import{o as e}from"./rolldown-runtime.js";import{n as t,t as n}from"./jsx-runtime.js";import{A as r,St as i,Vt as a,_t as o,j as s}from"./useActiveWallet-CEs8euQ3.js";import{k as c}from"./context-Cdw68BC2.js";import{t as l}from"./modal-context-DHfp-mFQ.js";import{n as u}from"./ConnectWalletView-INqAsNoN.js";import{n as d}from"./QrCode-BVnyWVuE.js";var f=n(),p=e(t(),1);s(),d();var m={component:()=>{let{setWalletConnectionStatus:e,closePrivyModal:t,inProgressAuthFlowRef:n}=a(),{data:s,navigate:d}=l(),m=c(),h=r(),g=s?.externalConnectWallet?.description,_=(0,p.useRef)(s?.externalConnectWallet?.walletList??m.appearance.walletList),v=(0,p.useRef)(s?.externalConnectWallet?.walletChainType??m.appearance.walletChainType),y=_.current,b=v.current,x=n.current===`link`?void 0:()=>d(`LandingScreen`);return(0,f.jsx)(u,{walletList:y,walletChainType:b,onClose:t,onConnect:(0,p.useCallback)((({connector:t,wallet:n})=>{h(`connectWallet`,`onSuccess`,{wallet:n}),e({status:`connected`,connectedWallet:n,connector:t,connectError:null,connectRetry:()=>null}),d(`ConnectionStatusScreen`,!s?.externalConnectWallet?.preSelectedWalletId)}),[e,d,s?.login?.disableSignup,s?.externalConnectWallet?.preSelectedWalletId]),onConnectError:e=>{e instanceof i?(console.warn(e.cause?e.cause:e.message),h(`connectWallet`,`onError`,e.privyErrorCode||o.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),h(`connectWallet`,`onError`,o.UNKNOWN_CONNECT_WALLET_ERROR))},onBack:x,customDescription:g||``,preSelectedWalletId:s?.externalConnectWallet?.preSelectedWalletId,app:m})},isUnauthenticatedScreem:!0};export{m as AuthenticateWithWalletScreen,m as default};