@privy-io/react-auth 3.16.0 → 3.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/dist/cjs/AccountNotFoundScreen-B_Ii7HuZ.js +1 -0
  2. package/dist/cjs/{Address-DTfphH3Q.js → Address-DVa7_frc.js} +1 -1
  3. package/dist/cjs/AffirmativeConsentScreen-B7KmE68B.js +6 -0
  4. package/dist/cjs/AllowlistRejectionScreen-O8KznddG.js +1 -0
  5. package/dist/cjs/AuthenticateWithWalletScreen-C8K-iZIK.js +1 -0
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-cOTXpUAv.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-yMOq8AmY.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-lFFqycAd.js +103 -0
  9. package/dist/cjs/AwaitingSolToEvmBridgingScreen-DmvP14kc.js +2 -0
  10. package/dist/cjs/{BridgeNetworkSelectionView-xdYr4mxx.js → BridgeNetworkSelectionView-pkX-b3EU.js} +3 -3
  11. package/dist/cjs/CaptchaScreen-C0GEjNbh.js +1 -0
  12. package/dist/cjs/CoinbaseOnrampStatusScreen-yT0aNgm6.js +16 -0
  13. package/dist/cjs/ConnectEmailForm-BBb0J8Qw.js +3 -0
  14. package/dist/cjs/ConnectLedgerScreen-DUt1xIAQ.js +9 -0
  15. package/dist/cjs/ConnectOnlyLandingScreen-DsDH4IPK.js +1 -0
  16. package/dist/cjs/ConnectOnlyStatusScreen-DHifzxdh.js +1 -0
  17. package/dist/cjs/ConnectOrCreateScreen-BUgdLxoo.js +1 -0
  18. package/dist/cjs/{ConnectPhoneForm-BYX8kgCj.js → ConnectPhoneForm-Cz02aWfj.js} +1 -1
  19. package/dist/cjs/{ConnectWalletView-QyJORAZG.js → ConnectWalletView-CWInrfMx.js} +1 -1
  20. package/dist/cjs/ConnectionStatusScreen-BVrAip_u.js +7 -0
  21. package/dist/cjs/CrossAppAuthScreen-BlSprwdt.js +1 -0
  22. package/dist/cjs/{CustomLandingScreenView-Cx9QR2CX.js → CustomLandingScreenView-FFU4u8kB.js} +6 -6
  23. package/dist/cjs/DelegatedActionsConsentScreen-2K48Ywrm.js +1 -0
  24. package/dist/cjs/DelegatedActionsRevokeScreen-AuQpKTzg.js +1 -0
  25. package/dist/cjs/EmbeddedWalletConnectingScreen-C4LTqs6h.js +1 -0
  26. package/dist/cjs/EmbeddedWalletCreatedScreen-C32Uofc9.js +1 -0
  27. package/dist/cjs/{EmbeddedWalletKeyExportScreen-wfa1ho1-.js → EmbeddedWalletKeyExportScreen-SnvHNrgu.js} +4 -4
  28. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-osK2tW68.js +1 -0
  29. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-DKWmdrJ6.js +1 -0
  30. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-DqSEVO7w.js +1 -0
  31. package/dist/cjs/{EnrollTotp-BzmjXzYC.js → EnrollTotp-CXMhvYqd.js} +8 -8
  32. package/dist/cjs/ErrorScreen-CPJ98NuU.js +4 -0
  33. package/dist/cjs/{FarcasterConnectStatusScreen-s3pS-ZH-.js → FarcasterConnectStatusScreen-D13iXt7h.js} +5 -5
  34. package/dist/cjs/FarcasterSignerStatusScreen-Bf_kP9J_.js +29 -0
  35. package/dist/cjs/FiatOnrampScreen-BV4GPQv0.js +97 -0
  36. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-85QbPj5Z.js +2 -0
  37. package/dist/cjs/FundWalletMethodHeader-CcRikV5C.js +1 -0
  38. package/dist/cjs/FundWithBankDepositScreen-CETUOydb.js +58 -0
  39. package/dist/cjs/FundingEditAmountScreen-ro3pfZTg.js +1 -0
  40. package/dist/cjs/FundingMethodSelectionScreen-ecxVf53z.js +1 -0
  41. package/dist/cjs/InAppBrowserLoginNotPossible-BaL0j2oh.js +1 -0
  42. package/dist/cjs/InstallWalletScreen-D8WdMq8Y.js +1 -0
  43. package/dist/cjs/LandingScreen-D3EKQEkC.js +1 -0
  44. package/dist/cjs/{LinkConflictScreen-DnHf7IMX.js → LinkConflictScreen-Ch0YDBOh.js} +3 -3
  45. package/dist/cjs/LinkEmailScreen-BiHRv43F.js +1 -0
  46. package/dist/cjs/{LinkPasskeyScreen-CTN6f7yX.js → LinkPasskeyScreen-BkAhVm_K.js} +12 -12
  47. package/dist/cjs/LinkPhoneScreen-SMbGlFFp.js +1 -0
  48. package/dist/cjs/LoginFailedScreen-gThOR4ql.js +1 -0
  49. package/dist/cjs/ManualTransferScreen-C6_MKYQa.js +1 -0
  50. package/dist/cjs/MfaAuthEnrollmentFlowScreen-BGwEDhYM.js +1 -0
  51. package/dist/cjs/MfaAuthVerifyFlowScreen-FkpTmQLM.js +1 -0
  52. package/dist/cjs/MfaEnrollmentFlowScreen-D68k3d6k.js +1 -0
  53. package/dist/cjs/MfaVerifyFlowScreen-DPiE_Oju.js +1 -0
  54. package/dist/cjs/{ModalHeader-CakS8Dcu.js → ModalHeader-DGIBNq1A.js} +1 -1
  55. package/dist/cjs/MoonpayStatusScreen-Bwey-ZFS.js +16 -0
  56. package/dist/cjs/OAuthStatusScreen-DCIvmlua.js +1 -0
  57. package/dist/cjs/PasskeySelectSignupOrLogin-BrsgZDWY.js +1 -0
  58. package/dist/cjs/PasskeyStatusScreen-CRdrwEDq.js +3 -0
  59. package/dist/cjs/PasswordRecoveryScreen-nT66Ca8q.js +20 -0
  60. package/dist/cjs/{QrCode-C-Mk5-26.js → QrCode-Di8xGbem.js} +1 -1
  61. package/dist/cjs/RecoveryOAuthStatusScreen-BC6heUn-.js +1 -0
  62. package/dist/cjs/RecoveryPasswordCreateScreen-D6M_6kN8.js +1 -0
  63. package/dist/cjs/{RecoverySelectionScreen-BAJ1nLeO.js → RecoverySelectionScreen-BDCnVnE6.js} +2 -2
  64. package/dist/cjs/{Screen-Dp9-H_S8.js → Screen-B1vrS1Ly.js} +1 -1
  65. package/dist/cjs/{ScreenLayout-DANQ0V5E.js → ScreenLayout-yf03MRVf.js} +1 -1
  66. package/dist/cjs/SelectSourceAsset-BzCWfa5L.js +112 -0
  67. package/dist/cjs/SetAutomaticRecoveryScreen-CVn23TKd.js +14 -0
  68. package/dist/cjs/{SetWalletPasswordForm-B7bBDQ8N.js → SetWalletPasswordForm-0S2ymSzL.js} +4 -4
  69. package/dist/cjs/{SignRequestScreen-BUvgSx9X.js → SignRequestScreen-CPgU7Wo3.js} +4 -4
  70. package/dist/cjs/{StandardSignAndSendTransactionScreen-CzfhyIDP.js → StandardSignAndSendTransactionScreen-C-E3j4dP.js} +2 -2
  71. package/dist/cjs/TelegramAuthScreen-DiYpzHoT.js +1 -0
  72. package/dist/cjs/{TransactionDetails-BlPOqfEn.js → TransactionDetails-CHdkf5Rb.js} +1 -1
  73. package/dist/cjs/{TransactionErrorView-BpXI1X_G.js → TransactionErrorView-D1Nh7N_d.js} +4 -4
  74. package/dist/cjs/{TransferFromWalletScreen-Ds1sknGn.js → TransferFromWalletScreen-h9tRPXBH.js} +2 -2
  75. package/dist/cjs/{TransferOrBridgeLoadingScreen-CAYUlR4u.js → TransferOrBridgeLoadingScreen-DQZIn6hw.js} +2 -2
  76. package/dist/cjs/UpdateEmailScreen-BY3xMHK8.js +1 -0
  77. package/dist/cjs/UpdatePhoneScreen-ChbBiqBC.js +1 -0
  78. package/dist/cjs/UserLimitReachedScreen-AJZpREqN.js +1 -0
  79. package/dist/cjs/{WalletInfoCard-CRZt0t3t.js → WalletInfoCard-BfZ3_ji-.js} +6 -6
  80. package/dist/cjs/WalletInterstitialScreen-DRz63LSO.js +1 -0
  81. package/dist/cjs/{WalletLink-Cx_Zda0m.js → WalletLink--xpsJ0_X.js} +5 -5
  82. package/dist/cjs/{WalletOverflowButton-cnlzyqcK.js → WalletOverflowButton-B81EzN7L.js} +1 -1
  83. package/dist/cjs/{WarningBanner-COl_Q0K3.js → WarningBanner-DUcGaIpZ.js} +1 -1
  84. package/dist/cjs/abstract-smart-wallets.js +1 -1
  85. package/dist/cjs/{context-BAmjgwZ7.js → context-DTLyrNSs.js} +1 -1
  86. package/dist/cjs/{ethers-D8g2mvSK.js → ethers-DkYZ2n_L.js} +1 -1
  87. package/dist/cjs/extended-chains.js +1 -1
  88. package/dist/cjs/{getErc20Balance-C6ZUC_1B.js → getErc20Balance-CZkdpSqJ.js} +1 -1
  89. package/dist/cjs/{getErc20TokenInfo-DprFN1Dj.js → getErc20TokenInfo-B7OUw6ca.js} +1 -1
  90. package/dist/cjs/{index-BohqOluI.js → index-BbTBzvbB.js} +5 -5
  91. package/dist/cjs/{index-DIKBRogK.js → index-DLnQPdlD.js} +2 -2
  92. package/dist/cjs/index-DVVwP01f.js +1 -0
  93. package/dist/cjs/index.js +1 -1
  94. package/dist/cjs/internal.js +1 -1
  95. package/dist/cjs/privy-context-CqCBaHHR.js +1 -0
  96. package/dist/cjs/{shared-C-w7sNT2.js → shared-BrHBD7Qj.js} +1 -1
  97. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-DAiUXgPZ.js → shouldProceedtoEmbeddedWalletCreationFlow-By7HZi5X.js} +1 -1
  98. package/dist/cjs/smart-wallets-CXiwZqOu.js +1 -0
  99. package/dist/cjs/smart-wallets.js +1 -1
  100. package/dist/cjs/solana.js +1 -1
  101. package/dist/cjs/{styles-s2f3dL_6.js → styles-BU6XkGeI.js} +4 -4
  102. package/dist/cjs/{to-ui-error-CqnwRcKJ.js → to-ui-error-Bxoctv93.js} +1 -1
  103. package/dist/cjs/ui.js +1 -1
  104. package/dist/cjs/use-export-wallet-B4aMG55I.js +1 -0
  105. package/dist/cjs/use-export-wallet-CJFX3PX0.js +1 -0
  106. package/dist/cjs/{useActiveWallet-CYUR_x0A.js → useActiveWallet-DEJxYDtx.js} +1 -1
  107. package/dist/cjs/{useGetTokenPrice-X3dW0I3y.js → useGetTokenPrice-zMimik1y.js} +1 -1
  108. package/dist/cjs/{useI18n-BsableMs.js → useI18n-CttJorXw.js} +1 -1
  109. package/dist/cjs/usePrivy-B61TDDeF.js +1 -0
  110. package/dist/cjs/{useSolanaRpcClient-BhX1Bzre.js → useSolanaRpcClient-B5g3sWrW.js} +1 -1
  111. package/dist/cjs/{useWalletBalance-CcicA-jd.js → useWalletBalance-BD5uRFtG.js} +1 -1
  112. package/dist/cjs/useWallets-BsO73htS.js +1 -0
  113. package/dist/cjs/useWallets-CAFhVWLf.js +1 -0
  114. package/dist/dts/{events-context-DJ7XN_9I.d.mts → events-context-BXis4NRh.d.mts} +1 -1
  115. package/dist/dts/{events-context-DJ7XN_9I.d.ts → events-context-BXis4NRh.d.ts} +1 -1
  116. package/dist/dts/extended-chains.d.mts +1 -1
  117. package/dist/dts/extended-chains.d.ts +1 -1
  118. package/dist/dts/farcaster.d.mts +1 -1
  119. package/dist/dts/farcaster.d.ts +1 -1
  120. package/dist/dts/index.d.mts +41 -8
  121. package/dist/dts/index.d.ts +41 -8
  122. package/dist/dts/internal.d.mts +1 -1
  123. package/dist/dts/internal.d.ts +1 -1
  124. package/dist/dts/smart-wallets.d.mts +1 -1
  125. package/dist/dts/smart-wallets.d.ts +1 -1
  126. package/dist/dts/solana.d.mts +3 -3
  127. package/dist/dts/solana.d.ts +3 -3
  128. package/dist/dts/{types-CrwMc83t.d.mts → types-Bc9w_mgT.d.mts} +3 -2
  129. package/dist/dts/{types-CrwMc83t.d.ts → types-Bc9w_mgT.d.ts} +3 -2
  130. package/dist/dts/ui.d.mts +1 -1
  131. package/dist/dts/ui.d.ts +1 -1
  132. package/dist/esm/AccountNotFoundScreen-qafr9ivT.mjs +1 -0
  133. package/dist/esm/{Address-Cbulz6Wu.mjs → Address-B99EaiMb.mjs} +1 -1
  134. package/dist/esm/AffirmativeConsentScreen-CIqvK8m6.mjs +6 -0
  135. package/dist/esm/AllowlistRejectionScreen-DU4DWBPE.mjs +1 -0
  136. package/dist/esm/AuthenticateWithWalletScreen-XPD7DrVO.mjs +1 -0
  137. package/dist/esm/AwaitingEvmToSolBridgingScreen-DD0jtqOa.mjs +2 -0
  138. package/dist/esm/AwaitingExternalEthereumTransferScreen-DzTmic9m.mjs +2 -0
  139. package/dist/esm/AwaitingPasswordlessCodeScreen-7QOTS6b-.mjs +103 -0
  140. package/dist/esm/AwaitingSolToEvmBridgingScreen-DYZZooDp.mjs +2 -0
  141. package/dist/esm/{BridgeNetworkSelectionView-nrYQOGZA.mjs → BridgeNetworkSelectionView-CmMVzAX5.mjs} +5 -5
  142. package/dist/esm/CaptchaScreen-DhwS3FJh.mjs +1 -0
  143. package/dist/esm/CoinbaseOnrampStatusScreen-CTrA4xKy.mjs +16 -0
  144. package/dist/esm/ConnectEmailForm-yaDsKJmn.mjs +3 -0
  145. package/dist/esm/ConnectLedgerScreen-O8ZnkCDn.mjs +9 -0
  146. package/dist/esm/ConnectOnlyLandingScreen-BUO28erJ.mjs +1 -0
  147. package/dist/esm/ConnectOnlyStatusScreen-Dy6oAk17.mjs +1 -0
  148. package/dist/esm/ConnectOrCreateScreen-H52RmK3k.mjs +1 -0
  149. package/dist/esm/{ConnectPhoneForm-D8SHd_ge.mjs → ConnectPhoneForm-SXho-ZCl.mjs} +1 -1
  150. package/dist/esm/{ConnectWalletView-By6eXfKl.mjs → ConnectWalletView-mm5nV3qj.mjs} +1 -1
  151. package/dist/esm/ConnectionStatusScreen-XXeNlflJ.mjs +7 -0
  152. package/dist/esm/CrossAppAuthScreen-bAev2vFm.mjs +1 -0
  153. package/dist/esm/{CustomLandingScreenView-Co0nHKPw.mjs → CustomLandingScreenView-e-NPZniC.mjs} +4 -4
  154. package/dist/esm/DelegatedActionsConsentScreen-C2uGvUf3.mjs +1 -0
  155. package/dist/esm/DelegatedActionsRevokeScreen-DIURa5L6.mjs +1 -0
  156. package/dist/esm/EmbeddedWalletConnectingScreen-CznyXfNg.mjs +1 -0
  157. package/dist/esm/EmbeddedWalletCreatedScreen-Vch95Jje.mjs +1 -0
  158. package/dist/esm/EmbeddedWalletKeyExportScreen-kW2-IWjW.mjs +40 -0
  159. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-DtrWxrnI.mjs +1 -0
  160. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-QLodnJ1t.mjs +1 -0
  161. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-B0gtNXG6.mjs +1 -0
  162. package/dist/esm/{EnrollTotp-nZPSS3Ux.mjs → EnrollTotp-Du2Tjgrx.mjs} +5 -5
  163. package/dist/esm/ErrorScreen-P5oZf9cz.mjs +4 -0
  164. package/dist/esm/{FarcasterConnectStatusScreen-BdwUuSkv.mjs → FarcasterConnectStatusScreen-dpPMJ4I7.mjs} +8 -8
  165. package/dist/esm/FarcasterSignerStatusScreen-COkxl1bH.mjs +28 -0
  166. package/dist/esm/FiatOnrampScreen-Ci0mAJY4.mjs +97 -0
  167. package/dist/esm/FundSolWalletWithExternalSolanaWallet-DW0tS4tS.mjs +1 -0
  168. package/dist/esm/FundWalletMethodHeader-D38FBVVM.mjs +1 -0
  169. package/dist/esm/FundWithBankDepositScreen-Dk_IouhM.mjs +58 -0
  170. package/dist/esm/FundingEditAmountScreen-BLsQoL4e.mjs +1 -0
  171. package/dist/esm/FundingMethodSelectionScreen-OlDe5HS2.mjs +1 -0
  172. package/dist/esm/InAppBrowserLoginNotPossible-BV3tTire.mjs +1 -0
  173. package/dist/esm/InstallWalletScreen-BMmSUe34.mjs +1 -0
  174. package/dist/esm/LandingScreen-B83IEgoc.mjs +1 -0
  175. package/dist/esm/{LinkConflictScreen-DNGVg8dW.mjs → LinkConflictScreen-DNiusVkA.mjs} +3 -3
  176. package/dist/esm/LinkEmailScreen-1OEkvtrp.mjs +1 -0
  177. package/dist/esm/{LinkPasskeyScreen-CTYGeo1r.mjs → LinkPasskeyScreen-CHPataTs.mjs} +5 -5
  178. package/dist/esm/LinkPhoneScreen-DiwKH2Mt.mjs +1 -0
  179. package/dist/esm/LoginFailedScreen-CDmqpAN2.mjs +1 -0
  180. package/dist/esm/ManualTransferScreen-DyN3_kBX.mjs +1 -0
  181. package/dist/esm/MfaAuthEnrollmentFlowScreen-BNV7WReW.mjs +1 -0
  182. package/dist/esm/MfaAuthVerifyFlowScreen-B-ukVyrA.mjs +1 -0
  183. package/dist/esm/MfaEnrollmentFlowScreen-COe5FpFP.mjs +1 -0
  184. package/dist/esm/MfaVerifyFlowScreen-DCIPle0Z.mjs +1 -0
  185. package/dist/esm/{ModalHeader-DfHxv9fE.mjs → ModalHeader-DpkEBdQv.mjs} +1 -1
  186. package/dist/esm/MoonpayStatusScreen-_owltgjZ.mjs +16 -0
  187. package/dist/esm/OAuthStatusScreen-KZmCHc_b.mjs +1 -0
  188. package/dist/esm/PasskeySelectSignupOrLogin-CQ_DHbaT.mjs +1 -0
  189. package/dist/esm/PasskeyStatusScreen-eu3lPB6M.mjs +3 -0
  190. package/dist/esm/PasswordRecoveryScreen-DndhFHx6.mjs +20 -0
  191. package/dist/esm/{QrCode-D4XZQrgi.mjs → QrCode-D-J14re9.mjs} +1 -1
  192. package/dist/esm/RecoveryOAuthStatusScreen-CwCRvxCX.mjs +1 -0
  193. package/dist/esm/RecoveryPasswordCreateScreen-DrRcz4CY.mjs +1 -0
  194. package/dist/esm/{RecoverySelectionScreen-DVBTi436.mjs → RecoverySelectionScreen-CPHkQlGF.mjs} +2 -2
  195. package/dist/esm/{Screen-CDEd4p2a.mjs → Screen-B0u1eY7p.mjs} +3 -3
  196. package/dist/esm/{ScreenLayout-BdRrZJd_.mjs → ScreenLayout-CyK-vOMq.mjs} +1 -1
  197. package/dist/esm/SelectSourceAsset-ac3FApgI.mjs +112 -0
  198. package/dist/esm/{SetAutomaticRecoveryScreen-DBcSNU6R.mjs → SetAutomaticRecoveryScreen-DLY7WHVZ.mjs} +2 -2
  199. package/dist/esm/{SetWalletPasswordForm-DdWjdu2s.mjs → SetWalletPasswordForm-CQWh647N.mjs} +4 -4
  200. package/dist/esm/SignRequestScreen-BYHN19dO.mjs +26 -0
  201. package/dist/esm/{StandardSignAndSendTransactionScreen-DIJRS8NR.mjs → StandardSignAndSendTransactionScreen-5sT-AMvv.mjs} +2 -2
  202. package/dist/esm/TelegramAuthScreen-DATrHQkr.mjs +1 -0
  203. package/dist/esm/{TransactionDetails-Ce_Cnzo2.mjs → TransactionDetails-D9GBw9C3.mjs} +4 -4
  204. package/dist/esm/{TransactionErrorView-JiZmO7NJ.mjs → TransactionErrorView-3qTJ_97m.mjs} +5 -5
  205. package/dist/esm/{TransferFromWalletScreen-ad5b7GV7.mjs → TransferFromWalletScreen-w3c3g8ys.mjs} +2 -2
  206. package/dist/esm/{TransferOrBridgeLoadingScreen-Cwzefd9j.mjs → TransferOrBridgeLoadingScreen-koaJdk-2.mjs} +1 -1
  207. package/dist/esm/UpdateEmailScreen-BKTgKvoR.mjs +1 -0
  208. package/dist/esm/UpdatePhoneScreen-z7-7NbIO.mjs +1 -0
  209. package/dist/esm/UserLimitReachedScreen-BK77vZJo.mjs +1 -0
  210. package/dist/esm/{WalletInfoCard-D2dCT7_H.mjs → WalletInfoCard-hC5PhrNs.mjs} +1 -1
  211. package/dist/esm/WalletInterstitialScreen-DzDGk-y-.mjs +1 -0
  212. package/dist/esm/{WalletLink-DNraFqEC.mjs → WalletLink-sGQdBvAh.mjs} +1 -1
  213. package/dist/esm/{WalletOverflowButton-Cn_nKCBf.mjs → WalletOverflowButton-BrrkHpeZ.mjs} +1 -1
  214. package/dist/esm/{WarningBanner-c8L53pJ2.mjs → WarningBanner-D5LqDt95.mjs} +2 -2
  215. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  216. package/dist/esm/{context-Cw2-86-G.mjs → context-Bj4czVEP.mjs} +1 -1
  217. package/dist/esm/{ethers-5oa3ZKLD.mjs → ethers-BozrzoVi.mjs} +1 -1
  218. package/dist/esm/extended-chains.mjs +1 -1
  219. package/dist/esm/{getErc20Balance-sCX8nL1s.mjs → getErc20Balance-NThD2gHO.mjs} +1 -1
  220. package/dist/esm/{getErc20TokenInfo-CwiO-mOs.mjs → getErc20TokenInfo-BtdscGyJ.mjs} +1 -1
  221. package/dist/esm/index-CuKtz_xL.mjs +12 -0
  222. package/dist/esm/index-DQp_5KKJ.mjs +174 -0
  223. package/dist/esm/index-Ds8yBPhi.mjs +1 -0
  224. package/dist/esm/index.mjs +1 -1
  225. package/dist/esm/internal.mjs +1 -1
  226. package/dist/esm/privy-context-DICqtyyT.mjs +1 -0
  227. package/dist/esm/{shared-Bw0pXSOO.mjs → shared-zCv-_9Pa.mjs} +1 -1
  228. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-BkTDxfME.mjs → shouldProceedtoEmbeddedWalletCreationFlow-DLpCU-0h.mjs} +1 -1
  229. package/dist/esm/smart-wallets-B8GvSECb.mjs +1 -0
  230. package/dist/esm/smart-wallets.mjs +1 -1
  231. package/dist/esm/solana.mjs +1 -1
  232. package/dist/esm/{styles-D5Jf27-u.mjs → styles-pSKfqjN3.mjs} +15 -15
  233. package/dist/esm/{to-ui-error-DnDY_33E.mjs → to-ui-error-KRq5_d4z.mjs} +2 -2
  234. package/dist/esm/ui.mjs +1 -1
  235. package/dist/esm/use-export-wallet-D1P_g8O0.mjs +1 -0
  236. package/dist/esm/use-export-wallet-DVyBljMT.mjs +1 -0
  237. package/dist/esm/{useActiveWallet-CwS7ik68.mjs → useActiveWallet-DMrO7evY.mjs} +1 -1
  238. package/dist/esm/useGetTokenPrice-N5ZX6Yun.mjs +1 -0
  239. package/dist/esm/{useI18n-bIQlZhkW.mjs → useI18n-BiiKgmqw.mjs} +1 -1
  240. package/dist/esm/usePrivy-DDB15S8o.mjs +1 -0
  241. package/dist/esm/{useSolanaRpcClient-C2WlA-Ah.mjs → useSolanaRpcClient-B--BKNG3.mjs} +1 -1
  242. package/dist/esm/{useWalletBalance-DopZXXwh.mjs → useWalletBalance-C0WFIwSX.mjs} +1 -1
  243. package/dist/esm/useWallets-CJvLEQqE.mjs +1 -0
  244. package/dist/esm/useWallets-CS_W9ciB.mjs +1 -0
  245. package/package.json +5 -5
  246. package/dist/cjs/AccountNotFoundScreen-Bqh-CYrp.js +0 -1
  247. package/dist/cjs/AffirmativeConsentScreen-uogZ44HQ.js +0 -6
  248. package/dist/cjs/AllowlistRejectionScreen-3OKwgh23.js +0 -1
  249. package/dist/cjs/AuthenticateWithWalletScreen-DXy5TnZj.js +0 -1
  250. package/dist/cjs/AwaitingEvmToSolBridgingScreen-DR1RiU-S.js +0 -2
  251. package/dist/cjs/AwaitingExternalEthereumTransferScreen-DgQ9z_ck.js +0 -2
  252. package/dist/cjs/AwaitingPasswordlessCodeScreen-Bah7kXAV.js +0 -103
  253. package/dist/cjs/AwaitingSolToEvmBridgingScreen-HSwPZmzZ.js +0 -2
  254. package/dist/cjs/CaptchaScreen-BLoD3u63.js +0 -1
  255. package/dist/cjs/CoinbaseOnrampStatusScreen-CoSS2KfY.js +0 -16
  256. package/dist/cjs/ConnectEmailForm-BjXzo_T8.js +0 -3
  257. package/dist/cjs/ConnectLedgerScreen-Brfd_c8H.js +0 -9
  258. package/dist/cjs/ConnectOnlyLandingScreen-C41qgoJf.js +0 -1
  259. package/dist/cjs/ConnectOnlyStatusScreen-DPsh3aXI.js +0 -1
  260. package/dist/cjs/ConnectOrCreateScreen-Dpv9J_eC.js +0 -1
  261. package/dist/cjs/ConnectionStatusScreen-DfKCyYnE.js +0 -7
  262. package/dist/cjs/CrossAppAuthScreen-CAmbPQb0.js +0 -1
  263. package/dist/cjs/DelegatedActionsConsentScreen-DOvRMKf-.js +0 -1
  264. package/dist/cjs/DelegatedActionsRevokeScreen-5ecaxQ0D.js +0 -1
  265. package/dist/cjs/EmbeddedWalletConnectingScreen-B31DzW7n.js +0 -1
  266. package/dist/cjs/EmbeddedWalletCreatedScreen-BXEozrA_.js +0 -1
  267. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-DSrn-F5R.js +0 -1
  268. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-DGlv7LlS.js +0 -1
  269. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-Byr5dLg5.js +0 -1
  270. package/dist/cjs/ErrorScreen-DJwJwrGn.js +0 -4
  271. package/dist/cjs/FarcasterSignerStatusScreen--CVrZRE9.js +0 -29
  272. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-3Fn4CnSA.js +0 -2
  273. package/dist/cjs/FundWalletMethodHeader-D2fapeXN.js +0 -1
  274. package/dist/cjs/FundWithBankDepositScreen-DUQAuyf5.js +0 -176
  275. package/dist/cjs/FundingEditAmountScreen-B3wEw9xm.js +0 -1
  276. package/dist/cjs/FundingMethodSelectionScreen-ChQNeyi6.js +0 -1
  277. package/dist/cjs/InAppBrowserLoginNotPossible-XFkxHwKR.js +0 -1
  278. package/dist/cjs/InstallWalletScreen-Cp3ZRRYf.js +0 -1
  279. package/dist/cjs/LandingScreen-DwFs0lRf.js +0 -1
  280. package/dist/cjs/LinkEmailScreen-_sfK6ECC.js +0 -1
  281. package/dist/cjs/LinkPhoneScreen-BjMfF3Kz.js +0 -1
  282. package/dist/cjs/LoginFailedScreen-BUnuwN-5.js +0 -1
  283. package/dist/cjs/ManualTransferScreen-D2hHGf6p.js +0 -1
  284. package/dist/cjs/MfaAuthEnrollmentFlowScreen-VFaXkogp.js +0 -1
  285. package/dist/cjs/MfaAuthVerifyFlowScreen-CVBdW4Cw.js +0 -1
  286. package/dist/cjs/MfaEnrollmentFlowScreen-DxkzCr5s.js +0 -1
  287. package/dist/cjs/MfaVerifyFlowScreen-AFZc7liT.js +0 -1
  288. package/dist/cjs/MoonpayStatusScreen-C66Eq4G4.js +0 -16
  289. package/dist/cjs/OAuthStatusScreen-NKl6SLvR.js +0 -1
  290. package/dist/cjs/PasskeySelectSignupOrLogin-D9VfPofR.js +0 -1
  291. package/dist/cjs/PasskeyStatusScreen-CBC-60D2.js +0 -3
  292. package/dist/cjs/PasswordRecoveryScreen-BSUhAJ63.js +0 -20
  293. package/dist/cjs/RecoveryOAuthStatusScreen-y2Z3cphT.js +0 -1
  294. package/dist/cjs/RecoveryPasswordCreateScreen-CoDYHaJk.js +0 -1
  295. package/dist/cjs/SetAutomaticRecoveryScreen-BLiDEmlE.js +0 -14
  296. package/dist/cjs/TelegramAuthScreen-BGB40HSe.js +0 -1
  297. package/dist/cjs/UpdateEmailScreen-Bgn5JxGJ.js +0 -1
  298. package/dist/cjs/UpdatePhoneScreen-DPAxfLv5.js +0 -1
  299. package/dist/cjs/UserLimitReachedScreen-BG8gj4ah.js +0 -1
  300. package/dist/cjs/WalletInterstitialScreen-CBH05HpE.js +0 -1
  301. package/dist/cjs/get-is-unified-wallet-DitrQ4hx.js +0 -1
  302. package/dist/cjs/index-CCY3tkwt.js +0 -1
  303. package/dist/cjs/smart-wallets-BtILJe_K.js +0 -1
  304. package/dist/cjs/use-export-wallet-C6DaLOxp.js +0 -1
  305. package/dist/cjs/use-export-wallet-eDTOzHRt.js +0 -1
  306. package/dist/cjs/usePrivy-CHcu9hX8.js +0 -1
  307. package/dist/cjs/useWallets-CbvzYOqg.js +0 -1
  308. package/dist/cjs/useWallets-Cy6axcvW.js +0 -1
  309. package/dist/esm/AccountNotFoundScreen-BSYd-8_2.mjs +0 -1
  310. package/dist/esm/AffirmativeConsentScreen-C_uGmdSa.mjs +0 -6
  311. package/dist/esm/AllowlistRejectionScreen-DBdNYwS-.mjs +0 -1
  312. package/dist/esm/AuthenticateWithWalletScreen-D-Aw0iYo.mjs +0 -1
  313. package/dist/esm/AwaitingEvmToSolBridgingScreen-BMr5CXgX.mjs +0 -2
  314. package/dist/esm/AwaitingExternalEthereumTransferScreen-aOEMTW-b.mjs +0 -2
  315. package/dist/esm/AwaitingPasswordlessCodeScreen-CjPJ7IMM.mjs +0 -103
  316. package/dist/esm/AwaitingSolToEvmBridgingScreen-xrFngED1.mjs +0 -2
  317. package/dist/esm/CaptchaScreen-BOKElE1r.mjs +0 -1
  318. package/dist/esm/CoinbaseOnrampStatusScreen-CTV5uUn3.mjs +0 -16
  319. package/dist/esm/ConnectEmailForm-Dp85JvZj.mjs +0 -3
  320. package/dist/esm/ConnectLedgerScreen-rxzesP5N.mjs +0 -9
  321. package/dist/esm/ConnectOnlyLandingScreen-CmImF7oZ.mjs +0 -1
  322. package/dist/esm/ConnectOnlyStatusScreen-Bo90w6P9.mjs +0 -1
  323. package/dist/esm/ConnectOrCreateScreen-Dc2VQF-B.mjs +0 -1
  324. package/dist/esm/ConnectionStatusScreen-C_fxSXJ2.mjs +0 -7
  325. package/dist/esm/CrossAppAuthScreen-DU0FD2ep.mjs +0 -1
  326. package/dist/esm/DelegatedActionsConsentScreen-Dr-DeIXC.mjs +0 -1
  327. package/dist/esm/DelegatedActionsRevokeScreen-kXOJxXu-.mjs +0 -1
  328. package/dist/esm/EmbeddedWalletConnectingScreen-tFedaOj3.mjs +0 -1
  329. package/dist/esm/EmbeddedWalletCreatedScreen-DCx4NdAp.mjs +0 -1
  330. package/dist/esm/EmbeddedWalletKeyExportScreen-CVflSsvz.mjs +0 -40
  331. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-vSzXa62f.mjs +0 -1
  332. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-B4szV9Hg.mjs +0 -1
  333. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BOBLnE_O.mjs +0 -1
  334. package/dist/esm/ErrorScreen-BGE6wldq.mjs +0 -4
  335. package/dist/esm/FarcasterSignerStatusScreen-C-crikPv.mjs +0 -28
  336. package/dist/esm/FundSolWalletWithExternalSolanaWallet-BX4gYmzv.mjs +0 -1
  337. package/dist/esm/FundWalletMethodHeader-CdXWChwL.mjs +0 -1
  338. package/dist/esm/FundWithBankDepositScreen-HyqTUpLq.mjs +0 -176
  339. package/dist/esm/FundingEditAmountScreen--ffFSUmf.mjs +0 -1
  340. package/dist/esm/FundingMethodSelectionScreen-Djr0jY03.mjs +0 -1
  341. package/dist/esm/InAppBrowserLoginNotPossible-D6wMCuzD.mjs +0 -1
  342. package/dist/esm/InstallWalletScreen-B6VSXUWR.mjs +0 -1
  343. package/dist/esm/LandingScreen-BV0xq-oc.mjs +0 -1
  344. package/dist/esm/LinkEmailScreen-CtMuCZvp.mjs +0 -1
  345. package/dist/esm/LinkPhoneScreen-2nnXZB2B.mjs +0 -1
  346. package/dist/esm/LoginFailedScreen-hHvIsH81.mjs +0 -1
  347. package/dist/esm/ManualTransferScreen-C0xJ3si8.mjs +0 -1
  348. package/dist/esm/MfaAuthEnrollmentFlowScreen-CznUpkq5.mjs +0 -1
  349. package/dist/esm/MfaAuthVerifyFlowScreen-DUmOZHGX.mjs +0 -1
  350. package/dist/esm/MfaEnrollmentFlowScreen-DeoSfYAS.mjs +0 -1
  351. package/dist/esm/MfaVerifyFlowScreen-JJ1crW_8.mjs +0 -1
  352. package/dist/esm/MoonpayStatusScreen-BIzQZK9f.mjs +0 -16
  353. package/dist/esm/OAuthStatusScreen-DhmaZBTY.mjs +0 -1
  354. package/dist/esm/PasskeySelectSignupOrLogin-BmiJnukl.mjs +0 -1
  355. package/dist/esm/PasskeyStatusScreen-BStwA1_J.mjs +0 -3
  356. package/dist/esm/PasswordRecoveryScreen-DyBDQADG.mjs +0 -20
  357. package/dist/esm/RecoveryOAuthStatusScreen-BfcxgkUL.mjs +0 -1
  358. package/dist/esm/RecoveryPasswordCreateScreen-CBfvjxht.mjs +0 -1
  359. package/dist/esm/SignRequestScreen-CxAuntSd.mjs +0 -26
  360. package/dist/esm/TelegramAuthScreen-BRDG8b6x.mjs +0 -1
  361. package/dist/esm/UpdateEmailScreen-C5lQJUiA.mjs +0 -1
  362. package/dist/esm/UpdatePhoneScreen-BwkzWVHl.mjs +0 -1
  363. package/dist/esm/UserLimitReachedScreen-ComDV9kj.mjs +0 -1
  364. package/dist/esm/WalletInterstitialScreen-riBB51NH.mjs +0 -1
  365. package/dist/esm/get-is-unified-wallet-CQc-E5dS.mjs +0 -1
  366. package/dist/esm/index-B5B9f4U9.mjs +0 -12
  367. package/dist/esm/index-Bvw5OxHl.mjs +0 -174
  368. package/dist/esm/index-yxF2V6XY.mjs +0 -1
  369. package/dist/esm/smart-wallets-Dl42tBUP.mjs +0 -1
  370. package/dist/esm/use-export-wallet-Bd5Sg5V-.mjs +0 -1
  371. package/dist/esm/use-export-wallet-NF9h_lS_.mjs +0 -1
  372. package/dist/esm/useGetTokenPrice-oI6b3gPZ.mjs +0 -1
  373. package/dist/esm/usePrivy-DAnfSvB5.mjs +0 -1
  374. package/dist/esm/useWallets-2_uCkhA8.mjs +0 -1
  375. package/dist/esm/useWallets-DpbBw4Vl.mjs +0 -1
@@ -0,0 +1,16 @@
1
+ import{jsx as r,jsxs as e,Fragment as t}from"react/jsx-runtime";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import i from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as n}from"react";import{styled as a}from"styled-components";import{M as s,B as l,P as c}from"./ModalHeader-DpkEBdQv.mjs";import{a as m}from"./Layouts-BlFm53ED.mjs";import{L as d,O as u}from"./useActiveWallet-DMrO7evY.mjs";import{u as p}from"./context-Bj4czVEP.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{a as f}from"./privy-context-DICqtyyT.mjs";import{u as g}from"./index-Ds8yBPhi.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"zustand";import"react-device-detect";import"./use-export-wallet-DVyBljMT.mjs";import"./useWallets-CS_W9ciB.mjs";import"viem";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./analytics-mkkvFRju.mjs";const y=({size:t=61,...o})=>/*#__PURE__*/r("svg",{width:t,height:t,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:/*#__PURE__*/e("g",{id:"moonpay_symbol_wht 2",children:[/*#__PURE__*/r("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),/*#__PURE__*/r("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});const v={component:()=>{let{data:o,setModalData:i,navigateBack:n}=f(),a=p(),{closePrivyModal:c}=h(),{externalTransactionId:m}=o?.moonpayStatus,d=g(m||null,a.fundingMethodConfig.moonpay.useSandbox??!1);/*#__PURE__*/return e(t,{children:[/*#__PURE__*/r(s,{title:"Fund account",backFn:()=>{let r={...o?.funding,showAlternateFundingMethod:!0};r.usingDefaultFundingMethod&&(r.usingDefaultFundingMethod=!1),i({funding:r,solanaFundingData:o?.solanaFundingData}),n()}}),/*#__PURE__*/r(C,{status:d,onClickCta:c}),/*#__PURE__*/r(l,{})]})}};let C=({status:o,onClickCta:i})=>{let{title:a,body:s,cta:l}=n((()=>(r=>{switch(r){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}})(o)),[o]);/*#__PURE__*/return e(t,{children:[/*#__PURE__*/e(b,{children:[/*#__PURE__*/r(w,{status:o}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/r("h3",{children:a}),/*#__PURE__*/r(x,{children:s})]})]}),l&&/*#__PURE__*/r(c,{onClick:i,children:l})]})},w=({status:t})=>{if(!t||"pending"===t){let t="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/r(d,{color:t,style:{position:"absolute"}}),/*#__PURE__*/r(u,{color:t}),/*#__PURE__*/r(y,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let n=(e=>{switch(e){case"completed":return i;case"waitingAuthorization":return()=>/*#__PURE__*/r(o,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}})(t),a=(s=t)?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[s]:"var(--privy-color-foreground-4)";var s;/*#__PURE__*/return r("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/r(n,{width:"4rem",height:"4rem",color:a})})},x=a.p`
2
+ font-size: 1rem;
3
+ color: var(--privy-color-foreground-3);
4
+ margin-bottom: 1rem;
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 1rem;
8
+ `,b=a.div`
9
+ display: flex;
10
+ flex-direction: column;
11
+ align-items: center;
12
+ justify-content: center;
13
+ margin-left: 1.75rem;
14
+ margin-right: 1.75rem;
15
+ padding: 2rem 0;
16
+ `;export{v as MoonpayStatusScreen,v as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import t,{useState as r,useEffect as o}from"react";import{i,u as a,a as n}from"./privy-context-DICqtyyT.mjs";import{A as s,T as m,I as c,S as l,a as d,L as p,b as u,D as v,G as h}from"./twitter-BoAxhlj6.mjs";import y from"@heroicons/react/24/outline/GlobeAltIcon";import{T as f,L as g}from"./twitch-5IOe4sIQ.mjs";import{u as E,q as A}from"./context-Bj4czVEP.mjs";import{b as T,u as S,k as w}from"./internal-context-Z-fyxadS.mjs";import{s as _}from"./shouldProceedtoEmbeddedWalletCreationFlow-DLpCU-0h.mjs";import{S as b}from"./ScreenLayout-CyK-vOMq.mjs";import{e as C}from"./capitalizeFirstLetter-DmLYqXsO.mjs";import{l as j}from"./index-DQp_5KKJ.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-DpkEBdQv.mjs";import"styled-components";import"./useActiveWallet-DMrO7evY.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DVyBljMT.mjs";import"./useWallets-CS_W9ciB.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.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-B0u1eY7p.mjs";import"./index-Dq_xe9dz.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DDB15S8o.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";const O=({style:t})=>/*#__PURE__*/e(y,{style:{color:"var(--privy-color-error)",...t}});let R={google:{name:"Google",component:h},discord:{name:"Discord",component:v},github:{name:"Github",component:u},linkedin:{name:"LinkedIn",component:p},twitter:{name:"Twitter",component:d},spotify:{name:"Spotify",component:l},instagram:{name:"Instagram",component:c},tiktok:{name:"Tiktok",component:m},line:{name:"LINE",component:g},twitch:{name:"Twitch",component:f},apple:{name:"Apple",component:s}},N=({iconUrl:e,...r})=>t.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},t.createElement("foreignObject",{x:"2",y:"2",width:"29",height:"28"},t.createElement("img",{src:e,width:"29",height:"28",style:{display:"block",objectFit:"contain",borderRadius:"4px"},alt:"Provider icon"})));const U=(e,r)=>{if(e in R)return R[e];if(i(e)&&r){let o=r.find((t=>t.provider===e));if(o)return{name:o.provider_display_name,component:e=>t.createElement(N,{...e,iconUrl:o.provider_icon_url})}}return{name:"Unknown",component:O}};function I(e,t,r){let o={detail:"",retryable:!1},i=C(t);if(e?.privyErrorCode===T.LINKED_TO_ANOTHER_USER&&(o.detail="This account has already been linked to another user."),e?.privyErrorCode===T.INVALID_CREDENTIALS&&(o.retryable=!0,o.detail="Something went wrong. Try again."),e.privyErrorCode===T.OAUTH_USER_DENIED&&(o.detail=`Retry and check ${i} to finish connecting your account.`,o.retryable=!0),e?.privyErrorCode===T.TOO_MANY_REQUESTS&&(o.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===T.TOO_MANY_REQUESTS&&e.message.includes("provider rate limit")){let e=U(t,r).name;o.detail=`Request limit reached for ${e}. Please wait a moment and try again.`}if(e?.privyErrorCode===T.OAUTH_ACCOUNT_SUSPENDED){let e=U(t,r).name;o.detail=`Your ${e} account is suspended. Please try another login method.`}return e?.privyErrorCode===T.CANNOT_LINK_MORE_OF_TYPE&&(o.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode===T.OAUTH_UNEXPECTED&&t.startsWith("privy:")&&(o.detail="Something went wrong. Please try again."),o}const L=({providerName:t,ProviderLogo:r,success:o,errorMessage:i,onRetry:a})=>{let n=o?`Successfully connected with ${t}`:i?i.message:`Verifying connection to ${t}`;/*#__PURE__*/return e(b,{title:n,subtitle:o?"You're good to go!":i?i.detail:"Just a few moments more",icon:r,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!i},secondaryCta:i?.retryable&&a?{label:"Retry",onClick:a}:void 0,watermark:!0})},k={component:()=>{let{authenticated:t,logout:i,ready:s,user:m}=a(),{setModalData:c,navigate:l,resetNavigation:d}=n(),p=E(),{getAuthMeta:u,initLoginWithOAuth:v,loginWithOAuth:h,updateWallets:y,setReadyToTrue:f,closePrivyModal:g,createAnalyticsEvent:b}=S(),[C,O]=r(!1),[R,N]=r(void 0),k=u()?.provider||"google",{name:P,component:x}=U(k,p.customOAuthProviders);return o((()=>{h(k).then((()=>{O(!0),f(!0)})).catch((e=>{if(f(!1),e?.privyErrorCode===T.ALLOWLIST_REJECTED)return N(void 0),d(),void l("AllowlistRejectionScreen");if(e?.privyErrorCode===T.USER_LIMIT_REACHED)return console.error(new w(e).toString()),N(void 0),d(),void l("UserLimitReachedScreen");if(e?.privyErrorCode===T.USER_DOES_NOT_EXIST)return N(void 0),d(),void l("AccountNotFoundScreen");if(e?.privyErrorCode===T.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return N(void 0),d(),c({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:u()?.provider,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void l("LinkConflictScreen");let{retryable:t,detail:r}=I(e,k,p.customOAuthProviders);N({retryable:t,detail:r,message:"Authentication failed"})})).finally((()=>{j()}))}),[P,k]),o((()=>{if(s&&t&&C&&m){if(p?.legal.requireUsersAcceptTerms&&!m.hasAcceptedTerms){let e=setTimeout((()=>{l("AffirmativeConsentScreen")}),A);return()=>clearTimeout(e)}if(_(m,p.embeddedWallets)){let e=setTimeout((()=>{c({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),b({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:k,screen:"OAuthStatusScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),l("EmbeddedWalletOnAccountCreateScreen")}),A);return()=>clearTimeout(e)}{let e=setTimeout((()=>g({shouldCallAuthOnSuccess:!0,isSuccess:!0})),A);return y(),()=>clearTimeout(e)}}}),[s,t,C,m]),/*#__PURE__*/e(L,{providerName:P,ProviderLogo:x,success:C,errorMessage:R,onRetry:R?.retryable?()=>{j(),v(k),N(void 0)}:void 0})},isShownBeforeReady:!0};export{k as OAuthStatusScreen,L as OAuthStatusScreenView,k as default};
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{FingerprintIcon as e}from"lucide-react";import{a as o}from"./index-DQp_5KKJ.mjs";import{u as i}from"./internal-context-Z-fyxadS.mjs";import{a as r}from"./privy-context-DICqtyyT.mjs";import{S as a}from"./ScreenLayout-CyK-vOMq.mjs";import"react";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-DMrO7evY.mjs";import"zustand";import"./context-Bj4czVEP.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-DVyBljMT.mjs";import"./useWallets-CS_W9ciB.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DDB15S8o.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-DpkEBdQv.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-B0u1eY7p.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:o="Log in or create a new account?",subtitle:i="Create a new account with a passkey or use a passkey to log in to an existing account.",onSignup:r,onLogin:s})=>/*#__PURE__*/t(a,{title:o,subtitle:i,icon:e,primaryCta:{label:"Create new account",onClick:r},secondaryCta:{label:"Log in with a passkey",onClick:s},watermark:!0}),n={component:()=>{let{enabled:e,token:a}=o(),{navigate:n,setModalData:p}=r(),{initSignupWithPasskey:c,initLoginWithPasskey:m}=i();/*#__PURE__*/return t(s,{onSignup:async()=>{e&&!a?(p({passkeyAuthModalData:{passkeySignupFlow:!0},captchaModalData:{callback:t=>c({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await c({withPrivyUi:!0,captchaToken:a}),p({passkeyAuthModalData:{passkeySignupFlow:!0}}),n("PasskeyStatusScreen"))},onLogin:async()=>{e&&!a?(p({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:t=>m({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await m({withPrivyUi:!0,captchaToken:a}),p({passkeyAuthModalData:{passkeySignupFlow:!1}}),n("PasskeyStatusScreen"))}})}};export{n as PasskeySelectSignupOrLogin,s as PasskeySelectSignupOrLoginView,n as default};
@@ -0,0 +1,3 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{FingerprintIcon as r}from"lucide-react";import{useState as t,useRef as o,useEffect as s}from"react";import{styled as i}from"styled-components";import{u as a,q as n}from"./context-Bj4czVEP.mjs";import{c,b as m,u}from"./internal-context-Z-fyxadS.mjs";import{a as p,u as l}from"./privy-context-DICqtyyT.mjs";import{s as d}from"./shouldProceedtoEmbeddedWalletCreationFlow-DLpCU-0h.mjs";import{S as y}from"./ScreenLayout-CyK-vOMq.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./index-DQp_5KKJ.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-DMrO7evY.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DVyBljMT.mjs";import"./useWallets-CS_W9ciB.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DDB15S8o.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-DpkEBdQv.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-B0u1eY7p.mjs";import"./index-Dq_xe9dz.mjs";const h=({status:t,passkeySignupFlow:o=!1,error:s,onRetry:i})=>/*#__PURE__*/e(y,{title:(()=>{switch(t){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}})(),subtitle:/*#__PURE__*/e(v,{children:(()=>{switch(t){case"loading":return o?"Please follow prompts to register your passkey.":"Please follow prompts to verify your passkey.\nYou will have to sign up with another method first to register a passkey for your account.";case"success":return"You've successfully logged in with your passkey.";case"error":if(s instanceof c){if(s.privyErrorCode===m.CANNOT_LINK_MORE_OF_TYPE)return"Cannot link more passkeys to account.";if(s.privyErrorCode===m.PASSKEY_NOT_ALLOWED)return"Passkey request timed out or rejected by user.\nYou will have to sign up with another method first to register a passkey for your account."}return"An unknown error occurred.\nYou will have to sign up with another method first to register a passkey for your account."}})()}),icon:r,iconVariant:"loading",iconLoadingStatus:{success:"success"===t,fail:"error"===t},primaryCta:"error"===t&&i?{label:"Retry",onClick:i}:"success"===t?{label:"Continue",disabled:!0}:void 0,watermark:!0}),f={component:()=>{let{data:r,setModalData:i,navigate:c}=p(),m=a(),{loginWithPasskey:y,signupWithPasskey:f,closePrivyModal:v,createAnalyticsEvent:g}=u(),{user:w,logout:j}=l(),{passkeySignupFlow:k}=r?.passkeyAuthModalData??{},S=n-500,[b,A]=t("loading"),[C,P]=t(null),x=o([]),E=e=>{x.current=[e,...x.current]};s((()=>()=>{x.current.forEach((e=>clearTimeout(e))),x.current=[]}),[]);let W=async()=>{A("loading");try{k?await f():await y(),A("success")}catch(e){P(e),A("error")}};return s((()=>{if("success"===b&&w){if(m?.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms)return void E(setTimeout((()=>{c("AffirmativeConsentScreen")}),S));if(!d(w,m?.embeddedWallets))return void E(setTimeout((()=>{v({shouldCallAuthOnSuccess:!0,isSuccess:!0})}),n));E(setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),g({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"PasskeyStatusScreen"}}),j()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")}),S))}}),[w,b]),s((()=>{W()}),[]),/*#__PURE__*/e(h,{status:b,passkeySignupFlow:k,error:C,onRetry:W})}};let v=i.span`
2
+ white-space: pre-wrap;
3
+ `;export{f as PasskeyStatusScreen,h as PasskeyStatusScreenView,f as default};
@@ -0,0 +1,20 @@
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import o from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as t,useEffect as i}from"react";import{styled as s,css as a}from"styled-components";import{u as n,a as l,j as c}from"./privy-context-DICqtyyT.mjs";import{P as m}from"./ModalHeader-DpkEBdQv.mjs";import{S as d}from"./Layouts-BlFm53ED.mjs";import{P as p,a as u,I as h,H as y,S as v}from"./shared-zCv-_9Pa.mjs";import{n as f}from"./index-DQp_5KKJ.mjs";import{u as w,m as j}from"./internal-context-Z-fyxadS.mjs";import{S as g}from"./Screen-B0u1eY7p.mjs";import"@privy-io/are-addresses-equal";import"./context-Bj4czVEP.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-DMrO7evY.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DVyBljMT.mjs";import"./useWallets-CS_W9ciB.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.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"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DDB15S8o.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./index-Dq_xe9dz.mjs";const b={component:()=>{let[s,a]=t(!0),{authenticated:m,user:b}=n(),{walletProxy:C,closePrivyModal:I,createAnalyticsEvent:P,client:S}=w(),{navigate:W,data:T,onUserCloseViaDialogOrKeybindRef:_}=l(),[E,R]=t(void 0),[U,H]=t(""),[M,F]=t(!1),{entropyId:N,entropyIdVerifier:O,onCompleteNavigateTo:V,onSuccess:$,onFailure:z}=T.recoverWallet,L=(e="User exited before their wallet could be recovered")=>{I({shouldCallAuthOnSuccess:!1}),z("string"==typeof e?new j(e):e)};_.current=L,i((()=>{if(!m)return L("User must be authenticated and have a Privy wallet before it can be recovered")}),[m]);/*#__PURE__*/return e(g,{children:[/*#__PURE__*/r(g.Header,{icon:o,title:"Enter your password",subtitle:"Please provision your account on this new device. To continue, enter your recovery password.",showClose:!0,onClose:L}),/*#__PURE__*/r(g.Body,{children:/*#__PURE__*/r(x,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/e(p,{children:[/*#__PURE__*/r(u,{type:s?"password":"text",onChange:e=>(e=>{e&&R(e)})(e.target.value),disabled:M,style:{paddingRight:"2.3rem"}}),/*#__PURE__*/r(h,{style:{right:"0.75rem"},children:s?/*#__PURE__*/r(y,{onClick:()=>a(!1)}):/*#__PURE__*/r(v,{onClick:()=>a(!0)})})]}),!!U&&/*#__PURE__*/r(k,{children:U})]})})}),/*#__PURE__*/e(g.Footer,{children:[/*#__PURE__*/r(g.HelpText,{children:/*#__PURE__*/e(d,{children:[/*#__PURE__*/r("h4",{children:"Why is this necessary?"}),/*#__PURE__*/r("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]})}),/*#__PURE__*/r(g.Actions,{children:/*#__PURE__*/r(A,{loading:M||!C,disabled:!E,onClick:async()=>{F(!0);let e=await S.getAccessToken(),r=c(b,N);if(!e||!r||null===E)return L("User must be authenticated and have a Privy wallet before it can be recovered");try{P({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:r.address}}),await(C?.recover({accessToken:e,entropyId:N,entropyIdVerifier:O,recoveryPassword:E})),H(""),V?W(V):I({shouldCallAuthOnSuccess:!1}),$?.(r),P({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r.address}})}catch(e){f(e)?H("Invalid recovery password, please try again."):H("An error has occurred, please try again.")}finally{F(!1)}},$hideAnimations:!N&&M,children:"Recover your account"})}),/*#__PURE__*/r(g.Watermark,{})]})]})}};let x=s.div`
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 1.5rem;
5
+ `,k=s.div`
6
+ line-height: 20px;
7
+ height: 20px;
8
+ font-size: 13px;
9
+ color: var(--privy-color-error);
10
+ text-align: left;
11
+ margin-top: 0.5rem;
12
+ `,A=s(m)`
13
+ ${({$hideAnimations:e})=>e&&a`
14
+ && {
15
+ // Remove animations because the recoverWallet task on the iframe partially
16
+ // blocks the renderer, so the animation stutters and doesn't look good
17
+ transition: none;
18
+ }
19
+ `}
20
+ `;export{b as PasswordRecoveryScreen,b as default};
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import t from"qrcode";import l from"react";import{styled as i}from"styled-components";import{u as c}from"./context-Cw2-86-G.mjs";import{D as n,E as g}from"./use-export-wallet-Bd5Sg5V-.mjs";const a=()=>/*#__PURE__*/e("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:/*#__PURE__*/e("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});let h=(e,r,o,t,l)=>{for(let i=r;i<r+t;i++)for(let r=o;r<o+l;r++){let o=e?.[r];o&&o[i]&&(o[i]=0)}return e},m=(e,r)=>{let o=t.create(e,{errorCorrectionLevel:r}).modules,l=g(Array.from(o.data),o.size);return l=h(l,0,0,7,7),l=h(l,l.length-7,0,7,7),h(l,0,l.length-7,7,7)},d=({x:r,y:t,cellSize:l,bgColor:i,fgColor:c})=>
1
+ import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import t from"qrcode";import l from"react";import{styled as i}from"styled-components";import{u as c}from"./context-Bj4czVEP.mjs";import{D as n,E as g}from"./use-export-wallet-DVyBljMT.mjs";const a=()=>/*#__PURE__*/e("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:/*#__PURE__*/e("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});let h=(e,r,o,t,l)=>{for(let i=r;i<r+t;i++)for(let r=o;r<o+l;r++){let o=e?.[r];o&&o[i]&&(o[i]=0)}return e},m=(e,r)=>{let o=t.create(e,{errorCorrectionLevel:r}).modules,l=g(Array.from(o.data),o.size);return l=h(l,0,0,7,7),l=h(l,l.length-7,0,7,7),h(l,0,l.length-7,7,7)},d=({x:r,y:t,cellSize:l,bgColor:i,fgColor:c})=>
2
2
  /*#__PURE__*/e(o,{children:[0,1,2].map((o=>/*#__PURE__*/e("circle",{r:l*(7-2*o)/2,cx:r+7*l/2,cy:t+7*l/2,fill:o%2!=0?i:c},`finder-${r}-${t}-${o}`)))}),p=({cellSize:r,matrixSize:t,bgColor:l,fgColor:i})=>/*#__PURE__*/e(o,{children:[[0,0],[(t-7)*r,0],[0,(t-7)*r]].map((([o,t])=>/*#__PURE__*/e(d,{x:o,y:t,cellSize:r,bgColor:l,fgColor:i},`finder-${o}-${t}`)))}),s=({matrix:r,cellSize:t,color:i})=>/*#__PURE__*/e(o,{children:r.map(((r,o)=>r.map(((r,c)=>r?/*#__PURE__*/e("rect",{height:t-.4,width:t-.4,x:o*t+.1*t,y:c*t+.1*t,rx:.5*t,ry:.5*t,fill:i},`cell-${o}-${c}`):/*#__PURE__*/e(l.Fragment,{},`circle-${o}-${c}`)))))}),u=({cellSize:t,matrixSize:l,element:i,sizePercentage:c,bgColor:n})=>{if(!i)/*#__PURE__*/return e(o,{});let g=l*(c||.14),a=Math.floor(l/2-g/2),h=Math.floor(l/2+g/2);(h-a)%2!=l%2&&(h+=1);let m=(h-a)*t,d=m-.2*m,p=a*t;/*#__PURE__*/return r(o,{children:[/*#__PURE__*/e("rect",{x:a*t,y:a*t,width:m,height:m,fill:n}),/*#__PURE__*/e(i,{x:p+.1*m,y:p+.1*m,height:d,width:d})]})},f=o=>{let t=o.outputSize,l=m(o.url,o.errorCorrectionLevel),i=t/l.length,c=n(2*i,{min:.025*t,max:.036*t});/*#__PURE__*/return r("svg",{height:o.outputSize,width:o.outputSize,viewBox:`0 0 ${o.outputSize} ${o.outputSize}`,style:{height:"100%",width:"100%",padding:`${c}px`},children:[/*#__PURE__*/e(s,{matrix:l,cellSize:i,color:o.fgColor}),/*#__PURE__*/e(p,{cellSize:i,matrixSize:l.length,fgColor:o.fgColor,bgColor:o.bgColor}),/*#__PURE__*/e(u,{cellSize:i,element:o.logo?.element,bgColor:o.bgColor,matrixSize:l.length})]})},x=i.div.attrs({className:"ph-no-capture"})`
3
3
  display: flex;
4
4
  justify-content: center;
@@ -0,0 +1 @@
1
+ import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import{useState as o,useEffect as a,useCallback as i}from"react";import{M as c,P as s,B as l}from"./ModalHeader-DpkEBdQv.mjs";import{C as n}from"./ScreenHeader-CHmc4-Lu.mjs";import{q as d}from"./context-Bj4czVEP.mjs";import{o as p,q as u,r as m,v,R as h,l as w}from"./index-DQp_5KKJ.mjs";import{a as y,f,b as _,u as A}from"./internal-context-Z-fyxadS.mjs";import{a as E,u as g,g as C}from"./privy-context-DICqtyyT.mjs";import{a8 as b,a9 as R,aa as k}from"./paths-3HW55qZg.mjs";import{g as T}from"./useWallets-CS_W9ciB.mjs";import{a as O}from"./events-context-CI0iqAXA.mjs";import{A as x,G as N,R as S}from"./styles-BsotlekN.mjs";import"styled-components";import"./useActiveWallet-DMrO7evY.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DVyBljMT.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"viem";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"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./usePrivy-DDB15S8o.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";async function I({url:e,popup:t,provider:r}){return t.location=e,new Promise(((e,r)=>{function o(){t?.close(),window.removeEventListener("message",a)}function a(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(e(t.data),o()),"https://cdn.apple-cloudkit.com"===t.origin&&t.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:t.data.ckSession}),o()),"PRIVY_OAUTH_ERROR"===t.data.type&&(r(t.data.error),o()))}window.addEventListener("message",a)}))}async function M({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:a}){if(!a||!r)throw new y("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===a)throw new y("User denied confirmation during OAuth flow");try{return(await e.post(b,{authorization_code:a,state_code:r,code_verifier:o,provider:t})).access_token}catch(e){let t=f(e);if(t.privyErrorCode)throw new y(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new y("Invalid code during oauth flow.",void 0,_.OAUTH_USER_DENIED);throw new y("Invalid code during OAuth flow.",void 0,_.UNKNOWN_AUTH_ERROR)}}async function U({api:e,provider:t}){let r=p(),o=u(),a=await m(r);try{return"icloud"===t?{url:(await e.post(R,{client_type:"web"})).url}:{url:(await e.post(k,{redirect_to:window.location.href,code_challenge:a,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(e){throw f(e)}}let j={"google-drive":{name:"Google Drive",component:N},icloud:{name:"iCloud",component:x}};const W={component:()=>{let{logout:p}=g(),{navigate:u,setModalData:m,data:f}=E(),{closePrivyModal:b,createAnalyticsEvent:R}=A(),{execute:k}=(()=>{let{client:e,walletProxy:t,refreshSessionAndUser:r}=A(),{data:o}=E(),{user:a}=g(),i=O(),{create:c}=v();return{execute:async({provider:s,action:l,popup:n,shouldCreateEth:d,shouldCreateSol:p})=>{let u,m;if(!e)throw new y("Missing client");function v(t){if(!t&&e)throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:s}}),new y("Recovery OAuth failed")}switch(s){case"google-drive":{let t,r,{url:o,codeVerifier:a,stateCode:i}=await U({api:e.api,provider:s});v(o);try{let a=await I({url:o,popup:n,provider:s});if(t=a.stateCode,r=a.authorizationCode,t!==i)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:s,storedStateCode:i??"",returnedStateCode:t??""}}),new y("Unexpected auth flow. This may be a phishing attempt.",void 0,_.OAUTH_UNEXPECTED)}catch(t){throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:s}}),new y("Recovery OAuth failed")}[u,m]=await Promise.all([e.getAccessToken(),M({api:e.api,provider:s,codeVerifier:a,stateCode:t,authorizationCode:r})]);break}case"icloud":{let{url:t}=await U({api:e.api,provider:s});v(t);let{ckWebAuthToken:r}=await I({url:t,popup:n,provider:s});m=r,u=await e.getAccessToken()}}if(!t)throw new y("Cannot connect to wallet proxy");if(!u)throw new y("Unable to authorize user");switch(l){case"recover":{let r=o?.recoverWallet?.entropyId,a=o?.recoverWallet?.entropyIdVerifier;if(!r||!a)throw new y("Recovery OAuth failed");e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:r,recoveryMethod:s}}),await t.recover({accessToken:u,entropyId:r,entropyIdVerifier:a,recoveryAccessToken:m}),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r,recoveryMethod:s}});break}case"create-wallet":{let t;if(e.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),d&&p)t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"ethereum",walletIndex:0,latestUser:a}),t=await c({chainType:"solana",walletIndex:0,latestUser:t.user});else if(p)t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"solana",walletIndex:0,latestUser:a});else{if(!d)throw Error("Invalid args to create wallet");t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"ethereum",walletIndex:0,latestUser:a})}if(!t)throw i("createWallet","onError",_.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:t.account.address}}),i("createWallet","onSuccess",{wallet:t.account});break}case"set-recovery":{let o=C(a);if(!o)throw i("setWalletRecovery","onError",_.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:s}});let{entropyId:c,entropyIdVerifier:l}=T(a);await t.setRecovery({accessToken:u,entropyId:c,entropyIdVerifier:l,recoveryMethod:s,recoveryAccessToken:m});let n=C(await r());if(!n)throw i("createWallet","onError",_.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:s}}),i("setWalletRecovery","onSuccess",{method:s,wallet:n});break}default:throw new y("Unsupported recovery action")}}}})(),[x,N]=o(!1),{provider:W,action:D,isInAccountCreateFlow:P,shouldCreateEth:V,shouldCreateSol:L}=f?.recoveryOAuthStatus,[z,H]=o(void 0),[$,B]=o("create-wallet"===D);if("user-passcode"===W)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let F=j[W].name,q=j[W].component,G=f?.recoverWallet?.onCompleteNavigateTo,K=new h((async(e="create-wallet")=>(B(!0),new Promise(((t,r)=>{setTimeout((async()=>{try{let r=window.open();await k({provider:W,action:e,popup:r,shouldCreateEth:V,shouldCreateSol:L}),N(!0),t()}catch(t){H({message:`${"recover"===e?"Recovery":"Back up"} with ${F} unsuccessful`,detail:"recover"===D?`Please verify that you are selecting the ${F} account associated with your backup.`:"",retryable:!0}),r()}}),0)})))));a((()=>{"recover"!==D&&K.execute(P?"create-wallet":"set-recovery")}),[]),a((()=>{if(!x)return;let e=setTimeout((()=>{P?(m({createWallet:{onSuccess:()=>{},onFailure:e=>{R({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"RecoveryOAuthScreen"}}),p()},callAuthOnSuccessOnClose:!0,shouldCreateEth:!1,shouldCreateSol:!1}}),u("EmbeddedWalletCreatedScreen")):b({shouldCallAuthOnSuccess:!1})}),d);return()=>clearTimeout(e)}),[x]);let Y=i((async()=>{await K.execute("recover"),G?u(G):N(!0)}),[]),X="google-drive"===W?"Google Drive":"Apple iCloud",Q=x&&`Successfully ${"recover"===D?"recovered":"backed up"} with ${X}.`||z&&z.message||`${"recover"===D?"Recovering":"Backing up"} with ${X}...`,J=z?z.detail:"";/*#__PURE__*/return e(t,{children:[/*#__PURE__*/r(c,{}),$?/*#__PURE__*/r(t,{children:/*#__PURE__*/e(S,{children:[/*#__PURE__*/r(n,{title:Q,icon:/*#__PURE__*/r(q,{style:{width:"38px",height:"38px"}}),description:J}),z&&z?.retryable?/*#__PURE__*/r(s,{onClick:()=>{w(),H(void 0),"create-wallet"===D?K.execute("create-wallet"):Y()},disabled:!x&&!z?.retryable,children:"Try again"}):null]})}):/*#__PURE__*/e(S,{children:[/*#__PURE__*/r(n,{title:"Confirm it's really you",icon:/*#__PURE__*/r(q,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${X} where your account is backed up.`}),/*#__PURE__*/e(s,{onClick:Y,children:["Confirm with ",X]})]}),/*#__PURE__*/r(l,{})]})}};export{W as RecoveryOAuthScreen,W as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as t}from"react";import{u as r}from"./context-Bj4czVEP.mjs";import{v as i,R as s}from"./index-DQp_5KKJ.mjs";import{u as a,m as n}from"./internal-context-Z-fyxadS.mjs";import{a as c,u as m}from"./privy-context-DICqtyyT.mjs";import{S as l,g as p}from"./SetWalletPasswordForm-CQWh647N.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-DMrO7evY.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-DVyBljMT.mjs";import"./useWallets-CS_W9ciB.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DDB15S8o.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"./ModalHeader-DpkEBdQv.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"./shared-zCv-_9Pa.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Checkbox-BhNoOKjX.mjs";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"./ScreenHeader-CHmc4-Lu.mjs";const u={component:()=>{let{navigate:u,data:d,onUserCloseViaDialogOrKeybindRef:h}=c(),w=r(),[y,v]=o(""),[j,f]=o(!1),[C,I]=o(),[g,x]=o(null),{create:b}=i(),{authenticated:P,user:S}=m(),{closePrivyModal:A,isNewUserThisSession:U,initializeWalletProxy:k}=a(),{onSuccess:E,onFailure:M,callAuthOnSuccessOnClose:T,shouldCreateEth:O,shouldCreateSol:W}=d.createWallet,[D,L]=o(null),R=new s((async()=>{try{let e;if(O&&W)e=await b({recoveryMethod:"user-passcode",recoveryPassword:C,chainType:"ethereum",walletIndex:0,latestUser:S}),e=await b({chainType:"solana",walletIndex:0,latestUser:e.user});else if(W)e=await b({recoveryMethod:"user-passcode",recoveryPassword:C,chainType:"solana",walletIndex:0,latestUser:S});else{if(!O)throw Error("Invalid args to create wallet");e=await b({recoveryMethod:"user-passcode",recoveryPassword:C,chainType:"ethereum",walletIndex:0,latestUser:S})}L(e),U?u("EmbeddedWalletCreatedScreen"):(E(e),A({shouldCallAuthOnSuccess:T}))}catch(e){v(e.message)}}));t((()=>{g||k(3e4).then((e=>x(e)))}),[g]),t((()=>{if(!P||!S)return u("LandingScreen"),void M(Error("User must be authenticated before creating a Privy wallet"))}),[P]),h.current=()=>null;/*#__PURE__*/return e(l,{config:{initiatedBy:"automatic"},appName:w?.name||"privy",loading:!g,buttonLoading:j,buttonHideAnimations:!D&&j,isResettingPassword:!1,error:y,password:C||"",onClose:()=>{D&&"user-passcode"!==D.account.recoveryMethod?(M(new n("User created a wallet but failed to set a password for it")),A({shouldCallAuthOnSuccess:!1})):D?(E(D),A({shouldCallAuthOnSuccess:T})):(M(new n("User wallet creation failed")),A({shouldCallAuthOnSuccess:!1}))},onPasswordChange:I,onPasswordGenerate:()=>I(p()),onSubmit:async()=>(f(!0),R.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>f(!1))))})}};export{u as EmbeddedWalletPasswordCreateScreen,u as default};
@@ -1,7 +1,7 @@
1
- import{jsxs as e,jsx as o,Fragment as r}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/LockClosedIcon";import i from"@heroicons/react/24/outline/PencilSquareIcon";import s from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as c}from"react";import{styled as n}from"styled-components";import{a,u as l,g as p}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{M as d,B as u,P as m}from"./ModalHeader-DfHxv9fE.mjs";import{C as h}from"./ScreenHeader-CHmc4-Lu.mjs";import{u as y}from"./context-Cw2-86-G.mjs";import{u as v}from"./internal-context-Z-fyxadS.mjs";import{w as g}from"./index-Bvw5OxHl.mjs";import{R as f,A as w,G as C,a as j}from"./styles-BsotlekN.mjs";import{A as k}from"./useActiveWallet-CwS7ik68.mjs";import"@privy-io/are-addresses-equal";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useWallets-2_uCkhA8.mjs";import"viem";import"./use-export-wallet-Bd5Sg5V-.mjs";import"viem/utils";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";let S=n.div`
1
+ import{jsxs as e,jsx as o,Fragment as r}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/LockClosedIcon";import i from"@heroicons/react/24/outline/PencilSquareIcon";import s from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as c}from"react";import{styled as n}from"styled-components";import{a,u as l,g as p}from"./privy-context-DICqtyyT.mjs";import{M as d,B as u,P as m}from"./ModalHeader-DpkEBdQv.mjs";import{C as h}from"./ScreenHeader-CHmc4-Lu.mjs";import{u as y}from"./context-Bj4czVEP.mjs";import{u as v}from"./internal-context-Z-fyxadS.mjs";import{w as g}from"./index-DQp_5KKJ.mjs";import{R as f,A as w,G as C,a as j}from"./styles-BsotlekN.mjs";import{A as k}from"./useActiveWallet-DMrO7evY.mjs";import"@privy-io/are-addresses-equal";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useWallets-CS_W9ciB.mjs";import"viem";import"./use-export-wallet-DVyBljMT.mjs";import"viem/utils";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DDB15S8o.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";let S=n.div`
2
2
  width: 24px;
3
3
  height: 24px;
4
4
  display: flex;
5
5
  justify-content: center;
6
6
  align-items: center;
7
- `,A={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy","privy-v2":"Privy"},x=({onClose:t})=>/*#__PURE__*/e(j,{children:[/*#__PURE__*/o(h,{title:"Why do I need to secure my account?",icon:/*#__PURE__*/o(s,{width:48}),description:/*#__PURE__*/e(r,{children:[/*#__PURE__*/o("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),/*#__PURE__*/o("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It’s important you don’t lose access to the method you choose."})]})}),/*#__PURE__*/o(m,{onClick:t,children:"Select backup method"})]});const b={component:()=>{let[s,n]=c(!1),{navigate:m,lastScreen:j,navigateBack:b,setModalData:P,data:I,onUserCloseViaDialogOrKeybindRef:M}=a(),{user:O}=l(),{embeddedWallets:W}=y(),{closePrivyModal:R}=v(),F=p(O),B=null===F,{isInAccountCreateFlow:D,isResettingPassword:E,shouldCreateEth:G,shouldCreateSol:U}=I.recoverySelection,q=F&&"privy"!==F.recoveryMethod,H=q?/*#__PURE__*/e("span",{children:["Your account is currently secured using"," ",/*#__PURE__*/o("strong",{children:A[F?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function L(e){P({recoveryOAuthStatus:{provider:e,action:B?"create-wallet":"set-recovery",isInAccountCreateFlow:D,shouldCreateEth:G,shouldCreateSol:U}}),m("RecoveryOAuthScreen")}function Y(){I?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),R({shouldCallAuthOnSuccess:I?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return M.current=Y,/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(d,{onClose:Y,backFn:s?()=>n(!1):j?b:void 0,infoFn:j||s?void 0:()=>n(!0)},"header"),s?/*#__PURE__*/o(x,{onClose:()=>n(!1)}):/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(h,{title:q?"Update backup method":"Secure your account",icon:/*#__PURE__*/o(t,{width:48}),description:H}),/*#__PURE__*/o(f,{children:W.userOwnedRecoveryOptions.filter((e=>!["icloud","google-drive"].includes(F?.recoveryMethod||"")||e!==F?.recoveryMethod)).sort().map((r=>{switch(r){case"google-drive":/*#__PURE__*/return e(k,{onClick:()=>L("google-drive"),children:[/*#__PURE__*/o(S,{children:/*#__PURE__*/o(C,{style:{width:18}})}),"Back up to Google Drive"]},r);case"icloud":/*#__PURE__*/return e(k,{onClick:()=>L("icloud"),children:[/*#__PURE__*/o(S,{children:/*#__PURE__*/o(w,{style:{width:24}})}),"Back up to Apple iCloud"]},r);case"user-passcode":/*#__PURE__*/return e(k,{onClick:()=>{m(g({isCreatingWallet:B,skipSplashScreen:!0}))},children:[/*#__PURE__*/o(S,{children:/*#__PURE__*/o(i,{style:{width:18}})}),E?"Reset your":"Set a"," password"]},r);default:return null}}))})]}),/*#__PURE__*/o(u,{})]})}};export{b as RecoverySelectionScreen,b as default};
7
+ `,x={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy","privy-v2":"Privy"},A=({onClose:t})=>/*#__PURE__*/e(j,{children:[/*#__PURE__*/o(h,{title:"Why do I need to secure my account?",icon:/*#__PURE__*/o(s,{width:48}),description:/*#__PURE__*/e(r,{children:[/*#__PURE__*/o("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),/*#__PURE__*/o("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It’s important you don’t lose access to the method you choose."})]})}),/*#__PURE__*/o(m,{onClick:t,children:"Select backup method"})]});const P={component:()=>{let[s,n]=c(!1),{navigate:m,lastScreen:j,navigateBack:P,setModalData:b,data:I,onUserCloseViaDialogOrKeybindRef:M}=a(),{user:O}=l(),{embeddedWallets:W}=y(),{closePrivyModal:R}=v(),F=p(O),B=null===F,{isInAccountCreateFlow:D,isResettingPassword:E,shouldCreateEth:G,shouldCreateSol:U}=I.recoverySelection,q=F&&"privy"!==F.recoveryMethod,H=q?/*#__PURE__*/e("span",{children:["Your account is currently secured using"," ",/*#__PURE__*/o("strong",{children:x[F?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function L(e){b({recoveryOAuthStatus:{provider:e,action:B?"create-wallet":"set-recovery",isInAccountCreateFlow:D,shouldCreateEth:G,shouldCreateSol:U}}),m("RecoveryOAuthScreen")}function Y(){I?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),R({shouldCallAuthOnSuccess:I?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return M.current=Y,/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(d,{onClose:Y,backFn:s?()=>n(!1):j?P:void 0,infoFn:j||s?void 0:()=>n(!0)},"header"),s?/*#__PURE__*/o(A,{onClose:()=>n(!1)}):/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(h,{title:q?"Update backup method":"Secure your account",icon:/*#__PURE__*/o(t,{width:48}),description:H}),/*#__PURE__*/o(f,{children:W.userOwnedRecoveryOptions.filter((e=>!["icloud","google-drive"].includes(F?.recoveryMethod||"")||e!==F?.recoveryMethod)).sort().map((r=>{switch(r){case"google-drive":/*#__PURE__*/return e(k,{onClick:()=>L("google-drive"),children:[/*#__PURE__*/o(S,{children:/*#__PURE__*/o(C,{style:{width:18}})}),"Back up to Google Drive"]},r);case"icloud":/*#__PURE__*/return e(k,{onClick:()=>L("icloud"),children:[/*#__PURE__*/o(S,{children:/*#__PURE__*/o(w,{style:{width:24}})}),"Back up to Apple iCloud"]},r);case"user-passcode":/*#__PURE__*/return e(k,{onClick:()=>{m(g({isCreatingWallet:B,skipSplashScreen:!0}))},children:[/*#__PURE__*/o(S,{children:/*#__PURE__*/o(i,{style:{width:18}})}),E?"Reset your":"Set a"," password"]},r);default:return null}}))})]}),/*#__PURE__*/o(u,{})]})}};export{P as RecoverySelectionScreen,P as default};
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import i from"react";import{styled as o}from"styled-components";import{N as n}from"./useActiveWallet-CwS7ik68.mjs";import{M as t,B as a}from"./ModalHeader-DfHxv9fE.mjs";import{N as l}from"./index-Dq_xe9dz.mjs";const c=o.div`
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import i from"react";import{styled as o}from"styled-components";import{N as n}from"./useActiveWallet-DMrO7evY.mjs";import{M as t,B as a}from"./ModalHeader-DpkEBdQv.mjs";import{N as l}from"./index-Dq_xe9dz.mjs";const c=o.div`
2
2
  /* spacing tokens */
3
3
  --screen-space: 16px; /* base 1x = 16 */
4
4
  --screen-space-lg: calc(var(--screen-space) * 1.5); /* 24px */
@@ -139,13 +139,13 @@ import{jsx as e,jsxs as r}from"react/jsx-runtime";import i from"react";import{st
139
139
  padding: 0;
140
140
  color: var(--privy-color-foreground-3);
141
141
  }
142
- `,F=o.div`
142
+ `,j=o.div`
143
143
  height: 100%;
144
144
  width: ${({pct:e})=>e}%;
145
145
  background: var(--privy-color-foreground-3);
146
146
  border-radius: 2px;
147
147
  transition: width 300ms ease-in-out;
148
- `,j=({step:r})=>r?/*#__PURE__*/e(k,{children:/*#__PURE__*/e(F,{pct:Math.min(100,r.current/r.total*100)})}):null;w.Header=({title:i,subtitle:o,icon:n,iconVariant:t,iconLoadingStatus:a,showBack:l,onBack:c,showInfo:d,onInfo:g,showClose:h,onClose:x,step:b,headerTitle:y,...k})=>/*#__PURE__*/r(s,{...k,children:[/*#__PURE__*/e(p,{backFn:l?c:void 0,infoFn:d?g:void 0,onClose:h?x:void 0,title:y,closeable:h}),(n||t||i||o)&&/*#__PURE__*/r(v,{children:[n||t?/*#__PURE__*/e(w.Icon,{icon:n,variant:t,loadingStatus:a}):null,!(!i&&!o)&&/*#__PURE__*/r(u,{children:[i&&/*#__PURE__*/e(f,{children:i}),o&&/*#__PURE__*/e(m,{children:o})]})]}),b&&/*#__PURE__*/e(j,{step:b})]}),(w.Body=/*#__PURE__*/i.forwardRef((({children:r,...i},o)=>/*#__PURE__*/e(g,{ref:o,...i,children:r})))).displayName="Screen.Body",w.Footer=({children:r,...i})=>/*#__PURE__*/e(h,{id:"privy-content-footer-container",...i,children:r}),w.Actions=({children:r,...i})=>/*#__PURE__*/e($,{...i,children:r}),w.HelpText=({children:r,...i})=>/*#__PURE__*/e(z,{...i,children:r}),w.FooterText=({children:r,...i})=>/*#__PURE__*/e(S,{...i,children:r}),w.Watermark=()=>/*#__PURE__*/e(E,{}),w.Icon=({icon:o,variant:t="subtle",loadingStatus:a})=>"logo"===t&&o?/*#__PURE__*/e(b,"string"==typeof o?{children:/*#__PURE__*/e("img",{src:o,alt:""})}:/*#__PURE__*/i.isValidElement(o)?{children:o}:{children:/*#__PURE__*/i.createElement(o)}):"loading"===t?o?
148
+ `,F=({step:r})=>r?/*#__PURE__*/e(k,{children:/*#__PURE__*/e(j,{pct:Math.min(100,r.current/r.total*100)})}):null;w.Header=({title:i,subtitle:o,icon:n,iconVariant:t,iconLoadingStatus:a,showBack:l,onBack:c,showInfo:d,onInfo:g,showClose:h,onClose:x,step:b,headerTitle:y,...k})=>/*#__PURE__*/r(s,{...k,children:[/*#__PURE__*/e(p,{backFn:l?c:void 0,infoFn:d?g:void 0,onClose:h?x:void 0,title:y,closeable:h}),(n||t||i||o)&&/*#__PURE__*/r(v,{children:[n||t?/*#__PURE__*/e(w.Icon,{icon:n,variant:t,loadingStatus:a}):null,!(!i&&!o)&&/*#__PURE__*/r(u,{children:[i&&/*#__PURE__*/e(f,{children:i}),o&&/*#__PURE__*/e(m,{children:o})]})]}),b&&/*#__PURE__*/e(F,{step:b})]}),(w.Body=/*#__PURE__*/i.forwardRef((({children:r,...i},o)=>/*#__PURE__*/e(g,{ref:o,...i,children:r})))).displayName="Screen.Body",w.Footer=({children:r,...i})=>/*#__PURE__*/e(h,{id:"privy-content-footer-container",...i,children:r}),w.Actions=({children:r,...i})=>/*#__PURE__*/e($,{...i,children:r}),w.HelpText=({children:r,...i})=>/*#__PURE__*/e(z,{...i,children:r}),w.FooterText=({children:r,...i})=>/*#__PURE__*/e(S,{...i,children:r}),w.Watermark=()=>/*#__PURE__*/e(E,{}),w.Icon=({icon:o,variant:t="subtle",loadingStatus:a})=>"logo"===t&&o?/*#__PURE__*/e(b,"string"==typeof o?{children:/*#__PURE__*/e("img",{src:o,alt:""})}:/*#__PURE__*/i.isValidElement(o)?{children:o}:{children:/*#__PURE__*/i.createElement(o)}):"loading"===t?o?
149
149
  /*#__PURE__*/e(y,{children:/*#__PURE__*/r("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[/*#__PURE__*/e(n,{success:a?.success,fail:a?.fail}),"string"==typeof o?
150
150
  /*#__PURE__*/e("span",{style:{background:`url('${o}') 0 0 / contain`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"contain"}}):/*#__PURE__*/i.isValidElement(o)?
151
151
  /*#__PURE__*/i.cloneElement(o,{style:{width:"38px",height:"38px"}}):
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as r,jsx as l}from"react/jsx-runtime";import{a as t}from"./ModalHeader-DfHxv9fE.mjs";import{S as a}from"./Screen-CDEd4p2a.mjs";const n=({primaryCta:n,secondaryCta:i,helpText:d,footerText:o,watermark:c=!0,children:s,...m})=>{let h=n||i?/*#__PURE__*/e(r,{children:[n&&(()=>{let{label:e,...r}=n,a=r.variant||"primary";/*#__PURE__*/return l(t,{...r,variant:a,style:{width:"100%",...r.style},children:e})})(),i&&(()=>{let{label:e,...r}=i,a=r.variant||"secondary";/*#__PURE__*/return l(t,{...r,variant:a,style:{width:"100%",...r.style},children:e})})()]}):null;/*#__PURE__*/return e(a,{id:m.id,className:m.className,children:[/*#__PURE__*/l(a.Header,{...m}),s?/*#__PURE__*/l(a.Body,{children:s}):null,d||h||c?/*#__PURE__*/e(a.Footer,{children:[d?/*#__PURE__*/l(a.HelpText,{children:d}):null,h?/*#__PURE__*/l(a.Actions,{children:h}):null,c?/*#__PURE__*/l(a.Watermark,{}):null]}):null,o?/*#__PURE__*/l(a.FooterText,{children:o}):null]})};export{n as S};
1
+ import{jsxs as e,Fragment as r,jsx as l}from"react/jsx-runtime";import{a as t}from"./ModalHeader-DpkEBdQv.mjs";import{S as a}from"./Screen-B0u1eY7p.mjs";const n=({primaryCta:n,secondaryCta:i,helpText:d,footerText:o,watermark:c=!0,children:s,...m})=>{let h=n||i?/*#__PURE__*/e(r,{children:[n&&(()=>{let{label:e,...r}=n,a=r.variant||"primary";/*#__PURE__*/return l(t,{...r,variant:a,style:{width:"100%",...r.style},children:e})})(),i&&(()=>{let{label:e,...r}=i,a=r.variant||"secondary";/*#__PURE__*/return l(t,{...r,variant:a,style:{width:"100%",...r.style},children:e})})()]}):null;/*#__PURE__*/return e(a,{id:m.id,className:m.className,children:[/*#__PURE__*/l(a.Header,{...m}),s?/*#__PURE__*/l(a.Body,{children:s}):null,d||h||c?/*#__PURE__*/e(a.Footer,{children:[d?/*#__PURE__*/l(a.HelpText,{children:d}):null,h?/*#__PURE__*/l(a.Actions,{children:h}):null,c?/*#__PURE__*/l(a.Watermark,{}):null]}):null,o?/*#__PURE__*/l(a.FooterText,{children:o}):null]})};export{n as S};
@@ -0,0 +1,112 @@
1
+ import{k as e}from"./use-export-wallet-DVyBljMT.mjs";import{jsxs as r,jsx as t}from"react/jsx-runtime";import{ChevronDown as o}from"lucide-react";import{useState as n,useRef as i,useCallback as a,useMemo as l}from"react";import{styled as s}from"styled-components";import{K as d}from"./index-DQp_5KKJ.mjs";import{S as c}from"./ScreenLayout-CyK-vOMq.mjs";const u=async({operation:r,until:t,delay:o,interval:n,attempts:i,signal:a})=>{let l,s=0;for(;s<i;){if(a?.aborted)return{status:"aborted",result:l,attempts:s};s++;try{if(l=await r(),t(l))return{status:"success",result:l,attempts:s};s<i&&await e(n)}catch(r){s<i&&await e(n)}}return{status:"max_attempts",result:l,attempts:s}},m=e=>{try{return e.location.origin}catch{return}},p=async(e,r)=>{let t=await u({operation:async()=>({done:m(e)===window.location.origin,closed:e.closed}),until:({done:e,closed:r})=>e||r,delay:0,interval:500,attempts:360,signal:r});return"aborted"===t.status?(e.close(),{status:"aborted"}):"max_attempts"===t.status?{status:"timeout"}:t.result.done?(e.close(),{status:"redirected"}):{status:"closed"}},f=({currency:e="usd",value:o,onChange:s,inputMode:c="decimal",autoFocus:u})=>{let[m,p]=n("0"),f=i(null),h=o??m,v=d[e]?.symbol??"$",w=a((e=>{let r=e.target.value,t=(r=r.replace(/[^\d.]/g,"")).split(".");t.length>2&&(r=t[0]+"."+t.slice(1).join("")),2===t.length&&t[1].length>2&&(r=`${t[0]}.${t[1].slice(0,2)}`),r.length>1&&"0"===r[0]&&"."!==r[1]&&(r=r.slice(1)),(""===r||"."===r)&&(r="0"),s?s(r):p(r)}),[s]),b=a((e=>{!(["Delete","Backspace","Tab","Escape","Enter",".","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)||(e.ctrlKey||e.metaKey)&&["a","c","v","x"].includes(e.key.toLowerCase()))&&(e.key>="0"&&e.key<="9"||e.preventDefault())}),[]),x=l((()=>(h.includes("."),h)),[h]);/*#__PURE__*/return r(g,{onClick:()=>f.current?.focus(),children:[/*#__PURE__*/t(y,{children:v}),x,/*#__PURE__*/t("input",{ref:f,type:"text",inputMode:c,value:x,onChange:w,onKeyDown:b,autoFocus:u,placeholder:"0",style:{width:1,height:"1rem",opacity:0,alignSelf:"center",fontSize:"1rem"}}),/*#__PURE__*/t(y,{style:{opacity:0},children:v})]})},h=({selectedAsset:e,onEditSourceAsset:n})=>{let{icon:i}=d[e];/*#__PURE__*/return r(v,{onClick:n,children:[/*#__PURE__*/t(w,{children:i}),/*#__PURE__*/t(b,{children:e.toLocaleUpperCase()}),/*#__PURE__*/t(x,{children:/*#__PURE__*/t(o,{})})]})};let g=s.span`
2
+ background-color: var(--privy-color-background);
3
+ width: 100%;
4
+ text-align: center;
5
+ border: none;
6
+ font-kerning: none;
7
+ font-feature-settings: 'calt' off;
8
+ display: flex;
9
+ justify-content: center;
10
+ align-items: flex-start;
11
+ cursor: pointer;
12
+
13
+ &:focus {
14
+ outline: none !important;
15
+ border: none !important;
16
+ box-shadow: none !important;
17
+ }
18
+
19
+ && {
20
+ color: var(--privy-color-foreground);
21
+ font-size: 3.75rem;
22
+ font-style: normal;
23
+ font-weight: 600;
24
+ line-height: 5.375rem;
25
+ }
26
+ `,y=s.span`
27
+ color: var(--privy-color-foreground);
28
+ font-kerning: none;
29
+ font-feature-settings: 'calt' off;
30
+ font-size: 1rem;
31
+ font-style: normal;
32
+ font-weight: 600;
33
+ line-height: 1.5rem;
34
+ margin-top: 0.75rem;
35
+ `,v=s.button`
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: space-between;
39
+ width: auto;
40
+ gap: 0.5rem;
41
+ border: 1px solid var(--privy-color-border-default);
42
+ border-radius: var(--privy-border-radius-full);
43
+
44
+ && {
45
+ margin: auto;
46
+ padding: 0.5rem 1rem;
47
+ }
48
+ `,w=s.div`
49
+ svg {
50
+ width: 1rem;
51
+ height: 1rem;
52
+ border-radius: var(--privy-border-radius-full);
53
+ overflow: hidden;
54
+ }
55
+ `,b=s.span`
56
+ color: var(--privy-color-foreground);
57
+ font-kerning: none;
58
+ font-feature-settings: 'calt' off;
59
+ font-size: 0.875rem;
60
+ font-style: normal;
61
+ font-weight: 500;
62
+ line-height: 1.375rem;
63
+ `,x=s.div`
64
+ color: var(--privy-color-foreground);
65
+
66
+ svg {
67
+ width: 1.25rem;
68
+ height: 1.25rem;
69
+ }
70
+ `;const k=({opts:e,isLoading:o,onSelectSource:n})=>/*#__PURE__*/t(c,{showClose:!1,showBack:!0,onBack:()=>n(e.source.selectedAsset),title:"Select currency",children:/*#__PURE__*/t(C,{children:e.source.assets.map((e=>{let{icon:i,name:a}=d[e];/*#__PURE__*/return t(S,{onClick:()=>n(e),disabled:o,children:/*#__PURE__*/r(A,{children:[/*#__PURE__*/t(j,{children:i}),/*#__PURE__*/r(L,{children:[/*#__PURE__*/t(z,{children:a}),/*#__PURE__*/t(D,{children:e.toLocaleUpperCase()})]})]})},e)}))})});let C=s.div`
71
+ display: flex;
72
+ flex-direction: column;
73
+ gap: 0.75rem;
74
+ width: 100%;
75
+ `,S=s.button`
76
+ border-color: var(--privy-color-border-default);
77
+ border-width: 1px;
78
+ border-radius: var(--privy-border-radius-mdlg);
79
+ border-style: solid;
80
+ display: flex;
81
+
82
+ && {
83
+ padding: 0.75rem 1rem;
84
+ }
85
+ `,A=s.div`
86
+ display: flex;
87
+ align-items: center;
88
+ gap: 1rem;
89
+ width: 100%;
90
+ `,j=s.div`
91
+ svg {
92
+ width: 2.25rem;
93
+ height: 2.25rem;
94
+ border-radius: var(--privy-border-radius-full);
95
+ overflow: hidden;
96
+ }
97
+ `,L=s.div`
98
+ display: flex;
99
+ flex-direction: column;
100
+ align-items: flex-start;
101
+ gap: 0.125rem;
102
+ `,z=s.span`
103
+ color: var(--privy-color-foreground);
104
+ font-size: 0.875rem;
105
+ font-weight: 600;
106
+ line-height: 1.25rem;
107
+ `,D=s.span`
108
+ color: var(--privy-color-foreground-3);
109
+ font-size: 0.75rem;
110
+ font-weight: 400;
111
+ line-height: 1.125rem;
112
+ `;export{f as A,h as C,k as S,u as a,p};
@@ -1,4 +1,4 @@
1
- import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ExclamationTriangleIcon";import i from"@heroicons/react/24/outline/LockClosedIcon";import{useState as n}from"react";import{u as l,a,j as s}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{M as c,c as m,B as d}from"./ModalHeader-DfHxv9fE.mjs";import{styled as p}from"styled-components";import{S as u}from"./Subtitle-CV-2yKE4.mjs";import{T as y}from"./Title-BnzYV3Is.mjs";import{q as f}from"./context-Cw2-86-G.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{G as v}from"./useActiveWallet-CwS7ik68.mjs";import"@privy-io/are-addresses-equal";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"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";const g=p.div`
1
+ import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ExclamationTriangleIcon";import i from"@heroicons/react/24/outline/LockClosedIcon";import{useState as n}from"react";import{u as l,a,j as s}from"./privy-context-DICqtyyT.mjs";import{M as c,c as m,B as d}from"./ModalHeader-DpkEBdQv.mjs";import{styled as p}from"styled-components";import{S as u}from"./Subtitle-CV-2yKE4.mjs";import{T as y}from"./Title-BnzYV3Is.mjs";import{q as h}from"./context-Bj4czVEP.mjs";import{u as f}from"./internal-context-Z-fyxadS.mjs";import{G as v}from"./useActiveWallet-DMrO7evY.mjs";import"@privy-io/are-addresses-equal";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"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./use-export-wallet-DVyBljMT.mjs";import"./useWallets-CS_W9ciB.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";const g=p.div`
2
2
  && {
3
3
  border-width: 4px;
4
4
  }
@@ -11,4 +11,4 @@ import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import t from"@h
11
11
  border-style: solid;
12
12
  border-color: ${e=>e.$color??"var(--privy-color-accent)"};
13
13
  border-radius: 50%;
14
- `,w={component:()=>{let{user:p}=l(),{client:w,walletProxy:j,refreshSessionAndUser:x,closePrivyModal:I}=h(),b=a(),{entropyId:T,entropyIdVerifier:k}=b.data?.recoverWallet,[C,M]=n(!1),[S,W]=n(null),[A,U]=n(null);function E(){if(!C){if(A)return b.data?.setWalletPassword?.onFailure(A),void I();if(!S)return b.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void I()}}b.onUserCloseViaDialogOrKeybindRef.current=E;let P=!(!C&&!S);/*#__PURE__*/return e(r,A?{children:[/*#__PURE__*/o(c,{onClose:E},"header"),/*#__PURE__*/o(g,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:/*#__PURE__*/o(t,{height:38,width:38,stroke:"var(--privy-color-error)"})}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(m,{onClick:()=>U(null),children:"Try again"}),/*#__PURE__*/o(d,{})]}:{children:[/*#__PURE__*/o(c,{onClose:E},"header"),/*#__PURE__*/o(i,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),/*#__PURE__*/o(u,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(m,{loading:C,disabled:P,onClick:()=>async function(){M(!0);try{let e=await w.getAccessToken(),r=s(p,T);if(!e||!j||!r)return;if(!(await j.setRecovery({accessToken:e,entropyId:T,entropyIdVerifier:k,existingRecoveryMethod:r.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let o=await x();if(!o)throw Error("Unable to set recovery on wallet");let t=s(o,r.address);if(!t)throw Error("Unabled to set recovery on wallet");W(!!o),setTimeout((()=>{b.data?.setWalletPassword?.onSuccess(t),I()}),f)}catch(e){U(e)}finally{M(!1)}}(),children:S?"Success":"Confirm"}),/*#__PURE__*/o(d,{})]})}};export{w as SetAutomaticRecoveryScreen,w as default};
14
+ `,w={component:()=>{let{user:p}=l(),{client:w,walletProxy:j,refreshSessionAndUser:x,closePrivyModal:b}=f(),I=a(),{entropyId:T,entropyIdVerifier:k}=I.data?.recoverWallet,[C,M]=n(!1),[S,W]=n(null),[A,U]=n(null);function E(){if(!C){if(A)return I.data?.setWalletPassword?.onFailure(A),void b();if(!S)return I.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void b()}}I.onUserCloseViaDialogOrKeybindRef.current=E;let P=!(!C&&!S);/*#__PURE__*/return e(r,A?{children:[/*#__PURE__*/o(c,{onClose:E},"header"),/*#__PURE__*/o(g,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:/*#__PURE__*/o(t,{height:38,width:38,stroke:"var(--privy-color-error)"})}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(m,{onClick:()=>U(null),children:"Try again"}),/*#__PURE__*/o(d,{})]}:{children:[/*#__PURE__*/o(c,{onClose:E},"header"),/*#__PURE__*/o(i,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),/*#__PURE__*/o(u,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(m,{loading:C,disabled:P,onClick:()=>async function(){M(!0);try{let e=await w.getAccessToken(),r=s(p,T);if(!e||!j||!r)return;if(!(await j.setRecovery({accessToken:e,entropyId:T,entropyIdVerifier:k,existingRecoveryMethod:r.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let o=await x();if(!o)throw Error("Unable to set recovery on wallet");let t=s(o,r.address);if(!t)throw Error("Unabled to set recovery on wallet");W(!!o),setTimeout((()=>{I.data?.setWalletPassword?.onSuccess(t),b()}),h)}catch(e){U(e)}finally{M(!1)}}(),children:S?"Success":"Confirm"}),/*#__PURE__*/o(d,{})]})}};export{w as SetAutomaticRecoveryScreen,w as default};
@@ -1,12 +1,12 @@
1
- import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as i,useMemo as t,useCallback as a,useReducer as l}from"react";import{q as c}from"./context-Cw2-86-G.mjs";import{a as s}from"./get-is-unified-wallet-CQc-E5dS.mjs";import d from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{b as h,R as u,c as p}from"./Layouts-BlFm53ED.mjs";import{M as m,B as g,S as y,P as v}from"./ModalHeader-DfHxv9fE.mjs";import{E as f,b as w,P as b,a as k,I as C,H as S,S as x,c as $,N as B,D as R,d as P,R as A,e as I,f as j,g as L}from"./shared-Bw0pXSOO.mjs";import{styled as E}from"styled-components";import{C as T}from"./Checkbox-BhNoOKjX.mjs";import z from"@heroicons/react/24/outline/KeyIcon";import D from"@heroicons/react/24/solid/CheckCircleIcon";import H from"fast-password-entropy";import*as U from"secure-password-utilities";import{DEFAULT_WORDLIST as F}from"secure-password-utilities/wordlists";import M from"@heroicons/react/24/outline/ArrowDownTrayIcon";import K from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import O from"@heroicons/react/24/outline/DocumentDuplicateIcon";import N from"@heroicons/react/24/solid/XCircleIcon";import{C as W}from"./ScreenHeader-CHmc4-Lu.mjs";const Y=({buttonHideAnimations:t,buttonLoading:a,password:l,onSubmit:c,onBack:s})=>{let[p,y]=n(!0),[v,R]=n(!1),[P,A]=n(""),I=l===P;return i((()=>{P&&!v&&R(!0)}),[P]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:s}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e(b,{children:[/*#__PURE__*/o(k,{value:P,onChange:e=>A(e.target.value),onKeyUp:e=>{"Enter"===e.key&&c()},onBlur:()=>R(!0),placeholder:"confirm your password",type:p?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/o(C,{style:{right:"0.75rem"},children:p?/*#__PURE__*/o(S,{onClick:()=>y(!1)}):/*#__PURE__*/o(x,{onClick:()=>y(!0)})})]}),
2
- /*#__PURE__*/o($,{"aria-hidden":!v||I,error:!0,children:"Passwords do not match"})]}),/*#__PURE__*/o(B,{onClick:c,loading:a,disabled:!I,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/o(u,{}),/*#__PURE__*/o(g,{})]})},Z=({buttonHideAnimations:i,buttonLoading:t,onSubmit:a,onBack:l,config:c})=>{let[s,p]=n(!1);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:l}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),/*#__PURE__*/o(R,{children:/*#__PURE__*/e(P,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),p((e=>!e))},children:[/*#__PURE__*/o(T,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),/*#__PURE__*/o(r,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),/*#__PURE__*/e(_,{children:["user"===c.initiatedBy&&/*#__PURE__*/o(y,{onClick:c.onCancel,disabled:t,children:"Cancel"}),/*#__PURE__*/o(B,{onClick:a,loading:t,$hideAnimations:i,disabled:!s,children:"Set Password"})]}),/*#__PURE__*/o(u,{}),/*#__PURE__*/o(g,{})]})};let _=E.div`
1
+ import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as i,useMemo as t,useCallback as a,useReducer as l}from"react";import{q as c}from"./context-Bj4czVEP.mjs";import{a as s}from"./privy-context-DICqtyyT.mjs";import d from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{b as h,R as p,c as u}from"./Layouts-BlFm53ED.mjs";import{M as m,B as g,S as y,P as v}from"./ModalHeader-DpkEBdQv.mjs";import{E as f,b as w,P as b,a as k,I as C,H as S,S as x,c as $,N as B,D as R,d as P,R as j,e as A,f as I,g as L}from"./shared-zCv-_9Pa.mjs";import{styled as E}from"styled-components";import{C as U}from"./Checkbox-BhNoOKjX.mjs";import z from"@heroicons/react/24/outline/KeyIcon";import D from"@heroicons/react/24/solid/CheckCircleIcon";import H from"fast-password-entropy";import*as T from"secure-password-utilities";import{DEFAULT_WORDLIST as F}from"secure-password-utilities/wordlists";import M from"@heroicons/react/24/outline/ArrowDownTrayIcon";import K from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import O from"@heroicons/react/24/outline/DocumentDuplicateIcon";import N from"@heroicons/react/24/solid/XCircleIcon";import{C as W}from"./ScreenHeader-CHmc4-Lu.mjs";const Y=({buttonHideAnimations:t,buttonLoading:a,password:l,onSubmit:c,onBack:s})=>{let[u,y]=n(!0),[v,R]=n(!1),[P,j]=n(""),A=l===P;return i((()=>{P&&!v&&R(!0)}),[P]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:s}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e(b,{children:[/*#__PURE__*/o(k,{value:P,onChange:e=>j(e.target.value),onKeyUp:e=>{"Enter"===e.key&&c()},onBlur:()=>R(!0),placeholder:"confirm your password",type:u?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/o(C,{style:{right:"0.75rem"},children:u?/*#__PURE__*/o(S,{onClick:()=>y(!1)}):/*#__PURE__*/o(x,{onClick:()=>y(!0)})})]}),
2
+ /*#__PURE__*/o($,{"aria-hidden":!v||A,error:!0,children:"Passwords do not match"})]}),/*#__PURE__*/o(B,{onClick:c,loading:a,disabled:!A,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})},Z=({buttonHideAnimations:i,buttonLoading:t,onSubmit:a,onBack:l,config:c})=>{let[s,u]=n(!1);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:l}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),/*#__PURE__*/o(R,{children:/*#__PURE__*/e(P,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),u((e=>!e))},children:[/*#__PURE__*/o(U,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),/*#__PURE__*/o(r,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),/*#__PURE__*/e(_,{children:["user"===c.initiatedBy&&/*#__PURE__*/o(y,{onClick:c.onCancel,disabled:t,children:"Cancel"}),/*#__PURE__*/o(B,{onClick:a,loading:t,$hideAnimations:i,disabled:!s,children:"Set Password"})]}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let _=E.div`
3
3
  display: flex;
4
4
  gap: 10px;
5
- `,q=/[a-z]/,G=/[A-Z]/,X=/[0-9]/,J="!@#$%^&*()\\-_+.",Q=`a-zA-Z0-9${J}`,V=RegExp(`[${J}]`),ee=RegExp(`[${Q}]`);const re=RegExp(`^[${Q}]{6,}$`),oe=()=>U.generatePassphrase(4,F);function ne(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function ie(e=""){return(.3*function(e){if(e.length<8)return 0;let r=0;return q.test(e)&&(r+=1),G.test(e)&&(r+=1),X.test(e)&&(r+=1),V.test(e)&&(r+=1),Math.max(0,Math.min(1,r/3))}(e)+H(e)/95)/2}const te=({buttonHideAnimations:a,buttonLoading:l,password:c="",config:s,isResettingPassword:d,onSubmit:p,onClose:y,onBack:v,onPasswordChange:j,onPasswordGenerate:L})=>{let[E,T]=n(!1),[H,U]=n(!1);i((()=>{c&&!H&&U(!0)}),[c]);let F=t((()=>H?6>(c?.length||0)?"Password must be at least 6 characters":re.test(c||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!ee.test(e))).map((e=>e.replace(" ","SPACE"))))])(c).join(" ")} )`:null),[c,H]),M=t((()=>F?{value:0,label:"Weak"}:function(e=""){let r=ie(e);return{value:r,label:ne(r)}}(c)),[c,F]),K=t((()=>!c?.length||!!F),[F,c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{onClose:y,closeable:"user"===s.initiatedBy,backFn:v}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(z,{height:48,width:48,stroke:"var(--privy-color-accent)"}),/*#__PURE__*/e("h3",{style:{color:"var(--privy-color-foreground)"},children:[d?"Reset":"Set"," your password"]}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),/*#__PURE__*/e(b,{children:[/*#__PURE__*/o(k,{value:c,onChange:e=>j(e.target.value),onKeyUp:e=>{"Enter"===e.key&&p()},placeholder:"enter or generate a strong password",type:E?"password":"text",style:{paddingRight:"3.8rem"}}),/*#__PURE__*/e(C,{style:{width:"3.5rem"},children:[E?/*#__PURE__*/o(S,{onClick:()=>T(!1)}):/*#__PURE__*/o(x,{onClick:()=>T(!0)}),/*#__PURE__*/o(A,{onClick:L})]})]}),/*#__PURE__*/o(I,{value:0===M.value?.01:M.value,label:M.label}),/*#__PURE__*/o($,{error:!!F,children:F||`Password Strength: ${H?M.label:"--"}`}),/*#__PURE__*/e(le,{children:[/*#__PURE__*/o(ae,{children:/*#__PURE__*/e(R,{children:[/*#__PURE__*/e(P,{children:[/*#__PURE__*/o(D,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),/*#__PURE__*/e(P,{children:[/*#__PURE__*/o(D,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),/*#__PURE__*/o(B,{onClick:p,loading:l,disabled:K,$hideAnimations:a,children:"Continue"})]})]}),/*#__PURE__*/o(u,{}),/*#__PURE__*/o(g,{})]})};let ae=E(R)`
5
+ `,q=/[a-z]/,G=/[A-Z]/,X=/[0-9]/,J="!@#$%^&*()\\-_+.",Q=`a-zA-Z0-9${J}`,V=RegExp(`[${J}]`),ee=RegExp(`[${Q}]`);const re=RegExp(`^[${Q}]{6,}$`),oe=()=>T.generatePassphrase(4,F);function ne(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function ie(e=""){return(.3*function(e){if(e.length<8)return 0;let r=0;return q.test(e)&&(r+=1),G.test(e)&&(r+=1),X.test(e)&&(r+=1),V.test(e)&&(r+=1),Math.max(0,Math.min(1,r/3))}(e)+H(e)/95)/2}const te=({buttonHideAnimations:a,buttonLoading:l,password:c="",config:s,isResettingPassword:d,onSubmit:u,onClose:y,onBack:v,onPasswordChange:I,onPasswordGenerate:L})=>{let[E,U]=n(!1),[H,T]=n(!1);i((()=>{c&&!H&&T(!0)}),[c]);let F=t((()=>H?6>(c?.length||0)?"Password must be at least 6 characters":re.test(c||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!ee.test(e))).map((e=>e.replace(" ","SPACE"))))])(c).join(" ")} )`:null),[c,H]),M=t((()=>F?{value:0,label:"Weak"}:function(e=""){let r=ie(e);return{value:r,label:ne(r)}}(c)),[c,F]),K=t((()=>!c?.length||!!F),[F,c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{onClose:y,closeable:"user"===s.initiatedBy,backFn:v}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(z,{height:48,width:48,stroke:"var(--privy-color-accent)"}),/*#__PURE__*/e("h3",{style:{color:"var(--privy-color-foreground)"},children:[d?"Reset":"Set"," your password"]}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),/*#__PURE__*/e(b,{children:[/*#__PURE__*/o(k,{value:c,onChange:e=>I(e.target.value),onKeyUp:e=>{"Enter"===e.key&&u()},placeholder:"enter or generate a strong password",type:E?"password":"text",style:{paddingRight:"3.8rem"}}),/*#__PURE__*/e(C,{style:{width:"3.5rem"},children:[E?/*#__PURE__*/o(S,{onClick:()=>U(!1)}):/*#__PURE__*/o(x,{onClick:()=>U(!0)}),/*#__PURE__*/o(j,{onClick:L})]})]}),/*#__PURE__*/o(A,{value:0===M.value?.01:M.value,label:M.label}),/*#__PURE__*/o($,{error:!!F,children:F||`Password Strength: ${H?M.label:"--"}`}),/*#__PURE__*/e(le,{children:[/*#__PURE__*/o(ae,{children:/*#__PURE__*/e(R,{children:[/*#__PURE__*/e(P,{children:[/*#__PURE__*/o(D,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),/*#__PURE__*/e(P,{children:[/*#__PURE__*/o(D,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),/*#__PURE__*/o(B,{onClick:u,loading:l,disabled:K,$hideAnimations:a,children:"Continue"})]})]}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let ae=E(R)`
6
6
  flex: 1;
7
7
  padding-top: 1rem;
8
8
  `,le=E.div`
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  height: 100%;
12
- `;const ce=({buttonHideAnimations:i,buttonLoading:t,appName:l,password:c,onSubmit:s,onBack:p})=>{let[y,v]=n(!1),[k,$]=n(!0),R=a((()=>{v(!0),c&&navigator.clipboard.writeText(c)}),[c]),P=a((()=>{let e=document.createElement("a"),r=l.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),o=new Blob([se(l,c)],{type:"text/plain"}),n=URL.createObjectURL(o);e.href=n,e.target="_blank",e.download=`${r}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(n)}),5e3)}),[c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{backFn:p,closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),/*#__PURE__*/e(b,{centered:!0,children:[/*#__PURE__*/o(j,{children:k?"•".repeat(c.length):c}),/*#__PURE__*/o(C,{style:{right:"0.75rem"},children:k?/*#__PURE__*/o(S,{onClick:()=>$(!1)}):/*#__PURE__*/o(x,{onClick:()=>$(!0)})})]}),/*#__PURE__*/e("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[/*#__PURE__*/o(L,{onClick:R,children:/*#__PURE__*/e(r,y?{children:[/*#__PURE__*/o(K,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[/*#__PURE__*/o(O,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),/*#__PURE__*/e(L,{onClick:P,children:[/*#__PURE__*/o(M,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),/*#__PURE__*/o(B,{onClick:s,loading:t,$hideAnimations:i,children:"Continue"}),/*#__PURE__*/o(u,{}),/*#__PURE__*/o(g,{})]})};let se=(e,r)=>`Your wallet recovery password for ${e} is\n\n${r}\n\nYou will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;const de=({error:n,onClose:i})=>/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(p,n?{children:[/*#__PURE__*/o(N,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Something went wrong",description:n})]}:{children:[/*#__PURE__*/o(D,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Success"})]}),/*#__PURE__*/o(v,{onClick:i,children:"Close"}),/*#__PURE__*/o(u,{}),/*#__PURE__*/o(g,{})]});let he=(e,r)=>{switch(e){case"creating":return"back"===r?e:"saving";case"saving":return"back"===r?"creating":"confirming";case"confirming":return"back"===r?"saving":"finalizing";case"finalizing":return"back"===r?"confirming":"done";default:return e}};const ue=({onSubmit:e,...r})=>{let{lastScreen:n,navigate:t}=s(),{send:d,state:h}=(()=>{let[e,r]=l(he,"creating");return{send:r,state:e}})(),u=a((async()=>{"finalizing"===h&&await e(),d("next")}),[h,d,e]);i((()=>{let e;return"done"===h&&"automatic"===r.config.initiatedBy&&(e=setTimeout((()=>r.onClose?.()),c)),()=>{e&&clearTimeout(e)}}),[h,r.config.initiatedBy,r.onClose]);let p=a((()=>{d("back")}),[d]),m=a((()=>{t("RecoverySelectionScreen")}),[n,t]);return"creating"===h?/*#__PURE__*/o(te,{...r,onSubmit:u,onBack:"RecoverySelectionScreen"===n?m:void 0}):"saving"===h?/*#__PURE__*/o(ce,{...r,onSubmit:u,onBack:p}):"confirming"===h?/*#__PURE__*/o(Y,{...r,onSubmit:u,onBack:p}):"finalizing"===h?/*#__PURE__*/o(Z,{...r,onSubmit:u,onBack:p}):"done"===h?/*#__PURE__*/o(de,{...r,onSubmit:u}):null};export{ue as S,oe as g};
12
+ `;const ce=({buttonHideAnimations:i,buttonLoading:t,appName:l,password:c,onSubmit:s,onBack:u})=>{let[y,v]=n(!1),[k,$]=n(!0),R=a((()=>{v(!0),c&&navigator.clipboard.writeText(c)}),[c]),P=a((()=>{let e=document.createElement("a"),r=l.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),o=new Blob([se(l,c)],{type:"text/plain"}),n=URL.createObjectURL(o);e.href=n,e.target="_blank",e.download=`${r}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(n)}),5e3)}),[c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{backFn:u,closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),/*#__PURE__*/e(b,{centered:!0,children:[/*#__PURE__*/o(I,{children:k?"•".repeat(c.length):c}),/*#__PURE__*/o(C,{style:{right:"0.75rem"},children:k?/*#__PURE__*/o(S,{onClick:()=>$(!1)}):/*#__PURE__*/o(x,{onClick:()=>$(!0)})})]}),/*#__PURE__*/e("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[/*#__PURE__*/o(L,{onClick:R,children:/*#__PURE__*/e(r,y?{children:[/*#__PURE__*/o(K,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[/*#__PURE__*/o(O,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),/*#__PURE__*/e(L,{onClick:P,children:[/*#__PURE__*/o(M,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),/*#__PURE__*/o(B,{onClick:s,loading:t,$hideAnimations:i,children:"Continue"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let se=(e,r)=>`Your wallet recovery password for ${e} is\n\n${r}\n\nYou will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;const de=({error:n,onClose:i})=>/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(u,n?{children:[/*#__PURE__*/o(N,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Something went wrong",description:n})]}:{children:[/*#__PURE__*/o(D,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Success"})]}),/*#__PURE__*/o(v,{onClick:i,children:"Close"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]});let he=(e,r)=>{switch(e){case"creating":return"back"===r?e:"saving";case"saving":return"back"===r?"creating":"confirming";case"confirming":return"back"===r?"saving":"finalizing";case"finalizing":return"back"===r?"confirming":"done";default:return e}};const pe=({onSubmit:e,...r})=>{let{lastScreen:n,navigate:t}=s(),{send:d,state:h}=(()=>{let[e,r]=l(he,"creating");return{send:r,state:e}})(),p=a((async()=>{"finalizing"===h&&await e(),d("next")}),[h,d,e]);i((()=>{let e;return"done"===h&&"automatic"===r.config.initiatedBy&&(e=setTimeout((()=>r.onClose?.()),c)),()=>{e&&clearTimeout(e)}}),[h,r.config.initiatedBy,r.onClose]);let u=a((()=>{d("back")}),[d]),m=a((()=>{t("RecoverySelectionScreen")}),[n,t]);return"creating"===h?/*#__PURE__*/o(te,{...r,onSubmit:p,onBack:"RecoverySelectionScreen"===n?m:void 0}):"saving"===h?/*#__PURE__*/o(ce,{...r,onSubmit:p,onBack:u}):"confirming"===h?/*#__PURE__*/o(Y,{...r,onSubmit:p,onBack:u}):"finalizing"===h?/*#__PURE__*/o(Z,{...r,onSubmit:p,onBack:u}):"done"===h?/*#__PURE__*/o(de,{...r,onSubmit:p}):null};export{pe as S,oe as g};
@@ -0,0 +1,26 @@
1
+ import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{base64 as r}from"@scure/base";import{Edit as i}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s}from"styled-components";import{isHex as l,hexToString as c}from"viem";import{ProviderErrors as m}from"@privy-io/js-sdk-core";import{C as p}from"./CopyToClipboard-DSTf_eKU.mjs";import{a as d}from"./Layouts-BlFm53ED.mjs";import{M as u,D as g}from"./JsonTree-aPaJmPx7.mjs";import{P as y,G as h}from"./use-export-wallet-DVyBljMT.mjs";import{W as f,q as x}from"./context-Bj4czVEP.mjs";import{u as C}from"./internal-context-Z-fyxadS.mjs";import{u as v,a as b}from"./privy-context-DICqtyyT.mjs";import{S as w}from"./ScreenLayout-CyK-vOMq.mjs";import"./useWallets-CS_W9ciB.mjs";import"eventemitter3";import"viem/utils";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-DpkEBdQv.mjs";import"./useActiveWallet-DMrO7evY.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.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-B0u1eY7p.mjs";import"./index-Dq_xe9dz.mjs";const j=s.img`
2
+ && {
3
+ height: ${e=>"sm"===e.size?"65px":"140px"};
4
+ width: ${e=>"sm"===e.size?"65px":"140px"};
5
+ border-radius: 16px;
6
+ margin-bottom: 12px;
7
+ }
8
+ `;let T=e=>{if(!l(e))return e;try{let t=c(e);return t.includes("�")?e:t}catch{return e}},S=e=>{try{let t=r.decode(e),o=(new TextDecoder).decode(t);return o.includes("�")?e:o}catch{return e}},E=r=>{let{types:i,primaryType:n,...a}=r.typedData;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(A,{data:a}),/*#__PURE__*/e(p,{text:(s=r.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const L=({method:o,messageData:r,copy:n,iconUrl:a,isLoading:s,success:l,walletProxyIsLoading:c,errorMessage:m,isCancellable:p,onSign:u,onCancel:g,onClose:y})=>/*#__PURE__*/e(w,{title:n.title,subtitle:n.description,showClose:!0,onClose:y,icon:i,iconVariant:"subtle",helpText:m?/*#__PURE__*/e(D,{children:m}):void 0,primaryCta:{label:n.buttonText,onClick:u,disabled:s||l||c,loading:s},secondaryCta:p?{label:"Not now",onClick:g,disabled:s||l||c}:void 0,watermark:!0,children:/*#__PURE__*/t(d,{children:[a?/*#__PURE__*/e(j,{style:{alignSelf:"center"},size:"sm",src:a,alt:"app image"}):null,/*#__PURE__*/t(_,{children:["personal_sign"===o&&/*#__PURE__*/e(U,{children:T(r)}),"eth_signTypedData_v4"===o&&/*#__PURE__*/e(E,{typedData:r}),"solana_signMessage"===o&&/*#__PURE__*/e(U,{children:S(r)})]})]})}),R={component:()=>{let{authenticated:t}=v(),{initializeWalletProxy:o,closePrivyModal:r}=C(),{navigate:i,data:s,onUserCloseViaDialogOrKeybindRef:l}=b(),[c,p]=n(!0),[d,u]=n(""),[g,w]=n(),[j,T]=n(null),[S,E]=n(!1);a((()=>{t||i("LandingScreen")}),[t]),a((()=>{o(f).then((e=>{p(!1),e||(u("An error has occurred, please try again."),w(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:R,data:_,confirmAndSign:D,onSuccess:A,onFailure:U,uiOptions:M}=s.signMessage,I={title:M?.title||"Sign message",description:M?.description||"Signing this message will not cost you any fees.",buttonText:M?.buttonText||"Sign and continue"},k=e=>{e?A(e):U(g||new y(new h("The user rejected the request.",m.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{T(null),u(""),w(void 0)}),200)};l.current=()=>{k(j)};/*#__PURE__*/return e(L,{method:R,messageData:_,copy:I,iconUrl:M?.iconUrl&&"string"==typeof M.iconUrl?M.iconUrl:void 0,isLoading:S,success:null!==j,walletProxyIsLoading:c,errorMessage:d,isCancellable:M?.isCancellable,onSign:async()=>{E(!0),u("");try{let e=await D();T(e),E(!1),setTimeout((()=>{k(e)}),x)}catch(e){console.error(e),u("An error has occurred, please try again."),w(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),E(!1)}},onCancel:()=>k(null),onClose:()=>k(j)})}};let _=s.div`
9
+ flex: 1;
10
+ display: flex;
11
+ flex-direction: column;
12
+ gap: 16px;
13
+ `,D=s.p`
14
+ && {
15
+ margin: 0;
16
+ width: 100%;
17
+ text-align: center;
18
+ color: var(--privy-color-error-dark);
19
+ font-size: 14px;
20
+ line-height: 22px;
21
+ }
22
+ `,A=s(g)`
23
+ margin-top: 0;
24
+ `,U=s(u)`
25
+ margin-top: 0;
26
+ `;export{R as SignRequestScreen,L as SignRequestView,R as default};