import"./rolldown-runtime.js";import{n as e,t}from"./jsx-runtime.js";import{Mt as n,T as r,Vt as i,j as a}from"./useActiveWallet-CEs8euQ3.js";import{k as o}from"./context-Cdw68BC2.js";import"./index-CKYEOQWW.js";import{t as s}from"./modal-context-DHfp-mFQ.js";import{t as c}from"./createLucideIcon.js";import{t as l}from"./external-link.js";import{d as u}from"./ModalHeader-BS54PZSj.js";import{t as d}from"./ScreenLayout-Dy-3vlz4.js";import{t as f}from"./shouldProceedtoEmbeddedWalletCreationFlow-Zce_uO5W.js";var p=c(`file-check`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]),m=t();e(),a();var h={component:()=>{let{user:e,logout:t}=n(),{onUserCloseViaDialogOrKeybindRef:r,setModalData:a,navigate:c}=s(),l=o(),{acceptTerms:u,closePrivyModal:d,createAnalyticsEvent:p}=i(),h=e=>{e?.preventDefault(),d({shouldCallAuthOnSuccess:!1}),t()};return r.current=h,(0,m.jsx)(g,{termsAndConditionsUrl:l?.legal.termsAndConditionsUrl,privacyPolicyUrl:l?.legal.privacyPolicyUrl,onAccept:async n=>{n?.preventDefault(),await u(),e&&f(e,l.embeddedWallets)?(a({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),p({eventName:`embedded_wallet_creation_failure_logout`,payload:{error:e,screen:`AffirmativeConsentScreen`}}),t()},callAuthOnSuccessOnClose:!0}}),c(`EmbeddedWalletOnAccountCreateScreen`)):d()},onDecline:h})}},g=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:n,onDecline:r,title:i=`One last step`,subtitle:a=`By signing up, you agree to our terms and privacy policy.`})=>(0,m.jsx)(d,{title:i,subtitle:a,icon:p,primaryCta:{label:`Accept`,onClick:n},secondaryCta:{label:`No thanks`,onClick:r},watermark:!0,children:(e||t)&&(0,m.jsxs)(_,{children:[e&&(0,m.jsxs)(u,{variant:`muted`,href:e,target:`_blank`,size:`lg`,style:{justifyContent:`space-between`},as:`a`,children:[`View Terms`,(0,m.jsx)(l,{width:16,height:16,strokeWidth:2.25})]}),t&&(0,m.jsxs)(u,{variant:`muted`,href:t,target:`_blank`,size:`lg`,style:{justifyContent:`space-between`},as:`a`,children:[`View Privacy Policy`,(0,m.jsx)(l,{width:16,height:16,strokeWidth:2.25})]})]})}),_=r.div`
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: var(--screen-space);
`;export{h as AffirmativeConsentScreen,h as default,g as AffirmativeConsentScreenView};