@levo-so/studio 0.1.102 → 0.1.104

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/{AuthProvider-56TywIOB.js → AuthProvider-C6bvedwF.js} +16 -16
  2. package/{BillingStep-BTRobf00.js → BillingStep-2cKT5Pir.js} +1 -1
  3. package/{Button-DTrN8kki.js → Button-DtPwDEN0.js} +240 -143
  4. package/Button-lUfKisu8.js +116 -0
  5. package/CollectionField-xa-jed3_.js +232 -0
  6. package/{CollectionInput-lHOvWWav.js → CollectionInput-CpNGIXJx.js} +32 -32
  7. package/DateTimeWidget-DPHIhkAi.js +256 -0
  8. package/Dialog-IrII0ugb.js +130 -0
  9. package/{EntryCard-CqZlbw1Z.js → EntryCard-j4uZb2cE.js} +6 -6
  10. package/{LoginCard-DWLnYJJU.js → LoginCard-asvOHIRg.js} +3 -3
  11. package/{LoginForm-CEUbBeE3.js → LoginForm-BdsPVHdO.js} +200 -200
  12. package/{LoginModal-AWNLO49X.js → LoginModal-CyvbEK26.js} +4 -4
  13. package/{MessageCard-C5ULcfuw.js → MessageCard-lrXKEsBP.js} +2 -2
  14. package/{MessageFooter-CATwNJJU.js → MessageFooter-D-dCrzJH.js} +2 -2
  15. package/{ModalManager-DQXhkmyC.js → ModalManager-BcPk4sbK.js} +1 -1
  16. package/{PendingApprovalCard-BowwZMBu.js → PendingApprovalCard-hYkupl9A.js} +3 -3
  17. package/PhoneWidget-BOFhs8Ra.js +100 -0
  18. package/{Popover-Du4iigVw.js → Popover-O1poOHk2.js} +19 -20
  19. package/PopupRenderer-C7OHYphU-IWM6d7gW.js +2668 -0
  20. package/{RichTextWidget-iYdVRBGB.js → RichTextWidget-18XLL8wW.js} +27 -25
  21. package/RteThemeProvider-Cfepkyer.js +20 -0
  22. package/{StripePaymentModal-DC-ySB_o.js → StripePaymentModal-DrLMN18M.js} +17 -17
  23. package/Toolbar-Y6JtgPFn.js +645 -0
  24. package/Tooltip-NEMQqPyr.js +67 -0
  25. package/VerifyButton-TNkt-SDu.js +177 -0
  26. package/bookingCard-BdV2YSkq.js +636 -0
  27. package/collection.js +8 -8
  28. package/{dialog-CCWrvmHd.js → dialog-C8-iHixJ.js} +32 -32
  29. package/dist-CsX9NP5P.js +3188 -0
  30. package/generateRadiusScale-BpcgkGtN.js +71 -0
  31. package/getFieldValidations-CSkSV2hW.js +90 -0
  32. package/index.d.ts +53 -2
  33. package/index.js +5867 -7655
  34. package/inlineRteTheme-Ajq9PNpQ.js +9 -0
  35. package/{nodeAlignment-DoVbjk29.js → nodeAlignment-DKCIjzlR.js} +3 -3
  36. package/package.json +60 -76
  37. package/rolldown-runtime-CAFD8bLK.js +11 -0
  38. package/studio.css +1 -1
  39. package/{useLogin-D2VCOHYI.js → useLogin-B2qE8710.js} +23 -23
  40. package/{utils-Bh9uGjo1.js → utils-CZLafTgN.js} +1 -1
  41. package/{widgets-CG5Z_dk7.js → widgets-eu5zXTf-.js} +38 -105
  42. package/CollectionField-7uXvhxYK.js +0 -274
  43. package/DateTimeWidget-BHCP5osb.js +0 -255
  44. package/PhoneWidget-C6uZmrk8.js +0 -100
  45. package/Toolbar-BHi_B-nE.js +0 -737
  46. package/Tooltip-K_gFzjOa.js +0 -68
  47. package/VerifyButton-D21AOIX3.js +0 -273
  48. package/bookingCard--NlgtcJs.js +0 -577
  49. package/dist-x5VFEnQl.js +0 -3185
  50. package/getFieldValidations-DZnDgNI0.js +0 -159
  51. package/inlineRteTheme-Cn_Vqgsm.js +0 -23
  52. /package/{Beams-DkcjMVZl.js → Beams-DEybrmUZ.js} +0 -0
  53. /package/{Dots-BrEPvoj3.js → Dots-CMyy77GM.js} +0 -0
  54. /package/{Gradient-B4Er9hym.js → Gradient-DBn_zXzI.js} +0 -0
  55. /package/{Grid-B4XWU9eL.js → Grid-kGCr-6by.js} +0 -0
  56. /package/{Waves-kW-EBDdJ.js → Waves-DjLcbiBu.js} +0 -0
  57. /package/{authentication-fXmNYss1.js → authentication-hnV1BI8s.js} +0 -0
  58. /package/{card-BwNr7kQS.js → card-5ooLmYSr.js} +0 -0
  59. /package/{theme.cssm-2YTdd8Yh.js → theme.cssm-BXDp-ojp.js} +0 -0
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { t as e } from "./useLogin-D2VCOHYI.js";
3
- import { c as t, t as n } from "./authentication-fXmNYss1.js";
4
- import { useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
5
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
6
- import { getLevoError as u } from "@levo-so/core";
7
- import { LevoOAuth as d, errorHandler as f, successToast as p, useLevo as m } from "@levo-so/react";
2
+ import { t as e } from "./useLogin-B2qE8710.js";
3
+ import { c as t, t as n } from "./authentication-hnV1BI8s.js";
4
+ import { LevoOAuth as r, errorHandler as i, successToast as a, useLevo as o } from "@levo-so/react";
5
+ import { useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
6
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
7
+ import { getLevoError as m } from "@levo-so/core";
8
8
  import { ChevronDown as h } from "lucide-react";
9
9
  import { Popover as g } from "radix-ui";
10
10
  import * as _ from "yup";
@@ -35,10 +35,10 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
35
35
  iconEnter: "_iconEnter_1je4h_103",
36
36
  iconScale: "_iconScale_1je4h_1",
37
37
  text: "_text_1je4h_119"
38
- }, P = ({ className: e, children: t, isLoading: n = !1, isError: i = !1, loadingText: a = "Loading...", successText: s = "Success!", errorText: u = "Error!", variant: d = "default", size: f = "default", disabled: p, ...m }) => {
39
- let [h, g] = o(!1), [_, v] = o(!1), [y, b] = o(n);
40
- r(() => {
41
- if (y && !n) if (i) {
38
+ }, P = ({ className: e, children: t, isLoading: n = !1, isError: r = !1, loadingText: i = "Loading...", successText: a = "Success!", errorText: o = "Error!", variant: c = "default", size: l = "default", disabled: d, ...m }) => {
39
+ let [h, g] = u(!1), [_, v] = u(!1), [y, b] = u(n);
40
+ s(() => {
41
+ if (y && !n) if (r) {
42
42
  v(!0);
43
43
  let e = setTimeout(() => {
44
44
  v(!1);
@@ -55,14 +55,14 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
55
55
  }, [
56
56
  n,
57
57
  y,
58
- i
58
+ r
59
59
  ]);
60
- let x = () => n ? a : h ? s : _ ? u : t, S = () => _ ? "destructive" : h ? "success" : d, C = () => n ? /* @__PURE__ */ c("div", {
60
+ let x = () => n ? i : h ? a : _ ? o : t, S = () => _ ? "destructive" : h ? "success" : c, C = () => n ? /* @__PURE__ */ f("div", {
61
61
  className: `${N.icon} ${N.iconEnter}`,
62
- children: /* @__PURE__ */ c("svg", {
62
+ children: /* @__PURE__ */ f("svg", {
63
63
  className: N.spinner,
64
64
  viewBox: "0 0 24 24",
65
- children: /* @__PURE__ */ c("circle", {
65
+ children: /* @__PURE__ */ f("circle", {
66
66
  cx: "12",
67
67
  cy: "12",
68
68
  r: "10",
@@ -73,16 +73,16 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
73
73
  strokeDashoffset: "32"
74
74
  })
75
75
  })
76
- }) : h && !n ? /* @__PURE__ */ c("div", {
76
+ }) : h && !n ? /* @__PURE__ */ f("div", {
77
77
  className: `${N.icon} ${N.iconEnter}`,
78
- children: /* @__PURE__ */ l("svg", {
78
+ children: /* @__PURE__ */ p("svg", {
79
79
  viewBox: "0 0 24 24",
80
- children: [/* @__PURE__ */ c("circle", {
80
+ children: [/* @__PURE__ */ f("circle", {
81
81
  cx: "12",
82
82
  cy: "12",
83
83
  r: "10",
84
84
  fill: "currentColor"
85
- }), /* @__PURE__ */ c("path", {
85
+ }), /* @__PURE__ */ f("path", {
86
86
  d: "m9 12 2 2 4-4",
87
87
  stroke: "white",
88
88
  strokeWidth: "2",
@@ -91,9 +91,9 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
91
91
  strokeLinejoin: "round"
92
92
  })]
93
93
  })
94
- }) : _ && !n ? /* @__PURE__ */ c("div", {
94
+ }) : _ && !n ? /* @__PURE__ */ f("div", {
95
95
  className: `${N.icon} ${N.iconEnter}`,
96
- children: /* @__PURE__ */ l("svg", {
96
+ children: /* @__PURE__ */ p("svg", {
97
97
  xmlns: "http://www.w3.org/2000/svg",
98
98
  width: "24",
99
99
  height: "24",
@@ -104,25 +104,25 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
104
104
  strokeLinecap: "round",
105
105
  strokeLinejoin: "round",
106
106
  children: [
107
- /* @__PURE__ */ c("circle", {
107
+ /* @__PURE__ */ f("circle", {
108
108
  cx: "12",
109
109
  cy: "12",
110
110
  r: "10"
111
111
  }),
112
- /* @__PURE__ */ c("path", { d: "m15 9-6 6" }),
113
- /* @__PURE__ */ c("path", { d: "m9 9 6 6" })
112
+ /* @__PURE__ */ f("path", { d: "m15 9-6 6" }),
113
+ /* @__PURE__ */ f("path", { d: "m9 9 6 6" })
114
114
  ]
115
115
  })
116
116
  }) : null;
117
- return /* @__PURE__ */ c("button", {
117
+ return /* @__PURE__ */ f("button", {
118
118
  className: `${N.button} ${e || ""}`,
119
119
  "data-variant": S(),
120
- "data-size": f,
121
- disabled: p || n,
120
+ "data-size": l,
121
+ disabled: d || n,
122
122
  ...m,
123
- children: /* @__PURE__ */ l("div", {
123
+ children: /* @__PURE__ */ p("div", {
124
124
  className: N.content,
125
- children: [C(), /* @__PURE__ */ c("span", {
125
+ children: [C(), /* @__PURE__ */ f("span", {
126
126
  className: N.text,
127
127
  children: x()
128
128
  })]
@@ -134,15 +134,15 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
134
134
  inputWrapper: "_inputWrapper_wx5fd_13",
135
135
  input: "_input_wx5fd_13",
136
136
  editButton: "_editButton_wx5fd_38"
137
- }, I = ({ email: e, setEmail: t, otpSent: n, handleReset: r }) => /* @__PURE__ */ l("div", {
137
+ }, I = ({ email: e, setEmail: t, otpSent: n, handleReset: r }) => /* @__PURE__ */ p("div", {
138
138
  className: F.container,
139
- children: [/* @__PURE__ */ c("label", {
139
+ children: [/* @__PURE__ */ f("label", {
140
140
  htmlFor: "email",
141
141
  className: F.label,
142
142
  children: "Email"
143
- }), /* @__PURE__ */ l("div", {
143
+ }), /* @__PURE__ */ p("div", {
144
144
  className: F.inputWrapper,
145
- children: [/* @__PURE__ */ c("input", {
145
+ children: [/* @__PURE__ */ f("input", {
146
146
  id: "email",
147
147
  type: "email",
148
148
  value: e,
@@ -150,7 +150,7 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
150
150
  className: F.input,
151
151
  placeholder: "Enter your email",
152
152
  disabled: n
153
- }), n && /* @__PURE__ */ c(P, {
153
+ }), n && /* @__PURE__ */ f(P, {
154
154
  type: "button",
155
155
  variant: "outline",
156
156
  onClick: () => r(),
@@ -168,17 +168,17 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
168
168
  submessage: "_submessage_x1dec_49",
169
169
  actions: "_actions_x1dec_55",
170
170
  resetButton: "_resetButton_x1dec_59"
171
- }, R = ({ email: e, onReset: t }) => /* @__PURE__ */ l("div", {
171
+ }, R = ({ email: e, onReset: t }) => /* @__PURE__ */ p("div", {
172
172
  className: L.container,
173
173
  children: [
174
- /* @__PURE__ */ c("div", {
174
+ /* @__PURE__ */ f("div", {
175
175
  className: L.iconWrapper,
176
- children: /* @__PURE__ */ c("svg", {
176
+ children: /* @__PURE__ */ f("svg", {
177
177
  className: L.icon,
178
178
  fill: "none",
179
179
  viewBox: "0 0 24 24",
180
180
  stroke: "currentColor",
181
- children: /* @__PURE__ */ c("path", {
181
+ children: /* @__PURE__ */ f("path", {
182
182
  strokeLinecap: "round",
183
183
  strokeLinejoin: "round",
184
184
  strokeWidth: 2,
@@ -186,26 +186,26 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
186
186
  })
187
187
  })
188
188
  }),
189
- /* @__PURE__ */ l("div", {
189
+ /* @__PURE__ */ p("div", {
190
190
  className: L.content,
191
191
  children: [
192
- /* @__PURE__ */ c("h3", {
192
+ /* @__PURE__ */ f("h3", {
193
193
  className: L.title,
194
194
  children: "Check your email"
195
195
  }),
196
- /* @__PURE__ */ l("p", {
196
+ /* @__PURE__ */ p("p", {
197
197
  className: L.message,
198
- children: ["We've sent a magic link to ", /* @__PURE__ */ c("strong", { children: e })]
198
+ children: ["We've sent a magic link to ", /* @__PURE__ */ f("strong", { children: e })]
199
199
  }),
200
- /* @__PURE__ */ c("p", {
200
+ /* @__PURE__ */ f("p", {
201
201
  className: L.submessage,
202
202
  children: "Click the link in your email to sign in. The link will expire in 15 minutes."
203
203
  })
204
204
  ]
205
205
  }),
206
- /* @__PURE__ */ c("div", {
206
+ /* @__PURE__ */ f("div", {
207
207
  className: L.actions,
208
- children: /* @__PURE__ */ c(P, {
208
+ children: /* @__PURE__ */ f(P, {
209
209
  variant: "outline",
210
210
  onClick: t,
211
211
  className: L.resetButton,
@@ -231,88 +231,88 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
231
231
  errorTitle: "_errorTitle_1mfd3_112",
232
232
  errorMessage: "_errorMessage_1mfd3_119",
233
233
  errorDismiss: "_errorDismiss_1mfd3_125"
234
- }, B = ({ error: e, onDismiss: t }) => /* @__PURE__ */ c("div", {
234
+ }, B = ({ error: e, onDismiss: t }) => /* @__PURE__ */ f("div", {
235
235
  className: z.errorContainer,
236
- children: /* @__PURE__ */ l("div", {
236
+ children: /* @__PURE__ */ p("div", {
237
237
  className: z.errorContent,
238
- children: [/* @__PURE__ */ l("div", {
238
+ children: [/* @__PURE__ */ p("div", {
239
239
  className: z.errorText,
240
- children: [e.title && /* @__PURE__ */ c("div", {
240
+ children: [e.title && /* @__PURE__ */ f("div", {
241
241
  className: z.errorTitle,
242
242
  children: e.title
243
- }), /* @__PURE__ */ c("div", {
243
+ }), /* @__PURE__ */ f("div", {
244
244
  className: z.errorMessage,
245
245
  children: e.message || "An unexpected error occurred"
246
246
  })]
247
- }), t && /* @__PURE__ */ c("button", {
247
+ }), t && /* @__PURE__ */ f("button", {
248
248
  onClick: t,
249
249
  className: z.errorDismiss,
250
250
  "aria-label": "Dismiss error",
251
251
  children: "×"
252
252
  })]
253
253
  })
254
- }), V = ({ onMagicLinkSent: n, onPendingApproval: i }) => {
255
- let { sendMagicLink: a } = e(), [s, d] = o(!1), [f, p] = o(null);
256
- r(() => {
257
- n?.(s);
258
- }, [s, n]);
259
- let m = v({
254
+ }), V = ({ onMagicLinkSent: n, onPendingApproval: r }) => {
255
+ let { sendMagicLink: i } = e(), [a, o] = u(!1), [c, l] = u(null);
256
+ s(() => {
257
+ n?.(a);
258
+ }, [a, n]);
259
+ let d = v({
260
260
  initialValues: { email: "" },
261
261
  validationSchema: M,
262
262
  validateOnChange: !1,
263
263
  validateOnBlur: !1,
264
- onSubmit: async (e, { setSubmitting: n, setFieldError: r }) => {
264
+ onSubmit: async (e, { setSubmitting: n, setFieldError: a }) => {
265
265
  try {
266
- p(null), await a(e.email), d(!0);
266
+ l(null), await i(e.email), o(!0);
267
267
  } catch (e) {
268
- let n = u(e);
268
+ let n = m(e);
269
269
  if (t(n.code)) {
270
- i?.();
270
+ r?.();
271
271
  return;
272
272
  }
273
273
  n.hasFieldErrors ? n.fieldErrors.forEach((e) => {
274
- r(e.param, e.message);
275
- }) : p(n);
274
+ a(e.param, e.message);
275
+ }) : l(n);
276
276
  } finally {
277
277
  n(!1);
278
278
  }
279
279
  }
280
280
  }), h = () => {
281
- d(!1), m.resetForm(), p(null);
281
+ o(!1), d.resetForm(), l(null);
282
282
  };
283
- return s ? /* @__PURE__ */ c(R, {
284
- email: m.values.email,
283
+ return a ? /* @__PURE__ */ f(R, {
284
+ email: d.values.email,
285
285
  onReset: h
286
- }) : /* @__PURE__ */ l("form", {
287
- onSubmit: m.handleSubmit,
286
+ }) : /* @__PURE__ */ p("form", {
287
+ onSubmit: d.handleSubmit,
288
288
  style: {
289
289
  display: "flex",
290
290
  flexDirection: "column",
291
291
  gap: "1rem"
292
292
  },
293
293
  children: [
294
- /* @__PURE__ */ c(I, {
295
- email: m.values.email,
296
- setEmail: (e) => m.setFieldValue("email", e),
294
+ /* @__PURE__ */ f(I, {
295
+ email: d.values.email,
296
+ setEmail: (e) => d.setFieldValue("email", e),
297
297
  otpSent: !1,
298
298
  handleReset: h
299
299
  }),
300
- /* @__PURE__ */ c("div", {
300
+ /* @__PURE__ */ f("div", {
301
301
  className: z.buttonWrapper,
302
- children: /* @__PURE__ */ c(P, {
302
+ children: /* @__PURE__ */ f(P, {
303
303
  type: "submit",
304
- isLoading: m.isSubmitting,
305
- isError: !!f,
306
- disabled: m.isSubmitting,
304
+ isLoading: d.isSubmitting,
305
+ isError: !!c,
306
+ disabled: d.isSubmitting,
307
307
  className: z.fullWidthButton,
308
308
  loadingText: "Sending Magic Link...",
309
309
  errorText: "Failed to Send",
310
310
  children: "Send Magic Link"
311
311
  })
312
312
  }),
313
- f && /* @__PURE__ */ c(B, {
314
- error: f,
315
- onDismiss: () => p(null)
313
+ c && /* @__PURE__ */ f(B, {
314
+ error: c,
315
+ onDismiss: () => l(null)
316
316
  })
317
317
  ]
318
318
  });
@@ -323,36 +323,36 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
323
323
  input: "_input_1c9qn_13",
324
324
  resendButton: "_resendButton_1c9qn_36"
325
325
  }, U = ({ otpSent: e, isResendingOtp: t, otp: n, resendOTP: r, setOtp: i }) => {
326
- let [a, s] = o(0);
327
- return e ? /* @__PURE__ */ l("div", {
326
+ let [a, o] = u(0);
327
+ return e ? /* @__PURE__ */ p("div", {
328
328
  className: H.container,
329
329
  children: [
330
- /* @__PURE__ */ c("label", {
330
+ /* @__PURE__ */ f("label", {
331
331
  className: H.label,
332
332
  children: "Verification Code"
333
333
  }),
334
- /* @__PURE__ */ c("div", {
334
+ /* @__PURE__ */ f("div", {
335
335
  className: H.inputGroup,
336
- children: /* @__PURE__ */ c(b, {
336
+ children: /* @__PURE__ */ f(b, {
337
337
  value: n,
338
338
  onChange: i,
339
339
  numInputs: 4,
340
340
  inputStyle: { marginRight: "12px" },
341
341
  inputType: "tel",
342
342
  skipDefaultStyles: !0,
343
- renderInput: ({ className: e, ...t }) => /* @__PURE__ */ c("input", {
343
+ renderInput: ({ className: e, ...t }) => /* @__PURE__ */ f("input", {
344
344
  className: `${H.input} ${e}`,
345
345
  ...t
346
346
  })
347
347
  })
348
348
  }),
349
- /* @__PURE__ */ c("button", {
349
+ /* @__PURE__ */ f("button", {
350
350
  type: "button",
351
351
  onClick: () => {
352
352
  r(() => {
353
- s(30);
353
+ o(30);
354
354
  let e = setInterval(() => {
355
- s((t) => t <= 1 ? (clearInterval(e), 0) : t - 1);
355
+ o((t) => t <= 1 ? (clearInterval(e), 0) : t - 1);
356
356
  }, 1e3);
357
357
  });
358
358
  },
@@ -363,32 +363,32 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
363
363
  ]
364
364
  }) : null;
365
365
  }, W = ({ onPendingApproval: n }) => {
366
- let { sendOTP: r, verifyOTP: i, resendOTP: a } = e(), [s, d] = o(!1), [f, p] = o(null), [m, h] = o(!1), g = v({
366
+ let { sendOTP: r, verifyOTP: i, resendOTP: a } = e(), [o, s] = u(!1), [c, l] = u(null), [d, h] = u(!1), g = v({
367
367
  initialValues: {
368
368
  email: "",
369
369
  otp: ""
370
370
  },
371
- validationSchema: s ? k : O,
371
+ validationSchema: o ? k : O,
372
372
  validateOnChange: !1,
373
373
  validateOnBlur: !1,
374
- onSubmit: async (e, { setSubmitting: a, setFieldError: o }) => {
374
+ onSubmit: async (e, { setSubmitting: a, setFieldError: c }) => {
375
375
  try {
376
- p(null), s ? await i(e.email, e.otp) : (await r({ email: e.email }), d(!0));
376
+ l(null), o ? await i(e.email, e.otp) : (await r({ email: e.email }), s(!0));
377
377
  } catch (e) {
378
- let r = u(e);
378
+ let r = m(e);
379
379
  if (t(r.code)) {
380
380
  n?.();
381
381
  return;
382
382
  }
383
383
  r.hasFieldErrors ? r.fieldErrors.forEach((e) => {
384
- o(e.param, e.message);
385
- }) : p(r);
384
+ c(e.param, e.message);
385
+ }) : l(r);
386
386
  } finally {
387
387
  a(!1);
388
388
  }
389
389
  }
390
390
  });
391
- return /* @__PURE__ */ l("form", {
391
+ return /* @__PURE__ */ p("form", {
392
392
  onSubmit: g.handleSubmit,
393
393
  style: {
394
394
  display: "flex",
@@ -396,44 +396,44 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
396
396
  gap: "1rem"
397
397
  },
398
398
  children: [
399
- /* @__PURE__ */ c(I, {
399
+ /* @__PURE__ */ f(I, {
400
400
  email: g.values.email,
401
401
  setEmail: (e) => g.setFieldValue("email", e),
402
- otpSent: s,
402
+ otpSent: o,
403
403
  handleReset: () => {
404
- d(!1), g.resetForm(), p(null);
404
+ s(!1), g.resetForm(), l(null);
405
405
  }
406
406
  }),
407
- /* @__PURE__ */ c(U, {
408
- otpSent: s,
407
+ /* @__PURE__ */ f(U, {
408
+ otpSent: o,
409
409
  otp: g.values.otp,
410
410
  setOtp: (e) => g.setFieldValue("otp", e),
411
- isResendingOtp: m,
411
+ isResendingOtp: d,
412
412
  resendOTP: async () => {
413
413
  try {
414
- h(!0), p(null), await a({ email: g.values.email });
414
+ h(!0), l(null), await a({ email: g.values.email });
415
415
  } catch (e) {
416
- p(u(e));
416
+ l(m(e));
417
417
  } finally {
418
418
  h(!1);
419
419
  }
420
420
  }
421
421
  }),
422
- /* @__PURE__ */ c("div", {
422
+ /* @__PURE__ */ f("div", {
423
423
  className: z.buttonWrapper,
424
- children: s ? /* @__PURE__ */ c(P, {
424
+ children: o ? /* @__PURE__ */ f(P, {
425
425
  type: "submit",
426
426
  isLoading: g.isSubmitting,
427
- isError: !!f,
427
+ isError: !!c,
428
428
  disabled: g.isSubmitting || !g.values.otp,
429
429
  className: z.fullWidthButton,
430
430
  loadingText: "Verifying...",
431
431
  errorText: "Verification Failed",
432
432
  children: "Verify & Sign In"
433
- }) : /* @__PURE__ */ c(P, {
433
+ }) : /* @__PURE__ */ f(P, {
434
434
  type: "submit",
435
435
  isLoading: g.isSubmitting,
436
- isError: !!f,
436
+ isError: !!c,
437
437
  disabled: g.isSubmitting,
438
438
  className: z.fullWidthButton,
439
439
  loadingText: "Sending Code...",
@@ -441,9 +441,9 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
441
441
  children: "Send Code"
442
442
  })
443
443
  }),
444
- f && /* @__PURE__ */ c(B, {
445
- error: f,
446
- onDismiss: () => p(null)
444
+ c && /* @__PURE__ */ f(B, {
445
+ error: c,
446
+ onDismiss: () => l(null)
447
447
  })
448
448
  ]
449
449
  });
@@ -460,7 +460,7 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
460
460
  countryName: "_countryName_1fvbo_118",
461
461
  dialCode: "_dialCode_1fvbo_125"
462
462
  }, K = ({ phone: e, setPhone: t, otpSent: n, handleReset: r }) => {
463
- let [i, s] = o(!1), [u, d] = o(""), f = a(null), p = a(null), { inputValue: m, handlePhoneValueChange: _, inputRef: v, country: y, setCountry: b } = w({
463
+ let [i, a] = u(!1), [o, s] = u(""), c = l(null), d = l(null), { inputValue: m, handlePhoneValueChange: _, inputRef: v, country: y, setCountry: b } = w({
464
464
  defaultCountry: "in",
465
465
  value: e,
466
466
  countries: S,
@@ -471,32 +471,32 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
471
471
  forceDialCode: !0
472
472
  }), T = S.filter((e) => {
473
473
  let t = C(e);
474
- return t.name.toLowerCase().includes(u.toLowerCase()) || t.dialCode.includes(u);
474
+ return t.name.toLowerCase().includes(o.toLowerCase()) || t.dialCode.includes(o);
475
475
  });
476
- return /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
476
+ return /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
477
477
  className: G.label,
478
478
  children: "Phone Number"
479
- }), /* @__PURE__ */ l("div", {
479
+ }), /* @__PURE__ */ p("div", {
480
480
  className: G.inputWrapper,
481
- children: [/* @__PURE__ */ l("div", {
481
+ children: [/* @__PURE__ */ p("div", {
482
482
  className: G.phoneInputWrapper,
483
- children: [/* @__PURE__ */ l(g.Root, {
483
+ children: [/* @__PURE__ */ p(g.Root, {
484
484
  open: i,
485
- onOpenChange: s,
486
- children: [/* @__PURE__ */ c(g.Trigger, {
485
+ onOpenChange: a,
486
+ children: [/* @__PURE__ */ f(g.Trigger, {
487
487
  asChild: !0,
488
488
  disabled: n,
489
- children: /* @__PURE__ */ l("button", {
489
+ children: /* @__PURE__ */ p("button", {
490
490
  type: "button",
491
491
  className: G.selector,
492
492
  disabled: n,
493
- children: [/* @__PURE__ */ c(x, {
493
+ children: [/* @__PURE__ */ f(x, {
494
494
  iso2: y.iso2,
495
495
  style: {
496
496
  width: "24px",
497
497
  height: "16px"
498
498
  }
499
- }), /* @__PURE__ */ c(h, {
499
+ }), /* @__PURE__ */ f(h, {
500
500
  size: 16,
501
501
  style: {
502
502
  marginLeft: "4px",
@@ -504,24 +504,24 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
504
504
  }
505
505
  })]
506
506
  })
507
- }), /* @__PURE__ */ c(g.Portal, { children: /* @__PURE__ */ l(g.Content, {
507
+ }), /* @__PURE__ */ f(g.Portal, { children: /* @__PURE__ */ p(g.Content, {
508
508
  className: G.dropdownContent,
509
509
  align: "start",
510
510
  side: "bottom",
511
511
  sideOffset: 4,
512
512
  onOpenAutoFocus: (e) => {
513
- e.preventDefault(), p.current?.focus();
513
+ e.preventDefault(), d.current?.focus();
514
514
  },
515
- children: [/* @__PURE__ */ c("div", {
515
+ children: [/* @__PURE__ */ f("div", {
516
516
  style: { padding: "0.5rem" },
517
- children: /* @__PURE__ */ c("input", {
518
- ref: p,
517
+ children: /* @__PURE__ */ f("input", {
518
+ ref: d,
519
519
  type: "text",
520
520
  placeholder: "Search country...",
521
- value: u,
522
- onChange: (e) => d(e.target.value),
521
+ value: o,
522
+ onChange: (e) => s(e.target.value),
523
523
  onKeyDown: (e) => {
524
- e.key === "ArrowDown" && (e.preventDefault(), (f.current?.firstElementChild)?.focus());
524
+ e.key === "ArrowDown" && (e.preventDefault(), (c.current?.firstElementChild)?.focus());
525
525
  },
526
526
  className: G.input,
527
527
  style: {
@@ -529,45 +529,45 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
529
529
  borderLeft: "1px solid #d1d5db"
530
530
  }
531
531
  })
532
- }), /* @__PURE__ */ l("div", {
533
- ref: f,
532
+ }), /* @__PURE__ */ p("div", {
533
+ ref: c,
534
534
  style: {
535
535
  overflowY: "auto",
536
536
  flex: 1
537
537
  },
538
538
  children: [T.map((e) => {
539
539
  let t = C(e), n = t.iso2 === y.iso2;
540
- return /* @__PURE__ */ l("button", {
540
+ return /* @__PURE__ */ p("button", {
541
541
  type: "button",
542
542
  className: G.countryItem,
543
543
  "data-selected": n,
544
544
  onClick: () => {
545
- b(t.iso2), s(!1), d("");
545
+ b(t.iso2), a(!1), s("");
546
546
  },
547
547
  onKeyDown: (e) => {
548
548
  if (e.key === "ArrowDown") e.preventDefault(), e.currentTarget.nextElementSibling?.focus();
549
549
  else if (e.key === "ArrowUp") {
550
550
  e.preventDefault();
551
551
  let t = e.currentTarget.previousElementSibling;
552
- t ? t.focus() : p.current?.focus();
552
+ t ? t.focus() : d.current?.focus();
553
553
  }
554
554
  },
555
555
  children: [
556
- /* @__PURE__ */ c(x, {
556
+ /* @__PURE__ */ f(x, {
557
557
  iso2: t.iso2,
558
558
  className: G.flag
559
559
  }),
560
- /* @__PURE__ */ c("span", {
560
+ /* @__PURE__ */ f("span", {
561
561
  className: G.countryName,
562
562
  children: t.name
563
563
  }),
564
- /* @__PURE__ */ l("span", {
564
+ /* @__PURE__ */ p("span", {
565
565
  className: G.dialCode,
566
566
  children: ["+", t.dialCode]
567
567
  })
568
568
  ]
569
569
  }, t.iso2);
570
- }), T.length === 0 && /* @__PURE__ */ c("div", {
570
+ }), T.length === 0 && /* @__PURE__ */ f("div", {
571
571
  style: {
572
572
  padding: "1rem",
573
573
  textAlign: "center",
@@ -578,7 +578,7 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
578
578
  })]
579
579
  })]
580
580
  }) })]
581
- }), /* @__PURE__ */ c("input", {
581
+ }), /* @__PURE__ */ f("input", {
582
582
  ref: v,
583
583
  type: "tel",
584
584
  value: m,
@@ -586,7 +586,7 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
586
586
  className: G.input,
587
587
  disabled: n
588
588
  })]
589
- }), n && /* @__PURE__ */ c(P, {
589
+ }), n && /* @__PURE__ */ f(P, {
590
590
  variant: "outline",
591
591
  onClick: () => r(),
592
592
  className: G.editButton,
@@ -594,35 +594,35 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
594
594
  })]
595
595
  })] });
596
596
  }, q = ({ onPendingApproval: n }) => {
597
- let { sendOTP: r, verifyOTP: i, resendOTP: a } = e(), [s, d] = o(!1), [f, p] = o(null), [m, h] = o(!1), g = v({
597
+ let { sendOTP: r, verifyOTP: i, resendOTP: a } = e(), [o, s] = u(!1), [c, l] = u(null), [d, h] = u(!1), g = v({
598
598
  initialValues: {
599
599
  phone: "",
600
600
  otp: ""
601
601
  },
602
- validationSchema: s ? j : A,
602
+ validationSchema: o ? j : A,
603
603
  validateOnChange: !1,
604
604
  validateOnBlur: !1,
605
- onSubmit: async (e, { setSubmitting: a, setFieldError: o }) => {
605
+ onSubmit: async (e, { setSubmitting: a, setFieldError: c }) => {
606
606
  try {
607
- p(null), s ? await i(e.phone, e.otp) : (await r({
607
+ l(null), o ? await i(e.phone, e.otp) : (await r({
608
608
  phone: e.phone,
609
609
  medium: "whatsapp"
610
- }), d(!0));
610
+ }), s(!0));
611
611
  } catch (e) {
612
- let r = u(e);
612
+ let r = m(e);
613
613
  if (t(r.code)) {
614
614
  n?.();
615
615
  return;
616
616
  }
617
617
  r.hasFieldErrors ? r.fieldErrors.forEach((e) => {
618
- o(e.param, e.message);
619
- }) : p(r);
618
+ c(e.param, e.message);
619
+ }) : l(r);
620
620
  } finally {
621
621
  a(!1);
622
622
  }
623
623
  }
624
624
  });
625
- return /* @__PURE__ */ l("form", {
625
+ return /* @__PURE__ */ p("form", {
626
626
  onSubmit: g.handleSubmit,
627
627
  style: {
628
628
  display: "flex",
@@ -630,47 +630,47 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
630
630
  gap: "1rem"
631
631
  },
632
632
  children: [
633
- /* @__PURE__ */ c(K, {
633
+ /* @__PURE__ */ f(K, {
634
634
  phone: g.values.phone,
635
635
  setPhone: (e) => g.setFieldValue("phone", e),
636
- otpSent: s,
636
+ otpSent: o,
637
637
  handleReset: () => {
638
- d(!1), g.resetForm(), p(null);
638
+ s(!1), g.resetForm(), l(null);
639
639
  }
640
640
  }),
641
- /* @__PURE__ */ c(U, {
642
- otpSent: s,
641
+ /* @__PURE__ */ f(U, {
642
+ otpSent: o,
643
643
  otp: g.values.otp,
644
644
  setOtp: (e) => g.setFieldValue("otp", e),
645
- isResendingOtp: m,
645
+ isResendingOtp: d,
646
646
  resendOTP: async () => {
647
647
  try {
648
- h(!0), p(null), await a({
648
+ h(!0), l(null), await a({
649
649
  phone: g.values.phone,
650
650
  medium: "whatsapp"
651
651
  });
652
652
  } catch (e) {
653
- p(u(e));
653
+ l(m(e));
654
654
  } finally {
655
655
  h(!1);
656
656
  }
657
657
  }
658
658
  }),
659
- /* @__PURE__ */ c("div", {
659
+ /* @__PURE__ */ f("div", {
660
660
  className: z.buttonWrapper,
661
- children: s ? /* @__PURE__ */ c(P, {
661
+ children: o ? /* @__PURE__ */ f(P, {
662
662
  type: "submit",
663
663
  isLoading: g.isSubmitting,
664
- isError: !!f,
664
+ isError: !!c,
665
665
  disabled: g.isSubmitting,
666
666
  className: z.fullWidthButton,
667
667
  loadingText: "Verifying...",
668
668
  errorText: "Verification Failed",
669
669
  children: "Verify & Sign In"
670
- }) : /* @__PURE__ */ c(P, {
670
+ }) : /* @__PURE__ */ f(P, {
671
671
  type: "submit",
672
672
  isLoading: g.isSubmitting,
673
- isError: !!f,
673
+ isError: !!c,
674
674
  disabled: g.isSubmitting,
675
675
  className: z.fullWidthButton,
676
676
  loadingText: "Sending Code...",
@@ -678,14 +678,14 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
678
678
  children: "Send Code"
679
679
  })
680
680
  }),
681
- f && /* @__PURE__ */ c(B, { error: f })
681
+ c && /* @__PURE__ */ f(B, { error: c })
682
682
  ]
683
683
  });
684
684
  }, J = ({ method: e, onMagicLinkSent: t, onPendingApproval: n }) => {
685
685
  switch (e) {
686
- case "otp": return /* @__PURE__ */ c(W, { onPendingApproval: n });
687
- case "whatsapp": return /* @__PURE__ */ c(q, { onPendingApproval: n });
688
- case "magiclink": return /* @__PURE__ */ c(V, {
686
+ case "otp": return /* @__PURE__ */ f(W, { onPendingApproval: n });
687
+ case "whatsapp": return /* @__PURE__ */ f(q, { onPendingApproval: n });
688
+ case "magiclink": return /* @__PURE__ */ f(V, {
689
689
  onMagicLinkSent: t,
690
690
  onPendingApproval: n
691
691
  });
@@ -693,78 +693,78 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
693
693
  }
694
694
  }, Y = ({ method: e }) => {
695
695
  switch (e) {
696
- case "google": return /* @__PURE__ */ c(d.Button, {
696
+ case "google": return /* @__PURE__ */ f(r.Button, {
697
697
  provider: "google",
698
- children: /* @__PURE__ */ l("button", {
698
+ children: /* @__PURE__ */ p("button", {
699
699
  type: "button",
700
700
  className: z.googleButton,
701
- children: [/* @__PURE__ */ c("img", {
701
+ children: [/* @__PURE__ */ f("img", {
702
702
  className: z.googleIcon,
703
703
  src: "https://static.levocdn.com/png/google.png"
704
704
  }), "Continue with Google"]
705
705
  })
706
706
  });
707
- case "microsoft": return /* @__PURE__ */ c(d.Button, {
707
+ case "microsoft": return /* @__PURE__ */ f(r.Button, {
708
708
  provider: "microsoft",
709
- children: /* @__PURE__ */ l("button", {
709
+ children: /* @__PURE__ */ p("button", {
710
710
  type: "button",
711
711
  className: z.googleButton,
712
- children: [/* @__PURE__ */ c("img", {
712
+ children: [/* @__PURE__ */ f("img", {
713
713
  className: z.googleIcon,
714
714
  src: "https://static.levocdn.com/png/microsoft.png"
715
715
  }), "Continue with Microsoft"]
716
716
  })
717
717
  });
718
- case "linkedin": return /* @__PURE__ */ c(d.Button, {
718
+ case "linkedin": return /* @__PURE__ */ f(r.Button, {
719
719
  provider: "linkedin",
720
- children: /* @__PURE__ */ l("button", {
720
+ children: /* @__PURE__ */ p("button", {
721
721
  type: "button",
722
722
  className: z.googleButton,
723
- children: [/* @__PURE__ */ c("img", {
723
+ children: [/* @__PURE__ */ f("img", {
724
724
  className: z.googleIcon,
725
725
  src: "https://static.levocdn.com/png/linkedin.png"
726
726
  }), "Continue with LinkedIn"]
727
727
  })
728
728
  });
729
- default: return /* @__PURE__ */ c(s, {});
729
+ default: return /* @__PURE__ */ f(d, {});
730
730
  }
731
- }, X = ({ otpSent: e, oAuthTitle: t, onOAuthSuccess: n, onOAuthError: r, oAuthMethods: i }) => {
732
- let { logger: a } = m();
733
- return /* @__PURE__ */ c("div", {
731
+ }, X = ({ otpSent: e, oAuthTitle: t, onOAuthSuccess: n, onOAuthError: i, oAuthMethods: s }) => {
732
+ let { logger: c } = o();
733
+ return /* @__PURE__ */ f("div", {
734
734
  className: z.oauthContainer,
735
- children: !e && /* @__PURE__ */ c(d.Container, {
735
+ children: !e && /* @__PURE__ */ f(r.Container, {
736
736
  title: t,
737
737
  onSuccess: () => {
738
- p("You are logged in successfully", "Login Successful", { position: "top-right" }), n && n();
738
+ a("You are logged in successfully", "Login Successful", { position: "top-right" }), n && n();
739
739
  },
740
740
  onError: (e) => {
741
- let t = u(e);
742
- a?.error("OAuth login failed", { exception: t }), r && r(t);
741
+ let t = m(e);
742
+ c?.error("OAuth login failed", { exception: t }), i && i(t);
743
743
  },
744
- children: i?.map((e) => /* @__PURE__ */ c(Y, { method: e }, e))
744
+ children: s?.map((e) => /* @__PURE__ */ f(Y, { method: e }, e))
745
745
  })
746
746
  });
747
- }, Z = ({ oAuthMethods: e, oAuthTitle: t = "Studio", showDivider: n, dividerText: r, onOAuthSuccess: i, onOAuthError: a }) => /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(X, {
747
+ }, Z = ({ oAuthMethods: e, oAuthTitle: t = "Studio", showDivider: n, dividerText: r, onOAuthSuccess: i, onOAuthError: a }) => /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(X, {
748
748
  otpSent: !n,
749
749
  oAuthTitle: t,
750
750
  onOAuthSuccess: i,
751
751
  onOAuthError: a,
752
752
  oAuthMethods: e
753
- }), n && /* @__PURE__ */ l("div", {
753
+ }), n && /* @__PURE__ */ p("div", {
754
754
  className: z.divider,
755
755
  children: [
756
- /* @__PURE__ */ c("div", { className: z.dividerLine }),
757
- /* @__PURE__ */ c("div", {
756
+ /* @__PURE__ */ f("div", { className: z.dividerLine }),
757
+ /* @__PURE__ */ f("div", {
758
758
  className: z.dividerText,
759
759
  children: r
760
760
  }),
761
- /* @__PURE__ */ c("div", { className: z.dividerLine })
761
+ /* @__PURE__ */ f("div", { className: z.dividerLine })
762
762
  ]
763
- })] }), Q = ({ className: r, oAuthTitle: a = "Studio", page: o, magicLinkSent: s, setMagicLinkSent: u, oAuthMethods: d, onPendingApproval: p }) => {
764
- let { refetchLoginStatus: m } = e(), h = i(() => o?.access?.[0]?.kind === "authentication" && o?.access?.[0]?.options?.primary_method || "otp", [o?.access]), g = i(() => d || o?.access?.[0]?.kind === "authentication" && o?.access?.[0]?.options?.methods?.filter((e) => n.includes(e)) || [], [o?.access, d]);
765
- return /* @__PURE__ */ l("div", {
763
+ })] }), Q = ({ className: r, oAuthTitle: a = "Studio", page: o, magicLinkSent: s, setMagicLinkSent: l, oAuthMethods: u, onPendingApproval: d }) => {
764
+ let { refetchLoginStatus: m } = e(), h = c(() => o?.access?.[0]?.kind === "authentication" && o?.access?.[0]?.options?.primary_method || "otp", [o?.access]), g = c(() => u || o?.access?.[0]?.kind === "authentication" && o?.access?.[0]?.options?.methods?.filter((e) => n.includes(e)) || [], [o?.access, u]);
765
+ return /* @__PURE__ */ p("div", {
766
766
  className: `${z.container} ${r || ""}`,
767
- children: [g.length > 0 && !s && /* @__PURE__ */ c(Z, {
767
+ children: [g.length > 0 && !s && /* @__PURE__ */ f(Z, {
768
768
  oAuthMethods: g,
769
769
  oAuthTitle: a,
770
770
  showDivider: !0,
@@ -779,17 +779,17 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
779
779
  },
780
780
  onOAuthError: (e) => {
781
781
  if (t(e?.code)) {
782
- p?.();
782
+ d?.();
783
783
  return;
784
784
  }
785
- f(e);
785
+ i(e);
786
786
  }
787
- }), /* @__PURE__ */ c("div", {
787
+ }), /* @__PURE__ */ f("div", {
788
788
  className: z.formSection,
789
- children: /* @__PURE__ */ c(J, {
789
+ children: /* @__PURE__ */ f(J, {
790
790
  method: h,
791
- onMagicLinkSent: u,
792
- onPendingApproval: p
791
+ onMagicLinkSent: l,
792
+ onPendingApproval: d
793
793
  })
794
794
  })]
795
795
  });