@crossmint/client-sdk-react-ui 1.10.5 → 1.10.7

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 (203) hide show
  1. package/dist/{chunk-GGVJALEH.cjs → chunk-2ROLE4XU.cjs} +3 -3
  2. package/dist/{chunk-HYP7ISWS.js → chunk-5EE2IAIP.js} +2 -2
  3. package/dist/{chunk-FKRBO2MK.js → chunk-5UXGDXPR.js} +2 -2
  4. package/dist/chunk-6CPZDD6Y.js +29 -0
  5. package/dist/chunk-6CPZDD6Y.js.map +1 -0
  6. package/dist/{chunk-NKOG6FTK.js → chunk-6EX2VR7S.js} +2 -2
  7. package/dist/{chunk-U5EONMPH.js → chunk-6FG6NL44.js} +4 -4
  8. package/dist/{chunk-E7KTAG6X.cjs → chunk-6PPUWTTF.cjs} +3 -3
  9. package/dist/{chunk-MBJBFR2H.js → chunk-7BZSIPWM.js} +2 -2
  10. package/dist/chunk-BFTVVPCU.js +81 -0
  11. package/dist/chunk-BFTVVPCU.js.map +1 -0
  12. package/dist/chunk-BURUD6IV.cjs +64 -0
  13. package/dist/chunk-BURUD6IV.cjs.map +1 -0
  14. package/dist/{chunk-LF3XEXLA.js → chunk-DCMLWFDK.js} +2 -2
  15. package/dist/chunk-DR67KSE7.js +31 -0
  16. package/dist/chunk-DR67KSE7.js.map +1 -0
  17. package/dist/{chunk-YP4CPG34.js → chunk-FGHABNQM.js} +2 -2
  18. package/dist/{chunk-YP4CPG34.js.map → chunk-FGHABNQM.js.map} +1 -1
  19. package/dist/{chunk-6AFXSTEN.cjs → chunk-GMKTZIU2.cjs} +3 -3
  20. package/dist/{chunk-4BGD6LSC.js → chunk-HOTEC5UH.js} +2 -2
  21. package/dist/chunk-HW2Q6J4R.js +64 -0
  22. package/dist/chunk-HW2Q6J4R.js.map +1 -0
  23. package/dist/chunk-HZ26XTTK.cjs +81 -0
  24. package/dist/chunk-HZ26XTTK.cjs.map +1 -0
  25. package/dist/{chunk-LD66M6G7.cjs → chunk-K5S6RUJ3.cjs} +3 -3
  26. package/dist/chunk-LGY5FQOZ.cjs +29 -0
  27. package/dist/chunk-LGY5FQOZ.cjs.map +1 -0
  28. package/dist/{chunk-HR57IU52.cjs → chunk-LJA62EVT.cjs} +3 -3
  29. package/dist/{chunk-EBMORHG3.cjs → chunk-MCINXS2Y.cjs} +17 -252
  30. package/dist/chunk-MCINXS2Y.cjs.map +1 -0
  31. package/dist/{chunk-T5WAVOPI.js → chunk-O53ZB544.js} +55 -290
  32. package/dist/chunk-O53ZB544.js.map +1 -0
  33. package/dist/{chunk-G526QBKQ.cjs → chunk-QFZ6GZZR.cjs} +3 -3
  34. package/dist/{chunk-KAXBBO66.cjs → chunk-SBTNHVSD.cjs} +3 -3
  35. package/dist/{chunk-7YHGZZ6G.js → chunk-TH42AO6J.js} +2 -2
  36. package/dist/{chunk-JZYMJ733.js → chunk-U7LXB3SM.js} +2 -2
  37. package/dist/chunk-UGHW5HMB.cjs +31 -0
  38. package/dist/chunk-UGHW5HMB.cjs.map +1 -0
  39. package/dist/{chunk-CPISBXIR.cjs → chunk-Y3SUMTUI.cjs} +2 -2
  40. package/dist/{chunk-CPISBXIR.cjs.map → chunk-Y3SUMTUI.cjs.map} +1 -1
  41. package/dist/{chunk-3LHIEADG.cjs → chunk-YNBGMNE6.cjs} +3 -3
  42. package/dist/{chunk-NTAMXW3Z.cjs → chunk-ZJC4OB5Z.cjs} +3 -3
  43. package/dist/components/CrossmintNFTCollectionView.cjs +3 -3
  44. package/dist/components/CrossmintNFTCollectionView.js +2 -2
  45. package/dist/components/CrossmintNFTDetail.cjs +3 -3
  46. package/dist/components/CrossmintNFTDetail.js +2 -2
  47. package/dist/components/auth/AuthForm.cjs +5 -11
  48. package/dist/components/auth/AuthForm.js +4 -10
  49. package/dist/components/auth/AuthFormBackButton.cjs +5 -11
  50. package/dist/components/auth/AuthFormBackButton.js +4 -10
  51. package/dist/components/auth/AuthFormDialog.cjs +5 -11
  52. package/dist/components/auth/AuthFormDialog.js +4 -10
  53. package/dist/components/auth/EmbeddedAuthForm.cjs +6 -12
  54. package/dist/components/auth/EmbeddedAuthForm.js +5 -11
  55. package/dist/components/auth/methods/email/EmailAuthFlow.cjs +5 -11
  56. package/dist/components/auth/methods/email/EmailAuthFlow.js +4 -10
  57. package/dist/components/auth/methods/email/EmailOTPInput.cjs +5 -11
  58. package/dist/components/auth/methods/email/EmailOTPInput.js +4 -10
  59. package/dist/components/auth/methods/email/EmailSignIn.cjs +5 -11
  60. package/dist/components/auth/methods/email/EmailSignIn.js +4 -10
  61. package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs +5 -11
  62. package/dist/components/auth/methods/farcaster/FarcasterSignIn.js +4 -10
  63. package/dist/components/auth/methods/google/GoogleSignIn.cjs +5 -11
  64. package/dist/components/auth/methods/google/GoogleSignIn.js +4 -10
  65. package/dist/components/auth/methods/web3/Web3AuthFlow.cjs +43 -12
  66. package/dist/components/auth/methods/web3/Web3AuthFlow.cjs.map +1 -1
  67. package/dist/components/auth/methods/web3/Web3AuthFlow.d.cts +1 -1
  68. package/dist/components/auth/methods/web3/Web3AuthFlow.d.ts +1 -1
  69. package/dist/components/auth/methods/web3/Web3AuthFlow.js +43 -12
  70. package/dist/components/auth/methods/web3/Web3AuthFlow.js.map +1 -1
  71. package/dist/components/auth/methods/web3/Web3AuthFlowButton.cjs +8 -11
  72. package/dist/components/auth/methods/web3/Web3AuthFlowButton.js +7 -10
  73. package/dist/components/auth/methods/web3/Web3Connector.cjs +58 -4
  74. package/dist/components/auth/methods/web3/Web3Connector.cjs.map +1 -1
  75. package/dist/components/auth/methods/web3/Web3Connector.js +58 -4
  76. package/dist/components/auth/methods/web3/Web3Connector.js.map +1 -1
  77. package/dist/components/auth/methods/web3/Web3ConnectorButton.cjs +48 -4
  78. package/dist/components/auth/methods/web3/Web3ConnectorButton.cjs.map +1 -1
  79. package/dist/components/auth/methods/web3/Web3ConnectorButton.js +48 -4
  80. package/dist/components/auth/methods/web3/Web3ConnectorButton.js.map +1 -1
  81. package/dist/components/auth/methods/web3/Web3Connectors.cjs +6 -11
  82. package/dist/components/auth/methods/web3/Web3Connectors.js +5 -10
  83. package/dist/components/common/Divider.cjs +5 -11
  84. package/dist/components/common/Divider.js +4 -10
  85. package/dist/components/embed/index.cjs +4 -4
  86. package/dist/components/embed/index.js +3 -3
  87. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +7 -13
  88. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +6 -12
  89. package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs +6 -12
  90. package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js +5 -11
  91. package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs +4 -22
  92. package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs.map +1 -1
  93. package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js +3 -21
  94. package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js.map +1 -1
  95. package/dist/components/embed/v3/index.cjs +7 -13
  96. package/dist/components/embed/v3/index.js +6 -12
  97. package/dist/components/hosted/CrossmintPayButton.cjs +3 -3
  98. package/dist/components/hosted/CrossmintPayButton.js +2 -2
  99. package/dist/components/hosted/index.cjs +3 -3
  100. package/dist/components/hosted/index.js +2 -2
  101. package/dist/components/index.cjs +15 -21
  102. package/dist/components/index.js +14 -20
  103. package/dist/consts/version.cjs +2 -2
  104. package/dist/consts/version.js +1 -1
  105. package/dist/hooks/index.cjs +5 -11
  106. package/dist/hooks/index.js +4 -10
  107. package/dist/hooks/useAuth.cjs +5 -11
  108. package/dist/hooks/useAuth.js +4 -10
  109. package/dist/hooks/useCrossmintAuth.cjs +5 -11
  110. package/dist/hooks/useCrossmintAuth.js +4 -10
  111. package/dist/hooks/useCrossmintCheckout.cjs +4 -4
  112. package/dist/hooks/useCrossmintCheckout.js +3 -3
  113. package/dist/hooks/useOAuthWindowListener.cjs +5 -11
  114. package/dist/hooks/useOAuthWindowListener.js +4 -10
  115. package/dist/hooks/useWallet.cjs +5 -11
  116. package/dist/hooks/useWallet.js +4 -10
  117. package/dist/icons/base64Icons.cjs +6 -6
  118. package/dist/icons/base64Icons.cjs.map +1 -1
  119. package/dist/icons/base64Icons.js +5 -5
  120. package/dist/icons/base64Icons.js.map +1 -1
  121. package/dist/index.cjs +15 -21
  122. package/dist/index.cjs.map +1 -1
  123. package/dist/index.js +14 -20
  124. package/dist/index.js.map +1 -1
  125. package/dist/providers/CrossmintAuthProvider.cjs +5 -11
  126. package/dist/providers/CrossmintAuthProvider.js +4 -10
  127. package/dist/providers/CrossmintWalletProvider.cjs +5 -11
  128. package/dist/providers/CrossmintWalletProvider.js +4 -10
  129. package/dist/providers/auth/AuthFormProvider.cjs +5 -11
  130. package/dist/providers/auth/AuthFormProvider.js +4 -10
  131. package/dist/providers/auth/web3/DynamicWeb3WalletConnect.cjs +33 -0
  132. package/dist/providers/auth/web3/DynamicWeb3WalletConnect.d.cts +10 -0
  133. package/dist/providers/auth/web3/DynamicWeb3WalletConnect.d.ts +10 -0
  134. package/dist/providers/auth/web3/DynamicWeb3WalletConnect.js +33 -0
  135. package/dist/providers/index.cjs +5 -11
  136. package/dist/providers/index.js +4 -10
  137. package/dist/utils/createCrossmintApiClient.cjs +3 -3
  138. package/dist/utils/createCrossmintApiClient.js +2 -2
  139. package/dist/utils/dynamic/dynamicChainToCrossmintChain.cjs +8 -0
  140. package/dist/utils/dynamic/dynamicChainToCrossmintChain.d.cts +6 -0
  141. package/dist/utils/dynamic/dynamicChainToCrossmintChain.d.ts +6 -0
  142. package/dist/utils/dynamic/dynamicChainToCrossmintChain.js +8 -0
  143. package/package.json +5 -8
  144. package/src/components/auth/AuthForm.tsx +9 -2
  145. package/src/components/auth/methods/web3/Web3AuthFlow.tsx +18 -0
  146. package/src/components/auth/methods/web3/Web3Connectors.tsx +5 -72
  147. package/src/components/embed/v3/crypto/CryptoWalletConnectionHandler.tsx +3 -24
  148. package/src/providers/CrossmintAuthProvider.test.tsx +0 -4
  149. package/src/providers/CrossmintWalletProvider.test.tsx +0 -6
  150. package/src/providers/auth/AuthFormProvider.test.tsx +0 -5
  151. package/src/providers/auth/AuthFormProvider.tsx +1 -6
  152. package/src/providers/auth/web3/DynamicWeb3WalletConnect.tsx +73 -0
  153. package/src/utils/dynamic/dynamicChainToCrossmintChain.ts +20 -0
  154. package/dist/chunk-5S4VO6RB.cjs +0 -55
  155. package/dist/chunk-5S4VO6RB.cjs.map +0 -1
  156. package/dist/chunk-EBMORHG3.cjs.map +0 -1
  157. package/dist/chunk-HSLAH2PN.cjs +0 -54
  158. package/dist/chunk-HSLAH2PN.cjs.map +0 -1
  159. package/dist/chunk-NFWMF6T7.js +0 -54
  160. package/dist/chunk-NFWMF6T7.js.map +0 -1
  161. package/dist/chunk-OZS4WEKF.js +0 -55
  162. package/dist/chunk-OZS4WEKF.js.map +0 -1
  163. package/dist/chunk-Q3UM7UCM.cjs +0 -64
  164. package/dist/chunk-Q3UM7UCM.cjs.map +0 -1
  165. package/dist/chunk-QFQWKKVU.js +0 -11
  166. package/dist/chunk-QFQWKKVU.js.map +0 -1
  167. package/dist/chunk-QK5J7FD3.cjs +0 -11
  168. package/dist/chunk-QK5J7FD3.cjs.map +0 -1
  169. package/dist/chunk-T5WAVOPI.js.map +0 -1
  170. package/dist/chunk-ZSWTJ6E7.js +0 -64
  171. package/dist/chunk-ZSWTJ6E7.js.map +0 -1
  172. package/dist/components/auth/methods/web3/Web3ConnectorContainer.cjs +0 -36
  173. package/dist/components/auth/methods/web3/Web3ConnectorContainer.d.cts +0 -10
  174. package/dist/components/auth/methods/web3/Web3ConnectorContainer.d.ts +0 -10
  175. package/dist/components/auth/methods/web3/Web3ConnectorContainer.js +0 -36
  176. package/dist/providers/auth/web3/WagmiAuthProvider.cjs +0 -8
  177. package/dist/providers/auth/web3/WagmiAuthProvider.d.cts +0 -8
  178. package/dist/providers/auth/web3/WagmiAuthProvider.d.ts +0 -8
  179. package/dist/providers/auth/web3/WagmiAuthProvider.js +0 -8
  180. package/src/components/auth/methods/web3/Web3ConnectorContainer.tsx +0 -87
  181. package/src/providers/auth/web3/WagmiAuthProvider.tsx +0 -56
  182. /package/dist/{chunk-GGVJALEH.cjs.map → chunk-2ROLE4XU.cjs.map} +0 -0
  183. /package/dist/{chunk-HYP7ISWS.js.map → chunk-5EE2IAIP.js.map} +0 -0
  184. /package/dist/{chunk-FKRBO2MK.js.map → chunk-5UXGDXPR.js.map} +0 -0
  185. /package/dist/{chunk-NKOG6FTK.js.map → chunk-6EX2VR7S.js.map} +0 -0
  186. /package/dist/{chunk-U5EONMPH.js.map → chunk-6FG6NL44.js.map} +0 -0
  187. /package/dist/{chunk-E7KTAG6X.cjs.map → chunk-6PPUWTTF.cjs.map} +0 -0
  188. /package/dist/{chunk-MBJBFR2H.js.map → chunk-7BZSIPWM.js.map} +0 -0
  189. /package/dist/{chunk-LF3XEXLA.js.map → chunk-DCMLWFDK.js.map} +0 -0
  190. /package/dist/{chunk-6AFXSTEN.cjs.map → chunk-GMKTZIU2.cjs.map} +0 -0
  191. /package/dist/{chunk-4BGD6LSC.js.map → chunk-HOTEC5UH.js.map} +0 -0
  192. /package/dist/{chunk-LD66M6G7.cjs.map → chunk-K5S6RUJ3.cjs.map} +0 -0
  193. /package/dist/{chunk-HR57IU52.cjs.map → chunk-LJA62EVT.cjs.map} +0 -0
  194. /package/dist/{chunk-G526QBKQ.cjs.map → chunk-QFZ6GZZR.cjs.map} +0 -0
  195. /package/dist/{chunk-KAXBBO66.cjs.map → chunk-SBTNHVSD.cjs.map} +0 -0
  196. /package/dist/{chunk-7YHGZZ6G.js.map → chunk-TH42AO6J.js.map} +0 -0
  197. /package/dist/{chunk-JZYMJ733.js.map → chunk-U7LXB3SM.js.map} +0 -0
  198. /package/dist/{chunk-3LHIEADG.cjs.map → chunk-YNBGMNE6.cjs.map} +0 -0
  199. /package/dist/{chunk-NTAMXW3Z.cjs.map → chunk-ZJC4OB5Z.cjs.map} +0 -0
  200. /package/dist/{components/auth/methods/web3/Web3ConnectorContainer.cjs.map → providers/auth/web3/DynamicWeb3WalletConnect.cjs.map} +0 -0
  201. /package/dist/{components/auth/methods/web3/Web3ConnectorContainer.js.map → providers/auth/web3/DynamicWeb3WalletConnect.js.map} +0 -0
  202. /package/dist/{providers/auth/web3/WagmiAuthProvider.cjs.map → utils/dynamic/dynamicChainToCrossmintChain.cjs.map} +0 -0
  203. /package/dist/{providers/auth/web3/WagmiAuthProvider.js.map → utils/dynamic/dynamicChainToCrossmintChain.js.map} +0 -0
@@ -1,12 +1,3 @@
1
- import {
2
- Web3ConnectorButton
3
- } from "./chunk-NFWMF6T7.js";
4
- import {
5
- Web3Connector
6
- } from "./chunk-ZSWTJ6E7.js";
7
- import {
8
- WagmiAuthProvider
9
- } from "./chunk-OZS4WEKF.js";
10
1
  import {
11
2
  FarcasterProvider
12
3
  } from "./chunk-A7J4DAE7.js";
@@ -39,19 +30,9 @@ import {
39
30
  import {
40
31
  LeftArrowIcon
41
32
  } from "./chunk-ZDQGQY7Z.js";
42
- import {
43
- WalletIcon
44
- } from "./chunk-VZIXXIU5.js";
45
33
  import {
46
34
  AlertIcon
47
35
  } from "./chunk-7KIY6DLW.js";
48
- import {
49
- metamaskIcon,
50
- walletConnectIcon
51
- } from "./chunk-QFQWKKVU.js";
52
- import {
53
- ChevronRightIcon
54
- } from "./chunk-3KR4GYLF.js";
55
36
  import {
56
37
  EmailOtpIcon
57
38
  } from "./chunk-I63FQCIV.js";
@@ -72,7 +53,7 @@ import {
72
53
  } from "./chunk-CRTRMMJ7.js";
73
54
 
74
55
  // src/providers/CrossmintWalletProvider.tsx
75
- import { createContext as createContext3, useMemo as useMemo3, useState as useState9 } from "react";
56
+ import { createContext as createContext3, useMemo as useMemo3, useState as useState8 } from "react";
76
57
  import { createPortal } from "react-dom";
77
58
  import {
78
59
  SmartWalletError,
@@ -93,7 +74,7 @@ function useWallet() {
93
74
  import { useContext as useContext4 } from "react";
94
75
 
95
76
  // src/providers/CrossmintAuthProvider.tsx
96
- import { createContext as createContext2, useEffect as useEffect6, useMemo as useMemo2, useRef as useRef2, useState as useState8 } from "react";
77
+ import { createContext as createContext2, useEffect as useEffect5, useMemo as useMemo2, useRef as useRef2, useState as useState7 } from "react";
97
78
  import { CrossmintAuth, getCookie } from "@crossmint/client-sdk-auth";
98
79
  import { validateApiKeyAndGetCrossmintBaseUrl } from "@crossmint/common-sdk-base";
99
80
  import { SESSION_PREFIX } from "@crossmint/common-sdk-auth";
@@ -181,9 +162,13 @@ var AuthFormProvider = ({
181
162
  setError,
182
163
  setStep
183
164
  };
184
- return /* @__PURE__ */ jsx(AuthFormContext.Provider, { value, children: /* @__PURE__ */ jsx(WagmiAuthProvider, { children }) });
165
+ return /* @__PURE__ */ jsx(AuthFormContext.Provider, { value, children });
185
166
  };
186
167
 
168
+ // src/components/auth/AuthForm.tsx
169
+ import { lazy } from "react";
170
+ import Color2 from "color";
171
+
187
172
  // src/components/auth/methods/email/EmailAuthFlow.tsx
188
173
  import { useState as useState4 } from "react";
189
174
 
@@ -756,236 +741,20 @@ function FarcasterQRCode() {
756
741
  ] });
757
742
  }
758
743
 
759
- // src/components/auth/methods/web3/Web3AuthFlowButton.tsx
760
- import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
761
- function Web3AuthFlowButton() {
762
- var _a, _b, _c, _d, _e;
763
- const { step, appearance, setStep, setError } = useAuthForm();
764
- if (step !== "initial") {
765
- return null;
766
- }
767
- return /* @__PURE__ */ jsxs6(
768
- "button",
769
- {
770
- className: classNames(
771
- "relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center",
772
- "transition-colors duration-200 ease-in-out",
773
- "hover:bg-cm-hover focus:bg-cm-hover outline-none"
774
- ),
775
- style: {
776
- borderRadius: appearance == null ? void 0 : appearance.borderRadius,
777
- borderColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.border,
778
- backgroundColor: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.buttonBackground
779
- },
780
- onClick: () => {
781
- setStep("web3");
782
- setError(null);
783
- },
784
- children: [
785
- /* @__PURE__ */ jsx9(
786
- WalletIcon,
787
- {
788
- className: "h-[21px] w-[21px] absolute left-[20px]",
789
- style: { color: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.textPrimary }
790
- }
791
- ),
792
- /* @__PURE__ */ jsx9("span", { className: "font-medium", style: { margin: "0px 32px", color: (_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.textPrimary }, children: "Continue with a wallet" }),
793
- /* @__PURE__ */ jsx9(
794
- ChevronRightIcon,
795
- {
796
- className: "h-[21px] w-[21px] absolute right-[20px]",
797
- style: { color: (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.textSecondary }
798
- }
799
- ),
800
- /* @__PURE__ */ jsx9("span", { className: "sr-only", children: "Continue with a wallet" })
801
- ]
802
- }
803
- );
804
- }
805
-
806
- // src/components/auth/methods/web3/Web3ConnectorContainer.tsx
807
- import { useState as useState7, useEffect as useEffect4 } from "react";
808
- import { useAccount, useChainId, useConnect, useSignMessage } from "wagmi";
809
- import { jsx as jsx10 } from "react/jsx-runtime";
810
- function Web3ConnectorContainer({ providerType, flag, icon }) {
811
- var _a, _b;
812
- const { crossmintAuth } = useCrossmintAuth();
813
- const { appearance, error, setError } = useAuthForm();
814
- const [isLoading, setIsLoading] = useState7(false);
815
- const chainId = useChainId();
816
- const { address, status: accountStatus } = useAccount();
817
- const { signMessageAsync, status: signMessageStatus } = useSignMessage();
818
- const { connect, connectors } = useConnect({
819
- mutation: {
820
- onError: () => setIsLoading(false)
821
- }
822
- });
823
- const isExtensionInstalled = (_b = (_a = window.ethereum) == null ? void 0 : _a[flag]) != null ? _b : false;
824
- if (!isExtensionInstalled) {
825
- providerType = "walletConnect";
826
- }
827
- const connector = connectors.find((c) => c.id === providerType);
828
- useEffect4(() => {
829
- if (address != null) {
830
- handleSignIn();
831
- }
832
- }, [address]);
833
- const handleSignIn = () => __async(this, null, function* () {
834
- if (address == null) {
835
- return;
836
- }
837
- setIsLoading(true);
838
- setError(null);
839
- try {
840
- const res = yield crossmintAuth == null ? void 0 : crossmintAuth.signInWithSmartWallet(address);
841
- const signature = yield signMessageAsync({ message: res.challenge });
842
- const authResponse = yield crossmintAuth == null ? void 0 : crossmintAuth.authenticateSmartWallet(address, signature);
843
- const oneTimeSecret = authResponse.oneTimeSecret;
844
- yield crossmintAuth == null ? void 0 : crossmintAuth.handleRefreshAuthMaterial(oneTimeSecret);
845
- } catch (error2) {
846
- console.error(`Error connecting to ${providerType}:`, error2);
847
- setError(`Error connecting to ${providerType}. Please try again or contact support.`);
848
- } finally {
849
- setIsLoading(false);
850
- }
851
- });
852
- const isLoadingOrPending = isLoading || accountStatus === "connecting" || accountStatus === "reconnecting" || signMessageStatus === "pending";
853
- return /* @__PURE__ */ jsx10(
854
- Web3Connector,
855
- {
856
- icon,
857
- appearance,
858
- headingText: signMessageStatus === "pending" ? "Sign to verify" : "Connect your wallet",
859
- buttonText: error != null && !isLoadingOrPending ? "Retry" : isLoadingOrPending ? "Connecting" : "Connect",
860
- isLoading: isLoadingOrPending,
861
- onConnectClick: () => {
862
- if (address != null) {
863
- handleSignIn();
864
- } else if (connector) {
865
- connect({ connector, chainId });
866
- }
867
- }
868
- }
869
- );
870
- }
871
-
872
- // src/components/auth/methods/web3/Web3Connectors.tsx
873
- import { useAccount as useAccount2, useDisconnect } from "wagmi";
874
- import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
875
- function Web3Connectors() {
876
- var _a, _b, _c, _d, _e, _f, _g;
877
- const { appearance, step, setStep } = useAuthForm();
878
- const { isConnected } = useAccount2();
879
- const { disconnect } = useDisconnect();
880
- if (step === "web3") {
881
- return /* @__PURE__ */ jsxs7(Fragment4, { children: [
882
- /* @__PURE__ */ jsx11(
883
- AuthFormBackButton,
884
- {
885
- onClick: () => setStep("initial"),
886
- iconColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.textPrimary,
887
- ringColor: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.accent
888
- }
889
- ),
890
- /* @__PURE__ */ jsxs7("div", { className: "flex flex-col items-center gap-2", children: [
891
- /* @__PURE__ */ jsx11("div", { className: "text-center mb-6", children: /* @__PURE__ */ jsx11(
892
- "h3",
893
- {
894
- className: "text-lg font-semibold text-cm-text-primary",
895
- style: { color: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.textPrimary },
896
- children: "Connect wallet"
897
- }
898
- ) }),
899
- /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-[10px] w-full", children: [
900
- /* @__PURE__ */ jsx11(
901
- Web3ConnectorButton,
902
- {
903
- title: "Metamask",
904
- appearance,
905
- img: metamaskIcon,
906
- onClick: () => {
907
- if (isConnected) {
908
- disconnect();
909
- }
910
- setTimeout(() => {
911
- setStep("web3/metamask");
912
- }, 200);
913
- }
914
- }
915
- ),
916
- /* @__PURE__ */ jsx11(
917
- Web3ConnectorButton,
918
- {
919
- title: "WalletConnect",
920
- appearance,
921
- img: walletConnectIcon,
922
- onClick: () => {
923
- if (isConnected) {
924
- disconnect();
925
- }
926
- setTimeout(() => {
927
- setStep("web3/walletconnect");
928
- }, 200);
929
- }
930
- }
931
- )
932
- ] })
933
- ] })
934
- ] });
935
- }
936
- if (step === "web3/metamask") {
937
- return /* @__PURE__ */ jsxs7(Fragment4, { children: [
938
- /* @__PURE__ */ jsx11(
939
- AuthFormBackButton,
940
- {
941
- onClick: () => {
942
- setStep("web3");
943
- },
944
- iconColor: (_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.textPrimary,
945
- ringColor: (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.accent
946
- }
947
- ),
948
- /* @__PURE__ */ jsx11(Web3ConnectorContainer, { providerType: "metaMaskSDK", flag: "isMetaMask", icon: metamaskIcon })
949
- ] });
950
- }
951
- if (step === "web3/walletconnect") {
952
- return /* @__PURE__ */ jsxs7(Fragment4, { children: [
953
- /* @__PURE__ */ jsx11(
954
- AuthFormBackButton,
955
- {
956
- onClick: () => {
957
- setStep("web3");
958
- },
959
- iconColor: (_f = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _f.textPrimary,
960
- ringColor: (_g = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _g.accent
961
- }
962
- ),
963
- /* @__PURE__ */ jsx11(Web3ConnectorContainer, { providerType: "walletConnect", icon: walletConnectIcon })
964
- ] });
965
- }
966
- return null;
967
- }
968
-
969
- // src/components/auth/methods/web3/Web3AuthFlow.tsx
970
- import { jsx as jsx12 } from "react/jsx-runtime";
971
- function Web3AuthFlow() {
972
- const { step } = useAuthForm();
973
- if (step.startsWith("web3")) {
974
- return /* @__PURE__ */ jsx12(Web3Connectors, {});
975
- }
976
- if (step === "initial") {
977
- return /* @__PURE__ */ jsx12(Web3AuthFlowButton, {});
978
- }
979
- return null;
980
- }
981
-
982
744
  // src/components/auth/AuthForm.tsx
983
- import Color2 from "color";
984
- import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
745
+ import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
746
+ var Web3AuthFlow = lazy(
747
+ () => (
748
+ // @ts-expect-error - Error because we dont use 'module' field in tsconfig, which is expected because we use tsup to compile
749
+ import("./components/auth/methods/web3/Web3AuthFlow.js").then((mod) => ({
750
+ default: mod.Web3AuthFlow
751
+ }))
752
+ )
753
+ );
985
754
  function AuthForm({ className }) {
986
755
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
987
756
  const { step, appearance, loginMethods, baseUrl, error } = useAuthForm();
988
- return /* @__PURE__ */ jsxs8(
757
+ return /* @__PURE__ */ jsxs6(
989
758
  "div",
990
759
  {
991
760
  className: classNames(
@@ -993,7 +762,7 @@ function AuthForm({ className }) {
993
762
  className
994
763
  ),
995
764
  children: [
996
- error ? /* @__PURE__ */ jsxs8(
765
+ error ? /* @__PURE__ */ jsxs6(
997
766
  "div",
998
767
  {
999
768
  className: "flex items-start justify-start w-full rounded-lg p-2 mt-4 bg-cm-danger-muted",
@@ -1001,13 +770,13 @@ function AuthForm({ className }) {
1001
770
  backgroundColor: new Color2((_b = (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.danger) != null ? _b : "#f44336").alpha(0.12).toString()
1002
771
  },
1003
772
  children: [
1004
- /* @__PURE__ */ jsx13(AlertIcon, { customColor: (_d = (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.danger) != null ? _d : "#f44336" }),
1005
- /* @__PURE__ */ jsx13("p", { className: "ml-2 text-sm", style: { color: (_f = (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.danger) != null ? _f : "#f44336" }, children: error })
773
+ /* @__PURE__ */ jsx9(AlertIcon, { customColor: (_d = (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.danger) != null ? _d : "#f44336" }),
774
+ /* @__PURE__ */ jsx9("p", { className: "ml-2 text-sm", style: { color: (_f = (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.danger) != null ? _f : "#f44336" }, children: error })
1006
775
  ]
1007
776
  }
1008
777
  ) : null,
1009
- step === "initial" ? /* @__PURE__ */ jsxs8("div", { children: [
1010
- /* @__PURE__ */ jsx13(
778
+ step === "initial" ? /* @__PURE__ */ jsxs6("div", { children: [
779
+ /* @__PURE__ */ jsx9(
1011
780
  "h1",
1012
781
  {
1013
782
  className: "text-2xl font-bold text-cm-text-primary",
@@ -1015,7 +784,7 @@ function AuthForm({ className }) {
1015
784
  children: "Sign In"
1016
785
  }
1017
786
  ),
1018
- /* @__PURE__ */ jsx13(
787
+ /* @__PURE__ */ jsx9(
1019
788
  "p",
1020
789
  {
1021
790
  className: "text-base font-normal mb-3 text-cm-text-secondary",
@@ -1024,14 +793,14 @@ function AuthForm({ className }) {
1024
793
  }
1025
794
  )
1026
795
  ] }) : null,
1027
- loginMethods.includes("email") ? /* @__PURE__ */ jsxs8(Fragment5, { children: [
1028
- /* @__PURE__ */ jsx13(EmailAuthFlow, {}),
1029
- loginMethods.length > 1 ? /* @__PURE__ */ jsx13(Divider, { appearance, text: "OR" }) : null
796
+ loginMethods.includes("email") ? /* @__PURE__ */ jsxs6(Fragment4, { children: [
797
+ /* @__PURE__ */ jsx9(EmailAuthFlow, {}),
798
+ loginMethods.length > 1 ? /* @__PURE__ */ jsx9(Divider, { appearance, text: "OR" }) : null
1030
799
  ] }) : null,
1031
- loginMethods.includes("google") ? /* @__PURE__ */ jsx13(GoogleSignIn, {}) : null,
1032
- loginMethods.includes("farcaster") ? /* @__PURE__ */ jsx13(FarcasterProvider, { baseUrl, children: /* @__PURE__ */ jsx13(FarcasterSignIn, {}) }) : null,
1033
- loginMethods.includes("web3") ? /* @__PURE__ */ jsx13(Web3AuthFlow, {}) : null,
1034
- step === "initial" || step === "otp" ? /* @__PURE__ */ jsx13(
800
+ loginMethods.includes("google") ? /* @__PURE__ */ jsx9(GoogleSignIn, {}) : null,
801
+ loginMethods.includes("farcaster") ? /* @__PURE__ */ jsx9(FarcasterProvider, { baseUrl, children: /* @__PURE__ */ jsx9(FarcasterSignIn, {}) }) : null,
802
+ loginMethods.includes("web3") ? /* @__PURE__ */ jsx9(Web3AuthFlow, {}) : null,
803
+ step === "initial" || step === "otp" ? /* @__PURE__ */ jsx9(
1035
804
  PoweredByCrossmint,
1036
805
  {
1037
806
  className: "mt-4 justify-center",
@@ -1044,15 +813,15 @@ function AuthForm({ className }) {
1044
813
  }
1045
814
 
1046
815
  // src/components/auth/AuthFormDialog.tsx
1047
- import { useEffect as useEffect5 } from "react";
1048
- import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
816
+ import { useEffect as useEffect4 } from "react";
817
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
1049
818
  function AuthFormDialog({ open }) {
1050
819
  var _a, _b, _c;
1051
820
  const { appearance, setDialogOpen } = useAuthForm();
1052
- useEffect5(() => {
821
+ useEffect4(() => {
1053
822
  document.body.style.overflow = open ? "hidden" : "";
1054
823
  }, [open]);
1055
- return /* @__PURE__ */ jsx14(Dialog, { modal: false, open, onOpenChange: setDialogOpen, children: /* @__PURE__ */ jsxs9(
824
+ return /* @__PURE__ */ jsx10(Dialog, { modal: false, open, onOpenChange: setDialogOpen, children: /* @__PURE__ */ jsxs7(
1056
825
  DialogContent,
1057
826
  {
1058
827
  onInteractOutside: (e) => e.preventDefault(),
@@ -1065,16 +834,16 @@ function AuthFormDialog({ open }) {
1065
834
  backgroundColor: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.background
1066
835
  },
1067
836
  children: [
1068
- /* @__PURE__ */ jsx14(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx14(DialogTitle, { children: "Crossmint Auth" }) }),
1069
- /* @__PURE__ */ jsx14(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx14(DialogDescription, { children: "Sign in via Crossmint" }) }),
1070
- /* @__PURE__ */ jsx14(AuthForm, { className: "max-w-[448px]" })
837
+ /* @__PURE__ */ jsx10(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx10(DialogTitle, { children: "Crossmint Auth" }) }),
838
+ /* @__PURE__ */ jsx10(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx10(DialogDescription, { children: "Sign in via Crossmint" }) }),
839
+ /* @__PURE__ */ jsx10(AuthForm, { className: "max-w-[448px]" })
1071
840
  ]
1072
841
  }
1073
842
  ) });
1074
843
  }
1075
844
 
1076
845
  // src/providers/CrossmintAuthProvider.tsx
1077
- import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
846
+ import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
1078
847
  var defaultContextValue = {
1079
848
  crossmintAuth: void 0,
1080
849
  login: () => {
@@ -1101,7 +870,7 @@ function CrossmintAuthProvider({
1101
870
  refreshRoute,
1102
871
  logoutRoute
1103
872
  }) {
1104
- const [user, setUser] = useState8(void 0);
873
+ const [user, setUser] = useState7(void 0);
1105
874
  const { crossmint, setJwt } = useCrossmint("CrossmintAuthProvider must be used within CrossmintProvider");
1106
875
  const crossmintAuthRef = useRef2(null);
1107
876
  const crossmintAuth = useMemo2(() => {
@@ -1124,14 +893,14 @@ function CrossmintAuthProvider({
1124
893
  return crossmintAuthRef.current;
1125
894
  }, []);
1126
895
  const crossmintBaseUrl = validateApiKeyAndGetCrossmintBaseUrl(crossmint.apiKey);
1127
- const [dialogOpen, setDialogOpen] = useState8(false);
1128
- useEffect6(() => {
896
+ const [dialogOpen, setDialogOpen] = useState7(false);
897
+ useEffect5(() => {
1129
898
  if (crossmint.jwt == null) {
1130
899
  const jwt = getCookie(SESSION_PREFIX);
1131
900
  setJwt(jwt);
1132
901
  }
1133
902
  }, []);
1134
- useEffect6(() => {
903
+ useEffect5(() => {
1135
904
  if (crossmint.jwt == null) {
1136
905
  return;
1137
906
  }
@@ -1164,7 +933,7 @@ function CrossmintAuthProvider({
1164
933
  const user2 = yield crossmintAuth.getUser();
1165
934
  setUser(user2);
1166
935
  });
1167
- return /* @__PURE__ */ jsx15(TwindProvider, { children: /* @__PURE__ */ jsx15(
936
+ return /* @__PURE__ */ jsx11(TwindProvider, { children: /* @__PURE__ */ jsx11(
1168
937
  AuthContext.Provider,
1169
938
  {
1170
939
  value: {
@@ -1176,13 +945,13 @@ function CrossmintAuthProvider({
1176
945
  status: getAuthStatus(),
1177
946
  getUser
1178
947
  },
1179
- children: /* @__PURE__ */ jsx15(
948
+ children: /* @__PURE__ */ jsx11(
1180
949
  CrossmintWalletProvider,
1181
950
  {
1182
951
  defaultChain: embeddedWallets.defaultChain,
1183
952
  showPasskeyHelpers: embeddedWallets.showPasskeyHelpers,
1184
953
  appearance,
1185
- children: /* @__PURE__ */ jsxs10(
954
+ children: /* @__PURE__ */ jsxs8(
1186
955
  AuthFormProvider,
1187
956
  {
1188
957
  initialState: {
@@ -1193,8 +962,8 @@ function CrossmintAuthProvider({
1193
962
  baseUrl: crossmintBaseUrl
1194
963
  },
1195
964
  children: [
1196
- /* @__PURE__ */ jsx15(WalletManager, { embeddedWallets, accessToken: crossmint.jwt, children }),
1197
- /* @__PURE__ */ jsx15(AuthFormDialog, { open: dialogOpen })
965
+ /* @__PURE__ */ jsx11(WalletManager, { embeddedWallets, accessToken: crossmint.jwt, children }),
966
+ /* @__PURE__ */ jsx11(AuthFormDialog, { open: dialogOpen })
1198
967
  ]
1199
968
  }
1200
969
  )
@@ -1209,7 +978,7 @@ function WalletManager({
1209
978
  accessToken
1210
979
  }) {
1211
980
  const { getOrCreateWallet, clearWallet, status } = useWallet();
1212
- useEffect6(() => {
981
+ useEffect5(() => {
1213
982
  if (embeddedWallets.createOnLogin === "all-users" && status === "not-loaded" && accessToken != null) {
1214
983
  getOrCreateWallet({
1215
984
  type: embeddedWallets.type,
@@ -1220,7 +989,7 @@ function WalletManager({
1220
989
  clearWallet();
1221
990
  }
1222
991
  }, [accessToken, status]);
1223
- return /* @__PURE__ */ jsx15(Fragment6, { children });
992
+ return /* @__PURE__ */ jsx11(Fragment5, { children });
1224
993
  }
1225
994
 
1226
995
  // src/hooks/useAuth.ts
@@ -1233,7 +1002,7 @@ function useAuth() {
1233
1002
  }
1234
1003
 
1235
1004
  // src/providers/CrossmintWalletProvider.tsx
1236
- import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
1005
+ import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
1237
1006
  var WalletContext = createContext3({
1238
1007
  status: "not-loaded",
1239
1008
  getOrCreateWallet: () => Promise.resolve({ startedCreation: false }),
@@ -1249,8 +1018,8 @@ function CrossmintWalletProvider({
1249
1018
  }) {
1250
1019
  const { crossmint } = useCrossmint("CrossmintWalletProvider must be used within CrossmintProvider");
1251
1020
  const smartWalletSDK = useMemo3(() => SmartWalletSDK.init({ clientApiKey: crossmint.apiKey }), [crossmint.apiKey]);
1252
- const [walletState, setWalletState] = useState9({ status: "not-loaded" });
1253
- const [passkeyPromptState, setPasskeyPromptState] = useState9({ open: false });
1021
+ const [walletState, setWalletState] = useState8({ status: "not-loaded" });
1022
+ const [passkeyPromptState, setPasskeyPromptState] = useState8({ open: false });
1254
1023
  const getOrCreateWallet = (..._0) => __async(this, [..._0], function* (config = { type: "evm-smart-wallet", signer: { type: "PASSKEY" } }) {
1255
1024
  if (walletState.status == "in-progress") {
1256
1025
  console.log("Wallet already loading");
@@ -1303,9 +1072,9 @@ function CrossmintWalletProvider({
1303
1072
  const clearWallet = () => {
1304
1073
  setWalletState({ status: "not-loaded" });
1305
1074
  };
1306
- return /* @__PURE__ */ jsxs11(WalletContext.Provider, { value: __spreadProps(__spreadValues({}, walletState), { getOrCreateWallet, clearWallet }), children: [
1075
+ return /* @__PURE__ */ jsxs9(WalletContext.Provider, { value: __spreadProps(__spreadValues({}, walletState), { getOrCreateWallet, clearWallet }), children: [
1307
1076
  children,
1308
- passkeyPromptState.open ? createPortal(/* @__PURE__ */ jsx16(PasskeyPrompt, { state: passkeyPromptState, appearance }), document.body) : null
1077
+ passkeyPromptState.open ? createPortal(/* @__PURE__ */ jsx12(PasskeyPrompt, { state: passkeyPromptState, appearance }), document.body) : null
1309
1078
  ] });
1310
1079
  }
1311
1080
  function deriveErrorState(error) {
@@ -1333,14 +1102,10 @@ export {
1333
1102
  useOAuthWindowListener,
1334
1103
  GoogleSignIn,
1335
1104
  FarcasterSignIn,
1336
- Web3AuthFlowButton,
1337
- Web3ConnectorContainer,
1338
- Web3Connectors,
1339
- Web3AuthFlow,
1340
1105
  AuthForm,
1341
1106
  AuthFormDialog,
1342
1107
  AuthContext,
1343
1108
  CrossmintAuthProvider,
1344
1109
  useAuth
1345
1110
  };
1346
- //# sourceMappingURL=chunk-T5WAVOPI.js.map
1111
+ //# sourceMappingURL=chunk-O53ZB544.js.map