"use strict";var e=require("react/jsx-runtime"),r=require("lucide-react"),i=require("react"),t=require("styled-components"),s=require("./context-rs-ygOK2.js"),o=require("./modal-context-BgeioxwT.js"),n=require("./styles-COEGLFkM.js"),u=require("./styles-Dlyi5Dtd.js"),c=require("./index-BoiKFBqR.js");require("@privy-io/js-sdk-core"),require("tinycolor2"),require("./internal-context-CdsQ3LEl.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("eventemitter3"),require("./events-context-Di6--rDg.js"),require("./privy-context-UTJouJ1x.js"),require("@privy-io/are-addresses-equal"),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("./ScreenLayout-DaFW0I3a.js"),require("./ModalHeader-Cpls13mi.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("./Screen-8NusMFtu.js"),require("./index-ByFhjjzH.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");const l={component:()=>{let t=c.useAddFundsStore(),{onUserCloseViaDialogOrKeybindRef:l}=o.usePrivyModal(),j=s.useAppConfig(),p=i.useRef(!1);i.useEffect((()=>{t&&(p.current=!1)}),[t]);let h=i.useCallback((async()=>{!p.current&&t&&(p.current=!0,c.resetAddFundsStore(),await t.onCancel())}),[t]);if(i.useEffect((()=>(l.current=h,()=>{l.current===h&&(l.current=null)})),[h,l]),!t)return null;if(t.error)/*#__PURE__*/return e.jsx(u.CompactScreenLayout,{icon:r.Banknote,iconVariant:"warning",title:"Unable to add funds",subtitle:t.error,showClose:!0,onClose:h,primaryCta:{label:"Close",onClick:h}});/*#__PURE__*/return e.jsx(u.CompactScreenLayout,{icon:r.Banknote,iconVariant:"subtle",title:"Select method",subtitle:"Choose how to fund your wallet",showClose:!0,onClose:h,children:/*#__PURE__*/e.jsxs(n.ScrollContainer,{style:{marginTop:"1rem"},$colorScheme:j.appearance.palette.colorScheme,children:[t.startFiat&&/*#__PURE__*/e.jsxs(u.OptionButton,{onClick:async()=>{p.current||(p.current=!0,await(t.startFiat?.()))},children:[/*#__PURE__*/e.jsx(a,{children:/*#__PURE__*/e.jsx(r.CreditCard,{})}),/*#__PURE__*/e.jsxs(d,{children:[/*#__PURE__*/e.jsx(u.OptionLabel,{children:"Pay with fiat"}),/*#__PURE__*/e.jsx(q,{children:"Apple Pay, Google Pay, or debit card"})]})]}),t.startCrypto&&/*#__PURE__*/e.jsxs(u.OptionButton,{onClick:async()=>{p.current||(p.current=!0,await(t.startCrypto?.()))},children:[/*#__PURE__*/e.jsx(a,{children:/*#__PURE__*/e.jsx(r.QrCode,{})}),/*#__PURE__*/e.jsxs(d,{children:[/*#__PURE__*/e.jsx(u.OptionLabel,{children:"Transfer from wallet"}),/*#__PURE__*/e.jsx(q,{children:"Send crypto from any wallet"})]})]})]})})}};let a=t.styled.span`
  width: 2rem;
  height: 2rem;
  border-radius: var(--privy-border-radius-full);
  background-color: var(--privy-color-background-2);
  color: var(--color-icon-muted, #64668b);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  svg {
    width: 1.125rem;
    height: 1.125rem;
  }
`,d=t.styled.span`
  display: flex;
  flex-direction: column;
  align-items: flex-start;
`,q=t.styled.span`
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--privy-color-foreground-3);
`;exports.AddFundsSelectionScreen=l,exports.default=l;
//# sourceMappingURL=AddFundsSelectionScreen-Dl3-WlRI.js.map
