@zerodev/wallet-react-ui 0.0.1 → 0.0.3

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,45 +1,45 @@
1
- import { jsxs as a, jsx as t, Fragment as b } from "react/jsx-runtime";
2
- import { useId as D, useState as x, useEffect as P, useMemo as ie, useRef as K } from "react";
3
- import { useStore as O, create as se } from "zustand";
4
- import { cn as R, IconButton as q, Text as h, Icon as X, Button as C, Wrapper as de, ListItem as Y, Input as ae } from "@zerodev/react-ui";
5
- import { useConfig as le, useConnect as ce } from "wagmi";
6
- import { useSendMagicLink as J, useSendOTP as Q, useVerifyOTP as ue, useAuthenticateOAuth as pe, useRegisterPasskey as fe, useLoginPasskey as he, useVerifyMagicLink as ze, zeroDevWallet as me, NotAuthenticatedError as ge } from "@zerodev/wallet-react";
7
- import { subscribeWithSelector as ye } from "zustand/middleware";
1
+ import { jsxs as d, jsx as t, Fragment as b } from "react/jsx-runtime";
2
+ import { useId as V, useState as w, useEffect as P, useMemo as re, useRef as K } from "react";
3
+ import { useStore as O, create as ie } from "zustand";
4
+ import { cn as R, IconButton as q, Text as h, ZeroDevLogo as se, Button as C, Wrapper as ae, ListItem as X, Input as de, Icon as le } from "@zerodev/react-ui";
5
+ import { useConfig as ce, useConnect as ue } from "wagmi";
6
+ import { useSendMagicLink as Y, useSendOTP as J, useVerifyOTP as pe, useAuthenticateOAuth as fe, useRegisterPasskey as he, useLoginPasskey as ze, useVerifyMagicLink as me, zeroDevWallet as ge, NotAuthenticatedError as ye } from "@zerodev/wallet-react";
7
+ import { subscribeWithSelector as xe } from "zustand/middleware";
8
8
  const Z = 52;
9
- function xe({
9
+ function we({
10
10
  onBack: e,
11
- onClose: o,
12
- title: i,
11
+ onClose: i,
12
+ title: r,
13
13
  logo: n,
14
- className: r
14
+ className: o
15
15
  }) {
16
- return /* @__PURE__ */ a(
16
+ return /* @__PURE__ */ d(
17
17
  "div",
18
18
  {
19
19
  className: R(
20
20
  "zd:absolute zd:top-4 zd:left-0 zd:right-0 zd:flex zd:flex-row zd:items-center zd:justify-between",
21
- r
21
+ o
22
22
  ),
23
- style: { height: Z },
23
+ style: { height: `calc(${Z / 4} * var(--zd-spacing))` },
24
24
  children: [
25
25
  e ? /* @__PURE__ */ t(q, { iconName: "chevronLeft", onClick: e }) : /* @__PURE__ */ t("div", { className: "zd:h-13 zd:w-13" }),
26
26
  n && /* @__PURE__ */ t("div", { className: "zd:absolute zd:left-0 zd:right-0 zd:flex zd:items-center zd:justify-center zd:pointer-events-none", children: n }),
27
- i && /* @__PURE__ */ t("div", { className: "zd:absolute zd:left-0 zd:right-0 zd:flex zd:items-center zd:justify-center zd:pointer-events-none", children: /* @__PURE__ */ t(h, { className: "zd:text-body1", children: i }) }),
28
- /* @__PURE__ */ t(q, { iconName: "x", onClick: o })
27
+ r && /* @__PURE__ */ t("div", { className: "zd:absolute zd:left-0 zd:right-0 zd:flex zd:items-center zd:justify-center zd:pointer-events-none", children: /* @__PURE__ */ t(h, { className: "zd:text-body1", children: r }) }),
28
+ /* @__PURE__ */ t(q, { iconName: "x", onClick: i })
29
29
  ]
30
30
  }
31
31
  );
32
32
  }
33
- function we({
33
+ function ve({
34
34
  layer: e,
35
- rect: o
35
+ rect: i
36
36
  }) {
37
- const { id: i, matrix: n, fillOpacity: r, stops: c } = e;
38
- return /* @__PURE__ */ a(b, { children: [
37
+ const { id: r, matrix: n, fillOpacity: o, stops: c } = e;
38
+ return /* @__PURE__ */ d(b, { children: [
39
39
  /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t(
40
40
  "radialGradient",
41
41
  {
42
- id: i,
42
+ id: r,
43
43
  cx: "0",
44
44
  cy: "0",
45
45
  r: "1",
@@ -59,24 +59,24 @@ function we({
59
59
  /* @__PURE__ */ t(
60
60
  "rect",
61
61
  {
62
- x: o.x,
63
- y: o.y,
64
- width: o.width,
65
- height: o.height,
66
- fill: `url(#${i})`,
67
- fillOpacity: r
62
+ x: i.x,
63
+ y: i.y,
64
+ width: i.width,
65
+ height: i.height,
66
+ fill: `url(#${r})`,
67
+ fillOpacity: o
68
68
  }
69
69
  )
70
70
  ] });
71
71
  }
72
- const ve = "-6 -6 412 812";
73
- function Ne() {
72
+ const Ne = "-6 -6 412 812";
73
+ function Se() {
74
74
  return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none", children: /* @__PURE__ */ t(
75
75
  "svg",
76
76
  {
77
77
  width: "100%",
78
78
  height: "100%",
79
- viewBox: ve,
79
+ viewBox: Ne,
80
80
  preserveAspectRatio: "none",
81
81
  role: "img",
82
82
  "aria-label": "Decorative gradient background",
@@ -84,8 +84,8 @@ function Ne() {
84
84
  }
85
85
  ) });
86
86
  }
87
- function Se() {
88
- const e = D(), o = [
87
+ function Ee() {
88
+ const e = V(), i = [
89
89
  {
90
90
  // (CSS #6) blue → top-right. x-radius widened so the lobe reaches further
91
91
  // left; y-radius kept short so it stays up top and doesn't bleed into the
@@ -151,7 +151,7 @@ function Se() {
151
151
  ]
152
152
  }
153
153
  ];
154
- return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none zd:overflow-hidden", children: /* @__PURE__ */ a(
154
+ return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none zd:overflow-hidden", children: /* @__PURE__ */ d(
155
155
  "svg",
156
156
  {
157
157
  width: "100%",
@@ -160,15 +160,15 @@ function Se() {
160
160
  preserveAspectRatio: "none",
161
161
  role: "presentation",
162
162
  children: [
163
- o.map((i) => /* @__PURE__ */ t(
164
- we,
163
+ i.map((r) => /* @__PURE__ */ t(
164
+ ve,
165
165
  {
166
- layer: i,
166
+ layer: r,
167
167
  rect: { x: 0, y: 0, width: 400, height: 800 }
168
168
  },
169
- i.id
169
+ r.id
170
170
  )),
171
- /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ a(
171
+ /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ d(
172
172
  "linearGradient",
173
173
  {
174
174
  id: `${e}-vfade`,
@@ -196,7 +196,7 @@ function Se() {
196
196
  fill: `url(#${e}-vfade)`
197
197
  }
198
198
  ),
199
- /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ a(
199
+ /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ d(
200
200
  "linearGradient",
201
201
  {
202
202
  id: `${e}-bluefade`,
@@ -227,8 +227,8 @@ function Se() {
227
227
  }
228
228
  ) });
229
229
  }
230
- function Ee() {
231
- const e = D(), o = [
230
+ function be() {
231
+ const e = V(), i = [
232
232
  {
233
233
  id: `${e}-g6`,
234
234
  // (CSS #6) blue, top-right
@@ -304,7 +304,7 @@ function Ee() {
304
304
  ]
305
305
  }
306
306
  ];
307
- return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none zd:overflow-hidden", children: /* @__PURE__ */ a(
307
+ return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none zd:overflow-hidden", children: /* @__PURE__ */ d(
308
308
  "svg",
309
309
  {
310
310
  width: "100%",
@@ -313,78 +313,94 @@ function Ee() {
313
313
  role: "presentation",
314
314
  children: [
315
315
  /* @__PURE__ */ t("rect", { width: "100%", height: "100%", fill: "#130E0B" }),
316
- /* @__PURE__ */ t("defs", { children: o.map((i) => /* @__PURE__ */ t(
316
+ /* @__PURE__ */ t("defs", { children: i.map((r) => /* @__PURE__ */ t(
317
317
  "radialGradient",
318
318
  {
319
- id: i.id,
320
- cx: `${i.cx / i.rx * 100}%`,
321
- cy: `${i.cy / i.ry * 100}%`,
319
+ id: r.id,
320
+ cx: `${r.cx / r.rx * 100}%`,
321
+ cy: `${r.cy / r.ry * 100}%`,
322
322
  r: "100%",
323
323
  gradientUnits: "objectBoundingBox",
324
- gradientTransform: `scale(${i.rx}, ${i.ry})`,
325
- children: i.stops.map((n, r) => /* @__PURE__ */ t(
324
+ gradientTransform: `scale(${r.rx}, ${r.ry})`,
325
+ children: r.stops.map((n, o) => /* @__PURE__ */ t(
326
326
  "stop",
327
327
  {
328
328
  offset: n.offset,
329
329
  stopColor: n.color,
330
330
  stopOpacity: n.opacity
331
331
  },
332
- n.color + r.toString()
332
+ n.color + o.toString()
333
333
  ))
334
334
  },
335
- i.id
335
+ r.id
336
336
  )) }),
337
- o.map((i) => /* @__PURE__ */ t(
337
+ i.map((r) => /* @__PURE__ */ t(
338
338
  "rect",
339
339
  {
340
340
  width: "100%",
341
341
  height: "100%",
342
- fill: `url(#${i.id})`
342
+ fill: `url(#${r.id})`
343
343
  },
344
- `${i.id}-rect`
344
+ `${r.id}-rect`
345
345
  ))
346
346
  ]
347
347
  }
348
348
  ) });
349
349
  }
350
- const be = Z + 16;
351
- function Ce({
350
+ const Ce = Z + 16;
351
+ function ke({
352
352
  children: e,
353
- className: o,
354
- contentClassName: i,
355
- style: n,
356
- topNav: r
353
+ className: i,
354
+ contentClassName: r,
355
+ size: n = "lg",
356
+ style: o,
357
+ topNav: c
357
358
  }) {
358
- return /* @__PURE__ */ a(
359
+ return /* @__PURE__ */ d(
359
360
  "div",
360
361
  {
362
+ "data-zd-size": n,
361
363
  className: R(
362
- "zd:flex zd:flex-col zd:overflow-hidden zd:text-left",
363
- "zd:fixed zd:inset-0 zd:z-50 zd:w-screen zd:h-[100dvh] zd:rounded-[36px]",
364
- "zd:sm:relative zd:sm:z-auto zd:sm:w-100 zd:sm:max-w-full zd:sm:h-[810px] zd:sm:max-h-[100dvh]",
365
- o
364
+ // 400×810 by default, but never taller/wider than the parent — a
365
+ // consumer wrapper with its own size caps the Screen (max-w/h-full =
366
+ // 100% of the parent). overflow-hidden clips the frame to its rounded
367
+ // border ring; content scrolls in the inner div below.
368
+ "zd:relative zd:flex zd:flex-col zd:text-left",
369
+ // w-100 = 400px, h-202.5 = 810px at density 1; both compile to
370
+ // calc(var(--zd-spacing) * N), so they scale with the size variants.
371
+ // rounded-[38px] = inner card radius (32px) + the 6px border-ring gap,
372
+ // so the ring has a uniform width — equal inner/outer radii would make
373
+ // the corners read thicker than the sides.
374
+ "zd:w-100 zd:h-202.5 zd:max-w-full zd:max-h-full zd:overflow-hidden zd:rounded-[38px]",
375
+ i
366
376
  ),
367
- style: n,
377
+ style: o,
368
378
  children: [
369
- /* @__PURE__ */ t(Ee, {}),
370
- /* @__PURE__ */ a(
379
+ /* @__PURE__ */ t(be, {}),
380
+ /* @__PURE__ */ d(
371
381
  "div",
372
382
  {
373
383
  className: R(
384
+ // m-1.5 = calc(var(--zd-spacing) * 1.5) = 6px at density 1, so the
385
+ // gradient border ring thins with the size variants. (Corner radii
386
+ // stay fixed, so at smaller sizes the ring is marginally non-uniform
387
+ // at the corners — a minor cosmetic trade-off.)
374
388
  "zd:flex zd:flex-1 zd:flex-col zd:m-1.5 zd:px-4 zd:overflow-hidden zd:rounded-4xl zd:relative",
375
- i
389
+ r
376
390
  ),
377
391
  style: { clipPath: "inset(0 round 32px)" },
378
392
  children: [
379
- /* @__PURE__ */ t(Ne, {}),
380
393
  /* @__PURE__ */ t(Se, {}),
381
- /* @__PURE__ */ a("div", { className: "zd:relative zd:z-10 zd:flex zd:flex-1 zd:flex-col zd:min-h-0", children: [
382
- r,
394
+ /* @__PURE__ */ t(Ee, {}),
395
+ /* @__PURE__ */ d("div", { className: "zd:relative zd:z-10 zd:flex zd:flex-1 zd:flex-col zd:min-h-0", children: [
396
+ c,
383
397
  /* @__PURE__ */ t(
384
398
  "div",
385
399
  {
386
400
  className: "zd:flex zd:flex-1 zd:flex-col zd:min-h-0 zd:overflow-y-auto zd:overflow-x-hidden",
387
- style: { paddingTop: `${be}px` },
401
+ style: {
402
+ paddingTop: `calc(${Ce / 4} * var(--zd-spacing))`
403
+ },
388
404
  children: e
389
405
  }
390
406
  )
@@ -396,19 +412,19 @@ function Ce({
396
412
  }
397
413
  );
398
414
  }
399
- const ke = "" + new URL("error.webp", import.meta.url).href, Ae = "" + new URL("loading.webp", import.meta.url).href, Oe = "" + new URL("send.webp", import.meta.url).href, Te = "" + new URL("success.webp", import.meta.url).href, Be = {
400
- error: ke,
401
- loading: Ae,
402
- send: Oe,
403
- success: Te
415
+ const Ae = "" + new URL("error.webp", import.meta.url).href, Oe = "" + new URL("loading.webp", import.meta.url).href, Te = "" + new URL("send.webp", import.meta.url).href, Be = "" + new URL("success.webp", import.meta.url).href, Ie = {
416
+ error: Ae,
417
+ loading: Oe,
418
+ send: Te,
419
+ success: Be
404
420
  };
405
421
  function I({
406
422
  imageName: e,
407
- title: o,
408
- children: i,
423
+ title: i,
424
+ children: r,
409
425
  className: n
410
426
  }) {
411
- return /* @__PURE__ */ a(
427
+ return /* @__PURE__ */ d(
412
428
  "div",
413
429
  {
414
430
  className: R("zd:flex zd:flex-col zd:gap-8 zd:items-center", n),
@@ -416,39 +432,39 @@ function I({
416
432
  /* @__PURE__ */ t(
417
433
  "img",
418
434
  {
419
- src: Be[e],
435
+ src: Ie[e],
420
436
  alt: e,
421
437
  className: "zd:w-[118px] zd:h-[118px] zd:bg-transparent"
422
438
  }
423
439
  ),
424
- /* @__PURE__ */ a("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:items-center", children: [
425
- /* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children: o }),
426
- /* @__PURE__ */ t(h, { className: "zd:text-center zd:whitespace-pre-wrap", children: i })
440
+ /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:items-center", children: [
441
+ /* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children: i }),
442
+ /* @__PURE__ */ t(h, { className: "zd:text-center zd:whitespace-pre-wrap", children: r })
427
443
  ] })
428
444
  ]
429
445
  }
430
446
  );
431
447
  }
432
- function ee() {
433
- const o = le().connectors.find((i) => i.id === "zerodev-wallet");
434
- if (!o || !("getKitStore" in o))
448
+ function Q() {
449
+ const i = ce().connectors.find((r) => r.id === "zerodev-wallet");
450
+ if (!i || !("getKitStore" in i))
435
451
  throw new Error("useKitStore must be used with the zeroDevWallet connector");
436
- return o.getKitStore();
452
+ return i.getKitStore();
437
453
  }
438
454
  function F() {
439
- const e = ee(), o = O(e, (l) => l.auth.step), i = O(e, (l) => l.auth.stepHistory), n = O(e, (l) => l.auth.email), r = O(e, (l) => l.auth.otpId), c = O(
455
+ const e = Q(), i = O(e, (l) => l.auth.step), r = O(e, (l) => l.auth.stepHistory), n = O(e, (l) => l.auth.email), o = O(e, (l) => l.auth.otpId), c = O(
440
456
  e,
441
457
  (l) => l.auth.otpEncryptionTargetBundle
442
458
  ), s = O(e, (l) => l.auth.enabledMethods), u = O(e, (l) => l.auth.config);
443
459
  return {
444
- step: o,
460
+ step: i,
445
461
  email: n,
446
- otpId: r,
462
+ otpId: o,
447
463
  otpEncryptionTargetBundle: c,
448
464
  enabledMethods: s,
449
465
  config: u,
450
466
  goToStep: e.getState().auth.goToStep,
451
- goBack: i.length > 0 ? e.getState().auth.goBack : null,
467
+ goBack: r.length > 0 ? e.getState().auth.goBack : null,
452
468
  reset: e.getState().auth.reset,
453
469
  setEmail: e.getState().auth.setEmail,
454
470
  setOtpSession: e.getState().auth.setOtpSession,
@@ -457,9 +473,9 @@ function F() {
457
473
  }
458
474
  function L({
459
475
  className: e,
460
- style: o
476
+ style: i
461
477
  }) {
462
- return /* @__PURE__ */ a(
478
+ return /* @__PURE__ */ d(
463
479
  "div",
464
480
  {
465
481
  className: R(
@@ -469,30 +485,31 @@ function L({
469
485
  children: [
470
486
  /* @__PURE__ */ t(h, { children: "Powered by" }),
471
487
  /* @__PURE__ */ t(
472
- X,
488
+ se,
473
489
  {
474
- name: "zerodevLogo",
475
- className: "zd:h-[18px] zd:w-auto",
476
- style: o
490
+ variant: "lockup",
491
+ tone: "black",
492
+ className: "zd:h-4.5 zd:w-auto",
493
+ style: i
477
494
  }
478
495
  )
479
496
  ]
480
497
  }
481
498
  );
482
499
  }
483
- function Ie() {
484
- const { email: e, setOtpSession: o } = F(), { mutateAsync: i, isPending: n } = J(), [r, c] = x(60), s = r <= 0 && !n;
500
+ function Fe() {
501
+ const { email: e, setOtpSession: i } = F(), { mutateAsync: r, isPending: n } = Y(), [o, c] = w(60), s = o <= 0 && !n;
485
502
  return P(() => {
486
- if (r <= 0) return;
503
+ if (o <= 0) return;
487
504
  const l = setInterval(() => {
488
505
  c((p) => Math.max(0, p - 1));
489
506
  }, 1e3);
490
507
  return () => {
491
508
  clearInterval(l);
492
509
  };
493
- }, [r]), /* @__PURE__ */ a(b, { children: [
494
- /* @__PURE__ */ a("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
495
- /* @__PURE__ */ a(
510
+ }, [o]), /* @__PURE__ */ d(b, { children: [
511
+ /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
512
+ /* @__PURE__ */ d(
496
513
  I,
497
514
  {
498
515
  imageName: "send",
@@ -508,7 +525,7 @@ function Ie() {
508
525
  ]
509
526
  }
510
527
  ),
511
- /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ a(h, { className: "zd:text-center", children: [
528
+ /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ d(h, { className: "zd:text-center", children: [
512
529
  "Did not get an email?",
513
530
  " ",
514
531
  /* @__PURE__ */ t(
@@ -519,15 +536,15 @@ function Ie() {
519
536
  onClick: async () => {
520
537
  if (!(!e || !s))
521
538
  try {
522
- const { otpId: l, otpEncryptionTargetBundle: p } = await i({
539
+ const { otpId: l, otpEncryptionTargetBundle: p } = await r({
523
540
  email: e
524
541
  });
525
- o({ otpId: l, otpEncryptionTargetBundle: p }), c(60);
542
+ i({ otpId: l, otpEncryptionTargetBundle: p }), c(60);
526
543
  } catch {
527
544
  }
528
545
  },
529
546
  className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
530
- children: s ? "Resend" : `Resend in ${r} ${r === 1 ? "second" : "seconds"}`
547
+ children: s ? "Resend" : `Resend in ${o} ${o === 1 ? "second" : "seconds"}`
531
548
  }
532
549
  )
533
550
  ] }) })
@@ -535,7 +552,7 @@ function Ie() {
535
552
  /* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
536
553
  ] });
537
554
  }
538
- function Fe() {
555
+ function Pe() {
539
556
  return typeof window > "u" ? !1 : new URLSearchParams(window.location.search).has("code");
540
557
  }
541
558
  function $() {
@@ -543,82 +560,82 @@ function $() {
543
560
  const e = new URL(window.location.href);
544
561
  e.searchParams.has("code") && (e.searchParams.delete("code"), window.history.replaceState(null, "", e.toString()));
545
562
  }
546
- function Pe({
563
+ function Re({
547
564
  title: e = "Oops, something went wrong",
548
- message: o = "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",
549
- showRetry: i = !1,
565
+ message: i = "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",
566
+ showRetry: r = !1,
550
567
  showChooseAnother: n = !0
551
568
  }) {
552
- const { goToStep: r, goBack: c, reset: s } = F();
553
- return /* @__PURE__ */ a(b, { children: [
554
- /* @__PURE__ */ a("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
555
- /* @__PURE__ */ t(I, { imageName: "error", title: e, children: o }),
556
- /* @__PURE__ */ a("div", { className: "zd:flex zd:flex-col zd:gap-1", children: [
557
- i && /* @__PURE__ */ t(C, { action: "primary", text: "Try again", onClick: c ?? (() => r("sign-up")) }),
569
+ const { goToStep: o, goBack: c, reset: s } = F();
570
+ return /* @__PURE__ */ d(b, { children: [
571
+ /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
572
+ /* @__PURE__ */ t(I, { imageName: "error", title: e, children: i }),
573
+ /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-1", children: [
574
+ r && /* @__PURE__ */ t(C, { action: "primary", text: "Try again", onClick: c ?? (() => o("sign-up")) }),
558
575
  n && /* @__PURE__ */ t(
559
576
  C,
560
577
  {
561
- action: i ? "secondary" : "primary",
578
+ action: r ? "secondary" : "primary",
562
579
  onClick: () => {
563
- $(), r("sign-up");
580
+ $(), o("sign-up");
564
581
  },
565
582
  text: "Choose another sign-in method"
566
583
  }
567
584
  ),
568
- !i && !n && /* @__PURE__ */ t(C, { action: "primary", text: "Start over", onClick: s })
585
+ !r && !n && /* @__PURE__ */ t(C, { action: "primary", text: "Start over", onClick: s })
569
586
  ] })
570
587
  ] }),
571
588
  /* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
572
589
  ] });
573
590
  }
574
- const Re = 4, Le = 8, $e = 6;
575
- function Ue(e) {
576
- return Math.max(Re, Math.min(Le, e));
591
+ const Le = 4, $e = 8, Ue = 6;
592
+ function Me(e) {
593
+ return Math.max(Le, Math.min($e, e));
577
594
  }
578
- function Me({ char: e, isFocused: o }) {
595
+ function je({ char: e, isFocused: i }) {
579
596
  return /* @__PURE__ */ t(
580
- de,
597
+ ae,
581
598
  {
582
599
  "data-testid": "code-input-box",
583
- "data-active": o || void 0,
600
+ "data-active": i || void 0,
584
601
  className: R(
585
602
  "zd:h-16 zd:w-14 zd:rounded-lg zd:flex zd:items-center zd:justify-center",
586
- o && "zd:border-[1.5px] zd:border-greyScale"
603
+ i && "zd:border-[1.5px] zd:border-greyScale"
587
604
  ),
588
605
  children: /* @__PURE__ */ t(h, { className: "zd:text-h2", children: e })
589
606
  }
590
607
  );
591
608
  }
592
- function je({
609
+ function _e({
593
610
  onChange: e,
594
- onComplete: o,
595
- disabled: i = !1,
611
+ onComplete: i,
612
+ disabled: r = !1,
596
613
  error: n = !1,
597
- autoFocus: r = !1,
598
- length: c = $e,
614
+ autoFocus: o = !1,
615
+ length: c = Ue,
599
616
  "data-testid": s
600
617
  }) {
601
- const u = Ue(c), l = ie(
618
+ const u = Me(c), l = re(
602
619
  () => Array.from({ length: u }, (f, g) => ({
603
620
  id: `char-${g}`,
604
621
  index: g
605
622
  })),
606
623
  [u]
607
- ), [p, w] = x(""), [m, N] = x(!1), k = K(null);
624
+ ), [p, x] = w(""), [m, N] = w(!1), k = K(null);
608
625
  P(() => {
609
626
  var f;
610
- r && !i && ((f = k.current) == null || f.focus());
611
- }, [r, i]), P(() => {
612
- w((f) => f.slice(0, u));
627
+ o && !r && ((f = k.current) == null || f.focus());
628
+ }, [o, r]), P(() => {
629
+ x((f) => f.slice(0, u));
613
630
  }, [u]);
614
631
  const S = (f) => {
615
632
  const g = f.slice(0, u).toUpperCase();
616
- w(g), e == null || e(g), g.length === u && setTimeout(() => {
633
+ x(g), e == null || e(g), g.length === u && setTimeout(() => {
617
634
  var T;
618
- o == null || o(g), (T = k.current) == null || T.blur();
635
+ i == null || i(g), (T = k.current) == null || T.blur();
619
636
  }, 0);
620
637
  };
621
- return /* @__PURE__ */ a(
638
+ return /* @__PURE__ */ d(
622
639
  "button",
623
640
  {
624
641
  type: "button",
@@ -627,7 +644,7 @@ function je({
627
644
  var f;
628
645
  return (f = k.current) == null ? void 0 : f.focus();
629
646
  },
630
- disabled: i,
647
+ disabled: r,
631
648
  "data-testid": s,
632
649
  children: [
633
650
  /* @__PURE__ */ t(
@@ -639,14 +656,14 @@ function je({
639
656
  onFocus: () => N(!0),
640
657
  onBlur: () => N(!1),
641
658
  maxLength: u,
642
- disabled: i,
659
+ disabled: r,
643
660
  className: "zd:absolute zd:opacity-0 zd:pointer-events-none",
644
661
  style: { position: "absolute", opacity: 0 },
645
662
  "aria-label": "Verification code"
646
663
  }
647
664
  ),
648
665
  l.map((f) => /* @__PURE__ */ t(
649
- Me,
666
+ je,
650
667
  {
651
668
  char: p[f.index] ?? "",
652
669
  isFocused: !n && m && f.index === p.length
@@ -657,16 +674,16 @@ function je({
657
674
  }
658
675
  );
659
676
  }
660
- function _e() {
677
+ function He() {
661
678
  const {
662
679
  email: e,
663
- otpId: o,
664
- otpEncryptionTargetBundle: i,
680
+ otpId: i,
681
+ otpEncryptionTargetBundle: r,
665
682
  setOtpSession: n,
666
- clearOtpSession: r,
683
+ clearOtpSession: o,
667
684
  goToStep: c,
668
685
  config: s
669
- } = F(), { mutateAsync: u, isPending: l } = Q(), { mutateAsync: p, isPending: w } = ue(), [m, N] = x(""), [k, S] = x(!1), [f, g] = x(60);
686
+ } = F(), { mutateAsync: u, isPending: l } = J(), { mutateAsync: p, isPending: x } = pe(), [m, N] = w(""), [k, S] = w(!1), [f, g] = w(60);
670
687
  P(() => {
671
688
  if (f <= 0) return;
672
689
  const v = setInterval(() => {
@@ -676,14 +693,14 @@ function _e() {
676
693
  }, [f]);
677
694
  const T = async () => {
678
695
  var v, A;
679
- if (!(!m.trim() || !o || !i)) {
696
+ if (!(!m.trim() || !i || !r)) {
680
697
  S(!1);
681
698
  try {
682
699
  await p({
683
- otpId: o,
700
+ otpId: i,
684
701
  code: m.trim(),
685
- otpEncryptionTargetBundle: i
686
- }), r(), c("authenticated"), (v = s == null ? void 0 : s.onSuccess) == null || v.call(s);
702
+ otpEncryptionTargetBundle: r
703
+ }), o(), c("authenticated"), (v = s == null ? void 0 : s.onSuccess) == null || v.call(s);
687
704
  } catch (_) {
688
705
  S(!0), (A = s == null ? void 0 : s.onError) == null || A.call(s, _);
689
706
  }
@@ -702,22 +719,22 @@ function _e() {
702
719
  S(!0);
703
720
  }
704
721
  }, U = f <= 0 && !l;
705
- return /* @__PURE__ */ a(b, { children: [
706
- /* @__PURE__ */ a("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center", children: [
707
- /* @__PURE__ */ a("div", { className: "zd:flex zd:flex-col zd:gap-4", children: [
722
+ return /* @__PURE__ */ d(b, { children: [
723
+ /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center", children: [
724
+ /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-4", children: [
708
725
  /* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Enter verification code" }),
709
- /* @__PURE__ */ a(h, { className: "zd:text-center", children: [
726
+ /* @__PURE__ */ d(h, { className: "zd:text-center", children: [
710
727
  "Enter the code from the email we sent to",
711
728
  " ",
712
729
  /* @__PURE__ */ t(h, { className: "zd:text-solarOrange", children: e })
713
730
  ] })
714
731
  ] }),
715
732
  /* @__PURE__ */ t(
716
- je,
733
+ _e,
717
734
  {
718
735
  onComplete: y,
719
736
  onChange: () => S(!1),
720
- disabled: w,
737
+ disabled: x,
721
738
  error: k,
722
739
  autoFocus: !0
723
740
  }
@@ -727,10 +744,10 @@ function _e() {
727
744
  {
728
745
  text: "Confirm code",
729
746
  onClick: T,
730
- disabled: !m.trim() || w
747
+ disabled: !m.trim() || x
731
748
  }
732
749
  ),
733
- /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ a(h, { className: "zd:text-center", children: [
750
+ /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ d(h, { className: "zd:text-center", children: [
734
751
  "Did not get an email?",
735
752
  " ",
736
753
  /* @__PURE__ */ t(
@@ -748,29 +765,29 @@ function _e() {
748
765
  /* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
749
766
  ] });
750
767
  }
751
- function He({
768
+ function Ge({
752
769
  termsAndConditionsUrl: e,
753
- privacyPolicyUrl: o,
754
- agreedToTerms: i,
770
+ privacyPolicyUrl: i,
771
+ agreedToTerms: r,
755
772
  setAgreedToTerms: n,
756
- highlight: r = !1
773
+ highlight: o = !1
757
774
  }) {
758
- return /* @__PURE__ */ a("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-5", children: [
759
- !!(e || o) && /* @__PURE__ */ a(
775
+ return /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-5", children: [
776
+ !!(e || i) && /* @__PURE__ */ d(
760
777
  "div",
761
778
  {
762
- className: `zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${r ? "zd:border zd:border-negative" : "zd:border zd:border-transparent"}`,
779
+ 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"}`,
763
780
  children: [
764
781
  /* @__PURE__ */ t(
765
782
  "input",
766
783
  {
767
784
  type: "checkbox",
768
- checked: i,
785
+ checked: r,
769
786
  onChange: (s) => n(s.target.checked),
770
787
  className: "zd:cursor-pointer zd:[color-scheme:light]"
771
788
  }
772
789
  ),
773
- /* @__PURE__ */ a(h, { className: "zd:flex-1", children: [
790
+ /* @__PURE__ */ d(h, { className: "zd:flex-1", children: [
774
791
  "I agree to the",
775
792
  " ",
776
793
  e && /* @__PURE__ */ t(
@@ -784,12 +801,12 @@ function He({
784
801
  children: "Terms & Conditions"
785
802
  }
786
803
  ),
787
- e && o && " and ",
788
- o && /* @__PURE__ */ t(
804
+ e && i && " and ",
805
+ i && /* @__PURE__ */ t(
789
806
  h,
790
807
  {
791
808
  as: "a",
792
- href: o,
809
+ href: i,
793
810
  target: "_blank",
794
811
  rel: "noopener noreferrer",
795
812
  className: "zd:underline",
@@ -803,18 +820,18 @@ function He({
803
820
  /* @__PURE__ */ t(L, {})
804
821
  ] });
805
822
  }
806
- const Ge = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
823
+ const We = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
807
824
  function M(e) {
808
- return Ge.test(e.trim());
825
+ return We.test(e.trim());
809
826
  }
810
- const We = "" + new URL("blob.webm", import.meta.url).href;
811
- function qe({ className: e }) {
827
+ const qe = "" + new URL("blob.webm", import.meta.url).href;
828
+ function De({ className: e }) {
812
829
  return /* @__PURE__ */ t(
813
830
  "video",
814
831
  {
815
832
  className: e,
816
833
  style: { aspectRatio: "1 / 1" },
817
- src: We,
834
+ src: qe,
818
835
  autoPlay: !0,
819
836
  loop: !0,
820
837
  muted: !0,
@@ -828,40 +845,40 @@ function H(e) {
828
845
  return e instanceof Error ? e.name === "AbortError" || e.name === "NotAllowedError" ? !0 : e.message.toLowerCase().includes("oauth popup was closed") : !1;
829
846
  }
830
847
  function Ve() {
831
- const { goToStep: e, setEmail: o, setOtpSession: i, config: n, enabledMethods: r } = F(), [c, s] = x(!1), [u, l] = x(!1), [p, w] = x(""), m = (n == null ? void 0 : n.emailAuthMethod) === "otp", { mutateAsync: N, isPending: k } = Q(), { mutateAsync: S, isPending: f } = J(), g = k || f, [T, y] = x(null), { mutateAsync: j, isPending: U } = pe({
848
+ const { goToStep: e, setEmail: i, setOtpSession: r, config: n, enabledMethods: o } = F(), [c, s] = w(!1), [u, l] = w(!1), [p, x] = w(""), m = (n == null ? void 0 : n.emailAuthMethod) === "otp", { mutateAsync: N, isPending: k } = J(), { mutateAsync: S, isPending: f } = Y(), g = k || f, [T, y] = w(null), { mutateAsync: j, isPending: U } = fe({
832
849
  mutation: {
833
850
  onSuccess: async () => {
834
- var d;
835
- e("authenticated"), (d = n == null ? void 0 : n.onSuccess) == null || d.call(n);
851
+ var a;
852
+ e("authenticated"), (a = n == null ? void 0 : n.onSuccess) == null || a.call(n);
836
853
  },
837
- onError: (d) => {
854
+ onError: (a) => {
838
855
  var z;
839
- (z = n == null ? void 0 : n.onError) == null || z.call(n, d);
856
+ (z = n == null ? void 0 : n.onError) == null || z.call(n, a);
840
857
  }
841
858
  }
842
- }), { mutate: v, isPending: A } = fe({
859
+ }), { mutate: v, isPending: A } = he({
843
860
  mutation: {
844
861
  onSuccess: () => {
845
- var d;
846
- e("authenticated"), (d = n == null ? void 0 : n.onSuccess) == null || d.call(n);
862
+ var a;
863
+ e("authenticated"), (a = n == null ? void 0 : n.onSuccess) == null || a.call(n);
847
864
  },
848
- onError: (d) => {
865
+ onError: (a) => {
849
866
  var z;
850
- H(d) || y(d instanceof Error ? d.message : String(d)), (z = n == null ? void 0 : n.onError) == null || z.call(n, d);
867
+ H(a) || y(a instanceof Error ? a.message : String(a)), (z = n == null ? void 0 : n.onError) == null || z.call(n, a);
851
868
  }
852
869
  }
853
- }), { mutate: _, isPending: te } = he({
870
+ }), { mutate: _, isPending: ee } = ze({
854
871
  mutation: {
855
872
  onSuccess: () => {
856
- var d;
857
- e("authenticated"), (d = n == null ? void 0 : n.onSuccess) == null || d.call(n);
873
+ var a;
874
+ e("authenticated"), (a = n == null ? void 0 : n.onSuccess) == null || a.call(n);
858
875
  },
859
- onError: (d) => {
876
+ onError: (a) => {
860
877
  var z;
861
- H(d) || y(d instanceof Error ? d.message : String(d)), (z = n == null ? void 0 : n.onError) == null || z.call(n, d);
878
+ H(a) || y(a instanceof Error ? a.message : String(a)), (z = n == null ? void 0 : n.onError) == null || z.call(n, a);
862
879
  }
863
880
  }
864
- }), E = U || g || A || te, B = !!(n != null && n.termsAndConditionsUrl || n != null && n.privacyPolicyUrl) && !c, ne = () => {
881
+ }), E = U || g || A || ee, B = !!(n != null && n.termsAndConditionsUrl || n != null && n.privacyPolicyUrl) && !c, te = () => {
865
882
  if (!E) {
866
883
  if (B) {
867
884
  l(!0);
@@ -869,7 +886,7 @@ function Ve() {
869
886
  }
870
887
  y(null), v();
871
888
  }
872
- }, oe = () => {
889
+ }, ne = () => {
873
890
  if (!E) {
874
891
  if (B) {
875
892
  l(!0);
@@ -877,7 +894,7 @@ function Ve() {
877
894
  }
878
895
  y(null), _();
879
896
  }
880
- }, re = async () => {
897
+ }, oe = async () => {
881
898
  if (B) {
882
899
  l(!0);
883
900
  return;
@@ -885,9 +902,9 @@ function Ve() {
885
902
  y(null);
886
903
  try {
887
904
  await j({ provider: "google" });
888
- } catch (d) {
889
- const z = d instanceof Error ? d.message : String(d);
890
- H(d) || y(z);
905
+ } catch (a) {
906
+ const z = a instanceof Error ? a.message : String(a);
907
+ H(a) || y(z);
891
908
  }
892
909
  }, W = m ? async () => {
893
910
  if (!(!p || E) && M(p)) {
@@ -897,13 +914,13 @@ function Ve() {
897
914
  }
898
915
  y(null);
899
916
  try {
900
- const { otpId: d, otpEncryptionTargetBundle: z } = await N({
917
+ const { otpId: a, otpEncryptionTargetBundle: z } = await N({
901
918
  email: p
902
919
  });
903
- o(p), i({ otpId: d, otpEncryptionTargetBundle: z }), e("otp-input");
904
- } catch (d) {
920
+ i(p), r({ otpId: a, otpEncryptionTargetBundle: z }), e("otp-input");
921
+ } catch (a) {
905
922
  y(
906
- d instanceof Error ? d.message : "Failed to send verification code"
923
+ a instanceof Error ? a.message : "Failed to send verification code"
907
924
  );
908
925
  }
909
926
  }
@@ -915,18 +932,18 @@ function Ve() {
915
932
  }
916
933
  y(null);
917
934
  try {
918
- const { otpId: d, otpEncryptionTargetBundle: z } = await S({
935
+ const { otpId: a, otpEncryptionTargetBundle: z } = await S({
919
936
  email: p
920
937
  });
921
- o(p), i({ otpId: d, otpEncryptionTargetBundle: z }), e("email-verification");
922
- } catch (d) {
938
+ i(p), r({ otpId: a, otpEncryptionTargetBundle: z }), e("email-verification");
939
+ } catch (a) {
923
940
  y(
924
- d instanceof Error ? d.message : "Failed to send verification code"
941
+ a instanceof Error ? a.message : "Failed to send verification code"
925
942
  );
926
943
  }
927
944
  }
928
945
  };
929
- return T ? /* @__PURE__ */ t("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full", children: /* @__PURE__ */ a("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:max-w-md", children: [
946
+ return T ? /* @__PURE__ */ t("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full", children: /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:max-w-md", children: [
930
947
  /* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Error occurred" }),
931
948
  /* @__PURE__ */ t(h, { className: "zd:text-center zd:text-red-500", children: T }),
932
949
  /* @__PURE__ */ t(
@@ -937,16 +954,16 @@ function Ve() {
937
954
  onClick: () => y(null)
938
955
  }
939
956
  )
940
- ] }) }) : /* @__PURE__ */ a("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden", children: [
941
- /* @__PURE__ */ a("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-center", children: [
942
- /* @__PURE__ */ a("div", { className: "zd:px-4 zd:flex zd:flex-col zd:items-center", children: [
943
- /* @__PURE__ */ t("div", { className: "zd:w-full zd:px-16 zd:py-4", children: /* @__PURE__ */ t(qe, { className: "zd:w-full zd:pointer-events-none zd:select-none" }) }),
957
+ ] }) }) : /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden", children: [
958
+ /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-center", children: [
959
+ /* @__PURE__ */ d("div", { className: "zd:px-4 zd:flex zd:flex-col zd:items-center", children: [
960
+ /* @__PURE__ */ t("div", { className: "zd:w-full zd:px-16 zd:py-4", children: /* @__PURE__ */ t(De, { className: "zd:w-full zd:pointer-events-none zd:select-none" }) }),
944
961
  /* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Continue to your wallet" }),
945
962
  /* @__PURE__ */ t(h, { className: "zd:mt-2 zd:text-center zd:text-greyScale/50", children: "Choose a sign-in method to proceed" })
946
963
  ] }),
947
- /* @__PURE__ */ a("div", { className: "zd:mt-6 zd:flex zd:flex-col zd:gap-4 zd:mb-4", children: [
948
- r.includes("passkey") && /* @__PURE__ */ a(b, { children: [
949
- /* @__PURE__ */ a("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
964
+ /* @__PURE__ */ d("div", { className: "zd:mt-6 zd:flex zd:flex-col zd:gap-4 zd:mb-4", children: [
965
+ o.includes("passkey") && /* @__PURE__ */ d(b, { children: [
966
+ /* @__PURE__ */ d("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
950
967
  /* @__PURE__ */ t(
951
968
  C,
952
969
  {
@@ -955,7 +972,7 @@ function Ve() {
955
972
  iconName: "key",
956
973
  trailIcon: !0,
957
974
  disabled: E,
958
- onClick: ne
975
+ onClick: te
959
976
  }
960
977
  ),
961
978
  /* @__PURE__ */ t(
@@ -966,43 +983,43 @@ function Ve() {
966
983
  iconName: "key",
967
984
  trailIcon: !0,
968
985
  disabled: E,
969
- onClick: oe
986
+ onClick: ne
970
987
  }
971
988
  )
972
989
  ] }),
973
- /* @__PURE__ */ a("div", { className: "zd:flex zd:items-center zd:gap-3", children: [
990
+ /* @__PURE__ */ d("div", { className: "zd:flex zd:items-center zd:gap-3", children: [
974
991
  /* @__PURE__ */ t("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" }),
975
992
  /* @__PURE__ */ t(h, { className: "zd:text-body3", children: "or" }),
976
993
  /* @__PURE__ */ t("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" })
977
994
  ] })
978
995
  ] }),
979
- /* @__PURE__ */ a("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
980
- r.includes("google") && /* @__PURE__ */ t(
981
- Y,
996
+ /* @__PURE__ */ d("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
997
+ o.includes("google") && /* @__PURE__ */ t(
998
+ X,
982
999
  {
983
1000
  iconName: "google",
984
1001
  title: "Google",
985
1002
  chevron: !0,
986
1003
  className: "zd:rounded-3xl",
987
1004
  disabled: E,
988
- onClick: re
1005
+ onClick: oe
989
1006
  }
990
1007
  ),
991
- r.includes("email") && /* @__PURE__ */ t(
992
- ae,
1008
+ o.includes("email") && /* @__PURE__ */ t(
1009
+ de,
993
1010
  {
994
1011
  iconName: "email",
995
1012
  placeholder: "Enter your email",
996
1013
  value: p,
997
- onChange: (d) => w(d.target.value),
1014
+ onChange: (a) => x(a.target.value),
998
1015
  type: "email",
999
1016
  autoCapitalize: "none",
1000
1017
  autoComplete: "email",
1001
1018
  disabled: E,
1002
1019
  variant: "listItemStyle",
1003
1020
  containerClassName: "zd:rounded-3xl",
1004
- onKeyDown: (d) => {
1005
- d.key === "Enter" && p && !E && W();
1021
+ onKeyDown: (a) => {
1022
+ a.key === "Enter" && p && !E && W();
1006
1023
  },
1007
1024
  children: g ? /* @__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(
1008
1025
  "button",
@@ -1011,7 +1028,7 @@ function Ve() {
1011
1028
  disabled: !M(p) || B,
1012
1029
  className: `zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${M(p) && !B ? "zd:cursor-pointer" : "zd:cursor-not-allowed zd:opacity-50"}`,
1013
1030
  onClick: () => W(),
1014
- children: /* @__PURE__ */ t(X, { name: "chevronRight", className: "zd:text-greyScale" })
1031
+ children: /* @__PURE__ */ t(le, { name: "chevronRight", className: "zd:text-greyScale" })
1015
1032
  }
1016
1033
  )
1017
1034
  }
@@ -1020,54 +1037,54 @@ function Ve() {
1020
1037
  ] })
1021
1038
  ] }),
1022
1039
  /* @__PURE__ */ t("div", { className: "zd:px-4", children: /* @__PURE__ */ t(
1023
- He,
1040
+ Ge,
1024
1041
  {
1025
1042
  termsAndConditionsUrl: n == null ? void 0 : n.termsAndConditionsUrl,
1026
1043
  privacyPolicyUrl: n == null ? void 0 : n.privacyPolicyUrl,
1027
1044
  agreedToTerms: c,
1028
- setAgreedToTerms: (d) => {
1029
- s(d), d && l(!1);
1045
+ setAgreedToTerms: (a) => {
1046
+ s(a), a && l(!1);
1030
1047
  },
1031
1048
  highlight: u
1032
1049
  }
1033
1050
  ) })
1034
1051
  ] });
1035
1052
  }
1036
- function De() {
1053
+ function Ke() {
1037
1054
  return typeof window > "u" ? null : new URLSearchParams(window.location.search).get("code");
1038
1055
  }
1039
- function Ke() {
1056
+ function Xe() {
1040
1057
  const {
1041
1058
  otpId: e,
1042
- otpEncryptionTargetBundle: o,
1043
- goToStep: i,
1059
+ otpEncryptionTargetBundle: i,
1060
+ goToStep: r,
1044
1061
  clearOtpSession: n,
1045
- config: r
1046
- } = F(), [c] = x(De), [s, u] = x(null), l = K(!1), { mutate: p, isPending: w } = ze({
1062
+ config: o
1063
+ } = F(), [c] = w(Ke), [s, u] = w(null), l = K(!1), { mutate: p, isPending: x } = me({
1047
1064
  mutation: {
1048
1065
  onSuccess: async () => {
1049
1066
  var m;
1050
- n(), i("authenticated"), (m = r == null ? void 0 : r.onSuccess) == null || m.call(r);
1067
+ n(), r("authenticated"), (m = o == null ? void 0 : o.onSuccess) == null || m.call(o);
1051
1068
  },
1052
1069
  onError: (m) => {
1053
1070
  var N;
1054
- u(m), (N = r == null ? void 0 : r.onError) == null || N.call(r, m);
1071
+ u(m), (N = o == null ? void 0 : o.onError) == null || N.call(o, m);
1055
1072
  }
1056
1073
  }
1057
1074
  });
1058
1075
  return P(() => {
1059
1076
  if (!(l.current || !c)) {
1060
- if (l.current = !0, !e || !o) {
1061
- $(), i(null);
1077
+ if (l.current = !0, !e || !i) {
1078
+ $(), r(null);
1062
1079
  return;
1063
1080
  }
1064
- p({ otpId: e, code: c, otpEncryptionTargetBundle: o });
1081
+ p({ otpId: e, code: c, otpEncryptionTargetBundle: i });
1065
1082
  }
1066
- }, [e, o, c, p, i]), /* @__PURE__ */ a(b, { children: [
1067
- /* @__PURE__ */ a("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
1068
- !s && w && /* @__PURE__ */ t(I, { imageName: "loading", title: "Verifying Your Email", children: "Please wait while we securely connect your wallet." }),
1069
- !s && !c && !w && /* @__PURE__ */ a(b, { children: [
1070
- /* @__PURE__ */ a(I, { imageName: "error", title: "Invalid Link", children: [
1083
+ }, [e, i, c, p, r]), /* @__PURE__ */ d(b, { children: [
1084
+ /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
1085
+ !s && x && /* @__PURE__ */ t(I, { imageName: "loading", title: "Verifying Your Email", children: "Please wait while we securely connect your wallet." }),
1086
+ !s && !c && !x && /* @__PURE__ */ d(b, { children: [
1087
+ /* @__PURE__ */ d(I, { imageName: "error", title: "Invalid Link", children: [
1071
1088
  "This verification link is invalid or incomplete.",
1072
1089
  /* @__PURE__ */ t("br", {}),
1073
1090
  "Please check your email and try again with the correct link."
@@ -1077,20 +1094,20 @@ function Ke() {
1077
1094
  {
1078
1095
  action: "primary",
1079
1096
  onClick: () => {
1080
- $(), i("sign-up");
1097
+ $(), r("sign-up");
1081
1098
  },
1082
1099
  text: "Choose another sign-in method"
1083
1100
  }
1084
1101
  )
1085
1102
  ] }),
1086
- s != null && /* @__PURE__ */ a(b, { children: [
1103
+ s != null && /* @__PURE__ */ d(b, { children: [
1087
1104
  /* @__PURE__ */ t(I, { 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." }),
1088
1105
  /* @__PURE__ */ t(
1089
1106
  C,
1090
1107
  {
1091
1108
  action: "primary",
1092
1109
  onClick: () => {
1093
- $(), i("sign-up");
1110
+ $(), r("sign-up");
1094
1111
  },
1095
1112
  text: "Choose another sign-in method"
1096
1113
  }
@@ -1100,9 +1117,9 @@ function Ke() {
1100
1117
  /* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
1101
1118
  ] });
1102
1119
  }
1103
- function Xe() {
1104
- const { goToStep: e } = F(), { connect: o, connectors: i, isPending: n } = ce(), r = i.filter((s) => s.id !== "zerodev-wallet"), c = (s) => {
1105
- o(
1120
+ function Ye() {
1121
+ const { goToStep: e } = F(), { connect: i, connectors: r, isPending: n } = ue(), o = r.filter((s) => s.id !== "zerodev-wallet"), c = (s) => {
1122
+ i(
1106
1123
  { connector: s },
1107
1124
  {
1108
1125
  onSuccess: () => {
@@ -1111,11 +1128,11 @@ function Xe() {
1111
1128
  }
1112
1129
  );
1113
1130
  };
1114
- return /* @__PURE__ */ a(b, { children: [
1115
- /* @__PURE__ */ a("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
1131
+ return /* @__PURE__ */ d(b, { children: [
1132
+ /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
1116
1133
  /* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Select your wallet" }),
1117
- /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-2", children: r.length === 0 ? /* @__PURE__ */ t(h, { className: "zd:text-center", children: "No wallets detected. Install a browser wallet extension to continue." }) : r.map((s) => /* @__PURE__ */ t(
1118
- Y,
1134
+ /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-2", children: o.length === 0 ? /* @__PURE__ */ t(h, { className: "zd:text-center", children: "No wallets detected. Install a browser wallet extension to continue." }) : o.map((s) => /* @__PURE__ */ t(
1135
+ X,
1119
1136
  {
1120
1137
  title: s.name,
1121
1138
  iconName: "walletOutline",
@@ -1130,82 +1147,84 @@ function Xe() {
1130
1147
  /* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
1131
1148
  ] });
1132
1149
  }
1133
- const Ye = {
1150
+ const Je = {
1134
1151
  "wallet-selection": "Choose your wallet"
1135
1152
  };
1136
- function Je() {
1153
+ function Ze() {
1137
1154
  return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(I, { imageName: "loading", title: "Authenticating...", children: "Please wait while we complete the OAuth authentication." }) });
1138
1155
  }
1139
1156
  function Qe() {
1140
1157
  return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(I, { imageName: "loading", title: "Passkey authentication", children: "Please authenticate with your passkey." }) });
1141
1158
  }
1142
- function Ze(e) {
1159
+ function et(e) {
1143
1160
  switch (e) {
1144
1161
  case "sign-up":
1145
1162
  return /* @__PURE__ */ t(Ve, {});
1146
1163
  case "email-verification":
1147
- return /* @__PURE__ */ t(Ie, {});
1164
+ return /* @__PURE__ */ t(Fe, {});
1148
1165
  case "otp-input":
1149
- return /* @__PURE__ */ t(_e, {});
1166
+ return /* @__PURE__ */ t(He, {});
1150
1167
  case "verifying-otp":
1151
- return /* @__PURE__ */ t(Ke, {});
1168
+ return /* @__PURE__ */ t(Xe, {});
1152
1169
  case "oauth-in-progress":
1153
- return /* @__PURE__ */ t(Je, {});
1170
+ return /* @__PURE__ */ t(Ze, {});
1154
1171
  case "passkey-prompt":
1155
1172
  return /* @__PURE__ */ t(Qe, {});
1156
1173
  case "wallet-selection":
1157
- return /* @__PURE__ */ t(Xe, {});
1174
+ return /* @__PURE__ */ t(Ye, {});
1158
1175
  case "error":
1159
- return /* @__PURE__ */ t(Pe, {});
1176
+ return /* @__PURE__ */ t(Re, {});
1160
1177
  default:
1161
1178
  return null;
1162
1179
  }
1163
1180
  }
1164
- function zt({
1165
- onClose: e
1181
+ function mt({
1182
+ onClose: e,
1183
+ size: i
1166
1184
  } = {}) {
1167
- const { step: o, goToStep: i, goBack: n, reset: r } = F(), c = O(ee(), (p) => p.logo);
1185
+ const { step: r, goToStep: n, goBack: o, reset: c } = F(), s = O(Q(), (x) => x.logo);
1168
1186
  P(() => {
1169
- o === null && Fe() && i("verifying-otp");
1170
- }, [o, i]);
1171
- const s = Ze(o);
1172
- if (!s) return null;
1173
- const u = () => {
1174
- $(), r(), e == null || e();
1175
- }, l = o ? Ye[o] : void 0;
1187
+ r === null && Pe() && n("verifying-otp");
1188
+ }, [r, n]);
1189
+ const u = et(r);
1190
+ if (!u) return null;
1191
+ const l = () => {
1192
+ $(), c(), e == null || e();
1193
+ }, p = r ? Je[r] : void 0;
1176
1194
  return /* @__PURE__ */ t(
1177
- Ce,
1195
+ ke,
1178
1196
  {
1179
- contentClassName: o === "sign-up" ? "zd:px-0" : void 0,
1197
+ ...i && { size: i },
1198
+ contentClassName: r === "sign-up" ? "zd:px-0" : void 0,
1180
1199
  topNav: /* @__PURE__ */ t(
1181
- xe,
1200
+ we,
1182
1201
  {
1183
- ...n !== null && { onBack: n },
1184
- onClose: u,
1185
- ...l && { title: l },
1186
- ...o === "sign-up" && {
1187
- ...c && { logo: c },
1202
+ ...o !== null && { onBack: o },
1203
+ onClose: l,
1204
+ ...p && { title: p },
1205
+ ...r === "sign-up" && {
1206
+ ...s && { logo: s },
1188
1207
  className: "zd:px-4"
1189
1208
  }
1190
1209
  }
1191
1210
  ),
1192
- children: s
1211
+ children: u
1193
1212
  }
1194
1213
  );
1195
1214
  }
1196
1215
  const G = "zerodev:auth:otpSession";
1197
- function et() {
1216
+ function tt() {
1198
1217
  if (typeof window > "u") return null;
1199
1218
  try {
1200
1219
  const e = window.localStorage.getItem(G);
1201
1220
  if (!e) return null;
1202
- const o = JSON.parse(e);
1203
- return !(o != null && o.otpId) || !(o != null && o.otpEncryptionTargetBundle) ? null : o;
1221
+ const i = JSON.parse(e);
1222
+ return !(i != null && i.otpId) || !(i != null && i.otpEncryptionTargetBundle) ? null : i;
1204
1223
  } catch {
1205
1224
  return null;
1206
1225
  }
1207
1226
  }
1208
- function tt(e) {
1227
+ function nt(e) {
1209
1228
  if (!(typeof window > "u"))
1210
1229
  try {
1211
1230
  window.localStorage.setItem(
@@ -1215,14 +1234,14 @@ function tt(e) {
1215
1234
  } catch {
1216
1235
  }
1217
1236
  }
1218
- function V() {
1237
+ function D() {
1219
1238
  if (!(typeof window > "u"))
1220
1239
  try {
1221
1240
  window.localStorage.removeItem(G);
1222
1241
  } catch {
1223
1242
  }
1224
1243
  }
1225
- const nt = (e, o, i) => ({
1244
+ const ot = (e, i, r) => ({
1226
1245
  auth: {
1227
1246
  // Initial state
1228
1247
  step: null,
@@ -1234,42 +1253,42 @@ const nt = (e, o, i) => ({
1234
1253
  config: null,
1235
1254
  // Actions
1236
1255
  initialize: (n) => {
1237
- const r = et();
1256
+ const o = tt();
1238
1257
  e((c) => ({
1239
1258
  auth: {
1240
1259
  ...c.auth,
1241
1260
  config: n,
1242
1261
  enabledMethods: n.enabledMethods,
1243
- ...r && {
1244
- otpId: r.otpId,
1245
- otpEncryptionTargetBundle: r.otpEncryptionTargetBundle
1262
+ ...o && {
1263
+ otpId: o.otpId,
1264
+ otpEncryptionTargetBundle: o.otpEncryptionTargetBundle
1246
1265
  }
1247
1266
  }
1248
1267
  }));
1249
1268
  },
1250
1269
  goToStep: (n) => {
1251
- e((r) => ({
1270
+ e((o) => ({
1252
1271
  auth: {
1253
- ...r.auth,
1272
+ ...o.auth,
1254
1273
  step: n,
1255
- stepHistory: r.auth.step === null ? r.auth.stepHistory : [...r.auth.stepHistory, r.auth.step]
1274
+ stepHistory: o.auth.step === null ? o.auth.stepHistory : [...o.auth.stepHistory, o.auth.step]
1256
1275
  }
1257
1276
  }));
1258
1277
  },
1259
1278
  goBack: () => {
1260
- const { auth: n } = o();
1279
+ const { auth: n } = i();
1261
1280
  if (n.stepHistory.length === 0) return;
1262
- const r = [...n.stepHistory], c = r.pop();
1281
+ const o = [...n.stepHistory], c = o.pop();
1263
1282
  e((s) => ({
1264
1283
  auth: {
1265
1284
  ...s.auth,
1266
1285
  step: c,
1267
- stepHistory: r
1286
+ stepHistory: o
1268
1287
  }
1269
1288
  }));
1270
1289
  },
1271
1290
  reset: () => {
1272
- V(), e((n) => ({
1291
+ D(), e((n) => ({
1273
1292
  auth: {
1274
1293
  ...n.auth,
1275
1294
  step: null,
@@ -1281,24 +1300,24 @@ const nt = (e, o, i) => ({
1281
1300
  }));
1282
1301
  },
1283
1302
  setEmail: (n) => {
1284
- e((r) => ({
1303
+ e((o) => ({
1285
1304
  auth: {
1286
- ...r.auth,
1305
+ ...o.auth,
1287
1306
  email: n
1288
1307
  }
1289
1308
  }));
1290
1309
  },
1291
- setOtpSession: ({ otpId: n, otpEncryptionTargetBundle: r }) => {
1292
- tt({ otpId: n, otpEncryptionTargetBundle: r }), e((c) => ({
1310
+ setOtpSession: ({ otpId: n, otpEncryptionTargetBundle: o }) => {
1311
+ nt({ otpId: n, otpEncryptionTargetBundle: o }), e((c) => ({
1293
1312
  auth: {
1294
1313
  ...c.auth,
1295
1314
  otpId: n,
1296
- otpEncryptionTargetBundle: r
1315
+ otpEncryptionTargetBundle: o
1297
1316
  }
1298
1317
  }));
1299
1318
  },
1300
1319
  clearOtpSession: () => {
1301
- V(), e((n) => ({
1320
+ D(), e((n) => ({
1302
1321
  auth: {
1303
1322
  ...n.auth,
1304
1323
  otpId: null,
@@ -1307,37 +1326,37 @@ const nt = (e, o, i) => ({
1307
1326
  }));
1308
1327
  }
1309
1328
  }
1310
- }), ot = (e = {}) => se()(
1311
- ye((o, i, n) => ({
1329
+ }), rt = (e = {}) => ie()(
1330
+ xe((i, r, n) => ({
1312
1331
  pendingRequests: [],
1313
1332
  userConfirmationListenerActive: !1,
1314
1333
  logo: e.logo ?? null,
1315
- addPendingRequest: (r) => o((c) => ({
1316
- pendingRequests: [...c.pendingRequests, r]
1334
+ addPendingRequest: (o) => i((c) => ({
1335
+ pendingRequests: [...c.pendingRequests, o]
1317
1336
  })),
1318
- removePendingRequest: (r) => o((c) => ({
1319
- pendingRequests: c.pendingRequests.filter((s) => s.id !== r)
1337
+ removePendingRequest: (o) => i((c) => ({
1338
+ pendingRequests: c.pendingRequests.filter((s) => s.id !== o)
1320
1339
  })),
1321
- clearPendingRequests: () => o({ pendingRequests: [] }),
1322
- setUserConfirmationListenerActive: (r) => o({ userConfirmationListenerActive: r }),
1323
- ...nt(o, i)
1340
+ clearPendingRequests: () => i({ pendingRequests: [] }),
1341
+ setUserConfirmationListenerActive: (o) => i({ userConfirmationListenerActive: o }),
1342
+ ...ot(i, r)
1324
1343
  }))
1325
1344
  );
1326
- function rt(e) {
1327
- return new Promise((o, i) => {
1345
+ function it(e) {
1346
+ return new Promise((i, r) => {
1328
1347
  const n = e.subscribe(
1329
- (r) => r.auth.step,
1330
- (r) => {
1331
- r === "authenticated" ? (n(), o()) : r === null && (n(), i(new Error("Auth flow dismissed")));
1348
+ (o) => o.auth.step,
1349
+ (o) => {
1350
+ o === "authenticated" ? (n(), i()) : o === null && (n(), r(new Error("Auth flow dismissed")));
1332
1351
  }
1333
1352
  );
1334
1353
  });
1335
1354
  }
1336
- function mt(e) {
1337
- var n, r;
1338
- const o = me(e), i = ot({ logo: (n = e.config) == null ? void 0 : n.logo });
1339
- return (r = e.config) != null && r.auth && i.getState().auth.initialize(e.config.auth), (c) => {
1340
- const s = o(c);
1355
+ function gt(e) {
1356
+ var n, o;
1357
+ const i = ge(e), r = rt({ logo: (n = e.config) == null ? void 0 : n.logo });
1358
+ return (o = e.config) != null && o.auth && r.getState().auth.initialize(e.config.auth), (c) => {
1359
+ const s = i(c);
1341
1360
  return {
1342
1361
  ...s,
1343
1362
  async connect(u) {
@@ -1345,30 +1364,30 @@ function mt(e) {
1345
1364
  try {
1346
1365
  return await s.connect(u);
1347
1366
  } catch (p) {
1348
- if (u != null && u.isReconnecting || !((l = e.config) != null && l.auth) || !(p instanceof ge))
1367
+ if (u != null && u.isReconnecting || !((l = e.config) != null && l.auth) || !(p instanceof ye))
1349
1368
  throw p;
1350
- if (i.getState().auth.step !== null)
1369
+ if (r.getState().auth.step !== null)
1351
1370
  throw new Error("Auth flow already in progress");
1352
- return i.getState().auth.goToStep("sign-up"), await rt(i), s.connect(u);
1371
+ return r.getState().auth.goToStep("sign-up"), await it(r), s.connect(u);
1353
1372
  }
1354
1373
  },
1355
1374
  async disconnect() {
1356
1375
  var u, l;
1357
- await ((u = s.disconnect) == null ? void 0 : u.call(s)), (l = e.config) != null && l.auth && i.getState().auth.reset();
1376
+ await ((u = s.disconnect) == null ? void 0 : u.call(s)), (l = e.config) != null && l.auth && r.getState().auth.reset();
1358
1377
  },
1359
1378
  async setup() {
1360
1379
  var u;
1361
1380
  await ((u = s.setup) == null ? void 0 : u.call(s)), typeof window > "u";
1362
1381
  },
1363
1382
  getKitStore() {
1364
- return i;
1383
+ return r;
1365
1384
  }
1366
1385
  };
1367
1386
  };
1368
1387
  }
1369
1388
  export {
1370
- zt as AuthFlow,
1389
+ mt as AuthFlow,
1371
1390
  F as useAuth,
1372
- mt as zeroDevWallet
1391
+ gt as zeroDevWallet
1373
1392
  };
1374
1393
  //# sourceMappingURL=index.mjs.map