@zerodev/wallet-react-ui 0.0.6 → 0.0.8

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 (71) hide show
  1. package/README.md +69 -10
  2. package/dist/_types/auth/authStoreSlice.d.ts +3 -4
  3. package/dist/_types/auth/authStoreSlice.d.ts.map +1 -1
  4. package/dist/_types/auth/components/WalletGridSheet/index.d.ts +15 -0
  5. package/dist/_types/auth/components/WalletGridSheet/index.d.ts.map +1 -0
  6. package/dist/_types/auth/hooks/useAuth.d.ts +0 -2
  7. package/dist/_types/auth/hooks/useAuth.d.ts.map +1 -1
  8. package/dist/_types/auth/index.d.ts +9 -1
  9. package/dist/_types/auth/index.d.ts.map +1 -1
  10. package/dist/_types/auth/pages/OtpInput.d.ts.map +1 -1
  11. package/dist/_types/auth/pages/SignUp/Email.d.ts +4 -0
  12. package/dist/_types/auth/pages/SignUp/Email.d.ts.map +1 -0
  13. package/dist/_types/auth/pages/SignUp/Google.d.ts +3 -0
  14. package/dist/_types/auth/pages/SignUp/Google.d.ts.map +1 -0
  15. package/dist/_types/auth/pages/SignUp/InstalledWallets.d.ts +12 -0
  16. package/dist/_types/auth/pages/SignUp/InstalledWallets.d.ts.map +1 -0
  17. package/dist/_types/auth/pages/SignUp/MoreWallets.d.ts +5 -0
  18. package/dist/_types/auth/pages/SignUp/MoreWallets.d.ts.map +1 -0
  19. package/dist/_types/auth/pages/SignUp/Passkey.d.ts +3 -0
  20. package/dist/_types/auth/pages/SignUp/Passkey.d.ts.map +1 -0
  21. package/dist/_types/auth/pages/SignUp/Wallet.d.ts +7 -0
  22. package/dist/_types/auth/pages/SignUp/Wallet.d.ts.map +1 -0
  23. package/dist/_types/auth/pages/SignUp/context.d.ts +30 -0
  24. package/dist/_types/auth/pages/SignUp/context.d.ts.map +1 -0
  25. package/dist/_types/auth/pages/SignUp/index.d.ts +37 -0
  26. package/dist/_types/auth/pages/SignUp/index.d.ts.map +1 -0
  27. package/dist/_types/auth/pages/Verifying.d.ts.map +1 -1
  28. package/dist/_types/auth/types.d.ts +2 -10
  29. package/dist/_types/auth/types.d.ts.map +1 -1
  30. package/dist/_types/auth/utils/isCancellationError.d.ts +2 -0
  31. package/dist/_types/auth/utils/isCancellationError.d.ts.map +1 -0
  32. package/dist/_types/auth/walletGuide.d.ts +108 -0
  33. package/dist/_types/auth/walletGuide.d.ts.map +1 -0
  34. package/dist/_types/connector.d.ts +3 -13
  35. package/dist/_types/connector.d.ts.map +1 -1
  36. package/dist/_types/index.d.ts +5 -3
  37. package/dist/_types/index.d.ts.map +1 -1
  38. package/dist/_types/store.d.ts +1 -6
  39. package/dist/_types/store.d.ts.map +1 -1
  40. package/dist/index.cjs +3 -3
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.mjs +810 -576
  43. package/dist/index.mjs.map +1 -1
  44. package/dist/styles.css +1 -1
  45. package/package.json +3 -3
  46. package/src/auth/authStoreSlice.ts +7 -13
  47. package/src/auth/components/WalletGridSheet/index.tsx +77 -0
  48. package/src/auth/hooks/useAuth.ts +0 -5
  49. package/src/auth/index.tsx +19 -20
  50. package/src/auth/pages/OtpInput.tsx +1 -4
  51. package/src/auth/pages/SignUp/Email.tsx +86 -0
  52. package/src/auth/pages/SignUp/Google.tsx +43 -0
  53. package/src/auth/pages/SignUp/InstalledWallets.tsx +95 -0
  54. package/src/auth/pages/SignUp/MoreWallets.tsx +105 -0
  55. package/src/auth/pages/SignUp/Passkey.tsx +56 -0
  56. package/src/auth/pages/SignUp/Wallet.tsx +81 -0
  57. package/src/auth/pages/SignUp/context.tsx +46 -0
  58. package/src/auth/pages/SignUp/index.tsx +164 -0
  59. package/src/auth/pages/Verifying.tsx +3 -10
  60. package/src/auth/types.ts +1 -11
  61. package/src/auth/utils/isCancellationError.ts +10 -0
  62. package/src/auth/walletGuide.ts +132 -0
  63. package/src/connector.ts +12 -28
  64. package/src/index.ts +4 -3
  65. package/src/store.ts +1 -8
  66. package/dist/_types/auth/pages/SignUp.d.ts +0 -2
  67. package/dist/_types/auth/pages/SignUp.d.ts.map +0 -1
  68. package/dist/_types/auth/pages/WalletSelection.d.ts +0 -2
  69. package/dist/_types/auth/pages/WalletSelection.d.ts.map +0 -1
  70. package/src/auth/pages/SignUp.tsx +0 -311
  71. package/src/auth/pages/WalletSelection.tsx +0 -61
package/dist/index.mjs CHANGED
@@ -1,61 +1,59 @@
1
- import { jsxs as c, jsx as n, Fragment as A } from "react/jsx-runtime";
2
- import { Text as m, cn as G, PoweredBy as B, Button as E, Wrapper as ne, ListItem as $, ListItemChevron as re, ListItemIcon as D, Input as se, Icon as ie, Screen as ae, TopNav as oe } from "@zerodev/react-ui";
3
- import { useState as w, useEffect as O, useMemo as le, useRef as K } from "react";
4
- import { useStore as I, create as de } from "zustand";
5
- import { useConfig as ce, useConnect as ue } from "wagmi";
6
- import { useSendMagicLink as Y, useSendOTP as J, useVerifyOTP as he, useAuthenticateOAuth as pe, useRegisterPasskey as me, useLoginPasskey as ze, useVerifyMagicLink as fe, zeroDevWallet as ge, NotAuthenticatedError as ye } from "@zerodev/wallet-react";
7
- import { subscribeWithSelector as xe } from "zustand/middleware";
8
- const we = "" + new URL("error.webp", import.meta.url).href, Se = "" + new URL("loading.webp", import.meta.url).href, Ne = "" + new URL("send.webp", import.meta.url).href, ve = "" + new URL("success.webp", import.meta.url).href, be = {
9
- error: we,
10
- loading: Se,
11
- send: Ne,
12
- success: ve
1
+ import { jsxs as p, jsx as t, Fragment as v } from "react/jsx-runtime";
2
+ import { Text as z, cn as j, PoweredBy as O, Button as S, Wrapper as a2, Input as o2, Icon as q, ListItem as T, ListItemChevron as P, ListItemIcon as $, Badge as K, BottomSheet as s2, BottomSheetContent as l2, BottomSheetTitle as d2, BottomSheetClose as c2, Screen as u2, TopNav as p2 } from "@zerodev/react-ui";
3
+ import { useState as E, useEffect as N, useMemo as f2, useRef as X, createContext as h2, useContext as m2, useLayoutEffect as g2, useCallback as D2 } from "react";
4
+ import { useStore as M, create as z2 } from "zustand";
5
+ import { useConfig as C2, useConnectors as Z, useConnect as G } from "wagmi";
6
+ import { useSendMagicLink as J, useSendOTP as Y, useVerifyOTP as E2, useAuthenticateOAuth as w2, useRegisterPasskey as F2, useLoginPasskey as x2, useVerifyMagicLink as y2, zeroDevWallet as v2, NotAuthenticatedError as S2 } from "@zerodev/wallet-react";
7
+ import { subscribeWithSelector as A2 } from "zustand/middleware";
8
+ const b2 = "" + new URL("error.webp", import.meta.url).href, k2 = "" + new URL("loading.webp", import.meta.url).href, N2 = "" + new URL("send.webp", import.meta.url).href, _2 = "" + new URL("success.webp", import.meta.url).href, L2 = {
9
+ error: b2,
10
+ loading: k2,
11
+ send: N2,
12
+ success: _2
13
13
  };
14
- function P({
14
+ function b({
15
15
  imageName: e,
16
- title: s,
16
+ title: n,
17
17
  children: a,
18
- className: t
18
+ className: r
19
19
  }) {
20
- return /* @__PURE__ */ c(
20
+ return /* @__PURE__ */ p(
21
21
  "div",
22
22
  {
23
- className: G("zd:flex zd:flex-col zd:gap-8 zd:items-center", t),
23
+ className: j("zd:flex zd:flex-col zd:gap-8 zd:items-center", r),
24
24
  children: [
25
- /* @__PURE__ */ n(
25
+ /* @__PURE__ */ t(
26
26
  "img",
27
27
  {
28
- src: be[e],
28
+ src: L2[e],
29
29
  alt: e,
30
30
  className: "zd:w-[118px] zd:h-[118px] zd:bg-transparent"
31
31
  }
32
32
  ),
33
- /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:items-center", children: [
34
- /* @__PURE__ */ n(m, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children: s }),
35
- /* @__PURE__ */ n(m, { className: "zd:text-center zd:whitespace-pre-wrap", children: a })
33
+ /* @__PURE__ */ p("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:items-center", children: [
34
+ /* @__PURE__ */ t(z, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children: n }),
35
+ /* @__PURE__ */ t(z, { className: "zd:text-center zd:whitespace-pre-wrap", children: a })
36
36
  ] })
37
37
  ]
38
38
  }
39
39
  );
40
40
  }
41
- function X() {
42
- const s = ce().connectors.find((a) => a.id === "zerodev-wallet");
43
- if (!s || !("getKitStore" in s))
41
+ function M2() {
42
+ const n = C2().connectors.find((a) => a.id === "zerodev-wallet");
43
+ if (!n || !("getKitStore" in n))
44
44
  throw new Error("useKitStore must be used with the zeroDevWallet connector");
45
- return s.getKitStore();
45
+ return n.getKitStore();
46
46
  }
47
- function R() {
48
- const e = X(), s = I(e, (l) => l.auth.step), a = I(e, (l) => l.auth.stepHistory), t = I(e, (l) => l.auth.email), r = I(e, (l) => l.auth.otpId), d = I(
47
+ function F() {
48
+ const e = M2(), n = M(e, (s) => s.auth.step), a = M(e, (s) => s.auth.stepHistory), r = M(e, (s) => s.auth.email), i = M(e, (s) => s.auth.otpId), o = M(
49
49
  e,
50
- (l) => l.auth.otpEncryptionTargetBundle
51
- ), i = I(e, (l) => l.auth.enabledMethods), u = I(e, (l) => l.auth.config);
50
+ (s) => s.auth.otpEncryptionTargetBundle
51
+ );
52
52
  return {
53
- step: s,
54
- email: t,
55
- otpId: r,
56
- otpEncryptionTargetBundle: d,
57
- enabledMethods: i,
58
- config: u,
53
+ step: n,
54
+ email: r,
55
+ otpId: i,
56
+ otpEncryptionTargetBundle: o,
59
57
  goToStep: e.getState().auth.goToStep,
60
58
  goBack: a.length > 0 ? e.getState().auth.goBack : null,
61
59
  reset: e.getState().auth.reset,
@@ -64,20 +62,20 @@ function R() {
64
62
  clearOtpSession: e.getState().auth.clearOtpSession
65
63
  };
66
64
  }
67
- function Ee() {
68
- const { email: e, setOtpSession: s } = R(), { mutateAsync: a, isPending: t } = Y(), [r, d] = w(60), i = r <= 0 && !t;
69
- return O(() => {
70
- if (r <= 0) return;
71
- const l = setInterval(() => {
72
- d((h) => Math.max(0, h - 1));
65
+ function U2() {
66
+ const { email: e, setOtpSession: n } = F(), { mutateAsync: a, isPending: r } = J(), [i, o] = E(60), s = i <= 0 && !r;
67
+ return N(() => {
68
+ if (i <= 0) return;
69
+ const f = setInterval(() => {
70
+ o((m) => Math.max(0, m - 1));
73
71
  }, 1e3);
74
72
  return () => {
75
- clearInterval(l);
73
+ clearInterval(f);
76
74
  };
77
- }, [r]), /* @__PURE__ */ c(A, { children: [
78
- /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
79
- /* @__PURE__ */ c(
80
- P,
75
+ }, [i]), /* @__PURE__ */ p(v, { children: [
76
+ /* @__PURE__ */ p("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
77
+ /* @__PURE__ */ p(
78
+ b,
81
79
  {
82
80
  imageName: "send",
83
81
  title: `Check your email!
@@ -85,280 +83,278 @@ function Ee() {
85
83
  children: [
86
84
  "We've sent a magic link to",
87
85
  " ",
88
- /* @__PURE__ */ n(m, { as: "span", className: "zd:text-solarOrange", children: e }),
86
+ /* @__PURE__ */ t(z, { as: "span", className: "zd:text-solarOrange", children: e }),
89
87
  `
90
88
  `,
91
89
  "Please open the email and click the link to log in."
92
90
  ]
93
91
  }
94
92
  ),
95
- /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(m, { className: "zd:text-center", children: [
93
+ /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ p(z, { className: "zd:text-center", children: [
96
94
  "Did not get an email?",
97
95
  " ",
98
- /* @__PURE__ */ n(
96
+ /* @__PURE__ */ t(
99
97
  "button",
100
98
  {
101
99
  type: "button",
102
- disabled: !i,
100
+ disabled: !s,
103
101
  onClick: async () => {
104
- if (!(!e || !i))
102
+ if (!(!e || !s))
105
103
  try {
106
- const { otpId: l, otpEncryptionTargetBundle: h } = await a({
104
+ const { otpId: f, otpEncryptionTargetBundle: m } = await a({
107
105
  email: e
108
106
  });
109
- s({ otpId: l, otpEncryptionTargetBundle: h }), d(60);
107
+ n({ otpId: f, otpEncryptionTargetBundle: m }), o(60);
110
108
  } catch {
111
109
  }
112
110
  },
113
111
  className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
114
- children: i ? "Resend" : `Resend in ${r} ${r === 1 ? "second" : "seconds"}`
112
+ children: s ? "Resend" : `Resend in ${i} ${i === 1 ? "second" : "seconds"}`
115
113
  }
116
114
  )
117
115
  ] }) })
118
116
  ] }),
119
- /* @__PURE__ */ n(B, { className: "zd:self-center zd:pt-4 zd:pb-6" })
117
+ /* @__PURE__ */ t(O, { className: "zd:self-center zd:pt-4 zd:pb-6" })
120
118
  ] });
121
119
  }
122
- function ke() {
120
+ function T2() {
123
121
  return typeof window > "u" ? !1 : new URLSearchParams(window.location.search).has("code");
124
122
  }
125
- function M() {
123
+ function U() {
126
124
  if (typeof window > "u") return;
127
125
  const e = new URL(window.location.href);
128
126
  e.searchParams.has("code") && (e.searchParams.delete("code"), window.history.replaceState(null, "", e.toString()));
129
127
  }
130
- function Te({
128
+ function O2({
131
129
  title: e = "Oops, something went wrong",
132
- message: s = "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",
130
+ message: n = "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",
133
131
  showRetry: a = !1,
134
- showChooseAnother: t = !0
132
+ showChooseAnother: r = !0
135
133
  }) {
136
- const { goToStep: r, goBack: d, reset: i } = R();
137
- return /* @__PURE__ */ c(A, { children: [
138
- /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
139
- /* @__PURE__ */ n(P, { imageName: "error", title: e, children: s }),
140
- /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-1", children: [
141
- a && /* @__PURE__ */ n(E, { action: "primary", text: "Try again", onClick: d ?? (() => r("sign-up")) }),
142
- t && /* @__PURE__ */ n(
143
- E,
134
+ const { goToStep: i, goBack: o, reset: s } = F();
135
+ return /* @__PURE__ */ p(v, { children: [
136
+ /* @__PURE__ */ p("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
137
+ /* @__PURE__ */ t(b, { imageName: "error", title: e, children: n }),
138
+ /* @__PURE__ */ p("div", { className: "zd:flex zd:flex-col zd:gap-1", children: [
139
+ a && /* @__PURE__ */ t(S, { action: "primary", text: "Try again", onClick: o ?? (() => i("sign-up")) }),
140
+ r && /* @__PURE__ */ t(
141
+ S,
144
142
  {
145
143
  action: a ? "secondary" : "primary",
146
144
  onClick: () => {
147
- M(), r("sign-up");
145
+ U(), i("sign-up");
148
146
  },
149
147
  text: "Choose another sign-in method"
150
148
  }
151
149
  ),
152
- !a && !t && /* @__PURE__ */ n(E, { action: "primary", text: "Start over", onClick: i })
150
+ !a && !r && /* @__PURE__ */ t(S, { action: "primary", text: "Start over", onClick: s })
153
151
  ] })
154
152
  ] }),
155
- /* @__PURE__ */ n(B, { className: "zd:self-center zd:pt-4 zd:pb-6" })
153
+ /* @__PURE__ */ t(O, { className: "zd:self-center zd:pt-4 zd:pb-6" })
156
154
  ] });
157
155
  }
158
- const Ie = 4, Ae = 8, Ce = 6;
159
- function Le(e) {
160
- return Math.max(Ie, Math.min(Ae, e));
156
+ const I2 = 4, H2 = 8, P2 = 6;
157
+ function R2(e) {
158
+ return Math.max(I2, Math.min(H2, e));
161
159
  }
162
- function Pe({ char: e, isFocused: s }) {
163
- return /* @__PURE__ */ n(
164
- ne,
160
+ function B2({ char: e, isFocused: n }) {
161
+ return /* @__PURE__ */ t(
162
+ a2,
165
163
  {
166
164
  "data-testid": "code-input-box",
167
- "data-active": s || void 0,
168
- className: G(
165
+ "data-active": n || void 0,
166
+ className: j(
169
167
  "zd:h-16 zd:w-14 zd:rounded-lg zd:flex zd:items-center zd:justify-center",
170
- s && "zd:border-[1.5px] zd:border-greyScale"
168
+ n && "zd:border-[1.5px] zd:border-greyScale"
171
169
  ),
172
- children: /* @__PURE__ */ n(m, { className: "zd:text-h2", children: e })
170
+ children: /* @__PURE__ */ t(z, { className: "zd:text-h2", children: e })
173
171
  }
174
172
  );
175
173
  }
176
- function Re({
174
+ function Z2({
177
175
  onChange: e,
178
- onComplete: s,
176
+ onComplete: n,
179
177
  disabled: a = !1,
180
- error: t = !1,
181
- autoFocus: r = !1,
182
- length: d = Ce,
183
- "data-testid": i
178
+ error: r = !1,
179
+ autoFocus: i = !1,
180
+ length: o = P2,
181
+ "data-testid": s
184
182
  }) {
185
- const u = Le(d), l = le(
186
- () => Array.from({ length: u }, (p, g) => ({
187
- id: `char-${g}`,
188
- index: g
183
+ const c = R2(o), f = f2(
184
+ () => Array.from({ length: c }, (d, D) => ({
185
+ id: `char-${D}`,
186
+ index: D
189
187
  })),
190
- [u]
191
- ), [h, x] = w(""), [f, N] = w(!1), k = K(null);
192
- O(() => {
193
- var p;
194
- r && !a && ((p = k.current) == null || p.focus());
195
- }, [r, a]), O(() => {
196
- x((p) => p.slice(0, u));
197
- }, [u]);
198
- const v = (p) => {
199
- const g = p.slice(0, u).toUpperCase();
200
- x(g), e == null || e(g), g.length === u && setTimeout(() => {
188
+ [c]
189
+ ), [m, g] = E(""), [w, u] = E(!1), l = X(null);
190
+ N(() => {
191
+ var d;
192
+ i && !a && ((d = l.current) == null || d.focus());
193
+ }, [i, a]), N(() => {
194
+ g((d) => d.slice(0, c));
195
+ }, [c]);
196
+ const h = (d) => {
197
+ const D = d.slice(0, c).toUpperCase();
198
+ g(D), e == null || e(D), D.length === c && setTimeout(() => {
201
199
  var C;
202
- s == null || s(g), (C = k.current) == null || C.blur();
200
+ n == null || n(D), (C = l.current) == null || C.blur();
203
201
  }, 0);
204
202
  };
205
- return /* @__PURE__ */ c(
203
+ return /* @__PURE__ */ p(
206
204
  "button",
207
205
  {
208
206
  type: "button",
209
207
  className: "zd:flex zd:flex-row zd:items-center zd:justify-between zd:gap-2 zd:w-full zd:cursor-text",
210
208
  onClick: () => {
211
- var p;
212
- return (p = k.current) == null ? void 0 : p.focus();
209
+ var d;
210
+ return (d = l.current) == null ? void 0 : d.focus();
213
211
  },
214
212
  disabled: a,
215
- "data-testid": i,
213
+ "data-testid": s,
216
214
  children: [
217
- /* @__PURE__ */ n(
215
+ /* @__PURE__ */ t(
218
216
  "input",
219
217
  {
220
- ref: k,
221
- value: h,
222
- onChange: (p) => v(p.target.value),
223
- onFocus: () => N(!0),
224
- onBlur: () => N(!1),
225
- maxLength: u,
218
+ ref: l,
219
+ value: m,
220
+ onChange: (d) => h(d.target.value),
221
+ onFocus: () => u(!0),
222
+ onBlur: () => u(!1),
223
+ maxLength: c,
226
224
  disabled: a,
227
225
  className: "zd:absolute zd:opacity-0 zd:pointer-events-none",
228
226
  style: { position: "absolute", opacity: 0 },
229
227
  "aria-label": "Verification code"
230
228
  }
231
229
  ),
232
- l.map((p) => /* @__PURE__ */ n(
233
- Pe,
230
+ f.map((d) => /* @__PURE__ */ t(
231
+ B2,
234
232
  {
235
- char: h[p.index] ?? "",
236
- isFocused: !t && f && p.index === h.length
233
+ char: m[d.index] ?? "",
234
+ isFocused: !r && w && d.index === m.length
237
235
  },
238
- p.id
236
+ d.id
239
237
  ))
240
238
  ]
241
239
  }
242
240
  );
243
241
  }
244
- function Oe() {
242
+ function G2() {
245
243
  const {
246
244
  email: e,
247
- otpId: s,
245
+ otpId: n,
248
246
  otpEncryptionTargetBundle: a,
249
- setOtpSession: t,
250
- clearOtpSession: r,
251
- goToStep: d,
252
- config: i
253
- } = R(), { mutateAsync: u, isPending: l } = J(), { mutateAsync: h, isPending: x } = he(), [f, N] = w(""), [k, v] = w(!1), [p, g] = w(60);
254
- O(() => {
255
- if (p <= 0) return;
256
- const S = setInterval(() => {
257
- g((T) => Math.max(0, T - 1));
247
+ setOtpSession: r,
248
+ clearOtpSession: i,
249
+ goToStep: o
250
+ } = F(), { mutateAsync: s, isPending: c } = Y(), { mutateAsync: f, isPending: m } = E2(), [g, w] = E(""), [u, l] = E(!1), [h, d] = E(60);
251
+ N(() => {
252
+ if (h <= 0) return;
253
+ const y = setInterval(() => {
254
+ d((R) => Math.max(0, R - 1));
258
255
  }, 1e3);
259
- return () => clearInterval(S);
260
- }, [p]);
261
- const C = async () => {
262
- var S, T;
263
- if (!(!f.trim() || !s || !a)) {
264
- v(!1);
256
+ return () => clearInterval(y);
257
+ }, [h]);
258
+ const D = async () => {
259
+ if (!(!g.trim() || !n || !a)) {
260
+ l(!1);
265
261
  try {
266
- await h({
267
- otpId: s,
268
- code: f.trim(),
262
+ await f({
263
+ otpId: n,
264
+ code: g.trim(),
269
265
  otpEncryptionTargetBundle: a
270
- }), r(), d("authenticated"), (S = i == null ? void 0 : i.onSuccess) == null || S.call(i);
271
- } catch (F) {
272
- v(!0), (T = i == null ? void 0 : i.onError) == null || T.call(i, F);
266
+ }), i(), o("authenticated");
267
+ } catch {
268
+ l(!0);
273
269
  }
274
270
  }
275
- }, y = (S) => {
276
- N(S);
277
- }, H = async () => {
278
- if (!(!e || p > 0 || l))
271
+ }, C = (y) => {
272
+ w(y);
273
+ }, x = async () => {
274
+ if (!(!e || h > 0 || c))
279
275
  try {
280
- const { otpId: S, otpEncryptionTargetBundle: T } = await u({ email: e });
281
- t({
282
- otpId: S,
283
- otpEncryptionTargetBundle: T
284
- }), g(60), v(!1);
276
+ const { otpId: y, otpEncryptionTargetBundle: R } = await s({ email: e });
277
+ r({
278
+ otpId: y,
279
+ otpEncryptionTargetBundle: R
280
+ }), d(60), l(!1);
285
281
  } catch {
286
- v(!0);
282
+ l(!0);
287
283
  }
288
- }, U = p <= 0 && !l;
289
- return /* @__PURE__ */ c(A, { children: [
290
- /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center", children: [
291
- /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4", children: [
292
- /* @__PURE__ */ n(m, { className: "zd:text-h2 zd:text-center", children: "Enter verification code" }),
293
- /* @__PURE__ */ c(m, { className: "zd:text-center", children: [
284
+ }, A = h <= 0 && !c;
285
+ return /* @__PURE__ */ p(v, { children: [
286
+ /* @__PURE__ */ p("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center", children: [
287
+ /* @__PURE__ */ p("div", { className: "zd:flex zd:flex-col zd:gap-4", children: [
288
+ /* @__PURE__ */ t(z, { className: "zd:text-h2 zd:text-center", children: "Enter verification code" }),
289
+ /* @__PURE__ */ p(z, { className: "zd:text-center", children: [
294
290
  "Enter the code from the email we sent to",
295
291
  " ",
296
- /* @__PURE__ */ n(m, { className: "zd:text-solarOrange", children: e })
292
+ /* @__PURE__ */ t(z, { className: "zd:text-solarOrange", children: e })
297
293
  ] })
298
294
  ] }),
299
- /* @__PURE__ */ n(
300
- Re,
295
+ /* @__PURE__ */ t(
296
+ Z2,
301
297
  {
302
- onComplete: y,
303
- onChange: () => v(!1),
304
- disabled: x,
305
- error: k,
298
+ onComplete: C,
299
+ onChange: () => l(!1),
300
+ disabled: m,
301
+ error: u,
306
302
  autoFocus: !0
307
303
  }
308
304
  ),
309
- /* @__PURE__ */ n(
310
- E,
305
+ /* @__PURE__ */ t(
306
+ S,
311
307
  {
312
308
  text: "Confirm code",
313
- onClick: C,
314
- disabled: !f.trim() || x
309
+ onClick: D,
310
+ disabled: !g.trim() || m
315
311
  }
316
312
  ),
317
- /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(m, { className: "zd:text-center", children: [
313
+ /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ p(z, { className: "zd:text-center", children: [
318
314
  "Did not get an email?",
319
315
  " ",
320
- /* @__PURE__ */ n(
316
+ /* @__PURE__ */ t(
321
317
  "button",
322
318
  {
323
319
  type: "button",
324
- disabled: !U,
325
- onClick: H,
320
+ disabled: !A,
321
+ onClick: x,
326
322
  className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
327
- children: U ? "Resend" : `Resend in ${p} ${p === 1 ? "second" : "seconds"}`
323
+ children: A ? "Resend" : `Resend in ${h} ${h === 1 ? "second" : "seconds"}`
328
324
  }
329
325
  )
330
326
  ] }) })
331
327
  ] }),
332
- /* @__PURE__ */ n(B, { className: "zd:self-center zd:pt-4 zd:pb-6" })
328
+ /* @__PURE__ */ t(O, { className: "zd:self-center zd:pt-4 zd:pb-6" })
333
329
  ] });
334
330
  }
335
- function Be({
331
+ function V2({
336
332
  termsAndConditionsUrl: e,
337
- privacyPolicyUrl: s,
333
+ privacyPolicyUrl: n,
338
334
  agreedToTerms: a,
339
- setAgreedToTerms: t,
340
- highlight: r = !1
335
+ setAgreedToTerms: r,
336
+ highlight: i = !1
341
337
  }) {
342
- return /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-5", children: [
343
- !!(e || s) && /* @__PURE__ */ c(
338
+ return /* @__PURE__ */ p("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-5", children: [
339
+ !!(e || n) && /* @__PURE__ */ p(
344
340
  "div",
345
341
  {
346
- className: `zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${r ? "zd:border zd:border-negative" : "zd:border zd:border-transparent"}`,
342
+ className: `zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${i ? "zd:border zd:border-negative" : "zd:border zd:border-transparent"}`,
347
343
  children: [
348
- /* @__PURE__ */ n(
344
+ /* @__PURE__ */ t(
349
345
  "input",
350
346
  {
351
347
  type: "checkbox",
352
348
  checked: a,
353
- onChange: (i) => t(i.target.checked),
349
+ onChange: (s) => r(s.target.checked),
354
350
  className: "zd:cursor-pointer zd:[color-scheme:light]"
355
351
  }
356
352
  ),
357
- /* @__PURE__ */ c(m, { className: "zd:flex-1", children: [
353
+ /* @__PURE__ */ p(z, { className: "zd:flex-1", children: [
358
354
  "I agree to the",
359
355
  " ",
360
- e && /* @__PURE__ */ n(
361
- m,
356
+ e && /* @__PURE__ */ t(
357
+ z,
362
358
  {
363
359
  as: "a",
364
360
  href: e,
@@ -368,12 +364,12 @@ function Be({
368
364
  children: "Terms & Conditions"
369
365
  }
370
366
  ),
371
- e && s && " and ",
372
- s && /* @__PURE__ */ n(
373
- m,
367
+ e && n && " and ",
368
+ n && /* @__PURE__ */ t(
369
+ z,
374
370
  {
375
371
  as: "a",
376
- href: s,
372
+ href: n,
377
373
  target: "_blank",
378
374
  rel: "noopener noreferrer",
379
375
  className: "zd:underline",
@@ -384,21 +380,17 @@ function Be({
384
380
  ]
385
381
  }
386
382
  ),
387
- /* @__PURE__ */ n(B, {})
383
+ /* @__PURE__ */ t(O, {})
388
384
  ] });
389
385
  }
390
- const Me = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
391
- function j(e) {
392
- return Me.test(e.trim());
393
- }
394
- const Ue = "" + new URL("blob.webm", import.meta.url).href;
395
- function je({ className: e }) {
396
- return /* @__PURE__ */ n(
386
+ const W2 = "" + new URL("blob.webm", import.meta.url).href;
387
+ function j2({ className: e }) {
388
+ return /* @__PURE__ */ t(
397
389
  "video",
398
390
  {
399
391
  className: e,
400
392
  style: { aspectRatio: "1 / 1" },
401
- src: Ue,
393
+ src: W2,
402
394
  autoPlay: !0,
403
395
  loop: !0,
404
396
  muted: !0,
@@ -408,462 +400,706 @@ function je({ className: e }) {
408
400
  }
409
401
  );
410
402
  }
411
- function _(e) {
412
- return e instanceof Error ? e.name === "AbortError" || e.name === "NotAllowedError" ? !0 : e.message.toLowerCase().includes("oauth popup was closed") : !1;
403
+ const Q = h2(null);
404
+ function _() {
405
+ const e = m2(Q);
406
+ if (!e)
407
+ throw new Error("SignUp.* components must be rendered inside <SignUp>");
408
+ return e;
413
409
  }
414
- function He() {
415
- const { goToStep: e, setEmail: s, setOtpSession: a, config: t, enabledMethods: r } = R(), [d, i] = w(!1), [u, l] = w(!1), [h, x] = w(""), f = (t == null ? void 0 : t.emailAuthMethod) === "otp", { mutateAsync: N, isPending: k } = J(), { mutateAsync: v, isPending: p } = Y(), g = k || p, [C, y] = w(null), { mutateAsync: H, isPending: U } = pe({
416
- mutation: {
417
- onSuccess: async () => {
418
- var o;
419
- e("authenticated"), (o = t == null ? void 0 : t.onSuccess) == null || o.call(t);
420
- },
421
- onError: (o) => {
422
- var z;
423
- (z = t == null ? void 0 : t.onError) == null || z.call(t, o);
410
+ function L(e) {
411
+ const { setAuthPending: n } = _();
412
+ N(() => (n(e), () => n(!1)), [e, n]);
413
+ }
414
+ const q2 = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
415
+ function B(e) {
416
+ return q2.test(e.trim());
417
+ }
418
+ function e2() {
419
+ const { goToStep: e, setEmail: n, setOtpSession: a } = F(), {
420
+ authPending: r,
421
+ emailAuthMethod: i,
422
+ needsAgreement: o,
423
+ guardAgreement: s,
424
+ setError: c
425
+ } = _(), [f, m] = E(""), g = i === "otp", { mutateAsync: w, isPending: u } = Y(), { mutateAsync: l, isPending: h } = J(), d = u || h;
426
+ L(d);
427
+ const D = async () => {
428
+ if (!(!f || r) && B(f) && s()) {
429
+ c(null);
430
+ try {
431
+ const C = g ? w : l, { otpId: x, otpEncryptionTargetBundle: A } = await C({
432
+ email: f
433
+ });
434
+ n(f), a({ otpId: x, otpEncryptionTargetBundle: A }), e(g ? "otp-input" : "email-verification");
435
+ } catch (C) {
436
+ c(
437
+ C instanceof Error ? C.message : "Failed to send verification code"
438
+ );
424
439
  }
425
440
  }
426
- }), { mutate: S, isPending: T } = me({
427
- mutation: {
428
- onSuccess: () => {
429
- var o;
430
- e("authenticated"), (o = t == null ? void 0 : t.onSuccess) == null || o.call(t);
441
+ };
442
+ return /* @__PURE__ */ t(
443
+ o2,
444
+ {
445
+ iconName: "email",
446
+ placeholder: "Enter your email",
447
+ value: f,
448
+ onChange: (C) => m(C.target.value),
449
+ type: "email",
450
+ autoCapitalize: "none",
451
+ autoComplete: "email",
452
+ disabled: r,
453
+ variant: "listItemStyle",
454
+ onKeyDown: (C) => {
455
+ C.key === "Enter" && f && !r && D();
431
456
  },
432
- onError: (o) => {
433
- var z;
434
- _(o) || y(o instanceof Error ? o.message : String(o)), (z = t == null ? void 0 : t.onError) == null || z.call(t, o);
435
- }
457
+ children: d ? /* @__PURE__ */ t("div", { className: "zd:w-13 zd:h-13 zd:flex zd:items-center zd:justify-center", children: /* @__PURE__ */ t("div", { className: "zd:w-5 zd:h-5 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin" }) }) : /* @__PURE__ */ t(
458
+ "button",
459
+ {
460
+ type: "button",
461
+ disabled: !B(f) || o,
462
+ className: `zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${B(f) && !o ? "zd:cursor-pointer" : "zd:cursor-not-allowed zd:opacity-50"}`,
463
+ onClick: () => D(),
464
+ children: /* @__PURE__ */ t(q, { name: "chevronRight", className: "zd:text-greyScale" })
465
+ }
466
+ )
436
467
  }
437
- }), { mutate: F, isPending: Q } = ze({
468
+ );
469
+ }
470
+ function I(e) {
471
+ return e instanceof Error ? e.name === "AbortError" || e.name === "NotAllowedError" || e.name === "UserRejectedRequestError" ? !0 : e.message.toLowerCase().includes("oauth popup was closed") : !1;
472
+ }
473
+ function t2() {
474
+ const { goToStep: e } = F(), { authPending: n, guardAgreement: a, setError: r } = _(), { mutateAsync: i, isPending: o } = w2({
438
475
  mutation: {
439
476
  onSuccess: () => {
440
- var o;
441
- e("authenticated"), (o = t == null ? void 0 : t.onSuccess) == null || o.call(t);
442
- },
443
- onError: (o) => {
444
- var z;
445
- _(o) || y(o instanceof Error ? o.message : String(o)), (z = t == null ? void 0 : t.onError) == null || z.call(t, o);
477
+ e("authenticated");
446
478
  }
447
479
  }
448
- }), b = U || g || T || Q, L = !!(t != null && t.termsAndConditionsUrl || t != null && t.privacyPolicyUrl) && !d, Z = () => {
449
- if (!b) {
450
- if (L) {
451
- l(!0);
452
- return;
480
+ });
481
+ return L(o), /* @__PURE__ */ t(
482
+ T,
483
+ {
484
+ icon: /* @__PURE__ */ t($, { name: "google" }),
485
+ title: "Google",
486
+ trailing: /* @__PURE__ */ t(P, {}),
487
+ disabled: n,
488
+ onClick: async () => {
489
+ if (!n && a()) {
490
+ r(null);
491
+ try {
492
+ await i({ provider: "google" });
493
+ } catch (c) {
494
+ I(c) || r(c instanceof Error ? c.message : String(c));
495
+ }
496
+ }
453
497
  }
454
- y(null), S();
455
498
  }
456
- }, ee = () => {
457
- if (!b) {
458
- if (L) {
459
- l(!0);
460
- return;
499
+ );
500
+ }
501
+ function H(e, n) {
502
+ return !!n.rdns && (e.id === n.rdns || (Array.isArray(e.rdns) ? e.rdns.includes(n.rdns) : e.rdns === n.rdns));
503
+ }
504
+ const $2 = [
505
+ {
506
+ id: "metamask",
507
+ name: "MetaMask",
508
+ rdns: "io.metamask",
509
+ icon: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%23ff5c16%22%20d%3D%22m24.024%2023.824-4.846-1.434-3.655%202.172-2.55-.001-3.656-2.171-4.844%201.434L3%2018.88l1.473-5.488L3%208.751%204.473%203l7.569%204.496h4.413L24.024%203l1.473%205.751-1.473%204.64%201.473%205.488z%22%2F%3E%3Cpath%20fill%3D%22%23ff5c16%22%20d%3D%22m4.474%203%207.57%204.499-.302%203.087zm4.844%2015.881%203.33%202.522-3.33.987zm3.064-4.17-.64-4.123-4.097%202.804h-.002v.001l.013%202.886%201.661-1.567zM24.024%203l-7.57%204.499.3%203.087zM19.18%2018.881l-3.33%202.522%203.33.987zm1.674-5.488v-.002zl-4.097-2.804-.64%204.124h3.064l1.662%201.567z%22%2F%3E%3Cpath%20fill%3D%22%23e34807%22%20d%3D%22m9.317%2022.39-4.844%201.434L3%2018.881h6.317zm3.064-7.68.925%205.962-1.282-3.315-4.37-1.078%201.662-1.568zm6.799%207.68%204.844%201.434%201.473-4.943H19.18zm-3.064-7.68-.925%205.962%201.282-3.315%204.37-1.078-1.663-1.568z%22%2F%3E%3Cpath%20fill%3D%22%23ff8d5d%22%20d%3D%22m3%2018.88%201.473-5.489h3.169l.012%202.887%204.37%201.078%201.282%203.314-.659.73-3.33-2.522H3zm22.497%200-1.473-5.489h-3.17l-.01%202.887-4.371%201.078-1.282%203.314.659.73%203.33-2.522h6.317zM16.455%207.495h-4.413l-.3%203.087%201.565%2010.084h1.884l1.565-10.084z%22%2F%3E%3Cpath%20fill%3D%22%23661800%22%20d%3D%22M4.473%203%203%208.751l1.473%204.64h3.169l4.1-2.805zm6.992%2012.908H10.03l-.781.761%202.776.685-.56-1.447M24.024%203l1.473%205.751-1.473%204.64h-3.17l-4.098-2.805zm-6.99%2012.908h1.437l.782.762-2.78.686.56-1.45zm-1.512%206.687.328-1.193-.66-.73h-1.885l-.659.73.327%201.192%22%2F%3E%3Cpath%20fill%3D%22%23c0c4cd%22%20d%3D%22M15.522%2022.594v1.969h-2.548v-1.969z%22%2F%3E%3Cpath%20fill%3D%22%23e7ebf6%22%20d%3D%22m9.318%2022.388%203.658%202.174v-1.969l-.328-1.192zm9.862%200-3.658%202.174v-1.969l.328-1.192z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M3%203h22.5v21.563H3z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",
510
+ mobileLink: "https://metamask.app.link/wc?uri=",
511
+ downloadUrl: "https://metamask.io/download"
512
+ },
513
+ {
514
+ id: "trust",
515
+ name: "Trust Wallet",
516
+ rdns: "com.trustwallet.app",
517
+ icon: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%230500FF%22%20d%3D%22M6%207.583%2013.53%205v17.882C8.15%2020.498%206%2015.928%206%2013.345V7.583Z%22%2F%3E%3Cpath%20fill%3D%22url(%23a)%22%20d%3D%22M22%207.583%2013.53%205v17.882c6.05-2.384%208.47-6.954%208.47-9.537V7.583Z%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22a%22%20x1%3D%2219.768%22%20x2%3D%2214.072%22%20y1%3D%223.753%22%20y2%3D%2222.853%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%22.02%22%20stop-color%3D%22%2300F%22%2F%3E%3Cstop%20offset%3D%22.08%22%20stop-color%3D%22%230094FF%22%2F%3E%3Cstop%20offset%3D%22.16%22%20stop-color%3D%22%2348FF91%22%2F%3E%3Cstop%20offset%3D%22.42%22%20stop-color%3D%22%230094FF%22%2F%3E%3Cstop%20offset%3D%22.68%22%20stop-color%3D%22%230038FF%22%2F%3E%3Cstop%20offset%3D%22.9%22%20stop-color%3D%22%230500FF%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",
518
+ mobileLink: "trust://wc?uri=",
519
+ downloadUrl: "https://trustwallet.com/download"
520
+ },
521
+ {
522
+ id: "coinbase",
523
+ name: "Coinbase Wallet",
524
+ rdns: "com.coinbase.wallet",
525
+ icon: "data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22%232C5FF6%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14%2023.8C19.4124%2023.8%2023.8%2019.4124%2023.8%2014C23.8%208.58761%2019.4124%204.2%2014%204.2C8.58761%204.2%204.2%208.58761%204.2%2014C4.2%2019.4124%208.58761%2023.8%2014%2023.8ZM11.55%2010.8C11.1358%2010.8%2010.8%2011.1358%2010.8%2011.55V16.45C10.8%2016.8642%2011.1358%2017.2%2011.55%2017.2H16.45C16.8642%2017.2%2017.2%2016.8642%2017.2%2016.45V11.55C17.2%2011.1358%2016.8642%2010.8%2016.45%2010.8H11.55Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E",
526
+ downloadUrl: "https://coinbase.com/wallet/downloads"
527
+ },
528
+ {
529
+ id: "rainbow",
530
+ name: "Rainbow",
531
+ rdns: "me.rainbow",
532
+ icon: "data:image/svg+xml,%3Csvg%20width%3D%22120%22%20height%3D%22120%22%20viewBox%3D%220%200%20120%20120%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%22120%22%20height%3D%22120%22%20fill%3D%22url(%23paint0_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2038H26C56.9279%2038%2082%2063.0721%2082%2094V100H94C97.3137%20100%20100%2097.3137%20100%2094C100%2053.1309%2066.8691%2020%2026%2020C22.6863%2020%2020%2022.6863%2020%2026V38Z%22%20fill%3D%22url(%23paint1_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M84%2094H100C100%2097.3137%2097.3137%20100%2094%20100H84V94Z%22%20fill%3D%22url(%23paint2_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M26%2020L26%2036H20L20%2026C20%2022.6863%2022.6863%2020%2026%2020Z%22%20fill%3D%22url(%23paint3_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2036H26C58.0325%2036%2084%2061.9675%2084%2094V100H66V94C66%2071.9086%2048.0914%2054%2026%2054H20V36Z%22%20fill%3D%22url(%23paint4_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M68%2094H84V100H68V94Z%22%20fill%3D%22url(%23paint5_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2052L20%2036L26%2036L26%2052H20Z%22%20fill%3D%22url(%23paint6_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2062C20%2065.3137%2022.6863%2068%2026%2068C40.3594%2068%2052%2079.6406%2052%2094C52%2097.3137%2054.6863%20100%2058%20100H68V94C68%2070.804%2049.196%2052%2026%2052H20V62Z%22%20fill%3D%22url(%23paint7_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M52%2094H68V100H58C54.6863%20100%2052%2097.3137%2052%2094Z%22%20fill%3D%22url(%23paint8_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M26%2068C22.6863%2068%2020%2065.3137%2020%2062L20%2052L26%2052L26%2068Z%22%20fill%3D%22url(%23paint9_radial_62_329)%22%2F%3E%0A%3Cdefs%3E%0A%3ClinearGradient%20id%3D%22paint0_linear_62_329%22%20x1%3D%2260%22%20y1%3D%220%22%20x2%3D%2260%22%20y2%3D%22120%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23174299%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23001E59%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint1_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(74)%22%3E%0A%3Cstop%20offset%3D%220.770277%22%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3ClinearGradient%20id%3D%22paint2_linear_62_329%22%20x1%3D%2283%22%20y1%3D%2297%22%20x2%3D%22100%22%20y2%3D%2297%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint3_linear_62_329%22%20x1%3D%2223%22%20y1%3D%2220%22%20x2%3D%2223%22%20y2%3D%2237%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%238754C9%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint4_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(58)%22%3E%0A%3Cstop%20offset%3D%220.723929%22%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3ClinearGradient%20id%3D%22paint5_linear_62_329%22%20x1%3D%2268%22%20y1%3D%2297%22%20x2%3D%2284%22%20y2%3D%2297%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint6_linear_62_329%22%20x1%3D%2223%22%20y1%3D%2252%22%20x2%3D%2223%22%20y2%3D%2236%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint7_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(42)%22%3E%0A%3Cstop%20offset%3D%220.59513%22%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3CradialGradient%20id%3D%22paint8_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(51%2097)%20scale(17%2045.3333)%22%3E%0A%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3CradialGradient%20id%3D%22paint9_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(23%2069)%20rotate(-90)%20scale(17%20322.37)%22%3E%0A%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E",
533
+ mobileLink: "rainbow://wc?uri=",
534
+ downloadUrl: "https://rainbow.download"
535
+ },
536
+ {
537
+ id: "rabby",
538
+ name: "Rabby Wallet",
539
+ rdns: "io.rabby",
540
+ icon: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%238697FF%22%20d%3D%22M28%200H0v28h28V0Z%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M22.54%2015.078c.677-1.514-2.673-5.744-5.874-7.506-2.017-1.365-4.12-1.178-4.545-.579-.935%201.316%203.094%202.43%205.788%203.731-.58.252-1.125.703-1.446%201.28-1.004-1.096-3.209-2.04-5.796-1.28-1.743.513-3.191%201.721-3.751%203.546a1.097%201.097%200%201%200-.445%202.1c.112%200%20.463-.075.463-.075l5.612.041c-2.244%203.56-4.018%204.081-4.018%204.698s1.697.45%202.335.22c3.05-1.1%206.327-4.531%206.89-5.519%202.36.295%204.345.33%204.786-.657Z%22%2F%3E%3Cpath%20fill%3D%22url(%23c)%22%20fill-rule%3D%22evenodd%22%20d%3D%22m17.885%2010.713.025.01c.125-.049.105-.233.07-.378-.078-.333-1.438-1.676-2.715-2.277-1.743-.82-3.025-.777-3.212-.398.356.726%201.998%201.408%203.714%202.12.723.3%201.46.606%202.118.923Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23d)%22%20fill-rule%3D%22evenodd%22%20d%3D%22M15.701%2018.036a10.296%2010.296%200%200%200-1.2-.37c.482-.862.583-2.138.128-2.945-.639-1.133-1.44-1.736-3.304-1.736-1.024%200-3.783.346-3.832%202.648-.005.242%200%20.464.017.667l5.036.037a17.264%2017.264%200%200%201-1.871%202.483c.669.172%201.221.316%201.728.448.48.125.92.24%201.38.357a21.003%2021.003%200%200%200%201.918-1.59Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23e)%22%20d%3D%22M6.848%2016.063c.206%201.75%201.2%202.435%203.232%202.638%202.032.203%203.197.067%204.749.208%201.296.118%202.453.778%202.882.55.386-.205.17-.947-.347-1.423-.67-.617-1.597-1.046-3.229-1.199.325-.89.234-2.138-.27-2.817-.731-.982-2.079-1.426-3.785-1.232-1.782.202-3.49%201.08-3.232%203.275Z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%2210.464%22%20x2%3D%2222.394%22%20y1%3D%2213.737%22%20y2%3D%2217.12%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22c%22%20x1%3D%2220.386%22%20x2%3D%2211.779%22%20y1%3D%2213.509%22%20y2%3D%224.879%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%237258DC%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23797DEA%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22d%22%20x1%3D%2215.94%22%20x2%3D%227.673%22%20y1%3D%2218.337%22%20y2%3D%2213.584%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%237461EA%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23BFC2FF%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22e%22%20x1%3D%2211.177%22%20x2%3D%2216.765%22%20y1%3D%2213.648%22%20y2%3D%2220.749%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%22.984%22%20stop-color%3D%22%23D5CEFF%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",
541
+ downloadUrl: "https://rabby.io"
542
+ },
543
+ {
544
+ id: "okx",
545
+ name: "OKX Wallet",
546
+ rdns: "com.okex.wallet",
547
+ icon: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10.819%205.556H5.93a.376.376%200%200%200-.375.375v4.888c0%20.207.168.375.375.375h4.888a.376.376%200%200%200%20.375-.376V5.932a.376.376%200%200%200-.376-.375Zm5.64%205.638h-4.886a.376.376%200%200%200-.376.376v4.887c0%20.208.168.376.376.376h4.887a.376.376%200%200%200%20.376-.375V11.57a.376.376%200%200%200-.376-.377Zm.75-5.638h4.887c.208%200%20.376.168.376.375v4.888a.376.376%200%200%201-.376.375H17.21a.376.376%200%200%201-.376-.376V5.933c0-.208.169-.376.376-.376Zm-6.39%2011.277H5.93a.376.376%200%200%200-.375.376v4.887c0%20.208.168.376.375.376h4.888a.376.376%200%200%200%20.375-.376V17.21a.376.376%200%200%200-.376-.376Zm6.39%200h4.887c.208%200%20.376.169.376.376v4.887a.376.376%200%200%201-.376.376H17.21a.376.376%200%200%201-.376-.376V17.21c0-.207.169-.376.376-.376Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E",
548
+ mobileLink: "okex://main/wc?uri=",
549
+ downloadUrl: "https://okx.com/download"
550
+ },
551
+ {
552
+ id: "zerion",
553
+ name: "Zerion",
554
+ rdns: "io.zerion.wallet",
555
+ icon: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%232962EF%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M6.073%207c-.48%200-.665.593-.262.841l10.073%206.074a.577.577%200%200%200%20.758-.139l4.43-5.814c.3-.404-.004-.962-.525-.962H6.073ZM21.904%2021c.48%200%20.67-.596.267-.844l-10.075-6.073a.569.569%200%200%200-.751.146l-4.437%205.813c-.301.404.012.958.534.958h14.462Z%22%2F%3E%3C%2Fsvg%3E",
556
+ mobileLink: "zerion://wc?uri=",
557
+ downloadUrl: "https://zerion.io"
558
+ },
559
+ {
560
+ id: "uniswap",
561
+ name: "Uniswap",
562
+ rdns: "org.uniswap.app",
563
+ icon: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23FFD8EA%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cg%20fill%3D%22%23FF007A%22%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20d%3D%22M9.635%206.068c-.255-.039-.266-.043-.145-.06.23-.035.773.012%201.148.099.874.202%201.67.722%202.519%201.646l.225.246.323-.051c1.36-.213%202.741-.044%203.899.477.319.144.821.43.882.503.022.024.058.173.082.335.086.557.044.982-.13%201.301-.096.173-.101.228-.037.377a.367.367%200%200%200%20.334.206c.287%200%20.597-.454.74-1.086l.056-.252.113.126c.62.685%201.106%201.618%201.189%202.282l.021.174-.103-.158a1.966%201.966%200%200%200-.59-.604c-.415-.268-.855-.36-2.017-.42-1.05-.053-1.645-.141-2.234-.329-1.003-.32-1.508-.744-2.699-2.27-.53-.678-.855-1.053-1.18-1.354-.74-.687-1.466-1.047-2.396-1.187v-.001Z%22%2F%3E%3Cpath%20d%3D%22M18.725%207.581c.026-.453.088-.753.216-1.026.028-.07.063-.136.104-.198a.69.69%200%200%201-.049.178c-.092.266-.108.629-.043%201.052.081.536.126.613.706%201.192.273.272.589.613.704.761l.21.267-.21-.191c-.255-.233-.841-.69-.972-.755-.086-.042-.1-.042-.153.01-.05.048-.06.12-.068.461-.01.532-.084.873-.263%201.213-.096.187-.111.147-.025-.062.066-.155.072-.224.072-.739%200-1.033-.127-1.283-.864-1.707a8.169%208.169%200%200%200-.684-.346%202.614%202.614%200%200%201-.334-.16c.02-.02.74.185%201.029.293.431.163.502.183.555.164.034-.013.051-.113.068-.407h.001Zm-8.595%201.77c-.517-.696-.838-1.764-.768-2.563l.02-.247.119.02c.222.04.603.179.783.286.49.29.703.673.918%201.657.064.288.147.613.185.725.061.178.294.592.483.862.136.194.046.286-.255.26-.46-.04-1.083-.46-1.485-1Zm7.965%205.182c-2.42-.95-3.273-1.777-3.273-3.17%200-.206.007-.374.016-.374.008%200%20.102.067.208.151.491.384%201.04.548%202.563.765.896.128%201.398.231%201.864.382%201.48.478%202.392%201.449%202.61%202.773.063.384.028%201.104-.076%201.484-.082.3-.329.84-.394.861-.019.007-.037-.061-.04-.154-.025-.496-.283-.98-.715-1.343-.49-.412-1.15-.741-2.763-1.375Zm-1.699.396a4.13%204.13%200%200%200-.117-.5l-.062-.18.115.127c.16.173.285.396.391.693.082.227.09.294.09.662%200%20.361-.011.437-.087.64-.104.3-.28.572-.51.794-.443.44-1.011.683-1.833.784-.142.018-.557.047-.922.066-.922.046-1.529.144-2.073.33a.446.446%200%200%201-.156.036c-.021-.021.35-.237.656-.381.431-.204.861-.315%201.825-.47.475-.078.968-.173%201.093-.21%201.178-.352%201.784-1.263%201.59-2.39Z%22%2F%3E%3Cpath%20d%3D%22M17.506%2016.855c-.321-.675-.396-1.327-.22-1.935.02-.067.05-.119.068-.119a.64.64%200%200%201%20.169.09c.149.097.445.261%201.237.682.988.527%201.553.934%201.936%201.4.335.407.542.872.643%201.438.057.32.023%201.093-.061%201.416-.266%201.018-.882%201.818-1.764%202.285a2.129%202.129%200%200%201-.258.124c-.013%200%20.035-.116.104-.259.297-.605.331-1.193.107-1.848-.138-.401-.418-.89-.982-1.718-.657-.96-.817-1.218-.979-1.556Zm-9.095%203.644c.9-.742%202.016-1.267%203.036-1.43a4.85%204.85%200%200%201%201.575.06c.652.163%201.235.528%201.538.962.296.425.423.794.556%201.618.052.324.109.651.125.724.1.427.293.768.532.939.38.272%201.037.29%201.682.044a.853.853%200%200%201%20.21-.064c.023.023-.301.235-.53.347-.27.141-.572.213-.879.208-.59%200-1.08-.294-1.49-.891a7.027%207.027%200%200%201-.402-.784c-.431-.961-.644-1.253-1.145-1.575-.437-.28-1-.329-1.424-.126-.556.266-.71.96-.312%201.4.187.189.43.313.695.354a.75.75%200%200%200%20.589-.174.728.728%200%200%200%20.251-.551c0-.29-.114-.453-.4-.581-.392-.172-.812.029-.81.388%200%20.153.069.249.226.32.1.044.103.046.02.03-.358-.073-.442-.496-.154-.776.347-.336%201.064-.188%201.31.272.103.194.115.578.025.81-.203.52-.79.793-1.387.644-.407-.102-.571-.211-1.06-.703-.852-.856-1.182-1.023-2.408-1.21l-.237-.035.268-.22Z%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M4.418%205.179c2.842%203.368%204.8%204.757%205.017%205.05.18.243.112.462-.195.632a1.899%201.899%200%200%201-.699.191c-.2%200-.269-.075-.269-.075-.115-.106-.18-.088-.773-1.116A176.911%20176.911%200%200%200%205.968%207.56c-.044-.04-.042-.04%201.448%202.564.24.543.047.741.047.819%200%20.157-.044.24-.242.457-.332.36-.48.765-.587%201.604-.12.94-.456%201.604-1.39%202.741-.545.666-.635.787-.773%201.056-.174.338-.221.527-.24.952a2.9%202.9%200%200%200%20.16%201.174c.122.378.252.626.582%201.125.285.43.448.75.448.876%200%20.099.019.099.461.001%201.054-.232%201.91-.64%202.392-1.142.298-.311.367-.482.37-.907.002-.277-.008-.336-.085-.496-.125-.26-.353-.477-.855-.813-.66-.44-.942-.794-1.018-1.28-.065-.4.01-.682.373-1.427.377-.773.47-1.103.535-1.88.04-.503.096-.701.244-.861.155-.166.293-.222.676-.272.623-.084%201.018-.24%201.343-.534a1.14%201.14%200%200%200%20.421-.869l.014-.28-.16-.179C9.563%209.34%204.036%204.667%204%204.667c-.007%200%20.18.23.418.512Zm1.325%2013.086a.486.486%200%200%200-.157-.652c-.203-.133-.522-.069-.522.103%200%20.053.03.092.098.125.114.058.122.122.032.254s-.082.248.02.328c.168.126.404.057.529-.158ZM10.683%2012c-.29.086-.575.389-.664.706-.053.194-.022.534.058.638.13.169.255.213.596.212.665-.004%201.243-.283%201.311-.632.054-.286-.2-.68-.55-.855a1.33%201.33%200%200%200-.75-.07Zm.78.593c.102-.143.057-.296-.118-.4-.331-.199-.835-.035-.835.272%200%20.153.262.32.502.32.16%200%20.38-.093.45-.192Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M4%204h19v20H4z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",
564
+ mobileLink: "uniswap://wc?uri=",
565
+ downloadUrl: "https://wallet.uniswap.org"
566
+ },
567
+ {
568
+ id: "ledger",
569
+ name: "Ledger",
570
+ icon: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M11.65%204.4H4.4V9h1.1V5.5l6.15-.04V4.4Zm.05%205.95v7.25h4.6v-1.1h-3.5l-.04-6.15H11.7ZM4.4%2023.6h7.25v-1.06L5.5%2022.5V19H4.4v4.6ZM16.35%204.4h7.25V9h-1.1V5.5l-6.15-.04V4.4Zm7.25%2019.2h-7.25v-1.06l6.15-.04V19h1.1v4.6Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E",
571
+ mobileLink: "ledgerlive://wc?uri=",
572
+ downloadUrl: "https://www.ledger.com/ledger-live"
573
+ },
574
+ {
575
+ id: "binance",
576
+ name: "Binance Wallet",
577
+ rdns: "com.binance.wallet",
578
+ icon: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22130%22%20height%3D%22130%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h130v130H0z%22%2F%3E%3Cpath%20fill%3D%22%23F3BA2F%22%20d%3D%22M45.587%2057.02%2065.01%2037.606l19.43%2019.43%2011.295-11.303L65.01%2015%2034.284%2045.725zM15%2065.004l11.299-11.299%2011.298%2011.299L26.3%2076.302zM45.587%2072.983%2065.01%2092.406l19.43-19.43%2011.303%2011.287-.008.007-30.725%2030.734-30.725-30.718-.016-.016zM92.403%2065.006%20103.7%2053.708%20115%2065.006l-11.299%2011.299z%22%2F%3E%3Cpath%20fill%3D%22%23F3BA2F%22%20d%3D%22m76.471%2064.998-11.46-11.469-8.476%208.475-.98.972-2.005%202.006-.016.016.016.024%2011.46%2011.453%2011.461-11.47.008-.007z%22%2F%3E%3C%2Fsvg%3E",
579
+ mobileLink: "bnc://app.binance.com/cedefi/wc?uri=",
580
+ downloadUrl: "https://www.binance.com/en/download"
581
+ }
582
+ ], k = $2;
583
+ function K2({
584
+ excludeWalletIds: e = [],
585
+ maxWallets: n = 4
586
+ }) {
587
+ const { goToStep: a } = F(), { authPending: r, guardAgreement: i, setError: o, registeredWallets: s } = _(), c = Z(), { mutate: f, isPending: m } = G();
588
+ L(m);
589
+ const g = c.filter(
590
+ (u) => u.type === "injected" && u.id !== "injected" && u.id !== "zerodev-wallet"
591
+ ).map((u) => {
592
+ const l = k.find((h) => H(u, h));
593
+ return {
594
+ connector: u,
595
+ walletId: l == null ? void 0 : l.id,
596
+ name: (l == null ? void 0 : l.name) ?? u.name,
597
+ icon: (l == null ? void 0 : l.icon) ?? u.icon,
598
+ ids: l ? [l.id, u.id] : [u.id],
599
+ rank: l ? k.indexOf(l) : k.length
600
+ };
601
+ }).filter(
602
+ (u) => !(u.walletId && s.includes(u.walletId))
603
+ ).filter((u) => !u.ids.some((l) => e.includes(l))).sort((u, l) => u.rank - l.rank).slice(0, n), w = (u) => {
604
+ r || i() && (o(null), f(
605
+ { connector: u },
606
+ {
607
+ // The external wallet is now the active wagmi connection — the
608
+ // embedded-wallet flow is done, so close it (mirrors SignUp.Wallet).
609
+ onSuccess: () => a(null),
610
+ onError: (l) => {
611
+ I(l) || o(l instanceof Error ? l.message : String(l));
612
+ }
461
613
  }
462
- y(null), F();
463
- }
464
- }, te = async () => {
465
- if (L) {
466
- l(!0);
467
- return;
468
- }
469
- y(null);
470
- try {
471
- await H({ provider: "google" });
472
- } catch (o) {
473
- const z = o instanceof Error ? o.message : String(o);
474
- _(o) || y(z);
614
+ ));
615
+ };
616
+ return /* @__PURE__ */ t(v, { children: g.map(({ connector: u, name: l, icon: h }) => /* @__PURE__ */ t(
617
+ T,
618
+ {
619
+ title: l,
620
+ icon: h ? /* @__PURE__ */ t("img", { src: h, alt: "", className: "zd:w-6 zd:h-6" }) : null,
621
+ subtitle: /* @__PURE__ */ t(K, { text: "INSTALLED" }),
622
+ trailing: /* @__PURE__ */ t(P, {}),
623
+ disabled: r,
624
+ onClick: () => w(u)
625
+ },
626
+ u.uid
627
+ )) });
628
+ }
629
+ function X2({ tile: e }) {
630
+ return /* @__PURE__ */ p(
631
+ "button",
632
+ {
633
+ type: "button",
634
+ onClick: e.onSelect,
635
+ className: "zd:flex zd:flex-col zd:items-center zd:gap-1.5 zd:cursor-pointer",
636
+ children: [
637
+ /* @__PURE__ */ t("div", { className: "zd:w-16 zd:h-16 zd:rounded-2xl zd:bg-greyScale/5 zd:flex zd:items-center zd:justify-center", children: e.icon ? /* @__PURE__ */ t("img", { src: e.icon, alt: "", className: "zd:w-8 zd:h-8" }) : /* @__PURE__ */ t(
638
+ q,
639
+ {
640
+ name: "walletOutline",
641
+ className: "zd:w-8 zd:h-8 zd:text-greyScale"
642
+ }
643
+ ) }),
644
+ /* @__PURE__ */ t(z, { className: "zd:text-body3 zd:max-w-full zd:truncate", children: e.name })
645
+ ]
475
646
  }
476
- }, W = f ? async () => {
477
- if (!(!h || b) && j(h)) {
478
- if (L) {
479
- l(!0);
480
- return;
647
+ );
648
+ }
649
+ function J2({
650
+ open: e,
651
+ onOpenChange: n,
652
+ tiles: a
653
+ }) {
654
+ return /* @__PURE__ */ t(s2, { open: e, onOpenChange: n, children: /* @__PURE__ */ p(l2, { className: "zd:p-4", children: [
655
+ /* @__PURE__ */ t(d2, { children: "All wallets" }),
656
+ /* @__PURE__ */ p("div", { className: "zd:mb-3 zd:flex zd:items-center zd:gap-2", children: [
657
+ /* @__PURE__ */ t(z, { className: "zd:text-h3 zd:flex-1", children: "All wallets" }),
658
+ /* @__PURE__ */ t(c2, { asChild: !0, children: /* @__PURE__ */ t(
659
+ "button",
660
+ {
661
+ type: "button",
662
+ "aria-label": "Close",
663
+ className: "zd:cursor-pointer zd:px-2 zd:text-greyScale/60",
664
+ children: "✕"
665
+ }
666
+ ) })
667
+ ] }),
668
+ /* @__PURE__ */ t("div", { className: "zd:grid zd:grid-cols-3 zd:gap-3 zd:max-h-80 zd:overflow-y-auto", children: a.map((r) => /* @__PURE__ */ t(X2, { tile: r }, r.key)) })
669
+ ] }) });
670
+ }
671
+ function Y2({
672
+ title: e = "More wallets"
673
+ }) {
674
+ const { goToStep: n } = F(), { authPending: a, guardAgreement: r, setError: i } = _(), [o, s] = E(!1), c = Z(), { mutate: f, isPending: m } = G();
675
+ L(m);
676
+ const g = c.filter(
677
+ (d) => d.id !== "zerodev-wallet" && d.type !== "walletConnect"
678
+ ), w = (d) => {
679
+ a || r() && (s(!1), i(null), f(
680
+ { connector: d },
681
+ {
682
+ // The external wallet is now the active wagmi connection — the
683
+ // embedded-wallet flow is done, so close it.
684
+ onSuccess: () => n(null),
685
+ onError: (D) => {
686
+ I(D) || i(D instanceof Error ? D.message : String(D));
687
+ }
481
688
  }
482
- y(null);
483
- try {
484
- const { otpId: o, otpEncryptionTargetBundle: z } = await N({
485
- email: h
486
- });
487
- s(h), a({ otpId: o, otpEncryptionTargetBundle: z }), e("otp-input");
488
- } catch (o) {
489
- y(
490
- o instanceof Error ? o.message : "Failed to send verification code"
491
- );
689
+ ));
690
+ }, u = k.map((d) => {
691
+ const D = g.find((C) => H(C, d));
692
+ return {
693
+ key: d.id,
694
+ name: d.name,
695
+ icon: d.icon,
696
+ onSelect: () => {
697
+ if (D) {
698
+ w(D);
699
+ return;
700
+ }
701
+ s(!1), window.open(d.downloadUrl, "_blank", "noopener,noreferrer");
492
702
  }
493
- }
494
- } : async () => {
495
- if (!(!h || b) && j(h)) {
496
- if (L) {
497
- l(!0);
498
- return;
703
+ };
704
+ }), l = g.filter((d) => !k.some((D) => H(d, D))).map((d) => ({
705
+ key: d.uid,
706
+ name: d.name,
707
+ icon: d.icon,
708
+ onSelect: () => w(d)
709
+ }));
710
+ return /* @__PURE__ */ p(v, { children: [
711
+ /* @__PURE__ */ t(
712
+ T,
713
+ {
714
+ icon: /* @__PURE__ */ t($, { name: "walletOutline", className: "zd:w-5 zd:h-5" }),
715
+ title: e,
716
+ trailing: /* @__PURE__ */ t(P, {}),
717
+ disabled: a,
718
+ onClick: () => {
719
+ a || r() && s(!0);
720
+ }
499
721
  }
500
- y(null);
501
- try {
502
- const { otpId: o, otpEncryptionTargetBundle: z } = await v({
503
- email: h
504
- });
505
- s(h), a({ otpId: o, otpEncryptionTargetBundle: z }), e("email-verification");
506
- } catch (o) {
507
- y(
508
- o instanceof Error ? o.message : "Failed to send verification code"
509
- );
722
+ ),
723
+ /* @__PURE__ */ t(
724
+ J2,
725
+ {
726
+ open: o,
727
+ onOpenChange: s,
728
+ tiles: [...u, ...l]
510
729
  }
730
+ )
731
+ ] });
732
+ }
733
+ function n2() {
734
+ const { goToStep: e } = F(), { authPending: n, guardAgreement: a, setError: r } = _(), i = {
735
+ onSuccess: () => {
736
+ e("authenticated");
737
+ },
738
+ onError: (g) => {
739
+ I(g) || r(g instanceof Error ? g.message : String(g));
511
740
  }
741
+ }, { mutate: o, isPending: s } = F2({ mutation: i }), { mutate: c, isPending: f } = x2({
742
+ mutation: i
743
+ });
744
+ L(s || f);
745
+ const m = (g) => () => {
746
+ n || a() && (r(null), g());
512
747
  };
513
- return C ? /* @__PURE__ */ n("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full", children: /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:max-w-md", children: [
514
- /* @__PURE__ */ n(m, { className: "zd:text-h2 zd:text-center", children: "Error occurred" }),
515
- /* @__PURE__ */ n(m, { className: "zd:text-center zd:text-red-500", children: C }),
516
- /* @__PURE__ */ n(
517
- E,
748
+ return /* @__PURE__ */ p(v, { children: [
749
+ /* @__PURE__ */ t(
750
+ S,
518
751
  {
519
- action: "primary",
520
- text: "Try again",
521
- onClick: () => y(null)
752
+ action: "secondary",
753
+ text: "Create a passkey",
754
+ iconName: "key",
755
+ trailIcon: !0,
756
+ disabled: n,
757
+ onClick: m(() => o())
758
+ }
759
+ ),
760
+ /* @__PURE__ */ t(
761
+ S,
762
+ {
763
+ action: "secondary",
764
+ text: "Log in with passkey",
765
+ iconName: "key",
766
+ trailIcon: !0,
767
+ disabled: n,
768
+ onClick: m(() => c())
522
769
  }
523
770
  )
524
- ] }) }) : /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden", children: [
525
- /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-center", children: [
526
- /* @__PURE__ */ c("div", { className: "zd:px-4 zd:flex zd:flex-col zd:items-center", children: [
527
- /* @__PURE__ */ n("div", { className: "zd:w-full zd:px-16 zd:py-4", children: /* @__PURE__ */ n(je, { className: "zd:w-full zd:pointer-events-none zd:select-none" }) }),
528
- /* @__PURE__ */ n(m, { className: "zd:text-h2 zd:text-center", children: "Continue to your wallet" }),
529
- /* @__PURE__ */ n(m, { className: "zd:mt-2 zd:text-center zd:text-greyScale/50", children: "Choose a sign-in method to proceed" })
530
- ] }),
531
- /* @__PURE__ */ c("div", { className: "zd:mt-6 zd:flex zd:flex-col zd:gap-4 zd:mb-4", children: [
532
- r.includes("passkey") && /* @__PURE__ */ c(A, { children: [
533
- /* @__PURE__ */ c("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
534
- /* @__PURE__ */ n(
535
- E,
536
- {
537
- action: "secondary",
538
- text: "Create a passkey",
539
- iconName: "key",
540
- trailIcon: !0,
541
- disabled: b,
542
- onClick: Z
543
- }
544
- ),
545
- /* @__PURE__ */ n(
546
- E,
547
- {
548
- action: "secondary",
549
- text: "Log in with passkey",
550
- iconName: "key",
551
- trailIcon: !0,
552
- disabled: b,
553
- onClick: ee
554
- }
555
- )
556
- ] }),
557
- /* @__PURE__ */ c("div", { className: "zd:flex zd:items-center zd:gap-3", children: [
558
- /* @__PURE__ */ n("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" }),
559
- /* @__PURE__ */ n(m, { className: "zd:text-body3", children: "or" }),
560
- /* @__PURE__ */ n("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" })
561
- ] })
562
- ] }),
563
- /* @__PURE__ */ c("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
564
- r.includes("google") && /* @__PURE__ */ n(
565
- $,
566
- {
567
- icon: /* @__PURE__ */ n(D, { name: "google" }),
568
- title: "Google",
569
- trailing: /* @__PURE__ */ n(re, {}),
570
- className: "zd:rounded-3xl",
571
- disabled: b,
572
- onClick: te
771
+ ] });
772
+ }
773
+ function Q2({ walletId: e }) {
774
+ const n = k.find((h) => h.id === e);
775
+ if (!n)
776
+ throw new Error(
777
+ `Unknown walletId "${e}". Valid ids: ${k.map((h) => h.id).join(", ")}`
778
+ );
779
+ const { goToStep: a } = F(), { authPending: r, guardAgreement: i, setError: o, registerWallet: s } = _(), c = Z(), { mutate: f, isPending: m } = G();
780
+ L(m), g2(() => s(n.id), [s, n.id]);
781
+ const g = c.find((h) => H(h, n)), w = !!n.rdns && c.some((h) => h.id === n.rdns), u = {
782
+ title: n.name,
783
+ icon: /* @__PURE__ */ t("img", { src: n.icon, alt: "", className: "zd:w-6 zd:h-6" }),
784
+ trailing: /* @__PURE__ */ t(P, {})
785
+ };
786
+ return g ? /* @__PURE__ */ t(
787
+ T,
788
+ {
789
+ ...u,
790
+ ...w && { subtitle: /* @__PURE__ */ t(K, { text: "INSTALLED" }) },
791
+ disabled: r,
792
+ onClick: () => {
793
+ r || i() && (o(null), f(
794
+ { connector: g },
795
+ {
796
+ // The external wallet is now the active wagmi connection — the
797
+ // embedded-wallet flow is done, so close it (mirrors SignUp.MoreWallets).
798
+ onSuccess: () => a(null),
799
+ onError: (h) => {
800
+ I(h) || o(h instanceof Error ? h.message : String(h));
573
801
  }
574
- ),
575
- r.includes("email") && /* @__PURE__ */ n(
576
- se,
802
+ }
803
+ ));
804
+ }
805
+ }
806
+ ) : /* @__PURE__ */ t(T, { ...u, asChild: !0, children: /* @__PURE__ */ t(
807
+ "a",
808
+ {
809
+ href: n.downloadUrl,
810
+ target: "_blank",
811
+ rel: "noopener noreferrer"
812
+ }
813
+ ) });
814
+ }
815
+ function i2({
816
+ children: e,
817
+ termsAndConditionsUrl: n,
818
+ privacyPolicyUrl: a,
819
+ emailAuthMethod: r = "magicLink"
820
+ }) {
821
+ const [i, o] = E(!1), [s, c] = E(!1), [f, m] = E(null), [g, w] = E(!1), [u, l] = E(
822
+ []
823
+ ), h = D2((x) => (l((A) => [...A, x]), () => {
824
+ l((A) => {
825
+ const y = [...A];
826
+ return y.splice(y.indexOf(x), 1), y;
827
+ });
828
+ }), []), D = !!(n || a) && !i, C = () => D ? (c(!0), !1) : !0;
829
+ return /* @__PURE__ */ p(
830
+ Q.Provider,
831
+ {
832
+ value: {
833
+ authPending: g,
834
+ emailAuthMethod: r,
835
+ setAuthPending: w,
836
+ needsAgreement: D,
837
+ guardAgreement: C,
838
+ setError: m,
839
+ registeredWallets: u,
840
+ registerWallet: h
841
+ },
842
+ children: [
843
+ f !== null && /* @__PURE__ */ t("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full zd:min-h-100", children: /* @__PURE__ */ p("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:max-w-md", children: [
844
+ /* @__PURE__ */ t(z, { className: "zd:text-h2 zd:text-center", children: "Error occurred" }),
845
+ /* @__PURE__ */ t(z, { className: "zd:text-center zd:text-red-500", children: f }),
846
+ /* @__PURE__ */ t(
847
+ S,
577
848
  {
578
- iconName: "email",
579
- placeholder: "Enter your email",
580
- value: h,
581
- onChange: (o) => x(o.target.value),
582
- type: "email",
583
- autoCapitalize: "none",
584
- autoComplete: "email",
585
- disabled: b,
586
- variant: "listItemStyle",
587
- containerClassName: "zd:rounded-3xl",
588
- onKeyDown: (o) => {
589
- o.key === "Enter" && h && !b && W();
590
- },
591
- children: g ? /* @__PURE__ */ n("div", { className: "zd:w-13 zd:h-13 zd:flex zd:items-center zd:justify-center", children: /* @__PURE__ */ n("div", { className: "zd:w-5 zd:h-5 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin" }) }) : /* @__PURE__ */ n(
592
- "button",
593
- {
594
- type: "button",
595
- disabled: !j(h) || L,
596
- className: `zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${j(h) && !L ? "zd:cursor-pointer" : "zd:cursor-not-allowed zd:opacity-50"}`,
597
- onClick: () => W(),
598
- children: /* @__PURE__ */ n(ie, { name: "chevronRight", className: "zd:text-greyScale" })
599
- }
600
- )
849
+ action: "primary",
850
+ text: "Try again",
851
+ onClick: () => m(null)
601
852
  }
602
853
  )
603
- ] })
604
- ] })
605
- ] }),
606
- /* @__PURE__ */ n("div", { className: "zd:px-4", children: /* @__PURE__ */ n(
607
- Be,
608
- {
609
- termsAndConditionsUrl: t == null ? void 0 : t.termsAndConditionsUrl,
610
- privacyPolicyUrl: t == null ? void 0 : t.privacyPolicyUrl,
611
- agreedToTerms: d,
612
- setAgreedToTerms: (o) => {
613
- i(o), o && l(!1);
614
- },
615
- highlight: u
616
- }
617
- ) })
854
+ ] }) }),
855
+ /* @__PURE__ */ p(
856
+ "div",
857
+ {
858
+ className: `zd:-mx-4 zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden${f !== null ? " zd:hidden" : ""}`,
859
+ children: [
860
+ /* @__PURE__ */ p("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-center", children: [
861
+ /* @__PURE__ */ p("div", { className: "zd:px-4 zd:flex zd:flex-col zd:items-center", children: [
862
+ /* @__PURE__ */ t("div", { className: "zd:w-full zd:px-16 zd:py-4", children: /* @__PURE__ */ t(j2, { className: "zd:w-full zd:pointer-events-none zd:select-none" }) }),
863
+ /* @__PURE__ */ t(z, { className: "zd:text-h2 zd:text-center", children: "Continue to your wallet" }),
864
+ /* @__PURE__ */ t(z, { className: "zd:mt-2 zd:text-center zd:text-greyScale/50", children: "Choose a sign-in method to proceed" })
865
+ ] }),
866
+ /* @__PURE__ */ t("div", { className: "zd:mt-6 zd:mb-4 zd:px-4 zd:flex zd:flex-col zd:gap-2", children: e })
867
+ ] }),
868
+ /* @__PURE__ */ t("div", { className: "zd:px-4", children: /* @__PURE__ */ t(
869
+ V2,
870
+ {
871
+ termsAndConditionsUrl: n,
872
+ privacyPolicyUrl: a,
873
+ agreedToTerms: i,
874
+ setAgreedToTerms: (x) => {
875
+ o(x), x && c(!1);
876
+ },
877
+ highlight: s
878
+ }
879
+ ) })
880
+ ]
881
+ }
882
+ )
883
+ ]
884
+ }
885
+ );
886
+ }
887
+ function r2({ label: e = "or" }) {
888
+ return /* @__PURE__ */ p("div", { className: "zd:-mx-4 zd:my-2 zd:flex zd:items-center zd:gap-3", children: [
889
+ /* @__PURE__ */ t("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" }),
890
+ /* @__PURE__ */ t(z, { className: "zd:text-body3", children: e }),
891
+ /* @__PURE__ */ t("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" })
618
892
  ] });
619
893
  }
620
- function Fe() {
894
+ function ee(e) {
895
+ return /* @__PURE__ */ p(i2, { ...e, children: [
896
+ /* @__PURE__ */ t(n2, {}),
897
+ /* @__PURE__ */ t(r2, {}),
898
+ /* @__PURE__ */ t(t2, {}),
899
+ /* @__PURE__ */ t(e2, {})
900
+ ] });
901
+ }
902
+ const te = Object.assign(i2, {
903
+ Default: ee,
904
+ Passkey: n2,
905
+ Google: t2,
906
+ Email: e2,
907
+ Wallet: Q2,
908
+ InstalledWallets: K2,
909
+ MoreWallets: Y2,
910
+ Divider: r2
911
+ });
912
+ function ne() {
621
913
  return typeof window > "u" ? null : new URLSearchParams(window.location.search).get("code");
622
914
  }
623
- function _e() {
624
- const {
625
- otpId: e,
626
- otpEncryptionTargetBundle: s,
627
- goToStep: a,
628
- clearOtpSession: t,
629
- config: r
630
- } = R(), [d] = w(Fe), [i, u] = w(null), l = K(!1), { mutate: h, isPending: x } = fe({
915
+ function ie() {
916
+ const { otpId: e, otpEncryptionTargetBundle: n, goToStep: a, clearOtpSession: r } = F(), [i] = E(ne), [o, s] = E(null), c = X(!1), { mutate: f, isPending: m } = y2({
631
917
  mutation: {
632
- onSuccess: async () => {
633
- var f;
634
- t(), a("authenticated"), (f = r == null ? void 0 : r.onSuccess) == null || f.call(r);
918
+ onSuccess: () => {
919
+ r(), a("authenticated");
635
920
  },
636
- onError: (f) => {
637
- var N;
638
- u(f), (N = r == null ? void 0 : r.onError) == null || N.call(r, f);
921
+ onError: (g) => {
922
+ s(g);
639
923
  }
640
924
  }
641
925
  });
642
- return O(() => {
643
- if (!(l.current || !d)) {
644
- if (l.current = !0, !e || !s) {
645
- M(), a(null);
926
+ return N(() => {
927
+ if (!(c.current || !i)) {
928
+ if (c.current = !0, !e || !n) {
929
+ U(), a(null);
646
930
  return;
647
931
  }
648
- h({ otpId: e, code: d, otpEncryptionTargetBundle: s });
932
+ f({ otpId: e, code: i, otpEncryptionTargetBundle: n });
649
933
  }
650
- }, [e, s, d, h, a]), /* @__PURE__ */ c(A, { children: [
651
- /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
652
- !i && x && /* @__PURE__ */ n(P, { imageName: "loading", title: "Verifying Your Email", children: "Please wait while we securely connect your wallet." }),
653
- !i && !d && !x && /* @__PURE__ */ c(A, { children: [
654
- /* @__PURE__ */ c(P, { imageName: "error", title: "Invalid Link", children: [
934
+ }, [e, n, i, f, a]), /* @__PURE__ */ p(v, { children: [
935
+ /* @__PURE__ */ p("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
936
+ !o && m && /* @__PURE__ */ t(b, { imageName: "loading", title: "Verifying Your Email", children: "Please wait while we securely connect your wallet." }),
937
+ !o && !i && !m && /* @__PURE__ */ p(v, { children: [
938
+ /* @__PURE__ */ p(b, { imageName: "error", title: "Invalid Link", children: [
655
939
  "This verification link is invalid or incomplete.",
656
- /* @__PURE__ */ n("br", {}),
940
+ /* @__PURE__ */ t("br", {}),
657
941
  "Please check your email and try again with the correct link."
658
942
  ] }),
659
- /* @__PURE__ */ n(
660
- E,
943
+ /* @__PURE__ */ t(
944
+ S,
661
945
  {
662
946
  action: "primary",
663
947
  onClick: () => {
664
- M(), a("sign-up");
948
+ U(), a("sign-up");
665
949
  },
666
950
  text: "Choose another sign-in method"
667
951
  }
668
952
  )
669
953
  ] }),
670
- i != null && /* @__PURE__ */ c(A, { children: [
671
- /* @__PURE__ */ n(P, { imageName: "error", title: "Oops, something went wrong", children: "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request." }),
672
- /* @__PURE__ */ n(
673
- E,
954
+ o != null && /* @__PURE__ */ p(v, { children: [
955
+ /* @__PURE__ */ t(b, { imageName: "error", title: "Oops, something went wrong", children: "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request." }),
956
+ /* @__PURE__ */ t(
957
+ S,
674
958
  {
675
959
  action: "primary",
676
960
  onClick: () => {
677
- M(), a("sign-up");
961
+ U(), a("sign-up");
678
962
  },
679
963
  text: "Choose another sign-in method"
680
964
  }
681
965
  )
682
966
  ] })
683
967
  ] }),
684
- /* @__PURE__ */ n(B, { className: "zd:self-center zd:pt-4 zd:pb-6" })
685
- ] });
686
- }
687
- function qe() {
688
- const { goToStep: e } = R(), { connect: s, connectors: a, isPending: t } = ue(), r = a.filter((i) => i.id !== "zerodev-wallet"), d = (i) => {
689
- s(
690
- { connector: i },
691
- {
692
- onSuccess: () => {
693
- e(null);
694
- }
695
- }
696
- );
697
- };
698
- return /* @__PURE__ */ c(A, { children: [
699
- /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
700
- /* @__PURE__ */ n(m, { className: "zd:text-h2 zd:text-center", children: "Select your wallet" }),
701
- /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-col zd:gap-2", children: r.length === 0 ? /* @__PURE__ */ n(m, { className: "zd:text-center", children: "No wallets detected. Install a browser wallet extension to continue." }) : r.map((i) => /* @__PURE__ */ n(
702
- $,
703
- {
704
- title: i.name,
705
- icon: i.icon ? /* @__PURE__ */ n(
706
- "img",
707
- {
708
- src: i.icon,
709
- alt: "",
710
- className: "zd:w-6 zd:h-6"
711
- }
712
- ) : /* @__PURE__ */ n(D, { name: "walletOutline" }),
713
- disabled: t,
714
- onClick: () => d(i),
715
- className: "zd:rounded-3xl"
716
- },
717
- i.uid
718
- )) })
719
- ] }),
720
- /* @__PURE__ */ n(B, { className: "zd:self-center zd:pt-4 zd:pb-6" })
968
+ /* @__PURE__ */ t(O, { className: "zd:self-center zd:pt-4 zd:pb-6" })
721
969
  ] });
722
970
  }
723
- const We = {
724
- "wallet-selection": "Choose your wallet"
725
- };
726
- function Ve() {
727
- return /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ n(P, { imageName: "loading", title: "Authenticating...", children: "Please wait while we complete the OAuth authentication." }) });
971
+ function re() {
972
+ return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(b, { imageName: "loading", title: "Authenticating...", children: "Please wait while we complete the OAuth authentication." }) });
728
973
  }
729
- function Ge() {
730
- return /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ n(P, { imageName: "loading", title: "Passkey authentication", children: "Please authenticate with your passkey." }) });
974
+ function ae() {
975
+ return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(b, { imageName: "loading", title: "Passkey authentication", children: "Please authenticate with your passkey." }) });
731
976
  }
732
- function $e(e) {
977
+ function oe(e, n) {
733
978
  switch (e) {
734
979
  case "sign-up":
735
- return /* @__PURE__ */ n(He, {});
980
+ return n ? n() : /* @__PURE__ */ t(te.Default, {});
736
981
  case "email-verification":
737
- return /* @__PURE__ */ n(Ee, {});
982
+ return /* @__PURE__ */ t(U2, {});
738
983
  case "otp-input":
739
- return /* @__PURE__ */ n(Oe, {});
984
+ return /* @__PURE__ */ t(G2, {});
740
985
  case "verifying-otp":
741
- return /* @__PURE__ */ n(_e, {});
986
+ return /* @__PURE__ */ t(ie, {});
742
987
  case "oauth-in-progress":
743
- return /* @__PURE__ */ n(Ve, {});
988
+ return /* @__PURE__ */ t(re, {});
744
989
  case "passkey-prompt":
745
- return /* @__PURE__ */ n(Ge, {});
746
- case "wallet-selection":
747
- return /* @__PURE__ */ n(qe, {});
990
+ return /* @__PURE__ */ t(ae, {});
748
991
  case "error":
749
- return /* @__PURE__ */ n(Te, {});
992
+ return /* @__PURE__ */ t(O2, {});
750
993
  default:
751
994
  return null;
752
995
  }
753
996
  }
754
- function lt({
997
+ function Ce({
755
998
  onClose: e,
756
- size: s
999
+ size: n,
1000
+ renderSignUp: a,
1001
+ logo: r
757
1002
  } = {}) {
758
- const { step: a, goToStep: t, goBack: r, reset: d } = R(), i = I(X(), (x) => x.logo);
759
- O(() => {
760
- a === null && ke() && t("verifying-otp");
761
- }, [a, t]);
762
- const u = $e(a);
763
- if (!u) return null;
764
- const l = () => {
765
- M(), d(), e == null || e();
766
- }, h = a ? We[a] : void 0;
767
- return /* @__PURE__ */ n(
768
- ae,
1003
+ const { step: i, goToStep: o, goBack: s, reset: c } = F();
1004
+ N(() => {
1005
+ i === null && T2() && o("verifying-otp");
1006
+ }, [i, o]);
1007
+ const f = oe(i, a);
1008
+ return f ? /* @__PURE__ */ t(
1009
+ u2,
769
1010
  {
770
- ...s && { size: s },
771
- contentClassName: a === "sign-up" ? "zd:px-0" : void 0,
772
- topNav: /* @__PURE__ */ n(
773
- oe,
1011
+ ...n && { size: n },
1012
+ className: i === "sign-up" ? "zd:h-auto zd:max-h-202.5" : void 0,
1013
+ topNav: /* @__PURE__ */ t(
1014
+ p2,
774
1015
  {
775
- ...r !== null && { onLeftButtonClick: r },
776
- onRightButtonClick: l,
777
- ...h && { title: h },
778
- ...a === "sign-up" && {
779
- ...i && { logo: i },
1016
+ ...s !== null && { onLeftButtonClick: s },
1017
+ onRightButtonClick: () => {
1018
+ U(), c(), e == null || e();
1019
+ },
1020
+ ...i === "sign-up" && {
1021
+ ...r && { logo: r },
780
1022
  className: "zd:px-4"
781
1023
  }
782
1024
  }
783
1025
  ),
784
- children: u
1026
+ children: f
785
1027
  }
786
- );
1028
+ ) : null;
787
1029
  }
788
- const q = "zerodev:auth:otpSession";
789
- function De() {
1030
+ const V = "zerodev:auth:otpSession";
1031
+ function se() {
790
1032
  if (typeof window > "u") return null;
791
1033
  try {
792
- const e = window.localStorage.getItem(q);
1034
+ const e = window.localStorage.getItem(V);
793
1035
  if (!e) return null;
794
- const s = JSON.parse(e);
795
- return !(s != null && s.otpId) || !(s != null && s.otpEncryptionTargetBundle) ? null : s;
1036
+ const n = JSON.parse(e);
1037
+ return !(n != null && n.otpId) || !(n != null && n.otpEncryptionTargetBundle) ? null : n;
796
1038
  } catch {
797
1039
  return null;
798
1040
  }
799
1041
  }
800
- function Ke(e) {
1042
+ function le(e) {
801
1043
  if (!(typeof window > "u"))
802
1044
  try {
803
1045
  window.localStorage.setItem(
804
- q,
1046
+ V,
805
1047
  JSON.stringify(e)
806
1048
  );
807
1049
  } catch {
808
1050
  }
809
1051
  }
810
- function V() {
1052
+ function W() {
811
1053
  if (!(typeof window > "u"))
812
1054
  try {
813
- window.localStorage.removeItem(q);
1055
+ window.localStorage.removeItem(V);
814
1056
  } catch {
815
1057
  }
816
1058
  }
817
- const Ye = (e, s, a) => ({
1059
+ const de = (e, n, a) => ({
818
1060
  auth: {
819
1061
  // Initial state
820
1062
  step: null,
821
1063
  stepHistory: [],
822
- enabledMethods: [],
823
1064
  email: null,
824
1065
  otpId: null,
825
1066
  otpEncryptionTargetBundle: null,
826
- config: null,
827
1067
  // Actions
828
- initialize: (t) => {
829
- const r = De();
830
- e((d) => ({
1068
+ initialize: () => {
1069
+ const r = se();
1070
+ r && e((i) => ({
831
1071
  auth: {
832
- ...d.auth,
833
- config: t,
834
- enabledMethods: t.enabledMethods,
835
- ...r && {
836
- otpId: r.otpId,
837
- otpEncryptionTargetBundle: r.otpEncryptionTargetBundle
838
- }
1072
+ ...i.auth,
1073
+ otpId: r.otpId,
1074
+ otpEncryptionTargetBundle: r.otpEncryptionTargetBundle
839
1075
  }
840
1076
  }));
841
1077
  },
842
- goToStep: (t) => {
843
- e((r) => ({
1078
+ goToStep: (r) => {
1079
+ e((i) => ({
844
1080
  auth: {
845
- ...r.auth,
846
- step: t,
847
- stepHistory: r.auth.step === null ? r.auth.stepHistory : [...r.auth.stepHistory, r.auth.step]
1081
+ ...i.auth,
1082
+ step: r,
1083
+ stepHistory: i.auth.step === null ? i.auth.stepHistory : [...i.auth.stepHistory, i.auth.step]
848
1084
  }
849
1085
  }));
850
1086
  },
851
1087
  goBack: () => {
852
- const { auth: t } = s();
853
- if (t.stepHistory.length === 0) return;
854
- const r = [...t.stepHistory], d = r.pop();
855
- e((i) => ({
1088
+ const { auth: r } = n();
1089
+ if (r.stepHistory.length === 0) return;
1090
+ const i = [...r.stepHistory], o = i.pop();
1091
+ e((s) => ({
856
1092
  auth: {
857
- ...i.auth,
858
- step: d,
859
- stepHistory: r
1093
+ ...s.auth,
1094
+ step: o,
1095
+ stepHistory: i
860
1096
  }
861
1097
  }));
862
1098
  },
863
1099
  reset: () => {
864
- V(), e((t) => ({
1100
+ W(), e((r) => ({
865
1101
  auth: {
866
- ...t.auth,
1102
+ ...r.auth,
867
1103
  step: null,
868
1104
  stepHistory: [],
869
1105
  email: null,
@@ -872,85 +1108,82 @@ const Ye = (e, s, a) => ({
872
1108
  }
873
1109
  }));
874
1110
  },
875
- setEmail: (t) => {
876
- e((r) => ({
1111
+ setEmail: (r) => {
1112
+ e((i) => ({
877
1113
  auth: {
878
- ...r.auth,
879
- email: t
1114
+ ...i.auth,
1115
+ email: r
880
1116
  }
881
1117
  }));
882
1118
  },
883
- setOtpSession: ({ otpId: t, otpEncryptionTargetBundle: r }) => {
884
- Ke({ otpId: t, otpEncryptionTargetBundle: r }), e((d) => ({
1119
+ setOtpSession: ({ otpId: r, otpEncryptionTargetBundle: i }) => {
1120
+ le({ otpId: r, otpEncryptionTargetBundle: i }), e((o) => ({
885
1121
  auth: {
886
- ...d.auth,
887
- otpId: t,
888
- otpEncryptionTargetBundle: r
1122
+ ...o.auth,
1123
+ otpId: r,
1124
+ otpEncryptionTargetBundle: i
889
1125
  }
890
1126
  }));
891
1127
  },
892
1128
  clearOtpSession: () => {
893
- V(), e((t) => ({
1129
+ W(), e((r) => ({
894
1130
  auth: {
895
- ...t.auth,
1131
+ ...r.auth,
896
1132
  otpId: null,
897
1133
  otpEncryptionTargetBundle: null
898
1134
  }
899
1135
  }));
900
1136
  }
901
1137
  }
902
- }), Je = (e = {}) => de()(
903
- xe((s, a, t) => ({
1138
+ }), ce = () => z2()(
1139
+ A2((e, n, a) => ({
904
1140
  pendingRequests: [],
905
1141
  userConfirmationListenerActive: !1,
906
- logo: e.logo ?? null,
907
- addPendingRequest: (r) => s((d) => ({
908
- pendingRequests: [...d.pendingRequests, r]
1142
+ addPendingRequest: (r) => e((i) => ({
1143
+ pendingRequests: [...i.pendingRequests, r]
909
1144
  })),
910
- removePendingRequest: (r) => s((d) => ({
911
- pendingRequests: d.pendingRequests.filter((i) => i.id !== r)
1145
+ removePendingRequest: (r) => e((i) => ({
1146
+ pendingRequests: i.pendingRequests.filter((o) => o.id !== r)
912
1147
  })),
913
- clearPendingRequests: () => s({ pendingRequests: [] }),
914
- setUserConfirmationListenerActive: (r) => s({ userConfirmationListenerActive: r }),
915
- ...Ye(s, a)
1148
+ clearPendingRequests: () => e({ pendingRequests: [] }),
1149
+ setUserConfirmationListenerActive: (r) => e({ userConfirmationListenerActive: r }),
1150
+ ...de(e, n)
916
1151
  }))
917
1152
  );
918
- function Xe(e) {
919
- return new Promise((s, a) => {
920
- const t = e.subscribe(
921
- (r) => r.auth.step,
922
- (r) => {
923
- r === "authenticated" ? (t(), s()) : r === null && (t(), a(new Error("Auth flow dismissed")));
1153
+ function ue(e) {
1154
+ return new Promise((n, a) => {
1155
+ const r = e.subscribe(
1156
+ (i) => i.auth.step,
1157
+ (i) => {
1158
+ i === "authenticated" ? (r(), n()) : i === null && (r(), a(new Error("Auth flow dismissed")));
924
1159
  }
925
1160
  );
926
1161
  });
927
1162
  }
928
- function dt(e) {
929
- var t, r;
930
- const s = ge(e), a = Je({ logo: (t = e.config) == null ? void 0 : t.logo });
931
- return (r = e.config) != null && r.auth && a.getState().auth.initialize(e.config.auth), (d) => {
932
- const i = s(d);
1163
+ function Ee(e) {
1164
+ const n = v2(e), a = ce();
1165
+ return (r) => {
1166
+ const i = n(r);
933
1167
  return {
934
1168
  ...i,
935
- async connect(u) {
936
- var l;
1169
+ async connect(o) {
937
1170
  try {
938
- return await i.connect(u);
939
- } catch (h) {
940
- if (u != null && u.isReconnecting || !((l = e.config) != null && l.auth) || !(h instanceof ye))
941
- throw h;
1171
+ return await i.connect(o);
1172
+ } catch (s) {
1173
+ if (o != null && o.isReconnecting || !(s instanceof S2))
1174
+ throw s;
942
1175
  if (a.getState().auth.step !== null)
943
1176
  throw new Error("Auth flow already in progress");
944
- return a.getState().auth.goToStep("sign-up"), await Xe(a), i.connect(u);
1177
+ return a.getState().auth.goToStep("sign-up"), await ue(a), i.connect(o);
945
1178
  }
946
1179
  },
947
1180
  async disconnect() {
948
- var u, l;
949
- await ((u = i.disconnect) == null ? void 0 : u.call(i)), (l = e.config) != null && l.auth && a.getState().auth.reset();
1181
+ var o;
1182
+ await ((o = i.disconnect) == null ? void 0 : o.call(i)), a.getState().auth.reset();
950
1183
  },
951
1184
  async setup() {
952
- var u;
953
- await ((u = i.setup) == null ? void 0 : u.call(i)), typeof window > "u";
1185
+ var o;
1186
+ await ((o = i.setup) == null ? void 0 : o.call(i)), !(typeof window > "u") && a.getState().auth.initialize();
954
1187
  },
955
1188
  getKitStore() {
956
1189
  return a;
@@ -959,8 +1192,9 @@ function dt(e) {
959
1192
  };
960
1193
  }
961
1194
  export {
962
- lt as AuthFlow,
963
- R as useAuth,
964
- dt as zeroDevWallet
1195
+ Ce as ConnectWallet,
1196
+ te as SignUp,
1197
+ F as useAuth,
1198
+ Ee as zeroDevWallet
965
1199
  };
966
1200
  //# sourceMappingURL=index.mjs.map