diff --git a/dist/assets/browser-BIVCoTGd.js b/dist/assets/browser-BIVCoTGd.js deleted file mode 100644 index 87fa30bb..00000000 --- a/dist/assets/browser-BIVCoTGd.js +++ /dev/null @@ -1 +0,0 @@ -import{g as e}from"./index-BWM6VT11.js";var o=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")};const r=e(o),s=Object.freeze(Object.defineProperty({__proto__:null,default:r},Symbol.toStringTag,{value:"Module"}));export{s as b}; diff --git a/dist/assets/ccip-vR6lDjN0.js b/dist/assets/ccip-vR6lDjN0.js deleted file mode 100644 index 095457fb..00000000 --- a/dist/assets/ccip-vR6lDjN0.js +++ /dev/null @@ -1 +0,0 @@ -import{B as l,a as m,s as y,d as k,i as b,c as O,b as E,e as L,H as h,f as x}from"./index-BWM6VT11.js";class M extends l{constructor({callbackSelector:r,cause:a,data:o,extraData:i,sender:d,urls:t}){var n;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(n=a.metaMessages)!=null&&n.length?"":[],"Offchain Gateway Call:",t&&[" Gateway URL(s):",...t.map(f=>` ${m(f)}`)],` Sender: ${d}`,` Data: ${o}`,` Callback selector: ${r}`,` Extra data: ${i}`].flat(),name:"OffchainLookupError"})}}class R extends l{constructor({result:r,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${m(a)}`,`Response: ${y(r)}`],name:"OffchainLookupResponseMalformedError"})}}class S extends l{constructor({sender:r,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${r}`],name:"OffchainLookupSenderMismatchError"})}}const A="0x556f1830",$={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(c,{blockNumber:r,blockTag:a,data:o,to:i}){const{args:d}=k({data:o,abi:[$]}),[t,n,f,u,s]=d,{ccipRead:e}=c,w=e&&typeof(e==null?void 0:e.request)=="function"?e.request:T;try{if(!b(i,t))throw new S({sender:t,to:i});const p=await w({data:f,sender:t,urls:n}),{data:g}=await O(c,{blockNumber:r,blockTag:a,data:E([u,L([{type:"bytes"},{type:"bytes"}],[p,s])]),to:i});return g}catch(p){throw new M({callbackSelector:u,cause:p,data:o,extraData:s,sender:t,urls:n})}}async function T({data:c,sender:r,urls:a}){var i;let o=new Error("An unknown error occurred.");for(let d=0;di.map(i=>d[i]); -import{_ as pe}from"./index-BWM6VT11.js";const me=Symbol(),ee=Object.getPrototypeOf,Z=new WeakMap,he=e=>e&&(Z.has(e)?Z.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,te=(e,t=!0)=>{Z.set(e,t)},z={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_AIRSTACK_API_KEY:"11a2f10c73cbd4ab6852b491cb5bffc98",VITE_ALCHEMY_API_KEY:"YH6oiAhpnqmgsVhC2bPIidBJl2CodK2E",VITE_ETHERSCAN_API_KEY:"ARAH4STGURHGEZUS4V3AU87GINMR7A8FGR",VITE_GIPHY_API_KEY:"Jnts5ON1nVuxfzGEZCGl5jwGE7pWRPXo",VITE_PRIVY_APP_ID:"cm5efrcwb07p1f1s686uuvsug",VITE_SUPABASE_ANON_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJ1YmZ0cGF0b2p3Y2ZrdXByanNrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzU4MzU4MjQsImV4cCI6MjA1MTQxMTgyNH0.WrKq9CI5QEFmZah8RSZywnbuMshLKzRJOOWJkNm33XM",VITE_SUPABASE_URL:"https://bubftpatojwcfkuprjsk.supabase.co"},H=e=>typeof e=="object"&&e!==null,W=new WeakMap,x=new WeakSet,Ie=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>H(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,v=n)=>{const y=l.get(o);if((y==null?void 0:y[0])===g)return y[1];const b=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(b,!0),l.set(o,[g,b]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(b,j))return;const O=Reflect.get(o,j),P={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete P.value,P.get=()=>v(O);else if(W.has(O)){const[I,J]=W.get(O);P.value=c(I,J(),v)}Object.defineProperty(b,j,P)}),Object.preventExtensions(b)},d=new WeakMap,f=[1,1],C=o=>{if(!H(o))throw new Error("object required");const g=d.get(o);if(g)return g;let v=f[0];const y=new Set,b=(a,i=++f[0])=>{v!==i&&(v=i,y.forEach(r=>r(a,i)))};let j=f[1];const O=(a=++f[1])=>(j!==a&&!y.size&&(j=a,I.forEach(([i])=>{const r=i[1](a);r>v&&(v=r)})),v),P=a=>(i,r)=>{const h=[...i];h[1]=[a,...h[1]],b(h,r)},I=new Map,J=(a,i)=>{if((z?"production":void 0)!=="production"&&I.has(a))throw new Error("prop listener already exists");if(y.size){const r=i[3](P(a));I.set(a,[i,r])}else I.set(a,[i])},Q=a=>{var i;const r=I.get(a);r&&(I.delete(a),(i=r[1])==null||i.call(r))},ue=a=>(y.add(a),y.size===1&&I.forEach(([r,h],T)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const N=r[3](P(T));I.set(T,[r,N])}),()=>{y.delete(a),y.size===0&&I.forEach(([r,h],T)=>{h&&(h(),I.set(T,[r]))})}),Y=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),$=t(Y,{deleteProperty(a,i){const r=Reflect.get(a,i);Q(i);const h=Reflect.deleteProperty(a,i);return h&&b(["delete",[i],r]),h},set(a,i,r,h){const T=Reflect.has(a,i),N=Reflect.get(a,i,h);if(T&&(e(N,r)||d.has(r)&&e(N,d.get(r))))return!0;Q(i),H(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(A=>{r.status="fulfilled",r.value=A,b(["resolve",[i],A])}).catch(A=>{r.status="rejected",r.reason=A,b(["reject",[i],A])});else{!W.has(r)&&s(r)&&(V=C(r));const A=!x.has(V)&&W.get(V);A&&J(i,A)}return Reflect.set(a,i,V,h),b(["set",[i],r,N]),!0}});d.set(o,$);const fe=[Y,O,c,ue];return W.set($,fe),Reflect.ownKeys(o).forEach(a=>{const i=Object.getOwnPropertyDescriptor(o,a);"value"in i&&($[a]=o[a],delete i.value,delete i.writable),Object.defineProperty(Y,a,i)}),$})=>[C,W,x,e,t,s,n,l,c,d,f],[ye]=Ie();function L(e={}){return ye(e)}function U(e,t,s){const n=W.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function be(e,t){const s=W.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=L({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return U(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={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 m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.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},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=Buffer.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.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(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}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}},_e=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=L({enabled:_e,userSessionId:"",events:[],connectedWalletId:void 0}),ve={state:p,subscribe(e){return U(p.events,()=>e(be(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},w=L({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),_={state:w,subscribe(e){return U(w,()=>e(w))},setChains(e){w.chains=e},setWalletConnectUri(e){w.walletConnectUri=e},setIsCustomDesktop(e){w.isCustomDesktop=e},setIsCustomMobile(e){w.isCustomMobile=e},setIsDataLoaded(e){w.isDataLoaded=e},setIsUiLoaded(e){w.isUiLoaded=e},setIsAuth(e){w.isAuth=e}},K=L({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}),R={state:K,subscribe(e){return U(K,()=>e(K))},setConfig(e){var t,s;ve.initialize(),_.setChains(e.chains),_.setIsAuth(!!e.enableAuthMode),_.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),_.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(K,e)}};var we=Object.defineProperty,se=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ce=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&ne(e,s,t[s]);return e};const F="https://explorer-api.walletconnect.com",X="wcm",q="js-2.7.0";async function B(e,t){const s=Ce({sdkType:X,sdkVersion:q},t),n=new URL(e,F);return n.searchParams.append("projectId",R.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const M={async getDesktopListings(e){return B("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return B("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return B("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return B("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${F}/w3m/v1/getWalletImage/${e}?projectId=${R.state.projectId}&sdkType=${X}&sdkVersion=${q}`},getAssetImageUrl(e){return`${F}/w3m/v1/getAssetImage/${e}?projectId=${R.state.projectId}&sdkType=${X}&sdkVersion=${q}`}};var Ae=Object.defineProperty,oe=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Pe=(e,t)=>{for(var s in t||(t={}))We.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Le.call(t,s)&&re(e,s,t[s]);return e};const ie=m.isMobile(),E=L({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ke={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=R.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await M.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const C=e.indexOf(d.id),o=e.indexOf(f.id);return C-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=_.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ie?await M.getMobileListings(d):await M.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Pe({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=R.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(v=>v.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),_.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:C}=ie?await M.getMobileListings(t):await M.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:C,page:c??1},{listings:o,total:C}},getWalletImageUrl(e){return M.getWalletImageUrl(e)},getAssetImageUrl(e){return M.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},D=L({open:!1}),G={state:D,subscribe(e){return U(D,()=>e(D))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=_.state;if(m.removeWalletConnectDeepLink(),_.setWalletConnectUri(e==null?void 0:e.uri),_.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)D.open=!0,t();else{const l=setInterval(()=>{const c=_.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),D.open=!0,t())},200)}})},close(){D.open=!1}};var Me=Object.defineProperty,ae=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&le(e,s,t[s]);if(ae)for(var s of ae(t))Ue.call(t,s)&&le(e,s,t[s]);return e};function Te(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const k=L({themeMode:Te()?"dark":"light"}),ce={state:k,subscribe(e){return U(k,()=>e(k))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(k.themeMode=t),s&&(k.themeVariables=je({},s))}},S=L({open:!1,message:"",variant:"success"}),$e={state:S,subscribe(e){return U(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class De{constructor(t){this.openModal=G.open,this.closeModal=G.close,this.subscribeModal=G.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),R.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-ClL5f3IO.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),_.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:De},Symbol.toStringTag,{value:"Module"}));export{m as C,ke as E,G as M,_ as O,de as R,ce as T,$e as a,ve as b,R as c,Ve as i}; diff --git a/dist/assets/index-BWM6VT11.js b/dist/assets/index-BWM6VT11.js deleted file mode 100644 index 8706139c..00000000 --- a/dist/assets/index-BWM6VT11.js +++ /dev/null @@ -1,614 +0,0 @@ -function Nge(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 a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var Xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yh(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 cV={exports:{}},K8={},uV={exports:{}},Pr={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var x3=Symbol.for("react.element"),Lge=Symbol.for("react.portal"),jge=Symbol.for("react.fragment"),$ge=Symbol.for("react.strict_mode"),Pge=Symbol.for("react.profiler"),Rge=Symbol.for("react.provider"),Dge=Symbol.for("react.context"),Oge=Symbol.for("react.forward_ref"),Fge=Symbol.for("react.suspense"),Uge=Symbol.for("react.memo"),Bge=Symbol.for("react.lazy"),eD=Symbol.iterator;function zge(t){return t===null||typeof t!="object"?null:(t=eD&&t[eD]||t["@@iterator"],typeof t=="function"?t:null)}var dV={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fV=Object.assign,hV={};function gm(t,e,r){this.props=t,this.context=e,this.refs=hV,this.updater=r||dV}gm.prototype.isReactComponent={};gm.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")};gm.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function pV(){}pV.prototype=gm.prototype;function _k(t,e,r){this.props=t,this.context=e,this.refs=hV,this.updater=r||dV}var Ck=_k.prototype=new pV;Ck.constructor=_k;fV(Ck,gm.prototype);Ck.isPureReactComponent=!0;var tD=Array.isArray,gV=Object.prototype.hasOwnProperty,Sk={current:null},mV={key:!0,ref:!0,__self:!0,__source:!0};function yV(t,e,r){var n,i={},a=null,s=null;if(e!=null)for(n in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(a=""+e.key),e)gV.call(e,n)&&!mV.hasOwnProperty(n)&&(i[n]=e[n]);var o=arguments.length-2;if(o===1)i.children=r;else if(1>>1,$=P[D];if(0>>1;Di(H,M))ee<$&&0>i(J,H)?(P[D]=J,P[ee]=M,D=ee):(P[D]=H,P[le]=M,D=le);else if(ee<$&&0>i(J,M))P[D]=J,P[ee]=M,D=ee;else break e}}return R}function i(P,R){var M=P.sortIndex-R.sortIndex;return M!==0?M:P.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],c=[],u=1,f=null,h=3,g=!1,m=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,v=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 A(P){for(var R=r(c);R!==null;){if(R.callback===null)n(c);else if(R.startTime<=P)n(c),R.sortIndex=R.expirationTime,e(l,R);else break;R=r(c)}}function S(P){if(w=!1,A(P),!m)if(r(l)!==null)m=!0,L(j);else{var R=r(c);R!==null&&O(S,R.startTime-P)}}function j(P,R){m=!1,w&&(w=!1,v(B),B=-1),g=!0;var M=h;try{for(A(R),f=r(l);f!==null&&(!(f.expirationTime>R)||P&&!Y());){var D=f.callback;if(typeof D=="function"){f.callback=null,h=f.priorityLevel;var $=D(f.expirationTime<=R);R=t.unstable_now(),typeof $=="function"?f.callback=$:f===r(l)&&n(l),A(R)}else n(l);f=r(l)}if(f!==null)var X=!0;else{var le=r(c);le!==null&&O(S,le.startTime-R),X=!1}return X}finally{f=null,h=M,g=!1}}var U=!1,I=null,B=-1,V=5,se=-1;function Y(){return!(t.unstable_now()-seP||125D?(P.sortIndex=M,e(c,P),r(l)===null&&P===r(c)&&(w?(v(B),B=-1):w=!0,O(S,M-D))):(P.sortIndex=$,e(l,P),m||g||(m=!0,L(j))),P},t.unstable_shouldYield=Y,t.unstable_wrapCallback=function(P){var R=h;return function(){var M=h;h=R;try{return P.apply(this,arguments)}finally{h=M}}}})(EV);xV.exports=EV;var Xge=xV.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var eme=E,To=Xge;function at(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"),PA=Object.prototype.hasOwnProperty,tme=/^[: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]*$/,nD={},iD={};function rme(t){return PA.call(iD,t)?!0:PA.call(nD,t)?!1:tme.test(t)?iD[t]=!0:(nD[t]=!0,!1)}function nme(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 ime(t,e,r,n){if(e===null||typeof e>"u"||nme(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 ps(t,e,r,n,i,a,s){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=a,this.removeEmptyString=s}var va={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){va[t]=new ps(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];va[e]=new ps(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){va[t]=new ps(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){va[t]=new ps(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){va[t]=new ps(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){va[t]=new ps(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){va[t]=new ps(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){va[t]=new ps(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){va[t]=new ps(t,5,!1,t.toLowerCase(),null,!1,!1)});var Ik=/[\-:]([a-z])/g;function Mk(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(Ik,Mk);va[e]=new ps(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(Ik,Mk);va[e]=new ps(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(Ik,Mk);va[e]=new ps(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){va[t]=new ps(t,1,!1,t.toLowerCase(),null,!1,!1)});va.xlinkHref=new ps("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){va[t]=new ps(t,1,!1,t.toLowerCase(),null,!0,!0)});function Tk(t,e,r,n){var i=va.hasOwnProperty(e)?va[e]:null;(i!==null?i.type!==0:n||!(2o||i[s]!==a[o]){var l=` -`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=o);break}}}finally{T_=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?sy(t):""}function ame(t){switch(t.tag){case 5:return sy(t.type);case 16:return sy("Lazy");case 13:return sy("Suspense");case 19:return sy("SuspenseList");case 0:case 2:case 15:return t=k_(t.type,!1),t;case 11:return t=k_(t.type.render,!1),t;case 1:return t=k_(t.type,!0),t;default:return""}}function FA(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 Dp:return"Fragment";case Rp:return"Portal";case RA:return"Profiler";case kk:return"StrictMode";case DA:return"Suspense";case OA:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case SV:return(t.displayName||"Context")+".Consumer";case CV:return(t._context.displayName||"Context")+".Provider";case Nk:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Lk:return e=t.displayName||null,e!==null?e:FA(t.type)||"Memo";case If:e=t._payload,t=t._init;try{return FA(t(e))}catch{}}return null}function sme(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 FA(e);case 8:return e===kk?"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 ih(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function IV(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function ome(t){var e=IV(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,a=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){n=""+s,a.call(this,s)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Yb(t){t._valueTracker||(t._valueTracker=ome(t))}function MV(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=IV(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function r5(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 UA(t,e){var r=e.checked;return Xn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function sD(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=ih(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 TV(t,e){e=e.checked,e!=null&&Tk(t,"checked",e,!1)}function BA(t,e){TV(t,e);var r=ih(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")?zA(t,e.type,r):e.hasOwnProperty("defaultValue")&&zA(t,e.type,ih(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function oD(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 zA(t,e,r){(e!=="number"||r5(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var oy=Array.isArray;function ig(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Kb.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function tw(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Cy={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},lme=["Webkit","ms","Moz","O"];Object.keys(Cy).forEach(function(t){lme.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Cy[e]=Cy[t]})});function jV(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Cy.hasOwnProperty(t)&&Cy[t]?(""+e).trim():e+"px"}function $V(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=jV(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var cme=Xn({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 GA(t,e){if(e){if(cme[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(at(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(at(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(at(61))}if(e.style!=null&&typeof e.style!="object")throw Error(at(62))}}function qA(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 VA=null;function jk(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var YA=null,ag=null,sg=null;function uD(t){if(t=C3(t)){if(typeof YA!="function")throw Error(at(280));var e=t.stateNode;e&&(e=e9(e),YA(t.stateNode,t.type,e))}}function PV(t){ag?sg?sg.push(t):sg=[t]:ag=t}function RV(){if(ag){var t=ag,e=sg;if(sg=ag=null,uD(t),e)for(t=0;t>>=0,t===0?32:31-(bme(t)/xme|0)|0}var Jb=64,Qb=4194304;function ly(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 s5(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,a=t.pingedLanes,s=r&268435455;if(s!==0){var o=s&~i;o!==0?n=ly(o):(a&=s,a!==0&&(n=ly(a)))}else s=r&~i,s!==0?n=ly(s):a!==0&&(n=ly(a));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,a=e&-e,i>=a||i===16&&(a&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 E3(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-cc(e),t[e]=r}function Sme(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=Ay),vD=" ",bD=!1;function rY(t,e){switch(t){case"keyup":return Xme.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nY(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Op=!1;function t2e(t,e){switch(t){case"compositionend":return nY(e);case"keypress":return e.which!==32?null:(bD=!0,vD);case"textInput":return t=e.data,t===vD&&bD?null:t;default:return null}}function r2e(t,e){if(Op)return t==="compositionend"||!Bk&&rY(t,e)?(t=eY(),o6=Ok=Of=null,Op=!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=CD(r)}}function oY(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?oY(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function lY(){for(var t=window,e=r5();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=r5(t.document)}return e}function zk(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 d2e(t){var e=lY(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&oY(r.ownerDocument.documentElement,r)){if(n!==null&&zk(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,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!t.extend&&a>n&&(i=n,n=a,a=i),i=SD(r,a);var s=SD(r,n);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),a>n?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.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,Fp=null,eI=null,My=null,tI=!1;function AD(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;tI||Fp==null||Fp!==r5(n)||(n=Fp,"selectionStart"in n&&zk(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}),My&&ow(My,n)||(My=n,n=c5(eI,"onSelect"),0zp||(t.current=oI[zp],oI[zp]=null,zp--)}function An(t,e){zp++,oI[zp]=t.current,t.current=e}var ah={},Wa=vh(ah),Bs=vh(!1),B0=ah;function Mg(t,e){var r=t.type.contextTypes;if(!r)return ah;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=e[a];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function zs(t){return t=t.childContextTypes,t!=null}function d5(){Rn(Bs),Rn(Wa)}function jD(t,e,r){if(Wa.current!==ah)throw Error(at(168));An(Wa,e),An(Bs,r)}function yY(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(at(108,sme(t)||"Unknown",i));return Xn({},r,n)}function f5(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ah,B0=Wa.current,An(Wa,t),An(Bs,Bs.current),!0}function $D(t,e,r){var n=t.stateNode;if(!n)throw Error(at(169));r?(t=yY(t,e,B0),n.__reactInternalMemoizedMergedChildContext=t,Rn(Bs),Rn(Wa),An(Wa,t)):Rn(Bs),An(Bs,r)}var pd=null,t9=!1,H_=!1;function wY(t){pd===null?pd=[t]:pd.push(t)}function _2e(t){t9=!0,wY(t)}function bh(){if(!H_&&pd!==null){H_=!0;var t=0,e=un;try{var r=pd;for(un=1;t>=s,i-=s,Cd=1<<32-cc(e)+i|r<B?(V=I,I=null):V=I.sibling;var se=h(v,I,A[B],S);if(se===null){I===null&&(I=V);break}t&&I&&se.alternate===null&&e(v,I),b=a(se,b,B),U===null?j=se:U.sibling=se,U=se,I=V}if(B===A.length)return r(v,I),Un&&s0(v,B),j;if(I===null){for(;BB?(V=I,I=null):V=I.sibling;var Y=h(v,I,se.value,S);if(Y===null){I===null&&(I=V);break}t&&I&&Y.alternate===null&&e(v,I),b=a(Y,b,B),U===null?j=Y:U.sibling=Y,U=Y,I=V}if(se.done)return r(v,I),Un&&s0(v,B),j;if(I===null){for(;!se.done;B++,se=A.next())se=f(v,se.value,S),se!==null&&(b=a(se,b,B),U===null?j=se:U.sibling=se,U=se);return Un&&s0(v,B),j}for(I=n(v,I);!se.done;B++,se=A.next())se=g(I,v,B,se.value,S),se!==null&&(t&&se.alternate!==null&&I.delete(se.key===null?B:se.key),b=a(se,b,B),U===null?j=se:U.sibling=se,U=se);return t&&I.forEach(function(N){return e(v,N)}),Un&&s0(v,B),j}function C(v,b,A,S){if(typeof A=="object"&&A!==null&&A.type===Dp&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case Vb:e:{for(var j=A.key,U=b;U!==null;){if(U.key===j){if(j=A.type,j===Dp){if(U.tag===7){r(v,U.sibling),b=i(U,A.props.children),b.return=v,v=b;break e}}else if(U.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===If&&DD(j)===U.type){r(v,U.sibling),b=i(U,A.props),b.ref=T2(v,U,A),b.return=v,v=b;break e}r(v,U);break}else e(v,U);U=U.sibling}A.type===Dp?(b=T0(A.props.children,v.mode,S,A.key),b.return=v,v=b):(S=g6(A.type,A.key,A.props,null,v.mode,S),S.ref=T2(v,b,A),S.return=v,v=S)}return s(v);case Rp:e:{for(U=A.key;b!==null;){if(b.key===U)if(b.tag===4&&b.stateNode.containerInfo===A.containerInfo&&b.stateNode.implementation===A.implementation){r(v,b.sibling),b=i(b,A.children||[]),b.return=v,v=b;break e}else{r(v,b);break}else e(v,b);b=b.sibling}b=Z_(A,v.mode,S),b.return=v,v=b}return s(v);case If:return U=A._init,C(v,b,U(A._payload),S)}if(oy(A))return m(v,b,A,S);if(C2(A))return w(v,b,A,S);i4(v,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,b!==null&&b.tag===6?(r(v,b.sibling),b=i(b,A),b.return=v,v=b):(r(v,b),b=Q_(A,v.mode,S),b.return=v,v=b),s(v)):r(v,b)}return C}var kg=EY(!0),_Y=EY(!1),g5=vh(null),m5=null,Gp=null,qk=null;function Vk(){qk=Gp=m5=null}function Yk(t){var e=g5.current;Rn(g5),t._currentValue=e}function uI(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function lg(t,e){m5=t,qk=Gp=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Fs=!0),t.firstContext=null)}function yl(t){var e=t._currentValue;if(qk!==t)if(t={context:t,memoizedValue:e,next:null},Gp===null){if(m5===null)throw Error(at(308));Gp=t,m5.dependencies={lanes:0,firstContext:t}}else Gp=Gp.next=t;return e}var b0=null;function Kk(t){b0===null?b0=[t]:b0.push(t)}function CY(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,Kk(e)):(r.next=i.next,i.next=r),e.interleaved=r,Pd(t,n)}function Pd(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Mf=!1;function Jk(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function SY(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function kd(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Jf(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Jr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,Pd(t,r)}return i=n.interleaved,i===null?(e.next=e,Kk(n)):(e.next=i.next,i.next=e),n.interleaved=e,Pd(t,r)}function c6(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Pk(t,r)}}function OD(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=s:a=a.next=s,r=r.next}while(r!==null);a===null?i=a=e:a=a.next=e}else i=a=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function y5(t,e,r,n){var i=t.updateQueue;Mf=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,s===null?a=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==s&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(a!==null){var f=i.baseState;s=0,u=c=l=null,o=a;do{var h=o.lane,g=o.eventTime;if((n&h)===h){u!==null&&(u=u.next={eventTime:g,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=t,w=o;switch(h=e,g=r,w.tag){case 1:if(m=w.payload,typeof m=="function"){f=m.call(g,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=w.payload,h=typeof m=="function"?m.call(g,f,h):m,h==null)break e;f=Xn({},f,h);break e;case 2:Mf=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[o]:h.push(o))}else g={eventTime:g,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=g,l=f):u=u.next=g,s|=h;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else a===null&&(i.shared.lanes=0);H0|=s,t.lanes=s,t.memoizedState=f}}function FD(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=q_.transition;q_.transition={};try{t(!1),e()}finally{un=r,q_.transition=n}}function zY(){return wl().memoizedState}function I2e(t,e,r){var n=Zf(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},WY(t))HY(e,r);else if(r=CY(t,e,r,n),r!==null){var i=ls();uc(r,t,n,i),GY(r,e,n)}}function M2e(t,e,r){var n=Zf(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(WY(t))HY(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,o=a(s,r);if(i.hasEagerState=!0,i.eagerState=o,yc(o,s)){var l=e.interleaved;l===null?(i.next=i,Kk(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=CY(t,e,i,n),r!==null&&(i=ls(),uc(r,t,n,i),GY(r,e,n))}}function WY(t){var e=t.alternate;return t===Qn||e!==null&&e===Qn}function HY(t,e){Ty=v5=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function GY(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Pk(t,r)}}var b5={readContext:yl,useCallback:Aa,useContext:Aa,useEffect:Aa,useImperativeHandle:Aa,useInsertionEffect:Aa,useLayoutEffect:Aa,useMemo:Aa,useReducer:Aa,useRef:Aa,useState:Aa,useDebugValue:Aa,useDeferredValue:Aa,useTransition:Aa,useMutableSource:Aa,useSyncExternalStore:Aa,useId:Aa,unstable_isNewReconciler:!1},T2e={readContext:yl,useCallback:function(t,e){return Vc().memoizedState=[t,e===void 0?null:e],t},useContext:yl,useEffect:BD,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,d6(4194308,4,DY.bind(null,e,t),r)},useLayoutEffect:function(t,e){return d6(4194308,4,t,e)},useInsertionEffect:function(t,e){return d6(4,2,t,e)},useMemo:function(t,e){var r=Vc();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Vc();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=I2e.bind(null,Qn,t),[n.memoizedState,t]},useRef:function(t){var e=Vc();return t={current:t},e.memoizedState=t},useState:UD,useDebugValue:iN,useDeferredValue:function(t){return Vc().memoizedState=t},useTransition:function(){var t=UD(!1),e=t[0];return t=A2e.bind(null,t[1]),Vc().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Qn,i=Vc();if(Un){if(r===void 0)throw Error(at(407));r=r()}else{if(r=e(),na===null)throw Error(at(349));W0&30||TY(n,e,r)}i.memoizedState=r;var a={value:r,getSnapshot:e};return i.queue=a,BD(NY.bind(null,n,a,t),[t]),n.flags|=2048,gw(9,kY.bind(null,n,a,r,e),void 0,null),r},useId:function(){var t=Vc(),e=na.identifierPrefix;if(Un){var r=Sd,n=Cd;r=(n&~(1<<32-cc(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=hw++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=s.createElement(r,{is:n.is}):(t=s.createElement(r),r==="select"&&(s=t,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):t=s.createElementNS(t,r),t[tu]=e,t[uw]=n,tK(t,e,!1,!1),e.stateNode=t;e:{switch(s=qA(r,n),r){case"dialog":jn("cancel",t),jn("close",t),i=n;break;case"iframe":case"object":case"embed":jn("load",t),i=n;break;case"video":case"audio":for(i=0;ijg&&(e.flags|=128,n=!0,k2(a,!1),e.lanes=4194304)}else{if(!n)if(t=w5(s),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),k2(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Un)return Ia(e),null}else 2*gi()-a.renderingStartTime>jg&&r!==1073741824&&(e.flags|=128,n=!0,k2(a,!1),e.lanes=4194304);a.isBackwards?(s.sibling=e.child,e.child=s):(r=a.last,r!==null?r.sibling=s:e.child=s,a.last=s)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=gi(),e.sibling=null,r=Kn.current,An(Kn,n?r&1|2:r&1),e):(Ia(e),null);case 22:case 23:return uN(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?go&1073741824&&(Ia(e),e.subtreeFlags&6&&(e.flags|=8192)):Ia(e),null;case 24:return null;case 25:return null}throw Error(at(156,e.tag))}function D2e(t,e){switch(Hk(e),e.tag){case 1:return zs(e.type)&&d5(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ng(),Rn(Bs),Rn(Wa),Xk(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Zk(e),null;case 13:if(Rn(Kn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(at(340));Tg()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Rn(Kn),null;case 4:return Ng(),null;case 10:return Yk(e.type._context),null;case 22:case 23:return uN(),null;case 24:return null;default:return null}}var s4=!1,ja=!1,O2e=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function qp(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ii(t,e,n)}else r.current=null}function vI(t,e,r){try{r()}catch(n){ii(t,e,n)}}var ZD=!1;function F2e(t,e){if(rI=o5,t=lY(),zk(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,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var s=0,o=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var g;f!==r||i!==0&&f.nodeType!==3||(o=s+i),f!==a||n!==0&&f.nodeType!==3||(l=s+n),f.nodeType===3&&(s+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===t)break t;if(h===r&&++c===i&&(o=s),h===a&&++u===n&&(l=s),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(nI={focusedElem:t,selectionRange:r},o5=!1,Tt=e;Tt!==null;)if(e=Tt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Tt=t;else for(;Tt!==null;){e=Tt;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var w=m.memoizedProps,C=m.memoizedState,v=e.stateNode,b=v.getSnapshotBeforeUpdate(e.elementType===e.type?w:Jl(e.type,w),C);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var A=e.stateNode.containerInfo;A.nodeType===1?A.textContent="":A.nodeType===9&&A.documentElement&&A.removeChild(A.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(at(163))}}catch(S){ii(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,Tt=t;break}Tt=e.return}return m=ZD,ZD=!1,m}function ky(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 a=i.destroy;i.destroy=void 0,a!==void 0&&vI(e,r,a)}i=i.next}while(i!==n)}}function i9(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 bI(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 iK(t){var e=t.alternate;e!==null&&(t.alternate=null,iK(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[tu],delete e[uw],delete e[sI],delete e[x2e],delete e[E2e])),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 aK(t){return t.tag===5||t.tag===3||t.tag===4}function XD(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||aK(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 xI(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=u5));else if(n!==4&&(t=t.child,t!==null))for(xI(t,e,r),t=t.sibling;t!==null;)xI(t,e,r),t=t.sibling}function EI(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(EI(t,e,r),t=t.sibling;t!==null;)EI(t,e,r),t=t.sibling}var ma=null,Zl=!1;function mf(t,e,r){for(r=r.child;r!==null;)sK(t,e,r),r=r.sibling}function sK(t,e,r){if(uu&&typeof uu.onCommitFiberUnmount=="function")try{uu.onCommitFiberUnmount(J8,r)}catch{}switch(r.tag){case 5:ja||qp(r,e);case 6:var n=ma,i=Zl;ma=null,mf(t,e,r),ma=n,Zl=i,ma!==null&&(Zl?(t=ma,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):ma.removeChild(r.stateNode));break;case 18:ma!==null&&(Zl?(t=ma,r=r.stateNode,t.nodeType===8?W_(t.parentNode,r):t.nodeType===1&&W_(t,r),aw(t)):W_(ma,r.stateNode));break;case 4:n=ma,i=Zl,ma=r.stateNode.containerInfo,Zl=!0,mf(t,e,r),ma=n,Zl=i;break;case 0:case 11:case 14:case 15:if(!ja&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&vI(r,e,s),i=i.next}while(i!==n)}mf(t,e,r);break;case 1:if(!ja&&(qp(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){ii(r,e,o)}mf(t,e,r);break;case 21:mf(t,e,r);break;case 22:r.mode&1?(ja=(n=ja)||r.memoizedState!==null,mf(t,e,r),ja=n):mf(t,e,r);break;default:mf(t,e,r)}}function eO(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new O2e),e.forEach(function(n){var i=Y2e.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Fl(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=s),n&=~a}if(n=i,n=gi()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*B2e(n/1960))-n,10t?16:t,Ff===null)var n=!1;else{if(t=Ff,Ff=null,_5=0,Jr&6)throw Error(at(331));var i=Jr;for(Jr|=4,Tt=t.current;Tt!==null;){var a=Tt,s=a.child;if(Tt.flags&16){var o=a.deletions;if(o!==null){for(var l=0;lgi()-lN?M0(t,0):oN|=r),Ws(t,e)}function pK(t,e){e===0&&(t.mode&1?(e=Qb,Qb<<=1,!(Qb&130023424)&&(Qb=4194304)):e=1);var r=ls();t=Pd(t,e),t!==null&&(E3(t,e,r),Ws(t,r))}function V2e(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),pK(t,r)}function Y2e(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(at(314))}n!==null&&n.delete(e),pK(t,r)}var gK;gK=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Bs.current)Fs=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Fs=!1,P2e(t,e,r);Fs=!!(t.flags&131072)}else Fs=!1,Un&&e.flags&1048576&&vY(e,p5,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;f6(t,e),t=e.pendingProps;var i=Mg(e,Wa.current);lg(e,r),i=tN(null,e,n,t,i,r);var a=rN();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,zs(n)?(a=!0,f5(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Jk(e),i.updater=n9,e.stateNode=i,i._reactInternals=e,fI(e,n,t,r),e=gI(null,e,n,!0,a,r)):(e.tag=0,Un&&a&&Wk(e),Za(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(f6(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=J2e(n),t=Jl(n,t),i){case 0:e=pI(null,e,n,t,r);break e;case 1:e=KD(null,e,n,t,r);break e;case 11:e=VD(null,e,n,t,r);break e;case 14:e=YD(null,e,n,Jl(n.type,t),r);break e}throw Error(at(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Jl(n,i),pI(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Jl(n,i),KD(t,e,n,i,r);case 3:e:{if(ZY(e),t===null)throw Error(at(387));n=e.pendingProps,a=e.memoizedState,i=a.element,SY(t,e),y5(e,n,null,r);var s=e.memoizedState;if(n=s.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=Lg(Error(at(423)),e),e=JD(t,e,n,r,i);break e}else if(n!==i){i=Lg(Error(at(424)),e),e=JD(t,e,n,r,i);break e}else for(xo=Kf(e.stateNode.containerInfo.firstChild),So=e,Un=!0,tc=null,r=_Y(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Tg(),n===i){e=Rd(t,e,r);break e}Za(t,e,n,r)}e=e.child}return e;case 5:return AY(e),t===null&&cI(e),n=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,s=i.children,iI(n,i)?s=null:a!==null&&iI(n,a)&&(e.flags|=32),QY(t,e),Za(t,e,s,r),e.child;case 6:return t===null&&cI(e),null;case 13:return XY(t,e,r);case 4:return Qk(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=kg(e,null,n,r):Za(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Jl(n,i),VD(t,e,n,i,r);case 7:return Za(t,e,e.pendingProps,r),e.child;case 8:return Za(t,e,e.pendingProps.children,r),e.child;case 12:return Za(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,a=e.memoizedProps,s=i.value,An(g5,n._currentValue),n._currentValue=s,a!==null)if(yc(a.value,s)){if(a.children===i.children&&!Bs.current){e=Rd(t,e,r);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){s=a.child;for(var l=o.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=kd(-1,r&-r),l.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),uI(a.return,r,e),o.lanes|=r;break}l=l.next}}else if(a.tag===10)s=a.type===e.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(at(341));s.lanes|=r,o=s.alternate,o!==null&&(o.lanes|=r),uI(s,r,e),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Za(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,lg(e,r),i=yl(i),n=n(i),e.flags|=1,Za(t,e,n,r),e.child;case 14:return n=e.type,i=Jl(n,e.pendingProps),i=Jl(n.type,i),YD(t,e,n,i,r);case 15:return KY(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Jl(n,i),f6(t,e),e.tag=1,zs(n)?(t=!0,f5(e)):t=!1,lg(e,r),qY(e,n,i),fI(e,n,i,r),gI(null,e,n,!0,t,r);case 19:return eK(t,e,r);case 22:return JY(t,e,r)}throw Error(at(156,e.tag))};function mK(t,e){return WV(t,e)}function K2e(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 dl(t,e,r,n){return new K2e(t,e,r,n)}function fN(t){return t=t.prototype,!(!t||!t.isReactComponent)}function J2e(t){if(typeof t=="function")return fN(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Nk)return 11;if(t===Lk)return 14}return 2}function Xf(t,e){var r=t.alternate;return r===null?(r=dl(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 g6(t,e,r,n,i,a){var s=2;if(n=t,typeof t=="function")fN(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Dp:return T0(r.children,i,a,e);case kk:s=8,i|=8;break;case RA:return t=dl(12,r,e,i|2),t.elementType=RA,t.lanes=a,t;case DA:return t=dl(13,r,e,i),t.elementType=DA,t.lanes=a,t;case OA:return t=dl(19,r,e,i),t.elementType=OA,t.lanes=a,t;case AV:return s9(r,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case CV:s=10;break e;case SV:s=9;break e;case Nk:s=11;break e;case Lk:s=14;break e;case If:s=16,n=null;break e}throw Error(at(130,t==null?t:typeof t,""))}return e=dl(s,r,e,i),e.elementType=t,e.type=n,e.lanes=a,e}function T0(t,e,r,n){return t=dl(7,t,n,e),t.lanes=r,t}function s9(t,e,r,n){return t=dl(22,t,n,e),t.elementType=AV,t.lanes=r,t.stateNode={isHidden:!1},t}function Q_(t,e,r){return t=dl(6,t,null,e),t.lanes=r,t}function Z_(t,e,r){return e=dl(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Q2e(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=L_(0),this.expirationTimes=L_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=L_(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hN(t,e,r,n,i,a,s,o,l){return t=new Q2e(t,e,r,o,l),e===1?(e=1,a===!0&&(e|=8)):e=0,a=dl(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jk(a),t}function Z2e(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bK)}catch(t){console.error(t)}}bK(),bV.exports=jo;var dc=bV.exports,xK,lO=dc;xK=lO.createRoot,lO.hydrateRoot;/** - * @remix-run/router v1.21.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function yw(){return yw=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function iye(){return Math.random().toString(36).substr(2,8)}function uO(t,e){return{usr:t.state,key:t.key,idx:e}}function II(t,e,r,n){return r===void 0&&(r=null),yw({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?d9(e):e,{state:r,key:e&&e.key||n||iye()})}function EK(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function d9(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function aye(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,s=i.history,o=E0.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(yw({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function f(){o=E0.Pop;let C=u(),v=C==null?null:C-c;c=C,l&&l({action:o,location:w.location,delta:v})}function h(C,v){o=E0.Push;let b=II(w.location,C,v);c=u()+1;let A=uO(b,c),S=w.createHref(b);try{s.pushState(A,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(S)}a&&l&&l({action:o,location:w.location,delta:1})}function g(C,v){o=E0.Replace;let b=II(w.location,C,v);c=u();let A=uO(b,c),S=w.createHref(b);s.replaceState(A,"",S),a&&l&&l({action:o,location:w.location,delta:0})}function m(C){let v=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof C=="string"?C:EK(C);return b=b.replace(/ $/,"%20"),fu(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let w={get action(){return o},get location(){return t(i,s)},listen(C){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(cO,f),l=C,()=>{i.removeEventListener(cO,f),l=null}},createHref(C){return e(i,C)},createURL:m,encodeLocation(C){let v=m(C);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:g,go(C){return s.go(C)}};return w}var dO;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(dO||(dO={}));function sye(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function oye(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?d9(t):t;return{pathname:r?r.startsWith("/")?r:lye(r,e):e,search:hye(n),hash:pye(i)}}function lye(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function X_(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function cye(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function uye(t,e){let r=cye(t);return e?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function dye(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=d9(t):(i=yw({},t),fu(!i.pathname||!i.pathname.includes("?"),X_("?","pathname","search",i)),fu(!i.pathname||!i.pathname.includes("#"),X_("#","pathname","hash",i)),fu(!i.search||!i.search.includes("#"),X_("#","search","hash",i)));let a=t===""||i.pathname==="",s=a?"/":i.pathname,o;if(s==null)o=r;else{let f=e.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}o=f>=0?e[f]:"/"}let l=oye(i,o),c=s&&s!=="/"&&s.endsWith("/"),u=(a||s===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const fye=t=>t.join("/").replace(/\/\/+/g,"/"),hye=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,pye=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,_K=["post","put","patch","delete"];new Set(_K);const gye=["get",..._K];new Set(gye);/** - * React Router v6.28.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function A5(){return A5=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),E.useCallback(function(c,u){if(u===void 0&&(u={}),!o.current)return;if(typeof c=="number"){n.go(c);return}let f=dye(c,JSON.parse(s),a,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:fye([e,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[e,n,s,a,t])}var AK=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(AK||{}),IK=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(IK||{});function vye(t){let e=E.useContext(CK);return e||fu(!1),e}function bye(t){let e=E.useContext(vN);return e||fu(!1),e}function xye(t){let e=bye(),r=e.matches[e.matches.length-1];return r.route.id||fu(!1),r.route.id}function Eye(){let{router:t}=vye(AK.UseNavigateStable),e=xye(IK.UseNavigateStable),r=E.useRef(!1);return SK(()=>{r.current=!0}),E.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,A5({fromRouteId:e},a)))},[t,e])}const fO={};function _ye(t,e){fO[e]||(fO[e]=!0,console.warn(e))}const hO=(t,e,r)=>_ye(t,"⚠️ React Router Future Flag Warning: "+e+". "+("You can use the `"+t+"` future flag to opt-in early. ")+("For more information, see "+r+"."));function Cye(t,e){(t==null?void 0:t.v7_startTransition)===void 0&&hO("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),(t==null?void 0:t.v7_relativeSplatPath)===void 0&&!e&&hO("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function Sye(t){let{basename:e="/",children:r=null,location:n,navigationType:i=E0.Pop,navigator:a,static:s=!1,future:o}=t;bN()&&fu(!1);let l=e.replace(/^\/*/,"/"),c=E.useMemo(()=>({basename:l,navigator:a,static:s,future:A5({v7_relativeSplatPath:!1},o)}),[l,o,a,s]);typeof n=="string"&&(n=d9(n));let{pathname:u="/",search:f="",hash:h="",state:g=null,key:m="default"}=n,w=E.useMemo(()=>{let C=sye(u,l);return C==null?null:{location:{pathname:C,search:f,hash:h,state:g,key:m},navigationType:i}},[l,u,f,h,g,m,i]);return w==null?null:E.createElement(yN.Provider,{value:c},E.createElement(wN.Provider,{children:r,value:w}))}new Promise(()=>{});/** - * React Router DOM v6.28.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */const Aye="6";try{window.__reactRouterVersion=Aye}catch{}const Iye="startTransition",pO=t5[Iye];function Mye(t){let{basename:e,children:r,future:n,window:i}=t,a=E.useRef();a.current==null&&(a.current=nye({window:i,v5Compat:!0}));let s=a.current,[o,l]=E.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},u=E.useCallback(f=>{c&&pO?pO(()=>l(f)):l(f)},[l,c]);return E.useLayoutEffect(()=>s.listen(u),[s,u]),E.useEffect(()=>Cye(n),[n]),E.createElement(Sye,{basename:e,children:r,location:o.location,navigationType:o.action,navigator:s,future:n})}var gO;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(gO||(gO={}));var mO;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(mO||(mO={}));const Tye="modulepreload",kye=function(t){return"/"+t},yO={},qs=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(r.map(l=>{if(l=kye(l),l in yO)return;yO[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":Tye,c||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),c)return new Promise((h,g)=>{f.addEventListener("load",h),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})},Nye="logger/5.7.0";let wO=!1,vO=!1;const m6={debug:1,default:2,info:2,warning:3,error:4,off:5};let bO=m6.default,eC=null;function Lye(){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 xO=Lye();var MI;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(MI||(MI={}));var ka;(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"})(ka||(ka={}));const EO="0123456789abcdef";let De=class ki{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();m6[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(bO>m6[n])&&console.log.apply(console,r)}debug(...e){this._log(ki.levels.DEBUG,e)}info(...e){this._log(ki.levels.INFO,e)}warn(...e){this._log(ki.levels.WARNING,e)}makeError(e,r,n){if(vO)return this.makeError("censored error",r,{});r||(r=ki.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const c=n[l];try{if(c instanceof Uint8Array){let u="";for(let f=0;f>4],u+=EO[c[f]&15];i.push(l+"=Uint8Array(0x"+u+")")}else i.push(l+"="+JSON.stringify(c))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const a=e;let s="";switch(r){case ka.NUMERIC_FAULT:{s="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":s+="-"+l;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result";break}break}case ka.CALL_EXCEPTION:case ka.INSUFFICIENT_FUNDS:case ka.MISSING_NEW:case ka.NONCE_EXPIRED:case ka.REPLACEMENT_UNDERPRICED:case ka.TRANSACTION_REPLACED:case ka.UNPREDICTABLE_GAS_LIMIT:s=r;break}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const o=new Error(e);return o.reason=a,o.code=r,Object.keys(n).forEach(function(l){o[l]=n[l]}),o}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,ki.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){xO&&this.throwError("platform missing String.prototype.normalize",ki.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:xO})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,ki.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,ki.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,ki.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",ki.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",ki.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",ki.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return eC||(eC=new ki(Nye)),eC}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",ki.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),wO){if(!e)return;this.globalLogger().throwError("error censorship permanent",ki.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}vO=!!e,wO=!!r}static setLogLevel(e){const r=m6[e.toLowerCase()];if(r==null){ki.globalLogger().warn("invalid log level - "+e);return}bO=r}static from(e){return new ki(e)}};De.errors=ka;De.levels=MI;const jye="bytes/5.7.0",ni=new De(jye);function MK(t){return!!t.toHexString}function ug(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return ug(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function xN(t){return Kr(t)&&!(t.length%2)||wm(t)}function _O(t){return typeof t=="number"&&t==t&&t%1===0}function wm(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!_O(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function er(t,e){if(e||(e={}),typeof t=="number"){ni.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),ug(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),MK(t)&&(t=t.toHexString()),Kr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":ni.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ier(i)),r=e.reduce((i,a)=>i+a.length,0),n=new Uint8Array(r);return e.reduce((i,a)=>(n.set(a,i),i+a.length),0),ug(n)}function q0(t){let e=er(t);if(e.length===0)return e;let r=0;for(;re&&ni.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),ug(r)}function Kr(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const tC="0123456789abcdef";function Bt(t,e){if(e||(e={}),typeof t=="number"){ni.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=tC[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),MK(t))return t.toHexString();if(Kr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":ni.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(wm(t)){let r="0x";for(let n=0;n>4]+tC[i&15]}return r}return ni.throwArgumentError("invalid hexlify value","value",t)}function V0(t){if(typeof t!="string")t=Bt(t);else if(!Kr(t)||t.length%2)return null;return(t.length-2)/2}function Na(t,e,r){return typeof t!="string"?t=Bt(t):(!Kr(t)||t.length%2)&&ni.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Ds(t){let e="0x";return t.forEach(r=>{e+=Bt(r).substring(2)}),e}function EN(t){const e=Pye(Bt(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function Pye(t){typeof t!="string"&&(t=Bt(t)),Kr(t)||ni.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&ni.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function f9(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(xN(t)){let r=er(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Bt(r.slice(0,32)),e.s=Bt(r.slice(32,64))):r.length===65?(e.r=Bt(r.slice(0,32)),e.s=Bt(r.slice(32,64)),e.v=r[64]):ni.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:ni.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Bt(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=$ye(er(e._vs),32);e._vs=Bt(i);const a=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=a:e.recoveryParam!==a&&ni.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const s=Bt(i);e.s==null?e.s=s:e.s!==s&&ni.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?ni.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&&ni.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Kr(e.r)?ni.throwArgumentError("signature missing or invalid r","signature",t):e.r=Bn(e.r,32),e.s==null||!Kr(e.s)?ni.throwArgumentError("signature missing or invalid s","signature",t):e.s=Bn(e.s,32);const r=er(e.s);r[0]>=128&&ni.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=Bt(r);e._vs&&(Kr(e._vs)||ni.throwArgumentError("signature invalid _vs","signature",t),e._vs=Bn(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&ni.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}var _N={exports:{}};const Rye={},Dye=Object.freeze(Object.defineProperty({__proto__:null,default:Rye},Symbol.toStringTag,{value:"Module"})),vm=yh(Dye);_N.exports;(function(t){(function(e,r){function n(k,x){if(!k)throw new Error(x||"Assertion failed")}function i(k,x){k.super_=x;var _=function(){};_.prototype=x.prototype,k.prototype=new _,k.prototype.constructor=k}function a(k,x,_){if(a.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((x==="le"||x==="be")&&(_=x,x=10),this._init(k||0,x||10,_||"be"))}typeof e=="object"?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=vm.Buffer}catch{}a.isBN=function(x){return x instanceof a?!0:x!==null&&typeof x=="object"&&x.constructor.wordSize===a.wordSize&&Array.isArray(x.words)},a.max=function(x,_){return x.cmp(_)>0?x:_},a.min=function(x,_){return x.cmp(_)<0?x:_},a.prototype._init=function(x,_,L){if(typeof x=="number")return this._initNumber(x,_,L);if(typeof x=="object")return this._initArray(x,_,L);_==="hex"&&(_=16),n(_===(_|0)&&_>=2&&_<=36),x=x.toString().replace(/\s+/g,"");var O=0;x[0]==="-"&&(O++,this.negative=1),O=0;O-=3)R=x[O]|x[O-1]<<8|x[O-2]<<16,this.words[P]|=R<>>26-M&67108863,M+=24,M>=26&&(M-=26,P++);else if(L==="le")for(O=0,P=0;O>>26-M&67108863,M+=24,M>=26&&(M-=26,P++);return this._strip()};function o(k,x){var _=k.charCodeAt(x);if(_>=48&&_<=57)return _-48;if(_>=65&&_<=70)return _-55;if(_>=97&&_<=102)return _-87;n(!1,"Invalid character in "+k)}function l(k,x,_){var L=o(k,_);return _-1>=x&&(L|=o(k,_-1)<<4),L}a.prototype._parseHex=function(x,_,L){this.length=Math.ceil((x.length-_)/6),this.words=new Array(this.length);for(var O=0;O=_;O-=2)M=l(x,_,O)<=18?(P-=18,R+=1,this.words[R]|=M>>>26):P+=8;else{var D=x.length-_;for(O=D%2===0?_+1:_;O=18?(P-=18,R+=1,this.words[R]|=M>>>26):P+=8}this._strip()};function c(k,x,_,L){for(var O=0,P=0,R=Math.min(k.length,_),M=x;M=49?P=D-49+10:D>=17?P=D-17+10:P=D,n(D>=0&&P1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?""}var h=["","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"],g=[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],m=[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];a.prototype.toString=function(x,_){x=x||10,_=_|0||1;var L;if(x===16||x==="hex"){L="";for(var O=0,P=0,R=0;R>>24-O&16777215,O+=2,O>=26&&(O-=26,R--),P!==0||R!==this.length-1?L=h[6-D.length]+D+L:L=D+L}for(P!==0&&(L=P.toString(16)+L);L.length%_!==0;)L="0"+L;return this.negative!==0&&(L="-"+L),L}if(x===(x|0)&&x>=2&&x<=36){var $=g[x],X=m[x];L="";var le=this.clone();for(le.negative=0;!le.isZero();){var H=le.modrn(X).toString(x);le=le.idivn(X),le.isZero()?L=H+L:L=h[$-H.length]+H+L}for(this.isZero()&&(L="0"+L);L.length%_!==0;)L="0"+L;return this.negative!==0&&(L="-"+L),L}n(!1,"Base should be between 2 and 36")},a.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},a.prototype.toJSON=function(){return this.toString(16,2)},s&&(a.prototype.toBuffer=function(x,_){return this.toArrayLike(s,x,_)}),a.prototype.toArray=function(x,_){return this.toArrayLike(Array,x,_)};var w=function(x,_){return x.allocUnsafe?x.allocUnsafe(_):new x(_)};a.prototype.toArrayLike=function(x,_,L){this._strip();var O=this.byteLength(),P=L||Math.max(1,O);n(O<=P,"byte array longer than desired length"),n(P>0,"Requested array length <= 0");var R=w(x,P),M=_==="le"?"LE":"BE";return this["_toArrayLike"+M](R,O),R},a.prototype._toArrayLikeLE=function(x,_){for(var L=0,O=0,P=0,R=0;P>8&255),L>16&255),R===6?(L>24&255),O=0,R=0):(O=M>>>24,R+=2)}if(L=0&&(x[L--]=M>>8&255),L>=0&&(x[L--]=M>>16&255),R===6?(L>=0&&(x[L--]=M>>24&255),O=0,R=0):(O=M>>>24,R+=2)}if(L>=0)for(x[L--]=O;L>=0;)x[L--]=0},Math.clz32?a.prototype._countBits=function(x){return 32-Math.clz32(x)}:a.prototype._countBits=function(x){var _=x,L=0;return _>=4096&&(L+=13,_>>>=13),_>=64&&(L+=7,_>>>=7),_>=8&&(L+=4,_>>>=4),_>=2&&(L+=2,_>>>=2),L+_},a.prototype._zeroBits=function(x){if(x===0)return 26;var _=x,L=0;return _&8191||(L+=13,_>>>=13),_&127||(L+=7,_>>>=7),_&15||(L+=4,_>>>=4),_&3||(L+=2,_>>>=2),_&1||L++,L},a.prototype.bitLength=function(){var x=this.words[this.length-1],_=this._countBits(x);return(this.length-1)*26+_};function C(k){for(var x=new Array(k.bitLength()),_=0;_>>O&1}return x}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var x=0,_=0;_x.length?this.clone().ior(x):x.clone().ior(this)},a.prototype.uor=function(x){return this.length>x.length?this.clone().iuor(x):x.clone().iuor(this)},a.prototype.iuand=function(x){var _;this.length>x.length?_=x:_=this;for(var L=0;L<_.length;L++)this.words[L]=this.words[L]&x.words[L];return this.length=_.length,this._strip()},a.prototype.iand=function(x){return n((this.negative|x.negative)===0),this.iuand(x)},a.prototype.and=function(x){return this.length>x.length?this.clone().iand(x):x.clone().iand(this)},a.prototype.uand=function(x){return this.length>x.length?this.clone().iuand(x):x.clone().iuand(this)},a.prototype.iuxor=function(x){var _,L;this.length>x.length?(_=this,L=x):(_=x,L=this);for(var O=0;Ox.length?this.clone().ixor(x):x.clone().ixor(this)},a.prototype.uxor=function(x){return this.length>x.length?this.clone().iuxor(x):x.clone().iuxor(this)},a.prototype.inotn=function(x){n(typeof x=="number"&&x>=0);var _=Math.ceil(x/26)|0,L=x%26;this._expand(_),L>0&&_--;for(var O=0;O<_;O++)this.words[O]=~this.words[O]&67108863;return L>0&&(this.words[O]=~this.words[O]&67108863>>26-L),this._strip()},a.prototype.notn=function(x){return this.clone().inotn(x)},a.prototype.setn=function(x,_){n(typeof x=="number"&&x>=0);var L=x/26|0,O=x%26;return this._expand(L+1),_?this.words[L]=this.words[L]|1<x.length?(L=this,O=x):(L=x,O=this);for(var P=0,R=0;R>>26;for(;P!==0&&R>>26;if(this.length=L.length,P!==0)this.words[this.length]=P,this.length++;else if(L!==this)for(;Rx.length?this.clone().iadd(x):x.clone().iadd(this)},a.prototype.isub=function(x){if(x.negative!==0){x.negative=0;var _=this.iadd(x);return x.negative=1,_._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(x),this.negative=1,this._normSign();var L=this.cmp(x);if(L===0)return this.negative=0,this.length=1,this.words[0]=0,this;var O,P;L>0?(O=this,P=x):(O=x,P=this);for(var R=0,M=0;M>26,this.words[M]=_&67108863;for(;R!==0&&M>26,this.words[M]=_&67108863;if(R===0&&M>>26,le=D&67108863,H=Math.min($,x.length-1),ee=Math.max(0,$-k.length+1);ee<=H;ee++){var J=$-ee|0;O=k.words[J]|0,P=x.words[ee]|0,R=O*P+le,X+=R/67108864|0,le=R&67108863}_.words[$]=le|0,D=X|0}return D!==0?_.words[$]=D|0:_.length--,_._strip()}var b=function(x,_,L){var O=x.words,P=_.words,R=L.words,M=0,D,$,X,le=O[0]|0,H=le&8191,ee=le>>>13,J=O[1]|0,te=J&8191,re=J>>>13,z=O[2]|0,G=z&8191,Q=z>>>13,me=O[3]|0,be=me&8191,Ce=me>>>13,Fe=O[4]|0,Ue=Fe&8191,Ke=Fe>>>13,lt=O[5]|0,Ee=lt&8191,He=lt>>>13,qe=O[6]|0,Ie=qe&8191,Ne=qe>>>13,$e=O[7]|0,je=$e&8191,K=$e>>>13,F=O[8]|0,W=F&8191,ie=F>>>13,pe=O[9]|0,we=pe&8191,he=pe>>>13,Re=P[0]|0,Je=Re&8191,et=Re>>>13,it=P[1]|0,ut=it&8191,pt=it>>>13,tr=P[2]|0,zt=tr&8191,At=tr>>>13,mt=P[3]|0,St=mt&8191,dt=mt>>>13,Nt=P[4]|0,Rt=Nt&8191,gt=Nt>>>13,qt=P[5]|0,Wt=qt&8191,ot=qt>>>13,Vt=P[6]|0,Ft=Vt&8191,yt=Vt>>>13,Ze=P[7]|0,Pt=Ze&8191,xt=Ze>>>13,Jt=P[8]|0,Cr=Jt&8191,Gt=Jt>>>13,Sr=P[9]|0,cr=Sr&8191,br=Sr>>>13;L.negative=x.negative^_.negative,L.length=19,D=Math.imul(H,Je),$=Math.imul(H,et),$=$+Math.imul(ee,Je)|0,X=Math.imul(ee,et);var Z=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Z>>>26)|0,Z&=67108863,D=Math.imul(te,Je),$=Math.imul(te,et),$=$+Math.imul(re,Je)|0,X=Math.imul(re,et),D=D+Math.imul(H,ut)|0,$=$+Math.imul(H,pt)|0,$=$+Math.imul(ee,ut)|0,X=X+Math.imul(ee,pt)|0;var ae=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ae>>>26)|0,ae&=67108863,D=Math.imul(G,Je),$=Math.imul(G,et),$=$+Math.imul(Q,Je)|0,X=Math.imul(Q,et),D=D+Math.imul(te,ut)|0,$=$+Math.imul(te,pt)|0,$=$+Math.imul(re,ut)|0,X=X+Math.imul(re,pt)|0,D=D+Math.imul(H,zt)|0,$=$+Math.imul(H,At)|0,$=$+Math.imul(ee,zt)|0,X=X+Math.imul(ee,At)|0;var de=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(de>>>26)|0,de&=67108863,D=Math.imul(be,Je),$=Math.imul(be,et),$=$+Math.imul(Ce,Je)|0,X=Math.imul(Ce,et),D=D+Math.imul(G,ut)|0,$=$+Math.imul(G,pt)|0,$=$+Math.imul(Q,ut)|0,X=X+Math.imul(Q,pt)|0,D=D+Math.imul(te,zt)|0,$=$+Math.imul(te,At)|0,$=$+Math.imul(re,zt)|0,X=X+Math.imul(re,At)|0,D=D+Math.imul(H,St)|0,$=$+Math.imul(H,dt)|0,$=$+Math.imul(ee,St)|0,X=X+Math.imul(ee,dt)|0;var ue=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ue>>>26)|0,ue&=67108863,D=Math.imul(Ue,Je),$=Math.imul(Ue,et),$=$+Math.imul(Ke,Je)|0,X=Math.imul(Ke,et),D=D+Math.imul(be,ut)|0,$=$+Math.imul(be,pt)|0,$=$+Math.imul(Ce,ut)|0,X=X+Math.imul(Ce,pt)|0,D=D+Math.imul(G,zt)|0,$=$+Math.imul(G,At)|0,$=$+Math.imul(Q,zt)|0,X=X+Math.imul(Q,At)|0,D=D+Math.imul(te,St)|0,$=$+Math.imul(te,dt)|0,$=$+Math.imul(re,St)|0,X=X+Math.imul(re,dt)|0,D=D+Math.imul(H,Rt)|0,$=$+Math.imul(H,gt)|0,$=$+Math.imul(ee,Rt)|0,X=X+Math.imul(ee,gt)|0;var ve=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ve>>>26)|0,ve&=67108863,D=Math.imul(Ee,Je),$=Math.imul(Ee,et),$=$+Math.imul(He,Je)|0,X=Math.imul(He,et),D=D+Math.imul(Ue,ut)|0,$=$+Math.imul(Ue,pt)|0,$=$+Math.imul(Ke,ut)|0,X=X+Math.imul(Ke,pt)|0,D=D+Math.imul(be,zt)|0,$=$+Math.imul(be,At)|0,$=$+Math.imul(Ce,zt)|0,X=X+Math.imul(Ce,At)|0,D=D+Math.imul(G,St)|0,$=$+Math.imul(G,dt)|0,$=$+Math.imul(Q,St)|0,X=X+Math.imul(Q,dt)|0,D=D+Math.imul(te,Rt)|0,$=$+Math.imul(te,gt)|0,$=$+Math.imul(re,Rt)|0,X=X+Math.imul(re,gt)|0,D=D+Math.imul(H,Wt)|0,$=$+Math.imul(H,ot)|0,$=$+Math.imul(ee,Wt)|0,X=X+Math.imul(ee,ot)|0;var Le=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Le>>>26)|0,Le&=67108863,D=Math.imul(Ie,Je),$=Math.imul(Ie,et),$=$+Math.imul(Ne,Je)|0,X=Math.imul(Ne,et),D=D+Math.imul(Ee,ut)|0,$=$+Math.imul(Ee,pt)|0,$=$+Math.imul(He,ut)|0,X=X+Math.imul(He,pt)|0,D=D+Math.imul(Ue,zt)|0,$=$+Math.imul(Ue,At)|0,$=$+Math.imul(Ke,zt)|0,X=X+Math.imul(Ke,At)|0,D=D+Math.imul(be,St)|0,$=$+Math.imul(be,dt)|0,$=$+Math.imul(Ce,St)|0,X=X+Math.imul(Ce,dt)|0,D=D+Math.imul(G,Rt)|0,$=$+Math.imul(G,gt)|0,$=$+Math.imul(Q,Rt)|0,X=X+Math.imul(Q,gt)|0,D=D+Math.imul(te,Wt)|0,$=$+Math.imul(te,ot)|0,$=$+Math.imul(re,Wt)|0,X=X+Math.imul(re,ot)|0,D=D+Math.imul(H,Ft)|0,$=$+Math.imul(H,yt)|0,$=$+Math.imul(ee,Ft)|0,X=X+Math.imul(ee,yt)|0;var Ge=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,D=Math.imul(je,Je),$=Math.imul(je,et),$=$+Math.imul(K,Je)|0,X=Math.imul(K,et),D=D+Math.imul(Ie,ut)|0,$=$+Math.imul(Ie,pt)|0,$=$+Math.imul(Ne,ut)|0,X=X+Math.imul(Ne,pt)|0,D=D+Math.imul(Ee,zt)|0,$=$+Math.imul(Ee,At)|0,$=$+Math.imul(He,zt)|0,X=X+Math.imul(He,At)|0,D=D+Math.imul(Ue,St)|0,$=$+Math.imul(Ue,dt)|0,$=$+Math.imul(Ke,St)|0,X=X+Math.imul(Ke,dt)|0,D=D+Math.imul(be,Rt)|0,$=$+Math.imul(be,gt)|0,$=$+Math.imul(Ce,Rt)|0,X=X+Math.imul(Ce,gt)|0,D=D+Math.imul(G,Wt)|0,$=$+Math.imul(G,ot)|0,$=$+Math.imul(Q,Wt)|0,X=X+Math.imul(Q,ot)|0,D=D+Math.imul(te,Ft)|0,$=$+Math.imul(te,yt)|0,$=$+Math.imul(re,Ft)|0,X=X+Math.imul(re,yt)|0,D=D+Math.imul(H,Pt)|0,$=$+Math.imul(H,xt)|0,$=$+Math.imul(ee,Pt)|0,X=X+Math.imul(ee,xt)|0;var Be=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Be>>>26)|0,Be&=67108863,D=Math.imul(W,Je),$=Math.imul(W,et),$=$+Math.imul(ie,Je)|0,X=Math.imul(ie,et),D=D+Math.imul(je,ut)|0,$=$+Math.imul(je,pt)|0,$=$+Math.imul(K,ut)|0,X=X+Math.imul(K,pt)|0,D=D+Math.imul(Ie,zt)|0,$=$+Math.imul(Ie,At)|0,$=$+Math.imul(Ne,zt)|0,X=X+Math.imul(Ne,At)|0,D=D+Math.imul(Ee,St)|0,$=$+Math.imul(Ee,dt)|0,$=$+Math.imul(He,St)|0,X=X+Math.imul(He,dt)|0,D=D+Math.imul(Ue,Rt)|0,$=$+Math.imul(Ue,gt)|0,$=$+Math.imul(Ke,Rt)|0,X=X+Math.imul(Ke,gt)|0,D=D+Math.imul(be,Wt)|0,$=$+Math.imul(be,ot)|0,$=$+Math.imul(Ce,Wt)|0,X=X+Math.imul(Ce,ot)|0,D=D+Math.imul(G,Ft)|0,$=$+Math.imul(G,yt)|0,$=$+Math.imul(Q,Ft)|0,X=X+Math.imul(Q,yt)|0,D=D+Math.imul(te,Pt)|0,$=$+Math.imul(te,xt)|0,$=$+Math.imul(re,Pt)|0,X=X+Math.imul(re,xt)|0,D=D+Math.imul(H,Cr)|0,$=$+Math.imul(H,Gt)|0,$=$+Math.imul(ee,Cr)|0,X=X+Math.imul(ee,Gt)|0;var tt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(tt>>>26)|0,tt&=67108863,D=Math.imul(we,Je),$=Math.imul(we,et),$=$+Math.imul(he,Je)|0,X=Math.imul(he,et),D=D+Math.imul(W,ut)|0,$=$+Math.imul(W,pt)|0,$=$+Math.imul(ie,ut)|0,X=X+Math.imul(ie,pt)|0,D=D+Math.imul(je,zt)|0,$=$+Math.imul(je,At)|0,$=$+Math.imul(K,zt)|0,X=X+Math.imul(K,At)|0,D=D+Math.imul(Ie,St)|0,$=$+Math.imul(Ie,dt)|0,$=$+Math.imul(Ne,St)|0,X=X+Math.imul(Ne,dt)|0,D=D+Math.imul(Ee,Rt)|0,$=$+Math.imul(Ee,gt)|0,$=$+Math.imul(He,Rt)|0,X=X+Math.imul(He,gt)|0,D=D+Math.imul(Ue,Wt)|0,$=$+Math.imul(Ue,ot)|0,$=$+Math.imul(Ke,Wt)|0,X=X+Math.imul(Ke,ot)|0,D=D+Math.imul(be,Ft)|0,$=$+Math.imul(be,yt)|0,$=$+Math.imul(Ce,Ft)|0,X=X+Math.imul(Ce,yt)|0,D=D+Math.imul(G,Pt)|0,$=$+Math.imul(G,xt)|0,$=$+Math.imul(Q,Pt)|0,X=X+Math.imul(Q,xt)|0,D=D+Math.imul(te,Cr)|0,$=$+Math.imul(te,Gt)|0,$=$+Math.imul(re,Cr)|0,X=X+Math.imul(re,Gt)|0,D=D+Math.imul(H,cr)|0,$=$+Math.imul(H,br)|0,$=$+Math.imul(ee,cr)|0,X=X+Math.imul(ee,br)|0;var vt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(vt>>>26)|0,vt&=67108863,D=Math.imul(we,ut),$=Math.imul(we,pt),$=$+Math.imul(he,ut)|0,X=Math.imul(he,pt),D=D+Math.imul(W,zt)|0,$=$+Math.imul(W,At)|0,$=$+Math.imul(ie,zt)|0,X=X+Math.imul(ie,At)|0,D=D+Math.imul(je,St)|0,$=$+Math.imul(je,dt)|0,$=$+Math.imul(K,St)|0,X=X+Math.imul(K,dt)|0,D=D+Math.imul(Ie,Rt)|0,$=$+Math.imul(Ie,gt)|0,$=$+Math.imul(Ne,Rt)|0,X=X+Math.imul(Ne,gt)|0,D=D+Math.imul(Ee,Wt)|0,$=$+Math.imul(Ee,ot)|0,$=$+Math.imul(He,Wt)|0,X=X+Math.imul(He,ot)|0,D=D+Math.imul(Ue,Ft)|0,$=$+Math.imul(Ue,yt)|0,$=$+Math.imul(Ke,Ft)|0,X=X+Math.imul(Ke,yt)|0,D=D+Math.imul(be,Pt)|0,$=$+Math.imul(be,xt)|0,$=$+Math.imul(Ce,Pt)|0,X=X+Math.imul(Ce,xt)|0,D=D+Math.imul(G,Cr)|0,$=$+Math.imul(G,Gt)|0,$=$+Math.imul(Q,Cr)|0,X=X+Math.imul(Q,Gt)|0,D=D+Math.imul(te,cr)|0,$=$+Math.imul(te,br)|0,$=$+Math.imul(re,cr)|0,X=X+Math.imul(re,br)|0;var Lt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,D=Math.imul(we,zt),$=Math.imul(we,At),$=$+Math.imul(he,zt)|0,X=Math.imul(he,At),D=D+Math.imul(W,St)|0,$=$+Math.imul(W,dt)|0,$=$+Math.imul(ie,St)|0,X=X+Math.imul(ie,dt)|0,D=D+Math.imul(je,Rt)|0,$=$+Math.imul(je,gt)|0,$=$+Math.imul(K,Rt)|0,X=X+Math.imul(K,gt)|0,D=D+Math.imul(Ie,Wt)|0,$=$+Math.imul(Ie,ot)|0,$=$+Math.imul(Ne,Wt)|0,X=X+Math.imul(Ne,ot)|0,D=D+Math.imul(Ee,Ft)|0,$=$+Math.imul(Ee,yt)|0,$=$+Math.imul(He,Ft)|0,X=X+Math.imul(He,yt)|0,D=D+Math.imul(Ue,Pt)|0,$=$+Math.imul(Ue,xt)|0,$=$+Math.imul(Ke,Pt)|0,X=X+Math.imul(Ke,xt)|0,D=D+Math.imul(be,Cr)|0,$=$+Math.imul(be,Gt)|0,$=$+Math.imul(Ce,Cr)|0,X=X+Math.imul(Ce,Gt)|0,D=D+Math.imul(G,cr)|0,$=$+Math.imul(G,br)|0,$=$+Math.imul(Q,cr)|0,X=X+Math.imul(Q,br)|0;var Ct=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,D=Math.imul(we,St),$=Math.imul(we,dt),$=$+Math.imul(he,St)|0,X=Math.imul(he,dt),D=D+Math.imul(W,Rt)|0,$=$+Math.imul(W,gt)|0,$=$+Math.imul(ie,Rt)|0,X=X+Math.imul(ie,gt)|0,D=D+Math.imul(je,Wt)|0,$=$+Math.imul(je,ot)|0,$=$+Math.imul(K,Wt)|0,X=X+Math.imul(K,ot)|0,D=D+Math.imul(Ie,Ft)|0,$=$+Math.imul(Ie,yt)|0,$=$+Math.imul(Ne,Ft)|0,X=X+Math.imul(Ne,yt)|0,D=D+Math.imul(Ee,Pt)|0,$=$+Math.imul(Ee,xt)|0,$=$+Math.imul(He,Pt)|0,X=X+Math.imul(He,xt)|0,D=D+Math.imul(Ue,Cr)|0,$=$+Math.imul(Ue,Gt)|0,$=$+Math.imul(Ke,Cr)|0,X=X+Math.imul(Ke,Gt)|0,D=D+Math.imul(be,cr)|0,$=$+Math.imul(be,br)|0,$=$+Math.imul(Ce,cr)|0,X=X+Math.imul(Ce,br)|0;var ir=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ir>>>26)|0,ir&=67108863,D=Math.imul(we,Rt),$=Math.imul(we,gt),$=$+Math.imul(he,Rt)|0,X=Math.imul(he,gt),D=D+Math.imul(W,Wt)|0,$=$+Math.imul(W,ot)|0,$=$+Math.imul(ie,Wt)|0,X=X+Math.imul(ie,ot)|0,D=D+Math.imul(je,Ft)|0,$=$+Math.imul(je,yt)|0,$=$+Math.imul(K,Ft)|0,X=X+Math.imul(K,yt)|0,D=D+Math.imul(Ie,Pt)|0,$=$+Math.imul(Ie,xt)|0,$=$+Math.imul(Ne,Pt)|0,X=X+Math.imul(Ne,xt)|0,D=D+Math.imul(Ee,Cr)|0,$=$+Math.imul(Ee,Gt)|0,$=$+Math.imul(He,Cr)|0,X=X+Math.imul(He,Gt)|0,D=D+Math.imul(Ue,cr)|0,$=$+Math.imul(Ue,br)|0,$=$+Math.imul(Ke,cr)|0,X=X+Math.imul(Ke,br)|0;var Zt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,D=Math.imul(we,Wt),$=Math.imul(we,ot),$=$+Math.imul(he,Wt)|0,X=Math.imul(he,ot),D=D+Math.imul(W,Ft)|0,$=$+Math.imul(W,yt)|0,$=$+Math.imul(ie,Ft)|0,X=X+Math.imul(ie,yt)|0,D=D+Math.imul(je,Pt)|0,$=$+Math.imul(je,xt)|0,$=$+Math.imul(K,Pt)|0,X=X+Math.imul(K,xt)|0,D=D+Math.imul(Ie,Cr)|0,$=$+Math.imul(Ie,Gt)|0,$=$+Math.imul(Ne,Cr)|0,X=X+Math.imul(Ne,Gt)|0,D=D+Math.imul(Ee,cr)|0,$=$+Math.imul(Ee,br)|0,$=$+Math.imul(He,cr)|0,X=X+Math.imul(He,br)|0;var sn=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(sn>>>26)|0,sn&=67108863,D=Math.imul(we,Ft),$=Math.imul(we,yt),$=$+Math.imul(he,Ft)|0,X=Math.imul(he,yt),D=D+Math.imul(W,Pt)|0,$=$+Math.imul(W,xt)|0,$=$+Math.imul(ie,Pt)|0,X=X+Math.imul(ie,xt)|0,D=D+Math.imul(je,Cr)|0,$=$+Math.imul(je,Gt)|0,$=$+Math.imul(K,Cr)|0,X=X+Math.imul(K,Gt)|0,D=D+Math.imul(Ie,cr)|0,$=$+Math.imul(Ie,br)|0,$=$+Math.imul(Ne,cr)|0,X=X+Math.imul(Ne,br)|0;var Rr=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,D=Math.imul(we,Pt),$=Math.imul(we,xt),$=$+Math.imul(he,Pt)|0,X=Math.imul(he,xt),D=D+Math.imul(W,Cr)|0,$=$+Math.imul(W,Gt)|0,$=$+Math.imul(ie,Cr)|0,X=X+Math.imul(ie,Gt)|0,D=D+Math.imul(je,cr)|0,$=$+Math.imul(je,br)|0,$=$+Math.imul(K,cr)|0,X=X+Math.imul(K,br)|0;var dn=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(dn>>>26)|0,dn&=67108863,D=Math.imul(we,Cr),$=Math.imul(we,Gt),$=$+Math.imul(he,Cr)|0,X=Math.imul(he,Gt),D=D+Math.imul(W,cr)|0,$=$+Math.imul(W,br)|0,$=$+Math.imul(ie,cr)|0,X=X+Math.imul(ie,br)|0;var qa=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(qa>>>26)|0,qa&=67108863,D=Math.imul(we,cr),$=Math.imul(we,br),$=$+Math.imul(he,cr)|0,X=Math.imul(he,br);var bs=(M+D|0)+(($&8191)<<13)|0;return M=(X+($>>>13)|0)+(bs>>>26)|0,bs&=67108863,R[0]=Z,R[1]=ae,R[2]=de,R[3]=ue,R[4]=ve,R[5]=Le,R[6]=Ge,R[7]=Be,R[8]=tt,R[9]=vt,R[10]=Lt,R[11]=Ct,R[12]=ir,R[13]=Zt,R[14]=sn,R[15]=Rr,R[16]=dn,R[17]=qa,R[18]=bs,M!==0&&(R[19]=M,L.length++),L};Math.imul||(b=v);function A(k,x,_){_.negative=x.negative^k.negative,_.length=k.length+x.length;for(var L=0,O=0,P=0;P<_.length-1;P++){var R=O;O=0;for(var M=L&67108863,D=Math.min(P,x.length-1),$=Math.max(0,P-k.length+1);$<=D;$++){var X=P-$,le=k.words[X]|0,H=x.words[$]|0,ee=le*H,J=ee&67108863;R=R+(ee/67108864|0)|0,J=J+M|0,M=J&67108863,R=R+(J>>>26)|0,O+=R>>>26,R&=67108863}_.words[P]=M,L=R,R=O}return L!==0?_.words[P]=L:_.length--,_._strip()}function S(k,x,_){return A(k,x,_)}a.prototype.mulTo=function(x,_){var L,O=this.length+x.length;return this.length===10&&x.length===10?L=b(this,x,_):O<63?L=v(this,x,_):O<1024?L=A(this,x,_):L=S(this,x,_),L},a.prototype.mul=function(x){var _=new a(null);return _.words=new Array(this.length+x.length),this.mulTo(x,_)},a.prototype.mulf=function(x){var _=new a(null);return _.words=new Array(this.length+x.length),S(this,x,_)},a.prototype.imul=function(x){return this.clone().mulTo(x,this)},a.prototype.imuln=function(x){var _=x<0;_&&(x=-x),n(typeof x=="number"),n(x<67108864);for(var L=0,O=0;O>=26,L+=P/67108864|0,L+=R>>>26,this.words[O]=R&67108863}return L!==0&&(this.words[O]=L,this.length++),_?this.ineg():this},a.prototype.muln=function(x){return this.clone().imuln(x)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(x){var _=C(x);if(_.length===0)return new a(1);for(var L=this,O=0;O<_.length&&_[O]===0;O++,L=L.sqr());if(++O<_.length)for(var P=L.sqr();O<_.length;O++,P=P.sqr())_[O]!==0&&(L=L.mul(P));return L},a.prototype.iushln=function(x){n(typeof x=="number"&&x>=0);var _=x%26,L=(x-_)/26,O=67108863>>>26-_<<26-_,P;if(_!==0){var R=0;for(P=0;P>>26-_}R&&(this.words[P]=R,this.length++)}if(L!==0){for(P=this.length-1;P>=0;P--)this.words[P+L]=this.words[P];for(P=0;P=0);var O;_?O=(_-_%26)/26:O=0;var P=x%26,R=Math.min((x-P)/26,this.length),M=67108863^67108863>>>P<R)for(this.length-=R,$=0;$=0&&(X!==0||$>=O);$--){var le=this.words[$]|0;this.words[$]=X<<26-P|le>>>P,X=le&M}return D&&X!==0&&(D.words[D.length++]=X),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(x,_,L){return n(this.negative===0),this.iushrn(x,_,L)},a.prototype.shln=function(x){return this.clone().ishln(x)},a.prototype.ushln=function(x){return this.clone().iushln(x)},a.prototype.shrn=function(x){return this.clone().ishrn(x)},a.prototype.ushrn=function(x){return this.clone().iushrn(x)},a.prototype.testn=function(x){n(typeof x=="number"&&x>=0);var _=x%26,L=(x-_)/26,O=1<<_;if(this.length<=L)return!1;var P=this.words[L];return!!(P&O)},a.prototype.imaskn=function(x){n(typeof x=="number"&&x>=0);var _=x%26,L=(x-_)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=L)return this;if(_!==0&&L++,this.length=Math.min(L,this.length),_!==0){var O=67108863^67108863>>>_<<_;this.words[this.length-1]&=O}return this._strip()},a.prototype.maskn=function(x){return this.clone().imaskn(x)},a.prototype.iaddn=function(x){return n(typeof x=="number"),n(x<67108864),x<0?this.isubn(-x):this.negative!==0?this.length===1&&(this.words[0]|0)<=x?(this.words[0]=x-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(x),this.negative=1,this):this._iaddn(x)},a.prototype._iaddn=function(x){this.words[0]+=x;for(var _=0;_=67108864;_++)this.words[_]-=67108864,_===this.length-1?this.words[_+1]=1:this.words[_+1]++;return this.length=Math.max(this.length,_+1),this},a.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 _=0;_>26)-(D/67108864|0),this.words[P+L]=R&67108863}for(;P>26,this.words[P+L]=R&67108863;if(M===0)return this._strip();for(n(M===-1),M=0,P=0;P>26,this.words[P]=R&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(x,_){var L=this.length-x.length,O=this.clone(),P=x,R=P.words[P.length-1]|0,M=this._countBits(R);L=26-M,L!==0&&(P=P.ushln(L),O.iushln(L),R=P.words[P.length-1]|0);var D=O.length-P.length,$;if(_!=="mod"){$=new a(null),$.length=D+1,$.words=new Array($.length);for(var X=0;X<$.length;X++)$.words[X]=0}var le=O.clone()._ishlnsubmul(P,1,D);le.negative===0&&(O=le,$&&($.words[D]=1));for(var H=D-1;H>=0;H--){var ee=(O.words[P.length+H]|0)*67108864+(O.words[P.length+H-1]|0);for(ee=Math.min(ee/R|0,67108863),O._ishlnsubmul(P,ee,H);O.negative!==0;)ee--,O.negative=0,O._ishlnsubmul(P,1,H),O.isZero()||(O.negative^=1);$&&($.words[H]=ee)}return $&&$._strip(),O._strip(),_!=="div"&&L!==0&&O.iushrn(L),{div:$||null,mod:O}},a.prototype.divmod=function(x,_,L){if(n(!x.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var O,P,R;return this.negative!==0&&x.negative===0?(R=this.neg().divmod(x,_),_!=="mod"&&(O=R.div.neg()),_!=="div"&&(P=R.mod.neg(),L&&P.negative!==0&&P.iadd(x)),{div:O,mod:P}):this.negative===0&&x.negative!==0?(R=this.divmod(x.neg(),_),_!=="mod"&&(O=R.div.neg()),{div:O,mod:R.mod}):this.negative&x.negative?(R=this.neg().divmod(x.neg(),_),_!=="div"&&(P=R.mod.neg(),L&&P.negative!==0&&P.isub(x)),{div:R.div,mod:P}):x.length>this.length||this.cmp(x)<0?{div:new a(0),mod:this}:x.length===1?_==="div"?{div:this.divn(x.words[0]),mod:null}:_==="mod"?{div:null,mod:new a(this.modrn(x.words[0]))}:{div:this.divn(x.words[0]),mod:new a(this.modrn(x.words[0]))}:this._wordDiv(x,_)},a.prototype.div=function(x){return this.divmod(x,"div",!1).div},a.prototype.mod=function(x){return this.divmod(x,"mod",!1).mod},a.prototype.umod=function(x){return this.divmod(x,"mod",!0).mod},a.prototype.divRound=function(x){var _=this.divmod(x);if(_.mod.isZero())return _.div;var L=_.div.negative!==0?_.mod.isub(x):_.mod,O=x.ushrn(1),P=x.andln(1),R=L.cmp(O);return R<0||P===1&&R===0?_.div:_.div.negative!==0?_.div.isubn(1):_.div.iaddn(1)},a.prototype.modrn=function(x){var _=x<0;_&&(x=-x),n(x<=67108863);for(var L=(1<<26)%x,O=0,P=this.length-1;P>=0;P--)O=(L*O+(this.words[P]|0))%x;return _?-O:O},a.prototype.modn=function(x){return this.modrn(x)},a.prototype.idivn=function(x){var _=x<0;_&&(x=-x),n(x<=67108863);for(var L=0,O=this.length-1;O>=0;O--){var P=(this.words[O]|0)+L*67108864;this.words[O]=P/x|0,L=P%x}return this._strip(),_?this.ineg():this},a.prototype.divn=function(x){return this.clone().idivn(x)},a.prototype.egcd=function(x){n(x.negative===0),n(!x.isZero());var _=this,L=x.clone();_.negative!==0?_=_.umod(x):_=_.clone();for(var O=new a(1),P=new a(0),R=new a(0),M=new a(1),D=0;_.isEven()&&L.isEven();)_.iushrn(1),L.iushrn(1),++D;for(var $=L.clone(),X=_.clone();!_.isZero();){for(var le=0,H=1;!(_.words[0]&H)&&le<26;++le,H<<=1);if(le>0)for(_.iushrn(le);le-- >0;)(O.isOdd()||P.isOdd())&&(O.iadd($),P.isub(X)),O.iushrn(1),P.iushrn(1);for(var ee=0,J=1;!(L.words[0]&J)&&ee<26;++ee,J<<=1);if(ee>0)for(L.iushrn(ee);ee-- >0;)(R.isOdd()||M.isOdd())&&(R.iadd($),M.isub(X)),R.iushrn(1),M.iushrn(1);_.cmp(L)>=0?(_.isub(L),O.isub(R),P.isub(M)):(L.isub(_),R.isub(O),M.isub(P))}return{a:R,b:M,gcd:L.iushln(D)}},a.prototype._invmp=function(x){n(x.negative===0),n(!x.isZero());var _=this,L=x.clone();_.negative!==0?_=_.umod(x):_=_.clone();for(var O=new a(1),P=new a(0),R=L.clone();_.cmpn(1)>0&&L.cmpn(1)>0;){for(var M=0,D=1;!(_.words[0]&D)&&M<26;++M,D<<=1);if(M>0)for(_.iushrn(M);M-- >0;)O.isOdd()&&O.iadd(R),O.iushrn(1);for(var $=0,X=1;!(L.words[0]&X)&&$<26;++$,X<<=1);if($>0)for(L.iushrn($);$-- >0;)P.isOdd()&&P.iadd(R),P.iushrn(1);_.cmp(L)>=0?(_.isub(L),O.isub(P)):(L.isub(_),P.isub(O))}var le;return _.cmpn(1)===0?le=O:le=P,le.cmpn(0)<0&&le.iadd(x),le},a.prototype.gcd=function(x){if(this.isZero())return x.abs();if(x.isZero())return this.abs();var _=this.clone(),L=x.clone();_.negative=0,L.negative=0;for(var O=0;_.isEven()&&L.isEven();O++)_.iushrn(1),L.iushrn(1);do{for(;_.isEven();)_.iushrn(1);for(;L.isEven();)L.iushrn(1);var P=_.cmp(L);if(P<0){var R=_;_=L,L=R}else if(P===0||L.cmpn(1)===0)break;_.isub(L)}while(!0);return L.iushln(O)},a.prototype.invm=function(x){return this.egcd(x).a.umod(x)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(x){return this.words[0]&x},a.prototype.bincn=function(x){n(typeof x=="number");var _=x%26,L=(x-_)/26,O=1<<_;if(this.length<=L)return this._expand(L+1),this.words[L]|=O,this;for(var P=O,R=L;P!==0&&R>>26,M&=67108863,this.words[R]=M}return P!==0&&(this.words[R]=P,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(x){var _=x<0;if(this.negative!==0&&!_)return-1;if(this.negative===0&&_)return 1;this._strip();var L;if(this.length>1)L=1;else{_&&(x=-x),n(x<=67108863,"Number is too big");var O=this.words[0]|0;L=O===x?0:Ox.length)return 1;if(this.length=0;L--){var O=this.words[L]|0,P=x.words[L]|0;if(O!==P){OP&&(_=1);break}}return _},a.prototype.gtn=function(x){return this.cmpn(x)===1},a.prototype.gt=function(x){return this.cmp(x)===1},a.prototype.gten=function(x){return this.cmpn(x)>=0},a.prototype.gte=function(x){return this.cmp(x)>=0},a.prototype.ltn=function(x){return this.cmpn(x)===-1},a.prototype.lt=function(x){return this.cmp(x)===-1},a.prototype.lten=function(x){return this.cmpn(x)<=0},a.prototype.lte=function(x){return this.cmp(x)<=0},a.prototype.eqn=function(x){return this.cmpn(x)===0},a.prototype.eq=function(x){return this.cmp(x)===0},a.red=function(x){return new Y(x)},a.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)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(x){return this.red=x,this},a.prototype.forceRed=function(x){return n(!this.red,"Already a number in reduction context"),this._forceRed(x)},a.prototype.redAdd=function(x){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,x)},a.prototype.redIAdd=function(x){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,x)},a.prototype.redSub=function(x){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,x)},a.prototype.redISub=function(x){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,x)},a.prototype.redShl=function(x){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,x)},a.prototype.redMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.mul(this,x)},a.prototype.redIMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.imul(this,x)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(x){return n(this.red&&!x.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,x)};var j={k256:null,p224:null,p192:null,p25519:null};function U(k,x){this.name=k,this.p=new a(x,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}U.prototype._tmp=function(){var x=new a(null);return x.words=new Array(Math.ceil(this.n/13)),x},U.prototype.ireduce=function(x){var _=x,L;do this.split(_,this.tmp),_=this.imulK(_),_=_.iadd(this.tmp),L=_.bitLength();while(L>this.n);var O=L0?_.isub(this.p):_.strip!==void 0?_.strip():_._strip(),_},U.prototype.split=function(x,_){x.iushrn(this.n,0,_)},U.prototype.imulK=function(x){return x.imul(this.k)};function I(){U.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(I,U),I.prototype.split=function(x,_){for(var L=4194303,O=Math.min(x.length,9),P=0;P>>22,R=M}R>>>=22,x.words[P-10]=R,R===0&&x.length>10?x.length-=10:x.length-=9},I.prototype.imulK=function(x){x.words[x.length]=0,x.words[x.length+1]=0,x.length+=2;for(var _=0,L=0;L>>=26,x.words[L]=P,_=O}return _!==0&&(x.words[x.length++]=_),x},a._prime=function(x){if(j[x])return j[x];var _;if(x==="k256")_=new I;else if(x==="p224")_=new B;else if(x==="p192")_=new V;else if(x==="p25519")_=new se;else throw new Error("Unknown prime "+x);return j[x]=_,_};function Y(k){if(typeof k=="string"){var x=a._prime(k);this.m=x.p,this.prime=x}else n(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}Y.prototype._verify1=function(x){n(x.negative===0,"red works only with positives"),n(x.red,"red works only with red numbers")},Y.prototype._verify2=function(x,_){n((x.negative|_.negative)===0,"red works only with positives"),n(x.red&&x.red===_.red,"red works only with red numbers")},Y.prototype.imod=function(x){return this.prime?this.prime.ireduce(x)._forceRed(this):(u(x,x.umod(this.m)._forceRed(this)),x)},Y.prototype.neg=function(x){return x.isZero()?x.clone():this.m.sub(x)._forceRed(this)},Y.prototype.add=function(x,_){this._verify2(x,_);var L=x.add(_);return L.cmp(this.m)>=0&&L.isub(this.m),L._forceRed(this)},Y.prototype.iadd=function(x,_){this._verify2(x,_);var L=x.iadd(_);return L.cmp(this.m)>=0&&L.isub(this.m),L},Y.prototype.sub=function(x,_){this._verify2(x,_);var L=x.sub(_);return L.cmpn(0)<0&&L.iadd(this.m),L._forceRed(this)},Y.prototype.isub=function(x,_){this._verify2(x,_);var L=x.isub(_);return L.cmpn(0)<0&&L.iadd(this.m),L},Y.prototype.shl=function(x,_){return this._verify1(x),this.imod(x.ushln(_))},Y.prototype.imul=function(x,_){return this._verify2(x,_),this.imod(x.imul(_))},Y.prototype.mul=function(x,_){return this._verify2(x,_),this.imod(x.mul(_))},Y.prototype.isqr=function(x){return this.imul(x,x.clone())},Y.prototype.sqr=function(x){return this.mul(x,x)},Y.prototype.sqrt=function(x){if(x.isZero())return x.clone();var _=this.m.andln(3);if(n(_%2===1),_===3){var L=this.m.add(new a(1)).iushrn(2);return this.pow(x,L)}for(var O=this.m.subn(1),P=0;!O.isZero()&&O.andln(1)===0;)P++,O.iushrn(1);n(!O.isZero());var R=new a(1).toRed(this),M=R.redNeg(),D=this.m.subn(1).iushrn(1),$=this.m.bitLength();for($=new a(2*$*$).toRed(this);this.pow($,D).cmp(M)!==0;)$.redIAdd(M);for(var X=this.pow($,O),le=this.pow(x,O.addn(1).iushrn(1)),H=this.pow(x,O),ee=P;H.cmp(R)!==0;){for(var J=H,te=0;J.cmp(R)!==0;te++)J=J.redSqr();n(te=0;P--){for(var X=_.words[P],le=$-1;le>=0;le--){var H=X>>le&1;if(R!==O[0]&&(R=this.sqr(R)),H===0&&M===0){D=0;continue}M<<=1,M|=H,D++,!(D!==L&&(P!==0||le!==0))&&(R=this.mul(R,O[M]),D=0,M=0)}$=26}return R},Y.prototype.convertTo=function(x){var _=x.umod(this.m);return _===x?_.clone():_},Y.prototype.convertFrom=function(x){var _=x.clone();return _.red=null,_},a.mont=function(x){return new N(x)};function N(k){Y.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(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(N,Y),N.prototype.convertTo=function(x){return this.imod(x.ushln(this.shift))},N.prototype.convertFrom=function(x){var _=this.imod(x.mul(this.rinv));return _.red=null,_},N.prototype.imul=function(x,_){if(x.isZero()||_.isZero())return x.words[0]=0,x.length=1,x;var L=x.imul(_),O=L.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=L.isub(O).iushrn(this.shift),R=P;return P.cmp(this.m)>=0?R=P.isub(this.m):P.cmpn(0)<0&&(R=P.iadd(this.m)),R._forceRed(this)},N.prototype.mul=function(x,_){if(x.isZero()||_.isZero())return new a(0)._forceRed(this);var L=x.mul(_),O=L.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=L.isub(O).iushrn(this.shift),R=P;return P.cmp(this.m)>=0?R=P.isub(this.m):P.cmpn(0)<0&&(R=P.iadd(this.m)),R._forceRed(this)},N.prototype.invm=function(x){var _=this.imod(x._invmp(this.m).mul(this.r2));return _._forceRed(this)}})(t,Xt)})(_N);var Oye=_N.exports;const yr=Lo(Oye),TK="bignumber/5.7.0";var I5=yr.BN;const cd=new De(TK),rC={},CO=9007199254740991;function Fye(t){return t!=null&&(nt.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Kr(t)||typeof t=="bigint"||wm(t))}let SO=!1;class nt{constructor(e,r){e!==rC&&cd.throwError("cannot call constructor directly; use BigNumber.from",De.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return As(Or(this).fromTwos(e))}toTwos(e){return As(Or(this).toTwos(e))}abs(){return this._hex[0]==="-"?nt.from(this._hex.substring(1)):this}add(e){return As(Or(this).add(Or(e)))}sub(e){return As(Or(this).sub(Or(e)))}div(e){return nt.from(e).isZero()&&Qo("division-by-zero","div"),As(Or(this).div(Or(e)))}mul(e){return As(Or(this).mul(Or(e)))}mod(e){const r=Or(e);return r.isNeg()&&Qo("division-by-zero","mod"),As(Or(this).umod(r))}pow(e){const r=Or(e);return r.isNeg()&&Qo("negative-power","pow"),As(Or(this).pow(r))}and(e){const r=Or(e);return(this.isNegative()||r.isNeg())&&Qo("unbound-bitwise-result","and"),As(Or(this).and(r))}or(e){const r=Or(e);return(this.isNegative()||r.isNeg())&&Qo("unbound-bitwise-result","or"),As(Or(this).or(r))}xor(e){const r=Or(e);return(this.isNegative()||r.isNeg())&&Qo("unbound-bitwise-result","xor"),As(Or(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Qo("negative-width","mask"),As(Or(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Qo("negative-width","shl"),As(Or(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Qo("negative-width","shr"),As(Or(this).shrn(e))}eq(e){return Or(this).eq(Or(e))}lt(e){return Or(this).lt(Or(e))}lte(e){return Or(this).lte(Or(e))}gt(e){return Or(this).gt(Or(e))}gte(e){return Or(this).gte(Or(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Or(this).isZero()}toNumber(){try{return Or(this).toNumber()}catch{Qo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return cd.throwError("this platform does not support BigInt",De.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?SO||(SO=!0,cd.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?cd.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",De.errors.UNEXPECTED_ARGUMENT,{}):cd.throwError("BigNumber.toString does not accept parameters",De.errors.UNEXPECTED_ARGUMENT,{})),Or(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof nt)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new nt(rC,ww(e)):e.match(/^-?[0-9]+$/)?new nt(rC,ww(new I5(e))):cd.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Qo("underflow","BigNumber.from",e),(e>=CO||e<=-CO)&&Qo("overflow","BigNumber.from",e),nt.from(String(e));const r=e;if(typeof r=="bigint")return nt.from(r.toString());if(wm(r))return nt.from(Bt(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return nt.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(Kr(n)||n[0]==="-"&&Kr(n.substring(1))))return nt.from(n)}return cd.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function ww(t){if(typeof t!="string")return ww(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&cd.throwArgumentError("invalid hex","value",t),t=ww(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 As(t){return nt.from(ww(t))}function Or(t){const e=nt.from(t).toHexString();return e[0]==="-"?new I5("-"+e.substring(3),16):new I5(e.substring(2),16)}function Qo(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),cd.throwError(t,De.errors.NUMERIC_FAULT,n)}function Uye(t){return new I5(t,36).toString(16)}const ns=new De(TK),jy={},kK=nt.from(0),NK=nt.from(-1);function LK(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),ns.throwError(t,De.errors.NUMERIC_FAULT,i)}let $y="0";for(;$y.length<256;)$y+=$y;function CN(t){if(typeof t!="number")try{t=nt.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+$y.substring(0,t):ns.throwArgumentError("invalid decimal size","decimals",t)}function y6(t,e){e==null&&(e=0);const r=CN(e);t=nt.from(t);const n=t.lt(kK);n&&(t=t.mul(NK));let i=t.mod(r).toString();for(;i.length2&&ns.throwArgumentError("too many decimal points","value",t);let a=i[0],s=i[1];for(a||(a="0"),s||(s="0");s[s.length-1]==="0";)s=s.substring(0,s.length-1);for(s.length>r.length-1&&LK("fractional component exceeds decimals","underflow","parseFixed"),s===""&&(s="0");s.lengthe[s]==null?l:(typeof e[s]!==o&&ns.throwArgumentError("invalid fixed format ("+s+" not "+o+")","format."+s,e[s]),e[s]);r=a("signed","boolean",r),n=a("width","number",n),i=a("decimals","number",i)}return n%8&&ns.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&ns.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new dg(jy,r,n,i)}}class ga{constructor(e,r,n,i){e!==jy&&ns.throwError("cannot use FixedNumber constructor; use FixedNumber.from",De.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&&ns.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Hc(this._value,this.format.decimals),n=Hc(e._value,e.format.decimals);return ga.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Hc(this._value,this.format.decimals),n=Hc(e._value,e.format.decimals);return ga.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Hc(this._value,this.format.decimals),n=Hc(e._value,e.format.decimals);return ga.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Hc(this._value,this.format.decimals),n=Hc(e._value,e.format.decimals);return ga.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=ga.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(AO.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=ga.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(AO.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)&&ns.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=ga.from("1"+$y.substring(0,e),this.format),i=Bye.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&&ns.throwArgumentError("invalid byte width","width",e);const r=nt.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Bn(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ga.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!Fye(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),ga.fromString(y6(e,r),dg.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=dg.from(r),i=Hc(e,n.decimals);!n.signed&&i.lt(kK)&&LK("unsigned value cannot be negative","overflow","value",e);let a=null;n.signed?a=i.toTwos(n.width).toHexString():(a=i.toHexString(),a=Bn(a,n.width/8));const s=y6(i,n.decimals);return new ga(jy,a,s,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=dg.from(r);if(er(e).length>n.width/8)throw new Error("overflow");let i=nt.from(e);n.signed&&(i=i.fromTwos(n.width));const a=i.toTwos((n.signed?0:1)+n.width).toHexString(),s=y6(i,n.decimals);return new ga(jy,a,s,n)}static from(e,r){if(typeof e=="string")return ga.fromString(e,r);if(wm(e))return ga.fromBytes(e,r);try{return ga.fromValue(e,0,r)}catch(n){if(n.code!==De.errors.INVALID_ARGUMENT)throw n}return ns.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const AO=ga.from(1),Bye=ga.from("0.5");var jK={exports:{}};/** - * [js-sha3]{@link https://github.com/emn178/js-sha3} - * - * @version 0.8.0 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2015-2018 - * @license MIT - */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var a=!n&&typeof self=="object",s=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?i=Xt:a&&(i=self);var o=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",c="0123456789abcdef".split(""),u=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],h=[1,256,65536,16777216],g=[6,1536,393216,100663296],m=[0,8,16,24],w=[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],C=[224,256,384,512],v=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],A={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(H){return Object.prototype.toString.call(H)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(H){return typeof H=="object"&&H.buffer&&H.buffer.constructor===ArrayBuffer});for(var S=function(H,ee,J){return function(te){return new $(H,ee,H).update(te)[J]()}},j=function(H,ee,J){return function(te,re){return new $(H,ee,re).update(te)[J]()}},U=function(H,ee,J){return function(te,re,z,G){return x["cshake"+H].update(te,re,z,G)[J]()}},I=function(H,ee,J){return function(te,re,z,G){return x["kmac"+H].update(te,re,z,G)[J]()}},B=function(H,ee,J,te){for(var re=0;re>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var te=0;te<50;++te)this.s[te]=0}$.prototype.update=function(H){if(this.finalized)throw new Error(r);var ee,J=typeof H;if(J!=="string"){if(J==="object"){if(H===null)throw new Error(e);if(l&&H.constructor===ArrayBuffer)H=new Uint8Array(H);else if(!Array.isArray(H)&&(!l||!ArrayBuffer.isView(H)))throw new Error(e)}else throw new Error(e);ee=!0}for(var te=this.blocks,re=this.byteCount,z=H.length,G=this.blockCount,Q=0,me=this.s,be,Ce;Q>2]|=H[Q]<>2]|=Ce<>2]|=(192|Ce>>6)<>2]|=(128|Ce&63)<=57344?(te[be>>2]|=(224|Ce>>12)<>2]|=(128|Ce>>6&63)<>2]|=(128|Ce&63)<>2]|=(240|Ce>>18)<>2]|=(128|Ce>>12&63)<>2]|=(128|Ce>>6&63)<>2]|=(128|Ce&63)<=re){for(this.start=be-re,this.block=te[G],be=0;be>8,J=H&255;J>0;)re.unshift(J),H=H>>8,J=H&255,++te;return ee?re.push(te):re.unshift(te),this.update(re),re.length},$.prototype.encodeString=function(H){var ee,J=typeof H;if(J!=="string"){if(J==="object"){if(H===null)throw new Error(e);if(l&&H.constructor===ArrayBuffer)H=new Uint8Array(H);else if(!Array.isArray(H)&&(!l||!ArrayBuffer.isView(H)))throw new Error(e)}else throw new Error(e);ee=!0}var te=0,re=H.length;if(ee)te=re;else for(var z=0;z=57344?te+=3:(G=65536+((G&1023)<<10|H.charCodeAt(++z)&1023),te+=4)}return te+=this.encode(te*8),this.update(H),te},$.prototype.bytepad=function(H,ee){for(var J=this.encode(ee),te=0;te>2]|=this.padding[ee&3],this.lastByteIndex===this.byteCount)for(H[0]=H[J],ee=1;ee>4&15]+c[Q&15]+c[Q>>12&15]+c[Q>>8&15]+c[Q>>20&15]+c[Q>>16&15]+c[Q>>28&15]+c[Q>>24&15];z%H===0&&(le(ee),re=0)}return te&&(Q=ee[re],G+=c[Q>>4&15]+c[Q&15],te>1&&(G+=c[Q>>12&15]+c[Q>>8&15]),te>2&&(G+=c[Q>>20&15]+c[Q>>16&15])),G},$.prototype.arrayBuffer=function(){this.finalize();var H=this.blockCount,ee=this.s,J=this.outputBlocks,te=this.extraBytes,re=0,z=0,G=this.outputBits>>3,Q;te?Q=new ArrayBuffer(J+1<<2):Q=new ArrayBuffer(G);for(var me=new Uint32Array(Q);z>8&255,G[Q+2]=me>>16&255,G[Q+3]=me>>24&255;z%H===0&&le(ee)}return te&&(Q=z<<2,me=ee[re],G[Q]=me&255,te>1&&(G[Q+1]=me>>8&255),te>2&&(G[Q+2]=me>>16&255)),G};function X(H,ee,J){$.call(this,H,ee,J)}X.prototype=new $,X.prototype.finalize=function(){return this.encode(this.outputBits,!0),$.prototype.finalize.call(this)};var le=function(H){var ee,J,te,re,z,G,Q,me,be,Ce,Fe,Ue,Ke,lt,Ee,He,qe,Ie,Ne,$e,je,K,F,W,ie,pe,we,he,Re,Je,et,it,ut,pt,tr,zt,At,mt,St,dt,Nt,Rt,gt,qt,Wt,ot,Vt,Ft,yt,Ze,Pt,xt,Jt,Cr,Gt,Sr,cr,br,Z,ae,de,ue,ve;for(te=0;te<48;te+=2)re=H[0]^H[10]^H[20]^H[30]^H[40],z=H[1]^H[11]^H[21]^H[31]^H[41],G=H[2]^H[12]^H[22]^H[32]^H[42],Q=H[3]^H[13]^H[23]^H[33]^H[43],me=H[4]^H[14]^H[24]^H[34]^H[44],be=H[5]^H[15]^H[25]^H[35]^H[45],Ce=H[6]^H[16]^H[26]^H[36]^H[46],Fe=H[7]^H[17]^H[27]^H[37]^H[47],Ue=H[8]^H[18]^H[28]^H[38]^H[48],Ke=H[9]^H[19]^H[29]^H[39]^H[49],ee=Ue^(G<<1|Q>>>31),J=Ke^(Q<<1|G>>>31),H[0]^=ee,H[1]^=J,H[10]^=ee,H[11]^=J,H[20]^=ee,H[21]^=J,H[30]^=ee,H[31]^=J,H[40]^=ee,H[41]^=J,ee=re^(me<<1|be>>>31),J=z^(be<<1|me>>>31),H[2]^=ee,H[3]^=J,H[12]^=ee,H[13]^=J,H[22]^=ee,H[23]^=J,H[32]^=ee,H[33]^=J,H[42]^=ee,H[43]^=J,ee=G^(Ce<<1|Fe>>>31),J=Q^(Fe<<1|Ce>>>31),H[4]^=ee,H[5]^=J,H[14]^=ee,H[15]^=J,H[24]^=ee,H[25]^=J,H[34]^=ee,H[35]^=J,H[44]^=ee,H[45]^=J,ee=me^(Ue<<1|Ke>>>31),J=be^(Ke<<1|Ue>>>31),H[6]^=ee,H[7]^=J,H[16]^=ee,H[17]^=J,H[26]^=ee,H[27]^=J,H[36]^=ee,H[37]^=J,H[46]^=ee,H[47]^=J,ee=Ce^(re<<1|z>>>31),J=Fe^(z<<1|re>>>31),H[8]^=ee,H[9]^=J,H[18]^=ee,H[19]^=J,H[28]^=ee,H[29]^=J,H[38]^=ee,H[39]^=J,H[48]^=ee,H[49]^=J,lt=H[0],Ee=H[1],ot=H[11]<<4|H[10]>>>28,Vt=H[10]<<4|H[11]>>>28,he=H[20]<<3|H[21]>>>29,Re=H[21]<<3|H[20]>>>29,ae=H[31]<<9|H[30]>>>23,de=H[30]<<9|H[31]>>>23,Rt=H[40]<<18|H[41]>>>14,gt=H[41]<<18|H[40]>>>14,pt=H[2]<<1|H[3]>>>31,tr=H[3]<<1|H[2]>>>31,He=H[13]<<12|H[12]>>>20,qe=H[12]<<12|H[13]>>>20,Ft=H[22]<<10|H[23]>>>22,yt=H[23]<<10|H[22]>>>22,Je=H[33]<<13|H[32]>>>19,et=H[32]<<13|H[33]>>>19,ue=H[42]<<2|H[43]>>>30,ve=H[43]<<2|H[42]>>>30,Cr=H[5]<<30|H[4]>>>2,Gt=H[4]<<30|H[5]>>>2,zt=H[14]<<6|H[15]>>>26,At=H[15]<<6|H[14]>>>26,Ie=H[25]<<11|H[24]>>>21,Ne=H[24]<<11|H[25]>>>21,Ze=H[34]<<15|H[35]>>>17,Pt=H[35]<<15|H[34]>>>17,it=H[45]<<29|H[44]>>>3,ut=H[44]<<29|H[45]>>>3,W=H[6]<<28|H[7]>>>4,ie=H[7]<<28|H[6]>>>4,Sr=H[17]<<23|H[16]>>>9,cr=H[16]<<23|H[17]>>>9,mt=H[26]<<25|H[27]>>>7,St=H[27]<<25|H[26]>>>7,$e=H[36]<<21|H[37]>>>11,je=H[37]<<21|H[36]>>>11,xt=H[47]<<24|H[46]>>>8,Jt=H[46]<<24|H[47]>>>8,qt=H[8]<<27|H[9]>>>5,Wt=H[9]<<27|H[8]>>>5,pe=H[18]<<20|H[19]>>>12,we=H[19]<<20|H[18]>>>12,br=H[29]<<7|H[28]>>>25,Z=H[28]<<7|H[29]>>>25,dt=H[38]<<8|H[39]>>>24,Nt=H[39]<<8|H[38]>>>24,K=H[48]<<14|H[49]>>>18,F=H[49]<<14|H[48]>>>18,H[0]=lt^~He&Ie,H[1]=Ee^~qe&Ne,H[10]=W^~pe&he,H[11]=ie^~we&Re,H[20]=pt^~zt&mt,H[21]=tr^~At&St,H[30]=qt^~ot&Ft,H[31]=Wt^~Vt&yt,H[40]=Cr^~Sr&br,H[41]=Gt^~cr&Z,H[2]=He^~Ie&$e,H[3]=qe^~Ne&je,H[12]=pe^~he&Je,H[13]=we^~Re&et,H[22]=zt^~mt&dt,H[23]=At^~St&Nt,H[32]=ot^~Ft&Ze,H[33]=Vt^~yt&Pt,H[42]=Sr^~br&ae,H[43]=cr^~Z&de,H[4]=Ie^~$e&K,H[5]=Ne^~je&F,H[14]=he^~Je&it,H[15]=Re^~et&ut,H[24]=mt^~dt&Rt,H[25]=St^~Nt>,H[34]=Ft^~Ze&xt,H[35]=yt^~Pt&Jt,H[44]=br^~ae&ue,H[45]=Z^~de&ve,H[6]=$e^~K<,H[7]=je^~F&Ee,H[16]=Je^~it&W,H[17]=et^~ut&ie,H[26]=dt^~Rt&pt,H[27]=Nt^~gt&tr,H[36]=Ze^~xt&qt,H[37]=Pt^~Jt&Wt,H[46]=ae^~ue&Cr,H[47]=de^~ve&Gt,H[8]=K^~lt&He,H[9]=F^~Ee&qe,H[18]=it^~W&pe,H[19]=ut^~ie&we,H[28]=Rt^~pt&zt,H[29]=gt^~tr&At,H[38]=xt^~qt&ot,H[39]=Jt^~Wt&Vt,H[48]=ue^~Cr&Sr,H[49]=ve^~Gt&cr,H[0]^=w[te],H[1]^=w[te+1]};if(o)t.exports=x;else for(L=0;L<_.length;++L)i[_[L]]=x[_[L]]})()})(jK);var zye=jK.exports;const Wye=Lo(zye);function _i(t){return"0x"+Wye.keccak_256(er(t))}const Hye="rlp/5.7.0",Zc=new De(Hye);function IO(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function MO(t,e,r){let n=0;for(let i=0;ie+1+n&&Zc.throwError("child data too short",De.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function PK(t,e){if(t.length===0&&Zc.throwError("data too short",De.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&Zc.throwError("data short segment too short",De.errors.BUFFER_OVERRUN,{});const n=MO(t,e+1,r);return e+1+r+n>t.length&&Zc.throwError("data long segment too short",De.errors.BUFFER_OVERRUN,{}),TO(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&Zc.throwError("data array too short",De.errors.BUFFER_OVERRUN,{}),TO(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&Zc.throwError("data array too short",De.errors.BUFFER_OVERRUN,{});const n=MO(t,e+1,r);e+1+r+n>t.length&&Zc.throwError("data array too short",De.errors.BUFFER_OVERRUN,{});const i=Bt(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&&Zc.throwError("data too short",De.errors.BUFFER_OVERRUN,{});const n=Bt(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:Bt(t[e])}}function SN(t){const e=er(t),r=PK(e,0);return r.consumed!==e.length&&Zc.throwArgumentError("invalid rlp data","data",t),r.result}const Gye="address/5.7.0",Yp=new De(Gye);function kO(t){Kr(t,20)||Yp.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=er(_i(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 qye=9007199254740991;function Vye(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const AN={};for(let t=0;t<10;t++)AN[String(t)]=String(t);for(let t=0;t<26;t++)AN[String.fromCharCode(65+t)]=String(10+t);const NO=Math.floor(Vye(qye));function Yye(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>AN[n]).join("");for(;e.length>=NO;){let n=e.substring(0,NO);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 Ir(t){let e=null;if(typeof t!="string"&&Yp.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=kO(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Yp.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)!==Yye(t)&&Yp.throwArgumentError("bad icap checksum","address",t),e=Uye(t.substring(4));e.length<40;)e="0"+e;e=kO("0x"+e)}else Yp.throwArgumentError("invalid address","address",t);return e}function Kye(t){try{return Ir(t),!0}catch{}return!1}function RK(t){let e=null;try{e=Ir(t.from)}catch{Yp.throwArgumentError("missing from address","transaction",t)}const r=q0(er(nt.from(t.nonce).toHexString()));return Ir(Na(_i(A3([e,r])),12))}const Jye="properties/5.7.0";var Qye=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const M5=new De(Jye);function st(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function ou(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 vi(t){return Qye(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(a=>({key:n,value:a}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function DK(t,e){(!t||typeof t!="object")&&M5.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||M5.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Ri(t){const e={};for(const r in t)e[r]=t[r];return e}const Zye={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function OK(t){if(t==null||Zye[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;rDd(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&st(e,r,Dd(n))}return e}return M5.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Dd(t){return Xye(t)}class I3{constructor(e){for(const r in e)this[r]=Dd(e[r])}}const ewe="abstract-provider/5.7.0";var twe=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const rwe=new De(ewe);class nwe extends I3{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class h9{constructor(){rwe.checkAbstract(new.target,h9),st(this,"_isProvider",!0)}getFeeData(){return twe(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield vi({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(s=>null)});let n=null,i=null,a=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,a=nt.from("1500000000"),i=e.baseFeePerGas.mul(2).add(a)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:a,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 iwe="networks/5.7.1",LO=new De(iwe);function awe(t){return t&&typeof t.renetwork=="function"}function gd(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 a=["goerli","ropsten","rinkeby","sepolia"];try{const s=new r.PocketProvider(t,n.pocket);s.network&&a.indexOf(s.network.name)===-1&&i.push(s)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const a=["ropsten"],s=new r.AnkrProvider(t,n.ankr);s.network&&a.indexOf(s.network.name)===-1&&i.push(s)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let a=1;return n.quorum!=null?a=n.quorum:t==="homestead"&&(a=2),new r.FallbackProvider(i,a)}return i[0]};return e.renetwork=function(r){return gd(r)},e}function T5(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return T5(t,n)},r}const jO={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:gd("homestead")},$O={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:gd("ropsten")},PO={chainId:63,name:"classicMordor",_defaultProvider:T5("https://www.ethercluster.com/mordor","classicMordor")},c4={unspecified:{chainId:0,name:"unspecified"},homestead:jO,mainnet:jO,morden:{chainId:2,name:"morden"},ropsten:$O,testnet:$O,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:gd("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:gd("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:gd("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:gd("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:T5("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:PO,classicTestnet:PO,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:T5("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:gd("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:gd("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 swe(t){if(t==null)return null;if(typeof t=="number"){for(const n in c4){const i=c4[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=c4[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=c4[t.name];if(!e)return typeof t.chainId!="number"&&LO.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&LO.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(awe(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}function FK(t){t=atob(t);const e=[];for(let r=0;r0;)n.push(s%this.base),s=s/this.base|0}let i="";for(let a=0;r[a]===0&&a=0;--a)i+=this.alphabet[n[a]];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(;a>0;)r.push(a&255),a>>=8}for(let n=0;e[n]===this._leader&&n>6===2;s++)a++;return a}return t===yo.OVERRUN?r.length-e-1:0}function pwe(t,e,r,n,i){return t===yo.OVERLONG?(n.push(i),0):(n.push(65533),HK(t,e,r))}const gwe=Object.freeze({error:hwe,ignore:HK,replace:pwe});function GK(t,e){e==null&&(e=gwe.error),t=er(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let a=null,s=null;if((i&224)===192)a=1,s=127;else if((i&240)===224)a=2,s=2047;else if((i&248)===240)a=3,s=65535;else{(i&192)===128?n+=e(yo.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(yo.BAD_PREFIX,n-1,t,r);continue}if(n-1+a>=t.length){n+=e(yo.OVERRUN,n-1,t,r);continue}let o=i&(1<<8-a-1)-1;for(let l=0;l1114111){n+=e(yo.OUT_OF_RANGE,n-1-a,t,r,o);continue}if(o>=55296&&o<=57343){n+=e(yo.UTF16_SURROGATE,n-1-a,t,r,o);continue}if(o<=s){n+=e(yo.OVERLONG,n-1-a,t,r,o);continue}r.push(o)}}return r}function Ao(t,e=vw.current){e!=vw.current&&(WK.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 a=t.charCodeAt(n);if(n>=t.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");const s=65536+((i&1023)<<10)+(a&1023);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return er(r)}function mwe(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function bm(t,e){return mwe(GK(t,e))}function ywe(t,e=vw.current){return GK(Ao(t,e))}function Kp(t){return _i(Ao(t))}const qK="hash/5.7.0";function VK(t,e){e==null&&(e=1);const r=[],n=r.forEach,i=function(a,s){n.call(a,function(o){s>0&&Array.isArray(o)?i(o,s-1):r.push(o)})};return i(t,e),r}function wwe(t){const e={};for(let r=0;r>--l&1}const f=31,h=Math.pow(2,f),g=h>>>1,m=g>>1,w=h-1;let C=0;for(let j=0;j1;){let se=U+I>>>1;j>>1|u(),B=B<<1^g,V=(V^g)<<1|g|1;b=B,A=1+V-B}let S=n-4;return v.map(j=>{switch(j-S){case 3:return S+65792+(t[o++]<<16|t[o++]<<8|t[o++]);case 2:return S+256+(t[o++]<<8|t[o++]);case 1:return S+t[o++];default:return j-1}})}function bwe(t){let e=0;return()=>t[e++]}function xwe(t){return bwe(vwe(t))}function Ewe(t){return t&1?~t>>1:t>>1}function _we(t,e){let r=Array(t);for(let n=0;ne[s]):r}function Swe(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(Iwe(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(Mwe(r,t))}return wwe(VK(e))}function Awe(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function YK(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[s].push(a));return n}function Iwe(t,e){let r=1+e(),n=e(),i=Awe(e),a=YK(i.length,1+t,e);return VK(a.map((s,o)=>{const l=s[0],c=s.slice(1);return Array(i[o]).fill(void 0).map((u,f)=>{let h=f*n;return[l+f*r,c.map(g=>g+h)]})}))}function Mwe(t,e){let r=1+e();return YK(r,1+t,e).map(i=>[i[0],i.slice(1)])}function Twe(t){let e=k5(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let c=k5(t,e);if(c.length==0)break;n.push({set:new Set(c),node:r()})}n.sort((c,u)=>u.set.size-c.set.size);let i=t(),a=i%3;i=i/3|0;let s=!!(i&1);i>>=1;let o=i==1,l=i==2;return{branches:n,valid:a,fe0f:s,save:o,check:l}}}function kwe(){return xwe(FK("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 p9=kwe(),Nwe=new Set(k5(p9)),Lwe=new Set(k5(p9)),jwe=Swe(p9),$we=Twe(p9),DO=45,OO=95;function KK(t){return ywe(t)}function Pwe(t){return t.filter(e=>e!=65039)}function JK(t){for(let e of t.split(".")){let r=KK(e);try{for(let n=r.lastIndexOf(OO)-1;n>=0;n--)if(r[n]!==OO)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===DO&&r[3]===DO)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function Rwe(t){return JK(Dwe(t,Pwe))}function Dwe(t,e){let r=KK(t).reverse(),n=[];for(;r.length;){let i=Fwe(r);if(i){n.push(...e(i));continue}let a=r.pop();if(Nwe.has(a)){n.push(a);continue}if(Lwe.has(a))continue;let s=jwe[a];if(s){n.push(...s);continue}throw new Error(`Disallowed codepoint: 0x${a.toString(16).toUpperCase()}`)}return JK(Owe(String.fromCodePoint(...n)))}function Owe(t){return t.normalize("NFC")}function Fwe(t,e){var r;let n=$we,i,a,s=[],o=t.length;for(;o;){let l=t[--o];if(n=(r=n.branches.find(c=>c.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)a=l;else if(n.check&&l===a)break;s.push(l),n.fe0f&&(s.push(65039),o>0&&t[o-1]==65039&&o--),n.valid&&(i=s.slice(),n.valid==2&&i.splice(1,1),t.length=o)}return i}const Uwe=new De(qK),QK=new Uint8Array(32);QK.fill(0);function FO(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function ZK(t){const e=Ao(Rwe(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(FO(e.slice(n))),r}function w6(t){typeof t!="string"&&Uwe.throwArgumentError("invalid ENS name; not a string","name",t);let e=QK;const r=ZK(t);for(;r.length;)e=_i(Us([e,_i(r.pop())]));return Bt(e)}function Bwe(t){return Bt(Us(ZK(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 zwe=`Ethereum Signed Message: -`;function XK(t){return typeof t=="string"&&(t=Ao(t)),_i(Us([Ao(zwe),Ao(String(t.length)),t]))}var Wwe=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Vn=new De(qK),eJ=new Uint8Array(32);eJ.fill(0);const Hwe=nt.from(-1),tJ=nt.from(0),rJ=nt.from(1),Gwe=nt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function qwe(t){const e=er(t),r=e.length%32;return r?Ds([e,eJ.slice(r)]):Bt(e)}const Vwe=Bn(rJ.toHexString(),32),Ywe=Bn(tJ.toHexString(),32),UO={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},nC=["name","version","chainId","verifyingContract","salt"];function BO(t){return function(e){return typeof e!="string"&&Vn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Kwe={name:BO("name"),version:BO("version"),chainId:function(t){try{return nt.from(t).toString()}catch{}return Vn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ir(t).toLowerCase()}catch{}return Vn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=er(t);if(e.length!==32)throw new Error("bad length");return Bt(e)}catch{}return Vn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function iC(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))&&Vn.throwArgumentError("invalid numeric width","type",t);const i=Gwe.mask(r?n-1:n),a=r?i.add(rJ).mul(Hwe):tJ;return function(s){const o=nt.from(s);return(o.lt(a)||o.gt(i))&&Vn.throwArgumentError(`value out-of-bounds for ${t}`,"value",s),Bn(o.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))&&Vn.throwArgumentError("invalid bytes width","type",t),function(n){return er(n).length!==r&&Vn.throwArgumentError(`invalid length for ${t}`,"value",n),qwe(n)}}}switch(t){case"address":return function(e){return Bn(Ir(e),32)};case"bool":return function(e){return e?Vwe:Ywe};case"bytes":return function(e){return _i(e)};case"string":return function(e){return Kp(e)}}return null}function zO(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class ho{constructor(e){st(this,"types",Object.freeze(Dd(e))),st(this,"_encoderCache",{}),st(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(o=>{r[o]={},n[o]=[],i[o]={}});for(const o in e){const l={};e[o].forEach(c=>{l[c.name]&&Vn.throwArgumentError(`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(o)}`,"types",e),l[c.name]=!0;const u=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===o&&Vn.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!iC(u)&&(n[u]||Vn.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(o),r[o][u]=!0)})}const a=Object.keys(n).filter(o=>n[o].length===0);a.length===0?Vn.throwArgumentError("missing primary type","types",e):a.length>1&&Vn.throwArgumentError(`ambiguous primary types or unused types: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"types",e),st(this,"primaryType",a[0]);function s(o,l){l[o]&&Vn.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),l[o]=!0,Object.keys(r[o]).forEach(c=>{n[c]&&(s(c,l),Object.keys(l).forEach(u=>{i[u][c]=!0}))}),delete l[o]}s(this.primaryType,{});for(const o in i){const l=Object.keys(i[o]);l.sort(),this._types[o]=zO(o,e[o])+l.map(c=>zO(c,e[c])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=iC(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],a=this.getEncoder(i),s=parseInt(r[3]);return o=>{s>=0&&o.length!==s&&Vn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",o);let l=o.map(a);return this._types[i]&&(l=l.map(_i)),_i(Ds(l))}}const n=this.types[e];if(n){const i=Kp(this._types[e]);return a=>{const s=n.map(({name:o,type:l})=>{const c=this.getEncoder(l)(a[o]);return this._types[l]?_i(c):c});return s.unshift(i),Ds(s)}}return Vn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||Vn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return _i(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(iC(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const s=i[1],o=parseInt(i[3]);return o>=0&&r.length!==o&&Vn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(s,l,n))}const a=this.types[e];return a?a.reduce((s,{name:o,type:l})=>(s[o]=this._visit(l,r[o],n),s),{}):Vn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new ho(e)}static getPrimaryType(e){return ho.from(e).primaryType}static hashStruct(e,r,n){return ho.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=UO[n];i||Vn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>nC.indexOf(n.name)-nC.indexOf(i.name)),ho.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Ds(["0x1901",ho.hashDomain(e),ho.from(r).hash(n)])}static hash(e,r,n){return _i(ho.encode(e,r,n))}static resolveNames(e,r,n,i){return Wwe(this,void 0,void 0,function*(){e=Ri(e);const a={};e.verifyingContract&&!Kr(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const s=ho.from(r);s.visit(n,(o,l)=>(o==="address"&&!Kr(l,20)&&(a[l]="0x"),l));for(const o in a)a[o]=yield i(o);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),n=s.visit(n,(o,l)=>o==="address"&&a[l]?a[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){ho.hashDomain(e);const i={},a=[];nC.forEach(l=>{const c=e[l];c!=null&&(i[l]=Kwe[l](c),a.push({name:l,type:UO[l]}))});const s=ho.from(r),o=Ri(r);return o.EIP712Domain?Vn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):o.EIP712Domain=a,s.encode(n),{types:o,domain:i,primaryType:s.primaryType,message:s.visit(n,(l,c)=>{if(l.match(/^bytes(\d*)/))return Bt(er(c));if(l.match(/^u?int/))return nt.from(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return typeof c!="string"&&Vn.throwArgumentError("invalid string","value",c),c}return Vn.throwArgumentError("unsupported type","type",l)})}}}var M3={},Ur={},w1=nJ;function nJ(t,e){if(!t)throw new Error(e||"Assertion failed")}nJ.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var kI={exports:{}};typeof Object.create=="function"?kI.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:kI.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 gs=kI.exports,Jwe=w1,Qwe=gs;Ur.inherits=Qwe;function Zwe(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function Xwe(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++]=a&63|128):Zwe(t,i)?(a=65536+((a&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=a&63|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=a&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Ur.htonl=iJ;function t3e(t,e){for(var r="",n=0;n>>0}return a}Ur.join32=r3e;function n3e(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=a&255):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=a&255)}return r}Ur.split32=n3e;function i3e(t,e){return t>>>e|t<<32-e}Ur.rotr32=i3e;function a3e(t,e){return t<>>32-e}Ur.rotl32=a3e;function s3e(t,e){return t+e>>>0}Ur.sum32=s3e;function o3e(t,e,r){return t+e+r>>>0}Ur.sum32_3=o3e;function l3e(t,e,r,n){return t+e+r+n>>>0}Ur.sum32_4=l3e;function c3e(t,e,r,n,i){return t+e+r+n+i>>>0}Ur.sum32_5=c3e;function u3e(t,e,r,n){var i=t[e],a=t[e+1],s=n+a>>>0,o=(s>>0,t[e+1]=s}Ur.sum64=u3e;function d3e(t,e,r,n){var i=e+n>>>0,a=(i>>0}Ur.sum64_hi=d3e;function f3e(t,e,r,n){var i=e+n;return i>>>0}Ur.sum64_lo=f3e;function h3e(t,e,r,n,i,a,s,o){var l=0,c=e;c=c+n>>>0,l+=c>>0,l+=c>>0,l+=c>>0}Ur.sum64_4_hi=h3e;function p3e(t,e,r,n,i,a,s,o){var l=e+n+a+o;return l>>>0}Ur.sum64_4_lo=p3e;function g3e(t,e,r,n,i,a,s,o,l,c){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}Ur.sum64_5_hi=g3e;function m3e(t,e,r,n,i,a,s,o,l,c){var u=e+n+a+o+c;return u>>>0}Ur.sum64_5_lo=m3e;function y3e(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Ur.rotr64_hi=y3e;function w3e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ur.rotr64_lo=w3e;function v3e(t,e,r){return t>>>r}Ur.shr64_hi=v3e;function b3e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ur.shr64_lo=b3e;var xm={},WO=Ur,x3e=w1;function g9(){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}xm.BlockHash=g9;g9.prototype.update=function(e,r){if(e=WO.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=WO.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[a++]=e>>>16&255,i[a++]=e>>>8&255,i[a++]=e&255}else for(i[a++]=e&255,i[a++]=e>>>8&255,i[a++]=e>>>16&255,i[a++]=e>>>24&255,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,s=8;s>>3}Lu.g0_256=A3e;function I3e(t){return hu(t,17)^hu(t,19)^t>>>10}Lu.g1_256=I3e;var $g=Ur,M3e=xm,T3e=Lu,aC=$g.rotl32,L2=$g.sum32,k3e=$g.sum32_5,N3e=T3e.ft_1,uJ=M3e.BlockHash,L3e=[1518500249,1859775393,2400959708,3395469782];function Cu(){if(!(this instanceof Cu))return new Cu;uJ.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}$g.inherits(Cu,uJ);var j3e=Cu;Cu.blockSize=512;Cu.outSize=160;Cu.hmacStrength=80;Cu.padLength=64;Cu.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()),bve(e.length<=this.blockSize);for(var r=e.length;r{a[o.toLowerCase()]=s}):n.headers.keys().forEach(s=>{a[s.toLowerCase()]=n.headers.get(s)}),{headers:a,statusCode:n.status,statusMessage:n.statusText,body:er(new Uint8Array(i))}})}var Sve=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const ql=new De(Eve);function YO(t){return new Promise(e=>{setTimeout(e,t)})}function wf(t,e){if(t==null)return null;if(typeof t=="string")return t;if(xN(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return bm(t)}catch{}return Bt(t)}return t}function Ave(t){return Ao(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function Ive(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;ql.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,a=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;ql.assertArgument(a>0&&a%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",a);const s=typeof t=="object"?!!t.errorPassThrough:!1,o={};let l=null;const c={method:"GET"};let u=!1,f=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&ql.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(f=t.timeout),t.headers)for(const v in t.headers)o[v.toLowerCase()]={key:v,value:String(t.headers[v])},["if-none-match","if-modified-since"].indexOf(v.toLowerCase())>=0&&(u=!0);if(c.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&ql.throwError("basic authentication requires a secure https url",De.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const v=t.user+":"+t.password;o.authorization={key:"Authorization",value:"Basic "+UK(Ao(v))}}t.skipFetchSetup!=null&&(c.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(c.fetchOptions=Ri(t.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),g=l?l.match(h):null;if(g)try{const v={statusCode:200,statusMessage:"OK",headers:{"content-type":g[1]||"text/plain"},body:g[2]?FK(g[3]):Ave(g[3])};let b=v.body;return r&&(b=r(v.body,v)),Promise.resolve(b)}catch(v){ql.throwError("processing response error",De.errors.SERVER_ERROR,{body:wf(g[1],g[2]),error:v,requestBody:null,requestMethod:"GET",url:l})}e&&(c.method="POST",c.body=e,o["content-type"]==null&&(o["content-type"]={key:"Content-Type",value:"application/octet-stream"}),o["content-length"]==null&&(o["content-length"]={key:"Content-Length",value:String(e.length)}));const m={};Object.keys(o).forEach(v=>{const b=o[v];m[b.key]=b.value}),c.headers=m;const w=function(){let v=null;return{promise:new Promise(function(S,j){f&&(v=setTimeout(()=>{v!=null&&(v=null,j(ql.makeError("timeout",De.errors.TIMEOUT,{requestBody:wf(c.body,m["content-type"]),requestMethod:c.method,timeout:f,url:l})))},f))}),cancel:function(){v!=null&&(clearTimeout(v),v=null)}}}(),C=function(){return Sve(this,void 0,void 0,function*(){for(let v=0;v=300)&&(w.cancel(),ql.throwError("bad response",De.errors.SERVER_ERROR,{status:b.statusCode,headers:b.headers,body:wf(A,b.headers?b.headers["content-type"]:null),requestBody:wf(c.body,m["content-type"]),requestMethod:c.method,url:l})),r)try{const S=yield r(A,b);return w.cancel(),S}catch(S){if(S.throttleRetry&&v{let o=null;if(a!=null)try{o=JSON.parse(bm(a))}catch(l){ql.throwError("invalid JSON",De.errors.SERVER_ERROR,{body:a,error:l})}return r&&(o=r(o,s)),o},i=null;if(e!=null){i=Ao(e);const a=typeof t=="string"?{url:t}:Ri(t);a.headers?Object.keys(a.headers).filter(o=>o.toLowerCase()==="content-type").length!==0||(a.headers=Ri(a.headers),a.headers["content-type"]="application/json"):a.headers={"content-type":"application/json"},t=a}return Ive(t,i,n)}function uy(t,e){return e||(e={}),e=Ri(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,a=!1;const s=()=>a?!1:(a=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{s()&&n(new Error("timeout"))},e.timeout));const o=e.retryLimit;let l=0;function c(){return t().then(function(u){if(u!==void 0)s()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",c);else if(e.onceBlock)e.onceBlock.once("block",c);else if(!a){if(l++,l>o){s()&&n(new Error("retry limit reached"));return}let f=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));fe.ceiling&&(f=e.ceiling),setTimeout(c,f)}return null},function(u){s()&&n(u)})}c()})}var N5="qpzry9x8gf2tvdw0s3jn54khce6mua7l",jI={};for(var d4=0;d4>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 xJ(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=fg(e)^n>>5}for(e=fg(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=xJ(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",a=0;a>5)throw new Error("Non 5-bit word");n=fg(n)^s,i+=N5.charAt(s)}for(a=0;a<6;++a)n=fg(n);for(n^=1,a=0;a<6;++a){var o=n>>(5-a)*5&31;i+=N5.charAt(o)}return i}function EJ(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 a=t.slice(0,i),s=t.slice(i+1);if(s.length<6)return"Data too short";var o=xJ(a);if(typeof o=="string")return o;for(var l=[],c=0;c=s.length)&&l.push(f)}return o!==1?"Invalid checksum for "+t:{prefix:a,words:l}}function Tve(){var t=EJ.apply(null,arguments);if(typeof t=="object")return t}function kve(t){var e=EJ.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function m9(t,e,r,n){for(var i=0,a=0,s=(1<=r;)a-=r,o.push(i>>a&s);if(n)a>0&&o.push(i<=e)return"Excess padding";if(i<>8,h=u&255;f?l.push(f,h):l.push(h)}return l}r.toArray=n;function i(s){return s.length===1?"0"+s:s}r.zero2=i;function a(s){for(var o="",l=0;l(h>>1)-1?w=(h>>1)-C:w=C,g.isubn(w)):w=0,f[m]=w,g.iushrn(1)}return f}r.getNAF=n;function i(l,c){var u=[[],[]];l=l.clone(),c=c.clone();for(var f=0,h=0,g;l.cmpn(-f)>0||c.cmpn(-h)>0;){var m=l.andln(3)+f&3,w=c.andln(3)+h&3;m===3&&(m=-1),w===3&&(w=-1);var C;m&1?(g=l.andln(7)+f&7,(g===3||g===5)&&w===2?C=-m:C=m):C=0,u[0].push(C);var v;w&1?(g=c.andln(7)+h&7,(g===3||g===5)&&m===2?v=-w:v=w):v=0,u[1].push(v),2*f===C+1&&(f=1-f),2*h===v+1&&(h=1-h),l.iushrn(1),c.iushrn(1)}return u}r.getJSF=i;function a(l,c,u){var f="_"+c;l.prototype[c]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=a;function s(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=s;function o(l){return new yr(l,"hex","le")}r.intFromLE=o}),L5=Po.getNAF,Dve=Po.getJSF,j5=Po.assert;function xh(t,e){this.type=t,this.p=new yr(e.p,16),this.red=e.prime?yr.red(e.prime):yr.mont(this.p),this.zero=new yr(0).toRed(this.red),this.one=new yr(1).toRed(this.red),this.two=new yr(2).toRed(this.red),this.n=e.n&&new yr(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 v1=xh;xh.prototype.point=function(){throw new Error("Not implemented")};xh.prototype.validate=function(){throw new Error("Not implemented")};xh.prototype._fixedNafMul=function(e,r){j5(e.precomputed);var n=e._getDoubles(),i=L5(r,1,this._bitLength),a=(1<=o;c--)l=(l<<1)+i[c];s.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=a;h>0;h--){for(o=0;o=0;l--){for(var c=0;l>=0&&s[l]===0;l--)c++;if(l>=0&&c++,o=o.dblp(c),l<0)break;var u=s[l];j5(u!==0),e.type==="affine"?u>0?o=o.mixedAdd(a[u-1>>1]):o=o.mixedAdd(a[-u-1>>1].neg()):u>0?o=o.add(a[u-1>>1]):o=o.add(a[-u-1>>1].neg())}return e.type==="affine"?o.toP():o};xh.prototype._wnafMulAdd=function(e,r,n,i,a){var s=this._wnafT1,o=this._wnafT2,l=this._wnafT3,c=0,u,f,h;for(u=0;u=1;u-=2){var m=u-1,w=u;if(s[m]!==1||s[w]!==1){l[m]=L5(n[m],s[m],this._bitLength),l[w]=L5(n[w],s[w],this._bitLength),c=Math.max(l[m].length,c),c=Math.max(l[w].length,c);continue}var C=[r[m],null,null,r[w]];r[m].y.cmp(r[w].y)===0?(C[1]=r[m].add(r[w]),C[2]=r[m].toJ().mixedAdd(r[w].neg())):r[m].y.cmp(r[w].y.redNeg())===0?(C[1]=r[m].toJ().mixedAdd(r[w]),C[2]=r[m].add(r[w].neg())):(C[1]=r[m].toJ().mixedAdd(r[w]),C[2]=r[m].toJ().mixedAdd(r[w].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=Dve(n[m],n[w]);for(c=Math.max(b[0].length,c),l[m]=new Array(c),l[w]=new Array(c),f=0;f=0;u--){for(var I=0;u>=0;){var B=!0;for(f=0;f=0&&I++,j=j.dblp(I),u<0)break;for(f=0;f0?h=o[f][V-1>>1]:V<0&&(h=o[f][-V-1>>1].neg()),h.type==="affine"?j=j.mixedAdd(h):j=j.add(h))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};_l.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a=0&&(g=c,m=u),f.negative&&(f=f.neg(),h=h.neg()),g.negative&&(g=g.neg(),m=m.neg()),[{a:f,b:h},{a:g,b:m}]};Cl.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),s=n.b.neg().mul(e).divRound(this.n),o=a.mul(n.a),l=s.mul(i.a),c=a.mul(n.b),u=s.mul(i.b),f=e.sub(o).sub(l),h=c.add(u).neg();return{k1:f,k2:h}};Cl.prototype.pointFromX=function(e,r){e=new yr(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 a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)};Cl.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0};Cl.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,s=0;s":""};ua.prototype.isInfinity=function(){return this.inf};ua.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)};ua.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(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),s=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)};ua.prototype.getX=function(){return this.x.fromRed()};ua.prototype.getY=function(){return this.y.fromRed()};ua.prototype.mul=function(e){return e=new yr(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)};ua.prototype.mulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)};ua.prototype.jmulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)};ua.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)};ua.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(a){return a.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};ua.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 ba(t,e,r,n){v1.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new yr(0)):(this.x=new yr(e,16),this.y=new yr(r,16),this.z=new yr(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}TN(ba,v1.BasePoint);Cl.prototype.jpoint=function(e,r,n){return new ba(this,e,r,n)};ba.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)};ba.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ba.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),a=e.x.redMul(n),s=this.y.redMul(r.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),l=i.redSub(a),c=s.redSub(o);if(l.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=l.redSqr(),f=u.redMul(l),h=i.redMul(u),g=c.redSqr().redIAdd(f).redISub(h).redISub(h),m=c.redMul(h.redISub(g)).redISub(s.redMul(f)),w=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,m,w)};ba.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),a=this.y,s=e.y.redMul(r).redMul(this.z),o=n.redSub(i),l=a.redSub(s);if(o.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=n.redMul(c),h=l.redSqr().redIAdd(u).redISub(f).redISub(f),g=l.redMul(f.redISub(h)).redISub(a.redMul(u)),m=this.z.redMul(o);return this.curve.jpoint(h,g,m)};ba.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(a),this.x.cmp(n)===0)return!0}};ba.prototype.inspect=function(){return this.isInfinity()?"":""};ba.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var v6=Cm(function(t,e){var r=e;r.base=v1,r.short=Fve,r.mont=null,r.edwards=null}),b6=Cm(function(t,e){var r=e,n=Po.assert;function i(o){o.type==="short"?this.curve=new v6.short(o):o.type==="edwards"?this.curve=new v6.edwards(o):this.curve=new v6.mont(o),this.g=this.curve.g,this.n=this.curve.n,this.hash=o.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function a(o,l){Object.defineProperty(r,o,{configurable:!0,enumerable:!0,get:function(){var c=new i(l);return Object.defineProperty(r,o,{configurable:!0,enumerable:!0,value:c}),c}})}a("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:Yc.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:Yc.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:Yc.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:Yc.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"]}),a("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:Yc.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Yc.sha256,gRed:!1,g:["9"]}),a("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:Yc.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var s;try{s=null.crash()}catch{s=void 0}a("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:Yc.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})});function sh(t){if(!(this instanceof sh))return new sh(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=sc.toArray(t.entropy,t.entropyEnc||"hex"),r=sc.toArray(t.nonce,t.nonceEnc||"hex"),n=sc.toArray(t.pers,t.persEnc||"hex");MN(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var CJ=sh;sh.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 a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};sh.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=sc.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length"};var Uve=Po.assert;function y9(t,e){if(t instanceof y9)return t;this._importDER(t,e)||(Uve(t.r&&t.s,"Signature without r or s"),this.r=new yr(t.r,16),this.s=new yr(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var w9=y9;function Bve(){this.place=0}function cC(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,a=0,s=e.place;a>>=0;return i<=127?!1:(e.place=s,i)}function JO(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)}y9.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=JO(r),n=JO(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];uC(i,r.length),i=i.concat(r),i.push(2),uC(i,n.length);var a=i.concat(n),s=[48];return uC(s,a.length),s=s.concat(a),Po.encode(s,e)};var zve=function(){throw new Error("unsupported")},SJ=Po.assert;function vl(t){if(!(this instanceof vl))return new vl(t);typeof t=="string"&&(SJ(Object.prototype.hasOwnProperty.call(b6,t),"Unknown curve "+t),t=b6[t]),t instanceof b6.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 Wve=vl;vl.prototype.keyPair=function(e){return new kN(this,e)};vl.prototype.keyFromPrivate=function(e,r){return kN.fromPrivate(this,e,r)};vl.prototype.keyFromPublic=function(e,r){return kN.fromPublic(this,e,r)};vl.prototype.genKeyPair=function(e){e||(e={});for(var r=new CJ({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||zve(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new yr(2));;){var a=new yr(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}};vl.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};vl.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 yr(e,16));for(var a=this.n.byteLength(),s=r.getPrivate().toArray("be",a),o=e.toArray("be",a),l=new CJ({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new yr(1)),u=0;;u++){var f=i.k?i.k(u):new yr(l.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(c)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var g=h.getX(),m=g.umod(this.n);if(m.cmpn(0)!==0){var w=f.invm(this.n).mul(m.mul(r.getPrivate()).iadd(e));if(w=w.umod(this.n),w.cmpn(0)!==0){var C=(h.getY().isOdd()?1:0)|(g.cmp(m)!==0?2:0);return i.canonical&&w.cmp(this.nh)>0&&(w=this.n.sub(w),C^=1),new w9({r:m,s:w,recoveryParam:C})}}}}}};vl.prototype.verify=function(e,r,n,i){e=this._truncateToN(new yr(e,16)),n=this.keyFromPublic(n,i),r=new w9(r,"hex");var a=r.r,s=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o=s.invm(this.n),l=o.mul(e).umod(this.n),c=o.mul(a).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.eqXToP(a)):(u=this.g.mulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.getX().umod(this.n).cmp(a)===0)};vl.prototype.recoverPubKey=function(t,e,r,n){SJ((3&r)===r,"The recovery param is more than two bits"),e=new w9(e,n);var i=this.n,a=new yr(t),s=e.r,o=e.s,l=r&1,c=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?s=this.curve.pointFromX(s.add(this.curve.n),l):s=this.curve.pointFromX(s,l);var u=e.r.invm(i),f=i.sub(a).mul(u).umod(i),h=o.mul(u).umod(i);return this.g.mulAdd(f,s,h)};vl.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new w9(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Hve=Cm(function(t,e){var r=e;r.version="6.5.4",r.utils=Po,r.rand=function(){throw new Error("unsupported")},r.curve=v6,r.curves=b6,r.ec=Wve,r.eddsa=null}),Gve=Hve.ec;const qve="signing-key/5.7.0",PI=new De(qve);let dC=null;function Tf(){return dC||(dC=new Gve("secp256k1")),dC}class Vve{constructor(e){st(this,"curve","secp256k1"),st(this,"privateKey",Bt(e)),V0(this.privateKey)!==32&&PI.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Tf().keyFromPrivate(er(this.privateKey));st(this,"publicKey","0x"+r.getPublic(!1,"hex")),st(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),st(this,"_isSigningKey",!0)}_addPoint(e){const r=Tf().keyFromPublic(er(this.publicKey)),n=Tf().keyFromPublic(er(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=Tf().keyFromPrivate(er(this.privateKey)),n=er(e);n.length!==32&&PI.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return f9({recoveryParam:i.recoveryParam,r:Bn("0x"+i.r.toString(16),32),s:Bn("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Tf().keyFromPrivate(er(this.privateKey)),n=Tf().keyFromPublic(er(AJ(e)));return Bn("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function Yve(t,e){const r=f9(e),n={r:er(r.r),s:er(r.s)};return"0x"+Tf().recoverPubKey(er(t),n,r.recoveryParam).encode("hex",!1)}function AJ(t,e){const r=er(t);return r.length===32?new Vve(r).publicKey:r.length===33?"0x"+Tf().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?Bt(r):PI.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Kve="transactions/5.7.0",Hs=new De(Kve);var QO;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(QO||(QO={}));function NN(t){return t==="0x"?null:Ir(t)}function $a(t){return t==="0x"?zK:nt.from(t)}const Jve=[{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"}],Qve={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Zve(t){const e=AJ(t);return Ir(Na(_i(Na(e,1)),12))}function LN(t,e){return Zve(Yve(er(t),e))}function wo(t,e){const r=q0(nt.from(t).toHexString());return r.length>32&&Hs.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function fC(t,e){return{address:Ir(t),storageKeys:(e||[]).map((r,n)=>(V0(r)!==32&&Hs.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function Sm(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&Hs.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),fC(r[0],r[1])):fC(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,a)=>(i[a]=!0,i),{});return fC(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function IJ(t){return Sm(t).map(e=>[e.address,e.storageKeys])}function MJ(t,e){if(t.gasPrice!=null){const n=nt.from(t.gasPrice),i=nt.from(t.maxFeePerGas||0);n.eq(i)||Hs.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[wo(t.chainId||0,"chainId"),wo(t.nonce||0,"nonce"),wo(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),wo(t.maxFeePerGas||0,"maxFeePerGas"),wo(t.gasLimit||0,"gasLimit"),t.to!=null?Ir(t.to):"0x",wo(t.value||0,"value"),t.data||"0x",IJ(t.accessList||[])];if(e){const n=f9(e);r.push(wo(n.recoveryParam,"recoveryParam")),r.push(q0(n.r)),r.push(q0(n.s))}return Ds(["0x02",A3(r)])}function TJ(t,e){const r=[wo(t.chainId||0,"chainId"),wo(t.nonce||0,"nonce"),wo(t.gasPrice||0,"gasPrice"),wo(t.gasLimit||0,"gasLimit"),t.to!=null?Ir(t.to):"0x",wo(t.value||0,"value"),t.data||"0x",IJ(t.accessList||[])];if(e){const n=f9(e);r.push(wo(n.recoveryParam,"recoveryParam")),r.push(q0(n.r)),r.push(q0(n.s))}return Ds(["0x01",A3(r)])}function Xve(t,e){DK(t,Qve);const r=[];Jve.forEach(function(i){let a=t[i.name]||[];const s={};i.numeric&&(s.hexPad="left"),a=er(Bt(a,s)),i.length&&a.length!==i.length&&a.length>0&&Hs.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,a),i.maxLength&&(a=q0(a),a.length>i.maxLength&&Hs.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,a)),r.push(Bt(a))});let n=0;return t.chainId!=null&&(n=t.chainId,typeof n!="number"&&Hs.throwArgumentError("invalid transaction.chainId","transaction",t)),n!==0&&(r.push(Bt(n)),r.push("0x"),r.push("0x")),A3(r)}function ebe(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&Hs.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),Xve(t);switch(t.type){case 1:return TJ(t,e);case 2:return MJ(t,e)}return Hs.throwError(`unsupported transaction type: ${t.type}`,De.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function kJ(t,e,r){try{const n=$a(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{Hs.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Bn(e[1],32),t.s=Bn(e[2],32);try{const n=_i(r(t));t.from=LN(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function tbe(t){const e=SN(t.slice(1));e.length!==9&&e.length!==12&&Hs.throwArgumentError("invalid component count for transaction type: 2","payload",Bt(t));const r=$a(e[2]),n=$a(e[3]),i={type:2,chainId:$a(e[0]).toNumber(),nonce:$a(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:$a(e[4]),to:NN(e[5]),value:$a(e[6]),data:e[7],accessList:Sm(e[8])};return e.length===9||(i.hash=_i(t),kJ(i,e.slice(9),MJ)),i}function rbe(t){const e=SN(t.slice(1));e.length!==8&&e.length!==11&&Hs.throwArgumentError("invalid component count for transaction type: 1","payload",Bt(t));const r={type:1,chainId:$a(e[0]).toNumber(),nonce:$a(e[1]).toNumber(),gasPrice:$a(e[2]),gasLimit:$a(e[3]),to:NN(e[4]),value:$a(e[5]),data:e[6],accessList:Sm(e[7])};return e.length===8||(r.hash=_i(t),kJ(r,e.slice(8),TJ)),r}function nbe(t){const e=SN(t);e.length!==9&&e.length!==6&&Hs.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:$a(e[0]).toNumber(),gasPrice:$a(e[1]),gasLimit:$a(e[2]),to:NN(e[3]),value:$a(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=nt.from(e[6]).toNumber()}catch{return r}if(r.r=Bn(e[7],32),r.s=Bn(e[8],32),nt.from(r.r).isZero()&&nt.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(Bt(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const a=_i(A3(i));try{r.from=LN(a,{r:Bt(r.r),s:Bt(r.s),recoveryParam:n})}catch{}r.hash=_i(t)}return r.type=null,r}function ibe(t){const e=er(t);if(e[0]>127)return nbe(e);switch(e[0]){case 1:return rbe(e);case 2:return tbe(e)}return Hs.throwError(`unsupported transaction type: ${e[0]}`,De.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const $2=new De(T3);class jt{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),o=this.hex.bind(this),l=this.number.bind(this),c=this.type.bind(this),u=f=>this.data(f,!0);return e.transaction={hash:s,type:c,accessList:jt.allowNull(this.accessList.bind(this),null),blockHash:jt.allowNull(s,null),blockNumber:jt.allowNull(l,null),transactionIndex:jt.allowNull(l,null),confirmations:jt.allowNull(l,null),from:r,gasPrice:jt.allowNull(n),maxPriorityFeePerGas:jt.allowNull(n),maxFeePerGas:jt.allowNull(n),gasLimit:n,to:jt.allowNull(r,null),value:n,nonce:l,data:a,r:jt.allowNull(this.uint256),s:jt.allowNull(this.uint256),v:jt.allowNull(l),creates:jt.allowNull(r,null),raw:jt.allowNull(a)},e.transactionRequest={from:jt.allowNull(r),nonce:jt.allowNull(l),gasLimit:jt.allowNull(n),gasPrice:jt.allowNull(n),maxPriorityFeePerGas:jt.allowNull(n),maxFeePerGas:jt.allowNull(n),to:jt.allowNull(r),value:jt.allowNull(n),data:jt.allowNull(u),type:jt.allowNull(l),accessList:jt.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:s,address:r,topics:jt.arrayOf(s),data:a,logIndex:l,blockHash:s},e.receipt={to:jt.allowNull(this.address,null),from:jt.allowNull(this.address,null),contractAddress:jt.allowNull(r,null),transactionIndex:l,root:jt.allowNull(o),gasUsed:n,logsBloom:jt.allowNull(a),blockHash:s,transactionHash:s,logs:jt.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:jt.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:jt.allowNull(n),status:jt.allowNull(l),type:c},e.block={hash:jt.allowNull(s),parentHash:s,number:l,timestamp:l,nonce:jt.allowNull(o),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:jt.allowNull(r),extraData:a,transactions:jt.allowNull(jt.arrayOf(s)),baseFeePerGas:jt.allowNull(n)},e.blockWithTransactions=Ri(e.block),e.blockWithTransactions.transactions=jt.allowNull(jt.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:jt.allowNull(i,void 0),toBlock:jt.allowNull(i,void 0),blockHash:jt.allowNull(s,void 0),address:jt.allowNull(r,void 0),topics:jt.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:jt.allowNull(l),blockHash:jt.allowNull(s),transactionIndex:l,removed:jt.allowNull(this.boolean.bind(this)),address:r,data:jt.allowFalsish(a,"0x"),topics:jt.arrayOf(s),transactionHash:s,logIndex:l},e}accessList(e){return Sm(e||[])}number(e){return e==="0x"?0:nt.from(e).toNumber()}type(e){return e==="0x"||e==null?0:nt.from(e).toNumber()}bigNumber(e){return nt.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),Kr(e))?e.toLowerCase():$2.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 Ir(e)}callAddress(e){if(!Kr(e,32))return null;const r=Ir(Na(e,12));return r===owe?null:r}contractAddress(e){return RK(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"||Kr(e))return EN(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return V0(n)!==32?$2.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=nt.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!Kr(e))throw new Error("invalid uint256");return Bn(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=jt.check(r,e);return i._difficulty=n==null?null:nt.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return jt.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&nt.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=jt.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;Kr(n)&&(n=nt.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),Kr(n)&&(n=nt.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 ibe(e)}receiptLog(e){return jt.check(this.formats.receiptLog,e)}receipt(e){const r=jt.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=nt.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&$2.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):$2.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&$2.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 jt.check(this.formats.filter,e)}filterLog(e){return jt.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const a=e[i](r[i]);a!==void 0&&(n[i]=a)}catch(a){throw a.checkKey=i,a.checkValue=r[i],a}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}}}var hr=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Mr=new De(T3),abe=10;function ZO(t){return t==null?"null":(V0(t)!==32&&Mr.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function XO(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[ZO(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return ZO(e)}).join("&")}function sbe(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 fp(t){if(typeof t=="string"){if(t=t.toLowerCase(),V0(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+XO(t);if(nwe.isForkEvent(t))throw Mr.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+XO(t.topics||[])}throw new Error("invalid event - "+t)}function P2(){return new Date().getTime()}function eF(t){return new Promise(e=>{setTimeout(e,t)})}const obe=["block","network","pending","poll"];let lbe=class{constructor(e,r,n){st(this,"tag",e),st(this,"listener",r),st(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=sbe(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||obe.indexOf(this.tag)>=0}};const cbe={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 hC(t){return Bn(nt.from(t).toHexString(),32)}function tF(t){return TI.encode(Us([t,Na(VO(VO(t)),0,4)]))}const NJ=new RegExp("^(ipfs)://(.*)$","i"),rF=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),NJ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function x6(t,e){try{return bm(bw(t,e))}catch{}return null}function bw(t,e){if(t==="0x")return null;const r=nt.from(Na(t,e,e+32)).toNumber(),n=nt.from(Na(t,r,r+32)).toNumber();return Na(t,r+32,r+32+n)}function pC(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Mr.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function nF(t){const e=er(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 ube(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function LJ(t){const e=[];let r=0;for(let n=0;nnt.from(e).eq(1)).catch(e=>{if(e.code===De.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return hr(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Ds([e,w6(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Ds(["0x9061b923",LJ([Bwe(this.name),n.data])]));try{let a=yield this.provider.call(n);return er(a).length%32===4&&Mr.throwError("resolver threw error",De.errors.CALL_EXCEPTION,{transaction:n,data:a}),i&&(a=bw(a,0)),a}catch(a){if(a.code===De.errors.CALL_EXCEPTION)return null;throw a}})}_fetchBytes(e,r){return hr(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?bw(n,0):null})}_getAddress(e,r){const n=cbe[String(e)];if(n==null&&Mr.throwError(`unsupported coin type: ${e}`,De.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=er(r);if(n.p2pkh!=null){const a=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(a){const s=parseInt(a[1],16);if(a[2].length===s*2&&s>=1&&s<=75)return tF(Us([[n.p2pkh],"0x"+a[2]]))}}if(n.p2sh!=null){const a=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){const s=parseInt(a[1],16);if(a[2].length===s*2&&s>=1&&s<=75)return tF(Us([[n.p2sh],"0x"+a[2]]))}}if(n.prefix!=null){const a=i[1];let s=i[0];if(s===0?a!==20&&a!==32&&(s=-1):s=-1,s>=0&&i.length===2+a&&a>=1&&a<=75){const o=KO.toWords(i.slice(2));return o.unshift(s),KO.encode(n.prefix,o)}}return null}getAddress(e){return hr(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===dwe?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===De.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",hC(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Mr.throwError("invalid or unsupported coin data",De.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return hr(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;ns[l])}return Mr.throwError("invalid or unsupported content hash data",De.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return hr(this,void 0,void 0,function*(){let r=Ao(e);r=Us([hC(64),hC(r.length),r]),r.length%32!==0&&(r=Us([r,Bn("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Bt(r));return n==null||n==="0x"?null:bm(n)})}}let gC=null,dbe=1;class fbe extends h9{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),st(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=ou(new.target,"getNetwork")(e);r?(st(this,"_network",r),this.emit("network",r,null)):Mr.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return hr(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||Mr.throwError("no network detected",De.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:st(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return uy(()=>this._ready().then(e=>e,e=>{if(!(e.code===De.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return gC==null&&(gC=new jt),gC}static getNetwork(e){return swe(e??"homestead")}ccipReadFetch(e,r,n){return hr(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),a=r.toLowerCase(),s=[];for(let o=0;o=0?null:JSON.stringify({data:a,sender:i}),f=yield IN({url:c,errorPassThrough:!0},u,(g,m)=>(g.status=m.statusCode,g));if(f.data)return f.data;const h=f.message||"unknown error";if(f.status>=400&&f.status<500)return Mr.throwError(`response not found during CCIP fetch: ${h}`,De.errors.SERVER_ERROR,{url:l,errorMessage:h});s.push(h)}return Mr.throwError(`error encountered during CCIP fetch: ${s.map(o=>JSON.stringify(o)).join(", ")}`,De.errors.SERVER_ERROR,{urls:n,errorMessages:s})})}_getInternalBlockNumber(e){return hr(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const a=yield i;if(P2()-a.respTime<=e)return a.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=P2(),n=vi({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:a})=>{if(a)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),a;const s=P2();return i=nt.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return hr(this,void 0,void 0,function*(){const e=dbe++,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)Mr.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Mr.makeError("network block skew detected",De.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 a=this._emitted[i];a!=="pending"&&n-a>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const a=i.hash;let s=this.getTransactionReceipt(a).then(o=>(!o||o.blockNumber==null||(this._emitted["t:"+a]=o.blockNumber,this.emit(a,o)),null)).catch(o=>{this.emit("error",o)});r.push(s);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const a=i.filter;a.fromBlock=i._lastBlockNumber+1,a.toBlock=n;const s=a.toBlock-this._maxFilterBlockRange;s>a.fromBlock&&(a.fromBlock=s),a.fromBlock<0&&(a.fromBlock=0);const o=this.getLogs(a).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(c=>{c.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=c.blockNumber),this._emitted["b:"+c.blockHash]=c.blockNumber,this._emitted["t:"+c.transactionHash]=c.blockNumber,this.emit(a,c)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(o)}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 hr(this,void 0,void 0,function*(){return Mr.throwError("provider does not support network detection",De.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return hr(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 eF(0),this._network;const n=Mr.makeError("underlying network changed",De.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=P2();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 hr(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return hr(this,void 0,void 0,function*(){const a=yield this.getTransactionReceipt(e);return(a?a.confirmations:0)>=r?a:new Promise((s,o)=>{const l=[];let c=!1;const u=function(){return c?!0:(c=!0,l.forEach(h=>{h()}),!1)},f=h=>{h.confirmations{this.removeListener(e,f)}),i){let h=i.startBlock,g=null;const m=w=>hr(this,void 0,void 0,function*(){c||(yield eF(1e3),this.getTransactionCount(i.from).then(C=>hr(this,void 0,void 0,function*(){if(!c){if(C<=i.nonce)h=w;else{{const v=yield this.getTransaction(e);if(v&&v.blockNumber!=null)return}for(g==null&&(g=h-3,g{c||this.once("block",m)}))});if(c)return;this.once("block",m),l.push(()=>{this.removeListener("block",m)})}if(typeof n=="number"&&n>0){const h=setTimeout(()=>{u()||o(Mr.makeError("timeout exceeded",De.errors.TIMEOUT,{timeout:n}))},n);h.unref&&h.unref(),l.push(()=>{clearTimeout(h)})}})})}getBlockNumber(){return hr(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return nt.from(e)}catch(r){return Mr.throwError("bad result from backend",De.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return nt.from(i)}catch(a){return Mr.throwError("bad result from backend",De.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:a})}})}getTransactionCount(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return nt.from(i).toNumber()}catch(a){return Mr.throwError("bad result from backend",De.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:a})}})}getCode(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return Bt(i)}catch(a){return Mr.throwError("bad result from backend",De.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:a})}})}getStorageAt(e,r,n){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(s=>EN(s))}),a=yield this.perform("getStorageAt",i);try{return Bt(a)}catch(s){return Mr.throwError("bad result from backend",De.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:a,error:s})}})}_wrapTransaction(e,r,n){if(r!=null&&V0(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Mr.throwError("Transaction hash mismatch from Provider.sendTransaction.",De.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(a,s)=>hr(this,void 0,void 0,function*(){a==null&&(a=1),s==null&&(s=0);let o;a!==0&&n!=null&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,a,s,o);return l==null&&a===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&Mr.throwError("transaction failed",De.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(a=>Bt(a)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const a=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,a,i)}catch(a){throw a.transaction=n,a.transactionHash=n.hash,a}})}_getTransactionRequest(e){return hr(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(a=>a?this._getAddress(a):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a?nt.from(a):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a?Bt(a):null))}),this.formatter.transactionRequest(yield vi(n))})}_getFilter(e){return hr(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 vi(r))})}_call(e,r,n){return hr(this,void 0,void 0,function*(){n>=abe&&Mr.throwError("CCIP read exceeded maximum redirections",De.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,a=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&a.substring(0,10)==="0x556f1830"&&V0(a)%32===4)try{const s=Na(a,4),o=Na(s,0,32);nt.from(o).eq(i)||Mr.throwError("CCIP Read sender did not match",De.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:a});const l=[],c=nt.from(Na(s,32,64)).toNumber(),u=nt.from(Na(s,c,c+32)).toNumber(),f=Na(s,c+32);for(let v=0;vhr(this,void 0,void 0,function*(){const a=yield this.perform("getBlock",i);if(a==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let s=null;for(let l=0;lthis._wrapTransaction(l)),o}return this.formatter.block(a)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return uy(()=>hr(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 s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return uy(()=>hr(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 s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return i}),{oncePoll:this})})}getLogs(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield vi({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),jt.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return hr(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return hr(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Mr.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 hr(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 iF(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return hr(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Mr.throwError("network does not support ENS",De.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+w6(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return hr(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(Kr(e))throw n}typeof e!="string"&&Mr.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return hr(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=x6(yield this.call({to:n,data:"0x691f3431"+w6(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return hr(this,void 0,void 0,function*(){let r=null;if(Kr(e)){const a=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",s=yield this._getResolver(a,"getAvatar");if(!s)return null;r=new iF(this,s,a);try{const o=yield r.getAvatar();if(o)return o.url}catch(o){if(o.code!==De.errors.CALL_EXCEPTION)throw o}try{const o=x6(yield this.call({to:s,data:"0x691f3431"+w6(a).substring(2)}),0);r=yield this.getResolver(o)}catch(o){if(o.code!==De.errors.CALL_EXCEPTION)throw o;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 Mr.throwError(e+" not implemented",De.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 lbe(fp(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=[],a=fp(e);return this._events=this._events.filter(s=>s.tag!==a?!0:(setTimeout(()=>{s.listener.apply(this,r)},0),n=!0,s.once?(i.push(s),!1):!0)),i.forEach(s=>{this._stopEvent(s)}),n}listenerCount(e){if(!e)return this._events.length;let r=fp(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=fp(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,a=fp(e);return this._events=this._events.filter(s=>s.tag!==a||s.listener!=r||i?!0:(i=!0,n.push(s),!1)),n.forEach(s=>{this._stopEvent(s)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=fp(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}const hbe="abstract-signer/5.7.0";var Bl=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const nl=new De(hbe),pbe=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],gbe=[De.errors.INSUFFICIENT_FUNDS,De.errors.NONCE_EXPIRED,De.errors.REPLACEMENT_UNDERPRICED];class k3{constructor(){nl.checkAbstract(new.target,k3),st(this,"_isSigner",!0)}getBalance(e){return Bl(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Bl(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Bl(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield vi(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Bl(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield vi(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Bl(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 Bl(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Bl(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Bl(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Bl(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)pbe.indexOf(n)===-1&&nl.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Ri(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()&&nl.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Bl(this,void 0,void 0,function*(){const r=yield vi(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Bl(this,void 0,void 0,function*(){if(i==null)return null;const a=yield this.resolveName(i);return a==null&&nl.throwArgumentError("provided ENS name resolves to null","tx.to",i),a})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?nl.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&nl.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 a=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=a,r.maxPriorityFeePerGas=a}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&nl.throwError("network does not support EIP-1559",De.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):nl.throwError("failed to get consistent fee data",De.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(gbe.indexOf(i.code)>=0)throw i;return nl.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",De.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]&&nl.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield vi(r)})}_checkProvider(e){this.provider||nl.throwError("missing provider",De.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class v9 extends k3{constructor(e,r){super(),st(this,"address",e),st(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{nl.throwError(e,De.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 v9(this.address,e)}}var ud=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const bi=new De(T3),mbe=["call","estimateGas"];function Py(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=Kr(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=Py(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return Py(JSON.parse(t),e)}catch{}return null}function jJ(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const a=Py(e,!0);if(a)return a.data;bi.throwError("missing revert data in call exception; Transaction reverted without a reason string",De.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let a=Py(e.body,!1);a==null&&(a=Py(e,!1)),a&&bi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",De.errors.UNPREDICTABLE_GAS_LIMIT,{reason:a.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===De.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)&&bi.throwError("insufficient funds for intrinsic transaction cost",De.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&bi.throwError("nonce has already been used",De.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&bi.throwError("replacement fee too low",De.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&bi.throwError("legacy pre-eip-155 transactions not supported",De.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),mbe.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&bi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",De.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function aF(t){return new Promise(function(e){setTimeout(e,t)})}function ybe(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 R2(t){return t&&t.toLowerCase()}const RI={};class $J extends k3{constructor(e,r,n){if(super(),e!==RI)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");st(this,"provider",r),n==null&&(n=0),typeof n=="string"?(st(this,"_address",this.provider.formatter.address(n)),st(this,"_index",null)):typeof n=="number"?(st(this,"_index",n),st(this,"_address",null)):bi.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return bi.throwError("cannot alter JSON-RPC Signer connection",De.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new wbe(RI,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&&bi.throwError("unknown account #"+this._index,De.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Ri(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Ri(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>ud(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&bi.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),vi({tx:vi(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&bi.throwArgumentError("from address mismatch","transaction",e):n.from=i;const a=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[a]).then(s=>s,s=>(typeof s.message=="string"&&s.message.match(/user denied/i)&&bi.throwError("user rejected transaction",De.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),jJ("sendTransaction",s,a)))})}signTransaction(e){return bi.throwError("signing transactions is unsupported",De.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return ud(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 uy(()=>ud(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 ud(this,void 0,void 0,function*(){const r=typeof e=="string"?Ao(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Bt(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&bi.throwError("user rejected signing",De.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return ud(this,void 0,void 0,function*(){const r=typeof e=="string"?Ao(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),Bt(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&bi.throwError("user rejected signing",De.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return ud(this,void 0,void 0,function*(){const i=yield ho.resolveNames(e,r,n,s=>this.provider.resolveName(s)),a=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[a.toLowerCase(),JSON.stringify(ho.getPayload(i.domain,r,i.value))])}catch(s){throw typeof s.message=="string"&&s.message.match(/user denied/i)&&bi.throwError("user rejected signing",De.errors.ACTION_REJECTED,{action:"_signTypedData",from:a,messageData:{domain:i.domain,types:r,value:i.value}}),s}})}unlock(e){return ud(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class wbe extends $J{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 vbe={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class PJ extends fbe{constructor(e,r){let n=r;n==null&&(n=new Promise((i,a)=>{setTimeout(()=>{this.detectNetwork().then(s=>{i(s)},s=>{a(s)})},0)})),super(n),e||(e=ou(this.constructor,"defaultUrl")()),typeof e=="string"?st(this,"connection",Object.freeze({url:e})):st(this,"connection",Object.freeze(Ri(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 ud(this,void 0,void 0,function*(){yield aF(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=ou(this.constructor,"getNetwork");try{return r(nt.from(e).toNumber())}catch(n){return bi.throwError("could not detect network",De.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return bi.throwError("could not detect network",De.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new $J(RI,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:Dd(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const a=IN(this.connection,JSON.stringify(n),ybe).then(s=>(this.emit("debug",{action:"response",request:n,response:s,provider:this}),s),s=>{throw this.emit("debug",{action:"response",error:s,request:n,provider:this}),s});return i&&(this._cache[e]=a,setTimeout(()=>{this._cache[e]=null},0)),a}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[R2(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[R2(r.address),r.blockTag]];case"getCode":return["eth_getCode",[R2(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[R2(r.address),Bn(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",[ou(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[ou(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=R2(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return ud(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&nt.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=yield this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(r=Ri(r),r.transaction=Ri(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&bi.throwError(e+" not implemented",De.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return jJ(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(a){if(e._pendingFilter!=r)return null;let s=Promise.resolve();return a.forEach(function(o){e._emitted["t:"+o.toLowerCase()]="pending",s=s.then(function(){return e.getTransaction(o).then(function(l){return e.emit("pending",l),null})})}),s.then(function(){return aF(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(a=>{})}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=Ri(vbe);if(r)for(const a in r)r[a]&&(n[a]=!0);DK(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(a){if(e[a]==null)return;const s=EN(nt.from(e[a]));a==="gasLimit"&&(a="gas"),i[a]=s}),["from","to","data"].forEach(function(a){e[a]!=null&&(i[a]=Bt(e[a]))}),e.accessList&&(i.accessList=Sm(e.accessList)),i}}var bbe=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const xbe=new De(T3);class Ebe extends PJ{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return bbe(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||xbe.throwError("no network detected",De.errors.UNKNOWN_ERROR,{}),this._network==null&&(st(this,"_network",r),this.emit("network",r,null))),r})}}const sF=new De(T3);let _be=1;function oF(t,e){const r="Web3LegacyFetcher";return function(n,i){const a={method:n,params:i,id:_be++,jsonrpc:"2.0"};return new Promise((s,o)=>{this.emit("debug",{action:"request",fetcher:r,request:Dd(a),provider:this}),e(a,(l,c)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:a,provider:this}),o(l);if(this.emit("debug",{action:"response",fetcher:r,request:a,response:c,provider:this}),c.error){const u=new Error(c.error.message);return u.code=c.error.code,u.data=c.error.data,o(u)}s(c.result)})})}}function Cbe(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Dd(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 $5 extends PJ{constructor(e,r){e==null&&sF.throwArgumentError("missing provider","provider",e);let n=null,i=null,a=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),a=e,e.request?(n===""&&(n="eip-1193:"),i=Cbe(e)):e.sendAsync?i=oF(e,e.sendAsync.bind(e)):e.send?i=oF(e,e.send.bind(e)):sF.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),st(this,"jsonRpcFetchFunc",i),st(this,"provider",a)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}function Sbe(t){if(typeof window>"u")return;const e=r=>t(r.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function Abe(){const t=new Set;let e=[];const r=()=>Sbe(i=>{e.some(({info:a})=>a.uuid===i.info.uuid)||(e=[...e,i],t.forEach(a=>a(e,{added:[i]})))});let n=r();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),n==null||n()},findProvider({rdns:i}){return e.find(a=>a.info.rdns===i)},getProviders(){return e},reset(){this.clear(),n==null||n(),n=r()},subscribe(i,{emitImmediately:a}={}){return t.add(i),a&&i(e,{added:e}),()=>t.delete(i)}}}var kt={},DI={exports:{}};(function(t,e){(function(r,n){var i="1.0.40",a="",s="?",o="function",l="undefined",c="object",u="string",f="major",h="model",g="name",m="type",w="vendor",C="version",v="architecture",b="console",A="mobile",S="tablet",j="smarttv",U="wearable",I="embedded",B=500,V="Amazon",se="Apple",Y="ASUS",N="BlackBerry",k="Browser",x="Chrome",_="Edge",L="Firefox",O="Google",P="Huawei",R="LG",M="Microsoft",D="Motorola",$="Opera",X="Samsung",le="Sharp",H="Sony",ee="Xiaomi",J="Zebra",te="Facebook",re="Chromium OS",z="Mac OS",G=" Browser",Q=function(je,K){var F={};for(var W in je)K[W]&&K[W].length%2===0?F[W]=K[W].concat(je[W]):F[W]=je[W];return F},me=function(je){for(var K={},F=0;F0?we.length===2?typeof we[1]==o?this[we[0]]=we[1].call(this,Re):this[we[0]]=we[1]:we.length===3?typeof we[1]===o&&!(we[1].exec&&we[1].test)?this[we[0]]=Re?we[1].call(this,Re,we[2]):n:this[we[0]]=Re?Re.replace(we[1],we[2]):n:we.length===4&&(this[we[0]]=Re?we[3].call(this,Re.replace(we[1],we[2])):n):this[we]=Re||n;F+=2}},lt=function(je,K){for(var F in K)if(typeof K[F]===c&&K[F].length>0){for(var W=0;W2&&(he[h]="iPad",he[m]=S),he},this.getEngine=function(){var he={};return he[g]=n,he[C]=n,Ke.call(he,W,pe.engine),he},this.getOS=function(){var he={};return he[g]=n,he[C]=n,Ke.call(he,W,pe.os),we&&!he[g]&&ie&&ie.platform&&ie.platform!="Unknown"&&(he[g]=ie.platform.replace(/chrome os/i,re).replace(/macos/i,z)),he},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return W},this.setUA=function(he){return W=typeof he===u&&he.length>B?Ue(he,B):he,this},this.setUA(W),this};Ie.VERSION=i,Ie.BROWSER=me([g,C,f]),Ie.CPU=me([v]),Ie.DEVICE=me([h,w,m,b,A,j,S,U,I]),Ie.ENGINE=Ie.OS=me([g,C]),t.exports&&(e=t.exports=Ie),e.UAParser=Ie;var Ne=typeof r!==l&&(r.jQuery||r.Zepto);if(Ne&&!Ne.ua){var $e=new Ie;Ne.ua=$e.getResult(),Ne.ua.get=function(){return $e.getUA()},Ne.ua.set=function(je){$e.setUA(je);var K=$e.getResult();for(var F in K)Ne.ua[F]=K[F]}}})(typeof window=="object"?window:Xt)})(DI,DI.exports);var Ibe=DI.exports;Object.defineProperty(kt,"__esModule",{value:!0});function Mbe(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Ba=E,Mn=Mbe(Ba),RJ=Ibe,Eh=new RJ,Ga=Eh.getBrowser(),Tbe=Eh.getCPU(),Ro=Eh.getDevice(),jN=Eh.getEngine(),_h=Eh.getOS(),N3=Eh.getUA(),DJ=function(e){return Eh.setUA(e)},L3=function(e){if(!e){console.error("No userAgent string was provided");return}var r=new RJ(e);return{UA:r,browser:r.getBrowser(),cpu:r.getCPU(),device:r.getDevice(),engine:r.getEngine(),os:r.getOS(),ua:r.getUA(),setUserAgent:function(i){return r.setUA(i)}}},OJ=Object.freeze({ClientUAInstance:Eh,browser:Ga,cpu:Tbe,device:Ro,engine:jN,os:_h,ua:N3,setUa:DJ,parseUserAgent:L3});function lF(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 kbe(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function Sl(t,e){if(t==null)return{};var r=Rbe(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function E6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Dbe(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return E6(t)}function Obe(t,e){return Fbe(t)||Ube(t,e)||Bbe(t,e)||zbe()}function Fbe(t){if(Array.isArray(t))return t}function Ube(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,s,o;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(l){a=!0,o=l}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw o}}return n}}function Bbe(t,e){if(t){if(typeof t=="string")return cF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cF(t,e)}}function cF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&arguments[1]!==void 0?arguments[1]:"none";return e||r},$N=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},PN=function(e){var r=$N();return r&&r.platform&&(r.platform.indexOf(e)!==-1||r.platform==="MacIntel"&&r.maxTouchPoints>1&&!window.MSStream)},qbe=function(e,r,n,i,a){return{isBrowser:e,browserMajorVersion:dr(r.major),browserFullVersion:dr(r.version),browserName:dr(r.name),engineName:dr(n.name),engineVersion:dr(n.version),osName:dr(i.name),osVersion:dr(i.version),userAgent:dr(a)}},uF=function(e,r,n,i){return kbe({},e,{vendor:dr(r.vendor),model:dr(r.model),os:dr(n.name),osVersion:dr(n.version),ua:dr(i)})},Vbe=function(e,r,n,i){return{isSmartTV:e,engineName:dr(r.name),engineVersion:dr(r.version),osName:dr(n.name),osVersion:dr(n.version),userAgent:dr(i)}},Ybe=function(e,r,n,i){return{isConsole:e,engineName:dr(r.name),engineVersion:dr(r.version),osName:dr(n.name),osVersion:dr(n.version),userAgent:dr(i)}},Kbe=function(e,r,n,i){return{isWearable:e,engineName:dr(r.name),engineVersion:dr(r.version),osName:dr(n.name),osVersion:dr(n.version),userAgent:dr(i)}},Jbe=function(e,r,n,i,a){return{isEmbedded:e,vendor:dr(r.vendor),model:dr(r.model),engineName:dr(n.name),engineVersion:dr(n.version),osName:dr(i.name),osVersion:dr(i.version),userAgent:dr(a)}};function Qbe(t){var e=t?L3(t):OJ,r=e.device,n=e.browser,i=e.engine,a=e.os,s=e.ua,o=Hbe(r.type),l=o.isBrowser,c=o.isMobile,u=o.isTablet,f=o.isSmartTV,h=o.isConsole,g=o.isWearable,m=o.isEmbedded;if(l)return qbe(l,n,i,a,s);if(f)return Vbe(f,i,a,s);if(h)return Ybe(h,i,a,s);if(c||u)return uF(o,r,a,s);if(g)return Kbe(g,i,a,s);if(m)return Jbe(m,r,i,a,s)}var FJ=function(e){var r=e.type;return r===La.Mobile},UJ=function(e){var r=e.type;return r===La.Tablet},BJ=function(e){var r=e.type;return r===La.Mobile||r===La.Tablet},zJ=function(e){var r=e.type;return r===La.SmartTv},P5=function(e){var r=e.type;return r===La.Browser},WJ=function(e){var r=e.type;return r===La.Wearable},HJ=function(e){var r=e.type;return r===La.Console},GJ=function(e){var r=e.type;return r===La.Embedded},qJ=function(e){var r=e.vendor;return dr(r)},VJ=function(e){var r=e.model;return dr(r)},YJ=function(e){var r=e.type;return dr(r,"browser")},KJ=function(e){var r=e.name;return r===Am.Android},JJ=function(e){var r=e.name;return r===Am.Windows},QJ=function(e){var r=e.name;return r===Am.MAC_OS},ZJ=function(e){var r=e.name;return r===Am.WindowsPhone},XJ=function(e){var r=e.name;return r===Am.IOS},eQ=function(e){var r=e.version;return dr(r)},tQ=function(e){var r=e.name;return dr(r)},rQ=function(e){var r=e.name;return r===Ys.Chrome},nQ=function(e){var r=e.name;return r===Ys.Firefox},iQ=function(e){var r=e.name;return r===Ys.Chromium},R5=function(e){var r=e.name;return r===Ys.Edge},aQ=function(e){var r=e.name;return r===Ys.Yandex},sQ=function(e){var r=e.name;return r===Ys.Safari||r===Ys.MobileSafari},oQ=function(e){var r=e.name;return r===Ys.MobileSafari},lQ=function(e){var r=e.name;return r===Ys.Opera},cQ=function(e){var r=e.name;return r===Ys.InternetExplorer||r===Ys.Ie},uQ=function(e){var r=e.name;return r===Ys.MIUI},dQ=function(e){var r=e.name;return r===Ys.SamsungBrowser},fQ=function(e){var r=e.version;return dr(r)},hQ=function(e){var r=e.major;return dr(r)},pQ=function(e){var r=e.name;return dr(r)},gQ=function(e){var r=e.name;return dr(r)},mQ=function(e){var r=e.version;return dr(r)},yQ=function(){var e=$N(),r=e&&e.userAgent&&e.userAgent.toLowerCase();return typeof r=="string"?/electron/.test(r):!1},hg=function(e){return typeof e=="string"&&e.indexOf("Edg/")!==-1},wQ=function(){var e=$N();return e&&(/iPad|iPhone|iPod/.test(e.platform)||e.platform==="MacIntel"&&e.maxTouchPoints>1)&&!window.MSStream},ru=function(){return PN("iPad")},vQ=function(){return PN("iPhone")},bQ=function(){return PN("iPod")},xQ=function(e){return dr(e)};function EQ(t){var e=t||OJ,r=e.device,n=e.browser,i=e.os,a=e.engine,s=e.ua;return{isSmartTV:zJ(r),isConsole:HJ(r),isWearable:WJ(r),isEmbedded:GJ(r),isMobileSafari:oQ(n)||ru(),isChromium:iQ(n),isMobile:BJ(r)||ru(),isMobileOnly:FJ(r),isTablet:UJ(r)||ru(),isBrowser:P5(r),isDesktop:P5(r),isAndroid:KJ(i),isWinPhone:ZJ(i),isIOS:XJ(i)||ru(),isChrome:rQ(n),isFirefox:nQ(n),isSafari:sQ(n),isOpera:lQ(n),isIE:cQ(n),osVersion:eQ(i),osName:tQ(i),fullBrowserVersion:fQ(n),browserVersion:hQ(n),browserName:pQ(n),mobileVendor:qJ(r),mobileModel:VJ(r),engineName:gQ(a),engineVersion:mQ(a),getUA:xQ(s),isEdge:R5(n)||hg(s),isYandex:aQ(n),deviceType:YJ(r),isIOS13:wQ(),isIPad13:ru(),isIPhone13:vQ(),isIPod13:bQ(),isElectron:yQ(),isEdgeChromium:hg(s),isLegacyEdge:R5(n)&&!hg(s),isWindows:JJ(i),isMacOs:QJ(i),isMIUI:uQ(n),isSamsungBrowser:dQ(n)}}var _Q=zJ(Ro),CQ=HJ(Ro),SQ=WJ(Ro),Zbe=GJ(Ro),Xbe=oQ(Ga)||ru(),e4e=iQ(Ga),b9=BJ(Ro)||ru(),AQ=FJ(Ro),IQ=UJ(Ro)||ru(),MQ=P5(Ro),t4e=P5(Ro),TQ=KJ(_h),kQ=ZJ(_h),NQ=XJ(_h)||ru(),r4e=rQ(Ga),n4e=nQ(Ga),i4e=sQ(Ga),a4e=lQ(Ga),LQ=cQ(Ga),s4e=eQ(_h),o4e=tQ(_h),l4e=fQ(Ga),c4e=hQ(Ga),u4e=pQ(Ga),d4e=qJ(Ro),f4e=VJ(Ro),h4e=gQ(jN),p4e=mQ(jN),g4e=xQ(N3),m4e=R5(Ga)||hg(N3),y4e=aQ(Ga),w4e=YJ(Ro),v4e=wQ(),b4e=ru(),x4e=vQ(),E4e=bQ(),_4e=yQ(),C4e=hg(N3),S4e=R5(Ga)&&!hg(N3),A4e=JJ(_h),I4e=QJ(_h),M4e=uQ(Ga),T4e=dQ(Ga),k4e=function(e){if(!e||typeof e!="string"){console.error("No valid user agent string was provided");return}var r=L3(e),n=r.device,i=r.browser,a=r.os,s=r.engine,o=r.ua;return EQ({device:n,browser:i,os:a,engine:s,ua:o})},N4e=function(e){var r=e.renderWithFragment,n=e.children,i=Sl(e,["renderWithFragment","children"]);return TQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},L4e=function(e){var r=e.renderWithFragment,n=e.children,i=Sl(e,["renderWithFragment","children"]);return MQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},j4e=function(e){var r=e.renderWithFragment,n=e.children,i=Sl(e,["renderWithFragment","children"]);return LQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},$4e=function(e){var r=e.renderWithFragment,n=e.children,i=Sl(e,["renderWithFragment","children"]);return NQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},P4e=function(e){var r=e.renderWithFragment,n=e.children,i=Sl(e,["renderWithFragment","children"]);return b9?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},R4e=function(e){var r=e.renderWithFragment,n=e.children,i=Sl(e,["renderWithFragment","children"]);return IQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},D4e=function(e){var r=e.renderWithFragment,n=e.children,i=Sl(e,["renderWithFragment","children"]);return kQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},O4e=function(e){var r=e.renderWithFragment,n=e.children;e.viewClassName,e.style;var i=Sl(e,["renderWithFragment","children","viewClassName","style"]);return AQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},F4e=function(e){var r=e.renderWithFragment,n=e.children,i=Sl(e,["renderWithFragment","children"]);return _Q?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},U4e=function(e){var r=e.renderWithFragment,n=e.children,i=Sl(e,["renderWithFragment","children"]);return CQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},B4e=function(e){var r=e.renderWithFragment,n=e.children,i=Sl(e,["renderWithFragment","children"]);return SQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},z4e=function(e){var r=e.renderWithFragment,n=e.children;e.viewClassName,e.style;var i=e.condition,a=Sl(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",a,n):null};function W4e(t){return function(e){Pbe(r,e);function r(n){var i;return Nbe(this,r),i=Dbe(this,FI(r).call(this,n)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(E6(i)),i.onOrientationChange=i.onOrientationChange.bind(E6(i)),i.onPageLoad=i.onPageLoad.bind(E6(i)),i.state={isLandscape:!1,isPortrait:!1},i}return jbe(r,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var i=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:i===0,isLandscape:i===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":Ry(window))!==void 0&&b9&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return Mn.createElement(t,OI({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),r}(Mn.Component)}function H4e(){var t=Ba.useState(function(){var a=window.innerWidth>window.innerHeight?90:0;return{isPortrait:a===0,isLandscape:a===90,orientation:a===0?"portrait":"landscape"}}),e=Obe(t,2),r=e[0],n=e[1],i=Ba.useCallback(function(){var a=window.innerWidth>window.innerHeight?90:0,s={isPortrait:a===0,isLandscape:a===90,orientation:a===0?"portrait":"landscape"};r.orientation!==s.orientation&&n(s)},[r.orientation]);return Ba.useEffect(function(){return(typeof window>"u"?"undefined":Ry(window))!==void 0&&b9&&(i(),window.addEventListener("load",i,!1),window.addEventListener("resize",i,!1)),function(){window.removeEventListener("resize",i,!1),window.removeEventListener("load",i,!1)}},[i]),r}function jQ(t){var e=t||window.navigator.userAgent;return L3(e)}function G4e(t){var e=t||window.navigator.userAgent,r=jQ(e),n=EQ(r);return[n,r]}kt.AndroidView=N4e;kt.BrowserTypes=Ys;kt.BrowserView=L4e;kt.ConsoleView=U4e;kt.CustomView=z4e;kt.IEView=j4e;kt.IOSView=$4e;kt.MobileOnlyView=O4e;kt.MobileView=P4e;kt.OsTypes=Am;kt.SmartTVView=F4e;kt.TabletView=R4e;kt.WearableView=B4e;kt.WinPhoneView=D4e;kt.browserName=u4e;kt.browserVersion=c4e;kt.deviceDetect=Qbe;kt.deviceType=w4e;kt.engineName=h4e;kt.engineVersion=p4e;kt.fullBrowserVersion=l4e;kt.getSelectorsByUserAgent=k4e;kt.getUA=g4e;var q4e=kt.isAndroid=TQ;kt.isBrowser=MQ;kt.isChrome=r4e;kt.isChromium=e4e;kt.isConsole=CQ;kt.isDesktop=t4e;kt.isEdge=m4e;kt.isEdgeChromium=C4e;kt.isElectron=_4e;kt.isEmbedded=Zbe;var V4e=kt.isFirefox=n4e;kt.isIE=LQ;var RN=kt.isIOS=NQ;kt.isIOS13=v4e;kt.isIPad13=b4e;kt.isIPhone13=x4e;kt.isIPod13=E4e;kt.isLegacyEdge=S4e;kt.isMIUI=M4e;kt.isMacOs=I4e;var ya=kt.isMobile=b9;kt.isMobileOnly=AQ;kt.isMobileSafari=Xbe;kt.isOpera=a4e;var Y4e=kt.isSafari=i4e;kt.isSamsungBrowser=T4e;kt.isSmartTV=_Q;kt.isTablet=IQ;kt.isWearable=SQ;kt.isWinPhone=kQ;kt.isWindows=A4e;kt.isYandex=y4e;kt.mobileModel=f4e;kt.mobileVendor=d4e;kt.osName=o4e;kt.osVersion=s4e;kt.parseUserAgent=L3;kt.setUserAgent=Gbe;kt.useDeviceData=jQ;kt.useDeviceSelectors=G4e;kt.useMobileOrientation=H4e;kt.withOrientationChange=W4e;const j3="abi/5.7.0",Hr=new De(j3),K0={};let dF={calldata:!0,memory:!0,storage:!0},K4e={calldata:!0,memory:!0};function f4(t,e){if(t==="bytes"||t==="string"){if(dF[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&K4e[e])return!0;return(dF[e]||e==="payable")&&Hr.throwArgumentError("invalid modifier","name",e),!1}function J4e(t,e){let r=t;function n(o){Hr.throwArgumentError(`unexpected character at position ${o}`,"param",t)}t=t.replace(/\s/g," ");function i(o){let l={type:"",name:"",parent:o,state:{allowType:!0}};return e&&(l.indexed=!1),l}let a={type:"",name:"",state:{allowType:!0}},s=a;for(let o=0;oJSON.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!==Zr.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===Zr.full?", ":",")+")"):r+=this.type,e!==Zr.sighash&&(this.indexed===!0&&(r+=" indexed"),e===Zr.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?Qi.fromString(e,r):Qi.fromObject(e)}static fromObject(e){return Qi.isParamType(e)?e:new Qi(K0,{name:e.name||null,type:kp(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(Qi.fromObject):null})}static fromString(e,r){function n(i){return Qi.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(J4e(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function xw(t,e){return X4e(t).map(r=>Qi.fromString(r,e))}class Ad{constructor(e,r){e!==K0&&Hr.throwError("use a static from method",De.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),_6(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return Ad.isFragment(e)?e:typeof e=="string"?Ad.fromString(e):Ad.fromObject(e)}static fromObject(e){if(Ad.isFragment(e))return e;switch(e.type){case"function":return iu.fromObject(e);case"event":return Ed.fromObject(e);case"constructor":return nu.fromObject(e);case"error":return $f.fromObject(e);case"fallback":case"receive":return null}return Hr.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"?Ed.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?iu.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?nu.fromString(e.trim()):e.split(" ")[0]==="error"?$f.fromString(e.substring(5).trim()):Hr.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Ed extends Ad{format(e){if(e||(e=Zr.sighash),Zr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Zr.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!==Zr.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Zr.full?", ":",")+") ",e!==Zr.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Ed.fromString(e):Ed.fromObject(e)}static fromObject(e){if(Ed.isEventFragment(e))return e;e.type!=="event"&&Hr.throwArgumentError("invalid event object","value",e);const r={name:Ew(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Qi.fromObject):[],type:"event"};return new Ed(K0,r)}static fromString(e){let r=e.match(_w);r||Hr.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:Hr.warn("unknown modifier: "+i)}}),Ed.fromObject({name:r[1].trim(),anonymous:n,inputs:xw(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function $Q(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Hr.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Hr.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=nt.from(r[1]),r[0]):t}function PQ(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 RQ(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&&Hr.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Hr.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"&&Hr.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&&Hr.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"&&Hr.throwArgumentError("unable to determine stateMutability","value",t),e}class nu extends Ad{format(e){if(e||(e=Zr.sighash),Zr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Zr.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===Zr.sighash&&Hr.throwError("cannot format a constructor for sighash",De.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===Zr.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?nu.fromString(e):nu.fromObject(e)}static fromObject(e){if(nu.isConstructorFragment(e))return e;e.type!=="constructor"&&Hr.throwArgumentError("invalid constructor object","value",e);let r=RQ(e);r.constant&&Hr.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Qi.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?nt.from(e.gas):null};return new nu(K0,n)}static fromString(e){let r={type:"constructor"};e=$Q(e,r);let n=e.match(_w);return(!n||n[1].trim()!=="constructor")&&Hr.throwArgumentError("invalid constructor string","value",e),r.inputs=xw(n[2].trim(),!1),PQ(n[3].trim(),r),nu.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class iu extends nu{format(e){if(e||(e=Zr.sighash),Zr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Zr.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!==Zr.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Zr.full?", ":",")+") ",e!==Zr.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"?iu.fromString(e):iu.fromObject(e)}static fromObject(e){if(iu.isFunctionFragment(e))return e;e.type!=="function"&&Hr.throwArgumentError("invalid function object","value",e);let r=RQ(e);const n={type:e.type,name:Ew(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Qi.fromObject):[],outputs:e.outputs?e.outputs.map(Qi.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?nt.from(e.gas):null};return new iu(K0,n)}static fromString(e){let r={type:"function"};e=$Q(e,r);let n=e.split(" returns ");n.length>2&&Hr.throwArgumentError("invalid function string","value",e);let i=n[0].match(_w);if(i||Hr.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&Ew(r.name),r.inputs=xw(i[2],!1),PQ(i[3].trim(),r),n.length>1){let a=n[1].match(_w);(a[1].trim()!=""||a[3].trim()!="")&&Hr.throwArgumentError("unexpected tokens","value",e),r.outputs=xw(a[2],!1)}else r.outputs=[];return iu.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function fF(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Hr.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class $f extends Ad{format(e){if(e||(e=Zr.sighash),Zr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Zr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Zr.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Zr.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?$f.fromString(e):$f.fromObject(e)}static fromObject(e){if($f.isErrorFragment(e))return e;e.type!=="error"&&Hr.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:Ew(e.name),inputs:e.inputs?e.inputs.map(Qi.fromObject):[]};return fF(new $f(K0,r))}static fromString(e){let r={type:"error"},n=e.match(_w);return n||Hr.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&Ew(r.name),r.inputs=xw(n[2],!1),fF($f.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function kp(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const Z4e=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ew(t){return(!t||!t.match(Z4e))&&Hr.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const _w=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function X4e(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&DN.throwError("value out-of-bounds",De.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Us([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 D5{constructor(e,r,n,i){st(this,"_data",er(e)),st(this,"wordSize",r||32),st(this,"_coerceFunc",n),st(this,"allowLoose",i),this._offset=0}get data(){return Bt(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):D5.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:DN.throwError("data out-of-bounds",De.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new D5(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 nt.from(this.readBytes(this.wordSize))}}class t6e extends Xd{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=Ir(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return Ir(Bn(e.readValue().toHexString(),20))}}class r6e extends Xd{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 Jp=new De(j3);function DQ(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(c=>{const u=c.localName;return u||Jp.throwError("cannot encode object for signature with missing names",De.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[u]&&Jp.throwError("cannot encode object for signature with duplicate names",De.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[u]=!0,r[u]})}else Jp.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Jp.throwArgumentError("types/value length mismatch","tuple",r);let i=new BI(t.wordSize),a=new BI(t.wordSize),s=[];e.forEach((l,c)=>{let u=n[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();s.push(g=>{h(g+f)})}else l.encode(i,u)}),s.forEach(l=>{l(i.length)});let o=t.appendWriter(i);return o+=t.appendWriter(a),o}function OQ(t,e){let r=[],n=t.subReader(0);e.forEach(a=>{let s=null;if(a.dynamic){let o=t.readValue(),l=n.subReader(o.toNumber());try{s=a.decode(l)}catch(c){if(c.code===De.errors.BUFFER_OVERRUN)throw c;s=c,s.baseType=a.name,s.name=a.localName,s.type=a.type}}else try{s=a.decode(t)}catch(o){if(o.code===De.errors.BUFFER_OVERRUN)throw o;s=o,s.baseType=a.name,s.name=a.localName,s.type=a.type}s!=null&&r.push(s)});const i=e.reduce((a,s)=>{const o=s.localName;return o&&(a[o]||(a[o]=0),a[o]++),a},{});e.forEach((a,s)=>{let o=a.localName;if(!o||i[o]!==1||(o==="length"&&(o="_length"),r[o]!=null))return;const l=r[s];l instanceof Error?Object.defineProperty(r,o,{enumerable:!0,get:()=>{throw l}}):r[o]=l});for(let a=0;a{throw s}})}return Object.freeze(r)}class n6e extends Xd{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",a=r===-1||e.dynamic;super("array",i,n,a),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Jp.throwError("insufficient data length",De.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i{s.dynamic&&(n=!0),i.push(s.type)});const a="tuple("+i.join(",")+")";super("tuple",a,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const a=i.localName;return a&&(n[a]||(n[a]=0),n[a]++),n},{});return this.coders.forEach((n,i)=>{let a=n.localName;!a||r[a]!==1||(a==="length"&&(a="_length"),e[a]==null&&(e[a]=e[i]))}),Object.freeze(e)}encode(e,r){return DQ(e,this.coders,r)}decode(e){return e.coerce(this.name,OQ(e,this.coders))}}const p4=new De(j3),u6e=new RegExp(/^bytes([0-9]*)$/),d6e=new RegExp(/^(u?int)([0-9]*)$/);class f6e{constructor(e){st(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new t6e(e.name);case"bool":return new i6e(e.name);case"string":return new c6e(e.name);case"bytes":return new a6e(e.name);case"array":return new n6e(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new h4((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new o6e(e.name)}let r=e.type.match(d6e);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&p4.throwArgumentError("invalid "+r[1]+" bit length","param",e),new l6e(n/8,r[1]==="int",e.name)}if(r=e.type.match(u6e),r){let n=parseInt(r[1]);return(n===0||n>32)&&p4.throwArgumentError("invalid bytes length","param",e),new s6e(n,e.name)}return p4.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new D5(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new BI(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Qi.from(i)));return new h4(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&p4.throwError("types/values length mismatch",De.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(s=>this._getCoder(Qi.from(s))),i=new h4(n,"_"),a=this._getWriter();return i.encode(a,r),a.data}decode(e,r,n){const i=e.map(s=>this._getCoder(Qi.from(s)));return new h4(i,"_").decode(this._getReader(er(r),n))}}const h6e=new f6e,Gn=new De(j3);class p6e extends I3{}class g6e extends I3{}class m6e extends I3{}class zI extends I3{static isIndexed(e){return!!(e&&e._isIndexed)}}const y6e={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function hF(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class pF{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,st(this,"fragments",r.map(n=>Ad.from(n)).filter(n=>n!=null)),st(this,"_abiCoder",ou(new.target,"getAbiCoder")()),st(this,"functions",{}),st(this,"errors",{}),st(this,"events",{}),st(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){Gn.warn("duplicate definition - constructor");return}st(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 a=n.format();if(i[a]){Gn.warn("duplicate definition - "+a);return}i[a]=n}),this.deploy||st(this,"deploy",nu.from({payable:!1,type:"constructor"})),st(this,"_isInterface",!0)}format(e){e||(e=Zr.full),e===Zr.sighash&&Gn.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===Zr.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return h6e}static getAddress(e){return Ir(e)}static getSighash(e){return Na(Kp(e.format()),0,4)}static getEventTopic(e){return Kp(e.format())}getFunction(e){if(Kr(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];Gn.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(a=>a.split("(")[0]===n);return i.length===0?Gn.throwArgumentError("no matching function","name",n):i.length>1&&Gn.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[iu.fromString(e).format()];return r||Gn.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(Kr(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];Gn.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(a=>a.split("(")[0]===n);return i.length===0?Gn.throwArgumentError("no matching event","name",n):i.length>1&&Gn.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Ed.fromString(e).format()];return r||Gn.throwArgumentError("no matching event","signature",e),r}getError(e){if(Kr(e)){const n=ou(this.constructor,"getSighash");for(const i in this.errors){const a=this.errors[i];if(e===n(a))return this.errors[i]}Gn.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(a=>a.split("(")[0]===n);return i.length===0?Gn.throwArgumentError("no matching error","name",n):i.length>1&&Gn.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[iu.fromString(e).format()];return r||Gn.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 ou(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),ou(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=er(r);return Bt(n.slice(0,4))!==this.getSighash(e)&&Gn.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Bt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),Bt(Us([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=er(r);return Bt(n.slice(0,4))!==this.getSighash(e)&&Gn.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Bt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Bt(Us([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=er(r),i=null,a="",s=null,o=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const c=Bt(n.slice(0,4)),u=y6e[c];if(u)s=this._abiCoder.decode(u.inputs,n.slice(4)),o=u.name,l=u.signature,u.reason&&(i=s[0]),o==="Error"?a=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:o==="Panic"&&(a=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{const f=this.getError(c);s=this._abiCoder.decode(f.inputs,n.slice(4)),o=f.name,l=f.format()}catch{}break}}return Gn.throwError("call revert exception"+a,De.errors.CALL_EXCEPTION,{method:e.format(),data:Bt(r),errorArgs:s,errorName:o,errorSignature:l,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Bt(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&Gn.throwError("too many arguments for "+e.format(),De.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(a,s)=>a.type==="string"?Kp(s):a.type==="bytes"?_i(Bt(s)):(a.type==="bool"&&typeof s=="boolean"&&(s=s?"0x01":"0x00"),a.type.match(/^u?int/)&&(s=nt.from(s).toHexString()),a.type==="address"&&this._abiCoder.encode(["address"],[s]),Bn(Bt(s),32));for(r.forEach((a,s)=>{let o=e.inputs[s];if(!o.indexed){a!=null&&Gn.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,a);return}a==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?Gn.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,a):Array.isArray(a)?n.push(a.map(l=>i(o,l))):n.push(i(o,a))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],a=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&Gn.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((s,o)=>{const l=r[o];if(s.indexed)if(s.type==="string")n.push(Kp(l));else if(s.type==="bytes")n.push(_i(l));else{if(s.baseType==="tuple"||s.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([s.type],[l]))}else i.push(s),a.push(l)}),{data:this._abiCoder.encode(i,a),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let h=this.getEventTopic(e);(!Kr(n[0],32)||n[0].toLowerCase()!==h)&&Gn.throwError("fragment/topic mismatch",De.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:h,value:n[0]}),n=n.slice(1)}let i=[],a=[],s=[];e.inputs.forEach((h,g)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(i.push(Qi.fromObject({type:"bytes32",name:h.name})),s.push(!0)):(i.push(h),s.push(!1)):(a.push(h),s.push(!1))});let o=n!=null?this._abiCoder.decode(i,Us(n)):null,l=this._abiCoder.decode(a,r,!0),c=[],u=0,f=0;e.inputs.forEach((h,g)=>{if(h.indexed)if(o==null)c[g]=new zI({_isIndexed:!0,hash:null});else if(s[g])c[g]=new zI({_isIndexed:!0,hash:o[f++]});else try{c[g]=o[f++]}catch(m){c[g]=m}else try{c[g]=l[u++]}catch(m){c[g]=m}if(h.name&&c[h.name]==null){const m=c[g];m instanceof Error?Object.defineProperty(c,h.name,{enumerable:!0,get:()=>{throw hF(`property ${JSON.stringify(h.name)}`,m)}}):c[h.name]=m}});for(let h=0;h{throw hF(`index ${h}`,g)}})}return Object.freeze(c)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new g6e({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:nt.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new p6e({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=Bt(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new m6e({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 w6e="contracts/5.7.0";var J0=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const hi=new De(w6e);function O5(t,e){return J0(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&hi.throwArgumentError("invalid address or ENS name","name",r);try{return Ir(r)}catch{}t||hi.throwError("a provider or signer is needed to resolve ENS names",De.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&hi.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function C6(t,e,r){return J0(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>C6(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield O5(t,e):r.type==="tuple"?yield C6(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>C6(t,n,r.arrayChildren))):Promise.reject(hi.makeError("invalid value for array",De.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function x9(t,e,r){return J0(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Ri(r.pop())),hi.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=vi({override:O5(t.signer,n.from),signer:t.signer.getAddress()}).then(c=>J0(this,void 0,void 0,function*(){return Ir(c.signer)!==c.override&&hi.throwError("Contract with a Signer cannot override from",De.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),c.override})):n.from=t.signer.getAddress():n.from&&(n.from=O5(t.provider,n.from));const i=yield vi({args:C6(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:vi(n)||{}}),a=t.interface.encodeFunctionData(e,i.args),s={data:a,to:i.address},o=i.overrides;if(o.nonce!=null&&(s.nonce=nt.from(o.nonce).toNumber()),o.gasLimit!=null&&(s.gasLimit=nt.from(o.gasLimit)),o.gasPrice!=null&&(s.gasPrice=nt.from(o.gasPrice)),o.maxFeePerGas!=null&&(s.maxFeePerGas=nt.from(o.maxFeePerGas)),o.maxPriorityFeePerGas!=null&&(s.maxPriorityFeePerGas=nt.from(o.maxPriorityFeePerGas)),o.from!=null&&(s.from=o.from),o.type!=null&&(s.type=o.type),o.accessList!=null&&(s.accessList=Sm(o.accessList)),s.gasLimit==null&&e.gas!=null){let c=21e3;const u=er(a);for(let f=0;fn[c]!=null);return l.length&&hi.throwError(`cannot override ${l.map(c=>JSON.stringify(c)).join(",")}`,De.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),s})}function v6e(t,e){return function(...r){return x9(t,e,r)}}function b6e(t,e){const r=t.signer||t.provider;return function(...n){return J0(this,void 0,void 0,function*(){r||hi.throwError("estimate require a provider or signer",De.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield x9(t,e,n);return yield r.estimateGas(i)})}}function x6e(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(a=>{let s=Dd(a),o=null;try{o=t.interface.parseLog(a)}catch{}return o&&(s.args=o.args,s.decode=(l,c)=>t.interface.decodeEventLog(o.eventFragment,l,c),s.event=o.name,s.eventSignature=o.signature),s.removeListener=()=>t.provider,s.getBlock=()=>t.provider.getBlock(i.blockHash),s.getTransaction=()=>t.provider.getTransaction(i.transactionHash),s.getTransactionReceipt=()=>Promise.resolve(i),s}),i))}function UQ(t,e,r){const n=t.signer||t.provider;return function(...i){return J0(this,void 0,void 0,function*(){let a;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=Ri(i.pop());l.blockTag!=null&&(a=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(a));const s=yield x9(t,e,i),o=yield n.call(s,a);try{let l=t.interface.decodeFunctionResult(e,o);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===De.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=s),l}})}}function E6e(t,e){return function(...r){return J0(this,void 0,void 0,function*(){t.signer||hi.throwError("sending a transaction requires a signer",De.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield x9(t,e,r),i=yield t.signer.sendTransaction(n);return x6e(t,i),i})}}function gF(t,e,r){return e.constant?UQ(t,e,r):E6e(t,e)}function BQ(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 Cw{constructor(e,r){st(this,"tag",e),st(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 _6e extends Cw{constructor(){super("error",null)}}class mF extends Cw{constructor(e,r,n,i){const a={address:e};let s=r.getEventTopic(n);i?(s!==i[0]&&hi.throwArgumentError("topic mismatch","topics",i),a.topics=i.slice()):a.topics=[s],super(BQ(a),a),st(this,"address",e),st(this,"interface",r),st(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=e6e(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class yF extends Cw{constructor(e,r){super("*",{address:e}),st(this,"address",e),st(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 C6e{constructor(e,r,n){st(this,"interface",ou(new.target,"getInterface")(r)),n==null?(st(this,"provider",null),st(this,"signer",null)):k3.isSigner(n)?(st(this,"provider",n.provider||null),st(this,"signer",n)):h9.isProvider(n)?(st(this,"provider",n),st(this,"signer",null)):hi.throwArgumentError("invalid signer or provider","signerOrProvider",n),st(this,"callStatic",{}),st(this,"estimateGas",{}),st(this,"functions",{}),st(this,"populateTransaction",{}),st(this,"filters",{});{const s={};Object.keys(this.interface.events).forEach(o=>{const l=this.interface.events[o];st(this.filters,o,(...c)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,c)})),s[l.name]||(s[l.name]=[]),s[l.name].push(o)}),Object.keys(s).forEach(o=>{const l=s[o];l.length===1?st(this.filters,o,this.filters[l[0]]):hi.warn(`Duplicate definition of ${o} (${l.join(", ")})`)})}if(st(this,"_runningEvents",{}),st(this,"_wrappedEmits",{}),e==null&&hi.throwArgumentError("invalid contract address or ENS name","addressOrName",e),st(this,"address",e),this.provider)st(this,"resolvedAddress",O5(this.provider,e));else try{st(this,"resolvedAddress",Promise.resolve(Ir(e)))}catch{hi.throwError("provider is required to use ENS name as contract address",De.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(s=>{});const i={},a={};Object.keys(this.interface.functions).forEach(s=>{const o=this.interface.functions[s];if(a[s]){hi.warn(`Duplicate ABI entry for ${JSON.stringify(s)}`);return}a[s]=!0;{const l=o.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(s)}this[s]==null&&st(this,s,gF(this,o,!0)),this.functions[s]==null&&st(this.functions,s,gF(this,o,!1)),this.callStatic[s]==null&&st(this.callStatic,s,UQ(this,o,!0)),this.populateTransaction[s]==null&&st(this.populateTransaction,s,v6e(this,o)),this.estimateGas[s]==null&&st(this.estimateGas,s,b6e(this,o))}),Object.keys(i).forEach(s=>{const o=i[s];if(o.length>1)return;s=s.substring(1);const l=o[0];try{this[s]==null&&st(this,s,this[l])}catch{}this.functions[s]==null&&st(this.functions,s,this.functions[l]),this.callStatic[s]==null&&st(this.callStatic,s,this.callStatic[l]),this.populateTransaction[s]==null&&st(this.populateTransaction,s,this.populateTransaction[l]),this.estimateGas[s]==null&&st(this.estimateGas,s,this.estimateGas[l])})}static getContractAddress(e){return RK(e)}static getInterface(e){return pF.isInterface(e)?e:new pF(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"&&hi.throwError("contract not deployed",De.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||hi.throwError("sending a transactions require a signer",De.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Ri(e||{});return["from","to"].forEach(function(n){r[n]!=null&&hi.throwError("cannot override "+n,De.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new v9(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&st(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return zI.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 _6e);if(e==="event")return this._normalizeRunningEvent(new Cw("event",null));if(e==="*")return this._normalizeRunningEvent(new yF(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new mF(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 mF(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Cw(BQ(r),r))}return this._normalizeRunningEvent(new yF(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=Dd(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||hi.throwError("events require a provider or a signer with a provider",De.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=a=>{let s=this._wrapEvent(e,a,r);if(s.decodeError==null)try{const o=e.getEmit(s);this.emit(e.filter,...o)}catch(o){s.decodeError=o.error}e.filter!=null&&this.emit("event",s),s.decodeError!=null&&this.emit("error",s.decodeError,s)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),a=Ri(i.filter);return typeof r=="string"&&Kr(r,32)?(n!=null&&hi.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),a.blockHash=r):(a.fromBlock=r??0,a.toBlock=n??"latest"),this.provider.getLogs(a).then(s=>s.map(o=>this._wrapEvent(i,o,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 S6e extends C6e{}const A6e="units/5.7.0",I6e=new De(A6e),M6e=["wei","kwei","mwei","gwei","szabo","finney","ether"];function T6e(t,e){return y6(t,e)}function wF(t,e){if(typeof t!="string"&&I6e.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=M6e.indexOf(e);r!==-1&&(e=3*r)}return Hc(t,e??18)}function zQ(t){return T6e(t,18)}function WI(t){"@babel/helpers - typeof";return WI=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},WI(t)}function k6e(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}function N6e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L6e(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&&Sw(t,e)}function j6e(t){var e=HQ();return function(){var n=Aw(t),i;if(e){var a=Aw(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return $6e(this,i)}}function $6e(t,e){if(e&&(WI(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WQ(t)}function WQ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function HI(t){var e=typeof Map=="function"?new Map:void 0;return HI=function(n){if(n===null||!P6e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return S6(n,arguments,Aw(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Sw(i,n)},HI(t)}function S6(t,e,r){return HQ()?S6=Reflect.construct:S6=function(i,a,s){var o=[null];o.push.apply(o,a);var l=Function.bind.apply(i,o),c=new l;return s&&Sw(c,s.prototype),c},S6.apply(null,arguments)}function HQ(){if(typeof Reflect>"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 P6e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Sw(t,e){return Sw=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Sw(t,e)}function Aw(t){return Aw=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Aw(t)}var md=function(t){L6e(r,t);var e=j6e(r);function r(n){var i;return N6e(this,r),i=e.call(this,n),Object.setPrototypeOf(WQ(i),r.prototype),i.name=i.constructor.name,i}return k6e(r)}(HI(Error)),ON=2,R6e=17,D6e=3,ds="0-90-9٠-٩۰-۹",O6e="-‐-―−ー-",F6e="//",U6e="..",B6e="  ­​⁠ ",z6e="()()[]\\[\\]",W6e="~⁓∼~",fc="".concat(O6e).concat(F6e).concat(U6e).concat(B6e).concat(z6e).concat(W6e),E9="++";function vF(t,e){t=t.split("-"),e=e.split("-");for(var r=t[0].split("."),n=e[0].split("."),i=0;i<3;i++){var a=Number(r[i]),s=Number(n[i]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]=ON&&s5e.test(t)}function l5e(t){return i5e.test(t)}var _F=new RegExp("(?:"+qQ()+")$","i");function c5e(t){var e=t.search(_F);if(e<0)return{};for(var r=t.slice(0,e),n=t.match(_F),i=1;i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d5e(t,e){if(t){if(typeof t=="string")return CF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return CF(t,e)}}function CF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p5e(t,e){if(t){if(typeof t=="string")return SF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return SF(t,e)}}function SF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);ra?"TOO_SHORT":i[i.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}function y5e(t,e,r){if(e===void 0&&(e={}),r=new oa(r),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.country(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}}if(r.possibleLengths())return YQ(t.phone||t.nationalNumber,r);if(t.countryCallingCode&&r.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function YQ(t,e){switch(A9(t,e)){case"IS_POSSIBLE":return!0;default:return!1}}function Ud(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function w5e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=v5e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v5e(t,e){if(t){if(typeof t=="string")return IF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IF(t,e)}}function IF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0}function KQ(t){return t.replace(new RegExp("[".concat(fc,"]+"),"g")," ").trim()}var JQ=/(\$\d)/;function QQ(t,e,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var a=t.replace(new RegExp(e.pattern()),n?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(JQ,e.nationalPrefixFormattingRule()):e.format());return n?KQ(a):a}var C5e=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function S5e(t,e,r){var n=new oa(r);if(n.selectNumberingPlan(t,e),n.defaultIDDPrefix())return n.defaultIDDPrefix();if(C5e.test(n.IDDPrefix()))return n.IDDPrefix()}function A5e(t){var e=t.number,r=t.ext;if(!e)return"";if(e[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(r?";ext="+r:"")}function I5e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=M5e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M5e(t,e){if(t){if(typeof t=="string")return MF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return MF(t,e)}}function MF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0){var a=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(e.search(a)!==0)continue}if(Ud(e,i.pattern()))return i}}function yC(t,e,r,n){return e?n(t,e,r):t}function L5e(t,e,r,n,i){var a=S9(n,i.metadata);if(a===r){var s=U5(t,e,"NATIONAL",i);return r==="1"?r+" "+s:s}var o=S5e(n,void 0,i.metadata);if(o)return"".concat(o," ").concat(r," ").concat(U5(t,null,"INTERNATIONAL",i))}function LF(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 jF(t){for(var e=1;e0&&s[1]==="0"))return t}}}function qI(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(t);if(n){var i,a,s=n.length-1,o=s>0&&n[s];if(e.nationalPrefixTransformRule()&&o)i=t.replace(r,e.nationalPrefixTransformRule()),s>1&&(a=n[1]);else{var l=n[0];i=t.slice(l.length),o&&(a=n[1])}var c;if(o){var u=t.indexOf(n[1]),f=t.slice(0,u);f===e.numberingPlan.nationalPrefix()&&(c=e.numberingPlan.nationalPrefix())}else c=n[0];return{nationalNumber:i,nationalPrefix:c,carrierCode:a}}}return{nationalNumber:t}}function VI(t,e){var r=qI(t,e),n=r.carrierCode,i=r.nationalNumber;if(i!==t){if(!U5e(t,i,e))return{nationalNumber:t};if(e.possibleLengths()&&!B5e(i,e))return{nationalNumber:t}}return{nationalNumber:i,carrierCode:n}}function U5e(t,e,r){return!(Ud(t,r.nationalNumberPattern())&&!Ud(e,r.nationalNumberPattern()))}function B5e(t,e){switch(A9(t,e)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function XQ(t,e,r,n){var i=e?S9(e,n):r;if(t.indexOf(i)===0){n=new oa(n),n.selectNumberingPlan(e,r);var a=t.slice(i.length),s=VI(a,n),o=s.nationalNumber,l=VI(t,n),c=l.nationalNumber;if(!Ud(c,n.nationalNumberPattern())&&Ud(o,n.nationalNumberPattern())||A9(c,n)==="TOO_LONG")return{countryCallingCode:i,number:a}}return{number:t}}function eZ(t,e,r,n){if(!t)return{};var i;if(t[0]!=="+"){var a=ZQ(t,e,r,n);if(a&&a!==t)i=!0,t="+"+a;else{if(e||r){var s=XQ(t,e,r,n),o=s.countryCallingCode,l=s.number;if(o)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:o,number:l}}return{number:t}}}if(t[1]==="0")return{};n=new oa(n);for(var c=2;c-1<=D6e&&c<=t.length;){var u=t.slice(1,c);if(n.hasCallingCode(u))return n.selectNumberingPlan(u),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:u,number:t.slice(c)};c++}return{}}function z5e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=W5e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W5e(t,e){if(t){if(typeof t=="string")return $F(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $F(t,e)}}function $F(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length)return"";var n=t.indexOf(";",r);return n>=0?t.substring(r,n):t.substring(r)}function e8e(t){return t===null?!0:t.length===0?!1:q5e.test(t)||Q5e.test(t)}function t8e(t,e){var r=e.extractFormattedPhoneNumber,n=X5e(t);if(!e8e(n))throw new md("NOT_A_NUMBER");var i;if(n===null)i=r(t)||"";else{i="",n.charAt(0)===nZ&&(i+=n);var a=t.indexOf(RF),s;a>=0?s=a+RF.length:s=0;var o=t.indexOf(KI);i+=t.substring(s,o)}var l=i.indexOf(Z5e);if(l>0&&(i=i.substring(0,l)),i!=="")return i}var r8e=250,n8e=new RegExp("["+E9+ds+"]"),i8e=new RegExp("[^"+ds+"#]+$");function a8e(t,e,r){if(e=e||{},r=new oa(r),e.defaultCountry&&!r.hasCountry(e.defaultCountry))throw e.v2?new md("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var n=o8e(t,e.v2,e.extract),i=n.number,a=n.ext,s=n.error;if(!i){if(e.v2)throw s==="TOO_SHORT"?new md("TOO_SHORT"):new md("NOT_A_NUMBER");return{}}var o=c8e(i,e.defaultCountry,e.defaultCallingCode,r),l=o.country,c=o.nationalNumber,u=o.countryCallingCode,f=o.countryCallingCodeSource,h=o.carrierCode;if(!r.hasSelectedNumberingPlan()){if(e.v2)throw new md("INVALID_COUNTRY");return{}}if(!c||c.lengthR6e){if(e.v2)throw new md("TOO_LONG");return{}}if(e.v2){var g=new UN(u,c,r.metadata);return l&&(g.country=l),h&&(g.carrierCode=h),a&&(g.ext=a),g.__countryCallingCodeSource=f,g}var m=(e.extended?r.hasSelectedNumberingPlan():l)?Ud(c,r.nationalNumberPattern()):!1;return e.extended?{country:l,countryCallingCode:u,carrierCode:h,valid:m,possible:m?!0:!!(e.extended===!0&&r.possibleLengths()&&YQ(c,r)),phone:c,ext:a}:m?l8e(l,c,a):{}}function s8e(t,e,r){if(t){if(t.length>r8e){if(r)throw new md("TOO_LONG");return}if(e===!1)return t;var n=t.search(n8e);if(!(n<0))return t.slice(n).replace(i8e,"")}}function o8e(t,e,r){var n=t8e(t,{extractFormattedPhoneNumber:function(s){return s8e(s,r,e)}});if(!n)return{};if(!o5e(n))return l5e(n)?{error:"TOO_SHORT"}:{};var i=c5e(n);return i.ext?i:{number:n}}function l8e(t,e,r){var n={country:t,phone:e};return r&&(n.ext=r),n}function c8e(t,e,r,n){var i=eZ(AF(t),e,r,n.metadata),a=i.countryCallingCodeSource,s=i.countryCallingCode,o=i.number,l;if(s)n.selectNumberingPlan(s);else if(o&&(e||r))n.selectNumberingPlan(e,r),e&&(l=e),s=r||S9(e,n.metadata);else return{};if(!o)return{countryCallingCodeSource:a,countryCallingCode:s};var c=VI(AF(o),n),u=c.nationalNumber,f=c.carrierCode,h=rZ(s,{nationalNumber:u,defaultCountry:e,metadata:n});return h&&(l=h,h==="001"||n.country(l)),{country:l,countryCallingCode:s,countryCallingCodeSource:a,nationalNumber:u,carrierCode:f}}function DF(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 OF(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T8e(t,e){if(t){if(typeof t=="string")return GF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GF(t,e)}}function GF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1;)e&1&&(r+=t),e>>=1,t+=t;return r+t}function qF(t,e){return t[e]===")"&&e++,k8e(t.slice(0,e))}function k8e(t){for(var e=[],r=0;r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W8e(t,e){if(t){if(typeof t=="string")return KF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return KF(t,e)}}function KF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&arguments[1]!==void 0?arguments[1]:{},i=n.allowOverflow;if(!r)throw new Error("String is required");var a=JI(r.split(""),this.matchTree,!0);if(a&&a.match&&delete a.matchedChars,!(a&&a.overflow&&!i))return a}}]),t}();function JI(t,e,r){if(typeof e=="string"){var n=t.join("");return e.indexOf(n)===0?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:n.indexOf(e)===0?r&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var i=t.slice(),a=0;a=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Y8e(t,e){if(t){if(typeof t=="string")return QF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return QF(t,e)}}function QF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0)){var i=this.getTemplateForFormat(r,n);if(i)return this.setNationalNumberTemplate(i,n),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(r){return this.isNANP||r&&r.nationalPrefixFormattingRule()&&e9e.test(r.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(r,n){var i=r.IDDPrefix,a=r.missingPlus;return i?n&&n.spacing===!1?i:i+" ":a?"":"+"}},{key:"getTemplate",value:function(r){if(this.template){for(var n=-1,i=0,a=r.international?this.getInternationalPrefixBeforeCountryCallingCode(r,{spacing:!1}):"";ic.length)){var u=new RegExp("^"+l+"$"),f=i.replace(/\d/g,QI);u.test(f)&&(c=f);var h=this.getFormatFormat(r,a),g;if(this.shouldTryNationalPrefixFormattingRule(r,{international:a,nationalPrefix:s})){var m=h.replace(JQ,r.nationalPrefixFormattingRule());if(F5(r.nationalPrefixFormattingRule())===(s||"")+F5("$1")&&(h=m,g=!0,s))for(var w=s.length;w>0;)h=h.replace(/\d/,Kl),w--}var C=c.replace(new RegExp(l),h).replace(new RegExp(QI,"g"),Kl);return g||(o?C=A6(Kl,o.length)+" "+C:s&&(C=A6(Kl,s.length)+this.getSeparatorAfterNationalPrefix(r)+C)),a&&(C=KQ(C)),C}}},{key:"formatNextNationalNumberDigits",value:function(r){var n=N8e(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,r);if(!n){this.resetFormat();return}return this.populatedNationalNumberTemplate=n[0],this.populatedNationalNumberTemplatePosition=n[1],qF(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(r,n){var i=n.international,a=n.nationalPrefix;if(r.nationalPrefixFormattingRule()){var s=r.usesNationalPrefix();if(s&&a||!s&&!i)return!0}}}]),t}();function iZ(t,e){return l9e(t)||o9e(t,e)||s9e(t,e)||a9e()}function a9e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s9e(t,e){if(t){if(typeof t=="string")return XF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return XF(t,e)}}function XF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=3;if(n.appendDigits(r),a&&this.extractIddPrefix(n),this.isWaitingForCountryCallingCode(n)){if(!this.extractCountryCallingCode(n))return}else n.appendNationalSignificantNumberDigits(r);n.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(n.getNationalDigits(),function(s){return n.update(s)})}},{key:"isWaitingForCountryCallingCode",value:function(r){var n=r.international,i=r.callingCode;return n&&!i}},{key:"extractCountryCallingCode",value:function(r){var n=eZ("+"+r.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode,a=n.number;if(i)return r.setCallingCode(i),r.update({nationalSignificantNumber:a}),!0}},{key:"reset",value:function(r){if(r){this.hasSelectedNumberingPlan=!0;var n=r._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=n&&m9e.test(n)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(r,n){if(this.hasSelectedNumberingPlan){var i=qI(r,this.metadata),a=i.nationalPrefix,s=i.nationalNumber,o=i.carrierCode;if(s!==r)return this.onExtractedNationalNumber(a,o,s,r,n),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(r,n,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(r,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var a=qI(r,this.metadata),s=a.nationalPrefix,o=a.nationalNumber,l=a.carrierCode;if(o!==n)return this.onExtractedNationalNumber(s,l,o,r,i),!0}}},{key:"onExtractedNationalNumber",value:function(r,n,i,a,s){var o,l,c=a.lastIndexOf(i);if(c>=0&&c===a.length-i.length){l=!0;var u=a.slice(0,c);u!==r&&(o=u)}s({nationalPrefix:r,carrierCode:n,nationalSignificantNumber:i,nationalSignificantNumberMatchesInput:l,complexPrefixBeforeNationalSignificantNumber:o}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(r){if(this.extractAnotherNationalSignificantNumber(r.getNationalDigits(),r.nationalSignificantNumber,function(n){return r.update(n)}))return!0;if(this.extractIddPrefix(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0;if(this.fixMissingPlus(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0}},{key:"extractIddPrefix",value:function(r){var n=r.international,i=r.IDDPrefix,a=r.digits;if(r.nationalSignificantNumber,!(n||i)){var s=ZQ(a,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(s!==void 0&&s!==a)return r.update({IDDPrefix:a.slice(0,a.length-s.length)}),this.startInternationalNumber(r,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(r){if(!r.international){var n=XQ(r.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode;if(n.number,i)return r.update({missingPlus:!0}),this.startInternationalNumber(r,{country:r.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(r,n){var i=n.country,a=n.callingCode;r.startInternationalNumber(i,a),r.nationalSignificantNumber&&(r.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(r){this.extractCountryCallingCode(r)&&this.extractNationalSignificantNumber(r.getNationalDigits(),function(n){return r.update(n)})}}]),t}();function w9e(t){var e=t.search(p9e);if(!(e<0)){t=t.slice(e);var r;return t[0]==="+"&&(r=!0,t=t.slice(1)),t=t.replace(g9e,""),r&&(t="+"+t),t}}function v9e(t){var e=w9e(t)||"";return e[0]==="+"?[e.slice(1),!0]:[e]}function b9e(t){var e=v9e(t),r=iZ(e,2),n=r[0],i=r[1];return h9e.test(n)||(n=""),[n,i]}function x9e(t,e){return S9e(t)||C9e(t,e)||_9e(t,e)||E9e()}function E9e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _9e(t,e){if(t){if(typeof t=="string")return eU(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eU(t,e)}}function eU(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1}},{key:"determineTheCountry",value:function(){this.state.setCountry(rZ(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var r=this.state,n=r.digits,i=r.callingCode,a=r.country,s=r.nationalSignificantNumber;if(n){if(this.isInternational())return i?"+"+i+s:"+"+n;if(a||i){var o=a?this.metadata.countryCallingCode():i;return"+"+o+s}}}},{key:"getNumber",value:function(){var r=this.state,n=r.nationalSignificantNumber,i=r.carrierCode,a=r.callingCode,s=this._getCountry();if(n&&!(!s&&!a)){if(s&&s===this.defaultCountry){var o=new oa(this.metadata.metadata);o.selectNumberingPlan(s);var l=o.numberingPlan.callingCode(),c=this.metadata.getCountryCodesForCallingCode(l);if(c.length>1){var u=tZ(n,{countries:c,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});u&&(s=u)}}var f=new UN(s||a,n,this.metadata.metadata);return i&&(f.carrierCode=i),f}}},{key:"isPossible",value:function(){var r=this.getNumber();return r?r.isPossible():!1}},{key:"isValid",value:function(){var r=this.getNumber();return r?r.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}]),t}();function T9e(t){return new oa(t).getCountries()}function k9e(t,e,r){if(e[t])return new UN(t,e[t],r)}const N9e={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},L9e={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0},j9e={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},$9e={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},P9e={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0},R9e={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},D9e={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},O9e={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0},F9e={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},sZ={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},oZ={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0},U9e={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},B9e={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},z9e={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var Is;(Is={}).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",Is.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",Is.INVALID_DATA="invalid_data",Is.LINKED_TO_ANOTHER_USER="linked_to_another_user",Is.ALLOWLIST_REJECTED="allowlist_rejected",Is.OAUTH_USER_DENIED="oauth_user_denied",Is.UNKNOWN_AUTH_ERROR="unknown_auth_error",Is.USER_EXITED_AUTH_FLOW="exited_auth_flow",Is.MUST_BE_AUTHENTICATED="must_be_authenticated",Is.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",Is.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",Is.CLIENT_REQUEST_TIMEOUT="client_request_timeout",Is.INVALID_CREDENTIALS="invalid_credentials";let W9e=class extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,r,n){super(e),r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},H9e=class extends W9e{constructor(e,r,n){super(e),this.type="provider_error",this.code=r,this.data=n}};const Xi={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};let bC=class extends H9e{constructor(e){var n,i,a;super(e.message,e.code,e.data);let r=Object.values(Xi).find(s=>s.eipCode===e.code);this.details=r||Xi.UNKNOWN_ERROR,e.code===-32002&&((n=e.message)!=null&&n.includes("already pending for origin")?(i=e.message)!=null&&i.includes("wallet_requestPermissions")?this.details=Xi.E32002_CONNECTION_ALREADY_PENDING:this.details=Xi.E32002_REQUEST_ALREADY_PENDING:(a=e.message)!=null&&a.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=Xi.E32002_WALLET_LOCKED))}};const ts=t=>nt.from(t);function ZI(t){if(typeof t=="number"||typeof t=="bigint"||typeof t=="string")return t;if(typeof t.toHexString=="function")return t.toHexString();throw Error(`Expected numeric value but received ${t}`)}function G9e(t){let e={};return t.to!==void 0&&(e.to=t.to),t.data!==void 0&&(e.data=t.data),t.chainId!==void 0&&(e.chainId=t.chainId),t.type!==void 0&&(e.type=t.type),t.accessList!==void 0&&(e.accessList=t.accessList),t.nonce!==void 0&&(e.nonce=ts(t.nonce).toNumber()),t.gasLimit!==void 0&&(e.gasLimit=ts(t.gasLimit)),t.gasPrice!==void 0&&(e.gasPrice=ts(t.gasPrice)),t.value!==void 0&&(e.value=ts(t.value)),t.maxFeePerGas!==void 0&&(e.maxFeePerGas=ts(t.maxFeePerGas)),t.maxPriorityFeePerGas!==void 0&&(e.maxPriorityFeePerGas=ts(t.maxPriorityFeePerGas)),e}const lZ=t=>[N9e.id,L9e.id,j9e.id].includes(t),q9e=async(t,e)=>{if(!lZ(t.chainId))throw Error("Invalid chain ID for Arbitrum gas estimation.");if(t.type===void 0&&(t.type=2),t.maxFeePerGas)return t;try{let{lastBaseFeePerGas:r}=await e.getFeeData();if(r){let n=r.mul(nt.from(120)).div(nt.from(100));t.maxFeePerGas=ZI(n),t.maxPriorityFeePerGas=ZI(nt.from(0))}}catch(r){throw Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return t},cZ=t=>[56,97].includes(t),V9e=async(t,e)=>{var r;if(!cZ(t.chainId))throw Error("Invalid chain ID for BSC gas estimation.");if(t.type===void 0?t.type=0:(t.type==1||t.type==2)&&console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!t.gasPrice){let n=await e.getFeeData();t.gasPrice=(r=n.gasPrice)==null?void 0:r.toHexString()}return t},Y9e=["function getL1Fee(bytes memory _data) external view returns (uint256)"],I9=t=>[$9e.id,P9e.id,R9e.id,D9e.id,O9e.id,F9e.id,U9e.id,z9e.id,B9e.id,81457,168587773].includes(t),K9e=async(t,e)=>{if(!I9(t.chainId))throw Error("Invalid chain ID for OP Stack gas estimation.");if(t.type===void 0&&(t.type=2),t.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete t.gasPrice),t.maxPriorityFeePerGas&&t.maxFeePerGas)return t;try{if(!t.maxPriorityFeePerGas){let r=await e.send("eth_maxPriorityFeePerGas",[]);t.maxPriorityFeePerGas=r}if(t.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),t.maxPriorityFeePerGas>=t.maxFeePerGas))throw Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!t.maxFeePerGas){let{lastBaseFeePerGas:r}=await e.getFeeData();if(!r)throw Error("Unable to fetch baseFee for last block.");let n=nt.from(r).mul(nt.from(126)).div(nt.from(100)).add(nt.from(t.maxPriorityFeePerGas));t.maxFeePerGas=ZI(n)}}catch(r){throw Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return t};async function J9e(t,e){if(!t.chainId||t.chainId&&!I9(t.chainId))return nt.from(0);let r=nt.from(0);try{let n=new S6e("0x420000000000000000000000000000000000000F",Y9e,e),i=G9e(t),a=ebe(i);r=await n.getL1Fee(a)}catch{}return r}var uZ={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Xt,function(){var r=function(a,s){if(s=s||{},typeof a!="function")throw new i("fetch must be a function");if(typeof s!="object")throw new i("defaults must be an object");if(s.retries!==void 0&&!n(s.retries))throw new i("retries must be a positive integer");if(s.retryDelay!==void 0&&!n(s.retryDelay)&&typeof s.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(s.retryOn!==void 0&&!Array.isArray(s.retryOn)&&typeof s.retryOn!="function")throw new i("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return s=Object.assign(o,s),function(c,u){var f=s.retries,h=s.retryDelay,g=s.retryOn;if(u&&u.retries!==void 0)if(n(u.retries))f=u.retries;else throw new i("retries must be a positive integer");if(u&&u.retryDelay!==void 0)if(n(u.retryDelay)||typeof u.retryDelay=="function")h=u.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(u&&u.retryOn)if(Array.isArray(u.retryOn)||typeof u.retryOn=="function")g=u.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(m,w){var C=function(b){var A=typeof Request<"u"&&c instanceof Request?c.clone():c;a(A,u).then(function(S){if(Array.isArray(g)&&g.indexOf(S.status)===-1)m(S);else if(typeof g=="function")try{return Promise.resolve(g(b,null,S)).then(function(j){j?v(b,null,S):m(S)}).catch(w)}catch(j){w(j)}else b=0}function i(a){this.name="ArgumentError",this.message=a}return r})})(uZ);var Q9e=uZ.exports;const Z9e=Lo(Q9e),dZ={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};let X9e=Z9e(fetch,{retries:3,retryDelay:500});const fZ=t=>[sZ.id,oZ.id,dZ.id].includes(t);let xC=t=>({maxPriorityFee:wF(t.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:wF(t.maxFee.toFixed(9),"gwei").toHexString()}),exe=t=>({safeLow:xC(t.safeLow),standard:xC(t.standard),fast:xC(t.fast)});const txe=async t=>{let e="";switch(t){case sZ.id:e="https://gasstation.polygon.technology/v2";break;case oZ.id:e="https://gasstation-testnet.polygon.technology/v2";break;case dZ.id:e="https://gasstation.polygon.technology/amoy";break;default:throw Error(`chainId ${t} does not support polygon gas stations`)}let r=await X9e(e),n=await r.json();if(r.status>399)throw n;return exe(n)};async function rxe(t){if(!fZ(t.chainId))throw Error("Invalid chain ID for Polygon gas estimation.");if(t.type===void 0&&(t.type=2),t.maxPriorityFeePerGas&&t.maxFeePerGas)return t;try{let{standard:e}=await txe(t.chainId);t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=e.maxPriorityFee),t.maxFeePerGas||(t.maxFeePerGas=e.maxFee),t.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete t.gasPrice)}catch(e){throw Error(`Failed to set gas prices from Polygon gas station with error: ${e}.`)}return t}const nxe=async(t,e)=>{var r,n,i;if(t.type===void 0&&(t.type=2),t.type===2){if(!t.maxFeePerGas||!t.maxPriorityFeePerGas){let a=await e.getFeeData();t.maxFeePerGas||(t.maxFeePerGas=(r=a.maxFeePerGas)==null?void 0:r.toHexString()),t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=(n=a.maxPriorityFeePerGas)==null?void 0:n.toHexString())}}else if(!t.gasPrice){let a=await e.getFeeData();t.gasPrice=(i=a.gasPrice)==null?void 0:i.toHexString()}return t};async function BN(t,e){if(!t.gasLimit)throw new bC("gasLimit was not successfully set for transaction.");let r=ts(t.gasLimit),n=nt.from(0);if(t.type==2){if(!t.maxFeePerGas)throw new bC("maxFeePerGas was not successfully set for transaction of type 2.");n=ts(t.maxFeePerGas)}else{if(!t.gasPrice)throw new bC("gasPrice was not successfully set for transaction of type 0 or 1.");n=ts(t.gasPrice)}let i=r.mul(n),a=nt.from(0);if(t.chainId&&I9(t.chainId))try{a=await J9e(t,e),i=i.add(a)}catch{}return{totalGasEstimate:i,l1ExecutionFeeEstimate:a}}async function ixe(t,e){try{return(await e.estimateGas(t)).toHexString()}catch(r){let n;if("message"in r&&r.message.includes("insufficient funds")&&(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'value'`),n=await async function({txRequest:i,provider:a}){try{let s={...i,value:void 0};return(await a.estimateGas(s)).toHexString()}catch(s){return console.warn(`Gas estimation failed with error: ${s} when omitting the 'value'`),null}}({txRequest:t,provider:e})),n||(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'from'`),n=await async function({txRequest:i,provider:a}){try{let s={...i,from:void 0};return(await a.estimateGas(s)).toHexString()}catch(s){return console.warn(`Gas estimation failed with error: ${s} when omitting the 'from' address`),null}}({txRequest:t,provider:e})),!n)throw r;return n}}function hZ(t){return/^-?0x[a-f0-9]+$/i.test(t)}function axe(t){for(let e of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=t[e];if(r!==void 0&&!function(n){let i=typeof n=="number",a=typeof n=="bigint",s=typeof n=="string"&&hZ(n);return i||a||s}(r))throw Error(`Transaction request property '${e}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof t.chainId!="number")throw Error("Transaction request property 'chainId' must be a number")}async function zN(t,e,r){if(e.chainId=Number(e.chainId),axe(e),e.from||(e.from=t),!e.nonce){let n=new v9(t,r);e.nonce=await n.getTransactionCount("pending")}return e.gasLimit||(e.gas?(e.gasLimit=e.gas,delete e.gas):e.gasLimit=await ixe(e,r)),typeof e.type=="string"&&hZ(e.type)&&(e.type=Number(e.type)),[23294,23295].includes(e.chainId)&&(e.type=0),(e=fZ(e.chainId)?await rxe(e):lZ(e.chainId)?await q9e(e,r):I9(e.chainId)?await K9e(e,r):cZ(e.chainId)?await V9e(e,r):await nxe(e,r)).type===0&&delete e.accessList,e.type!==2&&(delete e.maxPriorityFeePerGas,delete e.maxFeePerGas),e}var pZ={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(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function a(l,c,u,f,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var g=new i(u,f||l,h),m=r?r+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],g]:l._events[m].push(g):(l._events[m]=g,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},o.prototype.listeners=function(c){var u=r?r+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,g=f.length,m=new Array(g);h{let e=t;typeof e=="string"&&(e=fxe.encode(e));const r=32768,n=[];for(let i=0;ihxe(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),gxe=t=>{const e=atob(t),r=new Uint8Array(e.length);for(let n=0;n{let e=t;e instanceof Uint8Array&&(e=mZ.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return gxe(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class yxe extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var r;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}class Qh extends yxe{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}function wxe(t){return typeof t=="object"&&t!==null}function vxe(t){if(!wxe(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}const B5=pxe,bxe=mxe;function rU(t){if(typeof t!="string")throw new Qh("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:r}=t.split(".");if(r===5)throw new Qh("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new Qh("Invalid JWT");if(!e)throw new Qh("JWTs must contain a payload");let n;try{n=bxe(e)}catch{throw new Qh("Failed to base64url decode the payload")}let i;try{i=JSON.parse(mZ.decode(n))}catch{throw new Qh("Failed to parse the decoded payload as JSON")}if(!vxe(i))throw new Qh("Invalid JWT Claims Set");return i}/*! js-cookie v3.0.5 | MIT */function m4(t){for(var e=1;e"u")){s=m4({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var l in s)s[l]&&(o+="; "+l,s[l]!==!0&&(o+="="+s[l].split(";")[0]));return document.cookie=i+"="+t.write(a,i)+o}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],s={},o=0;o_xe(String(t),e),EC=(t,e)=>`+${WN(e)} ${t}`,Axe=t=>`*${t.replaceAll("-","").slice(-4)}`,Ixe=t=>new Mw(t),Mxe=Cxe().map(t=>({code:t,callCode:WN(t)})),Txe=t=>{var r;let e=(r=Sxe(t,Exe))==null?void 0:r.formatInternational();return e==null?void 0:e.substring(e.indexOf(" ")+1)},kxe=t=>{let e=new Mw;e.input(t);let r=e.getCountry()||"US",n=e.getCallingCode()||"1";return{countryCode:r,phone:t.replace("+"+n,"")}},Nxe=(t,e=!0)=>t.reduce((r,n)=>({...r,[n]:e}),{});let Lxe={buy:"CARD",send:"CRYPTO_ACCOUNT"},jxe={USDC:"2b92315d-eab7-5bef-84fa-089a131333f5",ETH:"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4",BTC:"5b71fc48-3dd3-540c-809b-f8c94d0e68b5",SOL:"4f039497-3af8-5bb3-951c-6df9afa9be1c",POL:"026bcc1e-9163-591c-a709-34dd18b2e7a1"};function $xe({input:t,amount:e,blockchain:r,asset:n,experience:i}){let a=new URL("https://pay.coinbase.com/buy/select-asset");return a.searchParams.set("appId",t.app_id),a.searchParams.set("sessionToken",t.session_token),a.searchParams.set("defaultExperience",i),a.searchParams.set("presetCryptoAmount",e.startsWith(".")?`0${e}`:e),a.searchParams.set("defaultNetwork",r),a.searchParams.set("defaultPaymentMethod",Lxe[i]),a.searchParams.set("defaultAsset",jxe[n]),a.searchParams.set("partnerUserId",t.partner_user_id),{url:a}}const Pxe="1.0.7";let Al=class eM extends Error{constructor(e,r={}){var s;const n=r.cause instanceof eM?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof eM&&r.cause.docsPath||r.docsPath,a=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${Pxe}`].join(` -`);super(a),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:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}};function Ch(t,e){const r=t.exec(e);return r==null?void 0:r.groups}const wZ=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,vZ=/^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)?$/,bZ=/^\(.+?\).*?$/,nU=/^tuple(?(\[(\d*)\])*)$/;function tM(t){let e=t.type;if(nU.test(t.type)&&"components"in t){e="(";const r=t.components.length;for(let i=0;i[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function Dxe(t){return xZ.test(t)}function Oxe(t){return Ch(xZ,t)}const EZ=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function Fxe(t){return EZ.test(t)}function Uxe(t){return Ch(EZ,t)}const _Z=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function Bxe(t){return _Z.test(t)}function zxe(t){return Ch(_Z,t)}const CZ=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function SZ(t){return CZ.test(t)}function Wxe(t){return Ch(CZ,t)}const AZ=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function Hxe(t){return AZ.test(t)}function Gxe(t){return Ch(AZ,t)}const qxe=/^fallback\(\) external(?:\s(?payable{1}))?$/;function Vxe(t){return qxe.test(t)}const Yxe=/^receive\(\) external payable$/;function Kxe(t){return Yxe.test(t)}const Jxe=new Set(["indexed"]),rM=new Set(["calldata","memory","storage"]);class Qxe extends Al{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Zxe extends Al{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Xxe extends Al{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class e7e extends Al{constructor({param:e,name:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class t7e extends Al{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class r7e extends Al{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class n7e extends Al{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class dy extends Al{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class i7e extends Al{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class a7e extends Al{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class s7e extends Al{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class o7e extends Al{constructor({current:e,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function l7e(t,e,r){let n="";if(r)for(const i of Object.entries(r)){if(!i)continue;let a="";for(const s of i[1])a+=`[${s.type}${s.name?`:${s.name}`:""}]`;n+=`(${i[0]}{${a}})`}return e?`${e}:${t}${n}`:t}const _C=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function c7e(t,e={}){if(Bxe(t)){const r=zxe(t);if(!r)throw new dy({signature:t,type:"function"});const n=nc(r.parameters),i=[],a=n.length;for(let o=0;o[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,d7e=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,f7e=/^u?int$/;function d0(t,e){var f,h;const r=l7e(t,e==null?void 0:e.type,e==null?void 0:e.structs);if(_C.has(r))return _C.get(r);const n=bZ.test(t),i=Ch(n?d7e:u7e,t);if(!i)throw new Xxe({param:t});if(i.name&&p7e(i.name))throw new e7e({param:t,name:i.name});const a=i.name?{name:i.name}:{},s=i.modifier==="indexed"?{indexed:!0}:{},o=(e==null?void 0:e.structs)??{};let l,c={};if(n){l="tuple";const g=nc(i.type),m=[],w=g.length;for(let C=0;C[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function MZ(t,e,r=new Set){const n=[],i=t.length;for(let a=0;ae(t,a)}function Iu(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new N7e(t.type);return`${t.name}(${T9(t.inputs,{includeName:e})})`}function T9(t,{includeName:e=!1}={}){return t?t.map(r=>w7e(r,{includeName:e})).join(e?", ":","):""}function w7e(t,{includeName:e}){return t.type.startsWith("tuple")?`(${T9(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}function vc(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function ai(t){return vc(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const TZ="2.22.1";let O2={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${TZ}`},Qe=class nM extends Error{constructor(e,r={}){var o;const n=(()=>{var l;return r.cause instanceof nM?r.cause.details:(l=r.cause)!=null&&l.message?r.cause.message:r.details})(),i=r.cause instanceof nM&&r.cause.docsPath||r.docsPath,a=(o=O2.getDocsUrl)==null?void 0:o.call(O2,{...r,docsPath:i}),s=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...O2.version?[`Version: ${O2.version}`]:[]].join(` -`);super(s,r.cause?{cause:r.cause}:void 0),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,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=TZ}walk(e){return kZ(this,e)}};function kZ(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?kZ(t.cause,e):e?null:t}class v7e extends Qe{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,name:"AbiConstructorNotFoundError"})}}class iU extends Qe{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,name:"AbiConstructorParamsNotFoundError"})}}class NZ extends Qe{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` -`),{metaMessages:[`Params: (${T9(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`],name:"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 P3 extends Qe{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class b7e extends Qe{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` -`),{name:"AbiEncodingArrayLengthMismatchError"})}}class x7e extends Qe{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${ai(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class E7e extends Qe{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` -`),{name:"AbiEncodingLengthMismatchError"})}}class LZ extends Qe{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,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class _7e extends Qe{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class jZ extends Qe{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,name:"AbiEventSignatureNotFoundError"})}}class aU extends Qe{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,name:"AbiEventNotFoundError"})}}class z5 extends Qe{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,name:"AbiFunctionNotFoundError"})}}class C7e extends Qe{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,name:"AbiFunctionOutputsNotFoundError"})}}class S7e extends Qe{constructor(e,{docsPath:r}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r,name:"AbiFunctionSignatureNotFoundError"})}}class A7e extends Qe{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Iu(e.abiItem)}\`, and`,`\`${r.type}\` in \`${Iu(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class I7e extends Qe{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}}class Tw extends Qe{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: (${T9(n,{includeName:!0})})`,`Data: ${r} (${i} bytes)`],name:"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 k9 extends Qe{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Iu(e,{includeName:!0})}".`].join(` -`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class M7e extends Qe{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r,name:"InvalidAbiEncodingType"})}}class T7e extends Qe{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r,name:"InvalidAbiDecodingType"})}}class k7e extends Qe{constructor(e){super([`Value "${e}" is not a valid array.`].join(` -`),{name:"InvalidArrayError"})}}class N7e extends Qe{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` -`),{name:"InvalidDefinitionTypeError"})}}class L7e extends Qe{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}class $Z extends Qe{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}let PZ=class extends Qe{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};class sU extends Qe{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.`,{name:"InvalidBytesLengthError"})}}function Im(t,{dir:e,size:r=32}={}){return typeof t=="string"?eh(t,{dir:e,size:r}):j7e(t,{dir:e,size:r})}function eh(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new PZ({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function j7e(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new PZ({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;ie)throw new R7e({givenSize:ai(t),maxSize:e})}function vo(t,e={}){const{signed:r}=e;e.size&&Mc(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,a=(1n<e.toString(16).padStart(2,"0"));function ur(t,e={}){return typeof t=="number"||typeof t=="bigint"?lr(t,e):typeof t=="string"?Dg(t,e):typeof t=="boolean"?DZ(t,e):Si(t,e)}function DZ(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Mc(r,{size:e.size}),Im(r,{size:e.size})):r}function Si(t,e={}){let r="";for(let i=0;ia||i=Zu.zero&&t<=Zu.nine)return t-Zu.zero;if(t>=Zu.A&&t<=Zu.F)return t-(Zu.A-10);if(t>=Zu.a&&t<=Zu.f)return t-(Zu.a-10)}function bc(t,e={}){let r=t;e.size&&(Mc(r,{size:e.size}),r=Im(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,a=new Uint8Array(i);for(let s=0,o=0;s0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function W5(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 OZ(t,e){HN(t);const r=e.outputLen;if(t.length>cU&w4)}:{h:Number(t>>cU&w4)|0,l:Number(t&w4)|0}}function G7e(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,V7e=(t,e,r)=>e<>>32-r,Y7e=(t,e,r)=>e<>>64-r,K7e=(t,e,r)=>t<>>64-r;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const J7e=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),CC=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Fc=(t,e)=>t<<32-e|t>>>e,uU=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Q7e=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function dU(t){for(let e=0;et().update(GN(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}const BZ=[],zZ=[],WZ=[],X7e=BigInt(0),F2=BigInt(1),eEe=BigInt(2),tEe=BigInt(7),rEe=BigInt(256),nEe=BigInt(113);for(let t=0,e=F2,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],BZ.push(2*(5*n+r)),zZ.push((t+1)*(t+2)/2%64);let i=X7e;for(let a=0;a<7;a++)e=(e<>tEe)*nEe)%rEe,e&eEe&&(i^=F2<<(F2<r>32?Y7e(t,e,r):q7e(t,e,r),hU=(t,e,r)=>r>32?K7e(t,e,r):V7e(t,e,r);function sEe(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let s=0;s<10;s++)r[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){const o=(s+8)%10,l=(s+2)%10,c=r[l],u=r[l+1],f=fU(c,u,1)^r[o],h=hU(c,u,1)^r[o+1];for(let g=0;g<50;g+=10)t[s+g]^=f,t[s+g+1]^=h}let i=t[2],a=t[3];for(let s=0;s<24;s++){const o=zZ[s],l=fU(i,a,o),c=hU(i,a,o),u=BZ[s];i=t[u],a=t[u+1],t[u]=l,t[u+1]=c}for(let s=0;s<50;s+=10){for(let o=0;o<10;o++)r[o]=t[s+o];for(let o=0;o<10;o++)t[s+o]^=~r[(o+2)%10]&r[(o+4)%10]}t[0]^=iEe[n],t[1]^=aEe[n]}r.fill(0)}let oEe=class HZ extends FZ{constructor(e,r,n,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,lU(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=J7e(this.state)}keccak(){uU||dU(this.state32),sEe(this.state32,this.rounds),uU||dU(this.state32),this.posOut=0,this.pos=0}update(e){W5(this);const{blockLen:r,state:n}=this;e=GN(e);const i=e.length;for(let a=0;a=n&&this.keccak();const s=Math.min(n-this.posOut,a-i);e.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return lU(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(OZ(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:a,enableXOF:s}=this;return e||(e=new HZ(r,n,i,s,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=n,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}};const lEe=(t,e,r)=>UZ(()=>new oEe(e,t,r)),cEe=lEe(1,136,256/8);function ea(t,e){const r=e||"hex",n=cEe(vc(t,{strict:!1})?Mm(t):t);return r==="bytes"?n:ur(n)}const uEe=t=>ea(Mm(t));function dEe(t){return uEe(t)}function fEe(t){let e=!0,r="",n=0,i="",a=!1;for(let s=0;s{const e=typeof t=="string"?t:Rxe(t);return fEe(e)};function GZ(t){return dEe(hEe(t))}const N9=GZ;class fs extends Qe{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class L9 extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const SC=new L9(8192);function R3(t,e){if(SC.has(`${t}.${e}`))return SC.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),n=ea(k0(r),"bytes"),i=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());const a=`0x${i.join("")}`;return SC.set(`${t}.${e}`,a),a}function qN(t,e){if(!Tn(t,{strict:!1}))throw new fs({address:t});return R3(t,e)}const pEe=/^0x[a-fA-F0-9]{40}$/,AC=new L9(8192);function Tn(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(AC.has(n))return AC.get(n);const i=pEe.test(t)?t.toLowerCase()===t?!0:r?R3(t)===t:!0:!1;return AC.set(n,i),i}function Bd(t){return typeof t[0]=="string"?ju(t):gEe(t)}function gEe(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 ju(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function Q0(t,e,r,{strict:n}={}){return vc(t,{strict:!1})?KZ(t,e,r,{strict:n}):YZ(t,e,r,{strict:n})}function qZ(t,e){if(typeof e=="number"&&e>0&&e>ai(t)-1)throw new $Z({offset:e,position:"start",size:ai(t)})}function VZ(t,e,r){if(typeof e=="number"&&typeof r=="number"&&ai(t)!==r-e)throw new $Z({offset:r,position:"end",size:ai(t)})}function YZ(t,e,r,{strict:n}={}){qZ(t,e);const i=t.slice(e,r);return n&&VZ(i,e,r),i}function KZ(t,e,r,{strict:n}={}){qZ(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&VZ(i,e,r),i}const mEe=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,JZ=/^(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 Tm(t,e){if(t.length!==e.length)throw new E7e({expectedLength:t.length,givenLength:e.length});const r=yEe({params:t,values:e}),n=YN(r);return n.length===0?"0x":n}function yEe({params:t,values:e}){const r=[];for(let n=0;n0?Bd([o,s]):o}}if(i)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:Bd(a.map(({encoded:s})=>s))}}function bEe(t,{param:e}){const[,r]=e.type.split("bytes"),n=ai(t);if(!r){let i=t;return n%32!==0&&(i=eh(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Bd([eh(lr(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new x7e({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:eh(t,{dir:"right"})}}function xEe(t){if(typeof t!="boolean")throw new Qe(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:eh(DZ(t))}}function EEe(t,{signed:e,size:r=256}){if(typeof r=="number"){const n=2n**(BigInt(r)-(e?1n:0n))-1n,i=e?-n-1n:0n;if(t>n||ti))}}function KN(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const j9=t=>Q0(GZ(t),0,4);function D3(t){const{abi:e,args:r=[],name:n}=t,i=vc(n,{strict:!1}),a=e.filter(o=>i?o.type==="function"?j9(o)===n:o.type==="event"?N9(o)===n:!1:"name"in o&&o.name===n);if(a.length===0)return;if(a.length===1)return a[0];let s;for(const o of a){if(!("inputs"in o))continue;if(!r||r.length===0){if(!o.inputs||o.inputs.length===0)return o;continue}if(!o.inputs||o.inputs.length===0||o.inputs.length!==r.length)continue;if(r.every((c,u)=>{const f="inputs"in o&&o.inputs[u];return f?iM(c,f):!1})){if(s&&"inputs"in s&&s.inputs){const c=QZ(o.inputs,s.inputs,r);if(c)throw new A7e({abiItem:o,type:c[0]},{abiItem:s,type:c[1]})}s=o}}return s||a[0]}function iM(t,e){const r=typeof t,n=e.type;switch(n){case"address":return Tn(t,{strict:!1});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,a)=>iM(Object.values(t)[a],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=>iM(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function QZ(t,e,r){for(const n in t){const i=t[n],a=e[n];if(i.type==="tuple"&&a.type==="tuple"&&"components"in i&&"components"in a)return QZ(i.components,a.components,r[n]);const s=[i.type,a.type];if(s.includes("address")&&s.includes("bytes20")?!0:s.includes("address")&&s.includes("string")?Tn(r[n],{strict:!1}):s.includes("address")&&s.includes("bytes")?Tn(r[n],{strict:!1}):!1)return s}}const pU="/docs/contract/encodeEventTopics";function O3(t){var l;const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const c=D3({abi:e,name:r});if(!c)throw new aU(r,{docsPath:pU});i=c}if(i.type!=="event")throw new aU(void 0,{docsPath:pU});const a=Iu(i),s=N9(a);let o=[];if(n&&"inputs"in i){const c=(l=i.inputs)==null?void 0:l.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?(c==null?void 0:c.map(f=>n[f.name]))??[]:[];u.length>0&&(o=(c==null?void 0:c.map((f,h)=>Array.isArray(u[h])?u[h].map((g,m)=>gU({param:f,value:u[h][m]})):u[h]?gU({param:f,value:u[h]}):null))??[])}return[s,...o]}function gU({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return ea(Mm(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new L7e(t.type);return Tm([t],[e])}function $9(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:a,response:s,status:o,transport:l})=>{o==="success"&&e===a&&(r[s]=l.request)})),a=>r[a]||t.request}async function ZZ(t,e){const{address:r,abi:n,args:i,eventName:a,fromBlock:s,strict:o,toBlock:l}=e,c=$9(t,{method:"eth_newFilter"}),u=a?O3({abi:n,args:i,eventName:a}):void 0,f=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof s=="bigint"?lr(s):s,toBlock:typeof l=="bigint"?lr(l):l,topics:u}]});return{abi:n,args:i,eventName:a,id:f,request:c(f),strict:!!o,type:"event"}}function ms(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const mU="/docs/contract/encodeFunctionData";function SEe(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const a=D3({abi:e,args:r,name:n});if(!a)throw new z5(n,{docsPath:mU});i=a}if(i.type!=="function")throw new z5(void 0,{docsPath:mU});return{abi:[i],functionName:j9(Iu(i))}}function Tc(t){const{args:e}=t,{abi:r,functionName:n}=(()=>{var o;return t.abi.length===1&&((o=t.functionName)!=null&&o.startsWith("0x"))?t:SEe(t)})(),i=r[0],a=n,s="inputs"in i&&i.inputs?Tm(i.inputs,e??[]):void 0;return ju([a,s??"0x"])}const XZ={1:"An `assert` condition failed.",17:"Arithmetic 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."},AEe={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},IEe={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class yU extends Qe{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class eX extends Qe{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class MEe extends Qe{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const TEe={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new MEe({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new eX({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new yU({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 yU({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},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function JN(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(TEe);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function kEe(t,e={}){typeof e.size<"u"&&Mc(t,{size:e.size});const r=Si(t,e);return vo(r,e)}function NEe(t,e={}){let r=t;if(typeof e.size<"u"&&(Mc(r,{size:e.size}),r=hc(r)),r.length>1||r[0]>1)throw new $7e(r);return!!r[0]}function Nd(t,e={}){typeof e.size<"u"&&Mc(t,{size:e.size});const r=Si(t,e);return Mu(r,e)}function LEe(t,e={}){let r=t;return typeof e.size<"u"&&(Mc(r,{size:e.size}),r=hc(r,{dir:"right"})),new TextDecoder().decode(r)}function km(t,e){const r=typeof e=="string"?bc(e):e,n=JN(r);if(ai(r)===0&&t.length>0)throw new P3;if(ai(e)&&ai(e)<32)throw new NZ({data:typeof e=="string"?e:Si(e),params:t,size:ai(e)});let i=0;const a=[];for(let s=0;s48?kEe(i,{signed:r}):Nd(i,{signed:r}),32]}function OEe(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:s})=>!s),i=n?[]:{};let a=0;if(kw(e)){const s=Nd(t.readBytes(aM)),o=r+s;for(let l=0;ls.type==="error"&&n===j9(Iu(s)));if(!a)throw new LZ(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?km(a.inputs,Q0(r,4)):void 0,errorName:a.name}}const ia=(t,e,r)=>JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString():i,r);function tX({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,a)=>`${n&&i.name?`${i.name}: `:""}${typeof e[a]=="object"?ia(e[a]):e[a]}`).join(", ")})`}const rX={gwei:9,wei:18},BEe={ether:-9,wei:9};function P9(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,a]=[r.slice(0,r.length-e),r.slice(r.length-e)];return a=a.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${a?`.${a}`:""}`}function F3(t,e="wei"){return P9(t,rX[e])}function Gs(t,e="wei"){return P9(t,BEe[e])}class zEe extends Qe{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class WEe extends Qe{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function vU(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} -`,"")}function HEe(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+=vU(n.state)),n.stateDiff&&(i+=` stateDiff: -`,i+=vU(n.stateDiff)),i},` State Override: -`).slice(0,-1)}function U3(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 GEe extends Qe{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` -`),{name:"FeeConflictError"})}}class qEe extends Qe{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class VEe extends Qe{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",U3(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","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class YEe extends Qe{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class KEe extends Qe{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:s,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){var m;const g=U3({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 h<"u"&&`${F3(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:a,gas:s,gasPrice:typeof o<"u"&&`${Gs(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${Gs(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Gs(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",g].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class nX extends Qe{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:a}){let s="Transaction";n&&a!==void 0&&(s=`Transaction at block time "${n}" at index "${a}"`),e&&a!==void 0&&(s=`Transaction at block hash "${e}" at index "${a}"`),r&&a!==void 0&&(s=`Transaction at block number "${r}" at index "${a}"`),i&&(s=`Transaction with hash "${i}"`),super(`${s} could not be found.`,{name:"TransactionNotFoundError"})}}class iX extends Qe{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class JEe extends Qe{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const QEe=t=>t,QN=t=>t;class aX extends Qe{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:s,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h,stateOverride:g}){var C;const m=r?ms(r):void 0;let w=U3({from:m==null?void 0:m.address,to:f,value:typeof h<"u"&&`${F3(h)} ${((C=i==null?void 0:i.nativeCurrency)==null?void 0:C.symbol)||"ETH"}`,data:a,gas:s,gasPrice:typeof o<"u"&&`${Gs(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${Gs(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Gs(c)} gwei`,nonce:u});g&&(w+=` -${HEe(g)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class ZEe extends Qe{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:a,functionName:s,sender:o}){const l=D3({abi:r,args:n,name:s}),c=l?tX({abiItem:l,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=l?Iu(l,{includeName:!0}):void 0,f=U3({address:i&&QEe(i),function:u,args:c&&c!=="()"&&`${[...Array((s==null?void 0:s.length)??0).keys()].map(()=>" ").join("")}${c}`,sender:o});super(e.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:e,docsPath:a,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],f&&"Contract Call:",f].filter(Boolean),name:"ContractFunctionExecutionError"}),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}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=s,this.sender=o}}class sM extends Qe{constructor({abi:e,data:r,functionName:n,message:i}){let a,s,o,l;if(r&&r!=="0x")try{s=UEe({abi:e,data:r});const{abiItem:u,errorName:f,args:h}=s;if(f==="Error")l=h[0];else if(f==="Panic"){const[g]=h;l=XZ[g]}else{const g=u?Iu(u,{includeName:!0}):void 0,m=u&&h?tX({abiItem:u,args:h,includeFunctionName:!1,includeName:!1}):void 0;o=[g?`Error: ${g}`:"",m&&m!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(u){a=u}else i&&(l=i);let c;a instanceof LZ&&(c=a.signature,o=[`Unable to decode signature "${c}" 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=${c}.`]),super(l&&l!=="execution reverted"||c?[`The contract function "${n}" reverted with the following ${c?"signature":"reason"}:`,l||c].join(` -`):`The contract function "${n}" reverted.`,{cause:a,metaMessages:o,name:"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=s,this.reason=l,this.signature=c}}class XEe extends Qe{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."],name:"ContractFunctionZeroDataError"})}}class e_e extends Qe{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class R9 extends Qe{constructor({data:e,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class Oy extends Qe{constructor({body:e,cause:r,details:n,headers:i,status:a,url:s}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[a&&`Status: ${a}`,`URL: ${QN(s)}`,e&&`Request body: ${ia(e)}`].filter(Boolean),name:"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=i,this.status=a,this.url=s}}class ZN extends Qe{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${QN(n)}`,`Request body: ${ia(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code,this.data=r.data}}class bU extends Qe{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${QN(r)}`,`Request body: ${ia(e)}`],name:"TimeoutError"})}}const t_e=-1;class Xs extends Qe{constructor(e,{code:r,docsPath:n,metaMessages:i,name:a,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages),name:a||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=a||e.name,this.code=e instanceof ZN?e.code:r??t_e}}class Nm extends Xs{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class Nw extends Xs{constructor(e){super(e,{code:Nw.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Nw,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Lw extends Xs{constructor(e){super(e,{code:Lw.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Lw,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class jw extends Xs{constructor(e,{method:r}={}){super(e,{code:jw.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(jw,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class $w extends Xs{constructor(e){super(e,{code:$w.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty($w,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Z0 extends Xs{constructor(e){super(e,{code:Z0.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Z0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class X0 extends Xs{constructor(e){super(e,{code:X0.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(X0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Pw extends Xs{constructor(e){super(e,{code:Pw.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Pw,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Rw extends Xs{constructor(e){super(e,{code:Rw.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Rw,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Dw extends Xs{constructor(e){super(e,{code:Dw.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(Dw,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Ow extends Xs{constructor(e,{method:r}={}){super(e,{code:Ow.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not implemented.`})}}Object.defineProperty(Ow,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Og extends Xs{constructor(e){super(e,{code:Og.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Og,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Fw extends Xs{constructor(e){super(e,{code:Fw.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Fw,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class gg extends Nm{constructor(e){super(e,{code:gg.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(gg,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Uw extends Nm{constructor(e){super(e,{code:Uw.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(Uw,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Bw extends Nm{constructor(e,{method:r}={}){super(e,{code:Bw.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(Bw,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class zw extends Nm{constructor(e){super(e,{code:zw.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(zw,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Ww extends Nm{constructor(e){super(e,{code:Ww.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Ww,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Hw extends Nm{constructor(e){super(e,{code:Hw.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Hw,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class r_e extends Xs{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const n_e=3;function e1(t,{abi:e,address:r,args:n,docsPath:i,functionName:a,sender:s}){const o=t instanceof R9?t:t instanceof Qe?t.walk(m=>"data"in m)||t.walk():{},{code:l,data:c,details:u,message:f,shortMessage:h}=o,g=t instanceof P3?new XEe({functionName:a}):[n_e,Z0.code].includes(l)&&(c||u||f||h)?new sM({abi:e,data:typeof c=="object"?c.data:c,functionName:a,message:o instanceof ZN?u:h??f}):t;return new ZEe(g,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:a,sender:s})}function i_e(t){const e=ea(`0x${t.substring(4)}`).substring(26);return R3(`0x${e}`)}async function a_e({hash:t,signature:e}){const r=vc(t)?t:ur(t),{secp256k1:n}=await qs(async()=>{const{secp256k1:s}=await Promise.resolve().then(()=>SAe);return{secp256k1:s}},void 0);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:c,s:u,v:f,yParity:h}=e,g=Number(h??f),m=xU(g);return new n.Signature(vo(c),vo(u)).addRecoveryBit(m)}const s=vc(e)?e:ur(e),o=Mu(`0x${s.slice(130)}`),l=xU(o);return n.Signature.fromCompact(s.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function xU(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function sX({hash:t,signature:e}){return i_e(await a_e({hash:t,signature:e}))}function oh(t,e="hex"){const r=oX(t),n=JN(new Uint8Array(r.length));return r.encode(n),e==="hex"?Si(n.bytes):n.bytes}function oX(t){return Array.isArray(t)?s_e(t.map(e=>oX(e))):o_e(t)}function s_e(t){const e=t.reduce((i,a)=>i+a.length,0),r=lX(e);return{length:e<=55?1+e:1+r+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+r),r===1?i.pushUint8(e):r===2?i.pushUint16(e):r===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:a}of t)a(i)}}}function o_e(t){const e=typeof t=="string"?bc(t):t,r=lX(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+r+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+r),r===1?i.pushUint8(e.length):r===2?i.pushUint16(e.length):r===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function lX(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new Qe("Length is too large.")}function l_e(t){const{chainId:e,contractAddress:r,nonce:n,to:i}=t,a=ea(ju(["0x05",oh([e?lr(e):"0x",r,n?lr(n):"0x"])]));return i==="bytes"?bc(a):a}async function cX(t){const{authorization:e,signature:r}=t;return sX({hash:l_e(e),signature:r??e})}class c_e extends Qe{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:s,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){var m;const g=U3({from:r==null?void 0:r.address,to:f,value:typeof h<"u"&&`${F3(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:a,gas:s,gasPrice:typeof o<"u"&&`${Gs(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${Gs(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Gs(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",g].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class Qp extends Qe{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,name:"ExecutionRevertedError"})}}Object.defineProperty(Qp,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Qp,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class t1 extends Qe{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Gs(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(t1,"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 oM extends Qe{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Gs(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(oM,"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 lM extends Qe{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(lM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class cM extends Qe{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,name:"NonceTooLowError"})}}Object.defineProperty(cM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class uM extends Qe{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(uM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class dM extends Qe{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."],name:"InsufficientFundsError"})}}Object.defineProperty(dM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class fM extends Qe{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,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(fM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class hM extends Qe{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(hM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class pM extends Qe{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(pM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Gw extends Qe{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${Gs(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Gs(n)} gwei`:""}).`].join(` -`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(Gw,"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 B3 extends Qe{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function D9(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof Qe?t.walk(i=>(i==null?void 0:i.code)===Qp.code):t;return n instanceof Qe?new Qp({cause:t,message:n.details}):Qp.nodeMessage.test(r)?new Qp({cause:t,message:t.details}):t1.nodeMessage.test(r)?new t1({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):oM.nodeMessage.test(r)?new oM({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):lM.nodeMessage.test(r)?new lM({cause:t,nonce:e==null?void 0:e.nonce}):cM.nodeMessage.test(r)?new cM({cause:t,nonce:e==null?void 0:e.nonce}):uM.nodeMessage.test(r)?new uM({cause:t,nonce:e==null?void 0:e.nonce}):dM.nodeMessage.test(r)?new dM({cause:t}):fM.nodeMessage.test(r)?new fM({cause:t,gas:e==null?void 0:e.gas}):hM.nodeMessage.test(r)?new hM({cause:t,gas:e==null?void 0:e.gas}):pM.nodeMessage.test(r)?new pM({cause:t}):Gw.nodeMessage.test(r)?new Gw({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new B3({cause:t})}function u_e(t,{docsPath:e,...r}){const n=(()=>{const i=D9(t,r);return i instanceof B3?t:i})();return new c_e(n,{docsPath:e,...r})}function O9(t,{format:e}){if(!e)return{};const r={};function n(a){const s=Object.keys(a);for(const o of s)o in t&&(r[o]=t[o]),a[o]&&typeof a[o]=="object"&&!Array.isArray(a[o])&&n(a[o])}const i=e(t||{});return n(i),r}function XN(t,e){return({exclude:r,format:n})=>({exclude:r,format:i=>{const a=e(i);if(r)for(const s of r)delete a[s];return{...a,...n(i)}},type:t})}const d_e={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Lm(t){const e={};return typeof t.authorizationList<"u"&&(e.authorizationList=f_e(t.authorizationList)),typeof t.accessList<"u"&&(e.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(e.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?e.blobs=t.blobs.map(r=>Si(r)):e.blobs=t.blobs),typeof t.data<"u"&&(e.data=t.data),typeof t.from<"u"&&(e.from=t.from),typeof t.gas<"u"&&(e.gas=lr(t.gas)),typeof t.gasPrice<"u"&&(e.gasPrice=lr(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=lr(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(e.maxFeePerGas=lr(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=lr(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(e.nonce=lr(t.nonce)),typeof t.to<"u"&&(e.to=t.to),typeof t.type<"u"&&(e.type=d_e[t.type]),typeof t.value<"u"&&(e.value=lr(t.value)),e}function f_e(t){return t.map(e=>({address:e.contractAddress,r:e.r,s:e.s,chainId:lr(e.chainId),nonce:lr(e.nonce),...typeof e.yParity<"u"?{yParity:lr(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:lr(e.v)}:{}}))}function EU(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new sU({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new sU({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function h_e(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:a}=t,s={};if(a!==void 0&&(s.code=a),e!==void 0&&(s.balance=lr(e)),r!==void 0&&(s.nonce=lr(r)),n!==void 0&&(s.state=EU(n)),i!==void 0){if(s.state)throw new WEe;s.stateDiff=EU(i)}return s}function eL(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!Tn(r,{strict:!1}))throw new fs({address:r});if(e[r])throw new zEe({address:r});e[r]=h_e(n)}return e}const F9=2n**256n-1n;function b1(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:a}=t,s=e?ms(e):void 0;if(s&&!Tn(s.address))throw new fs({address:s.address});if(a&&!Tn(a))throw new fs({address:a});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new GEe;if(n&&n>F9)throw new t1({maxFeePerGas:n});if(i&&n&&i>n)throw new Gw({maxFeePerGas:n,maxPriorityFeePerGas:i})}class p_e extends Qe{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class tL extends Qe{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class g_e extends Qe{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Gs(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class uX extends Qe{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.`,{name:"BlockNotFoundError"})}}const dX={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function U9(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?Mu(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?Mu(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?dX[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 t.authorizationList&&(e.authorizationList=y_e(t.authorizationList)),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}const m_e=XN("transaction",U9);function y_e(t){return t.map(e=>({contractAddress:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))}function rL(t){const e=(t.transactions??[]).map(r=>typeof r=="string"?r:U9(r));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}}const w_e=XN("block",rL);async function lu(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,h;const a=n??"latest",s=i??!1,o=r!==void 0?lr(r):void 0;let l=null;if(e?l=await t.request({method:"eth_getBlockByHash",params:[e,s]},{dedupe:!0}):l=await t.request({method:"eth_getBlockByNumber",params:[o||a,s]},{dedupe:!!o}),!l)throw new uX({blockHash:e,blockNumber:r});return(((h=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:h.format)||rL)(l)}async function nL(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function v_e(t,e){return fX(t,e)}async function fX(t,e){var a,s;const{block:r,chain:n=t.chain,request:i}=e||{};try{const o=((a=n==null?void 0:n.fees)==null?void 0:a.maxPriorityFeePerGas)??((s=n==null?void 0:n.fees)==null?void 0:s.defaultPriorityFee);if(typeof o=="function"){const c=r||await nr(t,lu,"getBlock")({}),u=await o({block:c,client:t,request:i});if(u===null)throw new Error;return u}if(typeof o<"u")return o;const l=await t.request({method:"eth_maxPriorityFeePerGas"});return vo(l)}catch{const[o,l]=await Promise.all([r?Promise.resolve(r):nr(t,lu,"getBlock")({}),nr(t,nL,"getGasPrice")({})]);if(typeof o.baseFeePerGas!="bigint")throw new tL;const c=l-o.baseFeePerGas;return c<0n?0n:c}}async function b_e(t,e){return gM(t,e)}async function gM(t,e){var h,g;const{block:r,chain:n=t.chain,request:i,type:a="eip1559"}=e||{},s=await(async()=>{var m,w;return typeof((m=n==null?void 0:n.fees)==null?void 0:m.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((w=n==null?void 0:n.fees)==null?void 0:w.baseFeeMultiplier)??1.2})();if(s<1)throw new p_e;const l=10**(((h=s.toString().split(".")[1])==null?void 0:h.length)??0),c=m=>m*BigInt(Math.ceil(s*l))/BigInt(l),u=r||await nr(t,lu,"getBlock")({});if(typeof((g=n==null?void 0:n.fees)==null?void 0:g.estimateFeesPerGas)=="function"){const m=await n.fees.estimateFeesPerGas({block:r,client:t,multiply:c,request:i,type:a});if(m!==null)return m}if(a==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new tL;const m=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await fX(t,{block:u,chain:n,request:i}),w=c(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??w+m,maxPriorityFeePerGas:m}}return{gasPrice:(i==null?void 0:i.gasPrice)??c(await nr(t,nL,"getGasPrice")({}))}}async function hX(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?lr(n):r]},{dedupe:!!n});return Mu(i)}function iL(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(a=>bc(a)):t.blobs,i=[];for(const a of n)i.push(Uint8Array.from(e.blobToKzgCommitment(a)));return r==="bytes"?i:i.map(a=>Si(a))}function aL(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(s=>bc(s)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(s=>bc(s)):t.commitments,a=[];for(let s=0;sSi(s))}function x_e(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),a=BigInt(4294967295),s=Number(r>>i&a),o=Number(r&a),l=n?4:0,c=n?0:4;t.setUint32(e+l,s,n),t.setUint32(e+c,o,n)}const E_e=(t,e,r)=>t&e^~t&r,__e=(t,e,r)=>t&e^t&r^e&r;let C_e=class extends FZ{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=CC(this.buffer)}update(e){W5(this);const{view:r,buffer:n,blockLen:i}=this;e=GN(e);const a=e.length;for(let s=0;si-s&&(this.process(n,0),s=0);for(let f=s;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,w=Fc(g,17)^Fc(g,19)^g>>>10;xf[f]=w+xf[f-7]+m+xf[f-16]|0}let{A:n,B:i,C:a,D:s,E:o,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=Fc(o,6)^Fc(o,11)^Fc(o,25),g=u+h+E_e(o,l,c)+S_e[f]+xf[f]|0,w=(Fc(n,2)^Fc(n,13)^Fc(n,22))+__e(n,i,a)|0;u=c,c=l,l=o,o=s+g|0,s=a,a=i,i=n,n=g+w|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,s=s+this.D|0,o=o+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,i,a,s,o,l,c,u)}roundClean(){xf.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const I_e=UZ(()=>new A_e);function M_e(t,e){return I_e(vc(t,{strict:!1})?Mm(t):t)}function T_e(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=M_e(e);return i.set([r],0),n==="bytes"?i:Si(i)}function pX(t){const{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const a of e)i.push(T_e({commitment:a,to:n,version:r}));return i}const _U=6,gX=32,sL=4096,mX=gX*sL,CU=mX*_U-1-1*sL*_U,yX=1;class k_e extends Qe{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class wX extends Qe{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class N_e extends Qe{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class L_e extends Qe{constructor({hash:e,version:r}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${yX}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}function j_e(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?bc(t.data):t.data,n=ai(r);if(!n)throw new wX;if(n>CU)throw new k_e({maxSize:CU,size:n});const i=[];let a=!0,s=0;for(;a;){const o=JN(new Uint8Array(mX));let l=0;for(;lo.bytes):i.map(o=>Si(o.bytes))}function vX(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??j_e({data:e,to:n}),a=t.commitments??iL({blobs:i,kzg:r,to:n}),s=t.proofs??aL({blobs:i,commitments:a,kzg:r,to:n}),o=[];for(let l=0;l"u"&&f)if(l){const v=await C();h.nonce=await l.consume({address:f.address,chainId:v,client:t})}else h.nonce=await nr(t,hX,"getTransactionCount")({address:f.address,blockTag:"pending"});if((c.includes("fees")||c.includes("type"))&&typeof u>"u")try{h.type=bX(h)}catch{const v=await m();h.type=typeof(v==null?void 0:v.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(c.includes("fees"))if(h.type!=="legacy"&&h.type!=="eip2930"){if(typeof h.maxFeePerGas>"u"||typeof h.maxPriorityFeePerGas>"u"){const v=await m(),{maxFeePerGas:b,maxPriorityFeePerGas:A}=await gM(t,{block:v,chain:i,request:h});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(h.gas=await nr(t,oL,"estimateGas")({...h,account:f&&{address:f.address,type:"json-rpc"}})),b1(h),delete h.parameters,h}async function EX(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?lr(r):void 0,a=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(a)}async function oL(t,e){var i,a,s;const{account:r=t.account}=e,n=r?ms(r):void 0;try{let x=function(L){const{block:O,request:P,rpcStateOverride:R}=L;return t.request({method:"eth_estimateGas",params:R?[P,O??"latest",R]:O?[P,O]:[P]})};const{accessList:o,authorizationList:l,blobs:c,blobVersionedHashes:u,blockNumber:f,blockTag:h,data:g,gas:m,gasPrice:w,maxFeePerBlobGas:C,maxFeePerGas:v,maxPriorityFeePerGas:b,nonce:A,value:S,stateOverride:j,...U}=await B9(t,{...e,parameters:(n==null?void 0:n.type)==="local"?void 0:["blobVersionedHashes"]}),B=(f?lr(f):void 0)||h,V=eL(j),se=await(async()=>{if(U.to)return U.to;if(l&&l.length>0)return await cX({authorization:l[0]}).catch(()=>{throw new Qe("`to` is required. Could not infer from `authorizationList`")})})();b1(e);const Y=(s=(a=(i=t.chain)==null?void 0:i.formatters)==null?void 0:a.transactionRequest)==null?void 0:s.format,k=(Y||Lm)({...O9(U,{format:Y}),from:n==null?void 0:n.address,accessList:o,authorizationList:l,blobs:c,blobVersionedHashes:u,data:g,gas:m,gasPrice:w,maxFeePerBlobGas:C,maxFeePerGas:v,maxPriorityFeePerGas:b,nonce:A,to:se,value:S});let _=BigInt(await x({block:B,request:k,rpcStateOverride:V}));if(l){const L=await EX(t,{address:k.from}),O=await Promise.all(l.map(async P=>{const{contractAddress:R}=P,M=await x({block:B,request:{authorizationList:void 0,data:g,from:n==null?void 0:n.address,to:R,value:lr(L)},rpcStateOverride:V}).catch(()=>100000n);return 2n*BigInt(M)}));_+=O.reduce((P,R)=>P+R,0n)}return _}catch(o){throw u_e(o,{...e,account:n,chain:t.chain})}}async function $_e(t,e){const{abi:r,address:n,args:i,functionName:a,dataSuffix:s,...o}=e,l=Tc({abi:r,args:i,functionName:a});try{return await nr(t,oL,"estimateGas")({data:`${l}${s?s.replace("0x",""):""}`,to:n,...o})}catch(c){const u=o.account?ms(o.account):void 0;throw e1(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:a,sender:u==null?void 0:u.address})}}function lL(t,e){if(!Tn(t,{strict:!1}))throw new fs({address:t});if(!Tn(e,{strict:!1}))throw new fs({address:e});return t.toLowerCase()===e.toLowerCase()}const SU="/docs/contract/decodeEventLog";function cL(t){const{abi:e,data:r,strict:n,topics:i}=t,a=n??!0,[s,...o]=i;if(!s)throw new _7e({docsPath:SU});const l=e.length===1?e[0]:e.find(w=>w.type==="event"&&s===N9(Iu(w)));if(!(l&&"name"in l)||l.type!=="event")throw new jZ(s,{docsPath:SU});const{name:c,inputs:u}=l,f=u==null?void 0:u.some(w=>!("name"in w&&w.name));let h=f?[]:{};const g=u.filter(w=>"indexed"in w&&w.indexed);for(let w=0;w!("indexed"in w&&w.indexed));if(m.length>0){if(r&&r!=="0x")try{const w=km(m,r);if(w)if(f)h=[...h,...w];else for(let C=0;C0?h:void 0}}function P_e({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(km([t],e)||[])[0]}function uL(t){const{abi:e,args:r,logs:n,strict:i=!0}=t,a=(()=>{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})();return n.map(s=>{var o;try{const l=e.find(u=>u.type==="event"&&s.topics[0]===N9(u));if(!l)return null;const c=cL({...s,abi:[l],strict:i});return a&&!a.includes(c.eventName)||!R_e({args:c.args,inputs:l.inputs,matchArgs:r})?null:{...c,...s}}catch(l){let c,u;if(l instanceof jZ)return null;if(l instanceof Tw||l instanceof k9){if(i)return null;c=l.abiItem.name,u=(o=l.abiItem.inputs)==null?void 0:o.some(f=>!("name"in f&&f.name))}return{...s,args:u?[]:{},eventName:c}}}).filter(Boolean)}function R_e(t){const{args:e,inputs:r,matchArgs:n}=t;if(!n)return!0;if(!e)return!1;function i(a,s,o){try{return a.type==="address"?lL(s,o):a.type==="string"||a.type==="bytes"?ea(Mm(s))===o:s===o}catch{return!1}}return Array.isArray(e)&&Array.isArray(n)?n.every((a,s)=>{if(a==null)return!0;const o=r[s];return o?(Array.isArray(a)?a:[a]).some(c=>i(o,c,e[s])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([a,s])=>{if(s==null)return!0;const o=r.find(c=>c.name===a);return o?(Array.isArray(s)?s:[s]).some(c=>i(o,c,e[a])):!1}):!1}function zd(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}:{}}}async function dL(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:a,events:s,args:o,strict:l}={}){const c=l??!1,u=s??(a?[a]:void 0);let f=[];u&&(f=[u.flatMap(w=>O3({abi:[w],eventName:w.name,args:s?void 0:o}))],a&&(f=f[0]));let h;r?h=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,blockHash:r}]}):h=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,fromBlock:typeof n=="bigint"?lr(n):n,toBlock:typeof i=="bigint"?lr(i):i}]});const g=h.map(m=>zd(m));return u?uL({abi:u,args:o,logs:g,strict:c}):g}async function _X(t,e){const{abi:r,address:n,args:i,blockHash:a,eventName:s,fromBlock:o,toBlock:l,strict:c}=e,u=s?D3({abi:r,name:s}):void 0,f=u?void 0:r.filter(h=>h.type==="event");return nr(t,dL,"getLogs")({address:n,args:i,blockHash:a,event:u,events:f,fromBlock:o,toBlock:l,strict:c})}const IC="/docs/contract/decodeFunctionResult";function x1(t){const{abi:e,args:r,functionName:n,data:i}=t;let a=e[0];if(n){const o=D3({abi:e,args:r,name:n});if(!o)throw new z5(n,{docsPath:IC});a=o}if(a.type!=="function")throw new z5(void 0,{docsPath:IC});if(!a.outputs)throw new C7e(a.name,{docsPath:IC});const s=km(a.outputs,i);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}const mM=[{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"}],CX=[{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"}],SX=[...CX,{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"}]}],D_e=[...CX,{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"}]}],AU=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],IU=[{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"}]}],MU=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],O_e="0x82ad56cb",F_e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",U_e="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",B_e="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";class yM extends Qe{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.`]],name:"ChainDoesNotSupportContract"})}}class z_e extends Qe{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}`],name:"ChainMismatchError"})}}class W_e extends Qe{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(` -`),{name:"ChainNotFoundError"})}}class AX extends Qe{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class z9 extends Qe{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const MC="/docs/contract/encodeDeployData";function W9(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(s=>"type"in s&&s.type==="constructor");if(!i)throw new v7e({docsPath:MC});if(!("inputs"in i))throw new iU({docsPath:MC});if(!i.inputs||i.inputs.length===0)throw new iU({docsPath:MC});const a=Tm(i.inputs,r);return ju([n,a])}function jm({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 yM({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new yM({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function IX(t,{docsPath:e,...r}){const n=(()=>{const i=D9(t,r);return i instanceof B3?t:i})();return new aX(n,{docsPath:e,...r})}function MX(){let t=()=>{},e=()=>{};return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const TC=new Map;function TX({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const a=async()=>{const u=l();s();const f=u.map(({args:h})=>h);f.length!==0&&t(f).then(h=>{i&&Array.isArray(h)&&h.sort(i);for(let g=0;g{for(let g=0;gTC.delete(e),o=()=>l().map(({args:u})=>u),l=()=>TC.get(e)||[],c=u=>TC.set(e,[...l(),u]);return{flush:s,async schedule(u){const{promise:f,resolve:h,reject:g}=MX();return(r==null?void 0:r([...o(),u]))&&a(),l().length>0?(c({args:u,resolve:h,reject:g}),f):(c({args:u,resolve:h,reject:g}),setTimeout(a,n),f)}}}async function H9(t,e){var Y,N,k,x;const{account:r=t.account,batch:n=!!((Y=t.batch)!=null&&Y.multicall),blockNumber:i,blockTag:a="latest",accessList:s,blobs:o,code:l,data:c,factory:u,factoryData:f,gas:h,gasPrice:g,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:C,nonce:v,to:b,value:A,stateOverride:S,...j}=e,U=r?ms(r):void 0;if(l&&(u||f))throw new Qe("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(l&&b)throw new Qe("Cannot provide both `code` & `to` as parameters.");const I=l&&c,B=u&&f&&b&&c,V=I||B,se=I?q_e({code:l,data:c}):B?V_e({data:c,factory:u,factoryData:f,to:b}):c;try{b1(e);const L=(i?lr(i):void 0)||a,O=eL(S),P=(x=(k=(N=t.chain)==null?void 0:N.formatters)==null?void 0:k.transactionRequest)==null?void 0:x.format,M=(P||Lm)({...O9(j,{format:P}),from:U==null?void 0:U.address,accessList:s,blobs:o,data:se,gas:h,gasPrice:g,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:C,nonce:v,to:V?void 0:b,value:A});if(n&&H_e({request:M})&&!O)try{return await G_e(t,{...M,blockNumber:i,blockTag:a})}catch($){if(!($ instanceof AX)&&!($ instanceof yM))throw $}const D=await t.request({method:"eth_call",params:O?[M,L,O]:[M,L]});return D==="0x"?{data:void 0}:{data:D}}catch(_){const L=Y_e(_),{offchainLookup:O,offchainLookupSignature:P}=await qs(async()=>{const{offchainLookup:R,offchainLookupSignature:M}=await import("./ccip-vR6lDjN0.js");return{offchainLookup:R,offchainLookupSignature:M}},[]);if(t.ccipRead!==!1&&(L==null?void 0:L.slice(0,10))===P&&b)return{data:await O(t,{data:L,to:b})};throw V&&(L==null?void 0:L.slice(0,10))==="0x101bb98d"?new e_e({factory:u}):IX(_,{...e,account:U,chain:t.chain})}}function H_e({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(O_e)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function G_e(t,e){var w;const{batchSize:r=1024,wait:n=0}=typeof((w=t.batch)==null?void 0:w.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:a="latest",data:s,multicallAddress:o,to:l}=e;let c=o;if(!c){if(!t.chain)throw new AX;c=jm({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?lr(i):void 0)||a,{schedule:h}=TX({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(C){return C.reduce((b,{data:A})=>b+(A.length-2),0)>r*2},fn:async C=>{const v=C.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),b=Tc({abi:mM,args:[v],functionName:"aggregate3"}),A=await t.request({method:"eth_call",params:[{data:b,to:c},f]});return x1({abi:mM,args:[v],functionName:"aggregate3",data:A||"0x"})}}),[{returnData:g,success:m}]=await h({data:s,to:l});if(!m)throw new R9({data:g});return g==="0x"?{data:void 0}:{data:g}}function q_e(t){const{code:e,data:r}=t;return W9({abi:$3(["constructor(bytes, bytes)"]),bytecode:F_e,args:[e,r]})}function V_e(t){const{data:e,factory:r,factoryData:n,to:i}=t;return W9({abi:$3(["constructor(address, bytes, address, bytes)"]),bytecode:U_e,args:[i,e,r,n]})}function Y_e(t){var r;if(!(t instanceof Qe))return;const e=t.walk();return typeof(e==null?void 0:e.data)=="object"?(r=e.data)==null?void 0:r.data:e.data}async function Wd(t,e){const{abi:r,address:n,args:i,functionName:a,...s}=e,o=Tc({abi:r,args:i,functionName:a});try{const{data:l}=await nr(t,H9,"call")({...s,data:o,to:n});return x1({abi:r,args:i,functionName:a,data:l||"0x"})}catch(l){throw e1(l,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:a})}}async function K_e(t,e){const{abi:r,address:n,args:i,dataSuffix:a,functionName:s,...o}=e,l=o.account?ms(o.account):t.account,c=Tc({abi:r,args:i,functionName:s});try{const{data:u}=await nr(t,H9,"call")({batch:!1,data:`${c}${a?a.replace("0x",""):""}`,to:n,...o,account:l}),f=x1({abi:r,args:i,functionName:s,data:u||"0x"}),h=r.filter(g=>"name"in g&&g.name===e.functionName);return{result:f,request:{abi:h,address:n,args:i,dataSuffix:a,functionName:s,...o,account:l}}}catch(u){throw e1(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:s,sender:l==null?void 0:l.address})}}const kC=new Map,TU=new Map;let J_e=0;function lh(t,e,r){const n=++J_e,i=()=>kC.get(t)||[],a=()=>{const u=i();kC.set(t,u.filter(f=>f.id!==n))},s=()=>{const u=i();if(!u.some(h=>h.id===n))return;const f=TU.get(t);u.length===1&&f&&f(),a()},o=i();if(kC.set(t,[...o,{id:n,fns:e}]),o&&o.length>0)return s;const l={};for(const u in e)l[u]=(...f)=>{var g,m;const h=i();if(h.length!==0)for(const w of h)(m=(g=w.fns)[u])==null||m.call(g,...f)};const c=r(l);return typeof c=="function"&&TU.set(t,c),s}async function wM(t){return new Promise(e=>setTimeout(e,t))}function W3(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const a=()=>i=!1;return(async()=>{let o;e&&(o=await t({unpoll:a}));const l=await(r==null?void 0:r(o))??n;await wM(l);const c=async()=>{i&&(await t({unpoll:a}),await wM(n),c())};c()})(),a}const Q_e=new Map,Z_e=new Map;function X_e(t){const e=(i,a)=>({clear:()=>a.delete(i),get:()=>a.get(i),set:s=>a.set(i,s)}),r=e(t,Q_e),n=e(t,Z_e);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function eCe(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=X_e(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function H3(t,{cacheTime:e=t.cacheTime}={}){const r=await eCe(()=>t.request({method:"eth_blockNumber"}),{cacheKey:tCe(t.uid),cacheTime:e});return BigInt(r)}async function G9(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(a=>zd(a));return!("abi"in e)||!e.abi?i:uL({abi:e.abi,logs:i,strict:r})}async function q9(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function rCe(t,e){const{abi:r,address:n,args:i,batch:a=!0,eventName:s,fromBlock:o,onError:l,onLogs:c,poll:u,pollingInterval:f=t.pollingInterval,strict:h}=e;return(typeof u<"u"?u:typeof o=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"))?(()=>{const C=h??!1,v=ia(["watchContractEvent",n,i,a,t.uid,s,f,C,o]);return lh(v,{onLogs:c,onError:l},b=>{let A;o!==void 0&&(A=o-1n);let S,j=!1;const U=W3(async()=>{var I;if(!j){try{S=await nr(t,ZZ,"createContractEventFilter")({abi:r,address:n,args:i,eventName:s,strict:C,fromBlock:o})}catch{}j=!0;return}try{let B;if(S)B=await nr(t,G9,"getFilterChanges")({filter:S});else{const V=await nr(t,H3,"getBlockNumber")({});A&&A{S&&await nr(t,q9,"uninstallFilter")({filter:S}),U()}})})():(()=>{const C=h??!1,v=ia(["watchContractEvent",n,i,a,t.uid,s,f,C]);let b=!0,A=()=>b=!1;return lh(v,{onLogs:c,onError:l},S=>((async()=>{try{const j=(()=>{if(t.transport.type==="fallback"){const B=t.transport.transports.find(V=>V.config.type==="webSocket");return B?B.value:t.transport}return t.transport})(),U=s?O3({abi:r,eventName:s,args:i}):[],{unsubscribe:I}=await j.subscribe({params:["logs",{address:n,topics:U}],onData(B){var se;if(!b)return;const V=B.result;try{const{eventName:Y,args:N}=cL({abi:r,data:V.data,topics:V.topics,strict:h}),k=zd(V,{args:N,eventName:Y});S.onLogs([k])}catch(Y){let N,k;if(Y instanceof Tw||Y instanceof k9){if(h)return;N=Y.abiItem.name,k=(se=Y.abiItem.inputs)==null?void 0:se.some(_=>!("name"in _&&_.name))}const x=zd(V,{args:k?[]:{},eventName:N});S.onLogs([x])}},onError(B){var V;(V=S.onError)==null||V.call(S,B)}});A=I,b||A()}catch(j){l==null||l(j)}})(),()=>A()))})()}class G3 extends Qe{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 Client."].join(` -`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class NC extends Qe{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function kX({chain:t,currentChainId:e}){if(!t)throw new W_e;if(e!==t.id)throw new z_e({chain:t,currentChainId:e})}function nCe(t,{docsPath:e,...r}){const n=(()=>{const i=D9(t,r);return i instanceof B3?t:i})();return new KEe(n,{docsPath:e,...r})}async function fL(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}const LC=new L9(128);async function hL(t,e){var v,b,A,S;const{account:r=t.account,chain:n=t.chain,accessList:i,authorizationList:a,blobs:s,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,value:m,...w}=e;if(typeof r>"u")throw new G3({docsPath:"/docs/actions/wallet/sendTransaction"});const C=r?ms(r):null;try{b1(e);const j=await(async()=>{if(e.to)return e.to;if(a&&a.length>0)return await cX({authorization:a[0]}).catch(()=>{throw new Qe("`to` is required. Could not infer from `authorizationList`.")})})();if((C==null?void 0:C.type)==="json-rpc"||C===null){let U;n!==null&&(U=await nr(t,z3,"getChainId")({}),kX({currentChainId:U,chain:n}));const I=(A=(b=(v=t.chain)==null?void 0:v.formatters)==null?void 0:b.transactionRequest)==null?void 0:A.format,V=(I||Lm)({...O9(w,{format:I}),accessList:i,authorizationList:a,blobs:s,chainId:U,data:o,from:C==null?void 0:C.address,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,to:j,value:m}),se=LC.get(t.uid),Y=se?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:Y,params:[V]},{retryCount:0})}catch(N){if(se===!1)throw N;const k=N;if(k.name==="InvalidInputRpcError"||k.name==="InvalidParamsRpcError"||k.name==="MethodNotFoundRpcError"||k.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[V]},{retryCount:0}).then(x=>(LC.set(t.uid,!0),x)).catch(x=>{const _=x;throw _.name==="MethodNotFoundRpcError"||_.name==="MethodNotSupportedRpcError"?(LC.set(t.uid,!1),k):_});throw k}}if((C==null?void 0:C.type)==="local"){const U=await nr(t,B9,"prepareTransactionRequest")({account:C,accessList:i,authorizationList:a,blobs:s,chain:n,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,nonceManager:C.nonceManager,parameters:[...xX,"sidecars"],value:m,...w,to:j}),I=(S=n==null?void 0:n.serializers)==null?void 0:S.transaction,B=await C.signTransaction(U,{serializer:I});return await nr(t,fL,"sendRawTransaction")({serializedTransaction:B})}throw(C==null?void 0:C.type)==="smart"?new NC({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new NC({docsPath:"/docs/actions/wallet/sendTransaction",type:C==null?void 0:C.type})}catch(j){throw j instanceof NC?j:nCe(j,{...e,account:C,chain:e.chain||void 0})}}async function iCe(t,e){const{abi:r,account:n=t.account,address:i,args:a,dataSuffix:s,functionName:o,...l}=e;if(typeof n>"u")throw new G3({docsPath:"/docs/contract/writeContract"});const c=n?ms(n):null,u=Tc({abi:r,args:a,functionName:o});try{return await nr(t,hL,"sendTransaction")({data:`${u}${s?s.replace("0x",""):""}`,to:i,account:c,...l})}catch(f){throw e1(f,{abi:r,address:i,args:a,docsPath:"/docs/contract/writeContract",functionName:o,sender:c==null?void 0:c.address})}}class aCe extends Qe{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function sCe(t,e){const{address:r,factory:n,factoryData:i}=e;try{const[a,s,o,l,c,u,f]=await nr(t,Wd,"readContract")({abi:oCe,address:r,functionName:"eip712Domain",factory:n,factoryData:i});return{domain:{name:s,version:o,chainId:Number(l),verifyingContract:c,salt:u},extensions:f,fields:a}}catch(a){const s=a;throw s.name==="ContractFunctionExecutionError"&&s.cause.name==="ContractFunctionZeroDataError"?new aCe({address:r}):s}}const oCe=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];async function lCe(t,{chain:e}){const{id:r,name:n,nativeCurrency:i,rpcUrls:a,blockExplorers:s}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:lr(r),chainName:n,nativeCurrency:i,rpcUrls:a.default.http,blockExplorerUrls:s?Object.values(s).map(({url:o})=>o):void 0}]},{dedupe:!0,retryCount:0})}const vM=256;let v4=vM,b4;function NX(t=11){if(!b4||v4+t>vM*2){b4="",v4=0;for(let e=0;e{const b=v(C);for(const S in m)delete b[S];const A={...C,...b};return Object.assign(A,{extend:w(A)})}}return Object.assign(m,{extend:w(m)})}const x4=new L9(8192);function cCe(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(x4.get(r))return x4.get(r);const n=t().finally(()=>x4.delete(r));return x4.set(r,n),n}function bM(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,a)=>{const s=async({count:o=0}={})=>{const l=async({error:c})=>{const u=typeof e=="function"?e({count:o,error:c}):e;u&&await wM(u),s({count:o+1})};try{const c=await t();i(c)}catch(c){if(o{const{dedupe:i=!1,retryDelay:a=150,retryCount:s=3,uid:o}={...e,...n},l=i?ea(Dg(`${o}.${ia(r)}`)):void 0;return cCe(()=>bM(async()=>{try{return await t(r)}catch(c){const u=c;switch(u.code){case Nw.code:throw new Nw(u);case Lw.code:throw new Lw(u);case jw.code:throw new jw(u,{method:r.method});case $w.code:throw new $w(u);case Z0.code:throw new Z0(u);case X0.code:throw new X0(u);case Pw.code:throw new Pw(u);case Rw.code:throw new Rw(u);case Dw.code:throw new Dw(u);case Ow.code:throw new Ow(u,{method:r.method});case Og.code:throw new Og(u);case Fw.code:throw new Fw(u);case gg.code:throw new gg(u);case Uw.code:throw new Uw(u);case Bw.code:throw new Bw(u);case zw.code:throw new zw(u);case Ww.code:throw new Ww(u);case Hw.code:throw new Hw(u);case 5e3:throw new gg(u);default:throw c instanceof Qe?c:new r_e(u)}}},{delay:({count:c,error:u})=>{var f;if(u&&u instanceof Oy){const h=(f=u==null?void 0:u.headers)==null?void 0:f.get("Retry-After");if(h!=null&&h.match(/\d/))return Number.parseInt(h)*1e3}return~~(1<dCe(c)}),{enabled:i,id:l})}}function dCe(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===Og.code||t.code===Z0.code:t instanceof Oy&&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 jX({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:a,type:s},o){const l=NX();return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:a,type:s},request:uCe(r,{retryCount:n,retryDelay:i,uid:l}),value:o}}function $X(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:a})=>jX({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??a,retryDelay:i,type:"custom"})}class fCe extends Qe{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function hCe(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,a)=>{(async()=>{let s;try{const o=new AbortController;r>0&&(s=setTimeout(()=>{n?o.abort():a(e)},r)),i(await t({signal:(o==null?void 0:o.signal)||null}))}catch(o){(o==null?void 0:o.name)==="AbortError"&&a(e),a(o)}finally{clearTimeout(s)}})()})}function pCe(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const kU=pCe();function gCe(t,e={}){return{async request(r){var f;const{body:n,onRequest:i=e.onRequest,onResponse:a=e.onResponse,timeout:s=e.timeout??1e4}=r,o={...e.fetchOptions??{},...r.fetchOptions??{}},{headers:l,method:c,signal:u}=o;try{const h=await hCe(async({signal:m})=>{const w={...o,body:Array.isArray(n)?ia(n.map(A=>({jsonrpc:"2.0",id:A.id??kU.take(),...A}))):ia({jsonrpc:"2.0",id:n.id??kU.take(),...n}),headers:{"Content-Type":"application/json",...l},method:c||"POST",signal:u||(s>0?m:null)},C=new Request(t,w),v=await(i==null?void 0:i(C,w))??{...w,url:t};return await fetch(v.url??t,v)},{errorInstance:new bU({body:n,url:t}),timeout:s,signal:!0});a&&await a(h);let g;if((f=h.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))g=await h.json();else{g=await h.text();try{g=JSON.parse(g||"{}")}catch(m){if(h.ok)throw m;g={error:g}}}if(!h.ok)throw new Oy({body:n,details:ia(g.error)||h.statusText,headers:h.headers,status:h.status,url:t});return g}catch(h){throw h instanceof Oy||h instanceof bU?h:new Oy({body:n,cause:h,url:t})}}}}function xc(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:a="HTTP JSON-RPC",onFetchRequest:s,onFetchResponse:o,retryDelay:l}=e;return({chain:c,retryCount:u,timeout:f})=>{const{batchSize:h=1e3,wait:g=0}=typeof r=="object"?r:{},m=e.retryCount??u,w=f??e.timeout??1e4,C=t||(c==null?void 0:c.rpcUrls.default.http[0]);if(!C)throw new fCe;const v=gCe(C,{fetchOptions:n,onRequest:s,onResponse:o,timeout:w});return jX({key:i,name:a,async request({method:b,params:A}){const S={method:b,params:A},{schedule:j}=TX({id:C,wait:g,shouldSplitBatch(V){return V.length>h},fn:V=>v.request({body:V}),sort:(V,se)=>V.id-se.id}),U=async V=>r?j(V):[await v.request({body:V})],[{error:I,result:B}]=await U(S);if(I)throw new ZN({body:S,error:I,url:C});return B},retryCount:m,retryDelay:l,timeout:w,type:"http"},{fetchOptions:n,url:C})}}function pL(t,e){var n,i,a,s,o,l;if(!(t instanceof Qe))return!1;const r=t.walk(c=>c instanceof sM);return r instanceof sM?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((a=r.data)==null?void 0:a.errorName)==="ResolverNotContract"||((s=r.data)==null?void 0:s.errorName)==="ResolverError"||((o=r.data)==null?void 0:o.errorName)==="HttpError"||(l=r.reason)!=null&&l.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===XZ[50]):!1}function PX(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return vc(e)?e:null}function I6(t){let e=new Uint8Array(32).fill(0);if(!t)return Si(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=PX(r[n]),a=i?Mm(i):ea(k0(r[n]),"bytes");e=ea(Bd([e,a]),"bytes")}return Si(e)}function mCe(t){return`[${t.slice(2)}]`}function yCe(t){const e=new Uint8Array(32).fill(0);return t?PX(t)||ea(k0(t)):Si(e)}function V9(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(k0(e).byteLength+2);let n=0;const i=e.split(".");for(let a=0;a255&&(s=k0(mCe(yCe(i[a])))),r[n]=s.length,r.set(s,n+1),n+=s.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function wCe(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:a,strict:s,universalResolverAddress:o}){let l=o;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=jm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c=Tc({abi:IU,functionName:"addr",...n!=null?{args:[I6(i),BigInt(n)]}:{args:[I6(i)]}}),u={address:l,abi:SX,functionName:"resolve",args:[ur(V9(i)),c],blockNumber:e,blockTag:r},f=nr(t,Wd,"readContract"),h=a?await f({...u,args:[...u.args,a]}):await f(u);if(h[0]==="0x")return null;const g=x1({abi:IU,args:n!=null?[I6(i),BigInt(n)]:void 0,functionName:"addr",data:h[0]});return g==="0x"||hc(g)==="0x00"?null:g}catch(c){if(s)throw c;if(pL(c,"resolve"))return null;throw c}}class vCe extends Qe{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)}`],name:"EnsAvatarInvalidMetadataError"})}}class U2 extends Qe{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class gL extends Qe{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.`,{name:"EnsAvatarUriResolutionError"})}}class bCe extends Qe{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const xCe=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,ECe=/^(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\-.]+))?(?\/.*)?$/,_Ce=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,CCe=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function SCe(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 NU(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function RX({uri:t,gatewayUrls:e}){const r=_Ce.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=NU(e==null?void 0:e.ipfs,"https://ipfs.io"),i=NU(e==null?void 0:e.arweave,"https://arweave.net"),a=t.match(xCe),{protocol:s,subpath:o,target:l,subtarget:c=""}=(a==null?void 0:a.groups)||{},u=s==="ipns:/"||o==="ipns/",f=s==="ipfs:/"||o==="ipfs/"||ECe.test(t);if(t.startsWith("http")&&!u&&!f){let g=t;return e!=null&&e.arweave&&(g=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:g,isOnChain:!1,isEncoded:!1}}if((u||f)&&l)return{uri:`${n}/${u?"ipns":"ipfs"}/${l}${c}`,isOnChain:!1,isEncoded:!1};if(s==="ar:/"&&l)return{uri:`${i}/${l}${c||""}`,isOnChain:!1,isEncoded:!1};let h=t.replace(CCe,"");if(h.startsWith("i.json());return await mL({gatewayUrls:t,uri:DX(r)})}catch{throw new gL({uri:e})}}async function mL({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=RX({uri:e,gatewayUrls:t});if(n||await SCe(r))return r;throw new gL({uri:e})}function ICe(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[a,s]=r.split(":"),[o,l]=n.split(":");if(!a||a.toLowerCase()!=="eip155")throw new U2({reason:"Only EIP-155 supported"});if(!s)throw new U2({reason:"Chain ID not found"});if(!l)throw new U2({reason:"Contract address not found"});if(!i)throw new U2({reason:"Token ID not found"});if(!o)throw new U2({reason:"ERC namespace not found"});return{chainID:Number.parseInt(s),namespace:o.toLowerCase(),contractAddress:l,tokenID:i}}async function MCe(t,{nft:e}){if(e.namespace==="erc721")return Wd(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 Wd(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 bCe({namespace:e.namespace})}async function TCe(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?kCe(t,{gatewayUrls:e,record:r}):mL({uri:r,gatewayUrls:e})}async function kCe(t,{gatewayUrls:e,record:r}){const n=ICe(r),i=await MCe(t,{nft:n}),{uri:a,isOnChain:s,isEncoded:o}=RX({uri:i,gatewayUrls:e});if(s&&(a.includes("data:application/json;base64,")||a.startsWith("{"))){const c=o?atob(a.replace("data:application/json;base64,","")):a,u=JSON.parse(c);return mL({uri:DX(u),gatewayUrls:e})}let l=n.tokenID;return n.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),ACe({gatewayUrls:e,uri:a.replace(/(?:0x)?{id}/,l)})}async function OX(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:a,strict:s,universalResolverAddress:o}){let l=o;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=jm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c={address:l,abi:SX,functionName:"resolve",args:[ur(V9(n)),Tc({abi:AU,functionName:"text",args:[I6(n),i]})],blockNumber:e,blockTag:r},u=nr(t,Wd,"readContract"),f=a?await u({...c,args:[...c.args,a]}):await u(c);if(f[0]==="0x")return null;const h=x1({abi:AU,functionName:"text",data:f[0]});return h===""?null:h}catch(c){if(s)throw c;if(pL(c,"resolve"))return null;throw c}}async function NCe(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:a,strict:s,universalResolverAddress:o}){const l=await nr(t,OX,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:o,gatewayUrls:a,strict:s});if(!l)return null;try{return await TCe(t,{record:l,gatewayUrls:n})}catch{return null}}async function LCe(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:a,universalResolverAddress:s}){let o=s;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=jm({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const l=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const c={address:o,abi:D_e,functionName:"reverse",args:[ur(V9(l))],blockNumber:r,blockTag:n},u=nr(t,Wd,"readContract"),[f,h]=i?await u({...c,args:[...c.args,i]}):await u(c);return e.toLowerCase()!==h.toLowerCase()?null:f}catch(c){if(a)throw c;if(pL(c,"reverse"))return null;throw c}}async function jCe(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let a=i;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=jm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[s]=await nr(t,Wd,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ur(V9(n))],blockNumber:e,blockTag:r});return s}async function $Ce(t,e){var C,v,b;const{account:r=t.account,blockNumber:n,blockTag:i="latest",blobs:a,data:s,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:f,to:h,value:g,...m}=e,w=r?ms(r):void 0;try{b1(e);const S=(n?lr(n):void 0)||i,j=(b=(v=(C=t.chain)==null?void 0:C.formatters)==null?void 0:v.transactionRequest)==null?void 0:b.format,I=(j||Lm)({...O9(m,{format:j}),from:w==null?void 0:w.address,blobs:a,data:s,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:f,to:h,value:g}),B=await t.request({method:"eth_createAccessList",params:[I,S]});return{accessList:B.accessList,gasUsed:BigInt(B.gasUsed)}}catch(A){throw IX(A,{...e,account:w,chain:t.chain})}}async function PCe(t){const e=$9(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}async function FX(t,{address:e,args:r,event:n,events:i,fromBlock:a,strict:s,toBlock:o}={}){const l=i??(n?[n]:void 0),c=$9(t,{method:"eth_newFilter"});let u=[];l&&(u=[l.flatMap(g=>O3({abi:[g],eventName:g.name,args:r}))],n&&(u=u[0]));const f=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof a=="bigint"?lr(a):a,toBlock:typeof o=="bigint"?lr(o):o,...u.length?{topics:u}:{}}]});return{abi:l,args:r,eventName:n?n.name:void 0,fromBlock:a,id:f,request:c(f),strict:!!s,toBlock:o,type:"event"}}async function UX(t){const e=$9(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function RCe(t){const e=await t.request({method:"eth_blobBaseFee"});return BigInt(e)}async function DCe(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?lr(r):void 0;let a;return e?a=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):a=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]},{dedupe:!!i}),Mu(a)}async function LU(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?lr(r):void 0,a=await t.request({method:"eth_getCode",params:[e,i||n]},{dedupe:!!i});if(a!=="0x")return a}function OCe(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 FCe(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const a=r?lr(r):void 0,s=await t.request({method:"eth_feeHistory",params:[lr(e),a||n,i]},{dedupe:!!a});return OCe(s)}async function UCe(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(a=>zd(a));return e.abi?uL({abi:e.abi,logs:i,strict:r}):i}function BCe(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}class zCe extends Qe{constructor({domain:e}){super(`Invalid domain "${ia(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class WCe extends Qe{constructor({primaryType:e,types:r}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class HCe extends Qe{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function GCe(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:qX({domain:e}),...t.types};GX({domain:e,message:r,primaryType:n,types:i});const a=["0x1901"];return e&&a.push(qCe({domain:e,types:i})),n!=="EIP712Domain"&&a.push(BX({data:r,primaryType:n,types:i})),ea(Bd(a))}function qCe({domain:t,types:e}){return BX({data:t,primaryType:"EIP712Domain",types:e})}function BX({data:t,primaryType:e,types:r}){const n=zX({data:t,primaryType:e,types:r});return ea(n)}function zX({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[VCe({primaryType:e,types:r})];for(const a of r[e]){const[s,o]=HX({types:r,name:a.name,type:a.type,value:t[a.name]});n.push(s),i.push(o)}return Tm(n,i)}function VCe({primaryType:t,types:e}){const r=ur(YCe({primaryType:t,types:e}));return ea(r)}function YCe({primaryType:t,types:e}){let r="";const n=WX({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const a of i)r+=`${a}(${e[a].map(({name:s,type:o})=>`${o} ${s}`).join(",")})`;return r}function WX({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 a of e[i])WX({primaryType:a.type,types:e},r);return r}function HX({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},ea(zX({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},ea(n)];if(r==="string")return[{type:"bytes32"},ea(ur(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),a=n.map(s=>HX({name:e,type:i,types:t,value:s}));return[{type:"bytes32"},ea(Tm(a.map(([s])=>s),a.map(([,s])=>s)))]}return[{type:r},n]}function KCe(t){const{domain:e,message:r,primaryType:n,types:i}=t,a=(l,c)=>{const u={...c};for(const f of l){const{name:h,type:g}=f;g==="address"&&(u[h]=u[h].toLowerCase())}return u},s=i.EIP712Domain?e?a(i.EIP712Domain,e):{}:{},o=(()=>{if(n!=="EIP712Domain")return a(i[n],r)})();return ia({domain:s,message:o,primaryType:n,types:i})}function GX(t){const{domain:e,message:r,primaryType:n,types:i}=t,a=(s,o)=>{for(const l of s){const{name:c,type:u}=l,f=o[c],h=u.match(JZ);if(h&&(typeof f=="number"||typeof f=="bigint")){const[w,C,v]=h;lr(f,{signed:C==="int",size:Number.parseInt(v)/8})}if(u==="address"&&typeof f=="string"&&!Tn(f))throw new fs({address:f});const g=u.match(mEe);if(g){const[w,C]=g;if(C&&ai(f)!==Number.parseInt(C))throw new I7e({expectedSize:Number.parseInt(C),givenSize:ai(f)})}const m=i[u];m&&(JCe(u),a(m,f))}};if(i.EIP712Domain&&e){if(typeof e!="object")throw new zCe({domain:e});a(i.EIP712Domain,e)}if(n!=="EIP712Domain")if(i[n])a(i[n],r);else throw new WCe({primaryType:n,types:i})}function qX({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)}function JCe(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new HCe({type:t})}function QCe(t){const{abi:e,data:r}=t,n=Q0(r,0,4),i=e.find(a=>a.type==="function"&&n===j9(Iu(a)));if(!i)throw new S7e(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:i.name,args:"inputs"in i&&i.inputs&&i.inputs.length>0?km(i.inputs,Q0(r,4)):void 0}}const ZCe={"0x0":"reverted","0x1":"success"};function VX(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=>zd(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Mu(t.transactionIndex):null,status:t.status?ZCe[t.status]:null,type:t.type?dX[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}const XCe=XN("transactionReceipt",VX),eSe=`Ethereum Signed Message: -`;function tSe(t){const e=typeof t=="string"?Dg(t):typeof t.raw=="string"?t.raw:Si(t.raw),r=Dg(`${eSe}${ai(e)}`);return Bd([r,e])}function YX(t,e){return ea(tSe(t),e)}const KX="0x6492649264926492649264926492649264926492649264926492649264926492";function rSe(t){return KZ(t,-32)===KX}function nSe(t){const{address:e,data:r,signature:n,to:i="hex"}=t,a=ju([Tm([{type:"address"},{type:"bytes"},{type:"bytes"}],[e,r,n]),KX]);return i==="hex"?a:bc(a)}function iSe(t){const{authorizationList:e}=t;if(e)for(const r of e){const{contractAddress:n,chainId:i}=r;if(!Tn(n))throw new fs({address:n});if(i<0)throw new z9({chainId:i})}yL(t)}function aSe(t){const{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new wX;for(const r of e){const n=ai(r),i=Mu(Q0(r,0,1));if(n!==32)throw new N_e({hash:r,size:n});if(i!==yX)throw new L_e({hash:r,version:i})}}yL(t)}function yL(t){const{chainId:e,maxPriorityFeePerGas:r,maxFeePerGas:n,to:i}=t;if(e<=0)throw new z9({chainId:e});if(i&&!Tn(i))throw new fs({address:i});if(n&&n>F9)throw new t1({maxFeePerGas:n});if(r&&n&&r>n)throw new Gw({maxFeePerGas:n,maxPriorityFeePerGas:r})}function sSe(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:a}=t;if(e<=0)throw new z9({chainId:e});if(a&&!Tn(a))throw new fs({address:a});if(r||i)throw new Qe("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>F9)throw new t1({maxFeePerGas:n})}function oSe(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:a}=t;if(a&&!Tn(a))throw new fs({address:a});if(typeof e<"u"&&e<=0)throw new z9({chainId:e});if(r||i)throw new Qe("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>F9)throw new t1({maxFeePerGas:n})}function lSe(t){if(!t||t.length===0)return[];const e=[];for(const r of t){const{contractAddress:n,chainId:i,nonce:a,...s}=r;e.push([i?ur(i):"0x",n,a?ur(a):"0x",...q3({},s)])}return e}function Y9(t){if(!t||t.length===0)return[];const e=[];for(let r=0;r"u"||typeof g>"u")){const A=typeof t.blobs[0]=="string"?t.blobs:t.blobs.map(U=>Si(U)),S=t.kzg,j=iL({blobs:A,kzg:S});if(typeof h>"u"&&(h=pX({commitments:j})),typeof g>"u"){const U=aL({blobs:A,commitments:j,kzg:S});g=vX({blobs:A,commitments:j,proofs:U})}}const m=Y9(u),w=[ur(r),i?ur(i):"0x",c?ur(c):"0x",l?ur(l):"0x",n?ur(n):"0x",a??"0x",s?ur(s):"0x",f??"0x",m,o?ur(o):"0x",h??[],...q3(t,e)],C=[],v=[],b=[];if(g)for(let A=0;A{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+e.v-27n);const g=27n+(e.v===27n?0n:1n);if(e.v!==g)throw new qEe({v:e.v});return g})(),f=hc(e.r),h=hc(e.s);c=[...c,ur(u),f==="0x00"?"0x":f,h==="0x00"?"0x":h]}else r>0&&(c=[...c,ur(r),"0x","0x"]);return oh(c)}function q3(t,e){const r=e??t,{v:n,yParity:i}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof i>"u")return[];const a=hc(r.r),s=hc(r.s);return[typeof i=="number"?i?ur(1):"0x":n===0n?"0x":n===1n?ur(1):n===27n?"0x":ur(1),a==="0x00"?"0x":a,s==="0x00"?"0x":s]}class gSe extends Qe{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function mSe(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new gSe({value:t});let[r,n="0"]=t.split(".");const i=r.startsWith("-");if(i&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>e){const[a,s,o]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],l=Math.round(+`${s}.${o}`);l>9?n=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):n=`${a}${l}`,n.length>e&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${i?"-":""}${r}${n}`)}function JX(t,e="wei"){return mSe(t,rX[e])}function ySe(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function wSe(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?Mu(t.nonce):void 0,storageProof:t.storageProof?ySe(t.storageProof):void 0}}async function vSe(t,{address:e,blockNumber:r,blockTag:n,storageKeys:i}){const a=n??"latest",s=r!==void 0?lr(r):void 0,o=await t.request({method:"eth_getProof",params:[e,i,s||a]});return wSe(o)}async function bSe(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const a=r!==void 0?lr(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,a||n]})}async function wL(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:a}){var u,f,h;const s=n||"latest",o=r!==void 0?lr(r):void 0;let l=null;if(i?l=await t.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):e?l=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,lr(a)]},{dedupe:!0}):(o||s)&&(l=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||s,lr(a)]},{dedupe:!!o})),!l)throw new nX({blockHash:e,blockNumber:r,blockTag:s,hash:i,index:a});return(((h=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.transaction)==null?void 0:h.format)||U9)(l)}async function xSe(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([nr(t,H3,"getBlockNumber")({}),e?nr(t,wL,"getTransaction")({hash:e}):void 0]),a=(r==null?void 0:r.blockNumber)||(i==null?void 0:i.blockNumber);return a?n-a+1n:0n}async function xM(t,{hash:e}){var i,a,s;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new iX({hash:e});return(((s=(a=(i=t.chain)==null?void 0:i.formatters)==null?void 0:a.transactionReceipt)==null?void 0:s.format)||VX)(r)}async function ESe(t,e){var C;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:a,multicallAddress:s,stateOverride:o}=e,l=e.contracts,c=n??(typeof((C=t.batch)==null?void 0:C.multicall)=="object"&&t.batch.multicall.batchSize||1024);let u=s;if(!u){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");u=jm({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=[[]];let h=0,g=0;for(let v=0;v0&&g>c&&f[h].length>0&&(h++,g=(U.length-2)/2,f[h]=[]),f[h]=[...f[h],{allowFailure:!0,callData:U,target:A}]}catch(U){const I=e1(U,{abi:b,address:A,args:S,docsPath:"/docs/contract/multicall",functionName:j});if(!r)throw I;f[h]=[...f[h],{allowFailure:!0,callData:"0x",target:A}]}}const m=await Promise.allSettled(f.map(v=>nr(t,Wd,"readContract")({abi:mM,address:u,args:[v],blockNumber:i,blockTag:a,functionName:"aggregate3",stateOverride:o}))),w=[];for(let v=0;ve.toString(16).padStart(2,"0"));function Ug(t){V3(t);let e="";for(let r=0;r=Xu._0&&t<=Xu._9)return t-Xu._0;if(t>=Xu.A&&t<=Xu.F)return t-(Xu.A-10);if(t>=Xu.a&&t<=Xu.f)return t-(Xu.a-10)}function Bg(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let i=0,a=0;itypeof t=="bigint"&&K9<=t;function Q9(t,e,r){return jC(t)&&jC(e)&&jC(r)&&e<=t&&tK9;t>>=J9,e+=1);return e}function MSe(t,e){return t>>BigInt(e)&J9}function TSe(t,e,r){return t|(r?J9:K9)<(_Se<new Uint8Array(t),$U=t=>Uint8Array.from(t);function ZX(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=$C(t),i=$C(t),a=0;const s=()=>{n.fill(1),i.fill(0),a=0},o=(...f)=>r(i,n,...f),l=(f=$C())=>{i=o($U([0]),f),n=o(),f.length!==0&&(i=o($U([1]),f),n=o())},c=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{s(),l(f);let g;for(;!(g=h(c()));)l();return s(),g}}const kSe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||r1(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Y3(t,e,r={}){const n=(i,a,s)=>{const o=kSe[a];if(typeof o!="function")throw new Error("invalid validator function");const l=t[i];if(!(s&&l===void 0)&&!o(l,t))throw new Error("param "+String(i)+" is invalid. Expected "+a+", got "+l)};for(const[i,a]of Object.entries(e))n(i,a,!1);for(const[i,a]of Object.entries(r))n(i,a,!0);return t}const NSe=()=>{throw new Error("not implemented")};function EM(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const a=t(r,...n);return e.set(r,a),a}}const LSe=Object.freeze(Object.defineProperty({__proto__:null,aInRange:L0,abool:Fg,abytes:V3,bitGet:MSe,bitLen:QX,bitMask:EL,bitSet:TSe,bytesToHex:Ug,bytesToNumberBE:N0,bytesToNumberLE:bL,concatBytes:qw,createHmacDrbg:ZX,ensureBytes:Ql,equalBytes:ASe,hexToBytes:Bg,hexToNumber:vL,inRange:Q9,isBytes:r1,memoized:EM,notImplemented:NSe,numberToBytesBE:zg,numberToBytesLE:xL,numberToHexUnpadded:Zp,numberToVarBytesBE:SSe,utf8ToBytes:ISe,validateObject:Y3},Symbol.toStringTag,{value:"Module"})),jSe="0.1.1";function $Se(){return jSe}class Vw extends Error{constructor(e,r={}){const n=(()=>{var l;if(r.cause instanceof Vw){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return(l=r.cause)!=null&&l.message?r.cause.message:r.details})(),i=r.cause instanceof Vw&&r.cause.docsPath||r.docsPath,s=`https://oxlib.sh${i??""}`,o=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||i?["",n?`Details: ${n}`:void 0,i?`See: ${s}`:void 0]:[]].filter(l=>typeof l=="string").join(` -`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{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,"shortMessage",{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,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${$Se()}`}),this.cause=r.cause,this.details=n,this.docs=s,this.docsPath=i,this.shortMessage=e}walk(e){return XX(this,e)}}function XX(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?XX(t.cause,e):e?null:t}function PSe(t,e={}){const{dir:r,size:n=32}=e;if(n===0)return t;const i=t.replace("0x","");if(i.length>n*2)throw new OSe({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i[r==="right"?"padEnd":"padStart"](n*2,"0")}`}function yd(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let a;n?r?a=(1n<a||i{const v=C,b=v.account?ms(v.account):void 0,A={...v,data:v.abi?Tc(v):v.data,from:v.from??(b==null?void 0:b.address)};return b1(A),Lm(A)}),w=h.stateOverrides?eL(h.stateOverrides):void 0;l.push({blockOverrides:g,calls:m,stateOverrides:w})}const u=(r?lr(r):void 0)||n;return(await t.request({method:"eth_simulateV1",params:[{blockStateCalls:l,returnFullTransactions:a,traceTransfers:s,validation:o},u]})).map((h,g)=>({...rL(h),calls:h.calls.map((m,w)=>{var se,Y;const{abi:C,args:v,functionName:b,to:A}=i[g].calls[w],S=((se=m.error)==null?void 0:se.data)??m.returnData,j=BigInt(m.gasUsed),U=(Y=m.logs)==null?void 0:Y.map(N=>zd(N)),I=m.status==="0x1"?"success":"failure",B=C?x1({abi:C,data:S,functionName:b}):null,V=(()=>{var k;if(I==="success")return;let N;if(((k=m.error)==null?void 0:k.data)==="0x"?N=new P3:m.error&&(N=new R9(m.error)),!!N)return e1(N,{abi:C??[],address:A,args:v,functionName:b??""})})();return{data:S,gasUsed:j,logs:U,status:I,...I==="success"?{result:B}:{error:V}}})}))}catch(l){const c=l,u=D9(c,{});throw u instanceof B3?c:u}}function PU(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function zSe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Z9(t,...e){if(!zSe(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function WSe(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");PU(t.outputLen),PU(t.blockLen)}function H5(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 HSe(t,e){Z9(t);const r=e.outputLen;if(t.lengthnew DataView(t.buffer,t.byteOffset,t.byteLength),Uc=(t,e)=>t<<32-e|t>>>e;function GSe(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function _L(t){return typeof t=="string"&&(t=GSe(t)),Z9(t),t}function qSe(...t){let e=0;for(let n=0;nt().update(_L(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function YSe(t=32){if(pp&&typeof pp.getRandomValues=="function")return pp.getRandomValues(new Uint8Array(t));if(pp&&typeof pp.randomBytes=="function")return pp.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function KSe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),a=BigInt(4294967295),s=Number(r>>i&a),o=Number(r&a),l=n?4:0,c=n?0:4;t.setUint32(e+l,s,n),t.setUint32(e+c,o,n)}const JSe=(t,e,r)=>t&e^~t&r,QSe=(t,e,r)=>t&e^t&r^e&r;class ZSe extends eee{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=PC(this.buffer)}update(e){H5(this);const{view:r,buffer:n,blockLen:i}=this;e=_L(e);const a=e.length;for(let s=0;si-s&&(this.process(n,0),s=0);for(let f=s;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,w=Uc(g,17)^Uc(g,19)^g>>>10;_f[f]=w+_f[f-7]+m+_f[f-16]|0}let{A:n,B:i,C:a,D:s,E:o,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=Uc(o,6)^Uc(o,11)^Uc(o,25),g=u+h+JSe(o,l,c)+XSe[f]+_f[f]|0,w=(Uc(n,2)^Uc(n,13)^Uc(n,22))+QSe(n,i,a)|0;u=c,c=l,l=o,o=s+g|0,s=a,a=i,i=n,n=g+w|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,s=s+this.D|0,o=o+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,i,a,s,o,l,c,u)}roundClean(){_f.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const tAe=VSe(()=>new eAe);let tee=class extends eee{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,WSe(e);const n=_L(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(n.length>i?e.create().update(n).digest():n);for(let s=0;snew tee(t,e).update(r).digest();ree.create=(t,e)=>new tee(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ta=BigInt(0),mi=BigInt(1),f0=BigInt(2),rAe=BigInt(3),_M=BigInt(4),RU=BigInt(5),DU=BigInt(8);function $s(t,e){const r=t%e;return r>=ta?r:e+r}function nAe(t,e,r){if(eta;)e&mi&&(n=n*t%r),t=t*t%r,e>>=mi;return n}function Zo(t,e,r){let n=t;for(;e-- >ta;)n*=n,n%=r;return n}function CM(t,e){if(t===ta)throw new Error("invert: expected non-zero number");if(e<=ta)throw new Error("invert: expected positive modulus, got "+e);let r=$s(t,e),n=e,i=ta,a=mi;for(;r!==ta;){const o=n/r,l=n%r,c=i-a*o;n=r,r=l,i=a,a=c}if(n!==mi)throw new Error("invert: does not exist");return $s(i,e)}function iAe(t){const e=(t-mi)/f0;let r,n,i;for(r=t-mi,n=0;r%f0===ta;r/=f0,n++);for(i=f0;i1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const s=(t+mi)/_M;return function(l,c){const u=l.pow(c,s);if(!l.eql(l.sqr(u),c))throw new Error("Cannot find square root");return u}}const a=(r+mi)/f0;return function(o,l){if(o.pow(l,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=n,u=o.pow(o.mul(o.ONE,i),r),f=o.pow(l,a),h=o.pow(l,r);for(;!o.eql(h,o.ONE);){if(o.eql(h,o.ZERO))return o.ZERO;let g=1;for(let w=o.sqr(h);g(n[i]="function",n),e);return Y3(t,r)}function lAe(t,e,r){if(rta;)r&mi&&(n=t.mul(n,i)),i=t.sqr(i),r>>=mi;return n}function cAe(t,e){const r=new Array(e.length),n=e.reduce((a,s,o)=>t.is0(s)?a:(r[o]=a,t.mul(a,s)),t.ONE),i=t.inv(n);return e.reduceRight((a,s,o)=>t.is0(s)?a:(r[o]=t.mul(a,r[o]),t.mul(a,s)),i),r}function nee(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function iee(t,e,r=!1,n={}){if(t<=ta)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:a}=nee(t,e);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const o=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:EL(i),ZERO:ta,ONE:mi,create:l=>$s(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return ta<=l&&ll===ta,isOdd:l=>(l&mi)===mi,neg:l=>$s(-l,t),eql:(l,c)=>l===c,sqr:l=>$s(l*l,t),add:(l,c)=>$s(l+c,t),sub:(l,c)=>$s(l-c,t),mul:(l,c)=>$s(l*c,t),pow:(l,c)=>lAe(o,l,c),div:(l,c)=>$s(l*CM(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>CM(l,t),sqrt:n.sqrt||(l=>(s||(s=aAe(t)),s(o,l))),invertBatch:l=>cAe(o,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>r?xL(l,a):zg(l,a),fromBytes:l=>{if(l.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+l.length);return r?bL(l):N0(l)}});return Object.freeze(o)}function aee(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function see(t){const e=aee(t);return e+Math.ceil(e/2)}function uAe(t,e,r=!1){const n=t.length,i=aee(e),a=see(e);if(n<16||n1024)throw new Error("expected "+a+"-1024 bytes of input, got "+n);const s=r?N0(t):bL(t),o=$s(s,e-mi)+mi;return r?xL(o,i):zg(o,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const OU=BigInt(0),E4=BigInt(1);function RC(t,e){const r=e.negate();return t?r:e}function oee(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function DC(t,e){oee(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1);return{windows:r,windowSize:n}}function dAe(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function fAe(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}const OC=new WeakMap,lee=new WeakMap;function FC(t){return lee.get(t)||1}function hAe(t,e){return{constTimeNegate:RC,hasPrecomputes(r){return FC(r)!==1},unsafeLadder(r,n,i=t.ZERO){let a=r;for(;n>OU;)n&E4&&(i=i.add(a)),a=a.double(),n>>=E4;return i},precomputeWindow(r,n){const{windows:i,windowSize:a}=DC(n,e),s=[];let o=r,l=o;for(let c=0;c>=f,m>s&&(m-=u,i+=E4);const w=g,C=g+Math.abs(m)-1,v=h%2!==0,b=m<0;m===0?l=l.add(RC(v,n[w])):o=o.add(RC(b,n[C]))}return{p:o,f:l}},wNAFUnsafe(r,n,i,a=t.ZERO){const{windows:s,windowSize:o}=DC(r,e),l=BigInt(2**r-1),c=2**r,u=BigInt(r);for(let f=0;f>=u,g>o&&(g-=c,i+=E4),g===0)continue;let m=n[h+Math.abs(g)-1];g<0&&(m=m.negate()),a=a.add(m)}return a},getPrecomputes(r,n,i){let a=OC.get(n);return a||(a=this.precomputeWindow(n,r),r!==1&&OC.set(n,i(a))),a},wNAFCached(r,n,i){const a=FC(r);return this.wNAF(a,this.getPrecomputes(a,r,i),n)},wNAFCachedUnsafe(r,n,i,a){const s=FC(r);return s===1?this.unsafeLadder(r,n,a):this.wNAFUnsafe(s,this.getPrecomputes(s,r,i),n,a)},setWindowSize(r,n){oee(n,e),lee.set(r,n),OC.delete(r)}}}function pAe(t,e,r,n){if(dAe(r,t),fAe(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,a=QX(BigInt(r.length)),s=a>12?a-3:a>4?a-2:a?2:1,o=(1<=0;f-=s){l.fill(i);for(let g=0;g>BigInt(f)&BigInt(o));l[w]=l[w].add(r[g])}let h=i;for(let g=l.length-1,m=i;g>0;g--)m=m.add(l[g]),h=h.add(m);if(u=u.add(h),f!==0)for(let g=0;g{const{Err:r}=wd;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length&1)throw new r("tlv.encode: unpadded data");const n=e.length/2,i=Zp(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const a=n>127?Zp(i.length/2|128):"";return Zp(t)+a+i+e},decode(t,e){const{Err:r}=wd;let n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");const i=e[n++],a=!!(i&128);let s=0;if(!a)s=i;else{const l=i&127;if(!l)throw new r("tlv.decode(long): indefinite length not supported");if(l>4)throw new r("tlv.decode(long): byte length is too big");const c=e.subarray(n,n+l);if(c.length!==l)throw new r("tlv.decode: length bytes not complete");if(c[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const u of c)s=s<<8|u;if(n+=l,s<128)throw new r("tlv.decode(long): not minimal encoding")}const o=e.subarray(n,n+s);if(o.length!==s)throw new r("tlv.decode: wrong value length");return{v:o,l:e.subarray(n+s)}}},_int:{encode(t){const{Err:e}=wd;if(t<_d)throw new e("integer: negative integers are not allowed");let r=Zp(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){const{Err:e}=wd;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return mAe(t)}},toSig(t){const{Err:e,_int:r,_tlv:n}=wd,i=typeof t=="string"?yAe(t):t;V3(i);const{v:a,l:s}=n.decode(48,i);if(s.length)throw new e("invalid signature: left bytes after parsing");const{v:o,l}=n.decode(2,a),{v:c,l:u}=n.decode(2,l);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(o),s:r.decode(c)}},hexFromSig(t){const{_tlv:e,_int:r}=wd,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s)),a=n+i;return e.encode(48,a)}},_d=BigInt(0),qi=BigInt(1);BigInt(2);const UU=BigInt(3);BigInt(4);function wAe(t){const e=gAe(t),{Fp:r}=e,n=iee(e.n,e.nBitLength),i=e.toBytes||((w,C,v)=>{const b=C.toAffine();return qw(Uint8Array.from([4]),r.toBytes(b.x),r.toBytes(b.y))}),a=e.fromBytes||(w=>{const C=w.subarray(1),v=r.fromBytes(C.subarray(0,r.BYTES)),b=r.fromBytes(C.subarray(r.BYTES,2*r.BYTES));return{x:v,y:b}});function s(w){const{a:C,b:v}=e,b=r.sqr(w),A=r.mul(b,w);return r.add(r.add(A,r.mul(w,C)),v)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(w){return Q9(w,qi,e.n)}function l(w){const{allowedPrivateKeyLengths:C,nByteLength:v,wrapPrivateKey:b,n:A}=e;if(C&&typeof w!="bigint"){if(r1(w)&&(w=Ug(w)),typeof w!="string"||!C.includes(w.length))throw new Error("invalid private key");w=w.padStart(v*2,"0")}let S;try{S=typeof w=="bigint"?w:N0(Ql("private key",w,v))}catch{throw new Error("invalid private key, expected hex or "+v+" bytes, got "+typeof w)}return b&&(S=$s(S,A)),L0("private key",S,qi,A),S}function c(w){if(!(w instanceof h))throw new Error("ProjectivePoint expected")}const u=EM((w,C)=>{const{px:v,py:b,pz:A}=w;if(r.eql(A,r.ONE))return{x:v,y:b};const S=w.is0();C==null&&(C=S?r.ONE:r.inv(A));const j=r.mul(v,C),U=r.mul(b,C),I=r.mul(A,C);if(S)return{x:r.ZERO,y:r.ZERO};if(!r.eql(I,r.ONE))throw new Error("invZ was invalid");return{x:j,y:U}}),f=EM(w=>{if(w.is0()){if(e.allowInfinityPoint&&!r.is0(w.py))return;throw new Error("bad point: ZERO")}const{x:C,y:v}=w.toAffine();if(!r.isValid(C)||!r.isValid(v))throw new Error("bad point: x or y not FE");const b=r.sqr(v),A=s(C);if(!r.eql(b,A))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(C,v,b){if(this.px=C,this.py=v,this.pz=b,C==null||!r.isValid(C))throw new Error("x required");if(v==null||!r.isValid(v))throw new Error("y required");if(b==null||!r.isValid(b))throw new Error("z required");Object.freeze(this)}static fromAffine(C){const{x:v,y:b}=C||{};if(!C||!r.isValid(v)||!r.isValid(b))throw new Error("invalid affine point");if(C instanceof h)throw new Error("projective point not allowed");const A=S=>r.eql(S,r.ZERO);return A(v)&&A(b)?h.ZERO:new h(v,b,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){const v=r.invertBatch(C.map(b=>b.pz));return C.map((b,A)=>b.toAffine(v[A])).map(h.fromAffine)}static fromHex(C){const v=h.fromAffine(a(Ql("pointHex",C)));return v.assertValidity(),v}static fromPrivateKey(C){return h.BASE.multiply(l(C))}static msm(C,v){return pAe(h,n,C,v)}_setWindowSize(C){m.setWindowSize(this,C)}assertValidity(){f(this)}hasEvenY(){const{y:C}=this.toAffine();if(r.isOdd)return!r.isOdd(C);throw new Error("Field doesn't support isOdd")}equals(C){c(C);const{px:v,py:b,pz:A}=this,{px:S,py:j,pz:U}=C,I=r.eql(r.mul(v,U),r.mul(S,A)),B=r.eql(r.mul(b,U),r.mul(j,A));return I&&B}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:C,b:v}=e,b=r.mul(v,UU),{px:A,py:S,pz:j}=this;let U=r.ZERO,I=r.ZERO,B=r.ZERO,V=r.mul(A,A),se=r.mul(S,S),Y=r.mul(j,j),N=r.mul(A,S);return N=r.add(N,N),B=r.mul(A,j),B=r.add(B,B),U=r.mul(C,B),I=r.mul(b,Y),I=r.add(U,I),U=r.sub(se,I),I=r.add(se,I),I=r.mul(U,I),U=r.mul(N,U),B=r.mul(b,B),Y=r.mul(C,Y),N=r.sub(V,Y),N=r.mul(C,N),N=r.add(N,B),B=r.add(V,V),V=r.add(B,V),V=r.add(V,Y),V=r.mul(V,N),I=r.add(I,V),Y=r.mul(S,j),Y=r.add(Y,Y),V=r.mul(Y,N),U=r.sub(U,V),B=r.mul(Y,se),B=r.add(B,B),B=r.add(B,B),new h(U,I,B)}add(C){c(C);const{px:v,py:b,pz:A}=this,{px:S,py:j,pz:U}=C;let I=r.ZERO,B=r.ZERO,V=r.ZERO;const se=e.a,Y=r.mul(e.b,UU);let N=r.mul(v,S),k=r.mul(b,j),x=r.mul(A,U),_=r.add(v,b),L=r.add(S,j);_=r.mul(_,L),L=r.add(N,k),_=r.sub(_,L),L=r.add(v,A);let O=r.add(S,U);return L=r.mul(L,O),O=r.add(N,x),L=r.sub(L,O),O=r.add(b,A),I=r.add(j,U),O=r.mul(O,I),I=r.add(k,x),O=r.sub(O,I),V=r.mul(se,L),I=r.mul(Y,x),V=r.add(I,V),I=r.sub(k,V),V=r.add(k,V),B=r.mul(I,V),k=r.add(N,N),k=r.add(k,N),x=r.mul(se,x),L=r.mul(Y,L),k=r.add(k,x),x=r.sub(N,x),x=r.mul(se,x),L=r.add(L,x),N=r.mul(k,L),B=r.add(B,N),N=r.mul(O,L),I=r.mul(_,I),I=r.sub(I,N),N=r.mul(_,k),V=r.mul(O,V),V=r.add(V,N),new h(I,B,V)}subtract(C){return this.add(C.negate())}is0(){return this.equals(h.ZERO)}wNAF(C){return m.wNAFCached(this,C,h.normalizeZ)}multiplyUnsafe(C){const{endo:v,n:b}=e;L0("scalar",C,_d,b);const A=h.ZERO;if(C===_d)return A;if(this.is0()||C===qi)return this;if(!v||m.hasPrecomputes(this))return m.wNAFCachedUnsafe(this,C,h.normalizeZ);let{k1neg:S,k1:j,k2neg:U,k2:I}=v.splitScalar(C),B=A,V=A,se=this;for(;j>_d||I>_d;)j&qi&&(B=B.add(se)),I&qi&&(V=V.add(se)),se=se.double(),j>>=qi,I>>=qi;return S&&(B=B.negate()),U&&(V=V.negate()),V=new h(r.mul(V.px,v.beta),V.py,V.pz),B.add(V)}multiply(C){const{endo:v,n:b}=e;L0("scalar",C,qi,b);let A,S;if(v){const{k1neg:j,k1:U,k2neg:I,k2:B}=v.splitScalar(C);let{p:V,f:se}=this.wNAF(U),{p:Y,f:N}=this.wNAF(B);V=m.constTimeNegate(j,V),Y=m.constTimeNegate(I,Y),Y=new h(r.mul(Y.px,v.beta),Y.py,Y.pz),A=V.add(Y),S=se.add(N)}else{const{p:j,f:U}=this.wNAF(C);A=j,S=U}return h.normalizeZ([A,S])[0]}multiplyAndAddUnsafe(C,v,b){const A=h.BASE,S=(U,I)=>I===_d||I===qi||!U.equals(A)?U.multiplyUnsafe(I):U.multiply(I),j=S(this,v).add(S(C,b));return j.is0()?void 0:j}toAffine(C){return u(this,C)}isTorsionFree(){const{h:C,isTorsionFree:v}=e;if(C===qi)return!0;if(v)return v(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:C,clearCofactor:v}=e;return C===qi?this:v?v(h,this):this.multiplyUnsafe(e.h)}toRawBytes(C=!0){return Fg("isCompressed",C),this.assertValidity(),i(h,this,C)}toHex(C=!0){return Fg("isCompressed",C),Ug(this.toRawBytes(C))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const g=e.nBitLength,m=hAe(h,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:s,isWithinCurveOrder:o}}function vAe(t){const e=cee(t);return Y3(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function bAe(t){const e=vAe(t),{Fp:r,n}=e,i=r.BYTES+1,a=2*r.BYTES+1;function s(x){return $s(x,n)}function o(x){return CM(x,n)}const{ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:u,isWithinCurveOrder:f}=wAe({...e,toBytes(x,_,L){const O=_.toAffine(),P=r.toBytes(O.x),R=qw;return Fg("isCompressed",L),L?R(Uint8Array.from([_.hasEvenY()?2:3]),P):R(Uint8Array.from([4]),P,r.toBytes(O.y))},fromBytes(x){const _=x.length,L=x[0],O=x.subarray(1);if(_===i&&(L===2||L===3)){const P=N0(O);if(!Q9(P,qi,r.ORDER))throw new Error("Point is not on curve");const R=u(P);let M;try{M=r.sqrt(R)}catch(X){const le=X instanceof Error?": "+X.message:"";throw new Error("Point is not on curve"+le)}const D=(M&qi)===qi;return(L&1)===1!==D&&(M=r.neg(M)),{x:P,y:M}}else if(_===a&&L===4){const P=r.fromBytes(O.subarray(0,r.BYTES)),R=r.fromBytes(O.subarray(r.BYTES,2*r.BYTES));return{x:P,y:R}}else{const P=i,R=a;throw new Error("invalid Point, expected length of "+P+", or uncompressed "+R+", got "+_)}}}),h=x=>Ug(zg(x,e.nByteLength));function g(x){const _=n>>qi;return x>_}function m(x){return g(x)?s(-x):x}const w=(x,_,L)=>N0(x.slice(_,L));class C{constructor(_,L,O){this.r=_,this.s=L,this.recovery=O,this.assertValidity()}static fromCompact(_){const L=e.nByteLength;return _=Ql("compactSignature",_,L*2),new C(w(_,0,L),w(_,L,2*L))}static fromDER(_){const{r:L,s:O}=wd.toSig(Ql("DER",_));return new C(L,O)}assertValidity(){L0("r",this.r,qi,n),L0("s",this.s,qi,n)}addRecoveryBit(_){return new C(this.r,this.s,_)}recoverPublicKey(_){const{r:L,s:O,recovery:P}=this,R=U(Ql("msgHash",_));if(P==null||![0,1,2,3].includes(P))throw new Error("recovery id invalid");const M=P===2||P===3?L+e.n:L;if(M>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const D=P&1?"03":"02",$=l.fromHex(D+h(M)),X=o(M),le=s(-R*X),H=s(O*X),ee=l.BASE.multiplyAndAddUnsafe($,le,H);if(!ee)throw new Error("point at infinify");return ee.assertValidity(),ee}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Bg(this.toDERHex())}toDERHex(){return wd.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Bg(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(x){try{return c(x),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const x=see(e.n);return uAe(e.randomBytes(x),e.n)},precompute(x=8,_=l.BASE){return _._setWindowSize(x),_.multiply(BigInt(3)),_}};function b(x,_=!0){return l.fromPrivateKey(x).toRawBytes(_)}function A(x){const _=r1(x),L=typeof x=="string",O=(_||L)&&x.length;return _?O===i||O===a:L?O===2*i||O===2*a:x instanceof l}function S(x,_,L=!0){if(A(x))throw new Error("first arg must be private key");if(!A(_))throw new Error("second arg must be public key");return l.fromHex(_).multiply(c(x)).toRawBytes(L)}const j=e.bits2int||function(x){if(x.length>8192)throw new Error("input is too large");const _=N0(x),L=x.length*8-e.nBitLength;return L>0?_>>BigInt(L):_},U=e.bits2int_modN||function(x){return s(j(x))},I=EL(e.nBitLength);function B(x){return L0("num < 2^"+e.nBitLength,x,_d,I),zg(x,e.nByteLength)}function V(x,_,L=se){if(["recovered","canonical"].some(te=>te in L))throw new Error("sign() legacy options not supported");const{hash:O,randomBytes:P}=e;let{lowS:R,prehash:M,extraEntropy:D}=L;R==null&&(R=!0),x=Ql("msgHash",x),FU(L),M&&(x=Ql("prehashed msgHash",O(x)));const $=U(x),X=c(_),le=[B(X),B($)];if(D!=null&&D!==!1){const te=D===!0?P(r.BYTES):D;le.push(Ql("extraEntropy",te))}const H=qw(...le),ee=$;function J(te){const re=j(te);if(!f(re))return;const z=o(re),G=l.BASE.multiply(re).toAffine(),Q=s(G.x);if(Q===_d)return;const me=s(z*s(ee+Q*X));if(me===_d)return;let be=(G.x===Q?0:2)|Number(G.y&qi),Ce=me;return R&&g(me)&&(Ce=m(me),be^=1),new C(Q,Ce,be)}return{seed:H,k2sig:J}}const se={lowS:e.lowS,prehash:!1},Y={lowS:e.lowS,prehash:!1};function N(x,_,L=se){const{seed:O,k2sig:P}=V(x,_,L),R=e;return ZX(R.hash.outputLen,R.nByteLength,R.hmac)(O,P)}l.BASE._setWindowSize(8);function k(x,_,L,O=Y){var be;const P=x;_=Ql("msgHash",_),L=Ql("publicKey",L);const{lowS:R,prehash:M,format:D}=O;if(FU(O),"strict"in O)throw new Error("options.strict was renamed to lowS");if(D!==void 0&&D!=="compact"&&D!=="der")throw new Error("format must be compact or der");const $=typeof P=="string"||r1(P),X=!$&&!D&&typeof P=="object"&&P!==null&&typeof P.r=="bigint"&&typeof P.s=="bigint";if(!$&&!X)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let le,H;try{if(X&&(le=new C(P.r,P.s)),$){try{D!=="compact"&&(le=C.fromDER(P))}catch(Ce){if(!(Ce instanceof wd.Err))throw Ce}!le&&D!=="der"&&(le=C.fromCompact(P))}H=l.fromHex(L)}catch{return!1}if(!le||R&&le.hasHighS())return!1;M&&(_=e.hash(_));const{r:ee,s:J}=le,te=U(_),re=o(J),z=s(te*re),G=s(ee*re),Q=(be=l.BASE.multiplyAndAddUnsafe(H,z,G))==null?void 0:be.toAffine();return Q?s(Q.x)===ee:!1}return{CURVE:e,getPublicKey:b,getSharedSecret:S,sign:N,verify:k,ProjectivePoint:l,Signature:C,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function xAe(t){return{hash:t,hmac:(e,...r)=>ree(t,e,qSe(...r)),randomBytes:YSe}}function EAe(t,e){const r=n=>bAe({...t,...xAe(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const uee=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),BU=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_Ae=BigInt(1),SM=BigInt(2),zU=(t,e)=>(t+e/SM)/e;function CAe(t){const e=uee,r=BigInt(3),n=BigInt(6),i=BigInt(11),a=BigInt(22),s=BigInt(23),o=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,f=Zo(u,r,e)*u%e,h=Zo(f,r,e)*u%e,g=Zo(h,SM,e)*c%e,m=Zo(g,i,e)*g%e,w=Zo(m,a,e)*m%e,C=Zo(w,o,e)*w%e,v=Zo(C,l,e)*C%e,b=Zo(v,o,e)*w%e,A=Zo(b,r,e)*u%e,S=Zo(A,s,e)*m%e,j=Zo(S,n,e)*c%e,U=Zo(j,SM,e);if(!AM.eql(AM.sqr(U),t))throw new Error("Cannot find square root");return U}const AM=iee(uee,void 0,void 0,{sqrt:CAe}),CL=EAe({a:BigInt(0),b:BigInt(7),Fp:AM,n:BU,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=BU,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-_Ae*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=r,s=BigInt("0x100000000000000000000000000000000"),o=zU(a*t,e),l=zU(-n*t,e);let c=$s(t-o*r-l*i,e),u=$s(-o*n-l*a,e);const f=c>s,h=u>s;if(f&&(c=e-c),h&&(u=e-u),c>s||u>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:h,k2:u}}}},tAe);BigInt(0);CL.ProjectivePoint;const SAe=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:CL},Symbol.toStringTag,{value:"Module"}));function AAe({r:t,s:e,to:r="hex",v:n,yParity:i}){const a=(()=>{if(i===0||i===1)return i;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),s=`0x${new CL.Signature(vo(t),vo(e)).toCompactHex()}${a===0?"1b":"1c"}`;return r==="hex"?s:bc(s)}async function SL(t,e){var f,h,g;const{address:r,factory:n,factoryData:i,hash:a,signature:s,universalSignatureVerifierAddress:o=(g=(h=(f=t.chain)==null?void 0:f.contracts)==null?void 0:h.universalSignatureVerifier)==null?void 0:g.address,...l}=e,c=vc(s)?s:typeof s=="object"&&"r"in s&&"s"in s?AAe(s):Si(s),u=await(async()=>!n&&!i||rSe(c)?c:nSe({address:n,data:i,signature:c}))();try{const m=o?{to:o,data:Tc({abi:MU,functionName:"isValidSig",args:[r,a,u]}),...l}:{data:W9({abi:MU,args:[r,a,u],bytecode:B_e}),...l},{data:w}=await nr(t,H9,"call")(m);return D7e(w??"0x0")}catch(m){try{if(lL(qN(r),await sX({hash:a,signature:s})))return!0}catch{}if(m instanceof aX)return!1;throw m}}async function IAe(t,{address:e,message:r,factory:n,factoryData:i,signature:a,...s}){const o=YX(r);return SL(t,{address:e,factory:n,factoryData:i,hash:o,signature:a,...s})}async function MAe(t,e){const{address:r,factory:n,factoryData:i,signature:a,message:s,primaryType:o,types:l,domain:c,...u}=e,f=GCe({message:s,primaryType:o,types:l,domain:c});return SL(t,{address:r,factory:n,factoryData:i,hash:f,signature:a,...u})}function dee(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:a,pollingInterval:s=t.pollingInterval}){const o=typeof a<"u"?a:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket");let l;return o?(()=>{const f=ia(["watchBlockNumber",t.uid,e,r,s]);return lh(f,{onBlockNumber:n,onError:i},h=>W3(async()=>{var g;try{const m=await nr(t,H3,"getBlockNumber")({cacheTime:0});if(l){if(m===l)return;if(m-l>1&&r)for(let w=l+1n;wl)&&(h.onBlockNumber(m,l),l=m)}catch(m){(g=h.onError)==null||g.call(h,m)}},{emitOnBegin:e,interval:s}))})():(()=>{const f=ia(["watchBlockNumber",t.uid,e,r]);return lh(f,{onBlockNumber:n,onError:i},h=>{let g=!0,m=()=>g=!1;return(async()=>{try{const w=(()=>{if(t.transport.type==="fallback"){const v=t.transport.transports.find(b=>b.config.type==="webSocket");return v?v.value:t.transport}return t.transport})(),{unsubscribe:C}=await w.subscribe({params:["newHeads"],onData(v){var A;if(!g)return;const b=vo((A=v.result)==null?void 0:A.number);h.onBlockNumber(b,l),l=b},onError(v){var b;(b=h.onError)==null||b.call(h,v)}});m=C,g||m()}catch(w){i==null||i(w)}})(),()=>m()})})()}async function TAe(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:a=6,retryDelay:s=({count:l})=>~~(1<w(new JEe({hash:r})),o):void 0,v=lh(l,{onReplaced:n,resolve:m,reject:w},b=>{const A=nr(t,dee,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(S){const j=I=>{clearTimeout(C),A(),I(),v()};let U=S;if(!h)try{if(f){if(e>1&&(!f.blockNumber||U-f.blockNumber+1nb.resolve(f));return}if(c||(h=!0,await bM(async()=>{c=await nr(t,wL,"getTransaction")({hash:r}),c.blockNumber&&(U=c.blockNumber)},{delay:s,retryCount:a}),h=!1),f=await nr(t,xM,"getTransactionReceipt")({hash:r}),e>1&&(!f.blockNumber||U-f.blockNumber+1nb.resolve(f))}catch(I){if(I instanceof nX||I instanceof iX){if(!c){h=!1;return}try{u=c,h=!0;const B=await bM(()=>nr(t,lu,"getBlock")({blockNumber:U,includeTransactions:!0}),{delay:s,retryCount:a,shouldRetry:({error:Y})=>Y instanceof uX});h=!1;const V=B.transactions.find(({from:Y,nonce:N})=>Y===u.from&&N===u.nonce);if(!V||(f=await nr(t,xM,"getTransactionReceipt")({hash:V.hash}),e>1&&(!f.blockNumber||U-f.blockNumber+1n{var Y;(Y=b.onReplaced)==null||Y.call(b,{reason:se,replacedTransaction:u,transaction:V,transactionReceipt:f}),b.resolve(f)})}catch(B){j(()=>b.reject(B))}}else j(()=>b.reject(I))}}})});return g}function kAe(t,{blockTag:e="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:a,includeTransactions:s,poll:o,pollingInterval:l=t.pollingInterval}){const c=typeof o<"u"?o:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"),u=s??!1;let f;return c?(()=>{const m=ia(["watchBlocks",t.uid,e,r,n,u,l]);return lh(m,{onBlock:i,onError:a},w=>W3(async()=>{var C;try{const v=await nr(t,lu,"getBlock")({blockTag:e,includeTransactions:u});if(v.number&&(f!=null&&f.number)){if(v.number===f.number)return;if(v.number-f.number>1&&r)for(let b=(f==null?void 0:f.number)+1n;bf.number)&&(w.onBlock(v,f),f=v)}catch(v){(C=w.onError)==null||C.call(w,v)}},{emitOnBegin:n,interval:l}))})():(()=>{let m=!0,w=!0,C=()=>m=!1;return(async()=>{try{n&&nr(t,lu,"getBlock")({blockTag:e,includeTransactions:u}).then(A=>{m&&w&&(i(A,void 0),w=!1)});const v=(()=>{if(t.transport.type==="fallback"){const A=t.transport.transports.find(S=>S.config.type==="webSocket");return A?A.value:t.transport}return t.transport})(),{unsubscribe:b}=await v.subscribe({params:["newHeads"],async onData(A){if(!m)return;const S=await nr(t,lu,"getBlock")({blockNumber:A.blockNumber,includeTransactions:u}).catch(()=>{});m&&(i(S,f),w=!1,f=S)},onError(A){a==null||a(A)}});C=b,m||C()}catch(v){a==null||a(v)}})(),()=>C()})()}function NAe(t,{address:e,args:r,batch:n=!0,event:i,events:a,fromBlock:s,onError:o,onLogs:l,poll:c,pollingInterval:u=t.pollingInterval,strict:f}){const h=typeof c<"u"?c:typeof s=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"),g=f??!1;return h?(()=>{const C=ia(["watchEvent",e,r,n,t.uid,i,u,s]);return lh(C,{onLogs:l,onError:o},v=>{let b;s!==void 0&&(b=s-1n);let A,S=!1;const j=W3(async()=>{var U;if(!S){try{A=await nr(t,FX,"createEventFilter")({address:e,args:r,event:i,events:a,strict:g,fromBlock:s})}catch{}S=!0;return}try{let I;if(A)I=await nr(t,G9,"getFilterChanges")({filter:A});else{const B=await nr(t,H3,"getBlockNumber")({});b&&b!==B?I=await nr(t,dL,"getLogs")({address:e,args:r,event:i,events:a,fromBlock:b+1n,toBlock:B}):I=[],b=B}if(I.length===0)return;if(n)v.onLogs(I);else for(const B of I)v.onLogs([B])}catch(I){A&&I instanceof X0&&(S=!1),(U=v.onError)==null||U.call(v,I)}},{emitOnBegin:!0,interval:u});return async()=>{A&&await nr(t,q9,"uninstallFilter")({filter:A}),j()}})})():(()=>{let C=!0,v=()=>C=!1;return(async()=>{try{const b=(()=>{if(t.transport.type==="fallback"){const U=t.transport.transports.find(I=>I.config.type==="webSocket");return U?U.value:t.transport}return t.transport})(),A=a??(i?[i]:void 0);let S=[];A&&(S=[A.flatMap(I=>O3({abi:[I],eventName:I.name,args:r}))],i&&(S=S[0]));const{unsubscribe:j}=await b.subscribe({params:["logs",{address:e,topics:S}],onData(U){var B;if(!C)return;const I=U.result;try{const{eventName:V,args:se}=cL({abi:A??[],data:I.data,topics:I.topics,strict:g}),Y=zd(I,{args:se,eventName:V});l([Y])}catch(V){let se,Y;if(V instanceof Tw||V instanceof k9){if(f)return;se=V.abiItem.name,Y=(B=V.abiItem.inputs)==null?void 0:B.some(k=>!("name"in k&&k.name))}const N=zd(I,{args:Y?[]:{},eventName:se});l([N])}},onError(U){o==null||o(U)}});v=j,C||v()}catch(b){o==null||o(b)}})(),()=>v()})()}function LAe(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:a=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const c=ia(["watchPendingTransactions",t.uid,e,a]);return lh(c,{onTransactions:n,onError:r},u=>{let f;const h=W3(async()=>{var g;try{if(!f)try{f=await nr(t,UX,"createPendingTransactionFilter")({});return}catch(w){throw h(),w}const m=await nr(t,G9,"getFilterChanges")({filter:f});if(m.length===0)return;if(e)u.onTransactions(m);else for(const w of m)u.onTransactions([w])}catch(m){(g=u.onError)==null||g.call(u,m)}},{emitOnBegin:!0,interval:a});return async()=>{f&&await nr(t,q9,"uninstallFilter")({filter:f}),h()}})})():(()=>{let c=!0,u=()=>c=!1;return(async()=>{try{const{unsubscribe:f}=await t.transport.subscribe({params:["newPendingTransactions"],onData(h){if(!c)return;const g=h.result;n([g])},onError(h){r==null||r(h)}});u=f,c||u()}catch(f){r==null||r(f)}})(),()=>u()})()}function jAe(t){var f,h,g;const{scheme:e,statement:r,...n}=((f=t.match($Ae))==null?void 0:f.groups)??{},{chainId:i,expirationTime:a,issuedAt:s,notBefore:o,requestId:l,...c}=((h=t.match(PAe))==null?void 0:h.groups)??{},u=(g=t.split("Resources:")[1])==null?void 0:g.split(` -- `).slice(1);return{...n,...c,...i?{chainId:Number(i)}:{},...a?{expirationTime:new Date(a)}:{},...s?{issuedAt:new Date(s)}:{},...o?{notBefore:new Date(o)}:{},...l?{requestId:l}:{},...u?{resources:u}:{},...e?{scheme:e}:{},...r?{statement:r}:{}}}const $Ae=/^(?:(?[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?
0x[a-fA-F0-9]{40})\n\n(?:(?.*)\n\n)?/,PAe=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;function RAe(t){const{address:e,domain:r,message:n,nonce:i,scheme:a,time:s=new Date}=t;if(r&&n.domain!==r||i&&n.nonce!==i||a&&n.scheme!==a||n.expirationTime&&s>=n.expirationTime||n.notBefore&&sH9(t,e),createAccessList:e=>$Ce(t,e),createBlockFilter:()=>PCe(t),createContractEventFilter:e=>ZZ(t,e),createEventFilter:e=>FX(t,e),createPendingTransactionFilter:()=>UX(t),estimateContractGas:e=>$_e(t,e),estimateGas:e=>oL(t,e),getBalance:e=>EX(t,e),getBlobBaseFee:()=>RCe(t),getBlock:e=>lu(t,e),getBlockNumber:e=>H3(t,e),getBlockTransactionCount:e=>DCe(t,e),getBytecode:e=>LU(t,e),getChainId:()=>z3(t),getCode:e=>LU(t,e),getContractEvents:e=>_X(t,e),getEip712Domain:e=>sCe(t,e),getEnsAddress:e=>wCe(t,e),getEnsAvatar:e=>NCe(t,e),getEnsName:e=>LCe(t,e),getEnsResolver:e=>jCe(t,e),getEnsText:e=>OX(t,e),getFeeHistory:e=>FCe(t,e),estimateFeesPerGas:e=>b_e(t,e),getFilterChanges:e=>G9(t,e),getFilterLogs:e=>UCe(t,e),getGasPrice:()=>nL(t),getLogs:e=>dL(t,e),getProof:e=>vSe(t,e),estimateMaxPriorityFeePerGas:e=>v_e(t,e),getStorageAt:e=>bSe(t,e),getTransaction:e=>wL(t,e),getTransactionConfirmations:e=>xSe(t,e),getTransactionCount:e=>hX(t,e),getTransactionReceipt:e=>xM(t,e),multicall:e=>ESe(t,e),prepareTransactionRequest:e=>B9(t,e),readContract:e=>Wd(t,e),sendRawTransaction:e=>fL(t,e),simulate:e=>BSe(t,e),simulateContract:e=>K_e(t,e),verifyMessage:e=>IAe(t,e),verifySiweMessage:e=>DAe(t,e),verifyTypedData:e=>MAe(t,e),uninstallFilter:e=>q9(t,e),waitForTransactionReceipt:e=>TAe(t,e),watchBlocks:e=>kAe(t,e),watchBlockNumber:e=>dee(t,e),watchContractEvent:e=>rCe(t,e),watchEvent:e=>NAe(t,e),watchPendingTransactions:e=>LAe(t,e)}}function Ec(t){const{key:e="public",name:r="Public Client"}=t;return LX({...t,key:e,name:r,type:"publicClient"}).extend(AL)}function OAe(t,e){const{abi:r,args:n,bytecode:i,...a}=e,s=W9({abi:r,args:n,bytecode:i});return hL(t,{...a,data:s})}async function FAe(t){var r;return((r=t.account)==null?void 0:r.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>R3(n))}async function UAe(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function BAe(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>qN(r))}async function zAe(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function WAe(t,{account:e=t.account,message:r}){if(!e)throw new G3({docsPath:"/docs/actions/wallet/signMessage"});const n=ms(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?Dg(r):r.raw instanceof Uint8Array?ur(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function HAe(t,e){var c,u,f,h;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new G3({docsPath:"/docs/actions/wallet/signTransaction"});const a=ms(r);b1({account:a,...e});const s=await nr(t,z3,"getChainId")({});n!==null&&kX({currentChainId:s,chain:n});const o=(n==null?void 0:n.formatters)||((c=t.chain)==null?void 0:c.formatters),l=((u=o==null?void 0:o.transactionRequest)==null?void 0:u.format)||Lm;return a.signTransaction?a.signTransaction({...i,chainId:s},{serializer:(h=(f=t.chain)==null?void 0:f.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...l(i),chainId:lr(s),from:a.address}]},{retryCount:0})}async function GAe(t,e){const{account:r=t.account,domain:n,message:i,primaryType:a}=e;if(!r)throw new G3({docsPath:"/docs/actions/wallet/signTypedData"});const s=ms(r),o={EIP712Domain:qX({domain:n}),...e.types};if(GX({domain:n,message:i,primaryType:a,types:o}),s.signTypedData)return s.signTypedData({domain:n,message:i,primaryType:a,types:o});const l=KCe({domain:n,message:i,primaryType:a,types:o});return t.request({method:"eth_signTypedData_v4",params:[s.address,l]},{retryCount:0})}async function qAe(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:lr(e)}]},{retryCount:0})}async function VAe(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function YAe(t){return{addChain:e=>lCe(t,e),deployContract:e=>OAe(t,e),getAddresses:()=>FAe(t),getChainId:()=>z3(t),getPermissions:()=>UAe(t),prepareTransactionRequest:e=>B9(t,e),requestAddresses:()=>BAe(t),requestPermissions:e=>zAe(t,e),sendRawTransaction:e=>fL(t,e),sendTransaction:e=>hL(t,e),signMessage:e=>WAe(t,e),signTransaction:e=>HAe(t,e),signTypedData:e=>GAe(t,e),switchChain:e=>qAe(t,e),watchAsset:e=>VAe(t,e),writeContract:e=>iCe(t,e)}}function fee(t){const{key:e="wallet",name:r="Wallet Client",transport:n}=t;return LX({...t,key:e,name:r,transport:n,type:"walletClient"}).extend(YAe)}function WU(t){return t?`${t.slice(0,5)}…${t.slice(-4)}`:""}function KAe({wei:t,precision:e=3}){return parseFloat(F3(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"")}function HU({amount:t,decimals:e}){return P9(BigInt(t),e)}const JAe=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,QAe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,ZAe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function XAe(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){eIe(t);return}return e}function eIe(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function fy(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!ZAe.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(JAe.test(t)||QAe.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,XAe)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const tIe=/#/g,rIe=/&/g,nIe=/\//g,iIe=/=/g,IL=/\+/g,aIe=/%5e/gi,sIe=/%60/gi,oIe=/%7c/gi,lIe=/%20/gi;function cIe(t){return encodeURI(""+t).replace(oIe,"|")}function IM(t){return cIe(typeof t=="string"?t:JSON.stringify(t)).replace(IL,"%2B").replace(lIe,"+").replace(tIe,"%23").replace(rIe,"%26").replace(sIe,"`").replace(aIe,"^").replace(nIe,"%2F")}function UC(t){return IM(t).replace(iIe,"%3D")}function hee(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function uIe(t){return hee(t.replace(IL," "))}function dIe(t){return hee(t.replace(IL," "))}function fIe(t=""){const e={};t[0]==="?"&&(t=t.slice(1));for(const r of t.split("&")){const n=r.match(/([^=]+)=?(.*)/)||[];if(n.length<2)continue;const i=uIe(n[1]);if(i==="__proto__"||i==="constructor")continue;const a=dIe(n[2]||"");e[i]===void 0?e[i]=a:Array.isArray(e[i])?e[i].push(a):e[i]=[e[i],a]}return e}function hIe(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(r=>`${UC(t)}=${IM(r)}`).join("&"):`${UC(t)}=${IM(e)}`:UC(t)}function pIe(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>hIe(e,t[e])).filter(Boolean).join("&")}const gIe=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,mIe=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,yIe=/^([/\\]\s*){2,}[^/\\]/,wIe=/^\.?\//;function pee(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?gIe.test(t):mIe.test(t)||(e.acceptRelative?yIe.test(t):!1)}function vIe(t="",e){return t.endsWith("/")}function bIe(t="",e){return(vIe(t)?t.slice(0,-1):t)||"/"}function xIe(t="",e){return t.endsWith("/")?t:t+"/"}function EIe(t,e){if(CIe(e)||pee(t))return t;const r=bIe(e);return t.startsWith(r)?t:AIe(r,t)}function _Ie(t,e){const r=IIe(t),n={...fIe(r.search),...e};return r.search=pIe(n),MIe(r)}function CIe(t){return!t||t==="/"}function SIe(t){return t&&t!=="/"}function AIe(t,...e){let r=t||"";for(const n of e.filter(i=>SIe(i)))if(r){const i=n.replace(wIe,"");r=xIe(r)+i}else r=n;return r}const gee=Symbol.for("ufo:protocolRelative");function IIe(t="",e){const r=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(r){const[,f,h=""]=r;return{protocol:f.toLowerCase(),pathname:h,href:f+h,auth:"",host:"",search:"",hash:""}}if(!pee(t,{acceptRelative:!0}))return GU(t);const[,n="",i,a=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,s="",o=""]=a.match(/([^#/?]*)(.*)?/)||[];n==="file:"&&(o=o.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:l,search:c,hash:u}=GU(o);return{protocol:n.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:s,pathname:l,search:c,hash:u,[gee]:!n}}function GU(t=""){const[e="",r="",n=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:r,hash:n}}function MIe(t){const e=t.pathname||"",r=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",n=t.hash||"",i=t.auth?t.auth+"@":"",a=t.host||"";return(t.protocol||t[gee]?(t.protocol||"")+"//":"")+i+a+e+r+n}let mee=class extends Error{constructor(e,r){super(e,r),this.name="FetchError",r!=null&&r.cause&&!this.cause&&(this.cause=r.cause)}};function TIe(t){var l,c,u,f,h;const e=((l=t.error)==null?void 0:l.message)||((c=t.error)==null?void 0:c.toString())||"",r=((u=t.request)==null?void 0:u.method)||((f=t.options)==null?void 0:f.method)||"GET",n=((h=t.request)==null?void 0:h.url)||String(t.request)||"/",i=`[${r}] ${JSON.stringify(n)}`,a=t.response?`${t.response.status} ${t.response.statusText}`:"",s=`${i}: ${a}${e?` ${e}`:""}`,o=new mee(s,t.error?{cause:t.error}:void 0);for(const g of["request","options","response"])Object.defineProperty(o,g,{get(){return t[g]}});for(const[g,m]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(o,g,{get(){return t.response&&t.response[m]}});return o}const kIe=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function qU(t="GET"){return kIe.has(t.toUpperCase())}function NIe(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const LIe=new Set(["image/svg","application/xml","application/xhtml","application/html"]),jIe=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function $Ie(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return jIe.test(e)?"json":LIe.has(e)||e.startsWith("text/")?"text":"blob"}function PIe(t,e,r,n){const i=RIe((e==null?void 0:e.headers)??(t==null?void 0:t.headers),r==null?void 0:r.headers,n);let a;return(r!=null&&r.query||r!=null&&r.params||e!=null&&e.params||e!=null&&e.query)&&(a={...r==null?void 0:r.params,...r==null?void 0:r.query,...e==null?void 0:e.params,...e==null?void 0:e.query}),{...r,...e,query:a,params:a,headers:i}}function RIe(t,e,r){if(!e)return new r(t);const n=new r(e);if(t)for(const[i,a]of Symbol.iterator in t||Array.isArray(t)?t:new r(t))n.set(i,a);return n}async function _4(t,e){if(e)if(Array.isArray(e))for(const r of e)await r(t);else await e(t)}const DIe=new Set([408,409,425,429,500,502,503,504]),OIe=new Set([101,204,205,304]);function yee(t={}){const{fetch:e=globalThis.fetch,Headers:r=globalThis.Headers,AbortController:n=globalThis.AbortController}=t;async function i(o){const l=o.error&&o.error.name==="AbortError"&&!o.options.timeout||!1;if(o.options.retry!==!1&&!l){let u;typeof o.options.retry=="number"?u=o.options.retry:u=qU(o.options.method)?0:1;const f=o.response&&o.response.status||500;if(u>0&&(Array.isArray(o.options.retryStatusCodes)?o.options.retryStatusCodes.includes(f):DIe.has(f))){const h=typeof o.options.retryDelay=="function"?o.options.retryDelay(o):o.options.retryDelay||0;return h>0&&await new Promise(g=>setTimeout(g,h)),a(o.request,{...o.options,retry:u-1})}}const c=TIe(o);throw Error.captureStackTrace&&Error.captureStackTrace(c,a),c}const a=async function(l,c={}){const u={request:l,options:PIe(l,c,t.defaults,r),response:void 0,error:void 0};u.options.method&&(u.options.method=u.options.method.toUpperCase()),u.options.onRequest&&await _4(u,u.options.onRequest),typeof u.request=="string"&&(u.options.baseURL&&(u.request=EIe(u.request,u.options.baseURL)),u.options.query&&(u.request=_Ie(u.request,u.options.query),delete u.options.query),"query"in u.options&&delete u.options.query,"params"in u.options&&delete u.options.params),u.options.body&&qU(u.options.method)&&(NIe(u.options.body)?(u.options.body=typeof u.options.body=="string"?u.options.body:JSON.stringify(u.options.body),u.options.headers=new r(u.options.headers||{}),u.options.headers.has("content-type")||u.options.headers.set("content-type","application/json"),u.options.headers.has("accept")||u.options.headers.set("accept","application/json")):("pipeTo"in u.options.body&&typeof u.options.body.pipeTo=="function"||typeof u.options.body.pipe=="function")&&("duplex"in u.options||(u.options.duplex="half")));let f;if(!u.options.signal&&u.options.timeout){const g=new n;f=setTimeout(()=>{const m=new Error("[TimeoutError]: The operation was aborted due to timeout");m.name="TimeoutError",m.code=23,g.abort(m)},u.options.timeout),u.options.signal=g.signal}try{u.response=await e(u.request,u.options)}catch(g){return u.error=g,u.options.onRequestError&&await _4(u,u.options.onRequestError),await i(u)}finally{f&&clearTimeout(f)}if((u.response.body||u.response._bodyInit)&&!OIe.has(u.response.status)&&u.options.method!=="HEAD"){const g=(u.options.parseResponse?"json":u.options.responseType)||$Ie(u.response.headers.get("content-type")||"");switch(g){case"json":{const m=await u.response.text(),w=u.options.parseResponse||fy;u.response._data=w(m);break}case"stream":{u.response._data=u.response.body||u.response._bodyInit;break}default:u.response._data=await u.response[g]()}}return u.options.onResponse&&await _4(u,u.options.onResponse),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600?(u.options.onResponseError&&await _4(u,u.options.onResponseError),await i(u)):u.response},s=async function(l,c){return(await a(l,c))._data};return s.raw=a,s.native=(...o)=>e(...o),s.create=(o={},l={})=>yee({...t,...l,defaults:{...t.defaults,...l.defaults,...o}}),s}const G5=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}(),FIe=G5.fetch?(...t)=>G5.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),UIe=G5.Headers,BIe=G5.AbortController,wee=yee({fetch:FIe,Headers:UIe,AbortController:BIe});var or;let Ks=class extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,r,n){super(e),r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},ol=class extends Ks{constructor(e,r,n,i,a,s){super(n,i,a),this.type=e,this.status=r,this.data=s}},_e=class extends Ks{constructor(e,r,n){super(e,r,n),this.type="client_error"}},zIe=class extends _e{constructor(){super("Request timed out",void 0,"client_request_timeout")}},Pn=class extends Ks{constructor(e,r,n){super(e,r,n),this.type="connector_error"}};const Vr=t=>{if(t instanceof Ks)return t;if(!(t instanceof mee))return _n(t);if(!t.response)return new ol("api_error",null,t.message,t);let{type:e,message:r,error:n,code:i}=t.data;return new ol(e||"ApiError",t.response.status,r||n,t,i,t.data)},_n=t=>t instanceof Ks?t:t instanceof Error?new _e(t.message,t):new _e(`Internal error: ${t}`);var Ae=((or={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",or.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",or.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",or.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",or.INVALID_DATA="invalid_data",or.INVALID_CAPTCHA="invalid_captcha",or.LINKED_TO_ANOTHER_USER="linked_to_another_user",or.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",or.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",or.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",or.USER_EXITED_UPDATE_FLOW="exited_update_flow",or.ALLOWLIST_REJECTED="allowlist_rejected",or.OAUTH_USER_DENIED="oauth_user_denied",or.OAUTH_UNEXPECTED="oauth_unexpected",or.UNKNOWN_AUTH_ERROR="unknown_auth_error",or.USER_EXITED_AUTH_FLOW="exited_auth_flow",or.USER_EXITED_LINK_FLOW="exited_link_flow",or.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",or.MUST_BE_AUTHENTICATED="must_be_authenticated",or.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",or.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",or.CLIENT_REQUEST_TIMEOUT="client_request_timeout",or.INVALID_CREDENTIALS="invalid_credentials",or.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",or.UNKNOWN_MFA_ERROR="unknown_mfa_error",or.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",or.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",or.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",or.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",or.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",or.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",or.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",or.TRANSACTION_FAILURE="transaction_failure",or.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",or.NOT_SUPPORTED="not_supported",or.CAPTCHA_TIMEOUT="captcha_timeout",or.INVALID_MESSAGE="invalid_message",or.UNABLE_TO_SIGN="unable_to_sign",or.CAPTCHA_FAILURE="captcha_failure",or.CAPTCHA_DISABLED="captcha_disabled",or.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",or.TOO_MANY_REQUESTS="too_many_requests",or.USER_LIMIT_REACHED="max_accounts_reached",or.DISALLOWED_LOGIN_METHOD="disallowed_login_method",or.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",or.PASSKEY_NOT_ALLOWED="passkey_not_allowed",or.USER_DOES_NOT_EXIST="user_does_not_exist",or.INSUFFICIENT_BALANCE="insufficient_balance",or.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",or);let gp=class extends _e{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},th=class extends _e{constructor(e="Embedded wallet error",r){super(e,r,"unknown_embedded_wallet_error")}},WIe=class extends _e{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},K3=class extends _e{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}};const vee="/api/v1/sessions",bee="/api/v1/sessions/logout",HIe="/api/v1/sessions/fork",xee="/api/v1/sessions/fork/recover",GIe="/api/v1/siwe/init",qIe="/api/v1/siwe/authenticate",VIe="/api/v1/siwe/link",YIe="/api/v1/siwe/link_smart_wallet",KIe="/api/v1/siwe/unlink",JIe="/api/v1/siwe/transfer",QIe="/api/v1/siws/init",ZIe="/api/v1/siws/authenticate",XIe="/api/v1/siws/link",eMe="/api/v1/siws/unlink",tMe="/api/v1/farcaster/init",rMe="/api/v1/farcaster/authenticate",nMe="/api/v1/farcaster/link",iMe="/api/v1/farcaster/status",aMe="/api/v1/farcaster/unlink",sMe="/api/v1/farcaster/transfer",oMe="/api/v1/passwordless/init",lMe="/api/v1/passwordless/authenticate",cMe="/api/v1/passwordless/link",uMe="/api/v1/passwordless/unlink",dMe="/api/v1/passwordless/update",fMe="/api/v1/passwordless/transfer",hMe="/api/v1/passwordless_sms/init",pMe="/api/v1/passwordless_sms/link",gMe="/api/v1/passwordless_sms/unlink",mMe="/api/v1/passwordless_sms/authenticate",yMe="/api/v1/passwordless_sms/update",wMe="/api/v1/passwordless_sms/transfer",Eee="/api/v1/oauth/init",_ee="/api/v1/oauth/authenticate",Cee="/api/v1/oauth/link",vMe="/api/v1/oauth/unlink",bMe="/api/v1/oauth/transfer",xMe="/api/v1/recovery/oauth/init",EMe="/api/v1/recovery/oauth/init_icloud",_Me="/api/v1/recovery/oauth/authenticate",CMe="/api/v1/passkeys/link/init",SMe="/api/v1/passkeys/authenticate/init",AMe="/api/v1/passkeys/link",IMe="/api/v1/passkeys/authenticate",MMe="/api/v1/passkeys/unlink",TMe="/api/v1/telegram/authenticate",kMe="/api/v1/telegram/link",NMe="/api/v1/telegram/unlink",LMe="/api/v1/telegram/transfer",jMe="/api/v1/mfa/passwordless_sms/init",$Me="/api/v1/mfa/passkeys/init",PMe="/api/v1/users/me/accept_terms",See="/api/v1/analytics_events",RMe="/api/v1/custom_jwt_account/authenticate",DMe="/api/v1/guest/authenticate",OMe="/api/v1/plugins/moonpay_on_ramp/sign",FMe="/api/v1/funding/coinbase_on_ramp/init",UMe="/api/v1/funding/coinbase_on_ramp/status",BMe="/api/v1/wallets/revoke";let Aee=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(RMe,{token:this.meta.token})}catch(e){throw Vr(e)}}async link(){throw Error("Unimplemented")}constructor(e){this.meta={token:e}}};function X9(t){return t?{"privy-ui":"t"}:void 0}let Xp=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _e("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(lMe,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _e("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(cMe,{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw Vr(e)}}async sendCodeEmail({email:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new _e("Auth flow has no API instance");if(e&&(this.meta.email=e),r&&(this.meta.captchaToken=r),!this.meta.email)throw new _e("Email must be set when initialzing authentication.");let i=X9(n);try{return await this.api.post(oMe,{email:this.meta.email,token:this.meta.captchaToken},{headers:{...i}})}catch(a){throw Vr(a)}}constructor({email:e,captchaToken:r,disableSignup:n}){this.meta={email:e,captchaToken:r,disableSignup:n??!1}}},zMe=class extends Xp{async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new _e("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(dMe,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw Vr(e)}}constructor(e,r,n){super({email:r,captchaToken:n}),this.meta={email:r,captchaToken:n,oldAddress:e,disableSignup:!1}}},WMe=class{get(e){return this._cache[e]}put(e,r){r!==void 0?this._cache[e]=r:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}},Iee=class{get(e){let r=localStorage.getItem(e);return r===null?void 0:JSON.parse(r)}put(e,r){r!==void 0?localStorage.setItem(e,JSON.stringify(r)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map(([e])=>e)}};function MM(){try{let t="privy:__session_storage__test",e=new Iee;return e.put(t,"blobby"),e.del(t),!0}catch{return!1}}var Dt=typeof window<"u"&&window.localStorage?new Iee:new WMe;function HMe(){var n;let t=window,e=t.ethereum;if(!e)return[];let r=[];if((n=e.providers)!=null&&n.length)for(let i of e.providers)i&&r.push(i);return r.push(t.ethereum),r}const Mee=t=>t.isApexWallet?"Apex Wallet":t.isAvalanche?"Core Wallet":t.isBackpack?"Backpack":t.isBifrost?"Bifrost Wallet":t.isBitKeep?"BitKeep":t.isBitski?"Bitski":t.isBlockWallet?"BlockWallet":t.isBraveWallet?"Brave Wallet":t.isClover?"Clover":t.isCoin98?"Coin98 Wallet":t.isCoinbaseWallet?"Coinbase Wallet":t.isDawn?"Dawn Wallet":t.isDefiant?"Defiant":t.isDesig?"Desig Wallet":t.isEnkrypt?"Enkrypt":t.isExodus?"Exodus":t.isFordefi?"Fordefi":t.isFrame?"Frame":t.isFrontier?"Frontier Wallet":t.isGamestop?"GameStop Wallet":t.isHaqqWallet?"HAQQ Wallet":t.isHyperPay?"HyperPay Wallet":t.isImToken?"ImToken":t.isHaloWallet?"Halo Wallet":t.isKuCoinWallet?"KuCoin Wallet":t.isMathWallet?"MathWallet":t.isNovaWallet?"Nova Wallet":t.isOkxWallet||t.isOKExWallet?"OKX Wallet":t.isOneInchIOSWallet||t.isOneInchAndroidWallet?"1inch Wallet":t.isOneKey?"OneKey Wallet":t.isOpera?"Opera":t.isPhantom?"Phantom":t.isPortal?"Ripio Portal":t.isRabby?"Rabby Wallet":t.isRainbow?"Rainbow":t.isSafePal?"SafePal Wallet":t.isStatus?"Status":t.isSubWallet?"SubWallet":t.isTalisman?"Talisman":t.isTally||t.isTaho?"Taho":t.isTokenPocket?"TokenPocket":t.isTokenary?"Tokenary":t.isTrust||t.isTrustWallet?"Trust Wallet":t.isTTWallet?"TTWallet":t.isXDEFI?"XDEFI Wallet":t.isZeal?"Zeal":t.isZerion?"Zerion":t.isMetaMask?"MetaMask":void 0,Tee=(t,e)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!e)return!0;if(t.isBraveWallet&&!t._events&&!t._state||Mee(t)!=="MetaMask")return!1;if(t.providers){for(let r of t.providers)if(!Tee(r))return!1}return!0},ex=()=>{var t,e,r,n,i,a;if("phantom"in window){let s=window;if((e=(t=s==null?void 0:s.phantom)==null?void 0:t.ethereum)!=null&&e.isPhantom&&((n=(r=s==null?void 0:s.phantom)==null?void 0:r.ethereum)!=null&&n.chainId)||(a=(i=s==null?void 0:s.phantom)==null?void 0:i.solana)!=null&&a.isPhantom)return!0}return!1},kee=()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let e of t.ethereum.providers)if(e&&e.isCoinbaseWallet)return!0}return!1},GMe=(t,e)=>{let r=[],n=[];for(let[i,a]of t.entries())i!!String(t).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),qMe=(t,e)=>{let r=t.slice(0),n=[];for(;r.length;)n.push(r.splice(0,e));return n},as=(t,e=3,r=4,n="ethereum")=>{if(!t)return"";let i=n==="ethereum"?2:0;return e+r+i+3>=t.length?t:`${t.slice(0,i+e)}...${t.slice(t.length-r,t.length)}`},BC=(t,e=3,r=4)=>as(t,e,r,"solana"),Lee=t=>new Promise(e=>setTimeout(e,t));function VMe(t,{interval:e=100,timeout:r=5e3}={}){return new Promise((n,i)=>{let a,s=0,o=()=>{s>=r?i("Max attempts reached without result"):(a=t(),s+=e,a==null?setTimeout(o,e):n(a))};o()})}const TM=(t,e={})=>{let r=e.delayMs||150,n=e.maxAttempts||270;return new Promise(async(i,a)=>{var l;let s=!1,o=0;for(;!s&&o{s=!0,i(c)},(...c)=>{s=!0,a(...c)}),o+=1,await Lee(r)}s||a(Error("Exceeded max attempts before resolving function"))})},jee=(t,e,r={},n={})=>{let i=new URL(e,t);for(let[s,o]of Object.entries(r))o!==void 0&&i.searchParams.set(s,o);let a=Object.entries(n);if(a.length>0){let s=new URLSearchParams;for(let[o,l]of a)s.append(o,l);i.hash=s.toString()}return i.href},YMe=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),q5=t=>typeof t=="string"?t:"0x"+t.toString(16);async function KMe({store:t,walletList:e,externalWalletConfig:r,walletChainType:n,timeout:i=3e3}){let a=!1,s=window;return new Promise(o=>{function l(){if(a)return;a=!0,window.removeEventListener("ethereum#initialized",l);let c=t.getProviders();console.debug("Detected injected providers:",c.map(f=>f.info));let u=[];for(let f of c)e.includes("coinbase_wallet")&&f.info.rdns==="com.coinbase.wallet"||n==="solana-only"&&f.info.rdns==="app.phantom"||u.push({type:f.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:f});if(n!=="solana-only")for(let f of HMe()){let h=Mee(f);if(!c.some(g=>g.info.name===h)){if(Tee(f,!0)&&!u.find(g=>g.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:f});continue}if(h==="Phantom"&&!u.find(g=>g.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:f});continue}if(h==="Coinbase Wallet"&&!u.find(g=>{var m;return g.type==="coinbase_wallet"&&((m=r.coinbaseWallet)==null?void 0:m.connectionOptions)!=="smartWalletOnly"})){u.push({type:"coinbase_wallet",legacyInjectedProvider:f});continue}u.find(g=>g.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:f})}}o(u)}s.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},i))})}function M6(t){return`eip155:${String(Number(t))}`}const JMe=(t,e,r,n)=>{let i=Number(t),a=e.find(s=>s.id===i);if(!a)throw new Pn(`Unsupported chainId ${t}`,4901);return ch(a,r,n)},ch=(t,e,r)=>{var s,o,l;let n,i=t.id,a=Number(t.id);if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])n=t.rpcUrls.privyWalletOverride.http[0];else if(e.rpcUrls&&e.rpcUrls[a])n=e.rpcUrls[a];else if((s=t.rpcUrls.privy)!=null&&s.http[0]){let c=new URL(t.rpcUrls.privy.http[0]);c.searchParams.append("privyAppId",r),n=c.toString()}else n=(o=t.rpcUrls.public)!=null&&o.http[0]?t.rpcUrls.public.http[0]:(l=t.rpcUrls.default)==null?void 0:l.http[0];if(!n)throw new Pn(`No RPC url found for ${i}`);return n},QMe=(t,e)=>{var i;let r=Number(t),n=e.find(a=>a.id===r);if(!n)throw new Pn(`Unsupported chainId ${t}`,4901);return(i=n.blockExplorers)==null?void 0:i.default.url},Wg=(t,e,r,n)=>{var s,o,l;let i=Number(t),a=e.find(c=>c.id===i);if(!a)throw new Pn(`Unsupported chainId ${t}`,4901);return new Ebe(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0]?a.rpcUrls.privyWalletOverride.http[0]:r.rpcUrls&&r.rpcUrls[i]?r.rpcUrls[i]:(s=a.rpcUrls.privy)!=null&&s.http[0]?{url:a.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}:(o=a.rpcUrls.public)!=null&&o.http[0]?a.rpcUrls.public.http[0]:(l=a.rpcUrls.default)==null?void 0:l.http[0])},kM=t=>{let e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=t.types.EIP712Domain??Object.entries(t.domain).map(([n,i])=>{if(i!=null&&typeof n=="string"&&n in e)return{name:n,type:e[n]}}).filter(n=>n!==void 0);return{...t,types:{...t.types,EIP712Domain:r}}};function ZMe(t,{min:e,max:r}){return Math.min(Math.max(t,e),r)}const zC=t=>{let e;try{e=new URL(t).hostname}catch{return}for(let[r,n]of Object.entries(NM))if(e.includes(n.hostname))return{walletClientType:r,entry:n}},NM={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}},bybit_wallet:{id:"15c8b91ade1a4e58f3ce4e7a0dd7f42b47db0c8df7e0d84f63eb39bcb96c4e0f",displayName:"Bybit Wallet",hostname:"bybit.com",mobile:{}}};function $ee(t){return{name:t.displayName||"",universalLink:t.mobile.universal,deepLink:t.mobile.native}}function XMe(t,e){let r=$ee(e);if(r.deepLink)return Dee(r.deepLink,t);if(r.universalLink)return ML(r.universalLink,t);throw new _e(`Unsupported wallet ${e.id}`)}function eTe(t,e){let r=$ee(e);if(r.universalLink)return ML(r.universalLink,t)}let Pee="WALLETCONNECT_DEEPLINK_CHOICE";function tTe(){try{localStorage.removeItem(Pee)}catch{}}function rTe({href:t,name:e}){try{localStorage.setItem(Pee,JSON.stringify({href:t,name:e}))}catch{}}function Ree(t){return t.startsWith("http://")||t.startsWith("https://")}function Dee(t,e){if(Ree(t))return ML(t,e);let r=t;return r.includes("://")||(r=t.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(e)}`,href:r}}function ML(t,e){if(!Ree(t))return Dee(t,e);let r=t;return r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(e)}`,href:r}}function Oee(t,e){window.open(t,e,"noreferrer noopener")}let is=class{execute(e){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}},VU=class{get meta(){return this._meta}async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.channelToken)throw new _e("Auth flow must be initialized first");try{let e=await this.api.post(rMe,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!e)throw new _e("No response from authentication");return e}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(nMe,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw Vr(e)}}async _startChannelOnce(){if(!this.api)throw new _e("Auth flow has no API instance");let e=await this.api.post(tMe,{token:this.captchaToken});ya&&!RN&&e.connect_uri&&Oee(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new _e("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.channelToken)throw new _e("Auth flow must be initialized first");let e=await this.api.get(iMe,{headers:{"farcaster-channel-token":this.meta.channelToken}});return e.state==="completed"&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}constructor(e,r=!1){this._meta={disableSignup:!1},this.captchaToken=e,this.startChannelOnce=new is(this._startChannelOnce.bind(this)),this.pollForReady=new is(this._pollForReady.bind(this)),this._meta.disableSignup=r}};const nTe="34357d3c125c2bcf2ce2bc3309d98715",LM="https://auth.privy.io",iTe=2e4,Dn=1400,TL=2500,tx=4e3,aTe="1.98.4",hy="privy:token",YU="privy-token",WC="privy:refresh_token",sTe="privy-refresh-token",T6="privy:pat",KU="privy:id_token",JU="privy-id-token",HC="privy-session",jM="privy:session_transfer_token",$M="privy:caid",Fee=t=>`privy:guest:${t}`,C4=t=>`privy:cross-app:${t}`,V5="privy:state_code",py="privy:code_verifier",Y5="privy:headless_oauth",K5="privy:oauth_disable_signup",GC=t=>`privy:wallet:${t}`,QU="privy:connectors",Uee="privy:connections",rx=12e4,Yw=1,ZU="0x1",kL=3e4,oTe="https://api.moonpay.com/v1",lTe="https://api.moonpay.com/v1",cTe="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",uTe="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",dTe="deprecated";async function fTe(t){let e=new TextEncoder().encode(t);return new Uint8Array(await crypto.subtle.digest("SHA-256",e))}function PM(t){return crypto.getRandomValues(new Uint8Array(t))}let Bee=class{getOrCreateGuestCredential(e){let r=Fee(e);if(MM()){if(Dt.get(r))return Dt.get(r);{let n=B5(PM(32));return Dt.put(r,n),n}}return B5(PM(32))}async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(DMe,{guest_credential:this.meta.guestCredential})}catch(e){throw Vr(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}},S4=class{async initAuthenticationFlow(e){if(!this.api)throw new _e("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute(e)}async initLinkFlow(){if(!this.api)throw new _e("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){var r,n;let e=await qs(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new _e("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new _e("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let i=await e.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options));return(n=(r=this.meta).setPasskeyAuthState)==null||n.call(r,{status:"submitting-response"}),await this.api.post(IMe,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(i)})}catch(i){throw i.name==="NotAllowedError"?new _e("Passkey request timed out or rejected by user.",void 0,Ae.PASSKEY_NOT_ALLOWED):Vr(i)}}async link(){var r,n;let e=await qs(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new _e("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new _e("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let i=this.meta.initLinkResponse.options,a=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(i));return(n=(r=this.meta).setPasskeyAuthState)==null||n.call(r,{status:"submitting-response"}),await this.api.post(AMe,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(a)})}catch(i){throw i.name==="NotAllowedError"?new _e("Passkey request timed out or rejected by user.",void 0,Ae.PASSKEY_NOT_ALLOWED):Vr(i)}}async _initAuthenticateOnce(e){if(!this.api)throw new _e("Auth flow has no API instance");let r=X9(e);return await this.api.post(SMe,{token:this.meta.captchaToken},{headers:{...r}})}async _initLinkOnce(){if(!this.api)throw new _e("Auth flow has no API instance");return await this.api.post(CMe,{})}_transformInitLinkOptionsToCamelCase(e){var r,n,i,a,s,o,l,c,u;return{rp:e.rp,user:{id:e.user.id,name:e.user.name,displayName:e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map(f=>({type:f.type,alg:f.alg})),timeout:e.timeout,excludeCredentials:(r=e.exclude_credentials)==null?void 0:r.map(f=>({id:f.id,type:f.type,transports:f.transports})),authenticatorSelection:{authenticatorAttachment:(n=e.authenticator_selection)==null?void 0:n.authenticator_attachment,requireResidentKey:(i=e.authenticator_selection)==null?void 0:i.require_resident_key,residentKey:(a=e.authenticator_selection)==null?void 0:a.resident_key,userVerification:(s=e.authenticator_selection)==null?void 0:s.user_verification},attestation:e.attestation,extensions:{appid:(o=e.extensions)==null?void 0:o.app_id,credProps:(c=(l=e.extensions)==null?void 0:l.cred_props)==null?void 0:c.rk,hmacCreateSecret:(u=e.extensions)==null?void 0:u.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){var r,n,i,a;return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:((r=e.allow_credentials)==null?void 0:r.map(s=>({id:s.id,type:s.type,transports:s.transports})))||[],timeout:e.timeout,extensions:{appid:(n=e.extensions)==null?void 0:n.app_id,credProps:(i=e.extensions)==null?void 0:i.cred_props,hmacCreateSecret:(a=e.extensions)==null?void 0:a.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}constructor({captchaToken:e,setPasskeyAuthState:r}){this.initAuthenticateOnce=new is(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new is(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:r}}};const RM=({address:t,chainId:e,nonce:r})=>`${window.location.host} wants you to sign in with your Ethereum account: -${t} - -By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees. - -URI: ${window.location.origin} -Version: 1 -Chain ID: ${e} -Nonce: ${r} -Issued At: ${new Date().toISOString()} -Resources: -- https://privy.io`;let J5=class{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,chainId:this.wallet.chainId,address:this.wallet.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new _e("SiweFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.authenticateWithSiweInternal({message:e,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.client)throw new _e("SiweFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw Vr(e)}}async sign(){if(!this.client)throw new _e("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new _e("Could not prepare SIWE message");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new _e("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new _e("SiweFlow has no client instance");let e=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=RM({address:e,chainId:r,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new is(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}};const hTe=({address:t,nonce:e})=>`${window.location.host} wants you to sign in with your Solana account: -${t} - -${`You are proving you own ${t}.`} - -URI: ${window.location.origin} -Version: 1 -Chain ID: mainnet -Nonce: ${e} -Issued At: ${new Date().toISOString()} -Resources: -- https://privy.io`;let DM=class{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new _e("SiwsFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:r,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.client)throw new _e("SiwsFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:r,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw Vr(e)}}async sign(){if(!this.client)throw new _e("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new _e("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new _e("Wallet does not support signMessage");let e=await this.wallet.signMessage(Buffer.from(this.preparedMessage));return{message:this.preparedMessage,signature:Buffer.from(e).toString("base64")}}async _getNonceOnce(){if(!this.client)throw new _e("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new _e("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=hTe({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new is(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}},eg=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _e("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(mMe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _e("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(pMe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Vr(e)}}async sendSmsCode({phoneNumber:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new _e("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new _e("phone nNumber must be set when initialzing authentication.");let i=X9(n);try{return await this.api.post(hMe,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:{...i}})}catch(a){throw Vr(a)}}constructor({phoneNumber:e,captchaToken:r,disableSignup:n}){this.meta={phoneNumber:e,captchaToken:r,disableSignup:n??!1}}},pTe=class extends eg{async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new _e("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(yMe,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Vr(e)}}constructor(e,r,n){super({phoneNumber:r,captchaToken:n}),this.meta={phoneNumber:r,captchaToken:n,oldPhoneNumber:e,disableSignup:!1}}};const Pe=()=>{throw Error("You need to wrap your application with the initialized with your app id.")},A4=t=>()=>{throw Error(t.trim())},zee=E.createContext({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:Pe,setError:Pe,setExecuting:Pe,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:Pe,reset:Pe,execute:Pe});let nx=class extends Ks{constructor(e,r,n){super(e||"Captcha failed"),this.type="Captcha",r instanceof Error&&(this.cause=r),this.privyErrorCode=n}};const gTe=({children:t,id:e,captchaSiteKey:r,captchaEnabled:n})=>{let i=E.useRef(null),[a,s]=E.useState(),[o,l]=E.useState(),[c,u]=E.useState(!1),f=E.useMemo(()=>n?c||a||o?!c||a||o?a&&!o?{status:"success",token:a}:o?{status:"error",error:o}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"},[n,a,o,c]);return d.jsx(zee.Provider,{value:{...f,ref:i,enabled:n,siteKey:r,appId:e,setToken:s,setError:l,setExecuting:u,remove(){var h;n&&((h=i.current)==null||h.remove(),u(!1),l(void 0),s(void 0))},reset(){var h;n&&((h=i.current)==null||h.reset(),u(!1),l(void 0),s(void 0))},execute(){var h;n&&(u(!0),(h=i.current)==null||h.execute())},async waitForResult(){if(!n)return"";try{return await VMe(()=>{var h;return(h=i.current)==null?void 0:h.getResponse()},{interval:200,timeout:2e4})}catch{throw new nx("Captcha failed",null,Ae.CAPTCHA_TIMEOUT)}}},children:t})},Do=()=>E.useContext(zee);let I4=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(TMe,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(kMe,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw Vr(e)}}constructor(e,r=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=r}};function XU(t){let e={detail:"",retryable:!1};return(t==null?void 0:t.privyErrorCode)===Ae.LINKED_TO_ANOTHER_USER&&(e.detail="This account has already been linked to another user."),(t==null?void 0:t.privyErrorCode)===Ae.DISALLOWED_LOGIN_METHOD&&(e.detail="Login with Telegram not allowed."),(t==null?void 0:t.privyErrorCode)===Ae.INVALID_DATA&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ae.CANNOT_LINK_MORE_OF_TYPE&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ae.INVALID_CREDENTIALS&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ae.TOO_MANY_REQUESTS&&(e.detail="Too many requests. Please wait before trying again."),(t==null?void 0:t.privyErrorCode)===Ae.TOO_MANY_REQUESTS&&t.message.includes("rate limit")&&(e.detail="Request limit reached for Telegram. Please wait a moment and try again."),t instanceof nx&&(e.retryable=!0,e.detail="Something went wrong. Try again."),e}function mTe(){let t;return(t=function(){let e=new URLSearchParams(window.location.search),r=Number(e.get("id")||""),n=e.get("hash"),i=Number(e.get("auth_date")||""),a=e.get("first_name");if(r&&a&&i&&n)return Object.fromEntries(e.entries())}())?(eB(),{flowType:"login-url",authData:t}):(t=function(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let r=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),n=r.get("user"),i=Number(r.get("auth_date")||""),a=r.get("hash");return n&&i&&a?Object.fromEntries(r.entries()):void 0}())?(eB(),{flowType:"web-app",authData:t}):void 0}function eB(){let t=new URL(window.location.href);t.searchParams.delete("id"),t.searchParams.delete("hash"),t.searchParams.delete("auth_date"),t.searchParams.delete("first_name"),t.searchParams.delete("last_name"),t.searchParams.delete("username"),t.searchParams.delete("photo_url"),t.hash="",window.history.replaceState({},"",t)}let Np=class Wee{static parse(e){try{return new Wee(e)}catch{return null}}static throwIfNotWellFormedJwt(e){return rU(e),e}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=rU(e)}},yTe=class Hee extends Np{static parse(e){try{return new Hee(e)}catch{return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}};function Yt(t){return t?new Date(1e3*t):null}function Qa(t,e){return t.slice().sort((r,n)=>(n.firstVerifiedAt??n.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===e)}const js=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"&&e.walletIndex===0))||null,k6=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"),wTe=t=>k6(t).reduce((e,r)=>!e||e.walletIndex((t==null?void 0:t.linkedAccounts)??[]).filter(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.chainType===e),N6=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"),au=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"&&e.walletIndex===0))||null,vTe=t=>N6(t).reduce((e,r)=>!e||e.walletIndex(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&e.imported&&e.chainType==="ethereum"))||null,Fy=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.imported&&e.walletClientType==="privy"&&e.chainType==="solana"))||null,Z5=(t,e)=>(t==null?void 0:t.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.address===e))||null,mo=t=>js(t)??au(t),qn=t=>{if(t.chainType==="ethereum")return{entropyId:t.address,entropyIdVerifier:"ethereum-address-verifier"};if(t.chainType==="solana")return{entropyId:t.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},bTe=t=>{let e=mo(t);if(!e)throw Error("Failed to find primary wallet");return qn(e)},M4=(t,e)=>{let r=Gee(t,"ethereum").find(n=>Ir(n.address)===Ir(e));return{signingWallet:r,rootWallet:r?r.imported?r:js(t):void 0}},L6=(t,e)=>{let r=Gee(t,"solana").find(n=>n.address===e);return r?r.imported||r.walletIndex===0?{signingWallet:r,rootWallet:r}:{signingWallet:r,rootWallet:au(t)}:{}},Hd=(t,e)=>{var r;return!(js(t)||au(t)||e!=="all-users"&&(e!=="users-without-wallets"||(r=(n=>n.linkedAccounts.filter(i=>i.type==="wallet"))(t))!=null&&r.length))};function Ta(t){if(!t)return null;let e=function(b){let A=[];for(let S of b){let j=S.type;switch(S.type){case"wallet":let U={address:S.address,type:S.type,imported:S.imported,delegated:S.delegated,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at),chainType:S.chain_type,chainId:S.chain_id,walletClient:S.wallet_client_type==="privy"?"privy":"unknown",walletClientType:S.wallet_client_type,connectorType:S.connector_type,recoveryMethod:S.recovery_method,walletIndex:S.wallet_index};A.push(U);break;case"smart_wallet":let I={address:S.address,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at),smartWalletType:S.smart_wallet_type};A.push(I);break;case"cross_app":let B={type:S.type,subject:S.subject,embeddedWallets:S.embedded_wallets,smartWallets:S.smart_wallets,providerApp:{id:S.provider_app_id},verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(B);break;case"email":let V={address:S.address,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(V);break;case"phone":let se={number:S.phoneNumber,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(se);break;case"google_oauth":let Y={subject:S.subject,email:S.email,name:S.name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(Y);break;case"spotify_oauth":let N={subject:S.subject,email:S.email,name:S.name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(N);break;case"instagram_oauth":let k={subject:S.subject,username:S.username,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(k);break;case"twitter_oauth":let x={subject:S.subject,username:S.username,name:S.name,type:S.type,profilePictureUrl:S.profile_picture_url,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(x);break;case"discord_oauth":let _={subject:S.subject,username:S.username,email:S.email,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(_);break;case"github_oauth":let L={subject:S.subject,username:S.username,name:S.name,email:S.email,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(L);break;case"tiktok_oauth":let O={subject:S.subject,username:S.username,name:S.name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(O);break;case"linkedin_oauth":let P={subject:S.subject,name:S.name,email:S.email,vanityName:S.vanity_name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(P);break;case"apple_oauth":let R={subject:S.subject,email:S.email,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(R);break;case"custom_auth":A.push({type:S.type,customUserId:S.custom_user_id,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)});break;case"farcaster":let M={type:S.type,fid:S.fid,ownerAddress:S.owner_address,displayName:S.display_name,username:S.username,bio:S.bio,pfp:S.profile_picture_url,url:S.homepage_url,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at),signerPublicKey:S.signer_public_key};A.push(M);break;case"passkey":let D={type:S.type,enrolledInMfa:S.enrolled_in_mfa,credentialId:S.credential_id,authenticatorName:S.authenticator_name,createdWithDevice:S.created_with_device,createdWithOs:S.created_with_os,createdWithBrowser:S.created_with_browser,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(D);break;case"telegram":let $={type:S.type,telegramUserId:S.telegram_user_id,firstName:S.first_name,lastName:S.last_name,username:S.username,photoUrl:S.photo_url,verifiedAt:Yt(S.first_verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push($);break;default:console.warn(`Unrecognized account type: ${j}. Please consider upgrading the Privy SDK.`)}}return A}(t.linked_accounts),r=Qa(e,"wallet"),n=Qa(e,"smart_wallet"),i=Qa(e,"email"),a=Qa(e,"phone"),s=Qa(e,"google_oauth"),o=Qa(e,"twitter_oauth"),l=Qa(e,"discord_oauth"),c=Qa(e,"github_oauth"),u=Qa(e,"spotify_oauth"),f=Qa(e,"instagram_oauth"),h=Qa(e,"tiktok_oauth"),g=Qa(e,"linkedin_oauth"),m=Qa(e,"apple_oauth"),w=Qa(e,"farcaster"),C=Qa(e,"telegram"),v=t.mfa_methods.map(({type:b,verified_at:A})=>({type:b,verifiedAt:Yt(A)}));return{id:t.id,createdAt:Yt(t.created_at),linkedAccounts:e,email:i&&{address:i==null?void 0:i.address},phone:a&&{number:a==null?void 0:a.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,delegated:r.delegated,walletIndex:r.walletIndex},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType},google:s&&{subject:s.subject,email:s.email,name:s.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name,profilePictureUrl:o.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:c&&{subject:c.subject,username:c.username,name:c.name,email:c.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:f&&{subject:f.subject,username:f.username},tiktok:h&&{subject:h.subject,username:h.username,name:h.name},linkedin:g&&{subject:g.subject,name:g.name,email:g.email,vanityName:g.vanityName},apple:m&&{subject:m.subject,email:m.email},farcaster:w&&{fid:w.fid,ownerAddress:w.ownerAddress,displayName:w.displayName,username:w.username,bio:w.bio,pfp:w.pfp,url:w.url,signerPublicKey:w.signerPublicKey},telegram:C&&{telegramUserId:C.telegramUserId,firstName:C.firstName,lastName:C.lastName,username:C.username,photoUrl:C.photoUrl},delegatedWallets:[],mfaMethods:v.map(b=>b.type),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}var qee={},Kw={},ix={};Object.defineProperty(ix,"__esModule",{value:!0});ix.walletLogo=void 0;const xTe=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' 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=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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=e,`data:image/svg+xml,%3Csvg width='${e}' 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 `}};ix.walletLogo=xTe;var ax={};const ETe=yh(oxe);var $u={},Gd={};Object.defineProperty(Gd,"__esModule",{value:!0});Gd.errorValues=Gd.standardErrorCodes=void 0;Gd.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}};Gd.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 sx={},NL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Gd,r="Unspecified error message.";t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(h,g=r){if(h&&Number.isInteger(h)){const m=h.toString();if(u(e.errorValues,m))return e.errorValues[m].message;if(l(h))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return g}t.getMessageFromCode=n;function i(h){if(!Number.isInteger(h))return!1;const g=h.toString();return!!(e.errorValues[g]||l(h))}t.isValidCode=i;function a(h){var g;if(typeof h=="number")return h;if(s(h))return(g=h.code)!==null&&g!==void 0?g:h.errorCode}t.getErrorCode=a;function s(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function o(h,{shouldIncludeStack:g=!1}={}){const m={};if(h&&typeof h=="object"&&!Array.isArray(h)&&u(h,"code")&&i(h.code)){const w=h;m.code=w.code,w.message&&typeof w.message=="string"?(m.message=w.message,u(w,"data")&&(m.data=w.data)):(m.message=n(m.code),m.data={originalError:c(h)})}else m.code=e.standardErrorCodes.rpc.internal,m.message=f(h,"message")?h.message:r,m.data={originalError:c(h)};return g&&(m.stack=f(h,"stack")?h.stack:void 0),m}t.serialize=o;function l(h){return h>=-32099&&h<=-32e3}function c(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function u(h,g){return Object.prototype.hasOwnProperty.call(h,g)}function f(h,g){return typeof h=="object"&&h!==null&&g in h&&typeof h[g]=="string"}})(NL);Object.defineProperty(sx,"__esModule",{value:!0});sx.standardErrors=void 0;const ha=Gd,Vee=NL;sx.standardErrors={rpc:{parse:t=>Xo(ha.standardErrorCodes.rpc.parse,t),invalidRequest:t=>Xo(ha.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>Xo(ha.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>Xo(ha.standardErrorCodes.rpc.methodNotFound,t),internal:t=>Xo(ha.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Xo(e,t)},invalidInput:t=>Xo(ha.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>Xo(ha.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Xo(ha.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Xo(ha.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Xo(ha.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Xo(ha.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>mp(ha.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>mp(ha.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>mp(ha.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>mp(ha.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>mp(ha.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>mp(ha.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Jee(e,r,n)}}};function Xo(t,e){const[r,n]=Yee(e);return new Kee(t,r||(0,Vee.getMessageFromCode)(t),n)}function mp(t,e){const[r,n]=Yee(e);return new Jee(t,r||(0,Vee.getMessageFromCode)(t),n)}function Yee(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}class Kee extends Error{constructor(e,r,n){if(!Number.isInteger(e))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=e,n!==void 0&&(this.data=n)}}class Jee extends Kee{constructor(e,r,n){if(!_Te(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}function _Te(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=void 0;var e=Gd;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});var r=sx;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}})})($u);var ox={},$m={};Object.defineProperty($m,"__esModule",{value:!0});$m.isErrorResponse=void 0;function CTe(t){return t.errorMessage!==void 0}$m.isErrorResponse=CTe;var E1={};Object.defineProperty(E1,"__esModule",{value:!0});E1.LIB_VERSION=void 0;E1.LIB_VERSION="4.0.3";Object.defineProperty(ox,"__esModule",{value:!0});ox.serializeError=void 0;const STe=$m,ATe=E1,ITe=Gd,MTe=NL;function TTe(t,e){const r=(0,MTe.serialize)(kTe(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",ATe.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=NTe(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ox.serializeError=TTe;function kTe(t){return typeof t=="string"?{message:t,code:ITe.standardErrorCodes.rpc.internal}:(0,STe.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function NTe(t,e){const r=t==null?void 0:t.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}var Pa={};Object.defineProperty(Pa,"__esModule",{value:!0});Pa.RegExpString=Pa.IntNumber=Pa.BigIntString=Pa.AddressString=Pa.HexString=Pa.OpaqueType=void 0;function J3(){return t=>t}Pa.OpaqueType=J3;Pa.HexString=J3();Pa.AddressString=J3();Pa.BigIntString=J3();function LTe(t){return Math.floor(t)}Pa.IntNumber=LTe;Pa.RegExpString=J3();var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.areAddressArraysEqual=Kt.getFavicon=Kt.range=Kt.isBigNumber=Kt.ensureParsedJSONObject=Kt.ensureBigInt=Kt.ensureRegExpString=Kt.ensureIntNumber=Kt.ensureBuffer=Kt.ensureAddressString=Kt.ensureEvenLengthHexString=Kt.ensureHexString=Kt.isHexString=Kt.prepend0x=Kt.strip0x=Kt.has0xPrefix=Kt.hexStringFromIntNumber=Kt.intNumberFromHexString=Kt.bigIntStringFromBigInt=Kt.hexStringFromBuffer=Kt.hexStringToUint8Array=Kt.uint8ArrayToHex=Kt.randomBytesHex=void 0;const _1=$u,gl=Pa,Qee=/^[0-9]*$/,Zee=/^[a-f0-9]*$/;function jTe(t){return Xee(crypto.getRandomValues(new Uint8Array(t)))}Kt.randomBytesHex=jTe;function Xee(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}Kt.uint8ArrayToHex=Xee;function $Te(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}Kt.hexStringToUint8Array=$Te;function PTe(t,e=!1){const r=t.toString("hex");return(0,gl.HexString)(e?`0x${r}`:r)}Kt.hexStringFromBuffer=PTe;function RTe(t){return(0,gl.BigIntString)(t.toString(10))}Kt.bigIntStringFromBigInt=RTe;function DTe(t){return(0,gl.IntNumber)(Number(BigInt(Z3(t,!0))))}Kt.intNumberFromHexString=DTe;function OTe(t){return(0,gl.HexString)(`0x${BigInt(t).toString(16)}`)}Kt.hexStringFromIntNumber=OTe;function LL(t){return t.startsWith("0x")||t.startsWith("0X")}Kt.has0xPrefix=LL;function lx(t){return LL(t)?t.slice(2):t}Kt.strip0x=lx;function ete(t){return LL(t)?`0x${t.slice(2)}`:`0x${t}`}Kt.prepend0x=ete;function Q3(t){if(typeof t!="string")return!1;const e=lx(t).toLowerCase();return Zee.test(e)}Kt.isHexString=Q3;function tte(t,e=!1){if(typeof t=="string"){const r=lx(t).toLowerCase();if(Zee.test(r))return(0,gl.HexString)(e?`0x${r}`:r)}throw _1.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}Kt.ensureHexString=tte;function Z3(t,e=!1){let r=tte(t,!1);return r.length%2===1&&(r=(0,gl.HexString)(`0${r}`)),e?(0,gl.HexString)(`0x${r}`):r}Kt.ensureEvenLengthHexString=Z3;function FTe(t){if(typeof t=="string"){const e=lx(t).toLowerCase();if(Q3(e)&&e.length===40)return(0,gl.AddressString)(ete(e))}throw _1.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}Kt.ensureAddressString=FTe;function UTe(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(Q3(t)){const e=Z3(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw _1.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}Kt.ensureBuffer=UTe;function rte(t){if(typeof t=="number"&&Number.isInteger(t))return(0,gl.IntNumber)(t);if(typeof t=="string"){if(Qee.test(t))return(0,gl.IntNumber)(Number(t));if(Q3(t))return(0,gl.IntNumber)(Number(BigInt(Z3(t,!0))))}throw _1.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Kt.ensureIntNumber=rte;function BTe(t){if(t instanceof RegExp)return(0,gl.RegExpString)(t.toString());throw _1.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}Kt.ensureRegExpString=BTe;function zTe(t){if(t!==null&&(typeof t=="bigint"||nte(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(rte(t));if(typeof t=="string"){if(Qee.test(t))return BigInt(t);if(Q3(t))return BigInt(Z3(t,!0))}throw _1.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Kt.ensureBigInt=zTe;function WTe(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw _1.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}Kt.ensureParsedJSONObject=WTe;function nte(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}Kt.isBigNumber=nte;function HTe(t,e){return Array.from({length:e-t},(r,n)=>t+n)}Kt.range=HTe;function GTe(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}Kt.getFavicon=GTe;function qTe(t,e){return t.length===e.length&&t.every((r,n)=>r===e[n])}Kt.areAddressArraysEqual=qTe;var cu={},cx={},ux={},$i={};Object.defineProperty($i,"__esModule",{value:!0});$i.decryptContent=$i.encryptContent=$i.importKeyFromHexString=$i.exportKeyToHexString=$i.decrypt=$i.encrypt=$i.deriveSharedSecret=$i.generateKeyPair=void 0;const ite=Kt;async function VTe(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}$i.generateKeyPair=VTe;async function YTe(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}$i.deriveSharedSecret=YTe;async function ate(t,e){const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:"AES-GCM",iv:r},t,new TextEncoder().encode(e));return{iv:r,cipherText:n}}$i.encrypt=ate;async function ste(t,{iv:e,cipherText:r}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,r);return new TextDecoder().decode(n)}$i.decrypt=ste;function ote(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function KTe(t,e){const r=ote(t),n=await crypto.subtle.exportKey(r,e);return(0,ite.uint8ArrayToHex)(new Uint8Array(n))}$i.exportKeyToHexString=KTe;async function JTe(t,e){const r=ote(t),n=(0,ite.hexStringToUint8Array)(e).buffer;return await crypto.subtle.importKey(r,n,{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}$i.importKeyFromHexString=JTe;async function QTe(t,e){const r=JSON.stringify(t,(n,i)=>{if(!(i instanceof Error))return i;const a=i;return Object.assign(Object.assign({},a.code?{code:a.code}:{}),{message:a.message})});return ate(e,r)}$i.encryptContent=QTe;async function ZTe(t,e){return JSON.parse(await ste(e,t))}$i.decryptContent=ZTe;var Pu={};Object.defineProperty(Pu,"__esModule",{value:!0});Pu.ScopedLocalStorage=void 0;class X5{constructor(e,r){this.scope=e,this.module=r}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new X5("CBWSDK").clear(),new X5("walletlink").clear()}}Pu.ScopedLocalStorage=X5;Object.defineProperty(ux,"__esModule",{value:!0});ux.SCWKeyManager=void 0;const T4=$i,XTe=Pu,qC={storageKey:"ownPrivateKey",keyType:"private"},VC={storageKey:"ownPublicKey",keyType:"public"},YC={storageKey:"peerPublicKey",keyType:"public"};class eke{constructor(){this.storage=new XTe.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(YC,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(VC.storageKey),this.storage.removeItem(qC.storageKey),this.storage.removeItem(YC.storageKey)}async generateKeyPair(){const e=await(0,T4.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(qC,e.privateKey),await this.storeKey(VC,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(qC)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(VC)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(YC)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,T4.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const r=this.storage.getItem(e.storageKey);return r?(0,T4.importKeyFromHexString)(e.keyType,r):null}async storeKey(e,r){const n=await(0,T4.exportKeyToHexString)(e.keyType,r);this.storage.setItem(e.storageKey,n)}}ux.SCWKeyManager=eke;var dx={};Object.defineProperty(dx,"__esModule",{value:!0});dx.SCWStateManager=void 0;const tke=Pu,tB="accounts",rB="activeChain",nB="availableChains",iB="walletCapabilities";class rke{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var r,n;this.storage=new tke.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(nB),this._walletCapabilities=this.loadItemFromStorage(iB);const i=this.loadItemFromStorage(tB),a=this.loadItemFromStorage(rB);i&&this.updateListener.onAccountsUpdate({accounts:i,source:"storage"}),a&&this.updateListener.onChainUpdate({chain:a,source:"storage"}),this._accounts=i||[],this._activeChain=a||{id:(n=(r=e.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1}}updateAccounts(e){this._accounts=e,this.storeItemToStorage(tB,e),this.updateListener.onAccountsUpdate({accounts:e,source:"wallet"})}switchChain(e){var r;const n=(r=this.availableChains)===null||r===void 0?void 0:r.find(i=>i.id===e);return n?(n===this._activeChain||(this._activeChain=n,this.storeItemToStorage(rB,n),this.updateListener.onChainUpdate({chain:n,source:"wallet"})),!0):!1}updateAvailableChains(e){if(!e||Object.keys(e).length===0)return;const r=Object.entries(e).map(([n,i])=>({id:Number(n),rpcUrl:i}));this.availableChains=r,this.storeItemToStorage(nB,r),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(iB,e)}storeItemToStorage(e,r){this.storage.setItem(e,JSON.stringify(r))}loadItemFromStorage(e){const r=this.storage.getItem(e);return r?JSON.parse(r):void 0}clear(){this.storage.clear()}}dx.SCWStateManager=rke;Object.defineProperty(cx,"__esModule",{value:!0});cx.SCWSigner=void 0;const nke=ux,ike=dx,k4=$u,aB=Kt,N4=$i;class ake{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new nke.SCWKeyManager,this.stateManager=new ike.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:e.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){const e=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),r=await this.communicator.postRequestAndWaitForResponse(e);if("failure"in r.content)throw r.content.failure;const n=await(0,N4.importKeyFromHexString)("public",r.sender);await this.keyManager.setPeerPublicKey(n);const i=await this.decryptResponseMessage(r);this.updateInternalState({method:"eth_requestAccounts"},i);const a=i.result;if("error"in a)throw a.error;return this.stateManager.accounts}async request(e){const r=this.tryLocalHandling(e);if(r!==void 0){if(r instanceof Error)throw r;return r}await this.communicator.waitForPopupLoaded();const n=await this.sendEncryptedRequest(e),i=await this.decryptResponseMessage(n);this.updateInternalState(e,i);const a=i.result;if("error"in a)throw a.error;return a.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(e){var r;switch(e.method){case"wallet_switchEthereumChain":{const n=e.params;if(!n||!(!((r=n[0])===null||r===void 0)&&r.chainId))throw k4.standardErrors.rpc.invalidParams();const i=(0,aB.ensureIntNumber)(n[0].chainId);return this.stateManager.switchChain(i)?null:void 0}case"wallet_getCapabilities":{const n=this.stateManager.walletCapabilities;if(!n)throw k4.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return n}default:return}}async sendEncryptedRequest(e){const r=await this.keyManager.getSharedSecret();if(!r)throw k4.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const n=await(0,N4.encryptContent)({action:e,chainId:this.stateManager.activeChain.id},r),i=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(i)}async createRequestMessage(e){const r=await(0,N4.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:r,content:e,timestamp:new Date}}async decryptResponseMessage(e){const r=e.content;if("failure"in r)throw r.failure;const n=await this.keyManager.getSharedSecret();if(!n)throw k4.standardErrors.provider.unauthorized("Invalid session");return(0,N4.decryptContent)(r.encrypted,n)}updateInternalState(e,r){var n,i;const a=(n=r.data)===null||n===void 0?void 0:n.chains;a&&this.stateManager.updateAvailableChains(a);const s=(i=r.data)===null||i===void 0?void 0:i.capabilities;s&&this.stateManager.updateWalletCapabilities(s);const o=r.result;if(!("error"in o))switch(e.method){case"eth_requestAccounts":{const l=o.value;this.stateManager.updateAccounts(l);break}case"wallet_switchEthereumChain":{if(o.value!==null)return;const l=e.params,c=(0,aB.ensureIntNumber)(l[0].chainId);this.stateManager.switchChain(c);break}}}}cx.SCWSigner=ake;var fx={},OM={exports:{}},jL={exports:{}},mg=typeof Reflect=="object"?Reflect:null,sB=mg&&typeof mg.apply=="function"?mg.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},j6;mg&&typeof mg.ownKeys=="function"?j6=mg.ownKeys:Object.getOwnPropertySymbols?j6=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:j6=function(e){return Object.getOwnPropertyNames(e)};function ske(t){console&&console.warn&&console.warn(t)}var lte=Number.isNaN||function(e){return e!==e};function gn(){gn.init.call(this)}jL.exports=gn;jL.exports.once=uke;gn.EventEmitter=gn;gn.prototype._events=void 0;gn.prototype._eventsCount=0;gn.prototype._maxListeners=void 0;var oB=10;function hx(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(gn,"defaultMaxListeners",{enumerable:!0,get:function(){return oB},set:function(t){if(typeof t!="number"||t<0||lte(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");oB=t}});gn.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};gn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||lte(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 cte(t){return t._maxListeners===void 0?gn.defaultMaxListeners:t._maxListeners}gn.prototype.getMaxListeners=function(){return cte(this)};gn.prototype.emit=function(e){for(var r=[],n=1;n0&&(s=r[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=a[e];if(l===void 0)return!1;if(typeof l=="function")sB(l,this,r);else for(var c=l.length,u=pte(l,c),n=0;n0&&s.length>i&&!s.warned){s.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=t,o.type=e,o.count=s.length,ske(o)}return t}gn.prototype.addListener=function(e,r){return ute(this,e,r,!1)};gn.prototype.on=gn.prototype.addListener;gn.prototype.prependListener=function(e,r){return ute(this,e,r,!0)};function oke(){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 dte(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=oke.bind(n);return i.listener=r,n.wrapFn=i,i}gn.prototype.once=function(e,r){return hx(r),this.on(e,dte(this,e,r)),this};gn.prototype.prependOnceListener=function(e,r){return hx(r),this.prependListener(e,dte(this,e,r)),this};gn.prototype.removeListener=function(e,r){var n,i,a,s,o;if(hx(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(a=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){o=n[s].listener,a=s;break}if(a<0)return this;a===0?n.shift():lke(n,a),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,o||r)}return this};gn.prototype.off=gn.prototype.removeListener;gn.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var a=Object.keys(n),s;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function fte(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?cke(i):pte(i,i.length)}gn.prototype.listeners=function(e){return fte(this,e,!0)};gn.prototype.rawListeners=function(e){return fte(this,e,!1)};gn.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):hte.call(t,e)};gn.prototype.listenerCount=hte;function hte(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}gn.prototype.eventNames=function(){return this._eventsCount>0?j6(this._events):[]};function pte(t,e){for(var r=new Array(e),n=0;n0)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 pke(t){var e=yte(t),r=e[0],n=e[1];return(r+n)*3/4-n}function gke(t,e,r){return(e+r)*3/4-r}function mke(t){var e,r=yte(t),n=r[0],i=r[1],a=new fke(gke(t,n,i)),s=0,o=i>0?n-4:n,l;for(l=0;l>16&255,a[s++]=e>>8&255,a[s++]=e&255;return i===2&&(e=al[t.charCodeAt(l)]<<2|al[t.charCodeAt(l+1)]>>4,a[s++]=e&255),i===1&&(e=al[t.charCodeAt(l)]<<10|al[t.charCodeAt(l+1)]<<4|al[t.charCodeAt(l+2)]>>2,a[s++]=e>>8&255,a[s++]=e&255),a}function yke(t){return su[t>>18&63]+su[t>>12&63]+su[t>>6&63]+su[t&63]}function wke(t,e,r){for(var n,i=[],a=e;ao?o:s+a));return n===1?(e=t[r-1],i.push(su[e>>2]+su[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(su[e>>10]+su[e>>4&63]+su[e<<2&63]+"=")),i.join("")}var PL={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */PL.read=function(t,e,r,n,i){var a,s,o=i*8-n-1,l=(1<>1,u=-7,f=r?i-1:0,h=r?-1:1,g=t[e+f];for(f+=h,a=g&(1<<-u)-1,g>>=-u,u+=o;u>0;a=a*256+t[e+f],f+=h,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=n;u>0;s=s*256+t[e+f],f+=h,u-=8);if(a===0)a=1-c;else{if(a===l)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,n),a=a-c}return(g?-1:1)*s*Math.pow(2,a-n)};PL.write=function(t,e,r,n,i,a){var s,o,l,c=a*8-i-1,u=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,m=n?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=h/l:e+=h*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=u?(o=0,s=u):s+f>=1?(o=(e*l-1)*Math.pow(2,i),s=s+f):(o=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+g]=o&255,g+=m,o/=256,i-=8);for(s=s<0;t[r+g]=s&255,g+=m,s/=256,c-=8);t[r+g-m]|=w*128};/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */(function(t){const e=px,r=PL,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=a(),!o.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 a(){try{const K=new Uint8Array(1),F={foo:function(){return 42}};return Object.setPrototypeOf(F,Uint8Array.prototype),Object.setPrototypeOf(K,F),K.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(K){if(K>i)throw new RangeError('The value "'+K+'" is invalid for option "size"');const F=new Uint8Array(K);return Object.setPrototypeOf(F,o.prototype),F}function o(K,F,W){if(typeof K=="number"){if(typeof F=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(K)}return l(K,F,W)}o.poolSize=8192;function l(K,F,W){if(typeof K=="string")return h(K,F);if(ArrayBuffer.isView(K))return m(K);if(K==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K);if(qe(K,ArrayBuffer)||K&&qe(K.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qe(K,SharedArrayBuffer)||K&&qe(K.buffer,SharedArrayBuffer)))return w(K,F,W);if(typeof K=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ie=K.valueOf&&K.valueOf();if(ie!=null&&ie!==K)return o.from(ie,F,W);const pe=C(K);if(pe)return pe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof K[Symbol.toPrimitive]=="function")return o.from(K[Symbol.toPrimitive]("string"),F,W);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K)}o.from=function(K,F,W){return l(K,F,W)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function c(K){if(typeof K!="number")throw new TypeError('"size" argument must be of type number');if(K<0)throw new RangeError('The value "'+K+'" is invalid for option "size"')}function u(K,F,W){return c(K),K<=0?s(K):F!==void 0?typeof W=="string"?s(K).fill(F,W):s(K).fill(F):s(K)}o.alloc=function(K,F,W){return u(K,F,W)};function f(K){return c(K),s(K<0?0:v(K)|0)}o.allocUnsafe=function(K){return f(K)},o.allocUnsafeSlow=function(K){return f(K)};function h(K,F){if((typeof F!="string"||F==="")&&(F="utf8"),!o.isEncoding(F))throw new TypeError("Unknown encoding: "+F);const W=A(K,F)|0;let ie=s(W);const pe=ie.write(K,F);return pe!==W&&(ie=ie.slice(0,pe)),ie}function g(K){const F=K.length<0?0:v(K.length)|0,W=s(F);for(let ie=0;ie=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return K|0}function b(K){return+K!=K&&(K=0),o.alloc(+K)}o.isBuffer=function(F){return F!=null&&F._isBuffer===!0&&F!==o.prototype},o.compare=function(F,W){if(qe(F,Uint8Array)&&(F=o.from(F,F.offset,F.byteLength)),qe(W,Uint8Array)&&(W=o.from(W,W.offset,W.byteLength)),!o.isBuffer(F)||!o.isBuffer(W))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(F===W)return 0;let ie=F.length,pe=W.length;for(let we=0,he=Math.min(ie,pe);wepe.length?(o.isBuffer(he)||(he=o.from(he)),he.copy(pe,we)):Uint8Array.prototype.set.call(pe,he,we);else if(o.isBuffer(he))he.copy(pe,we);else throw new TypeError('"list" argument must be an Array of Buffers');we+=he.length}return pe};function A(K,F){if(o.isBuffer(K))return K.length;if(ArrayBuffer.isView(K)||qe(K,ArrayBuffer))return K.byteLength;if(typeof K!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof K);const W=K.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&W===0)return 0;let pe=!1;for(;;)switch(F){case"ascii":case"latin1":case"binary":return W;case"utf8":case"utf-8":return Ue(K).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W*2;case"hex":return W>>>1;case"base64":return Ee(K).length;default:if(pe)return ie?-1:Ue(K).length;F=(""+F).toLowerCase(),pe=!0}}o.byteLength=A;function S(K,F,W){let ie=!1;if((F===void 0||F<0)&&(F=0),F>this.length||((W===void 0||W>this.length)&&(W=this.length),W<=0)||(W>>>=0,F>>>=0,W<=F))return"";for(K||(K="utf8");;)switch(K){case"hex":return R(this,F,W);case"utf8":case"utf-8":return x(this,F,W);case"ascii":return O(this,F,W);case"latin1":case"binary":return P(this,F,W);case"base64":return k(this,F,W);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,F,W);default:if(ie)throw new TypeError("Unknown encoding: "+K);K=(K+"").toLowerCase(),ie=!0}}o.prototype._isBuffer=!0;function j(K,F,W){const ie=K[F];K[F]=K[W],K[W]=ie}o.prototype.swap16=function(){const F=this.length;if(F%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let W=0;WW&&(F+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(F,W,ie,pe,we){if(qe(F,Uint8Array)&&(F=o.from(F,F.offset,F.byteLength)),!o.isBuffer(F))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof F);if(W===void 0&&(W=0),ie===void 0&&(ie=F?F.length:0),pe===void 0&&(pe=0),we===void 0&&(we=this.length),W<0||ie>F.length||pe<0||we>this.length)throw new RangeError("out of range index");if(pe>=we&&W>=ie)return 0;if(pe>=we)return-1;if(W>=ie)return 1;if(W>>>=0,ie>>>=0,pe>>>=0,we>>>=0,this===F)return 0;let he=we-pe,Re=ie-W;const Je=Math.min(he,Re),et=this.slice(pe,we),it=F.slice(W,ie);for(let ut=0;ut2147483647?W=2147483647:W<-2147483648&&(W=-2147483648),W=+W,Ie(W)&&(W=pe?0:K.length-1),W<0&&(W=K.length+W),W>=K.length){if(pe)return-1;W=K.length-1}else if(W<0)if(pe)W=0;else return-1;if(typeof F=="string"&&(F=o.from(F,ie)),o.isBuffer(F))return F.length===0?-1:I(K,F,W,ie,pe);if(typeof F=="number")return F=F&255,typeof Uint8Array.prototype.indexOf=="function"?pe?Uint8Array.prototype.indexOf.call(K,F,W):Uint8Array.prototype.lastIndexOf.call(K,F,W):I(K,[F],W,ie,pe);throw new TypeError("val must be string, number or Buffer")}function I(K,F,W,ie,pe){let we=1,he=K.length,Re=F.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(K.length<2||F.length<2)return-1;we=2,he/=2,Re/=2,W/=2}function Je(it,ut){return we===1?it[ut]:it.readUInt16BE(ut*we)}let et;if(pe){let it=-1;for(et=W;ethe&&(W=he-Re),et=W;et>=0;et--){let it=!0;for(let ut=0;utpe&&(ie=pe)):ie=pe;const we=F.length;ie>we/2&&(ie=we/2);let he;for(he=0;he>>0,isFinite(ie)?(ie=ie>>>0,pe===void 0&&(pe="utf8")):(pe=ie,ie=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const we=this.length-W;if((ie===void 0||ie>we)&&(ie=we),F.length>0&&(ie<0||W<0)||W>this.length)throw new RangeError("Attempt to write outside buffer bounds");pe||(pe="utf8");let he=!1;for(;;)switch(pe){case"hex":return B(this,F,W,ie);case"utf8":case"utf-8":return V(this,F,W,ie);case"ascii":case"latin1":case"binary":return se(this,F,W,ie);case"base64":return Y(this,F,W,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,F,W,ie);default:if(he)throw new TypeError("Unknown encoding: "+pe);pe=(""+pe).toLowerCase(),he=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(K,F,W){return F===0&&W===K.length?e.fromByteArray(K):e.fromByteArray(K.slice(F,W))}function x(K,F,W){W=Math.min(K.length,W);const ie=[];let pe=F;for(;pe239?4:we>223?3:we>191?2:1;if(pe+Re<=W){let Je,et,it,ut;switch(Re){case 1:we<128&&(he=we);break;case 2:Je=K[pe+1],(Je&192)===128&&(ut=(we&31)<<6|Je&63,ut>127&&(he=ut));break;case 3:Je=K[pe+1],et=K[pe+2],(Je&192)===128&&(et&192)===128&&(ut=(we&15)<<12|(Je&63)<<6|et&63,ut>2047&&(ut<55296||ut>57343)&&(he=ut));break;case 4:Je=K[pe+1],et=K[pe+2],it=K[pe+3],(Je&192)===128&&(et&192)===128&&(it&192)===128&&(ut=(we&15)<<18|(Je&63)<<12|(et&63)<<6|it&63,ut>65535&&ut<1114112&&(he=ut))}}he===null?(he=65533,Re=1):he>65535&&(he-=65536,ie.push(he>>>10&1023|55296),he=56320|he&1023),ie.push(he),pe+=Re}return L(ie)}const _=4096;function L(K){const F=K.length;if(F<=_)return String.fromCharCode.apply(String,K);let W="",ie=0;for(;ieie)&&(W=ie);let pe="";for(let we=F;weie&&(F=ie),W<0?(W+=ie,W<0&&(W=0)):W>ie&&(W=ie),WW)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(F,W,ie){F=F>>>0,W=W>>>0,ie||D(F,W,this.length);let pe=this[F],we=1,he=0;for(;++he>>0,W=W>>>0,ie||D(F,W,this.length);let pe=this[F+--W],we=1;for(;W>0&&(we*=256);)pe+=this[F+--W]*we;return pe},o.prototype.readUint8=o.prototype.readUInt8=function(F,W){return F=F>>>0,W||D(F,1,this.length),this[F]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(F,W){return F=F>>>0,W||D(F,2,this.length),this[F]|this[F+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(F,W){return F=F>>>0,W||D(F,2,this.length),this[F]<<8|this[F+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(F,W){return F=F>>>0,W||D(F,4,this.length),(this[F]|this[F+1]<<8|this[F+2]<<16)+this[F+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(F,W){return F=F>>>0,W||D(F,4,this.length),this[F]*16777216+(this[F+1]<<16|this[F+2]<<8|this[F+3])},o.prototype.readBigUInt64LE=$e(function(F){F=F>>>0,me(F,"offset");const W=this[F],ie=this[F+7];(W===void 0||ie===void 0)&&be(F,this.length-8);const pe=W+this[++F]*2**8+this[++F]*2**16+this[++F]*2**24,we=this[++F]+this[++F]*2**8+this[++F]*2**16+ie*2**24;return BigInt(pe)+(BigInt(we)<>>0,me(F,"offset");const W=this[F],ie=this[F+7];(W===void 0||ie===void 0)&&be(F,this.length-8);const pe=W*2**24+this[++F]*2**16+this[++F]*2**8+this[++F],we=this[++F]*2**24+this[++F]*2**16+this[++F]*2**8+ie;return(BigInt(pe)<>>0,W=W>>>0,ie||D(F,W,this.length);let pe=this[F],we=1,he=0;for(;++he=we&&(pe-=Math.pow(2,8*W)),pe},o.prototype.readIntBE=function(F,W,ie){F=F>>>0,W=W>>>0,ie||D(F,W,this.length);let pe=W,we=1,he=this[F+--pe];for(;pe>0&&(we*=256);)he+=this[F+--pe]*we;return we*=128,he>=we&&(he-=Math.pow(2,8*W)),he},o.prototype.readInt8=function(F,W){return F=F>>>0,W||D(F,1,this.length),this[F]&128?(255-this[F]+1)*-1:this[F]},o.prototype.readInt16LE=function(F,W){F=F>>>0,W||D(F,2,this.length);const ie=this[F]|this[F+1]<<8;return ie&32768?ie|4294901760:ie},o.prototype.readInt16BE=function(F,W){F=F>>>0,W||D(F,2,this.length);const ie=this[F+1]|this[F]<<8;return ie&32768?ie|4294901760:ie},o.prototype.readInt32LE=function(F,W){return F=F>>>0,W||D(F,4,this.length),this[F]|this[F+1]<<8|this[F+2]<<16|this[F+3]<<24},o.prototype.readInt32BE=function(F,W){return F=F>>>0,W||D(F,4,this.length),this[F]<<24|this[F+1]<<16|this[F+2]<<8|this[F+3]},o.prototype.readBigInt64LE=$e(function(F){F=F>>>0,me(F,"offset");const W=this[F],ie=this[F+7];(W===void 0||ie===void 0)&&be(F,this.length-8);const pe=this[F+4]+this[F+5]*2**8+this[F+6]*2**16+(ie<<24);return(BigInt(pe)<>>0,me(F,"offset");const W=this[F],ie=this[F+7];(W===void 0||ie===void 0)&&be(F,this.length-8);const pe=(W<<24)+this[++F]*2**16+this[++F]*2**8+this[++F];return(BigInt(pe)<>>0,W||D(F,4,this.length),r.read(this,F,!0,23,4)},o.prototype.readFloatBE=function(F,W){return F=F>>>0,W||D(F,4,this.length),r.read(this,F,!1,23,4)},o.prototype.readDoubleLE=function(F,W){return F=F>>>0,W||D(F,8,this.length),r.read(this,F,!0,52,8)},o.prototype.readDoubleBE=function(F,W){return F=F>>>0,W||D(F,8,this.length),r.read(this,F,!1,52,8)};function $(K,F,W,ie,pe,we){if(!o.isBuffer(K))throw new TypeError('"buffer" argument must be a Buffer instance');if(F>pe||FK.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(F,W,ie,pe){if(F=+F,W=W>>>0,ie=ie>>>0,!pe){const Re=Math.pow(2,8*ie)-1;$(this,F,W,ie,Re,0)}let we=1,he=0;for(this[W]=F&255;++he>>0,ie=ie>>>0,!pe){const Re=Math.pow(2,8*ie)-1;$(this,F,W,ie,Re,0)}let we=ie-1,he=1;for(this[W+we]=F&255;--we>=0&&(he*=256);)this[W+we]=F/he&255;return W+ie},o.prototype.writeUint8=o.prototype.writeUInt8=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,1,255,0),this[W]=F&255,W+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,2,65535,0),this[W]=F&255,this[W+1]=F>>>8,W+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,2,65535,0),this[W]=F>>>8,this[W+1]=F&255,W+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,4,4294967295,0),this[W+3]=F>>>24,this[W+2]=F>>>16,this[W+1]=F>>>8,this[W]=F&255,W+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,4,4294967295,0),this[W]=F>>>24,this[W+1]=F>>>16,this[W+2]=F>>>8,this[W+3]=F&255,W+4};function X(K,F,W,ie,pe){Q(F,ie,pe,K,W,7);let we=Number(F&BigInt(4294967295));K[W++]=we,we=we>>8,K[W++]=we,we=we>>8,K[W++]=we,we=we>>8,K[W++]=we;let he=Number(F>>BigInt(32)&BigInt(4294967295));return K[W++]=he,he=he>>8,K[W++]=he,he=he>>8,K[W++]=he,he=he>>8,K[W++]=he,W}function le(K,F,W,ie,pe){Q(F,ie,pe,K,W,7);let we=Number(F&BigInt(4294967295));K[W+7]=we,we=we>>8,K[W+6]=we,we=we>>8,K[W+5]=we,we=we>>8,K[W+4]=we;let he=Number(F>>BigInt(32)&BigInt(4294967295));return K[W+3]=he,he=he>>8,K[W+2]=he,he=he>>8,K[W+1]=he,he=he>>8,K[W]=he,W+8}o.prototype.writeBigUInt64LE=$e(function(F,W=0){return X(this,F,W,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=$e(function(F,W=0){return le(this,F,W,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(F,W,ie,pe){if(F=+F,W=W>>>0,!pe){const Je=Math.pow(2,8*ie-1);$(this,F,W,ie,Je-1,-Je)}let we=0,he=1,Re=0;for(this[W]=F&255;++we>0)-Re&255;return W+ie},o.prototype.writeIntBE=function(F,W,ie,pe){if(F=+F,W=W>>>0,!pe){const Je=Math.pow(2,8*ie-1);$(this,F,W,ie,Je-1,-Je)}let we=ie-1,he=1,Re=0;for(this[W+we]=F&255;--we>=0&&(he*=256);)F<0&&Re===0&&this[W+we+1]!==0&&(Re=1),this[W+we]=(F/he>>0)-Re&255;return W+ie},o.prototype.writeInt8=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,1,127,-128),F<0&&(F=255+F+1),this[W]=F&255,W+1},o.prototype.writeInt16LE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,2,32767,-32768),this[W]=F&255,this[W+1]=F>>>8,W+2},o.prototype.writeInt16BE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,2,32767,-32768),this[W]=F>>>8,this[W+1]=F&255,W+2},o.prototype.writeInt32LE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,4,2147483647,-2147483648),this[W]=F&255,this[W+1]=F>>>8,this[W+2]=F>>>16,this[W+3]=F>>>24,W+4},o.prototype.writeInt32BE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,4,2147483647,-2147483648),F<0&&(F=4294967295+F+1),this[W]=F>>>24,this[W+1]=F>>>16,this[W+2]=F>>>8,this[W+3]=F&255,W+4},o.prototype.writeBigInt64LE=$e(function(F,W=0){return X(this,F,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=$e(function(F,W=0){return le(this,F,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(K,F,W,ie,pe,we){if(W+ie>K.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("Index out of range")}function ee(K,F,W,ie,pe){return F=+F,W=W>>>0,pe||H(K,F,W,4),r.write(K,F,W,ie,23,4),W+4}o.prototype.writeFloatLE=function(F,W,ie){return ee(this,F,W,!0,ie)},o.prototype.writeFloatBE=function(F,W,ie){return ee(this,F,W,!1,ie)};function J(K,F,W,ie,pe){return F=+F,W=W>>>0,pe||H(K,F,W,8),r.write(K,F,W,ie,52,8),W+8}o.prototype.writeDoubleLE=function(F,W,ie){return J(this,F,W,!0,ie)},o.prototype.writeDoubleBE=function(F,W,ie){return J(this,F,W,!1,ie)},o.prototype.copy=function(F,W,ie,pe){if(!o.isBuffer(F))throw new TypeError("argument should be a Buffer");if(ie||(ie=0),!pe&&pe!==0&&(pe=this.length),W>=F.length&&(W=F.length),W||(W=0),pe>0&&pe=this.length)throw new RangeError("Index out of range");if(pe<0)throw new RangeError("sourceEnd out of bounds");pe>this.length&&(pe=this.length),F.length-W>>0,ie=ie===void 0?this.length:ie>>>0,F||(F=0);let we;if(typeof F=="number")for(we=W;we2**32?pe=z(String(W)):typeof W=="bigint"&&(pe=String(W),(W>BigInt(2)**BigInt(32)||W<-(BigInt(2)**BigInt(32)))&&(pe=z(pe)),pe+="n"),ie+=` It must be ${F}. Received ${pe}`,ie},RangeError);function z(K){let F="",W=K.length;const ie=K[0]==="-"?1:0;for(;W>=ie+4;W-=3)F=`_${K.slice(W-3,W)}${F}`;return`${K.slice(0,W)}${F}`}function G(K,F,W){me(F,"offset"),(K[F]===void 0||K[F+W]===void 0)&&be(F,K.length-(W+1))}function Q(K,F,W,ie,pe,we){if(K>W||K= 0${he} and < 2${he} ** ${(we+1)*8}${he}`:Re=`>= -(2${he} ** ${(we+1)*8-1}${he}) and < 2 ** ${(we+1)*8-1}${he}`,new te.ERR_OUT_OF_RANGE("value",Re,K)}G(ie,pe,we)}function me(K,F){if(typeof K!="number")throw new te.ERR_INVALID_ARG_TYPE(F,"number",K)}function be(K,F,W){throw Math.floor(K)!==K?(me(K,W),new te.ERR_OUT_OF_RANGE("offset","an integer",K)):F<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${F}`,K)}const Ce=/[^+/0-9A-Za-z-_]/g;function Fe(K){if(K=K.split("=")[0],K=K.trim().replace(Ce,""),K.length<2)return"";for(;K.length%4!==0;)K=K+"=";return K}function Ue(K,F){F=F||1/0;let W;const ie=K.length;let pe=null;const we=[];for(let he=0;he55295&&W<57344){if(!pe){if(W>56319){(F-=3)>-1&&we.push(239,191,189);continue}else if(he+1===ie){(F-=3)>-1&&we.push(239,191,189);continue}pe=W;continue}if(W<56320){(F-=3)>-1&&we.push(239,191,189),pe=W;continue}W=(pe-55296<<10|W-56320)+65536}else pe&&(F-=3)>-1&&we.push(239,191,189);if(pe=null,W<128){if((F-=1)<0)break;we.push(W)}else if(W<2048){if((F-=2)<0)break;we.push(W>>6|192,W&63|128)}else if(W<65536){if((F-=3)<0)break;we.push(W>>12|224,W>>6&63|128,W&63|128)}else if(W<1114112){if((F-=4)<0)break;we.push(W>>18|240,W>>12&63|128,W>>6&63|128,W&63|128)}else throw new Error("Invalid code point")}return we}function Ke(K){const F=[];for(let W=0;W>8,pe=W%256,we.push(pe),we.push(ie);return we}function Ee(K){return e.toByteArray(Fe(K))}function He(K,F,W,ie){let pe;for(pe=0;pe=F.length||pe>=K.length);++pe)F[pe+W]=K[pe];return pe}function qe(K,F){return K instanceof F||K!=null&&K.constructor!=null&&K.constructor.name!=null&&K.constructor.name===F.name}function Ie(K){return K!==K}const Ne=function(){const K="0123456789abcdef",F=new Array(256);for(let W=0;W<16;++W){const ie=W*16;for(let pe=0;pe<16;++pe)F[ie+pe]=K[W]+K[pe]}return F}();function $e(K){return typeof BigInt>"u"?je:K}function je(){throw new Error("BigInt not supported")}})(X3);var JC,lB;function bke(){if(lB)return JC;lB=1;function t(m,w){var C=Object.keys(m);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(m);w&&(v=v.filter(function(b){return Object.getOwnPropertyDescriptor(m,b).enumerable})),C.push.apply(C,v)}return C}function e(m){for(var w=1;w0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(C){var v={data:C,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var C=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,C}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(C){if(this.length===0)return"";for(var v=this.head,b=""+v.data;v=v.next;)b+=C+v.data;return b}},{key:"concat",value:function(C){if(this.length===0)return c.alloc(0);for(var v=c.allocUnsafe(C>>>0),b=this.head,A=0;b;)g(b.data,v,A),A+=b.data.length,b=b.next;return v}},{key:"consume",value:function(C,v){var b;return CS.length?S.length:C;if(j===S.length?A+=S:A+=S.slice(0,C),C-=j,C===0){j===S.length?(++b,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=S.slice(j));break}++b}return this.length-=b,A}},{key:"_getBuffer",value:function(C){var v=c.allocUnsafe(C),b=this.head,A=1;for(b.data.copy(v),C-=b.data.length;b=b.next;){var S=b.data,j=C>S.length?S.length:C;if(S.copy(v,v.length-C,0,j),C-=j,C===0){j===S.length?(++A,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=S.slice(j));break}++A}return this.length-=A,v}},{key:h,value:function(C,v){return f(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),m}(),JC}function xke(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(FM,this,t)):process.nextTick(FM,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(a){!e&&a?r._writableState?r._writableState.errorEmitted?process.nextTick($6,r):(r._writableState.errorEmitted=!0,process.nextTick(cB,r,a)):process.nextTick(cB,r,a):e?(process.nextTick($6,r),e(a)):process.nextTick($6,r)}),this)}function cB(t,e){FM(t,e),$6(t)}function $6(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Eke(){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 FM(t,e){t.emit("error",e)}function _ke(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var wte={destroy:xke,undestroy:Eke,errorOrDestroy:_ke},C1={};function Cke(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var vte={};function Il(t,e,r){r||(r=Error);function n(a,s,o){return typeof e=="string"?e:e(a,s,o)}var i=function(a){Cke(s,a);function s(o,l,c){return a.call(this,n(o,l,c))||this}return s}(r);i.prototype.name=r.name,i.prototype.code=t,vte[t]=i}function uB(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function Ske(t,e,r){return t.substr(0,e.length)===e}function Ake(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Ike(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}Il("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);Il("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&Ske(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(Ake(t," argument"))i="The ".concat(t," ").concat(n," ").concat(uB(e,"type"));else{var a=Ike(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(a," ").concat(n," ").concat(uB(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);Il("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Il("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});Il("ERR_STREAM_PREMATURE_CLOSE","Premature close");Il("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});Il("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Il("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Il("ERR_STREAM_WRITE_AFTER_END","write after end");Il("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Il("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);Il("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");C1.codes=vte;var Mke=C1.codes.ERR_INVALID_OPT_VALUE;function Tke(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function kke(t,e,r,n){var i=Tke(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new Mke(a,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var bte={getHighWaterMark:kke},Nke=Lke;function Lke(t,e){if(QC("noDeprecation"))return t;var r=!1;function n(){if(!r){if(QC("throwDeprecation"))throw new Error(e);QC("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function QC(t){try{if(!Xt.localStorage)return!1}catch{return!1}var e=Xt.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var ZC,dB;function xte(){if(dB)return ZC;dB=1,ZC=B;function t(ee){var J=this;this.next=null,this.entry=null,this.finish=function(){H(J,ee)}}var e;B.WritableState=U;var r={deprecate:Nke},n=mte,i=X3.Buffer,a=(typeof Xt<"u"?Xt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(ee){return i.from(ee)}function o(ee){return i.isBuffer(ee)||ee instanceof a}var l=wte,c=bte,u=c.getHighWaterMark,f=C1.codes,h=f.ERR_INVALID_ARG_TYPE,g=f.ERR_METHOD_NOT_IMPLEMENTED,m=f.ERR_MULTIPLE_CALLBACK,w=f.ERR_STREAM_CANNOT_PIPE,C=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,A=f.ERR_UNKNOWN_ENCODING,S=l.errorOrDestroy;gs(B,n);function j(){}function U(ee,J,te){e=e||Hg(),ee=ee||{},typeof te!="boolean"&&(te=J instanceof e),this.objectMode=!!ee.objectMode,te&&(this.objectMode=this.objectMode||!!ee.writableObjectMode),this.highWaterMark=u(this,ee,"writableHighWaterMark",te),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var re=ee.decodeStrings===!1;this.decodeStrings=!re,this.defaultEncoding=ee.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(z){L(J,z)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=ee.emitClose!==!1,this.autoDestroy=!!ee.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}U.prototype.getBuffer=function(){for(var J=this.bufferedRequest,te=[];J;)te.push(J),J=J.next;return te},function(){try{Object.defineProperty(U.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(B,Symbol.hasInstance,{value:function(J){return I.call(this,J)?!0:this!==B?!1:J&&J._writableState instanceof U}})):I=function(J){return J instanceof this};function B(ee){e=e||Hg();var J=this instanceof e;if(!J&&!I.call(B,this))return new B(ee);this._writableState=new U(ee,this,J),this.writable=!0,ee&&(typeof ee.write=="function"&&(this._write=ee.write),typeof ee.writev=="function"&&(this._writev=ee.writev),typeof ee.destroy=="function"&&(this._destroy=ee.destroy),typeof ee.final=="function"&&(this._final=ee.final)),n.call(this)}B.prototype.pipe=function(){S(this,new w)};function V(ee,J){var te=new b;S(ee,te),process.nextTick(J,te)}function se(ee,J,te,re){var z;return te===null?z=new v:typeof te!="string"&&!J.objectMode&&(z=new h("chunk",["string","Buffer"],te)),z?(S(ee,z),process.nextTick(re,z),!1):!0}B.prototype.write=function(ee,J,te){var re=this._writableState,z=!1,G=!re.objectMode&&o(ee);return G&&!i.isBuffer(ee)&&(ee=s(ee)),typeof J=="function"&&(te=J,J=null),G?J="buffer":J||(J=re.defaultEncoding),typeof te!="function"&&(te=j),re.ending?V(this,te):(G||se(this,re,ee,te))&&(re.pendingcb++,z=N(this,re,G,ee,J,te)),z},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){var ee=this._writableState;ee.corked&&(ee.corked--,!ee.writing&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&R(this,ee))},B.prototype.setDefaultEncoding=function(J){if(typeof J=="string"&&(J=J.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((J+"").toLowerCase())>-1))throw new A(J);return this._writableState.defaultEncoding=J,this},Object.defineProperty(B.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Y(ee,J,te){return!ee.objectMode&&ee.decodeStrings!==!1&&typeof J=="string"&&(J=i.from(J,te)),J}Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(ee,J,te,re,z,G){if(!te){var Q=Y(J,re,z);re!==Q&&(te=!0,z="buffer",re=Q)}var me=J.objectMode?1:re.length;J.length+=me;var be=J.length */(function(t,e){var r=X3,n=r.Buffer;function i(s,o){for(var l in s)o[l]=s[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=a);function a(s,o,l){return n(s,o,l)}a.prototype=Object.create(n.prototype),i(n,a),a.from=function(s,o,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return n(s,o,l)},a.alloc=function(s,o,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var c=n(s);return o!==void 0?typeof l=="string"?c.fill(o,l):c.fill(o):c.fill(0),c},a.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n(s)},a.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}})(UM,UM.exports);var Sh=UM.exports,hB;function pB(){if(hB)return eS;hB=1;var t=Sh.Buffer,e=t.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(v){if(!v)return"utf8";for(var b;;)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(b)return;v=(""+v).toLowerCase(),b=!0}}function n(v){var b=r(v);if(typeof b!="string"&&(t.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return b||v}eS.StringDecoder=i;function i(v){this.encoding=n(v);var b;switch(this.encoding){case"utf16le":this.text=f,this.end=h,b=4;break;case"utf8":this.fillLast=l,b=4;break;case"base64":this.text=g,this.end=m,b=3;break;default:this.write=w,this.end=C;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(b)}i.prototype.write=function(v){if(v.length===0)return"";var b,A;if(this.lastNeed){if(b=this.fillLast(v),b===void 0)return"";A=this.lastNeed,this.lastNeed=0}else A=0;return A>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function s(v,b,A){var S=b.length-1;if(S=0?(j>0&&(v.lastNeed=j-1),j):--S=0?(j>0&&(v.lastNeed=j-2),j):--S=0?(j>0&&(j===2?j=0:v.lastNeed=j-3),j):0))}function o(v,b,A){if((b[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&b.length>1){if((b[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&b.length>2&&(b[2]&192)!==128)return v.lastNeed=2,"�"}}function l(v){var b=this.lastTotal-this.lastNeed,A=o(this,v);if(A!==void 0)return A;if(this.lastNeed<=v.length)return v.copy(this.lastChar,b,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,b,0,v.length),this.lastNeed-=v.length}function c(v,b){var A=s(this,v,b);if(!this.lastNeed)return v.toString("utf8",b);this.lastTotal=A;var S=v.length-(A-this.lastNeed);return v.copy(this.lastChar,0,S),v.toString("utf8",b,S)}function u(v){var b=v&&v.length?this.write(v):"";return this.lastNeed?b+"�":b}function f(v,b){if((v.length-b)%2===0){var A=v.toString("utf16le",b);if(A){var S=A.charCodeAt(A.length-1);if(S>=55296&&S<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],A.slice(0,-1)}return A}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",b,v.length-1)}function h(v){var b=v&&v.length?this.write(v):"";if(this.lastNeed){var A=this.lastTotal-this.lastNeed;return b+this.lastChar.toString("utf16le",0,A)}return b}function g(v,b){var A=(v.length-b)%3;return A===0?v.toString("base64",b):(this.lastNeed=3-A,this.lastTotal=3,A===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",b,v.length-A))}function m(v){var b=v&&v.length?this.write(v):"";return this.lastNeed?b+this.lastChar.toString("base64",0,3-this.lastNeed):b}function w(v){return v.toString(this.encoding)}function C(v){return v&&v.length?this.write(v):""}return eS}var gB=C1.codes.ERR_STREAM_PREMATURE_CLOSE;function jke(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof Q!="string"&&!Fe.objectMode&&Object.getPrototypeOf(Q)!==n.prototype&&(Q=a(Q)),be)Fe.endEmitted?j(G,new v):Y(G,Fe,Q,!0);else if(Fe.ended)j(G,new w);else{if(Fe.destroyed)return!1;Fe.reading=!1,Fe.decoder&&!me?(Q=Fe.decoder.write(Q),Fe.objectMode||Q.length!==0?Y(G,Fe,Q,!1):R(G,Fe)):Y(G,Fe,Q,!1)}else be||(Fe.reading=!1,R(G,Fe))}return!Fe.ended&&(Fe.length=k?G=k:(G--,G|=G>>>1,G|=G>>>2,G|=G>>>4,G|=G>>>8,G|=G>>>16,G++),G}function _(G,Q){return G<=0||Q.length===0&&Q.ended?0:Q.objectMode?1:G!==G?Q.flowing&&Q.length?Q.buffer.head.data.length:Q.length:(G>Q.highWaterMark&&(Q.highWaterMark=x(G)),G<=Q.length?G:Q.ended?Q.length:(Q.needReadable=!0,0))}V.prototype.read=function(G){l("read",G),G=parseInt(G,10);var Q=this._readableState,me=G;if(G!==0&&(Q.emittedReadable=!1),G===0&&Q.needReadable&&((Q.highWaterMark!==0?Q.length>=Q.highWaterMark:Q.length>0)||Q.ended))return l("read: emitReadable",Q.length,Q.ended),Q.length===0&&Q.ended?te(this):O(this),null;if(G=_(G,Q),G===0&&Q.ended)return Q.length===0&&te(this),null;var be=Q.needReadable;l("need readable",be),(Q.length===0||Q.length-G0?Ce=J(G,Q):Ce=null,Ce===null?(Q.needReadable=Q.length<=Q.highWaterMark,G=0):(Q.length-=G,Q.awaitDrain=0),Q.length===0&&(Q.ended||(Q.needReadable=!0),me!==G&&Q.ended&&te(this)),Ce!==null&&this.emit("data",Ce),Ce};function L(G,Q){if(l("onEofChunk"),!Q.ended){if(Q.decoder){var me=Q.decoder.end();me&&me.length&&(Q.buffer.push(me),Q.length+=Q.objectMode?1:me.length)}Q.ended=!0,Q.sync?O(G):(Q.needReadable=!1,Q.emittedReadable||(Q.emittedReadable=!0,P(G)))}}function O(G){var Q=G._readableState;l("emitReadable",Q.needReadable,Q.emittedReadable),Q.needReadable=!1,Q.emittedReadable||(l("emitReadable",Q.flowing),Q.emittedReadable=!0,process.nextTick(P,G))}function P(G){var Q=G._readableState;l("emitReadable_",Q.destroyed,Q.length,Q.ended),!Q.destroyed&&(Q.length||Q.ended)&&(G.emit("readable"),Q.emittedReadable=!1),Q.needReadable=!Q.flowing&&!Q.ended&&Q.length<=Q.highWaterMark,ee(G)}function R(G,Q){Q.readingMore||(Q.readingMore=!0,process.nextTick(M,G,Q))}function M(G,Q){for(;!Q.reading&&!Q.ended&&(Q.length1&&z(be.pipes,G)!==-1)&&!Ee&&(l("false write response, pause",be.awaitDrain),be.awaitDrain++),me.pause())}function Ie(K){l("onerror",K),je(),G.removeListener("error",Ie),e(G,"error")===0&&j(G,K)}I(G,"error",Ie);function Ne(){G.removeListener("finish",$e),je()}G.once("close",Ne);function $e(){l("onfinish"),G.removeListener("close",Ne),je()}G.once("finish",$e);function je(){l("unpipe"),me.unpipe(G)}return G.emit("pipe",me),be.flowing||(l("pipe resume"),me.resume()),G};function D(G){return function(){var me=G._readableState;l("pipeOnDrain",me.awaitDrain),me.awaitDrain&&me.awaitDrain--,me.awaitDrain===0&&e(G,"data")&&(me.flowing=!0,ee(G))}}V.prototype.unpipe=function(G){var Q=this._readableState,me={hasUnpiped:!1};if(Q.pipesCount===0)return this;if(Q.pipesCount===1)return G&&G!==Q.pipes?this:(G||(G=Q.pipes),Q.pipes=null,Q.pipesCount=0,Q.flowing=!1,G&&G.emit("unpipe",this,me),this);if(!G){var be=Q.pipes,Ce=Q.pipesCount;Q.pipes=null,Q.pipesCount=0,Q.flowing=!1;for(var Fe=0;Fe0,be.flowing!==!1&&this.resume()):G==="readable"&&!be.endEmitted&&!be.readableListening&&(be.readableListening=be.needReadable=!0,be.flowing=!1,be.emittedReadable=!1,l("on readable",be.length,be.reading),be.length?O(this):be.reading||process.nextTick(X,this)),me},V.prototype.addListener=V.prototype.on,V.prototype.removeListener=function(G,Q){var me=r.prototype.removeListener.call(this,G,Q);return G==="readable"&&process.nextTick($,this),me},V.prototype.removeAllListeners=function(G){var Q=r.prototype.removeAllListeners.apply(this,arguments);return(G==="readable"||G===void 0)&&process.nextTick($,this),Q};function $(G){var Q=G._readableState;Q.readableListening=G.listenerCount("readable")>0,Q.resumeScheduled&&!Q.paused?Q.flowing=!0:G.listenerCount("data")>0&&G.resume()}function X(G){l("readable nexttick read 0"),G.read(0)}V.prototype.resume=function(){var G=this._readableState;return G.flowing||(l("resume"),G.flowing=!G.readableListening,le(this,G)),G.paused=!1,this};function le(G,Q){Q.resumeScheduled||(Q.resumeScheduled=!0,process.nextTick(H,G,Q))}function H(G,Q){l("resume",Q.reading),Q.reading||G.read(0),Q.resumeScheduled=!1,G.emit("resume"),ee(G),Q.flowing&&!Q.reading&&G.read(0)}V.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ee(G){var Q=G._readableState;for(l("flow",Q.flowing);Q.flowing&&G.read()!==null;);}V.prototype.wrap=function(G){var Q=this,me=this._readableState,be=!1;G.on("end",function(){if(l("wrapped end"),me.decoder&&!me.ended){var Ue=me.decoder.end();Ue&&Ue.length&&Q.push(Ue)}Q.push(null)}),G.on("data",function(Ue){if(l("wrapped data"),me.decoder&&(Ue=me.decoder.write(Ue)),!(me.objectMode&&Ue==null)&&!(!me.objectMode&&(!Ue||!Ue.length))){var Ke=Q.push(Ue);Ke||(be=!0,G.pause())}});for(var Ce in G)this[Ce]===void 0&&typeof G[Ce]=="function"&&(this[Ce]=function(Ke){return function(){return G[Ke].apply(G,arguments)}}(Ce));for(var Fe=0;Fe=Q.length?(Q.decoder?me=Q.buffer.join(""):Q.buffer.length===1?me=Q.buffer.first():me=Q.buffer.concat(Q.length),Q.buffer.clear()):me=Q.buffer.consume(G,Q.decoder),me}function te(G){var Q=G._readableState;l("endReadable",Q.endEmitted),Q.endEmitted||(Q.ended=!0,process.nextTick(re,Q,G))}function re(G,Q){if(l("endReadableNT",G.endEmitted,G.length),!G.endEmitted&&G.length===0&&(G.endEmitted=!0,Q.readable=!1,Q.emit("end"),G.autoDestroy)){var me=Q._writableState;(!me||me.autoDestroy&&me.finished)&&Q.destroy()}}typeof Symbol=="function"&&(V.from=function(G,Q){return S===void 0&&(S=Dke()),S(V,G,Q)});function z(G,Q){for(var me=0,be=G.length;me0;return Kke(s,l,c,function(u){i||(i=u),u&&a.forEach(xB),!l&&(a.forEach(xB),n(i))})});return e.reduce(Jke)}var Xke=Zke;(function(t,e){e=t.exports=_te(),e.Stream=e,e.Readable=e,e.Writable=xte(),e.Duplex=Hg(),e.Transform=Cte,e.PassThrough=Hke,e.finished=RL,e.pipeline=Xke})(OM,OM.exports);var Ite=OM.exports;const{Transform:eNe}=Ite;var tNe=t=>class Mte extends eNe{constructor(r,n,i,a,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=a,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let a=null;try{this.update(r,n)}catch(s){a=s}i(a)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.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 Buffer.isBuffer(r)||(r=Buffer.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 Mte(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:rNe}=Ite;var nNe=t=>class Tte extends rNe{constructor(r,n,i,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=a,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let a=null;try{this.update(r,n)}catch(s){a=s}i(a)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.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 Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Tte(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const iNe=tNe,aNe=nNe;var sNe=function(t){const e=iNe(t),r=aNe(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},kte={};const EB=[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];kte.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],o=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],u=t[8]^t[18]^t[28]^t[38]^t[48],f=t[9]^t[19]^t[29]^t[39]^t[49];let h=u^(i<<1|a>>>31),g=f^(a<<1|i>>>31);const m=t[0]^h,w=t[1]^g,C=t[10]^h,v=t[11]^g,b=t[20]^h,A=t[21]^g,S=t[30]^h,j=t[31]^g,U=t[40]^h,I=t[41]^g;h=r^(s<<1|o>>>31),g=n^(o<<1|s>>>31);const B=t[2]^h,V=t[3]^g,se=t[12]^h,Y=t[13]^g,N=t[22]^h,k=t[23]^g,x=t[32]^h,_=t[33]^g,L=t[42]^h,O=t[43]^g;h=i^(l<<1|c>>>31),g=a^(c<<1|l>>>31);const P=t[4]^h,R=t[5]^g,M=t[14]^h,D=t[15]^g,$=t[24]^h,X=t[25]^g,le=t[34]^h,H=t[35]^g,ee=t[44]^h,J=t[45]^g;h=s^(u<<1|f>>>31),g=o^(f<<1|u>>>31);const te=t[6]^h,re=t[7]^g,z=t[16]^h,G=t[17]^g,Q=t[26]^h,me=t[27]^g,be=t[36]^h,Ce=t[37]^g,Fe=t[46]^h,Ue=t[47]^g;h=l^(r<<1|n>>>31),g=c^(n<<1|r>>>31);const Ke=t[8]^h,lt=t[9]^g,Ee=t[18]^h,He=t[19]^g,qe=t[28]^h,Ie=t[29]^g,Ne=t[38]^h,$e=t[39]^g,je=t[48]^h,K=t[49]^g,F=m,W=w,ie=v<<4|C>>>28,pe=C<<4|v>>>28,we=b<<3|A>>>29,he=A<<3|b>>>29,Re=j<<9|S>>>23,Je=S<<9|j>>>23,et=U<<18|I>>>14,it=I<<18|U>>>14,ut=B<<1|V>>>31,pt=V<<1|B>>>31,tr=Y<<12|se>>>20,zt=se<<12|Y>>>20,At=N<<10|k>>>22,mt=k<<10|N>>>22,St=_<<13|x>>>19,dt=x<<13|_>>>19,Nt=L<<2|O>>>30,Rt=O<<2|L>>>30,gt=R<<30|P>>>2,qt=P<<30|R>>>2,Wt=M<<6|D>>>26,ot=D<<6|M>>>26,Vt=X<<11|$>>>21,Ft=$<<11|X>>>21,yt=le<<15|H>>>17,Ze=H<<15|le>>>17,Pt=J<<29|ee>>>3,xt=ee<<29|J>>>3,Jt=te<<28|re>>>4,Cr=re<<28|te>>>4,Gt=G<<23|z>>>9,Sr=z<<23|G>>>9,cr=Q<<25|me>>>7,br=me<<25|Q>>>7,Z=be<<21|Ce>>>11,ae=Ce<<21|be>>>11,de=Ue<<24|Fe>>>8,ue=Fe<<24|Ue>>>8,ve=Ke<<27|lt>>>5,Le=lt<<27|Ke>>>5,Ge=Ee<<20|He>>>12,Be=He<<20|Ee>>>12,tt=Ie<<7|qe>>>25,vt=qe<<7|Ie>>>25,Lt=Ne<<8|$e>>>24,Ct=$e<<8|Ne>>>24,ir=je<<14|K>>>18,Zt=K<<14|je>>>18;t[0]=F^~tr&Vt,t[1]=W^~zt&Ft,t[10]=Jt^~Ge&we,t[11]=Cr^~Be&he,t[20]=ut^~Wt&cr,t[21]=pt^~ot&br,t[30]=ve^~ie&At,t[31]=Le^~pe&mt,t[40]=gt^~Gt&tt,t[41]=qt^~Sr&vt,t[2]=tr^~Vt&Z,t[3]=zt^~Ft&ae,t[12]=Ge^~we&St,t[13]=Be^~he&dt,t[22]=Wt^~cr&Lt,t[23]=ot^~br&Ct,t[32]=ie^~At&yt,t[33]=pe^~mt&Ze,t[42]=Gt^~tt&Re,t[43]=Sr^~vt&Je,t[4]=Vt^~Z&ir,t[5]=Ft^~ae&Zt,t[14]=we^~St&Pt,t[15]=he^~dt&xt,t[24]=cr^~Lt&et,t[25]=br^~Ct&it,t[34]=At^~yt&de,t[35]=mt^~Ze&ue,t[44]=tt^~Re&Nt,t[45]=vt^~Je&Rt,t[6]=Z^~ir&F,t[7]=ae^~Zt&W,t[16]=St^~Pt&Jt,t[17]=dt^~xt&Cr,t[26]=Lt^~et&ut,t[27]=Ct^~it&pt,t[36]=yt^~de&ve,t[37]=Ze^~ue&Le,t[46]=Re^~Nt>,t[47]=Je^~Rt&qt,t[8]=ir^~F&tr,t[9]=Zt^~W&zt,t[18]=Pt^~Jt&Ge,t[19]=xt^~Cr&Be,t[28]=et^~ut&Wt,t[29]=it^~pt&ot,t[38]=de^~ve&ie,t[39]=ue^~Le&pe,t[48]=Nt^~gt&Gt,t[49]=Rt^~qt&Sr,t[0]^=EB[e*2],t[1]^=EB[e*2+1]}};const e8=kte;function Pm(){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}Pm.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};Pm.prototype.absorb=function(t){for(let e=0;e>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(e8.p1600(this.state),this.count=0);return e};Pm.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var oNe=Pm,lNe=sNe(oNe);const cNe=lNe;function Nte(t){return Buffer.allocUnsafe(t).fill(0)}function uNe(t){return t.toString(2).length}function Lte(t,e){let r=t.toString(16);r.length%2!==0&&(r="0"+r);const n=r.match(/.{1,2}/g).map(i=>parseInt(i,16));for(;n.length"u")throw new Error("Not an array?");if(r=Ote(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(a in e)i.push(Kc(t,e[a]));if(r==="dynamic"){var s=Kc("uint256",e.length);i.unshift(s)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([Kc("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,Xa.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=yg(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return Xa.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=yg(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);n=h0(e);const o=Xa.bitLengthFromBigInt(n);if(o>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+o);if(n<0)throw new Error("Supplied uint is negative");return Xa.bufferBEFromBigInt(n,32)}else if(t.startsWith("int")){if(r=yg(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);n=h0(e);const o=Xa.bitLengthFromBigInt(n);if(o>r)throw new Error("Supplied int exceeds width: "+r+" vs "+o);const l=Xa.twosFromBigInt(n,256);return Xa.bufferBEFromBigInt(l,32)}else if(t.startsWith("ufixed")){if(r=_B(t),n=h0(e),n<0)throw new Error("Supplied ufixed is negative");return Kc("uint256",n*BigInt(2)**BigInt(r[1]))}else if(t.startsWith("fixed"))return r=_B(t),Kc("int256",h0(e)*BigInt(2)**BigInt(r[1]))}throw new Error("Unsupported or invalid type: "+t)}function mNe(t){return t==="string"||t==="bytes"||Ote(t)==="dynamic"}function yNe(t){return t.lastIndexOf("]")===t.length-1}function wNe(t,e){var r=[],n=[],i=32*t.length;for(var a in t){var s=Dte(t[a]),o=e[a],l=Kc(s,o);mNe(s)?(r.push(Kc("uint256",i)),n.push(l),i+=l.length):r.push(l)}return Buffer.concat(r.concat(n))}function Fte(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],a=0;a32)throw new Error("Invalid bytes width: "+r);i.push(Xa.setLengthRight(o,r))}else if(s.startsWith("uint")){if(r=yg(s),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);n=h0(o);const l=Xa.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+l);i.push(Xa.bufferBEFromBigInt(n,r/8))}else if(s.startsWith("int")){if(r=yg(s),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);n=h0(o);const l=Xa.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied int exceeds width: "+r+" vs "+l);const c=Xa.twosFromBigInt(n,r);i.push(Xa.bufferBEFromBigInt(c,r/8))}else throw new Error("Unsupported or invalid type: "+s)}return Buffer.concat(i)}function vNe(t,e){return Xa.keccak(Fte(t,e))}var bNe={rawEncode:wNe,solidityPack:Fte,soliditySHA3:vNe};const Vl=Rte,Uy=bNe,Ute={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"]},aS={encodeData(t,e,r,n=!0){const i=["bytes32"],a=[this.hashType(t,r)];if(n){const s=(o,l,c)=>{if(r[l]!==void 0)return["bytes32",c==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Vl.keccak(this.encodeData(l,c,r,n))];if(c===void 0)throw new Error(`missing value for field ${o} of type ${l}`);if(l==="bytes")return["bytes32",Vl.keccak(c)];if(l==="string")return typeof c=="string"&&(c=Buffer.from(c,"utf8")),["bytes32",Vl.keccak(c)];if(l.lastIndexOf("]")===l.length-1){const u=l.slice(0,l.lastIndexOf("[")),f=c.map(h=>s(o,u,h));return["bytes32",Vl.keccak(Uy.rawEncode(f.map(([h])=>h),f.map(([,h])=>h)))]}return[l,c]};for(const o of r[t]){const[l,c]=s(o.name,o.type,e[o.name]);i.push(l),a.push(c)}}else for(const s of r[t]){let o=e[s.name];if(o!==void 0)if(s.type==="bytes")i.push("bytes32"),o=Vl.keccak(o),a.push(o);else if(s.type==="string")i.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=Vl.keccak(o),a.push(o);else if(r[s.type]!==void 0)i.push("bytes32"),o=Vl.keccak(this.encodeData(s.type,o,r,n)),a.push(o);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(s.type),a.push(o)}}return Uy.rawEncode(i,a)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:s,type:o})=>o+" "+s).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return Vl.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return Vl.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Ute.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),Vl.keccak(Buffer.concat(n))}};var xNe={TYPED_MESSAGE_SCHEMA:Ute,TypedDataUtils:aS,hashForSignTypedDataLegacy:function(t){return ENe(t.data)},hashForSignTypedData_v3:function(t){return aS.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return aS.hash(t.data)}};function ENe(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(a){return a.type==="bytes"?Vl.toBuffer(a.value):a.value}),n=t.map(function(a){return a.type}),i=t.map(function(a){if(!a.name)throw e;return a.type+" "+a.name});return Uy.soliditySHA3(["bytes32","bytes32"],[Uy.soliditySHA3(new Array(t.length).fill("string"),i),Uy.soliditySHA3(n,r)])}var mu={};Object.defineProperty(mu,"__esModule",{value:!0});mu.APP_VERSION_KEY=mu.LOCAL_STORAGE_ADDRESSES_KEY=mu.WALLET_USER_NAME_KEY=void 0;mu.WALLET_USER_NAME_KEY="walletUsername";mu.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";mu.APP_VERSION_KEY="AppVersion";var ev={};Object.defineProperty(ev,"__esModule",{value:!0});ev.RelayEventManager=void 0;const _Ne=Kt;class CNe{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,_Ne.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}ev.RelayEventManager=CNe;var wx={},vx={},bx={};Object.defineProperty(bx,"__esModule",{value:!0});bx.WalletLinkCipher=void 0;const L4=Kt;class SNe{constructor(e){this.secret=e}async encrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,L4.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,a.encode(e)),o=16,l=s.slice(s.byteLength-o),c=s.slice(0,s.byteLength-o),u=new Uint8Array(l),f=new Uint8Array(c),h=new Uint8Array([...n,...u,...f]);return(0,L4.uint8ArrayToHex)(h)}async decrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const a=await crypto.subtle.importKey("raw",(0,L4.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,L4.hexStringToUint8Array)(e),o=s.slice(0,12),l=s.slice(12,28),c=s.slice(28),u=new Uint8Array([...c,...l]),f={name:"AES-GCM",iv:new Uint8Array(o)};try{const h=await window.crypto.subtle.decrypt(f,a,u),g=new TextDecoder;n(g.decode(h))}catch(h){i(h)}})()})}}bx.WalletLinkCipher=SNe;var xx={};Object.defineProperty(xx,"__esModule",{value:!0});xx.WalletLinkHTTP=void 0;class ANe{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.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 e;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const a=(e=n==null?void 0:n.filter(s=>s.event==="Web3Response").map(s=>({type:"Event",sessionId:this.sessionId,eventId:s.id,event:s.event,data:s.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(a),a}throw new Error(`Check unseen events failed: ${r.status}`)}}xx.WalletLinkHTTP=ANe;var Gg={};Object.defineProperty(Gg,"__esModule",{value:!0});Gg.WalletLinkWebSocket=Gg.ConnectionState=void 0;var tg;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(tg||(Gg.ConnectionState=tg={}));class INe{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(a){r(a);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,tg.CONNECTING),i.onclose=a=>{var s;this.clearWebSocket(),r(new Error(`websocket error ${a.code}: ${a.reason}`)),(s=this.connectionStateListener)===null||s===void 0||s.call(this,tg.DISCONNECTED)},i.onopen=a=>{var s;e(),(s=this.connectionStateListener)===null||s===void 0||s.call(this,tg.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},i.onmessage=a=>{var s,o;if(a.data==="h")(s=this.incomingDataListener)===null||s===void 0||s.call(this,{type:"Heartbeat"});else try{const l=JSON.parse(a.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,l)}catch{}}})}disconnect(){var e;const{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,tg.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){const{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}Gg.WalletLinkWebSocket=INe;Object.defineProperty(vx,"__esModule",{value:!0});vx.WalletLinkConnection=void 0;const CB=mu,MNe=bx,TNe=xx,j4=Gg,wp=Pa,SB=1e4,kNe=6e4;class NNe{constructor({session:e,linkAPIUrl:r,listener:n,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,wp.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=s=>{if(!s)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>s.JsonRpcUrl&&this.handleChainUpdated(l,s.JsonRpcUrl)]]).forEach((l,c)=>{const u=s[c];u!==void 0&&l(u)})},this.handleDestroyed=s=>{var o;s==="1"&&((o=this.listener)===null||o===void 0||o.resetAndReload())},this.handleAccountUpdated=async s=>{var o;{const l=await this.cipher.decrypt(s);(o=this.listener)===null||o===void 0||o.accountUpdated(l)}},this.handleMetadataUpdated=async(s,o)=>{var l;{const c=await this.cipher.decrypt(o);(l=this.listener)===null||l===void 0||l.metadataUpdated(s,c)}},this.handleWalletUsernameUpdated=async s=>{this.handleMetadataUpdated(CB.WALLET_USER_NAME_KEY,s)},this.handleAppVersionUpdated=async s=>{this.handleMetadataUpdated(CB.APP_VERSION_KEY,s)},this.handleChainUpdated=async(s,o)=>{var l;{const c=await this.cipher.decrypt(s),u=await this.cipher.decrypt(o);(l=this.listener)===null||l===void 0||l.chainUpdated(c,u)}},this.session=e,this.cipher=new MNe.WalletLinkCipher(e.secret),this.listener=n;const a=new j4.WalletLinkWebSocket(`${r}/rpc`,i);a.setConnectionStateListener(async s=>{let o=!1;switch(s){case j4.ConnectionState.DISCONNECTED:if(!this.destroyed){const l=async()=>{await new Promise(c=>setTimeout(c,5e3)),this.destroyed||a.connect().catch(()=>{l()})};l()}break;case j4.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),o=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},SB),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case j4.ConnectionState.CONNECTING:break}this.connected!==o&&(this.connected=o)}),a.setIncomingDataListener(s=>{var o;switch(s.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const l=s.type==="IsLinkedOK"?s.linked:void 0;this.linked=l||s.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(s.metadata);break}case"Event":{this.handleIncomingEvent(s);break}}s.id!==void 0&&((o=this.requestResolutions.get(s.id))===null||o===void 0||o(s))}),this.ws=a,this.http=new TNe.WalletLinkHTTP(r,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this))}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r;if(!(e.type!=="Event"||e.event!=="Web3Response")){const n=await this.cipher.decrypt(e.data),i=JSON.parse(n);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){const n={type:"SetSessionConfig",id:(0,wp.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),a={type:"PublishEvent",id:(0,wp.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const s=await this.makeRequest(a);if(s.type==="Fail")throw new Error(s.error||"failed to publish event");return s.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>SB*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=kNe){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((a,s)=>{i=window.setTimeout(()=>{s(new Error(`request ${n} timed out`))},r)}),new Promise(a=>{this.requestResolutions.set(n,s=>{clearTimeout(i),a(s),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,wp.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authenticate")}sendIsLinked(){const e={type:"IsLinked",id:(0,wp.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,wp.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}vx.WalletLinkConnection=NNe;var Ex={},Bte={exports:{}},zte=Sh.Buffer;function _x(t,e){this._block=zte.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}_x.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=zte.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,a=this._len,s=0;s=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,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return t?a.toString(t):a};_x.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Rm=_x,LNe=gs,Wte=Rm,jNe=Sh.Buffer,$Ne=[1518500249,1859775393,-1894007588,-899497514],PNe=new Array(80);function tv(){this.init(),this._w=PNe,Wte.call(this,64,56)}LNe(tv,Wte);tv.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function RNe(t){return t<<5|t>>>27}function DNe(t){return t<<30|t>>>2}function ONe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}tv.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,s=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=e[o-3]^e[o-8]^e[o-14]^e[o-16];for(var l=0;l<80;++l){var c=~~(l/20),u=RNe(r)+ONe(c,n,i,a)+s+e[l]+$Ne[c]|0;s=a,a=i,i=DNe(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0};tv.prototype._hash=function(){var t=jNe.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var FNe=tv,UNe=gs,Hte=Rm,BNe=Sh.Buffer,zNe=[1518500249,1859775393,-1894007588,-899497514],WNe=new Array(80);function rv(){this.init(),this._w=WNe,Hte.call(this,64,56)}UNe(rv,Hte);rv.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function HNe(t){return t<<1|t>>>31}function GNe(t){return t<<5|t>>>27}function qNe(t){return t<<30|t>>>2}function VNe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}rv.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,s=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=HNe(e[o-3]^e[o-8]^e[o-14]^e[o-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=GNe(r)+VNe(c,n,i,a)+s+e[l]+zNe[c]|0;s=a,a=i,i=qNe(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0};rv.prototype._hash=function(){var t=BNe.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var YNe=rv,KNe=gs,Gte=Rm,JNe=Sh.Buffer,QNe=[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],ZNe=new Array(64);function nv(){this.init(),this._w=ZNe,Gte.call(this,64,56)}KNe(nv,Gte);nv.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 XNe(t,e,r){return r^t&(e^r)}function eLe(t,e,r){return t&e|r&(t|e)}function tLe(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function rLe(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function nLe(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function iLe(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}nv.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,s=this._e|0,o=this._f|0,l=this._g|0,c=this._h|0,u=0;u<16;++u)e[u]=t.readInt32BE(u*4);for(;u<64;++u)e[u]=iLe(e[u-2])+e[u-7]+nLe(e[u-15])+e[u-16]|0;for(var f=0;f<64;++f){var h=c+rLe(s)+XNe(s,o,l)+QNe[f]+e[f]|0,g=tLe(r)+eLe(r,n,i)|0;c=l,l=o,o=s,s=a+h|0,a=i,i=n,n=r,r=h+g|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0,this._f=o+this._f|0,this._g=l+this._g|0,this._h=c+this._h|0};nv.prototype._hash=function(){var t=JNe.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var qte=nv,aLe=gs,sLe=qte,oLe=Rm,lLe=Sh.Buffer,cLe=new Array(64);function Cx(){this.init(),this._w=cLe,oLe.call(this,64,56)}aLe(Cx,sLe);Cx.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};Cx.prototype._hash=function(){var t=lLe.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var uLe=Cx,dLe=gs,Vte=Rm,fLe=Sh.Buffer,AB=[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],hLe=new Array(160);function iv(){this.init(),this._w=hLe,Vte.call(this,128,112)}dLe(iv,Vte);iv.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 IB(t,e,r){return r^t&(e^r)}function MB(t,e,r){return t&e|r&(t|e)}function TB(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function kB(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function pLe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function gLe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function mLe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function yLe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Fi(t,e){return t>>>0>>0?1:0}iv.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,a=this._dh|0,s=this._eh|0,o=this._fh|0,l=this._gh|0,c=this._hh|0,u=this._al|0,f=this._bl|0,h=this._cl|0,g=this._dl|0,m=this._el|0,w=this._fl|0,C=this._gl|0,v=this._hl|0,b=0;b<32;b+=2)e[b]=t.readInt32BE(b*4),e[b+1]=t.readInt32BE(b*4+4);for(;b<160;b+=2){var A=e[b-30],S=e[b-15*2+1],j=pLe(A,S),U=gLe(S,A);A=e[b-2*2],S=e[b-2*2+1];var I=mLe(A,S),B=yLe(S,A),V=e[b-7*2],se=e[b-7*2+1],Y=e[b-16*2],N=e[b-16*2+1],k=U+se|0,x=j+V+Fi(k,U)|0;k=k+B|0,x=x+I+Fi(k,B)|0,k=k+N|0,x=x+Y+Fi(k,N)|0,e[b]=x,e[b+1]=k}for(var _=0;_<160;_+=2){x=e[_],k=e[_+1];var L=MB(r,n,i),O=MB(u,f,h),P=TB(r,u),R=TB(u,r),M=kB(s,m),D=kB(m,s),$=AB[_],X=AB[_+1],le=IB(s,o,l),H=IB(m,w,C),ee=v+D|0,J=c+M+Fi(ee,v)|0;ee=ee+H|0,J=J+le+Fi(ee,H)|0,ee=ee+X|0,J=J+$+Fi(ee,X)|0,ee=ee+k|0,J=J+x+Fi(ee,k)|0;var te=R+O|0,re=P+L+Fi(te,R)|0;c=l,v=C,l=o,C=w,o=s,w=m,m=g+ee|0,s=a+J+Fi(m,g)|0,a=i,g=h,i=n,h=f,n=r,f=u,u=ee+te|0,r=J+re+Fi(u,ee)|0}this._al=this._al+u|0,this._bl=this._bl+f|0,this._cl=this._cl+h|0,this._dl=this._dl+g|0,this._el=this._el+m|0,this._fl=this._fl+w|0,this._gl=this._gl+C|0,this._hl=this._hl+v|0,this._ah=this._ah+r+Fi(this._al,u)|0,this._bh=this._bh+n+Fi(this._bl,f)|0,this._ch=this._ch+i+Fi(this._cl,h)|0,this._dh=this._dh+a+Fi(this._dl,g)|0,this._eh=this._eh+s+Fi(this._el,m)|0,this._fh=this._fh+o+Fi(this._fl,w)|0,this._gh=this._gh+l+Fi(this._gl,C)|0,this._hh=this._hh+c+Fi(this._hl,v)|0};iv.prototype._hash=function(){var t=fLe.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var Yte=iv,wLe=gs,vLe=Yte,bLe=Rm,xLe=Sh.Buffer,ELe=new Array(160);function Sx(){this.init(),this._w=ELe,bLe.call(this,128,112)}wLe(Sx,vLe);Sx.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};Sx.prototype._hash=function(){var t=xLe.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var _Le=Sx,S1=Bte.exports=function(e){e=e.toLowerCase();var r=S1[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};S1.sha=FNe;S1.sha1=YNe;S1.sha224=uLe;S1.sha256=qte;S1.sha384=_Le;S1.sha512=Yte;var CLe=Bte.exports;Object.defineProperty(Ex,"__esModule",{value:!0});Ex.WalletLinkSession=void 0;const SLe=CLe,NB=Kt,LB="session:id",jB="session:secret",$B="session:linked";class DL{constructor(e,r,n,i){this._storage=e,this._id=r||(0,NB.randomBytesHex)(16),this._secret=n||(0,NB.randomBytesHex)(32),this._key=new SLe.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(LB),n=e.getItem($B),i=e.getItem(jB);return r&&i?new DL(e,r,i,n==="1"):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(LB,this._id),this._storage.setItem(jB,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem($B,this._linked?"1":"0")}}Ex.WalletLinkSession=DL;var Eo={};Object.defineProperty(Eo,"__esModule",{value:!0});Eo.isDarkMode=Eo.isMobileWeb=Eo.getLocation=Eo.createQrUrl=void 0;function ALe(t,e,r,n,i,a){const s=n?"parent-id":"id",o=new URLSearchParams({[s]:t,secret:e,server:r,v:i,chainId:a.toString()}).toString();return`${r}/#/link?${o}`}Eo.createQrUrl=ALe;function ILe(){try{return window.frameElement!==null}catch{return!1}}function MLe(){try{return ILe()&&window.top?window.top.location:window.location}catch{return window.location}}Eo.getLocation=MLe;function TLe(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}Eo.isMobileWeb=TLe;function kLe(){var t,e;return(e=(t=window==null?void 0:window.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}Eo.isDarkMode=kLe;var Ax={},av={},OL={};Object.defineProperty(OL,"__esModule",{value:!0});OL.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 NLe=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(av,"__esModule",{value:!0});av.injectCssReset=void 0;const LLe=NLe(OL);function jLe(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(LLe.default)),document.documentElement.appendChild(t)}av.injectCssReset=jLe;var FL={};function Kte(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e2&&(s.children=arguments.length>3?sv.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(a in t.defaultProps)s[a]===void 0&&(s[a]=t.defaultProps[a]);return By(t,s,n,i,null)}function By(t,e,r,n,i){var a={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Qte,__i:-1,__u:0};return i==null&&In.vnode!=null&&In.vnode(a),a}function RLe(){return{current:null}}function ov(t){return t.children}function zy(t,e){this.props=t,this.context=e}function qg(t,e){if(e==null)return t.__?qg(t.__,t.__i+1):null;for(var r;ee&&p0.sort(BM));t8.__r=0}function ire(t,e,r,n,i,a,s,o,l,c,u){var f,h,g,m,w,C,v=n&&n.__k||rre,b=e.length;for(l=DLe(r,e,v,l,b),f=0;f0?By(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,o=null,(c=s.__i=OLe(s,r,l,f))!==-1&&(f--,(o=r[c])&&(o.__u|=2)),o==null||o.__v===null?(c==-1&&h--,typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,s.__u|=4))):t.__k[a]=null;if(f)for(a=0;a(l!=null&&!(2&l.__u)?1:0))for(i=r-1,a=r+1;i>=0||a=0){if((l=e[i])&&!(2&l.__u)&&s==l.key&&o===l.type)return i;i--}if(a2&&(o.children=arguments.length>3?sv.call(arguments,2):r),By(t.type,o,n||t.key,i||t.ref,null)}function zLe(t,e){var r={__c:e="__cC"+tre++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,a;return this.getChildContext||(i=new Set,(a={})[e]=this,this.getChildContext=function(){return a},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&i.forEach(function(o){o.__e=!0,GM(o)})},this.sub=function(s){i.add(s);var o=s.componentWillUnmount;s.componentWillUnmount=function(){i&&i.delete(s),o&&o.call(s)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}sv=rre.slice,In={__e:function(t,e,r,n){for(var i,a,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(o){t=o}throw t}},Qte=0,Zte=function(t){return t!=null&&t.constructor==null},zy.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Id({},this.state),typeof t=="function"&&(t=t(Id({},r),this.props)),t&&Id(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),GM(this))},zy.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),GM(this))},zy.prototype.render=ov,p0=[],Xte=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,BM=function(t,e){return t.__v.__b-e.__v.__b},t8.__r=0,ere=/(PointerCapture)$|Capture$/i,UL=0,zM=OB(!1),WM=OB(!0),tre=0;const WLe=Object.freeze(Object.defineProperty({__proto__:null,Component:zy,Fragment:ov,cloneElement:BLe,createContext:zLe,createElement:HM,createRef:RLe,h:HM,hydrate:ure,get isValidElement(){return Zte},get options(){return In},render:cre,toChildArray:sre},Symbol.toStringTag,{value:"Module"})),dre=yh(WLe);var Vd,bn,sS,FB,Vg=0,fre=[],Yn=In,UB=Yn.__b,BB=Yn.__r,zB=Yn.diffed,WB=Yn.__c,HB=Yn.unmount,GB=Yn.__;function A1(t,e){Yn.__h&&Yn.__h(bn,t,Vg||e),Vg=0;var r=bn.__H||(bn.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function hre(t){return Vg=1,pre(mre,t)}function pre(t,e,r){var n=A1(Vd++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):mre(void 0,e),function(o){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,o);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=bn,!bn.u)){var i=function(o,l,c){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(h){return!!h.__c});if(u.every(function(h){return!h.__N}))return!a||a.call(this,o,l,c);var f=n.__c.props!==o;return u.forEach(function(h){if(h.__N){var g=h.__[0];h.__=h.__N,h.__N=void 0,g!==h.__[0]&&(f=!0)}}),a&&a.call(this,o,l,c)||f};bn.u=!0;var a=bn.shouldComponentUpdate,s=bn.componentWillUpdate;bn.componentWillUpdate=function(o,l,c){if(this.__e){var u=a;a=void 0,i(o,l,c),a=u}s&&s.call(this,o,l,c)},bn.shouldComponentUpdate=i}return n.__N||n.__}function HLe(t,e){var r=A1(Vd++,3);!Yn.__s&&GL(r.__H,e)&&(r.__=t,r.i=e,bn.__H.__h.push(r))}function gre(t,e){var r=A1(Vd++,4);!Yn.__s&&GL(r.__H,e)&&(r.__=t,r.i=e,bn.__h.push(r))}function GLe(t){return Vg=5,HL(function(){return{current:t}},[])}function qLe(t,e,r){Vg=6,gre(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function HL(t,e){var r=A1(Vd++,7);return GL(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function VLe(t,e){return Vg=8,HL(function(){return t},e)}function YLe(t){var e=bn.context[t.__c],r=A1(Vd++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(bn)),e.props.value):t.__}function KLe(t,e){Yn.useDebugValue&&Yn.useDebugValue(e?e(t):t)}function JLe(t){var e=A1(Vd++,10),r=hre();return e.__=t,bn.componentDidCatch||(bn.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function QLe(){var t=A1(Vd++,11);if(!t.__){for(var e=bn.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function ZLe(){for(var t;t=fre.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(P6),t.__H.__h.forEach(qM),t.__H.__h=[]}catch(e){t.__H.__h=[],Yn.__e(e,t.__v)}}Yn.__b=function(t){bn=null,UB&&UB(t)},Yn.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),GB&&GB(t,e)},Yn.__r=function(t){BB&&BB(t),Vd=0;var e=(bn=t.__c).__H;e&&(sS===bn?(e.__h=[],bn.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(e.__h.forEach(P6),e.__h.forEach(qM),e.__h=[],Vd=0)),sS=bn},Yn.diffed=function(t){zB&&zB(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(fre.push(e)!==1&&FB===Yn.requestAnimationFrame||((FB=Yn.requestAnimationFrame)||XLe)(ZLe)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),sS=bn=null},Yn.__c=function(t,e){e.some(function(r){try{r.__h.forEach(P6),r.__h=r.__h.filter(function(n){return!n.__||qM(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Yn.__e(n,r.__v)}}),WB&&WB(t,e)},Yn.unmount=function(t){HB&&HB(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{P6(n)}catch(i){e=i}}),r.__H=void 0,e&&Yn.__e(e,r.__v))};var qB=typeof requestAnimationFrame=="function";function XLe(t){var e,r=function(){clearTimeout(n),qB&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);qB&&(e=requestAnimationFrame(r))}function P6(t){var e=bn,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),bn=e}function qM(t){var e=bn;t.__c=t.__(),bn=e}function GL(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function mre(t,e){return typeof e=="function"?e(t):e}const eje=Object.freeze(Object.defineProperty({__proto__:null,useCallback:VLe,useContext:YLe,useDebugValue:KLe,useEffect:HLe,useErrorBoundary:JLe,useId:QLe,useImperativeHandle:qLe,useLayoutEffect:gre,useMemo:HL,useReducer:pre,useRef:GLe,useState:hre},Symbol.toStringTag,{value:"Module"})),tje=yh(eje);var qL={};Object.defineProperty(qL,"__esModule",{value:!0});qL.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(t){var e=Xt&&Xt.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Jte),n=dre,i=tje,a=Eo,s=e(qL),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",l="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class c{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=(0,a.isDarkMode)()}attach(g){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",g.appendChild(this.root),this.render()}presentItem(g){const m=this.nextItemKey++;return this.items.set(m,g),this.render(),()=>{this.items.delete(m),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([g,m])=>(0,n.h)(t.SnackbarInstance,Object.assign({},m,{key:g}))))),this.root)}}t.Snackbar=c;const u=h=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},h.children));t.SnackbarContainer=u;const f=({autoExpand:h,message:g,menuItems:m})=>{const[w,C]=(0,i.useState)(!0),[v,b]=(0,i.useState)(h??!1);(0,i.useEffect)(()=>{const S=[window.setTimeout(()=>{C(!1)},1),window.setTimeout(()=>{b(!0)},1e4)];return()=>{S.forEach(window.clearTimeout)}});const A=()=>{b(!v)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",w&&"-cbwsdk-snackbar-instance-hidden",v&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:A},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},g),(0,n.h)("div",{class:"-gear-container"},!v&&(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:l,class:"-gear-icon",title:"Expand"}))),m&&m.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},m.map((S,j)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",S.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:S.onClick,key:j},(0,n.h)("svg",{width:S.svgWidth,height:S.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":S.defaultFillRule,"clip-rule":S.defaultClipRule,d:S.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",S.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},S.info)))))};t.SnackbarInstance=f})(FL);Object.defineProperty(Ax,"__esModule",{value:!0});Ax.WalletLinkRelayUI=void 0;const rje=av,nje=FL;class ije{constructor(){this.attached=!1,this.snackbar=new nje.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.snackbar.attach(r),this.attached=!0,(0,rje.injectCssReset)()}showConnecting(e){let r;return e.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:e.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:e.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:e.onResetConnection}]},this.snackbar.presentItem(r)}}Ax.WalletLinkRelayUI=ije;var Mx={},Tx={},VL={};Object.defineProperty(VL,"__esModule",{value:!0});VL.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 yre=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tx,"__esModule",{value:!0});Tx.RedirectDialog=void 0;const aje=yre(Jte),Xc=dre,sje=av,oje=FL,lje=Eo,cje=yre(VL);class uje{constructor(){this.root=null,this.darkMode=(0,lje.isDarkMode)()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,sje.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,Xc.render)(null,this.root),e&&(0,Xc.render)((0,Xc.h)(dje,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}Tx.RedirectDialog=uje;const dje=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const a=r?"dark":"light";return(0,Xc.h)(oje.SnackbarContainer,{darkMode:r},(0,Xc.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Xc.h)("style",null,cje.default),(0,Xc.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Xc.h)("div",{class:(0,aje.default)("-cbwsdk-redirect-dialog-box",a)},(0,Xc.h)("p",null,t),(0,Xc.h)("button",{onClick:n},e))))};var yu={};Object.defineProperty(yu,"__esModule",{value:!0});yu.CBW_MOBILE_DEEPLINK_URL=yu.WALLETLINK_URL=yu.CB_KEYS_URL=void 0;yu.CB_KEYS_URL="https://keys.coinbase.com/connect";yu.WALLETLINK_URL="https://www.walletlink.org";yu.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink";Object.defineProperty(Mx,"__esModule",{value:!0});Mx.WLMobileRelayUI=void 0;const fje=Tx,hje=Eo,pje=yu;class gje{constructor(){this.attached=!1,this.redirectDialog=new fje.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const r=new URL(pje.CBW_MOBILE_DEEPLINK_URL);r.searchParams.append("redirect_url",(0,hje.getLocation)().href),e&&r.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}Mx.WLMobileRelayUI=gje;Object.defineProperty(wx,"__esModule",{value:!0});wx.WalletLinkRelay=void 0;const mje=vx,yje=mu,wje=ev,oS=Ex,vp=$m,vje=Eo,bje=Ax,VB=Mx,xje=$u,fi=Kt,Eje=Pu;class vd{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,vje.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{this.isLinked=a;const s=this.storage.getItem(yje.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this._session.linked=a),this.isUnlinkedErrorState=!1,s){const o=s.split(" "),l=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!a&&this._session.linked&&!l&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(a,s)=>{this.storage.setItem(a,s)},this.chainUpdated=(a,s)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===s||(this.chainCallbackParams={chainId:a,jsonRpcUrl:s},this.chainCallback&&this.chainCallback(a,s))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),vd.accountRequestCallbackIds.size>0&&(Array.from(vd.accountRequestCallbackIds.values()).forEach(s=>{const o={type:"WEB3_RESPONSE",id:s,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),vd.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage;const{session:r,ui:n,connection:i}=this.subscribe();this._session=r,this.connection=i,this.relayEventManager=new wje.RelayEventManager,this.ui=n}subscribe(){const e=oS.WalletLinkSession.load(this.storage)||new oS.WalletLinkSession(this.storage).save(),{linkAPIUrl:r}=this,n=new mje.WalletLinkConnection({session:e,linkAPIUrl:r,listener:this}),i=this.isMobileWeb?new VB.WLMobileRelayUI:new bje.WalletLinkRelayUI;return n.connect(),{session:e,ui:i,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{this.connection.destroy();const e=oS.WalletLinkSession.load(this.storage);(e==null?void 0:e.id)===this._session.id&&Eje.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(e=>{})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,fi.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,fi.hexStringFromBuffer)(e,!0),signature:(0,fi.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,fi.bigIntStringFromBigInt)(e.weiValue),data:(0,fi.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,fi.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,fi.bigIntStringFromBigInt)(e.weiValue),data:(0,fi.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,fi.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,fi.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,fi.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,fi.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getWalletLinkSession(){return this._session}genericRequest(e,r){return this.sendRequest({method:"generic",params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,fi.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,a),r==null||r()};return new Promise((a,s)=>{r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,o=>{if(r==null||r(),(0,vp.isErrorResponse)(o))return s(new Error(o.errorMessage));a(o)}),this.publishWeb3RequestEvent(n,e)})}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e}publishWeb3RequestEvent(e,r){const n={type:"WEB3_REQUEST",id:e,request:r};this.publishEvent("Web3Request",n,!0).then(i=>{}).catch(i=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n.id,response:{method:r.method,errorMessage:i.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(r.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof VB.WLMobileRelayUI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e){const{response:r}=e;if(r.method==="requestEthereumAccounts"){vd.accountRequestCallbackIds.forEach(n=>this.invokeCallback(Object.assign(Object.assign({},e),{id:n}))),vd.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n){var i;const a=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:r,errorMessage:a}})}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,fi.randomBytesHex)(8);return new Promise((n,i)=>{this.relayEventManager.callbacks.set(r,a=>{if((0,vp.isErrorResponse)(a))return i(new Error(a.errorMessage));n(a)}),vd.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,e)})}watchAsset(e,r,n,i,a,s){const o={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:a},chainId:s}};let l=null;const c=(0,fi.randomBytesHex)(8),u=f=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,o.method,f),l==null||l()};return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}),new Promise((f,h)=>{this.relayEventManager.callbacks.set(c,g=>{if(l==null||l(),(0,vp.isErrorResponse)(g))return h(new Error(g.errorMessage));f(g)}),this.publishWeb3RequestEvent(c,o)})}addEthereumChain(e,r,n,i,a,s){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:a,iconUrls:n,nativeCurrency:s}};let l=null;const c=(0,fi.randomBytesHex)(8),u=f=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,o.method,f),l==null||l()};return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}),new Promise((f,h)=>{this.relayEventManager.callbacks.set(c,g=>{if(l==null||l(),(0,vp.isErrorResponse)(g))return h(new Error(g.errorMessage));f(g)}),this.publishWeb3RequestEvent(c,o)})}switchEthereumChain(e,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,fi.randomBytesHex)(8);return new Promise((a,s)=>{this.relayEventManager.callbacks.set(i,o=>{if((0,vp.isErrorResponse)(o)&&o.errorCode)return s(xje.standardErrors.provider.custom({code:o.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,vp.isErrorResponse)(o))return s(new Error(o.errorMessage));a(o)}),this.publishWeb3RequestEvent(i,n)})}}wx.WalletLinkRelay=vd;vd.accountRequestCallbackIds=new Set;var _je=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fx,"__esModule",{value:!0});fx.WalletLinkSigner=void 0;const lS=_je(xNe),YB=mu,Cje=ev,ed=$m,Sje=wx,KB=yu,Ui=$u,Gr=Kt,Aje=Pu,cS="DefaultChainId",JB="DefaultJsonRpcUrl";class Ije{constructor(e){var r,n;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:i,appLogoUrl:a}=e.metadata;this._appName=i,this._appLogoUrl=a,this._storage=new Aje.ScopedLocalStorage("walletlink",KB.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new Cje.RelayEventManager,this._jsonRpcUrlFromOpts="";const s=this._storage.getItem(YB.LOCAL_STORAGE_ADDRESSES_KEY);if(s){const l=s.split(" ");l[0]!==""&&(this._addresses=l.map(c=>(0,Gr.ensureAddressString)(c)),(r=this.updateListener)===null||r===void 0||r.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(cS)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:r,secret:n}=e.getWalletLinkSession();return{id:r,secret:n}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(JB))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(JB,e)}updateProviderInfo(e,r){var n;this.jsonRpcUrl=e;const i=this.getChainId();this._storage.setItem(cS,r.toString(10)),((0,Gr.ensureIntNumber)(r)!==i||!this.hasMadeFirstChainChangedEmission)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:r,rpcUrl:e},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,a,s){const l=await this.initializeRelay().watchAsset(e,r,n,i,a,s==null?void 0:s.toString());return(0,ed.isErrorResponse)(l)?!1:!!l.result}async addEthereumChain(e,r,n,i,a,s){var o,l;if((0,Gr.ensureIntNumber)(e)===this.getChainId())return!1;const c=this.initializeRelay();this._isAuthorized()||await c.requestEthereumAccounts();const u=await c.addEthereumChain(e.toString(),r,a,n,i,s);return(0,ed.isErrorResponse)(u)?!1:(((o=u.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(r[0],e),((l=u.result)===null||l===void 0?void 0:l.isApproved)===!0)}async switchEthereumChain(e){const n=await this.initializeRelay().switchEthereumChain(e.toString(10),this.selectedAddress||void 0);if((0,ed.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===Ui.standardErrorCodes.provider.unsupportedChain?Ui.standardErrors.provider.unsupportedChain():Ui.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(e){try{return this._request(e).catch(r=>{throw r})}catch(r){return Promise.reject(r)}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw Ui.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw Ui.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw Ui.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,a=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:a})).result}_setAddresses(e,r){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");const i=e.map(a=>(0,Gr.ensureAddressString)(a));JSON.stringify(i)!==JSON.stringify(this._addresses)&&(this._addresses=i,(n=this.updateListener)===null||n===void 0||n.onAccountsUpdate({accounts:i,source:"wallet"}),this._storage.setItem(YB.LOCAL_STORAGE_ADDRESSES_KEY,i.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i})}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_handleSynchronousMethods(e){const{method:r}=e;switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n);default:return this._throwUnsupportedMethodError()}}_isKnownAddress(e){try{const r=(0,Gr.ensureAddressString)(e);return this._addresses.map(i=>(0,Gr.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){if(!this._isKnownAddress(e))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,Gr.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,Gr.ensureAddressString)(e.to):null,i=e.value!=null?(0,Gr.ensureBigInt)(e.value):BigInt(0),a=e.data?(0,Gr.ensureBuffer)(e.data):Buffer.alloc(0),s=e.nonce!=null?(0,Gr.ensureIntNumber)(e.nonce):null,o=e.gasPrice!=null?(0,Gr.ensureBigInt)(e.gasPrice):null,l=e.maxFeePerGas!=null?(0,Gr.ensureBigInt)(e.maxFeePerGas):null,c=e.maxPriorityFeePerGas!=null?(0,Gr.ensureBigInt)(e.maxPriorityFeePerGas):null,u=e.gas!=null?(0,Gr.ensureBigInt)(e.gas):null,f=e.chainId?(0,Gr.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:a,nonce:s,gasPriceInWei:o,maxFeePerGas:l,maxPriorityFeePerGas:c,gasLimit:u,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Ui.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Ui.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{const s=await this.initializeRelay().signEthereumMessage(e,r,n,i);if((0,ed.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(a){throw typeof a.message=="string"&&a.message.match(/(denied|rejected)/i)?Ui.standardErrors.provider.userRejectedRequest("User denied message signature"):a}}async _ethereumAddressFromSignedMessage(e,r,n){const a=await this.initializeRelay().ethereumAddressFromSignedMessage(e,r,n);if((0,ed.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,Gr.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(cS);if(!e)return(0,Gr.ensureIntNumber)(1);const r=parseInt(e,10);return(0,Gr.ensureIntNumber)(r)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{if(e=await this.initializeRelay().requestEthereumAccounts(),(0,ed.isErrorResponse)(e))throw new Error(e.errorMessage)}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Ui.standardErrors.provider.userRejectedRequest("User denied account authorization"):r}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,Gr.ensureAddressString)(e[0]),n=(0,Gr.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,Gr.ensureBuffer)(e[0]),n=(0,Gr.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,Gr.ensureBuffer)(e[0]),n=(0,Gr.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,Gr.ensureBuffer)(e[0]),n=(0,Gr.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await this.initializeRelay().signEthereumTransaction(r);if((0,ed.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Ui.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,Gr.ensureBuffer)(e[0]),i=await this.initializeRelay().submitEthereumTransaction(r,this.getChainId());if((0,ed.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await this.initializeRelay().signAndSubmitEthereumTransaction(r);if((0,ed.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Ui.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,Gr.ensureParsedJSONObject)(e[0]),n=(0,Gr.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=lS.default.hashForSignTypedDataLegacy({data:r}),a=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,a)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,Gr.ensureAddressString)(e[0]),n=(0,Gr.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=lS.default.hashForSignTypedData_v3({data:n}),a=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,a)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,Gr.ensureAddressString)(e[0]),n=(0,Gr.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=lS.default.hashForSignTypedData_v4({data:n}),a=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,a)}async _wallet_addEthereumChain(e){var r,n,i,a;const s=e[0];if(((r=s.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!s.chainName||s.chainName.trim()==="")throw Ui.standardErrors.rpc.invalidParams("chainName is a required field");if(!s.nativeCurrency)throw Ui.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(s.chainId,16);return await this.addEthereumChain(o,(n=s.rpcUrls)!==null&&n!==void 0?n:[],(i=s.blockExplorerUrls)!==null&&i!==void 0?i:[],s.chainName,(a=s.iconUrls)!==null&&a!==void 0?a:[],s.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw Ui.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw Ui.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw Ui.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw Ui.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:a,image:s,decimals:o}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,a,o,s,n)}}initializeRelay(){if(!this._relay){const e=new Sje.WalletLinkRelay({linkAPIUrl:KB.WALLETLINK_URL,storage:this._storage});e.setAppInfo(this._appName,this._appLogoUrl),e.attachUI(),e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),this._relay=e}return this._relay}}fx.WalletLinkSigner=Ije;var fl={};Object.defineProperty(fl,"__esModule",{value:!0});fl.checkErrorForInvalidRequestArgs=fl.getCoinbaseInjectedProvider=fl.getCoinbaseInjectedSigner=fl.fetchRPCRequest=void 0;const Mje=E1,R6=$u;async function Tje(t,e){if(!e.rpcUrl)throw R6.standardErrors.rpc.internal("No RPC URL set for chain");const r=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()});return(await(await window.fetch(e.rpcUrl,{method:"POST",body:JSON.stringify(r),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":Mje.LIB_VERSION}})).json()).result}fl.fetchRPCRequest=Tje;function wre(){return globalThis.coinbaseWalletSigner}fl.getCoinbaseInjectedSigner=wre;function kje({metadata:t,preference:e}){var r,n,i;const a=globalThis;if(e.options!=="smartWalletOnly"){if(wre())return;const l=a.coinbaseWalletExtension;if(l){const{appName:c,appLogoUrl:u,appChainIds:f}=t;return(r=l.setAppInfo)===null||r===void 0||r.call(l,c,u,f),l}}const s=(n=a.ethereum)!==null&&n!==void 0?n:(i=a.top)===null||i===void 0?void 0:i.ethereum;if(s!=null&&s.isCoinbaseBrowser)return s}fl.getCoinbaseInjectedProvider=kje;function Nje(t){if(!t||typeof t!="object"||Array.isArray(t))return R6.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:r}=t;if(typeof e!="string"||e.length===0)return R6.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))return R6.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t})}fl.checkErrorForInvalidRequestArgs=Nje;Object.defineProperty(cu,"__esModule",{value:!0});cu.createSigner=cu.fetchSignerType=cu.storeSignerType=cu.loadSignerType=void 0;const Lje=cx,vre=fx,jje=$u,$je=fl,Pje=Pu,bre="SignerType",xre=new Pje.ScopedLocalStorage("CBWSDK","SignerConfigurator");function Rje(){return xre.getItem(bre)}cu.loadSignerType=Rje;function Dje(t){xre.setItem(bre,t)}cu.storeSignerType=Dje;async function Oje(t){const{communicator:e,metadata:r}=t;Uje(e,r).catch(()=>{});const n={id:crypto.randomUUID(),event:"selectSignerType",data:t.preference},{data:i}=await e.postRequestAndWaitForResponse(n);return i}cu.fetchSignerType=Oje;function Fje(t){const{signerType:e,metadata:r,communicator:n,updateListener:i}=t;switch(e){case"scw":return new Lje.SCWSigner({metadata:r,updateListener:i,communicator:n});case"walletlink":return new vre.WalletLinkSigner({metadata:r,updateListener:i});case"extension":{const a=(0,$je.getCoinbaseInjectedSigner)();if(!a)throw jje.standardErrors.rpc.internal("injected signer not found");return a}}}cu.createSigner=Fje;async function Uje(t,e){await t.onMessage(({event:n})=>n==="WalletLinkSessionRequest");const r=new vre.WalletLinkSigner({metadata:e});t.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}var kx={},Yg={};Object.defineProperty(Yg,"__esModule",{value:!0});Yg.closePopup=Yg.openPopup=void 0;const Bje=$u,QB=420,ZB=540;function zje(t){const e=(window.innerWidth-QB)/2+window.screenX,r=(window.innerHeight-ZB)/2+window.screenY,n=window.open(t,"Smart Wallet",`width=${QB}, height=${ZB}, left=${e}, top=${r}`);if(n==null||n.focus(),!n)throw Bje.standardErrors.rpc.internal("Pop up window failed to open");return n}Yg.openPopup=zje;function Wje(t){t&&!t.closed&&t.close()}Yg.closePopup=Wje;Object.defineProperty(kx,"__esModule",{value:!0});kx.Communicator=void 0;const Hje=E1,XB=Yg,Gje=yu,ez=$u;class qje{constructor(e=Gje.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async r=>{(await this.waitForPopupLoaded()).postMessage(r,this.url.origin)},this.postRequestAndWaitForResponse=async r=>{const n=this.onMessage(({requestId:i})=>i===r.id);return this.postMessage(r),await n},this.onMessage=async r=>new Promise((n,i)=>{const a=s=>{if(s.origin!==this.url.origin)return;const o=s.data;r(o)&&(n(o),window.removeEventListener("message",a),this.listeners.delete(a))};window.addEventListener("message",a),this.listeners.set(a,{reject:i})}),this.disconnect=()=>{(0,XB.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:r},n)=>{r(ez.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",n)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?this.popup:(this.popup=(0,XB.openPopup)(this.url),this.onMessage(({event:r})=>r==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:r})=>r==="PopupLoaded").then(r=>{this.postMessage({requestId:r.id,data:{version:Hje.LIB_VERSION}})}).then(()=>{if(!this.popup)throw ez.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}}kx.Communicator=qje;var Nx={};Object.defineProperty(Nx,"__esModule",{value:!0});Nx.determineMethodCategory=void 0;const tz={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};function Vje(t){for(const e in tz){const r=e;if(tz[r].includes(t))return r}}Nx.determineMethodCategory=Vje;var Yje=Xt&&Xt.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i{try{if(this.connected)return this.emit("connect",{chainId:(0,B2.hexStringFromIntNumber)((0,P4.IntNumber)(this.chain.id))}),this.accounts;const u=await this.requestSignerSelection(),f=this.initSigner(u),h=await f.handshake();return this.signer=f,(0,R4.storeSignerType)(u),this.emit("connect",{chainId:(0,B2.hexStringFromIntNumber)((0,P4.IntNumber)(this.chain.id))}),h}catch(u){throw this.handleUnauthorizedError(u),u}},sign:async c=>{if(!this.connected||!this.signer)throw bp.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(c)}catch(u){throw this.handleUnauthorizedError(u),u}},fetch:c=>(0,rz.fetchRPCRequest)(c,this.chain),state:c=>{const u=()=>{if(this.connected)return this.accounts;throw bp.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(c.method){case"eth_chainId":return(0,B2.hexStringFromIntNumber)((0,P4.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return u();case"eth_coinbase":return u()[0];default:return this.handlers.unsupported(c)}},deprecated:({method:c})=>{throw bp.standardErrors.rpc.methodNotSupported(`Method ${c} is deprecated.`)},unsupported:({method:c})=>{throw bp.standardErrors.rpc.methodNotSupported(`Method ${c} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:c,source:u})=>{(0,B2.areAddressArraysEqual)(this.accounts,c)||(this.accounts=c,u!=="storage"&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:c,source:u})=>{c.id===this.chain.id&&c.rpcUrl===this.chain.rpcUrl||(this.chain=c,u!=="storage"&&this.emit("chainChanged",(0,B2.hexStringFromIntNumber)((0,P4.IntNumber)(c.id))))}},this.metadata=i,this.preference=o,this.communicator=new Zje.Communicator(s),this.chain={id:(n=(r=i.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1};const l=(0,R4.loadSignerType)();this.signer=l?this.initSigner(l):null}get connected(){return this.accounts.length>0}async request(e){var r;try{const n=(0,rz.checkErrorForInvalidRequestArgs)(e);if(n)throw n;const i=(r=(0,Xje.determineMethodCategory)(e.method))!==null&&r!==void 0?r:"fetch";return this.handlers[i](e)}catch(n){return Promise.reject((0,Qje.serializeError)(n,e.method))}}handleUnauthorizedError(e){e.code===bp.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1},e$e.ScopedLocalStorage.clearAll(),this.emit("disconnect",bp.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,R4.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,R4.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}ax.CoinbaseWalletProvider=t$e;Object.defineProperty(Kw,"__esModule",{value:!0});Kw.CoinbaseWalletSDK=void 0;const r$e=ix,n$e=ax,i$e=Pu,a$e=E1,s$e=Kt,o$e=fl;class l$e{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,s$e.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var r;const n={metadata:this.metadata,preference:e};return(r=(0,o$e.getCoinbaseInjectedProvider)(n))!==null&&r!==void 0?r:new n$e.CoinbaseWalletProvider(n)}getCoinbaseWalletLogo(e,r=240){return(0,r$e.walletLogo)(e,r)}storeLatestVersion(){new i$e.ScopedLocalStorage("CBWSDK").setItem("VERSION",a$e.LIB_VERSION)}}Kw.CoinbaseWalletSDK=l$e;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;const e=Kw;t.default=e.CoinbaseWalletSDK;var r=Kw;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}})})(qee);const VM=({style:t,...e})=>d.jsxs("svg",{viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),d.jsx("path",{fillRule:"evenodd",clipRule:"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"})]}),c$e="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",Ah={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},Ere={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},YL={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},_re={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},ef={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},Cre={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},u$e={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},KL={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},d$e={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},f$e={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},h$e={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},p$e={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}},g$e={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},Sre={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},m$e={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},y$e={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},Ru={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},I1={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},Are={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},tf={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},Ire={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},w$e={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},Mre={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},Tre={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},v$e={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},b$e={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},r8=[Ah,Ere,Mre,Ru,I1,Are,tf,Ire,KL,d$e,f$e,h$e,ef,Cre,u$e,y$e,Sre,m$e,YL,_re,Tre,b$e,v$e,g$e,w$e,p$e],kre=new Set(r8.map(t=>t.id));let Nre=class extends Pn{constructor(){super("Wallet timeout"),this.type="wallet_error"}},Lre=class extends Pn{constructor(){super("User rejected connection"),this.type="wallet_error"}};const M1=t=>{if(t instanceof Pn)return t;if(t!=null&&t.code&&(t!=null&&t.reason)){let e=new pc(t);return t.code===ka.ACTION_REJECTED&&(e.details=Xi.E4001_USER_REJECTED_REQUEST),e}return t!=null&&t.code?new pc(t):new Pn("Unknown connector error",t)};let j0=class extends Ks{constructor(e,r,n){super(e),this.type="provider_error",this.code=r,this.data=n}},pc=class extends j0{constructor(e){var n,i,a;super(e.message,e.code,e.data);let r=Object.values(Xi).find(s=>s.eipCode===e.code);this.details=r||Xi.UNKNOWN_ERROR,e.code===-32002&&((n=e.message)!=null&&n.includes("already pending for origin")?(i=e.message)!=null&&i.includes("wallet_requestPermissions")?this.details=Xi.E32002_CONNECTION_ALREADY_PENDING:this.details=Xi.E32002_REQUEST_ALREADY_PENDING:(a=e.message)!=null&&a.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=Xi.E32002_WALLET_LOCKED))}};const Pf={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...Xi};function bd(t){return t.type==="ethereum"}function YM(t,e){if(t.length!==e.length)return!1;for(let r=0;rt.rpcTimeouts&&t.rpcTimeouts[e]||rx;let rs=class{on(e,r){if(this.walletProvider)return this.walletProvider.on(e,r);this._subscriptions.push({eventName:e,listener:r})}async request(e){if(!this.walletProvider)throw new Pn(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch(r=>{throw M1(r)})}constructor(e,r){this.removeListener=(n,i)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(n,i)}catch{console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(n=new Nre,i=this.rpcTimeoutDuration)=>new Promise((a,s)=>setTimeout(()=>{s(n)},i)),this.setWalletProvider=n=>{this.walletProvider&&this._subscriptions.forEach(i=>{this.removeListener(i.eventName,i.listener)}),this.walletProvider=n,this._subscriptions.forEach(i=>{var a;(a=this.walletProvider)==null||a.on(i.eventName,i.listener)})},this.walletProvider=e,this.rpcTimeoutDuration=r||rx,this._subscriptions=[]}},n8=class extends rs{constructor(e){super(e,e.rpcTimeoutDuration)}},KM=class extends rs{sendAsync(e,r){throw Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}constructor(e){super(e,e.rpcTimeoutDuration)}};function z2(t){return t.chainType==="ethereum"}let Dm=class extends jre{buildConnectedWallet(e,r,n,i){let a=async()=>!!this.wallets.find(s=>Ir(s.address)===Ir(e));return{type:"ethereum",address:Ir(e),chainId:r,meta:n,imported:i,switchChain:async s=>{var h,g,m,w;let o,l;if(!a)throw new Pn("Wallet is not currently connected.");let c=(h=this.wallets.find(C=>Ir(C.address)===Ir(e)))==null?void 0:h.chainId;if(!c)throw new Pn("Unable to determine current chainId.");if(typeof s=="number"?(o=`0x${s.toString(16)}`,l=s):(o=s,l=Number(s)),c===M6(o))return;let u=this.chains.find(C=>C.id===l);if(!u)throw new Pn(`Unsupported chainId: ${s}`);let f=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]})};try{return await f()}catch(C){if(((v,b)=>{var A;return b==="coinbase_wallet"?v.message.includes("addEthereumChain"):v.code===4902||((A=v.message)==null?void 0:A.includes("4902"))})(C,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:o,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[((g=u.rpcUrls.default)==null?void 0:g.http[0])??""],blockExplorerUrls:[((m=u.blockExplorers)==null?void 0:m.default.url)??""]}]}),f();throw this.walletClientType==="rainbow"&&((w=C.message)!=null&&w.includes("wallet_switchEthereumChain"))?new Pn(`Rainbow does not support the chainId ${r}`):C}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new Pn("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new Pn("Wallet is not currently connected.");return new $5(new n8(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new Pn("Wallet is not currently connected.");return new KM(this.proxyProvider)},sign:async s=>{if(!await a())throw new Pn("Wallet is not currently connected.");return await this.sign(s)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let r,n=e;try{if(n===void 0){let l=await TM(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,l),Array.isArray(l)&&(n=l)}}catch(l){console.debug("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",l)}if(!n||!Array.isArray(n)||n.length<=0||!n[0])return;let i=n[0],a=Ir(i),s=[];if(this.walletClientType==="privy"){let l=Dt.get(GC(a));this.chains.find(c=>c.id===Number(l))||(Dt.del(GC(a)),l=null),r=l||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${r} on initialization`)}}else try{let l=await TM(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,l),typeof l=="string")r=l;else{if(typeof l!="number")throw Error("Invalid chainId returned from provider");r=`0x${l.toString(16)}`}}catch(l){console.warn(`Failed to get chainId from provider, defaulting to ${ZU}`,l),r=ZU}let o=M6(r);if(!s.find(l=>Ir(l.address)===a)){let l={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};s.push(this.buildConnectedWallet(Ir(i),o,l,this.connectorType==="embedded_imported"))}YM(s,this.wallets)||(this.wallets=s,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((r,n)=>n.connectedAt-r.connectedAt).find(r=>e.find(n=>Ir(n)===Ir(r.address)))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),new $5(new n8(this.proxyProvider)).getSigner().signMessage(e)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,r,n,i){super(e),this.chainType="ethereum",this.onAccountsChanged=a=>{a.length===0?this.onDisconnect():this.syncAccounts(a)},this.onChainChanged=a=>{this.wallets.forEach(s=>{s.chainId=M6(a),this.walletClientType==="privy"&&Dt.put(GC(s.address),a)}),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=()=>{this.connected=!0,this.syncAccounts()},this.wallets=[],this.walletClientType=e,this.chains=r,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=JL(i,e),this.connected=!1,this.initialized=!1}},D4,x$e=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],nz=(t,e)=>t.makeWeb3Provider({options:e}),E$e=class extends Dm{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:c$e,id:"com.coinbase.wallet"}}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||e.length===0||!e[0])throw new Pn("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw M1(e)}}updateConnectionPreference(e){this.connectionOptions=e,this.walletClientType=e==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(nz(D4,this.connectionOptions))}constructor(e,r,n,i,a,s){if(super("coinbase_wallet",e,r,n),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new rs(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!D4){let o=[r.id].concat(e.map(c=>c.id)),l=this.connectionOptions!=="eoaOnly"?o.filter(c=>!x$e.includes(c)):[];l.length>0&&!l.every(c=>kre.has(c))&&console.info(`The configured chains are not supported by Coinbase Smart Wallet: ${l.join(", ")}`),D4=new qee.CoinbaseWalletSDK({appName:a,appLogoUrl:s,appChainIds:o})}this.proxyProvider.setWalletProvider(nz(D4,this.connectionOptions))}};const $re=({...t})=>d.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})});let iz=class extends Dm{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[q5((e==null?void 0:e.chainId)||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:$re,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}constructor({provider:e,chains:r,defaultChain:n,rpcConfig:i,imported:a,walletIndex:s}){super("privy",r,n,i),this.connectorType="embedded",this.proxyProvider=e,this.walletIndex=s,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}};const _$e=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"],C$e=t=>_$e.includes(t),S$e=({as:t="div",...e},r)=>d.jsx(t,{...e,ref:r}),A$e=E.forwardRef(S$e),I$e="https://challenges.cloudflare.com/turnstile/v0/api.js",i8="cf-turnstile-script",M$e="cf-turnstile",Pre="onloadTurnstileCallback",a8=t=>!!document.getElementById(t),T$e=({render:t="explicit",onLoadCallbackName:e=Pre,scriptOptions:{nonce:r="",defer:n=!0,async:i=!0,id:a="",appendTo:s,onError:o,crossOrigin:l=""}={}})=>{const c=a||i8;if(a8(c))return;const u=document.createElement("script");if(u.id=c,u.src=`${I$e}?onload=${e}&render=${t}`,document.querySelector(`script[src="${u.src}"]`))return;u.defer=!!n,u.async=!!i,r&&(u.nonce=r),l&&(u.crossOrigin=l),o&&(u.onerror=o),(s==="body"?document.body:document.getElementsByTagName("head")[0]).appendChild(u)},Bc={normal:{width:300,height:65},compact:{width:130,height:120},invisible:{width:0,height:0,overflow:"hidden"},interactionOnly:{width:"fit-content",height:"auto"}};function k$e(t){let e;return t!=="invisible"&&(e=t),e}function N$e(t=i8){const[e,r]=E.useState(!1);return E.useEffect(()=>{const n=()=>{a8(t)&&r(!0)},i=new MutationObserver(n);return i.observe(document,{childList:!0,subtree:!0}),n(),()=>{i.disconnect()}},[t]),e}const Rre=E.forwardRef((t,e)=>{const{scriptOptions:r,options:n={},siteKey:i,onWidgetLoad:a,onSuccess:s,onExpire:o,onError:l,onBeforeInteractive:c,onAfterInteractive:u,onUnsupported:f,onLoadScript:h,id:g,style:m,as:w="div",injectScript:C=!0,...v}=t,b=n.size??"normal",[A,S]=E.useState(n.execution==="execute"?Bc.invisible:n.appearance==="interaction-only"?Bc.interactionOnly:Bc[b]),j=E.useRef(null),U=E.useRef(!1),[I,B]=E.useState(),[V,se]=E.useState(!1),Y=g??M$e,N=C?(r==null?void 0:r.id)||`${i8}__${Y}`:(r==null?void 0:r.id)||i8,k=N$e(N),x=r!=null&&r.onLoadCallbackName?`${r.onLoadCallbackName}__${Y}`:`${Pre}__${Y}`,_=E.useMemo(()=>({sitekey:i,action:n.action,cData:n.cData,callback:s,"error-callback":l,"expired-callback":o,"before-interactive-callback":c,"after-interactive-callback":u,"unsupported-callback":f,theme:n.theme??"auto",language:n.language??"auto",tabindex:n.tabIndex,"response-field":n.responseField,"response-field-name":n.responseFieldName,size:k$e(b),retry:n.retry??"auto","retry-interval":n.retryInterval??8e3,"refresh-expired":n.refreshExpired??"auto",execution:n.execution??"render",appearance:n.appearance??"always"}),[i,n,s,l,o,b,c,u,f]),L=E.useMemo(()=>JSON.stringify(_),[_]);return E.useImperativeHandle(e,()=>{if(typeof window>"u"||!k)return;const{turnstile:O}=window;return{getResponse(){if(!(O!=null&&O.getResponse)||!I){console.warn("Turnstile has not been loaded");return}return O.getResponse(I)},reset(){if(!(O!=null&&O.reset)||!I){console.warn("Turnstile has not been loaded");return}n.execution==="execute"&&S(Bc.invisible);try{O.reset(I)}catch(P){console.warn(`Failed to reset Turnstile widget ${I}`,P)}},remove(){if(!(O!=null&&O.remove)||!I){console.warn("Turnstile has not been loaded");return}B(""),S(Bc.invisible),O.remove(I)},render(){if(!(O!=null&&O.render)||!j.current||I){console.warn("Turnstile has not been loaded or widget already rendered");return}const P=O.render(j.current,_);return B(P),n.execution!=="execute"&&S(Bc[b]),P},execute(){if(n.execution==="execute"){if(!(O!=null&&O.execute)||!j.current||!I){console.warn("Turnstile has not been loaded or widget has not been rendered");return}O.execute(j.current,_),S(Bc[b])}},isExpired(){if(!(O!=null&&O.isExpired)||!I){console.warn("Turnstile has not been loaded");return}return O.isExpired(I)}}},[k,I,n.execution,b,_,j]),E.useEffect(()=>(window[x]=()=>se(!0),()=>{delete window[x]}),[x]),E.useEffect(()=>{C&&!V&&T$e({onLoadCallbackName:x,scriptOptions:{...r,id:N}})},[C,V,x,r,N]),E.useEffect(()=>{k&&!V&&window.turnstile&&se(!0)},[V,k]),E.useEffect(()=>{if(!i){console.warn("sitekey was not provided");return}if(!k||!j.current||!V||U.current)return;const O=window.turnstile.render(j.current,_);B(O),U.current=!0},[k,i,_,U,V]),E.useEffect(()=>{if(window.turnstile&&j.current&&I){a8(I)&&window.turnstile.remove(I);const O=window.turnstile.render(j.current,_);B(O),U.current=!0}},[L,i]),E.useEffect(()=>{if(window.turnstile&&I&&a8(I))return a==null||a(I),()=>{window.turnstile.remove(I)}},[I,a]),E.useEffect(()=>{S(n.execution==="execute"?Bc.invisible:_.appearance==="interaction-only"?Bc.interactionOnly:Bc[b])},[n.execution,b,_.appearance]),E.useEffect(()=>{!k||typeof h!="function"||h()},[k,h]),d.jsx(A$e,{ref:j,as:w,id:Y,style:{...A,...m},...v})});Rre.displayName="Turnstile";const L$e=t=>{let{enabled:e,siteKey:r,appId:n,setError:i,setToken:a,setExecuting:s,ref:o}=Do(),[,l]=E.useMemo(()=>(r==null?void 0:r.split("t:"))||[],[r]);if(E.useEffect(()=>{var c;return(c=o.current)==null?void 0:c.remove},[]),!e)return null;if(!l)throw Error("Unsupported captcha site key");return d.jsx("div",{className:"hidden h-0 w-0",children:d.jsx(Rre,{...t,ref:o,siteKey:l,options:{action:n,size:"invisible",...t.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{var c;(c=t.onUnsupported)==null||c.call(t),console.warn("Browser does not support Turnstile.")},onError:()=>{var c;(c=t.onError)==null||c.call(t),i("Captcha failed"),s(!1)},onSuccess:c=>{var u;(u=t.onSuccess)==null||u.call(t,c),a(c),s(!1)},onExpire:()=>{var c,u;(c=t.onExpire)==null||c.call(t);try{(u=o.current)==null||u.reset(),i(void 0),a(void 0)}catch{i("expired_and_failed_reset")}}})})};var Fa=function(){return Fa=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0?Ji(Om,--bl):0,Qg--,xi===10&&(Qg=1,jx--),xi}function gc(){return xi=bl2||QM(xi)>3?"":" "}function z$e(t,e){for(;--e&&gc()&&!(xi<48||xi>102||xi>57&&xi<65||xi>70&&xi<97););return Px(t,O6()+(e<6&&$0()==32&&gc()==32))}function ZM(t){for(;gc();)switch(xi){case t:return bl;case 34:case 39:t!==34&&t!==39&&ZM(xi);break;case 40:t===41&&ZM(t);break;case 92:gc();break}return bl}function W$e(t,e){for(;gc()&&t+xi!==57;)if(t+xi===84&&$0()===47)break;return"/*"+Px(e,bl-1)+"*"+ZL(t===47?t:gc())}function H$e(t){for(;!QM($0());)gc();return Px(t,bl)}function G$e(t){return U$e(F6("",null,null,null,[""],t=F$e(t),0,[0],t))}function F6(t,e,r,n,i,a,s,o,l){for(var c=0,u=0,f=s,h=0,g=0,m=0,w=1,C=1,v=1,b=0,A="",S=i,j=a,U=n,I=A;C;)switch(m=b,b=gc()){case 40:if(m!=108&&Ji(I,f-1)==58){D6(I+=Er(uS(b),"&","&\f"),"&\f",Fre(c?o[c-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:I+=uS(b);break;case 9:case 10:case 13:case 32:I+=B$e(m);break;case 92:I+=z$e(O6()-1,7);continue;case 47:switch($0()){case 42:case 47:gy(q$e(W$e(gc(),O6()),e,r,l),l);break;default:I+="/"}break;case 123*w:o[c++]=eu(I)*v;case 125*w:case 59:case 0:switch(b){case 0:case 125:C=0;case 59+u:v==-1&&(I=Er(I,/\f/g,"")),g>0&&eu(I)-f&&gy(g>32?oz(I+";",n,r,f-1,l):oz(Er(I," ","")+";",n,r,f-2,l),l);break;case 59:I+=";";default:if(gy(U=sz(I,e,r,c,u,i,o,A,S=[],j=[],f,a),a),b===123)if(u===0)F6(I,e,U,U,S,a,f,o,j);else switch(h===99&&Ji(I,3)===110?100:h){case 100:case 108:case 109:case 115:F6(t,U,U,n&&gy(sz(t,U,U,0,0,i,o,A,i,S=[],f,j),j),i,j,f,o,n?S:j);break;default:F6(I,U,U,U,[""],j,0,o,j)}}c=u=g=0,w=v=1,A=I="",f=s;break;case 58:f=1+eu(I),g=m;default:if(w<1){if(b==123)--w;else if(b==125&&w++==0&&O$e()==125)continue}switch(I+=ZL(b),b*w){case 38:v=u>0?1:(I+="\f",-1);break;case 44:o[c++]=(eu(I)-1)*v,v=1;break;case 64:$0()===45&&(I+=uS(gc())),h=$0(),u=f=eu(A=I+=H$e(O6())),b++;break;case 45:m===45&&eu(I)==2&&(w=0)}}return a}function sz(t,e,r,n,i,a,s,o,l,c,u,f){for(var h=i-1,g=i===0?a:[""],m=Bre(g),w=0,C=0,v=0;w0?g[b]+" "+A:Er(A,/&\f/g,g[b])))&&(l[v++]=S);return $x(t,e,r,i===0?Lx:o,l,c,u,f)}function q$e(t,e,r,n){return $x(t,e,r,Dre,ZL(D$e()),Jg(t,2,-2),0,n)}function oz(t,e,r,n,i){return $x(t,e,r,QL,Jg(t,0,n),Jg(t,n+1,-1),n,i)}function Wre(t,e,r){switch(P$e(t,e)){case 5103:return nn+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return nn+t+t;case 4789:return Wy+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return nn+t+Wy+t+$n+t+t;case 5936:switch(Ji(t,e+11)){case 114:return nn+t+$n+Er(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nn+t+$n+Er(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nn+t+$n+Er(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return nn+t+$n+t+t;case 6165:return nn+t+$n+"flex-"+t+t;case 5187:return nn+t+Er(t,/(\w+).+(:[^]+)/,nn+"box-$1$2"+$n+"flex-$1$2")+t;case 5443:return nn+t+$n+"flex-item-"+Er(t,/flex-|-self/g,"")+(dd(t,/flex-|baseline/)?"":$n+"grid-row-"+Er(t,/flex-|-self/g,""))+t;case 4675:return nn+t+$n+"flex-line-pack"+Er(t,/align-content|flex-|-self/g,"")+t;case 5548:return nn+t+$n+Er(t,"shrink","negative")+t;case 5292:return nn+t+$n+Er(t,"basis","preferred-size")+t;case 6060:return nn+"box-"+Er(t,"-grow","")+nn+t+$n+Er(t,"grow","positive")+t;case 4554:return nn+Er(t,/([^-])(transform)/g,"$1"+nn+"$2")+t;case 6187:return Er(Er(Er(t,/(zoom-|grab)/,nn+"$1"),/(image-set)/,nn+"$1"),t,"")+t;case 5495:case 3959:return Er(t,/(image-set\([^]*)/,nn+"$1$`$1");case 4968:return Er(Er(t,/(.+:)(flex-)?(.*)/,nn+"box-pack:$3"+$n+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+nn+t+t;case 4200:if(!dd(t,/flex-|baseline/))return $n+"grid-column-align"+Jg(t,e)+t;break;case 2592:case 3360:return $n+Er(t,"template-","")+t;case 4384:case 3616:return r&&r.some(function(n,i){return e=i,dd(n.props,/grid-\w+-end/)})?~D6(t+(r=r[e].value),"span",0)?t:$n+Er(t,"-start","")+t+$n+"grid-row-span:"+(~D6(r,"span",0)?dd(r,/\d+/):+dd(r,/\d+/)-+dd(t,/\d+/))+";":$n+Er(t,"-start","")+t;case 4896:case 4128:return r&&r.some(function(n){return dd(n.props,/grid-\w+-start/)})?t:$n+Er(Er(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Er(t,/(.+)-inline(.+)/,nn+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(eu(t)-1-e>6)switch(Ji(t,e+1)){case 109:if(Ji(t,e+4)!==45)break;case 102:return Er(t,/(.+:)(.+)-([^]+)/,"$1"+nn+"$2-$3$1"+Wy+(Ji(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~D6(t,"stretch",0)?Wre(Er(t,"stretch","fill-available"),e,r)+t:t}break;case 5152:case 5920:return Er(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,i,a,s,o,l,c){return $n+i+":"+a+c+(s?$n+i+"-span:"+(o?l:+l-+a)+c:"")+t});case 4949:if(Ji(t,e+6)===121)return Er(t,":",":"+nn)+t;break;case 6444:switch(Ji(t,Ji(t,14)===45?18:11)){case 120:return Er(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+nn+(Ji(t,14)===45?"inline-":"")+"box$3$1"+nn+"$2$3$1"+$n+"$2box$3")+t;case 100:return Er(t,":",":"+$n)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Er(t,"scroll-","scroll-snap-")+t}return t}function s8(t,e){for(var r="",n=0;n-1&&!t.return)switch(t.type){case QL:t.return=Wre(t.value,t.length,r);return;case Ore:return s8([Cf(t,{value:Er(t.value,"@","@"+nn)})],n);case Lx:if(t.length)return R$e(r=t.props,function(i){switch(dd(i,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":xp(Cf(t,{props:[Er(i,/:(read-\w+)/,":"+Wy+"$1")]})),xp(Cf(t,{props:[i]})),JM(t,{props:az(r,n)});break;case"::placeholder":xp(Cf(t,{props:[Er(i,/:(plac\w+)/,":"+nn+"input-$1")]})),xp(Cf(t,{props:[Er(i,/:(plac\w+)/,":"+Wy+"$1")]})),xp(Cf(t,{props:[Er(i,/:(plac\w+)/,$n+"input-$1")]})),xp(Cf(t,{props:[i]})),JM(t,{props:az(r,n)});break}return""})}}var Q$e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},po={},Zg=typeof process<"u"&&po!==void 0&&(po.REACT_APP_SC_ATTR||po.SC_ATTR)||"data-styled",Hre="active",Gre="data-styled-version",Rx="6.1.13",XL=`/*!sc*/ -`,o8=typeof window<"u"&&"HTMLElement"in window,Z$e=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&po!==void 0&&po.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&po.REACT_APP_SC_DISABLE_SPEEDY!==""?po.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&po.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&po!==void 0&&po.SC_DISABLE_SPEEDY!==void 0&&po.SC_DISABLE_SPEEDY!==""&&po.SC_DISABLE_SPEEDY!=="false"&&po.SC_DISABLE_SPEEDY),X$e={},Dx=Object.freeze([]),Xg=Object.freeze({});function qre(t,e,r){return r===void 0&&(r=Xg),t.theme!==r.theme&&t.theme||e||r.theme}var Vre=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),ePe=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,tPe=/(^-|-$)/g;function lz(t){return t.replace(ePe,"-").replace(tPe,"")}var rPe=/(a)(d)/gi,O4=52,cz=function(t){return String.fromCharCode(t+(t>25?39:97))};function XM(t){var e,r="";for(e=Math.abs(t);e>O4;e=e/O4|0)r=cz(e%O4)+r;return(cz(e%O4)+r).replace(rPe,"$1-$2")}var dS,Yre=5381,rg=function(t,e){for(var r=e.length;r;)t=33*t^e.charCodeAt(--r);return t},Kre=function(t){return rg(Yre,t)};function ej(t){return XM(Kre(t)>>>0)}function nPe(t){return t.displayName||t.name||"Component"}function fS(t){return typeof t=="string"&&!0}var Jre=typeof Symbol=="function"&&Symbol.for,Qre=Jre?Symbol.for("react.memo"):60115,iPe=Jre?Symbol.for("react.forward_ref"):60112,aPe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},sPe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Zre={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},oPe=((dS={})[iPe]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},dS[Qre]=Zre,dS);function uz(t){return("type"in(e=t)&&e.type.$$typeof)===Qre?Zre:"$$typeof"in t?oPe[t.$$typeof]:aPe;var e}var lPe=Object.defineProperty,cPe=Object.getOwnPropertyNames,dz=Object.getOwnPropertySymbols,uPe=Object.getOwnPropertyDescriptor,dPe=Object.getPrototypeOf,fz=Object.prototype;function Xre(t,e,r){if(typeof e!="string"){if(fz){var n=dPe(e);n&&n!==fz&&Xre(t,n,r)}var i=cPe(e);dz&&(i=i.concat(dz(e)));for(var a=uz(t),s=uz(e),o=0;o0?" Args: ".concat(e.join(", ")):""))}var fPe=function(){function t(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return t.prototype.indexOfGroup=function(e){for(var r=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,a=i;e>=a;)if((a<<=1)<0)throw lv(16,"".concat(e));this.groupSizes=new Uint32Array(a),this.groupSizes.set(n),this.length=a;for(var s=i;s=this.length||this.groupSizes[e]===0)return r;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),a=i+n,s=i;s=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.prototype.getRule=function(e){return e0&&(C+="".concat(v,","))}),l+="".concat(m).concat(w,'{content:"').concat(C,'"}').concat(XL)},u=0;u0?".".concat(e):h},u=l.slice();u.push(function(h){h.type===Lx&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(_Pe,r).replace(n,c))}),s.prefix&&u.push(J$e),u.push(V$e);var f=function(h,g,m,w){g===void 0&&(g=""),m===void 0&&(m=""),w===void 0&&(w="&"),e=w,r=g,n=new RegExp("\\".concat(r,"\\b"),"g");var C=h.replace(CPe,""),v=G$e(m||g?"".concat(m," ").concat(g," { ").concat(C," }"):C);s.namespace&&(v=tne(v,s.namespace));var b=[];return s8(v,Y$e(u.concat(K$e(function(A){return b.push(A)})))),b};return f.hash=l.length?l.reduce(function(h,g){return g.name||lv(15),rg(h,g.name)},Yre).toString():"",f}var APe=new u8,tT=SPe(),rne=Et.createContext({shouldForwardProp:void 0,styleSheet:APe,stylis:tT});rne.Consumer;Et.createContext(void 0);function rT(){return E.useContext(rne)}var nne=function(){function t(e,r){var n=this;this.inject=function(i,a){a===void 0&&(a=tT);var s=n.name+a.hash;i.hasNameForId(n.id,s)||i.insertRules(n.id,s,a(n.rules,s,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=r,rj(this,function(){throw lv(12,String(n.name))})}return t.prototype.getName=function(e){return e===void 0&&(e=tT),this.name+e.hash},t}(),IPe=function(t){return t>="A"&&t<="Z"};function gz(t){for(var e="",r=0;r>>0);if(!r.hasNameForId(this.componentId,s)){var o=n(a,".".concat(s),void 0,this.componentId);r.insertRules(this.componentId,s,o)}i=_0(i,s),this.staticRulesId=s}else{for(var l=rg(this.baseHash,n.hash),c="",u=0;u>>0);r.hasNameForId(this.componentId,g)||r.insertRules(this.componentId,g,n(c,".".concat(g),void 0,this.componentId)),i=_0(i,g)}}return i},t}(),nj=Et.createContext(void 0);nj.Consumer;var hS={};function kPe(t,e,r){var n=tj(t),i=t,a=!fS(t),s=e.attrs,o=s===void 0?Dx:s,l=e.componentId,c=l===void 0?function(S,j){var U=typeof S!="string"?"sc":lz(S);hS[U]=(hS[U]||0)+1;var I="".concat(U,"-").concat(ej(Rx+U+hS[U]));return j?"".concat(j,"-").concat(I):I}(e.displayName,e.parentComponentId):l,u=e.displayName,f=u===void 0?function(S){return fS(S)?"styled.".concat(S):"Styled(".concat(nPe(S),")")}(t):u,h=e.displayName&&e.componentId?"".concat(lz(e.displayName),"-").concat(e.componentId):e.componentId||c,g=n&&i.attrs?i.attrs.concat(o).filter(Boolean):o,m=e.shouldForwardProp;if(n&&i.shouldForwardProp){var w=i.shouldForwardProp;if(e.shouldForwardProp){var C=e.shouldForwardProp;m=function(S,j){return w(S,j)&&C(S,j)}}else m=w}var v=new TPe(r,h,n?i.componentStyle:void 0);function b(S,j){return function(U,I,B){var V=U.attrs,se=U.componentStyle,Y=U.defaultProps,N=U.foldedComponentIds,k=U.styledComponentId,x=U.target,_=Et.useContext(nj),L=rT(),O=U.shouldForwardProp||L.shouldForwardProp,P=qre(I,_,Y)||Xg,R=function(H,ee,J){for(var te,re=Fa(Fa({},ee),{className:void 0,theme:J}),z=0;z2&&u8.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,r,n,i)},t}();function LPe(t){for(var e=[],r=1;r{if(!t||!t.primary[0])return;let e=[t.primary[0]],r=[];for(let n of(t.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),t.primary.slice(1)))e.includes(n)?console.warn(`Duplicated login method: ${n}`):e.push(n);for(let n of t.overflow??[])e.includes(n)||r.includes(n)?console.warn(`Duplicated login method: ${n}`):r.push(n);return{primary:e,overflow:r}};let $Pe=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),wz=t=>$Pe.has(t),vz=(t,e,r)=>r.indexOf(t)===e;const PPe=({input:t,overrides:e})=>e?e.primary.concat(e.overflow??[]).filter(wz).filter(vz):t?t.filter(wz).filter(vz):lo.appearance.walletList;function ij(t){let e=t.filter(r=>!kre.has(r.id));return r8.concat(e)}function RPe(t,e){return{...t,rpcUrls:{...t.rpcUrls,privy:{http:[e]}}}}const DPe="https://api.mainnet-beta.solana.com",OPe="https://api.testnet.solana.com",FPe="https://api.devnet.solana.com",iT=792703809,aT="11111111111111111111111111111111",UPe="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";function aj(t){return t.includes("testnet")?"testnet":t.includes("devnet")?"devnet":"mainnet-beta"}function BPe(t,e){return`https://explorer.solana.com/tx/${t}?cluster=${e}`}function zPe(t,e){return`https://explorer.solana.com/account/${t}?cluster=${e}`}function WPe({name:t,rpcUrl:e}){if(e)return e;switch(t){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";case"devnet":return"https://api.devnet.solana.com"}}function d8(t){"@babel/helpers - typeof";return d8=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},d8(t)}var HPe=/^\s+/,GPe=/\s+$/;function $t(t,e){if(t=t||"",e=e||{},t instanceof $t)return t;if(!(this instanceof $t))return new $t(t,e);var r=qPe(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}$t.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),r,n,i,a,s,o;return r=e.r/255,n=e.g/255,i=e.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),i<=.03928?o=i/12.92:o=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*s+.0722*o},setAlpha:function(e){return this._a=cne(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=xz(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=xz(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=bz(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=bz(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return Ez(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return JPe(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Fn(this._r,255)*100)+"%",g:Math.round(Fn(this._g,255)*100)+"%",b:Math.round(Fn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Fn(this._r,255)*100)+"%, "+Math.round(Fn(this._g,255)*100)+"%, "+Math.round(Fn(this._b,255)*100)+"%)":"rgba("+Math.round(Fn(this._r,255)*100)+"%, "+Math.round(Fn(this._g,255)*100)+"%, "+Math.round(Fn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:lRe[Ez(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+_z(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(e){var a=$t(e);n="#"+_z(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(e){var r=!!e;e=e||this._format;var n=!1,i=this._a<1&&this._a>=0,a=!r&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return a?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return $t(this.toString())},_applyModification:function(e,r){var n=e.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(eRe,arguments)},brighten:function(){return this._applyModification(tRe,arguments)},darken:function(){return this._applyModification(rRe,arguments)},desaturate:function(){return this._applyModification(QPe,arguments)},saturate:function(){return this._applyModification(ZPe,arguments)},greyscale:function(){return this._applyModification(XPe,arguments)},spin:function(){return this._applyModification(nRe,arguments)},_applyCombination:function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(sRe,arguments)},complement:function(){return this._applyCombination(iRe,arguments)},monochromatic:function(){return this._applyCombination(oRe,arguments)},splitcomplement:function(){return this._applyCombination(aRe,arguments)},triad:function(){return this._applyCombination(Cz,[3])},tetrad:function(){return this._applyCombination(Cz,[4])}};$t.fromRatio=function(t,e){if(d8(t)=="object"){var r={};for(var n in t)t.hasOwnProperty(n)&&(n==="a"?r[n]=t[n]:r[n]=my(t[n]));t=r}return $t(t,e)};function qPe(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,a=null,s=!1,o=!1;return typeof t=="string"&&(t=fRe(t)),d8(t)=="object"&&(td(t.r)&&td(t.g)&&td(t.b)?(e=VPe(t.r,t.g,t.b),s=!0,o=String(t.r).substr(-1)==="%"?"prgb":"rgb"):td(t.h)&&td(t.s)&&td(t.v)?(n=my(t.s),i=my(t.v),e=KPe(t.h,n,i),s=!0,o="hsv"):td(t.h)&&td(t.s)&&td(t.l)&&(n=my(t.s),a=my(t.l),e=YPe(t.h,n,a),s=!0,o="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=cne(r),{ok:s,format:t.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function VPe(t,e,r){return{r:Fn(t,255)*255,g:Fn(e,255)*255,b:Fn(r,255)*255}}function bz(t,e,r){t=Fn(t,255),e=Fn(e,255),r=Fn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),a,s,o=(n+i)/2;if(n==i)a=s=0;else{var l=n-i;switch(s=o>.5?l/(2-n-i):l/(n+i),n){case t:a=(e-r)/l+(e1&&(f-=1),f<1/6?c+(u-c)*6*f:f<1/2?u:f<2/3?c+(u-c)*(2/3-f)*6:c}if(e===0)n=i=a=r;else{var o=r<.5?r*(1+e):r+e-r*e,l=2*r-o;n=s(l,o,t+1/3),i=s(l,o,t),a=s(l,o,t-1/3)}return{r:n*255,g:i*255,b:a*255}}function xz(t,e,r){t=Fn(t,255),e=Fn(e,255),r=Fn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),a,s,o=n,l=n-i;if(s=n===0?0:l/n,n==i)a=0;else{switch(n){case t:a=(e-r)/l+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push($t(n));return a}function oRe(t,e){e=e||6;for(var r=$t(t).toHsv(),n=r.h,i=r.s,a=r.v,s=[],o=1/e;e--;)s.push($t({h:n,s:i,v:a})),a=(a+o)%1;return s}$t.mix=function(t,e,r){r=r===0?0:r||50;var n=$t(t).toRgb(),i=$t(e).toRgb(),a=r/100,s={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return $t(s)};$t.readability=function(t,e){var r=$t(t),n=$t(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};$t.isReadable=function(t,e,r){var n=$t.readability(t,e),i,a;switch(a=!1,i=hRe(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=n>=4.5;break;case"AAlarge":a=n>=3;break;case"AAAsmall":a=n>=7;break}return a};$t.mostReadable=function(t,e,r){var n=null,i=0,a,s,o,l;r=r||{},s=r.includeFallbackColors,o=r.level,l=r.size;for(var c=0;ci&&(i=a,n=$t(e[c]));return $t.isReadable(t,n,{level:o,size:l})||!s?n:(r.includeFallbackColors=!1,$t.mostReadable(t,["#fff","#000"],r))};var sT=$t.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},lRe=$t.hexNames=cRe(sT);function cRe(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function cne(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Fn(t,e){uRe(t)&&(t="100%");var r=dRe(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Ox(t){return Math.min(1,Math.max(0,t))}function co(t){return parseInt(t,16)}function uRe(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function dRe(t){return typeof t=="string"&&t.indexOf("%")!=-1}function oc(t){return t.length==1?"0"+t:""+t}function my(t){return t<=1&&(t=t*100+"%"),t}function une(t){return Math.round(parseFloat(t)*255).toString(16)}function Sz(t){return co(t)/255}var Yl=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function td(t){return!!Yl.CSS_UNIT.exec(t)}function fRe(t){t=t.replace(HPe,"").replace(GPe,"").toLowerCase();var e=!1;if(sT[t])t=sT[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Yl.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Yl.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Yl.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Yl.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Yl.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Yl.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Yl.hex8.exec(t))?{r:co(r[1]),g:co(r[2]),b:co(r[3]),a:Sz(r[4]),format:e?"name":"hex8"}:(r=Yl.hex6.exec(t))?{r:co(r[1]),g:co(r[2]),b:co(r[3]),format:e?"name":"hex"}:(r=Yl.hex4.exec(t))?{r:co(r[1]+""+r[1]),g:co(r[2]+""+r[2]),b:co(r[3]+""+r[3]),a:Sz(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=Yl.hex3.exec(t))?{r:co(r[1]+""+r[1]),g:co(r[2]+""+r[2]),b:co(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function hRe(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}let Az="#FFFFFF";function pRe(t){return t<.8&&t>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),t>.5?"light":"dark"}function Ms(t,e){let r=Math.max(0,Math.min(1,t.toHsl().l+e));return $t({...t.toHsl(),l:r})}function gRe({backgroundTheme:t,accentHex:e}){let r;switch(t){case"light":r=Az;break;case"dark":r="#1E1E1D";break;default:r=t}let n=$t(r),i=$t(e),a=$t("#51BA81"),s=$t("#FFB74D"),o=$t("#EC6351"),l=pRe(n.getLuminance()),c=Ms(n,l==="light"?-.04:.11),u=Ms(n,l==="light"?-.08:.16),f=Ms(n,l==="light"?-.88:.87),h=Ms(n,l==="light"?-.7:.75),g=Ms(n,l==="light"?-.43:.45).desaturate(l==="light"?60:20),m=Ms(n,l==="light"?-.08:.25).desaturate(l==="light"?60:20),w=Ms(i,.15),C=Ms(i,.25),v=Ms(i,-.06),b=Ms(i,-.6),A=Ms(o,.3),S=Ms(s,.3),j=$t(i.getLuminance()>.5?"#040217":Az),U=Ms(a,-.16),I=Ms(a,.4);return{colorScheme:l,background:n.toHslString(),background2:c.toHslString(),background3:u.toHslString(),foreground:f.toHslString(),foreground2:h.toHslString(),foreground3:g.toHslString(),foreground4:m.toHslString(),accent:i.toHslString(),accentLight:w.toHslString(),accentLightest:C.toHslString(),accentDark:v.toHslString(),accentDarkest:b.toHslString(),foregroundAccent:j.toHslString(),success:a.toHslString(),successDark:U.toHslString(),successLight:I.toHslString(),error:o.toHslString(),errorLight:A.toHslString(),warn:s.toHslString(),warnLight:S.toHslString()}}function dne(t,e,r){var M,D,$,X,le,H,ee,J,te,re,z,G,Q,me,be,Ce,Fe,Ue,Ke,lt,Ee,He,qe,Ie,Ne,$e,je,K,F,W,ie,pe,we,he,Re,Je,et,it,ut,pt,tr;let n,i,a,s,o,l,c,u,f,h,g,m,w,C,v,b,A=r?console.warn:()=>{};e!=null&&e.loginMethods?(n=e.loginMethods.includes("email"),i=e.loginMethods.includes("sms"),s=e.loginMethods.includes("wallet"),o=e.loginMethods.includes("google"),l=e.loginMethods.includes("twitter"),c=e.loginMethods.includes("discord"),f=e.loginMethods.includes("spotify"),h=e.loginMethods.includes("instagram"),u=e.loginMethods.includes("tiktok"),m=e.loginMethods.includes("github"),g=e.loginMethods.includes("linkedin"),w=e.loginMethods.includes("apple"),C=e.loginMethods.includes("farcaster"),v=e.loginMethods.includes("telegram")):(n=t.emailAuth,i=t.smsAuth,s=t.walletAuth||t.solanaWalletAuth,o=t.googleOAuth,l=t.twitterOAuth,c=t.discordOAuth,m=t.githubOAuth,f=t.spotifyOAuth,h=t.instagramOAuth,u=t.tiktokOAuth,g=t.linkedinOAuth,w=t.appleOAuth,C=t.farcasterAuth,v=t.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:t.passkeyAuth&&(a=!0);let S=[n,i].filter(Boolean),j=[o,l,c,m,f,h,u,g,w,C,v].filter(Boolean),U=[s].filter(Boolean);if(S.length+j.length+U.length===0)throw Error("You must enable at least one login method");let I=((M=e==null?void 0:e.appearance)==null?void 0:M.showWalletLoginFirst)!==void 0?(D=e==null?void 0:e.appearance)==null?void 0:D.showWalletLoginFirst:t.showWalletLoginFirst;I&&U.length===0?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):I||j.length+S.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),I=!0);let B=((X=($=e==null?void 0:e.externalWallets)==null?void 0:$.walletConnect)==null?void 0:X.enabled)??!0;e!=null&&e.loginMethods&&e.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let V=PPe({input:(le=e==null?void 0:e.appearance)==null?void 0:le.walletList,overrides:e==null?void 0:e.loginMethodsAndOrder}),se=jPe({input:e==null?void 0:e.loginMethodsAndOrder}),Y=((H=e==null?void 0:e.intl)==null?void 0:H.defaultCountry)??"US",{chains:N,defaultChain:k}=yRe({additionalChains:e==null?void 0:e.additionalChains,supportedChains:e==null?void 0:e.supportedChains,defaultChainFromConfig:e==null?void 0:e.defaultChain,hasRpcConfigDefined:Object.keys(((ee=e==null?void 0:e.rpcConfig)==null?void 0:ee.rpcUrls)??{}).length>0}),x=!!(e!=null&&e.defaultChain),_=((J=e==null?void 0:e.customAuth)==null?void 0:J.getCustomAccessToken)&&((te=e==null?void 0:e.customAuth)==null?void 0:te.enabled)!==!1,L=!(t.enforceWalletUis??1);if(b=t.legacyWalletUiConfig??1?_?((re=e==null?void 0:e.embeddedWallets)==null?void 0:re.noPromptOnSignature)??!0:((z=e==null?void 0:e.embeddedWallets)==null?void 0:z.noPromptOnSignature)??L:L,((G=e==null?void 0:e.embeddedWallets)==null?void 0:G.waitForTransactionConfirmation)===!1&&b!==!0)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:O,...P}=(e==null?void 0:e.embeddedWallets)??{},R=(e==null?void 0:e.solanaClusters)??[];return t.solanaWalletAuth&&!((me=(Q=e==null?void 0:e.externalWallets)==null?void 0:Q.solana)!=null&&me.connectors)&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{id:t.id,name:t.name,allowlistConfig:t.allowlistConfig,legacyWalletUiConfig:t.legacyWalletUiConfig,appearance:{logo:((be=e==null?void 0:e.appearance)==null?void 0:be.logo)??t.logoUrl,landingHeader:((Ce=e==null?void 0:e.appearance)==null?void 0:Ce.landingHeader)??lo.appearance.landingHeader,loginMessage:typeof((Fe=e==null?void 0:e.appearance)==null?void 0:Fe.loginMessage)=="string"?(Ue=e==null?void 0:e.appearance)==null?void 0:Ue.loginMessage.slice(0,100):(Ke=e==null?void 0:e.appearance)==null?void 0:Ke.loginMessage,palette:gRe({backgroundTheme:((lt=e==null?void 0:e.appearance)==null?void 0:lt.theme)??lo.appearance.theme,accentHex:((Ee=e==null?void 0:e.appearance)==null?void 0:Ee.accentColor)??t.accentColor??lo.appearance.accentColor}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!((He=e==null?void 0:e.appearance)!=null&&He.hideDirectWeb2Inputs),walletList:V,walletChainType:((qe=e==null?void 0:e.appearance)==null?void 0:qe.walletChainType)??(({evmWalletAuth:zt,solanaWalletAuth:At})=>zt&&At?"ethereum-and-solana":zt?"ethereum-only":At?"solana-only":"ethereum-only")({evmWalletAuth:t.walletAuth??!1,solanaWalletAuth:t.solanaWalletAuth??!1})},loginMethods:{wallet:s,email:n,sms:i,passkey:a,google:o,twitter:l,discord:c,github:m,spotify:f,instagram:h,tiktok:u,linkedin:g,apple:w,farcaster:C,telegram:v},disablePlusEmails:t.disablePlusEmails,loginMethodsAndOrder:se,legal:{termsAndConditionsUrl:((Ie=e==null?void 0:e.legal)==null?void 0:Ie.termsAndConditionsUrl)??t.termsAndConditionsUrl,privacyPolicyUrl:((Ne=e==null?void 0:e.legal)==null?void 0:Ne.privacyPolicyUrl)??t.privacyPolicyUrl,requireUsersAcceptTerms:t.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:(e==null?void 0:e.walletConnectCloudProjectId)??t.walletConnectCloudProjectId??lo.walletConnectCloudProjectId,rpcConfig:{rpcUrls:(($e=e==null?void 0:e.rpcConfig)==null?void 0:$e.rpcUrls)??lo.rpcConfig.rpcUrls,rpcTimeouts:((je=e==null?void 0:e.rpcConfig)==null?void 0:je.rpcTimeouts)??lo.rpcConfig.rpcTimeouts},chains:N,solanaClusters:{"mainnet-beta":((K=R.find(zt=>zt.name==="mainnet-beta"))==null?void 0:K.rpcUrl)||DPe,testnet:((F=R.find(zt=>zt.name==="testnet"))==null?void 0:F.rpcUrl)||OPe,devnet:((W=R.find(zt=>zt.name==="devnet"))==null?void 0:W.rpcUrl)||FPe},defaultChain:k,intl:{defaultCountry:Y},shouldEnforceDefaultChainOnConnect:x,captchaEnabled:t.captchaEnabled??lo.captchaEnabled,captchaSiteKey:t.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:((pe=(ie=e==null?void 0:e.externalWallets)==null?void 0:ie.coinbaseWallet)==null?void 0:pe.connectionOptions)??lo.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:B},solana:{connectors:(he=(we=e==null?void 0:e.externalWallets)==null?void 0:we.solana)==null?void 0:he.connectors}},embeddedWallets:{...t.embeddedWalletConfig,...typeof O=="boolean"?{requireUserOwnedRecoveryOnCreate:O}:{},..._?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...P,noPromptOnSignature:b,showWalletUIs:(Re=e==null?void 0:e.embeddedWallets)==null?void 0:Re.showWalletUIs,extendedCalldataDecoding:(Je=e==null?void 0:e.embeddedWallets)==null?void 0:Je.extendedCalldataDecoding},mfa:{methods:t.mfaMethods??[],noPromptOnMfaRequired:((et=e==null?void 0:e.mfa)==null?void 0:et.noPromptOnMfaRequired)??!1},customAuth:_?{enabled:!0,...e.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:t.telegramAuthConfiguration},headless:!!(e!=null&&e.headless),render:{standalone:((it=e==null?void 0:e._render)==null?void 0:it.standalone)??lo._render.standalone},fundingConfig:t.fundingConfig,fundingMethodConfig:{...(e==null?void 0:e.fundingMethodConfig)??lo.fundingMethodConfig,moonpay:{...((ut=e==null?void 0:e.fundingMethodConfig)==null?void 0:ut.moonpay)??lo.fundingMethodConfig.moonpay,useSandbox:((pt=e==null?void 0:e.fundingMethodConfig)==null?void 0:pt.moonpay.useSandbox)??((tr=e==null?void 0:e.fiatOnRamp)==null?void 0:tr.useSandbox)??lo.fundingMethodConfig.moonpay.useSandbox}}}}function mRe(t,e){var l,c;if(!t)return{legacyCreateEmbeddedWalletFlag:e};let{appearance:r,additionalChains:n,supportedChains:i,defaultChain:a,externalWallets:s,...o}=t;return{...o,...n?{additionalChains:n.map(u=>u.id)}:void 0,...i?{supportedChains:i.map(u=>u.id)}:void 0,...a?{defaultChain:a.id}:void 0,...s?{walletConnect:s.walletConnect,coinbaseWallet:s.coinbaseWallet,solana:{connectors:(c=(l=s.solana)==null?void 0:l.connectors)==null?void 0:c.get().map(u=>u.walletClientType)}}:void 0,legacyCreateEmbeddedWalletFlag:e}}function yRe({additionalChains:t,supportedChains:e,defaultChainFromConfig:r,hasRpcConfigDefined:n}){let i;if(t&&e&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),e){if(e.length===0)throw Error("`supportedChains` must contain at least one chain");e.filter(o=>o.rpcUrls.privyWalletOverride).length>0&&n&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),i=e.map(o=>{var u;if(o.rpcUrls.privyWalletOverride)return o;let l=r8.find(f=>f.id===o.id),c=(u=l==null?void 0:l.rpcUrls.privy)==null?void 0:u.http[0];return c?RPe(o,c):o})}else i=r8.concat(t??[]);let a=e?i[0]:Ru,s=r??a;if(!i.find(o=>o.id===s.id))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:s}}const wRe=function(t,e=0){let r=3735928559^e,n=1103547991^e;for(let i,a=0;a>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)};let fne={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:"",enforceWalletUis:!1,legacyWalletUiConfig:!1};const hne=dne(fne,void 0,!1);let sj=E.createContext({appConfig:hne,isServerConfigLoaded:!1});const vRe=({children:t,legacyCreateEmbeddedWalletFlag:e,client:r,clientConfig:n})=>{let[i,a]=E.useState(null),s=E.useMemo(()=>dne(i??fne,n,!!i),[i,n]);return E.useEffect(()=>{if(!i)return;let o=mRe(n,e),l=wRe(JSON.stringify(o)).toString(),c=`privy:sent:${i.id}:${l}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:o}),localStorage.setItem(c,"t"))},[n,e,i]),E.useEffect(()=>{i||(async()=>{try{let o=await r.getServerConfig();o.customApiUrl&&r.updateApiUrl(o.customApiUrl),a(o)}catch(o){console.warn("Error generating app config: ",o)}})()},[]),d.jsx(sj.Provider,{value:{appConfig:s,isServerConfigLoaded:!!i},children:t})},Ai=()=>{let{appConfig:t}=E.useContext(sj);return t},bRe=()=>{let{isServerConfigLoaded:t}=E.useContext(sj);return t},pne=E.createContext({setAuthenticated:Pe,setUser:Pe,isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},noPromptOnSignature:{current:!1},nativeTokenSymbolForChainId:Pe,initializeWalletProxy:Pe,getAuthMeta:Pe,getAuthFlow:Pe,closePrivyModal:Pe,openPrivyModal:Pe,connectWallet:Pe,initLoginWithWallet:Pe,loginWithWallet:Pe,initLoginWithFarcaster:Pe,loginWithFarcaster:Pe,loginWithCode:Pe,initLoginWithEmail:Pe,initLoginWithSms:Pe,initUpdateEmail:Pe,initUpdatePhone:Pe,resendEmailCode:Pe,resendSmsCode:Pe,initLoginWithHeadlessOAuth:Pe,loginWithHeadlessOAuth:Pe,crossAppAuthFlow:Pe,initLoginWithOAuth:Pe,recoveryOAuthFlow:Pe,loginWithOAuth:Pe,passkeyAuthState:{status:"initial"},setPasskeyAuthState:Pe,initLoginWithPasskey:Pe,loginWithPasskey:Pe,initLinkWithPasskey:Pe,linkWithPasskey:Pe,refreshUser:Pe,loginWithGuestAccountFlow:Pe,walletProxy:null,createAnalyticsEvent:Pe,acceptTerms:Pe,getUsdTokenPrice:Pe,getUsdPriceForSol:Pe,recoverPrimaryWallet:Pe,updateWallets:Pe,fundWallet:Pe,openModal:Pe,setReadyToTrue:Pe,requestFarcasterSignerStatus:Pe,initLoginWithTelegram:Pe,loginWithTelegram:Pe,generateSiweMessage:Pe,generateSiweMessageForSmartWallet:Pe,linkWithSiwe:Pe,linkSmartWallet:Pe,delegateWallet:Pe,revokeDelegatedWallets:Pe,createEmbeddedSolanaWallet:Pe,exportSolanaWallet:Pe,solanaSignMessage:Pe,connectCoinbaseSmartWallet:Pe,initiateAccountTransfer:Pe,emailOtpState:{status:"initial"},setEmailOtpState:Pe,smsOtpState:{status:"initial"},setSmsOtpState:Pe,siweState:{status:"initial"},setSiweState:Pe,oAuthState:{status:"initial"},setOAuthState:Pe,isHeadlessOAuthLoading:!1}),_t=()=>E.useContext(pne);function xRe({src:t,...e}){return d.jsx("img",{src:t,...e,style:{display:"none"}})}var Ht,ye=((Ht={}).LANDING="LANDING",Ht.CONNECT_OR_CREATE="CONNECT_OR_CREATE",Ht.AWAITING_CONNECTION="AWAITING_CONNECTION",Ht.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",Ht.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",Ht.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",Ht.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",Ht.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",Ht.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",Ht.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",Ht.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",Ht.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",Ht.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",Ht.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",Ht.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",Ht.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",Ht.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",Ht.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",Ht.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",Ht.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",Ht.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",Ht.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",Ht.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",Ht.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",Ht.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",Ht.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",Ht.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",Ht.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",Ht.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",Ht.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",Ht.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",Ht.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",Ht.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",Ht.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",Ht.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",Ht.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",Ht.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",Ht.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",Ht.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",Ht.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",Ht.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",Ht.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",Ht.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",Ht.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",Ht.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",Ht.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",Ht.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",Ht.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",Ht.CAPTCHA_SCREEN="CAPTCHA_SCREEN",Ht.ERROR_SCREEN="ERROR_SCREEN",Ht.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",Ht.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",Ht.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN",Ht);const gne=E.createContext({ready:!1,app:hne,currentScreen:null,lastScreen:null,navigate:Pe,navigateBack:Pe,resetNavigation:Pe,setModalData:Pe,onUserCloseViaDialogOrKeybindRef:void 0});let ERe=[ye.LANDING,ye.CONNECT_ONLY_LANDING_SCREEN,null];const _Re=t=>{var o;let e=Ai(),r=t.authenticated,[n,i]=E.useState(t.initialScreen);E.useEffect(()=>{r||ERe.includes(t.initialScreen)||t.setInitialScreen(null)},[r]);let a=E.useRef(null);E.useEffect(()=>{t.open||(a.current=null)},[t.open]),E.useEffect(()=>{a.current=null},[t.initialScreen]);let s={ready:!!e.id,app:e,data:t.data,setModalData:t.setModalData,currentScreen:t.initialScreen,lastScreen:n,navigate:(l,c=!0)=>{t.setInitialScreen(l),c&&i(t.initialScreen)},navigateBack:()=>{t.setInitialScreen(n)},resetNavigation:()=>{t.setInitialScreen(null),i(null)},onUserCloseViaDialogOrKeybindRef:a};return d.jsxs(gne.Provider,{value:s,children:[(typeof e.appearance.logo=="string"||((o=e.appearance.logo)==null?void 0:o.type)==="img")&&d.jsx(xRe,{src:typeof e.appearance.logo=="string"?e.appearance.logo:e.appearance.logo.props.src}),t.children]})},wt=()=>E.useContext(gne),Fm=E.createContext({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:Pe,login:Pe,connectOrCreateWallet:Pe,linkEmail:Pe,linkPhone:Pe,linkFarcaster:Pe,linkWallet:Pe,startCrossAppAuthFlow:Pe,linkGoogle:Pe,linkTwitter:Pe,linkDiscord:Pe,linkGithub:Pe,linkSpotify:Pe,linkInstagram:Pe,linkTelegram:Pe,linkTiktok:Pe,linkLinkedIn:Pe,linkApple:Pe,linkPasskey:Pe,updateEmail:Pe,updatePhone:Pe,logout:Pe,getAccessToken:Pe,getEthereumProvider:Pe,getEthersProvider:Pe,getWeb3jsProvider:Pe,unlinkEmail:Pe,unlinkPhone:Pe,unlinkWallet:Pe,unlinkGoogle:Pe,unlinkTwitter:Pe,unlinkDiscord:Pe,unlinkGithub:Pe,unlinkSpotify:Pe,unlinkInstagram:Pe,unlinkTiktok:Pe,unlinkLinkedIn:Pe,unlinkApple:Pe,unlinkCrossAppAccount:Pe,unlinkFarcaster:Pe,unlinkTelegram:Pe,unlinkPasskey:Pe,setActiveWallet:Pe,forkSession:Pe,createWallet:Pe,signMessage:Pe,signTypedData:Pe,enrollInMfa:Pe,initEnrollmentWithSms:Pe,initEnrollmentWithTotp:Pe,initEnrollmentWithPasskey:Pe,promptMfa:Pe,init:Pe,submitEnrollmentWithSms:Pe,submitEnrollmentWithTotp:Pe,submitEnrollmentWithPasskey:Pe,unenroll:Pe,submit:Pe,cancel:Pe,sendTransaction:Pe,sendSolanaTransaction:Pe,exportWallet:Pe,setWalletPassword:Pe,setWalletRecovery:Pe,requestFarcasterSignerFromWarpcast:Pe,getFarcasterSignerPublicKey:Pe,signFarcasterMessage:Pe,createGuestAccount:Pe,signMessageWithCrossAppWallet:Pe,signTypedDataWithCrossAppWallet:Pe,sendTransactionWithCrossAppWallet:Pe,isModalOpen:!1,mfaMethods:[]}),$r=()=>E.useContext(Fm),CRe=t=>{let[e,r]=E.useState("auto");return E.useEffect(()=>{let n=new ResizeObserver(i=>{var a;r(((a=i[0])==null?void 0:a.contentRect.height)??"auto")});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current]),e},SRe={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},mne=E.createContext(void 0);let yne=()=>E.useContext(mne);function oj(t,e){if(!e)return;let r=yne().current[t];return E.useEffect(()=>{var n;for(let[i,a]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,i)||console.warn(`Invalid event type "${i}" for action "${t}"`),(n=r[i])==null||n.push(a);return()=>{var i;for(let[a,s]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,a)||console.warn(`Invalid event type "${a}" for action "${t}"`),r[a]=(i=r[a])==null?void 0:i.filter(o=>o!==s)}},[e])}function ze(t,e,r,...n){for(let i of t.current[e][r])i(...n)}function lj(){let t=yne();return(e,r,...n)=>ze(t,e,r,...n)}function ARe(t){oj("configureMfa",t)}function IRe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))}const P0=E.forwardRef(IRe),_c=({success:t,fail:e})=>d.jsxs(d.Fragment,{children:[d.jsx(xl,{className:t?"success":e?"fail":""}),d.jsx(cj,{className:t?"success":e?"fail":""})]}),xl=fe.span.withConfig({displayName:"Loader",componentId:"sc-ce7792e2-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;}@keyframes rotation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}&&&.success{border-color:var(--privy-color-success);border-bottom-color:var(--privy-color-success);}&&&.fail{border-color:var(--privy-color-error);border-bottom-color:var(--privy-color-error);}"],t=>t.color??"var(--privy-color-accent)"),cj=fe(xl).withConfig({displayName:"LoaderFaint",componentId:"sc-ce7792e2-1"})(["&&{border-bottom-color:",";animation:none;opacity:0.5;}"],t=>t.color??"var(--privy-color-accent)"),Ih=t=>d.jsx(MRe,{color:t.color||"var(--privy-color-foreground-3)"});let MRe=fe(xl).withConfig({displayName:"StyledButtonLoader",componentId:"sc-ce7792e2-2"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const Fx=fe.button.withConfig({displayName:"Button",componentId:"sc-e15d0508-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{padding:12px 16px;}"]),Ot=({children:t,loading:e,disabled:r,success:n,loadingText:i="Loading...",...a})=>d.jsx(wne,{disabled:e||r,success:n,...a,children:e?d.jsxs("span",{children:[d.jsx(Ih,{}),i?d.jsx("span",{children:i}):null]}):t}),Xw=({children:t,loading:e,disabled:r,...n})=>d.jsx(TRe,{disabled:r,...n,children:e?d.jsx(Ih,{color:"var(--privy-color-foreground-accent)"}):t});let TRe=fe(Fx).withConfig({displayName:"StyledPrimaryButtonWithoutGray",componentId:"sc-e15d0508-1"})(["position:relative;&&{background-color:var(--privy-color-accent);color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:disabled,&:hover:disabled,&:active:disabled{cursor:not-allowed;pointer-events:none;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent-dark);}"]);const kRe=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>d.jsx(wne,{as:"a",disabled:e||r,...i,children:e?d.jsxs("span",{children:[d.jsx(Ih,{}),n?d.jsx("span",{children:n}):null]}):t});let wne=fe(Fx).withConfig({displayName:"StyledPrimaryButton",componentId:"sc-e15d0508-2"})(["position:relative;&&{background-color:",";color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:",";}&:active{background-color:",";}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}"," > span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent)",t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)",t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)",t=>t.disabled?la(["&&&,&&&:hover,&&&:active{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;pointer-events:none;}"]):"");const Yd=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>d.jsx(NRe,{disabled:e||r,...i,children:e?d.jsxs("span",{children:[d.jsx(Ih,{}),n?d.jsx("span",{children:n}):null]}):t});let NRe=fe(Fx).withConfig({displayName:"StyledSecondaryButton",componentId:"sc-e15d0508-3"})(["&&{border-width:1px;border-color:",";color:var(--privy-color-foreground);transition:border-color 200ms ease;}&:hover,&:active{border-color:",";}&:hover:disabled,&:active:disabled{border-color:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-3);cursor:not-allowed;}> span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],t=>t.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)",t=>t.warn?"var(--privy-color-error)":"var(--privy-color-foreground-3)");const uj=fe.button.withConfig({displayName:"SoftCtaButton",componentId:"sc-e15d0508-4"})(["&&{padding:12px 16px;font-weight:500;text-align:center;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent);border-radius:var(--privy-border-radius-sm);min-width:144px;opacity:",";transition:opacity 200ms ease,background-color 200ms ease,color 200ms ease;user-select:none;"," &:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],t=>t.invisible?"0":"1",t=>t.invisible&&la(["pointer-events:none;"])),dj=({children:t,onClick:e,disabled:r,isSubmitting:n,...i})=>d.jsxs(LRe,{$isSubmitting:n,onClick:e,disabled:r,...i,children:[d.jsx("span",{children:t}),d.jsx("span",{children:d.jsx(Ih,{})})]});let LRe=fe.button.withConfig({displayName:"StyledEmbeddedButton",componentId:"sc-e15d0508-6"})(["&&{color:var(--privy-color-accent);font-size:16px;font-style:normal;font-weight:500;line-height:24px;cursor:pointer;border-radius:0px var(--privy-border-radius-mdlg) var(--privy-border-radius-mdlg) 0px;border:none;transition:color 200ms ease;@media (min-width:441px){font-size:14px;}:hover{color:var(--privy-color-accent-dark);}&& > :first-child{opacity:",";}&& > :last-child{position:absolute;display:flex;top:50%;left:50%;transform:translate3d(-50%,-50%,0);opacity:",";}:disabled,:hover:disabled{color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],t=>t.$isSubmitting?0:1,t=>t.$isSubmitting?1:0);const vne=fe.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],t=>t.color??"var(--privy-color-accent)",t=>t.color??"var(--privy-color-accent)");function jRe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const $Re=E.forwardRef(jRe);function PRe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const RRe=E.forwardRef(PRe);function DRe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const ORe=E.forwardRef(DRe),bne=({backFn:t})=>d.jsx("div",{children:d.jsx(Ux,{onClick:t,children:d.jsx($Re,{height:"16px",width:"16px",strokeWidth:2})})}),FRe=({nextFn:t})=>d.jsx("div",{children:d.jsx(Ux,{onClick:t,children:d.jsx(RRe,{height:"16px",width:"16px",strokeWidth:2})})}),URe=({infoFn:t})=>d.jsx("div",{children:d.jsx(zRe,{"aria-label":"info",onClick:t,children:d.jsx(P0,{height:"22px",width:"22px",strokeWidth:2})})}),BRe=t=>d.jsx("div",{children:d.jsx(Ux,{"aria-label":"close modal",onClick:t.onClose,children:d.jsx(ORe,{height:"16px",width:"16px",strokeWidth:2})})}),ft=({backFn:t,infoFn:e,onClose:r,title:n,closeable:i=!0})=>{let{closePrivyModal:a}=_t(),s=Ai();return d.jsxs(WRe,{children:[d.jsxs(HRe,{children:[t&&d.jsx(bne,{backFn:t}),e&&d.jsx(URe,{infoFn:e})]}),n&&d.jsx(qRe,{id:"privy-dialog-title",children:n}),d.jsx(GRe,{children:!s.render.standalone&&i&&d.jsx(BRe,{onClose:r||(()=>a())})})]})};let Ux=fe.button.withConfig({displayName:"StyledButton",componentId:"sc-f295093d-0"})(["&&{cursor:pointer;display:flex;opacity:0.6;background-color:var(--privy-color-background-2);border-radius:var(--privy-border-radius-full);padding:4px;> svg{margin:auto;color:var(--privy-color-foreground);}:hover{opacity:1;}}"]),zRe=fe(Ux).withConfig({displayName:"TransparentStyledButton",componentId:"sc-f295093d-1"})(["&&{background-color:transparent;}"]),WRe=fe.div.withConfig({displayName:"StyledHeader",componentId:"sc-f295093d-2"})(["padding:16px 0;display:flex;align-items:center;justify-content:space-between;h2{font-size:16px;line-height:24px;font-weight:600;color:var(--privy-color-foreground);}"]),HRe=fe.div.withConfig({displayName:"LeftActionContainer",componentId:"sc-f295093d-3"})(["flex:1;align-items:center;display:flex;gap:8px;"]),GRe=fe.div.withConfig({displayName:"RightActionContainer",componentId:"sc-f295093d-4"})(["flex:1;display:flex;justify-content:flex-end;"]),qRe=fe.div.withConfig({displayName:"TitleContainer",componentId:"sc-f295093d-5"})(["overflow:hidden;white-space:nowrap;max-width:100%;text-overflow:ellipsis;text-align:center;color:var(--privy-color-foreground-2);"]),Js=fe.div.withConfig({displayName:"StackedContainer",componentId:"sc-f7e7d474-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const uh=fe.div.withConfig({displayName:"Grow",componentId:"sc-b51c7c74-0"})(["text-align:left;flex-grow:1;"]),xne=fe.div.withConfig({displayName:"AlignBottom",componentId:"sc-b51c7c74-1"})(["display:flex;flex-direction:column;justify-content:flex-end;flex-grow:1;"]),dh=fe.div.withConfig({displayName:"LoginMethodContainer",componentId:"sc-b51c7c74-2"})(["display:flex;flex-direction:column;gap:12px;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]),VRe=fe(dh).withConfig({displayName:"LoginMethodContainerWithScrollShadows",componentId:"sc-b51c7c74-3"})([""," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],t=>t.$colorScheme==="light"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":t.$colorScheme==="dark"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0);let Ene=la(["&&{width:100%;font-size:16px;line-height:24px;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;align-items:center;padding:12px 16px;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-mdlg);transition:background-color 200ms ease;cursor:pointer;&:hover{background-color:var(--privy-color-background-2);}&:disabled{cursor:pointer;background-color:var(--privy-color-background-2);}svg{height:24px;max-height:24px;max-width:24px;}}"]);const _ne=fe.div.withConfig({displayName:"Subtitle",componentId:"sc-b51c7c74-4"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Jn=fe.button.attrs({className:"login-method-button"}).withConfig({displayName:"LoginMethodButton",componentId:"sc-b51c7c74-5"})(["",""],Ene),Iz=fe.a.withConfig({displayName:"LoginMethodButtonLink",componentId:"sc-b51c7c74-6"})(["",""],Ene),n1=fe.div.withConfig({displayName:"Hide",componentId:"sc-b51c7c74-7"})(["width:100%;height:100%;min-height:inherit;display:flex;flex-direction:column;",""],t=>t.$if?"display: none;":""),YRe=fe.div.withConfig({displayName:"EmptyWalletState",componentId:"sc-b51c7c74-8"})(["width:100%;height:100%;padding:",";"],t=>t.$withPadding?"64px 0px":"0px"),KRe=fe.div.withConfig({displayName:"Header",componentId:"sc-b51c7c74-9"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:32px;gap:12px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),JRe=()=>{let{navigate:t,app:e}=wt();return d.jsxs(d.Fragment,{children:[d.jsx(ft,{}),d.jsxs(QRe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(vne,{color:"var(--privy-color-warn-light)"}),d.jsx(P0,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),d.jsxs(ZRe,{children:[d.jsx("h3",{children:"Account not found"}),d.jsxs("p",{children:["Please try logging in again or go to ",e.name," to create an account."]})]}),d.jsx(uh,{}),d.jsx(Ot,{onClick:()=>t(ye.LANDING),children:"Try logging in again"})]})]})};let QRe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-408d3d00-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;margin-top:24px;"]),ZRe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-408d3d00-1"})(["display:flex;flex-direction:column;gap:8px;"]);function XRe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const rf=E.forwardRef(XRe);function eDe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a2.25 2.25 0 0 0-2.25-2.25H15a3 3 0 1 1-6 0H5.25A2.25 2.25 0 0 0 3 12m18 0v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 9m18 0V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v3"}))}const cv=E.forwardRef(eDe),fj=fe.span.withConfig({displayName:"CircleBorder",componentId:"sc-9056b8b8-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;border-bottom-color:",";}"],t=>t.color??"var(--privy-color-accent)",t=>t.color??"var(--privy-color-accent)");function tDe(t){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",...t,children:d.jsx("g",{fill:t.color||"var(--privy-color-foreground)",children:d.jsx("path",{d:"M0 15.4v15.38h4.64V19.96h3.58c2.47 0 3.63-.01 3.77-.02 1-.08 1.49-.15 2.18-.3a9.45 9.45 0 0 0 4.6-2.37c1.66-1.57 2.64-3.87 2.81-6.56.02-.3.02-1.19 0-1.49-.1-1.77-.56-3.35-1.36-4.72A8.84 8.84 0 0 0 15.14.57c-.93-.3-1.75-.43-3.09-.54C11.9.02 10.2 0 5.93 0H0ZM10.85 4c1.85.05 3.1.45 4.16 1.3.22.17.54.49.69.68a5.97 5.97 0 0 1 1.19 3.13c.04.35.04 1.36 0 1.71-.08.68-.23 1.3-.44 1.85a4.8 4.8 0 0 1-1.09 1.68A5.63 5.63 0 0 1 12 15.92c-.6.08-.4.08-4.01.09H4.64V3.98h2.9c1.6 0 3.08 0 3.31.02ZM187.65 5.71v5.72h-.27l-.09-.14a15.9 15.9 0 0 0-1.21-1.73c-.43-.5-1-.95-1.7-1.36-.54-.3-1.05-.5-1.73-.63a8.98 8.98 0 0 0-1.7-.17 8.84 8.84 0 0 0-7.8 4.03 12.95 12.95 0 0 0-2.03 6.39c-.07.98-.06 2.15.02 3.13.2 2.47.87 4.53 2.02 6.25a8.98 8.98 0 0 0 10.22 3.65 6.5 6.5 0 0 0 2.8-1.93c.41-.51.84-1.1 1.1-1.55l.1-.17h.37v3.58h4.38V0h-4.48Zm-5.24 5.54c1.3.14 2.3.6 3.17 1.48.9.9 1.5 2.09 1.85 3.64.36 1.6.39 3.72.06 5.43a8.13 8.13 0 0 1-1.54 3.62 5.1 5.1 0 0 1-3.93 1.96 6.13 6.13 0 0 1-2.32-.31 5.87 5.87 0 0 1-3.33-3.5c-.39-1-.62-2.05-.72-3.32-.03-.32-.04-1.35-.02-1.73.08-1.56.4-2.91.96-4.05a6.2 6.2 0 0 1 1.06-1.58 5.08 5.08 0 0 1 3.6-1.66c.25-.02.9 0 1.16.02ZM210.07 15.39l.01 15.38h4.38l.01-3.57h.37l.09.15c.24.44.84 1.26 1.21 1.7a6.79 6.79 0 0 0 2.57 1.75 9.3 9.3 0 0 0 6.86-.49 9.28 9.28 0 0 0 4.05-4.07A13.05 13.05 0 0 0 231 21.6c.21-1.73.18-3.7-.09-5.32a13.03 13.03 0 0 0-1.5-4.3 9.1 9.1 0 0 0-3.75-3.63 9.15 9.15 0 0 0-4.43-.96 7.46 7.46 0 0 0-2.8.5A7.07 7.07 0 0 0 216 9.7c-.4.52-.82 1.12-1.1 1.59l-.07.14h-.27V0h-4.5Zm11.13-4.14c1.07.1 1.94.44 2.7 1.04a6.1 6.1 0 0 1 1.64 1.98c.43.84.78 2 .94 3.11.15 1.16.16 2.4.02 3.54a9.34 9.34 0 0 1-1.39 4.03 5.33 5.33 0 0 1-2.69 2.15c-.9.3-2.04.38-3.06.2a5.14 5.14 0 0 1-3.45-2.37 6.03 6.03 0 0 1-.45-.8c-.5-1.03-.8-2.2-.92-3.58-.04-.49-.06-.89-.05-1.53.01-.76.05-1.23.13-1.85.38-2.53 1.47-4.38 3.15-5.31a5.46 5.46 0 0 1 2.3-.63 10 10 0 0 1 1.13.02ZM69.05 2.17l-.01 2.77V7.7h-3.36v3.6h3.36v6.8l.01 7.15c.06 1.4.4 2.44 1.1 3.37a5.8 5.8 0 0 0 2.97 2.07c.91.3 1.83.42 2.9.38a8.71 8.71 0 0 0 2.66-.48l-.8-3.7-.38.06a4.96 4.96 0 0 1-2.43-.06c-.33-.1-.56-.25-.8-.49-.4-.41-.6-.88-.7-1.67-.02-.2-.02-.62-.03-6.82v-6.6h4.73V7.7h-4.73V2.16h-4.49ZM133.34 2.17V7.7h-3.39v3.6h3.38v6.9l.01 7.17a5.66 5.66 0 0 0 2.36 4.49c.85.6 2.03 1.03 3.26 1.17.85.1 2.03.05 2.81-.1.3-.06.75-.18 1-.26l.2-.06v-.05l-.81-3.67-.37.06a4.99 4.99 0 0 1-1.8.09c-.85-.13-1.32-.4-1.7-.97a2.63 2.63 0 0 1-.39-1.04c-.06-.4-.06 0-.06-7.1V11.3h4.7V7.7h-4.7l-.01-2.77V2.16h-4.49ZM293.41 2.36a14.56 14.56 0 0 0-13.7 16.07 14.59 14.59 0 0 0 21.86 11.08 14.5 14.5 0 0 0 7.11-14.07 14.61 14.61 0 0 0-6.53-10.73 14.49 14.49 0 0 0-8.74-2.35ZM350.8 2.36a10.17 10.17 0 0 0-7.56 4.2c-.16.2-.45.63-.58.83l-.05.1h-.47l-.01-4.36h-7.36v36.4h7.82V27.27h.49l.05.07a11.3 11.3 0 0 0 7.49 4.15 10.52 10.52 0 0 0 9.38-4.1c1.66-2.1 2.73-4.9 3.07-8.06.1-.87.13-1.4.13-2.37 0-.8 0-1.1-.07-1.76a15.95 15.95 0 0 0-3.23-8.72 12.8 12.8 0 0 0-1.85-1.84 10.49 10.49 0 0 0-7.26-2.28Zm-.94 6.05c1.27.15 2.33.65 3.2 1.5.98.96 1.67 2.31 2.03 4 .34 1.57.38 3.68.12 5.39a9.78 9.78 0 0 1-1.04 3.25c-.14.25-.44.69-.6.89a5.35 5.35 0 0 1-4.31 2.07 5.25 5.25 0 0 1-4.41-1.9 7.35 7.35 0 0 1-1.26-2.32 14.09 14.09 0 0 1-.62-4.83c.05-1.98.38-3.53 1.02-4.85a5.63 5.63 0 0 1 2.5-2.65c.66-.34 1.3-.5 2.14-.58.18-.02 1.04 0 1.23.03ZM363.63 3.1l-.01 3.2v3.16h1.43c1.26.01 1.44.02 1.54.04.42.09.66.28.79.62.08.23.08.08.08 2.96a911.57 911.57 0 0 1 .03 10.18v7.54h7.82v-7.4l.01-7.83c.03-.94.11-1.63.27-2.28.46-1.9 1.54-2.93 3.35-3.23.52-.08.2-.08 5-.08h4.4V3.08h-3.1c-3.48 0-3.91.01-4.67.1-1.83.2-3.04.79-3.96 1.88-.5.6-.9 1.32-1.26 2.26l-.06.17h-.46V3.09h-5.6c-4.46 0-5.6 0-5.6.02ZM390.8 16.95V30.8h3.87l3.86-.01V3.09h-7.73ZM400.6 3.1l-.01.4v.38l4.66 13.4 4.69 13.47.02.05h10.3l.03-.05 4.67-13.45 4.67-13.4V3.1h-7.43l-6.7 19.26h-.5l-3.28-9.5-3.31-9.64-.05-.12h-3.88l-3.88.01ZM430.98 3.1c-.01 0-.02.19-.02.4v.39l5.08 14.59c2.8 8.02 5.08 14.6 5.08 14.61.01.02-.22.02-4.8.02h-4.82v6.42h4.95c5.09 0 5.23 0 5.87-.06 3.15-.28 5.29-1.63 6.63-4.15.28-.55.44-.95.87-2.16L459 6.78l1-2.89v-.8h-7.43l-6.69 19.26h-.5l-3.27-9.46-3.31-9.64-.06-.16h-3.88l-3.88.01ZM36.57 7.36c-1.36.1-2.6.6-3.62 1.45a5.65 5.65 0 0 0-1.67 2.42l-.05.13H31V7.7h-4.35v23.08h4.5v-7.3c0-8 0-7.34.08-7.82a4.89 4.89 0 0 1 2.06-3.18c.83-.58 1.74-.89 2.87-.98a11.87 11.87 0 0 1 2.8.25H39v-4.3l-.21-.02c-.61-.07-1.74-.1-2.22-.07ZM51.08 7.41c-2.33.12-4.3.84-5.95 2.16a9.89 9.89 0 0 0-2.03 2.2 12.5 12.5 0 0 0-2 5.78 18.04 18.04 0 0 0 0 3.65 12.13 12.13 0 0 0 2.26 6.05 9.74 9.74 0 0 0 5 3.52c2.11.64 4.7.64 6.8 0a9.78 9.78 0 0 0 4.88-3.37c1.38-1.78 2.19-4 2.4-6.58.13-1.46.06-3.06-.18-4.42a11.24 11.24 0 0 0-3.58-6.6 10 10 0 0 0-5.75-2.35c-.56-.06-1.31-.07-1.85-.04Zm1.42 3.78c.88.1 1.62.34 2.28.75a6.13 6.13 0 0 1 1.99 2.15 10.31 10.31 0 0 1 1.2 5c.02 1.23-.12 2.44-.42 3.51a7.14 7.14 0 0 1-1.81 3.32c-.61.6-1.2.98-1.95 1.24a6 6 0 0 1-2 .3 5.7 5.7 0 0 1-2.72-.6 5 5 0 0 1-1.28-.94A7.1 7.1 0 0 1 46 22.73c-.57-1.99-.6-4.46-.08-6.5a7.24 7.24 0 0 1 2.03-3.67 5.13 5.13 0 0 1 3.35-1.4 11 11 0 0 1 1.2.03ZM92.05 7.4c-.96.06-1.56.15-2.3.33a9.62 9.62 0 0 0-6.09 4.66 13.5 13.5 0 0 0-1.71 7c0 .83 0 1.04.06 1.6.16 1.77.58 3.32 1.29 4.7A9.72 9.72 0 0 0 90.28 31c1.84.37 4.08.32 5.85-.13a9.07 9.07 0 0 0 5.02-3.1A7.64 7.64 0 0 0 102.5 25l-2.11-.39-2.11-.38-.08.13a4.72 4.72 0 0 1-2.35 2.55 6.3 6.3 0 0 1-2.23.58c-.29.03-1.13.03-1.44 0a6.35 6.35 0 0 1-3.02-1.04 5.93 5.93 0 0 1-2.02-2.43 8.44 8.44 0 0 1-.72-3.18v-.26h16.38v-.81c0-1.83-.06-2.76-.25-3.87-.2-1.22-.53-2.24-1.05-3.28a8.9 8.9 0 0 0-2.66-3.26 10.1 10.1 0 0 0-5.34-1.94 18.3 18.3 0 0 0-1.46-.03Zm1.3 3.75c1.2.13 2.19.55 3.05 1.3a5.8 5.8 0 0 1 1.78 2.96c.13.51.21 1.17.21 1.66v.15H86.43v-.12c.08-.97.3-1.78.72-2.61.5-1 1.2-1.8 2.14-2.42a5.32 5.32 0 0 1 2.9-.95c.2-.01.97 0 1.17.03ZM116.79 7.41c-2 .1-3.73.65-5.22 1.65a10.7 10.7 0 0 0-4.25 6.06 16.1 16.1 0 0 0-.5 5.8c.2 2.17.84 4.13 1.88 5.76.58.9 1.32 1.73 2.15 2.4a9.37 9.37 0 0 0 3.6 1.8 12.06 12.06 0 0 0 3.92.34 10.2 10.2 0 0 0 3.84-.95 8.31 8.31 0 0 0 4.76-6.75l.01-.04h-4.37l-.05.16a4.87 4.87 0 0 1-4.24 3.75c-.59.07-1.32.06-1.93-.05a5.47 5.47 0 0 1-3.5-2.27c-.56-.75-1-1.73-1.26-2.79a13.8 13.8 0 0 1-.16-5.24 7.77 7.77 0 0 1 2.1-4.3 5.48 5.48 0 0 1 2.15-1.3 6.4 6.4 0 0 1 3.89.1c.59.21 1.03.5 1.5.96a5.32 5.32 0 0 1 1.46 2.5l.04.15h4.37v-.06a8.22 8.22 0 0 0-5.31-6.94 10.98 10.98 0 0 0-4.88-.74ZM156.2 7.41a9.87 9.87 0 0 0-6 2.29 11.02 11.02 0 0 0-3.41 5.43c-.52 1.78-.68 3.9-.48 5.97.17 1.8.63 3.38 1.37 4.8a9.68 9.68 0 0 0 5.91 4.86c1.65.48 3.63.61 5.53.36 3.72-.49 6.55-2.62 7.56-5.69.12-.39.13-.42.1-.43-.02 0-4.13-.75-4.19-.75-.03 0-.04 0-.1.16-.18.42-.45.9-.72 1.22-.16.2-.49.53-.7.7-.67.54-1.5.9-2.43 1.08-.48.08-.83.11-1.41.11-.64 0-1.07-.04-1.6-.15a5.76 5.76 0 0 1-3.93-2.83 8 8 0 0 1-.99-3.79v-.16h16.38v-1.11l-.02-1.43c-.1-2.25-.53-4-1.35-5.59a9.24 9.24 0 0 0-6.18-4.75c-1.04-.26-2.2-.36-3.33-.3Zm1.45 3.74a5.35 5.35 0 0 1 3.66 1.94 6.1 6.1 0 0 1 1.38 4.01v.12h-11.97v-.06c0-.02 0-.14.02-.25a6.6 6.6 0 0 1 2.15-4.32 5.73 5.73 0 0 1 3.5-1.46c.25-.02 1 0 1.26.02ZM233.58 7.82l8.37 23.22a49.22 49.22 0 0 1-.67 1.9 5.36 5.36 0 0 1-1.14 1.8c-.41.4-.82.58-1.48.69-.27.04-1.03.03-1.35 0a8.05 8.05 0 0 1-1.1-.23l-1.08 3.67c0 .02.32.14.66.22.83.21 1.57.29 2.56.28.56-.01.8-.03 1.24-.1 2.71-.4 4.66-2.09 5.86-5.08l9.64-26.44c0-.02-4.82-.06-4.83-.05l-2.93 8.96-2.91 8.94h-.24l-.22-.65-2.91-8.95-2.7-8.3H233.53ZM293.05 35.8c-1.18.04-1.93.09-2.8.16-2.52.24-4.53.69-5.43 1.23-.7.41-.76.86-.2 1.28.88.66 3.29 1.19 6.36 1.4a48.55 48.55 0 0 0 5.75.05c3.47-.19 6.24-.78 7.11-1.5.22-.19.3-.34.3-.53 0-.1 0-.12-.04-.22-.35-.69-2.32-1.3-5.25-1.63a41.09 41.09 0 0 0-5.8-.24Zm0 0"})})})}let Mz=fe.div.withConfig({displayName:"TermsAndConditionsContainer",componentId:"sc-c97bf02f-0"})(["margin-top:16px;font-size:13px;text-align:center;color:var(--privy-color-foreground-3);&& > a{color:var(--privy-color-accent);}"]);function hj(t){let{legal:{privacyPolicyUrl:e,termsAndConditionsUrl:r,requireUsersAcceptTerms:n}}=t.app;if(n&&!t.alwaysShowImplicitConsent||!r&&!e)return d.jsx(Mz,{});let i=!(!e||!r);return d.jsxs(Mz,{children:["By logging in I agree to the"," ",r&&d.jsx("a",{href:r,target:"_blank",children:i?"Terms":"Terms of Service"}),i&&" & ",e&&d.jsx("a",{href:e,target:"_blank",children:"Privacy Policy"})]})}const Qt=()=>d.jsx(kr,{children:d.jsx("a",{href:"https://www.privy.io/",target:"_blank",children:d.jsx(tDe,{height:13,width:150})})}),kr=fe.div.withConfig({displayName:"ModalFooter",componentId:"sc-c97bf02f-1"})(["display:flex;align-items:center;justify-content:center;padding-top:8px;padding-bottom:12px;gap:8px;font-size:13px;&& a{padding:0.5rem 0;&:hover{text-decoration:none;}}@media all and (display-mode:standalone){padding-bottom:30px;}"]);function rDe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const nDe=E.forwardRef(rDe);function iDe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"}))}const Cne=E.forwardRef(iDe),bo=({address:t,showCopyIcon:e,url:r,className:n})=>{let[i,a]=E.useState(!1);return E.useEffect(()=>{if(i){let s=setTimeout(()=>a(!1),2e3);return()=>clearTimeout(s)}},[i]),r?d.jsx("a",{title:t,className:n,href:`${r}/address/${t}`,target:"_blank",children:as(t)}):d.jsxs("button",{title:t,className:n,onClick:s=>(s.stopPropagation(),navigator.clipboard.writeText(t).then(()=>a(!0)).catch(console.error)),children:[as(t),e&&d.jsx(i?sDe:aDe,{})]})};let aDe=fe(Cne).withConfig({displayName:"StyledSquare2StackIcon",componentId:"sc-6eaa0c94-0"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-foreground-3);"]),sDe=fe(nDe).withConfig({displayName:"StyledCheckIcon",componentId:"sc-6eaa0c94-1"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-success);"]);function Sne(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Ane=({onTransfer:t,isTransferring:e,transferSuccess:r})=>d.jsx(Ot,{...r?{success:!0,children:"Success!"}:{warn:!0,loading:e,onClick:t,children:"Transfer and delete account"}});function oDe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}))}const Bx=E.forwardRef(oDe),Ine=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-aa2e65ff-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:100%;padding-bottom:16px;"]),oT=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-aa2e65ff-1"})(["display:flex;flex-direction:column;&& p{font-size:14px;}width:100%;gap:16px;"]),Mne=fe.div.withConfig({displayName:"DisclosedAccountContainer",componentId:"sc-aa2e65ff-2"})(["display:flex;cursor:pointer;align-items:center;width:100%;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-md);padding:8px 10px;font-size:14px;font-weight:500;gap:8px;"]),Tne=fe(Bx).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-aa2e65ff-3"})(["position:relative;width:",";height:",";color:var(--privy-color-foreground-3);margin-left:auto;"],t=>`${t.iconSize}px`,t=>`${t.iconSize}px`),lDe=fe(Cne).withConfig({displayName:"StyledCopyIcon",componentId:"sc-aa2e65ff-4"})(["position:relative;width:15px;height:15px;color:var(--privy-color-foreground-3);margin-left:auto;"]),cDe=fe.ol.withConfig({displayName:"ListContainer",componentId:"sc-aa2e65ff-5"})(["display:flex;flex-direction:column;font-size:14px;width:100%;text-align:left;"]),Tz=fe.li.withConfig({displayName:"ListItem",componentId:"sc-aa2e65ff-6"})(["font-size:14px;list-style-type:auto;list-style-position:outside;margin-left:1rem;margin-bottom:0.5rem;&:last-child{margin-bottom:0;}"]),uDe=fe.div.withConfig({displayName:"CircleContainer",componentId:"sc-aa2e65ff-7"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]);let dDe=()=>d.jsx(uDe,{children:d.jsx(Tne,{iconSize:60})});const fDe=({address:t,onClose:e,onRetry:r,onTransfer:n,isTransferring:i,transferSuccess:a})=>{var l;let{defaultChain:s}=Ai(),o=((l=s.blockExplorers)==null?void 0:l.default.url)??"https://etherscan.io";return d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:e,backFn:r}),d.jsxs(Ine,{children:[d.jsx(dDe,{}),d.jsxs(oT,{children:[d.jsx("h3",{children:"Check account assets before transferring"}),d.jsx("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),d.jsxs(cDe,{children:[d.jsx("p",{children:" To check your balance, you can:"}),d.jsx(Tz,{children:"Log out and log back into the other account, or "}),d.jsxs(Tz,{children:["Copy your wallet address and use a"," ",d.jsx("u",{children:d.jsx("a",{target:"_blank",href:o,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),d.jsxs(Mne,{onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[d.jsx(cv,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),d.jsx(bo,{address:t,showCopyIcon:!1}),d.jsx(lDe,{})]}),d.jsx(Ane,{onTransfer:n,isTransferring:i,transferSuccess:a})]})]}),d.jsx(Qt,{})]})},hDe=()=>{let{initiateAccountTransfer:t,closePrivyModal:e}=_t(),{data:r,navigate:n,lastScreen:i,setModalData:a}=wt(),[s,o]=E.useState(void 0),[l,c]=E.useState(!1),[u,f]=E.useState(!1),h=async()=>{var g,m,w,C,v,b,A,S,j;try{if(!((g=r==null?void 0:r.accountTransfer)!=null&&g.nonce)||!((m=r==null?void 0:r.accountTransfer)!=null&&m.account))throw Error("missing account transfer inputs");f(!0),await t({nonce:(w=r==null?void 0:r.accountTransfer)==null?void 0:w.nonce,account:(C=r==null?void 0:r.accountTransfer)==null?void 0:C.account,accountType:(v=r==null?void 0:r.accountTransfer)==null?void 0:v.linkMethod,externalWalletMetadata:(b=r==null?void 0:r.accountTransfer)==null?void 0:b.externalWalletMetadata,telegramAuthResult:(A=r==null?void 0:r.accountTransfer)==null?void 0:A.telegramAuthResult,farcasterEmbeddedAddress:(S=r==null?void 0:r.accountTransfer)==null?void 0:S.farcasterEmbeddedAddress,oAuthUserInfo:(j=r==null?void 0:r.accountTransfer)==null?void 0:j.oAuthUserInfo}),c(!0),f(!1),setTimeout(e,1e3)}catch(U){a({errorModalData:{error:U,previousScreen:i||ye.LINK_CONFLICT_SCREEN}}),n(ye.ERROR_SCREEN,!0)}};return s?d.jsx(fDe,{address:s,onClose:e,onRetry:()=>o(void 0),onTransfer:h,isTransferring:u,transferSuccess:l}):d.jsx(pDe,{onClose:e,onInfo:()=>{var g;return o((g=r==null?void 0:r.accountTransfer)==null?void 0:g.embeddedWalletAddress)},onContinue:()=>{var g;return o((g=r==null?void 0:r.accountTransfer)==null?void 0:g.embeddedWalletAddress)},onTransfer:h,isTransferring:u,transferSuccess:l,data:r})},pDe=({onClose:t,onContinue:e,onInfo:r,onTransfer:n,transferSuccess:i,isTransferring:a,data:s})=>{var l,c,u,f,h,g,m;if(!((l=s==null?void 0:s.accountTransfer)!=null&&l.linkMethod)||!((c=s==null?void 0:s.accountTransfer)!=null&&c.displayName))return;let o={method:(u=s==null?void 0:s.accountTransfer)==null?void 0:u.linkMethod,handle:(f=s==null?void 0:s.accountTransfer)==null?void 0:f.displayName,disclosedAccount:(h=s==null?void 0:s.accountTransfer)!=null&&h.embeddedWalletAddress?{type:"wallet",handle:(g=s==null?void 0:s.accountTransfer)==null?void 0:g.embeddedWalletAddress}:void 0};return d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!0}),d.jsxs(Ine,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(fj,{color:"var(--privy-color-error)"}),d.jsx(rf,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),d.jsxs(oT,{children:[d.jsxs("h3",{children:[function(w){switch(w){case"sms":return"Phone number";case"email":return"Email address";case"siwe":return"Wallet address";case"linkedin":return"LinkedIn profile";case"google":case"apple":case"discord":case"github":case"instagram":case"spotify":case"tiktok":case"twitter":case"telegram":case"farcaster":return`${Sne(w.replace("_oauth",""))} profile`;default:return w}}(o.method)," is associated with another account"]}),d.jsxs("p",{children:["Do you want to transfer",d.jsx("b",{children:o.handle?` ${o.handle}`:""})," to this account instead? This will delete your other account."]}),d.jsx(gDe,{onClick:r,disclosedAccount:o.disclosedAccount})]}),d.jsxs(oT,{style:{gap:12,marginTop:12},children:[(m=s==null?void 0:s.accountTransfer)!=null&&m.embeddedWalletAddress?d.jsx(Ot,{onClick:e,children:"Continue"}):d.jsx(Ane,{onTransfer:n,transferSuccess:i,isTransferring:a}),d.jsx(Yd,{onClick:t,children:"No thanks"})]})]}),d.jsx(Qt,{})]})};function gDe({disclosedAccount:t,onClick:e}){return t?d.jsxs(Mne,{onClick:e,children:[d.jsx(cv,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),d.jsx(bo,{address:t.handle,showCopyIcon:!1}),d.jsx(Tne,{iconSize:15})]}):null}function mDe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const lT=E.forwardRef(mDe);function yDe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M9 1.5H5.625c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5Zm6.61 10.936a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 14.47a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}),E.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"}))}const wDe=E.forwardRef(yDe),zx=fe.div.withConfig({displayName:"AppLogoContainer",componentId:"sc-a63b1990-0"})(["display:flex;flex-direction:column;align-items:center;padding:0px 0px 30px;@media (max-width:440px){padding:10px 10px 20px;}"]),hn=fe.div.withConfig({displayName:"Title",componentId:"sc-a63b1990-1"})(["font-size:18px;line-height:30px;text-align:center;font-weight:600;margin-bottom:10px;"]),pn=fe.div.withConfig({displayName:"SubTitle",componentId:"sc-a63b1990-2"})(["font-size:0.875rem;text-align:center;"]),i1=fe.div.withConfig({displayName:"Container",componentId:"sc-a63b1990-3"})(["display:flex;flex-direction:column;align-items:center;gap:10px;flex-grow:1;padding:20px 0;@media (max-width:440px){padding:10px 10px 20px;}"]),Wx=fe.div.withConfig({displayName:"List",componentId:"sc-a63b1990-4"})(["display:flex;flex-direction:column;align-items:stretch;gap:0.75rem;padding:1rem 0rem 0rem;flex-grow:1;width:100%;"]),wu=fe.div.withConfig({displayName:"ListItemIcon",componentId:"sc-a63b1990-5"})(["width:25px;display:flex;align-items:center;justify-content:flex-start;> svg{z-index:2;height:25px !important;width:25px !important;color:var(--privy-color-accent);}"]),vu=fe.div.withConfig({displayName:"ListItem",componentId:"sc-a63b1990-6"})(["display:flex;align-items:center;gap:10px;font-size:0.875rem;line-height:1rem;text-align:left;"]),ic=fe.div.withConfig({displayName:"BottomSection",componentId:"sc-a63b1990-7"})(["display:flex;flex-direction:column;gap:10px;padding-top:20px;"]),kne=fe.div.withConfig({displayName:"MethodList",componentId:"sc-a63b1990-8"})(["display:flex;flex-direction:column;align-items:stretch;gap:1rem;padding:1rem 0rem 0rem;flex-grow:1;width:100%;"]),pS=fe.div.withConfig({displayName:"MethodListItem",componentId:"sc-a63b1990-9"})(["display:flex;gap:5px;width:100%;position:relative;"]),gS=fe.button.withConfig({displayName:"RemoveMethodButton",componentId:"sc-a63b1990-10"})(["&&{background-color:transparent;color:var(--privy-color-foreground-3);padding:0 0.75rem;display:flex;align-items:center;height:100%;> svg{z-index:2;height:20px !important;width:20px !important;}}&&:hover{color:var(--privy-color-error);}"]),mS=fe.div.withConfig({displayName:"MethodText",componentId:"sc-a63b1990-11"})(["display:flex;align-items:center;gap:0.5rem;> svg{z-index:2;height:20px !important;width:20px !important;}"]),yS=fe.div.withConfig({displayName:"ExtraText",componentId:"sc-a63b1990-12"})(["display:flex;align-items:center;gap:6px;font-weight:400 !important;color:",";> svg{z-index:2;height:18px !important;width:18px !important;display:flex !important;align-items:flex-end;}"],t=>t.isAccent?"var(--privy-color-accent)":"var(--privy-color-foreground-3)"),wS=fe.div.withConfig({displayName:"SmsInsecureText",componentId:"sc-a63b1990-13"})(["width:100%;display:flex;justify-content:space-between;"]),vDe=fe.p.withConfig({displayName:"TermsText",componentId:"sc-a63b1990-14"})(["text-align:left;width:100%;color:var(--privy-color-foreground-3) !important;"]),cT=fe.button.withConfig({displayName:"PrimaryTextButton",componentId:"sc-a63b1990-15"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:0.875rem;line-height:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{color:",";background-color:transparent;padding:0.5rem 0px;}&:hover{text-decoration:underline;}"],t=>t.theme==="dark"?"var(--privy-color-foreground-2)":"var(--privy-color-accent)"),Da=fe.div.withConfig({displayName:"IconWrapper",componentId:"sc-a63b1990-16"})(["display:flex;align-items:center;justify-content:center;color:var(--privy-color-accent);width:100%;> svg{z-index:2;width:3rem;height:3rem;}"]),Nne=fe.div.withConfig({displayName:"ErrorMessage",componentId:"sc-a63b1990-17"})(["color:var(--privy-color-error);"]),bDe=()=>{let{user:t,logout:e}=$r(),{app:r,onUserCloseViaDialogOrKeybindRef:n,setModalData:i,navigate:a}=wt(),{acceptTerms:s,closePrivyModal:o,createAnalyticsEvent:l}=_t(),c=u=>{u==null||u.preventDefault(),o({shouldCallAuthOnSuccess:!1}),e()};return n.current=c,d.jsx(xDe,{termsAndConditionsUrl:r==null?void 0:r.legal.termsAndConditionsUrl,privacyPolicyUrl:r==null?void 0:r.legal.privacyPolicyUrl,onAccept:async u=>{var f;u.preventDefault(),await s(),t&&Hd(t,(f=r==null?void 0:r.embeddedWallets)==null?void 0:f.createOnLogin)?(i({createWallet:{onSuccess:()=>{},onFailure:h=>{console.error(h),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:h,screen:"AffirmativeConsentScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),a(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)):o()},onDecline:c})},xDe=({termsAndConditionsUrl:t,privacyPolicyUrl:e,onAccept:r,onDecline:n})=>d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsx(wDe,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),d.jsx(hn,{style:{marginTop:24},children:"One last step"}),d.jsx(pn,{children:"By signing up, you agree to our terms and privacy policy."}),d.jsxs(dh,{style:{marginTop:24},children:[t&&d.jsxs(Iz,{target:"_blank",href:t,children:["View Terms ",d.jsx(lT,{style:{marginLeft:"auto"}})]}),e&&d.jsxs(Iz,{target:"_blank",href:e,children:["View Privacy Policy ",d.jsx(lT,{style:{marginLeft:"auto"}})]})]}),d.jsxs(EDe,{style:{marginTop:24},children:[d.jsx(Yd,{onClick:n,children:"No thanks"}),d.jsx(Ot,{onClick:r,children:"Accept"})]}),d.jsx(Qt,{})]});let EDe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-4aff18c8-0"})(["display:flex;gap:10px;"]);const Lne=({style:t,...e})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...t},...e,children:d.jsx("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})}),_De=()=>{let{navigate:t,app:e}=wt(),r=(e==null?void 0:e.allowlistConfig.errorTitle)||"You don't have access to this app",n=(e==null?void 0:e.allowlistConfig.errorDetail)||"Have you been invited?",i=(e==null?void 0:e.allowlistConfig.errorCtaText)||"Try another account";return d.jsxs(d.Fragment,{children:[d.jsx(ft,{}),d.jsxs(CDe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(fj,{}),d.jsx(Lne,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),d.jsxs(SDe,{children:[d.jsx(typeof r=="string"?"h3":d.Fragment,{children:r}),d.jsx(typeof n=="string"?"p":d.Fragment,{children:n})]}),e!=null&&e.allowlistConfig.errorCtaLink?d.jsx(Ot,{as:"a",href:e.allowlistConfig.errorCtaLink,children:i}):d.jsx(Ot,{onClick:()=>{t(ye.LANDING)},children:i})]})]})};let CDe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-ed4ecf-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;"]),SDe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-ed4ecf-1"})(["display:flex;flex-direction:column;gap:8px;"]);function ADe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const IDe=E.forwardRef(ADe);function MDe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"}))}const T1=E.forwardRef(MDe);function TDe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 0 1-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z"}))}const Cc=E.forwardRef(TDe),k1=fe.div.withConfig({displayName:"BottomPusherContainer",componentId:"sc-cb963810-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;margin-top:auto;gap:16px;flex-grow:100;"]),Sc=fe.div.withConfig({displayName:"CenteredItem",componentId:"sc-cb963810-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;flex-grow:1;width:100%;"]),pj=fe.div.withConfig({displayName:"HorizontallyCenteredItem",componentId:"sc-cb963810-2"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]),gj=fe(Sc).withConfig({displayName:"CenteredItemWithPadding",componentId:"sc-cb963810-3"})(["padding:20px 0;"]),nf=fe(Sc).withConfig({displayName:"CenteredItemWithGap",componentId:"sc-cb963810-4"})(["gap:16px;"]),Hx=fe.div.withConfig({displayName:"FlexContainer",componentId:"sc-cb963810-5"})(["display:flex;flex-direction:column;width:100%;"]),ko=fe.div.withConfig({displayName:"FixedGappedContainer",componentId:"sc-cb963810-6"})(["display:flex;flex-direction:column;gap:8px;"]),kDe=fe.div.withConfig({displayName:"StyledCalloutSection",componentId:"sc-cb963810-8"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;padding:16px;margin-top:16px;margin-bottom:16px;width:100%;background:var(--privy-color-background-2);border-radius:var(--privy-border-radius-md);&& h4{color:var(--privy-color-foreground-3);font-size:14px;text-decoration:underline;font-weight:medium;}&& p{color:var(--privy-color-foreground-3);font-size:14px;}"]),tn=fe.div.withConfig({displayName:"RefactorSpacerTop",componentId:"sc-cb963810-9"})(["height:16px;"]),an=fe.div.withConfig({displayName:"RefactorSpacerBottom",componentId:"sc-cb963810-10"})(["height:12px;"]),NDe=fe.div.withConfig({displayName:"RelativeContainer",componentId:"sc-cb963810-11"})(["position:relative;"]),mj=fe.div.withConfig({displayName:"ConfigurableSpacer",componentId:"sc-cb963810-12"})(["height:","px;"],t=>t.height??"12"),LDe=fe.div.withConfig({displayName:"Circle",componentId:"sc-cb963810-13"})(["background-color:var(--privy-color-accent);display:flex;justify-content:center;align-items:center;border-radius:50%;border-color:white;border-width:2px !important;"]),Gx=({title:t,description:e,children:r,...n})=>d.jsx(jne,{...n,children:d.jsxs(d.Fragment,{children:[d.jsx("h3",{children:t}),typeof e=="string"?d.jsx("p",{children:e}):e,r]})}),uv=fe(Gx).withConfig({displayName:"PaddedScreenHeader",componentId:"sc-523a75d6-0"})(["margin-bottom:24px;"]),zn=({title:t,description:e,icon:r,children:n,...i})=>d.jsxs(jDe,{...i,children:[r||null,d.jsx("h3",{children:t}),e&&typeof e=="string"?d.jsx("p",{children:e}):e,n]});let jne=fe.div.withConfig({displayName:"StyledSection",componentId:"sc-523a75d6-1"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;width:100%;margin-bottom:24px;&& h3{font-size:17px;color:var(--privy-color-foreground);}&& p{color:var(--privy-color-foreground-2);font-size:14px;}"]),jDe=fe(jne).withConfig({displayName:"CenteredStyledSection",componentId:"sc-523a75d6-2"})(["align-items:center;text-align:center;gap:16px;h3{margin-bottom:24px;}"]),kz=Array(6).fill("");var W2,H2,$De=((W2=$De||{})[W2.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",W2[W2.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",W2),PDe=((H2=PDe||{})[H2.EMAIL=0]="EMAIL",H2[H2.SMS=1]="SMS",H2);const RDe=()=>{var _,L,O;let{app:t,navigate:e,lastScreen:r,navigateBack:n,setModalData:i,onUserCloseViaDialogOrKeybindRef:a}=wt(),{closePrivyModal:s,resendEmailCode:o,resendSmsCode:l,getAuthMeta:c,loginWithCode:u,updateWallets:f,createAnalyticsEvent:h}=_t(),{authenticated:g,logout:m,user:w}=$r(),[C,v]=E.useState(kz),[b,A]=E.useState(!1),[S,j]=E.useState(null),[U,I]=E.useState(null),[B,V]=E.useState(0);a.current=()=>null;let se=(_=c())!=null&&_.email?0:1,Y=Dn-500;E.useEffect(()=>{if(B){let P=setTimeout(()=>{V(B-1)},1e3);return()=>clearTimeout(P)}},[B]),E.useEffect(()=>{var P;if(g&&b&&w){if(t!=null&&t.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms){let R=setTimeout(()=>{e(ye.AFFIRMATIVE_CONSENT_SCREEN)},Y);return()=>clearTimeout(R)}if(Hd(w,(P=t==null?void 0:t.embeddedWallets)==null?void 0:P.createOnLogin)){let R=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:M=>{console.error(M),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:M,screen:"AwaitingPasswordlessCodeScreen"}}),m()},callAuthOnSuccessOnClose:!0}}),e(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Y);return()=>clearTimeout(R)}{f();let R=setTimeout(()=>s({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Dn);return()=>clearTimeout(R)}}},[g,b,w]),E.useEffect(()=>{if(S&&U===0){let P=setTimeout(()=>{v(kz),j(null);let R=document.querySelector("input[name=code-0]");R==null||R.focus()},1400);return()=>clearTimeout(P)}},[S]);let N=P=>{var le;P.preventDefault();let R=P.currentTarget.value.replace(" ","");if(R==="")return;if(isNaN(Number(R)))return j("Code should be numeric"),void I(1);j(null),I(null);let M=Number((le=P.currentTarget.name)==null?void 0:le.charAt(5)),D=[...R||[""]].slice(0,6-M),$=[...C.slice(0,M),...D,...C.slice(M+D.length)];v($);let X=Math.min(Math.max(M+D.length,0),5);if(!isNaN(Number(P.currentTarget.value))){let H=document.querySelector(`input[name=code-${X}]`);H==null||H.focus()}if($.every(H=>H&&!isNaN(+H))){let H=document.querySelector(`input[name=code-${X}]`);H==null||H.blur(),u($.join("")).then(()=>A(!0)).catch(ee=>{var J,te,re,z,G,Q,me,be,Ce,Fe,Ue,Ke;if(ee instanceof ol&&ee.privyErrorCode===Ae.INVALID_CREDENTIALS)j("Invalid or expired verification code");else if(ee instanceof ol&&ee.privyErrorCode===Ae.CANNOT_LINK_MORE_OF_TYPE)j(ee.message);else{if(ee instanceof ol&&ee.privyErrorCode===Ae.USER_LIMIT_REACHED)return console.error(new K3(ee).toString()),void e(ye.USER_LIMIT_REACHED_SCREEN);if(ee instanceof ol&&ee.privyErrorCode===Ae.USER_DOES_NOT_EXIST)return void e(ye.ACCOUNT_NOT_FOUND_SCREEN);if(ee instanceof ol&&ee.privyErrorCode===Ae.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:ee,previousScreen:r??ye.AWAITING_PASSWORDLESS_CODE}}),void e(ye.ERROR_SCREEN,!1);if(ee instanceof ol&&ee.privyErrorCode===Ae.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:ee}}),void e(ye.CONNECT_OR_CREATE,!1);if(ee instanceof ol&&ee.privyErrorCode===Ae.ACCOUNT_TRANSFER_REQUIRED&&((te=(J=ee.data)==null?void 0:J.data)!=null&&te.nonce))return i({accountTransfer:{nonce:(z=(re=ee.data)==null?void 0:re.data)==null?void 0:z.nonce,account:se===0?(G=c())==null?void 0:G.email:(Q=c())==null?void 0:Q.phoneNumber,displayName:(Ce=(be=(me=ee.data)==null?void 0:me.data)==null?void 0:be.account)==null?void 0:Ce.displayName,linkMethod:se===0?"email":"sms",embeddedWalletAddress:(Ke=(Ue=(Fe=ee.data)==null?void 0:Fe.data)==null?void 0:Ue.otherUser)==null?void 0:Ke.embeddedWalletAddress}}),void e(ye.LINK_CONFLICT_SCREEN);j("Issue verifying code")}I(0)})}},k=se==0?d.jsx(T1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):d.jsx(Cc,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),x=d.jsxs("p",se==0?{children:["Please check ",d.jsx(Nz,{children:(L=c())==null?void 0:L.email})," for an email from privy.io and enter your code below."]}:{children:["Please check ",d.jsx(Nz,{children:(O=c())==null?void 0:O.phoneNumber})," for a message from ",(t==null?void 0:t.name)||"Privy"," and enter your code below."]});return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:()=>n()},"header"),d.jsxs(DDe,{children:[d.jsx(zn,{title:"Enter confirmation code",description:x,icon:k}),d.jsxs(pj,{children:[d.jsxs(ODe,{children:[d.jsx(FDe,{$fail:!!S,$success:b,children:d.jsx("span",{children:S||(b?"Success!":"")})}),d.jsx("div",{children:C.map((P,R)=>d.jsx("input",{name:`code-${R}`,type:"text",value:C[R],onChange:N,onKeyUp:M=>{M.key==="Backspace"&&(D=>{if(U===1&&(j(null),I(null)),v([...C.slice(0,D),"",...C.slice(D+1)]),D>0){let $=document.querySelector(`input[name=code-${D-1}]`);$==null||$.focus()}})(R)},inputMode:"numeric",autoFocus:R===0,pattern:"[0-9]",className:`${b?"success":""} ${S?"fail":""}`,autoComplete:ya?"one-time-code":"off"},R))})]}),d.jsxs(UDe,{children:[d.jsxs("span",{children:["Didn't get ",se==0?"an email":"a message","?"]}),B?d.jsxs(zDe,{children:[d.jsx(IDe,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),d.jsx("span",{children:"Code sent"})]}):d.jsx(BDe,{children:d.jsx("button",{onClick:async()=>{V(30),se==0?await o():await l()},children:"Resend code"})})]})]})]}),d.jsx(Qt,{})]})};let DDe=fe.div.withConfig({displayName:"PasswordlessCodeContainer",componentId:"sc-463c12b2-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:center;margin:auto;gap:16px;flex-grow:1;"]),ODe=fe.div.withConfig({displayName:"CodeInput",componentId:"sc-463c12b2-1"})(["display:flex;flex-direction:column;width:100%;gap:8px;> div:last-child{display:flex;justify-content:center;gap:0.5rem;width:100%;border-radius:var(--privy-border-radius-md);> input{border:1px solid var(--privy-color-foreground-4);background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);padding:8px 10px;height:58px;width:46px;text-align:center;font-size:18px;}> input:focus{border:1px solid var(--privy-color-accent);}> input:invalid{border:1px solid var(--privy-color-error);}> input.success{border:1px solid var(--privy-color-success);}> input.fail{border:1px solid var(--privy-color-error);animation:shake 180ms;animation-iteration-count:2;}}@keyframes shake{0%{transform:translate(1px,0px);}33%{transform:translate(-1px,0px);}67%{transform:translate(-1px,0px);}100%{transform:translate(1px,0px);}}"]),FDe=fe.div.withConfig({displayName:"InputHelp",componentId:"sc-463c12b2-2"})(["line-height:20px;height:20px;font-size:13px;color:",";display:flex;justify-content:flex-end;width:100%;"],t=>t.$success?"var(--privy-color-success)":t.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"),UDe=fe.div.withConfig({displayName:"HelpText",componentId:"sc-463c12b2-3"})(["font-size:13px;color:var(--privy-color-foreground);display:flex;gap:8px;align-items:center;width:100%;margin-top:16px;padding-bottom:32px;"]),BDe=fe.div.withConfig({displayName:"ResendButtonContainer",componentId:"sc-463c12b2-4"})(["color:var(--privy-color-accent);padding:2px 0;> button{text-decoration:underline;}"]),zDe=fe.div.withConfig({displayName:"Badge",componentId:"sc-463c12b2-5"})(["display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-sm);padding:2px 8px;gap:4px;background:var(--privy-color-background-2);color:var(--privy-color-foreground-2);"]),Nz=fe.span.withConfig({displayName:"BoldWrappingSpan",componentId:"sc-463c12b2-6"})(["font-weight:500;word-break:break-all;"]);function WDe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const a1=E.forwardRef(WDe);function HDe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))}const qx=E.forwardRef(HDe),GDe=({icon:t})=>d.jsx(d.Fragment,{children:d.jsx(qDe,{children:d.jsxs("div",{children:[d.jsx(_c,{}),typeof t=="string"?d.jsx("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?d.jsx(t,{style:{width:"38px",height:"38px"}}):d.jsx("span",{})]})})});let qDe=fe.div.withConfig({displayName:"StackedContainer",componentId:"sc-26c1d9b9-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const VDe=()=>{let{lastScreen:t,currentScreen:e,data:r,navigateBack:n,navigate:i,setModalData:a}=wt(),{status:s,token:o,waitForResult:l,reset:c,execute:u}=Do(),f=E.useRef([]),h=N=>{f.current=[N,...f.current]},[g,m]=E.useState(!0);E.useEffect(()=>(h(setTimeout(m,1e3,!1)),()=>{f.current.forEach(N=>clearTimeout(N)),f.current=[]}),[]);let[w,C]=E.useState(""),[v,b]=E.useState("Checking that you are a human..."),[A,S]=E.useState(d.jsx(Ot,{onClick:()=>{},disabled:!0,children:"Continue"})),[j,U]=E.useState(!1),[I,B]=E.useState(3),V=r==null?void 0:r.captchaModalData,se=async N=>{try{await(V==null?void 0:V.callback(N)),V!=null&&V.onSuccessNavigateTo&&i(V==null?void 0:V.onSuccessNavigateTo,!1)}catch(k){if(k instanceof nx)return;a({errorModalData:{error:k,previousScreen:t||ye.LANDING}}),i((V==null?void 0:V.onErrorNavigateTo)||ye.ERROR_SCREEN,!1)}};E.useEffect(()=>{s==="success"?h(setTimeout(async()=>{let N=await l();!N||V!=null&&V.userIntentRequired||se(N)},1e3)):s==="ready"&&h(setTimeout(()=>{s==="ready"&&u()},500))},[s]),E.useEffect(()=>{if(!g)switch(s){case"success":C("Success!"),b("CAPTCHA passed successfully."),S(d.jsx(Ot,{onClick:()=>{U(!0),se(o)},disabled:!(V!=null&&V.userIntentRequired),loading:j,children:V!=null&&V.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":C(""),b("Checking that you are a human..."),S(d.jsx(Ot,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":C("Something went wrong"),I<=0?(b("If you use an adblocker or VPN, try disabling and re-attempting."),S(null)):(b("You did not pass CAPTCHA. Please try again."),S(d.jsx(Ot,{onClick:Y,children:"Retry"})))}},[s,g,j]);let Y=async()=>{if(I<=0)return;B(k=>k-1),c(),u();let N=await l();!N||V!=null&&V.userIntentRequired||se(N)};return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:t&&e!==t?n:void 0}),d.jsxs(YDe,{children:[s==="success"?d.jsx(a1,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):s==="error"?d.jsx(qx,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(GDe,{}),d.jsxs(ko,{children:[w?d.jsx("h3",{children:w}):null,d.jsx("p",{children:v})]}),A]}),d.jsx(kr,{})]})};let YDe=fe.div.withConfig({displayName:"CaptchaContainer",componentId:"sc-9afcf974-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const z6=({chainType:t,withPadding:e})=>{let r="";return r=t==="ethereum-only"||t==="ethereum-and-solana"?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",d.jsx(YRe,{$withPadding:e,children:d.jsxs(KRe,{children:[d.jsx(P0,{style:{color:"var(--privy-color-warn)",height:48,width:48}}),d.jsx("h3",{children:"No wallets available"}),d.jsxs("p",{children:["Please download an external wallet provider, like ",r,"."]})]})},"empty-wallet-state")},$ne=({icon:t,name:e})=>typeof t=="string"?d.jsx("img",{alt:`${e||"wallet"} logo`,src:t,style:{height:24,width:24,borderRadius:4}}):t===void 0?d.jsx(cv,{}):t?d.jsx(t,{}):null;let KDe=lne(["from,to{background:var(--privy-color-foreground-4);color:var(--privy-color-foreground-4);}50%{background:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-accent);}"]);const Pne=la(["",""],t=>t.$isLoading?la(["width:35%;animation:"," 2s linear infinite;border-radius:var(--privy-border-radius-sm);"],KDe):""),Ac=({children:t,color:e,isLoading:r,isPulsing:n,...i})=>d.jsx(JDe,{$color:e,$isLoading:r,$isPulsing:n,...i,children:t});let JDe=fe.span.withConfig({displayName:"StyledSpan",componentId:"sc-eba15c9-0"})(["padding:0.125rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);display:flex;align-items:center;"," ",""],t=>{let e,r;t.$color==="green"&&(e="var(--privy-color-success-dark)",r="var(--privy-color-success-light)"),t.$color==="red"&&(e="var(--privy-color-error)",r="var(--privy-color-error-light)"),t.$color==="gray"&&(e="var(--privy-color-foreground-2)",r="var(--privy-color-background-2)");let n=lne(["from,to{background-color:",";}50%{background-color:rgba(",",0.8);}"],r,r);return la(["color:",";background-color:",";",";"],e,r,t.$isPulsing&&la(["animation:"," 3s linear infinite;"],n))},Pne);const QDe=({...t})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...t,children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{offset:"0",stopColor:"#f1562b"}),d.jsx("stop",{offset:"0.3",stopColor:"#f1542b"}),d.jsx("stop",{offset:"0.41",stopColor:"#f04d2a"}),d.jsx("stop",{offset:"0.49",stopColor:"#ef4229"}),d.jsx("stop",{offset:"0.5",stopColor:"#ef4029"}),d.jsx("stop",{offset:"0.56",stopColor:"#e83e28"}),d.jsx("stop",{offset:"0.67",stopColor:"#e13c26"}),d.jsx("stop",{offset:"1",stopColor:"#df3c26"})]})}),d.jsx("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),d.jsx("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]}),ZDe=({style:t,...e})=>d.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("path",{d:"M0 10.2C0 4.56669 4.5667 0 10.2 0H37.8C43.4333 0 48 4.5667 48 10.2V37.8C48 43.4333 43.4333 48 37.8 48H10.2C4.56669 48 0 43.4333 0 37.8V10.2Z",fill:"#604E93"}),d.jsx("path",{d:"M4.13353 14.6218C3.70207 13.1338 4.62517 11.5926 6.14065 11.2707L31.424 5.90036C32.6242 5.64544 33.8434 6.24236 34.3782 7.34668L45.7343 30.7995L13.7343 47.7328L4.13353 14.6218Z",fill:"url(#paint0_linear_362_37285)"}),d.jsx("path",{d:"M4.46332 16.4519C4.00953 14.8821 5.06159 13.277 6.68213 13.0669L40.1928 8.72077C41.5851 8.5402 42.879 9.47008 43.1517 10.8473L48.0004 35.333L13.467 47.5999L4.46332 16.4519Z",fill:"white"}),d.jsx("path",{d:"M0 18.6666C0 15.7211 2.38781 13.3333 5.33333 13.3333H37.3333C43.2244 13.3333 48 18.1089 48 24V37.3333C48 43.2243 43.2244 48 37.3333 48H10.6667C4.77563 48 0 43.2243 0 37.3333V18.6666Z",fill:"black"}),d.jsx("path",{d:"M31.7559 33.3796V23.3867H33.7051V33.3796H31.7559Z",fill:"#F7A600"}),d.jsx("path",{d:"M9.51303 36.362H5.33398V26.3691H9.3449C11.2941 26.3691 12.4301 27.4639 12.4301 29.176C12.4301 30.2844 11.7008 31.0006 11.1964 31.2393C11.7996 31.5201 12.5709 32.1511 12.5709 33.4846C12.5709 35.3513 11.2941 36.362 9.51303 36.362ZM9.19043 28.1096H7.28322V30.4117H9.19043C10.0174 30.4117 10.4808 29.9489 10.4808 29.2612C10.4808 28.5723 10.0185 28.1096 9.19043 28.1096ZM9.31653 32.1658H7.28322V34.6215H9.31653C10.2003 34.6215 10.6206 34.0599 10.6206 33.3868C10.6216 32.7127 10.2003 32.1658 9.31653 32.1658Z",fill:"white"}),d.jsx("path",{d:"M17.9425 32.2637V36.362H16.007V32.2637L13.0059 26.3691H15.1232L16.9884 30.3969L18.8252 26.3691H20.9426L17.9425 32.2637Z",fill:"white"}),d.jsx("path",{d:"M26.4896 36.362H22.3105V26.3691H26.3215C28.2707 26.3691 29.4066 27.4639 29.4066 29.176C29.4066 30.2844 28.6774 31.0006 28.173 31.2393C28.7761 31.5201 29.5474 32.1511 29.5474 33.4846C29.5464 35.3513 28.2696 36.362 26.4896 36.362ZM26.167 28.1096H24.2598V30.4117H26.167C26.994 30.4117 27.4574 29.9489 27.4574 29.2612C27.4563 28.5723 26.994 28.1096 26.167 28.1096ZM26.2931 32.1658H24.2598V34.6215H26.2931C27.1768 34.6215 27.5971 34.0599 27.5971 33.3868C27.5971 32.7127 27.1758 32.1658 26.2931 32.1658Z",fill:"white"}),d.jsx("path",{d:"M40.0573 28.1096V36.362H38.1081V28.1096H35.5V26.3691H42.6665V28.1096H40.0573Z",fill:"white"}),d.jsx("defs",{children:d.jsxs("linearGradient",{id:"paint0_linear_362_37285",x1:"4.00094",y1:"13.9604",x2:"46.1673",y2:"11.8482",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{"stop-color":"#FFD748"}),d.jsx("stop",{offset:"1","stop-color":"#F7A600"})]})})]}),XDe=({style:t,...e})=>d.jsxs("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),d.jsx("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask0_16909_31415)",children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#002D72"}),d.jsx("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),d.jsxs("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),d.jsx("stop",{offset:"1",stopColor:"#002D72"})]})]})]}),Rne=({style:t,...e})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),d.jsx("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),d.jsx("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),d.jsx("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),d.jsx("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),d.jsx("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),d.jsx("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),d.jsx("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),d.jsx("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),d.jsx("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),d.jsx("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),d.jsx("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),d.jsx("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]}),eOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfoDAIVMQ8VNW19AAAGKUlEQVRYw+2WTWxcVxXHf+feN98Tf43j2KmduMEibZOilEjNl9KmImrCoipSkSohIQQSQkJhSdmAAEV0ka742CF11WURsEJRHSg4TWooUhPagkgcO/6IY8ffnhk/z8y9h8Wbsd/4AwEbFnCkJ7173zn/c87/nHPfhf91kcbLt892cX9RebrbcOaA4ViPoVyNvvVemfqPwMdfewyAbAI+nPbcGPfcnvYc6hCuDM0CEDSUDeAUkw54wRqW2gvmL+WHvgIwWQdCofeNqX/JaVwKnSZpZ/zTaUtbpaa/FUSbGPjOc3tRFbyyNzC809sifSf77FBvq/zKKb+rOR23ZtNoJ1a2Oq45SAQctMILk8v6heEJd3ZqRe87z4sizKkqb1x/FDGgGlXCCMe9cvj+sqbLVffyyT7z0uMd5l5gZVCVXwPDmTSL6SSUf9TsUBXWKlAOaQdOJAJe9sr5kXl/aHjCm7myIpAR4ThwVUSaSyARwxeAtACPSso7d515Zj8Dx3rMQCrgK6rcdo5rIsxvayaBmqMAfE6Ez4Q1MremPR8+cKzXou9ABriIcJU6nxsBKKSBo3HA0MHwhGO2pJzuM5lCVk54zwnVDcAmBryPEpkvKTfHPaOLHmWb7lGUNBA2BYBoiMpYU1ZRYIzMexbXlFN9hoGCadR3W81rDu7Oe96f8CyWFZHYmG3KmKoPRUwzA0R9cGunzhaBhbIyOBKxcarfUtjTrLO8BjfHHbcfeiq17QzF5FbDOUTTF5ePgPJuQaw7+NOkZ/COI6xG2QkQVmHwjuODSU/F/VPn5bqPRgvUA9Ami9qu5gq5JPS2CFYiEAWsRHu5ZAx5Z6k1NER1swQi2rAL60/LFr+oQmdWeK7fcrBdmrIUgSNdhlxC+MOYY373+jfwN2ja0kpMAbNAl2rk2EiUdXdeONlr2ZuPUtdYplqnor9dyCYsw5OOh0WlXAGv9VJF/maBB02lbby8drYLIKnws8Dw9da0sL9VeLxD6GkRkgg2xnA+C8lE9F6pQrG8CeiAKsqDFWV0QXmwrCyHSs3zc4FLQGXbvwDgVL+pAD/p75CXulukuyUlGAOlMoSV5vJuYyBWLgO0poT9B4TP9sLKuvJwRadH5/XHCJX3x/yG/kYAP7iYwER89AGtjbo7B0urnnBdMUJDh0RgSCejRbWqFIsRqNfoSaeEdNJgDLRlhPaMtD25jz7g44tPWK4MRThNY1g3ftErmUZWxsCenMU7KK55xpYDZouCd2zMofPwqCiMLgcUyx7vIhtjNhnySqaO3SQGYOX1g411AXh+a+vmMlBoS7AY5Hlrro+bqwWsFbTejNYIN1Y7eGuuj4VEnkJbglyGneQc0AkQvt6zWYJa6AhSABwDDm+1MkbJZoVn81UGuqdZWrMYa4CIdmMN5w+FfDFToiPhEB/Z7CCH6z4GS2uxo9iYOv2e5wWycQvntd5knkDgsaxnf6ZKpbo55QmrPNURIgLVWnTarFeis8CaptMgq3DOGgatjTVhzUVjZAwl3RJ4qayU1xxGhEK7pWWPYA0EwWZDBkHU/TUHK0VlftHhVclmLLls83EkQsl7SKdiATRUvOc6sAps/GpSKWEtFJxXqg6KJU86JcyEUK5E0eaS0JVWwnWlWhOcU4wVUilhS0Krqgxta8LC5cnG+hPg73EFa4R8zmINGBFq+QOMdFzg0rUcr75d5dW3q1y6luNexwVq+QMYI1gL+ZzZSj917E8AOi9PbTIQk0XgPeB4fDOVIHRtbQvhk5/fJ33P2kezZSZX32O1GhVyYhVmO0/R8tR5dOKPLv3X38ykKHYQXXLicgNYiG9sDQDg98A3gCXg48hIr7Pv06NLPWe+msR+K591uW9++RV8fajFCLlsmhLpUqXnzE/bFu69ycwHh0DOAKeBI0A78O5WZ7ErmSDRYTsEfAn4GzBG/X5QDfKMTdz/7r7Ozj9bY77/zNHDRzfOZgFBP1peXfnhzPzcL48EeQfcAa4STVU/8EQdu7kp44vJHe70Dbl74jKqSmAtNec+JSKngfow4VT1RmDtSM05RISB4e/tihW/0u9+d9lB3v3Fm6gooruZRbfIc6987d+B/b/8d+UfeVGT8xvC5akAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjQtMTItMDJUMjE6NDk6MTArMDA6MDB60KjYAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI0LTEyLTAyVDIxOjQ5OjEwKzAwOjAwC40QZAAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyNC0xMi0wMlQyMTo0OToxNSswMDowMA6gHhwAAAAASUVORK5CYII=",Vx=({style:t,...e})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]}),Dne="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyB2aWV3Qm94PScwIDAgMTA4IDEwOCcgZmlsbD0nbm9uZScgc3R5bGU9J2hlaWdodDoyOHB4O3dpZHRoOjI4cHgnPjxyZWN0IHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyByeD0nMjMnIGZpbGw9JyNBQjlGRjInPjwvcmVjdD48cGF0aCBmaWxsLXJ1bGU9J2V2ZW5vZGQnIGNsaXAtcnVsZT0nZXZlbm9kZCcgZD0nTTQ2LjUyNjcgNjkuOTIyOUM0Mi4wMDU0IDc2Ljg1MDkgMzQuNDI5MiA4NS42MTgyIDI0LjM0OCA4NS42MTgyQzE5LjU4MjQgODUuNjE4MiAxNSA4My42NTYzIDE1IDc1LjEzNDJDMTUgNTMuNDMwNSA0NC42MzI2IDE5LjgzMjcgNzIuMTI2OCAxOS44MzI3Qzg3Ljc2OCAxOS44MzI3IDk0IDMwLjY4NDYgOTQgNDMuMDA3OUM5NCA1OC44MjU4IDgzLjczNTUgNzYuOTEyMiA3My41MzIxIDc2LjkxMjJDNzAuMjkzOSA3Ni45MTIyIDY4LjcwNTMgNzUuMTM0MiA2OC43MDUzIDcyLjMxNEM2OC43MDUzIDcxLjU3ODMgNjguODI3NSA3MC43ODEyIDY5LjA3MTkgNjkuOTIyOUM2NS41ODkzIDc1Ljg2OTkgNTguODY4NSA4MS4zODc4IDUyLjU3NTQgODEuMzg3OEM0Ny45OTMgODEuMzg3OCA0NS42NzEzIDc4LjUwNjMgNDUuNjcxMyA3NC40NTk4QzQ1LjY3MTMgNzIuOTg4NCA0NS45NzY4IDcxLjQ1NTYgNDYuNTI2NyA2OS45MjI5Wk04My42NzYxIDQyLjU3OTRDODMuNjc2MSA0Ni4xNzA0IDgxLjU1NzUgNDcuOTY1OCA3OS4xODc1IDQ3Ljk2NThDNzYuNzgxNiA0Ny45NjU4IDc0LjY5ODkgNDYuMTcwNCA3NC42OTg5IDQyLjU3OTRDNzQuNjk4OSAzOC45ODg1IDc2Ljc4MTYgMzcuMTkzMSA3OS4xODc1IDM3LjE5MzFDODEuNTU3NSAzNy4xOTMxIDgzLjY3NjEgMzguOTg4NSA4My42NzYxIDQyLjU3OTRaTTcwLjIxMDMgNDIuNTc5NUM3MC4yMTAzIDQ2LjE3MDQgNjguMDkxNiA0Ny45NjU4IDY1LjcyMTYgNDcuOTY1OEM2My4zMTU3IDQ3Ljk2NTggNjEuMjMzIDQ2LjE3MDQgNjEuMjMzIDQyLjU3OTVDNjEuMjMzIDM4Ljk4ODUgNjMuMzE1NyAzNy4xOTMxIDY1LjcyMTYgMzcuMTkzMUM2OC4wOTE2IDM3LjE5MzEgNzAuMjEwMyAzOC45ODg1IDcwLjIxMDMgNDIuNTc5NVonIGZpbGw9JyNGRkZERjgnPjwvcGF0aD48L3N2Zz4=",tOe=t=>d.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),d.jsx("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),d.jsx("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"white"}),d.jsx("stop",{offset:"1",stopColor:"white"})]}),d.jsxs("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#8697FF"}),d.jsx("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),d.jsxs("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#8697FF"}),d.jsx("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),d.jsxs("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"white"}),d.jsx("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]}),rOe=({style:t,...e})=>d.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("g",{clipPath:"url(#clip0_5_32)",children:d.jsxs("g",{clipPath:"url(#clip1_5_32)",children:[d.jsx("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:d.jsx("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),d.jsx("g",{mask:"url(#mask0_5_32)",children:d.jsx("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),d.jsx("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),d.jsx("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),d.jsx("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),d.jsx("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),d.jsx("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),d.jsx("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),d.jsx("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),d.jsx("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),d.jsx("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#174299"}),d.jsx("stop",{offset:"1",stopColor:"#001E59"})]}),d.jsxs("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[d.jsx("stop",{offset:"0.770277",stopColor:"#FF4000"}),d.jsx("stop",{offset:"1",stopColor:"#8754C9"})]}),d.jsxs("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#FF4000"}),d.jsx("stop",{offset:"1",stopColor:"#8754C9"})]}),d.jsxs("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#8754C9"}),d.jsx("stop",{offset:"1",stopColor:"#FF4000"})]}),d.jsxs("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[d.jsx("stop",{offset:"0.723929",stopColor:"#FFF700"}),d.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),d.jsxs("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#FFF700"}),d.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),d.jsxs("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#FFF700"}),d.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),d.jsxs("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[d.jsx("stop",{offset:"0.59513",stopColor:"#00AAFF"}),d.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),d.jsxs("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[d.jsx("stop",{stopColor:"#00AAFF"}),d.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),d.jsxs("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[d.jsx("stop",{stopColor:"#00AAFF"}),d.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),d.jsx("clipPath",{id:"clip0_5_32",children:d.jsx("rect",{width:"120",height:"120",fill:"white"})}),d.jsx("clipPath",{id:"clip1_5_32",children:d.jsx("rect",{width:"120",height:"120",fill:"white"})})]})]}),nOe=({style:t,...e})=>d.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),d.jsx("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),d.jsx("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),d.jsx("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]}),iOe=({style:t,...e})=>d.jsxs("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),d.jsxs("g",{children:[d.jsx("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),d.jsx("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),d.jsx("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),d.jsx("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),d.jsx("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),d.jsx("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),d.jsx("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]}),aOe=({style:t,...e})=>d.jsxs("svg",{fill:"none",height:"1024",width:"1024",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsxs("filter",{id:"a","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse",height:"1228",width:"1244",x:"-72",y:"-72",children:[d.jsx("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),d.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",mode:"normal",result:"shape"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"-72",dy:"-72"}),d.jsx("feGaussianBlur",{stdDeviation:"54"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),d.jsx("feBlend",{in2:"shape",mode:"normal",result:"effect1_innerShadow_3981_20791"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"152",dy:"132"}),d.jsx("feGaussianBlur",{stdDeviation:"74"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.15 0"}),d.jsx("feBlend",{in2:"effect1_innerShadow_3981_20791",mode:"normal",result:"effect2_innerShadow_3981_20791"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"32",dy:"20"}),d.jsx("feGaussianBlur",{stdDeviation:"50"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"}),d.jsx("feBlend",{in2:"effect2_innerShadow_3981_20791",mode:"normal",result:"effect3_innerShadow_3981_20791"})]}),d.jsxs("filter",{id:"b","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse",height:"352",width:"747",x:"142",y:"352",children:[d.jsx("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),d.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",mode:"normal",result:"shape"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"8",dy:"12"}),d.jsx("feGaussianBlur",{stdDeviation:"5"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.120833 0 0 0 0 0.120833 0 0 0 0 0.120833 0 0 0 0.69 0"}),d.jsx("feBlend",{in2:"shape",mode:"normal",result:"effect1_innerShadow_3981_20791"})]}),d.jsxs("linearGradient",{id:"c",gradientUnits:"userSpaceOnUse",x1:"0",x2:"1024",y1:"0",y2:"1024",children:[d.jsx("stop",{offset:"0",stopColor:"#8992d1"}),d.jsx("stop",{offset:"1",stopColor:"#646c9f"})]}),d.jsx("clipPath",{id:"d",children:d.jsx("path",{d:"m0 0h1024v1024h-1024z"})}),d.jsxs("g",{"clip-path":"url(#d)",children:[d.jsx("g",{filter:"url(#a)",children:d.jsx("rect",{fill:"url(#c)",height:"1024",rx:"230",width:"1024"})}),d.jsxs("g",{fill:"#fff",filter:"url(#b)",children:[d.jsx("path",{d:"m212.459 354h-54.459c-8.837 0-16 7.163-16 16v203c0 66.826 54.174 121 121 121h44c66.826 0 121-54.174 121-121v-203c0-8.837-7.163-16-16-16h-56.548c-8.837 0-16 7.163-16 16v198.829c0 28.607-23.19 51.797-51.797 51.797-32.693 0-59.196-26.503-59.196-59.196v-191.43c0-8.837-7.163-16-16-16z"}),d.jsx("path",{d:"m868.426 352h-68.495c-6.98 0-12.487 5.934-11.967 12.895l14.206 190c.468 6.263 5.686 11.105 11.966 11.105h45.412c6.409 0 11.687-5.037 11.987-11.44l8.878-190c.32-6.84-5.14-12.56-11.987-12.56z"}),d.jsx("ellipse",{cx:"834",cy:"649.5",rx:"47",ry:"44.5"}),d.jsx("path",{clipRule:"evenodd",d:"m522 687h50c8.837 0 16-7.163 16-16v-80c0-8.837 7.163-16 16-16h33.5c61.58 0 111.5-49.92 111.5-111.5s-49.92-111.5-111.5-111.5h-115.5c-8.837 0-16 7.163-16 16v303c0 8.837 7.163 16 16 16zm70-252v58c0 6.627 5.373 12 12 12h14c20.987 0 38-17.013 38-38v-6c0-20.987-17.013-38-38-38h-14c-6.627 0-12 5.373-12 12z",fillRule:"evenodd"})]})]})]}),One=({style:t,...e})=>{let{app:r}=wt();return d.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"28",height:"28",rx:"3",fill:(r==null?void 0:r.appearance.palette.colorScheme)==="dark"?"#3396ff":"#141414"}),d.jsx("g",{clipPath:"url(#clip0_1765_9946)",children:d.jsx("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_1765_9946",children:d.jsx("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})},sOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC",oOe=({style:t,...e})=>d.jsxs("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsxs("g",{clipPath:"url(#clip0_1704_1423)",children:[d.jsx("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_1704_1423",children:d.jsx("rect",{width:"176",height:"176",fill:"white"})})})]}),bu={coinbase_wallet:{logo:VM,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:VM,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Rne,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Vx,displayName:"Phantom"},rainbow:{logo:rOe,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:One,displayName:"WalletConnect"},zerion:{logo:oOe,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:QDe,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:XDe,displayName:"Crypto.com Onchain",rdns:"com.crypto.wallet"},uniswap:{logo:iOe,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:tOe,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:nOe},universal_profile:{displayName:"Universal Profile",logo:aOe},bybit_wallet:{displayName:"Bybit Wallet",logo:ZDe}},Um=(t,e,r)=>{var n;return(n=bu[t])!=null&&n.displayName?t==="coinbase_wallet"?bu[r].displayName:bu[t].displayName:e==="wallet_connect_v2"&&t==="wallet_connect"?"Wallet Connect":void 0},Fne=(t,e,r)=>{var n;return(n=bu[t])!=null&&n.logo?t==="coinbase_wallet"?bu[r].logo:bu[t].logo:e==="wallet_connect_v2"&&t==="wallet_connect"?One:void 0};function uT(t){var r,n;let e=t.toLowerCase();return!!((n=(r=window==null?void 0:window.webkit)==null?void 0:r.messageHandlers)!=null&&n.ReactNativeWebView)||!!(window!=null&&window.ReactNativeWebView)||["fbav","fban","instagram","snapchat","linkedinapp"].some(i=>e.includes(i))}let Une=E.createContext({});const lOe=({children:t})=>{let e=Ai(),[r,n]=E.useState({});return oj("login",{onComplete:(i,a,s,o,l)=>{l&&l.type!=="passkey"&&l.type!=="cross_app"&&(l.type!=="wallet"||l.walletClientType!=="privy")&&(Dt.put(Lz(e.id),l.type),l.type==="wallet"?(Dt.put(vS(e.id),l.walletClientType),Dt.put(bS(e.id),l.chainType),n({accountType:l.type,walletClientType:l.walletClientType,chainType:l.chainType})):(Dt.del(vS(e.id)),Dt.del(bS(e.id)),n({accountType:l.type})))}}),E.useEffect(()=>{if(!e.id)return;let i=Dt.get(Lz(e.id)),a=Dt.get(vS(e.id)),s=Dt.get(bS(e.id));i&&n(i==="wallet"?{accountType:i,walletClientType:a,chainType:s}:{accountType:i})},[e.id]),d.jsx(Une.Provider,{value:r,children:t})};let Lz=t=>`privy:${t}:recent-login-method`,vS=t=>`privy:${t}:recent-login-wallet-client`,bS=t=>`privy:${t}:recent-login-chain-type`;const Mh=()=>E.useContext(Une),rd=({provider:t,displayName:e,logo:r,connectOnly:n,connector:i})=>{let{navigate:a}=wt(),{connectWallet:s}=_t(),o=Mh(),l=i.connectorType==="wallet_connect_v2"?t:i.walletClientType,c=window.matchMedia("(display-mode: standalone)").matches;return d.jsxs(cOe,{onClick:i.connectorType==="phantom"||i.connectorType==="solana_adapter"&&i.walletClientType==="phantom"?()=>{ex()||i.chainType==="solana"&&"isInstalled"in i&&i.isInstalled?(s(i,l),a(n?ye.AWAITING_CONNECT_ONLY_CONNECTION:ye.AWAITING_CONNECTION)):a(ya?ye.PHANTOM_INTERSTITIAL_SCREEN:ye.INSTALL_PHANTOM_SCREEN)}:i.connectorType!=="coinbase_wallet"||i.connectionOptions!=="eoaOnly"||!ya||c||kee()?()=>{(!uT(window.navigator.userAgent)||event!=null&&event.isTrusted)&&(s(i,l),a(n?ye.AWAITING_CONNECT_ONLY_CONNECTION:ye.AWAITING_CONNECTION))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`},children:[d.jsx($ne,{icon:Fne(t,i.connectorType,i.walletClientType)??r,name:i.walletClientType}),d.jsx("span",{children:Um(t,i.connectorType,i.walletClientType)||e||i.walletClientType}),d.jsxs(uOe,{id:"chip-container",children:[(o==null?void 0:o.walletClientType)===l&&(o==null?void 0:o.chainType)===i.chainType?d.jsx(jz,{color:"gray",children:"Recent"}):d.jsx("span",{id:"connect-text",children:"Connect"}),i.connectorType==="solana_adapter"&&d.jsx(jz,{color:"gray",children:"Solana"})]})]})};let cOe=fe(Jn).withConfig({displayName:"ConnectWalletButton",componentId:"sc-b6343d12-0"})(["> #chip-container > #connect-text{font-weight:500;color:var(--privy-color-accent);opacity:0;transition:opacity 0.1s ease-out;}:hover > #chip-container > #connect-text{opacity:1;}@media (max-width:440px){> #chip-container > #connect-text{display:none;}}"]),jz=fe(Ac).withConfig({displayName:"StyledChip",componentId:"sc-b6343d12-1"})(["margin-left:auto;"]),uOe=fe.div.withConfig({displayName:"ChipContainer",componentId:"sc-b6343d12-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const dOe=["coinbase_wallet"];let fOe=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom"];const hOe=["safe"],pOe=["phantom","universal_profile"],yj=({wallets:t})=>{let{app:e}=wt();return t.length===0?d.jsx(z6,{chainType:e.appearance.walletChainType,withPadding:!0}):d.jsx(d.Fragment,{children:t})},s1=({walletList:t,walletChainType:e,connectors:r,connectOnly:n,ignore:i,walletConnectEnabled:a,forceWallet:s})=>{var h,g;let o=[],l=[],c=[],u=r.filter(m=>e==="ethereum-only"?m.chainType==="ethereum":e!=="solana-only"||m.chainType==="solana"),f=u.find(m=>m.connectorType==="wallet_connect_v2");for(let[m,w]of(s?[s.wallet]:t).entries()){if(w==="detected_ethereum_wallets"||w==="detected_wallets")for(let[C,v]of u.filter(({chainType:b,connectorType:A,walletClientType:S})=>b!=="solana"&&(S==="uniswap_wallet_extension"||S==="uniswap_extension"?!i.includes("uniswap"):S==="crypto.com_wallet_extension"||S==="crypto.com_onchain"?!i.includes("cryptocom"):A==="injected"&&!i.includes(S))).entries()){let{walletClientType:b,walletBranding:A,chainType:S}=v;(b==="unknown"?l:o).push(d.jsx(rd,{connectOnly:n,provider:b,logo:A.icon,displayName:A.name,connector:v},`${m}-${w}-${b}-${S}-${C}`))}if(w==="detected_solana_wallets"||w==="detected_wallets")for(let[C,v]of u.filter(({chainType:b,walletClientType:A})=>{if(b==="solana")return e!=="ethereum-only"&&!i.includes(A)}).entries()){let{walletClientType:b,walletBranding:A,chainType:S}=v;(b==="unknown"?l:o).push(d.jsx(rd,{connectOnly:n,provider:b,logo:A.icon,displayName:A.name,connector:v},`${m}-${w}-${b}-${S}-${C}`))}if(pOe.includes(w)){let C=u.find(v=>v.connectorType==="injected"&&v.walletClientType===w||v.connectorType===w);if(C&&o.push(d.jsx(rd,{connectOnly:n,provider:w,connector:C},`${m}-${w}`)),e==="solana-only"||e==="ethereum-and-solana"){let v=u.find(({chainType:b,connectorType:A,walletClientType:S})=>b==="solana"&&A==="solana_adapter"&&S===w);v&&o.push(d.jsx(rd,{connectOnly:n,provider:w,connector:v},`${w}-solana`))}}else if(fOe.includes(w)){let C=u.find(v=>w==="uniswap"?v.walletClientType==="uniswap_wallet_extension"||v.walletClientType==="uniswap_extension":w==="cryptocom"?v.walletClientType==="crypto.com_wallet_extension"||v.walletClientType==="crypto.com_onchain":v.connectorType==="injected"&&v.walletClientType===w);a&&!C&&(C=f),C&&o.push(d.jsx(rd,{connectOnly:n,provider:w,connector:C,logo:C.connectorType==="injected"?C.walletBranding.icon:void 0,displayName:C.connectorType==="injected"?C.walletBranding.name:void 0},`${m}-${w}`))}else if(dOe.includes(w)){let C=u.find(({connectorType:v})=>v===w);C&&o.push(d.jsx(rd,{connectOnly:n,provider:w,connector:C},`${m}-${w}`))}else if(hOe.includes(w))f&&c.push(d.jsx(rd,{connectOnly:n,provider:w,connector:f},`${m}-${w}`));else if(w==="wallet_connect")f&&c.push(d.jsx(rd,{connectOnly:n,provider:w,connector:f},`${m}-${w}`));else if(w===(s==null?void 0:s.wallet)){let C=s.chainType==="ethereum"&&t.includes("detected_ethereum_wallets"),v=s.chainType==="solana"&&t.includes("detected_solana_wallets");if(t.includes("detected_wallets")||C||v){let b=u.find(({walletClientType:A})=>A===w);b&&o.push(d.jsx(rd,{connectOnly:n,provider:w,displayName:(h=b.walletBranding)==null?void 0:h.name,logo:(g=b.walletBranding)==null?void 0:g.icon,connector:b},`${m}-${w}`))}}}return[...l,...o,...c]},gOe=()=>{var s,o;let{app:t,data:e}=wt(),r=(s=e==null?void 0:e.externalConnectWallet)==null?void 0:s.suggestedAddress,n=r?`Connect the wallet with address ${as(r)} ${t!=null&&t.name?`to ${t.name}.`:"."}`:`Connect a wallet to ${t==null?void 0:t.name}`,{connectors:i}=_t(),a=s1({walletList:((o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.walletList)??t.appearance.walletList,walletChainType:t.appearance.walletChainType,connectors:i,connectOnly:!0,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return d.jsxs(d.Fragment,{children:[d.jsx(ft,{},"header"),a.length>0&&d.jsx(uv,{title:"Connect your wallet",description:n}),d.jsx(dh,{children:d.jsx(yj,{wallets:a})}),d.jsx(Qt,{})]})},mOe=()=>{var s,o;let{app:t,data:e}=wt(),r=(s=e==null?void 0:e.externalConnectWallet)==null?void 0:s.suggestedAddress,n=r?d.jsxs("span",{children:["Connect the wallet with address ",d.jsx(bo,{showCopyIcon:!1,address:r})," ",t!=null&&t.name?`to ${t.name}.`:"."]}):`Connect a wallet to your ${t==null?void 0:t.name} account`,{connectors:i}=_t(),a=s1({walletList:((o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.walletList)??t.appearance.walletList,walletChainType:t.appearance.walletChainType,connectors:i,connectOnly:!0,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return d.jsxs(d.Fragment,{children:[d.jsx(ft,{},"header"),a.length>0&&d.jsx(Gx,{title:"Connect your wallet",description:n}),d.jsx(dh,{children:d.jsx(yj,{wallets:a})}),t&&d.jsx(hj,{app:t,alwaysShowImplicitConsent:!0}),d.jsx(Qt,{})]})},wj=({style:t,...e})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...t},...e,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),$z=t=>{var r;let e=(r=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses"))==null?void 0:r.split(" ").filter(n=>vc(n,{strict:!0})).map(n=>qN(n));return!!(e!=null&&e.length)&&!!(t!=null&&t.linkedAccounts.filter(n=>n.type=="wallet"&&e.includes(n.address)).length)};var Pz=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new xOe:typeof navigator<"u"?IOe(navigator.userAgent):TOe()}function AOe(t){return t!==""&&COe.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var a=i.exec(t);return!!a&&[n,a]},!1)}function IOe(t){var e=AOe(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new bOe;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length=0;o--)(s=t[o])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function $Oe(t,e){return function(r,n){e(r,n,t)}}function POe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ROe(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})}function DOe(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[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 Bne(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a}function UOe(){for(var t=[],e=0;e1||o(h,g)})})}function o(h,g){try{l(n[h](g))}catch(m){f(a[0][3],m)}}function l(h){h.value instanceof e3?Promise.resolve(h.value.v).then(c,u):f(a[0][2],h)}function c(h){o("next",h)}function u(h){o("throw",h)}function f(h,g){h(g),a.shift(),a.length&&o(a[0][0],a[0][1])}}function WOe(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,a){e[i]=t[i]?function(s){return(r=!r)?{value:e3(t[i](s)),done:i==="return"}:a?a(s):s}:a}}function HOe(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 hT=="function"?hT(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(s){return new Promise(function(o,l){s=t[a](s),i(o,l,s.done,s.value)})}}function i(a,s,o,l){Promise.resolve(l).then(function(c){a({value:c,done:o})},s)}}function GOe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function qOe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function VOe(t){return t&&t.__esModule?t:{default:t}}function YOe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function KOe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const JOe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return fT},__asyncDelegator:WOe,__asyncGenerator:zOe,__asyncValues:HOe,__await:e3,__awaiter:ROe,__classPrivateFieldGet:YOe,__classPrivateFieldSet:KOe,__createBinding:OOe,__decorate:jOe,__exportStar:FOe,__extends:NOe,__generator:DOe,__importDefault:VOe,__importStar:qOe,__makeTemplateObject:GOe,__metadata:POe,__param:$Oe,__read:Bne,__rest:LOe,__spread:UOe,__spreadArrays:BOe,__values:hT},Symbol.toStringTag,{value:"Module"})),Yx=yh(JOe);var xS={},G2={},Oz;function QOe(){if(Oz)return G2;Oz=1,Object.defineProperty(G2,"__esModule",{value:!0}),G2.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return G2.delay=t,G2}var Zh={},ES={},Xh={},Fz;function ZOe(){return Fz||(Fz=1,Object.defineProperty(Xh,"__esModule",{value:!0}),Xh.ONE_THOUSAND=Xh.ONE_HUNDRED=void 0,Xh.ONE_HUNDRED=100,Xh.ONE_THOUSAND=1e3),Xh}var _S={},Uz;function XOe(){return Uz||(Uz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(_S)),_S}var Bz;function zne(){return Bz||(Bz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Yx;e.__exportStar(ZOe(),t),e.__exportStar(XOe(),t)}(ES)),ES}var zz;function eFe(){if(zz)return Zh;zz=1,Object.defineProperty(Zh,"__esModule",{value:!0}),Zh.fromMiliseconds=Zh.toMiliseconds=void 0;const t=zne();function e(n){return n*t.ONE_THOUSAND}Zh.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Zh.fromMiliseconds=r,Zh}var Wz;function tFe(){return Wz||(Wz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Yx;e.__exportStar(QOe(),t),e.__exportStar(eFe(),t)}(xS)),xS}var Ep={},Hz;function rFe(){if(Hz)return Ep;Hz=1,Object.defineProperty(Ep,"__esModule",{value:!0}),Ep.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return Ep.Watch=t,Ep.default=t,Ep}var CS={},q2={},Gz;function nFe(){if(Gz)return q2;Gz=1,Object.defineProperty(q2,"__esModule",{value:!0}),q2.IWatch=void 0;class t{}return q2.IWatch=t,q2}var qz;function iFe(){return qz||(qz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Yx.__exportStar(nFe(),t)}(CS)),CS}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Yx;e.__exportStar(tFe(),t),e.__exportStar(rFe(),t),e.__exportStar(iFe(),t),e.__exportStar(zne(),t)})(ct);var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.getLocalStorage=Sn.getLocalStorageOrThrow=Sn.getCrypto=Sn.getCryptoOrThrow=Wne=Sn.getLocation=Sn.getLocationOrThrow=vj=Sn.getNavigator=Sn.getNavigatorOrThrow=dv=Sn.getDocument=Sn.getDocumentOrThrow=Sn.getFromWindowOrThrow=Sn.getFromWindow=void 0;function N1(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Sn.getFromWindow=N1;function Bm(t){const e=N1(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Sn.getFromWindowOrThrow=Bm;function aFe(){return Bm("document")}Sn.getDocumentOrThrow=aFe;function sFe(){return N1("document")}var dv=Sn.getDocument=sFe;function oFe(){return Bm("navigator")}Sn.getNavigatorOrThrow=oFe;function lFe(){return N1("navigator")}var vj=Sn.getNavigator=lFe;function cFe(){return Bm("location")}Sn.getLocationOrThrow=cFe;function uFe(){return N1("location")}var Wne=Sn.getLocation=uFe;function dFe(){return Bm("crypto")}Sn.getCryptoOrThrow=dFe;function fFe(){return N1("crypto")}Sn.getCrypto=fFe;function hFe(){return Bm("localStorage")}Sn.getLocalStorageOrThrow=hFe;function pFe(){return N1("localStorage")}Sn.getLocalStorage=pFe;var bj={};Object.defineProperty(bj,"__esModule",{value:!0});var Hne=bj.getWindowMetadata=void 0;const Vz=Sn;function gFe(){let t,e;try{t=Vz.getDocumentOrThrow(),e=Vz.getLocationOrThrow()}catch{return null}function r(){const f=t.getElementsByTagName("link"),h=[];for(let g=0;g-1){const C=m.getAttribute("href");if(C)if(C.toLowerCase().indexOf("https:")===-1&&C.toLowerCase().indexOf("http:")===-1&&C.indexOf("//")!==0){let v=e.protocol+"//"+e.host;if(C.indexOf("/")===0)v+=C;else{const b=e.pathname.split("/");b.pop();const A=b.join("/");v+=A+"/"+C}h.push(v)}else if(C.indexOf("//")===0){const v=e.protocol+C;h.push(v)}else h.push(C)}}return h}function n(...f){const h=t.getElementsByTagName("meta");for(let g=0;gm.getAttribute(C)).filter(C=>C?f.includes(C):!1);if(w.length&&w){const C=m.getAttribute("content");if(C)return C}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}function a(){return n("description","og:description","twitter:description","keywords")}const s=i(),o=a(),l=e.origin,c=r();return{description:o,url:l,icons:c,name:s}}Hne=bj.getWindowMetadata=gFe;var t3={},mFe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Gne="%[a-f0-9]{2}",Yz=new RegExp("("+Gne+")|([^%]+?)","gi"),Kz=new RegExp("("+Gne+")+","gi");function pT(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],pT(r),pT(n))}function yFe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(Yz)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},xFe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),a=0;ab==null,s=Symbol("encodeFragmentIdentifier");function o(b){switch(b.arrayFormat){case"index":return A=>(S,j)=>{const U=S.length;return j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,[u(A,b),"[",U,"]"].join("")]:[...S,[u(A,b),"[",u(U,b),"]=",u(j,b)].join("")]};case"bracket":return A=>(S,j)=>j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,[u(A,b),"[]"].join("")]:[...S,[u(A,b),"[]=",u(j,b)].join("")];case"colon-list-separator":return A=>(S,j)=>j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,[u(A,b),":list="].join("")]:[...S,[u(A,b),":list=",u(j,b)].join("")];case"comma":case"separator":case"bracket-separator":{const A=b.arrayFormat==="bracket-separator"?"[]=":"=";return S=>(j,U)=>U===void 0||b.skipNull&&U===null||b.skipEmptyString&&U===""?j:(U=U===null?"":U,j.length===0?[[u(S,b),A,u(U,b)].join("")]:[[j,u(U,b)].join(b.arrayFormatSeparator)])}default:return A=>(S,j)=>j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,u(A,b)]:[...S,[u(A,b),"=",u(j,b)].join("")]}}function l(b){let A;switch(b.arrayFormat){case"index":return(S,j,U)=>{if(A=/\[(\d*)\]$/.exec(S),S=S.replace(/\[\d*\]$/,""),!A){U[S]=j;return}U[S]===void 0&&(U[S]={}),U[S][A[1]]=j};case"bracket":return(S,j,U)=>{if(A=/(\[\])$/.exec(S),S=S.replace(/\[\]$/,""),!A){U[S]=j;return}if(U[S]===void 0){U[S]=[j];return}U[S]=[].concat(U[S],j)};case"colon-list-separator":return(S,j,U)=>{if(A=/(:list)$/.exec(S),S=S.replace(/:list$/,""),!A){U[S]=j;return}if(U[S]===void 0){U[S]=[j];return}U[S]=[].concat(U[S],j)};case"comma":case"separator":return(S,j,U)=>{const I=typeof j=="string"&&j.includes(b.arrayFormatSeparator),B=typeof j=="string"&&!I&&f(j,b).includes(b.arrayFormatSeparator);j=B?f(j,b):j;const V=I||B?j.split(b.arrayFormatSeparator).map(se=>f(se,b)):j===null?j:f(j,b);U[S]=V};case"bracket-separator":return(S,j,U)=>{const I=/(\[\])$/.test(S);if(S=S.replace(/\[\]$/,""),!I){U[S]=j&&f(j,b);return}const B=j===null?[]:j.split(b.arrayFormatSeparator).map(V=>f(V,b));if(U[S]===void 0){U[S]=B;return}U[S]=[].concat(U[S],B)};default:return(S,j,U)=>{if(U[S]===void 0){U[S]=j;return}U[S]=[].concat(U[S],j)}}}function c(b){if(typeof b!="string"||b.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(b,A){return A.encode?A.strict?e(b):encodeURIComponent(b):b}function f(b,A){return A.decode?r(b):b}function h(b){return Array.isArray(b)?b.sort():typeof b=="object"?h(Object.keys(b)).sort((A,S)=>Number(A)-Number(S)).map(A=>b[A]):b}function g(b){const A=b.indexOf("#");return A!==-1&&(b=b.slice(0,A)),b}function m(b){let A="";const S=b.indexOf("#");return S!==-1&&(A=b.slice(S)),A}function w(b){b=g(b);const A=b.indexOf("?");return A===-1?"":b.slice(A+1)}function C(b,A){return A.parseNumbers&&!Number.isNaN(Number(b))&&typeof b=="string"&&b.trim()!==""?b=Number(b):A.parseBooleans&&b!==null&&(b.toLowerCase()==="true"||b.toLowerCase()==="false")&&(b=b.toLowerCase()==="true"),b}function v(b,A){A=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},A),c(A.arrayFormatSeparator);const S=l(A),j=Object.create(null);if(typeof b!="string"||(b=b.trim().replace(/^[?#&]/,""),!b))return j;for(const U of b.split("&")){if(U==="")continue;let[I,B]=n(A.decode?U.replace(/\+/g," "):U,"=");B=B===void 0?null:["comma","separator","bracket-separator"].includes(A.arrayFormat)?B:f(B,A),S(f(I,A),B,j)}for(const U of Object.keys(j)){const I=j[U];if(typeof I=="object"&&I!==null)for(const B of Object.keys(I))I[B]=C(I[B],A);else j[U]=C(I,A)}return A.sort===!1?j:(A.sort===!0?Object.keys(j).sort():Object.keys(j).sort(A.sort)).reduce((U,I)=>{const B=j[I];return B&&typeof B=="object"&&!Array.isArray(B)?U[I]=h(B):U[I]=B,U},Object.create(null))}t.extract=w,t.parse=v,t.stringify=(b,A)=>{if(!b)return"";A=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},A),c(A.arrayFormatSeparator);const S=B=>A.skipNull&&a(b[B])||A.skipEmptyString&&b[B]==="",j=o(A),U={};for(const B of Object.keys(b))S(B)||(U[B]=b[B]);const I=Object.keys(U);return A.sort!==!1&&I.sort(A.sort),I.map(B=>{const V=b[B];return V===void 0?"":V===null?u(B,A):Array.isArray(V)?V.length===0&&A.arrayFormat==="bracket-separator"?u(B,A)+"[]":V.reduce(j(B),[]).join("&"):u(B,A)+"="+u(V,A)}).filter(B=>B.length>0).join("&")},t.parseUrl=(b,A)=>{A=Object.assign({decode:!0},A);const[S,j]=n(b,"#");return Object.assign({url:S.split("?")[0]||"",query:v(w(b),A)},A&&A.parseFragmentIdentifier&&j?{fragmentIdentifier:f(j,A)}:{})},t.stringifyUrl=(b,A)=>{A=Object.assign({encode:!0,strict:!0,[s]:!0},A);const S=g(b.url).split("?")[0]||"",j=t.extract(b.url),U=t.parse(j,{sort:!1}),I=Object.assign(U,b.query);let B=t.stringify(I,A);B&&(B=`?${B}`);let V=m(b.url);return b.fragmentIdentifier&&(V=`#${A[s]?u(b.fragmentIdentifier,A):b.fragmentIdentifier}`),`${S}${B}${V}`},t.pick=(b,A,S)=>{S=Object.assign({parseFragmentIdentifier:!0,[s]:!1},S);const{url:j,query:U,fragmentIdentifier:I}=t.parseUrl(b,S);return t.stringifyUrl({url:j,query:i(U,A),fragmentIdentifier:I},S)},t.exclude=(b,A,S)=>{const j=Array.isArray(A)?U=>!A.includes(U):(U,I)=>!A(U,I);return t.pick(b,j,S)}})(t3);var xj={},Kx={},wr={},qne={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,l){var c=o>>>16&65535,u=o&65535,f=l>>>16&65535,h=l&65535;return u*h+(c*h+u*f<<16>>>0)|0}t.mul=Math.imul||e;function r(o,l){return o+l|0}t.add=r;function n(o,l){return o-l|0}t.sub=n;function i(o,l){return o<>>32-l}t.rotl=i;function a(o,l){return o<<32-l|o>>>l}t.rotr=a;function s(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o}t.isInteger=Number.isInteger||s,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(o){return t.isInteger(o)&&o>=-t.MAX_SAFE_INTEGER&&o<=t.MAX_SAFE_INTEGER}})(qne);Object.defineProperty(wr,"__esModule",{value:!0});var Vne=qne;function EFe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}wr.readInt16BE=EFe;function _Fe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}wr.readUint16BE=_Fe;function CFe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}wr.readInt16LE=CFe;function SFe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}wr.readUint16LE=SFe;function Yne(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}wr.writeUint16BE=Yne;wr.writeInt16BE=Yne;function Kne(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}wr.writeUint16LE=Kne;wr.writeInt16LE=Kne;function gT(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}wr.readInt32BE=gT;function mT(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}wr.readUint32BE=mT;function yT(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}wr.readInt32LE=yT;function wT(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}wr.readUint32LE=wT;function f8(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}wr.writeUint32BE=f8;wr.writeInt32BE=f8;function h8(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}wr.writeUint32LE=h8;wr.writeInt32LE=h8;function AFe(t,e){e===void 0&&(e=0);var r=gT(t,e),n=gT(t,e+4);return r*4294967296+n-(n>>31)*4294967296}wr.readInt64BE=AFe;function IFe(t,e){e===void 0&&(e=0);var r=mT(t,e),n=mT(t,e+4);return r*4294967296+n}wr.readUint64BE=IFe;function MFe(t,e){e===void 0&&(e=0);var r=yT(t,e),n=yT(t,e+4);return n*4294967296+r-(r>>31)*4294967296}wr.readInt64LE=MFe;function TFe(t,e){e===void 0&&(e=0);var r=wT(t,e),n=wT(t,e+4);return n*4294967296+r}wr.readUint64LE=TFe;function Jne(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),f8(t/4294967296>>>0,e,r),f8(t>>>0,e,r+4),e}wr.writeUint64BE=Jne;wr.writeInt64BE=Jne;function Qne(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),h8(t>>>0,e,r),h8(t/4294967296>>>0,e,r+4),e}wr.writeUint64LE=Qne;wr.writeInt64LE=Qne;function kFe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=t/8+r-1;a>=r;a--)n+=e[a]*i,i*=256;return n}wr.readUintBE=kFe;function NFe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=r;a=n;a--)r[a]=e/i&255,i*=256;return r}wr.writeUintBE=LFe;function jFe(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Vne.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a>>16|_<<16,Y=Y+_|0,I^=Y,I=I>>>20|I<<12,S=S+B|0,L^=S,L=L>>>16|L<<16,N=N+L|0,B^=N,B=B>>>20|B<<12,j=j+V|0,O^=j,O=O>>>16|O<<16,k=k+O|0,V^=k,V=V>>>20|V<<12,U=U+se|0,P^=U,P=P>>>16|P<<16,x=x+P|0,se^=x,se=se>>>20|se<<12,j=j+V|0,O^=j,O=O>>>24|O<<8,k=k+O|0,V^=k,V=V>>>25|V<<7,U=U+se|0,P^=U,P=P>>>24|P<<8,x=x+P|0,se^=x,se=se>>>25|se<<7,S=S+B|0,L^=S,L=L>>>24|L<<8,N=N+L|0,B^=N,B=B>>>25|B<<7,A=A+I|0,_^=A,_=_>>>24|_<<8,Y=Y+_|0,I^=Y,I=I>>>25|I<<7,A=A+B|0,P^=A,P=P>>>16|P<<16,k=k+P|0,B^=k,B=B>>>20|B<<12,S=S+V|0,_^=S,_=_>>>16|_<<16,x=x+_|0,V^=x,V=V>>>20|V<<12,j=j+se|0,L^=j,L=L>>>16|L<<16,Y=Y+L|0,se^=Y,se=se>>>20|se<<12,U=U+I|0,O^=U,O=O>>>16|O<<16,N=N+O|0,I^=N,I=I>>>20|I<<12,j=j+se|0,L^=j,L=L>>>24|L<<8,Y=Y+L|0,se^=Y,se=se>>>25|se<<7,U=U+I|0,O^=U,O=O>>>24|O<<8,N=N+O|0,I^=N,I=I>>>25|I<<7,S=S+V|0,_^=S,_=_>>>24|_<<8,x=x+_|0,V^=x,V=V>>>25|V<<7,A=A+B|0,P^=A,P=P>>>24|P<<8,k=k+P|0,B^=k,B=B>>>25|B<<7;Ma.writeUint32LE(A+n|0,t,0),Ma.writeUint32LE(S+i|0,t,4),Ma.writeUint32LE(j+a|0,t,8),Ma.writeUint32LE(U+s|0,t,12),Ma.writeUint32LE(I+o|0,t,16),Ma.writeUint32LE(B+l|0,t,20),Ma.writeUint32LE(V+c|0,t,24),Ma.writeUint32LE(se+u|0,t,28),Ma.writeUint32LE(Y+f|0,t,32),Ma.writeUint32LE(N+h|0,t,36),Ma.writeUint32LE(k+g|0,t,40),Ma.writeUint32LE(x+m|0,t,44),Ma.writeUint32LE(_+w|0,t,48),Ma.writeUint32LE(L+C|0,t,52),Ma.writeUint32LE(O+v|0,t,56),Ma.writeUint32LE(P+b|0,t,60)}function Zne(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Xne={},Th={};Object.defineProperty(Th,"__esModule",{value:!0});function VFe(t,e,r){return~(t-1)&e|t-1&r}Th.select=VFe;function YFe(t,e){return(t|0)-(e|0)-1>>>31&1}Th.lessOrEqual=YFe;function eie(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Th.compare=eie;function KFe(t,e){return t.length===0||e.length===0?!1:eie(t,e)!==0}Th.equal=KFe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Th,r=Oo;t.DIGEST_LENGTH=16;var n=function(){function s(o){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var l=o[0]|o[1]<<8;this._r[0]=l&8191;var c=o[2]|o[3]<<8;this._r[1]=(l>>>13|c<<3)&8191;var u=o[4]|o[5]<<8;this._r[2]=(c>>>10|u<<6)&7939;var f=o[6]|o[7]<<8;this._r[3]=(u>>>7|f<<9)&8191;var h=o[8]|o[9]<<8;this._r[4]=(f>>>4|h<<12)&255,this._r[5]=h>>>1&8190;var g=o[10]|o[11]<<8;this._r[6]=(h>>>14|g<<2)&8191;var m=o[12]|o[13]<<8;this._r[7]=(g>>>11|m<<5)&8065;var w=o[14]|o[15]<<8;this._r[8]=(m>>>8|w<<8)&8191,this._r[9]=w>>>5&127,this._pad[0]=o[16]|o[17]<<8,this._pad[1]=o[18]|o[19]<<8,this._pad[2]=o[20]|o[21]<<8,this._pad[3]=o[22]|o[23]<<8,this._pad[4]=o[24]|o[25]<<8,this._pad[5]=o[26]|o[27]<<8,this._pad[6]=o[28]|o[29]<<8,this._pad[7]=o[30]|o[31]<<8}return s.prototype._blocks=function(o,l,c){for(var u=this._fin?0:2048,f=this._h[0],h=this._h[1],g=this._h[2],m=this._h[3],w=this._h[4],C=this._h[5],v=this._h[6],b=this._h[7],A=this._h[8],S=this._h[9],j=this._r[0],U=this._r[1],I=this._r[2],B=this._r[3],V=this._r[4],se=this._r[5],Y=this._r[6],N=this._r[7],k=this._r[8],x=this._r[9];c>=16;){var _=o[l+0]|o[l+1]<<8;f+=_&8191;var L=o[l+2]|o[l+3]<<8;h+=(_>>>13|L<<3)&8191;var O=o[l+4]|o[l+5]<<8;g+=(L>>>10|O<<6)&8191;var P=o[l+6]|o[l+7]<<8;m+=(O>>>7|P<<9)&8191;var R=o[l+8]|o[l+9]<<8;w+=(P>>>4|R<<12)&8191,C+=R>>>1&8191;var M=o[l+10]|o[l+11]<<8;v+=(R>>>14|M<<2)&8191;var D=o[l+12]|o[l+13]<<8;b+=(M>>>11|D<<5)&8191;var $=o[l+14]|o[l+15]<<8;A+=(D>>>8|$<<8)&8191,S+=$>>>5|u;var X=0,le=X;le+=f*j,le+=h*(5*x),le+=g*(5*k),le+=m*(5*N),le+=w*(5*Y),X=le>>>13,le&=8191,le+=C*(5*se),le+=v*(5*V),le+=b*(5*B),le+=A*(5*I),le+=S*(5*U),X+=le>>>13,le&=8191;var H=X;H+=f*U,H+=h*j,H+=g*(5*x),H+=m*(5*k),H+=w*(5*N),X=H>>>13,H&=8191,H+=C*(5*Y),H+=v*(5*se),H+=b*(5*V),H+=A*(5*B),H+=S*(5*I),X+=H>>>13,H&=8191;var ee=X;ee+=f*I,ee+=h*U,ee+=g*j,ee+=m*(5*x),ee+=w*(5*k),X=ee>>>13,ee&=8191,ee+=C*(5*N),ee+=v*(5*Y),ee+=b*(5*se),ee+=A*(5*V),ee+=S*(5*B),X+=ee>>>13,ee&=8191;var J=X;J+=f*B,J+=h*I,J+=g*U,J+=m*j,J+=w*(5*x),X=J>>>13,J&=8191,J+=C*(5*k),J+=v*(5*N),J+=b*(5*Y),J+=A*(5*se),J+=S*(5*V),X+=J>>>13,J&=8191;var te=X;te+=f*V,te+=h*B,te+=g*I,te+=m*U,te+=w*j,X=te>>>13,te&=8191,te+=C*(5*x),te+=v*(5*k),te+=b*(5*N),te+=A*(5*Y),te+=S*(5*se),X+=te>>>13,te&=8191;var re=X;re+=f*se,re+=h*V,re+=g*B,re+=m*I,re+=w*U,X=re>>>13,re&=8191,re+=C*j,re+=v*(5*x),re+=b*(5*k),re+=A*(5*N),re+=S*(5*Y),X+=re>>>13,re&=8191;var z=X;z+=f*Y,z+=h*se,z+=g*V,z+=m*B,z+=w*I,X=z>>>13,z&=8191,z+=C*U,z+=v*j,z+=b*(5*x),z+=A*(5*k),z+=S*(5*N),X+=z>>>13,z&=8191;var G=X;G+=f*N,G+=h*Y,G+=g*se,G+=m*V,G+=w*B,X=G>>>13,G&=8191,G+=C*I,G+=v*U,G+=b*j,G+=A*(5*x),G+=S*(5*k),X+=G>>>13,G&=8191;var Q=X;Q+=f*k,Q+=h*N,Q+=g*Y,Q+=m*se,Q+=w*V,X=Q>>>13,Q&=8191,Q+=C*B,Q+=v*I,Q+=b*U,Q+=A*j,Q+=S*(5*x),X+=Q>>>13,Q&=8191;var me=X;me+=f*x,me+=h*k,me+=g*N,me+=m*Y,me+=w*se,X=me>>>13,me&=8191,me+=C*V,me+=v*B,me+=b*I,me+=A*U,me+=S*j,X+=me>>>13,me&=8191,X=(X<<2)+X|0,X=X+le|0,le=X&8191,X=X>>>13,H+=X,f=le,h=H,g=ee,m=J,w=te,C=re,v=z,b=G,A=Q,S=me,l+=16,c-=16}this._h[0]=f,this._h[1]=h,this._h[2]=g,this._h[3]=m,this._h[4]=w,this._h[5]=C,this._h[6]=v,this._h[7]=b,this._h[8]=A,this._h[9]=S},s.prototype.finish=function(o,l){l===void 0&&(l=0);var c=new Uint16Array(10),u,f,h,g;if(this._leftover){for(g=this._leftover,this._buffer[g++]=1;g<16;g++)this._buffer[g]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(u=this._h[1]>>>13,this._h[1]&=8191,g=2;g<10;g++)this._h[g]+=u,u=this._h[g]>>>13,this._h[g]&=8191;for(this._h[0]+=u*5,u=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=u,u=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=u,c[0]=this._h[0]+5,u=c[0]>>>13,c[0]&=8191,g=1;g<10;g++)c[g]=this._h[g]+u,u=c[g]>>>13,c[g]&=8191;for(c[9]-=8192,f=(u^1)-1,g=0;g<10;g++)c[g]&=f;for(f=~f,g=0;g<10;g++)this._h[g]=this._h[g]&f|c[g];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,h=this._h[0]+this._pad[0],this._h[0]=h&65535,g=1;g<8;g++)h=(this._h[g]+this._pad[g]|0)+(h>>>16)|0,this._h[g]=h&65535;return o[l+0]=this._h[0]>>>0,o[l+1]=this._h[0]>>>8,o[l+2]=this._h[1]>>>0,o[l+3]=this._h[1]>>>8,o[l+4]=this._h[2]>>>0,o[l+5]=this._h[2]>>>8,o[l+6]=this._h[3]>>>0,o[l+7]=this._h[3]>>>8,o[l+8]=this._h[4]>>>0,o[l+9]=this._h[4]>>>8,o[l+10]=this._h[5]>>>0,o[l+11]=this._h[5]>>>8,o[l+12]=this._h[6]>>>0,o[l+13]=this._h[6]>>>8,o[l+14]=this._h[7]>>>0,o[l+15]=this._h[7]>>>8,this._finished=!0,this},s.prototype.update=function(o){var l=0,c=o.length,u;if(this._leftover){u=16-this._leftover,u>c&&(u=c);for(var f=0;f=16&&(u=c-c%16,this._blocks(o,l,u),l+=u,c-=u),c){for(var f=0;f16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var g=new Uint8Array(16);g.set(c,g.length-c.length);var m=new Uint8Array(32);e.stream(this._key,g,m,4);var w=u.length+this.tagLength,C;if(h){if(h.length!==w)throw new Error("ChaCha20Poly1305: incorrect destination length");C=h}else C=new Uint8Array(w);return e.streamXOR(this._key,g,u,C,4),this._authenticate(C.subarray(C.length-this.tagLength,C.length),m,C.subarray(0,C.length-this.tagLength),f),n.wipe(g),C},l.prototype.open=function(c,u,f,h){if(c.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(u.length0&&g.update(s.subarray(h.length%16))),g.update(f),f.length%16>0&&g.update(s.subarray(f.length%16));var m=new Uint8Array(8);h&&i.writeUint64LE(h.length,m),g.update(m),i.writeUint64LE(f.length,m),g.update(m);for(var w=g.digest(),C=0;Cthis.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n256)throw new Error("randomString charset is too long");let h="";const g=u.length,m=256-256%g;for(;c>0;){const w=i(Math.ceil(c*256/m),f);for(let C=0;C0;C++){const v=w[C];v0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=l[u++],c--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=a(this._temp,this._state,l,u,c),c%=this.blockSize);c>0;)this._buffer[this._bufferLength++]=l[u++],c--;return this},o.prototype.finish=function(l){if(!this._finished){var c=this._bytesHashed,u=this._bufferLength,f=c/536870912|0,h=c<<3,g=c%64<56?64:128;this._buffer[u]=128;for(var m=u+1;m0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},o.prototype.restoreState=function(l){return this._state.set(l.state),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},o.prototype.cleanSavedState=function(l){r.wipe(l.state),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},o}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(o,l,c,u,f){for(;f>=64;){for(var h=l[0],g=l[1],m=l[2],w=l[3],C=l[4],v=l[5],b=l[6],A=l[7],S=0;S<16;S++){var j=u+S*4;o[S]=e.readUint32BE(c,j)}for(var S=16;S<64;S++){var U=o[S-2],I=(U>>>17|U<<15)^(U>>>19|U<<13)^U>>>10;U=o[S-15];var B=(U>>>7|U<<25)^(U>>>18|U<<14)^U>>>3;o[S]=(I+o[S-7]|0)+(B+o[S-16]|0)}for(var S=0;S<64;S++){var I=(((C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7))+(C&v^~C&b)|0)+(A+(i[S]+o[S]|0)|0)|0,B=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&g^h&m^g&m)|0;A=b,b=v,v=C,C=w+I|0,w=m,m=g,g=h,h=I+B|0}l[0]+=h,l[1]+=g,l[2]+=m,l[3]+=w,l[4]+=C,l[5]+=v,l[6]+=b,l[7]+=A,u+=64,f-=64}return u}function s(o){var l=new n;l.update(o);var c=l.digest();return l.clean(),c}t.hash=s})(hv);var _j={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=kh,r=Oo;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(S){const j=new Float64Array(16);if(S)for(let U=0;U>16&1),U[se-1]&=65535;U[15]=I[15]-32767-(U[14]>>16&1);const V=U[15]>>16&1;U[14]&=65535,o(I,U,1-V)}for(let B=0;B<16;B++)S[2*B]=I[B]&255,S[2*B+1]=I[B]>>8}function c(S,j){for(let U=0;U<16;U++)S[U]=j[2*U]+(j[2*U+1]<<8);S[15]&=32767}function u(S,j,U){for(let I=0;I<16;I++)S[I]=j[I]+U[I]}function f(S,j,U){for(let I=0;I<16;I++)S[I]=j[I]-U[I]}function h(S,j,U){let I,B,V=0,se=0,Y=0,N=0,k=0,x=0,_=0,L=0,O=0,P=0,R=0,M=0,D=0,$=0,X=0,le=0,H=0,ee=0,J=0,te=0,re=0,z=0,G=0,Q=0,me=0,be=0,Ce=0,Fe=0,Ue=0,Ke=0,lt=0,Ee=U[0],He=U[1],qe=U[2],Ie=U[3],Ne=U[4],$e=U[5],je=U[6],K=U[7],F=U[8],W=U[9],ie=U[10],pe=U[11],we=U[12],he=U[13],Re=U[14],Je=U[15];I=j[0],V+=I*Ee,se+=I*He,Y+=I*qe,N+=I*Ie,k+=I*Ne,x+=I*$e,_+=I*je,L+=I*K,O+=I*F,P+=I*W,R+=I*ie,M+=I*pe,D+=I*we,$+=I*he,X+=I*Re,le+=I*Je,I=j[1],se+=I*Ee,Y+=I*He,N+=I*qe,k+=I*Ie,x+=I*Ne,_+=I*$e,L+=I*je,O+=I*K,P+=I*F,R+=I*W,M+=I*ie,D+=I*pe,$+=I*we,X+=I*he,le+=I*Re,H+=I*Je,I=j[2],Y+=I*Ee,N+=I*He,k+=I*qe,x+=I*Ie,_+=I*Ne,L+=I*$e,O+=I*je,P+=I*K,R+=I*F,M+=I*W,D+=I*ie,$+=I*pe,X+=I*we,le+=I*he,H+=I*Re,ee+=I*Je,I=j[3],N+=I*Ee,k+=I*He,x+=I*qe,_+=I*Ie,L+=I*Ne,O+=I*$e,P+=I*je,R+=I*K,M+=I*F,D+=I*W,$+=I*ie,X+=I*pe,le+=I*we,H+=I*he,ee+=I*Re,J+=I*Je,I=j[4],k+=I*Ee,x+=I*He,_+=I*qe,L+=I*Ie,O+=I*Ne,P+=I*$e,R+=I*je,M+=I*K,D+=I*F,$+=I*W,X+=I*ie,le+=I*pe,H+=I*we,ee+=I*he,J+=I*Re,te+=I*Je,I=j[5],x+=I*Ee,_+=I*He,L+=I*qe,O+=I*Ie,P+=I*Ne,R+=I*$e,M+=I*je,D+=I*K,$+=I*F,X+=I*W,le+=I*ie,H+=I*pe,ee+=I*we,J+=I*he,te+=I*Re,re+=I*Je,I=j[6],_+=I*Ee,L+=I*He,O+=I*qe,P+=I*Ie,R+=I*Ne,M+=I*$e,D+=I*je,$+=I*K,X+=I*F,le+=I*W,H+=I*ie,ee+=I*pe,J+=I*we,te+=I*he,re+=I*Re,z+=I*Je,I=j[7],L+=I*Ee,O+=I*He,P+=I*qe,R+=I*Ie,M+=I*Ne,D+=I*$e,$+=I*je,X+=I*K,le+=I*F,H+=I*W,ee+=I*ie,J+=I*pe,te+=I*we,re+=I*he,z+=I*Re,G+=I*Je,I=j[8],O+=I*Ee,P+=I*He,R+=I*qe,M+=I*Ie,D+=I*Ne,$+=I*$e,X+=I*je,le+=I*K,H+=I*F,ee+=I*W,J+=I*ie,te+=I*pe,re+=I*we,z+=I*he,G+=I*Re,Q+=I*Je,I=j[9],P+=I*Ee,R+=I*He,M+=I*qe,D+=I*Ie,$+=I*Ne,X+=I*$e,le+=I*je,H+=I*K,ee+=I*F,J+=I*W,te+=I*ie,re+=I*pe,z+=I*we,G+=I*he,Q+=I*Re,me+=I*Je,I=j[10],R+=I*Ee,M+=I*He,D+=I*qe,$+=I*Ie,X+=I*Ne,le+=I*$e,H+=I*je,ee+=I*K,J+=I*F,te+=I*W,re+=I*ie,z+=I*pe,G+=I*we,Q+=I*he,me+=I*Re,be+=I*Je,I=j[11],M+=I*Ee,D+=I*He,$+=I*qe,X+=I*Ie,le+=I*Ne,H+=I*$e,ee+=I*je,J+=I*K,te+=I*F,re+=I*W,z+=I*ie,G+=I*pe,Q+=I*we,me+=I*he,be+=I*Re,Ce+=I*Je,I=j[12],D+=I*Ee,$+=I*He,X+=I*qe,le+=I*Ie,H+=I*Ne,ee+=I*$e,J+=I*je,te+=I*K,re+=I*F,z+=I*W,G+=I*ie,Q+=I*pe,me+=I*we,be+=I*he,Ce+=I*Re,Fe+=I*Je,I=j[13],$+=I*Ee,X+=I*He,le+=I*qe,H+=I*Ie,ee+=I*Ne,J+=I*$e,te+=I*je,re+=I*K,z+=I*F,G+=I*W,Q+=I*ie,me+=I*pe,be+=I*we,Ce+=I*he,Fe+=I*Re,Ue+=I*Je,I=j[14],X+=I*Ee,le+=I*He,H+=I*qe,ee+=I*Ie,J+=I*Ne,te+=I*$e,re+=I*je,z+=I*K,G+=I*F,Q+=I*W,me+=I*ie,be+=I*pe,Ce+=I*we,Fe+=I*he,Ue+=I*Re,Ke+=I*Je,I=j[15],le+=I*Ee,H+=I*He,ee+=I*qe,J+=I*Ie,te+=I*Ne,re+=I*$e,z+=I*je,G+=I*K,Q+=I*F,me+=I*W,be+=I*ie,Ce+=I*pe,Fe+=I*we,Ue+=I*he,Ke+=I*Re,lt+=I*Je,V+=38*H,se+=38*ee,Y+=38*J,N+=38*te,k+=38*re,x+=38*z,_+=38*G,L+=38*Q,O+=38*me,P+=38*be,R+=38*Ce,M+=38*Fe,D+=38*Ue,$+=38*Ke,X+=38*lt,B=1,I=V+B+65535,B=Math.floor(I/65536),V=I-B*65536,I=se+B+65535,B=Math.floor(I/65536),se=I-B*65536,I=Y+B+65535,B=Math.floor(I/65536),Y=I-B*65536,I=N+B+65535,B=Math.floor(I/65536),N=I-B*65536,I=k+B+65535,B=Math.floor(I/65536),k=I-B*65536,I=x+B+65535,B=Math.floor(I/65536),x=I-B*65536,I=_+B+65535,B=Math.floor(I/65536),_=I-B*65536,I=L+B+65535,B=Math.floor(I/65536),L=I-B*65536,I=O+B+65535,B=Math.floor(I/65536),O=I-B*65536,I=P+B+65535,B=Math.floor(I/65536),P=I-B*65536,I=R+B+65535,B=Math.floor(I/65536),R=I-B*65536,I=M+B+65535,B=Math.floor(I/65536),M=I-B*65536,I=D+B+65535,B=Math.floor(I/65536),D=I-B*65536,I=$+B+65535,B=Math.floor(I/65536),$=I-B*65536,I=X+B+65535,B=Math.floor(I/65536),X=I-B*65536,I=le+B+65535,B=Math.floor(I/65536),le=I-B*65536,V+=B-1+37*(B-1),B=1,I=V+B+65535,B=Math.floor(I/65536),V=I-B*65536,I=se+B+65535,B=Math.floor(I/65536),se=I-B*65536,I=Y+B+65535,B=Math.floor(I/65536),Y=I-B*65536,I=N+B+65535,B=Math.floor(I/65536),N=I-B*65536,I=k+B+65535,B=Math.floor(I/65536),k=I-B*65536,I=x+B+65535,B=Math.floor(I/65536),x=I-B*65536,I=_+B+65535,B=Math.floor(I/65536),_=I-B*65536,I=L+B+65535,B=Math.floor(I/65536),L=I-B*65536,I=O+B+65535,B=Math.floor(I/65536),O=I-B*65536,I=P+B+65535,B=Math.floor(I/65536),P=I-B*65536,I=R+B+65535,B=Math.floor(I/65536),R=I-B*65536,I=M+B+65535,B=Math.floor(I/65536),M=I-B*65536,I=D+B+65535,B=Math.floor(I/65536),D=I-B*65536,I=$+B+65535,B=Math.floor(I/65536),$=I-B*65536,I=X+B+65535,B=Math.floor(I/65536),X=I-B*65536,I=le+B+65535,B=Math.floor(I/65536),le=I-B*65536,V+=B-1+37*(B-1),S[0]=V,S[1]=se,S[2]=Y,S[3]=N,S[4]=k,S[5]=x,S[6]=_,S[7]=L,S[8]=O,S[9]=P,S[10]=R,S[11]=M,S[12]=D,S[13]=$,S[14]=X,S[15]=le}function g(S,j){h(S,j,j)}function m(S,j){const U=n();for(let I=0;I<16;I++)U[I]=j[I];for(let I=253;I>=0;I--)g(U,U),I!==2&&I!==4&&h(U,U,j);for(let I=0;I<16;I++)S[I]=U[I]}function w(S,j){const U=new Uint8Array(32),I=new Float64Array(80),B=n(),V=n(),se=n(),Y=n(),N=n(),k=n();for(let O=0;O<31;O++)U[O]=S[O];U[31]=S[31]&127|64,U[0]&=248,c(I,j);for(let O=0;O<16;O++)V[O]=I[O];B[0]=Y[0]=1;for(let O=254;O>=0;--O){const P=U[O>>>3]>>>(O&7)&1;o(B,V,P),o(se,Y,P),u(N,B,se),f(B,B,se),u(se,V,Y),f(V,V,Y),g(Y,N),g(k,B),h(B,se,B),h(se,V,N),u(N,B,se),f(B,B,se),g(V,B),f(se,Y,k),h(B,se,a),u(B,B,Y),h(se,se,B),h(B,Y,k),h(Y,V,I),g(V,N),o(B,V,P),o(se,Y,P)}for(let O=0;O<16;O++)I[O+16]=B[O],I[O+32]=se[O],I[O+48]=V[O],I[O+64]=Y[O];const x=I.subarray(32),_=I.subarray(16);m(x,x),h(_,_,x);const L=new Uint8Array(32);return l(L,_),L}t.scalarMult=w;function C(S){return w(S,i)}t.scalarMultBase=C;function v(S){if(S.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const j=new Uint8Array(S);return{publicKey:C(j),secretKey:j}}t.generateKeyPairFromSeed=v;function b(S){const j=(0,e.randomBytes)(32,S),U=v(j);return(0,r.wipe)(j),U}t.generateKeyPair=b;function A(S,j,U=!1){if(S.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(j.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const I=w(S,j);if(U){let B=0;for(let V=0;Vi+a.length,0));const r=nie(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function cUe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,S=new Uint8Array(A);v!==b;){for(var j=m[v],U=0,I=A-1;(j!==0||U>>0,S[I]=j%o>>>0,j=j/o>>>0;if(j!==0)throw new Error("Non-zero carry");C=U,v++}for(var B=A-C;B!==A&&S[B]===0;)B++;for(var V=l.repeat(w);B>>0,A=new Uint8Array(b);m[w];){var S=r[m.charCodeAt(w)];if(S===255)return;for(var j=0,U=b-1;(S!==0||j>>0,A[U]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");v=j,w++}if(m[w]!==" "){for(var I=b-v;I!==b&&A[I]===0;)I++;for(var B=new Uint8Array(C+(b-I)),V=C;I!==b;)B[V++]=A[I++];return B}}}function g(m){var w=h(m);if(w)return w;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:g}}var uUe=cUe,dUe=uUe;const fUe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},hUe=t=>new TextEncoder().encode(t),pUe=t=>new TextDecoder().decode(t);class gUe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class mUe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return iie(this,e)}}class yUe{constructor(e){this.decoders=e}or(e){return iie(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const iie=(t,e)=>new yUe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class wUe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new gUe(e,r,n),this.decoder=new mUe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Xx=({name:t,prefix:e,encode:r,decode:n})=>new wUe(t,e,r,n),pv=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=dUe(r,e);return Xx({prefix:t,name:e,encode:n,decode:a=>fUe(i(a))})},vUe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(o-=8,s[c++]=255&l>>o)}if(o>=r||255&l<<8-o)throw new SyntaxError("Unexpected end of data");return s},bUe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)s-=r,a+=e[i&o>>s];if(s&&(a+=e[i&o<Xx({prefix:e,name:t,encode(i){return bUe(i,n,r)},decode(i){return vUe(i,n,r,t)}}),xUe=Xx({prefix:"\0",name:"identity",encode:t=>pUe(t),decode:t=>hUe(t)}),EUe=Object.freeze(Object.defineProperty({__proto__:null,identity:xUe},Symbol.toStringTag,{value:"Module"})),_Ue=xa({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),CUe=Object.freeze(Object.defineProperty({__proto__:null,base2:_Ue},Symbol.toStringTag,{value:"Module"})),SUe=xa({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),AUe=Object.freeze(Object.defineProperty({__proto__:null,base8:SUe},Symbol.toStringTag,{value:"Module"})),IUe=pv({prefix:"9",name:"base10",alphabet:"0123456789"}),MUe=Object.freeze(Object.defineProperty({__proto__:null,base10:IUe},Symbol.toStringTag,{value:"Module"})),TUe=xa({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),kUe=xa({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),NUe=Object.freeze(Object.defineProperty({__proto__:null,base16:TUe,base16upper:kUe},Symbol.toStringTag,{value:"Module"})),LUe=xa({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),jUe=xa({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),$Ue=xa({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),PUe=xa({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),RUe=xa({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),DUe=xa({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),OUe=xa({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),FUe=xa({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),UUe=xa({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),BUe=Object.freeze(Object.defineProperty({__proto__:null,base32:LUe,base32hex:RUe,base32hexpad:OUe,base32hexpadupper:FUe,base32hexupper:DUe,base32pad:$Ue,base32padupper:PUe,base32upper:jUe,base32z:UUe},Symbol.toStringTag,{value:"Module"})),zUe=pv({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),WUe=pv({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),HUe=Object.freeze(Object.defineProperty({__proto__:null,base36:zUe,base36upper:WUe},Symbol.toStringTag,{value:"Module"})),GUe=pv({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),qUe=pv({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),VUe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:GUe,base58flickr:qUe},Symbol.toStringTag,{value:"Module"})),YUe=xa({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),KUe=xa({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),JUe=xa({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),QUe=xa({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),ZUe=Object.freeze(Object.defineProperty({__proto__:null,base64:YUe,base64pad:KUe,base64url:JUe,base64urlpad:QUe},Symbol.toStringTag,{value:"Module"})),aie=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),XUe=aie.reduce((t,e,r)=>(t[r]=e,t),[]),eBe=aie.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function tBe(t){return t.reduce((e,r)=>(e+=XUe[r],e),"")}function rBe(t){const e=[];for(const r of t){const n=eBe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const nBe=Xx({prefix:"🚀",name:"base256emoji",encode:tBe,decode:rBe}),iBe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:nBe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Xz={...EUe,...CUe,...AUe,...MUe,...NUe,...BUe,...HUe,...VUe,...ZUe,...iBe};function sie(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const eW=sie("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),SS=sie("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=nie(t.length);for(let r=0;r",pBe="MIT",gBe={url:"https://github.com/indutny/elliptic/issues"},mBe="https://github.com/indutny/elliptic",yBe={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},wBe={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},vBe={name:aBe,version:sBe,description:oBe,main:lBe,files:cBe,scripts:uBe,repository:dBe,keywords:fBe,author:hBe,license:pBe,bugs:gBe,homepage:mBe,devDependencies:yBe,dependencies:wBe};var Fo={},Cj={exports:{}};Cj.exports;(function(t){(function(e,r){function n(Y,N){if(!Y)throw new Error(N||"Assertion failed")}function i(Y,N){Y.super_=N;var k=function(){};k.prototype=N.prototype,Y.prototype=new k,Y.prototype.constructor=Y}function a(Y,N,k){if(a.isBN(Y))return Y;this.negative=0,this.words=null,this.length=0,this.red=null,Y!==null&&((N==="le"||N==="be")&&(k=N,N=10),this._init(Y||0,N||10,k||"be"))}typeof e=="object"?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=vm.Buffer}catch{}a.isBN=function(N){return N instanceof a?!0:N!==null&&typeof N=="object"&&N.constructor.wordSize===a.wordSize&&Array.isArray(N.words)},a.max=function(N,k){return N.cmp(k)>0?N:k},a.min=function(N,k){return N.cmp(k)<0?N:k},a.prototype._init=function(N,k,x){if(typeof N=="number")return this._initNumber(N,k,x);if(typeof N=="object")return this._initArray(N,k,x);k==="hex"&&(k=16),n(k===(k|0)&&k>=2&&k<=36),N=N.toString().replace(/\s+/g,"");var _=0;N[0]==="-"&&(_++,this.negative=1),_=0;_-=3)O=N[_]|N[_-1]<<8|N[_-2]<<16,this.words[L]|=O<>>26-P&67108863,P+=24,P>=26&&(P-=26,L++);else if(x==="le")for(_=0,L=0;_>>26-P&67108863,P+=24,P>=26&&(P-=26,L++);return this.strip()};function o(Y,N){var k=Y.charCodeAt(N);return k>=65&&k<=70?k-55:k>=97&&k<=102?k-87:k-48&15}function l(Y,N,k){var x=o(Y,k);return k-1>=N&&(x|=o(Y,k-1)<<4),x}a.prototype._parseHex=function(N,k,x){this.length=Math.ceil((N.length-k)/6),this.words=new Array(this.length);for(var _=0;_=k;_-=2)P=l(N,k,_)<=18?(L-=18,O+=1,this.words[O]|=P>>>26):L+=8;else{var R=N.length-k;for(_=R%2===0?k+1:k;_=18?(L-=18,O+=1,this.words[O]|=P>>>26):L+=8}this.strip()};function c(Y,N,k,x){for(var _=0,L=Math.min(Y.length,k),O=N;O=49?_+=P-49+10:P>=17?_+=P-17+10:_+=P}return _}a.prototype._parseBase=function(N,k,x){this.words=[0],this.length=1;for(var _=0,L=1;L<=67108863;L*=k)_++;_--,L=L/k|0;for(var O=N.length-x,P=O%_,R=Math.min(O,O-P)+x,M=0,D=x;D1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","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"],f=[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],h=[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];a.prototype.toString=function(N,k){N=N||10,k=k|0||1;var x;if(N===16||N==="hex"){x="";for(var _=0,L=0,O=0;O>>24-_&16777215,_+=2,_>=26&&(_-=26,O--),L!==0||O!==this.length-1?x=u[6-R.length]+R+x:x=R+x}for(L!==0&&(x=L.toString(16)+x);x.length%k!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(N===(N|0)&&N>=2&&N<=36){var M=f[N],D=h[N];x="";var $=this.clone();for($.negative=0;!$.isZero();){var X=$.modn(D).toString(N);$=$.idivn(D),$.isZero()?x=X+x:x=u[M-X.length]+X+x}for(this.isZero()&&(x="0"+x);x.length%k!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var N=this.words[0];return this.length===2?N+=this.words[1]*67108864:this.length===3&&this.words[2]===1?N+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-N:N},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(N,k){return n(typeof s<"u"),this.toArrayLike(s,N,k)},a.prototype.toArray=function(N,k){return this.toArrayLike(Array,N,k)},a.prototype.toArrayLike=function(N,k,x){var _=this.byteLength(),L=x||Math.max(1,_);n(_<=L,"byte array longer than desired length"),n(L>0,"Requested array length <= 0"),this.strip();var O=k==="le",P=new N(L),R,M,D=this.clone();if(O){for(M=0;!D.isZero();M++)R=D.andln(255),D.iushrn(8),P[M]=R;for(;M=4096&&(x+=13,k>>>=13),k>=64&&(x+=7,k>>>=7),k>=8&&(x+=4,k>>>=4),k>=2&&(x+=2,k>>>=2),x+k},a.prototype._zeroBits=function(N){if(N===0)return 26;var k=N,x=0;return k&8191||(x+=13,k>>>=13),k&127||(x+=7,k>>>=7),k&15||(x+=4,k>>>=4),k&3||(x+=2,k>>>=2),k&1||x++,x},a.prototype.bitLength=function(){var N=this.words[this.length-1],k=this._countBits(N);return(this.length-1)*26+k};function g(Y){for(var N=new Array(Y.bitLength()),k=0;k>>_}return N}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var N=0,k=0;kN.length?this.clone().ior(N):N.clone().ior(this)},a.prototype.uor=function(N){return this.length>N.length?this.clone().iuor(N):N.clone().iuor(this)},a.prototype.iuand=function(N){var k;this.length>N.length?k=N:k=this;for(var x=0;xN.length?this.clone().iand(N):N.clone().iand(this)},a.prototype.uand=function(N){return this.length>N.length?this.clone().iuand(N):N.clone().iuand(this)},a.prototype.iuxor=function(N){var k,x;this.length>N.length?(k=this,x=N):(k=N,x=this);for(var _=0;_N.length?this.clone().ixor(N):N.clone().ixor(this)},a.prototype.uxor=function(N){return this.length>N.length?this.clone().iuxor(N):N.clone().iuxor(this)},a.prototype.inotn=function(N){n(typeof N=="number"&&N>=0);var k=Math.ceil(N/26)|0,x=N%26;this._expand(k),x>0&&k--;for(var _=0;_0&&(this.words[_]=~this.words[_]&67108863>>26-x),this.strip()},a.prototype.notn=function(N){return this.clone().inotn(N)},a.prototype.setn=function(N,k){n(typeof N=="number"&&N>=0);var x=N/26|0,_=N%26;return this._expand(x+1),k?this.words[x]=this.words[x]|1<<_:this.words[x]=this.words[x]&~(1<<_),this.strip()},a.prototype.iadd=function(N){var k;if(this.negative!==0&&N.negative===0)return this.negative=0,k=this.isub(N),this.negative^=1,this._normSign();if(this.negative===0&&N.negative!==0)return N.negative=0,k=this.isub(N),N.negative=1,k._normSign();var x,_;this.length>N.length?(x=this,_=N):(x=N,_=this);for(var L=0,O=0;O<_.length;O++)k=(x.words[O]|0)+(_.words[O]|0)+L,this.words[O]=k&67108863,L=k>>>26;for(;L!==0&&O>>26;if(this.length=x.length,L!==0)this.words[this.length]=L,this.length++;else if(x!==this)for(;ON.length?this.clone().iadd(N):N.clone().iadd(this)},a.prototype.isub=function(N){if(N.negative!==0){N.negative=0;var k=this.iadd(N);return N.negative=1,k._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(N),this.negative=1,this._normSign();var x=this.cmp(N);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,L;x>0?(_=this,L=N):(_=N,L=this);for(var O=0,P=0;P>26,this.words[P]=k&67108863;for(;O!==0&&P<_.length;P++)k=(_.words[P]|0)+O,O=k>>26,this.words[P]=k&67108863;if(O===0&&P<_.length&&_!==this)for(;P<_.length;P++)this.words[P]=_.words[P];return this.length=Math.max(this.length,P),_!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(N){return this.clone().isub(N)};function m(Y,N,k){k.negative=N.negative^Y.negative;var x=Y.length+N.length|0;k.length=x,x=x-1|0;var _=Y.words[0]|0,L=N.words[0]|0,O=_*L,P=O&67108863,R=O/67108864|0;k.words[0]=P;for(var M=1;M>>26,$=R&67108863,X=Math.min(M,N.length-1),le=Math.max(0,M-Y.length+1);le<=X;le++){var H=M-le|0;_=Y.words[H]|0,L=N.words[le]|0,O=_*L+$,D+=O/67108864|0,$=O&67108863}k.words[M]=$|0,R=D|0}return R!==0?k.words[M]=R|0:k.length--,k.strip()}var w=function(N,k,x){var _=N.words,L=k.words,O=x.words,P=0,R,M,D,$=_[0]|0,X=$&8191,le=$>>>13,H=_[1]|0,ee=H&8191,J=H>>>13,te=_[2]|0,re=te&8191,z=te>>>13,G=_[3]|0,Q=G&8191,me=G>>>13,be=_[4]|0,Ce=be&8191,Fe=be>>>13,Ue=_[5]|0,Ke=Ue&8191,lt=Ue>>>13,Ee=_[6]|0,He=Ee&8191,qe=Ee>>>13,Ie=_[7]|0,Ne=Ie&8191,$e=Ie>>>13,je=_[8]|0,K=je&8191,F=je>>>13,W=_[9]|0,ie=W&8191,pe=W>>>13,we=L[0]|0,he=we&8191,Re=we>>>13,Je=L[1]|0,et=Je&8191,it=Je>>>13,ut=L[2]|0,pt=ut&8191,tr=ut>>>13,zt=L[3]|0,At=zt&8191,mt=zt>>>13,St=L[4]|0,dt=St&8191,Nt=St>>>13,Rt=L[5]|0,gt=Rt&8191,qt=Rt>>>13,Wt=L[6]|0,ot=Wt&8191,Vt=Wt>>>13,Ft=L[7]|0,yt=Ft&8191,Ze=Ft>>>13,Pt=L[8]|0,xt=Pt&8191,Jt=Pt>>>13,Cr=L[9]|0,Gt=Cr&8191,Sr=Cr>>>13;x.negative=N.negative^k.negative,x.length=19,R=Math.imul(X,he),M=Math.imul(X,Re),M=M+Math.imul(le,he)|0,D=Math.imul(le,Re);var cr=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(cr>>>26)|0,cr&=67108863,R=Math.imul(ee,he),M=Math.imul(ee,Re),M=M+Math.imul(J,he)|0,D=Math.imul(J,Re),R=R+Math.imul(X,et)|0,M=M+Math.imul(X,it)|0,M=M+Math.imul(le,et)|0,D=D+Math.imul(le,it)|0;var br=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(br>>>26)|0,br&=67108863,R=Math.imul(re,he),M=Math.imul(re,Re),M=M+Math.imul(z,he)|0,D=Math.imul(z,Re),R=R+Math.imul(ee,et)|0,M=M+Math.imul(ee,it)|0,M=M+Math.imul(J,et)|0,D=D+Math.imul(J,it)|0,R=R+Math.imul(X,pt)|0,M=M+Math.imul(X,tr)|0,M=M+Math.imul(le,pt)|0,D=D+Math.imul(le,tr)|0;var Z=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Z>>>26)|0,Z&=67108863,R=Math.imul(Q,he),M=Math.imul(Q,Re),M=M+Math.imul(me,he)|0,D=Math.imul(me,Re),R=R+Math.imul(re,et)|0,M=M+Math.imul(re,it)|0,M=M+Math.imul(z,et)|0,D=D+Math.imul(z,it)|0,R=R+Math.imul(ee,pt)|0,M=M+Math.imul(ee,tr)|0,M=M+Math.imul(J,pt)|0,D=D+Math.imul(J,tr)|0,R=R+Math.imul(X,At)|0,M=M+Math.imul(X,mt)|0,M=M+Math.imul(le,At)|0,D=D+Math.imul(le,mt)|0;var ae=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ae>>>26)|0,ae&=67108863,R=Math.imul(Ce,he),M=Math.imul(Ce,Re),M=M+Math.imul(Fe,he)|0,D=Math.imul(Fe,Re),R=R+Math.imul(Q,et)|0,M=M+Math.imul(Q,it)|0,M=M+Math.imul(me,et)|0,D=D+Math.imul(me,it)|0,R=R+Math.imul(re,pt)|0,M=M+Math.imul(re,tr)|0,M=M+Math.imul(z,pt)|0,D=D+Math.imul(z,tr)|0,R=R+Math.imul(ee,At)|0,M=M+Math.imul(ee,mt)|0,M=M+Math.imul(J,At)|0,D=D+Math.imul(J,mt)|0,R=R+Math.imul(X,dt)|0,M=M+Math.imul(X,Nt)|0,M=M+Math.imul(le,dt)|0,D=D+Math.imul(le,Nt)|0;var de=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(de>>>26)|0,de&=67108863,R=Math.imul(Ke,he),M=Math.imul(Ke,Re),M=M+Math.imul(lt,he)|0,D=Math.imul(lt,Re),R=R+Math.imul(Ce,et)|0,M=M+Math.imul(Ce,it)|0,M=M+Math.imul(Fe,et)|0,D=D+Math.imul(Fe,it)|0,R=R+Math.imul(Q,pt)|0,M=M+Math.imul(Q,tr)|0,M=M+Math.imul(me,pt)|0,D=D+Math.imul(me,tr)|0,R=R+Math.imul(re,At)|0,M=M+Math.imul(re,mt)|0,M=M+Math.imul(z,At)|0,D=D+Math.imul(z,mt)|0,R=R+Math.imul(ee,dt)|0,M=M+Math.imul(ee,Nt)|0,M=M+Math.imul(J,dt)|0,D=D+Math.imul(J,Nt)|0,R=R+Math.imul(X,gt)|0,M=M+Math.imul(X,qt)|0,M=M+Math.imul(le,gt)|0,D=D+Math.imul(le,qt)|0;var ue=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ue>>>26)|0,ue&=67108863,R=Math.imul(He,he),M=Math.imul(He,Re),M=M+Math.imul(qe,he)|0,D=Math.imul(qe,Re),R=R+Math.imul(Ke,et)|0,M=M+Math.imul(Ke,it)|0,M=M+Math.imul(lt,et)|0,D=D+Math.imul(lt,it)|0,R=R+Math.imul(Ce,pt)|0,M=M+Math.imul(Ce,tr)|0,M=M+Math.imul(Fe,pt)|0,D=D+Math.imul(Fe,tr)|0,R=R+Math.imul(Q,At)|0,M=M+Math.imul(Q,mt)|0,M=M+Math.imul(me,At)|0,D=D+Math.imul(me,mt)|0,R=R+Math.imul(re,dt)|0,M=M+Math.imul(re,Nt)|0,M=M+Math.imul(z,dt)|0,D=D+Math.imul(z,Nt)|0,R=R+Math.imul(ee,gt)|0,M=M+Math.imul(ee,qt)|0,M=M+Math.imul(J,gt)|0,D=D+Math.imul(J,qt)|0,R=R+Math.imul(X,ot)|0,M=M+Math.imul(X,Vt)|0,M=M+Math.imul(le,ot)|0,D=D+Math.imul(le,Vt)|0;var ve=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ve>>>26)|0,ve&=67108863,R=Math.imul(Ne,he),M=Math.imul(Ne,Re),M=M+Math.imul($e,he)|0,D=Math.imul($e,Re),R=R+Math.imul(He,et)|0,M=M+Math.imul(He,it)|0,M=M+Math.imul(qe,et)|0,D=D+Math.imul(qe,it)|0,R=R+Math.imul(Ke,pt)|0,M=M+Math.imul(Ke,tr)|0,M=M+Math.imul(lt,pt)|0,D=D+Math.imul(lt,tr)|0,R=R+Math.imul(Ce,At)|0,M=M+Math.imul(Ce,mt)|0,M=M+Math.imul(Fe,At)|0,D=D+Math.imul(Fe,mt)|0,R=R+Math.imul(Q,dt)|0,M=M+Math.imul(Q,Nt)|0,M=M+Math.imul(me,dt)|0,D=D+Math.imul(me,Nt)|0,R=R+Math.imul(re,gt)|0,M=M+Math.imul(re,qt)|0,M=M+Math.imul(z,gt)|0,D=D+Math.imul(z,qt)|0,R=R+Math.imul(ee,ot)|0,M=M+Math.imul(ee,Vt)|0,M=M+Math.imul(J,ot)|0,D=D+Math.imul(J,Vt)|0,R=R+Math.imul(X,yt)|0,M=M+Math.imul(X,Ze)|0,M=M+Math.imul(le,yt)|0,D=D+Math.imul(le,Ze)|0;var Le=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Le>>>26)|0,Le&=67108863,R=Math.imul(K,he),M=Math.imul(K,Re),M=M+Math.imul(F,he)|0,D=Math.imul(F,Re),R=R+Math.imul(Ne,et)|0,M=M+Math.imul(Ne,it)|0,M=M+Math.imul($e,et)|0,D=D+Math.imul($e,it)|0,R=R+Math.imul(He,pt)|0,M=M+Math.imul(He,tr)|0,M=M+Math.imul(qe,pt)|0,D=D+Math.imul(qe,tr)|0,R=R+Math.imul(Ke,At)|0,M=M+Math.imul(Ke,mt)|0,M=M+Math.imul(lt,At)|0,D=D+Math.imul(lt,mt)|0,R=R+Math.imul(Ce,dt)|0,M=M+Math.imul(Ce,Nt)|0,M=M+Math.imul(Fe,dt)|0,D=D+Math.imul(Fe,Nt)|0,R=R+Math.imul(Q,gt)|0,M=M+Math.imul(Q,qt)|0,M=M+Math.imul(me,gt)|0,D=D+Math.imul(me,qt)|0,R=R+Math.imul(re,ot)|0,M=M+Math.imul(re,Vt)|0,M=M+Math.imul(z,ot)|0,D=D+Math.imul(z,Vt)|0,R=R+Math.imul(ee,yt)|0,M=M+Math.imul(ee,Ze)|0,M=M+Math.imul(J,yt)|0,D=D+Math.imul(J,Ze)|0,R=R+Math.imul(X,xt)|0,M=M+Math.imul(X,Jt)|0,M=M+Math.imul(le,xt)|0,D=D+Math.imul(le,Jt)|0;var Ge=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,R=Math.imul(ie,he),M=Math.imul(ie,Re),M=M+Math.imul(pe,he)|0,D=Math.imul(pe,Re),R=R+Math.imul(K,et)|0,M=M+Math.imul(K,it)|0,M=M+Math.imul(F,et)|0,D=D+Math.imul(F,it)|0,R=R+Math.imul(Ne,pt)|0,M=M+Math.imul(Ne,tr)|0,M=M+Math.imul($e,pt)|0,D=D+Math.imul($e,tr)|0,R=R+Math.imul(He,At)|0,M=M+Math.imul(He,mt)|0,M=M+Math.imul(qe,At)|0,D=D+Math.imul(qe,mt)|0,R=R+Math.imul(Ke,dt)|0,M=M+Math.imul(Ke,Nt)|0,M=M+Math.imul(lt,dt)|0,D=D+Math.imul(lt,Nt)|0,R=R+Math.imul(Ce,gt)|0,M=M+Math.imul(Ce,qt)|0,M=M+Math.imul(Fe,gt)|0,D=D+Math.imul(Fe,qt)|0,R=R+Math.imul(Q,ot)|0,M=M+Math.imul(Q,Vt)|0,M=M+Math.imul(me,ot)|0,D=D+Math.imul(me,Vt)|0,R=R+Math.imul(re,yt)|0,M=M+Math.imul(re,Ze)|0,M=M+Math.imul(z,yt)|0,D=D+Math.imul(z,Ze)|0,R=R+Math.imul(ee,xt)|0,M=M+Math.imul(ee,Jt)|0,M=M+Math.imul(J,xt)|0,D=D+Math.imul(J,Jt)|0,R=R+Math.imul(X,Gt)|0,M=M+Math.imul(X,Sr)|0,M=M+Math.imul(le,Gt)|0,D=D+Math.imul(le,Sr)|0;var Be=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Be>>>26)|0,Be&=67108863,R=Math.imul(ie,et),M=Math.imul(ie,it),M=M+Math.imul(pe,et)|0,D=Math.imul(pe,it),R=R+Math.imul(K,pt)|0,M=M+Math.imul(K,tr)|0,M=M+Math.imul(F,pt)|0,D=D+Math.imul(F,tr)|0,R=R+Math.imul(Ne,At)|0,M=M+Math.imul(Ne,mt)|0,M=M+Math.imul($e,At)|0,D=D+Math.imul($e,mt)|0,R=R+Math.imul(He,dt)|0,M=M+Math.imul(He,Nt)|0,M=M+Math.imul(qe,dt)|0,D=D+Math.imul(qe,Nt)|0,R=R+Math.imul(Ke,gt)|0,M=M+Math.imul(Ke,qt)|0,M=M+Math.imul(lt,gt)|0,D=D+Math.imul(lt,qt)|0,R=R+Math.imul(Ce,ot)|0,M=M+Math.imul(Ce,Vt)|0,M=M+Math.imul(Fe,ot)|0,D=D+Math.imul(Fe,Vt)|0,R=R+Math.imul(Q,yt)|0,M=M+Math.imul(Q,Ze)|0,M=M+Math.imul(me,yt)|0,D=D+Math.imul(me,Ze)|0,R=R+Math.imul(re,xt)|0,M=M+Math.imul(re,Jt)|0,M=M+Math.imul(z,xt)|0,D=D+Math.imul(z,Jt)|0,R=R+Math.imul(ee,Gt)|0,M=M+Math.imul(ee,Sr)|0,M=M+Math.imul(J,Gt)|0,D=D+Math.imul(J,Sr)|0;var tt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(tt>>>26)|0,tt&=67108863,R=Math.imul(ie,pt),M=Math.imul(ie,tr),M=M+Math.imul(pe,pt)|0,D=Math.imul(pe,tr),R=R+Math.imul(K,At)|0,M=M+Math.imul(K,mt)|0,M=M+Math.imul(F,At)|0,D=D+Math.imul(F,mt)|0,R=R+Math.imul(Ne,dt)|0,M=M+Math.imul(Ne,Nt)|0,M=M+Math.imul($e,dt)|0,D=D+Math.imul($e,Nt)|0,R=R+Math.imul(He,gt)|0,M=M+Math.imul(He,qt)|0,M=M+Math.imul(qe,gt)|0,D=D+Math.imul(qe,qt)|0,R=R+Math.imul(Ke,ot)|0,M=M+Math.imul(Ke,Vt)|0,M=M+Math.imul(lt,ot)|0,D=D+Math.imul(lt,Vt)|0,R=R+Math.imul(Ce,yt)|0,M=M+Math.imul(Ce,Ze)|0,M=M+Math.imul(Fe,yt)|0,D=D+Math.imul(Fe,Ze)|0,R=R+Math.imul(Q,xt)|0,M=M+Math.imul(Q,Jt)|0,M=M+Math.imul(me,xt)|0,D=D+Math.imul(me,Jt)|0,R=R+Math.imul(re,Gt)|0,M=M+Math.imul(re,Sr)|0,M=M+Math.imul(z,Gt)|0,D=D+Math.imul(z,Sr)|0;var vt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(vt>>>26)|0,vt&=67108863,R=Math.imul(ie,At),M=Math.imul(ie,mt),M=M+Math.imul(pe,At)|0,D=Math.imul(pe,mt),R=R+Math.imul(K,dt)|0,M=M+Math.imul(K,Nt)|0,M=M+Math.imul(F,dt)|0,D=D+Math.imul(F,Nt)|0,R=R+Math.imul(Ne,gt)|0,M=M+Math.imul(Ne,qt)|0,M=M+Math.imul($e,gt)|0,D=D+Math.imul($e,qt)|0,R=R+Math.imul(He,ot)|0,M=M+Math.imul(He,Vt)|0,M=M+Math.imul(qe,ot)|0,D=D+Math.imul(qe,Vt)|0,R=R+Math.imul(Ke,yt)|0,M=M+Math.imul(Ke,Ze)|0,M=M+Math.imul(lt,yt)|0,D=D+Math.imul(lt,Ze)|0,R=R+Math.imul(Ce,xt)|0,M=M+Math.imul(Ce,Jt)|0,M=M+Math.imul(Fe,xt)|0,D=D+Math.imul(Fe,Jt)|0,R=R+Math.imul(Q,Gt)|0,M=M+Math.imul(Q,Sr)|0,M=M+Math.imul(me,Gt)|0,D=D+Math.imul(me,Sr)|0;var Lt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,R=Math.imul(ie,dt),M=Math.imul(ie,Nt),M=M+Math.imul(pe,dt)|0,D=Math.imul(pe,Nt),R=R+Math.imul(K,gt)|0,M=M+Math.imul(K,qt)|0,M=M+Math.imul(F,gt)|0,D=D+Math.imul(F,qt)|0,R=R+Math.imul(Ne,ot)|0,M=M+Math.imul(Ne,Vt)|0,M=M+Math.imul($e,ot)|0,D=D+Math.imul($e,Vt)|0,R=R+Math.imul(He,yt)|0,M=M+Math.imul(He,Ze)|0,M=M+Math.imul(qe,yt)|0,D=D+Math.imul(qe,Ze)|0,R=R+Math.imul(Ke,xt)|0,M=M+Math.imul(Ke,Jt)|0,M=M+Math.imul(lt,xt)|0,D=D+Math.imul(lt,Jt)|0,R=R+Math.imul(Ce,Gt)|0,M=M+Math.imul(Ce,Sr)|0,M=M+Math.imul(Fe,Gt)|0,D=D+Math.imul(Fe,Sr)|0;var Ct=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,R=Math.imul(ie,gt),M=Math.imul(ie,qt),M=M+Math.imul(pe,gt)|0,D=Math.imul(pe,qt),R=R+Math.imul(K,ot)|0,M=M+Math.imul(K,Vt)|0,M=M+Math.imul(F,ot)|0,D=D+Math.imul(F,Vt)|0,R=R+Math.imul(Ne,yt)|0,M=M+Math.imul(Ne,Ze)|0,M=M+Math.imul($e,yt)|0,D=D+Math.imul($e,Ze)|0,R=R+Math.imul(He,xt)|0,M=M+Math.imul(He,Jt)|0,M=M+Math.imul(qe,xt)|0,D=D+Math.imul(qe,Jt)|0,R=R+Math.imul(Ke,Gt)|0,M=M+Math.imul(Ke,Sr)|0,M=M+Math.imul(lt,Gt)|0,D=D+Math.imul(lt,Sr)|0;var ir=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ir>>>26)|0,ir&=67108863,R=Math.imul(ie,ot),M=Math.imul(ie,Vt),M=M+Math.imul(pe,ot)|0,D=Math.imul(pe,Vt),R=R+Math.imul(K,yt)|0,M=M+Math.imul(K,Ze)|0,M=M+Math.imul(F,yt)|0,D=D+Math.imul(F,Ze)|0,R=R+Math.imul(Ne,xt)|0,M=M+Math.imul(Ne,Jt)|0,M=M+Math.imul($e,xt)|0,D=D+Math.imul($e,Jt)|0,R=R+Math.imul(He,Gt)|0,M=M+Math.imul(He,Sr)|0,M=M+Math.imul(qe,Gt)|0,D=D+Math.imul(qe,Sr)|0;var Zt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,R=Math.imul(ie,yt),M=Math.imul(ie,Ze),M=M+Math.imul(pe,yt)|0,D=Math.imul(pe,Ze),R=R+Math.imul(K,xt)|0,M=M+Math.imul(K,Jt)|0,M=M+Math.imul(F,xt)|0,D=D+Math.imul(F,Jt)|0,R=R+Math.imul(Ne,Gt)|0,M=M+Math.imul(Ne,Sr)|0,M=M+Math.imul($e,Gt)|0,D=D+Math.imul($e,Sr)|0;var sn=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(sn>>>26)|0,sn&=67108863,R=Math.imul(ie,xt),M=Math.imul(ie,Jt),M=M+Math.imul(pe,xt)|0,D=Math.imul(pe,Jt),R=R+Math.imul(K,Gt)|0,M=M+Math.imul(K,Sr)|0,M=M+Math.imul(F,Gt)|0,D=D+Math.imul(F,Sr)|0;var Rr=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,R=Math.imul(ie,Gt),M=Math.imul(ie,Sr),M=M+Math.imul(pe,Gt)|0,D=Math.imul(pe,Sr);var dn=(P+R|0)+((M&8191)<<13)|0;return P=(D+(M>>>13)|0)+(dn>>>26)|0,dn&=67108863,O[0]=cr,O[1]=br,O[2]=Z,O[3]=ae,O[4]=de,O[5]=ue,O[6]=ve,O[7]=Le,O[8]=Ge,O[9]=Be,O[10]=tt,O[11]=vt,O[12]=Lt,O[13]=Ct,O[14]=ir,O[15]=Zt,O[16]=sn,O[17]=Rr,O[18]=dn,P!==0&&(O[19]=P,x.length++),x};Math.imul||(w=m);function C(Y,N,k){k.negative=N.negative^Y.negative,k.length=Y.length+N.length;for(var x=0,_=0,L=0;L>>26)|0,_+=O>>>26,O&=67108863}k.words[L]=P,x=O,O=_}return x!==0?k.words[L]=x:k.length--,k.strip()}function v(Y,N,k){var x=new b;return x.mulp(Y,N,k)}a.prototype.mulTo=function(N,k){var x,_=this.length+N.length;return this.length===10&&N.length===10?x=w(this,N,k):_<63?x=m(this,N,k):_<1024?x=C(this,N,k):x=v(this,N,k),x};function b(Y,N){this.x=Y,this.y=N}b.prototype.makeRBT=function(N){for(var k=new Array(N),x=a.prototype._countBits(N)-1,_=0;_>=1;return _},b.prototype.permute=function(N,k,x,_,L,O){for(var P=0;P>>1)L++;return 1<>>13,x[2*O+1]=L&8191,L=L>>>13;for(O=2*k;O<_;++O)x[O]=0;n(L===0),n((L&-8192)===0)},b.prototype.stub=function(N){for(var k=new Array(N),x=0;x>=26,k+=_/67108864|0,k+=L>>>26,this.words[x]=L&67108863}return k!==0&&(this.words[x]=k,this.length++),this},a.prototype.muln=function(N){return this.clone().imuln(N)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(N){var k=g(N);if(k.length===0)return new a(1);for(var x=this,_=0;_=0);var k=N%26,x=(N-k)/26,_=67108863>>>26-k<<26-k,L;if(k!==0){var O=0;for(L=0;L>>26-k}O&&(this.words[L]=O,this.length++)}if(x!==0){for(L=this.length-1;L>=0;L--)this.words[L+x]=this.words[L];for(L=0;L=0);var _;k?_=(k-k%26)/26:_=0;var L=N%26,O=Math.min((N-L)/26,this.length),P=67108863^67108863>>>L<O)for(this.length-=O,M=0;M=0&&(D!==0||M>=_);M--){var $=this.words[M]|0;this.words[M]=D<<26-L|$>>>L,D=$&P}return R&&D!==0&&(R.words[R.length++]=D),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(N,k,x){return n(this.negative===0),this.iushrn(N,k,x)},a.prototype.shln=function(N){return this.clone().ishln(N)},a.prototype.ushln=function(N){return this.clone().iushln(N)},a.prototype.shrn=function(N){return this.clone().ishrn(N)},a.prototype.ushrn=function(N){return this.clone().iushrn(N)},a.prototype.testn=function(N){n(typeof N=="number"&&N>=0);var k=N%26,x=(N-k)/26,_=1<=0);var k=N%26,x=(N-k)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(k!==0&&x++,this.length=Math.min(x,this.length),k!==0){var _=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},a.prototype.isubn=function(N){if(n(typeof N=="number"),n(N<67108864),N<0)return this.iaddn(-N);if(this.negative!==0)return this.negative=0,this.iaddn(N),this.negative=1,this;if(this.words[0]-=N,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var k=0;k>26)-(R/67108864|0),this.words[L+x]=O&67108863}for(;L>26,this.words[L+x]=O&67108863;if(P===0)return this.strip();for(n(P===-1),P=0,L=0;L>26,this.words[L]=O&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(N,k){var x=this.length-N.length,_=this.clone(),L=N,O=L.words[L.length-1]|0,P=this._countBits(O);x=26-P,x!==0&&(L=L.ushln(x),_.iushln(x),O=L.words[L.length-1]|0);var R=_.length-L.length,M;if(k!=="mod"){M=new a(null),M.length=R+1,M.words=new Array(M.length);for(var D=0;D=0;X--){var le=(_.words[L.length+X]|0)*67108864+(_.words[L.length+X-1]|0);for(le=Math.min(le/O|0,67108863),_._ishlnsubmul(L,le,X);_.negative!==0;)le--,_.negative=0,_._ishlnsubmul(L,1,X),_.isZero()||(_.negative^=1);M&&(M.words[X]=le)}return M&&M.strip(),_.strip(),k!=="div"&&x!==0&&_.iushrn(x),{div:M||null,mod:_}},a.prototype.divmod=function(N,k,x){if(n(!N.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var _,L,O;return this.negative!==0&&N.negative===0?(O=this.neg().divmod(N,k),k!=="mod"&&(_=O.div.neg()),k!=="div"&&(L=O.mod.neg(),x&&L.negative!==0&&L.iadd(N)),{div:_,mod:L}):this.negative===0&&N.negative!==0?(O=this.divmod(N.neg(),k),k!=="mod"&&(_=O.div.neg()),{div:_,mod:O.mod}):this.negative&N.negative?(O=this.neg().divmod(N.neg(),k),k!=="div"&&(L=O.mod.neg(),x&&L.negative!==0&&L.isub(N)),{div:O.div,mod:L}):N.length>this.length||this.cmp(N)<0?{div:new a(0),mod:this}:N.length===1?k==="div"?{div:this.divn(N.words[0]),mod:null}:k==="mod"?{div:null,mod:new a(this.modn(N.words[0]))}:{div:this.divn(N.words[0]),mod:new a(this.modn(N.words[0]))}:this._wordDiv(N,k)},a.prototype.div=function(N){return this.divmod(N,"div",!1).div},a.prototype.mod=function(N){return this.divmod(N,"mod",!1).mod},a.prototype.umod=function(N){return this.divmod(N,"mod",!0).mod},a.prototype.divRound=function(N){var k=this.divmod(N);if(k.mod.isZero())return k.div;var x=k.div.negative!==0?k.mod.isub(N):k.mod,_=N.ushrn(1),L=N.andln(1),O=x.cmp(_);return O<0||L===1&&O===0?k.div:k.div.negative!==0?k.div.isubn(1):k.div.iaddn(1)},a.prototype.modn=function(N){n(N<=67108863);for(var k=(1<<26)%N,x=0,_=this.length-1;_>=0;_--)x=(k*x+(this.words[_]|0))%N;return x},a.prototype.idivn=function(N){n(N<=67108863);for(var k=0,x=this.length-1;x>=0;x--){var _=(this.words[x]|0)+k*67108864;this.words[x]=_/N|0,k=_%N}return this.strip()},a.prototype.divn=function(N){return this.clone().idivn(N)},a.prototype.egcd=function(N){n(N.negative===0),n(!N.isZero());var k=this,x=N.clone();k.negative!==0?k=k.umod(N):k=k.clone();for(var _=new a(1),L=new a(0),O=new a(0),P=new a(1),R=0;k.isEven()&&x.isEven();)k.iushrn(1),x.iushrn(1),++R;for(var M=x.clone(),D=k.clone();!k.isZero();){for(var $=0,X=1;!(k.words[0]&X)&&$<26;++$,X<<=1);if($>0)for(k.iushrn($);$-- >0;)(_.isOdd()||L.isOdd())&&(_.iadd(M),L.isub(D)),_.iushrn(1),L.iushrn(1);for(var le=0,H=1;!(x.words[0]&H)&&le<26;++le,H<<=1);if(le>0)for(x.iushrn(le);le-- >0;)(O.isOdd()||P.isOdd())&&(O.iadd(M),P.isub(D)),O.iushrn(1),P.iushrn(1);k.cmp(x)>=0?(k.isub(x),_.isub(O),L.isub(P)):(x.isub(k),O.isub(_),P.isub(L))}return{a:O,b:P,gcd:x.iushln(R)}},a.prototype._invmp=function(N){n(N.negative===0),n(!N.isZero());var k=this,x=N.clone();k.negative!==0?k=k.umod(N):k=k.clone();for(var _=new a(1),L=new a(0),O=x.clone();k.cmpn(1)>0&&x.cmpn(1)>0;){for(var P=0,R=1;!(k.words[0]&R)&&P<26;++P,R<<=1);if(P>0)for(k.iushrn(P);P-- >0;)_.isOdd()&&_.iadd(O),_.iushrn(1);for(var M=0,D=1;!(x.words[0]&D)&&M<26;++M,D<<=1);if(M>0)for(x.iushrn(M);M-- >0;)L.isOdd()&&L.iadd(O),L.iushrn(1);k.cmp(x)>=0?(k.isub(x),_.isub(L)):(x.isub(k),L.isub(_))}var $;return k.cmpn(1)===0?$=_:$=L,$.cmpn(0)<0&&$.iadd(N),$},a.prototype.gcd=function(N){if(this.isZero())return N.abs();if(N.isZero())return this.abs();var k=this.clone(),x=N.clone();k.negative=0,x.negative=0;for(var _=0;k.isEven()&&x.isEven();_++)k.iushrn(1),x.iushrn(1);do{for(;k.isEven();)k.iushrn(1);for(;x.isEven();)x.iushrn(1);var L=k.cmp(x);if(L<0){var O=k;k=x,x=O}else if(L===0||x.cmpn(1)===0)break;k.isub(x)}while(!0);return x.iushln(_)},a.prototype.invm=function(N){return this.egcd(N).a.umod(N)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(N){return this.words[0]&N},a.prototype.bincn=function(N){n(typeof N=="number");var k=N%26,x=(N-k)/26,_=1<>>26,P&=67108863,this.words[O]=P}return L!==0&&(this.words[O]=L,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(N){var k=N<0;if(this.negative!==0&&!k)return-1;if(this.negative===0&&k)return 1;this.strip();var x;if(this.length>1)x=1;else{k&&(N=-N),n(N<=67108863,"Number is too big");var _=this.words[0]|0;x=_===N?0:_N.length)return 1;if(this.length=0;x--){var _=this.words[x]|0,L=N.words[x]|0;if(_!==L){_L&&(k=1);break}}return k},a.prototype.gtn=function(N){return this.cmpn(N)===1},a.prototype.gt=function(N){return this.cmp(N)===1},a.prototype.gten=function(N){return this.cmpn(N)>=0},a.prototype.gte=function(N){return this.cmp(N)>=0},a.prototype.ltn=function(N){return this.cmpn(N)===-1},a.prototype.lt=function(N){return this.cmp(N)===-1},a.prototype.lten=function(N){return this.cmpn(N)<=0},a.prototype.lte=function(N){return this.cmp(N)<=0},a.prototype.eqn=function(N){return this.cmpn(N)===0},a.prototype.eq=function(N){return this.cmp(N)===0},a.red=function(N){return new V(N)},a.prototype.toRed=function(N){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),N.convertTo(this)._forceRed(N)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(N){return this.red=N,this},a.prototype.forceRed=function(N){return n(!this.red,"Already a number in reduction context"),this._forceRed(N)},a.prototype.redAdd=function(N){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,N)},a.prototype.redIAdd=function(N){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,N)},a.prototype.redSub=function(N){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,N)},a.prototype.redISub=function(N){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,N)},a.prototype.redShl=function(N){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,N)},a.prototype.redMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.mul(this,N)},a.prototype.redIMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.imul(this,N)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(N){return n(this.red&&!N.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,N)};var A={k256:null,p224:null,p192:null,p25519:null};function S(Y,N){this.name=Y,this.p=new a(N,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}S.prototype._tmp=function(){var N=new a(null);return N.words=new Array(Math.ceil(this.n/13)),N},S.prototype.ireduce=function(N){var k=N,x;do this.split(k,this.tmp),k=this.imulK(k),k=k.iadd(this.tmp),x=k.bitLength();while(x>this.n);var _=x0?k.isub(this.p):k.strip!==void 0?k.strip():k._strip(),k},S.prototype.split=function(N,k){N.iushrn(this.n,0,k)},S.prototype.imulK=function(N){return N.imul(this.k)};function j(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,S),j.prototype.split=function(N,k){for(var x=4194303,_=Math.min(N.length,9),L=0;L<_;L++)k.words[L]=N.words[L];if(k.length=_,N.length<=9){N.words[0]=0,N.length=1;return}var O=N.words[9];for(k.words[k.length++]=O&x,L=10;L>>22,O=P}O>>>=22,N.words[L-10]=O,O===0&&N.length>10?N.length-=10:N.length-=9},j.prototype.imulK=function(N){N.words[N.length]=0,N.words[N.length+1]=0,N.length+=2;for(var k=0,x=0;x>>=26,N.words[x]=L,k=_}return k!==0&&(N.words[N.length++]=k),N},a._prime=function(N){if(A[N])return A[N];var k;if(N==="k256")k=new j;else if(N==="p224")k=new U;else if(N==="p192")k=new I;else if(N==="p25519")k=new B;else throw new Error("Unknown prime "+N);return A[N]=k,k};function V(Y){if(typeof Y=="string"){var N=a._prime(Y);this.m=N.p,this.prime=N}else n(Y.gtn(1),"modulus must be greater than 1"),this.m=Y,this.prime=null}V.prototype._verify1=function(N){n(N.negative===0,"red works only with positives"),n(N.red,"red works only with red numbers")},V.prototype._verify2=function(N,k){n((N.negative|k.negative)===0,"red works only with positives"),n(N.red&&N.red===k.red,"red works only with red numbers")},V.prototype.imod=function(N){return this.prime?this.prime.ireduce(N)._forceRed(this):N.umod(this.m)._forceRed(this)},V.prototype.neg=function(N){return N.isZero()?N.clone():this.m.sub(N)._forceRed(this)},V.prototype.add=function(N,k){this._verify2(N,k);var x=N.add(k);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},V.prototype.iadd=function(N,k){this._verify2(N,k);var x=N.iadd(k);return x.cmp(this.m)>=0&&x.isub(this.m),x},V.prototype.sub=function(N,k){this._verify2(N,k);var x=N.sub(k);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},V.prototype.isub=function(N,k){this._verify2(N,k);var x=N.isub(k);return x.cmpn(0)<0&&x.iadd(this.m),x},V.prototype.shl=function(N,k){return this._verify1(N),this.imod(N.ushln(k))},V.prototype.imul=function(N,k){return this._verify2(N,k),this.imod(N.imul(k))},V.prototype.mul=function(N,k){return this._verify2(N,k),this.imod(N.mul(k))},V.prototype.isqr=function(N){return this.imul(N,N.clone())},V.prototype.sqr=function(N){return this.mul(N,N)},V.prototype.sqrt=function(N){if(N.isZero())return N.clone();var k=this.m.andln(3);if(n(k%2===1),k===3){var x=this.m.add(new a(1)).iushrn(2);return this.pow(N,x)}for(var _=this.m.subn(1),L=0;!_.isZero()&&_.andln(1)===0;)L++,_.iushrn(1);n(!_.isZero());var O=new a(1).toRed(this),P=O.redNeg(),R=this.m.subn(1).iushrn(1),M=this.m.bitLength();for(M=new a(2*M*M).toRed(this);this.pow(M,R).cmp(P)!==0;)M.redIAdd(P);for(var D=this.pow(M,_),$=this.pow(N,_.addn(1).iushrn(1)),X=this.pow(N,_),le=L;X.cmp(O)!==0;){for(var H=X,ee=0;H.cmp(O)!==0;ee++)H=H.redSqr();n(ee=0;L--){for(var D=k.words[L],$=M-1;$>=0;$--){var X=D>>$&1;if(O!==_[0]&&(O=this.sqr(O)),X===0&&P===0){R=0;continue}P<<=1,P|=X,R++,!(R!==x&&(L!==0||$!==0))&&(O=this.mul(O,_[P]),R=0,P=0)}M=26}return O},V.prototype.convertTo=function(N){var k=N.umod(this.m);return k===N?k.clone():k},V.prototype.convertFrom=function(N){var k=N.clone();return k.red=null,k},a.mont=function(N){return new se(N)};function se(Y){V.call(this,Y),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(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(se,V),se.prototype.convertTo=function(N){return this.imod(N.ushln(this.shift))},se.prototype.convertFrom=function(N){var k=this.imod(N.mul(this.rinv));return k.red=null,k},se.prototype.imul=function(N,k){if(N.isZero()||k.isZero())return N.words[0]=0,N.length=1,N;var x=N.imul(k),_=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),L=x.isub(_).iushrn(this.shift),O=L;return L.cmp(this.m)>=0?O=L.isub(this.m):L.cmpn(0)<0&&(O=L.iadd(this.m)),O._forceRed(this)},se.prototype.mul=function(N,k){if(N.isZero()||k.isZero())return new a(0)._forceRed(this);var x=N.mul(k),_=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),L=x.isub(_).iushrn(this.shift),O=L;return L.cmp(this.m)>=0?O=L.isub(this.m):L.cmpn(0)<0&&(O=L.iadd(this.m)),O._forceRed(this)},se.prototype.invm=function(N){var k=this.imod(N._invmp(this.m).mul(this.r2));return k._forceRed(this)}})(t,Xt)})(Cj);var af=Cj.exports,Sj={};(function(t){var e=t;function r(a,s){if(Array.isArray(a))return a.slice();if(!a)return[];var o=[];if(typeof a!="string"){for(var l=0;l>8,f=c&255;u?o.push(u,f):o.push(f)}return o}e.toArray=r;function n(a){return a.length===1?"0"+a:a}e.zero2=n;function i(a){for(var s="",o=0;o(w>>1)-1?v=(w>>1)-b:v=b,C.isubn(v)):v=0,g[m]=v,C.iushrn(1)}return g}e.getNAF=a;function s(u,f){var h=[[],[]];u=u.clone(),f=f.clone();for(var g=0,m=0,w;u.cmpn(-g)>0||f.cmpn(-m)>0;){var C=u.andln(3)+g&3,v=f.andln(3)+m&3;C===3&&(C=-1),v===3&&(v=-1);var b;C&1?(w=u.andln(7)+g&7,(w===3||w===5)&&v===2?b=-C:b=C):b=0,h[0].push(b);var A;v&1?(w=f.andln(7)+m&7,(w===3||w===5)&&C===2?A=-v:A=v):A=0,h[1].push(A),2*g===b+1&&(g=1-g),2*m===A+1&&(m=1-m),u.iushrn(1),f.iushrn(1)}return h}e.getJSF=s;function o(u,f,h){var g="_"+f;u.prototype[f]=function(){return this[g]!==void 0?this[g]:this[g]=h.call(this)}}e.cachedProperty=o;function l(u){return typeof u=="string"?e.toArray(u,"hex"):u}e.parseBytes=l;function c(u){return new r(u,"hex","le")}e.intFromLE=c})(Fo);var Aj={exports:{}},AS;Aj.exports=function(e){return AS||(AS=new Uf(null)),AS.generate(e)};function Uf(t){this.rand=t}Aj.exports.Rand=Uf;Uf.prototype.generate=function(e){return this._rand(e)};Uf.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var e7=Nh;Nh.prototype.point=function(){throw new Error("Not implemented")};Nh.prototype.validate=function(){throw new Error("Not implemented")};Nh.prototype._fixedNafMul=function(e,r){g8(e.precomputed);var n=e._getDoubles(),i=p8(r,1,this._bitLength),a=(1<=o;c--)l=(l<<1)+i[c];s.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=a;h>0;h--){for(o=0;o=0;l--){for(var c=0;l>=0&&s[l]===0;l--)c++;if(l>=0&&c++,o=o.dblp(c),l<0)break;var u=s[l];g8(u!==0),e.type==="affine"?u>0?o=o.mixedAdd(a[u-1>>1]):o=o.mixedAdd(a[-u-1>>1].neg()):u>0?o=o.add(a[u-1>>1]):o=o.add(a[-u-1>>1].neg())}return e.type==="affine"?o.toP():o};Nh.prototype._wnafMulAdd=function(e,r,n,i,a){var s=this._wnafT1,o=this._wnafT2,l=this._wnafT3,c=0,u,f,h;for(u=0;u=1;u-=2){var m=u-1,w=u;if(s[m]!==1||s[w]!==1){l[m]=p8(n[m],s[m],this._bitLength),l[w]=p8(n[w],s[w],this._bitLength),c=Math.max(l[m].length,c),c=Math.max(l[w].length,c);continue}var C=[r[m],null,null,r[w]];r[m].y.cmp(r[w].y)===0?(C[1]=r[m].add(r[w]),C[2]=r[m].toJ().mixedAdd(r[w].neg())):r[m].y.cmp(r[w].y.redNeg())===0?(C[1]=r[m].toJ().mixedAdd(r[w]),C[2]=r[m].add(r[w].neg())):(C[1]=r[m].toJ().mixedAdd(r[w]),C[2]=r[m].toJ().mixedAdd(r[w].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=bBe(n[m],n[w]);for(c=Math.max(b[0].length,c),l[m]=new Array(c),l[w]=new Array(c),f=0;f=0;u--){for(var I=0;u>=0;){var B=!0;for(f=0;f=0&&I++,j=j.dblp(I),u<0)break;for(f=0;f0?h=o[f][V-1>>1]:V<0&&(h=o[f][-V-1>>1].neg()),h.type==="affine"?j=j.mixedAdd(h):j=j.add(h))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};Ml.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a=0&&(g=c,m=u),f.negative&&(f=f.neg(),h=h.neg()),g.negative&&(g=g.neg(),m=m.neg()),[{a:f,b:h},{a:g,b:m}]};Tl.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),s=n.b.neg().mul(e).divRound(this.n),o=a.mul(n.a),l=s.mul(i.a),c=a.mul(n.b),u=s.mul(i.b),f=e.sub(o).sub(l),h=c.add(u).neg();return{k1:f,k2:h}};Tl.prototype.pointFromX=function(e,r){e=new si(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 a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)};Tl.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0};Tl.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,s=0;s":""};da.prototype.isInfinity=function(){return this.inf};da.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)};da.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(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),s=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)};da.prototype.getX=function(){return this.x.fromRed()};da.prototype.getY=function(){return this.y.fromRed()};da.prototype.mul=function(e){return e=new si(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)};da.prototype.mulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)};da.prototype.jmulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)};da.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)};da.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(a){return a.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};da.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 Ea(t,e,r,n){zm.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new si(0)):(this.x=new si(e,16),this.y=new si(r,16),this.z=new si(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}Mj(Ea,zm.BasePoint);Tl.prototype.jpoint=function(e,r,n){return new Ea(this,e,r,n)};Ea.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)};Ea.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Ea.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),a=e.x.redMul(n),s=this.y.redMul(r.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),l=i.redSub(a),c=s.redSub(o);if(l.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=l.redSqr(),f=u.redMul(l),h=i.redMul(u),g=c.redSqr().redIAdd(f).redISub(h).redISub(h),m=c.redMul(h.redISub(g)).redISub(s.redMul(f)),w=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,m,w)};Ea.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),a=this.y,s=e.y.redMul(r).redMul(this.z),o=n.redSub(i),l=a.redSub(s);if(o.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=n.redMul(c),h=l.redSqr().redIAdd(u).redISub(f).redISub(f),g=l.redMul(f.redISub(h)).redISub(a.redMul(u)),m=this.z.redMul(o);return this.curve.jpoint(h,g,m)};Ea.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(a),this.x.cmp(n)===0)return!0}};Ea.prototype.inspect=function(){return this.isInfinity()?"":""};Ea.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var ng=af,uie=gs,t7=e7,CBe=Fo;function Wm(t){t7.call(this,"mont",t),this.a=new ng(t.a,16).toRed(this.red),this.b=new ng(t.b,16).toRed(this.red),this.i4=new ng(4).toRed(this.red).redInvm(),this.two=new ng(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}uie(Wm,t7);var SBe=Wm;Wm.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),a=i.redSqrt();return a.redSqr().cmp(i)===0};function ca(t,e,r){t7.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new ng(e,16),this.z=new ng(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}uie(ca,t7.BasePoint);Wm.prototype.decodePoint=function(e,r){return this.point(CBe.toArray(e,r),1)};Wm.prototype.point=function(e,r){return new ca(this,e,r)};Wm.prototype.pointFromJSON=function(e){return ca.fromJSON(this,e)};ca.prototype.precompute=function(){};ca.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};ca.fromJSON=function(e,r){return new ca(e,r[0],r[1]||e.one)};ca.prototype.inspect=function(){return this.isInfinity()?"":""};ca.prototype.isInfinity=function(){return this.z.cmpn(0)===0};ca.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),a=r.redSub(i),s=r.redMul(i),o=a.redMul(i.redAdd(this.curve.a24.redMul(a)));return this.curve.point(s,o)};ca.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};ca.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),a=e.x.redAdd(e.z),s=e.x.redSub(e.z),o=s.redMul(n),l=a.redMul(i),c=r.z.redMul(o.redAdd(l).redSqr()),u=r.x.redMul(o.redISub(l).redSqr());return this.curve.point(c,u)};ca.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),a=this,s=[];r.cmpn(0)!==0;r.iushrn(1))s.push(r.andln(1));for(var o=s.length-1;o>=0;o--)s[o]===0?(n=n.diffAdd(i,a),i=i.dbl()):(i=n.diffAdd(i,a),n=n.dbl());return i};ca.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};ca.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};ca.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};ca.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};ca.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var ABe=Fo,Md=af,die=gs,r7=e7,IBe=ABe.assert;function Du(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,r7.call(this,"edwards",t),this.a=new Md(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Md(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Md(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),IBe(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}die(Du,r7);var MBe=Du;Du.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Du.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Du.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};Du.prototype.pointFromX=function(e,r){e=new Md(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),a=this.one.redSub(this.c2.redMul(this.d).redMul(n)),s=i.redMul(a.redInvm()),o=s.redSqrt();if(o.redSqr().redSub(s).cmp(this.zero)!==0)throw new Error("invalid point");var l=o.fromRed().isOdd();return(r&&!l||!r&&l)&&(o=o.redNeg()),this.point(e,o)};Du.prototype.pointFromY=function(e,r){e=new Md(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),a=n.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(a.redInvm());if(s.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var o=s.redSqrt();if(o.redSqr().redSub(s).cmp(this.zero)!==0)throw new Error("invalid point");return o.fromRed().isOdd()!==r&&(o=o.redNeg()),this.point(o,e)};Du.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),a=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(a)===0};function kn(t,e,r,n,i){r7.BasePoint.call(this,t,"projective"),e===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Md(e,16),this.y=new Md(r,16),this.z=n?new Md(n,16):this.curve.one,this.t=i&&new Md(i,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}die(kn,r7.BasePoint);Du.prototype.pointFromJSON=function(e){return kn.fromJSON(this,e)};Du.prototype.point=function(e,r,n,i){return new kn(this,e,r,n,i)};kn.fromJSON=function(e,r){return new kn(e,r[0],r[1],r[2])};kn.prototype.inspect=function(){return this.isInfinity()?"":""};kn.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};kn.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),s=i.redAdd(r),o=s.redSub(n),l=i.redSub(r),c=a.redMul(o),u=s.redMul(l),f=a.redMul(l),h=o.redMul(s);return this.curve.point(c,u,h,f)};kn.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,a,s,o,l,c;if(this.curve.twisted){o=this.curve._mulA(r);var u=o.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(u.redSub(this.curve.two)),a=u.redMul(o.redSub(n)),s=u.redSqr().redSub(u).redSub(u)):(l=this.z.redSqr(),c=u.redSub(l).redISub(l),i=e.redSub(r).redISub(n).redMul(c),a=u.redMul(o.redSub(n)),s=u.redMul(c))}else o=r.redAdd(n),l=this.curve._mulC(this.z).redSqr(),c=o.redSub(l).redSub(l),i=this.curve._mulC(e.redISub(o)).redMul(c),a=this.curve._mulC(o).redMul(r.redISub(n)),s=o.redMul(c);return this.curve.point(i,a,s)};kn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};kn.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),s=n.redSub(r),o=a.redSub(i),l=a.redAdd(i),c=n.redAdd(r),u=s.redMul(o),f=l.redMul(c),h=s.redMul(c),g=o.redMul(l);return this.curve.point(u,f,g,h)};kn.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(i).redMul(a),o=n.redSub(s),l=n.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),u=r.redMul(o).redMul(c),f,h;return this.curve.twisted?(f=r.redMul(l).redMul(a.redSub(this.curve._mulA(i))),h=o.redMul(l)):(f=r.redMul(l).redMul(a.redSub(i)),h=this.curve._mulC(o).redMul(l)),this.curve.point(u,f,h)};kn.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};kn.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};kn.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};kn.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};kn.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};kn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};kn.prototype.getX=function(){return this.normalize(),this.x.fromRed()};kn.prototype.getY=function(){return this.normalize(),this.y.fromRed()};kn.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};kn.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};kn.prototype.toP=kn.prototype.normalize;kn.prototype.mixedAdd=kn.prototype.add;(function(t){var e=t;e.base=e7,e.short=_Be,e.mont=SBe,e.edwards=MBe})(Ij);var n7={},IS,rW;function TBe(){return rW||(rW=1,IS={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),IS}(function(t){var e=t,r=M3,n=Ij,i=Fo,a=i.assert;function s(c){c.type==="short"?this.curve=new n.short(c):c.type==="edwards"?this.curve=new n.edwards(c):this.curve=new n.mont(c),this.g=this.curve.g,this.n=this.curve.n,this.hash=c.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=s;function o(c,u){Object.defineProperty(e,c,{configurable:!0,enumerable:!0,get:function(){var f=new s(u);return Object.defineProperty(e,c,{configurable:!0,enumerable:!0,value:f}),f}})}o("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:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("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:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("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:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("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:r.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"]}),o("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:r.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"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),o("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:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var l;try{l=TBe()}catch{l=void 0}o("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:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",l]})})(n7);var kBe=M3,R0=Sj,fie=w1;function fh(t){if(!(this instanceof fh))return new fh(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=R0.toArray(t.entropy,t.entropyEnc||"hex"),r=R0.toArray(t.nonce,t.nonceEnc||"hex"),n=R0.toArray(t.pers,t.persEnc||"hex");fie(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var NBe=fh;fh.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 a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};fh.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=R0.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length"};var m8=af,Tj=Fo,PBe=Tj.assert;function i7(t,e){if(t instanceof i7)return t;this._importDER(t,e)||(PBe(t.r&&t.s,"Signature without r or s"),this.r=new m8(t.r,16),this.s=new m8(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var RBe=i7;function DBe(){this.place=0}function MS(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var i=0,a=0,s=e.place;a>>=0;return i<=127?!1:(e.place=s,i)}function nW(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)}i7.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=nW(r),n=nW(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];TS(i,r.length),i=i.concat(r),i.push(2),TS(i,n.length);var a=i.concat(n),s=[48];return TS(s,a.length),s=s.concat(a),Tj.encode(s,e)};var lc=af,hie=NBe,OBe=Fo,kS=n7,FBe=cie,g0=OBe.assert,kj=$Be,a7=RBe;function El(t){if(!(this instanceof El))return new El(t);typeof t=="string"&&(g0(Object.prototype.hasOwnProperty.call(kS,t),"Unknown curve "+t),t=kS[t]),t instanceof kS.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 UBe=El;El.prototype.keyPair=function(e){return new kj(this,e)};El.prototype.keyFromPrivate=function(e,r){return kj.fromPrivate(this,e,r)};El.prototype.keyFromPublic=function(e,r){return kj.fromPublic(this,e,r)};El.prototype.genKeyPair=function(e){e||(e={});for(var r=new hie({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||FBe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new lc(2));;){var a=new lc(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}};El.prototype._truncateToN=function(e,r,n){var i;if(lc.isBN(e)||typeof e=="number")e=new lc(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new lc(e,16);else{var a=e.toString();i=a.length+1>>>1,e=new lc(a,16)}typeof n!="number"&&(n=i*8);var s=n-this.n.bitLength();return s>0&&(e=e.ushrn(s)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};El.prototype.sign=function(e,r,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!lc.isBN(e)){g0(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),g0(e.length>>>0===e.length);for(var a=0;a=0)){var g=this.g.mul(h);if(!g.isInfinity()){var m=g.getX(),w=m.umod(this.n);if(w.cmpn(0)!==0){var C=h.invm(this.n).mul(w.mul(r.getPrivate()).iadd(e));if(C=C.umod(this.n),C.cmpn(0)!==0){var v=(g.getY().isOdd()?1:0)|(m.cmp(w)!==0?2:0);return i.canonical&&C.cmp(this.nh)>0&&(C=this.n.sub(C),v^=1),new a7({r:w,s:C,recoveryParam:v})}}}}}};El.prototype.verify=function(e,r,n,i,a){a||(a={}),e=this._truncateToN(e,!1,a.msgBitLength),n=this.keyFromPublic(n,i),r=new a7(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 l=o.invm(this.n),c=l.mul(e).umod(this.n),u=l.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};El.prototype.recoverPubKey=function(t,e,r,n){g0((3&r)===r,"The recovery param is more than two bits"),e=new a7(e,n);var i=this.n,a=new lc(t),s=e.r,o=e.s,l=r&1,c=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?s=this.curve.pointFromX(s.add(this.curve.n),l):s=this.curve.pointFromX(s,l);var u=e.r.invm(i),f=i.sub(a).mul(u).umod(i),h=o.mul(u).umod(i);return this.g.mulAdd(f,s,h)};El.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new a7(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var mv=Fo,pie=mv.assert,iW=mv.parseBytes,Hm=mv.cachedProperty;function sa(t,e){this.eddsa=t,this._secret=iW(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=iW(e.pub)}sa.fromPublic=function(e,r){return r instanceof sa?r:new sa(e,{pub:r})};sa.fromSecret=function(e,r){return r instanceof sa?r:new sa(e,{secret:r})};sa.prototype.secret=function(){return this._secret};Hm(sa,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Hm(sa,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Hm(sa,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});Hm(sa,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Hm(sa,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Hm(sa,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});sa.prototype.sign=function(e){return pie(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};sa.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};sa.prototype.getSecret=function(e){return pie(this._secret,"KeyPair is public only"),mv.encode(this.secret(),e)};sa.prototype.getPublic=function(e){return mv.encode(this.pubBytes(),e)};var BBe=sa,zBe=af,s7=Fo,aW=s7.assert,o7=s7.cachedProperty,WBe=s7.parseBytes;function L1(t,e){this.eddsa=t,typeof e!="object"&&(e=WBe(e)),Array.isArray(e)&&(aW(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),aW(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof zBe&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o7(L1,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});o7(L1,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});o7(L1,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});o7(L1,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});L1.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};L1.prototype.toHex=function(){return s7.encode(this.toBytes(),"hex").toUpperCase()};var HBe=L1,GBe=M3,qBe=n7,tm=Fo,VBe=tm.assert,gie=tm.parseBytes,mie=BBe,sW=HBe;function Qs(t){if(VBe(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Qs))return new Qs(t);t=qBe[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=GBe.sha512}var YBe=Qs;Qs.prototype.sign=function(e,r){e=gie(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),a=this.g.mul(i),s=this.encodePoint(a),o=this.hashInt(s,n.pubBytes(),e).mul(n.priv()),l=i.add(o).umod(this.curve.n);return this.makeSignature({R:a,S:l,Rencoded:s})};Qs.prototype.verify=function(e,r,n){if(e=gie(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var i=this.keyFromPublic(n),a=this.hashInt(r.Rencoded(),i.pubBytes(),e),s=this.g.mul(r.S()),o=r.R().add(i.pub().mul(a));return o.eq(s)};Qs.prototype.hashInt=function(){for(var e=this.hash(),r=0;r0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=l[u++],c--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,l,u,c),c%=this.blockSize);c>0;)this._buffer[this._bufferLength++]=l[u++],c--;return this},o.prototype.finish=function(l){if(!this._finished){var c=this._bytesHashed,u=this._bufferLength,f=c/536870912|0,h=c<<3,g=c%128<112?128:256;this._buffer[u]=128;for(var m=u+1;m0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},o.prototype.restoreState=function(l){return this._stateHi.set(l.stateHi),this._stateLo.set(l.stateLo),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},o.prototype.cleanSavedState=function(l){r.wipe(l.stateHi),r.wipe(l.stateLo),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},o}();t.SHA512=n;var i=new Int32Array([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]);function a(o,l,c,u,f,h,g){for(var m=c[0],w=c[1],C=c[2],v=c[3],b=c[4],A=c[5],S=c[6],j=c[7],U=u[0],I=u[1],B=u[2],V=u[3],se=u[4],Y=u[5],N=u[6],k=u[7],x,_,L,O,P,R,M,D;g>=128;){for(var $=0;$<16;$++){var X=8*$+h;o[$]=e.readUint32BE(f,X),l[$]=e.readUint32BE(f,X+4)}for(var $=0;$<80;$++){var le=m,H=w,ee=C,J=v,te=b,re=A,z=S,G=j,Q=U,me=I,be=B,Ce=V,Fe=se,Ue=Y,Ke=N,lt=k;if(x=j,_=k,P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=(b>>>14|se<<18)^(b>>>18|se<<14)^(se>>>9|b<<23),_=(se>>>14|b<<18)^(se>>>18|b<<14)^(b>>>9|se<<23),P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,x=b&A^~b&S,_=se&Y^~se&N,P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,x=i[$*2],_=i[$*2+1],P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,x=o[$%16],_=l[$%16],P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,L=M&65535|D<<16,O=P&65535|R<<16,x=L,_=O,P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=(m>>>28|U<<4)^(U>>>2|m<<30)^(U>>>7|m<<25),_=(U>>>28|m<<4)^(m>>>2|U<<30)^(m>>>7|U<<25),P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,x=m&w^m&C^w&C,_=U&I^U&B^I&B,P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,G=M&65535|D<<16,lt=P&65535|R<<16,x=J,_=Ce,P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=L,_=O,P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,J=M&65535|D<<16,Ce=P&65535|R<<16,w=le,C=H,v=ee,b=J,A=te,S=re,j=z,m=G,I=Q,B=me,V=be,se=Ce,Y=Fe,N=Ue,k=Ke,U=lt,$%16===15)for(var X=0;X<16;X++)x=o[X],_=l[X],P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=o[(X+9)%16],_=l[(X+9)%16],P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,L=o[(X+1)%16],O=l[(X+1)%16],x=(L>>>1|O<<31)^(L>>>8|O<<24)^L>>>7,_=(O>>>1|L<<31)^(O>>>8|L<<24)^(O>>>7|L<<25),P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,L=o[(X+14)%16],O=l[(X+14)%16],x=(L>>>19|O<<13)^(O>>>29|L<<3)^L>>>6,_=(O>>>19|L<<13)^(L>>>29|O<<3)^(O>>>6|L<<26),P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,o[X]=M&65535|D<<16,l[X]=P&65535|R<<16}x=m,_=U,P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=c[0],_=u[0],P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[0]=m=M&65535|D<<16,u[0]=U=P&65535|R<<16,x=w,_=I,P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=c[1],_=u[1],P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[1]=w=M&65535|D<<16,u[1]=I=P&65535|R<<16,x=C,_=B,P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=c[2],_=u[2],P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[2]=C=M&65535|D<<16,u[2]=B=P&65535|R<<16,x=v,_=V,P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=c[3],_=u[3],P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[3]=v=M&65535|D<<16,u[3]=V=P&65535|R<<16,x=b,_=se,P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=c[4],_=u[4],P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[4]=b=M&65535|D<<16,u[4]=se=P&65535|R<<16,x=A,_=Y,P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=c[5],_=u[5],P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[5]=A=M&65535|D<<16,u[5]=Y=P&65535|R<<16,x=S,_=N,P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=c[6],_=u[6],P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[6]=S=M&65535|D<<16,u[6]=N=P&65535|R<<16,x=j,_=k,P=_&65535,R=_>>>16,M=x&65535,D=x>>>16,x=c[7],_=u[7],P+=_&65535,R+=_>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[7]=j=M&65535|D<<16,u[7]=k=P&65535|R<<16,h+=128,g-=128}return h}function s(o){var l=new n;l.update(o);var c=l.digest();return l.clean(),c}t.hash=s})(yie);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=kh,r=yie,n=Oo;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(J){const te=new Float64Array(16);if(J)for(let re=0;re>16&1),re[me-1]&=65535;re[15]=z[15]-32767-(re[14]>>16&1);const Q=re[15]>>16&1;re[14]&=65535,w(z,re,1-Q)}for(let G=0;G<16;G++)J[2*G]=z[G]&255,J[2*G+1]=z[G]>>8}function v(J,te){let re=0;for(let z=0;z<32;z++)re|=J[z]^te[z];return(1&re-1>>>8)-1}function b(J,te){const re=new Uint8Array(32),z=new Uint8Array(32);return C(re,J),C(z,te),v(re,z)}function A(J){const te=new Uint8Array(32);return C(te,J),te[0]&1}function S(J,te){for(let re=0;re<16;re++)J[re]=te[2*re]+(te[2*re+1]<<8);J[15]&=32767}function j(J,te,re){for(let z=0;z<16;z++)J[z]=te[z]+re[z]}function U(J,te,re){for(let z=0;z<16;z++)J[z]=te[z]-re[z]}function I(J,te,re){let z,G,Q=0,me=0,be=0,Ce=0,Fe=0,Ue=0,Ke=0,lt=0,Ee=0,He=0,qe=0,Ie=0,Ne=0,$e=0,je=0,K=0,F=0,W=0,ie=0,pe=0,we=0,he=0,Re=0,Je=0,et=0,it=0,ut=0,pt=0,tr=0,zt=0,At=0,mt=re[0],St=re[1],dt=re[2],Nt=re[3],Rt=re[4],gt=re[5],qt=re[6],Wt=re[7],ot=re[8],Vt=re[9],Ft=re[10],yt=re[11],Ze=re[12],Pt=re[13],xt=re[14],Jt=re[15];z=te[0],Q+=z*mt,me+=z*St,be+=z*dt,Ce+=z*Nt,Fe+=z*Rt,Ue+=z*gt,Ke+=z*qt,lt+=z*Wt,Ee+=z*ot,He+=z*Vt,qe+=z*Ft,Ie+=z*yt,Ne+=z*Ze,$e+=z*Pt,je+=z*xt,K+=z*Jt,z=te[1],me+=z*mt,be+=z*St,Ce+=z*dt,Fe+=z*Nt,Ue+=z*Rt,Ke+=z*gt,lt+=z*qt,Ee+=z*Wt,He+=z*ot,qe+=z*Vt,Ie+=z*Ft,Ne+=z*yt,$e+=z*Ze,je+=z*Pt,K+=z*xt,F+=z*Jt,z=te[2],be+=z*mt,Ce+=z*St,Fe+=z*dt,Ue+=z*Nt,Ke+=z*Rt,lt+=z*gt,Ee+=z*qt,He+=z*Wt,qe+=z*ot,Ie+=z*Vt,Ne+=z*Ft,$e+=z*yt,je+=z*Ze,K+=z*Pt,F+=z*xt,W+=z*Jt,z=te[3],Ce+=z*mt,Fe+=z*St,Ue+=z*dt,Ke+=z*Nt,lt+=z*Rt,Ee+=z*gt,He+=z*qt,qe+=z*Wt,Ie+=z*ot,Ne+=z*Vt,$e+=z*Ft,je+=z*yt,K+=z*Ze,F+=z*Pt,W+=z*xt,ie+=z*Jt,z=te[4],Fe+=z*mt,Ue+=z*St,Ke+=z*dt,lt+=z*Nt,Ee+=z*Rt,He+=z*gt,qe+=z*qt,Ie+=z*Wt,Ne+=z*ot,$e+=z*Vt,je+=z*Ft,K+=z*yt,F+=z*Ze,W+=z*Pt,ie+=z*xt,pe+=z*Jt,z=te[5],Ue+=z*mt,Ke+=z*St,lt+=z*dt,Ee+=z*Nt,He+=z*Rt,qe+=z*gt,Ie+=z*qt,Ne+=z*Wt,$e+=z*ot,je+=z*Vt,K+=z*Ft,F+=z*yt,W+=z*Ze,ie+=z*Pt,pe+=z*xt,we+=z*Jt,z=te[6],Ke+=z*mt,lt+=z*St,Ee+=z*dt,He+=z*Nt,qe+=z*Rt,Ie+=z*gt,Ne+=z*qt,$e+=z*Wt,je+=z*ot,K+=z*Vt,F+=z*Ft,W+=z*yt,ie+=z*Ze,pe+=z*Pt,we+=z*xt,he+=z*Jt,z=te[7],lt+=z*mt,Ee+=z*St,He+=z*dt,qe+=z*Nt,Ie+=z*Rt,Ne+=z*gt,$e+=z*qt,je+=z*Wt,K+=z*ot,F+=z*Vt,W+=z*Ft,ie+=z*yt,pe+=z*Ze,we+=z*Pt,he+=z*xt,Re+=z*Jt,z=te[8],Ee+=z*mt,He+=z*St,qe+=z*dt,Ie+=z*Nt,Ne+=z*Rt,$e+=z*gt,je+=z*qt,K+=z*Wt,F+=z*ot,W+=z*Vt,ie+=z*Ft,pe+=z*yt,we+=z*Ze,he+=z*Pt,Re+=z*xt,Je+=z*Jt,z=te[9],He+=z*mt,qe+=z*St,Ie+=z*dt,Ne+=z*Nt,$e+=z*Rt,je+=z*gt,K+=z*qt,F+=z*Wt,W+=z*ot,ie+=z*Vt,pe+=z*Ft,we+=z*yt,he+=z*Ze,Re+=z*Pt,Je+=z*xt,et+=z*Jt,z=te[10],qe+=z*mt,Ie+=z*St,Ne+=z*dt,$e+=z*Nt,je+=z*Rt,K+=z*gt,F+=z*qt,W+=z*Wt,ie+=z*ot,pe+=z*Vt,we+=z*Ft,he+=z*yt,Re+=z*Ze,Je+=z*Pt,et+=z*xt,it+=z*Jt,z=te[11],Ie+=z*mt,Ne+=z*St,$e+=z*dt,je+=z*Nt,K+=z*Rt,F+=z*gt,W+=z*qt,ie+=z*Wt,pe+=z*ot,we+=z*Vt,he+=z*Ft,Re+=z*yt,Je+=z*Ze,et+=z*Pt,it+=z*xt,ut+=z*Jt,z=te[12],Ne+=z*mt,$e+=z*St,je+=z*dt,K+=z*Nt,F+=z*Rt,W+=z*gt,ie+=z*qt,pe+=z*Wt,we+=z*ot,he+=z*Vt,Re+=z*Ft,Je+=z*yt,et+=z*Ze,it+=z*Pt,ut+=z*xt,pt+=z*Jt,z=te[13],$e+=z*mt,je+=z*St,K+=z*dt,F+=z*Nt,W+=z*Rt,ie+=z*gt,pe+=z*qt,we+=z*Wt,he+=z*ot,Re+=z*Vt,Je+=z*Ft,et+=z*yt,it+=z*Ze,ut+=z*Pt,pt+=z*xt,tr+=z*Jt,z=te[14],je+=z*mt,K+=z*St,F+=z*dt,W+=z*Nt,ie+=z*Rt,pe+=z*gt,we+=z*qt,he+=z*Wt,Re+=z*ot,Je+=z*Vt,et+=z*Ft,it+=z*yt,ut+=z*Ze,pt+=z*Pt,tr+=z*xt,zt+=z*Jt,z=te[15],K+=z*mt,F+=z*St,W+=z*dt,ie+=z*Nt,pe+=z*Rt,we+=z*gt,he+=z*qt,Re+=z*Wt,Je+=z*ot,et+=z*Vt,it+=z*Ft,ut+=z*yt,pt+=z*Ze,tr+=z*Pt,zt+=z*xt,At+=z*Jt,Q+=38*F,me+=38*W,be+=38*ie,Ce+=38*pe,Fe+=38*we,Ue+=38*he,Ke+=38*Re,lt+=38*Je,Ee+=38*et,He+=38*it,qe+=38*ut,Ie+=38*pt,Ne+=38*tr,$e+=38*zt,je+=38*At,G=1,z=Q+G+65535,G=Math.floor(z/65536),Q=z-G*65536,z=me+G+65535,G=Math.floor(z/65536),me=z-G*65536,z=be+G+65535,G=Math.floor(z/65536),be=z-G*65536,z=Ce+G+65535,G=Math.floor(z/65536),Ce=z-G*65536,z=Fe+G+65535,G=Math.floor(z/65536),Fe=z-G*65536,z=Ue+G+65535,G=Math.floor(z/65536),Ue=z-G*65536,z=Ke+G+65535,G=Math.floor(z/65536),Ke=z-G*65536,z=lt+G+65535,G=Math.floor(z/65536),lt=z-G*65536,z=Ee+G+65535,G=Math.floor(z/65536),Ee=z-G*65536,z=He+G+65535,G=Math.floor(z/65536),He=z-G*65536,z=qe+G+65535,G=Math.floor(z/65536),qe=z-G*65536,z=Ie+G+65535,G=Math.floor(z/65536),Ie=z-G*65536,z=Ne+G+65535,G=Math.floor(z/65536),Ne=z-G*65536,z=$e+G+65535,G=Math.floor(z/65536),$e=z-G*65536,z=je+G+65535,G=Math.floor(z/65536),je=z-G*65536,z=K+G+65535,G=Math.floor(z/65536),K=z-G*65536,Q+=G-1+37*(G-1),G=1,z=Q+G+65535,G=Math.floor(z/65536),Q=z-G*65536,z=me+G+65535,G=Math.floor(z/65536),me=z-G*65536,z=be+G+65535,G=Math.floor(z/65536),be=z-G*65536,z=Ce+G+65535,G=Math.floor(z/65536),Ce=z-G*65536,z=Fe+G+65535,G=Math.floor(z/65536),Fe=z-G*65536,z=Ue+G+65535,G=Math.floor(z/65536),Ue=z-G*65536,z=Ke+G+65535,G=Math.floor(z/65536),Ke=z-G*65536,z=lt+G+65535,G=Math.floor(z/65536),lt=z-G*65536,z=Ee+G+65535,G=Math.floor(z/65536),Ee=z-G*65536,z=He+G+65535,G=Math.floor(z/65536),He=z-G*65536,z=qe+G+65535,G=Math.floor(z/65536),qe=z-G*65536,z=Ie+G+65535,G=Math.floor(z/65536),Ie=z-G*65536,z=Ne+G+65535,G=Math.floor(z/65536),Ne=z-G*65536,z=$e+G+65535,G=Math.floor(z/65536),$e=z-G*65536,z=je+G+65535,G=Math.floor(z/65536),je=z-G*65536,z=K+G+65535,G=Math.floor(z/65536),K=z-G*65536,Q+=G-1+37*(G-1),J[0]=Q,J[1]=me,J[2]=be,J[3]=Ce,J[4]=Fe,J[5]=Ue,J[6]=Ke,J[7]=lt,J[8]=Ee,J[9]=He,J[10]=qe,J[11]=Ie,J[12]=Ne,J[13]=$e,J[14]=je,J[15]=K}function B(J,te){I(J,te,te)}function V(J,te){const re=i();let z;for(z=0;z<16;z++)re[z]=te[z];for(z=253;z>=0;z--)B(re,re),z!==2&&z!==4&&I(re,re,te);for(z=0;z<16;z++)J[z]=re[z]}function se(J,te){const re=i();let z;for(z=0;z<16;z++)re[z]=te[z];for(z=250;z>=0;z--)B(re,re),z!==1&&I(re,re,te);for(z=0;z<16;z++)J[z]=re[z]}function Y(J,te){const re=i(),z=i(),G=i(),Q=i(),me=i(),be=i(),Ce=i(),Fe=i(),Ue=i();U(re,J[1],J[0]),U(Ue,te[1],te[0]),I(re,re,Ue),j(z,J[0],J[1]),j(Ue,te[0],te[1]),I(z,z,Ue),I(G,J[3],te[3]),I(G,G,c),I(Q,J[2],te[2]),j(Q,Q,Q),U(me,z,re),U(be,Q,G),j(Ce,Q,G),j(Fe,z,re),I(J[0],me,be),I(J[1],Fe,Ce),I(J[2],Ce,be),I(J[3],me,Fe)}function N(J,te,re){for(let z=0;z<4;z++)w(J[z],te[z],re)}function k(J,te){const re=i(),z=i(),G=i();V(G,te[2]),I(re,te[0],G),I(z,te[1],G),C(J,z),J[31]^=A(re)<<7}function x(J,te,re){g(J[0],s),g(J[1],o),g(J[2],o),g(J[3],s);for(let z=255;z>=0;--z){const G=re[z/8|0]>>(z&7)&1;N(J,te,G),Y(te,J),Y(J,J),N(J,te,G)}}function _(J,te){const re=[i(),i(),i(),i()];g(re[0],u),g(re[1],f),g(re[2],o),I(re[3],u,f),x(J,re,te)}function L(J){if(J.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const te=(0,r.hash)(J);te[0]&=248,te[31]&=127,te[31]|=64;const re=new Uint8Array(32),z=[i(),i(),i(),i()];_(z,te),k(re,z);const G=new Uint8Array(64);return G.set(J),G.set(re,32),{publicKey:re,secretKey:G}}t.generateKeyPairFromSeed=L;function O(J){const te=(0,e.randomBytes)(32,J),re=L(te);return(0,n.wipe)(te),re}t.generateKeyPair=O;function P(J){if(J.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(J.subarray(32))}t.extractPublicKeyFromSecretKey=P;const R=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function M(J,te){let re,z,G,Q;for(z=63;z>=32;--z){for(re=0,G=z-32,Q=z-12;G>4)*R[G],re=te[G]>>8,te[G]&=255;for(G=0;G<32;G++)te[G]-=re*R[G];for(z=0;z<32;z++)te[z+1]+=te[z]>>8,J[z]=te[z]&255}function D(J){const te=new Float64Array(64);for(let re=0;re<64;re++)te[re]=J[re];for(let re=0;re<64;re++)J[re]=0;M(J,te)}function $(J,te){const re=new Float64Array(64),z=[i(),i(),i(),i()],G=(0,r.hash)(J.subarray(0,32));G[0]&=248,G[31]&=127,G[31]|=64;const Q=new Uint8Array(64);Q.set(G.subarray(32),32);const me=new r.SHA512;me.update(Q.subarray(32)),me.update(te);const be=me.digest();me.clean(),D(be),_(z,be),k(Q,z),me.reset(),me.update(Q.subarray(0,32)),me.update(J.subarray(32)),me.update(te);const Ce=me.digest();D(Ce);for(let Fe=0;Fe<32;Fe++)re[Fe]=be[Fe];for(let Fe=0;Fe<32;Fe++)for(let Ue=0;Ue<32;Ue++)re[Fe+Ue]+=Ce[Fe]*G[Ue];return M(Q.subarray(32),re),Q}t.sign=$;function X(J,te){const re=i(),z=i(),G=i(),Q=i(),me=i(),be=i(),Ce=i();return g(J[2],o),S(J[1],te),B(G,J[1]),I(Q,G,l),U(G,G,J[2]),j(Q,J[2],Q),B(me,Q),B(be,me),I(Ce,be,me),I(re,Ce,G),I(re,re,Q),se(re,re),I(re,re,G),I(re,re,Q),I(re,re,Q),I(J[0],re,Q),B(z,J[0]),I(z,z,Q),b(z,G)&&I(J[0],J[0],h),B(z,J[0]),I(z,z,Q),b(z,G)?-1:(A(J[0])===te[31]>>7&&U(J[0],s,J[0]),I(J[3],J[0],J[1]),0)}function le(J,te,re){const z=new Uint8Array(32),G=[i(),i(),i(),i()],Q=[i(),i(),i(),i()];if(re.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(X(Q,J))return!1;const me=new r.SHA512;me.update(re.subarray(0,32)),me.update(J),me.update(te);const be=me.digest();return D(be),x(G,Q,be),_(Q,re.subarray(32)),Y(G,Q),k(z,G),!v(re,z)}t.verify=le;function H(J){let te=[i(),i(),i(),i()];if(X(te,J))throw new Error("Ed25519: invalid public key");let re=i(),z=i(),G=te[1];j(re,o,G),U(z,o,G),V(z,z),I(re,re,z);let Q=new Uint8Array(32);return C(Q,re),Q}t.convertPublicKeyToX25519=H;function ee(J){const te=(0,r.hash)(J.subarray(0,32));te[0]&=248,te[31]&=127,te[31]|=64;const re=new Uint8Array(te.subarray(0,32));return(0,n.wipe)(te),re}t.convertSecretKeyToX25519=ee})(Nj);const KBe="EdDSA",JBe="JWT",y8=".",l7="base64url",wie="utf8",vie="utf8",QBe=":",ZBe="did",XBe="key",oW="base58btc",eze="z",tze="K36",rze=32,nze=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),ize=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function o1(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return ize(t)}catch{return t}}function Kd(t){return typeof t=="string"?t:nze(t)||""}function lW(t){return o1(aa(ra(t,l7),wie))}function w8(t){return aa(ra(Kd(t),wie),l7)}function bie(t){const e=ra(tze,oW),r=eze+aa(W6([e,t]),oW);return[ZBe,XBe,r].join(QBe)}function aze(t){return aa(t,l7)}function sze(t){return ra(t,l7)}function oze(t){return ra([w8(t.header),w8(t.payload)].join(y8),vie)}function lze(t){return[w8(t.header),w8(t.payload),aze(t.signature)].join(y8)}function xT(t){const e=t.split(y8),r=lW(e[0]),n=lW(e[1]),i=sze(e[2]),a=ra(e.slice(0,2).join(y8),vie);return{header:r,payload:n,signature:i,data:a}}function cW(t=kh.randomBytes(rze)){return Nj.generateKeyPairFromSeed(t)}async function cze(t,e,r,n,i=ct.fromMiliseconds(Date.now())){const a={alg:KBe,typ:JBe},s=bie(n.publicKey),o=i+r,l={iss:s,sub:t,aud:e,iat:i,exp:o},c=oze({header:a,payload:l}),u=Nj.sign(n.secretKey,c);return lze({header:a,payload:l,signature:u})}const uze={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var dze={};const fze=":";function wg(t){const[e,r]=t.split(fze);return{namespace:e,reference:r}}function uW(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function xie(t,e){return t.includes(":")?[t]:e.chains||[]}var hze=Object.defineProperty,dW=Object.getOwnPropertySymbols,pze=Object.prototype.hasOwnProperty,gze=Object.prototype.propertyIsEnumerable,fW=(t,e,r)=>e in t?hze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,hW=(t,e)=>{for(var r in e||(e={}))pze.call(e,r)&&fW(t,r,e[r]);if(dW)for(var r of dW(e))gze.call(e,r)&&fW(t,r,e[r]);return t};const mze="ReactNative",_o={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},yze="js";function v8(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Lh(){return!dv()&&!!vj()&&navigator.product===mze}function wze(){return Lh()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function vze(){return Lh()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function yv(){return!v8()&&!!vj()&&!!dv()}function wv(){return Lh()?_o.reactNative:v8()?_o.node:yv()?_o.browser:_o.unknown}function pW(){var t;try{return Lh()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function bze(t,e){let r=t3.parse(t);return r=hW(hW({},r),e),t=t3.stringify(r),t}function Eie(){return Hne()||{name:"",description:"",url:"",icons:[""]}}function xze(){if(wv()===_o.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=SOe();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function Eze(){var t;const e=wv();return e===_o.browser?[e,((t=Wne())==null?void 0:t.host)||"unknown"].join(":"):e}function _ie(t,e,r){const n=xze(),i=Eze();return[[t,e].join("-"),[yze,r].join("-"),n,i].join("/")}function _ze({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:a,useOnCloseEvent:s,bundleId:o,packageName:l}){const c=r.split("?"),u=_ie(t,e,n),f={auth:i,ua:u,projectId:a,useOnCloseEvent:s||void 0,packageName:l||void 0,bundleId:o||void 0},h=bze(c[1]||"",f);return c[0]+"?"+h}function C0(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Cie(t){return Object.fromEntries(t.entries())}function Sie(t){return new Map(Object.entries(t))}function l0(t=ct.FIVE_MINUTES,e){const r=ct.toMiliseconds(t||ct.FIVE_MINUTES);let n,i,a,s;return{resolve:o=>{a&&n&&(clearTimeout(a),n(o),s=Promise.resolve(o))},reject:o=>{a&&i&&(clearTimeout(a),i(o))},done:()=>new Promise((o,l)=>{if(s)return o(s);a=setTimeout(()=>{const c=new Error(e);s=Promise.reject(c),l(c)},r),n=o,i=l})}}function Bf(t,e,r){return new Promise(async(n,i)=>{const a=setTimeout(()=>i(new Error(r)),e);try{const s=await t;n(s)}catch(s){i(s)}clearTimeout(a)})}function Aie(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function Cze(t){return Aie("topic",t)}function Sze(t){return Aie("id",t)}function Iie(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function Li(t,e){return ct.fromMiliseconds(Date.now()+ct.toMiliseconds(t))}function kf(t){return Date.now()>=ct.toMiliseconds(t)}function jr(t,e){return`${t}${e?`:${e}`:""}`}function H6(t=[],e=[]){return[...new Set([...t,...e])]}async function Aze({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,a=i==null?void 0:i.href;if(typeof a!="string")return;const s=Ize(a,t,e),o=wv();if(o===_o.browser){if(!((n=dv())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}s.startsWith("https://")||s.startsWith("http://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,Tze()?"_blank":"_self","noreferrer noopener")}else o===_o.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(i){console.error(i)}}function Ize(t,e,r){const n=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const a=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${a}${kze(n,!0)}`}else i=`${i}/wc?${n}`;return i}async function Mze(t,e){let r="";try{if(yv()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function gW(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function mW(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Lj(){return typeof process<"u"&&dze.IS_VITEST==="true"}function Tze(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function kze(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function Mie(t){return Buffer.from(t,"base64").toString("utf-8")}function Nze(t){return new Promise(e=>setTimeout(e,t))}const Lze="https://rpc.walletconnect.org/v1";async function jze(t,e,r,n,i,a){switch(r.t){case"eip191":return $ze(t,e,r.s);case"eip1271":return await Pze(t,e,r.s,n,i,a);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function $ze(t,e,r){return LN(XK(e),r).toLowerCase()===t.toLowerCase()}async function Pze(t,e,r,n,i,a){const s=wg(n);if(!s.namespace||!s.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const o="0x1626ba7e",l="0000000000000000000000000000000000000000000000000000000000000040",c="0000000000000000000000000000000000000000000000000000000000000041",u=r.substring(2),f=XK(e).substring(2),h=o+f+l+c+u,g=await fetch(`${a||Lze}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:Rze(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:h},"latest"]})}),{result:m}=await g.json();return m?m.slice(0,o.length).toLowerCase()===o.toLowerCase():!1}catch(o){return console.error("isValidEip1271Signature: ",o),!1}}function Rze(){return Date.now()+Math.floor(Math.random()*1e3)}var Dze=Object.defineProperty,Oze=Object.defineProperties,Fze=Object.getOwnPropertyDescriptors,yW=Object.getOwnPropertySymbols,Uze=Object.prototype.hasOwnProperty,Bze=Object.prototype.propertyIsEnumerable,wW=(t,e,r)=>e in t?Dze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zze=(t,e)=>{for(var r in e||(e={}))Uze.call(e,r)&&wW(t,r,e[r]);if(yW)for(var r of yW(e))Bze.call(e,r)&&wW(t,r,e[r]);return t},Wze=(t,e)=>Oze(t,Fze(e));const Hze="did:pkh:",jj=t=>t==null?void 0:t.split(":"),Gze=t=>{const e=t&&jj(t);if(e)return t.includes(Hze)?e[3]:e[1]},ET=t=>{const e=t&&jj(t);if(e)return e[2]+":"+e[3]},b8=t=>{const e=t&&jj(t);if(e)return e.pop()};async function vW(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,a=Tie(i,i.iss),s=b8(i.iss);return await jze(s,a,n,ET(i.iss),r)}const Tie=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=b8(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const a=`URI: ${t.aud||t.uri}`,s=`Version: ${t.version}`,o=`Chain ID: ${Gze(e)}`,l=`Nonce: ${t.nonce}`,c=`Issued At: ${t.iat}`,u=t.exp?`Expiration Time: ${t.exp}`:void 0,f=t.nbf?`Not Before: ${t.nbf}`:void 0,h=t.requestId?`Request ID: ${t.requestId}`:void 0,g=t.resources?`Resources:${t.resources.map(w=>` -- ${w}`).join("")}`:void 0,m=G6(t.resources);if(m){const w=r3(m);i=eWe(i,w)}return[r,n,"",i,"",a,s,o,l,c,u,f,h,g].filter(w=>w!=null).join(` -`)};function qze(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function Vze(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function l1(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const a=n[i];if(!Array.isArray(a))throw new Error(`Ability limits ${i} must be an array of objects, found: ${a}`);if(!a.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);a.forEach(s=>{if(typeof s!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${s}`)})})})}function Yze(t,e,r,n={}){return r==null||r.sort((i,a)=>i.localeCompare(a)),{att:{[t]:Kze(e,r,n)}}}function Kze(t,e,r={}){e=e==null?void 0:e.sort((i,a)=>i.localeCompare(a));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function kie(t){return l1(t),`urn:recap:${qze(t).replace(/=/g,"")}`}function r3(t){const e=Vze(t.replace("urn:recap:",""));return l1(e),e}function Jze(t,e,r){const n=Yze(t,e,r);return kie(n)}function Qze(t){return t&&t.includes("urn:recap:")}function Zze(t,e){const r=r3(t),n=r3(e),i=Xze(r,n);return kie(i)}function Xze(t,e){l1(t),l1(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,a)=>i.localeCompare(a)),n={att:{}};return r.forEach(i=>{var a,s;Object.keys(((a=t.att)==null?void 0:a[i])||{}).concat(Object.keys(((s=e.att)==null?void 0:s[i])||{})).sort((o,l)=>o.localeCompare(l)).forEach(o=>{var l,c;n.att[i]=Wze(zze({},n.att[i]),{[o]:((l=t.att[i])==null?void 0:l[o])||((c=e.att[i])==null?void 0:c[o])})})}),n}function eWe(t="",e){l1(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(o=>{const l=Object.keys(e.att[o]).map(f=>({ability:f.split("/")[0],action:f.split("/")[1]}));l.sort((f,h)=>f.action.localeCompare(h.action));const c={};l.forEach(f=>{c[f.ability]||(c[f.ability]=[]),c[f.ability].push(f.action)});const u=Object.keys(c).map(f=>(i++,`(${i}) '${f}': '${c[f].join("', '")}' for '${o}'.`));n.push(u.join(", ").replace(".,","."))});const a=n.join(" "),s=`${r}${a}`;return`${t?t+" ":""}${s}`}function bW(t){var e;const r=r3(t);l1(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function xW(t){const e=r3(t);l1(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var a;(a=i==null?void 0:i[0])!=null&&a.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function G6(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return Qze(e)?e:void 0}const Nie="base10",cs="base16",zf="base64pad",V2="base64url",vv="utf8",Lie=0,Ld=1,bv=2,tWe=0,EW=1,Hy=12,$j=32;function rWe(){const t=_j.generateKeyPair();return{privateKey:aa(t.secretKey,cs),publicKey:aa(t.publicKey,cs)}}function _T(){const t=kh.randomBytes($j);return aa(t,cs)}function nWe(t,e){const r=_j.sharedKey(ra(t,cs),ra(e,cs),!0),n=new tUe(hv.SHA256,r).expand($j);return aa(n,cs)}function q6(t){const e=hv.hash(ra(t,cs));return aa(e,cs)}function xd(t){const e=hv.hash(ra(t,vv));return aa(e,cs)}function jie(t){return ra(`${t}`,Nie)}function c1(t){return Number(aa(t,Nie))}function iWe(t){const e=jie(typeof t.type<"u"?t.type:Lie);if(c1(e)===Ld&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?ra(t.senderPublicKey,cs):void 0,n=typeof t.iv<"u"?ra(t.iv,cs):kh.randomBytes(Hy),i=new xj.ChaCha20Poly1305(ra(t.symKey,cs)).seal(n,ra(t.message,vv));return $ie({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function aWe(t,e){const r=jie(bv),n=kh.randomBytes(Hy),i=ra(t,vv);return $ie({type:r,sealed:i,iv:n,encoding:e})}function sWe(t){const e=new xj.ChaCha20Poly1305(ra(t.symKey,cs)),{sealed:r,iv:n}=n3({encoded:t.encoded,encoding:t==null?void 0:t.encoding}),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return aa(i,vv)}function oWe(t,e){const{sealed:r}=n3({encoded:t,encoding:e});return aa(r,vv)}function $ie(t){const{encoding:e=zf}=t;if(c1(t.type)===bv)return aa(W6([t.type,t.sealed]),e);if(c1(t.type)===Ld){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return aa(W6([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return aa(W6([t.type,t.iv,t.sealed]),e)}function n3(t){const{encoded:e,encoding:r=zf}=t,n=ra(e,r),i=n.slice(tWe,EW),a=EW;if(c1(i)===Ld){const c=a+$j,u=c+Hy,f=n.slice(a,c),h=n.slice(c,u),g=n.slice(u);return{type:i,sealed:g,iv:h,senderPublicKey:f}}if(c1(i)===bv){const c=n.slice(a),u=kh.randomBytes(Hy);return{type:i,sealed:c,iv:u}}const s=a+Hy,o=n.slice(a,s),l=n.slice(s);return{type:i,sealed:l,iv:o}}function lWe(t,e){const r=n3({encoded:t,encoding:e==null?void 0:e.encoding});return Pie({type:c1(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?aa(r.senderPublicKey,cs):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Pie(t){const e=(t==null?void 0:t.type)||Lie;if(e===Ld){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function _W(t){return t.type===Ld&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function CW(t){return t.type===bv}function cWe(t){return new lie.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function uWe(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function dWe(t){return Buffer.from(uWe(t),"base64")}function fWe(t,e){const[r,n,i]=t.split("."),a=dWe(i);if(a.length!==64)throw new Error("Invalid signature length");const s=a.slice(0,32).toString("hex"),o=a.slice(32,64).toString("hex"),l=`${r}.${n}`,c=new hv.SHA256().update(Buffer.from(l)).digest(),u=cWe(e),f=Buffer.from(c).toString("hex");if(!u.verify(f,{r:s,s:o}))throw new Error("Invalid signature");return xT(t).payload}const hWe="irn";function x8(t){return(t==null?void 0:t.relay)||{protocol:hWe}}function yy(t){const e=uze[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var pWe=Object.defineProperty,gWe=Object.defineProperties,mWe=Object.getOwnPropertyDescriptors,SW=Object.getOwnPropertySymbols,yWe=Object.prototype.hasOwnProperty,wWe=Object.prototype.propertyIsEnumerable,AW=(t,e,r)=>e in t?pWe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,IW=(t,e)=>{for(var r in e||(e={}))yWe.call(e,r)&&AW(t,r,e[r]);if(SW)for(var r of SW(e))wWe.call(e,r)&&AW(t,r,e[r]);return t},vWe=(t,e)=>gWe(t,mWe(e));function bWe(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const a=i.replace(n,""),s=t[i];r[a]=s}}),r}function MW(t){if(!t.includes("wc:")){const l=Mie(t);l!=null&&l.includes("wc:")&&(t=l)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),a=typeof r<"u"?t.substring(r):"",s=t3.parse(a),o=typeof s.methods=="string"?s.methods.split(","):void 0;return{protocol:n,topic:xWe(i[0]),version:parseInt(i[1],10),symKey:s.symKey,relay:bWe(s),methods:o,expiryTimestamp:s.expiryTimestamp?parseInt(s.expiryTimestamp,10):void 0}}function xWe(t){return t.startsWith("//")?t.substring(2):t}function EWe(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const a=r+e+i;t[i]&&(n[a]=t[i])}),n}function TW(t){return`${t.protocol}:${t.topic}@${t.version}?`+t3.stringify(IW(vWe(IW({symKey:t.symKey},EWe(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function U4(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function Gm(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function _We(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Gm(r.accounts))}),e}function CWe(t,e){const r=[];return Object.values(t).forEach(n=>{Gm(n.accounts).includes(e)&&r.push(...n.methods)}),r}function SWe(t,e){const r=[];return Object.values(t).forEach(n=>{Gm(n.accounts).includes(e)&&r.push(...n.events)}),r}function Pj(t){return t.includes(":")}function wy(t){return Pj(t)?t.split(":")[0]:t}function AWe(t){const e={};return t==null||t.forEach(r=>{const[n,i]=r.split(":");e[n]||(e[n]={accounts:[],chains:[],events:[]}),e[n].accounts.push(r),e[n].chains.push(`${n}:${i}`)}),e}function kW(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=AWe(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=H6(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const IWe={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},MWe={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ht(t,e){const{message:r,code:n}=MWe[t];return{message:e?`${r} ${e}`:r,code:n}}function ln(t,e){const{message:r,code:n}=IWe[t];return{message:e?`${r} ${e}`:r,code:n}}function Jd(t,e){return!!Array.isArray(t)}function i3(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Os(t){return typeof t>"u"}function pi(t,e){return e&&Os(t)?!0:typeof t=="string"&&!!t.trim().length}function Rj(t,e){return typeof t=="number"&&!isNaN(t)}function TWe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let a=!0;return C0(i,n)?(n.forEach(s=>{const{accounts:o,methods:l,events:c}=t.namespaces[s],u=Gm(o),f=r[s];(!C0(xie(s,f),u)||!C0(f.methods,l)||!C0(f.events,c))&&(a=!1)}),a):!1}function E8(t){return pi(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function kWe(t){if(pi(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&E8(r)}}return!1}function NWe(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(pi(t,!1)){if(e(t))return!0;const r=Mie(t);return e(r)}}catch{}return!1}function LWe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function jWe(t){return t==null?void 0:t.topic}function $We(t,e){let r=null;return pi(t==null?void 0:t.publicKey,!1)||(r=ht("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function NW(t){let e=!0;return Jd(t)?t.length&&(e=t.every(r=>pi(r,!1))):e=!1,e}function PWe(t,e,r){let n=null;return Jd(e)&&e.length?e.forEach(i=>{n||E8(i)||(n=ln("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):E8(t)||(n=ln("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function RWe(t,e,r){let n=null;return Object.entries(t).forEach(([i,a])=>{if(n)return;const s=PWe(i,xie(i,a),`${e} ${r}`);s&&(n=s)}),n}function DWe(t,e){let r=null;return Jd(t)?t.forEach(n=>{r||kWe(n)||(r=ln("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=ln("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function OWe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=DWe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function FWe(t,e){let r=null;return NW(t==null?void 0:t.methods)?NW(t==null?void 0:t.events)||(r=ln("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=ln("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function Rie(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=FWe(n,`${e}, namespace`);i&&(r=i)}),r}function UWe(t,e,r){let n=null;if(t&&i3(t)){const i=Rie(t,e);i&&(n=i);const a=RWe(t,e,r);a&&(n=a)}else n=ht("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function NS(t,e){let r=null;if(t&&i3(t)){const n=Rie(t,e);n&&(r=n);const i=OWe(t,e);i&&(r=i)}else r=ht("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Die(t){return pi(t.protocol,!0)}function BWe(t,e){let r=!1;return t?t&&Jd(t)&&t.length&&t.forEach(n=>{r=Die(n)}):r=!0,r}function zWe(t){return typeof t=="number"}function Ls(t){return typeof t<"u"&&typeof t!==null}function WWe(t){return!(!t||typeof t!="object"||!t.code||!Rj(t.code)||!t.message||!pi(t.message,!1))}function HWe(t){return!(Os(t)||!pi(t.method,!1))}function GWe(t){return!(Os(t)||Os(t.result)&&Os(t.error)||!Rj(t.id)||!pi(t.jsonrpc,!1))}function qWe(t){return!(Os(t)||!pi(t.name,!1))}function LW(t,e){return!(!E8(e)||!_We(t).includes(e))}function VWe(t,e,r){return pi(r,!1)?CWe(t,e).includes(r):!1}function YWe(t,e,r){return pi(r,!1)?SWe(t,e).includes(r):!1}function jW(t,e,r){let n=null;const i=KWe(t),a=JWe(e),s=Object.keys(i),o=Object.keys(a),l=$W(Object.keys(t)),c=$W(Object.keys(e)),u=l.filter(f=>!c.includes(f));return u.length&&(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. - Required: ${u.toString()} - Received: ${Object.keys(e).toString()}`)),C0(s,o)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. - Required: ${s.toString()} - Approved: ${o.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const h=Gm(e[f].accounts);h.includes(f)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${f} - Required: ${f} - Approved: ${h.toString()}`))}),s.forEach(f=>{n||(C0(i[f].methods,a[f].methods)?C0(i[f].events,a[f].events)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${f}`)):n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${f}`))}),n}function KWe(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function $W(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function JWe(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Gm(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(a=>a.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function QWe(t,e){return Rj(t)&&t<=e.max&&t>=e.min}function PW(){const t=wv();return new Promise(e=>{switch(t){case _o.browser:e(ZWe());break;case _o.reactNative:e(XWe());break;case _o.node:e(eHe());break;default:e(!0)}})}function ZWe(){return yv()&&(navigator==null?void 0:navigator.onLine)}async function XWe(){if(Lh()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function eHe(){return!0}function tHe(t){switch(wv()){case _o.browser:rHe(t);break;case _o.reactNative:nHe(t);break}}function rHe(t){!Lh()&&yv()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function nHe(t){Lh()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const LS={};class Y2{static get(e){return LS[e]}static set(e,r){LS[e]=r}static delete(e){delete LS[e]}}class j1{}let iHe=class extends j1{constructor(e){super()}};const RW=ct.FIVE_SECONDS,qm={pulse:"heartbeat_pulse"};let aHe=class Oie extends iHe{constructor(e){super(e),this.events=new ys.EventEmitter,this.interval=RW,this.interval=(e==null?void 0:e.interval)||RW}static async init(e){const r=new Oie(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),ct.toMiliseconds(this.interval))}pulse(){this.events.emit(qm.pulse)}};function sHe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Hi(t,...e){try{return sHe(t(...e))}catch(r){return Promise.reject(r)}}function oHe(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function lHe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function V6(t){if(oHe(t))return String(t);if(lHe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return V6(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const CT="base64:";function cHe(t){return typeof t=="string"?t:CT+fHe(t)}function uHe(t){return typeof t!="string"||!t.startsWith(CT)?t:dHe(t.slice(CT.length))}function dHe(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function fHe(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function Ns(t){var e;return t&&((e=t.split("?")[0])==null?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function hHe(...t){return Ns(t.join(":"))}function B4(t){return t=Ns(t),t?t+":":""}const pHe="memory",gHe=()=>{const t=new Map;return{name:pHe,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function mHe(t={}){const e={mounts:{"":t.driver||gHe()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=c=>{for(const u of e.mountpoints)if(c.startsWith(u))return{base:u,relativeKey:c.slice(u.length),driver:e.mounts[u]};return{base:"",relativeKey:c,driver:e.mounts[""]}},n=(c,u)=>e.mountpoints.filter(f=>f.startsWith(c)||u&&c.startsWith(f)).map(f=>({relativeBase:c.length>f.length?c.slice(f.length):void 0,mountpoint:f,driver:e.mounts[f]})),i=(c,u)=>{if(e.watching){u=Ns(u);for(const f of e.watchListeners)f(c,u)}},a=async()=>{if(!e.watching){e.watching=!0;for(const c in e.mounts)e.unwatch[c]=await DW(e.mounts[c],i,c)}},s=async()=>{if(e.watching){for(const c in e.unwatch)await e.unwatch[c]();e.unwatch={},e.watching=!1}},o=(c,u,f)=>{const h=new Map,g=m=>{let w=h.get(m.base);return w||(w={driver:m.driver,base:m.base,items:[]},h.set(m.base,w)),w};for(const m of c){const w=typeof m=="string",C=Ns(w?m:m.key),v=w?void 0:m.value,b=w||!m.options?u:{...u,...m.options},A=r(C);g(A).items.push({key:C,value:v,relativeKey:A.relativeKey,options:b})}return Promise.all([...h.values()].map(m=>f(m))).then(m=>m.flat())},l={hasItem(c,u={}){c=Ns(c);const{relativeKey:f,driver:h}=r(c);return Hi(h.hasItem,f,u)},getItem(c,u={}){c=Ns(c);const{relativeKey:f,driver:h}=r(c);return Hi(h.getItem,f,u).then(g=>fy(g))},getItems(c,u={}){return o(c,u,f=>f.driver.getItems?Hi(f.driver.getItems,f.items.map(h=>({key:h.relativeKey,options:h.options})),u).then(h=>h.map(g=>({key:hHe(f.base,g.key),value:fy(g.value)}))):Promise.all(f.items.map(h=>Hi(f.driver.getItem,h.relativeKey,h.options).then(g=>({key:h.key,value:fy(g)})))))},getItemRaw(c,u={}){c=Ns(c);const{relativeKey:f,driver:h}=r(c);return h.getItemRaw?Hi(h.getItemRaw,f,u):Hi(h.getItem,f,u).then(g=>uHe(g))},async setItem(c,u,f={}){if(u===void 0)return l.removeItem(c);c=Ns(c);const{relativeKey:h,driver:g}=r(c);g.setItem&&(await Hi(g.setItem,h,V6(u),f),g.watch||i("update",c))},async setItems(c,u){await o(c,u,async f=>{if(f.driver.setItems)return Hi(f.driver.setItems,f.items.map(h=>({key:h.relativeKey,value:V6(h.value),options:h.options})),u);f.driver.setItem&&await Promise.all(f.items.map(h=>Hi(f.driver.setItem,h.relativeKey,V6(h.value),h.options)))})},async setItemRaw(c,u,f={}){if(u===void 0)return l.removeItem(c,f);c=Ns(c);const{relativeKey:h,driver:g}=r(c);if(g.setItemRaw)await Hi(g.setItemRaw,h,u,f);else if(g.setItem)await Hi(g.setItem,h,cHe(u),f);else return;g.watch||i("update",c)},async removeItem(c,u={}){typeof u=="boolean"&&(u={removeMeta:u}),c=Ns(c);const{relativeKey:f,driver:h}=r(c);h.removeItem&&(await Hi(h.removeItem,f,u),(u.removeMeta||u.removeMata)&&await Hi(h.removeItem,f+"$",u),h.watch||i("remove",c))},async getMeta(c,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),c=Ns(c);const{relativeKey:f,driver:h}=r(c),g=Object.create(null);if(h.getMeta&&Object.assign(g,await Hi(h.getMeta,f,u)),!u.nativeOnly){const m=await Hi(h.getItem,f+"$",u).then(w=>fy(w));m&&typeof m=="object"&&(typeof m.atime=="string"&&(m.atime=new Date(m.atime)),typeof m.mtime=="string"&&(m.mtime=new Date(m.mtime)),Object.assign(g,m))}return g},setMeta(c,u,f={}){return this.setItem(c+"$",u,f)},removeMeta(c,u={}){return this.removeItem(c+"$",u)},async getKeys(c,u={}){c=B4(c);const f=n(c,!0);let h=[];const g=[];for(const m of f){const w=await Hi(m.driver.getKeys,m.relativeBase,u);for(const C of w){const v=m.mountpoint+Ns(C);h.some(b=>v.startsWith(b))||g.push(v)}h=[m.mountpoint,...h.filter(C=>!C.startsWith(m.mountpoint))]}return c?g.filter(m=>m.startsWith(c)&&m[m.length-1]!=="$"):g.filter(m=>m[m.length-1]!=="$")},async clear(c,u={}){c=B4(c),await Promise.all(n(c,!1).map(async f=>{if(f.driver.clear)return Hi(f.driver.clear,f.relativeBase,u);if(f.driver.removeItem){const h=await f.driver.getKeys(f.relativeBase||"",u);return Promise.all(h.map(g=>f.driver.removeItem(g,u)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(c=>OW(c)))},async watch(c){return await a(),e.watchListeners.push(c),async()=>{e.watchListeners=e.watchListeners.filter(u=>u!==c),e.watchListeners.length===0&&await s()}},async unwatch(){e.watchListeners=[],await s()},mount(c,u){if(c=B4(c),c&&e.mounts[c])throw new Error(`already mounted at ${c}`);return c&&(e.mountpoints.push(c),e.mountpoints.sort((f,h)=>h.length-f.length)),e.mounts[c]=u,e.watching&&Promise.resolve(DW(u,i,c)).then(f=>{e.unwatch[c]=f}).catch(console.error),l},async unmount(c,u=!0){var f,h;c=B4(c),!(!c||!e.mounts[c])&&(e.watching&&c in e.unwatch&&((h=(f=e.unwatch)[c])==null||h.call(f),delete e.unwatch[c]),u&&await OW(e.mounts[c]),e.mountpoints=e.mountpoints.filter(g=>g!==c),delete e.mounts[c])},getMount(c=""){c=Ns(c)+":";const u=r(c);return{driver:u.driver,base:u.base}},getMounts(c="",u={}){return c=Ns(c),n(c,u.parents).map(h=>({driver:h.driver,base:h.mountpoint}))},keys:(c,u={})=>l.getKeys(c,u),get:(c,u={})=>l.getItem(c,u),set:(c,u,f={})=>l.setItem(c,u,f),has:(c,u={})=>l.hasItem(c,u),del:(c,u={})=>l.removeItem(c,u),remove:(c,u={})=>l.removeItem(c,u)};return l}function DW(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function OW(t){typeof t.dispose=="function"&&await Hi(t.dispose)}function $1(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Fie(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=$1(r);return(i,a)=>n.then(s=>a(s.transaction(e,i).objectStore(e)))}let jS;function xv(){return jS||(jS=Fie("keyval-store","keyval")),jS}function FW(t,e=xv()){return e("readonly",r=>$1(r.get(t)))}function yHe(t,e,r=xv()){return r("readwrite",n=>(n.put(e,t),$1(n.transaction)))}function wHe(t,e=xv()){return e("readwrite",r=>(r.delete(t),$1(r.transaction)))}function vHe(t=xv()){return t("readwrite",e=>(e.clear(),$1(e.transaction)))}function bHe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},$1(t.transaction)}function xHe(t=xv()){return t("readonly",e=>{if(e.getAllKeys)return $1(e.getAllKeys());const r=[];return bHe(e,n=>r.push(n.key)).then(()=>r)})}const EHe="idb-keyval";var _He=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=Fie(t.dbName,t.storeName)),{name:EHe,options:t,async hasItem(i){return!(typeof await FW(r(i),n)>"u")},async getItem(i){return await FW(r(i),n)??null},setItem(i,a){return yHe(r(i),a,n)},removeItem(i){return wHe(r(i),n)},getKeys(){return xHe(n)},clear(){return vHe(n)}}};const CHe="WALLET_CONNECT_V2_INDEXED_DB",SHe="keyvaluestorage";let AHe=class{constructor(){this.indexedDb=mHe({driver:_He({dbName:CHe,storeName:SHe})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Kd(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var $S=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Y6={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof $S<"u"&&$S.localStorage?Y6.exports=$S.localStorage:typeof window<"u"&&window.localStorage?Y6.exports=window.localStorage:Y6.exports=new e})();function IHe(t){var e;return[t[0],o1((e=t[1])!=null?e:"")]}let MHe=class{constructor(){this.localStorage=Y6.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(IHe)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return o1(r)}async setItem(e,r){this.localStorage.setItem(e,Kd(r))}async removeItem(e){this.localStorage.removeItem(e)}};const THe="wc_storage_version",UW=1,kHe=async(t,e,r)=>{const n=THe,i=await e.getItem(n);if(i&&i>=UW){r(e);return}const a=await t.getKeys();if(!a.length){r(e);return}const s=[];for(;a.length;){const o=a.shift();if(!o)continue;const l=o.toLowerCase();if(l.includes("wc@")||l.includes("walletconnect")||l.includes("wc_")||l.includes("wallet_connect")){const c=await t.getItem(o);await e.setItem(o,c),s.push(o)}}await e.setItem(n,UW),r(e),NHe(t,s)},NHe=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let LHe=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new MHe;this.storage=e;try{const r=new AHe;kHe(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};function jHe(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var $He=PHe;function PHe(t,e,r){var n=r&&r.stringify||jHe,i=1;if(typeof t=="object"&&t!==null){var a=e.length+i;if(a===1)return t;var s=new Array(a);s[0]=n(t);for(var o=1;o-1?f:0,t.charCodeAt(g+1)){case 100:case 102:if(u>=l||e[u]==null)break;f=l||e[u]==null)break;f=l||e[u]===void 0)break;f",f=g+2,g++;break}c+=n(e[u]),f=g+2,g++;break;case 115:if(u>=l)break;f-1&&(a=!1);const s=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const o=t.level||"info",l=Object.create(r);l.log||(l.log=s3),Object.defineProperty(l,"levelVal",{get:u}),Object.defineProperty(l,"level",{get:f,set:h});const c={transmit:e,serialize:i,asObject:t.browser.asObject,levels:s,timestamp:zHe(t)};l.levels=xu.levels,l.level=o,l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=s3,l.serializers=n,l._serialize=i,l._stdErrSerialize=a,l.child=g,e&&(l._logEvent=ST());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function f(){return this._level}function h(m){if(m!=="silent"&&!this.levels.values[m])throw Error("unknown level "+m);this._level=m,_p(c,l,"error","log"),_p(c,l,"fatal","error"),_p(c,l,"warn","error"),_p(c,l,"info","log"),_p(c,l,"debug","log"),_p(c,l,"trace","log")}function g(m,w){if(!m)throw new Error("missing bindings for child Pino");w=w||{},i&&m.serializers&&(w.serializers=m.serializers);const C=w.serializers;if(i&&C){var v=Object.assign({},n,C),b=t.browser.serialize===!0?Object.keys(v):i;delete m.serializers,c7([m],b,v,this._stdErrSerialize)}function A(S){this._childLevel=(S._childLevel|0)+1,this.error=Cp(S,m,"error"),this.fatal=Cp(S,m,"fatal"),this.warn=Cp(S,m,"warn"),this.info=Cp(S,m,"info"),this.debug=Cp(S,m,"debug"),this.trace=Cp(S,m,"trace"),v&&(this.serializers=v,this._serialize=b),e&&(this._logEvent=ST([].concat(S._logEvent.bindings,m)))}return A.prototype=this,new A(this)}return l}xu.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};xu.stdSerializers=RHe;xu.stdTimeFunctions=Object.assign({},{nullTime:Uie,epochTime:Bie,unixTime:WHe,isoTime:HHe});function _p(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?s3:i[r]?i[r]:a3[r]||a3[n]||s3,OHe(t,e,r)}function OHe(t,e,r){!t.transmit&&e[r]===s3||(e[r]=function(n){return function(){const a=t.timestamp(),s=new Array(arguments.length),o=Object.getPrototypeOf&&Object.getPrototypeOf(this)===a3?a3:this;for(var l=0;l-1&&a in r&&(t[i][a]=r[a](t[i][a]))}function Cp(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;ithis.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}},zie=class{constructor(e,r=Dj){this.level=e??"error",this.levelValue=Lp.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new zW(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===Lp.levels.values.error?console.error(e):r===Lp.levels.values.warn?console.warn(e):r===Lp.levels.values.debug?console.debug(e):r===Lp.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Kd({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new zW(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Kd({extraMetadata:e})),new Blob(r,{type:"application/json"})}},YHe=class{constructor(e,r=Dj){this.baseChunkLogger=new zie(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}},KHe=class{constructor(e,r=Dj){this.baseChunkLogger=new zie(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var JHe=Object.defineProperty,QHe=Object.defineProperties,ZHe=Object.getOwnPropertyDescriptors,WW=Object.getOwnPropertySymbols,XHe=Object.prototype.hasOwnProperty,eGe=Object.prototype.propertyIsEnumerable,HW=(t,e,r)=>e in t?JHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_8=(t,e)=>{for(var r in e||(e={}))XHe.call(e,r)&&HW(t,r,e[r]);if(WW)for(var r of WW(e))eGe.call(e,r)&&HW(t,r,e[r]);return t},C8=(t,e)=>QHe(t,ZHe(e));function u7(t){return C8(_8({},t),{level:(t==null?void 0:t.level)||qHe.level})}function tGe(t,e=_v){return t[e]||""}function rGe(t,e,r=_v){return t[r]=e,t}function eo(t,e=_v){let r="";return typeof t.bindings>"u"?r=tGe(t,e):r=t.bindings().context||"",r}function nGe(t,e,r=_v){const n=eo(t,r);return n.trim()?`${n}/${e}`:e}function ws(t,e,r=_v){const n=nGe(t,e,r),i=t.child({context:n});return rGe(i,n,r)}function iGe(t){var e,r;const n=new YHe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:Ev(C8(_8({},t.opts),{level:"trace",browser:C8(_8({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function aGe(t){var e;const r=new KHe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:Ev(C8(_8({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function sGe(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?iGe(t):aGe(t)}let oGe=class extends j1{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},lGe=class extends j1{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},cGe=class{constructor(e,r){this.logger=e,this.core=r}},uGe=class extends j1{constructor(e,r){super(),this.relayer=e,this.logger=r}},dGe=class extends j1{constructor(e){super()}},fGe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},hGe=class extends j1{constructor(e,r){super(),this.relayer=e,this.logger=r}},pGe=class extends j1{constructor(e,r){super(),this.core=e,this.logger=r}},gGe=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},mGe=class{constructor(e,r){this.projectId=e,this.logger=r}},yGe=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},wGe=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},vGe=class{constructor(e){this.client=e}};const bGe="PARSE_ERROR",xGe="INVALID_REQUEST",EGe="METHOD_NOT_FOUND",_Ge="INVALID_PARAMS",Wie="INTERNAL_ERROR",Oj="SERVER_ERROR",CGe=[-32700,-32600,-32601,-32602,-32603],Gy={[bGe]:{code:-32700,message:"Parse error"},[xGe]:{code:-32600,message:"Invalid Request"},[EGe]:{code:-32601,message:"Method not found"},[_Ge]:{code:-32602,message:"Invalid params"},[Wie]:{code:-32603,message:"Internal error"},[Oj]:{code:-32e3,message:"Server error"}},Hie=Oj;function SGe(t){return CGe.includes(t)}function GW(t){return Object.keys(Gy).includes(t)?Gy[t]:Gy[Hie]}function AGe(t){const e=Object.values(Gy).find(r=>r.code===t);return e||Gy[Hie]}function Gie(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var qie={};/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var AT=function(t,e){return AT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},AT(t,e)};function IGe(t,e){AT(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var IT=function(){return IT=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;o--)(s=t[o])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function kGe(t,e){return function(r,n){e(r,n,t)}}function NGe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function LGe(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})}function jGe(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[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 Vie(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a}function RGe(){for(var t=[],e=0;e1||o(h,g)})})}function o(h,g){try{l(n[h](g))}catch(m){f(a[0][3],m)}}function l(h){h.value instanceof o3?Promise.resolve(h.value.v).then(c,u):f(a[0][2],h)}function c(h){o("next",h)}function u(h){o("throw",h)}function f(h,g){h(g),a.shift(),a.length&&o(a[0][0],a[0][1])}}function FGe(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,a){e[i]=t[i]?function(s){return(r=!r)?{value:o3(t[i](s)),done:i==="return"}:a?a(s):s}:a}}function UGe(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 MT=="function"?MT(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(s){return new Promise(function(o,l){s=t[a](s),i(o,l,s.done,s.value)})}}function i(a,s,o,l){Promise.resolve(l).then(function(c){a({value:c,done:o})},s)}}function BGe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function zGe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function WGe(t){return t&&t.__esModule?t:{default:t}}function HGe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function GGe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const qGe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return IT},__asyncDelegator:FGe,__asyncGenerator:OGe,__asyncValues:UGe,__await:o3,__awaiter:LGe,__classPrivateFieldGet:HGe,__classPrivateFieldSet:GGe,__createBinding:$Ge,__decorate:TGe,__exportStar:PGe,__extends:IGe,__generator:jGe,__importDefault:WGe,__importStar:zGe,__makeTemplateObject:BGe,__metadata:NGe,__param:kGe,__read:Vie,__rest:MGe,__spread:RGe,__spreadArrays:DGe,__values:MT},Symbol.toStringTag,{value:"Module"})),VGe=yh(qGe);var nd={},qW;function YGe(){if(qW)return nd;qW=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.isBrowserCryptoAvailable=nd.getSubtleCrypto=nd.getBrowerCrypto=void 0;function t(){return(Xt==null?void 0:Xt.crypto)||(Xt==null?void 0:Xt.msCrypto)||{}}nd.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}nd.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return nd.isBrowserCryptoAvailable=r,nd}var id={},VW;function KGe(){if(VW)return id;VW=1,Object.defineProperty(id,"__esModule",{value:!0}),id.isBrowser=id.isNode=id.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}id.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}id.isNode=e;function r(){return!t()&&!e()}return id.isBrowser=r,id}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=VGe;e.__exportStar(YGe(),t),e.__exportStar(KGe(),t)})(qie);function fd(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function S0(t=6){return BigInt(fd(t))}function Wf(t,e,r){return{id:r||fd(),jsonrpc:"2.0",method:t,params:e}}function d7(t,e){return{id:t,jsonrpc:"2.0",result:e}}function f7(t,e,r){return{id:t,jsonrpc:"2.0",error:JGe(e)}}function JGe(t,e){return typeof t>"u"?GW(Wie):(typeof t=="string"&&(t=Object.assign(Object.assign({},GW(Oj)),{message:t})),SGe(t.code)&&(t=AGe(t.code)),t)}let QGe=class{},ZGe=class extends QGe{constructor(){super()}},XGe=class extends ZGe{constructor(e){super()}};const eqe="^https?:",tqe="^wss?:";function rqe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Yie(t,e){const r=rqe(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function YW(t){return Yie(t,eqe)}function KW(t){return Yie(t,tqe)}function nqe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Kie(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function Fj(t){return Kie(t)&&"method"in t}function h7(t){return Kie(t)&&(Jc(t)||sl(t))}function Jc(t){return"result"in t}function sl(t){return"error"in t}let kl=class extends XGe{constructor(e){super(e),this.events=new ys.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(Wf(e.method,e.params||[],e.id||S0().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(a){i(a)}this.events.on(`${e.id}`,a=>{sl(a)?i(a.error):n(a.result)});try{await this.connection.send(e,r)}catch(a){i(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),h7(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const iqe=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),aqe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",JW=t=>t.split("?")[0],QW=10,sqe=iqe();let oqe=class{constructor(e){if(this.url=e,this.events=new ys.EventEmitter,this.registering=!1,!KW(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Kd(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!KW(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=qie.isReactNative()?void 0:{rejectUnauthorized:!nqe(e)},a=new sqe(e,[],i);aqe()?a.onerror=s=>{const o=s;n(this.emitError(o.error))}:a.on("error",s=>{n(this.emitError(s))}),a.onopen=()=>{this.onOpen(a),r(a)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?o1(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),a=f7(e,i);this.events.emit("payload",a)}parseError(e,r=this.url){return Gie(e,JW(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>QW&&this.events.setMaxListeners(QW)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${JW(this.url)}`));return this.events.emit("register_error",r),r}};var S8={exports:{}};S8.exports;(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,o="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",h="[object Error]",g="[object Function]",m="[object GeneratorFunction]",w="[object Map]",C="[object Number]",v="[object Null]",b="[object Object]",A="[object Promise]",S="[object Proxy]",j="[object RegExp]",U="[object Set]",I="[object String]",B="[object Symbol]",V="[object Undefined]",se="[object WeakMap]",Y="[object ArrayBuffer]",N="[object DataView]",k="[object Float32Array]",x="[object Float64Array]",_="[object Int8Array]",L="[object Int16Array]",O="[object Int32Array]",P="[object Uint8Array]",R="[object Uint8ClampedArray]",M="[object Uint16Array]",D="[object Uint32Array]",$=/[\\^$.*+?()[\]{}|]/g,X=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,H={};H[k]=H[x]=H[_]=H[L]=H[O]=H[P]=H[R]=H[M]=H[D]=!0,H[o]=H[l]=H[Y]=H[u]=H[N]=H[f]=H[h]=H[g]=H[w]=H[C]=H[b]=H[j]=H[U]=H[I]=H[se]=!1;var ee=typeof Xt=="object"&&Xt&&Xt.Object===Object&&Xt,J=typeof self=="object"&&self&&self.Object===Object&&self,te=ee||J||Function("return this")(),re=e&&!e.nodeType&&e,z=re&&!0&&t&&!t.nodeType&&t,G=z&&z.exports===re,Q=G&&ee.process,me=function(){try{return Q&&Q.binding&&Q.binding("util")}catch{}}(),be=me&&me.isTypedArray;function Ce(ge,Te){for(var Xe=-1,It=ge==null?0:ge.length,yn=0,gr=[];++Xe-1}function ue(ge,Te){var Xe=this.__data__,It=Lc(Xe,ge);return It<0?(++this.size,Xe.push([ge,Te])):Xe[It][1]=Te,this}cr.prototype.clear=br,cr.prototype.delete=Z,cr.prototype.get=ae,cr.prototype.has=de,cr.prototype.set=ue;function ve(ge){var Te=-1,Xe=ge==null?0:ge.length;for(this.clear();++Teyi))return!1;var wn=gr.get(ge);if(wn&&gr.get(Te))return wn==Te;var ci=-1,xs=!0,wi=Xe&a?new Lt:void 0;for(gr.set(ge,Te),gr.set(Te,ge);++ci-1&&ge%1==0&&ge-1&&ge%1==0&&ge<=s}function ab(ge){var Te=typeof ge;return ge!=null&&(Te=="object"||Te=="function")}function Bh(ge){return ge!=null&&typeof ge=="object"}var sb=be?lt(be):Vv;function _E(ge){return xE(ge)?to(ge):Yv(ge)}function mn(){return[]}function fn(){return!1}t.exports=EE})(S8,S8.exports);var lqe=S8.exports;const cqe=Lo(lqe),Jie="wc",Qie=2,A8="core",Tu=`${Jie}@2:${A8}:`,uqe={name:A8,logger:"error"},dqe={database:":memory:"},fqe="crypto",ZW="client_ed25519_seed",hqe=ct.ONE_DAY,pqe="keychain",gqe="0.3",mqe="messages",yqe="0.3",XW=ct.SIX_HOURS,wqe="publisher",Zie="irn",vqe="error",Xie="wss://relay.walletconnect.org",bqe="relayer",Zi={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},xqe="_subscription",el={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},Eqe=.1,TT="2.17.3",Cn={link_mode:"link_mode",relay:"relay"},_qe="0.3",Cqe="WALLETCONNECT_CLIENT_ID",eH="WALLETCONNECT_LINK_MODE_APPS",uo={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},Sqe="subscription",Aqe="0.3",Iqe=ct.FIVE_SECONDS*1e3,Mqe="pairing",Tqe="0.3",K2={wc_pairingDelete:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ct.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ct.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:0},res:{ttl:ct.ONE_DAY,prompt:!1,tag:0}}},m0={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},zl={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},kqe="history",Nqe="0.3",Lqe="expirer",il={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},jqe="0.3",$qe="verify-api",Pqe="https://verify.walletconnect.com",eae="https://verify.walletconnect.org",qy=eae,Rqe=`${qy}/v3`,Dqe=[Pqe,eae],Oqe="echo",Fqe="https://echo.walletconnect.com",Gc={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},od={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Wl={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},t0={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},r0={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},J2={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},Uqe=.1,Bqe="event-client",zqe=86400,Wqe="https://pulse.walletconnect.org/batch";function Hqe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,S=new Uint8Array(A);v!==b;){for(var j=m[v],U=0,I=A-1;(j!==0||U>>0,S[I]=j%o>>>0,j=j/o>>>0;if(j!==0)throw new Error("Non-zero carry");C=U,v++}for(var B=A-C;B!==A&&S[B]===0;)B++;for(var V=l.repeat(w);B>>0,A=new Uint8Array(b);m[w];){var S=r[m.charCodeAt(w)];if(S===255)return;for(var j=0,U=b-1;(S!==0||j>>0,A[U]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");v=j,w++}if(m[w]!==" "){for(var I=b-v;I!==b&&A[I]===0;)I++;for(var B=new Uint8Array(C+(b-I)),V=C;I!==b;)B[V++]=A[I++];return B}}}function g(m){var w=h(m);if(w)return w;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:g}}var Gqe=Hqe,qqe=Gqe;const tae=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Vqe=t=>new TextEncoder().encode(t),Yqe=t=>new TextDecoder().decode(t);class Kqe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Jqe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return rae(this,e)}}class Qqe{constructor(e){this.decoders=e}or(e){return rae(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const rae=(t,e)=>new Qqe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Zqe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Kqe(e,r,n),this.decoder=new Jqe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const p7=({name:t,prefix:e,encode:r,decode:n})=>new Zqe(t,e,r,n),Cv=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=qqe(r,e);return p7({prefix:t,name:e,encode:n,decode:a=>tae(i(a))})},Xqe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(o-=8,s[c++]=255&l>>o)}if(o>=r||255&l<<8-o)throw new SyntaxError("Unexpected end of data");return s},eVe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)s-=r,a+=e[i&o>>s];if(s&&(a+=e[i&o<p7({prefix:e,name:t,encode(i){return eVe(i,n,r)},decode(i){return Xqe(i,n,r,t)}}),tVe=p7({prefix:"\0",name:"identity",encode:t=>Yqe(t),decode:t=>Vqe(t)});var rVe=Object.freeze({__proto__:null,identity:tVe});const nVe=_a({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var iVe=Object.freeze({__proto__:null,base2:nVe});const aVe=_a({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var sVe=Object.freeze({__proto__:null,base8:aVe});const oVe=Cv({prefix:"9",name:"base10",alphabet:"0123456789"});var lVe=Object.freeze({__proto__:null,base10:oVe});const cVe=_a({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),uVe=_a({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var dVe=Object.freeze({__proto__:null,base16:cVe,base16upper:uVe});const fVe=_a({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),hVe=_a({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),pVe=_a({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),gVe=_a({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),mVe=_a({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),yVe=_a({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),wVe=_a({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),vVe=_a({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),bVe=_a({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var xVe=Object.freeze({__proto__:null,base32:fVe,base32upper:hVe,base32pad:pVe,base32padupper:gVe,base32hex:mVe,base32hexupper:yVe,base32hexpad:wVe,base32hexpadupper:vVe,base32z:bVe});const EVe=Cv({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),_Ve=Cv({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var CVe=Object.freeze({__proto__:null,base36:EVe,base36upper:_Ve});const SVe=Cv({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),AVe=Cv({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var IVe=Object.freeze({__proto__:null,base58btc:SVe,base58flickr:AVe});const MVe=_a({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),TVe=_a({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),kVe=_a({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),NVe=_a({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var LVe=Object.freeze({__proto__:null,base64:MVe,base64pad:TVe,base64url:kVe,base64urlpad:NVe});const nae=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),jVe=nae.reduce((t,e,r)=>(t[r]=e,t),[]),$Ve=nae.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function PVe(t){return t.reduce((e,r)=>(e+=jVe[r],e),"")}function RVe(t){const e=[];for(const r of t){const n=$Ve[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const DVe=p7({prefix:"🚀",name:"base256emoji",encode:PVe,decode:RVe});var OVe=Object.freeze({__proto__:null,base256emoji:DVe}),FVe=iae,tH=128,UVe=127,BVe=~UVe,zVe=Math.pow(2,31);function iae(t,e,r){e=e||[],r=r||0;for(var n=r;t>=zVe;)e[r++]=t&255|tH,t/=128;for(;t&BVe;)e[r++]=t&255|tH,t>>>=7;return e[r]=t|0,iae.bytes=r-n+1,e}var WVe=kT,HVe=128,rH=127;function kT(t,n){var r=0,n=n||0,i=0,a=n,s,o=t.length;do{if(a>=o)throw kT.bytes=0,new RangeError("Could not decode varint");s=t[a++],r+=i<28?(s&rH)<=HVe);return kT.bytes=a-n,r}var GVe=Math.pow(2,7),qVe=Math.pow(2,14),VVe=Math.pow(2,21),YVe=Math.pow(2,28),KVe=Math.pow(2,35),JVe=Math.pow(2,42),QVe=Math.pow(2,49),ZVe=Math.pow(2,56),XVe=Math.pow(2,63),eYe=function(t){return t(aae.encode(t,e,r),e),iH=t=>aae.encodingLength(t),NT=(t,e)=>{const r=e.byteLength,n=iH(t),i=n+iH(r),a=new Uint8Array(i+r);return nH(t,a,0),nH(r,a,n),a.set(e,i),new rYe(t,r,e,a)};let rYe=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};const sae=({name:t,code:e,encode:r})=>new nYe(t,e,r);let nYe=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?NT(this.code,r):r.then(n=>NT(this.code,n))}else throw Error("Unknown type, must be binary type")}};const oae=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),iYe=sae({name:"sha2-256",code:18,encode:oae("SHA-256")}),aYe=sae({name:"sha2-512",code:19,encode:oae("SHA-512")});var sYe=Object.freeze({__proto__:null,sha256:iYe,sha512:aYe});const lae=0,oYe="identity",cae=tae,lYe=t=>NT(lae,cae(t)),cYe={code:lae,name:oYe,encode:cae,digest:lYe};var uYe=Object.freeze({__proto__:null,identity:cYe});new TextEncoder,new TextDecoder;const aH={...rVe,...iVe,...sVe,...lVe,...dVe,...xVe,...CVe,...IVe,...LVe,...OVe};({...sYe,...uYe});function dYe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function uae(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const sH=uae("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),RS=uae("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=dYe(t.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:a}=ht("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(a)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=ws(r,this.name)}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Cie(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Sie(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}};class gYe{constructor(e,r,n){this.core=e,this.logger=r,this.name=fqe,this.randomSessionIdentifier=_T(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),a=cW(i);return bie(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=rWe();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const a=await this.getClientSeed(),s=cW(a),o=this.randomSessionIdentifier;return await cze(o,i,hqe,s)},this.generateSharedKey=(i,a,s)=>{this.isInitialized();const o=this.getPrivateKey(i),l=nWe(o,a);return this.setSymKey(l,s)},this.setSymKey=async(i,a)=>{this.isInitialized();const s=a||q6(i);return await this.keychain.set(s,i),s},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,a,s)=>{this.isInitialized();const o=Pie(s),l=Kd(a);if(CW(o))return aWe(l,s==null?void 0:s.encoding);if(_W(o)){const h=o.senderPublicKey,g=o.receiverPublicKey;i=await this.generateSharedKey(h,g)}const c=this.getSymKey(i),{type:u,senderPublicKey:f}=o;return iWe({type:u,symKey:c,message:l,senderPublicKey:f,encoding:s==null?void 0:s.encoding})},this.decode=async(i,a,s)=>{this.isInitialized();const o=lWe(a,s);if(CW(o)){const l=oWe(a,s==null?void 0:s.encoding);return o1(l)}if(_W(o)){const l=o.receiverPublicKey,c=o.senderPublicKey;i=await this.generateSharedKey(l,c)}try{const l=this.getSymKey(i),c=sWe({symKey:l,encoded:a,encoding:s==null?void 0:s.encoding});return o1(c)}catch(l){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(l)}},this.getPayloadType=(i,a=zf)=>{const s=n3({encoded:i,encoding:a});return c1(s.type)},this.getPayloadSenderPublicKey=(i,a=zf)=>{const s=n3({encoded:i,encoding:a});return s.senderPublicKey?aa(s.senderPublicKey,cs):void 0},this.core=e,this.logger=ws(r,this.name),this.keychain=n||new pYe(this.core,this.logger)}get context(){return eo(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(ZW)}catch{e=_T(),await this.keychain.set(ZW,e)}return hYe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class mYe extends cGe{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=mqe,this.version=yqe,this.initialized=!1,this.storagePrefix=Tu,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const a=xd(i);let s=this.messages.get(n);return typeof s>"u"&&(s={}),typeof s[a]<"u"||(s[a]=i,this.messages.set(n,s),await this.persist()),a},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const a=this.get(n),s=xd(i);return typeof a[s]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=ws(e,this.name),this.core=r}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Cie(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Sie(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}var yYe=Object.defineProperty,wYe=Object.defineProperties,vYe=Object.getOwnPropertyDescriptors,oH=Object.getOwnPropertySymbols,bYe=Object.prototype.hasOwnProperty,xYe=Object.prototype.propertyIsEnumerable,lH=(t,e,r)=>e in t?yYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cH=(t,e)=>{for(var r in e||(e={}))bYe.call(e,r)&&lH(t,r,e[r]);if(oH)for(var r of oH(e))xYe.call(e,r)&&lH(t,r,e[r]);return t},uH=(t,e)=>wYe(t,vYe(e));class EYe extends uGe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new ys.EventEmitter,this.name=wqe,this.queue=new Map,this.publishTimeout=ct.toMiliseconds(ct.ONE_MINUTE),this.initialPublishTimeout=ct.toMiliseconds(ct.ONE_SECOND*15),this.needsTransportRestart=!1,this.publish=async(n,i,a)=>{var s;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}});const o=(a==null?void 0:a.ttl)||XW,l=x8(a),c=(a==null?void 0:a.prompt)||!1,u=(a==null?void 0:a.tag)||0,f=(a==null?void 0:a.id)||S0().toString(),h={topic:n,message:i,opts:{ttl:o,relay:l,prompt:c,tag:u,id:f,attestation:a==null?void 0:a.attestation}},g=`Failed to publish payload, please try again. id:${f} tag:${u}`;try{const m=new Promise(async w=>{const C=({id:b})=>{h.opts.id===b&&(this.removeRequestFromQueue(b),this.relayer.events.removeListener(Zi.publish,C),w(h))};this.relayer.events.on(Zi.publish,C);const v=Bf(new Promise((b,A)=>{this.rpcPublish({topic:n,message:i,ttl:o,prompt:c,tag:u,id:f,attestation:a==null?void 0:a.attestation}).then(b).catch(S=>{this.logger.warn(S,S==null?void 0:S.message),A(S)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${f} tag:${u}`);try{await v,this.events.removeListener(Zi.publish,C)}catch(b){this.queue.set(f,uH(cH({},h),{attempt:1})),this.logger.warn(b,b==null?void 0:b.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,topic:n,message:i,opts:a}}),await Bf(m,this.publishTimeout,g)}catch(m){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(m),(s=a==null?void 0:a.internal)!=null&&s.throwOnFailedPublish)throw m}finally{this.queue.delete(f)}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=ws(r,this.name),this.registerEventListeners()}get context(){return eo(this.logger)}async rpcPublish(e){var r,n,i,a;const{topic:s,message:o,ttl:l=XW,prompt:c,tag:u,id:f,attestation:h}=e,g={method:yy(x8().protocol).publish,params:{topic:s,message:o,ttl:l,prompt:c,tag:u,attestation:h},id:f};Os((r=g.params)==null?void 0:r.prompt)&&((n=g.params)==null||delete n.prompt),Os((i=g.params)==null?void 0:i.tag)&&((a=g.params)==null||delete a.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:g});const m=await this.relayer.request(g);return this.relayer.events.emit(Zi.publish,e),this.logger.debug("Successfully Published Payload"),m}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,r)=>{const n=e.attempt+1;this.queue.set(r,uH(cH({},e),{attempt:n}));const{topic:i,message:a,opts:s,attestation:o}=e;this.logger.warn({},`Publisher: queue->publishing: ${e.opts.id}, tag: ${e.opts.tag}, attempt: ${n}`),await this.rpcPublish({topic:i,message:a,ttl:s.ttl,prompt:s.prompt,tag:s.tag,id:s.id,attestation:o}),this.logger.warn({},`Publisher: queue->published: ${e.opts.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(qm.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Zi.connection_stalled);return}this.checkQueue()}),this.relayer.on(Zi.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class _Ye{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(a=>a!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var CYe=Object.defineProperty,SYe=Object.defineProperties,AYe=Object.getOwnPropertyDescriptors,dH=Object.getOwnPropertySymbols,IYe=Object.prototype.hasOwnProperty,MYe=Object.prototype.propertyIsEnumerable,fH=(t,e,r)=>e in t?CYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Q2=(t,e)=>{for(var r in e||(e={}))IYe.call(e,r)&&fH(t,r,e[r]);if(dH)for(var r of dH(e))MYe.call(e,r)&&fH(t,r,e[r]);return t},DS=(t,e)=>SYe(t,AYe(e));class TYe extends hGe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new _Ye,this.events=new ys.EventEmitter,this.name=Sqe,this.version=Aqe,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Tu,this.subscribeTimeout=ct.toMiliseconds(ct.ONE_MINUTE),this.initialSubscribeTimeout=ct.toMiliseconds(ct.ONE_SECOND*15),this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const a=x8(i),s={topic:n,relay:a,transportType:i==null?void 0:i.transportType};this.pending.set(n,s);const o=await this.rpcSubscribe(n,a,i);return typeof o=="string"&&(this.onSubscribe(o,s),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),o}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((a,s)=>{const o=new ct.Watch;o.start(i);const l=setInterval(()=>{(!this.pending.has(n)&&this.topics.includes(n)||this.cached.some(c=>c.topic===n))&&(clearInterval(l),o.stop(i),a(!0)),o.elapsed(i)>=Iqe&&(clearInterval(l),o.stop(i),s(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{await this.restore(),await this.onRestart()},this.checkPending=async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;const n=[];this.pending.forEach(i=>{n.push(i)}),await this.batchSubscribe(n)},this.registerEventListeners=()=>{this.relayer.core.heartbeat.on(qm.pulse,async()=>{await this.checkPending()}),this.events.on(uo.created,async n=>{const i=uo.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()}),this.events.on(uo.deleted,async n=>{const i=uo.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()})},this.relayer=e,this.logger=ws(r,this.name),this.clientId=""}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=x8(n);await this.rpcUnsubscribe(e,r,i);const a=ln("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r,n){var i;(n==null?void 0:n.transportType)===Cn.relay&&await this.restartToComplete();const a={method:yy(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:a});const s=(i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish;try{const o=this.getSubscriptionId(e);if((n==null?void 0:n.transportType)===Cn.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(a).catch(u=>this.logger.warn(u))},ct.toMiliseconds(ct.ONE_SECOND)),o;const l=new Promise(async u=>{const f=h=>{h.topic===e&&(this.events.removeListener(uo.created,f),u(h.id))};this.events.on(uo.created,f);try{const h=await Bf(new Promise((g,m)=>{this.relayer.request(a).catch(w=>{this.logger.warn(w,w==null?void 0:w.message),m(w)}).then(g)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(uo.created,f),u(h)}catch{}}),c=await Bf(l,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!c&&s)throw new Error(`Subscribing to ${e} failed, please try again`);return c?o:null}catch(o){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Zi.connection_stalled),s)throw o}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:yy(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Bf(new Promise(i=>{this.relayer.request(n).catch(a=>this.logger.warn(a)).then(i)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(Zi.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:yy(r.protocol).batchFetchMessages,params:{topics:e.map(a=>a.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await Bf(new Promise((a,s)=>{this.relayer.request(n).catch(o=>{this.logger.warn(o),s(o)}).then(a)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(Zi.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:yy(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,DS(Q2({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Q2({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,Q2({},r)),this.topicMap.set(r.topic,e),this.events.emit(uo.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(uo.deleted,DS(Q2({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(uo.sync)}async onRestart(){if(this.cached.length){const e=[...this.cached],r=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(e.map(r=>DS(Q2({},r),{id:this.getSubscriptionId(r.topic)}))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(await Nze(ct.toMiliseconds(ct.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(r.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen()}getSubscriptionId(e){return xd(e+this.clientId)}}var kYe=Object.defineProperty,hH=Object.getOwnPropertySymbols,NYe=Object.prototype.hasOwnProperty,LYe=Object.prototype.propertyIsEnumerable,pH=(t,e,r)=>e in t?kYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gH=(t,e)=>{for(var r in e||(e={}))NYe.call(e,r)&&pH(t,r,e[r]);if(hH)for(var r of hH(e))LYe.call(e,r)&&pH(t,r,e[r]);return t};class jYe extends dGe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new ys.EventEmitter,this.name=bqe,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1,this.heartBeatTimeout=ct.toMiliseconds(ct.THIRTY_SECONDS+ct.FIVE_SECONDS),this.requestsInFlight=[],this.connectTimeout=ct.toMiliseconds(ct.ONE_SECOND*15),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const a=r.id||S0().toString();await this.toEstablishConnection();try{this.logger.trace({id:a,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - publishing...");const s=`${a}:${((i=r.params)==null?void 0:i.tag)||""}`;this.requestsInFlight.push(s);const o=await this.provider.request(r);return this.requestsInFlight=this.requestsInFlight.filter(l=>l!==s),o}catch(s){throw this.logger.debug(`Failed to Publish Request: ${a}`),s}},this.resetPingTimeout=()=>{if(v8())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i;this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r,r==null?void 0:r.message)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.warn({},"Relayer connected 🛜"),this.startPingTimeout(),this.events.emit(Zi.connect)},this.onDisconnectHandler=()=>{this.logger.warn({},"Relayer disconnected 🛑"),this.requestsInFlight=[],this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.fatal(r,`Fatal socket error: ${r==null?void 0:r.message}`),this.events.emit(Zi.error,r),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(el.payload,this.onPayloadHandler),this.provider.on(el.connect,this.onConnectHandler),this.provider.on(el.disconnect,this.onDisconnectHandler),this.provider.on(el.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?ws(e.logger,this.name):Ev(u7({level:e.logger||vqe})),this.messages=new mYe(this.logger,e.core),this.subscriber=new TYe(this,this.logger),this.publisher=new EYe(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||Xie,this.projectId=e.projectId,wze()?this.packageName=pW():vze()&&(this.bundleId=pW()),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e,e==null?void 0:e.message)}}get context(){return eo(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now(),transportType:Cn.relay})}async subscribe(e,r){var n,i,a;this.isInitialized(),(!(r!=null&&r.transportType)||(r==null?void 0:r.transportType)==="relay")&&await this.toEstablishConnection();const s=typeof((n=r==null?void 0:r.internal)==null?void 0:n.throwOnFailedPublish)>"u"?!0:(i=r==null?void 0:r.internal)==null?void 0:i.throwOnFailedPublish;let o=((a=this.subscriber.topicMap.get(e))==null?void 0:a[0])||"",l;const c=u=>{u.topic===e&&(this.subscriber.off(uo.created,c),l())};return await Promise.all([new Promise(u=>{l=u,this.subscriber.on(uo.created,c)}),new Promise(async(u,f)=>{o=await this.subscriber.subscribe(e,gH({internal:{throwOnFailedPublish:s}},r)).catch(h=>{s&&f(h)})||o,u()})]),o}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Bf(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(r,n)=>{await this.connect(e).then(r).catch(n).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await PW())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.debug(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i,"Error while processing batch message event: "+(i==null?void 0:i.message))}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(e,r){const{topic:n}=e;if(!r.sessionExists){const i=Li(ct.FIVE_MINUTES),a={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,a)}this.events.emit(Zi.message,e),await this.recordMessageEvent(e)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let r=1;for(;r<6;){try{this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${r}...`),await this.createProvider(),await new Promise(async(n,i)=>{const a=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(el.disconnect,a),await Bf(new Promise((s,o)=>{this.provider.connect().then(s).catch(o)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(s=>{i(s)}).finally(()=>{this.provider.off(el.disconnect,a),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),await new Promise(async(s,o)=>{const l=()=>{o(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(el.disconnect,l),await this.subscriber.start().then(s).catch(o).finally(()=>{this.provider.off(el.disconnect,l)})}),this.hasExperiencedNetworkDisruption=!1,n()})}catch(n){await this.subscriber.stop();const i=n;this.logger.warn({},i.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${r}`);break}await new Promise(n=>setTimeout(n,ct.toMiliseconds(r*1))),r++}}startPingTimeout(){var e,r,n,i,a;if(v8())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((a=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||a.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(s){this.logger.warn(s,s==null?void 0:s.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new kl(new oqe(_ze({sdkVersion:TT,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.warn(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.warn(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Fj(e)){if(!e.method.endsWith(xqe))return;const r=e.params,{topic:n,message:i,publishedAt:a,attestation:s}=r.data,o={topic:n,message:i,publishedAt:a,transportType:Cn.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(gH({type:"event",event:r.id},o)),this.events.emit(r.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else h7(e)&&this.events.emit(Zi.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Zi.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=d7(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(el.payload,this.onPayloadHandler),this.provider.off(el.connect,this.onConnectHandler),this.provider.off(el.disconnect,this.onDisconnectHandler),this.provider.off(el.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await PW();tHe(async r=>{e!==r&&(e=r,r?await this.transportOpen().catch(n=>this.logger.error(n,n==null?void 0:n.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),clearTimeout(this.pingTimeout),this.events.emit(Zi.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||this.connectPromise||(this.reconnectTimeout=setTimeout(async()=>{clearTimeout(this.reconnectTimeout),await this.transportOpen().catch(e=>this.logger.error(e,e==null?void 0:e.message))},ct.toMiliseconds(Eqe))))}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&await this.transportOpen()}}var $Ye=Object.defineProperty,mH=Object.getOwnPropertySymbols,PYe=Object.prototype.hasOwnProperty,RYe=Object.prototype.propertyIsEnumerable,yH=(t,e,r)=>e in t?$Ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wH=(t,e)=>{for(var r in e||(e={}))PYe.call(e,r)&&yH(t,r,e[r]);if(mH)for(var r of mH(e))RYe.call(e,r)&&yH(t,r,e[r]);return t};class P1 extends fGe{constructor(e,r,n,i=Tu,a=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=_qe,this.cached=[],this.initialized=!1,this.storagePrefix=Tu,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>{this.getKey&&s!==null&&!Os(s)?this.map.set(this.getKey(s),s):LWe(s)?this.map.set(s.id,s):jWe(s)&&this.map.set(s.topic,s)}),this.cached=[],this.initialized=!0)},this.set=async(s,o)=>{this.isInitialized(),this.map.has(s)?await this.update(s,o):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:s,value:o}),this.map.set(s,o),await this.persist())},this.get=s=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:s}),this.getData(s)),this.getAll=s=>(this.isInitialized(),s?this.values.filter(o=>Object.keys(s).every(l=>cqe(o[l],s[l]))):this.values),this.update=async(s,o)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:s,update:o});const l=wH(wH({},this.getData(s)),o);this.map.set(s,l),await this.persist()},this.delete=async(s,o)=>{this.isInitialized(),this.map.has(s)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:s,reason:o}),this.map.delete(s),this.addToRecentlyDeleted(s),await this.persist())},this.logger=ws(r,this.name),this.storagePrefix=i,this.getKey=a}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=ht("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class DYe{constructor(e,r){this.core=e,this.logger=r,this.name=Mqe,this.version=Tqe,this.events=new $L,this.initialized=!1,this.storagePrefix=Tu,this.ignoredPayloadTypes=[Ld],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();const i=_T(),a=await this.core.crypto.setSymKey(i),s=Li(ct.FIVE_MINUTES),o={protocol:Zie},l={topic:a,expiry:s,relay:o,active:!1,methods:n==null?void 0:n.methods},c=TW({protocol:this.core.protocol,version:this.core.version,topic:a,symKey:i,relay:o,expiryTimestamp:s,methods:n==null?void 0:n.methods});return this.events.emit(m0.create,l),this.core.expirer.set(a,s),await this.pairings.set(a,l),await this.core.relayer.subscribe(a,{transportType:n==null?void 0:n.transportType}),{topic:a,uri:c}},this.pair=async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[Gc.pairing_started]}});this.isValidPair(n,i);const{topic:a,symKey:s,relay:o,expiryTimestamp:l,methods:c}=MW(n.uri);i.props.properties.topic=a,i.addTrace(Gc.pairing_uri_validation_success),i.addTrace(Gc.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(a)){if(u=this.pairings.get(a),i.addTrace(Gc.existing_pairing),u.active)throw i.setError(od.active_pairing_already_exists),new Error(`Pairing already exists: ${a}. Please try again with a new connection URI.`);i.addTrace(Gc.pairing_not_expired)}const f=l||Li(ct.FIVE_MINUTES),h={topic:a,relay:o,expiry:f,active:!1,methods:c};this.core.expirer.set(a,f),await this.pairings.set(a,h),i.addTrace(Gc.store_new_pairing),n.activatePairing&&await this.activate({topic:a}),this.events.emit(m0.create,h),i.addTrace(Gc.emit_inactive_pairing),this.core.crypto.keychain.has(a)||await this.core.crypto.setSymKey(s,a),i.addTrace(Gc.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(od.no_internet_connection)}try{await this.core.relayer.subscribe(a,{relay:o})}catch(g){throw i.setError(od.subscribe_pairing_topic_failure),g}return i.addTrace(Gc.subscribe_pairing_topic_success),h},this.activate=async({topic:n})=>{this.isInitialized();const i=Li(ct.THIRTY_DAYS);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const a=await this.sendRequest(i,"wc_pairingPing",{}),{done:s,resolve:o,reject:l}=l0();this.events.once(jr("pairing_ping",a),({error:c})=>{c?l(c):o()}),await s()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",ln("USER_DISCONNECTED")),await this.deletePairing(i))},this.formatUriFromPairing=n=>{this.isInitialized();const{topic:i,relay:a,expiry:s,methods:o}=n,l=this.core.crypto.keychain.get(i);return TW({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:l,relay:a,expiryTimestamp:s,methods:o})},this.sendRequest=async(n,i,a)=>{const s=Wf(i,a),o=await this.core.crypto.encode(n,s),l=K2[i].req;return this.core.history.set(n,s),this.core.relayer.publish(n,o,l),s.id},this.sendResult=async(n,i,a)=>{const s=d7(n,a),o=await this.core.crypto.encode(i,s),l=await this.core.history.get(i,n),c=K2[l.request.method].res;await this.core.relayer.publish(i,o,c),await this.core.history.resolve(s)},this.sendError=async(n,i,a)=>{const s=f7(n,a),o=await this.core.crypto.encode(i,s),l=await this.core.history.get(i,n),c=K2[l.request.method]?K2[l.request.method].res:K2.unregistered_method.res;await this.core.relayer.publish(i,o,c),await this.core.history.resolve(s)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,ln("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>kf(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:a}=n;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(i,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,a);default:return this.onUnknownRpcMethodRequest(i,a)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:a}=n,s=(await this.core.history.get(i,a.id)).request.method;switch(s){case"wc_pairingPing":return this.onPairingPingResponse(i,a);default:return this.onUnknownRpcMethodResponse(s)}},this.onPairingPingRequest=async(n,i)=>{const{id:a}=i;try{this.isValidPing({topic:n}),await this.sendResult(a,n,!0),this.events.emit(m0.ping,{id:a,topic:n})}catch(s){await this.sendError(a,n,s),this.logger.error(s)}},this.onPairingPingResponse=(n,i)=>{const{id:a}=i;setTimeout(()=>{Jc(i)?this.events.emit(jr("pairing_ping",a),{}):sl(i)&&this.events.emit(jr("pairing_ping",a),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:a}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(m0.delete,{id:a,topic:n})}catch(s){await this.sendError(a,n,s),this.logger.error(s)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:a,method:s}=i;try{if(this.registeredMethods.includes(s))return;const o=ln("WC_METHOD_UNSUPPORTED",s);await this.sendError(a,n,o),this.logger.error(o)}catch(o){await this.sendError(a,n,o),this.logger.error(o)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(ln("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var a;if(!Ls(n)){const{message:o}=ht("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(od.malformed_pairing_uri),new Error(o)}if(!NWe(n.uri)){const{message:o}=ht("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(od.malformed_pairing_uri),new Error(o)}const s=MW(n==null?void 0:n.uri);if(!((a=s==null?void 0:s.relay)!=null&&a.protocol)){const{message:o}=ht("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(od.malformed_pairing_uri),new Error(o)}if(!(s!=null&&s.symKey)){const{message:o}=ht("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(od.malformed_pairing_uri),new Error(o)}if(s!=null&&s.expiryTimestamp&&ct.toMiliseconds(s==null?void 0:s.expiryTimestamp){if(!Ls(n)){const{message:a}=ht("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Ls(n)){const{message:a}=ht("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!pi(n,!1)){const{message:i}=ht("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=ht("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(kf(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=ht("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=ws(r,this.name),this.pairings=new P1(this.core,this.logger,this.name,this.storagePrefix)}get context(){return eo(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Zi.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===Cn.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const a=await this.core.crypto.decode(r,n);try{Fj(a)?(this.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a})):h7(a)&&(await this.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a}),this.core.history.delete(r,a.id))}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(il.expired,async e=>{const{topic:r}=Iie(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(m0.expire,{topic:r}))})}}class OYe extends lGe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new ys.EventEmitter,this.name=kqe,this.version=Nqe,this.cached=[],this.initialized=!1,this.storagePrefix=Tu,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:a}),this.records.has(i.id))return;const s={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:a,expiry:Li(ct.THIRTY_DAYS)};this.records.set(s.id,s),this.persist(),this.events.emit(zl.created,s)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=sl(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(zl.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(a=>{if(a.topic===n){if(typeof i<"u"&&a.id!==i)return;this.records.delete(a.id),this.events.emit(zl.deleted,a)}}),this.persist()},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=ws(r,this.name)}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:Wf(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(zl.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(zl.created,e=>{const r=zl.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(zl.updated,e=>{const r=zl.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(zl.deleted,e=>{const r=zl.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(qm.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{ct.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(zl.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class FYe extends pGe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new ys.EventEmitter,this.name=Lqe,this.version=jqe,this.cached=[],this.initialized=!1,this.storagePrefix=Tu,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const a=this.formatTarget(n),s={target:a,expiry:i};this.expirations.set(a,s),this.checkExpiry(a,s),this.events.emit(il.created,{target:a,expiration:s})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),a=this.getExpiration(i);this.expirations.delete(i),this.events.emit(il.deleted,{target:i,expiration:a})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=ws(r,this.name)}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return Cze(e);if(typeof e=="number")return Sze(e);const{message:r}=ht("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(il.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;ct.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(il.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(qm.pulse,()=>this.checkExpirations()),this.events.on(il.created,e=>{const r=il.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(il.expired,e=>{const r=il.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(il.deleted,e=>{const r=il.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class UYe extends gGe{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=$qe,this.verifyUrlV3=Rqe,this.storagePrefix=Tu,this.version=Qie,this.init=async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&ct.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt){if(!yv()||this.isDevEnv)return;const a=window.location.origin,{id:s,decryptedId:o}=i,l=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${a}&id=${s}&decryptedId=${o}`;try{const c=dv(),u=this.startAbortTimer(ct.ONE_SECOND*5),f=await new Promise((h,g)=>{const m=()=>{window.removeEventListener("message",C),c.body.removeChild(w),g("attestation aborted")};this.abortController.signal.addEventListener("abort",m);const w=c.createElement("iframe");w.src=l,w.style.display="none",w.addEventListener("error",m,{signal:this.abortController.signal});const C=v=>{if(v.data&&typeof v.data=="string")try{const b=JSON.parse(v.data);if(b.type==="verify_attestation"){if(xT(b.attestation).payload.id!==s)return;clearInterval(u),c.body.removeChild(w),this.abortController.signal.removeEventListener("abort",m),window.removeEventListener("message",C),h(b.attestation===null?"":b.attestation)}}catch(b){this.logger.warn(b)}};c.body.appendChild(w),window.addEventListener("message",C,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",f),f}catch(c){this.logger.warn(c)}return""},this.resolve=async i=>{if(this.isDevEnv)return"";const{attestationId:a,hash:s,encryptedId:o}=i;if(a===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(a){if(xT(a).payload.id!==o)return;const c=await this.isValidJwtAttestation(a);if(c){if(!c.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return c}}if(!s)return;const l=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(s,l)},this.fetchAttestation=async(i,a)=>{this.logger.debug(`resolving attestation: ${i} from url: ${a}`);const s=this.startAbortTimer(ct.ONE_SECOND*5),o=await fetch(`${a}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(s),o.status===200?await o.json():void 0},this.getVerifyUrl=i=>{let a=i||qy;return Dqe.includes(a)||(this.logger.info(`verify url: ${a}, not included in trusted list, assigning default: ${qy}`),a=qy),a},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(ct.FIVE_SECONDS),a=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await a.json()}catch(i){this.logger.warn(i)}},this.persistPublicKey=async i=>{this.logger.debug("persisting public key to local storage",i),await this.store.setItem(this.storeKey,i),this.publicKey=i},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async i=>{const a=await this.getPublicKey();try{if(a)return this.validateAttestation(i,a)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}const s=await this.fetchAndPersistPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async a=>{const s=await this.fetchPublicKey();s&&(await this.persistPublicKey(s),a(s))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i},this.validateAttestation=(i,a)=>{const s=fWe(i,a.publicKey),o={hasExpired:ct.toMiliseconds(s.exp)this.abortController.abort(),ct.toMiliseconds(e))}}class BYe extends mGe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=Oqe,this.registerDeviceToken=async n=>{const{clientId:i,token:a,notificationType:s,enableEncrypted:o=!1}=n,l=`${Fqe}/${this.projectId}/clients`;await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:s,token:a,always_raw:o})})},this.logger=ws(r,this.context)}}var zYe=Object.defineProperty,vH=Object.getOwnPropertySymbols,WYe=Object.prototype.hasOwnProperty,HYe=Object.prototype.propertyIsEnumerable,bH=(t,e,r)=>e in t?zYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Z2=(t,e)=>{for(var r in e||(e={}))WYe.call(e,r)&&bH(t,r,e[r]);if(vH)for(var r of vH(e))HYe.call(e,r)&&bH(t,r,e[r]);return t};class GYe extends yGe{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=Bqe,this.storagePrefix=Tu,this.storageVersion=Uqe,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!Lj())try{const i={eventId:mW(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:_ie(this.core.relayer.protocol,this.core.relayer.version,TT)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}},this.createEvent=i=>{const{event:a="ERROR",type:s="",properties:{topic:o,trace:l}}=i,c=mW(),u=this.core.projectId||"",f=Date.now(),h=Z2({eventId:c,timestamp:f,props:{event:a,type:s,properties:{topic:o,trace:l}},bundleId:u,domain:this.getAppDomain()},this.setMethods(c));return this.telemetryEnabled&&(this.events.set(c,h),this.shouldPersist=!0),h},this.getEvent=i=>{const{eventId:a,topic:s}=i;if(a)return this.events.get(a);const o=Array.from(this.events.values()).find(l=>l.props.properties.topic===s);if(o)return Z2(Z2({},o),this.setMethods(o.eventId))},this.deleteEvent=i=>{const{eventId:a}=i;this.events.delete(a),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(qm.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{ct.fromMiliseconds(Date.now())-ct.fromMiliseconds(i.timestamp)>zqe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})},this.setMethods=i=>({addTrace:a=>this.addTrace(i,a),setError:a=>this.setError(i,a)}),this.addTrace=(i,a)=>{const s=this.events.get(i);s&&(s.props.properties.trace.push(a),this.events.set(i,s),this.shouldPersist=!0)},this.setError=(i,a)=>{const s=this.events.get(i);s&&(s.props.type=a,s.timestamp=Date.now(),this.events.set(i,s),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(a=>{this.events.set(a.eventId,Z2(Z2({},a),this.setMethods(a.eventId)))})}catch(i){this.logger.warn(i)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[a,s]of this.events)s.props.type&&i.push(s);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const a of i)this.events.delete(a.eventId),this.shouldPersist=!0}catch(a){this.logger.warn(a)}},this.sendEvent=async i=>{const a=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${Wqe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${TT}${a}`,{method:"POST",body:JSON.stringify(i)})},this.getAppDomain=()=>Eie().url,this.logger=ws(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var qYe=Object.defineProperty,xH=Object.getOwnPropertySymbols,VYe=Object.prototype.hasOwnProperty,YYe=Object.prototype.propertyIsEnumerable,EH=(t,e,r)=>e in t?qYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_H=(t,e)=>{for(var r in e||(e={}))VYe.call(e,r)&&EH(t,r,e[r]);if(xH)for(var r of xH(e))YYe.call(e,r)&&EH(t,r,e[r]);return t};let KYe=class dae extends oGe{constructor(e){var r;super(e),this.protocol=Jie,this.version=Qie,this.name=A8,this.events=new ys.EventEmitter,this.initialized=!1,this.on=(s,o)=>this.events.on(s,o),this.once=(s,o)=>this.events.once(s,o),this.off=(s,o)=>this.events.off(s,o),this.removeListener=(s,o)=>this.events.removeListener(s,o),this.dispatchEnvelope=({topic:s,message:o,sessionExists:l})=>{if(!s||!o)return;const c={topic:s,message:o,publishedAt:Date.now(),transportType:Cn.link_mode};this.relayer.onLinkMessageEvent(c,{sessionExists:l})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Xie,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=u7({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:uqe.logger,name:A8}),{logger:i,chunkLoggerController:a}=sGe({opts:n,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=a,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var s,o;(s=this.logChunkController)!=null&&s.downloadLogsBlobInBrowser&&((o=this.logChunkController)==null||o.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=ws(i,this.name),this.heartbeat=new aHe,this.crypto=new gYe(this,this.logger,e==null?void 0:e.keychain),this.history=new OYe(this,this.logger),this.expirer=new FYe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new LHe(_H(_H({},dqe),e==null?void 0:e.storageOptions)),this.relayer=new jYe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new DYe(this,this.logger),this.verify=new UYe(this,this.logger,this.storage),this.echoClient=new BYe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new GYe(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new dae(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(Cqe,n),r}get context(){return eo(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(eH,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(eH)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}};const JYe=KYe,fae="wc",hae=2,pae="client",Uj=`${fae}@${hae}:${pae}:`,OS={name:pae,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},CH="WALLETCONNECT_DEEPLINK_CHOICE",QYe="proposal",gae="Proposal expired",ZYe="session",Sp=ct.SEVEN_DAYS,XYe="engine",Bi={wc_sessionPropose:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1114},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:ct.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:ct.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1119}}},FS={min:ct.FIVE_MINUTES,max:ct.SEVEN_DAYS},Wc={idle:"IDLE",active:"ACTIVE"},eKe="request",tKe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],rKe="wc",nKe="auth",iKe="authKeys",aKe="pairingTopics",sKe="requests",g7=`${rKe}@${1.5}:${nKe}:`,K6=`${g7}:PUB_KEY`;var oKe=Object.defineProperty,lKe=Object.defineProperties,cKe=Object.getOwnPropertyDescriptors,SH=Object.getOwnPropertySymbols,uKe=Object.prototype.hasOwnProperty,dKe=Object.prototype.propertyIsEnumerable,AH=(t,e,r)=>e in t?oKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ti=(t,e)=>{for(var r in e||(e={}))uKe.call(e,r)&&AH(t,r,e[r]);if(SH)for(var r of SH(e))dKe.call(e,r)&&AH(t,r,e[r]);return t},Hl=(t,e)=>lKe(t,cKe(e));class fKe extends vGe{constructor(e){super(e),this.name=XYe,this.events=new $L,this.initialized=!1,this.requestQueue={state:Wc.idle,queue:[]},this.sessionRequestQueue={state:Wc.idle,queue:[]},this.requestQueueDelay=ct.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(Bi)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ct.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const n=Hl(ti({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:a,optionalNamespaces:s,sessionProperties:o,relays:l}=n;let c=i,u,f=!1;try{c&&(f=this.client.core.pairing.pairings.get(c).active)}catch(S){throw this.client.logger.error(`connect() -> pairing.get(${c}) failed`),S}if(!c||!f){const{topic:S,uri:j}=await this.client.core.pairing.create();c=S,u=j}if(!c){const{message:S}=ht("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw new Error(S)}const h=await this.client.core.crypto.generateKeyPair(),g=Bi.wc_sessionPropose.req.ttl||ct.FIVE_MINUTES,m=Li(g),w=ti({requiredNamespaces:a,optionalNamespaces:s,relays:l??[{protocol:Zie}],proposer:{publicKey:h,metadata:this.client.metadata},expiryTimestamp:m,pairingTopic:c},o&&{sessionProperties:o}),{reject:C,resolve:v,done:b}=l0(g,gae);this.events.once(jr("session_connect"),async({error:S,session:j})=>{if(S)C(S);else if(j){j.self.publicKey=h;const U=Hl(ti({},j),{pairingTopic:w.pairingTopic,requiredNamespaces:w.requiredNamespaces,optionalNamespaces:w.optionalNamespaces,transportType:Cn.relay});await this.client.session.set(j.topic,U),await this.setExpiry(j.topic,j.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:j.peer.metadata}),this.cleanupDuplicatePairings(U),v(U)}});const A=await this.sendRequest({topic:c,method:"wc_sessionPropose",params:w,throwOnFailedPublish:!0});return await this.setProposal(A,ti({id:A},w)),{uri:u,approval:b}},this.pair=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{var n,i,a;const s=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[Wl.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(B){throw s.setError(t0.no_internet_connection),B}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(B){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),s.setError(t0.proposal_not_found),B}try{await this.isValidApprove(r)}catch(B){throw this.client.logger.error("approve() -> isValidApprove() failed"),s.setError(t0.session_approve_namespace_validation_failure),B}const{id:o,relayProtocol:l,namespaces:c,sessionProperties:u,sessionConfig:f}=r,h=this.client.proposal.get(o);this.client.core.eventClient.deleteEvent({eventId:s.eventId});const{pairingTopic:g,proposer:m,requiredNamespaces:w,optionalNamespaces:C}=h;let v=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:g});v||(v=(a=this.client.core.eventClient)==null?void 0:a.createEvent({type:Wl.session_approve_started,properties:{topic:g,trace:[Wl.session_approve_started,Wl.session_namespaces_validation_success]}}));const b=await this.client.core.crypto.generateKeyPair(),A=m.publicKey,S=await this.client.core.crypto.generateSharedKey(b,A),j=ti(ti({relay:{protocol:l??"irn"},namespaces:c,controller:{publicKey:b,metadata:this.client.metadata},expiry:Li(Sp)},u&&{sessionProperties:u}),f&&{sessionConfig:f}),U=Cn.relay;v.addTrace(Wl.subscribing_session_topic);try{await this.client.core.relayer.subscribe(S,{transportType:U})}catch(B){throw v.setError(t0.subscribe_session_topic_failure),B}v.addTrace(Wl.subscribe_session_topic_success);const I=Hl(ti({},j),{topic:S,requiredNamespaces:w,optionalNamespaces:C,pairingTopic:g,acknowledged:!1,self:j.controller,peer:{publicKey:m.publicKey,metadata:m.metadata},controller:b,transportType:Cn.relay});await this.client.session.set(S,I),v.addTrace(Wl.store_session);try{v.addTrace(Wl.publishing_session_settle),await this.sendRequest({topic:S,method:"wc_sessionSettle",params:j,throwOnFailedPublish:!0}).catch(B=>{throw v==null||v.setError(t0.session_settle_publish_failure),B}),v.addTrace(Wl.session_settle_publish_success),v.addTrace(Wl.publishing_session_approve),await this.sendResult({id:o,topic:g,result:{relay:{protocol:l??"irn"},responderPublicKey:b},throwOnFailedPublish:!0}).catch(B=>{throw v==null||v.setError(t0.session_approve_publish_failure),B}),v.addTrace(Wl.session_approve_publish_success)}catch(B){throw this.client.logger.error(B),this.client.session.delete(S,ln("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(S),B}return this.client.core.eventClient.deleteEvent({eventId:v.eventId}),await this.client.core.pairing.updateMetadata({topic:g,metadata:m.metadata}),await this.client.proposal.delete(o,ln("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(S,Li(Sp)),{topic:S,acknowledged:()=>Promise.resolve(this.client.session.get(S))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(s){throw this.client.logger.error("reject() -> isValidReject() failed"),s}const{id:n,reason:i}=r;let a;try{a=this.client.proposal.get(n).pairingTopic}catch(s){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),s}a&&(await this.sendError({id:n,topic:a,error:i,rpcOpts:Bi.wc_sessionPropose.reject}),await this.client.proposal.delete(n,ln("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(f){throw this.client.logger.error("update() -> isValidUpdate() failed"),f}const{topic:n,namespaces:i}=r,{done:a,resolve:s,reject:o}=l0(),l=fd(),c=S0().toString(),u=this.client.session.get(n).namespaces;return this.events.once(jr("session_update",l),({error:f})=>{f?o(f):s()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:l,relayRpcId:c}).catch(f=>{this.client.logger.error(f),this.client.session.update(n,{namespaces:u}),o(f)}),{acknowledged:a}},this.extend=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(l){throw this.client.logger.error("extend() -> isValidExtend() failed"),l}const{topic:n}=r,i=fd(),{done:a,resolve:s,reject:o}=l0();return this.events.once(jr("session_extend",i),({error:l})=>{l?o(l):s()}),await this.setExpiry(n,Li(Sp)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(l=>{o(l)}),{acknowledged:a}},this.request=async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(m){throw this.client.logger.error("request() -> isValidRequest() failed"),m}const{chainId:n,request:i,topic:a,expiry:s=Bi.wc_sessionRequest.req.ttl}=r,o=this.client.session.get(a);(o==null?void 0:o.transportType)===Cn.relay&&await this.confirmOnlineStateOrThrow();const l=fd(),c=S0().toString(),{done:u,resolve:f,reject:h}=l0(s,"Request expired. Please try again.");this.events.once(jr("session_request",l),({error:m,result:w})=>{m?h(m):f(w)});const g=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);return g?(await this.sendRequest({clientRpcId:l,relayRpcId:c,topic:a,method:"wc_sessionRequest",params:{request:Hl(ti({},i),{expiryTimestamp:Li(s)}),chainId:n},expiry:s,throwOnFailedPublish:!0,appLink:g}).catch(m=>h(m)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:l}),await u()):await Promise.all([new Promise(async m=>{await this.sendRequest({clientRpcId:l,relayRpcId:c,topic:a,method:"wc_sessionRequest",params:{request:Hl(ti({},i),{expiryTimestamp:Li(s)}),chainId:n},expiry:s,throwOnFailedPublish:!0}).catch(w=>h(w)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:l}),m()}),new Promise(async m=>{var w;if(!((w=o.sessionConfig)!=null&&w.disableDeepLink)){const C=await Mze(this.client.core.storage,CH);await Aze({id:l,topic:a,wcDeepLink:C})}m()}),u()]).then(m=>m[2])},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:a}=i,s=this.client.session.get(n);s.transportType===Cn.relay&&await this.confirmOnlineStateOrThrow();const o=this.getAppLinkIfEnabled(s.peer.metadata,s.transportType);Jc(i)?await this.sendResult({id:a,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:o}):sl(i)&&await this.sendError({id:a,topic:n,error:i.error,appLink:o}),this.cleanupAfterResponse(r)},this.ping=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=fd(),a=S0().toString(),{done:s,resolve:o,reject:l}=l0();this.events.once(jr("session_ping",i),({error:c})=>{c?l(c):o()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:a}),s()])}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);const{topic:n,event:i,chainId:a}=r,s=S0().toString(),o=fd();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:a},throwOnFailedPublish:!0,relayRpcId:s,clientRpcId:o})},this.disconnect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:ln("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=ht("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>TWe(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const a=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),s=a?Cn.link_mode:Cn.relay;s===Cn.relay&&await this.confirmOnlineStateOrThrow();const{chains:o,statement:l="",uri:c,domain:u,nonce:f,type:h,exp:g,nbf:m,methods:w=[],expiry:C}=r,v=[...r.resources||[]],{topic:b,uri:A}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:s});this.client.logger.info({message:"Generated new pairing",pairing:{topic:b,uri:A}});const S=await this.client.core.crypto.generateKeyPair(),j=q6(S);if(await Promise.all([this.client.auth.authKeys.set(K6,{responseTopic:j,publicKey:S}),this.client.auth.pairingTopics.set(j,{topic:j,pairingTopic:b})]),await this.client.core.relayer.subscribe(j,{transportType:s}),this.client.logger.info(`sending request to new pairing topic: ${b}`),w.length>0){const{namespace:P}=wg(o[0]);let R=Jze(P,"request",w);G6(v)&&(R=Zze(R,v.pop())),v.push(R)}const U=C&&C>Bi.wc_sessionAuthenticate.req.ttl?C:Bi.wc_sessionAuthenticate.req.ttl,I={authPayload:{type:h??"caip122",chains:o,statement:l,aud:c,domain:u,version:"1",nonce:f,iat:new Date().toISOString(),exp:g,nbf:m,resources:v},requester:{publicKey:S,metadata:this.client.metadata},expiryTimestamp:Li(U)},B={eip155:{chains:o,methods:[...new Set(["personal_sign",...w])],events:["chainChanged","accountsChanged"]}},V={requiredNamespaces:{},optionalNamespaces:B,relays:[{protocol:"irn"}],pairingTopic:b,proposer:{publicKey:S,metadata:this.client.metadata},expiryTimestamp:Li(Bi.wc_sessionPropose.req.ttl)},{done:se,resolve:Y,reject:N}=l0(U,"Request expired"),k=async({error:P,session:R})=>{if(this.events.off(jr("session_request",_),x),P)N(P);else if(R){R.self.publicKey=S,await this.client.session.set(R.topic,R),await this.setExpiry(R.topic,R.expiry),b&&await this.client.core.pairing.updateMetadata({topic:b,metadata:R.peer.metadata});const M=this.client.session.get(R.topic);await this.deleteProposal(L),Y({session:M})}},x=async P=>{var R,M,D;if(await this.deletePendingAuthRequest(_,{message:"fulfilled",code:0}),P.error){const te=ln("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return P.error.code===te.code?void 0:(this.events.off(jr("session_connect"),k),N(P.error.message))}await this.deleteProposal(L),this.events.off(jr("session_connect"),k);const{cacaos:$,responder:X}=P.result,le=[],H=[];for(const te of $){await vW({cacao:te,projectId:this.client.core.projectId})||(this.client.logger.error(te,"Signature verification failed"),N(ln("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:re}=te,z=G6(re.resources),G=[ET(re.iss)],Q=b8(re.iss);if(z){const me=bW(z),be=xW(z);le.push(...me),G.push(...be)}for(const me of G)H.push(`${me}:${Q}`)}const ee=await this.client.core.crypto.generateSharedKey(S,X.publicKey);let J;le.length>0&&(J={topic:ee,acknowledged:!0,self:{publicKey:S,metadata:this.client.metadata},peer:X,controller:X.publicKey,expiry:Li(Sp),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:b,namespaces:kW([...new Set(le)],[...new Set(H)]),transportType:s},await this.client.core.relayer.subscribe(ee,{transportType:s}),await this.client.session.set(ee,J),b&&await this.client.core.pairing.updateMetadata({topic:b,metadata:X.metadata}),J=this.client.session.get(ee)),(R=this.client.metadata.redirect)!=null&&R.linkMode&&(M=X.metadata.redirect)!=null&&M.linkMode&&(D=X.metadata.redirect)!=null&&D.universal&&n&&(this.client.core.addLinkModeSupportedApp(X.metadata.redirect.universal),this.client.session.update(ee,{transportType:Cn.link_mode})),Y({auths:$,session:J})},_=fd(),L=fd();this.events.once(jr("session_connect"),k),this.events.once(jr("session_request",_),x);let O;try{if(a){const P=Wf("wc_sessionAuthenticate",I,_);this.client.core.history.set(b,P);const R=await this.client.core.crypto.encode("",P,{type:bv,encoding:V2});O=U4(n,b,R)}else await Promise.all([this.sendRequest({topic:b,method:"wc_sessionAuthenticate",params:I,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:_}),this.sendRequest({topic:b,method:"wc_sessionPropose",params:V,expiry:Bi.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:L})])}catch(P){throw this.events.off(jr("session_connect"),k),this.events.off(jr("session_request",_),x),P}return await this.setProposal(L,ti({id:L},V)),await this.setAuthRequest(_,{request:Hl(ti({},I),{verifyContext:{}}),pairingTopic:b,transportType:s}),{uri:O??A,response:se}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,a=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[r0.authenticated_session_approve_started]}});try{this.isInitialized()}catch(C){throw a.setError(J2.no_internet_connection),C}const s=this.getPendingAuthRequest(n);if(!s)throw a.setError(J2.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const o=s.transportType||Cn.relay;o===Cn.relay&&await this.confirmOnlineStateOrThrow();const l=s.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),u=q6(l),f={type:Ld,receiverPublicKey:l,senderPublicKey:c},h=[],g=[];for(const C of i){if(!await vW({cacao:C,projectId:this.client.core.projectId})){a.setError(J2.invalid_cacao);const j=ln("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:u,error:j,encodeOpts:f}),new Error(j.message)}a.addTrace(r0.cacaos_verified);const{p:v}=C,b=G6(v.resources),A=[ET(v.iss)],S=b8(v.iss);if(b){const j=bW(b),U=xW(b);h.push(...j),A.push(...U)}for(const j of A)g.push(`${j}:${S}`)}const m=await this.client.core.crypto.generateSharedKey(c,l);a.addTrace(r0.create_authenticated_session_topic);let w;if((h==null?void 0:h.length)>0){w={topic:m,acknowledged:!0,self:{publicKey:c,metadata:this.client.metadata},peer:{publicKey:l,metadata:s.requester.metadata},controller:l,expiry:Li(Sp),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:s.pairingTopic,namespaces:kW([...new Set(h)],[...new Set(g)]),transportType:o},a.addTrace(r0.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(m,{transportType:o})}catch(C){throw a.setError(J2.subscribe_authenticated_session_topic_failure),C}a.addTrace(r0.subscribe_authenticated_session_topic_success),await this.client.session.set(m,w),a.addTrace(r0.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:s.pairingTopic,metadata:s.requester.metadata})}a.addTrace(r0.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:n,result:{cacaos:i,responder:{publicKey:c,metadata:this.client.metadata}},encodeOpts:f,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(s.requester.metadata,o)})}catch(C){throw a.setError(J2.authenticated_session_approve_publish_failure),C}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:s.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:a.eventId}),{session:w}},this.rejectSessionAuthenticate=async r=>{this.isInitialized();const{id:n,reason:i}=r,a=this.getPendingAuthRequest(n);if(!a)throw new Error(`Could not find pending auth request with id ${n}`);a.transportType===Cn.relay&&await this.confirmOnlineStateOrThrow();const s=a.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),l=q6(s),c={type:Ld,receiverPublicKey:s,senderPublicKey:o};await this.sendError({id:n,topic:l,error:i,encodeOpts:c,rpcOpts:Bi.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(a.requester.metadata,a.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,ln("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return Tie(n,i)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(a=>{var s,o;return((s=a.peerMetadata)==null?void 0:s.url)&&((o=a.peerMetadata)==null?void 0:o.url)===r.peer.metadata.url&&a.topic&&a.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async r=>{var n;const{topic:i,expirerHasDeleted:a=!1,emitEvent:s=!0,id:o=0}=r,{self:l}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,ln("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(l.publicKey)&&await this.client.core.crypto.deleteKeyPair(l.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),a||this.client.core.expirer.del(i),this.client.core.storage.removeItem(CH).catch(c=>this.client.logger.warn(c)),this.getPendingSessionRequests().forEach(c=>{c.topic===i&&this.deletePendingSessionRequest(c.id,ln("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=Wc.idle),s&&this.client.events.emit("session_delete",{id:o,topic:i})},this.deleteProposal=async(r,n)=>{if(n)try{const i=this.client.proposal.get(r),a=this.client.core.eventClient.getEvent({topic:i.pairingTopic});a==null||a.setError(t0.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,ln("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==r),i&&(this.sessionRequestQueue.state=Wc.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,Li(Bi.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:a,transportType:s=Cn.relay}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:a,verifyContext:i.verifyContext,transportType:s})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:a,verifyContext:s}=r,o=a.request.expiryTimestamp||Li(Bi.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,o),await this.client.pendingRequest.set(n,{id:n,topic:i,params:a,verifyContext:s})},this.sendRequest=async r=>{const{topic:n,method:i,params:a,expiry:s,relayRpcId:o,clientRpcId:l,throwOnFailedPublish:c,appLink:u}=r,f=Wf(i,a,l);let h;const g=!!u;try{const C=g?V2:zf;h=await this.client.core.crypto.encode(n,f,{encoding:C})}catch(C){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),C}let m;if(tKe.includes(i)){const C=xd(JSON.stringify(f)),v=xd(h);m=await this.client.core.verify.register({id:v,decryptedId:C})}const w=Bi[i].req;if(w.attestation=m,s&&(w.ttl=s),o&&(w.id=o),this.client.core.history.set(n,f),g){const C=U4(u,n,h);await global.Linking.openURL(C,this.client.name)}else{const C=Bi[i].req;s&&(C.ttl=s),o&&(C.id=o),c?(C.internal=Hl(ti({},C.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,h,C)):this.client.core.relayer.publish(n,h,C).catch(v=>this.client.logger.error(v))}return f.id},this.sendResult=async r=>{const{id:n,topic:i,result:a,throwOnFailedPublish:s,encodeOpts:o,appLink:l}=r,c=d7(n,a);let u;const f=l&&typeof(global==null?void 0:global.Linking)<"u";try{const g=f?V2:zf;u=await this.client.core.crypto.encode(i,c,Hl(ti({},o||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),g}let h;try{h=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),g}if(f){const g=U4(l,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=Bi[h.request.method].res;s?(g.internal=Hl(ti({},g.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,u,g)):this.client.core.relayer.publish(i,u,g).catch(m=>this.client.logger.error(m))}await this.client.core.history.resolve(c)},this.sendError=async r=>{const{id:n,topic:i,error:a,encodeOpts:s,rpcOpts:o,appLink:l}=r,c=f7(n,a);let u;const f=l&&typeof(global==null?void 0:global.Linking)<"u";try{const g=f?V2:zf;u=await this.client.core.crypto.encode(i,c,Hl(ti({},s||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),g}let h;try{h=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),g}if(f){const g=U4(l,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=o||Bi[h.request.method].res;this.client.core.relayer.publish(i,u,g)}await this.client.core.history.resolve(c)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let a=!1;kf(i.expiry)&&(a=!0),this.client.core.crypto.keychain.has(i.topic)||(a=!0),a&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{kf(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Wc.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Wc.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Wc.idle},this.processRequest=async r=>{const{topic:n,payload:i,attestation:a,transportType:s,encryptedId:o}=r,l=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:l}))switch(l){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:n,payload:i,attestation:a,encryptedId:o});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:i,attestation:a,encryptedId:o,transportType:s});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:a,encryptedId:o,transportType:s});default:return this.client.logger.info(`Unsupported request method ${l}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i,transportType:a}=r,s=(await this.client.core.history.get(n,i.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,a);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=ht("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.shouldIgnorePairingRequest=r=>{const{topic:n,requestMethod:i}=r,a=this.expectedPairingMethodMap.get(n);return!a||a.includes(i)?!1:!!(a.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:n,payload:i,attestation:a,encryptedId:s}=r,{params:o,id:l}=i;try{const c=this.client.core.eventClient.getEvent({topic:n});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),c==null||c.setError(od.proposal_listener_not_found)),this.isValidConnect(ti({},i.params));const u=o.expiryTimestamp||Li(Bi.wc_sessionPropose.req.ttl),f=ti({id:l,pairingTopic:n,expiryTimestamp:u},o);await this.setProposal(l,f);const h=await this.getVerifyContext({attestationId:a,hash:xd(JSON.stringify(i)),encryptedId:s,metadata:f.proposer.metadata});c==null||c.addTrace(Gc.emit_session_proposal),this.client.events.emit("session_proposal",{id:l,params:f,verifyContext:h})}catch(c){await this.sendError({id:l,topic:n,error:c,rpcOpts:Bi.wc_sessionPropose.autoReject}),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:a}=n;if(Jc(n)){const{result:s}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const o=this.client.proposal.get(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});const l=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const c=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});const u=await this.client.core.crypto.generateSharedKey(l,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:u});const f=await this.client.core.relayer.subscribe(u,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),await this.client.core.pairing.activate({topic:r})}else if(sl(n)){await this.client.proposal.delete(a,ln("USER_DISCONNECTED"));const s=jr("session_connect");if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners, 954`);this.events.emit(jr("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:a}=n;try{this.isValidSessionSettleRequest(a);const{relay:s,controller:o,expiry:l,namespaces:c,sessionProperties:u,sessionConfig:f}=n.params,h=Hl(ti(ti({topic:r,relay:s,expiry:l,namespaces:c,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:o.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:o.publicKey,metadata:o.metadata}},u&&{sessionProperties:u}),f&&{sessionConfig:f}),{transportType:Cn.relay}),g=jr("session_connect");if(this.events.listenerCount(g)===0)throw new Error(`emitting ${g} without any listeners 997`);this.events.emit(jr("session_connect"),{session:h}),await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Jc(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(jr("session_approve",i),{})):sl(n)&&(await this.client.session.delete(r,ln("USER_DISCONNECTED")),this.events.emit(jr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:a}=n;try{const s=`${r}_session_update`,o=Y2.get(s);if(o&&this.isRequestOutOfSync(o,a)){this.client.logger.warn(`Discarding out of sync request - ${a}`),this.sendError({id:a,topic:r,error:ln("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(ti({topic:r},i));try{Y2.set(s,a),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:a,topic:r,result:!0,throwOnFailedPublish:!0})}catch(l){throw Y2.delete(s),l}this.client.events.emit("session_update",{id:a,topic:r,params:i})}catch(s){await this.sendError({id:a,topic:r,error:s}),this.client.logger.error(s)}},this.isRequestOutOfSync=(r,n)=>n.toString().slice(0,-3){const{id:i}=n,a=jr("session_update",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Jc(n)?this.events.emit(jr("session_update",i),{}):sl(n)&&this.events.emit(jr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Li(Sp)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,a=jr("session_extend",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Jc(n)?this.events.emit(jr("session_extend",i),{}):sl(n)&&this.events.emit(jr("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,a=jr("session_ping",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);setTimeout(()=>{Jc(n)?this.events.emit(jr("session_ping",i),{}):sl(n)&&this.events.emit(jr("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),Promise.all([new Promise(a=>{this.client.core.relayer.once(Zi.publish,async()=>{a(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:ln("USER_DISCONNECTED")})]).catch(a=>this.client.logger.error(a))}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async r=>{var n,i,a;const{topic:s,payload:o,attestation:l,encryptedId:c,transportType:u}=r,{id:f,params:h}=o;try{await this.isValidRequest(ti({topic:s},h));const g=this.client.session.get(s),m=await this.getVerifyContext({attestationId:l,hash:xd(JSON.stringify(Wf("wc_sessionRequest",h,f))),encryptedId:c,metadata:g.peer.metadata,transportType:u}),w={id:f,topic:s,params:h,verifyContext:m};await this.setPendingSessionRequest(w),u===Cn.link_mode&&(n=g.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=g.peer.metadata.redirect)==null?void 0:i.universal),(a=this.client.signConfig)!=null&&a.disableRequestQueue?this.emitSessionRequest(w):(this.addSessionRequestToSessionRequestQueue(w),this.processSessionRequestQueue())}catch(g){await this.sendError({id:f,topic:s,error:g}),this.client.logger.error(g)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,a=jr("session_request",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Jc(n)?this.events.emit(jr("session_request",i),{result:n.result}):sl(n)&&this.events.emit(jr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:a}=n;try{const s=`${r}_session_event_${a.event.name}`,o=Y2.get(s);if(o&&this.isRequestOutOfSync(o,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(ti({topic:r},a)),this.client.events.emit("session_event",{id:i,topic:r,params:a}),Y2.set(s,i)}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),Jc(n)?this.events.emit(jr("session_request",i),{result:n.result}):sl(n)&&this.events.emit(jr("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{var n;const{topic:i,payload:a,attestation:s,encryptedId:o,transportType:l}=r;try{const{requester:c,authPayload:u,expiryTimestamp:f}=a.params,h=await this.getVerifyContext({attestationId:s,hash:xd(JSON.stringify(a)),encryptedId:o,metadata:c.metadata,transportType:l}),g={requester:c,pairingTopic:i,id:a.id,authPayload:u,verifyContext:h,expiryTimestamp:f};await this.setAuthRequest(a.id,{request:g,pairingTopic:i,transportType:l}),l===Cn.link_mode&&(n=c.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp(c.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:a.params,id:a.id,verifyContext:h})}catch(c){this.client.logger.error(c);const u=a.params.requester.publicKey,f=await this.client.core.crypto.generateKeyPair(),h=this.getAppLinkIfEnabled(a.params.requester.metadata,l),g={type:Ld,receiverPublicKey:u,senderPublicKey:f};await this.sendError({id:a.id,topic:i,error:c,encodeOpts:g,rpcOpts:Bi.wc_sessionAuthenticate.autoReject,appLink:h})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Wc.idle,this.processSessionRequestQueue()},ct.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(a=>a.topic===r&&a.request.method==="wc_sessionRequest").forEach(a=>{const s=a.request.id,o=jr("session_request",s);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);this.events.emit(jr("session_request",a.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Wc.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Wc.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest({topic:r.topic,payload:Wf("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!Ls(r)){const{message:l}=ht("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:s,relays:o}=r;if(Os(n)||await this.isValidPairingTopic(n),!BWe(o)){const{message:l}=ht("MISSING_OR_INVALID",`connect() relays: ${o}`);throw new Error(l)}!Os(i)&&i3(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Os(a)&&i3(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),Os(s)||this.validateSessionProps(s,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=UWe(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Ls(r))throw new Error(ht("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:a,sessionProperties:s}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const o=this.client.proposal.get(n),l=NS(i,"approve()");if(l)throw new Error(l.message);const c=jW(o.requiredNamespaces,i,"approve()");if(c)throw new Error(c.message);if(!pi(a,!0)){const{message:u}=ht("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(u)}Os(s)||this.validateSessionProps(s,"sessionProperties")},this.isValidReject=async r=>{if(!Ls(r)){const{message:a}=ht("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(a)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!WWe(i)){const{message:a}=ht("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidSessionSettleRequest=r=>{if(!Ls(r)){const{message:c}=ht("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(c)}const{relay:n,controller:i,namespaces:a,expiry:s}=r;if(!Die(n)){const{message:c}=ht("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(c)}const o=$We(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);const l=NS(a,"onSessionSettleRequest()");if(l)throw new Error(l.message);if(kf(s)){const{message:c}=ht("EXPIRED","onSessionSettleRequest()");throw new Error(c)}},this.isValidUpdate=async r=>{if(!Ls(r)){const{message:l}=ht("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(l)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const a=this.client.session.get(n),s=NS(i,"update()");if(s)throw new Error(s.message);const o=jW(a.requiredNamespaces,i,"update()");if(o)throw new Error(o.message)},this.isValidExtend=async r=>{if(!Ls(r)){const{message:i}=ht("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Ls(r)){const{message:l}=ht("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(l)}const{topic:n,request:i,chainId:a,expiry:s}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!LW(o,a)){const{message:l}=ht("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(l)}if(!HWe(i)){const{message:l}=ht("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(l)}if(!VWe(o,a,i.method)){const{message:l}=ht("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(l)}if(s&&!QWe(s,FS)){const{message:l}=ht("MISSING_OR_INVALID",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${FS.min} and ${FS.max}`);throw new Error(l)}},this.isValidRespond=async r=>{var n;if(!Ls(r)){const{message:s}=ht("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(s)}const{topic:i,response:a}=r;try{await this.isValidSessionTopic(i)}catch(s){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),s}if(!GWe(a)){const{message:s}=ht("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(s)}},this.isValidPing=async r=>{if(!Ls(r)){const{message:i}=ht("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Ls(r)){const{message:o}=ht("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(o)}const{topic:n,event:i,chainId:a}=r;await this.isValidSessionTopic(n);const{namespaces:s}=this.client.session.get(n);if(!LW(s,a)){const{message:o}=ht("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(o)}if(!qWe(i)){const{message:o}=ht("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}if(!YWe(s,a,i.name)){const{message:o}=ht("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidDisconnect=async r=>{if(!Ls(r)){const{message:i}=ht("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:a,nonce:s}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!pi(i,!1))throw new Error("uri is required parameter");if(!pi(a,!1))throw new Error("domain is required parameter");if(!pi(s,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(l=>wg(l).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:o}=wg(n[0]);if(o!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:n,hash:i,encryptedId:a,metadata:s,transportType:o}=r,l={verified:{verifyUrl:s.verifyUrl||qy,validation:"UNKNOWN",origin:s.url||""}};try{if(o===Cn.link_mode){const u=this.getAppLinkIfEnabled(s,o);return l.verified.validation=u&&new URL(u).origin===new URL(s.url).origin?"VALID":"INVALID",l}const c=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:a,verifyUrl:s.verifyUrl});c&&(l.verified.origin=c.origin,l.verified.isScam=c.isScam,l.verified.validation=c.origin===new URL(s.url).origin?"VALID":"INVALID")}catch(c){this.client.logger.warn(c)}return this.client.logger.debug(`Verify context: ${JSON.stringify(l)}`),l},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!pi(i,!1)){const{message:a}=ht("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(a)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const a=this.recentlyDeletedLimit/2;for(const s of this.recentlyDeletedMap.keys()){if(i++>=a)break;this.recentlyDeletedMap.delete(s)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=ht("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}},this.isLinkModeEnabled=(r,n)=>{var i,a,s,o,l,c,u,f,h;return!r||n!==Cn.link_mode?!1:((a=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:a.linkMode)===!0&&((o=(s=this.client.metadata)==null?void 0:s.redirect)==null?void 0:o.universal)!==void 0&&((c=(l=this.client.metadata)==null?void 0:l.redirect)==null?void 0:c.universal)!==""&&((u=r==null?void 0:r.redirect)==null?void 0:u.universal)!==void 0&&((f=r==null?void 0:r.redirect)==null?void 0:f.universal)!==""&&((h=r==null?void 0:r.redirect)==null?void 0:h.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"},this.getAppLinkIfEnabled=(r,n)=>{var i;return this.isLinkModeEnabled(r,n)?(i=r==null?void 0:r.redirect)==null?void 0:i.universal:void 0},this.handleLinkModeMessage=({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;const n=gW(r,"topic")||"",i=decodeURIComponent(gW(r,"wc_ev")||""),a=this.client.session.keys.includes(n);a&&this.client.session.update(n,{transportType:Cn.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:a})},this.registerLinkModeListeners=async()=>{var r;if(Lj()||Lh()&&(r=this.client.metadata.redirect)!=null&&r.linkMode){const n=global==null?void 0:global.Linking;if(typeof n<"u"){n.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await n.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Zi.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:n,attestation:i,transportType:a}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(K6)?this.client.auth.authKeys.get(K6):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(r,n,{receiverPublicKey:s,encoding:a===Cn.link_mode?V2:zf});try{Fj(o)?(this.client.core.history.set(r,o),this.onRelayEventRequest({topic:r,payload:o,attestation:i,transportType:a,encryptedId:xd(n)})):h7(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o,transportType:a}),this.client.core.history.delete(r,o.id)):this.onRelayEventUnknownPayload({topic:r,payload:o,transportType:a})}catch(l){this.client.logger.error(l)}}registerExpirerEvents(){this.client.core.expirer.on(il.expired,async e=>{const{topic:r,id:n}=Iie(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,ht("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,ht("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(m0.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(m0.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!pi(e,!1)){const{message:r}=ht("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=ht("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(kf(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=ht("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!pi(e,!1)){const{message:r}=ht("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=ht("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(kf(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=ht("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=ht("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(pi(e,!1)){const{message:r}=ht("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=ht("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!zWe(e)){const{message:r}=ht("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=ht("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(kf(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=ht("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class hKe extends P1{constructor(e,r){super(e,r,QYe,Uj),this.core=e,this.logger=r}}let pKe=class extends P1{constructor(e,r){super(e,r,ZYe,Uj),this.core=e,this.logger=r}};class gKe extends P1{constructor(e,r){super(e,r,eKe,Uj,n=>n.id),this.core=e,this.logger=r}}class mKe extends P1{constructor(e,r){super(e,r,iKe,g7,()=>K6),this.core=e,this.logger=r}}class yKe extends P1{constructor(e,r){super(e,r,aKe,g7),this.core=e,this.logger=r}}class wKe extends P1{constructor(e,r){super(e,r,sKe,g7,n=>n.id),this.core=e,this.logger=r}}class vKe{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new mKe(this.core,this.logger),this.pairingTopics=new yKe(this.core,this.logger),this.requests=new wKe(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}let bKe=class mae extends wGe{constructor(e){super(e),this.protocol=fae,this.version=hae,this.name=OS.name,this.events=new ys.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async(n,i)=>{try{return await this.engine.authenticate(n,i)}catch(a){throw this.logger.error(a.message),a}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.name=(e==null?void 0:e.name)||OS.name,this.metadata=(e==null?void 0:e.metadata)||Eie(),this.signConfig=e==null?void 0:e.signConfig;const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Ev(u7({level:(e==null?void 0:e.logger)||OS.logger}));this.core=(e==null?void 0:e.core)||new JYe(e),this.logger=ws(r,this.name),this.session=new pKe(this.core,this.logger),this.proposal=new hKe(this.core,this.logger),this.pendingRequest=new gKe(this.core,this.logger),this.engine=new fKe(this),this.auth=new vKe(this.core,this.logger)}static async init(e){const r=new mae(e);return await r.initialize(),r}get context(){return eo(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),setTimeout(()=>{this.engine.processRelayMessageCache()},ct.toMiliseconds(ct.ONE_SECOND))}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};var I8={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */I8.exports;(function(t,e){(function(){var r,n="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",f=1,h=2,g=4,m=1,w=2,C=1,v=2,b=4,A=8,S=16,j=32,U=64,I=128,B=256,V=512,se=30,Y="...",N=800,k=16,x=1,_=2,L=3,O=1/0,P=9007199254740991,R=17976931348623157e292,M=NaN,D=4294967295,$=D-1,X=D>>>1,le=[["ary",I],["bind",C],["bindKey",v],["curry",A],["curryRight",S],["flip",V],["partial",j],["partialRight",U],["rearg",B]],H="[object Arguments]",ee="[object Array]",J="[object AsyncFunction]",te="[object Boolean]",re="[object Date]",z="[object DOMException]",G="[object Error]",Q="[object Function]",me="[object GeneratorFunction]",be="[object Map]",Ce="[object Number]",Fe="[object Null]",Ue="[object Object]",Ke="[object Promise]",lt="[object Proxy]",Ee="[object RegExp]",He="[object Set]",qe="[object String]",Ie="[object Symbol]",Ne="[object Undefined]",$e="[object WeakMap]",je="[object WeakSet]",K="[object ArrayBuffer]",F="[object DataView]",W="[object Float32Array]",ie="[object Float64Array]",pe="[object Int8Array]",we="[object Int16Array]",he="[object Int32Array]",Re="[object Uint8Array]",Je="[object Uint8ClampedArray]",et="[object Uint16Array]",it="[object Uint32Array]",ut=/\b__p \+= '';/g,pt=/\b(__p \+=) '' \+/g,tr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zt=/&(?:amp|lt|gt|quot|#39);/g,At=/[&<>"']/g,mt=RegExp(zt.source),St=RegExp(At.source),dt=/<%-([\s\S]+?)%>/g,Nt=/<%([\s\S]+?)%>/g,Rt=/<%=([\s\S]+?)%>/g,gt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qt=/^\w*$/,Wt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ot=/[\\^$.*+?()[\]{}|]/g,Vt=RegExp(ot.source),Ft=/^\s+/,yt=/\s/,Ze=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pt=/\{\n\/\* \[wrapped with (.+)\] \*/,xt=/,? & /,Jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cr=/[()=,{}\[\]\/\s]/,Gt=/\\(\\)?/g,Sr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,cr=/\w*$/,br=/^[-+]0x[0-9a-f]+$/i,Z=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,de=/^0o[0-7]+$/i,ue=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Le=/($^)/,Ge=/['\n\r\u2028\u2029\\]/g,Be="\\ud800-\\udfff",tt="\\u0300-\\u036f",vt="\\ufe20-\\ufe2f",Lt="\\u20d0-\\u20ff",Ct=tt+vt+Lt,ir="\\u2700-\\u27bf",Zt="a-z\\xdf-\\xf6\\xf8-\\xff",sn="\\xac\\xb1\\xd7\\xf7",Rr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",dn="\\u2000-\\u206f",qa=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bs="A-Z\\xc0-\\xd6\\xd8-\\xde",to="\\ufe0e\\ufe0f",Lc=sn+Rr+dn+qa,Fh="['’]",Bu="["+Be+"]",s2="["+Lc+"]",Uh="["+Ct+"]",qv="\\d+",wE="["+ir+"]",Vv="["+Zt+"]",Yv="[^"+Be+Lc+qv+ir+Zt+bs+"]",Y1="\\ud83c[\\udffb-\\udfff]",vE="(?:"+Uh+"|"+Y1+")",Kv="[^"+Be+"]",K1="(?:\\ud83c[\\udde6-\\uddff]){2}",sf="[\\ud800-\\udbff][\\udc00-\\udfff]",ro="["+bs+"]",Jv="\\u200d",Qv="(?:"+Vv+"|"+Yv+")",jc="(?:"+ro+"|"+Yv+")",Zv="(?:"+Fh+"(?:d|ll|m|re|s|t|ve))?",Xv="(?:"+Fh+"(?:D|LL|M|RE|S|T|VE))?",eb=vE+"?",tb="["+to+"]?",bE="(?:"+Jv+"(?:"+[Kv,K1,sf].join("|")+")"+tb+eb+")*",zu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rb="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nb=tb+eb+bE,J1="(?:"+[wE,K1,sf].join("|")+")"+nb,xE="(?:"+[Kv+Uh+"?",Uh,K1,sf,Bu].join("|")+")",o2=RegExp(Fh,"g"),EE=RegExp(Uh,"g"),Q1=RegExp(Y1+"(?="+Y1+")|"+xE+nb,"g"),ib=RegExp([ro+"?"+Vv+"+"+Zv+"(?="+[s2,ro,"$"].join("|")+")",jc+"+"+Xv+"(?="+[s2,ro+Qv,"$"].join("|")+")",ro+"?"+Qv+"+"+Zv,ro+"+"+Xv,rb,zu,qv,J1].join("|"),"g"),ab=RegExp("["+Jv+Be+Ct+to+"]"),Bh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,sb=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],_E=-1,mn={};mn[W]=mn[ie]=mn[pe]=mn[we]=mn[he]=mn[Re]=mn[Je]=mn[et]=mn[it]=!0,mn[H]=mn[ee]=mn[K]=mn[te]=mn[F]=mn[re]=mn[G]=mn[Q]=mn[be]=mn[Ce]=mn[Ue]=mn[Ee]=mn[He]=mn[qe]=mn[$e]=!1;var fn={};fn[H]=fn[ee]=fn[K]=fn[F]=fn[te]=fn[re]=fn[W]=fn[ie]=fn[pe]=fn[we]=fn[he]=fn[be]=fn[Ce]=fn[Ue]=fn[Ee]=fn[He]=fn[qe]=fn[Ie]=fn[Re]=fn[Je]=fn[et]=fn[it]=!0,fn[G]=fn[Q]=fn[$e]=!1;var ge={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Te={"&":"&","<":"<",">":">",'"':""","'":"'"},Xe={"&":"&","<":"<",">":">",""":'"',"'":"'"},It={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},yn=parseFloat,gr=parseInt,Nn=typeof Xt=="object"&&Xt&&Xt.Object===Object&&Xt,yi=typeof self=="object"&&self&&self.Object===Object&&self,Br=Nn||yi||Function("return this")(),wn=e&&!e.nodeType&&e,ci=wn&&!0&&t&&!t.nodeType&&t,xs=ci&&ci.exports===wn,wi=xs&&Nn.process,Ln=function(){try{var Me=ci&&ci.require&&ci.require("util").types;return Me||wi&&wi.binding&&wi.binding("util")}catch{}}(),Va=Ln&&Ln.isArrayBuffer,$l=Ln&&Ln.isDate,Wo=Ln&&Ln.isMap,$c=Ln&&Ln.isRegExp,l2=Ln&&Ln.isSet,zh=Ln&&Ln.isTypedArray;function Di(Me,We,Oe){switch(Oe.length){case 0:return Me.call(We);case 1:return Me.call(We,Oe[0]);case 2:return Me.call(We,Oe[0],Oe[1]);case 3:return Me.call(We,Oe[0],Oe[1],Oe[2])}return Me.apply(We,Oe)}function ede(Me,We,Oe,Mt){for(var fr=-1,en=Me==null?0:Me.length;++fr-1}function CE(Me,We,Oe){for(var Mt=-1,fr=Me==null?0:Me.length;++Mt-1;);return Oe}function lP(Me,We){for(var Oe=Me.length;Oe--&&Z1(We,Me[Oe],0)>-1;);return Oe}function cde(Me,We){for(var Oe=Me.length,Mt=0;Oe--;)Me[Oe]===We&&++Mt;return Mt}var ude=ME(ge),dde=ME(Te);function fde(Me){return"\\"+It[Me]}function hde(Me,We){return Me==null?r:Me[We]}function X1(Me){return ab.test(Me)}function pde(Me){return Bh.test(Me)}function gde(Me){for(var We,Oe=[];!(We=Me.next()).done;)Oe.push(We.value);return Oe}function LE(Me){var We=-1,Oe=Array(Me.size);return Me.forEach(function(Mt,fr){Oe[++We]=[fr,Mt]}),Oe}function cP(Me,We){return function(Oe){return Me(We(Oe))}}function cf(Me,We){for(var Oe=-1,Mt=Me.length,fr=0,en=[];++Oe-1}function rfe(p,y){var T=this.__data__,q=Cb(T,p);return q<0?(++this.size,T.push([p,y])):T[q][1]=y,this}Wu.prototype.clear=Zde,Wu.prototype.delete=Xde,Wu.prototype.get=efe,Wu.prototype.has=tfe,Wu.prototype.set=rfe;function Hu(p){var y=-1,T=p==null?0:p.length;for(this.clear();++y=y?p:y)),p}function Vo(p,y,T,q,ne,ce){var xe,Se=y&f,ke=y&h,Ve=y&g;if(T&&(xe=ne?T(p,q,ne,ce):T(p)),xe!==r)return xe;if(!Hn(p))return p;var Ye=mr(p);if(Ye){if(xe=she(p),!Se)return Es(p,xe)}else{var rt=Sa(p),bt=rt==Q||rt==me;if(gf(p))return GP(p,Se);if(rt==Ue||rt==H||bt&&!ne){if(xe=ke||bt?{}:uR(p),!Se)return ke?Kfe(p,wfe(xe,p)):Yfe(p,xP(xe,p))}else{if(!fn[rt])return ne?p:{};xe=ohe(p,rt,Se)}}ce||(ce=new Rl);var Ut=ce.get(p);if(Ut)return Ut;ce.set(p,xe),FR(p)?p.forEach(function(sr){xe.add(Vo(sr,y,T,sr,p,ce))}):DR(p)&&p.forEach(function(sr,Lr){xe.set(Lr,Vo(sr,y,T,Lr,p,ce))});var ar=Ve?ke?i_:n_:ke?Cs:Oi,xr=Ye?r:ar(p);return Ho(xr||p,function(sr,Lr){xr&&(Lr=sr,sr=p[Lr]),g2(xe,Lr,Vo(sr,y,T,Lr,p,ce))}),xe}function vfe(p){var y=Oi(p);return function(T){return EP(T,p,y)}}function EP(p,y,T){var q=T.length;if(p==null)return!q;for(p=vn(p);q--;){var ne=T[q],ce=y[ne],xe=p[ne];if(xe===r&&!(ne in p)||!ce(xe))return!1}return!0}function _P(p,y,T){if(typeof p!="function")throw new Go(s);return E2(function(){p.apply(r,T)},y)}function m2(p,y,T,q){var ne=-1,ce=ob,xe=!0,Se=p.length,ke=[],Ve=y.length;if(!Se)return ke;T&&(y=On(y,no(T))),q?(ce=CE,xe=!1):y.length>=i&&(ce=c2,xe=!1,y=new Gh(y));e:for(;++nene?0:ne+T),q=q===r||q>ne?ne:vr(q),q<0&&(q+=ne),q=T>q?0:BR(q);T0&&T(Se)?y>1?fa(Se,y-1,T,q,ne):lf(ne,Se):q||(ne[ne.length]=Se)}return ne}var FE=QP(),AP=QP(!0);function Pc(p,y){return p&&FE(p,y,Oi)}function UE(p,y){return p&&AP(p,y,Oi)}function Ab(p,y){return of(y,function(T){return Ku(p[T])})}function Vh(p,y){y=hf(y,p);for(var T=0,q=y.length;p!=null&&Ty}function Efe(p,y){return p!=null&&on.call(p,y)}function _fe(p,y){return p!=null&&y in vn(p)}function Cfe(p,y,T){return p>=Ca(y,T)&&p=120&&Ye.length>=120)?new Gh(xe&&Ye):r}Ye=p[0];var rt=-1,bt=Se[0];e:for(;++rt-1;)Se!==p&&yb.call(Se,ke,1),yb.call(p,ke,1);return p}function DP(p,y){for(var T=p?y.length:0,q=T-1;T--;){var ne=y[T];if(T==q||ne!==ce){var ce=ne;Yu(ne)?yb.call(p,ne,1):JE(p,ne)}}return p}function VE(p,y){return p+bb(yP()*(y-p+1))}function Dfe(p,y,T,q){for(var ne=-1,ce=Ti(vb((y-p)/(T||1)),0),xe=Oe(ce);ce--;)xe[q?ce:++ne]=p,p+=T;return xe}function YE(p,y){var T="";if(!p||y<1||y>P)return T;do y%2&&(T+=p),y=bb(y/2),y&&(p+=p);while(y);return T}function Ar(p,y){return d_(hR(p,y,Ss),p+"")}function Ofe(p){return bP(up(p))}function Ffe(p,y){var T=up(p);return Db(T,qh(y,0,T.length))}function v2(p,y,T,q){if(!Hn(p))return p;y=hf(y,p);for(var ne=-1,ce=y.length,xe=ce-1,Se=p;Se!=null&&++nene?0:ne+y),T=T>ne?ne:T,T<0&&(T+=ne),ne=y>T?0:T-y>>>0,y>>>=0;for(var ce=Oe(ne);++q>>1,xe=p[ce];xe!==null&&!ao(xe)&&(T?xe<=y:xe=i){var Ve=y?null:Xfe(p);if(Ve)return cb(Ve);xe=!1,ne=c2,ke=new Gh}else ke=y?[]:Se;e:for(;++q=q?p:Yo(p,y,T)}var HP=kde||function(p){return Br.clearTimeout(p)};function GP(p,y){if(y)return p.slice();var T=p.length,q=fP?fP(T):new p.constructor(T);return p.copy(q),q}function e_(p){var y=new p.constructor(p.byteLength);return new gb(y).set(new gb(p)),y}function Hfe(p,y){var T=y?e_(p.buffer):p.buffer;return new p.constructor(T,p.byteOffset,p.byteLength)}function Gfe(p){var y=new p.constructor(p.source,cr.exec(p));return y.lastIndex=p.lastIndex,y}function qfe(p){return p2?vn(p2.call(p)):{}}function qP(p,y){var T=y?e_(p.buffer):p.buffer;return new p.constructor(T,p.byteOffset,p.length)}function VP(p,y){if(p!==y){var T=p!==r,q=p===null,ne=p===p,ce=ao(p),xe=y!==r,Se=y===null,ke=y===y,Ve=ao(y);if(!Se&&!Ve&&!ce&&p>y||ce&&xe&&ke&&!Se&&!Ve||q&&xe&&ke||!T&&ke||!ne)return 1;if(!q&&!ce&&!Ve&&p=Se)return ke;var Ve=T[q];return ke*(Ve=="desc"?-1:1)}}return p.index-y.index}function YP(p,y,T,q){for(var ne=-1,ce=p.length,xe=T.length,Se=-1,ke=y.length,Ve=Ti(ce-xe,0),Ye=Oe(ke+Ve),rt=!q;++Se1?T[ne-1]:r,xe=ne>2?T[2]:r;for(ce=p.length>3&&typeof ce=="function"?(ne--,ce):r,xe&&Ka(T[0],T[1],xe)&&(ce=ne<3?r:ce,ne=1),y=vn(y);++q-1?ne[ce?y[xe]:xe]:r}}function eR(p){return Vu(function(y){var T=y.length,q=T,ne=qo.prototype.thru;for(p&&y.reverse();q--;){var ce=y[q];if(typeof ce!="function")throw new Go(s);if(ne&&!xe&&Pb(ce)=="wrapper")var xe=new qo([],!0)}for(q=xe?q:T;++q1&&zr.reverse(),Ye&&keSe))return!1;var Ve=ce.get(p),Ye=ce.get(y);if(Ve&&Ye)return Ve==y&&Ye==p;var rt=-1,bt=!0,Ut=T&w?new Gh:r;for(ce.set(p,y),ce.set(y,p);++rt1?"& ":"")+y[q],y=y.join(T>2?", ":" "),p.replace(Ze,`{ -/* [wrapped with `+y+`] */ -`)}function che(p){return mr(p)||Jh(p)||!!(gP&&p&&p[gP])}function Yu(p,y){var T=typeof p;return y=y??P,!!y&&(T=="number"||T!="symbol"&&ue.test(p))&&p>-1&&p%1==0&&p0){if(++y>=N)return arguments[0]}else y=0;return p.apply(r,arguments)}}function Db(p,y){var T=-1,q=p.length,ne=q-1;for(y=y===r?q:y;++T1?p[y-1]:r;return T=typeof T=="function"?(p.pop(),T):r,SR(p,T)});function AR(p){var y=oe(p);return y.__chain__=!0,y}function b0e(p,y){return y(p),p}function Ob(p,y){return y(p)}var x0e=Vu(function(p){var y=p.length,T=y?p[0]:0,q=this.__wrapped__,ne=function(ce){return OE(ce,p)};return y>1||this.__actions__.length||!(q instanceof Dr)||!Yu(T)?this.thru(ne):(q=q.slice(T,+T+(y?1:0)),q.__actions__.push({func:Ob,args:[ne],thisArg:r}),new qo(q,this.__chain__).thru(function(ce){return y&&!ce.length&&ce.push(r),ce}))});function E0e(){return AR(this)}function _0e(){return new qo(this.value(),this.__chain__)}function C0e(){this.__values__===r&&(this.__values__=UR(this.value()));var p=this.__index__>=this.__values__.length,y=p?r:this.__values__[this.__index__++];return{done:p,value:y}}function S0e(){return this}function A0e(p){for(var y,T=this;T instanceof _b;){var q=vR(T);q.__index__=0,q.__values__=r,y?ne.__wrapped__=q:y=q;var ne=q;T=T.__wrapped__}return ne.__wrapped__=p,y}function I0e(){var p=this.__wrapped__;if(p instanceof Dr){var y=p;return this.__actions__.length&&(y=new Dr(this)),y=y.reverse(),y.__actions__.push({func:Ob,args:[f_],thisArg:r}),new qo(y,this.__chain__)}return this.thru(f_)}function M0e(){return zP(this.__wrapped__,this.__actions__)}var T0e=kb(function(p,y,T){on.call(p,T)?++p[T]:Gu(p,T,1)});function k0e(p,y,T){var q=mr(p)?tP:bfe;return T&&Ka(p,y,T)&&(y=r),q(p,rr(y,3))}function N0e(p,y){var T=mr(p)?of:SP;return T(p,rr(y,3))}var L0e=XP(bR),j0e=XP(xR);function $0e(p,y){return fa(Fb(p,y),1)}function P0e(p,y){return fa(Fb(p,y),O)}function R0e(p,y,T){return T=T===r?1:vr(T),fa(Fb(p,y),T)}function IR(p,y){var T=mr(p)?Ho:df;return T(p,rr(y,3))}function MR(p,y){var T=mr(p)?tde:CP;return T(p,rr(y,3))}var D0e=kb(function(p,y,T){on.call(p,T)?p[T].push(y):Gu(p,T,[y])});function O0e(p,y,T,q){p=_s(p)?p:up(p),T=T&&!q?vr(T):0;var ne=p.length;return T<0&&(T=Ti(ne+T,0)),Hb(p)?T<=ne&&p.indexOf(y,T)>-1:!!ne&&Z1(p,y,T)>-1}var F0e=Ar(function(p,y,T){var q=-1,ne=typeof y=="function",ce=_s(p)?Oe(p.length):[];return df(p,function(xe){ce[++q]=ne?Di(y,xe,T):y2(xe,y,T)}),ce}),U0e=kb(function(p,y,T){Gu(p,T,y)});function Fb(p,y){var T=mr(p)?On:NP;return T(p,rr(y,3))}function B0e(p,y,T,q){return p==null?[]:(mr(y)||(y=y==null?[]:[y]),T=q?r:T,mr(T)||(T=T==null?[]:[T]),PP(p,y,T))}var z0e=kb(function(p,y,T){p[T?0:1].push(y)},function(){return[[],[]]});function W0e(p,y,T){var q=mr(p)?SE:aP,ne=arguments.length<3;return q(p,rr(y,4),T,ne,df)}function H0e(p,y,T){var q=mr(p)?rde:aP,ne=arguments.length<3;return q(p,rr(y,4),T,ne,CP)}function G0e(p,y){var T=mr(p)?of:SP;return T(p,zb(rr(y,3)))}function q0e(p){var y=mr(p)?bP:Ofe;return y(p)}function V0e(p,y,T){(T?Ka(p,y,T):y===r)?y=1:y=vr(y);var q=mr(p)?gfe:Ffe;return q(p,y)}function Y0e(p){var y=mr(p)?mfe:Bfe;return y(p)}function K0e(p){if(p==null)return 0;if(_s(p))return Hb(p)?ep(p):p.length;var y=Sa(p);return y==be||y==He?p.size:HE(p).length}function J0e(p,y,T){var q=mr(p)?AE:zfe;return T&&Ka(p,y,T)&&(y=r),q(p,rr(y,3))}var Q0e=Ar(function(p,y){if(p==null)return[];var T=y.length;return T>1&&Ka(p,y[0],y[1])?y=[]:T>2&&Ka(y[0],y[1],y[2])&&(y=[y[0]]),PP(p,fa(y,1),[])}),Ub=Nde||function(){return Br.Date.now()};function Z0e(p,y){if(typeof y!="function")throw new Go(s);return p=vr(p),function(){if(--p<1)return y.apply(this,arguments)}}function TR(p,y,T){return y=T?r:y,y=p&&y==null?p.length:y,qu(p,I,r,r,r,r,y)}function kR(p,y){var T;if(typeof y!="function")throw new Go(s);return p=vr(p),function(){return--p>0&&(T=y.apply(this,arguments)),p<=1&&(y=r),T}}var p_=Ar(function(p,y,T){var q=C;if(T.length){var ne=cf(T,lp(p_));q|=j}return qu(p,q,y,T,ne)}),NR=Ar(function(p,y,T){var q=C|v;if(T.length){var ne=cf(T,lp(NR));q|=j}return qu(y,q,p,T,ne)});function LR(p,y,T){y=T?r:y;var q=qu(p,A,r,r,r,r,r,y);return q.placeholder=LR.placeholder,q}function jR(p,y,T){y=T?r:y;var q=qu(p,S,r,r,r,r,r,y);return q.placeholder=jR.placeholder,q}function $R(p,y,T){var q,ne,ce,xe,Se,ke,Ve=0,Ye=!1,rt=!1,bt=!0;if(typeof p!="function")throw new Go(s);y=Jo(y)||0,Hn(T)&&(Ye=!!T.leading,rt="maxWait"in T,ce=rt?Ti(Jo(T.maxWait)||0,y):ce,bt="trailing"in T?!!T.trailing:bt);function Ut(di){var Ol=q,Qu=ne;return q=ne=r,Ve=di,xe=p.apply(Qu,Ol),xe}function ar(di){return Ve=di,Se=E2(Lr,y),Ye?Ut(di):xe}function xr(di){var Ol=di-ke,Qu=di-Ve,XR=y-Ol;return rt?Ca(XR,ce-Qu):XR}function sr(di){var Ol=di-ke,Qu=di-Ve;return ke===r||Ol>=y||Ol<0||rt&&Qu>=ce}function Lr(){var di=Ub();if(sr(di))return zr(di);Se=E2(Lr,xr(di))}function zr(di){return Se=r,bt&&q?Ut(di):(q=ne=r,xe)}function so(){Se!==r&&HP(Se),Ve=0,q=ke=ne=Se=r}function Ja(){return Se===r?xe:zr(Ub())}function oo(){var di=Ub(),Ol=sr(di);if(q=arguments,ne=this,ke=di,Ol){if(Se===r)return ar(ke);if(rt)return HP(Se),Se=E2(Lr,y),Ut(ke)}return Se===r&&(Se=E2(Lr,y)),xe}return oo.cancel=so,oo.flush=Ja,oo}var X0e=Ar(function(p,y){return _P(p,1,y)}),e1e=Ar(function(p,y,T){return _P(p,Jo(y)||0,T)});function t1e(p){return qu(p,V)}function Bb(p,y){if(typeof p!="function"||y!=null&&typeof y!="function")throw new Go(s);var T=function(){var q=arguments,ne=y?y.apply(this,q):q[0],ce=T.cache;if(ce.has(ne))return ce.get(ne);var xe=p.apply(this,q);return T.cache=ce.set(ne,xe)||ce,xe};return T.cache=new(Bb.Cache||Hu),T}Bb.Cache=Hu;function zb(p){if(typeof p!="function")throw new Go(s);return function(){var y=arguments;switch(y.length){case 0:return!p.call(this);case 1:return!p.call(this,y[0]);case 2:return!p.call(this,y[0],y[1]);case 3:return!p.call(this,y[0],y[1],y[2])}return!p.apply(this,y)}}function r1e(p){return kR(2,p)}var n1e=Wfe(function(p,y){y=y.length==1&&mr(y[0])?On(y[0],no(rr())):On(fa(y,1),no(rr()));var T=y.length;return Ar(function(q){for(var ne=-1,ce=Ca(q.length,T);++ne=y}),Jh=MP(function(){return arguments}())?MP:function(p){return ei(p)&&on.call(p,"callee")&&!pP.call(p,"callee")},mr=Oe.isArray,w1e=Va?no(Va):Afe;function _s(p){return p!=null&&Wb(p.length)&&!Ku(p)}function ui(p){return ei(p)&&_s(p)}function v1e(p){return p===!0||p===!1||ei(p)&&Ya(p)==te}var gf=jde||A_,b1e=$l?no($l):Ife;function x1e(p){return ei(p)&&p.nodeType===1&&!_2(p)}function E1e(p){if(p==null)return!0;if(_s(p)&&(mr(p)||typeof p=="string"||typeof p.splice=="function"||gf(p)||cp(p)||Jh(p)))return!p.length;var y=Sa(p);if(y==be||y==He)return!p.size;if(x2(p))return!HE(p).length;for(var T in p)if(on.call(p,T))return!1;return!0}function _1e(p,y){return w2(p,y)}function C1e(p,y,T){T=typeof T=="function"?T:r;var q=T?T(p,y):r;return q===r?w2(p,y,r,T):!!q}function m_(p){if(!ei(p))return!1;var y=Ya(p);return y==G||y==z||typeof p.message=="string"&&typeof p.name=="string"&&!_2(p)}function S1e(p){return typeof p=="number"&&mP(p)}function Ku(p){if(!Hn(p))return!1;var y=Ya(p);return y==Q||y==me||y==J||y==lt}function RR(p){return typeof p=="number"&&p==vr(p)}function Wb(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=P}function Hn(p){var y=typeof p;return p!=null&&(y=="object"||y=="function")}function ei(p){return p!=null&&typeof p=="object"}var DR=Wo?no(Wo):Tfe;function A1e(p,y){return p===y||WE(p,y,s_(y))}function I1e(p,y,T){return T=typeof T=="function"?T:r,WE(p,y,s_(y),T)}function M1e(p){return OR(p)&&p!=+p}function T1e(p){if(fhe(p))throw new fr(a);return TP(p)}function k1e(p){return p===null}function N1e(p){return p==null}function OR(p){return typeof p=="number"||ei(p)&&Ya(p)==Ce}function _2(p){if(!ei(p)||Ya(p)!=Ue)return!1;var y=mb(p);if(y===null)return!0;var T=on.call(y,"constructor")&&y.constructor;return typeof T=="function"&&T instanceof T&&fb.call(T)==Ide}var y_=$c?no($c):kfe;function L1e(p){return RR(p)&&p>=-P&&p<=P}var FR=l2?no(l2):Nfe;function Hb(p){return typeof p=="string"||!mr(p)&&ei(p)&&Ya(p)==qe}function ao(p){return typeof p=="symbol"||ei(p)&&Ya(p)==Ie}var cp=zh?no(zh):Lfe;function j1e(p){return p===r}function $1e(p){return ei(p)&&Sa(p)==$e}function P1e(p){return ei(p)&&Ya(p)==je}var R1e=$b(GE),D1e=$b(function(p,y){return p<=y});function UR(p){if(!p)return[];if(_s(p))return Hb(p)?Pl(p):Es(p);if(u2&&p[u2])return gde(p[u2]());var y=Sa(p),T=y==be?LE:y==He?cb:up;return T(p)}function Ju(p){if(!p)return p===0?p:0;if(p=Jo(p),p===O||p===-O){var y=p<0?-1:1;return y*R}return p===p?p:0}function vr(p){var y=Ju(p),T=y%1;return y===y?T?y-T:y:0}function BR(p){return p?qh(vr(p),0,D):0}function Jo(p){if(typeof p=="number")return p;if(ao(p))return M;if(Hn(p)){var y=typeof p.valueOf=="function"?p.valueOf():p;p=Hn(y)?y+"":y}if(typeof p!="string")return p===0?p:+p;p=sP(p);var T=Z.test(p);return T||de.test(p)?gr(p.slice(2),T?2:8):br.test(p)?M:+p}function zR(p){return Rc(p,Cs(p))}function O1e(p){return p?qh(vr(p),-P,P):p===0?p:0}function rn(p){return p==null?"":io(p)}var F1e=sp(function(p,y){if(x2(y)||_s(y)){Rc(y,Oi(y),p);return}for(var T in y)on.call(y,T)&&g2(p,T,y[T])}),WR=sp(function(p,y){Rc(y,Cs(y),p)}),Gb=sp(function(p,y,T,q){Rc(y,Cs(y),p,q)}),U1e=sp(function(p,y,T,q){Rc(y,Oi(y),p,q)}),B1e=Vu(OE);function z1e(p,y){var T=ap(p);return y==null?T:xP(T,y)}var W1e=Ar(function(p,y){p=vn(p);var T=-1,q=y.length,ne=q>2?y[2]:r;for(ne&&Ka(y[0],y[1],ne)&&(q=1);++T1),ce}),Rc(p,i_(p),T),q&&(T=Vo(T,f|h|g,ehe));for(var ne=y.length;ne--;)JE(T,y[ne]);return T});function ope(p,y){return GR(p,zb(rr(y)))}var lpe=Vu(function(p,y){return p==null?{}:Pfe(p,y)});function GR(p,y){if(p==null)return{};var T=On(i_(p),function(q){return[q]});return y=rr(y),RP(p,T,function(q,ne){return y(q,ne[0])})}function cpe(p,y,T){y=hf(y,p);var q=-1,ne=y.length;for(ne||(ne=1,p=r);++qy){var q=p;p=y,y=q}if(T||p%1||y%1){var ne=yP();return Ca(p+ne*(y-p+yn("1e-"+((ne+"").length-1))),y)}return VE(p,y)}var bpe=op(function(p,y,T){return y=y.toLowerCase(),p+(T?YR(y):y)});function YR(p){return b_(rn(p).toLowerCase())}function KR(p){return p=rn(p),p&&p.replace(ve,ude).replace(EE,"")}function xpe(p,y,T){p=rn(p),y=io(y);var q=p.length;T=T===r?q:qh(vr(T),0,q);var ne=T;return T-=y.length,T>=0&&p.slice(T,ne)==y}function Epe(p){return p=rn(p),p&&St.test(p)?p.replace(At,dde):p}function _pe(p){return p=rn(p),p&&Vt.test(p)?p.replace(ot,"\\$&"):p}var Cpe=op(function(p,y,T){return p+(T?"-":"")+y.toLowerCase()}),Spe=op(function(p,y,T){return p+(T?" ":"")+y.toLowerCase()}),Ape=ZP("toLowerCase");function Ipe(p,y,T){p=rn(p),y=vr(y);var q=y?ep(p):0;if(!y||q>=y)return p;var ne=(y-q)/2;return jb(bb(ne),T)+p+jb(vb(ne),T)}function Mpe(p,y,T){p=rn(p),y=vr(y);var q=y?ep(p):0;return y&&q>>0,T?(p=rn(p),p&&(typeof y=="string"||y!=null&&!y_(y))&&(y=io(y),!y&&X1(p))?pf(Pl(p),0,T):p.split(y,T)):[]}var Ppe=op(function(p,y,T){return p+(T?" ":"")+b_(y)});function Rpe(p,y,T){return p=rn(p),T=T==null?0:qh(vr(T),0,p.length),y=io(y),p.slice(T,T+y.length)==y}function Dpe(p,y,T){var q=oe.templateSettings;T&&Ka(p,y,T)&&(y=r),p=rn(p),y=Gb({},y,q,aR);var ne=Gb({},y.imports,q.imports,aR),ce=Oi(ne),xe=NE(ne,ce),Se,ke,Ve=0,Ye=y.interpolate||Le,rt="__p += '",bt=jE((y.escape||Le).source+"|"+Ye.source+"|"+(Ye===Rt?Sr:Le).source+"|"+(y.evaluate||Le).source+"|$","g"),Ut="//# sourceURL="+(on.call(y,"sourceURL")?(y.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++_E+"]")+` -`;p.replace(bt,function(sr,Lr,zr,so,Ja,oo){return zr||(zr=so),rt+=p.slice(Ve,oo).replace(Ge,fde),Lr&&(Se=!0,rt+=`' + -__e(`+Lr+`) + -'`),Ja&&(ke=!0,rt+=`'; -`+Ja+`; -__p += '`),zr&&(rt+=`' + -((__t = (`+zr+`)) == null ? '' : __t) + -'`),Ve=oo+sr.length,sr}),rt+=`'; -`;var ar=on.call(y,"variable")&&y.variable;if(!ar)rt=`with (obj) { -`+rt+` -} -`;else if(Cr.test(ar))throw new fr(o);rt=(ke?rt.replace(ut,""):rt).replace(pt,"$1").replace(tr,"$1;"),rt="function("+(ar||"obj")+`) { -`+(ar?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(Se?", __e = _.escape":"")+(ke?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+rt+`return __p -}`;var xr=QR(function(){return en(ce,Ut+"return "+rt).apply(r,xe)});if(xr.source=rt,m_(xr))throw xr;return xr}function Ope(p){return rn(p).toLowerCase()}function Fpe(p){return rn(p).toUpperCase()}function Upe(p,y,T){if(p=rn(p),p&&(T||y===r))return sP(p);if(!p||!(y=io(y)))return p;var q=Pl(p),ne=Pl(y),ce=oP(q,ne),xe=lP(q,ne)+1;return pf(q,ce,xe).join("")}function Bpe(p,y,T){if(p=rn(p),p&&(T||y===r))return p.slice(0,uP(p)+1);if(!p||!(y=io(y)))return p;var q=Pl(p),ne=lP(q,Pl(y))+1;return pf(q,0,ne).join("")}function zpe(p,y,T){if(p=rn(p),p&&(T||y===r))return p.replace(Ft,"");if(!p||!(y=io(y)))return p;var q=Pl(p),ne=oP(q,Pl(y));return pf(q,ne).join("")}function Wpe(p,y){var T=se,q=Y;if(Hn(y)){var ne="separator"in y?y.separator:ne;T="length"in y?vr(y.length):T,q="omission"in y?io(y.omission):q}p=rn(p);var ce=p.length;if(X1(p)){var xe=Pl(p);ce=xe.length}if(T>=ce)return p;var Se=T-ep(q);if(Se<1)return q;var ke=xe?pf(xe,0,Se).join(""):p.slice(0,Se);if(ne===r)return ke+q;if(xe&&(Se+=ke.length-Se),y_(ne)){if(p.slice(Se).search(ne)){var Ve,Ye=ke;for(ne.global||(ne=jE(ne.source,rn(cr.exec(ne))+"g")),ne.lastIndex=0;Ve=ne.exec(Ye);)var rt=Ve.index;ke=ke.slice(0,rt===r?Se:rt)}}else if(p.indexOf(io(ne),Se)!=Se){var bt=ke.lastIndexOf(ne);bt>-1&&(ke=ke.slice(0,bt))}return ke+q}function Hpe(p){return p=rn(p),p&&mt.test(p)?p.replace(zt,vde):p}var Gpe=op(function(p,y,T){return p+(T?" ":"")+y.toUpperCase()}),b_=ZP("toUpperCase");function JR(p,y,T){return p=rn(p),y=T?r:y,y===r?pde(p)?Ede(p):ade(p):p.match(y)||[]}var QR=Ar(function(p,y){try{return Di(p,r,y)}catch(T){return m_(T)?T:new fr(T)}}),qpe=Vu(function(p,y){return Ho(y,function(T){T=Dc(T),Gu(p,T,p_(p[T],p))}),p});function Vpe(p){var y=p==null?0:p.length,T=rr();return p=y?On(p,function(q){if(typeof q[1]!="function")throw new Go(s);return[T(q[0]),q[1]]}):[],Ar(function(q){for(var ne=-1;++neP)return[];var T=D,q=Ca(p,D);y=rr(y),p-=D;for(var ne=kE(q,y);++T0||y<0)?new Dr(T):(p<0?T=T.takeRight(-p):p&&(T=T.drop(p)),y!==r&&(y=vr(y),T=y<0?T.dropRight(-y):T.take(y-p)),T)},Dr.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},Dr.prototype.toArray=function(){return this.take(D)},Pc(Dr.prototype,function(p,y){var T=/^(?:filter|find|map|reject)|While$/.test(y),q=/^(?:head|last)$/.test(y),ne=oe[q?"take"+(y=="last"?"Right":""):y],ce=q||/^find/.test(y);ne&&(oe.prototype[y]=function(){var xe=this.__wrapped__,Se=q?[1]:arguments,ke=xe instanceof Dr,Ve=Se[0],Ye=ke||mr(xe),rt=function(Lr){var zr=ne.apply(oe,lf([Lr],Se));return q&&bt?zr[0]:zr};Ye&&T&&typeof Ve=="function"&&Ve.length!=1&&(ke=Ye=!1);var bt=this.__chain__,Ut=!!this.__actions__.length,ar=ce&&!bt,xr=ke&&!Ut;if(!ce&&Ye){xe=xr?xe:new Dr(this);var sr=p.apply(xe,Se);return sr.__actions__.push({func:Ob,args:[rt],thisArg:r}),new qo(sr,bt)}return ar&&xr?p.apply(this,Se):(sr=this.thru(rt),ar?q?sr.value()[0]:sr.value():sr)})}),Ho(["pop","push","shift","sort","splice","unshift"],function(p){var y=ub[p],T=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",q=/^(?:pop|shift)$/.test(p);oe.prototype[p]=function(){var ne=arguments;if(q&&!this.__chain__){var ce=this.value();return y.apply(mr(ce)?ce:[],ne)}return this[T](function(xe){return y.apply(mr(xe)?xe:[],ne)})}}),Pc(Dr.prototype,function(p,y){var T=oe[y];if(T){var q=T.name+"";on.call(ip,q)||(ip[q]=[]),ip[q].push({name:y,func:T})}}),ip[Nb(r,v).name]=[{name:"wrapper",func:r}],Dr.prototype.clone=Hde,Dr.prototype.reverse=Gde,Dr.prototype.value=qde,oe.prototype.at=x0e,oe.prototype.chain=E0e,oe.prototype.commit=_0e,oe.prototype.next=C0e,oe.prototype.plant=A0e,oe.prototype.reverse=I0e,oe.prototype.toJSON=oe.prototype.valueOf=oe.prototype.value=M0e,oe.prototype.first=oe.prototype.head,u2&&(oe.prototype[u2]=S0e),oe},tp=_de();ci?((ci.exports=tp)._=tp,wn._=tp):Br._=tp}).call(Xt)})(I8,I8.exports);var xKe=I8.exports,LT={exports:{}};(function(t,e){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Xt<"u"&&Xt,n=function(){function a(){this.fetch=!1,this.DOMException=r.DOMException}return a.prototype=r,new a}();(function(a){(function(s){var o=typeof a<"u"&&a||typeof self<"u"&&self||typeof Xt<"u"&&Xt||{},l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function c(_){return _&&DataView.prototype.isPrototypeOf(_)}if(l.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(_){return _&&u.indexOf(Object.prototype.toString.call(_))>-1};function h(_){if(typeof _!="string"&&(_=String(_)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(_)||_==="")throw new TypeError('Invalid character in header field name: "'+_+'"');return _.toLowerCase()}function g(_){return typeof _!="string"&&(_=String(_)),_}function m(_){var L={next:function(){var O=_.shift();return{done:O===void 0,value:O}}};return l.iterable&&(L[Symbol.iterator]=function(){return L}),L}function w(_){this.map={},_ instanceof w?_.forEach(function(L,O){this.append(O,L)},this):Array.isArray(_)?_.forEach(function(L){if(L.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+L.length);this.append(L[0],L[1])},this):_&&Object.getOwnPropertyNames(_).forEach(function(L){this.append(L,_[L])},this)}w.prototype.append=function(_,L){_=h(_),L=g(L);var O=this.map[_];this.map[_]=O?O+", "+L:L},w.prototype.delete=function(_){delete this.map[h(_)]},w.prototype.get=function(_){return _=h(_),this.has(_)?this.map[_]:null},w.prototype.has=function(_){return this.map.hasOwnProperty(h(_))},w.prototype.set=function(_,L){this.map[h(_)]=g(L)},w.prototype.forEach=function(_,L){for(var O in this.map)this.map.hasOwnProperty(O)&&_.call(L,this.map[O],O,this)},w.prototype.keys=function(){var _=[];return this.forEach(function(L,O){_.push(O)}),m(_)},w.prototype.values=function(){var _=[];return this.forEach(function(L){_.push(L)}),m(_)},w.prototype.entries=function(){var _=[];return this.forEach(function(L,O){_.push([O,L])}),m(_)},l.iterable&&(w.prototype[Symbol.iterator]=w.prototype.entries);function C(_){if(!_._noBody){if(_.bodyUsed)return Promise.reject(new TypeError("Already read"));_.bodyUsed=!0}}function v(_){return new Promise(function(L,O){_.onload=function(){L(_.result)},_.onerror=function(){O(_.error)}})}function b(_){var L=new FileReader,O=v(L);return L.readAsArrayBuffer(_),O}function A(_){var L=new FileReader,O=v(L),P=/charset=([A-Za-z0-9_-]+)/.exec(_.type),R=P?P[1]:"utf-8";return L.readAsText(_,R),O}function S(_){for(var L=new Uint8Array(_),O=new Array(L.length),P=0;P-1?L:_}function V(_,L){if(!(this instanceof V))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');L=L||{};var O=L.body;if(_ instanceof V){if(_.bodyUsed)throw new TypeError("Already read");this.url=_.url,this.credentials=_.credentials,L.headers||(this.headers=new w(_.headers)),this.method=_.method,this.mode=_.mode,this.signal=_.signal,!O&&_._bodyInit!=null&&(O=_._bodyInit,_.bodyUsed=!0)}else this.url=String(_);if(this.credentials=L.credentials||this.credentials||"same-origin",(L.headers||!this.headers)&&(this.headers=new w(L.headers)),this.method=B(L.method||this.method||"GET"),this.mode=L.mode||this.mode||null,this.signal=L.signal||this.signal||function(){if("AbortController"in o){var M=new AbortController;return M.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&O)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(O),(this.method==="GET"||this.method==="HEAD")&&(L.cache==="no-store"||L.cache==="no-cache")){var P=/([?&])_=[^&]*/;if(P.test(this.url))this.url=this.url.replace(P,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}V.prototype.clone=function(){return new V(this,{body:this._bodyInit})};function se(_){var L=new FormData;return _.trim().split("&").forEach(function(O){if(O){var P=O.split("="),R=P.shift().replace(/\+/g," "),M=P.join("=").replace(/\+/g," ");L.append(decodeURIComponent(R),decodeURIComponent(M))}}),L}function Y(_){var L=new w,O=_.replace(/\r?\n[\t ]+/g," ");return O.split("\r").map(function(P){return P.indexOf(` -`)===0?P.substr(1,P.length):P}).forEach(function(P){var R=P.split(":"),M=R.shift().trim();if(M){var D=R.join(":").trim();try{L.append(M,D)}catch($){console.warn("Response "+$.message)}}}),L}U.call(V.prototype);function N(_,L){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=L.statusText===void 0?"":""+L.statusText,this.headers=new w(L.headers),this.url=L.url||"",this._initBody(_)}U.call(N.prototype),N.prototype.clone=function(){return new N(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new w(this.headers),url:this.url})},N.error=function(){var _=new N(null,{status:200,statusText:""});return _.ok=!1,_.status=0,_.type="error",_};var k=[301,302,303,307,308];N.redirect=function(_,L){if(k.indexOf(L)===-1)throw new RangeError("Invalid status code");return new N(null,{status:L,headers:{location:_}})},s.DOMException=o.DOMException;try{new s.DOMException}catch{s.DOMException=function(L,O){this.message=L,this.name=O;var P=Error(L);this.stack=P.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function x(_,L){return new Promise(function(O,P){var R=new V(_,L);if(R.signal&&R.signal.aborted)return P(new s.DOMException("Aborted","AbortError"));var M=new XMLHttpRequest;function D(){M.abort()}M.onload=function(){var le={statusText:M.statusText,headers:Y(M.getAllResponseHeaders()||"")};R.url.indexOf("file://")===0&&(M.status<200||M.status>599)?le.status=200:le.status=M.status,le.url="responseURL"in M?M.responseURL:le.headers.get("X-Request-URL");var H="response"in M?M.response:M.responseText;setTimeout(function(){O(new N(H,le))},0)},M.onerror=function(){setTimeout(function(){P(new TypeError("Network request failed"))},0)},M.ontimeout=function(){setTimeout(function(){P(new TypeError("Network request timed out"))},0)},M.onabort=function(){setTimeout(function(){P(new s.DOMException("Aborted","AbortError"))},0)};function $(le){try{return le===""&&o.location.href?o.location.href:le}catch{return le}}if(M.open(R.method,$(R.url),!0),R.credentials==="include"?M.withCredentials=!0:R.credentials==="omit"&&(M.withCredentials=!1),"responseType"in M&&(l.blob?M.responseType="blob":l.arrayBuffer&&(M.responseType="arraybuffer")),L&&typeof L.headers=="object"&&!(L.headers instanceof w||o.Headers&&L.headers instanceof o.Headers)){var X=[];Object.getOwnPropertyNames(L.headers).forEach(function(le){X.push(h(le)),M.setRequestHeader(le,g(L.headers[le]))}),R.headers.forEach(function(le,H){X.indexOf(H)===-1&&M.setRequestHeader(H,le)})}else R.headers.forEach(function(le,H){M.setRequestHeader(H,le)});R.signal&&(R.signal.addEventListener("abort",D),M.onreadystatechange=function(){M.readyState===4&&R.signal.removeEventListener("abort",D)}),M.send(typeof R._bodyInit>"u"?null:R._bodyInit)})}return x.polyfill=!0,o.fetch||(o.fetch=x,o.Headers=w,o.Request=V,o.Response=N),s.Headers=w,s.Request=V,s.Response=N,s.fetch=x,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=r.fetch?r:n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(LT,LT.exports);var EKe=LT.exports;const IH=Lo(EKe);var _Ke=Object.defineProperty,CKe=Object.defineProperties,SKe=Object.getOwnPropertyDescriptors,MH=Object.getOwnPropertySymbols,AKe=Object.prototype.hasOwnProperty,IKe=Object.prototype.propertyIsEnumerable,TH=(t,e,r)=>e in t?_Ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,kH=(t,e)=>{for(var r in e||(e={}))AKe.call(e,r)&&TH(t,r,e[r]);if(MH)for(var r of MH(e))IKe.call(e,r)&&TH(t,r,e[r]);return t},NH=(t,e)=>CKe(t,SKe(e));const MKe={Accept:"application/json","Content-Type":"application/json"},TKe="POST",LH={headers:MKe,method:TKe},jH=10;let kc=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new ys.EventEmitter,this.isAvailable=!1,this.registering=!1,!YW(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=Kd(e),n=await(await IH(this.url,NH(kH({},LH),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!YW(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Kd({id:1,jsonrpc:"2.0",method:"test",params:[]});await IH(e,NH(kH({},LH),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?o1(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),a=f7(e,i);this.events.emit("payload",a)}parseError(e,r=this.url){return Gie(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>jH&&this.events.setMaxListeners(jH)}};const $H="error",kKe="wss://relay.walletconnect.org",NKe="wc",LKe="universal_provider",PH=`${NKe}@2:${LKe}:`,yae="https://rpc.walletconnect.org/v1/",jp="generic",jKe=`${yae}bundler`,Nl={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var $Ke=Object.defineProperty,PKe=Object.defineProperties,RKe=Object.getOwnPropertyDescriptors,RH=Object.getOwnPropertySymbols,DKe=Object.prototype.hasOwnProperty,OKe=Object.prototype.propertyIsEnumerable,DH=(t,e,r)=>e in t?$Ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,W4=(t,e)=>{for(var r in e||(e={}))DKe.call(e,r)&&DH(t,r,e[r]);if(RH)for(var r of RH(e))OKe.call(e,r)&&DH(t,r,e[r]);return t},FKe=(t,e)=>PKe(t,RKe(e));function No(t,e,r){var n;const i=wg(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${yae}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function R1(t){return t.includes(":")?t.split(":")[1]:t}function wae(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function UKe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const a=e.namespaces[i].accounts;n.push(...a)}),n}function US(t={},e={}){const r=OH(t),n=OH(e);return xKe.merge(r,n)}function OH(t){var e,r,n,i;const a={};if(!i3(t))return a;for(const[s,o]of Object.entries(t)){const l=Pj(s)?[s]:o.chains,c=o.methods||[],u=o.events||[],f=o.rpcMap||{},h=wy(s);a[h]=FKe(W4(W4({},a[h]),o),{chains:H6(l,(e=a[h])==null?void 0:e.chains),methods:H6(c,(r=a[h])==null?void 0:r.methods),events:H6(u,(n=a[h])==null?void 0:n.events),rpcMap:W4(W4({},f),(i=a[h])==null?void 0:i.rpcMap)})}return a}function BKe(t){return t.includes(":")?t.split(":")[2]:t}function FH(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],a=n.events||[],s=n.accounts||[],o=Pj(r)?[r]:n.chains?n.chains:wae(n.accounts);e[r]={chains:o,methods:i,events:a,accounts:s}}return e}function BS(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const vae={},Xr=t=>vae[t],zS=(t,e)=>{vae[t]=e};let zKe=class{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Nl.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=R1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||No(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new kl(new kc(n,Xr("disableProviderPing")))}};var WKe=Object.defineProperty,HKe=Object.defineProperties,GKe=Object.getOwnPropertyDescriptors,UH=Object.getOwnPropertySymbols,qKe=Object.prototype.hasOwnProperty,VKe=Object.prototype.propertyIsEnumerable,BH=(t,e,r)=>e in t?WKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zH=(t,e)=>{for(var r in e||(e={}))qKe.call(e,r)&&BH(t,r,e[r]);if(UH)for(var r of UH(e))VKe.call(e,r)&&BH(t,r,e[r]);return t},WH=(t,e)=>HKe(t,GKe(e));class YKe{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("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());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}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,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(Nl.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,r){const n=r||No(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new kl(new kc(n,Xr("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(R1(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const a=parseInt(i,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const a=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const s=this.client.session.get(e.topic),o=((i=s==null?void 0:s.sessionProperties)==null?void 0:i.capabilities)||{};if(o!=null&&o[a])return o==null?void 0:o[a];const l=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:WH(zH({},s.sessionProperties||{}),{capabilities:WH(zH({},o||{}),{[a]:l})})})}catch(c){console.warn("Failed to update session with capabilities",c)}return l}async getCallStatus(e){var r,n;const i=this.client.session.get(e.topic),a=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(a){const o=this.getBundlerUrl(e.chainId,a);try{return await this.getUserOperationReceipt(o,e)}catch(l){console.warn("Failed to fetch call status from bundler",l,o)}}const s=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(s)try{return await this.getUserOperationReceipt(s,e)}catch(o){console.warn("Failed to fetch call status from custom bundler",o,s)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Wf("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!a.ok)throw new Error(`Failed to fetch user operation receipt - ${a.status}`);return await a.json()}getBundlerUrl(e,r){return`${jKe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class KKe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Nl.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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=R1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||No(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new kl(new kc(n,Xr("disableProviderPing")))}}let JKe=class{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Nl.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=R1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||No(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new kl(new kc(n,Xr("disableProviderPing")))}};class QKe{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("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,r){if(!this.httpProviders[e]){const n=r||No(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(Nl.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||No(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new kl(new kc(n,Xr("disableProviderPing")))}}let ZKe=class{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Nl.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=R1(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new kl(new kc(n,Xr("disableProviderPing")))}};class XKe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Nl.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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=R1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||No(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new kl(new kc(n,Xr("disableProviderPing")))}}let eJe=class{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Nl.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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=R1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||No(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new kl(new kc(n,Xr("disableProviderPing")))}};class tJe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||No(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Nl.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||No(e,this.namespace);return typeof n>"u"?void 0:new kl(new kc(n,Xr("disableProviderPing")))}}class rJe{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||No(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Nl.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||No(e,this.namespace);return typeof n>"u"?void 0:new kl(new kc(n))}}class nJe{constructor(e){this.name=jp,this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Nl.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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const a=wg(i);n[`${a.namespace}:${a.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||No(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new kl(new kc(n,Xr("disableProviderPing")))}}var iJe=Object.defineProperty,aJe=Object.defineProperties,sJe=Object.getOwnPropertyDescriptors,HH=Object.getOwnPropertySymbols,oJe=Object.prototype.hasOwnProperty,lJe=Object.prototype.propertyIsEnumerable,GH=(t,e,r)=>e in t?iJe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,H4=(t,e)=>{for(var r in e||(e={}))oJe.call(e,r)&&GH(t,r,e[r]);if(HH)for(var r of HH(e))lJe.call(e,r)&&GH(t,r,e[r]);return t},WS=(t,e)=>aJe(t,sJe(e));let cJe=class bae{constructor(e){this.events=new $L,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:Ev(u7({level:(e==null?void 0:e.logger)||$H})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new bae(e);return await r.initialize(),r}async request(e,r,n){const[i,a]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:H4({},e),chainId:`${i}:${a}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const a=new Date().getTime();this.request(e,n,i).then(s=>r(null,d7(a,s))).catch(s=>r(s,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:ln("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)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const a=await i();if(this.session=a.session,this.session){const s=FH(this.session.namespaces);this.namespaces=US(this.namespaces,s),this.persist("namespaces",this.namespaces),this.onConnect()}return a}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(a=>{this.session=a;const s=FH(a.namespaces);this.namespaces=US(this.namespaces,s),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==gae)throw a;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),a=this.getProvider(n);a.name===jp?a.setDefaultChain(`${n}:${i}`,r):a.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(Jd(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.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 bKe.init({core:this.providerOpts.core,logger:this.providerOpts.logger||$H,relayUrl:this.providerOpts.relayUrl||kKe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),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(r=>wy(r)))];zS("client",this.client),zS("events",this.events),zS("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=UKe(r,this.session),i=wae(n),a=US(this.namespaces,this.optionalNamespaces),s=WS(H4({},a[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new YKe({namespace:s});break;case"algorand":this.rpcProviders[r]=new QKe({namespace:s});break;case"solana":this.rpcProviders[r]=new KKe({namespace:s});break;case"cosmos":this.rpcProviders[r]=new JKe({namespace:s});break;case"polkadot":this.rpcProviders[r]=new zKe({namespace:s});break;case"cip34":this.rpcProviders[r]=new ZKe({namespace:s});break;case"elrond":this.rpcProviders[r]=new XKe({namespace:s});break;case"multiversx":this.rpcProviders[r]=new eJe({namespace:s});break;case"near":this.rpcProviders[r]=new tJe({namespace:s});break;case"tezos":this.rpcProviders[r]=new rJe({namespace:s});break;default:this.rpcProviders[jp]?this.rpcProviders[jp].updateNamespace(s):this.rpcProviders[jp]=new nJe({namespace:s})}})}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:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&Jd(i)&&this.events.emit("accountsChanged",i.map(BKe))}else if(n.name==="chainChanged"){const i=r.chainId,a=r.event.data,s=wy(i),o=BS(i)!==BS(a)?`${s}:${BS(a)}`:i;this.onChainChanged(o)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,a=(n=this.client)==null?void 0:n.session.get(e);this.session=WS(H4({},a),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",WS(H4({},ln("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Nl.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[jp]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(s=>wy(s)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=wy(Object.keys(this.namespaces)[0]),a=this.rpcProviders[i].getDefaultChain();return[i,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}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,r){this.client.core.storage.setItem(`${PH}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${PH}/${e}`)}};const uJe=cJe,dJe="wc",fJe="ethereum_provider",hJe=`${dJe}@2:${fJe}:`,pJe="https://rpc.walletconnect.org/v1/",jT=["eth_sendTransaction","personal_sign"],xae=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],$T=["chainChanged","accountsChanged"],Eae=["chainChanged","accountsChanged","message","disconnect","connect"];var gJe=Object.defineProperty,mJe=Object.defineProperties,yJe=Object.getOwnPropertyDescriptors,qH=Object.getOwnPropertySymbols,wJe=Object.prototype.hasOwnProperty,vJe=Object.prototype.propertyIsEnumerable,VH=(t,e,r)=>e in t?gJe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$p=(t,e)=>{for(var r in e||(e={}))wJe.call(e,r)&&VH(t,r,e[r]);if(qH)for(var r of qH(e))vJe.call(e,r)&&VH(t,r,e[r]);return t},HS=(t,e)=>mJe(t,yJe(e));function M8(t){return Number(t[0].split(":")[1])}function G4(t){return`0x${t.toString(16)}`}function bJe(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:a,optionalEvents:s,rpcMap:o}=t;if(!Jd(e))throw new Error("Invalid chains");const l={chains:e,methods:n||jT,events:a||$T,rpcMap:$p({},e.length?{[M8(e)]:o[M8(e)]}:{})},c=a==null?void 0:a.filter(g=>!$T.includes(g)),u=n==null?void 0:n.filter(g=>!jT.includes(g));if(!r&&!s&&!i&&!(c!=null&&c.length)&&!(u!=null&&u.length))return{required:e.length?l:void 0};const f=(c==null?void 0:c.length)&&(u==null?void 0:u.length)||!r,h={chains:[...new Set(f?l.chains.concat(r||[]):r)],methods:[...new Set(l.methods.concat(i!=null&&i.length?i:xae))],events:[...new Set(l.events.concat(s!=null&&s.length?s:Eae))],rpcMap:o};return{required:e.length?l:void 0,optional:r.length?h:void 0}}let xJe=class _ae{constructor(){this.events=new ys.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=hJe,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new _ae;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}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:r,optional:n}=bJe(this.rpc);try{const i=await new Promise(async(s,o)=>{var l;this.rpc.showQrModal&&((l=this.modal)==null||l.subscribeModal(c=>{!c.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(HS($p({namespaces:$p({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(c=>{s(c)}).catch(c=>{o(new Error(c.message))})});if(!i)return;const a=uW(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:G4(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const n=await new Promise(async(a,s)=>{var o;this.rpc.showQrModal&&((o=this.modal)==null||o.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),s(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(HS($p({},e),{chains:this.rpc.chains}),r).then(l=>{a(l)}).catch(l=>{s(new Error(l.message))})}),i=n.session;if(i){const a=uW(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:G4(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}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:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",G4(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",HS($p({},ln("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.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 r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",G4(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e==null?void 0:e.chains)!=null?r:[],a=(n=e==null?void 0:e.optionalChains)!=null?n:[],s=i.concat(a);if(!s.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const o=i.length?(e==null?void 0:e.methods)||jT:[],l=i.length?(e==null?void 0:e.events)||$T:[],c=(e==null?void 0:e.optionalMethods)||[],u=(e==null?void 0:e.optionalEvents)||[],f=(e==null?void 0:e.rpcMap)||this.buildRpcMap(s,e.projectId),h=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(g=>this.formatChainId(g)),optionalChains:a.map(g=>this.formatChainId(g)),methods:o,events:l,optionalMethods:c,optionalEvents:u,rpcMap:f,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:h,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?M8(this.rpc.chains):M8(this.rpc.optionalChains),this.signer=await uJe.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled,logger:e.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await qs(()=>import("./index--IzDW4VH.js").then(i=>i.i),[]);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r($p({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&Jd(r)&&(this.rpc.chains=r.map(a=>this.formatChainId(a)),r.forEach(a=>{this.rpc.rpcMap[a]=(i==null?void 0:i[a])||this.getRpcUrl(a)})),n&&Jd(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(a=>this.formatChainId(a)),n.forEach(a=>{this.rpc.rpcMap[a]=(i==null?void 0:i[a])||this.getRpcUrl(a)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${pJe}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}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(r=>this.parseAccount(r))}};const EJe=xJe;let vg=class extends Dm{async initialize(){var n,i,a,s;let e=await this.createProvider();if(this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session){if((i=(n=this.walletProvider)==null?void 0:n.session)!=null&&i.peer.metadata.url){let o=zC((s=(a=this.walletProvider)==null?void 0:a.session)==null?void 0:s.peer.metadata.url);this.walletEntry=o==null?void 0:o.entry,this.walletClientType=(o==null?void 0:o.walletClientType)||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:r}=await qs(()=>import("./index--IzDW4VH.js").then(o=>o.i),[]);this.modal=new r({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(o=>{var l;o.open||(l=this.walletProvider)!=null&&l.session||!this.onQrModalClosed||this.onQrModalClosed()})}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){var e;return!!((e=this.walletProvider)!=null&&e.connected)}get walletBranding(){var r,n,i,a,s,o,l;if(this.walletClientType==="metamask")return{name:"MetaMask",icon:eOe,id:"io.metamask"};let e=(i=(n=(r=this.walletProvider)==null?void 0:r.session)==null?void 0:n.peer.metadata.icons)==null?void 0:i[0];return{name:YMe(((s=(a=this.walletProvider)==null?void 0:a.session)==null?void 0:s.peer.metadata.name)||"")||"WalletConnect",icon:typeof e=="string"?e:sOe,id:((l=(o=this.walletProvider)==null?void 0:o.session)==null?void 0:l.peer.metadata.name.toLowerCase())||"wallet_connect_v2"}}async resetConnection(e){var r;this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,(r=this.walletEntry)!=null&&r.isWalletEntryOverriden||(this.walletEntry=NM[e]),this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,tTe(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((e,r)=>{this.onQrModalClosed=()=>{r(new Lre)},(async()=>{var a,s,o,l,c;let n="",i=await Promise.race([(a=this.walletProvider)==null?void 0:a.enable(),this.proxyProvider.walletTimeout()]);if(i!=null&&i.length&&(n=i[0]),!n||n==="")throw new Pn("Unable to retrieve address");if((o=(s=this.walletProvider)==null?void 0:s.session)!=null&&o.peer.metadata.url){let u=zC((c=(l=this.walletProvider)==null?void 0:l.session)==null?void 0:c.peer.metadata.url);this.walletEntry=u==null?void 0:u.entry,this.walletClientType=(u==null?void 0:u.walletClientType)||"unknown",this.proxyProvider.rpcTimeoutDuration=JL(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(i),e()})().catch(n=>{r(n?M1(n):new Pn("Unknown error during connection"))}).finally(()=>{var n;return(n=this.modal)==null?void 0:n.closeModal()})})}disconnect(){var e;(e=this.walletProvider)==null||e.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let a of this.chains){let s=JMe(a.id,this.chains,this.rpcConfig,this.privyAppId);s&&(e[a.id]=s)}let r=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await EJe.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:Eae,optionalMethods:xae,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{var s,o;if(i.signer.abortPairingAttempt(),this.walletEntry){let{redirect:l,href:c}=XMe(a,this.walletEntry);rTe({href:c,name:this.walletEntry.displayName}),this.redirectUri=l;let u=eTe(a,this.walletEntry);u!=null&&u.redirect&&(this.fallbackUniversalRedirectUri=u.redirect),ya&&Oee(l,"_self"),(s=this.showPrivyQrModal)==null||s.call(this,{native:l,universal:this.fallbackUniversalRedirectUri})}else(o=this.modal)==null||o.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{var a,s,o;if((a=this.modal)==null||a.closeModal(),(s=i.session)==null?void 0:s.peer.metadata.url){let l=zC((o=i.session)==null?void 0:o.peer.metadata.url);this.walletEntry=l==null?void 0:l.entry,this.walletClientType=(l==null?void 0:l.walletClientType)||"unknown"}}),i}async enableProvider(){var e,r;return(e=this.walletProvider)!=null&&e.connected?Promise.resolve(this.walletProvider.accounts):await((r=this.walletProvider)==null?void 0:r.enable())}setWalletEntry(e,r){this.walletEntry=e,this.showPrivyQrModal=r}constructor(e,r,n,i,a,s,o,l){super(l||"unknown",n,i,r),this.connectorType="wallet_connect_v2",this.privyAppId=s,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=r,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new rs(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=NM[l],this.walletClientType=l)}};var _Je=(t,e)=>{let r=E.useRef(()=>{});E.useEffect(()=>{r.current=t}),E.useEffect(()=>{if(e!==null){let n=setInterval(()=>r.current(),e||0);return()=>clearInterval(n)}},[e])};function CJe(){let[t,e]=E.useState(!1),r=E.useCallback(()=>{document.hidden&&e(!0)},[]);return E.useEffect(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:t,reset:()=>e(!1)}}const Cae=t=>(t==null?void 0:t.privyErrorCode)===Ae.LINKED_TO_ANOTHER_USER?Pf.ERROR_USER_EXISTS:t instanceof pc&&!t.details.default?t.details:t instanceof Nre?Pf.ERROR_TIMED_OUT:t instanceof Lre?Pf.ERROR_USER_REJECTED_CONNECTION:(t==null?void 0:t.privyErrorCode)===Ae.CANNOT_LINK_MORE_OF_TYPE?Pf.ERROR_USER_LIMIT_REACHED:Pf.ERROR_WALLET_CONNECTION,SJe=()=>{var be,Ce,Fe,Ue,Ke,lt,Ee,He,qe,Ie,Ne;let t,[e,r]=E.useState(!1),[n,i]=E.useState(!1),[a,s]=E.useState(void 0),{authenticated:o,logout:l}=$r(),{app:c,navigate:u,navigateBack:f,lastScreen:h,currentScreen:g,setModalData:m,data:w}=wt(),{getAuthFlow:C,walletConnectionStatus:v,closePrivyModal:b,initLoginWithWallet:A,loginWithWallet:S,updateWallets:j,createAnalyticsEvent:U}=_t(),{walletConnectors:I}=$r(),[B,V]=E.useState(0),{user:se}=$r(),[Y]=E.useState((se==null?void 0:se.linkedAccounts.length)||0),[N,k]=E.useState(""),[x,_]=E.useState(""),[L,O]=E.useState(!1),{hasTabbedAway:P}=CJe(),{enabled:R,token:M}=Do(),D=ya&&((be=v==null?void 0:v.connector)==null?void 0:be.connectorType)==="wallet_connect_v2"||ya&&((Ce=v==null?void 0:v.connector)==null?void 0:Ce.connectorType)==="coinbase_wallet"||ya&&((Fe=v==null?void 0:v.connector)==null?void 0:Fe.connectorType)==="injected"&&((Ue=v==null?void 0:v.connector)==null?void 0:Ue.walletClientType)==="phantom",$=(v==null?void 0:v.status)==="connected",X=(v==null?void 0:v.status)==="switching_to_supported_chain";E.useEffect(()=>{var K;let $e=C(),je=$e instanceof J5||$e instanceof DM?$e:void 0;$&&!je&&(!R||M||o?A(v.connectedWallet,M,(K=w==null?void 0:w.login)==null?void 0:K.disableSignup).then(()=>{O(!0)}):(m({captchaModalData:{callback:F=>{var W;return A(v.connectedWallet,F,(W=w==null?void 0:w.login)==null?void 0:W.disableSignup).then(()=>{O(!0)})},userIntentRequired:!1,onSuccessNavigateTo:ye.AWAITING_CONNECTION,onErrorNavigateTo:ye.ERROR_SCREEN}}),u(ye.CAPTCHA_SCREEN,!1))),je&&D&&$&&!je.preparedMessage?je.buildMessage():je&&!D&&$&&(n||(async()=>{var F,W;i(!0),s(void 0);try{((F=v==null?void 0:v.connector)==null?void 0:F.connectorType)==="wallet_connect_v2"&&((W=v==null?void 0:v.connector)==null?void 0:W.walletClientType)==="metamask"&&await Lee(2500),await H()}catch(ie){console.warn("Auto-prompted signature failed",ie)}finally{i(!1)}})())},[B,$,L]),E.useEffect(()=>{var $e;if(se&&e){let je=Dn-500;if(c!=null&&c.legal.requireUsersAcceptTerms&&!se.hasAcceptedTerms){let F=setTimeout(()=>{u(ye.AFFIRMATIVE_CONSENT_SCREEN)},je);return()=>clearTimeout(F)}if(Hd(se,($e=c==null?void 0:c.embeddedWallets)==null?void 0:$e.createOnLogin)){let F=setTimeout(()=>{m({createWallet:{onSuccess:()=>{},onFailure:W=>{console.error(W),U({eventName:"embedded_wallet_creation_failure_logout",payload:{error:W,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),u(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},je);return()=>clearTimeout(F)}j();let K=setTimeout(()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Dn);return()=>clearTimeout(K)}},[se,e]);let le=$e=>{var je,K,F,W,ie,pe,we,he,Re,Je,et,it,ut,pt;if(($e==null?void 0:$e.privyErrorCode)!==Ae.ALLOWLIST_REJECTED){if(($e==null?void 0:$e.privyErrorCode)===Ae.USER_LIMIT_REACHED)return console.error(new K3($e).toString()),void u(ye.USER_LIMIT_REACHED_SCREEN);if(($e==null?void 0:$e.privyErrorCode)!==Ae.USER_DOES_NOT_EXIST)return($e==null?void 0:$e.privyErrorCode)===Ae.ACCOUNT_TRANSFER_REQUIRED&&((K=(je=$e.data)==null?void 0:je.data)!=null&&K.nonce)?(m({accountTransfer:{nonce:(W=(F=$e.data)==null?void 0:F.data)==null?void 0:W.nonce,account:(ie=C())==null?void 0:ie.meta.address,displayName:(he=(we=(pe=$e.data)==null?void 0:pe.data)==null?void 0:we.account)==null?void 0:he.displayName,externalWalletMetadata:{walletClientType:(Re=C())==null?void 0:Re.meta.walletClientType,chainId:(Je=C())==null?void 0:Je.meta.chainId,connectorType:(et=C())==null?void 0:et.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:(pt=(ut=(it=$e.data)==null?void 0:it.data)==null?void 0:ut.otherUser)==null?void 0:pt.embeddedWalletAddress}}),void u(ye.LINK_CONFLICT_SCREEN)):void s(Cae($e));u(ye.ACCOUNT_NOT_FOUND_SCREEN)}else u(ye.ALLOWLIST_REJECTION_SCREEN)};async function H(){try{await S(),r(!0)}catch($e){le($e)}finally{i(!1)}}E.useEffect(()=>{v!=null&&v.connectError&&le(v==null?void 0:v.connectError)},[v]),_Je(()=>{let $e=ee==="wallet_connect_v2"&&(v==null?void 0:v.connector)instanceof vg?v.connector.redirectUri:void 0;$e&&k($e);let je=ee==="wallet_connect_v2"&&(v==null?void 0:v.connector)instanceof vg?v.connector.fallbackUniversalRedirectUri:void 0;je&&_(je)},(v==null?void 0:v.connector)instanceof vg&&!N?500:null);let ee=((Ke=v==null?void 0:v.connector)==null?void 0:Ke.connectorType)||"injected",J=((lt=v==null?void 0:v.connector)==null?void 0:lt.walletClientType)||"unknown",te=((Ee=bu[J])==null?void 0:Ee.displayName)||((He=v==null?void 0:v.connector)==null?void 0:He.walletBranding.name)||"Browser Extension",re=((qe=bu[J])==null?void 0:qe.logo)||((Ie=v==null?void 0:v.connector)==null?void 0:Ie.walletBranding.icon)||($e=>d.jsx(wj,{...$e})),z=te==="Browser Extension"?te.toLowerCase():te;t=e?`Successfully connected with ${z}`:a?a.message:X?"Switching networks":$?n&&D?"Signing":"Sign to verify":`Waiting for ${z}`;let G="Don’t see your wallet? Check your other browser windows.";e?G=Y===((se==null?void 0:se.linkedAccounts.length)||0)?"Wallet was already linked.":"You’re good to go!":B>=2&&a?G="Unable to connect wallet":a?G=a.detail:X?G="Switch your wallet to the requested network.":$&&D?G="Sign the message in your wallet to verify it belongs to you.":J==="metamask"&&ya?G="Click continue to open and connect MetaMask.":J==="metamask"?G="For the best experience, connect only one wallet at a time.":ee==="wallet_connect"?G="Open your mobile wallet app to continue":ee!=="coinbase_wallet"||kee()||(G=$z(se)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let Q=(Ne=I==null?void 0:I.walletConnectors)==null?void 0:Ne.find($e=>$e.walletClientType==="coinbase_wallet"),me=J==="coinbase_wallet"&&($z(se)||a===Pf.ERROR_USER_EXISTS);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:h&&g!==h?f:void 0}),d.jsxs(AJe,{children:[d.jsx(Sae,{walletLogo:re,success:e,fail:!!a}),d.jsxs(ko,{children:[d.jsx("h3",{children:t}),d.jsx("p",{children:G}),$||!N||P?null:d.jsxs("p",{children:["Still here?"," ",d.jsx("a",{href:N,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),x&&d.jsxs(d.Fragment,{children:[" ","or"," ",d.jsx("a",{href:x,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),me?d.jsx(Ot,{onClick:()=>Q&&(Q==null?void 0:Q.disconnect()),disabled:e,children:"Use a different wallet"}):a==Pf.ERROR_USER_EXISTS&&g!==h?d.jsx(Ot,{onClick:f,children:"Use a different wallet"}):$&&!e&&D?d.jsx(Ot,{onClick:()=>{i(!0),H()},disabled:n,children:n?"Signing":"Sign with your wallet"}):!e&&(a!=null&&a.retryable)&&B<2?d.jsx(Ot,{onClick:()=>{V(B+1),s(void 0),$?(i(!0),H()):v==null||v.connectRetry()},disabled:!e&&(!(a!=null&&a.retryable)||B>=2),children:"Retry"}):e||a?null:d.jsx(Ot,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),d.jsx(kr,{})]})};let AJe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-afad057-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),IJe=fe.div.withConfig({displayName:"StackedContainer",componentId:"sc-afad057-1"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const Sae=t=>{let e=t.walletLogo;return d.jsx(d.Fragment,{children:d.jsx(IJe,{children:d.jsxs("div",{children:[d.jsx(_c,{success:t.success,fail:t.fail}),typeof e=="string"?d.jsx("span",{style:{background:`url('${e}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):d.jsx(e,{style:{width:"38px",height:"38px"}})]})})})},MJe=()=>{var j,U,I,B,V,se;let t,{navigateBack:e,navigate:r,lastScreen:n,currentScreen:i,data:a,setModalData:s}=wt(),{walletConnectionStatus:o,closePrivyModal:l}=_t(),[c,u]=E.useState(void 0),[f,h]=E.useState(0),g=(o==null?void 0:o.status)==="connected",m=(o==null?void 0:o.status)==="switching_to_supported_chain";E.useEffect(()=>{var Y,N;if(g){let k;if((Y=a==null?void 0:a.externalConnectWallet)!=null&&Y.onCompleteNavigateTo){let x=a.externalConnectWallet.onCompleteNavigateTo,_=(N=o.connectedWallet)==null?void 0:N.address;k=setTimeout(()=>{var L;a.funding&&s({...a,funding:{...a.funding,connectedWalletAddress:_}}),r(x({walletChainType:(L=o.connector)==null?void 0:L.chainType}))},Dn)}else k=setTimeout(l,Dn);return()=>clearTimeout(k)}},[g]),E.useEffect(()=>{var Y;o!=null&&o.connectError&&(Y=o==null?void 0:o.connectError,u(Cae(Y)))},[o]);let w=((j=o==null?void 0:o.connector)==null?void 0:j.connectorType)||"injected",C=((U=o==null?void 0:o.connector)==null?void 0:U.walletClientType)||"unknown",v=((I=bu[C])==null?void 0:I.displayName)||((B=o==null?void 0:o.connector)==null?void 0:B.walletBranding.name)||"Browser Extension",b=((V=bu[C])==null?void 0:V.logo)||((se=o==null?void 0:o.connector)==null?void 0:se.walletBranding.icon)||(Y=>d.jsx(wj,{...Y})),A=v==="Browser Extension"?v.toLowerCase():v;t=g?`Successfully connected with ${A}`:c?c.message:m?"Switching networks":`Waiting for ${A}`;let S="Don’t see your wallet? Check your other browser windows.";return g?S="You’re good to go!":f>=2&&c?S="Unable to connect wallet":c?S=c.detail:m?S="Switch your wallet to the requested network.":C==="metamask"&&ya?S="Click to continue to open and connect MetaMask.":C==="metamask"?S="For the best experience, connect only one wallet at a time.":w==="wallet_connect_v2"?S="Open your mobile wallet app to continue":w==="coinbase_wallet"&&(S="Open the Coinbase app on your phone to continue."),d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:i===n?void 0:e}),d.jsxs(TJe,{children:[d.jsx(Sae,{walletLogo:b,success:g,fail:!!c}),d.jsxs(ko,{children:[d.jsx("h3",{children:t}),d.jsx("p",{children:S})]}),c==Pf.ERROR_USER_EXISTS?d.jsx(Ot,{onClick:e,children:"Use a different wallet"}):!g&&(c!=null&&c.retryable)&&f<2?d.jsx(Ot,{onClick:()=>{h(f+1),u(void 0),o==null||o.connectRetry()},disabled:!g&&(!(c!=null&&c.retryable)||f>=2),children:"Retry"}):!g&&c&&f>=2?d.jsx(Ot,{onClick:e,children:"Use a different wallet"}):null]}),d.jsx(kr,{})]})};let TJe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-1346f57-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const Aae=({name:t,logoUrl:e,size:r="38px"})=>typeof e=="string"?d.jsx("img",{src:e,alt:`${t??"Provider app"} logo`,style:{width:r,height:r,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):d.jsx("span",{});function kJe(t){let{logout:e}=E.useContext(Fm);return oj("logout",t),{logout:e}}const NJe=()=>{let t=Ai(),{data:e,navigate:r,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=wt(),{crossAppAuthFlow:a,updateWallets:s,closePrivyModal:o,createAnalyticsEvent:l}=_t(),{logout:c}=kJe(),[u,f]=E.useState({}),h=e==null?void 0:e.crossAppAuth,g={id:h.appId,name:h.name,logoUrl:h.logoUrl},m=new _e(`There was an issue connecting your ${g.name} account. Please try again.`),w=new is(async A=>{if(h.popup)try{let S=await a({appId:A,popup:h.popup,action:h.action});f({data:S})}catch(S){S instanceof _e?f({error:S}):(S instanceof ol&&h.popup&&h.popup.close(),f({error:m}))}else f({error:m})}),C=()=>{u.data&&(s(),h.onSuccess(u.data),o({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h.onError(u.error??new _e("User canceled flow")),o({shouldCallAuthOnSuccess:!1,isSuccess:!1})};i.current=C,E.useEffect(()=>{g.id.length&&w.execute(g.id)},[g.id]),E.useEffect(()=>{var j;if(!u.data)return;let A=u.data;if(t.legal.requireUsersAcceptTerms&&!A.hasAcceptedTerms){let U=setTimeout(()=>{r(ye.AFFIRMATIVE_CONSENT_SCREEN)},Dn);return()=>clearTimeout(U)}if(Hd(A,(j=t.embeddedWallets)==null?void 0:j.createOnLogin)){let U=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:I=>{console.error(I),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:I,provider:`privy:${g.id}`,screen:"CrossAppAuthScreen"}}),c()},callAuthOnSuccessOnClose:!0}}),r(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Dn);return()=>clearTimeout(U)}let S=setTimeout(C,Dn);return()=>clearTimeout(S)},[u.data]);let{title:v,subtitle:b}=E.useMemo(()=>u.data?{title:`Successfully connected with ${g.name}`,subtitle:"You're good to go!"}:u.error?{title:"Authentication failed",subtitle:u.error.message}:{title:`Connecting to ${g.name}`,subtitle:`Please check the pop-up from ${g.name} to continue`},[u,g.name]);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:C}),d.jsx(tn,{}),d.jsxs(LJe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(_c,{success:!!u.data,fail:!!u.error}),d.jsx(Aae,{name:g.name,logoUrl:g.logoUrl})]})}),d.jsxs(ko,{children:[d.jsx("h3",{children:v}),d.jsx("p",{children:b})]})]}),d.jsx(an,{}),d.jsx(kr,{})]})};let LJe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-2ae0702a-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]);function jJe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Nc=E.forwardRef(jJe);function $Je({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const PJe=E.forwardRef($Je),RJe=fe.div.withConfig({displayName:"Column",componentId:"sc-cfc52180-0"})(["display:flex;flex-direction:column;"]),u1=fe.span.withConfig({displayName:"ErrorMessage",componentId:"sc-fcb8cd50-0"})(["text-align:left;font-size:0.75rem;font-weight:500;line-height:1.125rem;color:var(--privy-color-error);"]),DJe=fe.span.withConfig({displayName:"LabelXs",componentId:"sc-4c43f9fd-0"})(["color:var(--privy-color-foreground-3);font-size:0.75rem;font-weight:500;line-height:1.125rem;"]),Iae=la(["&&{border-width:1px;padding:0.5rem 1rem;}width:100%;text-align:left;border:solid 1px var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);display:flex;justify-content:space-between;align-items:center;",""],t=>t.$state==="error"?"border-color: var(--privy-color-error);":""),Bj=fe.div.withConfig({displayName:"Box",componentId:"sc-1660059c-0"})(["",""],Iae),m7=({errMsg:t,balance:e,address:r,isLoading:n,className:i,title:a,isPulsing:s,showIcon:o,statusColor:l="green"})=>{let c;return c=l||(t?"red":"green"),d.jsxs(d.Fragment,{children:[d.jsxs(Bj,{className:i,$state:t?"error":void 0,children:[d.jsxs(RJe,{children:[d.jsx(DJe,{children:a||"Pay with"}),d.jsx(bo,{address:r,showCopyIcon:o||!!t})]}),e!==void 0&&d.jsx(Ac,{isLoading:n,isPulsing:s,color:c,children:e})]}),t&&d.jsx(u1,{style:{marginTop:"0.25rem"},children:t})]})},OJe=()=>{let{app:t,data:e}=wt(),{closePrivyModal:r}=_t(),[n,i]=E.useState(!1),[a,s]=E.useState(),{address:o,onDelegate:l,onSuccess:c,onError:u}=e.delegatedActions.consent,f=async()=>{n?c():u(a??new _e("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return E.useEffect(()=>{if(!n&&!a)return;let h=setTimeout(f,TL);return()=>clearTimeout(h)},[n,a]),d.jsxs(d.Fragment,n||a?{children:[d.jsx(ft,{onClose:f}),d.jsx(tn,{}),d.jsxs(pj,{children:[a?d.jsx(Bx,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(Nc,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(mj,{height:20}),d.jsx(zn,{title:a?"Something went wrong":"Success!",description:a?"Please try again.":`You’ve successfully granted delegated action permissions to ${t.name}.`})]}),d.jsx(an,{}),d.jsx(Qt,{})]}:{children:[d.jsx(ft,{closeable:!0,onClose:f}),d.jsx(PJe,{width:56,height:56,style:{margin:"auto"}}),d.jsx(hn,{style:{marginTop:24,color:"var(--privy-color-foreground)"},children:"Enable offline access"}),d.jsxs(pn,{style:{marginBottom:24,textWrap:"pretty"},children:["By confirming, ",t.name," will be able to use your wallet for you even when you're not around. You can revoke this later."]}),d.jsx(UJe,{showIcon:!0,address:o,title:"Wallet",isLoading:!1}),d.jsxs(FJe,{style:{marginTop:24},children:[d.jsx(Yd,{onClick:f,children:"Not now"}),d.jsx(Ot,{onClick:async()=>{try{await l(),i(!0)}catch(h){s(h)}},children:"Accept"})]}),d.jsx(Qt,{})]})};let FJe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-b99bc0c0-0"})(["display:flex;gap:10px;"]),UJe=fe(m7).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-b99bc0c0-1"})(["margin-top:1.5rem;"]);function BJe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"}))}const zJe=E.forwardRef(BJe),WJe=()=>{let{app:t,data:e}=wt(),{closePrivyModal:r}=_t(),[n,i]=E.useState(!1),[a,s]=E.useState(),{onRevoke:o,onSuccess:l,onError:c}=e.delegatedActions.revoke,u=async()=>{n?l():c(a??new _e("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return E.useEffect(()=>{if(!n&&!a)return;let f=setTimeout(u,TL);return()=>clearTimeout(f)},[n,a]),d.jsxs(d.Fragment,n||a?{children:[d.jsx(ft,{onClose:u}),d.jsx(tn,{}),d.jsxs(pj,{children:[a?d.jsx(Bx,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(Nc,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(mj,{height:20}),d.jsx(zn,{title:a?"Something went wrong":"Success!",description:a?"Please try again.":"You've successfully revoked permissions."})]}),d.jsx(an,{}),d.jsx(Qt,{})]}:{children:[d.jsx(ft,{closeable:!0,onClose:u}),d.jsx(zJe,{width:56,height:56,style:{margin:"auto"}}),d.jsx(hn,{style:{marginTop:24},children:"Revoke offline access to wallet"}),d.jsxs(pn,{children:["By confirming, ",t.name," will no longer be able to use this wallet on your behalf when you are not online."]}),d.jsxs(HJe,{style:{marginTop:24},children:[d.jsx(Yd,{onClick:u,children:"Deny"}),d.jsx(Ot,{onClick:async()=>{try{await o(),i(!0)}catch(f){s(f)}},children:"Confirm"})]}),d.jsx(Qt,{})]})};let HJe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-8ff214d7-0"})(["display:flex;gap:10px;"]);const Mae=()=>d.jsx(GJe,{children:d.jsxs(qJe,{children:[d.jsx(VJe,{}),d.jsx(YJe,{})]})});let GJe=fe.div.withConfig({displayName:"LoadingContainer",componentId:"sc-85b54ede-0"})(["display:flex;justify-content:center;align-items:center;flex-grow:1;margin:12px;padding:16px;@media all and (display-mode:standalone){margin-bottom:30px;}"]),qJe=fe.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-85b54ede-1"})(["position:relative;height:140px;width:140px;opacity:1;animation:fadein 200ms ease;"]),VJe=fe.div.withConfig({displayName:"CircleFixed",componentId:"sc-85b54ede-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:140px;height:140px;&&{border:4px solid var(--privy-color-accent-light);border-radius:50%;}"]),YJe=fe.div.withConfig({displayName:"CircleRotate",componentId:"sc-85b54ede-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:140px;height:140px;animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:var(--privy-color-accent) transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);const KJe=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];let ri=class extends Error{constructor(e,r){super(r),this.type=e}};function Vm(t){let e=t.type;return typeof e=="string"&&KJe.includes(e)}function T8(t){return Vm(t)&&t.type==="wallet_not_on_device"}function JJe(t){return Vm(t)&&(t.type==="invalid_recovery_pin"||t.type==="invalid_request_arguments")}function zj(t){return!!Vm(t)&&t.type==="mfa_timeout"}function Wj(t){return!!Vm(t)&&t.type==="missing_or_invalid_mfa"}function QJe(t){return!!Vm(t)&&t.type==="mfa_verification_max_attempts_reached"}function Tae(t){return!(!Vm(t)||!t.message.includes("code 429"))}function kae(t){return!!function(e){let r=e.type;return typeof r=="string"&&r==="client_error"}(t)&&t.message==="MFA canceled"}function y7(){return B5(PM(36))}function Hj(){return y7()}async function Gj(t,e="S256"){if(e!="S256")return t;{let r=await fTe(t);return B5(r)}}function ZJe(){let t=Dt.get(py);if(!t)throw new _e("Authentication error.");return t}function Nae({isCreatingWallet:t,skipSplashScreen:e}){return t?ye.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN:e?ye.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN:ye.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN}function Lae({walletAction:t,availableRecoveryMethods:e,legacySetWalletPasswordFlow:r,isResettingPassword:n,showAutomaticRecovery:i}){return i?ye.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN:r||e.length===1?Nae({isCreatingWallet:t==="create",skipSplashScreen:n}):ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN}function jae(t){switch(t){case"user-passcode":return ye.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN;case"google-drive":case"icloud":return ye.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN;default:throw Error("Recovery method not supported")}}async function YH({api:t,provider:e}){let r=y7(),n=Hj(),i=await Gj(r);try{return e==="icloud"?{url:(await t.post(EMe,{client_type:"web"})).url}:{url:(await t.post(xMe,{redirect_to:window.location.href,code_challenge:i,state_code:n})).url,codeVerifier:r,stateCode:n,provider:e}}catch(a){throw Vr(a)}}async function XJe({api:t,provider:e,stateCode:r,codeVerifier:n,authorizationCode:i}){if(!i||!r)throw new _e("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(i==="undefined")throw new _e("User denied confirmation during OAuth flow");try{return(await t.post(_Me,{authorization_code:i,state_code:r,code_verifier:n,provider:e})).access_token}catch(a){let s=Vr(a);throw s.privyErrorCode?new _e(s.message||"Invalid code during OAuth flow.",void 0,s.privyErrorCode):s.message==="User denied confirmation during OAuth flow"?new _e("Invalid code during oauth flow.",void 0,Ae.OAUTH_USER_DENIED):new _e("Invalid code during OAuth flow.",void 0,Ae.UNKNOWN_AUTH_ERROR)}}const eQe=()=>{let{authenticated:t,user:e,getAccessToken:r}=$r(),{closePrivyModal:n,createAnalyticsEvent:i,walletProxy:a}=_t(),{navigate:s,data:o,setModalData:l,onUserCloseViaDialogOrKeybindRef:c}=wt(),u=E.useMemo(()=>Date.now(),[]),[f,h]=E.useState(!1),{onCompleteNavigateTo:g,onFailure:m,shouldForceMFA:w,entropyId:C,entropyIdVerifier:v}=o==null?void 0:o.connectWallet,b=S=>{f||(h(!0),m(typeof S=="string"?Error(S):S))};E.useEffect(()=>{let S,j=Z5(e,C);return t&&j?a?((async()=>{let U=await r();if(!U)return b("User must be authenticated and have a Privy wallet before it can be connected");try{await a.connect({accessToken:U,entropyId:C,entropyIdVerifier:v}),w&&await a.verifyMfa({accessToken:U});let I=(Date.now()-u)/1e3;g===ye.EMBEDDED_WALLET_KEY_EXPORT_SCREEN&&I<1?S=setTimeout(()=>{s(g,!1)},1e3*(1-I)):s(g,!1)}catch(I){if(T8(I)&&j.recoveryMethod==="privy"){let B=await r();if(!B)return b("User must be authenticated and have a Privy wallet before it can be recovered");try{i({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:j.address}});let V=await(a==null?void 0:a.recover({accessToken:B,entropyId:C,entropyIdVerifier:v}));V!=null&&V.entropyId||b(Error("Unable to recover wallet")),g?s(g):n({shouldCallAuthOnSuccess:!1}),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:j.address}}),s(g)}catch{b("An error has occurred, please try again.")}}else T8(I)&&j.recoveryMethod!=="privy"?(l({...o,recoverWallet:{entropyId:C,entropyIdVerifier:v,onCompleteNavigateTo:g,onFailure:m},recoveryOAuthStatus:{provider:j.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}}),s(jae(j.recoveryMethod))):b(I)}})(),()=>clearTimeout(S)):void 0:b("User must be authenticated and have a Privy wallet before it can be connected")},[t,e,a]);let A=()=>{b("User exited before wallet could be connected"),n({shouldCallAuthOnSuccess:!1})};return c.current=A,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:A}),f?d.jsxs(d.Fragment,{children:[d.jsxs(nf,{children:[d.jsx(qx,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Something went wrong",description:"We’re on it. Please try again later."})]}),d.jsx(Ot,{onClick:()=>n({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):d.jsx(Mae,{}),d.jsx(tQe,{})]})};let tQe=fe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-124dbb1c-0"})(["height:44px;"]);const rQe=()=>{let{user:t}=$r(),{closePrivyModal:e,isNewUserThisSession:r,updateWallets:n}=_t(),{app:i,data:a,onUserCloseViaDialogOrKeybindRef:s}=wt(),{onSuccess:o,onFailure:l,callAuthOnSuccessOnClose:c}=a.createWallet,u=()=>{let f=js(t);f?(n(),o(f)):l(Error("Failed to create wallet")),e({shouldCallAuthOnSuccess:c})};return E.useEffect(()=>{let f=setTimeout(u,TL);return()=>clearTimeout(f)},[]),s.current=u,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:u}),d.jsx(tn,{}),d.jsxs(nf,{children:[d.jsx(a1,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),d.jsx(zn,{title:r?"Welcome"+(i!=null&&i.name?` to ${i==null?void 0:i.name}`:""):"All set!",description:r?"You’ve successfully created an account.":"Your account is secured."})]}),d.jsx(an,{}),d.jsx(Qt,{})]})},nQe=({children:t,theme:e})=>d.jsxs(iQe,{$theme:e,children:[d.jsx(rf,{width:"1.25rem",color:e==="dark"?"#FDE68A":"var(--privy-color-warn)"}),t]});let iQe=fe.div.withConfig({displayName:"Container",componentId:"sc-97f152b3-0"})(["display:flex;gap:0.5rem;background-color:",";"," align-items:flex-start;text-align:left;padding:0.5rem 0.75rem;font-size:0.8125rem;font-weight:400;line-height:1.125rem;padding:0.75rem;&&{border-radius:var(--privy-border-radius-sm);}"],t=>t.$theme==="dark"?"var(--privy-color-background-2)":"var(--privy-color-warn-light)",t=>t.$theme==="dark"?"color: #FDE68A;":"");const D1=fe.span.withConfig({displayName:"Subtitle",componentId:"sc-7a11f796-0"})(["margin-top:4px;color:var(--privy-color-foreground);text-align:center;font-size:0.875rem;font-weight:400;line-height:1.375rem;&& a{color:var(--privy-color-accent);}"]),hh=fe.span.withConfig({displayName:"Title",componentId:"sc-66de63c-0"})(["color:var(--privy-color-foreground);font-size:1.125rem;font-weight:600;line-height:1.875rem;text-align:center;"]),aQe=()=>{let[t,e]=E.useState(null),{authenticated:r,user:n,getAccessToken:i}=$r(),{closePrivyModal:a,createAnalyticsEvent:s,clientAnalyticsId:o}=_t(),l=Ai(),{data:c,onUserCloseViaDialogOrKeybindRef:u}=wt(),{onFailure:f,onSuccess:h,origin:g,appId:m,appClientId:w,walletToExport:C,primaryWallet:v}=c.keyExport,b=S=>{a({shouldCallAuthOnSuccess:!1}),f(typeof S=="string"?Error(S):S)},A=()=>{a({shouldCallAuthOnSuccess:!1}),h(),s({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:C.address}})};return E.useEffect(()=>{if(!r||!C)return b("User must be authenticated before exporting their wallet");i().then(e,b)},[r,n]),u.current=A,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:A}),d.jsxs(oQe,{children:[d.jsx(hh,{children:"Transfer wallet"}),d.jsxs(D1,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",d.jsx("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),d.jsx(nQe,{theme:l.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),d.jsx(m7,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:C.address,showIcon:!0}),d.jsx("div",{style:{width:"100%"},children:t&&d.jsx(sQe,{origin:g,appId:m,appClientId:w,accessToken:t,clientAnalyticsId:o,walletToExport:C,primaryWallet:v,dimensions:{height:"44px"}})})]}),d.jsx(Qt,{})]})};function sQe(t){let[e,r]=E.useState(t.dimensions.width),[n,i]=E.useState(void 0),a=E.useRef(null);E.useEffect(()=>{if(a.current&&e===void 0){let{width:l}=a.current.getBoundingClientRect();r(l)}let o=getComputedStyle(document.documentElement);i({background:o.getPropertyValue("--privy-color-background"),background2:o.getPropertyValue("--privy-color-background-2"),foreground3:o.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:o.getPropertyValue("--privy-color-foreground-accent"),accent:o.getPropertyValue("--privy-color-accent"),accentDark:o.getPropertyValue("--privy-color-accent-dark"),success:o.getPropertyValue("--privy-color-success")})},[]);let s=t.walletToExport.chainType==="ethereum"&&!t.walletToExport.imported;return d.jsx("div",{ref:a,children:e&&d.jsxs(lQe,{children:[d.jsx("iframe",{style:{position:"absolute",zIndex:1},width:e,height:t.dimensions.height,allow:"clipboard-write self *",src:jee(t.origin,`/apps/${t.appId}/embedded-wallets/export`,{client_id:t.appClientId,primaryAddress:t.primaryWallet.address,address:t.walletToExport.address,walletIndex:t.walletToExport.walletIndex,width:`${e}px`,caid:t.clientAnalyticsId,phrase_export:s,...n},{token:t.accessToken})}),d.jsx(KH,{children:"Loading..."}),s&&d.jsx(KH,{children:"Loading..."})]})})}let oQe=fe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-eaab13a9-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),lQe=fe.div.withConfig({displayName:"ButtonContainer",componentId:"sc-eaab13a9-1"})(["overflow:visible;position:relative;overflow:none;height:44px;display:flex;gap:12px;"]),KH=fe.div.withConfig({displayName:"LoadingButton",componentId:"sc-eaab13a9-2"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);function $ae(){let{getAccessToken:t}=$r(),{refreshUser:e,createAnalyticsEvent:r,initializeWalletProxy:n}=_t(),i=E.useRef(!1);return{createWallet:E.useCallback(async({user:a,recoveryPassword:s})=>{let o=await t();if(!o)throw r({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),Error("An error has occured, please login again.");try{r({eventName:"embedded_wallet_creation_started"});let l=await n(kL);if(!l)throw Error("walletProxy does not exist.");let c=new Promise((g,m)=>{setTimeout(()=>{m(Error("walletProxy.create timed out."))},2e4)}),u=au(a);if(!await Promise.race([l.create({accessToken:o,recoveryPassword:s,recoveryMethod:s?"user-passcode":void 0,solanaAddress:u==null?void 0:u.address}),c]))throw Error("walletProxy.create did not send a response.");let f=await e();if(!f)throw Error("Failed to refresh user.");let h=js(f);if(!h)throw Error("Updated user is missing embedded wallet.");return r({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:h.address}}),i.current=!0,h}catch(l){if(i.current)return;throw r({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}const cQe=()=>{let{app:t,setModalData:e,navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=wt(),[a,s]=E.useState(""),{embeddedWallets:o}=Ai(),{authenticated:l,user:c}=$r(),{closePrivyModal:u}=_t(),{onSuccess:f,onFailure:h,callAuthOnSuccessOnClose:g}=n.createWallet,m=(t==null?void 0:t.embeddedWallets.requireUserOwnedRecoveryOnCreate)===!0,{createWallet:w}=$ae(),[C,v]=E.useState(null),b=new is(async()=>{try{let A=await w({user:c});if(!A)return;v(A),r(ye.EMBEDDED_WALLET_CREATED_SCREEN)}catch(A){s(A.message)}});return E.useEffect(()=>l&&c?m?(e({...n,recoverySelection:{...n==null?void 0:n.recoverySelection,isInAccountCreateFlow:!0}}),r(Lae({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:o.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void b.execute():(r(ye.LANDING),void h(Error("User must be authenticated before creating a Privy wallet"))),[m,l]),i.current=()=>null,a?d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsxs(nf,{children:[d.jsx(qx,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Something went wrong",description:a})]}),d.jsx(Ot,{onClick:()=>{C?(f(C),u({shouldCallAuthOnSuccess:g})):(h(new th("User wallet creation failed")),u({shouldCallAuthOnSuccess:!1}))},children:"Close"}),d.jsx(uQe,{})]}):d.jsx(Mae,{})};let uQe=fe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-eabafbf4-0"})(["height:44px;"]);var dQe=function(e,r){return Math.round(r*Math.log(e)/Math.LN2)},fQe=[{name:"lowercase",re:/[a-z]/,length:26},{name:"uppercase",re:/[A-Z]/,length:26},{name:"numbers",re:/[0-9]/,length:10},{name:"symbols",re:/[^a-zA-Z0-9]/,length:33}],hQe=function(e){return function(r){return e.reduce(function(n,i){return n+(i.re.test(r)?i.length:0)},0)}},pQe=hQe(fQe),gQe=function(e){return e?dQe(pQe(e),e.length):0},mQe=gQe;const yQe=Lo(mQe);function Pae(t){return crypto.getRandomValues(new Uint8Array(t))}const wQe=256,Vy=65536;function vQe(){const[t]=Pae(1);return t}function bQe(){const[t,e]=Pae(2);return(t<<8)+e}function xQe(t){if(typeof t!="number"||t<2||t>Vy)throw new Error(`Invalid number: number must be at least two and at most ${Vy}`);const e=t>256,r=e?Vy:wQe,n=e?bQe:vQe,i=t*Math.floor(r/t);for(;;){const a=n();if(aVy)throw new Error(`Invalid argument: end must be a number less than or equal to ${Vy}`);if(r-e<2)throw new Error("Invalid range: range must contain at least two values");const n=[];for(let i=0;i{const s=e[i];return n+(a===0?s:r+s)},"")}const CQe=Object.freeze(["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","amigo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","coastline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dish","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","euphemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","giddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungrily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasses","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastrami","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","recycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","tingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unusable","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]),SQe=Object.freeze(CQe.filter(t=>!t.includes("-")));let AQe=/[a-z]/,IQe=/[A-Z]/,MQe=/[0-9]/,Rae="!@#$%^&*()\\-_+.",Dae=`a-zA-Z0-9${Rae}`,TQe=RegExp(`[${Rae}]`),kQe=RegExp(`[${Dae}]`);const NQe=RegExp(`^[${Dae}]{6,}$`),LQe=(t="")=>[...new Set(t.split("").filter(e=>!kQe.test(e)).map(e=>e.replace(" ","SPACE")))],Oae=()=>_Qe(4,SQe);function jQe(t){return t>.9?"Strong":t>.5?"Medium":"Weak"}function $Qe(t){if(t.length<8)return 0;let e=0;return AQe.test(t)&&(e+=1),IQe.test(t)&&(e+=1),MQe.test(t)&&(e+=1),TQe.test(t)&&(e+=1),Math.max(0,Math.min(1,e/3))}function PQe(t=""){return(.3*$Qe(t)+yQe(t)/95)/2}function RQe(t=""){let e=PQe(t);return{value:e,label:jQe(e)}}function DQe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const OQe=E.forwardRef(DQe);function FQe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const UQe=E.forwardRef(FQe);function BQe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const zQe=E.forwardRef(BQe);let WQe=la(["font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;text-align:left;transition:color 0.1s ease-in;"]);const Fae=fe.span.withConfig({displayName:"StatusText",componentId:"sc-3f6866a9-0"})([""," transition:color 0.1s ease-in;color:",";text-transform:",";&[aria-hidden='true']{visibility:hidden;}"],WQe,({error:t})=>t?"var(--privy-color-error)":"var(--privy-color-foreground-3)",({error:t})=>t?"":"capitalize"),w7=fe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-3f6866a9-1"})(["display:flex;flex-direction:column;justify-content:center;flex-grow:1;"]),v7=fe(Ot).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-3f6866a9-2"})(["",""],t=>t.hideAnimations&&la(["&&{transition:none;}"]));let Uae=la(["&&{width:100%;border-width:1px;border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);background:var(--privy-color-background);color:var(--privy-color-foreground);padding:12px;font-size:16px;font-style:normal;font-weight:300;line-height:22px;}"]);const qj=fe.input.withConfig({displayName:"PasswordInput",componentId:"sc-3f6866a9-3"})([""," &::placeholder{color:var(--privy-color-foreground-3);font-style:italic;font-size:14px;}overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"],Uae),HQe=fe.div.withConfig({displayName:"PasswordDisplay",componentId:"sc-3f6866a9-4"})(["",""],Uae),b7=fe.div.withConfig({displayName:"PasswordContainer",componentId:"sc-3f6866a9-5"})(["position:relative;width:100%;display:flex;align-items:center;justify-content:",";"],({centered:t})=>t?"center":"space-between"),x7=fe.div.withConfig({displayName:"Header",componentId:"sc-3f6866a9-6"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:32px 0;gap:4px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),Vj=fe.div.withConfig({displayName:"Details",componentId:"sc-3f6866a9-7"})(["display:flex;flex-direction:column;gap:10px;padding-bottom:1rem;"]),PT=fe.div.withConfig({displayName:"DetailItem",componentId:"sc-3f6866a9-8"})(["display:flex;text-align:left;align-items:center;gap:8px;max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;margin:0 8px;color:var(--privy-color-foreground-2);> :first-child{min-width:24px;}"]),JH=fe(Fx).withConfig({displayName:"ExportButton",componentId:"sc-3f6866a9-10"})(["display:flex;flex:1;gap:4px;justify-content:center;&&{background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);border-width:1px;}"]),Yj=fe.div.withConfig({displayName:"InputRightIcons",componentId:"sc-3f6866a9-11"})(["position:absolute;right:0.5rem;display:flex;flex-direction:row;justify-content:space-around;align-items:center;"]),GQe=fe(OQe).withConfig({displayName:"RegenerateIcon",componentId:"sc-3f6866a9-12"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),Kj=fe(zQe).withConfig({displayName:"HiddenIcon",componentId:"sc-3f6866a9-13"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),Jj=fe(UQe).withConfig({displayName:"ShownIcon",componentId:"sc-3f6866a9-14"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),qQe=fe.progress.withConfig({displayName:"StrengthMeter",componentId:"sc-3f6866a9-15"})(["height:4px;width:100%;margin:8px 0;::-webkit-progress-bar{border-radius:8px;background:var(--privy-color-foreground-4);}::-webkit-progress-value{border-radius:8px;transition:all 0.1s ease-out;background:",";}"],({label:t})=>(t==="Strong"?"#78dca6":t==="Medium"&&"var(--privy-color-warn)")||"var(--privy-color-error)"),VQe=({buttonHideAnimations:t,buttonLoading:e,password:r,onSubmit:n,onBack:i})=>{let[a,s]=E.useState(!0),[o,l]=E.useState(!1),[c,u]=E.useState(""),f=r===c;return E.useEffect(()=>{c&&!o&&l(!0)},[c]),d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1,backFn:i}),d.jsx(tn,{}),d.jsxs(w7,{children:[d.jsxs(x7,{children:[d.jsx(rf,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),d.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),d.jsxs(b7,{children:[d.jsx(qj,{value:c,onChange:h=>u(h.target.value),onKeyUp:h=>{h.key==="Enter"&&n()},onBlur:()=>l(!0),placeholder:"confirm your password",type:a?"password":"text",style:{paddingRight:"2.3rem"}}),d.jsx(Yj,{style:{right:"0.75rem"},children:a?d.jsx(Kj,{onClick:()=>s(!1)}):d.jsx(Jj,{onClick:()=>s(!0)})})]}),d.jsx(Fae,{"aria-hidden":!o||f,error:!0,children:"Passwords do not match"})]}),d.jsx(v7,{onClick:n,loading:e,disabled:!f,hideAnimations:t,children:"Continue"}),d.jsx(an,{}),d.jsx(Qt,{})]})},YQe=({className:t,checked:e,color:r="var(--privy-color-accent)",...n})=>d.jsx("label",{children:d.jsxs(KQe,{className:t,children:[d.jsx(zae,{checked:e,...n}),d.jsx(JQe,{color:r,checked:e,children:d.jsx(Bae,{viewBox:"0 0 24 24",children:d.jsx("polyline",{points:"20 6 9 17 4 12"})})})]})});let KQe=fe.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-db51b935-1"})(["display:inline-block;vertical-align:middle;"]),Bae=fe.svg.withConfig({displayName:"Icon",componentId:"sc-db51b935-2"})(["fill:none;stroke:white;stroke-width:3px;"]),zae=fe.input.attrs({type:"checkbox"}).withConfig({displayName:"HiddenCheckbox",componentId:"sc-db51b935-3"})(["border:0;clip:rect(0 0 0 0);clippath:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;"]),JQe=fe.div.withConfig({displayName:"StyledCheckbox",componentId:"sc-db51b935-4"})(["display:inline-block;width:18px;height:18px;transition:all 150ms;cursor:pointer;border-color:",";border-radius:3px;background:",";&&{border-width:1px;}",":focus + &{box-shadow:0 0 0 1px ",";}","{visibility:",";}"],t=>t.color,t=>t.checked?t.color:"var(--privy-color-background)",zae,t=>t.color,Bae,t=>t.checked?"visible":"hidden");const QQe=({buttonHideAnimations:t,buttonLoading:e,onSubmit:r,onBack:n,config:i})=>{let[a,s]=E.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1,backFn:n}),d.jsx(tn,{}),d.jsxs(w7,{children:[d.jsxs(x7,{children:[d.jsx(rf,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),d.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),d.jsx(Vj,{children:d.jsxs(PT,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:o=>{o.preventDefault(),s(l=>!l)},children:[d.jsx(YQe,{color:"var(--privy-color-error)",readOnly:!0,checked:a}),d.jsx(d.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),d.jsxs(ZQe,{children:[i.initiatedBy==="user"&&d.jsx(Yd,{onClick:i.onCancel,disabled:e,children:"Cancel"}),d.jsx(v7,{onClick:r,loading:e,hideAnimations:t,disabled:!a,children:"Set Password"})]}),d.jsx(an,{}),d.jsx(Qt,{})]})};let ZQe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-eb601350-0"})(["display:flex;gap:10px;"]);function XQe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))}const eZe=E.forwardRef(XQe),tZe=({buttonHideAnimations:t,buttonLoading:e,password:r="",config:n,isResettingPassword:i,onSubmit:a,onClose:s,onBack:o,onPasswordChange:l,onPasswordGenerate:c})=>{let[u,f]=E.useState(!1),[h,g]=E.useState(!1);E.useEffect(()=>{r&&!h&&g(!0)},[r]);let m=E.useMemo(()=>h?6>((r==null?void 0:r.length)||0)?"Password must be at least 6 characters":NQe.test(r||"")?null:`Invalid characters used ( ${LQe(r).join(" ")} )`:null,[r,h]),w=E.useMemo(()=>m?{value:0,label:"Weak"}:RQe(r),[r,m]),C=E.useMemo(()=>!(r!=null&&r.length)||!!m,[m,r]);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:s,closeable:n.initiatedBy==="user",backFn:o}),d.jsx(tn,{}),d.jsxs(w7,{children:[d.jsxs(x7,{children:[d.jsx(eZe,{height:48,width:48,stroke:"var(--privy-color-accent)"}),d.jsxs("h3",{style:{color:"var(--privy-color-foreground)"},children:[i?"Reset":"Set"," your password"]}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),d.jsxs(b7,{children:[d.jsx(qj,{value:r,onChange:v=>l(v.target.value),onKeyUp:v=>{v.key==="Enter"&&a()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),d.jsxs(Yj,{style:{width:"3.5rem"},children:[u?d.jsx(Kj,{onClick:()=>f(!1)}):d.jsx(Jj,{onClick:()=>f(!0)}),d.jsx(GQe,{onClick:c})]})]}),d.jsx(qQe,{value:w.value===0?.01:w.value,label:w.label}),d.jsx(Fae,{error:!!m,children:m||`Password Strength: ${h?w.label:"--"}`}),d.jsxs(nZe,{children:[d.jsx(rZe,{children:d.jsxs(Vj,{children:[d.jsxs(PT,{children:[d.jsx(a1,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),d.jsxs(PT,{children:[d.jsx(a1,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),d.jsx(v7,{onClick:a,loading:e,disabled:C,hideAnimations:t,children:"Continue"})]})]}),d.jsx(an,{}),d.jsx(Qt,{})]})};let rZe=fe(Vj).withConfig({displayName:"DetailsContainer",componentId:"sc-7b3b7727-0"})(["flex:1;padding-top:1rem;"]),nZe=fe.div.withConfig({displayName:"LowerContainer",componentId:"sc-7b3b7727-1"})(["display:flex;flex-direction:column;height:100%;"]);function iZe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const aZe=E.forwardRef(iZe);function sZe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0 1 18 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3 1.5 1.5 3-3.75"}))}const Wae=E.forwardRef(sZe);function oZe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"}))}const lZe=E.forwardRef(oZe),cZe=({buttonHideAnimations:t,buttonLoading:e,appName:r,password:n,onSubmit:i,onBack:a})=>{let[s,o]=E.useState(!1),l=E.useCallback(()=>{o(!0),n&&navigator.clipboard.writeText(n)},[n]),c=E.useCallback(()=>{let u=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),h=new Blob([uZe(r,n)],{type:"text/plain"}),g=URL.createObjectURL(h);u.href=g,u.target="_blank",u.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(g)},5e3)},[n]);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:a,closeable:!1}),d.jsx(tn,{}),d.jsxs(w7,{children:[d.jsxs(x7,{children:[d.jsx(rf,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),d.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),d.jsx(b7,{centered:!0,children:d.jsx(HQe,{children:n})}),d.jsxs("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[d.jsx(JH,{onClick:l,children:d.jsxs(d.Fragment,s?{children:[d.jsx(Wae,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[d.jsx(lZe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),d.jsxs(JH,{onClick:c,children:[d.jsx(aZe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),d.jsx(v7,{onClick:i,loading:e,hideAnimations:t,children:"Continue"}),d.jsx(an,{}),d.jsx(Qt,{})]})};let uZe=(t,e)=>`Your wallet recovery password for ${t} is - -${e} - -You will need this password to access your ${t} wallet on a new device. Please keep it somewhere safe.`;const dZe=({error:t,onClose:e})=>d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsx(tn,{}),d.jsxs(nf,t?{children:[d.jsx(qx,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Something went wrong",description:t})]}:{children:[d.jsx(a1,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Success"})]}),d.jsx(Ot,{onClick:e,children:"Close"}),d.jsx(an,{}),d.jsx(Qt,{})]});let fZe=(t,e)=>{switch(t){case"creating":return e==="back"?t:"saving";case"saving":return e==="back"?"creating":"confirming";case"confirming":return e==="back"?"saving":"finalizing";case"finalizing":return e==="back"?"confirming":"done";default:return t}};const hZe=()=>{let[t,e]=E.useReducer(fZe,"creating");return{send:e,state:t}},Hae=({onSubmit:t,...e})=>{let{lastScreen:r,navigate:n}=wt(),{send:i,state:a}=hZe(),s=E.useCallback(async()=>{a==="finalizing"&&await t(),i("next")},[a,i,t]);E.useEffect(()=>{let c;return a==="done"&&e.config.initiatedBy==="automatic"&&(c=setTimeout(()=>{var u;return(u=e.onClose)==null?void 0:u.call(e)},Dn)),()=>{c&&clearTimeout(c)}},[a,e.config.initiatedBy,e.onClose]);let o=E.useCallback(()=>{i("back")},[i]),l=E.useCallback(()=>{n(ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN)},[r,n]);return a==="creating"?d.jsx(tZe,{...e,onSubmit:s,onBack:r===ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN?l:void 0}):a==="saving"?d.jsx(cZe,{...e,onSubmit:s,onBack:o}):a==="confirming"?d.jsx(VQe,{...e,onSubmit:s,onBack:o}):a==="finalizing"?d.jsx(QQe,{...e,onSubmit:s,onBack:o}):a==="done"?d.jsx(dZe,{...e,onSubmit:s}):null},pZe=()=>{let[t,e]=E.useState(null),[r,n]=E.useState(!1),[i,a]=E.useState(null),[s,o]=E.useState(""),{authenticated:l,getAccessToken:c,user:u}=$r(),{walletProxy:f,refreshUser:h,closePrivyModal:g,createAnalyticsEvent:m}=_t(),{app:w,navigate:C,data:v,onUserCloseViaDialogOrKeybindRef:b}=wt(),{onSuccess:A,onFailure:S}=v.createWallet,j=mo(u),U=(t==null?void 0:t.recoveryMethod)==="user-passcode",I=(j==null?void 0:j.recoveryMethod)==="user-passcode";E.useEffect(()=>{l||(C(ye.LANDING),S(new WIe("User must be authenticated before setting a password on a Privy wallet")))},[l]);let B=()=>i?(S(i),void g({shouldCallAuthOnSuccess:!1})):U?(A(t),void g({shouldCallAuthOnSuccess:!1})):(S(new th("Exited before password was added to wallet")),void g({shouldCallAuthOnSuccess:!1}));return b.current=B,d.jsx(Hae,{appName:(w==null?void 0:w.name)||"privy",config:{initiatedBy:"user",onCancel:B},error:i?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:s,isResettingPassword:I,onPasswordGenerate:()=>o(Oae()),onPasswordChange:o,onSubmit:async()=>{U?(A(t),g({shouldCallAuthOnSuccess:!1})):(n(!0),a(null),await(async()=>{let V=await c();if(V&&(j!=null&&j.address)&&s&&f)try{m({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I}});let{entropyId:se,entropyIdVerifier:Y}=qn(j);if(!(await f.setRecovery({accessToken:V,entropyId:se,entropyIdVerifier:Y,recoveryPassword:s,recoveryMethod:"user-passcode"})).entropyId)return a(new th("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I,reason:"error setting password"}});let N=await h(),k=mo(N);if(!k)return a(new th("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I,reason:"wallet disconnected"}});e(k),m({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I}})}catch(se){console.warn(se),a(se instanceof Error?se:Error("Error setting password on privy wallet")),m({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:j.address,reason:se}})}})(),n(!1))},onClose:B})};function gZe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const Qj=E.forwardRef(gZe);function mZe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 0 0-5.25 5.25v3a3 3 0 0 0-3 3v6.75a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3v-6.75a3 3 0 0 0-3-3v-3c0-2.9-2.35-5.25-5.25-5.25Zm3.75 8.25v-3a3.75 3.75 0 1 0-7.5 0v3h7.5Z",clipRule:"evenodd"}))}const Gae=E.forwardRef(mZe),yZe=()=>{let{closePrivyModal:t}=_t(),{data:e,setModalData:r,navigate:n,onUserCloseViaDialogOrKeybindRef:i}=wt(),{onSuccess:a,onFailure:s}=e.setWalletPassword,o=()=>{s(new th("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return i.current=o,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:o}),d.jsx(tn,{}),d.jsxs(nf,{children:[d.jsxs(NDe,{children:[d.jsx(Qj,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),d.jsx(LDe,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:d.jsx(Gae,{width:"12px",height:"12px",fill:"white"})})]}),d.jsxs(zn,{title:"Secure Your Account",children:["Please set a password to secure your account.",d.jsx("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),d.jsx(Ot,{onClick:()=>{r({createWallet:{onFailure:s,onSuccess:a,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),n(ye.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN)},children:"Add password"}),d.jsx(an,{}),d.jsx(Qt,{})]})};let wZe=(t,e)=>{let r=d.jsx(rf,{height:38,width:38,stroke:"var(--privy-color-error)"});if(t instanceof _e)switch(t.privyErrorCode){case Ae.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:t.message,ctaText:"Try again",icon:r};case Ae.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:t.message,ctaText:"Try again",icon:r};case Ae.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:t.message,ctaText:"Try again",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else{if(t instanceof ri&&t.type==="twilio_verification_failed")return{title:"Something went wrong",detail:t.message,ctaText:"Try again",icon:d.jsx(Cc,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(!(t instanceof Ks))return t instanceof ol&&t.status&&[400,422].includes(t.status)?{title:"Something went wrong",detail:t.message,ctaText:"Try again",icon:r}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r};switch(t.privyErrorCode){case Ae.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case Ae.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:t.message,ctaText:"Try another method",icon:r};case Ae.ALLOWLIST_REJECTED:return{title:e.errorTitle||"You don't have access to this app",detail:e.errorDetail||"Have you been invited?",ctaText:e.errorCtaText||"Try another account",icon:d.jsx(Lne,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case Ae.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:d.jsx("span",{})};case Ae.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:d.jsx("span",{})};case Ae.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case Ae.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:r};case Ae.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}}};const vZe=()=>{var s,o;let{navigate:t,navigateBack:e,data:r,lastScreen:n,currentScreen:i}=wt(),a=((s=r==null?void 0:r.errorModalData)==null?void 0:s.previousScreen)||(n===i?void 0:n);return d.jsx(Sv,{error:((o=r==null?void 0:r.errorModalData)==null?void 0:o.error)||Error(),backFn:()=>a?t(a,!1):e(),onClick:()=>t(a||ye.LANDING,!1)})},Sv=({error:t,backFn:e,onClick:r})=>{let{reset:n}=Do(),{app:i}=wt(),a=wZe(t,i.allowlistConfig);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:e}),d.jsxs(bZe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(fj,{color:"var(--privy-color-error)"}),a.icon]})}),d.jsxs(xZe,{children:[d.jsx("h3",{children:a.title}),d.jsx("p",{children:a.detail})]}),d.jsx(Ot,{color:"var(--privy-color-error)",onClick:()=>{t instanceof Ks&&(t.privyErrorCode===Ae.INVALID_CAPTCHA&&n(),t.privyErrorCode===Ae.ALLOWLIST_REJECTED&&i.allowlistConfig.errorCtaLink)?window.location.href=i.allowlistConfig.errorCtaLink:r==null||r()},children:a.ctaText})]})]})};let bZe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-1d84a574-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;"]),xZe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-1d84a574-1"})(["display:flex;flex-direction:column;gap:8px;"]);const qae=({style:t,color:e,...r})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:e||"currentColor",style:{height:"1.5rem",width:"1.5rem",...t},...r,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),EZe=({color:t,...e})=>d.jsx("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...e,children:d.jsx("g",{children:d.jsx("path",{fill:t||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})}),E7=t=>{let[e,r]=E.useState(!1);return d.jsxs(_Ze,{color:t.color,onClick:()=>{r(!0),navigator.clipboard.writeText(t.text),setTimeout(()=>r(!1),1500)},justCopied:e,children:[e?d.jsx(qae,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):d.jsx(EZe,{style:{height:"14px",width:"14px"}}),e?"Copied":"Copy"," ",t.itemName?t.itemName:"to Clipboard"]})};let _Ze=fe.button.withConfig({displayName:"StyledCopytoClipboardButton",componentId:"sc-9c2ee64b-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;height:14px;}"],t=>t.justCopied?"var(--privy-color-foreground)":t.color||"var(--privy-color-foreground-3)",t=>t.justCopied?"medium":"normal",t=>t.justCopied?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)");const Vae=t=>{let[e,r]=E.useState(!1);return d.jsx(CZe,{color:t.color,href:t.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:e,children:t.text})};let CZe=fe.a.withConfig({displayName:"StyledOpenLinkButton",componentId:"sc-4e695c83-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;height:14px;}"],t=>t.justOpened?"var(--privy-color-foreground)":t.color||"var(--privy-color-foreground-3)",t=>t.justOpened?"medium":"normal",t=>t.justOpened?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)");var Av={},SZe=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Yae={},Uo={};let Zj;const AZe=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Uo.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Uo.getSymbolTotalCodewords=function(e){return AZe[e]};Uo.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Uo.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Zj=e};Uo.isKanjiModeEnabled=function(){return typeof Zj<"u"};Uo.toSJIS=function(e){return Zj(e)};var _7={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(_7);function Kae(){this.buffer=[],this.length=0}Kae.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var IZe=Kae;function Iv(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}Iv.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)};Iv.prototype.get=function(t,e){return this.data[t*this.size+e]};Iv.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Iv.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var MZe=Iv,Jae={};(function(t){const e=Uo.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,a=e(n),s=a===145?26:Math.ceil((a-13)/(2*i-2))*2,o=[a-7];for(let l=1;l=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const a=i.size;let s=0,o=0,l=0,c=null,u=null;for(let f=0;f=5&&(s+=e.N1+(o-5)),c=g,o=1),g=i.get(h,f),g===u?l++:(l>=5&&(s+=e.N1+(l-5)),u=g,l=1)}o>=5&&(s+=e.N1+(o-5)),l>=5&&(s+=e.N1+(l-5))}return s},t.getPenaltyN2=function(i){const a=i.size;let s=0;for(let o=0;o=10&&(o===1488||o===93)&&s++,l=l<<1&2047|i.get(u,c),u>=10&&(l===1488||l===93)&&s++}return s*e.N3},t.getPenaltyN4=function(i){let a=0;const s=i.data.length;for(let l=0;l=0;){const s=a[0];for(let l=0;l0){const a=new Uint8Array(this.degree);return a.set(n,i),a}return n};var kZe=Xj,tse={},jh={},e$={};e$.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Ou={};const rse="[0-9]+",NZe="[A-Z $%*+\\-./:]+";let l3="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";l3=l3.replace(/u/g,"\\u");const LZe="(?:(?![A-Z0-9 $%*+\\-./:]|"+l3+`)(?:.|[\r -]))+`;Ou.KANJI=new RegExp(l3,"g");Ou.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Ou.BYTE=new RegExp(LZe,"g");Ou.NUMERIC=new RegExp(rse,"g");Ou.ALPHANUMERIC=new RegExp(NZe,"g");const jZe=new RegExp("^"+l3+"$"),$Ze=new RegExp("^"+rse+"$"),PZe=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Ou.testKanji=function(e){return jZe.test(e)};Ou.testNumeric=function(e){return $Ze.test(e)};Ou.testAlphanumeric=function(e){return PZe.test(e)};(function(t){const e=e$,r=Ou;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(a,s){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?a.ccBits[0]:s<27?a.ccBits[1]:a.ccBits[2]},t.getBestModeForData=function(a){return r.testNumeric(a)?t.NUMERIC:r.testAlphanumeric(a)?t.ALPHANUMERIC:r.testKanji(a)?t.KANJI:t.BYTE},t.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},t.isValid=function(a){return a&&a.bit&&a.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(a,s){if(t.isValid(a))return a;try{return n(a)}catch{return s}}})(jh);(function(t){const e=Uo,r=C7,n=_7,i=jh,a=e$,s=7973,o=e.getBCHDigit(s);function l(h,g,m){for(let w=1;w<=40;w++)if(g<=t.getCapacity(w,m,h))return w}function c(h,g){return i.getCharCountIndicator(h,g)+4}function u(h,g){let m=0;return h.forEach(function(w){const C=c(w.mode,g);m+=C+w.getBitsLength()}),m}function f(h,g){for(let m=1;m<=40;m++)if(u(h,m)<=t.getCapacity(m,g,i.MIXED))return m}t.from=function(g,m){return a.isValid(g)?parseInt(g,10):m},t.getCapacity=function(g,m,w){if(!a.isValid(g))throw new Error("Invalid QR Code version");typeof w>"u"&&(w=i.BYTE);const C=e.getSymbolTotalCodewords(g),v=r.getTotalCodewordsCount(g,m),b=(C-v)*8;if(w===i.MIXED)return b;const A=b-c(w,g);switch(w){case i.NUMERIC:return Math.floor(A/10*3);case i.ALPHANUMERIC:return Math.floor(A/11*2);case i.KANJI:return Math.floor(A/13);case i.BYTE:default:return Math.floor(A/8)}},t.getBestVersionForData=function(g,m){let w;const C=n.from(m,n.M);if(Array.isArray(g)){if(g.length>1)return f(g,C);if(g.length===0)return 1;w=g[0]}else w=g;return l(w.mode,w.getLength(),C)},t.getEncodedBits=function(g){if(!a.isValid(g)||g<7)throw new Error("Invalid QR Code version");let m=g<<12;for(;e.getBCHDigit(m)-o>=0;)m^=s<=0;)i^=ise<0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,a*3+1))};var OZe=rm;const FZe=jh,GS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function nm(t){this.mode=FZe.ALPHANUMERIC,this.data=t}nm.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};nm.prototype.getLength=function(){return this.data.length};nm.prototype.getBitsLength=function(){return nm.getBitsLength(this.data.length)};nm.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=GS.indexOf(this.data[r])*45;n+=GS.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(GS.indexOf(this.data[r]),6)};var UZe=nm;const BZe=jh;function im(t){this.mode=BZe.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}im.getBitsLength=function(e){return e*8};im.prototype.getLength=function(){return this.data.length};im.prototype.getBitsLength=function(){return im.getBitsLength(this.data.length)};im.prototype.write=function(t){for(let e=0,r=this.data.length;e=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` -Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var GZe=am,sse={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var a={},s={};s[n]=0;var o=e.PriorityQueue.make();o.push(n,0);for(var l,c,u,f,h,g,m,w,C;!o.empty();){l=o.pop(),c=l.value,f=l.cost,h=r[c]||{};for(u in h)h.hasOwnProperty(u)&&(g=h[u],m=f+g,w=s[u],C=typeof s[u]>"u",(C||w>m)&&(s[u]=m,o.push(u,m),a[u]=c))}if(typeof i<"u"&&typeof s[i]>"u"){var v=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(v)}return a},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],a=n;a;)i.push(a),r[a],a=r[a];return i.reverse(),i},find_path:function(r,n,i){var a=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},a;r=r||{};for(a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(sse);var qZe=sse.exports;(function(t){const e=jh,r=OZe,n=UZe,i=zZe,a=GZe,s=Ou,o=Uo,l=qZe;function c(v){return unescape(encodeURIComponent(v)).length}function u(v,b,A){const S=[];let j;for(;(j=v.exec(A))!==null;)S.push({data:j[0],index:j.index,mode:b,length:j[0].length});return S}function f(v){const b=u(s.NUMERIC,e.NUMERIC,v),A=u(s.ALPHANUMERIC,e.ALPHANUMERIC,v);let S,j;return o.isKanjiModeEnabled()?(S=u(s.BYTE,e.BYTE,v),j=u(s.KANJI,e.KANJI,v)):(S=u(s.BYTE_KANJI,e.BYTE,v),j=[]),b.concat(A,S,j).sort(function(I,B){return I.index-B.index}).map(function(I){return{data:I.data,mode:I.mode,length:I.length}})}function h(v,b){switch(b){case e.NUMERIC:return r.getBitsLength(v);case e.ALPHANUMERIC:return n.getBitsLength(v);case e.KANJI:return a.getBitsLength(v);case e.BYTE:return i.getBitsLength(v)}}function g(v){return v.reduce(function(b,A){const S=b.length-1>=0?b[b.length-1]:null;return S&&S.mode===A.mode?(b[b.length-1].data+=A.data,b):(b.push(A),b)},[])}function m(v){const b=[];for(let A=0;A=0&&o<=6&&(l===0||l===6)||l>=0&&l<=6&&(o===0||o===6)||o>=2&&o<=4&&l>=2&&l<=4?t.set(a+o,s+l,!0,!0):t.set(a+o,s+l,!1,!0))}}function tXe(t){const e=t.size;for(let r=8;r>o&1)===1,t.set(i,a,s,!0),t.set(a,i,s,!0)}function YS(t,e,r){const n=t.size,i=ZZe.getEncodedBits(e,r);let a,s;for(a=0;a<15;a++)s=(i>>a&1)===1,a<6?t.set(a,8,s,!0):a<8?t.set(a+1,8,s,!0):t.set(n-15+a,8,s,!0),a<8?t.set(8,n-a-1,s,!0):a<9?t.set(8,15-a-1+1,s,!0):t.set(8,15-a-1,s,!0);t.set(n-8,8,1,!0)}function iXe(t,e){const r=t.size;let n=-1,i=r-1,a=7,s=0;for(let o=r-1;o>0;o-=2)for(o===6&&o--;;){for(let l=0;l<2;l++)if(!t.isReserved(i,o-l)){let c=!1;s>>a&1)===1),t.set(i,o-l,c),a--,a===-1&&(s++,a=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function aXe(t,e,r){const n=new VZe;r.forEach(function(l){n.put(l.mode.bit,4),n.put(l.getLength(),XZe.getCharCountIndicator(l.mode,t)),l.write(n)});const i=A7.getSymbolTotalCodewords(t),a=OT.getTotalCodewordsCount(t,e),s=(i-a)*8;for(n.getLengthInBits()+4<=s&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const o=(s-n.getLengthInBits())/8;for(let l=0;l=7&&nXe(l,e),iXe(l,s),isNaN(n)&&(n=DT.getBestMask(l,YS.bind(null,l,r))),DT.applyMask(n,l),YS(l,r,n),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}Yae.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=qS.M,i,a;return typeof r<"u"&&(n=qS.from(r.errorCorrectionLevel,qS.M),i=N8.from(r.version),a=DT.from(r.maskPattern),r.toSJISFunc&&A7.setToSJISFunction(r.toSJISFunc)),oXe(e,i,n,a)};var ose={},t$={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:a,scale:a?4:s,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const a=t.getScale(n,i);return Math.floor((n+i.margin*2)*a)},t.qrToImageData=function(n,i,a){const s=i.modules.size,o=i.modules.data,l=t.getScale(s,a),c=Math.floor((s+a.margin*2)*l),u=a.margin*l,f=[a.color.light,a.color.dark];for(let h=0;h=u&&g>=u&&h"u"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(c=n()),l=e.getOptions(l);const u=e.getImageWidth(a.modules.size,l),f=c.getContext("2d"),h=f.createImageData(u,u);return e.qrToImageData(h.data,a,l),r(f,c,u),f.putImageData(h,0,0),c},t.renderToDataURL=function(a,s,o){let l=o;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const c=t.render(a,s,l),u=l.type||"image/png",f=l.rendererOpts||{};return c.toDataURL(u,f.quality)}})(ose);var lse={};const lXe=t$;function XH(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function KS(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function cXe(t,e,r){let n="",i=0,a=!1,s=0;for(let o=0;o0&&l>0&&t[o-1]||(n+=a?KS("M",l+r,.5+c+r):KS("m",i,0),i=0,a=!1),l+1':"",c="',u='viewBox="0 0 '+o+" "+o+'"',h=''+l+c+` -`;return typeof n=="function"&&n(null,h),h};const uXe=SZe,FT=Yae,cse=ose,dXe=lse;function r$(t,e,r,n,i){const a=[].slice.call(arguments,1),s=a.length,o=typeof a[s-1]=="function";if(!o&&!uXe())throw new Error("Callback required as last argument");if(o){if(s<2)throw new Error("Too few arguments provided");s===2?(i=r,r=e,e=n=void 0):s===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(r=e,e=n=void 0):s===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(l,c){try{const u=FT.create(r,n);l(t(u,e,n))}catch(u){c(u)}})}try{const l=FT.create(r,n);i(null,t(l,e,n))}catch(l){i(l)}}Av.create=FT.create;Av.toCanvas=r$.bind(null,cse.render);Av.toDataURL=r$.bind(null,cse.renderToDataURL);Av.toString=r$.bind(null,function(t,e,r){return dXe.render(t,r)});const fXe=()=>d.jsx("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:d.jsx("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});let JS=(t,e,r,n,i)=>{for(let a=e;a{let r=Av.create(t,{errorCorrectionLevel:e}).modules,n=qMe(Array.from(r.data),r.size);return n=JS(n,0,0,7,7),n=JS(n,n.length-7,0,7,7),JS(n,0,n.length-7,7,7)},pXe=({x:t,y:e,cellSize:r,bgColor:n,fgColor:i})=>d.jsx(d.Fragment,{children:[0,1,2].map(a=>d.jsx("circle",{r:r*(7-2*a)/2,cx:t+7*r/2,cy:e+7*r/2,fill:a%2!=0?n:i},`finder-${t}-${e}-${a}`))}),gXe=({cellSize:t,matrixSize:e,bgColor:r,fgColor:n})=>d.jsx(d.Fragment,{children:[[0,0],[(e-7)*t,0],[0,(e-7)*t]].map(([i,a])=>d.jsx(pXe,{x:i,y:a,cellSize:t,bgColor:r,fgColor:n},`finder-${i}-${a}`))}),mXe=({matrix:t,cellSize:e,color:r})=>d.jsx(d.Fragment,{children:t.map((n,i)=>n.map((a,s)=>a?d.jsx("rect",{height:e-.4,width:e-.4,x:i*e+.1*e,y:s*e+.1*e,rx:.5*e,ry:.5*e,fill:r},`cell-${i}-${s}`):d.jsx(Et.Fragment,{},`circle-${i}-${s}`)))}),yXe=({cellSize:t,matrixSize:e,element:r,sizePercentage:n,bgColor:i})=>{if(!r)return d.jsx(d.Fragment,{});let a=e*(n||.14),s=Math.floor(e/2-a/2),o=Math.floor(e/2+a/2);(o-s)%2!=e%2&&(o+=1);let l=(o-s)*t,c=l-.2*l,u=s*t;return d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:s*t,y:s*t,width:l,height:l,fill:i}),d.jsx(r,{x:u+.1*l,y:u+.1*l,height:c,width:c})]})},wXe=t=>{var a;let e=t.outputSize,r=hXe(t.url,t.errorCorrectionLevel),n=e/r.length,i=ZMe(2*n,{min:.025*e,max:.036*e});return d.jsxs("svg",{height:t.outputSize,width:t.outputSize,viewBox:`0 0 ${t.outputSize} ${t.outputSize}`,style:{height:"100%",width:"100%",padding:`${i}px`},children:[d.jsx(mXe,{matrix:r,cellSize:n,color:t.fgColor}),d.jsx(gXe,{cellSize:n,matrixSize:r.length,fgColor:t.fgColor,bgColor:t.bgColor}),d.jsx(yXe,{cellSize:n,element:(a=t.logo)==null?void 0:a.element,bgColor:t.bgColor,matrixSize:r.length})]})},vXe=fe.div.withConfig({displayName:"QrContainer",componentId:"sc-aa6883ae-0"})(["display:flex;justify-content:center;align-items:center;height:",";width:",";margin:auto;background-color:",";&&{border-width:2px;border-color:",";border-radius:var(--privy-border-radius-md);}"],t=>`${t.$size}px`,t=>`${t.$size}px`,t=>t.$bgColor,t=>t.$borderColor);const I7=t=>{let{appearance:e}=Ai(),r=t.bgColor||"#FFFFFF",n=t.fgColor||"#000000",i=t.size||160,a=e.palette.colorScheme==="dark"?r:n;return d.jsx(vXe,{$size:i,$bgColor:r,$fgColor:n,$borderColor:a,children:d.jsx(wXe,{url:t.url,logo:{element:t.squareLogoElement??fXe},outputSize:i,bgColor:r,fgColor:n,errorCorrectionLevel:t.errorCorrectionLevel||"Q"})})},D0=({style:t,...e})=>d.jsxs("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...t},...e,children:[d.jsx("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),d.jsx("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),d.jsx("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),d.jsx("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});let eG="#8a63d2";const bXe=()=>{let{authenticated:t,logout:e,ready:r,user:n}=$r(),{lastScreen:i,navigate:a,navigateBack:s,setModalData:o,app:l}=wt(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:f,createAnalyticsEvent:h}=_t(),[g,m]=E.useState(void 0),[w,C]=E.useState(!1),[v,b]=E.useState(!1),A=E.useRef([]),S=c(),j=S==null?void 0:S.meta.connectUri;return E.useEffect(()=>{let U=Date.now(),I=setInterval(async()=>{var se,Y,N,k,x,_,L,O,P,R,M,D,$,X,le;let B=await S.pollForReady.execute(),V=Date.now()-U;if(B){clearInterval(I),C(!0);try{await u(),b(!0)}catch(H){let ee={retryable:!1,message:"Authentication failed"};if((H==null?void 0:H.privyErrorCode)===Ae.ALLOWLIST_REJECTED)return void a(ye.ALLOWLIST_REJECTION_SCREEN);if((H==null?void 0:H.privyErrorCode)===Ae.USER_LIMIT_REACHED)return console.error(new K3(H).toString()),void a(ye.USER_LIMIT_REACHED_SCREEN);if((H==null?void 0:H.privyErrorCode)===Ae.USER_DOES_NOT_EXIST)return void a(ye.ACCOUNT_NOT_FOUND_SCREEN);if((H==null?void 0:H.privyErrorCode)===Ae.LINKED_TO_ANOTHER_USER)ee.detail=H.message??"This account has already been linked to another user.";else{if((H==null?void 0:H.privyErrorCode)===Ae.ACCOUNT_TRANSFER_REQUIRED&&((Y=(se=H.data)==null?void 0:se.data)!=null&&Y.nonce))return o({accountTransfer:{nonce:(k=(N=H.data)==null?void 0:N.data)==null?void 0:k.nonce,account:(_=(x=H.data)==null?void 0:x.data)==null?void 0:_.subject,displayName:(P=(O=(L=H.data)==null?void 0:L.data)==null?void 0:O.account)==null?void 0:P.displayName,linkMethod:"farcaster",embeddedWalletAddress:(D=(M=(R=H.data)==null?void 0:R.data)==null?void 0:M.otherUser)==null?void 0:D.embeddedWalletAddress,farcasterEmbeddedAddress:(le=(X=($=H.data)==null?void 0:$.data)==null?void 0:X.otherUser)==null?void 0:le.farcasterEmbeddedAddress}}),void a(ye.LINK_CONFLICT_SCREEN);(H==null?void 0:H.privyErrorCode)===Ae.INVALID_CREDENTIALS?(ee.retryable=!0,ee.detail="Something went wrong. Try again."):(H==null?void 0:H.privyErrorCode)===Ae.TOO_MANY_REQUESTS&&(ee.detail="Too many requests. Please wait before trying again.")}m(ee)}}else V>12e4&&(clearInterval(I),m({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},2e3);return()=>{clearInterval(I),A.current.forEach(B=>clearTimeout(B))}},[]),E.useEffect(()=>{if(r&&t&&v&&n){if(l!=null&&l.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let U=setTimeout(()=>{a(ye.AFFIRMATIVE_CONSENT_SCREEN)},Dn);return()=>clearTimeout(U)}v&&(Hd(n,l==null?void 0:l.embeddedWallets.createOnLogin)?A.current.push(setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:U=>{console.error(U),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:U,screen:"FarcasterConnectStatusScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),a(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Dn)):A.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Dn)))}},[v,r,t,n]),d.jsxs(d.Fragment,ya||w?{children:[d.jsx(ft,{backFn:i?s:void 0,onClose:f},"header"),d.jsx(tn,{}),d.jsx(d.Fragment,RN?{children:d.jsxs(xXe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(_c,{success:v,fail:!!g}),d.jsx(D0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(ko,{children:[d.jsx(hn,{children:g?g.message:"Sign in with Farcaster"}),d.jsx(pn,{children:g?g.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),j&&d.jsx(Ot,{onClick:U=>{U.preventDefault(),window.location.href=j},children:"Open Warpcast app"})]})}:{children:d.jsxs(tG,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(_c,{success:v,fail:!!g}),d.jsx(D0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(ko,{children:[d.jsx(hn,{children:g?g.message:"Signing in with Farcaster"}),d.jsx(pn,{children:g?g.detail:"This should only take a moment"}),d.jsx(Sc,{children:j&&ya&&d.jsx(Vae,{text:"Take me to Warpcast",url:j,color:eG})})]})]})}),d.jsx(kr,{})]}:{children:[d.jsx(ft,{backFn:i?s:void 0,onClose:f},"header"),d.jsx(tn,{}),d.jsx(tG,{children:d.jsxs("div",{children:[d.jsx(hn,{children:"Sign in with Farcaster"}),d.jsx(pn,{children:"Scan with your phone's camera to continue."}),d.jsx(gj,{children:j?d.jsx(I7,{url:j,size:275,squareLogoElement:D0}):d.jsx(xl,{})}),d.jsxs(Sc,{children:[d.jsx(pn,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),j&&d.jsx(E7,{text:j,itemName:"link",color:eG})]})]})}),d.jsx(kr,{})]})};let tG=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-5a361367-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]),xXe=fe.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-5a361367-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),rG="#8a63d2";const EXe=()=>{let{lastScreen:t,navigateBack:e,data:r,app:n}=wt(),{requestFarcasterSignerStatus:i,closePrivyModal:a}=_t(),[s,o]=E.useState(void 0),[l,c]=E.useState(!1),[u,f]=E.useState(!1),h=E.useRef([]),g=r==null?void 0:r.farcasterSigner;E.useEffect(()=>{let w=Date.now(),C=setInterval(async()=>{if(!(g!=null&&g.public_key))return clearInterval(C),void o({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});g.status==="approved"&&(clearInterval(C),c(!1),f(!0),h.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Dn)));let v=await i(g==null?void 0:g.public_key),b=Date.now()-w;v.status==="approved"?(clearInterval(C),c(!1),f(!0),h.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Dn))):b>3e5?(clearInterval(C),o({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):v.status==="revoked"&&(clearInterval(C),o({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},2e3);return()=>{clearInterval(C),h.current.forEach(v=>clearTimeout(v))}},[]);let m=(g==null?void 0:g.status)==="pending_approval"?g.signer_approval_url:void 0;return d.jsxs(d.Fragment,ya||l?{children:[d.jsx(ft,{backFn:t?e:void 0,onClose:a},"header"),d.jsx(tn,{}),d.jsx(d.Fragment,RN?{children:d.jsxs(_Xe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(_c,{success:u,fail:!!s}),d.jsx(D0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(ko,{children:[d.jsx(hn,{children:s?s.message:"Add a signer to Farcaster"}),d.jsx(pn,{children:s?s.detail:"This will allow "+n.name+" to add casts, likes, follows, and more on your behalf."})]}),m&&d.jsx(Ot,{onClick:w=>{w.preventDefault(),window.location.href=m},children:"Open Warpcast app"})]})}:{children:d.jsxs(nG,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(_c,{success:u,fail:!!s}),d.jsx(D0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(ko,{children:[d.jsx(hn,{children:s?s.message:"Requesting signer from Farcaster"}),d.jsx(pn,{children:s?s.detail:"This should only take a moment"}),d.jsx(Sc,{children:m&&ya&&d.jsx(Vae,{text:"Take me to Warpcast",url:m,color:rG})})]})]})}),d.jsx(kr,{})]}:{children:[d.jsx(ft,{backFn:t?e:void 0,onClose:a},"header"),d.jsx(tn,{}),d.jsx(nG,{children:d.jsxs("div",{children:[d.jsx(hn,{children:"Add a signer to Farcaster"}),d.jsxs(pn,{children:["This will allow ",n.name," to add casts, likes, follows, and more on your behalf."]}),d.jsx(gj,{children:(g==null?void 0:g.status)==="pending_approval"?d.jsx(I7,{url:g.signer_approval_url,size:275,squareLogoElement:D0}):d.jsx(xl,{})}),d.jsxs(Sc,{children:[d.jsx(pn,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),(g==null?void 0:g.status)==="pending_approval"&&d.jsx(E7,{text:g.signer_approval_url,itemName:"link",color:rG})]})]})}),d.jsx(kr,{})]})};let nG=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-6e2c96cd-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]),_Xe=fe.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-6e2c96cd-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);function Zs({title:t}){var s,o;let{currentScreen:e,navigateBack:r,navigate:n,data:i,setModalData:a}=wt();return d.jsx(ft,{title:t,backFn:e===ye.FUNDING_MANUAL_TRANSFER_SCREEN?r:e===((s=i==null?void 0:i.funding)==null?void 0:s.methodScreen)?i.funding.comingFromSendTransactionScreen?()=>n(ye.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN):void 0:(o=i==null?void 0:i.funding)!=null&&o.methodScreen?()=>{let l=i.funding;l.usingDefaultFundingMethod&&(l.usingDefaultFundingMethod=!1),a({funding:l}),n(l.methodScreen)}:void 0})}const Ym=({size:t})=>d.jsx(CXe,{$size:t,children:d.jsxs(SXe,{children:[d.jsx(AXe,{}),d.jsx(IXe,{})]})});let CXe=fe.div.withConfig({displayName:"LoadingContainer",componentId:"sc-3ddaba1c-0"})(["--spinner-size:",";display:flex;justify-content:center;align-items:center;flex-grow:1;@media all and (display-mode:standalone){margin-bottom:30px;}"],t=>t.$size?t.$size:"96px"),SXe=fe.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-3ddaba1c-1"})(["position:relative;height:var(--spinner-size);width:var(--spinner-size);opacity:1;animation:fadein 200ms ease;"]),AXe=fe.div.withConfig({displayName:"CircleFixed",componentId:"sc-3ddaba1c-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);&&{border:4px solid #f1f2f9;border-radius:50%;}"]),IXe=fe.div.withConfig({displayName:"CircleRotate",componentId:"sc-3ddaba1c-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:#cbcde1 transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);const use=({enabled:t=!0}={})=>{let{showFiatPrices:e,getUsdPriceForSol:r}=_t(),[n,i]=E.useState(!0),[a,s]=E.useState(void 0),[o,l]=E.useState(void 0);return E.useEffect(()=>{(async()=>{if(e&&t)try{i(!0);let c=await r();c?l(c):s(Error("Unable to fetch SOL price"))}catch(c){s(c)}finally{i(!1)}else i(!1)})()},[]),{solPrice:o,isSolPriceLoading:n,solPriceError:a}};function Km(t){let{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}=(o=>{let{showFiatPrices:l,getUsdTokenPrice:c,chains:u}=_t(),[f,h]=E.useState(!0),[g,m]=E.useState(void 0),[w,C]=E.useState(void 0);return E.useEffect(()=>{o||(o=Yw);let v=ij(u).find(b=>b.id===Number(o));(async()=>{if(l){if(!v)return h(!1),void m(Error(`Unable to fetch token price on chain id ${o}`));try{h(!0);let b=await c(v);b?C(b):m(Error(`Unable to fetch token price on chain id ${v.id}`))}catch(b){m(b)}finally{h(!1)}}else h(!1)})()},[o]),{tokenPrice:w,isTokenPriceLoading:f,tokenPriceError:g}})(t==="solana"?-1:t),{solPrice:i,isSolPriceLoading:a,solPriceError:s}=use({enabled:t==="solana"});return t==="solana"?{tokenPrice:i,isTokenPriceLoading:a,tokenPriceError:s}:{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}}const dse=E.createContext(null);function O1(){let t=E.useContext(dse);return t===null?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):t}const Qd="sdk_fiat_on_ramp_completed_with_status";let iG="0x0000000000000000000000000000000000000000";const c3=({destinationCurrency:t,...e})=>({tradeType:"EXACT_OUTPUT",originCurrency:iG,destinationCurrency:t??iG,...e}),u3=async({input:t,isTestnet:e})=>{let r=await fetch(e?"https://api.testnets.relay.link/execute/swap":"https://api.relay.link/execute/swap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await r.json();if(!(r.ok||typeof n.message=="string"&&n.message.startsWith("Invalid address")))throw console.error("Relay error:",n),Error(n.message??"Error fetching quote from relay");return n},L8=t=>{var r,n;let e=(n=(r=t.steps[0])==null?void 0:r.items)==null?void 0:n[0];if(e)return{from:e.data.from,to:e.data.to,value:Number(e.data.value),chainId:Number(e.data.chainId),data:e.data.data}},MXe=(t,e=0)=>{let r=t[e],n=t[e+7];if(!r||!n)throw Error(`Buffer offset out of range: first: ${r}, last: ${n}.`);return(BigInt(t[e+4]+256*t[e+5]+65536*t[e+6]+(n<<24))<<32n)+BigInt(r+256*t[++e]+65536*t[++e]+16777216*t[++e])};let TXe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function nh(t,e=6,r=!1,n=!1){let i=(parseFloat(t.toString())/1e9).toFixed(e).replace(/0+$/,"").replace(/\.$/,""),a=n?"":" SOL";return r?`${i}${a}`:`${i==="0"?"<0.001":i}${a}`}function O0(t,e){let r=parseFloat(t.toString())/1e9,n=TXe.format(e*r);return n==="$0.00"?"<$0.01":n}function fse({amount:t,fee:e,tokenPrice:r}){let n=BigInt(1e9*parseFloat(t)),i=n+e;return{fundingAmountInBaseUnit:n,fundingAmountInUsd:r?O0(n,r):void 0,totalPriceInUsd:r?O0(i,r):void 0,totalPriceInNativeCurrency:nh(i),feePriceInNativeCurrency:nh(e),feePriceInUsd:r?O0(e,r):void 0}}function $h(t){return"version"in t}function QS(t,e,r=0){var a,s,o;let n=e==="from"?0:e==="to"?1:2;if($h(t)){let l=t.message.getAccountKeys(),c=(a=t.message.compiledInstructions.at(r))==null?void 0:a.accountKeyIndexes[n];return c&&l.get(c)||null}let i=(o=(s=t.instructions.at(r))==null?void 0:s.keys.at(n))==null?void 0:o.pubkey;if(i==null)throw Error(`Transaction does not contain a "${e}" public key`);return i}function kXe(t,e=!1,r=0){var a,s;let n=e?1:4;if($h(t)){let o=(a=t.message.compiledInstructions.at(r))==null?void 0:a.data;if(!o)return 0n;try{return MXe(Buffer.from(o),n)}catch{return 0n}}let i=(s=t.instructions.at(r))==null?void 0:s.data.readBigInt64LE(n);return i??0n}function NXe(t,e){if($h(t)){let n=t.message.staticAccountKeys.find(i=>i.toBase58()===e);if(!n)throw Error(`Transaction does not contain public key ${e}`);return n}let r=t.compileMessage().accountKeys.find(n=>n.toBase58()===e);if(!r)throw Error(`Transaction does not contain public key ${e}`);return r}function LXe(t,e=0){var n,i,a;let r;if($h(t)){let s=(n=t.message.compiledInstructions.at(e))==null?void 0:n.programIdIndex;if(s==null)throw Error("Transaction does not contain a Program ID");r=(i=t.message.getAccountKeys().get(s))==null?void 0:i.toBase58()}else r=(a=t.instructions.at(e))==null?void 0:a.programId.toBase58();if(!r)throw Error("Transaction does not contain a Program ID");return r==="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"?"approve":r==="11111111111111111111111111111111"?"transfer":"instruction"}async function jXe(t,e){return $h(t)?(await e.getFeeForMessage(t.message)).value:await t.getEstimatedFee(e)}function hse(t,e){var r;return{signature:t,parsedTransaction:e,fees:BigInt(((r=e==null?void 0:e.meta)==null?void 0:r.fee)||0)}}async function pse(t,e){let r=[],n=$h(t)?t.message.compiledInstructions.length:t.instructions.length,i={},a=BigInt(await jXe(t,e)||0);for(let s=0;s=u})}return{fees:a,instructions:r}}const gse=({chains:t,appId:e,address:r,rpcConfig:n})=>Promise.all(t.map(async i=>({balance:await Ec({chain:i,transport:xc(ch(i,n,e))}).getBalance({address:r}).catch(()=>0n),chain:i})));let mse=E.createContext({plugins:{current:{}}});const $Xe=({children:t})=>{let e=E.useRef({});return d.jsx(mse.Provider,{value:{plugins:e},children:t})},Mv=()=>{let{plugins:t}=E.useContext(mse);return E.useCallback(e=>t.current[e],[t])},Tv=Symbol("solana-funding-plugin"),kv=fe.span.withConfig({displayName:"Rows",componentId:"sc-b764aab6-0"})(["display:flex;flex-direction:column;gap:0.35rem;width:100%;"]),Yr=fe.span.withConfig({displayName:"Row",componentId:"sc-b764aab6-1"})(["display:flex;width:100%;justify-content:space-between;gap:0.5rem;"]),qr=fe.span.withConfig({displayName:"LabelSm",componentId:"sc-6c002d6-0"})(["color:var(--privy-color-foreground-3);font-size:0.875rem;font-weight:400;line-height:1.375rem;"]),PXe=fe(qr).withConfig({displayName:"LabelSmPrimary",componentId:"sc-6c002d6-1"})(["color:var(--privy-color-accent);"]),cn=fe.span.withConfig({displayName:"Value",componentId:"sc-72aa026-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;",""],Pne);function RXe({title:t,titleId:e,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?E.createElement("title",{id:e},t):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const yse=E.forwardRef(RXe),DXe=t=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...t,children:d.jsx("g",{id:"Layer_x0020_1",children:d.jsxs("g",{id:"_2405588477232",children:[d.jsx("rect",{fill:"none",width:"2500",height:"2500"}),d.jsx("g",{children:d.jsxs("g",{children:[d.jsx("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),d.jsx("g",{children:d.jsxs("g",{children:[d.jsx("g",{children:d.jsx("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),d.jsx("g",{children:d.jsx("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),d.jsx("g",{children:d.jsx("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),d.jsx("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),d.jsxs("g",{children:[d.jsx("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),d.jsx("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})}),OXe=t=>d.jsxs("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]}),FXe=t=>d.jsxs("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),d.jsx("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),UXe=t=>d.jsxs("svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),d.jsx("path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]}),BXe=t=>d.jsxs("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{width:"199.4",height:"207.623",fill:"#121212"}),d.jsxs("g",{"clip-path":"url(#clip0_2303_643)",children:[d.jsx("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),d.jsx("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_2303_643",children:d.jsx("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]}),zXe=t=>d.jsxs("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...t,children:[d.jsx("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),d.jsx("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),d.jsx("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),d.jsx("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),d.jsx("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]}),WXe=t=>d.jsxs("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),d.jsx("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),d.jsx("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]}),HXe=t=>d.jsxs("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),d.jsx("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]}),GXe=t=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 397.7 311.7",enableBackground:"new 0 0 397.7 311.7",xmlSpace:"preserve",...t,children:[d.jsxs("linearGradient",{id:"SVGID_1_",gradientUnits:"userSpaceOnUse",x1:"360.8791",y1:"351.4553",x2:"141.213",y2:"-69.2936",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[d.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),d.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),d.jsx("path",{d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z",fill:"url(#SVGID_1_)"}),d.jsxs("linearGradient",{id:"SVGID_2_",gradientUnits:"userSpaceOnUse",x1:"264.8291",y1:"401.6014",x2:"45.163",y2:"-19.1475",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[d.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),d.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),d.jsx("path",{d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z",fill:"url(#SVGID_2_)"}),d.jsxs("linearGradient",{id:"SVGID_3_",gradientUnits:"userSpaceOnUse",x1:"312.5484",y1:"376.688",x2:"92.8822",y2:"-44.061",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[d.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),d.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),d.jsx("path",{d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4 c5.8,0,8.7-7,4.6-11.1L333.1,120.1z",fill:"url(#SVGID_3_)"})]}),qXe=t=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",...t,children:[d.jsx("g",{clipPath:"url(#clip0)",children:d.jsx("g",{clipPath:"url(#clip1)",children:d.jsx("path",{d:"M14.9188 29.8373C6.67944 29.8373 0.00012207 23.1581 0.00012207 14.9187C0.00012207 6.67931 6.67944 0 14.9188 0C23.1581 0 29.8373 6.67931 29.8373 14.9187C29.8373 23.1581 23.1581 29.8373 14.9188 29.8373Z",fill:"url(#paint0)"})})}),d.jsxs("defs",{children:[d.jsxs("radialGradient",{id:"paint0",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(21.6921 8.02215) rotate(180) scale(25.2008)",children:[d.jsx("stop",{offset:"0.00682297",stopColor:"#F2CEFE"}),d.jsx("stop",{offset:"0.1913",stopColor:"#AFBAF1"}),d.jsx("stop",{offset:"0.4982",stopColor:"#4281D3"}),d.jsx("stop",{offset:"0.666667",stopColor:"#2E427D"}),d.jsx("stop",{offset:"0.822917",stopColor:"#230101"}),d.jsx("stop",{offset:"1",stopColor:"#8F6B40"})]}),d.jsx("clipPath",{id:"clip0",children:d.jsx("rect",{width:"30",height:"30",fill:"white"})}),d.jsx("clipPath",{id:"clip1",children:d.jsx("rect",{width:"30",height:"30",fill:"white"})})]})]});let VXe={[Ah.id]:DXe,[YL.id]:OXe,[ef.id]:FXe,[KL.id]:UXe,[Sre.id]:BXe,[Ru.id]:zXe,[I1.id]:WXe,[tf.id]:HXe,[Tre.id]:qXe};const wse=({chainId:t,...e})=>{if(t==="solana")return d.jsx(GXe,{...e});let r=VXe[t];return d.jsx(r||yse,{...e})},YXe=({balance:t,className:e,chain:r})=>d.jsx(Bj,{className:e,$state:void 0,children:d.jsx(UT,{balance:t,chain:r})}),UT=({balance:t,chain:e})=>d.jsxs(d.Fragment,{children:[d.jsxs(KXe,{children:[d.jsx(QXe,{chainId:"id"in e?e.id:"solana"}),d.jsx(cn,{children:e.name})]}),d.jsxs(Ac,{isLoading:!1,isPulsing:!1,color:"gray",children:[d.jsx(JXe,{children:d.jsx(cv,{})}),t]})]});let KXe=fe.div.withConfig({displayName:"Container",componentId:"sc-6d3c340d-0"})(["display:flex;align-items:center;"]),JXe=fe.div.withConfig({displayName:"IconContainer",componentId:"sc-6d3c340d-1"})(["height:0.75rem;width:0.75rem;margin-right:0.2rem;"]),QXe=fe(wse).withConfig({displayName:"StyledNetworkIcon",componentId:"sc-6d3c340d-2"})(["height:1.25rem;width:1.25rem;display:inline-block;margin-right:0.5rem;border-radius:4px;"]);const vse=typeof document<"u"?Et.useLayoutEffect:()=>{};function ZXe(t){const e=E.useRef(null);return vse(()=>{e.current=t},[t]),E.useCallback((...r)=>{const n=e.current;return n==null?void 0:n(...r)},[])}const Nv=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},A0=t=>t&&"window"in t&&t.window===t?t:Nv(t).defaultView||window;function XXe(t){var e;return typeof window>"u"||window.navigator==null?!1:((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.brands.some(r=>t.test(r.brand)))||t.test(window.navigator.userAgent)}function eet(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function bse(t){let e=null;return()=>(e==null&&(e=t()),e)}const tet=bse(function(){return eet(/^Mac/i)}),ret=bse(function(){return XXe(/Android/i)});function net(t){return t.mozInputSource===0&&t.isTrusted?!0:ret()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}class iet{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,r){this.nativeEvent=r,this.target=r.target,this.currentTarget=r.currentTarget,this.relatedTarget=r.relatedTarget,this.bubbles=r.bubbles,this.cancelable=r.cancelable,this.defaultPrevented=r.defaultPrevented,this.eventPhase=r.eventPhase,this.isTrusted=r.isTrusted,this.timeStamp=r.timeStamp,this.type=e}}function xse(t){let e=E.useRef({isFocused:!1,observer:null});vse(()=>{const n=e.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=ZXe(n=>{t==null||t(n)});return E.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){e.current.isFocused=!0;let i=n.target,a=s=>{e.current.isFocused=!1,i.disabled&&r(new iet("blur",s)),e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};i.addEventListener("focusout",a,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&i.disabled){var s;(s=e.current.observer)===null||s===void 0||s.disconnect();let o=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:o})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:o}))}}),e.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[r])}function aet(t){let{isDisabled:e,onFocus:r,onBlur:n,onFocusChange:i}=t;const a=E.useCallback(l=>{if(l.target===l.currentTarget)return n&&n(l),i&&i(!1),!0},[n,i]),s=xse(a),o=E.useCallback(l=>{const c=Nv(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(r&&r(l),i&&i(!0),s(l))},[i,r,s]);return{focusProps:{onFocus:!e&&(r||i||n)?o:void 0,onBlur:!e&&(n||i)?a:void 0}}}let Lv=null,BT=new Set,Ky=new Map,d1=!1,zT=!1;const set={Tab:!0,Escape:!0};function n$(t,e){for(let r of BT)r(t,e)}function oet(t){return!(t.metaKey||!tet()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function j8(t){d1=!0,oet(t)&&(Lv="keyboard",n$("keyboard",t))}function ul(t){Lv="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(d1=!0,n$("pointer",t))}function Ese(t){net(t)&&(d1=!0,Lv="virtual")}function _se(t){t.target===window||t.target===document||(!d1&&!zT&&(Lv="virtual",n$("virtual",t)),d1=!1,zT=!1)}function Cse(){d1=!1,zT=!0}function WT(t){if(typeof window>"u"||Ky.get(A0(t)))return;const e=A0(t),r=Nv(t);let n=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){d1=!0,n.apply(this,arguments)},r.addEventListener("keydown",j8,!0),r.addEventListener("keyup",j8,!0),r.addEventListener("click",Ese,!0),e.addEventListener("focus",_se,!0),e.addEventListener("blur",Cse,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",ul,!0),r.addEventListener("pointermove",ul,!0),r.addEventListener("pointerup",ul,!0)):(r.addEventListener("mousedown",ul,!0),r.addEventListener("mousemove",ul,!0),r.addEventListener("mouseup",ul,!0)),e.addEventListener("beforeunload",()=>{Sse(t)},{once:!0}),Ky.set(e,{focus:n})}const Sse=(t,e)=>{const r=A0(t),n=Nv(t);e&&n.removeEventListener("DOMContentLoaded",e),Ky.has(r)&&(r.HTMLElement.prototype.focus=Ky.get(r).focus,n.removeEventListener("keydown",j8,!0),n.removeEventListener("keyup",j8,!0),n.removeEventListener("click",Ese,!0),r.removeEventListener("focus",_se,!0),r.removeEventListener("blur",Cse,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",ul,!0),n.removeEventListener("pointermove",ul,!0),n.removeEventListener("pointerup",ul,!0)):(n.removeEventListener("mousedown",ul,!0),n.removeEventListener("mousemove",ul,!0),n.removeEventListener("mouseup",ul,!0)),Ky.delete(r))};function cet(t){const e=Nv(t);let r;return e.readyState!=="loading"?WT(t):(r=()=>{WT(t)},e.addEventListener("DOMContentLoaded",r)),()=>Sse(t,r)}typeof document<"u"&&cet();function Ase(){return Lv!=="pointer"}const uet=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function det(t,e,r){var n;const i=typeof window<"u"?A0(r==null?void 0:r.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?A0(r==null?void 0:r.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?A0(r==null?void 0:r.target).HTMLElement:HTMLElement,o=typeof window<"u"?A0(r==null?void 0:r.target).KeyboardEvent:KeyboardEvent;return t=t||(r==null?void 0:r.target)instanceof i&&!uet.has(r==null||(n=r.target)===null||n===void 0?void 0:n.type)||(r==null?void 0:r.target)instanceof a||(r==null?void 0:r.target)instanceof s&&(r==null?void 0:r.target.isContentEditable),!(t&&e==="keyboard"&&r instanceof o&&!set[r.key])}function fet(t,e,r){WT(),E.useEffect(()=>{let n=(i,a)=>{det(!!(r!=null&&r.isTextInput),i,a)&&t(Ase())};return BT.add(n),()=>{BT.delete(n)}},e)}function het(t){let{isDisabled:e,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:i}=t,a=E.useRef({isFocusWithin:!1}),s=E.useCallback(c=>{a.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(a.current.isFocusWithin=!1,r&&r(c),i&&i(!1))},[r,i,a]),o=xse(s),l=E.useCallback(c=>{!a.current.isFocusWithin&&document.activeElement===c.target&&(n&&n(c),i&&i(!0),a.current.isFocusWithin=!0,o(c))},[n,i,o]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:s}}}let $8=!1,ZS=0;function HT(){$8=!0,setTimeout(()=>{$8=!1},50)}function aG(t){t.pointerType==="touch"&&HT()}function pet(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",aG):document.addEventListener("touchend",HT),ZS++,()=>{ZS--,!(ZS>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",aG):document.removeEventListener("touchend",HT))}}function get(t){let{onHoverStart:e,onHoverChange:r,onHoverEnd:n,isDisabled:i}=t,[a,s]=E.useState(!1),o=E.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;E.useEffect(pet,[]);let{hoverProps:l,triggerHoverEnd:c}=E.useMemo(()=>{let u=(g,m)=>{if(o.pointerType=m,i||m==="touch"||o.isHovered||!g.currentTarget.contains(g.target))return;o.isHovered=!0;let w=g.currentTarget;o.target=w,e&&e({type:"hoverstart",target:w,pointerType:m}),r&&r(!0),s(!0)},f=(g,m)=>{if(o.pointerType="",o.target=null,m==="touch"||!o.isHovered)return;o.isHovered=!1;let w=g.currentTarget;n&&n({type:"hoverend",target:w,pointerType:m}),r&&r(!1),s(!1)},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=g=>{$8&&g.pointerType==="mouse"||u(g,g.pointerType)},h.onPointerLeave=g=>{!i&&g.currentTarget.contains(g.target)&&f(g,g.pointerType)}):(h.onTouchStart=()=>{o.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=g=>{!o.ignoreEmulatedMouseEvents&&!$8&&u(g,"mouse"),o.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=g=>{!i&&g.currentTarget.contains(g.target)&&f(g,"mouse")}),{hoverProps:h,triggerHoverEnd:f}},[e,r,n,i,o]);return E.useEffect(()=>{i&&c({currentTarget:o.target},o.pointerType)},[i]),{hoverProps:l,isHovered:a}}function met(t={}){let{autoFocus:e=!1,isTextInput:r,within:n}=t,i=E.useRef({isFocused:!1,isFocusVisible:e||Ase()}),[a,s]=E.useState(!1),[o,l]=E.useState(()=>i.current.isFocused&&i.current.isFocusVisible),c=E.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),u=E.useCallback(g=>{i.current.isFocused=g,s(g),c()},[c]);fet(g=>{i.current.isFocusVisible=g,c()},[],{isTextInput:r});let{focusProps:f}=aet({isDisabled:n,onFocusChange:u}),{focusWithinProps:h}=het({isDisabled:!n,onFocusWithinChange:u});return{isFocused:a,isFocusVisible:o,focusProps:n?h:f}}var yet=Object.defineProperty,wet=(t,e,r)=>e in t?yet(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,XS=(t,e,r)=>(wet(t,typeof e!="symbol"?e+"":e,r),r);let vet=class{constructor(){XS(this,"current",this.detect()),XS(this,"handoffState","pending"),XS(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},F0=new vet;function F1(t){return F0.isServer?null:t instanceof Node?t.ownerDocument:t!=null&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}function M7(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function Fu(){let t=[],e={addEventListener(r,n,i,a){return r.addEventListener(n,i,a),e.add(()=>r.removeEventListener(n,i,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return e.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return e.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return M7(()=>{n.current&&r[0]()}),e.add(()=>{n.current=!1})},style(r,n,i){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=Fu();return r(n),this.add(()=>n.dispose())},add(r){return t.includes(r)||t.push(r),()=>{let n=t.indexOf(r);if(n>=0)for(let i of t.splice(n,1))i()}},dispose(){for(let r of t.splice(0))r()}};return e}function Jm(){let[t]=E.useState(Fu);return E.useEffect(()=>()=>t.dispose(),[t]),t}let xn=(t,e)=>{F0.isServer?E.useEffect(t,e):E.useLayoutEffect(t,e)};function U1(t){let e=E.useRef(t);return xn(()=>{e.current=t},[t]),e}let pr=function(t){let e=U1(t);return Et.useCallback((...r)=>e.current(...r),[e])};function bet(t){let e=t.width/2,r=t.height/2;return{top:t.clientY-r,right:t.clientX+e,bottom:t.clientY+r,left:t.clientX-e}}function xet(t,e){return!(!t||!e||t.righte.right||t.bottome.bottom)}function Eet({disabled:t=!1}={}){let e=E.useRef(null),[r,n]=E.useState(!1),i=Jm(),a=pr(()=>{e.current=null,n(!1),i.dispose()}),s=pr(o=>{if(i.dispose(),e.current===null){e.current=o.currentTarget,n(!0);{let l=F1(o.currentTarget);i.addEventListener(l,"pointerup",a,!1),i.addEventListener(l,"pointermove",c=>{if(e.current){let u=bet(c);n(xet(u,e.current.getBoundingClientRect()))}},!1),i.addEventListener(l,"pointercancel",a,!1)}}});return{pressed:r,pressProps:t?{}:{onPointerDown:s,onPointerUp:a,onClick:a}}}let _et=E.createContext(void 0);function Ise(){return E.useContext(_et)}function GT(...t){return Array.from(new Set(t.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function ku(t,e,...r){if(t in e){let i=e[t];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ku),n}var sm=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(sm||{}),Gf=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(Gf||{});function Ii(){let t=Aet();return E.useCallback(e=>Cet({mergeRefs:t,...e}),[t])}function Cet({ourProps:t,theirProps:e,slot:r,defaultTag:n,features:i,visible:a=!0,name:s,mergeRefs:o}){o=o??Iet;let l=Mse(e,t);if(a)return Y4(l,r,n,s,o);let c=i??0;if(c&2){let{static:u=!1,...f}=l;if(u)return Y4(f,r,n,s,o)}if(c&1){let{unmount:u=!0,...f}=l;return ku(u?0:1,{0(){return null},1(){return Y4({...f,hidden:!0,style:{display:"none"}},r,n,s,o)}})}return Y4(l,r,n,s,o)}function Y4(t,e={},r,n,i){let{as:a=r,children:s,refName:o="ref",...l}=eA(t,["unmount","static"]),c=t.ref!==void 0?{[o]:t.ref}:{},u=typeof s=="function"?s(e):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(e)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let f={};if(e){let h=!1,g=[];for(let[m,w]of Object.entries(e))typeof w=="boolean"&&(h=!0),w===!0&&g.push(m.replace(/([A-Z])/g,C=>`-${C.toLowerCase()}`));if(h){f["data-headlessui-state"]=g.join(" ");for(let m of g)f[`data-${m}`]=""}}if(a===E.Fragment&&(Object.keys(c0(l)).length>0||Object.keys(c0(f)).length>0))if(!E.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(c0(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(c0(l)).concat(Object.keys(c0(f))).map(h=>` - ${h}`).join(` -`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>` - ${h}`).join(` -`)].join(` -`))}else{let h=u.props,g=h==null?void 0:h.className,m=typeof g=="function"?(...v)=>GT(g(...v),l.className):GT(g,l.className),w=m?{className:m}:{},C=Mse(u.props,c0(eA(l,["ref"])));for(let v in f)v in C&&delete f[v];return E.cloneElement(u,Object.assign({},C,f,c,{ref:i(Met(u),c.ref)},w))}return E.createElement(a,Object.assign({},eA(l,["ref"]),a!==E.Fragment&&c,a!==E.Fragment&&f),u)}function Aet(){let t=E.useRef([]),e=E.useCallback(r=>{for(let n of t.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return t.current=r,e}}function Iet(...t){return t.every(e=>e==null)?void 0:e=>{for(let r of t)r!=null&&(typeof r=="function"?r(e):r.current=e)}}function Mse(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},r={};for(let n of t)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):e[i]=n[i];if(e.disabled||e["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[i=>{var a;return(a=i==null?void 0:i.preventDefault)==null?void 0:a.call(i)}]);for(let n in r)Object.assign(e,{[n](i,...a){let s=r[n];for(let o of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;o(i,...a)}}});return e}function Tse(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},r={};for(let n of t)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):e[i]=n[i];for(let n in r)Object.assign(e,{[n](...i){let a=r[n];for(let s of a)s==null||s(...i)}});return e}function oi(t){var e;return Object.assign(E.forwardRef(t),{displayName:(e=t.displayName)!=null?e:t.name})}function c0(t){let e=Object.assign({},t);for(let r in e)e[r]===void 0&&delete e[r];return e}function eA(t,e=[]){let r=Object.assign({},t);for(let n of e)n in r&&delete r[n];return r}function Met(t){return Et.version.split(".")[0]>="19"?t.props.ref:t.ref}let Tet="span";var P8=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(P8||{});function ket(t,e){var r;let{features:n=1,...i}=t,a={ref:e,"aria-hidden":(n&2)===2?!0:(r=i["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Ii()({ourProps:a,theirProps:i,slot:{},defaultTag:Tet,name:"Hidden"})}let qT=oi(ket),Net=E.createContext(void 0);function Let(){return E.useContext(Net)}function jet(t){let e=t.parentElement,r=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(r=e),e=e.parentElement;let n=(e==null?void 0:e.getAttribute("disabled"))==="";return n&&$et(r)?!1:n}function $et(t){if(!t)return!1;let e=t.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}let kse=Symbol();function Pet(t,e=!0){return Object.assign(t,{[kse]:e})}function vs(...t){let e=E.useRef(t);E.useEffect(()=>{e.current=t},[t]);let r=pr(n=>{for(let i of e.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return t.every(n=>n==null||(n==null?void 0:n[kse]))?void 0:r}let i$=E.createContext(null);i$.displayName="DescriptionContext";function Nse(){let t=E.useContext(i$);if(t===null){let e=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Nse),e}return t}function Lse(){let[t,e]=E.useState([]);return[t.length>0?t.join(" "):void 0,E.useMemo(()=>function(r){let n=pr(a=>(e(s=>[...s,a]),()=>e(s=>{let o=s.slice(),l=o.indexOf(a);return l!==-1&&o.splice(l,1),o}))),i=E.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props,value:r.value}),[n,r.slot,r.name,r.props,r.value]);return Et.createElement(i$.Provider,{value:i},r.children)},[e])]}let Ret="p";function Det(t,e){let r=E.useId(),n=Ise(),{id:i=`headlessui-description-${r}`,...a}=t,s=Nse(),o=vs(e);xn(()=>s.register(i),[i,s.register]);let l=n||!1,c=E.useMemo(()=>({...s.slot,disabled:l}),[s.slot,l]),u={ref:o,...s.props,id:i};return Ii()({ourProps:u,theirProps:a,slot:c,defaultTag:Ret,name:s.name||"Description"})}let Oet=oi(Det),Fet=Object.assign(Oet,{});var Vi=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(Vi||{});let T7=E.createContext(null);T7.displayName="LabelContext";function a$(){let t=E.useContext(T7);if(t===null){let e=new Error("You used a