import{o as e}from"./rolldown-runtime.js";import{Gn as t,N as n,j as r,xt as i}from"./useActiveWallet-CEs8euQ3.js";import{N as a}from"./context-Cdw68BC2.js";var o=e(r(),1);function s(e){return{name:e.metadata?.shortName||e.name||``,universalLink:e.mobile.universal,deepLink:e.mobile.native}}function c(e,t){let n=s(t);if(o.isMobile&&o.isAndroid&&n.universalLink)return h(n.universalLink,e);if(n.deepLink)return m(n.deepLink,e);if(n.universalLink)return h(n.universalLink,e);throw new i(`Unsupported wallet ${t.id}`)}function l(e,t){let n=s(t);if(n.universalLink)return h(n.universalLink,e)}var u=`WALLETCONNECT_DEEPLINK_CHOICE`;function d(){try{localStorage.removeItem(u)}catch{}}function ee({href:e,name:t}){try{localStorage.setItem(u,JSON.stringify({href:e,name:t}))}catch{}}function f(){try{localStorage.removeItem(u)}catch{}}function p(e){return e.startsWith(`http://`)||e.startsWith(`https://`)}function m(e,t){if(p(e))return h(e,t);let n=e;return n.includes(`://`)||(n=e.replaceAll(`/`,``).replaceAll(`:`,``),n=`${n}://`),n.endsWith(`/`)||(n=`${n}/`),{redirect:`${n}wc?uri=${encodeURIComponent(t)}`,href:n}}function h(e,t){if(!p(e))return m(e,t);let n=e;return n.endsWith(`/`)||(n=`${n}/`),{redirect:`${n}wc?uri=${encodeURIComponent(t)}`,href:n}}function g(e,t){window.open(e,t,`noreferrer noopener`)}function _(e){return crypto.getRandomValues(new Uint8Array(e))}function v(){return t(_(36))}function y(){return v()}async function b(e,n=`S256`){if(n!=`S256`)return e;{let n=await async function(e){let t=new TextEncoder().encode(e);return new Uint8Array(await crypto.subtle.digest(`SHA-256`,t))}(e);return t(n)}}function x(){let e=n.get(a);if(!e)throw new i(`Authentication error.`);return e}var S=`/api/v1/sessions`,C=`/api/v1/sessions/logout`,w=`/api/v1/siwe/init`,T=`/api/v1/siwe/authenticate`,E=`/api/v1/siwe/link`,D=`/api/v1/siwe/link_smart_wallet`,O=`/api/v1/siwe/unlink`,k=`/api/v1/siwe/transfer`,A=`/api/v1/siws/init`,j=`/api/v1/siws/authenticate`,M=`/api/v1/siws/link`,N=`/api/v1/siws/unlink`,P=`/api/v1/siws/transfer`,F=`/api/v1/farcaster/init`,I=`/api/v1/farcaster/authenticate`,L=`/api/v1/farcaster/link`,R=`/api/v1/farcaster/status`,z=`/api/v1/farcaster/unlink`,B=`/api/v1/farcaster/transfer`,V=`/api/v1/passwordless/init`,H=`/api/v1/passwordless/authenticate`,U=`/api/v1/passwordless/link`,W=`/api/v1/passwordless/unlink`,G=`/api/v1/passwordless/update`,K=`/api/v1/passwordless/transfer`,q=`/api/v1/passwordless_sms/init`,J=`/api/v1/passwordless_sms/link`,Y=`/api/v1/passwordless_sms/unlink`,X=`/api/v1/passwordless_sms/authenticate`,Z=`/api/v1/passwordless_sms/update`,te=`/api/v1/passwordless_sms/transfer`,Q=`/api/v1/oauth/init`,ne=`/api/v1/oauth/authenticate`,re=`/api/v1/oauth/link`,ie=`/api/v1/oauth/unlink`,ae=`/api/v1/oauth/transfer`,oe=`/api/v1/recovery/oauth/init`,se=`/api/v1/recovery/oauth/init_icloud`,ce=`/api/v1/recovery/oauth/authenticate`,le=`/api/v1/passkeys/link/init`,ue=`/api/v1/passkeys/authenticate/init`,de=`/api/v1/passkeys/register/init`,fe=`/api/v1/passkeys/link`,pe=`/api/v1/passkeys/authenticate`,me=`/api/v1/passkeys/register`,he=`/api/v1/telegram/authenticate`,ge=`/api/v1/telegram/link`,_e=`/api/v1/telegram/unlink`,ve=`/api/v1/telegram/transfer`,ye=`/api/v1/mfa/passwordless_sms/init`,be=`/api/v1/mfa/passkeys/init`,$=`/api/v1/users/me/accept_terms`,xe=`/api/v1/analytics_events`,Se=`/api/v1/custom_jwt_account/authenticate`,Ce=`/api/v1/custom_jwt_account/link`,we=`/api/v1/guest/authenticate`,Te=`/api/v1/plugins/moonpay_on_ramp/sign`,Ee=`/api/v1/funding/coinbase_on_ramp/init`,De=`/api/v1/funding/coinbase_on_ramp/status`,Oe=`/api/v1/wallets/revoke`,ke=`/api/v1/users/me`,Ae=`/api/v1/scan/transaction`;export{T as $,H as A,N as B,ge as C,z as D,ye as E,R as F,ke as G,O as H,w as I,G as J,D as K,Se as L,E as M,we as N,S as O,B as P,xe as Q,U as R,he as S,ve as T,Ee as U,L as V,j as W,Oe as X,A as Y,C as Z,ue as _,v as _t,X as a,F as at,pe as b,Q as c,K as ct,ie as d,d as dt,Ce as et,ae as f,x as ft,le as g,l as gt,ce as h,f as ht,Y as i,De as it,P as j,$ as k,ne as l,_ as lt,se as m,ee as mt,q as n,Ae as nt,Z as o,W as ot,oe as p,y as pt,Te as q,J as r,k as rt,te as s,V as st,be as t,M as tt,re as u,c as ut,de as v,g as vt,_e as w,me as x,fe as y,b as yt,I as z};