@zerodev/wallet-react-ui 0.0.11 → 0.0.12

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 (52) hide show
  1. package/README.md +38 -7
  2. package/dist/_types/auth/brandAssets.d.ts +2 -0
  3. package/dist/_types/auth/brandAssets.d.ts.map +1 -0
  4. package/dist/_types/auth/components/WalletSheet/index.d.ts +20 -0
  5. package/dist/_types/auth/components/WalletSheet/index.d.ts.map +1 -0
  6. package/dist/_types/auth/hooks/useWalletConnectPairing.d.ts +19 -0
  7. package/dist/_types/auth/hooks/useWalletConnectPairing.d.ts.map +1 -0
  8. package/dist/_types/auth/hooks/useWalletInfo.d.ts +32 -0
  9. package/dist/_types/auth/hooks/useWalletInfo.d.ts.map +1 -0
  10. package/dist/_types/auth/pages/SignUp/MoreWallets.d.ts.map +1 -1
  11. package/dist/_types/auth/pages/SignUp/Wallet.d.ts.map +1 -1
  12. package/dist/_types/auth/pages/SignUp/WalletConnect.d.ts +5 -0
  13. package/dist/_types/auth/pages/SignUp/WalletConnect.d.ts.map +1 -0
  14. package/dist/_types/auth/pages/SignUp/context.d.ts +4 -0
  15. package/dist/_types/auth/pages/SignUp/context.d.ts.map +1 -1
  16. package/dist/_types/auth/pages/SignUp/index.d.ts +2 -0
  17. package/dist/_types/auth/pages/SignUp/index.d.ts.map +1 -1
  18. package/dist/_types/auth/utils/isMobile.d.ts +2 -0
  19. package/dist/_types/auth/utils/isMobile.d.ts.map +1 -0
  20. package/dist/_types/auth/utils/isZeroDevWalletConnect.d.ts +6 -0
  21. package/dist/_types/auth/utils/isZeroDevWalletConnect.d.ts.map +1 -0
  22. package/dist/_types/auth/utils/walletDeepLink.d.ts +18 -0
  23. package/dist/_types/auth/utils/walletDeepLink.d.ts.map +1 -0
  24. package/dist/_types/auth/walletGuide.d.ts +21 -3
  25. package/dist/_types/auth/walletGuide.d.ts.map +1 -1
  26. package/dist/_types/index.d.ts +3 -0
  27. package/dist/_types/index.d.ts.map +1 -1
  28. package/dist/_types/zeroDevWalletConnect.d.ts +13 -0
  29. package/dist/_types/zeroDevWalletConnect.d.ts.map +1 -0
  30. package/dist/index.cjs +3 -3
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.mjs +1009 -659
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/styles.css +1 -1
  35. package/package.json +6 -5
  36. package/src/assets.d.ts +5 -0
  37. package/src/auth/brandAssets.ts +5 -0
  38. package/src/auth/components/WalletSheet/index.tsx +220 -0
  39. package/src/auth/hooks/useWalletConnectPairing.ts +134 -0
  40. package/src/auth/hooks/useWalletInfo.ts +145 -0
  41. package/src/auth/pages/SignUp/InstalledWallets.tsx +1 -1
  42. package/src/auth/pages/SignUp/MoreWallets.tsx +44 -9
  43. package/src/auth/pages/SignUp/Wallet.tsx +43 -13
  44. package/src/auth/pages/SignUp/WalletConnect.tsx +32 -0
  45. package/src/auth/pages/SignUp/context.tsx +4 -0
  46. package/src/auth/pages/SignUp/index.tsx +31 -0
  47. package/src/auth/utils/isMobile.ts +9 -0
  48. package/src/auth/utils/isZeroDevWalletConnect.ts +8 -0
  49. package/src/auth/utils/walletDeepLink.ts +23 -0
  50. package/src/auth/walletGuide.ts +42 -8
  51. package/src/index.ts +7 -2
  52. package/src/zeroDevWalletConnect.ts +95 -0
package/dist/index.mjs CHANGED
@@ -1,59 +1,60 @@
1
- import { jsxs as c, jsx as t, Fragment as x } from "react/jsx-runtime";
2
- import { Text as D, cn as B, PoweredBy as H, Button as S, Wrapper as e2, Input as f2, Icon as Z, ListItem as M, ListItemChevron as V, ListItemIcon as t2, Badge as n2, BottomSheet as m2, BottomSheetContent as g2, BottomSheetTitle as z2, BottomSheetClose as D2, Screen as i2, TopNav as a2 } from "@zerodev/react-ui";
3
- import { useState as C, useEffect as U, useMemo as w2, useRef as r2, createContext as C2, useContext as E2, useLayoutEffect as F2, useCallback as x2, Fragment as y2 } from "react";
4
- import { useStore as O, create as v2 } from "zustand";
5
- import { useConfig as S2, useConnectors as $, useConnect as q } from "wagmi";
6
- import { useSendMagicLink as s2, useSendOTP as l2, useVerifyOTP as b2, useAuthenticateOAuth as A2, useRegisterPasskey as N2, useLoginPasskey as k2, useVerifyMagicLink as U2, zeroDevWallet as T2, NotAuthenticatedError as _2 } from "@zerodev/wallet-react";
7
- import { subscribeWithSelector as L2 } from "zustand/middleware";
8
- const O2 = "" + new URL("error.webp", import.meta.url).href, I2 = "" + new URL("loading.webp", import.meta.url).href, M2 = "" + new URL("send.webp", import.meta.url).href, H2 = "" + new URL("success.webp", import.meta.url).href, P2 = {
9
- error: O2,
10
- loading: I2,
11
- send: M2,
12
- success: H2
1
+ import { jsxs as c, jsx as n, Fragment as b } from "react/jsx-runtime";
2
+ import { Text as w, cn as q, PoweredBy as Z, Button as A, Wrapper as c2, BottomSheet as u2, BottomSheetContent as f2, BottomSheetTitle as p2, BottomSheetClose as m2, QrCode as N2, Input as U2, Icon as K, ListItem as T, ListItemChevron as G, ListItemIcon as h2, Badge as X, Screen as g2, TopNav as z2 } from "@zerodev/react-ui";
3
+ import { useState as E, useEffect as N, useMemo as $, useRef as e2, createContext as I2, useContext as T2, useLayoutEffect as L2, useCallback as O2, Fragment as M2 } from "react";
4
+ import { useStore as W, create as B2 } from "zustand";
5
+ import { useConfig as H2, useConnectors as H, useConnect as V, useConnections as R2, useAccount as D2 } from "wagmi";
6
+ import { useSendMagicLink as C2, useSendOTP as w2, useVerifyOTP as P2, useAuthenticateOAuth as W2, useRegisterPasskey as _2, useLoginPasskey as Z2, useVerifyMagicLink as G2, zeroDevWallet as V2, NotAuthenticatedError as j2 } from "@zerodev/wallet-react";
7
+ import { subscribeWithSelector as q2 } from "zustand/middleware";
8
+ import { walletConnect as K2 } from "wagmi/connectors";
9
+ const J2 = "" + new URL("error.webp", import.meta.url).href, Q2 = "" + new URL("loading.webp", import.meta.url).href, Y2 = "" + new URL("send.webp", import.meta.url).href, X2 = "" + new URL("success.webp", import.meta.url).href, $2 = {
10
+ error: J2,
11
+ loading: Q2,
12
+ send: Y2,
13
+ success: X2
13
14
  };
14
- function N({
15
+ function L({
15
16
  imageName: e,
16
- title: n,
17
+ title: t,
17
18
  children: r,
18
- className: a
19
+ className: i
19
20
  }) {
20
21
  return /* @__PURE__ */ c(
21
22
  "div",
22
23
  {
23
- className: B("zd:flex zd:flex-col zd:gap-8 zd:items-center", a),
24
+ className: q("zd:flex zd:flex-col zd:gap-8 zd:items-center", i),
24
25
  children: [
25
- /* @__PURE__ */ t(
26
+ /* @__PURE__ */ n(
26
27
  "img",
27
28
  {
28
- src: P2[e],
29
+ src: $2[e],
29
30
  alt: e,
30
31
  className: "zd:w-[118px] zd:h-[118px] zd:bg-transparent"
31
32
  }
32
33
  ),
33
34
  /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:items-center", children: [
34
- /* @__PURE__ */ t(D, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children: n }),
35
- /* @__PURE__ */ t(D, { className: "zd:text-center zd:whitespace-pre-wrap", children: r })
35
+ /* @__PURE__ */ n(w, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children: t }),
36
+ /* @__PURE__ */ n(w, { className: "zd:text-center zd:whitespace-pre-wrap", children: r })
36
37
  ] })
37
38
  ]
38
39
  }
39
40
  );
40
41
  }
41
- function R2() {
42
- const n = S2().connectors.find((r) => r.id === "zerodev-wallet");
43
- if (!n || !("getKitStore" in n))
42
+ function ee() {
43
+ const t = H2().connectors.find((r) => r.id === "zerodev-wallet");
44
+ if (!t || !("getKitStore" in t))
44
45
  throw new Error("useKitStore must be used with the zeroDevWallet connector");
45
- return n.getKitStore();
46
+ return t.getKitStore();
46
47
  }
47
- function F() {
48
- const e = R2(), n = O(e, (l) => l.auth.step), r = O(e, (l) => l.auth.stepHistory), a = O(e, (l) => l.auth.email), i = O(e, (l) => l.auth.otpId), s = O(
48
+ function S() {
49
+ const e = ee(), t = W(e, (s) => s.auth.step), r = W(e, (s) => s.auth.stepHistory), i = W(e, (s) => s.auth.email), o = W(e, (s) => s.auth.otpId), a = W(
49
50
  e,
50
- (l) => l.auth.otpEncryptionTargetBundle
51
+ (s) => s.auth.otpEncryptionTargetBundle
51
52
  );
52
53
  return {
53
- step: n,
54
- email: a,
55
- otpId: i,
56
- otpEncryptionTargetBundle: s,
54
+ step: t,
55
+ email: i,
56
+ otpId: o,
57
+ otpEncryptionTargetBundle: a,
57
58
  goToStep: e.getState().auth.goToStep,
58
59
  goBack: r.length > 0 ? e.getState().auth.goBack : null,
59
60
  reset: e.getState().auth.reset,
@@ -62,20 +63,20 @@ function F() {
62
63
  clearOtpSession: e.getState().auth.clearOtpSession
63
64
  };
64
65
  }
65
- function B2() {
66
- const { email: e, setOtpSession: n } = F(), { mutateAsync: r, isPending: a } = s2(), [i, s] = C(60), l = i <= 0 && !a;
67
- return U(() => {
68
- if (i <= 0) return;
69
- const p = setInterval(() => {
70
- s((m) => Math.max(0, m - 1));
66
+ function te() {
67
+ const { email: e, setOtpSession: t } = S(), { mutateAsync: r, isPending: i } = C2(), [o, a] = E(60), s = o <= 0 && !i;
68
+ return N(() => {
69
+ if (o <= 0) return;
70
+ const u = setInterval(() => {
71
+ a((g) => Math.max(0, g - 1));
71
72
  }, 1e3);
72
73
  return () => {
73
- clearInterval(p);
74
+ clearInterval(u);
74
75
  };
75
- }, [i]), /* @__PURE__ */ c(x, { children: [
76
+ }, [o]), /* @__PURE__ */ c(b, { children: [
76
77
  /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
77
78
  /* @__PURE__ */ c(
78
- N,
79
+ L,
79
80
  {
80
81
  imageName: "send",
81
82
  title: `Check your email!
@@ -83,121 +84,121 @@ function B2() {
83
84
  children: [
84
85
  "We've sent a magic link to",
85
86
  " ",
86
- /* @__PURE__ */ t(D, { as: "span", className: "zd:text-solarOrange", children: e }),
87
+ /* @__PURE__ */ n(w, { as: "span", className: "zd:text-solarOrange", children: e }),
87
88
  `
88
89
  `,
89
90
  "Please open the email and click the link to log in."
90
91
  ]
91
92
  }
92
93
  ),
93
- /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(D, { className: "zd:text-center", children: [
94
+ /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(w, { className: "zd:text-center", children: [
94
95
  "Did not get an email?",
95
96
  " ",
96
- /* @__PURE__ */ t(
97
+ /* @__PURE__ */ n(
97
98
  "button",
98
99
  {
99
100
  type: "button",
100
- disabled: !l,
101
+ disabled: !s,
101
102
  onClick: async () => {
102
- if (!(!e || !l))
103
+ if (!(!e || !s))
103
104
  try {
104
- const { otpId: p, otpEncryptionTargetBundle: m } = await r({
105
+ const { otpId: u, otpEncryptionTargetBundle: g } = await r({
105
106
  email: e
106
107
  });
107
- n({ otpId: p, otpEncryptionTargetBundle: m }), s(60);
108
+ t({ otpId: u, otpEncryptionTargetBundle: g }), a(60);
108
109
  } catch {
109
110
  }
110
111
  },
111
112
  className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
112
- children: l ? "Resend" : `Resend in ${i} ${i === 1 ? "second" : "seconds"}`
113
+ children: s ? "Resend" : `Resend in ${o} ${o === 1 ? "second" : "seconds"}`
113
114
  }
114
115
  )
115
116
  ] }) })
116
117
  ] }),
117
- /* @__PURE__ */ t(H, { className: "zd:self-center zd:pt-4 zd:pb-6" })
118
+ /* @__PURE__ */ n(Z, { className: "zd:self-center zd:pt-4 zd:pb-6" })
118
119
  ] });
119
120
  }
120
- function Z2() {
121
+ function ne() {
121
122
  return typeof window > "u" ? !1 : new URLSearchParams(window.location.search).has("code");
122
123
  }
123
- function I() {
124
+ function _() {
124
125
  if (typeof window > "u") return;
125
126
  const e = new URL(window.location.href);
126
127
  e.searchParams.has("code") && (e.searchParams.delete("code"), window.history.replaceState(null, "", e.toString()));
127
128
  }
128
- function G2({
129
+ function ie({
129
130
  title: e = "Oops, something went wrong",
130
- message: n = "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",
131
+ message: t = "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",
131
132
  showRetry: r = !1,
132
- showChooseAnother: a = !0
133
+ showChooseAnother: i = !0
133
134
  }) {
134
- const { goToStep: i, goBack: s, reset: l } = F();
135
- return /* @__PURE__ */ c(x, { children: [
135
+ const { goToStep: o, goBack: a, reset: s } = S();
136
+ return /* @__PURE__ */ c(b, { children: [
136
137
  /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
137
- /* @__PURE__ */ t(N, { imageName: "error", title: e, children: n }),
138
+ /* @__PURE__ */ n(L, { imageName: "error", title: e, children: t }),
138
139
  /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-1", children: [
139
- r && /* @__PURE__ */ t(S, { action: "primary", text: "Try again", onClick: s ?? (() => i("sign-up")) }),
140
- a && /* @__PURE__ */ t(
141
- S,
140
+ r && /* @__PURE__ */ n(A, { action: "primary", text: "Try again", onClick: a ?? (() => o("sign-up")) }),
141
+ i && /* @__PURE__ */ n(
142
+ A,
142
143
  {
143
144
  action: r ? "secondary" : "primary",
144
145
  onClick: () => {
145
- I(), i("sign-up");
146
+ _(), o("sign-up");
146
147
  },
147
148
  text: "Choose another sign-in method"
148
149
  }
149
150
  ),
150
- !r && !a && /* @__PURE__ */ t(S, { action: "primary", text: "Start over", onClick: l })
151
+ !r && !i && /* @__PURE__ */ n(A, { action: "primary", text: "Start over", onClick: s })
151
152
  ] })
152
153
  ] }),
153
- /* @__PURE__ */ t(H, { className: "zd:self-center zd:pt-4 zd:pb-6" })
154
+ /* @__PURE__ */ n(Z, { className: "zd:self-center zd:pt-4 zd:pb-6" })
154
155
  ] });
155
156
  }
156
- const V2 = 4, W2 = 8, j2 = 6;
157
- function $2(e) {
158
- return Math.max(V2, Math.min(W2, e));
157
+ const re = 4, oe = 8, ae = 6;
158
+ function se(e) {
159
+ return Math.max(re, Math.min(oe, e));
159
160
  }
160
- function q2({ char: e, isFocused: n }) {
161
- return /* @__PURE__ */ t(
162
- e2,
161
+ function le({ char: e, isFocused: t }) {
162
+ return /* @__PURE__ */ n(
163
+ c2,
163
164
  {
164
165
  "data-testid": "code-input-box",
165
- "data-active": n || void 0,
166
- className: B(
166
+ "data-active": t || void 0,
167
+ className: q(
167
168
  "zd:h-16 zd:w-14 zd:rounded-lg zd:flex zd:items-center zd:justify-center",
168
- n && "zd:border-[1.5px] zd:border-greyScale"
169
+ t && "zd:border-[1.5px] zd:border-greyScale"
169
170
  ),
170
- children: /* @__PURE__ */ t(D, { className: "zd:text-h2", children: e })
171
+ children: /* @__PURE__ */ n(w, { className: "zd:text-h2", children: e })
171
172
  }
172
173
  );
173
174
  }
174
- function K2({
175
+ function de({
175
176
  onChange: e,
176
- onComplete: n,
177
+ onComplete: t,
177
178
  disabled: r = !1,
178
- error: a = !1,
179
- autoFocus: i = !1,
180
- length: s = j2,
181
- "data-testid": l
179
+ error: i = !1,
180
+ autoFocus: o = !1,
181
+ length: a = ae,
182
+ "data-testid": s
182
183
  }) {
183
- const o = $2(s), p = w2(
184
- () => Array.from({ length: o }, (u, z) => ({
185
- id: `char-${z}`,
186
- index: z
184
+ const l = se(a), u = $(
185
+ () => Array.from({ length: l }, (f, C) => ({
186
+ id: `char-${C}`,
187
+ index: C
187
188
  })),
188
- [o]
189
- ), [m, g] = C(""), [E, h] = C(!1), d = r2(null);
190
- U(() => {
191
- var u;
192
- i && !r && ((u = d.current) == null || u.focus());
193
- }, [i, r]), U(() => {
194
- g((u) => u.slice(0, o));
195
- }, [o]);
196
- const f = (u) => {
197
- const z = u.slice(0, o).toUpperCase();
198
- g(z), e == null || e(z), z.length === o && setTimeout(() => {
199
- var w;
200
- n == null || n(z), (w = d.current) == null || w.blur();
189
+ [l]
190
+ ), [g, z] = E(""), [F, p] = E(!1), d = e2(null);
191
+ N(() => {
192
+ var f;
193
+ o && !r && ((f = d.current) == null || f.focus());
194
+ }, [o, r]), N(() => {
195
+ z((f) => f.slice(0, l));
196
+ }, [l]);
197
+ const D = (f) => {
198
+ const C = f.slice(0, l).toUpperCase();
199
+ z(C), e == null || e(C), C.length === l && setTimeout(() => {
200
+ var x;
201
+ t == null || t(C), (x = d.current) == null || x.blur();
201
202
  }, 0);
202
203
  };
203
204
  return /* @__PURE__ */ c(
@@ -206,155 +207,155 @@ function K2({
206
207
  type: "button",
207
208
  className: "zd:flex zd:flex-row zd:items-center zd:justify-between zd:gap-2 zd:w-full zd:cursor-text",
208
209
  onClick: () => {
209
- var u;
210
- return (u = d.current) == null ? void 0 : u.focus();
210
+ var f;
211
+ return (f = d.current) == null ? void 0 : f.focus();
211
212
  },
212
213
  disabled: r,
213
- "data-testid": l,
214
+ "data-testid": s,
214
215
  children: [
215
- /* @__PURE__ */ t(
216
+ /* @__PURE__ */ n(
216
217
  "input",
217
218
  {
218
219
  ref: d,
219
- value: m,
220
- onChange: (u) => f(u.target.value),
221
- onFocus: () => h(!0),
222
- onBlur: () => h(!1),
223
- maxLength: o,
220
+ value: g,
221
+ onChange: (f) => D(f.target.value),
222
+ onFocus: () => p(!0),
223
+ onBlur: () => p(!1),
224
+ maxLength: l,
224
225
  disabled: r,
225
226
  className: "zd:absolute zd:opacity-0 zd:pointer-events-none",
226
227
  style: { position: "absolute", opacity: 0 },
227
228
  "aria-label": "Verification code"
228
229
  }
229
230
  ),
230
- p.map((u) => /* @__PURE__ */ t(
231
- q2,
231
+ u.map((f) => /* @__PURE__ */ n(
232
+ le,
232
233
  {
233
- char: m[u.index] ?? "",
234
- isFocused: !a && E && u.index === m.length
234
+ char: g[f.index] ?? "",
235
+ isFocused: !i && F && f.index === g.length
235
236
  },
236
- u.id
237
+ f.id
237
238
  ))
238
239
  ]
239
240
  }
240
241
  );
241
242
  }
242
- function Y2() {
243
+ function ce() {
243
244
  const {
244
245
  email: e,
245
- otpId: n,
246
+ otpId: t,
246
247
  otpEncryptionTargetBundle: r,
247
- setOtpSession: a,
248
- clearOtpSession: i,
249
- goToStep: s
250
- } = F(), { mutateAsync: l, isPending: o } = l2(), { mutateAsync: p, isPending: m } = b2(), [g, E] = C(""), [h, d] = C(!1), [f, u] = C(60);
251
- U(() => {
252
- if (f <= 0) return;
248
+ setOtpSession: i,
249
+ clearOtpSession: o,
250
+ goToStep: a
251
+ } = S(), { mutateAsync: s, isPending: l } = w2(), { mutateAsync: u, isPending: g } = P2(), [z, F] = E(""), [p, d] = E(!1), [D, f] = E(60);
252
+ N(() => {
253
+ if (D <= 0) return;
253
254
  const v = setInterval(() => {
254
- u((W) => Math.max(0, W - 1));
255
+ f((y) => Math.max(0, y - 1));
255
256
  }, 1e3);
256
257
  return () => clearInterval(v);
257
- }, [f]);
258
- const z = async () => {
259
- if (!(!g.trim() || !n || !r)) {
258
+ }, [D]);
259
+ const C = async () => {
260
+ if (!(!z.trim() || !t || !r)) {
260
261
  d(!1);
261
262
  try {
262
- await p({
263
- otpId: n,
264
- code: g.trim(),
263
+ await u({
264
+ otpId: t,
265
+ code: z.trim(),
265
266
  otpEncryptionTargetBundle: r
266
- }), i(), s("authenticated");
267
+ }), o(), a("authenticated");
267
268
  } catch {
268
269
  d(!0);
269
270
  }
270
271
  }
271
- }, w = (v) => {
272
- E(v);
273
- }, y = async () => {
274
- if (!(!e || f > 0 || o))
272
+ }, x = (v) => {
273
+ F(v);
274
+ }, m = async () => {
275
+ if (!(!e || D > 0 || l))
275
276
  try {
276
- const { otpId: v, otpEncryptionTargetBundle: W } = await l({ email: e });
277
- a({
277
+ const { otpId: v, otpEncryptionTargetBundle: y } = await s({ email: e });
278
+ i({
278
279
  otpId: v,
279
- otpEncryptionTargetBundle: W
280
- }), u(60), d(!1);
280
+ otpEncryptionTargetBundle: y
281
+ }), f(60), d(!1);
281
282
  } catch {
282
283
  d(!0);
283
284
  }
284
- }, b = f <= 0 && !o;
285
- return /* @__PURE__ */ c(x, { children: [
285
+ }, h = D <= 0 && !l;
286
+ return /* @__PURE__ */ c(b, { children: [
286
287
  /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center", children: [
287
288
  /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4", children: [
288
- /* @__PURE__ */ t(D, { className: "zd:text-h2 zd:text-center", children: "Enter verification code" }),
289
- /* @__PURE__ */ c(D, { className: "zd:text-center", children: [
289
+ /* @__PURE__ */ n(w, { className: "zd:text-h2 zd:text-center", children: "Enter verification code" }),
290
+ /* @__PURE__ */ c(w, { className: "zd:text-center", children: [
290
291
  "Enter the code from the email we sent to",
291
292
  " ",
292
- /* @__PURE__ */ t(D, { className: "zd:text-solarOrange", children: e })
293
+ /* @__PURE__ */ n(w, { className: "zd:text-solarOrange", children: e })
293
294
  ] })
294
295
  ] }),
295
- /* @__PURE__ */ t(
296
- K2,
296
+ /* @__PURE__ */ n(
297
+ de,
297
298
  {
298
- onComplete: w,
299
+ onComplete: x,
299
300
  onChange: () => d(!1),
300
- disabled: m,
301
- error: h,
301
+ disabled: g,
302
+ error: p,
302
303
  autoFocus: !0
303
304
  }
304
305
  ),
305
- /* @__PURE__ */ t(
306
- S,
306
+ /* @__PURE__ */ n(
307
+ A,
307
308
  {
308
309
  text: "Confirm code",
309
- onClick: z,
310
- disabled: !g.trim() || m
310
+ onClick: C,
311
+ disabled: !z.trim() || g
311
312
  }
312
313
  ),
313
- /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(D, { className: "zd:text-center", children: [
314
+ /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(w, { className: "zd:text-center", children: [
314
315
  "Did not get an email?",
315
316
  " ",
316
- /* @__PURE__ */ t(
317
+ /* @__PURE__ */ n(
317
318
  "button",
318
319
  {
319
320
  type: "button",
320
- disabled: !b,
321
- onClick: y,
321
+ disabled: !h,
322
+ onClick: m,
322
323
  className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
323
- children: b ? "Resend" : `Resend in ${f} ${f === 1 ? "second" : "seconds"}`
324
+ children: h ? "Resend" : `Resend in ${D} ${D === 1 ? "second" : "seconds"}`
324
325
  }
325
326
  )
326
327
  ] }) })
327
328
  ] }),
328
- /* @__PURE__ */ t(H, { className: "zd:self-center zd:pt-4 zd:pb-6" })
329
+ /* @__PURE__ */ n(Z, { className: "zd:self-center zd:pt-4 zd:pb-6" })
329
330
  ] });
330
331
  }
331
- function J2({
332
+ function ue({
332
333
  termsAndConditionsUrl: e,
333
- privacyPolicyUrl: n,
334
+ privacyPolicyUrl: t,
334
335
  agreedToTerms: r,
335
- setAgreedToTerms: a,
336
- highlight: i = !1
336
+ setAgreedToTerms: i,
337
+ highlight: o = !1
337
338
  }) {
338
339
  return /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-5", children: [
339
- !!(e || n) && /* @__PURE__ */ c(
340
+ !!(e || t) && /* @__PURE__ */ c(
340
341
  "div",
341
342
  {
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"}`,
343
+ className: `zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${o ? "zd:border zd:border-negative" : "zd:border zd:border-transparent"}`,
343
344
  children: [
344
- /* @__PURE__ */ t(
345
+ /* @__PURE__ */ n(
345
346
  "input",
346
347
  {
347
348
  type: "checkbox",
348
349
  checked: r,
349
- onChange: (l) => a(l.target.checked),
350
+ onChange: (s) => i(s.target.checked),
350
351
  className: "zd:cursor-pointer zd:[color-scheme:light]"
351
352
  }
352
353
  ),
353
- /* @__PURE__ */ c(D, { className: "zd:flex-1", children: [
354
+ /* @__PURE__ */ c(w, { className: "zd:flex-1", children: [
354
355
  "I agree to the",
355
356
  " ",
356
- e && /* @__PURE__ */ t(
357
- D,
357
+ e && /* @__PURE__ */ n(
358
+ w,
358
359
  {
359
360
  as: "a",
360
361
  href: e,
@@ -364,12 +365,12 @@ function J2({
364
365
  children: "Terms & Conditions"
365
366
  }
366
367
  ),
367
- e && n && " and ",
368
- n && /* @__PURE__ */ t(
369
- D,
368
+ e && t && " and ",
369
+ t && /* @__PURE__ */ n(
370
+ w,
370
371
  {
371
372
  as: "a",
372
- href: n,
373
+ href: t,
373
374
  target: "_blank",
374
375
  rel: "noopener noreferrer",
375
376
  className: "zd:underline",
@@ -380,17 +381,17 @@ function J2({
380
381
  ]
381
382
  }
382
383
  ),
383
- /* @__PURE__ */ t(H, {})
384
+ /* @__PURE__ */ n(Z, {})
384
385
  ] });
385
386
  }
386
- const X2 = "" + new URL("blob.webm", import.meta.url).href;
387
- function Q2({ className: e }) {
388
- return /* @__PURE__ */ t(
387
+ const fe = "" + new URL("blob.webm", import.meta.url).href;
388
+ function pe({ className: e }) {
389
+ return /* @__PURE__ */ n(
389
390
  "video",
390
391
  {
391
392
  className: e,
392
393
  style: { aspectRatio: "1 / 1" },
393
- src: X2,
394
+ src: fe,
394
395
  autoPlay: !0,
395
396
  loop: !0,
396
397
  muted: !0,
@@ -400,108 +401,17 @@ function Q2({ className: e }) {
400
401
  }
401
402
  );
402
403
  }
403
- const o2 = C2(null);
404
- function T() {
405
- const e = E2(o2);
406
- if (!e)
407
- throw new Error("SignUp.* components must be rendered inside <SignUp>");
408
- return e;
409
- }
410
- function L(e) {
411
- const { setAuthPending: n } = T();
412
- U(() => (n(e), () => n(!1)), [e, n]);
413
- }
414
- const ee = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
415
- function j(e) {
416
- return ee.test(e.trim());
417
- }
418
- function d2() {
419
- const { goToStep: e, setEmail: n, setOtpSession: r } = F(), {
420
- authPending: a,
421
- emailAuthMethod: i,
422
- needsAgreement: s,
423
- guardAgreement: l,
424
- setError: o
425
- } = T(), [p, m] = C(""), g = i === "otp", { mutateAsync: E, isPending: h } = l2(), { mutateAsync: d, isPending: f } = s2(), u = h || f;
426
- L(u);
427
- const z = async () => {
428
- if (!(!p || a) && j(p) && l()) {
429
- o(null);
430
- try {
431
- const w = g ? E : d, { otpId: y, otpEncryptionTargetBundle: b } = await w({
432
- email: p
433
- });
434
- n(p), r({ otpId: y, otpEncryptionTargetBundle: b }), e(g ? "otp-input" : "email-verification");
435
- } catch (w) {
436
- o(
437
- w instanceof Error ? w.message : "Failed to send verification code"
438
- );
439
- }
440
- }
441
- };
442
- return /* @__PURE__ */ t(
443
- f2,
444
- {
445
- iconName: "email",
446
- placeholder: "Enter your email",
447
- value: p,
448
- onChange: (w) => m(w.target.value),
449
- type: "email",
450
- autoCapitalize: "none",
451
- autoComplete: "email",
452
- disabled: a,
453
- variant: "listItemStyle",
454
- onKeyDown: (w) => {
455
- w.key === "Enter" && p && !a && z();
456
- },
457
- children: u ? /* @__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: !j(p) || s,
462
- className: `zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${j(p) && !s ? "zd:cursor-pointer" : "zd:cursor-not-allowed zd:opacity-50"}`,
463
- onClick: () => z(),
464
- children: /* @__PURE__ */ t(Z, { name: "chevronRight", className: "zd:text-greyScale" })
465
- }
466
- )
467
- }
468
- );
469
- }
470
- function P(e) {
404
+ const me = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20width='24'%20height='24'%20fill='url(%23pattern0_19361_9946)'/%3e%3cdefs%3e%3cpattern%20id='pattern0_19361_9946'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_19361_9946'%20transform='scale(0.0136986)'/%3e%3c/pattern%3e%3cimage%20id='image0_19361_9946'%20width='73'%20height='73'%20preserveAspectRatio='none'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAABJCAYAAABxcwvcAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgpSURBVHgB5Zx/bFNVFMfPbWc2NJD9BAckjmSDDs1WEwSNvzqVxGCCDP/ABJUZTUQJv4wGogkwEg38xQ9jookJW9QE/hhs+8N/AFeDkoAkPIyuA6aUBEgJYw4WZcDayzl3feV1e3197/a+0rWfpGn7+nr73rfnnHvuue8+Blmm7nG/nwMEIBZ7DIDVMAA/bcdtNcb9cHsYtw2BeHANPJ6LuFHr/1MLQpZh4DI1Nf7SokegBWL8dfw1P6pRCpkTBA/rKopCZ1+fFgaXcUWkJGHIatwlyDys/e5/0BkOa0PgAkpFEuI8HFuPzW5QZDG2GXNP3lnEPXtUW5cykWrnN2x9EOKMR4jFeFt/7x+toIiMRap9wh9gUb5vfOB90JBYGLdaz/+ltUGGSIskXGtKbMx6chjGoO3u/2xjJvFKSiSfz18zyvghiHffuQ5ZlZezJtlY5QGHkHuNevhpmCQCERQK8E89PdfnXwUSeJ3sPNfXsIpz6MSXJTD5KOEMlpVPnwGD167+4uSLtkWq9TVs5YzthkkPCzgVypZIwoLyQiAdZ0KlFYliUNzF8gwWqKysDl8fiJxJu6fVh9SLRRnvybUcSCFDOKRpwlxKs9rJsnfLc4GIUhxfHqKcz2qnlCLV1jfsynOBBHSORVP4Pqt9TN2N4hBEeQ8UEBxY898hzTT2mloSjcWgwGDA96Vyuwki1dU3rC8ENzMByzxgOg5NcrcC6M3SMTR6i80ZPxhOsqRRiK0qYIEIU2tKsqS6+sYL2RJp2rSpsPCpBbAIH9OmToVZs2aKbcTNm8Nwc3gYQn1nxePk76fEtiwxwZoSIuEsRguPuRuwSYTly5bCKy81waKFCxx998TJU3Cws1s8XIex1v5ebVvirf6itr6RuvwAuMTaNauh5e2VCWuR5fLlK9CBQn319TfgGjR11XvmyftvIVFEuwAuQBaz84vtwp1UQmJt+nyLsDBX8LImfY5PBO6o1x0LanlnJfzQ9p1ygQhqk9omC3WF2H1NRBWgvHLGLlAcsOngP/14PbgNWSq58LFfj4NqBgeuttOzcLfa+Y3/qpwKIoHW2fiHyVWO/Nwjni9fuZLoweik633zxMNukD94qFu4n0qwlyujXo7V+nCcxtSN0+bjiXUdPGC5D/VQezHwUlyxA7kWiU49oxVL31gBodBZUIU+nvOI+XmF9GJek6rnuYSiLF2+AjZ9tsW2QIQI0vidwOIlog0z6DdVCkSweAjyllU9+ia+eRoUcgKTP/Jjo5scOdoD732wxpE44xnGBLP9+x9h9syZUF8/L7GdBNrrQkrAGIsMXot0eSuqZmwCF7Jso1DkXhs+2Qy3b98BFVAc09t2SyAB/gjWwb9lGLRPo/O5Noe2+OUmOHzUndIUBXYatrgFTWqeD52Z42GSvRr1QJSnBA//BLMt8iC7AlEb1Fa69oxYCaS3142diGyWr49jGQ5HODhEF4j+SYLizIfrNkoHztnxxFBPOqm9t1reTxmknbZHYlJ7MoNkSgMcT3OPF4jQs19jMLXL+BMytmfXoozQcXV1HEhqj7bJtldSAqWORVr70eokgXSo3OFUKDOBdGSE0sUwcy/6THYI41gk6qlSma0ToawE0nEilJVAOjIdyMgIDHnExU4OSOffdoSyI5COHaHSCUTHSsd8REIkGpY4tiTCjlDdGBfMhhFOBNKxinl2BZIsqYjqpAe7Ng0ksNNj7Pxye5JQ+gnJlE7MhKK2rbp4XSDpXIqNeRkOS6qfkR2WDAxcFyWK5597NuWBUjKpD0XoJKuqKlO2txnHZ4cxm6bvmFFcXAyvLXkVjv12HF7A36Q/IRUZCyRgJwYHIvsxT/Lj7ADfBRlgJ27QQVsFVRKoI16/JpF2YDVTNglUIxAkat0eTCul3M2IneTPyiWMAhHUC8kmf6LSQCUTBcMVHtfGM1qCLxhkfCW9TJas/+MdJjMgMlnypfgxZFJpMPKQLlJYw/klBdZEOBHKjks4EUq1QDRjol+tG08BWBcowo5QTmKGHaGUCwTkaixxqaAQqUjx5X5WQskEVdqX4oxZe24IRDDvfU2ESHGzCoJCzITST0gmqFq1p1wgTLSN6+oMGbc6l9MxnlgmAlm1p1ogAicA9hjfJ6a5a/z+0qI7OIvr0iojSgFUXfRgvLDCDYo4m2NcYpG4RHkoEhkpr6iegrIFwAVU1bf1tlS2ZwSL/23nQlq7cVvy9UklsFtFzjSZ8cZgwjq5JJFEzhRL9sdCgqzIbCXThFIJWZPTGlM+IJZ7mVgRMUEksiZMpN6FQoOz1lTr4UzXlmB5IIwllDLVM7u5CrnZ+ZDWmurzlJXJaDFsKwS3s3IznZQiiSDuYc1539vhOaZbdmq5lGvwWiRSUVF9FYVaBvnIWFFtf7rd0q53w/iklVdWM7eSzAfGuCtsrbC1chKFCuaVUA4EImyvwc0boRwKRDhazU1CVVRWX8RwH4BJuaKbbewPaTvAIdI3T5hMC3XE/UswQe7vk7v3kiNL0hkYiAxNr6zu4oyVQc7fRIEFsfTRfK5Pk67jS1mSkTqfvwUY35pzVkX5HQ410L0yXqovZUlGKEUgq4oBu5ErQZ0qi9FbrPmffjW3NsvYkoyMxSrYxoFL3RMkI9BysOvtpCFGzt5kyogQi1Y8ZcMNya2wBjY6Arsnxe3KzKC7AcZi0MIYvIiTWUqCPFpMOAbQxXAqTLbHcvZ7WUTcmKoEe8OxPKtRTDownvqOgWJwzcJ4kFqMww3cEozegqBbFpOKrIqUDnJTeqZL8LIthBX3AMO5NwaXDfWSAAAAAElFTkSuQmCC'/%3e%3c/defs%3e%3c/svg%3e", t2 = me;
405
+ function R(e) {
471
406
  return e instanceof Error ? e.name === "AbortError" || e.name === "NotAllowedError" || e.name === "UserRejectedRequestError" ? !0 : e.message.toLowerCase().includes("oauth popup was closed") : !1;
472
407
  }
473
- function c2() {
474
- const { goToStep: e } = F(), { authPending: n, guardAgreement: r, setError: a } = T(), { mutateAsync: i, isPending: s } = A2({
475
- mutation: {
476
- onSuccess: () => {
477
- e("authenticated");
478
- }
479
- }
480
- });
481
- return L(s), /* @__PURE__ */ t(
482
- M,
483
- {
484
- icon: /* @__PURE__ */ t(t2, { name: "google" }),
485
- title: "Google",
486
- trailing: /* @__PURE__ */ t(V, {}),
487
- disabled: n,
488
- onClick: async () => {
489
- if (!n && r()) {
490
- a(null);
491
- try {
492
- await i({ provider: "google" });
493
- } catch (o) {
494
- P(o) || a(o instanceof Error ? o.message : String(o));
495
- }
496
- }
497
- }
498
- }
499
- );
408
+ function n2(e, t) {
409
+ return t.rdns && e.id === t.rdns ? !0 : !!t.rdns && e.type === "injected" && e.id !== "injected" && e.id !== "zerodev-wallet" && e.name === t.name;
500
410
  }
501
- function G(e, n) {
502
- return !!n.rdns && (e.id === n.rdns || (Array.isArray(e.rdns) ? e.rdns.includes(n.rdns) : e.rdns === n.rdns));
411
+ function O(e, t) {
412
+ return n2(e, t) ? !0 : !!t.rdns && (Array.isArray(e.rdns) ? e.rdns.includes(t.rdns) : e.rdns === t.rdns);
503
413
  }
504
- const te = [
414
+ const he = [
505
415
  {
506
416
  id: "metamask",
507
417
  name: "MetaMask",
@@ -538,6 +448,7 @@ const te = [
538
448
  name: "Rabby Wallet",
539
449
  rdns: "io.rabby",
540
450
  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",
451
+ mobileLink: "rabby://wc?uri=",
541
452
  downloadUrl: "https://rabby.io"
542
453
  },
543
454
  {
@@ -579,54 +490,325 @@ const te = [
579
490
  mobileLink: "bnc://app.binance.com/cedefi/wc?uri=",
580
491
  downloadUrl: "https://www.binance.com/en/download"
581
492
  }
582
- ], k = te;
583
- function ne({
493
+ ], k = he;
494
+ function ge({
495
+ open: e,
496
+ onOpenChange: t,
497
+ wallet: r,
498
+ pairing: i
499
+ }) {
500
+ return /* @__PURE__ */ n(u2, { open: e, onOpenChange: t, children: /* @__PURE__ */ c(f2, { className: "zd:p-4", children: [
501
+ /* @__PURE__ */ n(p2, { children: r ? `Connect ${r.name}` : "WalletConnect" }),
502
+ /* @__PURE__ */ n(ze, { wallet: r, pairing: i })
503
+ ] }) });
504
+ }
505
+ function ze({
506
+ wallet: e,
507
+ pairing: t
508
+ }) {
509
+ const { goToStep: r } = S(), { uri: i, error: o, retry: a } = t, s = H(), { connect: l } = V(), u = e ? s.find((h) => O(h, e)) : void 0, [g, z] = E(
510
+ u ? "browser" : "mobile"
511
+ ), [F, p] = E(null), [d, D] = E(!1), f = i && (e != null && e.mobileLink) ? `${e.mobileLink}${encodeURIComponent(i)}` : i, C = async () => {
512
+ if (i)
513
+ try {
514
+ await navigator.clipboard.writeText(i), D(!0), setTimeout(() => D(!1), 2e3);
515
+ } catch {
516
+ }
517
+ }, x = () => {
518
+ u && (p(null), l(
519
+ { connector: u },
520
+ {
521
+ onSuccess: () => r(null),
522
+ onError: (h) => {
523
+ R(h) || p(h instanceof Error ? h.message : String(h));
524
+ }
525
+ }
526
+ ));
527
+ }, m = o ?? F;
528
+ return /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-3", children: [
529
+ /* @__PURE__ */ c("div", { className: "zd:flex zd:w-full zd:items-center zd:gap-2", children: [
530
+ /* @__PURE__ */ n(
531
+ "img",
532
+ {
533
+ src: e ? e.icon : t2,
534
+ alt: "",
535
+ className: "zd:w-8 zd:h-8 zd:rounded-xl"
536
+ }
537
+ ),
538
+ /* @__PURE__ */ n(w, { className: "zd:text-h3 zd:flex-1", children: e ? e.name : "WalletConnect" }),
539
+ /* @__PURE__ */ n(m2, { asChild: !0, children: /* @__PURE__ */ n(
540
+ "button",
541
+ {
542
+ type: "button",
543
+ "aria-label": "Close",
544
+ className: "zd:cursor-pointer zd:px-2 zd:text-greyScale/60",
545
+ children: "✕"
546
+ }
547
+ ) })
548
+ ] }),
549
+ e && /* @__PURE__ */ n("div", { className: "zd:flex zd:w-full zd:gap-2", children: ["mobile", "browser"].map((h) => /* @__PURE__ */ n(
550
+ "button",
551
+ {
552
+ type: "button",
553
+ onClick: () => z(h),
554
+ className: `zd:flex-1 zd:rounded-2xl zd:py-1.5 zd:text-body3 zd:cursor-pointer ${g === h ? "zd:bg-greyScale/10 zd:font-semibold" : "zd:text-greyScale/60"}`,
555
+ children: h === "mobile" ? "Mobile" : "Browser"
556
+ },
557
+ h
558
+ )) }),
559
+ !e || g === "mobile" ? m ? /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-2 zd:items-center", children: [
560
+ /* @__PURE__ */ n(w, { className: "zd:text-center zd:text-red-500", children: m }),
561
+ /* @__PURE__ */ n(A, { action: "secondary", text: "Try again", onClick: a })
562
+ ] }) : /* @__PURE__ */ c(b, { children: [
563
+ /* @__PURE__ */ n("div", { className: "zd:bg-white zd:rounded-2xl zd:p-2 zd:border zd:border-greyScale/10", children: f ? /* @__PURE__ */ n(N2, { value: f, size: 176 }) : /* @__PURE__ */ n("div", { className: "zd:w-[176px] zd:h-[176px] zd:flex zd:items-center zd:justify-center", children: /* @__PURE__ */ n("div", { className: "zd:w-8 zd:h-8 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin" }) }) }),
564
+ f && (e == null ? void 0 : e.mobileLink) && /* @__PURE__ */ c(
565
+ "a",
566
+ {
567
+ href: f,
568
+ className: "zd:w-full zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",
569
+ children: [
570
+ "Open in ",
571
+ e.name
572
+ ]
573
+ }
574
+ ),
575
+ /* @__PURE__ */ n(
576
+ A,
577
+ {
578
+ action: "secondary",
579
+ text: d ? "Copied" : "Copy link",
580
+ onClick: C,
581
+ disabled: !f
582
+ }
583
+ )
584
+ ] }) : m ? /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-2 zd:items-center", children: [
585
+ /* @__PURE__ */ n(w, { className: "zd:text-center zd:text-red-500", children: m }),
586
+ /* @__PURE__ */ n(
587
+ A,
588
+ {
589
+ action: "secondary",
590
+ text: "Try again",
591
+ onClick: u ? x : a
592
+ }
593
+ )
594
+ ] }) : u && e ? /* @__PURE__ */ c(
595
+ "button",
596
+ {
597
+ type: "button",
598
+ onClick: x,
599
+ className: "zd:w-full zd:cursor-pointer zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",
600
+ children: [
601
+ "Open in ",
602
+ e.name
603
+ ]
604
+ }
605
+ ) : e && /* @__PURE__ */ c(
606
+ "a",
607
+ {
608
+ href: e.downloadUrl,
609
+ target: "_blank",
610
+ rel: "noopener noreferrer",
611
+ className: "zd:w-full zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",
612
+ children: [
613
+ "Get ",
614
+ e.name
615
+ ]
616
+ }
617
+ )
618
+ ] });
619
+ }
620
+ function x2() {
621
+ var e, t;
622
+ return typeof window > "u" ? !1 : ((t = (e = window.matchMedia) == null ? void 0 : e.call(window, "(pointer: coarse)")) == null ? void 0 : t.matches) || /Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(
623
+ navigator.userAgent
624
+ );
625
+ }
626
+ function J(e) {
627
+ return e.type === "walletConnect" && "zdWalletConnect" in e;
628
+ }
629
+ function De(e) {
630
+ const { wallet: t, connectors: r, uri: i, mobile: o } = e;
631
+ return !t.mobileLink || !o || !i || r.some((a) => O(a, t)) ? null : `${t.mobileLink}${encodeURIComponent(i)}`;
632
+ }
633
+ function Ce() {
634
+ const { goToStep: e } = S(), t = H(), r = t.find(J), { connect: i } = V(), a = R2().some(
635
+ (d) => d.connector.uid === (r == null ? void 0 : r.uid)
636
+ ), { isReconnecting: s } = D2(), [l, u] = E(null), [g, z] = E(null), F = e2(!1), p = (d) => {
637
+ z(null), u(null), i({ connector: d }, { onError: (D) => z(D.message) });
638
+ };
639
+ return N(() => {
640
+ if (!r || a) return;
641
+ const d = ({ type: m, data: h }) => {
642
+ m === "display_uri" && typeof h == "string" && u(h);
643
+ };
644
+ r.emitter.on("message", d);
645
+ const D = () => z("Proposal expired"), f = () => e(null);
646
+ let C, x = !1;
647
+ return r.getProvider().then((m) => {
648
+ var h, v, y;
649
+ x || (C = m, (y = (v = (h = C.signer) == null ? void 0 : h.client) == null ? void 0 : v.events) == null || y.on("proposal_expire", D), C.on("connect", f));
650
+ }).catch((m) => {
651
+ x || z(m instanceof Error ? m.message : String(m));
652
+ }), !F.current && !s && (F.current = !0, p(r)), () => {
653
+ var m, h, v;
654
+ x = !0, (v = (h = (m = C == null ? void 0 : C.signer) == null ? void 0 : m.client) == null ? void 0 : h.events) == null || v.off("proposal_expire", D), C == null || C.off("connect", f), r.emitter.off("message", d);
655
+ };
656
+ }, [r, a, s]), {
657
+ uri: l,
658
+ error: g,
659
+ retry: () => {
660
+ r && p(r);
661
+ },
662
+ deepLinkFor: (d) => De({
663
+ wallet: d,
664
+ connectors: t,
665
+ uri: g ? null : l,
666
+ mobile: x2()
667
+ })
668
+ };
669
+ }
670
+ const E2 = I2(null);
671
+ function U() {
672
+ const e = T2(E2);
673
+ if (!e)
674
+ throw new Error("SignUp.* components must be rendered inside <SignUp>");
675
+ return e;
676
+ }
677
+ function P(e) {
678
+ const { setAuthPending: t } = U();
679
+ N(() => (t(e), () => t(!1)), [e, t]);
680
+ }
681
+ const we = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
682
+ function Y(e) {
683
+ return we.test(e.trim());
684
+ }
685
+ function F2() {
686
+ const { goToStep: e, setEmail: t, setOtpSession: r } = S(), {
687
+ authPending: i,
688
+ emailAuthMethod: o,
689
+ needsAgreement: a,
690
+ guardAgreement: s,
691
+ setError: l
692
+ } = U(), [u, g] = E(""), z = o === "otp", { mutateAsync: F, isPending: p } = w2(), { mutateAsync: d, isPending: D } = C2(), f = p || D;
693
+ P(f);
694
+ const C = async () => {
695
+ if (!(!u || i) && Y(u) && s()) {
696
+ l(null);
697
+ try {
698
+ const x = z ? F : d, { otpId: m, otpEncryptionTargetBundle: h } = await x({
699
+ email: u
700
+ });
701
+ t(u), r({ otpId: m, otpEncryptionTargetBundle: h }), e(z ? "otp-input" : "email-verification");
702
+ } catch (x) {
703
+ l(
704
+ x instanceof Error ? x.message : "Failed to send verification code"
705
+ );
706
+ }
707
+ }
708
+ };
709
+ return /* @__PURE__ */ n(
710
+ U2,
711
+ {
712
+ iconName: "email",
713
+ placeholder: "Enter your email",
714
+ value: u,
715
+ onChange: (x) => g(x.target.value),
716
+ type: "email",
717
+ autoCapitalize: "none",
718
+ autoComplete: "email",
719
+ disabled: i,
720
+ variant: "listItemStyle",
721
+ onKeyDown: (x) => {
722
+ x.key === "Enter" && u && !i && C();
723
+ },
724
+ children: f ? /* @__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(
725
+ "button",
726
+ {
727
+ type: "button",
728
+ disabled: !Y(u) || a,
729
+ className: `zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${Y(u) && !a ? "zd:cursor-pointer" : "zd:cursor-not-allowed zd:opacity-50"}`,
730
+ onClick: () => C(),
731
+ children: /* @__PURE__ */ n(K, { name: "chevronRight", className: "zd:text-greyScale" })
732
+ }
733
+ )
734
+ }
735
+ );
736
+ }
737
+ function y2() {
738
+ const { goToStep: e } = S(), { authPending: t, guardAgreement: r, setError: i } = U(), { mutateAsync: o, isPending: a } = W2({
739
+ mutation: {
740
+ onSuccess: () => {
741
+ e("authenticated");
742
+ }
743
+ }
744
+ });
745
+ return P(a), /* @__PURE__ */ n(
746
+ T,
747
+ {
748
+ icon: /* @__PURE__ */ n(h2, { name: "google" }),
749
+ title: "Google",
750
+ trailing: /* @__PURE__ */ n(G, {}),
751
+ disabled: t,
752
+ onClick: async () => {
753
+ if (!t && r()) {
754
+ i(null);
755
+ try {
756
+ await o({ provider: "google" });
757
+ } catch (l) {
758
+ R(l) || i(l instanceof Error ? l.message : String(l));
759
+ }
760
+ }
761
+ }
762
+ }
763
+ );
764
+ }
765
+ function xe({
584
766
  excludeWalletIds: e = [],
585
- maxWallets: n = 4
767
+ maxWallets: t = 4
586
768
  }) {
587
- const { goToStep: r } = F(), { authPending: a, guardAgreement: i, setError: s, registeredWallets: l } = T(), o = $(), { mutate: p, isPending: m } = q();
588
- L(m);
589
- const g = o.filter(
590
- (h) => h.type === "injected" && h.id !== "injected" && h.id !== "zerodev-wallet"
591
- ).map((h) => {
592
- const d = k.find((f) => G(h, f));
769
+ const { goToStep: r } = S(), { authPending: i, guardAgreement: o, setError: a, registeredWallets: s } = U(), l = H(), { connect: u, isPending: g } = V();
770
+ P(g);
771
+ const z = l.filter(
772
+ (p) => p.type === "injected" && p.id !== "injected" && p.id !== "zerodev-wallet"
773
+ ).map((p) => {
774
+ const d = k.find((D) => O(p, D));
593
775
  return {
594
- connector: h,
776
+ connector: p,
595
777
  walletId: d == null ? void 0 : d.id,
596
- name: (d == null ? void 0 : d.name) ?? h.name,
597
- icon: (d == null ? void 0 : d.icon) ?? h.icon,
598
- ids: d ? [d.id, h.id] : [h.id],
778
+ name: (d == null ? void 0 : d.name) ?? p.name,
779
+ icon: (d == null ? void 0 : d.icon) ?? p.icon,
780
+ ids: d ? [d.id, p.id] : [p.id],
599
781
  rank: d ? k.indexOf(d) : k.length
600
782
  };
601
783
  }).filter(
602
- (h) => !(h.walletId && l.includes(h.walletId))
603
- ).filter((h) => !h.ids.some((d) => e.includes(d))).sort((h, d) => h.rank - d.rank).slice(0, n), E = (h) => {
604
- a || i() && (s(null), p(
605
- { connector: h },
784
+ (p) => !(p.walletId && s.includes(p.walletId))
785
+ ).filter((p) => !p.ids.some((d) => e.includes(d))).sort((p, d) => p.rank - d.rank).slice(0, t), F = (p) => {
786
+ i || o() && (a(null), u(
787
+ { connector: p },
606
788
  {
607
789
  // The external wallet is now the active wagmi connection — the
608
790
  // embedded-wallet flow is done, so close it (mirrors SignUp.Wallet).
609
791
  onSuccess: () => r(null),
610
792
  onError: (d) => {
611
- P(d) || s(d instanceof Error ? d.message : String(d));
793
+ R(d) || a(d instanceof Error ? d.message : String(d));
612
794
  }
613
795
  }
614
796
  ));
615
797
  };
616
- return /* @__PURE__ */ t(x, { children: g.map(({ connector: h, name: d, icon: f }) => /* @__PURE__ */ t(
617
- M,
798
+ return /* @__PURE__ */ n(b, { children: z.map(({ connector: p, name: d, icon: D }) => /* @__PURE__ */ n(
799
+ T,
618
800
  {
619
801
  title: d,
620
- icon: f ? /* @__PURE__ */ t("img", { src: f, alt: "", className: "zd:w-6 zd:h-6" }) : null,
621
- subtitle: /* @__PURE__ */ t(n2, { text: "INSTALLED" }),
622
- trailing: /* @__PURE__ */ t(V, {}),
623
- disabled: a,
624
- onClick: () => E(h)
802
+ icon: D ? /* @__PURE__ */ n("img", { src: D, alt: "", className: "zd:w-6 zd:h-6" }) : null,
803
+ subtitle: /* @__PURE__ */ n(X, { text: "INSTALLED" }),
804
+ trailing: /* @__PURE__ */ n(G, {}),
805
+ disabled: i,
806
+ onClick: () => F(p)
625
807
  },
626
- h.uid
808
+ p.uid
627
809
  )) });
628
810
  }
629
- function ie({ tile: e }) {
811
+ function Ee({ tile: e }) {
630
812
  return /* @__PURE__ */ c(
631
813
  "button",
632
814
  {
@@ -634,28 +816,28 @@ function ie({ tile: e }) {
634
816
  onClick: e.onSelect,
635
817
  className: "zd:flex zd:flex-col zd:items-center zd:gap-1.5 zd:cursor-pointer",
636
818
  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
- Z,
819
+ /* @__PURE__ */ n("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__ */ n("img", { src: e.icon, alt: "", className: "zd:w-8 zd:h-8" }) : /* @__PURE__ */ n(
820
+ K,
639
821
  {
640
822
  name: "walletOutline",
641
823
  className: "zd:w-8 zd:h-8 zd:text-greyScale"
642
824
  }
643
825
  ) }),
644
- /* @__PURE__ */ t(D, { className: "zd:text-body3 zd:max-w-full zd:truncate", children: e.name })
826
+ /* @__PURE__ */ n(w, { className: "zd:text-body3 zd:max-w-full zd:truncate", children: e.name })
645
827
  ]
646
828
  }
647
829
  );
648
830
  }
649
- function ae({
831
+ function Fe({
650
832
  open: e,
651
- onOpenChange: n,
833
+ onOpenChange: t,
652
834
  tiles: r
653
835
  }) {
654
- return /* @__PURE__ */ t(m2, { open: e, onOpenChange: n, children: /* @__PURE__ */ c(g2, { className: "zd:p-4", children: [
655
- /* @__PURE__ */ t(z2, { children: "All wallets" }),
836
+ return /* @__PURE__ */ n(u2, { open: e, onOpenChange: t, children: /* @__PURE__ */ c(f2, { className: "zd:p-4", children: [
837
+ /* @__PURE__ */ n(p2, { children: "All wallets" }),
656
838
  /* @__PURE__ */ c("div", { className: "zd:mb-3 zd:flex zd:items-center zd:gap-2", children: [
657
- /* @__PURE__ */ t(D, { className: "zd:text-h3 zd:flex-1", children: "All wallets" }),
658
- /* @__PURE__ */ t(D2, { asChild: !0, children: /* @__PURE__ */ t(
839
+ /* @__PURE__ */ n(w, { className: "zd:text-h3 zd:flex-1", children: "All wallets" }),
840
+ /* @__PURE__ */ n(m2, { asChild: !0, children: /* @__PURE__ */ n(
659
841
  "button",
660
842
  {
661
843
  type: "button",
@@ -665,398 +847,527 @@ function ae({
665
847
  }
666
848
  ) })
667
849
  ] }),
668
- /* @__PURE__ */ t("div", { className: "zd:grid zd:grid-cols-3 zd:gap-3 zd:max-h-80 zd:overflow-y-auto", children: r.map((a) => /* @__PURE__ */ t(ie, { tile: a }, a.key)) })
850
+ /* @__PURE__ */ n("div", { className: "zd:grid zd:grid-cols-3 zd:gap-3 zd:max-h-80 zd:overflow-y-auto", children: r.map((i) => /* @__PURE__ */ n(Ee, { tile: i }, i.key)) })
669
851
  ] }) });
670
852
  }
671
- function re({
853
+ function ye({
672
854
  title: e = "More wallets"
673
855
  }) {
674
- const { goToStep: n } = F(), { authPending: r, guardAgreement: a, setError: i } = T(), [s, l] = C(!1), o = $(), { mutate: p, isPending: m } = q();
675
- L(m);
676
- const g = o.filter(
677
- (u) => u.id !== "zerodev-wallet" && u.type !== "walletConnect"
678
- ), E = (u) => {
679
- r || a() && (l(!1), i(null), p(
680
- { connector: u },
856
+ const { goToStep: t } = S(), { authPending: r, guardAgreement: i, setError: o, openWalletSheet: a } = U(), [s, l] = E(!1), u = H(), { connect: g, isPending: z } = V();
857
+ P(z);
858
+ const F = u.filter(
859
+ (m) => m.id !== "zerodev-wallet" && m.type !== "walletConnect"
860
+ ), p = (m) => {
861
+ r || i() && (l(!1), o(null), g(
862
+ { connector: m },
681
863
  {
682
864
  // The external wallet is now the active wagmi connection — the
683
865
  // embedded-wallet flow is done, so close it.
684
- onSuccess: () => n(null),
685
- onError: (z) => {
686
- P(z) || i(z instanceof Error ? z.message : String(z));
866
+ onSuccess: () => t(null),
867
+ onError: (h) => {
868
+ R(h) || o(h instanceof Error ? h.message : String(h));
687
869
  }
688
870
  }
689
871
  ));
690
- }, h = k.map((u) => {
691
- const z = g.find((w) => G(w, u));
872
+ }, d = u.some(J), D = k.map((m) => {
873
+ const h = F.find((v) => n2(v, m));
692
874
  return {
693
- key: u.id,
694
- name: u.name,
695
- icon: u.icon,
875
+ key: m.id,
876
+ name: m.name,
877
+ icon: m.icon,
696
878
  onSelect: () => {
697
- if (z) {
698
- E(z);
879
+ if (h) {
880
+ p(h);
881
+ return;
882
+ }
883
+ if (d) {
884
+ if (r || !i()) return;
885
+ l(!1), a(m);
699
886
  return;
700
887
  }
701
- l(!1), window.open(u.downloadUrl, "_blank", "noopener,noreferrer");
888
+ const v = F.find((y) => O(y, m));
889
+ if (v) {
890
+ p(v);
891
+ return;
892
+ }
893
+ l(!1), window.open(m.downloadUrl, "_blank", "noopener,noreferrer");
702
894
  }
703
895
  };
704
- }), d = g.filter((u) => !k.some((z) => G(u, z))).map((u) => ({
705
- key: u.uid,
706
- name: u.name,
707
- icon: u.icon,
708
- onSelect: () => E(u)
896
+ }), f = F.filter((m) => !k.some((h) => O(m, h))).map((m) => ({
897
+ key: m.uid,
898
+ name: m.name,
899
+ icon: m.icon,
900
+ onSelect: () => p(m)
709
901
  }));
710
- return /* @__PURE__ */ c(x, { children: [
711
- /* @__PURE__ */ t(
712
- M,
902
+ return /* @__PURE__ */ c(b, { children: [
903
+ /* @__PURE__ */ n(
904
+ T,
713
905
  {
714
- icon: /* @__PURE__ */ t(t2, { name: "walletOutline", className: "zd:w-5 zd:h-5" }),
906
+ icon: /* @__PURE__ */ n(h2, { name: "walletOutline", className: "zd:w-5 zd:h-5" }),
715
907
  title: e,
716
- trailing: /* @__PURE__ */ t(V, {}),
908
+ trailing: /* @__PURE__ */ n(G, {}),
717
909
  disabled: r,
718
910
  onClick: () => {
719
- r || a() && l(!0);
911
+ r || i() && l(!0);
720
912
  }
721
913
  }
722
914
  ),
723
- /* @__PURE__ */ t(
724
- ae,
915
+ /* @__PURE__ */ n(
916
+ Fe,
725
917
  {
726
918
  open: s,
727
919
  onOpenChange: l,
728
- tiles: [...h, ...d]
920
+ tiles: [...d ? [
921
+ {
922
+ key: "walletconnect",
923
+ name: "WalletConnect",
924
+ icon: t2,
925
+ onSelect: () => {
926
+ r || i() && (l(!1), a());
927
+ }
928
+ }
929
+ ] : [], ...D, ...f]
729
930
  }
730
931
  )
731
932
  ] });
732
933
  }
733
- function u2() {
734
- const { goToStep: e } = F(), { authPending: n, guardAgreement: r, setError: a } = T(), i = {
934
+ function v2() {
935
+ const { goToStep: e } = S(), { authPending: t, guardAgreement: r, setError: i } = U(), o = {
735
936
  onSuccess: () => {
736
937
  e("authenticated");
737
938
  },
738
- onError: (g) => {
739
- P(g) || a(g instanceof Error ? g.message : String(g));
939
+ onError: (z) => {
940
+ R(z) || i(z instanceof Error ? z.message : String(z));
740
941
  }
741
- }, { mutate: s, isPending: l } = N2({ mutation: i }), { mutate: o, isPending: p } = k2({
742
- mutation: i
942
+ }, { mutate: a, isPending: s } = _2({ mutation: o }), { mutate: l, isPending: u } = Z2({
943
+ mutation: o
743
944
  });
744
- L(l || p);
745
- const m = (g) => () => {
746
- n || r() && (a(null), g());
945
+ P(s || u);
946
+ const g = (z) => () => {
947
+ t || r() && (i(null), z());
747
948
  };
748
- return /* @__PURE__ */ c(x, { children: [
749
- /* @__PURE__ */ t(
750
- S,
949
+ return /* @__PURE__ */ c(b, { children: [
950
+ /* @__PURE__ */ n(
951
+ A,
751
952
  {
752
953
  action: "secondary",
753
954
  text: "Create a passkey",
754
955
  iconName: "key",
755
956
  trailIcon: !0,
756
- disabled: n,
757
- onClick: m(() => s())
957
+ disabled: t,
958
+ onClick: g(() => a())
758
959
  }
759
960
  ),
760
- /* @__PURE__ */ t(
761
- S,
961
+ /* @__PURE__ */ n(
962
+ A,
762
963
  {
763
964
  action: "secondary",
764
965
  text: "Log in with passkey",
765
966
  iconName: "key",
766
967
  trailIcon: !0,
767
- disabled: n,
768
- onClick: m(() => o())
968
+ disabled: t,
969
+ onClick: g(() => l())
769
970
  }
770
971
  )
771
972
  ] });
772
973
  }
773
- function se({ walletId: e }) {
774
- const n = k.find((f) => f.id === e);
775
- if (!n)
974
+ function ve({ walletId: e }) {
975
+ const t = k.find((f) => f.id === e);
976
+ if (!t)
776
977
  throw new Error(
777
978
  `Unknown walletId "${e}". Valid ids: ${k.map((f) => f.id).join(", ")}`
778
979
  );
779
- const { goToStep: r } = F(), { authPending: a, guardAgreement: i, setError: s, registerWallet: l } = T(), o = $(), { mutate: p, isPending: m } = q();
780
- L(m), F2(() => l(n.id), [l, n.id]);
781
- const g = o.find((f) => G(f, n)), E = !!n.rdns && o.some((f) => f.id === n.rdns), h = {
782
- title: n.name,
783
- icon: /* @__PURE__ */ t("img", { src: n.icon, alt: "", className: "zd:w-6 zd:h-6" }),
784
- trailing: /* @__PURE__ */ t(V, {})
980
+ const { goToStep: r } = S(), {
981
+ authPending: i,
982
+ guardAgreement: o,
983
+ setError: a,
984
+ registerWallet: s,
985
+ openWalletSheet: l
986
+ } = U(), u = H(), { connect: g, isPending: z } = V();
987
+ P(z), L2(() => s(t.id), [s, t.id]);
988
+ const F = u.find((f) => n2(f, t)), p = {
989
+ title: t.name,
990
+ icon: /* @__PURE__ */ n("img", { src: t.icon, alt: "", className: "zd:w-6 zd:h-6" }),
991
+ trailing: /* @__PURE__ */ n(G, {})
785
992
  };
786
- return g ? /* @__PURE__ */ t(
787
- M,
993
+ if (!F && u.some(J))
994
+ return /* @__PURE__ */ n(
995
+ T,
996
+ {
997
+ ...p,
998
+ disabled: i,
999
+ onClick: () => {
1000
+ i || o() && l(t);
1001
+ }
1002
+ }
1003
+ );
1004
+ const d = F ?? u.find((f) => O(f, t));
1005
+ return d ? /* @__PURE__ */ n(
1006
+ T,
788
1007
  {
789
- ...h,
790
- ...E && { subtitle: /* @__PURE__ */ t(n2, { text: "INSTALLED" }) },
791
- disabled: a,
1008
+ ...p,
1009
+ ...!!F && { subtitle: /* @__PURE__ */ n(X, { text: "INSTALLED" }) },
1010
+ disabled: i,
792
1011
  onClick: () => {
793
- a || i() && (s(null), p(
794
- { connector: g },
1012
+ i || o() && (a(null), g(
1013
+ { connector: d },
795
1014
  {
796
1015
  // The external wallet is now the active wagmi connection — the
797
1016
  // embedded-wallet flow is done, so close it (mirrors SignUp.MoreWallets).
798
1017
  onSuccess: () => r(null),
799
1018
  onError: (f) => {
800
- P(f) || s(f instanceof Error ? f.message : String(f));
1019
+ R(f) || a(f instanceof Error ? f.message : String(f));
801
1020
  }
802
1021
  }
803
1022
  ));
804
1023
  }
805
1024
  }
806
- ) : /* @__PURE__ */ t(M, { ...h, asChild: !0, children: /* @__PURE__ */ t(
1025
+ ) : /* @__PURE__ */ n(T, { ...p, asChild: !0, children: /* @__PURE__ */ n(
807
1026
  "a",
808
1027
  {
809
- href: n.downloadUrl,
1028
+ href: t.downloadUrl,
810
1029
  target: "_blank",
811
1030
  rel: "noopener noreferrer"
812
1031
  }
813
1032
  ) });
814
1033
  }
815
- function p2({
1034
+ function Se() {
1035
+ const { authPending: e, guardAgreement: t, openWalletSheet: r } = U();
1036
+ return H().some(J) ? /* @__PURE__ */ n(
1037
+ T,
1038
+ {
1039
+ title: "WalletConnect",
1040
+ icon: /* @__PURE__ */ n("img", { src: t2, alt: "", className: "zd:w-6 zd:h-6" }),
1041
+ subtitle: /* @__PURE__ */ n(X, { text: "QR CODE" }),
1042
+ trailing: /* @__PURE__ */ n(G, {}),
1043
+ disabled: e,
1044
+ onClick: () => {
1045
+ e || t() && r();
1046
+ }
1047
+ }
1048
+ ) : null;
1049
+ }
1050
+ function S2({
816
1051
  children: e,
817
- termsAndConditionsUrl: n,
1052
+ termsAndConditionsUrl: t,
818
1053
  privacyPolicyUrl: r,
819
- emailAuthMethod: a = "magicLink"
1054
+ emailAuthMethod: i = "magicLink"
820
1055
  }) {
821
- const [i, s] = C(!1), [l, o] = C(!1), [p, m] = C(null), [g, E] = C(!1), [h, d] = C(
1056
+ const [o, a] = E(!1), [s, l] = E(!1), [u, g] = E(null), [z, F] = E(!1), [p, d] = E(
822
1057
  []
823
- ), f = x2((y) => (d((b) => [...b, y]), () => {
824
- d((b) => {
825
- const v = [...b];
826
- return v.splice(v.indexOf(y), 1), v;
1058
+ ), D = O2((y) => (d((M) => [...M, y]), () => {
1059
+ d((M) => {
1060
+ const Q = [...M];
1061
+ return Q.splice(Q.indexOf(y), 1), Q;
827
1062
  });
828
- }), []), z = !!(n || r) && !i, w = () => z ? (o(!0), !1) : !0;
1063
+ }), []), [f, C] = E(null), x = Ce(), h = !!(t || r) && !o, v = () => h ? (l(!0), !1) : !0;
829
1064
  return /* @__PURE__ */ c(
830
- o2.Provider,
1065
+ E2.Provider,
831
1066
  {
832
1067
  value: {
833
- authPending: g,
834
- emailAuthMethod: a,
835
- setAuthPending: E,
836
- needsAgreement: z,
837
- guardAgreement: w,
838
- setError: m,
839
- registeredWallets: h,
840
- registerWallet: f
1068
+ authPending: z,
1069
+ emailAuthMethod: i,
1070
+ setAuthPending: F,
1071
+ needsAgreement: h,
1072
+ guardAgreement: v,
1073
+ setError: g,
1074
+ registeredWallets: p,
1075
+ registerWallet: D,
1076
+ openWalletSheet: (y) => {
1077
+ const M = y && x.deepLinkFor(y);
1078
+ M && (window.location.href = M), C({ wallet: y });
1079
+ }
841
1080
  },
842
1081
  children: [
843
- p !== null && /* @__PURE__ */ t("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full zd:min-h-100", children: /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:max-w-md", children: [
844
- /* @__PURE__ */ t(D, { className: "zd:text-h2 zd:text-center", children: "Error occurred" }),
845
- /* @__PURE__ */ t(D, { className: "zd:text-center zd:text-red-500", children: p }),
846
- /* @__PURE__ */ t(
847
- S,
1082
+ u !== null && /* @__PURE__ */ n("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full zd:min-h-100", children: /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:max-w-md", children: [
1083
+ /* @__PURE__ */ n(w, { className: "zd:text-h2 zd:text-center", children: "Error occurred" }),
1084
+ /* @__PURE__ */ n(w, { className: "zd:text-center zd:text-red-500", children: u }),
1085
+ /* @__PURE__ */ n(
1086
+ A,
848
1087
  {
849
1088
  action: "primary",
850
1089
  text: "Try again",
851
- onClick: () => m(null)
1090
+ onClick: () => g(null)
852
1091
  }
853
1092
  )
854
1093
  ] }) }),
855
1094
  /* @__PURE__ */ c(
856
1095
  "div",
857
1096
  {
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${p !== null ? " zd:hidden" : ""}`,
1097
+ 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${u !== null ? " zd:hidden" : ""}`,
859
1098
  children: [
860
1099
  /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-center", children: [
861
1100
  /* @__PURE__ */ c("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(Q2, { className: "zd:w-full zd:pointer-events-none zd:select-none" }) }),
863
- /* @__PURE__ */ t(D, { className: "zd:text-h2 zd:text-center", children: "Continue to your wallet" }),
864
- /* @__PURE__ */ t(D, { className: "zd:mt-2 zd:text-center zd:text-greyScale/50", children: "Choose a sign-in method to proceed" })
1101
+ /* @__PURE__ */ n("div", { className: "zd:w-full zd:px-16 zd:py-4", children: /* @__PURE__ */ n(pe, { className: "zd:w-full zd:pointer-events-none zd:select-none" }) }),
1102
+ /* @__PURE__ */ n(w, { className: "zd:text-h2 zd:text-center", children: "Continue to your wallet" }),
1103
+ /* @__PURE__ */ n(w, { className: "zd:mt-2 zd:text-center zd:text-greyScale/50", children: "Choose a sign-in method to proceed" })
865
1104
  ] }),
866
- /* @__PURE__ */ t("div", { className: "zd:mt-6 zd:mb-4 zd:px-4 zd:flex zd:flex-col zd:gap-2", children: e })
1105
+ /* @__PURE__ */ n("div", { className: "zd:mt-6 zd:mb-4 zd:px-4 zd:flex zd:flex-col zd:gap-2", children: e })
867
1106
  ] }),
868
- /* @__PURE__ */ t("div", { className: "zd:px-4", children: /* @__PURE__ */ t(
869
- J2,
1107
+ /* @__PURE__ */ n("div", { className: "zd:px-4", children: /* @__PURE__ */ n(
1108
+ ue,
870
1109
  {
871
- termsAndConditionsUrl: n,
1110
+ termsAndConditionsUrl: t,
872
1111
  privacyPolicyUrl: r,
873
- agreedToTerms: i,
1112
+ agreedToTerms: o,
874
1113
  setAgreedToTerms: (y) => {
875
- s(y), y && o(!1);
1114
+ a(y), y && l(!1);
876
1115
  },
877
- highlight: l
1116
+ highlight: s
878
1117
  }
879
1118
  ) })
880
1119
  ]
881
1120
  }
1121
+ ),
1122
+ /* @__PURE__ */ n(
1123
+ ge,
1124
+ {
1125
+ pairing: x,
1126
+ open: f !== null,
1127
+ onOpenChange: (y) => {
1128
+ y || C(null);
1129
+ },
1130
+ wallet: f == null ? void 0 : f.wallet
1131
+ }
882
1132
  )
883
1133
  ]
884
1134
  }
885
1135
  );
886
1136
  }
887
- function h2({ label: e = "or" }) {
1137
+ function A2({ label: e = "or" }) {
888
1138
  return /* @__PURE__ */ c("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(D, { className: "zd:text-body3", children: e }),
891
- /* @__PURE__ */ t("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" })
1139
+ /* @__PURE__ */ n("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" }),
1140
+ /* @__PURE__ */ n(w, { className: "zd:text-body3", children: e }),
1141
+ /* @__PURE__ */ n("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" })
892
1142
  ] });
893
1143
  }
894
- function le(e) {
895
- return /* @__PURE__ */ c(p2, { ...e, children: [
896
- /* @__PURE__ */ t(u2, {}),
897
- /* @__PURE__ */ t(h2, {}),
898
- /* @__PURE__ */ t(c2, {}),
899
- /* @__PURE__ */ t(d2, {})
1144
+ function Ae(e) {
1145
+ return /* @__PURE__ */ c(S2, { ...e, children: [
1146
+ /* @__PURE__ */ n(v2, {}),
1147
+ /* @__PURE__ */ n(A2, {}),
1148
+ /* @__PURE__ */ n(y2, {}),
1149
+ /* @__PURE__ */ n(F2, {})
900
1150
  ] });
901
1151
  }
902
- const oe = Object.assign(p2, {
903
- Default: le,
904
- Passkey: u2,
905
- Google: c2,
906
- Email: d2,
907
- Wallet: se,
908
- InstalledWallets: ne,
909
- MoreWallets: re,
910
- Divider: h2
1152
+ const be = Object.assign(S2, {
1153
+ Default: Ae,
1154
+ Passkey: v2,
1155
+ Google: y2,
1156
+ Email: F2,
1157
+ Wallet: ve,
1158
+ WalletConnect: Se,
1159
+ InstalledWallets: xe,
1160
+ MoreWallets: ye,
1161
+ Divider: A2
911
1162
  });
912
- function de() {
1163
+ function ke() {
913
1164
  return typeof window > "u" ? null : new URLSearchParams(window.location.search).get("code");
914
1165
  }
915
- function ce() {
916
- const { otpId: e, otpEncryptionTargetBundle: n, goToStep: r, clearOtpSession: a } = F(), [i] = C(de), [s, l] = C(null), o = r2(!1), { mutate: p, isPending: m } = U2({
1166
+ function Ne() {
1167
+ const { otpId: e, otpEncryptionTargetBundle: t, goToStep: r, clearOtpSession: i } = S(), [o] = E(ke), [a, s] = E(null), l = e2(!1), { mutate: u, isPending: g } = G2({
917
1168
  mutation: {
918
1169
  onSuccess: () => {
919
- a(), r("authenticated");
1170
+ i(), r("authenticated");
920
1171
  },
921
- onError: (g) => {
922
- l(g);
1172
+ onError: (z) => {
1173
+ s(z);
923
1174
  }
924
1175
  }
925
1176
  });
926
- return U(() => {
927
- if (!(o.current || !i)) {
928
- if (o.current = !0, !e || !n) {
929
- I(), r(null);
1177
+ return N(() => {
1178
+ if (!(l.current || !o)) {
1179
+ if (l.current = !0, !e || !t) {
1180
+ _(), r(null);
930
1181
  return;
931
1182
  }
932
- p({ otpId: e, code: i, otpEncryptionTargetBundle: n });
1183
+ u({ otpId: e, code: o, otpEncryptionTargetBundle: t });
933
1184
  }
934
- }, [e, n, i, p, r]), /* @__PURE__ */ c(x, { children: [
1185
+ }, [e, t, o, u, r]), /* @__PURE__ */ c(b, { children: [
935
1186
  /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
936
- !s && m && /* @__PURE__ */ t(N, { imageName: "loading", title: "Verifying Your Email", children: "Please wait while we securely connect your wallet." }),
937
- !s && !i && !m && /* @__PURE__ */ c(x, { children: [
938
- /* @__PURE__ */ c(N, { imageName: "error", title: "Invalid Link", children: [
1187
+ !a && g && /* @__PURE__ */ n(L, { imageName: "loading", title: "Verifying Your Email", children: "Please wait while we securely connect your wallet." }),
1188
+ !a && !o && !g && /* @__PURE__ */ c(b, { children: [
1189
+ /* @__PURE__ */ c(L, { imageName: "error", title: "Invalid Link", children: [
939
1190
  "This verification link is invalid or incomplete.",
940
- /* @__PURE__ */ t("br", {}),
1191
+ /* @__PURE__ */ n("br", {}),
941
1192
  "Please check your email and try again with the correct link."
942
1193
  ] }),
943
- /* @__PURE__ */ t(
944
- S,
1194
+ /* @__PURE__ */ n(
1195
+ A,
945
1196
  {
946
1197
  action: "primary",
947
1198
  onClick: () => {
948
- I(), r("sign-up");
1199
+ _(), r("sign-up");
949
1200
  },
950
1201
  text: "Choose another sign-in method"
951
1202
  }
952
1203
  )
953
1204
  ] }),
954
- s != null && /* @__PURE__ */ c(x, { children: [
955
- /* @__PURE__ */ t(N, { 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,
1205
+ a != null && /* @__PURE__ */ c(b, { children: [
1206
+ /* @__PURE__ */ n(L, { 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." }),
1207
+ /* @__PURE__ */ n(
1208
+ A,
958
1209
  {
959
1210
  action: "primary",
960
1211
  onClick: () => {
961
- I(), r("sign-up");
1212
+ _(), r("sign-up");
962
1213
  },
963
1214
  text: "Choose another sign-in method"
964
1215
  }
965
1216
  )
966
1217
  ] })
967
1218
  ] }),
968
- /* @__PURE__ */ t(H, { className: "zd:self-center zd:pt-4 zd:pb-6" })
1219
+ /* @__PURE__ */ n(Z, { className: "zd:self-center zd:pt-4 zd:pb-6" })
969
1220
  ] });
970
1221
  }
971
- function ue() {
972
- return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(N, { imageName: "loading", title: "Authenticating...", children: "Please wait while we complete the OAuth authentication." }) });
1222
+ function Ue() {
1223
+ return /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ n(L, { imageName: "loading", title: "Authenticating...", children: "Please wait while we complete the OAuth authentication." }) });
973
1224
  }
974
- function pe() {
975
- return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(N, { imageName: "loading", title: "Passkey authentication", children: "Please authenticate with your passkey." }) });
1225
+ function Ie() {
1226
+ return /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ n(L, { imageName: "loading", title: "Passkey authentication", children: "Please authenticate with your passkey." }) });
976
1227
  }
977
- function he(e, n) {
1228
+ function Te(e, t) {
978
1229
  switch (e) {
979
1230
  case "sign-up":
980
- return n ? n() : /* @__PURE__ */ t(oe.Default, {});
1231
+ return t ? t() : /* @__PURE__ */ n(be.Default, {});
981
1232
  case "email-verification":
982
- return /* @__PURE__ */ t(B2, {});
1233
+ return /* @__PURE__ */ n(te, {});
983
1234
  case "otp-input":
984
- return /* @__PURE__ */ t(Y2, {});
1235
+ return /* @__PURE__ */ n(ce, {});
985
1236
  case "verifying-otp":
986
- return /* @__PURE__ */ t(ce, {});
1237
+ return /* @__PURE__ */ n(Ne, {});
987
1238
  case "oauth-in-progress":
988
- return /* @__PURE__ */ t(ue, {});
1239
+ return /* @__PURE__ */ n(Ue, {});
989
1240
  case "passkey-prompt":
990
- return /* @__PURE__ */ t(pe, {});
1241
+ return /* @__PURE__ */ n(Ie, {});
991
1242
  case "error":
992
- return /* @__PURE__ */ t(G2, {});
1243
+ return /* @__PURE__ */ n(ie, {});
993
1244
  default:
994
1245
  return null;
995
1246
  }
996
1247
  }
997
- function _e({
1248
+ function rt({
998
1249
  onClose: e,
999
- size: n,
1250
+ size: t,
1000
1251
  renderSignUp: r,
1001
- logo: a
1252
+ logo: i
1002
1253
  } = {}) {
1003
- const { step: i, goToStep: s, goBack: l, reset: o } = F();
1004
- U(() => {
1005
- i === null && Z2() && s("verifying-otp");
1006
- }, [i, s]);
1007
- const p = he(i, r);
1008
- return p ? /* @__PURE__ */ t(
1009
- i2,
1254
+ const { step: o, goToStep: a, goBack: s, reset: l } = S();
1255
+ N(() => {
1256
+ o === null && ne() && a("verifying-otp");
1257
+ }, [o, a]);
1258
+ const u = Te(o, r);
1259
+ return u ? /* @__PURE__ */ n(
1260
+ g2,
1010
1261
  {
1011
- ...n && { size: n },
1012
- className: i === "sign-up" ? "zd:h-auto zd:max-h-202.5" : void 0,
1013
- topNav: /* @__PURE__ */ t(
1014
- a2,
1262
+ ...t && { size: t },
1263
+ className: o === "sign-up" ? "zd:h-auto zd:max-h-202.5" : void 0,
1264
+ topNav: /* @__PURE__ */ n(
1265
+ z2,
1015
1266
  {
1016
- ...l !== null && { onLeftButtonClick: l },
1267
+ ...s !== null && { onLeftButtonClick: s },
1017
1268
  onRightButtonClick: () => {
1018
- I(), o(), e == null || e();
1269
+ _(), l(), e == null || e();
1019
1270
  },
1020
- ...i === "sign-up" && {
1021
- ...a && { logo: a },
1271
+ ...o === "sign-up" && {
1272
+ ...i && { logo: i },
1022
1273
  className: "zd:px-4"
1023
1274
  }
1024
1275
  }
1025
1276
  ),
1026
- children: p
1277
+ children: u
1027
1278
  }
1028
1279
  ) : null;
1029
1280
  }
1030
- const K = "zerodev:auth:otpSession";
1031
- function fe() {
1281
+ function Le(e) {
1282
+ const t = e.toLowerCase();
1283
+ return k.find((r) => {
1284
+ const i = r.name.toLowerCase();
1285
+ return t.includes(i) || i.includes(t);
1286
+ });
1287
+ }
1288
+ function Oe(e) {
1289
+ return k.find((t) => O(e, t));
1290
+ }
1291
+ function Me() {
1292
+ const { connector: e, isConnected: t } = D2(), [r, i] = E(void 0), o = !!e && e.type === "walletConnect";
1293
+ return N(() => {
1294
+ if (!e || !o) {
1295
+ i(void 0);
1296
+ return;
1297
+ }
1298
+ let a = !1;
1299
+ return e.getProvider().then((s) => {
1300
+ var u, g;
1301
+ if (a) return;
1302
+ const l = (g = (u = s.session) == null ? void 0 : u.peer) == null ? void 0 : g.metadata;
1303
+ i(l);
1304
+ }).catch(() => {
1305
+ }), () => {
1306
+ a = !0;
1307
+ };
1308
+ }, [e, o]), $(() => {
1309
+ var s;
1310
+ if (!t || !e) return;
1311
+ if (e.id === "zerodev-wallet")
1312
+ return {
1313
+ name: e.name,
1314
+ icon: e.icon,
1315
+ source: "embedded"
1316
+ };
1317
+ if (o) {
1318
+ const l = r != null && r.name ? Le(r.name) : void 0;
1319
+ return {
1320
+ name: (r == null ? void 0 : r.name) ?? void 0,
1321
+ icon: ((s = r == null ? void 0 : r.icons) == null ? void 0 : s[0]) ?? (l == null ? void 0 : l.icon),
1322
+ walletId: l == null ? void 0 : l.id,
1323
+ // Identity is about the session, so a raw walletConnect() connector
1324
+ // resolves here too — unlike pairing, which is kit-connector-only.
1325
+ source: "walletconnect"
1326
+ };
1327
+ }
1328
+ const a = Oe(e);
1329
+ return {
1330
+ name: e.name,
1331
+ icon: e.icon ?? (a == null ? void 0 : a.icon),
1332
+ walletId: a == null ? void 0 : a.id,
1333
+ source: e.type === "injected" ? "injected" : "other"
1334
+ };
1335
+ }, [e, t, o, r]);
1336
+ }
1337
+ function ot(e) {
1338
+ const t = Me();
1339
+ return $(() => ({ walletInfo: t }), [t]);
1340
+ }
1341
+ const i2 = "zerodev:auth:otpSession";
1342
+ function Be() {
1032
1343
  if (typeof window > "u") return null;
1033
1344
  try {
1034
- const e = window.localStorage.getItem(K);
1345
+ const e = window.localStorage.getItem(i2);
1035
1346
  if (!e) return null;
1036
- const n = JSON.parse(e);
1037
- return !(n != null && n.otpId) || !(n != null && n.otpEncryptionTargetBundle) ? null : n;
1347
+ const t = JSON.parse(e);
1348
+ return !(t != null && t.otpId) || !(t != null && t.otpEncryptionTargetBundle) ? null : t;
1038
1349
  } catch {
1039
1350
  return null;
1040
1351
  }
1041
1352
  }
1042
- function me(e) {
1353
+ function He(e) {
1043
1354
  if (!(typeof window > "u"))
1044
1355
  try {
1045
1356
  window.localStorage.setItem(
1046
- K,
1357
+ i2,
1047
1358
  JSON.stringify(e)
1048
1359
  );
1049
1360
  } catch {
1050
1361
  }
1051
1362
  }
1052
- function Y() {
1363
+ function r2() {
1053
1364
  if (!(typeof window > "u"))
1054
1365
  try {
1055
- window.localStorage.removeItem(K);
1366
+ window.localStorage.removeItem(i2);
1056
1367
  } catch {
1057
1368
  }
1058
1369
  }
1059
- const ge = (e, n, r) => ({
1370
+ const Re = (e, t, r) => ({
1060
1371
  auth: {
1061
1372
  // Initial state
1062
1373
  step: null,
@@ -1066,40 +1377,40 @@ const ge = (e, n, r) => ({
1066
1377
  otpEncryptionTargetBundle: null,
1067
1378
  // Actions
1068
1379
  initialize: () => {
1069
- const a = fe();
1070
- a && e((i) => ({
1380
+ const i = Be();
1381
+ i && e((o) => ({
1071
1382
  auth: {
1072
- ...i.auth,
1073
- otpId: a.otpId,
1074
- otpEncryptionTargetBundle: a.otpEncryptionTargetBundle
1383
+ ...o.auth,
1384
+ otpId: i.otpId,
1385
+ otpEncryptionTargetBundle: i.otpEncryptionTargetBundle
1075
1386
  }
1076
1387
  }));
1077
1388
  },
1078
- goToStep: (a) => {
1079
- e((i) => ({
1389
+ goToStep: (i) => {
1390
+ e((o) => ({
1080
1391
  auth: {
1081
- ...i.auth,
1082
- step: a,
1083
- stepHistory: i.auth.step === null ? i.auth.stepHistory : [...i.auth.stepHistory, i.auth.step]
1392
+ ...o.auth,
1393
+ step: i,
1394
+ stepHistory: o.auth.step === null ? o.auth.stepHistory : [...o.auth.stepHistory, o.auth.step]
1084
1395
  }
1085
1396
  }));
1086
1397
  },
1087
1398
  goBack: () => {
1088
- const { auth: a } = n();
1089
- if (a.stepHistory.length === 0) return;
1090
- const i = [...a.stepHistory], s = i.pop();
1091
- e((l) => ({
1399
+ const { auth: i } = t();
1400
+ if (i.stepHistory.length === 0) return;
1401
+ const o = [...i.stepHistory], a = o.pop();
1402
+ e((s) => ({
1092
1403
  auth: {
1093
- ...l.auth,
1094
- step: s,
1095
- stepHistory: i
1404
+ ...s.auth,
1405
+ step: a,
1406
+ stepHistory: o
1096
1407
  }
1097
1408
  }));
1098
1409
  },
1099
1410
  reset: () => {
1100
- Y(), e((a) => ({
1411
+ r2(), e((i) => ({
1101
1412
  auth: {
1102
- ...a.auth,
1413
+ ...i.auth,
1103
1414
  step: null,
1104
1415
  stepHistory: [],
1105
1416
  email: null,
@@ -1108,82 +1419,82 @@ const ge = (e, n, r) => ({
1108
1419
  }
1109
1420
  }));
1110
1421
  },
1111
- setEmail: (a) => {
1112
- e((i) => ({
1422
+ setEmail: (i) => {
1423
+ e((o) => ({
1113
1424
  auth: {
1114
- ...i.auth,
1115
- email: a
1425
+ ...o.auth,
1426
+ email: i
1116
1427
  }
1117
1428
  }));
1118
1429
  },
1119
- setOtpSession: ({ otpId: a, otpEncryptionTargetBundle: i }) => {
1120
- me({ otpId: a, otpEncryptionTargetBundle: i }), e((s) => ({
1430
+ setOtpSession: ({ otpId: i, otpEncryptionTargetBundle: o }) => {
1431
+ He({ otpId: i, otpEncryptionTargetBundle: o }), e((a) => ({
1121
1432
  auth: {
1122
- ...s.auth,
1123
- otpId: a,
1124
- otpEncryptionTargetBundle: i
1433
+ ...a.auth,
1434
+ otpId: i,
1435
+ otpEncryptionTargetBundle: o
1125
1436
  }
1126
1437
  }));
1127
1438
  },
1128
1439
  clearOtpSession: () => {
1129
- Y(), e((a) => ({
1440
+ r2(), e((i) => ({
1130
1441
  auth: {
1131
- ...a.auth,
1442
+ ...i.auth,
1132
1443
  otpId: null,
1133
1444
  otpEncryptionTargetBundle: null
1134
1445
  }
1135
1446
  }));
1136
1447
  }
1137
1448
  }
1138
- }), ze = () => v2()(
1139
- L2((e, n, r) => ({
1449
+ }), Pe = () => B2()(
1450
+ q2((e, t, r) => ({
1140
1451
  pendingRequests: [],
1141
1452
  userConfirmationListenerActive: !1,
1142
- addPendingRequest: (a) => e((i) => ({
1143
- pendingRequests: [...i.pendingRequests, a]
1453
+ addPendingRequest: (i) => e((o) => ({
1454
+ pendingRequests: [...o.pendingRequests, i]
1144
1455
  })),
1145
- removePendingRequest: (a) => e((i) => ({
1146
- pendingRequests: i.pendingRequests.filter((s) => s.id !== a)
1456
+ removePendingRequest: (i) => e((o) => ({
1457
+ pendingRequests: o.pendingRequests.filter((a) => a.id !== i)
1147
1458
  })),
1148
1459
  clearPendingRequests: () => e({ pendingRequests: [] }),
1149
- setUserConfirmationListenerActive: (a) => e({ userConfirmationListenerActive: a }),
1150
- ...ge(e, n)
1460
+ setUserConfirmationListenerActive: (i) => e({ userConfirmationListenerActive: i }),
1461
+ ...Re(e, t)
1151
1462
  }))
1152
1463
  );
1153
- function De(e) {
1154
- return new Promise((n, r) => {
1155
- const a = e.subscribe(
1156
- (i) => i.auth.step,
1157
- (i) => {
1158
- i === "authenticated" ? (a(), n()) : i === null && (a(), r(new Error("Auth flow dismissed")));
1464
+ function We(e) {
1465
+ return new Promise((t, r) => {
1466
+ const i = e.subscribe(
1467
+ (o) => o.auth.step,
1468
+ (o) => {
1469
+ o === "authenticated" ? (i(), t()) : o === null && (i(), r(new Error("Auth flow dismissed")));
1159
1470
  }
1160
1471
  );
1161
1472
  });
1162
1473
  }
1163
- function Le(e) {
1164
- const n = T2(e), r = ze();
1165
- return (a) => {
1166
- const i = n(a);
1474
+ function at(e) {
1475
+ const t = V2(e), r = Pe();
1476
+ return (i) => {
1477
+ const o = t(i);
1167
1478
  return {
1168
- ...i,
1169
- async connect(s) {
1479
+ ...o,
1480
+ async connect(a) {
1170
1481
  try {
1171
- return await i.connect(s);
1172
- } catch (l) {
1173
- if (s != null && s.isReconnecting || !(l instanceof _2))
1174
- throw l;
1482
+ return await o.connect(a);
1483
+ } catch (s) {
1484
+ if (a != null && a.isReconnecting || !(s instanceof j2))
1485
+ throw s;
1175
1486
  if (r.getState().auth.step !== null)
1176
1487
  throw new Error("Auth flow already in progress");
1177
- return r.getState().auth.goToStep("sign-up"), await De(r), i.connect(s);
1488
+ return r.getState().auth.goToStep("sign-up"), await We(r), o.connect(a);
1178
1489
  }
1179
1490
  },
1180
1491
  async disconnect() {
1181
- var s;
1182
- await ((s = i.disconnect) == null ? void 0 : s.call(i)), r.getState().auth.reset();
1492
+ var a;
1493
+ await ((a = o.disconnect) == null ? void 0 : a.call(o)), r.getState().auth.reset();
1183
1494
  },
1184
1495
  async setup() {
1185
- var s;
1186
- await ((s = i.setup) == null ? void 0 : s.call(i)), !(typeof window > "u") && r.getState().auth.initialize();
1496
+ var a;
1497
+ await ((a = o.setup) == null ? void 0 : a.call(o)), !(typeof window > "u") && r.getState().auth.initialize();
1187
1498
  },
1188
1499
  getKitStore() {
1189
1500
  return r;
@@ -1191,68 +1502,68 @@ function Le(e) {
1191
1502
  };
1192
1503
  };
1193
1504
  }
1194
- const we = {
1505
+ const _e = {
1195
1506
  Pending: "zd:text-solarOrange",
1196
1507
  Success: "zd:text-positive",
1197
1508
  Failed: "zd:text-negative"
1198
1509
  };
1199
- function Ce({
1510
+ function Ze({
1200
1511
  icon: e,
1201
- title: n,
1512
+ title: t,
1202
1513
  value: r,
1203
- chainName: a,
1204
- chainIconUrl: i,
1205
- destChainName: s,
1206
- destChainIconUrl: l,
1207
- status: o,
1208
- className: p
1514
+ chainName: i,
1515
+ chainIconUrl: o,
1516
+ destChainName: a,
1517
+ destChainIconUrl: s,
1518
+ status: l,
1519
+ className: u
1209
1520
  }) {
1210
1521
  return /* @__PURE__ */ c(
1211
1522
  "div",
1212
1523
  {
1213
- className: B(
1524
+ className: q(
1214
1525
  "zd:flex zd:w-full zd:items-center zd:gap-2 zd:p-2",
1215
- p
1526
+ u
1216
1527
  ),
1217
1528
  children: [
1218
- /* @__PURE__ */ t("div", { className: "zd:flex zd:size-11 zd:shrink-0 zd:items-center zd:justify-center zd:rounded-xl zd:bg-white", children: /* @__PURE__ */ t(Z, { name: e, className: "zd:size-5" }) }),
1529
+ /* @__PURE__ */ n("div", { className: "zd:flex zd:size-11 zd:shrink-0 zd:items-center zd:justify-center zd:rounded-xl zd:bg-white", children: /* @__PURE__ */ n(K, { name: e, className: "zd:size-5" }) }),
1219
1530
  /* @__PURE__ */ c("div", { className: "zd:flex zd:min-w-0 zd:flex-1 zd:flex-col zd:gap-2", children: [
1220
1531
  /* @__PURE__ */ c("div", { className: "zd:flex zd:w-full zd:items-center zd:justify-between zd:gap-2", children: [
1221
- /* @__PURE__ */ t(D, { className: "zd:shrink-0 zd:whitespace-nowrap zd:text-body1", children: n }),
1222
- /* @__PURE__ */ t(D, { className: "zd:min-w-0 zd:truncate zd:text-right zd:text-body1", children: r })
1532
+ /* @__PURE__ */ n(w, { className: "zd:shrink-0 zd:whitespace-nowrap zd:text-body1", children: t }),
1533
+ /* @__PURE__ */ n(w, { className: "zd:min-w-0 zd:truncate zd:text-right zd:text-body1", children: r })
1223
1534
  ] }),
1224
1535
  /* @__PURE__ */ c("div", { className: "zd:flex zd:w-full zd:items-center zd:justify-between zd:gap-2", children: [
1225
1536
  /* @__PURE__ */ c("div", { className: "zd:flex zd:min-w-0 zd:items-center zd:gap-2", children: [
1226
- /* @__PURE__ */ t(
1227
- J,
1537
+ /* @__PURE__ */ n(
1538
+ o2,
1228
1539
  {
1229
- name: a,
1230
- ...i && { iconUrl: i }
1540
+ name: i,
1541
+ ...o && { iconUrl: o }
1231
1542
  }
1232
1543
  ),
1233
- s && /* @__PURE__ */ c(x, { children: [
1234
- /* @__PURE__ */ t(
1235
- Z,
1544
+ a && /* @__PURE__ */ c(b, { children: [
1545
+ /* @__PURE__ */ n(
1546
+ K,
1236
1547
  {
1237
1548
  name: "arrowRightFill",
1238
1549
  "aria-hidden": !0,
1239
1550
  className: "zd:size-3 zd:shrink-0 zd:opacity-30"
1240
1551
  }
1241
1552
  ),
1242
- /* @__PURE__ */ t(
1243
- J,
1553
+ /* @__PURE__ */ n(
1554
+ o2,
1244
1555
  {
1245
- name: s,
1246
- ...l && { iconUrl: l }
1556
+ name: a,
1557
+ ...s && { iconUrl: s }
1247
1558
  }
1248
1559
  )
1249
1560
  ] })
1250
1561
  ] }),
1251
- /* @__PURE__ */ t(
1252
- D,
1562
+ /* @__PURE__ */ n(
1563
+ w,
1253
1564
  {
1254
- className: B("zd:shrink-0 zd:text-body3", we[o]),
1255
- children: o
1565
+ className: q("zd:shrink-0 zd:text-body3", _e[l]),
1566
+ children: l
1256
1567
  }
1257
1568
  )
1258
1569
  ] })
@@ -1261,32 +1572,32 @@ function Ce({
1261
1572
  }
1262
1573
  );
1263
1574
  }
1264
- function J({ name: e, iconUrl: n }) {
1575
+ function o2({ name: e, iconUrl: t }) {
1265
1576
  return /* @__PURE__ */ c("div", { className: "zd:flex zd:min-w-0 zd:items-center zd:gap-[5px]", children: [
1266
- n && /* @__PURE__ */ t("span", { className: "zd:size-3 zd:shrink-0 zd:overflow-hidden zd:rounded-full zd:bg-white", children: /* @__PURE__ */ t(
1577
+ t && /* @__PURE__ */ n("span", { className: "zd:size-3 zd:shrink-0 zd:overflow-hidden zd:rounded-full zd:bg-white", children: /* @__PURE__ */ n(
1267
1578
  "img",
1268
1579
  {
1269
- src: n,
1580
+ src: t,
1270
1581
  alt: "",
1271
1582
  "aria-hidden": !0,
1272
1583
  className: "zd:size-full zd:object-cover"
1273
1584
  }
1274
1585
  ) }),
1275
- /* @__PURE__ */ t(D, { className: "zd:truncate zd:text-body3", children: e })
1586
+ /* @__PURE__ */ n(w, { className: "zd:truncate zd:text-body3", children: e })
1276
1587
  ] });
1277
1588
  }
1278
- const _ = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png", X = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/base/info/logo.png", A = 3600 * 1e3, Ee = [
1589
+ const B = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png", a2 = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/base/info/logo.png", I = 3600 * 1e3, Ge = [
1279
1590
  {
1280
1591
  id: "mock-1",
1281
1592
  icon: "arrowSwapHorizontalOutline",
1282
1593
  title: "Swapped ETH → USD₮0",
1283
1594
  value: "2,343 ETH",
1284
1595
  chainName: "Arbitrum One",
1285
- chainIconUrl: _,
1596
+ chainIconUrl: B,
1286
1597
  destChainName: "Base",
1287
- destChainIconUrl: X,
1598
+ destChainIconUrl: a2,
1288
1599
  status: "Pending",
1289
- timestamp: Date.now() - 1 * A
1600
+ timestamp: Date.now() - 1 * I
1290
1601
  },
1291
1602
  {
1292
1603
  id: "mock-2",
@@ -1294,11 +1605,11 @@ const _ = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchai
1294
1605
  title: "Swapped ETH → USD₮0",
1295
1606
  value: "2,343 ETH",
1296
1607
  chainName: "Arbitrum One",
1297
- chainIconUrl: _,
1608
+ chainIconUrl: B,
1298
1609
  destChainName: "Base",
1299
- destChainIconUrl: X,
1610
+ destChainIconUrl: a2,
1300
1611
  status: "Pending",
1301
- timestamp: Date.now() - 2 * A
1612
+ timestamp: Date.now() - 2 * I
1302
1613
  },
1303
1614
  {
1304
1615
  id: "mock-3",
@@ -1306,9 +1617,9 @@ const _ = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchai
1306
1617
  title: "Fixed Yield",
1307
1618
  value: "2,323 PT wstETH (25 Jan 2026)",
1308
1619
  chainName: "Arbitrum One",
1309
- chainIconUrl: _,
1620
+ chainIconUrl: B,
1310
1621
  status: "Success",
1311
- timestamp: Date.now() - 3 * A
1622
+ timestamp: Date.now() - 3 * I
1312
1623
  },
1313
1624
  {
1314
1625
  id: "mock-4",
@@ -1316,9 +1627,9 @@ const _ = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchai
1316
1627
  title: "Received NFT",
1317
1628
  value: "Bored Ape Yacht Club",
1318
1629
  chainName: "Arbitrum One",
1319
- chainIconUrl: _,
1630
+ chainIconUrl: B,
1320
1631
  status: "Success",
1321
- timestamp: Date.now() - 4 * A
1632
+ timestamp: Date.now() - 4 * I
1322
1633
  },
1323
1634
  {
1324
1635
  id: "mock-5",
@@ -1326,9 +1637,9 @@ const _ = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchai
1326
1637
  title: "Collateral Used",
1327
1638
  value: "Collateralization enabled for USD₮0",
1328
1639
  chainName: "Arbitrum One",
1329
- chainIconUrl: _,
1640
+ chainIconUrl: B,
1330
1641
  status: "Success",
1331
- timestamp: Date.now() - 336 * A
1642
+ timestamp: Date.now() - 336 * I
1332
1643
  },
1333
1644
  {
1334
1645
  id: "mock-6",
@@ -1336,64 +1647,64 @@ const _ = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchai
1336
1647
  title: "Liquid Staked ETH",
1337
1648
  value: "2,323 PT wstETH (25 Jan 2026)",
1338
1649
  chainName: "Arbitrum One",
1339
- chainIconUrl: _,
1650
+ chainIconUrl: B,
1340
1651
  status: "Success",
1341
- timestamp: Date.now() - 336 * A - 1 * A
1652
+ timestamp: Date.now() - 336 * I - 1 * I
1342
1653
  }
1343
1654
  ];
1344
- function R(e) {
1345
- const n = new Date(e);
1346
- return `${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`;
1655
+ function j(e) {
1656
+ const t = new Date(e);
1657
+ return `${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`;
1347
1658
  }
1348
- function Fe(e, n) {
1349
- const r = R(e);
1350
- return r === R(n) ? "Today" : r === R(n - 1440 * 60 * 1e3) ? "Yesterday" : new Intl.DateTimeFormat("en-US", {
1659
+ function Ve(e, t) {
1660
+ const r = j(e);
1661
+ return r === j(t) ? "Today" : r === j(t - 1440 * 60 * 1e3) ? "Yesterday" : new Intl.DateTimeFormat("en-US", {
1351
1662
  month: "long",
1352
1663
  day: "numeric",
1353
1664
  year: "numeric"
1354
1665
  }).format(new Date(e));
1355
1666
  }
1356
- function xe(e, n = Date.now()) {
1357
- var s;
1358
- const r = [...e].sort((l, o) => o.timestamp - l.timestamp), a = [];
1359
- let i = null;
1360
- for (const l of r) {
1361
- const o = R(l.timestamp);
1362
- o !== i && (i = o, a.push({ label: Fe(l.timestamp, n), entries: [] })), (s = a[a.length - 1]) == null || s.entries.push(l);
1667
+ function je(e, t = Date.now()) {
1668
+ var a;
1669
+ const r = [...e].sort((s, l) => l.timestamp - s.timestamp), i = [];
1670
+ let o = null;
1671
+ for (const s of r) {
1672
+ const l = j(s.timestamp);
1673
+ l !== o && (o = l, i.push({ label: Ve(s.timestamp, t), entries: [] })), (a = i[i.length - 1]) == null || a.entries.push(s);
1363
1674
  }
1364
- return a;
1675
+ return i;
1365
1676
  }
1366
- function ye({
1367
- entries: e = Ee,
1368
- onSelectEntry: n
1677
+ function qe({
1678
+ entries: e = Ge,
1679
+ onSelectEntry: t
1369
1680
  }) {
1370
- const r = xe(e);
1371
- return /* @__PURE__ */ t("div", { className: "zd:flex zd:h-full zd:w-full zd:flex-col zd:gap-1 zd:pt-2 zd:pb-4", children: /* @__PURE__ */ t(
1372
- e2,
1681
+ const r = je(e);
1682
+ return /* @__PURE__ */ n("div", { className: "zd:flex zd:h-full zd:w-full zd:flex-col zd:gap-1 zd:pt-2 zd:pb-4", children: /* @__PURE__ */ n(
1683
+ c2,
1373
1684
  {
1374
1685
  variant: "ghost",
1375
1686
  className: "zd:flex zd:w-full zd:flex-1 zd:flex-col zd:gap-1 zd:overflow-y-auto zd:rounded-2xl zd:p-2",
1376
- children: r.map((a) => /* @__PURE__ */ c(y2, { children: [
1377
- /* @__PURE__ */ t("div", { className: "zd:flex zd:w-full zd:items-center zd:py-2 zd:pr-2", children: /* @__PURE__ */ t(D, { className: "zd:text-body3", children: a.label }) }),
1378
- a.entries.map(
1379
- (i) => n ? /* @__PURE__ */ t(
1687
+ children: r.map((i) => /* @__PURE__ */ c(M2, { children: [
1688
+ /* @__PURE__ */ n("div", { className: "zd:flex zd:w-full zd:items-center zd:py-2 zd:pr-2", children: /* @__PURE__ */ n(w, { className: "zd:text-body3", children: i.label }) }),
1689
+ i.entries.map(
1690
+ (o) => t ? /* @__PURE__ */ n(
1380
1691
  "button",
1381
1692
  {
1382
1693
  type: "button",
1383
- onClick: () => n(i),
1694
+ onClick: () => t(o),
1384
1695
  className: "zd:w-full zd:cursor-pointer zd:text-left",
1385
- children: /* @__PURE__ */ t(Q, { entry: i })
1696
+ children: /* @__PURE__ */ n(s2, { entry: o })
1386
1697
  },
1387
- i.id
1388
- ) : /* @__PURE__ */ t(Q, { entry: i }, i.id)
1698
+ o.id
1699
+ ) : /* @__PURE__ */ n(s2, { entry: o }, o.id)
1389
1700
  )
1390
- ] }, a.label))
1701
+ ] }, i.label))
1391
1702
  }
1392
1703
  ) });
1393
1704
  }
1394
- function Q({ entry: e }) {
1395
- return /* @__PURE__ */ t(
1396
- Ce,
1705
+ function s2({ entry: e }) {
1706
+ return /* @__PURE__ */ n(
1707
+ Ze,
1397
1708
  {
1398
1709
  icon: e.icon,
1399
1710
  title: e.title,
@@ -1408,43 +1719,82 @@ function Q({ entry: e }) {
1408
1719
  }
1409
1720
  );
1410
1721
  }
1411
- const ve = {
1722
+ const Ke = {
1412
1723
  history: "History"
1413
1724
  };
1414
- function Oe({
1725
+ function st({
1415
1726
  onClose: e,
1416
- entries: n,
1727
+ entries: t,
1417
1728
  onSelectEntry: r,
1418
- className: a,
1419
- size: i
1729
+ className: i,
1730
+ size: o
1420
1731
  }) {
1421
- const [s] = C("history"), l = () => {
1422
- switch (s) {
1732
+ const [a] = E("history"), s = () => {
1733
+ switch (a) {
1423
1734
  case "history":
1424
- return /* @__PURE__ */ t(
1425
- ye,
1735
+ return /* @__PURE__ */ n(
1736
+ qe,
1426
1737
  {
1427
- ...n && { entries: n },
1738
+ ...t && { entries: t },
1428
1739
  ...r && { onSelectEntry: r }
1429
1740
  }
1430
1741
  );
1431
1742
  }
1432
1743
  };
1433
- return /* @__PURE__ */ t(
1434
- i2,
1744
+ return /* @__PURE__ */ n(
1745
+ g2,
1435
1746
  {
1436
- ...a && { className: a },
1437
- ...i && { size: i },
1438
- topNav: /* @__PURE__ */ t(a2, { title: ve[s], onRightButtonClick: e }),
1439
- children: l()
1747
+ ...i && { className: i },
1748
+ ...o && { size: o },
1749
+ topNav: /* @__PURE__ */ n(z2, { title: Ke[a], onRightButtonClick: e }),
1750
+ children: s()
1440
1751
  }
1441
1752
  );
1442
1753
  }
1754
+ const b2 = "WALLETCONNECT_DEEPLINK_CHOICE", l2 = /* @__PURE__ */ new WeakSet();
1755
+ function d2(e) {
1756
+ var i, o, a;
1757
+ const t = (o = (i = e.session) == null ? void 0 : i.peer) == null ? void 0 : o.metadata, r = (a = t == null ? void 0 : t.redirect) == null ? void 0 : a.native;
1758
+ if (!r || !x2()) {
1759
+ k2();
1760
+ return;
1761
+ }
1762
+ try {
1763
+ localStorage.setItem(
1764
+ b2,
1765
+ JSON.stringify({ href: r, name: (t == null ? void 0 : t.name) ?? "" })
1766
+ );
1767
+ } catch {
1768
+ }
1769
+ }
1770
+ function k2() {
1771
+ try {
1772
+ localStorage.removeItem(b2);
1773
+ } catch {
1774
+ }
1775
+ }
1776
+ function Je(e) {
1777
+ l2.has(e) || (l2.add(e), e.on("connect", () => d2(e)), e.on("disconnect", k2), e.session && d2(e));
1778
+ }
1779
+ function lt(e) {
1780
+ if (!e.projectId)
1781
+ throw new Error("zeroDevWalletConnect requires a WalletConnect projectId");
1782
+ const t = K2({ ...e, showQrModal: !1 });
1783
+ return (r) => {
1784
+ const i = Object.assign(t(r), { zdWalletConnect: !0 }), o = i.getProvider.bind(i);
1785
+ return i.getProvider = async (...a) => {
1786
+ const s = await o(...a);
1787
+ return Je(s), s;
1788
+ }, i;
1789
+ };
1790
+ }
1443
1791
  export {
1444
- _e as ConnectWallet,
1445
- oe as SignUp,
1446
- Oe as TxHistory,
1447
- F as useAuth,
1448
- Le as zeroDevWallet
1792
+ rt as ConnectWallet,
1793
+ be as SignUp,
1794
+ st as TxHistory,
1795
+ S as useAuth,
1796
+ ot as useWalletInfo,
1797
+ at as zeroDevWallet,
1798
+ lt as zeroDevWalletConnect
1449
1799
  };
1450
1800
  //# sourceMappingURL=index.mjs.map