@zerodev/wallet-react-ui 0.0.8 → 0.0.9

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.
package/dist/index.mjs CHANGED
@@ -1,81 +1,81 @@
1
- import { jsxs as p, jsx as t, Fragment as v } from "react/jsx-runtime";
2
- import { Text as z, cn as j, PoweredBy as O, Button as S, Wrapper as a2, Input as o2, Icon as q, ListItem as T, ListItemChevron as P, ListItemIcon as $, Badge as K, BottomSheet as s2, BottomSheetContent as l2, BottomSheetTitle as d2, BottomSheetClose as c2, Screen as u2, TopNav as p2 } from "@zerodev/react-ui";
3
- import { useState as E, useEffect as N, useMemo as f2, useRef as X, createContext as h2, useContext as m2, useLayoutEffect as g2, useCallback as D2 } from "react";
4
- import { useStore as M, create as z2 } from "zustand";
5
- import { useConfig as C2, useConnectors as Z, useConnect as G } from "wagmi";
6
- import { useSendMagicLink as J, useSendOTP as Y, useVerifyOTP as E2, useAuthenticateOAuth as w2, useRegisterPasskey as F2, useLoginPasskey as x2, useVerifyMagicLink as y2, zeroDevWallet as v2, NotAuthenticatedError as S2 } from "@zerodev/wallet-react";
7
- import { subscribeWithSelector as A2 } from "zustand/middleware";
8
- const b2 = "" + new URL("error.webp", import.meta.url).href, k2 = "" + new URL("loading.webp", import.meta.url).href, N2 = "" + new URL("send.webp", import.meta.url).href, _2 = "" + new URL("success.webp", import.meta.url).href, L2 = {
9
- error: b2,
10
- loading: k2,
11
- send: N2,
12
- success: _2
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
13
13
  };
14
- function b({
14
+ function N({
15
15
  imageName: e,
16
16
  title: n,
17
- children: a,
18
- className: r
17
+ children: r,
18
+ className: a
19
19
  }) {
20
- return /* @__PURE__ */ p(
20
+ return /* @__PURE__ */ c(
21
21
  "div",
22
22
  {
23
- className: j("zd:flex zd:flex-col zd:gap-8 zd:items-center", r),
23
+ className: B("zd:flex zd:flex-col zd:gap-8 zd:items-center", a),
24
24
  children: [
25
25
  /* @__PURE__ */ t(
26
26
  "img",
27
27
  {
28
- src: L2[e],
28
+ src: P2[e],
29
29
  alt: e,
30
30
  className: "zd:w-[118px] zd:h-[118px] zd:bg-transparent"
31
31
  }
32
32
  ),
33
- /* @__PURE__ */ p("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:items-center", children: [
34
- /* @__PURE__ */ t(z, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children: n }),
35
- /* @__PURE__ */ t(z, { className: "zd:text-center zd:whitespace-pre-wrap", children: a })
33
+ /* @__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 })
36
36
  ] })
37
37
  ]
38
38
  }
39
39
  );
40
40
  }
41
- function M2() {
42
- const n = C2().connectors.find((a) => a.id === "zerodev-wallet");
41
+ function R2() {
42
+ const n = S2().connectors.find((r) => r.id === "zerodev-wallet");
43
43
  if (!n || !("getKitStore" in n))
44
44
  throw new Error("useKitStore must be used with the zeroDevWallet connector");
45
45
  return n.getKitStore();
46
46
  }
47
47
  function F() {
48
- const e = M2(), n = M(e, (s) => s.auth.step), a = M(e, (s) => s.auth.stepHistory), r = M(e, (s) => s.auth.email), i = M(e, (s) => s.auth.otpId), o = M(
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(
49
49
  e,
50
- (s) => s.auth.otpEncryptionTargetBundle
50
+ (l) => l.auth.otpEncryptionTargetBundle
51
51
  );
52
52
  return {
53
53
  step: n,
54
- email: r,
54
+ email: a,
55
55
  otpId: i,
56
- otpEncryptionTargetBundle: o,
56
+ otpEncryptionTargetBundle: s,
57
57
  goToStep: e.getState().auth.goToStep,
58
- goBack: a.length > 0 ? e.getState().auth.goBack : null,
58
+ goBack: r.length > 0 ? e.getState().auth.goBack : null,
59
59
  reset: e.getState().auth.reset,
60
60
  setEmail: e.getState().auth.setEmail,
61
61
  setOtpSession: e.getState().auth.setOtpSession,
62
62
  clearOtpSession: e.getState().auth.clearOtpSession
63
63
  };
64
64
  }
65
- function U2() {
66
- const { email: e, setOtpSession: n } = F(), { mutateAsync: a, isPending: r } = J(), [i, o] = E(60), s = i <= 0 && !r;
67
- return N(() => {
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
68
  if (i <= 0) return;
69
- const f = setInterval(() => {
70
- o((m) => Math.max(0, m - 1));
69
+ const p = setInterval(() => {
70
+ s((m) => Math.max(0, m - 1));
71
71
  }, 1e3);
72
72
  return () => {
73
- clearInterval(f);
73
+ clearInterval(p);
74
74
  };
75
- }, [i]), /* @__PURE__ */ p(v, { children: [
76
- /* @__PURE__ */ p("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
77
- /* @__PURE__ */ p(
78
- b,
75
+ }, [i]), /* @__PURE__ */ c(x, { children: [
76
+ /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
77
+ /* @__PURE__ */ c(
78
+ N,
79
79
  {
80
80
  imageName: "send",
81
81
  title: `Check your email!
@@ -83,222 +83,222 @@ function U2() {
83
83
  children: [
84
84
  "We've sent a magic link to",
85
85
  " ",
86
- /* @__PURE__ */ t(z, { as: "span", className: "zd:text-solarOrange", children: e }),
86
+ /* @__PURE__ */ t(D, { as: "span", className: "zd:text-solarOrange", children: e }),
87
87
  `
88
88
  `,
89
89
  "Please open the email and click the link to log in."
90
90
  ]
91
91
  }
92
92
  ),
93
- /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ p(z, { className: "zd:text-center", children: [
93
+ /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(D, { className: "zd:text-center", children: [
94
94
  "Did not get an email?",
95
95
  " ",
96
96
  /* @__PURE__ */ t(
97
97
  "button",
98
98
  {
99
99
  type: "button",
100
- disabled: !s,
100
+ disabled: !l,
101
101
  onClick: async () => {
102
- if (!(!e || !s))
102
+ if (!(!e || !l))
103
103
  try {
104
- const { otpId: f, otpEncryptionTargetBundle: m } = await a({
104
+ const { otpId: p, otpEncryptionTargetBundle: m } = await r({
105
105
  email: e
106
106
  });
107
- n({ otpId: f, otpEncryptionTargetBundle: m }), o(60);
107
+ n({ otpId: p, otpEncryptionTargetBundle: m }), s(60);
108
108
  } catch {
109
109
  }
110
110
  },
111
111
  className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
112
- children: s ? "Resend" : `Resend in ${i} ${i === 1 ? "second" : "seconds"}`
112
+ children: l ? "Resend" : `Resend in ${i} ${i === 1 ? "second" : "seconds"}`
113
113
  }
114
114
  )
115
115
  ] }) })
116
116
  ] }),
117
- /* @__PURE__ */ t(O, { className: "zd:self-center zd:pt-4 zd:pb-6" })
117
+ /* @__PURE__ */ t(H, { className: "zd:self-center zd:pt-4 zd:pb-6" })
118
118
  ] });
119
119
  }
120
- function T2() {
120
+ function Z2() {
121
121
  return typeof window > "u" ? !1 : new URLSearchParams(window.location.search).has("code");
122
122
  }
123
- function U() {
123
+ function I() {
124
124
  if (typeof window > "u") return;
125
125
  const e = new URL(window.location.href);
126
126
  e.searchParams.has("code") && (e.searchParams.delete("code"), window.history.replaceState(null, "", e.toString()));
127
127
  }
128
- function O2({
128
+ function G2({
129
129
  title: e = "Oops, something went wrong",
130
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
- showRetry: a = !1,
132
- showChooseAnother: r = !0
131
+ showRetry: r = !1,
132
+ showChooseAnother: a = !0
133
133
  }) {
134
- const { goToStep: i, goBack: o, reset: s } = F();
135
- return /* @__PURE__ */ p(v, { children: [
136
- /* @__PURE__ */ p("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
137
- /* @__PURE__ */ t(b, { imageName: "error", title: e, children: n }),
138
- /* @__PURE__ */ p("div", { className: "zd:flex zd:flex-col zd:gap-1", children: [
139
- a && /* @__PURE__ */ t(S, { action: "primary", text: "Try again", onClick: o ?? (() => i("sign-up")) }),
140
- r && /* @__PURE__ */ t(
134
+ const { goToStep: i, goBack: s, reset: l } = F();
135
+ return /* @__PURE__ */ c(x, { children: [
136
+ /* @__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__ */ 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
141
  S,
142
142
  {
143
- action: a ? "secondary" : "primary",
143
+ action: r ? "secondary" : "primary",
144
144
  onClick: () => {
145
- U(), i("sign-up");
145
+ I(), i("sign-up");
146
146
  },
147
147
  text: "Choose another sign-in method"
148
148
  }
149
149
  ),
150
- !a && !r && /* @__PURE__ */ t(S, { action: "primary", text: "Start over", onClick: s })
150
+ !r && !a && /* @__PURE__ */ t(S, { action: "primary", text: "Start over", onClick: l })
151
151
  ] })
152
152
  ] }),
153
- /* @__PURE__ */ t(O, { className: "zd:self-center zd:pt-4 zd:pb-6" })
153
+ /* @__PURE__ */ t(H, { className: "zd:self-center zd:pt-4 zd:pb-6" })
154
154
  ] });
155
155
  }
156
- const I2 = 4, H2 = 8, P2 = 6;
157
- function R2(e) {
158
- return Math.max(I2, Math.min(H2, e));
156
+ const V2 = 4, W2 = 8, j2 = 6;
157
+ function $2(e) {
158
+ return Math.max(V2, Math.min(W2, e));
159
159
  }
160
- function B2({ char: e, isFocused: n }) {
160
+ function q2({ char: e, isFocused: n }) {
161
161
  return /* @__PURE__ */ t(
162
- a2,
162
+ e2,
163
163
  {
164
164
  "data-testid": "code-input-box",
165
165
  "data-active": n || void 0,
166
- className: j(
166
+ className: B(
167
167
  "zd:h-16 zd:w-14 zd:rounded-lg zd:flex zd:items-center zd:justify-center",
168
168
  n && "zd:border-[1.5px] zd:border-greyScale"
169
169
  ),
170
- children: /* @__PURE__ */ t(z, { className: "zd:text-h2", children: e })
170
+ children: /* @__PURE__ */ t(D, { className: "zd:text-h2", children: e })
171
171
  }
172
172
  );
173
173
  }
174
- function Z2({
174
+ function K2({
175
175
  onChange: e,
176
176
  onComplete: n,
177
- disabled: a = !1,
178
- error: r = !1,
177
+ disabled: r = !1,
178
+ error: a = !1,
179
179
  autoFocus: i = !1,
180
- length: o = P2,
181
- "data-testid": s
180
+ length: s = j2,
181
+ "data-testid": l
182
182
  }) {
183
- const c = R2(o), f = f2(
184
- () => Array.from({ length: c }, (d, D) => ({
185
- id: `char-${D}`,
186
- index: D
183
+ const o = $2(s), p = w2(
184
+ () => Array.from({ length: o }, (u, z) => ({
185
+ id: `char-${z}`,
186
+ index: z
187
187
  })),
188
- [c]
189
- ), [m, g] = E(""), [w, u] = E(!1), l = X(null);
190
- N(() => {
191
- var d;
192
- i && !a && ((d = l.current) == null || d.focus());
193
- }, [i, a]), N(() => {
194
- g((d) => d.slice(0, c));
195
- }, [c]);
196
- const h = (d) => {
197
- const D = d.slice(0, c).toUpperCase();
198
- g(D), e == null || e(D), D.length === c && setTimeout(() => {
199
- var C;
200
- n == null || n(D), (C = l.current) == null || C.blur();
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();
201
201
  }, 0);
202
202
  };
203
- return /* @__PURE__ */ p(
203
+ return /* @__PURE__ */ c(
204
204
  "button",
205
205
  {
206
206
  type: "button",
207
207
  className: "zd:flex zd:flex-row zd:items-center zd:justify-between zd:gap-2 zd:w-full zd:cursor-text",
208
208
  onClick: () => {
209
- var d;
210
- return (d = l.current) == null ? void 0 : d.focus();
209
+ var u;
210
+ return (u = d.current) == null ? void 0 : u.focus();
211
211
  },
212
- disabled: a,
213
- "data-testid": s,
212
+ disabled: r,
213
+ "data-testid": l,
214
214
  children: [
215
215
  /* @__PURE__ */ t(
216
216
  "input",
217
217
  {
218
- ref: l,
218
+ ref: d,
219
219
  value: m,
220
- onChange: (d) => h(d.target.value),
221
- onFocus: () => u(!0),
222
- onBlur: () => u(!1),
223
- maxLength: c,
224
- disabled: a,
220
+ onChange: (u) => f(u.target.value),
221
+ onFocus: () => h(!0),
222
+ onBlur: () => h(!1),
223
+ maxLength: o,
224
+ disabled: r,
225
225
  className: "zd:absolute zd:opacity-0 zd:pointer-events-none",
226
226
  style: { position: "absolute", opacity: 0 },
227
227
  "aria-label": "Verification code"
228
228
  }
229
229
  ),
230
- f.map((d) => /* @__PURE__ */ t(
231
- B2,
230
+ p.map((u) => /* @__PURE__ */ t(
231
+ q2,
232
232
  {
233
- char: m[d.index] ?? "",
234
- isFocused: !r && w && d.index === m.length
233
+ char: m[u.index] ?? "",
234
+ isFocused: !a && E && u.index === m.length
235
235
  },
236
- d.id
236
+ u.id
237
237
  ))
238
238
  ]
239
239
  }
240
240
  );
241
241
  }
242
- function G2() {
242
+ function Y2() {
243
243
  const {
244
244
  email: e,
245
245
  otpId: n,
246
- otpEncryptionTargetBundle: a,
247
- setOtpSession: r,
246
+ otpEncryptionTargetBundle: r,
247
+ setOtpSession: a,
248
248
  clearOtpSession: i,
249
- goToStep: o
250
- } = F(), { mutateAsync: s, isPending: c } = Y(), { mutateAsync: f, isPending: m } = E2(), [g, w] = E(""), [u, l] = E(!1), [h, d] = E(60);
251
- N(() => {
252
- if (h <= 0) return;
253
- const y = setInterval(() => {
254
- d((R) => Math.max(0, R - 1));
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;
253
+ const v = setInterval(() => {
254
+ u((W) => Math.max(0, W - 1));
255
255
  }, 1e3);
256
- return () => clearInterval(y);
257
- }, [h]);
258
- const D = async () => {
259
- if (!(!g.trim() || !n || !a)) {
260
- l(!1);
256
+ return () => clearInterval(v);
257
+ }, [f]);
258
+ const z = async () => {
259
+ if (!(!g.trim() || !n || !r)) {
260
+ d(!1);
261
261
  try {
262
- await f({
262
+ await p({
263
263
  otpId: n,
264
264
  code: g.trim(),
265
- otpEncryptionTargetBundle: a
266
- }), i(), o("authenticated");
265
+ otpEncryptionTargetBundle: r
266
+ }), i(), s("authenticated");
267
267
  } catch {
268
- l(!0);
268
+ d(!0);
269
269
  }
270
270
  }
271
- }, C = (y) => {
272
- w(y);
273
- }, x = async () => {
274
- if (!(!e || h > 0 || c))
271
+ }, w = (v) => {
272
+ E(v);
273
+ }, y = async () => {
274
+ if (!(!e || f > 0 || o))
275
275
  try {
276
- const { otpId: y, otpEncryptionTargetBundle: R } = await s({ email: e });
277
- r({
278
- otpId: y,
279
- otpEncryptionTargetBundle: R
280
- }), d(60), l(!1);
276
+ const { otpId: v, otpEncryptionTargetBundle: W } = await l({ email: e });
277
+ a({
278
+ otpId: v,
279
+ otpEncryptionTargetBundle: W
280
+ }), u(60), d(!1);
281
281
  } catch {
282
- l(!0);
282
+ d(!0);
283
283
  }
284
- }, A = h <= 0 && !c;
285
- return /* @__PURE__ */ p(v, { children: [
286
- /* @__PURE__ */ p("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center", children: [
287
- /* @__PURE__ */ p("div", { className: "zd:flex zd:flex-col zd:gap-4", children: [
288
- /* @__PURE__ */ t(z, { className: "zd:text-h2 zd:text-center", children: "Enter verification code" }),
289
- /* @__PURE__ */ p(z, { className: "zd:text-center", children: [
284
+ }, b = f <= 0 && !o;
285
+ return /* @__PURE__ */ c(x, { children: [
286
+ /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center", children: [
287
+ /* @__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: [
290
290
  "Enter the code from the email we sent to",
291
291
  " ",
292
- /* @__PURE__ */ t(z, { className: "zd:text-solarOrange", children: e })
292
+ /* @__PURE__ */ t(D, { className: "zd:text-solarOrange", children: e })
293
293
  ] })
294
294
  ] }),
295
295
  /* @__PURE__ */ t(
296
- Z2,
296
+ K2,
297
297
  {
298
- onComplete: C,
299
- onChange: () => l(!1),
298
+ onComplete: w,
299
+ onChange: () => d(!1),
300
300
  disabled: m,
301
- error: u,
301
+ error: h,
302
302
  autoFocus: !0
303
303
  }
304
304
  ),
@@ -306,37 +306,37 @@ function G2() {
306
306
  S,
307
307
  {
308
308
  text: "Confirm code",
309
- onClick: D,
309
+ onClick: z,
310
310
  disabled: !g.trim() || m
311
311
  }
312
312
  ),
313
- /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ p(z, { className: "zd:text-center", children: [
313
+ /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(D, { className: "zd:text-center", children: [
314
314
  "Did not get an email?",
315
315
  " ",
316
316
  /* @__PURE__ */ t(
317
317
  "button",
318
318
  {
319
319
  type: "button",
320
- disabled: !A,
321
- onClick: x,
320
+ disabled: !b,
321
+ onClick: y,
322
322
  className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
323
- children: A ? "Resend" : `Resend in ${h} ${h === 1 ? "second" : "seconds"}`
323
+ children: b ? "Resend" : `Resend in ${f} ${f === 1 ? "second" : "seconds"}`
324
324
  }
325
325
  )
326
326
  ] }) })
327
327
  ] }),
328
- /* @__PURE__ */ t(O, { className: "zd:self-center zd:pt-4 zd:pb-6" })
328
+ /* @__PURE__ */ t(H, { className: "zd:self-center zd:pt-4 zd:pb-6" })
329
329
  ] });
330
330
  }
331
- function V2({
331
+ function J2({
332
332
  termsAndConditionsUrl: e,
333
333
  privacyPolicyUrl: n,
334
- agreedToTerms: a,
335
- setAgreedToTerms: r,
334
+ agreedToTerms: r,
335
+ setAgreedToTerms: a,
336
336
  highlight: i = !1
337
337
  }) {
338
- return /* @__PURE__ */ p("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-5", children: [
339
- !!(e || n) && /* @__PURE__ */ p(
338
+ return /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-5", children: [
339
+ !!(e || n) && /* @__PURE__ */ c(
340
340
  "div",
341
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"}`,
@@ -345,16 +345,16 @@ function V2({
345
345
  "input",
346
346
  {
347
347
  type: "checkbox",
348
- checked: a,
349
- onChange: (s) => r(s.target.checked),
348
+ checked: r,
349
+ onChange: (l) => a(l.target.checked),
350
350
  className: "zd:cursor-pointer zd:[color-scheme:light]"
351
351
  }
352
352
  ),
353
- /* @__PURE__ */ p(z, { className: "zd:flex-1", children: [
353
+ /* @__PURE__ */ c(D, { className: "zd:flex-1", children: [
354
354
  "I agree to the",
355
355
  " ",
356
356
  e && /* @__PURE__ */ t(
357
- z,
357
+ D,
358
358
  {
359
359
  as: "a",
360
360
  href: e,
@@ -366,7 +366,7 @@ function V2({
366
366
  ),
367
367
  e && n && " and ",
368
368
  n && /* @__PURE__ */ t(
369
- z,
369
+ D,
370
370
  {
371
371
  as: "a",
372
372
  href: n,
@@ -380,17 +380,17 @@ function V2({
380
380
  ]
381
381
  }
382
382
  ),
383
- /* @__PURE__ */ t(O, {})
383
+ /* @__PURE__ */ t(H, {})
384
384
  ] });
385
385
  }
386
- const W2 = "" + new URL("blob.webm", import.meta.url).href;
387
- function j2({ className: e }) {
386
+ const X2 = "" + new URL("blob.webm", import.meta.url).href;
387
+ function Q2({ className: e }) {
388
388
  return /* @__PURE__ */ t(
389
389
  "video",
390
390
  {
391
391
  className: e,
392
392
  style: { aspectRatio: "1 / 1" },
393
- src: W2,
393
+ src: X2,
394
394
  autoPlay: !0,
395
395
  loop: !0,
396
396
  muted: !0,
@@ -400,108 +400,108 @@ function j2({ className: e }) {
400
400
  }
401
401
  );
402
402
  }
403
- const Q = h2(null);
404
- function _() {
405
- const e = m2(Q);
403
+ const o2 = C2(null);
404
+ function T() {
405
+ const e = E2(o2);
406
406
  if (!e)
407
407
  throw new Error("SignUp.* components must be rendered inside <SignUp>");
408
408
  return e;
409
409
  }
410
410
  function L(e) {
411
- const { setAuthPending: n } = _();
412
- N(() => (n(e), () => n(!1)), [e, n]);
411
+ const { setAuthPending: n } = T();
412
+ U(() => (n(e), () => n(!1)), [e, n]);
413
413
  }
414
- const q2 = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
415
- function B(e) {
416
- return q2.test(e.trim());
414
+ const ee = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
415
+ function j(e) {
416
+ return ee.test(e.trim());
417
417
  }
418
- function e2() {
419
- const { goToStep: e, setEmail: n, setOtpSession: a } = F(), {
420
- authPending: r,
418
+ function d2() {
419
+ const { goToStep: e, setEmail: n, setOtpSession: r } = F(), {
420
+ authPending: a,
421
421
  emailAuthMethod: i,
422
- needsAgreement: o,
423
- guardAgreement: s,
424
- setError: c
425
- } = _(), [f, m] = E(""), g = i === "otp", { mutateAsync: w, isPending: u } = Y(), { mutateAsync: l, isPending: h } = J(), d = u || h;
426
- L(d);
427
- const D = async () => {
428
- if (!(!f || r) && B(f) && s()) {
429
- c(null);
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
430
  try {
431
- const C = g ? w : l, { otpId: x, otpEncryptionTargetBundle: A } = await C({
432
- email: f
431
+ const w = g ? E : d, { otpId: y, otpEncryptionTargetBundle: b } = await w({
432
+ email: p
433
433
  });
434
- n(f), a({ otpId: x, otpEncryptionTargetBundle: A }), e(g ? "otp-input" : "email-verification");
435
- } catch (C) {
436
- c(
437
- C instanceof Error ? C.message : "Failed to send verification code"
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
438
  );
439
439
  }
440
440
  }
441
441
  };
442
442
  return /* @__PURE__ */ t(
443
- o2,
443
+ f2,
444
444
  {
445
445
  iconName: "email",
446
446
  placeholder: "Enter your email",
447
- value: f,
448
- onChange: (C) => m(C.target.value),
447
+ value: p,
448
+ onChange: (w) => m(w.target.value),
449
449
  type: "email",
450
450
  autoCapitalize: "none",
451
451
  autoComplete: "email",
452
- disabled: r,
452
+ disabled: a,
453
453
  variant: "listItemStyle",
454
- onKeyDown: (C) => {
455
- C.key === "Enter" && f && !r && D();
454
+ onKeyDown: (w) => {
455
+ w.key === "Enter" && p && !a && z();
456
456
  },
457
- children: d ? /* @__PURE__ */ t("div", { className: "zd:w-13 zd:h-13 zd:flex zd:items-center zd:justify-center", children: /* @__PURE__ */ t("div", { className: "zd:w-5 zd:h-5 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin" }) }) : /* @__PURE__ */ t(
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
458
  "button",
459
459
  {
460
460
  type: "button",
461
- disabled: !B(f) || o,
462
- className: `zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${B(f) && !o ? "zd:cursor-pointer" : "zd:cursor-not-allowed zd:opacity-50"}`,
463
- onClick: () => D(),
464
- children: /* @__PURE__ */ t(q, { name: "chevronRight", className: "zd:text-greyScale" })
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
465
  }
466
466
  )
467
467
  }
468
468
  );
469
469
  }
470
- function I(e) {
470
+ function P(e) {
471
471
  return e instanceof Error ? e.name === "AbortError" || e.name === "NotAllowedError" || e.name === "UserRejectedRequestError" ? !0 : e.message.toLowerCase().includes("oauth popup was closed") : !1;
472
472
  }
473
- function t2() {
474
- const { goToStep: e } = F(), { authPending: n, guardAgreement: a, setError: r } = _(), { mutateAsync: i, isPending: o } = w2({
473
+ function c2() {
474
+ const { goToStep: e } = F(), { authPending: n, guardAgreement: r, setError: a } = T(), { mutateAsync: i, isPending: s } = A2({
475
475
  mutation: {
476
476
  onSuccess: () => {
477
477
  e("authenticated");
478
478
  }
479
479
  }
480
480
  });
481
- return L(o), /* @__PURE__ */ t(
482
- T,
481
+ return L(s), /* @__PURE__ */ t(
482
+ M,
483
483
  {
484
- icon: /* @__PURE__ */ t($, { name: "google" }),
484
+ icon: /* @__PURE__ */ t(t2, { name: "google" }),
485
485
  title: "Google",
486
- trailing: /* @__PURE__ */ t(P, {}),
486
+ trailing: /* @__PURE__ */ t(V, {}),
487
487
  disabled: n,
488
488
  onClick: async () => {
489
- if (!n && a()) {
490
- r(null);
489
+ if (!n && r()) {
490
+ a(null);
491
491
  try {
492
492
  await i({ provider: "google" });
493
- } catch (c) {
494
- I(c) || r(c instanceof Error ? c.message : String(c));
493
+ } catch (o) {
494
+ P(o) || a(o instanceof Error ? o.message : String(o));
495
495
  }
496
496
  }
497
497
  }
498
498
  }
499
499
  );
500
500
  }
501
- function H(e, n) {
501
+ function G(e, n) {
502
502
  return !!n.rdns && (e.id === n.rdns || (Array.isArray(e.rdns) ? e.rdns.includes(n.rdns) : e.rdns === n.rdns));
503
503
  }
504
- const $2 = [
504
+ const te = [
505
505
  {
506
506
  id: "metamask",
507
507
  name: "MetaMask",
@@ -579,55 +579,55 @@ const $2 = [
579
579
  mobileLink: "bnc://app.binance.com/cedefi/wc?uri=",
580
580
  downloadUrl: "https://www.binance.com/en/download"
581
581
  }
582
- ], k = $2;
583
- function K2({
582
+ ], k = te;
583
+ function ne({
584
584
  excludeWalletIds: e = [],
585
585
  maxWallets: n = 4
586
586
  }) {
587
- const { goToStep: a } = F(), { authPending: r, guardAgreement: i, setError: o, registeredWallets: s } = _(), c = Z(), { mutate: f, isPending: m } = G();
587
+ const { goToStep: r } = F(), { authPending: a, guardAgreement: i, setError: s, registeredWallets: l } = T(), o = $(), { mutate: p, isPending: m } = q();
588
588
  L(m);
589
- const g = c.filter(
590
- (u) => u.type === "injected" && u.id !== "injected" && u.id !== "zerodev-wallet"
591
- ).map((u) => {
592
- const l = k.find((h) => H(u, h));
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));
593
593
  return {
594
- connector: u,
595
- walletId: l == null ? void 0 : l.id,
596
- name: (l == null ? void 0 : l.name) ?? u.name,
597
- icon: (l == null ? void 0 : l.icon) ?? u.icon,
598
- ids: l ? [l.id, u.id] : [u.id],
599
- rank: l ? k.indexOf(l) : k.length
594
+ connector: h,
595
+ 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],
599
+ rank: d ? k.indexOf(d) : k.length
600
600
  };
601
601
  }).filter(
602
- (u) => !(u.walletId && s.includes(u.walletId))
603
- ).filter((u) => !u.ids.some((l) => e.includes(l))).sort((u, l) => u.rank - l.rank).slice(0, n), w = (u) => {
604
- r || i() && (o(null), f(
605
- { connector: u },
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 },
606
606
  {
607
607
  // The external wallet is now the active wagmi connection — the
608
608
  // embedded-wallet flow is done, so close it (mirrors SignUp.Wallet).
609
- onSuccess: () => a(null),
610
- onError: (l) => {
611
- I(l) || o(l instanceof Error ? l.message : String(l));
609
+ onSuccess: () => r(null),
610
+ onError: (d) => {
611
+ P(d) || s(d instanceof Error ? d.message : String(d));
612
612
  }
613
613
  }
614
614
  ));
615
615
  };
616
- return /* @__PURE__ */ t(v, { children: g.map(({ connector: u, name: l, icon: h }) => /* @__PURE__ */ t(
617
- T,
616
+ return /* @__PURE__ */ t(x, { children: g.map(({ connector: h, name: d, icon: f }) => /* @__PURE__ */ t(
617
+ M,
618
618
  {
619
- title: l,
620
- icon: h ? /* @__PURE__ */ t("img", { src: h, alt: "", className: "zd:w-6 zd:h-6" }) : null,
621
- subtitle: /* @__PURE__ */ t(K, { text: "INSTALLED" }),
622
- trailing: /* @__PURE__ */ t(P, {}),
623
- disabled: r,
624
- onClick: () => w(u)
619
+ 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)
625
625
  },
626
- u.uid
626
+ h.uid
627
627
  )) });
628
628
  }
629
- function X2({ tile: e }) {
630
- return /* @__PURE__ */ p(
629
+ function ie({ tile: e }) {
630
+ return /* @__PURE__ */ c(
631
631
  "button",
632
632
  {
633
633
  type: "button",
@@ -635,27 +635,27 @@ function X2({ tile: e }) {
635
635
  className: "zd:flex zd:flex-col zd:items-center zd:gap-1.5 zd:cursor-pointer",
636
636
  children: [
637
637
  /* @__PURE__ */ t("div", { className: "zd:w-16 zd:h-16 zd:rounded-2xl zd:bg-greyScale/5 zd:flex zd:items-center zd:justify-center", children: e.icon ? /* @__PURE__ */ t("img", { src: e.icon, alt: "", className: "zd:w-8 zd:h-8" }) : /* @__PURE__ */ t(
638
- q,
638
+ Z,
639
639
  {
640
640
  name: "walletOutline",
641
641
  className: "zd:w-8 zd:h-8 zd:text-greyScale"
642
642
  }
643
643
  ) }),
644
- /* @__PURE__ */ t(z, { className: "zd:text-body3 zd:max-w-full zd:truncate", children: e.name })
644
+ /* @__PURE__ */ t(D, { className: "zd:text-body3 zd:max-w-full zd:truncate", children: e.name })
645
645
  ]
646
646
  }
647
647
  );
648
648
  }
649
- function J2({
649
+ function ae({
650
650
  open: e,
651
651
  onOpenChange: n,
652
- tiles: a
652
+ tiles: r
653
653
  }) {
654
- return /* @__PURE__ */ t(s2, { open: e, onOpenChange: n, children: /* @__PURE__ */ p(l2, { className: "zd:p-4", children: [
655
- /* @__PURE__ */ t(d2, { children: "All wallets" }),
656
- /* @__PURE__ */ p("div", { className: "zd:mb-3 zd:flex zd:items-center zd:gap-2", children: [
657
- /* @__PURE__ */ t(z, { className: "zd:text-h3 zd:flex-1", children: "All wallets" }),
658
- /* @__PURE__ */ t(c2, { asChild: !0, children: /* @__PURE__ */ t(
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" }),
656
+ /* @__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(
659
659
  "button",
660
660
  {
661
661
  type: "button",
@@ -665,87 +665,87 @@ function J2({
665
665
  }
666
666
  ) })
667
667
  ] }),
668
- /* @__PURE__ */ t("div", { className: "zd:grid zd:grid-cols-3 zd:gap-3 zd:max-h-80 zd:overflow-y-auto", children: a.map((r) => /* @__PURE__ */ t(X2, { tile: r }, r.key)) })
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)) })
669
669
  ] }) });
670
670
  }
671
- function Y2({
671
+ function re({
672
672
  title: e = "More wallets"
673
673
  }) {
674
- const { goToStep: n } = F(), { authPending: a, guardAgreement: r, setError: i } = _(), [o, s] = E(!1), c = Z(), { mutate: f, isPending: m } = G();
674
+ const { goToStep: n } = F(), { authPending: r, guardAgreement: a, setError: i } = T(), [s, l] = C(!1), o = $(), { mutate: p, isPending: m } = q();
675
675
  L(m);
676
- const g = c.filter(
677
- (d) => d.id !== "zerodev-wallet" && d.type !== "walletConnect"
678
- ), w = (d) => {
679
- a || r() && (s(!1), i(null), f(
680
- { connector: d },
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 },
681
681
  {
682
682
  // The external wallet is now the active wagmi connection — the
683
683
  // embedded-wallet flow is done, so close it.
684
684
  onSuccess: () => n(null),
685
- onError: (D) => {
686
- I(D) || i(D instanceof Error ? D.message : String(D));
685
+ onError: (z) => {
686
+ P(z) || i(z instanceof Error ? z.message : String(z));
687
687
  }
688
688
  }
689
689
  ));
690
- }, u = k.map((d) => {
691
- const D = g.find((C) => H(C, d));
690
+ }, h = k.map((u) => {
691
+ const z = g.find((w) => G(w, u));
692
692
  return {
693
- key: d.id,
694
- name: d.name,
695
- icon: d.icon,
693
+ key: u.id,
694
+ name: u.name,
695
+ icon: u.icon,
696
696
  onSelect: () => {
697
- if (D) {
698
- w(D);
697
+ if (z) {
698
+ E(z);
699
699
  return;
700
700
  }
701
- s(!1), window.open(d.downloadUrl, "_blank", "noopener,noreferrer");
701
+ l(!1), window.open(u.downloadUrl, "_blank", "noopener,noreferrer");
702
702
  }
703
703
  };
704
- }), l = g.filter((d) => !k.some((D) => H(d, D))).map((d) => ({
705
- key: d.uid,
706
- name: d.name,
707
- icon: d.icon,
708
- onSelect: () => w(d)
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)
709
709
  }));
710
- return /* @__PURE__ */ p(v, { children: [
710
+ return /* @__PURE__ */ c(x, { children: [
711
711
  /* @__PURE__ */ t(
712
- T,
712
+ M,
713
713
  {
714
- icon: /* @__PURE__ */ t($, { name: "walletOutline", className: "zd:w-5 zd:h-5" }),
714
+ icon: /* @__PURE__ */ t(t2, { name: "walletOutline", className: "zd:w-5 zd:h-5" }),
715
715
  title: e,
716
- trailing: /* @__PURE__ */ t(P, {}),
717
- disabled: a,
716
+ trailing: /* @__PURE__ */ t(V, {}),
717
+ disabled: r,
718
718
  onClick: () => {
719
- a || r() && s(!0);
719
+ r || a() && l(!0);
720
720
  }
721
721
  }
722
722
  ),
723
723
  /* @__PURE__ */ t(
724
- J2,
724
+ ae,
725
725
  {
726
- open: o,
727
- onOpenChange: s,
728
- tiles: [...u, ...l]
726
+ open: s,
727
+ onOpenChange: l,
728
+ tiles: [...h, ...d]
729
729
  }
730
730
  )
731
731
  ] });
732
732
  }
733
- function n2() {
734
- const { goToStep: e } = F(), { authPending: n, guardAgreement: a, setError: r } = _(), i = {
733
+ function u2() {
734
+ const { goToStep: e } = F(), { authPending: n, guardAgreement: r, setError: a } = T(), i = {
735
735
  onSuccess: () => {
736
736
  e("authenticated");
737
737
  },
738
738
  onError: (g) => {
739
- I(g) || r(g instanceof Error ? g.message : String(g));
739
+ P(g) || a(g instanceof Error ? g.message : String(g));
740
740
  }
741
- }, { mutate: o, isPending: s } = F2({ mutation: i }), { mutate: c, isPending: f } = x2({
741
+ }, { mutate: s, isPending: l } = N2({ mutation: i }), { mutate: o, isPending: p } = k2({
742
742
  mutation: i
743
743
  });
744
- L(s || f);
744
+ L(l || p);
745
745
  const m = (g) => () => {
746
- n || a() && (r(null), g());
746
+ n || r() && (a(null), g());
747
747
  };
748
- return /* @__PURE__ */ p(v, { children: [
748
+ return /* @__PURE__ */ c(x, { children: [
749
749
  /* @__PURE__ */ t(
750
750
  S,
751
751
  {
@@ -754,7 +754,7 @@ function n2() {
754
754
  iconName: "key",
755
755
  trailIcon: !0,
756
756
  disabled: n,
757
- onClick: m(() => o())
757
+ onClick: m(() => s())
758
758
  }
759
759
  ),
760
760
  /* @__PURE__ */ t(
@@ -765,45 +765,45 @@ function n2() {
765
765
  iconName: "key",
766
766
  trailIcon: !0,
767
767
  disabled: n,
768
- onClick: m(() => c())
768
+ onClick: m(() => o())
769
769
  }
770
770
  )
771
771
  ] });
772
772
  }
773
- function Q2({ walletId: e }) {
774
- const n = k.find((h) => h.id === e);
773
+ function se({ walletId: e }) {
774
+ const n = k.find((f) => f.id === e);
775
775
  if (!n)
776
776
  throw new Error(
777
- `Unknown walletId "${e}". Valid ids: ${k.map((h) => h.id).join(", ")}`
777
+ `Unknown walletId "${e}". Valid ids: ${k.map((f) => f.id).join(", ")}`
778
778
  );
779
- const { goToStep: a } = F(), { authPending: r, guardAgreement: i, setError: o, registerWallet: s } = _(), c = Z(), { mutate: f, isPending: m } = G();
780
- L(m), g2(() => s(n.id), [s, n.id]);
781
- const g = c.find((h) => H(h, n)), w = !!n.rdns && c.some((h) => h.id === n.rdns), u = {
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
782
  title: n.name,
783
783
  icon: /* @__PURE__ */ t("img", { src: n.icon, alt: "", className: "zd:w-6 zd:h-6" }),
784
- trailing: /* @__PURE__ */ t(P, {})
784
+ trailing: /* @__PURE__ */ t(V, {})
785
785
  };
786
786
  return g ? /* @__PURE__ */ t(
787
- T,
787
+ M,
788
788
  {
789
- ...u,
790
- ...w && { subtitle: /* @__PURE__ */ t(K, { text: "INSTALLED" }) },
791
- disabled: r,
789
+ ...h,
790
+ ...E && { subtitle: /* @__PURE__ */ t(n2, { text: "INSTALLED" }) },
791
+ disabled: a,
792
792
  onClick: () => {
793
- r || i() && (o(null), f(
793
+ a || i() && (s(null), p(
794
794
  { connector: g },
795
795
  {
796
796
  // The external wallet is now the active wagmi connection — the
797
797
  // embedded-wallet flow is done, so close it (mirrors SignUp.MoreWallets).
798
- onSuccess: () => a(null),
799
- onError: (h) => {
800
- I(h) || o(h instanceof Error ? h.message : String(h));
798
+ onSuccess: () => r(null),
799
+ onError: (f) => {
800
+ P(f) || s(f instanceof Error ? f.message : String(f));
801
801
  }
802
802
  }
803
803
  ));
804
804
  }
805
805
  }
806
- ) : /* @__PURE__ */ t(T, { ...u, asChild: !0, children: /* @__PURE__ */ t(
806
+ ) : /* @__PURE__ */ t(M, { ...h, asChild: !0, children: /* @__PURE__ */ t(
807
807
  "a",
808
808
  {
809
809
  href: n.downloadUrl,
@@ -812,37 +812,37 @@ function Q2({ walletId: e }) {
812
812
  }
813
813
  ) });
814
814
  }
815
- function i2({
815
+ function p2({
816
816
  children: e,
817
817
  termsAndConditionsUrl: n,
818
- privacyPolicyUrl: a,
819
- emailAuthMethod: r = "magicLink"
818
+ privacyPolicyUrl: r,
819
+ emailAuthMethod: a = "magicLink"
820
820
  }) {
821
- const [i, o] = E(!1), [s, c] = E(!1), [f, m] = E(null), [g, w] = E(!1), [u, l] = E(
821
+ const [i, s] = C(!1), [l, o] = C(!1), [p, m] = C(null), [g, E] = C(!1), [h, d] = C(
822
822
  []
823
- ), h = D2((x) => (l((A) => [...A, x]), () => {
824
- l((A) => {
825
- const y = [...A];
826
- return y.splice(y.indexOf(x), 1), y;
823
+ ), f = x2((y) => (d((b) => [...b, y]), () => {
824
+ d((b) => {
825
+ const v = [...b];
826
+ return v.splice(v.indexOf(y), 1), v;
827
827
  });
828
- }), []), D = !!(n || a) && !i, C = () => D ? (c(!0), !1) : !0;
829
- return /* @__PURE__ */ p(
830
- Q.Provider,
828
+ }), []), z = !!(n || r) && !i, w = () => z ? (o(!0), !1) : !0;
829
+ return /* @__PURE__ */ c(
830
+ o2.Provider,
831
831
  {
832
832
  value: {
833
833
  authPending: g,
834
- emailAuthMethod: r,
835
- setAuthPending: w,
836
- needsAgreement: D,
837
- guardAgreement: C,
834
+ emailAuthMethod: a,
835
+ setAuthPending: E,
836
+ needsAgreement: z,
837
+ guardAgreement: w,
838
838
  setError: m,
839
- registeredWallets: u,
840
- registerWallet: h
839
+ registeredWallets: h,
840
+ registerWallet: f
841
841
  },
842
842
  children: [
843
- f !== null && /* @__PURE__ */ t("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full zd:min-h-100", children: /* @__PURE__ */ p("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:max-w-md", children: [
844
- /* @__PURE__ */ t(z, { className: "zd:text-h2 zd:text-center", children: "Error occurred" }),
845
- /* @__PURE__ */ t(z, { className: "zd:text-center zd:text-red-500", children: f }),
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
846
  /* @__PURE__ */ t(
847
847
  S,
848
848
  {
@@ -852,29 +852,29 @@ function i2({
852
852
  }
853
853
  )
854
854
  ] }) }),
855
- /* @__PURE__ */ p(
855
+ /* @__PURE__ */ c(
856
856
  "div",
857
857
  {
858
- className: `zd:-mx-4 zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden${f !== null ? " zd:hidden" : ""}`,
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" : ""}`,
859
859
  children: [
860
- /* @__PURE__ */ p("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-center", children: [
861
- /* @__PURE__ */ p("div", { className: "zd:px-4 zd:flex zd:flex-col zd:items-center", children: [
862
- /* @__PURE__ */ t("div", { className: "zd:w-full zd:px-16 zd:py-4", children: /* @__PURE__ */ t(j2, { className: "zd:w-full zd:pointer-events-none zd:select-none" }) }),
863
- /* @__PURE__ */ t(z, { className: "zd:text-h2 zd:text-center", children: "Continue to your wallet" }),
864
- /* @__PURE__ */ t(z, { className: "zd:mt-2 zd:text-center zd:text-greyScale/50", children: "Choose a sign-in method to proceed" })
860
+ /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-center", children: [
861
+ /* @__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" })
865
865
  ] }),
866
866
  /* @__PURE__ */ t("div", { className: "zd:mt-6 zd:mb-4 zd:px-4 zd:flex zd:flex-col zd:gap-2", children: e })
867
867
  ] }),
868
868
  /* @__PURE__ */ t("div", { className: "zd:px-4", children: /* @__PURE__ */ t(
869
- V2,
869
+ J2,
870
870
  {
871
871
  termsAndConditionsUrl: n,
872
- privacyPolicyUrl: a,
872
+ privacyPolicyUrl: r,
873
873
  agreedToTerms: i,
874
- setAgreedToTerms: (x) => {
875
- o(x), x && c(!1);
874
+ setAgreedToTerms: (y) => {
875
+ s(y), y && o(!1);
876
876
  },
877
- highlight: s
877
+ highlight: l
878
878
  }
879
879
  ) })
880
880
  ]
@@ -884,58 +884,58 @@ function i2({
884
884
  }
885
885
  );
886
886
  }
887
- function r2({ label: e = "or" }) {
888
- return /* @__PURE__ */ p("div", { className: "zd:-mx-4 zd:my-2 zd:flex zd:items-center zd:gap-3", children: [
887
+ function h2({ label: e = "or" }) {
888
+ return /* @__PURE__ */ c("div", { className: "zd:-mx-4 zd:my-2 zd:flex zd:items-center zd:gap-3", children: [
889
889
  /* @__PURE__ */ t("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" }),
890
- /* @__PURE__ */ t(z, { className: "zd:text-body3", children: e }),
890
+ /* @__PURE__ */ t(D, { className: "zd:text-body3", children: e }),
891
891
  /* @__PURE__ */ t("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" })
892
892
  ] });
893
893
  }
894
- function ee(e) {
895
- return /* @__PURE__ */ p(i2, { ...e, children: [
896
- /* @__PURE__ */ t(n2, {}),
897
- /* @__PURE__ */ t(r2, {}),
898
- /* @__PURE__ */ t(t2, {}),
899
- /* @__PURE__ */ t(e2, {})
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, {})
900
900
  ] });
901
901
  }
902
- const te = Object.assign(i2, {
903
- Default: ee,
904
- Passkey: n2,
905
- Google: t2,
906
- Email: e2,
907
- Wallet: Q2,
908
- InstalledWallets: K2,
909
- MoreWallets: Y2,
910
- Divider: r2
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
911
911
  });
912
- function ne() {
912
+ function de() {
913
913
  return typeof window > "u" ? null : new URLSearchParams(window.location.search).get("code");
914
914
  }
915
- function ie() {
916
- const { otpId: e, otpEncryptionTargetBundle: n, goToStep: a, clearOtpSession: r } = F(), [i] = E(ne), [o, s] = E(null), c = X(!1), { mutate: f, isPending: m } = y2({
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({
917
917
  mutation: {
918
918
  onSuccess: () => {
919
- r(), a("authenticated");
919
+ a(), r("authenticated");
920
920
  },
921
921
  onError: (g) => {
922
- s(g);
922
+ l(g);
923
923
  }
924
924
  }
925
925
  });
926
- return N(() => {
927
- if (!(c.current || !i)) {
928
- if (c.current = !0, !e || !n) {
929
- U(), a(null);
926
+ return U(() => {
927
+ if (!(o.current || !i)) {
928
+ if (o.current = !0, !e || !n) {
929
+ I(), r(null);
930
930
  return;
931
931
  }
932
- f({ otpId: e, code: i, otpEncryptionTargetBundle: n });
932
+ p({ otpId: e, code: i, otpEncryptionTargetBundle: n });
933
933
  }
934
- }, [e, n, i, f, a]), /* @__PURE__ */ p(v, { children: [
935
- /* @__PURE__ */ p("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
936
- !o && m && /* @__PURE__ */ t(b, { imageName: "loading", title: "Verifying Your Email", children: "Please wait while we securely connect your wallet." }),
937
- !o && !i && !m && /* @__PURE__ */ p(v, { children: [
938
- /* @__PURE__ */ p(b, { imageName: "error", title: "Invalid Link", children: [
934
+ }, [e, n, i, p, r]), /* @__PURE__ */ c(x, { children: [
935
+ /* @__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: [
939
939
  "This verification link is invalid or incomplete.",
940
940
  /* @__PURE__ */ t("br", {}),
941
941
  "Please check your email and try again with the correct link."
@@ -945,93 +945,93 @@ function ie() {
945
945
  {
946
946
  action: "primary",
947
947
  onClick: () => {
948
- U(), a("sign-up");
948
+ I(), r("sign-up");
949
949
  },
950
950
  text: "Choose another sign-in method"
951
951
  }
952
952
  )
953
953
  ] }),
954
- o != null && /* @__PURE__ */ p(v, { children: [
955
- /* @__PURE__ */ t(b, { imageName: "error", title: "Oops, something went wrong", children: "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request." }),
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
956
  /* @__PURE__ */ t(
957
957
  S,
958
958
  {
959
959
  action: "primary",
960
960
  onClick: () => {
961
- U(), a("sign-up");
961
+ I(), r("sign-up");
962
962
  },
963
963
  text: "Choose another sign-in method"
964
964
  }
965
965
  )
966
966
  ] })
967
967
  ] }),
968
- /* @__PURE__ */ t(O, { className: "zd:self-center zd:pt-4 zd:pb-6" })
968
+ /* @__PURE__ */ t(H, { className: "zd:self-center zd:pt-4 zd:pb-6" })
969
969
  ] });
970
970
  }
971
- function re() {
972
- return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(b, { imageName: "loading", title: "Authenticating...", children: "Please wait while we complete the OAuth authentication." }) });
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." }) });
973
973
  }
974
- function ae() {
975
- return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(b, { imageName: "loading", title: "Passkey authentication", children: "Please authenticate with your passkey." }) });
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." }) });
976
976
  }
977
- function oe(e, n) {
977
+ function he(e, n) {
978
978
  switch (e) {
979
979
  case "sign-up":
980
- return n ? n() : /* @__PURE__ */ t(te.Default, {});
980
+ return n ? n() : /* @__PURE__ */ t(oe.Default, {});
981
981
  case "email-verification":
982
- return /* @__PURE__ */ t(U2, {});
982
+ return /* @__PURE__ */ t(B2, {});
983
983
  case "otp-input":
984
- return /* @__PURE__ */ t(G2, {});
984
+ return /* @__PURE__ */ t(Y2, {});
985
985
  case "verifying-otp":
986
- return /* @__PURE__ */ t(ie, {});
986
+ return /* @__PURE__ */ t(ce, {});
987
987
  case "oauth-in-progress":
988
- return /* @__PURE__ */ t(re, {});
988
+ return /* @__PURE__ */ t(ue, {});
989
989
  case "passkey-prompt":
990
- return /* @__PURE__ */ t(ae, {});
990
+ return /* @__PURE__ */ t(pe, {});
991
991
  case "error":
992
- return /* @__PURE__ */ t(O2, {});
992
+ return /* @__PURE__ */ t(G2, {});
993
993
  default:
994
994
  return null;
995
995
  }
996
996
  }
997
- function Ce({
997
+ function _e({
998
998
  onClose: e,
999
999
  size: n,
1000
- renderSignUp: a,
1001
- logo: r
1000
+ renderSignUp: r,
1001
+ logo: a
1002
1002
  } = {}) {
1003
- const { step: i, goToStep: o, goBack: s, reset: c } = F();
1004
- N(() => {
1005
- i === null && T2() && o("verifying-otp");
1006
- }, [i, o]);
1007
- const f = oe(i, a);
1008
- return f ? /* @__PURE__ */ t(
1009
- u2,
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,
1010
1010
  {
1011
1011
  ...n && { size: n },
1012
1012
  className: i === "sign-up" ? "zd:h-auto zd:max-h-202.5" : void 0,
1013
1013
  topNav: /* @__PURE__ */ t(
1014
- p2,
1014
+ a2,
1015
1015
  {
1016
- ...s !== null && { onLeftButtonClick: s },
1016
+ ...l !== null && { onLeftButtonClick: l },
1017
1017
  onRightButtonClick: () => {
1018
- U(), c(), e == null || e();
1018
+ I(), o(), e == null || e();
1019
1019
  },
1020
1020
  ...i === "sign-up" && {
1021
- ...r && { logo: r },
1021
+ ...a && { logo: a },
1022
1022
  className: "zd:px-4"
1023
1023
  }
1024
1024
  }
1025
1025
  ),
1026
- children: f
1026
+ children: p
1027
1027
  }
1028
1028
  ) : null;
1029
1029
  }
1030
- const V = "zerodev:auth:otpSession";
1031
- function se() {
1030
+ const K = "zerodev:auth:otpSession";
1031
+ function fe() {
1032
1032
  if (typeof window > "u") return null;
1033
1033
  try {
1034
- const e = window.localStorage.getItem(V);
1034
+ const e = window.localStorage.getItem(K);
1035
1035
  if (!e) return null;
1036
1036
  const n = JSON.parse(e);
1037
1037
  return !(n != null && n.otpId) || !(n != null && n.otpEncryptionTargetBundle) ? null : n;
@@ -1039,24 +1039,24 @@ function se() {
1039
1039
  return null;
1040
1040
  }
1041
1041
  }
1042
- function le(e) {
1042
+ function me(e) {
1043
1043
  if (!(typeof window > "u"))
1044
1044
  try {
1045
1045
  window.localStorage.setItem(
1046
- V,
1046
+ K,
1047
1047
  JSON.stringify(e)
1048
1048
  );
1049
1049
  } catch {
1050
1050
  }
1051
1051
  }
1052
- function W() {
1052
+ function Y() {
1053
1053
  if (!(typeof window > "u"))
1054
1054
  try {
1055
- window.localStorage.removeItem(V);
1055
+ window.localStorage.removeItem(K);
1056
1056
  } catch {
1057
1057
  }
1058
1058
  }
1059
- const de = (e, n, a) => ({
1059
+ const ge = (e, n, r) => ({
1060
1060
  auth: {
1061
1061
  // Initial state
1062
1062
  step: null,
@@ -1066,40 +1066,40 @@ const de = (e, n, a) => ({
1066
1066
  otpEncryptionTargetBundle: null,
1067
1067
  // Actions
1068
1068
  initialize: () => {
1069
- const r = se();
1070
- r && e((i) => ({
1069
+ const a = fe();
1070
+ a && e((i) => ({
1071
1071
  auth: {
1072
1072
  ...i.auth,
1073
- otpId: r.otpId,
1074
- otpEncryptionTargetBundle: r.otpEncryptionTargetBundle
1073
+ otpId: a.otpId,
1074
+ otpEncryptionTargetBundle: a.otpEncryptionTargetBundle
1075
1075
  }
1076
1076
  }));
1077
1077
  },
1078
- goToStep: (r) => {
1078
+ goToStep: (a) => {
1079
1079
  e((i) => ({
1080
1080
  auth: {
1081
1081
  ...i.auth,
1082
- step: r,
1082
+ step: a,
1083
1083
  stepHistory: i.auth.step === null ? i.auth.stepHistory : [...i.auth.stepHistory, i.auth.step]
1084
1084
  }
1085
1085
  }));
1086
1086
  },
1087
1087
  goBack: () => {
1088
- const { auth: r } = n();
1089
- if (r.stepHistory.length === 0) return;
1090
- const i = [...r.stepHistory], o = i.pop();
1091
- e((s) => ({
1088
+ const { auth: a } = n();
1089
+ if (a.stepHistory.length === 0) return;
1090
+ const i = [...a.stepHistory], s = i.pop();
1091
+ e((l) => ({
1092
1092
  auth: {
1093
- ...s.auth,
1094
- step: o,
1093
+ ...l.auth,
1094
+ step: s,
1095
1095
  stepHistory: i
1096
1096
  }
1097
1097
  }));
1098
1098
  },
1099
1099
  reset: () => {
1100
- W(), e((r) => ({
1100
+ Y(), e((a) => ({
1101
1101
  auth: {
1102
- ...r.auth,
1102
+ ...a.auth,
1103
1103
  step: null,
1104
1104
  stepHistory: [],
1105
1105
  email: null,
@@ -1108,93 +1108,343 @@ const de = (e, n, a) => ({
1108
1108
  }
1109
1109
  }));
1110
1110
  },
1111
- setEmail: (r) => {
1111
+ setEmail: (a) => {
1112
1112
  e((i) => ({
1113
1113
  auth: {
1114
1114
  ...i.auth,
1115
- email: r
1115
+ email: a
1116
1116
  }
1117
1117
  }));
1118
1118
  },
1119
- setOtpSession: ({ otpId: r, otpEncryptionTargetBundle: i }) => {
1120
- le({ otpId: r, otpEncryptionTargetBundle: i }), e((o) => ({
1119
+ setOtpSession: ({ otpId: a, otpEncryptionTargetBundle: i }) => {
1120
+ me({ otpId: a, otpEncryptionTargetBundle: i }), e((s) => ({
1121
1121
  auth: {
1122
- ...o.auth,
1123
- otpId: r,
1122
+ ...s.auth,
1123
+ otpId: a,
1124
1124
  otpEncryptionTargetBundle: i
1125
1125
  }
1126
1126
  }));
1127
1127
  },
1128
1128
  clearOtpSession: () => {
1129
- W(), e((r) => ({
1129
+ Y(), e((a) => ({
1130
1130
  auth: {
1131
- ...r.auth,
1131
+ ...a.auth,
1132
1132
  otpId: null,
1133
1133
  otpEncryptionTargetBundle: null
1134
1134
  }
1135
1135
  }));
1136
1136
  }
1137
1137
  }
1138
- }), ce = () => z2()(
1139
- A2((e, n, a) => ({
1138
+ }), ze = () => v2()(
1139
+ L2((e, n, r) => ({
1140
1140
  pendingRequests: [],
1141
1141
  userConfirmationListenerActive: !1,
1142
- addPendingRequest: (r) => e((i) => ({
1143
- pendingRequests: [...i.pendingRequests, r]
1142
+ addPendingRequest: (a) => e((i) => ({
1143
+ pendingRequests: [...i.pendingRequests, a]
1144
1144
  })),
1145
- removePendingRequest: (r) => e((i) => ({
1146
- pendingRequests: i.pendingRequests.filter((o) => o.id !== r)
1145
+ removePendingRequest: (a) => e((i) => ({
1146
+ pendingRequests: i.pendingRequests.filter((s) => s.id !== a)
1147
1147
  })),
1148
1148
  clearPendingRequests: () => e({ pendingRequests: [] }),
1149
- setUserConfirmationListenerActive: (r) => e({ userConfirmationListenerActive: r }),
1150
- ...de(e, n)
1149
+ setUserConfirmationListenerActive: (a) => e({ userConfirmationListenerActive: a }),
1150
+ ...ge(e, n)
1151
1151
  }))
1152
1152
  );
1153
- function ue(e) {
1154
- return new Promise((n, a) => {
1155
- const r = e.subscribe(
1153
+ function De(e) {
1154
+ return new Promise((n, r) => {
1155
+ const a = e.subscribe(
1156
1156
  (i) => i.auth.step,
1157
1157
  (i) => {
1158
- i === "authenticated" ? (r(), n()) : i === null && (r(), a(new Error("Auth flow dismissed")));
1158
+ i === "authenticated" ? (a(), n()) : i === null && (a(), r(new Error("Auth flow dismissed")));
1159
1159
  }
1160
1160
  );
1161
1161
  });
1162
1162
  }
1163
- function Ee(e) {
1164
- const n = v2(e), a = ce();
1165
- return (r) => {
1166
- const i = n(r);
1163
+ function Le(e) {
1164
+ const n = T2(e), r = ze();
1165
+ return (a) => {
1166
+ const i = n(a);
1167
1167
  return {
1168
1168
  ...i,
1169
- async connect(o) {
1169
+ async connect(s) {
1170
1170
  try {
1171
- return await i.connect(o);
1172
- } catch (s) {
1173
- if (o != null && o.isReconnecting || !(s instanceof S2))
1174
- throw s;
1175
- if (a.getState().auth.step !== null)
1171
+ return await i.connect(s);
1172
+ } catch (l) {
1173
+ if (s != null && s.isReconnecting || !(l instanceof _2))
1174
+ throw l;
1175
+ if (r.getState().auth.step !== null)
1176
1176
  throw new Error("Auth flow already in progress");
1177
- return a.getState().auth.goToStep("sign-up"), await ue(a), i.connect(o);
1177
+ return r.getState().auth.goToStep("sign-up"), await De(r), i.connect(s);
1178
1178
  }
1179
1179
  },
1180
1180
  async disconnect() {
1181
- var o;
1182
- await ((o = i.disconnect) == null ? void 0 : o.call(i)), a.getState().auth.reset();
1181
+ var s;
1182
+ await ((s = i.disconnect) == null ? void 0 : s.call(i)), r.getState().auth.reset();
1183
1183
  },
1184
1184
  async setup() {
1185
- var o;
1186
- await ((o = i.setup) == null ? void 0 : o.call(i)), !(typeof window > "u") && a.getState().auth.initialize();
1185
+ var s;
1186
+ await ((s = i.setup) == null ? void 0 : s.call(i)), !(typeof window > "u") && r.getState().auth.initialize();
1187
1187
  },
1188
1188
  getKitStore() {
1189
- return a;
1189
+ return r;
1190
1190
  }
1191
1191
  };
1192
1192
  };
1193
1193
  }
1194
+ const we = {
1195
+ Pending: "zd:text-solarOrange",
1196
+ Success: "zd:text-positive",
1197
+ Failed: "zd:text-negative"
1198
+ };
1199
+ function Ce({
1200
+ icon: e,
1201
+ title: n,
1202
+ value: r,
1203
+ chainName: a,
1204
+ chainIconUrl: i,
1205
+ destChainName: s,
1206
+ destChainIconUrl: l,
1207
+ status: o,
1208
+ className: p
1209
+ }) {
1210
+ return /* @__PURE__ */ c(
1211
+ "div",
1212
+ {
1213
+ className: B(
1214
+ "zd:flex zd:w-full zd:items-center zd:gap-2 zd:p-2",
1215
+ p
1216
+ ),
1217
+ 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" }) }),
1219
+ /* @__PURE__ */ c("div", { className: "zd:flex zd:min-w-0 zd:flex-1 zd:flex-col zd:gap-2", children: [
1220
+ /* @__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 })
1223
+ ] }),
1224
+ /* @__PURE__ */ c("div", { className: "zd:flex zd:w-full zd:items-center zd:justify-between zd:gap-2", children: [
1225
+ /* @__PURE__ */ c("div", { className: "zd:flex zd:min-w-0 zd:items-center zd:gap-2", children: [
1226
+ /* @__PURE__ */ t(
1227
+ J,
1228
+ {
1229
+ name: a,
1230
+ ...i && { iconUrl: i }
1231
+ }
1232
+ ),
1233
+ s && /* @__PURE__ */ c(x, { children: [
1234
+ /* @__PURE__ */ t(
1235
+ Z,
1236
+ {
1237
+ name: "arrowRightFill",
1238
+ "aria-hidden": !0,
1239
+ className: "zd:size-3 zd:shrink-0 zd:opacity-30"
1240
+ }
1241
+ ),
1242
+ /* @__PURE__ */ t(
1243
+ J,
1244
+ {
1245
+ name: s,
1246
+ ...l && { iconUrl: l }
1247
+ }
1248
+ )
1249
+ ] })
1250
+ ] }),
1251
+ /* @__PURE__ */ t(
1252
+ D,
1253
+ {
1254
+ className: B("zd:shrink-0 zd:text-body3", we[o]),
1255
+ children: o
1256
+ }
1257
+ )
1258
+ ] })
1259
+ ] })
1260
+ ]
1261
+ }
1262
+ );
1263
+ }
1264
+ function J({ name: e, iconUrl: n }) {
1265
+ 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(
1267
+ "img",
1268
+ {
1269
+ src: n,
1270
+ alt: "",
1271
+ "aria-hidden": !0,
1272
+ className: "zd:size-full zd:object-cover"
1273
+ }
1274
+ ) }),
1275
+ /* @__PURE__ */ t(D, { className: "zd:truncate zd:text-body3", children: e })
1276
+ ] });
1277
+ }
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 = [
1279
+ {
1280
+ id: "mock-1",
1281
+ icon: "arrowSwapHorizontalOutline",
1282
+ title: "Swapped ETH → USD₮0",
1283
+ value: "2,343 ETH",
1284
+ chainName: "Arbitrum One",
1285
+ chainIconUrl: _,
1286
+ destChainName: "Base",
1287
+ destChainIconUrl: X,
1288
+ status: "Pending",
1289
+ timestamp: Date.now() - 1 * A
1290
+ },
1291
+ {
1292
+ id: "mock-2",
1293
+ icon: "arrowSwapHorizontalOutline",
1294
+ title: "Swapped ETH → USD₮0",
1295
+ value: "2,343 ETH",
1296
+ chainName: "Arbitrum One",
1297
+ chainIconUrl: _,
1298
+ destChainName: "Base",
1299
+ destChainIconUrl: X,
1300
+ status: "Pending",
1301
+ timestamp: Date.now() - 2 * A
1302
+ },
1303
+ {
1304
+ id: "mock-3",
1305
+ icon: "lighting",
1306
+ title: "Fixed Yield",
1307
+ value: "2,323 PT wstETH (25 Jan 2026)",
1308
+ chainName: "Arbitrum One",
1309
+ chainIconUrl: _,
1310
+ status: "Success",
1311
+ timestamp: Date.now() - 3 * A
1312
+ },
1313
+ {
1314
+ id: "mock-4",
1315
+ icon: "imageFill",
1316
+ title: "Received NFT",
1317
+ value: "Bored Ape Yacht Club",
1318
+ chainName: "Arbitrum One",
1319
+ chainIconUrl: _,
1320
+ status: "Success",
1321
+ timestamp: Date.now() - 4 * A
1322
+ },
1323
+ {
1324
+ id: "mock-5",
1325
+ icon: "lighting",
1326
+ title: "Collateral Used",
1327
+ value: "Collateralization enabled for USD₮0",
1328
+ chainName: "Arbitrum One",
1329
+ chainIconUrl: _,
1330
+ status: "Success",
1331
+ timestamp: Date.now() - 336 * A
1332
+ },
1333
+ {
1334
+ id: "mock-6",
1335
+ icon: "lighting",
1336
+ title: "Liquid Staked ETH",
1337
+ value: "2,323 PT wstETH (25 Jan 2026)",
1338
+ chainName: "Arbitrum One",
1339
+ chainIconUrl: _,
1340
+ status: "Success",
1341
+ timestamp: Date.now() - 336 * A - 1 * A
1342
+ }
1343
+ ];
1344
+ function R(e) {
1345
+ const n = new Date(e);
1346
+ return `${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`;
1347
+ }
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", {
1351
+ month: "long",
1352
+ day: "numeric",
1353
+ year: "numeric"
1354
+ }).format(new Date(e));
1355
+ }
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);
1363
+ }
1364
+ return a;
1365
+ }
1366
+ function ye({
1367
+ entries: e = Ee,
1368
+ onSelectEntry: n
1369
+ }) {
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,
1373
+ {
1374
+ variant: "ghost",
1375
+ 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(
1380
+ "button",
1381
+ {
1382
+ type: "button",
1383
+ onClick: () => n(i),
1384
+ className: "zd:w-full zd:cursor-pointer zd:text-left",
1385
+ children: /* @__PURE__ */ t(Q, { entry: i })
1386
+ },
1387
+ i.id
1388
+ ) : /* @__PURE__ */ t(Q, { entry: i }, i.id)
1389
+ )
1390
+ ] }, a.label))
1391
+ }
1392
+ ) });
1393
+ }
1394
+ function Q({ entry: e }) {
1395
+ return /* @__PURE__ */ t(
1396
+ Ce,
1397
+ {
1398
+ icon: e.icon,
1399
+ title: e.title,
1400
+ value: e.value,
1401
+ chainName: e.chainName,
1402
+ ...e.chainIconUrl && { chainIconUrl: e.chainIconUrl },
1403
+ ...e.destChainName && { destChainName: e.destChainName },
1404
+ ...e.destChainIconUrl && {
1405
+ destChainIconUrl: e.destChainIconUrl
1406
+ },
1407
+ status: e.status
1408
+ }
1409
+ );
1410
+ }
1411
+ const ve = {
1412
+ history: "History"
1413
+ };
1414
+ function Oe({
1415
+ onClose: e,
1416
+ entries: n,
1417
+ onSelectEntry: r,
1418
+ className: a,
1419
+ size: i
1420
+ }) {
1421
+ const [s] = C("history"), l = () => {
1422
+ switch (s) {
1423
+ case "history":
1424
+ return /* @__PURE__ */ t(
1425
+ ye,
1426
+ {
1427
+ ...n && { entries: n },
1428
+ ...r && { onSelectEntry: r }
1429
+ }
1430
+ );
1431
+ }
1432
+ };
1433
+ return /* @__PURE__ */ t(
1434
+ i2,
1435
+ {
1436
+ ...a && { className: a },
1437
+ ...i && { size: i },
1438
+ topNav: /* @__PURE__ */ t(a2, { title: ve[s], onRightButtonClick: e }),
1439
+ children: l()
1440
+ }
1441
+ );
1442
+ }
1194
1443
  export {
1195
- Ce as ConnectWallet,
1196
- te as SignUp,
1444
+ _e as ConnectWallet,
1445
+ oe as SignUp,
1446
+ Oe as TxHistory,
1197
1447
  F as useAuth,
1198
- Ee as zeroDevWallet
1448
+ Le as zeroDevWallet
1199
1449
  };
1200
1450
  //# sourceMappingURL=index.mjs.map