import{jsx as t}from"react/jsx-runtime";import{FingerprintIcon as e}from"lucide-react";import{a as o}from"./index-C5jxD-zy.mjs";import{u as i}from"./internal-context-dfitw7Ot.mjs";import{u as r}from"./modal-context-DBwfUxD-.mjs";import{S as a}from"./ScreenLayout-Caq5mGD8.mjs";import"react";import"@privy-io/js-sdk-core";import"./toViemAccount-4iGGrW4w.mjs";import"jose";import"./privy-context-Bi6vqCPc.mjs";import"@privy-io/are-addresses-equal";import"eventemitter3";import"./index-BtwxknTg.mjs";import"zustand";import"./context-BKnOUECq.mjs";import"tinycolor2";import"viem";import"viem/utils";import"./errors-Dd6zfYtp.mjs";import"ofetch";import"./wallet-connect-58EobR5U.mjs";import"./getPublicClient-D4yNgeGy.mjs";import"viem/chains";import"react-device-detect";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./pkce-BinverJO.mjs";import"./paths-BH8W4zMc.mjs";import"./PrivyPluginContext-DA-yS5vO.mjs";import"js-cookie";import"@privy-io/ethereum";import"viem/accounts";import"mipd";import"@scure/base";import"./usePrivy-BhL-ltvm.mjs";import"./use-unlink-wallet-oAguM2-k.mjs";import"./get-entropy-details-for-user-BIWg0YxF.mjs";import"./user-D5cqJNp9.mjs";import"@privy-io/popup";import"./events-context-BJ75xIIf.mjs";import"styled-components";import"./useActiveWallet-BEfvREjE.mjs";import"@headlessui/react";import"@privy-io/urls";import"./getEmbeddedConnectedWallet-Ba6LFHzY.mjs";import"./frame-DtizlaLu.mjs";import"@privy-io/routes";import"./use-deposit-address-BwThybOQ.mjs";import"x402/client";import"@privy-io/api-base";import"./use-sign-with-user-signer-CQI6hUH7.mjs";import"./ModalHeader-DffkxvO4.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-D8KNyGVj.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:o="Log in or create a new account?",subtitle:i="Create a new account with a passkey or use a passkey to log in to an existing account.",onSignup:r,onLogin:s})=>/*#__PURE__*/t(a,{title:o,subtitle:i,icon:e,primaryCta:{label:"Create new account",onClick:r},secondaryCta:{label:"Log in with a passkey",onClick:s},watermark:!0}),n={component:()=>{let{enabled:e,token:a}=o(),{navigate:n,setModalData:m}=r(),{initSignupWithPasskey:p,initLoginWithPasskey:c}=i();/*#__PURE__*/return t(s,{onSignup:async()=>{e&&!a?(m({passkeyAuthModalData:{passkeySignupFlow:!0},captchaModalData:{callback:t=>p({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await p({withPrivyUi:!0,captchaToken:a}),m({passkeyAuthModalData:{passkeySignupFlow:!0}}),n("PasskeyStatusScreen"))},onLogin:async()=>{e&&!a?(m({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:t=>c({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await c({withPrivyUi:!0,captchaToken:a}),m({passkeyAuthModalData:{passkeySignupFlow:!1}}),n("PasskeyStatusScreen"))}})}};export{n as PasskeySelectSignupOrLogin,s as PasskeySelectSignupOrLoginView,n as default};
//# sourceMappingURL=PasskeySelectSignupOrLogin-DJR_ZRbZ.mjs.map
