import{jsx as e,jsxs as t}from"react/jsx-runtime";import{FileCheck as r,ExternalLink as o}from"lucide-react";import"react";import{styled as i}from"styled-components";import{a as s}from"./ModalHeader-DffkxvO4.mjs";import{u as m}from"./context-BKnOUECq.mjs";import{u as n}from"./internal-context-dfitw7Ot.mjs";import{u as a}from"./modal-context-DBwfUxD-.mjs";import{u as l}from"./privy-context-Bi6vqCPc.mjs";import{s as c}from"./shouldProceedtoEmbeddedWalletCreationFlow-SyjOJUom.mjs";import{S as p}from"./ScreenLayout-Caq5mGD8.mjs";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"@privy-io/js-sdk-core";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"tinycolor2";import"@privy-io/are-addresses-equal";import"./index-C5jxD-zy.mjs";import"./toViemAccount-4iGGrW4w.mjs";import"jose";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"@privy-io/popup";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"./Screen-D8KNyGVj.mjs";import"./index-Dq_xe9dz.mjs";const d={component:()=>{let{user:t,logout:r}=l(),{onUserCloseViaDialogOrKeybindRef:o,setModalData:i,navigate:s}=a(),p=m(),{acceptTerms:d,closePrivyModal:y,createAnalyticsEvent:j}=n(),v=e=>{e?.preventDefault(),y({shouldCallAuthOnSuccess:!1}),r()};o.current=v;/*#__PURE__*/return e(u,{termsAndConditionsUrl:p?.legal.termsAndConditionsUrl,privacyPolicyUrl:p?.legal.privacyPolicyUrl,onAccept:async e=>{e?.preventDefault(),await d(),t&&c(t,p.embeddedWallets)?(i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),j({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AffirmativeConsentScreen"}}),r()},callAuthOnSuccessOnClose:!0}}),s("EmbeddedWalletOnAccountCreateScreen")):y()},onDecline:v})}},u=({termsAndConditionsUrl:i,privacyPolicyUrl:m,onAccept:n,onDecline:a,title:l="One last step",subtitle:c="By signing up, you agree to our terms and privacy policy."})=>/*#__PURE__*/e(p,{title:l,subtitle:c,icon:r,primaryCta:{label:"Accept",onClick:n},secondaryCta:{label:"No thanks",onClick:a},watermark:!0,children:(i||m)&&/*#__PURE__*/t(y,{children:[i&&/*#__PURE__*/t(s,{variant:"muted",href:i,target:"_blank",size:"lg",style:{justifyContent:"space-between"},as:"a",children:["View Terms",/*#__PURE__*/e(o,{width:16,height:16,strokeWidth:2.25})]}),m&&/*#__PURE__*/t(s,{variant:"muted",href:m,target:"_blank",size:"lg",style:{justifyContent:"space-between"},as:"a",children:["View Privacy Policy",/*#__PURE__*/e(o,{width:16,height:16,strokeWidth:2.25})]})]})});let y=i.div`
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: var(--screen-space);
`;export{d as AffirmativeConsentScreen,u as AffirmativeConsentScreenView,d as default};
//# sourceMappingURL=AffirmativeConsentScreen-DqS-kE9s.mjs.map
