import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t}from"lucide-react";import{useEffect as o}from"react";import{u as r,b as i,d as s}from"./privy-context-Bi6vqCPc.mjs";import{u as m,s as c}from"./context-BKnOUECq.mjs";import{u as n}from"./internal-context-dfitw7Ot.mjs";import{u as a}from"./modal-context-DBwfUxD-.mjs";import{S as l}from"./ScreenLayout-Caq5mGD8.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-DffkxvO4.mjs";import"styled-components";import"./useActiveWallet-BEfvREjE.mjs";import"viem/utils";import"./wallet-connect-58EobR5U.mjs";import"./errors-Dd6zfYtp.mjs";import"ofetch";import"./getPublicClient-D4yNgeGy.mjs";import"viem";import"viem/chains";import"eventemitter3";import"./events-context-BJ75xIIf.mjs";import"./index-BtwxknTg.mjs";import"zustand";import"react-device-detect";import"./get-entropy-details-for-user-BIWg0YxF.mjs";import"./user-D5cqJNp9.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 u=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(l,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),p={component:()=>{let{user:t}=r(),{closePrivyModal:l,isNewUserThisSession:p,updateWallets:d}=n(),{data:j,onUserCloseViaDialogOrKeybindRef:f}=a(),h=m(),{onSuccess:v,onFailure:y,callAuthOnSuccessOnClose:x}=j.createWallet,S=()=>{let e=i(t)??s(t);t&&e?(d(),v({user:t,account:e})):y(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:x})};o((()=>{let e=setTimeout(S,c);return()=>clearTimeout(e)}),[]),f.current=S;let A=p&&!((t?.linkedAccounts?.length??0)>1);/*#__PURE__*/return e(u,{title:A?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:A?"You've successfully created an account.":"Your account is secured.",onClose:S})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
//# sourceMappingURL=EmbeddedWalletCreatedScreen-Bhhf-uyT.mjs.map
