"use strict";var e=require("react/jsx-runtime"),r=require("lucide-react");require("react");var i=require("styled-components"),t=require("./ModalHeader-Cpls13mi.js"),s=require("./context-rs-ygOK2.js"),n=require("./internal-context-CdsQ3LEl.js"),o=require("./modal-context-BgeioxwT.js"),u=require("./privy-context-UTJouJ1x.js"),a=require("./shouldProceedtoEmbeddedWalletCreationFlow-DTSTIV1u.js"),l=require("./ScreenLayout-DaFW0I3a.js");require("./useActiveWallet-dTc6deka.js"),require("viem/utils"),require("./wallet-connect-BuohfvHK.js"),require("./errors-CBapWvRs.js"),require("ofetch"),require("./getPublicClient-CFd_sHBk.js"),require("viem"),require("viem/chains"),require("@privy-io/js-sdk-core"),require("eventemitter3"),require("./events-context-Di6--rDg.js"),require("./index-Ub4KpwSY.js"),require("zustand"),require("react-device-detect"),require("./get-entropy-details-for-user-D63rM5_a.js"),require("./user-D2oPA-vS.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("tinycolor2"),require("@privy-io/are-addresses-equal"),require("./index-BoiKFBqR.js"),require("./toViemAccount-CopJpCYv.js"),require("jose"),require("@coinbase/wallet-sdk"),require("@walletconnect/ethereum-provider"),require("./pkce-CmuJlEgn.js"),require("./paths-DizMb-lU.js"),require("./PrivyPluginContext-DsLtVhZA.js"),require("js-cookie"),require("@privy-io/ethereum"),require("viem/accounts"),require("mipd"),require("@scure/base"),require("./usePrivy-Dt4_yE6Q.js"),require("./use-unlink-wallet-DAxmY7kq.js"),require("@privy-io/popup"),require("@headlessui/react"),require("@privy-io/urls"),require("./getEmbeddedConnectedWallet-D6YL2FS9.js"),require("./frame-BHa-PKpX.js"),require("@privy-io/routes"),require("./use-deposit-address-CVyd0fqP.js"),require("x402/client"),require("@privy-io/api-base"),require("./use-sign-with-user-signer-BhoaqeNG.js"),require("./Screen-8NusMFtu.js"),require("./index-ByFhjjzH.js");const c={component:()=>{let{user:r,logout:i}=u.usePrivyContext(),{onUserCloseViaDialogOrKeybindRef:t,setModalData:l,navigate:c}=o.usePrivyModal(),q=s.useAppConfig(),{acceptTerms:p,closePrivyModal:y,createAnalyticsEvent:j}=n.usePrivyInternal(),v=e=>{e?.preventDefault(),y({shouldCallAuthOnSuccess:!1}),i()};t.current=v;/*#__PURE__*/return e.jsx(d,{termsAndConditionsUrl:q?.legal.termsAndConditionsUrl,privacyPolicyUrl:q?.legal.privacyPolicyUrl,onAccept:async e=>{e?.preventDefault(),await p(),r&&a.shouldProceedtoEmbeddedWalletCreationFlow(r,q.embeddedWallets)?(l({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),j({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AffirmativeConsentScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")):y()},onDecline:v})}},d=({termsAndConditionsUrl:i,privacyPolicyUrl:s,onAccept:n,onDecline:o,title:u="One last step",subtitle:a="By signing up, you agree to our terms and privacy policy."})=>/*#__PURE__*/e.jsx(l.ScreenLayout,{title:u,subtitle:a,icon:r.FileCheck,primaryCta:{label:"Accept",onClick:n},secondaryCta:{label:"No thanks",onClick:o},watermark:!0,children:(i||s)&&/*#__PURE__*/e.jsxs(q,{children:[i&&/*#__PURE__*/e.jsxs(t.Button,{variant:"muted",href:i,target:"_blank",size:"lg",style:{justifyContent:"space-between"},as:"a",children:["View Terms",/*#__PURE__*/e.jsx(r.ExternalLink,{width:16,height:16,strokeWidth:2.25})]}),s&&/*#__PURE__*/e.jsxs(t.Button,{variant:"muted",href:s,target:"_blank",size:"lg",style:{justifyContent:"space-between"},as:"a",children:["View Privacy Policy",/*#__PURE__*/e.jsx(r.ExternalLink,{width:16,height:16,strokeWidth:2.25})]})]})});let q=i.styled.div`
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: var(--screen-space);
`;exports.AffirmativeConsentScreen=c,exports.AffirmativeConsentScreenView=d,exports.default=c;
//# sourceMappingURL=AffirmativeConsentScreen-gb6nHqLi.js.map
