@levo-so/studio 0.1.64 → 0.1.66
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/{Beams-I4aWHPVY.js → Beams-nmNmDhrm.js} +1 -1
- package/dist/BillingStep-CUrykLb4.js +203 -0
- package/dist/{Dots-CUmk_uHm.js → Dots-dNvykqVn.js} +1 -1
- package/dist/{Gradient-ClJiEr54.js → Gradient-Ciw_vJDx.js} +1 -1
- package/dist/{Grid-BgVIobRt.js → Grid-BqYjfOaX.js} +1 -1
- package/dist/{MessageCard-CiE4ZR7i.js → MessageCard-B4szjq4V.js} +1 -1
- package/dist/{Waves-B8-qCWtJ.js → Waves-BJBLHT4h.js} +1 -1
- package/dist/components/LoginForm/GoogleOAuth.d.ts.map +1 -1
- package/dist/components/bookingCard/BillingStep.d.ts +35 -0
- package/dist/components/bookingCard/BillingStep.d.ts.map +1 -0
- package/dist/components/bookingCard/BookingCard.d.ts +20 -0
- package/dist/components/bookingCard/BookingCard.d.ts.map +1 -1
- package/dist/components/bookingCard/index.d.ts +1 -0
- package/dist/components/bookingCard/index.d.ts.map +1 -1
- package/dist/components/bookingModal/BookingConfirmation.d.ts +4 -0
- package/dist/components/bookingModal/BookingConfirmation.d.ts.map +1 -1
- package/dist/components/bookingModal/BookingModal.d.ts.map +1 -1
- package/dist/components/globalSearch/GlobalSearch.d.ts +7 -0
- package/dist/components/globalSearch/GlobalSearch.d.ts.map +1 -0
- package/dist/components/globalSearch/GlobalSearchDialog.d.ts +6 -0
- package/dist/components/globalSearch/GlobalSearchDialog.d.ts.map +1 -0
- package/dist/components/globalSearch/index.d.ts +2 -0
- package/dist/components/globalSearch/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/registerModal/AttendeeForm.d.ts +1 -1
- package/dist/components/registerModal/AttendeeForm.d.ts.map +1 -1
- package/dist/components/registerModal/RegisterModal.d.ts.map +1 -1
- package/dist/components/registerModal/RegistrationConfirmationModal.d.ts.map +1 -1
- package/dist/components/stripePaymentModal/StripePaymentModal.d.ts.map +1 -1
- package/dist/components/stripePaymentModal/index.d.ts +1 -1
- package/dist/components/stripePaymentModal/index.d.ts.map +1 -1
- package/dist/components/ui/base/index.d.ts +1 -0
- package/dist/components/ui/base/index.d.ts.map +1 -1
- package/dist/components/ui/base/kbd.d.ts +4 -0
- package/dist/components/ui/base/kbd.d.ts.map +1 -0
- package/dist/contentEngine/useContentEngine.d.ts.map +1 -1
- package/dist/contentEngine/useContextEngine.d.ts.map +1 -1
- package/dist/core/AccessManager/index.d.ts.map +1 -1
- package/dist/elements/Form.d.ts.map +1 -1
- package/dist/elements/Heading.d.ts.map +1 -1
- package/dist/elements/forum/categoryFilter/CategoryFilter.d.ts.map +1 -1
- package/dist/elements/forum/comments/Comment.d.ts.map +1 -1
- package/dist/elements/forum/comments/Comments.d.ts.map +1 -1
- package/dist/elements/forum/comments/ReplyBox.d.ts.map +1 -1
- package/dist/elements/forum/comments/commentUtility.d.ts.map +1 -1
- package/dist/elements/forum/createForumPost/CreateForumPost.d.ts.map +1 -1
- package/dist/elements/forum/createForumPost/CreateForumPostModal.d.ts.map +1 -1
- package/dist/elements/forum/utility/Video.d.ts.map +1 -1
- package/dist/elements/forum/utility/index.d.ts.map +1 -1
- package/dist/{elements-C0sYbYML.js → elements-BFZyX9xz.js} +1 -1
- package/dist/hooks/useLogin.d.ts.map +1 -1
- package/dist/{index-Cf4jJOnE.js → index-BxyIkcWw.js} +236 -160
- package/dist/{index-D_r8laYN.js → index-C75foZeA.js} +4523 -4229
- package/dist/{index-Ccv1uVOU.js → index-CpNa1Kv5.js} +2 -2
- package/dist/{index-DtRAKt_V.js → index-DDc-37FN.js} +2 -2
- package/dist/{index-DJS7RFvk.js → index-DWpliAOR.js} +1 -1
- package/dist/{index-BUgkYYcp.js → index-djT9Bhvi.js} +1 -1
- package/dist/{index-BqEvx8Yg.js → index-gIohjnj8.js} +152 -152
- package/dist/index.js +115 -112
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as e, jsxs as l, Fragment as q } from "react/jsx-runtime";
|
|
3
3
|
import { useLevo as Q, LevoOAuth as I, successToast as X, errorHandler as Z } from "@levo-so/react";
|
|
4
4
|
import { useState as _, useEffect as G, useRef as R, useMemo as F } from "react";
|
|
5
|
-
import { h as $, A as ee } from "./index-
|
|
5
|
+
import { h as $, A as ee } from "./index-C75foZeA.js";
|
|
6
6
|
import { getLevoError as B } from "@levo-so/core";
|
|
7
7
|
import { useFormik as A } from "formik";
|
|
8
8
|
import { parsePhoneNumberWithError as te } from "libphonenumber-js";
|
|
@@ -11,10 +11,10 @@ import ne from "react-otp-input";
|
|
|
11
11
|
import { ChevronDown as re } from "lucide-react";
|
|
12
12
|
import { Popover as L } from "radix-ui";
|
|
13
13
|
import { usePhoneInput as oe, defaultCountries as P, parseCountry as M, FlagImage as j } from "react-international-phone";
|
|
14
|
-
const z = k.string().required("Email is required").email("Please enter a valid email address").trim(), H = k.string().required("Please enter the verification code").length(4, "Verification code must be 4 digits").matches(/^\d+$/, "Verification code must contain only numbers"), U = k.string().required("Phone number is required").test("phone", "The phone number has incorrect format", (
|
|
15
|
-
if (!
|
|
14
|
+
const z = k.string().required("Email is required").email("Please enter a valid email address").trim(), H = k.string().required("Please enter the verification code").length(4, "Verification code must be 4 digits").matches(/^\d+$/, "Verification code must contain only numbers"), U = k.string().required("Phone number is required").test("phone", "The phone number has incorrect format", (o) => {
|
|
15
|
+
if (!o) return !1;
|
|
16
16
|
try {
|
|
17
|
-
return te(
|
|
17
|
+
return te(o)?.isValid() ?? !1;
|
|
18
18
|
} catch {
|
|
19
19
|
return !1;
|
|
20
20
|
}
|
|
@@ -36,21 +36,21 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
36
36
|
iconEnter: pe,
|
|
37
37
|
text: he
|
|
38
38
|
}, E = ({
|
|
39
|
-
className:
|
|
39
|
+
className: o,
|
|
40
40
|
children: c,
|
|
41
|
-
isLoading:
|
|
41
|
+
isLoading: t = !1,
|
|
42
42
|
isError: a = !1,
|
|
43
|
-
loadingText:
|
|
43
|
+
loadingText: u = "Loading...",
|
|
44
44
|
successText: s = "Success!",
|
|
45
|
-
errorText:
|
|
45
|
+
errorText: r = "Error!",
|
|
46
46
|
variant: h = "default",
|
|
47
|
-
size:
|
|
48
|
-
disabled:
|
|
47
|
+
size: p = "default",
|
|
48
|
+
disabled: n,
|
|
49
49
|
...y
|
|
50
50
|
}) => {
|
|
51
|
-
const [v, i] = _(!1), [g, C] = _(!1), [S,
|
|
51
|
+
const [v, i] = _(!1), [g, C] = _(!1), [S, m] = _(t);
|
|
52
52
|
G(() => {
|
|
53
|
-
if (S && !
|
|
53
|
+
if (S && !t)
|
|
54
54
|
if (a) {
|
|
55
55
|
C(!0);
|
|
56
56
|
const T = setTimeout(() => {
|
|
@@ -64,9 +64,9 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
64
64
|
}, 2e3);
|
|
65
65
|
return () => clearTimeout(T);
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
}, [
|
|
69
|
-
const f = () =>
|
|
67
|
+
m(t);
|
|
68
|
+
}, [t, S, a]);
|
|
69
|
+
const f = () => t ? u : v ? s : g ? r : c, V = () => g ? "destructive" : v ? "success" : h, w = () => t ? /* @__PURE__ */ e("div", { className: `${N.icon} ${N.iconEnter}`, children: /* @__PURE__ */ e("svg", { className: N.spinner, viewBox: "0 0 24 24", children: /* @__PURE__ */ e(
|
|
70
70
|
"circle",
|
|
71
71
|
{
|
|
72
72
|
cx: "12",
|
|
@@ -78,7 +78,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
78
78
|
strokeDasharray: "32",
|
|
79
79
|
strokeDashoffset: "32"
|
|
80
80
|
}
|
|
81
|
-
) }) }) : v && !
|
|
81
|
+
) }) }) : v && !t ? /* @__PURE__ */ e("div", { className: `${N.icon} ${N.iconEnter}`, children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", children: [
|
|
82
82
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor" }),
|
|
83
83
|
/* @__PURE__ */ e(
|
|
84
84
|
"path",
|
|
@@ -91,7 +91,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
91
91
|
strokeLinejoin: "round"
|
|
92
92
|
}
|
|
93
93
|
)
|
|
94
|
-
] }) }) : g && !
|
|
94
|
+
] }) }) : g && !t ? /* @__PURE__ */ e("div", { className: `${N.icon} ${N.iconEnter}`, children: /* @__PURE__ */ l(
|
|
95
95
|
"svg",
|
|
96
96
|
{
|
|
97
97
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -113,10 +113,10 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
113
113
|
return /* @__PURE__ */ e(
|
|
114
114
|
"button",
|
|
115
115
|
{
|
|
116
|
-
className: `${N.button} ${
|
|
116
|
+
className: `${N.button} ${o || ""}`,
|
|
117
117
|
"data-variant": V(),
|
|
118
|
-
"data-size":
|
|
119
|
-
disabled:
|
|
118
|
+
"data-size": p,
|
|
119
|
+
disabled: n || t,
|
|
120
120
|
...y,
|
|
121
121
|
children: /* @__PURE__ */ l("div", { className: N.content, children: [
|
|
122
122
|
w(),
|
|
@@ -130,21 +130,21 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
130
130
|
inputWrapper: _e,
|
|
131
131
|
input: ve,
|
|
132
132
|
editButton: be
|
|
133
|
-
}, Y = ({ email:
|
|
133
|
+
}, Y = ({ email: o, setEmail: c, otpSent: t, handleReset: a }) => /* @__PURE__ */ l("div", { className: W.container, children: [
|
|
134
134
|
/* @__PURE__ */ e("label", { className: W.label, children: "Email" }),
|
|
135
135
|
/* @__PURE__ */ l("div", { className: W.inputWrapper, children: [
|
|
136
136
|
/* @__PURE__ */ e(
|
|
137
137
|
"input",
|
|
138
138
|
{
|
|
139
139
|
type: "email",
|
|
140
|
-
value:
|
|
141
|
-
onChange: (
|
|
140
|
+
value: o,
|
|
141
|
+
onChange: (u) => c(u.target.value),
|
|
142
142
|
className: W.input,
|
|
143
143
|
placeholder: "Enter your email",
|
|
144
|
-
disabled:
|
|
144
|
+
disabled: t
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
|
-
|
|
147
|
+
t && /* @__PURE__ */ e(
|
|
148
148
|
E,
|
|
149
149
|
{
|
|
150
150
|
variant: "outline",
|
|
@@ -164,7 +164,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
164
164
|
submessage: Ee,
|
|
165
165
|
actions: Te,
|
|
166
166
|
resetButton: ke
|
|
167
|
-
}, Be = ({ email:
|
|
167
|
+
}, Be = ({ email: o, onReset: c }) => /* @__PURE__ */ l("div", { className: x.container, children: [
|
|
168
168
|
/* @__PURE__ */ e("div", { className: x.iconWrapper, children: /* @__PURE__ */ e("svg", { className: x.icon, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
169
169
|
"path",
|
|
170
170
|
{
|
|
@@ -178,7 +178,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
178
178
|
/* @__PURE__ */ e("h3", { className: x.title, children: "Check your email" }),
|
|
179
179
|
/* @__PURE__ */ l("p", { className: x.message, children: [
|
|
180
180
|
"We've sent a magic link to ",
|
|
181
|
-
/* @__PURE__ */ e("strong", { children:
|
|
181
|
+
/* @__PURE__ */ e("strong", { children: o })
|
|
182
182
|
] }),
|
|
183
183
|
/* @__PURE__ */ e("p", { className: x.submessage, children: "Click the link in your email to sign in. The link will expire in 15 minutes." })
|
|
184
184
|
] }),
|
|
@@ -200,43 +200,43 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
200
200
|
errorTitle: qe,
|
|
201
201
|
errorMessage: Ge,
|
|
202
202
|
errorDismiss: ze
|
|
203
|
-
}, D = ({ error:
|
|
203
|
+
}, D = ({ error: o, onDismiss: c }) => /* @__PURE__ */ e("div", { className: d.errorContainer, children: /* @__PURE__ */ l("div", { className: d.errorContent, children: [
|
|
204
204
|
/* @__PURE__ */ l("div", { className: d.errorText, children: [
|
|
205
|
-
|
|
206
|
-
/* @__PURE__ */ e("div", { className: d.errorMessage, children:
|
|
205
|
+
o.title && /* @__PURE__ */ e("div", { className: d.errorTitle, children: o.title }),
|
|
206
|
+
/* @__PURE__ */ e("div", { className: d.errorMessage, children: o.message || "An unexpected error occurred" })
|
|
207
207
|
] }),
|
|
208
208
|
c && /* @__PURE__ */ e("button", { onClick: c, className: d.errorDismiss, "aria-label": "Dismiss error", children: "×" })
|
|
209
|
-
] }) }), He = ({ onMagicLinkSent:
|
|
210
|
-
const { sendMagicLink: c } = $(), [
|
|
209
|
+
] }) }), He = ({ onMagicLinkSent: o }) => {
|
|
210
|
+
const { sendMagicLink: c } = $(), [t, a] = _(!1), [u, s] = _(null);
|
|
211
211
|
G(() => {
|
|
212
|
-
|
|
213
|
-
}, [
|
|
214
|
-
const
|
|
212
|
+
o?.(t);
|
|
213
|
+
}, [t, o]);
|
|
214
|
+
const r = A({
|
|
215
215
|
initialValues: {
|
|
216
216
|
email: ""
|
|
217
217
|
},
|
|
218
218
|
validationSchema: le,
|
|
219
219
|
validateOnChange: !1,
|
|
220
220
|
validateOnBlur: !1,
|
|
221
|
-
onSubmit: async (
|
|
221
|
+
onSubmit: async (p, { setSubmitting: n, setFieldError: y }) => {
|
|
222
222
|
try {
|
|
223
|
-
s(null), await c(
|
|
223
|
+
s(null), await c(p.email), a(!0);
|
|
224
224
|
} catch (v) {
|
|
225
225
|
const i = B(v);
|
|
226
226
|
i.hasFieldErrors ? i.fieldErrors.forEach((g) => {
|
|
227
227
|
y(g.param, g.message);
|
|
228
228
|
}) : s(i);
|
|
229
229
|
} finally {
|
|
230
|
-
|
|
230
|
+
n(!1);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
}), h = () => {
|
|
234
|
-
a(!1),
|
|
234
|
+
a(!1), r.resetForm(), s(null);
|
|
235
235
|
};
|
|
236
|
-
return
|
|
236
|
+
return t ? /* @__PURE__ */ e(Be, { email: r.values.email, onReset: h }) : /* @__PURE__ */ l(
|
|
237
237
|
"form",
|
|
238
238
|
{
|
|
239
|
-
onSubmit:
|
|
239
|
+
onSubmit: r.handleSubmit,
|
|
240
240
|
style: {
|
|
241
241
|
display: "flex",
|
|
242
242
|
flexDirection: "column",
|
|
@@ -246,8 +246,8 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
246
246
|
/* @__PURE__ */ e(
|
|
247
247
|
Y,
|
|
248
248
|
{
|
|
249
|
-
email:
|
|
250
|
-
setEmail: (
|
|
249
|
+
email: r.values.email,
|
|
250
|
+
setEmail: (p) => r.setFieldValue("email", p),
|
|
251
251
|
otpSent: !1,
|
|
252
252
|
handleReset: h
|
|
253
253
|
}
|
|
@@ -256,16 +256,16 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
256
256
|
E,
|
|
257
257
|
{
|
|
258
258
|
type: "submit",
|
|
259
|
-
isLoading:
|
|
260
|
-
isError: !!
|
|
261
|
-
disabled:
|
|
259
|
+
isLoading: r.isSubmitting,
|
|
260
|
+
isError: !!u,
|
|
261
|
+
disabled: r.isSubmitting,
|
|
262
262
|
className: d.fullWidthButton,
|
|
263
263
|
loadingText: "Sending Magic Link...",
|
|
264
264
|
errorText: "Failed to Send",
|
|
265
265
|
children: "Send Magic Link"
|
|
266
266
|
}
|
|
267
267
|
) }),
|
|
268
|
-
|
|
268
|
+
u && /* @__PURE__ */ e(D, { error: u, onDismiss: () => s(null) })
|
|
269
269
|
]
|
|
270
270
|
}
|
|
271
271
|
);
|
|
@@ -276,34 +276,34 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
276
276
|
input: Je,
|
|
277
277
|
resendButton: Qe
|
|
278
278
|
}, J = ({
|
|
279
|
-
otpSent:
|
|
279
|
+
otpSent: o,
|
|
280
280
|
isResendingOtp: c,
|
|
281
|
-
otp:
|
|
281
|
+
otp: t,
|
|
282
282
|
resendOTP: a,
|
|
283
|
-
setOtp:
|
|
283
|
+
setOtp: u
|
|
284
284
|
}) => {
|
|
285
|
-
const [s,
|
|
285
|
+
const [s, r] = _(0), h = () => {
|
|
286
286
|
a(() => {
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
|
|
287
|
+
r(30);
|
|
288
|
+
const p = setInterval(() => {
|
|
289
|
+
r((n) => n <= 1 ? (clearInterval(p), 0) : n - 1);
|
|
290
290
|
}, 1e3);
|
|
291
291
|
});
|
|
292
292
|
};
|
|
293
|
-
return
|
|
293
|
+
return o ? /* @__PURE__ */ l("div", { className: O.container, children: [
|
|
294
294
|
/* @__PURE__ */ e("label", { className: O.label, children: "Verification Code" }),
|
|
295
295
|
/* @__PURE__ */ e("div", { className: O.inputGroup, children: /* @__PURE__ */ e(
|
|
296
296
|
ne,
|
|
297
297
|
{
|
|
298
|
-
value:
|
|
299
|
-
onChange:
|
|
298
|
+
value: t,
|
|
299
|
+
onChange: u,
|
|
300
300
|
numInputs: 4,
|
|
301
301
|
inputStyle: {
|
|
302
302
|
marginRight: "12px"
|
|
303
303
|
},
|
|
304
304
|
inputType: "tel",
|
|
305
305
|
skipDefaultStyles: !0,
|
|
306
|
-
renderInput: ({ className:
|
|
306
|
+
renderInput: ({ className: p, ...n }) => /* @__PURE__ */ e("input", { className: `${O.input} ${p}`, ...n })
|
|
307
307
|
}
|
|
308
308
|
) }),
|
|
309
309
|
/* @__PURE__ */ e(
|
|
@@ -317,7 +317,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
317
317
|
)
|
|
318
318
|
] }) : null;
|
|
319
319
|
}, Xe = () => {
|
|
320
|
-
const { sendOTP:
|
|
320
|
+
const { sendOTP: o, verifyOTP: c, resendOTP: t } = $(), [a, u] = _(!1), [s, r] = _(null), [h, p] = _(!1), n = A({
|
|
321
321
|
initialValues: {
|
|
322
322
|
email: "",
|
|
323
323
|
otp: ""
|
|
@@ -327,32 +327,32 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
327
327
|
validateOnBlur: !1,
|
|
328
328
|
onSubmit: async (i, { setSubmitting: g, setFieldError: C }) => {
|
|
329
329
|
try {
|
|
330
|
-
|
|
330
|
+
r(null), a ? await c(i.email, i.otp) : (await o({ email: i.email }), u(!0));
|
|
331
331
|
} catch (S) {
|
|
332
|
-
const
|
|
333
|
-
|
|
332
|
+
const m = B(S);
|
|
333
|
+
m.hasFieldErrors ? m.fieldErrors.forEach((f) => {
|
|
334
334
|
C(f.param, f.message);
|
|
335
|
-
}) :
|
|
335
|
+
}) : r(m);
|
|
336
336
|
} finally {
|
|
337
337
|
g(!1);
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
}), y = () => {
|
|
341
|
-
|
|
341
|
+
u(!1), n.resetForm(), r(null);
|
|
342
342
|
}, v = async () => {
|
|
343
343
|
try {
|
|
344
|
-
|
|
344
|
+
p(!0), r(null), await t({ email: n.values.email });
|
|
345
345
|
} catch (i) {
|
|
346
346
|
const g = B(i);
|
|
347
|
-
|
|
347
|
+
r(g);
|
|
348
348
|
} finally {
|
|
349
|
-
|
|
349
|
+
p(!1);
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
352
|
return /* @__PURE__ */ l(
|
|
353
353
|
"form",
|
|
354
354
|
{
|
|
355
|
-
onSubmit:
|
|
355
|
+
onSubmit: n.handleSubmit,
|
|
356
356
|
style: {
|
|
357
357
|
display: "flex",
|
|
358
358
|
flexDirection: "column",
|
|
@@ -362,8 +362,8 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
362
362
|
/* @__PURE__ */ e(
|
|
363
363
|
Y,
|
|
364
364
|
{
|
|
365
|
-
email:
|
|
366
|
-
setEmail: (i) =>
|
|
365
|
+
email: n.values.email,
|
|
366
|
+
setEmail: (i) => n.setFieldValue("email", i),
|
|
367
367
|
otpSent: a,
|
|
368
368
|
handleReset: y
|
|
369
369
|
}
|
|
@@ -372,8 +372,8 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
372
372
|
J,
|
|
373
373
|
{
|
|
374
374
|
otpSent: a,
|
|
375
|
-
otp:
|
|
376
|
-
setOtp: (i) =>
|
|
375
|
+
otp: n.values.otp,
|
|
376
|
+
setOtp: (i) => n.setFieldValue("otp", i),
|
|
377
377
|
isResendingOtp: h,
|
|
378
378
|
resendOTP: v
|
|
379
379
|
}
|
|
@@ -382,9 +382,9 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
382
382
|
E,
|
|
383
383
|
{
|
|
384
384
|
type: "submit",
|
|
385
|
-
isLoading:
|
|
385
|
+
isLoading: n.isSubmitting,
|
|
386
386
|
isError: !!s,
|
|
387
|
-
disabled:
|
|
387
|
+
disabled: n.isSubmitting,
|
|
388
388
|
className: d.fullWidthButton,
|
|
389
389
|
loadingText: "Verifying...",
|
|
390
390
|
errorText: "Verification Failed",
|
|
@@ -394,16 +394,16 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
394
394
|
E,
|
|
395
395
|
{
|
|
396
396
|
type: "submit",
|
|
397
|
-
isLoading:
|
|
397
|
+
isLoading: n.isSubmitting,
|
|
398
398
|
isError: !!s,
|
|
399
|
-
disabled:
|
|
399
|
+
disabled: n.isSubmitting,
|
|
400
400
|
className: d.fullWidthButton,
|
|
401
401
|
loadingText: "Sending Code...",
|
|
402
402
|
errorText: "Failed to Send",
|
|
403
403
|
children: "Send Code"
|
|
404
404
|
}
|
|
405
405
|
) }),
|
|
406
|
-
s && /* @__PURE__ */ e(D, { error: s, onDismiss: () =>
|
|
406
|
+
s && /* @__PURE__ */ e(D, { error: s, onDismiss: () => r(null) })
|
|
407
407
|
]
|
|
408
408
|
}
|
|
409
409
|
);
|
|
@@ -419,26 +419,26 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
419
419
|
flag: at,
|
|
420
420
|
countryName: lt,
|
|
421
421
|
dialCode: ct
|
|
422
|
-
}, dt = ({ phone:
|
|
423
|
-
const [
|
|
422
|
+
}, dt = ({ phone: o, setPhone: c, otpSent: t, handleReset: a }) => {
|
|
423
|
+
const [u, s] = _(!1), [r, h] = _(""), p = R(null), n = R(null), { inputValue: y, handlePhoneValueChange: v, inputRef: i, country: g, setCountry: C } = oe({
|
|
424
424
|
defaultCountry: "in",
|
|
425
|
-
value:
|
|
425
|
+
value: o,
|
|
426
426
|
countries: P,
|
|
427
|
-
onChange: (
|
|
428
|
-
c(
|
|
427
|
+
onChange: (m) => {
|
|
428
|
+
c(m.phone);
|
|
429
429
|
},
|
|
430
430
|
disableDialCodePrefill: !0,
|
|
431
431
|
forceDialCode: !0
|
|
432
|
-
}), S = P.filter((
|
|
433
|
-
const f = M(
|
|
434
|
-
return f.name.toLowerCase().includes(
|
|
432
|
+
}), S = P.filter((m) => {
|
|
433
|
+
const f = M(m);
|
|
434
|
+
return f.name.toLowerCase().includes(r.toLowerCase()) || f.dialCode.includes(r);
|
|
435
435
|
});
|
|
436
436
|
return /* @__PURE__ */ l("div", { children: [
|
|
437
437
|
/* @__PURE__ */ e("label", { className: b.label, children: "Phone Number" }),
|
|
438
438
|
/* @__PURE__ */ l("div", { className: b.inputWrapper, children: [
|
|
439
439
|
/* @__PURE__ */ l("div", { className: b.phoneInputWrapper, children: [
|
|
440
|
-
/* @__PURE__ */ l(L.Root, { open:
|
|
441
|
-
/* @__PURE__ */ e(L.Trigger, { asChild: !0, disabled:
|
|
440
|
+
/* @__PURE__ */ l(L.Root, { open: u, onOpenChange: s, children: [
|
|
441
|
+
/* @__PURE__ */ e(L.Trigger, { asChild: !0, disabled: t, children: /* @__PURE__ */ l("button", { type: "button", className: b.selector, disabled: t, children: [
|
|
442
442
|
/* @__PURE__ */ e(j, { iso2: g.iso2, style: { width: "24px", height: "16px" } }),
|
|
443
443
|
/* @__PURE__ */ e(re, { size: 16, style: { marginLeft: "4px", opacity: 0.5 } })
|
|
444
444
|
] }) }),
|
|
@@ -449,20 +449,20 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
449
449
|
align: "start",
|
|
450
450
|
side: "bottom",
|
|
451
451
|
sideOffset: 4,
|
|
452
|
-
onOpenAutoFocus: (
|
|
453
|
-
|
|
452
|
+
onOpenAutoFocus: (m) => {
|
|
453
|
+
m.preventDefault(), n.current?.focus();
|
|
454
454
|
},
|
|
455
455
|
children: [
|
|
456
456
|
/* @__PURE__ */ e("div", { style: { padding: "0.5rem" }, children: /* @__PURE__ */ e(
|
|
457
457
|
"input",
|
|
458
458
|
{
|
|
459
|
-
ref:
|
|
459
|
+
ref: n,
|
|
460
460
|
type: "text",
|
|
461
461
|
placeholder: "Search country...",
|
|
462
|
-
value:
|
|
463
|
-
onChange: (
|
|
464
|
-
onKeyDown: (
|
|
465
|
-
|
|
462
|
+
value: r,
|
|
463
|
+
onChange: (m) => h(m.target.value),
|
|
464
|
+
onKeyDown: (m) => {
|
|
465
|
+
m.key === "ArrowDown" && (m.preventDefault(), p.current?.firstElementChild?.focus());
|
|
466
466
|
},
|
|
467
467
|
className: b.input,
|
|
468
468
|
style: {
|
|
@@ -471,9 +471,9 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
) }),
|
|
474
|
-
/* @__PURE__ */ l("div", { ref:
|
|
475
|
-
S.map((
|
|
476
|
-
const f = M(
|
|
474
|
+
/* @__PURE__ */ l("div", { ref: p, style: { overflowY: "auto", flex: 1 }, children: [
|
|
475
|
+
S.map((m) => {
|
|
476
|
+
const f = M(m), V = f.iso2 === g.iso2;
|
|
477
477
|
return /* @__PURE__ */ l(
|
|
478
478
|
"button",
|
|
479
479
|
{
|
|
@@ -489,7 +489,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
489
489
|
else if (w.key === "ArrowUp") {
|
|
490
490
|
w.preventDefault();
|
|
491
491
|
const T = w.currentTarget.previousElementSibling;
|
|
492
|
-
T ? T.focus() :
|
|
492
|
+
T ? T.focus() : n.current?.focus();
|
|
493
493
|
}
|
|
494
494
|
},
|
|
495
495
|
children: [
|
|
@@ -529,11 +529,11 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
529
529
|
value: y,
|
|
530
530
|
onChange: v,
|
|
531
531
|
className: b.input,
|
|
532
|
-
disabled:
|
|
532
|
+
disabled: t
|
|
533
533
|
}
|
|
534
534
|
)
|
|
535
535
|
] }),
|
|
536
|
-
|
|
536
|
+
t && /* @__PURE__ */ e(
|
|
537
537
|
E,
|
|
538
538
|
{
|
|
539
539
|
variant: "outline",
|
|
@@ -545,7 +545,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
545
545
|
] })
|
|
546
546
|
] });
|
|
547
547
|
}, ut = () => {
|
|
548
|
-
const { sendOTP:
|
|
548
|
+
const { sendOTP: o, verifyOTP: c, resendOTP: t } = $(), [a, u] = _(!1), [s, r] = _(null), [h, p] = _(!1), n = A({
|
|
549
549
|
initialValues: {
|
|
550
550
|
phone: "",
|
|
551
551
|
otp: ""
|
|
@@ -555,32 +555,32 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
555
555
|
validateOnBlur: !1,
|
|
556
556
|
onSubmit: async (i, { setSubmitting: g, setFieldError: C }) => {
|
|
557
557
|
try {
|
|
558
|
-
|
|
558
|
+
r(null), a ? await c(i.phone, i.otp) : (await o({ phone: i.phone, medium: "whatsapp" }), u(!0));
|
|
559
559
|
} catch (S) {
|
|
560
|
-
const
|
|
561
|
-
|
|
560
|
+
const m = B(S);
|
|
561
|
+
m.hasFieldErrors ? m.fieldErrors.forEach((f) => {
|
|
562
562
|
C(f.param, f.message);
|
|
563
|
-
}) :
|
|
563
|
+
}) : r(m);
|
|
564
564
|
} finally {
|
|
565
565
|
g(!1);
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
}), y = () => {
|
|
569
|
-
|
|
569
|
+
u(!1), n.resetForm(), r(null);
|
|
570
570
|
}, v = async () => {
|
|
571
571
|
try {
|
|
572
|
-
|
|
572
|
+
p(!0), r(null), await t({ phone: n.values.phone, medium: "whatsapp" });
|
|
573
573
|
} catch (i) {
|
|
574
574
|
const g = B(i);
|
|
575
|
-
|
|
575
|
+
r(g);
|
|
576
576
|
} finally {
|
|
577
|
-
|
|
577
|
+
p(!1);
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
580
|
return /* @__PURE__ */ l(
|
|
581
581
|
"form",
|
|
582
582
|
{
|
|
583
|
-
onSubmit:
|
|
583
|
+
onSubmit: n.handleSubmit,
|
|
584
584
|
style: {
|
|
585
585
|
display: "flex",
|
|
586
586
|
flexDirection: "column",
|
|
@@ -590,8 +590,8 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
590
590
|
/* @__PURE__ */ e(
|
|
591
591
|
dt,
|
|
592
592
|
{
|
|
593
|
-
phone:
|
|
594
|
-
setPhone: (i) =>
|
|
593
|
+
phone: n.values.phone,
|
|
594
|
+
setPhone: (i) => n.setFieldValue("phone", i),
|
|
595
595
|
otpSent: a,
|
|
596
596
|
handleReset: y
|
|
597
597
|
}
|
|
@@ -600,8 +600,8 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
600
600
|
J,
|
|
601
601
|
{
|
|
602
602
|
otpSent: a,
|
|
603
|
-
otp:
|
|
604
|
-
setOtp: (i) =>
|
|
603
|
+
otp: n.values.otp,
|
|
604
|
+
setOtp: (i) => n.setFieldValue("otp", i),
|
|
605
605
|
isResendingOtp: h,
|
|
606
606
|
resendOTP: v
|
|
607
607
|
}
|
|
@@ -610,9 +610,9 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
610
610
|
E,
|
|
611
611
|
{
|
|
612
612
|
type: "submit",
|
|
613
|
-
isLoading:
|
|
613
|
+
isLoading: n.isSubmitting,
|
|
614
614
|
isError: !!s,
|
|
615
|
-
disabled:
|
|
615
|
+
disabled: n.isSubmitting,
|
|
616
616
|
className: d.fullWidthButton,
|
|
617
617
|
loadingText: "Verifying...",
|
|
618
618
|
errorText: "Verification Failed",
|
|
@@ -622,9 +622,9 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
622
622
|
E,
|
|
623
623
|
{
|
|
624
624
|
type: "submit",
|
|
625
|
-
isLoading:
|
|
625
|
+
isLoading: n.isSubmitting,
|
|
626
626
|
isError: !!s,
|
|
627
|
-
disabled:
|
|
627
|
+
disabled: n.isSubmitting,
|
|
628
628
|
className: d.fullWidthButton,
|
|
629
629
|
loadingText: "Sending Code...",
|
|
630
630
|
errorText: "Failed to Send",
|
|
@@ -636,10 +636,10 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
636
636
|
}
|
|
637
637
|
);
|
|
638
638
|
}, mt = ({
|
|
639
|
-
method:
|
|
639
|
+
method: o,
|
|
640
640
|
onMagicLinkSent: c
|
|
641
641
|
}) => {
|
|
642
|
-
switch (
|
|
642
|
+
switch (o) {
|
|
643
643
|
case "otp":
|
|
644
644
|
return /* @__PURE__ */ e(Xe, {});
|
|
645
645
|
case "whatsapp":
|
|
@@ -649,20 +649,20 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
649
649
|
default:
|
|
650
650
|
return null;
|
|
651
651
|
}
|
|
652
|
-
}, pt = ({ method:
|
|
653
|
-
switch (
|
|
652
|
+
}, pt = ({ method: o }) => {
|
|
653
|
+
switch (o) {
|
|
654
654
|
case "google":
|
|
655
|
-
return /* @__PURE__ */ e(I.Button, { provider: "google", children: /* @__PURE__ */ l("button", { className: d.googleButton, children: [
|
|
655
|
+
return /* @__PURE__ */ e(I.Button, { provider: "google", children: /* @__PURE__ */ l("button", { type: "button", className: d.googleButton, children: [
|
|
656
656
|
/* @__PURE__ */ e("img", { className: d.googleIcon, src: "https://static.levocdn.com/png/google.png" }),
|
|
657
657
|
"Continue with Google"
|
|
658
658
|
] }) });
|
|
659
659
|
case "microsoft":
|
|
660
|
-
return /* @__PURE__ */ e(I.Button, { provider: "microsoft", children: /* @__PURE__ */ l("button", { className: d.googleButton, children: [
|
|
660
|
+
return /* @__PURE__ */ e(I.Button, { provider: "microsoft", children: /* @__PURE__ */ l("button", { type: "button", className: d.googleButton, children: [
|
|
661
661
|
/* @__PURE__ */ e("img", { className: d.googleIcon, src: "https://static.levocdn.com/png/microsoft.png" }),
|
|
662
662
|
"Continue with Microsoft"
|
|
663
663
|
] }) });
|
|
664
664
|
case "linkedin":
|
|
665
|
-
return /* @__PURE__ */ e(I.Button, { provider: "linkedin", children: /* @__PURE__ */ l("button", { className: d.googleButton, children: [
|
|
665
|
+
return /* @__PURE__ */ e(I.Button, { provider: "linkedin", children: /* @__PURE__ */ l("button", { type: "button", className: d.googleButton, children: [
|
|
666
666
|
/* @__PURE__ */ e("img", { className: d.googleIcon, src: "https://static.levocdn.com/png/linkedin.png" }),
|
|
667
667
|
"Continue with LinkedIn"
|
|
668
668
|
] }) });
|
|
@@ -671,62 +671,62 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
671
671
|
return /* @__PURE__ */ e(q, {});
|
|
672
672
|
}
|
|
673
673
|
}, ht = ({
|
|
674
|
-
otpSent:
|
|
674
|
+
otpSent: o,
|
|
675
675
|
oAuthTitle: c,
|
|
676
|
-
onOAuthSuccess:
|
|
676
|
+
onOAuthSuccess: t,
|
|
677
677
|
onOAuthError: a,
|
|
678
|
-
oAuthMethods:
|
|
678
|
+
oAuthMethods: u
|
|
679
679
|
}) => {
|
|
680
|
-
const {
|
|
681
|
-
return /* @__PURE__ */ e("div", { className: d.oauthContainer, children: !
|
|
680
|
+
const { logger: s } = Q();
|
|
681
|
+
return /* @__PURE__ */ e("div", { className: d.oauthContainer, children: !o && /* @__PURE__ */ e(
|
|
682
682
|
I.Container,
|
|
683
683
|
{
|
|
684
684
|
title: c,
|
|
685
685
|
onSuccess: () => {
|
|
686
686
|
X("You are logged in successfully", "Login Successful", {
|
|
687
687
|
position: "top-right"
|
|
688
|
-
}),
|
|
688
|
+
}), t && t();
|
|
689
689
|
},
|
|
690
|
-
onError: (
|
|
691
|
-
const
|
|
692
|
-
|
|
690
|
+
onError: (r) => {
|
|
691
|
+
const h = B(r);
|
|
692
|
+
s?.error("OAuth login failed", h.message), a && a(h);
|
|
693
693
|
},
|
|
694
|
-
children:
|
|
694
|
+
children: u?.map((r) => /* @__PURE__ */ e(pt, { method: r }, r))
|
|
695
695
|
}
|
|
696
696
|
) });
|
|
697
697
|
}, ft = ({
|
|
698
|
-
oAuthMethods:
|
|
698
|
+
oAuthMethods: o,
|
|
699
699
|
oAuthTitle: c = "Studio",
|
|
700
|
-
showDivider:
|
|
700
|
+
showDivider: t,
|
|
701
701
|
dividerText: a,
|
|
702
|
-
onOAuthSuccess:
|
|
702
|
+
onOAuthSuccess: u,
|
|
703
703
|
onOAuthError: s
|
|
704
704
|
}) => /* @__PURE__ */ l(q, { children: [
|
|
705
705
|
/* @__PURE__ */ e(
|
|
706
706
|
ht,
|
|
707
707
|
{
|
|
708
|
-
otpSent: !
|
|
708
|
+
otpSent: !t,
|
|
709
709
|
oAuthTitle: c,
|
|
710
|
-
onOAuthSuccess:
|
|
710
|
+
onOAuthSuccess: u,
|
|
711
711
|
onOAuthError: s,
|
|
712
|
-
oAuthMethods:
|
|
712
|
+
oAuthMethods: o
|
|
713
713
|
}
|
|
714
714
|
),
|
|
715
|
-
|
|
715
|
+
t && /* @__PURE__ */ l("div", { className: d.divider, children: [
|
|
716
716
|
/* @__PURE__ */ e("div", { className: d.dividerLine }),
|
|
717
717
|
/* @__PURE__ */ e("div", { className: d.dividerText, children: a }),
|
|
718
718
|
/* @__PURE__ */ e("div", { className: d.dividerLine })
|
|
719
719
|
] })
|
|
720
720
|
] }), Tt = ({
|
|
721
|
-
className:
|
|
721
|
+
className: o,
|
|
722
722
|
oAuthTitle: c = "Studio",
|
|
723
|
-
page:
|
|
723
|
+
page: t,
|
|
724
724
|
magicLinkSent: a,
|
|
725
|
-
setMagicLinkSent:
|
|
725
|
+
setMagicLinkSent: u,
|
|
726
726
|
oAuthMethods: s
|
|
727
727
|
}) => {
|
|
728
|
-
const { refetchLoginStatus:
|
|
729
|
-
|
|
728
|
+
const { refetchLoginStatus: r } = $(), h = F(() => t?.access?.[0]?.kind === "authentication" && t?.access?.[0]?.options?.primary_method || "otp", [t?.access]), p = F(() => s || (t?.access?.[0]?.kind === "authentication" ? t?.access?.[0]?.options?.methods?.filter((i) => ee.includes(i)) || [] : []), [t?.access, s]), n = () => {
|
|
729
|
+
r();
|
|
730
730
|
}, y = (i) => {
|
|
731
731
|
Z(i);
|
|
732
732
|
}, v = () => {
|
|
@@ -739,15 +739,15 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
739
739
|
return "or sign in with email";
|
|
740
740
|
}
|
|
741
741
|
};
|
|
742
|
-
return /* @__PURE__ */ l("div", { className: `${d.container} ${
|
|
743
|
-
|
|
742
|
+
return /* @__PURE__ */ l("div", { className: `${d.container} ${o || ""}`, children: [
|
|
743
|
+
p.length > 0 && !a && /* @__PURE__ */ e(
|
|
744
744
|
ft,
|
|
745
745
|
{
|
|
746
|
-
oAuthMethods:
|
|
746
|
+
oAuthMethods: p,
|
|
747
747
|
oAuthTitle: c,
|
|
748
748
|
showDivider: !0,
|
|
749
749
|
dividerText: v(),
|
|
750
|
-
onOAuthSuccess:
|
|
750
|
+
onOAuthSuccess: n,
|
|
751
751
|
onOAuthError: y
|
|
752
752
|
}
|
|
753
753
|
),
|
|
@@ -755,7 +755,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
755
755
|
mt,
|
|
756
756
|
{
|
|
757
757
|
method: h,
|
|
758
|
-
onMagicLinkSent:
|
|
758
|
+
onMagicLinkSent: u
|
|
759
759
|
}
|
|
760
760
|
) })
|
|
761
761
|
] });
|