PageSourceSearch

https://radreport.com.br/assets/web3Wallets-DKU11ybA.js

js radreport.com.br collected 2026-09-24 14:37:09 UTC 1,299,937 bytes, 326 lines download raw bytes

vendor: 2,949 bytes, lines 1-2
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/getBalance-pPDU8PQq.js","assets/bundler-BZOUbTQa.js","assets/type-guards-C6mkCq0U.js","assets/vendor-react-DyYvSSk1.js","assets/vendor-query-skQMsM6X.js","assets/utils-BnNtzvC2.js","assets/vendor-supabase-BfoV2C50.js","assets/index-BGwtrXIa.js","assets/vendor-ui-CCmu0bzQ.js","assets/index-DRKIJnYW.css","assets/useWeb3ChainConfig-oZ-Z2Koq.js","assets/extends-CF3RwP-h.js","assets/decimals-AzlhcAmY.js","assets/TypedData-CVVqYjz9.js","assets/fuse-CcLD0YPK.js","assets/arweave-CAGvOb64.js","assets/getNFT-D2WO1T-r.js","assets/fetchTokenMetadata-DYi7ZnOC.js","assets/getNFT-C0K-mRVB.js","assets/totalSupply-CWh8C8rG.js","assets/get-ecosystem-wallet-info-VIv-Ovo7.js","assets/index-BXaxSJrg.js","assets/hooks.module-C4srAwv3.js","assets/parseSignature-DCmX6IM0.js","assets/rpc-u1sSp6zF.js","assets/sha256-CIPQSzP0.js","assets/encodePacked-DUDc9fvG.js","assets/index-C2Jl551l.js","assets/web-connector-BqSB86Fz.js","assets/sign-login-payload-BKykauFw.js","assets/eth_sendRawTransaction-DPdnXbFR.js","assets/controller-C_I9tG6s.js","assets/qr-overlay-DIGHsE4I.js","assets/in-app-wallet-calls-23XdHcCt.js","assets/send-batch-transaction-c5G2OieS.js","assets/eth_getTransactionCount-D2rfJacD.js","assets/index-CE4vVO9x.js","assets/approve-BhQh79Kv.js","assets/bigint-D5W-kv3X.js","assets/send-eip712-transaction-eX5VRUFB.js","assets/concat-hex-BKoDG-Kf.js","assets/QRCodeRenderer-CpcfPDJ0.js","assets/CoinbaseSDKConnection-CyNZTsMy.js","assets/InAppWalletConnectUI-7nAWBUuy.js","assets/index-CcukV5Gd.js","assets/common-DZlWus51.js","assets/index-B-YpBHM0.js","assets/ccip-B01OUSOD.js","assets/secp256k1-CI6YikNH.js","assets/session-proposal-DVXzOJVn.js","assets/session-request-C7kRdgHN.js","assets/getActiveClaimCondition-CeXXYUaK.js","assets/claimCondition-t4GtiXaJ.js","assets/getActiveClaimCondition-BDzzchIW.js","assets/getActiveClaimCondition-dK9OtcWY.js","assets/fetch-proofs-for-claimers-CaMsrQ_Q.js"])))=>i.map(i=>d[i]);
2var pm=e=>{throw TypeError(e)};var ud=(e,t,n)=>t.has(e)||pm("Cannot "+n);var H=(e,t,n)=>(ud(e,t,"read from private field"),n?n.call(e):t.get(e)),Oe=(e,t,n)=>t.has(e)?pm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ce=(e,t,n,i)=>(ud(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),je=(e,t,n)=>(ud(e,t,"access private method"),n);import{r as _,i as wm,h as T4,j as v4,e as Zs}from"./vendor-react-DyYvSSk1.js";import{aA as h,cC as Bx,cD as Vx,cE as $x,cF as Wx,cG as Fx,cH as Yx,Y as Hx,Z as Qx,a3 as Zx,_ as qx,bv as Gx,$ as Kx,a1 as Jx,a0 as Xx,u as L4,b as Ft,c as be}from"./index-BGwtrXIa.js";import{useWeb3ChainConfig as j4,RADC_CONTRACT_ADDRESS as e6}from"./useWeb3ChainConfig-oZ-Z2Koq.js";import{j as a,a as t6,u as dd}from"./vendor-query-skQMsM6X.js";import{g as Ge,l as Ht,m as nu,n as S4,o as D4,p as N4,e as St,d as Lt,c as hn,w as Ui,q as A4,h as iu,L as n6,r as i6}from"./utils-BnNtzvC2.js";
2import{$ as cf,bi as _m,bj as Li,bk as pl,ac as Ca,a6 as ka,bl as Ch,bm,bn as r6,aa as s6,bo as o6,bp as xm,a2 as Cs,ai as a6,ae as Im,bq as c6,br as O4,bs as ur,o as l6,D as Eh,aV as u6,B as lf,a as d6,aD as Mm,E as k4,w as ru,j as Th,e as _e,k as zt,q as uf,b9 as h6,bt as hd,bc as Cm,bb as f6,bu as m6,bv as y6,bw as bi,J as Bi,H as z4,X as g6,R as Em,K as p6,bx as w6,Z as Tm,L as Qr,S as _6,c as b6,h as Zt,by as Vi,n as ln,i as P4,bz as x6,v as Zr,l as df,V as I6,m as vm,U as Ea,A as R4,bA as Xe,b4 as M6,bB as hf,bC as Di,bD as su,f as ff,u as ou,b6 as wl,bE as C6,ao as In,t as E6,aq as T6,ax as au,bF as U4,bG as B4,bH as V4,y as ht,ap as oc,bI as v6,bJ as mf,bK as Mn,T as xo,bL as _l,aj as L6,am as $4,Y as j6,bM as S6,aH as D6,bN as N6}from"./type-guards-C6mkCq0U.js";import{ab as Ur,s as yf,a as A6,i as O6,I as k6,b as z6,B as P6,w as W4,m as F4,y as cu,a9 as Pt,q as mi,C as Lm,j as wn,h as gf,cG as qr,d as R6,e as Y4,r as ac,x as za,cH as bl,a6 as H4,a7 as Q4,t as pf,p as wf,n as Is,o as lu,cI as U6,F as B6,cJ as V6,z as $6,Z as ga,l as tr,k as xl,V as Z4,W as jm,cK as W6,cL as F6,cM as Y6,bi as jc}from"./bundler-BZOUbTQa.js";import{_ as H6}from"./extends-CF3RwP-h.js";import{a as Q6,b as Z6}from"./decimals-AzlhcAmY.js";import{p as _n,B as Ve,g as we}from"./vendor-supabase-BfoV2C50.js";import{k as q6,e as q4,v as G4,s as K4}from"./TypedData-CVVqYjz9.js";import{F as J4}from"./fuse-CcLD0YPK.js";import{resolveArweaveScheme as G6}from"./arweave-CAGvOb64.js";const X4=_.createContext(void 0);function _f(e){if(!e.address)throw new Error("AccountProvider: No address passed. Ensure an address is always provided to the AccountProvider");return a.jsx(X4.Provider,{value:e,children:e.children})}function cc(){const e=_.useContext(X4);if(!e)throw new Error("AccountProviderContext not found. Make sure you are using AccountName, AccountAvatar, etc. inside an <AccountProvider /> component");return e}const vh={type:"dark",colors:{accentButtonBg:"hsl(221 83% 54%)",accentButtonText:"hsl(0 0% 100%)",accentText:"hsl(209.61deg 100% 65.31%)",borderColor:"hsl(0 0% 15%)",connectedButtonBg:"hsl(0 0% 3.92%)",connectedButtonBgHover:"hsl(0 0% 11%)",danger:"hsl(360 72% 55%)",inputAutofillBg:"hsl(0 0% 11%)",modalBg:"hsl(0 0% 3.92%)",primaryButtonBg:"hsl(0 0% 100%)",primaryButtonText:"hsl(0 0% 0%)",primaryText:"hsl(0 0% 98%)",scrollbarBg:"hsl(0 0% 11%)",secondaryButtonBg:"hsl(0 0% 9%)",modalOverlayBg:"rgba(0, 0, 0, 0.7)",secondaryButtonHoverBg:"hsl(0 0% 9%/80%)",secondaryButtonText:"hsl(0 0% 98%)",secondaryIconColor:"hsl(0 0% 63%)",secondaryIconHoverBg:"hsl(0 0% 11%)",secondaryIconHoverColor:"hsl(0 0% 98%)",secondaryText:"hsl(0 0% 63%)",selectedTextBg:"hsl(0 0% 100%)",selectedTextColor:"hsl(0 0% 0%)",separatorLine:"hsl(0 0% 15%)",skeletonBg:"hsl(0 0% 12%)",success:"hsl(142 75% 50%)",tertiaryBg:"hsl(0 0% 11%/50%)",tooltipBg:"hsl(0 0% 11%)",tooltipText:"hsl(0 0% 98%)"},fontFamily:"inherit"},K6={type:"light",colors:{accentButtonBg:"hsl(221 83% 54%)",accentButtonText:"hsl(0 0% 100%)",accentText:"hsl(211.23deg 100% 44.47%)",borderColor:"hsl(0 0% 85%)",connectedButtonBg:"hsl(0 0% 100%)",connectedButtonBgHover:"hsl(0 0% 93%)",danger:"hsl(360 72% 60%)",inputAutofillBg:"hsl(0 0% 93%)",modalBg:"hsl(0 0% 100%)",primaryButtonBg:"hsl(0 0% 4%)",primaryButtonText:"hsl(0 0% 100%)",primaryText:"hsl(0 0% 4%)",scrollbarBg:"hsl(0 0% 93%)",secondaryButtonBg:"hsl(0 0% 93%)",modalOverlayBg:"rgba(0, 0, 0, 0.7)",secondaryButtonHoverBg:"hsl(0 0% 93%/80%)",secondaryButtonText:"hsl(0 0% 4%)",secondaryIconColor:"hsl(0 0% 40%)",secondaryIconHoverBg:"hsl(0 0% 93%)",secondaryIconHoverColor:"hsl(0 0% 4%)",secondaryText:"hsl(0 0% 40%)",selectedTextBg:"hsl(0 0% 4%)",selectedTextColor:"hsl(0 0% 100%)",separatorLine:"hsl(0 0% 85%)",skeletonBg:"hsl(0 0% 85%)",success:"hsl(142.09 70.56% 35.29%)",tertiaryBg:"hsl(0 0% 93%/70%)",tooltipBg:"hsl(0 0% 100%)",tooltipText:"hsl(0 0% 4%)"},fontFamily:"inherit"},ie={"3xl":"48px",lg:"20px",md:"16px",sm:"14px",xl:"24px",xs:"12px",xxl:"32px"},R={"3xl":"64px","3xs":"4px","4xs":"2px",lg:"24px",md:"16px","md+":"20px",sm:"12px",xl:"32px",xs:"8px",xxl:"48px",xxs:"6px"},J={lg:"12px",md:"8px",sm:"6px",xl:"20px",xs:"4px",xxl:"32px",full:"9999px"},D={"3xl":"96","4xl":"128",lg:"32",md:"24","sm+":"20",sm:"16",xl:"48",xs:"12",xxl:"64"},bf={mobile:"@media (max-width: 640px)"},ep={lg:"0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"};var Dn,Ne,tc,yn,_s,mo,Ar,Or,nc,yo,go,bs,xs,kr,po,We,pa,Lh,jh,Sh,Dh,Nh,Ah,Oh,tp,M4,xf=(M4=class extends cf{constructor(t,n){super();Oe(this,We);Oe(this,Dn);Oe(this,Ne);Oe(this,tc);Oe(this,yn);Oe(this,_s);Oe(this,mo);Oe(this,Ar);Oe(this,Or);Oe(this,nc);Oe(this,yo);Oe(this,go);Oe(this,bs);Oe(this,xs);Oe(this,kr);Oe(this,po,new Set);this.options=n,Ce(this,Dn,t),Ce(this,Or,null),Ce(this,Ar,_m()),this.options.experimental_prefetchInRender||H(this,Ar).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(H(this,Ne).addObserver(this),Sm(H(this,Ne),this.options)?je(this,We,pa).call(this):this.updateResult(),je(this,We,Dh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kh(H(this,Ne),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kh(H(this,Ne),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,je(this,We,Nh).call(this),je(this,We,Ah).call(this),H(this,Ne).removeObserver(this)}setOptions(t){const n=this.options,i=H(this,Ne);if(this.options=H(this,Dn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Li(this.options.enabled,H(this,Ne))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");je(this,We,Oh).call(this),H(this,Ne).setOptions(this.options),n._defaulted&&!pl(this.options,n)&&H(this,Dn).getQueryCache().notify({type:"observerOptionsUpdated",query:H(this,Ne),observer:this});const r=this.hasListeners();r&&Dm(H(this,Ne),i,this.options,n)&&je(this,We,pa).call(this),this.updateResult(),r&&(H(this,Ne)!==i||Li(this.options.enabled,H(this,Ne))!==Li(n.enabled,H(this,Ne))||Ca(this.options.staleTime,H(this,Ne))!==Ca(n.staleTime,H(this,Ne)))&&je(this,We,Lh).call(this);const s=je(this,We,jh).call(this);r&&(H(this,Ne)!==i||Li(this.options.enabled,H(this,Ne))!==Li(n.enabled,H(this,Ne))||s!==H(this,kr))&&je(this,We,Sh).call(this,s)}getOptimisticResult(t){const n=H(this,Dn).getQueryCache().build(H(this,Dn),t),i=this.createResult(n,t);return X6(this,i)&&(Ce(this,yn,i),Ce(this,mo,this.options),Ce(this,_s,H(this,Ne).state)),i}getCurrentResult(){return H(this,yn)}trackResult(t,n){return new Proxy(t,{get:(i,r)=>(this.trackProp(r),n==null||n(r),Reflect.get(i,r))})}trackProp(t){H(this,po).add(t)}getCurrentQuery(){return H(this,Ne)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=H(this,Dn).defaultQueryOptions(t),i=H(this,Dn).getQueryCache().build(H(this,Dn),n);return i.fetch().then(()=>this.createResult(i,n))}fetch(t){return je(this,We,pa).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),H(this,yn)))}createResult(t,n){var M;const i=H(this,Ne),r=this.options,s=H(this,yn),o=H(this,_s),c=H(this,mo),u=t!==i?t.state:H(this,tc),{state:d}=t;let f={...d},m=!1,y;if(n._optimisticResults){const S=this.hasListeners(),L=!S&&Sm(t,n),O=S&&Dm(t,i,n,r);(L||O)&&(f={...f,...o6(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:w}=f;y=f.data;let x=!1;if(n.placeholderData!==void 0&&y===void 0&&w==="pending"){let S;s!=null&&s.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(S=s.data,x=!0):S=typeof n.placeholderData=="function"?n.placeholderData((M=H(this,go))==null?void 0:M.state.data,H(this,go)):n.placeholderData,S!==void 0&&(w="success",y=xm(s==null?void 0:s.data,S,n),m=!0)}if(n.select&&y!==void 0&&!x)if(s&&y===(o==null?void 0:o.data)&&n.select===H(this,nc))y=H(this,yo);else try{Ce(this,nc,n.select),y=n.select(y),y=xm(s==null?void 0:s.data,y,n),Ce(this,yo,y),Ce(this,Or,null)}catch(S){Ce(this,Or,S)}H(this,Or)&&(g=H(this,Or),y=H(this,yo),p=Date.now(),w="error");const I=f.fetchStatus==="fetching",E=w==="pending",j=w==="error",C=E&&I,T=y!==void 0,N={status:w,fetchStatus:f.fetchStatus,isPending:E,isSuccess:w==="success",isError:j,isInitialLoading:C,isLoading:C,data:y,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdate
2Count:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:I,isRefetching:I&&!E,isLoadingError:j&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:j&&T,isStale:If(t,n),refetch:this.refetch,promise:H(this,Ar)};if(this.options.experimental_prefetchInRender){const S=P=>{N.status==="error"?P.reject(N.error):N.data!==void 0&&P.resolve(N.data)},L=()=>{const P=Ce(this,Ar,N.promise=_m());S(P)},O=H(this,Ar);switch(O.status){case"pending":t.queryHash===i.queryHash&&S(O);break;case"fulfilled":(N.status==="error"||N.data!==O.value)&&L();break;case"rejected":(N.status!=="error"||N.error!==O.reason)&&L();break}}return N}updateResult(){const t=H(this,yn),n=this.createResult(H(this,Ne),this.options);if(Ce(this,_s,H(this,Ne).state),Ce(this,mo,this.options),H(this,_s).data!==void 0&&Ce(this,go,H(this,Ne)),pl(n,t))return;Ce(this,yn,n);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!H(this,po).size)return!0;const o=new Set(s??H(this,po));return this.options.throwOnError&&o.add("error"),Object.keys(H(this,yn)).some(c=>{const l=c;return H(this,yn)[l]!==t[l]&&o.has(l)})};je(this,We,tp).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&je(this,We,Dh).call(this)}},Dn=new WeakMap,Ne=new WeakMap,tc=new WeakMap,yn=new WeakMap,_s=new WeakMap,mo=new WeakMap,Ar=new WeakMap,Or=new WeakMap,nc=new WeakMap,yo=new WeakMap,go=new WeakMap,bs=new WeakMap,xs=new WeakMap,kr=new WeakMap,po=new WeakMap,We=new WeakSet,pa=function(t){je(this,We,Oh).call(this);let n=H(this,Ne).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ka)),n},Lh=function(){je(this,We,Nh).call(this);const t=Ca(this.options.staleTime,H(this,Ne));if(Ch||H(this,yn).isStale||!bm(t))return;const i=r6(H(this,yn).dataUpdatedAt,t)+1;Ce(this,bs,setTimeout(()=>{H(this,yn).isStale||this.updateResult()},i))},jh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(H(this,Ne)):this.options.refetchInterval)??!1},Sh=function(t){je(this,We,Ah).call(this),Ce(this,kr,t),!(Ch||Li(this.options.enabled,H(this,Ne))===!1||!bm(H(this,kr))||H(this,kr)===0)&&Ce(this,xs,setInterval(()=>{(this.options.refetchIntervalInBackground||s6.isFocused())&&je(this,We,pa).call(this)},H(this,kr)))},Dh=function(){je(this,We,Lh).call(this),je(this,We,Sh).call(this,je(this,We,jh).call(this))},Nh=function(){H(this,bs)&&(clearTimeout(H(this,bs)),Ce(this,bs,void 0))},Ah=function(){H(this,xs)&&(clearInterval(H(this,xs)),Ce(this,xs,void 0))},Oh=function(){const t=H(this,Dn).getQueryCache().build(H(this,Dn),this.options);if(t===H(this,Ne))return;const n=H(this,Ne);Ce(this,Ne,t),Ce(this,tc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},tp=function(t){Cs.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(H(this,yn))}),H(this,Dn).getQueryCache().notify({query:H(this,Ne),type:"observerResultsUpdated"})})},M4);function J6(e,t){return Li(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Sm(e,t){return J6(e,t)||e.state.data!==void 0&&kh(e,t,t.refetchOnMount)}function kh(e,t,n){if(Li(t.enabled,e)!==!1&&Ca(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&If(e,t)}return!1}function Dm(e,t,n,i){return(e!==t||Li(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&If(e,n)}function If(e,t){return Li(t.enabled,e)!==!1&&e.isStaleByTime(Ca(t.staleTime,e))}function X6(e,t){return!pl(e.getCurrentResult(),t)}function Nm(e,t){const n=new Set(t);return e.filter(i=>!n.has(i))}function e8(e,t,n){const i=e.slice(0);return i[t]=n,i}var wo,Jn,_o,bo,Xn,zr,ic,rc,sc,Qt,zh,Ph,Rh,Uh,Bh,C4,t8=(C4=class extends cf{constructor(t,n,i){super();Oe(this,Qt);Oe(this,wo);Oe(this,Jn);Oe(this,_o);Oe(this,bo);Oe(this,Xn);Oe(this,zr);Oe(this,ic);Oe(this,rc);Oe(this,sc,[]);Ce(this,wo,t),Ce(this,bo,i),Ce(this,_o,[]),Ce(this,Xn,[]),Ce(this,Jn,[]),this.setQueries(n)}
2onSubscribe(){this.listeners.size===1&&H(this,Xn).forEach(t=>{t.subscribe(n=>{je(this,Qt,Uh).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,H(this,Xn).forEach(t=>{t.destroy()})}setQueries(t,n){Ce(this,_o,t),Ce(this,bo,n),Cs.batch(()=>{const i=H(this,Xn),r=je(this,Qt,Rh).call(this,H(this,_o));Ce(this,sc,r),r.forEach(l=>l.observer.setOptions(l.defaultedQueryOptions));const s=r.map(l=>l.observer),o=s.map(l=>l.getCurrentResult()),c=s.some((l,u)=>l!==i[u]);i.length===s.length&&!c||(Ce(this,Xn,s),Ce(this,Jn,o),this.hasListeners()&&(Nm(i,s).forEach(l=>{l.destroy()}),Nm(s,i).forEach(l=>{l.subscribe(u=>{je(this,Qt,Uh).call(this,l,u)})}),je(this,Qt,Bh).call(this)))})}getCurrentResult(){return H(this,Jn)}getQueries(){return H(this,Xn).map(t=>t.getCurrentQuery())}getObservers(){return H(this,Xn)}getOptimisticResult(t,n){const i=je(this,Qt,Rh).call(this,t),r=i.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions));return[r,s=>je(this,Qt,Ph).call(this,s??r,n),()=>je(this,Qt,zh).call(this,r,i)]}},wo=new WeakMap,Jn=new WeakMap,_o=new WeakMap,bo=new WeakMap,Xn=new WeakMap,zr=new WeakMap,ic=new WeakMap,rc=new WeakMap,sc=new WeakMap,Qt=new WeakSet,zh=function(t,n){return n.map((i,r)=>{const s=t[r];return i.defaultedQueryOptions.notifyOnChangeProps?s:i.observer.trackResult(s,o=>{n.forEach(c=>{c.observer.trackProp(o)})})})},Ph=function(t,n){return n?((!H(this,zr)||H(this,Jn)!==H(this,rc)||n!==H(this,ic))&&(Ce(this,ic,n),Ce(this,rc,H(this,Jn)),Ce(this,zr,a6(H(this,zr),n(t)))),H(this,zr)):t},Rh=function(t){const n=new Map(H(this,Xn).map(r=>[r.options.queryHash,r])),i=[];return t.forEach(r=>{const s=H(this,wo).defaultQueryOptions(r),o=n.get(s.queryHash);o?i.push({defaultedQueryOptions:s,observer:o}):i.push({defaultedQueryOptions:s,observer:new xf(H(this,wo),s)})}),i},Uh=function(t,n){const i=H(this,Xn).indexOf(t);i!==-1&&(Ce(this,Jn,e8(H(this,Jn),i,n)),je(this,Qt,Bh).call(this))},Bh=function(){var t;if(this.hasListeners()){const n=H(this,zr),i=je(this,Qt,zh).call(this,H(this,Jn),H(this,sc)),r=je(this,Qt,Ph).call(this,i,(t=H(this,bo))==null?void 0:t.combine);n!==r&&Cs.batch(()=>{this.listeners.forEach(s=>{s(H(this,Jn))})})}},C4),Pr,Rr,Nn,er,ir,nl,Vh,E4,n8=(E4=class extends cf{constructor(t,n){super();Oe(this,ir);Oe(this,Pr);Oe(this,Rr);Oe(this,Nn);Oe(this,er);Ce(this,Pr,t),this.setOptions(n),this.bindMethods(),je(this,ir,nl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var i;const n=this.options;this.options=H(this,Pr).defaultMutationOptions(t),pl(this.options,n)||H(this,Pr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:H(this,Nn),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Im(n.mutationKey)!==Im(this.options.mutationKey)?this.reset():((i=H(this,Nn))==null?void 0:i.state.status)==="pending"&&H(this,Nn).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=H(this,Nn))==null||t.removeObserver(this)}onMutationUpdate(t){je(this,ir,nl).call(this),je(this,ir,Vh).call(this,t)}getCurrentResult(){return H(this,Rr)}
2reset(){var t;(t=H(this,Nn))==null||t.removeObserver(this),Ce(this,Nn,void 0),je(this,ir,nl).call(this),je(this,ir,Vh).call(this)}mutate(t,n){var i;return Ce(this,er,n),(i=H(this,Nn))==null||i.removeObserver(this),Ce(this,Nn,H(this,Pr).getMutationCache().build(H(this,Pr),this.options)),H(this,Nn).addObserver(this),H(this,Nn).execute(t)}},Pr=new WeakMap,Rr=new WeakMap,Nn=new WeakMap,er=new WeakMap,ir=new WeakSet,nl=function(){var n;const t=((n=H(this,Nn))==null?void 0:n.state)??c6();Ce(this,Rr,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Vh=function(t){Cs.batch(()=>{var n,i,r,s,o,c,l,u;if(H(this,er)&&this.hasListeners()){const d=H(this,Rr).variables,f=H(this,Rr).context;(t==null?void 0:t.type)==="success"?((i=(n=H(this,er)).onSuccess)==null||i.call(n,t.data,d,f),(s=(r=H(this,er)).onSettled)==null||s.call(r,t.data,null,d,f)):(t==null?void 0:t.type)==="error"&&((c=(o=H(this,er)).onError)==null||c.call(o,t.error,d,f),(u=(l=H(this,er)).onSettled)==null||u.call(l,void 0,t.error,d,f))}this.listeners.forEach(d=>{d(H(this,Rr))})})},E4),np=_.createContext(!1),ip=()=>_.useContext(np);np.Provider;function i8(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var r8=_.createContext(i8()),rp=()=>_.useContext(r8),sp=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},op=e=>{_.useEffect(()=>{e.clearReset()},[e])},ap=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(r&&e.data===void 0||O4(n,[e.error,i])),cp=e=>{if(e.suspense){const t=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>t(n(...i)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},lp=(e,t)=>e.isLoading&&e.isFetching&&!t,$h=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Il=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Mf({queries:e,...t},n){const i=ur(),r=ip(),s=rp(),o=_.useMemo(()=>e.map(p=>{const w=i.defaultQueryOptions(p);return w._optimisticResults=r?"isRestoring":"optimistic",w}),[e,i,r]);o.forEach(p=>{cp(p),sp(p,s)}),op(s);const[c]=_.useState(()=>new t8(i,o,t)),[l,u,d]=c.getOptimisticResult(o,t.combine),f=!r&&t.subscribed!==!1;_.useSyncExternalStore(_.useCallback(p=>f?c.subscribe(Cs.batchCalls(p)):ka,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),_.useEffect(()=>{c.setQueries(o,t)},[o,t,c]);const y=l.some((p,w)=>$h(o[w],p))?l.flatMap((p,w)=>{const x=o[w];if(x){const I=new xf(i,x);if($h(x,p))return Il(x,I,s);lp(p,r)&&Il(x,I,s)}return[]}):[];if(y.length>0)throw Promise.all(y);const g=l.find((p,w)=>{const x=o[w];return x&&ap({result:p,errorResetBoundary:s,throwOnError:x.throwOnError,query:i.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(g!=null&&g.error)throw g.error;return u(d())}function s8(e,t,n){var f,m,y,g,p;const i=ip(),r=rp(),s=ur(),o=s.defaultQueryOptions(e);(m=(f=s.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||m.call(f,o),o._optimisticResults=i?"isRestoring":"optimistic",cp(o),sp(o,r),op(r);const c=!s.getQueryCache().get(o.queryHash),[l]=_.useState(()=>new t(s,o)),u=l.getOptimisticResult(o),d=!i&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(w=>{const x=d?l.subscribe(Cs.batchCalls(w)):ka;return l.updateResult(),x},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),_.useEffect(()=>{l.setOptions(o)},[o,l]),$h(o,u))throw Il(o,l,r);if(ap({result:u,errorResetBoundary:r,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((g=(y=s.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||g.call(y,o,u),o.experimental_prefetchInRender&&!Ch&&lp(u,i)){const w=c?Il(o,l,r):(p=s.getQueryCache().get(o.queryHash))==null?void 0:p.promise;w==null||w.catch(ka).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}function pe(e,t){return s8(e,xf)}function Es(e,t){const n=ur(),[i]=_.useState(()=>new n8(n,e));_.useEffect(()=>{i.setOptions(e)},[i,e]);const r=_.useSyncExternalStore(_.useCallback(o=>i.subscribe(Cs.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),s=_.useCallback((o,c)=>{i.mutate(o,c).catch(ka)},[i]);if(r.error&&O4(i.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:s,mutateAsync:r.mutate}}function Cf(e,t,n){const i=!!n,r=ur(),s=pe({enabled:i&&!!(t!=null&&t.address),gcTime:0,placeholderData:!1,queryFn:()=>!n||!(t!=null&&t.address)?!1:n.isLoggedIn(t.address),queryKey:["siwe_auth","isLoggedIn",t==null?void 0:t.address],refetchOnWindowFocus:!1}),o=Es({mutationFn:async()=>
2{if(!n)throw new Error("No auth options provided");if(!e)throw new Error("No active wallet");const l=e.getChain();if(!l)throw new Error("No active chain");if(!t)throw new Error("No active account");const[u,{signLoginPayload:d}]=await Promise.all([n.getLoginPayload({address:t.address,chainId:l.id}),h(()=>import("./sign-login-payload-BKykauFw.js"),[])]);u.chain_id&&Number(u.chain_id)!==l.id&&await e.switchChain(Ge(Number(u.chain_id)));const f=await d({account:t,payload:u});return await n.doLogin(f)},mutationKey:["siwe_auth","login",t==null?void 0:t.address],onSuccess:()=>r.invalidateQueries({queryKey:["siwe_auth","isLoggedIn"]})}),c=Es({mutationFn:async()=>{if(!n)throw new Error("No auth options provided");return await n.doLogout()},mutationKey:["siwe_auth","logout",t==null?void 0:t.address],onSuccess:()=>r.invalidateQueries({queryKey:["siwe_auth","isLoggedIn"]})});return{doLogin:o.mutateAsync,doLogout:c.mutateAsync,isLoading:s.isFetching,isLoggedIn:s.data,isLoggingIn:o.isPending,isLoggingOut:c.isPending,isPending:s.isPending,requiresAuth:i}}function o8(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return l6(t)?t:null}function a8(e){const t=new Uint8Array(32).fill(0);return e?o8(e)||Ur(u6(e)):Eh(t)}function c8(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:i}){return new Promise((r,s)=>{(async()=>{let o;try{const c=new AbortController;n>0&&(o=setTimeout(()=>{i?c.abort():s(t)},n)),r(await e({signal:(c==null?void 0:c.signal)||null}))}catch(c){(c==null?void 0:c.name)==="AbortError"&&s(t),s(c)}finally{clearTimeout(o)}})()})}class l8 extends lf{constructor({domain:t}){super(`Invalid domain "${yf(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class u8 extends lf{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class d8 extends lf{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function h8(e){const{domain:t,message:n,primaryType:i,types:r}=e,s=(l,u)=>{const d={...u};for(const f of l){const{name:m,type:y}=f;y==="address"&&(d[m]=d[m].toLowerCase())}return d},o=r.EIP712Domain?t?s(r.EIP712Domain,t):{}:{},c=(()=>{if(i!=="EIP712Domain")return s(r[i],n)})();return yf({domain:o,message:c,primaryType:i,types:r})}function up(e){const{domain:t,message:n,primaryType:i,types:r}=e,s=(o,c)=>{for(const l of o){const{name:u,type:d}=l,f=c[u],m=d.match(A6);if(m&&(typeof f=="number"||typeof f=="bigint")){const[p,w,x]=m;d6(f,{signed:w==="int",size:Number.parseInt(x,10)/8})}if(d==="address"&&typeof f=="string"&&!O6(f))throw new k6({address:f});const y=d.match(z6);if(y){const[p,w]=y;if(w&&Mm(f)!==Number.parseInt(w,10))throw new P6({expectedSize:Number.parseInt(w,10),givenSize:Mm(f)})}const g=r[d];g&&(f8(d),s(g,f))}};if(r.EIP712Domain&&t){if(typeof t!="object")throw new l8({domain:t});s(r.EIP712Domain,t)}if(i!=="EIP712Domain")if(r[i])s(r[i],n);else throw new u8({primaryType:i,types:r})}function Ef({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function bq({domain:e}){return dp({domain:e,types:{EIP712Domain:Ef({domain:e})}})}function f8(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new d8({type:e})}function xq(e){const{domain:t={},message:n,primaryType:i}=e,r={EIP712Domain:Ef({domain:t}),...e.types};up({domain:t,message:n,primaryType:i,types:r});const s=["0x1901"];return t&&s.push(dp({domain:t,types:r})),i!=="EIP712Domain"&&s.push(hp({data:n,primaryType:i,types:r})),Ur(W4(s))}function dp({domain:e,types:t}){return hp({data:e,primaryType:"EIP712Domain",types:t})}function hp({data:e,primaryType:t,types:n}){const i=fp({data:e,primaryType:t,types:n});return Ur(i)}function fp({data:e,primaryType:t,types:n}){const i=[{type:"bytes32"}],r=[m8({primaryType:t,types:n})];for(const s of n[t]){const[o,c]=yp({types:n,name:s.name,type:s.type,value:e[s.name]});i.push(o),r.push(c)}return F4(i,r)}function m8({primaryType:e,types:t}){const n=k4(y8({primaryType:e,types:t}));return Ur(n)}function y8({primaryType:e,types:t}){let n="";const i=mp({primaryType:e,types:t});i.delete(e);const r=[e,...Array.from(i).sort()];for(const s of r)n+=`${s}(${t[s].map(({name:o,type:c})=>`${c} ${o}`).join(",")})`;return n}function mp({primaryType:e,types:t},n=new Set){const i=e.match(/^\w*/u),r=i==null?void 0:i[0];if(n.has(r)||t[r]===void 0)return n;n.add(r);for(const s of t[r])mp({primaryType:s.type,types:t},n);return n}function yp({types:e,name:t,type:n,value:i}){if(e[n]!==void 0)return[{type:"bytes32"},Ur(fp({data:i,primaryType:n,types:e}))];if(n==="bytes")return i=`0x${(i.length%2?"0":"")+i.slice(2)}`,[{type:"bytes32"},Ur(i)];if(n==="string")return[{type:"bytes32"},Ur(k4(i))];if(n.lastIndexOf("]")===n.length-1){const r=n.slice(0,n.lastIndexOf("[")),s=i.map(o=>yp({name:t,type:r,types:e,value:o}));return[{type:"bytes32"},Ur(F4(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:n},i]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Tf=BigInt(0),Wh=BigInt(1);function vf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Lf(e){if(!vf(e))throw new Error("Uint8Array expected")}function Iq(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Mq(e){const t=e.toString(16);return t.length&1?"0"+t:t}function jf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Tf:BigInt("0x"+e)}const gp=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",g8=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function pp(e){if(Lf(e),gp)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=g8[e[n]];return t}const Wi={_0:48,_9:57,A:65,F:70,a:97,f:102};function Am(e){if(e>=Wi._0&&e<=Wi._9)return e-Wi._0;if(e>=Wi.A&&e<=Wi.F)return e-(Wi.A-10);if(e>=Wi.a&&e<=Wi.f)return e-(Wi.a-10)}function wp(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(gp)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(n);for(let r=0,s=0;r<n;r++,s+=2){const o=Am(e.charCodeAt(s)),c=Am(e.charCodeAt(s+1));if(o===void 0||c===void 0){const l=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+s)}i[r]=o*16+c}return i}function Cq(e){return jf(pp(e))}function Eq(e){return Lf(e),jf(pp(Uint8Array.from(e).reverse()))}function p8(e,t){return wp(e.toString(16).padStart(t*2,"0"))}function Tq(e,t){return p8(e,t).reverse()}function vq(e,t,n){let i;if(typeof t=="string")try{i=wp(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(vf(t))i=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const r=i.length;if(typeof n=="number"&&r!==n)throw new Error(e+" of length "+n+" expected, got "+r);return i}function w8(...e){let t=0;for(let i=0;i<e.length;i++){const r=e[i];Lf(r),t+=r.length}const n=new Uint8Array(t);for(let i=0,r=0;i<e.length;i++){const s=e[i];n.set(s,r),r+=s.length}return n}const fd=e=>typeof e=="bigint"&&Tf<=e;function _8(e,t,n){return fd(e)&&fd(t)&&fd(n)&&t<=e&&e<n}function Lq(e,t,n,i){if(!_8(t,n,i))throw new Error("expected valid "+e+": "+n+" <= n < "+i+", got "+t)}function jq(e){let t;for(t=0;e>Tf;e>>=Wh,t+=1);return t}const Sq=e=>(Wh<<BigInt(e))-Wh,md=e=>new Uint8Array(e),Om=e=>Uint8Array.from(e);function Dq(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let i=md(e),r=md(e),s=0;const o=()=>{i.fill(1),r.fill(0),s=0},c=(...f)=>n(r,i,...f),l=(f=md(0))=>{r=c(Om([0]),f),i=c(),f.length!==0&&(r=c(Om([1]),f),i=c())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const m=[];for(;f<t;){i=c();const y=i.slice();m.push(y),f+=i.length}return w8(...m)};return(f,m)=>{o(),l(f);let y;for(;!(y=m(u()));)l();return o(),y}}const b8={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||vf(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Nq(e,t,n={}){const i=(r,s,o)=>{const c=b8[s];if(typeof c!="function")throw new Error("invalid validator function");const l=e[r];if(!(o&&l===void 0)&&!c(l,e))throw new Error("param "+String(r)+" is invali
2d. Expected "+s+", got "+l)};for(const[r,s]of Object.entries(t))i(r,s,!1);for(const[r,s]of Object.entries(n))i(r,s,!0);return e}function Aq(e){const t=new WeakMap;return(n,...i)=>{const r=t.get(n);if(r!==void 0)return r;const s=e(n,...i);return t.set(n,s),s}}const yd=new Map;function _p(e){if(yd.has(e))return yd.get(e);const t=cu();return yd.set(e,t),t}function x8(e){var t;return pe({enabled:!!(e!=null&&e.transactionHash)&&(((t=e==null?void 0:e.queryOptions)==null?void 0:t.enabled)??!0),queryFn:async()=>{if(!(e!=null&&e.transactionHash))throw new Error("No transaction hash or user op hash provided");return ru(e)},queryKey:["waitForReceipt",(e==null?void 0:e.chain.id)||-1,e==null?void 0:e.transactionHash],retry:!1})}class I8{constructor(t){Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"next",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.value=t}}class M8{constructor(){Object.defineProperty(this,"head",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tail",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.clear(),this.size=0}enqueue(t){const n=new I8(t);this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.size++}dequeue(){var n;const t=this.head;if(t)return this.head=(n=this.head)==null?void 0:n.next,this.size--,t.value}clear(){this.head=void 0,this.tail=void 0,this.size=0}*[Symbol.iterator](){let t=this.head;for(;t;)yield t.value,t=t.next}}
2const C8={bind(e,t,n){return e.bind(n)}};function E8(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=new M8;let n=0;const i=()=>{if(n--,t.size>0){const c=t.dequeue();c&&c()}},r=async(c,l,u)=>{n++;const d=(async()=>c(...u))();l(d);try{await d}catch{}i()},s=(c,l,u)=>{t.enqueue(C8.bind(r.bind(void 0,c,l,u))),(async()=>{if(await Promise.resolve(),n<e&&t.size>0){const d=t.dequeue();d&&d()}})()},o=(c,...l)=>new Promise(u=>{s(c,u,l)});return Object.defineProperties(o,{activeCount:{get:()=>n},clearQueue:{value(){t.clear()}},pendingCount:{get:()=>t.size}}),o}function bp(e){var i;const t=!!e&&!e.name,n=pe({queryFn:async()=>{if(!e)throw new Error("chain is required");return nu(await Ht(e))},...zs(e),enabled:t,retry:!1});return{isLoading:t&&n.isLoading,name:(e==null?void 0:e.name)??((i=n.data)==null?void 0:i.name)}}function Sf(e){var i,r,s,o;const t=!!e&&!((i=e.icon)!=null&&i.url),n=pe({queryFn:async()=>{if(!e)throw new Error("chain is required");return nu(await Ht(e))},...zs(e),enabled:t,retry:!1});return{isLoading:t&&n.isLoading,url:((r=e==null?void 0:e.icon)==null?void 0:r.url)??((o=(s=n.data)==null?void 0:s.icon)==null?void 0:o.url)}}function T8(e){var i,r;const t=!!e&&"testnet"in e&&!((i=e.faucets)!=null&&i.length)&&e.id!==1337,n=pe({queryFn:async()=>{if(!e)throw new Error("chain is required");return Ht(e)},...zs(e),enabled:t});return{faucets:(e==null?void 0:e.faucets)??((r=n.data)==null?void 0:r.faucets)??[],isLoading:t&&n.isLoading}}function v8(e){var i,r,s,o;const t=!!e&&!((i=e.nativeCurrency)!=null&&i.symbol),n=pe({queryFn:async()=>{if(!e)throw new Error("chain is required");return Ht(e)},...zs(e),enabled:t});return{isLoading:t&&n.isLoading,symbol:((r=e==null?void 0:e.nativeCurrency)==null?void 0:r.symbol)??((o=(s=n.data)==null?void 0:s.nativeCurrency)==null?void 0:o.symbol)}}function Df(e){var r,s;const t=!!e&&!((r=e.blockExplorers)!=null&&r.length),n=pe({queryFn:async()=>{if(!e)throw new Error("chain is required");return Ht(e)},...zs(e),enabled:t}),i=n.data?nu(n.data):void 0;return{explorers:e!=null&&e.blockExplorers&&((s=e==null?void 0:e.blockExplorers)==null?void 0:s.length)>0?e==null?void 0:e.blockExplorers:(i==null?void 0:i.blockExplorers)??[],isLoading:t&&n.isLoading}}function zs(e){return{enabled:!!e,queryKey:["chain",e==null?void 0:e.id],staleTime:1e3*60*60}}function ko(e){return pe({...zs(e),queryFn:async()=>{if(!e)throw new Error("chainId is required");return Ht(e)}})}function xp(e,t){const n=_.useMemo(()=>{const i=E8(t);return e.map(r=>({...zs(r),queryFn:()=>i(()=>Ht(r))}))},[e,t]);return Mf({queries:n})}async function Ip(e,t){const n=await e({method:"eth_getBalance",params:[t.address,t.blockTag||"latest"]});return Th(n)}async function Ts(e){const{address:t,client:n,chain:i}=e,r=e.tokenAddress||(i.id===42429?"0x20c0000000000000000000000000000000000000":void 0);if(r&&_e(r)!==_e(Pt)){const{getBalance:d}=await h(async()=>{const{getBalance:f}=await import("./getBalance-pPDU8PQq.js");return{getBalance:f}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));return d({address:t,contract:zt({address:r,chain:i,client:n})})}const s=uf({chain:i,client:n}),[o,c,l,u]=await Promise.all([S4(i),D4(i),N4(i),Ip(s,{address:t})]);return{chainId:i.id,decimals:c,displayValue:mi(u,c),name:l,symbol:o,tokenAddress:r??Pt,value:u}}function uu(e,t){const{chain:n,address:i,tokenAddress:r,client:s}=e;return pe({...t,enabled:((t==null?void 0:t.enabled)===void 0||t.enabled)&&!!n&&!!s&&!!i,queryFn:async()=>{if(!n)throw new Error("chain is required");if(!s)throw new Error("client is required");if(!i)throw new Error("address is required");return Ts({address:i,chain:n,client:s,tokenAddress:r})},queryKey:["walletBalance",(n==null?void 0:n.id)||-1,i||"0x0",{tokenAddress:r}]})}function L8(e,t,n,i){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,i);const r=BigInt(32),s=BigInt(4294967295),o=Number(n>>r&s),c=Number(n&s),l=i?4:0,u=i?0:4;e.setUint32(t+l,o,i),e.setUint32(t+u,c,i)}function j8(e,t,n){return e&t^~e&n}function S8(e,t,n){return e&t^e&n^t&n}class D8 extends h6{constructor(t,n,i,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=i,this.isLE=r,this.buffer=new Uint8Array(t),this.view=hd(this.buffer)}update(t){Cm(this);const{view:n,buffer:i,blockLen:r}=this;t=f6(t);const s=t.length;for(let o=0;o<s;){const c=Math.min(r-this.pos,s-o);if(c===r){const l=hd(t);for(;r<=s-o;o+=r)this.process(l,o);continue}i.set(t.subarray(o,o+c),this.pos),this.pos+=c,o+=c,this.pos===r&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Cm(this),m6(t,this),this.finished=!0;const{buffer:n,view:i,blockLen:r,isLE:s}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>r-o&&(this.process(i,0),o=0);for(let f=o;f<r;f++)n[f]=0;L8(i,r-8,BigInt(this.length*8),s),this.process(i,0);const c=hd(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)c.setUint32(4*f,d[f],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const i=t.slice(0,n);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:i,length:r,finished:s,destroyed:o,pos:c}=this;return t.length=r,t.pos=c,t.finished=s,t.destroyed=o,r%n&&t.buffer.set(i),t}}const N8=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
2734187,3204031479,3329325298]),dr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),hr=new Uint32Array(64);class A8 extends D8{constructor(t=32){super(64,t,8,!1),this.A=dr[0]|0,this.B=dr[1]|0,this.C=dr[2]|0,this.D=dr[3]|0,this.E=dr[4]|0,this.F=dr[5]|0,this.G=dr[6]|0,this.H=dr[7]|0}get(){const{A:t,B:n,C:i,D:r,E:s,F:o,G:c,H:l}=this;return[t,n,i,r,s,o,c,l]}set(t,n,i,r,s,o,c,l){this.A=t|0,this.B=n|0,this.C=i|0,this.D=r|0,this.E=s|0,this.F=o|0,this.G=c|0,this.H=l|0}process(t,n){for(let f=0;f<16;f++,n+=4)hr[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const m=hr[f-15],y=hr[f-2],g=bi(m,7)^bi(m,18)^m>>>3,p=bi(y,17)^bi(y,19)^y>>>10;hr[f]=p+hr[f-7]+g+hr[f-16]|0}let{A:i,B:r,C:s,D:o,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const m=bi(c,6)^bi(c,11)^bi(c,25),y=d+m+j8(c,l,u)+N8[f]+hr[f]|0,p=(bi(i,2)^bi(i,13)^bi(i,22))+S8(i,r,s)|0;d=u,u=l,l=c,c=o+y|0,o=s,s=r,r=i,i=y+p|0}i=i+this.A|0,r=r+this.B|0,s=s+this.C|0,o=o+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,r,s,o,c,l,u,d)}roundClean(){hr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const O8=y6(()=>new A8),k8={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 R8({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new P8({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new km({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new km({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function z8(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(k8);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class km extends Bi{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class P8 extends Bi{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class R8 extends Bi{constructor({count:t,limit:n}
2){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function U8(e,t){const{as:n}=t,i=Mp(e),r=z8(new Uint8Array(i.length));return i.encode(r),n==="Hex"?z4(r.bytes):r.bytes}function B8(e,t={}){const{as:n="Hex"}=t;return U8(e,{as:n})}function Mp(e){return Array.isArray(e)?V8(e.map(t=>Mp(t))):$8(e)}function V8(e){const t=e.reduce((r,s)=>r+s.length,0),n=Cp(t);return{length:t<=55?1+t:1+n+t,encode(r){t<=55?r.pushByte(192+t):(r.pushByte(247+n),n===1?r.pushUint8(t):n===2?r.pushUint16(t):n===3?r.pushUint24(t):r.pushUint32(t));for(const{encode:s}of e)s(r)}}}function $8(e){const t=typeof e=="string"?g6(e):e,n=Cp(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(r){t.length===1&&t[0]<128?r.pushBytes(t):t.length<=55?(r.pushByte(128+t.length),r.pushBytes(t)):(r.pushByte(183+n),n===1?r.pushUint8(t.length):n===2?r.pushUint16(t.length):n===3?r.pushUint24(t.length):r.pushUint32(t.length),r.pushBytes(t))}}}function Cp(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new Bi("Length is too large.")}function W8(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new gd({signature:e});if(typeof e.s>"u")throw new gd({signature:e});if(n&&typeof e.yParity>"u")throw new gd({signature:e});if(e.r<0n||e.r>Lm)throw new J8({value:e.r});if(e.s<0n||e.s>Lm)throw new X8({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new du({value:e.yParity})}function F8(e){return Nf(z4(e))}function Nf(e){if(e.length!==130&&e.length!==132)throw new K8({signature:e});const t=BigInt(Em(e,0,32)),n=BigInt(Em(e,32,64)),i=(()=>{const r=+`0x${e.slice(130)}`;if(!Number.isNaN(r))try{return Af(r)}catch{throw new du({value:r})}})();return typeof i>"u"?{r:t,s:n}:{r:t,s:n,yParity:i}}function Y8(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return H8(e)}function H8(e){const t=typeof e=="string"?Nf(e):e instanceof Uint8Array?F8(e):typeof e.r=="string"?Z8(e):e.v?Q8(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return W8(t),t}function Q8(e){return{r:e.r,s:e.s,yParity:Af(e.v)}}function Z8(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let i=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof i!="number"&&(i=Af(n)),typeof i!="number")throw new du({value:e.yParity});return i})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function q8(e){const{r:t,s:n,yParity:i}=e;return{r:Qr(t,{size:32}),s:Qr(n,{size:32}),yParity:i===0?"0x0":"0x1"}}function G8(e){const{r:t,s:n,yParity:i}=e;return[i?"0x01":"0x",t===0n?"0x":Tm(Qr(t)),n===0n?"0x":Tm(Qr(n))]}function Af(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new e9({value:e})}function Oq(e){if(e===0)return 27;if(e===1)return 28;throw new du({value:e})}class K8 extends Bi{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${p6(w6(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class gd extends Bi{constructor({signature:t}){super(`Signature \`${_6(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class J8 extends Bi{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class X8 extends Bi{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class du extends Bi{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class e9 extends Bi{constructor({value:t}){super(`Value \`${t}
2\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function t9(e){return n9(e)}function n9(e){return q6(b6("0x05",B8(Ep(e))))}function i9(e){const{address:t,chainId:n,nonce:i,...r}=e;return{address:t,chainId:Qr(n),nonce:Qr(i),...q8(r)}}function r9(e){return e.map(i9)}function Ep(e){const{address:t,chainId:n,nonce:i}=e,r=Y8(e);return[n?Qr(n):"0x",t,i?Qr(i):"0x",...r?G8(r):[]]}function kq(e){if(!e||e.length===0)return[];const t=[];for(const n of e)t.push(Ep(n));return t}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function s9(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Tp(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(n=>typeof n=="string"):t.every(n=>Number.isSafeInteger(n)):!1}function Ml(e,t){if(typeof t!="string")throw new Error(`${e}: string expected`);return!0}function Of(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function Fh(e){if(!Array.isArray(e))throw new Error("array expected")}function Cl(e,t){if(!Tp(!0,t))throw new Error(`${e}: array of strings expected`)}function o9(e,t){if(!Tp(!1,t))throw new Error(`${e}: array of numbers expected`)}function a9(...e){const t=s=>s,n=(s,o)=>c=>s(o(c)),i=e.map(s=>s.encode).reduceRight(n,t),r=e.map(s=>s.decode).reduce(n,t);return{encode:i,decode:r}}function c9(e){const t=typeof e=="string"?e.split(""):e,n=t.length;Cl("alphabet",t);const i=new Map(t.map((r,s)=>[r,s]));return{encode:r=>(Fh(r),r.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return t[s]})),decode:r=>(Fh(r),r.map(s=>{Ml("alphabet.decode",s);const o=i.get(s);if(o===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return o}))}}function l9(e=""){return Ml("join",e),{encode:t=>(Cl("join.decode",t),t.join(e)),decode:t=>(Ml("join.decode",t),t.split(e))}}function u9(e,t="="){return Of(e),Ml("padding",t),{encode(n){for(Cl("padding.encode",n);n.length*e%8;)n.push(t);return n},decode(n){Cl("padding.decode",n);let i=n.length;if(i*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;i>0&&n[i-1]===t;i--)if((i-1)*e%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,i)}}}const vp=(e,t)=>t===0?e:vp(t,e%t),El=(e,t)=>e+(t-vp(e,t)),pd=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function zm(e,t,n,i){if(Fh(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(El(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${El(t,n)}`);let r=0,s=0;const o=pd[t],c=pd[n]-1,l=[];for(const u of e){if(Of(u),u>=o)throw new Error(`convertRadix2: invalid data word=${u} from=${t}`);if(r=r<<t|u,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=n;s-=n)l.push((r>>s-n&c)>>>0);const d=pd[s];if(d===void 0)throw new Error("invalid carry");r&=d-1}if(r=r<<n-s&c,!i&&s>=t)throw new Error("Excess padding");if(!i&&r>0)throw new Error(`Non-zero padding: ${r}`);return i&&s>0&&l.push(r>>>0),l}function d9(e,t=!1){if(Of(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(El(8,e)>32||El(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!s9(n))throw new Error("radix2.encode input should be Uint8Array");return zm(Array.from(n),8,e,!t)},decode:n=>(o9("radix2.decode",n),Uint8Array.from(zm(n,e,8,t)))}}const h9=a9(d9(5),c9("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),u9(5),l9(""));class Ot extends Error{constructor(t){super(t.message),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"correlationId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"statusCode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code,this.correlationId=t.correlationId,this.statusCode=t.statusCode}toString(){return Zt({code:this.code,correlationId:this.correlationId,message:this.message,statusCode:this.statusCode})}}async function f9(e){const{originChainId:t,originTokenAddress:n,destinationChainId:i,destinationTokenAddress:r,sender:s,receiver:o,client:c,amount:l,purchaseData:u,maxSteps:d,paymentLinkId:f,slippageToleranceBps:m}=e,y=hn(c),g=new URL(`${St("bridge")}/v1/buy/prepare`),p=await y(g.toString(),{body:Zt({amount:l.toString(),buyAmountWei:l.toString(),destinationChainId:i.toString(),destinationTokenAddress:r,maxSteps:d,originChainId:t.toString(),originTokenAddress:n,paymentLinkId:f,purchaseData:u,receiver:o,sender:s,slippageToleranceBps:m}),headers:{"Content-Type":"application/json"},method:"POST"});if(!p.ok){const x=await p.json();throw new Ot({code:x.code||"UNKNOWN_ERROR",correlationId:x.correlationId||void 0,message:x.message||p.statusText,statusCode:p.status})}const{data:w}=await p.json();return{blockNumber:w.blockNumber?BigInt(w.blockNumber):void 0,destinationAmount:BigInt(w.destinationAmount),estimatedExecutionTimeMs:w.estimatedExecutionTimeMs,intent:{amount:l,destinationChainId:i,destinationTokenAddress:r,originChainId:t,originTokenAddress:n,receiver:o,sender:s},originAmount:BigInt(w.originAmount),steps:w.steps.map(x=>({...x,transactions:x.transactions.map(I=>
2({...I,chain:Lt(I.chainId),client:c,value:I.value?BigInt(I.value):void 0}))})),timestamp:w.timestamp}}async function m9(e){const{client:t}=e;return Ui(async()=>{const n=hn(t),i=new URL(`${St("bridge")}/v1/chains`);e.testnet&&i.searchParams.set("testnet",e.testnet.toString()),"type"in e&&e.type?i.searchParams.set("type",e.type):"originChainId"in e&&e.originChainId?i.searchParams.set("originChainId",e.originChainId.toString()):"destinationChainId"in e&&e.destinationChainId&&i.searchParams.set("destinationChainId",e.destinationChainId.toString());const r=await n(i.toString());if(!r.ok){const o=await r.json();throw new Ot({code:o.code||"UNKNOWN_ERROR",correlationId:o.correlationId||void 0,message:o.message||r.statusText,statusCode:r.status})}const{data:s}=await r.json();return s},{cacheKey:`bridge-chains-${JSON.stringify(e)}`,cacheTime:1e3*60*60*1})}async function y9(e){const{id:t,client:n}=e,i=hn(n),r=new URL(`${St("bridge")}/v1/onramp/status`);r.searchParams.set("id",t);const s=await i(r.toString());if(!s.ok){const c=await s.json();throw new Ot({code:c.code||"UNKNOWN_ERROR",correlationId:c.correlationId||void 0,message:c.message||s.statusText,statusCode:s.status})}const{data:o}=await s.json();return o}async function kf(e){const{client:t,onramp:n,chainId:i,tokenAddress:r,receiver:s,amount:o,purchaseData:c,sender:l,onrampTokenAddress:u,onrampChainId:d,currency:f,maxSteps:m,excludeChainIds:y,paymentLinkId:g,country:p}=e,w=hn(t),x=`${St("bridge")}/v1/onramp/prepare`,I={chainId:Number(i),onramp:n,receiver:s,tokenAddress:r};o!==void 0&&(I.amount=o.toString()),c!==void 0&&(I.purchaseData=c),l!==void 0&&(I.sender=l),u!==void 0&&(I.onrampTokenAddress=u),d!==void 0&&(I.onrampChainId=Number(d)),f!==void 0&&(I.currency=f),m!==void 0&&(I.maxSteps=m),y!==void 0&&(I.excludeChainIds=Array.isArray(y)?y.join(","):y),g!==void 0&&(I.paymentLinkId=g),p!==void 0&&(I.country=p);const E=await w(x,{body:Zt(I),headers:{"Content-Type":"application/json"},method:"POST"});if(!E.ok){const v=await E.json();throw new Ot({code:v.code||"UNKNOWN_ERROR",correlationId:v.correlationId||void 0,message:v.message||E.statusText,statusCode:E.status})}const{data:j}=await E.json(),C=j.steps.map(v=>({...v,destinationAmount:BigInt(v.destinationAmount),originAmount:BigInt(v.originAmount),transactions:v.transactions.map(N=>({...N,chain:Lt(N.chainId),client:t,value:N.value?BigInt(N.value):void 0}))})),T={...j.intent,amount:j.intent.amount?j.intent.amount:void 0};return{...j,destinationAmount:BigInt(j.destinationAmount),intent:T,steps:C}}const zq=Object.freeze(Object.defineProperty({__proto__:null,prepare:kf,status:y9},Symbol.toStringTag,{value:"Module"}));async function g9(e){const{originChainId:t,originTokenAddress:n,destinationChainId:i,destinationTokenAddress:r,amount:s,sender:o,receiver:c,client:l,purchaseData:u,maxSteps:d,paymentLinkId:f,slippageToleranceBps:m}=e,y=hn(l),g=new URL(`${St("bridge")}/v1/sell/prepare`),p=await y(g.toString(),{body:Zt({amount:s.toString(),destinationChainId:i.toString(),destinationTokenAddress:r,maxSteps:d,originChainId:t.toString(),originTokenAddress:n,paymentLinkId:f,purchaseData:u,receiver:c,sellAmountWei:s.toString(),sender:o,slippageToleranceBps:m}),headers:{"Content-Type":"application/json"},method:"POST"});if(!p.ok){const x=await p.json();throw new Ot({code:x.code||"UNKNOWN_ERROR",correlationId:x.correlationId||void 0,message:x.message||p.statusText,statusCode:p.status})}const{data:w}=await p.json();return{blockNumber:w.blockNumber?BigInt(w.blockNumber):void 0,destinationAmount:BigInt(w.destinationAmount),estimatedExecutionTimeMs:w.estimatedExecutionTimeMs,expiration:w.expiration,intent:{amount:s,destinationChainId:i,destinationTokenAddress:r,originChainId:t,originTokenAddress:n,purchaseData:u,receiver:c,sender:o},originAmount:BigInt(w.originAmount),steps:w.steps.map(x=>({...x,transactions:x.transactions.map(I=>({...I,chain:Lt(I.chainId),client:l,value:I.value?BigInt(I.value):void 0}))})),timestamp:w.timestamp}}async function zf(e){const{client:t,chainId:n,tokenAddress:i,symbol:r,name:s,limit:o,offset:c,includePrices:l,sortBy:u,query:d}=e,f=hn(t),m=new URL(`${St("bridge")}/v1/tokens`);n!=null&&m.searchParams.set("chainId",n.toString()),i&&m.searchParams.set("tokenAddress",i),r&&m.searchParams.set("symbol",r),s&&m.searchParams.set("name",s),o!==void 0&&m.searchParams.set("limit",o.toString()),c!=null&&m.searchParams.set("offset",c.toString()),l!==void 0&&m.searchParams.set("includePrices",l.toString()),u!==void 0&&m.searchParams.set("sortBy",u),d!==void 0&&m.searchParams.set("query",d);const y=await f(m.toString());if(!y.ok){const p=await y.json();throw new Ot({code:p.code||"UNKNOWN_ERROR",correlationId:p.correlationId||void 0,message:p.message||y.statusText,statusCode:y.status})}const{data:g}=await y.json();return g}async function p9(e){const{client:t,chainId:n,tokenAddress:i}=e,r=hn(t),s=`${St("bridge")}/v1/tokens`,c=await r(s,{body:JSON.stringify({chainId:n,tokenAddress:i}),headers:{"Content-Type":"application/json"},method:"POST"});if(!c.ok){const u=await c.json();throw new Ot({code:u.code||"UNKNOWN_ERROR",correlationId:u.correlationId||void 0,message:u.message||c.statusText,statusCode:c.status})}const{data:l}=await c.json();return l}async function w9(e){const{chainId:t,tokenAddress:n,sender:i,receiver:r,client:s,amount:o,purchaseData:c,feePayer:l,paymentLinkId:u}=e,d=hn(s),f=new URL(`${St("bridge")}/v1/transfer/prepare`),m=await d(f.toString(),{body:Zt({amount:o.toString(),chainId:t.toString(),feePayer:l,paymentLinkId:u,purchaseData:c,receiver:r,sender:i,tokenAddress:n,transferAmountWei:o.toString()}),headers:{"Content-Type":"application/json"},method:"POST"});if(!m.ok){const g=await m.json();throw new Ot({code:g.code||"UNKNOWN_ERROR",correlationId:g.correlationId||void 0,message:g.message||m.statusText,statusCode:m.status})}const{data:y}=await m.json();return{blockNumber:y.blockNumber?BigInt(y.blockNumber):void 0,destinationAmount:BigInt(y.destinationAmount),estimatedExecutionTimeMs:y.estimatedExecutionTimeMs,intent:{amount:o,chainId:t,feePayer:l,receiver:r,sender:i,tokenAddress:n},originAmount:BigInt(y.originAmount),steps:y.steps.map(g=>({...g,transactions:g.transactions.map(p=>({...p,chain:Lt(p.chainId),client:s,value:p.value?BigInt(p.value):void 0}))})),timestamp:y.timestamp}}function ft(){const t=Vi("useActiveWallet").activeWalletStore;return _.useSyncExternalStore(t.subscribe,t.getValue,t.getValue)}function jt(){const t=Vi("useActiveWalletChain").activeWalletChainStore;return _.useSyncExternalStore(t.subscribe,t.getValue,t.getValue)}function _9(){const t=Vi("useActiveWalletConnectionStatus").activeWalletConnectionStatusStore;return _.useSyncExternalStore(t.subscribe,t.getValue,t.getValue)}function b9(){return Vi("useAddConnectedWallet").addConnectedWallet}function Ps(){const t=Vi("useConnectedWallets").connectedWallets;return _.useSyncExternalStore(t.subscribe,t.getValue,t.getValue)}function hu(){var i;const e=ft(),t=Ps(),n=(i=e==null?void 0:e.getAdminAccount)==null?void 0:i.call(e);return n?t.find(r=>{var s,o,c;return((o=(s=r.getAccount())==null?void 0:s.address)==null?void 0:o.toLowerCase())===((c=n==null?void 0:n.address)==null?void 0:c.toLowerCase())}):e}function Pf(e,t){const n={};for(const[i,r]of Object.entries(e)){n[Number(i)]={};const s={};for(const[o,c]of Object.entries(r))s[o]=c;n[Number(i)]=s}return typeof t=="number"?{[t]:n[t]}:n}function x9(){return Vi("useSetActiveWalletConnectionStatus").activeWalletConnectionStatusStore.setValue}function I9(e){const t=Vi("useConnect"),{connect:n}=t,i=x9(),[r,s]=_.useState(!1),[o,c]=_.useState(null),l=_.useCallback(async d=>{if(c(null),i("connecting"),typeof d!="function"){const f=await n(d,e);return i("connected"),f}s(!0);try{const f=await d(),m=await n(f,e);return i("connected"),m}catch(f){console.error(f),c(f),i("disconnected")}finally{s(!1)}return null},[n,e,i]),u=_.useCallback(()=>{s(!1),i("disconnected")},[i]);return{connect:l,error:o,isConnecting:r,cancelConnection:u}}async function M9(e){var o;const{wallet:t,chain:n}=e,i=t.getAccount();if(!i)throw new Error(`Cannot send calls, no account connected for wallet: ${t.id}`);const r=e.calls[0];if(!r)throw new Error("No calls to send");const s=r.chain||n;if(((o=t.getChain())==null?void 0:o.id)!==s.id&&await t.switchChain(s),i.sendCalls){const{wallet:c,...l}=e;return{...await i.sendCalls(l),wallet:t}}throw new Error(`Cannot send calls, wallet ${t.id} does not support EIP-5792`)}async function fu(e,t){const n=e.calls[0];if(!n)throw new Error("No calls to send");const{calls:i,capabilities:r,version:s="2.0.0",chain:o=n.chain}=e,c=await Promise.all(i.map(async u=>{const{to:d,value:f}=u;if(d===void 0&&u.data===void 0)throw new Error("Cannot send call, `to` or `data` must be provided.");const[m,y,g]=await Promise.all([wn(d),gf(u),wn(f)]);return m?{data:y,to:_e(m),value:typeof g=="bigint"||typeof g=="number"?ln(g):void 0}:{data:y,to:void 0,value:void 0}}));return{callParams:[{atomicRequired:e.atomicRequired??!1,calls:c,capabilities:r,chainId:ln(o.id),from:_e(t.address),version:s}],chain:o}}const C9=Object.freeze(Object.defineProperty({__proto__:null,sendCalls:M9,toProviderCallParams:fu},Symbol.toStringTag,{value:"Module"}));async function E9({wallet:e,client:t,id:n}){const i=e.getAccount();if(!i)throw new Error(`Failed to get call status, no account found for wallet ${e.id}`);const r=e.getChain();
2if(!r)throw new Error(`Failed to get call status, no chain found for wallet ${e.id}`);if(i.getCallsStatus)return i.getCallsStatus({id:n,chain:r,client:t});throw new Error(`Failed to get call status, wallet ${e.id} does not support EIP-5792`)}const T9={"0x0":"reverted","0x1":"success"};function Rf(e){var i;const[t,n]=(()=>{const r=e.status;return r>=100&&r<200?["pending",r]:r>=200&&r<300?["success",r]:r>=300&&r<700?["failure",r]:r==="CONFIRMED"?["success",200]:r==="PENDING"?["pending",100]:[void 0,r]})();return{...e,atomic:e.atomic,chainId:e.chainId?P4(e.chainId):void 0,receipts:((i=e.receipts)==null?void 0:i.map(r=>({...r,blockNumber:Th(r.blockNumber),gasUsed:Th(r.gasUsed),status:T9[r.status]})))??[],status:t,statusCode:n,version:e.version}}const v9=100,Sc=new Map;function L9(e){const{id:t,chain:n,wallet:i,client:r}=e,o=`${n.id}:calls_${t}`,c=e.maxBlocksWaitTime??v9;if(Sc.has(o))return Sc.get(o);const l=new Promise((u,d)=>{let f=-1;const m=x6({chain:n,client:r,onNewBlockNumber:async()=>{if(f++,f>=c){m(),d(new Error(`Bundle not confirmed after ${c} blocks`));return}try{const y=await E9({client:r,id:t,wallet:i});if(y.status==="success"||y.status==="failure"){m(),u(y);return}}catch(y){console.error("waitForCallsReceipt error",y)}}})}).finally(()=>{Sc.delete(o)});return Sc.set(o,l),l}function Lp(){return Vi("useSetActiveWallet").setActiveWallet}function Uf(){return Vi("useSwitchActiveWalletChain").switchActiveWalletChain}async function Bf(e){const{address:t,client:n}=e,r=await hn(n)(`${St("social")}/v1/profiles/${t}`);if(!r.ok){const s=await r.text().catch(()=>"Unknown error");throw new Error(`Failed to fetch profile: ${r.status} ${r.statusText} - ${s}`)}return(await r.json()).data}function j9(e){const{client:t,address:n}=e;return pe({enabled:!!n,queryFn:async()=>{if(!n)throw new Error("Address is required, should not have reached this point.");return await Bf({address:n,client:t})},queryKey:["social-profiles",n],retry:!1})}const fr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAwIiBoZWlnaHQ9IjI1MDAiIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0iIzYyN0VFQSIvPjxnIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZmlsbC1vcGFjaXR5PSIuNjAyIiBkPSJNMTYuNDk4IDR2OC44N2w3LjQ5NyAzLjM1eiIvPjxwYXRoIGQ9Ik0xNi40OTggNEw5IDE2LjIybDcuNDk4LTMuMzV6Ii8+PHBhdGggZmlsbC1vcGFjaXR5PSIuNjAyIiBkPSJNMTYuNDk4IDIxLjk2OHY2LjAyN0wyNCAxNy42MTZ6Ii8+PHBhdGggZD0iTTE2LjQ5OCAyNy45OTV2LTYuMDI4TDkgMTcuNjE2eiIvPjxwYXRoIGZpbGwtb3BhY2l0eT0iLjIiIGQ9Ik0xNi40OTggMjAuNTczbDcuNDk3LTQuMzUzLTcuNDk3LTMuMzQ4eiIvPjxwYXRoIGZpbGwtb3BhY2l0eT0iLjYwMiIgZD0iTTkgMTYuMjJsNy40OTggNC4zNTN2LTcuNzAxeiIvPjwvZz48L2c+PC9zdmc+",Dc="data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMzkuNDMgMjk1LjI3Ij48dGl0bGU+dGV0aGVyLXVzZHQtbG9nbzwvdGl0bGU+PHBhdGggZD0iTTYyLjE1LDEuNDVsLTYxLjg5LDEzMGEyLjUyLDIuNTIsMCwwLDAsLjU0LDIuOTRMMTY3Ljk1LDI5NC41NmEyLjU1LDIuNTUsMCwwLDAsMy41MywwTDMzOC42MywxMzQuNGEyLjUyLDIuNTIsMCwwLDAsLjU0LTIuOTRsLTYxLjg5LTEzMEEyLjUsMi41LDAsMCwwLDI3NSwwSDY0LjQ1YTIuNSwyLjUsMCwwLDAtMi4zLDEuNDVoMFoiIHN0eWxlPSJmaWxsOiM1MGFmOTU7ZmlsbC1ydWxlOmV2ZW5vZGQiLz48cGF0aCBkPSJNMTkxLjE5LDE0NC44djBjLTEuMi4wOS03LjQsMC40Ni0yMS4yMywwLjQ2LTExLDAtMTguODEtLjMzLTIxLjU1LTAuNDZ2MGMtNDIuNTEtMS44Ny03NC4yNC05LjI3LTc0LjI0LTE4LjEzczMxLjczLTE2LjI1LDc0LjI0LTE4LjE1djI4LjkxYzIuNzgsMC4yLDEwLjc0LjY3LDIxLjc0LDAuNjcsMTMuMiwwLDE5LjgxLS41NSwyMS0wLjY2di0yOC45YzQyLjQyLDEuODksNzQuMDgsOS4yOSw3NC4wOCwxOC4xM3MtMzEuNjUsMTYuMjQtNzQuMDgsMTguMTJoMFptMC0zOS4yNVY3OS42OGg1OS4yVjQwLjIzSDg5LjIxVjc5LjY4SDE0OC40djI1Ljg2Yy00OC4xMSwyLjIxLTg0LjI5LDExLjc0LTg0LjI5LDIzLjE2czM2LjE4LDIwLjk0LDg0LjI5LDIzLjE2djgyLjloNDIuNzhWMTUxLjgzYzQ4LTIuMjEsODQuMTItMTEuNzMsODQuMTItMjMuMTRzLTM2LjA5LTIwLjkzLTg0LjEyLTIzLjE1aDBabTAsMGgwWiIgc3R5bGU9ImZpbGw6I2ZmZjtmaWxsLXJ1bGU6ZXZlbm9kZCIvPjwvc3ZnPg==",Zn="data:image/svg+xml;base64,PHN2ZyBkYXRhLW5hbWU9Ijg2OTc3Njg0LTEyZGItNDg1MC04ZjMwLTIzM2E3YzI2N2QxMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMjAwMCAyMDAwIj4KICA8
2cGF0aCBkPSJNMTAwMCAyMDAwYzU1NC4xNyAwIDEwMDAtNDQ1LjgzIDEwMDAtMTAwMFMxNTU0LjE3IDAgMTAwMCAwIDAgNDQ1LjgzIDAgMTAwMHM0NDUuODMgMTAwMCAxMDAwIDEwMDB6IiBmaWxsPSIjMjc3NWNhIi8+CiAgPHBhdGggZD0iTTEyNzUgMTE1OC4zM2MwLTE0NS44My04Ny41LTE5NS44My0yNjIuNS0yMTYuNjYtMTI1LTE2LjY3LTE1MC01MC0xNTAtMTA4LjM0czQxLjY3LTk1LjgzIDEyNS05NS44M2M3NSAwIDExNi42NyAyNSAxMzcuNSA4Ny41IDQuMTcgMTIuNSAxNi42NyAyMC44MyAyOS4xNyAyMC44M2g2Ni42NmMxNi42NyAwIDI5LjE3LTEyLjUgMjkuMTctMjkuMTZ2LTQuMTdjLTE2LjY3LTkxLjY3LTkxLjY3LTE2Mi41LTE4Ny41LTE3MC44M3YtMTAwYzAtMTYuNjctMTIuNS0yOS4xNy0zMy4zMy0zMy4zNGgtNjIuNWMtMTYuNjcgMC0yOS4xNyAxMi41LTMzLjM0IDMzLjM0djk1LjgzYy0xMjUgMTYuNjctMjA0LjE2IDEwMC0yMDQuMTYgMjA0LjE3IDAgMTM3LjUgODMuMzMgMTkxLjY2IDI1OC4zMyAyMTIuNSAxMTYuNjcgMjAuODMgMTU0LjE3IDQ1LjgzIDE1NC4xNyAxMTIuNXMtNTguMzQgMTEyLjUtMTM3LjUgMTEyLjVjLTEwOC4zNCAwLTE0NS44NC00NS44NC0xNTguMzQtMTA4LjM0LTQuMTYtMTYuNjYtMTYuNjYtMjUtMjkuMTYtMjVoLTcwLjg0Yy0xNi42NiAwLTI5LjE2IDEyLjUtMjkuMTYgMjkuMTd2NC4xN2MxNi42NiAxMDQuMTYgODMuMzMgMTc5LjE2IDIyMC44MyAyMDB2MTAwYzAgMTYuNjYgMTIuNSAyOS4xNiAzMy4zMyAzMy4zM2g2Mi41YzE2LjY3IDAgMjkuMTctMTIuNSAzMy4zNC0zMy4zM3YtMTAwYzEyNS0yMC44NCAyMDguMzMtMTA4LjM0IDIwOC4zMy0yMjAuODR6IiBmaWxsPSIjZmZmIi8+CiAgPHBhdGggZD0iTTc4Ny41IDE1OTUuODNjLTMyNS0xMTYuNjYtNDkxLjY3LTQ3OS4xNi0zNzAuODMtODAwIDYyLjUtMTc1IDIwMC0zMDguMzMgMzcwLjgzLTM3MC44MyAxNi42Ny04LjMzIDI1LTIwLjgzIDI1LTQxLjY3VjMyNWMwLTE2LjY3LTguMzMtMjkuMTctMjUtMzMuMzMtNC4xNyAwLTEyLjUgMC0xNi42NyA0LjE2LTM5NS44MyAxMjUtNjEyLjUgNTQ1Ljg0LTQ4Ny41IDk0MS42NyA3NSAyMzMuMzMgMjU0LjE3IDQxMi41IDQ4Ny41IDQ4Ny41IDE2LjY3IDguMzMgMzMuMzQgMCAzNy41LTE2LjY3IDQuMTctNC4xNiA0LjE3LTguMzMgNC4xNy0xNi42NnYtNTguMzRjMC0xMi41LTEyLjUtMjkuMTYtMjUtMzcuNXpNMTIyOS4xNyAyOTUuODNjLTE2LjY3LTguMzMtMzMuMzQgMC0zNy41IDE2LjY3LTQuMTcgNC4xNy00LjE3IDguMzMtNC4xNyAxNi42N3Y1OC4zM2MwIDE2LjY3IDEyLjUgMzMuMzMgMjUgNDEuNjcgMzI1IDExNi42NiA0OTEuNjcgNDc5LjE2IDM3MC44MyA4MDAtNjIuNSAxNzUtMjAwIDMwOC4zMy0zNzAuODMgMzcwLjgzLTE2LjY3IDguMzMtMjUgMjAuODMtMjUgNDEuNjdWMTcwMGMwIDE2LjY3IDguMzMgMjkuMTcgMjUgMzMuMzMgNC4xNyAwIDEyLjUgMCAxNi42Ny00LjE2IDM5NS44My0xMjUgNjEyLjUtNTQ1Ljg0IDQ4Ny41LTk0MS42Ny03NS0yMzcuNS0yNTguMzQtNDE2LjY3LTQ4Ny41LTQ5MS42N3oiIGZpbGw9IiNmZmYiLz4KPC9zdmc+Cg==",Nc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDkuMjYgMTA5LjI2Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzVhNTU2NDt9LmNscy0ye2ZpbGw6I2YwOTI0Mjt9LmNscy0ze2ZpbGw6IzI4MjEzODt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPndyYXBwZWQtYml0Y29pbi13YnRjPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iTGF5ZXJfMS0yIiBkYXRhLW5hbWU9IkxheWVyIDEiPjxnIGlkPSJQYWdlLTEiPjxnIGlkPSJ3YnRjX2NvbG91ciIgZGF0YS1uYW1lPSJ3YnRjIGNvbG91ciI+PHBhdGggaWQ9IlNoYXBlIiBjbGFzcz0iY2xzLTEiIGQ9Ik04OS4wOSwyMi45M2wtMywzYTQyLjQ3LDQyLjQ3LDAsMCwxLDAsNTcuMzJsMywzYTQ2Ljc2LDQ2Ljc2LDAsMCwwLDAtNjMuMzlaIi8+PHBhdGggaWQ9IlNoYXBlLTIiIGRhdGEtbmFtZT0iU2hhcGUiIGNsYXNzPSJjbHMtMSIgZD0iTTI2LDIzLjE5YTQyLjQ3LDQyLjQ3LDAsMCwxLDU3LjMyLDBsMy0zYTQ2Ljc2LDQ2Ljc2LDAsMCwwLTYzLjM5LDBaIi8+PHBhdGggaWQ9IlNoYXBlLTMiIGRhdGEtbmFtZT0iU2hhcGUiIGNsYXNzPSJjbHMtMSIgZD0iTTIzLjE5LDgzLjI4YTQyLjQ3LDQyLjQ3LDAsMCwxLDAtNTcuMjlsLTMtM2E0Ni43Niw0Ni43NiwwLDAsMCwwLDYzLjM5WiIvPjxwYXRoIGlkPSJTaGFwZS00IiBkYXRhLW5hbWU9IlNoYXBlIiBjbGFzcz0iY2xzLTEiIGQ9Ik04My4yOCw4Ni4wNWE0Mi40Nyw0Mi40NywwLDAsMS01Ny4zMiwwbC0zLDNhNDYuNzYsNDYuNzYsMCwwLDAsNjMuMzksMFoiLz48cGF0aCBpZD0iU2hhcGUtNSIgZGF0YS1uYW1lPSJTaGFwZSIgY2xhc3M9ImNscy0yIiBkPSJNNzMuNTcsNDQuNjJjLS42LTYuMjYtNi04LjM2LTEyLjgzLTlWMjdINTUuNDZ2OC40NmMtMS4zOSwwLTIuODEsMC00LjIyLDBWMjdINDZ2OC42OEgzNS4yOXY1LjY1czMuOS0uMDcsMy44NCwwYTIuNzMsMi43MywwLDAsMSwzLDIuMzJWNjcuNDFhMS44NSwxLjg1LDAsMCwxLS42NCwxLjI5LDEuODMsMS44MywwLDAsMS0xLjM2LjQ2Yy4wNy4wNi0zLjg0LDAtMy44NCwwbC0xLDYuMzFINDUuOXY4LjgyaDUuMjhWNzUuNkg1NS40djguNjVoNS4yOVY3NS41M2M4LjkyLS41NCwxNS4xNC0yLjc0LDE1LjkyLTExLjA5LjYzLTYuNzItMi41My05LjcyLTcuNTgtMTAuOTNDNzIuMSw1Miw3NCw0OS4yLDczLjU3LDQ0LjYyWk02Ni4xNyw2My40YzAsNi41Ni0xMS4yNCw1LjgxLTE0LjgyLDUuODFWNTcuNTdDNTQuOTMsNTcuNTgsNjYuMTcsNTYuNTUsNjYuMTcsNjMuNFpNNjMuNzIsNDdjMCw2LTkuMzgsNS4yNy0xMi4zNiw1LjI3VjQxLjY5QzU0LjM0LDQxLjY5LDYzLjcyLDQwLjc1LDYzLjcyLDQ3WiIvPjxwYXRoIGlkPSJTaGFwZS02IiBkYXRhLW5hbWU9IlNoYXBlIiBjbGFzcz0iY2xzLTMiIGQ9Ik01NC42MiwxMDkuMjZhNTQuNjMsNTQuNjMsMCwxLDEsNTQuNjQtNTQuNjRBNTQuNjMsNTQuNjMsMCwwLDEsNTQuNjIsMTA5LjI2Wm0wLTEwNUE1MC4zNCw1MC4zNCwwLDEsMCwxMDUsNTQuNjIsNTAuMzQsNTAuMzQsMCwwLDAsNTQuNjIsNC4yNloiLz48L2c+PC9nPjwvZz48L2c+PC9zdmc+",wd="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8Y2lyY2xlIGN4PSI1MTIiIGN5PSI1MTIiIHI9IjUxMiIgZmlsbD0iIzgyNDdFNSIvPgo8cGF0aCBkPSJNNjgxLjQ2OSA0MDIuNDU2QzY2OS4xODkgMzk1LjMxMiA2NTMuMjI0IDM5NS4zMTIgNjM5LjcxNiA0MDIuNDU2TDU0My45MjggNDU3LjIyOEw0NzguODQyIDQ5Mi45NDlMMzgzLjA1NSA1NDcuNzIxQzM3MC43NzQgNTU0Ljg2NSAzNTQuODEgNTU0Ljg2NSAzNDEuMzAxIDU0Ny43MjFMMjY1LjE2MiA1MDQuODU2QzI1Mi44ODIgNDk3LjcxMiAyNDQuMjg2IDQ4NC42MTQgMjQ0LjI4NiA0NzAuMzI1VjM4NS43ODZDMjQ0LjI4NiAzNzEuNDk4IDI1MS42NTQgMzU4LjQgMjY1LjE2MiAzNTEuMjU2TDM0MC4wNzMgMzA5LjU4MUMzNTIuMzUzIDMwMi40MzcgMzY4LjMxOCAzMDIuNDM3IDM4MS44MjcgMzA5LjU4MUw0NTYuNzM3IDM1MS4yNTZDNDY5LjAxOCAzNTguNCA0NzcuNjE0IDM3MS40OTggNDc3
2LjYxNCAzODUuNzg2VjQ0MC41NThMNTQyLjcgNDAzLjY0NlYzNDguODc0QzU0Mi43IDMzNC41ODYgNTM1LjMzMiAzMjEuNDg4IDUyMS44MjQgMzE0LjM0NEwzODMuMDU1IDIzNS43NThDMzcwLjc3NCAyMjguNjE0IDM1NC44MSAyMjguNjE0IDM0MS4zMDEgMjM1Ljc1OEwyMDAuMDc2IDMxNC4zNDRDMTg2LjU2NyAzMjEuNDg4IDE3OS4xOTkgMzM0LjU4NiAxNzkuMTk5IDM0OC44NzRWNTA3LjIzN0MxNzkuMTk5IDUyMS41MjUgMTg2LjU2NyA1MzQuNjIzIDIwMC4wNzYgNTQxLjc2N0wzNDEuMzAxIDYyMC4zNTNDMzUzLjU4MiA2MjcuNDk4IDM2OS41NDYgNjI3LjQ5OCAzODMuMDU1IDYyMC4zNTNMNDc4Ljg0MiA1NjYuNzcyTDU0My45MjggNTI5Ljg2TDYzOS43MTYgNDc2LjI3OUM2NTEuOTk2IDQ2OS4xMzUgNjY3Ljk2MSA0NjkuMTM1IDY4MS40NjkgNDc2LjI3OUw3NTYuMzggNTE3Ljk1M0M3NjguNjYgNTI1LjA5OCA3NzcuMjU3IDUzOC4xOTUgNzc3LjI1NyA1NTIuNDg0VjYzNy4wMjNDNzc3LjI1NyA2NTEuMzEyIDc2OS44ODggNjY0LjQwOSA3NTYuMzggNjcxLjU1M0w2ODEuNDY5IDcxNC40MTlDNjY5LjE4OSA3MjEuNTYzIDY1My4yMjQgNzIxLjU2MyA2MzkuNzE2IDcxNC40MTlMNTY0LjgwNSA2NzIuNzQ0QzU1Mi41MjUgNjY1LjYgNTQzLjkyOCA2NTIuNTAyIDU0My45MjggNjM4LjIxNFY1ODMuNDQyTDQ3OC44NDIgNjIwLjM1M1Y2NzUuMTI1QzQ3OC44NDIgNjg5LjQxNCA0ODYuMjEgNzAyLjUxMiA0OTkuNzE5IDcwOS42NTZMNjQwLjk0NCA3ODguMjQyQzY1My4yMjQgNzk1LjM4NiA2NjkuMTg5IDc5NS4zODYgNjgyLjY5NyA3ODguMjQyTDgyMy45MjIgNzA5LjY1NkM4MzYuMjAzIDcwMi41MTIgODQ0Ljc5OSA2ODkuNDE0IDg0NC43OTkgNjc1LjEyNVY1MTYuNzYzQzg0NC43OTkgNTAyLjQ3NCA4MzcuNDMxIDQ4OS4zNzcgODIzLjkyMiA0ODIuMjMyTDY4MS40NjkgNDAyLjQ1NloiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=",Pm="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiI+PGcgZmlsbD0ibm9uZSI+PGNpcmNsZSBjeD0iMTYiIGN5PSIxNiIgcj0iMTYiIGZpbGw9IiNGM0JBMkYiLz48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMTIuMTE2IDE0LjQwNEwxNiAxMC41MmwzLjg4NiAzLjg4NiAyLjI2LTIuMjZMMTYgNmwtNi4xNDQgNi4xNDQgMi4yNiAyLjI2ek02IDE2bDIuMjYtMi4yNkwxMC41MiAxNmwtMi4yNiAyLjI2TDYgMTZ6bTYuMTE2IDEuNTk2TDE2IDIxLjQ4bDMuODg2LTMuODg2IDIuMjYgMi4yNTlMMTYgMjZsLTYuMTQ0LTYuMTQ0LS4wMDMtLjAwMyAyLjI2My0yLjI1N3pNMjEuNDggMTZsMi4yNi0yLjI2TDI2IDE2bC0yLjI2IDIuMjZMMjEuNDggMTZ6bS0zLjE4OC0uMDAyaC4wMDJ2LjAwMkwxNiAxOC4yOTRsLTIuMjkxLTIuMjktLjAwNC0uMDA0LjAwNC0uMDAzLjQwMS0uNDAyLjE5NS0uMTk1TDE2IDEzLjcwNmwyLjI5MyAyLjI5M3oiLz48L2c+PC9zdmc+",Rm="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMzYuNDEgMzM3LjQyIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2YwYjkwYjtzdHJva2U6I2YwYjkwYjt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkFzc2V0IDE8L3RpdGxlPjxnIGlkPSJMYXllcl8yIiBkYXRhLW5hbWU9IkxheWVyIDIiPjxnIGlkPSJMYXllcl8xLTIiIGRhdGEtbmFtZT0iTGF5ZXIgMSI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTY4LjIuNzFsNDEuNSw0Mi41TDEwNS4yLDE0Ny43MWwtNDEuNS00MS41WiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTIzMS4yLDYzLjcxbDQxLjUsNDIuNUwxMDUuMiwyNzMuNzFsLTQxLjUtNDEuNVoiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik00Mi4yLDEyNi43MWw0MS41LDQyLjUtNDEuNSw0MS41TC43LDE2OS4yMVoiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0yOTQuMiwxMjYuNzFsNDEuNSw0Mi41TDE2OC4yLDMzNi43MWwtNDEuNS00MS41WiIvPjwvZz48L2c+PC9zdmc+",Um="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMzIgMzIiPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDojZmZmO2ZpbGwtcnVsZTpldmVub2RkO30uY2xzLTJ7ZmlsbDojMTNiNWVjO30uY2xzLTN7bWFzazp1cmwoI21hc2spO308L3N0eWxlPjxtYXNrIGlkPSJtYXNrIiB4PSIxMCIgeT0iNiIgd2lkdGg9IjkzLjEiIGhlaWdodD0iMjAiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiPjxnIGlkPSJhIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xMCw2aDkzLjFWMjZIMTBaIi8+PC9nPjwvbWFzaz48L2RlZnM+PHRpdGxlPmZhPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iTGF5ZXJfMS0yIiBkYXRhLW5hbWU9IkxheWVyIDEiPjxjaXJjbGUgY2xhc3M9ImNscy0yIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTYiLz48ZyBjbGFzcz0iY2xzLTMiPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE3LjIsMTIuOWwzLjYtMi4xVjE1Wm0zLjYsOUwxNiwyNC43bC00LjgtMi44VjE3TDE2LDE5LjgsMjAuOCwxN1pNMTEuMiwxMC44bDMuNiwyLjFMMTEuMiwxNVptNS40LDMuMUwyMC4yLDE2bC0zLjYsMi4xWm0tMS4yLDQuMkwxMS44LDE2bDMuNi0yLjFabTQuOC04LjNMMTYsMTIuMiwxMS44LDkuOCwxNiw3LjNaTTEwLDkuNFYyMi41bDYsMy40LDYtMy40VjkuNEwxNiw2WiIvPjwvZz48L2c+PC9nPjwvc3ZnPg==",S9={1:[{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",icon:fr,name:"Wrapped Ether",symbol:"WETH"},{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",icon:Dc,name:"Tether USD",symbol:"USDT"},{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",icon:Zn,name:"USD Coin",symbol:"USDC"},{address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",icon:Nc,name:"Wrapped Bitc
2oin",symbol:"WBTC"},{address:"0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0",icon:wd,name:"Polygon",symbol:"WMATIC"}],10:[{address:"0x4200000000000000000000000000000000000006",icon:fr,name:"Wrapped Ether",symbol:"WETH"},{address:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",icon:Zn,name:"USD Coin",symbol:"USDC"}],56:[{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",icon:Pm,name:"Wrapped Binance Chain Token",symbol:"WBNB"},{address:"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",icon:Rm,name:"Binance USD",symbol:"BUSD"}],97:[{address:"0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd",icon:Pm,name:"Wrapped Binance Chain Testnet Token",symbol:"WBNB"},{address:"0xed24fc36d5ee211ea25a80239fb8c4cfd80f12ee",icon:Rm,name:"Binance USD",symbol:"BUSD"}],137:[{address:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",icon:Zn,name:"USD Coin",symbol:"USDC"},{address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",icon:wd,name:"Wrapped Matic",symbol:"WMATIC"},{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",icon:fr,name:"Wrapped Ether",symbol:"WETH"},{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",icon:Dc,name:"Tether USD",symbol:"USDT"},{address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",icon:Nc,name:"Wrapped BTC",symbol:"WBTC"}],250:[{address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",icon:Um,name:"Wrapped Fantom",symbol:"WFTM"},{address:"0x74b23882a30290451A17c44f4F05243b6b58C76d",icon:fr,name:"Wrapped Ether",symbol:"WETH"},{address:"0x04068DA6C83AFCFA0e13ba15A6696662335D5B75",icon:Zn,name:"USD Coin",symbol:"USDC"},{address:"0x321162Cd933E2Be498Cd2267a90534A804051b11",icon:Nc,name:"Wrapped Bitcoin",symbol:"WBTC"}],420:[{address:"0x4200000000000000000000000000000000000006",icon:fr,name:"Wrapped Ether",symbol:"WETH"}],4002:[{address:"0xf1277d1Ed8AD466beddF92ef448A132661956621",icon:Um,name:"Wrapped Fantom",symbol:"WFTM"}],8453:[{address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",icon:Zn,name:"USD Coin",symbol:"USDC"}],42161:[{address:"0x82af49447d8a07e3bd95bd0d56f35241523fbab1",icon:fr,name:"Wrapped Ether",symbol:"WETH"},{address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",icon:Zn,name:"USD Coin",symbol:"USDC"}],43113:[{address:"0xd00ae08403B9bbb9124bB305C09058E32C39A48c",icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUwMyIgaGVpZ2h0PSIxNTA0IiB2aWV3Qm94PSIwIDAgMTUwMyAxNTA0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cmVjdCB4PSIyODciIHk9IjI1OCIgd2lkdGg9IjkyOCIgaGVpZ2h0PSI4NDQiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTUwMi41IDc1MkMxNTAyLjUgMTE2Ni43NyAxMTY2LjI3IDE1MDMgNzUxLjUgMTUwM0MzMzYuNzM0IDE1MDMgMC41IDExNjYuNzcgMC41IDc1MkMwLjUgMzM3LjIzNCAzMzYuNzM0IDEgNzUxLjUgMUMxMTY2LjI3IDEgMTUwMi41IDMzNy4yMzQgMTUwMi41IDc1MlpNNTM4LjY4OCAxMDUwLjg2SDM5Mi45NEMzNjIuMzE0IDEwNTAuODYgMzQ3LjE4NiAxMDUwLjg2IDMzNy45NjIgMTA0NC45NkMzMjcuOTk5IDEwMzguNSAzMjEuOTExIDEwMjcuOCAzMjEuMTczIDEwMTUuOTlDMzIwLjYxOSAxMDA1LjExIDMyOC4xODQgOTkxLjgyMiAzNDMuMzEyIDk2NS4yNTVMNzAzLjE4MiAzMzAuOTM1QzcxOC40OTUgMzAzLjk5OSA3MjYuMjQzIDI5MC41MzEgNzM2LjAyMSAyODUuNTVDNzQ2LjUzNyAyODAuMiA3NTkuMDgzIDI4MC4yIDc2OS41OTkgMjg1LjU1Qzc3OS4zNzcgMjkwLjUzMSA3ODcuMTI2IDMwMy45OTkgODAyLjQzOCAzMzAuOTM1TDg3Ni40MiA0NjAuMDc5TDg3Ni43OTcgNDYwLjczOEM4OTMuMzM2IDQ4OS42MzUgOTAxLjcyMyA1MDQuMjg5IDkwNS4zODUgNTE5LjY2OUM5MDkuNDQzIDUzNi40NTggOTA5LjQ0MyA1NTQuMTY5IDkwNS4zODUgNTcwLjk1OEM5MDEuNjk1IDU4Ni40NTUgODkzLjM5MyA2MDEuMjE1IDg3Ni42MDQgNjMwLjU0OUw2ODcuNTczIDk2NC43MDJMNjg3LjA4NCA5NjUuNTU4QzY3MC40MzYgOTk0LjY5MyA2NjEuOTk5IDEwMDkuNDYgNjUwLjMwNiAxMDIwLjZDNjM3LjU3NiAxMDMyLjc4IDYyMi4yNjMgMTA0MS42MyA2MDUuNDc0IDEwNDYuNjJDNTkwLjE2MSAxMDUwLjg2IDU3My4wMDQgMTA1MC44NiA1MzguNjg4IDEwNTAuODZaTTkwNi43NSAxMDUwLjg2SDExMTUuNTlDMTE0Ni40IDEwNTAuODYgMTE2MS45IDEwNTAuODYgMTE3MS4xMyAxMDQ0Ljc4QzExODEuMDkgMTAzOC4zMiAxMTg3LjM2IDEwMjcuNDMgMTE4Ny45MiAxMDE1LjYzQzExODguNDUgMTAwNS4xIDExODEuMDUgOTkyLjMzIDExNjYuNTUgOTY3LjMwN0MxMTY2LjA1IDk2Ni40NTUgMTE2NS41NSA5NjUuNTg4IDExNjUuMDQgOTY0LjcwNkwxMDYwLjQzIDc4NS43NUwxMDU5LjI0IDc4My43MzVDMTA0NC41NCA3NTguODc3IDEwMzcuMTIgNzQ2LjMyNCAxMDI3LjU5IDc0MS40NzJDMTAxNy4wOCA3MzYuMTIxIDEwMDQuNzEgNzM2LjEyMSA5OTQuMTk5IDc0MS40NzJDOTg0LjYwNSA3NDYuNDUzIDk3Ni44NTcgNzU5LjU1MiA5NjEuNTQ0IDc4NS45MzRMODU3LjMwNiA5NjQuODkxTDg1Ni45NDkgOTY1LjUwN0M4NDEuNjkgOTkxLjg0NyA4MzQuMDY0IDEwMDUuMDEgODM0LjYxNCAxMDE1LjgxQzgzNS4zNTIgMTAyNy42MiA4NDEuNDQgMTAzOC41IDg1MS40MDIgMTA0NC45NkM4NjAuNDQzIDEwNTAuODYgODc1Ljk0IDEwNTAuODYgOTA2Ljc1IDEwNTAuODZaIiBmaWxsPSIjRTg0MTQyIi8+Cjwvc3ZnPgo=",name:"Wrapped AVAX",symbol:"WAVAX"},{address:"0x5425890298aed601595a70AB815c96711a31Bc65",icon:Zn,name:"USD Coin",symbol:"USDC"}],43114:[{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUwMyIgaGVpZ2h0PSIxNTA0IiB2aWV3Qm94PSIwIDAgMTUwMyAxNTA0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cmVjdCB4PSIyODciIHk9IjI1OCIgd2lkdGg9IjkyOCIgaGVpZ2h0PSI4NDQiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTUwMi41IDc1MkMxNTAyLjUgMTE2Ni43NyAxMTY2LjI3IDE1MDMgNzUxLjUgMTUwM0MzMzYuNzM0IDE1MDMgMC41IDExNjYuNzcgMC41IDc1MkMwLjUgMzM3LjIzNCAzMzYuNzM0IDEgNzUxLjUgMUMxMTY2LjI3IDEgMTUwMi41IDMzNy4yMzQgMTUwMi41IDc1MlpNNTM4LjY4OCAxMDUwLjg2SDM5Mi45NEMzNjIuMzE0IDEwNTAuODYgMzQ3LjE4NiAxMDUwLjg2IDMzNy45NjIgMTA0NC45NkMzMjcuOTk5IDEwMzguNSAzMjEuOTExIDEwMjcuOCAzMjEuMTczIDEwMTUuOTlDMzIwLjYxOSAxMDA1LjExIDMyOC4xODQgOTkxLjgyMiAzNDMuMzEyIDk2NS4yNTVMNzAzLjE4MiAzMzAuOTM1QzcxO
2C40OTUgMzAzLjk5OSA3MjYuMjQzIDI5MC41MzEgNzM2LjAyMSAyODUuNTVDNzQ2LjUzNyAyODAuMiA3NTkuMDgzIDI4MC4yIDc2OS41OTkgMjg1LjU1Qzc3OS4zNzcgMjkwLjUzMSA3ODcuMTI2IDMwMy45OTkgODAyLjQzOCAzMzAuOTM1TDg3Ni40MiA0NjAuMDc5TDg3Ni43OTcgNDYwLjczOEM4OTMuMzM2IDQ4OS42MzUgOTAxLjcyMyA1MDQuMjg5IDkwNS4zODUgNTE5LjY2OUM5MDkuNDQzIDUzNi40NTggOTA5LjQ0MyA1NTQuMTY5IDkwNS4zODUgNTcwLjk1OEM5MDEuNjk1IDU4Ni40NTUgODkzLjM5MyA2MDEuMjE1IDg3Ni42MDQgNjMwLjU0OUw2ODcuNTczIDk2NC43MDJMNjg3LjA4NCA5NjUuNTU4QzY3MC40MzYgOTk0LjY5MyA2NjEuOTk5IDEwMDkuNDYgNjUwLjMwNiAxMDIwLjZDNjM3LjU3NiAxMDMyLjc4IDYyMi4yNjMgMTA0MS42MyA2MDUuNDc0IDEwNDYuNjJDNTkwLjE2MSAxMDUwLjg2IDU3My4wMDQgMTA1MC44NiA1MzguNjg4IDEwNTAuODZaTTkwNi43NSAxMDUwLjg2SDExMTUuNTlDMTE0Ni40IDEwNTAuODYgMTE2MS45IDEwNTAuODYgMTE3MS4xMyAxMDQ0Ljc4QzExODEuMDkgMTAzOC4zMiAxMTg3LjM2IDEwMjcuNDMgMTE4Ny45MiAxMDE1LjYzQzExODguNDUgMTAwNS4xIDExODEuMDUgOTkyLjMzIDExNjYuNTUgOTY3LjMwN0MxMTY2LjA1IDk2Ni40NTUgMTE2NS41NSA5NjUuNTg4IDExNjUuMDQgOTY0LjcwNkwxMDYwLjQzIDc4NS43NUwxMDU5LjI0IDc4My43MzVDMTA0NC41NCA3NTguODc3IDEwMzcuMTIgNzQ2LjMyNCAxMDI3LjU5IDc0MS40NzJDMTAxNy4wOCA3MzYuMTIxIDEwMDQuNzEgNzM2LjEyMSA5OTQuMTk5IDc0MS40NzJDOTg0LjYwNSA3NDYuNDUzIDk3Ni44NTcgNzU5LjU1MiA5NjEuNTQ0IDc4NS45MzRMODU3LjMwNiA5NjQuODkxTDg1Ni45NDkgOTY1LjUwN0M4NDEuNjkgOTkxLjg0NyA4MzQuMDY0IDEwMDUuMDEgODM0LjYxNCAxMDE1LjgxQzgzNS4zNTIgMTAyNy42MiA4NDEuNDQgMTAzOC41IDg1MS40MDIgMTA0NC45NkM4NjAuNDQzIDEwNTAuODYgODc1Ljk0IDEwNTAuODYgOTA2Ljc1IDEwNTAuODZaIiBmaWxsPSIjRTg0MTQyIi8+Cjwvc3ZnPgo=",name:"Wrapped AVAX",symbol:"WAVAX"},{address:"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",icon:fr,name:"Wrapped Ether",symbol:"WETH"},{address:"0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7",icon:Dc,name:"Tether USD",symbol:"USDT"},{address:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",icon:Zn,name:"USD Coin",symbol:"USDC"},{address:"0x50b7545627a5162F82A992c33b87aDc75187B218",icon:Nc,name:"Wrapped BTC",symbol:"WBTC"}],80001:[{address:"0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889",icon:wd,name:"Wrapped Matic",symbol:"WMATIC"},{address:"0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa",icon:fr,name:"Wrapped Ether",symbol:"WETH"},{address:"0x0FA8781a83E46826621b3BC094Ea2A0212e71B23",icon:Zn,name:"USD Coin",symbol:"USDC"},{address:"0x3813e82e6f7098b9583FC0F33a962D02018B6803",icon:Dc,name:"Tether USD",symbol:"USDT"}],84532:[{address:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",icon:Zn,name:"USD Coin",symbol:"USDC"}],421614:[{address:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",icon:Zn,name:"USD Coin",symbol:"USDC"}],11155111:[{address:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",icon:Zn,name:"USD Coin",symbol:"USDC"}]},Pa=S9,zo=Lt({blockExplorers:[{name:"Etherscan",url:"https://etherscan.io"}],id:1,name:"Ethereum",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"}});function D9(e,t){switch(t.type){case"ERC721":return{chainId:t.chainId,id:t.tokenId,metadata:e,owner:(t==null?void 0:t.owner)??null,tokenAddress:t.tokenAddress,tokenURI:t.tokenUri,type:t.type};case"ERC1155":return{chainId:t.chainId,id:t.tokenId,metadata:e,owner:(t==null?void 0:t.owner)??null,supply:t.supply,tokenAddress:t.tokenAddress,tokenURI:t.tokenUri,type:t.type};default:throw new Error("Invalid NFT type")}}async function jp(e){let t=e.uri;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n="",i="",r=""]=t.split("/"),[s,o]=n.split(":"),[c,l]=i.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Error(`Invalid EIP namespace, expected EIP155, got: "${s}"`);if(!o)throw new Error("Chain ID not found");if(!l||!Zr(l))throw new Error("Contract address not found");if(!r)throw new Error("Token ID not found");const u=Ge(Number(o)),d=zt({address:l,chain:u,client:e.client});switch(c){case"erc721":{const{getNFT:f}=await h(async()=>{const{getNFT:y}=await import("./getNFT-D2WO1T-r.js");return{getNFT:y}},__vite__mapDeps([16,7,4,3,6,8,9,17,2,5,1,10,11,12,13,14,15]));return(await f({contract:d,tokenId:BigInt(r)})).metadata.image??null}case"erc1155":{const{getNFT:f}=await h(async()=>{const{getNFT:y}=await import("./getNFT-C0K-mRVB.js");return{getNFT:y}},__vite__mapDeps([18,17,7,4,3,6,8,9,2,5,19,1,12,10,11,13,14,15]));return(await f({contract:d,tokenId:BigInt(r)})).metadata.image??null}default:throw new Error(`Invalid ERC namespace, expected ERC721 or ERC1155, got: "${c}"`)}}const N9=Object.freeze(Object.defineProperty({__proto__:null,parseNFT:D9,parseNftUri:jp},Symbol.toStringTag,{value:"Module"}));async function Sp(e){let t=e.uri;
2if(/eip155:/i.test(e.uri)&&(t=await jp(e)),!t)return null;const n=qr({client:e.client,uri:t});return await A9({client:e.client,uri:n})?n:null}async function A9(e){try{const t=await hn(e.client)(e.uri,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return!!(n!=null&&n.startsWith("image/"))}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const i=new Image;i.onload=()=>{n(!0)},i.onerror=()=>{n(!1)},i.src=e.uri})}}function O9(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return df(t)?t:null}function Dp(e){let t=new Uint8Array(32).fill(0);if(!e)return Eh(t);const n=e.split(".");for(let i=n.length-1;i>=0;i-=1){const r=n[i],s=O9(r),o=s?I6(s):vm(Ea(r),"bytes");t=vm(W4([t,o]),"bytes")}return Eh(t)}function k9(e){return`[${e.slice(2)}]`}function Np(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(Ea(t).byteLength+2);let i=0;const r=t.split(".");for(let s=0;s<r.length;s++){const o=r[s];let c=Ea(o);c.byteLength>255&&(c=Ea(k9(a8(o)))),n[i]=c.length,n.set(c,i+1),i+=c.length+1}return n.byteLength!==i+1?n.slice(0,i+1):n}const z9="0x59d1d43c",P9=[{name:"name",type:"bytes32"},{name:"key",type:"string"}],R9=[{type:"string"}];function U9(e){return Y4(P9,[e.name,e.key])}function B9(e){return z9+U9(e).slice(2)}function V9(e){return R6(R9,e)[0]}const $9="0x9061b923",W9=[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],F9=[{type:"bytes"},{type:"address"}];async function Ap(e){return ac({contract:e.contract,method:[$9,W9,F9],params:[e.name,e.data]})}const Vf="0xeeeeeeee14d718c2b47d9923deab1335e144eeee";async function Y9(e){const{client:t,name:n,key:i,resolverAddress:r,resolverChain:s}=e;return Ui(async()=>{const o=zt({address:r||Vf,chain:s||zo,client:t}),c=B9({key:i,name:Dp(n)}),l=await Ap({contract:o,data:c,name:R4(Np(n))});if(l[0]==="0x")return null;const u=V9(l[0]);return u===""?null:u},{cacheKey:`ens:text:${n}:${i}`,cacheTime:60*1e3})}async function H9(e){const{client:t,name:n,resolverAddress:i,resolverChain:r}=e;return Ui(async()=>{const s=await Y9({client:t,key:"avatar",name:n,resolverAddress:i,resolverChain:r});if(!s)return null;try{return Sp({client:t,uri:s})}catch(o){return console.error("Error parsing avatar record",o),null}},{cacheKey:`ens:avatar:${n}`,cacheTime:60*1e3})}const Q9="0x5d78a217",Z9=[{name:"reverseName",type:"bytes"},{name:"coinType",type:"uint256"}],q9=[{type:"string"},{type:"address"},{type:"address"}];async function G9(e){return ac({contract:e.contract,method:[Q9,Z9,q9],params:[e.reverseName,e.coinType]})}async function $f(e){const{client:t,address:n,resolverAddress:i,resolverChain:r}=e;return Ui(async()=>{const s=zt({address:i||Vf,chain:r||zo,client:t}),[o]=await G9({contract:s,reverseName:n,coinType:60n}).catch(c=>{if(typeof c=="object"&&c!==null&&"data"in c&&typeof c.data=="str
2ing"&&c.data.startsWith("0xef9c03ce"))throw c;return[null]});return o||null},{cacheKey:`ens:name:${(r==null?void 0:r.id)||1}:${n}`,cacheTime:60*1e3})}async function lc(e,t){if(Xe(e)){const{getEcosystemWalletInfo:n}=await h(async()=>{const{getEcosystemWalletInfo:i}=await import("./get-ecosystem-wallet-info-VIv-Ovo7.js");return{getEcosystemWalletInfo:i}},__vite__mapDeps([20,3,7,4,6,8,9,10,5,2,1,11,12,13,14,15]));return t?n(e).then(i=>i.image_id):n(e)}switch(e){case"smart":return t?h(()=>import("./image-BnYtBA0B.js"),[]).then(n=>n.default):h(()=>import("./index-BuSavAVK.js"),[]).then(n=>n.wallet);case"inApp":return t?h(()=>import("./image-YhquT9-B.js"),[]).then(n=>n.default):h(()=>import("./index-B6yqoFuC.js"),[]).then(n=>n.wallet);case"walletConnect":return t?h(()=>import("./image-B3sWXgWp.js"),[]).then(n=>n.default):h(()=>import("./index-B21BIk0D.js"),[]).then(n=>n.wallet);case"embedded":return t?h(()=>import("./image-CE6B5igp.js"),[]).then(n=>n.default):h(()=>import("./index-CZfaBXw3.js"),[]).then(n=>n.wallet);case"adapter":return t?h(()=>import("./image-CaoCxndE.js"),[]).then(n=>n.default):h(()=>import("./index-DkPRLpmE.js"),[]).then(n=>n.wallet);case"io.1inch.wallet":return t?h(()=>import("./image-DcM8byf5.js"),[]).then(n=>n.default):h(()=>import("./index-B8SH8PS4.js"),[]).then(n=>n.wallet);case"com.binance.wallet":return t?h(()=>import("./image-B6woX8-F.js"),[]).then(n=>n.default):h(()=>import("./index-D1Wt1Kx7.js"),[]).then(n=>n.wallet);case"com.ledger":return t?h(()=>import("./image-CGobRsqC.js"),[]).then(n=>n.default):h(()=>import("./index-C63hJ0G0.js"),[]).then(n=>n.wallet);case"com.bitpay":return t?h(()=>import("./image-oGFA7lCe.js"),[]).then(n=>n.default):h(()=>import("./index-Bl6ScMn3.js"),[]).then(n=>n.wallet);case"com.bestwallet":return t?h(()=>import("./image-YzdSnFCd.js"),[]).then(n=>n.default):h(()=>import("./index-C_fnrq8t.js"),[]).then(n=>n.wallet);case"io.metamask":return t?h(()=>import("./image-rAE1A9js.js"),[]).then(n=>n.default):h(()=>import("./index-DaZnaClT.js"),[]).then(n=>n.wallet);case"com.trustwallet.app":return t?h(()=>import("./image-DhOOZChF.js"),[]).then(n=>n.default):h(()=>import("./index-9552Tb-C.js"),[]).then(n=>n.wallet);case"com.fireblocks":return t?h(()=>import("./image-C_rXI8lY.js"),[]).then(n=>n.default):h(()=>import("./index-fm1oF4Rd.js"),[]).then(n=>n.wallet);case"com.bitget.web3":return t?h(()=>import("./image-Cyu_SKNX.js"),[]).then(n=>n.default):h(()=>import("./index-7Xw6Dozy.js"),[]).then(n=>n.wallet);case"pro.tokenpocket":return t?h(()=>import("./image--EMjkbyZ.js"),[]).then(n=>n.default):h(()=>import("./index-C6d9DLRH.js"),[]).then(n=>n.wallet);case"com.safepal":return t?h(()=>import("./image-CPrfOTN2.js"),[]).then(n=>n.default):h(()=>import("./index-BKoDPf_i.js"),[]).then(n=>n.wallet);case"org.uniswap":return t?h(()=>import("./image-DzLDqqsm.js"),[]).then(n=>n.default):h(()=>import("./index-j8mIFeCA.js"),[]).then(n=>n.wallet);case"io.zerion.wallet":return t?h(()=>import("./image-CXpsLPxr.js"),[]).then(n=>n.default):h(()=>import("./index-CAYpPiIA.js"),[]).then(n=>n.wallet);case"com.elrond.maiar.wallet":return t?h(()=>import("./image-Zh059TUR.js"),[]).then(n=>n.default):h(()=>import("./index-CN99OAiz.js"),[]).then(n=>n.wallet);case"com.crypto.wallet":return t?h(()=>import("./image-BbeMBRJP.js"),[]).then(n=>n.default):h(()=>import("./index-DoeeKGAI.js"),[]).then(n=>n.wallet);case"com.bitcoin":return t?h(()=>import("./image-CIhcwJo_.js"),[]).then(n=>n.default):h(()=>import("./index-COFjg0BY.js"),[]).then(n=>n.wallet);case"com.bifrostwallet":return t?h(()=>import("./image-BJbq9ykO.js"),[]).then(n=>n.default):h(()=>import("./index-Cw9NGSPc.js"),[]).then(n=>n.wallet);case"jp.co.rakuten-wallet":return t?h(()=>import("./image-CkSdZpFq.js"),[]).then(n=>n.default):h(()=>import("./index-CU6dgzkA.js"),[]).then(n=>n.wallet);case"com.bybit":return t?h(()=>import("./image-CVPmP4Bl.js"),[]).then(n=>n.default):h(()=>import("./index-m0YDsCpu.js"),[]).then(n=>n.wallet);case"com.blockchain.login":return t?h(()=>import("./image-BvEJhPGs.js"),[]).then(n=>n.default):h(()=>import("./index-C8VMxu1Z.js"),[]).then(n=>n.wallet);case"io.trezor":return t?h(()=>import("./image-BQXnGJhx.js"),[]).then(n=>n.default):h(()=>import("./index-CDqfDzT6.js"),[]).then(n=>n.wallet);case"im.token":return t?h(()=>import("./image-ChDeiuh7.js"),[]).then(n=>n.default):h(()=>import("./index-iJWzlNVI.js"),[]).then(n=>n.wallet);case"global.safe":return t?h(()=>import("./image-B6ncW7rJ.js"),[]).then(n=>n.default):h(()=>import("./index-HPp1Id1p.js"),[]).then(n=>n.wallet);case"xyz.ctrl":return t?h(()=>
2import("./image-DsOpF0U0.js"),[]).then(n=>n.default):h(()=>import("./index-CW6lKp1A.js"),[]).then(n=>n.wallet);case"co.arculus":return t?h(()=>import("./image-CYFfk7g3.js"),[]).then(n=>n.default):h(()=>import("./index-s6ugJH3L.js"),[]).then(n=>n.wallet);case"com.roninchain.wallet":return t?h(()=>import("./image-BMgLTkFN.js"),[]).then(n=>n.default):h(()=>import("./index-caEr82M6.js"),[]).then(n=>n.wallet);case"com.okex.wallet":return t?h(()=>import("./image-Ck2fht2U.js"),[]).then(n=>n.default):h(()=>import("./index-CbEIEIEo.js"),[]).then(n=>n.wallet);case"com.wemixplay":return t?h(()=>import("./image-Dfhapk7_.js"),[]).then(n=>n.default):h(()=>import("./index-C8AQSvJD.js"),[]).then(n=>n.wallet);case"com.tangem":return t?h(()=>import("./image-xMsS8TDb.js"),[]).then(n=>n.default):h(()=>import("./index-CKXDw-uc.js"),[]).then(n=>n.wallet);case"com.exodus":return t?h(()=>import("./image-BULUy74S.js"),[]).then(n=>n.default):h(()=>import("./index-DszThTMl.js"),[]).then(n=>n.wallet);case"com.hashpack.wallet":return t?h(()=>import("./image-BFzDP99B.js"),[]).then(n=>n.default):h(()=>import("./index-wBbkQCZY.js"),[]).then(n=>n.wallet);case"id.co.pintu":return t?h(()=>import("./image-CsH_NRy-.js"),[]).then(n=>n.default):h(()=>import("./index-DHDm_YtM.js"),[]).then(n=>n.wallet);case"network.blackfort":return t?h(()=>import("./image-CTLwieHz.js"),[]).then(n=>n.default):h(()=>import("./index-DZRVQyzq.js"),[]).then(n=>n.wallet);case"com.wigwam.wallet":return t?h(()=>import("./image-xaEWk6k8.js"),[]).then(n=>n.default):h(()=>import("./index-BA0Hn6eE.js"),[]).then(n=>n.wallet);case"app.backpack":return t?h(()=>import("./image-YbQrvLSP.js"),[]).then(n=>n.default):h(()=>import("./index-B8BWAl26.js"),[]).then(n=>n.wallet);case"app.subwallet":return t?h(()=>import("./image-BdqmMP8T.js"),[]).then(n=>n.default):h(()=>import("./index-7C_yDnI4.js"),[]).then(n=>n.wallet);case"cc.avacus":return t?h(()=>import("./image-uGs9mRWl.js"),[]).then(n=>n.default):h(()=>import("./index-BFZxo6Jc.js"),[]).then(n=>n.wallet);case"me.rainbow":return t?h(()=>import("./image-DSGxNIm1.js"),[]).then(n=>n.default):h(()=>import("./index-3d3uK5Ax.js"),[]).then(n=>n.wallet);case"so.onekey.app.wallet":return t?h(()=>import("./image-CwaGmiHI.js"),[]).then(n=>n.default):h(()=>import("./index-CUEmD5dS.js"),[]).then(n=>n.wallet);case"me.haha":return t?h(()=>import("./image-Npe5Xkhl.js"),[]).then(n=>n.default):h(()=>import("./index-B7GQyWAF.js"),[]).then(n=>n.wallet);case"com.bee":return t?h(()=>import("./image-Sy6X7CtO.js"),[]).then(n=>n.default):h(()=>import("./index-CQ3aQg5G.js"),[]).then(n=>n.wallet);case"ag.jup":return t?h(()=>import("./image-BuqgjEJD.js"),[]).then(n=>n.default):h(()=>import("./index-D30RfPa1.js"),[]).then(n=>n.wallet);case"app.keplr":return t?h(()=>import("./image-DpeCw-px.js"),[]).then(n=>n.default):h(()=>import("./index-BnsE1W-S.js"),[]).then(n=>n.wallet);case"org.hot-labs":return t?h(()=>import("./image-DFf3lDA_.js"),[]).then(n=>n.default):h(()=>import("./index-DDwu-IMz.js"),[]).then(n=>n.wallet);case"com.dcentwallet":return t?h(()=>import("./image-CUPOo6zK.js"),[]).then(n=>n.default):h(()=>import("./index-Bm92iZMY.js"),[]).then(n=>n.wallet);case"com.kraken":return t?h(()=>import("./image-BP17CoHz.js"),[]).then(n=>n.default):h(()=>import("./index-BFGXqrJS.js"),[]).then(n=>n.wallet);case"com.kucoin":return t?h(()=>import("./image-JIl7mHMQ.js"),[]).then(n=>n.default):h(()=>import("./index-DRVDpxj6.js"),[]).then(n=>n.wallet);case"io.magiceden.wallet":return t?h(()=>import("./image-B7QIFAir.js"),[]).then(n=>n.default):h(()=>import("./index-DMTU8hfu.js"),[]).then(n=>n.wallet);case"com.tomi":return t?h(()=>import("./image-COwCE3RO.js"),[]).then(n=>n.default):h(()=>import("./index-C7njqxXR.js"),[]).then(n=>n.wallet);case"io.ibvm":return t?h(()=>import("./image-CVBI4BwD.js"),[]).then(n=>n.default):h(()=>import("./index-HzSvsrak.js"),[]).then(n=>n.wallet);case"com.mewwallet":return t?h(()=>import("./image-Dx4ya6_y.js"),[]).then(n=>n.default):h(()=>import("./index-DEzKWTBJ.js"),[]).then(n=>n.wallet);case"com.socios.app":return t?h(()=>import("./image-COKP1J8V.js"),[]).then(n=>n.default):h(()=>import("./index-D06ftJGd.js"),[]).then(n=>n.wallet);case"xyz.argent":return t?h(()=>import("./image-5mReG_-1.js"),[]).then(n=>n.default):h(()=>import("./index-CQPZVLgk.js"),[]).then(n=>n.wallet);case"org.thorwallet":return t?h(()=>
2import("./image-Dmp2jTO0.js"),[]).then(n=>n.default):h(()=>import("./index-NO3dCFlG.js"),[]).then(n=>n.wallet);case"io.internetmoney":return t?h(()=>import("./image-D4PYvYqY.js"),[]).then(n=>n.default):h(()=>import("./index-BZwq4W5O.js"),[]).then(n=>n.wallet);case"org.mathwallet":return t?h(()=>import("./image-mMy4SSmg.js"),[]).then(n=>n.default):h(()=>import("./index-lGNYNhMi.js"),[]).then(n=>n.wallet);case"io.cypherhq":return t?h(()=>import("./image-B14TCFf5.js"),[]).then(n=>n.default):h(()=>import("./index-yURkkC3L.js"),[]).then(n=>n.wallet);case"io.novawallet":return t?h(()=>import("./image-DDso8kuB.js"),[]).then(n=>n.default):h(()=>import("./index-C91aPf2g.js"),[]).then(n=>n.wallet);case"io.yowallet":return t?h(()=>import("./image-Bx8buncY.js"),[]).then(n=>n.default):h(()=>import("./index-B062fuzr.js"),[]).then(n=>n.wallet);case"com.flowfoundation.wallet":return t?h(()=>import("./image-Da2xkAVi.js"),[]).then(n=>n.default):h(()=>import("./index-CBVJzm96.js"),[]).then(n=>n.wallet);case"app.kabila":return t?h(()=>import("./image-B-l20wIO.js"),[]).then(n=>n.default):h(()=>import("./index-cTRIo3rN.js"),[]).then(n=>n.wallet);case"com.opera":return t?h(()=>import("./image-sDrIF89f.js"),[]).then(n=>n.default):h(()=>import("./index-lIOVfT2m.js"),[]).then(n=>n.wallet);case"com.valoraapp":return t?h(()=>import("./image-5QXPaavh.js"),[]).then(n=>n.default):h(()=>import("./index-C6baQHax.js"),[]).then(n=>n.wallet);case"com.robinhood.wallet":return t?h(()=>import("./image-DBehogZh.js"),[]).then(n=>n.default):h(()=>import("./index-bzH6W7xo.js"),[]).then(n=>n.wallet);case"com.chain":return t?h(()=>import("./image-qsAyF5Oj.js"),[]).then(n=>n.default):h(()=>import("./index-npRlG_V2.js"),[]).then(n=>n.wallet);case"io.huddln":return t?h(()=>import("./image-CQm90J-d.js"),[]).then(n=>n.default):h(()=>import("./index-DILut-jL.js"),[]).then(n=>n.wallet);case"app.core.extension":return t?h(()=>import("./image-De2xpum1.js"),[]).then(n=>n.default):h(()=>import("./index-BtfbjCVr.js"),[]).then(n=>n.wallet);case"world.freedom":return t?h(()=>import("./image-COnY36UD.js"),[]).then(n=>n.default):h(()=>import("./index-BZUSQkq9.js"),[]).then(n=>n.wallet);case"money.unstoppable":return t?h(()=>import("./image-Bvw8wNRu.js"),[]).then(n=>n.default):h(()=>import("./index-CW8D5Pv5.js"),[]).then(n=>n.wallet);case"pk.modular":return t?h(()=>import("./image-CaHdVXd1.js"),[]).then(n=>n.default):h(()=>import("./index-1CA6ps09.js"),[]).then(n=>n.wallet);case"app.wombat":return t?h(()=>import("./image-ExeF69qZ.js"),[]).then(n=>n.default):h(()=>import("./index-D9Jrno_D.js"),[]).then(n=>n.wallet);case"com.klipwallet":return t?h(()=>import("./image-8vXf4Xjy.js"),[]).then(n=>n.default):h(()=>import("./index-CcNQ53IV.js"),[]).then(n=>n.wallet);case"com.gemwallet":return t?h(()=>import("./image-M7TV7WaH.js"),[]).then(n=>n.default):h(()=>import("./index-BtZsXMJj.js"),[]).then(n=>n.wallet);case"com.sabay.wallet":return t?h(()=>import("./image-CsNgSbbt.js"),[]).then(n=>n.default):h(()=>import("./index-BVAmxcaa.js"),[]).then(n=>n.wallet);case"com.zengo":return t?h(()=>import("./image-DNtaIeSw.js"),[]).then(n=>n.default):h(()=>import("./index-DDk7D3eE.js"),[]).then(n=>n.wallet);case"xyz.joeywallet":return t?h(()=>import("./image-CTsHGgDx.js"),[]).then(n=>n.default):h(()=>import("./index-Im6F3t68.js"),[]).then(n=>n.wallet);case"io.tokoin":return t?h(()=>import("./image-DQzzFCs2.js"),[]).then(n=>n.default):h(()=>import("./index-Bwjy4Jw7.js"),[]).then(n=>n.wallet);case"io.alpha-u.wallet.web":return t?h(()=>import("./image-DLiMUWBI.js"),[]).then(n=>n.default):h(()=>import("./index-DFt1vT8N.js"),[]).then(n=>n.wallet);case"network.cvl":return t?h(()=>import("./image-CtZg2vKX.js"),[]).then(n=>n.default):h(()=>import("./index-D2vPh3Mc.js"),[]).then(n=>n.wallet);case"io.leapwallet":return t?h(()=>import("./image-DHnnMCFG.js"),[]).then(n=>n.default):h(()=>import("./index-BdkJrfxl.js"),[]).then(n=>n.wallet);case"io.xenea":return t?h(()=>import("./image-B5ZxW0VG.js"),[]).then(n=>n.default):h(()=>import("./index-C8mAROh2.js"),[]).then(n=>n.wallet);case"com.oasys-wallet":return t?h(()=>import("./image-W7SfqKZe.js"),[]).then(n=>n.default):h(()=>import("./index-gQ8zpnGO.js"),[]).then(n=>n.wallet);case"com.bitso":return t?h(()=>import("./image-LfonVSeq.js"),[]).then(n=>n.default):h(()=>import("./index-YcqLCtWD.js"),[]).then(n=>n.wallet);case"io.enjin":return t?h(()=>import("./image-BnXzDKuV.js"),[]).then(n=>n.default):h(()=>import("./index-Jmrm9oUu.js"),[]).then(n=>n.wallet);case"com.coldwallet":return t?h(()=>import("./image-CVrpZdwi.js"),[]).then(n=>n.default):h(()=>import("./index-CkqupmC6.js"),[]).then(n=>n.wallet);case"org.creditcoin.app":return t?h(()=>import("./image-CzL8n4ZU.js"),[]).then(n=>n.default):h(()=>import("./index-B94SpzOt.js"),[]).then(n=>n.wallet);case"app.everspace":return t?h(()=>import("./image-ripXpF5P.js"),[]).then(n=>n.default):h(()=>import("./index-COlGaDkw.js"),[]).then(n=>n.wallet);case"app.zeal":return t?h(()=>import("./image-hO8Jv2oh.js"),[]).then(n=>n.default):h(()=>import("./index-B6n-vVE0.js"),[]).then(n=>n.wallet);case"app.whitewallet":return t?h(()=>
2import("./image-D7wXb0Un.js"),[]).then(n=>n.default):h(()=>import("./index-SCBLsVUL.js"),[]).then(n=>n.wallet);case"ai.purewallet":return t?h(()=>import("./image-K1HoU8Qi.js"),[]).then(n=>n.default):h(()=>import("./index-DZ2hd5eC.js"),[]).then(n=>n.wallet);case"com.fastex.wallet":return t?h(()=>import("./image-lBIlUHFP.js"),[]).then(n=>n.default):h(()=>import("./index-CMzQk3O6.js"),[]).then(n=>n.wallet);case"io.kriptomat":return t?h(()=>import("./image-6ouyxZRt.js"),[]).then(n=>n.default):h(()=>import("./index-wk2CJ7i5.js"),[]).then(n=>n.wallet);case"com.ullapay":return t?h(()=>import("./image-Bn2sAgXJ.js"),[]).then(n=>n.default):h(()=>import("./index-D_d6gemZ.js"),[]).then(n=>n.wallet);case"io.atomicwallet":return t?h(()=>import("./image-D55LvXjp.js"),[]).then(n=>n.default):h(()=>import("./index-DEV4egrN.js"),[]).then(n=>n.wallet);case"com.pionewallet":return t?h(()=>import("./image-B_0Cqkss.js"),[]).then(n=>n.default):h(()=>import("./index-BogX5ITG.js"),[]).then(n=>n.wallet);case"io.oxalus":return t?h(()=>import("./image-DTa4RXUa.js"),[]).then(n=>n.default):h(()=>import("./index-CuQBw1y6.js"),[]).then(n=>n.wallet);case"xyz.uniultra.wallet":return t?h(()=>import("./image-BSLjXnNe.js"),[]).then(n=>n.default):h(()=>import("./index-CJYo3Znz.js"),[]).then(n=>n.wallet);case"xyz.frontier.wallet":return t?h(()=>import("./image-Bdtwdp85.js"),[]).then(n=>n.default):h(()=>import("./index--YTVamH2.js"),[]).then(n=>n.wallet);case"com.coolbitx.cwsapp":return t?h(()=>import("./image-DWR067hG.js"),[]).then(n=>n.default):h(()=>import("./index-tkvX3w1X.js"),[]).then(n=>n.wallet);case"org.gooddollar":return t?h(()=>import("./image-y3eCNAT6.js"),[]).then(n=>n.default):h(()=>import("./index-C7N44kNF.js"),[]).then(n=>n.wallet);case"com.cakewallet":return t?h(()=>import("./image-BqQffU2u.js"),[]).then(n=>n.default):h(()=>import("./index-DPCPDLBT.js"),[]).then(n=>n.wallet);case"com.ellipal":return t?h(()=>import("./image-vuuCn07N.js"),[]).then(n=>n.default):h(()=>import("./index-jTpsrMvb.js"),[]).then(n=>n.wallet);case"app.krystal":return t?h(()=>import("./image-C2QANSRr.js"),[]).then(n=>n.default):h(()=>import("./index-B7dAHFam.js"),[]).then(n=>n.wallet);case"com.monarchwallet":return t?h(()=>import("./image-BNA4BP9T.js"),[]).then(n=>n.default):h(()=>import("./index-C7WD5W_Z.js"),[]).then(n=>n.wallet);case"com.burritowallet":return t?h(()=>import("./image-BI-5Z38o.js"),[]).then(n=>n.default):h(()=>import("./index-DpRqa1iX.js"),[]).then(n=>n.wallet);case"co.family.wallet":return t?h(()=>import("./image-CECsJh3H.js"),[]).then(n=>n.default):h(()=>import("./index-DrzmRQ9S.js"),[]).then(n=>n.wallet);case"com.mtpelerin":return t?h(()=>import("./image-BDOqiI6p.js"),[]).then(n=>n.default):h(()=>import("./index-bQArImNA.js"),[]).then(n=>n.wallet);case"app.keyring":return t?h(()=>import("./image-BH6pi8gb.js"),[]).then(n=>n.default):h(()=>import("./index-DLGneTkB.js"),[]).then(n=>n.wallet);case"cc.localtrade.lab":return t?h(()=>import("./image-DRqNpoe6.js"),[]).then(n=>n.default):h(()=>import("./index-D-qw7id5.js"),[]).then(n=>n.wallet);case"tech.okto":return t?h(()=>import("./image-uk4MysVY.js"),[]).then(n=>n.default):h(()=>import("./index-C5ZfEOey.js"),[]).then(n=>n.wallet);case"com.xcapit":return t?h(()=>import("./image-BjFjHCOg.js"),[]).then(n=>n.default):h(()=>import("./index-DbAxetvE.js"),[]).then(n=>n.wallet);case"com.gayawallet":return t?h(()=>import("./image-DC9Wj56E.js"),[]).then(n=>n.default):h(()=>import("./index-D4VnhuTS.js"),[]).then(n=>n.wallet);case"app.nightly":return t?h(()=>import("./image-Bv8VGwx8.js"),[]).then(n=>n.default):h(()=>import("./index-uM5GtqSd.js"),[]).then(n=>n.wallet);case"com.coin98":return t?h(()=>import("./image-Co9P7WAh.js"),[]).then(n=>n.default):h(()=>import("./index-CxBkKx5Q.js"),[]).then(n=>n.wallet);case"xyz.coca":return t?h(()=>import("./image-DaxrbegS.js"),[]).then(n=>n.default):h(()=>import("./index-CAfHv9Ye.js"),[]).then(n=>n.wallet);case"app.linen":return t?h(()=>import("./image-CljvD_on.js"),[]).then(n=>n.default):h(()=>import("./index-DTPO88lj.js"),[]).then(n=>n.wallet);case"dev.auroracloud":return t?h(()=>import("./image-BbwfB3J_.js"),[]).then(n=>n.default):h(()=>import("./index-DqYjD_64.js"),[]).then(n=>n.wallet);case"com.coinomi":return t?h(()=>import("./image-CyezMyAx.js"),[]).then(n=>n.default):h(()=>import("./index-B-oXIR8J.js"),[]).then(n=>n.wallet);case"my.mone":return t?h(()=>import("./image-B7h27Vsd.js"),[]).then(n=>n.default):h(()=>import("./index-3jJtZlGN.js"),[]).then(n=>n.wallet);case"org.alephium":return t?h(()=>
2import("./image-DDUR5y02.js"),[]).then(n=>n.default):h(()=>import("./index-CRTSSeuy.js"),[]).then(n=>n.wallet);case"com.alicebob":return t?h(()=>import("./image-BKjOwOZU.js"),[]).then(n=>n.default):h(()=>import("./index-DYiL0IsZ.js"),[]).then(n=>n.wallet);case"io.koalawallet":return t?h(()=>import("./image-CTAbQz5j.js"),[]).then(n=>n.default):h(()=>import("./index-DPXkoJXK.js"),[]).then(n=>n.wallet);case"com.veworld":return t?h(()=>import("./image-DKBlkqWK.js"),[]).then(n=>n.default):h(()=>import("./index-DV2Q2KhC.js"),[]).then(n=>n.wallet);case"com.withpaper":return t?h(()=>import("./image-DbBiNCFK.js"),[]).then(n=>n.default):h(()=>import("./index-CExunyqd.js"),[]).then(n=>n.wallet);case"io.noone":return t?h(()=>import("./image-CwDXHpUj.js"),[]).then(n=>n.default):h(()=>import("./index-BEFk-36A.js"),[]).then(n=>n.wallet);case"network.haqq":return t?h(()=>import("./image-BaRuJqy0.js"),[]).then(n=>n.default):h(()=>import("./index--t3K2suC.js"),[]).then(n=>n.wallet);case"io.ricewallet":return t?h(()=>import("./image-CmVMIVLM.js"),[]).then(n=>n.default):h(()=>import("./index-C_j7AjFr.js"),[]).then(n=>n.wallet);case"me.iopay":return t?h(()=>import("./image-CMJsc-Ir.js"),[]).then(n=>n.default):h(()=>import("./index-bsKYZmcs.js"),[]).then(n=>n.wallet);case"app.walletnow":return t?h(()=>import("./image-CmkiYZaU.js"),[]).then(n=>n.default):h(()=>import("./index-C_C9JdoE.js"),[]).then(n=>n.wallet);case"io.okse":return t?h(()=>import("./image-CZ9z1ucT.js"),[]).then(n=>n.default):h(()=>import("./index-_a8zNWKv.js"),[]).then(n=>n.wallet);case"network.over":return t?h(()=>import("./image-Cq54pcgl.js"),[]).then(n=>n.default):h(()=>import("./index-BDifUsn3.js"),[]).then(n=>n.wallet);case"com.aktionariat":return t?h(()=>import("./image-Cc6jyxLi.js"),[]).then(n=>n.default):h(()=>import("./index-Pw2thZ4h.js"),[]).then(n=>n.wallet);case"com.paybolt":return t?h(()=>import("./image-cwzgrAkh.js"),[]).then(n=>n.default):h(()=>import("./index-BxqRct_I.js"),[]).then(n=>n.wallet);case"com.plasma-wallet":return t?h(()=>import("./image-BVO9IT_6.js"),[]).then(n=>n.default):h(()=>import("./index-fiGpKN6W.js"),[]).then(n=>n.wallet);case"org.bytebank":return t?h(()=>import("./image-BP2Ox9Qn.js"),[]).then(n=>n.default):h(()=>import("./index-S5s6rAc3.js"),[]).then(n=>n.wallet);case"io.ethermail":return t?h(()=>import("./image-Duck5tqn.js"),[]).then(n=>n.default):h(()=>import("./index-BoCHG1VO.js"),[]).then(n=>n.wallet);case"com.optowallet":return t?h(()=>import("./image-W-Y_Nm-s.js"),[]).then(n=>n.default):h(()=>import("./index-BP-yDgcx.js"),[]).then(n=>n.wallet);case"finance.openwallet":return t?h(()=>import("./image-M_AWRaKs.js"),[]).then(n=>n.default):h(()=>import("./index-Cv59xn6_.js"),[]).then(n=>n.wallet);case"xyz.sequence":return t?h(()=>import("./image-o3pjQDbu.js"),[]).then(n=>n.default):h(()=>import("./index-D7Gl-ZGb.js"),[]).then(n=>n.wallet);case"com.foxwallet":return t?h(()=>import("./image-DcX8AUYd.js"),[]).then(n=>n.default):h(()=>import("./index-BARF52iT.js"),[]).then(n=>n.wallet);case"app.hbwallet":return t?h(()=>import("./image-BlogSp8o.js"),[]).then(n=>n.default):h(()=>import("./index-CW58bOV7.js"),[]).then(n=>n.wallet);case"it.airgap":return t?h(()=>import("./image-5CGX_QL3.js"),[]).then(n=>n.default):h(()=>import("./index-YDG1R00C.js"),[]).then(n=>n.wallet);case"com.holdstation":return t?h(()=>import("./image-BcNLqzB4.js"),[]).then(n=>n.default):h(()=>import("./index-9Ml23qSY.js"),[]).then(n=>n.wallet);case"io.universaleverything":return t?h(()=>import("./image-D3z3GjMO.js"),[]).then(n=>n.default):h(()=>import("./index-qmNRbp6W.js"),[]).then(n=>n.wallet);case"com.abra":return t?h(()=>import("./image-CCgX-pcz.js"),[]).then(n=>n.default):h(()=>import("./index-_36_A-pH.js"),[]).then(n=>n.wallet);case"org.thepulsewallet":return t?h(()=>import("./image-BxfO9qDl.js"),[]).then(n=>n.default):h(()=>import("./index-DgNvhZ_M.js"),[]).then(n=>n.wallet);case"com.premanft":return t?h(()=>import("./image-pKZ5ApxC.js"),[]).then(n=>n.default):h(()=>import("./index-CbGJyo5C.js"),[]).then(n=>n.wallet);case"xyz.timelesswallet":return t?h(()=>
2import("./image-DUs_WIFe.js"),[]).then(n=>n.default):h(()=>import("./index-WXvxLSve.js"),[]).then(n=>n.wallet);case"org.bitizen":return t?h(()=>import("./image-TQ3Nh_VF.js"),[]).then(n=>n.default):h(()=>import("./index-Db_DlPJs.js"),[]).then(n=>n.wallet);case"app.ultimate":return t?h(()=>import("./image-ClyvBbEv.js"),[]).then(n=>n.default):h(()=>import("./index-D2Z8_AUU.js"),[]).then(n=>n.wallet);case"io.compasswallet":return t?h(()=>import("./image-D6x5dtDG.js"),[]).then(n=>n.default):h(()=>import("./index-2qmxPQhP.js"),[]).then(n=>n.wallet);case"app.fizzwallet":return t?h(()=>import("./image-E3PT44xu.js"),[]).then(n=>n.default):h(()=>import("./index-DAYuEFQ-.js"),[]).then(n=>n.wallet);case"com.xovawallet":return t?h(()=>import("./image-B02ECgsY.js"),[]).then(n=>n.default):h(()=>import("./index-Bap5Lkty.js"),[]).then(n=>n.wallet);case"app.nicegram":return t?h(()=>import("./image-DH5ootHk.js"),[]).then(n=>n.default):h(()=>import("./index-BEXV42kp.js"),[]).then(n=>n.wallet);case"io.zelcore":return t?h(()=>import("./image-CLUlwzEU.js"),[]).then(n=>n.default):h(()=>import("./index-BLO6pY9b.js"),[]).then(n=>n.wallet);case"app.freighter":return t?h(()=>import("./image-BanazMP9.js"),[]).then(n=>n.default):h(()=>import("./index-CcdGs50g.js"),[]).then(n=>n.wallet);case"app.stickey":return t?h(()=>import("./image-_t2-K1ZP.js"),[]).then(n=>n.default):h(()=>import("./index-Cu2rQjR7.js"),[]).then(n=>n.wallet);case"app.coinstats":return t?h(()=>import("./image-BlZLdRma.js"),[]).then(n=>n.default):h(()=>import("./index-j8xu_BhO.js"),[]).then(n=>n.wallet);case"io.harti":return t?h(()=>import("./image-Xfz-LkLu.js"),[]).then(n=>n.default):h(()=>import("./index-DPhI9JUn.js"),[]).then(n=>n.wallet);case"io.dttd":return t?h(()=>import("./image-pEGSGt6h.js"),[]).then(n=>n.default):h(()=>import("./index-CXYI0OjH.js"),[]).then(n=>n.wallet);case"com.tellaw":return t?h(()=>import("./image-sm-_D7TO.js"),[]).then(n=>n.default):h(()=>import("./index-Ddqy22qU.js"),[]).then(n=>n.wallet);case"io.klever":return t?h(()=>import("./image-BBFbQZtc.js"),[]).then(n=>n.default):h(()=>import("./index-BJAcAgB9.js"),[]).then(n=>n.wallet);case"com.unstoppabledomains":return t?h(()=>import("./image-EUVXQieb.js"),[]).then(n=>n.default):h(()=>import("./index-B1XrJIPH.js"),[]).then(n=>n.wallet);case"is.callback":return t?h(()=>import("./image-Mf3UQvEC.js"),[]).then(n=>n.default):h(()=>import("./index-DTtDhdi2.js"),[]).then(n=>n.wallet);case"ai.pundi":return t?h(()=>import("./image-9BTuaiXb.js"),[]).then(n=>n.default):h(()=>import("./index-Ca7jbqnT.js"),[]).then(n=>n.wallet);case"io.summonersarena":return t?h(()=>import("./image-3-p5LJAk.js"),[]).then(n=>n.default):h(()=>import("./index-ovz39Egy.js"),[]).then(n=>n.wallet);case"io.fizen":return t?h(()=>import("./image-CZLdphQJ.js"),[]).then(n=>n.default):h(()=>import("./index-WwjGYjHa.js"),[]).then(n=>n.wallet);case"fi.pillar":return t?h(()=>import("./image-CVAbhfmI.js"),[]).then(n=>n.default):h(()=>import("./index-BFJUkm8C.js"),[]).then(n=>n.wallet);case"world.ixo":return t?h(()=>import("./image-CsTNl20e.js"),[]).then(n=>n.default):h(()=>import("./index-C-A1j44m.js"),[]).then(n=>n.wallet);case"org.thetatoken":return t?h(()=>import("./image-BstOz2Sd.js"),[]).then(n=>n.default):h(()=>import("./index-BlU4B6pe.js"),[]).then(n=>n.wallet);case"net.gateweb3":return t?h(()=>import("./image-CypdirPa.js"),[]).then(n=>n.default):h(()=>import("./index-BkM7PWkU.js"),[]).then(n=>n.wallet);case"app.ammer":return t?h(()=>import("./image-BfGkQCHU.js"),[]).then(n=>n.default):h(()=>import("./index-C0HCn7GN.js"),[]).then(n=>n.wallet);case"us.binance":return t?h(()=>import("./image-DgkgLcDL.js"),[]).then(n=>n.default):h(()=>import("./index-BuhGQjsZ.js"),[]).then(n=>n.wallet);case"io.yusetoken":return t?h(()=>import("./image-CSAN5rKt.js"),[]).then(n=>n.default):h(()=>import("./index-DQ8_v09O.js"),[]).then(n=>n.wallet);case"co.muza":return t?h(()=>import("./image-CRsMfPT0.js"),[]).then(n=>n.default):h(()=>import("./index-5IpGHzAv.js"),[]).then(n=>n.wallet);case"io.hyperpay":return t?h(()=>import("./image-D8scG8aP.js"),[]).then(n=>n.default):h(()=>import("./index-BXZiXU-9.js"),[]).then(n=>n.wallet);case"io.cosmostation":return t?h(()=>import("./image-BYUgGshq.js"),[]).then(n=>n.default):h(()=>import("./index-RiIluuCN.js"),[]).then(n=>n.wallet);case"app.ryipay":return t?h(()=>import("./image-oKct0i27.js"),[]).then(n=>n.default):h(()=>import("./index-CdvxolxE.js"),[]).then(n=>n.wallet);case"io.wallet3":return t?h(()=>
2import("./image-DJLc6AlW.js"),[]).then(n=>n.default):h(()=>import("./index-C_5dy4gh.js"),[]).then(n=>n.wallet);case"org.dota168":return t?h(()=>import("./image-D3VAu6BC.js"),[]).then(n=>n.default):h(()=>import("./index-BP76iXI2.js"),[]).then(n=>n.wallet);case"com.bitpie":return t?h(()=>import("./image-BUsH-M52.js"),[]).then(n=>n.default):h(()=>import("./index-BKN05ia6.js"),[]).then(n=>n.wallet);case"com.coininn":return t?h(()=>import("./image-B_AAvjJY.js"),[]).then(n=>n.default):h(()=>import("./index-l2eJJ7mG.js"),[]).then(n=>n.wallet);case"me.easy":return t?h(()=>import("./image-BjKXKIhU.js"),[]).then(n=>n.default):h(()=>import("./index-4WvPsM5O.js"),[]).then(n=>n.wallet);case"io.shido":return t?h(()=>import("./image-BGZ2pFmO.js"),[]).then(n=>n.default):h(()=>import("./index-SaOy8OjI.js"),[]).then(n=>n.wallet);case"com.neonwallet":return t?h(()=>import("./image-D2051qUc.js"),[]).then(n=>n.default):h(()=>import("./index-CUJUgO36.js"),[]).then(n=>n.wallet);case"com.secuxtech":return t?h(()=>import("./image-DHHZDLK-.js"),[]).then(n=>n.default):h(()=>import("./index-D1G_5OyD.js"),[]).then(n=>n.wallet);case"com.unitywallet":return t?h(()=>import("./image-BqmT5urK.js"),[]).then(n=>n.default):h(()=>import("./index-BqxSKkSq.js"),[]).then(n=>n.wallet);case"io.miraiapp":return t?h(()=>import("./image-Bi1elmSL.js"),[]).then(n=>n.default):h(()=>import("./index-D0rQT1_1.js"),[]).then(n=>n.wallet);case"com.beexo":return t?h(()=>import("./image-MGwelZJS.js"),[]).then(n=>n.default):h(()=>import("./index-Bbv-4GNB.js"),[]).then(n=>n.wallet);case"social.halo":return t?h(()=>import("./image-CbnSXqJS.js"),[]).then(n=>n.default):h(()=>import("./index-KpPak-wu.js"),[]).then(n=>n.wallet);case"com.gemspocket":return t?h(()=>import("./image-DpGIEKrK.js"),[]).then(n=>n.default):h(()=>import("./index-RpXAvNRL.js"),[]).then(n=>n.wallet);case"app.status":return t?h(()=>import("./image-9509MPsE.js"),[]).then(n=>n.default):h(()=>import("./index-DLMSD3H_.js"),[]).then(n=>n.wallet);case"com.midoin":return t?h(()=>import("./image-BocNs9ze.js"),[]).then(n=>n.default):h(()=>import("./index-CrBWjlui.js"),[]).then(n=>n.wallet);case"id.competence":return t?h(()=>import("./image-CaqftHzf.js"),[]).then(n=>n.default):h(()=>import("./index-CGMXxK_x.js"),[]).then(n=>n.wallet);case"com.safemoon":return t?h(()=>import("./image-BcfiUDv-.js"),[]).then(n=>n.default):h(()=>import("./index-BgECKCj8.js"),[]).then(n=>n.wallet);case"llc.besc":return t?h(()=>import("./image-DLwHWQ4l.js"),[]).then(n=>n.default):h(()=>import("./index-CbMeskkV.js"),[]).then(n=>n.wallet);case"baby.smart":return t?h(()=>import("./image-VxDqDj0T.js"),[]).then(n=>n.default):h(()=>import("./index-BmKJ1abQ.js"),[]).then(n=>n.wallet);case"app.onto":return t?h(()=>import("./image-BCXqBewH.js"),[]).then(n=>n.default):h(()=>import("./index-BPFXH4g9.js"),[]).then(n=>n.wallet);case"com.ivirse":return t?h(()=>import("./image-8DkN4eFx.js"),[]).then(n=>n.default):h(()=>import("./index-CqWFxNbG.js"),[]).then(n=>n.wallet);case"one.mixin.messenger":return t?h(()=>import("./image-DecSbpNG.js"),[]).then(n=>n.default):h(()=>import("./index-PjYIiHEb.js"),[]).then(n=>n.wallet);case"cash.abpay":return t?h(()=>import("./image-Bb4ZLG-2.js"),[]).then(n=>n.default):h(()=>import("./index-BrvgJVgh.js"),[]).then(n=>n.wallet);case"ch.dssecurity":return t?h(()=>import("./image-ddsU9gPS.js"),[]).then(n=>n.default):h(()=>import("./index-DDdoZFD-.js"),[]).then(n=>n.wallet);case"com.concordium.wallet":return t?h(()=>import("./image-W5rUOVDT.js"),[]).then(n=>n.default):h(()=>import("./index-B5BAsv-B.js"),[]).then(n=>n.wallet);case"io.zkape":return t?h(()=>import("./image-Bm-o9RF3.js"),[]).then(n=>n.default):h(()=>import("./index-yLatYZZK.js"),[]).then(n=>n.wallet);case"com.paliwallet":return t?h(()=>import("./image-DqH_Lyo9.js"),[]).then(n=>n.default):h(()=>import("./index-C93NlSEw.js"),[]).then(n=>n.wallet);case"io.pitaka":return t?h(()=>import("./image-Bo8CHmCG.js"),[]).then(n=>n.default):h(()=>import("./index-DeQey0SH.js"),[]).then(n=>n.wallet);case"com.saitamatoken":return t?h(()=>import("./image-AlOoIjkb.js"),[]).then(n=>n.default):h(()=>import("./index-CNkg8_tm.js"),[]).then(n=>n.wallet);case"org.mugambo":return t?h(()=>import("./image-vXNBwFvw.js"),[]).then(n=>n.default):h(()=>import("./index-CqJjpCD5.js"),[]).then(n=>n.wallet);case"fi.stablez":return t?h(()=>import("./image-CruMo9Ar.js"),[]).then(n=>n.default):h(()=>import("./index-Wz7obrZB.js"),[]).then(n=>n.wallet);case"io.legacynetwork":return t?h(()=>
2import("./image-Dgb3Vdrr.js"),[]).then(n=>n.default):h(()=>import("./index-DLHjxUiX.js"),[]).then(n=>n.wallet);case"com.meld.app":return t?h(()=>import("./image-DrobCWF2.js"),[]).then(n=>n.default):h(()=>import("./index-BqLb859N.js"),[]).then(n=>n.wallet);case"io.bladewallet":return t?h(()=>import("./image-nqueMEws.js"),[]).then(n=>n.default):h(()=>import("./index-C0I75rp3.js"),[]).then(n=>n.wallet);case"com.authentrend":return t?h(()=>import("./image-CmzmxiTz.js"),[]).then(n=>n.default):h(()=>import("./index-0qRtNAQn.js"),[]).then(n=>n.wallet);case"com.webauth":return t?h(()=>import("./image-EyKsXf_1.js"),[]).then(n=>n.default):h(()=>import("./index-BXnDDK-y.js"),[]).then(n=>n.wallet);case"xyz.tucop":return t?h(()=>import("./image-8r04P3UP.js"),[]).then(n=>n.default):h(()=>import("./index-Bbznecif.js"),[]).then(n=>n.wallet);case"pro.fintoken":return t?h(()=>import("./image-BBez6ov1.js"),[]).then(n=>n.default):h(()=>import("./index-CP3DQPwx.js"),[]).then(n=>n.wallet);case"io.nash":return t?h(()=>import("./image--fcqsYch.js"),[]).then(n=>n.default):h(()=>import("./index-Bx9srovK.js"),[]).then(n=>n.wallet);case"vc.uincubator.api":return t?h(()=>import("./image-CyLv-qKv.js"),[]).then(n=>n.default):h(()=>import("./index-B5AZ3O3C.js"),[]).then(n=>n.wallet);case"io.unagi.unawallet":return t?h(()=>import("./image-C6ewnpHo.js"),[]).then(n=>n.default):h(()=>import("./index-CD7cY8HX.js"),[]).then(n=>n.wallet);case"io.nonbank":return t?h(()=>import("./image-TA_PkYBz.js"),[]).then(n=>n.default):h(()=>import("./index-DSWhMtMn.js"),[]).then(n=>n.wallet);case"io.armana.portal":return t?h(()=>import("./image-CI3i53ES.js"),[]).then(n=>n.default):h(()=>import("./index-DuTQzi4Z.js"),[]).then(n=>n.wallet);case"com.x9wallet":return t?h(()=>import("./image-BnT6IaIq.js"),[]).then(n=>n.default):h(()=>import("./index-K7y9yqJI.js"),[]).then(n=>n.wallet);case"io.kigo":return t?h(()=>import("./image-D9i7y0RW.js"),[]).then(n=>n.default):h(()=>import("./index-BIFgx20V.js"),[]).then(n=>n.wallet);case"com.alphawallet":return t?h(()=>import("./image-xJO47ptb.js"),[]).then(n=>n.default):h(()=>import("./index-B78E3fcT.js"),[]).then(n=>n.wallet);case"com.getcogni":return t?h(()=>import("./image-CwsKp0mM.js"),[]).then(n=>n.default):h(()=>import("./index-BNlDhEDg.js"),[]).then(n=>n.wallet);case"app.sinum":return t?h(()=>import("./image-DTy0DgOV.js"),[]).then(n=>n.default):h(()=>import("./index-D5GVUjIM.js"),[]).then(n=>n.wallet);case"finance.soulswap.app":return t?h(()=>import("./image-BI8lK7Gl.js"),[]).then(n=>n.default):h(()=>import("./index-CB_NguTF.js"),[]).then(n=>n.wallet);case"io.loopring.wallet":return t?h(()=>import("./image-BdLvgjKp.js"),[]).then(n=>n.default):h(()=>import("./index-DpoJvg5R.js"),[]).then(n=>n.wallet);case"com.shapeshift":return t?h(()=>import("./image-T2oAotCg.js"),[]).then(n=>n.default):h(()=>
2import("./index-CdMxme0L.js"),[]).then(n=>n.wallet);case"io.trinity-tech":return t?h(()=>import("./image-bHVCC2t9.js"),[]).then(n=>n.default):h(()=>import("./index-JNZoio_2.js"),[]).then(n=>n.wallet);case"money.keychain":return t?h(()=>import("./image-CHotlokX.js"),[]).then(n=>n.default):h(()=>import("./index-C2CZkwuV.js"),[]).then(n=>n.wallet);case"com.superhero.cordova":return t?h(()=>import("./image-CsmwtAjX.js"),[]).then(n=>n.default):h(()=>import("./index-C5X26G0P.js"),[]).then(n=>n.wallet);case"com.bettatrade":return t?h(()=>import("./image-B4MULACL.js"),[]).then(n=>n.default):h(()=>import("./index-qNIXx6_B.js"),[]).then(n=>n.wallet);case"online.puzzle":return t?h(()=>import("./image-C4hEqt6v.js"),[]).then(n=>n.default):h(()=>import("./index-D2-ySoTs.js"),[]).then(n=>n.wallet);case"gg.indi":return t?h(()=>import("./image-DdicXBNF.js"),[]).then(n=>n.default):h(()=>import("./index-BTkNDmCP.js"),[]).then(n=>n.wallet);case"io.tradestrike":return t?h(()=>import("./image-Bsv1aEQB.js"),[]).then(n=>n.default):h(()=>import("./index-CLtv9-lU.js"),[]).then(n=>n.wallet);case"xyz.echooo":return t?h(()=>import("./image-C7H4CQ65.js"),[]).then(n=>n.default):h(()=>import("./index-B-UTLjBc.js"),[]).then(n=>n.wallet);case"com.kryptogo":return t?h(()=>import("./image-D3ALeCj7.js"),[]).then(n=>n.default):h(()=>import("./index-BtBx3hi1.js"),[]).then(n=>n.wallet);case"io.trustasset":return t?h(()=>import("./image-BfmBx3-B.js"),[]).then(n=>n.default):h(()=>import("./index-MECmwSvw.js"),[]).then(n=>n.wallet);case"app.utorg":return t?h(()=>import("./image-CyF2UJbG.js"),[]).then(n=>n.default):h(()=>import("./index-DK-e_E51.js"),[]).then(n=>n.wallet);case"app.dfinnwallet":return t?h(()=>import("./image-DGLcwgsS.js"),[]).then(n=>n.default):h(()=>import("./index-DR-ujXcj.js"),[]).then(n=>n.wallet);case"org.rezor":return t?h(()=>import("./image-D_0i3ZH4.js"),[]).then(n=>n.default):h(()=>import("./index-DlKNOIdN.js"),[]).then(n=>n.wallet);case"io.legionnetwork":return t?h(()=>import("./image-BszqTwo7.js"),[]).then(n=>n.default):h(()=>import("./index-DMyHg26L.js"),[]).then(n=>n.wallet);case"cc.maxwallet":return t?h(()=>import("./image-CxvWjDXv.js"),[]).then(n=>n.default):h(()=>import("./index-Dy45c3qF.js"),[]).then(n=>n.wallet);case"com.ripio":return t?h(()=>import("./image-DZpGtN5l.js"),[]).then(n=>n.default):h(()=>import("./index-BoC-cn90.js"),[]).then(n=>n.wallet);case"com.fxwallet":return t?h(()=>import("./image-Bkj-ZRbS.js"),[]).then(n=>n.default):h(()=>import("./index-D8dYcFAn.js"),[]).then(n=>n.wallet);case"inc.tomo":return t?h(()=>import("./image-rw28GAIu.js"),[]).then(n=>n.default):h(()=>import("./index-Bh8eOJMM.js"),[]).then(n=>n.wallet);case"me.komet.app":return t?h(()=>import("./image-29vwsAfI.js"),[]).then(n=>n.default):h(()=>import("./index-CapnWgEl.js"),[]).then(n=>n.wallet);case"io.guardiianwallet":return t?h(()=>import("./image-DIDeRhKH.js"),[]).then(n=>n.default):h(()=>import("./index-CWTqaiN6.js"),[]).then(n=>n.wallet);case"io.hacken.hai":return t?h(()=>import("./image-Fq457JJn.js"),[]).then(n=>n.default):h(()=>import("./index-BH1-nK1j.js"),[]).then(n=>n.wallet);case"com.zypto":return t?h(()=>import("./image-D9OC6Qfy.js"),[]).then(n=>n.default):h(()=>import("./index-5U2ZJeh5.js"),[]).then(n=>n.wallet);case"io.nabox":return t?h(()=>import("./image-CJb0NNxX.js"),[]).then(n=>n.default):h(()=>import("./index-Cl87iGjg.js"),[]).then(n=>n.wallet);case"com.tastycrypto":return t?h(()=>import("./image-IpgDqPq2.js"),[]).then(n=>n.default):h(()=>import("./index-CXgqt45P.js"),[]).then(n=>n.wallet);case"com.ballet":return t?h(()=>import("./image-DNyYhMNV.js"),[]).then(n=>n.default):h(()=>import("./index-DhFHq_nZ.js"),[]).then(n=>n.wallet);case"io.talken":return t?h(()=>import("./image-DjXN5hvv.js"),[]).then(n=>n.default):h(()=>import("./index-CuJtvtqs.js"),[]).then(n=>n.wallet);case"io.wallacy":return t?h(()=>import("./image-CdGvq_lV.js"),[]).then(n=>n.default):h(()=>import("./index-DcUozftP.js"),[]).then(n=>n.wallet);case"network.mrhb":return t?h(()=>import("./image-CaBQfcNB.js"),[]).then(n=>n.default):h(()=>import("./index-BpspMk9l.js"),[]).then(n=>n.wallet);case"io.pockie":return t?h(()=>
2import("./image-D13kcv8b.js"),[]).then(n=>n.default):h(()=>import("./index-Bd7BhrCK.js"),[]).then(n=>n.wallet);case"me.astrox":return t?h(()=>import("./image-BGSprUxs.js"),[]).then(n=>n.default):h(()=>import("./index-BM9GzZ_o.js"),[]).then(n=>n.wallet);case"com.thirdweb":return t?h(()=>import("./image--O11VYbP.js"),[]).then(n=>n.default):h(()=>import("./index-VZmM-6RJ.js"),[]).then(n=>n.wallet);case"com.poolsmobility.wallet":return t?h(()=>import("./image-CUFBkGzy.js"),[]).then(n=>n.default):h(()=>import("./index-DMyDV-OH.js"),[]).then(n=>n.wallet);case"xyz.roam.wallet":return t?h(()=>import("./image-BBk5bBxJ.js"),[]).then(n=>n.default):h(()=>import("./index-DACt8hFb.js"),[]).then(n=>n.wallet);case"app.gamic":return t?h(()=>import("./image-CbmAI5Wi.js"),[]).then(n=>n.default):h(()=>import("./index-D09WfuKj.js"),[]).then(n=>n.wallet);case"app.m1nty":return t?h(()=>import("./image-8Zz6I0OH.js"),[]).then(n=>n.default):h(()=>import("./index-CU6cpe0O.js"),[]).then(n=>n.wallet);case"network.trustkeys":return t?h(()=>import("./image-BJAlBW3-.js"),[]).then(n=>n.default):h(()=>import("./index-BSA2BPZ9.js"),[]).then(n=>n.wallet);case"com.caesiumlab":return t?h(()=>import("./image-DLtkWmCC.js"),[]).then(n=>n.default):h(()=>import("./index-CZNdz8B6.js"),[]).then(n=>n.wallet);case"app.catecoin":return t?h(()=>import("./image-BIIaxSfC.js"),[]).then(n=>n.default):h(()=>import("./index-DNynPGua.js"),[]).then(n=>n.wallet);case"com.hootark":return t?h(()=>import("./image-BQTKy54v.js"),[]).then(n=>n.default):h(()=>import("./index-DhlaSoR4.js"),[]).then(n=>n.wallet);case"com.crossmint":return t?h(()=>import("./image-DrH3Wn2w.js"),[]).then(n=>n.default):h(()=>import("./index-Czf-i91G.js"),[]).then(n=>n.wallet);case"com.coincircle":return t?h(()=>import("./image-DOcz3CQ4.js"),[]).then(n=>n.default):h(()=>import("./index-Crs9jVrm.js"),[]).then(n=>n.wallet);case"io.bharatbox":return t?h(()=>import("./image-D1eN-vq9.js"),[]).then(n=>n.default):h(()=>import("./index-CdYRC4Ux.js"),[]).then(n=>n.wallet);case"nl.greenhood.wallet":return t?h(()=>import("./image-Cyy1KupU.js"),[]).then(n=>n.default):h(()=>import("./index-BPgl8Hhp.js"),[]).then(n=>n.wallet);case"co.swopme":return t?h(()=>import("./image-B6SAWLjq.js"),[]).then(n=>n.default):h(()=>import("./index-DMAP8qTI.js"),[]).then(n=>n.wallet);case"com.kresus":return t?h(()=>import("./image-DesBMjvP.js"),[]).then(n=>n.default):h(()=>import("./index-oEcArN4B.js"),[]).then(n=>n.wallet);case"com.dolletwallet":return t?h(()=>import("./image-fjbgiffe.js"),[]).then(n=>n.default):h(()=>import("./index-CCIAeA2T.js"),[]).then(n=>n.wallet);case"net.shinobi-wallet":return t?h(()=>import("./image-WbOd8jAJ.js"),[]).then(n=>n.default):h(()=>import("./index-CZmLnawh.js"),[]).then(n=>n.wallet);case"com.azcoiner":return t?h(()=>import("./image-BQcTbEVl.js"),[]).then(n=>n.default):h(()=>import("./index-t6B_NULY.js"),[]).then(n=>n.wallet);case"com.passwallet.app":return t?h(()=>import("./image-DJYKaoNi.js"),[]).then(n=>n.default):h(()=>import("./index-Ct6AYfZ-.js"),[]).then(n=>n.wallet);case"app.qubic.wallet":return t?h(()=>import("./image-BBZFtk5k.js"),[]).then(n=>n.default):h(()=>import("./index-DoKwRUhz.js"),[]).then(n=>n.wallet);case"com.coinex.wallet":return t?h(()=>import("./image-CfglWSsQ.js"),[]).then(n=>n.default):h(()=>import("./index-DMEV07wA.js"),[]).then(n=>n.wallet);case"app.xverse":return t?h(()=>import("./image-DETlLb_v.js"),[]).then(n=>n.default):h(()=>import("./index-DAlw00ee.js"),[]).then(n=>n.wallet);case"com.flash-wallet":return t?h(()=>import("./image-BzGwleUn.js"),[]).then(n=>n.default):h(()=>import("./index-7BdGIDy3.js"),[]).then(n=>n.wallet);case"com.vgxfoundation":return t?h(()=>import("./image-C6NJnfCW.js"),[]).then(n=>n.default):h(()=>import("./index-CsAX4sL-.js"),[]).then(n=>n.wallet);case"org.arianee":return t?h(()=>import("./image-B6VmDbM6.js"),[]).then(n=>n.default):h(()=>import("./index-Cx8lAzRu.js"),[]).then(n=>n.wallet);case"io.myabcwallet":return t?h(()=>import("./image-jv6wUF7a.js"),[]).then(n=>n.default):h(()=>import("./index-3an-fsOm.js"),[]).then(n=>n.wallet);case"io.owallet":return t?h(()=>
2import("./image-DGhNZ1rS.js"),[]).then(n=>n.default):h(()=>import("./index-D2_d10WC.js"),[]).then(n=>n.wallet);case"io.zelus":return t?h(()=>import("./image-1epPqHV4.js"),[]).then(n=>n.default):h(()=>import("./index-hUldZ-v8.js"),[]).then(n=>n.wallet);case"net.myrenegade":return t?h(()=>import("./image-SJHuomz2.js"),[]).then(n=>n.default):h(()=>import("./index-C5gBqe1B.js"),[]).then(n=>n.wallet);case"io.clingon":return t?h(()=>import("./image-2s8lIjLJ.js"),[]).then(n=>n.default):h(()=>import("./index-Dk8LF9Yk.js"),[]).then(n=>n.wallet);case"com.icewal":return t?h(()=>import("./image-rdvu9IOp.js"),[]).then(n=>n.default):h(()=>import("./index-Cd5Dye5X.js"),[]).then(n=>n.wallet);case"io.streakk":return t?h(()=>import("./image-CcPbeTXv.js"),[]).then(n=>n.default):h(()=>import("./index-CrGDBMbK.js"),[]).then(n=>n.wallet);case"com.dokwallet":return t?h(()=>import("./image-BRPzDWpX.js"),[]).then(n=>n.default):h(()=>import("./index-xEbiF_Me.js"),[]).then(n=>n.wallet);case"finance.porta":return t?h(()=>import("./image-BNvlqRxs.js"),[]).then(n=>n.default):h(()=>import("./index-DSL1LhIu.js"),[]).then(n=>n.wallet);case"io.prettygood.x":return t?h(()=>import("./image-BhmKXBqm.js"),[]).then(n=>n.default):h(()=>import("./index-DfafaK4Q.js"),[]).then(n=>n.wallet);case"io.earthwallet":return t?h(()=>import("./image-BOJcifnx.js"),[]).then(n=>n.default):h(()=>import("./index-BmwlJTQ-.js"),[]).then(n=>n.wallet);case"net.spatium.wallet":return t?h(()=>import("./image-CmrOpLf4.js"),[]).then(n=>n.default):h(()=>import("./index-Fd858RJQ.js"),[]).then(n=>n.wallet);case"live.superex":return t?h(()=>import("./image-ByHnaba8.js"),[]).then(n=>n.default):h(()=>import("./index-DqVvpGRi.js"),[]).then(n=>n.wallet);case"com.adftechnology":return t?h(()=>import("./image-C6LRjQzh.js"),[]).then(n=>n.default):h(()=>import("./index-C-b1qpM9.js"),[]).then(n=>n.wallet);case"com.bscecowallet":return t?h(()=>import("./image-8u03hBEl.js"),[]).then(n=>n.default):h(()=>import("./index-Dn2svNQz.js"),[]).then(n=>n.wallet);case"io.wallypto":return t?h(()=>import("./image-CRU88082.js"),[]).then(n=>n.default):h(()=>import("./index-j06jujv2.js"),[]).then(n=>n.wallet);case"com.reown":return t?h(()=>import("./image-D3tLM-DF.js"),[]).then(n=>n.default):h(()=>import("./index-DibwKtF2.js"),[]).then(n=>n.wallet);case"finance.voltage":return t?h(()=>import("./image-ZVoqlWXW.js"),[]).then(n=>n.default):h(()=>import("./index-XRQW1mUN.js"),[]).then(n=>n.wallet);case"com.walletconnect":return t?h(()=>import("./image-BAS5CqSz.js"),[]).then(n=>n.default):h(()=>import("./index-B-BftUxa.js"),[]).then(n=>n.wallet);case"io.passpay":return t?h(()=>import("./image-Ci0UFTFy.js"),[]).then(n=>n.default):h(()=>import("./index-CP_9UNXA.js"),[]).then(n=>n.wallet);case"technology.obvious":return t?h(()=>import("./image-ZLtraAGN.js"),[]).then(n=>n.default):h(()=>import("./index-BzNpkHfI.js"),[]).then(n=>n.wallet);case"io.plutope":return t?h(()=>import("./image-Bz03or90.js"),[]).then(n=>n.default):h(()=>import("./index-CszQa87W.js"),[]).then(n=>n.wallet);case"io.buzz-up":return t?h(()=>import("./image-BsQYdoXP.js"),[]).then(n=>n.default):h(()=>import("./index-BoJGVmma.js"),[]).then(n=>n.wallet);case"co.xellar":return t?h(()=>import("./image-D2QL-j27.js"),[]).then(n=>n.default):h(()=>import("./index-cdlur5jM.js"),[]).then(n=>n.wallet);case"com.kaxaa":return t?h(()=>import("./image-DPzEe6a_.js"),[]).then(n=>n.default):h(()=>import("./index-DFSGuScS.js"),[]).then(n=>n.wallet);case"org.shefi":return t?h(()=>import("./image-DwUGDFj5.js"),[]).then(n=>n.default):h(()=>import("./index-Dtavj5eK.js"),[]).then(n=>n.wallet);case"xyz.orion":return t?h(()=>import("./image-CCDmsN6r.js"),[]).then(n=>n.default):h(()=>import("./index-Ba2OoCBH.js"),[]).then(n=>n.wallet);case"world.dosi.vault":return t?h(()=>import("./image-Cy0vmJls.js"),[]).then(n=>n.default):h(()=>import("./index-eujSyrnd.js"),[]).then(n=>n.wallet);case"network.gridlock":return t?h(()=>import("./image-CxyHP7w7.js"),[]).then(n=>n.default):h(()=>import("./index-Ce98wt2N.js"),[]).then(n=>n.wallet);case"finance.plena":return t?h(()=>import("./image-Cwg1QVuh.js"),[]).then(n=>n.default):h(()=>import("./index-BG1ZQeCA.js"),[]).then(n=>n.wallet);case"cc.dropp":return t?h(()=>import("./image-CAIffJi4.js"),[]).then(n=>n.default):h(()=>import("./index-HFnaQWCU.js"),[]).then(n=>n.wallet);case"io.scramberry":return t?h(()=>
2import("./image-D8ARN-Gu.js"),[]).then(n=>n.default):h(()=>import("./index-BIcsFldg.js"),[]).then(n=>n.wallet);case"xyz.bonuz":return t?h(()=>import("./image-HcidEyjv.js"),[]).then(n=>n.default):h(()=>import("./index-BZhX-e71.js"),[]).then(n=>n.wallet);case"com.bmawallet":return t?h(()=>import("./image-kZBIIBVa.js"),[]).then(n=>n.default):h(()=>import("./index-BM8c6qO-.js"),[]).then(n=>n.wallet);case"co.lifedefi":return t?h(()=>import("./image-DRpXk5be.js"),[]).then(n=>n.default):h(()=>import("./index-otRo5H2H.js"),[]).then(n=>n.wallet);case"com.get-verso":return t?h(()=>import("./image-CgzMLfDa.js"),[]).then(n=>n.default):h(()=>import("./index-DAEFTu29.js"),[]).then(n=>n.wallet);case"io.blocto":return t?h(()=>import("./image-FnAIuX7S.js"),[]).then(n=>n.default):h(()=>import("./index-ZITrt5Fi.js"),[]).then(n=>n.wallet);case"com.pandoshi":return t?h(()=>import("./image-PWpnYSKI.js"),[]).then(n=>n.default):h(()=>import("./index-BmXd0pys.js"),[]).then(n=>n.wallet);case"io.getclave":return t?h(()=>import("./image-rvsWf8U_.js"),[]).then(n=>n.default):h(()=>import("./index--rITGawC.js"),[]).then(n=>n.wallet);case"technology.jambo":return t?h(()=>import("./image-Bx8ULApC.js"),[]).then(n=>n.default):h(()=>import("./index-C2KnoZm4.js"),[]).then(n=>n.wallet);case"app.edge":return t?h(()=>import("./image-1-dOu4Yt.js"),[]).then(n=>n.default):h(()=>import("./index-stFagoJS.js"),[]).then(n=>n.wallet);case"io.banksocial":return t?h(()=>import("./image-OrIz0o8m.js"),[]).then(n=>n.default):h(()=>import("./index-Ia3LffGn.js"),[]).then(n=>n.wallet);case"io.konio":return t?h(()=>import("./image-C2Wl7RAy.js"),[]).then(n=>n.default):h(()=>import("./index-B-kI7R4f.js"),[]).then(n=>n.wallet);case"com.qubetics":return t?h(()=>import("./image-DLvMDcgw.js"),[]).then(n=>n.default):h(()=>import("./index-C_j5E1ow.js"),[]).then(n=>n.wallet);case"app.imem":return t?h(()=>import("./image-Atwyf6cQ.js"),[]).then(n=>n.default):h(()=>import("./index-KXLAu1y1.js"),[]).then(n=>n.wallet);case"com.purechain":return t?h(()=>import("./image-DgU8tR58.js"),[]).then(n=>n.default):h(()=>import("./index-G-h-xM0C.js"),[]).then(n=>n.wallet);case"io.ethos":return t?h(()=>import("./image-DmNOl1OW.js"),[]).then(n=>n.default):h(()=>import("./index-DmLPMpkA.js"),[]).then(n=>n.wallet);case"io.didwallet":return t?h(()=>import("./image-CzKmxeZp.js"),[]).then(n=>n.default):h(()=>import("./index-QGSP4PI8.js"),[]).then(n=>n.wallet);case"com.dextrade":return t?h(()=>import("./image-B_ozWfd0.js"),[]).then(n=>n.default):h(()=>import("./index-CdOxXIip.js"),[]).then(n=>n.wallet);case"org.kelp":return t?h(()=>import("./image-CcKS-8-S.js"),[]).then(n=>n.default):h(()=>import("./index-DUBZIaC-.js"),[]).then(n=>n.wallet);case"xyz.nestwallet":return t?h(()=>import("./image-Bq1UxveY.js"),[]).then(n=>n.default):h(()=>import("./index-uKvrIGe-.js"),[]).then(n=>n.wallet);case"com.cryptnox":return t?h(()=>import("./image-UFnS_pK0.js"),[]).then(n=>n.default):h(()=>import("./index-ComRbnem.js"),[]).then(n=>n.wallet);case"land.liker":return t?h(()=>import("./image-C_JPqQZj.js"),[]).then(n=>n.default):h(()=>import("./index-CId5PD0X.js"),[]).then(n=>n.wallet);case"io.hippowallet":return t?h(()=>import("./image-BdJA4XzW.js"),[]).then(n=>n.default):h(()=>import("./index-BTzbgIH6.js"),[]).then(n=>n.wallet);case"io.certhis":return t?h(()=>import("./image-bSOL4gQb.js"),[]).then(n=>n.default):h(()=>import("./index-BxtNhRvf.js"),[]).then(n=>n.wallet);case"io.safecryptowallet":return t?h(()=>import("./image-DFF2Z6Pk.js"),[]).then(n=>n.default):h(()=>import("./index-CWdL5XwO.js"),[]).then(n=>n.wallet);case"com.saify":return t?h(()=>import("./image-DOwBqPVS.js"),[]).then(n=>n.default):h(()=>import("./index-De1eZyIJ.js"),[]).then(n=>n.wallet);case"com.tiduswallet":return t?h(()=>import("./image-DzJAqGfB.js"),[]).then(n=>n.default):h(()=>import("./index-BMPGw_D6.js"),[]).then(n=>n.wallet);case"io.uptn.dapp-web":return t?h(()=>import("./image-C4ELurjg.js"),[]).then(n=>n.default):h(()=>import("./index-jsmqr-24.js"),[]).then(n=>n.wallet);case"com.it.onewallet":return t?h(()=>import("./image-CWCOKSln.js"),[]).then(n=>n.default):h(()=>import("./index-DHNwai-Z.js"),[]).then(n=>n.wallet);case"com.rktechworks":return t?h(()=>import("./image-BhECDi_9.js"),[]).then(n=>n.default):h(()=>import("./index-D6xvjdG0.js"),[]).then(n=>n.wallet);case"com.revelator.wallet":return t?h(()=>import("./image-nW5JvdXC.js"),[]).then(n=>n.default):h(()=>import("./index-CNl69Nv0.js"),[]).then(n=>n.wallet);case"com.sinohope":return t?h(()=>
2import("./image-D7P0qSfx.js"),[]).then(n=>n.default):h(()=>import("./index-DKzyJcIY.js"),[]).then(n=>n.wallet);case"network.dgg":return t?h(()=>import("./image-DrraBYJZ.js"),[]).then(n=>n.default):h(()=>import("./index-DnUUaSfF.js"),[]).then(n=>n.wallet);case"io.up":return t?h(()=>import("./image-DbpOM2LD.js"),[]).then(n=>n.default):h(()=>import("./index-BuWGQyCe.js"),[]).then(n=>n.wallet);case"com.lif3":return t?h(()=>import("./image-DC2DOoz2.js"),[]).then(n=>n.default):h(()=>import("./index-BKkJhanY.js"),[]).then(n=>n.wallet);case"io.bimwallet":return t?h(()=>import("./image-BKSQyIc5.js"),[]).then(n=>n.default):h(()=>import("./index-3DerMn1X.js"),[]).then(n=>n.wallet);case"pub.dg":return t?h(()=>import("./image-C4KoLZ1v.js"),[]).then(n=>n.default):h(()=>import("./index-D6d2Y6jv.js"),[]).then(n=>n.wallet);case"com.wemix":return t?h(()=>import("./image-CawBnBIo.js"),[]).then(n=>n.default):h(()=>import("./index-18L0wZ74.js"),[]).then(n=>n.wallet);case"com.pierwallet":return t?h(()=>import("./image-DA8Sg5HZ.js"),[]).then(n=>n.default):h(()=>import("./index-mJTgSazQ.js"),[]).then(n=>n.wallet);case"net.stasis":return t?h(()=>import("./image-CyE6Mi3e.js"),[]).then(n=>n.default):h(()=>import("./index-CJ8I9s4o.js"),[]).then(n=>n.wallet);case"com.peakdefi":return t?h(()=>import("./image-DUcJQ0b3.js"),[]).then(n=>n.default):h(()=>import("./index-DEMIRENu.js"),[]).then(n=>n.wallet);case"com.3swallet":return t?h(()=>import("./image-CD3he1Tj.js"),[]).then(n=>n.default):h(()=>import("./index-DVGcX2HE.js"),[]).then(n=>n.wallet);case"com.example.subdomain":return t?h(()=>import("./image-Cs2bevZt.js"),[]).then(n=>n.default):h(()=>import("./index-CJt068xh.js"),[]).then(n=>n.wallet);case"com.reown.appkit-lab":return t?h(()=>import("./image-CnDG0aor.js"),[]).then(n=>n.default):h(()=>import("./index-BzfyCotn.js"),[]).then(n=>n.wallet);case"com.opz":return t?h(()=>import("./image-D1qvgd7h.js"),[]).then(n=>n.default):h(()=>import("./index-CMGByxdA.js"),[]).then(n=>n.wallet);case"ai.spotonchain.platform":return t?h(()=>import("./image-C6QSWUy4.js"),[]).then(n=>n.default):h(()=>import("./index-Ba7PpD6d.js"),[]).then(n=>n.wallet);case"org.dailychain.wallet":return t?h(()=>import("./image-BJ_lqI1X.js"),[]).then(n=>n.default):h(()=>import("./index-DQa9pNJd.js"),[]).then(n=>n.wallet);case"app.omni":return t?h(()=>import("./image-CqLwuE__.js"),[]).then(n=>n.default):h(()=>import("./index-D_7wDcMK.js"),[]).then(n=>n.wallet);case"id.plumaa":return t?h(()=>import("./image-BvJKCSpY.js"),[]).then(n=>n.default):h(()=>import("./index-D45a0k-1.js"),[]).then(n=>n.wallet);case"io.ttmwallet":return t?h(()=>import("./image-Chg2WzE1.js"),[]).then(n=>n.default):h(()=>import("./index-CLikIjn_.js"),[]).then(n=>n.wallet);case"io.kgen":return t?h(()=>import("./image-DFYGQEwh.js"),[]).then(n=>n.default):h(()=>import("./index-BQWXi0by.js"),[]).then(n=>n.wallet);case"com.nufinetes":return t?h(()=>import("./image-CpFHTO_m.js"),[]).then(n=>n.default):h(()=>import("./index-B8De2hoC.js"),[]).then(n=>n.wallet);case"com.squirrelwallet":return t?h(()=>import("./image-bHJO6btW.js"),[]).then(n=>n.default):h(()=>import("./index-DyaPXLoO.js"),[]).then(n=>n.wallet);case"eu.trusteeglobal":return t?h(()=>import("./image-cDoShVvl.js"),[]).then(n=>n.default):h(()=>import("./index-B51294pb.js"),[]).then(n=>n.wallet);case"com.daffione":return t?h(()=>import("./image-Dtc98pdf.js"),[]).then(n=>n.default):h(()=>import("./index-BIXqJF5y.js"),[]).then(n=>n.wallet);case"com.saakuru.app":return t?h(()=>import("./image-TQLBEOIW.js"),[]).then(n=>n.default):h(()=>import("./index-CjVYDT09.js"),[]).then(n=>n.wallet);case"io.r0ar":return t?h(()=>import("./image-4bx5chOJ.js"),[]).then(n=>n.default):h(()=>import("./index-CfCXSq_b.js"),[]).then(n=>n.wallet);case"com.nodle":return t?h(()=>import("./image-tiHbZ1Vk.js"),[]).then(n=>n.default):h(()=>import("./index-BwL47YsA.js"),[]).then(n=>n.wallet);case"app.tofee":return t?h(()=>import("./image-DpHbdMp9.js"),[]).then(n=>n.default):h(()=>import("./index-Bk-uZV0j.js"),[]).then(n=>n.wallet);case"io.pltwallet":return t?h(()=>import("./image-BIDqxk8w.js"),[]).then(n=>n.default):h(()=>import("./index-eiEAIzdd.js"),[]).then(n=>n.wallet);case"org.talkapp":return t?h(()=>import("./image-BkKo9DtA.js"),[]).then(n=>n.default):h(()=>import("./index-BGGk2Hck.js"),[]).then(n=>n.wallet);case"io.ready":return t?h(()=>import("./image-BwjeUYie.js"),[]).then(n=>n.default):h(()=>import("./index-BQwDdmmS.js"),[]).then(n=>n.wallet);case"app.w3wallet":return t?h(()=>import("./image-Covp72ND.js"),[]).then(n=>n.default):h(()=>import("./index-Cb41eDDJ.js"),[]).then(n=>n.wallet);case"pro.ds.app":return t?h(()=>import("./image-Bktw-NJ-.js"),[]).then(n=>n.default):h(()=>import("./index-b5ABnFKj.js"),[]).then(n=>n.wallet);case"com.reown.docs":return t?h(()=>import("./image-V4qYiUxw.js"),[]).then(n=>n.default):h(()=>import("./index-DsgD7D-8.js"),[]).then(n=>n.wallet);case"com.apollox":return t?h(()=>import("./image-ss2LFlQu.js"),[]).then(n=>n.default):h(()=>import("./index-BLMjeGJ-.js"),[]).then(n=>n.wallet);case"com.ipmb":return t?h(()=>import("./image-CirJIT7l.js"),[]).then(n=>n.default):h(()=>import("./index-DP0utIbV.js"),[]).then(n=>n.wallet);case"com.payperless":return t?h(()=>import("./image-q4XfUN6v.js"),[]).then(n=>n.default):h(()=>import("./index-szNElS1a.js"),[]).then(n=>n.wallet);case"com.obliowallet":return t?h(()=>import("./image-BGxqJH7c.js"),[]).then(n=>n.default):h(()=>import("./index-JuvDLDuk.js"),[]).then(n=>n.wallet);case"app.keeper-wallet":return t?h(()=>
2import("./image-Dpgf4dcg.js"),[]).then(n=>n.default):h(()=>import("./index-DlfGjmz4.js"),[]).then(n=>n.wallet);case"io.paraswap":return t?h(()=>import("./image-CQKjvlto.js"),[]).then(n=>n.default):h(()=>import("./index-DjLE3t9q.js"),[]).then(n=>n.wallet);case"org.ecoinwallet":return t?h(()=>import("./image-C3Va51zP.js"),[]).then(n=>n.default):h(()=>import("./index-DFZNHq44.js"),[]).then(n=>n.wallet);case"fi.dropmate":return t?h(()=>import("./image-5xiz28Wo.js"),[]).then(n=>n.default):h(()=>import("./index-p0ATWoVh.js"),[]).then(n=>n.wallet);case"com.cryptokara":return t?h(()=>import("./image-Dqbrewdt.js"),[]).then(n=>n.default):h(()=>import("./index-Cfzzcvgo.js"),[]).then(n=>n.wallet);case"co.cyber.wallet":return t?h(()=>import("./image-BvkSxpXq.js"),[]).then(n=>n.default):h(()=>import("./index-e_qeQmc1.js"),[]).then(n=>n.wallet);case"com.kriptonio":return t?h(()=>import("./image-D_cIj1db.js"),[]).then(n=>n.default):h(()=>import("./index-Dxm6Y7eO.js"),[]).then(n=>n.wallet);case"digital.minerva":return t?h(()=>import("./image-D5wxf47e.js"),[]).then(n=>n.default):h(()=>import("./index-HnCuhDYJ.js"),[]).then(n=>n.wallet);case"com.mpcvault.broswerplugin":return t?h(()=>import("./image-BN4ovMrn.js"),[]).then(n=>n.default):h(()=>import("./index-BXY5tnuK.js"),[]).then(n=>n.wallet);case"com.liberawallet":return t?h(()=>import("./image-DyrMImIL.js"),[]).then(n=>n.default):h(()=>import("./index-Dqyfi4dm.js"),[]).then(n=>n.wallet);case"io.helixid":return t?h(()=>import("./image-Dkp4M1ik.js"),[]).then(n=>n.default):h(()=>import("./index-RJhc6LnM.js"),[]).then(n=>n.wallet);case"com.broearn":return t?h(()=>import("./image-JyGUnQ_N.js"),[]).then(n=>n.default):h(()=>import("./index-WsH2ZGfO.js"),[]).then(n=>n.wallet);case"io.altme":return t?h(()=>import("./image-MQbcgW7z.js"),[]).then(n=>n.default):h(()=>import("./index-CpMkh5pZ.js"),[]).then(n=>n.wallet);case"app.herewallet":return t?h(()=>import("./image-gnC_p3Da.js"),[]).then(n=>n.default):h(()=>import("./index-CecEswCv.js"),[]).then(n=>n.wallet);case"com.coinsdo":return t?h(()=>import("./image-DrHhCSDD.js"),[]).then(n=>n.default):h(()=>import("./index-DJYG2Vtc.js"),[]).then(n=>n.wallet);case"trade.flooz.wallet":return t?h(()=>import("./image-DaaIjpQJ.js"),[]).then(n=>n.default):h(()=>import("./index-C6EDKfcJ.js"),[]).then(n=>n.wallet);case"com.tapwallet":return t?h(()=>import("./image-BxeDPEwg.js"),[]).then(n=>n.default):h(()=>import("./index-BwCUvEoQ.js"),[]).then(n=>n.wallet);case"fun.tobi":return t?h(()=>import("./image-DmhgJWq-.js"),[]).then(n=>n.default):h(()=>import("./index-C1adBKyv.js"),[]).then(n=>n.wallet);case"com.bitnovo":return t?h(()=>import("./image-BTZyVpoA.js"),[]).then(n=>n.default):h(()=>import("./index-CaZIFXyW.js"),[]).then(n=>n.wallet);case"io.xucre":return t?h(()=>import("./image-DZ-B-aVa.js"),[]).then(n=>n.default):h(()=>import("./index-BBDAdmKp.js"),[]).then(n=>n.wallet);case"app.girin":return t?h(()=>import("./image-CkQb0YUH.js"),[]).then(n=>n.default):h(()=>import("./index-CpJZxSfI.js"),[]).then(n=>n.wallet);case"finance.panaroma":return t?h(()=>import("./image-Z9k3mhsb.js"),[]).then(n=>n.default):h(()=>import("./index-BIeLm-x3.js"),[]).then(n=>n.wallet);case"app.clot":return t?h(()=>import("./image-DZplWZyD.js"),[]).then(n=>n.default):h(()=>import("./index-BVQeUBdj.js"),[]).then(n=>n.wallet);case"io.transi":return t?h(()=>import("./image-Dc5zhKf6.js"),[]).then(n=>n.default):h(()=>import("./index-DDggnqr4.js"),[]).then(n=>n.wallet);case"world.qoin":return t?h(()=>import("./image-BPAkEl8k.js"),[]).then(n=>n.default):h(()=>import("./index-C9taR4Do.js"),[]).then(n=>n.wallet);case"com.greengloryglobal":return t?h(()=>import("./image-lOdcUtWG.js"),[]).then(n=>n.default):h(()=>import("./index-C-OT0KJG.js"),[]).then(n=>n.wallet);case"com.amazewallet":return t?h(()=>import("./image-2wmDBIB6.js"),[]).then(n=>n.default):h(()=>import("./index-DvXpQOkv.js"),[]).then(n=>n.wallet);case"zone.bitverse":return t?h(()=>import("./image-C6aZzydG.js"),[]).then(n=>n.default):h(()=>import("./index-CN6XdMAo.js"),[]).then(n=>n.wallet);case"social.gm2":return t?h(()=>import("./image-BqtrMo-7.js"),[]).then(n=>n.default):h(()=>import("./index-Coq7--sH.js"),[]).then(n=>n.wallet);case"io.ozonewallet":return t?h(()=>import("./image-BtnrRGhZ.js"),[]).then(n=>n.default):h(()=>import("./index-DFc7lZHb.js"),[]).then(n=>n.wallet);case"io.ukiss":return t?h(()=>
2import("./image-DFYwzuHA.js"),[]).then(n=>n.default):h(()=>import("./index-CE9n_StB.js"),[]).then(n=>n.wallet);case"finance.islamicoin":return t?h(()=>import("./image-CWG4tRzZ.js"),[]).then(n=>n.default):h(()=>import("./index-pcLdliEp.js"),[]).then(n=>n.wallet);case"io.copiosa":return t?h(()=>import("./image-DuQoo_kR.js"),[]).then(n=>n.default):h(()=>import("./index-CWmGdvBR.js"),[]).then(n=>n.wallet);case"world.fncy":return t?h(()=>import("./image-B5M2ftPa.js"),[]).then(n=>n.default):h(()=>import("./index-Ba45jQBJ.js"),[]).then(n=>n.wallet);case"io.moonstake":return t?h(()=>import("./image-zsArRLIF.js"),[]).then(n=>n.default):h(()=>import("./index-C7HuhgLE.js"),[]).then(n=>n.wallet);case"com.trusteeglobal":return t?h(()=>import("./image-iR_slvRo.js"),[]).then(n=>n.default):h(()=>import("./index-CNLH4wrU.js"),[]).then(n=>n.wallet);case"net.spatium":return t?h(()=>import("./image-DBFrM6tr.js"),[]).then(n=>n.default):h(()=>import("./index-BJBC3bLU.js"),[]).then(n=>n.wallet);case"co.filwallet":return t?h(()=>import("./image-Do8rO3zE.js"),[]).then(n=>n.default):h(()=>import("./index-D7FslwZl.js"),[]).then(n=>n.wallet);case"money.snowball":return t?h(()=>import("./image-3Q7PfsJG.js"),[]).then(n=>n.default):h(()=>import("./index-yOwMLl2f.js"),[]).then(n=>n.wallet);case"com.ennowallet":return t?h(()=>import("./image-Ccx8wDSE.js"),[]).then(n=>n.default):h(()=>import("./index-BRIQuVzg.js"),[]).then(n=>n.wallet);case"io.safematrix":return t?h(()=>import("./image-BX4sAPzh.js"),[]).then(n=>n.default):h(()=>import("./index-Yk_iQY25.js"),[]).then(n=>n.wallet);case"pro.assure":return t?h(()=>import("./image-DMTT8AeN.js"),[]).then(n=>n.default):h(()=>import("./index-BfYVYwh5.js"),[]).then(n=>n.wallet);case"com.neftipedia":return t?h(()=>import("./image-vrSaD0K9.js"),[]).then(n=>n.default):h(()=>import("./index-BHZDuU0I.js"),[]).then(n=>n.wallet);case"io.goldbit":return t?h(()=>import("./image-CtiFcEL8.js"),[]).then(n=>n.default):h(()=>import("./index-DFrKYv4g.js"),[]).then(n=>n.wallet);case"com.coingrig":return t?h(()=>import("./image-NsVKBwxZ.js"),[]).then(n=>n.default):h(()=>import("./index-DcyXtFTG.js"),[]).then(n=>n.wallet);case"io.xfun":return t?h(()=>import("./image-CPMDxql6.js"),[]).then(n=>n.default):h(()=>import("./index-B05algAv.js"),[]).then(n=>n.wallet);case"com.antiersolutions":return t?h(()=>import("./image-BMh4HSr7.js"),[]).then(n=>n.default):h(()=>import("./index-DufOfQ90.js"),[]).then(n=>n.wallet);case"com.itoken":return t?h(()=>import("./image-BwBO8BTi.js"),[]).then(n=>n.default):h(()=>import("./index-BftqI1FU.js"),[]).then(n=>n.wallet);case"com.cardstack":return t?h(()=>import("./image-D7Sd6W8U.js"),[]).then(n=>n.default):h(()=>import("./index-BiHhxeDt.js"),[]).then(n=>n.wallet);case"io.slavi":return t?h(()=>import("./image-BQUnnXTb.js"),[]).then(n=>n.default):h(()=>import("./index-Kt6GlPCW.js"),[]).then(n=>n.wallet);case"tech.defiantapp":return t?h(()=>import("./image-D4-YMi52.js"),[]).then(n=>n.default):h(()=>import("./index-DPic1oJg.js"),[]).then(n=>n.wallet);case"com.dexari":return t?h(()=>import("./image-BoANtDMS.js"),[]).then(n=>n.default):h(()=>import("./index-DPFoWmV6.js"),[]).then(n=>n.wallet);case"io.cfcx":return t?h(()=>import("./image-139plIjh.js"),[]).then(n=>n.default):h(()=>import("./index-Cws1zSAX.js"),[]).then(n=>n.wallet);case"com.socjsc":return t?h(()=>import("./image-Crp2YP47.js"),[]).then(n=>n.default):h(()=>import("./index-C_XOoDbk.js"),[]).then(n=>n.wallet);case"com.tokenb":return t?h(()=>import("./image-8LnJ1bNt.js"),[]).then(n=>n.default):h(()=>import("./index-DcwbqEHj.js"),[]).then(n=>n.wallet);case"org.onyx":return t?h(()=>import("./image-DKcWaLtu.js"),[]).then(n=>n.default):h(()=>import("./index-C5NL4PoV.js"),[]).then(n=>n.wallet);case"io.gk8":return t?h(()=>import("./image-ZwibGfzR.js"),[]).then(n=>n.default):h(()=>import("./index-CLxj2t1J.js"),[]).then(n=>n.wallet);case"com.anchorage":return t?h(()=>import("./image-OT0Fb2Nb.js"),[]).then(n=>n.default):h(()=>import("./index-aoLVKFG1.js"),[]).then(n=>n.wallet);case"com.hashport.wallet":return t?h(()=>import("./image-DooF_Vfs.js"),[]).then(n=>n.default):h(()=>import("./index-DICTy0sa.js"),[]).then(n=>n.wallet);case"io.billionwallet":return t?h(()=>
2import("./image-DDBzbPSl.js"),[]).then(n=>n.default):h(()=>import("./index-CmCRou09.js"),[]).then(n=>n.wallet);case"com.dlicom":return t?h(()=>import("./image-lXBTHYnD.js"),[]).then(n=>n.default):h(()=>import("./index-l8DhIVZW.js"),[]).then(n=>n.wallet);case"com.tychiwallet":return t?h(()=>import("./image-pcyfaNhf.js"),[]).then(n=>n.default):h(()=>import("./index-B3vR_dtk.js"),[]).then(n=>n.wallet);case"at.swe":return t?h(()=>import("./image-C8_9fy1e.js"),[]).then(n=>n.default):h(()=>import("./index-ficai7Ce.js"),[]).then(n=>n.wallet);case"network.wali":return t?h(()=>import("./image-CSyxcTwp.js"),[]).then(n=>n.default):h(()=>import("./index-Dzkop1Gk.js"),[]).then(n=>n.wallet);case"io.diamante":return t?h(()=>import("./image-Dh9w9A8z.js"),[]).then(n=>n.default):h(()=>import("./index-C1a5oPtZ.js"),[]).then(n=>n.wallet);case"ai.interlinklabs":return t?h(()=>import("./image-Dz82Zyfj.js"),[]).then(n=>n.default):h(()=>import("./index-BTqXeJHf.js"),[]).then(n=>n.wallet);case"com.walllet":return t?h(()=>import("./image-VFWT6oS6.js"),[]).then(n=>n.default):h(()=>import("./index-DPgWRg9-.js"),[]).then(n=>n.wallet);case"org.lunascape":return t?h(()=>import("./image-D4nkyGrg.js"),[]).then(n=>n.default):h(()=>import("./index-4Nmn8ium.js"),[]).then(n=>n.wallet);case"com.nvxowallet":return t?h(()=>import("./image-BoS2kgXC.js"),[]).then(n=>n.default):h(()=>import("./index-CRRdY0XA.js"),[]).then(n=>n.wallet);case"today.paywithcrypto.wallet":return t?h(()=>import("./image-CsUCYFyx.js"),[]).then(n=>n.default):h(()=>import("./index-CFUSXkKo.js"),[]).then(n=>n.wallet);case"ai.iluminary":return t?h(()=>import("./image-CEuSmI3b.js"),[]).then(n=>n.default):h(()=>import("./index-D1j-SvoJ.js"),[]).then(n=>n.wallet);case"io.reactwallet":return t?h(()=>import("./image-B3lDLhwe.js"),[]).then(n=>n.default):h(()=>import("./index-CTs1t6rA.js"),[]).then(n=>n.wallet);case"com.rewardywallet":return t?h(()=>import("./image-DVyDRAAO.js"),[]).then(n=>n.default):h(()=>import("./index-cF_6KJvb.js"),[]).then(n=>n.wallet);case"io.walletv":return t?h(()=>import("./image-CTBdimeM.js"),[]).then(n=>n.default):h(()=>import("./index-He5kaR9n.js"),[]).then(n=>n.wallet);case"app.outlawgames":return t?h(()=>import("./image-BPqXYngz.js"),[]).then(n=>n.default):h(()=>import("./index-D2hPph8l.js"),[]).then(n=>n.wallet);case"io.ironwallet":return t?h(()=>import("./image-BKNtkg6s.js"),[]).then(n=>n.default):h(()=>import("./index-B1-qcL-p.js"),[]).then(n=>n.wallet);case"com.mecowallet":return t?h(()=>import("./image-m7IlStdm.js"),[]).then(n=>n.default):h(()=>import("./index-BdgyG9Qa.js"),[]).then(n=>n.wallet);case"com.onlybulls":return t?h(()=>import("./image-qLUwfjzV.js"),[]).then(n=>n.default):h(()=>import("./index-DPPIbXj8.js"),[]).then(n=>n.wallet);case"me.qiewallet":return t?h(()=>import("./image-BHJFFIIN.js"),[]).then(n=>n.default):h(()=>import("./index-D6zAueb_.js"),[]).then(n=>n.wallet);case"fund.lflabs":return t?h(()=>import("./image-dO78_uyn.js"),[]).then(n=>n.default):h(()=>import("./index-BBkeSt5m.js"),[]).then(n=>n.wallet);case"io.walletverse":return t?h(()=>import("./image-DUk3AUBd.js"),[]).then(n=>n.default):h(()=>import("./index-CfO_m3oL.js"),[]).then(n=>n.wallet);case"com.berasig":return t?h(()=>import("./image-CisWvLpc.js"),[]).then(n=>n.default):h(()=>import("./index-Cg1E5HxJ.js"),[]).then(n=>n.wallet);case"app.phantom":return t?h(()=>import("./image-6levnvAC.js"),[]).then(n=>n.default):h(()=>import("./index-IBUgXgOa.js"),[]).then(n=>n.wallet);case"com.coinbase.wallet":return t?h(()=>import("./image-C6EsuPXB.js"),[]).then(n=>n.default):h(()=>import("./index-BILUwmJ9.js"),[]).then(n=>n.wallet);case"io.rabby":return t?h(()=>import("./image-CZ2qSHpt.js"),[]).then(n=>n.default):h(()=>import("./index-Bprjmfje.js"),[]).then(n=>n.wallet);case"com.brave.wallet":return t?h(()=>import("./image-9Jtg22X3.js"),[]).then(n=>n.default):h(()=>import("./index-DKbx-y78.js"),[]).then(n=>n.wallet);case"fi.nu":return t?h(()=>import("./image-BAl5qyeX.js"),[]).then(n=>n.default):h(()=>import("./index-BXi61TZ5.js"),[]).then(n=>n.wallet);case"pro.hinkal.walletconnect":return t?h(()=>import("./image-d8n8A6si.js"),[]).then(n=>n.default):h(()=>import("./index-CujrNB-Q.js"),[]).then(n=>n.wallet);case"com.moongate.one":return t?h(()=>
2import("./image-DZc2BYzk.js"),[]).then(n=>n.default):h(()=>import("./index-B2WV7sR7.js"),[]).then(n=>n.wallet);case"tech.levain":return t?h(()=>import("./image-DcIu3U38.js"),[]).then(n=>n.default):h(()=>import("./index-CEpc_g8h.js"),[]).then(n=>n.wallet);case"com.enkrypt":return t?h(()=>import("./image-DvpdMMzF.js"),[]).then(n=>n.default):h(()=>import("./index-Cc4uopde.js"),[]).then(n=>n.wallet);case"com.scramble":return t?h(()=>import("./image-DT5Fvf2s.js"),[]).then(n=>n.default):h(()=>import("./index-D4Sgj1mL.js"),[]).then(n=>n.wallet);case"io.finoa":return t?h(()=>import("./image-D_i0o0Nv.js"),[]).then(n=>n.default):h(()=>import("./index-DFghxfjK.js"),[]).then(n=>n.wallet);case"com.blazpay.wallet":return t?h(()=>import("./image-CgHABHdL.js"),[]).then(n=>n.default):h(()=>import("./index-B_OXuBhF.js"),[]).then(n=>n.wallet);case"io.getjoin.prd":return t?h(()=>import("./image-CmWdSXJI.js"),[]).then(n=>n.default):h(()=>import("./index-QvBzJwgv.js"),[]).then(n=>n.wallet);case"xyz.talisman":return t?h(()=>import("./image-VlTaWJmy.js"),[]).then(n=>n.default):h(()=>import("./index-BgbYZOnC.js"),[]).then(n=>n.wallet);case"eu.flashsoft.clear-wallet":return t?h(()=>import("./image-gxCVLutB.js"),[]).then(n=>n.default):h(()=>import("./index-BBiL2lyk.js"),[]).then(n=>n.wallet);case"app.berasig":return t?h(()=>import("./image-BjTMD2k8.js"),[]).then(n=>n.default):h(()=>import("./index-DkcP2fCc.js"),[]).then(n=>n.wallet);case"com.wallet.reown":return t?h(()=>import("./image-CC2_AL18.js"),[]).then(n=>n.default):h(()=>import("./index-BEx6ckei.js"),[]).then(n=>n.wallet);case"io.runonflux.sspwallet":return t?h(()=>import("./image-DfzpWAED.js"),[]).then(n=>n.default):h(()=>import("./index-CrUcAJK0.js"),[]).then(n=>n.wallet);case"com.blanqlabs.wallet":return t?h(()=>import("./image-wR942Jk6.js"),[]).then(n=>n.default):h(()=>import("./index-DBst6Hla.js"),[]).then(n=>n.wallet);case"io.hero.wallet":return t?h(()=>import("./image-BbH7e9pw.js"),[]).then(n=>n.default):h(()=>import("./index-BBANTdk4.js"),[]).then(n=>n.wallet);case"network.verified.custody":return t?h(()=>import("./image-DpjDzWCs.js"),[]).then(n=>n.default):h(()=>import("./index-CyhgnW_d.js"),[]).then(n=>n.wallet);case"console.utila.io":return t?h(()=>import("./image-C7tHBnQp.js"),[]).then(n=>n.default):h(()=>import("./index-BrOCsLbf.js"),[]).then(n=>n.wallet);case"com.micet.wallet":return t?h(()=>import("./image-On2ij4Ix.js"),[]).then(n=>n.default):h(()=>import("./index-JAAqCLcG.js"),[]).then(n=>n.wallet);case"world.dolphinode.chain":return t?h(()=>import("./image-BXzPnbc4.js"),[]).then(n=>n.default):h(()=>import("./index-CiwBOkla.js"),[]).then(n=>n.wallet);case"com.lootrush":return t?h(()=>import("./image-t4jvKgpV.js"),[]).then(n=>n.default):h(()=>import("./index-BLsnOBhg.js"),[]).then(n=>n.wallet);case"xyz.dawnwallet":return t?h(()=>import("./image-bpacFMFT.js"),[]).then(n=>n.default):h(()=>import("./index-BqK7Phb6.js"),[]).then(n=>n.wallet);case"xyz.abs":return t?h(()=>import("./image-DFo7XMVJ.js"),[]).then(n=>n.default):h(()=>import("./index-8Ff6vDUD.js"),[]).then(n=>n.wallet);case"sh.frame":return t?h(()=>import("./image-C1w2WpL5.js"),[]).then(n=>n.default):h(()=>import("./index-cAvSYrmF.js"),[]).then(n=>n.wallet);case"io.useglyph":return t?h(()=>import("./image-C46yxCl4.js"),[]).then(n=>n.default):h(()=>import("./index-DE_8irSD.js"),[]).then(n=>n.wallet);case"org.base.account":return t?h(()=>import("./image-Ds78yECl.js"),[]).then(n=>n.default):h(()=>import("./index-kNZGxYSe.js"),[]).then(n=>n.wallet);default:throw new Error(`Wallet with id ${e} not found`)}}function Op(e){const{client:t,address:n}=e;return pe({enabled:!!n,queryFn:()=>$f({address:n||"",client:t,resolverChain:zo}),queryKey:["ens-name",n]})}function Po(e){return pe({enabled:!!e,queryFn:()=>{if(!e)throw new Error("Wallet id is required");return lc(e,!1)},queryKey:["wallet-info",e],refetchOnMount:!1,refetchOnWindowFocus:!1,retry:!1})}function K9(e){return pe({enabled:!!e,queryFn:async()=>{var i;if(!e)throw new Error("Wallet id is required");const{getInstalledWalletProviders:t}=await h(async()=>{const{getInstalledWalletProviders:r}=await Promise.resolve().then(()=>Ll);return{getInstalledWalletProviders:r}},void 0),n=(i=t().find(r=>r.info.rdns===e))==null?void 0:i.info.icon;return n||lc(e,!0)},queryKey:["wallet-image",e],refetchOnMount:!1,refetchOnWindowFocus:!1,retry:!1})}const kp=_.createContext(void 0);function J9(e){return a.jsx(kp.Provider,{value:e,children:e.children})}function X9(){const e=_.useContext(kp);if(!e)throw new Error("WalletProviderContext not found. Make sure you are using WalletIcon, Wallet
2Name, etc. inside a <WalletProvider /> component");return e}async function ot(e){const t={action:e.event,amountWei:e.amountWei,chainId:e.chainId,clientId:e.client.clientId,dstChainId:e.toChainId,dstTokenAddress:e.toToken,errorCode:e.error,source:"pay",tokenAddress:e.fromToken,walletAddress:e.walletAddress,walletType:e.walletType};return M6({client:e.client,data:t,ecosystem:e.ecosystem})}async function zp(e){const{account:t,client:n,chain:i,tokenAddress:r}=e;if(r){const{getBalance:d}=await h(async()=>{const{getBalance:f}=await import("./getBalance-pPDU8PQq.js");return{getBalance:f}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));return d({address:t.address,contract:zt({address:r,chain:i,client:n})})}const s=uf({chain:i,client:n}),[o,c,l,u]=await Promise.all([S4(i),D4(i),N4(i),Ip(s,{address:t.address})]);return{decimals:c,displayValue:mi(u,c),name:l,symbol:o,value:u}}function eI(e){const{showPayModal:t,gasless:n,wallet:i,switchChain:r}=e;let s=i==null?void 0:i.getAccount();return Es({mutationFn:async o=>{var l,u;if(i&&o.chain.id!==((l=i.getChain())==null?void 0:l.id)&&(await r(o.chain),s=i.getAccount(),((u=i.getChain())==null?void 0:u.id)!==o.chain.id))throw new Error(`Could not switch to chain ${o.chain.id}`);const c=s;if(!c)throw new Error("No active account");return t?new Promise((d,f)=>{const m=async()=>{try{const y=await za({account:c,gasless:n,transaction:o});d(y)}catch(y){H4(y)&&Q4({chainId:o.chain.id,client:o.client,contractAddress:await wn(o.to??void 0),error:y,transactionValue:await wn(o.value),walletAddress:c.address}),f(y)}};(async()=>{try{const[y,g]=await Promise.all([wn(o.value),wn(o.erc20Value)]),p=y||0n,w=(g==null?void 0:g.amountWei)||0n,[x,I,E]=await Promise.all([Ts({address:c.address,chain:o.chain,client:o.client}),g!=null&&g.tokenAddress?zp({account:c,chain:o.chain,client:o.client,tokenAddress:g.tokenAddress}):void 0,bl(o,c.address)]),C=hf(i)?0n:E,T=p+C;if(w>0n&&I&&I.value<w||T>0n&&x.value<T){const N=await zf({client:o.client,chainId:o.chain.id,tokenAddress:g==null?void 0:g.tokenAddress}).catch(M=>(ot({client:o.client,error:M==null?void 0:M.message,event:"pay_transaction_modal_pay_api_error",toChainId:o.chain.id,walletAddress:c.address,walletType:i==null?void 0:i.id}),null));if(!N||N.length===0){ot({client:o.client,error:JSON.stringify({chain:o.chain.id,message:"chain/token not supported",token:g==null?void 0:g.tokenAddress}),event:"pay_transaction_modal_chain_token_not_supported",toChainId:o.chain.id,toToken:(g==null?void 0:g.tokenAddress)||void 0,walletAddress:c.address,walletType:i==null?void 0:i.id}),t({mode:"deposit",rejectTx:f,resolveTx:d,sendTx:m,tx:o});return}t({mode:"buy",rejectTx:f,resolveTx:d,sendTx:m,tx:o})}else ot({client:o.client,event:"pay_transaction_modal_has_enough_funds",toChainId:o.chain.id,toToken:(g==null?void 0:g.tokenAddress)||void 0,walletAddress:c.address,walletType:i==null?void 0:i.id}),m()}catch(y){console.error("Failed to estimate cost",y),m()}})()}):(ot({chainId:o.chain.id,client:o.client,event:"pay_transaction_modal_disabled",walletAddress:c.address,walletType:i==null?void 0:i.id}),za({account:c,gasless:n,transaction:o}))}})}const Pp=_.createContext(vh);function mu(e){const{theme:t,children:n}=e,i=Rp(t);return a.jsx(Pp.Provider,{value:i,children:n})}function Rp(e){if(!e||!tI(e))return vh;let t;return typeof e=="string"?t=e==="light"?K6:vh:t=e,t}function tI(e){return e==="dark"||e==="light"||typeof e=="object"&&e!==null&&"colors"in e}function ee(){return _.useContext(Pp)}class nI{async open(t){window.open(t,"_blank","noopener,noreferrer")}}const lo=new nI;function Up(...e){return e.filter(t=>typeof t=="string").join(" ")}var iI=!1;function rI(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function sI(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var oI=function(){function e(n){var i=this;this._insertTag=function(r){var s;i.tags.length===0?i.insertionPoint?s=i.insertionPoint.nextSibling:i.prepend?s=i.container.firstChild:s=i.before:s=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(r,
2s),i.tags.push(r)},this.isSpeedy=n.speedy===void 0?!iI:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(i){i.forEach(this._insertTag)},t.insert=function(i){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(sI(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var s=rI(r);try{s.insertRule(i,s.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(i));this.ctr++},t.flush=function(){this.tags.forEach(function(i){var r;return(r=i.parentNode)==null?void 0:r.removeChild(i)}),this.tags=[],this.ctr=0},e}(),an="-ms-",Tl="-moz-",Ue="-webkit-",Bp="comm",Wf="rule",Ff="decl",aI="@import",Vp="@keyframes",cI="@layer",lI=Math.abs,yu=String.fromCharCode,uI=Object.assign;function dI(e,t){return Yt(e,0)^45?(((t<<2^Yt(e,0))<<2^Yt(e,1))<<2^Yt(e,2))<<2^Yt(e,3):0}function $p(e){return e.trim()}function hI(e,t){return(e=t.exec(e))?e[0]:e}function Be(e,t,n){return e.replace(t,n)}function Yh(e,t){return e.indexOf(t)}function Yt(e,t){return e.charCodeAt(t)|0}function Ra(e,t,n){return e.slice(t,n)}function ji(e){return e.length}function Yf(e){return e.length}function Ac(e,t){return t.push(e),e}function fI(e,t){return e.map(t).join("")}var gu=1,Io=1,Wp=0,Rn=0,It=0,Ro="";function pu(e,t,n,i,r,s,o){return{value:e,root:t,parent:n,type:i,props:r,children:s,line:gu,column:Io,length:o,return:""}}function qo(e,t){return uI(pu("",null,null,"",null,null,0),e,{length:-e.length},t)}function mI(){return It}function yI(){return It=Rn>0?Yt(Ro,--Rn):0,Io--,It===10&&(Io=1,gu--),It}function Yn(){return It=Rn<Wp?Yt(Ro,Rn++):0,Io++,It===10&&(Io=1,gu++),It}function Ai(){return Yt(Ro,Rn)}function il(){return Rn}function uc(e,t){return Ra(Ro,e,t)}function Ua(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Fp(e){return gu=Io=1,Wp=ji(Ro=e),Rn=0,[]}function Yp(e){return Ro="",e}function rl(e){return $p(uc(Rn-1,Hh(e===91?e+2:e===40?e+1:e)))}function gI(e){for(;(It=Ai())&&It<33;)Yn();return Ua(e)>2||Ua(It)>3?"":" "}function pI(e,t){for(;--t&&Yn()&&!(It<48||It>102||It>57&&It<65||It>70&&It<97););return uc(e,il()+(t<6&&Ai()==32&&Yn()==32))}function Hh(e){for(;Yn();)switch(It){case e:return Rn;case 34:case 39:e!==34&&e!==39&&Hh(It);break;case 40:e===41&&Hh(e);break;case 92:Yn();break}return Rn}function wI(e,t){for(;Yn()&&e+It!==57;)if(e+It===84&&Ai()===47)break;return"/*"+uc(t,Rn-1)+"*"+yu(e===47?e:Yn())}function _I(e){for(;!Ua(Ai());)Yn();return uc(e,Rn)}function bI(e){return Yp(sl("",null,null,null,[""],e=Fp(e),0,[0],e))}function sl(e,t,n,i,r,s,o,c,l){for(var u=0,d=0,f=o,m=0,y=0,g=0,p=1,w=1,x=1,I=0,E="",j=r,C=s,T=i,v=E;w;)switch(g=I,I=Yn()){case 40:if(g!=108&&Yt(v,f-1)==58){Yh(v+=Be(rl(I),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:v+=rl(I);break;case 9:case 10:case 13:case 32:v+=gI(g);break;case 92:v+=pI(il()-1,7);continue;case 47:switch(Ai()){case 42:case 47:Ac(xI(wI(Yn(),il()),t,n),l);break;default:v+="/"}break;case 123*p:c[u++]=ji(v)*x;case 125*p:case 59:case 0:switch(I){case 0:case 125:w=0;case 59+d:x==-1&&(v=Be(v,/\f/g,"")),y>0&&ji(v)-f&&Ac(y>32?Vm(v+";",i,n,f-1):Vm(Be(v," ","")+";",i,n,f-2),l);break;case 59:v+=";";default:if(Ac(T=Bm(v,t,n,u,d,r,c,E,j=[],C=[],f),s),I===123)if(d===0)sl(v,t,T,T,j,s,f,c,C);else switch(m===99&&Yt(v,3)===110?100:m){case 100:case 108:case 109:case 115:sl(e,T,T,i&&Ac(Bm(e,T,T,0,0,r,c,E,r,j=[],f),C),r,C,f,c,i?j:C);break;default:sl(v,T,T,T,[""],C,0,c,C)}}u=d=y=0,p=x=1,E=v="",f=o;break;case 58:f=1+ji(v),y=g;default:if(p<1){if(I==123)--p;else if(I==125&&p++==0&&yI()==125)continue}switch(v+=yu(I),I*p){case 38:x=d>0?1:(v+="\f",-1);break;case 44:c[u++]=(ji(v)-1)*x,x=1;break;case 64:Ai()===45&&(v+=rl(Yn())),m=Ai(),d=f=ji(E=v+=_I(il())),I++;break;case 45:g===45&&ji(v)==2&&(p=0)}}return s}function Bm(e,t,n,i,r,s,o,c,l,u,d){for(var f=r-1,m=r===0?s:[""],y=Yf(m),g=0,p=0,w=0;g<i;++g)for(var x=0,I=Ra(e,f+1,f=lI(p=o[g])),E=e;x<y;++x)(E=$p(p>0?m[x]+" "+I:Be(I,/&\f/g,m[x])))&&(l[w++]=E);return pu(e,t,n,r===0?Wf:c,l,u,d)}
2function xI(e,t,n){return pu(e,t,n,Bp,yu(mI()),Ra(e,2,-2),0)}function Vm(e,t,n,i){return pu(e,t,n,Ff,Ra(e,0,i),Ra(e,i+1,-1),i)}function uo(e,t){for(var n="",i=Yf(e),r=0;r<i;r++)n+=t(e[r],r,e,t)||"";return n}function II(e,t,n,i){switch(e.type){case cI:if(e.children.length)break;case aI:case Ff:return e.return=e.return||e.value;case Bp:return"";case Vp:return e.return=e.value+"{"+uo(e.children,i)+"}";case Wf:e.value=e.props.join(",")}return ji(n=uo(e.children,i))?e.return=e.value+"{"+n+"}":""}function MI(e){var t=Yf(e);return function(n,i,r,s){for(var o="",c=0;c<t;c++)o+=e[c](n,i,r,s)||"";return o}}function CI(e){return function(t){t.root||(t=t.return)&&e(t)}}function Hp(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var EI=function(t,n,i){for(var r=0,s=0;r=s,s=Ai(),r===38&&s===12&&(n[i]=1),!Ua(s);)Yn();return uc(t,Rn)},TI=function(t,n){var i=-1,r=44;do switch(Ua(r)){case 0:r===38&&Ai()===12&&(n[i]=1),t[i]+=EI(Rn-1,n,i);break;case 2:t[i]+=rl(r);break;case 4:if(r===44){t[++i]=Ai()===58?"&\f":"",n[i]=t[i].length;break}default:t[i]+=yu(r)}while(r=Yn());return t},vI=function(t,n){return Yp(TI(Fp(t),n))},$m=new WeakMap,LI=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,i=t.parent,r=t.column===i.column&&t.line===i.line;i.type!=="rule";)if(i=i.parent,!i)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!$m.get(i))&&!r){$m.set(t,!0);for(var s=[],o=vI(n,s),c=i.props,l=0,u=0;l<o.length;l++)for(var d=0;d<c.length;d++,u++)t.props[u]=s[l]?o[l].replace(/&\f/g,c[d]):c[d]+" "+o[l]}}},jI=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function Qp(e,t){switch(dI(e,t)){case 5103:return Ue+"print-"+e+e;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 Ue+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ue+e+Tl+e+an+e+e;case 6828:case 4268:return Ue+e+an+e+e;case 6165:return Ue+e+an+"flex-"+e+e;case 5187:return Ue+e+Be(e,/(\w+).+(:[^]+)/,Ue+"box-$1$2"+an+"flex-$1$2")+e;case 5443:return Ue+e+an+"flex-item-"+Be(e,/flex-|-self/,"")+e;case 4675:return Ue+e+an+"flex-line-pack"+Be(e,/align-content|flex-|-self/,"")+e;case 5548:return Ue+e+an+Be(e,"shrink","negative")+e;case 5292:return Ue+e+an+Be(e,"basis","preferred-size")+e;case 6060:return Ue+"box-"+Be(e,"-grow","")+Ue+e+an+Be(e,"grow","positive")+e;case 4554:return Ue+Be(e,/([^-])(transform)/g,"$1"+Ue+"$2")+e;case 6187:return Be(Be(Be(e,/(zoom-|grab)/,Ue+"$1"),/(image-set)/,Ue+"$1"),e,"")+e;case 5495:case 3959:return Be(e,/(image-set\([^]*)/,Ue+"$1$`$1");case 4968:return Be(Be(e,/(.+:)(flex-)?(.*)/,Ue+"box-pack:$3"+an+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ue+e+e;case 4095:case 3583:case 4068:case 2532:return Be(e,/(.+)-inline(.+)/,Ue+"$1$2")+e;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(ji(e)-1-t>6)switch(Yt(e,t+1)){case 109:if(Yt(e,t+4)!==45)break;case 102:return Be(e,/(.+:)(.+)-([^]+)/,"$1"+Ue+"$2-$3$1"+Tl+(Yt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Yh(e,"stretch")?Qp(Be(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Yt(e,t+1)!==115)break;case 6444:switch(Yt(e,ji(e)-3-(~Yh(e,"!important")&&10))){case 107:return Be(e,":",":"+Ue)+e;case 101:return Be(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ue+(Yt(e,14)===45?"inline-":"")+"box$3$1"+Ue+"$2$3$1"+an+"$2box$3")+e}break;case 5936:switch(Yt(e,t+11)){case 114:return Ue+e+an+Be(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ue+e+an+Be(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ue+e+an+Be(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ue+e+an+e+e}return e}var SI=function(t,n,i,r){if(t.length>-1&&!t.return)switch(t.type){case Ff:t.return=Qp(t.value,t.length);break;case Vp:return uo([qo(t,{value:Be(t.value,"@","@"+Ue)})],r);case Wf:if(t.length)return fI(t.props,function(s){switch(hI(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return uo([qo(t,{props:[Be(s,/:(read-\w+)/,":"+Tl+"$1")]})],r);case"::placeholder":return uo([qo(t,{props:[Be(s,/:(plac\w+)/,":"+Ue+"input-$1")]}),qo(t,{props:[Be(s,/:(plac\w+)/,":"+Tl+"$1")]}),qo(t,{props:[Be(s,/:(plac\w+)/,an+"input-$1")]})],r)}return""})}},DI=[SI],NI=function(t){var n=t.key;if(n==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(p){var w=p.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var r=t.stylisPlugins||DI,s={},o,c=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var w=p.getAttribute("data-emotion").split(" "),x=1;x<w.length;x++)s[w[x]]=!0;c.push(p)});var l,u=[LI,jI];{var d,f=[II,CI(function(p){d.insert(p)})],m=MI(u.concat(r,f)),y=function(w){return uo(bI(w),m)};l=function(w,x,I,E){d=I,y(w?w+"{"+x.styles+"}":x.styles),E&&(g.inserted[x.name]=!0)}}var g={key:n,sheet:new oI({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:s,registered:{},insert:l};return g.sheet.hydrate(c),g},Zp={exports:{}},Ze={};/** @license React v16.13.1
3 * react-is.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Rt=typeof Symbol=="function"&&Symbol.for,Hf=Rt?Symbol.for("react.element"):60103,Qf=Rt?Symbol.for("react.portal"):60106,wu=Rt?Symbol.for("react.fragment"):60107,_u=Rt?Symbol.for("react.strict_mode"):60108,bu=Rt?Symbol.for("react.profiler"):60114,xu=Rt?Symbol.for("react.provider"):60109,Iu=Rt?Symbol.for("react.context"):60110,Zf=Rt?Symbol.for("react.async_mode"):60111,Mu=Rt?Symbol.for("react.concurrent_mode"):60111,Cu=Rt?Symbol.for("react.forward_ref"):60112,Eu=Rt?Symbol.for("react.suspense"):60113,AI=Rt?Symbol.for("react.suspense_list"):60120,Tu=Rt?Symbol.for("react.memo"):60115,vu=Rt?Symbol.for("react.lazy"):60116,OI=Rt?Symbol.for("react.block"):60121,kI=Rt?Symbol.for("react.fundamental"):60117,zI=Rt?Symbol.for("react.responder"):60118,PI=Rt?Symbol.for("react.scope"):60119;function Qn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Hf:switch(e=e.type,e){case Zf:case Mu:case wu:case bu:case _u:case Eu:return e;
9default:switch(e=e&&e.$$typeof,e){case Iu:case Cu:case vu:case Tu:case xu:return e;default:return t}}case Qf:return t}}}function qp(e){return Qn(e)===Mu}Ze.AsyncMode=Zf;Ze.ConcurrentMode=Mu;Ze.ContextConsumer=Iu;Ze.ContextProvider=xu;Ze.Element=Hf;Ze.ForwardRef=Cu;Ze.Fragment=wu;Ze.Lazy=vu;Ze.Memo=Tu;Ze.Portal=Qf;Ze.Profiler=bu;Ze.StrictMode=_u;Ze.Suspense=Eu;Ze.isAsyncMode=function(e){return qp(e)||Qn(e)===Zf};Ze.isConcurrentMode=qp;Ze.isContextConsumer=function(e){return Qn(e)===Iu};Ze.isContextProvider=function(e){return Qn(e)===xu};Ze.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Hf};Ze.isForwardRef=function(e){return Qn(e)===Cu};Ze.isFragment=function(e){return Qn(e)===wu};Ze.isLazy=function(e){return Qn(e)===vu};Ze.isMemo=function(e){return Qn(e)===Tu};Ze.isPortal=function(e){return Qn(e)===Qf};Ze.isProfiler=function(e){return Qn(e)===bu};Ze.isStrictMode=function(e){return Qn(e)===_u};Ze.isSuspense=function(e){return Qn(e)===Eu};Ze.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===wu||e===Mu||e===bu||e===_u||e===Eu||e===AI||typeof e=="object"&&e!==null&&(e.$$typeof===vu||e.$$typeof===Tu||e.$$typeof===xu||e.$$typeof===Iu||e.$$typeof===Cu||e.$$typeof===kI||e.$$typeof===zI||e.$$typeof===PI||e.$$typeof===OI)};Ze.typeOf=Qn;Zp.exports=Ze;var RI=Zp.exports,Gp=RI,UI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},BI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Kp={};Kp[Gp.ForwardRef]=UI;Kp[Gp.Memo]=BI;var VI=!0;function Jp(e,t,n){var i="";return n.split(" ").forEach(function(r){e[r]!==void 0?t.push(e[r]+";"):r&&(i+=r+" ")}),i}var qf=function(t,n,i){var r=t.key+"-"+n.name;(i===!1||VI===!1)&&t.registered[r]===void 0&&(t.registered[r]=n.styles)},Xp=function(t,n,i){qf(t,n,i);var r=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var s=n;do t.insert(n===s?"."+r:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function $I(e){for(var t=0,n,i=0,r=e.length;r>=4;++i,r-=4)n=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(r){case 3:t^=(e.charCodeAt(i+2)&255)<<16;case 2:t^=(e.charCodeAt(i+1)&255)<<8;case 1:t^=e.charCodeAt(i)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var WI={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,scale: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},FI=!1,YI=/[A-Z]|^ms/g,HI=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ew=function(t){return t.charCodeAt(1)===45},Wm=function(t){return t!=null&&typeof t!="boolean"},_d=Hp(function(e){return ew(e)?e:e.replace(YI,"-$&").toLowerCase()}),Fm=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(HI,function(i,r,s){return Si={name:r,styles:s,next:Si},r})}return WI[t]!==1&&!ew(t)&&typeof n=="number"&&n!==0?n+"px":n},QI="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Ba(e,t,n){if(n==null)return"";var i=n;if(i.__emotion_styles!==void 0)return i;switch(typeof n){case"boolean":return"";case"object":{var r=n;if(r.anim===1)return Si={name:r.name,styles:r.styles,next:Si},r.name;var s=n;if(s.styles!==void 0){var o=s.next;if(o!==void 0)for(;o!==void 0;)Si={name:o.name,styles:o.styles,next:Si},o=o.next;var c=s.styles+";";return c}
9return ZI(e,t,n)}case"function":{if(e!==void 0){var l=Si,u=n(e);return Si=l,Ba(e,t,u)}break}}var d=n;if(t==null)return d;var f=t[d];return f!==void 0?f:d}function ZI(e,t,n){var i="";if(Array.isArray(n))for(var r=0;r<n.length;r++)i+=Ba(e,t,n[r])+";";else for(var s in n){var o=n[s];if(typeof o!="object"){var c=o;t!=null&&t[c]!==void 0?i+=s+"{"+t[c]+"}":Wm(c)&&(i+=_d(s)+":"+Fm(s,c)+";")}else{if(s==="NO_COMPONENT_SELECTOR"&&FI)throw new Error(QI);if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var l=0;l<o.length;l++)Wm(o[l])&&(i+=_d(s)+":"+Fm(s,o[l])+";");else{var u=Ba(e,t,o);switch(s){case"animation":case"animationName":{i+=_d(s)+":"+u+";";break}default:i+=s+"{"+u+"}"}}}}return i}var Ym=/label:\s*([^\s;{]+)\s*(;|$)/g,Si;function Gf(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,r="";Si=void 0;var s=e[0];if(s==null||s.raw===void 0)i=!1,r+=Ba(n,t,s);else{var o=s;r+=o[0]}for(var c=1;c<e.length;c++)if(r+=Ba(n,t,e[c]),i){var l=s;r+=l[c]}Ym.lastIndex=0;for(var u="",d;(d=Ym.exec(r))!==null;)u+="-"+d[1];var f=$I(r)+u;return{name:f,styles:r,next:Si}}var qI=function(t){return t()},GI=wm.useInsertionEffect?wm.useInsertionEffect:!1,tw=GI||qI,KI=!1,nw=_.createContext(typeof HTMLElement<"u"?NI({key:"css"}):null);nw.Provider;var iw=function(t){return _.forwardRef(function(n,i){var r=_.useContext(nw);return t(n,r,i)})},rw=_.createContext({}),Kf={}.hasOwnProperty,Qh="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",JI=function(t,n){var i={};for(var r in n)Kf.call(n,r)&&(i[r]=n[r]);return i[Qh]=t,i},XI=function(t){var n=t.cache,i=t.serialized,r=t.isStringTag;return qf(n,i,r),tw(function(){return Xp(n,i,r)}),null},e7=iw(function(e,t,n){var i=e.css;typeof i=="string"&&t.registered[i]!==void 0&&(i=t.registered[i]);var r=e[Qh],s=[i],o="";typeof e.className=="string"?o=Jp(t.registered,s,e.className):e.className!=null&&(o=e.className+" ");var c=Gf(s,void 0,_.useContext(rw));o+=t.key+"-"+c.name;var l={};for(var u in e)Kf.call(e,u)&&u!=="css"&&u!==Qh&&!KI&&(l[u]=e[u]);return l.className=o,n&&(l.ref=n),_.createElement(_.Fragment,null,_.createElement(XI,{cache:t,serialized:c,isStringTag:typeof r=="string"}),_.createElement(r,l))}),t7=e7,Hm=function(t,n){var i=arguments;if(n==null||!Kf.call(n,"css"))return _.createElement.apply(void 0,i);var r=i.length,s=new Array(r);s[0]=t7,s[1]=JI(t,n);for(var o=2;o<r;o++)s[o]=i[o];return _.createElement.apply(null,s)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(Hm||(Hm={}));function n7(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Gf(t)}function qt(){var e=n7.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}const i7=qt`
10  from {
11    opacity: 0;
12    transform: translateY(20%) scale(0.8) ;
13  }
14  to {
15    opacity: 1;
16    transform: translateY(0);
17  }
18`,r7=qt`
19  from {
20    opacity: 0;
21    transform: translateY(-20%) scale(0.8) ;
22  }
23  to {
24    opacity: 1;
25    transform: translateY(0);
26  }
27`,Rs=qt`
28  from {
29    opacity: 0;
30  }
31  to {
32    opacity: 1;
33  }
34`;var s7=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInl
34ine|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o7=Hp(function(e){return s7.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),a7=!1,c7=o7,l7=function(t){return t!=="theme"},Qm=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?c7:l7},Zm=function(t,n,i){var r;if(n){var s=n.shouldForwardProp;r=t.__emotion_forwardProp&&s?function(o){return t.__emotion_forwardProp(o)&&s(o)}:s}return typeof r!="function"&&i&&(r=t.__emotion_forwardProp),r},u7=function(t){var n=t.cache,i=t.serialized,r=t.isStringTag;return qf(n,i,r),tw(function(){return Xp(n,i,r)}),null},d7=function e(t,n){var i=t.__emotion_real===t,r=i&&t.__emotion_base||t,s,o;n!==void 0&&(s=n.label,o=n.target);var c=Zm(t,n,i),l=c||Qm(r),u=!l("as");return function(){var d=arguments,f=i&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(s!==void 0&&f.push("label:"+s+";"),d[0]==null||d[0].raw===void 0)f.push.apply(f,d);else{var m=d[0];f.push(m[0]);for(var y=d.length,g=1;g<y;g++)f.push(d[g],m[g])}var p=iw(function(w,x,I){var E=u&&w.as||r,j="",C=[],T=w;if(w.theme==null){T={};for(var v in w)T[v]=w[v];T.theme=_.useContext(rw)}typeof w.className=="string"?j=Jp(x.registered,C,w.className):w.className!=null&&(j=w.className+" ");var N=Gf(f.concat(C),x.registered,T);j+=x.key+"-"+N.name,o!==void 0&&(j+=" "+o);var M=u&&c===void 0?Qm(E):l,S={};for(var L in w)u&&L==="as"||M(L)&&(S[L]=w[L]);return S.className=j,I&&(S.ref=I),_.createElement(_.Fragment,null,_.createElement(u7,{cache:x,serialized:N,isStringTag:typeof E=="string"}),_.createElement(E,S))});return p.displayName=s!==void 0?s:"Styled("+(typeof r=="string"?r:r.displayName||r.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=r,p.__emotion_styles=f,p.__emotion_forwardProp=c,Object.defineProperty(p,"toString",{value:function(){return o===void 0&&a7?"NO_COMPONENT_SELECTOR":"."+o}}),p.withComponent=function(w,x){var I=e(w,H6({},n,x,{shouldForwardProp:Zm(p,x,!0)}));return I.apply(void 0,f)},p}},h7=["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","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","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","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],nt=d7.bind(null);
34h7.forEach(function(e){nt[e]=nt(e)});const Fe=nt.div,f7=nt.svg,m7=nt.span,y7=nt.a,$i=nt.button,g7=nt.label,p7=nt.input,w7=nt.h2,_7=nt.p,sw=nt.ul,b7=nt.select,x7=nt.option;function at(e,t){if(e==null)return{};var n={},i=Object.keys(e),r,s;for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var I7=["color"],M7=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,I7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M7.5 2C7.77614 2 8 2.22386 8 2.5L8 11.2929L11.1464 8.14645C11.3417 7.95118 11.6583 7.95118 11.8536 8.14645C12.0488 8.34171 12.0488 8.65829 11.8536 8.85355L7.85355 12.8536C7.75979 12.9473 7.63261 13 7.5 13C7.36739 13 7.24021 12.9473 7.14645 12.8536L3.14645 8.85355C2.95118 8.65829 2.95118 8.34171 3.14645 8.14645C3.34171 7.95118 3.65829 7.95118 3.85355 8.14645L7 11.2929L7 2.5C7 2.22386 7.22386 2 7.5 2Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),C7=["color"],E7=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,C7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M8.14645 3.14645C8.34171 2.95118 8.65829 2.95118 8.85355 3.14645L12.8536 7.14645C13.0488 7.34171 13.0488 7.65829 12.8536 7.85355L8.85355 11.8536C8.65829 12.0488 8.34171 12.0488 8.14645 11.8536C7.95118 11.6583 7.95118 11.3417 8.14645 11.1464L11.2929 8H2.5C2.22386 8 2 7.77614 2 7.5C2 7.22386 2.22386 7 2.5 7H11.2929L8.14645 3.85355C7.95118 3.65829 7.95118 3.34171 8.14645 3.14645Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),T7=["color"],Us=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,T7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),v7=["color"],L7=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,v7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M7.49991 0.877045C3.84222 0.877045 0.877075 3.84219 0.877075 7.49988C0.877075 11.1575 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1576 0.877045 7.49991 0.877045ZM1.82708 7.49988C1.82708 4.36686 4.36689 1.82704 7.49991 1.82704C10.6329 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6329 13.1727 7.49991 13.1727C4.36689 13.1727 1.82708 10.6329 1.82708 7.49988ZM10.1589 5.53774C10.3178 5.31191 10.2636 5.00001 10.0378 4.84109C9.81194 4.68217 9.50004 4.73642 9.34112 4.96225L6.51977 8.97154L5.35681 7.78706C5.16334 7.59002 4.84677 7.58711 4.64973 7.78058C4.45268 7.97404 4.44978 8.29061 4.64325 8.48765L6.22658 10.1003C6.33054 10.2062 6.47617 10.2604 6.62407 10.2483C6.77197 10.2363 6.90686 10.1591 6.99226 10.0377L10.1589 5.53774Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),j7=["color"],Lu=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,j7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}
34),S7=["color"],ow=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,S7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),D7=["color"],N7=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,D7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),A7=["color"],O7=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,A7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M7.50009 0.877014C3.84241 0.877014 0.877258 3.84216 0.877258 7.49984C0.877258 11.1575 3.8424 14.1227 7.50009 14.1227C11.1578 14.1227 14.1229 11.1575 14.1229 7.49984C14.1229 3.84216 11.1577 0.877014 7.50009 0.877014ZM1.82726 7.49984C1.82726 4.36683 4.36708 1.82701 7.50009 1.82701C10.6331 1.82701 13.1729 4.36683 13.1729 7.49984C13.1729 10.6328 10.6331 13.1727 7.50009 13.1727C4.36708 13.1727 1.82726 10.6328 1.82726 7.49984ZM8 4.50001C8 4.22387 7.77614 4.00001 7.5 4.00001C7.22386 4.00001 7 4.22387 7 4.50001V7.50001C7 7.63262 7.05268 7.7598 7.14645 7.85357L9.14645 9.85357C9.34171 10.0488 9.65829 10.0488 9.85355 9.85357C10.0488 9.65831 10.0488 9.34172 9.85355 9.14646L8 7.29291V4.50001Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),k7=["color"],aw=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,k7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),z7=["color"],P7=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,z7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}
34),R7=["color"],cw=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,R7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),U7=["color"],is=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,U7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704ZM9.85358 5.14644C10.0488 5.3417 10.0488 5.65829 9.85358 5.85355L8.20713 7.49999L9.85358 9.14644C10.0488 9.3417 10.0488 9.65829 9.85358 9.85355C9.65832 10.0488 9.34173 10.0488 9.14647 9.85355L7.50002 8.2071L5.85358 9.85355C5.65832 10.0488 5.34173 10.0488 5.14647 9.85355C4.95121 9.65829 4.95121 9.3417 5.14647 9.14644L6.79292 7.49999L5.14647 5.85355C4.95121 5.65829 4.95121 5.3417 5.14647 5.14644C5.34173 4.95118 5.65832 4.95118 5.85358 5.14644L7.50002 6.79289L9.14647 5.14644C9.34173 4.95118 9.65832 4.95118 9.85358 5.14644Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),B7=["color"],V7=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,B7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M3 1C2.44771 1 2 1.44772 2 2V13C2 13.5523 2.44772 14 3 14H10.5C10.7761 14 11 13.7761 11 13.5C11 13.2239 10.7761 13 10.5 13H3V2L10.5 2C10.7761 2 11 1.77614 11 1.5C11 1.22386 10.7761 1 10.5 1H3ZM12.6036 4.89645C12.4083 4.70118 12.0917 4.70118 11.8964 4.89645C11.7012 5.09171 11.7012 5.40829 11.8964 5.60355L13.2929 7H6.5C6.22386 7 6 7.22386 6 7.5C6 7.77614 6.22386 8 6.5 8H13.2929L11.8964 9.39645C11.7012 9.59171 11.7012 9.90829 11.8964 10.1036C12.0917 10.2988 12.4083 10.2988 12.6036 10.1036L14.8536 7.85355C15.0488 7.65829 15.0488 7.34171 14.8536 7.14645L12.6036 4.89645Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),$7=["color"],Jf=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,$7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H12C12.5523 13 13 12.5523 13 12V8.5C13 8.22386 12.7761 8 12.5 8C12.2239 8 12 8.22386 12 8.5V12H3V3L6.5 3C6.77614 3 7 2.77614 7 2.5C7 2.22386 6.77614 2 6.5 2H3ZM12.8536 2.14645C12.9015 2.19439 12.9377 2.24964 12.9621 2.30861C12.9861 2.36669 12.9996 2.4303 13 2.497L13 2.5V2.50049V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3.70711L6.85355 8.85355C6.65829 9.04882 6.34171 9.04882 6.14645 8.85355C5.95118 8.65829 5.95118 8.34171 6.14645 8.14645L11.2929 3H9.5C9.22386 3 9 2.77614 9 2.5C9 2.22386 9.22386 2 9.5 2H12.4999H12.5C12.5678 2 12.6324 2.01349 12.6914 2.03794C12.7504 2.06234 12.8056 2.09851 12.8536 2.14645Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),W7=["color"],Xf=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,W7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}
34),F7=["color"],Y7=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,F7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H2.75C2.47386 8 2.25 7.77614 2.25 7.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),H7=["color"],Q7=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,H7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),Z7=["color"],q7=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,Z7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M13.5 13.95C13.7485 13.95 13.95 13.7485 13.95 13.5C13.95 13.2514 13.7485 13.05 13.5 13.05L1.49995 13.05C1.25142 13.05 1.04995 13.2514 1.04995 13.5C1.04995 13.7485 1.25142 13.95 1.49995 13.95L13.5 13.95ZM11.0681 7.5683C11.2439 7.39257 11.2439 7.10764 11.0681 6.93191C10.8924 6.75617 10.6075 6.75617 10.4317 6.93191L7.94993 9.41371L7.94993 1.49998C7.94993 1.25146 7.74846 1.04998 7.49993 1.04998C7.2514 1.04998 7.04993 1.25146 7.04993 1.49998L7.04993 9.41371L4.56813 6.93191C4.39239 6.75617 4.10746 6.75617 3.93173 6.93191C3.75599 7.10764 3.75599 7.39257 3.93173 7.5683L7.18173 10.8183C7.35746 10.994 7.64239 10.994 7.81812 10.8183L11.0681 7.5683Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),G7=["color"],ju=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,G7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M8 2.75C8 2.47386 7.77614 2.25 7.5 2.25C7.22386 2.25 7 2.47386 7 2.75V7H2.75C2.47386 7 2.25 7.22386 2.25 7.5C2.25 7.77614 2.47386 8 2.75 8H7V12.25C7 12.5261 7.22386 12.75 7.5 12.75C7.77614 12.75 8 12.5261 8 12.25V8H12.25C12.5261 8 12.75 7.77614 12.75 7.5C12.75 7.22386 12.5261 7 12.25 7H8V2.75Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),K7=["color"],J7=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,K7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M7.49985 0.877045C3.84216 0.877045 0.877014 3.84219 0.877014 7.49988C0.877014 11.1575 3.84216 14.1227 7.49985 14.1227C11.1575 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1575 0.877045 7.49985 0.877045ZM1.82701 7.49988C1.82701 4.36686 4.36683 1.82704 7.49985 1.82704C10.6328 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6328 13.1727 7.49985 13.1727C4.36683 13.1727 1.82701 10.6329 1.82701 7.49988ZM7.49999 9.49999C8.60456 9.49999 9.49999 8.60456 9.49999 7.49999C9.49999 6.39542 8.60456 5.49999 7.49999 5.49999C6.39542 5.49999 5.49999 6.39542 5.49999 7.49999C5.49999 8.60456 6.39542 9.49999 7.49999 9.49999Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),X7=["color"],dc=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,X7);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M1.84998 7.49998C1.84998 4.66458 4.05979 1.84998 7.49998 1.84998C10.2783 1.84998 11.6515 3.9064 12.2367 5H10.5C10.2239 5 10 5.22386 10 5.5C10 5.77614 10.2239 6 10.5 6H13.5C13.7761 6 14 5.77614 14 5.5V2.5C14 2.22386 13.7761 2 13.5 2C13.2239 2 13 2.22386 13 2.5V4.31318C12.2955 3.07126 10.6659 0.849976 7.49998 0.849976C3.43716 0.849976 0.849976 4.18537 0.849976 7.49998C0.849976 10.8146 3.43716 14.15 7.49998 14.15C9.44382 
3414.15 11.0622 13.3808 12.2145 12.2084C12.8315 11.5806 13.3133 10.839 13.6418 10.0407C13.7469 9.78536 13.6251 9.49315 13.3698 9.38806C13.1144 9.28296 12.8222 9.40478 12.7171 9.66014C12.4363 10.3425 12.0251 10.9745 11.5013 11.5074C10.5295 12.4963 9.16504 13.15 7.49998 13.15C4.05979 13.15 1.84998 10.3354 1.84998 7.49998Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),eM=["color"],tM=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,eM);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M12.3536 1.14645C12.1583 0.951184 11.8417 0.951184 11.6464 1.14645C11.4512 1.34171 11.4512 1.65829 11.6464 1.85355L12.7929 3H12C10.7037 3 9.71111 3.58423 8.87248 4.38931C8.20065 5.03427 7.59349 5.85684 6.99461 6.6682C6.86287 6.84668 6.73154 7.02462 6.6 7.2C5.10874 9.18835 3.49037 11 0.5 11C0.223858 11 0 11.2239 0 11.5C0 11.7761 0.223858 12 0.5 12C4.00963 12 5.89126 9.81165 7.4 7.8C7.54367 7.60845 7.6832 7.41962 7.81996 7.23454L7.82005 7.23443L7.82006 7.23441C8.41674 6.42695 8.96069 5.69085 9.56502 5.11069C10.2889 4.41577 11.0463 4 12 4H12.7929L11.6464 5.14645C11.4512 5.34171 11.4512 5.65829 11.6464 5.85355C11.8417 6.04882 12.1583 6.04882 12.3536 5.85355L14.3536 3.85355C14.5488 3.65829 14.5488 3.34171 14.3536 3.14645L12.3536 1.14645ZM0.5 3C3.35278 3 5.12992 4.44588 6.50548 6.06746L6.3762 6.24266C6.2483 6.4161 6.12293 6.58609 6 6.75C5.96397 6.79804 5.92798 6.84581 5.892 6.89331C4.57348 5.29306 3.02637 4 
340.5 4C0.223858 4 0 3.77614 0 3.5C0 3.22386 0.223858 3 0.5 3ZM8.87248 10.6107C8.37284 10.131 7.90897 9.55314 7.45767 8.95468C7.64688 8.71693 7.82704 8.48061 8 8.25L8.08987 8.12987C8.58412 8.79402 9.05288 9.39766 9.56502 9.88931C10.2889 10.5842 11.0463 11 12 11H12.7929L11.6464 9.85355C11.4512 9.65829 11.4512 9.34171 11.6464 9.14645C11.8417 8.95118 12.1583 8.95118 12.3536 9.14645L14.3536 11.1464C14.5488 11.3417 14.5488 11.6583 14.3536 11.8536L12.3536 13.8536C12.1583 14.0488 11.8417 14.0488 11.6464 13.8536C11.4512 13.6583 11.4512 13.3417 11.6464 13.1464L12.7929 12H12C10.7037 12 9.71111 11.4158 8.87248 10.6107Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),nM=["color"],iM=_.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,r=at(e,nM);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),_.createElement("path",{d:"M2.5 4C2.22386 4 2 4.22386 2 4.5C2 4.77614 2.22386 5 2.5 5H12.5C12.7761 5 13 4.77614 13 4.5C13 4.22386 12.7761 4 12.5 4H2.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))});const ue=$i(e=>{const t=ee();return e.unstyled?{}:{all:"unset","[&:active]:not([disabled])":{transform:"translateY(1px)"},"&[data-disabled='true']":{"&:hover":{borderColor:"transparent"},background:t.colors.tertiaryBg,borderColor:"transparent",boxShadow:"none",color:t.colors.secondaryText},"&[disabled]":{cursor:"not-allowed"},alignItems:"center",background:(()=>{if(e.bg)return t.colors[e.bg];switch(e.variant){case"primary":return t.colors.primaryButtonBg;case"accent":return t.colors.accentButtonBg;case"secondary":return t.colors.secondaryButtonBg;default:return"none"}})(),borderRadius:J.md,boxSizing:"border-box",color:(()=>{switch(e.variant){case"primary":return t.colors.primaryButtonText;case"accent":return t.colors.accentButtonText;case"secondary":return t.colors.secondaryButtonText;case"ghost":case"ghost-solid":case"outline":return t.colors.secondaryButtonText;case"link":return t.colors.accentText;default:return t.colors.primaryButtonText}})(),cursor:"pointer",display:"inline-flex",flexShrink:0,fontSize:ie.sm,fontWeight:500,gap:e.gap&&R[e.gap]||0,justifyContent:"center",lineHeight:"normal",maxWidth:"100%",padding:`${ie.sm} ${ie.sm}`,textAlign:"center",transition:"border 200ms ease",WebkitTapHighlightColor:"transparent",width:e.fullWidth?"100%":void 0,"&:hover":{background:e.hoverBg?t.colors[e.hoverBg]:void 0},...e.variant==="outline"?{"&:hover":{borderColor:t.colors.accentText},'&[aria-selected="true"]':{borderColor:t.colors.accentText},border:`1px solid ${t.colors.borderColor}`}:e.variant==="ghost"?{"&:hover":{borderColor:t.colors.accentText},border:"1px solid transparent"}:e.variant==="ghost-solid"?{"&:hover":{background:t.colors[e.hoverBg||"tertiaryBg"]},border:"1px solid transparent"}:e.variant==="accent"?{"&:hover":{opacity:.8}}:e.variant==="secondary"?{"&:hover":{background:t.colors[e.hoverBg||"secondaryButtonHoverBg"]}}:e.variant==="link"?{"&:hover":{color:t.colors.primaryText},padding:0}:{}}}),lw=ue.withComponent("a"),rr=$i(e=>{const t=ee();return{all:"unset","&:hover":{background:t.colors.secondaryIconHoverBg,color:t.colors.secondaryIconHoverColor},"&[disabled]":{cursor:"not-allowed"},alignItems:"center",borderRadius:J.sm,color:t.colors.secondaryIconColor,cursor:"pointer",display:"inline-flex",justifyContent:"center",padding:"2px",transition:"background 200ms ease, color 200ms ease",WebkitTapHighlightColor:"transparent"}}),Su=w7(e=>({color:ee().colors.primaryText,fontSize:ie.lg,fontWeight:500,lineHeight:1.3,margin:0,letterSpacing:"-0.025em",textAlign:"left"})),rM=e=>a.jsx(rr,{className:"tw-back-button",onClick:e.onClick,style:{transform:"translateX(-25%)",...e.style},type:"button",children:a.jsx(ow,{height:D.md,width:D.md})}),uw=Fe(e=>({borderTop:`1px solid ${ee().colors.separatorLine}
34`,display:"flex",flexDirection:"column",gap:R.md,padding:R.lg})),hc={"&::-webkit-scrollbar":{display:"none",width:0},scrollbarWidth:"none"};function Me(e){const{onBack:t,title:n}=e;return a.jsxs("div",{className:Up("tw-header",e.className),style:{alignItems:"center",display:"flex",justifyContent:e.leftAligned?"flex-start":"center",position:"relative"},children:[t&&a.jsx(rM,{onClick:t,style:{left:0,position:"absolute",top:0}}),a.jsx(b,{center:"both",flex:"row",gap:"xs",children:typeof n=="string"?a.jsx(Su,{children:n}):n})]})}const He=Fe(e=>{const t=ee();return{borderTop:`1px ${e.dashed?"dashed":"solid"} ${t.colors.separatorLine}`}});function b(e){const t={};return e.relative&&(t.position="relative"),e.fullHeight&&(t.height="100%"),e.expand&&(t.flex="1 1 0%"),e.flex&&(t.display="flex",t.flexDirection=e.flex,e.flex==="row"&&(t.flexWrap="wrap"),e.gap&&(t.gap=R[e.gap]),e.center&&(e.center==="both"&&(t.justifyContent="center",t.alignItems="center"),(e.center==="x"&&e.flex==="row"||e.center==="y"&&e.flex==="column")&&(t.justifyContent="center"),(e.center==="x"&&e.flex==="column"||e.center==="y"&&e.flex==="row")&&(t.alignItems="center"))),e.p&&(t.padding=R[e.p]),e.px&&(t.paddingLeft=R[e.px],t.paddingRight=R[e.px]),e.py&&(t.paddingTop=R[e.py],t.paddingBottom=R[e.py]),e.pb&&(t.paddingBottom=R[e.pb]),e.pt&&(t.paddingTop=R[e.pt]),e.debug&&(t.outline="1px solid red",t.outlineOffset="-1px"),a.jsx(sM,{bg:e.bg,borderColor:e.borderColor,color:e.color,"data-animate":e.animate,"data-scrolly":e.scrollY,className:e.className,style:{...t,...e.style},children:e.children})}const sM=Fe(e=>{const t=ee();return{"&[data-animate='fadein']":{animation:`${Rs} 350ms ease forwards`,opacity:0},"&[data-animate='floatdown']":{animation:`${r7} 350ms ease forwards`,opacity:0},"&[data-animate='floatup']":{animation:`${i7} 350ms ease forwards`,opacity:0},"&[data-scrolly='true']":{overflowY:"auto",...hc},background:e.bg?t.colors[e.bg]:void 0,borderColor:e.borderColor?t.colors[e.borderColor]:void 0,color:e.color?t.colors[e.color]:"inherit"}}),Qe=e=>{const t=ee();return a.jsxs(cM,{style:{height:`${D[e.size]}px`,width:`${D[e.size]}px`,...e.style},viewBox:"0 0 50 50",className:"tw-spinner",children:[a.jsx("circle",{cx:"25",cy:"25",fill:"none",r:"20",style:{strokeLinecap:"round",animation:"tw-spinner-circle-dash 1.5s ease-in-out infinite"},stroke:e.color?t.colors[e.color]:"currentColor",strokeWidth:Number(D[e.size])>64?"2":"4"}),a.jsx("style",{children:oM})]})},oM=`
35@keyframes tw-spinner-circle-dash {
36  0% {
37    stroke-dasharray: 1, 150;
38    stroke-dashoffset: 0;
39  }
40  50% {
41    stroke-dasharray: 90, 150;
42    stroke-dashoffset: -35;
43  }
44  100% {
45    stroke-dasharray: 90, 150;
46    stroke-dashoffset: -124;
47  }
48`,aM=qt`
49  100% {
50    transform: rotate(360deg);
51  }
52`,cM=f7({animation:`${aM} 2s linear infinite`,height:"1em",width:"1em"});function Mt(e){return a.jsx(b,{center:"both",flex:"row",fullHeight:!0,style:{minHeight:e.height||"350px"},children:a.jsx(Qe,{color:"secondaryText",size:"xl"})})}async function Uo(e,t,n){return Ui(async()=>{const r=(await zf({chainId:n,client:e,tokenAddress:t}))[0];return r||await p9({chainId:n,client:e,tokenAddress:t}).catch(()=>{throw new Error("Token not supported")})},{cacheKey:`get-token-price-${t}-${n}`,cacheTime:1e3*60})}const vs=e=>{const t=_.useId(),n=_.useId();return a.jsxs("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 109 109",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:[a.jsxs("g",{clipPath:`url(#${n})`,children:[a.jsx("path",{d:"M54.5 109C84.5995 109 109 84.5995 109 54.5C109 24.4005 84.5995 0 54.5 0C24.4005 0 0 24.4005 0 54.5C0 84.5995 24.4005 109 54.5 109Z",fill:"#4BABFF"}),a.jsx("path",{d:"M55 96C77.6437 96 96 77.6437 96 55C96 32.3563 77.6437 14 55 14C32.3563 14 14 32.3563 14 55C14 77.6437 32.3563 96 55 96Z",fill:"#1C85FF"}),a.jsx("path",{d:"M73.2352 69.389C73.7459 69.8997 74.0329 70.5924 74.0329 71.3147C74.0329 72.037 73.7459 72.7298 73.2352 73.2405C72.7244 73.7513 72.0317 74.0382 71.3094 74.0382C70.5871 74.0382 69.8944 73.7513 69.3836 73.2405L54.9992 58.8515L40.6102 73.236C40.0994 73.7467 39.4067 74.0337 38.6844 74.0337C37.9621 74.0337 37.2694 73.7467 36.7586 73.236C36.2479 72.7252 35.9609 72.0325 35.9609 71.3102C35.9609 70.5879 36.2479 69.8952 36.7586 69.3844L51.1476 55L36.7632 40.611C36.2524 40.1002 35.9655 39.4075 35.9655 38.6852C35.9655 37.9629 36.2524 37.2702 36.7632 36.7594C37.2739 36.2487 37.9666 35.9617 38.6889 35.9617C39.4112 35.9617 40.104 36.2487 40.6147 36.7594L54.9992 51.1484L69.3881 36.7572C69.8989 36.2464 70.5916 35.9595 71.3139 35.9595C72.0362 35.9595 72.729 36.2464 73.2397 36.7572C73.7505 37.2679 74.0374 37.9606 74.0374 38.6829C74.0374 39.4052 73.7505 40.098 73.2397 40.6087L58.8507 55L73.2352 69.389Z",fill:`url(#${t})`})]}),a.jsxs("defs",{children:[a.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:t,x1:"54.9992",x2:"54.9992",y1:"35.9595",y2:"74.0382",children:[a.jsx("stop",{stopColor:"white"}),a.jsx("stop",{offset:"1",stopColor:"#90CBFF"})]}),a.jsx("clipPath",{id:n,children:a.jsx("rect",{fill:"white",height:"109",width:"109"})})]})]})};async function lM(e){switch(e){case"es_ES":return(await h(async()=>{const{default:t}=await import("./es-VJyYb90S.js");return{default:t}},[])).default;case"ja_JP":return(await h(async()=>{const{default:t}=await import("./ja-DJMSrON6.js");return{default:t}},[])).default;case"tl_PH":return(await h(async()=>{const{default:t}=await import("./tl-CRo3FF6E.js");return{default:t}},[])).default;case"vi_VN":return(await h(async()=>{const{default:t}=await import("./vi-UZskHqr3.js");return{default:t}},[])).default;case"de_DE":return(await h(async()=>{const{default:t}=await import("./de-CGYpD2SG.js");return{default:t}},[])).default;
52case"ko_KR":return(await h(async()=>{const{default:t}=await import("./kr-5lmSzexK.js");return{default:t}},[])).default;case"fr_FR":return(await h(async()=>{const{default:t}=await import("./fr-Dw9xCc6Y.js");return{default:t}},[])).default;case"ru_RU":return(await h(async()=>{const{default:t}=await import("./ru-BiwauFaO.js");return{default:t}},[])).default;case"pt_BR":return(await h(async()=>{const{default:t}=await import("./br-B9BLCi07.js");return{default:t}},[])).default;case"zh_CN":return(await h(async()=>{const{default:t}=await import("./zh-uWVXxi-t.js");return{default:t}},[])).default;default:return(await h(async()=>{const{default:t}=await Promise.resolve().then(()=>vT);return{default:t}},void 0)).default}}function e1(e){return pe({queryFn:async()=>lM(e),queryKey:["connect-locale",e],refetchOnMount:!1,refetchOnWindowFocus:!1})}const Wn="com.coinbase.wallet",Br="org.base.account",t1="io.metamask",dw="me.rainbow",hw="io.zerion.wallet",uM=["inApp","embedded","smart","xyz.abs"];function n1(e){return e.startsWith("http://")||e.startsWith("https://")}function fw(e,t){if(!n1(e))return mw(e,t);let n=e;n.endsWith("/")||(n=`${n}/`);const i=encodeURIComponent(t);return{href:n,redirect:`${n}wc?uri=${i}`}}function mw(e,t){if(n1(e))return fw(e,t);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`);const i=encodeURIComponent(t);return{href:n,redirect:`${n}wc?uri=${i}`}}function yw(e,t){return n1(e)?fw(e,t):mw(e,t)}function gw(e,t){return`${e.endsWith("/")?e:`${e}/`}tx/${t}`}function dM(e,t){return`${e.endsWith("/")?e:`${e}/`}address/${t}`}function hM(){if(typeof navigator>"u")return!1;const e=A4(navigator.userAgent);return e?e.toLowerCase().includes("android"):!1}function fM(){if(typeof navigator>"u")return!1;const e=A4(navigator.userAgent);return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function mM(){return typeof window>"u"||typeof navigator>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function yM(){return typeof window>"u"?!1:"orientation"in window||"onorientationchange"in window}function sr(){return!!(hM()||fM()||mM()&&yM()||typeof window<"u"&&window.innerWidth<640)}function Wr(e){if(window!==window.top)window.open(e);else if(e.startsWith("http")){const n=document.createElement("a");n.href=e,n.target="_blank",n.rel="noreferrer noopener",n.click()}else window.location.href=e}function gM(e){const{createOptions:t}=e,n=su();let i,r;function s(){i=void 0,r=void 0}let o=async()=>{},c=async d=>{r=d};const l=n.subscribe("chainChanged",d=>{r=d}),u=n.subscribe("disconnect",()=>{s(),l(),u()});return n.subscribe("accountChanged",d=>{i=d}),{autoConnect:async d=>{const{autoConnectBaseAccountSDK:f}=await h(async()=>{const{autoConnectBaseAccountSDK:x}=await Promise.resolve().then(()=>Gm);return{autoConnectBaseAccountSDK:x}},void 0),m=await e.providerFactory(),[y,g,p,w]=await f(d,n,m);return i=y,r=g,o=p,c=w,Di({chainId:r.id,client:d.client,walletAddress:i.address,walletType:Br}),i},connect:async d=>{const{connectBaseAccountSDK:f}=await h(async()=>{const{connectBaseAccountSDK:x}=await Promise.resolve().then(()=>Gm);return{connectBaseAccountSDK:x}},void 0),m=await e.providerFactory(),[y,g,p,w]=await f(d,n,m);return i=y,r=g,o=p,c=w,Di({chainId:r.id,client:d.client,walletAddress:i.address,walletType:Br}),i},disconnect:async()=>{s(),await o()},getAccount:()=>i,getChain(){if(r)return r=iu(r.id)||r,r},getConfig:()=>t,id:Br,subscribe:n.subscribe,switchChain:async d=>{await c(d)}}}function i1(e){return pM(e).map(t=>{try{const n=new URL(t);return n.hostname.endsWith(".thirdweb.com")&&(n.pathname="",n.search=""),n.toString()}catch{return t}})}function pM(e,t,n="http"){const i=[];for(const r of e.rpc)n==="http"&&!r.startsWith("http")||n==="ws"&&!r.startsWith("ws")||(r.includes("${THIRDWEB_API_KEY}")?i.push(r.replace("${THIRDWEB_API_KEY}","")):r.includes("${")||i.push(r));if(i.length===0)throw new Error(`No RPC available for chainId "${e.chainId}" with mode ${n}`);return i}function wM(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}function _M(){return typeof _n<"u"&&typeof _n.versions<"u"&&typeof _n.versions.node<"u"}function pw(){return!wM()&&!_M()}function vl(){if(!pw())return{description:"thirdweb powered dApp",logoUrl:"https://thirdweb.com/favicon.ico",name:"thirdweb powered dApp",url:"https://thirdweb.com"};const{protocol:e,hostname:t,port:n}=window.location;let i=`${e}//${t}`;n&&n!=="80"&&n!=="443"&&(i+=`:${n}`);const r=`${i}/favicon.ico`;return{description:window.document.title||"thirdweb powered dApp",logoUrl:r,name:window.document.title||"thirdweb powered dApp",url:i}}function pi(e){return typeof e=="number"?e:df(e)?P4(e):typeof e=="bigint"?Number(e):Number.parseInt(e,10)}let bd,Oc;async function ww(e){var s,o,c,l,u,d,f;if(bd){if(e&&Oc){const m=((s=Oc.chains)==null?void 0:s.map(w=>w.id))||[],y=((o=e.chains)==null?void 0:o.map(w=>w.id))||[],g=m.length===y.length&&m.every((w,x)=>w===y[x]),p=((c=e.appMetadata)==null?void 0:c.name)===((l=Oc.appMetadata)==null?void 0:l.name);(!g||!p)&&console.warn("[Base Account SDK] Provider already initialized with different options. The Base Account SDK uses a singleton provider - subsequent configurations are ignored. Create only one Base Account wallet instance per application.")}return bd}const{createBaseAccountSDK:t}=await h(async()=>{const{createBaseAccountSDK:m}=await import("./index-BXaxSJrg.js");return{createBaseAccountSDK:m}},__vite__mapDeps([21,22,3,6,23,2,4,5,7,8,9,1,24,25,26,10,11,12,13,14,15])),n=vl(),r=t({appName:((u=e==null?void 0:e.appMetadata)==null?void 0:u.name)||n.name||"thirdweb powered dApp",appLogoUrl:((d=e==null?void 0:e.appMetadata)==null?void 0:d.logoUrl)||n.logoUrl||null,appChainIds:((f=e==null?void 0:e.chains)==null?void 0:f.map(m=>m.id))||[]}).getProvider();return bd=r,Oc=e,r}function qm({provider:e,address:t,client:n}){const i={address:_e(t),async sendTransaction(r){const s=await e.request({method:"eth_sendTransaction",params:[{accessList:r.accessList,data:r.data,from:_e(t),gas:r.gas?ln(r.gas):void 0,to:r.to,value:r.value?ln(r.value):void 0}]});return pf({chainId:r.chainId,client:n,contractAddress:r.to??void 0,gasPrice:r.gasPrice,transactionHash:s,walletAddress:_e(t),walletType:Br}),{transactionHash:s}},async signMessage({message:r}){if(!i.address)throw new Error("Provider not setup");const s=typeof r=="string"?ff(r):r.raw instanceof Uint8Array?ou(r.raw):r.raw,o=await e.request({method:"personal_sign",params:[s,i.address]});if(!wl(o))throw new Error("Invalid signature returned");return o},async signTypedData(r){if(!i.address)throw new Error("Provider not setup");const{domain:s,message:o,primaryType:c}=wf(r),l={EIP712Domain:q4(s),...r.types};G4({domain:s,message:o,primaryType:c,types:l});const u=K4({domain:s??{},message:o,primaryType:c,types:l}),d=await e.request({method:"eth_signTypedData_v4",params:[i.address,u]});if(!wl(d))throw new Error("Invalid signed payload returned");return d},sendCalls:async r=>{try{const{callParams:s,chain:o}=await fu(r,i),c=await e.request({method:"wallet_sendCalls",params:s});return c&&typeof c=="object"&&"id"in c?{chain:o,client:n,id:c.id}:{chain:o,client:n,id:c}}catch(s){throw/unsupport|not support/i.test(s.message)?new Error(`${Br} errored calling wallet_sendCalls, with error: ${s instanceof Error?s.message:Zt
52(s)}`):s}},async getCallsStatus(r){try{const s=await e.request({method:"wallet_getCallsStatus",params:[r.id]});return Rf(s)}catch(s){throw/unsupport|not support/i.test(s.message)?new Error(`${Br} does not support wallet_getCallsStatus, reach out to them directly to request EIP-5792 support.`):s}},async getCapabilities(r){const s=r.chainId;try{const o=await e.request({method:"wallet_getCapabilities",params:[_e(i.address)]});return Pf(o,s)}catch(o){if(/unsupport|not support|not available/i.test(o.message))return{message:`${Br} does not support wallet_getCapabilities, reach out to them directly to request EIP-5792 support.`};throw o}}};return i}function _w(e,t,n,i,r){const s=qm({address:e,client:r,provider:n});async function o(){n.off("accountsChanged",l),n.off("chainChanged",u),n.off("disconnect",c),await n.disconnect()}async function c(){o(),i.emit("disconnect",void 0)}function l(d){if(d[0]){const f=qm({address:_e(d[0]),client:r,provider:n});i.emit("accountChanged",f),i.emit("accountsChanged",d)}else c()}function u(d){const f=Ge(pi(d));i.emit("chainChanged",f)}return n.on("accountsChanged",l),n.on("chainChanged",u),n.on("disconnect",c),[s,t,c,d=>bw(n,d)]}async function bM(e,t,n){const i=await n.request({method:"eth_requestAccounts"});if(!i[0])throw new Error("No accounts found");const r=_e(i[0]),s=await n.request({method:"eth_chainId"}),o=pi(s);let c=e.chain&&e.chain.id===o?e.chain:Ge(o);return o&&(e!=null&&e.chain)&&o!==(e==null?void 0:e.chain.id)&&(await bw(n,e.chain),c=e.chain),_w(r,c,n,t,e.client)}async function xM(e,t,n){const r=(await n.request({method:"eth_accounts"}))[0];if(!r)throw new Error("No accounts found");const s=await n.request({method:"eth_chainId"}),o=pi(s),c=e.chain&&e.chain.id===o?e.chain:Ge(o);return _w(r,c,n,t,e.client)}async function bw(e,t){var s;const n=await e.request({method:"eth_chainId"}),i=Ge(pi(n));if((i==null?void 0:i.id)===t.id)return;const r=ln(t.id);try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]})}catch(o){const c=await Ht(t);(o==null?void 0:o.code)===4902&&await e.request({method:"wallet_addEthereumChain",params:[{blockExplorerUrls:((s=c.explorers)==null?void 0:s.map(l=>l.url))||[],chainId:r,chainName:c.name,nativeCurrency:c.nativeCurrency,rpcUrls:i1(c)}]})}}const Gm=Object.freeze(Object.defineProperty({__proto__:null,autoConnectBaseAccountSDK:xM,connectBaseAccountSDK:bM,getBaseAccountWebProvider:ww},Symbol.toStringTag,{value:"Module"}));function IM(e){const{createOptions:t}=e,n=su();let i,r;function s(){i=void 0,r=void 0}let o=async()=>{},c=async d=>{r=d};const l=n.subscribe("chainChanged",d=>{r=d}),u=n.subscribe("disconnect",()=>{s(),l(),u()});return n.subscribe("accountChanged",d=>{i=d}),{autoConnect:async d=>{const{autoConnectCoinbaseWalletSDK:f}=await h(async()=>{const{autoConnectCoinbaseWalletSDK:x}=await Promise.resolve().then(()=>Zh);return{autoConnectCoinbaseWalletSDK:x}},void 0),m=await e.providerFactory(),[y,g,p,w]=await f(d,n,m);return i=y,r=g,o=p,c=w,Di({chainId:r.id,client:d.client,walletAddress:i.address,walletType:Wn}),i},connect:async d=>{const{connectCoinbaseWalletSDK:f}=await h(async()=>{const{connectCoinbaseWalletSDK:x}=await Promise.resolve().then(()=>Zh);return{connectCoinbaseWalletSDK:x}},void 0),m=await e.providerFactory(),[y,g,p,w]=await f(d,n,m);return i=y,r=g,o=p,c=w,Di({chainId:r.id,client:d.client,walletAddress:i.address,walletType:Wn}),i},disconnect:async()=>{s(),await o()},getAccount:()=>i,getChain(){if(r)return r=iu(r.id)||r,r},getConfig:()=>t,id:Wn,onConnectRequested:async()=>{var d;if(e.onConnectRequested){const f=await e.providerFactory();return(d=e.onConnectRequested)==null?void 0:d.call(e,f)}},subscribe:n.subscribe,switchChain:async d=>{await c(d)}}}async function xw(e){var t,n;await((n=(t=e==null?void 0:e.communicator)==null?void 0:t.waitForPopupLoaded)==null?void 0:n.call(t))}const MM=Object.freeze(Object.defineProperty({__proto__:null,showCoinbasePopup:xw},Symbol.toStringTag,{value:"Module"}));let xd;async function Iw(e){var t,n;if(!xd){let i=(await h(()=>import("./index-C2Jl551l.js"),__vite__mapDeps([27,6,3,2,4,5,7,8,9,22,10,1,11,12,13,14,15]))).default;typeof i!="function"&&typeof i.default=="function"&&(i=i.default);const s=new i({appChainIds:e!=null&&e.chains?e.chains.map(o=>o.id):void 0,appLogoUrl:((t=e==null?void 0:e.appMetadata)==null?void 0:t.logoUrl)||vl().logoUrl,appName:((n=e==null?void 0:e.appMetadata)==null?void 0:n.name)||vl().name}).makeWeb3Provider(e==null?void 0:e.walletConfig);return xd=s,s}return xd}function Km({provider:e,address:t,client:n}){const i={address:_e(t),onTransactionRequested:async()=>{window.localStorage&&window.localStorage.getItem("-CBWSDK:SignerConfigurator:SignerType")==="scw"&&await xw(e)},async sendTransaction(r){const s=await e.request({method:"eth_sendTransaction",params:[{accessList:r.accessList,data:r.data,from:_e(t),gas:r.gas?ln(r.gas):void 0,to:r.to,value:r.value?ln(r.value):void 0}]});return pf({chainId:r.chainId,client:n,contractAddress:r.to??void 0,gasPrice:r.gasPrice,transactionHash:s,walletAddress:_e(t),walletType:Wn}),{transactionHash:s}},async signMessage({message:r}){if(!i.address)throw new Error("Provider not setup");const s=typeof r=="string"?ff(r):r.raw instanceof Uint8Array?ou(r.raw):r.raw,o=await e.request({method:"personal_sign",params:[s,i.address]});if(!wl(o))throw new Error("Invalid signature returned");return o},async signTypedData(r){if(!i.address)throw new Error("Provider not setup");const{domain:s,message:o,primaryType:c}=wf(r),l={EIP712Domain:q4(s),...r.types};G4({domain:s,message:o,primaryType:c,types:l});const u=K4({domain:s??{},message:o,primaryType:c,types:l}),d=await e.request({method:"eth_signTypedData_v4",params:[i.address,u]});if(!wl(d))throw new Error("Invalid signed payload returned");return d},sendCalls:async r=>{try{const{callParams:s,chain:o}=await fu(r,i),c=await e.request({method:"wallet_sendCalls",params:s});return c&&typeof c=="object"&&"id"in c?{chain:o,client:n,id:c.id}:{chain:o,client:n,id:c}}catch(s){throw/unsupport|not support/i.test(s.message)?new Error(`${Wn} errored calling wallet_sendCalls, with error: ${s instanceof Error?s.message:Zt
52(s)}`):s}},async getCallsStatus(r){try{const s=await e.request({method:"wallet_getCallsStatus",params:[r.id]});return Rf(s)}catch(s){throw/unsupport|not support/i.test(s.message)?new Error(`${Wn} does not support wallet_getCallsStatus, reach out to them directly to request EIP-5792 support.`):s}},async getCallsStatusRaw(r){try{return await e.request({method:"wallet_getCallsStatus",params:[r.id]})}catch(s){throw/unsupport|not support/i.test(s.message)?new Error(`${Wn} does not support wallet_getCallsStatus, reach out to them directly to request EIP-5792 support.`):s}},async getCapabilities(r){const s=r.chainId;try{const o=await e.request({method:"wallet_getCapabilities",params:[_e(i.address)]});return Pf(o,s)}catch(o){if(/unsupport|not support|not available/i.test(o.message))return{message:`${Wn} does not support wallet_getCapabilities, reach out to them directly to request EIP-5792 support.`};throw o}}};return i}function Mw(e,t,n,i,r){const s=Km({address:e,client:r,provider:n});async function o(){n.removeListener("accountsChanged",l),n.removeListener("chainChanged",u),n.removeListener("disconnect",c),await n.disconnect()}async function c(){o(),i.emit("disconnect",void 0)}function l(d){if(d[0]){const f=Km({address:_e(d[0]),client:r,provider:n});i.emit("accountChanged",f),i.emit("accountsChanged",d)}else c()}function u(d){const f=Ge(pi(d));i.emit("chainChanged",f)}return n.on("accountsChanged",l),n.on("chainChanged",u),n.on("disconnect",c),[s,t,c,d=>Cw(n,d)]}async function CM(e,t,n){const i=await n.request({method:"eth_requestAccounts"});if(!i[0])throw new Error("No accounts found");const r=_e(i[0]),s=await n.request({method:"eth_chainId"}),o=pi(s);let c=e.chain&&e.chain.id===o?e.chain:Ge(o);return o&&(e!=null&&e.chain)&&o!==(e==null?void 0:e.chain.id)&&(await Cw(n,e.chain),c=e.chain),Mw(r,c,n,t,e.client)}async function EM(e,t,n){const r=(await n.request({method:"eth_accounts"}))[0];if(!r)throw new Error("No accounts found");const s=await n.request({method:"eth_chainId"}),o=pi(s),c=e.chain&&e.chain.id===o?e.chain:Ge(o);return Mw(r,c,n,t,e.client)}async function Cw(e,t){var s;const n=await e.request({method:"eth_chainId"}),i=Ge(pi(n));if((i==null?void 0:i.id)===t.id)return;const r=ln(t.id);try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]})}catch(o){const c=await Ht(t);(o==null?void 0:o.code)===4902&&await e.request({method:"wallet_addEthereumChain",params:[{blockExplorerUrls:((s=c.explorers)==null?void 0:s.map(l=>l.url))||[],chainId:r,chainName:c.name,nativeCurrency:c.nativeCurrency,rpcUrls:i1(c)}]})}}const Zh=Object.freeze(Object.defineProperty({__proto__:null,autoConnectCoinbaseWalletSDK:EM,connectCoinbaseWalletSDK:CM,getCoinbaseWebProvider:Iw},Symbol.toStringTag,{value:"Module"}));async function Ew(e){return Ui(async()=>{var i;const n=await(await fetch(`${St("inAppWallet")}/api/2024-05-05/ecosystem-wallet`,{headers:{"x-ecosystem-id":e}})).json();if(!n||n.code==="UNAUTHORIZED")throw new Error(n.message||`Could not find ecosystem wallet with id ${e}, please check your ecosystem wallet configuration.`);return(i=n.authOptions)!=null&&i.includes("siwe")&&(n.authOptions=n.authOptions.filter(r=>r!=="siwe"),n.authOptions.push("wallet")),n},{cacheKey:`ecosystem-wallet-options-${e}`,cacheTime:1e3*60*5})}const Id=new Map;async function wa(e,t,n){var s;const i=Zt({clientId:e.clientId,ecosystem:n,partialSecretKey:(s=e.secretKey)==null?void 0:s.slice(0,5)});if(Id.has(i))return Id.get(i);const r=await t(e);return Id.set(i,r),r}function Tw(e){const{createOptions:t,connectorFactory:n,ecosystem:i}=e,r=i?i.id:"inApp",s=su();let o=t,c,l,u,d,f=null;const m=async y=>{if(i){const g=await Ew(i.id),p=g==null?void 0:g.smartAccountOptions;if(p)if(g.smartAccountOptions.executionMode==="EIP7702")o={...o,executionMode:{mode:"EIP7702",sponsorGas:p.sponsorGas}};else{const{defaultChainId:x}=g.smartAccountOptions,I=(y==null?void 0:y.chain)??(x?Ge(x):void 0);if(!I)throw new Error("A chain must be provided either via 'chain' in connect options or 'defaultChainId' in ecosystem configuration. Please pass it via connect() or update the ecosystem configuration.");o={...o,smartAccount:{chain:I,factoryAddress:p.accountFactoryAddress,sponsorGas:p.sponsorGas}}}}};return{autoConnect:async y=>{const{autoConnectInAppWallet:g}=await h(async()=>{const{autoConnectInAppWallet:E}=await Promise.resolve().then(()=>Td);return{autoConnectInAppWallet:E}},void 0),p=await wa(y.client,n,i);await m();const{account:w,chain:x,adminAccount:I}=await g(y,o,p);d=y.client,c=w,l=I,u=x;try{f=await p.storage.getAuthCookie()}catch(E){console.error("Failed to retrieve auth token:",E),f=null}return Di({chainId:u.id,client:y.client,ecosystem:i,walletAddress:c.address,walletType:r}),c},connect:async y=>{const{connectInAppWallet:g}=await h(async()=>{const{connectInAppWallet:E}=await Promise.resolve().then(()=>Td);return{connectInAppWallet:E}},void 0),p=await wa(y.client,n,i);await m();const{account:w,chain:x,adminAccount:I}=await g(y,o,p);d=y.client,c=w,l=I,u=x;try{f=await p.storage.getAuthCookie()}catch(E){console.error("Failed to retrieve auth token:",E),f=null}return Di({chainId:u.id,client:y.client,ecosystem:i,walletAddress:c.address,walletType:r}),c},disconnect:async()=>
52{if(d&&!(await(await wa(d,n,i)).logout()).success)throw new Error("Failed to logout");c=void 0,l=void 0,u=void 0,f=null,s.emit("disconnect",void 0)},getAccount:()=>c,getAdminAccount:()=>l,getAuthToken:()=>f,getChain(){if(u)return u=iu(u.id)||u,u},getConfig:()=>o,id:r,subscribe:s.subscribe,switchChain:async y=>{var g;if((o!=null&&o.smartAccount||((g=o==null?void 0:o.executionMode)==null?void 0:g.mode)==="EIP4337")&&d&&c){const{autoConnectInAppWallet:p}=await h(async()=>{const{autoConnectInAppWallet:j}=await Promise.resolve().then(()=>Td);return{autoConnectInAppWallet:j}},void 0),w=await wa(d,n,i);await m({chain:y});const{account:x,chain:I,adminAccount:E}=await p({chain:y,client:d},o,w);l=E,c=x,u=I}else u=y;s.emit("chainChanged",y)}}}function TM(...e){const[t,n]=e,i={id:t,partnerId:n==null?void 0:n.partnerId};return Tw({connectorFactory:async r=>{const{InAppWebConnector:s}=await h(async()=>{const{InAppWebConnector:o}=await import("./web-connector-BqSB86Fz.js");return{InAppWebConnector:o}},__vite__mapDeps([28,7,4,3,6,8,9,5,2,1,29,30,10,11,12,13,14,15]));return new s({client:r,ecosystem:i,storage:n==null?void 0:n.storage})},createOptions:{auth:{...n==null?void 0:n.auth,options:[]},partnerId:i.partnerId},ecosystem:i})}function vw(e){return Tw({connectorFactory:async t=>{var i;const{InAppWebConnector:n}=await h(async()=>{const{InAppWebConnector:r}=await import("./web-connector-BqSB86Fz.js");return{InAppWebConnector:r}},__vite__mapDeps([28,7,4,3,6,8,9,5,2,1,29,30,10,11,12,13,14,15]));return new n({client:t,passkeyDomain:(i=e==null?void 0:e.auth)==null?void 0:i.passkeyDomain,storage:e==null?void 0:e.storage})},createOptions:e})}function vM(e){if(typeof window>"u")return;const t=n=>e(n.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}function LM(){const e=new Set;let t=[];const n=()=>vM(r=>{t.some(({info:s})=>s.uuid===r.info.uuid)||(t=[...t,r],e.forEach(s=>s(t,{added:[r]})))});let i=n();return{_listeners(){return e},clear(){e.forEach(r=>r([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),i==null||i()},findProvider({rdns:r}){return t.find(s=>s.info.rdns===r)},getProviders(){return t},reset(){this.clear(),i==null||i(),i=n()},subscribe(r,{emitImmediately:s}={}){return e.add(r),s&&r(t,{added:t}),()=>e.delete(r)}}}const Jm=pw()?LM():void 0;function r1(e){const t=or().find(n=>n.info.rdns===e);return t==null?void 0:t.provider}function jM(){if(Jm)return Jm}function or(){var t;const e=((t=jM())==null?void 0:t.getProviders())||[];for(const n of e)if(n.info.rdns==="io.metamask.mobile"){n.info.rdns=t1;break}return e}const Ll=Object.freeze(Object.defineProperty({__proto__:null,getInstalledWalletProviders:or,injectedProvider:r1},Symbol.toStringTag,{value:"Module"}));function qh(e){const t=r1(e);if(!t)throw new Error(`No injected provider found for wallet: "${e}"`);return t}async function SM({id:e,provider:t,emitter:n,client:i,chain:r}){var m,y;let s,c=0;for(;!(s!=null&&s[0])&&c<3;){try{s=await t.request({method:"eth_requestAccounts"})}catch(g){if(console.error(g),(y=(m=NM(g))==null?void 0:m.toLowerCase())!=null&&y.includes("rejected"))throw g;await new Promise(p=>setTimeout(p,500))}c++}const l=s==null?void 0:s[0];if(!l)throw new Error("Failed to connect to wallet, no accounts available");const u=_e(l),d=await t.request({method:"eth_chainId"}).then(pi).catch(g=>{throw new Error("Error reading chainId from provider",g)});let f=r&&r.id===d?r:Ge(d);try{r&&typeof r.id<"u"&&r.id!==d&&(await jw(t,r),f=r)}catch{console.warn(`Error switching to chain ${r==null?void 0:r.id} - defaulting to wallet chain (${d})`)}return Lw({address:u,chain:f,client:i,emitter:n,id:e,provider:t})}async function DM({id:e,provider:t,emitter:n,client:i,chain:r}){const o=(await t.request({method:"eth_accounts"}))[0];if(!o)throw new Error("Failed to connect to wallet, no accounts available");const c=_e(o),l=await t.request({method:"eth_chainId"}).then(pi),u=r&&r.id===l?r:Ge(l);return Lw({address:c,chain:u,client:i,emitter:n,id:e,provider:t})}function Xm({provider:e,address:t,client:n,id:i}){const r={address:_e(t),async sendTransaction(s){const c=[{...s.gasPrice?{gasPrice:ln(s.gasPrice)}:{maxFeePerGas:s.maxFeePerGas?ln(s.maxFeePerGas):void 0,maxPriorityFeePerGas:s.maxPriorityFeePerGas?ln(s.maxPriorityFeePerGas):void 0},from:this.address,gas:s.gas?ln(s.gas):void 0,nonce:s.nonce?ln(s.nonce):void 0,to:s.to?_e(s.to):void 0,data:s.data,value:s.value?ln(s.value):void 0,authorizationList:s.authorizationList?r9(s.authorizationList):void 0,accessList:s.accessList,...s.eip712}];try{const l=await e.request({method:"eth_sendTransaction",params:c});return pf({chainId:s.chainId,client:n,contractAddress:s.to??void 0,gasPrice:s.gasPrice,transactionHash:l,walletAddress:_e(t),walletType:i}),{transactionHash:l}}catch(l){throw H4(l)&&Q4({chainId:s.chainId,client:n,contractAddress:s.to||void 0,error:l,transactionValue:s.value,walletAddress:_e(t)}),l}},async signMessage({message:s}){if(!r.address)throw new Error("Provider not setup");const o=typeof s=="string"?ff(s):s.raw instanceof Uint8Array?ou(s.raw):s.raw;return await e.request({method:"personal_sign",params:[o,_e(r.address)]})},async signAuthorization(s){const o=t9(s);let c;try{c=await e.request({method:"eth_sign",params:[_e(r.address),o]})}catch{c=await e.request({method:"secp256k1_sign",params:[o]})}if(!c)throw new Error("Failed to sign authorization");const l=Nf(c);return{...s,...l}},async signTypedData(s){if(!e||!r.address)throw new Error("Provider not setup");const o=wf(s),{domain:c,message:l,primaryType:u}=o,d={EIP712Domain:Ef({domain:c}),...o.types};up({domain:c,message:l,primaryType:u,types:d});const f=h8({domain:c??{},message:l,primaryType:u,types:d});return await e.request({method:"eth_signTypedData_v4",params:[_e(r.address),f]})},async watchAsset(s){return await e.request({method:"wallet_watchAsset",params:s},{retryCount:0})},async sendCalls(s){try{const{callParams:o,chain:c}=await fu(s,r),l=await e.request({method:"wallet_sendCalls",params:o});return l&&typeof l=="object"&&"id"in l?{chain:c,client:n,id:l.id}:{chain:c,client:n,id:l}}catch(o){throw/unsupport|not support/i.test(o.message)?new Error(`${i} errored calling wallet_sendCalls, with error: ${o instanceof Error?o.message:yf(o)}`):o}},async getCallsStatus(s){try{const o=await e.request({method:"wallet_getCallsStatus",params:[s.id]});return Rf(o)}catch(o){throw/unsupport|not support/i.test(o.message)?new Error(`${i} does not support wallet_getCallsStatus, reach out to them directly to request EIP-5792 support.`):o}},async getCallsStatusRaw(s){try{return await e.request({method:"wallet_getCallsStatus",params:[s.id]})}catch(o){throw/unsupport|not support/i.test(o.message)?new Error(`${i} does not support wallet_getCallsStatus, reach out to them directly to request EIP-5792 support.`):o}},async getCapabilities(s){const o=s.chainId;try{const c=await e.request({method:"wallet_getCapabilities",params:[_e(r.address),o?[ln(o)]:void 0]});return Pf(c,o)}
52catch(c){if(/unsupport|not support|not available/i.test(c.message))return{message:`${i} does not support wallet_getCapabilities, reach out to them directly to request EIP-5792 support.`};throw c}}};return r}async function Lw({provider:e,address:t,chain:n,emitter:i,client:r,id:s}){const o=Xm({address:t,client:r,id:s,provider:e});async function c(){e.removeListener("accountsChanged",u),e.removeListener("chainChanged",d),e.removeListener("disconnect",l);try{await c8(()=>e.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}}async function l(){c(),i.emit("disconnect",void 0)}function u(f){if(f[0]){const m=Xm({address:_e(f[0]),client:r,id:s,provider:e});i.emit("accountChanged",m),i.emit("accountsChanged",f)}else l()}function d(f){const m=Ge(pi(f));i.emit("chainChanged",m)}return e.on&&(e.on("accountsChanged",u),e.on("chainChanged",d),e.on("disconnect",l)),[o,n,l,f=>jw(e,f)]}async function jw(e,t){var i;const n=ln(t.id);try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:n}]})}catch{const r=await Ht(t);await e.request({method:"wallet_addEthereumChain",params:[{blockExplorerUrls:(i=r.explorers)==null?void 0:i.map(s=>s.url),chainId:n,chainName:r.name,nativeCurrency:r.nativeCurrency,rpcUrls:i1(r)}]})}}function NM(e){return e instanceof Error?e.message:typeof e=="string"?e:typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}const ey=Object.freeze(Object.defineProperty({__proto__:null,autoConnectEip1193Wallet:DM,connectEip1193Wallet:SM,getInjectedProvider:qh},Symbol.toStringTag,{value:"Module"}));function un(...e){const[t,n]=e;switch(!0){case t==="smart":return C6(n);case(t==="embedded"||t==="inApp"):return vw(n);case Xe(t):return TM(...e);case t===Wn:{const i=n;return IM({createOptions:i,onConnectRequested:async r=>{const{showCoinbasePopup:s}=await h(async()=>{const{showCoinbasePopup:o}=await Promise.resolve().then(()=>MM);return{showCoinbasePopup:o}},void 0);return s(r)},providerFactory:()=>Iw(i)})}case t===Br:{const i=n;return gM({createOptions:i,providerFactory:()=>ww(i)})}default:{let c=function(){r=void 0,s=void 0};const i=su();let r,s,o,l=async()=>{};const u=i.subscribe("disconnect",()=>{c(),o==null||o(),u()});i.subscribe("accountChanged",y=>{r=y});let d=async()=>{throw new Error("Not implemented yet")};const f=sr()?y=>Wr(y):void 0,m={autoConnect:async y=>{const{injectedProvider:g}=await h(async()=>{const{injectedProvider:p}=await Promise.resolve().then(()=>Ll);return{injectedProvider:p}},void 0);if(t!=="walletConnect"&&g(t)){const{autoConnectEip1193Wallet:p}=await h(async()=>{const{autoConnectEip1193Wallet:j}=await Promise.resolve().then(()=>ey);return{autoConnectEip1193Wallet:j}},void 0),[w,x,I,E]=await p({chain:y.chain,client:y.client,emitter:i,id:t,provider:qh(t)});return r=w,s=x,l=I,d=E,o=i.subscribe("chainChanged",j=>{s=j}),Di({chainId:s.id,client:y.client,walletAddress:r.address,walletType:t}),r}if(y&&"client"in y){const{autoConnectWC:p}=await h(async()=>{const{autoConnectWC:j}=await import("./controller-C_I9tG6s.js");return{autoConnectWC:j}},__vite__mapDeps([31,7,4,3,6,8,9,1,2,5,24,10,11,12,13,14,15])),[w,x,I,E]=await p(y,i,m.id,In,f);return r=w,s=x,l=I,d=E,Di({chainId:s.id,client:y.client,walletAddress:r.address,walletType:t}),r}throw new Error("Failed to auto connect")},connect:async y=>{async function g(x){var j;const{connectWC:I}=await h(async()=>{const{connectWC:C}=await import("./controller-C_I9tG6s.js");return{connectWC:C}},__vite__mapDeps([31,7,4,3,6,8,9,1,2,5,24,10,11,12,13,14,15]));let E;try{const[C,T,v,N]=await I({...x,walletConnect:{...x.walletConnect,onDisplayUri:((j=x.walletConnect)==null?void 0:j.onDisplayUri)||(async M=>{var S,L;if(typeof window<"u"&&typeof document<"u")if(sr()){const O=await lc(t),P=O.mobile.native||O.mobile.universal;Wr(P?yw(P,M).redirect:M);return}else try{const{createQROverlay:O}=await h(async()=>{const{createQROverlay:P}=await import("./qr-overlay-DIGHsE4I.js");return{createQROverlay:P}},__vite__mapDeps([32,7,4,3,6,8,9]));E&&E.destroy(),E=O(M,{theme:((L=(S=x.walletConnect)==null?void 0:S.qrModalOptions)==null?void 0:L.themeMode)??"dark",qrSize:280,showCloseButton:!0,onCancel:()=>{var P,$;($=(P=x.walletConnect)==null?void 0:P.onCancel)==null||$.call(P)}
52})}catch(O){console.error("Failed to create QR overlay:",O)}})}},i,m.id,In,f);return E&&(E.destroy(),E=void 0),r=C,s=T,l=v,d=N,Di({chainId:s.id,client:x.client,walletAddress:r.address,walletType:t}),r}catch(C){throw E&&(E.destroy(),E=void 0),C}}if(t==="walletConnect"){const{client:x,chain:I,...E}=y;return g({chain:I,client:x,walletConnect:{...E}})}const p=y&&"walletConnect"in y,{injectedProvider:w}=await h(async()=>{const{injectedProvider:x}=await Promise.resolve().then(()=>Ll);return{injectedProvider:x}},void 0);if(w(t)&&!p){const{connectEip1193Wallet:x}=await h(async()=>{const{connectEip1193Wallet:T}=await Promise.resolve().then(()=>ey);return{connectEip1193Wallet:T}},void 0),[I,E,j,C]=await x({chain:y.chain,client:y.client,emitter:i,id:t,provider:qh(t)});return r=I,s=E,l=j,d=C,o=i.subscribe("chainChanged",T=>{s=T}),Di({chainId:s.id,client:y.client,walletAddress:r.address,walletType:t}),r}if(y&&"client"in y)return g(y);throw new Error("Failed to connect")},disconnect:async()=>{c(),await l()},getAccount:()=>r,getChain(){if(s)return s=iu(s.id)||s,s},getConfig:()=>e[1],id:t,subscribe:i.subscribe,switchChain:async y=>{try{await d(y),s=y}catch(g){console.error("Error switching chain",g)}}};return m}}}function Du(e){return[un("inApp",{executionMode:e==null?void 0:e.executionMode}),un(t1),un(Wn,{appMetadata:e==null?void 0:e.appMetadata,chains:e==null?void 0:e.chains}),un(dw),un("io.rabby"),un(hw),un("com.okex.wallet")]}function Sw(e){return[un(t1),un(Wn,{appMetadata:e==null?void 0:e.appMetadata,chains:e==null?void 0:e.chains}),un(dw),un("io.rabby"),un(hw),un("com.okex.wallet")]}const Dw=_.createContext(!1),Nw=_.createContext(()=>{}),Aw=_.createContext({}),Ow=_.createContext(()=>{}),kw=e=>{const[t,n]=_.useState(e.isOpen),[i,r]=_.useState({});return a.jsx(Dw.Provider,{value:t,children:a.jsx(Nw.Provider,{value:n,children:a.jsx(Aw.Provider,{value:i,children:a.jsx(Ow.Provider,{value:r,children:a.jsx(mu,{theme:e.theme,children:e.children})})})})})},AM=()=>_.useContext(Dw),zw=()=>{const e=_.useContext(Nw);if(e===void 0)throw new Error("useSetWalletModalOpen must be used within a ThirdwebProvider");return e};function Bs(){return _.useContext(Ow)}function OM(){return _.useContext(Aw)}const gn={getStarted:"getStarted",main:"main",showAll:"showAll",signIn:"signIn"},Pw="400px",Rw=730,Uw=`${Rw}px`,kM=Rw+40,Bw="570px",s1="660px",Gh=250;function jl(e){setTimeout(e,Gh+200)}function zM(){return typeof window<"u"?window.innerWidth>=kM:!1}function PM({wallets:e}){Mf({queries:e.filter(t=>t.id===Wn||t.id==="inApp"||Xe(t.id)).map(t=>({queryFn:async()=>{switch(!0){case Wn===t.id:{const{getCoinbaseWebProvider:n}=await h(async()=>{const{getCoinbaseWebProvider:i}=await Promise.resolve().then(()=>Zh);return{getCoinbaseWebProvider:i}},void 0);return await n(t.getConfig()),!0}default:return!1}},queryKey:["preload-wallet",t.id]}))})}function Vw(e,t){return new Promise((n,i)=>{const r=setTimeout(()=>{i(new Error(t.message))},t.ms);e.then(s=>{clearTimeout(r),n(s)},s=>{clearTimeout(r),i(s)})})}const Pq="/sdk/2022-08-12/embedded-wallet",Md=e=>`thirdwebEwsWalletUserId-${e}`,RM="walletToken",Cd=e=>`${RM}-${e}`,ty=e=>`passkey-credential-id-${e}`,UM="a",Ed=(e,t)=>`${UM}-${e}-${t}`,ny=e=>`walletConnectSessions-${e}`,iy=e=>`thirdweb_guest_session_id_${e}`,ry=new Map;
52class fc{constructor({storage:t,clientId:n,ecosystem:i}){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ecosystem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.storage=t,this.key=BM(n,i==null?void 0:i.id),this.ecosystem=i}async getItem(t){return this.storage?this.storage.getItem(t):ry.get(t)??null}async setItem(t,n){if(this.storage)return this.storage.setItem(t,n);ry.set(t,n)}async removeItem(t){const n=await this.getItem(t);return this.storage&&n?(this.storage.removeItem(t),!0):!1}async getWalletConnectSessions(){return this.getItem(ny(this.key))}async saveWalletConnectSessions(t){await this.setItem(ny(this.key),t)}async savePasskeyCredentialId(t){await this.setItem(ty(this.key),t)}async getPasskeyCredentialId(){return this.getItem(ty(this.key))}async saveAuthCookie(t){await this.setItem(Cd(this.key),t)}async getAuthCookie(){return this.getItem(Cd(this.key))}async removeAuthCookie(){return this.removeItem(Cd(this.key))}async saveDeviceShare(t,n){await this.saveWalletUserId(n),await this.setItem(Ed(this.key,n),t)}async getDeviceShare(){const t=await this.getWalletUserId();return t?this.getItem(Ed(this.key,t)):null}async removeDeviceShare(){const t=await this.getWalletUserId();return t?this.removeItem(Ed(this.key,t)):!1}async getWalletUserId(){return this.getItem(Md(this.key))}async saveWalletUserId(t){await this.setItem(Md(this.key),t)}async removeWalletUserId(){return this.removeItem(Md(this.key))}async getGuestSessionId(){return this.getItem(iy(this.key))}async saveGuestSessionId(t){await this.setItem(iy(this.key),t)}}const BM=(e,t)=>`${e}${t?`-${t}`:""}`;async function VM({client:e,ecosystem:t,tokenToLink:n,storage:i}){const r=hn(e,t),s=St("inAppWallet"),o=await i.getAuthCookie();if(!o)throw new Error("Failed to link account, no user logged in");const c={Authorization:`Bearer iaw-auth-token:${o}`,"Content-Type":"application/json"},l=await r(`${s}/api/2024-05-05/account/connect`,{body:Zt({accountAuthTokenToConnect:n}),headers:c,method:"POST"});if(!l.ok){const d=await l.json();throw new Error(d.message||"Failed to link account.")}const{linkedAccounts:u}=await l.json();return u??[]}async function Rq({client:e,ecosystem:t,profileToUnlink:n,allowAccountDeletion:i=!1,storage:r}){const s=hn(e,t),o=St("inAppWallet"),c=await r.getAuthCookie();if(!c)throw new Error("Failed to unlink account, no user logged in");const l={Authorization:`Bearer iaw-auth-token:${c}`,"Content-Type":"application/json"},u=await s(`${o}/api/2024-05-05/account/disconnect`,{body:Zt({allowAccountDeletion:i,details:n.details,type:n.type}),headers:l,method:"POST"});if(!u.ok){const f=await u.json();throw new Error(f.message||"Failed to unlink account.")}const{linkedAccounts:d}=await u.json();return d??[]}async function Uq({client:e,ecosystem:t,storage:n}){const i=hn(e,t),r=St("inAppWallet"),s=await n.getAuthCookie();if(!s)throw new Error("Failed to get linked accounts, no user logged in");const o={Authorization:`Bearer iaw-auth-token:${s}`,"Content-Type":"application/json"},c=await i(`${r}/api/2024-05-05/accounts`,{headers:o,method:"GET"});if(!c.ok){const u=await c.json();throw new Error(u.message||"Failed to get linked accounts.")}const{linkedAccounts:l}=await c.json();return l??[]}const Nu=["google","apple","facebook","discord","line","x","tiktok","epic","coinbase","farcaster","telegram","github","twitch","steam"],$M=[...Nu,"guest","backend","email","phone","passkey","wallet"],WM="0x3f707e6b",FM=[{type:"tuple[]",name:"calls",components:[{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}]}],YM=[];function HM(e){const t=lu(async()=>"asyncParams"in e?await e.asyncParams():e);return Is({contract:e.contract,method:[WM,FM,YM],params:async()=>[(await t()).calls],value:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.value},accessList:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.accessList},gas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.gas},gasPrice:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.gasPrice},maxFeePerGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.maxFeePerGas},maxPriorityFeePerGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.maxPriorityFeePerGas},nonce:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.nonce},extraGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.extraGas},erc20Value:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.erc20Value},authorizationList:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.authorizationList}})}async function QM(e){const{client:t,chain:n,bundlerUrl:i}=e,r=i??T6(n),s=`delegation-contract:${r}`;return Ui(async()=>{var u;const c=await hn(t)(r,{useAuthToken:!0,body:Zt({id:1,jsonrpc:"2.0",method:"tw_getDelegationContract",params:[]}),headers:{"Content-Type":"application/json"},method:"POST"});if(!c.ok)throw new Error(`Failed to fetch delegation contract: ${c.status} ${c.statusText}`);const l=await c.json();if(l.error)throw new Error(`Delegation contract RPC error: ${JSON.stringify(l.error)}`);if(!((u=l.result)!=null&&u.delegationContract))throw new Error("Invalid response: missing delegationContract in result");return l.result.delegationContract},{cacheKey:s,cacheTime:24*60*60*1e3})}const ZM=e=>{const{client:t,adminAccount:n,sponsorGas:i}=e,r=async o=>{var g,p,w;const c=o[0];if(!c)throw new Error("No transactions provided");const l=Ge(c.chainId),u=zt({address:n.address,chain:l,client:t,abi:JM});let d=(g=c.authorizationList)==null?void 0:g[0];const f=await QM({client:t,chain:l});if(d&&((p=d.address)==null?void 0:p.toLowerCase())!==f.toLowerCase())throw new Error(`Authorization address does not match expected delegation contract address. Expected ${f} but got ${d.address}`);if(!d&&!await GM(u,f)){let I=c.nonce?BigInt(c.nonce):BigInt(await qM({client:t,address:n.address,chain:l}));I+=i?0n:1n;const E=await((w=n.signAuthorization)==null?void 0:w.call(n,{address:_e(f),chainId:c.chainId,nonce:I}));if(!E)throw new Error("Failed to sign authorization");d=E}if(i){const x={calls:o.map(C=>({data:C.data??"0x",target:_e(C.to??""),value:C.value??0n})),uid:cu()},I=await n.signTypedData({domain:{chainId:c.chainId,name:"MinimalAccount",verifyingContract:u.address,version:"1"},message:x,primaryType:"WrappedCalls",types:{Call:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],WrappedCalls:[{name:"calls",type:"Call[]"},{name:"uid",type:"bytes32"}]}}),E=await U6({authorization:d,eoaAddress:_e(n.address),options:{chain:Ge(c.chainId),client:t},signature:I,wrappedCalls:x});return{transactionHash:await KM({options:{chain:Ge(c.chainId),client:t},transactionId:E.transactionId})}}const m=HM({calls:o.map(x=>({data:x.data??"0x",target:_e(x.to??""),value:x.value??0n})),contract:u,overrides:{authorizationList:d?[d]:void 0,value:o.reduce((x,I)=>x+(I.value??0n),0n)}}),y=await B6({from:n.address,transaction:m});return n.sendTransaction(y)},s={address:n.address,sendBatchTransaction:async o=>r(o),sendTransaction:async o=>r([o]),signMessage:({message:o,originalMessage:c,chainId:l})=>n.signMessage({chainId:l,message:o,originalMessage:c}),signTypedData:o=>n.signTypedData(o),sendCalls:async o=>{const{inAppWalletSendCalls:c}=await h(async()=>{const{inAppWalletSendCalls:m}=await import("./in-app-wallet-calls-23XdHcCt.js");return{inAppWalletSendCalls:m}},__vite__mapDeps([33,2,3,4,5,6,7,8,9,1,34])),l=o.calls[0];if(!l)throw new Error("No calls to send");const u=l.client,d=l.chain||o.chain,f=await c({account:s,calls:o.calls,chain:d});return{chain:d,client:u,id:f}},getCallsStatus:async o=>{const{inAppWalletGetCallsStatus:c}=await h(async()=>{const{inAppWalletGetCallsStatus:l}=await import("./in-app-wallet-calls-23XdHcCt.js");return{inAppWalletGetCallsStatus:l}},__vite__mapDeps([33,2,3,4,5,6,7,8,9,1,34]));return c(o)},getCallsStatusRaw:async o=>{const{inAppWalletGetCallsStatusRaw:c}=await h(async()=>{const{inAppWalletGetCallsStatusRaw:l}=await import("./in-app-wallet-calls-23XdHcCt.js");return{inAppWalletGetCallsStatusRaw:l}},__vite__mapDeps([33,2,3,4,5,6,7,8,9,1,34]));return c(o)},getCapabilities:async o=>({[o.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:i??!1}}})};return s};async function qM(e){const{client:t,address:n,chain:i}=e,r=uf({chain:i,client:t});return await h(async()=>{const{eth_getTransactionCount:o}=await import("./eth_getTransactionCount-D2rfJacD.js");return{eth_getTransactionCount:o}},__vite__mapDeps([35,2,3,4,5,6,7,8,9])).then(({eth_getTransactionCount:o})=>o(r,{address:_e(n),blockTag:"pending"}))}async function GM(e,t){const n=await E6(e),i=n.length>0&&n.startsWith("0xef0100"),r=`0x${n.slice(8,48)}`;return i&&r.toLowerCase()===t.toLowerCase()}async function KM(e){const t=e.timeoutMs||3e5,n=e.intervalMs||1e3,i=Date.now()+t;for(;Date.now()<i;){const r=await V6({options:e.options,transactionId:e.transactionId});if(r.transactionHash)return r.transactionHash;await new Promise(s=>setTimeout(s,n))}throw new Error(`Timeout waiting for transaction to be mined on chain ${e.options.chain.id} with transactionId: ${e.transactionId}`)}const JM=[{type:"receive",stateMutability:"payable"},{type:"function",name:"createSessionWithSig",inputs:[{name:"sessionS
52pec",type:"tuple",internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeWithSig",inputs:[{name:"wrappedCalls",type:"tuple",internalType:"struct WrappedCalls",components:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"getCallPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]}],stateMutability:"view"}
52,{type:"function",name:"getSessionExpirationForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getSessionStateForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple",internalType:"struct SessionLib.SessionState",components:[{name:"transferValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callValue",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]},{name:"callParams",type:"tuple[]",internalType:"struct SessionLib.LimitState[]",components:[{name:"remaining",type:"uint256",internalType:"uint256"},{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"index",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"getTransferPoliciesForSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}],stateMutability:"view"},{type:"function",name:"isWildcardSigner",inputs:[{name:"signer",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"supportsInterface",inputs:[{name:"interfaceId",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"event",name:"Executed",inputs:[{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"},{name:"data",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"SessionCreated",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"sessionSpec",type:"tuple",indexed:!1,internalType:"struct SessionLib.SessionSpec",components:[{name:"signer",type:"address",internalType:"address"},{name:"isWildcard",type:"bool",internalType:"bool"},{name:"expiresAt",type:"uint256",internalType:"uint256"},{name:"callPolicies",type:"tuple[]",internalType:"struct SessionLib.CallSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]},{name:"constraints",type:"tuple[]",internalType:"struct SessionLib.Constraint[]",components:[{name:"condition",type:"uint8",internalType:"enum SessionLib.Condition"},{name:"index",type:"uint64",internalType:"uint64"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"limit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]}]},{name:"transferPolicies",type:"tuple[]",internalType:"struct SessionLib.TransferSpec[]",components:[{name:"target",type:"address",internalType:"address"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"},{name:"valueLimit",type:"tuple",internalType:"struct SessionLib.UsageLimit",components:[{name:"limitType",type:"uint8",internalType:"enum SessionLib.LimitType"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint256",internalType:"uint256"}]}]},{name:"uid",type:"bytes32",internalType:"bytes32"}]}],anonymous:!1},{type:"event",name:"ValueReceived",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AllowanceExceeded",inputs:[{name:"allowanceUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"},{name:"period",type:"uint64",internalType:"uint64"}]},{type:"error",name:"CallPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"},{name:"selector",type:"bytes4",internalType:"bytes4"}]},{type:"error",name:"CallReverted",inputs:[]},{type:"error",name:"ConditionFailed",inputs:[{name:"param",type:"bytes32",internalType:"bytes32"},{name:"refValue",type:"bytes32",internalType:"bytes32"},{name:"condition",type:"uint8",internalType:"uint8"}]},{type:"error",name:"InvalidDataLength",inputs:[{name:"actualLength",type:"uint256",internalType:"uint256"},{name:"expectedLength",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidSignature",inputs:[{name:"msgSender",type:"address",internalType:"address"},{name:"thisAddress",type:"address",internalType:"address"}]},{type:"error",name:"LifetimeUsageExceeded",inputs:[{name:"lifetimeUsage",type:"uint256",internalType:"uint256"},{name:"limit",type:"uint256",internalType:"uint256"}]}
52,{type:"error",name:"MaxValueExceeded",inputs:[{name:"value",type:"uint256",internalType:"uint256"},{name:"maxValuePerUse",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NoCallsToExecute",inputs:[]},{type:"error",name:"SessionExpired",inputs:[]},{type:"error",name:"SessionExpiresTooSoon",inputs:[]},{type:"error",name:"SessionZeroSigner",inputs:[]},{type:"error",name:"TransferPolicyViolated",inputs:[{name:"target",type:"address",internalType:"address"}]},{type:"error",name:"UIDAlreadyProcessed",inputs:[]}];function o1(e){return e.id==="inApp"||e.id==="embedded"}async function XM(e,t,n){var s,o,c,l;if(((s=t==null?void 0:t.auth)==null?void 0:s.mode)!=="popup"&&((o=t==null?void 0:t.auth)==null?void 0:o.mode)!==void 0&&n.authenticateWithRedirect){const u=e.strategy;Nu.includes(u)&&await n.authenticateWithRedirect(u,(c=t==null?void 0:t.auth)==null?void 0:c.mode,(l=t==null?void 0:t.auth)==null?void 0:l.redirectUrl)}const r=(await n.connect(e)).user.account;return $w({authAccount:r,client:e.client,createOptions:t,desiredChain:e.chain})}async function eC(e,t,n){e.authResult&&n.loginWithAuthToken&&await n.loginWithAuthToken(e.authResult);const i=await nC(n);if(!i)throw new Error("Failed to authenticate user.");const r=i.account;return $w({authAccount:r,client:e.client,createOptions:t,desiredChain:e.chain})}async function tC(e){const{connectSmartAccount:t}=await h(async()=>{const{connectSmartAccount:n}=await import("./index-CE4vVO9x.js").then(i=>i.i);return{connectSmartAccount:n}},__vite__mapDeps([36,7,4,3,6,8,9,1,2,5,37,38,39,30,40,25]));return t({chain:e.chain,client:e.client,personalAccount:e.authAccount},e.smartAccountOptions)}async function nC(e){const t=await e.getUser();switch(t.status){case"Logged In, Wallet Initialized":return t}}async function $w(e){const{createOptions:t,authAccount:n,desiredChain:i,client:r}=e;let s,o;const c=t&&"executionMode"in t?t.executionMode:void 0;if(c&&(c.mode==="EIP4337"?s=c.smartAccount:c.mode==="EIP7702"&&(o=c)),t&&"smartAccount"in t&&(t!=null&&t.smartAccount)&&(s=t.smartAccount),s){const[l,u]=await tC({authAccount:n,chain:i,client:r,smartAccountOptions:s});return{account:l,adminAccount:n,chain:u}}if(o){const l=i;if(!l)throw new Error("Chain is required for EIP-7702 execution, pass a chain when connecting the inAppWallet.");return{account:ZM({adminAccount:n,client:r,sponsorGas:o.sponsorGas}),adminAccount:n,chain:l}}return{account:n,chain:i||zo}}const Td=Object.freeze(Object.defineProperty({__proto__:null,autoConnectInAppWallet:eC,connectInAppWallet:XM,isInAppWallet:o1},Symbol.toStringTag,{value:"Module"}));function iC(e){const t=i=>o1(i)||Xe(i),n=au(e.wallet)&&e.connectedWallets.some(i=>{var r,s,o,c,l,u;return t(i)&&((s=(r=i.getAccount())==null?void 0:r.address)==null?void 0:s.toLowerCase())===((u=(l=(c=(o=e.wallet).getAdminAccount)==null?void 0:c.call(o))==null?void 0:l.address)==null?void 0:u.toLowerCase())});return t(e.wallet)||n}function rC(){if(typeof document>"u")return;const e=new URLSearchParams(window.location.search);let t;const n=window.location.hash||"";let i=n;const r=n.indexOf("?");r!==-1&&(t=new URLSearchParams(n.substring(r)),i=n.substring(0,r));const s=e.get("walletId")??(t==null?void 0:t.get("walletId"))??void 0,o=e.get("authResult")??
52(t==null?void 0:t.get("authResult"))??void 0,c=e.get("authProvider")??(t==null?void 0:t.get("authProvider"))??void 0,l=e.get("authCookie")??(t==null?void 0:t.get("authCookie"))??void 0,u=e.get("authFlow")??(t==null?void 0:t.get("authFlow"))??void 0;if((l||o)&&s){const d=(()=>{if(o)return e.delete("authResult"),t==null||t.delete("authResult"),JSON.parse(decodeURIComponent(o))})();e.delete("walletId"),e.delete("authProvider"),e.delete("authCookie"),e.delete("authFlow"),t==null||t.delete("walletId"),t==null||t.delete("authProvider"),t==null||t.delete("authCookie"),t==null||t.delete("authFlow");const f=e.toString(),m=f?`?${f}`:"";let y=i;if(t){const g=t.toString();g&&(y=`${i}?${g}`)}return window.history.pushState({},"",`${window.location.pathname}${m}${y}`),{authCookie:l,authFlow:u,authProvider:c,authResult:d,walletId:s}}}let vd;const sC=async e=>{if(vd&&!e.force&&await vd)return!0;const t=oC(e);return vd=t,t},oC=async({storage:e,props:t,createWalletFn:n,manager:i,connectOverride:r,setLastAuthProvider:s})=>{var C,T,v,N,M;const{wallets:o,onConnect:c}=t,l=t.timeout??15e3;let u=!1;i.isAutoConnecting.setValue(!0);let[d,f]=await Promise.all([U4(e),B4(e)]);const m=rC();if((m==null?void 0:m.authFlow)==="link"&&m.authResult)return await aC({client:t.client,connectOverride:r,createWalletFn:n,manager:i,onConnect:c,props:t,setLastAuthProvider:s,storage:e,timeout:l,urlToken:m,wallets:o});const y=o.find(S=>S.id===(m==null?void 0:m.walletId));if(m!=null&&m.authCookie&&y&&await new fc({clientId:t.client.clientId,ecosystem:Xe(y)?{id:y.id,partnerId:(C=y.getConfig())==null?void 0:C.partnerId}:void 0,storage:e}).saveAuthCookie(m.authCookie),m!=null&&m.walletId&&(f=m.walletId,d=d!=null&&d.includes(m.walletId)?d:[m.walletId,...d||[]]),m!=null&&m.authProvider&&await(s==null?void 0:s(m.authProvider,e)),!d)return u;const g=await V4(e)||t.chain,p=d.map(S=>{const L=o.find(O=>O.id===S);return L||n(S)}),w=f&&(p.find(S=>S.id===f)||n(f));if(w){i.activeWalletConnectionStatusStore.setValue("connecting"),await Vw(Kh({authResult:m==null?void 0:m.authResult,client:t.client,lastConnectedChain:g,wallet:w}),{message:`AutoConnect timeout: ${l}ms limit exceeded.`,ms:l}).catch(S=>{console.warn(S.message),t.onTimeout&&t.onTimeout()});try{await(r?r(w):i.connect(w,{accountAbstraction:t.accountAbstraction,client:t.client}))}catch(S){S instanceof Error&&console.warn("Error auto connecting wallet:",S.message),i.activeWalletConnectionStatusStore.setValue("disconnected")}}else i.activeWalletConnectionStatusStore.setValue("disconnected");const x=p.filter(S=>S.id!==f&&d.includes(S.id));for(const S of x)try{await Kh({authResult:m==null?void 0:m.authResult,client:t.client,lastConnectedChain:g,wallet:S}),i.addConnectedWallet(S)}catch{}w&&iC({connectedWallets:w?[w,...x]:x,wallet:w})&&((T=t.siweAuth)!=null&&T.requiresAuth)&&!((v=t.siweAuth)!=null&&v.isLoggedIn)&&!((N=t.siweAuth)!=null&&N.isLoggingIn)&&await((M=t.siweAuth)==null?void 0:M.doLogin().catch(S=>{console.warn("Error signing in with SIWE:",S.message)})),i.isAutoConnecting.setValue(!1);const E=i.activeWalletStore.getValue(),j=i.connectedWallets.getValue();if(E){u=!0;try{c==null||c(E,j)}catch(S){console.error("Error calling onConnect callback:",S)}}else i.activeWalletConnectionStatusStore.setValue("disconnected");return u};async function aC(e){var j;const{client:t,connectOverride:n,createWalletFn:i,manager:r,onConnect:s,props:o,setLastAuthProvider:c,storage:l,timeout:u,urlToken:d,wallets:f}=e,[m,y]=await Promise.all([U4(l),B4(l)]),g=await V4(l)||o.chain;if(!y||!m)return console.warn("No stored wallet found for linking flow"),r.isAutoConnecting.setValue(!1),!1;d.authProvider&&await(c==null?void 0:c(d.authProvider,l));const p=f.find(C=>C.id===y)||i(y);r.activeWalletConnectionStatusStore.setValue("connecting");try{await Vw(Kh({authResult:void 0,client:t,lastConnectedChain:g,wallet:p}),{message:`AutoConnect timeout: ${u}ms limit exceeded.`,ms:u}),await(n?n(p):r.connect(p,{accountAbstraction:o.accountAbstraction,client:t}))}catch(C){return console.warn("Failed to auto-connect for linking:",C),r.activeWalletConnectionStatusStore.setValue("disconnected"),r.isAutoConnecting.setValue(!1),!1}const w=Xe(p)?{id:p.id,partnerId:(j=p.getConfig())==null?void 0:j.partnerId}:void 0,x=new fc({clientId:t.clientId,ecosystem:w,storage:l});try{await VM({client:t,ecosystem:w,storage:x,tokenToLink:d.authResult.storedToken.cookieString})}catch(C){console.error("Failed to link profile after redirect:",C)}r.isAutoConnecting.setValue(!1);const I=r.activeWalletStore.getValue(),E=r.connectedWallets.getValue();if(I){try{s==null||s(I,E)}catch(C){console.error("Error calling onConnect callback:",C)}return!0}return!1}async function Kh(e){return e.wallet.autoConnect({authResult:e.authResult,chain:e.last
52ConnectedChain,client:e.client})}const a1="lastAuthProvider";async function ar(e,t){await t.setItem(a1,e)}async function Ww(e){return await e.getItem(a1)}function cC(e,t,n){const i=Vi("useAutoConnect"),{connect:r}=I9({accountAbstraction:t.accountAbstraction,client:t.client});return pe({queryFn:()=>sC({connectOverride:r,createWalletFn:n,manager:i,props:t,setLastAuthProvider:ar,storage:e}),queryKey:["autoConnect",t.client.clientId],refetchOnMount:!1,refetchOnWindowFocus:!1})}function lC(e){const t=e.wallets||Du(e);return cC(In,{...e,wallets:t},un)}function Fw(e){return lC(e),null}function Yw(e){const{height:t,elementRef:n}=uC();return a.jsx("div",{style:{boxSizing:"border-box",height:t?`${t}px`:"auto",overflow:"hidden",transition:"height 210ms ease"},children:a.jsx("div",{ref:n,style:{maxHeight:e.maxHeight},children:e.children})})}function uC(){const e=_.useRef(null),[t,n]=_.useState();return _.useEffect(()=>{const i=e.current;if(!i)return;const r=new ResizeObserver(()=>{n(i.scrollHeight)});return r.observe(i),()=>{r.disconnect()}},[]),{elementRef:e,height:t}}const Hw=e=>new Promise(t=>setTimeout(t,e)),U=({y:e})=>a.jsx("div",{style:{height:R[e],flexShrink:0}}),A=m7(e=>({color:ee().colors[e.color||"secondaryText"],display:e.inline?"inline":"block",fontSize:ie[e.size||"md"],fontWeight:e.weight||400,lineHeight:e.multiline?1.5:"normal",margin:0,maxWidth:"100%",overflow:"hidden",textAlign:e.center?"center":"left",textOverflow:"ellipsis",textWrap:e.balance?"balance":"inherit",letterSpacing:e.trackingTight?"-0.025em":void 0})),Gr=y7(e=>{const t=ee();return{all:"unset","&:hover":{color:t.colors[e.hoverColor||"primaryText"],textDecoration:"none"},color:t.colors[e.color||"accentText"],cursor:"pointer",display:e.inline?"inline":"block",fontSize:ie[e.size||"md"],fontWeight:e.weight||500,lineHeight:"normal",textAlign:e.center?"center":"left",textDecoration:"none",transition:"color 0.2s ease"}}),Qw="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3MDUuNiIgaGVpZ2h0PSI3MjAiIHZpZXdCb3g9IjAgMCAxODYuNjkgMTkwLjUiIHhtbG5zOnY9Imh0dHBzOi8vdmVjdGEuaW8vbmFubyI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTE4NC41ODMgNzY1LjE3MSkiPjxwYXRoIGNsaXAtcGF0aD0ibm9uZSIgbWFzaz0ibm9uZSIgZD0iTS0xMDg5LjMzMy02ODcuMjM5djM2Ljg4OGg1MS4yNjJjLTIuMjUxIDExLjg2My05LjAwNiAyMS45MDgtMTkuMTM3IDI4LjY2MmwzMC45MTMgMjMuOTg2YzE4LjAxMS0xNi42MjUgMjguNDAyLTQxLjA0NCAyOC40MDItNzAuMDUyIDAtNi43NTQtLjYwNi0xMy4yNDktMS43MzItMTkuNDgzeiIgZmlsbD0iIzQyODVmNCIvPjxwYXRoIGNsaXAtcGF0aD0ibm9uZSIgbWFzaz0ibm9uZSIgZD0iTS0xMTQyLjcxNC02NTEuNzkxbC02Ljk3MiA1LjMzNy0yNC42NzkgMTkuMjIzaDBjMTUuNjczIDMxLjA4NiA0Ny43OTYgNTIuNTYxIDg1LjAzIDUyLjU2MSAyNS43MTcgMCA0Ny4yNzgtOC40ODYgNjMuMDM4LTIzLjAzM2wtMzAuOTEzLTIzLjk4NmMtOC40ODYgNS43MTUtMTkuMzEgOS4xNzktMzIuMTI1IDkuMTc5LTI0Ljc2NSAwLTQ1LjgwNi0xNi43MTItNTMuMzQtMzkuMjI2eiIgZmlsbD0iIzM0YTg1MyIvPjxwYXRoIGNsaXAtcGF0aD0ibm9uZSIgbWFzaz0ibm9uZSIgZD0iTS0xMTc0LjM2NS03MTIuNjFjLTYuNDk0IDEyLjgxNS0xMC4yMTcgMjcuMjc2LTEwLjIxNyA0Mi42ODlzMy43MjMgMjkuODc0IDEwLjIxNyA0Mi42ODljMCAuMDg2IDMxLjY5My0yNC41OTIgMzEuNjkzLTI0LjU5Mi0xLjkwNS01LjcxNS0zLjAzMS0xMS43NzYtMy4wMzEtMTguMDk4czEuMTI2LTEyLjM4MyAzLjAzMS0xOC4wOTh6IiBmaWxsPSIjZmJiYzA1Ii8+PHBhdGggZD0iTS0xMDg5LjMzMy03MjcuMjQ0YzE0LjAyOCAwIDI2LjQ5NyA0Ljg0OSAzNi40NTUgMTQuMjAxbDI3LjI3Ni0yNy4yNzZjLTE2LjUzOS0xNS40MTMtMzguMDEzLTI0Ljg1Mi02My43MzEtMjQuODUyLTM3LjIzNCAwLTY5LjM1OSAyMS4zODgtODUuMDMyIDUyLjU2MWwzMS42OTIgMjQuNTkyYzcuNTMzLTIyLjUxNCAyOC41NzUtMzkuMjI2IDUzLjM0LTM5LjIyNnoiIGZpbGw9IiNlYTQzMzUiIGNsaXAtcGF0aD0ibm9uZSIgbWFzaz0ibm9uZSIvPjwvZz48L3N2Zz4=",Zw="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0iRWJlbmUgMSIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgaWQ9ImZhY2Vib29rLWxvZ28tMjAxOSI+PHBhdGggZmlsbD0iIzE4NzdmMiIgZD0iTTEwMjQsNTEyQzEwMjQsMjI5LjIzMDE2LDc5NC43Njk3OCwwLDUxMiwwUzAsMjI5LjIzMDE2LDAsNTEyYzAsMjU1LjU1NCwxODcuMjMxLDQ2Ny4zNzAxMiw0MzIsNTA1Ljc3Nzc3VjY2MEgzMDJWNTEySDQzMlYzOTkuMkM0MzIsMjcwLjg3OTgyLDUwOC40Mzg1NCwyMDAsNjI1LjM4OTIyLDIwMCw2ODEuNDA3NjUsMjAwLDc0MCwyMTAsNzQwLDIxMFYzMzZINjc1LjQzNzEzQzYxMS44MzUwOCwzMzYsNTkyLDM3NS40NjY2Nyw1OTIsNDE1Ljk1NzI4VjUxMkg3MzRMNzExLjMsNjYwSDU5MnYzNTcuNzc3NzdDODM2Ljc2OSw5NzkuMzcwMTIsMTAyNCw3NjcuNTU0LDEwMjQsNTEyWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik03MTEuMyw2NjAsNzM0LDUxMkg1OTJWNDE1Ljk1NzI4QzU5MiwzNzUuNDY2NjcsNjExLjgzNTA4LDMzNiw2NzUuNDM3MTMsMzM2SDc0MFYyMTBzLTU4LjU5MjM1LTEwLTExNC42MTA3OC0xMEM1MDguNDM4NTQsMjAwLDQzMiwyNzAuODc5ODIsNDMyLDM5OS4yVjUxMkgzMDJWNjYwSDQzMnYzNTcuNzc3NzdhNTE3LjM5NjE5LDUxNy4zOTYxOSwwLDAsMCwxNjAsMFY2NjBaIj48L3BhdGg+PC9zdmc+",qw="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDM4IiBoZWlnaHQ9IjI1MDAiIHZpZXdCb3g9IjAgMCA0OTYuMjU1IDYwOC43MjgiIGlkPSJhcHBsZSI+PHBhdGggZmlsbD0iIzk5OSIgZD0iTTI3My44MSA1Mi45NzNDMzEzLjgwNi4yNTcgMzY5LjQxIDAgMzY5LjQxIDBzOC4yNzEgNDkuNTYyLTMxLjQ2MyA5Ny4zMDZjLTQyLjQyNiA1MC45OC05MC42NDkgNDIuNjM4LTkwLjY0OSA0Mi42MzhzLTkuMDU1LTQwLjA5NCAyNi41MTItODYuOTcxek0yNTIuMzg1IDE3NC42NjJjMjAuNTc2IDAgNTguNzY0LTI4LjI4NCAxMDguNDcxLTI4LjI4NCA4NS41NjIgMCAxMTkuMjIyIDYwLjg4MyAxMTkuMjIyIDYwLjg4M3MtNjUuODMzID
52MzLjY1OS02NS44MzMgMTE1LjMzMWMwIDkyLjEzMyA4Mi4wMSAxMjMuODg1IDgyLjAxIDEyMy44ODVzLTU3LjMyOCAxNjEuMzU3LTEzNC43NjIgMTYxLjM1N2MtMzUuNTY1IDAtNjMuMjE1LTIzLjk2Ny0xMDAuNjg4LTIzLjk2Ny0zOC4xODggMC03Ni4wODQgMjQuODYxLTEwMC43NjYgMjQuODYxQzg5LjMzIDYwOC43MyAwIDQ1NS42NjYgMCAzMzIuNjI4YzAtMTIxLjA1MiA3NS42MTItMTg0LjU1NCAxNDYuNTMzLTE4NC41NTQgNDYuMTA1IDAgODEuODgzIDI2LjU4OCAxMDUuODUyIDI2LjU4OHoiPjwvcGF0aD48L3N2Zz4=",Gw="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDEwMCAxMDAiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBpZD0iZGlzY29yZCI+PHBhdGggZmlsbD0iIzY2NjVkMiIgZD0iTTg1LjIyLDI0Ljk1OGMtMTEuNDU5LTguNTc1LTIyLjQzOC04LjMzNC0yMi40MzgtOC4zMzRsLTEuMTIyLDEuMjgyCgkJCQljMTMuNjIzLDQuMDg3LDE5Ljk1NCwxMC4wOTcsMTkuOTU0LDEwLjA5N2MtMTkuNDkxLTEwLjczMS00NC4zMTctMTAuNjU0LTY0LjU5LDBjMCwwLDYuNTcxLTYuMzMxLDIwLjk5Ni0xMC40MThsLTAuODAxLTAuOTYyCgkJCQljMCwwLTEwLjg5OS0wLjI0LTIyLjQzOCw4LjMzNGMwLDAtMTEuNTQsMjAuNzU1LTExLjU0LDQ2LjMxOWMwLDAsNi43MzIsMTEuNTQsMjQuNDQyLDEyLjEwMWMwLDAsMi45NjUtMy41MjYsNS4zNjktNi41NzEKCQkJCWMtMTAuMTc3LTMuMDQ1LTE0LjAyNC05LjM3Ni0xNC4wMjQtOS4zNzZjNi4zOTQsNC4wMDEsMTIuODU5LDYuNTA1LDIwLjkxNiw4LjA5NGMxMy4xMDgsMi42OTgsMjkuNDEzLTAuMDc2LDQxLjU5MS04LjA5NAoJCQkJYzAsMC00LjAwNyw2LjQ5MS0xNC41MDUsOS40NTZjMi40MDQsMi45NjUsNS4yODksNi40MTEsNS4yODksNi40MTFjMTcuNzEtMC41NjEsMjQuNDQxLTEyLjEwMSwyNC40NDEtMTIuMDIKCQkJCUM5Ni43NTksNDUuNzEzLDg1LjIyLDI0Ljk1OCw4NS4yMiwyNC45NTh6IE0zNS4wNTUsNjMuODI0Yy00LjQ4OCwwLTguMTc0LTMuOTI3LTguMTc0LTguODE1CgkJCQljMC4zMjgtMTEuNzA3LDE2LjEwMi0xMS42NzEsMTYuMzQ4LDBDNDMuMjI5LDU5Ljg5NywzOS42MjIsNjMuODI0LDM1LjA1NSw2My44MjR6IE02NC4zMDQsNjMuODI0CgkJCQljLTQuNDg4LDAtOC4xNzQtMy45MjctOC4xNzQtOC44MTVjMC4zNi0xMS42ODQsMTUuOTM3LTExLjY4OSwxNi4zNDgsMEM3Mi40NzgsNTkuODk3LDY4Ljg3Miw2My44MjQsNjQuMzA0LDYzLjgyNHoiPjwvcGF0aD48L3N2Zz4=",Kw="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTU2IiBoZWlnaHQ9IjU1NiIgdmlld0JveD0iMCAwIDU1NiA1NTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8xNDhfNSkiPgo8cGF0aCBkPSJNMjc4IDBDNDMxLjUzMyAwIDU1NiAxMjQuNDY3IDU1NiAyNzhDNTU2IDQzMS41MzMgNDMxLjUzMyA1NTYgMjc4IDU1NkMxMjQuNDY3IDU1NiAwIDQzMS41MzMgMCAyNzhDMCAxMjQuNDY3IDEyNC40NjcgMCAyNzggMFoiIGZpbGw9IiMwMDUyRkYiLz4KPHBhdGggZD0iTTI3OC40ODIgMzc1LjE5QzIyNC40OSAzNzUuMTkgMTgwLjg2MiAzMzEuNDEgMTgwLjg2MiAyNzcuNUMxODAuODYyIDIyMy41OSAyMjQuNjEgMTc5LjgxIDI3OC40ODIgMTc5LjgxQzMyNi44MSAxNzkuODEgMzY2Ljk0MyAyMTUuMDI3IDM3NC42NTYgMjYxLjIxOEg0NzNDNDY0LjY4NCAxNjAuODc1IDM4MC44MDMgODIgMjc4LjM2MiA4MkMxNzAuNDk3IDgyIDgzIDE2OS41NTkgODMgMjc3LjVDODMgMzg1LjQ0MSAxNzAuNDk3IDQ3MyAyNzguMzYyIDQ3M0MzODAuODAzIDQ3MyA0NjQuNjg0IDM5NC4xMjUgNDczIDI5My43ODJIMzc0LjUzNkMzNjYuODIzIDMzOS45NzMgMzI2LjgxIDM3NS4xOSAyNzguNDgyIDM3NS4xOVoiIGZpbGw9IndoaXRlIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDBfMTQ4XzUiPgo8cmVjdCB3aWR0aD0iNTU2IiBoZWlnaHQ9IjU1NiIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K",Jw="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMjAiIGhlaWdodD0iMzIwIiB2aWV3Qm94PSIwIDAgMzIwIDMyMCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiMwNmM3NTU7fS5jbHMtMntmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxnIGlkPSJMYXllcl8yIiBkYXRhLW5hbWU9IkxheWVyIDIiPjxnIGlkPSJMSU5FX0xPR08iIGRhdGEtbmFtZT0iTElORSBMT0dPIj48cmVjdCBjbGFzcz0iY2xzLTEiIHdpZHRoPSIzMjAiIGhlaWdodD0iMzIwIiByeD0iNzIuMTQiLz48cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik0yNjYuNjYsMTQ0LjkyYzAtNDcuNzQtNDcuODYtODYuNTgtMTA2LjY5LTg2LjU4UzUzLjI4LDk3LjE4LDUzLjI4LDE0NC45MmMwLDQyLjgsMzgsNzguNjUsODkuMjIsODUuNDIsMy40OC43NSw4LjIxLDIuMjksOS40LDUuMjYsMS4wOCwyLjcuNzEsNi45My4zNSw5LjY1LDAsMC0xLjI1LDcuNTMtMS41Miw5LjEzLS40NywyLjctMi4xNSwxMC41NSw5LjI0LDUuNzZzNjEuNDQtMzYuMTgsODMuODItNjEuOTVoMEMyNTkuMjUsMTgxLjI0LDI2Ni42NiwxNjQsMjY2LjY2LDE0NC45MloiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0yMzEuMTYsMTcyLjQ5aC0zMGEyLDIsMCwwLDEtMi0ydjBoMFYxMjMuOTRoMHYwYTIsMiwwLDAsMSwyLTJoMzBhMiwyLDAsMCwxLDIsMnY3LjU3YTIsMiwwLDAsMS0yLDJIMjEwLjc5djcuODVoMjAuMzdhMiwyLDAsMCwxLDIsMlYxNTFhMiwyLDAsMCwxLTIsMkgyMTAuNzl2Ny44NmgyMC4zN2EyLDIsMCwwLDEsMiwydjcuNTZBMiwyLDAsMCwxLDIzMS4xNiwxNzIuNDlaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTIwLjI5LDE3Mi40OWEyLDIsMCwwLDAsMi0ydi03LjU2YTIsMiwwLDAsMC0yLTJIOTkuOTJ2LTM3YTIsMiwwLDAsMC0yLTJIOTAuMzJhMiwyLDAsMCwwLTIsMnY0Ni41M2gwdjBhMiwyLDAsMCwwLDIsMmgzMFoiLz48cmVjdCBjbGFzcz0iY2xzLTEiIHg9IjEyOC43MyIgeT0iMTIxLjg1IiB3aWR0aD0iMTEuNjQiIGhlaWdodD0iNTAuNjQiIHJ4PSIyLjA0Ii8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTg5Ljg0LDEyMS44NWgtNy41NmEyLDIsMCwwLDAtMiwydjI3LjY2bC0yMS4zLTI4Ljc3YTEuMiwxLjIsMCwwLDAtLjE3LS4yMXYwbC0uMTItLjEyLDAsMC0uMTEtLjA5LS4wNiwwLS4xMS0uMDgtLjA2LDAtLjExLS4wNi0uMDcsMC0uMTEsMC0uMDcsMC0uMTIsMC0uMDgsMC0uMTIsMGgtLjA4bC0uMTEsMGgtNy43MWEyLDIsMCwwLDAtMiwydjQ2LjU2YTIsMiwwLDAsMCwyLDJoNy41N2EyLDIsMCwwLDAsMi0yVjE0Mi44MWwyMS4zMywyOC44YTIsMiwwLDAsMCwuNTIuNTJoMGwuMTIuMDguMDYsMCwuMS4wNS4xLDAsLjA3LDAsLjE0LDBoMGEyLjQyLDIuNDIsMCwwLDAsLjU0LjA3aDcuNTJhMiwyLDAsMCwwLDItMlYxMjMuODlBMiwyLDAsMCwwLDE4OS44NCwxMjEuODVaIi8+PC9nPjwvZz48L3N2Zz4=",Xw="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwMCIgaGVpZ2h0PSIxMDAwIiB2aWV3Qm94PSIwIDAgMTAwMCAxM
52DAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cmVjdCB3aWR0aD0iMTAwMCIgaGVpZ2h0PSIxMDAwIiByeD0iMjAwIiBmaWxsPSIjODU1RENEIi8+CjxwYXRoIGQ9Ik0yNTcuNzc4IDE1NS41NTZINzQyLjIyMlY4NDQuNDQ0SDY3MS4xMTFWNTI4Ljg4OUg2NzAuNDE0QzY2Mi41NTQgNDQxLjY3NyA1ODkuMjU4IDM3My4zMzMgNTAwIDM3My4zMzNDNDEwLjc0MiAzNzMuMzMzIDMzNy40NDYgNDQxLjY3NyAzMjkuNTg2IDUyOC44ODlIMzI4Ljg4OVY4NDQuNDQ0SDI1Ny43NzhWMTU1LjU1NloiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xMjguODg5IDI1My4zMzNMMTU3Ljc3OCAzNTEuMTExSDE4Mi4yMjJWNzQ2LjY2N0MxNjkuOTQ5IDc0Ni42NjcgMTYwIDc1Ni42MTYgMTYwIDc2OC44ODlWNzk1LjU1NkgxNTUuNTU2QzE0My4yODMgNzk1LjU1NiAxMzMuMzMzIDgwNS41MDUgMTMzLjMzMyA4MTcuNzc4Vjg0NC40NDRIMzgyLjIyMlY4MTcuNzc4QzM4Mi4yMjIgODA1LjUwNSAzNzIuMjczIDc5NS41NTYgMzYwIDc5NS41NTZIMzU1LjU1NlY3NjguODg5QzM1NS41NTYgNzU2LjYxNiAzNDUuNjA2IDc0Ni42NjcgMzMzLjMzMyA3NDYuNjY3SDMwNi42NjdWMjUzLjMzM0gxMjguODg5WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTY3NS41NTYgNzQ2LjY2N0M2NjMuMjgzIDc0Ni42NjcgNjUzLjMzMyA3NTYuNjE2IDY1My4zMzMgNzY4Ljg4OVY3OTUuNTU2SDY0OC44ODlDNjM2LjYxNiA3OTUuNTU2IDYyNi42NjcgODA1LjUwNSA2MjYuNjY3IDgxNy43NzhWODQ0LjQ0NEg4NzUuNTU2VjgxNy43NzhDODc1LjU1NiA4MDUuNTA1IDg2NS42MDYgNzk1LjU1NiA4NTMuMzMzIDc5NS41NTZIODQ4Ljg4OVY3NjguODg5Qzg0OC44ODkgNzU2LjYxNiA4MzguOTQgNzQ2LjY2NyA4MjYuNjY3IDc0Ni42NjdWMzUxLjExMUg4NTEuMTExTDg4MCAyNTMuMzMzSDcwMi4yMjJWNzQ2LjY2N0g2NzUuNTU2WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==",e3="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTAwMHB4IiBoZWlnaHQ9IjEwMDBweCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTMuMiAoNzI2NDMpIC0gaHR0cHM6Ly9za2V0Y2hhcHAuY29tIC0tPgogICAgPHRpdGxlPkFydGJvYXJkPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+CiAgICAgICAgPGxpbmVhckdyYWRpZW50IHgxPSI1MCUiIHkxPSIwJSIgeDI9IjUwJSIgeTI9Ijk5LjI1ODM0MDQlIiBpZD0ibGluZWFyR3JhZGllbnQtMSI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiMyQUFCRUUiIG9mZnNldD0iMCUiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzIyOUVEOSIgb2Zmc2V0PSIxMDAlIj48L3N0b3A+CiAgICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxnIGlkPSJBcnRib2FyZCIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGNpcmNsZSBpZD0iT3ZhbCIgZmlsbD0idXJsKCNsaW5lYXJHcmFkaWVudC0xKSIgY3g9IjUwMCIgY3k9IjUwMCIgcj0iNTAwIj48L2NpcmNsZT4KICAgICAgICA8cGF0aCBkPSJNMjI2LjMyODQxOSw0OTQuNzIyMDY5IEMzNzIuMDg4NTczLDQzMS4yMTY2ODUgNDY5LjI4NDgzOSwzODkuMzUwMDQ5IDUxNy45MTcyMTYsMzY5LjEyMjE2MSBDNjU2Ljc3MjUzNSwzMTEuMzY3NDMgNjg1LjYyNTQ4MSwzMDEuMzM0ODE1IDcwNC40MzE0MjcsMzAxLjAwMzUzMiBDNzA4LjU2NzYyMSwzMDAuOTMwNjcgNzE3LjgxNTgzOSwzMDEuOTU1NzQzIDcyMy44MDY0NDYsMzA2LjgxNjcwNyBDNzI4Ljg2NDc5NywzMTAuOTIxMjEgNzMwLjI1NjU1MiwzMTYuNDY1ODEgNzMwLjkyMjU1MSwzMjAuMzU3MzI5IEM3MzEuNTg4NTUxLDMyNC4yNDg4NDggNzMyLjQxNzg3OSwzMzMuMTEzODI4IDczMS43NTg2MjYsMzQwLjA0MDY2NiBDNzI0LjIzNDAwNyw0MTkuMTAyNDg2IDY5MS42NzUxMDQsNjEwLjk2NDY3NCA2NzUuMTEwOTgyLDY5OS41MTUyNjcgQzY2OC4xMDIwOCw3MzYuOTg0MzQyIDY1NC4zMDEzMzYsNzQ5LjU0NzUzMiA2NDAuOTQwNjE4LDc1MC43NzcwMDYgQzYxMS45MDQ2ODQsNzUzLjQ0ODkzOCA1ODkuODU2MTE1LDczMS41ODgwMzUgNTYxLjczMzM5Myw3MTMuMTUzMjM3IEM1MTcuNzI2ODg2LDY4NC4zMDY0MTYgNDkyLjg2NjAwOSw2NjYuMzQ5MTgxIDQ1MC4xNTAwNzQsNjM4LjIwMDAxMyBDNDAwLjc4NDQyLDYwNS42Njg3OCA0MzIuNzg2MTE5LDU4Ny43ODkwNDggNDYwLjkxOTQ2Miw1NTguNTY4NTYzIEM0NjguMjgyMDkxLDU1MC45MjE0MjMgNTk2LjIxNTA4LDQzNC41NTY0NzkgNTk4LjY5MTIyNyw0MjQuMDAwMzU1IEM1OTkuMDAwOTEsNDIyLjY4MDEzNSA1OTkuMjg4MzEyLDQxNy43NTg5ODEgNTk2LjM2NDc0LDQxNS4xNjA0MzEgQzU5My40NDExNjgsNDEyLjU2MTg4MSA1ODkuMTI2MjI5LDQxMy40NTA0ODQgNTg2LjAxMjQ0OCw0MTQuMTU3MTk4IEM1ODEuNTk4NzU4LDQxNS4xNTg5NDMgNTExLjI5Nzc5Myw0NjEuNjI1Mjc0IDM3NS4xMDk1NTMsNTUzLjU1NjE4OSBDMzU1LjE1NDg1OCw1NjcuMjU4NjIzIDMzNy4wODA1MTUsNTczLjkzNDkwOCAzMjAuODg2NTI0LDU3My41ODUwNDYgQzMwMy4wMzM5NDgsNTczLjE5OTM1MSAyNjguNjkyNzU0LDU2My40OTA5MjggMjQzLjE2MzYwNiw1NTUuMTkyNDA4IEMyMTEuODUxMDY3LDU0NS4wMTM5MzYgMTg2Ljk2NDQ4NCw1MzkuNjMyNTA0IDE4OS4xMzE1NDcsNTIyLjM0NjMwOSBDMTkwLjI2MDI4Nyw1MTMuMzQyNTg5IDIwMi42NTkyNDQsNTA0LjEzNDUwOSAyMjYuMzI4NDE5LDQ5NC43MjIwNjkgWiIgaWQ9IlBhdGgtMyIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgPC9nPgo8L3N2Zz4=",t3="data:image/svg+xml;
52base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMjQwMCAyODAwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNDAwIDI4MDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojRkZGRkZGO30KCS5zdDF7ZmlsbDojOTE0NkZGO30KPC9zdHlsZT4KPHRpdGxlPkFzc2V0IDI8L3RpdGxlPgo8Zz4KCTxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMjIwMCwxMzAwIDE4MDAsMTcwMCAxNDAwLDE3MDAgMTA1MCwyMDUwIDEwNTAsMTcwMCA2MDAsMTcwMCA2MDAsMjAwIDIyMDAsMjAwIAkiLz4KCTxnPgoJCTxnIGlkPSJMYXllcl8xLTIiPgoJCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNNTAwLDBMMCw1MDB2MTgwMGg2MDB2NTAwbDUwMC01MDBoNDAwbDkwMC05MDBWMEg1MDB6IE0yMjAwLDEzMDBsLTQwMCw0MDBoLTQwMGwtMzUwLDM1MHYtMzUwSDYwMFYyMDBoMTYwMAoJCQkJVjEzMDB6Ii8+CgkJCTxyZWN0IHg9IjE3MDAiIHk9IjU1MCIgY2xhc3M9InN0MSIgd2lkdGg9IjIwMCIgaGVpZ2h0PSI2MDAiLz4KCQkJPHJlY3QgeD0iMTE1MCIgeT0iNTUwIiBjbGFzcz0ic3QxIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjYwMCIvPgoJCTwvZz4KCTwvZz4KPC9nPgo8L3N2Zz4K",n3="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNjUgNjUiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI0IiIHg9Ii41IiB5PSIuNSIvPjxkZWZzPjxsaW5lYXJHcmFkaWVudCBpZD0iQSIgeDI9IjUwJSIgeDE9IjUwJSIgeTI9IjEwMCUiIHkxPSIwJSI+PHN0b3Agc3RvcC1jb2xvcj0iIzExMWQyZSIgb2Zmc2V0PSIwJSIvPjxzdG9wIHN0b3AtY29sb3I9IiMwNTE4MzkiIG9mZnNldD0iMjEuMiUiLz48c3RvcCBzdG9wLWNvbG9yPSIjMGExYjQ4IiBvZmZzZXQ9IjQwLjclIi8+PHN0b3Agc3RvcC1jb2xvcj0iIzEzMmU2MiIgb2Zmc2V0PSI1OC4xJSIvPjxzdG9wIHN0b3AtY29sb3I9IiMxNDRiN2UiIG9mZnNldD0iNzMuOCUiLz48c3RvcCBzdG9wLWNvbG9yPSIjMTM2NDk3IiBvZmZzZXQ9Ijg3LjMlIi8+PHN0b3Agc3RvcC1jb2xvcj0iIzEzODdiOCIgb2Zmc2V0PSIxMDAlIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHN5bWJvbCBpZD0iQiI+PGc+PHBhdGggZD0iTTEuMzA1IDQxLjIwMkM1LjI1OSA1NC4zODYgMTcuNDg4IDY0IDMxLjk1OSA2NGMxNy42NzMgMCAzMi0xNC4zMjcgMzItMzJzLTE0LjMyNy0zMi0zMi0zMkMxNS4wMDEgMCAxLjEyNCAxMy4xOTMuMDI4IDI5Ljg3NGMyLjA3NCAzLjQ3NyAyLjg3OSA1LjYyOCAxLjI3NSAxMS4zMjh6IiBmaWxsPSJ1cmwoI0EpIi8+PHBhdGggZD0iTTMwLjMxIDIzLjk4NWwuMDAzLjE1OC03LjgzIDExLjM3NWMtMS4yNjgtLjA1OC0yLjU0LjE2NS0zLjc0OC42NjJhOC4xNCA4LjE0IDAgMCAwLTEuNDk4LjhMLjA0MiAyOS44OTNzLS4zOTggNi41NDYgMS4yNiAxMS40MjRsMTIuMTU2IDUuMDE2Yy42IDIuNzI4IDIuNDggNS4xMiA1LjI0MiA2LjI3YTguODggOC44OCAwIDAgMCAxMS42MDMtNC43ODIgOC44OSA4Ljg5IDAgMCAwIC42ODQtMy42NTZMNDIuMTggMzYuMTZsLjI3NS4wMDVjNi43MDUgMCAxMi4xNTUtNS40NjYgMTIuMTU1LTEyLjE4cy01LjQ0LTEyLjE2LTEyLjE1NS0xMi4xNzRjLTYuNzAyIDAtMTIuMTU1IDUuNDYtMTIuMTU1IDEyLjE3NHptLTEuODggMjMuMDVjLTEuNDU0IDMuNS01LjQ2NiA1LjE0Ny04Ljk1MyAzLjY5NGE2Ljg0IDYuODQgMCAwIDEtMy41MjQtMy4zNjJsMy45NTcgMS42NGE1LjA0IDUuMDQgMCAwIDAgNi41OTEtMi43MTkgNS4wNSA1LjA1IDAgMCAwLTIuNzE1LTYuNjAxbC00LjEtMS42OTVjMS41NzgtLjYgMy4zNzItLjYyIDUuMDUuMDc3IDEuNy43MDMgMyAyLjAyNyAzLjY5NiAzLjcycy42OTIgMy41Ni0uMDEgNS4yNDZNNDIuNDY2IDMyLjFhOC4xMiA4LjEyIDAgMCAxLTguMDk4LTguMTEzIDguMTIgOC4xMiAwIDAgMSA4LjA5OC04LjExMSA4LjEyIDguMTIgMCAwIDEgOC4xIDguMTExIDguMTIgOC4xMiAwIDAgMS04LjEgOC4xMTNtLTYuMDY4LTguMTI2YTYuMDkgNi4wOSAwIDAgMSA2LjA4LTYuMDk1YzMuMzU1IDAgNi4wODQgMi43MyA2LjA4NCA2LjA5NWE2LjA5IDYuMDkgMCAwIDEtNi4wODQgNi4wOTMgNi4wOSA2LjA5IDAgMCAxLTYuMDgxLTYuMDkzeiIvPjwvZz48L3N5bWJvbD48L3N2Zz4=",i3="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTA2IiBoZWlnaHQ9IjEwNiIgdmlld0JveD0iMCAwIDEwNiAxMDYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjUzIiBjeT0iNTMiIHI9IjUzIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTUyLjg1NCA0QzI1LjgzOSA0IDQgMjYgNCA1My4yMTdDNCA3NC45NzMgMTcuOTkzIDkzLjM4OSAzNy40MDUgOTkuOTA3QzM5LjgzMiAxMDAuMzk3IDQwLjcyMSA5OC44NDggNDAuNzIxIDk3LjU0NUM0MC43MjEgOTYuNDA0IDQwLjY0MSA5Mi40OTMgNDAuNjQxIDg4LjQxOEMyNy4wNTEgOTEuMzUyIDI0LjIyMSA4Mi41NTEgMjQuMjIxIDgyLjU1MUMyMi4wMzcgNzYuODQ3IDE4LjgwMSA3NS4zODEgMTguODAxIDc1LjM4MUMxNC4zNTMgNzIuMzY2IDE5LjEyNSA3Mi4zNjYgMTkuMTI1IDcyLjM2NkMyNC4wNTkgNzIuNjkyIDI2LjY0OCA3Ny40MTggMjYuNjQ4IDc3LjQxOEMzMS4wMTUgODQuOTE0IDM4LjA1MiA4Mi43OTYgNDAuODgzIDgxLjQ5MkM0MS4yODcgNzguMzE0IDQyLjU4MiA3Ni4xMTQgNDMuOTU3IDc0Ljg5MkMzMy4xMTggNzMuNzUxIDIxLjcxNCA2OS41MTQgMjEuNzE0IDUwLjYwOUMyMS43MTQgNDUuMjMxIDIzLjY1NCA0MC44MzEgMjYuNzI4IDM3LjQwOUMyNi4yNDMgMzYuMTg3IDI0LjU0NCAzMS4xMzQgMjcuMjE0IDI0LjM3MUMyNy4yMTQgMjQuMzcxIDMxLjMzOSAyMy4wNjcgNDAuNjQgMjkuNDIzQzQ0LjYyMjEgMjguMzQ1NyA0OC43Mjg4IDI3Ljc5NzYgNTIuODU0IDI3Ljc5M0M1Ni45NzkgMjcuNzkzIDYxLjE4NCAyOC4zNjQgNjUuMDY3IDI5LjQyM0M3NC4z
52NjkgMjMuMDY3IDc4LjQ5NCAyNC4zNzEgNzguNDk0IDI0LjM3MUM4MS4xNjQgMzEuMTM0IDc5LjQ2NCAzNi4xODcgNzguOTc5IDM3LjQwOUM4Mi4xMzQgNDAuODMxIDgzLjk5NCA0NS4yMzEgODMuOTk0IDUwLjYwOUM4My45OTQgNjkuNTE0IDcyLjU5IDczLjY2OSA2MS42NyA3NC44OTJDNjMuNDUgNzYuNDQgNjQuOTg2IDc5LjM3MyA2NC45ODYgODQuMDE4QzY0Ljk4NiA5MC42MTggNjQuOTA2IDk1LjkxNSA2NC45MDYgOTcuNTQ0QzY0LjkwNiA5OC44NDggNjUuNzk2IDEwMC4zOTcgNjguMjIyIDk5LjkwOEM4Ny42MzQgOTMuMzg4IDEwMS42MjcgNzQuOTczIDEwMS42MjcgNTMuMjE3QzEwMS43MDcgMjYgNzkuNzg4IDQgNTIuODU0IDRaIiBmaWxsPSIjMjQyOTJGIi8+Cjwvc3ZnPgo=",r3="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIwIiBoZWlnaHQ9IjMyMCIgdmlld0JveD0iMCAwIDMyMCAzMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIzMjAiIGhlaWdodD0iMzIwIiByeD0iMjQiIGZpbGw9ImJsYWNrIi8+CjxwYXRoIGQ9Ik0xNzcuMzE1IDE0NS4zMzVMMjQ1LjA2OCA2N0gyMjkuMDEzTDE3MC4xODIgMTM1LjAxN0wxMjMuMTk1IDY3SDY5TDE0MC4wNTUgMTY5Ljg1NEw2OSAyNTJIODUuMDU2M0wxNDcuMTgzIDE4MC4xNzJMMTk2LjgwNSAyNTJIMjUxTDE3Ny4zMTEgMTQ1LjMzNUgxNzcuMzE1Wk0xNTUuMzIzIDE3MC43NkwxNDguMTI0IDE2MC41MThMOTAuODQxNyA3OS4wMjJIMTE1LjUwM0wxNjEuNzMxIDE0NC43OTJMMTY4LjkzIDE1NS4wMzRMMjI5LjAyIDI0MC41MjVIMjA0LjM1OUwxNTUuMzIzIDE3MC43NjRWMTcwLjc2WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==",s3="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjAwIDEyMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPgogIDxwYXRoIGQ9Ik02MzYgMTIwMWMtMjMuMDIgMC00Ni4wNDIgMC02OS42OTctLjQwOC05Ljc5NC0xLjEzNS0xOC45OTYtMS41MTgtMjguMTAxLTIuNjY1LTE2LjQyNC0yLjA2Ny0zMi45Ni0zLjc3NS00OS4xNC03LjEyNi0yMS42OTYtNC40OTQtNDMuMjM2LTkuOTA3LTY0LjU4OS0xNS44NDItMjQuMjYtNi43NDMtNDcuNjQ1LTE2LjAyLTcwLjU3Ny0yNi40OC0yNi4yMjYtMTEuOTYzLTUxLjkxMy0yNC45NjQtNzUuNzk4LTQxLjA5OC0xOC43NDYtMTIuNjYzLTM3LjA1Ny0yNi4wNC01NC44OTktMzkuOTQ4LTEzLjU1LTEwLjU2My0yNi43MjktMjEuNzkxLTM4Ljg2Ni0zMy45My0xNi4xOS0xNi4xOS0zMS42NTgtMzMuMTYyLTQ2LjU4Mi01MC41MzItMTAuOTY1LTEyLjc2Mi0yMS4yMS0yNi4yNjUtMzAuNTk3LTQwLjIzLTExLjM3OS0xNi45MjUtMjIuMTc4LTM0LjMyMS0zMi4wMS01Mi4xODUtMTAuMTM2LTE4LjQyLTE5LjYyOC0zNy4yOTUtMjcuOTE3LTU2LjYwOC0xMC43NDEtMjUuMDI1LTE5LjkzMS01MC43MjQtMjYuMjE0LTc3LjMwNy00LjU5Mi0xOS40MjctOS4yOTgtMzguODYzLTEyLjgxMy01OC40OTktMi42NjYtMTQuODkyLTMuNS0zMC4xMS01LjI3Mi00NS4xNjdDMi44MDQgNjUxLjkyMiAxLjY2NiA2NTAuOTg5IDEgNjUwYzAtLjQ0NCAwLS44ODkuMzk5LTEuODIuMTMzLTMuNzE4LS4xMzMtNi45NS0uMzk5LTEwLjE4IDAtMjQuMzU0IDAtNDguNzA4LjM5OS03My42ODUuMTMzLTMuODUzLS4xMzMtNy4wODQtLjM5OS0xMC4zMTUgMC0uNDQ0IDAtLjg4OS4zOTEtMS43OS43OTUtMS4xMzggMS40ODUtMS43ODkgMS41Ni0yLjUwMy43NC03LjE1NiAxLjI0Ni0xNC4zMzggMi4wOC0yMS40ODIgMS4yMjgtMTAuNSAyLjAyOS0yMS4xMDcgNC4xNjMtMzEuNDMgMy44MS0xOC40MjYgOC4zMDMtMzYuNzE3IDEyLjgyNy01NC45ODYgNy44ODUtMzEuODQgMTkuNDA0LTYyLjQ2NyAzMy4yMTMtOTIuMTExIDE1LjM3NS0zMy4wMDcgMzMuMzUzLTY0LjU4NCA1NC41MjMtOTQuMzg1IDE2LjM2NC0yMy4wMzYgMzQuMTc3LTQ0LjggNTMuMjE3LTY1LjU2NSA5LjczNS0xMC42MTcgMjAuNTg5LTIwLjIxMyAzMS4wMS0zMC4xOTUgMTcuMjMtMTYuNTA2IDM1Ljg4Mi0zMS4yNSA1NS4xNDItNDUuMzMgMjEuODk3LTE2LjAwOSA0NC42NDctMzAuNjc4IDY4LjczLTQzLjAxIDIwLjgyOC0xMC42NjggNDIuMTE4LTIwLjY2NSA2My45LTI5LjE3NyAyMS43NDUtOC40OTggNDQuMTcxLTE1LjQyNiA2Ni42MzYtMjEuODYzIDIzLjkyMS02Ljg1NCA0OC4zNTQtMTEuNzI4IDczLjE5LTE0LjE4IDEzLjgyNC0xLjM2NSAyNy42NTgtMi42NSA0MS40ODItNC4wMjQgMS0uMSAxLjk1OC0uNjM2IDIuOTM2LS45NjkgMjMuMDIgMCA0Ni4wNDIgMCA2OS42OTcuNDA4IDkuNzk3IDEuMTM1IDE5LjAwMyAxLjUxMyAyOC4xMTEgMi42NjYgMTYuMjY0IDIuMDYgMzIuNjM0IDMuNzg5IDQ4LjY1NyA3LjExMyAyMS44NiA0LjUzNiA0My41NzYgOS45MzYgNjUuMSAxNS44ODMgMjQuMjggNi43MSA0Ny42NDEgMTYuMDY5IDcwLjYwNyAyNi40NzQgMjUuOTc2IDExLjc3IDUxLjA4MiAyNS4xMTggNzUuMTUgNDAuMzYgMzIuMDkgMjAuMzI0IDYxLjk2NyA0My42MjYgODkuNTUgNjkuNjk4IDEzLjY5NSAxMi45NDUgMjYuNjIgMjYuNzk2IDM5LjAwNCA0MS4wMTIgMTIuNDkgMTQuMzM5IDI0LjAyNyAyOS41MjMgMzUuNzE1IDQ0LjU0NCAxNi4xNzQgMjAuNzg3IDI5LjczNCA0My4zMjQgNDIuMTc3IDY2LjQ0MiAxOS41ODkgMzYuMzk3IDM1LjU1NCA3NC40MTggNDcuMDc2IDExNC4xNTMgNC43NDEgMTYuMzUyIDguNTM4IDMzLjAxIDEyLjAzOSA0OS42OCAyLjkyNSAxMy45MyA1LjE2NCAyOC4wMzMgNy4wMjQgNDIuMTUgMS44MTUgMTMuNzY4IDIuNzUgMjcuNjUyIDQuMTI0IDQxLjQ4LjEgMS4wMDEuNjM2IDEuOTYuOTY5IDIuOTM3IDAgMjMuMDIgMCA0Ni4wNDItLjQwOCA2OS42OTctMS4xMzUgOS43OTctMS41MTMgMTkuMDAzLTIuNjY2IDI4LjExMS0yLjA2IDE2LjI2NC0zLjgxNyAzMi42MjYtNy4xMDcgNDguNjU5LTQuNDU4IDIxLjcyMS05LjYxMyA0My4zNDctMTUuNjE2IDY0LjY5MS03LjE2MyAyNS40NzItMTYuODc1IDUwLjExLTI4IDc0LjEyNy0xMS45NzggMjUuODU4LTI1LjQ3MyA1MC45MjYtNDAuOTE4IDc0Ljg5M2E1OTguNSA1OTguNSAwIDAgMS02Ny44OSA4Ni42OWMtMTIuOTMzIDEzLjcwNS0yNi43OTIgMjYuNjI0LTQxLjA
52wOCAzOS4wMDctMTQuMzQgMTIuNDkxLTI5LjUyMyAyNC4wMjgtNDQuNTQ1IDM1LjcxNi0yMC43ODYgMTYuMTc0LTQzLjMyMyAyOS43MzQtNjYuNDQyIDQyLjE3Ny0zNi4zOTcgMTkuNTg5LTc0LjQxOCAzNS41NTQtMTE0LjE1MyA0Ny4wNzYtMTYuMzUyIDQuNzQxLTMzLjAxIDguNTM4LTQ5LjY4IDEyLjAzOS0xMy45MyAyLjkyNS0yOC4wMzQgNS4xNjQtNDIuMTUgNy4wMjUtMTMuNzY4IDEuODE0LTI3LjY1MiAyLjc0OC00MS40OCA0LjEyMy0xLjAwMS4xLTEuOTYuNjM2LTIuOTM3Ljk2OW0xNzkuOTM0LTg1NS45NDhzLS4wMjQuMDg3LjA0LS42NDNjLTEuMjg4LTEuNjctMi42My0zLjMtMy44NTgtNS4wMTQtOS42ODgtMTMuNTE5LTE3Ljk2NS0yNy44Mi0yNC4xMTQtNDMuMzE3LTYuMzMzLTE1Ljk2LTEwLjY0OC0zMi4zOTctMTIuMDA0LTQ5LjU1Ni0uNTA0LTYuMzY3LTEtMTIuNzMzLTEuNTItMTkuMzczLTExLjc1IDAtMjMuNTIgMC0zNS40MzYtLjE4NSAwIDAtLjE4Ni0uMTQ2LS40NjMtLjg4NmwtMy40OTItMzIuODU2SDYwMHY2LjA4NWMwIDE3Ny4wNzktLjAxNyAzNTQuMTU3LjAyOSA1MzEuMjM2LjAwNCAxNS42MDItMy44OTMgMzAuMzE0LTEwLjQ3NiA0NC4xODQtMTEuNjY4IDI0LjU4LTI5LjkxIDQyLjgwNS01NC43NTMgNTQuMzMzLTIzLjU4NiAxMC45NDUtNDcuOTU4IDEzLjY1NC03My4xMzIgNy4xMTMtOC4wNC0yLjA4OS0xNS43ODgtNS4zMDYtMjQuMjY1LTguMjUzLS44LS42OTUtMS42LTEuMzktMi40MjItMi43OS0yNi4xNy00MC43MDctMjguNTk2LTgzLjExMS0yLjI0OC0xMjMuNDc3IDMwLjA1OS00Ni4wNTEgNzQuMjQ5LTYxLjIwOCAxMjcuODktNDcuODc4VjUxNS4zMDdjLTEzLjA1LS4zOTMtMjUuNzQyLS43NzYtMzguNTgtMS4zNDMgMCAwLS4xODctLjE0NS0uMDU4LTEuMDVWNDgxLjQ5Yy0xMS4zODYtLjUwNC0yMi41My0xLjYyMy0zMy42MzYtMS4zMzMtMTQuNDUuMzc2LTI5LjAzOC44NDUtNDMuMjY0IDMuMTQ3LTE3LjE4NiAyLjc4MS0zMy44ODcgNy44NzgtNTAuMTQyIDE0LjU0LTI3LjY5NCAxMS4zNS01Mi42MzkgMjYuODM3LTc0LjQzNCA0Ny4yNzctNy40ODUgNy4wMi0xNC40NzUgMTQuNjA0LTIxLjMwOSAyMi4yNzItMTEuMDY0IDEyLjQxNS0yMC4yMzcgMjYuMTg3LTI4LjI0MiA0MC43NjQtMTEuMzYgMjAuNjg1LTE5Ljk3IDQyLjQ4MS0yNC42NzggNjUuNTU1LTIuNzY1IDEzLjU0OC0zLjgyNyAyNy40NjktNS4xNzMgNDEuMjY5LS42MjcgNi40MzItLjQ0IDEyLjk5Ny0uMDM1IDE5LjQ2NS43NiAxMi4xMTUgMS4wMjkgMjQuMzY3IDMuMTQyIDM2LjI3IDQuODYyIDI3LjM3OCAxMy45ODMgNTMuMzc0IDI3LjggNzcuNjU4IDE0LjY0IDI1LjczIDMzLjAyNCA0OC4zNDMgNTUuNTI1IDY3LjU2MyAzLjkwMSAzLjMzMiA4LjMzMSA2LjA0NiAxMi40ODkgOS4wMzQgMCAwLS4wMTMtLjAyNy4wNC41Ni41OS40OSAxLjE3OC45ODEgMi4wNTggMi4xMTEgMi4yOSAxLjg0MiA0LjU4MSAzLjY4MyA3LjA5MiA2LjA4LjY0Mi40IDEuMjg0Ljc5OCAxLjg0MyAxLjIzIDAgMCAuMDEyLS4wODguMDcuNjAxIDEyLjc3NCAxMC41MjEgMjUuMDEgMjEuNzk0IDM4LjQ0MyAzMS4zOSAyMS4wOCAxNS4wNTYgNDQuNjMgMjUuNDM1IDY5LjUzIDMyLjYxIDE4LjQzIDUuMzEyIDM3LjMxMiA4LjM2MyA1Ni40MTUgOS4zMiAxOC40NzEuOTI3IDM2Ljg2Ny0uNTY4IDU1LjE0NS0zLjc5NSAyNy4wMS00Ljc3IDUyLjQ0OS0xMy43MDcgNzYuNDA0LTI3LjA1OSAyNi4xMDMtMTQuNTQ4IDQ4LjgyNS0zMy4xMjYgNjguMjk3LTU1LjgwNyAxMi44MjktMTQuOTQ0IDI0LjIxLTMwLjkxMyAzMi41MjUtNDguNzAyIDYuNTgtMTQuMDggMTIuMDEyLTI4Ljc2MiAxNy4wMy00My40OTEgNi45MDctMjAuMjY1IDkuODA1LTQxLjQ4IDkuOTAzLTYyLjczMS40MTctOTAuMTQzLjE3Ny0xODAuMjg4LjE3Ny0yNzAuNDMzdi02Ljc0NGM1Ni42NSAzOC45MiAxMTguMDM4IDU4Ljk2NiAxODUuNzQzIDU4Ljk4NXYtMTM0LjUyYy04LjU4Ni0uODc2LTE2LjkwNC0xLjY3Ni0yNS4yMDktMi41OTUtNC41MjQtLjUtOS4wMjUtMS4yMDMtMTQuMDgtMi4wMjUtLjIwNi0uMzE3LS40MTMtLjYzNS0uMjI2LTEuNzE5di0yNy43NDVjLTcuODE4LS44Mi0xNS43ODgtMS42Ni0yMy43NTktMi40ODktMTMuOTE4LTEuNDQ2LTI3LjQ0LTQuNzU4LTQwLjMwNi0xMC4xMDUtMTEuMDE3LTQuNTc4LTIxLjYwNS0xMC4xOS0zMi40NjYtMTUuNDc0IDAgMC0uMjM0LS4yLS42NjQtLjgyM2EyMSAyMSAwIDAgMS0yLjY4LS43MzJjLTEuMTczLTEuMjg4LTIuMzQ2LTIuNTc3LTMuNTMtNC40ODctLjY1OS0uNDM1LTEuMzE4LS44Ny0xLjg4OS0xLjMzIiBzdHlsZT0iLS1kYXJrcmVhZGVyLWlubGluZS1maWxsOnZhcigtLWRhcmtyZWFkZXItYmFja2dyb3VuZC0wMDAwMDAsICMwMDAwMDApOy0tZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlOm5vbmU7dmlzaWJpbGl0eTp2aXNpYmxlO29wYWNpdHk6MSIgZGF0YS1pbmRleD0iMCIvPgogIDxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0xIDU1NC40NTRjLjI2NiAyLjc3Ny41MzIgNi4wMDguMzk5IDkuMzkyQzEgNTYwLjk3IDEgNTU3Ljk0IDEgNTU0LjQ1NCIgc3R5bGU9Ii0tZGFya3JlYWRlci1pbmxpbmUtZmlsbDp2YXIoLS1kYXJrcmVhZGVyLXRleHQtZmZmZmZmLCAjZThlNmUzKTstLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZTpub25lO3Zpc2liaWxpdHk6dmlzaWJsZSIgZGF0YS1pbmRleD0iNSIvPgogIDxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0xIDYzOC40NTRjLjI2NiAyLjc3Ny41MzIgNi4wMDguMzk5IDkuMzkyQzEgNjQ0Ljk3IDEgNjQxLjk0IDEgNjM4LjQ1NCIgc3R5bGU9Ii0tZGFya3JlYWRlci1pbmxpbmUtZmlsbDp2YXIoLS1kYXJrcmVhZGVyLXRleHQtZmZmZmZmLCAjZThlNmUzKTstLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZTpub25lO3Zpc2liaWxpdHk6dmlzaWJsZSIgZGF0YS1pbmRleD0iNiIvPgogIDxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik04MjQuNDYzIDM1Mi4y
52MjJzLjIzNC4yLjA1NC42MjljNC44OTggNS4zNjIgOS44NTcgMTAuNDI1IDE1LjA3NSAxNS4yMDYgMTUuMjUgMTMuOTcxIDMyLjY5NCAyNC41NTYgNTEuOTIzIDMxLjk2NCA5LjUxNCAzLjY2NiAxOS41MyA2LjAyOSAyOS4zMTkgOC45OC4yMDcuMzE5LjQxNC42MzcuODkzIDEuNTE3LjI3MiAzNS4xMzUuMjcyIDY5LjcwOC4yNzIgMTA0LjU3OS0zMy44NjYtLjA1Ni02Ni4yMDMtNS4wODctOTcuNzc1LTE1LjEyNC0zMS41MTYtMTAuMDItNjAuNzIyLTI0Ljc0NS04OC4yMjQtNDMuOTcyIDAgMS41NDYuMDAzIDIuMzY1IDAgMy4xODQtLjMzMyA5NC4yMzUtLjU3NiAxODguNDctMS4xMzEgMjgyLjcwMy0uMDYgMTAuMTIxLTEuMjA0IDIwLjM3My0zLjEyOCAzMC4zMTctMy41NTMgMTguMzU1LTkuMDQ5IDM2LjE1LTE2LjQ2IDUzLjQ0Mi0xMS4xMzkgMjUuOTkxLTI2LjI5IDQ5LjI4OS00NS41MTMgNjkuODAxLTkuMzMgOS45NTYtMTkuNTczIDE5LjMxLTMwLjUxOCAyNy40MzQtMTIuODk5IDkuNTc1LTI2LjU4OCAxOC4yOS00MC42OTQgMjUuOTg0YTE5MC4zIDE5MC4zIDAgMCAxLTU1LjMxIDE5LjgzOGMtMTUuODY4IDMuMDQxLTMyLjA0OCA0LjY4LTQ4LjE2NCA2LjExOC03LjgzNy42OTgtMTUuODk5LS4wMDgtMjMuNzYtLjkyNi0xMy45MzQtMS42MjctMjcuOTY3LTMuMTAyLTQxLjY0NC02LjA4NS0yMi42OS00Ljk0OC00NC4wNzEtMTMuNjQyLTY0LjExMi0yNS41My00LjY1OS0yLjc2My05LjY1My00Ljk2LTE0LjQ5My03LjQxOCAwIDAtLjAxMi4wODcuMjE0LS4yNjctLjYxMy0uNzEyLTEuNDUtMS4wNzEtMi4yOS0xLjQzLTIuMjktMS44NDItNC41OC0zLjY4My02Ljk2NS02LjIxLS43MzQtMS4xMjktMS4zNzYtMS41Ny0yLjAxNy0yLjAxMyAwIDAgLjAxMy4wMjcuMjAzLS4zMDYtLjk1NS0xLjkzOS0xLjk4Mi0zLjY0NC0zLjI2Mi01LjEzMi0xNC44NTEtMTcuMjc1LTI2LjU3Ni0zNi40NjgtMzUuOTQ0LTU3LjIyLTExLjc2NS0yNi4wNjYtMTkuMDc1LTUzLjM5NS0yMC42OC04MS43ODgtMS4wNS0xOC41OTQtLjAwOS0zNy40NzggMi4wMS01Ni4wMjQgMS45MzgtMTcuODE4IDcuMTE4LTM1LjEzMSAxMy42LTUxLjk4NSAxMS4yMDUtMjkuMTI2IDI3LjI3Ni01NS4yODUgNDguNDQtNzguMDY0IDEwLjA4NC0xMC44NTQgMjEuMzI1LTIwLjgxMiAzMi45NjgtMzAuMDAzIDE5LjUwNy0xNS4zOTkgNDEuMjMzLTI3LjA3MiA2NC42OTUtMzUuNTU0IDI1LjgyOC05LjMzNyA1Mi40MDMtMTQuMzAyIDc5LjgxMS0xNS4wNDggMCAwIC4xODYuMTQ1LjE3OS42OS0uMDA3IDM1LjQ1OS0uMDA3IDcwLjM3NC0uMDA3IDEwNS4yMjctOS4xNzQtMS42NDMtMTcuNzQ2LTMuODQ2LTI2LjQ0Mi00LjU4LTEzLjY3Ni0xLjE1NC0yNy4xNy43MjMtNDAuMzIgNC44NTUtMjcuODg4IDguNzY0LTQ5LjQwMSAyNS44My02NC4xMDYgNTAuODgtMTIuNzg5IDIxLjc4Ni0xNy42MzcgNDUuNDY5LTE0LjI3NyA3MC44MTUgMi4wNyAxNS42MTggNy4wMDggMzAuMDc2IDE1LjE4OSA0My4zOTQgMTAuNjYgMTcuMzUzIDI0Ljc1IDMxLjIzNiA0
52Mi45MyA0MC43MzQuOC42OTYgMS42IDEuMzkxIDIuNzEyIDIuNTU0IDcuNDU1IDEwLjUyMiAxNi4zMzYgMTguODE3IDI2LjUzNSAyNS42MzcgMjUuNDA2IDE2Ljk4OSA1My4zMjIgMjMuNTA5IDgzLjM5NiAxNy43OTMgMzAuNDQtNS43ODUgNTQuNDk3LTIyLjE4NyA3Mi4xOTMtNDcuNTE2IDExLjI3NS0xNi4xMzkgMTguODUxLTM0LjMyOCAxOC45MzgtNTMuOTgyLjcyOC0xNjQuMTg0Ljg5My0zMjguMzcgMS4yMi00OTIuNTU2LjAzLTE1LjE1OC4wMDQtMzAuMzE3LjAwNC00NS40NzZWMjI3YzIuNSAwIDQuNDU5LjAwMyA2LjQxNyAwbDkyLjQ0LS4xODJzLjE4NS4xNDYuMTc4LjYzOGMtLjAxMS45OS0uMTE4IDEuNTE1LS4wMDYgMS45ODYgNC41MjMgMTkuMDI3IDEwLjY0MiAzNy4zOCAyMC4zMzQgNTQuNTY3IDExLjg2OCAyMS4wNDggMjcuMzMgMzguOTA3IDQ1LjY3NiA1NC4zODUgMy4yMjUgMi43MiA3LjIyNyA0LjUyIDEwLjg3IDYuNzQ1IDAgMCAuMDI1LS4wODctLjIyOC4yMzYuNTQ5Ljc1OCAxLjM1MSAxLjE5MyAyLjE1MyAxLjYyOGEyMTMgMjEzIDAgMCAwIDQuMDUgNC4zNTdjMS4yMTUuNjE1IDEuODk3LjczOSAyLjU3OS44NjIiIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLWZpbGw6dmFyKC0tZGFya3JlYWRlci1iYWNrZ3JvdW5kLWZmZmZmZiwgIzE4MWExYik7LS1kYXJrcmVhZGVyLWlubGluZS1zdHJva2U6bm9uZTtvcGFjaXR5OjEiIGRhdGEtaW5kZXg9IjciLz4KICA8cGF0aCBmaWxsPSIjRkUyQzU1IiBkPSJNMzUxLjEwMiA5MzUuMjA3YzQuODEgMi4xMTMgOS44MDUgNC4zMSAxNC40NjQgNy4wNzQgMjAuMDQgMTEuODg4IDQxLjQyMyAyMC41ODIgNjQuMTEyIDI1LjUzIDEzLjY3NyAyLjk4MyAyNy43MSA0LjQ1OCA0MS42NDUgNi4wODUgNy44Ni45MTggMTUuOTIyIDEuNjI0IDIzLjc1OS45MjYgMTYuMTE2LTEuNDM3IDMyLjI5Ni0zLjA3NyA0OC4xNjQtNi4xMThhMTkwLjMgMTkwLjMgMCAwIDAgNTUuMzEtMTkuODM4YzE0LjEwNi03LjY5NSAyNy43OTUtMTYuNDA5IDQwLjY5NC0yNS45ODQgMTAuOTQ1LTguMTI1IDIxLjE4Ny0xNy40NzggMzAuNTE4LTI3LjQzNCAxOS4yMjMtMjAuNTEyIDM0LjM3NC00My44MSA0NS41MTMtNjkuOCA3LjQxMS0xNy4yOTQgMTIuOTA3LTM1LjA4OCAxNi40Ni01My40NDMgMS45MjQtOS45NDQgMy4wNjgtMjAuMTk2IDMuMTI4LTMwLjMxNy41NTUtOTQuMjMzLjc5OC0xODguNDY4IDEuMTMtMjgyLjcwMy4wMDQtLjgyLjAwMS0xLjYzOC4wMDEtMy4xODQgMjcuNTAyIDE5LjIyNyA1Ni43MDggMzMuOTUzIDg4LjIyNCA0My45NzIgMzEuNTcyIDEwLjAzNyA2My45MSAxNS4wNjggOTcuNzc1IDE1LjEyNGwtLjAwMS0xMDQuNDc0YzQuNTEuMTU0IDkuMDEyLjg1NyAxMy41MzYgMS4zNTcgOC4zMDUuOTE5IDE2LjYyMyAxLjcxOSAyNS4yMDkgMi41OTZ2MTM0LjUxOWMtNjcuNzA1LS4wMi0xMjkuMDkzLTIwLjA2Ni0xODUuNzQzLTU4Ljk4NXY2Ljc0NGMwIDkwLjE0NS4yNCAxODAuMjktLjE3NyAyNzAuNDMzLS4wOTggMjEuMjUxLTIuOTk2IDQyLjQ2Ni05LjkwMiA2Mi43My01LjAyIDE0LjczLTEwLjQ1IDI5LjQxMi0xNy4wMzEgNDMuNDkyLTguMzE0IDE3Ljc4OS0xOS42OTYgMzMuNzU4LTMyLjUyNSA0OC43MDItMTkuNDcyIDIyLjY4LTQyLjE5NCA0MS4yNTktNjguMjk3IDU1LjgwNy0yMy45NTUgMTMuMzUyLTQ5LjM5NSAyMi4yOS03Ni40MDQgMjcuMDU5LTE4LjI3OCAzLjIyNy0zNi42NzQgNC43MjItNTUuMTQ1IDMuNzk2LTE5LjEwMy0uOTU4LTM3Ljk4NC00LjAwOS01Ni40MTUtOS4zMi0yNC45LTcuMTc2LTQ4LjQ1LTE3LjU1NS02OS41My0zMi42MTEtMTMuNDM0LTkuNTk2LTI1LjY3LTIwLjg2OS0zOC40NzItMzEuNzM1IiBzdHlsZT0iLS1kYXJrcmVhZGVyLWlubGluZS1maWxsOnZhcigtLWRhcmtyZWFkZXItYmFja2dyb3VuZC1mZTJjNTUsICNiMTAxMjMpOy0tZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlOm5vbmU7dmlzaWJpbGl0eTp2aXNpYmxlO29wYWNpdHk6MSIgZGF0YS1pbmRleD0iOCIvPgogIDxwYXRoIGZpbGw9IiMyNUY0RUUiIGQ9Ik03MzguNzE4IDIyNi40NDhjLTMwLjY3NS40MzEtNjEuNDg4LjQ5Mi05Mi4zMDEuNTUxLTEuOTU4LjAwNC0zLjkxNi4wMDEtNi40MTcuMDAxdjUuMjg4YzAgMTUuMTU5LjAyNiAzMC4zMTgtLjAwNCA0NS40NzYtLjMyNyAxNjQuMTg2LS40OTIgMzI4LjM3Mi0xLjIyIDQ5Mi41NTYtLjA4NyAxOS42NTQtNy42NjMgMzcuODQzLTE4LjkzOCA1My45ODItMTcuNjk2IDI1LjMyOS00MS43NTMgNDEuNzMtNzIuMTkzIDQ3LjUxNi0zMC4wNzQgNS43MTYtNTcuOTktLjgwNC04My4zOTYtMTcuNzkzLTEwLjE5OS02LjgyLTE5LjA4LTE1LjExNS0yNi4yMzctMjUuNTE0IDcuODY4IDIuMzU2IDE1LjYxNiA1LjU3MyAyMy42NTYgNy42NjIgMjUuMTc0IDYuNTQxIDQ5LjU0NiAzLjgzMiA3My4xMzItNy4xMTMgMjQuODQzLTExLjUyOCA0My4wODUtMjkuNzUzIDU0Ljc1My01NC4zMzMgNi41ODMtMTMuODcgMTAuNDgtMjguNTgyIDEwLjQ3Ni00NC4xODQtLjA0Ni0xNzcuMDc5LS4wMjktMzU0LjE1Ny0uMDI5LTUzMS4yMzZ2LTYuMDg1aDEzNS4wODdjMS4xODIgMTEuMTE1IDIuMzM3IDIxLjk4NSAzLjYzIDMzLjIyNiIgc3R5bGU9Ii0tZGFya3JlYWRlci1pbmxpbmUtZmlsbDp2YXIoLS1kYXJrcmVhZGVyLWJhY2tncm91bmQtMjVmNGVlLCAjMDliM2IwKTstLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZTpub25lO29wYWNpdHk6MSIgZGF0YS1pbmRleD0iOSIvPgogIDxwYXRoIGZpbGw9IiMyNUY0RUUiIGQ9Ik01MjEuOTIgNTEzLjM2N2MtMjcuNDcyIDEuMTk4LTU0LjA0NyA2LjE2My03OS44NzUgMTUuNS0yMy40NjIgOC40ODItNDUuMTg4IDIwLjE1NS02NC42OTUgMzUuNTU0LTExLjY0MyA5LjE5MS0yMi44ODQgMTkuMTQ5LTMyLjk2OSAzMC4wMDMtMjEuMTYzIDIyLjc3OS0zNy4yMzQgN
52DguOTM4LTQ4LjQzOCA3OC4wNjQtNi40ODMgMTYuODU0LTExLjY2MyAzNC4xNjctMTMuNjAyIDUxLjk4NS0yLjAxOCAxOC41NDYtMy4wNTkgMzcuNDMtMi4wMDggNTYuMDI0IDEuNjA0IDI4LjM5MyA4LjkxNCA1NS43MjIgMjAuNjggODEuNzg4IDkuMzY3IDIwLjc1MiAyMS4wOTIgMzkuOTQ1IDM1Ljk0MyA1Ny4yMiAxLjI4IDEuNDg4IDIuMzA3IDMuMTkzIDMuMjc2IDUuMTM3LTQuMzYyLTIuNjYtOC43OTItNS4zNzQtMTIuNjkzLTguNzA2LTIyLjUwMS0xOS4yMi00MC44ODUtNDEuODMyLTU1LjUyNS02Ny41NjMtMTMuODE3LTI0LjI4NC0yMi45MzgtNTAuMjgtMjcuOC03Ny42NTgtMi4xMTMtMTEuOTAzLTIuMzgyLTI0LjE1NS0zLjE0Mi0zNi4yNy0uNDA2LTYuNDY4LS41OTItMTMuMDMzLjAzNS0xOS40NjUgMS4zNDYtMTMuOCAyLjQwOC0yNy43MjEgNS4xNzMtNDEuMjY5IDQuNzA5LTIzLjA3NCAxMy4zMTktNDQuODcgMjQuNjc4LTY1LjU1NSA4LjAwNS0xNC41NzcgMTcuMTc4LTI4LjM1IDI4LjI0Mi00MC43NjQgNi44MzQtNy42NjggMTMuODI0LTE1LjI1MyAyMS4zMDktMjIuMjcyIDIxLjc5NS0yMC40NCA0Ni43NC0zNS45MjcgNzQuNDM0LTQ3LjI3NyAxNi4yNTUtNi42NjIgMzIuOTU2LTExLjc1OSA1MC4xNDItMTQuNTQgMTQuMjI2LTIuMzAyIDI4LjgxMy0yLjc3IDQzLjI2NC0zLjE0NyAxMS4xMDctLjI5IDIyLjI1LjgyOSAzMy42MzYgMS4zMzMgMCAxMS4xNDUgMCAyMS4yODUtLjA2NCAzMS44NzgiIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLWZpbGw6dmFyKC0tZGFya3JlYWRlci1iYWNrZ3JvdW5kLTI1ZjRlZSwgIzA5YjNiMCk7LS1kYXJrcmVhZGVyLWlubGluZS1zdHJva2U6dmFyKC0tZGFya3JlYWRlci10ZXh0LTBkOTlmZiwgIzIzYTNmZik7b3BhY2l0eToxIiBkYXRhLWluZGV4PSIxMCIvPgogIDxwYXRoIGZpbGw9IiNGRTJDNTUiIGQ9Ik00MzQuOTkyIDgyNS40ODJjLTE4LjE3LTkuMTQ2LTMyLjI2LTIzLjAyOS00Mi45Mi00MC4zODItOC4xOC0xMy4zMTgtMTMuMTItMjcuNzc2LTE1LjE5LTQzLjM5NC0zLjM1OS0yNS4zNDYgMS40OS00OS4wMjkgMTQuMjc4LTcwLjgxNSAxNC43MDUtMjUuMDUgMzYuMjE4LTQyLjExNiA2NC4xMDYtNTAuODggMTMuMTUtNC4xMzIgMjYuNjQ0LTYuMDA5IDQwLjMyLTQuODU1IDguNjk2LjczNCAxNy4yNjggMi45MzcgMjYuNDQyIDQuNTggMC0zNC44NTMgMC02OS43NjguMDgtMTA1LjEzNSAxMi43NzMtLjA3IDI1LjQ2Ni4zMTMgMzguNTE0LjcwNnYxMzguNDY4Yy01My42NC0xMy4zMy05Ny44MyAxLjgyNy0xMjcuODkgNDcuODc4LTI2LjM0NyA0MC4zNjYtMjMuOTIxIDgyLjc3IDIuMjYgMTIzLjgyOSIgc3R5bGU9Ii0tZGFya3JlYWRlci1pbmxpbmUtZmlsbDp2YXIoLS1kYXJrcmVhZGVyLWJhY2tncm91bmQtZmUyYzU1LCAjYjEwMTIzKTstLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZTpub25lO29wYWNpdHk6MSIgZGF0YS1pbmRleD0iMTEiLz4KICA8cGF0aCBmaWxsPSIjRkUyQzU1IiBkPSJNODE1Ljk0MiAzNDQuNzc0Yy0zLjY3Ni0xLjg2LTcuNjc4LTMuNjYtMTAuOTAzLTYuMzgtMTguMzQ1LTE1LjQ3OC0zMy44MDgtMzMuMzM3LTQ1LjY3Ni01NC4zODUtOS42OTItMTcuMTg3LTE1LjgxMS0zNS41NC0yMC4zMzQtNTQuNTY3LS4xMTItLjQ3MS0uMDA1LS45OTUuMDgtMS44OTQgMTEuODQ5LS4zOTkgMjMuNjE4LS4zOTkgMzUuMzY5LS4zOTkuNTIgNi42NCAxLjAxNiAxMy4wMDYgMS41MiAxOS4zNzMgMS4zNTYgMTcuMTYgNS42NyAzMy41OTUgMTIuMDA0IDQ5LjU1NiA2LjE1IDE1LjQ5OCAxNC40MjYgMjkuNzk4IDI0LjExNCA0My4zMTcgMS4yMjcgMS43MTMgMi41NyAzLjM0NCAzLjgyNiA1LjM3OSIgc3R5bGU9Ii0tZGFya3JlYWRlci1pbmxpbmUtZmlsbDp2YXIoLS1kYXJrcmVhZGVyLWJhY2tncm91bmQtZmUyYzU1LCAjYjEwMTIzKTstLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZTpub25lIiBkYXRhLWluZGV4PSIxMiIvPgogIDxwYXRoIGZpbGw9IiMyNUY0RUUiIGQ9Ik05MjEuMDMgNDA4LjYxOWMtOS45ODUtMi41Ny0yMC00LjkzMi0yOS41MTUtOC41OTgtMTkuMjMtNy40MDgtMzYuNjczLTE3Ljk5My01MS45MjMtMzEuOTY0LTUuMjE4LTQuNzgtMTAuMTc3LTkuODQ0LTE1LjAzMy0xNS4xNDEgMTEgNC43OTIgMjEuNTg3IDEwLjQwMyAzMi42MDQgMTQuOTgxIDEyLjg2NyA1LjM0NyAyNi4zODggOC42NiA0MC4zMDYgMTAuMTA1IDcuOTcxLjgyOCAxNS45NCAxLjY3IDIzLjc1OSAyLjQ5IDAgOS4wODYgMCAxOC40MTUtLjE5NyAyOC4xMjciIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLWZpbGw6dmFyKC0tZGFya3JlYWRlci10ZXh0LTI1ZjRlZSwgIzM2ZjVlZik7LS1kYXJrcmVhZGVyLWlubGluZS1zdHJva2U6dmFyKC0tZGFya3JlYWRlci10ZXh0LTBkOTlmZiwgIzIzYTNmZik7b3BhY2l0eToxIiBkYXRhLWluZGV4PSIxMyIvPgogIDxwYXRoIGZpbGw9IiNGRTJDNTUiIGQ9Ik04MTcuODI5IDM0Ni42OTJhMy41IDMuNSAwIDAgMS0yLjE5Mi0xLjMwNWMuODY4LjEyNCAxLjUyNy41NTkgMi4xOTIgMS4zMDUiIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLWZpbGw6dmFyKC0tZGFya3JlYWRlci10ZXh0LWZlMmM1NSwgI2ZlMzk1Zik7LS1kYXJrcmVhZGVyLWlubGluZS1zdHJva2U6bm9uZSIgZGF0YS1pbmRleD0iMTQiLz4KICA8cGF0aCBmaWxsPSIjMjVGNEVFIiBkPSJNMzQwLjA0MiA5MjUuMjM3Yy42MTQuMTQ4IDEuMjU2LjU5IDEuODQ1IDEuMzk5LS42NC0uMTI1LTEuMjMtLjYxNS0xLjg0NS0xLjQiIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLWZpbGw6dmFyKC0tZGFya3JlYWRlci10ZXh0LTI1ZjRlZSwgIzM2ZjVlZik7LS1kYXJrcmVhZGVyLWlubGluZS1zdHJva2U6bm9uZTt2aXNpYmlsaXR5OnZpc2libGUiIGRhdGEtaW5kZXg9IjE1Ii8+CiAgPHBhdGggZmlsbD0iI0ZFMkM1NSIgZD0iTTM0OS4xMDggOTMzLjQ0M2EzLjY2IDMuNjYgMCAwIDEgMi4yMiAxLjEzOGMtLjgyNi0uMDYyLTEuNDY4LS40Ni0yLjIyLTEuMTM4IiBzdHlsZT0iLS1kYXJrcmVhZGVyLWlubGluZS1maWxsOnZhcigtLWRhcmtyZWFkZXItdGV4dC1mZTJjNTUsICNmZTM5NWYpOy0tZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlOm5vbmU7dmlzaWJpbGl0eTp2aXNpYmxlIiBkYXRhLWluZGV4PSIxNiIvPgogIDxwYXRoIGZpbGw9IiMyNUY0RUUiIGQ9Ik04MjQuMjQ4IDM1MS45MTFjLS40NjcuMTg4LTEuMTUuMDY0LTIuMDQtLjQwMi40Ny0uMTk4IDEuMTQ3LS4wNTMgMi4wNC40MDIiIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLWZpbGw6dmFyKC0tZGFya3JlYWRlci10ZXh0LTI1ZjRlZSwgIzM2ZjVlZik7LS1kYXJrcmVhZGVyLWlubGluZS1zdHJva2U6bm9uZSIgZGF0YS1pbmRleD0iMTciLz4KPC9zdmc+Cg==",o3="data:image/svg+xml;
52base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgPGNpcmNsZSBjeD0iNTEyIiBjeT0iNTEyIiByPSI1MTIiIHN0eWxlPSJmaWxsOiMzMTMxMzEiLz4KICAgPHBhdGggZD0iTTMzMS40IDI3NmMtMjkuMyAwLTQwLjEgMTAuOC00MC4xIDQwLjF2MzUzLjRjMCAzLjMuMSA2LjQuNCA5LjIuNyA2LjQuOCAxMi43IDYuOCAxOS43LjYuOCA2LjYgNS4yIDYuNiA1LjIgMy4yIDEuNiA1LjUgMi43IDkuMiA0LjNsMTc3LjggNzQuNWM5LjIgNC4yIDEzLjEgNS45IDE5LjggNS43aC4xYzYuOC4yIDEwLjYtMS41IDE5LjgtNS43bDE3Ny44LTc0LjVjMy43LTEuNSA1LjktMi42IDkuMi00LjMgMCAwIDYuMS00LjUgNi42LTUuMiA2LTcgNi0xMy4yIDYuOC0xOS43LjMtMi44LjQtNS45LjQtOS4yVjMxNmMwLTI5LjMtMTAuOC00MC00MC4xLTQwSDMzMS40em0yODUgNjYuM2gxNC41YzI0LjIgMCAzNiAxMS44IDM2IDM2LjJ2NDAuMWgtMjkuM3YtMzguNWMwLTcuOC0zLjYtMTEuNS0xMS4yLTExLjVoLTVjLTcuOCAwLTExLjUgMy42LTExLjUgMTEuNXYxMjRjMCA3LjggMy42IDExLjQgMTEuNSAxMS40aDUuNWM3LjUgMCAxMS4xLTMuNiAxMS4xLTExLjR2LTQ0LjRoMjkuNHY0NS43YzAgMjQuNC0xMiAzNi40LTM2LjMgMzYuNGgtMTQuOGMtMjQuMyAwLTM2LjMtMTIuMS0zNi4zLTM2LjRWMzc4LjhjLjEtMjQuNCAxMi4xLTM2LjUgMzYuNC0zNi41em0tMjYwIDEuNmg2Ni40djI3LjJoLTM2LjZ2NTUuNmgzNS4ydjI3LjJoLTM1LjJ2NTkuMmgzNy4xdjI3LjJoLTY2LjlWMzQzLjl6bTgxLjQgMGg0Ni45YzI0LjMgMCAzNi4zIDEyLjEgMzYuMyAzNi41djUyLjJjMCAyNC40LTEyIDM2LjUtMzYuMyAzNi41aC0xNi45djcxLjJoLTI5LjlsLS4xLTE5Ni40em05Ni42IDBoMjkuOHYxOTYuNGgtMjkuOFYzNDMuOXptLTY2LjggMjYuNXY3Mi4zSDQ4MGM3LjUgMCAxMS4xLTMuNiAxMS4xLTExLjV2LTQ5LjNjMC03LjktMy42LTExLjUtMTEuMS0xMS41aC0xMi40ek0zODUuNCA1ODdoNC40bDEgLjFoMS42bC44LjNoLjhsLjguMi44LjIuNy4xLjcuMi43LjEuOC4zLjYuMS42LjMuOC4yLjYuMy44LjMuNy4zLjYuNC44LjMuNi40LjguNC42LjQuNy40LjYuNS42LjQuNi41LjcuNS42LjYuNi41LS41LjYtLjYuNi0uNS42LS42LjYtLjUuNi0uNS42LS42LjYtLjUuNi0uNS42LS42LjYtLjUuNi0uNi42LS41LjYtLjUuNi0uNi42LS41LjctLjYuNi0uNS42LS42LS41LS42LS42LS42LS40LS43LS41LS42LS40LS43LS40LS42LS40LS43LS40LS42LS4zLS42LS4zLS42LS4yLS43LS4zLS44LS4yLS42LS4yLS44LS4yLS44LS4yLS44LS4xaC0uOWwtMS0uMmgtMS42bC0uOC4xaC0uOGwtLjguMi0uNy4yLS43LjItLjguMi0uNi4zLS44LjMtLjYuNC0uNi40LS42LjQtLjYuNS0uNi41LS42LjUtLjUuNi0uNi42LS40LjYtLjQuNi0uNS42LS4zLjctLjQuNi0uNC43LS4yLjctLjMuNy0uMi44LS4xLjgtLjIuNy0uMi45di44bC0uMS44djEuOWwuMS44LjEuNy4xLjguMi44LjIuNi4xLjguMi42LjMuNi4zLjguNC44LjMuNi40LjYuNS43LjUuNi40LjYuNi42LjUuNi42LjUuNi41LjYuNS43LjQuNi40LjcuMy44LjMuNi4zLjguMi44LjMuOC4xLjguMi44LjEgMSAuMWgyLjZsMS0uMWguOGwuOC0uMy44LS4xLjgtLjMuNy0uMS43LS4zLjYtLjMuOC0uMy41LS4zLjYtLjR2LTcuNGgtMTEuOHYtMTEuOWgyNi42djI2LjZsLS42LjUtLjYuNS0uNi40LS42LjUtLjYuNC0uNi41LS42LjQtLjcuNC0uOC40LS43LjQtLjYuNC0uOC4zLS42LjQtLjguMy0uOC4zLS44LjMtLjcuMy0uNy4yLS43LjMtLjguMi0uNy4yLS44LjMtLjcuMS0uOC4yLS44LjItLjguMS0uOC4xLS44LjEtLjguMS0xIC4xLS44LjEtLjkuMWgtNC4ybC0uNy42aC0uOGwtLjgtLjFoLS44bC0uOC0uMy0uOC0uMS0uOC0uMi0uOC0uMS0uNi0uMy0uOC0uMS0uOC0uMy0uNy0uMy0uNy0uMi0uOC0uMy0uNy0uMy0uOC0uMy0uNi0uMy0uOC0uNC0uNi0uNC0uOC0uNC0uNi0uNC0uNi0uNC0uNi0uNS0uNi0uNS0uNy0uNS0uNS0uNS0uNi0uNS0uNi0uNi0uNi0uNS0uNi0uNi0uNy0uNi0uNi0uNi0uNS0uNi0uNS0uNi0uNC0uNi0uNS0uNi0uNC0uNi0uNC0uNi0uNC0uNy0uNC0uNi0uMy0uNy0uMy0uNy0uMy0uNy0uMy0uNy0uMi0uNi0uMy0uNy0uMi0uNy0uMi0uNy0uMi0uOC0uMi0uNy0uMi0uOC0uMS0uNy0uMi0uOC0uMS0uNy0uMS0uOC0uMS0uOC0uMS0uOHYtNC40bC4yLS44di0uOWwuMi0uOHYtLjhsLjMtLjguMy0uOC4xLS44LjItLjcuMy0uOC4yLS43LjMtLjguMy0uNy4zLS43LjMtLjcuMy0uNy40LS43LjQtLjYuNC0uNi40LS42LjQtLjYuNS0uNy41LS42LjUtLjYuNi0uNi41LS42LjUtLjYuNi0uNi41LS42LjYtLjUuNi0uNi42LS41LjYtLjUuNi0uNC42LS41LjYtLjQuNy0uNC43LS40LjgtLjQuNi0uNC44LS4zLjctLjMuOC0uNC42LS4yLjgtLjMuNy0uMy43LS4yLjctLjIuOC0uMi43LS4yLjgtLjJoLjhsLjgtLjJoLjhsLjgtLjJoLjhsMS4zLTF6bTI1NS44LjJoNC40bDEgLjJoMS42bC44LjJoMWwuOC4zLjcuMS44LjIuOC4xLjcuMi44LjIuOC4zLjYuMS44
52LjMuOC4zLjYuMy44LjMuOC4zLjcuNC42LjMuOC40LjcuNC42LjQuNy41LjYuNC42LjUuNi41LjYuNS0uNS42LS40LjctLjUuNi0uNS42LS41LjctLjQuNi0uNS42LS41LjctLjQuNi0uNS42LS41LjYtLjUuNy0uNC43LS41LjYtLjYuNi0uNC42LS41LjctLjYtLjUtLjctLjQtLjYtLjQtLjYtLjUtLjctLjMtLjYtLjQtLjgtLjMtLjYtLjMtLjgtLjMtLjYtLjMtLjYtLjItLjctLjMtLjgtLjItLjgtLjMtLjgtLjItLjktLjItLjgtLjEtLjgtLjItLjgtLjEtLjgtLjEtLjctLjFoLTEuOGwtLjkuMS0uOC4yLS44LjEtLjYuMy0uNi4zLS43LjYtLjUuNy0uMy43djJsLjQuOS4zLjUuNi42LjguNC42LjQuOC4zLjguMyAxIC4zLjYuMi42LjIuOC4yLjYuMi44LjIuOS4yLjkuMi45LjMuOS4xLjguMy45LjIuOC4yLjguMi44LjIuOC4zLjguMi43LjIuOC4zLjguMy44LjQuOC4zLjguNC44LjQuNi40LjYuNC43LjUuNi40LjcuNi42LjYuNi42LjYuNi40LjYuNi44LjQuNi4zLjguNC42LjIuOC4zLjYuMS44LjIuOC4xLjguMS44LjEuOHYybC0uMS45LS4xLjgtLjEuOS0uMi44LS4yLjgtLjIuOC0uMi44LS4zLjctLjMuNi0uMy43LS40LjYtLjUuNi0uNC42LS40LjctLjYuNi0uNS42LS42LjUtLjYuNi0uNi41LS42LjUtLjYuNC0uNy41LS44LjQtLjYuMy0uOC40LS44LjMtLjguMy0uOC4zLS44LjItLjYuMi0uOC4yLS44LjItLjYuMS0uOC4yaC0uM2wtLjguMWgtLjhsLS44LjJoLTZsLS44LS4xLS44LS4xLS45LS4xLS44LS4yLS44LS4xLS44LS4xLS44LS4yLS45LS4yLS44LS4yLS44LS4yLS44LS4yLS44LS4yLS44LS4zLS44LS4zLS43LS4yLS44LS4yLS44LS4zLS42LS4zLS44LS4zLS42LS40LS44LS4zLS43LS40LS42LS40LS44LS40LS42LS40LS43LS40LS42LS41LS42LS41LS42LS41LS42LS41LS42LS41LS42LS42LjUtLjYuNi0uNi41LS42LjYtLjYuNS0uNi41LS42LjYtLjYuNS0uNi42LS42LjUtLjYuNi0uNi41LS42LjUtLjYuNi0uNi41LS42LjYtLjYuNi0uNi42LjUuOC41LjYuNS44LjUuNi40LjcuNS42LjQuNy4zLjYuNC43LjMuOC4zLjYuMy44LjIuNi4zLjguMi44LjMuOC4zLjguMS44LjIuOC4xaC45bC44LjNoNC40bC44LS4yLjgtLjIuNi0uMS42LS4yLjYtLjMuNy0uNS40LS42LjQtLjYuMi0uOHYtMS45bC0uMy0uOC0uNS0uNi0uNS0uNS0uNy0uNS0uNi0uMy0uOC0uMy0uOC0uMy0xLS40LS42LS4xLS42LS4yLS44LS4yLS42LS4yLS44LS4zLS44LS4xLS45LS4zLS44LS4xLS45LS4zLS44LS4xLS44LS4zLS44LS4xLS44LS4zLS44LS4yLS44LS4yLS43LS4zLS43LS4yLS43LS4zLS44LS4zLS45LS4zLS44LS4zLS44LS4zLS44LS40LS44LS40LS42LS40LS44LS40LS42LS41LS43LS40LS41LS41LS42LS42LS42LS42LS41LS42LS41LS42LS40LS42LS40LS42LS40LS43LS4zLS42LS4zLS42LS4yLS43LS4yLS42LS4yLS44LS4xLS43di0uOGwtLjItLjh2LTMuNWwuMS0uOC4xLS44LjEtLjYuMi0uOC4yLS42LjItLjguMy0uNi4zLS44LjMtLjYuNC0uOC40LS42LjYtLjYuNC0uNi42LS42LjYtLjYuNS0uNi43LS42LjUtLjQuNy0uNS42LS41LjYtLjQuOC0uNC42LS4zLjgtLjQuNi0uMy44LS4zLjgtLjMuOC0uMi42LS4yLjgtLjEuNi0uMi44LS4xLjgtLjIuOC0uMS44LS4xLjgtLjEuNi0uMXptLTE5Ny4xLjZoMTUuMWwuMy43LjMuNy4zLjcuMi44LjMuNy4zLjcuMy43LjMuNy4yLjcuNC44LjMuNy4zLjcuMi43LjMuNy40LjcuMy44LjMuNy4yLjcuMy43LjQuNy4yLjcuMy44LjIuOC4zLjYuNC44LjMuNi4zLjguMy44LjIuNi40LjguMy42LjMuOC4yLjYuMy44LjQuOC4zLjcuMi43LjIuNy4zLjcuNC43LjMuOC4zLjcuMi43LjMuNy4zLjcuMy43LjMuOC4zLjcuMy43LjQuNy4zLjcuMy43LjIuOC4zLjcuNC43LjMuNy4yLjcuMy43LjMuOC40LjguMi42LjMuOC4yLjYuMy44LjQuOC4zLjYuMi44LjMuNi4yLjguNC42LjMuOC4yLjguMy42LjMuOC40LjYuMy44LjIuOC4zLjYuMy44LjQuNkg0NjZsLS40LS43LS4yLS43LS4zLS43LS4zLS44LS4yLS43LS4zLS43LS4zLS43LS4zLS43LS4zLS43LS4zLS43LS4yLS43LS4zLS44LS4zLS43LS4zLS43LS4zLS43aC0yMy4ybC0uMy44LS4yLjYtLjMuOC0uNC44LS4yLjYtLjMuOC0uMy42LS4yLjgtLjMuNi0uMy44LS4zLjYtLjMuOC0uMy44LS4zLjYtLjIuOGgtMTYuNWwuMy0uOC4zLS43LjMtLjcuMy0uOC4yLS43LjQtLjcuMy0uNy4zLS43LjItLjcuMy0uOC40LS43LjMtLjcuMy0uNy4yLS43LjMtLjcuNC0uOC4zLS43LjMtLjcuMy0uNy4zLS43LjMtLjcuMy0uOC4zLS44LjMtLjYuMy0uOC40LS42LjMtLjguMi0uOC4yLS42LjMtLjguNC0uNi4zLS44LjMtLjYuMi0uOC4zLS44LjQtLjYuMi0uOC4zLS42LjMtLjguMy0uOC40LS42LjMtLjguMi0uNi4zLS44LjMtLjYuNC0uOC4zLS44LjMtLjcuMi0uNy4zLS43LjQtLjcuMy0uNy4yLS44LjMtLjcuMy0uNy40LS43LjMtLjcuMi0uNy4zLS44LjMtLjguMy0uNi4zLS44LjItLjYuMy0uOC4zLS44LjQtLjYuMy0uOC4zLS42LjItLjguMy0uNi40LS44LjMtLjguMy0uNi4zLS44LjMtLjYuNC0uOC4yLS44LjItLjYuMy0uOCAyLjgtLjZ6bTQ2LjguNGgxNi41bC41LjYuNC43LjUuNi40LjcuNC42LjQuNy40LjYuNS43LjQuNi40LjYuNC43LjQuNi42LjcuMy42LjQuNy41LjYuNS42LjMuNy41LjYuNC43LjMuNi42LjcuNC42LjQuNy40LjYuNC42LjUuNy40LjYuNC43LjQuNi40LjcuNS42LjQuNy40LjYuNS0uNi4zLS44LjUtLjYuNS0uOC40LS42LjMtLjguNi0uNi40LS44LjMtLjYuNS0uNi41LS44LjQtLjYuNC0uOC40LS42LjUtLjguNC0uNi40LS44LjQtLjYuNC0uNi41LS44LjQtLjYuNC0uOC41LS42LjQtLjguNC0uNi41LS42LjQtLjguNS0uNi40LS44LjQtLjYuNC0uOC41LS42LjQtLjguNC0uNkg1NTN2NTkuNWgtMTUuN3YtMzVsLS40LjYtLjUuOC0uNC42LS41LjYtLjQuOC0uNS42LS40LjYtLjUuOC0uNC42LS40LjYtLjYuNi0uNC44LS41LjYtLjQuNi0uNC44LS41LjYtLjQuNi0uNS44LS40LjYtLjUuNi0uNC44LS40LjYtLjUuNi0uNC44LS41LjYtLjUuNi0uNC42LS40LjgtLjUuNi0uNS42LS4zLjgtLjYuNi0uNC42LS41LjgtLjQuNmgtLjNsLS41LS43LS40LS42LS41LS43LS40LS42LS41LS43LS40LS42LS41LS43LS40LS42LS41LS43LS40LS42LS42LS43LS4zLS42LS41LS43LS41LS42LS40LS43LS41LS42LS40LS44LS41LS42LS40LS43LS41LS42LS40LS43LS41LS42LS40LS43LS41LS42LS40LS43LS41LS42LS40LS43LS41LS42LS40LS43LS41LS42LS40LS43LS42LS42LS4zLS43LS41LS42djM1LjFINDkxdi01OC45bC0uMS0uMnptNzQgMGg0Ni45djEzLjRoLTMxLjR2OS41aDI4LjJ2MTIuN2gtMjguMlY2MzRoMzEuOHYxMy41SDU2NXYtNTguOWwtLjEtLjR6bS0xMTMuNSAxOC4yLS4zLjgtLjMuNi0uMy44LS4zLjgtLjIuNy0uMy43LS4zLjgtLjMuOC0uMi42LS4zLjgtLjMuNi0uMy44LS4zLjgtLjMuNi0uMi44
52LS4zLjYtLjMuOC0uNiAxLjItLjIuNi0uMy44LS4zLjgtLjIuNi0uMy44aDEzLjdsLS4zLS44LS4zLS43LS4zLS44LS4zLS43LS4yLS43LS4zLS43LS4zLS44LS4zLS43LS4zLS43LS4zLS43LS4yLS43LS4zLS44LS4zLS43LS4zLS43LS4zLS43LS4yLS43LS4zLS44LS4zLS44LS4zLS42LS4zLS44LS4zLS44LS4yLS43LS44LTEuMXptLTI0LjUgMTExLjRoMTcxbC04Ny4zIDI4LjgtODMuNy0yOC44eiIgc3R5bGU9ImZpbGw6I2ZmZiIvPgo8L3N2Zz4=",dC="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjMzMzUgMi42NjY1SDIuNjY2ODNDMS45MzA0NSAyLjY2NjUgMS4zMzM1IDMuMjYzNDYgMS4zMzM1IDMuOTk5ODRWMTEuOTk5OEMxLjMzMzUgMTIuNzM2MiAxLjkzMDQ1IDEzLjMzMzIgMi42NjY4MyAxMy4zMzMySDEzLjMzMzVDMTQuMDY5OSAxMy4zMzMyIDE0LjY2NjggMTIuNzM2MiAxNC42NjY4IDExLjk5OThWMy45OTk4NEMxNC42NjY4IDMuMjYzNDYgMTQuMDY5OSAyLjY2NjUgMTMuMzMzNSAyLjY2NjVaIiBzdHJva2U9IiMzMzg1RkYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTQuNjY2OCA0LjY2NjVMOC42ODY4MyA4LjQ2NjVDOC40ODEwMSA4LjU5NTQ1IDguMjQzMDQgOC42NjM4NCA4LjAwMDE2IDguNjYzODRDNy43NTcyOCA4LjY2Mzg0IDcuNTE5MzEgOC41OTU0NSA3LjMxMzUgOC40NjY1TDEuMzMzNSA0LjY2NjUiIHN0cm9rZT0iIzMzODVGRiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=",hC="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzU2MzlfNjMyKSI+CjxwYXRoIGQ9Ik0xNC42NjY5IDExLjI4MDJWMTMuMjgwMkMxNC42Njc3IDEzLjQ2NTkgMTQuNjI5NyAxMy42NDk3IDE0LjU1NTMgMTMuODE5OEMxNC40ODA5IDEzLjk4OTkgMTQuMzcxOCAxNC4xNDI2IDE0LjIzNSAxNC4yNjgxQzE0LjA5ODIgMTQuMzkzNyAxMy45MzY3IDE0LjQ4OTIgMTMuNzYwOCAxNC41NDg3QzEzLjU4NDkgMTQuNjA4MiAxMy4zOTg1IDE0LjYzMDMgMTMuMjEzNiAxNC42MTM2QzExLjE2MjIgMTQuMzkwNyA5LjE5MTYxIDEzLjY4OTcgNy40NjAyOCAxMi41NjY5QzUuODQ5NSAxMS41NDMzIDQuNDgzODQgMTAuMTc3NyAzLjQ2MDI4IDguNTY2ODlDMi4zMzM2IDYuODI3NyAxLjYzMjQ0IDQuODQ3NTYgMS40MTM2MSAyLjc4Njg5QzEuMzk2OTUgMi42MDI1NCAxLjQxODg2IDIuNDE2NzMgMS40Nzc5NSAyLjI0MTMxQzEuNTM3MDMgMi4wNjU4OSAxLjYzMTk5IDEuOTA0NjkgMS43NTY3OSAxLjc2Nzk3QzEuODgxNTkgMS42MzEyNiAyLjAzMzQ4IDEuNTIyMDMgMi4yMDI4MSAxLjQ0NzI0QzIuMzcyMTMgMS4zNzI0NSAyLjU1NTE3IDEuMzMzNzQgMi43NDAyOCAxLjMzMzU2SDQuNzQwMjhDNS4wNjM4MiAxLjMzMDM4IDUuMzc3NDggMS40NDQ5NSA1LjYyMjc5IDEuNjU1OTJDNS44NjgxIDEuODY2ODkgNi4wMjgzMyAyLjE1OTg2IDYuMDczNjEgMi40ODAyM0M2LjE1ODAzIDMuMTIwMjcgNi4zMTQ1OCAzLjc0ODcxIDYuNTQwMjggNC4zNTM1NkM2LjYyOTk4IDQuNTkyMTggNi42NDkzOSA0Ljg1MTUgNi41OTYyMiA1LjEwMDgxQzYuNTQzMDUgNS4zNTAxMiA2LjQxOTUyIDUuNTc4OTcgNi4yNDAyOCA1Ljc2MDIzTDUuMzkzNjEgNi42MDY4OUM2LjM0MjY1IDguMjc1OTIgNy43MjQ1OCA5LjY1Nzg2IDkuMzkzNjEgMTAuNjA2OUwxMC4yNDAzIDkuNzYwMjNDMTAuNDIxNSA5LjU4MDk5IDEwLjY1MDQgOS40NTc0NiAxMC44OTk3IDkuNDA0MjlDMTEuMTQ5IDkuMzUxMTIgMTEuNDA4MyA5LjM3MDUzIDExLjY0NjkgOS40NjAyM0MxMi4yNTE4IDkuNjg1OTMgMTIuODgwMiA5Ljg0MjQ4IDEzLjUyMDMgOS45MjY4OUMxMy44NDQxIDkuOTcyNTggMTQuMTM5OSAxMC4xMzU3IDE0LjM1MTMgMTAuMzg1MkMxNC41NjI3IDEwLjYzNDggMTQuNjc1MSAxMC45NTMzIDE0LjY2NjkgMTEuMjgwMloiIHN0cm9rZT0iIzMzODVGRiIgc3Ryb2tlLXdpZHRoPSIxLjMzMzMzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF81NjM5XzYzMiI+CjxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K",a3="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzQwNDhfNDIzMSkiPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuNTg0IDQuODU1NjZDNy43MTA2OSA0Ljc4MjUyIDcuODU0MzkgNC43NDQwMiA4LjAwMDY3IDQuNzQ0MDJDOC4xNDY5NSA0Ljc0NDAyIDguMjkwNjUgNC43ODI1MiA4LjQxNzM0IDQuODU1NjZMMTAuNTE1MyA2LjA2NjY2QzEwLjY0MiA2LjEzOTggMTAuNzQ3MiA2LjI0NSAxMC44MjA0IDYuMzcxNjhDMTAuODkzNSA2LjQ5ODM1IDEwLjkzMiA2LjY0MjA1IDEwLjkzMiA2Ljc4ODMzVjkuMjExQzEwLjkzMiA5LjM1NzI3IDEwLjg5MzUgOS41MDA5NyAxMC44MjA0IDkuNjI3NjVDMTAuNzQ3MiA5Ljc1NDMzIDEwLjY0MiA5Ljg1OTUzIDEwLjUxNTMgOS45MzI2Nkw4LjQxNzM0IDExLjE0NEM4LjI5MDY1IDExLjIxNzEgOC4xNDY5NSAxMS4yNTU2IDguMDAwNjcgMTEuMjU1NkM3Ljg1NDM5IDExLjI1NTYgNy43MTA2OSAxMS4yMTcxIDcuNTg0IDExLjE0NEw1LjQ4NiA5LjkzMjY2QzUuMzU5MzIgOS44NTk1MyA1LjI1NDEzIDkuNzU0MzMgNS4xODA5OSA5LjYyNzY1QzUuMTA3ODUgOS41MDA5NyA1LjA2OTM0IDkuMzU3MjcgNS4wNjkzNCA5LjIxMVY2Ljc4ODY2QzUuMDY5MjggNi42NDIzMyA1LjEwNzc2IDYuNDk4NTYgNS4xODA5IDYuMzcxODJDNS4yNTQwNSA2LjI0NTA4IDUuMzU5MjcgNi4xMzk4MyA1LjQ4NiA2LjA2NjY2TDcuNTg0IDQuODU1Nj
52ZaTTguMDg0IDUuNDMzQzguMDU4NjcgNS40MTgzNyA4LjAyOTkzIDUuNDEwNjcgOC4wMDA2NyA1LjQxMDY3QzcuOTcxNDEgNS40MTA2NyA3Ljk0MjY3IDUuNDE4MzcgNy45MTczNCA1LjQzM0w1LjgxOTM0IDYuNjQ0MzNDNS43OTQgNi42NTg5NiA1Ljc3Mjk2IDYuNjggNS43NTgzMyA2LjcwNTMzQzUuNzQzNyA2LjczMDY3IDUuNzM2IDYuNzU5NDEgNS43MzYgNi43ODg2NlY5LjIxMTMzQzUuNzM2IDkuMjQwNTkgNS43NDM3IDkuMjY5MzMgNS43NTgzMyA5LjI5NDY2QzUuNzcyOTYgOS4zMiA1Ljc5NCA5LjM0MTA0IDUuODE5MzQgOS4zNTU2Nkw3LjkxNzM0IDEwLjU2NjdDNy45NDI2NyAxMC41ODEzIDcuOTcxNDEgMTAuNTg5IDguMDAwNjcgMTAuNTg5QzguMDI5OTMgMTAuNTg5IDguMDU4NjcgMTAuNTgxMyA4LjA4NCAxMC41NjY3TDEwLjE4MiA5LjM1NTMzQzEwLjIwNzMgOS4zNDA3IDEwLjIyODQgOS4zMTk2NiAxMC4yNDMgOS4yOTQzM0MxMC4yNTc2IDkuMjY4OTkgMTAuMjY1MyA5LjI0MDI1IDEwLjI2NTMgOS4yMTFWNi43ODg2NkMxMC4yNjUzIDYuNzU5NDEgMTAuMjU3NiA2LjczMDY3IDEwLjI0MyA2LjcwNTMzQzEwLjIyODQgNi42OCAxMC4yMDczIDYuNjU4OTYgMTAuMTgyIDYuNjQ0MzNMOC4wODQgNS40MzNaIiBmaWxsPSIjNUM1QzVDIi8+CjwvZz4KPGNpcmNsZSBjeD0iOCIgY3k9IjgiIHI9IjcuNjkyMzEiIHN0cm9rZT0iIzVDNUM1QyIgc3Ryb2tlLXdpZHRoPSIwLjYxNTM4NSIvPgo8Y2lyY2xlIGN4PSI3Ljk5OTU1IiBjeT0iOC4wMDAwNCIgcj0iNS44NDYxNSIgc3Ryb2tlPSIjNUM1QzVDIiBzdHJva2Utd2lkdGg9IjAuNjE1Mzg1Ii8+CjxkZWZzPgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzQwNDhfNDIzMSI+CjxyZWN0IHdpZHRoPSI4IiBoZWlnaHQ9IjgiIGZpbGw9IndoaXRlIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0IDQpIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==",fC="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDIxVjE5QzE5IDE3LjkzOTEgMTguNTc4NiAxNi45MjE3IDE3LjgyODQgMTYuMTcxNkMxNy4wNzgzIDE1LjQyMTQgMTYuMDYwOSAxNSAxNSAxNUg5QzcuOTM5MTMgMTUgNi45MjE3MiAxNS40MjE0IDYuMTcxNTcgMTYuMTcxNkM1LjQyMTQzIDE2LjkyMTcgNSAxNy45MzkxIDUgMTlWMjEiIHN0cm9rZT0iIzMzODVGRiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTEyIDExQzE0LjIwOTEgMTEgMTYgOS4yMDkxNCAxNiA3QzE2IDQuNzkwODYgMTQuMjA5MSAzIDEyIDNDOS43OTA4NiAzIDggNC43OTA4NiA4IDdDOCA5LjIwOTE0IDkuNzkwODYgMTEgMTIgMTFaIiBzdHJva2U9IiMzMzg1RkYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=",c3="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyLjY2NjcgNC42NjY2N1YyLjY2NjY3QzEyLjY2NjcgMi40ODk4NiAxMi41OTY0IDIuMzIwMjkgMTIuNDcxNCAyLjE5NTI2QzEyLjM0NjQgMi4wNzAyNCAxMi4xNzY4IDIgMTIgMkgzLjMzMzMzQzIuOTc5NzEgMiAyLjY0MDU3IDIuMTQwNDggMi4zOTA1MiAyLjM5MDUyQzIuMTQwNDggMi42NDA1NyAyIDIuOTc5NzEgMiAzLjMzMzMzQzIgMy42ODY5NiAyLjE0MDQ4IDQuMDI2MDkgMi4zOTA1MiA0LjI3NjE0QzIuNjQwNTcgNC41MjYxOSAyLjk3OTcxIDQuNjY2NjcgMy4zMzMzMyA0LjY2NjY3SDEzLjMzMzNDMTMuNTEwMSA0LjY2NjY3IDEzLjY3OTcgNC43MzY5IDEzLjgwNDcgNC44NjE5M0MxMy45Mjk4IDQuOTg2OTUgMTQgNS4xNTY1MiAxNCA1LjMzMzMzVjhNMTQgOEgxMkMxMS42NDY0IDggMTEuMzA3MiA4LjE0MDQ4IDExLjA1NzIgOC4zOTA1MkMxMC44MDcxIDguNjQwNTcgMTAuNjY2NyA4Ljk3OTcxIDEwLjY2NjcgOS4zMzMzM0MxMC42NjY3IDkuNjg2OTYgMTAuODA3MSAxMC4wMjYxIDExLjA1NzIgMTAuMjc2MUMxMS4zMDcyIDEwLjUyNjIgMTEuNjQ2NCAxMC42NjY3IDEyIDEwLjY2NjdIMTRDMTQuMTc2OCAxMC42NjY3IDE0LjM0NjQgMTAuNTk2NCAxNC40NzE0IDEwLjQ3MTRDMTQuNTk2NCAxMC4zNDY0IDE0LjY2NjcgMTAuMTc2OCAxNC42NjY3IDEwVjguNjY2NjdDMTQuNjY2NyA4LjQ4OTg2IDE0LjU5NjQgOC4zMjAyOSAxNC40NzE0IDguMTk1MjZDMTQuMzQ2NCA4LjA3MDI0IDE0LjE3NjggOCAxNCA4WiIgc3Ryb2tlPSIjMzM4NUZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTIgMy4zMzM1VjEyLjY2NjhDMiAxMy4wMjA1IDIuMTQwNDggMTMuMzU5NiAyLjM5MDUyIDEzLjYwOTZDMi42NDA1NyAxMy44NTk3IDIuOTc5NzEgMTQuMDAwMiAzLjMzMzMzIDE0LjAwMDJIMTMuMzMzM0MxMy41MTAxIDE0LjAwMDIgMTMuNjc5NyAxMy45Mjk5IDEzLjgwNDcgMTMuODA0OUMxMy45Mjk4IDEzLjY3OTkgMTQgMTMuNTEwMyAxNCAxMy4zMzM1VjEwLjY2NjgiIHN0cm9rZT0iIzMzODVGRiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=",mC="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzU2MzlfMzIpIj4KPHBhdGggZD0iTTcuOTk5NTkgNi42NjY1QzcuNjQ1OTYgNi42NjY1IDcuMzA2ODMgNi44MDY5OCA3LjA1Njc4IDcuMDU3MDNDNi44MDY3MyA3LjMwNzA4IDYuNjY2MjUgNy42NDYyMiA2LjY2NjI1IDcuOTk5ODRDNi42NjYyNSA4LjY3OTg0IDYuNTk5NTkgOS42
52NzMxNyA2LjQ5MjkyIDEwLjY2NjUiIHN0cm9rZT0iIzMzODVGRiIgc3Ryb2tlLXdpZHRoPSIxLjI1NDkiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNOS4zMzI5MyA4Ljc0NjU4QzkuMzMyOTMgMTAuMzMzMiA5LjMzMjkzIDEyLjk5OTkgOC42NjYyNiAxNC42NjY2IiBzdHJva2U9IiMzMzg1RkYiIHN0cm9rZS13aWR0aD0iMS4yNTQ5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTExLjUyNzMgMTQuMDEzM0MxMS42MDczIDEzLjYxMzMgMTEuODE0IDEyLjQ4IDExLjg2MDcgMTIiIHN0cm9rZT0iIzMzODVGRiIgc3Ryb2tlLXdpZHRoPSIxLjI1NDkiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMS4zMzM5OCA4LjAwMDE2QzEuMzMzOTggNi42MDA5NSAxLjc3NDIzIDUuMjM3MiAyLjU5MjM3IDQuMTAyMDlDMy40MTA1MSAyLjk2Njk5IDQuNTY1MDUgMi4xMTgwOCA1Ljg5MjQ3IDEuNjc1NjFDNy4yMTk4OCAxLjIzMzE0IDguNjUyODYgMS4yMTk1NCA5Ljk4ODQ0IDEuNjM2NzRDMTEuMzI0IDIuMDUzOTQgMTIuNDk0NSAyLjg4MDc5IDEzLjMzNCA0LjAwMDE2IiBzdHJva2U9IiMzMzg1RkYiIHN0cm9rZS13aWR0aD0iMS4yNTQ5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTEuMzMzOTggMTAuNjY2NUgxLjMzOTE0IiBzdHJva2U9IiMzMzg1RkYiIHN0cm9rZS13aWR0aD0iMS4yNTQ5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTE0LjUzMjcgMTAuNjY2NUMxNC42NjYgOS4zMzMxNyAxNC42MiA3LjA5NzE3IDE0LjUzMjcgNi42NjY1IiBzdHJva2U9IiMzMzg1RkYiIHN0cm9rZS13aWR0aD0iMS4yNTQ5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTMuMzMzOTggMTIuOTk5OEMzLjY2NzMyIDExLjk5OTggNC4wMDA2NSA5Ljk5OTg0IDQuMDAwNjUgNy45OTk4NEMzLjk5OTk4IDcuNTQ1NzUgNC4wNzY2MyA3LjA5NDg2IDQuMjI3MzIgNi42NjY1IiBzdHJva2U9IiMzMzg1RkYiIHN0cm9rZS13aWR0aD0iMS4yNTQ5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTUuNzY3MDkgMTQuNjY2OEM1LjkwNzA5IDE0LjIyNjggNi4wNjcwOSAxMy43ODY4IDYuMTQ3MDkgMTMuMzMzNSIgc3Ryb2tlPSIjMzM4NUZGIiBzdHJva2Utd2lkdGg9IjEuMjU0OSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik02IDQuNTMzNDZDNi42MDgyNyA0LjE4MjI4IDcuMjk4MjggMy45OTc0NSA4LjAwMDY0IDMuOTk3NTZDOC43MDMwMSAzLjk5NzY3IDkuMzkyOTYgNC4xODI3MiAxMC4wMDExIDQuNTM0MUMxMC42MDkzIDQuODg1NDggMTEuMTE0MiA1LjM5MDc5IDExLjQ2NTEgNS45OTkyM0MxMS44MTYgNi42MDc2NiAxMi4wMDA1IDcuMjk3NzYgMTIgOC4wMDAxMlY5LjMzMzQ2IiBzdHJva2U9IiMzMzg1RkYiIHN0cm9rZS13aWR0aD0iMS4yNTQ5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF81NjM5XzMyIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo=",ms={apple:qw,coinbase:Kw,discord:Gw,facebook:Zw,farcaster:Xw,github:i3,google:Qw,line:Jw,steam:n3,telegram:e3,twitch:t3,x:r3,tiktok:s3,epic:o3};function l3(e){switch(e){case"google":return Qw;case"coinbase":return Kw;case"apple":return qw;case"facebook":return Zw;case"phone":return hC;case"email":return dC;case"passkey":return mC;case"discord":return Gw;case"line":return Jw;case"x":return r3;case"tiktok":return s3;case"epic":return o3;case"farcaster":return Xw;case"telegram":return e3;case"twitch":return t3;case"github":return i3;case"steam":return n3;case"guest":return fC;default:return c3}}function yC(e){const{id:t}=X9();return pe({queryFn:async()=>gC({id:t}),queryKey:["walletIcon",t],...e.queryOptions})}async function gC(e){var i;const{getInstalledWalletProviders:t}=await h(async()=>{const{getInstalledWalletProviders:r}=await Promise.resolve().then(()=>Ll);return{getInstalledWalletProviders:r}},void 0),n=(i=t().find(r=>r.info.rdns===e.id))==null?void 0:i.info.icon;return n||lc(e.id,!0)}const Au=e=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size,viewBox:"0 0 24 24",role:"presentation",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-mail-icon lucide-mail",style:{color:e.color},children:[a.jsx("path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}),a.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"})]}),Vs=e=>a.jsxs("svg",{"aria-hidden":"true",fill:"none",height:e.size,viewBox:"0 0 36 36",width:e.size,children:[a.jsx("path",{d:"M18.0001 15C17.2045 15 16.4414 15.3161 15.8788 15.8787C15.3162 16.4413 15.0001 17.2044 15.0001 18C15.0001 19.53 14.8501 21.765 14.6101 24",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3"}),a.jsx("path",{d:"M21.0002 19.6801C21.0002 23.2501 21.0002 29.2501 19.5002 33.0001",
52stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3"}),a.jsx("path",{d:"M25.9348 31.53C26.1148 30.63 26.5798 28.08 26.6848 27",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3"}),a.jsx("path",{d:"M2.99976 18C2.99976 14.8518 3.99032 11.7833 5.83112 9.22935C7.67193 6.67536 10.2697 4.76531 13.2563 3.76975C16.243 2.77419 19.4672 2.74359 22.4723 3.6823C25.4773 4.621 28.1108 6.48141 29.9998 9",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3"}),a.jsx("path",{d:"M2.99976 24H3.01628",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3"}),a.jsx("path",{d:"M32.7 24C33 21 32.8965 15.969 32.7 15",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3"}),a.jsx("path",{d:"M7.49976 29.25C8.24976 27 8.99976 22.5 8.99976 18C8.99824 16.9783 9.17071 15.9638 9.50976 15",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3"}),a.jsx("path",{d:"M12.9751 33C13.2901 32.01 13.6501 31.02 13.8301 30",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3"}),a.jsx("path",{d:"M13.5 10.2C14.8686 9.40988 16.4211 8.99401 18.0014 8.99426C19.5818 8.99452 21.1342 9.41088 22.5025 10.2015C23.8708 10.9921 25.0069 12.129 25.7964 13.498C26.5859 14.867 27.001 16.4197 27 18V21",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3"})]}),c1=e=>a.jsxs("svg",{fill:"none",height:e.size,role:"presentation",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),a.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),Ls=e=>a.jsxs("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 24 24",width:e.size,xmlns:"http://www.w3.org/2000/svg",style:e.style,children:[a.jsx("path",{d:"M19 7V4C19 3.73478 18.8946 3.48043 18.7071 3.29289C18.5196 3.10536 18.2652 3 18 3H5C4.46957 3 3.96086 3.21071 3.58579 3.58579C3.21071 3.96086 3 4.46957 3 5C3 5.53043 3.21071 6.03914 3.58579 6.41421C3.96086 6.78929 4.46957 7 5 7H20C20.2652 7 20.5196 7.10536 20.7071 7.29289C20.8946 7.48043 21 7.73478 21 8V12M21 12H18C17.4696 12 16.9609 12.2107 16.5858 12.5858C16.2107 12.9609 16 13.4696 16 14C16 14.5304 16.2107 15.0391 16.5858 15.4142C16.9609 15.7893 17.4696 16 18 16H21C21.2652 16 21.5196 15.8946 21.7071 15.7071C21.8946 15.5196 22 15.2652 22 15V13C22 12.7348 21.8946 12.4804 21.7071 12.2929C21.5196 12.1054 21.2652 12 21 12Z",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),a.jsx("path",{d:"M3 5V19C3 19.5304 3.21071 20.0391 3.58579 20.4142C3.96086 20.7893 4.46957 21 5 21H20C20.2652 21 20.5196 20.8946 20.7071 20.7071C20.8946 20.5196 21 20.2652 21 20V16",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]}),Ou=e=>{const t=_.useId();return a.jsxs("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 16 16",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("g",{clipPath:`url(#${t})`,children:a.jsx("path",{d:"M14.6669 11.2802V13.2802C14.6677 13.4659 14.6297 13.6497 14.5553 13.8198C14.4809 13.9899 14.3718 14.1426 14.235 14.2681C14.0982 14.3937 13.9367 14.4892 13.7608 14.5487C13.5849 14.6082 13.3985 14.6303 13.2136 14.6136C11.1622 14.3907 9.19161 13.6897 7.46028 12.5669C5.8495 11.5433 4.48384 10.1777 3.46028 8.56689C2.3336 6.8277 1.63244 4.84756 1.41361 2.78689C1.39695 2.60254 1.41886 2.41673 1.47795 2.24131C1.53703 2.06589 1.63199 1.90469 1.75679 1.76797C1.88159 1.63126 2.03348 1.52203 2.20281 1.44724C2.37213 1.37245 2.55517 1.33374 2.74028 1.33356H4.74028C5.06382 1.33038 5.37748 1.44495 5.62279 1.65592C5.8681 1.86689 6.02833 2.15986 6.07361 2.48023C6.15803 3.12027 6.31458 3.74871 6.54028 4.35356C6.62998 4.59218 6.64939 4.8515 6.59622 5.10081C6.54305 5.35012 6.41952 5.57897 6.24028 5.76023L5.39361 6.60689C6.34265 8.27592 7.72458 9.65786 9.39361 10.6069L10.2403 9.76023C10.4215 9.58099 10.6504 9.45746 10.8997 9.40429C11.149 9.35112 11.4083 9.37053 11.6469 9.46023C12.2518 9.68593 12.8802 9.84248 13.5203 9.92689C13.8441 9.97258 14.1399 10.1357 14.3513 10.3852C14.5627 10.6348 14.6751 10.9533 14.6669 11.2802Z",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.33333"})}),a.jsx("defs",{children:a.jsx("clipPath",{id:t,children:a.jsx("rect",{fill:"white",height:"16",width:"16"})})})]})},me=e=>a.jsx(wC,{className:e.className||"",color:e.color,style:{height:e.height,width:e.width||"auto",...e.style}}),pC=qt`
530% {
54    opacity: 0.5;
55  }
56  100% {
57    opacity: 1;
58  }
59`,wC=Fe(e=>{const t=ee();return{animation:`${pC} 500ms ease-in-out infinite alternate`,backgroundColor:t.colors[e.color||"skeletonBg"],backgroundSize:"200% 200%",borderRadius:J.sm}}),dt=e=>{const[t,n]=_.useState("pending"),i=_.useRef(null),r=e.src,s=`${e.width}px`,o=`${e.height||e.width}px`,l=(()=>
59{if(r!==void 0)try{return qr({client:e.client,uri:r})}catch{return e.src}})(),u=l===void 0?"pending":l===""?"fallback":t,d=u==="loaded";return _.useEffect(()=>{const f=i.current;if(f)if(f.complete)n("loaded");else{let m=function(){n("loaded")};return f.addEventListener("load",m),()=>{f.removeEventListener("load",m)}}},[]),a.jsxs("div",{style:{alignItems:"center",display:"inline-flex",flexShrink:0,justifyItems:"center",position:"relative"},children:[u==="pending"&&a.jsx(me,{height:o,width:s,color:e.skeletonColor,style:e.style}),u==="fallback"&&(e.fallback||a.jsx(b,{bg:"tertiaryBg",borderColor:"borderColor",style:{height:o,width:s,borderRadius:J.md,borderWidth:"1px",borderStyle:"solid",...e.style},children:a.jsx("div",{})})),a.jsx("img",{alt:e.alt||"",className:e.className,decoding:"async",draggable:!1,height:e.height,loading:e.loading,onError:f=>{e.fallbackImage&&f.currentTarget.src!==e.fallbackImage?f.currentTarget.src=e.fallbackImage:n("fallback")},onLoad:()=>{n("loaded")},src:l||void 0,style:{height:d?e.height?`${e.height}px`:void 0:0,objectFit:"contain",opacity:d?1:0,transition:"opacity 0.4s ease",userSelect:"none",visibility:d?"visible":"hidden",width:d?e.width?`${e.width}px`:void 0:0,...e.style},width:e.width},l)]})};function ai(e){const t=ee(),[n,i]=_.useState(void 0),r=ft();return _.useEffect(()=>{async function s(){var u;const o=In,c=e.id;let l;if(c==="inApp"&&r&&(r.id==="inApp"||r.id==="smart")){const d=await Ww(o);l=d?{authProvider:d,uri:l3(d)}:{authProvider:"wallet",uri:""}}else{const d=(u=or().find(f=>f.info.rdns===c))==null?void 0:u.info.icon;d?l={uri:d}:l={uri:await lc(c,!0)}}i(l)}s()},[e.id,r]),(n==null?void 0:n.authProvider)==="email"?a.jsx(Au,{color:t.colors.accentText,size:e.size}):(n==null?void 0:n.authProvider)==="phone"?a.jsx(Ou,{color:t.colors.accentText,size:e.size}):(n==null?void 0:n.authProvider)==="passkey"?a.jsx(Vs,{color:t.colors.accentText,size:e.size}):(n==null?void 0:n.authProvider)==="wallet"?a.jsx(Ls,{color:t.colors.accentText,size:e.size}):(n==null?void 0:n.authProvider)==="guest"?a.jsx(c1,{color:t.colors.accentText,size:e.size}):n!=null&&n.uri?a.jsx(dt,{client:e.client,height:e.size,loading:"eager",src:n.uri,style:{borderRadius:J.md,...e.style},width:e.size}):a.jsx(_C,{client:e.client,id:e.id,size:e.size})}function _C(e){const t=K9(e.id);return t.isFetched&&!t.data?a.jsx(dt,{client:e.client,height:e.size,src:c3,width:e.size}):a.jsx(Ls,{size:e.size})}function ku(e){const{termsOfServiceUrl:t,privacyPolicyUrl:n,locale:i,requireApproval:r}=e;if(!t&&!n&&!r)return null;const s=t&&n;return a.jsx(b,{center:"x",flex:"row",children:a.jsxs(A,{balance:!0,center:!0,inline:!0,multiline:!0,size:"xs",style:{maxWidth:"250px"},children:[r&&a.jsx("input",{checked:e.isApproved,disabled:!r,onChange:e.onApprove,style:{marginRight:R["3xs"],transform:"translateY(3px)"},type:"checkbox"}),i.prefix," ",t&&a.jsxs(Gr,{href:t,inline:!0,size:"xs",style:{whiteSpace:"nowrap"},target:"_blank",children:[" ",i.termsOfService," "]}),s&&`${i.and} `,n&&a.jsx(Gr,{href:n,inline:!0,size:"xs",target:"_blank",children:i.privacyPolicy}),!n&&!t&&a.jsx(A,{inline:!0,size:"xs",children:"Terms of Service and Privacy Policy"})]})})}function zu(e){return a.jsx(CC,{"data-error":e.error,children:a.jsx("div",{"data-container":!0,style:{alignItems:"center",display:"flex",justifyContent:"center",position:"relative"},children:a.jsxs("div",{"data-img-container":!0,children:[!e.hideSpinner&&a.jsx("svg",{role:"presentation",style:{display:e.error?"none":"block"},viewBox:"0 0 110 110",children:a.jsx("rect",{fill:"none",height:"106",rx:20,strokeDasharray:"132 261",strokeDashoffset:-388,strokeLinecap:"round",strokeWidth:4,width:"106",x:"2",y:"2"})}),a.jsx(bC,{children:a.jsx(ai,{client:e.client,id:e.id,size:"68"})})]})})})}const bC=Fe(()=>{const e=ee();return{alignItems:"center",background:e.colors.tertiaryBg,border:`1px solid ${e.colors.borderColor}`,borderRadius:"13px",display:"flex",justifyContent:"center",padding:R.xs}}),xC=qt`
60from {
61  stroke-dashoffset: 0px;
62}
63`,IC=qt`
64  0% {
65    transform: translateX(0);
66  }
67  25% {
68    transform: translateX(-5px);
69  }
70  50% {
71    transform: translateX(5px);
72  }
73  75% {
74    transform: translateX(-5px);
75  }
76  100% {
77    transform: translateX(0);
78  }
79`,MC=qt`
800% {
81  transform: scale(0.95);
82}
83100% {
84  opacity: 0;
85  transform: scale(1.3);
86}
87`,CC=Fe(e=>{const t=ee();return{"[data-img-container]":{alignItems:"center",display:"flex",justifyContent:"center",position:"relative"},"&[data-error='true'] [data-container]":{animation:`${IC} 0.25s linear`},"&[data-error='true'] [data-img-container]::before":{animation:`${MC} 1.5s ease infinite`,background:t.colors.danger,borderRadius:"20px",content:'""',inset:0,position:"absolute",zIndex:-1},borderRadius:J.xl,display:"flex",img:{zIndex:100},justifyContent:"center",position:"relative",rect:{animation:`${xC} 1.2s linear infinite`,stroke:t.colors.accentText},svg:{animation:`${Rs} 400ms ease`,height:"calc(100% + 16px)",left:"-8px",position:"absolute",top:"-8px",width:"calc(100% + 16px)"}}}),u3=e=>{const{onDone:t,modalSize:n,onClose:i,termsOfServiceUrl:r,privacyPolicyUrl:s,
87connectLocale:o}=e,c=ft(),l=hu(),u=ht(),d=Cf(c,u,e.auth),[f,m]=_.useState(void 0),[y,g]=_.useState(f?"failed":"idle"),{disconnect:p}=oc(),w=o.signatureScreen,x=_.useCallback(async()=>{try{m(void 0),g("signing"),await d.doLogin(),t==null||t()}catch(E){await Hw(1e3),m(E.message),g("failed")}},[t,d]);if(!c||d.isPending)return a.jsx(Mt,{"data-testid":"loading-screen"});if(sy(c.id)||c.id==="smart"&&l&&sy(l.id))return a.jsx(EC,{connectLocale:o,error:f,signIn:x,status:y,wallet:c});const I=()=>{x()};return a.jsxs(b,{animate:"fadein",flex:"column",fullHeight:!0,children:[a.jsx(b,{p:"lg",style:{paddingBottom:0},children:a.jsx(Me,{title:w.instructionScreen.title})}),a.jsx(b,{center:"y",expand:!0,flex:"column",px:n==="compact"?"lg":"xxl",style:{paddingBottom:R.xl,paddingTop:0},children:y==="idle"?a.jsxs(a.Fragment,{children:[a.jsx(b,{animate:"fadein",center:"x",flex:"row",py:"3xl",children:a.jsx(vC,{children:a.jsx(ai,{client:e.client,id:c.id,size:"80"})})}),a.jsx(A,{balance:!0,center:!0,multiline:!0,children:w.instructionScreen.instruction}),a.jsx(U,{y:"lg"}),a.jsx(ue,{"data-testid":"sign-in-button",fullWidth:!0,onClick:x,style:{alignItems:"center",padding:R.md},variant:"accent",children:o.signatureScreen.instructionScreen.signInButton}),a.jsx(U,{y:"sm"}),a.jsx(ue,{"data-testid":"disconnect-button",fullWidth:!0,onClick:()=>{i==null||i(),p(c)},style:{alignItems:"center",padding:R.md},variant:"secondary",children:o.signatureScreen.instructionScreen.disconnectWallet})]}):a.jsxs(a.Fragment,{children:[a.jsx(b,{py:"3xl",children:a.jsx(zu,{client:e.client,error:y==="failed",id:c.id})}),a.jsxs(b,{animate:"fadein",flex:"column",gap:"md",children:[a.jsxs(A,{center:!0,color:"primaryText",size:"lg",className:"tw-screen-title",children:[y==="failed"?f||w.signingScreen.failedToSignIn:w.signingScreen.inProgress," "]}),y==="signing"&&a.jsx(A,{balance:!0,center:!0,multiline:!0,className:"tw-screen-description",children:o.signatureScreen.signingScreen.prompt}),y==="failed"&&a.jsxs(b,{children:[a.jsx(U,{y:"sm"}),a.jsxs(ue,{fullWidth:!0,onClick:I,style:{alignItems:"center",gap:R.xs,padding:R.md},variant:"accent",children:[a.jsx(dc,{height:D.sm,width:D.sm}),w.signingScreen.tryAgain]}),a.jsx(U,{y:"sm"}),a.jsx(ue,{fullWidth:!0,onClick:()=>{p(c)},style:{alignItems:"center",padding:R.md},variant:"secondary",children:w.instructionScreen.disconnectWallet})]})]},y)]})}),(r||s)&&a.jsx(b,{animate:"fadein",p:"md",children:a.jsx(ku,{locale:o.agreement,privacyPolicyUrl:s,termsOfServiceUrl:r})})]})};function sy(e){return e==="inApp"||e==="embedded"||e.startsWith("ecosystem")}function EC({signIn:e,error:t,status:n,connectLocale:i,wallet:r}){const s=i.signatureScreen,o=_.useRef(!1),{disconnect:c}=oc();return _.useEffect(()=>{o.current||(o.current=!0,e())},[e]),a.jsxs(b,{animate:"fadein",flex:"column",fullHeight:!0,p:"lg",children:[a.jsx(Me,{title:s.signingScreen.title}),a.jsxs(b,{center:"both",expand:!0,flex:"row",style:{minHeight:"250px"},children:[n==="signing"&&a.jsx(Qe,{color:"accentText",size:"xl"}),n==="failed"&&a.jsxs(b,{children:[a.jsx(U,{y:"lg"}),a.jsx(A,{center:!0,color:"danger",size:"lg",children:t||s.signingScreen.failedToSignIn}),a.jsx(U,{y:"lg"}),a.jsxs(ue,{fullWidth:!0,onClick:()=>{e()},style:{alignItems:"center",gap:R.xs,padding:R.md},variant:"accent",children:[a.jsx(dc,{height:D.sm,width:D.sm}),s.signingScreen.tryAgain]}),a.jsx(U,{y:"sm"}),a.jsx(ue,{"data-testid":"disconnect-button",fullWidth:!0,onClick:()=>{c(r)},style:{alignItems:"center",padding:R.md},variant:"secondary",children:s.instructionScreen.disconnectWallet})]})]})]})}const TC=qt`
880% {
89  transform: scale(0.9);
90}
91100% {
92  opacity: 0;
93  transform: scale(1.4);
94}
95`,vC=Fe(e=>{const t=ee();return{"&::before":{animation:`${TC} 2s cubic-bezier(0.175, 0.885, 0.32, 1.1) infinite`,background:t.colors.accentText,borderRadius:J.xl,bottom:0,content:'""',display:"block",left:0,position:"absolute",right:0,top:0,zIndex:-1},position:"relative"}}),LC=e=>a.jsx("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 129 131",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M59.7178 0C62.7511 0 65.788 0 68.8212 0C71.4429 0.423181 74.1011 0.679982 76.6755 1.29848C103.785 7.78725 120.277 24.7723 126.755 51.5485C127.428 54.3335 127.712 57.2089 128.175 60.0446V69.8103C127.803 72.1722 127.472 74.5449 127.057 76.8995C122.582 102.298 103.177 122.722 77.9136 128.56C74.8003 129.28 71.6104 129.67 68.457 130.213H59.3537C57.3838 129.913 55.4065 129.663 53.4475 129.305C27.0442 124.491 6.91125 104.974 1.44197 78.8526C0.841148 75.9808 0.473373 73.0656 0 70.1684C0 66.9132 0 63.6579 0 60.4027C0.371416 58.0408 0.706418 55.6718 1.11425 53.3135C
955.52026 28.0493 24.9905 7.50151 50.0902 1.70719C53.2618 0.97657 56.5062 0.560624 59.7178 0ZM96.8813 10.3119C96.8959 10.2865 96.9104 10.2576 96.9286 10.2323C96.8886 10.2504 96.8522 10.2648 96.8121 10.2829C96.8085 10.2287 96.8048 10.178 96.8012 10.1238C96.8303 10.1853 96.8558 10.2504 96.8849 10.3119H96.8813ZM25.1762 115.709C25.2089 115.716 25.2454 115.72 25.2781 115.727C25.249 115.749 25.2235 115.771 25.1944 115.792C25.2053 115.767 25.2162 115.742 25.2271 115.716C25.1252 115.525 25.0196 115.333 24.9176 115.141C22.7328 113.087 21.127 110.421 18.3305 109.014C18.2977 109.032 18.2613 109.05 18.2285 109.065C18.2758 109.058 18.3232 109.054 18.3705 109.047C18.4397 109.365 18.3997 109.795 18.5926 109.984C20.3587 111.687 22.1502 113.362 23.9745 115.004C24.1675 115.177 24.5972 115.083 24.9176 115.116C25.0014 115.311 25.0851 115.51 25.1725 115.706L25.1762 115.709ZM27.594 12.4567L27.2262 12.9197C27.1898 13.1439 27.1571 13.3682 27.1206 13.5924C26.8038 13.5924 26.4871 13.596 26.1703 13.5996C26.0683 13.813 25.9663 14.0264 25.8607 14.2362L25.7661 14.2652L25.8243 14.1856C25.9336 13.9686 26.0428 13.7479 26.1557 13.5309C26.4688 13.5418 26.7856 13.5526 27.0988 13.5671C27.1243 13.332 27.1498 13.0969 27.1753 12.8618C27.2954 12.7352 27.412 12.6122 27.5321 12.4856C27.543 12.511 27.554 12.5399 27.5649 12.5652C27.5758 12.529 27.5831 12.4893 27.594 12.4531V12.4567ZM106.589 111.926C106.738 111.868 106.891 111.806 107.041 111.749C107.616 111.354 108.286 111.043 108.756 110.548C110.281 108.924 111.771 107.26 113.205 105.553C113.919 104.703 114.483 103.726 115.113 102.808C113.981 103.448 112.849 104.084 111.716 104.725C111.669 104.753 111.632 104.811 111.6 104.862C110.088 107.166 108.577 109.474 107.07 111.778L106.556 111.958L106.625 112.06L106.589 111.926ZM79.6906 2.95141C79.6906 2.92971 79.6906 2.90801 79.6906 2.88631C79.6724 2.89716 79.6505 2.91163 79.6323 2.92248C79.8253 2.9478 80.0146 2.97311 80.2076 2.99843C80.0328 2.98397 79.8617 2.96588 79.6869 2.95141H79.6906ZM95.1662 8.90488C95.1116 8.90488 95.0533 8.89764 94.9987 8.90849C94.9732 8.91211 94.955 8.94828 94.9368 8.96998C95.0242 8.93381 95.1116 8.89764 95.199 8.86147C95.301 9.07125 95.3956 9.28827 95.5194 9.49082C95.5376 9.51975 95.6796 9.47273 95.7634 9.45827C95.5668 9.2738 95.3665 9.08934 95.1699 8.90126L95.1662 8.90488ZM86.7729 124.603C85.8772 124.921 84.9778 125.229 84.0893 125.565C83.94 125.623 83.8417 125.811 83.7215 125.941C83.8562 125.988 84.031 126.111 84.1184 126.068C85.0069 125.605 85.8808 125.117 86.7584 124.636C86.8021 124.621 86.8494 124.592 86.8895 124.596C86.9259 124.6 86.9623 124.643 86.9951 124.665C86.9186 124.643 86.8458 124.621 86.7693 124.603H86.7729ZM82.2431 4.35478L82.2941 4.31138V4.32223C82.5672 4.5935 82.793 5.00583 83.1207 5.11072C85.8189 5.99325 88.5317 6.82153 91.2445 7.6498C91.4193 7.70406 91.6341 7.64257 91.8271 7.63172C91.6596 7.46896 91.514 7.25917 91.3173 7.
9514705C88.4844 5.599 85.4912 4.56456 82.2395 4.35116L82.2431 4.35478ZM29.9609 10.9991C30.2995 11.0135 30.6928 11.1438 30.9732 11.0208C33.8389 9.75847 36.6937 8.46361 39.5376 7.15428C39.9054 6.98429 40.2331 6.70217 40.5244 6.41643C40.7319 6.21388 40.8412 5.91729 40.9941 5.66049C40.6664 5.68943 40.2913 5.62432 40.0219 5.76177C36.6573 7.49066 33.3109 9.2521 29.9609 11.0027C29.9864 11.0461 30.0119 11.0895 30.041 11.1293C30.0701 11.1655 30.1102 11.1944 30.1466 11.2233L29.9609 10.9991ZM8.93219 95.5918C8.89213 95.628 8.84844 95.6677 8.80838 95.7039C8.85208 95.6641 8.89942 95.6243 8.94311 95.5845C8.99773 96.0801 8.91398 96.6443 9.12882 97.0566C11.7397 102.034 14.7984 106.641 19.9509 109.43C19.9436 109.437 19.9363 109.445 19.9327 109.455C19.7579 108.913 19.6413 108.345 19.401 107.828C18.4943 105.875 17.6204 103.903 16.5899 102.015C16.1347 101.18 15.4283 100.417 14.6746 99.82C12.8102 98.3479 10.8512 96.9915 8.93219 95.5918ZM23.0533 112.295C23.097 112.248 23.1407 112.201 23.1844 112.15C23.1443 112.19 23.1006 112.23 23.0606 112.269C23.279 112.472 23.5449 112.646 23.7087 112.888C27.1206 117.861 32.1275 120.35 37.7861 121.818C38.1648 121.916 38.5763 121.887 38.9732 121.919C38.813 121.608 38.6709 121.283 38.4925 120.983C37.7861 119.789 37.1525 118.541 36.3259 117.434C35.8344 116.776 35.1206 116.125 34.3669 115.843C31.1917 114.657 27.9691 113.597 24.7501 112.53C24.2149 112.353 23.6177 112.367 23.0496 112.291L23.0533 112.295ZM69.8298 86.3252C73.0378 86.3252 75.4666 86.2927 77.8917 86.3397C78.9514 86.3614 79.4029 86.025 79.4284 84.9074C79.5049 81.4134 79.6432 77.9195 79.818 74.4291C79.8763 73.25 79.4757 72.9353 78.2777 72.8919C71.4903 72.6605 64.7065 72.353 57.9227 71.9986C56.8048 71.9407 56.2804 72.1107 56.204 73.3477C55.9855 76.8344 55.7015 80.3211 55.341 83.797C55.2135 85.0267 55.665 85.3595 56.8048 85.4282C61.4074 85.7067 66.0028 86.0539 69.8262 86.3216L69.8298 86.3252ZM69.9245 72.2192C72.2076 72.2192 74.9969 72.1505 77.7789 72.2481C79.2937 72.3024 79.9527 71.9371 79.869 70.2697C79.7015 66.9638 79.6796 63.6507 79.7088 60.3412C79.7197 58.8836 79.2536 58.4315 77.7315 58.3881C71.6177 58.2217 65.5076 57.9251 59.4011 57.5779C58.1994 57.5092 57.828 57.8274 57.7224 58.9776C57.3838 62.6307 56.9832 66.2838 56.528 69.9261C56.3897 71.0401 56.8776 71.2571 57.8171 71.3222C61.6842 71.5862 65.5513 71.8937 69.9281 72.2228L69.9245 72.2192ZM55.3956 74.3749C55.4247 74.0892 55.432 73.5394 55.5412 73.0149C55.7415 72.0564 55.2936 71.7852 54.4088 71.6333C47.8471 70.5048 41.2927 69.3401 34.742 68.1429C33.9481 67.9982 33.4748 68.0019 33.3655 68.9459C32.9249 72.6496 32.4115 76.3461 32.0401 80.0571C32 80.473 32.6118 81.2905 33.0269 81.3664C39.7488 82.6396 46.4852 83.8151 53.2181 85.0267C54.2267 85.2076 54.6091 84.8531 54.671 83.8115C54.853 80.7479 55.1334 77.688 55.3956 74.3749ZM54.143 71.2065C55.4757 71.3511 55.7634 70.7073 55.8726 69.5788C56.2222 65.9294 56.6264 62.2835 57.0888 58.6449C57.2272 57.5489 56.7429 57.3645 55.8253 57.2089C49.8644 56.1926 43.9108 55.1437 37.9718 54.0297C37.0178 53.8488 36.6464 54.0731 36.4461 54.9484C35.6122 58.5798 34.7638 62.2075 33.9008 65.8317C33.6823 66.754 33.8753 67.2966 34.9131 67.4955C41.3255 68.7144 47.7342 69.9659 54.1466 71.2101L54.143 71.2065ZM68.519 99.3606C71.5449 99.3606 73.97 99.3172 76.3915 99.3787C77.564 99.4077 78.1612 99.0894 78.2595 97.8198C78.5035 94.702 78.8203 91.5879 79.1808 88.4809C79.3119 87.3524 78.9514 87.0558 77.8262 87.0161C70.8093 86.7629 63.7925 86.4554 56.7793 86.0901C55.6286 86.0286 55.1334 86.2565 55.0897 87.4646C54.9805 90.5896 54.813 93.7146 54.5981 96.836C54.518 97.9753 54.8676 98.4094 56.0656 98.4781C60.417 98.7277 64.7611 99.0857 68.5153 99.3606H68.519ZM80.5244 79.623H80.4261C80.3278 81.3664 80.2659 83.1134 80.1202 84.8531C80.0365 85.8442 80.3023 86.318 81.3947 86.2095C87.7816 85.5621 94.1721 84.9616 100.555 84.2636C101.007 84.2129 101.728 83.4968 101.739 83.0772C101.826 79.3482 101.779 75.6155 101.772 71.8864C101.772 71.1486 101.488 70.852 100.654 70.9388C94.3287 71.5935 88.0001 72.2083 81.6678 72.8015C80.8339 72.8811 80.4989 73.1849 80.5171 74.0277C80.5572 75.894 80.5281 77.7603 80.5281 79.6267L80.5244 79.623ZM80.3788 65.1156C80.437 65.1156 80.4953 65.1156 80.5536 65.1156C80.5536 66.9819 80.5936 68.8518 80.5353 70.7182C80.5062 71.6911 80.7393 72.2011 81.8389 72.089C88.0474 71.4633 94.2559 70.852 100.468 70.2624C101.418 70.172 101.699 69.7271 101.579 68.8374C101.058 65.0794 100.559 
9561.3178 100.057 57.5598C99.9473 56.7424 99.5795 56.5217 98.7056 56.6158C93.0433 57.2234 87.3738 57.7768 81.7006 58.2868C80.7138 58.3772 80.3096 58.6557 80.3533 59.6938C80.4297 61.4986 80.3751 63.3071 80.3751 65.1119L80.3788 65.1156ZM54.1393 91.8881C54.1393 91.8881 54.1466 91.8881 54.1503 91.8881C54.2413 90.2677 54.2959 88.6401 54.4416 87.0233C54.518 86.1805 54.2304 85.8767 53.3892 85.7357C46.6527 84.5819 39.9199 83.4027 33.198 82.173C32.1675 81.9849 31.7342 82.173 31.7379 83.2581C31.7451 86.5639 31.6687 89.8734 31.7379 93.1793C31.7488 93.6386 32.3496 94.4054 32.7829 94.485C39.3774 95.7365 45.99 96.8939 52.599 98.0802C53.5385 98.2502 53.9026 97.8777 53.9136 96.93C53.9391 95.2482 54.0592 93.5663 54.1393 91.8844V91.8881ZM70.1758 44.2893C66.5199 44.018 63.8508 43.8878 61.2035 43.5912C60.0929 43.4682 59.7106 43.7395 59.5831 44.8391C59.1717 48.3656 58.7019 51.8884 58.1594 55.3969C57.9773 56.5724 58.4033 56.8653 59.4702 56.9087C65.6423 57.1619 71.8144 57.4404 77.9864 57.7406C79.2063 57.8021 79.5631 57.3211 79.4612 56.1492C79.1516 52.6118 78.8822 49.0709 78.6819 45.5263C78.62 44.4412 78.1102 44.264 77.1817 44.2784C74.5162 44.3182 71.8508 44.2929 70.1758 44.2929V44.2893ZM82.6983 99.3715C87.9782 98.7168 93.2582 98.0513 98.5417 97.4147C99.4084 97.3098 100.006 97.0747 100.14 96.0728C100.585 92.7995 101.091 89.5334 101.579 86.2637C101.728 85.2655 101.458 84.9182 100.319 85.0412C94.0665 85.714 87.8107 86.3397 81.544 86.8678C80.2695 86.9763 79.9163 87.4428 79.8471 88.593C79.7088 90.8717 79.5085 93.1504 79.2427 95.4182C78.7912 99.2919 78.762 99.2883 82.6983 99.3715ZM58.9495 44.0035C58.9714 43.4682 58.9714 43.4755 57.6423 43.2368C52.6427 42.3398 47.6396 41.4681 42.6509 40.5168C41.6823 40.3324 41.2308 40.553 40.9213 41.4789C39.7633 44.9584 38.5617 48.4234 37.3309 51.8776C37.0105 52.7782 37.1999 53.2159 38.1539 53.3822C44.1694 54.4311 50.1776 55.5162 56.204 56.5109C56.5499 56.5688 57.3146 56.019 57.3692 55.6754C57.9372 51.9318 58.4033 48.1739 58.9532 44.0035H58.9495ZM83.798 57.7225C88.5499 57.1619 93.3019 56.
956122 98.0538 56.0371C98.8767 55.9358 99.8308 55.9539 99.4484 54.5903C98.4289 50.9372 97.4603 47.2696 96.488 43.6057C96.2732 42.7919 95.8071 42.6472 95.0097 42.734C90.2541 43.2476 85.4948 43.7504 80.7283 44.1518C79.6177 44.2459 79.2572 44.5497 79.3738 45.6637C79.6651 48.4777 79.8981 51.2989 80.0693 54.1237C80.2841 57.6647 80.2477 57.6683 83.798 57.7189V57.7225ZM32.6154 68.0344C32.437 67.9259 31.9673 67.5244 31.4283 67.3255C26.538 65.546 21.6222 63.8279 16.7392 62.0231C15.8835 61.7084 15.421 61.571 15.2535 62.6669C14.711 66.2404 14.092 69.7995 13.5895 73.3766C13.5239 73.8396 13.8443 74.7004 14.1939 74.8306C19.5175 76.8344 24.8667 78.7622 30.2376 80.643C30.467 80.7226 31.188 80.2162 31.2244 79.9233C31.7124 76.1617 32.1202 72.3856 32.6154 68.0308V68.0344ZM32.6919 66.8951C32.8485 66.5189 33.0851 66.1174 33.1907 65.687C34.0574 62.0629 34.8439 58.417 35.7797 54.8073C36.0565 53.7403 35.6705 53.5052 34.7893 53.1978C30.2813 51.6389 25.777 50.0547 21.3164 48.3692C20.3223 47.993 19.9181 48.116 19.594 49.0781C18.4324 52.554 17.249 56.0262 16.0364 59.4876C15.6759 60.5148 16.0328 61.0465 17.005 61.3901C21.9026 63.1226 26.7893 64.8768 31.6832 66.6202C31.909 66.6998 32.1493 66.7468 32.6955 66.8915L32.6919 66.8951ZM67.1207 110.645C69.8116 110.645 72.2404 110.598 74.6619 110.667C75.7324 110.696 76.1767 110.298 76.3405 109.282C76.7738 106.605 77.2363 103.936 77.7679 101.278C77.9828 100.207 77.5203 100.098 76.6282 100.062C69.7242 99.7874 62.8239 99.4836 55.9236 99.1364C54.9259 99.0857 54.5035 99.2774 54.5071 100.359C54.5144 102.949 54.467 105.538 54.3287 108.124C54.2595 109.383 54.7292 109.817 55.9527 109.886C59.7652 110.099 63.574 110.396 67.1207 110.642V110.645ZM53.615 104.106C53.6769 104.106 53.7351 104.106 53.797 104.106C53.797 102.844 53.7351 101.578 53.8153 100.319C53.8772 99.3642 53.6113 98.9483 52.5918 98.7783C46.0264 97.6679 39.472 96.5141 32.9249 95.306C31.8871 95.1143 31.7706 95.4471 31.8835 96.2935C32.2658 99.093 32.6518 101.892 32.9759 104.699C33.0924 105.712 33.6059 106.15 34.5672 106.32C40.4698 107.358 46.3651 108.407 52.2604 109.488C53.3637 109.691 53.655 109.257 53.6223 108.258C53.5786 106.877 53.6113 105.491 53.6113 104.106H53.615ZM30.9586 87.8552C30.9805 87.8552 31.0059 87.8552 31.0278 87.8552C31.0278 86.2927 30.9513 84.7229 31.0533 83.164C31.1225 82.0717 30.7583 81.6304 29.6951 81.2688C24.6627 79.5543 19.6596 77.7495 14.6746 75.9085C13.7351 75.5612 13.3309 75.5793 13.3673 76.6716C13.4766 80.0354 13.5166 83.4027 13.7169 86.7629C13.7497 87.3199 14.3359 88.1337 14.8566 88.329C19.8307 90.2026 24.8448 91.964 29.8444 93.7761C30.7474 94.1052 31.0096 93.8267 30.9768 92.908C30.9186 91.2262 30.9622 89.5407 30.9622 87.8552H30.9586ZM40.6009 40.2564C40.1785 40.0719 39.7524 39.8622 39.3118 39.703C35.554 38.343 31.7706 37.0518 28.0492 35.5978C27.0587 35.2108 26.6436 35.417 26.2103 36.2308C24.477 39.4752 22.7547 42.7268 20.9595 45.935C20.3769 46.9803 20.701 47.4396 21.7023 47.7941C26.152 49.3674 30.6054 50.9372 35.0369 52.5684C36.0783 52.9518 36.3915 52.5467 36.6901 51.6497C37.848 48.1594 39.0715 44.6944 40.2695 41.2185C40.3496 40.9906 40.4261 40.7628 40.6045 40.26L40.6009 40.2564ZM117.997 64.3632C117.018 60.4172 116.082 56.5688 115.062 52.742C115.004 52.5214 114.236 52.2791 113.897 52.3767C109.786 53.5776 105.69 54.8218 101.611 56.1275C101.233 56.2505 100.734 56.9124 100.774 57.2704C101.225 61.1478 101.753 65.0179 102.332 68.8772C102.383 69.2063 103.039 69.7633 103.257 69.6982C107.882 68.331 112.488 66.9023 117.083 65.4302C117.422 65.3217 117.63 64.8045 117.994 64.3632H117.997ZM81.0087 110.443C81.016 110.501 81.0269 110.555 81.0342 110.613C85.666 110.034 90.3014 109.484 94.9222 108.848C95.4903 108.768 96.3205 108.367 96.4807 107.918C97.5513 104.978 98.4762 101.983 99.4339 99.0025C99.6523 98.3262 99.4776 98.0296 98.651 98.1164C92.3187 98.7602 85.9828 99.3425 79.6541 100.015C79.2463 100.059 78.6601 100.641 78.5654 101.061C78.1539 102.88 77.8808 104.732 77.5859 106.576C77.3783 107.86 77.2181 109.155 77.036 110.443H81.0051H81.0087ZM102.518 77.131C102.518 77.131 102.529 77.131 102.533 77.131C102.533 78.9973 102.54 80.86 102.529 82.7264C102.525 83.3485 102.423 84.0827 103.414 83.7789C108.148 82.3249 112.878 80.8528 117.582 79.3156C117.946 79.1962 118.354 78.5126 118.351 78.0967C118.311 74.4291 118.172 70.7652 118.081 67.0976C118.059 66.2259 117.852 66.0053 116.89 66.3164C112.524 67.7306 108.133 69.0797 103.72 70.3456C102.682 70.6422 102.402 71.022 102.485 72.0745C102.616 73.7492 102.522 75.4419 102.522 77.1237L102.518 77.131ZM70.8895 43.5767C73.1871 43.5767 75.1243 43.537 77.0579 43.5912C78.1102 43.6201 78.4634 43.2512 78.3105 42.2168C77.8226 38.9471 77.3565 35.6774 76.9414 32.3968C76.8285 31.4962 76.4607 31.2069 75.554 31.1815C71.4429 31.0658 67.3319 30.9103 63.2245 30.6933C62.2559 30.6426 61.7861 30.8849 61.6368 31.8651C61.1562 35.0119 60.661 38.1586 60.0893 41.2945C59.8671 42.5134 60.3187 42.8968 61.4657 42.9583C64.7283 43.1391 67.9837 43.3814 70.8858 43.5731L70.8895 43.5767ZM58.3596 42.857C58.7056 42.3723 59.2372 41.9491 59.3319 41.4428C59.9181 38.2454 60.3587 35.0191 60.9559 31.8217C61.1489 30.7873 60.9122 30.4871 59.8781 30.3207C56.051 29.7058 52.2349 29.0078 48.4297 28.2771C47.5048 28.0999 46.9659 28.2771 46.5617 29.1524C45.1489 32.216 43.696 35.2614 42.2212 38.2996C41.7879 39.1894 41.7916 39.6958 42.9532 39.9092C47.9563 40.8351 52.9486 41.8153 58.356 42.857H58.3596ZM101.029 55.8743
95C105.457 54.3841 109.691 52.9808 113.894 51.4906C114.156 51.3965 114.414 50.5466 114.276 50.2102C112.779 46.6041 111.224 43.0197 109.611 39.4643C109.484 39.1858 108.745 38.9362 108.395 39.0375C104.863 40.0647 101.342 41.1462 97.8426 42.2819C97.5295 42.3832 97.118 43.027 97.1872 43.3091C98.1375 47.096 99.1535 50.8649 100.191 54.6301C100.29 54.9918 100.628 55.2884 101.025 55.8671L101.029 55.8743ZM82.5089 43.5731C86.4816 43.0993 90.4507 42.6183 94.4234 42.1625C95.4648 42.0432 95.9746 41.7611 95.4502 40.5783C94.0374 37.3846 92.7484 34.1329 91.2918 30.9573C91.0843 30.5016 90.1922 30.0603 89.6532 30.1001C86.0301 30.3713 82.4179 30.8235 78.7948 31.1056C77.6951 31.1888 77.4985 31.5432 77.666 32.5451C78.0993 35.1602 78.4379 37.7897 78.8094 40.4119C79.1055 42.5098 80.3375 43.5635 82.5053 43.5731H82.5089ZM118.245 81.8981C117.735 81.3881 119.017 79.8762 117.357 80.3283C112.692 81.6015 108.082 83.0772 103.479 84.5529C103.006 84.7048 102.442 85.345 102.361 85.8297C101.812 89.1537 101.397 92.4993 100.89 95.8305C100.745 96.7818 101.04 97.0675 101.946 96.7854C106.276 95.4399 110.624 94.1486 114.91 92.6838C115.583 92.4523 116.268 91.4866 116.446 90.7451C117.153 87.8226 117.662 84.8531 118.245 81.8981ZM32.1857 105.224C31.7925 101.784 31.4866 98.7313 31.0533 95.6967C30.9914 95.2699 30.3906 94.749 29.9281 94.579C24.9868 92.7778 20.0128 91.0706 15.0751 89.2622C14.0519 88.886 13.8844 89.1247 14.1102 90.0507C14.8494 93.0853 15.574 96.1271 16.3569 99.1545C16.4661 99.5704 16.8157 100.106 17.1834 100.243C21.9317 102.034 26.7019 103.77 31.4793 105.48C31.716 105.564 32.0911 105.26 32.1821 105.224H32.1857ZM65.8244 119.662C67.8854 119.662 69.9464 119.626 72.0037 119.681C72.9832 119.706 73.6023 119.449 73.8717 118.433C74.3815 116.516 74.9313 114.606 75.5358 112.714C75.8599 111.691 75.6341 111.376 74.5126 111.34C68.2786 111.134 62.0447 110.902 55.8143 110.551C54.4743 110.475 54.2704 110.924 54.3432 112.038C54.4634 113.839 54.5435 115.644 54.5472 117.449C54.5472 118.512 54.955 118.928 56.0292 118.99C59.2955 119.171 62.5544 119.435 65.8244 119.666V119.662ZM40.7174 39.2871C40.914 39.023 41.2672 38.6794 41.4639 38.2671C42.9495 35.171 44.3769 32.0496 45.8881 28.968C46.3068 28.1144 46.2558 27.778 45.2727 27.4525C42.3451 26.4831 39.4757 25.351 36.5481 24.3817C36.0783 24.2262 35.1971 24.3926 34.9131 24.7362C32.579 27.5755 30.3505 30.5052 28.0601 33.3842C27.361 34.2632 27.5977 34.737 28.5772 35.0842C32.3387 36.4116 36.0965 37.7571 39.858 39.0954C40.0292 39.1569 40.2112 39.1749 40.7137 39.2871H40.7174ZM53.757 114.577C53.6732 113.26 54.0774 111.492 53.3783 110.75C52.6209 109.947 50.833 110.103 49.493 109.839C49.3146 109.803 49.1361 109.781 48.9577 109.745C44.3259 108.877 39.6796 108.067 35.066 107.112C33.5658 106.801 33.391 107.199 33.828 108.468C34.4943 110.399 35.1243 112.342 35.7215 114.291C36.0201 115.271 36.6282 115.738 37.6368 115.923C41.6787 116.657 45.6987 117.532 49.7552 118.194C53.8881 118.867 53.9026 118.784 53.757 114.573V114.577ZM10.4215 40.8894C10.163 41.3017 9.90442 41.6128 9.75513 41.9672C8.40055 45.1863 7.09696 48.4234 5.71325 51.6316C5.2508 52.7023 5.49113 53.5305 6.34684 54.1816C8.84116 56.0732 11.3755 57.9215 13.888 59.7878C14.8603 60.5076 15.1297 60.0446 15.4392 59.0825C16.5644 55.5886 17.7369 52.1018 19.026 48.6658C19.4047 47.6566 19.0587 47.3709 18.3123 46.8537C15.8908 45.1682 13.5494 43.3634 11.1825 41.5983C10.9458 41.4211 10.7492 41.1968 10.4215 40.8894ZM97.2272 41.9564C100.996 40.6977 104.605 39.5041 108.188 38.2454C108.37 38.1803 108.534 37.3882 108.373 37.1458C106.229 33.8725 104.047 30.6245 101.804 27.4199C101.604 27.1306 100.861 26.9859 100.468 27.1016C97.8572 27.8503 95.2755 28.7112 92.6719 29.4816C91.9618 29.6914 91.6487 29.8433 92.0128 30.6824C93.4803 34.0425 94.8603 37.4424 96.3023 40.817C96.4589 41.1823 96.8157 41.4645 97.2272 41.96V41.9564ZM14.5872 61.3503C14.4961 61.2635 14.1102 60.8331 13.655 60.4931C11.0879 58.5942 8.4661 56.7604 5.94265 54.8001C5.22531 54.2394 4.90852 53.9718 4.71917 55.0677C4.11106 58.5653 3.46655 62.0592 2.93491 65.5677C2.85116 66.1247 3.10242 66.9927 3.51753 67.3255C6.24124 69.5065 9.04507 71.5899 11.8416 73.6804C12.47
9552 74.1543 12.7519 73.883 12.8575 73.1343C13.3855 69.3763 13.9536 65.6255 14.5872 61.3431V61.3503ZM26.1703 34.8817C25.868 34.661 25.584 34.4621 25.3073 34.2523C23.2353 32.7006 21.1197 31.2069 19.1206 29.5684C18.4288 29.0005 18.1411 29.1488 17.7369 29.7348C15.5885 32.8598 13.4511 35.9957 11.2808 39.1026C10.7346 39.8839 10.9641 40.477 11.6013 40.9653C13.8953 42.7195 16.2185 44.434 18.5198 46.1773C19.4447 46.8754 19.878 46.5933 20.3842 45.595C22.0446 42.3217 23.8289 39.1135 25.5694 35.8799C25.7406 35.5616 25.9372 35.2614 26.1666 34.878L26.1703 34.8817ZM77.6332 119.492C79.7488 119.308 81.8644 119.156 83.9764 118.935C91.5431 118.147 91.7106 118.02 95.0643 111.21C95.1189 111.101 95.1844 110.996 95.2208 110.884C95.3483 110.494 95.4648 110.099 95.585 109.709C95.1699 109.705 94.7511 109.662 94.3396 109.705C89.6387 110.182 84.9414 110.732 80.2331 111.137C76.6865 111.445 76.6828 111.362 75.7106 114.859C75.5649 115.38 75.4193 115.904 75.2627 116.422C74.6194 118.541 75.4096 119.565 77.6332 119.492ZM97.7625 108.812C102.398 107.17 106.669 105.665 110.926 104.131C111.17 104.045 111.396 103.733 111.509 103.477C112.834 100.446 114.141 97.4039 115.427 94.3584C115.529 94.1161 115.448 93.8014 115.452 93.5193C115.172 93.5772 114.884 93.6169 114.611 93.6965C110.267 94.995 105.919 96.279 101.59 97.6281C101.102 97.78 100.493 98.2177 100.341 98.6626C99.3246 101.621 98.4143 104.616 97.4967 107.607C97.4275 107.828 97.5986 108.121 97.7625 108.819V108.812ZM70.5399 30.5052C72.3205 30.5052 73.8353 30.4726 75.3501 30.516C76.3587 30.545 76.6173 30.1326 76.4061 29.2067C75.7834 26.447 75.2445 23.6692 74.5454 20.9312C74.4361 20.4971 73.6933 19.9618 73.2053 19.9257C70.5508 19.7195 67.8817 19.6869 65.2235 19.5206C64.3788 19.4663 64.0219 19.7448 63.869 20.5405C63.3592 23.199 62.8348 25.8574 62.2668 28.505C62.0228 29.6335 62.4379 30.0024 63.5485 30.0494C65.9664 30.1543 68.3842 30.3605 70.5363 30.5052H70.5399ZM60.4862 29.9011C60.8103 29.525 61.371 29.1633 61.4766 28.7003C62.1029 25.937 62.5981 23.1483 63.1917 20.3814C63.3665 19.5712 63.0897 19.3252 62.3287 19.2023C59.8162 18.7936 57.3219 18.28 54.8057 17.911C54.3323 17.8423 53.564 18.0846 53.32 18.4463C51.5176 21.0867 49.828 23.7994 48.0729 26.4723C47.534 27.2933 47.9636 27.4923 48.681 27.6297C52.4898 28.3567 56.295 29.0946 60.4862 29.9011ZM80.2841 30.3677C80.2877 30.4075 80.295 30.4473 80.2987 30.4835C83.2955 30.1182 86.2923 29.7348 89.2928 29.3984C90.2286 29.2935 90.4361 28.9607 89.93 28.1469C88.2186 25.3908 86.5727 22.5913 84.7848 19.8859C84.4898 19.4374 83.5904 19.148 82.9932 19.1806C80.7648 19.3035 78.5472 19.6508 76.3187 19.7846C75.2736 19.8461 75.1498 20.215 75.3647 21.112C75.9109 23.3871 76.366 25.6838 76.8831 27.9661C77.5167 30.762 76.7993 30.4509 79.9236 30.3822C80.0438 30.3822 80.1639 30.3713 80.2841 30.3677ZM12.5553 81.0915C12.5954 81.0915 12.6318 81.0915 12.6718 81.0915C12.6718 79.4639 12.6136 77.8363 12.6937 76.2123C12.741 75.2972 12.3805 74.8668 11.6377 74.364C8.98681 72.5809 6.42331 70.6712 3.8234 68.8084C3.53938 68.6059 3.25171 68.4033 2.96404 68.2008C2.86209 68.5914 2.65453 68.9857 2.67638 69.3691C2.85845 72.6749 3.05508 75.9772 3.31361 79.2794C3.35367 79.775 3.6122 80.4007 3.98362 80.7009C6.61266 82.8023 9.29268 84.8495 11.9763 86.8822C12.6172 87.3669 12.9413 87.1571 12.8794 86.3216C12.7447 84.5782 12.6573 82.8349 12.5517 81.0915H12.5553ZM28.7774 19.0395C28.457 19.2529 28.1293 19.4121 27.878 19.6508C25.1216 22.2622 22.3796 24.8953 19.6231 27.5031C18.9859 28.1035 19.0332 28.6642 19.6814 29.1488C21.6987 30.6679 23.716 32.1907 25.8025 33.6157C26.0829 33.8074 26.9604 33.6049 27.208 33.3011C29.5931 30.3496 31.8835 27.3259 34.2504 24.3564C34.7711 23.7053 34.6728 23.4594 34.0064 23C32.4188 21.9113 30.9222 20.6961 29.3892 19.5278C29.2035 19.3867 29.0287 19.2348 28.7811 19.0359L28.7774 19.0395ZM126.128 57.5272C125.076 53.9971 123.962 50.25 122.808 46.5173C122.786 46.4414 122.159 46.4016 121.977 46.5426C120.098 48.0364 118.223 49.5411 116.421 51.1217C116.071 51.4291 115.783 52.1308 115.874 52.5648C116.65 56.2758 117.502 59.9687 118.402 63.6543C118.471 63.9328 119.203 64.3488 119.381 64.2547C121.799 62.9454 123.995 61.354 125.499 58.9921C125.717 58.6485 125.83 58.2362 126.132 57.5309L126.128 57.5272ZM122.083 44.745C122.028 44.5388 122.017 44.4086 121.963 44.3074C120.091 40.8062 118.223 37.305 116.311 33.8255C116.253 33.7206 115.634 33.7604 115.43 33.9232C113.835 35.1963 112.259 36.4912 110.737 37.8475C110.449 38.1043 110.194 38.759 110.321 39.0664C111.825 42.6761 113.391 46.2605 115.001 49.8232C115.139 50.127 115.929 50.4959 116.057 50.3947C117.965 48.8575 119.822 47.2552 121.661 45.6312C121.905 45.4178 121.966 45.0018 122.087 44.745H122.083ZM17.4238 101.245C17.4529 101.668 17.3874 101.994 17.5075 102.225C18.8038 104.735 20.1002 107.246 21.4657 109.72C21.706 110.157 22.1939 110.573 22.6637 110.75C26.4434 112.193 30.2449 113.586 34.0465 114.964C34.3487 115.073 34.731 114.968 35.077 114.964C34.9932 114.624 34.924 114.277 34.8221 113.94C34.203 111.929 33.4966 109.944 32.9795 107.907C32.721 106.895 32.2404 106.475 31.2499 106.146C27.0041 104.743 22.8057 103.213 18.589 101.722C18.305 101.
95621 18.0282 101.491 17.4238 101.241V101.245ZM45.7096 14.9271C45.6878 14.9379 45.4402 14.9922 45.2763 15.1405C42.4288 17.6542 39.5849 20.1716 36.7593 22.7035C36.0492 23.34 36.6464 23.6294 37.1707 23.8175C40.0692 24.8628 42.9641 25.9081 45.8881 26.8738C46.2522 26.9931 46.9987 26.7653 47.2026 26.4578C49.0051 23.756 50.7383 21.0035 52.4534 18.2402C52.5918 18.0159 52.5153 17.3613 52.3842 17.3142C50.2395 16.504 48.0692 15.7553 45.7133 14.9271H45.7096ZM119.254 73.0873C119.214 73.0873 119.177 73.0909 119.137 73.0945C119.137 74.5376 119.174 75.9844 119.123 77.4276C119.093 78.3354 119.447 78.5995 120.135 78.0352C122.079 76.4402 124.024 74.8306 125.848 73.1017C126.354 72.6243 126.671 71.6984 126.664 70.9822C126.635 67.557 126.467 64.1317 126.329 60.7065C126.318 60.4461 126.132 60.1893 126.03 59.9325C125.808 60.1025 125.579 60.2689 125.36 60.4461C123.481 61.9435 121.653 63.5133 119.698 64.9058C118.951 65.4375 118.653 65.8896 118.747 66.7902C118.973 68.8844 119.09 70.9858 119.254 73.0873ZM91.0807 29.3948C94.5945 28.241 97.2891 27.3765 99.9582 26.4289C100.118 26.371 100.235 25.474 100.049 25.2787C97.4603 22.5949 94.8312 19.9474 92.1548 17.3504C91.8599 17.0647 91.1608 16.9706 90.7311 17.0828C89.158 17.4915 87.6287 18.0666 86.0592 18.5006C85.229 18.7285 85.1489 19.0106 85.5932 19.7231C87.3446 22.5262 89.0561 25.3547 90.742 28.194C90.9823 28.6027 91.0115 29.1344 91.0843 29.3948H91.0807ZM115.401 32.5053C115.139 32.093 114.931 31.6626 114.629 31.3081C112.452 28.7401 110.216 26.2191 108.086 23.6113C107.103 22.4105 106.487 22.4503 105.548 23.6836C104.914 24.5155 103.942 25.1376 103.024 25.6983C102.219 26.1902 102.092 26.5121 102.667 27.3367C104.801 30.3894 106.869 33.4891 108.898 36.6142C109.378 37.3556 109.775 37.7282 110.554 37.0844C111.938 35.9378 113.333 34.8021 114.684 33.6193C114.986 33.3553 115.139 32.9249 115.401 32.5089V32.5053ZM63.7197 125.876C64.5317 125.876 65.5003 125.869 66.4689 125.876C70.8021 125.916 70.762 125.902 72.5317 121.858C73.0633 120.639 72.8558 120.364 71.5267 120.339C67.2845 120.266 63.046 120.093 58.8075 119.905C54.0155 119.691 54.5472 118.44 55.1807 123.967C55.29 124.932 55.7306 125.316 56.6628 125.374C58.9605 125.515 61.2581 125.695 63.716 125.873L63.7197 125.876ZM110.263 105.679C109.87 105.679 109.575 105.614 109.32 105.69C105.438 106.819 101.56 107.944 97.6969 109.134C97.1981 109.289 96.6665 109.723 96.397 110.172C95.1444 112.291 93.9719 114.458 92.7848 116.617C92.6501 116.863 92.5882 117.149 92.4935 117.416C92.7848 117.416 93.0943 117.492 93.3601 117.409C96.6373 116.375 99.9145 115.337 103.174 114.248C103.661 114.085 104.157 113.723 104.477 113.322C106.269 111.061 108.006 108.757 109.761 106.464C109.906 106.276 110.023 106.063 110.267 105.679H110.263ZM37.3018 116.834C37.2909 116.935 37.1307 117.301 37.2508 117.492C38.2085 119.019 39.1807 120.541 40.2331 122.003C40.5207 122.4 41.0742 122.748 41.5622 122.842C45.5385 123.609 49.5258 124.328 53.5203 124.99C53.8007 125.037 54.4671 124.498 54.4561 124.256C54.3979 122.939 54.2486 121.616 53.9755 120.324C53.8954 119.945 53.3528 119.449 52.9559 119.384C47.8908 118.519 42.8111 117.72 37.3018 116.834ZM3.87074 82.8421C4.34411 84.5348 4.95221 86.3108 5.32363 88.1337C6.3869 93.3601 10.0319 96.3622 14.3905 98.7855C14.6746 98.9411 15.0278 98.97 15.3519 99.0568C15.3227 98.7711 15.3191 98.4781 15.2572 98.1996C14.5981 95.2626 13.9536 92.3257 13.2399 89.4032C13.1124 88.8824 12.7847 88.2892 12.3623 87.9818C9.78062 86.0974 7.14794 84.2817 4.52982 82.4515C4.36232 82.3321 4.14384 82.2851 3.9472 82.2055C3.929 82.3755 3.90715 82.5455 3.87074 82.8493V82.8421ZM44.7301 14.5147C44.6209 14.3267 44.5881 14.2001 44.508 14.135C43.361 13.256 42.2285 12.3554 41.0342 11.5416C40.8412 11.4078 40.3278 11.585 40.0474 11.755C36.752 13.7696 33.4748 15.8168 30.1903 17.8495C29.4839 18.2872 29.4729 18.7646 30.1138 19.2384C31.6104 20.3488 33.0888 21.4954 34.6582 22.4973C34.975 22.6998 35.8052 22.5045 36.1475 22.2043C38.8348 19.8714 41.4602 17.4698 44.1038 15.0862C44.3187 14.8945 44.5262 14.6956 44.7228 14.5111L44.7301 14.5147ZM75.1935 125.71C77.6551 125.406 80.2477 125.164 82.8075 124.733C83.7689 124.571 84.7848 124.129 85.5495 123.533C86.8239 122.538 87.9382 121.33 89.0816 120.176C89.3911 119.861 89.5622 119.413 89.7989 119.022C89.3255 119.033 88.8522 119.011 88.3824 119.055C84.4134 119.431 80.448 119.966 76.468 
95120.147C74.5563 120.234 73.442 120.755 72.9286 122.614C72.6337 123.681 72.0802 124.679 71.6396 125.71H75.1899H75.1935ZM126.474 75.4925C126.314 74.9464 126.223 74.6389 126.132 74.3315C125.903 74.5051 125.677 74.6823 125.448 74.8559C123.678 76.1978 121.897 77.5252 120.149 78.8924C119.712 79.236 119.133 79.6701 119.046 80.1439C118.394 83.6198 117.848 87.1173 117.273 90.6077C117.182 91.1538 117.164 91.6783 117.954 91.1972C120.557 89.6166 123.201 87.9384 124.177 84.9218C125.189 81.7968 125.753 78.5271 126.474 75.4961V75.4925ZM95.4248 13.7552C94.6783 14.4207 94.0338 15.1513 93.2436 15.6577C92.3442 16.2328 92.4716 16.58 93.1598 17.2347C95.3009 19.2746 97.4311 21.329 99.4594 23.4775C101.844 26.0057 102.026 26.06 104.619 23.633C104.881 23.3871 105.111 23.1013 105.369 22.8481C106.09 22.1464 106.036 21.5424 105.216 20.9348C102.212 18.7031 99.2263 16.4498 96.2295 14.2109C95.9928 14.0337 95.7124 13.9179 95.4248 13.7552ZM69.9099 19.1625C70.9696 19.1625 71.9382 19.1299 72.9068 19.1733C73.8426 19.2131 74.0865 18.8514 73.7989 17.9906C73.2126 16.2219 72.6992 14.4279 72.0693 12.6773C71.8653 12.1095 71.4393 11.245 71.0242 11.1872C69.4876 10.981 67.9108 11.0352 66.3487 11.0606C66.2176 11.0606 66.0501 11.5561 65.9773 11.8382C65.4821 13.7588 65.0196 15.6866 64.5135 17.6072C64.2841 18.4789 64.5972 18.8044 65.4712 18.8478C66.9823 18.9201 68.4898 19.0612 69.9099 19.1661V19.1625ZM62.7584 18.6633C63.0497 18.327 63.6032 17.9436 63.7816 17.4336C64.1967 16.2472 64.4261 14.9958 64.7392 13.7733C65.4639 10.9593 65.4712 10.9267 62.5508 10.3625C61.7898 10.2142 60.65 10.0406 60.2349 10.4421C58.3778 12.2397 56.7138 14.2398 54.9878 16.1677C54.467 16.75 54.6309 17.1298 55.3701 17.2708C57.686 17.7157 60.0055 18.1461 62.762 18.6633H62.7584ZM76.4134 19.1444C78.3906 18.9238 80.3678 18.6706 82.3487 18.4934C83.5431 18.3885 83.503 17.9544 82.8403 17.1949C81.6569 15.8349 80.3715 14.54 79.3483 13.0716C77.8444 10.9123 75.9254 10.3914 73.453 10.9267C72.5535 11.1221 72.3678 11.3137 72.681 12.1782C73.351 14.0373 73.9955 15.9145 74.4762 17.8315C74.7638 18.9853 75.3574 19.2891 76.4134 19.1408V19.1444ZM17.1725 23.7741C17.4311 24.8266 17.584 25.5861 17.8061 26.3276C18.1375 27.4308 18.5307 27.6297 19.4629 26.6604C21.5931 24.4432 23.7633 22.2441 26.1084 20.262C27.5467 19.0431 28.7192 18.034 27.4556 16.0772C27.3646 15.9362 27.35 15.7264 27.361 15.5492C27.4338 14.3447 27.0223 14.1567 26.1011 14.9271C23.5521 17.0538 20.9413 19.1082 18.4798 21.329C17.7952 21.9475 17.5476 23.0398 17.1725 23.7741ZM8.80838 35.2072C9.11425 36.2597 9.35458 37.2435 9.69323 38.1948C10.0027 39.0628 10.3414 39.193 10.9386 38.2779C12.6718 35.6087 14.3942 32.9177 16.3387 30.4039C17.4165 29.0114 18.2103 27.8684 17.005 26.1938C16.7174 25.7923 16.7647 25.1557 16.6482 24.6313C16.5863 24.3528 16.5025 24.0779 16.4261 23.7994C16.153 23.9766 15.7997 24.096 15.6177 24.3419C13.6441 26.9895 11.6377 29.619 9.77698 32.3426C9.23078 33.1419 9.12154 34.2306 8.80474 35.2072H8.80838ZM56.2877 8.43468C56.102 8.50701 55.8617 8.56488 55.6578 8.68786C52.8467 10.3553 50.0428 12.0263 47.239 13.7045C46.427 14.1928 46.802 14.5256 47.4284 14.7498C49.1361 15.3683 50.8403 16.0121 52.5772 16.5294C52.985 16.6523 53.7024 16.4751 53.9864 16.1677C55.7597 14.2688 57.4602 12.3048 59.1498 10.3336C59.2991 10.1563 59.3027 9.56316 59.219 9.52699C58.2759 9.12913 57.3 8.79999 56.2841 8.43829L56.2877 8.43468ZM84.8394 18.1714C86.5727 17.6434 88.1312 17.1659 89.6897 16.6885C90.5927 16.4136 90.7784 16.0447 89.8972 15.4479C87.4502 13.7877 84.9814 12.1565 82.5927 10.4168C81.3801 9.53422 80.2841 9.51975 78.9259 10.0623C77.9791 10.4421 77.9391 10.6048 78.5945 11.321C80.3824 13.2777 82.0902 15.3068 83.8453 17.2925C84.1366 17.6217 84.508 17.8857 84.8358 18.1714H84.8394ZM27.838 14.7064C28.1584 15.7662 28.3041 16.4787 28.6063 17.1153C28.701 17.3179 29.3273 17.5132 29.5166 17.3974C32.9723 15.3068 36.4133 13.1909 39.818 11.028C41.016 10.2648 39.5995 9.30997 39.8726 8.44914C39.4356 8.40212 38.9113 8.17787 38.5763 8.34064C35.4702 9.81272 32.3678 11.292 29.3382 12.9088C28.6609 13.2705 28.2713 14.1639 27.8343 14.71L27.838 14.7064ZM3.23714 47.9894C3.53573 48.9913 3.81976 50.0293 4.16568 51.0493C4.24579 51.2844 4.5371 51.4508 4.73009 51.6461C4.88303 51.411 5.07602 51.1904 5.17797 50.9336C6.20483 48.4234 7.09332 45.8518 8.26947 43.4176C9.22714 41.4355 10.3013 39.6054 8.65181 37.5003C8.44789 37.2399 8.47338 36.8095 8.3605 36.4659C8.28039 36.2163 8.1493 35.9848 8.04006 35.7425C7.858 35.9631 7.61038 36.1548 7.50843 36.4044C6.32135 39.3015 5.13064 42.1951 3.99818 45.1139C3.65226 46.0037 3.49932 46.9658 3.2335 47.9894H3.23714ZM122.837 89.1862C122.775 88.9837 122.727 88.8426 122.684 88.6979C122.534 88.7847 122.378 88.8607 122.24 88.9583C120.608 90.0941 118.977 91.2298 117.36 92.3836C117.076 92.5861 116.741 92.8248 116.
95617 93.125C115.368 96.185 114.159 99.263 112.947 102.337C112.885 102.493 112.892 102.674 112.87 102.844C113.074 102.818 113.307 102.844 113.478 102.753C113.854 102.558 114.192 102.305 114.549 102.081C117.404 100.283 118.82 97.3894 120.291 94.5573C121.205 92.7959 121.992 90.973 122.837 89.1826V89.1862ZM53.5421 6.52494C52.8102 6.72749 52.3915 6.81068 51.9946 6.95535C49.1034 8.01873 46.2012 9.05317 43.3391 10.1853C41.5476 10.8942 41.5585 11.1221 43.077 12.3012C45.3564 14.0698 45.3273 14.0301 47.7197 12.4893C49.7479 11.1835 51.8526 9.99719 53.9136 8.73488C54.3432 8.47084 54.7147 8.11277 55.1152 7.79448C54.5362 7.3279 53.9573 6.8577 53.5385 6.5177L53.5421 6.52494ZM102.107 115.854C101.364 115.951 101.098 115.959 100.85 116.027C98.0538 116.787 95.2536 117.532 92.4753 118.349C91.8781 118.527 91.27 118.888 90.8258 119.326C89.5804 120.549 88.4152 121.847 87.2281 123.127C87.0315 123.341 86.8749 123.59 86.7001 123.826C86.9769 123.811 87.2645 123.833 87.534 123.782C92.8576 122.744 97.3219 120.096 101.265 116.49C101.397 116.367 101.553 116.273 102.11 115.861L102.107 115.854ZM83.0806 7.8415C82.7238 8.14532 82.3305 8.47808 81.9336 8.81445C82.1885 9.09657 82.3997 9.43657 82.7056 9.64635C85.1344 11.3174 87.6141 12.9233 90.0174 14.6305C91.7907 15.8928 92.184 15.8964 93.7716 14.352C94.5108 13.6358 94.6273 13.1186 93.564 12.6303C90.3924 11.1618 87.239 9.66443 84.0747 8.18511C83.8053 8.05851 83.5103 7.98618 83.0806 7.83788V7.8415ZM95.5449 12.0118C95.8144 12.4856 95.971 13.1041 96.3715 13.408C99.4302 15.7481 102.536 18.0304 105.639 20.3163C105.85 20.4718 106.152 20.5007 106.411 20.5912C106.48 20.3091 106.691 19.9618 106.596 19.7557C106.039 18.544 105.704 16.9996 104.75 16.2472C102.351 14.3556 99.6596 12.8256 97.0816 11.1618C96.204 10.594 95.443 10.301 95.5486 12.0154L95.5449 12.0118ZM116.148 30.0639C115.947 29.2899 115.966 28.4363 115.554 27.9263C113.063 24.8411 110.482 21.8318 107.911 18.8116C107.82 18.7068 107.463 18.667 107.368 18.7502C107.103 18.9889 107.452 21.9584 107.732 22.2767C110.125 24.9966 112.51 27.7201 114.906 30.4401C115.135 30.7005 115.416 30.9211 115.674 31.1598C115.834 30.7909 115.995 30.4256 116.151 30.0639H116.148ZM62.4525 126.603C62.4525 126.567 62.4525 126.531 62.4525 126.495C60.7593 126.383 59.0661 126.238 57.3728 126.173C56.8376 126.151 56.2914 126.336 55.7524 126.426C56.0583 127.124 56.3023 127.858 56.7028 128.499C56.8339 128.708 57.3728 128.712 57.7297 128.73C60.3915 128.86 63.0606 129.117 65.7151 129.012C66.793 128.969 67.8562 128.162 68.8831 127.623C69.1161 127.5 69.1708 127.052 69.3055 126.752C69.0215 126.701 68.7374 126.611 68.4498 126.611C66.4507 126.6 64.4516 126.603 62.4525 126.603ZM0.666364 60.938C0.972236 62.1678 1.20892 63.2167 1.51115 64.2439C1.58034 64.4754 1.88257 64.6417 2.07556 64.837C2.14474 64.6092 2.23214 64.3849 2.27583 64.1535C2.77834 61.3756 3.0041 58.5147 3.85253 55.8454C4.51889 53.7584 4.02731 52.138 3.1097 50.4272C3.00774 50.2355 2.82567 50.0872 2.68002 49.9208C2.59627 50.1415 2.47246 50.3549 2.43241 50.5864C1.82795 54.0731 1.23805 57.5634 0.662723 60.938H0.666364ZM40.5826 8.26468C40.7793 9.6572 40.8812 10.4529 42.3159 9.8706C45.5676 8.55404 48.8849 7.40385 52.1584 6.14154C52.5044 6.00772 52.7301 5.57369 53.0105 5.2771C52.6355 5.09263 52.2131 4.68754 51.8963 4.75988C48.4734 5.5339 45.0578 6.34409 41.6678 7.24471C41.1762 7.37492 40.823 8.02596 40.5826 8.26468ZM54.2522 128.354C55.0752 128.484 55.5485 128.408 55.2281 127.352C54.9441 126.415 54.6236 125.858 53.4693 125.703C50.1776 125.261 46.9113 124.618 43.6341 124.071C43.2044 123.999 42.7602 124.032 42.3196 124.014C42.6473 124.346 42.9495 124.715 43.31 125.008C46.4925 127.627 50.5162 127.536 54.2522 128.35V128.354ZM122.928 41.8804C122.666 40.9906 122.516 40.0213 122.108 39.1713C120.885 36.6214 119.589 34.104 118.252 31.6083C117.928 31.0043 117.338 30.5413 116.872 30.0097C116.778 30.9428 116.661 31.8724 116.61 32.8055C116.599 33.0008 116.861 33.2034 116.978 33.4132C118.591 36.3067 120.197 39.2039 121.813 42.0938C122.006 42.4374 122.265 42.7412 122.491 43.0668C122.622 42.7051 122.753 42.347 122.924 41.8768L122.928 41.8804ZM95.0934 11.8961C95.1553 11.6899 95.2172 11.4837 95.2828 11.2776C94.7074 10.6555 94.2486 9.75124 93.5349 9.4655C90.5709 8.28276 87.534 7.27364 84.508 6.24643C84.1803 6.13431 83.7543 6.32239 83.3719 6.36941C83.6086 6.71302 83.7689 7.21215 84.0966 7.3713C87.4102 8.96998 90.742 10.5216 94.092 12.0444C94.3506 12.1601 94.7584 11.9539 95.0934 11.8961ZM71.0096 128.915C75.463 128.549 78.6091 127.808 81.1835 126.401C81.4348 126.263 81.6496 126.064 81.879 125.894C81.5695 125.855 81.2527 125.757 80.9468 
95125.779C77.8699 126.021 74.7893 126.26 71.716 126.56C71.2281 126.607 70.6892 126.857 70.3214 127.178C69.8444 127.594 69.5167 128.177 69.1234 128.687L71.006 128.915H71.0096ZM69.3565 10.3733C71.1698 10.4059 71.2281 10.3155 70.4452 8.62999C70.2449 8.19596 70.0483 7.75831 69.808 7.3496C69.3637 6.59366 68.8904 5.85581 68.4279 5.11072C68.0456 5.93176 67.5941 6.7311 67.2955 7.5847C66.3342 10.3155 66.356 10.3227 69.3565 10.3733ZM52.6318 2.81759C50.4725 3.17566 48.4188 3.39268 46.4343 3.88458C45.0615 4.22457 43.7761 4.92264 42.4689 5.50496C42.2613 5.599 42.1557 5.92453 42.0064 6.14154C42.2358 6.13431 42.4725 6.15963 42.6946 6.11261C45.9937 5.38199 49.2927 4.6586 52.5845 3.8882C52.9377 3.80501 53.229 3.4614 53.5494 3.24077C53.2254 3.09247 52.9049 2.94418 52.6318 2.81759ZM64.9286 10.1274C65.2782 9.80187 65.8025 9.52699 65.9846 9.10381C66.4361 8.0549 66.7383 6.9445 67.077 5.85219C67.1425 5.64602 67.0952 5.40731 67.0988 5.17944C66.8804 5.23731 66.6255 5.23731 66.4507 5.35667C65.5585 5.97878 64.6555 6.59366 63.8144 7.28088C63.0861 7.87767 62.4306 8.5685 61.7461 9.21593C62.711 9.49082 63.676 9.7657 64.925 10.1202L64.9286 10.1274ZM73.0815 10.5867C73.1799 10.4819 73.2818 10.377 73.3801 10.2721C73.6787 10.2504 73.9882 10.2612 74.2795 10.1997C74.7274 10.1057 75.1644 9.96464 75.605 9.84166C75.3246 9.4872 75.0988 9.06764 74.7529 8.79637C73.4784 7.7981 72.1712 6.83961 70.8567 5.88836C70.5799 5.68943 70.2377 5.5773 69.9281 5.42539C70.0228 5.79794 70.0702 6.18856 70.2231 6.53579C70.6091 7.41109 70.955 8.32255 71.4866 9.10742C71.8835 9.69337 72.5426 10.1021 73.0852 10.5904L73.0815 10.5867ZM126.824 54.6662C125.972 51.4074 125.072 47.9351 124.144 44.4665C124.042 44.0867 123.78 43.7467 123.59 43.3887C123.416 43.8263 123.201 44.2567 123.081 44.7088C123.026 44.915 123.139 45.1718 123.204 45.3961C124.162 48.6079 125.12 51.8197 126.092 55.0279C126.154 55.2305 126.358 55.3933 126.493 55.5705C126.565 55.3679 126.638 55.1654 126.82 54.6662H126.824ZM64.6446 5.11072C62.4889 5.92091 60.2386 6.75642 58.0028 7.6281C57.8972 7.66789 57.8863 8.23574 57.9008 8.23936C58.8621 8.43829 60.0565 9.04594 60.752 8.68786C62.2704 7.91022 63.5412 6.64791 64.9031 5.57007C65.0087 5.48688 65.0342 5.30603 65.0961 5.17221C64.9832 5.15774 64.8703 5.13965 64.6482 5.11072H64.6446ZM1.90442 71.749C1.94447 71.749 1.98088 71.749 2.02094 71.749C2.02094 70.4252 2.08648 69.0978 1.99545 67.7776C1.94811 67.094 1.65316 66.4177 1.42012 65.7558C1.35093 65.5604 1.11789 65.423 0.961312 65.2602C0.881203 65.4555 0.717342 65.6545 0.735549 65.8389C1.0305 69.3148 1.33637 72.7907 1.67137 76.2593C1.69322 76.5016 1.94811 76.7223 2.09012 76.9538C2.12654 76.7223 2.19936 76.4836 2.18844 76.2557C2.10469 74.7547 1.99909 73.25 1.90078 71.749H1.90442ZM77.3674 9.71869C77.7352 9.63911 77.9828 9.61741 78.2049 9.53061C78.6382 9.36061 79.0606 9.15806 79.4866 8.96636C79.1225 8.70233 78.7912 8.36957 78.387 8.18872C76.5736 7.38215 74.7384 6.61536 72.9068 5.84496C72.6992 5.75815 72.4625 5.73645 72.2404 5.68581C72.3424 5.85942 72.4006 6.08729 72.5463 6.20303C73.8644 7.25194 75.1899 8.29 76.5299 9.30636C76.7993 9.5089 77.1453 9.61379 77.3674 9.71869ZM42.6218 125.355C42.163 125.005 41.9372 124.889 41.7843 124.712C39.7379 122.31 36.5116 122.578 33.9663 121.312C33.879 121.268 33.7479 121.323 33.635 121.33C33.7151 121.456 33.7661 121.652 33.8826 121.706C36.4971 122.932 39.1152 124.144 41.737 125.345C41.8826 125.413 42.0902 125.352 42.6218 125.352V125.355ZM62.0046 4.78881C59.9108 5.19391 57.726 5.60624 55.5485 6.05112C55.3082 6.09814 55.1079 6.32962 54.8894 6.4743C55.046 6.6443 55.1662 6.89025 55.3628 6.96982C55.7852 7.14705 56.3132 7.45087 56.6737 7.33151C58.549 6.69855 60.3879 5.94985 62.2304 5.23008C62.3833 5.16859 62.4925 4.99859 62.62 4.88285C62.4489 4.85753 62.2777 4.83222 
9562.0046 4.79243V4.78881ZM75.3319 5.50135C75.026 5.55198 74.9131 5.57007 74.7966 5.59177C74.8986 5.7039 74.9787 5.86304 75.1061 5.92091C76.8503 6.72749 78.5872 7.55215 80.3606 8.29C80.6701 8.42021 81.1653 8.23936 81.5185 8.0766C81.635 8.02235 81.6314 7.35321 81.5695 7.33513C79.443 6.68047 77.3055 6.0692 75.3319 5.50135ZM54.4743 5.47603C56.5936 5.06732 58.4871 4.70562 60.3842 4.3367C60.4971 4.315 60.5991 4.25351 60.7083 4.2101C60.5881 4.15223 60.4643 4.03649 60.3478 4.04011C58.4179 4.145 56.488 4.23904 54.5654 4.40542C54.3178 4.42712 54.0993 4.81775 53.8699 5.03838C54.1211 5.21923 54.3687 5.40007 54.478 5.47603H54.4743ZM77.0287 4.76711C76.854 4.80328 76.5918 4.85392 76.3333 4.90817C76.5991 5.03838 76.854 5.21561 77.138 5.29518C78.5363 5.69666 79.9345 6.09452 81.3474 6.44175C81.686 6.52494 82.0756 6.40196 82.4434 6.37664C82.1667 6.10176 81.9263 5.65326 81.6023 5.58454C80.1239 5.26263 78.62 5.042 77.0324 4.77073L77.0287 4.76711ZM69.4293 1.27316C68.4789 1.19359 67.8271 1.10316 67.1717 1.09955C66.9459 1.09955 66.7201 1.30933 66.4907 1.42507C67.0697 1.89889 67.6487 2.3727 68.224 2.85014C68.5408 2.43781 68.854 2.02548 69.4256 1.27316H69.4293ZM77.2581 3.55544C77.2545 3.58799 77.2509 3.62055 77.2472 3.6531C76.8867 3.6531 76.5226 3.64225 76.1621 3.65671C75.9254 3.66756 75.6887 3.72182 75.452 3.75437C75.6705 3.82309 75.8817 3.92075 76.1038 3.9533C77.3565 4.13777 78.6091 4.31499 79.8653 4.47052C80.0583 4.49584 80.2659 4.39818 80.4662 4.3584C80.2914 4.21372 80.1312 3.98224 79.9345 3.94607C79.0497 3.78331 78.1539 3.67842 77.2618 3.55182L77.2581 3.55544ZM72.7575 1.71804C72.0073 1.59145 71.4794 1.38167 71.006 1.46124C70.5362 1.54081 70.1066 1.89889 69.6878 2.17739C69.5859 2.24611 69.6041 2.48845 69.564 2.64759C70.0192 2.59695 70.4743 2.57525 70.9222 2.48845C71.3337 2.40887 71.7379 2.27866 72.1384 2.14122C72.2768 2.0942 72.3897 1.97123 72.7575 1.71081V1.71804ZM55.5631 3.55906C57.067 3.45778 58.3269 3.37821 59.5904 3.28055C59.7579 3.26609 59.9181 3.16843 60.082 3.10694C59.9327 3.04907 59.7798 2.94418 59.6305 2.94056C58.3669 2.89716 57.1034 2.84291 55.8398 2.86822C55.5376 2.87546 55.239 3.17205 54.9368 3.33481C55.2172 3.43608 55.4975 3.53736 55.5667 3.56267L55.5631 3.55906ZM63.5267 1.05976C63.29 1.12486 63.0169 1.20082 62.7474 1.27678C62.9841 1.43592 63.2026 1.63485 63.4575 1.74698C63.7889 1.89165 64.1421 2.00739 64.4953 2.06165C64.965 2.13399 65.4457 2.13399 65.919 2.16654C65.4966 1.84825 65.1034 1.46847 64.6373 1.22614C64.3351 1.07061 63.9309 1.1104 63.5267 1.05614V1.05976ZM59.9036 1.57336C59.889 1.61677 59.8781 1.65655 59.8635 1.69996C59.7433 1.69272 59.6195 1.65655 59.5067 1.68187C59.1644 1.75421 58.8294 1.85187 58.4871 1.93867C58.793 2.0291 59.0952 2.13399 59.4047 2.20633C59.5758 2.24611 59.7615 2.23164 59.94 2.2425C60.7629 2.2859 61.5859 2.3293 62.4052 2.3727C61.5713 2.10867 60.7338 1.84102 59.8999 1.57698L59.9036 1.57336ZM54.3214 2.25696C54.7183 2.10867 55.2354 1.91335 55.7561 1.72166C55.5594 1.66017 55.3519 1.51911 55.1698 1.54805C54.4161 1.65655 53.6696 1.8157 52.9195 1.95676C53.3237 2.04356 53.7279 2.13037 54.3214 2.26058V2.25696ZM75.2008 2.97311C75.452 2.92248 75.9946 2.81397 76.5372 2.70546C75.9291 2.60419 75.3246 2.48121 74.7165 2.40887C74.4871 2.37994 74.2395 2.43419 74.0137 2.4993C73.8062 2.55717 73.6168 2.67291 73.4165 2.76333C73.6095 2.83205 73.7989 2.94056 73.9992 2.96588C74.2905 3.00205 74.5927 2.97311 75.2008 2.97311ZM127.064 58.5436C127.017 58.4496 126.966 58.3555 126.919 58.2579C126.875 58.3447 126.78 58.4459 126.795 58.5219C126.82 58.6413 126.919 58.7425 126.984 58.851C127.01 58.7498 127.035 58.6485 127.064 58.5436Z",fill:"currentColor"})}),jC=e=>{const t=_.useId();return a.jsxs("svg",{fill:"none",height:e.height,role:"presentation",viewBox:"0 0 74 11",width:e.height*74/11,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{clipRule:"evenodd",d:"M34.1489 0.373291C33.5297 0.373291 33.022 0.874761 33.022 1.51414C33.022 2.14097 33.5297 2.64244 34.1489 2.64244C34.7681 2.64244 35.2758 2.14097 35.2758 1.51414C35.2758 0.874761 34.7681 0.373291 34.1489 0.373291ZM35.1396 3.21913H33.1706V9.97644H35.1396V3.21913ZM21.6787 0.624035H23.5982V3.21914H25.0718V5.02444H23.5982V7.40642C23.5982 7.75745 23.8706 8.03326 24.205 8.03326H25.0594V9.95138H24.205C22.818 9.95138 21.6787 8.81054 21.6787 7.39389V5.0119H20.7871V3.20661H21.6787V0.624035ZM29.7652 3.0687C28.8736 3.0687 28.1677 3.44481 27.8953 4.03403V0.624035H25.9263V9.96392H27.8953V6.17782C27.8953 5.388 28.403 4.83639 29.1213 4.83639C29.8519 4.83639 30.2605 5.31278 30.2605 6.11514V9.97646H32.2295V5.8644C32.2295 4.10925 31.3379 3.0687 29.7652 3.0687ZM37.9507 3.2066V4.13432C38.2479 3.45734 38.9661 3.0687 39.8701 3.05616C40.0063 3.05616 40.1797 3.0687 40.3902 3.09377V4.97429C40.1921 4.93668 39.9692 4.9116 39.7339 4.9116C38.607 4.9116 37.9507 5.55098 37.9507 6.66675V9.96392H35.9817V3.2066H37.9507ZM45.9257 4.09672C45.7275 3.50749 44.9474 3.09378 43.9443 3.09378C43.0032 3.09378 42.2106 3.43227 41.5791 4.10926C40.9599 4.7737 40.6379 5.61367 40.6379 6.59154C40.6379 7.5694 40.9599 8.39683 41.5791 9.08635C42.2106 9.7508 43.0032 10.0893 43.9443 10.0893C44.9474 10.0893 45.7275 9.67558 45.9257 9.08635V9.97646H47.8946V0.624035H45.9257V4.09672ZM45.5294 7.79506C45.195 8.12102 44.7864 8.27146 44.3034 8.2714
956C43.8329 8.27146 43.4242 8.10848 43.1022 7.79506C42.7679 7.45657 42.6069 7.0554 42.6069 6.59154C42.6069 6.12767 42.7679 5.7265 43.1022 5.40054C43.4366 5.06205 43.8329 4.89907 44.3034 4.89907C44.7988 4.89907 45.2074 5.06205 45.5294 5.40054C45.8761 5.7265 46.0495 6.12767 46.0495 6.59154C46.0495 7.0554 45.8761 7.45657 45.5294 7.79506ZM53.5787 3.2442L55.3619 6.45361L56.5631 3.21913H58.4949L55.7458 10.3651L53.5787 6.47868L51.4115 10.3651L48.6748 3.21913H50.6066L51.7954 6.45361L53.5787 3.2442ZM61.7394 3.05616C60.7239 3.05616 59.8694 3.38212 59.2007 4.03403C58.5444 4.6734 58.2101 5.5259 58.2101 6.57899V6.64167C58.2101 7.69476 58.5444 8.54726 59.2007 9.18664C59.8818 9.81347 60.7487 10.1394 61.8384 10.1394C62.8539 10.1394 63.6836 9.93884 64.3151 9.52513V7.78252C63.6959 8.22131 62.9034 8.43443 61.9499 8.43443C60.9097 8.43443 60.2286 7.92042 60.1914 7.11807H65.0829C65.1077 6.91748 65.12 6.69182 65.12 6.46616C65.12 5.50083 64.7981 4.69848 64.1789 4.04657C63.5597 3.38212 62.73 3.05616 61.7394 3.05616ZM60.1914 5.82679C60.2038 5.51337 60.3648 5.25009 60.662 5.03697C60.9716 4.82385 61.3183 4.71101 61.7394 4.71101C62.5195 4.71101 63.1263 5.22502 63.1263 5.82679H60.1914ZM69.8135 3.09378C70.7546 3.09378 71.5472 3.43227 72.1663 4.10925C72.7979 4.78624 73.1199 5.60113 73.1199 6.579C73.1199 7.55686 72.7979 8.38429 72.1663 9.07381C71.5472 9.73826 70.7546 10.0768 69.8135 10.0768C68.8104 10.0768 68.0302 9.66304 67.8321 9.07381V9.96392H65.8631V0.
95624035H67.8321V4.09672C68.0302 3.50749 68.8104 3.09378 69.8135 3.09378ZM69.4543 8.27146C69.9249 8.27146 70.3212 8.12102 70.6555 7.79506C70.9899 7.45657 71.1509 7.05539 71.1509 6.59153C71.1509 6.12767 70.9899 5.7265 70.6555 5.40054C70.3336 5.06205 69.9249 4.89907 69.4543 4.89907C68.9714 4.89907 68.5627 5.06205 68.216 5.40054C67.8816 5.7265 67.7083 6.12767 67.7083 6.59153C67.7083 7.05539 67.8816 7.45657 68.216 7.79506C68.5503 8.10848 68.959 8.27146 69.4543 8.27146Z",fill:"currentColor",fillRule:"evenodd"}),a.jsx("g",{clipPath:`url(#${t})`,children:a.jsx("path",{clipRule:"evenodd",d:"M0.045011 0.900694C-0.126602 0.467742 0.193222 0 0.661257 0H3.56697C3.83999 0 4.08181 0.162357 4.18322 0.413623L6.49609 6.18115C6.55849 6.33578 6.55849 6.50973 6.49609 6.66822L5.04128 10.2903C4.81896 10.8431 4.03111 10.8431 3.80879 10.2903L0.045011 0.900694ZM5.65759 0.881366C5.50158 0.45228 5.8214 0 6.28164 0H8.81292C9.09374 0 9.34336 0.173954 9.43697 0.432951L11.5392 6.20048C11.5899 6.34351 11.5899 6.502 11.5392 6.6489L10.2755 10.1164C10.0649 10.6962 9.23805 10.6962 9.02744 10.1164L5.65759 0.881366ZM11.3404 0C10.8724 0 10.5525 0.467742 10.7241 0.900694L14.4879 10.2903C14.7102 10.8431 15.4981 10.8431 15.7204 10.2903L17.1752 6.66822C17.2376 6.50973 17.2376 6.33578 17.1752 6.18115L14.8623 0.413623C14.7609 0.162357 14.5191 0 14.2461 0H11.3404Z",fill:"currentColor",fillRule:"evenodd"})}),a.jsx("defs",{children:a.jsx("clipPath",{id:t,children:a.jsx("rect",{fill:"white",height:"10.7049",width:"17.219"})})})]})};function Mo(e){const t=e.link||"https://playground.thirdweb.com/connect/sign-in/button?utm_source=cw_text";return a.jsx(Gr,{color:"secondaryText",hoverColor:"primaryText",href:t,target:"_blank",children:a.jsxs(b,{center:"both",flex:"row",style:{color:"currentColor",gap:4},children:[a.jsx(A,{size:"xs",style:{color:"currentColor"},weight:600,children:"Powered by"}),a.jsx(jC,{height:11})]})})}function SC(e){const t=e.welcomeScreen;if(t&&typeof t=="function")return a.jsx(t,{});const n=(typeof t=="object"?t==null?void 0:t.title:void 0)||e.connectLocale.welcomeScreen.defaultTitle,i=(typeof t=="object"?t==null?void 0:t.subtitle:void 0)||e.connectLocale.welcomeScreen.defaultSubtitle,r=typeof t=="object"?t==null?void 0:t.img:void 0,s=e.meta.termsOfServiceUrl||e.meta.privacyPolicyUrl;return a.jsxs(b,{animate:"fadein",flex:"column",fullHeight:!0,children:[a.jsxs(b,{center:"both",expand:!0,flex:"column",p:"lg",style:{minHeight:"300px"},children:[a.jsx(b,{center:"x",flex:"row",children:r?a.jsx(dt,{client:e.client,height:r.height?String(r.height):void 0,src:r.src,width:r.width?String(r.width):void 0}):a.jsx(NC,{children:a.jsx(LC,{size:"150"})})}),a.jsx(U,{y:"xxl"}),a.jsx(A,{center:!0,color:"primaryText",multiline:!0,weight:600,children:n}),a.jsx(U,{y:"md"}),a.jsx(A,{color:"secondaryText",multiline:!0,style:{textAlign:"center"},children:i}),a.jsx(U,{y:"lg"}),a.jsx(Gr,{center:!0,href:"https://blog.thirdweb.com/web3-wallet/",target:"_blank",children:e.connectLocale.newToWallets})]}),a.jsx(b,{flex:"column",gap:"lg",py:"lg",children:a.jsxs("div",{children:[s&&a.jsx(ku,{locale:e.connectLocale.agreement,privacyPolicyUrl:e.meta.privacyPolicyUrl,termsOfServiceUrl:e.meta.termsOfServiceUrl}),e.meta.showThirdwebBranding!==!1&&a.jsx(b,{style:{paddingTop:R.xl},children:a.jsx(Mo,{})})]})})]})}const DC=qt`
96  from {
97    transform: translateY(4px);
98  }
99  to {
100    transform: translateY(-4px);
101  }
102`,NC=Fe(()=>{const e=ee();return{animation:`${DC} 2s ease infinite alternate`,color:e.colors.accentText,filter:`drop-shadow(0px 6px 10px ${e.colors.accentText})`}});function Pu(){try{if(typeof window<"u"&&window.localStorage)return window.localStorage.getItem(v6)}catch{}return null}function AC(){try{if(typeof window<"u"&&window.localStorage)return window.localStorage.getItem(a1)}catch{}return null}function l1(e,t){const n=or(),i=Pu();return e.sort((r,s)=>{const o=n.find(l=>l.info.rdns===r.id),c=n.find(l=>
102l.info.rdns===s.id);return o&&!c?-1:!o&&c?1:0}).sort((r,s)=>{const o=t==null?void 0:t.find(l=>l.id===r.id),c=t==null?void 0:t.find(l=>l.id===s.id);return o&&!c?-1:!o&&c?1:0}).sort((r,s)=>r.id===i?-1:s.id===i?1:0).sort((r,s)=>{const o=r.id==="inApp"||r.id==="embedded",c=s.id==="inApp"||s.id==="embedded";return o&&!c?-1:!o&&c?1:0})}const u1=_.createContext(void 0);function d1(e){let t=gn.main;const n=e.wallets.find(c=>c.id==="embedded"||c.id==="inApp");e.wallets.length===1&&e.wallets[0]?t=e.wallets[0]:e.size==="wide"&&!e.welcomeScreen&&n&&(t=n);const[i,r]=_.useState(t),s=_.useRef(t),o=ht();return _.useEffect(()=>{t!==s.current&&(s.current=t,r(t))},[t]),_.useEffect(()=>{!o&&i===gn.signIn&&r(gn.main)},[o,i]),{initialScreen:t,screen:i,setScreen:r}}function h1(){const e=_.useContext(u1);if(!e)throw new Error("useScreenContext must be used within a <ScreenSetupContext.Provider />");return e}async function mc(e,t){return wa(e,async n=>{const{InAppWebConnector:i}=await h(async()=>{const{InAppWebConnector:r}=await import("./web-connector-BqSB86Fz.js");return{InAppWebConnector:r}},__vite__mapDeps([28,7,4,3,6,8,9,5,2,1,29,30,10,11,12,13,14,15]));return new i({client:n,ecosystem:t})},t)}
102async function d3(e){const{client:t,ecosystem:n}=e,r=await(await mc(t,n)).getUser();switch(r.status){case"Logged In, Wallet Initialized":return r}}async function OC(e){const t=await d3(e);if(t&&"email"in t.authDetails)return t.authDetails.email}async function kC(e){const t=await d3(e);if(t&&"phoneNumber"in t.authDetails)return t.authDetails.phoneNumber}async function Jh(e){return(await mc(e.client,e.ecosystem)).preAuthenticate(e)}async function Kr(e){return await(await mc(e.client,e.ecosystem)).linkProfile(e)}async function h3(e){return await(await mc(e.client,e.ecosystem)).unlinkProfile(e.profileToUnlink,e.allowAccountDeletion)}async function f3(e){return(await mc(e.client,e.ecosystem)).getProfiles()}const zC=Object.freeze(Object.defineProperty({__proto__:null,getProfiles:f3,getUserEmail:OC,getUserPhoneNumber:kC,linkProfile:Kr,preAuthenticate:Jh,unlinkProfile:h3},Symbol.toStringTag,{value:"Module"})),m3=e=>{if(!$M.includes(e))throw new Error(`Unknown auth option ${e}`);switch(e){case"wallet":return"siwe";default:return e}},f1=({authOption:e,client:t,ecosystem:n,mode:i="popup",redirectUrl:r,authFlow:s})=>{if(i==="popup"&&r)throw new Error("Redirect URL is not supported for popup mode");if(i==="window"&&!r)throw new Error("Redirect URL is required for window mode");const o=m3(e);let c=`${St("inAppWallet")}/api/2024-05-05/login/${o}?clientId=${t.clientId}`;if(n!=null&&n.partnerId?c=`${c}&ecosystemId=${n.id}&ecosystemPartnerId=${n.partnerId}`:n&&(c=`${c}&ecosystemId=${n.id}`),i!=="popup"){const l=new URL(r||window.location.href);l.searchParams.set("walletId",(n==null?void 0:n.id)||"inApp"),l.searchParams.set("authProvider",e),s&&l.searchParams.set("authFlow",s),c=`${c}&redirectUrl=${encodeURIComponent(l.toString())}`}return c},Bq=({authOption:e,client:t,ecosystem:n})=>{const i=m3(e);let r=`${St("inAppWallet")}/api/2024-05-05/login/${i}/callback?clientId=${t.clientId}`;return n!=null&&n.partnerId?r=`${r}&ecosystemId=${n.id}&ecosystemPartnerId=${n.partnerId}`:n&&(r=`${r}&ecosystemId=${n.id}`),r},PC="width=350, height=500",oy=({isWindowOpenedByFn:e,win:t,closeOpenedWindow:n})=>{e?t==null||t.close():t&&n?n(t):t&&t.close()};async function y3(e){const t=f1({...e,mode:e.mode||"redirect",authFlow:e.authFlow});e.mode==="redirect"?window.location.href=t:window.open(t),await new Promise(n=>setTimeout(n,5e3))}const Vq=async e=>{let t=e.openedWindow,n=!1;if(t||(t=window.open(f1({...e,mode:"popup"}),`Login to ${e.authOption}`,PC),n=!0),!t)throw new Error("Something went wrong opening pop-up");return await new Promise((r,s)=>{const o=window.setInterval(async()=>{t.closed&&(clearInterval(o),window.removeEventListener("message",c),s(new Error("User closed login window")))},1e3),c=async l=>{if(l.origin===St("inAppWallet")){if(typeof l.data!="object"){s(new Error("Invalid event data"));return}switch(l.data.eventType){case"oauthSuccessResult":{window.removeEventListener("message",c),clearInterval(o),oy({closeOpenedWindow:e.closeOpenedWindow,isWindowOpenedByFn:n,win:t}),l.data.authResult&&r(l.data.authResult);break}case"oauthFailureResult":{window.removeEventListener("message",c),clearInterval(o),oy({closeOpenedWindow:e.closeOpenedWindow,isWindowOpenedByFn:n,win:t}),s(new Error(l.data.errorString));break}}}};window.addEventListener("message",c)})};function RC(e){return a.jsx(b,{bg:"modalBg",color:"secondaryText",borderColor:"borderColor",flex:"row",center:"y",style:{borderRadius:J.full,padding:`${R["3xs"]} ${R.xs}`,borderWidth:"1px",borderStyle:"solid"},children:a.jsx(A,{style:{fontSize:10,whiteSpace:"nowrap"},children:e.text})})}function m1(){return a.jsx("div",{style:{position:"absolute",top:-10,right:-10,zIndex:1,pointerEvents:"none",cursor:"default"},children:a.jsx(RC,{text:"Last used"})})}const UC=12;function ls(e){return a.jsxs(ue,{disabled:e.disabled,className:e.className,fullWidth:!0,onClick:()=>{e.onClick()},style:{display:"flex",justifyContent:"flex-start",padding:R.sm,position:"relative"},variant:"outline",children:[e.lastUsedBadge&&a.jsx(m1,{}),a.jsxs(b,{center:"y",color:"accentText",flex:"row",gap:"sm",children:[a.jsx(e.icon,{size:D.md}),a.jsx(A,{color:"primaryText",children:e.title})]})]})}const g3=e=>a.jsx(BC,{style:{paddingBlock:e.py?R[e.py]:0},children:a.jsxs("span",{children:[" ",e.text]})}),BC=Fe(()=>{const e=ee();return{"&::before, &::after":{borderBottom:`1px solid ${e.colors.separatorLine}`,content:'""',flex:1},alignItems:"center",color:e.colors.secondaryText,display:"flex",fontSize:ie.sm,span:{margin:"0 16px"}}}),Ld=g7(e=>({color:ee().colors[e.color||"primaryText"],display:"block",fontSize:ie.sm,fontWeight:500})),Jr=p7(e=>{const t=ee();return{"&:-webkit-autofill":{boxShadow:`0 0 0px 1000px ${t.colors.inputAutofillBg} inset !important`,transition:"background-color 5000s ease-in-out 0s",WebkitBoxShadow:`0 0 0px 1000px ${t.colors.inputAutofillBg} inset !important`,WebkitTextFillColor:t.colors.primaryText},"&:-webkit-autofill:focus":{boxShadow:`0 0 0px 1000px ${t.colors.inputAutofillBg} inset, 0 0 0 2px ${e.variant==="outline"?t.colors.accentText:"transparent"} !important`,WebkitBoxShadow:`0 0 0px 1000px ${t.colors.inputAutofillBg} inset, 0 0 0 2px ${e.variant==="outline"?t.colors.accentText:"transparent"} !important`},"&::placeholder":{color:t.colors.secondaryText},"&:focus":{boxShadow:`0 0 0 2px ${t.colors.accentText}`},"&:not([type='password'])":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&[data-error='true']":{boxShadow:`0 0 0 2px ${t.colors.danger} !important`},"&[data-focus='false']:focus":{boxShadow:"none"},"&[data-placeholder='true']":{color:t.colors.secondaryText},"&[disabled]":{cursor:"not-allowed"}
102,"&[type='number']":{appearance:"none",MozAppearance:"textfield"},"&[type='number']::-webkit-outer-spin-button, &[type='number']::-webkit-inner-spin-button":{margin:0,WebkitAppearance:"none"},appearance:"none",background:e.bg?t.colors[e.bg]:"transparent",border:"none",borderRadius:J.md,boxShadow:`0 0 0 1.5px ${e.variant==="outline"?t.colors.borderColor:"transparent"}`,boxSizing:"border-box",color:t.colors.primaryText,display:"block",fontFamily:"inherit",fontSize:ie.sm,outline:"none",padding:e.sm?R.sm:ie.sm,WebkitAppearance:"none",width:"100%",[bf.mobile]:{fontSize:ie.md}}}),VC=Fe(()=>{const e=ee();return{"&:focus-within":{boxShadow:`0 0 0px 1px ${e.colors.accentText}`},"&[data-error='true']":{boxShadow:`0 0 0px 1px ${e.colors.danger}`},borderRadius:J.md,boxShadow:`0 0 0px 1px ${e.colors.borderColor}`,display:"flex","input:focus":{boxShadow:"none"}}}),Xh=[{countryIsoCode:"AD",countryName:"Andorra",phoneNumberCode:"376"},{countryIsoCode:"AE",countryName:"United Arab Emirates",phoneNumberCode:"971"},{countryIsoCode:"AF",countryName:"Afghanistan",phoneNumberCode:"93"},{countryIsoCode:"AG",countryName:"Antigua and Barbuda",phoneNumberCode:"1268"},{countryIsoCode:"AI",countryName:"Anguilla",phoneNumberCode:"1264"},{countryIsoCode:"AL",countryName:"Albania",phoneNumberCode:"355"},{countryIsoCode:"AM",countryName:"Armenia",phoneNumberCode:"374"},{countryIsoCode:"AN",countryName:"Netherlands Antilles",phoneNumberCode:"599"},{countryIsoCode:"AO",countryName:"Angola",phoneNumberCode:"244"},{countryIsoCode:"AQ",countryName:"Antarctica",phoneNumberCode:"672"},{countryIsoCode:"AR",countryName:"Argentina",phoneNumberCode:"54"},{countryIsoCode:"AS",countryName:"American Samoa",phoneNumberCode:"1684"},{countryIsoCode:"AT",countryName:"Austria",phoneNumberCode:"43"},{countryIsoCode:"AU",countryName:"Australia",phoneNumberCode:"61"},{countryIsoCode:"AW",countryName:"Aruba",phoneNumberCode:"297"},{countryIsoCode:"AX",countryName:"Aland Islands",phoneNumberCode:"35818"},{countryIsoCode:"AZ",countryName:"Azerbaijan",phoneNumberCode:"994"},{countryIsoCode:"BA",countryName:"Bosnia and Herzegovina",phoneNumberCode:"387"},{countryIsoCode:"BB",countryName:"Barbados",phoneNumberCode:"1246"},{countryIsoCode:"BD",countryName:"Bangladesh",phoneNumberCode:"880"},{countryIsoCode:"BE",countryName:"Belgium",phoneNumberCode:"32"},{countryIsoCode:"BF",countryName:"Burkina Faso",phoneNumberCode:"226"},{countryIsoCode:"BG",countryName:"Bulgaria",phoneNumberCode:"359"},{countryIsoCode:"BH",countryName:"Bahrain",phoneNumberCode:"973"},{countryIsoCode:"BI",countryName:"Burundi",phoneNumberCode:"257"},{countryIsoCode:"BJ",countryName:"Benin",phoneNumberCode:"229"},{countryIsoCode:"BL",countryName:"Saint Barthelemy",phoneNumberCode:"590"},{countryIsoCode:"BM",countryName:"Bermuda",phoneNumberCode:"1441"},{countryIsoCode:"BN",countryName:"Brunei Darussalam",phoneNumberCode:"673"},{countryIsoCode:"BO",countryName:"Bolivia",phoneNumberCode:"591"},{countryIsoCode:"BR",countryName:"Brazil",phoneNumberCode:"55"},{countryIsoCode:"BS",countryName:"Bahamas",phoneNumberCode:"1242"},{countryIsoCode:"BT",countryName:"Bhutan",phoneNumberCode:"975"},{countryIsoCode:"BV",countryName:"Bouvet Island",phoneNumberCode:"47"},{countryIsoCode:"BW",countryName:"Botswana",phoneNumberCode:"267"},{countryIsoCode:"BY",countryName:"Belarus",phoneNumberCode:"375"},{countryIsoCode:"BZ",countryName:"Belize",phoneNumberCode:"501"},{countryIsoCode:"CA",countryName:"Canada",phoneNumberCode:"1"},{countryIsoCode:"CC",countryName:"Cocos (Keeling) Islands",phoneNumberCode:"672"},{countryIsoCode:"CF",countryName:"Central African Republic",phoneNumberCode:"236"},{countryIsoCode:"CG",countryName:"Congo",phoneNumberCode:"242"},{countryIsoCode:"CH",countryName:"Switzerland",phoneNumberCode:"41"},{countryIsoCode:"CI",countryName:"Cote d`Ivoire",phoneNumberCode:"225"},{countryIsoCode:"CK",countryName:"Cook Islands",phoneNumberCode:"682"},{countryIsoCode:"CL",countryName:"Chile",phoneNumberCode:"56"},{countryIsoCode:"CM",countryName:"Cameroon",phoneNumberCode:"237"},{countryIsoCode:"CN",countryName:"China",phoneNumberCode:"86"},{countryIsoCode:"CO",countryName:"Colombia",phoneNumberCode:"57"},{countryIsoCode:"CR",countryName:"Costa Rica",phoneNumberCode:"506"},{countryIsoCode:"CU",countryName:"Cuba",phoneNumberCode:"53"},{countryIsoCode:"CV",countryName:"Cape Verde",phoneNumberCode:"238"},{countryIsoCode:"CW",countryName:"Curacao",phoneNumberCode:"5999"},{countryIsoCode:"CX",countryName:"Christmas Island",phoneNumberCode:"6189164"},{countryIsoCode:"CY",countryName:"Cyprus",phoneNumberCode:"357"},{countryIsoCode:"CZ",countryName:"Czechia",phoneNumberCode:"420"},{countryIsoCode:"DE",countryName:"Germany",phoneNumberCode:"49"},{countryIsoCode:"DJ",countryName:"Djibouti",phoneNumberCode:"253"},{countryIsoCode:"DK",countryName:"Denmark",phoneNumberCode:"45"},{countryIsoCode:"DM",countryName:"Dominica",phoneNumberCode:"1767"},{countryIsoCode:"DO",countryName:"Dominican Republic",phoneNumberCode:"1809"},{countryIsoCode:"DZ",countryName:"Algeria",phoneNumberCode:"213"},{countryIsoCode:"EC",countryName:"Ecuador",phoneNumberCode:"593"},{countryIsoCode:"EE",countryName:"Estonia",phoneNumberCode:"372"}
102,{countryIsoCode:"EG",countryName:"Egypt",phoneNumberCode:"20"},{countryIsoCode:"EH",countryName:"Western Sahara",phoneNumberCode:"212"},{countryIsoCode:"ER",countryName:"Eritrea",phoneNumberCode:"291"},{countryIsoCode:"ES",countryName:"Spain",phoneNumberCode:"34"},{countryIsoCode:"ET",countryName:"Ethiopia",phoneNumberCode:"251"},{countryIsoCode:"FI",countryName:"Finland",phoneNumberCode:"358"},{countryIsoCode:"FJ",countryName:"Fiji",phoneNumberCode:"679"},{countryIsoCode:"FO",countryName:"Faroe Islands",phoneNumberCode:"298"},{countryIsoCode:"FR",countryName:"France",phoneNumberCode:"33"},{countryIsoCode:"GA",countryName:"Gabon",phoneNumberCode:"241"},{countryIsoCode:"GB",countryName:"United Kingdom",phoneNumberCode:"44"},{countryIsoCode:"GD",countryName:"Grenada",phoneNumberCode:"1473"},{countryIsoCode:"GE",countryName:"Georgia",phoneNumberCode:"995"},{countryIsoCode:"GF",countryName:"French Guiana",phoneNumberCode:"594"},{countryIsoCode:"GG",countryName:"Guernsey",phoneNumberCode:"441481"},{countryIsoCode:"GH",countryName:"Ghana",phoneNumberCode:"233"},{countryIsoCode:"GI",countryName:"Gibraltar",phoneNumberCode:"350"},{countryIsoCode:"GL",countryName:"Greenland",phoneNumberCode:"299"},{countryIsoCode:"GM",countryName:"Gambia",phoneNumberCode:"220"},{countryIsoCode:"GN",countryName:"Guinea",phoneNumberCode:"224"},{countryIsoCode:"GP",countryName:"Guadeloupe",phoneNumberCode:"590"},{countryIsoCode:"GQ",countryName:"Equatorial Guinea",phoneNumberCode:"240"},{countryIsoCode:"GR",countryName:"Greece",phoneNumberCode:"30"},{countryIsoCode:"GT",countryName:"Guatemala",phoneNumberCode:"502"},{countryIsoCode:"GU",countryName:"Guam",phoneNumberCode:"1671"},{countryIsoCode:"GW",countryName:"Guinea-Bissau",phoneNumberCode:"245"},{countryIsoCode:"GY",countryName:"Guyana",phoneNumberCode:"592"},{countryIsoCode:"HN",countryName:"Honduras",phoneNumberCode:"504"},{countryIsoCode:"HR",countryName:"Croatia",phoneNumberCode:"385"},{countryIsoCode:"HT",countryName:"Haiti",phoneNumberCode:"509"},{countryIsoCode:"HU",countryName:"Hungary",phoneNumberCode:"36"},{countryIsoCode:"ID",countryName:"Indonesia",phoneNumberCode:"62"},{countryIsoCode:"IE",countryName:"Ireland",phoneNumberCode:"353"},{countryIsoCode:"IL",countryName:"Israel",phoneNumberCode:"972"},{countryIsoCode:"IM",countryName:"Isle Of Man",phoneNumberCode:"441624"},{countryIsoCode:"IN",countryName:"India",phoneNumberCode:"91"},{countryIsoCode:"IO",countryName:"British Indian Ocean Territory",phoneNumberCode:"246"},{countryIsoCode:"IQ",countryName:"Iraq",phoneNumberCode:"964"},{countryIsoCode:"IR",countryName:"Iran (Islamic Republic of)",phoneNumberCode:"98"},{countryIsoCode:"IS",countryName:"Iceland",phoneNumberCode:"354"},{countryIsoCode:"IT",countryName:"Italy",phoneNumberCode:"39"},{countryIsoCode:"JE",countryName:"Jersey",phoneNumberCode:"441534"},{countryIsoCode:"JM",countryName:"Jamaica",phoneNumberCode:"1876"},{countryIsoCode:"JO",countryName:"Jordan",phoneNumberCode:"962"},{countryIsoCode:"JP",countryName:"Japan",phoneNumberCode:"81"},{countryIsoCode:"KE",countryName:"Kenya",phoneNumberCode:"254"},{countryIsoCode:"KG",countryName:"Kyrgyzstan",phoneNumberCode:"996"},{countryIsoCode:"KH",countryName:"Cambodia",phoneNumberCode:"855"},{countryIsoCode:"KI",countryName:"Kiribati",phoneNumberCode:"686"},{countryIsoCode:"KM",countryName:"Comoros",phoneNumberCode:"269"},{countryIsoCode:"KN",countryName:"Saint Kitts and Nevis",phoneNumberCode:"1869"},{countryIsoCode:"KR",countryName:"Republic of Korea",phoneNumberCode:"82"},{countryIsoCode:"KW",countryName:"Kuwait",phoneNumberCode:"965"},{countryIsoCode:"KY",countryName:"Cayman Islands",phoneNumberCode:"1345"},{countryIsoCode:"KZ",countryName:"Kazakhstan",phoneNumberCode:"7"},{countryIsoCode:"LB",countryName:"Lebanon",phoneNumberCode:"961"},{countryIsoCode:"LC",countryName:"Saint Lucia",phoneNumberCode:"1758"},{countryIsoCode:"LI",countryName:"Liechtenstein",phoneNumberCode:"423"},{countryIsoCode:"LK",countryName:"Sri Lanka",phoneNumberCode:"94"},{countryIsoCode:"LR",countryName:"Liberia",phoneNumberCode:"231"},{countryIsoCode:"LS",countryName:"Lesotho",phoneNumberCode:"266"},{countryIsoCode:"LT",countryName:"Lithuania",phoneNumberCode:"370"},{countryIsoCode:"LU",countryName:"Luxembourg",phoneNumberCode:"352"},{countryIsoCode:"LV",countryName:"Latvia",phoneNumberCode:"371"},{countryIsoCode:"LY",countryName:"Libyan Arab Jamahiriya",phoneNumberCode:"218"},{countryIsoCode:"MA",countryName:"Morocco",phoneNumberCode:"212"},{countryIsoCode:"MC",countryName:"Monaco",phoneNumberCode:"377"},{countryIsoCode:"MD",countryName:"Moldova (Republic of)",phoneNumberCode:"373"},{countryIsoCode:"ME",countryName:"Montenegro",phoneNumberCode:"382"},{countryIsoCode:"MF",countryName:"Saint Martin French",phoneNumberCode:"590"},{countryIsoCode:"MG",countryName:"Madagascar",phoneNumberCode:"261"},{countryIsoCode:"MH",countryName:"Marshall Islands",phoneNumberCode:"692"},{countryIsoCode:"ML",countryName:"Mali",phoneNumberCode:"223"},{countryIsoCode:"MM",countryName:"Myanmar",phoneNumberCode:"95"},{countryIsoCode:"MN",countryName:"Mongolia",phoneNumberCode:"976"},{countryIsoCode:"MP",countryName:"Northern Mariana Islands",phoneNumberCode:"1670"},{countryIsoCode:"MQ",countryName:"Martinique",phoneNumberCode:"596"},{countryIsoCode:"MR",countryName:"Mauritania",phoneNumberCode:"222"},{countryIsoCode:"MS",countryName:"Montserrat",phoneNumberCode:"1664"},{countryIsoCode:"MT",countryName:"Malta",phoneNumberCode:"356"},{countryIsoCode:"MU",countryName:"Mauritius",phoneNumberCode:"230"},{countryIsoCode:"MV",countryName:"Maldives",phoneNumberCode:"960"},{countryIsoCode:"MW",countryName:"Malawi",phoneNumberCode:"265"},{countryIsoCode:"MX",countryName:"Mexico",phoneNumberCode:"52"},{countryIsoCode:"MY",countryName:"Malaysia",phoneNumberCode:"60"},{countryIsoCode:"MZ",countryName:"Mozambique",phoneNumberCode:"258"},{countryIsoCode:"NA",countryName:"Namibia",phoneNumberCode:"264"},{countryIsoCode:"NC",countryName:"New Caledonia",phoneNumberCode:"687"},{countryIsoCode:"NE",countryName:"Niger",phoneNumberCode:"227"},{countryIsoCode:"NF",countryName:"Norfolk Island",phoneNumberCode:"672"},{countryIsoCode:"NG",countryName:"Nigeria",phoneNumberCode:"234"},{countryIsoCode:"NI",countryName:"Nicaragua",phoneNumberCode:"505"},{countryIsoCode:"NL",countryName:"Netherlands",phoneNumberCode:"31"},{countryIsoCode:"NO",countryName:"Norway",phoneNumberCode:"47"},{countryIsoCode:"NP",countryName:"Nepal",phoneNumberCode:"977"}
102,{countryIsoCode:"NR",countryName:"Nauru",phoneNumberCode:"674"},{countryIsoCode:"NU",countryName:"Niue",phoneNumberCode:"683"},{countryIsoCode:"NZ",countryName:"New Zealand",phoneNumberCode:"64"},{countryIsoCode:"OM",countryName:"Oman",phoneNumberCode:"968"},{countryIsoCode:"PA",countryName:"Panama",phoneNumberCode:"507"},{countryIsoCode:"PE",countryName:"Peru",phoneNumberCode:"51"},{countryIsoCode:"PF",countryName:"French Polynesia",phoneNumberCode:"689"},{countryIsoCode:"PG",countryName:"Papua New Guinea",phoneNumberCode:"675"},{countryIsoCode:"PH",countryName:"Philippines",phoneNumberCode:"63"},{countryIsoCode:"PK",countryName:"Pakistan",phoneNumberCode:"92"},{countryIsoCode:"PL",countryName:"Poland",phoneNumberCode:"48"},{countryIsoCode:"PM",countryName:"Saint Pierre and Miquelon",phoneNumberCode:"508"},{countryIsoCode:"PN",countryName:"Pitcairn",phoneNumberCode:"64"},{countryIsoCode:"PR",countryName:"Puerto Rico",phoneNumberCode:"1787"},{countryIsoCode:"PT",countryName:"Portugal",phoneNumberCode:"351"},{countryIsoCode:"PW",countryName:"Palau",phoneNumberCode:"680"},{countryIsoCode:"PY",countryName:"Paraguay",phoneNumberCode:"595"},{countryIsoCode:"QA",countryName:"Qatar",phoneNumberCode:"974"},{countryIsoCode:"RE",countryName:"Reunion",phoneNumberCode:"262"},{countryIsoCode:"RO",countryName:"Romania",phoneNumberCode:"40"},{countryIsoCode:"RS",countryName:"Serbia",phoneNumberCode:"381"},{countryIsoCode:"RU",countryName:"Russian Federation",phoneNumberCode:"7"},{countryIsoCode:"RW",countryName:"Rwanda",phoneNumberCode:"250"},{countryIsoCode:"SA",countryName:"Saudi Arabia",phoneNumberCode:"966"},{countryIsoCode:"SB",countryName:"Solomon Islands",phoneNumberCode:"677"},{countryIsoCode:"SC",countryName:"Seychelles",phoneNumberCode:"248"},{countryIsoCode:"SD",countryName:"Sudan",phoneNumberCode:"249"},{countryIsoCode:"SE",countryName:"Sweden",phoneNumberCode:"46"},{countryIsoCode:"SG",countryName:"Singapore",phoneNumberCode:"65"},{countryIsoCode:"SH",countryName:"Saint Helena",phoneNumberCode:"290"},{countryIsoCode:"SI",countryName:"Slovenia",phoneNumberCode:"386"},{countryIsoCode:"SK",countryName:"Slovakia",phoneNumberCode:"421"},{countryIsoCode:"SL",countryName:"Sierra Leone",phoneNumberCode:"232"},{countryIsoCode:"SM",countryName:"San Marino",phoneNumberCode:"378"},{countryIsoCode:"SN",countryName:"Senegal",phoneNumberCode:"221"},{countryIsoCode:"SO",countryName:"Somalia",phoneNumberCode:"252"},{countryIsoCode:"SR",countryName:"Suriname",phoneNumberCode:"597"},{countryIsoCode:"SS",countryName:"South Sudan",phoneNumberCode:"211"},{countryIsoCode:"ST",countryName:"Sao Tome and Principe",phoneNumberCode:"239"},{countryIsoCode:"SV",countryName:"El Salvador",phoneNumberCode:"503"},{countryIsoCode:"SX",countryName:"Sint Maarten Dutch",phoneNumberCode:"1721"},{countryIsoCode:"SY",countryName:"Syrian Arab Republic",phoneNumberCode:"963"},{countryIsoCode:"SZ",countryName:"Swaziland",phoneNumberCode:"268"},{countryIsoCode:"TC",countryName:"Turks and Caicos Islands",phoneNumberCode:"1649"},{countryIsoCode:"TD",countryName:"Chad",phoneNumberCode:"235"},{countryIsoCode:"TF",countryName:"French Southern Territories",phoneNumberCode:"1"},{countryIsoCode:"TG",countryName:"Togo",phoneNumberCode:"228"},{countryIsoCode:"TH",countryName:"Thailand",phoneNumberCode:"66"},{countryIsoCode:"TJ",countryName:"Tajikistan",phoneNumberCode:"992"},{countryIsoCode:"TK",countryName:"Tokelau",phoneNumberCode:"690"},{countryIsoCode:"TL",countryName:"Timor-Leste (East Timor)",phoneNumberCode:"670"},{countryIsoCode:"TM",countryName:"Turkmenistan",phoneNumberCode:"993"},{countryIsoCode:"TN",countryName:"Tunisia",phoneNumberCode:"216"},{countryIsoCode:"TO",countryName:"Tonga",phoneNumberCode:"676"},{countryIsoCode:"TR",countryName:"Turkey",phoneNumberCode:"90"},{countryIsoCode:"TT",countryName:"Trinidad and Tobago",phoneNumberCode:"1868"},{countryIsoCode:"TV",countryName:"Tuvalu",phoneNumberCode:"688"},{countryIsoCode:"TW",countryName:"Taiwan (Province of China)",phoneNumberCode:"886"},{countryIsoCode:"TZ",countryName:"Tanzania (United Republic of)",phoneNumberCode:"255"},{countryIsoCode:"UA",countryName:"Ukraine",phoneNumberCode:"380"},{countryIsoCode:"UG",countryName:"Uganda",phoneNumberCode:"256"},{countryIsoCode:"US",countryName:"United States",phoneNumberCode:"1"},{countryIsoCode:"UY",countryName:"Uruguay",phoneNumberCode:"598"},{countryIsoCode:"UZ",countryName:"Uzbekistan",phoneNumberCode:"998"},{countryIsoCode:"VE",countryName:"Venezuela",phoneNumberCode:"58"},{countryIsoCode:"VG",countryName:"Virgin Islands British",phoneNumberCode:"1284"},{countryIsoCode:"VI",countryName:"Virgin Islands US",phoneNumberCode:"1340"},{countryIsoCode:"VN",countryName:"Vietnam",phoneNumberCode:"84"},{countryIsoCode:"VU",countryName:"Vanuatu",phoneNumberCode:"678"},{countryIsoCode:"WF",countryName:"Wallis and Futuna Islands",phoneNumberCode:"681"},{countryIsoCode:"WS",countryName:"Samoa",phoneNumberCode:"685"},{countryIsoCode:"XK",countryName:"Kosovo",phoneNumberCode:"383"},{countryIsoCode:"YE",countryName:"Yemen",phoneNumberCode:"967"},{countryIsoCode:"YT",countryName:"Mayotte",phoneNumberCode:"262269"},{countryIsoCode:"YU",countryName:"Yugoslavia",phoneNumberCode:"38"},{countryIsoCode:"ZA",countryName:"South Africa",phoneNumberCode:"27"},{countryIsoCode:"ZM",countryName:"Zambia",phoneNumberCode:"260"},{countryIsoCode:"ZW",countryName:"Zimbabwe",phoneNumberCode:"263"}];function e0(e){const t=Xh.find(n=>n.countryIsoCode===e);return t?`${t.countryIsoCode} +${t.phoneNumberCode}`:"US +1"}function $C({countryCode:e,setCountryCode:t,allowedCountryCodes:n}){const i=_.useRef(null),r=n&&n.length>0?Xh.filter(s=>n.includes(s.countryIsoCode)):Xh??[{countryIsoCode:"US",countryName:"United States",phoneNumberCode:1}];return a.jsxs(WC,{name:"countries",onChange:s=>{t(s.target.value)},ref:i,style:{padding:`${R.sm} ${R.md}`},value:e,children:[a.jsx(ay,{style:{display:"none"},value:e,children:e}),r.map(s=>a.jsxs(ay,{value:e0(s.countryIsoCode),children:[s.countryName," +",s.phoneNumberCode]},s.countryIsoCode))]})}const ay=x7(()=>{const e=ee();return{"&:hover":{background:e.colors.tertiaryBg},background:e.colors.modalBg,color:e.colors.primaryText,transition:"background 0.3s ease"}}),WC=b7(e=>{const t=ee();return{"&::placeholder":{color:t.colors.secondaryText},"&[disabled]":{cursor:"not-allowed"},appearance:"none",background:"transparent",border:"none",borderRadius:J.lg,boxSizing:"border-box",color:t.colors.primaryText,cursor:"pointer",display:"block",maxWidth:"90px",minWidth:"0px",outline:"none",overflow:"hidden",padding:R.sm,textOverflow:"ellipsis",WebkitAppearance:"none",whiteSpace:"nowrap"}});function t0(e){const[t,n]=_.useState(e.defaultSmsCountryCode?e0(e.defaultSmsCountryCode):e.allowedSmsCountryCodes&&e.allowedSmsCountryCodes.length>0&&e.allowedSmsCountryCodes[0]?e0(e.allowedSmsCountryCodes[0]):"US +1"),[i,r]=_.useState(""),[s,o]=_.useState(),[c,l]=_.useState(!1),u=()=>{l(!0),!(!i||s)&&e.onSelect(e.format==="phone"?`+${t.split("+")[1]}${i}`:i)},d=c&&!!s||!i&&!!e.emptyErrorMessage&&c;return a.jsxs("div",{style:{width:"100%"},children:[a.jsxs(VC,{className:e.className,"data-error":d,style:{display:"flex",flexDirection:"row",position:"relative"},children:[e.lastUsedBadge&&a.jsx(m1,{}),e.format==="phone"&&a.jsx($C,{allowedCountryCodes:e.allowedSmsCountryCodes,c
102ountryCode:t,setCountryCode:n}),a.jsx(Jr,{disabled:e.disabled,name:e.name,onChange:f=>{r(f.target.value),e.errorMessage?o(e.errorMessage(f.target.value)):o(void 0)},onKeyDown:f=>{f.key==="Enter"&&u()},placeholder:e.placeholder,style:{flexGrow:1,padding:`${R.sm} ${e.format==="phone"?0:R.sm}`},tabIndex:-1,type:e.type,value:i,variant:"transparent"}),a.jsx(rr,{disabled:e.disabled,onClick:u,style:{borderRadius:`0 ${J.md} ${J.md} 0`,padding:R.sm},children:a.jsx(E7,{height:D.md,width:D.md})})]}),c&&s&&a.jsxs(a.Fragment,{children:[a.jsx(U,{y:"xs"}),a.jsx(A,{color:"danger",size:"sm",children:s})]}),!(c&&s)&&!i&&e.emptyErrorMessage&&c&&a.jsxs(a.Fragment,{children:[a.jsx(U,{y:"xs"}),a.jsx(A,{color:"danger",size:"sm",children:e.emptyErrorMessage})]})]})}function FC(e){return/^\S+@\S+\.\S+$/.test(e.replace(/\+/g,""))}function YC(e){switch(e){case"google":return"Sign In - Google Accounts";default:return`Sign In - ${e.slice(0,1).toUpperCase()}${e.slice(1)}`}}function HC(e){switch(e){case"facebook":return{height:555,width:715};default:return{height:500,width:350}}}function QC(e,t,n){switch(e){case"apple":case"facebook":case"google":case"farcaster":case"telegram":case"github":case"twitch":case"steam":case"line":case"x":case"tiktok":case"epic":case"guest":case"coinbase":case"discord":return f1({authOption:e,client:t,ecosystem:n});default:throw new Error(`Unsupported auth option: ${e}`)}}function p3({authOption:e,themeObj:t,client:n,ecosystem:i}){const{height:r,width:s}=HC(e),o=(window.innerHeight-r)/2,c=(window.innerWidth-s)/2,l=window.open(QC(e,n,i),void 0,`width=${s}, height=${r}, top=${o}, left=${c}`);if(l){const u=YC(e);l.document.title=u,l.document.body.innerHTML=ZC,l.document.body.style.background=t.colors.modalBg,l.document.body.style.color=t.colors.accentText}return l&&window.addEventListener("beforeunload",()=>{l==null||l.close()}),l}const ZC=`
103<svg class="loader" viewBox="0 0 50 50">
104  <circle
105    cx="25"
106    cy="25"
107    r="20"
108    fill="none"
109    stroke="currentColor"
110    stroke-width="4"
111  />
112</svg>
113
114<style>
115  body,
116  html {
117    height: 100%;
118    margin: 0;
119    padding: 0;
120  }
121
122  body {
123    display: flex;
124    justify-content: center;
125    align-items: center;
126  }
127
128  .loader {
129    width: 50px;
130    height: 50px;
131    animation: spin 2s linear infinite;
132  }
133
134  .loader circle {
135    animation: loading 1.5s linear infinite;
136  }
137
138  @keyframes loading {
139    0% {
140      stroke-dasharray: 1, 150;
141      stroke-dashoffset: 0;
142    }
143    50% {
144      stroke-dasharray: 90, 150;
145      stroke-dashoffset: -35;
146    }
147    100% {
148      stroke-dasharray: 90, 150;
149      stroke-dashoffset: -124;
150    }
151  }
152
153  @keyframes spin {
154    100% {
155      transform: rotate(360deg);
156        }
157  }
158</style>
159`,n0=["email","phone","google","apple","facebook","passkey"],w3=e=>{var F,Y,Q,Z,K,q,oe;const t=e.locale,{wallet:n}=e,i=Bs(),r=ee(),s=_.useMemo(()=>AC(),[]),o=_.useMemo(()=>Pu(),[]),c=_.useMemo(()=>{var re,ae;return e.wallet.id==="inApp"?(ae=(re=e.wallet.getConfig())==null?void 0:re.metadata)==null?void 0:ae.image:void 0},[e.wallet]),l={apple:t.signInWithApple,coinbase:"Coinbase",discord:t.signInWithDiscord,facebook:t.signInWithFacebook,farcaster:"Farcaster",github:"GitHub",google:t.signInWithGoogle,line:"LINE",steam:"Steam",telegram:"Telegram",twitch:"Twitch",x:"X",tiktok:"TikTok",epic:"Epic"},{data:u,isLoading:d}=pe({enabled:Xe(n),queryFn:async()=>{if(Xe(n)){const re=await Ew(n.id);return(re==null?void 0:re.authOptions)??null}return null},queryKey:["auth-options",n.id],retry:!1}),f=Xe(n)?u??n0:((Y=(F=n.getConfig())==null?void 0:F.auth)==null?void 0:Y.options)??n0,m=_.useMemo(()=>!s||n.id!==o?f:[...f].sort((re,ae)=>s===re?-1:s===ae?1:0),[f,s,n.id,o]),y=m.indexOf("email"),g=y!==-1,p=m.indexOf("phone"),w=p!==-1,x=m.filter(re=>Nu.includes(re)),I=_.useMemo(()=>{switch(x.length){case 7:return 4;case 6:return 4;default:return 5}},[x.length]),E=_.useMemo(()=>Array.from({length:Math.ceil(x.length/I)},(re,ae)=>x.slice(ae*I,(ae+1)*I)),[x,I]),[j,C]=_.useState(null),T=_.useMemo(()=>j||(g&&w?y<p?"email":"phone":g?"email":w?"phone":"none"),[g,w,y,p,j]);if(Xe(n)&&d)return a.jsx(Mt,{});const v=m.includes("passkey"),N=m.includes("guest"),M=m.includes("wallet"),S=T==="email"?t.emailPlaceholder:t.phonePlaceholder,L=T==="email"?t.emailRequired:t.phoneRequired;let O="text";T==="email"?O="email":T==="phone"&&(O="tel");const P=x.length>0,$=Xe(n)?{id:n.id,partnerId:(Q=n.getConfig())==null?void 0:Q.partnerId}:void 0,z=async()=>{const re={chain:e.chain,client:e.client,ecosystem:$,strategy:"guest"},ae=(async()=>{const le=await n.connect(re);return ar("guest",In),le})();i({guestLogin:{connectionPromise:ae}}),e.select()},k=async re=>{var Te,qe;const ae=n.getConfig(),le=((Te=ae==null?void 0:ae.auth)==null?void 0:Te.mode)??"popup";if(ae&&"auth"in ae&&le!=="popup"&&!e.isLinking)return y3({authOption:re,client:e.client,ecosystem:$,mode:le,redirectUrl:(qe=ae==null?void 0:ae.auth)==null?void 0:qe.redirectUrl});try{const ct=p3({authOption:re,client:e.client,ecosystem:$,themeObj:r});if(!ct)throw new Error("Failed to open login window");const fn={chain:e.chain,client:e.client,closeOpenedWindow:ge=>{ge.close()},ecosystem:$,openedWindow:ct,strategy:re},fe=(()=>
159{if(e.isLinking){if(n.id!=="inApp"&&!Xe(n))throw new Error("Only in-app wallets support multi-auth");return Kr(fn)}const ge=n.connect(fn);return ar(re,In),ge})();i({socialLogin:{connectionPromise:fe,type:re}}),e.select()}catch(ct){console.error(`Error signing in with ${re}`,ct)}};function B(){i({passkeyLogin:!0}),e.select()}function W(){i({walletLogin:{linking:e.isLinking||!1}}),e.select()}const V=x.length>2;return a.jsxs(b,{flex:"column",gap:"md",style:{position:"relative"},children:[c&&a.jsxs(a.Fragment,{children:[a.jsx(dt,{alt:c.alt,client:e.client,height:`${c.height}`,src:c.src,style:{margin:"auto"},width:`${c.width}`}),a.jsx(U,{y:"xxs"})]}),P&&a.jsx(b,{flex:"column",gap:x.length>4?"xs":"sm",children:E.map(re=>a.jsx(qC,{children:re.map(ae=>{const le=!V||x.length>4?D.md:D.lg;return a.jsxs(GC,{className:"tw-social-button","aria-label":`Login with ${ae}`,"data-variant":V?"icon":"full",disabled:e.disabled,onClick:()=>{k(ae)},style:{flexGrow:x.length<7?1:0,position:"relative"},variant:"outline",children:[o===n.id&&s===ae&&a.jsx(m1,{}),a.jsx(dt,{client:e.client,height:le,src:ms[ae],width:le}),!V&&`${x.length===1?"Continue with ":""}${l[ae]}`]},ae)})},re[0]))}),e.size==="wide"&&P&&(g||w)&&a.jsx(g3,{text:t.or}),g&&(T==="email"?a.jsx(t0,{className:"tw-input-container tw-input-container__email",lastUsedBadge:o===n.id&&s==="email",disabled:e.disabled,emptyErrorMessage:L,errorMessage:re=>{if(!FC(re.toLowerCase()))return t.invalidEmail},name:"email",onSelect:re=>{i({emailLogin:re}),e.select()},placeholder:S,submitButtonText:t.submitEmail,type:O}):a.jsx(ls,{lastUsedBadge:o===n.id&&s==="email",className:"tw-select-button tw-select-button__email",client:e.client,disabled:e.disabled,icon:Au,onClick:()=>{C("email")},title:t.emailPlaceholder})),w&&(T==="phone"?a.jsx(t0,{className:"tw-input-container tw-input-container__phone",allowedSmsCountryCodes:(K=(Z=n.getConfig())==null?void 0:Z.auth)==null?void 0:K.allowedSmsCountryCodes,defaultSmsCountryCode:(oe=(q=n.getConfig())==null?void 0:q.auth)==null?void 0:oe.defaultSmsCountryCode,lastUsedBadge:o===n.id&&s==="phone",disabled:e.disabled,emptyErrorMessage:L,errorMessage:re=>{const ae=re.replace(/[-() ]/g,"");if(!/^[0-9]+$/.test(ae)&&w)return t.invalidPhone},format:"phone",name:"phone",onSelect:re=>{i({phoneLogin:re.replace(/[-() ]/g,"")}),e.select()},placeholder:S,submitButtonText:t.submitEmail,type:O}):a.jsx(ls,{lastUsedBadge:o===n.id&&s==="phone",className:"tw-select-button tw-select-button__phone",client:e.client,disabled:e.disabled,icon:Ou,onClick:()=>{C("phone")},title:t.phonePlaceholder})),v&&a.jsx(ls,{lastUsedBadge:o===n.id&&s==="passkey",className:"tw-select-button tw-select-button__passkey",client:e.client,disabled:e.disabled,icon:Vs,onClick:()=>{B()},title:t.passkey}),M&&!e.isLinking&&a.jsx(ls,{lastUsedBadge:o===n.id&&s==="wallet",className:"tw-select-button tw-select-button__link-wallet",client:e.client,icon:Ls,onClick:()=>{W()},title:t.signInWithWallet}),N&&a.jsx(ls,{lastUsedBadge:o===n.id&&s==="guest",className:"tw-select-button tw-select-button__guest",client:e.client,disabled:e.disabled,icon:c1,onClick:()=>{z()},title:t.loginAsGuest}),e.isLinking&&a.jsx(ls,{lastUsedBadge:!1,className:"tw-select-button tw-select-button__link-wallet",client:e.client,icon:Ls,onClick:()=>{W()},title:t.linkWallet})]})},qC=e=>a.jsx(b,{center:"x",flex:"row",gap:e.children.length>4?"xs":"sm",style:{display:"flex",justifyContent:"center","& > *":{flexBasis:`${100/e.children.length}%`,maxWidth:`${100/e.children.length}%`}},children:e.children}),GC=nt(ue)({"&[data-variant='full']":{"&:active":{boxShadow:"none"},display:"flex",fontSize:ie.md,fontWeight:500,gap:R.sm,justifyContent:"flex-start",padding:R.md,transition:"background-color 0.2s ease"},"&[data-variant='icon']":{padding:R.sm}});function KC(e){var f,m;const t=(((m=(f=e.wallet.getConfig())==null?void 0:f.auth)==null?void 0:m.options)||n0).slice().sort((y,g)=>y in ms&&!(g in ms)?-1:!(y in ms)&&g in ms?1:0),n=ee(),i=t[0],r=t[1],s=t[2],o=t[3],c="4px",l="6px",u="20",d="12";return i&&r?a.jsxs("div",{style:{width:`${D.xl}px`,height:`${D.xl}px`,position:"relative",gap:R["3xs"],border:`1px solid ${n.colors.borderColor}`,borderRadius:J.md,backgroundColor:n.colors.tertiaryBg},children:[a.jsx("div",{style:{position:"absolute",top:c,left:c,display:"flex"},children:a.jsx(Go,{authOption:i,client:e.client,size:u})}),a.jsx("div",{style:{position:"absolute",bottom:c,right:c,display:"flex"},children:a.jsx(Go,{authOption:r,client:e.client,size:u})}),a.jsxs("div",{children:[s&&a.jsx("div",{style:{position:"absolute",top:l,right:l,display:"flex"},children:a.jsx(Go,{authOption:s,client:e.client,size:d})}),o&&a.jsx("div",{style:{position:"absolute",bottom:l,left:l,display:"flex"},children:a.jsx(Go,{authOption:o,client:e.client,size:d})})]})]}):i?a.jsx("div",{style:{width:`${D.xl}px`,height:`${D.xl}px`,display:"flex",justifyContent:"center",alignItems:"center",border:`1px solid ${n.colors.borderColor}`,borderRadius:J.md,backgroundColor:n.colors.tertiaryBg},children:a.jsx(Go,{authOption:i,client:e.client,size:D.lg},i)}):null}function Go(e){const t=ee();if(e.authOption in ms){const n=ms[e.authOption];return a.jsx(dt,{src:n,width:e.size,height:e.size,client:e.client})}return e.authOption==="phone"?a.jsx(Ou,{size:e.size,color:t.colors.secondaryText}):e.authOption==="email"?a.jsx(Au,{size:e.size,color:t.colors.secondaryText}):e.authOption==="passkey"?a.jsx(Vs,{size:e.size,color:t.colors.secondaryText}):e.authOption==="guest"?a.jsx(c1,{size:e.size,color:t.colors.secondaryText}):null}function y1(e){var f,m,y,g,p,w;const{selectWallet:t,wallet:n}=e,i=n.id,r=(f=e.recommendedWallets)==null?void 0:f.find(x=>x.id===i),s=Po(i),o=((m=or().find(x=>x.info.rdns===i))==null?void 0:m.info.name)||((y=s.data)==null?void 0:y.name),c=or().find(x=>x.info.rdns===i),l=n&&i==="inApp"?(g=n.getConfig())==null?void 0:g.metadata:void 0;let u=(l==null?void 0:l.name)||o;const d=l==null?void 0:l.icon;if(n.id==="inApp"){const x=n.getConfig();if(((p=x==null?void 0:x.auth)==null?void 0:p.options.length)===1){const I=(w=x.auth)==null?void 0:w.options[0];I&&(u=JC({text:I}))}}return a.jsxs(g1,{className:e.className,"data-active":e.isActive,onClick:t,type:"button",children:[d?a.jsx(dt,{alt:"",client:e.client,height:`${D.xl}`,src:d,width:`${D.xl}`}):n.id==="inApp"?a.jsx(KC,{client:e.client,wallet:n}):a.jsx(ai,{client:e.client,id:i,size:D.xl}),a.jsxs(b,{expand:!0,flex:"column",gap:"xxs",children:[u?a.jsx(A,{color:"primaryText",weight:500,children:u}):a.jsx(me,{height:ie.md,width:"100px"}),e.badge?a.jsx(A,{size:"sm",children:e.badge}):r?a.jsx(A,{size:"sm",children:e.connectLocale.recommended}):c?a.jsx(A,{size:"sm",children:e.connectLocale.installed}):null]})]})}const g1=$i(e=>{const t=ee();return{all:"unset","&:hover":{backgroundColor:t.colors.tertiaryBg,transform:"scale(1.01)"},'&[data-active="true"]':{backgroundColor:t.colors.tertiaryBg},alignItems:"center",borderRadius:J.md,boxSizing:"border-box",color:t.colors.secondaryText,cursor:"pointer",display:"flex",flexDirection:"row",gap:R.sm,padding:`${R.xs} ${R.xs}`,transition:"background-color 200ms ease, transform 200ms ease",width:"100%"}});function JC(e){return e.text.charAt(0).toUpperCase()+e.text.slice(1)}async function XC(e){switch(e){case"es_ES":return(await h(async()=>{const{default:t}=await import("./es-D1JvwHmW.js");return{default:t}},[])).default;case"ja_JP":return(await h(async()=>{const{default:t}=await import("./ja-qsQcCBfK.js");return{default:t}},[])).default;case"tl_PH":return(await h(async()=>{const{default:t}=await import("./tl-LjGyFSL6.js");return{default:t}},[])).default;case"vi_VN":return(await h(async()=>{const{default:t}=await import("./vi-BmXdTnDJ.js");return{default:t}},[])).default;case"de_DE":return(await h(async()=>{const{default:t}=await import("./de-HLnDQwsk.js");return{default:t}},[])).default;
159case"ko_KR":return(await h(async()=>{const{default:t}=await import("./kr-CBFJeZbH.js");return{default:t}},[])).default;case"fr_FR":return(await h(async()=>{const{default:t}=await import("./fr-DQrXBak2.js");return{default:t}},[])).default;case"ru_RU":return(await h(async()=>{const{default:t}=await import("./ru-BDcqn2vv.js");return{default:t}},[])).default;case"pt_BR":return(await h(async()=>{const{default:t}=await import("./br-Bh5kquYi.js");return{default:t}},[])).default;case"zh_CN":return(await h(async()=>{const{default:t}=await import("./zh-8Oiy2Jay.js");return{default:t}},[])).default;default:return(await h(async()=>{const{default:t}=await import("./en-lXclJmNl.js");return{default:t}},[])).default}}function _3(e){const[t,n]=_.useState(void 0);return _.useEffect(()=>{XC(e).then(i=>{n(i)})},[e]),t}function eE(e){const{screen:t}=h1(),n=Bs(),i=_3(e.connectLocale.id);return e.size==="wide"||t!==gn.main&&e.size==="compact"?a.jsx(y1,{badge:void 0,client:e.client,connectLocale:e.connectLocale,isActive:t===e.wallet,recommendedWallets:e.recommendedWallets,selectWallet:()=>{n({}),e.select()},wallet:e.wallet}):i?a.jsx(w3,{chain:e.chain,client:e.client,disabled:e.disabled,done:e.done,goBack:e.goBack,locale:i,select:e.select,size:e.size,wallet:e.wallet}):a.jsx(Mt,{height:"195px"})}async function tE(e){switch(e){case"es_ES":return(await h(async()=>{const{default:t}=await import("./es-BoeWNXZK.js");return{default:t}},[])).default;case"ja_JP":return(await h(async()=>{const{default:t}=await import("./ja-B_14a7-i.js");return{default:t}},[])).default;case"tl_PH":return(await h(async()=>{const{default:t}=await import("./tl-DgU76fWy.js");return{default:t}},[])).default;case"vi_VN":return(await h(async()=>{const{default:t}=await import("./vi-CeeFZUD3.js");return{default:t}},[])).default;case"de_DE":return(await h(async()=>{const{default:t}=await import("./de-DxwDt0Si.js");return{default:t}},[])).default;case"ko_KR":return(await h(async()=>{const{default:t}=await import("./kr-C28WMrvF.js");return{default:t}},[])).default;case"fr_FR":return(await h(async()=>{const{default:t}=await import("./fr-Cl9YKZtN.js");return{default:t}},[])).default;case"ru_RU":return(await h(async()=>{const{default:t}=await import("./ru-CRpUAoj9.js");return{default:t}},[])).default;case"pt_BR":return(await h(async()=>{const{default:t}=await import("./br-Bzf0kdCg.js");return{default:t}},[])).default;case"zh_CN":return(await h(async()=>{const{default:t}=await import("./zh-DNrmKyYe.js");return{default:t}},[])).default;default:return(await h(async()=>{const{default:t}=await import("./en-wiTKdR4T.js");return{default:t}},[])).default}}async function nE(e){switch(e){case"es_ES":return(await h(async()=>{const{default:t}=await import("./es-Dar-xg4p.js");return{default:t}},[])).default;case"ja_JP":return(await h(async()=>{const{default:t}=await import("./ja-DI56VDCk.js");return{default:t}},[])).default;case"tl_PH":return(await h(async()=>{const{default:t}=await import("./tl-DNpoqKxi.js");return{default:t}},[])).default;case"vi_VN":return(await h(async()=>{const{default:t}=await import("./vi-rl4iq8bS.js");return{default:t}},[])).default;case"de_DE":return(await h(async()=>{const{default:t}=await import("./de-BIWVAXLP.js");return{default:t}},[])).default;case"ko_KR":return(await h(async()=>{const{default:t}=await import("./kr-BP_x8d-4.js");return{default:t}},[])).default;case"fr_FR":return(await h(async()=>{const{default:t}=await import("./fr-Biip2F0B.js");return{default:t}},[])).default;case"ru_RU":return(await h(async()=>{const{default:t}=await import("./ru-ov3iIk3P.js");return{default:t}},[])).default;case"pt_BR":return(await h(async()=>{const{default:t}=await import("./br-OOdQ3ULT.js");return{default:t}},[])).default;case"zh_CN":return(await h(async()=>{const{default:t}=await import("./zh-DrVkc5qI.js");return{default:t}},[])).default;default:return(await h(async()=>{const{default:t}=await import("./en-C9j038gl.js");return{default:t}},[])).default}}const cy=e=>a.jsx("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 23 28",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M22.4181 21.6041C22.008 22.5506 21.5224 23.422 20.9599 24.223C20.1931 25.3151 19.5652 26.0711 19.0814 26.4908C18.3313 27.1799 17.5277 27.5327 16.6671 27.5528C16.0493 27.5528 15.3043 27.3772 14.437 27.021C13.5669 26.6664 12.7673 26.4908 12.0362 26.4908C11.2694 26.4908 10.447 26.6664 9.56734 27.021C8.68636 27.3772 7.97665 27.5628 7.43403 27.5812C6.60879 27.
1596164 5.78624 27.2534 4.96519 26.4908C4.44116 26.0343 3.78569 25.2516 3.00047 24.1428C2.15799 22.9587 1.46536 21.5857 0.92274 20.0203C0.341611 18.3295 0.050293 16.6922 0.050293 15.1071C0.050293 13.2914 0.44307 11.7253 1.2298 10.413C1.84809 9.35886 2.67065 8.52734 3.70014 7.91691C4.72963 7.30648 5.84199 6.99541 7.03991 6.97551C7.69538 6.97551 8.55493 7.17804 9.6231 7.57607C10.6882 7.97544 11.3722 8.17797 11.672 8.17797C11.8962 8.17797 12.656 7.94116 13.944 7.46904C15.162 7.0312 16.19 6.84991 17.0321 6.92133C19.3141 7.10529 21.0285 8.00387 22.1687 9.62276C20.1278 10.858 19.1182 12.5881 19.1383 14.8076C19.1567 16.5363 19.7846 17.9749 21.0185 19.1172C21.5777 19.6473 22.2022 20.0571 22.897 20.3481C22.7463 20.7846 22.5872 21.2027 22.4181 21.6041ZM17.1845 1.03178C17.1845 2.38678 16.6889 3.65194 15.7011 4.82296C14.509 6.21507 13.0672 7.0195 11.5036 6.89256C11.4837 6.73 11.4721 6.55892 11.4721 6.37913C11.4721 5.07833 12.039 3.68622 13.0457 2.54798C13.5484 1.97167 14.1876 1.49247 14.9628 1.11021C15.7363 0.733653 16.4679 0.525407 17.156 0.489746C17.1761 0.670889 17.1845 0.85206 17.1845 1.03178Z",fill:"#959CA0"})}),iE=e=>a.jsx("svg",{height:e.size,role:"presentation",viewBox:"0 0 190.5 190.5",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:a.jsxs("g",{transform:"translate(90.669 -507.469)",children:[a.jsx("path",{clipPath:"none",d:"M4.583 650.342c26.304 0 47.627-21.324 47.627-47.628s-21.323-47.628-47.627-47.628-47.627 21.324-47.627 47.628 21.323 47.628 47.627 47.628z",fill:"#fff",mask:"none"}),a.jsx("path",{clipPath:"none",d:"M-36.664 626.539l-41.24-71.43c-8.362 14.479-12.765 30.904-12.765 47.625s4.401 33.146 12.762 47.625 20.387 26.503 34.868 34.86 30.908 12.755 47.628 12.75l41.24-71.43v-.011c-4.177 7.244-10.188 13.26-17.428 17.443a47.62 47.62 0 0 1-47.632.007 47.62 47.62 0 0 1-17.433-17.437z",fill:"#229342",mask:"none"}),a.jsx("path",{clipPath:"none",d:"M45.826 626.536l-41.239 71.43c16.72.003 33.146-4.398 47.626-12.757s26.504-20.384 34.863-34.865a95.24 95.24 0 0 0 12.755-47.627c-.003-16.72-4.408-33.145-12.772-47.623H4.58l-.01.007a47.62 47.62 0 0 1 23.819 6.372c7.243 4.179 13.257 10.19 17.439 17.431a47.62 47.62 0 0 1-.001 47.633z",fill:"#fbc116",mask:"none"}),a.jsx("path",{clipPath:"none",d:"M4.583 640.43c20.824 0 37.705-16.881 37.705-37.706s-16.881-37.705-37.705-37.705-37.705 16.881-37.705 37.705 16.881 37.706 37.705 37.706z",fill:"#1a73e8",mask:"none"}),a.jsx("path",{clipPath:"none",d:"M4.583 555.097h82.479c-8.358-14.481-20.381-26.507-34.861-34.868a95.23 95.23 0 0 0-47.625-12.76c-16.72.001-33.145 4.404-47.623 12.767a95.23 95.23 0 0 0-34.856 34.872l41.24 71.43.011.006a47.62 47.62 0 0 1-.015-47.633c4.179-7.242 10.193-13.256 17.434-17.436s15.456-6.381 23.818-6.379z",fill:"#e33b2e",mask:"none"})]})}),ly=e=>a.jsxs("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 23 26",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M10.5832 12.0978L0.0976562 23.2275C0.0980507 23.2298 0.0988382 23.2317 0.0992076 23.2341C0.420793 24.4427 1.52467 25.3326 2.83473 25.3326C3.35844 25.3326 3.85012 25.191 4.27179 24.9424L4.30528 24.9228L16.1087 18.1117L10.5838 12.0977",fill:"#EB3131"}),a.jsx("path",{d:"M21.1922 10.2046L21.1821 10.1977L16.0862 7.2435L10.345 12.3523L16.1061 18.1127L21.1752 15.1879C22.0639 14.7081 22.6672 13.7712 22.6672 12.6908C22.6672 11.6182 22.072 10.6859 21.1922 10.2046Z",fill:"#F6B60B"}),a.jsx("path",{d:"M0.0961678 2.10416C0.0331317 2.33661 0 2.58009 0 2.83292V22.5002C0 22.7526 0.0327407 22.9969 0.0965672 23.2285L10.9441 12.3832L0.0965672 2.10444",fill:"#5778C5"}),a.jsx("path",{d:"M10.6603 12.6667L16.088 7.24061L4.29785 0.404818C3.8693 0.148138 3.36912 0 2.83391 0C1.52384 0 0.418474 0.891502 0.0968301 2.10147C0.0964356 2.10265 0.0964355 2.10347 0.0964355 2.1045L10.6603 12.6669",fill:"#3BAD49"})]}),rE=_.lazy(()=>h(()=>import("./QRCodeRenderer-CpcfPDJ0.js"),__vite__mapDeps([41,4,3]))),Ru=e=>{const t=e.size||310,n=a.jsxs(cE,{style:{height:`${t}px`,width:`${t}px`},children:[a.jsx("span",{"data-v1":!0}),a.jsx("span",{"data-v2":!0}),a.jsx("span",{"data-v3":!0}),a.jsx("div",{})]});return a.jsxs("div",{style:{display:"flex",justifyContent:"center",position:"relative"},children:[e.qrCodeUri?a.jsx(_.Suspense,{fallback:n,children:a.jsx(oE,{children:a.jsx(rE,{clearSize:e.QRIcon?70:void 0,ecl:"M",size:t+20,uri:e.qrCodeUri})})}):n,e.QRIcon&&a.jsx(sE,{children:e.QRIcon})]})},sE=Fe({alignContent:"center",display:"flex",justifyContent:"center",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)",zIndex:1e3}),oE=Fe(()=>{const e=ee();return{"--ck-body-background":e.colors.modalBg,"--ck-qr-background":e.colors.modalBg,"--ck-qr-dot-color":e.colors.primaryText,animation:`${Rs} 600ms ease`}}),aE=qt`
160  0%{ background-position: 100% 0; }
161  100%{ background-position: -100% 0; }
162`,cE=Fe(e=>{const t=ee();return{"--bg":t.colors.modalBg,"--color":t.colors.skeletonBg,"&::after":{animation:`${aE} 1000ms linear infinite both`,background:"linear-gradient(90deg, transparent 50%, var(--color), transparent)",backgroundSize:"200% 100%",content:'""',inset:0,position:"absolute",transform:"scale(1.5) rotate(45deg)",zIndex:100},"&:before":{background:"repeat",backgroundImage:"radial-gradient(var(--color) 41%, transparent 41%)",backgroundSize:"1.888% 1.888%",content:'""',inset:0,position:"absolute",zIndex:3},"> div":{background:"var(--bg)",borderRadius:"5px",boxShadow:"0 0 0 7px var(--bg)",height:"28%",position:"relative",width:"28%",zIndex:4},"> span":{"&:before":{borderRadius:"3px",boxShadow:"0 0 0 4px var(--bg)",content:'""',inset:"9px",position:"absolute"},"&[data-v1]":{left:0,top:0},"&[data-v2]":{right:0,top:0},"&[data-v3]":{bottom:0,left:0},background:"var(--color)",borderRadius:"12px",boxShadow:"0 0 0 4px var(--bg)",height:"13.25%",position:"absolute",width:"13.25%",zIndex:4},alignItems:"center",borderRadius:J.md,display:"flex",justifyContent:"center",overflow:"hidden",position:"relative"}}
162),uy=({wallet:e,walletInfo:t,header:n,footer:i,onBack:r,locale:s,client:o})=>{const[c,l]=_.useState("base"),u=c==="android-scan"||c==="ios-scan",d=r?()=>{c==="base"?r():l("base")}:void 0;return a.jsx(b,{animate:"fadein",flex:"column",fullHeight:!0,children:a.jsxs(b,{expand:!0,flex:"column",p:"lg",children:[c==="android-scan"&&t.app.android&&a.jsx(dy,{client:o,locale:{scanToDownload:s.getStartedScreen.instruction},onBack:d,platform:"Google Play",platformIcon:a.jsx(ly,{size:D.md}),url:t.app.android,walletId:e.id,walletName:t.name}),c==="ios-scan"&&t.app.ios&&a.jsx(dy,{client:o,locale:{scanToDownload:s.getStartedScreen.instruction},onBack:d,platform:"App Store",platformIcon:a.jsx(cy,{size:D.md}),url:t.app.ios,walletId:e.id,walletName:t.name}),c==="base"&&a.jsxs(b,{expand:!0,flex:"column",children:[n||a.jsx(Me,{onBack:d,title:t.name}),a.jsx(U,{y:"xl"}),a.jsx(b,{animate:"fadein",center:"y",expand:!0,flex:"column",style:{minHeight:"250px"},children:a.jsxs(b,{flex:"column",gap:"xs",children:[t.app.chrome&&a.jsxs(jd,{onClick:()=>{Wr(t.app.chrome||"")},children:[a.jsx(iE,{size:D.lg}),a.jsx("span",{children:s.download.chrome})]}),t.app.android&&a.jsxs(jd,{as:"button",onClick:()=>{sr()?Wr(t.app.android||""):l("android-scan")},children:[a.jsx(ly,{size:D.lg}),a.jsx("span",{children:s.download.android})]}),t.app.ios&&a.jsxs(jd,{as:"button",onClick:()=>{sr()?Wr(t.app.ios||""):l("ios-scan")},children:[a.jsx(cy,{size:D.lg}),a.jsx("span",{children:s.download.iOS})]})]})})]}),!u&&i]})})},dy=e=>a.jsxs(b,{animate:"fadein",expand:!0,children:[a.jsx(Me,{onBack:e.onBack,title:e.walletName}),a.jsx(U,{y:"xl"}),a.jsxs(b,{center:"both",expand:!0,flex:"column",style:{textAlign:"center"},children:[a.jsx(Ru,{QRIcon:a.jsx(ai,{client:e.client,id:e.walletId,size:D.xxl}),qrCodeUri:e.url}),a.jsx(U,{y:"xl"}),a.jsx(A,{balance:!0,center:!0,multiline:!0,children:e.locale.scanToDownload}),a.jsx(U,{y:"xs"})]})]}),jd=$i(e=>{const t=ee();return{all:"unset","&:hover":{background:t.colors.secondaryButtonHoverBg,color:t.colors.primaryText,textDecoration:"none"},alignItems:"center",background:t.colors.secondaryButtonBg,borderRadius:J.sm,boxSizing:"border-box",color:t.colors.secondaryButtonText,cursor:"pointer",display:"flex",fontWeight:500,gap:R.md,padding:`${R.sm} ${R.md}`,textDecoration:"none",transition:"100ms ease",width:"100%"}});function lE(e){return new Promise(t=>{setTimeout(t,e)})}const p1=e=>{const{locale:t}=e;return a.jsxs(b,{animate:"fadein",flex:"column",fullHeight:!0,className:"tw-connecting-wallet-screen",children:[a.jsx(b,{p:"lg",style:{paddingBottom:0},children:a.jsx(Me,{onBack:e.onBack,title:e.walletName})}),a.jsxs(b,{center:"y",expand:!0,flex:"column",px:e.size==="compact"?"lg":"xxl",relative:!0,style:{paddingTop:0},children:[a.jsx(b,{py:"3xl",children:a.jsx(zu,{client:e.client,error:e.errorConnecting,id:e.walletId})}),a.jsxs(b,{animate:"fadein",style:{animationDuration:"200ms"},children:[a.jsx(A,{center:!0,color:"primaryText",size:"lg",weight:500,className:"tw-screen-title","data-status":e.errorConnecting?"failed":"in-progress",children:e.errorConnecting?t.failed:t.inProgress}),a.jsx(U,{y:"md"}),e.errorConnecting?a.jsx(b,{animate:"fadein",center:"x",flex:"row",children:a.jsxs(ue,{className:"tw-retry-button",fullWidth:!0,onClick:e.onRetry,style:{alignItems:"center",gap:R.xs},variant:"accent",children:[a.jsx(dc,{height:D.sm,width:D.sm}),t.tryAgain]})}):a.jsx(A,{balance:!0,center:!0,multiline:!0,className:"tw-screen-description",children:t.instruction})]})]}),e.onGetStarted?a.jsxs(a.Fragment,{children:[a.jsx(U,{y:"xl"}),a.jsx(He,{}),a.jsx(b,{center:"x",flex:"row",p:"lg",children:a.jsx(ue,{onClick:e.onGetStarted,variant:"link",className:"tw-get-started-button",children:t.getStartedLink})})]}):a.jsx(U,{y:e.size==="compact"?"lg":"xxl"})]})},b3=e=>{const{connectModalSize:t,client:n}=e,[i,r]=_.useState(!1);return a.jsxs(b,{animate:"fadein",flex:"column",fullHeight:!0,className:"tw-qr-scan-screen",children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:e.walletName})}),a.jsx(U,{y:"sm"}),a.jsxs(b,{center:"both",expand:!0,flex:"column",px:"lg",children:[!e.error&&a.jsxs("div",{style:{textAlign:"center"},children:[a.jsx(Ru,{QRIcon:a.jsx(ai,{client:n,id:e.walletId,size:D.xxl}),qrCodeUri:e.qrCodeUri}),a.jsx(U,{y:"xs"}),a.jsxs(ue,{className:"tw-copy-link-button",disabled:e.qrCodeUri===void 0,onClick:()=>{navigator.clipboard.writeText(e.qrCodeUri).then(()=>{r(!0),setTimeout(()=>r(!1),3e3)}).catch(s=>{console.error("Failed to copy link to clipboard",s)})},style:{cursor:e.qrCodeUri===void 0?"default":"pointer",fontSize:"12px",opacity:e.qrCodeUri===void 0?.5:1},variant:"link",children:[i?a.jsx(Us,{height:14,width:14}):a.jsx(aw,{height:14,width:14}),a.jsx("span",{style:{padding:"0 4px"},children:"Copy Link"})]}),a.jsx(U,{y:"lg"}),a.jsx(A,{balance:!0,center:!0,multiline:!0,className:"tw-screen-description",style:{paddingInline:R.lg},children:e.qrScanInstruction})]}),e.error&&a.jsxs(b,{animate:"fadein",style:{width:"100%"},children:[a.jsx(U,{y:"xxl"}),a.jsx(b,{center:"x",flex:"row",children:a.jsx(vs,{size:D["3xl"]})}),a.jsx(U,{y:"lg"}),a.jsx(A,{center:!0,color:"primaryText",size:"lg",className:"tw-screen-title","data-status":"failed",children:"Connection Failed"}),a.jsx(U,{y:"3xl"}),a.jsx(ue,{fullWidth:!0,onClick:e.onRetry,variant:"accent",className:"tw-retry-button",children:"Try again"})]})]}),a.jsx(U,{y:"lg"}),e.onGetStarted&&a.jsx(uw,{style:{border:t==="compact"?void 0:"none"},children:a.jsx(ue,{onClick:e.onGetStarted,className:"tw-get-started-button",style:{fontSize:ie.sm,textAlign:"center"},variant:"link",children:e.getStartedLink})})]})},uE=e=>{const{onBack:t,onGetStarted:n,wallet:i,walletInfo:r,locale:s,done:o}=e,[c,l]=_.useState(),[u,d]=_.useState(!1),f=_.useCallback(()=>{var y;d(!1),i.connect({chain:e.chain,client:e.client,walletConnect:{onDisplayUri(g){try{if(sr()){const p=r.mobile.native||r.mobile.universal;Wr(p?yw(p,g).redirect:g)}else l(g)}catch(p){console.error(p),d(!0)}},optionalChains:e.chains,projectId:(y=e.walletConnect)==null?void 0:y.projectId,showQrModal:!1}}).then(()=>{o()}).catch(g=>{d(!0),console.error(g)})},[e.walletConnect,r.mobile.native,r.mobile.universal,i,e.chain,e.client,e.chains,o]),m=_.useRef(!1);return _.useEffect(()=>{m.current||(m.current=!0,f())},[f]),sr()?a.jsx(p1,{client:e.client,errorConnecting:u,locale:{failed:s.connectionScreen.failed,get
162StartedLink:s.getStartedLink,inProgress:s.connectionScreen.inProgress,instruction:s.connectionScreen.instruction,tryAgain:s.connectionScreen.retry},onBack:t,onGetStarted:n,onRetry:f,size:e.size,walletId:i.id,walletName:r.name}):a.jsx(b3,{client:e.client,connectModalSize:e.size,error:u,getStartedLink:s.getStartedLink,onBack:t,onGetStarted:n,onRetry:f,qrCodeUri:c,qrScanInstruction:s.scanScreen.instruction,walletId:i.id,walletName:r.name})},dE=e=>{const{onBack:t,wallet:n,walletInfo:i,locale:r,done:s,setModalVisibility:o}=e,[c,l]=_.useState(),[u,d]=_.useState(!1),f=_.useCallback(()=>{var y,g;if(d(!1),sr()){let p=!1;lE(2e3).then(()=>{p||o(!1)}),n.connect({chain:e.chain,client:e.client,optionalChains:e.chains,projectId:(y=e.walletConnect)==null?void 0:y.projectId,showQrModal:!0}).then(()=>{p=!0,o(!0),s()}).catch(w=>{p=!0,o(!0),d(!0),console.error(w)})}else n.connect({chain:e.chain,client:e.client,onDisplayUri(p){l(p)},optionalChains:e.chains,projectId:(g=e.walletConnect)==null?void 0:g.projectId,showQrModal:!1}).then(()=>{s()}).catch(p=>{d(!0),console.error(p)})},[e.walletConnect,n,e.chain,e.client,e.chains,s,o]),m=_.useRef(!1);return _.useEffect(()=>{m.current||(m.current=!0,f())},[f]),sr()?a.jsx(p1,{client:e.client,errorConnecting:u,locale:{failed:r.connectionScreen.failed,get
162StartedLink:r.getStartedLink,inProgress:r.connectionScreen.inProgress,instruction:r.connectionScreen.instruction,tryAgain:r.connectionScreen.retry},onBack:t,onRetry:f,size:e.size,walletId:n.id,walletName:i.name}):a.jsx(b3,{client:e.client,connectModalSize:e.size,error:u,getStartedLink:r.getStartedLink,onBack:t,onRetry:f,qrCodeUri:c,qrScanInstruction:r.scanScreen.instruction,walletId:n.id,walletName:i.name})},hE=e=>{let t=window.location.toString();e.wallet.id==="io.metamask"?t=t.replace("https://",""):t=encodeURIComponent(t);const n=`${e.deepLinkPrefix}${t}?ref=${t}`;return a.jsxs(b,{animate:"fadein",children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:e.walletInfo.name})}),a.jsx(b,{animate:"fadein",center:"x",flex:"row",py:"3xl",children:a.jsx(mE,{children:a.jsx(ai,{client:e.client,id:e.wallet.id,size:"80"})})}),a.jsx(b,{p:"lg",children:a.jsxs(lw,{fullWidth:!0,gap:"xs",href:n,variant:"accent",children:["Continue in ",e.walletInfo.name,a.jsx(Jf,{height:D.sm,width:D.sm})]})})]})},fE=qt`
1630% {
164  transform: scale(0.9);
165}
166100% {
167  opacity: 0;
168  transform: scale(1.4);
169}
170`,mE=Fe(e=>{const t=ee();return{"&::before":{animation:`${fE} 2s cubic-bezier(0.175, 0.885, 0.32, 1.1) infinite`,background:t.colors.accentText,borderRadius:J.xl,bottom:0,content:'""',display:"block",left:0,position:"absolute",right:0,top:0,zIndex:-1},position:"relative"}}),hy=e=>{const{wallet:t,done:n}=e,[i,r]=_.useState(!1),s=e.locale,o=_.useCallback(async()=>{try{c.current=!0,r(!1),await Hw(1e3),await t.connect({chain:e.chain,client:e.client}),n()}catch(l){r(!0),console.error(l)}},[e.client,e.chain,n,t]),c=_.useRef(!1);return _.useEffect(()=>{c.current||o()},[o]),a.jsx(p1,{client:e.client,errorConnecting:i,locale:{failed:s.connectionScreen.failed,get
170StartedLink:s.getStartedLink,inProgress:s.connectionScreen.inProgress,instruction:s.connectionScreen.instruction,tryAgain:s.connectionScreen.retry},onBack:e.onBack,onGetStarted:e.onGetStarted,onRetry:()=>{o()},size:e.size,walletId:e.wallet.id,walletName:e.walletName})},yE=_.lazy(()=>h(()=>import("./CoinbaseSDKConnection-CyNZTsMy.js"),__vite__mapDeps([42,4,3,7,6,8,9,10,5,2,1,11,12,13,14,15]))),gE=_.lazy(()=>h(()=>import("./InAppWalletConnectUI-7nAWBUuy.js"),__vite__mapDeps([43,4,3,7,6,8,9,10,5,2,1,11,12,13,14,15]))),pE=_.lazy(()=>h(()=>Promise.resolve().then(()=>SL),void 0));function x3(e){var f,m,y;const[t,n]=_.useState("main"),{wallet:i}=e,r=Po(e.wallet.id),s=e.connectLocale.id,o=pe({queryFn:async()=>nE(s),queryKey:["injectedWalletLocale",s,(f=r.data)==null?void 0:f.name],refetchOnMount:!1,refetchOnWindowFocus:!1});if(r.isLoading||!o.data)return a.jsx(Mt,{});const c=o.data;if(!r.data){const g=or().find(p=>p.info.rdns===i.id);return g?a.jsx(hy,{chain:e.chain,client:e.client,done:e.done,locale:c(g.info.name),onBack:e.onBack,size:e.size,wallet:e.wallet,walletName:g.info.name}):a.jsxs(b,{animate:"fadein",flex:"column",fullHeight:!0,children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:"Not Supported"})}),a.jsxs(b,{center:"both",expand:!0,flex:"column",p:"lg",style:{minHeight:"300px"},children:[a.jsx(vs,{size:D["3xl"]}),a.jsx(U,{y:"lg"}),a.jsx(A,{center:!0,color:"primaryText",children:"Wallet is not supported"}),a.jsx(U,{y:"xxl"})]})]})}const l=c(r.data.name),u=or().find(g=>g.info.rdns===r.data.rdns);if(t==="get-started")return a.jsx(uy,{client:e.client,locale:l,onBack:()=>{n("main")},wallet:e.wallet,walletInfo:r.data});const d=r.data.deepLink&&!u&&sr()&&(((m=i.getConfig())==null?void 0:m.preferDeepLink)||i.id==="app.phantom");return(y=r.data.deepLink)!=null&&y.mobile&&d?a.jsx(hE,{client:e.client,deepLinkPrefix:r.data.deepLink.mobile,locale:l,onBack:e.onBack,onGetStarted:()=>{n("get-started")},wallet:e.wallet,walletInfo:r.data}):r.data.rdns&&u?a.jsx(hy,{chain:e.chain,client:e.client,done:e.done,locale:l,onBack:e.onBack,onGetStarted:()=>{n("get-started")},size:e.size,wallet:e.wallet,walletName:r.data.name}):r.data.mobile.native||r.data.mobile.universal?a.jsx(uE,{chain:e.chain,chains:e.chains,client:e.client,done:e.done,locale:l,onBack:e.onBack,onGetStarted:()=>{n("get-started")},size:e.size,wallet:e.wallet,walletConnect:e.walletConnect,walletInfo:r.data}):e.wallet.id==="walletConnect"?a.jsx(dE,{chain:e.chain,chains:e.chains,client:e.client,done:e.done,locale:l,onBack:e.onBack,setModalVisibility:e.setModalVisibility,size:e.size,wallet:e.wallet,walletConnect:e.walletConnect,walletInfo:r.data}):e.wallet.id==="inApp"||e.wallet.id==="embedded"?a.jsx(_.Suspense,{fallback:a.jsx(Mt,{}),children:a.jsx(gE,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,done:e.done,goBack:e.onBack,meta:e.meta,size:e.size,wallet:e.wallet,walletConnect:e.walletConnect})}):Xe(e.wallet.id)?a.jsx(_.Suspense,{fallback:a.jsx(Mt,{}),children:a.jsx(pE,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,done:e.done,goBack:e.onBack,meta:e.meta,size:e.size,wallet:e.wallet,walletConnect:e.walletConnect})}):e.wallet.id?a.jsx(_.Suspense,{fallback:a.jsx(Mt,{}),children:a.jsx(yE,{chain:e.chain,client:e.client,done:e.done,locale:l,onBack:e.onBack,onGetStarted:()=>{n("get-started")},size:e.size,wallet:e.wallet,walletInfo:r.data})}):a.jsx(uy,{client:e.client,locale:l,onBack:e.onBack,wallet:e.wallet,walletInfo:r.data})}function I3(e){const t=Po(e.personalWallet.id),[n,i]=_.useState(!1);return t.data?n?a.jsx(wE,{accountAbstraction:e.accountAbstraction,client:e.client,done:e.done,localeId:e.connectLocale.id,onBack:e.onBack,personalWallet:e.personalWallet,personalWalletInfo:t.data,size:e.size}):a.jsx(x3,{chain:e.chain,chains:e.chains,client:e.client,connectLocale:e.connectLocale,done:()=>{i(!0)},meta:e.meta,onBack:e.onBack,setModalVisibility:e.setModalVisibility,size:e.size,wallet:e.personalWallet,walletConnect:e.walletConnect}):a.jsx(Mt,{})}function wE(e){const t=pe({queryFn:()=>tE(e.localeId),queryKey:["getSmartWalletLocale",e.localeId]}),{personalWallet:n}=e,{done:i}=e,[r,s]=_.useState("idle"),o=mf(),c=_.useCallback(async()=>
170{if(!n)throw new Error("No personal wallet");s("connecting");try{const u=await o.handleConnection(n,{accountAbstraction:e.accountAbstraction,client:e.client});i(u),s("idle")}catch(u){console.error(u),s("connect-error")}},[i,n,e.client,e.accountAbstraction,o]),l=_.useRef(!1);return _.useEffect(()=>{l.current||(c(),l.current=!0)},[c]),t.data?r==="connect-error"?a.jsx(b,{animate:"fadein",center:"both",flex:"column",fullHeight:!0,p:"lg",style:{minHeight:"300px"},children:a.jsx(A,{color:"danger",children:t.data.failedToConnect})}):a.jsxs(b,{center:"both",flex:"column",fullHeight:!0,style:{minHeight:"300px"},children:[a.jsx(A,{center:!0,color:"primaryText",multiline:!0,children:t.data.connecting}),a.jsx(U,{y:"lg"}),a.jsx(Qe,{color:"accentText",size:"lg"})]}):a.jsx(Mt,{})}const fy="inApp";function M3(e){const[t,n]=_.useState(null);return e.accountAbstraction?t?a.jsx(I3,{accountAbstraction:e.accountAbstraction,chain:e.chain,chains:e.chains,client:e.client,connectLocale:e.connectLocale,done:e.done,meta:e.meta,onBack:e.goBack,personalWallet:t,setModalVisibility:e.setModalVisibility,size:e.size,walletConnect:e.walletConnect}):a.jsx(my,{...e,done:i=>{n(i)}}):a.jsx(my,{...e})}const my=e=>{const{walletIdsToHide:t}=e,n=e.size==="compact",[i,r]=_.useState(!1),[s,o]=_.useState(!1),c=_E(),l=_.useMemo(()=>Pu(),[]),u=e.wallets;let d=[...u];for(const M of c)u.find(S=>S.id===M.id)||d.push(M);t&&(d=d.filter(M=>!(t!=null&&t.includes(M.id))));const f=!1,m=d,y=m.filter(M=>M.id===fy),g=l1(m.filter(M=>M.id!==fy),e.recommendedWallets),p=f,w=_.useRef(!1);_.useEffect(()=>{setTimeout(()=>{w.current=!0},1e3)},[]);const x=e.modalHeader?a.jsx(Me,{onBack:e.modalHeader.onBack,title:e.modalHeader.title}):a.jsxs(b,{center:"y",flex:"row",gap:"xs",className:"tw-header",children:[e.meta.titleIconUrl?a.jsx(dt,{client:e.client,height:D.md,src:e.meta.titleIconUrl,width:D.md}):null,a.jsxs(Su,{children:[" ",e.title," "]})]}),I=async M=>{e.selectWallet(M)},E=a.jsx(ls,{className:"tw-select-connect-a-wallet-button",lastUsedBadge:!!l&&l!=="inApp"&&!l.startsWith("ecosystem."),client:e.client,disabled:e.meta.requireApproval&&!s,icon:Ls,onClick:()=>{r(!0)},title:e.connectLocale.connectAWallet}),j=a.jsxs(b,{className:"tw-get-started-container",flex:"row",style:{justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",weight:500,children:e.connectLocale.newToWallets}),a.jsx(Gr,{href:"https://blog.thirdweb.com/web3-wallet/",size:"sm",target:"_blank",weight:500,children:e.connectLocale.getStarted})]}),C=e.meta.requireApproval||e.meta.termsOfServiceUrl||e.meta.privacyPolicyUrl?a.jsx(ku,{isApproved:s,locale:e.connectLocale.agreement,onApprove:()=>o(!s),privacyPolicyUrl:e.meta.privacyPolicyUrl,requireApproval:e.meta.requireApproval,termsOfServiceUrl:e.meta.termsOfServiceUrl}):void 0;let T,v;n?y.length===0?(T=a.jsx(Ko,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,diableSelectionDataReset:e.disableSelectionDataReset,disabled:e.meta.requireApproval&&!s,done:e.done,goBack:e.goBack,onShowAll:e.onShowAll,recommendedWallets:e.recommendedWallets,selectWallet:I,showAllWallets:e.showAllWallets,size:e.size,wallets:m}),v=a.jsxs(a.Fragment,{children:[a.jsx(He,{}),a.jsxs(b,{flex:"column",gap:"md",px:"lg",py:"md+",children:[j,p]}),a.jsx(He,{}),C&&a.jsx(b,{px:"md",style:{paddingBottom:R.md,paddingTop:R.md},children:C})]})):i?(T=a.jsx(Ko,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,diableSelectionDataReset:e.disableSelectionDataReset,disabled:e.meta.requireApproval&&!s,done:e.done,goBack:e.goBack,onShowAll:e.onShowAll,recommendedWallets:e.recommendedWallets,selectWallet:I,showAllWallets:e.showAllWallets,size:e.size,wallets:g}),v=a.jsx(uw,{children:j})):(T=a.jsxs(b,{px:"xs",children:[a.jsx(Ko,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,diableSelectionDataReset:e.disableSelectionDataReset,disabled:e.meta.requireApproval&&!s,done:e.done,goBack:e.goBack,recommendedWallets:e.recommendedWallets,selectWallet:I,showAllWallets:e.showAllWallets,size:e.size,wallets:y}),g.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(g3,{text:e.connectLocale.or}),a.jsx(U,{y:"lg"})]})]}),g.length===0?v=C||p?a.jsxs(a.Fragment,{children:[a.jsx(U,{y:"md"}),a.jsx(He,{}),p,C&&a.jsxs(b,{p:"md",children:[" ",C," "]})]}):a.jsx(U,{y:"sm"}):g.length>1?v=a.jsxs(b,{flex:"column",gap:"sm",style:{position:"relative"},children:[a.jsx(CE,{}),a.jsxs(b,{flex:"column",gap:"md",px:"lg",children:[E,p]}),C?a.jsxs(b,{p:"md",children:[" ",C," "]}):a.jsx(U,{y:"xxs"})]}):v=a.jsxs(a.Fragment,{children:[a.jsx(b,{px:"lg",children:a.jsx(Ko,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,diableSelectionDataReset:e.disableSelectionDataReset,disabled:e.meta.requireApproval&&!s,done:e.done,goBack:e.goBack,onShowAll:e.onShowAll,recommendedWallets:e.recommendedWallets,selectWallet:I,showAllWallets:e.showAllWallets,size:e.size,wallets:g})}),p,C?a.jsxs(a.Fragment,{children:[a.jsx(He,{}),a.jsxs(b,{p:"md",children:[" ",C," "]})]}):p]})):T=a.jsx(Ko,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,diableSelectionDataReset:e.disableSelectionDataReset,disabled:e.meta.requireApproval&&!s,done:e.done,goBack:e.goBack,onShowAll:e.onShowAll,recommendedWallets:e.recommendedWallets,selectWallet:I,showAllWallets:e.showAllWallets,size:e.size,wallets:m});const N=!e.hideHeader||e.modalHeader;return a.jsxs(b,{animate:"fadein",className:"tw-wallet-selection",flex:"column",fullHeight:!0,scrollY:!0,style:{maxHeight:e.size==="compact"?s1:void 0},children:[N&&a.jsx(b,{px:"lg",pt:"lg",pb:"xs",children:i?a.jsx(Me,{onBack:()=>{r(!1)},title:x}):x}),a.jsxs(b,{expand:!0,scrollY:!0,style:N?{paddingTop:"2px"}:{paddingTop:R.md},children:[!N&&i&&a.jsx(b,{px:"md",children:a.jsx(b,{center:"y",flex:"row",style:{padding:R.sm,paddingTop:0},children:a.jsxs(rr,{onClick:()=>{r(!1)},style:{gap:R.xxs,paddingBlock:R.xxs,paddingRight:R.xs,transform:`translateX(-${R.xs})`},children:[a.jsx(ow,{height:D.sm,width:D.sm}),e.connectLocale.goBackButton]})})}),T]}),v,n&&e.meta.showThirdwebBranding!==!1&&a.jsx(b,{py:"md",children:a.jsx(Mo,{})})]})};let Sd=[];function _E(){return Sd.length===0&&(Sd=or().map(n=>n.info.rdns).map(n=>un(n))),Sd}const Ko=e=>{const t=l1(e.wallets,e.recommendedWallets),{screen:n}=h1(),i=Bs(),r=_.useMemo(()=>Pu(),[]);return a.jsxs(ME,{style:{maxHeight:"370px",minHeight:"100%",paddingTop:e.size==="wide"?0:UC},children:[t.map(s=>{const o=n?typeof n=="object"&&n.id===s.id:!1;return a.jsx("li",{children:s.id==="inApp"&&e.size==="compact"?a.jsx(eE,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,disabled:e.disabled,done:()=>e.done(s),goBack:e.goBack,recommendedWallets:e.recommendedWallets,select:()=>e.selectWallet(s),size:e.size,wallet:s}):a.jsx(y1,{className:"tw-wallet-select-wallet-button",badge:r===s.id?"Last used":void 0,client:e.client,connectLocale:e.connectLocale,isActive:o,recommendedWallets:e.recommendedWallets,selectWallet:()=>{e.diableSelectionDataReset||i({}),e.selectWallet(s)},wallet:s})},s.id)}),e.onShowAll&&e.showAllWallets!==!1&&a.jsx(xE,{className:"tw-show-all-wallets-button",children:a.jsxs(g1,{onClick:e.onShowAll,children:[a.jsxs(IE,{children:[a.jsx("div",{"data-dot":!0}),a.jsx("div",{"data-dot":!0}),a.jsx("div",{"data-dot":!0}),a.jsx("div",{"data-dot":!0})]}),a.jsxs(b,{flex:"row",gap:"xs",children:[a.jsx(A,{color:"primaryText",children:"All Wallets"}),a.jsx(bE,{children:" 500+ "})]})]})})]})},bE=Fe(()=>{const e=ee();return{backgroundColor:e.colors.secondaryButtonBg,borderRadius:J.sm,color:e.colors.secondaryText,fontSize:ie.xs,paddingBlock:"3px",paddingInline:R.xxs}}),xE=Fe(()=>({"&:hover [data-dot]":{background:ee().colors.primaryText}})),IE=Fe(()=>{const e=ee();return{"& div":{background:e.colors.secondaryText,borderRadius:"50%",height:"10px",transition:"background 200ms ease",width:"10px"},alignItems:"center",backgroundColor:e.colors.tertiaryBg,border:`1px solid ${e.colors.borderColor}`,borderRadius:J.md,display:"grid",gap:R["4xs"],gridTemplateColumns:"1fr 1fr",height:`${D.xl}px`,justifyItems:"center",padding:R.xs,width:`${D.xl}px`}}),ME=sw({all:"unset",boxSizing:"border-box",display:"flex",flex:1,flexDirection:"column",gap:"2px",listStyleType:"none",overflowY:"auto",...hc,margin:"-2px",marginBottom:0,paddingInline:R.md,paddingBottom:R.lg}),CE=Fe(e=>{const t=ee();return t.colors.modalBg,{background:`linear-gradient(to bottom, transparent 0%, ${t.colors.modalBg}
170 80%)`,height:R.lg,left:0,pointerEvents:"none",position:"absolute",top:`-${R.lg}`,width:"100%"}});function EE(e){return a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"300px 1fr",height:"100%"},children:[a.jsxs(vE,{children:[" ",e.left," "]}),a.jsx(b,{flex:"column",relative:!0,scrollY:!0,children:e.right})]})}function TE(e){return a.jsx(b,{flex:"column",relative:!0,scrollY:!0,style:{maxHeight:s1},children:e.children})}const vE=Fe(e=>{const t=ee();return{display:"flex",flexDirection:"column",overflowY:"auto",...hc,borderRight:`1px solid ${t.colors.separatorLine}`,position:"relative"}}),LE=_.lazy(()=>h(()=>Promise.resolve().then(()=>Tv),void 0)),C3=e=>{const{setModalVisibility:t,onClose:n,shouldSetActive:i}=e,{screen:r,setScreen:s,initialScreen:o}=e.screenSetup,c=Lp(),l=Bs(),u=ft(),d=ht(),f=Cf(u,d,e.auth),m=f.requiresAuth&&!f.isLoggedIn,y=mf(),g=_.useCallback(T=>{i?c(T):y.addConnectedWallet(T),e.onConnect&&e.onConnect(T,y.connectedWallets.getValue()),jl(()=>{l({}),t(!0)}),m?s(gn.signIn):(s(o),n==null||n())},[t,n,e.onConnect,c,m,s,l,i,o,y]),p=_.useCallback(()=>{l({}),s(o)},[s,o,l]),w=a.jsx(M3,{accountAbstraction:e.accountAbstraction,chain:e.chain,chains:e.chains,client:e.client,connectLocale:e.connectLocale,done:g,goBack:e.wallets.length>1?p:void 0,hideHeader:e.hideHeader,meta:e.meta,modalHeader:e.modalHeader,onShowAll:()=>{s(gn.showAll)},recommendedWallets:e.recommendedWallets,selectWallet:T=>{T.onConnectRequested?T.onConnectRequested().then(()=>s(T)).catch(console.error):s(T)},setModalVisibility:t,showAllWallets:e.showAllWallets,size:e.size,title:e.meta.title||e.connectLocale.defaultModalTitle,walletConnect:e.walletConnect,walletIdsToHide:e.walletIdsToHide,wallets:e.wallets}),x=a.jsx(_.Suspense,{fallback:a.jsx(Mt,{}),children:a.jsx(LE,{client:e.client,connectLocale:e.connectLocale,onBack:p,onSelect:s,recommendedWallets:e.recommendedWallets,walletIdsToHide:e.walletIdsToHide,size:e.size})}),I=a.jsx(SC,{client:e.client,connectLocale:e.connectLocale,meta:e.meta,welcomeScreen:e.welcomeScreen}),E=e.wallets.length>1?p:void 0,j=T=>e.accountAbstraction?a.jsx(I3,{accountAbstraction:e.accountAbstraction,chain:e.chain,chains:e.chains,client:e.client,connectLocale:e.connectLocale,done:v=>{g(v)},meta:e.meta,onBack:E,personalWallet:T,setModalVisibility:e.setModalVisibility,size:e.size,walletConnect:e.walletConnect},T.id):a.jsx(x3,{chain:e.chain,chains:e.chains,client:e.client,connectLocale:e.connectLocale,done:()=>{g(T)},meta:e.meta,onBack:E,setModalVisibility:e.setModalVisibility,size:e.size,wallet:T,walletConnect:e.walletConnect},T.id),C=a.jsx(u3,{auth:e.auth,client:e.client,connectLocale:e.connectLocale,modalSize:e.size,onClose:n,onDone:n,privacyPolicyUrl:e.meta.privacyPolicyUrl,termsOfServiceUrl:e.meta.termsOfServiceUrl});return a.jsx(u1.Provider,{value:e.screenSetup,children:e.size==="wide"?a.jsx(EE,{left:w,right:a.jsxs(a.Fragment,{children:[r===gn.signIn&&C,r===gn.main&&I,r===gn.getStarted&&I,r===gn.showAll&&x,typeof r!="string"&&j(r)]})}):a.jsxs(TE,{children:[r===gn.signIn&&C,r===gn.main&&w,r===gn.getStarted&&I,r===gn.showAll&&x,typeof r!="string"&&j(r)]})})},jE=Fe(e=>{const{modalSize:t}=e,n=ee();return{"& *":{boxSizing:"border-box"},"& *::selection":{backgroundColor:n.colors.selectedTextBg,color:n.colors.selectedTextColor},background:n.colors.modalBg,border:`1px solid ${n.colors.borderColor}`,borderRadius:J.xl,boxSizing:"border-box",color:n.colors.primaryText,fontFamily:n.fontFamily,height:t==="compact"?"auto":Bw,lineHeight:"normal",overflow:"hidden",position:"relative",maxWidth:"100%",width:t==="compact"?Pw:Uw}});function E3(e){const t=kx({payModal:!1}),[n,i]=_.useState(),[r,s]=_.useState(),o=Df(e.tx.chain),[c,l]=_.useState("loading"),u=ee(),d=_.useCallback(async()=>{l("loading"),s(void 0);try{const m=await t.mutateAsync(e.tx);i(m.transactionHash),e.onTxSent(m),l("sent")}catch(m){console.error(m),s(m),l("failed")}},[t,e.tx,e.onTxSent]),f=_.useRef(!1);return _.useEffect(()=>{f.current||(f.current=!0,d())},[d]),a.jsxs(b,{p:"lg",children:[a.jsx(Me,{onBack:e.onBack,title:"Transaction"}),a.jsx(U,{y:"xxl"}),a.jsxs(b,{center:"x",flex:"row",children:[c==="loading"&&a.jsx(Qe,{color:"accentText",size:"xxl"}),c==="failed"&&a.jsx(vs,{size:D["3xl"]}),c==="sent"&&a.jsx(b,{center:"both",flex:"row",style:{animation:"successBounce 0.6s ease-out",backgroundColor:u.colors.tertiaryBg,border:`2px solid ${u.colors.success}
170`,borderRadius:"50%",height:"64px",marginBottom:"16px",width:"64px"},children:a.jsx(Us,{color:u.colors.success,height:D.xl,style:{animation:"checkAppear 0.3s ease-out 0.3s both"},width:D.xl})})]}),a.jsx(U,{y:"md"}),a.jsxs(A,{center:!0,color:"primaryText",size:"lg",children:[c==="loading"&&"Sending transaction",c==="failed"&&"Transaction failed",c==="sent"&&"Transaction sent"]}),a.jsx(U,{y:"sm"}),a.jsx(A,{center:!0,color:"danger",size:"sm",children:c==="failed"&&r&&r.message||""}),a.jsx(U,{y:"xl"}),c==="failed"&&a.jsx(ue,{fullWidth:!0,onClick:d,variant:"accent",children:"Try Again"}),c==="sent"&&a.jsxs(a.Fragment,{children:[n&&a.jsxs(a.Fragment,{children:[a.jsxs(ue,{color:"primaryText",fullWidth:!0,gap:"xs",onClick:()=>{var m;e.windowAdapter.open(gw(((m=o.explorers[0])==null?void 0:m.url)??"",n))},variant:"secondary",children:["View on Explorer",a.jsx(Jf,{height:D.sm,width:D.sm})]}),a.jsx(U,{y:"sm"})]}),a.jsx(ue,{fullWidth:!0,onClick:e.closeModal,variant:"accent",children:"Done"})]}),a.jsx("style",{children:`
171          @keyframes successBounce {
172            0% {
173              transform: scale(0.3);
174              opacity: 0;
175            }
176            50% {
177              transform: scale(1.05);
178            }
179            70% {
180              transform: scale(0.9);
181            }
182            100% {
183              transform: scale(1);
184              opacity: 1;
185            }
186          }
187
188          @keyframes checkAppear {
189            0% {
190              transform: scale(0);
191              opacity: 0;
192            }
193            100% {
194              transform: scale(1);
195              opacity: 1;
196            }
197          }
198        `})]})}function SE(e){return e==="INTERNAL_SERVER_ERROR"||e==="UNKNOWN_ERROR"}function DE(e){const{error:t}=e;if(!t)return{errorCode:null,isClientError:!1,isRetryable:!1,isServerError:!1,mappedError:null,statusCode:null,userMessage:""};let n;t instanceof Ot?n=t:n=new Ot({code:"UNKNOWN_ERROR",message:t.message||"An unknown error occurred",statusCode:500});const i=n.statusCode||null,r=i!==null&&i>=400&&i<500,s=i!==null&&i>=500,o=NE(n);return{errorCode:n.code,isClientError:r,isRetryable:SE(n.code),isServerError:s,mappedError:n,statusCode:i,userMessage:o}}function NE(e){switch(e.code){case"INVALID_INPUT":return"Invalid input provided. Please check your parameters and try again.";case"ROUTE_NOT_FOUND":return"No route found for this transaction. Please try a different token pair or amount.";case"AMOUNT_TOO_LOW":return"The amount is too low for this transaction. Please increase the amount.";case"AMOUNT_TOO_HIGH":return"The amount is too high for this transaction. Please decrease the amount.";case"INTERNAL_SERVER_ERROR":return"A temporary error occurred. Please try again in a moment.";default:return e.message||"An unexpected error occurred. Please try again."}}function T3({error:e,onRetry:t,onCancel:n,client:i}){const r=ee(),{userMessage:s}=DE({error:e}),o=_.useRef(!1);return _.useEffect(()=>{o.current||(o.current=!0,ot({client:i,error:e.message,event:"ub:ui:error"}))},[i,e.message]),a.jsx(b,{flex:"column",fullHeight:!0,gap:"md",p:"md",children:a.jsxs(b,{flex:"row",gap:"md",style:{alignItems:"flex-start"},children:[a.jsx(b,{center:"both",style:{backgroundColor:r.colors.tertiaryBg,borderRadius:"50%",flexShrink:0,height:"24px",width:"24px"},children:a.jsx(is,{color:r.colors.danger,height:D.md,width:D.md})}),a.jsxs(b,{flex:"column",fullHeight:!0,gap:"sm",style:{flex:1},children:[a.jsx(A,{color:"primaryText",size:"lg",children:"Error"}),a.jsx(b,{flex:"column",gap:"sm",style:{minHeight:"100px"},children:a.jsx(b,{flex:"column",gap:"sm",style:{flex:1},children:a.jsx(A,{color:"secondaryText",size:"sm",children:s})})}),a.jsxs(b,{flex:"row",gap:"sm",style:{justifyContent:"flex-end"},children:[a.jsx(ue,{onClick:t,variant:"primary",children:"Try Again"}),n&&a.jsx(ue,{onClick:n,variant:"secondary",children:"Cancel"})]})]})]})})}function Bo(e,t){if(e===0)return 0;const n=10**t,i=1/10**t,r=e<i?"ceil":"round";return Math[r]((e+Number.EPSILON)*n)/n}function Co(e,t=!0,n=5){return Bo(Number(e.displayValue),n)+(t?` ${e.symbol}`:"")}function pn(e,t,n=5){return Bo(Number.parseFloat(mi(e,t)),n).toString()}function Fr(e,t){return AE(t,"en-US",e)}
198function AE(e,t,n){return e<0?new Intl.NumberFormat(t,{style:"currency",currency:n,maximumFractionDigits:6,minimumFractionDigits:0}).format(e):new Intl.NumberFormat(t,{style:"currency",currency:n,maximumFractionDigits:2,minimumFractionDigits:0,notation:"compact"}).format(e)}function OE(e){var c;let t=e;"source_metadata"in e&&(t=e.source_metadata);const n=t.settings.compilationTarget,i=Object.keys(n),r=n[i[0]],s={author:t.output.devdoc.author,details:t.output.devdoc.detail,notice:t.output.userdoc.notice,title:t.output.devdoc.title},o=[...new Set(Object.entries(t.sources).map(([,l])=>l.license))];return{abi:((c=t==null?void 0:t.output)==null?void 0:c.abi)||[],info:s,isPartialAbi:t.isPartialAbi,licenses:o,metadata:t,name:r,zk_version:e.zk_version}}async function kE(e){const{address:t,chain:n}=e,i=await fetch(`https://contract.thirdweb.com/metadata/${n.id}/${t}`,{headers:{"Content-Type":"application/json"},method:"GET"});if(!i.ok){const s=await i.json();throw new Error(s.message||s.error||"Failed to get compiler metadata")}const r=await i.json();return OE(r)}function v3({transaction:e,client:t,wallet:n}){const i=ko(e.chain),r=hf(n);return pe({enabled:!!e.to&&!!i.data,queryFn:async()=>{var j,C;const s=zt({address:e.to,chain:e.chain,client:t}),[o,c,l,u]=await Promise.all([kE(s).catch(()=>null),wn(e.value),wn(e.erc20Value),gf(e).catch(()=>"0x")]),[d,f]=await Promise.all([Uo(t,(l==null?void 0:l.tokenAddress)||Pt,e.chain.id),r?0n:bl(e).catch(()=>null)]);let m={description:void 0,functionName:"Contract Call",selector:"0x"};if(o!=null&&o.abi&&u.length>=10)try{const T=u.slice(0,10),v=o.abi,S=(Array.isArray(v)?v:[]).filter(L=>L&&typeof L=="object"&&"type"in L&&L.type==="function").map(L=>L).find(L=>$6(L)===T);S&&(m={description:void 0,functionName:S.name,selector:T})}catch{}const g=await(async()=>d?d.decimals:l?Q6({contract:zt({address:l.tokenAddress,chain:e.chain,client:t})}):18)(),p=l?l.amountWei:c||0n,w=((C=(j=i.data)==null?void 0:j.nativeCurrency)==null?void 0:C.symbol)||"ETH",x=(d==null?void 0:d.symbol)||w,I=l&&l.tokenAddress.toLowerCase()!==Pt?l.amountWei:(c||0n)+(f||0n),E=mi(I,g);return{contractMetadata:o,costWei:p,functionInfo:m,gasCostDisplay:f?`${pn(f,18)} ${w}`:null,gasCostWei:f,tokenInfo:d,totalCost:E,totalCostWei:I,txCostDisplay:`${pn(p,g)} ${x}`}},queryKey:["transaction-details",Zt(e),r]})}const zE=e=>{const t=_.useId();return a.jsxs("svg",{"aria-hidden":"true",height:e.size,viewBox:"0 0 512 512",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("mask",{id:t,children:a.jsx("circle",{cx:"256",cy:"256",fill:"#fff",r:"256"})}),a.jsxs("g",{mask:`url(#${t})`,children:[a.jsx("path",{d:"M0 0v512h144l112-64 112 64h144V0H368L256 64 144 0Z",fill:"#d80027"}),a.jsx("path",{d:"M144 0h224v512H144Z",fill:"#eee"}),a.jsx("path",{d:"m301 289 44-22-22-11v-22l-45 22 23-44h-23l-22-34-22 33h-23l23 45-45-22v22l-22 11 45 22-12 23h45v33h22v-33h45z",fill:"#d80027"})]})]})},PE=e=>{const t=_.useId();return a.jsxs("svg",{"aria-hidden":"true",height:e.size,viewBox:"0 0 512 512",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("mask",{id:t,children:a.jsx("circle",{cx:"256",cy:"256",fill:"#fff",r:"256"})}),a.jsxs("g",{mask:`url(#${t})`,children:[a.jsx("path",{d:"M0 0h512v512H0z",fill:"#0052b4"}),a.jsx("path",{d:"m256 100.2 8.3 25.5H291l-21.7 15.7 8.3 25.6-21.7-15.8-21.7 15.8 8.3-25.6-21.7-15.7h26.8zm-110.2 45.6 24 12.2 18.9-19-4.2 26.5 23.9 12.2-26.5 4.2-4.2 26.5-12.2-24-26.5 4.3 19-19zM100.2 256l25.5-8.3V221l15.7 21.7 25.6-8.3-15.8 21.7 15.8 21.7-25.6-8.3-15.7 21.7v-26.8zm45.6 110.2 12.2-24-19-18.9 26.5 4.2 12.2-23.9 4.2 26.5 26.5 4.2-24 12.2 4.3 26.5-19-19zM256 411.8l-8.3-25.5H221l21.7-15.7-8.3-25.6 21.7 15.8 21.7-15.8-8.3 25.6 21.7 15.7h-26.8zm110.2-45.6-24-12.2-18.9 19 4.2-26.5-23.9-12.2 26.5-4.2 4.2-26.5 12.2 24 26.5-4.3-19 19zM411.8 256l-25.5 8.3V291l-15.7-21.7-25.6 8.3 15.8-21.7-15.8-21.7 25.6 8.3 15.7-21.7v26.8zm-45.6-110.2-12.2 24 19 18.9-26.5-4.2-12.2 23.9-4.2-26.5-26.5-4.2 24-12.2-4.3-26.5 19 19z",fill:"#ffda44"})]})]})},RE=e=>a.jsxs("svg",{"aria-hidden":"true",height:e.size,version:"1.1",viewBox:"0 0 512 512",width:e.size,x:"0px",xmlns:"http://www.w3.org/2000/svg",y:"0px",children:[a.jsx("circle",{cx:"256",cy:"256",fill:"#F0F0F0",r:"256"}),a.jsxs("g",{children:[a.jsx("path",{d:"M52.92,100.142c-20.109,26.163-35.272,56.318-44.101,89.077h133.178L52.92,100.142z",fill:"#0052B4"}),a.jsx("path",{d:"M503.181,189.219c-8.829-32.758-23.993-62.913-44.101-89.076l-89.075,89.076H503.181z",fill:"#0052B4"}),a.jsx("path",{d:"M8.819,322.784c8.83,32.758,23.993,62.913,44.101,89.075l89.074-89.075L8.819,322.784L8.819,322.784   z",fill:"#0052B4"}),a.jsx("path",{d:"M411.858,52.921c-26.163-20.109-56.317-35.272-89.076-44.102v133.177L411.858,52.921z",fill:"#0052B4"}),a.jsx("path",{d:"M100.142,459.079c26.163,20.109,56.318,35.272,89.076,44.102V370.005L100.142,459.079z",fill:"#0052B4"}
198),a.jsx("path",{d:"M189.217,8.819c-32.758,8.83-62.913,23.993-89.075,44.101l89.075,89.075V8.819z",fill:"#0052B4"}),a.jsx("path",{d:"M322.783,503.181c32.758-8.83,62.913-23.993,89.075-44.101l-89.075-89.075V503.181z",fill:"#0052B4"}),a.jsx("path",{d:"M370.005,322.784l89.075,89.076c20.108-26.162,35.272-56.318,44.101-89.076H370.005z",fill:"#0052B4"})]}),a.jsxs("g",{children:[a.jsx("path",{d:"M509.833,222.609h-220.44h-0.001V2.167C278.461,0.744,267.317,0,256,0   c-11.319,0-22.461,0.744-33.391,2.167v220.44v0.001H2.167C0.744,233.539,0,244.683,0,256c0,11.319,0.744,22.461,2.167,33.391   h220.44h0.001v220.442C233.539,511.256,244.681,512,256,512c11.317,0,22.461-0.743,33.391-2.167v-220.44v-0.001h220.442   C511.256,278.461,512,267.319,512,256C512,244.683,511.256,233.539,509.833,222.609z",fill:"#D80027"}),a.jsx("path",{d:"M322.783,322.784L322.783,322.784L437.019,437.02c5.254-5.252,10.266-10.743,15.048-16.435   l-97.802-97.802h-31.482V322.784z",fill:"#D80027"}),a.jsx("path",{d:"M189.217,322.784h-0.002L74.98,437.019c5.252,5.254,10.743,10.266,16.435,15.048l97.802-97.804   V322.784z",fill:"#D80027"}),a.jsx("path",{d:"M189.217,189.219v-0.002L74.981,74.98c-5.254,5.252-10.266,10.743-15.048,16.435l97.803,97.803   H189.217z",fill:"#D80027"}),a.jsx("path",{d:"M322.783,189.219L322.783,189.219L437.02,74.981c-5.252-5.254-10.743-10.266-16.435-15.047   l-97.802,97.803V189.219z",fill:"#D80027"})]})]}),UE=e=>a.jsx("svg",{height:e.size,role:"presentation",viewBox:"0 0 32 32",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:a.jsxs("g",{fill:"none",fillRule:"evenodd",children:[a.jsx("circle",{cx:"16",cy:"16",fill:"#a81b1b",r:"16"}),a.jsx("path",{d:"M17.548 18.711v1.878h5.063v2.288h-5.063V25.5h-3.096v-2.623H9.389v-2.288h5.063v-1.878H9.389v-2.288h4.171L7.5 7.5h3.752l4.8 7.534L20.853 7.5H24.5l-6.086 8.923h4.197v2.288z",fill:"#ffffff"})]})}),BE=e=>a.jsxs("svg",{"aria-hidden":"true",height:e.size,version:"1.1",viewBox:"0 0 512 512",width:e.size,x:"0px",xmlns:"http://www.w3.org/2000/svg",y:"0px",children:[a.jsx("circle",{cx:"256",cy:"256",fill:"#F0F0F0",r:"256"}),a.jsxs("g",{children:[a.jsx("path",{d:"M244.87,256H512c0-23.106-3.08-45.49-8.819-66.783H244.87V256z",fill:"#D80027"}),a.jsx("path",{d:"M244.87,122.435h229.556c-15.671-25.572-35.708-48.175-59.07-66.783H244.87V122.435z",fill:"#D80027"}),a.jsx("path",{d:"M256,512c60.249,0,115.626-20.824,159.356-55.652H96.644C140.374,491.176,195.751,512,256,512z",fill:"#D80027"}),a.jsx("path",{d:"M37.574,389.565h436.852c12.581-20.529,22.338-42.969,28.755-66.783H8.819   C15.236,346.596,24.993,369.036,37.574,389.565z",fill:"#D80027"})]}),a.jsx("path",{d:"M118.584,39.978h23.329l-21.7,15.765l8.289,25.509l-21.699-15.765L85.104,81.252l7.16-22.037  C73.158,75.13,56.412,93.776,42.612,114.552h7.475l-13.813,10.035c-2.152,3.59-4.216,7.237-6.194,10.938l6.596,20.301l-12.306-8.941  c-3.059,6.481-5.857,13.108-8.372,19.873l7.267,22.368h26.822l-21.7,15.765l8.289,25.509l-21.699-15.765l-12.998,9.444  C0.678,234.537,0,245.189,0,256h256c0-141.384,0-158.052,0-256C205.428,0,158.285,14.67,118.584,39.978z M128.502,230.4  l-21.699-15.765L85.104,230.4l8.289-25.509l-21.7-15.765h26.822l8.288-25.509l8.288,25.509h26.822l-21.7,15.765L128.502,230.4z   M120.213,130.317l8.289,25.509l-21.699-15.765l-21.699,15.765l8.289-25.509l-21.7-15.765h26.822l8.288-25.509l8.288,25.509h26.822  L120.213,130.317z M220.328,230.4l-21.699-15.765L176.93,230.4l8.289-25.509l-21.7-15.765h26.822l8.288-25.509l8.288,25.509h26.822  l-21.7,15.765L220.328,230.4z M212.039,130.317l8.289,25.509l-21.699-15.765l-21.699,15.765l8.289-25.509l-21.7-15.765h26.822  l8.288-25.509l8.288,25.509h26.822L212.039,130.317z M212.039,55.743l8.289,25.509l-21.699-15.765L176.93,81.252l8.289-25.509  l-21.7-15.765h26.822l8.288-25.509l8.288,25.509h26.822L212.039,55.743z",fill:"#0052B4"})]}),VE={countryCode:"US",icon:BE,name:"US Dollar",shorthand:"USD",symbol:"$"},$E=[VE,{countryCode:"CA",icon:zE,name:"Canadian Dollar",shorthand:"CAD",symbol:"$"},{countryCode:"GB",icon:RE,name:"British Pound",shorthand:"GBP",symbol:"£"},{countryCode:"EU",icon:PE,name:"Euro",shorthand:"EUR",symbol:"€"},{countryCode:"JP",icon:UE,name:"Japanese Yen",shorthand:"JPY",symbol
198:"Â¥"},{countryCode:"AU",name:"Australian Dollar",shorthand:"AUD",symbol:"$"},{countryCode:"NZ",name:"New Zealand Dollar",shorthand:"NZD",symbol:"$"}];function WE(e){return $E.find(t=>t.shorthand.toLowerCase()===e.toLowerCase())??{countryCode:"US",icon:HE,name:e,shorthand:e,symbol:"$"}}function FE(e,t){return e.icon?a.jsx(e.icon,{size:D[t]}):a.jsx("img",{alt:e.shorthand,height:D[t],src:`https://flagsapi.com/${e.countryCode.toUpperCase()}/flat/64.png`,width:D[t]})}function YE(e){return FE(WE(e.currency),e.size)}const HE=e=>a.jsx(J7,{height:e.size,width:e.size});async function L3(e){const{client:t,fromTokenAddress:n,chain:i,fromAmount:r,to:s}=e;if(Number(r)===0)return{result:0};if(i.testnet===!0)throw new Error(`Cannot fetch price for a testnet (chainId: ${i.id})`);if(!Zr(n))throw new Error("Invalid fromTokenAddress. Expected a valid EVM contract address");const o=await Uo(t,n,i.id),c=(o==null?void 0:o.prices[s])||0;if(!o||c===0)throw new Error(`Error: Failed to fetch price for token ${n} on chainId: ${i.id}`);return{result:c*r}}function Uu(e,t){const[n,i]=_.useState(e);return _.useEffect(()=>{let r=!1;const s=setTimeout(()=>{r||i(e)},t);return()=>{r=!0,clearTimeout(s)}},[e,t]),n}const Sl={nativeToken:!0};function Oi(e){var t;return e&&("nativeToken"in e||((t=e.address)==null?void 0:t.toLowerCase())===Pt.toLowerCase()||(e==null?void 0:e.address)===ga)||!1}function yy(e){return Oi(e)?Pt:_e(e.address)}function j3(e){var i;const t=Uu(e.tokenAmount,500),n=pe({queryFn:()=>L3({chain:e.chain,client:e.client,fromAmount:Number(t),fromTokenAddress:yy(e.token),to:e.currency||"USD"}),queryKey:["cryptoToFiat",e.chain.id,yy(e.token),t,e.currency]});return n.isLoading?a.jsx(me,{height:ie.lg,width:"50px"}):(i=n.data)!=null&&i.result?a.jsx(A,{...e,trackingTight:!0,children:Fr(e.currency||"USD",n.data.result)}):null}function QE(){const e=ee();return a.jsx(b,{center:"both",flex:"row",style:{marginBottom:"-12px",marginTop:"-12px",position:"relative",width:"100%",zIndex:1e3},children:a.jsx(b,{center:"both",color:"secondaryText",flex:"row",style:{backgroundColor:e.colors.modalBg,border:`1px solid ${e.colors.borderColor}`,borderRadius:J.full,padding:"6px"},children:a.jsx(Lu,{height:D["sm+"],width:D["sm+"]})})})}function S3(e){const t=Ps(),n=t.length>0&&t.some(i=>i.id==="inApp"||Xe(i));return pe({enabled:n,queryFn:async()=>{var s;const i=t.find(o=>Xe(o)),r=i?{id:i.id,partnerId:(s=i.getConfig())==null?void 0:s.partnerId}:void 0;return f3({client:e.client,ecosystem:r})},queryKey:["profiles",t.map(i=>{var r;return`${i.id}-${(r=i.getAccount())==null?void 0:r.address}`})]})}function Dl(e){var f,m,y,g;const{client:t,address:n}=e,i=Ps(),r=S3({client:t}),s=i.find(p=>{var w,x;return((x=(w=p.getAccount())==null?void 0:w.address)==null?void 0:x.toLowerCase())===n.toLowerCase()}),o=s&&(s.id==="inApp"||Xe(s)||au(s))?(m=(f=r.data)==null?void 0:f.find(p=>!!p.details.email))==null?void 0:m.details.email:void 0,c=Po(s==null?void 0:s.id),l=Op({address:n,client:t}),u=n?l.data||Mn(n):"",d=D[e.iconSize||"md"];return a.jsx(b,{flex:"row",style:{justifyContent:"space-between"},children:a.jsxs(b,{center:"y",color:"secondaryText",flex:"row",gap:"sm",children:[s?a.jsx(ai,{client:e.client,id:s.id,size:d}):a.jsx(b,{borderColor:"borderColor",bg:"modalBg",flex:"row",center:"both",style:{borderStyle:"solid",borderWidth:"1px",borderRadius:J.full,width:`${d}px`,height:`${d}px`,position:"relative"},children:a.jsx(Ls,{style:{position:"absolute",inset:"25%"}})}),a.jsxs(b,{flex:"column",gap:"3xs",children:[e.label?a.jsx(A,{color:"secondaryText",size:"xs",children:e.label}):null,a.jsx(A,{color:"primaryText",size:e.textSize||"xs",children:u||Mn(e.address)}),r.isLoading?a.jsx(me,{height:ie.sm,width:"100px"}):o||(y=c==null?void 0:c.data)!=null&&y.name?a.jsx(A,{color:"secondaryText",size:"xs",children:o||((g=c==null?void 0:c.data)==null?void 0:g.name)}):null]})]})})}const w1=e=>{const{name:t}=bp(e.chain);return t?a.jsx(A,{color:e.color,size:e.size,style:e.style,children:e.short?i0(t):t}):a.jsx(me,{height:ie[e.size],width:"50px"})};function i0(e){const t=e.split(" "),n=new Set(["mainnet","testnet","chain"]);return t.filter(i=>!n.has(i.toLowerCase())).join(" ")}const Xr="data:image/svg+xml;charset=UTF-8,%3csvg width='15' height='14' viewBox='0 0 15 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7 8.04238e-07C5.1435 8.04238e-07 3.36301 0.737501 2.05025 2.05025C0.7375 3.36301 0 5.1435 0 7C0 7.225 -1.52737e-07 7.445 0.0349998 7.665C0.16385 9.0151 0.68213 10.2988 1.52686 11.3598C2.37158 12.4209 3.50637 13.2137 4.79326 13.642C6.0801 14.0702 7.4637 14.1153 8.7758 13.7719C10.0879 13.4285 11.2719 12.7113 12.184 11.7075C13.0961 10.7038 13.6969 9.4567 13.9135 8.1178C14.1301 6.7789 13.9531 5.406 13.4039 4.16587C12.8548 2.92574 11.9573 1.87184 10.8204 1.13228C9.6835 0.392721 8.3563 -0.000649196 7 8.04238e-07ZM7 1C8.581 1.00137 10.0975 1.62668 11.22 2.74V3.24C9.2438 2.55991 7.0956 2.56872 5.125 3.265C4.96758 3.1116 4.76997 3.00586 4.555 2.96H4.43C4.37 2.75 4.315 2.54 4.27 2.325C4.225 2.11 4.2 1.92 4.175 1.715C5.043 1.24658 6.0137 1.00091 7 1ZM5.5 3.935C7.3158 3.32693 9.2838 3.34984 11.085 4C10.8414 5.2703 10.3094 6.4677 9.53 7.5C9.312 7.4077 9.0707 7.3855 8.8395 7.4366C8.6083 7.4877 8.3988 7.6094 8.24 7.785C8.065 7.685 7.89 7.585 7.74 7.47C6.7307 6.7966 5.8877 5.9023 5.275 4.855C5.374 4.73221 5.4461 4.58996 5.4866 4.43749C5.5271 4.28502 5.5351 4.12575 5.51 3.97L5.5 3.935ZM3.5 2.135C3.5 2.24 3.53 2.35 3.55 2.455C3.595 2.675 3.655 2.89 3.715 3.105C3.52353 3.21838 3.36943 3.38531 3.2717 3.58522C3.17397 3.78513 3.13688 4.00927 3.165 4.23C2.37575 4.7454 1.67078 5.3795 1.075 6.11C1.19455 5.3189 1.47112 4.55966 1.88843 3.87701C2.30575 3.19437 2.85539 2.60208 3.505 2.135H3.5ZM3.5 9.99C3.30481 10.0555 3.13037 10.1714 2.9943 10.3259C2.85822 10.4804 2.76533 10.6681 2.725 10.87H2.405C1.59754 9.9069 1.1146 8.7136 1.025 7.46L1.08 7.365C1.70611 6.3942 2.52463 5.562 3.485 4.92C3.62899 5.0704 3.81094 5.179 4.01162 5.2345C4.2123 5.2899 4.42423 5.2901 4.625 5.235C5.2938 6.3652 6.208 7.3306 7.3 8.06C7.505 8.195 7.71
1985 8.32 7.925 8.44C7.9082 8.6312 7.9391 8.8237 8.015 9C7.1 9.7266 6.0445 10.256 4.915 10.555C4.78401 10.3103 4.57028 10.1201 4.31199 10.0184C4.05369 9.9167 3.76766 9.9102 3.505 10L3.5 9.99ZM7 12.99C5.9831 12.9903 4.98307 12.7304 4.095 12.235L4.235 12.205C4.43397 12.1397 4.61176 12.0222 4.74984 11.8648C4.88792 11.7074 4.98122 11.5158 5.02 11.31C6.2985 10.984 7.4921 10.3872 8.52 9.56C8.7642 9.7027 9.0525 9.75 9.3295 9.6927C9.6064 9.6355 9.8524 9.4778 10.02 9.25C10.7254 9.4334 11.4511 9.5275 12.18 9.53H12.445C11.9626 10.5673 11.1938 11.4451 10.2291 12.0599C9.2643 12.6747 8.144 13.0009 7 13V12.99ZM10.255 8.54C10.2545 8.3304 10.1975 8.1249 10.09 7.945C10.9221 6.8581 11.5012 5.5991 11.785 4.26C12.035 4.37667 12.2817 4.50667 12.525 4.65C13.0749 5.9495 13.1493 7.4012 12.735 8.75C11.9049 8.8142 11.0698 8.7484 10.26 8.555L10.255 8.54Z' fill='%23646D7A'/%3e%3c/svg%3e";function D3({token:e,client:t,size:n,style:i}){const r=ee(),s=Ge(e.chainId);return a.jsxs(b,{center:"y",flex:"row",gap:"sm",style:{flexWrap:"nowrap",...i},children:[a.jsxs(b,{style:{height:D[n],position:"relative",width:D[n]},children:[a.jsx(ZE,{client:t,size:n,token:e}),s.id!==1&&a.jsx(b,{style:{background:r.colors.borderColor,border:`1.5px solid ${r.colors.modalBg}`,borderRadius:"50%",bottom:"-2px",height:n==="lg"||n==="xl"?D.sm:D.xs,position:"absolute",right:"-2px",width:n==="lg"||n==="xl"?D.sm:D.xs},children:a.jsx(N3,{chain:s,client:t,size:n==="xl"||n==="lg"?"sm":"xs"})})]}),a.jsxs(b,{flex:"column",gap:"4xs",style:{minWidth:0},children:[a.jsx(A,{color:"primaryText",size:n==="xl"?"lg":"sm",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},weight:500,trackingTight:!0,children:e.name}),a.jsx(w1,{chain:s,client:t,short:!0,size:n==="xl"?"sm":"xs"})]})]})}function ZE(e){var s;const t=Ge(e.token.chainId),n=ko(t).data,i=ee(),r=_.useMemo(()=>{var o;return Oi(e.token)||e.token.address===Pt?(n==null?void 0:n.nativeCurrency.symbol)==="ETH"?"ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png":(o=n==null?void 0:n.icon)==null?void 0:o.url:e.token.iconUri},[e.token,(s=n==null?void 0:n.icon)==null?void 0:s.url,n==null?void 0:n.nativeCurrency.symbol]);return r?a.jsx(dt,{client:e.client,fallbackImage:a3,height:D[e.size],src:r,style:{borderRadius:"50%"},width:D[e.size]}):a.jsx(b,{style:{alignItems:"center",backgroundColor:i.colors.secondaryButtonBg,border:`1px solid ${i.colors.borderColor}`,borderRadius:"50%",display:"flex",height:`${D[e.size]}px`,justifyContent:"center",padding:R.xs,width:`${D[e.size]}px`},children:a.jsx(A,{color:"secondaryText",size:e.size==="xl"?"sm":"xs",style:{fontWeight:600},children:e.token.symbol.slice(0,1)})})}const N3=e=>{const{url:t}=Sf(e.chain);return a.jsx(b,{style:{alignItems:"center",display:"flex",flexShrink:0,position:"relative"},children:a.jsx(dt,{client:e.client,fallbackImage:Xr,height:D[e.size],src:qE({chainIconUrl:t,client:e.client}),width:D[e.size]})})},qE=e=>{const t=e.chainIconUrl;if(!t)return Xr;try{return qr({client:e.client,uri:t})}catch{return Xr}};function gy({client:e,token:t,amount:n,onClick:i,style:r,currency:s}){const o=Ge(t.chainId);return a.jsxs(GE,{onClick:()=>i(t),style:{display:"flex",justifyContent:"space-between",padding:`${R.md} ${R.md}`,...r},variant:"secondary",children:[a.jsx(D3,{client:e,size:"lg",style:{flex:1,maxWidth:"50%"},token:t}),a.jsx(b,{center:"y",color:"secondaryText",flex:"row",gap:"4xs",style:{flex:"1",flexWrap:"nowrap",justifyContent:"flex-end",maxWidth:"50%",minWidth:0},children:a.jsxs(b,{color:"secondaryText",flex:"column",gap:"3xs",style:{alignItems:"flex-end",minWidth:0,overflow:"hidden"},children:[a.jsx(A,{color:"primaryText",size:"sm",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:`${Number(n).toLocaleString(void 0,{maximumFractionDigits:6,minimumFractionDigits:0})} ${t.symbol}`}),a.jsx(j3,{currency:s,chain:o,client:e,color:"secondaryText",size:"sm",token:t,tokenAmount:n})]})})]})}const GE=nt(ue)(e=>({"&:hover":{background:ee().colors.secondaryButtonBg},background:"transparent",flexDirection:"row",flexWrap:"nowrap",gap:R.sm,justifyContent:"space-between",padding:R.sm,paddingRight:R.xs,transition:"background 200ms ease, transform 150ms ease",...e.style}));function KE(e){var r;const t=ee(),n=e.sender||(e.paymentMethod.type==="wallet"?(r=e.paymentMethod.payerWallet.getAccount())==null?void 0:r.address:void 0),i=e.receiver.toLowerCase()!==(n==null?void 0:n.toLowerCase());return a.jsxs(b,{children:[a.jsxs(b,{bg:"tertiaryBg",flex:"column",style:{border:`1px solid ${t.colors.borderColor}`,borderRadius:J.xl},children:[n&&a.jsx(b,{flex:"row",gap:"sm",px:"md",py:"md",style:{borderBottom:`1px dashed ${t.colors.borderColor}`}
198,children:a.jsx(Dl,{address:n,client:e.client,iconSize:"lg",textSize:"sm"})}),e.paymentMethod.type==="wallet"&&a.jsx(gy,{currency:e.currency,amount:e.fromAmount,client:e.client,onClick:()=>{},style:{background:"transparent",border:"none",borderRadius:0},token:e.paymentMethod.originToken}),e.paymentMethod.type==="fiat"&&a.jsxs(b,{center:"y",flex:"row",gap:"sm",px:"md",py:"md",style:{justifyContent:"space-between"},children:[a.jsxs(b,{center:"y",flex:"row",gap:"sm",children:[YE({currency:e.paymentMethod.currency,size:"lg"}),a.jsxs(b,{center:"y",flex:"column",gap:"3xs",children:[a.jsx(A,{color:"primaryText",size:"sm",weight:500,children:e.paymentMethod.currency}),a.jsx(A,{color:"secondaryText",size:"xs",children:e.paymentMethod.onramp.charAt(0).toUpperCase()+e.paymentMethod.onramp.slice(1)})]})]}),a.jsx(A,{color:"primaryText",size:"sm",children:e.fromAmount})]})]}),a.jsx(QE,{}),a.jsxs(b,{bg:"tertiaryBg",flex:"column",style:{border:`1px solid ${t.colors.borderColor}`,borderRadius:J.xl},children:[i&&a.jsx(b,{flex:"row",gap:"sm",px:"md",py:"md",style:{borderBottom:`1px dashed ${t.colors.borderColor}`},children:a.jsx(Dl,{address:e.receiver,client:e.client,iconSize:"lg",textSize:"sm"})}),e.modeInfo.mode==="direct_payment"&&a.jsxs(b,{center:"y",flex:"row",gap:"sm",p:"md",style:{justifyContent:"space-between"},children:[a.jsxs(b,{center:"y",flex:"column",gap:"3xs",style:{flex:1},children:[a.jsx(A,{color:"primaryText",size:"sm",weight:500,children:e.metadata.title||"Payment"}),e.metadata.description&&a.jsx(A,{color:"secondaryText",size:"xs",children:e.metadata.description})]}),a.jsxs(b,{center:"y",flex:"column",gap:"3xs",style:{alignItems:"flex-end"},children:[a.jsx(j3,{currency:e.currency,chain:Lt(e.toToken.chainId),client:e.client,color:"primaryText",size:"sm",token:e.toToken,tokenAmount:e.modeInfo.paymentInfo.amount}),a.jsxs(A,{color:"secondaryText",size:"xs",children:[e.modeInfo.paymentInfo.amount," ",e.toToken.symbol]})]})]}),e.modeInfo.mode==="fund_wallet"&&a.jsx(gy,{currency:e.currency,amount:e.toAmount,client:e.client,onClick:()=>{},style:{background:"transparent",border:"none",borderRadius:0},token:e.toToken}),e.modeInfo.mode==="transaction"&&a.jsx(JE,{client:e.client,paymentMethod:e.paymentMethod,transaction:e.modeInfo.transaction,metadata:e.metadata})]})]})}const JE=e=>{const t=ee(),n=v3({client:e.client,transaction:e.transaction,wallet:e.paymentMethod.payerWallet});return n.data?a.jsxs(b,{center:"y",flex:"row",gap:"sm",p:"md",style:{justifyContent:"space-between"},children:[a.jsxs(b,{center:"y",flex:"column",gap:"3xs",style:{flex:1},children:[a.jsx(A,{color:"primaryText",size:"sm",weight:500,children:e.metadata.title||"Transaction"}),e.metadata.description&&a.jsx(A,{color:"secondaryText",size:"xs",children:e.metadata.description})]}),a.jsx(b,{center:"y",flex:"column",gap:"3xs",style:{alignItems:"flex-end"},children:a.jsx(A,{color:"secondaryText",size:"xs",style:{backgroundColor:t.colors.secondaryButtonBg,borderRadius:R.sm,fontFamily:"monospace",padding:`${R.xs} ${R.sm}`,textAlign:"right"},children:n.data.functionInfo.functionName})})]}):a.jsxs(b,{center:"y",flex:"row",gap:"sm",p:"md",style:{justifyContent:"space-between"},children:[a.jsxs(b,{center:"y",flex:"column",gap:"3xs",style:{flex:1},children:[a.jsx("div",{style:{backgroundColor:t.colors.skeletonBg,borderRadius:R.xs,height:"16px",width:"120px"}}),e.metadata.description&&a.jsx("div",{style:{backgroundColor:t.colors.skeletonBg,borderRadius:R.xs,height:"12px",width:"80px"}})]}),a.jsx(b,{center:"y",flex:"column",gap:"3xs",style:{alignItems:"flex-end"},children:a.jsx("div",{style:{backgroundColor:t.colors.skeletonBg,borderRadius:R.sm,height:"24px",width:"100px"}})})]})};function A3({metadata:e,confirmButtonLabel:t,client:n,paymentMethod:i,preparedQuote:r,onConfirm:s,onBack:o,onError:c,currency:l,modeInfo:u}){var w,x;const d=ee(),f=()=>{try{s()}catch(I){c(I)}},m=xp(r.steps.flatMap(I=>[Lt(I.originToken.chainId),Lt(I.destinationToken.chainId)]),10),y=_.useMemo(()=>m.map(I=>I.data),[m]).filter(I=>!!I),p=(()=>{var I,E,j,C,T,v;switch(r.type){case"transfer":{const N=i.type==="wallet"?i.originToken:void 0;
198return N?{destinationAmount:pn(r.destinationAmount,N.decimals),destinationToken:N,estimatedTime:r.estimatedExecutionTimeMs,originAmount:pn(r.originAmount,N.decimals),originToken:N}:(c(new Error("Invalid payment method")),{destinationAmount:"0",destinationToken:void 0,estimatedTime:0,originAmount:"0",originToken:void 0})}case"buy":{const N=i.type==="wallet"?i:void 0;return N?{destinationAmount:pn(r.destinationAmount,((E=(I=r.steps[r.steps.length-1])==null?void 0:I.destinationToken)==null?void 0:E.decimals)??18),destinationToken:(j=r.steps[r.steps.length-1])==null?void 0:j.destinationToken,estimatedTime:r.estimatedExecutionTimeMs,originAmount:pn(r.originAmount,N.originToken.decimals),originToken:i.type==="wallet"?i.originToken:void 0}:(c(new Error("Invalid payment method")),{destinationAmount:"0",destinationToken:void 0,estimatedTime:0,originAmount:"0",originToken:void 0})}case"sell":{const N=i.type==="wallet"?i:void 0;return N?{destinationAmount:pn(r.destinationAmount,((T=(C=r.steps[r.steps.length-1])==null?void 0:C.destinationToken)==null?void 0:T.decimals)??18),destinationToken:(v=r.steps[r.steps.length-1])==null?void 0:v.destinationToken,estimatedTime:r.estimatedExecutionTimeMs,originAmount:pn(r.originAmount,N.originToken.decimals),originToken:i.type==="wallet"?i.originToken:void 0}:(c(new Error("Invalid payment method")),{destinationAmount:"0",destinationToken:void 0,estimatedTime:0,originAmount:"0",originToken:void 0})}case"onramp":{const N=i.type==="fiat"?i:void 0;return N?{destinationAmount:pn(r.destinationAmount,r.destinationToken.decimals),destinationToken:r.destinationToken,estimatedTime:void 0,originAmount:Fr(N.currency,Number(r.currencyAmount)),originToken:void 0}:(c(new Error("Invalid payment method")),{destinationAmount:"0",destinationToken:void 0,estimatedTime:0,originAmount:"0",originToken:void 0})}default:throw new Error(`Unsupported bridge prepare type: ${r.type}`)}})();return a.jsxs(b,{flex:"column",fullHeight:!0,px:"md",pb:"md",pt:"md+",children:[a.jsx(Me,{onBack:o,title:e.title||"Payment Details"}),a.jsx(U,{y:"lg"}),a.jsxs(b,{flex:"column",children:[a.jsxs(b,{flex:"column",children:[p.destinationToken&&a.jsx(KE,{currency:l,metadata:e,modeInfo:u,client:n,fromAmount:p.originAmount,paymentMethod:i,receiver:r.intent.receiver,sender:r.intent.sender||((x=(w=i.payerWallet)==null?void 0:w.getAccount())==null?void 0:x.address),toAmount:p.destinationAmount,toToken:p.destinationToken}),a.jsx(U,{y:"md"}),a.jsxs(b,{flex:"row",gap:"sm",children:[a.jsxs(b,{flex:"row",gap:"xs",style:{flex:1,justifyContent:"center"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Estimated Time"}),a.jsx(A,{color:"primaryText",size:"sm",children:p.estimatedTime?`~${Math.ceil(p.estimatedTime/6e4)} min`:"~2 min"})]}),r.steps.length>1?a.jsxs(b,{flex:"row",gap:"xs",style:{flex:1,justifyContent:"center"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Route Length"}),a.jsxs(A,{color:"primaryText",size:"sm",children:[r.steps.length," step",r.steps.length!==1?"s":""]})]}):null]})]}),r.steps.length>1&&a.jsxs(b,{flex:"column",children:[a.jsx(U,{y:"sm"}),a.jsx(b,{flex:"column",gap:"md+",style:{backgroundColor:d.colors.tertiaryBg,border:`1px solid ${d.colors.borderColor}`,borderRadius:J.xl,padding:`${R.md} ${R.md}`},children:r.steps.map((I,E)=>{var j,C,T;return a.jsx(b,{flex:"column",gap:"sm",children:a.jsxs(b,{flex:"row",gap:"sm",style:{alignItems:"center"},children:[a.jsx(b,{center:"both",flex:"row",style:{backgroundColor:d.colors.modalBg,border:`1px solid ${d.colors.borderColor}`,borderRadius:J.full,color:d.colors.secondaryText,flexShrink:0,fontWeight:"bold",height:`${D.lg}px`,width:`${D.lg}px`},children:a.jsx(A,{color:"secondaryText",size:"sm",children:E+1})}),a.jsx(b,{center:"y",flex:"row",gap:"sm",style:{flex:1},children:a.jsxs(b,{flex:"column",gap:"3xs",style:{flex:1},children:[a.jsx(A,{color:"primaryText",size:"sm",weight:500,children:I.destinationToken.chainId!==I.originToken.chainId?a.jsxs(a.Fragment,{children:["Bridge"," ",I.originToken.symbol===I.destinationToken.symbol?I.originToken.symbol:`${I.originToken.symbol} to ${I.destinationToken.symbol}`]}):a.jsxs(a.Fragment,{children:["Swap ",I.originToken.symbol," to"," ",I.destinationToken.symbol]})}),a.jsx(A,{color:"secondaryText",size:"xs",children:I.originToken.chainId!==I.destinationToken.chainId?a.jsxs(a.Fragment,{children:[(j=y.find(v=>v.chainId===I.originToken.chainId))==null?void 0:j.name," ","to"," ",(C=y.find(v=>v.chainId===I.destinationToken.chainId))==null?void 0:C.name]}):(T=y.find(v=>v.chainId===I.originToken.chainId))==null?void 0:T.name})]})})]})},`step-${E}-${I.originToken.address}-${I.destinationToken.address}`)})})]}),a.jsx(U,{y:"md"}),a.jsx(b,{flex:"column",gap:"sm",children:a.jsx(ue,{fullWidth:!0,onClick:f,variant:"primary",style:{borderRadius:J.full},children:t||"Confirm Payment"})})]})]})}function XE(e){var u;const{destinationToken:t,destinationAmount:n,client:i,payerWallet:r,supportedTokens:s}=e,o=ft(),c=r||o,l=pe({enabled:!!c,queryFn:async()=>{var j;const d=c==null?void 0:c.getAccount();if(!c||!d)throw new Error("No wallet connected");const f=new URL(`${St("bridge")}/v1/buy/quote/${d.address}`);f.searchParams.set("destinationChainId",t.chainId.toString()),f.searchParams.set("destinationTokenAddress",t.address),f.searchParams.set("amount",tr(n,t.decimals).toString()),f.searchParams.set("includeQuotes","false");const y=await hn(i)(f.toString());if(!y.ok){const C=await y.json();throw new Ot({code:C.code||"UNKNOWN_ERROR",correlationId:C.correlationId||void 0,message:C.message||y.statusText,statusCode:y.status})}const{data:g}=await y.json(),w=g.map(C=>({balance:BigInt(C.balance),originToken:C.token,payerWallet:c,type:"wallet",quote:C.quote})).filter(C=>!!C.originToken.prices.USD).sort((C,T)=>Number.parseFloat(mi(T.balance,T.originToken.decimals))*(T.originToken.prices.USD||1)-Number.parseFloat(mi(C.balance,C.originToken.decimals))*(C.originToken.prices.USD||1)),x=s?Object.keys(s).flatMap(C=>{var T;return((T=s[Number(C)])==null?void 0:T.map(v=>({chainId:Number(C),address:v.address})))??[]}):[],I=s?w.filter(C=>x.find(T=>T.chainId===C.originToken.chainId&&T.address.toLowerCase()===C.originToken.address.toLowerCase())):w,E=(((j=t.prices)==null?void 0:j.USD)??0)*Number(n);return I.map(C=>{var N;const v=(((N=C.originToken.prices)==null?void 0:N.USD)??0)*Number(mi(C.balance,C.originToken.decimals))>=E;return{...C,action:"buy",hasEnoughBalance:v}})},queryKey:["payment-methods",t.chainId,t.address,n,(u=r==null?void 0:r.getAccount())==null?void 0:u.address,s],refetchOnWindowFocus:!1,staleTime:5*60*1e3});return{data:l.data||[],error:l.error,isError:l.isError,isLoading:l.isLoading,isSuccess:l.isSuccess,refetch:l.refetch}}function O3(e){const t=jt(),n=Ps(),i=e.wallets||Du({appMetadata:e.appMetadata,chains:e.chains}).filter(s=>s.id!=="inApp"),r=d1({size:"compact",wallets:i,welcomeScreen:void 0});return a.jsx(C3,{accountAbstraction:e.accountAbstraction,auth:void 0,chain:e.chain||t,chains:e.chains,client:e.client,connectLocale:e.connectLocale,hideHeader:e.isEmbed,isOpen:!0,meta:{showThirdwebBranding:!1},modalHeader:{onBack:e.onBack,title:"Connect"},onClose:()=>{},onConnect:s=>{e.onSelect(s)},recommendedWallets:e.recommendedWallets,screenSetup:r,setModalVisibility:()=>{},shouldSetActive:!1,showAllWallets:e.showAllWallets,size:"compact",walletConnect:e.walletConnect,walletIdsToHide:n.map(s=>s.id),wallets:i,welcomeScreen:void 0})}function eT(e,t){return Mf({queries:["coinbase","stripe","transak","rampnow"].map(r=>({...t,enabled:!!e,queryFn:async()=>
198{if(!e)throw new Error("No params provided");const s=await Uo(e.client,e.tokenAddress,e.chainId),o=tr(e.amount,s.decimals);return kf({amount:o,chainId:e.chainId,client:e.client,currency:e.currency||"USD",onramp:r,receiver:e.receiver,tokenAddress:e.tokenAddress,country:e.country})},queryKey:["onramp-prepare",r,e],retry:!1}))})}const tT=[{description:"Fast and secure payments",iconUri:"https://i.ibb.co/LDJ3Rk2t/Frame-5.png",id:"coinbase",name:"Coinbase"},{description:"Trusted payment processing",iconUri:"https://i.ibb.co/CpgQC2Lf/images-3.png",id:"stripe",name:"Stripe"},{description:"Global payment solution",iconUri:"https://i.ibb.co/Xx2r882p/Transak-official-symbol-1.png",id:"transak",name:"Transak"},{description:"Cards, bank transfers and more",iconUri:"https://app.rampnow.io/favicon.ico",id:"rampnow",name:"Rampnow"}];function nT({onProviderSelected:e,client:t,toChainId:n,toTokenAddress:i,toAddress:r,toAmount:s,currency:o,country:c}){const l=eT({amount:s||"0",chainId:n,client:t,currency:o||"USD",receiver:xo(r),tokenAddress:xo(i),country:c}),u=_.useMemo(()=>l.map(f=>f.data).filter(f=>!!f),[l]),d=l.some(f=>f.isLoading);return l.every(f=>f.isError)?a.jsx(b,{center:"both",flex:"column",style:{minHeight:"200px",flexGrow:1},children:a.jsx(A,{color:"secondaryText",size:"sm",children:"No quotes available"})}):a.jsx(b,{flex:"column",gap:"xs",style:{flexGrow:1},children:d?a.jsxs(b,{center:"both",flex:"column",style:{flexGrow:1,paddingBottom:R.lg},px:"md",children:[a.jsx(Qe,{color:"secondaryText",size:"xl"}),a.jsx(U,{y:"lg"}),a.jsx(A,{center:!0,color:"primaryText",size:"lg",weight:600,trackingTight:!0,children:"Searching Providers"}),a.jsx(U,{y:"xs"}),a.jsx(A,{center:!0,color:"secondaryText",size:"sm",multiline:!0,style:{textWrap:"pretty"},children:"Searching for the best providers for this payment"})]}):u.sort((f,m)=>f.currencyAmount-m.currencyAmount).map(f=>{const m=tT.find(y=>y.id===f.intent.onramp);return m?a.jsx(ue,{fullWidth:!0,onClick:()=>e(m.id),style:{borderRadius:J.lg,textAlign:"left",padding:`${R.md}`},variant:"secondary",children:a.jsxs(b,{flex:"row",gap:"sm",style:{alignItems:"center",width:"100%"},children:[a.jsx(dt,{alt:m.name,client:t,height:D.lg,src:m.iconUri,width:D.lg,style:{borderRadius:J.full}}),a.jsx(b,{flex:"column",gap:"3xs",style:{flex:1},children:a.jsx(A,{color:"primaryText",size:"md",weight:500,children:m.name})}),a.jsxs(b,{flex:"column",gap:"3xs",style:{alignItems:"flex-end"},children:[a.jsx(A,{color:"primaryText",size:"sm",style:{fontWeight:500},children:Fr(o||"USD",f.currencyAmount)}),a.jsxs(A,{color:"secondaryText",size:"xs",children:[Bo(Number(mi(f.destinationAmount,f.destinationToken.decimals)),4)," ",f.destinationToken.symbol]})]})]})},m.id):null})})}function iT({paymentMethod:e,client:t,onPaymentMethodSelected:n,currency:i}){const r=ee(),s=e.hasEnoughBalance,o=e.originToken.prices[i||"USD"];return a.jsx(ue,{disabled:!s,fullWidth:!0,onClick:()=>n(e),style:{backgroundColor:r.colors.tertiaryBg,borderRadius:J.lg,padding:`${R.md} ${R.md}`,textAlign:"left"},variant:"secondary",children:a.jsxs(b,{flex:"row",gap:"md",style:{alignItems:"center",width:"100%"},children:[a.jsx(D3,{client:t,size:"lg",style:{maxWidth:"50%"},token:e.originToken}),a.jsxs(b,{flex:"column",gap:"3xs",style:{alignItems:"flex-end",flex:1},children:[o&&a.jsx(A,{color:"primaryText",size:"sm",style:{fontWeight:500,textWrap:"nowrap"},children:Fr(i||"USD",Number(pn(e.balance,e.originToken.decimals))*o)}),a.jsx(b,{flex:"row",gap:"3xs",children:a.jsxs(A,{color:s?"success":"danger",size:"xs",children:[pn(e.balance,e.originToken.decimals)," ",e.originToken.symbol]})})]})]})},`${e.originToken.address}-${e.originToken.chainId}`)}function rT({paymentMethods:e,paymentMethodsLoading:t,client:n,onPaymentMethodSelected:i,onBack:r,destinationToken:s,destinationAmount:o,feePayer:c,currency:l}){const u=ee();return t?a.jsx(b,{flex:"column",gap:"xs",pb:"lg",style:{maxHeight:"400px",overflowY:"auto",scrollbarWidth:"none"},children:new Array(10).fill(0).map((d,f)=>a.jsx(b,{style:{backgroundColor:u.colors.tertiaryBg,borderRadius:J.lg,padding:`${R.md} ${R.md}`},children:a.jsxs(b,{flex:"row",gap:"md",style:{alignItems:"center",width:"100%"},children:[a.jsxs(b,{center:"y",flex:"row",gap:"sm",style:{maxWidth:"50%"},children:[a.jsx("div",{style:{backgroundColor:u.colors.skeletonBg,borderRadius:"50%",height:"32px",width:"32px"}}),a.jsxs(b,{flex:"column",gap:"3xs",children:[a.jsx(me,{height:"14px",width:"60px"}),a.jsx(me,{height:"12px",width:"40px"})]})]}),a.jsxs(b,{flex:"column",gap:"3xs",style:{alignItems:"flex-end",flex:1},children:[a.jsx(me,{height:"16px",width:"80px"}),a.jsxs(b,{flex:"row",gap:"3xs",children:[a.jsx(me,{height:"12px",width:"50px"}),a.jsx(me,{height:"12px",width:"40px"})]})]})]})},f))}):e.length===0?a.jsxs(b,{center:"both",flex:"column",style:{minHeight:"250px"},children:[a.jsx(A,{center:!0,color:"primaryText",size:"md",children:"No available tokens found for this wallet"}),a.jsx(U,{y:"sm"}),a.jsx(A,{center:!0,color:"secondaryText",size:"sm",children:"Try connecting a different wallet or pay with card"}),a.jsx(U,{y:"lg"}),a.jsx(ue,{onClick:r,variant:"primary",children:"Select another payment method"})]}):a.jsx(b,{flex:"column",gap:"xs",pb:"lg",style:{maxHeight:"400px",overflowY:"auto",scrollbarWidth:"none"},children:e.filter(d=>d.type==="wallet").map(d=>a.jsx(iT,{client:n,destinationAmount:o,destinationToken:s,feePayer:c,onPaymentMethodSelected:i,paymentMethod:d,currency:l},`${d.originToken.address}-${d.originToken.chainId}`))})}const sT=e=>a.jsxs("svg",{fill:"none",height:e.size,role:"presentation",stroke:e.color??"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1",viewBox:"0 0 24 24",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{height:"14",rx:"2",width:"20",x:"2",y:"5"}),a.jsx("line",{x1:"2",x2:"22",y1:"10",y2:"10"})]});function oT({connectedWallets:e,client:t,onWalletSelected:n,onFiatSelected:i,onConnectWallet:r,paymentMethods:s=["crypto","card"]}){const o=ee();return a.jsxs(b,{flex:"column",gap:"xs",children:[s.includes("crypto")&&a.jsxs(a.Fragment,{children:[e.length>0&&a.jsx(b,{flex:"column",gap:"sm",children:e.map(c=>{const l=c.getAccount();return l!=null&&l.address?a.jsx(ue,{fullWidth:!0,onClick:()=>n(c),style:{borderRadius:J.md,justifyContent:"space-between",padding:`${R.md} ${R.md}`},variant:"secondary",children:a.jsx(Dl,{address:l==null?void 0:l.address,client:t,iconSize:"lg",textSize:"sm"})},`${c.id}-${l.address}`):null})}),a.jsx(ue,{fullWidth:!0,onClick:r,style:{borderRadius:J.md,height:"auto",padding:`${R.md} ${R.md}`,textAlign:"left"},variant:"secondary",children:a.jsxs(b,{flex:"row",gap:"md",style:{alignItems:"center",width:"100%"},children:[a.jsx(b,{style:{alignItems:"center",border:`1px dashed ${o.colors.secondaryText}`,borderRadius:J.full,display:"flex",height:`${D.lg}px`,justifyContent:"center",width:`${D.lg}px`},children:a.jsx(ju,{color:o.colors.secondaryText,height:D["sm+"],width:D["sm+"]})}),a.jsxs(b,{flex:"column",gap:"3xs",style:{flex:1},children:[a.jsx(A,{color:"primaryText",size:"sm",children:"Connect a Wallet"}),a.jsx(A,{color:"secondaryText",size:"xs",children:"Pay with any web3 wallet"})]})]})})]}),s.includes("card")&&a.jsx(ue,{fullWidth:!0,onClick:i,style:{borderRadius:J.md,height:"auto",padding:`${R.md} ${R.md}`,textAlign:"left"},variant:"secondary",children:a.jsxs(b,{flex:"row",gap:"md",style:{alignItems:"center",width:"100%"},children:[a.jsx(sT,{color:o.colors.secondaryText,size:D.lg}),a.jsxs(b,{flex:"column",gap:"3xs",style:{flex:1},children:[a.jsx(A,{color:"primaryText",size:"sm",children:"Pay with Card"}),a.jsx(A,{color:"secondaryText",size:"xs",children:"Onramp and pay in one step"})]})]})})]})}function k3({destinationToken:e,client:t,destinationAmount:n,receiverAddress:i,onPaymentMethodSelected:r,onError:s,onBack:o,connectOptions:c,connectLocale:l,paymentMethods:u,supportedTokens:d,feePayer:f,currency:m,country:y}){var z,k;const g=Ps(),p=ft(),w=u.length===1&&u[0]==="card"?{type:"fiatProviderSelection"}:{type:"walletSelection"},[x,I]=_.useState(w),E=x.type==="tokenSelection"?x.selectedWallet:p,{data:j,isLoading:C,error:T}=XE({client:t,destinationAmount:n,destinationToken:e,payerWallet:E,supportedTokens:d});_.useEffect(()=>{T&&s(T)},[T,s]);const v=B=>{try{r(B)}catch(W){s(W)}},N=B=>{ot({client:t,event:"ub:ui:token_selection"}),I({selectedWallet:B,type:"tokenSelection"})},M=async()=>{I({type:"walletConnection"})},S=()=>{ot({client:t,event:"ub:ui:fiat_provider_selection"}),I({type:"fiatProviderSelection"})},L=()=>{I({type:"walletSelection"})},O=B=>{var F;if(!(i||((F=E==null?void 0:E.getAccount())==null?void 0:F.address))){s(new Error("No recipient address available for fiat payment"));return}v({currency:m||"USD",onramp:B,payerWallet:E,type:"fiat"})},P=()=>{switch(x.type){case"walletSelection":return"Choose Payment Method";case"tokenSelection":return"Select Token";case"fiatProviderSelection":return"Select Payment Provider";case"walletConnection":return"Connect Wallet"}},$=()=>{if(u.length===1&&u[0]==="card")return o;switch(x.type){case"walletSelection":return o;case"tokenSelection":case"fiatProviderSelection":case"walletConnection":return L}};if(x.type==="walletConnection"){const B=e?Lt(e.chainId):void 0,W=B?[B,...(c==null?void 0:c.chains)||[]]:c==null?void 0:c.chains;return a.jsx(O3,{accountAbstraction:c==null?void 0:c.accountAbstraction,appMetadata:c==null?void 0:c.appMetadata,chain:B||(c==null?void 0:c.chain),chains:W,client:t,connectLocale:l,hiddenWallets:[],isEmbed:!1,onBack:L,onSelect:N,recommendedWallets:c==null?void 0:c.recommendedWallets,showAllWallets:(c==null?void 0:c.showAllWallets)===void 0?!0:c==null?void 0:c.showAllWallets,walletConnect:c==null?void 0:c.walletConnect,wallets:(z=c==null?void 0:c.wallets)==null?void 0:z.filter(V=>V.id!=="inApp")})}return a.jsxs(b,{flex:"column",px:"md",pt:"md+",children:[a.jsx(Me,{onBack:$(),title:P()}),a.jsx(U,{y:"lg"}),a.jsxs(b,{flex:"column",style:{minHeight:"300px"},children:[x.type==="walletSelection"&&a.jsx(oT,{client:t,connectedWallets:g,onConnectWallet:M,onFiatSelected:S,onWalletSelected:N,paymentMethods:u}),x.type==="tokenSelection"&&a.jsx(rT,{client:t,destinationAmount:tr(n,e.decimals),destinationToken:e,feePayer:f,onBack:L,onPaymentMethodSelected:v,paymentMethods:j,paymentMethodsLoading:C,currency:m}),x.type==="fiatProviderSelection"&&a.jsx(nT,{country:y,client:t,onProviderSelected:O,toAddress:i||((k=E==null?void 0:E.getAccount())==null?void 0:k.address)||"",toAmount:n,toChainId:e.chainId,toTokenAddress:e.address,currency:m})]})]})}function _1(e){const[t,n]=_.useState(!1),i=_.useCallback(async()=>{await navigator.clipboard.writeText(e),n(!0)},[e]);return _.useEffect(()=>{let r=null;return t&&(r=window.setTimeout(()=>{n(!1)},1500)),()=>{r&&window.clearTimeout(r)}},[t]),{hasCopied:t,onCopy:i}}const Nl=e=>a.jsx(Bx,{delayDuration:200,children:a.jsxs(Vx,{children:[a.jsx($x,{asChild:!0,children:e.children}),a.jsx(Wx,{children:a.jsxs(cT,{align:e.align||"center",side:e.side||"top",sideOffset:e.sideOffset||6,children:[e.tip,a.jsx(lT,{})]})})]})}),aT=qt`
199from {
200  opacity: 0;
201  transform: translateY(2px);
202}
203to {
204  opacity: 1;
205  transform: translateY(0);
206}
207`,cT=nt(Fx)(e=>{const t=ee();return{animation:`${aT} 200ms cubic-bezier(0.16, 1, 0.3, 1)`,background:t.colors.tooltipBg,borderRadius:J.sm,boxShadow:ep.sm,color:t.colors.tooltipText,fontSize:ie.sm,lineHeight:1.5,maxWidth:"300px",padding:`${R.xs} ${R.sm}`,userSelect:"none",willChange:"transform, opacity",zIndex:999999999999999}}),lT=nt(Yx)(()=>({fill:ee().colors.tooltipBg})),js=e=>{const{hasCopied:t,onCopy:n}=_1(e.text),i=e.hasCopied||t;return a.jsx(ue,{onClick:n,variant:"ghost-solid",style:{alignItems:"center",display:"flex",padding:2,justifyContent:"center",borderRadius:J.sm},children:a.jsx(Nl,{align:e.align,side:e.side,tip:e.tip,children:a.jsx("div",{children:a.jsx(b,{center:"both",color:i?"success":"secondaryText",flex:"row",children:i?a.jsx(Us,{className:"tw-check-icon",width:e.iconSize||16,height:e.iconSize||16}):a.jsx(aw,{className:"tw-copy-icon",width:e.iconSize||16,height:e.iconSize||16})})})})})};function uT(e,t){var n;return e.type==="onramp"?e.id:(n=t.transactions[t.transactions.length-1])==null?void 0:n.transactionHash}function dT(e,t){return pe({enabled:!0,queryFn:async()=>
207{if(e.type==="onramp"&&t.type==="onramp")return{amountPaid:`${t.currencyAmount} ${t.currency}`,amountReceived:`${pn(t.destinationAmount,t.destinationToken.decimals)} ${t.destinationToken.symbol}`,chain:await Ht(Lt(t.destinationToken.chainId)),destinationToken:t.destinationToken,id:t.id,label:"Onramp Payment",type:"paymentId"};if((e.type==="buy"||e.type==="sell"||e.type==="transfer")&&e.transactions.length>0){const i=e.transactions[e.transactions.length-1];if(i){const[r,s]=await Promise.all([Ht(Ge(e.destinationToken.chainId)),Ht(Ge(e.originToken.chainId))]);return{amountPaid:`${pn(e.originAmount,e.originToken.decimals)} ${e.originToken.symbol}`,amountReceived:`${pn(e.destinationAmount,e.destinationToken.decimals)} ${e.destinationToken.symbol}`,chain:r,destinationChain:r,destinationToken:e.destinationToken,id:i.transactionHash,label:"Transaction",originChain:s,originToken:e.originToken,type:"transactionHash"}}}return null},queryKey:["transaction-info",e.type,uT(t,e)],staleTime:5*60*1e3})}function hT({status:e,preparedQuote:t}){const n=ee(),{data:i,isPending:r}=dT(e,t);return r?a.jsx(me,{height:"200px",style:{borderRadius:J.lg}}):i?a.jsxs(b,{flex:"column",gap:"sm",style:{backgroundColor:n.colors.tertiaryBg,border:`1px solid ${n.colors.borderColor}`,borderRadius:J.lg,padding:R.md},children:[a.jsxs(b,{flex:"row",gap:"sm",py:"4xs",style:{alignItems:"center",justifyContent:"space-between"},children:[a.jsx(A,{color:"primaryText",size:"sm",weight:500,children:i.label}),a.jsx(b,{style:{backgroundColor:n.colors.modalBg,borderRadius:J.full,border:`1px solid ${n.colors.borderColor}`,padding:`${R["3xs"]} ${R.xs}`},children:a.jsx(A,{style:{color:n.colors.success,fontSize:10,letterSpacing:"0.025em"},children:"COMPLETED"})})]}),a.jsx(He,{}),i.amountPaid&&a.jsxs(b,{center:"y",flex:"row",style:{justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Amount Paid"}),a.jsx(A,{color:"primaryText",size:"sm",children:i.amountPaid})]}),i.amountReceived&&a.jsxs(b,{center:"y",flex:"row",style:{justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Amount Received"}),a.jsx(A,{color:"primaryText",size:"sm",children:i.amountReceived})]}),i.originChain&&a.jsxs(b,{center:"y",flex:"row",style:{justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Origin Chain"}),a.jsx(A,{color:"primaryText",size:"sm",children:i0(i.originChain.name)})]}),a.jsxs(b,{center:"y",flex:"row",style:{justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Destination Chain"}),a.jsx(A,{color:"primaryText",size:"sm",children:i0(i.chain.name)})]}),i.type==="paymentId"&&a.jsxs(b,{center:"y",flex:"row",style:{justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Payment ID"}),a.jsxs(b,{flex:"row",gap:"3xs",center:"y",children:[a.jsx(js,{text:i.id,iconSize:12,tip:"Copy Payment ID"}),a.jsx(A,{color:"primaryText",weight:400,size:"sm",children:_l(i.id)})]})]}),e.transactions.map(s=>{const o=`https://thirdweb.com/${s.chainId}/tx/${s.transactionHash}`;return a.jsxs(b,{center:"y",flex:"row",style:{justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Transaction Hash"}),a.jsxs(b,{flex:"row",gap:"3xs",center:"y",children:[a.jsx(js,{text:s.transactionHash,iconSize:12,tip:"Copy Transaction Hash"}),a.jsx(Gr,{href:o,target:"_blank",rel:"noreferrer",color:"primaryText",hoverColor:"accentText",weight:400,size:"sm",children:_l(s.transactionHash)})]})]},s.transactionHash)})]},i.id):null}function fT({preparedQuote:e,completedStatuses:t,onBack:n,windowAdapter:i}){return a.jsxs(b,{flex:"column",fullHeight:!0,px:"md",children:[a.jsx(U,{y:"md+"}),a.jsx(Me,{onBack:n,title:"Payment Receipt"}),a.jsx(U,{y:"md+"}),a.jsx(b,{flex:"column",gap:"lg",scrollY:!0,style:{maxHeight:"500px",minHeight:"400px"},children:a.jsx(b,{flex:"column",gap:"sm",children:t.map((r,s)=>a.jsx(hT,{preparedQuote:e,status:r,windowAdapter:i},`${r.type}-${s}`))})}),a.jsx(U,{y:"md+"})]})}function z3({preparedQuote:e,completedStatuses:t,onDone:n,windowAdapter:i,client:r,hasPaymentId:s=!1,showContinueWithTx:o,type:c}){const l=ee(),[u,d]=_.useState("success"),f=ur(),m=_.useRef(!1);if(_.useEffect(()=>{m.current||(m.current=!0,(e.type==="buy"||e.type==="sell")&&ot({chainId:e.intent.originChainId,client:r,event:"ub:ui:success_screen",fromToken:e.intent.originTokenAddress,toChainId:e.intent.destinationChainId,toToken:e.intent.destinationTokenAddress,walletAddress:e.intent.sender}),e.type==="transfer"&&ot({chainId:e.intent.chainId,client:r,event:"ub:ui:success_screen",fromToken:e.intent.tokenAddress,toChainId:e.intent.chainId,toToken:e.intent.tokenAddress,walletAddress:e.intent.sender}),f.invalidateQueries({queryKey:["bridge/v1/wallets"]}),f.invalidateQueries({queryKey:["walletBalance"]}),f.invalidateQueries({queryKey:["payment-methods"]}))},[r,e,f]),u==="detail")return a.jsx(fT,{completedStatuses:t,onBack:()=>d("success"),preparedQuote:e,windowAdapter:i});const y=c==="swap-success"?"Swap Successful":"Payment Successful",g=c==="swap-success"?"Your token swap has been completed successfully.":"Your payment has been completed successfully.";return a.jsxs(b,{flex:"column",fullHeight:!0,px:"md",pb:"md",pt:"md+",children:[a.jsx(U,{y:"3xl"}),a.jsxs(b,{center:"x",flex:"column",gap:"md",children:[a.jsx(b,{center:"both",flex:"row",style:{animation:"successBounce 0.6s ease-out",border:`2px solid ${l.colors.success}
207`,borderRadius:"50%",height:"64px",marginBottom:"16px",width:"64px"},children:a.jsx(Us,{color:l.colors.success,height:D.xl,style:{animation:"checkAppear 0.3s ease-out 0.3s both"},width:D.xl})}),a.jsxs("div",{children:[a.jsx(A,{center:!0,color:"primaryText",size:"xl",weight:600,trackingTight:!0,style:{marginBottom:R.xxs},children:y}),a.jsx(A,{center:!0,color:"secondaryText",size:"sm",children:s?"You can now close this page and return to the application.":o?"Click continue to execute your transaction.":g})]})]}),a.jsx(U,{y:"3xl"}),a.jsxs(b,{flex:"column",gap:"sm",style:{width:"100%"},children:[a.jsx(ue,{fullWidth:!0,onClick:()=>d("detail"),variant:"secondary",children:"View Transaction Receipt"}),!s&&a.jsx(ue,{fullWidth:!0,onClick:n,variant:"accent",children:o?"Continue":"Done"})]}),a.jsx("style",{children:`
208          @keyframes successBounce {
209            0% {
210              transform: scale(0.3);
211              opacity: 0;
212            }
213            50% {
214              transform: scale(1.05);
215            }
216            70% {
217              transform: scale(0.9);
218            }
219            100% {
220              transform: scale(1);
221              opacity: 1;
222            }
223          }
224
225          @keyframes checkAppear {
226            0% {
227              transform: scale(0);
228              opacity: 0;
229            }
230            100% {
231              transform: scale(1);
232              opacity: 1;
233            }
234          }
235        `})]})}function mT(e){const{enabled:t=!0,type:n,...i}=e;return pe({enabled:t&&!!i.client,gcTime:5*60*1e3,queryFn:async()=>{switch(n){case"buy":return{type:"buy",...await f9(i)};case"sell":return{type:"sell",...await g9(i)};case"transfer":return{type:"transfer",...await w9(i)};case"onramp":return{type:"onramp",...await kf(i)};default:throw new Error(`Unsupported bridge prepare type: ${n}`)}},queryKey:["bridge-prepare",n,Zt(i)],retry:(r,s)=>{if(s instanceof Ot){const o=s;if(o.statusCode&&o.statusCode>=400&&o.statusCode<500)return!1}return r<2},retryDelay:r=>Math.min(1e3*2**r,1e4),staleTime:2*60*1e3})}function P3({destinationToken:e,paymentMethod:t,amount:n,sender:i,receiver:r,client:s,onQuoteReceived:o,onError:c,purchaseData:l,paymentLinkId:u,feePayer:d,mode:f}){const m=yT({amount:n,client:s,destinationToken:e,feePayer:d,paymentLinkId:u,paymentMethod:t,purchaseData:l,receiver:r,sender:i}),y=mT(m);return _.useEffect(()=>{y.data&&o(y.data,m)},[y.data,o,m]),_.useEffect(()=>{y.error&&c(y.error)},[y.error,c]),a.jsxs(b,{center:"both",flex:"column",fullHeight:!0,p:"lg",style:{minHeight:"350px"},children:[a.jsx(Qe,{color:"secondaryText",size:"xl"}),a.jsx(U,{y:"md"}),a.jsx(A,{center:!0,color:"primaryText",size:"lg",style:{fontWeight:600},children:"Finding the best route"}),a.jsx(U,{y:"sm"}),a.jsx(A,{center:!0,color:"secondaryText",size:"sm",children:"We're searching for the most efficient path for this payment."})]})}function yT(e){var c,l;const{paymentMethod:t,amount:n,destinationToken:i,receiver:r,client:s,sender:o}=e;switch(t.type){case"fiat":return{amount:tr(n,i.decimals),chainId:i.chainId,client:s,currency:t.currency,enabled:!!(i&&n&&s),onramp:t.onramp||"coinbase",paymentLinkId:e.paymentLinkId,purchaseData:e.purchaseData,receiver:r,sender:o,tokenAddress:i.address,type:"onramp"};case"wallet":return t.originToken.chainId===i.chainId&&t.originToken.address.toLowerCase()===i.address.toLowerCase()?{amount:tr(n,i.decimals),chainId:i.chainId,client:s,enabled:!!(i&&n&&s),feePayer:e.feePayer||"sender",paymentLinkId:e.paymentLinkId,purchaseData:e.purchaseData,receiver:r,sender:o||((c=t.payerWallet.getAccount())==null?void 0:c.address)||r,tokenAddress:i.address,type:"transfer"}:{amount:t.action==="buy"?tr(n,i.decimals):tr(n,t.originToken.decimals),client:s,destinationChainId:i.chainId,destinationTokenAddress:i.address,enabled:!!(i&&n&&s),originChainId:t.originToken.chainId,originTokenAddress:t.originToken.address,paymentLinkId:e.paymentLinkId,purchaseData:e.purchaseData,receiver:r,sender:o||((l=t.payerWallet.getAccount())==null?void 0:l.address)||r,type:t.action}}}function gT(e){const t=[];return e.forEach((n,i)=>{var r;(r=n.transactions)==null||r.forEach((s,o)=>{t.push({...s,_index:t.length,_stepIndex:i})})}),t}function pT(e){const{wallet:t,windowAdapter:n,client:i,autoStart:r=!1,onComplete:s,preparedQuote:o}=e,c=_.useMemo(()=>o!=null&&o.steps?gT(o.steps):[],[o==null?void 0:o.steps]),[l,u]=_.useState(void 0),[d,f]=_.useState("idle"),[m,y]=_.useState(void 0),[g,p]=_.useState(new Set),[w,x]=_.useState((o==null?void 0:o.type)==="onramp"?"pending":void 0),I=_.useRef(null),E=_.useMemo(()=>
235{if(typeof(o==null?void 0:o.steps)>"u"||l===void 0)return;const z=c[l];return z?o.steps[z._stepIndex]:void 0},[l,c,o==null?void 0:o.steps]),j=_.useMemo(()=>{if(typeof(o==null?void 0:o.type)>"u")return 0;const z=c.length+(o.type==="onramp"?1:0);if(z===0)return 0;const k=g.size+(w==="completed"?1:0);return Math.round(k/z*100)},[g.size,c.length,o==null?void 0:o.type,w]),C=_.useCallback(async(z,k)=>{for(;!k.aborted;){if((await z()).completed)return;await new Promise(V=>{const F=setTimeout(V,2e3);k.addEventListener("abort",()=>clearTimeout(F),{once:!0})})}throw new Error("Polling aborted")},[]),T=_.useCallback(async(z,k,B,W)=>{if(typeof(o==null?void 0:o.type)>"u")throw new Error("No quote generated. This is unexpected.");const{prepareTransaction:V}=await h(async()=>{const{prepareTransaction:q}=await import("./bundler-BZOUbTQa.js").then(oe=>oe.cS);return{prepareTransaction:q}},__vite__mapDeps([1,2,3,4,5,6,7,8,9])),{sendTransaction:F}=await h(async()=>{const{sendTransaction:q}=await import("./bundler-BZOUbTQa.js").then(oe=>oe.cR);return{sendTransaction:q}},__vite__mapDeps([1,2,3,4,5,6,7,8,9])),Y=V({chain:z.chain,client:z.client,data:z.data,to:z.to,value:z.value,extraGas:50000n}),Q=await F({account:k,transaction:Y}),Z=Q.transactionHash;if(z.action==="approval"||z.action==="fee"){await ru(Q),await new Promise(q=>setTimeout(q,2e3));return}const{status:K}=await h(async()=>{const{status:q}=await import("./index-CcukV5Gd.js").then(oe=>oe.S);return{status:q}},__vite__mapDeps([44,5,6]));await C(async()=>{const q=await K({chainId:z.chainId,client:z.client,transactionHash:Z});if(q.status==="COMPLETED"){const oe={type:o.type,...q};return B.push(oe),{completed:!0}}if(q.status==="FAILED")throw new Error("Payment failed");return{completed:!1}},W)},[C,o==null?void 0:o.type]),v=_.useCallback(async(z,k,B,W)=>{if(typeof(o==null?void 0:o.type)>"u")throw new Error("No quote generated. This is unexpected.");if(!k.sendBatchTransaction)throw new Error("Account does not support batch transactions");const{prepareTransaction:V}=await h(async()=>{const{prepareTransaction:q}=await import("./bundler-BZOUbTQa.js").then(oe=>oe.cS);return{prepareTransaction:q}},__vite__mapDeps([1,2,3,4,5,6,7,8,9])),{sendBatchTransaction:F}=await h(async()=>{const{sendBatchTransaction:q}=await import("./send-batch-transaction-c5G2OieS.js");return{sendBatchTransaction:q}},__vite__mapDeps([34,1,2,3,4,5,6,7,8,9])),Y=await Promise.all(z.map(async q=>V({chain:q.chain,client:q.client,data:q.data,to:q.to,value:q.value,extraGas:50000n}))),Q=await F({account:k,transactions:Y});if(z.length===0)throw new Error("No transactions to batch");const Z=z[0];if(!Z)throw new Error("Invalid batch transaction");const{status:K}=await h(async()=>{const{status:q}=await import("./index-CcukV5Gd.js").then(oe=>oe.S);return{status:q}},__vite__mapDeps([44,5,6]));await C(async()=>{const q=await K({chainId:Z.chainId,client:Z.client,transactionHash:Q.transactionHash});if(q.status==="COMPLETED"){const oe={type:o.type,...q};return B.push(oe),{completed:!0}}if(q.status==="FAILED")throw new Error("Payment failed");return{completed:!1}},W)},[C,o==null?void 0:o.type]),N=_.useCallback(async(z,k,B,W,V)=>{var ae;if(typeof(o==null?void 0:o.type)>"u")throw new Error("No quote generated. This is unexpected.");if(!B.sendCalls)throw new Error("Account does not support eip5792 send calls");const{prepareTransaction:F}=await h(async()=>{const{prepareTransaction:le}=await import("./bundler-BZOUbTQa.js").then(Te=>Te.cS);return{prepareTransaction:le}},__vite__mapDeps([1,2,3,4,5,6,7,8,9])),{sendCalls:Y}=await h(async()=>{const{sendCalls:le}=await Promise.resolve().then(()=>C9);return{sendCalls:le}},void 0);if(z.length===0)throw new Error("No transactions to batch");const Q=z[0];if(!Q)throw new Error("Invalid batch transaction");const Z=await Promise.all(z.map(async le=>F({chain:le.chain,client:le.client,data:le.data,to:le.to,value:le.value,extraGas:50000n}))),K=await Y({wallet:k,calls:Z}),q=await L9(K);if(q.status==="failure")throw new Ot({code:"UNKNOWN_ERROR",message:"Transaction failed. Please try a different payment token or amount.",statusCode:500});const oe=(ae=q.receipts)==null?void 0:ae[q.receipts.length-1];if(!oe)throw new Error("No receipts found");const{status:re}=await h(async()=>{const{status:le}=await import("./index-CcukV5Gd.js").then(Te=>Te.S);return{status:le}},__vite__mapDeps([44,5,6]));await C(async()=>{const le=await re({chainId:Q.chainId,client:Q.client,transactionHash:oe.transactionHash});if(le.status==="COMPLETED"){const Te={type:o.type,...le};return W.push(Te),{completed:!0}}if(le.status==="FAILED")throw new Error("Payment failed");return{completed:!1}},V)},[C,o==null?void 0:o.type]),M=_.useCallback(async(z,k,B)=>{x("executing"),n.open(z.link);const{Onramp:W}=await h(async()=>{const{Onramp:V}=await import("./index-CcukV5Gd.js").then(F=>F.i);return{Onramp:V}},__vite__mapDeps([44,5,6]));await C(async()=>{const V=await W.status({client:i,id:z.id}),F=V.status;if(F==="COMPLETED"){await new Promise(Q=>setTimeout(Q,2e3)),x("completed");const Y={type:"onramp",...V};return k.push(Y),{completed:!0}}else F==="FAILED"&&x("failed");return{completed:!1}},B)},[C,i,n]),S=_.useCallback(async()=>{var B,W,V,F,Y,Q,Z,K,q,oe,re,ae,le,Te,qe,ct,fn,fe,ge,st,pt,wt;if(typeof(o==null?void 0:o.type)>"u")throw new Error("No quote generated. This is unexpected.");
235if(d!=="idle")return;ot({client:i,event:"ub:ui:execution:start",toChainId:(B=o.steps[o.steps.length-1])==null?void 0:B.destinationToken.chainId,toToken:(W=o.steps[o.steps.length-1])==null?void 0:W.destinationToken.address,fromToken:(V=o.steps[0])==null?void 0:V.originToken.address,chainId:(F=o.steps[0])==null?void 0:F.destinationToken.chainId,amountWei:(Q=(Y=o.steps[0])==null?void 0:Y.originAmount)==null?void 0:Q.toString(),walletAddress:(Z=t==null?void 0:t.getAccount())==null?void 0:Z.address,walletType:t==null?void 0:t.id}),f("executing"),y(void 0);const z=[],k=new AbortController;I.current=k;try{if(c.length>0&&!t)throw new Ot({code:"INVALID_INPUT",message:"No wallet provided to execute transactions",statusCode:400});if(o.type==="onramp"&&w==="pending"&&await M(o,z,k.signal),c.length>0){if(!t)throw new Ot({code:"INVALID_INPUT",message:"No wallet provided to execute transactions",statusCode:400});const ye=t.getAccount();if(!ye)throw new Ot({code:"INVALID_INPUT",message:"Wallet not connected",statusCode:400});const mt=l??0;for(let _t=mt;_t<c.length&&!k.signal.aborted;_t++){const it=c[_t];if(!it)continue;if(u(_t),!o.steps[it._stepIndex])throw new Error(`Invalid step index: ${it._stepIndex}`);it.chainId!==((K=t.getChain())==null?void 0:K.id)&&await t.switchChain(Ge(it.chainId));const mn=await wT(ye,it.chainId)&&_t<c.length-1,En=ye.sendBatchTransaction!==void 0&&_t<c.length-1;if(En||mn){const Ct=[it];let Tn=_t+1;for(;Tn<c.length;){const _i=c[Tn];if(!_i||_i.chainId!==it.chainId)break;Ct.push(_i),Tn++}if(Ct.length>1){if(En)await v(Ct,ye,z,k.signal);else if(mn)await N(Ct,t,ye,z,k.signal);else throw new Error("No supported execution mode found");for(const _i of Ct)p(Qs=>new Set(Qs).add(_i._index));_t=Tn-1;continue}}await T(it,ye,z,k.signal),p(Ct=>new Set(Ct).add(it._index))}}k.signal.aborted||(u(void 0),s&&s(z),ot({client:i,event:"ub:ui:execution:success",toChainId:(q=o.steps[o.steps.length-1])==null?void 0:q.destinationToken.chainId,toToken:(oe=o.steps[o.steps.length-1])==null?void 0:oe.destinationToken.address,fromToken:(re=o.steps[0])==null?void 0:re.originToken.address,chainId:(ae=o.steps[0])==null?void 0:ae.destinationToken.chainId,amountWei:(Te=(le=o.steps[0])==null?void 0:le.originAmount)==null?void 0:Te.toString(),walletAddress:(qe=t==null?void 0:t.getAccount())==null?void 0:qe.address,walletType:t==null?void 0:t.id}))}catch(ye){console.error("Error executing payment",ye),ot({client:i,error:ye instanceof Error?ye.message:Zt(ye),event:"ub:ui:execution:error",toChainId:(ct=o.steps[o.steps.length-1])==null?void 0:ct.destinationToken.chainId,toToken:(fn=o.steps[o.steps.length-1])==null?void 0:fn.destinationToken.address,fromToken:(fe=o.steps[0])==null?void 0:fe.originToken.address,chainId:(ge=o.steps[0])==null?void 0:ge.destinationToken.chainId,amountWei:(pt=(st=o.steps[0])==null?void 0:st.originAmount)==null?void 0:pt.toString(),walletAddress:(wt=t==null?void 0:t.getAccount())==null?void 0:wt.address,walletType:t==null?void 0:t.id}),ye instanceof Ot?y(ye):y(new Ot({code:"UNKNOWN_ERROR",message:(ye==null?void 0:ye.message)||"An unknown error occurred",statusCode:500}))}finally{f("idle"),I.current=null}},[d,t,l,c,T,v,N,w,M,s,o,i]),L=_.useCallback(()=>{d==="idle"&&S()},[S,d]),O=_.useCallback(()=>{I.current&&I.current.abort(),f("idle"),w==="executing"&&x("pending")},[w]),P=_.useCallback(()=>{m&&(y(void 0),S())},[m,S]),$=_.useRef(!1);return _.useEffect(()=>{r&&d==="idle"&&l===void 0&&!$.current&&($.current=!0,f("auto-starting"),setTimeout(()=>{L()},500))},[r,d,l,L]),_.useEffect(()=>()=>{I.current&&I.current.abort()},[]),{cancel:O,currentStep:E,currentTxIndex:l,error:m,executionState:d,onrampStatus:w,progress:j,retry:P,start:L,steps:o==null?void 0:o.steps}}const Dd=new Map;async function wT(e,t){var s;const n=`${e.address}_${t}`,i=Dd.get(n);if(i!==void 0)return i;const r=e.getCapabilities;if(!r)return Dd.set(n,!1),!1;try{const c=(s=(await Promise.race([r({chainId:t}),new Promise((u,d)=>setTimeout(()=>d(new Error("Timeout")),5e3))]))[t])==null?void 0:s.atomic,l=(c==null?void 0:c.status)==="supported"||(c==null?void 0:c.status)==="ready";return Dd.set(n,l),l}catch{return!1}}
235function R3({title:e,request:t,wallet:n,client:i,windowAdapter:r,onComplete:s,onCancel:o,onBack:c,autoStart:l,preparedQuote:u}){const d=ee(),{currentStep:f,progress:m,executionState:y,onrampStatus:g,steps:p,error:w,start:x,cancel:I,retry:E}=pT({autoStart:l,client:i,onComplete:O=>{s(O)},wallet:n,preparedQuote:u,windowAdapter:r}),j=()=>{I(),o&&o()},C=()=>{E()},T=O=>{if(!f||!p)return O===0&&w?"failed":"pending";const P=p.findIndex($=>$===f);return O<P?"completed":O===P&&y==="executing"?"executing":O===P&&w?"failed":O===P&&y==="idle"&&m===100?"completed":"pending"},v=O=>{switch(O){case"completed":return a.jsx(Us,{color:d.colors.accentButtonText,height:D.sm,width:D.sm});case"executing":return a.jsx(Qe,{color:"accentButtonText",size:"sm"});case"failed":return a.jsx(P7,{color:"white",height:D.sm,width:D.sm});default:return a.jsx(O7,{color:d.colors.primaryText,height:D.sm,width:D.sm})}},N=O=>{switch(O){case"completed":return d.colors.tertiaryBg;case"executing":return d.colors.tertiaryBg;case"failed":return d.colors.tertiaryBg;default:return d.colors.tertiaryBg}},M=O=>{switch(O){case"completed":return d.colors.success;case"executing":return d.colors.accentButtonBg;case"failed":return d.colors.danger;default:return d.colors.borderColor}},S=O=>{const{originToken:P,destinationToken:$}=O;return P.chainId!==$.chainId?a.jsxs(b,{flex:"row",gap:"3xs",children:[a.jsxs(A,{color:"primaryText",size:"sm",children:["Bridge ",P.symbol," to"," "]}),a.jsx(w1,{chain:_T(t),client:i,color:"primaryText",short:!0,size:"sm"})]}):P.symbol!==$.symbol?a.jsxs(A,{color:"primaryText",size:"sm",children:["Swap ",P.symbol," to ",$.symbol]}):a.jsx(A,{color:"primaryText",size:"sm",children:"Process transaction"})},L=O=>{switch(O){case"executing":return"Processing...";case"completed":return"Completed";case"pending":return"Waiting...";case"failed":return"Failed";default:return"Unknown"}};return a.jsxs(b,{flex:"column",fullHeight:!0,px:"md",pb:"md",pt:"md+",children:[a.jsx(Me,{onBack:c,title:e||"Processing Payment"}),a.jsx(U,{y:"xl"}),a.jsxs(b,{flex:"column",children:[a.jsxs(b,{flex:"column",gap:"sm",children:[a.jsxs(b,{center:"y",flex:"row",children:[a.jsx(A,{color:"secondaryText",size:"sm",style:{flex:1},children:"Progress"}),a.jsxs(A,{color:"primaryText",size:"sm",children:[m,"%"]})]}),a.jsx(b,{style:{backgroundColor:d.colors.tertiaryBg,border:`1px solid ${d.colors.borderColor}`,borderRadius:"4px",height:"8px",overflow:"hidden",width:"100%"},children:a.jsx(b,{style:{backgroundColor:w?d.colors.danger:d.colors.accentButtonBg,height:"100%",transition:"width 0.3s ease",width:`${m}%`},children:a.jsx(A,{})})})]}),a.jsx(U,{y:"lg"}),a.jsxs(b,{flex:"column",gap:"sm",children:[t.type==="onramp"&&g?a.jsxs(b,{flex:"row",gap:"md",style:{alignItems:"center",backgroundColor:N(g),border:`1px solid ${d.colors.borderColor}`,borderRadius:J.md,padding:`${R.sm} ${R.md}`},children:[a.jsx(b,{center:"both",flex:"row",style:{backgroundColor:M(g),borderRadius:"50%",color:d.colors.primaryButtonText,flexShrink:0,height:`${D.lg}px`,width:`${D.lg}px`},children:v(g)}),a.jsxs(b,{flex:"column",gap:"3xs",style:{flex:1},children:[a.jsx(A,{color:"primaryText",size:"sm",children:t.onramp.slice(0,1).toUpperCase()+t.onramp.slice(1)}),a.jsx(A,{color:"secondaryText",size:"xs",children:L(g)})]})]}):null,p==null?void 0:p.map((O,P)=>{const $=T(P);return a.jsxs(b,{flex:"row",gap:"md",style:{alignItems:"center",backgroundColor:N($),border:`1px solid ${d.colors.borderColor}`,borderRadius:J.md,padding:`${R.sm} ${R.md}`},children:[a.jsx(b,{center:"both",flex:"row",style:{backgroundColor:M($),borderRadius:"50%",color:d.colors.primaryButtonText,flexShrink:0,height:`${D.lg}px`,width:`${D.lg}px`},children:v($)}),a.jsxs(b,{flex:"column",gap:"3xs",style:{flex:1},children:[S(O),a.jsx(A,{color:"secondaryText",size:"xs",children:L($)})]})]},`${O.originToken.chainId}-${O.destinationToken.chainId}-${P}`)})]}),a.jsx(U,{y:"md"}),a.jsx(A,{center:!0,color:w?"danger":"secondaryText",size:"xs",multiline:!0,children:w?w.message||"An error occurred. Please try again.":a.jsxs(a.Fragment,{children:["Keep this window open until all",a.jsx("br",{})," transactions are complete."]})}),a.jsx(U,{y:"lg"}),w?a.jsx(b,{flex:"row",gap:"md",children:a.jsx(ue,{fullWidth:!0,onClick:C,variant:"primary",children:"Retry"})}):y==="idle"&&m===0?a.jsx(ue,{fullWidth:!0,onClick:x,variant:"accent",children:"Start Transaction"}):y==="executing"||y==="auto-starting"?a.jsx(ue,{fullWidth:!0,onClick:j,variant:"secondary",children:"Cancel Transaction"}):null]})]})}function _T(e){switch(e.type){case"onramp":return Lt(e.chainId);case"buy":case"sell":return Lt(e.destinationChainId);case"transfer":return Lt(e.chainId);default:throw new Error("Invalid quote type")}}const bT=Fe(e=>{const t=ee();return{animation:`${Rs} 400ms cubic-bezier(0.16, 1, 0.3, 1)`,backdropFilter:"blur(10px)",backgroundColor:t.colors.modalOverlayBg,inset:0,position:"fixed",zIndex:9999}}),yc=e=>{const[t,n]=_.useState(e.open),i=_.useRef(null),r=_.useRef(null);return _.useEffect(()=>{var s;if(e.open)n(e.open);else if(i.current){const o={duration:Gh,easing:"ease",fill:"forwards"};i.current.animate([{opacity:0}
235],{...o}).onfinish=()=>{n(!1)},(s=r.current)==null||s.animate([{opacity:0}],{...o,duration:Gh+100})}else n(e.open)},[e.open]),a.jsxs(Hx,{onOpenChange:e.setOpen,open:t,children:[e.trigger&&a.jsx(Qx,{asChild:!0,children:e.trigger}),a.jsxs(Zx,{children:[!e.hide&&a.jsx(qx,{asChild:!0,children:a.jsx(bT,{ref:r})}),a.jsx(Gx,{trapped:!e.hide,children:a.jsx(Kx,{"aria-describedby":void 0,asChild:!0,children:a.jsxs(MT,{className:Up("tw-modal",e.className),ref:i,style:e.hide?{height:0,opacity:0,overflow:"hidden",width:0}:{height:e.size==="compact"?"auto":Bw,maxWidth:e.size==="compact"?Pw:Uw},children:[a.jsx(Jx,{style:{borderWidth:0,clip:"rect(0, 0, 0, 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},children:e.title}),e.size==="compact"?a.jsx(Yw,{maxHeight:s1,children:e.children}):e.children,!e.hideCloseIcon&&a.jsx("div",{style:{position:"absolute",right:R.lg,top:R.lg,transform:"translateX(6px)",...e.crossContainerStyles},children:a.jsx(Xx,{asChild:!0,children:a.jsx(rr,{"aria-label":"Close",autoFocus:e.autoFocusCrossIcon===void 0?!0:e.autoFocusCrossIcon,type:"button",children:a.jsx(cw,{height:D.md,style:{color:"inherit"},width:D.md})})})})]})})})]})]})},xT=qt`
236  from {
237    opacity: 0;
238    transform: translate(-50%, -48%) scale(0.96);
239  }
240  to {
241    opacity: 1;
242    transform: translate(-50%, -50%) scale(1);
243  }
244`,IT=qt`
245  from {
246    opacity: 0;
247    transform: translate(0, 50%);
248  }
249  to {
250    opacity: 1;
251    transform: translate(0, 0);
252  }
253`,MT=Fe(e=>{const t=ee();return{"--bg":t.colors.modalBg,"& *":{boxSizing:"border-box"},animation:`${xT} 300ms ease`,background:t.colors.modalBg,border:`1px solid ${t.colors.borderColor}`,borderRadius:J.xl,boxShadow:ep.lg,boxSizing:"border-box",color:t.colors.primaryText,fontFamily:t.fontFamily,left:"50%",lineHeight:"normal",outline:"none",overflow:"hidden",position:"fixed",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100vw - 40px)",zIndex:1e4,[bf.mobile]:{animation:`${IT} 0.35s cubic-bezier(0.15, 1.15, 0.6, 1)`,borderBottomLeftRadius:0,borderBottomRightRadius:0,bottom:0,left:0,maxWidth:"none !important",right:0,top:"auto",transform:"none",width:"100vw"},"& *::selection":{backgroundColor:t.colors.selectedTextBg,color:t.colors.selectedTextColor},...hc}}),CT={USD:"$",EUR:"€",GBP:"£",JPY:"¥",KRW:"₩",CNY:"¥",INR:"₹",NOK:"kr",SEK:"kr",CHF:"CHF",AUD:"$",CAD:"$",NZD:"$",MXN:"$",BRL:"R$",CLP:"$",CZK:"Kč",DKK:"kr",HKD:"$",HUF:"Ft",IDR:"Rp",ILS:"₪",ISK:"kr"};function r0(e){return CT[e]||"$"}function ET(e){return e===0?"0.00":e<1e3?e.toString():e<1e4?e.toLocaleString("en-US"):e<1e6?Nd(e,1e3,"k"):e<1e9?Nd(e,1e6,"M"):Nd(e,1e9,"B")}function Nd(e,t,n){const i=e/t;return Number.isInteger(i)?Math.floor(i)+n:i.toFixed(1).replace(/\.0$/,"")+n}const py=[["#fca5a5","#b91c1c"],["#fdba74","#c2410c"],["#fcd34d","#b45309"],["#fde047","#a16207"],["#a3e635","#4d7c0f"],["#86efac","#15803d"],["#67e8f9","#0e7490"],["#7dd3fc","#0369a1"],["#93c5fd","#1d4ed8"],["#a5b4fc","#4338ca"],["#c4b5fd","#6d28d9"],["#d8b4fe","#7e22ce"],["#f0abfc","#a21caf"],["#f9a8d4","#be185d"],["#fda4af","#be123c"]];async function TT(e){const{chain:t,client:n,address:i,tokenAddress:r,showBalanceInFiat:s}=e;if(!t)throw new Error("chain is required");if(r&&(r==null?void 0:r.toLowerCase())===Pt.toLowerCase())throw new Error(`Invalid tokenAddress - cannot be ${Pt}`);if(!Zr(i))throw new Error("Invalid wallet address. Expected an EVM address");if(r&&!Zr(r))throw new Error("Invalid tokenAddress. Expected an EVM contract address");const o=await Ts({address:i,chain:t,client:n,tokenAddress:r}).catch(()=>{});if(!o)throw new Error(`Failed to retrieve ${r?`token: ${r}`:"native token"} balance for address: ${i} on chainId:${t.id}`);if(s){const c=await L3({chain:t,client:n,fromAmount:Number(o.displayValue),fromTokenAddress:r||Pt,to:s}).catch(()=>{});if(c===void 0)throw new Error(`Failed to resolve fiat value for ${r?`token: ${r}`:"native token"} on chainId: ${t.id}`);return{balance:c==null?void 0:c.result,symbol:r0(s)}}return{balance:Number(o.displayValue),symbol:o.symbol}}function Al(e){return`${Bo(e.balance,e.decimals)} ${e.symbol}`}function b1(e){const t=Bo(e.balance,e.decimals),n=ET(t);return`${e.symbol}${n}`}const x1={agreement:{and:"&",prefix:"By connecting, you agree to the",privacyPolicy:"Privacy Policy",termsOfService:"Terms of Service"},backupWallet:"Backup Wallet",buy:"Buy",confirmInWallet:"Confirm in wallet",connectAWallet:"Connect a Wallet",connectedToSmartWallet:"Smart Account",connecting:"Connecting",continueAsGuest:"Continue as guest",copyAddress:"Copy Address",currentNetwork:"Current network",defaultButtonTitle:"Connect",defaultModalTitle:"Sign in",disconnectWallet:"Disconnect Wallet",getStarted:"Get started",goBackButton:"Back",guest:"Guest",guestWalletWarning:"This is a temporary guest wallet. Backup wallet if you don't want to lose access to it",id:"en_US",installed:"Installed",manageWallet:{connectAnApp:"Connect an App",exportPrivateKey:"Export Private Key",linkedProfiles:"Linked Profiles",linkProfile:"Link a Profile",title:"Manage Wallet"},networkSelector:{addCustomNetwork:"Add Custom Network",allNetworks:"All",categoryLabel:{others:"All Networks",popular:"Popular",recentlyUsed:"Recently Used"}
253,failedToSwitch:"Failed to switch network",inputPlaceholder:"Search Network or Chain ID",loading:"Loading",mainnets:"Mainnets",testnets:"Testnets",title:"Select Network"},newToWallets:"New to wallets?",or:"OR",passkeys:{linkPasskey:"Link a Passkey",title:"Passkeys"},payTransactions:"Fiat Transactions",personalWallet:"Personal Wallet",receive:"Receive",receiveFundsScreen:{instruction:"Copy the address to send funds to this wallet",title:"Receive Funds"},recommended:"Recommended",requestTestnetFunds:"Request Testnet Funds",send:"Send",sendFundsScreen:{amount:"Amount",insufficientFunds:"Insufficient Funds",invalidAddress:"Invalid Address",noTokensFound:"No Tokens Found",searchToken:"Search or Paste token address",selectTokenTitle:"Select a Token",sending:"Sending",sendTo:"Send to",submitButton:"Send",successMessage:"Transaction Successful",title:"Send Funds",token:"Token",transactionFailed:"Transaction Failed",transactionRejected:"Transaction Rejected"},signatureScreen:{instructionScreen:{disconnectWallet:"Disconnect Wallet",instruction:"Please sign the message request in your wallet to continue",signInButton:"Sign in",title:"Sign in"},signingScreen:{approveTransactionInSafe:"Approve transaction in Safe",failedToSignIn:"Failed to Sign in",inProgress:"Awaiting Confirmation",prompt:"Signing the signature request in your wallet",promptForSafe:"Sign signature request in your wallet & approve transaction in Safe",title:"Signing In",tryAgain:"Try Again"}},signIn:"Sign in",smartWallet:"Smart Wallet",switchAccount:"Switch Account",switchingNetwork:"Switching Network",switchNetwork:"Switch Network",switchTo:"Switch to",transactions:"Transactions",viewAllTransactions:"View All Transactions",viewFunds:{title:"View Funds",viewAssets:"View Assets",viewNFTs:"View NFTs",viewTokens:"View Tokens"},walletTransactions:"Wallet Transactions",welcomeScreen:{defaultSubtitle:"Connect a wallet to get started",defaultTitle:"Your gateway to the decentralized world"}},vT=Object.freeze(Object.defineProperty({__proto__:null,default:x1},Symbol.toStringTag,{value:"Module"})),U3=e=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 18 18",width:e.size,height:e.size,style:{color:e.color},role:"presentation",children:a.jsx("path",{fill:"currentColor",d:"M15.6 4.6H1.85v-.55l12.1-.968v.968h1.65V2.4c0-1.21-.98-2.059-2.177-1.888L2.378 2.089C1.18 2.26.2 3.39.2 4.6v11a2.2 2.2 0 002.2 2.2h13.2a2.2 2.2 0 002.2-2.2V6.8a2.2 2.2 0 00-2.2-2.2zm-1.65 7.707a1.65 1.65 0 01-.63-3.176 1.65 1.65 0 11.63 3.176z"})}),Ad=640;function B3(){const[e,t]=_.useState(void 0);return _.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Ad-1}px)`),i=()=>{t(window.innerWidth<Ad)};return n.addEventListener("change",i),t(window.innerWidth<Ad),()=>n.removeEventListener("change",i)},[]),!!e}function I1({socialType:e,resolverAddress:t,resolverChain:n,loadingComponent:i,fallbackComponent:r,queryOptions:s,...o}){const{address:c,client:l}=cc(),u=pe({queryFn:async()=>{var p;const[d,f]=await Promise.all([Bf({address:c,client:l}),$f({address:c||"",client:l,resolverAddress:t,resolverChain:n})]),m=(p=d==null?void 0:d.filter(w=>w.avatar&&(e?w.type===e:!0))[0])==null?void 0:p.avatar,[y,g]=await Promise.all([m?Sp({client:l,uri:m}):void 0,f?H9({client:l,name:f}):void 0]);if(!y&&!g)throw new Error("Failed to resolve social + ens avatar");if(y)return y;if(g)return g;throw new Error("Failed to resolve social + ens avatar")},queryKey:["account-avatar",c,{socialType:e},{resolverAddress:t,resolverChain:n}],retry:!1,...s});return u.isLoading?i||null:u.data?a.jsx("img",{src:u.data,...o,alt:o.alt}):r||null}function V3(e){const t=_.useId(),n=_.useMemo(()=>py[Number(jf(e.address.slice(2,4)))%py.length],[e.address]);return a.jsx("div",{className:e.className,id:t,style:{...e.style,backgroundImage:`radial-gradient(ellipse at left bottom, ${n[0]}, ${n[1]})`,...e.size?{height:`${e.size}px`,width:`${e.size}px`}:void 0}})}function Va(e){const{address:t}=cc();return a.jsx(V3,{...e,address:t})}function M1({resolverAddress:e,resolverChain:t,socialType:n,formatFn:i,queryOptions:r,loadingComponent:s,fallbackComponent:o,...c}){const{address:l,client:u}=cc(),d=pe({queryFn:async()=>{var g;const[f,m]=await Promise.all([Bf({address:l,client:u}),$f({address:l,client:u,resolverAddress:e,resolverChain:t})]),y=((g=f==null?void 0:f.filter(p=>p.name&&(n?p.type===n:!0))[0])==null?void 0:g.name)||m;if(!y)throw new Error("Failed to resolve account name");return i?i(y):y},queryKey:["account-name",l,{socialType:n},{resolverAddress:e,resolverChain:t}],retry:!1,...r});return d.isLoading?s||null:d.data?a.jsx("span",{...c,children:d.data}):o||null}function LT({loadingComponent:e,fallbackComponent:t,queryOptions:n,...i}){const r=yC({queryOptions:n});return r.isLoading?e||null:r.data?a.jsx("img",{src:r.data,...i,alt:i.alt}):t||null}function jT(e){const t=e.activeWalletInfo.activeWallet,n=e.activeWalletInfo.activeAccount,i=a.jsx(Va,{style:{width:`${D.xs}px`,height:`${D.xs}px`,borderRadius:J.full}}),r=a.jsx(LT,{style:{width:`${D.xs}px`,height:`${D.xs}px`},fallbackComponent:i,loadingComponent:i});return a.jsx(ST,{variant:"ghost-solid",style:{paddingInline:R.xxs,paddingBlock:"2px"},onClick:e.onClick,children:a.jsx(_f,{address:n.address,client:e.client,children:a.jsx(J9,{id:t.id,children:a.jsxs(b,{flex:"row",gap:"xxs",center:"y",children:[a.jsx(I1,{style:{width:`${D.xs}px`,height:`${D.xs}px`,borderRadius:J.full,objectFit:"cover"},fallbackComponent:r,loadingComponent:r}),a.jsx("span",{style:{fontSize:ie.xs,letterSpacing:"0.025em"},children:a.jsx(M1,{fallbackComponent:a.jsx("span",{children:Mn(n.address)}),loadingComponent:a.jsx("span",{children:Mn(n.address)})})})]})})})})}const ST=nt(ue)(()=>{const e=ee();return{color:e.colors.secondaryText,transition:"color 200ms ease","&:hover":{color:e.colors.primaryText}}});function wy(e){const t=n=>{let i=n;i=i.replace(",","."),i.startsWith(".")&&(i=`0${i}`);const r=Number(i);Number.isNaN(r)||(i.length>1&&i.startsWith("0")&&!i.startsWith("0.")?e.setValue(i.slice(1)):e.setValue(i))};return a.jsx(Jr,{...e,inputMode:"decimal",onChange:n=>{t(n.target.value)},onClick:n=>{e.value===""&&n.currentTarget.setSelectionRange(n.currentTarget.value.length,n.currentTarget.value.length)},pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:"0.0",type:"text",variant:"transparent"})}function C1(e){return e.replace("Mainnet","")}const DT=new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:5,minimumFractionDigits:2});function NT(e){var n,i,r,s,o,c,l;const t=ee();return a.jsxs(ue,{variant:"ghost-solid",hoverBg:e.disabled?void 0:"secondaryButtonBg",fullWidth:!0,onClick:e.onSelectToken,gap:"sm",disabled:e.disabled,style:{borderBottom:`1px dashed ${t.colors.borderColor}`,justifyContent:"space-between",paddingInline:R.md,paddingBlock:R.md,borderRadius:0,background:e.disabled?"transparent":void 0,cursor:e.disabled?"default":"pointer",opacity:1},children:[a.jsxs(b,{gap:"sm",flex:"row",center:"y",children:[a.jsxs(b,{relative:!0,color:"secondaryText",children:[e.selectedToken&&!e.selectedToken.isError?a.jsx(dt,{src:((n=e.selectedToken)==null?void 0:n.data)===void 0?void 0:e.selectedToken.data.iconUri||"",client:e.client,width:"40",height:"40",fallback:a.jsx(b,{style:{background:`linear-gradient(45deg, white, ${t.colors.accentText})`,borderRadius:J.full,width:"40px",height:"40px"}}),style:{objectFit:"cover",borderRadius:J.full}},(r=(i=e.selectedToken)==null?void 0:i.data)==null?void 0:r.iconUri):a.jsx(b,{style:{border:`1px solid ${t.colors.borderColor}`,background:`linear-gradient(45deg, white, ${t.colors.accentText})`,borderRadius:J.full,width:"40px",height:"40px"}}),e.chain&&a.jsx(b,{bg:"modalBg",style:{padding:"2px",position:"absolute",bottom:-2,right:-2,display:"flex",borderRadius:J.full},children:a.jsx(dt,{src:((s=e.chain)==null?void 0:s.icon)||"",client:e.client,width:D.sm,height:D.sm,style:{borderRadius:J.full},fallback:a.jsx(b,{style:{background:`linear-gradient(45deg, white, ${t.colors.accentText})`,borderRadius:J.full,width:`${D.sm}px`,height:`${D.sm}px`}})})})]}),e.selectedToken&&!e.selectedToken.isError?a.jsxs(b,{flex:"column",style:{gap:"3px"},children:[(o=e.selectedToken)!=null&&o.isFetching?a.jsx(me,{width:"60px",height:ie.md}):a.jsx(A,{size:"md",color:"primaryText",weight:500,style:{whiteSpace:"nowrap",maxWidth:"200px"},children:(l=(c=e.selectedToken)==null?void 0:c.data)==null?void 0:l.symbol}),e.chain?a.jsx(A,{size:"xs",color:"secondaryText",style:{whiteSpace:"nowrap"},children:C1(e.chain.name)}):a.jsx(me,{width:"140px",height:ie.sm})]}):a.jsxs(b,{flex:"column",style:{gap:"3px"},children:[a.jsx(A,{size:"md",color:"primaryText",weight:500,children:"Select Token"}),a.jsx(A,{size:"xs",color:"secondaryText",children:"Required"})]})]}),!e.disabled&&a.jsx(b,{color:"secondaryText",flex:"row",center:"both",borderColor:"borderColor",style:{borderRadius:J.full,borderWidth:1,borderStyle:"solid",padding:R.xs},children:a.jsx(Lu,{width:D.sm,height:D.sm})})]})}function AT(e){return uu({address:e.walletAddress,chain:e.chainId?Lt(e.chainId):void 0,client:e.client,tokenAddress:e.tokenAddress?_e(e.tokenAddress)===_e(Pt)?void 0:_e(e.tokenAddress):void 0})}function OT(e){return pe({enabled:!!e.chainId,queryFn:async()=>
253{if(!e.chainId)throw new Error("Chain ID is required");const t=e.tokenAddress||Pt,n=await Uo(e.client,t,e.chainId).catch(i=>{i.message.includes("not supported")||Promise.reject(i)});return n?{token:n,type:"success"}:{type:"unsupported_token"}},queryKey:["bridge.getToken",e],refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1})}function s0(e){const t=ee();return a.jsxs(b,{flex:"column",children:[e.image&&a.jsx("div",{className:"tw-header-image",style:{aspectRatio:"16/9",backgroundColor:t.colors.tertiaryBg,backgroundImage:`url(${kT(e.client,e.image)})`,backgroundPosition:"center",backgroundSize:"cover",borderRadius:`${J.md} ${J.md} 0 0`,marginBottom:R.xxs,overflow:"hidden",width:"100%"}}),a.jsxs(b,{flex:"column",px:"md",children:[a.jsx(U,{y:"md"}),(e.title||e.description)&&a.jsxs(a.Fragment,{children:[e.title&&a.jsx(A,{color:"primaryText",size:"lg",weight:500,trackingTight:!0,children:e.title}),e.description&&a.jsxs(a.Fragment,{children:[a.jsx(U,{y:"xxs"}),a.jsx(A,{color:"secondaryText",size:"sm",multiline:!0,children:e.description})]}),a.jsx(U,{y:"md"})]}),e.children]})]})}function kT(e,t){return t.startsWith("ipfs://")?qr({client:e,uri:t}):t}function zT(e){const t=ht(),n=ft(),i=jt();return _.useMemo(()=>{const r=n,s=i,o=t;return r&&s&&o?{activeChain:s,activeWallet:r,activeAccount:o}:void 0},[t,n,i,e])}function PT(e){return pe({queryKey:["token-price",e.token],enabled:!!e.token,queryFn:()=>{if(!e.token)throw new Error("Token is required");return Uo(e.client,e.token.tokenAddress,e.token.chainId)},refetchOnMount:!1,retry:!1,refetchOnWindowFocus:!1})}const gc=e=>a.jsxs("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 24 24",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),a.jsx("path",{d:"M18.0901 10.37C19.0354 10.7224 19.8766 11.3075 20.5358 12.0712C21.1951 12.8349 21.6512 13.7524 21.8618 14.7391C22.0725 15.7257 22.031 16.7495 21.7411 17.7158C21.4513 18.6822 20.9224 19.5598 20.2035 20.2676C19.4846 20.9754 18.5988 21.4905 17.6281 21.7652C16.6573 22.04 15.633 22.0655 14.6498 21.8395C13.6666 21.6134 12.7562 21.1431 12.0029 20.472C11.2496 19.8009 10.6777 18.9507 10.3401 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),a.jsx("path",{d:"M7 6H8V10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),a.jsx("path",{d:"M16.7101 13.88L17.4101 14.59L14.5901 17.41",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]}),RT=e=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"presentation",width:e.size,style:{color:e.color},height:e.size,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("path",{d:"M12 16v-4"}),a.jsx("path",{d:"M12 8h.01"})]});function $3(e){return a.jsxs("div",{style:{position:"relative"},children:[a.jsx(b,{color:"secondaryText",children:a.jsx(Xf,{width:D.md,height:D.md,style:{position:"absolute",left:R.sm,top:"50%",borderRadius:J.lg,transform:"translateY(-50%)"}})}),a.jsx(Jr,{variant:"outline",placeholder:e.placeholder,value:e.value,sm:!0,style:{paddingLeft:"44px"},onChange:t=>e.onChange(t.target.value),autoFocus:e.autoFocus})]})}function UT(e){return a.jsxs(ue,{variant:"outline",bg:"tertiaryBg",fullWidth:!0,style:{justifyContent:"flex-start",fontWeight:500,fontSize:ie.md,padding:`${R.sm} ${R.sm}`,borderRadius:J.lg,minHeight:"48px"},gap:"sm",onClick:e.onClick,children:[a.jsx(dt,{src:e.selectedChain.icon,client:e.client,width:D.lg,height:D.lg}),a.jsxs("span",{children:[" ",C1(e.selectedChain.name)," "]}),a.jsx(Lu,{width:D.sm,height:D.sm,style:{marginLeft:"auto"}})]})}function W3(e){return pe({queryKey:["bridge-chains",e],queryFn:async()=>[...await m9(e)].sort((i,r)=>{var c,l;const s=(c=i.name[0])==null?void 0:c.match(/^\d/),o=(l=r.name[0])==null?void 0:l.match(/^\d/);return s&&!o?1:!s&&o?-1:i.name.localeCompare(r.name)}),refetchOnMount:!1,refetchOnWindowFocus:!1})}function BT({chainId:e,client:t}){var i;const n=W3({client:t});return{data:(i=n.data)==null?void 0:i.find(r=>r.chainId===e),isPending:n.isPending}}function F3(e){return W3({client:e.client,...e.type==="buy"?e.sellChainId?{originChainId:e.sellChainId}:{type:"destination"}:e.buyChainId?{destinationChainId:e.buyChainId}:{type:"origin"}})}function _y(e){const t=F3({client:e.client,type:e.type,buyChainId:e.selections.buyChainId,sellChainId:e.selections.sellChainId});return a.jsx(VT,{...e,isPending:t.isPending,onSelectChain:e.onSelectChain,chains:t.data??[]})}function VT(e){const[t,n]=_.useState(""),[i]=_.useState(e.selectedChain),s=_.useMemo(()=>i?[i,...e.chains.filter(o=>o.chainId!==i.chainId)]:e.chains,[e.chains,i]).filter(o=>o.name.toLowerCase().includes(t.toLowerCase()));return a.jsxs(b,{fullHeight:!0,flex:"column",children:[e.isMobile&&a.jsxs(a.Fragment,{children:[a.jsx(b,{px:"md",py:"md+",children:a.jsx(Me,{onBack:e.onBack,title:"Select Chain"})}),a.jsx(He,{})]}),a.jsx(U,{y:"md"}),a.jsx(b,{px:"md",style:{paddingBottom:0},children:a.jsx($3,{value:t,onChange:n,placeholder:"Search Chain"})}),a.jsx(U,{y:"sm"}),a.jsxs(b,{expand:!0,px:"md",gap:e.isMobile?void 0:"xxs",flex:"column",style:{maxHeight:e.isMobile?"400px":"none",overflowY:"auto",scrollbarWidth:"none",paddingBottom:R.md},children:[s.map(o=>{var c;return a.jsx(WT,{chain:o,client:e.client,onClick:()=>e.onSelectChain(o),isSelected:o.chainId===((c=e.selectedChain)==null?void 0:c.chainId),isMobile:e.isMobile},o.chainId)}
253),e.isPending&&new Array(20).fill(0).map(()=>a.jsx($T,{isMobile:e.isMobile})),s.length===0&&!e.isPending&&a.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:a.jsxs(A,{color:"secondaryText",size:"md",center:!0,multiline:!0,children:['No chains found for "',t,'"']})})]})]})}function $T(e){const t=e.isMobile?D.lg:D.md;return a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R.sm,padding:e.isMobile?`${R.sm} ${R.sm}`:`${R.xs} ${R.xs}`},children:[a.jsx(me,{height:`${t}px`,width:`${t}px`}),a.jsx(me,{height:e.isMobile?ie.md:ie.sm,width:"160px"})]})}function WT(e){const t=ee(),n=e.isMobile?D.lg:D.md;return a.jsxs(ue,{variant:e.isSelected?"secondary":"ghost-solid",fullWidth:!0,style:{justifyContent:"flex-start",fontWeight:500,fontSize:e.isMobile?ie.md:ie.sm,border:"1px solid transparent",padding:e.isMobile?void 0:`${R.xs} ${R.xs}`},onClick:e.onClick,gap:"sm",children:[a.jsx(dt,{src:e.chain.icon||"",client:e.client,width:n,height:n,style:{borderRadius:J.full},fallback:a.jsx(b,{color:"secondaryText",children:a.jsx(b,{style:{background:`linear-gradient(45deg, white, ${t.colors.accentText})`,borderRadius:J.full,width:`${n}px`,height:`${n}px`}})})}),C1(e.chain.name)]})}function FT(e){return pe({queryKey:["tokens",e],enabled:!!e.chainId,retry:!1,queryFn:()=>{if(!e.chainId)throw new Error("Chain ID is required");const t=e.search?Zr(e.search):!1;return zf({chainId:e.chainId,client:e.client,offset:e.offset,limit:e.limit,includePrices:!1,query:e.search&&!t?e.search:void 0,tokenAddress:e.search&&t?e.search:void 0})}})}function YT(e){return pe({queryKey:["bridge/v1/wallets",e],enabled:!!e.chainId&&!!e.walletAddress,queryFn:async()=>{if(!e.chainId||!e.walletAddress)throw new Error("invalid options");const n=St("bridge").includes("thirdweb-dev"),i=new URL(`https://api.${n?"thirdweb-dev":"thirdweb"}.com/v1/wallets/${e.walletAddress}/tokens`);i.searchParams.set("chainId",e.chainId.toString()),i.searchParams.set("limit",e.limit.toString()),i.searchParams.set("page",e.page.toString()),i.searchParams.set("metadata","true"),i.searchParams.set("resolveMetadataLinks","true"),i.searchParams.set("includeSpam","false"),i.searchParams.set("includeNative","true"),i.searchParams.set("sortBy","usd_value"),i.searchParams.set("sortOrder","desc"),i.searchParams.set("includeWithoutPrice","false");const s=await hn(e.client)(i.toString());if(!s.ok)throw new Error(`Failed to fetch token balances: ${s.statusText}`);return(await s.json()).result},refetchOnMount:"always"})}function Od(e,t){if(t)return e.find(n=>n.chainId===t)}const kd=100;function HT(e){var p,w,x,I,E;const t=F3({client:e.client,type:e.type,buyChainId:e.selections.buyChainId,sellChainId:e.selections.sellChainId}),[n,i]=_.useState(""),r=Uu(n,500),[s,o]=_.useState(kd),c=_.useCallback(j=>{i(j),o(kd)},[]),[l,u]=_.useState(void 0),d=l||(t.data?Od(t.data,(p=e.selectedToken)==null?void 0:p.chainId)||Od(t.data,(w=e.activeWalletInfo)==null?void 0:w.activeChain.id)||Od(t.data,1):void 0),f=FT({client:e.client,chainId:d==null?void 0:d.chainId,search:r,limit:s,offset:0}),m=YT({client:e.client,chainId:d==null?void 0:d.chainId,limit:s,page:1,walletAddress:(x=e.activeWalletInfo)==null?void 0:x.activeAccount.address}),y=_.useMemo(()=>{var j,C;return(C=(j=m.data)==null?void 0:j.tokens)==null?void 0:C.filter(T=>T.symbol.toLowerCase().includes(r.toLowerCase())||T.name.toLowerCase().includes(r.toLowerCase())||T.token_address.toLowerCase().includes(r.toLowerCase()))},[(I=m.data)==null?void 0:I.tokens,r]),g=f.isFetching||m.isFetching;return a.jsx(QT,{...e,ownedTokens:y||[],allTokens:f.data||[],isFetching:g,selectedChain:d,setSelectedChain:u,search:n,setSearch:c,selectedToken:e.selectedToken,setSelectedToken:e.setSelectedToken,showMore:((E=f.data)==null?void 0:E.length)===s?()=>{o(s+kd)}:void 0})}function QT(e){var c,l;const t=B3(),[n,i]=_.useState("select-token"),r=_.useMemo(()=>e.ownedTokens.sort((u,d)=>u.icon_uri&&!d.icon_uri?-1:!u.icon_uri&&d.icon_uri?1:0),[e.ownedTokens]),s=_.useMemo(()=>{const u=new Set(r.map(d=>`${d.token_address}-${d.chain_id}`.toLowerCase()));return e.allTokens.filter(d=>!u.has(`${d.address}-${d.chainId}`.toLowerCase()))},[e.allTokens,r]),o=_.useMemo(()=>s.sort((u,d)=>u.iconUri&&!d.iconUri?-1:!u.iconUri&&d.iconUri?1:0),[s]);return t?n==="select-token"?a.jsx(xy,{onSelectToken:u=>{e.setSelectedToken(u),e.onClose()},selectedToken:e.selectedToken,isFetching:e.isFetching,ownedTokens:e.ownedTokens,otherTokens:o,showMore:e.showMore,selectedChain:e.selectedChain,isMobile:!0,onSelectChain:()=>i("select-chain"),client:e.client,search:e.search,setSearch:e.setSearch,currency:e.currency},(l=e.selectedChain)==null?void 0:l.chainId):n==="select-chain"?a.jsx(_y,{isMobile:!0,onBack:()=>i("select-token"),client:e.client,onSelectChain:u=>{e.setSelectedChain(u),i("select-token")},selectedChain:e.selectedChain,type:e.type,selections:e.selections}):null:a.jsxs(b,{style:{display:"grid",gridTemplateColumns:"300px 1fr",height:"100%"},children:[a.jsx(GT,{children:a.jsx(_y,{type:e.type,selections:e.selections,onBack:()=>i("select-token"),client:e.client,isMobile:!1,onSelectChain:u=>{e.setSelectedChain(u),i("select-token")},selectedChain:e.selectedChain})}),a.jsx(b,{flex:"column",relative:!0,scrollY:!0,children:a.jsx(xy,{onSelectToken:u=>{e.setSelectedToken(u),e.onClose()},isMobile:!1,selectedToken:e.selectedToken,isFetching:e.isFetching,ownedTokens:e.ownedTokens,otherTokens:o,showMore:e.showMore,selectedChain:e.selectedChain,onSelectChain:()=>i("select-chain"),client:e.client,search:e.search,setSearch:e.setSearch,currency:e.currency},(c=e.selectedChain)==null?void 0:c.chainId)})]})}function ZT(){return a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:R.sm,padding:`${R.xs} ${R.xs}`,height:"70px"},children:[a.jsx(me,{height:`${D.lg}px`,width:`${D.lg}px`}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[a.jsx(me,{height:ie.sm,width:"100px"}),a.jsx(me,{height:ie.md,width:"200px"})]})]})}function by(e){const t=ee(),n="balance"in e.token?mi(BigInt(e.token.balance),e.token.decimals):void 0,i="balance"in e.token?e.token.price_data.price_usd*Number(n):void 0,r="balance"in e.token?e.token.token_address:e.token.address,s="balance"in e.token?e.token.chain_id:e.token.chainId;return a.jsxs(ue,{variant:e.isSelected?"secondary":"ghost-solid",fullWidth:!0,style:{justifyContent:"flex-start",fontWeight:500,fontSize:ie.md,border:"1px solid transparent",padding:`${R.xs} ${R.xs}`,textAlign:"left",lineHeight:"1.5",borderRadius:J.lg},gap:"sm",onClick:async()=>{e.onSelect({tokenAddress:r,chainId:s})},children:[a.jsx(dt,{src:("balance"in e.token?e.token.icon_uri:e.token.iconUri)||"",client:e.client,width:D.lg,height:D.lg,style:{flexShrink:0,borderRadius:J.full},fallback:a.jsx(b,{color:"secondaryText",children:a.jsx(b,{style:{background:`linear-gradient(45deg, white, ${t.colors.accentText})`,borderRadius:J.full,width:`${D.lg}px`,height:`${D.lg}px`}})})}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:R["3xs"],flex:1},children:[a.jsxs(b,{flex:"row",style:{justifyContent:"space-between",width:"100%"},children:[a.jsx(A,{size:"md",color:"primaryText",weight:500,style:{maxWidth:"200px",whiteSpace:"nowrap"},children:e.token.symbol}),"balance"in e.token&&a.jsx(A,{size:"md",color:"primaryText",children:DT.format(Number(mi(BigInt(e.token.balance),e.token.decimals)))})]}),a.jsxs(b,{flex:"row",style:{justifyContent:"space-between",width:"100%"},children:[a.jsx(A,{size:"xs",color:"secondaryText",style:{whiteSpace:"nowrap",maxWidth:"200px"},children:e.token.name}),i&&a.jsx(b,{flex:"row",children:a.jsxs(A,{size:"xs",color:"secondaryText",weight:400,children:["$",i.toFixed(2)]})})]})]}),a.jsx(rr,{onClick:o=>
253{o.stopPropagation(),o.preventDefault(),e.onInfoClick(r,s)},style:{padding:R.xxs,borderRadius:J.full},children:a.jsx(RT,{size:D.sm})})]})}function qT(e){const t=ee(),n=PT({token:{tokenAddress:e.tokenAddress,chainId:e.chainId},client:e.client}),i=n.data,r=xl(e.tokenAddress),s=r?`https://thirdweb.com/${e.chainId}`:`https://thirdweb.com/${e.chainId}/${e.tokenAddress}`;return a.jsxs(b,{flex:"column",expand:!0,style:{minHeight:"450px"},animate:"fadein",children:[a.jsx(b,{px:"md",py:"md+",children:a.jsx(Me,{onBack:e.onBack,title:"Token Details"})}),a.jsx(He,{dashed:!0}),n.isPending?a.jsx(b,{flex:"column",center:"both",expand:!0,children:a.jsx(Qe,{size:"lg",color:"secondaryText"})}):i?a.jsxs(b,{flex:"column",gap:"md",px:"md",py:"lg",children:[a.jsxs(b,{flex:"row",style:{justifyContent:"space-between",alignItems:"center"},children:[a.jsx(A,{size:"sm",color:"secondaryText",children:"Name"}),a.jsxs(b,{flex:"row",gap:"xxs",center:"y",children:[a.jsx(dt,{src:i.iconUri||"",client:e.client,width:D.sm,height:D.sm,style:{borderRadius:J.full},fallback:a.jsx(b,{style:{background:`linear-gradient(45deg, white, ${t.colors.accentText})`,borderRadius:J.full,width:`${D.sm}px`,height:`${D.sm}px`}})}),a.jsx(A,{size:"sm",color:"primaryText",weight:500,style:{maxWidth:"200px",whiteSpace:"nowrap"},children:i.name})]})]}),a.jsx(kc,{label:"Symbol",value:i.symbol}),"prices"in i&&a.jsx(kc,{label:"Price",value:i.prices[e.currency]?Fr(e.currency,i.prices[e.currency]):"N/A"}),!!i.marketCapUsd&&a.jsx(kc,{label:"Market Cap",value:Fr(e.currency,i.marketCapUsd)}),!!i.volume24hUsd&&a.jsx(kc,{label:"Volume (24h)",value:Fr(e.currency,i.volume24hUsd)}),a.jsxs(b,{flex:"row",style:{justifyContent:"space-between",alignItems:"center"},children:[a.jsx(A,{size:"sm",color:"secondaryText",children:"Contract Address"}),a.jsxs(b,{flex:"row",gap:"3xs",center:"y",children:[!r&&a.jsx(js,{text:e.tokenAddress,iconSize:13,tip:"Copy Address"}),a.jsx(Gr,{href:s,target:"_blank",rel:"noreferrer",color:"accentText",hoverColor:"primaryText",weight:500,size:"sm",children:r?"Native Currency":Mn(e.tokenAddress)})]})]})]}):a.jsx(b,{flex:"column",center:"both",expand:!0,children:a.jsx(A,{size:"sm",color:"secondaryText",children:"Token not found"})})]})}function kc(e){return a.jsxs(b,{flex:"row",style:{justifyContent:"space-between",alignItems:"center"},children:[a.jsx(A,{size:"sm",color:"secondaryText",children:e.label}),a.jsx(A,{size:"sm",color:"primaryText",weight:500,style:{maxWidth:"200px",whiteSpace:"nowrap"},children:e.value})]})}function xy(e){const[t,n]=_.useState(null),i=!e.isFetching&&e.otherTokens.length===0&&e.ownedTokens.length===0;return t?a.jsx(qT,{tokenAddress:t.tokenAddress,chainId:t.chainId,client:e.client,onBack:()=>n(null),currency:e.currency}):a.jsxs(b,{fullHeight:!0,flex:"column",children:[a.jsxs(b,{px:"md",pt:"md+",children:[a.jsx(A,{size:"lg",weight:600,color:"primaryText",trackingTight:!0,children:"Select Token"}),a.jsx(U,{y:"3xs"}),a.jsx(A,{size:"sm",color:"secondaryText",multiline:!0,style:{textWrap:"pretty"},children:"Select a token from the list or use the search"})]}),!e.selectedChain&&a.jsx(b,{flex:"column",center:"both",expand:!0,style:{minHeight:"300px"},children:a.jsx(Qe,{color:"secondaryText",size:"lg"})}),e.selectedChain&&a.jsxs(a.Fragment,{children:[e.isMobile?a.jsx(b,{p:"md",children:a.jsx(UT,{onClick:e.onSelectChain,selectedChain:e.selectedChain,client:e.client})}):a.jsx(U,{y:"md"}),a.jsx(b,{px:"md",children:a.jsx($3,{value:e.search,onChange:e.setSearch,placeholder:"Search by token or address",autoFocus:!e.isMobile})}),a.jsx(U,{y:"xs"}),a.jsxs(b,{pb:"md",px:"md",expand:!0,gap:"xxs",flex:"column",style:{minHeight:"300px",maxHeight:e.isMobile?"450px":"none",overflowY:"auto",scrollbarWidth:"none",paddingBottom:R.md},children:[e.isFetching&&new Array(20).fill(0).map((r,s)=>a.jsx(ZT,{},s)),!e.isFetching&&e.ownedTokens.length>0&&a.jsxs(b,{px:"xs",py:"xs",flex:"row",gap:"xs",center:"y",color:"secondaryText",children:[a.jsx(U3,{size:"14"}),a.jsx(A,{size:"sm",color:"secondaryText",style:{overflow:"unset"}
253,children:"Your Tokens"})]}),!e.isFetching&&e.ownedTokens.map(r=>a.jsx(by,{token:r,client:e.client,onSelect:e.onSelectToken,onInfoClick:(s,o)=>n({tokenAddress:s,chainId:o}),isSelected:!!e.selectedToken&&e.selectedToken.tokenAddress.toLowerCase()===r.token_address.toLowerCase()&&r.chain_id===e.selectedToken.chainId},r.token_address)),!e.isFetching&&e.ownedTokens.length>0&&a.jsxs(b,{px:"xs",py:"xs",flex:"row",gap:"xs",center:"y",color:"secondaryText",style:{marginTop:R.sm},children:[a.jsx(gc,{size:"14"}),a.jsx(A,{size:"sm",color:"secondaryText",style:{overflow:"unset"},children:"Other Tokens"})]}),!e.isFetching&&e.otherTokens.map(r=>a.jsx(by,{token:r,client:e.client,onSelect:e.onSelectToken,onInfoClick:(s,o)=>n({tokenAddress:s,chainId:o}),isSelected:!!e.selectedToken&&e.selectedToken.tokenAddress.toLowerCase()===r.address.toLowerCase()&&r.chainId===e.selectedToken.chainId},r.address)),e.showMore&&a.jsxs(ue,{variant:"outline",fullWidth:!0,style:{borderRadius:J.full},gap:"xs",onClick:()=>{var r;(r=e.showMore)==null||r.call(e)},children:[a.jsx(ju,{width:D.sm,height:D.sm}),"Load More"]}),i&&a.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:a.jsx(A,{size:"sm",color:"secondaryText",children:"No Tokens Found"})})]})]})]})}const GT=Fe(e=>{const t=ee();return{display:"flex",flexDirection:"column",overflowY:"auto",...hc,borderRight:`1px solid ${t.colors.separatorLine}`,position:"relative"}});function KT(e){var p,w,x,I,E,j,C,T,v,N,M,S,L,O,P,$;const t=ee(),n=zT(),i=e.receiverAddress??((p=n==null?void 0:n.activeAccount)==null?void 0:p.address),[r,s]=_.useState(!1),[o,c]=_.useState(!1),l=e.receiverAddress&&Zr(e.receiverAddress)&&((w=n==null?void 0:n.activeAccount)!=null&&w.address?xo(e.receiverAddress)!==xo((x=n==null?void 0:n.activeAccount)==null?void 0:x.address):!0),u=OT({tokenAddress:(I=e.selectedToken)==null?void 0:I.tokenAddress,chainId:(E=e.selectedToken)==null?void 0:E.chainId,client:e.client}),d=((j=u.data)==null?void 0:j.type)==="success"?u.data.token:void 0,f=AT({chainId:(C=e.selectedToken)==null?void 0:C.chainId,tokenAddress:(T=e.selectedToken)==null?void 0:T.tokenAddress,client:e.client,walletAddress:(v=n==null?void 0:n.activeAccount)==null?void 0:v.address}),m=l?"Pay":"Buy",y=B3(),g=!e.receiverAddress&&!n;return a.jsxs(s0,{client:e.client,title:e.metadata.title,description:e.metadata.description,image:e.metadata.image,children:[r&&a.jsx(vx,{client:e.client,locale:x1,detailsModal:{hideBuyFunds:!0},theme:e.theme,closeModal:()=>{s(!1)},onDisconnect:()=>{var z;(z=e.onDisconnect)==null||z.call(e)},chains:[],connectOptions:e.connectOptions}),a.jsx(yc,{hide:!1,className:"tw-modal__buy-widget",size:y?"compact":"wide",title:"Select Token",open:o,crossContainerStyles:{right:R.md,top:R["md+"],transform:"none"},setOpen:z=>c(z),autoFocusCrossIcon:!1,children:a.jsx(HT,{type:"buy",currency:e.currency,selections:{buyChainId:(N=e.selectedToken)==null?void 0:N.chainId,sellChainId:void 0},activeWalletInfo:n,onClose:()=>c(!1),client:e.client,selectedToken:e.selectedToken,setSelectedToken:z=>{e.setSelectedToken(z),c(!1)}})}),a.jsxs(b,{flex:"column",children:[a.jsx(JT,{title:m,presetOptions:e.presetOptions,amountSelection:e.amountSelection,setAmount:e.setAmountSelection,activeWalletInfo:n,selectedToken:e.selectedToken?{data:((M=u.data)==null?void 0:M.type)==="success"?u.data.token:void 0,isFetching:u.isFetching,isError:u.isError||((S=u.data)==null?void 0:S.type)==="unsupported_token"}:void 0,balance:{data:f.data,isFetching:f.isFetching},client:e.client,isConnected:!!n,onSelectToken:()=>{c(!0)},onWalletClick:()=>{s(!0)},currency:e.currency,amountEditable:e.amountEditable,tokenEditable:e.tokenEditable}),i&&l&&a.jsxs(a.Fragment,{children:[a.jsx(ev,{}),a.jsx(XT,{address:i,client:e.client})]})]}),a.jsx(U,{y:"md"}),(u.isError||((L=u.data)==null?void 0:L.type)==="unsupported_token")&&a.jsx("div",{style:{border:`1px solid ${t.colors.borderColor}`,borderRadius:J.full,padding:R.xs,marginBottom:R.md},children:a.jsx(A,{size:"sm",color:"danger",center:!0,children:"Failed to fetch token details"})}),g?a.jsx(Lx,{client:e.client,connectButton:{label:e.buttonLabel||m,style:{width:"100%",borderRadius:J.full}},theme:t,...e.connectOptions,autoConnect:!1,wallets:((O=e.connectOptions)==null?void 0:O.wallets)||Sw({appMetadata:(P=e.connectOptions)==null?void 0:P.appMetadata,chains:($=e.connectOptions)==null?void 0:$.chains})}):a.jsx(ue,{disabled:!i,fullWidth:!0,onClick:()=>
253{if(!i||!d)return;const z=d.prices[e.currency],{tokenValue:k}=Y3(e.amountSelection,z);k&&e.onContinue(String(k),d,_e(i))},style:{fontSize:ie.md,borderRadius:J.full},variant:"primary",children:e.buttonLabel||m}),e.showThirdwebBranding?a.jsxs("div",{children:[a.jsx(U,{y:"md"}),a.jsx(Mo,{link:"https://playground.thirdweb.com/payments/fund-wallet"})]}):a.jsx(U,{y:"xxs"}),a.jsx(U,{y:"md"})]})}function Y3(e,t){const n=e.type==="usd"?e.value:t?t*Number(e.value):void 0,i=e.type==="token"?e.value:t?Number(e.value)/t:void 0;return{fiatValue:n,tokenValue:i}}function JT(e){var c,l,u,d,f;const t=ee(),i=BT({chainId:(l=(c=e.selectedToken)==null?void 0:c.data)==null?void 0:l.chainId,client:e.client}).data,r=(d=(u=e.selectedToken)==null?void 0:u.data)==null?void 0:d.prices[e.currency],{fiatValue:s,tokenValue:o}=Y3(e.amountSelection,r);return a.jsxs(H3,{header:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsx(b,{flex:"row",center:"y",gap:"3xs",color:"secondaryText",children:a.jsx(A,{size:"xs",color:"primaryText",style:{letterSpacing:"0.07em",textTransform:"uppercase"},children:e.title})}),e.activeWalletInfo&&a.jsx(jT,{activeWalletInfo:e.activeWalletInfo,client:e.client,onClick:e.onWalletClick})]}),children:[a.jsx(NT,{selectedToken:e.selectedToken,client:e.client,onSelectToken:e.onSelectToken,chain:i,disabled:e.tokenEditable===!1}),a.jsxs(b,{px:"md",py:"md",children:[a.jsx(wy,{value:o?String(o):"",setValue:m=>{e.setAmount({type:"token",value:m})},disabled:e.amountEditable===!1,style:{border:"none",boxShadow:"none",fontSize:ie.xl,fontWeight:500,paddingInline:0,paddingBlock:0,letterSpacing:"-0.025em"}}),a.jsx(U,{y:"xs"}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"2px"},children:[a.jsx(A,{size:"md",color:"secondaryText",style:{flexShrink:0},children:r0(e.currency)}),(f=e.selectedToken)!=null&&f.isFetching?a.jsx(me,{width:"120px",height:"20px",style:{transform:"translateX(4px)"}}):a.jsx(wy,{value:String(s||0),setValue:m=>{e.setAmount({type:"usd",value:m})},disabled:e.amountEditable===!1,style:{border:"none",boxShadow:"none",fontSize:ie.md,fontWeight:400,color:t.colors.secondaryText,paddingInline:0,height:"20px",paddingBlock:0}})]}),e.amountEditable&&a.jsxs(a.Fragment,{children:[a.jsx(U,{y:"md"}),a.jsx(b,{flex:"row",gap:"xxs",children:e.presetOptions.map(m=>{var y;return a.jsxs(ue,{disabled:!((y=e.selectedToken)!=null&&y.data)||e.amountEditable===!1,onClick:()=>e.setAmount({type:"usd",value:String(m)}),style:{backgroundColor:"transparent",color:t.colors.secondaryText,fontSize:ie.xs,fontWeight:400,borderRadius:J.full,gap:"0.5px",padding:`${R.xxs} ${R.sm}`},variant:"outline",children:[a.jsx("span",{children:r0(e.currency)}),a.jsx("span",{children:m})]},m)})})]})]}),e.isConnected&&e.selectedToken&&a.jsx(b,{px:"md",py:"md",style:{borderTop:`1px dashed ${t.colors.borderColor}`,justifyContent:"start"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"3px"},children:[a.jsx(A,{size:"xs",color:"secondaryText",children:"Current Balance"}),e.balance.data===void 0?a.jsx(me,{height:ie.xs,width:"100px"}):a.jsxs(A,{size:"xs",color:"primaryText",children:[pn(e.balance.data.value,e.balance.data.decimals,5)," ",e.balance.data.symbol]})]})})]})}function XT(e){const t=Op({address:e.address,client:e.client});return a.jsx(H3,{header:a.jsx(A,{size:"xs",color:"primaryText",style:{letterSpacing:"0.07em",textTransform:"uppercase"},children:"To"}),children:a.jsxs(b,{px:"md",py:"md",flex:"row",center:"y",gap:"xs",color:"secondaryText",children:[a.jsx(U3,{size:D.xs,color:"secondaryText"}),a.jsx(A,{size:"sm",color:"primaryText",children:t.data||Mn(e.address)}),a.jsx(js,{text:e.address,tip:"Copy address",iconSize:14})]})})}function H3(e){const t=ee();return a.jsxs(b,{style:{borderRadius:J.xl,borderWidth:1,borderStyle:"solid",position:"relative",overflow:"hidden"},borderColor:"borderColor",children:[a.jsx(b,{bg:"tertiaryBg",style:{position:"absolute",inset:0,opacity:.5,zIndex:0}}),a.jsx(b,{style:{position:"relative",zIndex:1},children:a.jsx(b,{px:"md",py:"sm",relative:!0,children:e.header})}),a.jsx(b,{bg:"tertiaryBg",style:{position:"relative",overflow:"hidden",borderRadius:J.xl,borderTop:`1px solid ${t.colors.borderColor}`}
253,children:e.children})]})}function ev(){return a.jsx("div",{style:{display:"flex",justifyContent:"center",marginBlock:"-13px",zIndex:2,position:"relative"},children:a.jsx(b,{p:"xs",center:"both",flex:"row",color:"primaryText",bg:"modalBg",borderColor:"borderColor",style:{borderRadius:J.full,borderWidth:1,borderStyle:"solid"},children:a.jsx(M7,{width:D["sm+"],height:D["sm+"]})})})}function tv(e){var i,r,s,o,c,l,u,d,f;const t=_.useRef(!1);_.useEffect(()=>{var m;t.current||(t.current=!0,ot({client:e.client,event:"ub:ui:buy_widget:render",toChainId:(m=e.chain)==null?void 0:m.id,toToken:e.tokenAddress}))},[e.client,(i=e.chain)==null?void 0:i.id,e.tokenAddress]);const n=_.useMemo(()=>{var m;return e.showThirdwebBranding===!1?{...e.connectOptions,connectModal:{...(m=e.connectOptions)==null?void 0:m.connectModal,showThirdwebBranding:!1}}:e.connectOptions},[e.connectOptions,e.showThirdwebBranding]);return a.jsxs(iv,{theme:e.theme,className:e.className,style:e.style,children:[((r=e.connectOptions)==null?void 0:r.autoConnect)!==!1&&a.jsx(Fw,{client:e.client,wallets:(s=e.connectOptions)==null?void 0:s.wallets,timeout:typeof((o=e.connectOptions)==null?void 0:o.autoConnect)=="object"?(l=(c=e.connectOptions)==null?void 0:c.autoConnect)==null?void 0:l.timeout:void 0,appMetadata:(u=e.connectOptions)==null?void 0:u.appMetadata,accountAbstraction:(d=e.connectOptions)==null?void 0:d.accountAbstraction,chain:(f=e.connectOptions)==null?void 0:f.chain}),a.jsx(nv,{...e,theme:e.theme||"dark",currency:e.currency||"USD",paymentMethods:e.paymentMethods||["crypto","card"],presetOptions:e.presetOptions||[5,10,20],connectOptions:n,showThirdwebBranding:e.showThirdwebBranding===void 0?!0:e.showThirdwebBranding})]})}function nv(e){const[t,n]=_.useState({id:"1:buy-ui"}),i=_.useCallback((f,m)=>{var y,g;console.error(f),(m==null?void 0:m.type)==="buy"||(m==null?void 0:m.type)==="onramp"?(y=e.onError)==null||y.call(e,f,m):(g=e.onError)==null||g.call(e,f,void 0),n({id:"error",preparedQuote:m,error:f})},[e.onError]),r=_.useCallback(f=>{var m,y;(f==null?void 0:f.type)==="buy"||(f==null?void 0:f.type)==="onramp"?(m=e.onCancel)==null||m.call(e,f):(y=e.onCancel)==null||y.call(e,void 0)},[e.onCancel]),[s,o]=_.useState({type:"token",value:e.amount??""}),[c,l]=_.useState(()=>{var f;if((f=e.chain)!=null&&f.id)return{chainId:e.chain.id,tokenAddress:e.tokenAddress||Pt}}),u=e.amountEditable===void 0?!0:e.amountEditable,d=e.tokenEditable===void 0?!0:e.tokenEditable;return t.id==="1:buy-ui"?a.jsx(KT,{theme:e.theme,onDisconnect:e.onDisconnect,client:e.client,connectOptions:e.connectOptions,onContinue:(f,m,y)=>{ot({client:e.client,event:"payment_selection",toChainId:m.chainId,toToken:m.address}),n({id:"2:methodSelection",destinationAmount:f,destinationToken:m,receiverAddress:y})},presetOptions:e.presetOptions,receiverAddress:e.receiverAddress,showThirdwebBranding:e.showThirdwebBranding,metadata:{title:e.title,description:e.description,image:e.image},buttonLabel:e.buttonLabel,currency:e.currency,selectedToken:c,setSelectedToken:l,amountSelection:s,setAmountSelection:o,amountEditable:u,tokenEditable:d}):t.id==="2:methodSelection"?a.jsx(k3,{client:e.client,connectLocale:x1,connectOptions:e.connectOptions,paymentMethods:e.paymentMethods,currency:e.currency,supportedTokens:e.supportedTokens,country:e.country,destinationToken:t.destinationToken,destinationAmount:t.destinationAmount,receiverAddress:t.receiverAddress,feePayer:void 0,onBack:()=>{n({id:"1:buy-ui"})},onError:f=>{i(f,void 0)},onPaymentMethodSelected:f=>{ot({chainId:f.type==="wallet"?f.originToken.chainId:void 0,client:e.client,event:"ub:ui:loading_quote:fund_wallet",fromToken:f.type==="wallet"?f.originToken.address:void 0,toChainId:t.destinationToken.chainId,toToken:t.destinationToken.address}),n({...t,id:"3:load-quote",paymentMethod:f})}}):t.id==="3:load-quote"?a.jsx(P3,{paymentLinkId:e.paymentLinkId,purchaseData:e.purchaseData,client:e.client,sender:void 0,mode:"fund_wallet",feePayer:void 0,amount:t.destinationAmount,destinationToken:t.destinationToken,onBack:()=>{n({...t,id:"2:methodSelection"})},onError:f=>{i(f,void 0)},onQuoteReceived:(f,m)=>{var y,g,p;ot({chainId:f.type==="transfer"||f.type==="onramp"?f.intent.chainId:f.intent.originChainId,client:e.client,event:"payment_details",fromToken:f.type==="transfer"||f.type==="onramp"?f.intent.tokenAddress:f.intent.originTokenAddress,toChainId:f.type==="transfer"||f.type==="onramp"?f.intent.chainId:f.intent.destinationChainId,toToken:f.type==="transfer"||f.type==="onramp"?f.intent.tokenAddress:f.intent.destinationTokenAddress,walletAddress:(g=(y=t.paymentMethod.payerWallet)==null?void 0:y.getAccount())==null?void 0:g.address,walletType:(p=t.paymentMethod.payerWallet)==null?void 0:p.id}),n({...t,id:"4:preview",preparedQuote:f,request:m})},paymentMethod:t.paymentMethod,receiver:t.receiverAddress}):t.id==="4:preview"?a.jsx(A3,{client:e.client,currency:e.currency,metadata:{title:e.title,de
253scription:e.description},confirmButtonLabel:void 0,onBack:()=>{n({...t,id:"2:methodSelection"})},onConfirm:()=>{n({...t,id:"5:execute"})},onError:f=>{i(f,t.preparedQuote)},paymentMethod:t.paymentMethod,preparedQuote:t.preparedQuote,modeInfo:{mode:"fund_wallet"}}):t.id==="5:execute"?a.jsx(R3,{client:e.client,title:void 0,preparedQuote:t.preparedQuote,autoStart:!0,onBack:()=>{n({...t,id:"4:preview"})},onCancel:()=>{r(t.preparedQuote)},onComplete:f=>{var m;(t.preparedQuote.type==="buy"||t.preparedQuote.type==="onramp")&&((m=e.onSuccess)==null||m.call(e,{quote:t.preparedQuote,statuses:f})),n({id:"6:success",preparedQuote:t.preparedQuote,completedStatuses:f})},request:t.request,wallet:t.paymentMethod.payerWallet,windowAdapter:lo}):t.id==="6:success"?a.jsx(z3,{type:"payment-success",client:e.client,hasPaymentId:!!e.paymentLinkId,completedStatuses:t.completedStatuses,onDone:()=>{n({id:"1:buy-ui"})},preparedQuote:t.preparedQuote,showContinueWithTx:!1,windowAdapter:lo}):t.id==="error"?a.jsx(T3,{client:e.client,error:t.error,onCancel:()=>{n({id:"1:buy-ui"}),r(t.preparedQuote)},onRetry:()=>{n({id:"1:buy-ui"})}}):null}function iv(e){return a.jsx(mu,{theme:e.theme||"dark",children:a.jsx(jE,{className:e.className,modalSize:"compact",style:e.style,children:a.jsx(Yw,{children:e.children})})})}const E1=Fe({backgroundColor:"#00d395",borderRadius:"50%",bottom:0,boxShadow:"0 0 0 2px var(--bg)",height:"28%",position:"absolute",right:0,width:"28%"}),rv=e=>{const t=ee();return a.jsx("div",{style:{alignItems:"center",border:`1px solid ${t.colors.borderColor}`,borderRadius:"100%",display:"flex",flexShrink:0,justifyItems:"center",overflow:"hidden",padding:e.padding??"6px",position:"relative",...e.style},children:e.children})};function Ol({formatFn:e,...t}){const{address:n}=cc(),i=e?e(n):n;return a.jsx("span",{...t,children:i})}function ho({chain:e,tokenAddress:t,loadingComponent:n,fallbackComponent:i,queryOptions:r,formatFn:s,showBalanceInFiat:o,...c}){const{address:l,client:u}=cc(),d=jt(),f=e||d,m=pe({queryFn:async()=>TT({address:_e(l),chain:f,client:u,showBalanceInFiat:o,tokenAddress:t?_e(t):void 0}),queryKey:["internal_account_balance",(f==null?void 0:f.id)||-1,l,{tokenAddress:t},o],retry:!1,...r});return m.isLoading?n||null:m.data?s?a.jsx("span",{...c,children:s(m.data)}):o?a.jsx("span",{...c,children:b1({...m.data,decimals:0})}):a.jsx("span",{...c,children:Al({...m.data,decimals:m.data.balance<1?3:2})}):i||null}const Q3=_.createContext(void 0);function Z3(e){return a.jsx(Q3.Provider,{value:e,children:e.children})}function q3(){const e=_.useContext(Q3);if(!e)throw new Error("ChainProviderContext not found. Make sure you are using ChainName, ChainIcon, etc. inside a <ChainProvider /> component");return e}function G3({iconResolver:e,loadingComponent:t,fallbackComponent:n,queryOptions:i,client:r,...s}){const{chain:o}=q3(),c=pe({queryFn:async()=>sv({chain:o,client:r,iconResolver:e}),queryKey:ov({chainId:o.id,iconResolver:e}),...i});return c.isLoading?t||null:c.data?a.jsx("img",{src:c.data,...s,alt:s.alt}):n||null}async function sv(e){var s;const{chain:t,client:n,iconResolver:i}=e;if(typeof i=="string")return i;if(typeof i=="function")return i();if((s=t.icon)!=null&&s.url)return qr({client:n,uri:t.icon.url});const r=await Ht(t).then(o=>{var c;return(c=o.icon)==null?void 0:c.url}).catch(()=>{});if(!r)throw new Error("Failed to resolve icon for chain");return qr({client:n,uri:r})}function ov(e){const{chainId:t,iconResolver:n}=e;return["_internal_chain_icon_",t,{resolver:typeof n=="string"?n:typeof n=="function"?_p(n):void 0}]}function o0({nameResolver:e,formatFn:t,loadingComponent:n,fallbackComponent:i,queryOptions:r,...s}){const{chain:o}=q3(),c=pe({queryFn:async()=>av({chain:o,nameResolver:e}),queryKey:cv({chainId:o.id,nameResolver:e}),...r});if(c.isLoading)return n||null;if(!c.data)return i||null;const l=t?t(c.data):c.data;return a.jsx("span",{...s,children:l})}async function av(e){const{nameResolver:t,chain:n}=e;return typeof t=="string"?t:typeof t=="function"?t():n.name?n.name:Ht(n).then(i=>i.name)}function cv(e){return typeof e.nameResolver=="function"?["_internal_chain_name_",e.chainId,{resolver:_p(e.nameResolver)}]:["_internal_chain_name_",e.chainId]}const lv=({size:e})=>a.jsxs("svg",{fill:"none",height:e,role:"presentation",viewBox:"0 0 16 16",width:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M14.001 8.00048C14.001 9.18726 13.649 10.3474 12.9897 11.3342C12.3304 12.3209 11.3932 13.09 10.2968 13.5442C9.20032 13.9984 7.99382 14.1172 6.82984 13.8857C5.66587 13.6541 4.59668 13.0826 3.7575 12.2435C2.91832 11.4043 2.34683 10.3351 2.1153 9.17111C1.88377 8.00713 2.0026 6.80064 2.45676 5.70419C2.91092 4.60775 3.68002 3.6706 4.66679 3.01126C5.65357 2.35192 6.8137 2 8.00048 2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2001"}),a.jsx("path",{d:"M14.0005 2L8 8.00048",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2001"}),a.jsx("path",{d:"M10.3984 2H13.9987V5.60029",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2001"})]}),ii=$i(e=>{const t=ee();return{all:"unset","&:hover":{backgroundColor:t.colors.tertiaryBg,svg:{color:t.colors.accentText}},"&[data-variant='danger']:hover svg":{color:`${t.colors.danger}!important`},"&[data-variant='primary']:hover svg":{color:`${t.colors.primaryText}!important`},"&[disabled]":{cursor:"not-allowed"},alignItems:"center",backgroundColor:"transparent",borderRadius:J.md,boxSizing:"border-box",color:t.colors.secondaryText,cursor:"pointer",display:"flex",fontSize:ie.md,fontWeight:500,gap:R.sm,lineHeight:1.3,padding:`${R.sm} ${R.sm}`,svg:{color:t.colors.secondaryText,transition:"color 200ms ease"},transition:"background-color 200ms ease, transform 200ms ease",WebkitTapHighlightColor:"transparent",width:"100%"}}),uv=ii.withComponent("a");function K3(e,t){const[n,i]=_.useState(e),r=_.useCallback(s=>{if(!s)return;new IntersectionObserver(c=>{var l;(l=c[0])!=null&&l.isIntersecting&&i(u=>u+t)},{threshold:1}).observe(s)},[t]);return{itemsToShow:n,lastItemRef:r}}function J3(e){var v,N,M,S;const t=e.connectLocale.networkSelector,[n,i]=_.useState(""),[r,s]=_.useState("all"),o=Uu(n,300),{onSwitch:c,onCustomClick:l}=e.networkSelector||{},u=t.categoryLabel.others,d=t.categoryLabel.popular,f=t.categoryLabel.recentlyUsed,{chainSections:m,allChains:y,allChainsToSectionMap:g}=_.useMemo(()=>{var k,B,W,V;const L=[],O=[],P=new Map;function $(F,Y){P.set(F.id,Y),O.push(F)}if((k=e.networkSelector)!=null&&k.sections)for(const F of e.networkSelector.sections){const Y=F.chains.filter(Q=>!P.has(Q.id));if(Y.length>0){L.push({chains:Y,label:F.label});for(const Q of Y)$(Q,F.label)}}else{const F=new Map(e.chains.map(Y=>[Y.id,Y]));if((B=e.networkSelector)!=null&&B.recentChainIds&&((W=e.networkSelector)==null?void 0:W.recentChainIds.length)>0){const Y=e.networkSelector.recentChainIds.map(Q=>F.get(Q)).filter(Q=>Q!==void 0);L.push({chains:Y,label:f});for(const Q of Y)$(Q,f)}if((V=e.networkSelector)!=null&&V.popularChainIds&&e.networkSelector.popularChainIds.length>0){const Q=e.networkSelector.popularChainIds.map(Z=>F.get(Z)).filter(Z=>Z!==void 0).filter(Z=>!P.has(Z.id));if(Q.length>0){L.push({chains:Q,label:d});
253for(const Z of Q)$(Z,d)}}}const z=e.chains.filter(F=>!P.has(F.id));if(z.length>0){L.push({chains:z,label:u});for(const F of z)$(F,u)}return{allChains:O,allChainsToSectionMap:P,chainSections:L}},[(v=e.networkSelector)==null?void 0:v.sections,(N=e.networkSelector)==null?void 0:N.recentChainIds,(M=e.networkSelector)==null?void 0:M.popularChainIds,e.chains,f,d,u]),p=y.every(L=>!!L.name),w=xp(p?[]:y,10),x=p?!1:w.some(L=>L.isLoading),I=p?y:x?[]:w.filter(L=>!!L.data).map(L=>nu(L.data)),E=_.useMemo(()=>new J4(I,{keys:[{name:"name",weight:1},{name:"chainId",weight:1}],threshold:.4}),[I]),j=_.useMemo(()=>{if(o==="")return;const L=[],O=E.search(o).map(P=>P.item);for(const P of O){const $=g.get(P.id);if(!$)return;const z=L.find(k=>k.label===$);z?z.chains.push(P):L.push({chains:[P],label:$})}return L},[o,E,g])||m,C=_.useMemo(()=>r==="all"?j:j.map(L=>({chains:L.chains.filter(O=>r==="mainnet"&&!O.testnet||r==="testnet"&&O.testnet),label:L.label})),[j,r]),T=_.useCallback(L=>{c&&c(L),e.closeModal()},[c,e]);return a.jsxs(b,{className:e.className,children:[a.jsx(b,{p:"lg",children:e.onBack?a.jsx(Me,{onBack:e.onBack,title:t.title}):a.jsx(Su,{children:t.title})}),e.showTabs!==!1&&a.jsxs(a.Fragment,{children:[a.jsx(b,{px:"lg",children:a.jsxs(b,{flex:"row",gap:"xxs",children:[a.jsx(zd,{"data-active":r==="all",onClick:()=>s("all"),children:t.allNetworks}),a.jsx(zd,{"data-active":r==="mainnet",onClick:()=>s("mainnet"),children:t.mainnets}),a.jsx(zd,{"data-active":r==="testnet",onClick:()=>s("testnet"),children:t.testnets})]})}),a.jsx(U,{y:"lg"})]}),e.showTabs===!1&&a.jsx(U,{y:"xxs"}),a.jsx(b,{px:"lg",children:a.jsxs("div",{style:{alignItems:"center",display:"flex",position:"relative"},children:[a.jsx(gv,{height:D.md,width:D.md}),a.jsx(Jr,{disabled:x,onChange:L=>{i(L.target.value)},placeholder:x?"Loading chains...":t.inputPlaceholder,style:{padding:`${R.sm} ${R.md} ${R.sm} ${R.xxl}`},tabIndex:-1,value:n,variant:"outline"}),(o!==n||x)&&a.jsx("div",{style:{position:"absolute",right:R.md},children:a.jsx(Qe,{color:"accentText",size:"md"})})]})}),a.jsx(U,{y:"lg"}),a.jsx(b,{px:"md",children:a.jsx(dv,{chainSections:C,client:e.client,close:e.closeModal,connectLocale:e.connectLocale,onSwitch:T,renderChain:(S=e.networkSelector)==null?void 0:S.renderChain})}),l&&a.jsxs(a.Fragment,{children:[a.jsx(He,{}),a.jsx(b,{p:"lg",children:a.jsx(ue,{fullWidth:!0,onClick:()=>{l(),e.closeModal()},style:{boxShadow:"none",display:"flex",fontSize:ie.sm},variant:"link",children:t.addCustomNetwork})})]})]})}const dv=e=>{const{chainSections:t}=e,n=t.every(i=>i.chains.length===0);return a.jsx(b,{animate:"fadein",scrollY:!0,style:{height:"330px",paddingBottom:R.lg},children:n?a.jsxs(b,{center:"both",color:"secondaryText",flex:"column",gap:"md",children:[a.jsx(U,{y:"xl"}),a.jsx(is,{height:D.xl,width:D.xl}),a.jsx(A,{children:" No Results "})]}):t.map((i,r)=>i.chains.length===0?null:a.jsxs(_.Fragment,{children:[r!==0&&a.jsx(U,{y:"lg"}),a.jsx(fv,{children:i.label}),a.jsx(U,{y:"xs"}),a.jsx(hv,{chains:i.chains,client:e.client,close:e.close,connectLocale:e.connectLocale,onSwitch:e.onSwitch,renderChain:e.renderChain})]},i.label))})},hv=_.memo(function(t){const{itemsToShow:n,lastItemRef:i}=K3(10,10),r=Uf(),s=jt(),[o,c]=_.useState(-1),[l,u]=_.useState(-1),d=t.close;_.useEffect(()=>{o!==-1&&(s==null?void 0:s.id)===o&&d&&d()},[o,d,s==null?void 0:s.id]);const f=async g=>{u(-1),c(g.id);try{await r(g),t.onSwitch(g)}catch(p){u(g.id),console.error(p)}finally{c(-1)}},m=t.renderChain,y=t.chains.slice(0,n);return a.jsx(mv,{children:y.map((g,p)=>{if(!g)return null;const w=o===g.id,x=l===g.id,I=p===y.length-1;return a.jsx("li",{ref:I?i:void 0,children:m?a.jsx(m,{chain:g,close:t.close,switchChain:()=>{f(g)},switchFailed:l===g.id,switching:o===g.id}):a.jsx(X3,{chain:g,client:t.client,confirming:w,connectLocale:t.connectLocale,onClick:()=>f(g),switchingFailed:x})},g.id)})})}),X3=_.memo(function(t){const n=t.connectLocale,{chain:i,confirming:r,switchingFailed:s}=t,o=jt();return a.jsx(Z3,{chain:i,children:a.jsxs(yv,{"data-active":(o==null?void 0:o.id)===i.id,onClick:t.onClick,children:[a.jsxs(b,{style:{alignItems:"center",display:"flex",flexShrink:0,position:"relative"},children:[a.jsx(G3,{client:t.client,fallbackComponent:a.jsx("img",{alt:"",src:Xr,style:{height:`${D.lg}px`,width:`${D.lg}px`}}),loading:"lazy",loadingComponent:a.jsx(me,{height:`${D.lg}px`,width:`${D.lg}px`}),style:{height:`${D.lg}px`,width:`${D.lg}px`}}),(o==null?void 0:o.id)===i.id&&a.jsx(E1,{className:"tw-chain-active-dot-button-network-selector"})]}),r||s?a.jsxs(b,{flex:"column",gap:"3xs",style:{alignItems:"flex-start",width:"100%"},children:[a.jsx(o0,{loadingComponent:a.jsx(me,{height:"20px",width:"150px"})}),a.jsxs(b,{animate:"fadein",center:"y",flex:"row",gap:"xxs",children:[r&&a.jsxs(a.Fragment,{children:[a.jsx(A,{color:"accentText",size:"xs",children:n.switchingNetwork}),a.jsx(Qe,{color:"accentText",size:"xs"})]}),s&&a.jsx(b,{animate:"fadein",children:a.jsx(A,{color:"danger",size:"xs",children:n.networkSelector.failedToSwitch})})]})]}):a.jsx(o0,{className:"tw-chain-icon-none-confirming",loadingComponent:a.jsx(me,{height:"20px",width:"150px"})})]})})}),zd=nt.button(e=>{const t=ee();return{all:"unset","&[data-active='true']":{background:t.colors.secondaryButtonBg,color:t.colors.primaryText},borderRadius:J.lg,color:t.colors.secondaryText,cursor:"pointer",fontSize:ie.sm,fontWeight:500,padding:`${R.sm} ${R.sm}`,transition:"background 0.2s ease, color 0.2s ease",WebkitTapHighlightColor:"transparent"}}),fv=_7(()=>({color:ee().colors.secondaryText,display:"block",fontSize:ie.sm,margin:0,padding:`0 ${R.xs}`})),mv=sw({boxSizing:"border-box",display:"flex",flexDirection:"column",gap:R.xs,listStyle:"none",margin:0,padding:0}),yv=$i(e=>{const t=ee();return{"&:hover":{background:t.colors.secondaryButtonBg},all:"unset",alignItems:"center",borderRadius:J.md,boxSizing:"border-box",color:t.colors.primaryText,cursor:"pointer",display:"flex",fontSize:ie.md,fontWeight:500,gap:R.md,padding:`${R.xs} ${R.sm}`,transition:"background 0.2s ease",width:"100%",[bf.mobile]:{fontSize:ie.sm}}}),gv=nt(Xf)(e=>({color:ee().colors.secondaryText,left:R.sm,position:"absolute"}));function pv(e){var o;const[t,n]=_.useState("wallets"),i=Ps(),r=Lp(),s=!e.showAllWallets&&((o=e.wallets)==null?void 0:o.every(c=>i.includes(c)));return t==="connect"?a.jsx(O3,{...e,isEmbed:!1,onSelect:c=>{r(c),e.onBack()}}):a.jsxs(b,{children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:"Wallets"})}),a.jsx(He,{}),a.jsx(U,{y:"md"}),a.jsx(b,{px:"md",style:{minHeight:"150px"},children:a.jsx(b,{flex:"column",gap:"xs",children:i.filter(c=>{var l;return!((l=e.hiddenWallets)!=null&&l.includes(c.id))}).map(c=>a.jsx(wv,{chain:e.activeChain,client:e.client,onClick:()=>{r(c),e.onBack()},wallet:c},c.id))})}),a.jsx(U,{y:"xxl"}),a.jsx(b,{p:"lg",children:!s&&a.jsxs(ue,{fullWidth:!0,gap:"xs",onClick:()=>{n("connect")},variant:"accent",children:[a.jsx(ju,{height:D.sm,width:D.sm}),"Connect Wallet"]})})]})}function wv(e){var c;const t=ee(),n=ft(),{disconnect:i}=oc(),r=e.wallet.id,s=(c=e.wallet.getAccount())==null?void 0:c.address,o=uu({address:s,chain:e.chain,client:e.client});return a.jsxs("div",{style:{position:"relative"},children:[a.jsx(g1,{onClick:e.onClick,style:{justifyContent:"space-between"},children:a.jsxs(b,{center:"y",flex:"row",gap:"md",children:[a.jsx(ai,{client:e.client,id:r,size:D.lg}),a.jsxs(b,{flex:"column",gap:"4xs",children:[a.jsx(A,{color:"primaryText",children:Mn(s||"")}),o.data?a.jsx(A,{color:"secondaryText",size:"xs",weight:400,children:Co(o.data)}):a.jsx(me,{height:ie.sm,width:"100px"})]})]})}),a.jsx("div",{style:{position:"absolute",right:R.xxs,top:"50%",transform:"translateY(-50%)",zIndex:1},children:(n==null?void 0:n.id)===e.wallet.id?a.jsx(Nl,{tip:"Active Wallet",children:a.jsx(rr,{children:a.jsx(Us,{height:D.md,width:D.md})})}):a.jsx(Nl,{tip:"Disconnect",children:a.jsx(rr,{onClick:()=>{i(e.wallet)},children:a.jsx(Y7,{height:D.md,style:{color:t.colors.secondaryText},width:D.md})})})})]})}function _v(){const e=Ps(),t=ur();return Es({mutationFn:async({client:n,profileToUnlink:i,allowAccountDeleti
253on:r=!1})=>{var c;const s=e.find(l=>Xe(l)),o=s?{id:s.id,partnerId:(c=s.getConfig())==null?void 0:c.partnerId}:void 0;await h3({allowAccountDeletion:r,client:n,ecosystem:o,profileToUnlink:i})},onSuccess:()=>{t.invalidateQueries({queryKey:["profiles"]})}})}const bv=e=>a.jsx("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 24 24",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M12 15.5H7.5C6.10444 15.5 5.40665 15.5 4.83886 15.6722C3.56045 16.06 2.56004 17.0605 2.17224 18.3389C2 18.9067 2 19.6044 2 21M19 21V15M16 18H22M14.5 7.5C14.5 9.98528 12.4853 12 10 12C7.51472 12 5.5 9.98528 5.5 7.5C5.5 5.01472 7.51472 3 10 3C12.4853 3 14.5 5.01472 14.5 7.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})});function xv(e){switch(!0){case(e.type==="email"&&e.details.email!==void 0):return e.details.email;case(e.type==="google"&&e.details.email!==void 0):return e.details.email;case(e.type==="phone"&&e.details.phone!==void 0):return e.details.phone;case e.details.address!==void 0:return Mn(e.details.address,6);case(e.type==="cognito"&&e.details.email!==void 0):return e.details.email;case e.type.toLowerCase()==="custom_auth_endpoint":return"Custom Profile";default:return e.type.slice(0,1).toUpperCase()+e.type.slice(1)}}function Iv(e){const{data:t,isLoading:n}=S3({client:e.client});return n?a.jsx(Mt,{}):a.jsxs(b,{style:{minHeight:"300px"},children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:e.locale.manageWallet.linkedProfiles})}),a.jsx(He,{}),a.jsxs(b,{scrollY:!0,style:{height:"300px"},children:[a.jsx(U,{y:"md"}),a.jsxs(b,{px:"sm",children:[a.jsxs(ii,{onClick:()=>{e.setScreen("link-profile")},style:{fontSize:ie.sm},children:[a.jsx(bv,{size:D.lg}),a.jsx(A,{color:"primaryText",children:e.locale.manageWallet.linkProfile})]}),a.jsx(U,{y:"xs"}),t==null?void 0:t.filter(i=>i.type.toLowerCase()!=="guest"&&i.type.toLowerCase()!=="custom_jwt"&&i.type.toLowerCase()!=="custom_auth_endpoint").map(i=>a.jsx(Mv,{client:e.client,enableUnlinking:t.length>1,profile:i},`${JSON.stringify(i)}`))]}),a.jsx(U,{y:"md"})]})]})}function Mv({profile:e,enableUnlinking:t,client:n}){var o,c,l;const{data:i}=j9({address:e.details.address,client:n}),{mutate:r,isPending:s}=_v();return a.jsxs(ii,{as:"div",disabled:!0,style:{cursor:"default",fontSize:ie.sm},children:[i!=null&&i.some(u=>u.avatar)?a.jsx(dt,{client:n,height:D.lg,loading:"eager",src:(o=i==null?void 0:i.find(u=>u.avatar))==null?void 0:o.avatar,style:{borderRadius:"100%"},width:D.lg}):e.details.address!==void 0?a.jsx(b,{style:{borderRadius:"100%",height:"32px",overflow:"hidden",width:"32px"},children:a.jsx(V3,{address:e.details.address,size:32})}):e.type==="passkey"?a.jsx(Vs,{size:D.lg}):e.type==="email"?a.jsx(Au,{size:D.lg}):e.type==="phone"?a.jsx(Ou,{size:D.lg}):a.jsx(dt,{client:n,height:D.lg,loading:"eager",src:l3(e.type),width:D.lg}),a.jsxs("div",{style:{alignItems:"center",display:"flex",flexDirection:"row",flexGrow:1,justifyContent:"space-between"},children:[a.jsx(A,{color:"primaryText",children:((c=i==null?void 0:i.find(u=>u.avatar))==null?void 0:c.name)||xv(e)}),a.jsxs("div",{style:{alignItems:"center",display:"flex",flexDirection:"row",gap:"8px"},children:[((l=i==null?void 0:i.find(u=>u.avatar))==null?void 0:l.name)&&e.details.address&&a.jsx(A,{color:"secondaryText",size:"sm",children:Mn(e.details.address,4)}),t&&a.jsx(rr,{"aria-label":"Unlink",autoFocus:!0,disabled:s,onClick:()=>r({client:n,profileToUnlink:e}),style:{pointerEvents:"auto"},type:"button",children:a.jsx(cw,{height:D.md,style:{color:"inherit"},width:D.md})})]})]})]})}const Cv=[{id:"io.1inch.wallet",name:"1inch Wallet",hasMobileSupport:!0},{id:"com.binance.wallet",name:"Binance Wallet",hasMobileSupport:!0},{id:"com.ledger",name:"Ledger Live",hasMobileSupport:!0},{id:"com.bitpay",name:"BitPay Wallet",hasMobileSupport:!0},{id:"com.bestwallet",name:"Best Wallet",hasMobileSupport:!0},{id:"io.metamask",name:"MetaMask",hasMobileSupport:!0},{id:"com.trustwallet.app",name:"Trust Wallet",hasMobileSupport:!0},{id:"com.fireblocks",name:"Fireblocks",hasMobileSupport:!0},{id:"com.bitget.web3",name:"Bitget Wallet",hasMobileSupport:!0},{id:"pro.tokenpocket",name:"TokenPocket",hasMobileSupport:!0},{id:"com.safepal",name:"SafePal",hasMobileSupport:!0},{id:"org.uniswap",name:"Uniswap Wallet",hasMobileSupport:!0},{id:"io.zerion.wallet",name:"Zerion",hasMobileSupport:!0},{id:"com.elrond.maiar.wallet",name:"xPortal",hasMobileSupport:!0},{id:"com.crypto.wallet",name:"Crypto.com Onchain",hasMobileSupport:!0},{id:"com.bitcoin",name:"Bitcoin.com Wallet",hasMobileSupport:!0},{id:"com.bifrostwallet",name:"Bifrost Wallet",hasMobileSupport:!0},{id:"jp.co.rakuten-wallet",name:"Rakuten Wallet",hasMobileSupport:!0},{id:"com.bybit",name:"Bybit Wallet",hasMobileSupport:!0},{id:"com.blockchain.login",name:"Blockchain.com",hasMobileSupport:!0},{id:"io.trezor",name:"Trezor Suite",hasMobileSupport:!0},{id:"im.token",name:"imToken",hasMobileSupport:!0},{id:"global.safe",name:"Safe",hasMobileSupport:!0},{id:"xyz.ctrl",name:"Ctrl Wallet",hasMobileSupport:!0},{id:"co.arculus",name:"Arculus Wallet",hasMobileSupport:!0},{id:"com.roninchain.wallet",name:"Ronin Wallet",hasMobileSupport:!0},{id:"com.okex.wallet",name:"OKX Wallet",hasMobileSupport:!0},{id:"com.wemixplay",name:"WEMIX Play",hasMobileSupport:!0},{id:"com.tangem",name:"Tangem Wallet",hasMobileSupport:!0},{id:"com.exodus",name:"Exodus",hasMobileSupport:!0},{id:"com.hashpack.wallet",name:"HashPack",hasMobileSupport:!0},{id:"id.co.pintu",name:"Pintu",hasMobileSupport:!0},{id:"network.blackfort",name:"BlackFort Wallet",hasMobileSupport:!0},{id:"com.wigwam.wallet",name:"Wigwam",hasMobileSupport:!0},{id:"app.backpack",name:"Backpack",hasMobileSupport:!0},{id:"app.subwallet",name:"SubWallet",hasMobileSupport:!0},{id:"cc.avacus",name:"Avacus",hasMobileSupport:!0},{id:"me.rainbow",name:"Rainbow",hasMobileSupport:!0},{id:"so.onekey.app.wallet",name:"OneKey",hasMobileSupport:!0},{id:"me.haha",name:"HaHa",hasMobileSupport:!0},{id:"com.bee",name:"BeeWallet",hasMobileSupport:!0},{id:"ag.jup",name:"Jupiter",hasMobileSupport:!0},{id:"app.keplr",name:"Keplr",hasMobileSupport:!0},{id:"org.hot-labs",name:"HOT Wallet",hasMobileSupport:!0},{id:"com.dcentwallet",name:"D'CENT Wallet",hasMobileSupport:!0},{id:"com.kraken",name:"Kraken Wallet ",hasMobileSupport:!0},{id:"com.kucoin",name:"KuCoin Web3 Wallet",hasMobileSupport:!0},{id:"io.magiceden.wallet",name:"Magic Eden",hasMobileSupport:!0},{id:"com.tomi",name:"tomi Wallet",hasMobileSupport:!0},{id:"io.ibvm",name:"IBVM Wallet",hasMobileSupport:!0},{id:"com.mewwallet",name:"MEW wallet",hasMobileSupport:!0},{id:"com.socios.app",name:"Socios.com - Wallet & Tokens",hasMobileSupport:!0},{id:"xyz.argent",name:"Argent",hasMobileSupport:!0},{id:"org.thorwallet",name:"THORWallet",hasMobileSupport:!0},{id:"io.internetmoney",name:"Internet Money",hasMobileSupport:!0},{id:"org.mathwallet",name:"MathWallet",hasMobileSupport:!0},{id:"io.cypherhq",name:"Cypher Wallet",hasMobileSupport:!0},{id:"io.novawallet",name:"Nova Wallet",hasMobileSupport:!0},{id:"io.yowallet",name:"YoWallet",hasMobileSupport:!0},{id:"com.flowfoundation.wallet",name:"Flow Wallet",hasMobileSupport:!0},{id:"app.kabila",name:"Kabila Wallet",hasMobileSupport:!0},{id:"com.opera",name:"Opera Crypto Browser",hasMobileSupport:!0},{id:"com.valoraapp",name:"Valora",hasMobileSupport:!0},{id:"com.robinhood.wallet",name:"Robinhood Wallet",hasMobileSupport:!0},{id:"com.chain",name:"Chain",hasMobileSupport:!0},{id:"io.huddln",name:"Huddln",hasMobileSupport:!0},{id:"app.core.extension",name:"Core",hasMobileSupport:!0},{id:"world.freedom",name:"Freedom World",hasMobileSupport:!0},{id:"money.unstoppable",name:"Unstoppable Wallet",hasMobileSupport:!0},{id:"pk.modular",name:"Modular Wallet Prod",hasMobileSupport:!0},{id:"app.wombat",name:"Wombat",hasMobileSupport:!0},{id:"com.klipwallet",name:"klip",hasMobileSupport:!0},{id:"com.gemwallet",name:"Gem Wallet",hasMobileSupport:!0},{id:"com.sabay.wallet",name:"Sabay Wallet App",hasMobileSupport:!0},{id:"com.zengo",name:"Zengo Wallet",hasMobileSupport:!0},{id:"xyz.joeywallet",name:"Joey Wallet",hasMobileSupport:!0},{id:"io.tokoin",name:"Tokoin | My-T Wallet",hasMobileSupport:!0}
253,{id:"io.alpha-u.wallet.web",name:"αU wallet",hasMobileSupport:!0},{id:"network.cvl",name:"CVL Wallet",hasMobileSupport:!0},{id:"io.leapwallet",name:"Leap",hasMobileSupport:!0},{id:"io.xenea",name:"XENEA Wallet",hasMobileSupport:!0},{id:"com.oasys-wallet",name:"Oasys Passport",hasMobileSupport:!0},{id:"com.bitso",name:"Bitso Web3 Wallet",hasMobileSupport:!0},{id:"io.enjin",name:"Enjin Wallet",hasMobileSupport:!0},{id:"com.coldwallet",name:"Cold Wallet",hasMobileSupport:!0},{id:"org.creditcoin.app",name:"Credit Wallet",hasMobileSupport:!0},{id:"app.everspace",name:"Everspace",hasMobileSupport:!0},{id:"app.zeal",name:"Zeal",hasMobileSupport:!0},{id:"app.whitewallet",name:"Whitewallet",hasMobileSupport:!0},{id:"ai.purewallet",name:"PureWallet app",hasMobileSupport:!0},{id:"com.fastex.wallet",name:"Yo Wallet",hasMobileSupport:!0},{id:"io.kriptomat",name:"Kriptomat",hasMobileSupport:!0},{id:"com.ullapay",name:"WOW EARN",hasMobileSupport:!0},{id:"io.atomicwallet",name:"Atomic Wallet",hasMobileSupport:!0},{id:"com.pionewallet",name:"PioneWallet",hasMobileSupport:!0},{id:"io.oxalus",name:"Oxalus Wallet",hasMobileSupport:!0},{id:"xyz.uniultra.wallet",name:"U2U Wallet",hasMobileSupport:!0},{id:"xyz.frontier.wallet",name:"Frontier",hasMobileSupport:!0},{id:"com.coolbitx.cwsapp",name:"CoolWallet",hasMobileSupport:!0},{id:"org.gooddollar",name:"GoodDollar",hasMobileSupport:!0},{id:"com.cakewallet",name:"Cake Wallet",hasMobileSupport:!0},{id:"com.ellipal",name:"ELLIPAL",hasMobileSupport:!0},{id:"app.krystal",name:"Krystal",hasMobileSupport:!0},{id:"com.monarchwallet",name:"Monarch Wallet",hasMobileSupport:!0},{id:"com.burritowallet",name:"Burrito",hasMobileSupport:!0},{id:"co.family.wallet",name:"Family",hasMobileSupport:!0},{id:"com.mtpelerin",name:"Bridge Wallet",hasMobileSupport:!0},{id:"app.keyring",name:"KEYRING PRO",hasMobileSupport:!0},{id:"cc.localtrade.lab",name:"LocalTrade Wallet",hasMobileSupport:!0},{id:"tech.okto",name:"Okto",hasMobileSupport:!0},{id:"com.xcapit",name:"Xcapit",hasMobileSupport:!0},{id:"com.gayawallet",name:"Gaya Wallet",hasMobileSupport:!0},{id:"app.nightly",name:"Nightly",hasMobileSupport:!0},{id:"com.coin98",name:"Coin98 Super Wallet",hasMobileSupport:!0},{id:"xyz.coca",name:"COCA Wallet",hasMobileSupport:!0},{id:"app.linen",name:"Linen",hasMobileSupport:!0},{id:"dev.auroracloud",name:"Aurora Pass",hasMobileSupport:!0},{id:"com.coinomi",name:"Coinomi",hasMobileSupport:!0},{id:"my.mone",name:"mOne superapp",hasMobileSupport:!0},{id:"org.alephium",name:"Alephium Wallet",hasMobileSupport:!0},{id:"com.alicebob",name:"Alicebob Wallet",hasMobileSupport:!0},{id:"io.koalawallet",name:"Koala Wallet",hasMobileSupport:!0},{id:"com.veworld",name:"VeWorld Mobile",hasMobileSupport:!0},{id:"com.withpaper",name:"Paper",hasMobileSupport:!0},{id:"io.noone",name:"Noone Wallet",hasMobileSupport:!0},{id:"network.haqq",name:"HAQQ Wallet",hasMobileSupport:!0},{id:"io.ricewallet",name:"RiceWallet",hasMobileSupport:!0},{id:"me.iopay",name:"ioPay",hasMobileSupport:!0},{id:"app.walletnow",name:"NOW Wallet",hasMobileSupport:!0},{id:"io.okse",name:"Okse Wallet",hasMobileSupport:!0},{id:"network.over",name:"OverFlex",hasMobileSupport:!0},{id:"com.aktionariat",name:"Aktionariat",hasMobileSupport:!0},{id:"com.paybolt",name:"PayBolt",hasMobileSupport:!0},{id:"com.plasma-wallet",name:"Plasma Wallet",hasMobileSupport:!0},{id:"org.bytebank",name:"ByteBank",hasMobileSupport:!0},{id:"io.ethermail",name:"EtherMail",hasMobileSupport:!0},{id:"com.optowallet",name:"Opto Wallet",hasMobileSupport:!0},{id:"finance.openwallet",name:"Open Wallet",hasMobileSupport:!0},{id:"xyz.sequence",name:"Sequence Wallet",hasMobileSupport:!0},{id:"com.foxwallet",name:"FoxWallet",hasMobileSupport:!0},{id:"app.hbwallet",name:"HB WALLET",hasMobileSupport:!0},{id:"it.airgap",name:"AirGap Wallet",hasMobileSupport:!0},{id:"com.holdstation",name:"Holdstation Wallet",hasMobileSupport:!0},{id:"io.universaleverything",name:"UniversalProfiles",hasMobileSupport:!0},{id:"com.abra",name:"Abra Wallet",hasMobileSupport:!0},{id:"org.thepulsewallet",name:"The Pulse Wallet",hasMobileSupport:!0},{id:"com.premanft",name:"PREMA Wallet",hasMobileSupport:!0},{id:"xyz.timelesswallet",name:"Timeless Wallet",hasMobileSupport:!0},{id:"org.bitizen",name:"Bitizen",hasMobileSupport:!0},{id:"app.ultimate",name:"Ultimate",hasMobileSupport:!0},{id:"io.compasswallet",name:"Compass Wallet",hasMobileSupport:!0},{id:"app.fizzwallet",name:"Fizz",hasMobileSupport:!0},{id:"com.xovawallet",name:"Xova",hasMobileSupport:!0},{id:"app.nicegram",name:"Nicegram Wallet",hasMobileSupport:!0},{id:"io.zelcore",name:"Zelcore",hasMobileSupport:!0},{id:"app.freighter",name:"Freighter",hasMobileSupport:!0},{id:"app.stickey",name:"Stickey Wallet",hasMobileSupport:!0},{id:"app.coinstats",name:"CoinStats",hasMobileSupport:!0},{id:"io.harti",name:"HARTi Wallet",hasMobileSupport:!0},{id:"io.dttd",name:"DTTD",hasMobileSupport:!0},{id:"com.tellaw",name:"Tellaw Wallet",hasMobileSupport:!0},{id:"io.klever",name:"Klever Wallet",hasMobileSupport:!0},{id:"com.unstoppabledomains",name:"Unstoppable Domains",hasMobileSupport:!0},{id:"is.callback",name:"Callback",hasMobileSupport:!0},{id:"ai.pundi",name:"Pundi Wallet",hasMobileSupport:!0}
253,{id:"io.summonersarena",name:"SA ASSISTANT",hasMobileSupport:!0},{id:"io.fizen",name:"Fizen Wallet",hasMobileSupport:!0},{id:"fi.pillar",name:"Pillar",hasMobileSupport:!0},{id:"world.ixo",name:"Impact Wallet",hasMobileSupport:!0},{id:"org.thetatoken",name:"Theta Wallet",hasMobileSupport:!0},{id:"net.gateweb3",name:"GateWallet",hasMobileSupport:!0},{id:"app.ammer",name:"Ammer Wallet",hasMobileSupport:!0},{id:"us.binance",name:"Binance.US",hasMobileSupport:!0},{id:"io.yusetoken",name:"Yuse Wallet",hasMobileSupport:!0},{id:"co.muza",name:"MUZA",hasMobileSupport:!0},{id:"io.hyperpay",name:"HyperPay",hasMobileSupport:!0},{id:"io.cosmostation",name:"Cosmostation",hasMobileSupport:!0},{id:"app.ryipay",name:"RYIPAY",hasMobileSupport:!0},{id:"io.wallet3",name:"Wallet 3",hasMobileSupport:!0},{id:"org.dota168",name:"MetaWallet",hasMobileSupport:!0},{id:"com.bitpie",name:"Bitpie",hasMobileSupport:!0},{id:"com.coininn",name:"Coininn Wallet",hasMobileSupport:!0},{id:"me.easy",name:"EASY",hasMobileSupport:!0},{id:"io.shido",name:"Shido App",hasMobileSupport:!0},{id:"com.neonwallet",name:"Neon Wallet",hasMobileSupport:!0},{id:"com.secuxtech",name:"SecuX",hasMobileSupport:!0},{id:"com.unitywallet",name:"Unity Wallet",hasMobileSupport:!0},{id:"io.miraiapp",name:"Mirai App",hasMobileSupport:!0},{id:"com.beexo",name:"Beexo",hasMobileSupport:!0},{id:"social.halo",name:"Halo Wallet",hasMobileSupport:!0},{id:"com.gemspocket",name:"Gems Pocket",hasMobileSupport:!0},{id:"app.status",name:"Status",hasMobileSupport:!0}
253,{id:"com.midoin",name:"midoin",hasMobileSupport:!0},{id:"id.competence",name:"Competence.id",hasMobileSupport:!0},{id:"com.safemoon",name:"SafeMoon",hasMobileSupport:!0},{id:"llc.besc",name:"BeanBag",hasMobileSupport:!0},{id:"baby.smart",name:"Smart.Baby",hasMobileSupport:!0},{id:"app.onto",name:"ONTO",hasMobileSupport:!0},{id:"com.ivirse",name:"IApp",hasMobileSupport:!0},{id:"one.mixin.messenger",name:"Mixin Messenger",hasMobileSupport:!0},{id:"cash.abpay",name:"AB Pay",hasMobileSupport:!0},{id:"ch.dssecurity",name:"DS Security SA",hasMobileSupport:!0},{id:"com.concordium.wallet",name:"Concordium",hasMobileSupport:!0},{id:"io.zkape",name:"Ape Wallet",hasMobileSupport:!0},{id:"com.paliwallet",name:"Pali Wallet",hasMobileSupport:!0},{id:"io.pitaka",name:"Pitaka",hasMobileSupport:!0},{id:"com.saitamatoken",name:"SaitaPro",hasMobileSupport:!0},{id:"org.mugambo",name:"rss wallet",hasMobileSupport:!0},{id:"fi.stablez",name:"Stablez",hasMobileSupport:!0},{id:"io.legacynetwork",name:"Legacy Wallet",hasMobileSupport:!0},{id:"com.meld.app",name:"MELDapp",hasMobileSupport:!0},{id:"io.bladewallet",name:"Blade Wallet",hasMobileSupport:!0},{id:"com.authentrend",name:"AT.Wallet",hasMobileSupport:!0},{id:"com.webauth",name:"WebAuth",hasMobileSupport:!0},{id:"xyz.tucop",name:"TuCOP Wallet",hasMobileSupport:!0},{id:"pro.fintoken",name:"FINTOKEN",hasMobileSupport:!0},{id:"io.nash",name:"Nash",hasMobileSupport:!0},{id:"vc.uincubator.api",name:"UIIC",hasMobileSupport:!0},{id:"io.unagi.unawallet",name:"una Wallet",hasMobileSupport:!0},{id:"io.nonbank",name:"NonBank",hasMobileSupport:!0},{id:"io.armana.portal",name:"Armana Portal",hasMobileSupport:!0},{id:"com.x9wallet",name:"X9Wallet",hasMobileSupport:!0},{id:"io.kigo",name:"Kigo",hasMobileSupport:!0},{id:"com.alphawallet",name:"AlphaWallet",hasMobileSupport:!0},{id:"com.getcogni",name:"Cogni ",hasMobileSupport:!0},{id:"app.sinum",name:"Sinum",hasMobileSupport:!0},{id:"finance.soulswap.app",name:"SoulSwap",hasMobileSupport:!0},{id:"io.loopring.wallet",name:"Loopring",hasMobileSupport:!0},{id:"com.shapeshift",name:"ShapeShift",hasMobileSupport:!0},{id:"io.trinity-tech",name:"Essentials",hasMobileSupport:!0},{id:"money.keychain",name:"Keychain",hasMobileSupport:!0},{id:"com.superhero.cordova",name:"Superhero Wallet",hasMobileSupport:!0},{id:"com.bettatrade",name:"Bettatrade",hasMobileSupport:!0},{id:"online.puzzle",name:"Puzzle Wallet",hasMobileSupport:!0},{id:"gg.indi",name:"IndiGG",hasMobileSupport:!0},{id:"io.tradestrike",name:"StrikeX Wallet",hasMobileSupport:!0},{id:"xyz.echooo",name:"Echooo Wallet",hasMobileSupport:!0},{id:"com.kryptogo",name:"KryptoGO Wallet",hasMobileSupport:!0},{id:"io.trustasset",name:"Trust Asset Wallet",hasMobileSupport:!0},{id:"app.utorg",name:"UTORG",hasMobileSupport:!0},{id:"app.dfinnwallet",name:"Dfinn Wallet",hasMobileSupport:!0},{id:"org.rezor",name:"Rezor",hasMobileSupport:!0},{id:"io.legionnetwork",name:"LegionNetwork",hasMobileSupport:!0},{id:"cc.maxwallet",name:"MaxWallet",hasMobileSupport:!0},{id:"com.ripio",name:"Ripio Portal",hasMobileSupport:!0},{id:"com.fxwallet",name:"FxWallet",hasMobileSupport:!0},{id:"inc.tomo",name:"Tomo Wallet",hasMobileSupport:!0},{id:"me.komet.app",name:"Komet",hasMobileSupport:!0},{id:"io.guardiianwallet",name:"GUARDIIAN Wallet",hasMobileSupport:!0},{id:"io.hacken.hai",name:"hAI by Hacken",hasMobileSupport:!0},{id:"com.zypto",name:"Zypto",hasMobileSupport:!0},{id:"io.nabox",name:"Nabox",hasMobileSupport:!0},{id:"com.tastycrypto",name:"tastycrypto",hasMobileSupport:!0},{id:"com.ballet",name:"Ballet Crypto",hasMobileSupport:!0},{id:"io.talken",name:"Talken Wallet",hasMobileSupport:!0},{id:"io.wallacy",name:"Wallacy",hasMobileSupport:!0},{id:"network.mrhb",name:"Sahal Wallet",hasMobileSupport:!0},{id:"io.pockie",name:"pockie",hasMobileSupport:!0},{id:"me.astrox",name:"Me Wallet",hasMobileSupport:!0},{id:"com.thirdweb",name:"thirdweb",hasMobileSupport:!0},{id:"com.poolsmobility.wallet",name:"poolswallet",hasMobileSupport:!0},{id:"xyz.roam.wallet",name:"Roam",hasMobileSupport:!0},{id:"app.gamic",name:"Gamic",hasMobileSupport:!0},{id:"app.m1nty",name:"M1NTY",hasMobileSupport:!0},{id:"network.trustkeys",name:"TrustKeys Web3 SocialFi",hasMobileSupport:!0},{id:"com.caesiumlab",name:"Caesium",hasMobileSupport:!0},{id:"app.catecoin",name:"Catecoin Wallet",hasMobileSupport:!0},{id:"com.hootark",name:"HootArk",hasMobileSupport:!0},{id:"com.crossmint",name:"Crossmint",hasMobileSupport:!0},{id:"com.coincircle",name:"CoinCircle",hasMobileSupport:!0},{id:"io.bharatbox",name:"BharatBox App",hasMobileSupport:!0},{id:"nl.greenhood.wallet",name:"Greenhood",hasMobileSupport:!0},{id:"co.swopme",name:"SWOP",hasMobileSupport:!0},{id:"com.kresus",name:"Kresus SuperApp",hasMobileSupport:!0},{id:"com.dolletwallet",name:"Dollet",hasMobileSupport:!0},{id:"net.shinobi-wallet",name:"Shinobi-Wallet",hasMobileSupport:!0},{id:"com.azcoiner",name:"AZCoiner",hasMobileSupport:!0},{id:"com.passwallet.app",name:"Pass App",hasMobileSupport:!0},{id:"app.qubic.wallet",name:"Qubic Wallet",hasMobileSupport:!0},{id:"com.coinex.wallet",name:"CoinEx Wallet",hasMobileSupport:!0},{id:"app.xverse",name:"Xverse Wallet",hasMobileSupport:!0},{id:"com.flash-wallet",name:"Flash Wallet",hasMobileSupport:!0},{id:"com.vgxfoundation",name:"VGX Wallet",hasMobileSupport:!0},{id:"org.arianee",name:"Arianee Wallet",hasMobileSupport:!0},{id:"io.myabcwallet",name:"ABC Wallet",hasMobileSupport:!0},{id:"io.owallet",name:"OWallet",hasMobileSupport:!0},{id:"io.zelus",name:"Zelus Wallet",hasMobileSupport:!0},{id:"net.myrenegade",name:"Renegade",hasMobileSupport:!0},{id:"io.clingon",name:"Cling Wallet",hasMobileSupport:!0},{id:"com.icewal",name:"icewal",hasMobileSupport:!0},{id:"io.streakk",name:"Streakk Wallet",hasMobileSupport:!0},{id:"com.dokwallet",name:"Dokwallet",hasMobileSupport:!0},{id:"finance.porta",name:"PortaWallet",hasMobileSupport:!0},{id:"io.prettygood.x",name:"PrettyGood Keyboard",hasMobileSupport:!0},{id:"io.earthwallet",name:"Earth Wallet",hasMobileSupport:!0},{id:"net.spatium.wallet",name:"Spatium",hasMobileSupport:!0},{id:"live.superex",name:"SuperWallet",hasMobileSupport:!0},{id:"com.adftechnology",name:"ADF Wallet",hasMobileSupport:!0},{id:"com.bscecowallet",name:"BSC Wallet",hasMobileSupport:!0},{id:"io.wallypto",name:"Wallypto",hasMobileSupport:!0},{id:"com.reown",name:"React Native Sample Wallet",hasMobileSupport:!0},{id:"finance.voltage",name:"Volt Wallet",hasMobileSupport:!0},{id:"com.walletconnect",name:"Swift Sample Wallet",hasMobileSupport:!0},{id:"io.passpay",name:"PassPay Wallet",hasMobileSupport:!0}
253,{id:"technology.obvious",name:"Obvious",hasMobileSupport:!0},{id:"io.plutope",name:"Plutope",hasMobileSupport:!0},{id:"io.buzz-up",name:"BUZZUP",hasMobileSupport:!0},{id:"co.xellar",name:"Xellar",hasMobileSupport:!0},{id:"com.kaxaa",name:"KAXAA Wallet",hasMobileSupport:!0},{id:"org.shefi",name:"SheFi",hasMobileSupport:!0},{id:"xyz.orion",name:"Orion",hasMobileSupport:!0},{id:"world.dosi.vault",name:"DOSI Vault",hasMobileSupport:!0},{id:"network.gridlock",name:"Gridlock Wallet",hasMobileSupport:!0},{id:"finance.plena",name:"Plena-App",hasMobileSupport:!0},{id:"cc.dropp",name:"Dropp",hasMobileSupport:!0},{id:"io.scramberry",name:"ScramberryWallet",hasMobileSupport:!0},{id:"xyz.bonuz",name:"Bonuz Social Smart Wallet",hasMobileSupport:!0},{id:"com.bmawallet",name:"BMA Wallet",hasMobileSupport:!0},{id:"co.lifedefi",name:"Life DeFi",hasMobileSupport:!0},{id:"com.get-verso",name:"Verso",hasMobileSupport:!0},{id:"io.blocto",name:"Blocto",hasMobileSupport:!0},{id:"com.pandoshi",name:"Pandoshi Wallet",hasMobileSupport:!0},{id:"io.getclave",name:"Clave",hasMobileSupport:!0},{id:"technology.jambo",name:"Jambo",hasMobileSupport:!0},{id:"app.edge",name:"Edge",hasMobileSupport:!0},{id:"io.banksocial",name:"BankSocial ",hasMobileSupport:!0},{id:"io.konio",name:"Konio",hasMobileSupport:!0},{id:"com.qubetics",name:"QubeticsWallet",hasMobileSupport:!0},{id:"app.imem",name:"iMe Messenger & Crypto Wallet ",hasMobileSupport:!0},{id:"com.purechain",name:"PureWallet",hasMobileSupport:!0},{id:"io.ethos",name:"Ethos Self-Custody Vault",hasMobileSupport:!0},{id:"io.didwallet",name:"DIDWallet",hasMobileSupport:!0},{id:"com.dextrade",name:"DexTrade",hasMobileSupport:!0},{id:"org.kelp",name:"Kelp",hasMobileSupport:!0},{id:"xyz.nestwallet",name:"Nest Wallet",hasMobileSupport:!0},{id:"com.cryptnox",name:"Cryptnox Wallet",hasMobileSupport:!0},{id:"land.liker",name:"LikerLand App",hasMobileSupport:!0},{id:"io.hippowallet",name:"Hippo Wallet",hasMobileSupport:!0},{id:"io.certhis",name:"Certhis",hasMobileSupport:!0},{id:"io.safecryptowallet",name:"SafeWallet",hasMobileSupport:!0},{id:"com.saify",name:"Saify",hasMobileSupport:!0},{id:"com.tiduswallet",name:"Tidus Wallet ",hasMobileSupport:!0},{id:"io.uptn.dapp-web",name:"UPTN",hasMobileSupport:!0},{id:"com.it.onewallet",name:"onewallet",hasMobileSupport:!0},{id:"com.rktechworks",name:"ID Pocket",hasMobileSupport:!0},{id:"com.revelator.wallet",name:"Revelator Wallet",hasMobileSupport:!0},{id:"com.sinohope",name:"Sinohope",hasMobileSupport:!0},{id:"network.dgg",name:"DGG Wallet",hasMobileSupport:!0},{id:"io.up",name:"UP.io",hasMobileSupport:!0},{id:"com.lif3",name:"Lif3 Wallet",hasMobileSupport:!0},{id:"io.bimwallet",name:"BIM Wallet",hasMobileSupport:!0},{id:"pub.dg",name:"DGPub App",hasMobileSupport:!0},{id:"com.wemix",name:"WemixWallet",hasMobileSupport:!0},{id:"com.pierwallet",name:"pier",hasMobileSupport:!0},{id:"net.stasis",name:"Stasis Wallet",hasMobileSupport:!0},{id:"com.peakdefi",name:"PEAKDEFI",hasMobileSupport:!0},{id:"com.3swallet",name:"3S Wallet",hasMobileSupport:!0},{id:"com.example.subdomain",name:"Key3",hasMobileSupport:!0},{id:"com.reown.appkit-lab",name:"Flutter Sample Wallet",hasMobileSupport:!0},{id:"com.opz",name:"OPZ Wallet",hasMobileSupport:!0},{id:"ai.spotonchain.platform",name:"Spot On Chain App",hasMobileSupport:!0},{id:"org.dailychain.wallet",name:"Daily Wallet",hasMobileSupport:!0},{id:"app.omni",name:"Omni",hasMobileSupport:!0},{id:"id.plumaa",name:"Plumaa ID",hasMobileSupport:!0},{id:"io.ttmwallet",name:"MDAO Wallet",hasMobileSupport:!0},{id:"io.kgen",name:"KGeN Wallet",hasMobileSupport:!0},{id:"com.nufinetes",name:"Nufinetes",hasMobileSupport:!0},{id:"com.squirrelwallet",name:"Squirrel Wallet",hasMobileSupport:!0},{id:"eu.trusteeglobal",name:"Trustee Wallet",hasMobileSupport:!0},{id:"com.daffione",name:"DaffiOne",hasMobileSupport:!0},{id:"com.saakuru.app",name:"Saakuru All-in-One crypto App",hasMobileSupport:!0},{id:"io.r0ar",name:"R0AR Mobile Wallet",hasMobileSupport:!0},{id:"com.nodle",name:"Nodle",hasMobileSupport:!0},{id:"app.tofee",name:"Tofee Wallet Official",hasMobileSupport:!0},{id:"io.pltwallet",name:"PLTwallet",hasMobileSupport:!0},{id:"org.talkapp",name:"T+ Wallet ",hasMobileSupport:!0},{id:"io.ready",name:"Ready",hasMobileSupport:!0},{id:"app.w3wallet",name:"W3 Wallet",hasMobileSupport:!0},{id:"pro.ds.app",name:"Digital Shield",hasMobileSupport:!0},{id:"com.reown.docs",name:"Kotlin Sample Wallet",hasMobileSupport:!0},{id:"com.apollox",name:"ApolloX",hasMobileSupport:!0},{id:"com.ipmb",name:"IPMB Wallet",hasMobileSupport:!0}
253,{id:"com.payperless",name:"Payperless",hasMobileSupport:!0},{id:"com.obliowallet",name:"Oblio Wallet",hasMobileSupport:!0},{id:"app.keeper-wallet",name:"Keeper",hasMobileSupport:!0},{id:"io.paraswap",name:"ParaSwap Wallet",hasMobileSupport:!0},{id:"org.ecoinwallet",name:"ECOIN Wallet",hasMobileSupport:!0},{id:"fi.dropmate",name:"Dropmate",hasMobileSupport:!0},{id:"com.cryptokara",name:"Cryptokara",hasMobileSupport:!0},{id:"co.cyber.wallet",name:"CyberWallet",hasMobileSupport:!0},{id:"com.kriptonio",name:"Kriptonio",hasMobileSupport:!0},{id:"digital.minerva",name:"Minerva Wallet",hasMobileSupport:!0},{id:"com.mpcvault.broswerplugin",name:"MPCVault | Team crypto wallet",hasMobileSupport:!0},{id:"com.liberawallet",name:"Libera",hasMobileSupport:!0},{id:"io.helixid",name:"helix id",hasMobileSupport:!0},{id:"com.broearn",name:"Broearn Wallet",hasMobileSupport:!0},{id:"io.altme",name:"Altme",hasMobileSupport:!0},{id:"app.herewallet",name:"HERE Wallet",hasMobileSupport:!0},{id:"com.coinsdo",name:"CoinWallet",hasMobileSupport:!0},{id:"trade.flooz.wallet",name:"Flooz",hasMobileSupport:!0},{id:"com.tapwallet",name:"TAP WALLET",hasMobileSupport:!0},{id:"fun.tobi",name:"Tobi",hasMobileSupport:!0},{id:"com.bitnovo",name:"Bitnovo Wallet",hasMobileSupport:!0},{id:"io.xucre",name:"Xucre",hasMobileSupport:!0},{id:"app.girin",name:"Girin Wallet",hasMobileSupport:!0},{id:"finance.panaroma",name:"Panaroma Wallet",hasMobileSupport:!0},{id:"app.clot",name:"Clot",hasMobileSupport:!0},{id:"io.transi",name:"Transi",hasMobileSupport:!0},{id:"world.qoin",name:"Qoin Wallet",hasMobileSupport:!0},{id:"com.greengloryglobal",name:"Blockaura",hasMobileSupport:!0},{id:"com.amazewallet",name:"AmazeWallet",hasMobileSupport:!0},{id:"zone.bitverse",name:"Bitverse",hasMobileSupport:!0},{id:"social.gm2",name:"GM² Social",hasMobileSupport:!0},{id:"io.ozonewallet",name:"OzoneWallet",hasMobileSupport:!0},{id:"io.ukiss",name:"UKISS Hub",hasMobileSupport:!0},{id:"finance.islamicoin",name:"ISLAMIwallet",hasMobileSupport:!0},{id:"io.copiosa",name:"Copiosa",hasMobileSupport:!0},{id:"world.fncy",name:"Fncy Mobile Wallet",hasMobileSupport:!0},{id:"io.moonstake",name:"MOONSTAKE",hasMobileSupport:!0},{id:"com.trusteeglobal",name:"Trustee Wallet",hasMobileSupport:!0},{id:"net.spatium",name:"Spatium",hasMobileSupport:!0},{id:"co.filwallet",name:"FILWallet",hasMobileSupport:!0},{id:"money.snowball",name:"Snowball",hasMobileSupport:!0},{id:"com.ennowallet",name:"Enno Wallet",hasMobileSupport:!0},{id:"io.safematrix",name:"Safematrix",hasMobileSupport:!0},{id:"pro.assure",name:"Assure",hasMobileSupport:!0},{id:"com.neftipedia",name:"NeftiWallet",hasMobileSupport:!0},{id:"io.goldbit",name:"GoldBit",hasMobileSupport:!0},{id:"com.coingrig",name:"Coingrig",hasMobileSupport:!0},{id:"io.xfun",name:"XFUN Wallet",hasMobileSupport:!0},{id:"com.antiersolutions",name:"Ancrypto Wallet",hasMobileSupport:!0},{id:"com.itoken",name:"iToken Wallet",hasMobileSupport:!0},{id:"com.cardstack",name:"Card Wallet",hasMobileSupport:!0},{id:"io.slavi",name:"Slavi Wallet",hasMobileSupport:!0},{id:"tech.defiantapp",name:"Defiant",hasMobileSupport:!0},{id:"com.dexari",name:"Dexari",hasMobileSupport:!0},{id:"io.cfcx",name:"CFCX",hasMobileSupport:!0},{id:"com.socjsc",name:"SOC Wallet",hasMobileSupport:!0},{id:"com.tokenb",name:"TokenB",hasMobileSupport:!0},{id:"org.onyx",name:"Onyx Wallet",hasMobileSupport:!0},{id:"io.gk8",name:"GK8",hasMobileSupport:!0},{id:"com.anchorage",name:"Anchorage Digital ",hasMobileSupport:!0},{id:"com.hashport.wallet",name:"HashPort Wallet",hasMobileSupport:!0},{id:"io.billionwallet",name:"Billion Wallet",hasMobileSupport:!0},{id:"com.dlicom",name:"DLICOM",hasMobileSupport:!0},{id:"com.tychiwallet",name:"Tychi Wallet",hasMobileSupport:!0},{id:"at.swe",name:"Sweat Wallet",hasMobileSupport:!0},{id:"network.wali",name:"Wali Wallet",hasMobileSupport:!0},{id:"io.diamante",name:"DIAM Wallet",hasMobileSupport:!0},{id:"ai.interlinklabs",name:"ITLX Wallet",hasMobileSupport:!0},{id:"com.walllet",name:"walllet.com",hasMobileSupport:!0},{id:"org.lunascape",name:"Lunascape Browser",hasMobileSupport:!0},{id:"com.nvxowallet",name:"NVXO Wallet",hasMobileSupport:!0},{id:"today.paywithcrypto.wallet",name:"PWC Super App",hasMobileSupport:!0},{id:"ai.iluminary",name:"iLuminaryAi Wallet",hasMobileSupport:!0},{id:"io.reactwallet",name:"React Wallet",hasMobileSupport:!0},{id:"com.rewardywallet",name:"Rewardy Wallet",hasMobileSupport:!0},{id:"io.walletv",name:"Wallet V",hasMobileSupport:!0},{id:"app.outlawgames",name:"Outlaw Wallet",hasMobileSupport:!0},{id:"io.ironwallet",name:"IronWallet",hasMobileSupport:!0},{id:"com.mecowallet",name:"MeCo Wallet",hasMobileSupport:!0},{id:"com.onlybulls",name:"OnlyBulls Wallet",hasMobileSupport:!0},{id:"me.qiewallet",name:"QIE Wallet",hasMobileSupport:!0},{id:"fund.lflabs",name:"LF Wallet App",hasMobileSupport:!0},{id:"io.walletverse",name:"Walletverse",hasMobileSupport:!0},{id:"com.berasig",name:"BeraSig",hasMobileSupport:!0},{id:"app.phantom",name:"Phantom",hasMobileSupport:!1},{id:"com.coinbase.wallet",name:"Base (formerly Coinbase Wallet)",hasMobileSupport:!1},{id:"io.rabby",name:"Rabby",hasMobileSupport:!1},{id:"com.brave.wallet",name:"Brave Wallet",hasMobileSupport:!1},{id:"fi.nu",name:"NUFI",hasMobileSupport:!1},{id:"pro.hinkal.walletconnect",name:"Hinkal Wallet",hasMobileSupport:!1},{id:"com.moongate.one",name:"MG",hasMobileSupport:!1}
253,{id:"tech.levain",name:"Levain",hasMobileSupport:!1},{id:"com.enkrypt",name:"Enkrypt",hasMobileSupport:!1},{id:"com.scramble",name:"Scramble",hasMobileSupport:!1},{id:"io.finoa",name:"FinoaConnect",hasMobileSupport:!1},{id:"com.blazpay.wallet",name:"Blazpay",hasMobileSupport:!1},{id:"io.getjoin.prd",name:"JOIN MOBILE APP",hasMobileSupport:!1},{id:"xyz.talisman",name:"Talisman Wallet",hasMobileSupport:!1},{id:"eu.flashsoft.clear-wallet",name:"clear-wallet",hasMobileSupport:!1},{id:"app.berasig",name:"BeraSig",hasMobileSupport:!1},{id:"com.wallet.reown",name:"Leather",hasMobileSupport:!1},{id:"io.runonflux.sspwallet",name:"SSP",hasMobileSupport:!1},{id:"com.blanqlabs.wallet",name:"Blanq",hasMobileSupport:!1},{id:"io.hero.wallet",name:"Hero Wallet",hasMobileSupport:!1},{id:"network.verified.custody",name:"Verified Wallet",hasMobileSupport:!1},{id:"console.utila.io",name:"Utila",hasMobileSupport:!1},{id:"com.micet.wallet",name:"Micet",hasMobileSupport:!1},{id:"world.dolphinode.chain",name:"NodeVault",hasMobileSupport:!1},{id:"com.lootrush",name:"LootRush",hasMobileSupport:!1},{id:"xyz.dawnwallet",name:"Dawn Wallet",hasMobileSupport:!1},{id:"xyz.abs",name:"Abstract Global Wallet",hasMobileSupport:!1},{id:"sh.frame",name:"Frame Wallet",hasMobileSupport:!1},{id:"io.useglyph",name:"Glyph Wallet",hasMobileSupport:!1},{id:"org.base.account",name:"Base Account",hasMobileSupport:!1},{id:"smart",name:"Smart Wallet",hasMobileSupport:!0},{id:"inApp",name:"In-App Wallet",hasMobileSupport:!0},{id:"embedded",name:"In-App Wallet",hasMobileSupport:!0},{id:"walletConnect",name:"WalletConnect",hasMobileSupport:!1}];function e5(e){const{itemsToShow:t,lastItemRef:n}=K3(10,10),i=Bs(),r=_.useMemo(()=>Cv.filter(m=>!uM.includes(m.id)).filter(m=>{var y;return!((y=e.walletIdsToHide)!=null&&y.includes(m.id))}),[e.walletIdsToHide]),s=_.useMemo(()=>new J4(r,{keys:[{name:"name",weight:1}],threshold:.4}),[r]),o=_.useRef(null),[c,l]=_.useState(""),u=Uu(c,300),d=u?s.search(u).map(m=>m.item):r,f=_.useMemo(()=>l1(d.slice(0,t)),[d,t]);return a.jsxs(b,{animate:"fadein",flex:"column",fullHeight:!0,className:"tw-all-wallets-screen",children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:"Select Wallet"})}),a.jsx(U,{y:"xs"}),a.jsx(b,{px:"lg",children:a.jsxs("div",{style:{alignItems:"center",display:"flex",position:"relative"},children:[a.jsx(Ev,{height:D.md,width:D.md}),a.jsx(Jr,{onChange:m=>{var y,g;(g=(y=o.current)==null?void 0:y.parentElement)==null||g.scroll({top:0}),l(m.target.value)},placeholder:"Search Wallet",style:{padding:`${R.sm} ${R.sm} ${R.sm} ${R.xxl}`},tabIndex:-1,value:c,variant:"outline"}),u!==c&&a.jsx("div",{style:{position:"absolute",right:R.md},children:a.jsx(Qe,{color:"accentText",size:"md"})})]})}),f.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(U,{y:"md"}),a.jsxs(b,{animate:"fadein",expand:!0,scrollY:!0,children:[a.jsx("div",{ref:o,style:{maxHeight:e.size==="compact"?"400px":void 0,paddingInline:R.md},children:f.map((m,y)=>{const g=y===f.length-1,p=un(m.id);return a.jsx("li",{ref:g?n:void 0,style:{listStyle:"none"},children:a.jsx(y1,{className:"tw-select-wallet-button",badge:void 0,client:e.client,connectLocale:e.connectLocale,isActive:!1,recommendedWallets:e.recommendedWallets,selectWallet:()=>{e.onSelect(p),e.disableSelectionDataReset||i({})},wallet:p})},m.id)})}),a.jsx(U,{y:"xl"})]})]}),f.length===0&&a.jsxs(b,{animate:"fadein",center:"both",color:"secondaryText",expand:!0,flex:"column",gap:"md",style:{minHeight:"250px"},children:[a.jsx(is,{height:D.xl,width:D.xl}),a.jsx(A,{children:" No Results "})]})]})}const Ev=nt(Xf)(e=>({color:ee().colors.secondaryText,left:R.sm,position:"absolute"})),Tv=Object.freeze(Object.defineProperty({__proto__:null,default:e5},Symbol.toStringTag,{value:"Module"}));function Bu(e){return a.jsxs(b,{animate:"fadein",children:[a.jsx(U,{y:"xxl"}),a.jsx(b,{center:"x",flex:"row",children:a.jsx(vs,{size:D["3xl"]})}),a.jsx(U,{y:"lg"}),a.jsx(A,{center:!0,color:"primaryText",size:"md",children:e.title}),a.jsx(U,{y:"xl"}),a.jsx(U,{y:"xxl"}),a.jsx(ue,{fullWidth:!0,onClick:e.onTryAgain,variant:"accent",children:"Try Again"})]})}function T1(e){return a.jsxs(b,{animate:"fadein",children:[a.jsx(U,{y:"xxl"}),a.jsxs(b,{center:"x",flex:"row",style:{position:"relative"},children:[a.jsx(Qe,{color:"accentText",size:"4xl"}),a.jsx(b,{color:"accentText",style:{left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"},children:e.icon})]}),a.jsx(U,{y:"xl"}),a.jsx(A,{center:!0,color:"primaryText",size:"lg",children:e.title}),a.jsx(U,{y:"md"}
253),a.jsx(A,{center:!0,multiline:!0,children:e.subtitle}),a.jsx(U,{y:"xxl"}),a.jsx(U,{y:"xxl"})]})}function vv(e){var g;const{wallet:t,done:n}=e,i=b9(),r=_.useRef(void 0),[s,o]=_.useState("selecting"),[c,l]=_.useState(),[u,d]=_.useState(!1),f=Xe(t)?{id:t.id,partnerId:(g=t.getConfig())==null?void 0:g.partnerId}:void 0,m=()=>{o("selecting"),r.current=void 0,e.onBack()};async function y(p){o("loading"),l(void 0),r.current=p;try{e.isLinking?await Kr({chain:e.chain||t.getChain()||Lt(1),client:e.client,ecosystem:f,strategy:"wallet",wallet:p}):await t.connect({chain:e.chain||p.getChain()||Lt(1),client:e.client,strategy:"wallet",wallet:p}),i(p),n()}catch(w){l(w instanceof Error?w.message:"Unknown error"),o("error")}}return r.current?a.jsxs(b,{animate:"fadein",flex:"column",fullHeight:!0,children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:m,title:e.isLinking?e.inAppLocale.linkWallet:e.inAppLocale.signInWithWallet})}),a.jsx(b,{center:"y",expand:!0,flex:"column",px:e.size==="wide"?"xxl":"lg",children:a.jsx("div",{children:s==="error"?a.jsxs(a.Fragment,{children:[a.jsx(Bu,{onTryAgain:()=>{if(!r.current)throw new Error("Failed to connect to unknown wallet");y(r.current)},title:c||"Failed to Login"}),a.jsx(U,{y:"lg"})]}):a.jsx(T1,{icon:a.jsx(ai,{client:e.client,id:r.current.id??"",size:D.xl}),subtitle:"A pop-up prompt will appear to sign-in and verify your wallet",title:"Sign in with your wallet"})})})]}):u?a.jsx(_.Suspense,{fallback:a.jsx(Mt,{}),children:a.jsx(e5,{client:e.client,connectLocale:e.locale,disableSelectionDataReset:!0,onBack:()=>d(!1),onSelect:async p=>{y(p),d(!1)},recommendedWallets:void 0,size:e.size})}):a.jsx(M3,{chain:t.getChain(),chains:[],client:e.client,connectLocale:e.locale,disableSelectionDataReset:!0,done:()=>{},goBack:m,hideHeader:!1,meta:e.meta||{},modalHeader:{onBack:m,title:e.isLinking?e.inAppLocale.linkWallet:e.inAppLocale.signInWithWallet},onShowAll:()=>{d(!0)},recommendedWallets:void 0,selectWallet:async p=>{y(p)},setModalVisibility:()=>{},showAllWallets:!0,size:e.size,title:e.locale.connectAWallet,walletConnect:e.walletConnect,walletIdsToHide:["inApp"],wallets:Du()})}function Lv(e){var m;const t=e.locale,n=t.socialLoginScreen,[i,r]=_.useState(void 0),{done:s,wallet:o}=e,[c,l]=_.useState("connecting"),u=async()=>{var g,p;const y={client:e.client,ecosystem:Xe(o)?{id:o.id,partnerId:(g=o.getConfig())==null?void 0:g.partnerId}:void 0,strategy:"guest"};try{await o.connect(y),await ar("guest",In),l("connected"),s()}catch(w){l("error"),w instanceof Error&&((p=w==null?void 0:w.message)!=null&&p.includes("PAYMENT_METHOD_REQUIRED"))&&r(t.maxAccountsExceeded),console.error("Error generating guest account",w)}},d=(m=e.state)==null?void 0:m.guestLogin,f=_.useRef(!1);return _.useEffect(()=>{f.current||d&&(f.current=!0,l("connecting"),d.connectionPromise.then(()=>{s(),l("connected")}).catch(y=>{r(y.message),l("error")}))},[s,d]),a.jsx(b,{animate:"fadein",flex:"column",fullHeight:!0,className:"tw-guest-login-screen",children:a.jsxs(b,{expand:!0,flex:"column",p:"lg",style:{paddingBottom:0},children:[e.goBack&&a.jsx(Me,{onBack:e.goBack,title:n.title}),e.size==="compact"?a.jsx(U,{y:"xl"}):null,a.jsxs(b,{center:"both",expand:!0,flex:"column",style:{minHeight:"250px",textAlign:"center"},children:[c!=="error"&&a.jsxs(b,{animate:"fadein",children:[a.jsx(A,{center:!0,color:"primaryText",multiline:!0,style:{maxWidth:"250px"},children:"Generating your guest account"}),a.jsx(U,{y:"xl"}),a.jsx(b,{center:"x",flex:"row",children:a.jsx(Qe,{color:"accentText",size:"lg"})}),a.jsx(U,{y:"xxl"})]}),c==="error"&&a.jsxs(b,{animate:"fadein",children:[i?a.jsx(A,{center:!0,color:"danger",children:i}):a.jsx(A,{color:"danger",children:n.failed}),a.jsx(U,{y:"lg"}),a.jsx(ue,{onClick:u,variant:"primary",children:n.retry}),a.jsx(U,{y:"xxl"})]})]})]})})}const Pd=Fe({animation:`${Rs} 0.15s ease-in`});var jv=Object.defineProperty,Sv=Object.defineProperties,Dv=Object.getOwnPropertyDescriptors,kl=Object.getOwnPropertySymbols,t5=Object.prototype.hasOwnProperty,n5=Object.prototype.propertyIsEnumerable,Iy=(e,t,n)=>t in e?jv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nv=(e,t)=>{for(var n in t||(t={}))t5.call(t,n)&&Iy(e,n,t[n]);if(kl)for(var n of kl(t))n5.call(t,n)&&Iy(e,n,t[n]);return e},Av=(e,t)=>
253Sv(e,Dv(t)),Ov=(e,t)=>{var n={};for(var i in e)t5.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&kl)for(var i of kl(e))t.indexOf(i)<0&&n5.call(e,i)&&(n[i]=e[i]);return n};function kv(e){let t=setTimeout(e,0),n=setTimeout(e,10),i=setTimeout(e,50);return[t,n,i]}function zv(e){let t=_.useRef();return _.useEffect(()=>{t.current=e}),t.current}var Pv=18,i5=40,Rv=`${i5}px`,Uv=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function Bv({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:i}){let[r,s]=_.useState(!1),[o,c]=_.useState(!1),[l,u]=_.useState(!1),d=_.useMemo(()=>n==="none"?!1:(n==="increase-width"||n==="experimental-no-flickering")&&r&&o,[r,o,n]),f=_.useCallback(()=>{let m=e.current,y=t.current;if(!m||!y||l||n==="none")return;let g=m,p=g.getBoundingClientRect().left+g.offsetWidth,w=g.getBoundingClientRect().top+g.offsetHeight/2,x=p-Pv,I=w;document.querySelectorAll(Uv).length===0&&document.elementFromPoint(x,I)===m||(s(!0),u(!0))},[e,t,l,n]);return _.useEffect(()=>{let m=e.current;if(!m||n==="none")return;function y(){let p=window.innerWidth-m.getBoundingClientRect().right;c(p>=i5)}y();let g=setInterval(y,1e3);return()=>{clearInterval(g)}},[e,n]),_.useEffect(()=>{let m=i||document.activeElement===t.current;if(n==="none"||!m)return;let y=setTimeout(f,0),g=setTimeout(f,2e3),p=setTimeout(f,5e3),w=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(y),clearTimeout(g),clearTimeout(p),clearTimeout(w)}},[t,i,n,f]),{hasPWMBadge:r,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:Rv}}var Vv=_.createContext({}),r5=_.forwardRef((e,t)=>{var n=e,{value:i,onChange:r,maxLength:s,textAlign:o="left",pattern:c,placeholder:l,inputMode:u="numeric",onComplete:d,pushPasswordManagerStrategy:f="increase-width",pasteTransformer:m,containerClassName:y,noScriptCSSFallback:g=$v,render:p,children:w}=n,x=Ov(n,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),I,E,j,C,T;let[v,N]=_.useState(typeof x.defaultValue=="string"?x.defaultValue:""),M=i??v,S=zv(M),L=_.useCallback(fe=>{r==null||r(fe),N(fe)},[r]),O=_.useMemo(()=>c?typeof c=="string"?new RegExp(c):c:null,[c]),P=_.useRef(null),$=_.useRef(null),z=_.useRef({value:M,onChange:L,isIOS:typeof window<"u"&&((E=(I=window==null?void 0:window.CSS)==null?void 0:I.supports)==null?void 0:E.call(I,"-webkit-touch-callout","none"))}),k=_.useRef({prev:[(j=P.current)==null?void 0:j.selectionStart,(C=P.current)==null?void 0:C.selectionEnd,(T=P.current)==null?void 0:T.selectionDirection]});_.useImperativeHandle(t,()=>P.current,[]),_.useEffect(()=>{let fe=P.current,ge=$.current;if(!fe||!ge)return;z.current.value!==fe.value&&z.current.onChange(fe.value),k.current.prev=[fe.selectionStart,fe.selectionEnd,fe.selectionDirection];function st(){if(document.activeElement!==fe){Q(null),K(null);return}let ye=fe.selectionStart,mt=fe.selectionEnd,_t=fe.selectionDirection,it=fe.maxLength,li=fe.value,mn=k.current.prev,En=-1,Ct=-1,Tn;if(li.length!==0&&ye!==null&&mt!==null){let Px=ye===mt,Rx=ye===li.length&&li.length<it;if(Px&&!Rx){let ss=ye;if(ss===0)En=0,Ct=1,Tn="forward";else if(ss===it)En=ss-1,Ct=ss,Tn="backward";else if(it>1&&li.length>1){let ld=0;if(mn[0]!==null&&mn[1]!==null){Tn=ss<mn[1]?"backward":"forward";let Ux=mn[0]===mn[1]&&mn[0]<it;Tn==="backward"&&!Ux&&(ld=-1)}En=ld+ss,Ct=ld+ss+1}}En!==-1&&Ct!==-1&&En!==Ct&&P.current.setSelectionRange(En,Ct,Tn)}let _i=En!==-1?En:ye,Qs=Ct!==-1?Ct:mt,cd=Tn??_t;Q(_i),K(Qs),k.current.prev=[_i,Qs,cd]}if(document.addEventListener("selectionchange",st,{capture:!0}),st(),document.activeElement===fe&&F(!0),!document.getElementById("input-otp-style")){let ye=document.createElement("style");if(ye.id="input-otp-style",document.head.appendChild(ye),ye.sheet){let mt="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";Jo(ye.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Jo(ye.sheet,`[data-input-otp]:autofill { ${mt} }`),Jo(ye.sheet,`[data-input-otp]:-webkit-autofill { ${mt} }
253`),Jo(ye.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),Jo(ye.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let pt=()=>{ge&&ge.style.setProperty("--root-height",`${fe.clientHeight}px`)};pt();let wt=new ResizeObserver(pt);return wt.observe(fe),()=>{document.removeEventListener("selectionchange",st,{capture:!0}),wt.disconnect()}},[]);let[B,W]=_.useState(!1),[V,F]=_.useState(!1),[Y,Q]=_.useState(null),[Z,K]=_.useState(null);_.useEffect(()=>{kv(()=>{var fe,ge,st,pt;(fe=P.current)==null||fe.dispatchEvent(new Event("input"));let wt=(ge=P.current)==null?void 0:ge.selectionStart,ye=(st=P.current)==null?void 0:st.selectionEnd,mt=(pt=P.current)==null?void 0:pt.selectionDirection;wt!==null&&ye!==null&&(Q(wt),K(ye),k.current.prev=[wt,ye,mt])})},[M,V]),_.useEffect(()=>{S!==void 0&&M!==S&&S.length<s&&M.length===s&&(d==null||d(M))},[s,d,S,M]);let q=Bv({containerRef:$,inputRef:P,pushPasswordManagerStrategy:f,isFocused:V}),oe=_.useCallback(fe=>{let ge=fe.currentTarget.value.slice(0,s);if(ge.length>0&&O&&!O.test(ge)){fe.preventDefault();return}typeof S=="string"&&ge.length<S.length&&document.dispatchEvent(new Event("selectionchange")),L(ge)},[s,L,S,O]),re=_.useCallback(()=>{var fe;if(P.current){let ge=Math.min(P.current.value.length,s-1),st=P.current.value.length;(fe=P.current)==null||fe.setSelectionRange(ge,st),Q(ge),K(st)}F(!0)},[s]),ae=_.useCallback(fe=>{var ge,st;let pt=P.current;if(!m&&(!z.current.isIOS||!fe.clipboardData||!pt))return;let wt=fe.clipboardData.getData("text/plain"),ye=m?m(wt):wt;fe.preventDefault();let mt=(ge=P.current)==null?void 0:ge.selectionStart,_t=(st=P.current)==null?void 0:st.selectionEnd,it=(mt!==_t?M.slice(0,mt)+ye+M.slice(_t):M.slice(0,mt)+ye+M.slice(mt)).slice(0,s);if(it.length>0&&O&&!O.test(it))return;pt.value=it,L(it);let li=Math.min(it.length,s-1),mn=it.length;pt.setSelectionRange(li,mn),Q(li),K(mn)},[s,L,O,M]),le=_.useMemo(()=>({position:"relative",cursor:x.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[x.disabled]),Te=_.useMemo(()=>({position:"absolute",inset:0,width:q.willPushPWMBadge?`calc(100% + ${q.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:q.willPushPWMBadge?`inset(0 ${q.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:o,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[q.PWM_BADGE_SPACE_WIDTH,q.willPushPWMBadge,o]),qe=_.useMemo(()=>_.createElement("input",Av(Nv({autoComplete:x.autoComplete||"one-time-code"},x),{"data-input-otp":!0,"data-input-otp-placeholder-shown":M.length===0||void 0,"data-input-otp-mss":Y,"data-input-otp-mse":Z,inputMode:u,pattern:O==null?void 0:O.source,"aria-placeholder":l,style:Te,maxLength:s,value:M,ref:P,onPaste:fe=>{var ge;ae(fe),(ge=x.onPaste)==null||ge.call(x,fe)},onChange:oe,onMouseOver:fe=>{var ge;W(!0),(ge=x.onMouseOver)==null||ge.call(x,fe)},onMouseLeave:fe=>{var ge;W(!1),(ge=x.onMouseLeave)==null||ge.call(x,fe)},onFocus:fe=>{var ge;re(),(ge=x.onFocus)==null||ge.call(x,fe)},onBlur:fe=>{var ge;F(!1),(ge=x.onBlur)==null||ge.call(x,fe)}})),[oe,re,ae,u,Te,s,Z,Y,x,O==null?void 0:O.source,M]),ct=_.useMemo(()=>({slots:Array.from({length:s}).map((fe,ge)=>{var st;let pt=V&&Y!==null&&Z!==null&&(Y===Z&&ge===Y||ge>=Y&&ge<Z),wt=M[ge]!==void 0?M[ge]:null,ye=M[0]!==void 0?null:(st=l==null?void 0:l[ge])!=null?st:null;return{char:wt,placeholderChar:ye,isActive:pt,hasFakeCaret:pt&&wt===null}}),isFocused:V,isHovering:!x.disabled&&B}),[V,B,s,Z,Y,x.disabled,M]),fn=_.useMemo(()=>p?p(ct):_.createElement(Vv.Provider,{value:ct},w),[w,ct,p]);return _.createElement(_.Fragment,null,g!==null&&_.createElement("noscript",null,_.createElement("style",null,g)),_.createElement("div",{ref:$,"data-input-otp-container":!0,style:le,className:y},fn,_.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},qe)))});r5.displayName="Input";function Jo(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var $v=`
254[data-input-otp] {
255  --nojs-bg: white !important;
256  --nojs-fg: black !important;
257
258  background-color: var(--nojs-bg) !important;
259  color: var(--nojs-fg) !important;
260  caret-color: var(--nojs-fg) !important;
261  letter-spacing: .25em !important;
262  text-align: center !important;
263  border: 1px solid var(--nojs-fg) !important;
264  border-radius: 4px !important;
265  width: 100% !important;
266}
267@media (prefers-color-scheme: dark) {
268  [data-input-otp] {
269    --nojs-bg: black !important;
270    --nojs-fg: white !important;
271  }
272}`;function Wv(e){return a.jsx(Fv,{className:"tw-otp-input-container",children:a.jsx(r5,{maxLength:6,onChange:t=>{e.setValue(t)},onComplete:()=>{e.onEnter()},render:({slots:t})=>a.jsx(b,{center:"both",flex:"row",gap:"xs",children:t.map((n,i)=>a.jsx(Yv,{...n,isInvalid:e.isInvalid},i))}),value:e.value})})}const Fv=Fe({"& input":{maxWidth:"100%"}});function Yv(e){return a.jsxs(Zv,{"data-active":e.isActive,"data-error":e.isInvalid,children:[e.char!==null&&a.jsx("div",{children:e.char}),e.hasFakeCaret&&a.jsx(Qv,{})]})}const Hv=qt`
273  0%, 100% {
274    opacity: 0;
275  },
276  50% {
277    opacity: 1;
278  }
279  `,Qv=Fe(e=>({"&::before":{backgroundColor:ee().colors.primaryText,content:"''",display:"block",height:"1em",width:"1.5px"},alignItems:"center",animation:`${Hv} 1s infinite`,display:"flex",inset:0,justifyContent:"center",pointerEvents:"none",position:"absolute"})),Zv=Fe(e=>{const t=ee();return{"&[data-active='true']":{borderColor:t.colors.accentText},"&[data-error='true']":{borderColor:t.colors.danger},alignItems:"center",border:`2px solid ${t.colors.borderColor}`,borderRadius:J.lg,boxSizing:"border-box",color:t.colors.primaryText,display:"flex",fontSize:ie.md,height:"40px",justifyContent:"center",padding:R.xs,position:"relative",textAlign:"center",transition:"color 200ms ease",width:"40px"}});function qv(e){var N;const{wallet:t,done:n,goBack:i,userInfo:r}=e,s=e.size==="wide",o=e.locale,[c,l]=_.useState(""),[u,d]=_.useState("idle"),[f,m]=_.useState(),[y,g]=_.useState({type:"sending"}),[p,w]=_.useState(0),x=Xe(t)?{id:t.id,partnerId:(N=t.getConfig())==null?void 0:N.partnerId}:void 0,[I]=_.useState("base"),E=_.useCallback(async()=>
279{l(""),d("idle"),g({type:"sending"});try{if("email"in r)await Jh({client:e.client,ecosystem:x,email:r.email,strategy:"email"}),g({type:"sent"}),w(60);else if("phone"in r)await Jh({client:e.client,ecosystem:x,phoneNumber:r.phone,strategy:"phone"}),g({type:"sent"}),w(60);else throw new Error("Invalid userInfo")}catch(M){console.error(M),d("idle"),g({type:"error",message:M instanceof Error?M.message:void 0})}},[e.client,r,x]);async function j(M){if("email"in r)await t.connect({chain:e.chain,client:e.client,email:r.email,strategy:"email",verificationCode:M}),await ar("email",In);else if("phone"in r)await t.connect({chain:e.chain,client:e.client,phoneNumber:r.phone,strategy:"phone",verificationCode:M}),await ar("phone",In);else throw new Error("Invalid userInfo")}async function C(M){"email"in r?await Kr({client:e.client,ecosystem:x,email:r.email,strategy:"email",verificationCode:M}):"phone"in r&&await Kr({client:e.client,ecosystem:x,phoneNumber:r.phone,strategy:"phone",verificationCode:M})}const T=async M=>{var S;if(M.length===6){d("verifying");try{e.isLinking?await C(M):await j(M),n(),d("valid")}catch(L){L instanceof Error&&((S=L==null?void 0:L.message)!=null&&S.includes("PAYMENT_METHOD_REQUIRED"))?d("payment_required"):L instanceof Error&&(L.message.toLowerCase().includes("link")||L.message.toLowerCase().includes("profile"))?(d("linking_error"),m(L.message)):d("invalid"),console.error("Authentication Error",L)}}},v=_.useRef(!1);return _.useEffect(()=>{v.current||(v.current=!0,E())},[E]),_.useEffect(()=>{if(p<=0)return;const M=setInterval(()=>{w(S=>S<=1?(clearInterval(M),0):S-1)},1e3);return()=>clearInterval(M)},[p]),I==="base"?a.jsxs(b,{animate:"fadein",flex:"column",fullHeight:!0,className:"tw-otp-login-screen",children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:i,title:o.signIn})}),a.jsx(b,{center:"y",expand:!0,flex:"column",children:a.jsxs("form",{onSubmit:M=>{M.preventDefault()},children:[a.jsxs(b,{center:"x",flex:"column",px:"lg",children:[!s&&a.jsx(U,{y:"xl"}),a.jsx(A,{className:"tw-screen-title",children:o.emailLoginScreen.enterCodeSendTo}),a.jsx(U,{y:"sm"}),a.jsx(A,{color:"primaryText",children:"email"in r?r.email:r.phone}),a.jsx(U,{y:"xl"})]}),a.jsx(Wv,{digits:6,isInvalid:u==="invalid",onEnter:()=>{T(c)},setValue:M=>{l(M),d("idle")},value:c}),u==="invalid"&&a.jsxs(Pd,{children:[a.jsx(U,{y:"md"}),a.jsx(A,{center:!0,color:"danger",size:"sm",className:"tw-invalid-code-text",children:o.emailLoginScreen.invalidCode})]}),u==="linking_error"&&a.jsxs(Pd,{children:[a.jsx(U,{y:"md"}),a.jsx(A,{center:!0,color:"danger",size:"sm",className:"tw-screen-error",children:f||"Failed to verify code"})]}),u==="payment_required"&&a.jsxs(Pd,{children:[a.jsx(U,{y:"md"}),a.jsx(A,{center:!0,color:"danger",size:"sm",className:"tw-screen-error",children:o.maxAccountsExceeded})]}),a.jsx(U,{y:"xl"}),a.jsx(b,{px:s?"xxl":"lg",children:u==="verifying"?a.jsx(b,{animate:"fadein",center:"x",flex:"row",children:a.jsx(Qe,{color:"accentText",size:"lg"})}):a.jsx(b,{animate:"fadein",children:a.jsx(ue,{onClick:()=>T(c),style:{width:"100%"},type:"submit",variant:"accent",className:"tw-verify-button",children:o.emailLoginScreen.verify})},"btn-container")}),a.jsx(U,{y:"xl"}),!s&&a.jsx(He,{}),a.jsxs(b,{gap:"sm",p:s?void 0:"lg",flex:"column",children:[y.type==="error"&&a.jsx(A,{center:!0,color:"danger",size:"sm",className:"tw-screen-error",children:y.message||o.emailLoginScreen.failedToSendCode}),y.type==="sending"&&a.jsxs(b,{center:"both",flex:"row",gap:"xs",style:{textAlign:"center"},children:[a.jsx(A,{size:"sm",children:o.emailLoginScreen.sendingCode}),a.jsx(Qe,{color:"secondaryText",size:"xs"})]}),y.type!=="sending"&&a.jsx(Gv,{onClick:p===0?E:void 0,style:{cursor:p>0?"default":"pointer",opacity:p>0?.5:1},className:"tw-resend-button",type:"button",children:p>0?`Resend code in ${p} seconds`:o.emailLoginScreen.resendCode})]})]})})]}):null}const Gv=$i(e=>{const t=ee();return{all:"unset","&:hover":{color:t.colors.primaryText},color:t.colors.accentText,cursor:"pointer",fontSize:ie.sm,fontWeight:500,textAlign:"center",width:"100%"}});var Kv=Object.defineProperty,Vu=(e,t)=>{for(var n in t)Kv(e,n,{get:t[n],enumerable:!0})},ol={};Vu(ol,{authenticate:()=>iL,isAutocompleteAvailable:()=>c5,isAvailable:()=>Xv,isLocalAuthenticator:()=>eL,register:()=>nL});var Jv={};Vu(Jv,{bufferToHex:()=>o5,concatenateBuffers:()=>a5,isBase64url:()=>v1,parseBase64url:()=>yi,parseBuffer:()=>s5,sha256:()=>$u,toBase64url:()=>dn,toBuffer:()=>pc}
279);function pc(e){return Uint8Array.from(e,t=>t.charCodeAt(0)).buffer}function s5(e){return String.fromCharCode(...new Uint8Array(e))}function v1(e){return e.match(/^[a-zA-Z0-9\-_]+=*$/)!==null}function dn(e){return btoa(s5(e)).replaceAll("+","-").replaceAll("/","_")}function yi(e){return e=e.replaceAll("-","+").replaceAll("_","/"),pc(atob(e))}async function $u(e){return await crypto.subtle.digest("SHA-256",e)}function o5(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}function a5(e,t){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),n}function Xv(){return!!window.PublicKeyCredential}async function eL(){return await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()}function tL(e){if(!(!e||e.length===0))return e.includes("client-device")?e.includes("security-key")||e.includes("hybrid")?void 0:"platform":"cross-platform"}var cn=null;async function nL(e){if(!e.challenge)throw new Error('"challenge" required');if(!e.user)throw new Error('"user" required');if(!v1(e.challenge))throw new Error("Provided challenge is not properly encoded in Base64url");let t=typeof e.user=="string"?{name:e.user}:e.user;t.id||(t.id=crypto.randomUUID());let n={challenge:yi(e.challenge),rp:{id:e.domain??window.location.hostname,name:e.domain??window.location.hostname},user:{id:pc(t.id),name:t.name,displayName:t.displayName??t.name},hints:e.hints,pubKeyCredParams:[{alg:-7,type:"public-key"},{alg:-257,type:"public-key"}],timeout:e.timeout,authenticatorSelection:{userVerification:e.userVerification,authenticatorAttachment:tL(e.hints),residentKey:e.discoverable??"preferred",requireResidentKey:e.discoverable==="required"},attestation:e.attestation??!0?"direct":"none",...e.customProperties};cn==null||cn.abort("Cancel ongoing authentication"),cn=new AbortController;let i=await navigator.credentials.create({publicKey:n,signal:cn==null?void 0:cn.signal}),r=i.response;if(cn=null,i.type!="public-key")throw"Unexpected credential type!";let s=r.getPublicKey();if(!s)throw"Non-compliant browser or authenticator!";return{type:i.type,id:i.id,rawId:dn(i.rawId),authenticatorAttachment:i.authenticatorAttachment,clientExtensionResults:i.getClientExtensionResults(),response:{attestationObject:dn(r.attestationObject),authenticatorData:dn(r.getAuthenticatorData()),clientDataJSON:dn(r.clientDataJSON),publicKey:dn(s),publicKeyAlgorithm:r.getPublicKeyAlgorithm(),transports:r.getTransports()},user:t}}async function c5(){return PublicKeyCredential.isConditionalMediationAvailable&&PublicKeyCredential.isConditionalMediationAvailable()}async function iL(e){var r;if(!v1(e.challenge))throw new Error("Provided challenge is not properly encoded in Base64url");if(e.autocomplete&&!await c5())throw new Error("Passkeys autocomplete with conditional mediation is not available in this browser.");let t={challenge:yi(e.challenge),rpId:e.domain??window.location.hostname,allowCredentials:(r=e.allowCredentials)==null?void 0:r.map(rL),hints:e.hints,userVerification:e.userVerification,timeout:e.timeout,...e.customProperties};cn==null||cn.abort("Cancel ongoing authentication"),cn=new AbortController;let n=await navigator.credentials.get({publicKey:t,mediation:e.autocomplete?"conditional":void 0,signal:cn==null?void 0:cn.signal});if(n.type!="public-key")throw"Unexpected credential type!";cn=null;let i=n.response;return{clientExtensionResults:n.getClientExtensionResults(),id:n.id,rawId:dn(n.rawId),type:n.type,authenticatorAttachment:n.authenticatorAttachment,response:{authenticatorData:dn(i.authenticatorData),clientDataJSON:dn(i.clientDataJSON),signature:dn(i.signature),userHandle:i.userHandle?dn(i.userHandle):void 0}}}function rL(e){return typeof e=="string"?{id:yi(e),type:"public-key"}:{id:yi(e.id),type:"public-key",transports:e.transports}}var sL={};Vu(sL,{parseCryptoKey:()=>h5,randomChallenge:()=>hL,verifyAuthentication:()=>yL,verifyRegistration:()=>mL,verifySignature:()=>f5});var L1={};Vu(L1,{getAlgoName:()=>l5,parseAuthentication:()=>dL,parseAuthenticator:()=>wc,parseClient:()=>j1,parseRegistration:()=>uL,toAuthenticationInfo:()=>S1,toRegistrationInfo:()=>u5});var oL={"00000000-0000-0000-0000-000000000000":"Unknown authenticator","0076631b-d4a0-427f-5773-0ec71c9e0279":"HYPR FIDO2 Authenticator","01020304-0506-0708-0102-030405060708":"Chromium Virtual Authenticator (browser dev tools)","019614a3-2703-7e35-a453-285fd06c5d24":"ATLKey Authenticator","050dd0bc-ff20-4265-8d5d-305c4b215192":"eToken Fusion FIPS","07a9f89c-6407-4594-9d56-621d5f1e358b":"NXP Semiconductros FIDO2 Conformance Testing CTAP2 Authenticator","08987058-cadc-4b81-b6e1-30de50dcbe96":"Windows Hello","092277e5-8437-46b5-b911-ea64b294acb7":"Taglio CTAP2.1 CS","09591fc6-9811-48f7-8f57-b9f23df6413f":"Pone Biometrics OFFPAD Authenticator","09619fbf-d75e-4a62-be1d-fe4d240864ae":"VeriMark(TM) Guard 2.1 Fingerprint Security Key","0acf3011-bc60-f375-fb53-6f05f43154e0":"Nymi FIDO2 Authenticator","0bb43545-fd2c-4185-87dd-feb0b2916ace":"Security Key NFC by Yubico - Enterprise Edition","0d9b2e56-566b-c393-2940-f821b7f15d6d":"Excelsecu eSecu FIDO2 Pro Security Key","0db01cd6-5618-455b-bb46-1ec203d3213e":"GoldKey Security Token","0ea242b4-43c4-4a1b-8b17-dd6d0b6baec6":"Keeper","10c70715-2a9a-4de1-b0aa-3cff6d496d39":"eToken Fusion NFC FIPS","1105e4ed-af1d-02ff-ffff-ffffffffffff"
279:"Egomet FIDO2 Authenticator for Android","12755c32-8ad1-46eb-881c-e0b38d848b09":"Feitian ePass FIDO Authenticator (CTAP2.1, CTAP2.0, U2F)","12ded745-4bed-47d4-abaa-e713f51d6393":"Feitian AllinOne FIDO2 Authenticator","13ac47cf-1d78-4fd5-9060-aedaabacf826":"HID Crescendo Key V3 - Enterprise Edition","146e77ef-11eb-4423-b847-ce77864e9411":"eToken Fusion NFC PIV","149a2021-8ef6-4133-96b8-81f8d5b7f1f5":"Security Key by Yubico with NFC","17290f1e-c212-34d0-1423-365d729f09d9":"Thales PIN iOS SDK","175cd298-83d2-4a26-b637-313c07a6434e":"Chunghwa Telecom FIDO2 Smart Card Authenticator","19083c3d-8383-4b18-bc03-8f1c9ab2fd1b":"YubiKey 5 Series","1ac71f64-468d-4fe0-bef1-0e5f2f551f18":"YubiKey 5 Series with NFC (Enterprise Profile)","1c086528-58d5-f211-823c-356786e36140":"Atos CardOS FIDO2","1d1b4e33-76a1-47fb-97a0-14b10d0933f1":"Cryptnox FIDO2.1","1d8cac46-47a1-3386-af50-e88ae46fe802":"Ledger Flex FIDO2 Authenticator","1e906e14-77af-46bc-ae9f-fe6ef18257e4":"VeridiumID Passkey iOS SDK","20ac7a17-c814-4833-93fe-539f0d5e3389":"YubiKey 5 Series (Enterprise Profile)","20f0be98-9af9-986a-4b42-8eca4acb28e4":"Excelsecu eSecu FIDO2 Fingerprint Security Key","2194b428-9397-4046-8f39-007a1605a482":"IDPrime 931 Fido","22248c4c-7a12-46e2-9a41-44291b373a4d":"LogMeOnce","23195a52-62d9-40fa-8ee5-23b173f4fb52":"Hyper FIDO Pro NFC","23315ad0-6aca-4ba1-952e-f044f1e36976":"Clife Key 2 NFC","234cd403-35a2-4cc2-8015-77ea280c77f5":"Feitian ePass FIDO2-NFC Series (CTAP2.1, CTAP2.0, U2F)","23786452-f02d-4344-87ed-aaf703726881":"SafeNet eToken Fusion CC","24673149-6c86-42e7-98d9-433fb5b73296":"YubiKey 5 Series with Lightning","260e3021-482d-442d-838c-7edfbe153b7e":"Feitian ePass FIDO2-NFC Plus Authenticator","2772ce93-eb4b-4090-8b73-330f48477d73":"Security Key NFC by Yubico - Enterprise Edition Preview","2a55aee6-27cb-42c0-bc6e-04efe999e88a":"HID Crescendo 4000","2bff89f2-323a-48fc-b7c8-9ff7fe87c07e":"Feitian BioPass FIDO2 Pro (Enterprise Profile)","2c0df832-92de-4be1-8412-88a8f074df4a":"Feitian FIDO Smart Card","2c2aeed8-8174-4159-814b-486e92a261d0":"NEOWAVE WINKEO V2.0","2cd2f727-f6ca-44da-8f48-5c2e5da000a2":"Nitrokey 3 AM","2d3bec26-15ee-4f5d-88b2-53622490270b":"HID Crescendo Key V2","2fc0579f-8113-47ea-b116-bb5a8db9202a":"YubiKey 5 Series with NFC","2ffd6452-01da-471f-821b-ea4bf6c8676a":"IDPrime 941 Fido","30b5035e-d297-4fc1-b00b-addc96ba6a97":"OneSpan FIDO Touch","30b5035e-d297-4ff1-010b-addc96ba6a98":"OneSpan DIGIPASS FX1a","30b5035e-d297-4ff1-020b-addc96ba6a98":"OneSpan DIGIPASS FX1-C","30b5035e-d297-4ff1-b00b-addc96ba6a98":"OneSpan DIGIPASS FX1 BIO","30b5035e-d297-4ff2-010b-addc96ba6a98":"OneSpan DIGIPASS FX2-A","30b5035e-d297-4ff7-010b-addc96ba6a98":"OneSpan DIGIPASS FX7-B","30b5035e-d297-4ff7-020b-addc96ba6a98":"OneSpan DIGIPASS FX7","30b5035e-d297-4ff7-030b-addc96ba6a98":"OneSpan DIGIPASS FX7-C","30b5035e-d297-4ff7-b00b-addc96ba6a98":"OneSpan DIGIPASS FX7","3124e301-f14e-4e38-876d-fbeeb090e7bf":"YubiKey 5 Series with Lightning Preview","31c3f7ff-bf15-4327-83ec-9336abcbcd34":"WinMagic FIDO Eazy - Software","341e4da9-3c2e-8103-5a9f-aad887135200":"Ledger Nano S FIDO2 Authenticator","34744913-4f57-4e6e-a527-e9ec3c4b94e6":"YubiKey Bio Series - Multi-protocol Edition","34f5766d-1536-4a24-9033-0e294e510fb0":"YubiKey 5 Series with NFC Preview","361a3082-0278-4583-a16f-72a527f973e4":"eWBM eFA500 FIDO2 Authenticator","3789da91-f943-46bc-95c3-50ea2012f03a":"NEOWAVE Winkeo FIDO2","39589099-9a75-49fc-afaa-801ca211c62a":"Feitian ePass FIDO-NFC (Enterprise Profile) (CTAP2.1, CTAP2.0, U2F)","39a5647e-1853-446c-a1f6-a79bae9f5bc7":"IDmelon","3a662962-c6d4-4023-bebb-98ae92e78e20":"YubiKey 5 FIPS Series with Lightning (Enterprise Profile)","3aa78eb1-ddd8-46a8-a821-8f8ec57a7bd5":"YubiKey 5 CCN Series with NFC","3b1adb99-0dfe-46fd-90b8-7f7614a4de2a":"GoTrust Idem Key FIDO2 Authenticator","3b24bf49-1d45-4484-a917-13175df0867b":"YubiKey 5 Series with Lightning (Enterprise Profile)","3e078ffd-4c54-4586-8baa-a77da113aec5":"Hideez Key 3 FIDO2","3e22415d-7fdf-4ea4-8a0c-dd60c4249b9d":"Feitian iePass FIDO Authenticator","3f59672f-20aa-4afe-b6f4-7e5e916b6d98":"Arculus FIDO 2.1 Key Card [P71]","3fd410dc-8ab7-4b86-a1cb-c7174620b2dc":"IDEMIA SOLVO Fly 80 R1 FIDO Card Draft","42b4fb4a-2866-43b2-9bf7-6c6669c2e5d3":"Google Titan Security Key v2","42df17de
279-06ba-4177-a2bb-6701be1380d6":"Feitian BioPass FIDO2 Plus Authenticator","454e5346-4944-4ffd-6c93-8e9267193e9a":"Ensurity ThinC","454e5346-4944-4ffd-6c93-8e9267193e9b":"Ensurity AUTH BioPro","4599062e-6926-4fe7-9566-9e8fb1aedaa0":"YubiKey 5 Series (Enterprise Profile)","46544d5d-8f5d-4db4-89ac-ea8977073fff":"Foongtone FIDO Authenticator","47ab2fb4-66ac-4184-9ae1-86be814012d5":"Security Key NFC by Yubico - Enterprise Edition","489ff376-b48d-6640-bb69-782a860ca795":"Mettlesemi Vishwaas Eagle Authenticator using FIDO2","49a15c1c-3f63-3f51-23a7-b9e00096edd1":"IDEX CTAP2.1 Biometric, No pin","4b3f8944-d4f2-4d21-bb19-764a986ec160":"KeyXentic FIDO2 Secp256R1 FIDO2 CTAP2 Authenticator","4b89f401-464e-4745-a520-486ddfc5d80e":"IIST FIDO2 Authenticator","4c0cf95d-2f40-43b5-ba42-4c83a11c04ba":"Feitian BioPass FIDO2 Pro Authenticator","4c50ff10-1057-4fc6-b8ed-43a529530c3c":"ImproveID Authenticator","4d41190c-7beb-4a84-8018-adf265a6352d":"Thales IDPrime FIDO Bio","4e2ddbc2-2687-4709-8551-cb66c9776bfe":"SECORA ID V2 FIDO2.1 L1","4e768f2c-5fab-48b3-b300-220eb487752b":"Hideez Key 4 FIDO2 SDK","4fc84f16-2545-4e53-b8fc-7bf4d7282a10":"YubiKey 5 CCN Series with NFC (Enterprise Profile)","504d7149-4e4c-3841-4555-55445a677357":"WiSECURE AuthTron USB FIDO2 Authenticator","50726f74-6f6e-5061-7373-50726f746f6e":"Proton Pass","50a45b0c-80e7-f944-bf29-f552bfa2e048":"ACS FIDO Authenticator","50cbf15a-238c-4457-8f16-812c43bf3c49":"Ensurity AUTH TouchPro","516d3969-5a57-5651-5958-4e7a49434167":"SmartDisplayer BobeePass FIDO2 Authenticator","531126d6-e717-415c-9320-3d9aa6981239":"Dashlane","53414d53-554e-4700-0000-000000000000":"Samsung Pass","5343502d-5343-5343-6172-644649444f32":"ESS Smart Card Inc. Authenticator","54d9fee8-e621-4291-8b18-7157b99c5bec":"HID Crescendo Enabled","560a780c-b6ae-4f03-b110-082f856425b4":"KQC QuKey Bio FIDO2 Authenticator","5626bed4-e756-430b-a7ff-ca78c8b12738":"VALMIDO PRO FIDO","57235694-51a5-4a4d-a81a-f42185df6502":"SHALO AUTH","5753362b-4e6b-6345-7b2f-255438404c75":"WiSECURE Blentity FIDO2 Authenticator","57f7de54-c807-4eab-b1c6-1c9be7984e92":"YubiKey 5 FIPS Series","58276709-bb4b-4bb3-baf1-60eea99282a7":"YubiKey Bio Series - Multi-protocol Edition 1VDJSN","58b44d0b-0a7c-f33a-fd48-f7153c871352":"Ledger Nano S Plus FIDO2 Authenticator","59f85fe7-faa5-4c92-9f52-697b9d4d5473":"RSA Authenticator 4 for Android","5b0e46ba-db02-44ac-b979-ca9b84f5e335":"YubiKey 5 FIPS Series with Lightning Preview","5ca1ab1e-1337-fa57-f1d0-a117e71ca702":"Allthenticator iOS App: roaming BLE FIDO2 Allthenticator for Windows, Mac, Linux, and Allthenticate door readers","5ca1ab1e-fa57-1337-f1d0-a117371ca702":"Allthenticator Android App: roaming BLE FIDO2 Allthenticator for Windows, Mac, Linux, and Allthenticate door readers","5d629218-d3a5-11ed-afa1-0242ac120002":"Swissbit iShield Key Pro","5df66f62-5b47-43d3-aa1d-a6e31c8dbeb5":"Securitag Assembly Group FIDO Authenticator NFC","5e264d9d-28ef-4d34-95b4-5941e7a4faa8":"Ideem ZSM FIDO2 Authenticator","5ea308b2-7ac7-48b9-ac09-7e2da9015f8c":"Veridium Android SDK","5eaff75a-dd43-451f-af9f-87c9eeae293e":"Swissbit iShield Key 2 FIPS Enterprise","5fdb81b8-53f0-4967-a881-f5ec26fe4d18":"VinCSS FIDO2 Authenticator","6002f033-3c07-ce3e-d0f7-0ffe5ed42543":"Excelsecu eSecu FIDO2 Fingerprint Key","6028b017-b1d4-4c02-b4b3-afcdafc96bb2":"Windows Hello","61250591-b2bc-4456-b719-0b17be90bb30":"eWBM eFPA FIDO2 Authenticator","62e54e98-c209-4df3-b692-de71bb6a8528":"YubiKey 5 FIPS Series with NFC Preview","662ef48a-95e2-4aaa-a6c1-5b9c40375824":"YubiKey 5 Series with NFC - Enhanced PIN","664d9f67-84a2-412a-9ff7-b4f7d8ee6d05":"OpenSK authenticator","66a0ccb3-bd6a-191f-ee06-e375c50b9846":"Thales Bio iOS SDK","692db549-7ae5-44d5-a1e5-dd20a493b723":"HID Crescendo Key","69700f79-d1fb-472e-bd9b-a3a3b9a9eda0":"Pone Biometrics OFFPAD Authenticator","6999180d-630c-442d-b8f7-424b90a43fae":"Hyper FIDO Pro (CTAP2.1, CTAP2.0, U2F)","69e7c36f-f2f6-9e0d-07a6-bcc243262e6b":"OneKey FIDO2 Authenticator","6ab56fad-881f-4a43-acb2-0be065924522":"YubiKey 5 Series with NFC (Enterprise Profile)","6d212b28-a2c1-4638-b375-5932070f62e9":"initial","6d44ba9b-f6ec-2e49-b930-0c8fe920cb73":"Security Key by Yubico with NFC","6dae43be-af9c-417b-8b9f-1b611168ec60":"Dapple Authenticator from Dapple Security Inc.","6e24d385-004a-16a0-7bfe-efd963845b34":"Ledger Stax FIDO2 Authenticator","6e8d1eae-8d40-4c25-bcf8-4633959afc71":"Veridium iOS SDK","6ec5cff2-a0f9-4169-945b-f33b563f7b99":"YubiKey Bio Series - Multi-protocol Edition (Enterprise Profile)","70e7c36f-f2f6-9e0d-07a6-bcc243262e6b":"OneKey FIDO2 Bluetooth Authenticator","72c6b72d-8512-4c66-8359-9d3d10d9222f":"Security Key NFC by Yubico - Enterprise Edition (Enterprise Profile)","73402251-f2a8-4f03-873e-3cb6db604b03":"uTrust FIDO2 Security Key","73bb0cd4-e502-49b8-9c6f-b59445bf720b":"YubiKey 5 FIPS Series","7409272d-1ff9-4e10-9fc9-ac0019c124fd":"YubiKey Bio Series - FIDO Edition","74820b05-a6c9-40f9-8fb0-9f86aca93998":"SafeNet eToken Fusion","760eda36-00aa-4d29-855b-4012a182cdeb":"Security Key NFC by Yubico Preview","76692dc1-c56a-48d9-8e7d-31b5ced430ac":"VeriMark NFC+ USB-A Security Key","77010bd7-212a-4fc9-b236-d2ca5e9d4084":"Feitian BioPass FIDO2 Authenticator","771b48fd-d3d4-4f74-9232-fc157ab0507a":"Edge on Mac","773c30d9-5919-4e96-a4f5-db65e95cf890":"GSTAG OAK FIDO2 Authenticator","7787a482-13e8-4784-8a06-c7ed49a7aaf4":"Swissbit iShield Key 2","78ba3993-d784-4f44-8d6e-cc0a8ad5230e":"Feitian ePass FIDO-NFC(CTAP2.1, CTAP2.0, U2F)","7991798a-a7f3-487f-98c0-3faf7a458a04":"HID Crescendo Key V3","79f3c8ba-9e35-484b-8f47-53a5a0f5c630":"YubiKey 5 FIPS Series with NFC (Enterprise Profile)","7b96457d-e3cd-432b-9ceb-c9fdd7ef7432":"YubiKey 5 FIPS Series with Lightning","7d1351a6-e097-4852-b8bf-c9ac5c9ce4a3":"YubiKey Bio Series - Multi-protocol Edition","7d2afadd-bf6b-44a2-a66b-e831fceb8eff":"Taglio CTAP2.1 EP","7e3f3d30-3557-4442-bdae-139312178b39":"RSA DS100","817cdab8-0d51-4de1-a821-e25b88519cf3":"Swissbit iShield Key 2 FIPS","820d89ed-d65a-409e-85cb-f73f0578f82a":"IDmelon iOS Authenticator","82b0a720-127a-4788-b56d-d1d4b2d82eac":"ID-One Key","833b721a-ff5f-4d00-bb2e-bdda3ec01e29":"Feitian ePass FIDO2 Authenticator","83c47309-aabb-4108-8470-8be838b573cb":"YubiKey Bio Series - FIDO Edition (Enterprise Profile)","85203421-48f9-4355-9bc8-8a53846e5083":"YubiKey 5 FIPS Series with Lightning","8681a073-5f50-4d52-bce4-e21658d207b3":"RSA Authenticator 4 for iOS","87dbc5a1-4c94-4dc8-8a47-97d800fd1f3c":"eWBM eFA320 FIDO2 Authenticator","882adaf5-3aa9-4708-8e7d-3957103775b4":"T-Shield TrustSec FIDO2 Bio and client PIN version","8836336a-f590-0921-301d-46427531eee6":"Thales Bio Android SDK","8876631b-d4a0-427f-5773-0ec71c9e0279":"Solo Secp256R1 FIDO2 CTAP2 Authenticator","88bbd2f0-342a-42e7-9729-dd158be5407a":"Precision InnaIT Key FIDO 2 Level 2 certified","891494da-2c90-4d31-a9cd-4eab0aed1309":"Sésame","8976631b-d4a0-427f-5773-0ec71c9e0279":"Solo Tap Secp256R1 FIDO2 CTAP2 Authenticator","89b19028-256b-4025-8872-255358d950e4":"Sentry Enterprises CTAP2 Authenticator","8c39ee86-7f9a-4a95-9ba3-f6b097e5c2ee":"YubiKey Bio Series - FIDO Edition (Enterprise Profile)","8c97a730-3f7b-41a6-87d6-1e9b62bda6f0":"FT-JCOS FIDO Fingerprint Card","8d1b1fcb-3c76-49a9-9129-5515b346aa02":"IDEMIA ID-ONE Card","8d4378b0-725d-4432-b3c2-01fcdaf46286":"VeridiumID Passkey Android SDK","8da0e4dc-164b-454e-972e-88f362b23d59":"CardOS FIDO2 Token","8eec9bf9-486c-46da-9a67-1fbb4f66b9ed":"HID Crescendo 4000 FIPS","9012593f-43e4-4461-a97a-d92777b55d74":"VinCSS FIDO2 Fingerprint","905b4cb4-ed6f-4da9-92fc-45e0d4e9b5c7":"YubiKey 5 FIPS Series (Enterprise Profile)","90636e1f-ef82-43bf-bdcf-5255f139d12f":"YubiKey Bio Series - Multi-protocol Edition","912435d9-4a88-42f3-972d-1244b0d51420":"SI0X FIDO CL WRIST v1.0","91ad6b93-264b-4987-8737-3a690cad6917":"Token Ring FIDO2 Authenticator","930b0c03-ef46-4ac4-935c-538dccd1fcdb":"Chipwon Clife Key","931327dd-c89b-406c-a81e-ed7058ef36c6":"Swissbit iShield Key FIDO2","95442b2e-f15e-4def-b270-efb106facb4e":"eWBM eFA310 FIDO2 Authenticator","95e4d58c-056e-4a65-866d-f5a69659e880":"TruU Windows Authenticator","970c8d9c-19d2-46af-aa32-3f448db49e35":"WinMagic FIDO Eazy - TPM","973446ca-e21c-9a9b-99f5-9b985a67af0f":"ACS FIDO Authenticator Card","97e6a830-c952-4740-95fc-7c78dc97ce47":"YubiKey Bio Series - Multi-protocol Edition (Enterprise Profile)","9876631b-d4a0-427f-5773-0ec71c9e0279":"Somu Secp256R1 FIDO2 CTAP2 Authenticator","998f358b-2dd2-4cbe-a43a-e8107438dfb3":"OnlyKey Secp256R1 FIDO2 CTAP2 Authenticator","99bf4610-ec26-4252-b31f-7380ccd59db5":"ZTPass SmartAuth","99ed6c29-4573-4847-816d-78ad8f1c75ef":"VeroCard FIDO2 Authenticator","9c835346-796b-4c27-8898-d6032f515cc5":"Cryptnox FIDO2","9d3df6ba-282f-11ed-a261-0242ac120002":"Arculus FIDO2/U2F Key Card","9ddd1817-af5a-4672-a2b9-3e3dd95000a9":"Windows Hello","9e66c661-e428-452a-a8fb-51f7ed088acf":"YubiKey 5 FIPS Series with Lightning (RC Preview)","9eb7eabc-9db5-49a1-b6c3-555a802093f4":"YubiKey 5 Series with NFC KVZR57","9eb85bb6-9625-4a72-815d-0487830ccab2":"Ensurity AUTH BioPro Desktop","9f0d8150-baa5-4c00-9299-ad62c8bb4e87":"GoTrust Idem Card FIDO2 Authenticator","9f77e279-a6e2-4d58-b700-31e5943c6a98":"Hyper FIDO Pro","9ff4cc65-6154-4fff-ba09-9e2af7882ad2":"Security Key NFC by Yubico - Enterprise Edition (Enterprise Profile)","a02140b7-0cbd-42e1-a9b5-a39da2545114":"Feitian BioPass FIDO2 Plus (Enterprise Profile)","a02167b9-ae71-4ac7-9a07-06432ebb6f1c":"YubiKey 5 Series with Lightning","a10c6dd9-465e-4226-8198-c7c44b91c555":"Kaspersky Password Manager","a11a5faa-9f32-4b8c-8c5d-2f7d13e8c942":"AliasVault","a1f52be5-dfab-4364-b51c-2bd496b14a56":"OCTATCO EzFinger2 FIDO2 AUTHENTICATOR","a25342c0-3cdc-4414-8e46-f4807fca511c":"YubiKey 5 Series with NFC","a3975549-b191-fd67-b8fb-017e2917fdb3":"Excelsecu eSecu FIDO2 NFC Security Key","a4e9fc6d-4cbe-4758-b8ba-37598bb5bbaa":"Security Key NFC by Yubico","a7fc3f84-86a3-4da4-a3d7-eb6485a066d8":"NEOWAVE Badgeo FIDO2 (CTAP 2.1)","aa79f476-ea00-417e-9628-1e8365123922":"HID Crescendo 4000 FIDO","ab32f0c6-2239-afbb-c470-d2ef4e254db6":"TEST (DUMMY RECORD)","ab32f0c6-2239-afbb-c470-d2ef4e254db7":"TOKEN2 FIDO2 Security Key","ad08c78a-4e41-49b9-86a2-ac15b06899e2":"YubiKey Bio Series - FIDO Edition (Enterprise Profile)","adce0002-35bc-c60a-648b-0b25f1f05503":"Chrome on Mac","aeb6569c-f8fb-4950-ac60-24ca2bbe2e52":"HID Crescendo C2300","b12eac35-586c-4809-a4b1-d81af6c305cf":"Deepnet SafeKey/Classic (NFC)","b267239b-954f-4041-a01b-ee4f33c145b6":"authenton1 - CTAP2.1","b2c1a50b-dad8-4dc7-ba4d-0ce9597904bc":"YubiKey 5 Series with NFC - Enhanced PIN (Enterprise Profile)","b35a26b2-8f6e-4697-ab1d-d44db4da28c6":"Zoho Vault","b415094c-49d3-4c8b-b3fe-7d0ad28a6bc4":"ZTPass SmartAuth","b50d5e0a-7f81-4959-9b12-f45407407503":"IDPrime 3940 FIDO","b5397666-4885-aa6b-cebf-e52262a439a2":"Chromium Browser","b6ede29c-3772-412c-8a78-539c1f4c62d2":"Feitian BioPass FIDO2 Plus Authenticator","b78a0a55-6ef8-d246-a042-ba0f6d55050c":"LastPass","b7d3f68e-88a6-471e-9ecf-2df26d041ede":"Security Key NFC by Yubico","b84e4048-15dc-4dd0-8640-f4f60813c8af":"NordPass","b90e7dc1-316e-4fee-a25a-56a666a670fe":"YubiKey 5 Series with Lightning (Enterprise Profile)","b92c3f9a-c014-4056-887f-140a2501163b":"Security Key by Yubico","b93fd961-f2e6-462f
279-b122-82002247de78":"Android Authenticator","b9f6b7b6-f929-4189-bca9-dd951240c132":"Deepnet SafeKey/Classic (USB)","ba76a271-6eb6-4171-874d-b6428dbe3437":"ATKey.ProS","ba86dc56-635f-4141-aef6-00227b1b9af6":"TruU Windows Authenticator","bada5566-a7aa-401f-bd96-45619a55120d":"1Password","bb405265-40cf-4115-93e5-a332c1968d8c":"ID-One Card","bb66c294-de08-47e4-b7aa-d12c2cd3fb20":"Mettlesemi Vishwaas Hawk Authenticator using FIDO2","bb878d7b-cf54-4784-b390-357030497043":"TruU FIDO2 Authenticator","bbf4b6a7-679d-f6fc-c4f2-8ac0ddf9015a":"Excelsecu eSecu FIDO2 PRO Security Key","bc2fe499-0d8e-4ffe-96f3-94a82840cf8c":"OCTATCO EzQuant FIDO2 AUTHENTICATOR","be727034-574a-f799-5c76-0929e0430973":"Crayonic KeyVault K1 (USB-NFC-BLE FIDO2 Authenticator)","bfc748bb-3429-4faa-b9f9-7cfa9f3b76d0":"iPasswords","c1f9a0bc-1dd2-404a-b27f-8e29047a43fd":"YubiKey 5 FIPS Series with NFC","c3f47802-de73-4dfc-ba22-671fe3304f90":"eToken Fusion NFC PIV Enterprise","c4ddaf11-3032-4e77-b3b9-3a340369b9ad":"HID Crescendo Fusion","c5703116-972b-4851-a3e7-ae1259843399":"NEOWAVE Badgeo FIDO2","c5ef55ff-ad9a-4b9f-b580-adebafe026d0":"YubiKey 5 Series with Lightning","c611b55c-77b2-4527-8082-590e931b2f08":"Idem Key (Consumer profile)","c62100de-759b-4bf8-b22b-63b3e3a80401":"Token Ring 3 FIDO2 Authenticator","c80dbd9a-533f-4a17-b941-1a2f1c7cedff":"HID Crescendo C3000","c89674e3-a765-4b07-888a-7c086fbdf04b":"StarSign FIDO Card","c89e6a38-6c00-5426-5aa5-c9cbf48f0382":"ACS FIDO Authenticator NFC","ca4cff1b-5a81-4404-8194-59aabcf1660b":"IDPrime 3930 FIDO","ca87cb70-4c1b-4579-a8e8-4efdd7c007e0":"FIDO Alliance TruU Sample FIDO2 Authenticator","cb69481e-8ff7-4039-93ec-0a2729a154a8":"YubiKey 5 Series","cc45f64e-52a2-451b-83
2791a-4edd8022a202":"ToothPic Passkey Provider","cd69adb5-3c7a-deb9-3177-6800ea6cb72a":"Thales PIN Android SDK","cdbdaea2-c415-5073-50f7-c04e968640b6":"Excelsecu eSecu FIDO2 Security Key","ce6bf97f-9f69-4ba7-9032-97adc6ca5cf1":"YubiKey 5 FIPS Series with NFC (RC Preview)","cfcb13a2-244f-4b36-9077-82b79d6a7de7":"USB/NFC Passcode Authenticator","d2fbd093-ee62-488d-9dad-1e36389f8826":"YubiKey 5 FIPS Series (RC Preview)","d3452668-01fd-4c12-926c-83a4204853aa":"Microsoft Password Manager","d350af52-0351-4ba2-acd3-dfeeadc3f764":"pwSafe","d384db22-4d50-ebde-2eac-5765cf1e2a44":"Excelsecu eSecu FIDO2 Fingerprint Security Key","d41f5a69-b817-4144-a13c-9ebd6d9254d6":"ATKey.Card CTAP2.0","d49b2120-b865-4191-8cea-be84a52b0485":"Heimlane Vault","d548826e-79b4-db40-a3d8-11116f7e8349":"Bitwarden","d61d3b87-3e7c-4aea-9c50-441c371903ad":"KeyVault Secp256R1 FIDO2 CTAP2 Authenticator","d716019a-9f4e-4041-9750-17c78f8ae81a":"eToken Fusion BIO","d7781e5d-e353-46aa-afe2-3ca49f13332a":"YubiKey 5 Series with NFC","d7a423ad-3e19-4492-9200-78137dccc136":"VivoKey Apex FIDO2","d821a7d4-e97c-4cb6-bd82-4237731fd4be":"Hyper FIDO Bio Security Key","d8522d9f-575b-4866-88a9-ba99fa02f35b":"YubiKey Bio Series - FIDO Edition","d91c5288-0ef0-49b7-b8ae-21ca0aa6b3f3":"KEY-ID FIDO2 Authenticator","d94a29d9-52dd-4247-9c2d-8b818b610389":"VeriMark Guard Fingerprint Key","da1fa263-8b25-42b6-a820-c0036f21ba7f":"ATKey.Card NFC","dd4ec289-e01d-41c9-bb89-70fa845d4bf2":"iCloud Keychain (Managed)","dd86a2da-86a0-4cbe-b462-4bd31f57bc6f":"YubiKey Bio Series - FIDO Edition","dda9aa35-aaf1-4d3c-b6db-7902fd7dbbbf":"IDEMIA SOLVO Fly 80 R3 FIDO Card c","de503f9c-21a4-4f76-b4b7-558eb55c6f89":"Devolutions","def8ab1a-9f91-44f1-a103-088d8dc7d681":"IDEMIA SOLVO Fly 80 R3 FIDO Card e","e1a96183-5016-4f24-b55b-e3ae23614cc6":"ATKey.Pro CTAP2.0","e400ef8c-711d-4692-af46-7f2cf7da23ad":"Swissbit iShield Key 2 Enterprise","e416201b-afeb-41ca-a03d-2281c28322aa":"ATKey.Pro CTAP2.1","e41b42a3-60ac-4afb-8757-a98f2d7f6c9f":"Deepnet SafeKey/Classic (FP)","e77e3c64-05e3-428b-8824-0cbeb04b829d":"Security Key NFC by Yubico","e86addcd-7711-47e5-b42a-c18257b0bf61":"IDCore 3121 Fido","ea9b8d66-4d01-1d21-3ce4-b6b48cb575d4":"Google Password Manager","eabb46cc-e241-80bf-ae9e-96fa6d2975cf":"TOKEN2 PIN Plus Security Key Series ","eaecdef2-1c31-5634-8639-f1cbd9c00a08":"KeePassDX","eb3b131e-59dc-536a-d176-cb7306da10f5":"ellipticSecure MIRkey USB Authenticator","ec31b4cc-2acc-4b8e-9c01-bade00ccbe26":"KeyXentic FIDO2 Secp256R1 FIDO2 CTAP2 Authenticator","ed042a3a-4b22-4455-bb69-a267b652ae7e":"Security Key NFC by Yubico - Enterprise Edition","ee041bce-25e5-4cdb-8f86-897fd6418464":"Feitian ePass FIDO2-NFC Authenticator","ee7fa1e0-9539-432f-bd43-9c2fc6d4f311":"VeriMark NFC+ USB-C Security Key","ee882879-721c-4913-9775-3dfcce97072a":"YubiKey 5 Series","efb96b10-a9ee-4b6c-a4a9-d32125ccd4a4":"Safenet eToken FIDO","f2145e86-211e-4931-b874-e22bba7d01cc":"ID-One Key","f3809540-7f14-49c1-a8b3-8f813b225541":"Enpass","f4c63eff-d26c-4248-801c-3736c7eaa93a":"FIDO KeyPass S3","f56f58b3-d711-4afc-ba7d-6ac05f88cb19":"WinMagic FIDO Eazy - Phone","f573f209-b7fb-b261-671a-d7cf624cc812":"Excelsecu eSecu FIDO2 PRO+ Security Key","f7c558a0-f465-11e8-b568-0800200c9a66":"KONAI Secp256R1 FIDO2 Conformance Testing CTAP2 Authenticator","f8a011f3-8c0a-4d15-8006-17111f9edc7d":"Security Key by Yubico","f8d5c4e9-e539-4c06-8662-ec2a4155a555":"StarSign Key Fob","fa2b99dc-9e39-4257-8f92-4a30d23c4118":"YubiKey 5 Series with NFC","fbefdf68-fe86-0106-213e-4d5fa24cbe2e":"Excelsecu eSecu FIDO2 NFC Security Key","fbfc3007-154e-4ecc-8c0b-6e020557d7bd":"Apple Passwords","fc5ca237-69a0-4f3c-afe4-1ebc66def6df":"Clife Key 2","fcb1bcb4-f370-078c-6993-bc24d0ae3fbe":"Ledger Nano X FIDO2 Authenticator","fcc0118f-cd45-435b-8da1-9782b2da0715":"YubiKey 5 FIPS Series with NFC","fdb141b2-5d84-443e-8a35-4698c205a502":"KeePassXC","fec067a1-f1d0-4c5e-b4c0-cc3237475461":"KX701 SmartToken FIDO","ff4dac45-ede8-4ec2-aced-cf66103f4335":"YubiKey 5 Series"},aL=new TextDecoder("utf-8");function j1(e){return typeof e=="string"&&(e=yi(e)),JSON.parse(aL.decode(e))}function wc(e){typeof e=="string"&&(e=yi(e));let t=new DataView(e.slice(32,33)).getUint8(0);return{rpIdHash:cL(e),flags:{userPresent:!!(t&1),userVerified:!!(t&4),backupEligibility:!!(t&8),backupState:!!(t&16),attestedData:!!(t&64),extensionsIncluded:!!(t&128)},signCount:new DataView(e.slice(33,37)).getUint32(0,!1),aaguid:lL(e)}}function cL(e){return dn(e.slice(0,32))}function lL(e){if(e.byteLength<53)return"00000000-0000-0000-0000-000000000000";let t=e.slice(37,53),n=o5(t);return`${n.substring(0,8)}-${n.substring(8,12)}-${n.substring(12,16)}-${n.substring(16,20)}-${n.substring(20,32)}`}function l5(e){switch(e){case-7:return"ES256";case-8:return"EdDSA";case-257:return"RS256";default:throw new Error(`Unknown algorithm code: ${e}`)}}function uL(e){let t=wc(e.response.authenticatorData);return u5(e,t)}function u5(e,t){let n=t.aaguid;return{authenticator:{aaguid:n,counter:t.signCount,icon_light:"https://webauthn.passwordless.id/authenticators/"+n+"-light.png",icon_dark:"https://webauthn.passwordless.id/authenticators/"+n+"-dark.png",name:oL[n]??"Unknown"},credential:{id:e.id,publicKey:e.response.publicKey,algorithm:l5(e.response.publicKeyAlgorithm),transports:e.response.transports},synced:t.flags.backupEligibility,user:e.user,userVerified:t.flags.userVerified}}function S1(e,t){return{credentialId:e.id,userId:e.response.userHandle,counter:t.signCount,userVerified:t.flags.userVerified,authenticatorAttachment:e.authenticatorAttachment}}function dL(e){let t=wc(e.response.authenticatorData);return S1(e,t)}function hL(){let e=crypto.getRandomValues(new Uint8Array(18));return dn(e)}async function fL(e,t){if(typeof e=="function"){let n=e(t);return n instanceof Promise?await n:n}return e===t}async function zl(e,t){return!await fL(e,t)}async function mL(e,t){let n=j1(e.response.clientDataJSON),i=wc(e.response.authenticatorData),r=i.aaguid;if(t.verbose,t.userVerified&&!i.flags.userVerified)throw new Error("User verification required but not satisfied.");
279let s=t.domain??new URL(n.origin).hostname,o=dn(await $u(pc(s)));if(i.rpIdHash!==o)throw new Error(`Unexpected RpIdHash: ${i.rpIdHash} vs ${o}`);if(!r)throw new Error("Unexpected error, no AAGUID.");if(n.type!=="webauthn.create")throw new Error(`Unexpected ClientData type: ${n.type}`);if(await zl(t.origin,n.origin))throw new Error(`Unexpected ClientData origin: ${n.origin}`);if(await zl(t.challenge,n.challenge))throw new Error(`Unexpected ClientData challenge: ${n.challenge}`);return L1.toRegistrationInfo(e,i)}async function yL(e,t,n){if(e.id!==t.id)throw new Error(`Credential ID mismatch: ${e.id} vs ${t.id}`);if(!await f5({algorithm:t.algorithm,publicKey:t.publicKey,authenticatorData:e.response.authenticatorData,clientData:e.response.clientDataJSON,signature:e.response.signature,verbose:n.verbose}))throw new Error(`Invalid signature: ${e.response.signature}`);let i=j1(e.response.clientDataJSON),r=wc(e.response.authenticatorData);if(n.verbose,i.type!=="webauthn.get")throw new Error(`Unexpected clientData type: ${i.type}`);if(await zl(n.origin,i.origin))throw new Error(`Unexpected ClientData origin: ${i.origin}`);if(await zl(n.challenge,i.challenge))throw new Error(`Unexpected ClientData challenge: ${i.challenge}`);let s=n.domain??new URL(i.origin).hostname,o=dn(await $u(pc(s)));if(r.rpIdHash!==o)throw new Error(`Unexpected RpIdHash: ${r.rpIdHash} vs ${o}`);if(!r.flags.userPresent)throw new Error("Unexpected authenticator flags: missing userPresent");if(!r.flags.userVerified&&n.userVerified)throw new Error("Unexpected authenticator flags: missing userVerified");if(n.counter&&r.signCount<=n.counter)throw new Error(`Unexpected authenticator counter: ${r.signCount} (should be > ${n.counter})`);return S1(e,r)}function d5(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:"SHA-256"};default:throw new Error(`Unknown or unsupported crypto algorithm: ${e}. Only 'RS256' and 'ES256' are supported.`)}}async function h5(e,t){let n=d5(e),i=yi(t);return crypto.subtle.importKey("spki",i,n,!1,["verify"])}async function f5({algorithm:e,publicKey:t,authenticatorData:n,clientData:i,signature:r,verbose:s}){let o=await h5(e,t),c=await $u(yi(i)),l=a5(yi(n),c);s&&(""+e,""+t,""+dn(l),""+r);let u=yi(r);e=="ES256"&&(u=gL(u));let d=d5(e);return await crypto.subtle.verify(d,o,u,l)}function gL(e){let t=new Uint8Array(e),n=t[4]===0?5:4,i=n+32,r=t[i+2]===0?i+3:i+2,s=t.slice(n,i),o=t.slice(r);return new Uint8Array([...s,...o])}let Rd;function pL(){return Rd||(Rd=new TextDecoder),Rd}const wL="[object Uint8Array]";function Eo(e){if(!_L(e))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function _L(e){return e?e.constructor===Uint8Array?!0:Object.prototype.toString.call(e)===wL:!1}
279function $q(e,t){if(Eo(e),Eo(t),e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function bL(e){return Eo(e),pL().decode(e)}function m5(e){if(typeof e!="string")throw new TypeError(`Expected \`string\`, got \`${typeof e}\``)}function a0(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");const n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function xL(e){return m5(e),Uint8Array.from(globalThis.atob(a0(e)),t=>t.codePointAt(0))}function c0(e){return m5(e),bL(xL(e))}function Wq(e,t){if(e.length===0)return new Uint8Array(0);const n=e.reduce((s,o)=>s+o.length,0),i=new Uint8Array(n);let r=0;for(const s of e)Eo(s),i.set(s,r),r+=s.length;return i}function Fq(e,t){Eo(e),Eo(t);const n=Math.min(e.length,t.length);for(let i=0;i<n;i++){const r=e[i]-t[i];if(r!==0)return Math.sign(r)}return Math.sign(e.length-t.length)}class IL{isAvailable(){return ol.isAvailable()}async register(t){const{name:n,challenge:i,rp:r}=t,s=await ol.register({attestation:!0,challenge:i,domain:r.id,user:n,userVerification:"required"}),o=a0(s.response.clientDataJSON),c=JSON.parse(c0(o));return{authenticatorData:s.response.authenticatorData,clientData:s.response.clientDataJSON,credential:{algorithm:L1.getAlgoName(s.response.publicKeyAlgorithm),publicKey:s.response.publicKey},credentialId:s.id,origin:c.origin}}async authenticate(t){const{credentialId:n,challenge:i,rp:r}=t,s=await ol.authenticate({allowCredentials:n?[n]:[],challenge:i,domain:r.id,userVerification:"required"}),o=a0(s.response.clientDataJSON),c=JSON.parse(c0(o));return{authenticatorData:s.response.authenticatorData,clientData:s.response.clientDataJSON,credentialId:s.id,origin:c.origin,signature:s.response.signature}}}async function y5(e,t,n){return!!await new fc({clientId:e.clientId,ecosystem:t?{id:t}:void 0,storage:In}).getPasskeyCredentialId()}const Yq=Object.freeze(Object.defineProperty({__proto__:null,PasskeyWebClient:IL,hasStoredPasskey:y5},Symbol.toStringTag,{value:"Module"}));function ML(e){const{wallet:t,done:n,client:i,chain:r,size:s,locale:o}=e,[c,l]=_.useState("loading"),u=_.useRef(!1);return _.useEffect(()=>{u.current||(u.current=!0,y5(i,Xe(t.id)?t.id:void 0).then(d=>{l(d?"login":"select")}).catch(()=>{l("select")}))},[i,t.id]),a.jsxs(b,{animate:"fadein",flex:"column",fullHeight:!0,children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:e.isLinking?o.passkeys.linkPasskey:o.passkeys.title})}),a.jsx(b,{center:"y",expand:!0,flex:"column",px:s==="wide"?"xxl":"lg",children:a.jsxs("div",{children:[c==="loading"&&a.jsxs(a.Fragment,{children:[a.jsx(Mt,{}),a.jsx(U,{y:"xxl"})]}),c==="select"&&a.jsx(TL,{onSignin:()=>{l("login")},onSignup:()=>{l("signup")}}),c==="login"&&a.jsx(CL,{chain:r,client:i,done:n,isLinking:e.isLinking,onCreate:()=>{l("signup")},wallet:t}),c==="signup"&&a.jsx(EL,{chain:r,client:i,done:n,isLinking:e.isLinking,wallet:t})]})})]})}function CL(e){const{wallet:t,done:n,client:i,chain:r}=e,[s,o]=_.useState("loading"),[c,l]=_.useState();async function u(){o("loading");try{e.isLinking?await Kr({client:i,strategy:"passkey",type:"sign-in"}).catch(f=>{throw l(f.message),f}):(await t.connect({chain:r,client:i,strategy:"passkey",type:"sign-in"}),await ar("passkey",In)),n()}catch(f){console.error("Failed to login with passkey",f),o("error")}}const d=_.useRef(!1);return _.useEffect(()=>{d.current||(d.current=!0,u())}),s==="loading"?a.jsx(T1,{icon:a.jsx(Vs,{size:D.xxl}),subtitle:"A pop-up prompt will appear to sign-in and verify your passkey",title:"Requesting Passkey"}):s==="error"?a.jsxs(a.Fragment,{children:[a.jsx(Bu,{onTryAgain:u,title:c||"Failed to Login"}),a.jsx(U,{y:"sm"}),a.jsx(ue,{fullWidth:!0,onClick:e.onCreate,variant:"outline",children:"Create a new Passkey"}),a.jsx(U,{y:"lg"})]}):null}function EL(e){var m;const{wallet:t,done:n,client:i,chain:r}=e,[s,o]=_.useState(),[c,l]=_.useState("loading"),u=Xe(t)?{id:t.id,partnerId:(m=t.getConfig())==null?void 0:m.partnerId}:void 0;async function d(){l("loading");try{e.isLinking?await Kr({client:i,ecosystem:u,strategy:"passkey",type:"sign-up"}):(await t.connect({chain:r,client:i,strategy:"passkey",type:"sign-up"}),await ar("passkey",In)),n()}catch(y){console.error(y),y instanceof Error&&o(`Error creating passkey: ${y.message}`),l("error")}}const f=_.useRef(!1);return _.useEffect(()=>{f.current||(f.current=!0,d())}),c==="loading"?a.jsx(T1,{icon:a.jsx(Vs,{size:D.xxl}),subtitle:"A pop-up prompt will appear to sign-in and verify your passkey",t
279itle:"Creating Passkey"}):c==="error"?a.jsxs(a.Fragment,{children:[a.jsx(Bu,{onTryAgain:d,title:s||"Failed to create passkey"}),a.jsx(U,{y:"lg"})]}):null}function TL(e){return a.jsxs(b,{children:[a.jsx(U,{y:"xxl"}),a.jsx(b,{center:"x",color:"accentText",flex:"row",children:a.jsx(Vs,{size:D["4xl"]})}),a.jsx(U,{y:"xl"}),a.jsx(U,{y:"xxl"}),a.jsx(ue,{fullWidth:!0,onClick:e.onSignup,variant:"accent",children:"Create a Passkey"}),a.jsx(U,{y:"sm"}),a.jsx(ue,{fullWidth:!0,onClick:e.onSignin,variant:"outline",children:"I have a Passkey"}),a.jsx(U,{y:"lg"})]})}function vL(e){var g,p;const t=e.locale,n=t.socialLoginScreen,i=ee(),r=Xe(e.wallet)?{id:e.wallet.id,partnerId:(g=e.wallet.getConfig())==null?void 0:g.partnerId}:void 0,[s,o]=_.useState(void 0),{done:c,wallet:l}=e,[u,d]=_.useState("connecting"),f=async()=>{var I,E,j,C;const w=l.getConfig(),x=w&&"auth"in w?((I=w==null?void 0:w.auth)==null?void 0:I.mode)??"popup":"popup";if(w&&"auth"in w&&x!=="popup"&&!e.isLinking)return y3({authOption:e.socialAuth,client:e.client,ecosystem:r,mode:(E=w==null?void 0:w.auth)==null?void 0:E.mode,redirectUrl:(j=w==null?void 0:w.auth)==null?void 0:j.redirectUrl});try{const T=p3({authOption:e.socialAuth,client:e.client,ecosystem:r,themeObj:i});if(!T)throw new Error(`Failed to open ${e.socialAuth} login window`);d("connecting"),e.isLinking?await Kr({client:e.client,closeOpenedWindow:v=>{v.close()},ecosystem:r,openedWindow:T,strategy:e.socialAuth}).catch(v=>{throw o(v.message),v}):await l.connect({chain:e.chain,client:e.client,closeOpenedWindow:v=>{v.close()},openedWindow:T,strategy:e.socialAuth}),await ar(e.socialAuth,In),d("connected"),c()}catch(T){d("error"),T instanceof Error&&((C=T==null?void 0:T.message)!=null&&C.includes("PAYMENT_METHOD_REQUIRED"))&&o(t.maxAccountsExceeded),console.error(`Error signing in with ${e.socialAuth}`,T)}},m=(p=e.state)==null?void 0:p.socialLogin,y=_.useRef(!1);return _.useEffect(()=>{y.current||m&&(y.current=!0,d("connecting"),m.connectionPromise.then(()=>{c(),d("connected")}).catch(w=>{o(w.message),d("error")}))},[c,m]),a.jsx(b,{animate:"fadein",flex:"column",fullHeight:!0,className:"tw-social-login-screen",children:a.jsxs(b,{expand:!0,flex:"column",p:"lg",style:{paddingBottom:0},children:[e.goBack&&a.jsx(Me,{onBack:e.goBack,title:e.isLinking?e.connectLocale.manageWallet.linkProfile:n.title}),e.size==="compact"?a.jsx(U,{y:"xl"}):null,a.jsxs(b,{center:"both",expand:!0,flex:"column",style:{minHeight:"250px",textAlign:"center"},children:[u!=="error"&&a.jsxs(b,{animate:"fadein",children:[a.jsx(A,{center:!0,color:"primaryText",multiline:!0,style:{maxWidth:"250px"},children:n.instruction}),a.jsx(U,{y:"xl"}),a.jsx(b,{center:"x",flex:"row",children:a.jsx(Qe,{color:"accentText",size:"lg"})}),a.jsx(U,{y:"xxl"})]}),u==="error"&&a.jsxs(b,{animate:"fadein",children:[s?a.jsx(A,{center:!0,color:"danger",children:s}):a.jsx(A,{color:"danger",children:n.failed}),a.jsx(U,{y:"lg"}),a.jsx(ue,{onClick:f,variant:"primary",children:n.retry}),a.jsx(U,{y:"xxl"})]})]})]})})}function LL(e){var n,i,r;const t=Po(e.wallet.id);return a.jsx(Me,{leftAligned:!0,onBack:e.onBack,title:t.isLoading?a.jsx(me,{height:"24px",width:"200px"}):a.jsxs(a.Fragment,{children:[(n=t.data)!=null&&n.image_id?a.jsx(dt,{client:e.client,height:D.md,src:(i=t.data)==null?void 0:i.image_id,style:{borderRadius:J.sm},width:D.md}):null,a.jsx(Su,{children:(r=t.data)==null?void 0:r.name})]})})}function jL(e){const t=e.size==="compact",{initialScreen:n,screen:i}=h1(),[r,s]=_.useState(!1),o=i===e.wallet&&n===e.wallet?void 0:e.goBack;return a.jsxs(b,{animate:"fadein",flex:"column",fullHeight:!0,p:"lg",style:{minHeight:"250px"},children:[e.isLinking?a.jsx(Me,{onBack:o,title:e.connectLocale.manageWallet.linkProfile}):a.jsx(LL,{client:e.client,onBack:t?o:void 0,wallet:e.wallet}),a.jsx(U,{y:"lg"}),a.jsx(b,{center:"y",expand:!0,flex:"column",p:t?void 0:"lg",children:a.jsx(w3,{disabled:e.meta.requireApproval&&!r,...e})}),t&&(e.meta.showThirdwebBranding!==!1||e.meta.termsOfServiceUrl||e.meta.privacyPolicyUrl)&&a.jsx(U,{y:"xl"}),a.jsxs(b,{flex:"column",gap:"lg",children:[a.jsx(ku,{isApproved:r,locale:e.connectLocale.agreement,onApprove:()=>{s(!r)},privacyPolicyUrl:e.meta.privacyPolicyUrl,requireApproval:e.meta.requireApproval,termsOfServiceUrl:e.meta.termsOfServiceUrl}),e.meta.showThirdwebBranding!==!1&&a.jsx(Mo,{})]})]})}function g5(e){const t=OM(),n=Bs(),i=t,r=e.connectLocale.id,s=_3(r);if(!s)return a.jsx(Mt,{});const o=()=>{var u;e.size==="compact"&&((u=e.goBack)==null||u.call(e)),n({})},c=()=>{e.done(),n({})},l=i!=null&&i.emailLogin?{email:i.emailLogin}:i!=null&&i.phoneLogin?{phone:i.phoneLogin}:void 0;return l?a.jsx(qv,{chain:e.chain,client:e.client,done:c,goBack:o,isLinking:e.isLinking,locale:s,size:e.size,userInfo:l,wallet:e.wallet}):i!=null&&i.passkeyLogin?a.jsx(ML,{chain:e.chain,client:e.client,done:c,isLinking:e.isLinking,locale:e.connectLocale,onBack:o,size:e.size,wallet:e.wallet}):i!=null&&i.socialLogin?a.jsx(vL,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,done:c,goBack:o,isLinking:e.isLinking,locale:s,size:e.size,socialAuth:i.socialLogin.type,state:i,wallet:e.wallet}):i!=null&&i.walletLogin?a.jsx(vv,{chain:e.chain,client:e.client,done:c,inAppLocale:s,isLinking:i.walletLogin.linking,locale:e.connectLocale,meta:e.meta,onBack:o||(()=>n({})),size:e.size,wallet:e.wallet,walletConnect:e.walletConnect}):i!=null&&i.guestLogin?a.jsx(Lv,{client:e.client,connectLocale:e.connectLocale,done:c,goBack:o,locale:s,size:e.size,state:i,wallet:e.wallet}):a.jsx(jL,{chain:e.chain,client:e.client,connectLocale:e.connectLocale,done:c,goBack:e.goBack,isLinking:e.isLinking,locale:s,meta:e.meta,select:()=>{},size:e.size,wallet:e.wallet})}const SL=Object.freeze(Object.defineProperty({__proto__:null,default:g5},Symbol.toStringTag,{value:"Module"})),DL=_.lazy(()=>h(()=>import("./InAppWalletConnectUI-7nAWBUuy.js"),__vite__mapDeps([43,4,3,7,6,8,9,10,5,2,1,11,12,13,14,15])));function NL(e){const t=hu(),n=ft(),i=jt(),r=ur(),s=t||n;return s?s.id==="inApp"?a.jsx(_.Suspense,{fallback:a.jsx(Mt,{}),children:a.jsx(DL,{chain:i,client:e.client,connectLocale:e.locale,done:()=>{setTimeout(()=>{r.invalidateQueries({queryKey:["profiles"]})},500),e.onBack()},goBack:e.onBack,isLinking:!0,meta:{showThirdwebBranding:!1,title:e.locale.manageWallet.linkProfile},size:"compact",wallet:s,walletConnect:e.walletConnect})}):Xe(s)?a.jsx(_.Suspense,{fallback:a.jsx(Mt,{}),children:a.jsx(g5,{chain:i,client:e.client,connectLocale:e.locale,done:()=>{setTimeout(()=>{r.invalidateQueries({queryKey:["profiles"]})},500),e.onBack()},goBack:e.onBack,isLinking:!0,meta:{showThirdwebBranding:!1,title:e.locale.manageWallet.linkProfile},size:"compact",wallet:s,walletConnect:e.walletConnect})}):a.jsxs(b,{style:{minHeight:"300px"},children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:e.locale.manageWallet.linkProfile})}),a.jsx(He,{}),a.jsxs(b,{center:"both",color:"secondaryText",flex:"column",gap:"md",px:"xl",style:{flex:"1",minHeight:"250px"},children:[a.jsx(is,{height:D.xl,width:D.xl}),a.jsx(A,{center:!0,children:"This wallet does not support account linking"})]})]}):a.jsx(Mt,{})}const AL=e=>a.jsxs("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 24 24",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M2 5.99999L2 2.99999C2 2.39999 2.4 1.99999 3 1.99999H7L7 4.99999H10V7.99999H12L13.4 9.39999C14.7898 8.91585 16.3028 8.9177 17.6915 9.40524C19.0801 9.89278 20.2622 10.8372 21.0444 12.0839C21.8265 13.3306 22.1624 14.8058 21.9971 16.2683C21.8318 17.7307 21.1751 19.0937 20.1344 20.1344C19.0937 21.1751 17.7307 21.8318 16.2683 21.9971C14.8058 22.1624 13.3306 21.8265 12.0839 21.0444C10.8372 20.2622 9.89279 19.0801 9.40525 17.6915C8.91771 16.3028 8.91585 14.7898 9.4 13.4L2 5.99999Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),a.jsx("path",{d:"M15.5 15C15.7761 15 16 15.2239 16 15.5C16 15.7761 15.7761 16 15.5 16C15.2239 16 15 15.7761 15 15.5C15 15.2239 15.2239 15 15.5 15Z",fill:"currentColor",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]}),OL=e=>a.jsx("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 24 24",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M22 21V19C22 17.1362 20.7252 15.5701 19 15.126M15.5 3.29076C16.9659 3.88415 18 5.32131 18 7C18 8.67869 16.9659 10.1159 15.5 10.7092M17 21C17 19.1362 17 18.2044 16.6955 17.4693C16.2895 16.4892 15.5108 15.7105 14.5307 15.3045C13.7956 15 12.8638 15 11 15H8C6.13623 15 5.20435 15 4.46927 15.3045C3.48915 15.7105 2.7104
2796 16.4892 2.30448 17.4693C2 18.2044 2 19.1362 2 21M13.5 7C13.5 9.20914 11.7091 11 9.5 11C7.29086 11 5.5 9.20914 5.5 7C5.5 4.79086 7.29086 3 9.5 3C11.7091 3 13.5 4.79086 13.5 7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})}),kL=e=>a.jsx("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 24 24",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M4.91334 7.73539C8.82714 4.0882 15.1729 4.0882 19.0867 7.73539L19.5577 8.17432C19.7534 8.35664 19.7534 8.65232 19.5577 8.83464L17.9464 10.3362C17.8485 10.4274 17.6899 10.4274 17.5921 10.3362L16.9439 9.73217C14.2134 7.18782 9.7866 7.18782 7.05614 9.73217L6.36193 10.379C6.26407 10.4702 6.10547 10.4702 6.0076 10.379L4.39629 8.87747C4.20056 8.69515 4.20056 8.39947 4.39629 8.21715L4.91334 7.73539ZM22.4191 10.8407L23.8532 12.1771C24.0489 12.3594 24.0489 12.6551 23.8532 12.8374L17.3867 18.8632C17.1911 19.0456 16.8738 19.0456 16.6781 18.8632L12.0886 14.5865C12.0397 14.5409 11.9604 14.5409 11.9115 14.5865L7.32202 18.8632C7.12638 19.0456 6.8091 19.0456 6.61337 18.8632L0.146771 12.8373C-0.0489237 12.655 -0.0489237 12.3593 0.146771 12.177L1.58087 10.8406C1.77657 10.6582 2.09384 10.6582 2.28954 10.8406L6.87907 15.1173C6.928 15.163 7.0073 15.163 7.05623 15.1173L11.6456 10.8406C11.8412 10.6582 12.1585 10.6582 12.3542 10.8406L16.9438 15.1173C16.9927 15.163 17.072 15.163 17.1209 15.1173L21.7105 10.8407C21.9061 10.6583 22.2234 10.6583 22.4191 10.8407Z",fill:"currentColor"})});function zL(e){var r,s;const t=hu(),n=ft(),i=t||n;return a.jsxs(b,{style:{minHeight:"300px"},children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:e.locale.manageWallet.title})}),a.jsx(He,{}),a.jsxs(b,{px:"sm",scrollY:!0,style:{maxHeight:"500px"},children:[a.jsx(U,{y:"md"}),a.jsxs(b,{style:{height:"250px",position:"relative"},children:[a.jsx(PL,{closeModal:e.closeModal,connectLocale:e.locale}),typeof i<"u"&&((r=e.manageWallet)==null?void 0:r.allowLinkingProfiles)!==!1&&a.jsxs(ii,{onClick:()=>{e.setScreen("linked-profiles")},style:{fontSize:ie.sm},children:[a.jsx(OL,{size:D.md}),a.jsx(A,{color:"primaryText",children:e.locale.manageWallet.linkedProfiles})]}),a.jsxs(ii,{onClick:()=>{e.setScreen("wallet-connect-receiver")},style:{fontSize:ie.sm},children:[a.jsx(kL,{size:D.md}),a.jsx(A,{color:"primaryText",children:e.locale.manageWallet.connectAnApp})]}),i&&o1(i)&&!((s=i.getConfig())!=null&&s.hidePrivateKeyExport)&&a.jsxs(ii,{onClick:()=>{e.setScreen("private-key")},style:{fontSize:ie.sm},children:[a.jsx(AL,{size:D.md}),a.jsx(A,{color:"primaryText",children:e.locale.manageWallet.exportPrivateKey})]})]}),a.jsx(U,{y:"lg"})]})]})}function PL(e){const t=ft(),n=e.connectLocale;if((t==null?void 0:t.id)!=="io.metamask")return null;const i=r1("io.metamask");return i?a.jsxs(ii,{onClick:async()=>{await i.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}),e.closeModal()},type:"button",children:[a.jsx(tM,{height:D.md,width:D.md}),a.jsx(A,{color:"primaryText",children:n.switchAccount})]}):null}function RL(e){var s;const[t,n]=_.useState(!0),i=St("inAppWallet");if(_.useEffect(()=>{const o=async c=>{var l,u;if(typeof c.data=="object"&&"eventType"in c.data&&c.origin===i&&c.data.eventType==="exportPrivateKeyIframeLoaded"){const d=document.getElementById(`export-wallet-${(l=e.wallet)==null?void 0:l.id}`);if(!(d instanceof HTMLIFrameElement)||!e.wallet)return;const f=new fc({clientId:e.client.clientId,ecosystem:Xe(e.wallet)?{id:e.wallet.id,partnerId:(u=e.wallet.getConfig())==null?void 0:u.partnerId}:void 0,storage:In});d!=null&&d.contentWindow&&d.contentWindow.postMessage({authToken:await f.getAuthCookie(),eventType:"initExportPrivateKey"},c.origin)}};return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}},[e.wallet,e.client.clientId,i]),!e.wallet)throw new Error("[PrivateKey] No wallet found");const r=Xe(e.wallet)?{id:e.wallet.id,partnerId:(s=e.wallet.getConfig())==null?void 0:s.partnerId}:void 0;return a.jsxs(b,{style:{minHeight:"300px"},children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:e.connectLocale.manageWallet.exportPrivateKey})}),a.jsx(He,{}),a.jsxs(b,{px:"sm",scrollY:!0,style:{maxHeight:"500px"},children:[a.jsx(U,{y:"md"}),a.jsxs(b,{style:{height:"250px",position:"relative"},children:[t?a.jsx(b,{center:"both",flex:"column",style:{height:"100%",position:"absolute",width:"100%"},children:a.jsx(Qe,{color:"primaryButtonBg",size:"lg"})}):null,a.jsx(b,{style:{height:"100%",position:"absolute",width:"100%",zIndex:11},children:a.jsx("iframe",{allow:"clipboard-read; clipboard-write",id:`export-wallet-${e.wallet.id}`,onLoad:()=>{n(!1)},src:`${i}/sdk/2022-08-12/embedded-wallet/export-private-key?clientId=${e.client.clientId}&theme=${typeof e.theme=="string"?e.theme:e.theme.type}${r?`&ecosystemId=${r.id}`:""}${r!=null&&r.partnerId?`&partnerId=${r.partnerId}`:""}`,style:{height:"250px",visibility:t?"hidden":"unset",width:"100%"},title:"Export In-App Wallet"})})]}),a.jsx(U,{y:"lg"})]})]})}function UL(e,t=!0){return`${e.substring(0,t?4:6)}...${e.substring(e.length-(t?3:4))}`}function BL(e){const t=ht(),n=t==null?void 0:t.address,{hasCopied:i,onCopy:r}=_1(n||""),{connectLocale:s,client:o}
279=e,c=s.receiveFundsScreen;return a.jsxs(b,{p:"lg",className:"tw-receive-funds-screen",children:[a.jsx(Me,{onBack:e.onBack,title:c.title}),a.jsx(U,{y:"xl"}),a.jsx(b,{center:"x",flex:"row",children:a.jsx(Ru,{QRIcon:e.walletId&&a.jsx(ai,{client:o,id:e.walletId,size:D.xxl}),qrCodeUri:n,size:350})}),a.jsx(U,{y:"xl"}),a.jsxs(VL,{onClick:r,className:"tw-copy-address-button",children:[a.jsx(A,{color:"primaryText",size:"md",children:UL(n||"",!1)}),a.jsx(js,{hasCopied:i,text:n||"",tip:"Copy address"})]}),a.jsx(U,{y:"lg"}),a.jsx(A,{balance:!0,center:!0,size:"sm",className:"receive_fund_screen_instruction",multiline:!0,children:c.instruction})]})}const VL=$i(e=>{const t=ee();return{all:"unset","&:hover":{borderColor:t.colors.accentText},border:`1px solid ${t.colors.borderColor}`,borderRadius:J.md,boxSizing:"border-box",cursor:"pointer",display:"flex",justifyContent:"space-between",padding:R.md,transition:"border-color 200ms ease",width:"100%"}}),$L="0x3b3b57de",WL=[{name:"name",type:"bytes32"}];function FL(e){return Y4(WL,[e.name])}function YL(e){return $L+FL(e).slice(2)}async function HL(e){const{client:t,name:n,resolverAddress:i,resolverChain:r}=e;return Zr(n)?_e(n):Ui(async()=>{const s=zt({address:i||Vf,chain:r||zo,client:t}),o=YL({name:Dp(n)}),c=await Ap({contract:s,data:o,name:R4(Np(n))});return _e(`0x${c[0].slice(-40)}`)},{cacheKey:`ens:addr:${(r==null?void 0:r.id)||1}:${n}`,cacheTime:60*1e3})}const QL="0xa9059cbb",ZL=[{name:"to",type:"address"},{name:"value",type:"uint256"}],qL=[{type:"bool"}];function GL(e){const t=lu(async()=>"asyncParams"in e?await e.asyncParams():e);return Is({accessList:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.accessList},authorizationList:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.authorizationList},contract:e.contract,erc20Value:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.erc20Value},extraGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.extraGas},gas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.gas},gasPrice:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.gasPrice},maxFeePerGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.maxFeePerGas},maxPriorityFeePerGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.maxPriorityFeePerGas},method:[QL,ZL,qL],nonce:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.nonce},params:async()=>{const n=await t();return[n.to,n.value]},value:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.value}})}function KL(e){return GL({asyncParams:async()=>{let t;if("amount"in e){const{decimals:n}=await h(async()=>{const{decimals:r}=await import("./decimals-AzlhcAmY.js").then(s=>s.c);return{decimals:r}},__vite__mapDeps([12,5,6,1,2,3,4,7,8,9])),i=await n(e).catch(()=>18);t=tr(e.amount.toString(),i)}else t=e.amountWei;return{overrides:{erc20Value:{amountWei:t,tokenAddress:e.contract.address},...e.overrides},to:e.to,value:t}},contract:e.contract})}function JL(e){const t=e.split("."),n=t[t.length-1];return t.length<2||!n||/\s/.test(n)||/^\d+$/.test(n)?!1:t.every(i=>!(i.length<1||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(i)||/[\uff01-\uff5e]/.test(i)))}function XL(e){const t=ft(),n=ur();return Es({async mutationFn(i){const{tokenAddress:r,receiverAddress:s,amount:o}=i,c=t==null?void 0:t.getChain(),l=t==null?void 0:t.getAccount();if(!c)throw new Error("No active chain");if(!l)throw new Error("No active account");if(!s||!JL(s)&&!Zr(s))throw new Error("Invalid receiver address");if(!o||Number.isNaN(Number(o))||Number(o)<0)throw new Error("Invalid amount");let u=s;try{u=await HL({client:e,name:s})}catch{throw new Error("Failed to resolve address")}if(r){const d=zt({address:r,chain:c,client:e}),f=KL({amount:o,contract:d,to:u});return await za({account:l,transaction:f})}else{const d=Z4({chain:c,client:e,to:u,value:jm(o)}),f=await W6({account:l,transaction:d}),m=await Ts({address:l.address,chain:c,client:e});if(jm(o)+f>m.value)throw new Error("Insufficient balance for transfer amount and gas");return await za({account:l,transaction:d})}},onSettled:async(i,r)=>{r||(i!=null&&i.transactionHash&&await ru({chain:i.chain,client:e,maxBlocksWaitTime:1e4,transactionHash:i.transactionHash}),L6(n))}})}function D1(e){var i;const t=ko(e.chain).data,n=_.useMemo(()=>{var r;return Oi(e.token)||e.token.address===Pt?(t==null?void 0:t.nativeCurrency.symbol)==="ETH"?"ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png":(r=t==null?void 0:t.icon)==null?void 0:r.url:e.token.icon},[e.token,(i=t==null?void 0:t.icon)==null?void 0:i.url,t==null?void 0:t.nativeCurrency.symbol]);return n?a.jsx(dt,{client:e.client,fallbackImage:a3,height:D[e.size],src:n,width:D[e.size]}):a.jsx(b,{center:"both",color:"secondaryText",style:{height:D[e.size],width:D[e.size]},children:a.jsx(gc,{size:D[e.size]})})}function p5(e){const{chain:t,tokenAddress:n,client:i}=e;return pe({enabled:!!t&&!!i,queryFn:async()=>
279{if(n){const{getCurrencyMetadata:f}=await h(async()=>{const{getCurrencyMetadata:y}=await Promise.resolve().then(()=>xZ);return{getCurrencyMetadata:y}},void 0);return await f({contract:zt({address:n,chain:t,client:i})})}const{getChainDecimals:r,getChainNativeCurrencyName:s,getChainSymbol:o}=await h(async()=>{const{getChainDecimals:f,getChainNativeCurrencyName:m,getChainSymbol:y}=await import("./utils-BnNtzvC2.js").then(g=>g.u);return{getChainDecimals:f,getChainNativeCurrencyName:m,getChainSymbol:y}},__vite__mapDeps([5,6])),[c,l,u]=await Promise.all([o(t),r(t),s(t)]);return{decimals:l,name:u,symbol:c}},queryKey:["tokenInfo",(t==null?void 0:t.id)||-1,{tokenAddress:n}]})}const w5=e=>a.jsxs(b,{style:{alignItems:"center",display:"flex",flexShrink:0,position:"relative"},children:[a.jsx(dt,{client:e.client,fallbackImage:Xr,height:e.size,src:ej(e),width:e.size}),e.active&&a.jsx(E1,{className:"tw-chain-active-dot-legacy-chain-icon"})]}),ej=e=>{const t=e.chainIconUrl;if(!t)return Xr;try{return qr({client:e.client,uri:t})}catch{return Xr}};function tj(e){const[t,n]=_.useState("base"),[i,r]=_.useState(""),s=e.chain,o=bp(s),c=Sf(s),l=p5({chain:s,client:e.client,tokenAddress:i}),u=e.connectLocale.sendFundsScreen;let d=e.tokenList;l.data&&i&&(d=[{...l.data,address:i},...d]);const f=i?d.filter(y=>{const g=i.toLowerCase();return y.name.toLowerCase().includes(g)||y.symbol.toLowerCase().includes(g)||y.address.includes(i)}):d,{chainSelection:m}=e;return t==="select-chain"&&m?a.jsx(J3,{className:"tw-send-funds-screen tw-send-funds-screen__select-chain",chains:m.chains,client:e.client,closeModal:()=>n("base"),connectLocale:e.connectLocale,networkSelector:{renderChain(y){return a.jsx(X3,{chain:y.chain,client:e.client,confirming:!1,connectLocale:e.connectLocale,onClick:()=>{m.select(y.chain),n("base")},switchingFailed:!1})}},onBack:()=>n("base"),showTabs:!1}):a.jsxs(b,{className:"tw-send-funds-screen tw-send-funds-screen__select-token",animate:"fadein",style:{minHeight:"300px"},children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:e.modalTitle||u.selectTokenTitle})}),a.jsx(He,{}),a.jsxs(b,{scrollY:!0,style:{maxHeight:"450px"},children:[a.jsx(U,{y:"md"}),e.chainSelection&&a.jsxs(b,{px:"lg",children:[a.jsx(A,{size:"sm",children:"Select Network"}),a.jsx(U,{y:"xxs"}),a.jsxs(_5,{fullWidth:!0,onClick:()=>{n("select-chain")},variant:"secondary",children:[a.jsx(w5,{chainIconUrl:c.url,client:e.client,size:D.lg}),o.name?a.jsx(A,{color:"primaryText",size:"sm",children:o.name}):a.jsx(me,{height:ie.md}),a.jsx(Lu,{height:D.sm,style:{marginLeft:"auto"},width:D.sm})]}),a.jsx(U,{y:"xl"}),a.jsx(A,{size:"sm",children:"Select Token"})]}),a.jsxs(b,{px:"lg",children:[a.jsx(U,{y:"xs"}),a.jsx(Jr,{onChange:y=>{r(y.target.value)},placeholder:u.searchToken,value:i,variant:"outline"})]}),a.jsx(U,{y:"md"}),(f.length>0||!i)&&a.jsxs(b,{flex:"column",gap:"xs",px:"lg",scrollY:!0,style:{paddingBottom:R.lg,paddingTop:0},children:[!i&&a.jsx(My,{chain:e.chain,client:e.client,onClick:()=>{e.onTokenSelect(Sl)},token:Sl}),f.map(y=>a.jsx(My,{chain:e.chain,client:e.client,onClick:()=>e.onTokenSelect(y),token:y},y.address))]}),f.length===0&&l.isLoading&&i&&a.jsx(b,{animate:"fadein",center:"both",color:"secondaryText",flex:"column",gap:"md",p:"lg",style:{minHeight:"200px",paddingTop:0},children:a.jsx(Qe,{color:"accentText",size:"lg"})}),f.length===0&&!l.isLoading&&i&&a.jsxs(b,{animate:"fadein",center:"both",color:"secondaryText",flex:"column",gap:"md",p:"lg",style:{minHeight:"200px",paddingTop:0},children:[a.jsx(is,{height:D.lg,width:D.lg}),u.noTokensFound]}),a.jsx(U,{y:"md"})]})]})}function My(e){var r;const t=ht(),n=p5({chain:e.chain,client:e.client,tokenAddress:Oi(e.token)?void 0:e.token.address}),i=Oi(e.token)?(r=n.data)==null?void 0:r.name:e.token.name;return a.jsxs(_5,{fullWidth:!0,onClick:e.onClick,variant:"secondary",children:[a.jsx(D1,{chain:e.chain,client:e.client,size:"lg",token:e.token}),a.jsxs(b,{flex:"column",gap:"4xs",children:[i?a.jsx(A,{color:"primaryText",size:"sm",children:i}):a.jsx(me,{height:ie.md,width:"150px"}),t&&a.jsx(nj,{account:t,chain:e.chain,client:e.client,tokenAddress:Oi(e.token)?void 0:e.token.address})]})]})}function nj(e){const t=pe({queryFn:async()=>zp({account:e.account,chain:e.chain,client:e.client,tokenAddress:e.tokenAddress}),queryKey:["tokenBalance",e]});return t.data?a.jsxs(A,{size:"xs",children:[" ",Co(t.data)]}):a.jsx(me,{height:ie.xs,width:"100px"})}const _5=nt(ue)(()=>{const e=ee();return{"&:hover":{background:e.colors.secondaryButtonBg,transform:"scale(1.01)"},background:e.colors.tertiaryBg,gap:R.sm,justifyContent:"flex-start",padding:R.sm,transition:"background 200ms ease, transform 150ms ease"}});
279function ij(e){const[t,n]=_.useState("base"),i=jt(),r=i==null?void 0:i.id,{connectLocale:s,client:o}=e;let c=Sl;const l=e.supportedTokens||Pa;if(r&&l[r]&&l[r]!==Pa[r]){const x=l[r],I=x==null?void 0:x[0];I&&(c=I)}const[u,d]=_.useState(c),[f,m]=_.useState(""),[y,g]=_.useState("0"),p=jt(),w=(p!=null&&p.id?l[p.id]:void 0)||[];return t==="tokenSelector"&&p?a.jsx(tj,{chain:p,client:o,connectLocale:s,onBack:()=>{n("base")},onTokenSelect:x=>{d(x),n("base")},tokenList:w}):a.jsx(rj,{amount:y,client:o,connectLocale:s,onBack:e.onBack,onTokenSelect:()=>{n("tokenSelector")},receiverAddress:f,setAmount:g,setReceiverAddress:m,token:u})}function rj(e){var I,E;const t=e.connectLocale.sendFundsScreen,n=e.token&&"address"in e.token?e.token.address:void 0,i=jt(),r=ht(),s=jt(),o=uu({address:r==null?void 0:r.address,chain:i,client:e.client,tokenAddress:n}),{receiverAddress:c,setReceiverAddress:l,amount:u,setAmount:d}=e,f=XL(e.client);function m(j){var T;const C=((T=j==null?void 0:j.data)==null?void 0:T.message)||(j==null?void 0:j.message);return C?C.includes("user rejected")||C.includes("user closed modal")||C.includes("user denied")?t.transactionRejected:C.includes("insufficient funds")?t.insufficientFunds:C:t.transactionFailed}const y=_.useId(),g=_.useId(),p=_.useId();if(!s)return null;if(f.isError)return a.jsxs(b,{animate:"fadein",p:"lg",className:"tw-send-funds-screen tw-send-funds-screen__error",children:[a.jsx(Me,{onBack:()=>{f.reset()},title:t.title}),a.jsx(U,{y:"xl"}),a.jsxs(b,{animate:"fadein",center:"both",color:"danger",flex:"column",gap:"lg",style:{minHeight:"200px"},children:[a.jsx(is,{height:D.xl,width:D.xl}),a.jsx(A,{center:!0,color:"danger",multiline:!0,children:m(f.error)})]})]});if(f.isSuccess)return a.jsxs(b,{animate:"fadein",p:"lg",className:"tw-send-funds-screen tw-send-funds-screen__success",children:[a.jsx(Me,{onBack:()=>{f.reset()},title:t.title}),a.jsxs(b,{animate:"fadein",center:"both",color:"success",flex:"column",gap:"lg",style:{minHeight:"250px"},children:[a.jsx(L7,{height:D.xl,width:D.xl}),a.jsxs(A,{color:"success",children:[" ",t.successMessage," "]})]})]});const w=(e.token&&"name"in e.token?e.token.name:void 0)||((I=o==null?void 0:o.data)==null?void 0:I.name),x=(e.token&&"symbol"in e.token?e.token.symbol:void 0)||((E=o==null?void 0:o.data)==null?void 0:E.symbol);return a.jsxs(b,{animate:"fadein",p:"lg",className:"tw-send-funds-screen tw-send-funds-screen__form",children:[a.jsx(Me,{onBack:e.onBack,title:t.title}),a.jsx(U,{y:"xl"}),a.jsxs("form",{onSubmit:j=>{j.preventDefault()},children:[a.jsx(Ld,{color:"secondaryText",htmlFor:y,children:t.token}),a.jsx(U,{y:"sm"}),a.jsxs(ue,{className:"tw-select-token-button",fullWidth:!0,id:y,onClick:e.onTokenSelect,style:{gap:R.sm,justifyContent:"flex-start",padding:R.sm},variant:"outline",children:[a.jsx(D1,{chain:s,client:e.client,size:"lg",token:e.token}),a.jsxs(b,{flex:"column",gap:"xs",children:[w?a.jsx(A,{color:"primaryText",size:"sm",children:w}):a.jsx(me,{height:ie.xs,width:"150px"}),o.data?a.jsx(A,{size:"xs",children:Co(o.data)}):a.jsx(me,{height:ie.xs,width:"100px"})]})]}),a.jsx(U,{y:"lg"}),a.jsx(Ld,{color:"secondaryText",htmlFor:g,children:t.sendTo}),a.jsx(U,{y:"sm"}),a.jsx(Jr,{className:"tw-address-input",id:g,onChange:j=>{l(j.target.value)},placeholder:"0x... or ENS name",required:!0,value:c,variant:"outline"}),a.jsx(U,{y:"lg"}),a.jsx(Ld,{color:"secondaryText",htmlFor:p,children:t.amount}),a.jsx(U,{y:"sm"}),a.jsxs(b,{relative:!0,children:[a.jsx(Jr,{className:"tw-amount-input",id:p,onChange:j=>{d(j.target.value)},required:!0,type:"number",value:u,variant:"outline"}),a.jsx(sj,{children:a.jsxs(A,{size:"xs",children:[" ",x," "]})})]}),a.jsx(U,{y:"xxl"}),a.jsxs(ue,{className:"tw-send-funds-button",fullWidth:!0,onClick:async()=>{!c||!u||await f.mutateAsync({amount:u,receiverAddress:c,tokenAddress:n})},style:{alignItems:"center",gap:R.sm,padding:R.md},type:"submit",variant:"accent",children:[f.isPending&&a.jsx(Qe,{color:"accentButtonText",size:"sm"}),f.isPending?t.sending:t.submitButton]})]})]})}const sj=Fe({position:"absolute",right:R.sm,top:"50%",transform:"translateY(-50%)"});function oj({selected:e,onSelect:t,options:n,children:i}){const r=ee();return a.jsxs("div",{children:[a.jsx(b,{bg:"secondaryButtonBg",center:"y",flex:"row",p:"xxs",style:{borderRadius:J.lg,width:"100%"},children:n.map(s=>a.jsx(ue,{onClick:()=>t(s.value),style:{alignItems:"center",backgroundColor:s.value===e?r.colors.modalBg:"transparent",borderRadius:J.md,display:"flex",flex:1,justifyContent:"center",paddingBlock:R.sm,position:"relative"},type:"button",variant:"accent",children:a.jsx(A,{color:s.value===e?"primaryText":"secondaryText",size:"sm",style:{textAlign:"center"},children:s.label})},s.value))}),a.jsx(U,{y:"sm"}),i]})}const aj=e=>a.jsxs("svg",{fill:"none",height:e.size,role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{height:"18",rx:"2",ry:"2",width:"18",x:"3",y:"3"}),a.jsx("circle",{cx:"9",cy:"9",r:"2"}),a.jsx("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]});async function cj(e){var g;const[{getV1Nfts:t},{getThirdwebDomains:n},{getClientFetch:i},{assertInsightEnabled:r},{stringify:s}]=await Promise.all([h(()=>import("./thirdweb-DZ2vK6IO.js"),[]),h(()=>import("./utils-BnNtzvC2.js").then(p=>p.s),__vite__mapDeps([5,6])),h(()=>import("./utils-BnNtzvC2.js").then(p=>p.t),__vite__mapDeps([5,6])),h(()=>import("./common-DZlWus51.js"),__vite__mapDeps([45,5,6])),h(()=>import("./index-B-YpBHM0.js"),__vite__mapDeps([46,23,2,3,4,5,6,7,8,9,1,24,25,26,47,10,11,12,13,14,15]))]),{client:o,chains:c,ownerAddress:l,contractAddresses:u,queryOptions:d}=e;await r(c);const f={chain:c.map(p=>p.id),limit:50,owner_address:[l],contract_address:u||void 0},m=await t({baseUrl:`https://${n().insight}`,fetch:i(o),query:{...f,...d}});if(m.error)throw new Error(`${m.response.status} ${m.response.statusText} - ${m.error?s(m.error):"Unknown error"}`);return(await b5(((g=m.data)==null?void 0:g.data)??[],o,l)).map(p=>({...p,quantityOwned:p.quantityOwned??1n}))}async function Hq(e){var p;const[{getV1NftsByContractAddressByTokenId:t},{getThirdwebDomains:n},{getClientFetch:i},{assertInsightEnabled:r},{stringify:s}]=await Promise.all([h(()=>import("./thirdweb-DZ2vK6IO.js"),[]),h(()=>import("./utils-BnNtzvC2.js").then(w=>
279w.s),__vite__mapDeps([5,6])),h(()=>import("./utils-BnNtzvC2.js").then(w=>w.t),__vite__mapDeps([5,6])),h(()=>import("./common-DZlWus51.js"),__vite__mapDeps([45,5,6])),h(()=>import("./type-guards-C6mkCq0U.js").then(w=>w.bP),__vite__mapDeps([2,3,4,5,6,7,8,9]))]),{client:o,chain:c,contractAddress:l,tokenId:u,includeOwners:d=!0,queryOptions:f}=e;await r([c]);const m={chain_id:[c.id],include_owners:d===!0?"true":"false"},y=await t({baseUrl:`https://${n().insight}`,fetch:i(o),path:{contract_address:l,token_id:u.toString()},query:{...m,...f}});if(y.error)throw new Error(`${y.response.status} ${y.response.statusText} - ${y.error?s(y.error):"Unknown error"}`);const g=await b5(((p=y.data)==null?void 0:p.data)??[],o);return g==null?void 0:g[0]}async function b5(e,t,n){const[{parseNFT:i},{totalSupply:r}]=await Promise.all([h(()=>Promise.resolve().then(()=>N9),void 0),h(()=>import("./totalSupply-CWh8C8rG.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,12]))]);return await Promise.all(e.map(async s=>{var j;let o;const{contract:c,extra_metadata:l,collection:u,metadata_url:d,chain_id:f,token_id:m,status:y,balance:g,token_type:p,...w}=s;let x=w,I=n?[_e(n)]:void 0;if("owner_addresses"in w){const{owner_addresses:C,...T}=w;x=T,I=I??(C==null?void 0:C.map(v=>_e(v)))}const E=x5({attributes:((j=s.extra_metadata)==null?void 0:j.attributes)??void 0,image:s.image_url,uri:s.metadata_url??"",...x});if((c==null?void 0:c.type)==="erc1155"){const C=await r({contract:zt({address:c.address,chain:Ge(c.chain_id),client:t}),id:BigInt(m)}).catch(()=>0n);o=i(E,{chainId:(c==null?void 0:c.chain_id)??0,owner:I==null?void 0:I[0],supply:C,tokenAddress:(c==null?void 0:c.address)??"",tokenId:BigInt(m),tokenUri:l0(d)??"",type:"ERC1155"})}else o=i(E,{chainId:(c==null?void 0:c.chain_id)??0,owner:I==null?void 0:I[0],tokenAddress:(c==null?void 0:c.address)??"",tokenId:BigInt(m),tokenUri:l0(d)??"",type:"ERC721"});return{...o,...(c==null?void 0:c.type)==="erc1155"?{quantityOwned:g?BigInt(g):void 0}:{}}}))}function x5(e){if(typeof e!="object"||e===null)return e;for(const t in e)typeof e[t]=="string"?e[t]=l0(e[t]):x5(e[t]);return e}function l0(e){if(!e||typeof e!="string")return e;try{const t=new URL(e);if(t.host.endsWith(".ipfscdn.io")){const n=t.pathname.split("/"),i=n.findIndex(s=>s==="ipfs");if(i===-1)return e;const r=n.slice(i+1).join("/");return r?`ipfs://${r}`:e}}catch{return e}return e}async function lj(e){var y;const[{getV1Tokens:t},{getThirdwebDomains:n},{getClientFetch:i},{assertInsightEnabled:r},{stringify:s}]=await Promise.all([h(()=>import("./thirdweb-DZ2vK6IO.js"),[]),h(()=>import("./utils-BnNtzvC2.js").then(g=>g.s),__vite__mapDeps([5,6])),h(()=>import("./utils-BnNtzvC2.js").then(g=>g.t),__vite__mapDeps([5,6])),h(()=>import("./common-DZlWus51.js"),__vite__mapDeps([45,5,6])),h(()=>import("./type-guards-C6mkCq0U.js").then(g=>g.bP),__vite__mapDeps([2,3,4,5,6,7,8,9]))]),{client:o,chains:c,ownerAddress:l,tokenAddresses:u,queryOptions:d}=e;await r(c);const f={chain_id:c.length>0?c.map(g=>g.id):[1],include_native:"true",include_spam:"false",limit:50,metadata:"true",owner_address:[l],token_address:u||void 0,sort_by:"balance",sort_order:"desc"},m=await t({baseUrl:`https://${n().insight}`,fetch:i(o),query:{...f,...d}});if(m.error)throw new Error(`${m.response.status} ${m.response.statusText} - ${m.error?s(m.error):"Unknown error"}`);return uj(((y=m.data)==null?void 0:y.data)??[])}async function uj(e){const{toTokens:t}=await h(async()=>{const{toTokens:n}=await import("./bundler-BZOUbTQa.js").then(i=>i.cO);return{toTokens:n}},__vite__mapDeps([1,2,3,4,5,6,7,8,9]));return e.map(n=>{const i=n.decimals??18,r=BigInt(n.balance);return{chainId:n.chain_id,decimals:i,displayValue:t(r,i),name:n.name??"",symbol
279:n.symbol??"",tokenAddress:n.token_address,value:r}})}const dj="data:application/json;base64";function hj(e){return!!e.toLowerCase().startsWith(dj)}function fj(e){const t=e.indexOf(","),n=e.slice(t+1);return c0(n)}const mj="data:application/json;utf-8";function yj(e){return!!e.toLowerCase().startsWith(mj)}function gj(e){const t=e.indexOf(","),n=e.slice(t+1);try{return decodeURIComponent(n)}catch{return n}}const pj=e=>a.jsxs("svg",{height:"16",role:"presentation",viewBox:"0 0 32 32",width:"16",...e,children:[a.jsx("circle",{cx:"9",cy:"28.5",fill:"currentColor",r:"1.5"}),a.jsx("path",{d:"M10 25H8v-4h2a2 2 0 0 0 0-4H8a2.002 2.002 0 0 0-2 2v.5H4V19a4.005 4.005 0 0 1 4-4h2a4 4 0 0 1 0 8Z",fill:"currentColor"}),a.jsx("path",{d:"m27.7 9.3l-7-7A.908.908 0 0 0 20 2H10a2.006 2.006 0 0 0-2 2v8h2V4h8v6a2.006 2.006 0 0 0 2 2h6v16H14v2h12a2.006 2.006 0 0 0 2-2V10a.91.91 0 0 0-.3-.7ZM20 10V4.4l5.6 5.6Z",fill:"currentColor"})]}),wj=e=>a.jsxs("svg",{height:"16",role:"presentation",viewBox:"0 0 32 32",width:"16",...e,children:[a.jsx("path",{d:"M29 31a.999.999 0 0 1-.625-.22L23.65 27H20a1 1 0 0 1-1-1v-5a1 1 0 0 1 1-1h3.65l4.726-3.78A1 1 0 0 1 30 17v13a1 1 0 0 1-1 1Zm-8-6h3a1 1 0 0 1 .625.22L28 27.92v-8.84l-3.376 2.7A1 1 0 0 1 24 22h-3Z",fill:"currentColor"}),a.jsx("path",{d:"M16 28H8V4h8v6a2.006 2.006 0 0 0 2 2h6v3h2v-5a.91.91 0 0 0-.3-.7l-7-7A.909.909 0 0 0 18 2H8a2.006 2.006 0 0 0-2 2v24a2.006 2.006 0 0 0 2 2h8Zm2-23.6l5.6 5.6H18Z",fill:"currentColor"})]}),_j=e=>a.jsx("svg",{height:"16",role:"presentation",viewBox:"0 0 32 32",width:"16",...e,children:a.jsx("path",{d:"M12 6h-2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm10 0h-2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2z",fill:"currentColor"})}),bj=e=>a.jsx("svg",{height:"16",role:"presentation",viewBox:"0 0 32 32",width:"16",...e,children:a.jsx("path",{d:"M7 28a1 1 0 0 1-1-1V5a1 1 0 0 1 1.482-.876l20 11a1 1 0 0 1 0 1.752l-20 11A1 1 0 0 1 7 28Z",fill:"currentColor"})}),qs="audio/mpeg",zc="audio/midi",Pc="audio/ogg",Ud="image/jpeg",xj={"*3gpp":"audio/3gpp","*jpm":"video/jpm","*mp3":"audio/mp3","*wav":"audio/wave","*x3db":"model/x3d+binary","*x3dv":"model/x3d+vrml","3g2":"video/3gpp2","3gp":"video/3gpp","3gpp":"video/3gpp","3mf":"model/3mf",adp:"audio/adpcm",amr:"audio/amr",apng:"image/apng",au:"audio/basic",avif:"image/avif",bmp:"image/bmp",cgm:"image/cgm",drle:"image/dicom-rle",emf:"image/emf",exr:"image/aces",fits:"image/fits",g3:"image/g3fax",gif:"image/gif",glb:"model/gltf-binary",gltf:"model/gltf+json",h261:"video/h261",h263:"video/h263",h264:"video/h264",heic:"image/heic",heics:"image/heic-sequence",heif:"image/heif",heifs:"image/heif-sequence",hej2:"image/hej2k",hsj2:"image/hsj2",htm:"text/html",html:"text/html",ief:"image/ief",iges:"model/iges",igs:"model/iges",jhc:"image/jphc",jls:"image/jls",jp2:"image/jp2",jpe:Ud,jpeg:Ud,jpf:"image/jpx",jpg:Ud,jpg2:"image/jp2",jpgm:"video/jpm",jpgv:"video/jpeg",jph:"image/jph",jpm:"image/jpm",jpx:"image/jpx",jxr:"image/jxr",jxra:"image/jxra",jxrs:"image/jxrs",jxs:"image/jxs",jxsc:"image/jxsc",jxsi:"image/jxsi",jxss:"image/jxss",kar:zc,ktx:"image/ktx",ktx2:"image/ktx2",m1v:"video/mpeg",m2a:qs,m2v:"video/mpeg",m3a:qs,m4a:"audio/mp4",m4s:"video/iso.segment",mesh:"model/mesh",mid:zc,midi:zc,mj2:"video/mj2",mjp2:"video/mj2",mkv:"video/x-matroska",mov:"video/quicktime",mp2:qs,mp2a:qs,mp3:qs,mp4:"video/mp4",mp4a:"audio/mp4",mp4v:"video/mp4",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"video/mpeg",mpg4:"video/mp4",mpga:qs,msh:"model/mesh",mtl:"model/mtl",mxmf:"audio/mobile-xmf",obj:"model/obj",oga:Pc,ogg:Pc,ogv:"video/ogg",opus:Pc,png:"image/png",qt:"video/quicktime",rmi:zc,s3m:"audio/s3m",sgi:"image/sgi",shtml:"text/html",sil:"audio/silk",silo:"model/mesh",snd:"audio/basic",spx:Pc,stl:"model/stl",svg:"image/svg+xml",svgz:"image/svg+xml",t38:"image/t38",tfx:"image/tiff-fx",tif:"image/tiff",tiff:"image/tiff",ts:"video/mp2t",vrml:"model/vrml",wav:"audio/wav",weba:"audio/webm",webm:"video/webm",webp:"image/webp",wmf:"image/wmf",wrl:"model/vrml",x3d:"model/x3d+xml",x3db:"model/x3d+fastinfoset",x3dbz:"model/x3d+binary",x3dv:"model/x3d-vrml",x3dvz:"model/x3d+vrml",x3dz:"model/x3d+xml",xm:"audio/xm"};function Ij(e){const t=e.replace(/^.*[/\\]/,"").toLowerCase(),n=t.replace(/^.*\./,"").toLowerCase(),i=t.length<e.length;return(n.length<t.length-1||!i)&&xj[n]||null}async function Mj(e){if(!e)return;const t=Ij(e);if(t)return t;const n=e.startsWith("blob:")?await fetch(e):await fetch(e,{method:"HEAD"});if(n.ok&&n.headers.has("content-type"))return n.headers.get("content-type")||void 0}function Cy(e,t,n,i){const r=_.useMemo(()=>
279{if(!t)return"";if(t.startsWith("ar://"))return G6({gatewayUrl:i,uri:t});if(i)return t.replace("ipfs://",i);try{return qr({client:e,uri:t})}catch{return t.replace("ipfs://","https://ipfs.io/ipfs/")}},[t,i,e]),s=pe({enabled:!!r&&!n,initialData:n,queryFn:()=>Mj(r),queryKey:["mime-type",r]});return{isFetched:s.isFetched||!!n,mediaInfo:{mimeType:s.data||"image/",url:r}}}const Cj=_.forwardRef(function({src:t,poster:n,alt:i,gatewayUrl:r,requireInteraction:s=!1,width:o="300px",height:c="300px",style:l,mimeType:u,client:d,controls:f,className:m},y){var I,E;const g={objectFit:"contain",...l},{mediaInfo:p,isFetched:w}=Cy(d,t??void 0,u,r),{mediaInfo:x}=Cy(d,n??void 0,void 0,r);if(!w||!t)return a.jsx("div",{className:m,style:l});if(p.mimeType){if(p.mimeType.startsWith("text/html"))return a.jsx(vj,{alt:i,className:m,poster:x.url,ref:y,requireInteraction:s,src:p.url,style:g});if(p.mimeType.startsWith("model")&&(console.error("Encountered an unsupported media type. 3D model support was removed in v5.92.0. To add a 3D model to your app, use @google/model-viewer and use the ModelViewer component."),(I=x.mimeType)!=null&&I.startsWith("image/")))return a.jsx(Ey,{alt:i,className:m,height:c,ref:y,src:x.url,style:g,width:o});if(p.mimeType.startsWith("video"))return a.jsx(Ej,{className:m,controls:f,poster:(E=x.mimeType)!=null&&E.startsWith("image/")?x.url:void 0,ref:y,requireInteraction:s,src:p.url,style:g});if(p.mimeType.startsWith("audio"))return a.jsx(Tj,{alt:i,className:m,controls:f,height:c,poster:x.url,ref:y,src:p.url,style:g,width:o});if(p.mimeType.startsWith("image/"))return a.jsx(Ey,{alt:i,className:m,height:c,ref:y,src:p.url,style:g,width:o})}return a.jsx(Wu,{alt:i,className:m,ref:y,src:p.url,style:g})}),N1=({onClick:e,isPlaying:t})=>{const[n,i]=_.useState(!1),r=()=>i(!0),s=()=>i(!1),o=()=>i(!1),c=()=>i(!0);return a.jsx("button",{onClick:e,onMouseDown:o,onMouseEnter:r,onMouseLeave:s,onMouseUp:c,style:{backgroundColor:"#fff",border:"1px solid rgb(229, 232, 235)",borderRadius:"50%",bottom:0,color:"rgb(138, 147, 155)",cursor:"pointer",display:"grid",height:"32px",padding:0,placeItems:"center",position:"absolute",right:0,transform:"translate(-25%, -25%)",width:"32px",zIndex:3,...n?{boxShadow:"rgb(4 17 29 / 25%) 0px 0px 8px 0px",color:"rgb(53, 56, 64)"}:{}},type:"button",children:t?a.jsx(_j,{}):a.jsx(bj,{})})},Ey=_.forwardRef(function(t,n){const{style:i,src:r,alt:s,className:o,height:c,width:l}=t,[u,d]=_.useState(!1);return u?a.jsx(Wu,{alt:s,className:o,ref:n,src:r,style:i}):a.jsx("img",{alt:s,className:o,height:c,onError:()=>{d(!0)},ref:n,src:r??void 0,style:i,width:l})}),Ej=_.forwardRef(function({src:t,alt:n,poster:i,requireInteraction:r,style:s,width:o,height:c,controls:l,className:u},d){const f=_.useRef(null),[m,y]=_.useState(!r),[g,p]=_.useState(!0),[w,x]=_.useState(!1);return _.useEffect(()=>{if(f.current)if(m)try{f.current.play()}catch(I){console.error("Error playing video",I)}else try{f.current.pause(),f.current.currentTime=0}catch(I){console.error("Error pausing video",I)}},[m]),w?a.jsx(Wu,{alt:n,className:u,ref:d,src:t,style:s}):a.jsxs("div",{className:u,style:{position:"relative",...s},children:[a.jsx("video",{controls:l,controlsList:"nodownload",height:c,loop:!0,muted:g,onCanPlay:()=>{var I;m&&((I=f.current)==null||I.play())},onError:()=>{x(!0)},playsInline:!0,poster:i??void 0,preload:i?"metadata":"auto",ref:I5([f,d]),src:t??void 0,style:{height:"100%",objectFit:"contain",opacity:i?m?1:0:1,transition:"opacity .5s",width:"100%",zIndex:1},width:o}),i&&a.jsx("img",{alt:n,src:i,style:{bottom:0,height:"100%",left:0,objectFit:"contain",opacity:m?0:1,pointerEvents:"none",position:"absolute",right:0,top:0,transition:"opacity .5s",width:"100%",zIndex:2}}),a.jsx(N1,{isPlaying:m,onClick:()=>{y(I=>!I),p(!1)}})]})}),Tj=_.forwardRef(function({src:t,alt:n,poster:i,style:r,height:s,width:o,className:c,controls:l},u){const d=_.useRef(null),[f,m]=_.useState(!1),[y,g]=_.useState(!0),[p,w]=_.useState(!1);return _.useEffect(()=>{d.current&&(f?d.current.play():(d.current.pause(),d.current.currentTime=0))},[f]),p?a.jsx(Wu,{alt:n,className:c,ref:u,src:t,style:r}):a.jsxs("div",{className:c,style:{position:"relative",...r},children:[i?a.jsx("img",{alt:n,height:s,src:i,style:{height:"100%",objectFit:"contain",pointerEvents:"none",width:"100%"},width:o}):a.jsx("div",{style:{backgroundColor:"#fff",color:"rgb(138, 147, 155)",display:"grid",height:"100%",placeItems:"center",pointerEvents:"none",width:"100%"},children:a.jsx(wj,{style:{height:"64px",width:"64px"}})}),a.jsx(N1,{isPlaying:f,onClick:()=>{m(x=>!x),g(!1)}}),a.jsx("audio",{controls:l,controlsList:"nodownload",loop:!0,muted:y,onError:()=>{w(!0)}
279,playsInline:!0,preload:"none",ref:I5([d,u]),src:t??void 0,style:{opacity:0,pointerEvents:"none",position:"absolute",visibility:"hidden",zIndex:-1}})]})}),vj=_.forwardRef(function({src:t,alt:n,poster:i,requireInteraction:r,style:s,...o},c){const[l,u]=_.useState(!r);return a.jsxs("div",{style:{position:"relative",...s},...o,children:[a.jsx("iframe",{allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",ref:c,sandbox:"allow-scripts",src:l?t??void 0:void 0,style:{border:"none",height:"100%",objectFit:"contain",opacity:i?l?1:0:1,transition:"opacity .5s",width:"100%",zIndex:1},title:n||"thirdweb iframe player"}),i&&a.jsx("img",{alt:n,src:i,style:{bottom:0,height:"100%",left:0,objectFit:"contain",opacity:l?0:1,pointerEvents:"none",position:"absolute",right:0,top:0,transition:"opacity .5s",width:"100%",zIndex:2}}),a.jsx(N1,{isPlaying:l,onClick:()=>{u(d=>!d)}})]})}),Wu=_.forwardRef(function({src:t,alt:n,style:i,className:r},s){return a.jsx("div",{className:r,style:{position:"relative",...i},children:a.jsx("div",{style:{backgroundColor:"#fff",color:"rgb(138, 147, 155)",display:"grid",height:"100%",placeItems:"center",width:"100%"},children:a.jsxs("div",{style:{alignItems:"center",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:"8px"},children:[a.jsx(pj,{style:{aspectRatio:"1",maxWidth:"128px",minWidth:"48px",width:"50%"}}),a.jsx("a",{href:t??void 0,ref:s,rel:"noopener noreferrer",style:{color:"rgb(138, 147, 155)",textDecoration:"underline"},target:"_blank",children:n||"File"})]})})})});function I5(e){return t=>{for(const n of e)typeof n=="function"?n(t):n!=null&&(n.current=t)}}function Lj(e){return a.jsxs(b,{style:{minHeight:"300px"},children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:e.connectLocale.viewFunds.viewNFTs})}),a.jsx(He,{}),a.jsxs(b,{px:"sm",scrollY:!0,style:{maxHeight:"500px"},children:[a.jsx(U,{y:"md"}),a.jsx(M5,{...e})]})]})}function M5(e){var s;const t=ht(),n=jt(),i=pe({enabled:!!n&&!!t,queryFn:async()=>{var c,l;if(!t)throw new Error("No active account");if(!n)throw new Error("No active chain");return(await cj({chains:[n],client:e.client,ownerAddress:t.address,contractAddresses:(l=(c=e.supportedNFTs)==null?void 0:c[n.id])==null?void 0:l.map(u=>u.toLowerCase())})).filter(u=>!!u.metadata.name&&!!u.metadata.image).map(u=>({address:u.tokenAddress,chain:Ge(u.chainId),...u}))},queryKey:["nfts",n==null?void 0:n.id,t==null?void 0:t.address,e.supportedNFTs]});if(!(n!=null&&n.id)||!(t!=null&&t.address))return null;const r=i.data;return a.jsxs(a.Fragment,{children:[i.error?a.jsx(b,{center:"both",py:"lg",children:a.jsx(A,{center:!0,color:"secondaryText",size:"sm",children:"Error loading NFTs"})}):((s=i.data)==null?void 0:s.length)===0&&!i.isLoading?a.jsx(b,{center:"both",py:"lg",children:a.jsx(A,{center:!0,color:"secondaryText",size:"sm",children:"No NFTs found on this chain"})}):a.jsx(b,{style:{display:"grid",gap:"12px",gridTemplateColumns:"1fr 1fr"},children:i.isLoading||!r?a.jsxs(a.Fragment,{children:[a.jsx(me,{height:"150px",width:"150px"}),a.jsx(me,{height:"150px",width:"150px"}),a.jsx(me,{height:"150px",width:"150px"})]}):r.map(o=>a.jsx(jj,{...o,chain:o.chain,client:e.client,theme:e.theme},`${o.chain.id}:${o.address}:${o.id}`))}),a.jsx(U,{y:"lg"})]})}function jj(e){var r;const t=typeof e.theme=="string"?e.theme:e.theme.type,n=typeof e.theme=="string"?void 0:e.theme,i=a.jsxs("div",{style:{alignItems:"center",display:"flex",flexDirection:"column",gap:"4px",width:"150px"},children:[a.jsxs("div",{style:{alignItems:"center",background:t==="light"?"rgba(0, 0, 0, 0.10)":"rgba(0, 0, 0, 0.20)",borderRadius:"8px",display:"flex",flexShrink:0,height:"150px",overflow:"hidden",position:"relative",width:"150px"},children:[e.metadata.image&&a.jsx(Cj,{client:e.client,src:e.metadata.image,style:{height:"100%",width:"100%"}}),e.quantityOwned>1&&a.jsx("div",{style:{alignItems:"center",background:((r=n==null?void 0:n.colors)==null?void 0:r.modalBg)??(t==="light"?"white":"black"),borderRadius:"100%",bottom:"4px",display:"flex",fontSize:"10px",height:"20px",justifyContent:"center",padding:"4px 4px",position:"absolute",right:"4px",width:"20px"},children:e.quantityOwned.toString()}),e.chain.icon&&a.jsx("img",{alt:e.chain.name,src:e.chain.icon.url,style:{bottom:"4px",height:"20px",left:"4px",position:"absolute",width:"20px"}})]}),a.jsx(A,{color:"primaryText",size:"xs",style:{fontWeight:600,maxLines:2,textAlign:"center"},children:e.metadata.name})]});return e.chain.name?a.jsx("a",{href:`https://thirdweb.com/${e.chain.id}/${e.address}/nfts/${e.id}`,rel:"noreferrer",target:"_blank",children:i}):i}function Sj(e){return a.jsxs(b,{style:{minHeight:"300px"},children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:e.connectLocale.viewFunds.viewTokens})}),a.jsx(He,{}),a.jsxs(b,{px:"sm",scrollY:!0,style:{maxHeight:"500px"},children:[a.jsx(U,{y:"md"}),a.jsx(C5,{...e}),a.jsx(U,{y:"lg"})]})]})}function C5(e){var o;const t=ht(),n=jt(),i=e.supportedTokens||Pa,r=(n!=null&&n.id?i[n.id]:void 0)||[],s=pe({enabled:!!n&&!!t&&(!e.supportedTokens||!e.supportedTokens[n.id]),queryFn:async()=>
279{if(!n)throw new Error("No active chain");if(!t)throw new Error("No account");return(await lj({chains:[n],client:e.client,ownerAddress:t.address})).filter(l=>{var u;return!((u=Pa[n.id])!=null&&u.some(d=>d.address.toLowerCase()===l.tokenAddress.toLowerCase()))})},queryKey:["tokens",n==null?void 0:n.id,t==null?void 0:t.address]});return!n||!t?null:a.jsxs(a.Fragment,{children:[a.jsx(Bd,{chain:n,client:e.client,token:Sl}),r.map(c=>a.jsx(Bd,{chain:n,client:e.client,token:c},c.address)),s.isLoading&&a.jsxs(b,{flex:"column",gap:"sm",p:"sm",children:[a.jsx(me,{height:ie.md,width:"100%"}),a.jsx(me,{height:ie.md,width:"100%"})]}),(o=s.data)==null?void 0:o.map(c=>a.jsx(Bd,{balanceData:c,chain:n,client:e.client,token:{address:c.tokenAddress,name:c.name??"",symbol:c.symbol??""}},c.tokenAddress))]})}function Bd(e){var r;const t=ht(),n=uu({address:t==null?void 0:t.address,chain:e.chain,client:e.client,tokenAddress:Oi(e.token)?void 0:e.token.address},{enabled:e.balanceData===void 0}),i=Oi(e.token)?(r=n.data)==null?void 0:r.name:e.token.name;return a.jsxs(b,{flex:"row",gap:"sm",p:"sm",children:[a.jsx(D1,{chain:e.chain,client:e.client,size:"lg",token:e.token}),a.jsxs(b,{flex:"column",gap:"xxs",children:[i?a.jsx(A,{color:"primaryText",size:"sm",children:i}):a.jsx(me,{height:ie.md,width:"150px"}),e.balanceData?a.jsxs(A,{size:"xs",children:[" ",Co(e.balanceData)]}):n.data?a.jsxs(A,{size:"xs",children:[" ",Co(n.data)]}):a.jsx(me,{height:ie.xs,width:"100px"})]})]})}const Ty={label:a.jsxs("span",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[a.jsx(gc,{size:D.sm})," Tokens"]}),value:"Tokens"},vy={label:a.jsxs("span",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[a.jsx(aj,{size:D.sm})," NFTs"]}),value:"NFTs"};function Dj(e){var s;const{connectLocale:t}=e,n=_.useMemo(()=>{if(!e.assetTabs)return[Ty,vy];if(!e.assetTabs.length)return[];const o=[];for(const c of e.assetTabs)c==="token"?o.push(Ty):c==="nft"&&o.push(vy);return o},[e.assetTabs]),[i,r]=_.useState(((s=n[0])==null?void 0:s.value)||"Tokens");return a.jsxs(b,{animate:"fadein",style:{minHeight:"300px"},children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:t.viewFunds.viewAssets})}),a.jsx(He,{}),a.jsxs(b,{px:"lg",scrollY:!0,style:{minHeight:"330px"},children:[a.jsx(U,{y:"md"}),a.jsx(oj,{onSelect:r,options:n,selected:i,children:a.jsxs(b,{scrollY:!0,style:{maxHeight:"300px"},children:[i==="Tokens"&&a.jsx(C5,{client:e.client,connectLocale:t,supportedTokens:e.supportedTokens}
vendor: 4,801 bytes, line 279
279),i==="NFTs"&&a.jsx(M5,{client:e.client,connectLocale:t,supportedNFTs:e.supportedNFTs,theme:e.theme})]})}),a.jsx(U,{y:"lg"})]})]})}var A1={exports:{}},fo=typeof Reflect=="object"?Reflect:null,Ly=fo&&typeof fo.apply=="function"?fo.apply:function(t,n,i){return Function.prototype.apply.call(t,n,i)},al;fo&&typeof fo.ownKeys=="function"?al=fo.ownKeys:Object.getOwnPropertySymbols?al=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:al=function(t){return Object.getOwnPropertyNames(t)};function Nj(e){console&&console.warn&&console.warn(e)}var E5=Number.isNaN||function(t){return t!==t};function Ke(){Ke.init.call(this)}A1.exports=Ke;A1.exports.once=zj;Ke.EventEmitter=Ke;Ke.prototype._events=void 0;Ke.prototype._eventsCount=0;Ke.prototype._maxListeners=void 0;var jy=10;function Fu(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Ke,"defaultMaxListeners",{enumerable:!0,get:function(){return jy},set:function(e){if(typeof e!="number"||e<0||E5(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");jy=e}});Ke.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};Ke.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||E5(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function T5(e){return e._maxListeners===void 0?Ke.defaultMaxListeners:e._maxListeners}Ke.prototype.getMaxListeners=function(){return T5(this)};Ke.prototype.emit=function(t){for(var n=[],i=1;i<arguments.length;i++)n.push(arguments[i]);var r=t==="error",s=this._events;if(s!==void 0)r=r&&s.error===void 0;else if(!r)return!1;if(r){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var c=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw c.context=o,c}var l=s[t];if(l===void 0)return!1;if(typeof l=="function")Ly(l,this,n);else for(var u=l.length,d=D5(l,u),i=0;i<u;++i)Ly(d[i],this,n);return!0};function v5(e,t,n,i){var r,s,o;if(Fu(n),s=e._events,s===void 0?(s=e._events=Object.create(null),e._eventsCount=0):(s.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),o===void 0)o=s[t]=n,++e._eventsCount;else if(typeof o=="function"?o=s[t]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),r=T5(e),r>0&&o.length>r&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,Nj(c)}return e}Ke.prototype.addListener=function(t,n){return v5(this,t,n,!1)};Ke.prototype.on=Ke.prototype.addListener;Ke.prototype.prependListener=function(t,n){return v5(this,t,n,!0)};function Aj(){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 L5(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=Aj.bind(i);return r.listener=n,i.wrapFn=r,r}Ke.prototype.once=function(t,n){return Fu(n),this.on(t,L5(this,t,n)),this};Ke.prototype.prependOnceListener=function(t,n){return Fu(n),this.prependListener(t,L5(this,t,n)),this};Ke.prototype.removeListener=function(t,n){var i,r,s,o,c;if(Fu(n),r=this._events,r===void 0)return this;if(i=r[t],i===void 0)return this;if(i===n||i.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,i.listener||n));else if(typeof i!="function"){for(s=-1,o=i.length-1;o>=0;o--)if(i[o]===n||i[o].listener===n){c=i[o].listener,s=o;break}if(s<0)return this;s===0?i.shift():Oj(i,s),i.length===1&&(r[t]=i[0]),r.removeListener!==void 0&&this.emit("removeListener",t,c||n)}return this};Ke.prototype.off=Ke.prototype.removeListener;Ke.prototype.removeAllListeners=function(t){var n,i,r;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[t]),this;if(arguments.length===0){var s=Object.keys(i),o;for(r=0;r<s.length;++r)o=s[r],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=i[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(r=n.length-1;r>=0;r--)this.removeListener(t,n[r]);return this};
279function j5(e,t,n){var i=e._events;if(i===void 0)return[];var r=i[t];return r===void 0?[]:typeof r=="function"?n?[r.listener||r]:[r]:n?kj(r):D5(r,r.length)}Ke.prototype.listeners=function(t){return j5(this,t,!0)};Ke.prototype.rawListeners=function(t){return j5(this,t,!1)};Ke.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):S5.call(e,t)};Ke.prototype.listenerCount=S5;function S5(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Ke.prototype.eventNames=function(){return this._eventsCount>0?al(this._events):[]};function D5(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}function Oj(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function kj(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function zj(e,t){return new Promise(function(n,i){function r(o){e.removeListener(t,s),i(o)}function s(){typeof e.removeListener=="function"&&e.removeListener("error",r),n([].slice.call(arguments))}N5(e,t,s,{once:!0}),t!=="error"&&Pj(e,r,{once:!0})})}function Pj(e,t,n){typeof e.on=="function"&&N5(e,"error",t,n)}function N5(e,t,n,i){if(typeof e.on=="function")i.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function r(s){i.once&&e.removeEventListener(t,r),n(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var wi=A1.exports;const A5=T4(wi);var te={};/*! *****************************************************************************
280Copyright (c) Microsoft Corporation.
281
282Permission to use, copy, modify, and/or distribute this software for any
283purpose with or without fee is hereby granted.
284
285THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
286REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
287AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
288INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
289LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
290OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
291PERFORMANCE OF THIS SOFTWARE.
292***************************************************************************** */var u0=function(e,t){return u0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])},u0(e,t)};function Rj(e,t){u0(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var d0=function(){return d0=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},d0.apply(this,arguments)};function Uj(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}function Bj(e,t,n,i){var r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,i);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}function Vj(e,t){return function(n,i){t(n,i,e)}}function $j(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Wj(e,t,n,i){function r(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function c(d){try{u(i.next(d))}catch(f){o(f)}}function l(d){try{u(i.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):r(d.value).then(c,l)}u((i=i.apply(e,t||[])).next())})}function Fj(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(u){return function(d){return l([u,d])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(s=u[0]&2?r.return:u[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,u[1])).done)return s;switch(r=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],r=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Yj(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}function Hj(e,t){for(var n in e)n!=="default"&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function h0(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);
292if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function O5(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,s=[],o;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(c){o={error:c}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function Qj(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(O5(arguments[t]));return e}function Zj(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var s=arguments[t],o=0,c=s.length;o<c;o++,r++)i[r]=s[o];return i}function $a(e){return this instanceof $a?(this.v=e,this):new $a(e)}function qj(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),r,s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(m){i[m]&&(r[m]=function(y){return new Promise(function(g,p){s.push([m,y,g,p])>1||c(m,y)})})}function c(m,y){try{l(i[m](y))}catch(g){f(s[0][3],g)}}function l(m){m.value instanceof $a?Promise.resolve(m.value.v).then(u,d):f(s[0][2],m)}function u(m){c("next",m)}function d(m){c("throw",m)}function f(m,y){m(y),s.shift(),s.length&&c(s[0][0],s[0][1])}}function Gj(e){var t,n;return t={},i("next"),i("throw",function(r){throw r}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(r,s){t[r]=e[r]?function(o){return(n=!n)?{value:$a(e[r](o)),done:r==="return"}:s?s(o):o}:s}}function Kj(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof h0=="function"?h0(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(s){n[s]=e[s]&&function(o){return new Promise(function(c,l){o=e[s](o),r(c,l,o.done,o.value)})}}function r(s,o,c,l){Promise.resolve(l).then(function(u){s({value:u,done:c})},o)}}function Jj(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Xj(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function eS(e){return e&&e.__esModule?e:{default:e}}function tS(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function nS(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}const iS=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return d0},__asyncDelegator:Gj,__asyncGenerator:qj,__asyncValues:Kj,__await:$a,__awaiter:Wj,__classPrivateFieldGet:tS,__classPrivateFieldSet:nS,__createBinding:Yj,__decorate:Bj,__exportStar:Hj,__extends:Rj,__generator:Fj,__importDefault:eS,__importStar:Xj,__makeTemplateOb
292ject:Jj,__metadata:$j,__param:Vj,__read:O5,__rest:Uj,__spread:Qj,__spreadArrays:Zj,__values:h0},Symbol.toStringTag,{value:"Module"})),Yu=v4(iS);var Vd={},Xo={},Sy;function rS(){if(Sy)return Xo;Sy=1,Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.delay=void 0;function e(t){return new Promise(n=>{setTimeout(()=>{n(!0)},t)})}return Xo.delay=e,Xo}var os={},$d={},as={},Dy;function sS(){return Dy||(Dy=1,Object.defineProperty(as,"__esModule",{value:!0}),as.ONE_THOUSAND=as.ONE_HUNDRED=void 0,as.ONE_HUNDRED=100,as.ONE_THOUSAND=1e3),as}var Wd={},Ny;function oS(){return Ny||(Ny=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=e.ONE_MINUTE*5,e.TEN_MINUTES=e.ONE_MINUTE*10,e.THIRTY_MINUTES=e.ONE_MINUTE*30,e.SIXTY_MINUTES=e.ONE_MINUTE*60,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=e.ONE_HOUR*3,e.SIX_HOURS=e.ONE_HOUR*6,e.TWELVE_HOURS=e.ONE_HOUR*12,e.TWENTY_FOUR_HOURS=e.ONE_HOUR*24,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=e.ONE_DAY*3,e.FIVE_DAYS=e.ONE_DAY*5,e.SEVEN_DAYS=e.ONE_DAY*7,e.THIRTY_DAYS=e.ONE_DAY*30,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=e.ONE_WEEK*2,e.THREE_WEEKS=e.ONE_WEEK*3,e.FOUR_WEEKS=e.ONE_WEEK*4,e.ONE_YEAR=e.ONE_DAY*365}(Wd)),Wd}var Ay;function k5(){return Ay||(Ay=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Yu;t.__exportStar(sS(),e),t.__exportStar(oS(),e)}($d)),$d}var Oy;function aS(){if(Oy)return os;Oy=1,Object.defineProperty(os,"__esModule",{value:!0}),os.fromMiliseconds=os.toMiliseconds=void 0;const e=k5();function t(i){return i*e.ONE_THOUSAND}os.toMiliseconds=t;function n(i){return Math.floor(i/e.ONE_THOUSAND)}return os.fromMiliseconds=n,os}var ky;function cS(){return ky||(ky=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Yu;t.__exportStar(rS(),e),t.__exportStar(aS(),e)}(Vd)),Vd}var Gs={},zy;function lS(){if(zy)return Gs;zy=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.Watch=void 0;class e{constructor(){this.timestamps=new Map}start(n){if(this.timestamps.has(n))throw new Error(`Watch already started for label: ${n}`);this.timestamps.set(n,{started:Date.now()})}stop(n){const i=this.get(n);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${n}`);const r=Date.now()-i.started;this.timestamps.set(n,{started:i.started,elapsed:r})}get(n){const i=this.timestamps.get(n);if(typeof i>"u")throw new Error(`No timestamp found for label: ${n}`);return i}elapsed(n){const i=this.get(n);return i.elapsed||Date.now()-i.started}}return Gs.Watch=e,Gs.default=e,Gs}var Fd={},ea={},Py;function uS(){if(Py)return ea;Py=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.IWatch=void 0;class e{}return ea.IWatch=e,ea}var Ry;function dS(){return Ry||(Ry=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Yu.__exportStar(uS(),e)}(Fd)),Fd}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Yu;t.__exportStar(cS(),e),t.__exportStar(lS(),e),t.__exportStar(dS(),e),t.__exportStar(k5(),e)})(te);class $s{}let hS=class extends $s{constructor(t){super()}};const Uy=te.FIVE_SECONDS,Ws={pulse:"heartbeat_pulse"};let fS=class z5 extends hS{constructor(t){super(t),this.events=new wi.EventEmitter,this.interval=Uy,this.interval=(t==null?void 0:t.interval)||Uy}static async init(t){const n=new z5(t);return await n.init(),n}
292async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}off(t,n){this.events.off(t,n)}removeListener(t,n){this.events.removeListener(t,n)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),te.toMiliseconds(this.interval))}pulse(){this.events.emit(Ws.pulse)}};const mS=/"(?:_|\\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*:/,yS=/"(?: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*:/,gS=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function pS(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){wS(e);return}return t}function wS(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function Rc(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);const n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!gS.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(mS.test(e)||yS.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,pS)}return JSON.parse(e)}catch(i){if(t.strict)throw i;return e}}function _S(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function Nt(e,...t){try{return _S(e(...t))}catch(n){return Promise.reject(n)}}function bS(e){const t=typeof e;return e===null||t!=="object"&&t!=="function"}function xS(e){const t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function cl(e){if(bS(e))return String(e);if(xS(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return cl(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const f0="base64:";function IS(e){return typeof e=="string"?e:f0+ES(e)}function MS(e){return typeof e!="string"||!e.startsWith(f0)?e:CS(e.slice(f0.length))}function CS(e){return globalThis.Buffer?Ve.from(e,"base64"):Uint8Array.from(globalThis.atob(e),t=>t.codePointAt(0))}function ES(e){return globalThis.Buffer?Ve.from(e).toString("base64"):globalThis.btoa(String.fromCodePoint(...e))}function jn(e){var t;return e&&((t=e.split("?")[0])==null?void 0:t.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function TS(...e){return jn(e.join(":"))}function Uc(e){return e=jn(e),e?e+":":""}function vS(e,t){if(t===void 0)return!0;let n=0,i=e.indexOf(":");for(;i>-1;)n++,i=e.indexOf(":",i+1);return n<=t}function LS(e,t){return t?e.startsWith(t)&&e[e.length-1]!=="$":e[e.length-1]!=="$"}const jS="memory",SS=()=>{const e=new Map;return{name:jS,getInstance:()=>e,hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,n){e.set(t,n)},setItemRaw(t,n){e.set(t,n)},removeItem(t){e.delete(t)},getKeys(){return[...e.keys()]},clear(){e.clear()},dispose(){e.clear()}}};function DS(e={}){const t={mounts:{"":e.driver||SS()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=u=>{for(const d of t.mountpoints)if(u.startsWith(d))return{base:d,relativeKey:u.slice(d.length),driver:t.mounts[d]};return{base:"",relativeKey:u,driver:t.mounts[""]}},i=(u,d)=>t.mountpoints.filter(f=>f.startsWith(u)||d&&u.startsWith(f)).map(f=>({relativeBase:u.length>f.length?u.slice(f.length):void 0,mountpoint:f,driver:t.mounts[f]})),r=(u,d)=>{if(t.watching){d=jn(d);for(const f of t.watchListeners)f(u,d)}},s=async()=>{if(!t.watching){t.watching=!0;for(const u in t.mounts)t.unwatch[u]=await By(t.mounts[u],r,u)}},o=async()=>{if(t.watching){for(const u in t.unwatch)await t.unwatch[u]();t.unwatch={},t.watching=!1}},c=(u,d,f)=>{const m=new Map,y=g=>{let p=m.get(g.base);return p||(p={driver:g.driver,base:g.base,items:[]},m.set(g.base,p)),p};for(const g of u){const p=typeof g=="string",w=jn(p?g:g.key),x=p?void 0:g.value,I=p||!g.options?d:{...d,...g.options},E=n(w);y(E).items.push({key:w,value:x,relativeKey:E.relativeKey,options:I})}return Promise.all([...m.values()].map(g=>f(g))).then(g=>g.flat())},l={hasItem(u,d={}){u=jn(u);const{relativeKey:f,driver:m}=n(u);return Nt(m.hasItem,f,d)},getItem(u,d={}){u=jn(u);const{relativeKey:f,driver:m}=n(u);return Nt(m.getItem,f,d).then(y=>Rc(y))},getItems(u,d={}){return c(u,d,f=>f.driver.getItems?Nt(f.driver.getItems,f.items.map(m=>({key:m.relativeKey,options:m.options})),d).then(m=>m.map(y=>({key:TS(f.base,y.key),value:Rc(y.value)}))):Promise.all(f.items.map(m=>Nt(f.driver.getItem,m.relativeKey,m.options).then(y=>({key:m.key,value:Rc(y)})))))},getItemRaw(u,d={}){u=jn(u);const{relativeKey:f,driver:m}=n(u);return m.getItemRaw?Nt(m.getItemRaw,f,d):Nt(m.getItem,f,d).then(y=>MS(y))},async setItem(u,d,f={}){if(d===void 0)return l.removeItem(u);u=jn(u);const{relativeKey:m,driver:y}=n(u);
292y.setItem&&(await Nt(y.setItem,m,cl(d),f),y.watch||r("update",u))},async setItems(u,d){await c(u,d,async f=>{if(f.driver.setItems)return Nt(f.driver.setItems,f.items.map(m=>({key:m.relativeKey,value:cl(m.value),options:m.options})),d);f.driver.setItem&&await Promise.all(f.items.map(m=>Nt(f.driver.setItem,m.relativeKey,cl(m.value),m.options)))})},async setItemRaw(u,d,f={}){if(d===void 0)return l.removeItem(u,f);u=jn(u);const{relativeKey:m,driver:y}=n(u);if(y.setItemRaw)await Nt(y.setItemRaw,m,d,f);else if(y.setItem)await Nt(y.setItem,m,IS(d),f);else return;y.watch||r("update",u)},async removeItem(u,d={}){typeof d=="boolean"&&(d={removeMeta:d}),u=jn(u);const{relativeKey:f,driver:m}=n(u);m.removeItem&&(await Nt(m.removeItem,f,d),(d.removeMeta||d.removeMata)&&await Nt(m.removeItem,f+"$",d),m.watch||r("remove",u))},async getMeta(u,d={}){typeof d=="boolean"&&(d={nativeOnly:d}),u=jn(u);const{relativeKey:f,driver:m}=n(u),y=Object.create(null);if(m.getMeta&&Object.assign(y,await Nt(m.getMeta,f,d)),!d.nativeOnly){const g=await Nt(m.getItem,f+"$",d).then(p=>Rc(p));g&&typeof g=="object"&&(typeof g.atime=="string"&&(g.atime=new Date(g.atime)),typeof g.mtime=="string"&&(g.mtime=new Date(g.mtime)),Object.assign(y,g))}return y},setMeta(u,d,f={}){return this.setItem(u+"$",d,f)},removeMeta(u,d={}){return this.removeItem(u+"$",d)},async getKeys(u,d={}){var w;u=Uc(u);const f=i(u,!0);let m=[];const y=[];let g=!0;for(const x of f){(w=x.driver.flags)!=null&&w.maxDepth||(g=!1);const I=await Nt(x.driver.getKeys,x.relativeBase,d);for(const E of I){const j=x.mountpoint+jn(E);m.some(C=>j.startsWith(C))||y.push(j)}m=[x.mountpoint,...m.filter(E=>!E.startsWith(x.mountpoint))]}const p=d.maxDepth!==void 0&&!g;return y.filter(x=>(!p||vS(x,d.maxDepth))&&LS(x,u))},async clear(u,d={}){u=Uc(u),await Promise.all(i(u,!1).map(async f=>{if(f.driver.clear)return Nt(f.driver.clear,f.relativeBase,d);if(f.driver.removeItem){const m=await f.driver.getKeys(f.relativeBase||"",d);return Promise.all(m.map(y=>f.driver.removeItem(y,d)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(u=>Vy(u)))},async watch(u){return await s(),t.watchListeners.push(u),async()=>{t.watchListeners=t.watchListeners.filter(d=>d!==u),t.watchListeners.length===0&&await o()}},async unwatch(){t.watchListeners=[],await o()},mount(u,d){if(u=Uc(u),u&&t.mounts[u])throw new Error(`already mounted at ${u}`);return u&&(t.mountpoints.push(u),t.mountpoints.sort((f,m)=>m.length-f.length)),t.mounts[u]=d,t.watching&&Promise.resolve(By(d,r,u)).then(f=>{t.unwatch[u]=f}).catch(console.error),l},async unmount(u,d=!0){var f,m;u=Uc(u),!(!u||!t.mounts[u])&&(t.watching&&u in t.unwatch&&((m=(f=t.unwatch)[u])==null||m.call(f),delete t.unwatch[u]),d&&await Vy(t.mounts[u]),t.mountpoints=t.mountpoints.filter(y=>y!==u),delete t.mounts[u])},getMount(u=""){u=jn(u)+":";const d=n(u);return{driver:d.driver,base:d.base}},getMounts(u="",d={}){return u=jn(u),i(u,d.parents).map(m=>({driver:m.driver,base:m.mountpoint}))},keys:(u,d={})=>l.getKeys(u,d),get:(u,d={})=>l.getItem(u,d),set:(u,d,f={})=>l.setItem(u,d,f),has:(u,d={})=>l.hasItem(u,d),del:(u,d={})=>l.removeItem(u,d),remove:(u,d={})=>l.removeItem(u,d)};return l}function By(e,t,n){return e.watch?e.watch((i,r)=>t(i,n+r)):()=>{}}async function Vy(e){typeof e.dispose=="function"&&await Nt(e.dispose)}function Fs(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function P5(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const i=Fs(n);return(r,s)=>i.then(o=>s(o.transaction(t,r).objectStore(t)))}let Yd;function _c(){return Yd||(Yd=P5("keyval-store","keyval")),Yd}function $y(e,t=_c()){return t("readonly",n=>Fs(n.get(e)))}function NS(e,t,n=_c()){return n("readwrite",i=>(i.put(t,e),Fs(i.transaction)))}function AS(e,t=_c()){return t("readwrite",n=>(n.delete(e),Fs(n.transaction)))}function OS(e=_c()){return e("readwrite",t=>(t.clear(),Fs(t.transaction)))}function kS(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},Fs(e.transaction)}function zS(e=_c()){return e("readonly",t=>{if(t.getAllKeys)return Fs(t.getAllKeys());const n=[];return kS(t,i=>n.push(i.key)).then(()=>n)})}const PS=e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString()+"n":n),RS=e=>{const t=/([\[:])?(\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,n=e.replace(t,'$1"$2n"$3');return JSON.parse(n,(i,r)=>typeof r=="string"&&r.match(/^\d+n$/)?BigInt(r.substring(0,r.length-1)):r)};function To(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return RS(e)}catch{return e}}function Ss(e){return typeof e=="string"?e:PS(e)||""}const US="idb-keyval";var BS=(e={})=>{const t=e.base&&e.base.length>0?`${e.base}:`:"",n=r=>t+r;let i;return e.dbName&&e.storeName&&(i=P5(e.dbName,e.storeName)),{name:US,options:e,async hasItem(r){return!(typeof await $y(n(r),i)>"u")},async getItem(r){return await $y(n(r),i)??null},setItem(r,s){return NS(n(r),s,i)},removeItem(r){return AS(n(r),i)},getKeys(){return zS(i)},clear(){return OS(i)}}};const VS="WALLET_CONNECT_V2_INDEXED_DB",$S="keyvaluestorage";let WS=class{constructor(){this.indexedDb=DS({driver:BS({dbName:VS,storeName:$S})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(t=>[t.key,t.value])}async getItem(t){const n=await this.indexedDb.getItem(t);if(n!==null)return n}async setItem(t,n){await this.indexedDb.setItem(t,Ss(n))}async removeItem(t){await this.indexedDb.removeItem(t)}};var Hd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof we<"u"?we:typeof self<"u"?self:{},ll={exports:{}};(function(){let e;function t(){}e=t,e.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},e.prototype.setItem=function(n,i){this[n]=String(i)},e.prototype.removeItem=function(n){delete this[n]},e.prototype.clear=function(){const n=this;
292Object.keys(n).forEach(function(i){n[i]=void 0,delete n[i]})},e.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Hd<"u"&&Hd.localStorage?ll.exports=Hd.localStorage:typeof window<"u"&&window.localStorage?ll.exports=window.localStorage:ll.exports=new t})();function FS(e){var t;return[e[0],To((t=e[1])!=null?t:"")]}let YS=class{constructor(){this.localStorage=ll.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(FS)}async getItem(t){const n=this.localStorage.getItem(t);if(n!==null)return To(n)}async setItem(t,n){this.localStorage.setItem(t,Ss(n))}async removeItem(t){this.localStorage.removeItem(t)}};const HS="wc_storage_version",Wy=1,QS=async(e,t,n)=>{const i=HS,r=await t.getItem(i);if(r&&r>=Wy){n(t);return}const s=await e.getKeys();if(!s.length){n(t);return}const o=[];for(;s.length;){const c=s.shift();if(!c)continue;const l=c.toLowerCase();if(l.includes("wc@")||l.includes("walletconnect")||l.includes("wc_")||l.includes("wallet_connect")){const u=await e.getItem(c);await t.setItem(c,u),o.push(c)}}await t.setItem(i,Wy),n(t),ZS(e,o)},ZS=async(e,t)=>{t.length&&t.forEach(async n=>{await e.removeItem(n)})};let qS=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const t=new YS;this.storage=t;try{const n=new WS;QS(t,n,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(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,n){return await this.initialize(),this.storage.setItem(t,n)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise(t=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),t())},20)})}};function GS(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var KS=JS;function JS(e,t,n){var i=n&&n.stringify||GS,r=1;if(typeof e=="object"&&e!==null){var s=t.length+r;if(s===1)return e;var o=new Array(s);o[0]=i(e);for(var c=1;c<s;c++)o[c]=i(t[c]);return o.join(" ")}if(typeof e!="string")return e;var l=t.length;if(l===0)return e;for(var u="",d=1-r,f=-1,m=e&&e.length||0,y=0;y<m;){if(e.charCodeAt(y)===37&&y+1<m){switch(f=f>-1?f:0,e.charCodeAt(y+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<y&&(u+=e.slice(f,y)),u+=Number(t[d]),f=y+2,y++;break;case 105:if(d>=l||t[d]==null)break;f<y&&(u+=e.slice(f,y)),u+=Math.floor(Number(t[d])),f=y+2,y++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<y&&(u+=e.slice(f,y));var g=typeof t[d];if(g==="string"){u+="'"+t[d]+"'",f=y+2,y++;break}if(g==="function"){u+=t[d].name||"<anonymous>",f=y+2,y++;break}u+=i(t[d]),f=y+2,y++;break;case 115:if(d>=l)break;f<y&&(u+=e.slice(f,y)),u+=String(t[d]),f=y+2,y++;break;case 37:f<y&&(u+=e.slice(f,y)),u+="%",f=y+2,y++,d--;break}++d}++y}return f===-1?e:(f<m&&(u+=e.slice(f)),u)}const Fy=KS;var oo=ki;const Wa=cD().console||{},XS={mapHttpRequest:Bc,mapHttpResponse:Bc,wrapRequestSerializer:Qd,wrapResponseSerializer:Qd,wrapErrorSerializer:Qd,req:Bc,res:Bc,err:rD};function eD(e,t){return Array.isArray(e)?e.filter(function(i){return i!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function ki(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const n=e.browser.write||Wa;e.browser.write&&(e.browser.asObject=!0);const i=e.serializers||{},r=eD(e.browser.serialize,i);let s=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);const o=["error","fatal","warn","info","debug","trace"];typeof n=="function"&&(n.error=n.fatal=n.warn=n.info=n.debug=n.trace=n),e.enabled===!1&&(e.level="silent");const c=e.level||"info",l=Object.create(n);l.log||(l.log=Fa),Object.defineProperty(l,"levelVal",{get:d}),Object.defineProperty(l,"level",{get:f,set:m});const u={transmit:t,serialize:r,asObject:e.browser.asObject,levels:o,timestamp:sD(e)};l.levels=ki.levels,l.level=c,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=Fa,l.serializers=i,l._serialize=r,l._stdErrSerialize=s,l.child=y,t&&(l._logEvent=m0());
292function d(){return this.level==="silent"?1/0:this.levels.values[this.level]}function f(){return this._level}function m(g){if(g!=="silent"&&!this.levels.values[g])throw Error("unknown level "+g);this._level=g,Ks(u,l,"error","log"),Ks(u,l,"fatal","error"),Ks(u,l,"warn","error"),Ks(u,l,"info","log"),Ks(u,l,"debug","log"),Ks(u,l,"trace","log")}function y(g,p){if(!g)throw new Error("missing bindings for child Pino");p=p||{},r&&g.serializers&&(p.serializers=g.serializers);const w=p.serializers;if(r&&w){var x=Object.assign({},i,w),I=e.browser.serialize===!0?Object.keys(x):r;delete g.serializers,Hu([g],I,x,this._stdErrSerialize)}function E(j){this._childLevel=(j._childLevel|0)+1,this.error=Js(j,g,"error"),this.fatal=Js(j,g,"fatal"),this.warn=Js(j,g,"warn"),this.info=Js(j,g,"info"),this.debug=Js(j,g,"debug"),this.trace=Js(j,g,"trace"),x&&(this.serializers=x,this._serialize=I),t&&(this._logEvent=m0([].concat(j._logEvent.bindings,g)))}return E.prototype=this,new E(this)}return l}ki.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"}};ki.stdSerializers=XS;ki.stdTimeFunctions=Object.assign({},{nullTime:R5,epochTime:U5,unixTime:oD,isoTime:aD});function Ks(e,t,n,i){const r=Object.getPrototypeOf(t);t[n]=t.levelVal>t.levels.values[n]?Fa:r[n]?r[n]:Wa[n]||Wa[i]||Fa,tD(e,t,n)}function tD(e,t,n){!e.transmit&&t[n]===Fa||(t[n]=function(i){return function(){const s=e.timestamp(),o=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Wa?Wa:this;for(var l=0;l<o.length;l++)o[l]=arguments[l];if(e.serialize&&!e.asObject&&Hu(o,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?i.call(c,nD(this,n,o,s)):i.apply(c,o),e.transmit){const u=e.transmit.level||t.level,d=ki.levels.values[u],f=ki.levels.values[n];if(f<d)return;iD(this,{ts:s,methodLevel:n,methodValue:f,transmitLevel:u,transmitValue:ki.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},o)}}}(t[n]))}function nD(e,t,n,i){e._serialize&&Hu(n,e._serialize,e.serializers,e._stdErrSerialize);const r=n.slice();let s=r[0];const o={};i&&(o.time=i),o.level=ki.levels.values[t];let c=(e._childLevel|0)+1;if(c<1&&(c=1),s!==null&&typeof s=="object"){for(;c--&&typeof r[0]=="object";)Object.assign(o,r.shift());s=r.length?Fy(r.shift(),r):void 0}else typeof s=="string"&&(s=Fy(r.shift(),r));return s!==void 0&&(o.msg=s),o}function Hu(e,t,n,i){for(const r in e)if(i&&e[r]instanceof Error)e[r]=ki.stdSerializers.err(e[r]);else if(typeof e[r]=="object"&&!Array.isArray(e[r]))for(const s in e[r])t&&t.indexOf(s)>-1&&s in n&&(e[r][s]=n[s](e[r][s]))}function Js(e,t,n){return function(){const i=new Array(1+arguments.length);i[0]=t;for(var r=1;r<i.length;r++)i[r]=arguments[r-1];return e[n].apply(this,i)}}function iD(e,t,n){const i=t.send,r=t.ts,s=t.methodLevel,o=t.methodValue,c=t.val,l=e._logEvent.bindings;Hu(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=r,e._logEvent.messages=n.filter(function(u){return l.indexOf(u)===-1}),e._logEvent.level.label=s,e._logEvent.level.value=o,i(s,e._logEvent,c),e._logEvent=m0(l)}function m0(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function rD(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)t[n]===void 0&&(t[n]=e[n]);return t}function sD(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?R5:U5}function Bc(){return{}}function Qd(e){return e}function Fa(){}function R5(){return!1}function U5(){return Date.now()}function oD(){return Math.round(Date.now()/1e3)}function aD(){return new Date(Date.now()).toISOString()}function cD(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}const Qu=T4(oo),lD={level:"info"},bc="custom_context",O1=1e3*1024;let uD=class{constructor(t){this.nodeValue=t,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},Yy=class{constructor(t){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){const n=new uD(t);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${t} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){const t=[];let n=this.head;for(;n!==null;)t.push(n.value),n=n.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};const n=t.value;return t=t.next,{done:!1,value:n}}}}};class B5{constructor(t,n=O1){this.level=t??"error",this.levelValue=oo.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new Yy(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,n){n===oo.levels.values.error?console.error(t):n===oo.levels.values.warn?console.warn(t):n===oo.levels.values.debug||n===oo.levels.values.trace&&console.trace(t)}appendToLogs(t){this.logs.append(Ss({timestamp:new Date().toISOString(),log:t}));const n=typeof t=="string"?JSON.parse(t).level:t.level;n>=this.levelValue&&this.forwardToConsole(t,n)}getLogs(){return this.logs}clearLogs(){this.logs=new Yy(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){const n=this.getLogArray();return n.push(Ss({extraMetadata:t})),new Blob(n,{type:"application/json"})}}let dD=class{constructor(t,n=O1){this.baseChunkLogger=new B5(t,n)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){const n=URL.createObjectURL(this.logsToBlob(t)),i=document.createElement("a");i.href=n,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)}},hD=class{constructor(t,n=O1){this.baseChunkLogger=new B5(t,n)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}};var fD=Object.defineProperty,mD=Object.defineProperties,yD=Object.getOwnPropertyDescriptors,Hy=Object.getOwnPropertySymbols,gD=Object.prototype.hasOwnProperty,pD=Object.prototype.propertyIsEnumerable,Qy=(e,t,n)=>t in e?fD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pl=(e,t)=>
292{for(var n in t||(t={}))gD.call(t,n)&&Qy(e,n,t[n]);if(Hy)for(var n of Hy(t))pD.call(t,n)&&Qy(e,n,t[n]);return e},Rl=(e,t)=>mD(e,yD(t));function k1(e){return Rl(Pl({},e),{level:(e==null?void 0:e.level)||lD.level})}function wD(e,t=bc){return e[t]||""}function _D(e,t,n=bc){return e[n]=t,e}function Un(e,t=bc){let n="";return typeof e.bindings>"u"?n=wD(e,t):n=e.bindings().context||"",n}function bD(e,t,n=bc){const i=Un(e,n);return i.trim()?`${i}/${t}`:t}function Cn(e,t,n=bc){const i=bD(e,t,n),r=e.child({context:i});return _D(r,i,n)}function xD(e){var t,n;const i=new dD((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Qu(Rl(Pl({},e.opts),{level:"trace",browser:Rl(Pl({},(n=e.opts)==null?void 0:n.browser),{write:r=>i.write(r)})})),chunkLoggerController:i}}function ID(e){var t;const n=new hD((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Qu(Rl(Pl({},e.opts),{level:"trace"}),n),chunkLoggerController:n}}function MD(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?xD(e):ID(e)}var CD=Object.defineProperty,ED=(e,t,n)=>t in e?CD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zy=(e,t,n)=>ED(e,typeof t!="symbol"?t+"":t,n);let TD=class extends $s{constructor(t){super(),this.opts=t,Zy(this,"protocol","wc"),Zy(this,"version",2)}};var vD=Object.defineProperty,LD=(e,t,n)=>t in e?vD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jD=(e,t,n)=>LD(e,t+"",n);class SD extends $s{constructor(t,n){super(),this.core=t,this.logger=n,jD(this,"records",new Map)}}class DD{constructor(t,n){this.logger=t,this.core=n}}let ND=class extends $s{constructor(t,n){super(),this.relayer=t,this.logger=n}},AD=class extends $s{constructor(t){super()}},OD=class{constructor(t,n,i,r){this.core=t,this.logger=n,this.name=i}},kD=class extends $s{constructor(t,n){super(),this.relayer=t,this.logger=n}};class zD extends $s{constructor(t,n){super(),this.core=t,this.logger=n}}let PD=class{constructor(t,n,i){this.core=t,this.logger=n,this.store=i}},RD=class{constructor(t,n){this.projectId=t,this.logger=n}},UD=class{constructor(t,n,i){this.core=t,this.logger=n,this.telemetryEnabled=i}};var BD=Object.defineProperty,VD=(e,t,n)=>t in e?BD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qy=(e,t,n)=>VD(e,typeof t!="symbol"?t+"":t,n);let $D=class{constructor(t){this.opts=t,qy(this,"protocol","wc"),qy(this,"version",2)}},WD=class{constructor(t){this.client=t}};function FD(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function V5(e,...t){if(!FD(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Gy(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function YD(e,t){V5(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const Xs=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Zd=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function HD(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function $5(e){return typeof e=="string"&&(e=HD(e)),V5(e),e}let QD=class{clone(){return this._cloneInto()}};function ZD(e){const t=i=>e().update($5(i)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function W5(e=32){if(Xs&&typeof Xs.getRandomValues=="function")return Xs.getRandomValues(new Uint8Array(e));if(Xs&&typeof Xs.randomBytes=="function")return Xs.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function qD(e,t,n,i){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,i);const r=BigInt(32),s=BigInt(4294967295),o=Number(n>>r&s),c=Number(n&s),l=i?4:0,u=i?0:4;e.setUint32(t+l,o,i),e.setUint32(t+u,c,i)}let GD=class extends QD{constructor(t,n,i,r){super(),this.blockLen=t,this.outputLen=n,this.padOffset=i,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Zd(this.buffer)}update(t){Gy(this);const{view:n,buffer:i,blockLen:r}=this;t=$5(t);const s=t.length;for(let o=0;o<s;){const c=Math.min(r-this.pos,s-o);if(c===r){const l=Zd(t);for(;r<=s-o;o+=r)this.process(l,o);continue}i.set(t.subarray(o,o+c),this.pos),this.pos+=c,o+=c,this.pos===r&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Gy(this),YD(t,this),this.finished=!0;const{buffer:n,view:i,blockLen:r,isLE:s}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>r-o&&(this.process(i,0),o=0);for(let f=o;f<r;f++)n[f]=0;qD(i,r-8,BigInt(this.length*8),s),this.process(i,0);const c=Zd(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)c.setUint32(4*f,d[f],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const i=t.slice(0,n);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:i,length:r,finished:s,destroyed:o,pos:c}=this;return t.length=r,t.pos=c,t.finished=s,t.destroyed=o,r%n&&t.buffer.set(i),t}};const Vc=BigInt(2**32-1),y0=BigInt(32);function F5(e,t=!1){return t?{h:Number(e&Vc),l:Number(e>>y0&Vc)}:{h:Number(e>>y0&Vc)|0,l:Number(e&Vc)|0}}function KD(e,t=!1){let n=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let r=0;r<e.length;r++){const{h:s,l:o}=F5(e[r],t);[n[r],i[r]]=[s,o]}return[n,i]}const JD=(e,t)=>BigInt(e>>>0)<<y0|BigInt(t>>>0),XD=(e,t,n)=>e>>>n,eN=(e,t,n)=>e<<32-n|t>>>n,tN=(e,t,n)=>e>>>n|t<<32-n,nN=(e,t,n)=>e<<32-n|t>>>n,iN=(e,t,n)=>e<<64-n|t>>>n-32,rN=(e,t,n)=>e>>>n-32|t<<64-n,sN=(e,t)=>t,oN=(e,t)=>e,aN=(e,t,n)=>e<<n|t>>>32-n,cN=(e,t,n)=>t<<n|e>>>32-n,lN=(e,t,n)=>t<<n-32|e>>>64-n,uN=(e,t,n)=>e<<n-32|t>>>64-n;function dN(e,t,n,i){const r=(t>>>0)+(i>>>0);return{h:e+n+(r/2**32|0)|0,l:r|0}}const hN=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),fN=(e,t,n,i)=>t+n+i+(e/2**32|0)|0,mN=(e,t,n,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0),yN=(e,t,n,i,r)=>t+n+i+r+(e/2**32|0)|0,gN=(e,t,n,i,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0)+(r>>>0),pN=(e,t,n,i,r,s)=>t+n+i+r+s+(e/2**32|0)|0,ve={fromBig:F5,split:KD,toBig:JD,shrSH:XD,shrSL:eN,rotrSH:tN,rotrSL:nN,rotrBH:iN,rotrBL:rN,rotr32H:sN,rotr32L:oN,rotlSH:aN,rotlSL:cN,rotlBH:lN,rotlBL:uN,add:dN,add3L:hN,add3H:fN,add4L:mN,add4H:yN,add5H:pN,add5L:gN},[wN,_N]=ve.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b89
2926f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),mr=new Uint32Array(80),yr=new Uint32Array(80);let bN=class extends GD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:n,Bh:i,Bl:r,Ch:s,Cl:o,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:m,Gh:y,Gl:g,Hh:p,Hl:w}=this;return[t,n,i,r,s,o,c,l,u,d,f,m,y,g,p,w]}set(t,n,i,r,s,o,c,l,u,d,f,m,y,g,p,w){this.Ah=t|0,this.Al=n|0,this.Bh=i|0,this.Bl=r|0,this.Ch=s|0,this.Cl=o|0,this.Dh=c|0,this.Dl=l|0,this.Eh=u|0,this.El=d|0,this.Fh=f|0,this.Fl=m|0,this.Gh=y|0,this.Gl=g|0,this.Hh=p|0,this.Hl=w|0}process(t,n){for(let E=0;E<16;E++,n+=4)mr[E]=t.getUint32(n),yr[E]=t.getUint32(n+=4);for(let E=16;E<80;E++){const j=mr[E-15]|0,C=yr[E-15]|0,T=ve.rotrSH(j,C,1)^ve.rotrSH(j,C,8)^ve.shrSH(j,C,7),v=ve.rotrSL(j,C,1)^ve.rotrSL(j,C,8)^ve.shrSL(j,C,7),N=mr[E-2]|0,M=yr[E-2]|0,S=ve.rotrSH(N,M,19)^ve.rotrBH(N,M,61)^ve.shrSH(N,M,6),L=ve.rotrSL(N,M,19)^ve.rotrBL(N,M,61)^ve.shrSL(N,M,6),O=ve.add4L(v,L,yr[E-7],yr[E-16]),P=ve.add4H(O,T,S,mr[E-7],mr[E-16]);mr[E]=P|0,yr[E]=O|0}let{Ah:i,Al:r,Bh:s,Bl:o,Ch:c,Cl:l,Dh:u,Dl:d,Eh:f,El:m,Fh:y,Fl:g,Gh:p,Gl:w,Hh:x,Hl:I}=this;for(let E=0;E<80;E++){const j=ve.rotrSH(f,m,14)^ve.rotrSH(f,m,18)^ve.rotrBH(f,m,41),C=ve.rotrSL(f,m,14)^ve.rotrSL(f,m,18)^ve.rotrBL(f,m,41),T=f&y^~f&p,v=m&g^~m&w,N=ve.add5L(I,C,v,_N[E],yr[E]),M=ve.add5H(N,x,j,T,wN[E],mr[E]),S=N|0,L=ve.rotrSH(i,r,28)^ve.rotrBH(i,r,34)^ve.rotrBH(i,r,39),O=ve.rotrSL(i,r,28)^ve.rotrBL(i,r,34)^ve.rotrBL(i,r,39),P=i&s^i&c^s&c,$=r&o^r&l^o&l;x=p|0,I=w|0,p=y|0,w=g|0,y=f|0,g=m|0,{h:f,l:m}=ve.add(u|0,d|0,M|0,S|0),u=c|0,d=l|0,c=s|0,l=o|0,s=i|0,o=r|0;const z=ve.add3L(S,O,$);i=ve.add3H(z,M,L,P),r=z|0}({h:i,l:r}=ve.add(this.Ah|0,this.Al|0,i|0,r|0)),{h:s,l:o}=ve.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:c,l}=ve.add(this.Ch|0,this.Cl|0,c|0,l|0),{h:u,l:d}=ve.add(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:m}=ve.add(this.Eh|0,this.El|0,f|0,m|0),{h:y,l:g}=ve.add(this.Fh|0,this.Fl|0,y|0,g|0),{h:p,l:w}=ve.add(this.Gh|0,this.Gl|0,p|0,w|0),{h:x,l:I}=ve.add(this.Hh|0,this.Hl|0,x|0,I|0),this.set(i,r,s,o,c,l,u,d,f,m,y,g,p,w,x,I)}roundClean(){mr.fill(0),yr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const xN=ZD(()=>new bN);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const z1=BigInt(0),Y5=BigInt(1),IN=BigInt(2);function P1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function R1(e){if(!P1(e))throw new Error("Uint8Array expected")}function qd(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const MN=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function U1(e){R1(e);let t="";for(let n=0;n<e.length;n++)t+=MN[e[n]];return t}function H5(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?z1:BigInt("0x"+e)}const Fi={_0:48,_9:57,A:65,F:70,a:97,f:102};function Ky(e){if(e>=Fi._0&&e<=Fi._9)return e-Fi._0;if(e>=Fi.A&&e<=Fi.F)return e-(Fi.A-10);if(e>=Fi.a&&e<=Fi.f)return e-(Fi.a-10)}function Q5(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(n);for(let r=0,s=0;r<n;r++,s+=2){const o=Ky(e.charCodeAt(s)),c=Ky(e.charCodeAt(s+1));if(o===void 0||c===void 0){const l=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+s)}i[r]=o*16+c}return i}function CN(e){return H5(U1(e))}function ul(e){return R1(e),H5(U1(Uint8Array.from(e).reverse()))}function Z5(e,t){return Q5(e.toString(16).padStart(t*2,"0"))}function g0(e,t){return Z5(e,t).reverse()}
292function Yi(e,t,n){let i;if(typeof t=="string")try{i=Q5(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(P1(t))i=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const r=i.length;if(typeof n=="number"&&r!==n)throw new Error(e+" of length "+n+" expected, got "+r);return i}function Jy(...e){let t=0;for(let i=0;i<e.length;i++){const r=e[i];R1(r),t+=r.length}const n=new Uint8Array(t);for(let i=0,r=0;i<e.length;i++){const s=e[i];n.set(s,r),r+=s.length}return n}const Gd=e=>typeof e=="bigint"&&z1<=e;function EN(e,t,n){return Gd(e)&&Gd(t)&&Gd(n)&&t<=e&&e<n}function ta(e,t,n,i){if(!EN(t,n,i))throw new Error("expected valid "+e+": "+n+" <= n < "+i+", got "+t)}function TN(e){let t;for(t=0;e>z1;e>>=Y5,t+=1);return t}const vN=e=>(IN<<BigInt(e-1))-Y5,LN={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||P1(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function B1(e,t,n={}){const i=(r,s,o)=>{const c=LN[s];if(typeof c!="function")throw new Error("invalid validator function");const l=e[r];if(!(o&&l===void 0)&&!c(l,e))throw new Error("param "+String(r)+" is invalid. Expected "+s+", got "+l)};for(const[r,s]of Object.entries(t))i(r,s,!1);for(const[r,s]of Object.entries(n))i(r,s,!0);return e}function Xy(e){const t=new WeakMap;return(n,...i)=>{const r=t.get(n);if(r!==void 0)return r;const s=e(n,...i);return t.set(n,s),s}}const kt=BigInt(0),gt=BigInt(1),ds=BigInt(2),jN=BigInt(3),p0=BigInt(4),e2=BigInt(5),t2=BigInt(8);function vt(e,t){const n=e%t;return n>=kt?n:t+n}function SN(e,t,n){if(t<kt)throw new Error("invalid exponent, negatives unsupported");if(n<=kt)throw new Error("invalid modulus");if(n===gt)return kt;let i=gt;for(;t>kt;)t&gt&&(i=i*e%n),e=e*e%n,t>>=gt;return i}function xi(e,t,n){let i=e;for(;t-- >kt;)i*=i,i%=n;return i}function n2(e,t){if(e===kt)throw new Error("invert: expected non-zero number");if(t<=kt)throw new Error("invert: expected positive modulus, got "+t);let n=vt(e,t),i=t,r=kt,s=gt;for(;n!==kt;){const o=i/n,c=i%n,l=r-s*o;i=n,n=c,r=s,s=l}if(i!==gt)throw new Error("invert: does not exist");return vt(r,t)}function DN(e){const t=(e-gt)/ds;let n,i,r;for(n=e-gt,i=0;n%ds===kt;n/=ds,i++);for(r=ds;r<e&&SN(r,t,e)!==e-gt;r++)if(r>1e3)throw new Error("Cannot find square root: likely non-prime P");if(i===1){const o=(e+gt)/p0;return function(c,l){const u=c.pow(l,o);if(!c.eql(c.sqr(u),l))throw new Error("Cannot find square root");return u}}const s=(n+gt)/ds;return function(o,c){if(o.pow(c,t)===o.neg(o.ONE))throw new Error("Cannot find square root");let l=i,u=o.pow(o.mul(o.ONE,r),n),d=o.pow(c,s),f=o.pow(c,n);for(;!o.eql(f,o.ONE);){if(o.eql(f,o.ZERO))return o.ZERO;let m=1;for(let g=o.sqr(f);m<l&&!o.eql(g,o.ONE);m++)g=o.sqr(g);const y=o.pow(u,gt<<BigInt(l-m-1));u=o.sqr(y),d=o.mul(d,y),f=o.mul(f,u),l=m}return d}}function NN(e){if(e%p0===jN){const t=(e+gt)/p0;return function(n,i){const r=n.pow(i,t);if(!n.eql(n.sqr(r),i))throw new Error("Cannot find square root");return r}}if(e%t2===e2){const t=(e-e2)/t2;return function(n,i){const r=n.mul(i,ds),s=n.pow(r,t),o=n.mul(i,s),c=n.mul(n.mul(o,ds),s),l=n.mul(o,n.sub(c,n.ONE));if(!n.eql(n.sqr(l),i))throw new Error("Cannot find square root");return l}}return DN(e)}const AN=(e,t)=>(vt(e,t)&gt)===gt,ON=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function kN(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=ON.reduce((i,r)=>(i[r]="function",i),t);return B1(e,n)}function zN(e,t,n){if(n<kt)throw new Error("invalid exponent, negatives unsupported");if(n===kt)return e.ONE;if(n===gt)return t;let i=e.ONE,r=t;for(;n>kt;)n&gt&&(i=e.mul(i,r)),r=e.sqr(r),n>>=gt;return i}function PN(e,t){const n=new Array(t.length),i=t.reduce((s,o,c)=>e.is0(o)?s:(n[c]=s,e.mul(s,o)),e.ONE),r=e.inv(i);return t.reduceRight((s,o,c)=>e.is0(o)?s:(n[c]=e.mul(s,n[c]),e.mul(s,o)),r),n}function q5(e,t){const n=t!==void 0?t:e.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}function G5(e,t,n=!1,i={}){if(e<=kt)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:r,nByteLength:s}=q5(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const c=Object.freeze({ORDER:e,isLE:n,BITS:r,BYTES:s,MASK:vN(r),ZERO:kt,ONE:gt,create:l=>vt(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return kt<=l&&l<e},is0:l=>l===kt,isOdd:l=>(l&gt)===gt,neg:l=>vt(-l,e),eql:(l,u)=>l===u,sqr:l=>vt(l*l,e),add:(l,u)=>vt(l+u,e),sub:(l,u)=>vt(l-u,e),mul:(l,u)=>vt(l*u,e),pow:(l,u)=>zN(c,l,u),div:(l,u)=>vt(l*n2(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>n2(l,e),sqrt:i.sqrt||(l=>(o||(o=NN(e)),o(c,l))),invertBatch:l=>PN(c,l),cmov:(l,u,d)=>d?u:l,toBytes:l=>n?g0(l,s):Z5(l,s),fromBytes:l=>{if(l.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+l.length);return n?ul(l):CN(l)}});return Object.freeze(c)}const i2=BigInt(0),$c=BigInt(1);function Kd(e,t){const n=t.negate();return e?n:t}function K5(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Jd(e,t){K5(e,t);const n=Math.ceil(t/e)+1,i=2**(e-1);return{windows:n,windowSize:i}}function RN(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,i)=>{if(!(n instanceof t))throw new Error("invalid point at index "+i)})}function UN(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,i)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+i)})}const Xd=new WeakMap,J5=new WeakMap;function eh(e){return J5.get(e)||1}function BN(e,t){return{constTimeNegate:Kd,hasPrecomputes(n){return eh(n)!==1},unsafeLadder(n,i,r=e.ZERO){let s=n;for(;i>i2;)i&$c&&(r=r.add(s)),s=s.double(),i>>=$c;return r}
292,precomputeWindow(n,i){const{windows:r,windowSize:s}=Jd(i,t),o=[];let c=n,l=c;for(let u=0;u<r;u++){l=c,o.push(l);for(let d=1;d<s;d++)l=l.add(c),o.push(l);c=l.double()}return o},wNAF(n,i,r){const{windows:s,windowSize:o}=Jd(n,t);let c=e.ZERO,l=e.BASE;const u=BigInt(2**n-1),d=2**n,f=BigInt(n);for(let m=0;m<s;m++){const y=m*o;let g=Number(r&u);r>>=f,g>o&&(g-=d,r+=$c);const p=y,w=y+Math.abs(g)-1,x=m%2!==0,I=g<0;g===0?l=l.add(Kd(x,i[p])):c=c.add(Kd(I,i[w]))}return{p:c,f:l}},wNAFUnsafe(n,i,r,s=e.ZERO){const{windows:o,windowSize:c}=Jd(n,t),l=BigInt(2**n-1),u=2**n,d=BigInt(n);for(let f=0;f<o;f++){const m=f*c;if(r===i2)break;let y=Number(r&l);if(r>>=d,y>c&&(y-=u,r+=$c),y===0)continue;let g=i[m+Math.abs(y)-1];y<0&&(g=g.negate()),s=s.add(g)}return s},getPrecomputes(n,i,r){let s=Xd.get(i);return s||(s=this.precomputeWindow(i,n),n!==1&&Xd.set(i,r(s))),s},wNAFCached(n,i,r){const s=eh(n);return this.wNAF(s,this.getPrecomputes(s,n,r),i)},wNAFCachedUnsafe(n,i,r,s){const o=eh(n);return o===1?this.unsafeLadder(n,i,s):this.wNAFUnsafe(o,this.getPrecomputes(o,n,r),i,s)},setWindowSize(n,i){K5(i,t),J5.set(n,i),Xd.delete(n)}}}function VN(e,t,n,i){if(RN(n,e),UN(i,t),n.length!==i.length)throw new Error("arrays of points and scalars must have equal length");const r=e.ZERO,s=TN(BigInt(n.length)),o=s>12?s-3:s>4?s-2:s?2:1,c=(1<<o)-1,l=new Array(c+1).fill(r),u=Math.floor((t.BITS-1)/o)*o;let d=r;for(let f=u;f>=0;f-=o){l.fill(r);for(let y=0;y<i.length;y++){const g=i[y],p=Number(g>>BigInt(f)&BigInt(c));l[p]=l[p].add(n[y])}let m=r;for(let y=l.length-1,g=r;y>0;y--)g=g.add(l[y]),m=m.add(g);if(d=d.add(m),f!==0)for(let y=0;y<o;y++)d=d.double()}return d}function $N(e){return kN(e.Fp),B1(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...q5(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const ui=BigInt(0),vn=BigInt(1),Wc=BigInt(2),WN=BigInt(8),FN={zip215:!0};function YN(e){const t=$N(e);return B1(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function HN(e){const t=YN(e),{Fp:n,n:i,prehash:r,hash:s,randomBytes:o,nByteLength:c,h:l}=t,u=Wc<<BigInt(c*8)-vn,d=n.create,f=G5(t.n,t.nBitLength),m=t.uvRatio||((z,k)=>{try{return{isValid:!0,value:n.sqrt(z*n.inv(k))}}catch{return{isValid:!1,value:ui}}}),y=t.adjustScalarBytes||(z=>z),g=t.domain||((z,k,B)=>{if(qd("phflag",B),k.length||B)throw new Error("Contexts/pre-hash are not supported");return z});function p(z,k){ta("coordinate "+z,k,ui,u)}function w(z){if(!(z instanceof E))throw new Error("ExtendedPoint expected")}const x=Xy((z,k)=>{const{ex:B,ey:W,ez:V}=z,F=z.is0();k==null&&(k=F?WN:n.inv(V));const Y=d(B*k),Q=d(W*k),Z=d(V*k);if(F)return{x:ui,y:vn};if(Z!==vn)throw new Error("invZ was invalid");return{x:Y,y:Q}}),I=Xy(z=>{const{a:k,d:B}=t;if(z.is0())throw new Error("bad point: ZERO");const{ex:W,ey:V,ez:F,et:Y}=z,Q=d(W*W),Z=d(V*V),K=d(F*F),q=d(K*K),oe=d(Q*k),re=d(K*d(oe+Z)),ae=d(q+d(B*d(Q*Z)));if(re!==ae)throw new Error("bad point: equation left != right (1)");const le=d(W*V),Te=d(F*Y);if(le!==Te)throw new Error("bad point: equation left != right (2)");return!0});class E{constructor(k,B,W,V){this.ex=k,this.ey=B,this.ez=W,this.et=V,p("x",k),p("y",B),p("z",W),p("t",V),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(k){if(k instanceof E)throw new Error("extended point not allowed");const{x:B,y:W}=k||{};return p("x",B),p("y",W),new E(B,W,vn,d(B*W))}static normalizeZ(k){const B=n.invertBatch(k.map(W=>W.ez));return k.map((W,V)=>W.toAffine(B[V])).map(E.fromAffine)}static msm(k,B){return VN(E,f,k,B)}_setWindowSize(k){T.setWindowSize(this,k)}assertValidity(){I(this)}equals(k){w(k);const{ex:B,ey:W,ez:V}=this,{ex:F,ey:Y,ez:Q}=k,Z=d(B*Q),K=d(F*V),q=d(W*Q),oe=d(Y*V);return Z===K&&q===oe}is0(){return this.equals(E.ZERO)}negate(){return new E(d(-this.ex),this.ey,this.ez,d(-this.et))}double(){const{a:k}=t,{ex:B,ey:W,ez:V}=this,F=d(B*B),Y=d(W*W),Q=d(Wc*d(V*V)),Z=d(k*F),K=B+W,q=d(d(K*K)-F-Y),oe=Z+Y,re=oe-Q,ae=Z-Y,le=d(q*re),Te=d(oe*ae),qe=d(q*ae),ct=d(re*oe);return new E(le,Te,ct,qe)}
292add(k){w(k);const{a:B,d:W}=t,{ex:V,ey:F,ez:Y,et:Q}=this,{ex:Z,ey:K,ez:q,et:oe}=k;if(B===BigInt(-1)){const ye=d((F-V)*(K+Z)),mt=d((F+V)*(K-Z)),_t=d(mt-ye);if(_t===ui)return this.double();const it=d(Y*Wc*oe),li=d(Q*Wc*q),mn=li+it,En=mt+ye,Ct=li-it,Tn=d(mn*_t),_i=d(En*Ct),Qs=d(mn*Ct),cd=d(_t*En);return new E(Tn,_i,cd,Qs)}const re=d(V*Z),ae=d(F*K),le=d(Q*W*oe),Te=d(Y*q),qe=d((V+F)*(Z+K)-re-ae),ct=Te-le,fn=Te+le,fe=d(ae-B*re),ge=d(qe*ct),st=d(fn*fe),pt=d(qe*fe),wt=d(ct*fn);return new E(ge,st,wt,pt)}subtract(k){return this.add(k.negate())}wNAF(k){return T.wNAFCached(this,k,E.normalizeZ)}multiply(k){const B=k;ta("scalar",B,vn,i);const{p:W,f:V}=this.wNAF(B);return E.normalizeZ([W,V])[0]}multiplyUnsafe(k,B=E.ZERO){const W=k;return ta("scalar",W,ui,i),W===ui?C:this.is0()||W===vn?this:T.wNAFCachedUnsafe(this,W,E.normalizeZ,B)}isSmallOrder(){return this.multiplyUnsafe(l).is0()}isTorsionFree(){return T.unsafeLadder(this,i).is0()}toAffine(k){return x(this,k)}clearCofactor(){const{h:k}=t;return k===vn?this:this.multiplyUnsafe(k)}static fromHex(k,B=!1){const{d:W,a:V}=t,F=n.BYTES;k=Yi("pointHex",k,F),qd("zip215",B);const Y=k.slice(),Q=k[F-1];Y[F-1]=Q&-129;const Z=ul(Y),K=B?u:n.ORDER;ta("pointHex.y",Z,ui,K);const q=d(Z*Z),oe=d(q-vn),re=d(W*q-V);let{isValid:ae,value:le}=m(oe,re);if(!ae)throw new Error("Point.fromHex: invalid y coordinate");const Te=(le&vn)===vn,qe=(Q&128)!==0;if(!B&&le===ui&&qe)throw new Error("Point.fromHex: x=0 and x_0=1");return qe!==Te&&(le=d(-le)),E.fromAffine({x:le,y:Z})}static fromPrivateKey(k){return M(k).point}toRawBytes(){const{x:k,y:B}=this.toAffine(),W=g0(B,n.BYTES);return W[W.length-1]|=k&vn?128:0,W}toHex(){return U1(this.toRawBytes())}}E.BASE=new E(t.Gx,t.Gy,vn,d(t.Gx*t.Gy)),E.ZERO=new E(ui,vn,vn,ui);const{BASE:j,ZERO:C}=E,T=BN(E,c*8);function v(z){return vt(z,i)}function N(z){return v(ul(z))}function M(z){const k=n.BYTES;z=Yi("private key",z,k);const B=Yi("hashed private key",s(z),2*k),W=y(B.slice(0,k)),V=B.slice(k,2*k),F=N(W),Y=j.multiply(F),Q=Y.toRawBytes();return{head:W,prefix:V,scalar:F,point:Y,pointBytes:Q}}function S(z){return M(z).pointBytes}function L(z=new Uint8Array,...k){const B=Jy(...k);return N(s(g(B,Yi("context",z),!!r)))}function O(z,k,B={}){z=Yi("message",z),r&&(z=r(z));const{prefix:W,scalar:V,pointBytes:F}=M(k),Y=L(B.context,W,z),Q=j.multiply(Y).toRawBytes(),Z=L(B.context,Q,F,z),K=v(Y+Z*V);ta("signature.s",K,ui,i);const q=Jy(Q,g0(K,n.BYTES));return Yi("result",q,n.BYTES*2)}const P=FN;function $(z,k,B,W=P){const{context:V,zip215:F}=W,Y=n.BYTES;z=Yi("signature",z,2*Y),k=Yi("message",k),B=Yi("publicKey",B,Y),F!==void 0&&qd("zip215",F),r&&(k=r(k));const Q=ul(z.slice(Y,2*Y));let Z,K,q;try{Z=E.fromHex(B,F),K=E.fromHex(z.slice(0,Y),F),q=j.multiplyUnsafe(Q)}catch{return!1}if(!F&&Z.isSmallOrder())return!1;const oe=L(V,K.toRawBytes(),Z.toRawBytes(),k);return K.add(Z.multiplyUnsafe(oe)).subtract(q).clearCofactor().equals(E.ZERO)}return j._setWindowSize(8),{CURVE:t,getPublicKey:S,sign:O,verify:$,ExtendedPoint:E,utils:{getExtendedPublicKey:M,randomPrivateKey:()=>o(n.BYTES),precompute(z=8,k=E.BASE){return k._setWindowSize(z),k.multiply(BigInt(3)),k}}}}BigInt(0),BigInt(1);const V1=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),r2=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const QN=BigInt(1),s2=BigInt(2);BigInt(3);const ZN=BigInt(5),qN=BigInt(8);function GN(e){const t=BigInt(10),n=BigInt(20),i=BigInt(40),r=BigInt(80),s=V1,o=e*e%s*e%s,c=xi(o,s2,s)*o%s,l=xi(c,QN,s)*e%s,u=xi(l,ZN,s)*l%s,d=xi(u,t,s)*u%s,f=xi(d,n,s)*d%s,m=xi(f,i,s)*f%s,y=xi(m,r,s)*m%s,g=xi(y,r,s)*m%s,p=xi(g,t,s)*u%s;return{pow_p_5_8:xi(p,s2,s)*e%s,b2:o}}function KN(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function JN(e,t){const n=V1,i=vt(t*t*t,n),r=vt(i*i*t,n),s=GN(e*r).pow_p_5_8;let o=vt(e*i*s,n);const c=vt(t*o*o,n),l=o,u=vt(o*r2,n),d=c===e,f=c===vt(-e,n),m=c===vt(-e*r2,n);return d&&(o=l),(f||m)&&(o=u),AN(o,n)&&(o=vt(-o,n)),{isValid:d||f,value:o}}const XN=G5(V1,void 0,!0),eA={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:XN,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:qN,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:xN,randomBytes:W5,adjustScalarBytes:KN,uvRatio:JN},X5=HN(eA),tA="EdDSA",nA="JWT",Ul=".",Zu="base64url",e_="utf8",t_="utf8",iA=":",rA="did",sA="key",o2="base58btc",oA="z",aA="K36",cA=32;function $1(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function n_(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?$1(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function i_(e,t){t||(t=e.reduce((r,s)=>r+s.length,0));const n=n_(t);let i=0;for(const r of e)n.set(r,i),i+=r.length;return $1(n)}function lA(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var r=0;r<e.length;r++){var s=e.charAt(r),o=s.charCodeAt(0);if(n[o]!==255)throw new TypeError(s+" is ambiguous");n[o]=r}var c=e.length,l=e.charAt(0),u=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function f(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new 
292Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var p=0,w=0,x=0,I=g.length;x!==I&&g[x]===0;)x++,p++;for(var E=(I-x)*d+1>>>0,j=new Uint8Array(E);x!==I;){for(var C=g[x],T=0,v=E-1;(C!==0||T<w)&&v!==-1;v--,T++)C+=256*j[v]>>>0,j[v]=C%c>>>0,C=C/c>>>0;if(C!==0)throw new Error("Non-zero carry");w=T,x++}for(var N=E-w;N!==E&&j[N]===0;)N++;for(var M=l.repeat(p);N<E;++N)M+=e.charAt(j[N]);return M}function m(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var p=0;if(g[p]!==" "){for(var w=0,x=0;g[p]===l;)w++,p++;for(var I=(g.length-p)*u+1>>>0,E=new Uint8Array(I);g[p];){var j=n[g.charCodeAt(p)];if(j===255)return;for(var C=0,T=I-1;(j!==0||C<x)&&T!==-1;T--,C++)j+=c*E[T]>>>0,E[T]=j%256>>>0,j=j/256>>>0;if(j!==0)throw new Error("Non-zero carry");x=C,p++}if(g[p]!==" "){for(var v=I-x;v!==I&&E[v]===0;)v++;for(var N=new Uint8Array(w+(I-v)),M=w;v!==I;)N[M++]=E[v++];return N}}}function y(g){var p=m(g);if(p)return p;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:m,decode:y}}var uA=lA,dA=uA;const r_=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},hA=e=>new TextEncoder().encode(e),fA=e=>new TextDecoder().decode(e);let mA=class{constructor(t,n,i){this.name=t,this.prefix=n,this.baseEncode=i}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},yA=class{constructor(t,n,i){if(this.name=t,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return s_(this,t)}},gA=class{constructor(t){this.decoders=t}or(t){return s_(this,t)}decode(t){const n=t[0],i=this.decoders[n];if(i)return i.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const s_=(e,t)=>new gA({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});let pA=class{constructor(t,n,i,r){this.name=t,this.prefix=n,this.baseEncode=i,this.baseDecode=r,this.encoder=new mA(t,n,i),this.decoder=new yA(t,n,r)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};const qu=({name:e,prefix:t,encode:n,decode:i})=>new pA(e,t,n,i),xc=({prefix:e,name:t,alphabet:n})=>{const{encode:i,decode:r}=dA(n,t);return qu({prefix:e,name:t,encode:i,decode:s=>r_(r(s))})},wA=(e,t,n,i)=>{const r={};for(let d=0;d<t.length;++d)r[t[d]]=d;let s=e.length;for(;e[s-1]==="=";)--s;const o=new Uint8Array(s*n/8|0);let c=0,l=0,u=0;for(let d=0;d<s;++d){const f=r[e[d]];if(f===void 0)throw new SyntaxError(`Non-${i} character`);l=l<<n|f,c+=n,c>=8&&(c-=8,o[u++]=255&l>>c)}if(c>=n||255&l<<8-c)throw new SyntaxError("Unexpected end of data");return o},_A=(e,t,n)=>{const i=t[t.length-1]==="=",r=(1<<n)-1;let s="",o=0,c=0;for(let l=0;l<e.length;++l)for(c=c<<8|e[l],o+=8;o>n;)o-=n,s+=t[r&c>>o];if(o&&(s+=t[r&c<<n-o]),i)for(;s.length*n&7;)s+="=";return s},Gt=({name:e,prefix:t,bitsPerChar:n,alphabet:i})=>qu({prefix:t,name:e,encode(r){return _A(r,i,n)},decode(r){return wA(r,i,n,e)}}),bA=qu({prefix:"\0",name:"identity",encode:e=>fA(e),decode:e=>hA(e)});var xA=Object.freeze({__proto__:null,identity:bA});const IA=Gt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var MA=Object.freeze({__proto__:null,base2:IA});const CA=Gt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var EA=Object.freeze({__proto__:null,base8:CA});const TA=xc({prefix:"9",name:"base10",alphabet:"0123456789"});var vA=Object.freeze({__proto__:null,base10:TA});const LA=Gt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),jA=Gt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var SA=Object.freeze({__proto__:null,base16:LA,base16upper:jA});const DA=Gt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),NA=Gt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),AA=Gt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),OA=Gt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),kA=Gt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),zA=Gt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),PA=Gt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),RA=Gt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),UA=Gt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var BA=Object.freeze({__proto__:null,base32:DA,base32upper:NA,base32pad:AA,base32padupper:OA,base32hex:kA,base32hexupper:zA,base32hexpad:PA,base32hexpadupper:RA,base32z:UA});const VA=xc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),$A=xc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var WA=Object.freeze({__proto__:null,base36:VA,base36upper:$A});const FA=xc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),YA=xc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var HA=Object.freeze({__proto__:null,base58btc:FA,base58flickr:YA});const QA=Gt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
292+/",bitsPerChar:6}),ZA=Gt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),qA=Gt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),GA=Gt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var KA=Object.freeze({__proto__:null,base64:QA,base64pad:ZA,base64url:qA,base64urlpad:GA});const o_=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),JA=o_.reduce((e,t,n)=>(e[n]=t,e),[]),XA=o_.reduce((e,t,n)=>(e[t.codePointAt(0)]=n,e),[]);function eO(e){return e.reduce((t,n)=>(t+=JA[n],t),"")}function tO(e){const t=[];for(const n of e){const i=XA[n.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${n}`);t.push(i)}return new Uint8Array(t)}const nO=qu({prefix:"🚀",name:"base256emoji",encode:eO,decode:tO});var iO=Object.freeze({__proto__:null,base256emoji:nO}),rO=a_,a2=128,sO=127,oO=~sO,aO=Math.pow(2,31);function a_(e,t,n){t=t||[],n=n||0;for(var i=n;e>=aO;)t[n++]=e&255|a2,e/=128;for(;e&oO;)t[n++]=e&255|a2,e>>>=7;return t[n]=e|0,a_.bytes=n-i+1,t}var cO=w0,lO=128,c2=127;function w0(e,i){var n=0,i=i||0,r=0,s=i,o,c=e.length;do{if(s>=c)throw w0.bytes=0,new RangeError("Could not decode varint");o=e[s++],n+=r<28?(o&c2)<<r:(o&c2)*Math.pow(2,r),r+=7}while(o>=lO);return w0.bytes=s-i,n}var uO=Math.pow(2,7),dO=Math.pow(2,14),hO=Math.pow(2,21),fO=Math.pow(2,28),mO=Math.pow(2,35),yO=Math.pow(2,42),gO=Math.pow(2,49),pO=Math.pow(2,56),wO=Math.pow(2,63),_O=function(e){return e<uO?1:e<dO?2:e<hO?3:e<fO?4:e<mO?5:e<yO?6:e<gO?7:e<pO?8:e<wO?9:10},bO={encode:rO,decode:cO,encodingLength:_O},c_=bO;const l2=(e,t,n=0)=>(c_.encode(e,t,n),t),u2=e=>c_.encodingLength(e),_0=(e,t)=>{const n=t.byteLength,i=u2(e),r=i+u2(n),s=new Uint8Array(r+n);return l2(e,s,0),l2(n,s,i),s.set(t,r),new xO(e,n,t,s)};let xO=class{constructor(t,n,i,r){this.code=t,this.size=n,this.digest=i,this.bytes=r}};const l_=({name:e,code:t,encode:n})=>new IO(e,t,n);let IO=class{constructor(t,n,i){this.name=t,this.code=n,this.encode=i}digest(t){if(t instanceof Uint8Array){const n=this.encode(t);return n instanceof Uint8Array?_0(this.code,n):n.then(i=>_0(this.code,i))}else throw Error("Unknown type, must be binary type")}};const u_=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),MO=l_({name:"sha2-256",code:18,encode:u_("SHA-256")}),CO=l_({name:"sha2-512",code:19,encode:u_("SHA-512")});var EO=Object.freeze({__proto__:null,sha256:MO,sha512:CO});const d_=0,TO="identity",h_=r_,vO=e=>_0(d_,h_(e)),LO={code:d_,name:TO,encode:h_,digest:vO};var jO=Object.freeze({__proto__:null,identity:LO});new TextEncoder,new TextDecoder;const d2={...xA,...MA,...EA,...vA,...SA,...BA,...WA,...HA,...KA,...iO};({...EO,...jO});function f_(e,t,n,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:i}}}const h2=f_("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),th=f_("ascii","a",e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{e=e.substring(1);const t=n_(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),m_={utf8:h2,"utf-8":h2,hex:d2.base16,latin1:th,ascii:th,binary:th,...d2};function Gu(e,t="utf8"){const n=m_[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}function Vo(e,t="utf8"){const n=m_[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?$1(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}function f2(e){return To(Gu(Vo(e,Zu),e_))}function Bl(e){return Gu(Vo(Ss(e),e_),Zu)}function y_(e){const t=Vo(aA,o2),n=oA+Gu(i_([t,e]),o2);return[rA,sA,n].join(iA)}function SO(e){return Gu(e,Zu)}function DO(e){return Vo(e,Zu)}function NO(e){return Vo([Bl(e.header),Bl(e.payload)].join(Ul),t_)}function AO(e){return[Bl(e.header),Bl(e.payload),SO(e.signature)].join(Ul)}function b0(e){const t=e.split(Ul),n=f2(t[0]),i=f2(t[1]),r=DO(t[2]),s=Vo(t.slice(0,2).join(Ul),t_);return{header:n,payload:i,signature:r,data:s}}function m2(e=W5(cA)){const t=X5.getPublicKey(e);return{secretKey:i_([e,t]),publicKey:t}}async function OO(e,t,n,i,r=te.fromMiliseconds(Date.now())){const s={alg:tA,typ:nA},o=y_(i.publicKey),c=r+n,l={iss:o,sub:e,aud:t,iat:r,exp:c},u=NO({header:s,payload:l}),d=X5.sign(u,i.secretKey.slice(0,32));return AO({header:s,payload:l,signature:d})}var y2=function(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,s;i<r;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},kO=function(){function e(t,n,i){this.name=t,this.version=n,this.os=i,this.type="browser"}return e}(),zO=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=_
292n.platform}return e}(),PO=function(){function e(t,n,i,r){this.name=t,this.version=n,this.os=i,this.bot=r,this.type="bot-device"}return e}(),RO=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),UO=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),BO=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,VO=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,g2=3,$O=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",BO]],p2=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function WO(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new UO:typeof navigator<"u"?YO(navigator.userAgent):QO()}function FO(e){return e!==""&&$O.reduce(function(t,n){var i=n[0],r=n[1];if(t)return t;var s=r.exec(e);return!!s&&[i,s]},!1)}function YO(e){var t=FO(e);if(!t)return null;var n=t[0],i=t[1];if(n==="searchbot")return new RO;var r=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);r?r.length<g2&&(r=y2(y2([],r,!0),ZO(g2-r.length),!0)):r=[];var s=r.join("."),o=HO(e),c=VO.exec(e);return c&&c[1]?new PO(n,s,o,c[1]):new kO(n,s,o)}function HO(e){for(var t=0,n=p2.length;t<n;t++){var i=p2[t],r=i[0],s=i[1],o=s.exec(e);if(o)return r}return null}function QO(){var e=typeof _n<"u"&&_n.version;return e?new zO(_n.version.slice(1)):null}function ZO(e){for(var t=[],n=0;n<e;n++)t.push("0");return t}var tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.getLocalStorage=tt.getLocalStorageOrThrow=tt.getCrypto=tt.getCryptoOrThrow=g_=tt.getLocation=tt.getLocationOrThrow=W1=tt.getNavigator=tt.getNavigatorOrThrow=Ds=tt.getDocument=tt.getDocumentOrThrow=tt.getFromWindowOrThrow=tt.getFromWindow=void 0;function Ys(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}tt.getFromWindow=Ys;function $o(e){const t=Ys(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}tt.getFromWindowOrThrow=$o;function qO(){return $o("document")}tt.getDocumentOrThrow=qO;function GO(){return Ys("document")}var Ds=tt.getDocument=GO;function KO(){return $o("navigator")}tt.getNavigatorOrThrow=KO;function JO(){return Ys("navigator")}var W1=tt.getNavigator=JO;function XO(){return $o("location")}tt.getLocationOrThrow=XO;function ek(){return Ys("location")}var g_=tt.getLocation=ek;function tk(){return $o("crypto")}tt.getCryptoOrThrow=tk;function nk(){return Ys("crypto")}tt.getCrypto=nk;function ik(){return $o("localStorage")}tt.getLocalStorageOrThrow=ik;function rk(){return Ys("localStorage")}tt.getLocalStorage=rk;var F1={};Object.defineProperty(F1,"__esModule",{value:!0});var p_=F1.getWindowMetadata=void 0;const w2=tt;function sk(){let e,t;try{e=w2.getDocumentOrThrow(),t=w2.getLocationOrThrow()}catch{return null}function n(){const f=e.getElementsByTagName("link"),m=[];for(let y=0;y<f.length;y++){const g=f[y],p=g.getAttribute("rel");if(p&&p.toLowerCase().indexOf("icon")>-1){const w=g.getAttribute("href");if(w)if(w.toLowerCase().indexOf("https:")===-1&&w.toLowerCase().indexOf("http:")===-1&&w.indexOf("//")!==0){let x=t.protocol+"//"+t.host;if(w.indexOf("/")===0)x+=w;else{const I=t.pathname.split("/");I.pop();const E=I.join("/");x+=E+"/"+w}m.push(x)}else if(w.indexOf("//")===0){const x=t.protocol+w;m.push(x)}else m.push(w)}}return m}function i(...f){const m=e.getElementsByTagName("meta");for(let y=0;y<m.length;y++){const g=m[y],p=["itemprop","property","name"].map(w=>g.getAttribute(w)).filter(w=>w?f.includes(w):!1);if(p.length&&p){const w=g.getAttribute("content");
292if(w)return w}}return""}function r(){let f=i("name","og:site_name","og:title","twitter:title");return f||(f=e.title),f}function s(){return i("description","og:description","twitter:description","keywords")}const o=r(),c=s(),l=t.origin,u=n();return{description:c,url:l,icons:u,name:o}}p_=F1.getWindowMetadata=sk;function Ya(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function x0(e){return Ya(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const w_="2.31.0";let na={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${w_}`};class Ns extends Error{constructor(t,n={}){var c;const i=(()=>{var l;return n.cause instanceof Ns?n.cause.details:(l=n.cause)!=null&&l.message?n.cause.message:n.details})(),r=n.cause instanceof Ns&&n.cause.docsPath||n.docsPath,s=(c=na.getDocsUrl)==null?void 0:c.call(na,{...n,docsPath:r}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...i?[`Details: ${i}`]:[],...na.version?[`Version: ${na.version}`]:[]].join(`
293`);super(o,n.cause?{cause:n.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=i,this.docsPath=r,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=w_}walk(t){return __(this,t)}}function __(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?__(e.cause,t):t?null:e}class b_ extends Ns{constructor({size:t,targetSize:n,type:i}){super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function Wo(e,{dir:t,size:n=32}={}){return typeof e=="string"?ok(e,{dir:t,size:n}):ak(e,{dir:t,size:n})}function ok(e,{dir:t,size:n=32}={}){if(n===null)return e;const i=e.replace("0x","");if(i.length>n*2)throw new b_({size:Math.ceil(i.length/2),targetSize:n,type:"hex"});return`0x${i[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function ak(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new b_({size:e.length,targetSize:n,type:"bytes"});const i=new Uint8Array(n);for(let r=0;r<n;r++){const s=t==="right";i[s?r:n-r-1]=e[s?r:e.length-r-1]}return i}class ck extends Ns{constructor({max:t,min:n,signed:i,size:r,value:s}){super(`Number "${s}" is not in safe ${r?`${r*8}-bit ${i?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class lk extends Ns{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function Fo(e,{size:t}){if(x0(e)>t)throw new lk({givenSize:x0(e),maxSize:t})}function I0(e,t={}){const{signed:n}=t;t.size&&Fo(e,{size:t.size});const i=BigInt(e);if(!n)return i;const r=(e.length-2)/2,s=(1n<<BigInt(r)*8n-1n)-1n;return i<=s?i:i-BigInt(`0x${"f".padStart(r*2,"f")}`)-1n}function uk(e,t={}){return Number(I0(e,t))}const dk=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function M0(e,t={}){return typeof e=="number"||typeof e=="bigint"?I_(e,t):typeof e=="string"?mk(e,t):typeof e=="boolean"?hk(e,t):x_(e,t)}function hk(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Fo(n,{size:t.size}),Wo(n,{size:t.size})):n}function x_(e,t={}){let n="";for(let r=0;r<e.length;r++)n+=dk[e[r]];const i=`0x${n}`;return typeof t.size=="number"?(Fo(i,{size:t.size}),Wo(i,{dir:"right",size:t.size})):i}function I_(e,t={}){const{signed:n,size:i}=t,r=BigInt(e);let s;
293i?n?s=(1n<<BigInt(i)*8n-1n)-1n:s=2n**(BigInt(i)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&n?-s-1n:0;if(s&&r>s||r<o){const l=typeof e=="bigint"?"n":"";throw new ck({max:s?`${s}${l}`:void 0,min:`${o}${l}`,signed:n,size:i,value:`${e}${l}`})}const c=`0x${(n&&r<0?(1n<<BigInt(i*8))+BigInt(r):r).toString(16)}`;return i?Wo(c,{size:i}):c}const fk=new TextEncoder;function mk(e,t={}){const n=fk.encode(e);return x_(n,t)}const yk=new TextEncoder;function gk(e,t={}){return typeof e=="number"||typeof e=="bigint"?wk(e,t):typeof e=="boolean"?pk(e,t):Ya(e)?M_(e,t):C_(e,t)}function pk(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(Fo(n,{size:t.size}),Wo(n,{size:t.size})):n}const Hi={zero:48,nine:57,A:65,F:70,a:97,f:102};function _2(e){if(e>=Hi.zero&&e<=Hi.nine)return e-Hi.zero;if(e>=Hi.A&&e<=Hi.F)return e-(Hi.A-10);if(e>=Hi.a&&e<=Hi.f)return e-(Hi.a-10)}function M_(e,t={}){let n=e;t.size&&(Fo(n,{size:t.size}),n=Wo(n,{dir:"right",size:t.size}));let i=n.slice(2);i.length%2&&(i=`0${i}`);const r=i.length/2,s=new Uint8Array(r);for(let o=0,c=0;o<r;o++){const l=_2(i.charCodeAt(c++)),u=_2(i.charCodeAt(c++));if(l===void 0||u===void 0)throw new Ns(`Invalid byte sequence ("${i[c-2]}${i[c-1]}" in "${i}").`);s[o]=l*16+u}return s}function wk(e,t){const n=I_(e,t);return M_(n)}function C_(e,t={}){const n=yk.encode(e);return typeof t.size=="number"?(Fo(n,{size:t.size}),Wo(n,{dir:"right",size:t.size})):n}const Fc=BigInt(2**32-1),b2=BigInt(32);function _k(e,t=!1){return t?{h:Number(e&Fc),l:Number(e>>b2&Fc)}:{h:Number(e>>b2&Fc)|0,l:Number(e&Fc)|0}}function bk(e,t=!1){const n=e.length;let i=new Uint32Array(n),r=new Uint32Array(n);for(let s=0;s<n;s++){const{h:o,l:c}=_k(e[s],t);[i[s],r[s]]=[o,c]}return[i,r]}const xk=(e,t,n)=>e<<n|t>>>32-n,Ik=(e,t,n)=>t<<n|e>>>32-n,Mk=(e,t,n)=>t<<n-32|e>>>64-n,Ck=(e,t,n)=>e<<n-32|t>>>64-n,eo=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ek(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Vl(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ha(e,...t){if(!Ek(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function bG(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Vl(e.outputLen),Vl(e.blockLen)}function x2(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Tk(e,t){Ha(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function vk(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function E_(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function xG(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function IG(e,t){return e<<32-t|e>>>t}const Lk=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function jk(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Sk(e){for(let t=0;t<e.length;t++)e[t]=jk(e[t]);return e}const I2=Lk?e=>e:Sk;function Dk(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function T_(e){return typeof e=="string"&&(e=Dk(e)),Ha(e),e}function MG(...e){let t=0;for(let i=0;i<e.length;i++){const r=e[i];Ha(r),t+=r.length}const n=new Uint8Array(t);for(let i=0,r=0;i<e.length;i++){const s=e[i];n.set(s,r),r+=s.length}return n}class Nk{}function Ak(e){const t=i=>e().update(T_(i)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function CG(e=32){if(eo&&typeof eo.getRandomValues=="function")return eo.getRandomValues(new Uint8Array(e));if(eo&&typeof eo.randomBytes=="function")return Uint8Array.from(eo.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}
293const Ok=BigInt(0),ia=BigInt(1),kk=BigInt(2),zk=BigInt(7),Pk=BigInt(256),Rk=BigInt(113),v_=[],L_=[],j_=[];for(let e=0,t=ia,n=1,i=0;e<24;e++){[n,i]=[i,(2*n+3*i)%5],v_.push(2*(5*i+n)),L_.push((e+1)*(e+2)/2%64);let r=Ok;for(let s=0;s<7;s++)t=(t<<ia^(t>>zk)*Rk)%Pk,t&kk&&(r^=ia<<(ia<<BigInt(s))-ia);j_.push(r)}const S_=bk(j_,!0),Uk=S_[0],Bk=S_[1],M2=(e,t,n)=>n>32?Mk(e,t,n):xk(e,t,n),C2=(e,t,n)=>n>32?Ck(e,t,n):Ik(e,t,n);function Vk(e,t=24){const n=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const c=(o+8)%10,l=(o+2)%10,u=n[l],d=n[l+1],f=M2(u,d,1)^n[c],m=C2(u,d,1)^n[c+1];for(let y=0;y<50;y+=10)e[o+y]^=f,e[o+y+1]^=m}let r=e[2],s=e[3];for(let o=0;o<24;o++){const c=L_[o],l=M2(r,s,c),u=C2(r,s,c),d=v_[o];r=e[d],s=e[d+1],e[d]=l,e[d+1]=u}for(let o=0;o<50;o+=10){for(let c=0;c<10;c++)n[c]=e[o+c];for(let c=0;c<10;c++)e[o+c]^=~n[(c+2)%10]&n[(c+4)%10]}e[0]^=Uk[i],e[1]^=Bk[i]}E_(n)}class Y1 extends Nk{constructor(t,n,i,r=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=i,this.enableXOF=r,this.rounds=s,Vl(i),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=vk(this.state)}clone(){return this._cloneInto()}keccak(){I2(this.state32),Vk(this.state32,this.rounds),I2(this.state32),this.posOut=0,this.pos=0}update(t){x2(this),t=T_(t),Ha(t);const{blockLen:n,state:i}=this,r=t.length;for(let s=0;s<r;){const o=Math.min(n-this.pos,r-s);for(let c=0;c<o;c++)i[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:i,blockLen:r}=this;t[i]^=n,n&128&&i===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){x2(this,!1),Ha(t),this.finish();const n=this.state,{blockLen:i}=this;for(let r=0,s=t.length;r<s;){this.posOut>=i&&this.keccak();const o=Math.min(i-this.posOut,s-r);t.set(n.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Vl(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Tk(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,E_(this.state)}_cloneInto(t){const{blockLen:n,suffix:i,outputLen:r,rounds:s,enableXOF:o}=this;return t||(t=new Y1(n,i,r,o,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=i,t.outputLen=r,t.enableXOF=o,t.destroyed=this.destroyed,t}}const $k=(e,t,n)=>Ak(()=>new Y1(t,e,n)),Wk=$k(1,136,256/8);function D_(e,t){const n=t||"hex",i=Wk(Ya(e,{strict:!1})?gk(e):e);return n==="bytes"?i:M0(i)}class Fk extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const i=this.keys().next().value;i&&this.delete(i)}return this}}const nh=new Fk(8192);function Yk(e,t){if(nh.has(`${e}.${t}`))return nh.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),i=D_(C_(n),"bytes"),r=n.split("");for(let o=0;o<40;o+=2)i[o>>1]>>4>=8&&r[o]&&(r[o]=r[o].toUpperCase()),(i[o>>1]&15)>=8&&r[o+1]&&(r[o+1]=r[o+1].toUpperCase());const s=`0x${r.join("")}`;return nh.set(`${e}.${t}`,s),s}function Hk(e){const t=D_(`0x${e.substring(4)}`).substring(26);return Yk(`0x${t}`)}async function Qk({hash:e,signature:t}){const n=Ya(e)?e:M0(e),{secp256k1:i}=await h(async()=>{const{secp256k1:o}=await import("./secp256k1-CI6YikNH.js");return{secp256k1:o}},__vite__mapDeps([48,3,7,4,6,8,9,10,5,2,1,11,12,13,14,15]));return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:d,v:f,yParity:m}=t,y=Number(m??f),g=E2(y);return new i.Signature(I0(u),I0(d)).addRecoveryBit(g)}const o=Ya(t)?t:M0(t);if(x0(o)!==65)throw new Error("invalid signature length");const c=uk(`0x${o.slice(130)}`),l=E2(c);return i.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function E2(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function Zk({hash:e,signature:t}){return Hk(await Qk({hash:e,signature:t}))}function qk(e){if(e.length>=255)throw new TypeError("Alphabet too long");const t=new Uint8Array(256);for(let u=0;u<t.length;u++)t[u]=255;for(let u=0;u<e.length;
293u++){const d=e.charAt(u),f=d.charCodeAt(0);if(t[f]!==255)throw new TypeError(d+" is ambiguous");t[f]=u}const n=e.length,i=e.charAt(0),r=Math.log(n)/Math.log(256),s=Math.log(256)/Math.log(n);function o(u){if(u instanceof Uint8Array||(ArrayBuffer.isView(u)?u=new Uint8Array(u.buffer,u.byteOffset,u.byteLength):Array.isArray(u)&&(u=Uint8Array.from(u))),!(u instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(u.length===0)return"";let d=0,f=0,m=0;const y=u.length;for(;m!==y&&u[m]===0;)m++,d++;const g=(y-m)*s+1>>>0,p=new Uint8Array(g);for(;m!==y;){let I=u[m],E=0;for(let j=g-1;(I!==0||E<f)&&j!==-1;j--,E++)I+=256*p[j]>>>0,p[j]=I%n>>>0,I=I/n>>>0;if(I!==0)throw new Error("Non-zero carry");f=E,m++}let w=g-f;for(;w!==g&&p[w]===0;)w++;let x=i.repeat(d);for(;w<g;++w)x+=e.charAt(p[w]);return x}function c(u){if(typeof u!="string")throw new TypeError("Expected String");if(u.length===0)return new Uint8Array;let d=0,f=0,m=0;for(;u[d]===i;)f++,d++;const y=(u.length-d)*r+1>>>0,g=new Uint8Array(y);for(;d<u.length;){const I=u.charCodeAt(d);if(I>255)return;let E=t[I];if(E===255)return;let j=0;for(let C=y-1;(E!==0||j<m)&&C!==-1;C--,j++)E+=n*g[C]>>>0,g[C]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");m=j,d++}let p=y-m;for(;p!==y&&g[p]===0;)p++;const w=new Uint8Array(f+(y-p));let x=f;for(;p!==y;)w[x++]=g[p++];return w}function l(u){const d=c(u);if(d)return d;throw new Error("Non-base"+n+" character")}return{encode:o,decodeUnsafe:c,decode:l}}var Gk="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const Ic=qk(Gk);function Kk(e){const t=e.length;let n=0,i=0;for(;i<t;){let r=e.charCodeAt(i++);if(r&4294967168)if(!(r&4294965248))n+=2;else{if(r>=55296&&r<=56319&&i<t){const s=e.charCodeAt(i);(s&64512)===56320&&(++i,r=((r&1023)<<10)+(s&1023)+65536)}r&4294901760?n+=4:n+=3}else{n++;continue}}return n}function Jk(e,t,n){const i=e.length;let r=n,s=0;for(;s<i;){let o=e.charCodeAt(s++);if(o&4294967168)if(!(o&4294965248))t[r++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<i){const c=e.charCodeAt(s);(c&64512)===56320&&(++s,o=((o&1023)<<10)+(c&1023)+65536)}o&4294901760?(t[r++]=o>>18&7|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128):(t[r++]=o>>12&15|224,t[r++]=o>>6&63|128)}else{t[r++]=o;continue}t[r++]=o&63|128}}const Xk=new TextEncoder,ez=50;function tz(e,t,n){Xk.encodeInto(e,t.subarray(n))}function nz(e,t,n){e.length>
293ez?tz(e,t,n):Jk(e,t,n)}const iz=4096;function N_(e,t,n){let i=t;const r=i+n,s=[];let o="";for(;i<r;){const c=e[i++];if(!(c&128))s.push(c);else if((c&224)===192){const l=e[i++]&63;s.push((c&31)<<6|l)}else if((c&240)===224){const l=e[i++]&63,u=e[i++]&63;s.push((c&31)<<12|l<<6|u)}else if((c&248)===240){const l=e[i++]&63,u=e[i++]&63,d=e[i++]&63;let f=(c&7)<<18|l<<12|u<<6|d;f>65535&&(f-=65536,s.push(f>>>10&1023|55296),f=56320|f&1023),s.push(f)}else s.push(c);s.length>=iz&&(o+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(o+=String.fromCharCode(...s)),o}const rz=new TextDecoder,sz=200;function oz(e,t,n){const i=e.subarray(t,t+n);return rz.decode(i)}function az(e,t,n){return n>sz?oz(e,t,n):N_(e,t,n)}class Yc{constructor(t,n){this.type=t,this.data=n}}class $n extends Error{constructor(t){super(t);const n=Object.create($n.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:$n.name})}}const ra=4294967295;function cz(e,t,n){const i=n/4294967296,r=n;e.setUint32(t,i),e.setUint32(t+4,r)}function A_(e,t,n){const i=Math.floor(n/4294967296),r=n;e.setUint32(t,i),e.setUint32(t+4,r)}function O_(e,t){const n=e.getInt32(t),i=e.getUint32(t+4);return n*4294967296+i}function lz(e,t){const n=e.getUint32(t),i=e.getUint32(t+4);return n*4294967296+i}const uz=-1,dz=4294967296-1,hz=17179869184-1;function fz({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=hz)if(t===0&&e<=dz){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e),n}else{const n=e/4294967296,i=e&4294967295,r=new Uint8Array(8),s=new DataView(r.buffer);return s.setUint32(0,t<<2|n&3),s.setUint32(4,i),r}else{const n=new Uint8Array(12),i=new DataView(n.buffer);return i.setUint32(0,t),A_(i,4,e),n}}function mz(e){const t=e.getTime(),n=Math.floor(t/1e3),i=(t-n*1e3)*1e6,r=Math.floor(i/1e9);return{sec:n+r,nsec:i-r*1e9}}function yz(e){if(e instanceof Date){const t=mz(e);return fz(t)}else return null}function gz(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const n=t.getUint32(0),i=t.getUint32(4),r=(n&3)*4294967296+i,s=n>>>2;return{sec:r,nsec:s}}case 12:{const n=O_(t,4),i=t.getUint32(0);return{sec:n,nsec:i}}default:throw new $n(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}function pz(e){const t=gz(e);return new Date(t.sec*1e3+t.nsec/1e6)}const wz={type:uz,encode:yz,decode:pz};class $l{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(wz)}register({type:t,encode:n,decode:i}){if(t>=0)this.encoders[t]=n,this.decoders[t]=i;else{const r=-1-t;this.builtInEncoders[r]=n,this.builtInDecoders[r]=i}}tryToEncode(t,n){for(let i=0;i<this.builtInEncoders.length;i++){const r=this.builtInEncoders[i];if(r!=null){const s=r(t,n);if(s!=null){const o=-1-i;return new Yc(o,s)}}}for(let i=0;i<this.encoders.length;i++){const r=this.encoders[i];if(r!=null){const s=r(t,n);if(s!=null){const o=i;return new Yc(o,s)}}}return t instanceof Yc?t:null}decode(t,n,i){const r=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return r?r(t,n,i):new Yc(n,t)}}$l.defaultCodec=new $l;function _z(e){return e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function C0(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):_z(e)?new Uint8Array(e):Uint8Array.from(e)}const bz=100,xz=2048;let Iz=class k_{constructor(t){this.entered=!1,this.extensionCodec=(t==null?void 0:t.extensionCodec)??$l.defaultCodec,this.context=t==null?void 0:t.context,this.useBigInt64=(t==null?void 0:t.useBigInt64)??!1,this.maxDepth=(t==null?void 0:t.maxDepth)??bz,this.initialBufferSize=(t==null?void 0:t.initialBufferSize)??xz,this.sortKeys=(t==null?void 0:t.sortKeys)??!1,this.forceFloat32=(t==null?void 0:t.forceFloat32)??!1,this.ignoreUndefined=(t==null?void 0:t.ignoreUndefined)??!1,this.forceIntegerToFloat=(t==null?void 0:t.forceIntegerToFloat)??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new k_({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(t){if(this.entered)return this.clone().encodeSharedRef(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(t){if(this.entered)return this.clone().encode(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(t,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);t==null?this.encodeNil():typeof t=="boolean"?this.encodeBoolean(t):typeof t=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(t):this.encodeNumber(t):typeof t=="string"?this.encodeString(t):this.useBigInt64&&typeof t=="bigint"?this.encodeBigInt64(t):this.encodeObject(t,n)}ensureBufferSizeToWrite(t){const n=this.pos+t;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(t){const n=new ArrayBuffer(t),i=new Uint8Array(n),r=new DataView(n);i.set(this.bytes),this.view=r,this.bytes=i}encodeNil(){this.writeU8(192)}encodeBoolean(t){t===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(t){!this.forceIntegerToFloat&&Number.isSafeInteger(t)?t>=0?t<128?this.writeU8(t):t<256?(this.writeU8(204),this.writeU8(t)):t<65536?(this.writeU8(205),this.writeU16(t)):t<4294967296?(this.writeU8(206),this.writeU32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(207),this.writeU64(t)):t>=-32?this.writeU8(224|t+32):t>=-128?(this.writeU8(208),this.writeI8(t)):t>
293=-32768?(this.writeU8(209),this.writeI16(t)):t>=-2147483648?(this.writeU8(210),this.writeI32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(211),this.writeI64(t)):this.encodeNumberAsFloat(t)}encodeNumberAsFloat(t){this.forceFloat32?(this.writeU8(202),this.writeF32(t)):(this.writeU8(203),this.writeF64(t))}encodeBigInt64(t){t>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(t)):(this.writeU8(211),this.writeBigInt64(t))}writeStringHeader(t){if(t<32)this.writeU8(160+t);else if(t<256)this.writeU8(217),this.writeU8(t);else if(t<65536)this.writeU8(218),this.writeU16(t);else if(t<4294967296)this.writeU8(219),this.writeU32(t);else throw new Error(`Too long string: ${t} bytes in UTF-8`)}encodeString(t){const i=Kk(t);this.ensureBufferSizeToWrite(5+i),this.writeStringHeader(i),nz(t,this.bytes,this.pos),this.pos+=i}encodeObject(t,n){const i=this.extensionCodec.tryToEncode(t,this.context);if(i!=null)this.encodeExtension(i);else if(Array.isArray(t))this.encodeArray(t,n);else if(ArrayBuffer.isView(t))this.encodeBinary(t);else if(typeof t=="object")this.encodeMap(t,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(t)}`)}encodeBinary(t){const n=t.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const i=C0(t);this.writeU8a(i)}encodeArray(t,n){const i=t.length;if(i<16)this.writeU8(144+i);else if(i<65536)this.writeU8(220),this.writeU16(i);else if(i<4294967296)this.writeU8(221),this.writeU32(i);else throw new Error(`Too large array: ${i}`);for(const r of t)this.doEncode(r,n+1)}countWithoutUndefined(t,n){let i=0;for(const r of n)t[r]!==void 0&&i++;return i}encodeMap(t,n){const i=Object.keys(t);this.sortKeys&&i.sort();const r=this.ignoreUndefined?this.countWithoutUndefined(t,i):i.length;if(r<16)this.writeU8(128+r);else if(r<65536)this.writeU8(222),this.writeU16(r);else if(r<4294967296)this.writeU8(223),this.writeU32(r);else throw new Error(`Too large map object: ${r}`);for(const s of i){const o=t[s];this.ignoreUndefined&&o===void 0||(this.encodeString(s),this.doEncode(o,n+1))}}encodeExtension(t){if(typeof t.data=="function"){const i=t.data(this.pos+6),r=i.length;if(r>=4294967296)throw new Error(`Too large extension object: ${r}`);this.writeU8(201),this.writeU32(r),this.writeI8(t.type),this.writeU8a(i);return}const n=t.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(t.type),this.writeU8a(t.data)}writeU8(t){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,t),this.pos++}writeU8a(t){const n=t.length;this.ensureBufferSizeToWrite(n),this.bytes.set(t,this.pos),this.pos+=n}writeI8(t){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,t),this.pos++}writeU16(t){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,t),this.pos+=2}writeI16(t){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,t),this.pos+=2}writeU32(t){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,t),this.pos+=4}writeI32(t){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,t),this.pos+=4}writeF32(t){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,t),this.pos+=4}writeF64(t){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,t),this.pos+=8}writeU64(t){this.ensureBufferSizeToWrite(8),cz(this.view,this.pos,t),this.pos+=8}writeI64(t){this.ensureBufferSizeToWrite(8),A_(this.view,this.pos,t),this.pos+=8}writeBigUint64(t){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,t),this.pos+=8}writeBigInt64(t){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,t),this.pos+=8}};function Mz(e,t){return new Iz(t).encodeSharedRef(e)}function ih(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}const Cz=16,Ez=16;class Tz{constructor(t=Cz,n=Ez){this.hit=0,this.miss=0,this.maxKeyLength=t,this.maxLengthPerKey=n,this.caches=[];for(let i=0;i<this.maxKeyLength;i++)this.caches.push([])}canBeCached(t){return t>0&&t<=this.maxKeyLength}find(t,n,i){const r=this.caches[i-1];e:for(const s of r){const o=s.bytes;for(let c=0;c<i;c++)if(o[c]!==t[n+c])continue e;return s.str}return null}store(t,n){const i=this.caches[t.length-1],r={bytes:t,str:n};i.length>=this.maxLengthPerKey?i[Math.random()*i.length|0]=r:i.push(r)}decode(t,n,i){const r=this.find(t,n,i);if(r!=null)return this.hit++,r;this.miss++;const s=N_(t,n,i),o=Uint8Array.prototype.slice.call(t,n,n+i);return this.store(o,s),s}}const E0="array",Ta="map_key",z_="map_value",vz=e=>{if(typeof e=="string"||typeof e=="number")return e;throw new $n("The type of key must be string or number but "+typeof e)};class Lz{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(t){const n=this.getUninitializedStateFromPool();n.type=E0,n.position=0,n.size=t,n.array=new Array(t)}pushMapState(t){const n=this.getUninitializedStateFromPool();n.type=Ta,n.readCount=0,n.size=t,n.map={}}
293getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const t={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(t)}return this.stack[this.stackHeadPosition]}release(t){if(this.stack[this.stackHeadPosition]!==t)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(t.type===E0){const i=t;i.size=0,i.array=void 0,i.position=0,i.type=void 0}if(t.type===Ta||t.type===z_){const i=t;i.size=0,i.map=void 0,i.readCount=0,i.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const sa=-1,H1=new DataView(new ArrayBuffer(0)),jz=new Uint8Array(H1.buffer);try{H1.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const T2=new RangeError("Insufficient data"),Sz=new Tz;let Dz=class P_{constructor(t){this.totalPos=0,this.pos=0,this.view=H1,this.bytes=jz,this.headByte=sa,this.stack=new Lz,this.entered=!1,this.extensionCodec=(t==null?void 0:t.extensionCodec)??$l.defaultCodec,this.context=t==null?void 0:t.context,this.useBigInt64=(t==null?void 0:t.useBigInt64)??!1,this.rawStrings=(t==null?void 0:t.rawStrings)??!1,this.maxStrLength=(t==null?void 0:t.maxStrLength)??ra,this.maxBinLength=(t==null?void 0:t.maxBinLength)??ra,this.maxArrayLength=(t==null?void 0:t.maxArrayLength)??ra,this.maxMapLength=(t==null?void 0:t.maxMapLength)??ra,this.maxExtLength=(t==null?void 0:t.maxExtLength)??ra,this.keyDecoder=(t==null?void 0:t.keyDecoder)!==void 0?t.keyDecoder:Sz,this.mapKeyConverter=(t==null?void 0:t.mapKeyConverter)??vz}clone(){return new P_({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=sa,this.stack.reset()}setBuffer(t){const n=C0(t);this.bytes=n,this.view=new DataView(n.buffer,n.byteOffset,n.byteLength),this.pos=0}appendBuffer(t){if(this.headByte===sa&&!this.hasRemaining(1))this.setBuffer(t);else{const n=this.bytes.subarray(this.pos),i=C0(t),r=new Uint8Array(n.length+i.length);r.set(n),r.set(i,n.length),this.setBuffer(r)}}hasRemaining(t){return this.view.byteLength-this.pos>=t}createExtraByteError(t){const{view:n,pos:i}=this;return new RangeError(`Extra ${n.byteLength-i} of ${n.byteLength} byte(s) found at buffer[${t}]`)}decode(t){if(this.entered)return this.clone().decode(t);try{this.entered=!0,this.reinitializeState(),this.setBuffer(t);const n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n}finally{this.entered=!1}}*decodeMulti(t){if(this.entered){yield*this.clone().decodeMulti(t);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(t);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(t){if(this.entered)return this.clone().decodeAsync(t);try{this.entered=!0;let n=!1,i;for await(const c of t){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(c);try{i=this.doDecodeSync(),n=!0}catch(l){if(!(l instanceof RangeError))throw l}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return i}const{headByte:r,pos:s,totalPos:o}=this;throw new RangeError(`Insufficient data in parsing ${ih(r)} at ${o} (${s} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(t){return this.decodeMultiAsync(t,!0)}decodeStream(t){return this.decodeMultiAsync(t,!1)}async*decodeMultiAsync(t,n){if(this.entered){yield*this.clone().decodeMultiAsync(t,n);return}try{this.entered=!0;let i=n,r=-1;for await(const s of t){if(n&&r===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),i&&(r=this.readArraySize(),i=!1,this.complete());try{for(;yield this.doDecodeSync(),--r!==0;);}catch(o){if(!(o instanceof RangeError))throw o}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const t=this.readHeadByte();let n;if(t>=224)n=t-256;else if(t<192)if(t<128)n=t;else if(t<144){const r=t-128;if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(t<160){const r=t-144;if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else{const r=t-160;n=this.decodeString(r,0)}else if(t===192)n=null;else if(t===194)n=!1;else if(t===195)n=!0;else if(t===202)n=this.readF32();else if(t===203)n=this.readF64();else if(t===204)n=this.readU8();else if(t===205)n=this.readU16();else if(t===206)n=this.readU32();else if(t===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(t===208)n=this.readI8();else if(t===209)n=this.readI16();else if(t===210)n=this.readI32();else if(t===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(t===217){const r=this.lookU8();n=this.decodeString(r,1)}else if(t===218){const r=this.lookU16();n=this.decodeString(r,2)}else if(t===219){const r=this.lookU32();n=this.decodeString(r,4)}else if(t===220){const r=this.readU16();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(t===221){const r=this.readU32();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(t===222){const r=this.readU16();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(t===223){const r=this.readU32();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(t===196){const r=this.lookU8();n=this.decodeBinary(r,1)}else if(t===197){const r=this.lookU16();n=this.decodeBinary(r,2)}else if(t===198){const r=this.lookU32();n=this.decodeBinary(r,4)}else if(t===212)n=this.decodeExtension(1,0);else if(t===213)n=this.decodeExtension(2,0);else if(t===214)n=this.decodeExtension(4,0);else if(t===215)n=this.decodeExtension(8,0);else if(t===216)n=this.decodeExtension(16,0);else if(t===199){const r=this.lookU8();n=this.decodeExtension(r,1)}else if(t===200){const r=this.lookU16();n=this.decodeExtension(r,2)}else if(t===201){const r=this.lookU32();n=this.decodeExtension(r,4)}else throw new $n(`Unrecognized type byte: ${ih(t)}`);this.complete();const i=this.stack;for(;i.length>0;){const r=i.top();if(r.type===E0)if(r.array[r.position]=n,r.position++,r.position===r.size)n=r.array,i.release(r);else continue e;else if(r.type===Ta){if(n==="__proto__")throw new $n("The key __proto__ is not allowed");r.key=this.mapKeyConverter(n),r.type=z_;continue e}else if(r.map[r.key]=n,r.readCount++,r.readCount===r.size)n=r.map,i.release(r);else{r.key=null,r.type=Ta;continue e}}return n}}readHeadByte(){return this.headByte===sa&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=sa}readArraySize(){const t=this.readHeadByte();switch(t){case 220:return this.readU16();case 221:return this.readU32();
293default:{if(t<160)return t-144;throw new $n(`Unrecognized array type byte: ${ih(t)}`)}}}pushMapState(t){if(t>this.maxMapLength)throw new $n(`Max length exceeded: map length (${t}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(t)}pushArrayState(t){if(t>this.maxArrayLength)throw new $n(`Max length exceeded: array length (${t}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(t)}decodeString(t,n){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(t,n):this.decodeBinary(t,n)}decodeUtf8String(t,n){var s;if(t>this.maxStrLength)throw new $n(`Max length exceeded: UTF-8 byte length (${t}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+n+t)throw T2;const i=this.pos+n;let r;return this.stateIsMapKey()&&((s=this.keyDecoder)!=null&&s.canBeCached(t))?r=this.keyDecoder.decode(this.bytes,i,t):r=az(this.bytes,i,t),this.pos+=n+t,r}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===Ta:!1}decodeBinary(t,n){if(t>this.maxBinLength)throw new $n(`Max length exceeded: bin length (${t}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(t+n))throw T2;const i=this.pos+n,r=this.bytes.subarray(i,i+t);return this.pos+=n+t,r}decodeExtension(t,n){if(t>this.maxExtLength)throw new $n(`Max length exceeded: ext length (${t}) > maxExtLength (${this.maxExtLength})`);const i=this.view.getInt8(this.pos+n),r=this.decodeBinary(t,n+1);return this.extensionCodec.decode(r,i,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const t=this.view.getUint8(this.pos);return this.pos++,t}readI8(){const t=this.view.getInt8(this.pos);return this.pos++,t}readU16(){const t=this.view.getUint16(this.pos);return this.pos+=2,t}readI16(){const t=this.view.getInt16(this.pos);return this.pos+=2,t}readU32(){const t=this.view.getUint32(this.pos);return this.pos+=4,t}readI32(){const t=this.view.getInt32(this.pos);return this.pos+=4,t}readU64(){const t=lz(this.view,this.pos);return this.pos+=8,t}readI64(){const t=O_(this.view,this.pos);return this.pos+=8,t}readU64AsBigInt(){const t=this.view.getBigUint64(this.pos);return this.pos+=8,t}readI64AsBigInt(){const t=this.view.getBigInt64(this.pos);return this.pos+=8,t}readF32(){const t=this.view.getFloat32(this.pos);return this.pos+=4,t}readF64(){const t=this.view.getFloat64(this.pos);return this.pos+=8,t}};function Nz(e,t){return new Dz(t).decode(e)}function Q1(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function R_(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Q1(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function va(e,t){t||(t=e.reduce((r,s)=>r+s.length,0));const n=R_(t);let i=0;for(const r of e)n.set(r,i),i+=r.length;return Q1(n)}function Az(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var r=0;r<e.length;r++){var s=e.charAt(r),o=s.charCodeAt(0);if(n[o]!==255)throw new TypeError(s+" is ambiguous");n[o]=r}var c=e.length,l=e.charAt(0),u=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function f(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var p=0,w=0,x=0,I=g.length;x!==I&&g[x]===0;)x++,p++;for(var E=(I-x)*d+1>>>0,j=new Uint8Array(E);x!==I;){for(var C=g[x],T=0,v=E-1;(C!==0||T<w)&&v!==-1;v--,T++)C+=256*j[v]>>>0,j[v]=C%c>>>0,C=C/c>>>0;if(C!==0)throw new Error("Non-zero carry");w=T,x++}for(var N=E-w;N!==E&&j[N]===0;)N++;for(var M=l.repeat(p);N<E;++N)M+=e.charAt(j[N]);return M}function m(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var p=0;if(g[p]!==" "){for(var w=0,x=0;g[p]===l;)w++,p++;for(var I=(g.length-p)*u+1>>>0,E=new Uint8Array(I);g[p];){var j=n[g.charCodeAt(p)];if(j===255)return;for(var C=0,T=I-1;(j!==0||C<x)&&T!==-1;T--,C++)j+=c*E[T]>
293>>0,E[T]=j%256>>>0,j=j/256>>>0;if(j!==0)throw new Error("Non-zero carry");x=C,p++}if(g[p]!==" "){for(var v=I-x;v!==I&&E[v]===0;)v++;for(var N=new Uint8Array(w+(I-v)),M=w;v!==I;)N[M++]=E[v++];return N}}}function y(g){var p=m(g);if(p)return p;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:m,decode:y}}var Oz=Az,kz=Oz;const zz=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Pz=e=>new TextEncoder().encode(e),Rz=e=>new TextDecoder().decode(e);class Uz{constructor(t,n,i){this.name=t,this.prefix=n,this.baseEncode=i}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Bz{constructor(t,n,i){if(this.name=t,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return U_(this,t)}}class Vz{constructor(t){this.decoders=t}or(t){return U_(this,t)}decode(t){const n=t[0],i=this.decoders[n];if(i)return i.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const U_=(e,t)=>new Vz({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class $z{constructor(t,n,i,r){this.name=t,this.prefix=n,this.baseEncode=i,this.baseDecode=r,this.encoder=new Uz(t,n,i),this.decoder=new Bz(t,n,r)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Ku=({name:e,prefix:t,encode:n,decode:i})=>new $z(e,t,n,i),Mc=({prefix:e,name:t,alphabet:n})=>{const{encode:i,decode:r}=kz(n,t);return Ku({prefix:e,name:t,encode:i,decode:s=>zz(r(s))})},Wz=(e,t,n,i)=>{const r={};for(let d=0;d<t.length;++d)r[t[d]]=d;let s=e.length;for(;e[s-1]==="=";)--s;const o=new Uint8Array(s*n/8|0);let c=0,l=0,u=0;for(let d=0;d<s;++d){const f=r[e[d]];if(f===void 0)throw new SyntaxError(`Non-${i} character`);l=l<<n|f,c+=n,c>=8&&(c-=8,o[u++]=255&l>>c)}if(c>=n||255&l<<8-c)throw new SyntaxError("Unexpected end of data");return o},Fz=(e,t,n)=>{const i=t[t.length-1]==="=",r=(1<<n)-1;let s="",o=0,c=0;for(let l=0;l<e.length;++l)for(c=c<<8|e[l],o+=8;o>n;)o-=n,s+=t[r&c>>o];if(o&&(s+=t[r&c<<n-o]),i)for(;s.length*n&7;)s+="=";return s},Kt=({name:e,prefix:t,bitsPerChar:n,alphabet:i})=>Ku({prefix:t,name:e,encode(r){return Fz(r,i,n)},decode(r){return Wz(r,i,n,e)}}),Yz=Ku({prefix:"\0",name:"identity",encode:e=>Rz(e),decode:e=>Pz(e)}),Hz=Object.freeze(Object.defineProperty({__proto__:null,identity:Yz},Symbol.toStringTag,{value:"Module"})),Qz=Kt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Zz=Object.freeze(Object.defineProperty({__proto__:null,base2:Qz},Symbol.toStringTag,{value:"Module"})),qz=Kt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Gz=Object.freeze(Object.defineProperty({__proto__:null,base8:qz},Symbol.toStringTag,{value:"Module"})),Kz=Mc({prefix:"9",name:"base10",alphabet:"0123456789"}),Jz=Object.freeze(Object.defineProperty({__proto__:null,base10:Kz},Symbol.toStringTag,{value:"Module"})),Xz=Kt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),eP=Kt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),tP=Object.freeze(Object.defineProperty({__proto__:null,base16:Xz,base16upper:eP},Symbol.toStringTag,{value:"Module"})),nP=Kt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),iP=Kt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rP=Kt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),sP=Kt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),oP=Kt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),aP=Kt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),cP=Kt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),lP=Kt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),uP=Kt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),dP=Object.freeze(Object.defineProperty({__proto__:null,base32:nP,base32hex:oP,base32hexpad:cP,base32hexpadupper:lP,base32hexupper:aP,base32pad:rP,base32padupper:sP,base32upper:iP,base32z:uP},Symbol.toStringTag,{value:"Module"})),hP=Mc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),fP=Mc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),mP=Object.freeze(Object.defineProperty({__proto__:null,base36:hP,base36upper:fP},Symbol.toStringTag,{value:"Module"})),yP=Mc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),gP=Mc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),pP=Object.freeze(Object.defineProperty({__proto__:null,base58btc:yP,base58flickr:gP},Symbol.toStringTag,{value:"Module"})),wP=Kt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
293+/",bitsPerChar:6}),_P=Kt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),bP=Kt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),xP=Kt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),IP=Object.freeze(Object.defineProperty({__proto__:null,base64:wP,base64pad:_P,base64url:bP,base64urlpad:xP},Symbol.toStringTag,{value:"Module"})),B_=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),MP=B_.reduce((e,t,n)=>(e[n]=t,e),[]),CP=B_.reduce((e,t,n)=>(e[t.codePointAt(0)]=n,e),[]);function EP(e){return e.reduce((t,n)=>(t+=MP[n],t),"")}function TP(e){const t=[];for(const n of e){const i=CP[n.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${n}`);t.push(i)}return new Uint8Array(t)}const vP=Ku({prefix:"🚀",name:"base256emoji",encode:EP,decode:TP}),LP=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:vP},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const v2={...Hz,...Zz,...Gz,...Jz,...tP,...dP,...mP,...pP,...IP,...LP};function V_(e,t,n,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:i}}}const L2=V_("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),rh=V_("ascii","a",e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{e=e.substring(1);const t=R_(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),$_={utf8:L2,"utf-8":L2,hex:v2.base16,latin1:rh,ascii:rh,binary:rh,...v2};function ri(e,t="utf8"){const n=$_[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Q1(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}function Pn(e,t="utf8"){const n=$_[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}const jP={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"}},SP="Input must be an string, Buffer or Uint8Array";function DP(e){let t;if(e instanceof Uint8Array)t=e;else if(typeof e=="string")t=new TextEncoder().encode(e);else throw new Error(SP);return t}function NP(e){return Array.prototype.map.call(e,function(t){return(t<16?"0":"")+t.toString(16)}).join("")}function Hc(e){return(4294967296+e).toString(16).substring(1)}function AP(e,t,n){let i=`
294`+e+" = ";for(let r=0;r<t.length;r+=2){if(n===32)i+=Hc(t[r]).toUpperCase(),i+=" ",i+=Hc(t[r+1]).toUpperCase();else if(n===64)i+=Hc(t[r+1]).toUpperCase(),i+=Hc(t[r]).toUpperCase();else throw new Error("Invalid size "+n);r%6===4?i+=`
295`+new Array(e.length+4).join(" "):r<t.length-2&&(i+=" ")}}function OP(e,t,n){let i=new Date().getTime();
295const r=new Uint8Array(t);for(let o=0;o<t;o++)r[o]=o%256;const s=new Date().getTime();""+(s-i),i=s;for(let o=0;o<n;o++){const c=e(r),l=new Date().getTime(),u=l-i;i=l,""+u+c.substring(0,20),Math.round(t/(1<<20)/(u/1e3)*100)/100+""}}var W_={normalizeInput:DP,toHex:NP,debugPrint:AP,testSpeed:OP};const dl=W_;function Qc(e,t,n){const i=e[t]+e[n];let r=e[t+1]+e[n+1];i>=4294967296&&r++,e[t]=i,e[t+1]=r}function j2(e,t,n,i){let r=e[t]+n;n<0&&(r+=4294967296);let s=e[t+1]+i;r>=4294967296&&s++,e[t]=r,e[t+1]=s}function F_(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function gr(e,t,n,i,r,s){const o=_a[r],c=_a[r+1],l=_a[s],u=_a[s+1];Qc(Ee,e,t),j2(Ee,e,o,c);let d=Ee[i]^Ee[e],f=Ee[i+1]^Ee[e+1];Ee[i]=f,Ee[i+1]=d,Qc(Ee,n,i),d=Ee[t]^Ee[n],f=Ee[t+1]^Ee[n+1],Ee[t]=d>>>24^f<<8,Ee[t+1]=f>>>24^d<<8,Qc(Ee,e,t),j2(Ee,e,l,u),d=Ee[i]^Ee[e],f=Ee[i+1]^Ee[e+1],Ee[i]=d>>>16^f<<16,Ee[i+1]=f>>>16^d<<16,Qc(Ee,n,i),d=Ee[t]^Ee[n],f=Ee[t+1]^Ee[n+1],Ee[t]=f>>>31^d<<1,Ee[t+1]=d>>>31^f<<1}const Y_=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),kP=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],Xt=new Uint8Array(kP.map(function(e){return e*2})),Ee=new Uint32Array(32),_a=new Uint32Array(32);function H_(e,t){let n=0;for(n=0;n<16;n++)Ee[n]=e.h[n],Ee[n+16]=Y_[n];for(Ee[24]=Ee[24]^e.t,Ee[25]=Ee[25]^e.t/4294967296,t&&(Ee[28]=~Ee[28],Ee[29]=~Ee[29]),n=0;n<32;n++)_a[n]=F_(e.b,4*n);for(n=0;n<12;n++)gr(0,8,16,24,Xt[n*16+0],Xt[n*16+1]),gr(2,10,18,26,Xt[n*16+2],Xt[n*16+3]),gr(4,12,20,28,Xt[n*16+4],Xt[n*16+5]),gr(6,14,22,30,Xt[n*16+6],Xt[n*16+7]),gr(0,10,20,30,Xt[n*16+8],Xt[n*16+9]),gr(2,12,22,24,Xt[n*16+10],Xt[n*16+11]),gr(4,14,16,26,Xt[n*16+12],Xt[n*16+13]),gr(6,8,18,28,Xt[n*16+14],Xt[n*16+15]);for(n=0;n<16;n++)e.h[n]=e.h[n]^Ee[n]^Ee[n+16]}const pr=new Uint8Array([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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function Q_(e,t,n,i){if(e===0||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(n&&n.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(i&&i.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const r={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};pr.fill(0),pr[0]=e,t&&(pr[1]=t.length),pr[2]=1,pr[3]=1,n&&pr.set(n,32),i&&pr.set(i,48);for(let s=0;s<16;s++)r.h[s]=Y_[s]^F_(pr,s*4);return t&&(Z1(r,t),r.c=128),r}function Z1(e,t){for(let n=0;n<t.length;n++)e.c===128&&(e.t+=e.c,H_(e,!1),e.c=0),e.b[e.c++]=t[n]}function Z_(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;H_(e,!0);const t=new Uint8Array(e.outlen);for(let n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(n&3);return t}function q_(e,t,n,i,r){n=n||64,e=dl.normalizeInput(e),i&&(i=dl.normalizeInput(i)),r&&(r=dl.normalizeInput(r));const s=Q_(n,t,i,r);return Z1(s,e),Z_(s)}function zP(e,t,n,i,r){const s=q_(e,t,n,i,r);return dl.toHex(s)}var PP={blake2b:q_,blake2bHex:zP,blake2bInit:Q_,blake2bUpdate:Z1,blake2bFinal:Z_};const G_=W_;function RP(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function wr(e,t,n,i,r,s){Pe[e]=Pe[e]+Pe[t]+r,Pe[i]=Zc(Pe[i]^Pe[e],16),Pe[n]=Pe[n]+Pe[i],Pe[t]=Zc(Pe[t]^Pe[n],12),Pe[e]=Pe[e]+Pe[t]+s,Pe[i]=Zc(Pe[i]^Pe[e],8),Pe[n]=Pe[n]+Pe[i],Pe[t]=Zc(Pe[t]^Pe[n],7)}function Zc(e,t){return e>>>t^e<<32-t}const K_=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),en=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,
2956,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),Pe=new Uint32Array(16),Ut=new Uint32Array(16);function J_(e,t){let n=0;for(n=0;n<8;n++)Pe[n]=e.h[n],Pe[n+8]=K_[n];for(Pe[12]^=e.t,Pe[13]^=e.t/4294967296,t&&(Pe[14]=~Pe[14]),n=0;n<16;n++)Ut[n]=RP(e.b,4*n);for(n=0;n<10;n++)wr(0,4,8,12,Ut[en[n*16+0]],Ut[en[n*16+1]]),wr(1,5,9,13,Ut[en[n*16+2]],Ut[en[n*16+3]]),wr(2,6,10,14,Ut[en[n*16+4]],Ut[en[n*16+5]]),wr(3,7,11,15,Ut[en[n*16+6]],Ut[en[n*16+7]]),wr(0,5,10,15,Ut[en[n*16+8]],Ut[en[n*16+9]]),wr(1,6,11,12,Ut[en[n*16+10]],Ut[en[n*16+11]]),wr(2,7,8,13,Ut[en[n*16+12]],Ut[en[n*16+13]]),wr(3,4,9,14,Ut[en[n*16+14]],Ut[en[n*16+15]]);for(n=0;n<8;n++)e.h[n]^=Pe[n]^Pe[n+8]}function X_(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const n=t?t.length:0;if(t&&!(n>0&&n<=32))throw new Error("Incorrect key length, should be in [1, 32]");const i={h:new Uint32Array(K_),b:new Uint8Array(64),c:0,t:0,outlen:e};return i.h[0]^=16842752^n<<8^e,n>0&&(q1(i,t),i.c=64),i}function q1(e,t){for(let n=0;n<t.length;n++)e.c===64&&(e.t+=e.c,J_(e,!1),e.c=0),e.b[e.c++]=t[n]}function eb(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;J_(e,!0);const t=new Uint8Array(e.outlen);for(let n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(n&3)&255;return t}function tb(e,t,n){n=n||32,e=G_.normalizeInput(e);const i=X_(n,t);return q1(i,e),eb(i)}function UP(e,t,n){const i=tb(e,t,n);return G_.toHex(i)}var BP={blake2s:tb,blake2sHex:UP,blake2sInit:X_,blake2sUpdate:q1,blake2sFinal:eb};const oa=PP,aa=BP;var VP={blake2b:oa.blake2b,blake2bHex:oa.blake2bHex,blake2bInit:oa.blake2bInit,blake2bUpdate:oa.blake2bUpdate,blake2bFinal:oa.blake2bFinal,blake2s:aa.blake2s,blake2sHex:aa.blake2sHex,blake2sInit:aa.blake2sInit,blake2sUpdate:aa.blake2sUpdate,blake2sFinal:aa.blake2sFinal},$P={};const WP=":";function hl(e){const[t,n]=e.split(WP);return{namespace:t,reference:n}}function nb(e,t){return e.includes(":")?[e]:t.chains||[]}var FP=Object.defineProperty,YP=Object.defineProperties,HP=Object.getOwnPropertyDescriptors,S2=Object.getOwnPropertySymbols,QP=Object.prototype.hasOwnProperty,ZP=Object.prototype.propertyIsEnumerable,T0=(e,t,n)=>t in e?FP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D2=(e,t)=>
295{for(var n in t||(t={}))QP.call(t,n)&&T0(e,n,t[n]);if(S2)for(var n of S2(t))ZP.call(t,n)&&T0(e,n,t[n]);return e},qP=(e,t)=>YP(e,HP(t)),N2=(e,t,n)=>T0(e,typeof t!="symbol"?t+"":t,n);const GP="ReactNative",Fn={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},KP="js";function Wl(){return typeof _n<"u"&&typeof _n.versions<"u"&&typeof _n.versions.node<"u"}function rs(){return!Ds()&&!!W1()&&navigator.product===GP}function JP(){return rs()&&typeof we<"u"&&typeof(we==null?void 0:we.Platform)<"u"&&(we==null?void 0:we.Platform.OS)==="android"}function XP(){return rs()&&typeof we<"u"&&typeof(we==null?void 0:we.Platform)<"u"&&(we==null?void 0:we.Platform.OS)==="ios"}function Yo(){return!Wl()&&!!W1()&&!!Ds()}function Cc(){return rs()?Fn.reactNative:Wl()?Fn.node:Yo()?Fn.browser:Fn.unknown}function A2(){var e;try{return rs()&&typeof we<"u"&&typeof(we==null?void 0:we.Application)<"u"?(e=we.Application)==null?void 0:e.applicationId:void 0}catch{return}}function eR(e,t){const n=new URLSearchParams(e);for(const i of Object.keys(t).sort())if(t.hasOwnProperty(i)){const r=t[i];r!==void 0&&n.set(i,r)}return n.toString()}function tR(e){var t,n;const i=ib();try{return e!=null&&e.url&&i.url&&new URL(e.url).host!==new URL(i.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${e.url} differs from the actual page url:${i.url}. This is probably unintended and can lead to issues.`),e.url=i.url),(t=e==null?void 0:e.icons)!=null&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(r=>r!=="")),qP(D2(D2({},i),e),{url:(e==null?void 0:e.url)||i.url,name:(e==null?void 0:e.name)||i.name,description:(e==null?void 0:e.description)||i.description,icons:(n=e==null?void 0:e.icons)!=null&&n.length&&e.icons.length>0?e.icons:i.icons})}catch(r){return console.warn("Error populating app metadata",r),e||i}}function ib(){return p_()||{name:"",description:"",url:"",icons:[""]}}
295function nR(){if(Cc()===Fn.reactNative&&typeof we<"u"&&typeof(we==null?void 0:we.Platform)<"u"){const{OS:n,Version:i}=we.Platform;return[n,i].join("-")}const e=WO();if(e===null)return"unknown";const t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return e.type==="browser"?[t,e.name,e.version].join("-"):[t,e.version].join("-")}function iR(){var e;const t=Cc();return t===Fn.browser?[t,((e=g_())==null?void 0:e.host)||"unknown"].join(":"):t}function rb(e,t,n){const i=nR(),r=iR();return[[e,t].join("-"),[KP,n].join("-"),i,r].join("/")}function rR({protocol:e,version:t,relayUrl:n,sdkVersion:i,auth:r,projectId:s,useOnCloseEvent:o,bundleId:c,packageName:l}){const u=n.split("?"),d=rb(e,t,i),f={auth:r,ua:d,projectId:s,useOnCloseEvent:o||void 0,packageName:l||void 0,bundleId:c||void 0},m=eR(u[1]||"",f);return u[0]+"?"+m}function ys(e,t){return e.filter(n=>t.includes(n)).length===e.length}function v0(e){return Object.fromEntries(e.entries())}function L0(e){return new Map(Object.entries(e))}function us(e=te.FIVE_MINUTES,t){const n=te.toMiliseconds(e||te.FIVE_MINUTES);let i,r,s,o;return{resolve:c=>{s&&i&&(clearTimeout(s),i(c),o=Promise.resolve(c))},reject:c=>{s&&r&&(clearTimeout(s),r(c))},done:()=>new Promise((c,l)=>{if(o)return c(o);s=setTimeout(()=>{const u=new Error(t);o=Promise.reject(u),l(u)},n),i=c,r=l})}}function Ni(e,t,n){return new Promise(async(i,r)=>{const s=setTimeout(()=>r(new Error(n)),t);try{const o=await e;i(o)}catch(o){r(o)}clearTimeout(s)})}function sb(e,t){if(typeof t=="string"&&t.startsWith(`${e}:`))return t;if(e.toLowerCase()==="topic"){if(typeof t!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}else if(e.toLowerCase()==="id"){if(typeof t!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function sR(e){return sb("topic",e)}function oR(e){return sb("id",e)}function ob(e){const[t,n]=e.split(":"),i={id:void 0,topic:void 0};if(t==="topic"&&typeof n=="string")i.topic=n;else if(t==="id"&&Number.isInteger(Number(n)))i.id=Number(n);else throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${n}`);return i}function Tt(e,t){return te.fromMiliseconds(Date.now()+te.toMiliseconds(e))}function vr(e){return Date.now()>=te.toMiliseconds(e)}function $e(e,t){return`${e}${t?`:${t}`:""}`}function Ms(e=[],t=[]){return[...new Set([...e,...t])]}async function aR({id:e,topic:t,wcDeepLink:n}){var i;try{if(!n)return;const r=typeof n=="string"?JSON.parse(n):n,s=r==null?void 0:r.href;if(typeof s!="string")return;const o=cR(s,e,t),c=Cc();if(c===Fn.browser){if(!((i=Ds())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}lR(o)}else c===Fn.reactNative&&typeof(we==null?void 0:we.Linking)<"u"&&await we.Linking.openURL(o)}catch(r){console.error(r)}}function cR(e,t,n){const i=`requestId=${t}&sessionTopic=${n}`;e.endsWith("/")&&(e=e.slice(0,-1));let r=`${e}`;if(e.startsWith("https://t.me")){const s=e.includes("?")?"&startapp=":"?startapp=";r=`${r}${s}${fR(i,!0)}`}else r=`${r}/wc?${i}`;return r}function lR(e){let t="_self";hR()?t="_top":(dR()||e.startsWith("https://")||e.startsWith("http://"))&&(t="_blank"),window.open(e,t,"noreferrer noopener")}async function uR(e,t){let n="";try{if(Yo()&&(n=localStorage.getItem(t),n))return n;n=await e.getItem(t)}catch(i){console.error(i)}return n}function O2(e,t){if(!e.includes(t))return null;const n=e.split(/([&,?,=])/),i=n.indexOf(t);return n[i+2]}function k2(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function G1(){return typeof _n<"u"&&$P.IS_VITEST==="true"}function dR(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function hR(){try{return window.self!==window.top}catch{return!1}}function fR(e,t=!1){const n=Ve.from(e).toString("base64");return t?n.replace(/[=]/g,""):n}function ab(e){return Ve.from(e,"base64").toString("utf-8")}function mR(e){return new Promise(t=>setTimeout(t,e))}let yR=class{constructor({limit:t}){N2(this,"limit"),N2(this,"set"),this.limit=t,this.set=new Set}add(t){if(!this.set.has(t)){if(this.set.size>=this.limit){const n=this.set.values().next().value;n&&this.set.delete(n)}this.set.add(t)}}has(t){return this.set.has(t)}};const qc=BigInt(2**32-1),z2=BigInt(32);function cb(e,t=!1){return t?{h:Number(e&qc),l:Number(e>>z2&qc)}:{h:Number(e>>z2&qc)|0,l:Number(e&qc)|0}}function lb(e,t=!1){const n=e.length;
295let i=new Uint32Array(n),r=new Uint32Array(n);for(let s=0;s<n;s++){const{h:o,l:c}=cb(e[s],t);[i[s],r[s]]=[o,c]}return[i,r]}const P2=(e,t,n)=>e>>>n,R2=(e,t,n)=>e<<32-n|t>>>n,Lr=(e,t,n)=>e>>>n|t<<32-n,jr=(e,t,n)=>e<<32-n|t>>>n,ba=(e,t,n)=>e<<64-n|t>>>n-32,xa=(e,t,n)=>e>>>n-32|t<<64-n,gR=(e,t)=>t,pR=(e,t)=>e,wR=(e,t,n)=>e<<n|t>>>32-n,_R=(e,t,n)=>t<<n|e>>>32-n,bR=(e,t,n)=>t<<n-32|e>>>64-n,xR=(e,t,n)=>e<<n-32|t>>>64-n;function fi(e,t,n,i){const r=(t>>>0)+(i>>>0);return{h:e+n+(r/2**32|0)|0,l:r|0}}const K1=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),J1=(e,t,n,i)=>t+n+i+(e/2**32|0)|0,IR=(e,t,n,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0),MR=(e,t,n,i,r)=>t+n+i+r+(e/2**32|0)|0,CR=(e,t,n,i,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0)+(r>>>0),ER=(e,t,n,i,r,s)=>t+n+i+r+s+(e/2**32|0)|0,to=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function X1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function cr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function si(e,...t){if(!X1(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function em(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");cr(e.outputLen),cr(e.blockLen)}function es(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function tm(e,t){si(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Qa(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function oi(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function sh(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ii(e,t){return e<<32-t|e>>>t}const ub=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function db(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Gi=ub?e=>e:e=>db(e);function TR(e){for(let t=0;t<e.length;t++)e[t]=db(e[t]);return e}const Sr=ub?e=>e:TR,hb=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",vR=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Za(e){if(si(e),hb)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=vR[e[n]];return t}const Qi={_0:48,_9:57,A:65,F:70,a:97,f:102};function U2(e){if(e>=Qi._0&&e<=Qi._9)return e-Qi._0;if(e>=Qi.A&&e<=Qi.F)return e-(Qi.A-10);if(e>=Qi.a&&e<=Qi.f)return e-(Qi.a-10)}function nm(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(hb)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(n);for(let r=0,s=0;r<n;r++,s+=2){const o=U2(e.charCodeAt(s)),c=U2(e.charCodeAt(s+1));if(o===void 0||c===void 0){const l=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+s)}i[r]=o*16+c}return i}function LR(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function gi(e){return typeof e=="string"&&(e=LR(e)),si(e),e}function gs(...e){let t=0;for(let i=0;i<e.length;i++){const r=e[i];si(r),t+=r.length}const n=new Uint8Array(t);for(let i=0,r=0;i<e.length;i++){const s=e[i];n.set(s,r),r+=s.length}return n}class Ju{}function Ec(e){const t=i=>e().update(gi(i)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function jR(e){const t=(i,r)=>e(r).update(gi(i)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=i=>e(i),t}function Ho(e=32){if(to&&typeof to.getRandomValues=="function")return to.getRandomValues(new Uint8Array(e));if(to&&typeof to.randomBytes=="function")return Uint8Array.from(to.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const SR=BigInt(0),ca=BigInt(1),DR=BigInt(2),NR=BigInt(7),AR=BigInt(256),OR=BigInt(113),fb=[],mb=[],yb=[];for(let e=0,t=ca,n=1,i=0;e<24;e++){[n,i]=[i,(2*n+3*i)%5],fb.push(2*(5*i+n)),mb.push((e+1)*(e+2)/2%64);let r=SR;for(let s=0;s<7;s++)t=(t<<ca^(t>>NR)*OR)%AR,t&DR&&(r^=ca<<(ca<<BigInt(s))-ca);yb.push(r)}
295const gb=lb(yb,!0),kR=gb[0],zR=gb[1],B2=(e,t,n)=>n>32?bR(e,t,n):wR(e,t,n),V2=(e,t,n)=>n>32?xR(e,t,n):_R(e,t,n);function PR(e,t=24){const n=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const c=(o+8)%10,l=(o+2)%10,u=n[l],d=n[l+1],f=B2(u,d,1)^n[c],m=V2(u,d,1)^n[c+1];for(let y=0;y<50;y+=10)e[o+y]^=f,e[o+y+1]^=m}let r=e[2],s=e[3];for(let o=0;o<24;o++){const c=mb[o],l=B2(r,s,c),u=V2(r,s,c),d=fb[o];r=e[d],s=e[d+1],e[d]=l,e[d+1]=u}for(let o=0;o<50;o+=10){for(let c=0;c<10;c++)n[c]=e[o+c];for(let c=0;c<10;c++)e[o+c]^=~n[(c+2)%10]&n[(c+4)%10]}e[0]^=kR[i],e[1]^=zR[i]}oi(n)}let RR=class pb extends Ju{constructor(t,n,i,r=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=i,this.enableXOF=r,this.rounds=s,cr(i),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Qa(this.state)}clone(){return this._cloneInto()}keccak(){Sr(this.state32),PR(this.state32,this.rounds),Sr(this.state32),this.posOut=0,this.pos=0}update(t){es(this),t=gi(t),si(t);const{blockLen:n,state:i}=this,r=t.length;for(let s=0;s<r;){const o=Math.min(n-this.pos,r-s);for(let c=0;c<o;c++)i[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:i,blockLen:r}=this;t[i]^=n,n&128&&i===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){es(this,!1),si(t),this.finish();const n=this.state,{blockLen:i}=this;for(let r=0,s=t.length;r<s;){this.posOut>=i&&this.keccak();const o=Math.min(i-this.posOut,s-r);t.set(n.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return cr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(tm(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,oi(this.state)}_cloneInto(t){const{blockLen:n,suffix:i,outputLen:r,rounds:s,enableXOF:o}=this;return t||(t=new pb(n,i,r,o,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=i,t.outputLen=r,t.enableXOF=o,t.destroyed=this.destroyed,t}};const UR=(e,t,n)=>Ec(()=>new RR(t,e,n)),BR=UR(1,136,256/8);function VR(e,t,n,i){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,i);const r=BigInt(32),s=BigInt(4294967295),o=Number(n>>r&s),c=Number(n&s),l=i?4:0,u=i?0:4;e.setUint32(t+l,o,i),e.setUint32(t+u,c,i)}function $R(e,t,n){return e&t^~e&n}function WR(e,t,n){return e&t^e&n^t&n}let wb=class extends Ju{constructor(t,n,i,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=i,this.isLE=r,this.buffer=new Uint8Array(t),this.view=sh(this.buffer)}update(t){es(this),t=gi(t),si(t);const{view:n,buffer:i,blockLen:r}=this,s=t.length;for(let o=0;o<s;){const c=Math.min(r-this.pos,s-o);if(c===r){const l=sh(t);for(;r<=s-o;o+=r)this.process(l,o);continue}i.set(t.subarray(o,o+c),this.pos),this.pos+=c,o+=c,this.pos===r&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){es(this),tm(t,this),this.finished=!0;const{buffer:n,view:i,blockLen:r,isLE:s}=this;let{pos:o}=this;n[o++]=128,oi(this.buffer.subarray(o)),this.padOffset>r-o&&(this.process(i,0),o=0);for(let f=o;f<r;f++)n[f]=0;VR(i,r-8,BigInt(this.length*8),s),this.process(i,0);const c=sh(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)c.setUint32(4*f,d[f],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const i=t.slice(0,n);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:i,length:r,finished:s,destroyed:o,pos:c}=this;return t.destroyed=o,t.finished=s,t.length=r,t.pos=c,r%n&&t.buffer.set(i),t}clone(){return this._cloneInto()}};const _r=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),tn=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),nn=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),FR=Uint32Array.from([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,2756
295734187,3204031479,3329325298]),br=new Uint32Array(64);let YR=class extends wb{constructor(t=32){super(64,t,8,!1),this.A=_r[0]|0,this.B=_r[1]|0,this.C=_r[2]|0,this.D=_r[3]|0,this.E=_r[4]|0,this.F=_r[5]|0,this.G=_r[6]|0,this.H=_r[7]|0}get(){const{A:t,B:n,C:i,D:r,E:s,F:o,G:c,H:l}=this;return[t,n,i,r,s,o,c,l]}set(t,n,i,r,s,o,c,l){this.A=t|0,this.B=n|0,this.C=i|0,this.D=r|0,this.E=s|0,this.F=o|0,this.G=c|0,this.H=l|0}process(t,n){for(let f=0;f<16;f++,n+=4)br[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const m=br[f-15],y=br[f-2],g=Ii(m,7)^Ii(m,18)^m>>>3,p=Ii(y,17)^Ii(y,19)^y>>>10;br[f]=p+br[f-7]+g+br[f-16]|0}let{A:i,B:r,C:s,D:o,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const m=Ii(c,6)^Ii(c,11)^Ii(c,25),y=d+m+$R(c,l,u)+FR[f]+br[f]|0,g=(Ii(i,2)^Ii(i,13)^Ii(i,22))+WR(i,r,s)|0;d=u,u=l,l=c,c=o+y|0,o=s,s=r,r=i,i=y+g|0}i=i+this.A|0,r=r+this.B|0,s=s+this.C|0,o=o+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,r,s,o,c,l,u,d)}roundClean(){oi(br)}destroy(){this.set(0,0,0,0,0,0,0,0),oi(this.buffer)}};const _b=lb(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
2955771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),HR=_b[0],QR=_b[1],xr=new Uint32Array(80),Ir=new Uint32Array(80);let im=class extends wb{constructor(t=64){super(128,t,16,!1),this.Ah=nn[0]|0,this.Al=nn[1]|0,this.Bh=nn[2]|0,this.Bl=nn[3]|0,this.Ch=nn[4]|0,this.Cl=nn[5]|0,this.Dh=nn[6]|0,this.Dl=nn[7]|0,this.Eh=nn[8]|0,this.El=nn[9]|0,this.Fh=nn[10]|0,this.Fl=nn[11]|0,this.Gh=nn[12]|0,this.Gl=nn[13]|0,this.Hh=nn[14]|0,this.Hl=nn[15]|0}get(){const{Ah:t,Al:n,Bh:i,Bl:r,Ch:s,Cl:o,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:m,Gh:y,Gl:g,Hh:p,Hl:w}=this;return[t,n,i,r,s,o,c,l,u,d,f,m,y,g,p,w]}set(t,n,i,r,s,o,c,l,u,d,f,m,y,g,p,w){this.Ah=t|0,this.Al=n|0,this.Bh=i|0,this.Bl=r|0,this.Ch=s|0,this.Cl=o|0,this.Dh=c|0,this.Dl=l|0,this.Eh=u|0,this.El=d|0,this.Fh=f|0,this.Fl=m|0,this.Gh=y|0,this.Gl=g|0,this.Hh=p|0,this.Hl=w|0}process(t,n){for(let E=0;E<16;E++,n+=4)xr[E]=t.getUint32(n),Ir[E]=t.getUint32(n+=4);for(let E=16;E<80;E++){const j=xr[E-15]|0,C=Ir[E-15]|0,T=Lr(j,C,1)^Lr(j,C,8)^P2(j,C,7),v=jr(j,C,1)^jr(j,C,8)^R2(j,C,7),N=xr[E-2]|0,M=Ir[E-2]|0,S=Lr(N,M,19)^ba(N,M,61)^P2(N,M,6),L=jr(N,M,19)^xa(N,M,61)^R2(N,M,6),O=IR(v,L,Ir[E-7],Ir[E-16]),P=MR(O,T,S,xr[E-7],xr[E-16]);xr[E]=P|0,Ir[E]=O|0}let{Ah:i,Al:r,Bh:s,Bl:o,Ch:c,Cl:l,Dh:u,Dl:d,Eh:f,El:m,Fh:y,Fl:g,Gh:p,Gl:w,Hh:x,Hl:I}=this;for(let E=0;E<80;E++){const j=Lr(f,m,14)^Lr(f,m,18)^ba(f,m,41),C=jr(f,m,14)^jr(f,m,18)^xa(f,m,41),T=f&y^~f&p,v=m&g^~m&w,N=CR(I,C,v,QR[E],Ir[E]),M=ER(N,x,j,T,HR[E],xr[E]),S=N|0,L=Lr(i,r,28)^ba(i,r,34)^ba(i,r,39),O=jr(i,r,28)^xa(i,r,34)^xa(i,r,39),P=i&s^i&c^s&c,$=r&o^r&l^o&l;x=p|0,I=w|0,p=y|0,w=g|0,y=f|0,g=m|0,{h:f,l:m}=fi(u|0,d|0,M|0,S|0),u=c|0,d=l|0,c=s|0,l=o|0,s=i|0,o=r|0;const z=K1(S,O,$);i=J1(z,M,L,P),r=z|0}({h:i,l:r}=fi(this.Ah|0,this.Al|0,i|0,r|0)),{h:s,l:o}=fi(this.Bh|0,this.Bl|0,s|0,o|0),{h:c,l}=fi(this.Ch|0,this.Cl|0,c|0,l|0),{h:u,l:d}=fi(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:m}=fi(this.Eh|0,this.El|0,f|0,m|0),{h:y,l:g}=fi(this.Fh|0,this.Fl|0,y|0,g|0),{h:p,l:w}=fi(this.Gh|0,this.Gl|0,p|0,w|0),{h:x,l:I}=fi(this.Hh|0,this.Hl|0,x|0,I|0),this.set(i,r,s,o,c,l,u,d,f,m,y,g,p,w,x,I)}roundClean(){oi(xr,Ir)}destroy(){oi(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},ZR=class extends im{constructor(){super(48),this.Ah=tn[0]|0,this.Al=tn[1]|0,this.Bh=tn[2]|0,this.Bl=tn[3]|0,this.Ch=tn[4]|0,this.Cl=tn[5]|0,this.Dh=tn[6]|0,this.Dl=tn[7]|0,this.Eh=tn[8]|0,this.El=tn[9]|0,this.Fh=tn[10]|0,this.Fl=tn[11]|0,this.Gh=tn[12]|0,this.Gl=tn[13]|0,this.Hh=tn[14]|0,this.Hl=tn[15]|0}};const rn=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class qR extends im{constructor(){super(32),this.Ah=rn[0]|0,this.Al=rn[1]|0,this.Bh=rn[2]|0,this.Bl=rn[3]|0,this.Ch=rn[4]|0,this.Cl=rn[5]|0,this.Dh=rn[6]|0,this.Dl=rn[7]|0,this.Eh=rn[8]|0,this.El=rn[9]|0,this.Fh=rn[10]|0,this.Fl=rn[11]|0,this.Gh=rn[12]|0,this.Gl=rn[13]|0,this.Hh=rn[14]|0,this.Hl=rn[15]|0}}const Xu=Ec(()=>new YR),GR=Ec(()=>new im),KR=Ec(()=>new ZR),JR=Ec(()=>new qR),XR=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),Et=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),se=new Uint32Array(32);function Mr(e,t,n,i,r,s){const o=r[s],c=r[s+1];let l=se[2*e],u=se[2*e+1],d=se[2*t],f=se[2*t+1],m=se[2*n],y=se[2*n+1],g=se[2*i],p=se[2*i+1],w=K1(l,d,o);u=J1(w,u,f,c),l=w|0,{Dh:p,Dl:g}={Dh:p^u,Dl:g^l},{Dh:p,Dl:g}={Dh:gR(p,g),Dl:pR(p)},{h:y,l:m}=fi(y,m,p,g),{Bh:f,Bl:d}={Bh:f^y,Bl:d^m},{Bh:f,Bl:d}={Bh:Lr(f,d,24),Bl:jr(f,d,24)}
295,se[2*e]=l,se[2*e+1]=u,se[2*t]=d,se[2*t+1]=f,se[2*n]=m,se[2*n+1]=y,se[2*i]=g,se[2*i+1]=p}function Cr(e,t,n,i,r,s){const o=r[s],c=r[s+1];let l=se[2*e],u=se[2*e+1],d=se[2*t],f=se[2*t+1],m=se[2*n],y=se[2*n+1],g=se[2*i],p=se[2*i+1],w=K1(l,d,o);u=J1(w,u,f,c),l=w|0,{Dh:p,Dl:g}={Dh:p^u,Dl:g^l},{Dh:p,Dl:g}={Dh:Lr(p,g,16),Dl:jr(p,g,16)},{h:y,l:m}=fi(y,m,p,g),{Bh:f,Bl:d}={Bh:f^y,Bl:d^m},{Bh:f,Bl:d}={Bh:ba(f,d,63),Bl:xa(f,d,63)},se[2*e]=l,se[2*e+1]=u,se[2*t]=d,se[2*t+1]=f,se[2*n]=m,se[2*n+1]=y,se[2*i]=g,se[2*i+1]=p}function eU(e,t={},n,i,r){if(cr(n),e<0||e>n)throw new Error("outputLen bigger than keyLen");const{key:s,salt:o,personalization:c}=t;if(s!==void 0&&(s.length<1||s.length>n))throw new Error("key length must be undefined or 1.."+n);if(o!==void 0&&o.length!==i)throw new Error("salt must be undefined or "+i);if(c!==void 0&&c.length!==r)throw new Error("personalization must be undefined or "+r)}class tU extends Ju{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,cr(t),cr(n),this.blockLen=t,this.outputLen=n,this.buffer=new Uint8Array(t),this.buffer32=Qa(this.buffer)}update(t){es(this),t=gi(t),si(t);const{blockLen:n,buffer:i,buffer32:r}=this,s=t.length,o=t.byteOffset,c=t.buffer;for(let l=0;l<s;){this.pos===n&&(Sr(r),this.compress(r,0,!1),Sr(r),this.pos=0);const u=Math.min(n-this.pos,s-l),d=o+l;if(u===n&&!(d%4)&&l+u<s){const f=new Uint32Array(c,d,Math.floor((s-l)/4));Sr(f);for(let m=0;l+n<s;m+=r.length,l+=n)this.length+=n,this.compress(f,m,!1);Sr(f);continue}i.set(t.subarray(l,l+u),this.pos),this.pos+=u,this.length+=u,l+=u}return this}digestInto(t){es(this),tm(t,this);const{pos:n,buffer32:i}=this;this.finished=!0,oi(this.buffer.subarray(n)),Sr(i),this.compress(i,0,!0),Sr(i);const r=Qa(t);this.get().forEach((s,o)=>r[o]=Gi(s))}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const i=t.slice(0,n);return this.destroy(),i}_cloneInto(t){const{buffer:n,length:i,finished:r,destroyed:s,outputLen:o,pos:c}=this;return t||(t=new this.constructor({dkLen:o})),t.set(...this.get()),t.buffer.set(n),t.destroyed=s,t.finished=r,t.length=i,t.pos=c,t.outputLen=o,t}clone(){return this._cloneInto()}}class nU extends tU{constructor(t={}){const n=t.dkLen===void 0?64:t.dkLen;super(128,n),this.v0l=Et[0]|0,this.v0h=Et[1]|0,this.v1l=Et[2]|0,this.v1h=Et[3]|0,this.v2l=Et[4]|0,this.v2h=Et[5]|0,this.v3l=Et[6]|0,this.v3h=Et[7]|0,this.v4l=Et[8]|0,this.v4h=Et[9]|0,this.v5l=Et[10]|0,this.v5h=Et[11]|0,this.v6l=Et[12]|0,this.v6h=Et[13]|0,this.v7l=Et[14]|0,this.v7h=Et[15]|0,eU(n,t,64,16,16);let{key:i,personalization:r,salt:s}=t,o=0;if(i!==void 0&&(i=gi(i),o=i.length),this.v0l^=this.outputLen|o<<8|65536|1<<24,s!==void 0){s=gi(s);const c=Qa(s);this.v4l^=Gi(c[0]),this.v4h^=Gi(c[1]),this.v5l^=Gi(c[2]),this.v5h^=Gi(c[3])}if(r!==void 0){r=gi(r);const c=Qa(r);this.v6l^=Gi(c[0]),this.v6h^=Gi(c[1]),this.v7l^=Gi(c[2]),this.v7h^=Gi(c[3])}if(i!==void 0){const c=new Uint8Array(this.blockLen);c.set(i),this.update(c)}}get(){let{v0l:t,v0h:n,v1l:i,v1h:r,v2l:s,v2h:o,v3l:c,v3h:l,v4l:u,v4h:d,v5l:f,v5h:m,v6l:y,v6h:g,v7l:p,v7h:w}=this;return[t,n,i,r,s,o,c,l,u,d,f,m,y,g,p,w]}set(t,n,i,r,s,o,c,l,u,d,f,m,y,g,p,w){this.v0l=t|0,this.v0h=n|0,this.v1l=i|0,this.v1h=r|0,this.v2l=s|0,this.v2h=o|0,this.v3l=c|0,this.v3h=l|0,this.v4l=u|0,this.v4h=d|0,this.v5l=f|0,this.v5h=m|0,this.v6l=y|0,this.v6h=g|0,this.v7l=p|0,this.v7h=w|0}compress(t,n,i){this.get().forEach((l,u)=>se[u]=l),se.set(Et,16);let{h:r,l:s}=cb(BigInt(this.length));se[24]=Et[8]^s,se[25]=Et[9]^r,i&&(se[28]=~se[28],se[29]=~se[29]);let o=0;const c=XR;for(let l=0;l<12;l++)Mr(0,4,8,12,t,n+2*c[o++]),Cr(0,4,8,12,t,n+2*c[o++]),Mr(1,5,9,13,t,n+2*c[o++]),Cr(1,5,9,13,t,n+2*c[o++]),Mr(2,6,10,14,t,n+2*c[o++]),Cr(2,6,10,14,t,n+2*c[o++]),Mr(3,7,11,15,t,n+2*c[o++]),Cr(3,7,11,15,t,n+2*c[o++]),Mr(0,5,10,15,t,n+2*c[o++]),Cr(0,5,10,15,t,n+2*c[o++]),Mr(1,6,11,12,t,n+2*c[o++]),Cr(1,6,11,12,t,n+2*c[o++]),Mr(2,7,8,13,t,n+2*c[o++]),Cr(2,7,8,13,t,n+2*c[o++]),Mr(3,4,9,14,t,n+2*c[o++]),Cr(3,4,9,14,t,n+2*c[o++]);this.v0l^=se[0]^se[16],this.v0h^=se[1]^se[17],this.v1l^=se[2]^se[18],this.v1h^=se[3]^se[19],this.v2l^=se[4]^se[20],this.v2h^=se[5]^se[21],this.v3l^=se[6]^se[22],this.v3h^=se[7]^se[23],this.v4l^=se[8]^se[24],this.v4h^=se[9]^se[25],this.v5l^=se[10]^se[26],this.v5h^=se[11]^se[27],this.v6l^=se[12]^se[28],this.v6h^=se[13]^se[29],this.v7l^=se[14]^se[30],this.v7h^=se[15]^se[31],oi(se)}destroy(){this.destroyed=!0,oi(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const iU=jR(e=>new nU(e)),rU="https://rpc.walletconnect.org/v1";function bb(e){const t=`�Ethereum Signed Message:
296${e.length}`,n=new TextEncoder().encode(t+e);return"0x"+Ve.from(BR(n)).toString("hex")}async function sU(e,t,n,i,r,s){switch(n.t){case"eip191":return await oU(e,t,n.s);case"eip1271":return await aU(e,t,n.s,i,r,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${n.t}`)}}async function oU(e,t,n){return(await Zk({hash:bb(t),signature:n})).toLowerCase()===e.toLowerCase()}async function aU(e,t,n,i,r,s){const o=hl(i);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${i}`);try{const c="0x1626ba7e",l="0000000000000000000000000000000000000000000000000000000000000040",u=n.substring(2),d=(u.length/2).toString(16).padStart(64,"0"),f=(t.startsWith("0x")?t:bb(t)).substring(2),m=c+f+l+d+u,y=await fetch(`${s||rU}/?chainId=${i}&projectId=${r}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:cU(),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:m},"latest"]})}),{result:g}=await y.json();return g?g.slice(0,c.length).toLowerCase()===c.toLowerCase():!1}catch(c){return console.error("isValidEip1271Signature: ",c),!1}}function cU(){return Date.now()+Math.floor(Math.random()*1e3)}function lU(e){const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);const i=n[0];if(i===0)throw new Error("No signatures found");const r=1+i*64;if(n.length<r)throw new Error("Transaction data too short for claimed signature count");if(n.length<100)throw new Error("Transaction too short");const s=Ve.from(e,"base64").slice(1,65);return Ic.encode(s)}function uU(e){const t=new Uint8Array(Ve.from(e,"base64")),n=Array.from("TransactionData::").map(s=>s.charCodeAt(0)),i=new Uint8Array(n.length+t.length);i.set(n),i.set(t,n.length);const r=iU(i,{dkLen:32});return Ic.encode(r)}function $2(e){const t=new Uint8Array(Xu(dU(e)));return Ic.encode(t)}function dU(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="object"&&e!=null&&e.data)return new Uint8Array(Object.values(e.data));if(typeof e=="object"&&e)return new Uint8Array(Object.values(e));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}function W2(e){const t=Ve.from(e,"base64"),n=Nz(t).txn;if(!n)throw new Error("Invalid signed transaction: missing 'txn' field");const i=Mz(n),r=Ve.from("TX"),s=Ve.concat([r,Ve.from(i)]),o=JR(s);return h9.encode(o).replace(/=+$/,"")}function oh(e){const t=[];let n=BigInt(e);for(;n>=BigInt(128);)t.push(Number(n&BigInt(127)|BigInt(128))),n>>=BigInt(7);return t.push(Number(n)),Ve.from(t)}function hU(e){const t=Ve.from(e.signed.bodyBytes,"base64"),n=Ve.from(e.signed.authInfoBytes,"base64"),i=Ve.from(e.signature.signature,"base64"),r=[];r.push(Ve.from([10])),r.push(oh(t.length)),r.push(t),r.push(Ve.from([18])),r.push(oh(n.length)),r.push(n),r.push(Ve.from([26])),r.push(oh(i.length)),r.push(i);const s=Ve.concat(r),o=Xu(s);return Ve.from(o).toString("hex").toUpperCase()}var fU=Object.defineProperty,mU=Object.defineProperties,yU=Object.getOwnPropertyDescriptors,F2=Object.getOwnPropertySymbols,gU=Object.prototype.hasOwnProperty,pU=Object.prototype.propertyIsEnumerable,Y2=(e,t,n)=>t in e?fU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wU=(e,t)=>{for(var n in t||(t={}))gU.call(t,n)&&Y2(e,n,t[n]);if(F2)for(var n of F2(t))pU.call(t,n)&&Y2(e,n,t[n]);return e},_U=(e,t)=>mU(e,yU(t));const bU="did:pkh:",rm=e=>e==null?void 0:e.split(":"),xU=e=>{const t=e&&rm(e);
296if(t)return e.includes(bU)?t[3]:t[1]},j0=e=>{const t=e&&rm(e);if(t)return t[2]+":"+t[3]},Fl=e=>{const t=e&&rm(e);if(t)return t.pop()};async function H2(e){const{cacao:t,projectId:n}=e,{s:i,p:r}=t,s=xb(r,r.iss),o=Fl(r.iss);return await sU(o,s,i,j0(r.iss),n)}const xb=(e,t)=>{const n=`${e.domain} wants you to sign in with your Ethereum account:`,i=Fl(t);if(!e.aud&&!e.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let r=e.statement||void 0;const s=`URI: ${e.aud||e.uri}`,o=`Version: ${e.version}`,c=`Chain ID: ${xU(t)}`,l=`Nonce: ${e.nonce}`,u=`Issued At: ${e.iat}`,d=e.exp?`Expiration Time: ${e.exp}`:void 0,f=e.nbf?`Not Before: ${e.nbf}`:void 0,m=e.requestId?`Request ID: ${e.requestId}`:void 0,y=e.resources?`Resources:${e.resources.map(p=>`
297- ${p}`).join("")}`:void 0,g=fl(e.resources);if(g){const p=qa(g);r=SU(r,p)}return[n,i,"",r,"",s,o,c,l,u,d,f,m,y].filter(p=>p!=null).join(`
298`)};function IU(e){return Ve.from(JSON.stringify(e)).toString("base64")}function MU(e){return JSON.parse(Ve.from(e,"base64").toString("utf-8"))}function As(e){if(!e)throw new Error("No recap provided, value is undefined");if(!e.att)throw new Error("No `att` property found");const t=Object.keys(e.att);if(!(t!=null&&t.length))throw new Error("No resources found in `att` property");t.forEach(n=>{const i=e.att[n];if(Array.isArray(i))throw new Error(`Resource must be an object: ${n}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${n}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${n}`);
298Object.keys(i).forEach(r=>{const s=i[r];if(!Array.isArray(s))throw new Error(`Ability limits ${r} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${r} is empty array, must be an array with objects`);s.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${r}) must be an array of objects, found: ${o}`)})})})}function CU(e,t,n,i={}){return n==null||n.sort((r,s)=>r.localeCompare(s)),{att:{[e]:EU(t,n,i)}}}function EU(e,t,n={}){t=t==null?void 0:t.sort((r,s)=>r.localeCompare(s));const i=t.map(r=>({[`${e}/${r}`]:[n]}));return Object.assign({},...i)}function Ib(e){return As(e),`urn:recap:${IU(e).replace(/=/g,"")}`}function qa(e){const t=MU(e.replace("urn:recap:",""));return As(t),t}function TU(e,t,n){const i=CU(e,t,n);return Ib(i)}function vU(e){return e&&e.includes("urn:recap:")}function LU(e,t){const n=qa(e),i=qa(t),r=jU(n,i);return Ib(r)}function jU(e,t){As(e),As(t);const n=Object.keys(e.att).concat(Object.keys(t.att)).sort((r,s)=>r.localeCompare(s)),i={att:{}};return n.forEach(r=>{var s,o;Object.keys(((s=e.att)==null?void 0:s[r])||{}).concat(Object.keys(((o=t.att)==null?void 0:o[r])||{})).sort((c,l)=>
298c.localeCompare(l)).forEach(c=>{var l,u;i.att[r]=_U(wU({},i.att[r]),{[c]:((l=e.att[r])==null?void 0:l[c])||((u=t.att[r])==null?void 0:u[c])})})}),i}function SU(e="",t){As(t);const n="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(n))return e;const i=[];let r=0;Object.keys(t.att).forEach(c=>{const l=Object.keys(t.att[c]).map(f=>({ability:f.split("/")[0],action:f.split("/")[1]}));l.sort((f,m)=>f.action.localeCompare(m.action));const u={};l.forEach(f=>{u[f.ability]||(u[f.ability]=[]),u[f.ability].push(f.action)});const d=Object.keys(u).map(f=>(r++,`(${r}) '${f}': '${u[f].join("', '")}' for '${c}'.`));i.push(d.join(", ").replace(".,","."))});const s=i.join(" "),o=`${n}${s}`;return`${e?e+" ":""}${o}`}function Q2(e){var t;const n=qa(e);As(n);const i=(t=n.att)==null?void 0:t.eip155;return i?Object.keys(i).map(r=>r.split("/")[1]):[]}function Z2(e){const t=qa(e);As(t);const n=[];return Object.values(t.att).forEach(i=>{Object.values(i).forEach(r=>{var s;(s=r==null?void 0:r[0])!=null&&s.chains&&n.push(r[0].chains)})}),[...new Set(n.flat())]}function fl(e){if(!e)return;const t=e==null?void 0:e[e.length-1];return vU(t)?t:void 0}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function Mb(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function S0(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function ah(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function On(e,...t){if(!Mb(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function q2(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function DU(e,t){On(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Yr(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function vo(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function NU(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}const AU=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function OU(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function D0(e){if(typeof e=="string")e=OU(e);else if(Mb(e))e=N0(e);else throw new Error("Uint8Array expected, got "+typeof e);return e}function kU(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function zU(e,t){if(e.length!==t.length)return!1;let n=0;for(let i=0;i<e.length;i++)n|=e[i]^t[i];return n===0}const PU=(e,t)=>{function n(i,...r){if(On(i),!AU)throw new Error("Non little-endian hardware is not yet supported");if(e.nonceLength!==void 0){const u=r[0];if(!u)throw new Error("nonce / iv required");e.varSizeNonce?On(u):On(u,e.nonceLength)}const s=e.tagLength;s&&r[1]!==void 0&&On(r[1]);const o=t(i,...r),c=(u,d)=>{if(d!==void 0){if(u!==2)throw new Error("cipher output not supported");On(d)}};let l=!1;return{encrypt(u,d){if(l)throw new Error("cannot encrypt() twice with same key + nonce");return l=!0,On(u),c(o.encrypt.length,d),o.encrypt(u,d)},decrypt(u,d){if(On(u),s&&u.length<s)throw new Error("invalid ciphertext length: smaller than tagLength="+s);return c(o.decrypt.length,d),o.decrypt(u,d)}}}return Object.assign(n,e),n};function G2(e,t,n=!0){if(t===void 0)return new Uint8Array(e);if(t.length!==e)throw new Error("invalid output length, expected "+e+", got: "+t.length);if(n&&!UU(t))throw new Error("invalid output, must be aligned");return t}function K2(e,t,n,i){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,i);const r=BigInt(32),s=BigInt(4294967295),o=Number(n>>r&s),c=Number(n&s);e.setUint32(t+4,o,i),e.setUint32(t+0,c,i)}function RU(e,t,n){S0(n);const i=new Uint8Array(16),r=NU(i);return K2(r,0,BigInt(t),n),K2(r,8,BigInt(e),n),i}function UU(e){return e.byteOffset%4===0}function N0(e){return Uint8Array.from(e)}const Cb=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),BU=Cb("expand 16-byte k"),VU=Cb("expand 32-byte k"),$U=Yr(BU),WU=Yr(VU);function ke(e,t){return e<<t|e>>>32-t}function A0(e){return e.byteOffset%4===0}const Gc=64,FU=16,Eb=2**32-1,J2=new Uint32Array;function YU(e,t,n,i,r,s,o,c){const l=r.length,u=new Uint8Array(Gc),d=Yr(u),f=A0(r)&&A0(s),m=f?Yr(r):J2,y=f?Yr(s):J2;for(let g=0;g<l;o++){if(e(t,n,i,d,o,c),o>=Eb)throw new Error("arx: counter overflow");const p=Math.min(Gc,l-g);if(f&&p===Gc){const w=g/4;
298if(g%4!==0)throw new Error("arx: invalid block position");for(let x=0,I;x<FU;x++)I=w+x,y[I]=m[I]^d[x];g+=Gc;continue}for(let w=0,x;w<p;w++)x=g+w,s[x]=r[x]^u[w];g+=p}}function HU(e,t){const{allowShortKeys:n,extendNonceFn:i,counterLength:r,counterRight:s,rounds:o}=kU({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!="function")throw new Error("core must be a function");return ah(r),ah(o),S0(s),S0(n),(c,l,u,d,f=0)=>{On(c),On(l),On(u);const m=u.length;if(d===void 0&&(d=new Uint8Array(m)),On(d),ah(f),f<0||f>=Eb)throw new Error("arx: counter overflow");if(d.length<m)throw new Error(`arx: output (${d.length}) is shorter than data (${m})`);const y=[];let g=c.length,p,w;if(g===32)y.push(p=N0(c)),w=WU;else if(g===16&&n)p=new Uint8Array(32),p.set(c),p.set(c,16),w=$U,y.push(p);else throw new Error(`arx: invalid 32-byte key, got length=${g}`);A0(l)||y.push(l=N0(l));const x=Yr(p);if(i){if(l.length!==24)throw new Error("arx: extended nonce must be 24 bytes");i(w,x,Yr(l.subarray(0,16)),x),l=l.subarray(16)}const I=16-r;if(I!==l.length)throw new Error(`arx: nonce must be ${I} or 16 bytes`);if(I!==12){const j=new Uint8Array(12);j.set(l,s?0:12-l.length),l=j,y.push(l)}const E=Yr(l);return YU(e,w,x,E,u,d,f,o),vo(...y),d}}const Bt=(e,t)=>
298e[t++]&255|(e[t++]&255)<<8;class QU{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,t=D0(t),On(t,32);const n=Bt(t,0),i=Bt(t,2),r=Bt(t,4),s=Bt(t,6),o=Bt(t,8),c=Bt(t,10),l=Bt(t,12),u=Bt(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|i<<3)&8191,this.r[2]=(i>>>10|r<<6)&7939,this.r[3]=(r>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|c<<2)&8191,this.r[7]=(c>>>11|l<<5)&8065,this.r[8]=(l>>>8|u<<8)&8191,this.r[9]=u>>>5&127;for(let d=0;d<8;d++)this.pad[d]=Bt(t,16+2*d)}process(t,n,i=!1){const r=i?0:2048,{h:s,r:o}=this,c=o[0],l=o[1],u=o[2],d=o[3],f=o[4],m=o[5],y=o[6],g=o[7],p=o[8],w=o[9],x=Bt(t,n+0),I=Bt(t,n+2),E=Bt(t,n+4),j=Bt(t,n+6),C=Bt(t,n+8),T=Bt(t,n+10),v=Bt(t,n+12),N=Bt(t,n+14);let M=s[0]+(x&8191),S=s[1]+((x>>>13|I<<3)&8191),L=s[2]+((I>>>10|E<<6)&8191),O=s[3]+((E>>>7|j<<9)&8191),P=s[4]+((j>>>4|C<<12)&8191),$=s[5]+(C>>>1&8191),z=s[6]+((C>>>14|T<<2)&8191),k=s[7]+((T>>>11|v<<5)&8191),B=s[8]+((v>>>8|N<<8)&8191),W=s[9]+(N>>>5|r),V=0,F=V+M*c+S*(5*w)+L*(5*p)+O*(5*g)+P*(5*y);V=F>>>13,F&=8191,F+=$*(5*m)+z*(5*f)+k*(5*d)+B*(5*u)+W*(5*l),V+=F>>>13,F&=8191;let Y=V+M*l+S*c+L*(5*w)+O*(5*p)+P*(5*g);V=Y>>>13,Y&=8191,Y+=$*(5*y)+z*(5*m)+k*(5*f)+B*(5*d)+W*(5*u),V+=Y>>>13,Y&=8191;let Q=V+M*u+S*l+L*c+O*(5*w)+P*(5*p);V=Q>>>13,Q&=8191,Q+=$*(5*g)+z*(5*y)+k*(5*m)+B*(5*f)+W*(5*d),V+=Q>>>13,Q&=8191;let Z=V+M*d+S*u+L*l+O*c+P*(5*w);V=Z>>>13,Z&=8191,Z+=$*(5*p)+z*(5*g)+k*(5*y)+B*(5*m)+W*(5*f),V+=Z>>>13,Z&=8191;let K=V+M*f+S*d+L*u+O*l+P*c;V=K>>>13,K&=8191,K+=$*(5*w)+z*(5*p)+k*(5*g)+B*(5*y)+W*(5*m),V+=K>>>13,K&=8191;let q=V+M*m+S*f+L*d+O*u+P*l;V=q>>>13,q&=8191,q+=$*c+z*(5*w)+k*(5*p)+B*(5*g)+W*(5*y),V+=q>>>13,q&=8191;let oe=V+M*y+S*m+L*f+O*d+P*u;V=oe>>>13,oe&=8191,oe+=$*l+z*c+k*(5*w)+B*(5*p)+W*(5*g),V+=oe>>>13,oe&=8191;let re=V+M*g+S*y+L*m+O*f+P*d;V=re>>>13,re&=8191,re+=$*u+z*l+k*c+B*(5*w)+W*(5*p),V+=re>>>13,re&=8191;let ae=V+M*p+S*g+L*y+O*m+P*f;V=ae>>>13,ae&=8191,ae+=$*d+z*u+k*l+B*c+W*(5*w),V+=ae>>>13,ae&=8191;let le=V+M*w+S*p+L*g+O*y+P*m;V=le>>>13,le&=8191,le+=$*f+z*d+k*u+B*l+W*c,V+=le>>>13,le&=8191,V=(V<<2)+V|0,V=V+F|0,F=V&8191,V=V>>>13,Y+=V,s[0]=F,s[1]=Y,s[2]=Q,s[3]=Z,s[4]=K,s[5]=q,s[6]=oe,s[7]=re,s[8]=ae,s[9]=le}finalize(){const{h:t,pad:n}=this,i=new Uint16Array(10);let r=t[1]>>>13;t[1]&=8191;for(let c=2;c<10;c++)t[c]+=r,r=t[c]>>>13,t[c]&=8191;t[0]+=r*5,r=t[0]>>>13,t[0]&=8191,t[1]+=r,r=t[1]>>>13,t[1]&=8191,t[2]+=r,i[0]=t[0]+5,r=i[0]>>>13,i[0]&=8191;for(let c=1;c<10;c++)i[c]=t[c]+r,r=i[c]>>>13,i[c]&=8191;i[9]-=8192;let s=(r^1)-1;for(let c=0;c<10;c++)i[c]&=s;s=~s;for(let c=0;c<10;c++)t[c]=t[c]&s|i[c];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let o=t[0]+n[0];t[0]=o&65535;for(let c=1;c<8;c++)o=(t[c]+n[c]|0)+(o>>>16)|0,t[c]=o&65535;vo(i)}update(t){q2(this),t=D0(t),On(t);const{buffer:n,blockLen:i}=this,r=t.length;for(let s=0;s<r;){const o=Math.min(i-this.pos,r-s);if(o===i){for(;i<=r-s;s+=i)this.process(t,s);continue}n.set(t.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===i&&(this.process(n,0,!1),this.pos=0)}return this}destroy(){vo(this.h,this.r,this.buffer,this.pad)}digestInto(t){q2(this),DU(t,this),this.finished=!0;const{buffer:n,h:i}=this;let{pos:r}=this;if(r){for(n[r++]=1;r<16;r++)n[r]=0;this.process(n,0,!0)}this.finalize();let s=0;for(let o=0;o<8;o++)t[s++]=i[o]>>>0,t[s++]=i[o]>>>8;return t}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const i=t.slice(0,n);return this.destroy(),i}}function ZU(e){const t=(i,r)=>e(r).update(D0(i)).digest(),n=e(new Uint8Array(32));return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=i=>e(i),t}const qU=ZU(e=>new QU(e));function GU(e,t,n,i,r,s=20){let o=e[0],c=e[1],l=e[2],u=e[3],d=t[0],f=t[1],m=t[2],y=t[3],g=t[4],p=t[5],w=t[6],x=t[7],I=r,E=n[0],j=n[1],C=n[2],T=o,v=c,N=l,M=u,S=d,L=f,O=m,P=y,$=g,z=p,k=w,B=x,W=I,V=E,F=j,Y=C;for(let Z=0;Z<s;Z+=2)T=T+S|0,W=ke(W^T,16),$=$+W|0,S=ke(S^$,12),T=T+S|0,W=ke(W^T,8),$=$+W|0,S=ke(S^$,7),v=v+L|0,V=ke(V^v,16),z=z+V|0,L=ke(L^z,12),v=v+L|0,V=ke(V^v,8),z=z+V|0,L=ke(L^z,7),N=N+O|0,F=ke(F^N,16),k=k+F|0,O=ke(O^k,12),N=N+O|0,F=ke(F^N,8),k=k+F|0,O=ke(O^k,7),M=M+P|0,Y=ke(Y^M,16),B=B+Y|0,P=ke(P^B,12),M=M+P|0,Y=ke(Y^M,8),B=B+Y|0,P=ke(P^B,7),T=T+L|0,Y=ke(Y^T,16),k=k+Y|0,L=ke(L^k,12),T=T+L|0,Y=ke(Y^T,8),k=k+Y|0,L=ke(L^k,7),v=v+O|0,W=ke(W^v,16),B=B+W|0,O=ke(O^B,12),v=v+O|0,W=ke(W^v,8),B=B+W|0,O=ke(O^B,7),N=N+P|0,V=ke(V^N,16),$=$+V|0,P=ke(P^$,12),N=N+P|0,V=ke(V^N,8),$=$+V|0,P=ke(P^$,7),M=M+S|0,F=ke(F^M,16),z=z+F|0,S=ke(S^z,12),M=M+S|0,F=ke(F^M,8),z=z+F|0,S=ke(S^z,7);let Q=0;i[Q++]=o+T|0,i[Q++]=c+v|0,i[Q++]=l+N|0,i[Q++]=u+M|0,i[Q++]=d+S|0,i[Q++]=f+L|0,i[Q++]=m+O|0,i[Q++]=y+P|0,i[Q++]=g+$|0,i[Q++]=p+z|0,i[Q++]=w+k|0,i[Q++]=x+B|0,i[Q++]=I+W|0,i[Q++]=E+V|0,i[Q++]=j+F|0,i[Q++]=C+Y|0}const KU=HU(GU,{counterRight:!1,counterLength:4,allowShortKeys:!1}),JU=new Uint8Array(16),X2=(e,t)=>
298{e.update(t);const n=t.length%16;n&&e.update(JU.subarray(n))},XU=new Uint8Array(32);function eg(e,t,n,i,r){const s=e(t,n,XU),o=qU.create(s);r&&X2(o,r),X2(o,i);const c=RU(i.length,r?r.length:0,!0);o.update(c);const l=o.digest();return vo(s,c),l}const eB=e=>(t,n,i)=>({encrypt(r,s){const o=r.length;s=G2(o+16,s,!1),s.set(r);const c=s.subarray(0,-16);e(t,n,c,c,1);const l=eg(e,t,n,c,i);return s.set(l,o),vo(l),s},decrypt(r,s){s=G2(r.length-16,s,!1);const o=r.subarray(0,-16),c=r.subarray(-16),l=eg(e,t,n,o,i);if(!zU(c,l))throw new Error("invalid tag");return s.set(r.subarray(0,-16)),e(t,n,s,s,1),vo(l),s}}),Tb=PU({blockSize:64,nonceLength:12,tagLength:16},eB(KU));let vb=class extends Ju{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,em(t);const i=gi(n);if(this.iHash=t.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 r=this.blockLen,s=new Uint8Array(r);s.set(i.length>r?t.create().update(i).digest():i);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=t.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),oi(s)}update(t){return es(this),this.iHash.update(t),this}digestInto(t){es(this),si(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:i,finished:r,destroyed:s,blockLen:o,outputLen:c}=this;return t=t,t.finished=r,t.destroyed=s,t.blockLen=o,t.outputLen=c,t.oHash=n._cloneInto(t.oHash),t.iHash=i._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const ed=(e,t,n)=>new vb(e,t).update(n).digest();ed.create=(e,t)=>new vb(e,t);function tB(e,t,n){return em(e),n===void 0&&(n=new Uint8Array(e.outputLen)),ed(e,gi(n),gi(t))}const ch=Uint8Array.from([0]),tg=Uint8Array.of();function nB(e,t,n,i=32){em(e),cr(i);const r=e.outputLen;if(i>255*r)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(i/r);n===void 0&&(n=tg);const o=new Uint8Array(s*r),c=ed.create(e,t),l=c._cloneInto(),u=new Uint8Array(c.outputLen);for(let d=0;d<s;d++)ch[0]=d+1,l.update(d===0?tg:u).update(n).update(ch).digestInto(u),o.set(u,r*d),c._cloneInto(l);return c.destroy(),l.destroy(),oi(u,ch),o.slice(0,i)}const iB=(e,t,n,i,r)=>nB(e,tB(e,t,n),i,r),td=Xu,sm=BigInt(0),O0=BigInt(1);function Yl(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Kc(e){const t=e.toString(16);return t.length&1?"0"+t:t}function Lb(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?sm:BigInt("0x"+e)}function nd(e){return Lb(Za(e))}function Hl(e){return si(e),Lb(Za(Uint8Array.from(e).reverse()))}function om(e,t){return nm(e.toString(16).padStart(t*2,"0"))}function am(e,t){return om(e,t).reverse()}function An(e,t,n){let i;if(typeof t=="string")try{i=nm(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(X1(t))i=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const r=i.length;if(typeof n=="number"&&r!==n)throw new Error(e+" of length "+n+" expected, got "+r);return i}const lh=e=>typeof e=="bigint"&&sm<=e;function rB(e,t,n){return lh(e)&&lh(t)&&lh(n)&&t<=e&&e<n}function k0(e,t,n,i){if(!rB(t,n,i))throw new Error("expected valid "+e+": "+n+" <= n < "+i+", got "+t)}function sB(e){let t;for(t=0;e>sm;e>>=O0,t+=1);return t}const id=e=>(O0<<BigInt(e))-O0;function oB(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const i=m=>new Uint8Array(m),r=m=>Uint8Array.of(m);let s=i(e),o=i(e),c=0;const l=()=>{s.fill(1),o.fill(0),c=0},u=(...m)=>n(o,s,...m),d=(m=i(0))=>{o=u(r(0),m),s=u(),m.length!==0&&(o=u(r(1),m),s=u())},f=()=>{if(c++>=1e3)throw new Error("drbg: tried 1000 values");let m=0;const y=[];for(;m<t;){s=u();const g=s.slice();y.push(g),m+=s.length}
298return gs(...y)};return(m,y)=>{l(),d(m);let g;for(;!(g=y(f()));)d();return l(),g}}function rd(e,t,n={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function i(r,s,o){const c=e[r];if(o&&c===void 0)return;const l=typeof c;if(l!==s||c===null)throw new Error(`param "${r}" is invalid: expected ${s}, got ${l}`)}Object.entries(t).forEach(([r,s])=>i(r,s,!1)),Object.entries(n).forEach(([r,s])=>i(r,s,!0))}function ng(e){const t=new WeakMap;return(n,...i)=>{const r=t.get(n);if(r!==void 0)return r;const s=e(n,...i);return t.set(n,s),s}}const zn=BigInt(0),bn=BigInt(1),ps=BigInt(2),aB=BigInt(3),jb=BigInt(4),Sb=BigInt(5),Db=BigInt(8);function ni(e,t){const n=e%t;return n>=zn?n:t+n}function hi(e,t,n){let i=e;for(;t-- >zn;)i*=i,i%=n;return i}function ig(e,t){if(e===zn)throw new Error("invert: expected non-zero number");if(t<=zn)throw new Error("invert: expected positive modulus, got "+t);let n=ni(e,t),i=t,r=zn,s=bn;for(;n!==zn;){const o=i/n,c=i%n,l=r-s*o;i=n,n=c,r=s,s=l}if(i!==bn)throw new Error("invert: does not exist");return ni(r,t)}function Nb(e,t){const n=(e.ORDER+bn)/jb,i=e.pow(t,n);if(!e.eql(e.sqr(i),t))throw new Error("Cannot find square root");return i}function cB(e,t){const n=(e.ORDER-Sb)/Db,i=e.mul(t,ps),r=e.pow(i,n),s=e.mul(t,r),o=e.mul(e.mul(s,ps),r),c=e.mul(s,e.sub(o,e.ONE));if(!e.eql(e.sqr(c),t))throw new Error("Cannot find square root");return c}function lB(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-bn,n=0;for(;t%ps===zn;)t/=ps,n++;let i=ps;const r=Qo(e);for(;rg(r,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Nb;let s=r.pow(i,t);const o=(t+bn)/ps;return function(c,l){if(c.is0(l))return l;if(rg(c,l)!==1)throw new Error("Cannot find square root");let u=n,d=c.mul(c.ONE,s),f=c.pow(l,t),m=c.pow(l,o);for(;!c.eql(f,c.ONE);){if(c.is0(f))return c.ZERO;let y=1,g=c.sqr(f);for(;!c.eql(g,c.ONE);)if(y++,g=c.sqr(g),y===u)throw new Error("Cannot find square root");const p=bn<<BigInt(u-y-1),w=c.pow(d,p);u=y,d=c.sqr(w),f=c.mul(f,d),m=c.mul(m,w)}return m}}function uB(e){return e%jb===aB?Nb:e%Db===Sb?cB:lB(e)}const dB=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function hB(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=dB.reduce((i,r)=>(i[r]="function",i),t);return rd(e,n),e}function fB(e,t,n){if(n<zn)throw new Error("invalid exponent, negatives unsupported");if(n===zn)return e.ONE;if(n===bn)return t;let i=e.ONE,r=t;for(;n>zn;)n&bn&&(i=e.mul(i,r)),r=e.sqr(r),n>>=bn;return i}function Ab(e,t,n=!1){const i=new Array(t.length).fill(n?e.ZERO:void 0),r=t.reduce((o,c,l)=>e.is0(c)?o:(i[l]=o,e.mul(o,c)),e.ONE),s=e.inv(r);return t.reduceRight((o,c,l)=>e.is0(c)?o:(i[l]=e.mul(o,i[l]),e.mul(o,c)),s),i}function rg(e,t){const n=(e.ORDER-bn)/ps,i=e.pow(t,n),r=e.eql(i,e.ONE),s=e.eql(i,e.ZERO),o=e.eql(i,e.neg(e.ONE));if(!r&&!s&&!o)throw new Error("invalid Legendre symbol result");return r?1:s?0:-1}function mB(e,t){t!==void 0&&cr(t);const n=t!==void 0?t:e.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}function Qo(e,t,n=!1,i={}){if(e<=zn)throw new Error("invalid field: expected ORDER > 0, got "+e);let r,s;if(typeof t=="object"&&t!=null){if(i.sqrt||n)throw new Error("cannot specify opts in two arguments");const d=t;d.BITS&&(r=d.BITS),d.sqrt&&(s=d.sqrt),typeof d.isLE=="boolean"&&(n=d.isLE)}else typeof t=="number"&&(r=t),i.sqrt&&(s=i.sqrt);const{nBitLength:o,nByteLength:c}=mB(e,r);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let l;const u=Object.freeze({ORDER:e,isLE:n,BITS:o,BYTES:c,MASK:id(o),ZERO:zn,ONE:bn,create:d=>ni(d,e),isValid:d=>{if(typeof d!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof d);return zn<=d&&d<e},is0:d=>d===zn,isValidNot0:d=>!u.is0(d)&&u.isValid(d),isOdd:d=>(d&bn)===bn,neg:d=>ni(-d,e),eql:(d,f)=>d===f,sqr:d=>ni(d*d,e),add:(d,f)=>ni(d+f,e),sub:(d,f)=>ni(d-f,e),mul:(d,f)=>ni(d*f,e),pow:(d,f)=>fB(u,d,f),div:(d,f)=>ni(d*ig(f,e),e),sqrN:d=>d*d,addN:(d,f)=>d+f,subN:(d,f)=>d-f,mulN:(d,f)=>d*f,inv:d=>ig(d,e),sqrt:s||(d=>(l||(l=uB(e)),l(u,d))),toBytes:d=>n?am(d,c):om(d,c),fromBytes:d=>
298{if(d.length!==c)throw new Error("Field.fromBytes: expected "+c+" bytes, got "+d.length);return n?Hl(d):nd(d)},invertBatch:d=>Ab(u,d),cmov:(d,f,m)=>m?f:d});return Object.freeze(u)}function Ob(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function kb(e){const t=Ob(e);return t+Math.ceil(t/2)}function yB(e,t,n=!1){const i=e.length,r=Ob(t),s=kb(t);if(i<16||i<s||i>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+i);const o=n?Hl(e):nd(e),c=ni(o,t-bn)+bn;return n?am(c,r):om(c,r)}const Lo=BigInt(0),ws=BigInt(1);function La(e,t){const n=t.negate();return e?n:t}function gB(e,t,n){const i=s=>s.pz,r=Ab(e.Fp,n.map(i));return n.map((s,o)=>s.toAffine(r[o])).map(e.fromAffine)}function zb(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function uh(e,t){zb(e,t);const n=Math.ceil(t/e)+1,i=2**(e-1),r=2**e,s=id(e),o=BigInt(e);return{windows:n,windowSize:i,mask:s,maxNumber:r,shiftBy:o}}function sg(e,t,n){const{windowSize:i,mask:r,maxNumber:s,shiftBy:o}=n;let c=Number(e&r),l=e>>o;c>i&&(c-=s,l+=ws);const u=t*i,d=u+Math.abs(c)-1,f=c===0,m=c<0,y=t%2!==0;return{nextN:l,offset:d,isZero:f,isNeg:m,isNegF:y,offsetF:u}}function pB(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,i)=>{if(!(n instanceof t))throw new Error("invalid point at index "+i)})}function wB(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,i)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+i)})}const dh=new WeakMap,Pb=new WeakMap;function hh(e){return Pb.get(e)||1}function og(e){if(e!==Lo)throw new Error("invalid wNAF")}function _B(e,t){return{constTimeNegate:La,hasPrecomputes(n){return hh(n)!==1},unsafeLadder(n,i,r=e.ZERO){let s=n;for(;i>Lo;)i&ws&&(r=r.add(s)),s=s.double(),i>>=ws;return r},precomputeWindow(n,i){const{windows:r,windowSize:s}=uh(i,t),o=[];let c=n,l=c;for(let u=0;u<r;u++){l=c,o.push(l);for(let d=1;d<s;d++)l=l.add(c),o.push(l);c=l.double()}return o},wNAF(n,i,r){let s=e.ZERO,o=e.BASE;const c=uh(n,t);for(let l=0;l<c.windows;l++){const{nextN:u,offset:d,isZero:f,isNeg:m,isNegF:y,offsetF:g}=sg(r,l,c);r=u,f?o=o.add(La(y,i[g])):s=s.add(La(m,i[d]))}return og(r),{p:s,f:o}},wNAFUnsafe(n,i,r,s=e.ZERO){const o=uh(n,t);for(let c=0;c<o.windows&&r!==Lo;c++){const{nextN:l,offset:u,isZero:d,isNeg:f}=sg(r,c,o);if(r=l,!d){const m=i[u];s=s.add(f?m.negate():m)}}return og(r),s},getPrecomputes(n,i,r){let s=dh.get(i);return s||(s=this.precomputeWindow(i,n),n!==1&&(typeof r=="function"&&(s=r(s)),dh.set(i,s))),s},wNAFCached(n,i,r){const s=hh(n);return this.wNAF(s,this.getPrecomputes(s,n,r),i)},wNAFCachedUnsafe(n,i,r,s){const o=hh(n);return o===1?this.unsafeLadder(n,i,s):this.wNAFUnsafe(o,this.getPrecomputes(o,n,r),i,s)},setWindowSize(n,i){zb(i,t),Pb.set(n,i),dh.delete(n)}}}function bB(e,t,n,i){let r=t,s=e.ZERO,o=e.ZERO;for(;n>Lo||i>Lo;)n&ws&&(s=s.add(r)),i&ws&&(o=o.add(r)),r=r.double(),n>>=ws,i>>=ws;return{p1:s,p2:o}}function xB(e,t,n,i){pB(n,e),wB(i,t);const r=n.length,s=i.length;if(r!==s)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,c=sB(BigInt(r));let l=1;c>12?l=c-3:c>4?l=c-2:c>0&&(l=2);const u=id(l),d=new Array(Number(u)+1).fill(o),f=Math.floor((t.BITS-1)/l)*l;let m=o;for(let y=f;y>=0;y-=l){d.fill(o);for(let p=0;p<s;p++){const w=i[p],x=Number(w>>BigInt(y)&u);d[x]=d[x].add(n[p])}let g=o;for(let p=d.length-1,w=o;p>0;p--)w=w.add(d[p]),g=g.add(w);if(m=m.add(g),y!==0)for(let p=0;p<l;p++)m=m.double()}return m}function ag(e,t){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return hB(t),t}else return Qo(e)}function IB(e,t,n={}){if(!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(const o of["p","n","h"]){const c=t[o];if(!(typeof c=="bigint"&&c>Lo))throw new Error(`CURVE.${o} must be positive bigint`)}const i=ag(t.p,n.Fp),r=ag(t.n,n.Fn),s=["Gx","Gy","a","b"];for(const o of s)if(!i.isValid(t[o]))throw new Error(`CURVE.${o} must be valid field element of CURVE.Fp`);return{Fp:i,Fn:r}}BigInt(0),BigInt(1),BigInt(2),BigInt(8);const la=BigInt(0),no=BigInt(1),Jc=BigInt(2);
298function MB(e){return rd(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})}function CB(e){const t=MB(e),{P:n,type:i,adjustScalarBytes:r,powPminus2:s,randomBytes:o}=t,c=i==="x25519";if(!c&&i!=="x448")throw new Error("invalid type");const l=o||Ho,u=c?255:448,d=c?32:56,f=BigInt(c?9:5),m=BigInt(c?121665:39081),y=c?Jc**BigInt(254):Jc**BigInt(447),g=c?BigInt(8)*Jc**BigInt(251)-no:BigInt(4)*Jc**BigInt(445)-no,p=y+g+no,w=M=>ni(M,n),x=I(f);function I(M){return am(w(M),d)}function E(M){const S=An("u coordinate",M,d);return c&&(S[31]&=127),w(Hl(S))}function j(M){return Hl(r(An("scalar",M,d)))}function C(M,S){const L=N(E(S),j(M));if(L===la)throw new Error("invalid private or public key received");return I(L)}function T(M){return C(M,x)}function v(M,S,L){const O=w(M*(S-L));return S=w(S-O),L=w(L+O),{x_2:S,x_3:L}}function N(M,S){k0("u",M,la,n),k0("scalar",S,y,p);const L=S,O=M;let P=no,$=la,z=M,k=no,B=la;for(let V=BigInt(u-1);V>=la;V--){const F=L>>V&no;B^=F,{x_2:P,x_3:z}=v(B,P,z),{x_2:$,x_3:k}=v(B,$,k),B=F;const Y=P+$,Q=w(Y*Y),Z=P-$,K=w(Z*Z),q=Q-K,oe=z+k,re=z-k,ae=w(re*Y),le=w(oe*Z),Te=ae+le,qe=ae-le;z=w(Te*Te),k=w(O*w(qe*qe)),P=w(Q*K),$=w(q*(Q+w(m*q)))}({x_2:P,x_3:z}=v(B,P,z)),{x_2:$,x_3:k}=v(B,$,k);const W=s($);return w(P*W)}return{scalarMult:C,scalarMultBase:T,getSharedSecret:(M,S)=>C(M,S),getPublicKey:M=>T(M),utils:{randomPrivateKey:()=>l(d)},GuBytes:x.slice()}}BigInt(0);const EB=BigInt(1),cg=BigInt(2),TB=BigInt(3),vB=BigInt(5),LB=BigInt(8),Rb={p:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:LB,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function jB(e){const t=BigInt(10),n=BigInt(20),i=BigInt(40),r=BigInt(80),s=Rb.p,o=e*e%s*e%s,c=hi(o,cg,s)*o%s,l=hi(c,EB,s)*e%s,u=hi(l,vB,s)*l%s,d=hi(u,t,s)*u%s,f=hi(d,n,s)*d%s,m=hi(f,i,s)*f%s,y=hi(m,r,s)*m%s,g=hi(y,r,s)*m%s,p=hi(g,t,s)*u%s;return{pow_p_5_8:hi(p,cg,s)*e%s,b2:o}}function SB(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const z0=(()=>{const e=Rb.p;return CB({P:e,type:"x25519",powPminus2:t=>{const{pow_p_5_8:n,b2:i}=jB(t);return ni(hi(n,TB,e)*i,e)},adjustScalarBytes:SB})})();function lg(e){e.lowS!==void 0&&Yl("lowS",e.lowS),e.prehash!==void 0&&Yl("prehash",e.prehash)}class DB extends Error{constructor(t=""){super(t)}}const Ji={Err:DB,_tlv:{encode:(e,t)=>{const{Err:n}=Ji;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const i=t.length/2,r=Kc(i);if(r.length/2&128)throw new n("tlv.encode: long form length too big");const s=i>127?Kc(r.length/2|128):"";return Kc(e)+s+r+t},decode(e,t){const{Err:n}=Ji;let i=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new n("tlv.decode: wrong tlv");const r=t[i++],s=!!(r&128);let o=0;if(!s)o=r;else{const l=r&127;if(!l)throw new n("tlv.decode(long): indefinite length not supported");if(l>4)throw new n("tlv.decode(long): byte length is too big");const u=t.subarray(i,i+l);if(u.length!==l)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const d of u)o=o<<8|d;if(i+=l,o<128)throw new n("tlv.decode(long): not minimal encoding")}const c=t.subarray(i,i+o);if(c.length!==o)throw new n("tlv.decode: wrong value length");return{v:c,l:t.subarray(i+o)}}},_int:{encode(e){const{Err:t}=Ji;if(e<ja)throw new t("integer: negative integers are not allowed");let n=Kc(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=Ji;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return nd(e)}},toSig(e){const{Err:t,_int:n,_tlv:i}=Ji,r=An("signature",e),{v:s,l:o}=i.decode(48,r);if(o.length)throw new t("invalid signature: left bytes after parsing");const{v:c,l}=i.decode(2,s),{v:u,l:d}=i.decode(2,l);if(d.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(c),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=Ji,i=t.encode(2,n.encode(e.r)),r=t.encode(2,n.encode(e.s)),s=i+r;return t.encode(48,s)}},ja=BigInt(0),Sa=BigInt(1),NB=BigInt(2),Xc=BigInt(3),AB=BigInt(4);function OB(e,t,n){function i(r){const s=e.sqr(r),o=e.mul(s,r);return e.add(e.add(o,e.mul(r,t)),n)}return i}function Ub(e,t,n){const{BYTES:i}=e;function r(s){let o;if(typeof s=="bigint")o=s;else{let c=An("private key",s);if(t){if(!t.includes(c.length*2))throw new Error("invalid private key");const l=new Uint8Array(i);l.set(c,l.length-c.length),c=l}try{o=e.fromBytes(c)}catch{throw new Error(`invalid private key: expected ui8a of size ${i}, got ${typeof s}`)}}if(n&&(o=e.create(o)),!e.isValidNot0(o))throw new Error("invalid private key: out of range [1..N-1]");return o}return r}function kB(e,t={}){const{Fp:n,Fn:i}=IB("weierstrass",e,t),{h:r,n:s}=e;rd(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});
298const{endo:o}=t;if(o&&(!n.is0(e.a)||typeof o.beta!="bigint"||typeof o.splitScalar!="function"))throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');function c(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function l(N,M,S){const{x:L,y:O}=M.toAffine(),P=n.toBytes(L);if(Yl("isCompressed",S),S){c();const $=!n.isOdd(O);return gs(Bb($),P)}else return gs(Uint8Array.of(4),P,n.toBytes(O))}function u(N){si(N);const M=n.BYTES,S=M+1,L=2*M+1,O=N.length,P=N[0],$=N.subarray(1);if(O===S&&(P===2||P===3)){const z=n.fromBytes($);if(!n.isValid(z))throw new Error("bad point: is not on curve, wrong x");const k=m(z);let B;try{B=n.sqrt(k)}catch(V){const F=V instanceof Error?": "+V.message:"";throw new Error("bad point: is not on curve, sqrt error"+F)}c();const W=n.isOdd(B);return(P&1)===1!==W&&(B=n.neg(B)),{x:z,y:B}}else if(O===L&&P===4){const z=n.fromBytes($.subarray(M*0,M*1)),k=n.fromBytes($.subarray(M*1,M*2));if(!y(z,k))throw new Error("bad point: is not on curve");return{x:z,y:k}}else throw new Error(`bad point: got length ${O}, expected compressed=${S} or uncompressed=${L}`)}const d=t.toBytes||l,f=t.fromBytes||u,m=OB(n,e.a,e.b);function y(N,M){const S=n.sqr(M),L=m(N);return n.eql(S,L)}if(!y(e.Gx,e.Gy))throw new Error("bad curve params: generator point");const g=n.mul(n.pow(e.a,Xc),AB),p=n.mul(n.sqr(e.b),BigInt(27));if(n.is0(n.add(g,p)))throw new Error("bad curve params: a or b");function w(N,M,S=!1){if(!n.isValid(M)||S&&n.is0(M))throw new Error(`bad point coordinate ${N}`);return M}function x(N){if(!(N instanceof C))throw new Error("ProjectivePoint expected")}const I=ng((N,M)=>{const{px:S,py:L,pz:O}=N;if(n.eql(O,n.ONE))return{x:S,y:L};const P=N.is0();M==null&&(M=P?n.ONE:n.inv(O));const $=n.mul(S,M),z=n.mul(L,M),k=n.mul(O,M);if(P)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:$,y:z}}),E=ng(N=>{if(N.is0()){if(t.allowInfinityPoint&&!n.is0(N.py))return;throw new Error("bad point: ZERO")}const{x:M,y:S}=N.toAffine();if(!n.isValid(M)||!n.isValid(S))throw new Error("bad point: x or y not field elements");if(!y(M,S))throw new Error("bad point: equation left != right");if(!N.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function j(N,M,S,L,O){return S=new C(n.mul(S.px,N),S.py,S.pz),M=La(L,M),S=La(O,S),M.add(S)}class C{constructor(M,S,L){this.px=w("x",M),this.py=w("y",S,!0),this.pz=w("z",L),Object.freeze(this)}static fromAffine(M){const{x:S,y:L}=M||{};if(!M||!n.isValid(S)||!n.isValid(L))throw new Error("invalid affine point");if(M instanceof C)throw new Error("projective point not allowed");return n.is0(S)&&n.is0(L)?C.ZERO:new C(S,L,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(M){return gB(C,"pz",M)}static fromBytes(M){return si(M),C.fromHex(M)}static fromHex(M){const S=C.fromAffine(f(An("pointHex",M)));return S.assertValidity(),S}static fromPrivateKey(M){const S=Ub(i,t.allowedPrivateKeyLengths,t.wrapPrivateKey);return C.BASE.multiply(S(M))}static msm(M,S){return xB(C,i,M,S)}precompute(M=8,S=!0){return v.setWindowSize(this,M),S||this.multiply(Xc),this}_setWindowSize(M){this.precompute(M)}assertValidity(){E(this)}hasEvenY(){const{y:M}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(M)}equals(M){x(M);const{px:S,py:L,pz:O}=this,{px:P,py:$,pz:z}=M,k=n.eql(n.mul(S,z),n.mul(P,O)),B=n.eql(n.mul(L,z),n.mul($,O));return k&&B}negate(){return new C(this.px,n.neg(this.py),this.pz)}double(){const{a:M,b:S}=e,L=n.mul(S,Xc),{px:O,py:P,pz:$}=this;let z=n.ZERO,k=n.ZERO,B=n.ZERO,W=n.mul(O,O),V=n.mul(P,P),F=n.mul($,$),Y=n.mul(O,P);return Y=n.add(Y,Y),B=n.mul(O,$),B=n.add(B,B),z=n.mul(M,B),k=n.mul(L,F),k=n.add(z,k),z=n.sub(V,k),k=n.add(V,k),k=n.mul(z,k),z=n.mul(Y,z),B=n.mul(L,B),F=n.mul(M,F),Y=n.sub(W,F),Y=n.mul(M,Y),Y=n.add(Y,B),B=n.add(W,W),W=n.add(B,W),W=n.add(W,F),W=n.mul(W,Y),k=n.add(k,W),F=n.mul(P,$),F=n.add(F,F),W=n.mul(F,Y),z=n.sub(z,W),B=n.mul(F,V),B=n.add(B,B),B=n.add(B,B),new C(z,k,B)}add(M){x(M);const{px:S,py:L,pz:O}=this,{px:P,py:$,pz:z}=M;let k=n.ZERO,B=n.ZERO,W=n.ZERO;const V=e.a,F=n.mul(e.b,Xc);let Y=n.mul(S,P),Q=n.mul(L,$),Z=n.mul(O,z),K=n.add(S,L),q=n.add(P,$);K=n.mul(K,q),q=n.add(Y,Q),K=n.sub(K,q),q=n.add(S,O);let oe=n.add(P,z);return q=n.mul(q,oe),oe=n.add(Y,Z),q=n.sub(q,oe),oe=n.add(L,O),k=n.add($,z),oe=n.mul(oe,k),k=n.add(Q,Z),oe=n.sub(oe,k),W=n.mul(V,q),k=n.mul(F,Z),W=n.add(k,W),k=n.sub(Q,W),W=n.add(Q,W),B=n.mul(k,W),Q=n.add(Y,Y),Q=n.add(Q,Y),Z=n.mul(V,Z),q=n.mul(F,q),Q=n.add(Q,Z),Z=n.sub(Y,Z),Z=n.mul(V,Z),q=n.add(q,Z),Y=n.mul(Q,q),B=n.add(B,Y),Y=n.mul(oe,q),k=n.mul(K,k),k=n.sub(k,Y),Y=n.mul(K,Q),W=n.mul(oe,W),W=n.add(W,Y),new C(k,B,W)}subtract(M){return this.add(M.negate())}is0(){return this.equals(C.ZERO)}
298multiply(M){const{endo:S}=t;if(!i.isValidNot0(M))throw new Error("invalid scalar: out of range");let L,O;const P=$=>v.wNAFCached(this,$,C.normalizeZ);if(S){const{k1neg:$,k1:z,k2neg:k,k2:B}=S.splitScalar(M),{p:W,f:V}=P(z),{p:F,f:Y}=P(B);O=V.add(Y),L=j(S.beta,W,F,$,k)}else{const{p:$,f:z}=P(M);L=$,O=z}return C.normalizeZ([L,O])[0]}multiplyUnsafe(M){const{endo:S}=t,L=this;if(!i.isValid(M))throw new Error("invalid scalar: out of range");if(M===ja||L.is0())return C.ZERO;if(M===Sa)return L;if(v.hasPrecomputes(this))return this.multiply(M);if(S){const{k1neg:O,k1:P,k2neg:$,k2:z}=S.splitScalar(M),{p1:k,p2:B}=bB(C,L,P,z);return j(S.beta,k,B,O,$)}else return v.wNAFCachedUnsafe(L,M)}multiplyAndAddUnsafe(M,S,L){const O=this.multiplyUnsafe(S).add(M.multiplyUnsafe(L));return O.is0()?void 0:O}toAffine(M){return I(this,M)}isTorsionFree(){const{isTorsionFree:M}=t;return r===Sa?!0:M?M(C,this):v.wNAFCachedUnsafe(this,s).is0()}clearCofactor(){const{clearCofactor:M}=t;return r===Sa?this:M?M(C,this):this.multiplyUnsafe(r)}toBytes(M=!0){return Yl("isCompressed",M),this.assertValidity(),d(C,this,M)}toRawBytes(M=!0){return this.toBytes(M)}toHex(M=!0){return Za(this.toBytes(M))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}C.BASE=new C(e.Gx,e.Gy,n.ONE),C.ZERO=new C(n.ZERO,n.ONE,n.ZERO),C.Fp=n,C.Fn=i;const T=i.BITS,v=_B(C,t.endo?Math.ceil(T/2):T);return C}function Bb(e){return Uint8Array.of(e?2:3)}function zB(e,t,n={}){rd(t,{hash:"function"},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const i=t.randomBytes||Ho,r=t.hmac||((L,...O)=>ed(t.hash,L,gs(...O))),{Fp:s,Fn:o}=e,{ORDER:c,BITS:l}=o;function u(L){const O=c>>Sa;return L>O}function d(L){return u(L)?o.neg(L):L}function f(L,O){if(!o.isValidNot0(O))throw new Error(`invalid signature ${L}: out of range 1..CURVE.n`)}class m{constructor(O,P,$){f("r",O),f("s",P),this.r=O,this.s=P,$!=null&&(this.recovery=$),Object.freeze(this)}static fromCompact(O){const P=o.BYTES,$=An("compactSignature",O,P*2);return new m(o.fromBytes($.subarray(0,P)),o.fromBytes($.subarray(P,P*2)))}static fromDER(O){const{r:P,s:$}=Ji.toSig(An("DER",O));return new m(P,$)}assertValidity(){}addRecoveryBit(O){return new m(this.r,this.s,O)}recoverPublicKey(O){const P=s.ORDER,{r:$,s:z,recovery:k}=this;if(k==null||![0,1,2,3].includes(k))throw new Error("recovery id invalid");if(c*NB<P&&k>1)throw new Error("recovery id is ambiguous for h>1 curve");const B=k===2||k===3?$+c:$;if(!s.isValid(B))throw new Error("recovery id 2 or 3 invalid");const W=s.toBytes(B),V=e.fromHex(gs(Bb((k&1)===0),W)),F=o.inv(B),Y=E(An("msgHash",O)),Q=o.create(-Y*F),Z=o.create(z*F),K=e.BASE.multiplyUnsafe(Q).add(V.multiplyUnsafe(Z));if(K.is0())throw new Error("point at infinify");return K.assertValidity(),K}hasHighS(){return u(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,o.neg(this.s),this.recovery):this}toBytes(O){if(O==="compact")return gs(o.toBytes(this.r),o.toBytes(this.s));if(O==="der")return nm(Ji.hexFromSig(this));throw new Error("invalid format")}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Za(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Za(this.toBytes("compact"))}}const y=Ub(o,n.allowedPrivateKeyLengths,n.wrapPrivateKey),g={isValidPrivateKey(L){try{return y(L),!0}catch{return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{const L=c;return yB(i(kb(L)),L)},precompute(L=8,O=e.BASE){return O.precompute(L,!1)}};function p(L,O=!0){return e.fromPrivateKey(L).toBytes(O)}function w(L){if(typeof L=="bigint")return!1;if(L instanceof e)return!0;const O=An("key",L).length,P=s.BYTES,$=P+1,z=2*P+1;if(!(n.allowedPrivateKeyLengths||o.BYTES===$))return O===$||O===z}function x(L,O,P=!0){if(w(L)===!0)throw new Error("first arg must be private key");if(w(O)===!1)throw new Error("second arg must be public key");return e.fromHex(O).multiply(y(L)).toBytes(P)}const I=t.bits2int||function(L){if(L.length>8192)throw new Error("input is too large");const O=nd(L),P=L.length*8-l;return P>0?O>>BigInt(P):O},E=t.bits2int_modN||function(L){return o.create(I(L))},j=id(l);function C(L){return k0("num < 2^"+l,L,ja,j),o.toBytes(L)}function T(L,O,P=v){if(["recovered","canonical"].some(K=>K in P))throw new Error("sign() legacy options not supported");const{hash:$}=t;let{lowS:z,prehash:k,extraEntropy:B}=P;z==null&&(z=!0),L=An("msgHash",L),lg(P),k&&(L=An("prehashed msgHash",$(L)));const W=E(L),V=y(O),F=[C(V),C(W)];if(B!=null&&B!==!1){const K=B===!0?i(s.BYTES):B;F.push(An("extraEntropy",K))}const Y=gs(...F),Q=W;function Z(K){const q=I(K);if(!o.isValidNot0(q))return;const oe=o.inv(q),re=e.BASE.multiply(q).toAffine(),ae=o.create(re.x);if(ae===ja)return;const le=o.create(oe*o.create(Q+ae*V));if(le===ja)return;let Te=(re.x===ae?0:2)|Number(re.y&Sa),qe=le;return z&&u(le)&&(qe=d(le),Te^=1),new m(ae,qe,Te)}return{seed:Y,k2sig:Z}}const v={lowS:t.lowS,prehash:!1},N={lowS:t.lowS,prehash:!1};function M(L,O,P=v){const{seed:$,k2sig:z}=T(L,O,P);return oB(t.hash.outputLen,o.BYTES,r)($,z)}e.BASE.precompute(8);function S(L,O,P,$=N){const z=L;O=An("msgHash",O),P=An("publicKey",P),lg($);const{lowS:k,prehash:B,format:W}=$;if("strict"in $)throw new Error("options.strict was renamed to lowS");if(W!==void 0&&!["compact","der","js"].includes(W))throw new Error('format must be "compact", "der" or "js"');const V=typeof z=="string"||X1(z),F=!V&&!W&&typeof z=="object"&&z!==null&&typeof z.r=="bigint"&&typeof z.s=="bigint";if(!V&&!F)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Y,Q;try{if(F)if(W===void 0||W==="js")Y=new m(z.r,z.s);else throw new Error("invalid format");if(V){try{W!=="compact"&&(Y=m.fromDER(z))}catch(Te){if(!(Te instanceof Ji.Err))throw Te}!Y&&W!=="der"&&(Y=m.fromCompact(z))}Q=e.fromHex(P)}catch{return!1}if(!Y||k&&Y.hasHighS())return!1;B&&(O=t.hash(O));const{r:Z,s:K}=Y,q=E(O),oe=o.inv(K),re=o.create(q*oe),ae=o.create(Z*oe),le=e.BASE.multiplyUnsafe(re).add(Q.multiplyUnsafe(ae));return le.is0()?!1:o.create(le.x)===Z}return Object.freeze({getPublicKey:p,getSharedSecret:x,sign:M,verify:S,utils:g,Point:e,Signature:m})}function PB(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp,i=Qo(t.n,e.nBitLength),r={Fp:n,Fn:i,allowedPrivateKeyLengths:e.allowedPrivateKeyLengths,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,wrapPrivateKey:e.wrapPrivateKey,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:r}}function RB(e){const{CURVE:t,curveOpts:n}=PB(e),i={hash:e.hash,hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,ecdsaOpts:i}}function UB(e,t){return Object.assign({},t,{ProjectivePoint:t.Point,CURVE:e})}function BB(e){const{CURVE:t,curveOpts:n,ecdsaOpts:i}=RB(e),r=kB(t,n),s=zB(r,i,n);return UB(e,s)}function P0(e,t){const n=i=>BB({...e,hash:i});return{...n(t),create:n}}const Vb={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),G
298y:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},$b={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},Wb={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},VB=Qo(Vb.p),$B=Qo($b.p),WB=Qo(Wb.p),FB=P0({...Vb,Fp:VB,lowS:!1},Xu);P0({...$b,Fp:$B,lowS:!1},KR),P0({...Wb,Fp:WB,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},GR);const YB=FB,Fb="base10",xn="base16",kn="base64pad",Nr="base64url",Tc="utf8",Yb=0,nr=1,vc=2,HB=0,ug=1,Da=12,cm=32;function QB(){const e=z0.utils.randomPrivateKey(),t=z0.getPublicKey(e);return{privateKey:Pn(e,xn),publicKey:Pn(t,xn)}}function R0(){const e=Ho(cm);return Pn(e,xn)}function ZB(e,t){const n=z0.getSharedSecret(ri(e,xn),ri(t,xn)),i=iB(td,n,void 0,void 0,cm);return Pn(i,xn)}function ml(e){const t=td(ri(e,xn));return Pn(t,xn)}function ei(e){const t=td(ri(e,Tc));return Pn(t,xn)}function Hb(e){return ri(`${e}`,Fb)}function Os(e){return Number(Pn(e,Fb))}function Qb(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Zb(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=(4-t.length%4)%4;return t+"=".repeat(n)}function qB(e){const t=Hb(typeof e.type<"u"?e.type:Yb);if(Os(t)===nr&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const n=typeof e.senderPublicKey<"u"?ri(e.senderPublicKey,xn):void 0,i=typeof e.iv<"u"?ri(e.iv,xn):Ho(Da),r=ri(e.symKey,xn),s=Tb(r,i).encrypt(ri(e.message,Tc)),o=qb({type:t,sealed:s,iv:i,senderPublicKey:n});return e.encoding===Nr?Qb(o):o}function GB(e){const t=ri(e.symKey,xn),{sealed:n,iv:i}=Ga({encoded:e.encoded,encoding:e.encoding}),r=Tb(t,i).decrypt(n);if(r===null)throw new Error("Failed to decrypt");return Pn(r,Tc)}function KB(e,t){const n=Hb(vc),i=Ho(Da),r=ri(e,Tc),s=qb({type:n,sealed:r,iv:i});return t===Nr?Qb(s):s}function JB(e,t){const{sealed:n}=Ga({encoded:e,encoding:t});return Pn(n,Tc)}function qb(e){if(Os(e.type)===vc)return Pn(va([e.type,e.sealed]),kn);if(Os(e.type)===nr){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Pn(va([e.type,e.senderPublicKey,e.iv,e.sealed]),kn)}return Pn(va([e.type,e.iv,e.sealed]),kn)}function Ga(e){const t=(e.encoding||kn)===Nr?Zb(e.encoded):e.encoded,n=ri(t,kn),i=n.slice(HB,ug),r=ug;if(Os(i)===nr){const l=r+cm,u=l+Da,d=n.slice(r,l),f=n.slice(l,u),m=n.slice(u);return{type:i,sealed:m,iv:f,senderPublicKey:d}}if(Os(i)===vc){const l=n.slice(r),u=Ho(Da);return{type:i,sealed:l,iv:u}}const s=r+Da,o=n.slice(r,s),c=n.slice(s);return{type:i,sealed:c,iv:o}}function XB(e,t){const n=Ga({encoded:e,encoding:t==null?void 0:t.encoding});return Gb({type:Os(n.type),senderPublicKey:typeof n.senderPublicKey<"u"?Pn(n.senderPublicKey,xn):void 0,receiverPublicKey:t==null?void 0:t.receiverPublicKey})}function Gb(e){const t=(e==null?void 0:e.type)||Yb;if(t===nr){if(typeof(e==null?void 0:e.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(e==null?void 0:e.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e==null?void 0:e.senderPublicKey,receiverPublicKey:e==null?void 0:e.receiverPublicKey}}function dg(e){return e.type===nr&&typeof e.senderPublicKey=="string"&&typeof e.receiverPublicKey=="string"}function hg(e){return e.type===vc}function eV(e){const t=Ve.from(e.x,"base64"),n=Ve.from(e.y,"base64");return va([new Uint8Array([4]),t,n])}function tV(e,t){const[n,i,r]=e.split("."),s=Ve.from(Zb(r),"base64");if(s.length!==64)throw new Error("Invalid signature length");const o=s.slice(0,32),c=s.slice(32,64),l=`${n}.${i}`,u=td(l),d=eV(t);if(!YB.verify(va([o,c]),u,d))throw new Error("Invalid signature");return b0(e).payload}const nV="irn";function Ql(e){return(e==null?void 0:e.relay)||{protocol:nV}}function co(e){const t=jP[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}function iV(e,t="-"){const n={},i="relay"+t;return Object.keys(e).forEach(r=>{if(r.startsWith(i)){const s=r.replace(i,""),o=e[r];n[s]=o}}),n}function fg(e){if(!e.includes("wc:")){const u=ab(e);u!=null&&u.includes("wc:")&&(e=u)}e=e.includes("wc://")?e.replace("wc://",""):e,e=e.includes("wc:")?e.replace("wc:",""):e;const t=e.indexOf(":"),n=e.indexOf("?")!==-1?e.indexOf("?"):void 0,i=e.substring(0,t),r=e.substring(t+1,n).split("@"),s=typeof n<"u"?e.substring(n):"",o=new URLSearchParams(s),c={};o.forEach((u,d)=>{c[d]=u});
298const l=typeof c.methods=="string"?c.methods.split(","):void 0;return{protocol:i,topic:rV(r[0]),version:parseInt(r[1],10),symKey:c.symKey,relay:iV(c),methods:l,expiryTimestamp:c.expiryTimestamp?parseInt(c.expiryTimestamp,10):void 0}}function rV(e){return e.startsWith("//")?e.substring(2):e}function sV(e,t="-"){const n="relay",i={};return Object.keys(e).forEach(r=>{const s=r,o=n+t+s;e[s]&&(i[o]=e[s])}),i}function mg(e){const t=new URLSearchParams,n=sV(e.relay);Object.keys(n).sort().forEach(r=>{t.set(r,n[r])}),t.set("symKey",e.symKey),e.expiryTimestamp&&t.set("expiryTimestamp",e.expiryTimestamp.toString()),e.methods&&t.set("methods",e.methods.join(","));const i=t.toString();return`${e.protocol}:${e.topic}@${e.version}?${i}`}function el(e,t,n){return`${e}?wc_ev=${n}&topic=${t}`}var oV=Object.defineProperty,aV=Object.defineProperties,cV=Object.getOwnPropertyDescriptors,yg=Object.getOwnPropertySymbols,lV=Object.prototype.hasOwnProperty,uV=Object.prototype.propertyIsEnumerable,gg=(e,t,n)=>t in e?oV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dV=(e,t)=>{for(var n in t||(t={}))lV.call(t,n)&&gg(e,n,t[n]);if(yg)for(var n of yg(t))uV.call(t,n)&&gg(e,n,t[n]);return e},hV=(e,t)=>aV(e,cV(t));function Zo(e){const t=[];return e.forEach(n=>{const[i,r]=n.split(":");t.push(`${i}:${r}`)}),t}function fV(e){const t=[];return Object.values(e).forEach(n=>{t.push(...Zo(n.accounts))}),t}function mV(e,t){const n=[];return Object.values(e).forEach(i=>{Zo(i.accounts).includes(t)&&n.push(...i.methods)}),n}function yV(e,t){const n=[];return Object.values(e).forEach(i=>{Zo(i.accounts).includes(t)&&n.push(...i.events)}),n}function Kb(e){return e.includes(":")}function gV(e){return Kb(e)?e.split(":")[0]:e}function pg(e){var t,n,i;const r={};if(!Ka(e))return r;for(const[s,o]of Object.entries(e)){const c=Kb(s)?[s]:o.chains,l=o.methods||[],u=o.events||[],d=gV(s);r[d]=hV(dV({},r[d]),{chains:Ms(c,(t=r[d])==null?void 0:t.chains),methods:Ms(l,(n=r[d])==null?void 0:n.methods),events:Ms(u,(i=r[d])==null?void 0:i.events)})}return r}function pV(e){const t={};return e==null||e.forEach(n=>{var i;const[r,s]=n.split(":");t[r]||(t[r]={accounts:[],chains:[],events:[],methods:[]}),t[r].accounts.push(n),(i=t[r].chains)==null||i.push(`${r}:${s}`)}),t}function wg(e,t){t=t.map(i=>i.replace("did:pkh:",""));const n=pV(t);for(const[i,r]of Object.entries(n))r.methods?r.methods=Ms(r.methods,e):r.methods=e,r.events=["chainChanged","accountsChanged"];return n}function wV(e,t){var n,i,r,s,o,c;const l=pg(e),u=pg(t),d={},f=Object.keys(l).concat(Object.keys(u));for(const m of f)d[m]={chains:Ms((n=l[m])==null?void 0:n.chains,(i=u[m])==null?void 0:i.chains),methods:Ms((r=l[m])==null?void 0:r.methods,(s=u[m])==null?void 0:s.methods),events:Ms((o=l[m])==null?void 0:o.events,(c=u[m])==null?void 0:c.events)};return d}const _V={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}},bV={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}};
298function ne(e,t){const{message:n,code:i}=bV[e];return{message:t?`${n} ${t}`:n,code:i}}function lt(e,t){const{message:n,code:i}=_V[e];return{message:t?`${n} ${t}`:n,code:i}}function jo(e,t){return!!Array.isArray(e)}function Ka(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function At(e){return typeof e>"u"}function xt(e,t){return t&&At(e)?!0:typeof e=="string"&&!!e.trim().length}function lm(e,t){return typeof e=="number"&&!isNaN(e)}function xV(e,t){const{requiredNamespaces:n}=t,i=Object.keys(e.namespaces),r=Object.keys(n);let s=!0;return ys(r,i)?(i.forEach(o=>{const{accounts:c,methods:l,events:u}=e.namespaces[o],d=Zo(c),f=n[o];(!ys(nb(o,f),d)||!ys(f.methods,l)||!ys(f.events,u))&&(s=!1)}),s):!1}function Zl(e){return xt(e,!1)&&e.includes(":")?e.split(":").length===2:!1}function IV(e){if(xt(e,!1)&&e.includes(":")){const t=e.split(":");if(t.length===3){const n=t[0]+":"+t[1];return!!t[2]&&Zl(n)}}return!1}function MV(e){function t(n){try{return typeof new URL(n)<"u"}catch{return!1}}try{if(xt(e,!1)){if(t(e))return!0;const n=ab(e);return t(n)}}catch{}return!1}function CV(e){var t;return(t=e==null?void 0:e.proposer)==null?void 0:t.publicKey}function EV(e){return e==null?void 0:e.topic}function TV(e,t){let n=null;return xt(e==null?void 0:e.publicKey,!1)||(n=ne("MISSING_OR_INVALID",`${t} controller public key should be a string`)),n}function _g(e){let t=!0;return jo(e)?e.length&&(t=e.every(n=>xt(n,!1))):t=!1,t}function vV(e,t,n){let i=null;return jo(t)&&t.length?t.forEach(r=>{i||Zl(r)||(i=lt("UNSUPPORTED_CHAINS",`${n}, chain ${r} should be a string and conform to "namespace:chainId" format`))}):Zl(e)||(i=lt("UNSUPPORTED_CHAINS",`${n}, 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"] }`)),i}function LV(e,t,n){let i=null;return Object.entries(e).forEach(([r,s])=>{if(i)return;const o=vV(r,nb(r,s),`${t} ${n}`);o&&(i=o)}),i}function jV(e,t){let n=null;return jo(e)?e.forEach(i=>{n||IV(i)||(n=lt("UNSUPPORTED_ACCOUNTS",`${t}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):n=lt("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),n}function SV(e,t){let n=null;return Object.values(e).forEach(i=>{if(n)return;const r=jV(i==null?void 0:i.accounts,`${t} namespace`);r&&(n=r)}),n}function DV(e,t){let n=null;return _g(e==null?void 0:e.methods)?_g(e==null?void 0:e.events)||(n=lt("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):n=lt("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),n}function Jb(e,t){let n=null;return Object.values(e).forEach(i=>{if(n)return;const r=DV(i,`${t}, namespace`);r&&(n=r)}),n}function NV(e,t,n){let i=null;if(e&&Ka(e)){const r=Jb(e,t);r&&(i=r);const s=LV(e,t,n);s&&(i=s)}else i=ne("MISSING_OR_INVALID",`${t}, ${n} should be an object with data`);return i}function fh(e,t){let n=null;if(e&&Ka(e)){const i=Jb(e,t);i&&(n=i);const r=SV(e,t);r&&(n=r)}else n=ne("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return n}function Xb(e){return xt(e.protocol,!0)}function AV(e,t){let n=!1;return e?e&&jo(e)&&e.length&&e.forEach(i=>{n=Xb(i)}):n=!0,n}function OV(e){return typeof e=="number"}function Sn(e){return typeof e<"u"&&typeof e!==null}function kV(e){return!(!e||typeof e!="object"||!e.code||!lm(e.code)||!e.message||!xt(e.message,!1))}function zV(e){return!(At(e)||!xt(e.method,!1))}function PV(e){return!(At(e)||At(e.result)&&At(e.error)||!lm(e.id)||!xt(e.jsonrpc,!1))}function RV(e){return!(At(e)||!xt(e.name,!1))}function bg(e,t){return!(!Zl(t)||!fV(e).includes(t))}function UV(e,t,n){return xt(n,!1)?mV(e,t).includes(n):!1}function BV(e,t,n){return xt(n,!1)?yV(e,t).includes(n):!1}function xg(e,t,n){let i=null;const r=VV(e),s=$V(t),o=Object.keys(r),c=Object.keys(s),l=Ig(Object.keys(e)),u=Ig(Object.keys(t)),d=l.filter(f=>!u.includes(f));return d.length&&(i=ne("NON_CONFORMING_NAMESPACES",`${n} namespaces keys don't satisfy requiredNamespaces.
299      Required: ${d.toString()}
300      Received: ${Object.keys(t).toString()}`)),ys(o,c)||(i=ne("NON_CONFORMING_NAMESPACES",`${n} namespaces chains don't satisfy required namespaces.
301      Required: ${o.toString()}
302      Approved: ${c.toString()}`)),Object.keys(t).forEach(f=>{if(!f.includes(":")||i)return;const m=Zo(t[f].accounts);m.includes(f)||(i=ne("NON_CONFORMING_NAMESPACES",`${n} namespaces accounts don't satisfy namespace accounts for ${f}
303        Required: ${f}
304        Approved: ${m.toString()}`))}),o.forEach(f=>{i||(ys(r[f].methods,s[f].methods)?ys(r[f].events,s[f].events)||(i=ne("NON_CONFORMING_NAMESPACES",`${n} namespaces events don't satisfy namespace events for ${f}`)):i=ne("NON_CONFORMING_NAMESPACES",`${n} namespaces methods don't satisfy namespace methods for ${f}`))}),i}function VV(e){const t={};return Object.keys(e).forEach(n=>{var i;
304n.includes(":")?t[n]=e[n]:(i=e[n].chains)==null||i.forEach(r=>{t[r]={methods:e[n].methods,events:e[n].events}})}),t}function Ig(e){return[...new Set(e.map(t=>t.includes(":")?t.split(":")[0]:t))]}function $V(e){const t={};return Object.keys(e).forEach(n=>{if(n.includes(":"))t[n]=e[n];else{const i=Zo(e[n].accounts);i==null||i.forEach(r=>{t[r]={accounts:e[n].accounts.filter(s=>s.includes(`${r}:`)),methods:e[n].methods,events:e[n].events}})}}),t}function WV(e,t){return lm(e)&&e<=t.max&&e>=t.min}function Mg(){const e=Cc();return new Promise(t=>{switch(e){case Fn.browser:t(FV());break;case Fn.reactNative:t(YV());break;case Fn.node:t(HV());break;default:t(!0)}})}function FV(){return Yo()&&(navigator==null?void 0:navigator.onLine)}async function YV(){if(rs()&&typeof we<"u"&&we!=null&&we.NetInfo){const e=await(we==null?void 0:we.NetInfo.fetch());return e==null?void 0:e.isConnected}return!0}function HV(){return!0}function QV(e){switch(Cc()){case Fn.browser:ZV(e);break;case Fn.reactNative:qV(e);break}}function ZV(e){!rs()&&Yo()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)))}function qV(e){var t;rs()&&typeof we<"u"&&we!=null&&we.NetInfo&&((t=we)==null||t.NetInfo.addEventListener(n=>e(n==null?void 0:n.isConnected)))}function GV(){var e;return Yo()&&Ds()?((e=Ds())==null?void 0:e.visibilityState)==="visible":!0}const mh={};class ua{static get(t){return mh[t]}static set(t,n){mh[t]=n}static delete(t){delete mh[t]}}function KV(e){const t=Ic.decode(e);if(t.length<33)throw new Error("Too short to contain a public key");return t.slice(1,33)}function JV({publicKey:e,signature:t,payload:n}){var i;const r=U0(n.method),s=128|parseInt(((i=n.version)==null?void 0:i.toString())||"4"),o=t$(n.address),c=n.era==="00"?new Uint8Array([0]):U0(n.era);if(c.length!==1&&c.length!==2)throw new Error("Invalid era length");const l=parseInt(n.nonce,16),u=new Uint8Array([l&255,l>>8&255]),d=BigInt(`0x${e$(n.tip)}`),f=i$(d),m=new Uint8Array([0,...e,o,...t,...c,...u,...f,...r]),y=n$(m.length+1);return new Uint8Array([...y,s,...m])}function XV(e){const t=U0(e),n=VP.blake2b(t,void 0,32);return"0x"+Ve.from(n).toString("hex")}function U0(e){return new Uint8Array(e.replace(/^0x/,"").match(/.{1,2}/g).map(t=>parseInt(t,16)))}function e$(e){return e.startsWith("0x")?e.slice(2):e}function t$(e){const t=Ic.decode(e)[0];return t===42?0:t===60?2:1}function n$(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){const t=e<<2|1;return new Uint8Array([t&255,t>>8&255])}else if(e<1<<30){const t=e<<2|2;return new Uint8Array([t&255,t>>8&255,t>>16&255,t>>24&255])}else throw new Error("Compact encoding > 2^30 not supported")}function i$(e){if(e<BigInt(1)<<BigInt(6))return new Uint8Array([Number(e<<BigInt(2))]);if(e<BigInt(1)<<BigInt(14)){const t=e<<BigInt(2)|BigInt(1);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255))])}else if(e<BigInt(1)<<BigInt(30)){const t=e<<BigInt(2)|BigInt(2);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255)),Number(t>>BigInt(16)&BigInt(255)),Number(t>>BigInt(24)&BigInt(255))])}else throw new Error("BigInt compact encoding not supported > 2^30")}function r$(e){const t=Uint8Array.from(Ve.from(e.signature,"hex")),n=KV(e.transaction.address),i=JV({publicKey:n,signature:t,payload:e.transaction}),r=Ve.from(i).toString("hex");return XV(r)}const s$="PARSE_ERROR",o$="INVALID_REQUEST",a$="METHOD_NOT_FOUND",c$="INVALID_PARAMS",ex="INTERNAL_ERROR",um="SERVER_ERROR",l$=[-32700,-32600,-32601,-32602,-32603],Na={[s$]:{code:-32700,message:"Parse error"},[o$]:{code:-32600,message:"Invalid Request"},[a$]:{code:-32601,message:"Method not found"},[c$]:{code:-32602,message:"Invalid params"},[ex]:{code:-32603,message:"Internal error"},[um]:{code:-32e3,message:"Server error"}},tx=um;function u$(e){return l$.includes(e)}function Cg(e){return Object.keys(Na).includes(e)?Na[e]:Na[tx]}function d$(e){const t=Object.values(Na).find(n=>n.code===e);return t||Na[tx]}function h$(e,t,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${t}`):e}var nx={};/*! *****************************************************************************
305Copyright (c) Microsoft Corporation.
306
307Permission to use, copy, modify, and/or distribute this software for any
308purpose with or without fee is hereby granted.
309
310THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
311REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
312AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
313INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
314LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
315OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
316PERFORMANCE OF THIS SOFTWARE.
317***************************************************************************** */var B0=function(e,t){return B0=Object.
vendor: 4,261 bytes, line 317
317setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])},B0(e,t)};function f$(e,t){B0(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var V0=function(){return V0=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},V0.apply(this,arguments)};function m$(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}function y$(e,t,n,i){var r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,i);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}function g$(e,t){return function(n,i){t(n,i,e)}}function p$(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function w$(e,t,n,i){function r(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function c(d){try{u(i.next(d))}catch(f){o(f)}}function l(d){try{u(i.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):r(d.value).then(c,l)}u((i=i.apply(e,t||[])).next())})}function _$(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(u){return function(d){return l([u,d])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(s=u[0]&2?r.return:u[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,u[1])).done)return s;switch(r=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],r=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function b$(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}function x$(e,t){for(var n in e)n!=="default"&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function $0(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ix(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,s=[],o;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(c){o={error:c}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function I$(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ix(arguments[t]));return e}function M$(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var s=arguments[t],o=0,c=s.length;o<c;o++,r++)i[r]=s[o];return i}function Ja(e){return this instanceof Ja?(this.v=e,this):new Ja(e)}function C$(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),r,s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(m){i[m]&&(r[m]=function(y){return new Promise(function(g,p){s.push([m,y,g,p])>1||c(m,y)})})}function c(m,y){try{l(i[m](y))}catch(g){f(s[0][3],g)}}function l(m){m.value instanceof Ja?Promise.resolve(m.value.v).then(u,d):f(s[0][2],m)}function u(m){c("next",m)}function d(m){c("throw",m)}
317function f(m,y){m(y),s.shift(),s.length&&c(s[0][0],s[0][1])}}function E$(e){var t,n;return t={},i("next"),i("throw",function(r){throw r}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(r,s){t[r]=e[r]?function(o){return(n=!n)?{value:Ja(e[r](o)),done:r==="return"}:s?s(o):o}:s}}function T$(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof $0=="function"?$0(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(s){n[s]=e[s]&&function(o){return new Promise(function(c,l){o=e[s](o),r(c,l,o.done,o.value)})}}function r(s,o,c,l){Promise.resolve(l).then(function(u){s({value:u,done:c})},o)}}function v$(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function L$(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function j$(e){return e&&e.__esModule?e:{default:e}}function S$(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function D$(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}const N$=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return V0},__asyncDelegator:E$,__asyncGenerator:C$,__asyncValues:T$,__await:Ja,__awaiter:w$,__classPrivateFieldGet:S$,__classPrivateFieldSet:D$,__createBinding:b$,__decorate:y$,__exportStar:x$,__extends:f$,__generator:_$,__importDefault:j$,__importStar:L$,__makeTemplateOb
317ject:v$,__metadata:p$,__param:g$,__read:ix,__rest:m$,__spread:I$,__spreadArrays:M$,__values:$0},Symbol.toStringTag,{value:"Module"})),A$=v4(N$);var Zi={},Eg;function O$(){if(Eg)return Zi;Eg=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.isBrowserCryptoAvailable=Zi.getSubtleCrypto=Zi.getBrowerCrypto=void 0;function e(){return(Zs===null||Zs===void 0?void 0:Zs.crypto)||(Zs===null||Zs===void 0?void 0:Zs.msCrypto)||{}}Zi.getBrowerCrypto=e;function t(){const i=e();return i.subtle||i.webkitSubtle}Zi.getSubtleCrypto=t;function n(){return!!e()&&!!t()}return Zi.isBrowserCryptoAvailable=n,Zi}var qi={},Tg;function k$(){if(Tg)return qi;Tg=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.isBrowser=qi.isNode=qi.isReactNative=void 0;function e(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}qi.isReactNative=e;function t(){return typeof _n<"u"&&typeof _n.versions<"u"&&typeof _n.versions.node<"u"}qi.isNode=t;function n(){return!e()&&!t()}return qi.isBrowser=n,qi}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=A$;t.__exportStar(O$(),e),t.__exportStar(k$(),e)})(nx);function Ti(e=3){const t=Date.now()*Math.pow(10,e),n=Math.floor(Math.random()*Math.pow(10,e));return t+n}function Vr(e=6){return BigInt(Ti(e))}function Xi(e,t,n){return{id:n||Ti(),jsonrpc:"2.0",method:e,params:t}}function ql(e,t){return{id:e,jsonrpc:"2.0",result:t}}function dm(e,t,n){return{id:e,jsonrpc:"2.0",error:z$(t)}}function z$(e,t){return typeof e>"u"?Cg(ex):(typeof e=="string"&&(e=Object.assign(Object.assign({},Cg(um)),{message:e})),u$(e.code)&&(e=d$(e.code)),e)}class P${}class R$ extends P${constructor(){super()}}class U$ extends R${constructor(t){super()}}const B$="^https?:",V$="^wss?:";function $$(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(!(!t||!t.length))return t[0]}function rx(e,t){const n=$$(e);return typeof n>"u"?!1:new RegExp(t).test(n)}function DG(e){return rx(e,B$)}function vg(e){return rx(e,V$)}function W$(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function sx(e){return typeof e=="object"&&"id"in e&&"jsonrpc"in e&&e.jsonrpc==="2.0"}function hm(e){return sx(e)&&"method"in e}function sd(e){return sx(e)&&(vi(e)||ti(e))}function vi(e){return"result"in e}function ti(e){return"error"in e}class F$ extends U${constructor(t){super(t),this.events=new wi.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}off(t,n){this.events.off(t,n)}removeListener(t,n){this.events.removeListener(t,n)}async request(t,n){return this.requestStrict(Xi(t.method,t.params||[],t.id||Vr().toString()),n)}async requestStrict(t,n){return new Promise(async(i,r)=>{if(!this.connection.connected)try{await this.open()}catch(s){r(s)}this.events.on(`${t.id}`,s=>{ti(s)?r(s.error):i(s.result)});try{await this.connection.send(t,n)}catch(s){r(s)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),sd(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&t.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),typeof t=="string"&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",t=>this.onClose(t)),this.connection.on("error",t=>this.events.emit("error",t)),this.connection.on("register_error",t=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const Y$=()=>typeof WebSocket<"u"?WebSocket:typeof we<"u"&&typeof we.WebSocket<"u"?we.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),H$=()=>typeof WebSocket<"u"||typeof we<"u"&&typeof we.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Lg=e=>e.split("?")[0],jg=10,Q$=Y$();let Z$=class{constructor(t){if(this.url=t,this.events=new wi.EventEmitter,this.registering=!1,!vg(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}
317get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}off(t,n){this.events.off(t,n)}removeListener(t,n){this.events.removeListener(t,n)}async open(t=this.url){await this.register(t)}async close(){return new Promise((t,n)=>{if(typeof this.socket>"u"){n(new Error("Connection already closed"));return}this.socket.onclose=i=>{this.onClose(i),t()},this.socket.close()})}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Ss(t))}catch(n){this.onError(t.id,n)}}register(t=this.url){if(!vg(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){const n=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),new Promise((i,r)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),r(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return r(new Error("WebSocket connection is missing or invalid"));i(this.socket)})})}return this.url=t,this.registering=!0,new Promise((n,i)=>{const r=nx.isReactNative()?void 0:{rejectUnauthorized:!W$(t)},s=new Q$(t,[],r);H$()?s.onerror=o=>{const c=o;i(this.emitError(c.error))}:s.on("error",o=>{i(this.emitError(o))}),s.onopen=()=>{this.onOpen(s),n(s)}})}onOpen(t){t.onmessage=n=>this.onPayload(n),t.onclose=n=>this.onClose(n),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const n=typeof t.data=="string"?To(t.data):t.data;this.events.emit("payload",n)}onError(t,n){const i=this.parseError(n),r=i.message||i.toString(),s=dm(t,r);this.events.emit("payload",s)}parseError(t,n=this.url){return h$(t,Lg(n),"WS")}resetMaxListeners(){this.events.getMaxListeners()>jg&&this.events.setMaxListeners(jg)}emitError(t){const n=this.parseError(new Error((t==null?void 0:t.message)||`WebSocket connection failed for host: ${Lg(this.url)}`));return this.events.emit("register_error",n),n}};var q$={};const ox="wc",ax=2,Gl="core",Ri=`${ox}@2:${Gl}:`,G$={name:Gl,logger:"error"},K$={database:":memory:"},J$="crypto",Sg="client_ed25519_seed",X$=te.ONE_DAY,eW="keychain",tW="0.3",nW="messages",iW="0.3",rW=te.SIX_HOURS,sW="publisher",cx="irn",oW="error",lx="wss://relay.walletconnect.org",aW="relayer",yt={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"},cW="_subscription",qn={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},lW=.1,W0="2.21.8",rt={link_mode:"link_mode",relay:"relay"},yl={inbound:"inbound",outbound:"outbound"},uW="0.3",dW="WALLETCONNECT_CLIENT_ID",Dg="WALLETCONNECT_LINK_MODE_APPS",Vn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},hW="subscription",fW="0.3",mW="pairing",yW="0.3",da={wc_pairingDelete:{req:{ttl:te.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:te.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:te.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:te.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:te.ONE_DAY,prompt:!1,tag:0},res:{ttl:te.ONE_DAY,prompt:!1,tag:0}}},hs={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},di={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},gW="history",pW="0.3",wW="expirer",Kn={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},_W="0.3",bW="verify-api",xW="https://verify.walletconnect.com",ux="https://verify.walletconnect.org",Aa=ux,IW=`${Aa}/v3`,MW=[xW,ux],CW="echo",EW="https://echo.walletconnect.com",Ei={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"},Ki={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"},Er={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"},ha={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"},cs={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"},fa={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"},TW=.1,vW="event-client",LW=86400,jW="https://pulse.walletconnect.org/batch";function SW(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var r=0;r<e.length;r++){var s=e.charAt(r),o=s.charCodeAt(0);if(n[o]!==255)throw new TypeError(s+" is ambiguous");n[o]=r}var c=e.length,l=e.charAt(0),u=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function f(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new 
317Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var p=0,w=0,x=0,I=g.length;x!==I&&g[x]===0;)x++,p++;for(var E=(I-x)*d+1>>>0,j=new Uint8Array(E);x!==I;){for(var C=g[x],T=0,v=E-1;(C!==0||T<w)&&v!==-1;v--,T++)C+=256*j[v]>>>0,j[v]=C%c>>>0,C=C/c>>>0;if(C!==0)throw new Error("Non-zero carry");w=T,x++}for(var N=E-w;N!==E&&j[N]===0;)N++;for(var M=l.repeat(p);N<E;++N)M+=e.charAt(j[N]);return M}function m(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var p=0;if(g[p]!==" "){for(var w=0,x=0;g[p]===l;)w++,p++;for(var I=(g.length-p)*u+1>>>0,E=new Uint8Array(I);g[p];){var j=n[g.charCodeAt(p)];if(j===255)return;for(var C=0,T=I-1;(j!==0||C<x)&&T!==-1;T--,C++)j+=c*E[T]>>>0,E[T]=j%256>>>0,j=j/256>>>0;if(j!==0)throw new Error("Non-zero carry");x=C,p++}if(g[p]!==" "){for(var v=I-x;v!==I&&E[v]===0;)v++;for(var N=new Uint8Array(w+(I-v)),M=w;v!==I;)N[M++]=E[v++];return N}}}function y(g){var p=m(g);if(p)return p;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:m,decode:y}}var DW=SW,NW=DW;const dx=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},AW=e=>new TextEncoder().encode(e),OW=e=>new TextDecoder().decode(e);class kW{constructor(t,n,i){this.name=t,this.prefix=n,this.baseEncode=i}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class zW{constructor(t,n,i){if(this.name=t,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return hx(this,t)}}class PW{constructor(t){this.decoders=t}or(t){return hx(this,t)}decode(t){const n=t[0],i=this.decoders[n];if(i)return i.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const hx=(e,t)=>new PW({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class RW{constructor(t,n,i,r){this.name=t,this.prefix=n,this.baseEncode=i,this.baseDecode=r,this.encoder=new kW(t,n,i),this.decoder=new zW(t,n,r)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const od=({name:e,prefix:t,encode:n,decode:i})=>new RW(e,t,n,i),Lc=({prefix:e,name:t,alphabet:n})=>{const{encode:i,decode:r}=NW(n,t);return od({prefix:e,name:t,encode:i,decode:s=>dx(r(s))})},UW=(e,t,n,i)=>{const r={};for(let d=0;d<t.length;++d)r[t[d]]=d;let s=e.length;for(;e[s-1]==="=";)--s;const o=new Uint8Array(s*n/8|0);let c=0,l=0,u=0;for(let d=0;d<s;++d){const f=r[e[d]];if(f===void 0)throw new SyntaxError(`Non-${i} character`);l=l<<n|f,c+=n,c>=8&&(c-=8,o[u++]=255&l>>c)}if(c>=n||255&l<<8-c)throw new SyntaxError("Unexpected end of data");return o},BW=(e,t,n)=>{const i=t[t.length-1]==="=",r=(1<<n)-1;let s="",o=0,c=0;for(let l=0;l<e.length;++l)for(c=c<<8|e[l],o+=8;o>n;)o-=n,s+=t[r&c>>o];if(o&&(s+=t[r&c<<n-o]),i)for(;s.length*n&7;)s+="=";return s},Jt=({name:e,prefix:t,bitsPerChar:n,alphabet:i})=>od({prefix:t,name:e,encode(r){return BW(r,i,n)},decode(r){return UW(r,i,n,e)}}),VW=od({prefix:"\0",name:"identity",encode:e=>OW(e),decode:e=>AW(e)});var $W=Object.freeze({__proto__:null,identity:VW});const WW=Jt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var FW=Object.freeze({__proto__:null,base2:WW});const YW=Jt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var HW=Object.freeze({__proto__:null,base8:YW});const QW=Lc({prefix:"9",name:"base10",alphabet:"0123456789"});var ZW=Object.freeze({__proto__:null,base10:QW});const qW=Jt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),GW=Jt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var KW=Object.freeze({__proto__:null,base16:qW,base16upper:GW});const JW=Jt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),XW=Jt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),eF=Jt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),tF=Jt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),nF=Jt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),iF=Jt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rF=Jt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),sF=Jt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),oF=Jt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var aF=Object.freeze({__proto__:null,base32:JW,base32upper:XW,base32pad:eF,base32padupper:tF,base32hex:nF,base32hexupper:iF,base32hexpad:rF,base32hexpadupper:sF,base32z:oF});const cF=Lc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),lF=Lc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var uF=Object.freeze({__proto__:null,base36:cF,base36upper:lF});const dF=Lc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),hF=Lc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var fF=Object.freeze({__proto__:null,base58btc:dF,base58flickr:hF});const mF=Jt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
317+/",bitsPerChar:6}),yF=Jt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),gF=Jt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),pF=Jt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var wF=Object.freeze({__proto__:null,base64:mF,base64pad:yF,base64url:gF,base64urlpad:pF});const fx=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),_F=fx.reduce((e,t,n)=>(e[n]=t,e),[]),bF=fx.reduce((e,t,n)=>(e[t.codePointAt(0)]=n,e),[]);function xF(e){return e.reduce((t,n)=>(t+=_F[n],t),"")}function IF(e){const t=[];for(const n of e){const i=bF[n.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${n}`);t.push(i)}return new Uint8Array(t)}const MF=od({prefix:"🚀",name:"base256emoji",encode:xF,decode:IF});var CF=Object.freeze({__proto__:null,base256emoji:MF}),EF=mx,Ng=128,TF=127,vF=~TF,LF=Math.pow(2,31);function mx(e,t,n){t=t||[],n=n||0;for(var i=n;e>=LF;)t[n++]=e&255|Ng,e/=128;for(;e&vF;)t[n++]=e&255|Ng,e>>>=7;return t[n]=e|0,mx.bytes=n-i+1,t}var jF=F0,SF=128,Ag=127;function F0(e,i){var n=0,i=i||0,r=0,s=i,o,c=e.length;do{if(s>=c)throw F0.bytes=0,new RangeError("Could not decode varint");o=e[s++],n+=r<28?(o&Ag)<<r:(o&Ag)*Math.pow(2,r),r+=7}while(o>=SF);return F0.bytes=s-i,n}var DF=Math.pow(2,7),NF=Math.pow(2,14),AF=Math.pow(2,21),OF=Math.pow(2,28),kF=Math.pow(2,35),zF=Math.pow(2,42),PF=Math.pow(2,49),RF=Math.pow(2,56),UF=Math.pow(2,63),BF=function(e){return e<DF?1:e<NF?2:e<AF?3:e<OF?4:e<kF?5:e<zF?6:e<PF?7:e<RF?8:e<UF?9:10},VF={encode:EF,decode:jF,encodingLength:BF},yx=VF;const Og=(e,t,n=0)=>(yx.encode(e,t,n),t),kg=e=>yx.encodingLength(e),Y0=(e,t)=>{const n=t.byteLength,i=kg(e),r=i+kg(n),s=new Uint8Array(r+n);return Og(e,s,0),Og(n,s,i),s.set(t,r),new $F(e,n,t,s)};class $F{constructor(t,n,i,r){this.code=t,this.size=n,this.digest=i,this.bytes=r}}const gx=({name:e,code:t,encode:n})=>new WF(e,t,n);class WF{constructor(t,n,i){this.name=t,this.code=n,this.encode=i}digest(t){if(t instanceof Uint8Array){const n=this.encode(t);return n instanceof Uint8Array?Y0(this.code,n):n.then(i=>Y0(this.code,i))}else throw Error("Unknown type, must be binary type")}}const px=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),FF=gx({name:"sha2-256",code:18,encode:px("SHA-256")}),YF=gx({name:"sha2-512",code:19,encode:px("SHA-512")});var HF=Object.freeze({__proto__:null,sha256:FF,sha512:YF});const wx=0,QF="identity",_x=dx,ZF=e=>Y0(wx,_x(e)),qF={code:wx,name:QF,encode:_x,digest:ZF};var GF=Object.freeze({__proto__:null,identity:qF});new TextEncoder,new TextDecoder;const zg={...$W,...FW,...HW,...ZW,...KW,...aF,...uF,...fF,...wF,...CF};({...HF,...GF});function bx(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function KF(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?bx(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function xx(e,t,n,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:i}}}const Pg=xx("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),yh=xx("ascii","a",e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{e=e.substring(1);const t=KF(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),JF={utf8:Pg,"utf-8":Pg,hex:zg.base16,latin1:yh,ascii:yh,binary:yh,...zg};function XF(e,t="utf8"){const n=JF[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?bx(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}
317var eY=Object.defineProperty,tY=(e,t,n)=>t in e?eY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mi=(e,t,n)=>tY(e,typeof t!="symbol"?t+"":t,n);class nY{constructor(t,n){this.core=t,this.logger=n,Mi(this,"keychain",new Map),Mi(this,"name",eW),Mi(this,"version",tW),Mi(this,"initialized",!1),Mi(this,"storagePrefix",Ri),Mi(this,"init",async()=>{if(!this.initialized){const i=await this.getKeyChain();typeof i<"u"&&(this.keychain=i),this.initialized=!0}}),Mi(this,"has",i=>(this.isInitialized(),this.keychain.has(i))),Mi(this,"set",async(i,r)=>{this.isInitialized(),this.keychain.set(i,r),await this.persist()}),Mi(this,"get",i=>{this.isInitialized();const r=this.keychain.get(i);if(typeof r>"u"){const{message:s}=ne("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(s)}return r}),Mi(this,"del",async i=>{this.isInitialized(),this.keychain.delete(i),await this.persist()}),this.core=t,this.logger=Cn(n,this.name)}get context(){return Un(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(t){await this.core.storage.setItem(this.storageKey,v0(t))}async getKeyChain(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?L0(t):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:t}=ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}var iY=Object.defineProperty,rY=(e,t,n)=>t in e?iY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vt=(e,t,n)=>rY(e,typeof t!="symbol"?t+"":t,n);class sY{constructor(t,n,i){this.core=t,this.logger=n,Vt(this,"name",J$),Vt(this,"keychain"),Vt(this,"randomSessionIdentifier",R0()),Vt(this,"initialized",!1),Vt(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),Vt(this,"hasKeys",r=>(this.isInitialized(),this.keychain.has(r))),Vt(this,"getClientId",async()=>{this.isInitialized();const r=await this.getClientSeed(),s=m2(r);return y_(s.publicKey)}),Vt(this,"generateKeyPair",()=>{this.isInitialized();const r=QB();return this.setPrivateKey(r.publicKey,r.privateKey)}),Vt(this,"signJWT",async r=>{this.isInitialized();const s=await this.getClientSeed(),o=m2(s),c=this.randomSessionIdentifier;return await OO(c,r,X$,o)}),Vt(this,"generateSharedKey",(r,s,o)=>{this.isInitialized();const c=this.getPrivateKey(r),l=ZB(c,s);return this.setSymKey(l,o)}),Vt(this,"setSymKey",async(r,s)=>{this.isInitialized();const o=s||ml(r);return await this.keychain.set(o,r),o}),Vt(this,"deleteKeyPair",async r=>{this.isInitialized(),await this.keychain.del(r)}),Vt(this,"deleteSymKey",async r=>{this.isInitialized(),await this.keychain.del(r)}),Vt(this,"encode",async(r,s,o)=>{this.isInitialized();const c=Gb(o),l=Ss(s);if(hg(c))return KB(l,o==null?void 0:o.encoding);if(dg(c)){const m=c.senderPublicKey,y=c.receiverPublicKey;r=await this.generateSharedKey(m,y)}const u=this.getSymKey(r),{type:d,senderPublicKey:f}=c;return qB({type:d,symKey:u,message:l,senderPublicKey:f,encoding:o==null?void 0:o.encoding})}),Vt(this,"decode",async(r,s,o)=>{this.isInitialized();const c=XB(s,o);if(hg(c)){const l=JB(s,o==null?void 0:o.encoding);return To(l)}if(dg(c)){const l=c.receiverPublicKey,u=c.senderPublicKey;r=await this.generateSharedKey(l,u)}try{const l=this.getSymKey(r),u=GB({symKey:l,encoded:s,encoding:o==null?void 0:o.encoding});return To(u)}catch(l){this.logger.error(`Failed to decode message from topic: '${r}', clientId: '${await this.getClientId()}'`),this.logger.error(l)}}),Vt(this,"getPayloadType",(r,s=kn)=>{const o=Ga({encoded:r,encoding:s});return Os(o.type)}),Vt(this,"getPayloadSenderPublicKey",(r,s=kn)=>{const o=Ga({encoded:r,encoding:s});return o.senderPublicKey?Pn(o.senderPublicKey,xn):void 0}),this.core=t,this.logger=Cn(n,this.name),this.keychain=i||new nY(this.core,this.logger)}get context(){return Un(this.logger)}async setPrivateKey(t,n){return await this.keychain.set(t,n),t}getPrivateKey(t){return this.keychain.get(t)}async getClientSeed(){let t="";try{t=this.keychain.get(Sg)}catch{t=R0(),await this.keychain.set(Sg,t)}return XF(t,"base16")}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){const{message:t}=ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}var oY=Object.defineProperty,aY=Object.defineProperties,cY=Object.getOwnPropertyDescriptors,Rg=Object.getOwnPropertySymbols,lY=Object.prototype.hasOwnProperty,uY=Object.prototype.propertyIsEnumerable,H0=(e,t,n)=>t in e?oY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dY=(e,t)=>{for(var n in t||(t={}))lY.call(t,n)&&H0(e,n,t[n]);if(Rg)for(var n of Rg(t))uY.call(t,n)&&H0(e,n,t[n]);return e},hY=(e,t)=>aY(e,cY(t)),Bn=(e,t,n)=>H0(e,typeof t!="symbol"?t+"":t,n);class fY extends DD{constructor(t,n){super(t,n),this.logger=t,this.core=n,Bn(this,"messages",new Map),Bn(this,"messagesWithoutClientAck",new Map),Bn(this,"name",nW),Bn(this,"version",iW),Bn(this,"initialized",!1),Bn(this,"storagePrefix",Ri),Bn(this,"init",async()=>
317{if(!this.initialized){this.logger.trace("Initialized");try{const i=await this.getRelayerMessages();typeof i<"u"&&(this.messages=i);const r=await this.getRelayerMessagesWithoutClientAck();typeof r<"u"&&(this.messagesWithoutClientAck=r),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}finally{this.initialized=!0}}}),Bn(this,"set",async(i,r,s)=>{this.isInitialized();const o=ei(r);let c=this.messages.get(i);if(typeof c>"u"&&(c={}),typeof c[o]<"u")return o;if(c[o]=r,this.messages.set(i,c),s===yl.inbound){const l=this.messagesWithoutClientAck.get(i)||{};this.messagesWithoutClientAck.set(i,hY(dY({},l),{[o]:r}))}return await this.persist(),o}),Bn(this,"get",i=>{this.isInitialized();let r=this.messages.get(i);return typeof r>"u"&&(r={}),r}),Bn(this,"getWithoutAck",i=>{this.isInitialized();const r={};for(const s of i){const o=this.messagesWithoutClientAck.get(s)||{};r[s]=Object.values(o)}return r}),Bn(this,"has",(i,r)=>{this.isInitialized();const s=this.get(i),o=ei(r);return typeof s[o]<"u"}),Bn(this,"ack",async(i,r)=>{this.isInitialized();const s=this.messagesWithoutClientAck.get(i);if(typeof s>"u")return;const o=ei(r);delete s[o],Object.keys(s).length===0?this.messagesWithoutClientAck.delete(i):this.messagesWithoutClientAck.set(i,s),await this.persist()}),Bn(this,"del",async i=>{this.isInitialized(),this.messages.delete(i),this.messagesWithoutClientAck.delete(i),await this.persist()}),this.logger=Cn(t,this.name),this.core=n}get context(){return Un(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(t){await this.core.storage.setItem(this.storageKey,v0(t))}async setRelayerMessagesWithoutClientAck(t){await this.core.storage.setItem(this.storageKeyWithoutClientAck,v0(t))}async getRelayerMessages(){const t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?L0(t):void 0}async getRelayerMessagesWithoutClientAck(){const t=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof t<"u"?L0(t):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:t}=ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}var mY=Object.defineProperty,yY=Object.defineProperties,gY=Object.getOwnPropertyDescriptors,Ug=Object.getOwnPropertySymbols,pY=Object.prototype.hasOwnProperty,wY=Object.prototype.propertyIsEnumerable,Q0=(e,t,n)=>t in e?mY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,io=(e,t)=>{for(var n in t||(t={}))pY.call(t,n)&&Q0(e,n,t[n]);if(Ug)for(var n of Ug(t))wY.call(t,n)&&Q0(e,n,t[n]);return e},Bg=(e,t)=>yY(e,gY(t)),Gn=(e,t,n)=>Q0(e,typeof t!="symbol"?t+"":t,n);class _Y extends ND{constructor(t,n){super(t,n),this.relayer=t,this.logger=n,Gn(this,"events",new wi.EventEmitter),Gn(this,"name",sW),Gn(this,"queue",new Map),Gn(this,"publishTimeout",te.toMiliseconds(te.ONE_MINUTE)),Gn(this,"initialPublishTimeout",te.toMiliseconds(te.ONE_SECOND*15)),Gn(this,"needsTransportRestart",!1),Gn(this,"publish",async(i,r,s)=>{var o,c,l,u,d;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:i,message:r,opts:s}});const f=(s==null?void 0:s.ttl)||rW,m=(s==null?void 0:s.prompt)||!1,y=(s==null?void 0:s.tag)||0,g=(s==null?void 0:s.id)||Vr().toString(),p=co(Ql().protocol),w={id:g,method:(s==null?void 0:s.publishMethod)||p.publish,params:io({topic:i,message:r,ttl:f,prompt:m,tag:y,attestation:s==null?void 0:s.attestation},(s==null?void 0:s.tvf)&&{tvf:s.tvf})},x=`Failed to publish payload, please try again. id:${g} tag:${y}`;try{At((o=w.params)==null?void 0:o.prompt)&&((c=w.params)==null||delete c.prompt),At((l=w.params)==null?void 0:l.tag)&&((u=w.params)==null||delete u.tag);const I=new Promise(async E=>{const j=({id:T})=>{var v;((v=w.id)==null?void 0:v.toString())===T.toString()&&(this.removeRequestFromQueue(T),this.relayer.events.removeListener(yt.publish,j),E())};this.relayer.events.on(yt.publish,j);const C=Ni(new Promise((T,v)=>{this.rpcPublish(w,s).then(T).catch(N=>{this.logger.warn(N,N==null?void 0:N.message),v(N)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${g} tag:${y}`);try{await C,this.events.removeListener(yt.publish,j)}catch(T){this.queue.set(g,{request:w,opts:s,attempt:1}),this.logger.warn(T,T==null?void 0:T.message)}});this.logger.trace({type:"method",method:"publish",params:{id:g,topic:i,message:r,opts:s}}),await Ni(I,this.publishTimeout,x)}
317catch(I){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(I),(d=s==null?void 0:s.internal)!=null&&d.throwOnFailedPublish)throw I}finally{this.queue.delete(g)}}),Gn(this,"publishCustom",async i=>{var r,s,o,c,l;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:i});const{payload:u,opts:d={}}=i,{attestation:f,tvf:m,publishMethod:y,prompt:g,tag:p,ttl:w=te.FIVE_MINUTES}=d,x=d.id||Vr().toString(),I=co(Ql().protocol),E=y||I.publish,j={id:x,method:E,params:io(Bg(io({},u),{ttl:w,prompt:g,tag:p,attestation:f}),m)},C=`Failed to publish custom payload, please try again. id:${x} tag:${p}`;try{At((r=j.params)==null?void 0:r.prompt)&&((s=j.params)==null||delete s.prompt),At((o=j.params)==null?void 0:o.tag)&&((c=j.params)==null||delete c.tag);const T=new Promise(async v=>{const N=({id:S})=>{var L;((L=j.id)==null?void 0:L.toString())===S.toString()&&(this.removeRequestFromQueue(S),this.relayer.events.removeListener(yt.publish,N),v())};this.relayer.events.on(yt.publish,N);const M=Ni(new Promise((S,L)=>{this.rpcPublish(j,d).then(S).catch(O=>{this.logger.warn(O,O==null?void 0:O.message),L(O)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${E} id:${x} tag:${p}`);try{await M,this.events.removeListener(yt.publish,N)}catch(S){this.queue.set(x,{request:j,opts:d,attempt:1}),this.logger.warn(S,S==null?void 0:S.message)}});this.logger.trace({type:"method",method:"publish",params:{id:x,payload:u,opts:d}}),await Ni(T,this.publishTimeout,C)}catch(T){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(T),(l=d==null?void 0:d.internal)!=null&&l.throwOnFailedPublish)throw T}finally{this.queue.delete(x)}}),Gn(this,"on",(i,r)=>{this.events.on(i,r)}),Gn(this,"once",(i,r)=>{this.events.once(i,r)}),Gn(this,"off",(i,r)=>{this.events.off(i,r)}),Gn(this,"removeListener",(i,r)=>{this.events.removeListener(i,r)}),this.relayer=t,this.logger=Cn(n,this.name),this.registerEventListeners()}get context(){return Un(this.logger)}async rpcPublish(t,n){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:t});const i=await this.relayer.request(t);return this.relayer.events.emit(yt.publish,io(io({},t),n)),this.logger.debug("Successfully Published Payload"),i}removeRequestFromQueue(t){this.queue.delete(t)}checkQueue(){this.queue.forEach(async(t,n)=>{var i;const r=t.attempt+1;this.queue.set(n,Bg(io({},t),{attempt:r})),this.logger.warn({},`Publisher: queue->publishing: ${t.request.id}, tag: ${(i=t.request.params)==null?void 0:i.tag}, attempt: ${r}`),await this.rpcPublish(t.request,t.opts),this.logger.warn({},`Publisher: queue->published: ${t.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(Ws.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(yt.connection_stalled);return}this.checkQueue()}),this.relayer.on(yt.message_ack,t=>{this.removeRequestFromQueue(t.id.toString())})}}var bY=Object.defineProperty,xY=(e,t,n)=>t in e?bY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ro=(e,t,n)=>xY(e,typeof t!="symbol"?t+"":t,n);class IY{constructor(){ro(this,"map",new Map),ro(this,"set",(t,n)=>{const i=this.get(t);this.exists(t,n)||this.map.set(t,[...i,n])}),ro(this,"get",t=>this.map.get(t)||[]),ro(this,"exists",(t,n)=>this.get(t).includes(n)),ro(this,"delete",(t,n)=>{if(typeof n>"u"){this.map.delete(t);return}if(!this.map.has(t))return;const i=this.get(t);if(!this.exists(t,n))return;const r=i.filter(s=>s!==n);if(!r.length){this.map.delete(t);return}this.map.set(t,r)}),ro(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}}var MY=Object.defineProperty,CY=Object.defineProperties,EY=Object.getOwnPropertyDescriptors,Vg=Object.getOwnPropertySymbols,TY=Object.prototype.hasOwnProperty,vY=Object.prototype.propertyIsEnumerable,Z0=(e,t,n)=>t in e?MY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ma=(e,t)=>{for(var n in t||(t={}))TY.call(t,n)&&Z0(e,n,t[n]);if(Vg)for(var n of Vg(t))vY.call(t,n)&&Z0(e,n,t[n]);return e},gh=(e,t)=>
317CY(e,EY(t)),Je=(e,t,n)=>Z0(e,typeof t!="symbol"?t+"":t,n);class LY extends kD{constructor(t,n){super(t,n),this.relayer=t,this.logger=n,Je(this,"subscriptions",new Map),Je(this,"topicMap",new IY),Je(this,"events",new wi.EventEmitter),Je(this,"name",hW),Je(this,"version",fW),Je(this,"pending",new Map),Je(this,"cached",[]),Je(this,"initialized",!1),Je(this,"storagePrefix",Ri),Je(this,"subscribeTimeout",te.toMiliseconds(te.ONE_MINUTE)),Je(this,"initialSubscribeTimeout",te.toMiliseconds(te.ONE_SECOND*15)),Je(this,"clientId"),Je(this,"batchSubscribeTopicsLimit",500),Je(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),Je(this,"subscribe",async(i,r)=>{var s;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:r}});try{const o=Ql(r),c={topic:i,relay:o,transportType:r==null?void 0:r.transportType};(s=r==null?void 0:r.internal)!=null&&s.skipSubscribe||this.pending.set(i,c);const l=await this.rpcSubscribe(i,o,r);return typeof l=="string"&&(this.onSubscribe(l,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:r}})),l}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}}),Je(this,"unsubscribe",async(i,r)=>{this.isInitialized(),typeof(r==null?void 0:r.id)<"u"?await this.unsubscribeById(i,r.id,r):await this.unsubscribeByTopic(i,r)}),Je(this,"isSubscribed",i=>new Promise(r=>{r(this.topicMap.topics.includes(i))})),Je(this,"isKnownTopic",i=>new Promise(r=>{r(this.topicMap.topics.includes(i)||this.pending.has(i)||this.cached.some(s=>s.topic===i))})),Je(this,"on",(i,r)=>{this.events.on(i,r)}),Je(this,"once",(i,r)=>{this.events.once(i,r)}),Je(this,"off",(i,r)=>{this.events.off(i,r)}),Je(this,"removeListener",(i,r)=>{this.events.removeListener(i,r)}),Je(this,"start",async()=>{await this.onConnect()}),Je(this,"stop",async()=>{await this.onDisconnect()}),Je(this,"restart",async()=>{await this.restore(),await this.onRestart()}),Je(this,"checkPending",async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;const i=[];this.pending.forEach(r=>{i.push(r)}),await this.batchSubscribe(i)}),Je(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(Ws.pulse,async()=>{await this.checkPending()}),this.events.on(Vn.created,async i=>{const r=Vn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),await this.persist()}),this.events.on(Vn.deleted,async i=>{const r=Vn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),await this.persist()})}),this.relayer=t,this.logger=Cn(n,this.name),this.clientId=""}get context(){return Un(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}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(t,n){let i=!1;try{i=this.getSubscription(t).topic===n}catch{}return i}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(t,n){const i=this.topicMap.get(t);await Promise.all(i.map(async r=>await this.unsubscribeById(t,r,n)))}async unsubscribeById(t,n,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:n,opts:i}});try{const r=Ql(i);await this.restartToComplete({topic:t,id:n,relay:r}),await this.rpcUnsubscribe(t,n,r);const s=lt("USER_DISCONNECTED",`${this.name}, ${t}`);await this.onUnsubscribe(t,n,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,i
317d:n,opts:i}})}catch(r){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(r),r}}async rpcSubscribe(t,n,i){var r,s;const o=await this.getSubscriptionId(t);if((r=i==null?void 0:i.internal)!=null&&r.skipSubscribe)return o;(!i||(i==null?void 0:i.transportType)===rt.relay)&&await this.restartToComplete({topic:t,id:t,relay:n});const c={method:co(n.protocol).subscribe,params:{topic:t}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:c});const l=(s=i==null?void 0:i.internal)==null?void 0:s.throwOnFailedPublish;try{if((i==null?void 0:i.transportType)===rt.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(c).catch(f=>this.logger.warn(f))},te.toMiliseconds(te.ONE_SECOND)),o;const u=new Promise(async f=>{const m=y=>{y.topic===t&&(this.events.removeListener(Vn.created,m),f(y.id))};this.events.on(Vn.created,m);try{const y=await Ni(new Promise((g,p)=>{this.relayer.request(c).catch(w=>{this.logger.warn(w,w==null?void 0:w.message),p(w)}).then(g)}),this.initialSubscribeTimeout,`Subscribing to ${t} failed, please try again`);this.events.removeListener(Vn.created,m),f(y)}catch{}}),d=await Ni(u,this.subscribeTimeout,`Subscribing to ${t} failed, please try again`);if(!d&&l)throw new Error(`Subscribing to ${t} failed, please try again`);return d?o:null}catch(u){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(yt.connection_stalled),l)throw u}return null}async rpcBatchSubscribe(t){if(!t.length)return;const n=t[0].relay,i={method:co(n.protocol).batchSubscribe,params:{topics:t.map(r=>r.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{await await Ni(new Promise(r=>{this.relayer.request(i).catch(s=>this.logger.warn(s)).then(r)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(yt.connection_stalled)}}async rpcBatchFetchMessages(t){if(!t.length)return;const n=t[0].relay,i={method:co(n.protocol).batchFetchMessages,params:{topics:t.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});let r;try{r=await await Ni(new Promise((s,o)=>{this.relayer.request(i).catch(c=>{this.logger.warn(c),o(c)}).then(s)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(yt.connection_stalled)}return r}rpcUnsubscribe(t,n,i){const r={method:co(i.protocol).unsubscribe,params:{topic:t,id:n}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),this.relayer.request(r)}onSubscribe(t,n){this.setSubscription(t,gh(ma({},n),{id:t})),this.pending.delete(n.topic)}onBatchSubscribe(t){t.length&&t.forEach(n=>{this.setSubscription(n.id,ma({},n)),this.pending.delete(n.topic)})}async onUnsubscribe(t,n,i){this.events.removeAllListeners(n),this.hasSubscription(n,t)&&this.deleteSubscription(n,i),await this.relayer.messages.del(t)}async setRelayerSubscriptions(t){await this.relayer.core.storage.setItem(this.storageKey,t)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(t,n){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:t,subscription:n}),this.addSubscription(t,n)}addSubscription(t,n){this.subscriptions.set(t,ma({},n)),this.topicMap.set(n.topic,t),this.events.emit(Vn.created,n)}getSubscription(t){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:t});const n=this.subscriptions.get(t);if(!n){const{message:i}=ne("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(i)}return n}deleteSubscription(t,n){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:t,reason:n});const i=this.getSubscription(t);this.subscriptions.delete(t),this.topicMap.delete(i.topic,t),this.events.emit(Vn.deleted,gh(ma({},i),{reason:n}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Vn.sync)}
317async onRestart(){if(this.cached.length){const t=[...this.cached],n=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let i=0;i<n;i++){const r=t.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(r)}}this.events.emit(Vn.resubscribed)}async restore(){try{const t=await this.getRelayerSubscriptions();if(typeof t>"u"||!t.length)return;if(this.subscriptions.size&&!t.every(n=>{var i;return n.topic===((i=this.subscriptions.get(n.id))==null?void 0:i.topic)})){const{message:n}=ne("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(n)}this.cached=t,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(t){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(t)}}async batchSubscribe(t){t.length&&(await this.rpcBatchSubscribe(t),this.onBatchSubscribe(await Promise.all(t.map(async n=>gh(ma({}
317,n),{id:await this.getSubscriptionId(n.topic)})))))}async batchFetchMessages(t){if(!t.length)return;this.logger.trace(`Fetching batch messages for ${t.length} subscriptions`);const n=await this.rpcBatchFetchMessages(t);n&&n.messages&&(await mR(te.toMiliseconds(te.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(n.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:t}=ne("NOT_INITIALIZED",this.name);throw new Error(t)}}async restartToComplete(t){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(t),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(t){return ei(t+await this.getClientId())}}var jY=Object.defineProperty,$g=Object.getOwnPropertySymbols,SY=Object.prototype.hasOwnProperty,DY=Object.prototype.propertyIsEnumerable,q0=(e,t,n)=>t in e?jY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wg=(e,t)=>{for(var n in t||(t={}))SY.call(t,n)&&q0(e,n,t[n]);if($g)for(var n of $g(t))DY.call(t,n)&&q0(e,n,t[n]);return e},ze=(e,t,n)=>q0(e,typeof t!="symbol"?t+"":t,n);class NY extends AD{constructor(t){super(t),ze(this,"protocol","wc"),ze(this,"version",2),ze(this,"core"),ze(this,"logger"),ze(this,"events",new wi.EventEmitter),ze(this,"provider"),ze(this,"messages"),ze(this,"subscriber"),ze(this,"publisher"),ze(this,"name",aW),ze(this,"transportExplicitlyClosed",!1),ze(this,"initialized",!1),ze(this,"connectionAttemptInProgress",!1),ze(this,"relayUrl"),ze(this,"projectId"),ze(this,"packageName"),ze(this,"bundleId"),ze(this,"hasExperiencedNetworkDisruption",!1),ze(this,"pingTimeout"),ze(this,"heartBeatTimeout",te.toMiliseconds(te.THIRTY_SECONDS+te.FIVE_SECONDS)),ze(this,"reconnectTimeout"),ze(this,"connectPromise"),ze(this,"reconnectInProgress",!1),ze(this,"requestsInFlight",[]),ze(this,"connectTimeout",te.toMiliseconds(te.ONE_SECOND*15)),ze(this,"request",async n=>{var i,r;this.logger.debug("Publishing Request Payload");const s=n.id||Vr().toString();await this.toEstablishConnection();try{this.logger.trace({id:s,method:n.method,topic:(i=n.params)==null?void 0:i.topic},"relayer.request - publishing...");const o=`${s}:${((r=n.params)==null?void 0:r.tag)||""}`;this.requestsInFlight.push(o);const c=await this.provider.request(n);return this.requestsInFlight=this.requestsInFlight.filter(l=>l!==o),c}catch(o){throw this.logger.debug(`Failed to Publish Request: ${s}`),o}}),ze(this,"resetPingTimeout",()=>{Wl()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var n,i,r,s;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(s=(r=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null?void 0:r.terminate)==null||s.call(r)}catch(o){this.logger.warn(o,o==null?void 0:o.message)}},this.heartBeatTimeout))}),ze(this,"onPayloadHandler",n=>{this.onProviderPayload(n),this.resetPingTimeout()}),ze(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected 🛜"),this.startPingTimeout(),this.events.emit(yt.connect)}),ze(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected 🛑"),this.requestsInFlight=[],this.onProviderDisconnect()}),ze(this,"onProviderErrorHandler",n=>{this.logger.fatal(`Fatal socket error: ${n.message}`),this.events.emit(yt.error,n),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),ze(this,"registerProviderListeners",()=>{this.provider.on(qn.payload,this.onPayloadHandler),this.provider.on(qn.connect,this.onConnectHandler),this.provider.on(qn.disconnect,this.onDisconnectHandler),this.provider.on(qn.error,this.onProviderErrorHandler)}),this.core=t.core,this.logger=typeof t.logger<"u"&&typeof t.logger!="string"?Cn(t.logger,this.name):Qu(k1({level:t.logger||oW})),this.messages=new fY(this.logger,t.core),this.subscriber=new LY(this,this.logger),this.publisher=new _Y(this,this.logger),this.projectId=t==null?void 0:t.projectId,this.relayUrl=(t==null?void 0:t.relayUrl)||lx,JP()?this.packageName=A2():XP()&&(this.bundleId=A2()),this.provider={}}
317async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(t=>this.logger.warn(t,t==null?void 0:t.message))}get context(){return Un(this.logger)}get connected(){var t,n,i;return((i=(n=(t=this.provider)==null?void 0:t.connection)==null?void 0:n.socket)==null?void 0:i.readyState)===1||!1}get connecting(){var t,n,i;return((i=(n=(t=this.provider)==null?void 0:t.connection)==null?void 0:n.socket)==null?void 0:i.readyState)===0||this.connectPromise!==void 0||!1}async publish(t,n,i){this.isInitialized(),await this.publisher.publish(t,n,i),await this.recordMessageEvent({topic:t,message:n,publishedAt:Date.now(),transportType:rt.relay},yl.outbound)}async publishCustom(t){this.isInitialized(),await this.publisher.publishCustom(t)}async subscribe(t,n){var i,r,s;this.isInitialized(),(!(n!=null&&n.transportType)||(n==null?void 0:n.transportType)==="relay")&&await this.toEstablishConnection();const o=typeof((i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish)>"u"?!0:(r=n==null?void 0:n.internal)==null?void 0:r.throwOnFailedPublish;let c=((s=this.subscriber.topicMap.get(t))==null?void 0:s[0])||"",l;const u=d=>{d.topic===t&&(this.subscriber.off(Vn.created,u),l())};return await Promise.all([new Promise(d=>{l=d,this.subscriber.on(Vn.created,u)}),new Promise(async(d,f)=>{c=await this.subscriber.subscribe(t,Wg({internal:{throwOnFailedPublish:o}},n)).catch(m=>{o&&f(m)})||c,d()})]),c}async unsubscribe(t,n){this.isInitialized(),await this.subscriber.unsubscribe(t,n)}on(t,n){this.events.on(t,n)}once(t,n){this.events.once(t,n)}off(t,n){this.events.off(t,n)}removeListener(t,n){this.events.removeListener(t,n)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Ni(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(t){if(!this.subscriber.hasAnyTopics){this.logger.info("Starting WS connection skipped because the client has no topics to work with.");return}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(n,i)=>{await this.connect(t).then(n).catch(i).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(t){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=t||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Mg())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(t){if((t==null?void 0:t.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const n=t.sort((i,r)=>i.publishedAt-r.publishedAt);this.logger.debug(`Batch of ${n.length} message events sorted`);for(const i of n)try{await this.onMessageEvent(i)}catch(r){this.logger.warn(r,"Error while processing batch message event: "+(r==null?void 0:r.message))}this.logger.trace(`Batch of ${n.length} message events processed`)}async onLinkMessageEvent(t,n){const{topic:i}=t;if(!n.sessionExists){const r=Tt(te.FIVE_MINUTES),s={topic:i,expiry:r,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(i,s)}this.events.emit(yt.message,t),await this.recordMessageEvent(t,yl.inbound)}async connect(t){await this.confirmOnlineStateOrThrow(),t&&t!==this.relayUrl&&(this.relayUrl=t,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let n=1;for(;n<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${n}...`),await this.createProvider(),await new Promise(async(i,r)=>{const s=()=>
317{r(new Error("Connection interrupted while trying to connect"))};this.provider.once(qn.disconnect,s),await Ni(new Promise((o,c)=>{this.provider.connect().then(o).catch(c)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>{r(o)}).finally(()=>{this.provider.off(qn.disconnect,s),clearTimeout(this.reconnectTimeout)}),await new Promise(async(o,c)=>{const l=()=>{r(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(qn.disconnect,l),await this.subscriber.start().then(o).catch(c).finally(()=>{this.provider.off(qn.disconnect,l)})}),this.hasExperiencedNetworkDisruption=!1,i()})}catch(i){await this.subscriber.stop();const r=i;this.logger.warn({},r.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${n}`);break}await new Promise(i=>setTimeout(i,te.toMiliseconds(n*1))),n++}}startPingTimeout(){var t,n,i,r,s;if(Wl())try{(n=(t=this.provider)==null?void 0:t.connection)!=null&&n.socket&&((s=(r=(i=this.provider)==null?void 0:i.connection)==null?void 0:r.socket)==null||s.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o,o==null?void 0:o.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const t=await this.core.crypto.signJWT(this.relayUrl);this.provider=new F$(new Z$(rR({sdkVersion:W0,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(t,n){const{topic:i,message:r}=t;await this.messages.set(i,r,n)}async shouldIgnoreMessageEvent(t){const{topic:n,message:i}=t;if(!i||i.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isKnownTopic(n))return this.logger.warn(`Ignoring message for unknown topic ${n}`),!0;const r=this.messages.has(n,i);return r&&this.logger.warn(`Ignoring duplicate message: ${i}`),r}async onProviderPayload(t){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),hm(t)){if(!t.method.endsWith(cW))return;const n=t.params,{topic:i,message:r,publishedAt:s,attestation:o}=n.data,c={topic:i,message:r,publishedAt:s,transportType:rt.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(Wg({type:"event",event:n.id},c)),this.events.emit(n.id,c),await this.acknowledgePayload(t),await this.onMessageEvent(c)}else sd(t)&&this.events.emit(yt.message_ack,t)}async onMessageEvent(t){await this.shouldIgnoreMessageEvent(t)||(await this.recordMessageEvent(t,yl.inbound),this.events.emit(yt.message,t))}async acknowledgePayload(t){const n=ql(t.id,!0);await this.provider.connection.send(n)}unregisterProviderListeners(){this.provider.off(qn.payload,this.onPayloadHandler),this.provider.off(qn.connect,this.onConnectHandler),this.provider.off(qn.disconnect,this.onDisconnectHandler),this.provider.off(qn.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let t=await Mg();QV(async n=>{t!==n&&(t=n,n?await this.transportOpen().catch(i=>this.logger.error(i,i==null?void 0:i.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(Ws.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&GV())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(n){this.logger.warn(n,n==null?void 0:n.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(yt.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(t=>this.logger.error(t,t==null?void 0:t.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},te.toMiliseconds(lW)))))}isInitialized(){if(!this.initialized){const{message:t}=ne("NOT_INITIALIZED",this.name);throw new Error(t)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}await this.connect()}}}function AY(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Fg(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}
317function Yg(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const OY="[object RegExp]",kY="[object String]",zY="[object Number]",PY="[object Boolean]",Hg="[object Arguments]",RY="[object Symbol]",UY="[object Date]",BY="[object Map]",VY="[object Set]",$Y="[object Array]",WY="[object Function]",FY="[object ArrayBuffer]",ph="[object Object]",YY="[object Error]",HY="[object DataView]",QY="[object Uint8Array]",ZY="[object Uint8ClampedArray]",qY="[object Uint16Array]",GY="[object Uint32Array]",KY="[object BigUint64Array]",JY="[object Int8Array]",XY="[object Int16Array]",eH="[object Int32Array]",tH="[object BigInt64Array]",nH="[object Float32Array]",iH="[object Float64Array]";function rH(){}function Qg(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function sH(e,t,n){return Ia(e,t,void 0,void 0,void 0,void 0,n)}function Ia(e,t,n,i,r,s,o){const c=o(e,t,n,i,r,s);if(c!==void 0)return c;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return Oa(e,t,s,o)}return Oa(e,t,s,o)}function Oa(e,t,n,i){if(Object.is(e,t))return!0;let r=Yg(e),s=Yg(t);if(r===Hg&&(r=ph),s===Hg&&(s=ph),r!==s)return!1;switch(r){case kY:return e.toString()===t.toString();case zY:{const l=e.valueOf(),u=t.valueOf();return AY(l,u)}case PY:case UY:case RY:return Object.is(e.valueOf(),t.valueOf());case OY:return e.source===t.source&&e.flags===t.flags;case WY:return e===t}n=n??new Map;const o=n.get(e),c=n.get(t);if(o!=null&&c!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(r){case BY:{if(e.size!==t.size)return!1;for(const[l,u]of e.entries())if(!t.has(l)||!Ia(u,t.get(l),l,e,t,n,i))return!1;return!0}case VY:{if(e.size!==t.size)return!1;const l=Array.from(e.values()),u=Array.from(t.values());for(let d=0;d<l.length;d++){const f=l[d],m=u.findIndex(y=>Ia(f,y,void 0,e,t,n,i));if(m===-1)return!1;u.splice(m,1)}return!0}case $Y:case QY:case ZY:case qY:case GY:case KY:case JY:case XY:case eH:case tH:case nH:case iH:{if(typeof Ve<"u"&&Ve.isBuffer(e)!==Ve.isBuffer(t)||e.length!==t.length)return!1;for(let l=0;l<e.length;l++)if(!Ia(e[l],t[l],l,e,t,n,i))return!1;return!0}case FY:return e.byteLength!==t.byteLength?!1:Oa(new Uint8Array(e),new Uint8Array(t),n,i);case HY:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:Oa(new Uint8Array(e),new Uint8Array(t),n,i);case YY:return e.name===t.name&&e.message===t.message;case ph:{if(!(Oa(e.constructor,t.constructor,n,i)||Qg(e)&&Qg(t)))return!1;const l=[...Object.keys(e),...Fg(e)],u=[...Object.keys(t),...Fg(t)];if(l.length!==u.length)return!1;for(let d=0;d<l.length;d++){const f=l[d],m=e[f];if(!Object.hasOwn(t,f))return!1;const y=t[f];if(!Ia(m,y,f,e,t,n,i))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function oH(e,t){return sH(e,t,rH)}var aH=Object.defineProperty,Zg=Object.getOwnPropertySymbols,cH=Object.prototype.hasOwnProperty,lH=Object.prototype.propertyIsEnumerable,G0=(e,t,n)=>t in e?aH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qg=(e,t)=>{for(var n in t||(t={}))cH.call(t,n)&&G0(e,n,t[n]);if(Zg)for(var n of Zg(t))lH.call(t,n)&&G0(e,n,t[n]);return e},Ln=(e,t,n)=>G0(e,typeof t!="symbol"?t+"":t,n);class Hs extends OD{constructor(t,n,i,r=Ri,s=void 0){super(t,n,i,r),this.core=t,this.logger=n,this.name=i,Ln(this,"map",new Map),Ln(this,"version",uW),Ln(this,"cached",[]),Ln(this,"initialized",!1),Ln(this,"getKey"),Ln(this,"storagePrefix",Ri),Ln(this,"recentlyDeleted",[]),Ln(this,"recentlyDeletedLimit",200),Ln(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!At(o)?this.map.set(this.getKey(o),o):CV(o)?this.map.set(o.id,o):EV(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)}),Ln(this,"set",async(o,c)=>{this.isInitialized(),this.map.has(o)?await this.update(o,c):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:c}),this.map.set(o,c),await this.persist())}),Ln(this,"get",o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o))),Ln(this,"getAll",o=>(this.isInitialized(),o?this.values.filter(c=>Object.keys(o).every(l=>oH(c[l],o[l]))):this.values)),Ln(this,"update",async(o,c)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:c});const l=qg(qg({},this.getData(o)),c);this.map.set(o,l),await this.persist()}),Ln(this,"delete",async(o,c)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",ke
317y:o,reason:c}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())}),this.logger=Cn(n,this.name),this.storagePrefix=r,this.getKey=s}get context(){return Un(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(t){this.recentlyDeleted.push(t),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(t){await this.core.storage.setItem(this.storageKey,t)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(t){const n=this.map.get(t);if(!n){if(this.recentlyDeleted.includes(t)){const{message:r}=ne("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${t}`);throw this.logger.error(r),new Error(r)}const{message:i}=ne("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(i),new Error(i)}return n}async persist(){await this.setDataStore(this.values)}async restore(){try{const t=await this.getDataStore();if(typeof t>"u"||!t.length)return;if(this.map.size){const{message:n}=ne("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=t,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(t){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(t)}}isInitialized(){if(!this.initialized){const{message:t}=ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}var uH=Object.defineProperty,dH=(e,t,n)=>t in e?uH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Se=(e,t,n)=>dH(e,typeof t!="symbol"?t+"":t,n);class hH{constructor(t,n){this.core=t,this.logger=n,Se(this,"name",mW),Se(this,"version",yW),Se(this,"events",new A5),Se(this,"pairings"),Se(this,"initialized",!1),Se(this,"storagePrefix",Ri),Se(this,"ignoredPayloadTypes",[nr]),Se(this,"registeredMethods",[]),Se(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),Se(this,"register",({methods:i})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...i])]}),Se(this,"create",async i=>{this.isInitialized();const r=R0(),s=await this.core.crypto.setSymKey(r),o=Tt(te.FIVE_MINUTES),c={protocol:cx},l={topic:s,expiry:o,relay:c,active:!1,methods:i==null?void 0:i.methods},u=mg({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:r,relay:c,expiryTimestamp:o,methods:i==null?void 0:i.methods});return this.events.emit(hs.create,l),this.core.expirer.set(s,o),await this.pairings.set(s,l),await this.core.relayer.subscribe(s,{transportType:i==null?void 0:i.transportType,internal:i==null?void 0:i.internal}),{topic:s,uri:u}}),Se(this,"pair",async i=>{this.isInitialized();const r=this.core.eventClient.createEvent({properties:{topic:i==null?void 0:i.uri,trace:[Ei.pairing_started]}});this.isValidPair(i,r);const{topic:s,symKey:o,relay:c,expiryTimestamp:l,methods:u}=fg(i.uri);r.props.properties.topic=s,r.addTrace(Ei.pairing_uri_validation_success),r.addTrace(Ei.pairing_uri_not_expired);let d;if(this.pairings.keys.includes(s)){if(d=this.pairings.get(s),r.addTrace(Ei.existing_pairing),d.active)throw r.setError(Ki.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);r.addTrace(Ei.pairing_not_expired)}const f=l||Tt(te.FIVE_MINUTES),m={topic:s,relay:c,expiry:f,active:!1,methods:u};this.core.expirer.set(s,f),await this.pairings.set(s,m),r.addTrace(Ei.store_new_pairing),i.activatePairing&&await this.activate({topic:s}),this.events.emit(hs.create,m),r.addTrace(Ei.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),r.addTrace(Ei.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{r.setError(Ki.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:c})}catch(y){throw r.setError(Ki.subscribe_pairing_topic_failure),y}return r.addTrace(Ei.subscribe_pairing_topic_success),m}),Se(this,"activate",async({topic:i})=>{this.isInitialized();const r=Tt(te.FIVE_MINUTES);this.core.expirer.set(i,r),await this.pairings.update(i,{active:!0,expiry:r})}),Se(this,"ping",async i=>{this.isInitialized(),await this.isValidPing(i),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:r}=i;if(this.pairings.keys.includes(r)){const s=await this.sendRequest(r,"wc_pairingPing",{}),{done:o,resolve:c,reject:l}=us();this.events.once($e("pairing_ping",s),({error:u})=>{u?l(u):c()}),await o()}}),Se(this,"updateExpiry",async({topic:i,expiry:r})=>{this.isInitialized(),await this.pairings.update(i,{expiry:r})}),Se(this,"updateMetadata",async({topic:i,metadata:r})=>{this.isInitialized(),await this.pairings.update(i,{peerMetadata:r})}),Se(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),Se(this,"disconnect",async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:r}=i;this.pairings.keys.includes(r)&&(await this.sendRequest(r,"wc_pairingDelete",lt("USER_DISCONNECTED")),await this.deletePairing(r))}),Se(this,"formatUriFromPairing",i=>{this.isInitialized();const{topic:r,relay:s,expiry:o,methods:c}=i,l=this.core.crypto.keychain.get(r);return mg({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:l,relay:s,expiryTimestamp:o,methods:c})}),Se(this,"sendRequest",async(i,r,s)=>{const o=Xi(r,s),c=await this.core.crypto.encode(i,o),l=da[r].req;return this.core.history.set(i,o),this.core.relayer.publish(i,c,l),o.id}),Se(this,"sendResult",async(i,r,s)=>{const o=ql(i,s),c=await this.core.crypto.encode(r,o),l=(await this.core.history.get(r,i)).request.method,u=da[l].res;await this.core.relayer.publish(r,c,u),await this.core.history.resolve(o)}),Se(this,"sendError",async(i,r,s)=>{const o=dm(i,s),c=await this.core.crypto.encode(r,o),l=(await this.core.history.get(r,i)).request.method,u=da[l]?da[l].res:da.unregistered_method.res;await this.core.relayer.publish(r,c,u),await this.core.history.resolve(o)}),Se(this,"deletePairing",async(i,r)=>{await this.core.relayer.unsubscribe(i),await Promise.all([this.pairings.delete(i,lt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(i),r?Promise.resolve():this.core.expirer.del(i)])}),Se(this,"cleanup",async()=>{const i=this.pairings.getAll().filter(r=>vr(r.expiry));await Promise.all(i.map(r=>this.deletePairing(r.topic)))}),Se(this,"onRelayEventRequest",async i=>{const{topic:r,payload:s}=i;switch(s.method){case"wc_pairingPing":return await this.onPairingPingRequest(r,s);case"wc_pairingDelete":return await this.onPairingDeleteRequest(r,s);default:return await this.onUnknownRpcMethodRequest(r,s)}}),Se(this,"onRelayEventResponse",async i=>{const{topic:r,payload:s}=i,o=(await this.core.history.get(r,s.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(r,s);default:return this.onUnknownRpcMethodResponse(o)}}),Se(this,"onPairingPingRequest",async(i,r)=>{const{id:s}=r;try{this.isValidPing({topic:i}),await this.sendResult(s,i,!0),this.events.emit(hs.ping,{id:s,topic:i})}catch(o){await this.sendError(s,i,o),this.logger.error(o)}}),Se(this,"onPairingPingResponse",(i,r)=>{const{id:s}=r;setTimeout(()=>{vi(r)?this.events.emit($e("pairing_ping",s),{}):ti(r)&&this.events.emit($e("pairing_ping",s),{error:r.error})},500)}),Se(this,"onPairingDeleteRequest",async(i,r)=>{const{id:s}=r;try{this.isValidDisconnect({topic:i}),await this.deletePairing(i),this.events.emit(hs.delete,{id:s,topic:i})}catch(o){await this.sendError(s,i,o),this.logger.error(o)}}),Se(this,"onUnknownRpcMethodRequest",async(i,r)=>{const{id:s,method:o}=r;try{if(this.registeredMethods.includes(o))return;const c=lt("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,i,c),this.logger.error(c)}catch(c){await this.sendError(s,i,c),this.logger.error(c)}}),Se(this,"onUnknownRpcMethodResponse",i=>{this.registeredMethods.includes(i)||this.logger.error(lt("WC_METHOD_UNSUPPORTED",i))}),Se(this,"isValidPair",(i,r)=>{var s;if(!Sn(i)){const{message:c}=ne("MISSING_OR_INVALID",`pair() params: ${i}`);throw r.setError(Ki.malformed_pairing_uri),new Error(c)}if(!MV(i.uri)){const{message:c}=ne("MISSING_OR_INVALID",`pair() uri: ${i.uri}`);throw r.setError(Ki.malformed_pairing_uri),new Error(c)}const o=fg(i==null?void 0:i.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:c}=ne("MISSING_OR_INVALID","pair() uri#relay-protocol");throw r.setError(Ki.malformed_pairing_uri),new Error(c)}if(!(o!=null&&o.symKey)){const{message:c}=ne("MISSING_OR_INVALID","pair() uri#symKey");throw r.setError(Ki.malformed_pairing_uri),new Error(c)}if(o!=null&&o.expiryTimestamp&&te.toMiliseconds(o==null?void 0:o.expiryTimestamp)<Date.now()){r.setError(Ki.pairing_expired);const{message:c}=ne("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(c)}}),Se(this,"isValidPing",async i=>{if(!Sn(i)){const{message:s}=ne("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(s)}const{topic:r}=i;await this.isValidPairingTopic(r)}),Se(this,"isValidDisconnect",async i=>{if(!Sn(i)){const{message:s}=ne("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(s)}const{topic:r}=i;await this.isValidPairingTopic(r)}),Se(this,"isValidPairingTopic",async i=>{if(!xt(i,!1)){const{message:r}=ne("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(r)}if(!this.pairings.keys.includes(i)){const{message:r}=ne("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(r)}if(vr(this.pairings.get(i).expiry)){await this.deletePairing(i);const{message:r}=ne("EXPIRED",`pairing topic: ${i}`);throw new Error(r)}}),this.core=t,this.logger=Cn(n,this.name),this.pairings=new Hs(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Un(this.logger)}isInitialized(){if(!this.initialized){const{message:t}=ne("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.core.relayer.on(yt.message,async t=>{const{topic:n,message:i,transportType:r}=t;if(this.pairings.keys.includes(n)&&r!==rt.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))try{const s=await this.core.crypto.decode(n,i);hm(s)?(this.core.history.set(n,s),await this.onRelayEventRequest({topic:n,payload:s})):sd(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:n,payload:s}),this.core.history.delete(n,s.id)),await this.core.relayer.messages.ack(n,i)}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(Kn.expired,async t=>{const{topic:n}=ob(t.target);n&&this.pairings.keys.includes(n)&&(await this.deletePairing(n,!0),this.events.emit(hs.expire,{topic:n}))})}}var fH=Object.defineProperty,mH=(e,t,n)=>t in e?fH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$t=(e,t,n)=>mH(e,typeof t!="symbol"?t+"":t,n);class yH extends SD{constructor(t,n){super(t,n),this.core=t,this.logger=n,$t(this,"records",new Map),$t(this,"events",new wi.EventEmitter),$t(this,"name",gW),$t(this,"version",pW),$t(this,"cac
317hed",[]),$t(this,"initialized",!1),$t(this,"storagePrefix",Ri),$t(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.records.set(i.id,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),$t(this,"set",(i,r,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:i,request:r,chainId:s}),this.records.has(r.id))return;const o={id:r.id,topic:i,request:{method:r.method,params:r.params||null},chainId:s,expiry:Tt(te.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(di.created,o)}),$t(this,"resolve",async i=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:i}),!this.records.has(i.id))return;const r=await this.getRecord(i.id);typeof r.response>"u"&&(r.response=ti(i)?{error:i.error}:{result:i.result},this.records.set(r.id,r),this.persist(),this.events.emit(di.updated,r))}),$t(this,"get",async(i,r)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:i,id:r}),await this.getRecord(r))),$t(this,"delete",(i,r)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:r}),this.values.forEach(s=>{if(s.topic===i){if(typeof r<"u"&&s.id!==r)return;this.records.delete(s.id),this.events.emit(di.deleted,s)}}),this.persist()}),$t(this,"exists",async(i,r)=>(this.isInitialized(),this.records.has(r)?(await this.getRecord(r)).topic===i:!1)),$t(this,"on",(i,r)=>{this.events.on(i,r)}),$t(this,"once",(i,r)=>{this.events.once(i,r)}),$t(this,"off",(i,r)=>{this.events.off(i,r)}),$t(this,"removeListener",(i,r)=>{this.events.removeListener(i,r)}),this.logger=Cn(n,this.name)}get context(){return Un(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 t=[];return this.values.forEach(n=>{if(typeof n.response<"u")return;const i={topic:n.topic,request:Xi(n.request.method,n.request.params,n.id),chainId:n.chainId};return t.push(i)}),t}async setJsonRpcRecords(t){await this.core.storage.setItem(this.storageKey,t)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(t){this.isInitialized();const n=this.records.get(t);if(!n){const{message:i}=ne("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(i)}return n}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(di.sync)}async restore(){try{const t=await this.getJsonRpcRecords();if(typeof t>"u"||!t.length)return;if(this.records.size){const{message:n}=ne("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=t,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}}registerEventListeners(){this.events.on(di.created,t=>{const n=di.created;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:t})}),this.events.on(di.updated,t=>{const n=di.updated;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:t})}),this.events.on(di.deleted,t=>{const n=di.deleted;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:t})}),this.core.heartbeat.on(Ws.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let t=!1;this.records.forEach(n=>{te.toMiliseconds(n.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${n.id}`),this.records.delete(n.id),this.events.emit(di.deleted,n,!1),t=!0)}),t&&this.persist()}catch(t){this.logger.warn(t)}}isInitialized(){if(!this.initialized){const{message:t}=ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}var gH=Object.defineProperty,pH=(e,t,n)=>t in e?gH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sn=(e,t,n)=>pH(e,typeof t!="symbol"?t+"":t,n);class wH extends zD{constructor(t,n){super(t,n),this.core=t,this.logger=n,sn(this,"expirations",new Map),sn(this,"events",new wi.EventEmitter),sn(this,"name",wW),sn(this,"version",_W),sn(this,"cac
317hed",[]),sn(this,"initialized",!1),sn(this,"storagePrefix",Ri),sn(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.expirations.set(i.target,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),sn(this,"has",i=>{try{const r=this.formatTarget(i);return typeof this.getExpiration(r)<"u"}catch{return!1}}),sn(this,"set",(i,r)=>{this.isInitialized();const s=this.formatTarget(i),o={target:s,expiry:r};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Kn.created,{target:s,expiration:o})}),sn(this,"get",i=>{this.isInitialized();const r=this.formatTarget(i);return this.getExpiration(r)}),sn(this,"del",i=>{if(this.isInitialized(),this.has(i)){const r=this.formatTarget(i),s=this.getExpiration(r);this.expirations.delete(r),this.events.emit(Kn.deleted,{target:r,expiration:s})}}),sn(this,"on",(i,r)=>{this.events.on(i,r)}),sn(this,"once",(i,r)=>{this.events.once(i,r)}),sn(this,"off",(i,r)=>{this.events.off(i,r)}),sn(this,"removeListener",(i,r)=>{this.events.removeListener(i,r)}),this.logger=Cn(n,this.name)}get context(){return Un(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(t){if(typeof t=="string")return sR(t);if(typeof t=="number")return oR(t);const{message:n}=ne("UNKNOWN_TYPE",`Target type: ${typeof t}`);throw new Error(n)}async setExpirations(t){await this.core.storage.setItem(this.storageKey,t)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Kn.sync)}async restore(){try{const t=await this.getExpirations();if(typeof t>"u"||!t.length)return;if(this.expirations.size){const{message:n}=ne("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=t,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(t){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(t)}}getExpiration(t){const n=this.expirations.get(t);if(!n){const{message:i}=ne("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.warn(i),new Error(i)}return n}checkExpiry(t,n){const{expiry:i}=n;te.toMiliseconds(i)-Date.now()<=0&&this.expire(t,n)}expire(t,n){this.expirations.delete(t),this.events.emit(Kn.expired,{target:t,expiration:n})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((t,n)=>this.checkExpiry(n,t))}registerEventListeners(){this.core.heartbeat.on(Ws.pulse,()=>this.checkExpirations()),this.events.on(Kn.created,t=>{const n=Kn.created;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:t}),this.persist()}),this.events.on(Kn.expired,t=>{const n=Kn.expired;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:t}),this.persist()}),this.events.on(Kn.deleted,t=>{const n=Kn.deleted;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:t}),this.persist()})}isInitialized(){if(!this.initialized){const{message:t}=ne("NOT_INITIALIZED",this.name);throw new Error(t)}}}var _H=Object.defineProperty,bH=(e,t,n)=>t in e?_H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bt=(e,t,n)=>bH(e,typeof t!="symbol"?t+"":t,n);class xH extends PD{constructor(t,n,i){super(t,n,i),this.core=t,this.logger=n,this.store=i,bt(this,"name",bW),bt(this,"abortController"),bt(this,"isDevEnv"),bt(this,"verifyUrlV3",IW),bt(this,"storagePrefix",Ri),bt(this,"version",ax),bt(this,"publicKey"),bt(this,"fetchPromise"),bt(this,"init",async()=>{var r;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&te.toMiliseconds((r=this.publicKey)==null?void 0:r.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),bt(this,"register",async r=>{if(!Yo()||this.isDevEnv)return;const s=window.location.origin,{id:o,decryptedId:c}=r,l=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${o}&decryptedId=${c}`;
317try{const u=Ds(),d=this.startAbortTimer(te.ONE_SECOND*5),f=await new Promise((m,y)=>{const g=()=>{window.removeEventListener("message",w),u.body.removeChild(p),y("attestation aborted")};this.abortController.signal.addEventListener("abort",g);const p=u.createElement("iframe");p.src=l,p.style.display="none",p.addEventListener("error",g,{signal:this.abortController.signal});const w=x=>{if(x.data&&typeof x.data=="string")try{const I=JSON.parse(x.data);if(I.type==="verify_attestation"){if(b0(I.attestation).payload.id!==o)return;clearInterval(d),u.body.removeChild(p),this.abortController.signal.removeEventListener("abort",g),window.removeEventListener("message",w),m(I.attestation===null?"":I.attestation)}}catch(I){this.logger.warn(I)}};u.body.appendChild(p),window.addEventListener("message",w,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",f),f}catch(u){this.logger.warn(u)}return""}),bt(this,"resolve",async r=>{if(this.isDevEnv)return"";const{attestationId:s,hash:o,encryptedId:c}=r;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(b0(s).payload.id!==c)return;const u=await this.isValidJwtAttestation(s);if(u){if(!u.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return u}}if(!o)return;const l=this.getVerifyUrl(r==null?void 0:r.verifyUrl);return this.fetchAttestation(o,l)}),bt(this,"fetchAttestation",async(r,s)=>{this.logger.debug(`resolving attestation: ${r} from url: ${s}`);const o=this.startAbortTimer(te.ONE_SECOND*5),c=await fetch(`${s}/attestation/${r}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),c.status===200?await c.json():void 0}),bt(this,"getVerifyUrl",r=>{let s=r||Aa;return MW.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${Aa}`),s=Aa),s}),bt(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const r=this.startAbortTimer(te.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(r),await s.json()}catch(r){this.logger.warn(r)}}),bt(this,"persistPublicKey",async r=>{this.logger.debug("persisting public key to local storage",r),await this.store.setItem(this.storeKey,r),this.publicKey=r}),bt(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),bt(this,"isValidJwtAttestation",async r=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(r,s)}catch(c){this.logger.error(c),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(r,o)}catch(c){this.logger.error(c),this.logger.warn("error validating attestation")}}),bt(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),bt(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),s(o))});const r=await this.fetchPromise;return this.fetchPromise=void 0,r}),bt(this,"validateAttestation",(r,s)=>{const o=tV(r,s.publicKey),c={hasExpired:te.toMiliseconds(o.exp)<Date.now(),payload:o};if(c.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:c.payload.origin,isScam:c.payload.isScam,isVerified:c.payload.isVerified}}),this.logger=Cn(n,this.name),this.abortController=new AbortController,this.isDevEnv=G1(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return Un(this.logger)}startAbortTimer(t){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),te.toMiliseconds(t))}}var IH=Object.defineProperty,MH=(e,t,n)=>t in e?IH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gg=(e,t,n)=>MH(e,typeof t!="symbol"?t+"":t,n);class CH extends RD{constructor(t,n){super(t,n),this.projectId=t,this.logger=n,Gg(this,"context",CW),Gg(this,"registerDeviceToken",async i=>{const{clientId:r,token:s,notificationType:o,enableEncrypted:c=!1}=i,l=`${EW}/${this.projectId}/clients`;await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:r,type:o,token:s,always_raw:c})})}),this.logger=Cn(n,this.context)}}var EH=Object.defineProperty,Kg=Object.getOwnPropertySymbols,TH=Object.prototype.hasOwnProperty,vH=Object.prototype.propertyIsEnumerable,K0=(e,t,n)=>t in e?EH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ya=(e,t)=>{for(var n in t||(t={}))TH.call(t,n)&&K0(e,n,t[n]);if(Kg)for(var n of Kg(t))vH.call(t,n)&&K0(e,n,t[n]);return e}
317,Dt=(e,t,n)=>K0(e,typeof t!="symbol"?t+"":t,n);class LH extends UD{constructor(t,n,i=!0){super(t,n,i),this.core=t,this.logger=n,Dt(this,"context",vW),Dt(this,"storagePrefix",Ri),Dt(this,"storageVersion",TW),Dt(this,"events",new Map),Dt(this,"shouldPersist",!1),Dt(this,"init",async()=>{if(!G1())try{const r={eventId:k2(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:rb(this.core.relayer.protocol,this.core.relayer.version,W0)}}};await this.sendEvent([r])}catch(r){this.logger.warn(r)}}),Dt(this,"createEvent",r=>{const{event:s="ERROR",type:o="",properties:{topic:c,trace:l}}=r,u=k2(),d=this.core.projectId||"",f=Date.now(),m=ya({eventId:u,timestamp:f,props:{event:s,type:o,properties:{topic:c,trace:l}},bundleId:d,domain:this.getAppDomain()},this.setMethods(u));return this.telemetryEnabled&&(this.events.set(u,m),this.shouldPersist=!0),m}),Dt(this,"getEvent",r=>{const{eventId:s,topic:o}=r;if(s)return this.events.get(s);const c=Array.from(this.events.values()).find(l=>l.props.properties.topic===o);if(c)return ya(ya({},c),this.setMethods(c.eventId))}),Dt(this,"deleteEvent",r=>{const{eventId:s}=r;this.events.delete(s),this.shouldPersist=!0}),Dt(this,"setEventListeners",()=>{this.core.heartbeat.on(Ws.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(r=>{te.fromMiliseconds(Date.now())-te.fromMiliseconds(r.timestamp)>LW&&(this.events.delete(r.eventId),this.shouldPersist=!0)})})}),Dt(this,"setMethods",r=>({addTrace:s=>this.addTrace(r,s),setError:s=>this.setError(r,s)})),Dt(this,"addTrace",(r,s)=>{const o=this.events.get(r);o&&(o.props.properties.trace.push(s),this.events.set(r,o),this.shouldPersist=!0)}),Dt(this,"setError",(r,s)=>{const o=this.events.get(r);o&&(o.props.type=s,o.timestamp=Date.now(),this.events.set(r,o),this.shouldPersist=!0)}),Dt(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),Dt(this,"restore",async()=>{try{const r=await this.core.storage.getItem(this.storageKey)||[];if(!r.length)return;r.forEach(s=>{this.events.set(s.eventId,ya(ya({},s),this.setMethods(s.eventId)))})}catch(r){this.logger.warn(r)}}),Dt(this,"submit",async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const r=[];for(const[s,o]of this.events)o.props.type&&r.push(o);if(r.length!==0)try{if((await this.sendEvent(r)).ok)for(const s of r)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}}),Dt(this,"sendEvent",async r=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${jW}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${W0}${s}`,{method:"POST",body:JSON.stringify(r)})}),Dt(this,"getAppDomain",()=>ib().url),this.logger=Cn(n,this.context),this.telemetryEnabled=i,i?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var jH=Object.defineProperty,Jg=Object.getOwnPropertySymbols,SH=Object.prototype.hasOwnProperty,DH=Object.prototype.propertyIsEnumerable,J0=(e,t,n)=>t in e?jH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xg=(e,t)=>{for(var n in t||(t={}))SH.call(t,n)&&J0(e,n,t[n]);if(Jg)for(var n of Jg(t))DH.call(t,n)&&J0(e,n,t[n]);return e},et=(e,t,n)=>J0(e,typeof t!="symbol"?t+"":t,n);class fm extends TD{constructor(t){var n;super(t),et(this,"protocol",ox),et(this,"version",ax),et(this,"name",Gl),et(this,"relayUrl"),et(this,"projectId"),et(this,"customStoragePrefix"),et(this,"events",new wi.EventEmitter),et(this,"logger"),et(this,"heartbeat"),et(this,"relayer"),et(this,"crypto"),et(this,"storage"),et(this,"history"),et(this,"expirer"),et(this,"pairing"),et(this,"verify"),et(this,"echoClient"),et(this,"linkModeSupportedApps"),et(this,"eventClient"),et(this,"initialized",!1),et(this,"logChunkController"),et(this,"on",(c,l)=>this.events.on(c,l)),et(this,"once",(c,l)=>this.events.once(c,l)),et(this,"off",(c,l)=>this.events.off(c,l)),et(this,"removeListener",(c,l)=>this.events.removeListener(c,l)),et(this,"dispatchEnvelope",({topic:c,message:l,sessionExists:u})=>
317{if(!c||!l)return;const d={topic:c,message:l,publishedAt:Date.now(),transportType:rt.link_mode};this.relayer.onLinkMessageEvent(d,{sessionExists:u})});const i=this.getGlobalCore(t==null?void 0:t.customStoragePrefix);if(i)try{return this.customStoragePrefix=i.customStoragePrefix,this.logger=i.logger,this.heartbeat=i.heartbeat,this.crypto=i.crypto,this.history=i.history,this.expirer=i.expirer,this.storage=i.storage,this.relayer=i.relayer,this.pairing=i.pairing,this.verify=i.verify,this.echoClient=i.echoClient,this.linkModeSupportedApps=i.linkModeSupportedApps,this.eventClient=i.eventClient,this.initialized=i.initialized,this.logChunkController=i.logChunkController,i}catch(c){console.warn("Failed to copy global core",c)}this.projectId=t==null?void 0:t.projectId,this.relayUrl=(t==null?void 0:t.relayUrl)||lx,this.customStoragePrefix=t!=null&&t.customStoragePrefix?`:${t.customStoragePrefix}`:"";const r=k1({level:typeof(t==null?void 0:t.logger)=="string"&&t.logger?t.logger:G$.logger,name:Gl}),{logger:s,chunkLoggerController:o}=MD({opts:r,maxSizeInBytes:t==null?void 0:t.maxLogBlobSizeInBytes,loggerOverride:t==null?void 0:t.logger});this.logChunkController=o,(n=this.logChunkController)!=null&&n.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var c,l;(c=this.logChunkController)!=null&&c.downloadLogsBlobInBrowser&&((l=this.logChunkController)==null||l.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=Cn(s,this.name),this.heartbeat=new fS,this.crypto=new sY(this,this.logger,t==null?void 0:t.keychain),this.history=new yH(this,this.logger),this.expirer=new wH(this,this.logger),this.storage=t!=null&&t.storage?t.storage:new qS(Xg(Xg({},K$),t==null?void 0:t.storageOptions)),this.relayer=new NY({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new hH(this,this.logger),this.verify=new xH(this,this.logger,this.storage),this.echoClient=new CH(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new LH(this,this.logger,t==null?void 0:t.telemetryEnabled),this.setGlobalCore(this)}static async init(t){const n=new fm(t);await n.initialize();const i=await n.crypto.getClientId();return await n.storage.setItem(dW,i),n}get context(){return Un(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var t;return(t=this.logChunkController)==null?void 0:t.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(t){this.linkModeSupportedApps.includes(t)||(this.linkModeSupportedApps.push(t),await this.storage.setItem(Dg,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.linkModeSupportedApps=await this.storage.getItem(Dg)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(t){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,t),this.logger.error(t.message),t}}getGlobalCore(t=""){try{if(this.isGlobalCoreDisabled())return;const n=`_walletConnectCore_${t}`,i=`${n}_count`;return globalThis[i]=(globalThis[i]||0)+1,globalThis[i]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[i]} times.`),globalThis[n]}catch(n){console.warn("Failed to get global WalletConnect core",n);return}}setGlobalCore(t){var n;try{if(this.isGlobalCoreDisabled())return;const i=`_walletConnectCore_${((n=t.opts)==null?void 0:n.customStoragePrefix)||""}`;globalThis[i]=t}catch(i){console.warn("Failed to set global WalletConnect core",i)}}isGlobalCoreDisabled(){try{return typeof _n<"u"&&q$.DISABLE_GLOBAL_CORE==="true"}catch{return!0}}}const NH=fm,Ix="wc",Mx=2,Cx="client",mm=`${Ix}@${Mx}:${Cx}:`,wh={name:Cx,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},e4="WALLETCONNECT_DEEPLINK_CHOICE",AH="proposal",t4="Proposal expired",OH="session",so=te.SEVEN_DAYS,kH="engine",Wt={wc_sessionPropose:{req:{ttl:te.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:te.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:te.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:te.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:te.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:te.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:te.ONE_DAY,prompt:!1,tag:1104},res:{ttl:te.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:te.ONE_DAY,prompt:!1,tag:1106},res:{ttl:te.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:te.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:te.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:te.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:te.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:te.ONE_DAY,prompt:!1,tag:1112},res:{ttl:te.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:te.ONE_DAY,prompt:!1,tag:1114},res:{ttl:te.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:te.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:te.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:te.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:te.FIVE_MINUTES,prompt:!1,tag:1119}}},_h={min:te.FIVE_MINUTES,max:te.SEVEN_DAYS},Ci={idle:"IDLE",active:"ACTIVE"},zH={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""}
317,cosmos_signDirect:{key:""}},PH="request",RH=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],UH="wc",BH="auth",VH="authKeys",$H="pairingTopics",WH="requests",ad=`${UH}@${1.5}:${BH}:`,gl=`${ad}:PUB_KEY`;var FH=Object.defineProperty,YH=Object.defineProperties,HH=Object.getOwnPropertyDescriptors,n4=Object.getOwnPropertySymbols,QH=Object.prototype.hasOwnProperty,ZH=Object.prototype.propertyIsEnumerable,X0=(e,t,n)=>t in e?FH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ye=(e,t)=>{for(var n in t||(t={}))QH.call(t,n)&&X0(e,n,t[n]);if(n4)for(var n of n4(t))ZH.call(t,n)&&X0(e,n,t[n]);return e},on=(e,t)=>YH(e,HH(t)),G=(e,t,n)=>X0(e,typeof t!="symbol"?t+"":t,n);class qH extends WD{constructor(t){super(t),G(this,"name",kH),G(this,"events",new A5),G(this,"initialized",!1),G(this,"requestQueue",{state:Ci.idle,queue:[]}),G(this,"sessionRequestQueue",{state:Ci.idle,queue:[]}),G(this,"emittedSessionRequests",new yR({limit:500})),G(this,"requestQueueDelay",te.ONE_SECOND),G(this,"expectedPairingMethodMap",new Map),G(this,"recentlyDeletedMap",new Map),G(this,"recentlyDeletedLimit",200),G(this,"relayMessageCache",[]),G(this,"pendingSessions",new Map),G(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(Wt)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},te.toMiliseconds(this.requestQueueDelay)))}),G(this,"connect",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const i=on(Ye({},n),{requiredNamespaces:n.requiredNamespaces||{},optionalNamespaces:n.optionalNamespaces||{}});await this.isValidConnect(i),i.optionalNamespaces=wV(i.requiredNamespaces,i.optionalNamespaces),i.requiredNamespaces={};const{pairingTopic:r,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:c,scopedProperties:l,relays:u}=i;let d=r,f,m=!1;try{if(d){const T=this.client.core.pairing.pairings.get(d);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),m=T.active}}catch(T){throw this.client.logger.error(`connect() -> pairing.get(${d}) failed`),T}if(!d||!m){const{topic:T,uri:v}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});d=T,f=v}if(!d){const{message:T}=ne("NO_MATCHING_KEY",`connect() pairing topic: ${d}`);throw new Error(T)}const y=await this.client.core.crypto.generateKeyPair(),g=Wt.wc_sessionPropose.req.ttl||te.FIVE_MINUTES,p=Tt(g),w=on(Ye(Ye({requiredNamespaces:s,optionalNamespaces:o,relays:u??[{protocol:cx}],proposer:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:p,pairingTopic:d},c&&{sessionProperties:c}),l&&{scopedProperties:l}),{id:Ti()}),x=$e("session_connect",w.id),{reject:I,resolve:E,done:j}=us(g,t4),C=({id:T})=>{T===w.id&&(this.client.events.off("proposal_expire",C),this.pendingSessions.delete(w.id),this.events.emit(x,{error:{message:t4,code:0}}))};return this.client.events.on("proposal_expire",C),this.events.once(x,({error:T,session:v})=>{this.client.events.off("proposal_expire",C),T?I(T):v&&E(v)}),await this.sendProposeSession({proposal:w,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:w.id}}}),await this.setProposal(w.id,w),{uri:f,approval:j}}),G(this,"pair",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(n)}catch(i){throw this.client.logger.error("pair() failed"),i}}),G(this,"approve",async n=>{var i,r,s;const o=this.client.core.eventClient.createEvent({properties:{topic:(i=n==null?void 0:n.id)==null?void 0:i.toString(),trace:[Er.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(M){throw o.setError(ha.no_internet_connection),M}try{await this.isValidProposalId(n==null?void 0:n.id)}catch(M){throw this.client.logger.error(`approve() -> proposal.get(${n==null?void 0:n.id}) failed`),o.setError(ha.proposal_not_found),M}try{await this.isValidApprove(n)}catch(M){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(ha.session_approve_namespace_validation_failure),M}const{id:c,relayProtocol:l,namespaces:u,sessionProperties:d,scopedProperties:f,sessionConfig:m}=n,y=this.client.proposal.get(c);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:g,proposer:p,requiredNamespaces:w,optionalNamespaces:x}=y;let I=(r=this.client.core.eventClient)==null?void 0:r.getEvent({topic:g});I||(I=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:Er.session_approve_started,properties:{topic:g,trace:[Er.session_approve_started,Er.session_namespaces_validation_success]}}));const E=await this.client.core.crypto.generateKeyPair(),j=p.publicKey,C=await this.client.core.crypto.generateSharedKey(E,j),T=Ye(Ye(Ye({relay:{protocol:l??"irn"},namespaces:u,controller:{publicKey:E,metadata:this.client.metadata},expiry:Tt(so)},d&&{sessionProperties:d}),f&&{scopedProperties:f}),m&&{sessionConfig:m}),v=rt.relay;I.addTrace(Er.subscribing_session_topic);try{await this.client.core.relayer.subscribe(C,{transportType:v,internal:{skipSubscribe:!0}})}catch(M){throw I.setError(ha.subscribe_session_topic_failure),M}I.addTrace(Er.subscribe_session_topic_success);const N=on(Ye({},T),{topic:C,requiredNamespaces:w,optionalNamespaces:x,pairingTopic:g,acknowledged:!1,self:T.controller,peer:{publicKey:p.publicKey,metadata:p.metadata},controller:E,transportType:rt.relay});await this.client.session.set(C,N),I.addTrace(Er.store_session);try{await this.sendApproveSession({sessionTopic:C,proposal:y,pairingProposalResponse:{relay:{protocol:l??"irn"},responderPublicKey:E},sessionSettleRequest:T,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:c}}}),I.addTrace(Er.session_approve_publish_success)}
317catch(M){throw this.client.logger.error(M),this.client.session.delete(C,lt("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(C),M}return this.client.core.eventClient.deleteEvent({eventId:I.eventId}),await this.client.core.pairing.updateMetadata({topic:g,metadata:p.metadata}),await this.deleteProposal(c),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(C,Tt(so)),{topic:C,acknowledged:()=>Promise.resolve(this.client.session.get(C))}}),G(this,"reject",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(n)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:i,reason:r}=n;let s;try{s=this.client.proposal.get(i).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${i}) failed`),o}s&&await this.sendError({id:i,topic:s,error:r,rpcOpts:Wt.wc_sessionPropose.reject}),await this.deleteProposal(i)}),G(this,"update",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(n)}catch(f){throw this.client.logger.error("update() -> isValidUpdate() failed"),f}const{topic:i,namespaces:r}=n,{done:s,resolve:o,reject:c}=us(),l=Ti(),u=Vr().toString(),d=this.client.session.get(i).namespaces;return this.events.once($e("session_update",l),({error:f})=>{f?c(f):o()}),await this.client.session.update(i,{namespaces:r}),await this.sendRequest({topic:i,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:l,relayRpcId:u}).catch(f=>{this.client.logger.error(f),this.client.session.update(i,{namespaces:d}),c(f)}),{acknowledged:s}}),G(this,"extend",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(n)}catch(l){throw this.client.logger.error("extend() -> isValidExtend() failed"),l}const{topic:i}=n,r=Ti(),{done:s,resolve:o,reject:c}=us();return this.events.once($e("session_extend",r),({error:l})=>{l?c(l):o()}),await this.setExpiry(i,Tt(so)),this.sendRequest({topic:i,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch(l=>{c(l)}),{acknowledged:s}}),G(this,"request",async n=>{this.isInitialized();try{await this.isValidRequest(n)}catch(w){throw this.client.logger.error("request() -> isValidRequest() failed"),w}const{chainId:i,request:r,topic:s,expiry:o=Wt.wc_sessionRequest.req.ttl}=n,c=this.client.session.get(s);(c==null?void 0:c.transportType)===rt.relay&&await this.confirmOnlineStateOrThrow();const l=Ti(),u=Vr().toString(),{done:d,resolve:f,reject:m}=us(o,"Request expired. Please try again.");this.events.once($e("session_request",l),({error:w,result:x})=>{w?m(w):f(x)});const y="wc_sessionRequest",g=this.getAppLinkIfEnabled(c.peer.metadata,c.transportType);if(g)return await this.sendRequest({clientRpcId:l,relayRpcId:u,topic:s,method:y,params:{request:on(Ye({},r),{expiryTimestamp:Tt(o)}),chainId:i},expiry:o,throwOnFailedPublish:!0,appLink:g}).catch(w=>m(w)),this.client.events.emit("session_request_sent",{topic:s,request:r,chainId:i,id:l}),await d();const p={request:on(Ye({},r),{expiryTimestamp:Tt(o)}),chainId:i};return await Promise.all([new Promise(async w=>{await this.sendRequest({clientRpcId:l,relayRpcId:u,topic:s,method:y,params:p,expiry:o,throwOnFailedPublish:!0,tvf:this.getTVFParams(l,p)}).catch(x=>m(x)),this.client.events.emit("session_request_sent",{topic:s,request:r,chainId:i,id:l}),w()}),new Promise(async w=>{var x;if(!((x=c.sessionConfig)!=null&&x.disableDeepLink)){const I=await uR(this.client.core.storage,e4);await aR({id:l,topic:s,wcDeepLink:I})}w()}),d()]).then(w=>w[2])}),G(this,"respond",async n=>{this.isInitialized(),await this.isValidRespond(n);const{topic:i,response:r}=n,{id:s}=r,o=this.client.session.get(i);o.transportType===rt.relay&&await this.confirmOnlineStateOrThrow();const c=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);vi(r)?await this.sendResult({id:s,topic:i,result:r.result,throwOnFailedPublish:!0,appLink:c}):ti(r)&&await this.sendError({id:s,topic:i,error:r.error,appLink:c}),this.cleanupAfterResponse(n)}),G(this,"ping",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(n)}catch(r){throw this.client.logger.error("ping() -> isValidPing() failed"),r}const{topic:i}=n;if(this.client.session.keys.includes(i)){const r=Ti(),s=Vr().toString(),{done:o,resolve:c,reject:l}=us();this.events.once($e("session_ping",r),({error:u})=>{u?l(u):c()}),await Promise.all([this.sendRequest({topic:i,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:r,relayRpcId:s}),o()])}else this.client.core.pairing.pairings.keys.includes(i)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:i}))}),G(this,"emit",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(n);const{topic:i,event:r,chainId:s}=n,o=Vr().toString(),c=Ti();await this.sendRequest({topic:i,method:"wc_sessionEvent",params:{event:r,chainId:s},throwOnFailedPublish:!0,relayRpcId:o,clientRpcId:c})}),G(this,"disconnect",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(n);const{topic:i}=n;if(this.client.session.keys.includes(i))await this.sendRequest({topic:i,method:"wc_sessionDelete",params:lt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:i,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(i))await this.client.core.pairing.disconnect({topic:i});else{const{message:r}=ne("MISMATCHED_TOPIC",`Session or pairing topic not found: ${i}`);throw new Error(r)}}),G(this,"find",n=>(this.isInitialized(),this.client.session.getAll().filter(i=>xV(i,n)))),G(this,"getPendingSessionRequests",()=>
317this.client.pendingRequest.getAll()),G(this,"authenticate",async(n,i)=>{var r;this.isInitialized(),this.isValidAuthenticate(n);const s=i&&this.client.core.linkModeSupportedApps.includes(i)&&((r=this.client.metadata.redirect)==null?void 0:r.linkMode),o=s?rt.link_mode:rt.relay;o===rt.relay&&await this.confirmOnlineStateOrThrow();const{chains:c,statement:l="",uri:u,domain:d,nonce:f,type:m,exp:y,nbf:g,methods:p=[],expiry:w}=n,x=[...n.resources||[]],{topic:I,uri:E}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:I,uri:E}});const j=await this.client.core.crypto.generateKeyPair(),C=ml(j);if(await Promise.all([this.client.auth.authKeys.set(gl,{responseTopic:C,publicKey:j}),this.client.auth.pairingTopics.set(C,{topic:C,pairingTopic:I})]),await this.client.core.relayer.subscribe(C,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${I}`),p.length>0){const{namespace:V}=hl(c[0]);let F=TU(V,"request",p);fl(x)&&(F=LU(F,x.pop())),x.push(F)}const T=w&&w>Wt.wc_sessionAuthenticate.req.ttl?w:Wt.wc_sessionAuthenticate.req.ttl,v={authPayload:{type:m??"caip122",chains:c,statement:l,aud:u,domain:d,version:"1",nonce:f,iat:new Date().toISOString(),exp:y,nbf:g,resources:x},requester:{publicKey:j,metadata:this.client.metadata},expiryTimestamp:Tt(T)},N={eip155:{chains:c,methods:[...new Set(["personal_sign",...p])],events:["chainChanged","accountsChanged"]}},M={requiredNamespaces:{},optionalNamespaces:N,relays:[{protocol:"irn"}],pairingTopic:I,proposer:{publicKey:j,metadata:this.client.metadata},expiryTimestamp:Tt(Wt.wc_sessionPropose.req.ttl),id:Ti()},{done:S,resolve:L,reject:O}=us(T,"Request expired"),P=Ti(),$=$e("session_connect",M.id),z=$e("session_request",P),k=async({error:V,session:F})=>{this.events.off(z,B),V?O(V):F&&L({session:F})},B=async V=>{var F,Y,Q;if(await this.deletePendingAuthRequest(P,{message:"fulfilled",code:0}),V.error){const le=lt("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return V.error.code===le.code?void 0:(this.events.off($,k),O(V.error.message))}await this.deleteProposal(M.id),this.events.off($,k);const{cacaos:Z,responder:K}=V.result,q=[],oe=[];for(const le of Z){await H2({cacao:le,projectId:this.client.core.projectId})||(this.client.logger.error(le,"Signature verification failed"),O(lt("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:Te}=le,qe=fl(Te.resources),ct=[j0(Te.iss)],fn=Fl(Te.iss);if(qe){const fe=Q2(qe),ge=Z2(qe);q.push(...fe),ct.push(...ge)}for(const fe of ct)oe.push(`${fe}:${fn}`)}const re=await this.client.core.crypto.generateSharedKey(j,K.publicKey);let ae;q.length>0&&(ae={topic:re,acknowledged:!0,self:{publicKey:j,metadata:this.client.metadata},peer:K,controller:K.publicKey,expiry:Tt(so),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:I,namespaces:wg([...new Set(q)],[...new Set(oe)]),transportType:o},await this.client.core.relayer.subscribe(re,{transportType:o}),await this.client.session.set(re,ae),I&&await this.client.core.pairing.updateMetadata({topic:I,metadata:K.metadata}),ae=this.client.session.get(re)),(F=this.client.metadata.redirect)!=null&&F.linkMode&&(Y=K.metadata.redirect)!=null&&Y.linkMode&&(Q=K.metadata.redirect)!=null&&Q.universal&&i&&(this.client.core.addLinkModeSupportedApp(K.metadata.redirect.universal),this.client.session.update(re,{transportType:rt.link_mode})),L({auths:Z,session:ae})};this.events.once($,k),this.events.once(z,B);let W;try{if(s){const V=Xi("wc_sessionAuthenticate",v,P);this.client.core.history.set(I,V);const F=await this.client.core.crypto.encode("",V,{type:vc,encoding:Nr});W=el(i,I,F)}else await Promise.all([this.sendRequest({topic:I,method:"wc_sessionAuthenticate",params:v,expiry:n.expiry,throwOnFailedPublish:!0,clientRpcId:P}),this.sendRequest({topic:I,method:"wc_sessionPropose",params:M,expiry:Wt.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:M.id})])}catch(V){throw this.events.off($,k),this.events.off(z,B),V}return await this.setProposal(M.id,M),await this.setAuthRequest(P,{request:on(Ye({},v),{verifyContext:{}}),pairingTopic:I,transportType:o}),{uri:W??E,response:S}}),G(this,"approveSessionAuthenticate",async n=>{const{id:i,auths:r}=n,s=this.client.core.eventClient.createEvent({properties:{topic:i.toString(),trace:[cs.authenticated_session_approve_started]}});try{this.isInitialized()}catch(w){throw s.setError(fa.no_internet_connection),w}const o=this.getPendingAuthRequest(i);if(!o)throw s.setError(fa.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${i}`);const c=o.transportType||rt.relay;c===rt.relay&&await this.confirmOnlineStateOrThrow();const l=o.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),d=ml(l),f={type:nr,receiverPublicKey:l,senderPublicKey:u},m=[],y=[];for(const w of r){if(!await H2({cacao:w,projectId:this.client.core.projectId})){s.setError(fa.invalid_cacao);const C=lt("SESSION_SETTLEMENT_FAILED","Signature verification failed");
317throw await this.sendError({id:i,topic:d,error:C,encodeOpts:f}),new Error(C.message)}s.addTrace(cs.cacaos_verified);const{p:x}=w,I=fl(x.resources),E=[j0(x.iss)],j=Fl(x.iss);if(I){const C=Q2(I),T=Z2(I);m.push(...C),E.push(...T)}for(const C of E)y.push(`${C}:${j}`)}const g=await this.client.core.crypto.generateSharedKey(u,l);s.addTrace(cs.create_authenticated_session_topic);let p;if((m==null?void 0:m.length)>0){p={topic:g,acknowledged:!0,self:{publicKey:u,metadata:this.client.metadata},peer:{publicKey:l,metadata:o.requester.metadata},controller:l,expiry:Tt(so),authentication:r,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:wg([...new Set(m)],[...new Set(y)]),transportType:c},s.addTrace(cs.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(g,{transportType:c})}catch(w){throw s.setError(fa.subscribe_authenticated_session_topic_failure),w}s.addTrace(cs.subscribe_authenticated_session_topic_success),await this.client.session.set(g,p),s.addTrace(cs.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace(cs.publishing_authenticated_session_approve);try{await this.sendResult({topic:d,id:i,result:{cacaos:r,responder:{publicKey:u,metadata:this.client.metadata}},encodeOpts:f,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,c)})}catch(w){throw s.setError(fa.authenticated_session_approve_publish_failure),w}return await this.client.auth.requests.delete(i,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:p}}),G(this,"rejectSessionAuthenticate",async n=>{this.isInitialized();const{id:i,reason:r}=n,s=this.getPendingAuthRequest(i);if(!s)throw new Error(`Could not find pending auth request with id ${i}`);s.transportType===rt.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),l=ml(o),u={type:nr,receiverPublicKey:o,senderPublicKey:c};await this.sendError({id:i,topic:l,error:r,encodeOpts:u,rpcOpts:Wt.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(i,{message:"rejected",code:0}),await this.deleteProposal(i)}),G(this,"formatAuthMessage",n=>{this.isInitialized();const{request:i,iss:r}=n;return xb(i,r)}),G(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const n=this.relayMessageCache.shift();n&&await this.onRelayMessage(n)}catch(n){this.client.logger.error(n)}},50)}),G(this,"cleanupDuplicatePairings",async n=>{if(n.pairingTopic)try{const i=this.client.core.pairing.pairings.get(n.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter(s=>{var o,c;return((o=s.peerMetadata)==null?void 0:o.url)&&((c=s.peerMetadata)==null?void 0:c.url)===n.peer.metadata.url&&s.topic&&s.topic!==i.topic});if(r.length===0)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(i){this.client.logger.error(i)}}),G(this,"deleteSession",async n=>{var i;const{topic:r,expirerHasDeleted:s=!1,emitEvent:o=!0,id:c=0}=n,{self:l}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,lt("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(l.publicKey)&&await this.client.core.crypto.deleteKeyPair(l.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),s||this.client.core.expirer.del(r),this.client.core.storage.removeItem(e4).catch(u=>this.client.logger.warn(u)),this.getPendingSessionRequests().forEach(u=>{u.topic===r&&this.deletePendingSessionRequest(u.id,lt("USER_DISCONNECTED"))}),r===((i=this.sessionRequestQueue.queue[0])==null?void 0:i.topic)&&(this.sessionRequestQueue.state=Ci.idle),o&&this.client.events.emit("session_delete",{id:c,topic:r})}),G(this,"deleteProposal",async(n,i)=>{if(i)try{const r=this.client.proposal.get(n),s=this.client.core.eventClient.getEvent({topic:r.pairingTopic});s==null||s.setError(ha.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(n,lt("USER_DISCONNECTED")),i?Promise.resolve():this.client.core.expirer.del(n)]),this.addToRecentlyDeleted(n,"proposal")}),G(this,"deletePendingSessionRequest",async(n,i,r=!1)=>
317{await Promise.all([this.client.pendingRequest.delete(n,i),r?Promise.resolve():this.client.core.expirer.del(n)]),this.addToRecentlyDeleted(n,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==n),r&&(this.sessionRequestQueue.state=Ci.idle,this.client.events.emit("session_request_expire",{id:n}))}),G(this,"deletePendingAuthRequest",async(n,i,r=!1)=>{await Promise.all([this.client.auth.requests.delete(n,i),r?Promise.resolve():this.client.core.expirer.del(n)])}),G(this,"setExpiry",async(n,i)=>{this.client.session.keys.includes(n)&&(this.client.core.expirer.set(n,i),await this.client.session.update(n,{expiry:i}))}),G(this,"setProposal",async(n,i)=>{this.client.core.expirer.set(n,Tt(Wt.wc_sessionPropose.req.ttl)),await this.client.proposal.set(n,i)}),G(this,"setAuthRequest",async(n,i)=>{const{request:r,pairingTopic:s,transportType:o=rt.relay}=i;this.client.core.expirer.set(n,r.expiryTimestamp),await this.client.auth.requests.set(n,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:n,pairingTopic:s,verifyContext:r.verifyContext,transportType:o})}),G(this,"setPendingSessionRequest",async n=>{const{id:i,topic:r,params:s,verifyContext:o}=n,c=s.request.expiryTimestamp||Tt(Wt.wc_sessionRequest.req.ttl);this.client.core.expirer.set(i,c),await this.client.pendingRequest.set(i,{id:i,topic:r,params:s,verifyContext:o})}),G(this,"sendRequest",async n=>{const{topic:i,method:r,params:s,expiry:o,relayRpcId:c,clientRpcId:l,throwOnFailedPublish:u,appLink:d,tvf:f,publishOpts:m={}}=n,y=Xi(r,s,l);let g;const p=!!d;try{const I=p?Nr:kn;g=await this.client.core.crypto.encode(i,y,{encoding:I})}catch(I){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${i} failed`),I}let w;if(RH.includes(r)){const I=ei(JSON.stringify(y)),E=ei(g);w=await this.client.core.verify.register({id:E,decryptedId:I})}const x=Ye(Ye({},Wt[r].req),m);if(x.attestation=w,o&&(x.ttl=o),c&&(x.id=c),this.client.core.history.set(i,y),p){const I=el(d,i,g);await we.Linking.openURL(I,this.client.name)}else x.tvf=on(Ye({},f),{correlationId:y.id}),u?(x.internal=on(Ye({},x.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,g,x)):this.client.core.relayer.publish(i,g,x).catch(I=>this.client.logger.error(I));return y.id}),G(this,"sendProposeSession",async n=>{const{proposal:i,publishOpts:r}=n,s=Xi("wc_sessionPropose",i,i.id);this.client.core.history.set(i.pairingTopic,s);const o=await this.client.core.crypto.encode(i.pairingTopic,s,{encoding:kn}),c=ei(JSON.stringify(s)),l=ei(o),u=await this.client.core.verify.register({id:l,decryptedId:c});await this.client.core.relayer.publishCustom({payload:{pairingTopic:i.pairingTopic,sessionProposal:o},opts:on(Ye({},r),{publishMethod:"wc_proposeSession",attestation:u})})}),G(this,"sendApproveSession",async n=>{const{sessionTopic:i,pairingProposalResponse:r,proposal:s,sessionSettleRequest:o,publishOpts:c}=n,l=ql(s.id,r),u=await this.client.core.crypto.encode(s.pairingTopic,l,{encoding:kn}),d=Xi("wc_sessionSettle",o,c==null?void 0:c.id),f=await this.client.core.crypto.encode(i,d,{encoding:kn});this.client.core.history.set(i,d),await this.client.core.relayer.publishCustom({payload:{sessionTopic:i,pairingTopic:s.pairingTopic,sessionProposalResponse:u,sessionSettlementRequest:f},opts:on(Ye({},c),{publishMethod:"wc_approveSession"})})}),G(this,"sendResult",async n=>{const{id:i,topic:r,result:s,throwOnFailedPublish:o,encodeOpts:c,appLink:l}=n,u=ql(i,s);let d;const f=l&&typeof(we==null?void 0:we.Linking)<"u";try{const g=f?Nr:kn;d=await this.client.core.crypto.encode(r,u,on(Ye({},c||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${r} failed`),g}let m,y;try{m=await this.client.core.history.get(r,i);const g=m.request;try{y=this.getTVFParams(i,g.params,s)}catch(p){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${p==null?void 0:p.message}`)}}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${r}, ${i}) failed`),g}if(f){const g=el(l,r,d);await we.Linking.openURL(g,this.client.name)}else{const g=m.request.method,p=Wt[g].res;p.tvf=on(Ye({},y),{correlationId:i}),o?(p.internal=on(Ye({},p.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,d,p)):this.client.core.relayer.publish(r,d,p).catch(w=>this.client.logger.error(w))}await this.client.core.history.resolve(u)}),G(this,"sendError",async n=>{const{id:i,topic:r,error:s,encodeOpts:o,rpcOpts:c,appLink:l}=n,u=dm(i,s);let d;const f=l&&typeof(we==null?void 0:we.Linking)<"u";try{const y=f?Nr:kn;d=await this.client.core.crypto.encode(r,u,on(Ye({},o||{}),{encoding:y}))}catch(y){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${r} failed`),y}let m;try{m=await this.client.core.history.get(r,i)}catch(y){throw this.client.logger.error(`sendError() -> history.get(${r}, ${i}) failed`),y}if(f){const y=el(l,r,d);await we.Linking.openURL(y,this.client.name)}else{const y=m.request.method,g=c||Wt[y].res;this.client.core.relayer.publish(r,d,g)}await this.client.core.history.resolve(u)}),G(this,"cleanup",async()=>{const n=[],i=[];
317this.client.session.getAll().forEach(r=>{let s=!1;vr(r.expiry)&&(s=!0),this.client.core.crypto.keychain.has(r.topic)||(s=!0),s&&n.push(r.topic)}),this.client.proposal.getAll().forEach(r=>{vr(r.expiryTimestamp)&&i.push(r.id)}),await Promise.all([...n.map(r=>this.deleteSession({topic:r})),...i.map(r=>this.deleteProposal(r))])}),G(this,"onProviderMessageEvent",async n=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(n):await this.onRelayMessage(n)}),G(this,"onRelayEventRequest",async n=>{this.requestQueue.queue.push(n),await this.processRequestsQueue()}),G(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===Ci.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=Ci.active;const n=this.requestQueue.queue.shift();if(n)try{await this.processRequest(n)}catch(i){this.client.logger.warn(i)}}this.requestQueue.state=Ci.idle}),G(this,"processRequest",async n=>{const{topic:i,payload:r,attestation:s,transportType:o,encryptedId:c}=n,l=r.method;if(!this.shouldIgnorePairingRequest({topic:i,requestMethod:l}))switch(l){case"wc_sessionPropose":return await this.onSessionProposeRequest
317({topic:i,payload:r,attestation:s,encryptedId:c});case"wc_sessionSettle":return await this.onSessionSettleRequest(i,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(i,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(i,r);case"wc_sessionPing":return await this.onSessionPingRequest(i,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(i,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:i,payload:r,attestation:s,encryptedId:c,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(i,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:i,payload:r,attestation:s,encryptedId:c,transportType:o});default:return this.client.logger.info(`Unsupported request method ${l}`)}}),G(this,"onRelayEventResponse",async n=>{const{topic:i,payload:r,transportType:s}=n,o=(await this.client.core.history.get(i,r.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(i,r,s);case"wc_sessionSettle":return this.onSessionSettleResponse(i,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(i,r);case"wc_sessionExtend":return this.onSessionExtendResponse(i,r);case"wc_sessionPing":return this.onSessionPingResponse(i,r);case"wc_sessionRequest":return this.onSessionRequestResponse(i,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(i,r);default:return this.client.logger.info(`Unsupported response method ${o}`)}}),G(this,"onRelayEventUnknownPayload",n=>{const{topic:i}=n,{message:r}=ne("MISSING_OR_INVALID",`Decoded payload on topic ${i} is not identifiable as a JSON-RPC request or a response.`);throw new Error(r)}),G(this,"shouldIgnorePairingRequest",n=>{const{topic:i,requestMethod:r}=n,s=this.expectedPairingMethodMap.get(i);return!s||s.includes(r)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),G(this,"onSessionProposeRequest",async n=>{const{topic:i,payload:r,attestation:s,encryptedId:o}=n,{params:c,id:l}=r;try{const u=this.client.core.eventClient.getEvent({topic:i});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),u==null||u.setError(Ki.proposal_listener_not_found)),this.isValidConnect(Ye({},r.params));const d=c.expiryTimestamp||Tt(Wt.wc_sessionPropose.req.ttl),f=Ye({id:l,pairingTopic:i,expiryTimestamp:d,attestation:s,encryptedId:o},c);await this.setProposal(l,f);const m=await this.getVerifyContext({attestationId:s,hash:ei(JSON.stringify(r)),encryptedId:o,metadata:f.proposer.metadata});u==null||u.addTrace(Ei.emit_session_proposal),this.client.events.emit("session_proposal",{id:l,params:f,verifyContext:m})}catch(u){await this.sendError({id:l,topic:i,error:u,rpcOpts:Wt.wc_sessionPropose.autoReject}),this.client.logger.error(u)}}),G(this,"onSessionProposeResponse",async(n,i,r)=>{const{id:s}=i;
317if(vi(i)){const{result:o}=i;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const c=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:c});const l=c.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const u=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:u});const d=await this.client.core.crypto.generateSharedKey(l,u);this.pendingSessions.set(s,{sessionTopic:d,pairingTopic:n,proposalId:s,publicKey:l});const f=await this.client.core.relayer.subscribe(d,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),await this.client.core.pairing.activate({topic:n})}else if(ti(i)){await this.deleteProposal(s);const o=$e("session_connect",s);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(o,{error:i.error})}}),G(this,"onSessionSettleRequest",async(n,i)=>{const{id:r,params:s}=i;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:c,expiry:l,namespaces:u,sessionProperties:d,scopedProperties:f,sessionConfig:m}=i.params,y=[...this.pendingSessions.values()].find(w=>w.sessionTopic===n);if(!y)return this.client.logger.error(`Pending session not found for topic ${n}`);const g=this.client.proposal.get(y.proposalId),p=on(Ye(Ye(Ye({topic:n,relay:o,expiry:l,namespaces:u,acknowledged:!0,pairingTopic:y.pairingTopic,requiredNamespaces:g.requiredNamespaces,optionalNamespaces:g.optionalNamespaces,controller:c.publicKey,self:{publicKey:y.publicKey,metadata:this.client.metadata},peer:{publicKey:c.publicKey,metadata:c.metadata}},d&&{sessionProperties:d}),f&&{scopedProperties:f}),m&&{sessionConfig:m}),{transportType:rt.relay});await this.client.session.set(p.topic,p),await this.setExpiry(p.topic,p.expiry),await this.client.core.pairing.updateMetadata({topic:y.pairingTopic,metadata:p.peer.metadata}),this.client.events.emit("session_connect",{session:p}),this.events.emit($e("session_connect",y.proposalId),{session:p}),this.pendingSessions.delete(y.proposalId),this.deleteProposal(y.proposalId,!1),this.cleanupDuplicatePairings(p),await this.sendResult({id:i.id,topic:n,result:!0})}catch(o){await this.sendError({id:r,topic:n,error:o}),this.client.logger.error(o)}}),G(this,"onSessionSettleResponse",async(n,i)=>{const{id:r}=i;vi(i)?(await this.client.session.update(n,{acknowledged:!0}),this.events.emit($e("session_approve",r),{})):ti(i)&&(await this.client.session.delete(n,lt("USER_DISCONNECTED")),this.events.emit($e("session_approve",r),{error:i.error}))}),G(this,"onSessionUpdateRequest",async(n,i)=>{const{params:r,id:s}=i;try{const o=`${n}_session_update`,c=ua.get(o);if(c&&this.isRequestOutOfSync(c,s)){this.client.logger.warn(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:n,error:lt("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Ye({topic:n},r));try{ua.set(o,s),await this.client.session.update(n,{namespaces:r.namespaces}),await this.sendResult({id:s,topic:n,result:!0})}catch(l){throw ua.delete(o),l}this.client.events.emit("session_update",{id:s,topic:n,params:r})}catch(o){await this.sendError({id:s,topic:n,error:o}),this.client.logger.error(o)}}),G(this,"isRequestOutOfSync",(n,i)=>i.toString().slice(0,-3)<n.toString().slice(0,-3)),G(this,"onSessionUpdateResponse",(n,i)=>{const{id:r}=i,s=$e("session_update",r);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vi(i)?this.events.emit($e("session_update",r),{}):ti(i)&&this.events.emit($e("session_update",r),{error:i.error})}),G(this,"onSessionExtendRequest",async(n,i)=>{const{id:r}=i;try{this.isValidExtend({topic:n}),await this.setExpiry(n,Tt(so)),await this.sendResult({id:r,topic:n,result:!0}),this.client.events.emit("session_extend",{id:r,topic:n})}catch(s){await this.sendError({id:r,topic:n,error:s}),this.client.logger.error(s)}}),G(this,"onSessionExtendResponse",(n,i)=>{const{id:r}=i,s=$e("session_extend",r);
317if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vi(i)?this.events.emit($e("session_extend",r),{}):ti(i)&&this.events.emit($e("session_extend",r),{error:i.error})}),G(this,"onSessionPingRequest",async(n,i)=>{const{id:r}=i;try{this.isValidPing({topic:n}),await this.sendResult({id:r,topic:n,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:n})}catch(s){await this.sendError({id:r,topic:n,error:s}),this.client.logger.error(s)}}),G(this,"onSessionPingResponse",(n,i)=>{const{id:r}=i,s=$e("session_ping",r);setTimeout(()=>{if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners 2176`);vi(i)?this.events.emit($e("session_ping",r),{}):ti(i)&&this.events.emit($e("session_ping",r),{error:i.error})},500)}),G(this,"onSessionDeleteRequest",async(n,i)=>{const{id:r}=i;try{this.isValidDisconnect({topic:n,reason:i.params}),await Promise.all([new Promise(s=>{this.client.core.relayer.once(yt.publish,async()=>{s(await this.deleteSession({topic:n,id:r}))})}),this.sendResult({id:r,topic:n,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:n,error:lt("USER_DISCONNECTED")})]).catch(s=>this.client.logger.error(s))}catch(s){this.client.logger.error(s)}}),G(this,"onSessionRequest",async n=>{var i,r,s;const{topic:o,payload:c,attestation:l,encryptedId:u,transportType:d}=n,{id:f,params:m}=c;try{await this.isValidRequest(Ye({topic:o},m));const y=this.client.session.get(o),g=await this.getVerifyContext({attestationId:l,hash:ei(JSON.stringify(Xi("wc_sessionRequest",m,f))),encryptedId:u,metadata:y.peer.metadata,transportType:d}),p={id:f,topic:o,params:m,verifyContext:g};await this.setPendingSessionRequest(p),d===rt.link_mode&&(i=y.peer.metadata.redirect)!=null&&i.universal&&this.client.core.addLinkModeSupportedApp((r=y.peer.metadata.redirect)==null?void 0:r.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(p):(this.addSessionRequestToSessionRequestQueue(p),this.processSessionRequestQueue())}catch(y){await this.sendError({id:f,topic:o,error:y}),this.client.logger.error(y)}}),G(this,"onSessionRequestResponse",(n,i)=>{const{id:r}=i,s=$e("session_request",r);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);vi(i)?this.events.emit($e("session_request",r),{result:i.result}):ti(i)&&this.events.emit($e("session_request",r),{error:i.error})}),G(this,"onSessionEventRequest",async(n,i)=>{const{id:r,params:s}=i;try{const o=`${n}_session_event_${s.event.name}`,c=ua.get(o);if(c&&this.isRequestOutOfSync(c,r)){this.client.logger.info(`Discarding out of sync request - ${r}`);return}this.isValidEmit(Ye({topic:n},s)),this.client.events.emit("session_event",{id:r,topic:n,params:s}),ua.set(o,r)}catch(o){await this.sendError({id:r,topic:n,error:o}),this.client.logger.error(o)}}),G(this,"onSessionAuthenticateResponse",(n,i)=>{const{id:r}=i;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:n,payload:i}),vi(i)?this.events.emit($e("session_request",r),{result:i.result}):ti(i)&&this.events.emit($e("session_request",r),{error:i.error})}),G(this,"onSessionAuthenticateRequest",async n=>{var i;const{topic:r,payload:s,attestation:o,encryptedId:c,transportType:l}=n;try{const{requester:u,authPayload:d,expiryTimestamp:f}=s.params,m=await this.getVerifyContext({attestationId:o,hash:ei(JSON.stringify(s)),encryptedId:c,metadata:u.metadata,transportType:l}),y={requester:u,pairingTopic:r,id:s.id,authPayload:d,verifyContext:m,expiryTimestamp:f};await this.setAuthRequest(s.id,{request:y,pairingTopic:r,transportType:l}),l===rt.link_mode&&(i=u.metadata.redirect)!=null&&i.universal&&this.client.core.addLinkModeSupportedApp(u.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:s.params,id:s.id,verifyContext:m})}catch(u){this.client.logger.error(u);const d=s.params.requester.publicKey,f=await this.client.core.crypto.generateKeyPair(),m=this.getAppLinkIfEnabled(s.params.requester.metadata,l),y={type:nr,receiverPublicKey:d,senderPublicKey:f};
317await this.sendError({id:s.id,topic:r,error:u,encodeOpts:y,rpcOpts:Wt.wc_sessionAuthenticate.autoReject,appLink:m})}}),G(this,"addSessionRequestToSessionRequestQueue",n=>{this.sessionRequestQueue.queue.push(n)}),G(this,"cleanupAfterResponse",n=>{this.deletePendingSessionRequest(n.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Ci.idle,this.processSessionRequestQueue()},te.toMiliseconds(this.requestQueueDelay))}),G(this,"cleanupPendingSentRequestsForTopic",({topic:n,error:i})=>{const r=this.client.core.history.pending;r.length>0&&r.filter(s=>s.topic===n&&s.request.method==="wc_sessionRequest").forEach(s=>{const o=s.request.id,c=$e("session_request",o);if(this.events.listenerCount(c)===0)throw new Error(`emitting ${c} without any listeners`);this.events.emit($e("session_request",s.request.id),{error:i})})}),G(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===Ci.active){this.client.logger.info("session request queue is already active.");return}const n=this.sessionRequestQueue.queue[0];if(!n){this.client.logger.info("session request queue is empty.");return}try{this.emitSessionRequest(n)}catch(i){this.client.logger.error(i)}}),G(this,"emitSessionRequest",n=>{if(this.emittedSessionRequests.has(n.id)){this.client.logger.warn({id:n.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${n.id}`);return}this.sessionRequestQueue.state=Ci.active,this.emittedSessionRequests.add(n.id),this.client.events.emit("session_request",n)}),G(this,"onPairingCreated",n=>{if(n.methods&&this.expectedPairingMethodMap.set(n.topic,n.methods),n.active)return;const i=this.client.proposal.getAll().find(r=>r.pairingTopic===n.topic);
317i&&this.onSessionProposeRequest({topic:n.topic,payload:Xi("wc_sessionPropose",on(Ye({},i),{requiredNamespaces:i.requiredNamespaces,optionalNamespaces:i.optionalNamespaces,relays:i.relays,proposer:i.proposer,sessionProperties:i.sessionProperties,scopedProperties:i.scopedProperties}),i.id),attestation:i.attestation,encryptedId:i.encryptedId})}),G(this,"isValidConnect",async n=>{if(!Sn(n)){const{message:u}=ne("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(n)}`);throw new Error(u)}const{pairingTopic:i,requiredNamespaces:r,optionalNamespaces:s,sessionProperties:o,scopedProperties:c,relays:l}=n;if(At(i)||await this.isValidPairingTopic(i),!AV(l)){const{message:u}=ne("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(u)}if(!At(r)&&Ka(r)!==0){const u="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(u):this.client.logger.warn(u),this.validateNamespaces(r,"requiredNamespaces")}if(!At(s)&&Ka(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),At(o)||this.validateSessionProps(o,"sessionProperties"),!At(c)){this.validateSessionProps(c,"scopedProperties");const u=Object.keys(r||{}).concat(Object.keys(s||{}));if(!Object.keys(c).every(d=>u.includes(d.split(":")[0])))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(c)}, required/optional namespaces: ${JSON.stringify(u)}`)}}),G(this,"validateNamespaces",(n,i)=>{const r=NV(n,"connect()",i);if(r)throw new Error(r.message)}),G(this,"isValidApprove",async n=>{if(!Sn(n))throw new Error(ne("MISSING_OR_INVALID",`approve() params: ${n}`).message);const{id:i,namespaces:r,relayProtocol:s,sessionProperties:o,scopedProperties:c}=n;this.checkRecentlyDeleted(i),await this.isValidProposalId(i);const l=this.client.proposal.get(i),u=fh(r,"approve()");if(u)throw new Error(u.message);const d=xg(l.requiredNamespaces,r,"approve()");if(d)throw new Error(d.message);if(!xt(s,!0)){const{message:f}=ne("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(f)}if(At(o)||this.validateSessionProps(o,"sessionProperties"),!At(c)){this.validateSessionProps(c,"scopedProperties");const f=new Set(Object.keys(r));if(!Object.keys(c).every(m=>f.has(m.split(":")[0])))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(c)}, approved namespaces: ${Array.from(f).join(", ")}`)}}),G(this,"isValidReject",async n=>{if(!Sn(n)){const{message:s}=ne("MISSING_OR_INVALID",`reject() params: ${n}`);throw new Error(s)}const{id:i,reason:r}=n;if(this.checkRecentlyDeleted(i),await this.isValidProposalId(i),!kV(r)){const{message:s}=ne("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw new Error(s)}}),G(this,"isValidSessionSettleRequest",n=>{if(!Sn(n)){const{message:u}=ne("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${n}`);throw new Error(u)}
317const{relay:i,controller:r,namespaces:s,expiry:o}=n;if(!Xb(i)){const{message:u}=ne("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(u)}const c=TV(r,"onSessionSettleRequest()");if(c)throw new Error(c.message);const l=fh(s,"onSessionSettleRequest()");if(l)throw new Error(l.message);if(vr(o)){const{message:u}=ne("EXPIRED","onSessionSettleRequest()");throw new Error(u)}}),G(this,"isValidUpdate",async n=>{if(!Sn(n)){const{message:l}=ne("MISSING_OR_INVALID",`update() params: ${n}`);throw new Error(l)}const{topic:i,namespaces:r}=n;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const s=this.client.session.get(i),o=fh(r,"update()");if(o)throw new Error(o.message);const c=xg(s.requiredNamespaces,r,"update()");if(c)throw new Error(c.message)}),G(this,"isValidExtend",async n=>{if(!Sn(n)){const{message:r}=ne("MISSING_OR_INVALID",`extend() params: ${n}`);throw new Error(r)}const{topic:i}=n;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i)}),G(this,"isValidRequest",async n=>{if(!Sn(n)){const{message:l}=ne("MISSING_OR_INVALID",`request() params: ${n}`);throw new Error(l)}const{topic:i,request:r,chainId:s,expiry:o}=n;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const{namespaces:c}=this.client.session.get(i);if(!bg(c,s)){const{message:l}=ne("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(l)}if(!zV(r)){const{message:l}=ne("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw new Error(l)}if(!UV(c,s,r.method)){const{message:l}=ne("MISSING_OR_INVALID",`request() method: ${r.method}`);throw new Error(l)}if(o&&!WV(o,_h)){const{message:l}=ne("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${_h.min} and ${_h.max}`);throw new Error(l)}}),G(this,"isValidRespond",async n=>{var i;if(!Sn(n)){const{message:o}=ne("MISSING_OR_INVALID",`respond() params: ${n}`);throw new Error(o)}const{topic:r,response:s}=n;try{await this.isValidSessionTopic(r)}catch(o){throw(i=n==null?void 0:n.response)!=null&&i.id&&this.cleanupAfterResponse(n),o}if(!PV(s)){const{message:o}=ne("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}}),G(this,"isValidPing",async n=>{if(!Sn(n)){const{message:r}=ne("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(r)}const{topic:i}=n;await this.isValidSessionOrPairingTopic(i)}),G(this,"isValidEmit",async n=>{if(!Sn(n)){const{message:c}=ne("MISSING_OR_INVALID",`emit() params: ${n}`);throw new Error(c)}const{topic:i,event:r,chainId:s}=n;await this.isValidSessionTopic(i);const{namespaces:o}=this.client.session.get(i);if(!bg(o,s)){const{message:c}=ne("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(c)}if(!RV(r)){const{message:c}=ne("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(c)}if(!BV(o,s,r.name)){const{message:c}=ne("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw new Error(c)}}),G(this,"isValidDisconnect",async n=>{if(!Sn(n)){const{message:r}=ne("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(r)}const{topic:i}=n;await this.isValidSessionOrPairingTopic(i)}),G(this,"isValidAuthenticate",n=>{const{chains:i,uri:r,domain:s,nonce:o}=n;if(!Array.isArray(i)||i.length===0)throw new Error("chains is required and must be a non-empty array");if(!xt(r,!1))throw new Error("uri is required parameter");if(!xt(s,!1))throw new Error("domain is required parameter");if(!xt(o,!1))throw new Error("nonce is required parameter");if([...new Set(i.map(l=>hl(l).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:c}=hl(i[0]);if(c!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),G(this,"getVerifyContext",async n=>{const{attestationId:i,hash:r,encryptedId:s,metadata:o,transportType:c}=n,l={verified:{verifyUrl:o.verifyUrl||Aa,validation:"UNKNOWN",origin:o.url||""}};try{if(c===rt.link_mode){const d=this.getAppLinkIfEnabled(o,c);return l.verified.validation=d&&new URL(d).origin===new URL(o.url).origin?"VALID":"INVALID",l}const u=await this.client.core.verify.resolve({attestationId:i,hash:r,encryptedId:s,verifyUrl:o.verifyUrl});u&&(l.verified.origin=u.origin,l.verified.isScam=u.isScam,l.verified.validation=u.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(u){this.client.logger.warn(u)}return this.client.logger.debug(`Verify context: ${JSON.stringify(l)}`),l}),G(this,"validateSessionProps",(n,i)=>
317{Object.values(n).forEach((r,s)=>{if(r==null){const{message:o}=ne("MISSING_OR_INVALID",`${i} must contain an existing value for each key. Received: ${r} for key ${Object.keys(n)[s]}`);throw new Error(o)}})}),G(this,"getPendingAuthRequest",n=>{const i=this.client.auth.requests.get(n);return typeof i=="object"?i:void 0}),G(this,"addToRecentlyDeleted",(n,i)=>{if(this.recentlyDeletedMap.set(n,i),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let r=0;const s=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(r++>=s)break;this.recentlyDeletedMap.delete(o)}}}),G(this,"checkRecentlyDeleted",n=>{const i=this.recentlyDeletedMap.get(n);if(i){const{message:r}=ne("MISSING_OR_INVALID",`Record was recently deleted - ${i}: ${n}`);throw new Error(r)}}),G(this,"isLinkModeEnabled",(n,i)=>{var r,s,o,c,l,u,d,f,m;return!n||i!==rt.link_mode?!1:((s=(r=this.client.metadata)==null?void 0:r.redirect)==null?void 0:s.linkMode)===!0&&((c=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:c.universal)!==void 0&&((u=(l=this.client.metadata)==null?void 0:l.redirect)==null?void 0:u.universal)!==""&&((d=n==null?void 0:n.redirect)==null?void 0:d.universal)!==void 0&&((f=n==null?void 0:n.redirect)==null?void 0:f.universal)!==""&&((m=n==null?void 0:n.redirect)==null?void 0:m.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(n.redirect.universal)&&typeof(we==null?void 0:we.Linking)<"u"}),G(this,"getAppLinkIfEnabled",(n,i)=>{var r;return this.isLinkModeEnabled(n,i)?(r=n==null?void 0:n.redirect)==null?void 0:r.universal:void 0}),G(this,"handleLinkModeMessage",({url:n})=>{if(!n||!n.includes("wc_ev")||!n.includes("topic"))return;const i=O2(n,"topic")||"",r=decodeURIComponent(O2(n,"wc_ev")||""),s=this.client.session.keys.includes(i);s&&this.client.session.update(i,{transportType:rt.link_mode}),this.client.core.dispatchEnvelope({topic:i,message:r,sessionExists:s})}),G(this,"registerLinkModeListeners",async()=>{var n;if(G1()||rs()&&(n=this.client.metadata.redirect)!=null&&n.linkMode){const i=we==null?void 0:we.Linking;if(typeof i<"u"){i.addEventListener("url",this.handleLinkModeMessage,this.client.name);const r=await i.getInitialURL();r&&setTimeout(()=>{this.handleLinkModeMessage({url:r})},50)}}}),G(this,"getTVFParams",(n,i,r)=>{var s,o,c;if(!((s=i.request)!=null&&s.method))return{};const l={correlationId:n,rpcMethods:[i.request.method],chainId:i.chainId};try{const u=this.extractTxHashesFromResult(i.request,r);l.txHashes=u,l.contractAddresses=this.isValidContractData(i.request.params)?[(c=(o=i.request.params)==null?void 0:o[0])==null?void 0:c.to]:[]}catch(u){this.client.logger.warn("Error getting TVF params",u)}return l}),G(this,"isValidContractData",n=>{var i;if(!n)return!1;try{const r=(n==null?void 0:n.data)||((i=n==null?void 0:n[0])==null?void 0:i.data);if(!r.startsWith("0x"))return!1;const s=r.slice(2);return/^[0-9a-fA-F]*$/.test(s)?s.length%2===0:!1}catch{}return!1}),G(this,"extractTxHashesFromResult",(n,i)=>{var r;try{if(!i)return[];const s=n.method,o=zH[s];if(s==="sui_signTransaction")return[uU(i.transactionBytes)];if(s==="near_signTransaction")return[$2(i)];if(s==="near_signTransactions")return i.map(l=>$2(l));if(s==="xrpl_signTransactionFor"||s==="xrpl_signTransaction")return[(r=i.tx_json)==null?void 0:r.hash];if(s==="polkadot_signTransaction")return[r$({transaction:n.params.transactionPayload,signature:i.signature})];if(s==="algo_signTxn")return jo(i)?i.map(l=>W2(l)):[W2(i)];if(s==="cosmos_signDirect")return[hU(i)];if(typeof i=="string")return[i];const c=i[o.key];if(jo(c))return s==="solana_signAllTransactions"?c.map(l=>lU(l)):c;if(typeof c=="string")return[c]}catch(s){this.client.logger.warn("Error extracting tx hashes from result",s)}return[]})}async processPendingMessageEvents(){try{const t=this.client.session.keys,n=this.client.core.relayer.messages.getWithoutAck(t);for(const[i,r]of Object.entries(n))for(const s of r)try{await this.onProviderMessageEvent({topic:i,message:s,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${i}, message: ${s}`)}}catch(t){this.client.logger.warn("processPendingMessageEvents failed",t)}}isInitialized(){if(!this.initialized){const{message:t}=ne("NOT_INITIALIZED",this.name);throw new Error(t)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(yt.message,t=>{this.onProviderMessageEvent(t)})}async onRelayMessage(t){const{topic:n,message:i,attestation:r,transportType:s}=t,{publicKey:o}=this.client.auth.authKeys.keys.includes(gl)?this.client.auth.authKeys.get(gl):{responseTopic:void 0,publicKey:void 0};try{const c=await this.client.core.crypto.decode(n,i,{receiverPublicKey:o,encoding:s===rt.link_mode?Nr:kn});hm(c)?(this.client.core.history.set(n,c),await this.onRelayEventRequest({topic:n,payload:c,attestation:r,transportType:s,encryptedId:ei(i)})):sd(c)?(await this.client.core.history.resolve(c),await this.onRelayEventResponse({topic:n,payload:c,transportType:s}),this.client.core.history.delete(n,c.id)):await this.onRelayEventUnknownPayload({topic:n,payload:c,transportType:s}),await this.client.core.relayer.messages.ack(n,i)}catch(c){this.client.logger.error(c)}}registerExpirerEvents(){this.client.core.expirer.on(Kn.expired,async t=>{const{topic:n,id:i}=ob(t.target);
317if(i&&this.client.pendingRequest.keys.includes(i))return await this.deletePendingSessionRequest(i,ne("EXPIRED"),!0);if(i&&this.client.auth.requests.keys.includes(i))return await this.deletePendingAuthRequest(i,ne("EXPIRED"),!0);n?this.client.session.keys.includes(n)&&(await this.deleteSession({topic:n,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:n})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i}))})}registerPairingEvents(){this.client.core.pairing.events.on(hs.create,t=>this.onPairingCreated(t)),this.client.core.pairing.events.on(hs.delete,t=>{this.addToRecentlyDeleted(t.topic,"pairing")})}isValidPairingTopic(t){if(!xt(t,!1)){const{message:n}=ne("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(n)}if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:n}=ne("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(n)}if(vr(this.client.core.pairing.pairings.get(t).expiry)){const{message:n}=ne("EXPIRED",`pairing topic: ${t}`);throw new Error(n)}}async isValidSessionTopic(t){if(!xt(t,!1)){const{message:n}=ne("MISSING_OR_INVALID",`session topic should be a string: ${t}`);throw new Error(n)}if(this.checkRecentlyDeleted(t),!this.client.session.keys.includes(t)){const{message:n}=ne("NO_MATCHING_KEY",`session topic doesn't exist: ${t}`);throw new Error(n)}if(vr(this.client.session.get(t).expiry)){await this.deleteSession({topic:t});const{message:n}=ne("EXPIRED",`session topic: ${t}`);throw new Error(n)}if(!this.client.core.crypto.keychain.has(t)){const{message:n}=ne("MISSING_OR_INVALID",`session topic does not exist in keychain: ${t}`);throw await this.deleteSession({topic:t}),new Error(n)}}async isValidSessionOrPairingTopic(t){if(this.checkRecentlyDeleted(t),this.client.session.keys.includes(t))await this.isValidSessionTopic(t);else if(this.client.core.pairing.pairings.keys.includes(t))this.isValidPairingTopic(t);else if(xt(t,!1)){const{message:n}=ne("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${t}`);throw new Error(n)}else{const{message:n}=ne("MISSING_OR_INVALID",`session or pairing topic should be a string: ${t}`);throw new Error(n)}}async isValidProposalId(t){if(!OV(t)){const{message:n}=ne("MISSING_OR_INVALID",`proposal id should be a number: ${t}`);throw new Error(n)}if(!this.client.proposal.keys.includes(t)){const{message:n}=ne("NO_MATCHING_KEY",`proposal id doesn't exist: ${t}`);throw new Error(n)}if(vr(this.client.proposal.get(t).expiryTimestamp)){await this.deleteProposal(t);const{message:n}=ne("EXPIRED",`proposal id: ${t}`);throw new Error(n)}}}class GH extends Hs{constructor(t,n){super(t,n,AH,mm),this.core=t,this.logger=n}}class KH extends Hs{constructor(t,n){super(t,n,OH,mm),this.core=t,this.logger=n}}class JH extends Hs{constructor(t,n){super(t,n,PH,mm,i=>i.id),this.core=t,this.logger=n}}class XH extends Hs{constructor(t,n){super(t,n,VH,ad,()=>gl),this.core=t,this.logger=n}}class eQ extends Hs{constructor(t,n){super(t,n,$H,ad),this.core=t,this.logger=n}}class tQ extends Hs{constructor(t,n){super(t,n,WH,ad,i=>i.id),this.core=t,this.logger=n}}var nQ=Object.defineProperty,iQ=(e,t,n)=>t in e?nQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bh=(e,t,n)=>iQ(e,typeof t!="symbol"?t+"":t,n);class rQ{constructor(t,n){this.core=t,this.logger=n,bh(this,"authKeys"),bh(this,"pairingTopics"),bh(this,"requests"),this.authKeys=new XH(this.core,this.logger),this.pairingTopics=new eQ(this.core,this.logger),this.requests=new tQ(this.core,this.logger)}
317async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var sQ=Object.defineProperty,oQ=(e,t,n)=>t in e?sQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,De=(e,t,n)=>oQ(e,typeof t!="symbol"?t+"":t,n);class ym extends $D{constructor(t){super(t),De(this,"protocol",Ix),De(this,"version",Mx),De(this,"name",wh.name),De(this,"metadata"),De(this,"core"),De(this,"logger"),De(this,"events",new wi.EventEmitter),De(this,"engine"),De(this,"session"),De(this,"proposal"),De(this,"pendingRequest"),De(this,"auth"),De(this,"signConfig"),De(this,"on",(i,r)=>this.events.on(i,r)),De(this,"once",(i,r)=>this.events.once(i,r)),De(this,"off",(i,r)=>this.events.off(i,r)),De(this,"removeListener",(i,r)=>this.events.removeListener(i,r)),De(this,"removeAllListeners",i=>this.events.removeAllListeners(i)),De(this,"connect",async i=>{try{return await this.engine.connect(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"pair",async i=>{try{return await this.engine.pair(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"approve",async i=>{try{return await this.engine.approve(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"reject",async i=>{try{return await this.engine.reject(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"update",async i=>{try{return await this.engine.update(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"extend",async i=>{try{return await this.engine.extend(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"request",async i=>{try{return await this.engine.request(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"respond",async i=>{try{return await this.engine.respond(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"ping",async i=>{try{return await this.engine.ping(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"emit",async i=>{try{return await this.engine.emit(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"disconnect",async i=>{try{return await this.engine.disconnect(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"find",i=>{try{return this.engine.find(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(i){throw this.logger.error(i.message),i}}),De(this,"authenticate",async(i,r)=>{try{return await this.engine.authenticate(i,r)}catch(s){throw this.logger.error(s.message),s}}),De(this,"formatAuthMessage",i=>{try{return this.engine.formatAuthMessage(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"approveSessionAuthenticate",async i=>{try{return await this.engine.approveSessionAuthenticate(i)}catch(r){throw this.logger.error(r.message),r}}),De(this,"rejectSessionAuthenticate",async i=>{try{return await this.engine.rejectSessionAuthenticate(i)}catch(r){throw this.logger.error(r.message),r}}),this.name=(t==null?void 0:t.name)||wh.name,this.metadata=tR(t==null?void 0:t.metadata),this.signConfig=t==null?void 0:t.signConfig;const n=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:Qu(k1({level:(t==null?void 0:t.logger)||wh.logger}));this.core=(t==null?void 0:t.core)||new NH(t),this.logger=Cn(n,this.name),this.session=new KH(this.core,this.logger),this.proposal=new GH(this.core,this.logger),this.pendingRequest=new JH(this.core,this.logger),this.engine=new qH(this),this.auth=new rQ(this.core,this.logger)}static async init(t){const n=new ym(t);return await n.initialize(),n}get context(){return Un(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")}catch(t){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(t.message),t}}}const aQ=ym,cQ="08c4b07e3ad25f1a27c14a4e8cecb6f0",AG="eip155";let zi;async function Ex(){if(!zi)return[];const e=await zi.getWalletConnectSessions();return JSON.parse(e??"[]")}function lQ(e){zi||(zi=new fc({clientId:e.clientId,storage:null}))}async function OG(e){if(!zi)return;const t=await zi.getWalletConnectSessions(),n=JSON.parse(t??"[]");n.push(e),await zi.saveWalletConnectSessions(Zt(n))}async function uQ(e){if(!zi)return;const t=await zi.getWalletConnectSessions(),i=JSON.parse(t??"[]").filter(r=>r.topic!==e.topic);await zi.saveWalletConnectSessions(Zt(i))}let xh=new WeakMap;async function dQ(e){var d,f,m,y;const{wallet:t,requestHandlers:n,onConnect:i,onDisconnect:r,client:s}=e,o=e.chains&&e.chains.length>10?(console.warn("WalletConnect: Can specify no more than 10 chains, truncating to the first 10 provided chains..."),e.chains.slice(0,10)):e.chains;if(xh.has(s))return xh.get(s);lQ({clientId:e.client.clientId});const c=vl(),l=await aQ.init({metadata:{description:((d=e.appMetadata)==null?void 0:d.description)??c.description,icons:[((f=e.appMetadata)==null?void 0:f.logoUrl)??c.logoUrl],name:((m=e.appMetadata)==null?void 0:m.name)??c.name,url:((y=e.appMetadata)==null?void 0:y.url)??c.url},projectId:e.projectId??cQ});l.on("session_proposal",async g=>{const{onSessionProposal:p}=await h(async()=>{const{onSessionProposal:w}=await import("./session-proposal-DVXzOJVn.js");return{onSessionProposal:w}},__vite__mapDeps([49,3,7,4,6,8,9,10,5,2,1,11,12,13,14,15]));await p({chains:o,event:g,onConnect:i,wallet:t,walletConnectClient:l}).catch(w=>{if(e.onError)e.onError(w);else throw w})}),l.on("session_request",async g=>{const{fulfillRequest:p}=await h(async()=>{const{fulfillRequest:w}=await import("./session-request-C7kRdgHN.js");return{fulfillRequest:w}}
317,__vite__mapDeps([50,7,4,3,6,8,9,5,1,2]));await p({event:g,handlers:n,thirdwebClient:s,wallet:t,walletConnectClient:l}).catch(w=>{if(e.onError)e.onError(w);else throw w})}),l.on("session_event",async g=>{}),l.on("session_ping",g=>{}),l.on("session_delete",async g=>{await Tx({session:{topic:g.topic},walletConnectClient:l}).catch(p=>{if(e.onError)e.onError(p);else throw p})});const u=l.disconnect;return l.disconnect=async g=>{const p=await u(g).catch(()=>{});return r&&mQ({onDisconnect:r,topic:g.topic}),p},xh.set(e.client,l),l}function hQ(e){const{uri:t,walletConnectClient:n}=e;n.core.pairing.pair({uri:t})}async function fQ(){return Ex()}async function Tx(e){uQ(e.session);try{await e.walletConnectClient.disconnect({reason:{code:6e3,message:"Disconnected"},topic:e.session.topic})}catch{}}async function mQ(e){const{topic:t,onDisconnect:n}=e,i=await Ex();n(i.find(r=>r.topic===t)??{topic:t})}function yQ(e){return a.jsxs(b,{style:{minHeight:"300px"},children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:"Connect an App"})}),a.jsx(He,{}),a.jsx(b,{px:"lg",scrollY:!0,style:{maxHeight:"500px"},children:a.jsxs(b,{py:"lg",style:{position:"relative"},children:[a.jsx(b,{py:"md",children:a.jsx(zu,{client:e.client,error:!!e.error,hideSpinner:!0,id:"walletConnect"})}),a.jsx(b,{animate:"fadein",style:{animationDuration:"200ms"},children:e.error?a.jsxs(a.Fragment,{children:[a.jsx(A,{balance:!0,center:!0,multiline:!0,size:"sm",children:e.error}),a.jsx(U,{y:"md"}),a.jsx(b,{animate:"fadein",center:"x",flex:"row",children:a.jsxs(ue,{fullWidth:!0,onClick:()=>e.disconnect(),style:{alignItems:"center",gap:R.xs},variant:"accent",children:[a.jsx(dc,{height:D.sm,width:D.sm}),"Retry"]})})]}):a.jsxs(a.Fragment,{children:[a.jsxs(A,{balance:!0,center:!0,multiline:!0,size:"md",children:["Connected to ",e.session.origin??"another app."]}),a.jsx(U,{y:"xl"}),a.jsx(ue,{fullWidth:!0,onClick:()=>{e.disconnect()},variant:"accent",children:"Disconnect"})]})})]})})]})}function gQ(e){const t=ft(),[n,i]=_.useState(!1),[r,s]=_.useState(!1),o=ur(),{data:c}=pe({enabled:!!t,queryFn:async()=>{if(t)try{return await dQ({chains:e.chains,client:e.client,onConnect:()=>{i(!1),o.invalidateQueries({queryKey:["walletConnectSession"]})},onDisconnect:()=>{i(!1),o.invalidateQueries({queryKey:["walletConnectSession"]})},onError:m=>{s(m.message),i(!1)},wallet:t})}catch{s("Failed to establish WalletConnect connection");return}},queryKey:["walletConnectClient"],retry:!1}),{data:l,refetch:u}=pe({enabled:!!c,queryFn:async()=>c&&(await fQ())[0]||null,queryKey:["walletConnectSession"]}),{mutateAsync:d}=Es({mutationFn:async()=>{if(!c||!l)throw new Error("No session");await Tx({session:l,walletConnectClient:c})},onError:f=>{console.error(f),s(f.message)},onSuccess:()=>{s(!1),o.invalidateQueries({queryKey:["walletConnectSession"]}),u()}});return l?a.jsx(yQ,{disconnect:d,error:r,...e,session:l}):a.jsxs(b,{style:{minHeight:"300px"},children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:"Connect an App"})}),a.jsx(He,{}),a.jsx(b,{px:"lg",scrollY:!0,style:{maxHeight:"500px"},children:a.jsxs(b,{py:"sm",style:{position:"relative"},children:[a.jsx(b,{py:"md",children:a.jsx(zu,{client:e.client,error:!!r,hideSpinner:!n,id:"walletConnect"})}),a.jsx(b,{animate:"fadein",style:{animationDuration:"200ms"},children:r?a.jsxs(a.Fragment,{children:[a.jsx(A,{balance:!0,center:!0,multiline:!0,size:"sm",children:r}),a.jsx(U,{y:"md"}),a.jsx(b,{animate:"fadein",center:"x",flex:"row",children:a.jsxs(ue,{fullWidth:!0,onClick:()=>s(!1),style:{alignItems:"center",gap:R.xs},variant:"accent",children:[a.jsx(dc,{height:D.sm,width:D.sm}),"Retry"]})})]}):a.jsxs(a.Fragment,{children:[a.jsx(A,{balance:!0,center:!0,multiline:!0,size:"sm",children:"Copy your connection URI from the external app."}),a.jsx(U,{y:"xl"}),a.jsx(t0,{lastUsedBadge:!1,disabled:n||!!r||!c,emptyErrorMessage:"Please enter a valid URI",name:"wcUri",onSelect:async f=>{if(i(!0),!c)s("No WalletConnect client found");else try{hQ({uri:f,walletConnectClient:c})}catch{s("Error creating WalletConnect session")}},placeholder:"WalletConnect URI",submitButtonText:"Connect",type:"text"})]})})]})}),a.jsxs(b,{children:[a.jsx(U,{y:"lg"}),a.jsx(He,{}),a.jsx(b,{center:"x",flex:"row",p:"lg",children:a.jsx("a",{href:"https://blog.thirdweb.com/p/a62c0ef4-1d8f-424d-95b9-a006e5239849/",children:a.jsx(ue,{onClick:()=>{},variant:"link",children:"Where do I find the URI?"})})})]})]})}function pQ(e){const t=jt(),n=Df(t),i=F6(e.address),r=_.useSyncExternalStore(i.subscribe,i.getValue),s=pe({enabled:!!t,queryFn:()=>Y6({chain:t||zo,client:e.client,walletAddress:e.address}),queryKey:["transactions",e.address,t]}),o=[...[...r].reverse(),...s.data||[]];return a.jsx(b,{flex:"column",fullHeight:!0,scrollY:!0,style:{maxHeight:"370px",minHeight:"250px",paddingBottom:R.lg},children:a.jsxs(b,{expand:!0,flex:"column",gap:"xs",children:[s.isLoading&&a.jsxs(b,{center:"both",color:"secondaryText",flex:"column",gap:"md",style:{flex:"1",minHeight:"250px"},children:[a.jsx(Qe,{color:"secondaryText",size:"md"}),a.jsx(A,{children:"Loading recent transactions..."})]}),!s.isLoading&&o.length===0?a.jsxs(b,{center:"both",color:"secondaryText",flex:"column",gap:"md",style:{flex:"1",minHeight:"250px"},children:[a.jsx(is,{height:D.xl,width:D.xl}),a.jsx(A,{children:"No Transactions"})]}):a.jsx(b,{animate:"fadein",flex:"column",gap:"xs",style:{minHeight:"250px"},children:o.map(c=>{var l;return a.jsx(wQ,{client:e.client,explorerUrl:(l=n.explorers[0])==null?void 0:l.url,tx:c},c.transactionHash)})})]})})}function wQ(e){const{data:t,isLoading:n,error:i}=x8({chain:Ge(e.tx.chainId),client:e.client,queryOptions:{enabled:e.tx.receipt===void 0},transactionHash:e.tx.transactionHash}),r=Sf(Ge(e.tx.chainId)),s=e.tx.receipt??t,o=e.tx.decoded,c=a.jsxs(_Q,{fullWidth:!0,style:{paddingBlock:R.sm},variant:"secondary",children:[a.jsxs(b,{center:"y",flex:"row",gap:"md",style:{flex:1},children:[a.jsx(w5,{chainIconUrl:r.url,client:e.client,size:D.lg}),a.jsxs("div",{style:{display:"flex",flex:1,flexDirection:"column",justifyContent:"center"},children:[a.jsx(b,{center:"y",flex:"row",gap:"xs",style:{justifyContent:"space-between"},children:a.jsx(A,{color:"primaryText",size:"sm",children:o?o.name:"Transaction Sent"})}),a.jsx(U,{y:"xxs"}),a.jsx(b,{center:"y",flex:"row",gap:"xxs",style:{justifyContent:"space-between"},children:a.jsx(A,{color:"secondaryText",size:"xs",children:s!=null&&s.to?_l(s==null?void 0:s.to,4):_l(e.tx.transactionHash,4)})})]})]}),a.jsxs(b,{center:"y",flex:"row",gap:"xxs",children:[n&&a.jsx(Qe,{color:"primaryText",size:"sm"}),!n&&s&&s.status==="success"&&a.jsx(A,{color:"success",size:"md",children:a.jsx(Us,{height:D.md,width:D.md})}),(i||!n&&s&&s.status!=="success")&&a.jsx(A,{color:"danger",size:"md",children:a.jsx(is,{height:D.md,width:D.md})})]})]});return e.explorerUrl?a.jsx("a",{href:gw(e.explorerUrl,e.tx.transactionHash),rel:"noreferrer",target:"_blank",children:c}):c}const _Q=nt(ue)(()=>{const e=ee();return{"&:hover":{background:e.colors.secondaryButtonBg},background:e.colors.tertiaryBg,height:"62px"}});function bQ(e){var o;const t=jt(),n=ft(),i=ht(),r=Df(t),s=t&&i&&n?{account:i,chain:t,wallet:n}:void 0;return s?a.jsxs(b,{animate:"fadein",children:[a.jsx(b,{p:"lg",children:a.jsx(Me,{onBack:e.onBack,title:e.locale.transactions})}),a.jsx(He,{}),a.jsxs(b,{px:"lg",scrollY:!0,style:{minHeight:"330px"},children:[a.jsx(U,{y:"md"}),a.jsx(pQ,{address:s.account.address,client:e.client,locale:e.locale})]}),a.jsx(He,{}),a.jsx(b,{p:"lg",children:a.jsxs(lw,{as:"a",fullWidth:!0,gap:"xs",href:dM(((o=r.explorers[0])==null?void 0:o.url)??"",(i==null?void 0:i.address)??""),style:{color:"inherit",textDecoration:"none"},target:"_blank",variant:"outline",children:["View on Explorer",a.jsx(Jf,{height:D.sm,width:D.sm})]})})]}):a.jsx(Mt,{})}const Tr="tw-connected-wallet",xQ=1337,IQ=e=>{var d,f,m,y,g,p,w,x,I,E,j;const{connectLocale:t,client:n}=e,i=_.useContext($4),r=jt();function s(){i(null)}function o(){var C,T,v;i(a.jsx(vx,{assetTabs:(C=e.detailsModal)==null?void 0:C.assetTabs,chains:e.chains,client:n,closeModal:s,connectOptions:e.connectOptions,detailsModal:e.detailsModal,displayBalanceToken:(T=e.detailsButton)==null?void 0:T.displayBalanceToken,locale:t,onDisconnect:e.onDisconnect,supportedNFTs:e.supportedNFTs,supportedTokens:e.supportedTokens,theme:e.theme,showBalanceInFiat:(v=e.detailsButton)==null?void 0:v.showBalanceInFiat}))}const c=e.chain&&r&&r.id!==e.chain.id;if((d=e.detailsButton)!=null&&d.render)return a.jsx("div",{onClick:o,children:a.jsx(e.detailsButton.render,{})});if(e.chain&&c)return a.jsx(SQ,{className:(f=e.switchButton)==null?void 0:f.className,connectLocale:t,style:(m=e.switchButton)==null?void 0:m.style,switchNetworkBtnTitle:(y=e.switchButton)==null?void 0:y.label,targetChain:e.chain});const l=`${Tr} ${((g=e.detailsButton)==null?void 0:g.className)||""}`,u=(w=(p=e.detailsButton)==null?void 0:p.displayBalanceToken)==null?void 0:w[Number(r==null?void 0:r.id)];return a.jsxs(TQ,{className:l,"data-test":"connected-wallet-details",onClick:o,style:(x=e.detailsButton)==null?void 0:x.style,type:"button",children:[a.jsx(b,{style:{borderRadius:"100%",height:"35px",overflow:"hidden",
317width:"35px"},children:(I=e.detailsButton)!=null&&I.connectedAccountAvatarUrl?a.jsx("img",{alt:"",src:e.detailsButton.connectedAccountAvatarUrl,style:{height:"100%",objectFit:"cover",width:"100%"}}):a.jsx(I1,{className:`${Tr}__account_avatar`,fallbackComponent:a.jsx(Va,{className:`${Tr}__account_avatar`,size:35}),loadingComponent:a.jsx(Va,{className:`${Tr}__account_avatar`,size:35}),queryOptions:{refetchOnMount:!1,refetchOnWindowFocus:!1},style:{height:"100%",objectFit:"cover",width:"100%"}})}),a.jsxs(b,{flex:"column",gap:"4xs",style:{borderRadius:`0 ${J.md} ${J.md} 0`,textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[(E=e.detailsButton)!=null&&E.connectedAccountName?a.jsx(A,{className:`${Tr}__address`,color:"primaryText",size:"xs",weight:500,children:e.detailsButton.connectedAccountName}):a.jsx(A,{className:`${Tr}__address`,color:"primaryText",size:"xs",weight:500,children:a.jsx(M1,{fallbackComponent:a.jsx(Ol,{formatFn:Mn}),loadingComponent:a.jsx(Ol,{formatFn:Mn})})}),a.jsx(A,{className:`${Tr}__balance`,color:"secondaryText",size:"xs",style:{alignItems:"center",display:"flex",gap:"2px"},weight:400,children:(j=e.detailsButton)!=null&&j.showBalanceInFiat?a.jsxs(a.Fragment,{children:[a.jsx(ho,{chain:r,fallbackComponent:a.jsx(me,{height:ie.xs,width:"50px"}),loadingComponent:a.jsx(me,{height:ie.xs,width:"50px"}),tokenAddress:u}),a.jsx(ho,{chain:r,formatFn:MQ,loadingComponent:a.jsx(me,{height:ie.xs,width:"20px"}),showBalanceInFiat:"USD",tokenAddress:u})]}):a.jsx(ho,{chain:r,fallbackComponent:a.jsx(me,{height:ie.xs,width:"70px"}),formatFn:CQ,loadingComponent:a.jsx(me,{height:ie.xs,width:"70px"}),tokenAddress:u})})]})]})};function MQ(e){return` (${b1({...e,decimals:0})})`}function CQ(e){return`${Al({...e,decimals:e.balance<1?5:4})}`}function vx(e){var N,M,S,L,O,P,$,z,k,B,W,V,F,Y,Q,Z,K,q,oe,re,ae,le,Te,qe,ct,fn,fe,ge,st,pt,wt;const[t,n]=_.useState(e.initialScreen||"main"),{disconnect:i}=oc(),[r,s]=_.useState(!0),{client:o,locale:c}
317=e,l=jt(),u=ht(),d=Rp(e.theme),f=ft(),m=T8(l),y=ko(l),g=!(f!=null&&f.switchChain),p=d1({size:"compact",wallets:f?[f]:[],welcomeScreen:void 0}),w=_.useCallback(()=>{s(!1),jl(()=>{e.closeModal()})},[e.closeModal]);function x(ye){s(!1),e.closeModal(),e.onDisconnect(ye)}_.useEffect(()=>{u||w()},[u,w]);const{hideSendFunds:I,hideReceiveFunds:E,hideBuyFunds:j}=e.detailsModal||{},C=I&&E&&j,T=a.jsxs(b,{style:{height:`${D.xl}px`,position:"relative",width:`${D.xl}px`},children:[a.jsx(b,{style:{borderRadius:"100%",height:"100%",overflow:"hidden",width:"100%"},children:(N=e.detailsModal)!=null&&N.connectedAccountAvatarUrl?a.jsx("img",{alt:"",src:e.detailsModal.connectedAccountAvatarUrl,style:{height:"100%",objectFit:"cover",width:"100%"}}):u&&a.jsx(I1,{fallbackComponent:a.jsx(Va,{size:Number(D.xxl)}),loadingComponent:a.jsx(Va,{size:Number(D.xxl)}),style:{height:"100%",objectFit:"cover",width:"100%"}})}),(M=e.detailsModal)!=null&&M.hideSwitchWallet?null:a.jsx(b,{style:{bottom:-2,position:"absolute",right:-2},children:a.jsx(rv,{padding:"4px",style:{background:d.colors.modalBg},children:f&&a.jsx(ai,{client:o,id:f.id,size:"12",style:{borderRadius:0}})})})]});let v=a.jsxs("div",{className:`${Tr}__default_modal_screen`,children:[a.jsx(U,{y:"xs"}),a.jsxs(b,{center:"y",flex:"row",gap:"sm",px:"lg",style:{paddingBottom:C?R.md:R.lg,paddingTop:R.lg},children:[(S=e.detailsModal)!=null&&S.hideSwitchWallet?T:a.jsx(Nl,{tip:"Switch wallet",children:a.jsx("div",{onClick:()=>{n("wallet-manager")},onKeyDown:ye=>{ye.key==="w"&&n("wallet-manager")},style:{cursor:"pointer"},children:T})}),a.jsxs(b,{flex:"column",gap:"3xs",children:[a.jsxs("div",{style:{alignItems:"center",display:"flex",gap:R.xxs},children:[(L=e.detailsModal)!=null&&L.connectedAccountName?a.jsx(A,{color:"primaryText",size:"md",weight:500,children:e.detailsModal.connectedAccountName}):a.jsx(A,{color:"primaryText",size:"md",weight:500,children:a.jsx(M1,{fallbackComponent:a.jsx(Ol,{formatFn:Mn}),loadingComponent:a.jsx(Ol,{formatFn:Mn})})}),a.jsx(rr,{children:a.jsx(js,{text:(u==null?void 0:u.address)||"",tip:c.copyAddress})})]}),a.jsx(jQ,{client:o,locale:c})]})]}),!C&&a.jsxs(a.Fragment,{children:[a.jsx(b,{px:"lg",children:a.jsxs(b,{className:"tw-highlight-buttons",style:{display:"flex",gap:R.xs},children:[!I&&a.jsxs(ue,{className:"tw-highlight-button__send",onClick:()=>{n("send")},style:{alignItems:"center",display:"flex",flex:1,fontSize:ie.sm,gap:R.xs,padding:R.sm},variant:"outline",children:[a.jsx(b,{center:"both",color:"secondaryText",flex:"row",children:a.jsx(Q7,{height:D.sm,style:{transform:"translateY(-10%) rotate(-45deg) "},width:D.sm})}),c.send]}),!E&&a.jsxs(ue,{className:"tw-highlight-button__receive",onClick:()=>{n("receive")},style:{alignItems:"center",display:"flex",flex:1,fontSize:ie.sm,gap:R.xs,padding:R.sm},variant:"outline",children:[a.jsx(b,{center:"both",color:"secondaryText",flex:"row",children:a.jsx(q7,{height:D.sm,width:D.sm})}),c.receive]}),!j&&y.data&&!y.data.testnet&&a.jsxs(ue,{className:"tw-highlight-button__buy",onClick:()=>{ot({client:o,event:"details_modal_buy_click",walletAddress:u==null?void 0:u.address,walletType:f==null?void 0:f.id}),n("buy")},style:{alignItems:"center",display:"flex",flex:1,fontSize:ie.sm,gap:R.xs,padding:R.sm},variant:"outline",children:[a.jsx(b,{center:"both",color:"secondaryText",flex:"row",children:a.jsx(ju,{height:D.sm,width:D.sm})}),c.buy]})]})}),a.jsx(U,{y:"md"})]}),a.jsxs(b,{px:"md",children:[a.jsxs(b,{flex:"column",style:{gap:"1px"},children:[a.jsx(EQ,{client:e.client,disableSwitchChain:g,displayBalanceToken:e.displayBalanceToken,setScreen:()=>n("network-switcher"),showBalanceInFiat:(O=e.detailsModal)==null?void 0:O.showBalanceInFiat}),a.jsxs(ii,{className:"tw-view-transactions-button",onClick:()=>{n("transactions")},style:{fontSize:ie.sm},children:[a.jsx(iM,{height:D.md,width:D.md}),a.jsx(b,{center:"y",flex:"row",gap:"xs",children:a.jsx(A,{color:"primaryText",children:c.transactions})})]}),(e.assetTabs===void 0||e.assetTabs.length>0)&&a.jsxs(ii,{className:"tw-view-assets-button",onClick:()=>{n("view-assets")},style:{fontSize:ie.sm},children:[a.jsx(gc,{size:D.md}),a.jsx(A,{color:"primaryText",children:c.viewFunds.viewAssets})]}),a.jsxs(ii,{className:"tw-manage-wallet-button",onClick:()=>{n("manage-wallet")},style:{fontSize:ie.sm},children:[a.jsx(Ls,{size:D.md}),a.jsx(A,{color:"primaryText",children:e.locale.manageWallet.title})]}),(((P=e.detailsModal)==null?void 0:P.showTestnetFaucet)??!1)&&(m.faucet
317s.length>0||(l==null?void 0:l.id)===xQ)&&a.jsxs(uv,{className:"tw-request-testnet-funds-button",as:"a",href:m.faucets?m.faucets[0]:"#",style:{color:"inherit",textDecoration:"none"},target:"_blank",children:[a.jsx(b,{center:"both",color:"secondaryText",flex:"row",children:a.jsx(lv,{size:D.md})}),c.requestTestnetFunds]}),(($=e.detailsModal)==null?void 0:$.footer)&&a.jsx(e.detailsModal.footer,{close:w})]}),a.jsx(U,{y:"md"})]}),((z=e.detailsModal)==null?void 0:z.hideDisconnect)!==!0&&a.jsxs(b,{children:[a.jsx(He,{}),a.jsx(U,{y:"sm"}),a.jsx(b,{px:"md",children:a.jsxs(ii,{className:"tw-disconnect-wallet-button","data-variant":"danger",onClick:()=>{f&&u&&(i(f),x({account:u,wallet:f}))},type:"button",children:[a.jsx(V7,{height:D.md,width:D.md}),a.jsx(A,{color:"primaryText",children:c.disconnectWallet})]})}),a.jsx(U,{y:"sm"})]})]});if(t==="transactions"&&(v=a.jsx(bQ,{client:o,closeModal:w,locale:c,onBack:()=>n("main"),setScreen:n,title:c.buy})),t==="wallet-manager"&&u&&l&&f&&(v=a.jsx(pv,{accountAbstraction:(k=e.connectOptions)==null?void 0:k.accountAbstraction,activeAccount:u,activeChain:l,activeWallet:f,appMetadata:(B=e.connectOptions)==null?void 0:B.appMetadata,chain:(W=e.connectOptions)==null?void 0:W.chain,chains:(V=e.connectOptions)==null?void 0:V.chains,client:o,connectLocale:c,hiddenWallets:(F=e.connectOptions)==null?void 0:F.hiddenWallets,onBack:()=>n("main"),recommendedWallets:(Y=e.connectOptions)==null?void 0:Y.recommendedWallets,showAllWallets:!!((Q=e.connectOptions)!=null&&Q.showAllWallets),walletConnect:(Z=e.connectOptions)==null?void 0:Z.walletConnect,wallets:(K=e.connectOptions)==null?void 0:K.wallets})),t==="network-switcher")v=a.jsx(J3,{chains:l&&e.chains.find(ye=>ye.id===l.id)===void 0?[l,...e.chains]:e.chains,client:o,closeModal:w,connectLocale:c,networkSelector:(q=e.detailsModal)==null?void 0:q.networkSelector,onBack:()=>{n("main")}});else if(t==="view-assets")v=a.jsx(Dj,{assetTabs:(oe=e.detailsModal)==null?void 0:oe.assetTabs,client:o,connectLocale:c,onBack:()=>{n("main")},setScreen:n,supportedNFTs:e.supportedNFTs,supportedTokens:e.supportedTokens,theme:e.theme});else if(t==="view-nfts")v=a.jsx(Lj,{client:o,connectLocale:c,onBack:()=>{n("main")},supportedNFTs:e.supportedNFTs,theme:e.theme});else if(t==="view-tokens")v=a.jsx(Sj,{client:o,connectLocale:c,onBack:()=>{n("main")},supportedTokens:e.supportedTokens}
317);else if(t==="private-key"||t==="export")v=a.jsx(RL,{client:o,connectLocale:c,onBack:()=>{n("manage-wallet")},theme:e.theme,wallet:f});else if(t==="manage-wallet")v=a.jsx(zL,{client:o,closeModal:w,locale:c,onBack:()=>{n("main")},manageWallet:(re=e.detailsModal)==null?void 0:re.manageWallet,setScreen:n});else if(t==="wallet-connect-receiver")v=a.jsx(gQ,{chains:e.chains,client:o,onBack:()=>{n("manage-wallet")}});else if(t==="linked-profiles")v=a.jsx(Iv,{client:o,locale:c,onBack:()=>n("manage-wallet"),setScreen:n});else if(t==="link-profile")v=a.jsx(NL,{client:o,locale:c,onBack:()=>{n("linked-profiles")},walletConnect:(ae=e.connectOptions)==null?void 0:ae.walletConnect});else if(t==="send")v=a.jsx(ij,{client:o,connectLocale:c,onBack:()=>{n("main")},supportedTokens:e.supportedTokens});else if(t==="receive")v=a.jsx(BL,{client:o,connectLocale:c,onBack:()=>{n("main")},walletId:f==null?void 0:f.id});else if(t==="buy"){const ye=((ct=(qe=(Te=(le=e.detailsModal)==null?void 0:le.payOptions)==null?void 0:Te.prefillBuy)==null?void 0:qe.chain)==null?void 0:ct.id)||(l==null?void 0:l.id)||((fn=e.chains[0])==null?void 0:fn.id)||1;v=a.jsx(tv,{amount:((st=(ge=(fe=e.detailsModal)==null?void 0:fe.payOptions)==null?void 0:ge.prefillBuy)==null?void 0:st.amount)||"0.01",chain:Ge(ye),client:o,hiddenWallets:(pt=e.detailsModal)==null?void 0:pt.hiddenWallets,connectOptions:e.connectOptions,onCancel:()=>n("main"),onSuccess:()=>n("main"),supportedTokens:e.supportedTokens,theme:e.theme,style:{border:"none",borderRadius:J.lg},tokenAddress:(wt=e.displayBalanceToken)==null?void 0:wt[Number(ye)]})}return a.jsx(mu,{theme:e.theme,children:a.jsx(kw,{isOpen:!1,theme:e.theme,children:a.jsx(u1.Provider,{value:p,children:a.jsx(yc,{className:"tw-modal__wallet-details",title:"Manage Wallet",open:r,crossContainerStyles:{display:t==="buy"?"none":"block"},setOpen:ye=>{var mt,_t;ye||(w(),(mt=e.detailsModal)!=null&&mt.onClose&&((_t=e.detailsModal)==null||_t.onClose(t)))},size:"compact",children:(u==null?void 0:u.address)&&a.jsx(_f,{address:u.address,client:o,children:v})})})})})}function EQ(e){var o,c,l;const{disableSwitchChain:t,setScreen:n,showBalanceInFiat:i,client:r}=e,s=jt();return s?a.jsxs(ii,{className:"tw-internal-network-switcher-button tw-switch-network-button","data-variant":"primary",disabled:t,onClick:()=>{n("network-switcher")},type:"button",children:[a.jsxs(Z3,{chain:s,children:[a.jsx("div",{style:{alignItems:"center",display:"flex",position:"relative"},children:a.jsxs(b,{style:{alignItems:"center",display:"flex",flexShrink:0,position:"relative"},children:[a.jsx(G3,{client:r,fallbackComponent:a.jsx("img",{alt:"",src:Xr,style:{height:`${D.md}px`,width:`${D.md}px`}}),loadingComponent:a.jsx(me,{height:`${D.md}px`,width:`${D.md}px`}),style:{height:`${D.md}px`,width:`${D.md}px`}}),a.jsx(E1,{className:"tw-chain-active-dot-details-button"})]})}),a.jsxs(A,{color:"primaryText",multiline:!0,size:"md",children:[a.jsx(o0,{fallbackComponent:a.jsxs("span",{children:["Unknown chain #",s==null?void 0:s.id]}),loadingComponent:a.jsx(me,{height:"16px",width:"150px"})}),a.jsx(A,{color:"secondaryText",size:"xs",children:i?a.jsxs(a.Fragment,{children:[a.jsx(ho,{chain:s,fallbackComponent:a.jsx(me,{height:"1em",width:"70px"}),formatFn:u=>Al({...u,decimals:7}),loadingComponent:a.jsx(me,{height:"1em",width:"70px"}),tokenAddress:(o=e.displayBalanceToken)==null?void 0:o[Number(s==null?void 0:s.id)]})," ",a.jsx(ho,{chain:s,formatFn:u=>` (${b1({...u,decimals:3})})`,loadingComponent:a.jsx(me,{height:"1em",width:"30px"}),showBalanceInFiat:"USD",tokenAddress:(c=e.displayBalanceToken)==null?void 0:c[Number(s==null?void 0:s.id)]})]}):a.jsx(ho,{chain:s,fallbackComponent:a.jsx(me,{height:"1em",width:"100px"}),formatFn:u=>Al({...u,decimals:7}),loadingComponent:a.jsx(me,{height:"1em",width:"100px"}),tokenAddress:(l=e.displayBalanceToken)==null?void 0:l[Number(s==null?void 0:s.id)]})})]})]}),a.jsx(vQ,{height:D.sm,style:{flexShrink:0,marginLeft:"auto"},width:D.sm})]}):null}const TQ=$i(e=>{const t=ee();return{all:"unset","&:hover":{background:t.colors.connectedButtonBgHover,transition:"background 250ms ease"},alignItems:"center",animation:`${Rs} 300ms ease`,background:t.colors.connectedButtonBg,border:`1px solid ${t.colors.borderColor}`,borderRadius:J.md,boxSizing:"border-box",cursor:"pointer",display:"inline-flex",gap:R.xs,height:"50px",lineHeight:"normal",minWidth:"165px",overflow:"hidden",padding:R.xs,WebkitTapHighlightColor:"transparent"}}),vQ=nt(N7)(()=>({color:ee().colors.secondaryText}));function LQ(e){const t=ht(),n=ft(),i=au(n),r=jt(),{client:s,connectLocale:o}=e,[c,l]=_.useState(!1);_.useEffect(()=>{if(t&&i&&t.address&&r){const d=zt({address:t.address,chain:r,client:s});j6(d).then(f=>{l(f)})}else l(!1)},[t,r,s,i]);const u=a.jsx(b,{center:"y",flex:"row",gap:"3xs",children:a.jsx(A,{color:"secondaryText",size:"xs",weight:400,children:o.connectedToSmartWallet})});return r&&t&&i?a.jsx(a.Fragment,{children:c?a.jsx(Gr,{color:"secondaryText",hoverColor:"primaryText",href:`https://thirdweb.com/${r.id}/${t.address}/account`,size:"sm",target:"_blank",children:u}):a.jsxs(A,{size:"sm",children:[" ",u]})}):null}function jQ(e){const{client:t,locale:n}=e,i=ht(),r=ft(),s=hu(),{data:o}=Po(r==null?void 0:r.id),c=au(r),{data:l}=pe({enabled:!!(r!=null&&r.id)&&!!o,queryFn:async()=>{const d=await Ww(In);return d==="guest"?"Guest":d&&((r==null?void 0:r.id)==="inApp"||(r==null?void 0:r.id)==="smart")&&Nu.includes(d)?d.slice(0,1).toUpperCase()+d.slice(1):o==null?void 0:o.name},queryKey:["wallet-name",{walletAddress:i==null?void 0:i.address,walletId:r==null?void 0:r.id}]}),u=pe({enabled:!!s,queryFn:async()=>{var w;if(!(s&&(s.id==="inApp"||s.id.startsWith("ecosystem."))))return null;let f;if(Xe(s)){const x=s,I=(w=x.getConfig())==null?void 0:w.partnerId;f={id:x.id,partnerId:I}}const{getUserEmail:m,getUserPhoneNumber:y}=await h(async()=>{const{getUserEmail:x,getUserPhoneNumber:I}=await Promise.resolve().then(()=>zC);return{getUserEmail:x,getUserPhoneNumber:I}},void 0),[g,p]=await Promise.all([m({client:t,ecosystem:f}),y({client:t,ecosystem:f})]);return g||p||null},queryKey:["in-app-wallet-user",t,i==null?void 0:i.address]});return!u.data&&c?a.jsx(LQ,{client:t,connectLocale:n}):u.data||l?a.jsx(A,{size:"xs",weight:400,children:u.data||l}):a.jsx(me,{className:"InAppWalletUserInfo__skeleton",height:"10px",width:"50px"})}function SQ(e){const t=Uf(),[n,i]=_.useState(!1),r=e.connectLocale,s=e.switchNetworkBtnTitle??r.switchNetwork;return a.jsx(ue,{"aria-label":n?r.switchingNetwork:void 0,className:`tw-connect-wallet--switch-network ${e.className||""}`,"data-is-loading":n,"data-test":"switch-network-button",disabled:n,onClick:async()=>{i(!0);try{await t(e.targetChain)}catch(o){console.error(o)}i(!1)},style:{minWidth:"140px",...e.style},type:"button",variant:"primary",children:n?a.jsx(Qe,{color:"primaryButtonText",size:"sm"}):s})}const DQ=e=>a.jsx("svg",{fill:"none",height:e.size,role:"presentation",viewBox:"0 0 16 21",width:e.size,xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M2 21C1.45 21 0.979333 20.8043 0.588 20.413C0.196 20.021 0 19.55 0 19V9C0 8.45 0.196 7.979 0.588 7.587C0.979333 7.19567 1.45 7 2 7
317H3V5C3 3.61667 3.48767 2.43733 4.463 1.462C5.43767 0.487333 6.61667 0 8 0C9.38333 0 10.5627 0.487333 11.538 1.462C12.5127 2.43733 13 3.61667 13 5V7H14C14.55 7 15.021 7.19567 15.413 7.587C15.8043 7.979 16 8.45 16 9V19C16 19.55 15.8043 20.021 15.413 20.413C15.021 20.8043 14.55 21 14 21H2ZM8 16C8.55 16 9.021 15.8043 9.413 15.413C9.80433 15.021 10 14.55 10 14C10 13.45 9.80433 12.979 9.413 12.587C9.021 12.1957 8.55 12 8 12C7.45 12 6.97933 12.1957 6.588 12.587C6.196 12.979 6 13.45 6 14C6 14.55 6.196 15.021 6.588 15.413C6.97933 15.8043 7.45 16 8 16ZM5 7H11V5C11 4.16667 10.7083 3.45833 10.125 2.875C9.54167 2.29167 8.83333 2 8 2C7.16667 2 6.45833 2.29167 5.875 2.875C5.29167 3.45833 5 4.16667 5 5V7Z",fill:"currentColor"})}),NQ=e=>{const t=d1({size:e.size,wallets:e.wallets,welcomeScreen:e.welcomeScreen}),n=Bs(),{screen:i,setScreen:r,initialScreen:s}=t,o=AM(),c=zw(),[l,u]=_.useState(!1),d=_.useCallback(()=>{var y;(y=e.onClose)==null||y.call(e),c(!1),jl(()=>{r(s),n({})})},[s,c,r,n,e.onClose]),f=ht();_.useEffect(()=>{o||jl(()=>{u(!1)})},[o]);const m=_.useCallback(y=>u(!y),[]);return _.useEffect(()=>{o&&i===gn.signIn&&!f&&(r(s),c(!1))},[s,o,i,c,r,f]),a.jsx(yc,{className:"tw-modal__connect-wallet",title:"Connect Wallet",hide:l,open:o,setOpen:y=>{l||y||d()},size:e.size,children:a.jsx(C3,{accountAbstraction:e.accountAbstraction,auth:e.auth,chain:e.chain,chains:e.chains,client:e.client,connectLocale:e.connectLocale,hideHeader:!1,isOpen:o,meta:e.meta,modalHeader:void 0,onClose:d,onConnect:e.onConnect,recommendedWallets:e.recommendedWallets,screenSetup:t,setModalVisibility:m,shouldSetActive:e.shouldSetActive,showAllWallets:e.showAllWallets,size:e.size,walletConnect:e.walletConnect,walletIdsToHide:e.hiddenWallets,wallets:e.wallets,welcomeScreen:e.welcomeScreen})})},ef="tw-connect-wallet";function Lx(e){var f,m,y,g,p,w,x,I,E,j,C,T,v,N;const t=_.useMemo(()=>e.wallets||Du({appMetadata:e.appMetadata,chains:e.chains,executionMode:e.accountAbstraction?{mode:"EIP4337",smartAccount:e.accountAbstraction}:void 0}),[e.wallets,e.appMetadata,e.chains,e.accountAbstraction]),n=e1(e.locale||"en_US"),i=mf(),r=ht(),s=ft(),o=Cf(s,r,e.auth),c=e.hiddenWallets||((f=e.detailsModal)==null?void 0:f.hiddenWallets);PM({wallets:t}),_.useEffect(()=>{e.chain&&i.defineChains([e.chain])},[e.chain,i]),_.useEffect(()=>{e.chains&&i.defineChains(e.chains)},[e.chains,i]);const l=_.useMemo(()=>{var M;return!zM()||t.length===1?"compact":((M=e.connectModal)==null?void 0:M.size)||"compact"},[t.length,(m=e.connectModal)==null?void 0:m.size]),u=((y=e.accountAbstraction)==null?void 0:y.chain)||e.chain||((g=e.chains)==null?void 0:g[0]),d=e.autoConnect!==!1&&a.jsx(Fw,{accountAbstraction:e.accountAbstraction,appMetadata:e.appMetadata,chain:u,client:e.client,onConnect:e.onConnect,siweAuth:o,timeout:typeof e.autoConnect=="boolean"||(p=e.autoConnect)==null?void 0:p.timeout,wallets:t});if(!n.data){const M=`${((w=e.connectButton)==null?void 0:w.className)||""} ${ef}`;return a.jsxs(tf,{className:M,disabled:!0,style:{height:"50px",minWidth:"165px",...(x=e.connectButton)==null?void 0:x.style},type:"button",variant:"primary",children:[d,a.jsx(Qe,{color:"primaryButtonText",size:"sm"})]})}return a.jsxs(kw,{isOpen:!1,theme:e.theme,children:[a.jsx(AQ,{...e,connectLocale:n.data,siweAuth:o}),a.jsx(NQ,{accountAbstraction:e.accountAbstraction,auth:e.auth,chain:u,chains:e.chains,client:e.client,connectLocale:n.data,hiddenWallets:c,localeId:e.locale||"en_US",meta:{privacyPolicyUrl:(I=e.connectModal)==null?void 0:I.privacyPolicyUrl,requireApproval:(E=e.connectModal)==null?void 0:E.requireApproval,showThirdwebBranding:(j=e.connectModal)==null?void 0:j.showThirdwebBranding,termsOfServiceUrl:(C=e.connectModal)==null?void 0:C.termsOfServiceUrl,title:(T=e.connectModal)==null?void 0:T.title,titleIconUrl:(v=e.connectModal)==null?void 0:v.titleIcon},onConnect:e.onConnect,recommendedWallets:e.recommendedWallets,shouldSetActive:!0,showAllWallets:e.showAllWallets,size:l,walletConnect:e.walletConnect,wallets:t,welcomeScreen:(N=e.connectModal)==null?void 0:N.welcomeScreen}),d]})}function AQ(e){var y,g,p,w,x,I,E,j,C,T,v;const t=e.siweAuth,n=ht(),[i,r]=_.useState(!1),s=e.hiddenWallets||((y=e.detailsModal)==null?void 0:y.hiddenWallets);_.useEffect(()=>{n||r(!1)},[n]);const o=e.theme||"dark",c=_9(),l=e.connectLocale,u=c==="connecting",d=((g=e.connectButton)==null?void 0:g.label)||l.defaultButtonTitle,f=zw(),m=_.useMemo(()=>
317{if(!e.supportedTokens)return;const N={...Pa};for(const M in e.supportedTokens){const S=Number(M),L=e.supportedTokens[S];L&&(N[S]=L)}return N},[e.supportedTokens]);if(!n){const N=`${((p=e.connectButton)==null?void 0:p.className)||""} ${ef}`;return a.jsx(tf,{"aria-label":c==="connecting"?l.connecting:typeof d=="string"?d:l.defaultButtonTitle,className:N,"data-is-loading":u,"data-test":"connect-wallet-button","data-theme":o,disabled:u,onClick:()=>{f(!0)},style:{fontSize:"16px",height:"50px",minWidth:"165px",...(w=e.connectButton)==null?void 0:w.style},type:"button",variant:"primary",children:u?a.jsx(Qe,{color:"primaryButtonText",size:"sm"}):d})}if(t.requiresAuth){if(t.isPending||t.isLoggingIn||t.isLoggingOut){const N=`${((x=e.connectButton)==null?void 0:x.className)||""} ${ef}`;return a.jsx(tf,{className:N,disabled:!0,style:{height:"50px",minWidth:"165px",...(I=e.connectButton)==null?void 0:I.style},type:"button",variant:"primary",children:a.jsx(Qe,{color:"primaryButtonText",size:"sm"})})}if(!t.isLoggedIn)return a.jsxs(a.Fragment,{children:[a.jsx(ue,{className:(E=e.signInButton)==null?void 0:E.className,onClick:()=>{r(!0)},style:{minHeight:"50px",minWidth:"165px",...(j=e.signInButton)==null?void 0:j.style},type:"button",variant:"primary",children:t.isLoggingIn?a.jsx(Qe,{color:"primaryButtonText",size:"sm"}):a.jsxs(b,{center:"y",flex:"row",gap:"sm",children:[a.jsx(DQ,{size:D.sm}),a.jsxs("span",{children:[" ",((C=e.signInButton)==null?void 0:C.label)||l.signIn," "]})]})}),a.jsx(yc,{className:"tw-modal__sign-in",title:"Sign in",open:i,setOpen:r,size:"compact",children:a.jsx(u3,{auth:e.auth,client:e.client,connectLocale:l,modalSize:"compact",onDone:()=>r(!1),privacyPolicyUrl:(T=e.connectModal)==null?void 0:T.privacyPolicyUrl,termsOfServiceUrl:(v=e.connectModal)==null?void 0:v.termsOfServiceUrl})})]})}return a.jsx(_f,{address:n.address,client:e.client,children:a.jsx(IQ,{chain:e.chain,chains:(e==null?void 0:e.chains)||[],client:e.client,connectLocale:l,connectOptions:{accountAbstraction:e.accountAbstraction,appMetadata:e.appMetadata,chain:e.chain,chains:e.chains,connectModal:e.connectModal,hiddenWallets:s,recommendedWallets:e.recommendedWallets,showAllWallets:e.showAllWallets,walletConnect:e.walletConnect,wallets:e.wallets},detailsButton:e.detailsButton,detailsModal:{...e.detailsModal,hiddenWallets:s},onDisconnect:N=>{var M;t.requiresAuth&&t.doLogout(),(M=e.onDisconnect)==null||M.call(e,N)},supportedNFTs:e.supportedNFTs,supportedTokens:m,switchButton:e.switchButton,theme:o})})}const tf=nt(ue)({animation:`${Rs} 300ms ease`});function OQ({transaction:e,client:t,onContinue:n,onExecuteTransaction:i,connectOptions:r,currency:s,showThirdwebBranding:o=!0,buttonLabel:c,metadata:l}){var T,v,N,M,S,L,O,P,$,z,k;const u=ee(),d=ht(),f=ft(),m=ko(e.chain),y=v3({client:t,transaction:e,wallet:f}),{data:g}=pe({enabled:!!(d!=null&&d.address),queryFn:async()=>{if(!(d!=null&&d.address))return"0";const B=await wn(e.erc20Value);return(await Ts({address:d==null?void 0:d.address,chain:e.chain,tokenAddress:(B==null?void 0:B.tokenAddress.toLowerCase())!==Pt?B==null?void 0:B.tokenAddress:void 0,client:t})).displayValue},queryKey:["user-balance",d==null?void 0:d.address]}),p=((v=(T=y.data)==null?void 0:T.contractMetadata)==null?void 0:v.name)||"Unknown Contract",w=((M=(N=y.data)==null?void 0:N.functionInfo)==null?void 0:M.functionName)||"Contract Call",x=y.isLoading||m.isLoading,I=c||`Execute ${w}`,E=((L=(S=y.data)==null?void 0:S.tokenInfo)==null?void 0:L.prices[s])||void 0,j=E&&y.data?E*Number(y.data.totalCost):void 0,C=j!==void 0?Fr(s,j):(O=y.data)==null?void 0:O.txCostDisplay;return x?a.jsxs(s0,{client:t,title:l.title||"Transaction",description:l.description,image:l.image,children:[a.jsx(kQ,{theme:u}),a.jsx(U,{y:"md"}),a.jsx(He,{dashed:!0}),a.jsx(U,{y:"lg"}),a.jsxs(b,{flex:"column",gap:"sm",children:[a.jsx(tl,{valueWidth:"110px",labelWidth:"60px"}),a.jsx(tl,{valueWidth:"40%",labelWidth:"90px"}),a.jsx(tl,{valueWidth:"50%",labelWidth:"60px"}),a.jsx(tl,{valueWidth:"45%",labelWidth:"90px"})]}),a.jsx(U,{y:"lg"}),a.jsx(He,{dashed:!0}),a.jsx(U,{y:"lg"}),a.jsxs(ue,{fullWidth:!0,variant:"primary",gap:"xs",disabled:!0,style:{borderRadius:J.full,fontSize:ie.md},children:[a.jsx(Qe,{size:"sm"})," Loading"]}),o?a.jsxs("div",{children:[a.jsx(U,{y:"md"}),a.jsx(Mo,{}),a.jsx(U,{y:"md"})]}):null]}):a.jsxs(s0,{client:t,title:l.title||"Transaction",description:l.description,image:l.image,children:[a.jsxs(b,{center:"y",flex:"row",gap:"3xs",style:{justifyContent:"space-between"},children:[a.jsx(A,{color:"primaryText",size:"xl",weight:500,children:C}),a.jsx(A,{color:"secondaryText",size:"sm",style:{backgroundColor:u.colors.tertiaryBg,borderRadius:R.sm,fontFamily:"monospace",padding:`${R.xs} ${R.sm}`,textAlign:"right"},children:w})]}),a.jsx(U,{y:"md"}),a.jsx(He,{dashed:!0}),a.jsx(U,{y:"lg"}),a.jsxs(b,{flex:"column",gap:"sm",children:[p!=="UnknownContract"&&p!==void 0&&p!=="Unknown Contract"&&a.jsxs(b,{flex:"row",style:{alignItems:"center",justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Contract"}),a.jsx(A,{color:"primaryText",size:"sm",children:p})]}),a.jsxs(b,{flex:"row",style:{alignItems:"center",justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Address"}),a.jsx("a",{href:`https://thirdweb.com/${e.chain.id}/${e.to}`,rel:"noopener noreferrer",style:{color:u.colors.accentText,fontFamily:"monospace",fontSize:ie.sm,textDecoration:"none"},target:"_blank",children:Mn(e.to)})]}),a.jsxs(b,{flex:"row",style:{alignItems:"center",justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Network"}),a.jsxs(b,{center:"y",flex:"row",gap:"3xs",children:[a.jsx(N3,{chain:e.chain,client:t,size:"xs"}),a.jsx(w1,{chain:e.chain,client:t,color:"primaryText",short:!0,size:"sm",style:{fontFamily:"monospace"}})]})]}),((P=y.data)==null?void 0:P.txCostDisplay)&&a.jsxs(b,{flex:"row",style:{alignItems:"center",justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Cost"}),a.jsx(A,{color:"primaryText",size:"sm",style:{fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"60%"},children:($=y.data)==null?void 0:$.txCostDisplay})]}),((z=y.data)==null?void 0:z.gasCostDisplay)&&a.jsxs(b,{flex:"row",style:{alignItems:"center",justifyContent:"space-between"},children:[a.jsx(A,{color:"secondaryText",size:"sm",children:"Network fees"}),a.jsx(A,{color:"primaryText",size:"sm",style:{fontFamily:"monospace"},children:(k=y.data)==null?void 0:k.gasCostDisplay})]})]}),a.jsx(U,{y:"lg"}),a.jsx(He,{dashed:!0}),a.jsx(U,{y:"lg"}),d?a.jsx(ue,{fullWidth:!0,onClick:()=>{var B;if((B=y.data)!=null&&B.tokenInfo){if(g&&Number(g)<Number(y.data.totalCost)){n((Number(y.data.totalCost)-Number(g)).toString(),y.data.tokenInfo,_e(d.address));return}if(g&&Number(g)>=Number(y.data.totalCost)){i();return}n(y.data.totalCost,y.data.tokenInfo,_e(d.address))}else i()},style:{fontSize:ie.md,borderRadius:J.full},variant:"primary",children:I}):a.jsx(Lx,{client:t,connectButton:{label:I,style:{borderRadius:J.full}},theme:u,...r,wallets:(r==null?void 0:r.wallets)||Sw({appMetadata:r==null?void 0:r.appMetadata,chains:r==null?void 0:r.chains})}),o?a.jsxs("div",{children:[a.jsx(U,{y:"md"}),a.jsx(Mo,{})]}):null,a.jsx(U,{y:"md"})]})}const kQ=e=>a.jsxs(b,{center:"y",flex:"row",gap:"sm",style:{justifyContent:"space-between"},children:[a.jsx(me,{height:"32px",width:"60px",style:{borderRadius:J.full}}),a.jsx(me,{height:"32px",width:"180px",style:{borderRadius:J.full}})]});function tl(e){return a.jsxs(b,{flex:"row",style:{alignItems:"center",justifyContent:"space-between"},children:[a.jsx(me,{height:"16px",width:e.labelWidth}),a.jsx(me,{height:"16px",width:e.valueWidth})]})}function zQ(e){const{chain:t,tokenAddress:n,client:i}=e,{data:r}=ko(t),s=_.useRef(!1);return _.useEffect(()=>{s.current||(s.current=!0,ot({chainId:t.id,client:i,event:"ub:ui:unsupported_token",fromToken:n}))},[t.id,i,n]),r!=null&&r.testnet?a.jsxs(b,{animate:"fadein",center:"both",flex:"column",style:{minHeight:"350px"},children:[a.jsx(vs,{size:D["3xl"]}),a.jsx(U,{y:"lg"}),a.jsx(A,{center:!0,color:"primaryText",size:"lg",weight:600,children:"Testnet Not Supported"}),a.jsx(U,{y:"sm"}),a.jsx(A,{center:!0,color:"secondaryText",size:"sm",style:{lineHeight:1.5,maxWidth:"280px"},children:"Bridge does not support testnets at this time."})]}):a.jsxs(b,{animate:"fadein",center:"both",flex:"column",style:{minHeight:"350px"},children:[a.jsx(vs,{size:D["3xl"]}),a.jsx(U,{y:"lg"}),a.jsx(A,{center:!0,color:"primaryText",size:"lg",weight:600,children:"Token Not Supported"}),a.jsx(U,{y:"sm"}),a.jsx(A,{center:!0,color:"secondaryText",size:"sm",style:{lineHeight:1.5,maxWidth:"280px"},children:"This token or chain is not supported by the Bridge"})]})}function PQ(e){var s,o;const t=_.useRef(!1);_.useEffect(()=>{t.current||(t.current=!0,ot({chainId:e.transaction.chain.id,client:e.client,event:"ub:ui:transaction_widget:render",toToken:e.tokenAddress}))},[e.client,e.transaction.chain.id,e.tokenAddress]);const n=e1(e.locale||"en_US"),i=pe({queryFn:async()=>{let c=e.transaction.erc20Value;if(e.amount){const u=e.tokenAddress||Pt,d=await Uo(e.client,xo(u),e.transaction.chain.id).catch(f=>{if(f instanceof Error&&f.message.includes("not supported"))return null;throw f});if(!d)return{type:"unsupported_token"};c={amountWei:tr(e.amount,d.decimals),tokenAddress:xo(u)}}return{transaction:Z4({...e.transaction,erc20Value:c}),type:"success"}},queryKey:["transaction-query",Zt(e)],retry:1}),r=_.useMemo(()=>{var c;return e.showThirdwebBranding===!1?{...e.connectOptions,connectMod
317al:{...(c=e.connectOptions)==null?void 0:c.connectModal,showThirdwebBranding:e.showThirdwebBranding}}:e.connectOptions},[e.connectOptions,e.showThirdwebBranding]);return i.isPending||!n.data?a.jsx("div",{style:{alignItems:"center",display:"flex",justifyContent:"center",minHeight:"350px"},children:a.jsx(Qe,{color:"secondaryText",size:"xl"})}):i.error?a.jsxs("div",{style:{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center",minHeight:"350px"},children:[a.jsx(vs,{size:D["3xl"]}),a.jsx(U,{y:"lg"}),a.jsx(A,{color:"secondaryText",size:"md",children:i.error.message})]}):((s=i.data)==null?void 0:s.type)==="unsupported_token"?a.jsx(zQ,{chain:e.transaction.chain,client:e.client,tokenAddress:e.tokenAddress||Pt}):((o=i.data)==null?void 0:o.type)==="success"?a.jsx(RQ,{...e,connectOptions:r,connectLocale:n.data,transaction:i.data.transaction,currency:e.currency||"USD",paymentMethods:e.paymentMethods||["crypto","card"],showThirdwebBranding:e.showThirdwebBranding===void 0?!0:e.showThirdwebBranding}):null}function RQ(e){const[t,n]=_.useState({id:"init-ui"}),i=_.useCallback(r=>{var s;console.error(r),(s=e.onError)==null||s.call(e,r),n({id:"error",error:r})},[e.onError]);return t.id==="init-ui"?a.jsx(OQ,{client:e.client,metadata:{title:e.title,description:e.description,image:e.image},connectOptions:e.connectOptions,onContinue:(r,s,o)=>{ot({client:e.client,event:"payment_selection",toChainId:s.chainId,toToken:s.address}),n({id:"buy:1.methodSelection",destinationAmount:r,destinationToken:s,transaction:e.transaction,receiverAddress:o})},onExecuteTransaction:()=>{n({id:"execute-tx",transaction:e.transaction})},showThirdwebBranding:e.showThirdwebBranding,currency:e.currency,buttonLabel:e.buttonLabel,transaction:e.transaction}):t.id==="buy:1.methodSelection"?a.jsx(k3,{client:e.client,connectLocale:e.connectLocale,connectOptions:e.connectOptions,paymentMethods:e.paymentMethods,currency:e.currency,supportedTokens:e.supportedTokens,country:e.country,feePayer:void 0,destinationToken:t.destinationToken,destinationAmount:t.destinationAmount,receiverAddress:t.receiverAddress,onBack:()=>{n({id:"init-ui"})},onError:r=>{i(r)},onPaymentMethodSelected:r=>{ot({chainId:r.type==="wallet"?r.originToken.chainId:void 0,client:e.client,event:"ub:ui:loading_quote:transaction",fromToken:r.type==="wallet"?r.originToken.address:void 0,toChainId:t.destinationToken.chainId,toToken:t.destinationToken.address}),n({...t,id:"buy:2.load-quote",paymentMethod:r})}}):t.id==="buy:2.load-quote"?a.jsx(P3,{paymentLinkId:e.paymentLinkId,purchaseData:e.purchaseData,client:e.client,feePayer:void 0,sender:void 0,mode:"transaction",amount:t.destinationAmount,destinationToken:t.destinationToken,onBack:()=>{n({...t,id:"buy:1.methodSelection"})},onError:r=>{i(r)},onQuoteReceived:(r,s)=>{var o,c,l;(r.type==="buy"||r.type==="sell"||r.type==="transfer")&&ot({chainId:r.type==="transfer"?r.intent.chainId:r.intent.originChainId,client:e.client,event:"payment_details",fromToken:r.type==="transfer"?r.intent.tokenAddress:r.intent.originTokenAddress,toChainId:r.type==="transfer"?r.intent.chainId:r.intent.destinationChainId,toToken:r.type==="transfer"?r.intent.tokenAddress:r.intent.destinationTokenAddress,walletAddress:(c=(o=t.paymentMethod.payerWallet)==null?void 0:o.getAccount())==null?void 0:c.address,walletType:(l=t.paymentMethod.payerWallet)==null?void 0:l.id}),n({...t,id:"buy:3.preview",preparedQuote:r,request:s})},paymentMethod:t.paymentMethod,receiver:t.receiverAddress}):t.id==="buy:3.preview"?a.jsx(A3,{client:e.client,currency:e.currency,metadata:{title:e.title,description:e.description},confirmButtonLabel:void 0,onBack:()=>{n({...t,id:"buy:1.methodSelection"})},onConfirm:()=>{n({...t,id:"buy:4.execute-buy"})},onError:r=>{i(r)},paymentMethod:t.paymentMethod,preparedQuote:t.preparedQuote,modeInfo:{mode:"transaction",transaction:t.transaction}}):t.id==="buy:4.execute-buy"?a.jsx(R3,{client:e.client,title:void 0,preparedQuote:t.preparedQuote,autoStart:!0,onBack:()=>{n({...t,id:"buy:3.preview"})},onCancel:()=>{var r;(r=e.onCancel)==null||r.call(e)},onComplete:r=>{n({...t,id:"buy:5.success",completedStatuses:r})},request:t.request,wallet:t.paymentMethod.payerWallet,windowAdapter:lo}):t.id==="buy:5.success"?a.jsx(z3,{client:e.client,type:"payment-success",hasPaymentId:!!e.paymentLinkId,completedStatuses:t.completedStatuses,onDone:()=>{n({id:"execute-tx",transaction:t.transaction})},preparedQuote:t.preparedQuote,showContinueWithTx:!0,windowAdapter:lo}):t.id==="error"?a.jsx(T3,{client:e.client,error:t.error,onCancel:()=>{var r;n({id:"init-ui"}),(r=e.onCancel)==null||r.call(e)},onRetry:()=>{n({id:"init-ui"})}}):t.id==="execute-tx"?a.jsx(E3,{onBack:()=>{n({id:"init-ui"})},closeModal:()=>{n({id:"init-ui"})},onTxSent:r=>{var s;(s=e.onSuccess)==null||s.call(e,r)},tx:t.transaction,windowAdapter:lo}):null}var Re;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},e.getValidEnumValues=r=>{const s=e.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),o={};for(const c of s)o[c]=r[c];return e.objectValues(o)},e.objectValues=r=>e.objectKeys(r).map(function(s){return r[s]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},e.find=(r,s)=>{for(const o of r)if(s(o))return o}
vendor: 49,306 bytes, line 317
317,e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=i,e.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Re||(Re={}));var i4;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(i4||(i4={}));const de=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Dr=e=>{switch(typeof e){case"undefined":return de.undefined;case"string":return de.string;case"number":return Number.isNaN(e)?de.nan:de.number;case"boolean":return de.boolean;case"function":return de.function;case"bigint":return de.bigint;case"symbol":return de.symbol;case"object":return Array.isArray(e)?de.array:e===null?de.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?de.promise:typeof Map<"u"&&e instanceof Map?de.map:typeof Set<"u"&&e instanceof Set?de.set:typeof Date<"u"&&e instanceof Date?de.date:de.object;default:return de.unknown}},X=Re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class lr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(s){return s.message},i={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)i._errors.push(n(o));else{let c=i,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(n(o))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}};return r(this),i}static assert(t){if(!(t instanceof lr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},i=[];for(const r of this.issues)if(r.path.length>0){const s=r.path[0];n[s]=n[s]||[],n[s].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}lr.create=e=>new lr(e);const nf=(e,t)=>{let n;switch(e.code){case X.invalid_type:e.received===de.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case X.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Re.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:n=`Unrecognized key(s) in object: ${Re.joinValues(e.keys,", ")}`;break;case X.invalid_union:n="Invalid input";break;case X.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Re.joinValues(e.options)}`;break;case X.invalid_enum_value:n=`Invalid enum value. Expected ${Re.joinValues(e.options)}, received '${e.received}'`;break;case X.invalid_arguments:n="Invalid function arguments";break;case X.invalid_return_type:n="Invalid function return type";break;case X.invalid_date:n="Invalid date";break;case X.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Re.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case X.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case X.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case X.custom:n="Invalid input";break;case X.invalid_intersection_types:n="Intersection results could not be merged";break;case X.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case X.not_finite:n="Number must be finite";break;default:n=t.defaultError,Re.assertNever(e)}return{message:n}};let UQ=nf;function BQ(){return UQ}const VQ=e=>{const{data:t,path:n,errorMaps:i,issueData:r}=e,s=[...n,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let c="";const l=i.filter(u=>!!u).slice().reverse();for(const u of l)c=u(o,{data:t,defaultError:c}).message;return{...r,path:s,message:c}};function ce(e,t){const n=BQ(),i=VQ({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===nf?void 0:nf].filter(r=>!!r)});e.common.issues.push(i)}class Hn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const i=[];for(const r of n){if(r.status==="aborted")return xe;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){const i=[];for(const r of n){const s=await r.key,o=await r.value;i.push({key:s,value:o})}return Hn.mergeObjectSync(t,i)}static mergeObjectSync(t,n){const i={};for(const r of n){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return xe;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(i[s.value]=o.value)}return{status:t.value,value:i}}}const xe=Object.freeze({status:"aborted"}),Ma=e=>({status:"dirty",value:e}),ci=e=>({status:"valid",value:e}),r4=e=>e.status==="aborted",s4=e=>e.status==="dirty",So=e=>e.status==="valid",Kl=e=>typeof Promise<"u"&&e instanceof Promise;var he;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(he||(he={}));class ts{constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const o4=(e,t)=>{if(So(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new lr(e.common.issues);return this._error=n,this._error}}};function Le(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(o,c)=>{const{message:l}=e;return o.code==="invalid_enum_value"?{message:l??c.defaultError}:typeof c.data>"u"?{message:l??i??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:l??n??c.defaultError}},description:r}}class Ae{get description(){return this._def.description}_getType(t){return Dr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Dr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Hn,ctx:{common:t.parent.common,data:t.data,parsedType:Dr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Kl(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){const i={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Dr(t)},r=this._parseSync({data:t,path:i.path,parent:i});return o4(i,r)}"~validate"(t){var i,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Dr(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:n});return So(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(r=(i=s==null?void 0:s.message)==null?void 0:i.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(s=>So(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(t,n){const i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Dr(t)},r=this._parse({data:t,path:i.path,parent:i}),s=await(Kl(r)?r:Promise.resolve(r));return o4(i,s)}refine(t,n){const i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,s)=>{const o=t(r),c=()=>s.addIssue({code:X.custom,...i(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Ao({schema:this,typeName:Ie.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Hr.create(this,this._def)}nullable(){return Oo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pi.create(this)}promise(){return tu.create(this,this._def)}or(t){return Xl.create([this,t],this._def)}and(t){return eu.create(this,t,this._def)}transform(t){return new Ao({...Le(this._def),schema:this,typeName:Ie.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new sf({...Le(this._def),innerType:this,defaultValue:n,typeName:Ie.ZodDefault})}brand(){return new uZ({typeName:Ie.ZodBranded,type:this,...Le(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new of({...Le(this._def),innerType:this,catchValue:n,typeName:Ie.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return gm.create(this,t)}readonly(){return af.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const $Q=/^c[^\s-]{8,}$/i,WQ=/^[0-9a-z]+$/,FQ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,YQ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,HQ=/^[a-z0-9_-]{21}$/i,QQ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ZQ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,qQ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,GQ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ih;const KQ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,JQ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,XQ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,eZ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nZ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jx="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",iZ=new RegExp(`^${jx}$`);function Sx(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function rZ(e){return new RegExp(`^${Sx(e)}$`)}function sZ(e){let t=`${jx}T${Sx(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function oZ(e,t){return!!((t==="v4"||!t)&&KQ.test(e)||(t==="v6"||!t)&&XQ.test(e))}function aZ(e,t){if(!QQ.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function cZ(e,t){return!!((t==="v4"||!t)&&JQ.test(e)||(t==="v6"||!t)&&eZ.test(e))}class $r extends Ae{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==de.string){const s=this._getOrReturnCtx(t);return ce(s,{code:X.invalid_type,expected:de.string,received:s.parsedType}),xe}const i=new Hn;let r;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),ce(r,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),ce(r,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,c=t.data.length<s.value;(o||c)&&(r=this._getOrReturnCtx(t,r),o?ce(r,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&ce(r,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")qQ.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"email",code:X.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Ih||(Ih=new RegExp(GQ,"u")),Ih.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"emoji",code:X.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")YQ.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"uuid",code:X.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")HQ.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"nanoid",code:X.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")$Q.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"cuid",code:X.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")WQ.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"cuid2",code:X.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")FQ.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"ulid",code:X.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),ce(r,{validation:"url",code:X.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"regex",code:X.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),ce(r,{code:X.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(r=this._getOrReturnCtx(t,r),ce(r,{code:X.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),ce(r,{code:X.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?sZ(s).test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{code:X.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?iZ.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{code:X.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?rZ(s).test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{code:X.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?ZQ.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"duration",code:X.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?oZ(t.data,s.version)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"ip",code:X.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?aZ(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"jwt",code:X.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?cZ(t.data,s.version)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"cidr",code:X.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?tZ.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"base64",code:X.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?nZ.test(t.data)||(r=this._getOrReturnCtx(t,r),ce(r,{validation:"base64url",code:X.invalid_string,message:s.message}),i.dirty()):Re.assertNever(s);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:X.invalid_string,...he.errToObj(i)})}_addCheck(t){return new $r({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...he.errToObj(t)})}url(t){return this._addCheck({kind:"url",...he.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...he.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...he.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...he.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...he.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...he.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...he.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...he.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...he.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...he.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...he.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...he.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...he.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...he.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...he.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...he.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...he.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...he.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...he.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...he.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...he.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...he.errToObj(n)})}nonempty(t){return this.min(1,he.errToObj(t))}trim(){return new $r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new $r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new $r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}$r.create=e=>new $r({checks:[],typeName:Ie.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Le(e)});function lZ(e,t){const n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,s=Number.parseInt(e.toFixed(r).replace(".","")),o=Number.parseInt(t.toFixed(r).replace(".",""));return s%o/10**r}class Do extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==de.number){const s=this._getOrReturnCtx(t);return ce(s,{code:X.invalid_type,expected:de.number,received:s.parsedType}),xe}let i;const r=new Hn;for(const s of this._def.checks)s.kind==="int"?Re.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),ce(i,{code:X.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),ce(i,{code:X.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),ce(i,{code:X.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?lZ(t.data,s.value)!==0&&(i=this._getOrReturnCtx(t,i),ce(i,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),ce(i,{code:X.not_finite,message:s.message}),r.dirty()):Re.assertNever(s);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,he.toString(n))}gt(t,n){return this.setLimit("min",t,!1,he.toString(n))}lte(t,n){return this.setLimit("max",t,!0,he.toString(n))}lt(t,n){return this.setLimit("max",t,!1,he.toString(n))}setLimit(t,n,i,r){return new Do({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:he.toString(r)}]})}_addCheck(t){return new Do({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:he.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:he.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:he.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:he.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:he.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:he.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:he.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:he.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:he.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Re.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Do.create=e=>new Do({checks:[],typeName:Ie.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class Xa extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==de.bigint)return this._getInvalidInput(t);let i;const r=new Hn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),ce(i,{code:X.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),ce(i,{code:X.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),ce(i,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):Re.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ce(n,{code:X.invalid_type,expected:de.bigint,received:n.parsedType}),xe}gte(t,n){return this.setLimit("min",t,!0,he.toString(n))}gt(t,n){return this.setLimit("min",t,!1,he.toString(n))}lte(t,n){return this.setLimit("max",t,!0,he.toString(n))}lt(t,n){return this.setLimit("max",t,!1,he.toString(n))}setLimit(t,n,i,r){return new Xa({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:he.toString(r)}]})}_addCheck(t){return new Xa({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:he.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:he.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:he.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:he.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:he.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Xa.create=e=>new Xa({checks:[],typeName:Ie.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Le(e)});class a4 extends Ae{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==de.boolean){const i=this._getOrReturnCtx(t);return ce(i,{code:X.invalid_type,expected:de.boolean,received:i.parsedType}),xe}return ci(t.data)}}a4.create=e=>new a4({typeName:Ie.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class Jl extends Ae{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==de.date){const s=this._getOrReturnCtx(t);return ce(s,{code:X.invalid_type,expected:de.date,received:s.parsedType}),xe}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return ce(s,{code:X.invalid_date}),xe}const i=new Hn;let r;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),ce(r,{code:X.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),ce(r,{code:X.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Re.assertNever(s);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Jl({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:he.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:he.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Jl.create=e=>new Jl({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ie.ZodDate,...Le(e)});class c4 extends Ae{_parse(t){if(this._getType(t)!==de.symbol){const i=this._getOrReturnCtx(t);return ce(i,{code:X.invalid_type,expected:de.symbol,received:i.parsedType}),xe}return ci(t.data)}}c4.create=e=>new c4({typeName:Ie.ZodSymbol,...Le(e)});class l4 extends Ae{_parse(t){if(this._getType(t)!==de.undefined){const i=this._getOrReturnCtx(t);return ce(i,{code:X.invalid_type,expected:de.undefined,received:i.parsedType}),xe}return ci(t.data)}}l4.create=e=>new l4({typeName:Ie.ZodUndefined,...Le(e)});class u4 extends Ae{_parse(t){if(this._getType(t)!==de.null){const i=this._getOrReturnCtx(t);return ce(i,{code:X.invalid_type,expected:de.null,received:i.parsedType}),xe}return ci(t.data)}}u4.create=e=>new u4({typeName:Ie.ZodNull,...Le(e)});class d4 extends Ae{constructor(){super(...arguments),this._any=!0}_parse(t){return ci(t.data)}}d4.create=e=>new d4({typeName:Ie.ZodAny,...Le(e)});class h4 extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ci(t.data)}}h4.create=e=>new h4({typeName:Ie.ZodUnknown,...Le(e)});class ns extends Ae{_parse(t){const n=this._getOrReturnCtx(t);return ce(n,{code:X.invalid_type,expected:de.never,received:n.parsedType}),xe}}ns.create=e=>new ns({typeName:Ie.ZodNever,...Le(e)});class f4 extends Ae{_parse(t){if(this._getType(t)!==de.undefined){const i=this._getOrReturnCtx(t);return ce(i,{code:X.invalid_type,expected:de.void,received:i.parsedType}),xe}return ci(t.data)}}f4.create=e=>new f4({typeName:Ie.ZodVoid,...Le(e)});class Pi extends Ae{_parse(t){const{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==de.array)return ce(n,{code:X.invalid_type,expected:de.array,received:n.parsedType}),xe;if(r.exactLength!==null){const o=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(o||c)&&(ce(n,{code:o?X.too_big:X.too_small,minimum:c?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(ce(n,{code:X.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(ce(n,{code:X.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>r.type._parseAsync(new ts(n,o,n.path,c)))).then(o=>Hn.mergeArray(i,o));const s=[...n.data].map((o,c)=>r.type._parseSync(new ts(n,o,n.path,c)));return Hn.mergeArray(i,s)}get element(){return this._def.type}min(t,n){return new Pi({...this._def,minLength:{value:t,message:he.toString(n)}})}max(t,n){return new Pi({...this._def,maxLength:{value:t,message:he.toString(n)}})}length(t,n){return new Pi({...this._def,exactLength:{value:t,message:he.toString(n)}})}nonempty(t){return this.min(1,t)}}Pi.create=(e,t)=>new Pi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ie.ZodArray,...Le(t)});function ao(e){if(e instanceof ut){const t={};for(const n in e.shape){const i=e.shape[n];t[n]=Hr.create(ao(i))}return new ut({...e._def,shape:()=>t})}else return e instanceof Pi?new Pi({...e._def,type:ao(e.element)}):e instanceof Hr?Hr.create(ao(e.unwrap())):e instanceof Oo?Oo.create(ao(e.unwrap())):e instanceof ks?ks.create(e.items.map(t=>ao(t))):e}class ut extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Re.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==de.object){const u=this._getOrReturnCtx(t);return ce(u,{code:X.invalid_type,expected:de.object,received:u.parsedType}),xe}const{status:i,ctx:r}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof ns&&this._def.unknownKeys==="strip"))for(const u in r.data)o.includes(u)||c.push(u);const l=[];for(const u of o){const d=s[u],f=r.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new ts(r,f,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof ns){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:r.data[d]}});else if(u==="strict")c.length>0&&(ce(r,{code:X.unrecognized_keys,keys:c}),i.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of c){const f=r.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new ts(r,f,r.path,d)),alwaysSet:d in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key,m=await d.value;u.push({key:f,value:m,alwaysSet:d.alwaysSet})}return u}).then(u=>Hn.mergeObjectSync(i,u)):Hn.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(t){return he.errToObj,new ut({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,i)=>{var s,o;const r=((o=(s=this._def).errorMap)==null?void 0:o.call(s,n,i).message)??i.defaultError;return n.code==="unrecognized_keys"?{message:he.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new ut({...this._def,unknownKeys:"strip"})}passthrough(){return new ut({...this._def,unknownKeys:"passthrough"})}extend(t){return new ut({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ut({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ie.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new ut({...this._def,catchall:t})}pick(t){const n={};for(const i of Re.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new ut({...this._def,shape:()=>n})}omit(t){const n={};for(const i of Re.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new ut({...this._def,shape:()=>n})}deepPartial(){return ao(this)}partial(t){const n={};for(const i of Re.objectKeys(this.shape)){const r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new ut({...this._def,shape:()=>n})}required(t){const n={};for(const i of Re.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Hr;)s=s._def.innerType;n[i]=s}return new ut({...this._def,shape:()=>n})}keyof(){return Dx(Re.objectKeys(this.shape))}}ut.create=(e,t)=>new ut({shape:()=>e,unknownKeys:"strip",catchall:ns.create(),typeName:Ie.ZodObject,...Le(t)});ut.strictCreate=(e,t)=>new ut({shape:()=>e,unknownKeys:"strict",catchall:ns.create(),typeName:Ie.ZodObject,...Le(t)});ut.lazycreate=(e,t)=>new ut({shape:e,unknownKeys:"strip",catchall:ns.create(),typeName:Ie.ZodObject,...Le(t)});class Xl extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t),i=this._def.options;function r(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=s.map(c=>new lr(c.ctx.common.issues));return ce(n,{code:X.invalid_union,unionErrors:o}),xe}if(n.common.async)return Promise.all(i.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const l of i){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const c=o.map(l=>new lr(l));return ce(n,{code:X.invalid_union,unionErrors:c}),xe}}get options(){return this._def.options}}Xl.create=(e,t)=>new Xl({options:e,typeName:Ie.ZodUnion,...Le(t)});function rf(e,t){const n=Dr(e),i=Dr(t);if(e===t)return{valid:!0,data:e};if(n===de.object&&i===de.object){const r=Re.objectKeys(t),s=Re.objectKeys(e).filter(c=>r.indexOf(c)!==-1),o={...e,...t};for(const c of s){const l=rf(e[c],t[c]);if(!l.valid)return{valid:!1};o[c]=l.data}return{valid:!0,data:o}}else if(n===de.array&&i===de.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let s=0;s<e.length;s++){const o=e[s],c=t[s],l=rf(o,c);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return n===de.date&&i===de.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class eu extends Ae{_parse(t){const{status:n,ctx:i}=this._processInputParams(t),r=(s,o)=>{if(r4(s)||r4(o))return xe;const c=rf(s.value,o.value);return c.valid?((s4(s)||s4(o))&&n.dirty(),{status:n.value,value:c.data}):(ce(i,{code:X.invalid_intersection_types}),xe)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}eu.create=(e,t,n)=>new eu({left:e,right:t,typeName:Ie.ZodIntersection,...Le(n)});class ks extends Ae{_parse(t){const{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==de.array)return ce(i,{code:X.invalid_type,expected:de.array,received:i.parsedType}),xe;if(i.data.length<this._def.items.length)return ce(i,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&i.data.length>this._def.items.length&&(ce(i,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((o,c)=>{const l=this._def.items[c]||this._def.rest;return l?l._parse(new ts(i,o,i.path,c)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>Hn.mergeArray(n,o)):Hn.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new ks({...this._def,rest:t})}}ks.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ks({items:e,typeName:Ie.ZodTuple,rest:null,...Le(t)})};class m4 extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==de.map)return ce(i,{code:X.invalid_type,expected:de.map,received:i.parsedType}),xe;const r=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([c,l],u)=>({key:r._parse(new ts(i,c,i.path,[u,"key"])),value:s._parse(new ts(i,l,i.path,[u,"value"]))}));if(i.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return xe;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(u.value,d.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const l of o){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return xe;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(u.value,d.value)}return{status:n.value,value:c}}}}m4.create=(e,t,n)=>new m4({valueType:t,keyType:e,typeName:Ie.ZodMap,...Le(n)});class ec extends Ae{_parse(t){const{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==de.set)return ce(i,{code:X.invalid_type,expected:de.set,received:i.parsedType}),xe;const r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(ce(i,{code:X.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(ce(i,{code:X.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const d of l){if(d.status==="aborted")return xe;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const c=[...i.data.values()].map((l,u)=>s._parse(new ts(i,l,i.path,u)));return i.common.async?Promise.all(c).then(l=>o(l)):o(c)}min(t,n){return new ec({...this._def,minSize:{value:t,message:he.toString(n)}})}max(t,n){return new ec({...this._def,maxSize:{value:t,message:he.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ec.create=(e,t)=>new ec({valueType:e,minSize:null,maxSize:null,typeName:Ie.ZodSet,...Le(t)});class y4 extends Ae{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}y4.create=(e,t)=>new y4({getter:e,typeName:Ie.ZodLazy,...Le(t)});class g4 extends Ae{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ce(n,{received:n.data,code:X.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:t.data}}get value(){return this._def.value}}g4.create=(e,t)=>new g4({value:e,typeName:Ie.ZodLiteral,...Le(t)});function Dx(e,t){return new No({values:e,typeName:Ie.ZodEnum,...Le(t)})}class No extends Ae{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),i=this._def.values;return ce(n,{expected:Re.joinValues(i),received:n.parsedType,code:X.invalid_type}),xe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),i=this._def.values;return ce(n,{received:n.data,code:X.invalid_enum_value,options:i}),xe}return ci(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return No.create(t,{...this._def,...n})}exclude(t,n=this._def){return No.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}}No.create=Dx;class p4 extends Ae{_parse(t){const n=Re.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==de.string&&i.parsedType!==de.number){const r=Re.objectValues(n);return ce(i,{expected:Re.joinValues(r),received:i.parsedType,code:X.invalid_type}),xe}if(this._cache||(this._cache=new Set(Re.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const r=Re.objectValues(n);return ce(i,{received:i.data,code:X.invalid_enum_value,options:r}),xe}return ci(t.data)}get enum(){return this._def.values}}p4.create=(e,t)=>new p4({values:e,typeName:Ie.ZodNativeEnum,...Le(t)});class tu extends Ae{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==de.promise&&n.common.async===!1)return ce(n,{code:X.invalid_type,expected:de.promise,received:n.parsedType}),xe;const i=n.parsedType===de.promise?n.data:Promise.resolve(n.data);return ci(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}}tu.create=(e,t)=>new tu({type:e,typeName:Ie.ZodPromise,...Le(t)});class Ao extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o=>{ce(i,o),o.fatal?n.abort():n.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(i.data,s);if(i.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return xe;const l=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return l.status==="aborted"?xe:l.status==="dirty"||n.value==="dirty"?Ma(l.value):l});{if(n.value==="aborted")return xe;const c=this._def.schema._parseSync({data:o,path:i.path,parent:i});return c.status==="aborted"?xe:c.status==="dirty"||n.value==="dirty"?Ma(c.value):c}}if(r.type==="refinement"){const o=c=>{const l=r.refinement(c,s);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?xe:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?xe:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){const o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!So(o))return xe;const c=r.transform(o.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>So(o)?Promise.resolve(r.transform(o.value,s)).then(c=>({status:n.value,value:c})):xe);Re.assertNever(r)}}
317Ao.create=(e,t,n)=>new Ao({schema:e,typeName:Ie.ZodEffects,effect:t,...Le(n)});Ao.createWithPreprocess=(e,t,n)=>new Ao({schema:t,effect:{type:"preprocess",transform:e},typeName:Ie.ZodEffects,...Le(n)});class Hr extends Ae{_parse(t){return this._getType(t)===de.undefined?ci(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Hr.create=(e,t)=>new Hr({innerType:e,typeName:Ie.ZodOptional,...Le(t)});class Oo extends Ae{_parse(t){return this._getType(t)===de.null?ci(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Oo.create=(e,t)=>new Oo({innerType:e,typeName:Ie.ZodNullable,...Le(t)});class sf extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t);let i=n.data;return n.parsedType===de.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}sf.create=(e,t)=>new sf({innerType:e,typeName:Ie.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Le(t)});class of extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Kl(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new lr(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new lr(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}of.create=(e,t)=>new of({innerType:e,typeName:Ie.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Le(t)});class w4 extends Ae{_parse(t){if(this._getType(t)!==de.nan){const i=this._getOrReturnCtx(t);return ce(i,{code:X.invalid_type,expected:de.nan,received:i.parsedType}),xe}return{status:"valid",value:t.data}}}w4.create=e=>new w4({typeName:Ie.ZodNaN,...Le(e)});class uZ extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class gm extends Ae{_parse(t){const{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?xe:s.status==="dirty"?(n.dirty(),Ma(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?xe:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new gm({in:t,out:n,typeName:Ie.ZodPipeline})}}class af extends Ae{_parse(t){const n=this._def.innerType._parse(t),i=r=>(So(r)&&(r.value=Object.freeze(r.value)),r);return Kl(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}}af.create=(e,t)=>new af({innerType:e,typeName:Ie.ZodReadonly,...Le(t)});ut.lazycreate;var Ie;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ie||(Ie={}));const _4=$r.create,dZ=Do.create;ns.create;Pi.create;const hZ=ut.create;ut.strictCreate;Xl.create;eu.create;ks.create;No.create;tu.create;Hr.create;Oo.create;const fZ="0x06fdde03",mZ=[],yZ=[{type:"string"}];async function gZ(e){return ac({contract:e.contract,method:[fZ,mZ,yZ],params:[]})}async function Nx(e){return Ui(()=>gZ(e),{cacheKey:`${e.contract.chain.id}:${e.contract.address}:name`,cacheTime:Number.POSITIVE_INFINITY})}const pZ="0x95d89b41",wZ=[],_Z=[{type:"string"}];async function bZ(e){return ac({contract:e.contract,method:[pZ,wZ,_Z],params:[]})}async function Ax(e){return Ui(()=>bZ(e),{cacheKey:`${e.contract.chain.id}:${e.contract.address}:symbol`,cacheTime:Number.POSITIVE_INFINITY})}const b4=hZ({name:_4().default("Ether"),symbol:_4().default("ETH"),decimals:dZ().default(18)}
317).default({name:"Ether",symbol:"ETH",decimals:18});async function Ox(e){if(xl(e.contract.address)){if(!e.contract.chain.nativeCurrency||!e.contract.chain.nativeCurrency.name||!e.contract.chain.nativeCurrency.symbol||!e.contract.chain.nativeCurrency.decimals)try{const{getChainMetadata:t}=await h(async()=>{const{getChainMetadata:i}=await import("./utils-BnNtzvC2.js").then(r=>r.u);return{getChainMetadata:i}},__vite__mapDeps([5,6])),n=await t(e.contract.chain);return b4.parse({...n.nativeCurrency,...e.contract.chain.nativeCurrency})}catch{}return b4.parse(e.contract.chain.nativeCurrency)}try{const[t,n,i]=await Promise.all([Nx(e).catch(()=>""),Ax(e),Z6(e)]);return{decimals:i,name:t,symbol:n}}catch(t){throw new Error(`Invalid currency token: ${t}`)}}const xZ=Object.freeze(Object.defineProperty({__proto__:null,getCurrencyMetadata:Ox},Symbol.toStringTag,{value:"Module"}));function IZ(e){const{transaction:t,account:n,supportedDestinations:i}=e,[r,s]=_.useState();return _.useEffect(()=>{Promise.all([wn(t.value),wn(t.erc20Value),wn(t.to),gf(t)]).then(([o,c,l,u])=>{var d;s({data:u,erc20Currency:c==null?void 0:c.tokenAddress,erc20Value:(d=c==null?void 0:c.amountWei)==null?void 0:d.toString(),to:l,value:o==null?void 0:o.toString()})})},[t]),pe({enabled:!!t&&!!r,queryFn:async()=>{var m,y,g;if(!n)throw new Error("No payer account found");const o=await wn(t.erc20Value);if(o){const[p,w,x,I]=await Promise.all([Ts({address:n.address,chain:t.chain,client:t.client,tokenAddress:o.tokenAddress}),Ox({contract:zt({address:o.tokenAddress,chain:t.chain,client:t.client})}),bl(t,n==null?void 0:n.address),Ht(t.chain)]),E=o.amountWei,j=p,C={address:o.tokenAddress,icon:(y=(m=i.find(T=>T.chain.id===t.chain.id))==null?void 0:m.tokens.find(T=>T.address.toLowerCase()===o.tokenAddress.toLowerCase()))==null?void 0:y.icon,name:w.name,symbol:w.symbol};return{chainMetadata:I,decimals:w.decimals,gasCostWei:x,token:C,transactionValueWei:E,walletBalance:j}}const[c,l,u]=await Promise.all([Ts({address:n.address,chain:t.chain,client:t.client}),Ht(t.chain),bl(t,n==null?void 0:n.address)]),d=c,f=await wn(t.value)||0n;return{chainMetadata:l,decimals:18,gasCostWei:u,token:{address:Pt,icon:(g=l.icon)==null?void 0:g.url,name:l.nativeCurrency.name,symbol:l.nativeCurrency.symbol},transactionValueWei:f,walletBalance:d}},queryKey:["transaction-cost",t.chain.id,n==null?void 0:n.address,r],refetchInterval:e.refetchIntervalMs||3e4})}function MZ(e){return Oi(e.token)?a.jsx(CZ,{chain:e.chain,color:e.color,inline:e.inline,size:e.size}):a.jsx(A,{color:e.color||"primaryText",inline:e.inline,size:e.size,children:e.token.symbol})}function CZ(e){const t=v8(e.chain);return t.isLoading?a.jsx(me,{height:ie[e.size],width:"70px"}):a.jsx(A,{color:e.color||"primaryText",inline:e.inline,size:e.size,children:t.symbol??"ETH"})}const EZ=qt`
3180% {
319  opacity: 1;
320  transform: scale(0.5);
321}
322100% {
323  opacity: 0;
324  transform: scale(1.5);
325}
326`,TZ=Fe(()=>{const e=ee();return{"&::before":{animation:`${EZ} 1s infinite`,backgroundColor:e.colors.accentText,borderRadius:"50%",content:'""',height:"8px",width:"8px"},alignItems:"center",backgroundColor:e.colors.tertiaryBg,border:`1px solid ${e.colors.borderColor}`,borderRadius:J.lg,color:e.colors.secondaryText,display:"flex",fontSize:ie.sm,fontWeight:500,gap:R.sm,padding:`${R.md} ${R.sm}`,position:"relative"}});function vZ(e){const t=ft(),n=ht(),i=n==null?void 0:n.address,{hasCopied:r,onCopy:s}=_1(i||""),{connectLocale:o,client:c}=e,l=o.receiveFundsScreen,u=e.tx.chain.testnet===!0,{data:d,error:f,isFetching:m,refetch:y}=IZ({account:n,refetchIntervalMs:1e4,supportedDestinations:[],transaction:e.tx}),g=ee(),p=hf(t);if(f)return a.jsx(b,{center:"both",flex:"row",fullHeight:!0,style:{minHeight:"350px"},children:a.jsx(Bu,{onTryAgain:y,title:(f==null?void 0:f.message)||"Something went wrong"})});if(!d)return a.jsx(Mt,{});const w=Oi(d.token)&&!p?d.transactionValueWei+d.gasCostWei:d.transactionValueWei,x=d.walletBalance.value<w,I=d.walletBalance.value?w-d.walletBalance.value:w,E=()=>{window.open(`https://thirdweb.com/${e.tx.chain.id}?utm_source=ub_deposit`)};return a.jsxs(b,{p:"lg",children:[a.jsx(Me,{title:"Insufficient funds"}),a.jsx(U,{y:"lg"}),a.jsxs(b,{flex:"column",gap:"sm",children:[x&&a.jsx("div",{children:a.jsxs(A,{center:!0,color:"danger",multiline:!0,size:"xs",children:["You need"," ",Bo(Number.parseFloat(mi(I,d.decimals)),5)," ",d.token.symbol," to continue"]})}),a.jsxs(b,{flex:"row",style:{border:`1px solid ${g.colors.borderColor}`,borderBottom:"none",borderRadius:`${J.md} ${J.md} 0 0`,justifyContent:"space-between",padding:R.sm},children:[n&&a.jsx(Dl,{address:n==null?void 0:n.address,client:c,iconSize:"md"}),d.walletBalance.value!==void 0&&!m?a.jsxs(b,{center:"y",flex:"row",gap:"3xs",children:[a.jsx(A,{color:"secondaryText",size:"xs",weight:500,children:Co(d.walletBalance,!1)}),a.jsx(MZ,{chain:e.tx.chain,color:"secondaryText",size:"xs",token:d.token})]}):a.jsx(b,{center:"y",flex:"row",gap:"3xs",children:a.jsx(me,{height:ie.xs,width:"70px"})})]})]}),a.jsx(LZ,{onClick:s,children:a.jsxs(b,{center:"both",expand:!0,flex:"column",gap:"md",children:[a.jsx(b,{center:"x",flex:"row",children:a.jsx(Ru,{QRIcon:t&&a.jsx(ai,{client:c,id:t.id,size:D.xl}),qrCodeUri:i,size:250})}),a.jsxs(b,{center:"x",flex:"row",gap:"xs",children:[a.jsx(A,{color:"primaryText",size:"md",style:{fontFamily:"monospace"},children:i?Mn(i):""}),a.jsx(js,{hasCopied:r,text:i||"",tip:"Copy address"})]})]})}),a.jsx(U,{y:"md"}),a.jsx(A,{balance:!0,center:!0,className:"receive_fund_screen_instruction",multiline:!0,size:"sm",children:l.instruction}),a.jsx(U,{y:"md"}),x?a.jsxs(TZ,{children:["Waiting for funds on ",d.chainMetadata.name,"..."]}):a.jsx(ue,{fullWidth:!0,onClick:e.onDone,variant:"accent",children:"Continue"}),x&&u&&a.jsxs(a.Fragment,{children:[a.jsx(U,{y:"md"}),a.jsx(ue,{fullWidth:!0,onClick:E,variant:"link",children:a.jsxs(b,{center:"x",color:"accentText",flex:"row",gap:"xs",children:[a.jsx(gc,{size:D.sm}),a.jsx(A,{center:!0,color:"accentText",size:"xs",weight:500,children:"Get testnet funds"})]})})]})]})}const LZ=$i(e=>{const t=ee();return{all:"unset","&:hover":{borderColor:t.colors.accentText},border:`1px solid ${t.colors.borderColor}`,borderRadius:`0 0 ${J.md} ${J.md}`,boxSizing:"border-box",cursor:"pointer",display:"flex",justifyContent:"space-between",padding:R.md,transition:"border-color 200ms ease",width:"100%"}});function jZ(e){const t=ht(),n=ft();return pe({enabled:!!n&&!!t,queryFn:async()=>{var i;if(!t||!n)throw new Error;return ot({client:e.client,event:e.modalMode==="buy"?"open_pay_transaction_modal":"open_pay_deposit_modal",toChainId:e.tx.chain.id,toToken:e.tx.erc20Value?(i=await wn(e.tx.erc20Value))==null?void 0:i.tokenAddress:void 0,walletAddress:t.address,walletType:n.id}),null},queryKey:["transaction-modal-event",e.txId]}),a.jsx(mu,{theme:e.theme,children:a.jsx(yc,{className:"tw-modal__view-transaction",title:"View Transaction",open:!0,setOpen:i=>{i||e.onClose()},size:"compact",children:a.jsx(SZ,{...e})})})}function SZ(e){var t,n,i;return e.modalMode==="deposit"?a.jsx(DZ,{...e}):a.jsx(PQ,{client:e.client,country:e.country,currency:e.currency,transaction:e.tx,onCancel:e.onClose,locale:e.localeId,onSuccess:r=>{e.onTxSent(r)},title:(t=e.payOptions.metadata)==null?void 0:t.name,description:(n=e.payOptions.metadata)==null?void 0:n.description,image:(i=e.payOptions.metadata)==null?void 0:i.image,paymentMethods:e.payOptions.buyWithCrypto===!1?["card"]:e.payOptions.buyWithFiat===!1?["crypto"]:["crypto","card"],showThirdwebBranding:e.payOptions.showThirdwebBranding,supp
326ortedTokens:e.supportedTokens,onError:void 0,paymentLinkId:void 0,buttonLabel:void 0,purchaseData:void 0})}function DZ(e){const t=e1(e.localeId),[n,i]=_.useState("deposit");return t.data?n==="execute-tx"?a.jsx(E3,{onBack:()=>{i("deposit")},closeModal:e.onClose,onTxSent:e.onTxSent,tx:e.tx,windowAdapter:lo}):n==="deposit"?a.jsx(vZ,{client:e.client,connectLocale:t.data,onDone:()=>{i("execute-tx")},tx:e.tx}):null:a.jsx(Mt,{})}function kx(e={}){const t=Uf(),n=ft(),i=_.useContext($4),r=e.payModal;let s=!0;(r===!1||e.gasless)&&(s=!1);const o=c=>{var l;r!==!1&&i(a.jsx(jZ,{country:r==null?void 0:r.country,currency:r==null?void 0:r.currency,client:c.tx.client,localeId:(r==null?void 0:r.locale)||"en_US",modalMode:c.mode,onClose:()=>{i(null),c.rejectTx(new Error("User rejected transaction by closing modal"))},onComplete:c.sendTx,onTxSent:c.resolveTx,payOptions:{buyWithCrypto:r==null?void 0:r.buyWithCrypto,buyWithFiat:r==null?void 0:r.buyWithFiat,metadata:r==null?void 0:r.metadata,mode:"transaction",onPurchaseSuccess:r==null?void 0:r.onPurchaseSuccess,purchaseData:r==null?void 0:r.purchaseData,showThirdwebBranding:r==null?void 0:r.showThirdwebBranding,transaction:c.tx},supportedTokens:r==null?void 0:r.supportedTokens,theme:(r==null?void 0:r.theme)||"dark",title:((l=r==null?void 0:r.metadata)==null?void 0:l.name)||"Transaction",tx:c.tx,txId:cu()}))};return eI({gasless:e.gasless,showPayModal:!s||r===!1?void 0:o,switchChain:t,wallet:n})}function NZ(e={}){const t=kx(e);return Es({mutationFn:async n=>{const i=await t.mutateAsync(n);return await ru(i)}})}async function AZ(e){const{client:t,uri:n}=e;if(hj(n))try{return JSON.parse(fj(n))}catch(r){console.error("Failed to decode base64 encoded contract metadata",{uri:n},r);return}if(yj(n))try{return JSON.parse(gj(n))}catch(r){console.error("Failed to fetch utf8 encoded contract metadata",{uri:n},r);return}const{download:i}=await h(async()=>{const{download:r}=await import("./bundler-BZOUbTQa.js").then(s=>s.cN);return{download:r}},__vite__mapDeps([1,2,3,4,5,6,7,8,9]));return await(await i({client:t,uri:n})).json()}const OZ="0xe8a3d485",kZ=[],zZ=[{type:"string"}];async function PZ(e){return ac({contract:e.contract,method:[OZ,kZ,zZ],params:[]})}async function RZ(e){const[t,n,i]=await Promise.all([PZ(e).then(r=>r?AZ({client:e.contract.client,uri:r}):null).catch(()=>null),Nx(e).catch(()=>null),Ax(e).catch(()=>null)]);return{...t??{},name:t!=null&&t.name&&typeof t.name=="string"?t.name:n,symbol:t!=null&&t.symbol&&typeof t.symbol=="string"?t.symbol:i}}function UZ(e,t){const n=O8(df(e,{strict:!1})?S6(e):e);return ou(n)}const Mh=new n6(4096);function BZ(e){if(Mh.has(e))return Mh.get(e);const t=UZ(Ea(e)).slice(2,34);return Mh.set(e,t),t}function VZ(e){const{clientId:t,secretKey:n,...i}=e;let r=t;if(n)if(i6(n)){if(!t)throw new Error("clientId must be provided when using a JWT secretKey")}else r=t??BZ(n);if(!r)throw new Error("clientId or secretKey must be provided");return{...i,clientId:r,secretKey:n}}async function $Z(e){const t=await(async()=>{if(e.type==="erc1155"){const{getActiveClaimCondition:d}=await h(async()=>{const{getActiveClaimCondition:f}=await import("./getActiveClaimCondition-CeXXYUaK.js");return{getActiveClaimCondition:f}},__vite__mapDeps([51,1,2,3,4,5,6,7,8,9]));return await d({contract:e.contract,tokenId:e.tokenId})}if(e.type==="erc721"){if(e.singlePhaseDrop){const{claimCondition:f}=await h(async()=>{const{claimCondition:m}=await import("./claimCondition-t4GtiXaJ.js");return{claimCondition:m}},__vite__mapDeps([52,1,2,3,4,5,6,7,8,9]));return await f({contract:e.contract})}const{getActiveClaimCondition:d}=await h(async()=>{const{getActiveClaimCondition:f}=await import("./getActiveClaimCondition-BDzzchIW.js");return{getActiveClaimCondition:f}},__vite__mapDeps([53,1,2,3,4,5,6,7,8,9]));return await d({contract:e.contract})}if(e.singlePhaseDrop){const{claimCondition:d}=await h(async()=>{const{claimCondition:f}=await import("./claimCondition-t4GtiXaJ.js");return{claimCondition:f}},__vite__mapDeps([52,1,2,3,4,5,6,7,8,9]));return await d({contract:e.contract})}const{getActiveClaimCondition:u}=await h(async()=>{const{getActiveClaimCondition:d}=await import("./getActiveClaimCondition-dK9OtcWY.js");return{getActiveClaimCondition:d}},__vite__mapDeps([54,1,2,3,4,5,6,7,8,9]));return await u({contract:e.contract})})(),n=e.type==="erc20"?e.tokenDecimals:0,i=await(async()=>
326{if(!t.merkleRoot||t.merkleRoot===D6("0x",{size:32}))return{currency:ga,pricePerToken:jc,proof:[],quantityLimitPerWallet:0n};const{fetchProofsForClaimer:u}=await h(async()=>{const{fetchProofsForClaimer:g}=await import("./fetch-proofs-for-claimers-CaMsrQ_Q.js");return{fetchProofsForClaimer:g}},__vite__mapDeps([55,7,4,3,6,8,9,1,2,5,26,10,11,12,13,14,15])),d=await RZ({contract:e.contract}),m=(N6(d.merkle)?d.merkle:{})[t.merkleRoot];if(!m)return{currency:ga,pricePerToken:jc,proof:[],quantityLimitPerWallet:0n};const y=await u({claimer:e.from||e.to,contract:e.contract,merkleTreeUri:m,tokenDecimals:n});return y||{currency:ga,pricePerToken:jc,proof:[],quantityLimitPerWallet:0n}})(),r=i.currency&&i.currency!==ga?i.currency:t.currency,s=i.pricePerToken!==void 0&&i.pricePerToken!==jc?i.pricePerToken:t.pricePerToken,o=s*e.quantity/BigInt(10**n),c=xl(r)?o:0n,l=!xl(r)&&s>0n?{amountWei:o,tokenAddress:r}:void 0;return{allowlistProof:i,currency:r,data:"0x",overrides:{erc20Value:l,value:c},pricePerToken:s,quantity:e.quantity,receiver:e.to,tokenId:e.type==="erc1155"?e.tokenId:void 0}}const WZ="0x57bc3d78",FZ=[{name:"receiver",type:"address"},{name:"tokenId",type:"uint256"},{name:"quantity",type:"uint256"},{name:"currency",type:"address"},{name:"pricePerToken",type:"uint256"},{components:[{name:"proof",type:"bytes32[]"},{name:"quantityLimitPerWallet",type:"uint256"},{name:"pricePerToken",type:"uint256"},{name:"currency",type:"address"}],name:"allowlistProof",type:"tuple"},{name:"data",type:"bytes"}],YZ=[];function HZ(e){const t=lu(async()=>"asyncParams"in e?await e.asyncParams():e);return Is({accessList:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.accessList},authorizationList:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.authorizationList},contract:e.contract,erc20Value:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.erc20Value},extraGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.extraGas},gas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.gas},gasPrice:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.gasPrice},maxFeePerGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.maxFeePerGas},maxPriorityFeePerGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.maxPriorityFeePerGas},method:[WZ,FZ,YZ],nonce:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.nonce},params:async()=>{const n=await t();return[n.receiver,n.tokenId,n.quantity,n.currency,n.pricePerToken,n.allowlistProof,n.data]},value:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.value}})}function QZ(e){return HZ({async asyncParams(){return{...await $Z({contract:e.contract,from:e.from,quantity:e.quantity,singlePhaseDrop:e.singlePhaseDrop,to:e.to,tokenId:e.tokenId,type:"erc1155"}),tokenId:e.tokenId}},contract:e.contract,overrides:e.overrides})}const zx="87435f4b56bcb4bef9e6cbd488cb5501",fs=VZ({clientId:zx}),ZZ=()=>{const{user:e}=L4(),t=ht(),n=jt(),{mutateAsync:i}=NZ(),r=t6(),{defaultChainId:s}=j4(),o=e==null?void 0:e.id,{data:c=[],isLoading:l}=dd({queryKey:["web3-wallets",o],queryFn:async()=>{const{data:C,error:T}=await Ft.from("user_wallets").select("*").eq("user_id",o).order("linked_at",{ascending:!1});if(T)throw T;return C??[]},enabled:!!o,staleTime:3e4}),{data:u=[]}=dd({queryKey:["web3-mint-logs",o],queryFn:async()=>{const{data:C,error:T}=await Ft.from("web3_mint_log").select("*").eq("user_id",o).order("minted_at",{ascending:!1});if(T)throw T;return C??[]},enabled:!!o,staleTime:15e3,refetchInterval:C=>{const T=C.state.data;return(T==null?void 0:T.some(N=>N.status==="pending"))?15e3:!1}}),{data:d}=dd({queryKey:["web3-tokenomics"],queryFn:async()=>{const{data:C,error:T}=await Ft.from("web3_tokenomics_config").select("max_supply, current_minted, current_burned, burn_on_consume, burn_rate, sync_frequency").eq("token_symbol","RADC").single();if(T)throw T;return C},staleTime:6e4}),f=()=>r.invalidateQueries({queryKey:["web3-wallets",o]}),m=()=>r.invalidateQueries({queryKey:["web3-mint-logs",o]}),y=_.useCallback(async(C,T)=>{if(!o||!C)return"error";try{const v=C.toLowerCase(),{data:N}=await Ft.from("user_wallets").select("id, user_id, is_primary").ilike("wallet_address",v).maybeSingle();if(N&&N.user_id!==o)return console.warn("[autoLinkWallet] Wallet belongs to another user"),be.error("Esta wallet já está vinculada a outra conta"),"owned_by_other";if(N&&N.user_id===o)return"exists";const M=c.find(L=>L.is_primary);if(M&&M.wallet_address.toLowerCase()!==C.toLowerCase())return console.info("[autoLinkWallet] Wallet mismatch detected — primary:",M.wallet_address,"connecting:",C),"mismatch";const{error:S}=await Ft.from("user_wallets").insert({user_id:o,wallet_address:C.toLowerCase(),chain_id:T||s,is_primary:c.length===0,verified:!0});if(S){if(S.code==="23505"){const{data:L}=await Ft.from("user_wallets").select("user_id").ilike("wallet_address",v).maybeSingle();
326return(L==null?void 0:L.user_id)===o?"exists":(be.error("Esta wallet já está vinculada a outra conta"),"owned_by_other")}throw S}return f(),"linked"}catch(v){return console.error("Auto-link wallet error:",v),"error"}},[o,c]),g=_.useCallback(async()=>{if(!o||!(t!=null&&t.address)){be.error("Conecte sua wallet primeiro");return}const C=(n==null?void 0:n.id)||s;if(c.find(v=>v.wallet_address.toLowerCase()===t.address.toLowerCase())){be.info("Wallet já vinculada à sua conta");return}try{const{error:v}=await Ft.from("user_wallets").insert({user_id:o,wallet_address:t.address,chain_id:C,is_primary:c.length===0,verified:!0});if(v){if(v.code==="23505"){be.error("Esta wallet já está vinculada a outra conta");return}throw v}be.success("Wallet vinculada com sucesso!"),f()}catch(v){console.error("Error linking wallet:",v),be.error("Erro ao vincular wallet")}},[o,t==null?void 0:t.address,n==null?void 0:n.id,c]),p=_.useCallback(async C=>{if(o)try{const{error:T}=await Ft.from("user_wallets").delete().eq("id",C).eq("user_id",o);if(T)throw T;be.success("Wallet desvinculada"),f()}catch(T){console.error("Error unlinking wallet:",T),be.error("Erro ao desvincular wallet")}},[o]),w=_.useCallback(async(C,T)=>{var N,M;if(!o)return null;const v=c.find(S=>S.is_primary);if(!v)return be.error("Vincule uma wallet antes de mintar"),null;try{const{data:S,error:L}=await Ft.functions.invoke("web3-mint-nft",{body:{titleType:C,titleId:T,walletAddress:v.wallet_address,chainId:v.chain_id}});if(L){let P={};try{if(typeof L=="object"&&L.context){const $=typeof L.context.body=="string"?L.context.body:await((M=(N=L.context.body)==null?void 0:N.text)==null?void 0:M.call(N));$&&(P=JSON.parse($))}}catch{}return P.required?be.error(`Saldo RADC insuficiente. Necessário: ${P.required} RADC`):P.alreadyMinted?be.error("Este título já foi mintado"):be.error(P.error||L.message||"Erro ao mintar NFT"),null}const O=(S==null?void 0:S.radcPrice)>0?` (${S.radcPrice} RADC)`:"";return(S==null?void 0:S.status)==="confirmed"?be.success(`NFT mintado com sucesso!${O}`):be.info(`Claim enviado! Aguardando confirmação on-chain...${O}`,{duration:6e3}),m(),r.invalidateQueries({queryKey:["ai-credits"]}),S}catch(S){return console.error("Error minting NFT:",S),be.error(S.message||"Erro ao mintar NFT"),null}},[o,c]),x=_.useCallback(async(C,T,v)=>{var M,S,L,O;if(!o||!t||!fs)return be.error("Conecte sua wallet primeiro"),null;const N=c.find(P=>P.is_primary);if(!N)return be.error("Vincule uma wallet antes de mintar"),null;try{const{data:P,error:$}=await Ft.functions.invoke("web3-mint-nft",{body:{titleType:C,titleId:T,walletAddress:N.wallet_address,chainId:N.chain_id}});if($){let Z={};try{if(typeof $=="object"&&$.context){const K=typeof $.context.body=="string"?$.context.body:await((S=(M=$.context.body)==null?void 0:M.text)==null?void 0:S.call(M));K&&(Z=JSON.parse(K))}}catch{}return be.error(Z.error||$.message||"Erro ao verificar NFT"),null}if((P==null?void 0:P.mode)!=="onchain")return be.error("Modo on-chain não ativo"),null;const{contractAddress:z,onchainTokenId:k,radcPrice:B,radcContractAddress:W,chainId:V}=P;if(!z||k==null)return be.error("NFT ainda não configurado on-chain"),null;const F=Lt(V);if(B>0){v==null||v("approving");try{const Z=zt({client:fs,chain:F,address:W}),K=BigInt(B)*BigInt(10**18),q=Is({contract:Z,method:"function approve(address spender, uint256 amount) returns (bool)",params:[z,K]});await i(q),be.success("RADC aprovado! Executando claim...")}catch(Z){return console.error("Approve failed:",Z),be.error(Z.message||"Erro ao aprovar RADC"),v==null||v("idle"),null}}v==null||v("claiming");const Y=zt({client:fs,chain:F,address:z});let Q=null;try{const Z=QZ({contract:Y,to:N.wallet_address,from:N.wallet_address,tokenId:BigInt(k),quantity:1n});Q=await i(Z)}catch(Z){console.warn("claimTo SDK failed, trying raw claim fallback:",Z==null?void 0:Z.message);try{const K=BigInt(B)*BigInt(1e18),q=Is({contract:Y,method:"function claim(address _receiver, uint256 _tokenId, uint256 _quantity, address _currency, uint256 _pricePerToken, (bytes32[] proof, uint256 quantityLimitPerWallet, uint256 pricePerToken, address currency) _allowlistProof, bytes _data) payable",params:[N.wallet_address,BigInt(k),1n,W,K,{proof:[],quantityLimitPerWallet:0n,pricePerToken:K,currency:W},"0x"]});Q=await i(q)}catch(K){return console.error("Claim fallback also failed:",{error:K==null?void 0:K.message,contractAddress:z,tokenId:k,radcPrice:B,wallet:N.wallet_address}),be.error((L=K==null?void 0:K.message)!=null&&L.includes("user rejected")?"Transação cancelada":`Erro ao executar claim: ${((O=K==null?void 0:K.message)==null?void 0:O.slice(0,80))||"unknown"}`),v==null||v("idle"),null}}if(!Q)return be.error("Erro inesperado no claim"),v==null||v("idle"),null;try{try{await Ft.functions.invoke("web3-mint-nft",{body:{titleType:C,titleId:T,walletAddress:N.wallet_address,chainId:N.chain_id,logOnchainMint:!0,txHash:Q.transactionHash}})}catch(Z){console.warn("Failed to log on-chain mint:",Z)}return be.success(`NFT mintado on-chain! Tx: ${Q.transactionHash.slice(0,10)}...`),v==null||v("done"),m(),r.invalidateQueries({queryKey:["ai-credits"]}),{txHash:Q.transactionHash,status:"confirmed"}}catch(Z){return console.error("Post-claim error:",Z),be.error("Erro ao registrar mint"),v==null||v("idle"),null}}catch(P){return console.error("On-chain mint error:",P),be.error(P.message||"Erro no mint on-chain"),v==null||v("idle"),null}},[o,t,c,r]),I=_.useCallback(async C=>{var v,N;if(!o)return null;if(!c.find(M=>M.is_primary))return be.error("Vincule uma wallet antes de transferir"),null;try{const{data:M,error:S}=await Ft.functions.invoke("web3-withdraw-credits",{body:{amount:C}});if(S){let L={};try{if(typeof S=="object"&&S.context){const O=typeof S.context.body=="str
326ing"?S.context.body:await((N=(v=S.context.body)==null?void 0:v.text)==null?void 0:N.call(v));O&&(L=JSON.parse(O))}}catch{}return be.error(L.error||S.message||"Erro ao transferir para blockchain"),null}return be.success((M==null?void 0:M.message)||`${C} RADC transferidos para a blockchain`),m(),r.invalidateQueries({queryKey:["ai-credits"]}),M}catch(M){return console.error("Withdraw error:",M),be.error(M.message||"Erro ao transferir"),null}},[o,c,r]),E=_.useCallback(async(C,T)=>{var S,L,O,P;if(!o||!t||!fs)return be.error("Conecte sua wallet primeiro"),null;if(!c.find($=>$.is_primary))return be.error("Vincule uma wallet primeiro"),null;const N=(S=r.getQueryData(["web3-chain-config"]))==null?void 0:S.server_wallet_address;if(!N)return be.error("Server wallet não configurada"),null;const M=(await h(async()=>{const{RADC_CONTRACT_ADDRESS:$}=await import("./useWeb3ChainConfig-oZ-Z2Koq.js");return{RADC_CONTRACT_ADDRESS:$}},__vite__mapDeps([10,4,3,7,6,8,9,5]))).RADC_CONTRACT_ADDRESS;if(!M)return be.error("Contrato RADC não configurado"),null;try{const $=Lt(s),z=zt({client:fs,chain:$,address:M}),k=BigInt(C)*BigInt(10**18);T==null||T("transferring");let B;try{const F=Is({contract:z,method:"function transfer(address to, uint256 amount) returns (bool)",params:[N,k]});B=await i(F)}catch(F){return(L=F.message)!=null&&L.includes("user rejected")?be.error("Transação cancelada"):be.error("Erro ao transferir tokens"),T==null||T("idle"),null}T==null||T("confirming");const{data:W,error:V}=await Ft.functions.invoke("web3-deposit-credits",{body:{txHash:B.transactionHash,amount:C}});if(V){let F={};try{if(typeof V=="object"&&V.context){const Y=typeof V.context.body=="string"?V.context.body:await((P=(O=V.context.body)==null?void 0:O.text)==null?void 0:P.call(O));Y&&(F=JSON.parse(Y))}}catch{}return F.pending?(be.success("Transação recebida! O crédito será processado automaticamente.",{duration:6e3}),T==null||T("done"),m(),{pending:!0}):(be.error(F.error||"Erro ao creditar off-chain"),T==null||T("idle"),null)}return W!=null&&W.pending?(be.success("Transação recebida! O crédito será processado automaticamente.",{duration:6e3}),T==null||T("done"),m(),{pending:!0}):(be.success((W==null?void 0:W.message)||`${C} RADC depositados na conta off-chain`),T==null||T("done"),m(),r.invalidateQueries({queryKey:["ai-credits"]}),W)}catch($){return console.error("Deposit error:",$),be.error($.message||"Erro no depósito"),T==null||T("idle"),null}},[o,t,c,s,r]),j=_.useCallback(async()=>{var v;if(!o)return 0;const{data:C}=await Ft.from("web3_mint_log").select("id, metadata").eq("user_id",o).eq("status","pending");if(!C||C.length===0)return 0;let T=0;for(const N of C){const M=(v=N.metadata)==null?void 0:v.transactionId;if(!(!M||!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(M)))try{const{data:L,error:O}=await Ft.functions.invoke("web3-check-transaction",{body:{transactionId:M}});!O&&L&&(L.status==="confirmed"||L.status==="failed")&&T++}catch{}}return T>0&&(m(),r.invalidateQueries({queryKey:["ai-credits"]}),r.invalidateQueries({queryKey:["bridge-history"]}),r.invalidateQueries({queryKey:["bridge-onchain-balance"]})),T},[o,r]);return{wallets:c,mintLogs:u,tokenomics:d||null,isLinking:!1,isLoading:l,isConfigured:!!zx,primaryWallet:c.find(C=>C.is_primary)||null,connectedAddress:(t==null?void 0:t.address)||null,linkWallet:g,unlinkWallet:p,autoLinkWallet:y,requestMintNFT:w,requestMintNFTOnChain:x,requestWithdraw:I,requestDeposit:E,checkPendingTransactions:j,invalidateWallets:f,invalidateMintLogs:m}},qZ="0xb5051648",GZ=[{type:"tuple",name:"sessionSpec",components:[{type:"address",name:"signer"},{type:"bool",name:"isWildcard"},{type:"uint256",name:"expiresAt"},{type:"tuple[]",name:"callPolicies",components:[{type:"address",name:"target"},{type:"bytes4",name:"selector"},{type:"uint256",name:"maxValuePerUse"},{type:"tuple",name:"valueLimit",components:[{type:"uint8",name:"limitType"},{type:"uint256",name:"limit"},{type:"uint256",name:"period"}]},{type:"tuple[]",name:"constraints",components:[{type:"uint8",name:"condition"},{type:"uint64",name:"index"},{type:"bytes32",name:"refValue"},{type:"tuple",name:"limit",components:[{type:"uint8",name:"limitType"},{type:"uint256",name:"limit"},{type:"uint256",name:"period"}]}]}]},{type:"tuple[]",name:"transferPolicies",components:[{type:"address",name:"target"},{type:"uint256",name:"maxValuePerUse"},{type:"tuple",name:"valueLimit",components:[{type:"uint8",name:"limitType"},{type:"uint256",name:"limit"},{type:"uint256",name:"period"}]}]}
326,{type:"bytes32",name:"uid"}]},{type:"bytes",name:"signature"}],KZ=[];function JZ(e){const t=lu(async()=>"asyncParams"in e?await e.asyncParams():e);return Is({contract:e.contract,method:[qZ,GZ,KZ],params:async()=>{const n=await t();return[n.sessionSpec,n.signature]},value:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.value},accessList:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.accessList},gas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.gas},gasPrice:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.gasPrice},maxFeePerGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.maxFeePerGas},maxPriorityFeePerGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.maxPriorityFeePerGas},nonce:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.nonce},extraGas:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.extraGas},erc20Value:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.erc20Value},authorizationList:async()=>{var n;return(n=(await t()).overrides)==null?void 0:n.authorizationList}})}var x4;(function(e){e[e.Unlimited=0]="Unlimited",e[e.Lifetime=1]="Lifetime",e[e.Allowance=2]="Allowance"})(x4||(x4={}));var I4;(function(e){e[e.Unconstrained=0]="Unconstrained",e[e.Equal=1]="Equal",e[e.Greater=2]="Greater",e[e.Less=3]="Less",e[e.GreaterOrEqual=4]="GreaterOrEqual",e[e.LessOrEqual=5]="LessOr
326Equal",e[e.NotEqual=6]="NotEqual"})(I4||(I4={}));const XZ=[{name:"limitType",type:"uint8"},{name:"limit",type:"uint256"},{name:"period",type:"uint256"}],eq=[{name:"condition",type:"uint8"},{name:"index",type:"uint64"},{name:"refValue",type:"bytes32"},{name:"limit",type:"UsageLimit"}],tq=[{name:"target",type:"address"},{name:"selector",type:"bytes4"},{name:"maxValuePerUse",type:"uint256"},{name:"valueLimit",type:"UsageLimit"},{name:"constraints",type:"Constraint[]"}],nq=[{name:"target",type:"address"},{name:"maxValuePerUse",type:"uint256"},{name:"valueLimit",type:"UsageLimit"}],iq=[{name:"signer",type:"address"},{name:"isWildcard",type:"bool"},{name:"expiresAt",type:"uint256"},{name:"callPolicies",type:"CallSpec[]"},{name:"transferPolicies",type:"TransferSpec[]"},{name:"uid",type:"bytes32"}];function rq(e){const{contract:t,account:n,sessionKeyAddress:i,durationInSeconds:r,grantFullPermissions:s,callPolicies:o,transferPolicies:c}=e;if(r<=0)throw new Error("durationInSeconds must be positive");return JZ({async asyncParams(){const l={callPolicies:(o||[]).map(d=>({constraints:(d.constraints||[]).map(f=>({condition:Number(f.condition),index:f.index||BigInt(0),limit:f.limit?{limit:f.limit.limit,limitType:Number(f.limit.limitType),period:f.limit.period}
326:{limit:BigInt(0),limitType:0,period:BigInt(0)},refValue:f.refValue||"0x"})),maxValuePerUse:d.maxValuePerUse||BigInt(0),selector:d.selector,target:d.target,valueLimit:d.valueLimit?{limit:d.valueLimit.limit,limitType:Number(d.valueLimit.limitType),period:d.valueLimit.period}:{limit:BigInt(0),limitType:0,period:BigInt(0)}})),expiresAt:BigInt(Math.floor(Date.now()/1e3)+r),isWildcard:s??!0,signer:i,transferPolicies:(c||[]).map(d=>({maxValuePerUse:d.maxValuePerUse||BigInt(0),target:d.target,valueLimit:d.valueLimit?{limit:d.valueLimit.limit,limitType:Number(d.valueLimit.limitType),period:d.valueLimit.period}:{limit:BigInt(0),limitType:0,period:BigInt(0)}})),uid:await cu()},u=await n.signTypedData({domain:{chainId:t.chain.id,name:"MinimalAccount",verifyingContract:t.address,version:"1"},message:l,primaryType:"SessionSpec",types:{CallSpec:tq,Constraint:eq,SessionSpec:iq,TransferSpec:nq,UsageLimit:XZ}});return{sessionSpec:l,signature:u}},contract:t,overrides:e.overrides})}const sq=()=>{const{user:e}=L4(),t=ht(),{defaultChain:n,serverWalletAddress:i}=j4(),r=_.useRef(!1);return{ensureSessionKey:_.useCallback(async(o,c)=>{var u,d;if(!(e!=null&&e.id)||!t||!fs||r.current)return;if(!i){console.warn("[SessionKey] serverWalletAddress not configured — cannot register session key");return}const{data:l}=await Ft.from("user_wallets").select("session_key_address").eq("user_id",e.id).eq("wallet_address",o).single();if((l==null?void 0:l.session_key_address)!==i){r.current=!0;try{const m=zt({address:o,chain:c||n,client:fs}),y=rq({account:t,contract:m,sessionKeyAddress:i,durationInSeconds:86400*365,grantFullPermissions:!0});await za({account:t,transaction:y}),await Ft.from("user_wallets").update({session_key_address:i}).eq("user_id",e.id).eq("wallet_address",o)}catch(f){(u=f==null?void 0:f.message)!=null&&u.includes("rejected")||(d=f==null?void 0:f.message)!=null&&d.includes("denied")?console.warn("[SessionKey] User rejected transaction"):console.error("[SessionKey] Failed to create session key:",f==null?void 0:f.message)}finally{r.current=!1}}},[e==null?void 0:e.id,t,n,i])}},kG=()=>{const{autoLinkWallet:e}=ZZ(),{ensureSessionKey:t}=sq(),{disconnect:n}=oc();return{handleConnect:_.useCallback(async r=>{var u;const s=r.getAccount();if(!(s!=null&&s.address))return;const o=(u=r.getChain())==null?void 0:u.id,c=await e(s.address,o);if(c==="owned_by_other"){n(r);return}if(c==="mismatch"){be.warning("Wallet diferente da registrada. Desconecte e use sua wallet principal.",{duration:5e3}),n(r);return}const l=o?Lt(o):void 0;t(s.address,l)},[e,t,n])}},zG=[vw({auth:{options:["google","email","passkey","apple"]},executionMode:{mode:"EIP7702",sponsorGas:!0}})];function PG(e,t){const n=t||e6;return n?{[e]:[{address:n,name:"RadCredit",symbol:"RADC"}]}:{}}export{dm as $,Su as A,w3 as B,Lx as C,cQ as D,OM as E,Bs as F,_3 as G,ML as H,dt as I,vL as J,Lv as K,Mt as L,Me as M,AG as N,qv as O,Mo as P,Ox as Q,Fq as R,U as S,ku as T,Wq as U,$q as V,vv as W,wi as X,DG as Y,Ss as Z,To as _,kG as a,hp as a$,h$ as a0,A5 as a1,Qu as a2,k1 as a3,ql as a4,lt as a5,jo as a6,ym as a7,gV as a8,Ka as a9,MG as aA,CG as aB,Rc as aC,f1 as aD,Bq as aE,fc as aF,Pq as aG,y3 as aH,Vq as aI,Nu as aJ,VM as aK,Rq as aL,Uq as aM,O8 as aN,cj as aO,uu as aP,Cj as aQ,NZ as aR,kx as aS,QZ as aT,c8 as aU,xq as aV,l8 as aW,u8 as aX,d8 as aY,a8 as aZ,dp as a_,Kb as aa,Ms as ab,F$ as ac,Xi as ad,hl as ae,Tt as af,vr as ag,Oq as ah,e9 as ai,B8 as aj,Y8 as ak,G8 as al,kq as am,Q8 as an,Af as ao,Nk as ap,xG as aq,x2 as ar,T_ as as,Ha as at,Tk as au,E_ as av,Ak as aw,IG as ax,bG as ay,Vl as az,yj as b,bq as b0,Sq as b1,Tq as b2,p8 as b3,Eq as b4,Cq as b5,Nq as b6,jq as b7,Iq as b8,_8 as b9,w8 as ba,Lq as bb,vq as bc,wp as bd,Dq as be,vf as bf,Mq as bg,pp as bh,Aq as bi,P5 as bj,$y as bk,AS as bl,NS as bm,o8 as bn,Ot as bo,m9 as bp,zq as bq,zf as br,Yq as bs,xZ as bt,gj as c,lc as d,vl as e,Ef as f,PG as g,yw as h,hj as i,Ew as j,OG as k,Tx as l,Ex as m,pi as n,p1 as o,fj as p,Hq as q,zG as r,h8 as s,fs as t,ZZ as u,up as v,D9 as w,h1 as x,b as y,D as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.