@tempots/beatui 0.53.0 → 0.54.0
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/{2019-BiSy3dQP.cjs → 2019-5RIscTOv.cjs} +1 -1
- package/dist/{2019-Djx2f_nO.js → 2019-i1LHsYdK.js} +2 -2
- package/dist/{2020-BgJxYgaO.cjs → 2020-DeCezjWf.cjs} +1 -1
- package/dist/{2020-C1wOj1GM.js → 2020-S7qY95wq.js} +2 -2
- package/dist/{ar-BEbbig_x.cjs → ar-BqnDsD9v.cjs} +1 -1
- package/dist/{ar-Djuleurf.js → ar-DrBp_VwJ.js} +7 -12
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +353 -360
- package/dist/{de-E8u7Hbc0.js → de-B5oZoraI.js} +5 -10
- package/dist/{de-Br3MCGtv.cjs → de-C_N0wtxQ.cjs} +1 -1
- package/dist/{es-BN0iaBgJ.js → es-DRc5dc_G.js} +1 -6
- package/dist/{es-CAwGEj_N.cjs → es-JnLMDtzg.cjs} +1 -1
- package/dist/{fa-3Qfo8ZXh.js → fa-B0VDVs5B.js} +6 -11
- package/dist/{fa-CEz8tGnY.cjs → fa-BC16IdRL.cjs} +1 -1
- package/dist/{fr-Dbn62iEL.cjs → fr-BupZ6YnU.cjs} +1 -1
- package/dist/{fr-D1ndk0A5.js → fr-DXlfWwI6.js} +8 -13
- package/dist/{he-CIV7rntE.js → he-BX-Az8As.js} +8 -13
- package/dist/{he-OtaTg9wg.cjs → he-C-aQ2yoO.cjs} +1 -1
- package/dist/{hi-CnbarThz.cjs → hi-L3y3Aedb.cjs} +1 -1
- package/dist/{hi-tzWREPMb.js → hi-w4uL7LN1.js} +8 -13
- package/dist/{index-nRXzduHm.cjs → index-B7gVxeO9.cjs} +1 -1
- package/dist/{index-CBT2SLat.js → index-BI5w0jSz.js} +223 -224
- package/dist/{index-B9y4N11q.js → index-BnQvOXw8.js} +3019 -3004
- package/dist/{index-ClFVnBUS.cjs → index-Bv2gn_kV.cjs} +3 -3
- package/dist/{index-BjQW8AsK.cjs → index-CFOxIBGJ.cjs} +12 -12
- package/dist/{index-KPHFBjQB.cjs → index-CKyH3jwP.cjs} +1 -1
- package/dist/{index-TiMfhF1U.cjs → index-C_71zSeN.cjs} +1 -1
- package/dist/index-CkNcU-jd.cjs +8 -0
- package/dist/{index-qWS4IYZX.js → index-CyoxPiTg.js} +1 -1
- package/dist/{index-UMbs0jPr.js → index-DKwuTFYj.js} +377 -378
- package/dist/{index-DDhLWdaz.js → index-DNUXf4K4.js} +1 -1
- package/dist/{index-CAeOFdez.js → index-DjShJtXp.js} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +2413 -2522
- package/dist/{it-1Hy_Ay2j.js → it-BCKQ5Tu8.js} +6 -11
- package/dist/{it-FOaX_rku.cjs → it-CnHaoq-X.cjs} +1 -1
- package/dist/{ja-C7_PK2VE.js → ja-DC47Nkza.js} +13 -18
- package/dist/{ja-DW4_3EWp.cjs → ja-DpDF4IgX.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{ko-C-jXKweM.cjs → ko-BMmVJHzm.cjs} +1 -1
- package/dist/{ko-BDOp6dFE.js → ko-ejUHA0Sw.js} +8 -13
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +1 -1
- package/dist/{modal-BBaPJhi-.js → modal-CKyUdeEz.js} +54 -58
- package/dist/modal-rou7pM0r.cjs +1 -0
- package/dist/{nl-CF5W2Rt4.js → nl-WjgpPUel.js} +6 -11
- package/dist/{nl-Ui8TT45t.cjs → nl-viDlnQWK.cjs} +1 -1
- package/dist/{notice-DTTyRbwh.js → notice-BS0d903Q.js} +385 -387
- package/dist/notice-MF7whf3_.cjs +2 -0
- package/dist/{pl-oLzT5Ole.js → pl-Cw4CYjK_.js} +3 -8
- package/dist/{pl-8PM7rn2L.cjs → pl-Vrfv_fGt.cjs} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-Bb0T3Cx1.js → pt-B4Rh_ZBF.js} +10 -15
- package/dist/{pt-kRRsG9-4.cjs → pt-CxQV74vS.cjs} +1 -1
- package/dist/{ru-C5AMF9a6.cjs → ru-BB3GRr_J.cjs} +1 -1
- package/dist/{ru-DwLv1myc.js → ru-DFHsLJ9b.js} +14 -19
- package/dist/{toolbar-D_LSJCtv.js → toolbar-D2J_NkKD.js} +1 -1
- package/dist/{toolbar-D6_MB1QI.cjs → toolbar-DRdm9W7H.cjs} +1 -1
- package/dist/{tr-DBQNjaPN.js → tr-Dbktyawl.js} +7 -12
- package/dist/{tr-BwgU2BAj.cjs → tr-mBiHcEl1.cjs} +1 -1
- package/dist/{translations-CG5-f9U8.js → translations-CaTkLRHu.js} +85 -93
- package/dist/{translations-t57jdjWu.js → translations-CpTeFtvW.js} +1 -1
- package/dist/{translations-D77sU1Wl.cjs → translations-ggnrzaCG.cjs} +1 -1
- package/dist/translations-h_OJS1Ut.cjs +1 -0
- package/dist/types/components/data/icon.d.ts +1 -1
- package/dist/types/components/data/page-drop-zone.d.ts +1 -1
- package/dist/types/components/data/unstyled-drop-zone.d.ts +1 -1
- package/dist/types/components/form/input/create-nullable-string-input.d.ts +24 -0
- package/dist/types/components/form/input/create-temporal-input.d.ts +54 -0
- package/dist/types/components/form/input/nullable-email-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-password-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-plain-date-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-time-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-text-area.d.ts +6 -4
- package/dist/types/components/form/input/nullable-text-input.d.ts +3 -4
- package/dist/types/components/form/input/nullable-url-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-uuid-input.d.ts +1 -2
- package/dist/types/components/form/input/plain-date-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-date-time-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-time-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-year-month-input.d.ts +19 -3
- package/dist/types/components/json-schema/controls/shared-utils.d.ts +8 -0
- package/dist/types/components/json-schema/schema-conditionals.d.ts +26 -0
- package/dist/types/components/json-schema/schema-context.d.ts +4 -107
- package/dist/types/components/json-schema/schema-merge.d.ts +9 -0
- package/dist/types/components/json-schema/schema-types.d.ts +85 -0
- package/dist/{ur-s32jv4mP.cjs → ur-CZ5sgUP1.cjs} +1 -1
- package/dist/{ur-BmK_ieRn.js → ur-Cqh7AYnd.js} +9 -14
- package/dist/utils-U1aNOU3o.cjs +1 -0
- package/dist/utils-w_vUChhV.js +2454 -0
- package/dist/{vi-DK0Fj95H.js → vi-CLBp2oaY.js} +11 -16
- package/dist/{vi-B4qRKlRd.cjs → vi-Ki_Urj_E.cjs} +1 -1
- package/dist/{zh-CUEpc9yf.cjs → zh-C78OkbS0.cjs} +1 -1
- package/dist/{zh-Db8COSme.js → zh-CT4aGkgD.js} +8 -13
- package/package.json +5 -4
- package/dist/index-ClqyVDXY.cjs +0 -8
- package/dist/modal-O7QoP7Zv.cjs +0 -1
- package/dist/notice-DLDzwKkw.cjs +0 -2
- package/dist/translations-BAk3j4bi.cjs +0 -1
- package/dist/utils-CYMdxKSM.js +0 -2516
- package/dist/utils-DI_H4_Gm.cjs +0 -1
package/dist/auth/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { localStorageProp as
|
|
2
|
-
import { t as
|
|
3
|
-
import { s as A, o as
|
|
4
|
-
import { AuthI18n as
|
|
5
|
-
import { B as F, T as
|
|
6
|
-
import { classes as
|
|
7
|
-
const
|
|
1
|
+
import { localStorageProp as ie, prop as V, Use as x, html as i, attr as t, on as z, When as b, coalesce as h, Ensure as D, computedOf as g, Fragment as C, bind as ce, ForEach as le, Value as ee, OneOfValue as me } from "@tempots/dom";
|
|
2
|
+
import { t as ue, a as oe, u as W, S as $, b as se, c as T, P as N, E as G, N as H } from "../notice-BS0d903Q.js";
|
|
3
|
+
import { s as A, o as j, b as R, M as de } from "../modal-CKyUdeEz.js";
|
|
4
|
+
import { AuthI18n as q } from "../translations-CpTeFtvW.js";
|
|
5
|
+
import { B as F, T as pe, I as he } from "../translations-CaTkLRHu.js";
|
|
6
|
+
import { classes as ge } from "@tempots/ui";
|
|
7
|
+
const X = {
|
|
8
8
|
google: { name: "Google", icon: "logos:google-icon", color: "#4285f4" },
|
|
9
9
|
github: { name: "GitHub", icon: "logos:github-icon", color: "#333" },
|
|
10
10
|
apple: { name: "Apple", icon: "logos:apple", color: "#000" },
|
|
@@ -50,17 +50,17 @@ const Y = {
|
|
|
50
50
|
paypal: { name: "PayPal", icon: "logos:paypal", color: "#0070ba" },
|
|
51
51
|
x: { name: "X", icon: "simple-icons:x", color: "#000" }
|
|
52
52
|
};
|
|
53
|
-
function
|
|
54
|
-
return
|
|
53
|
+
function fe(e) {
|
|
54
|
+
return X[e]?.name || e;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
56
|
+
function Ie(e) {
|
|
57
|
+
return X[e]?.icon || "mdi:account";
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
59
|
+
function Te(e) {
|
|
60
|
+
return X[e]?.color || "#666";
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
return o.replace("{provider}",
|
|
62
|
+
function Ae(e, o = "Continue with {provider}") {
|
|
63
|
+
return o.replace("{provider}", fe(e));
|
|
64
64
|
}
|
|
65
65
|
const I = {
|
|
66
66
|
minLength: 8,
|
|
@@ -69,18 +69,18 @@ const I = {
|
|
|
69
69
|
requireNumbers: !0,
|
|
70
70
|
requireSymbols: !1
|
|
71
71
|
};
|
|
72
|
-
function
|
|
72
|
+
function Ce(e) {
|
|
73
73
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function be(e = 32) {
|
|
76
76
|
const o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
77
77
|
let c = "";
|
|
78
78
|
for (let m = 0; m < e; m++)
|
|
79
79
|
c += o.charAt(Math.floor(Math.random() * o.length));
|
|
80
80
|
return c;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
const
|
|
82
|
+
function ze(e, o, c, m = [], l = {}) {
|
|
83
|
+
const s = {
|
|
84
84
|
google: "https://accounts.google.com/oauth/authorize",
|
|
85
85
|
github: "https://github.com/login/oauth/authorize",
|
|
86
86
|
apple: "https://appleid.apple.com/auth/authorize",
|
|
@@ -130,20 +130,20 @@ function Ee(e, o, c, m = [], l = {}) {
|
|
|
130
130
|
yahoo: ["openid", "email", "profile"],
|
|
131
131
|
paypal: ["openid", "email", "profile"],
|
|
132
132
|
x: ["openid", "email", "profile"]
|
|
133
|
-
},
|
|
134
|
-
if (!
|
|
133
|
+
}, n = s[e];
|
|
134
|
+
if (!n)
|
|
135
135
|
throw new Error(`Unsupported provider: ${e}`);
|
|
136
|
-
const
|
|
136
|
+
const r = m.length > 0 ? m : u[e], a = be(), f = new URLSearchParams({
|
|
137
137
|
client_id: o,
|
|
138
138
|
redirect_uri: c,
|
|
139
|
-
scope:
|
|
140
|
-
state:
|
|
139
|
+
scope: r.join(" "),
|
|
140
|
+
state: a,
|
|
141
141
|
response_type: "code",
|
|
142
142
|
...l
|
|
143
143
|
});
|
|
144
|
-
return `${
|
|
144
|
+
return `${n}?${f.toString()}`;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Ee(e, o, c, m) {
|
|
147
147
|
const l = window.open(
|
|
148
148
|
e,
|
|
149
149
|
`${o}_login`,
|
|
@@ -153,20 +153,20 @@ function Ue(e, o, c, m) {
|
|
|
153
153
|
m?.(new Error("Failed to open popup window"));
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
l.closed && (clearInterval(
|
|
158
|
-
}, 1e3), u = (
|
|
159
|
-
|
|
156
|
+
const s = setInterval(() => {
|
|
157
|
+
l.closed && (clearInterval(s), m?.(new Error("Login cancelled")));
|
|
158
|
+
}, 1e3), u = (n) => {
|
|
159
|
+
n.origin === window.location.origin && (n.data.type === "SOCIAL_LOGIN_SUCCESS" ? (clearInterval(s), l.close(), window.removeEventListener("message", u), c?.(n.data.result)) : n.data.type === "SOCIAL_LOGIN_ERROR" && (clearInterval(s), l.close(), window.removeEventListener("message", u), m?.(new Error(n.data.error))));
|
|
160
160
|
};
|
|
161
161
|
window.addEventListener("message", u);
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Ue(e) {
|
|
164
164
|
return e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e ? String(e.message) : "An unexpected error occurred";
|
|
165
165
|
}
|
|
166
166
|
function Ve() {
|
|
167
167
|
return typeof window < "u" && typeof document < "u";
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Y({
|
|
170
170
|
task: e,
|
|
171
171
|
message: o,
|
|
172
172
|
onStart: c,
|
|
@@ -174,16 +174,16 @@ function Z({
|
|
|
174
174
|
}) {
|
|
175
175
|
return async (l) => {
|
|
176
176
|
c?.();
|
|
177
|
-
const
|
|
177
|
+
const s = await ue({
|
|
178
178
|
task: e != null ? () => e(l) : async () => null,
|
|
179
179
|
errorMessage: o,
|
|
180
180
|
errorPath: ["root"],
|
|
181
|
-
validation: (u) => u != null ?
|
|
181
|
+
validation: (u) => u != null ? oe.invalid({ message: u }) : oe.valid
|
|
182
182
|
});
|
|
183
|
-
return m?.(),
|
|
183
|
+
return m?.(), s;
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Z(e = I) {
|
|
187
187
|
let o = A();
|
|
188
188
|
return e.minLength && (o = o.min(
|
|
189
189
|
e.minLength,
|
|
@@ -198,23 +198,23 @@ function J(e = I) {
|
|
|
198
198
|
/[0-9]/,
|
|
199
199
|
"Password must contain at least one number"
|
|
200
200
|
)), e.requireSymbols && (o = o.regex(
|
|
201
|
-
/[!@#$%^&*()_
|
|
201
|
+
/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,
|
|
202
202
|
"Password must contain at least one special character"
|
|
203
203
|
)), e.customValidation && (o = o.refine((c) => e.customValidation(c))), o;
|
|
204
204
|
}
|
|
205
205
|
const M = A().min(1, "Email is required").email("Please enter a valid email address");
|
|
206
|
-
function
|
|
207
|
-
const o = e ?
|
|
206
|
+
function J(e) {
|
|
207
|
+
const o = e ? Z(e) : A().refine(
|
|
208
208
|
(c) => c.length > 0 ? null : "Password is required"
|
|
209
209
|
);
|
|
210
|
-
return
|
|
210
|
+
return j({
|
|
211
211
|
email: M,
|
|
212
212
|
password: o,
|
|
213
213
|
rememberMe: R().default(!1)
|
|
214
214
|
}).schema();
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
const c =
|
|
216
|
+
function K(e = I, o) {
|
|
217
|
+
const c = Z(e), m = o?.showNameField !== !1, l = o?.showConfirmPassword !== !1, s = o?.showAcceptTermsAndConditions !== !1, u = {
|
|
218
218
|
name: m ? A().min(1, "Name is required").optional() : A().optional(),
|
|
219
219
|
email: M,
|
|
220
220
|
password: c,
|
|
@@ -222,39 +222,39 @@ function Q(e = I, o) {
|
|
|
222
222
|
// When not shown, it should accept any value (including empty string)
|
|
223
223
|
confirmPassword: l ? A().min(1, "Please confirm your password") : A(),
|
|
224
224
|
// Accept any string value when not shown
|
|
225
|
-
acceptTerms:
|
|
226
|
-
(
|
|
225
|
+
acceptTerms: s ? R().refine(
|
|
226
|
+
(r) => r === !0,
|
|
227
227
|
"You must accept the terms and conditions"
|
|
228
228
|
) : R().default(!0)
|
|
229
229
|
// Default to true when not shown
|
|
230
|
-
},
|
|
231
|
-
return l ?
|
|
232
|
-
(
|
|
230
|
+
}, n = j(u);
|
|
231
|
+
return l ? n.refine(
|
|
232
|
+
(r) => r.password === r.confirmPassword ? null : "Passwords don't match",
|
|
233
233
|
{ path: ["confirmPassword"] }
|
|
234
|
-
).schema() :
|
|
234
|
+
).schema() : n.schema();
|
|
235
235
|
}
|
|
236
|
-
const
|
|
236
|
+
const ae = j({
|
|
237
237
|
email: M
|
|
238
|
-
}).schema(), Fe =
|
|
239
|
-
signIn:
|
|
240
|
-
signUp:
|
|
241
|
-
resetPassword: () =>
|
|
238
|
+
}).schema(), Fe = J(), Me = K(), Oe = {
|
|
239
|
+
signIn: J,
|
|
240
|
+
signUp: K,
|
|
241
|
+
resetPassword: () => ae
|
|
242
242
|
};
|
|
243
243
|
function Ne(e) {
|
|
244
244
|
const o = M.validate(e);
|
|
245
245
|
return o.success ? null : o.errors[0]?.message || "Invalid email";
|
|
246
246
|
}
|
|
247
247
|
function Re(e, o = I) {
|
|
248
|
-
const m =
|
|
248
|
+
const m = Z(o).validate(e);
|
|
249
249
|
return m.success ? null : m.errors[0]?.message || "Invalid password";
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function Q(e, o = I) {
|
|
252
252
|
const c = {
|
|
253
253
|
length: e.length >= (o.minLength || 8),
|
|
254
254
|
uppercase: /[A-Z]/.test(e),
|
|
255
255
|
lowercase: /[a-z]/.test(e),
|
|
256
256
|
numbers: /[0-9]/.test(e),
|
|
257
|
-
symbols: /[!@#$%^&*()_
|
|
257
|
+
symbols: /[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(e),
|
|
258
258
|
custom: o.customValidation ? o.customValidation(e) === null : e.length > 0
|
|
259
259
|
// For consistency, fail if password is empty
|
|
260
260
|
}, m = [
|
|
@@ -272,62 +272,61 @@ function ee(e, o = I) {
|
|
|
272
272
|
o.requireNumbers ? c.numbers : null,
|
|
273
273
|
o.requireSymbols ? c.symbols : null,
|
|
274
274
|
o.customValidation ? c.custom : null
|
|
275
|
-
].filter((
|
|
275
|
+
].filter((n) => n === !0).length, s = m > 0 ? Math.round(l / m * 100) : 0;
|
|
276
276
|
let u;
|
|
277
|
-
return
|
|
277
|
+
return s < 40 ? u = "weak" : s < 60 ? u = "fair" : s < 80 ? u = "good" : u = "strong", { strength: u, score: s, checks: c };
|
|
278
278
|
}
|
|
279
|
-
const
|
|
279
|
+
const re = () => ie({
|
|
280
280
|
key: "bui_auth_email",
|
|
281
281
|
defaultValue: null
|
|
282
282
|
});
|
|
283
|
-
function
|
|
283
|
+
function we({
|
|
284
284
|
onSignIn: e,
|
|
285
285
|
passwordRules: o,
|
|
286
286
|
labels: c,
|
|
287
287
|
showRememberMe: m
|
|
288
288
|
}) {
|
|
289
|
-
const l = V(!1),
|
|
289
|
+
const l = V(!1), s = re(), u = J(o), n = W({
|
|
290
290
|
schema: u,
|
|
291
|
-
onSubmit:
|
|
291
|
+
onSubmit: Y({
|
|
292
292
|
task: e,
|
|
293
293
|
message: "Reset password failed",
|
|
294
294
|
onStart: () => {
|
|
295
|
-
l.set(!0),
|
|
295
|
+
l.set(!0), n.controller.disable();
|
|
296
296
|
},
|
|
297
297
|
onEnd: () => {
|
|
298
|
-
l.set(!1),
|
|
298
|
+
l.set(!1), n.controller.enable();
|
|
299
299
|
}
|
|
300
300
|
}),
|
|
301
301
|
initialValue: {
|
|
302
302
|
email: "",
|
|
303
303
|
password: ""
|
|
304
304
|
}
|
|
305
|
-
}), { controller:
|
|
306
|
-
l.on(
|
|
307
|
-
const f =
|
|
308
|
-
return
|
|
305
|
+
}), { controller: r, submit: a } = n;
|
|
306
|
+
l.on(r.setDisabled);
|
|
307
|
+
const f = r.field("email"), w = r.field("password");
|
|
308
|
+
return s.on((_) => {
|
|
309
309
|
_ != null && f.change(_);
|
|
310
310
|
}), f.signal.on((_) => {
|
|
311
|
-
|
|
312
|
-
}),
|
|
313
|
-
|
|
311
|
+
s.value != null && (s.value = _);
|
|
312
|
+
}), x(
|
|
313
|
+
q,
|
|
314
314
|
(_) => (
|
|
315
315
|
// Email/Password form
|
|
316
316
|
i.form(
|
|
317
|
-
C(a.dispose, n.dispose, l.dispose),
|
|
318
317
|
t.class("bc-auth-form__form"),
|
|
319
|
-
|
|
318
|
+
z.submit(a),
|
|
320
319
|
$(
|
|
321
320
|
t.class("bc-auth-form__fields"),
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
(k) =>
|
|
321
|
+
D(
|
|
322
|
+
r.error,
|
|
323
|
+
(k) => H(
|
|
325
324
|
{ variant: "danger", tone: "prominent", role: "alert" },
|
|
326
325
|
i.div(k)
|
|
327
326
|
)
|
|
328
327
|
),
|
|
329
328
|
// Email field
|
|
330
|
-
T(
|
|
329
|
+
T(G, {
|
|
331
330
|
controller: f,
|
|
332
331
|
label: h(c?.emailLabel, _.$.emailLabel)
|
|
333
332
|
}),
|
|
@@ -343,13 +342,13 @@ function _e({
|
|
|
343
342
|
t.class("bc-auth-form__remember-me"),
|
|
344
343
|
i.label(
|
|
345
344
|
t.class("bc-auth-form__checkbox-label"),
|
|
346
|
-
|
|
347
|
-
value:
|
|
345
|
+
se({
|
|
346
|
+
value: s.map((k) => k != null),
|
|
348
347
|
after: i.span(
|
|
349
348
|
h(c?.rememberMeLabel, _.$.rememberMeLabel)
|
|
350
349
|
),
|
|
351
350
|
onChange: (k) => {
|
|
352
|
-
k ?
|
|
351
|
+
k ? s.value = f.signal.value ?? "" : s.value = null;
|
|
353
352
|
}
|
|
354
353
|
})
|
|
355
354
|
)
|
|
@@ -363,7 +362,7 @@ function _e({
|
|
|
363
362
|
variant: "filled",
|
|
364
363
|
color: "primary",
|
|
365
364
|
loading: l,
|
|
366
|
-
disabled:
|
|
365
|
+
disabled: r.disabledOrHasErrors
|
|
367
366
|
},
|
|
368
367
|
t.class("bc-auth-form__submit"),
|
|
369
368
|
h(c?.signInButton, _.$.signInButton)
|
|
@@ -372,13 +371,13 @@ function _e({
|
|
|
372
371
|
)
|
|
373
372
|
);
|
|
374
373
|
}
|
|
375
|
-
function
|
|
374
|
+
function _e({
|
|
376
375
|
password: e,
|
|
377
376
|
rules: o = I,
|
|
378
377
|
showLabel: c = !0,
|
|
379
378
|
className: m
|
|
380
379
|
}) {
|
|
381
|
-
const l = g(e)((
|
|
380
|
+
const l = g(e)((a) => !a || a.length === 0 ? {
|
|
382
381
|
strength: "weak",
|
|
383
382
|
score: 0,
|
|
384
383
|
checks: {
|
|
@@ -389,35 +388,34 @@ function Le({
|
|
|
389
388
|
symbols: !1,
|
|
390
389
|
custom: !1
|
|
391
390
|
}
|
|
392
|
-
} :
|
|
393
|
-
|
|
391
|
+
} : Q(a, o)), s = l.map((a) => a.strength), u = l.map((a) => a.score), n = l.map((a) => a.checks), r = g(
|
|
392
|
+
s,
|
|
394
393
|
m
|
|
395
|
-
)((
|
|
394
|
+
)((a, f) => [
|
|
396
395
|
"bc-password-strength",
|
|
397
|
-
`bc-password-strength--${
|
|
396
|
+
`bc-password-strength--${a}`,
|
|
398
397
|
f
|
|
399
398
|
].filter(Boolean).join(" "));
|
|
400
399
|
return i.div(
|
|
401
|
-
|
|
402
|
-
t.class(a),
|
|
400
|
+
t.class(r),
|
|
403
401
|
// Strength bar
|
|
404
402
|
i.div(
|
|
405
403
|
t.class("bc-password-strength__bar"),
|
|
406
404
|
i.div(
|
|
407
405
|
t.class("bc-password-strength__fill"),
|
|
408
|
-
t.style(u.map((
|
|
406
|
+
t.style(u.map((a) => `width: ${a}%`))
|
|
409
407
|
)
|
|
410
408
|
),
|
|
411
409
|
// Strength label (optional)
|
|
412
410
|
b(
|
|
413
411
|
c,
|
|
414
|
-
() =>
|
|
415
|
-
|
|
416
|
-
(
|
|
412
|
+
() => x(
|
|
413
|
+
q,
|
|
414
|
+
(a) => i.div(
|
|
417
415
|
t.class("bc-password-strength__label"),
|
|
418
416
|
g(
|
|
419
|
-
|
|
420
|
-
|
|
417
|
+
s,
|
|
418
|
+
a
|
|
421
419
|
)((f, w) => {
|
|
422
420
|
switch (f) {
|
|
423
421
|
case "weak":
|
|
@@ -444,13 +442,13 @@ function Le({
|
|
|
444
442
|
() => i.div(
|
|
445
443
|
t.class("bc-password-strength__requirement"),
|
|
446
444
|
t.class(
|
|
447
|
-
g(
|
|
448
|
-
(
|
|
445
|
+
g(n)(
|
|
446
|
+
(a) => a.length ? "bc-password-strength__requirement--met" : ""
|
|
449
447
|
)
|
|
450
448
|
),
|
|
451
449
|
i.span(
|
|
452
450
|
t.class("bc-password-strength__requirement-icon"),
|
|
453
|
-
g(
|
|
451
|
+
g(n)((a) => a.length ? "✓" : "○")
|
|
454
452
|
),
|
|
455
453
|
i.span(
|
|
456
454
|
t.class("bc-password-strength__requirement-text"),
|
|
@@ -464,13 +462,13 @@ function Le({
|
|
|
464
462
|
() => i.div(
|
|
465
463
|
t.class("bc-password-strength__requirement"),
|
|
466
464
|
t.class(
|
|
467
|
-
g(
|
|
468
|
-
(
|
|
465
|
+
g(n)(
|
|
466
|
+
(a) => a.uppercase ? "bc-password-strength__requirement--met" : ""
|
|
469
467
|
)
|
|
470
468
|
),
|
|
471
469
|
i.span(
|
|
472
470
|
t.class("bc-password-strength__requirement-icon"),
|
|
473
|
-
g(
|
|
471
|
+
g(n)((a) => a.uppercase ? "✓" : "○")
|
|
474
472
|
),
|
|
475
473
|
i.span(
|
|
476
474
|
t.class("bc-password-strength__requirement-text"),
|
|
@@ -484,13 +482,13 @@ function Le({
|
|
|
484
482
|
() => i.div(
|
|
485
483
|
t.class("bc-password-strength__requirement"),
|
|
486
484
|
t.class(
|
|
487
|
-
g(
|
|
488
|
-
(
|
|
485
|
+
g(n)(
|
|
486
|
+
(a) => a.lowercase ? "bc-password-strength__requirement--met" : ""
|
|
489
487
|
)
|
|
490
488
|
),
|
|
491
489
|
i.span(
|
|
492
490
|
t.class("bc-password-strength__requirement-icon"),
|
|
493
|
-
g(
|
|
491
|
+
g(n)((a) => a.lowercase ? "✓" : "○")
|
|
494
492
|
),
|
|
495
493
|
i.span(
|
|
496
494
|
t.class("bc-password-strength__requirement-text"),
|
|
@@ -504,13 +502,13 @@ function Le({
|
|
|
504
502
|
() => i.div(
|
|
505
503
|
t.class("bc-password-strength__requirement"),
|
|
506
504
|
t.class(
|
|
507
|
-
g(
|
|
508
|
-
(
|
|
505
|
+
g(n)(
|
|
506
|
+
(a) => a.numbers ? "bc-password-strength__requirement--met" : ""
|
|
509
507
|
)
|
|
510
508
|
),
|
|
511
509
|
i.span(
|
|
512
510
|
t.class("bc-password-strength__requirement-icon"),
|
|
513
|
-
g(
|
|
511
|
+
g(n)((a) => a.numbers ? "✓" : "○")
|
|
514
512
|
),
|
|
515
513
|
i.span(
|
|
516
514
|
t.class("bc-password-strength__requirement-text"),
|
|
@@ -524,13 +522,13 @@ function Le({
|
|
|
524
522
|
() => i.div(
|
|
525
523
|
t.class("bc-password-strength__requirement"),
|
|
526
524
|
t.class(
|
|
527
|
-
g(
|
|
528
|
-
(
|
|
525
|
+
g(n)(
|
|
526
|
+
(a) => a.symbols ? "bc-password-strength__requirement--met" : ""
|
|
529
527
|
)
|
|
530
528
|
),
|
|
531
529
|
i.span(
|
|
532
530
|
t.class("bc-password-strength__requirement-icon"),
|
|
533
|
-
g(
|
|
531
|
+
g(n)((a) => a.symbols ? "✓" : "○")
|
|
534
532
|
),
|
|
535
533
|
i.span(
|
|
536
534
|
t.class("bc-password-strength__requirement-text"),
|
|
@@ -541,92 +539,90 @@ function Le({
|
|
|
541
539
|
)
|
|
542
540
|
);
|
|
543
541
|
}
|
|
544
|
-
function
|
|
542
|
+
function De({
|
|
545
543
|
password: e,
|
|
546
544
|
rules: o = I,
|
|
547
545
|
className: c
|
|
548
546
|
}) {
|
|
549
|
-
const m = g(e)((
|
|
547
|
+
const m = g(e)((n) => !n || n.length === 0 ? { strength: "weak", score: 0 } : Q(n, o)), l = m.map((n) => n.strength), s = m.map((n) => n.score), u = g(
|
|
550
548
|
l,
|
|
551
549
|
c
|
|
552
|
-
)((
|
|
550
|
+
)((n, r) => [
|
|
553
551
|
"bc-password-strength-bar",
|
|
554
|
-
`bc-password-strength-bar--${
|
|
555
|
-
|
|
552
|
+
`bc-password-strength-bar--${n}`,
|
|
553
|
+
r
|
|
556
554
|
].filter(Boolean).join(" "));
|
|
557
555
|
return i.div(
|
|
558
|
-
C(m, u),
|
|
559
556
|
t.class(u),
|
|
560
557
|
i.div(
|
|
561
558
|
t.class("bc-password-strength-bar__fill"),
|
|
562
|
-
t.style(
|
|
559
|
+
t.style(s.map((n) => `width: ${n}%`))
|
|
563
560
|
)
|
|
564
561
|
);
|
|
565
562
|
}
|
|
566
|
-
function
|
|
563
|
+
function We({
|
|
567
564
|
password: e,
|
|
568
565
|
rules: o = I,
|
|
569
566
|
className: c
|
|
570
567
|
}) {
|
|
571
|
-
const m = g(e)((
|
|
568
|
+
const m = g(e)((s) => !s || s.length === 0 ? "weak" : Q(s, o).strength), l = g(
|
|
572
569
|
m,
|
|
573
570
|
c
|
|
574
|
-
)((
|
|
571
|
+
)((s, u) => [
|
|
575
572
|
"bc-password-strength-text",
|
|
576
|
-
`bc-password-strength-text--${
|
|
573
|
+
`bc-password-strength-text--${s}`,
|
|
577
574
|
u
|
|
578
575
|
].filter(Boolean).join(" "));
|
|
579
|
-
return
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
(n) => i.span(
|
|
576
|
+
return C(
|
|
577
|
+
x(
|
|
578
|
+
q,
|
|
579
|
+
(s) => i.span(
|
|
584
580
|
t.class(l),
|
|
585
581
|
g(
|
|
586
582
|
m,
|
|
587
|
-
|
|
588
|
-
)((u,
|
|
583
|
+
s
|
|
584
|
+
)((u, n) => {
|
|
589
585
|
switch (u) {
|
|
590
586
|
case "weak":
|
|
591
|
-
return
|
|
587
|
+
return n.passwordStrengthWeak;
|
|
592
588
|
case "fair":
|
|
593
|
-
return
|
|
589
|
+
return n.passwordStrengthFair;
|
|
594
590
|
case "good":
|
|
595
|
-
return
|
|
591
|
+
return n.passwordStrengthGood;
|
|
596
592
|
case "strong":
|
|
597
|
-
return
|
|
593
|
+
return n.passwordStrengthStrong;
|
|
598
594
|
default:
|
|
599
|
-
return
|
|
595
|
+
return n.passwordStrengthWeak;
|
|
600
596
|
}
|
|
601
597
|
})
|
|
602
598
|
)
|
|
603
599
|
)
|
|
604
600
|
);
|
|
605
601
|
}
|
|
606
|
-
function
|
|
602
|
+
function Le({
|
|
607
603
|
passwordRules: e,
|
|
608
604
|
labels: o,
|
|
609
605
|
initialEmail: c,
|
|
610
606
|
initialName: m,
|
|
611
607
|
showPasswordStrength: l,
|
|
612
|
-
onSignUp:
|
|
608
|
+
onSignUp: s,
|
|
613
609
|
showNameField: u,
|
|
614
|
-
showConfirmPassword:
|
|
615
|
-
showAcceptTermsAndConditions:
|
|
616
|
-
termsAndConditions:
|
|
610
|
+
showConfirmPassword: n,
|
|
611
|
+
showAcceptTermsAndConditions: r,
|
|
612
|
+
termsAndConditions: a
|
|
617
613
|
}) {
|
|
618
|
-
const f = V(!1), w = e || I, _ =
|
|
614
|
+
const f = V(!1), w = e || I, _ = K(w, {
|
|
619
615
|
showNameField: u !== !1,
|
|
620
|
-
showConfirmPassword:
|
|
621
|
-
showAcceptTermsAndConditions:
|
|
622
|
-
}), k =
|
|
616
|
+
showConfirmPassword: n !== !1,
|
|
617
|
+
showAcceptTermsAndConditions: r !== !1
|
|
618
|
+
}), k = W({
|
|
623
619
|
schema: _,
|
|
624
|
-
onSubmit:
|
|
625
|
-
task:
|
|
626
|
-
email:
|
|
627
|
-
password:
|
|
628
|
-
name:
|
|
629
|
-
acceptTerms:
|
|
620
|
+
onSubmit: Y({
|
|
621
|
+
task: s != null ? (v) => s({
|
|
622
|
+
email: v.email,
|
|
623
|
+
password: v.password,
|
|
624
|
+
name: v.name,
|
|
625
|
+
acceptTerms: v.acceptTerms
|
|
630
626
|
}) : void 0,
|
|
631
627
|
message: "Reset password failed",
|
|
632
628
|
onStart: () => {
|
|
@@ -643,22 +639,21 @@ function ke({
|
|
|
643
639
|
confirmPassword: "",
|
|
644
640
|
acceptTerms: !1
|
|
645
641
|
}
|
|
646
|
-
}), { controller:
|
|
647
|
-
f.on(
|
|
648
|
-
const S =
|
|
649
|
-
return
|
|
650
|
-
|
|
651
|
-
(
|
|
642
|
+
}), { controller: y, submit: B } = k;
|
|
643
|
+
f.on(y.setDisabled);
|
|
644
|
+
const S = y.field("name"), E = y.field("email"), U = y.field("password"), O = y.field("confirmPassword"), P = y.field("acceptTerms");
|
|
645
|
+
return x(
|
|
646
|
+
q,
|
|
647
|
+
(v) => (
|
|
652
648
|
// Registration form
|
|
653
649
|
i.form(
|
|
654
|
-
C(v.dispose, f.dispose),
|
|
655
650
|
t.class("bc-auth-form__form"),
|
|
656
|
-
|
|
651
|
+
z.submit(B),
|
|
657
652
|
$(
|
|
658
653
|
t.class("bc-auth-form__fields"),
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
(L) =>
|
|
654
|
+
D(
|
|
655
|
+
y.error,
|
|
656
|
+
(L) => H(
|
|
662
657
|
{ variant: "danger", tone: "prominent", role: "alert" },
|
|
663
658
|
i.div(L)
|
|
664
659
|
)
|
|
@@ -666,57 +661,57 @@ function ke({
|
|
|
666
661
|
// Name field (optional)
|
|
667
662
|
b(
|
|
668
663
|
u !== !1,
|
|
669
|
-
() => T(
|
|
664
|
+
() => T(pe, {
|
|
670
665
|
controller: S.transform(
|
|
671
666
|
(L) => L ?? "",
|
|
672
667
|
(L) => L === "" ? void 0 : L
|
|
673
668
|
),
|
|
674
|
-
label: h(o?.nameLabel,
|
|
669
|
+
label: h(o?.nameLabel, v.$.nameLabel)
|
|
675
670
|
})
|
|
676
671
|
),
|
|
677
672
|
// Email field
|
|
678
|
-
T(
|
|
679
|
-
controller:
|
|
680
|
-
label: h(o?.emailLabel,
|
|
673
|
+
T(G, {
|
|
674
|
+
controller: E,
|
|
675
|
+
label: h(o?.emailLabel, v.$.emailLabel)
|
|
681
676
|
}),
|
|
682
677
|
// Password field
|
|
683
678
|
T(N, {
|
|
684
|
-
controller:
|
|
685
|
-
label: h(o?.passwordLabel,
|
|
679
|
+
controller: U,
|
|
680
|
+
label: h(o?.passwordLabel, v.$.passwordLabel)
|
|
686
681
|
}),
|
|
687
682
|
// Password strength indicator
|
|
688
683
|
b(
|
|
689
684
|
l ?? !1,
|
|
690
|
-
() =>
|
|
691
|
-
password:
|
|
685
|
+
() => _e({
|
|
686
|
+
password: U.signal,
|
|
692
687
|
rules: w,
|
|
693
688
|
showLabel: !0
|
|
694
689
|
})
|
|
695
690
|
),
|
|
696
691
|
// Confirm password field
|
|
697
692
|
b(
|
|
698
|
-
|
|
693
|
+
n ?? !1,
|
|
699
694
|
() => T(N, {
|
|
700
|
-
controller:
|
|
695
|
+
controller: O,
|
|
701
696
|
label: h(
|
|
702
697
|
o?.confirmPasswordLabel,
|
|
703
|
-
|
|
698
|
+
v.$.confirmPasswordLabel
|
|
704
699
|
)
|
|
705
700
|
})
|
|
706
701
|
),
|
|
707
702
|
// Terms acceptance checkbox
|
|
708
703
|
b(
|
|
709
|
-
|
|
704
|
+
r ?? !1,
|
|
710
705
|
() => i.div(
|
|
711
706
|
t.class("bc-auth-form__terms"),
|
|
712
707
|
i.label(
|
|
713
708
|
t.class("bc-auth-form__checkbox-label"),
|
|
714
|
-
|
|
709
|
+
se({
|
|
715
710
|
value: P.signal.map((L) => L ?? !1),
|
|
716
711
|
onChange: (L) => P.change(L)
|
|
717
712
|
}),
|
|
718
713
|
i.span(
|
|
719
|
-
|
|
714
|
+
a || h(o?.acceptTermsLabel, v.$.acceptTermsLabel)
|
|
720
715
|
)
|
|
721
716
|
),
|
|
722
717
|
b(
|
|
@@ -736,22 +731,22 @@ function ke({
|
|
|
736
731
|
variant: "filled",
|
|
737
732
|
color: "primary",
|
|
738
733
|
loading: f,
|
|
739
|
-
disabled:
|
|
734
|
+
disabled: y.disabledOrHasErrors
|
|
740
735
|
},
|
|
741
736
|
t.class("bc-auth-form__submit"),
|
|
742
|
-
h(o?.signUpButton,
|
|
737
|
+
h(o?.signUpButton, v.$.signUpButton)
|
|
743
738
|
)
|
|
744
739
|
)
|
|
745
740
|
)
|
|
746
741
|
);
|
|
747
742
|
}
|
|
748
|
-
function
|
|
743
|
+
function ke({
|
|
749
744
|
onResetPassword: e,
|
|
750
745
|
labels: o = {}
|
|
751
746
|
}) {
|
|
752
|
-
const c =
|
|
753
|
-
schema:
|
|
754
|
-
onSubmit:
|
|
747
|
+
const c = re(), m = V(!1), l = W({
|
|
748
|
+
schema: ae,
|
|
749
|
+
onSubmit: Y({
|
|
755
750
|
task: e,
|
|
756
751
|
message: "Reset password failed",
|
|
757
752
|
onStart: () => {
|
|
@@ -764,37 +759,36 @@ function ve({
|
|
|
764
759
|
initialValue: {
|
|
765
760
|
email: ""
|
|
766
761
|
}
|
|
767
|
-
}), { controller:
|
|
768
|
-
m.on(
|
|
769
|
-
const
|
|
770
|
-
return c.on((
|
|
771
|
-
|
|
772
|
-
}),
|
|
773
|
-
|
|
774
|
-
(
|
|
762
|
+
}), { controller: s, submit: u } = l;
|
|
763
|
+
m.on(s.setDisabled);
|
|
764
|
+
const n = s.field("email");
|
|
765
|
+
return c.on((r) => {
|
|
766
|
+
r != null && n.change(r);
|
|
767
|
+
}), x(
|
|
768
|
+
q,
|
|
769
|
+
(r) => (
|
|
775
770
|
// Reset password form
|
|
776
771
|
i.form(
|
|
777
|
-
C(n.dispose, c.dispose, m.dispose),
|
|
778
772
|
t.class("bc-auth-form__form"),
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
(
|
|
773
|
+
D(
|
|
774
|
+
s.error,
|
|
775
|
+
(a) => H(
|
|
782
776
|
{ variant: "danger", tone: "prominent", role: "alert" },
|
|
783
|
-
i.div(
|
|
777
|
+
i.div(a)
|
|
784
778
|
)
|
|
785
779
|
),
|
|
786
780
|
// Description
|
|
787
781
|
i.p(
|
|
788
782
|
t.class("bc-auth-form__description"),
|
|
789
|
-
h(o?.resetPasswordDescription,
|
|
783
|
+
h(o?.resetPasswordDescription, r.$.resetPasswordDescription)
|
|
790
784
|
),
|
|
791
|
-
|
|
785
|
+
z.submit(u),
|
|
792
786
|
$(
|
|
793
787
|
t.class("bc-auth-form__fields"),
|
|
794
788
|
// Email field
|
|
795
|
-
T(
|
|
796
|
-
controller:
|
|
797
|
-
label: h(o?.emailLabel,
|
|
789
|
+
T(G, {
|
|
790
|
+
controller: n,
|
|
791
|
+
label: h(o?.emailLabel, r.$.emailLabel)
|
|
798
792
|
})
|
|
799
793
|
),
|
|
800
794
|
// Submit button
|
|
@@ -804,10 +798,10 @@ function ve({
|
|
|
804
798
|
type: "submit",
|
|
805
799
|
variant: "filled",
|
|
806
800
|
color: "primary",
|
|
807
|
-
disabled:
|
|
801
|
+
disabled: s.disabledOrHasErrors
|
|
808
802
|
},
|
|
809
803
|
t.class("bc-auth-form__submit"),
|
|
810
|
-
h(o?.resetPasswordButton,
|
|
804
|
+
h(o?.resetPasswordButton, r.$.resetPasswordButton)
|
|
811
805
|
)
|
|
812
806
|
)
|
|
813
807
|
)
|
|
@@ -819,24 +813,24 @@ function p({
|
|
|
819
813
|
size: c = "md",
|
|
820
814
|
name: m,
|
|
821
815
|
icon: l,
|
|
822
|
-
color:
|
|
816
|
+
color: s,
|
|
823
817
|
flow: u,
|
|
824
|
-
labels:
|
|
818
|
+
labels: n
|
|
825
819
|
}) {
|
|
826
820
|
return F(
|
|
827
821
|
{
|
|
828
822
|
type: "button",
|
|
829
823
|
variant: "filled",
|
|
830
824
|
size: c,
|
|
831
|
-
color:
|
|
825
|
+
color: s,
|
|
832
826
|
onClick: async () => {
|
|
833
827
|
if (o)
|
|
834
828
|
try {
|
|
835
829
|
u === "popup" ? await o() : await o();
|
|
836
|
-
} catch (
|
|
830
|
+
} catch (a) {
|
|
837
831
|
console.error(
|
|
838
832
|
`Social login error for ${e} (${u || "redirect"} flow):`,
|
|
839
|
-
|
|
833
|
+
a
|
|
840
834
|
);
|
|
841
835
|
}
|
|
842
836
|
},
|
|
@@ -844,27 +838,27 @@ function p({
|
|
|
844
838
|
},
|
|
845
839
|
t.class("bc-social-login-button"),
|
|
846
840
|
t.class(
|
|
847
|
-
g(e)((
|
|
841
|
+
g(e)((a) => `bc-social-login-button--${a}`)
|
|
848
842
|
),
|
|
849
843
|
i.span(
|
|
850
844
|
t.class("bc-social-login-button__inner"),
|
|
851
845
|
i.span(
|
|
852
846
|
t.class("bc-social-login-button__icon"),
|
|
853
|
-
|
|
847
|
+
he({ icon: l, size: c }, t.class("bc-social-login-button__icon-inner"))
|
|
854
848
|
),
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
(
|
|
849
|
+
x(
|
|
850
|
+
q,
|
|
851
|
+
(a) => i.span(
|
|
858
852
|
t.class("bc-social-login-button__label"),
|
|
859
|
-
|
|
860
|
-
h(
|
|
853
|
+
ce(
|
|
854
|
+
h(n?.continueWithProvider, a.$.continueWithProvider)
|
|
861
855
|
)(m)
|
|
862
856
|
)
|
|
863
857
|
)
|
|
864
858
|
)
|
|
865
859
|
);
|
|
866
860
|
}
|
|
867
|
-
function
|
|
861
|
+
function ve({
|
|
868
862
|
providers: e,
|
|
869
863
|
onProviderClick: o,
|
|
870
864
|
size: c = "md",
|
|
@@ -873,16 +867,16 @@ function ye({
|
|
|
873
867
|
return $(
|
|
874
868
|
t.class("bc-social-login-buttons"),
|
|
875
869
|
t.class(m),
|
|
876
|
-
|
|
870
|
+
le(
|
|
877
871
|
e,
|
|
878
872
|
(l) => p({
|
|
879
873
|
provider: l.$.provider,
|
|
880
874
|
flow: l.$.flow,
|
|
881
875
|
color: l.map(
|
|
882
|
-
({ provider:
|
|
876
|
+
({ provider: s }) => d[s].color
|
|
883
877
|
),
|
|
884
|
-
name: l.map(({ provider:
|
|
885
|
-
icon: l.map(({ provider:
|
|
878
|
+
name: l.map(({ provider: s }) => d[s].name),
|
|
879
|
+
icon: l.map(({ provider: s }) => d[s].icon),
|
|
886
880
|
onClick: async () => {
|
|
887
881
|
o && await o(l.$.provider.value);
|
|
888
882
|
},
|
|
@@ -1022,51 +1016,51 @@ const d = {
|
|
|
1022
1016
|
color: "blue"
|
|
1023
1017
|
// distinct deep blue tone (not Facebook’s exact blue)
|
|
1024
1018
|
}
|
|
1025
|
-
},
|
|
1019
|
+
}, Ge = (e) => p({
|
|
1026
1020
|
...e,
|
|
1027
1021
|
...d.google,
|
|
1028
1022
|
provider: "google"
|
|
1029
|
-
}),
|
|
1023
|
+
}), He = (e) => p({
|
|
1030
1024
|
...e,
|
|
1031
1025
|
...d.github,
|
|
1032
1026
|
provider: "github"
|
|
1033
|
-
}),
|
|
1027
|
+
}), je = (e) => p({
|
|
1034
1028
|
...e,
|
|
1035
1029
|
...d.apple,
|
|
1036
1030
|
provider: "apple"
|
|
1037
|
-
}),
|
|
1031
|
+
}), Xe = (e) => p({
|
|
1038
1032
|
...e,
|
|
1039
1033
|
...d.facebook,
|
|
1040
1034
|
provider: "facebook"
|
|
1041
|
-
}),
|
|
1035
|
+
}), Ye = (e) => p({
|
|
1042
1036
|
...e,
|
|
1043
1037
|
...d.x,
|
|
1044
1038
|
provider: "x"
|
|
1045
|
-
}),
|
|
1039
|
+
}), Ze = (e) => p({
|
|
1046
1040
|
...e,
|
|
1047
1041
|
...d.twitter,
|
|
1048
1042
|
provider: "twitter"
|
|
1049
|
-
}),
|
|
1043
|
+
}), Je = (e) => p({
|
|
1050
1044
|
...e,
|
|
1051
1045
|
...d.microsoft,
|
|
1052
1046
|
provider: "microsoft"
|
|
1053
|
-
}),
|
|
1047
|
+
}), Ke = (e) => p({
|
|
1054
1048
|
...e,
|
|
1055
1049
|
...d.discord,
|
|
1056
1050
|
provider: "discord"
|
|
1057
|
-
}),
|
|
1051
|
+
}), Qe = (e) => p({
|
|
1058
1052
|
...e,
|
|
1059
1053
|
...d.linkedin,
|
|
1060
1054
|
provider: "linkedin"
|
|
1061
|
-
}),
|
|
1055
|
+
}), eo = (e) => p({
|
|
1062
1056
|
...e,
|
|
1063
1057
|
...d.instagram,
|
|
1064
1058
|
provider: "instagram"
|
|
1065
|
-
}),
|
|
1059
|
+
}), oo = (e) => p({
|
|
1066
1060
|
...e,
|
|
1067
1061
|
...d.tiktok,
|
|
1068
1062
|
provider: "tiktok"
|
|
1069
|
-
}),
|
|
1063
|
+
}), to = (e) => p({
|
|
1070
1064
|
...e,
|
|
1071
1065
|
...d.snapchat,
|
|
1072
1066
|
provider: "snapchat"
|
|
@@ -1074,189 +1068,188 @@ const d = {
|
|
|
1074
1068
|
...e,
|
|
1075
1069
|
...d.reddit,
|
|
1076
1070
|
provider: "reddit"
|
|
1077
|
-
}),
|
|
1071
|
+
}), so = (e) => p({
|
|
1078
1072
|
...e,
|
|
1079
1073
|
...d.pinterest,
|
|
1080
1074
|
provider: "pinterest"
|
|
1081
|
-
}),
|
|
1075
|
+
}), ao = (e) => p({
|
|
1082
1076
|
...e,
|
|
1083
1077
|
...d.twitch,
|
|
1084
1078
|
provider: "twitch"
|
|
1085
|
-
}),
|
|
1079
|
+
}), ro = (e) => p({
|
|
1086
1080
|
...e,
|
|
1087
1081
|
...d.steam,
|
|
1088
1082
|
provider: "steam"
|
|
1089
|
-
}),
|
|
1083
|
+
}), io = (e) => p({
|
|
1090
1084
|
...e,
|
|
1091
1085
|
...d.epic,
|
|
1092
1086
|
provider: "epic"
|
|
1093
|
-
}),
|
|
1087
|
+
}), co = (e) => p({
|
|
1094
1088
|
...e,
|
|
1095
1089
|
...d.playstation,
|
|
1096
1090
|
provider: "playstation"
|
|
1097
|
-
}),
|
|
1091
|
+
}), lo = (e) => p({
|
|
1098
1092
|
...e,
|
|
1099
1093
|
...d.xbox,
|
|
1100
1094
|
provider: "xbox"
|
|
1101
|
-
}),
|
|
1095
|
+
}), mo = (e) => p({
|
|
1102
1096
|
...e,
|
|
1103
1097
|
...d.whatsapp,
|
|
1104
1098
|
provider: "whatsapp"
|
|
1105
|
-
}),
|
|
1099
|
+
}), uo = (e) => p({
|
|
1106
1100
|
...e,
|
|
1107
1101
|
...d.wechat,
|
|
1108
1102
|
provider: "wechat"
|
|
1109
|
-
}),
|
|
1103
|
+
}), po = (e) => p({
|
|
1110
1104
|
...e,
|
|
1111
1105
|
...d.amazon,
|
|
1112
1106
|
provider: "amazon"
|
|
1113
|
-
}),
|
|
1107
|
+
}), ho = (e) => p({
|
|
1114
1108
|
...e,
|
|
1115
1109
|
...d.yahoo,
|
|
1116
1110
|
provider: "yahoo"
|
|
1117
|
-
}),
|
|
1111
|
+
}), go = (e) => p({
|
|
1118
1112
|
...e,
|
|
1119
1113
|
...d.paypal,
|
|
1120
1114
|
provider: "paypal"
|
|
1121
1115
|
});
|
|
1122
|
-
function
|
|
1116
|
+
function te({ providers: e }) {
|
|
1123
1117
|
return $(
|
|
1124
|
-
|
|
1118
|
+
ve({
|
|
1125
1119
|
providers: e
|
|
1126
1120
|
})
|
|
1127
1121
|
);
|
|
1128
1122
|
}
|
|
1129
|
-
function
|
|
1123
|
+
function ye({
|
|
1130
1124
|
mode: e,
|
|
1131
1125
|
socialProviders: o,
|
|
1132
1126
|
initialName: c,
|
|
1133
1127
|
initialEmail: m,
|
|
1134
1128
|
passwordRules: l,
|
|
1135
|
-
showRememberMe:
|
|
1129
|
+
showRememberMe: s,
|
|
1136
1130
|
showSocialDivider: u,
|
|
1137
|
-
showPasswordStrength:
|
|
1138
|
-
labels:
|
|
1139
|
-
onSignIn:
|
|
1131
|
+
showPasswordStrength: n,
|
|
1132
|
+
labels: r,
|
|
1133
|
+
onSignIn: a,
|
|
1140
1134
|
onSignUp: f,
|
|
1141
1135
|
onResetPassword: w,
|
|
1142
1136
|
onModeChange: _,
|
|
1143
1137
|
// onSocialLogin,
|
|
1144
1138
|
showContainer: k
|
|
1145
|
-
}, ...
|
|
1146
|
-
const
|
|
1147
|
-
return
|
|
1148
|
-
function
|
|
1149
|
-
const P = h(
|
|
1139
|
+
}, ...y) {
|
|
1140
|
+
const B = e != null ? ee.deriveProp(e) : V("signin");
|
|
1141
|
+
return B.on((S) => _?.(S)), x(q, (S) => {
|
|
1142
|
+
function E() {
|
|
1143
|
+
const P = h(r?.hasAccountLink, S.$.hasAccountLink);
|
|
1150
1144
|
return i.button(
|
|
1151
1145
|
t.type("button"),
|
|
1152
1146
|
t.class("bc-auth-form__link"),
|
|
1153
|
-
|
|
1147
|
+
z.click(() => B.set("signin")),
|
|
1154
1148
|
P
|
|
1155
1149
|
);
|
|
1156
1150
|
}
|
|
1157
|
-
function
|
|
1151
|
+
function U() {
|
|
1158
1152
|
return i.button(
|
|
1159
1153
|
t.type("button"),
|
|
1160
1154
|
t.class("bc-auth-form__link"),
|
|
1161
|
-
|
|
1162
|
-
h(
|
|
1155
|
+
z.click(() => B.set("signup")),
|
|
1156
|
+
h(r?.noAccountLink, S.$.noAccountLink)
|
|
1163
1157
|
);
|
|
1164
1158
|
}
|
|
1165
|
-
function
|
|
1159
|
+
function O() {
|
|
1166
1160
|
return i.button(
|
|
1167
1161
|
t.type("button"),
|
|
1168
1162
|
t.class("bc-auth-form__link"),
|
|
1169
|
-
|
|
1170
|
-
h(
|
|
1163
|
+
z.click(() => B.set("reset-password")),
|
|
1164
|
+
h(r?.forgotPasswordLink, S.$.forgotPasswordLink)
|
|
1171
1165
|
);
|
|
1172
1166
|
}
|
|
1173
1167
|
return i.div(
|
|
1174
|
-
|
|
1168
|
+
ge({
|
|
1175
1169
|
"bc-auth-container": !0,
|
|
1176
|
-
"bc-auth-container--styled":
|
|
1170
|
+
"bc-auth-container--styled": ee.map(k ?? !0, (P) => P)
|
|
1177
1171
|
}),
|
|
1178
|
-
t.class(
|
|
1172
|
+
t.class(B.map((P) => `bc-auth-container--${P}`)),
|
|
1179
1173
|
t.class("bc-auth-form"),
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
signin: () => z(
|
|
1174
|
+
me(B, {
|
|
1175
|
+
signin: () => C(
|
|
1183
1176
|
i.h2(
|
|
1184
1177
|
t.class("bc-auth-form__title"),
|
|
1185
|
-
h(
|
|
1178
|
+
h(r?.signInTitle, S.$.signInTitle)
|
|
1186
1179
|
),
|
|
1187
|
-
o != null ?
|
|
1188
|
-
|
|
1180
|
+
o != null ? C(
|
|
1181
|
+
te({ providers: o }),
|
|
1189
1182
|
b(u ?? !1, ne)
|
|
1190
1183
|
) : null,
|
|
1191
|
-
|
|
1192
|
-
onSignIn:
|
|
1193
|
-
showRememberMe:
|
|
1184
|
+
we({
|
|
1185
|
+
onSignIn: a,
|
|
1186
|
+
showRememberMe: s,
|
|
1194
1187
|
passwordRules: l,
|
|
1195
1188
|
labels: {
|
|
1196
|
-
emailLabel:
|
|
1197
|
-
passwordLabel:
|
|
1198
|
-
rememberMeLabel:
|
|
1199
|
-
signInButton:
|
|
1200
|
-
forgotPasswordLink:
|
|
1201
|
-
noAccountLink:
|
|
1189
|
+
emailLabel: r?.emailLabel,
|
|
1190
|
+
passwordLabel: r?.passwordLabel,
|
|
1191
|
+
rememberMeLabel: r?.rememberMeLabel,
|
|
1192
|
+
signInButton: r?.signInButton,
|
|
1193
|
+
forgotPasswordLink: r?.forgotPasswordLink,
|
|
1194
|
+
noAccountLink: r?.noAccountLink
|
|
1202
1195
|
}
|
|
1203
1196
|
}),
|
|
1204
1197
|
$(
|
|
1205
1198
|
t.class("bc-auth-form__footer"),
|
|
1206
|
-
|
|
1207
|
-
|
|
1199
|
+
U(),
|
|
1200
|
+
O()
|
|
1208
1201
|
)
|
|
1209
1202
|
),
|
|
1210
|
-
signup: () =>
|
|
1203
|
+
signup: () => C(
|
|
1211
1204
|
i.h2(
|
|
1212
1205
|
t.class("bc-auth-form__title"),
|
|
1213
|
-
h(
|
|
1206
|
+
h(r?.signUpTitle, S.$.signUpTitle)
|
|
1214
1207
|
),
|
|
1215
|
-
o != null ?
|
|
1216
|
-
|
|
1208
|
+
o != null ? C(
|
|
1209
|
+
te({ providers: o }),
|
|
1217
1210
|
b(u ?? !1, ne)
|
|
1218
1211
|
) : null,
|
|
1219
|
-
|
|
1212
|
+
Le({
|
|
1220
1213
|
labels: {
|
|
1221
|
-
nameLabel:
|
|
1222
|
-
emailLabel:
|
|
1223
|
-
passwordLabel:
|
|
1224
|
-
confirmPasswordLabel:
|
|
1225
|
-
acceptTermsLabel:
|
|
1226
|
-
signUpButton:
|
|
1227
|
-
hasAccountLink:
|
|
1214
|
+
nameLabel: r?.nameLabel,
|
|
1215
|
+
emailLabel: r?.emailLabel,
|
|
1216
|
+
passwordLabel: r?.passwordLabel,
|
|
1217
|
+
confirmPasswordLabel: r?.confirmPasswordLabel,
|
|
1218
|
+
acceptTermsLabel: r?.acceptTermsLabel,
|
|
1219
|
+
signUpButton: r?.signUpButton,
|
|
1220
|
+
hasAccountLink: r?.hasAccountLink
|
|
1228
1221
|
},
|
|
1229
1222
|
initialEmail: m,
|
|
1230
1223
|
initialName: c,
|
|
1231
1224
|
onSignUp: f,
|
|
1232
1225
|
passwordRules: l,
|
|
1233
|
-
showPasswordStrength:
|
|
1226
|
+
showPasswordStrength: n
|
|
1234
1227
|
}),
|
|
1235
|
-
$(t.class("bc-auth-form__footer"),
|
|
1228
|
+
$(t.class("bc-auth-form__footer"), E())
|
|
1236
1229
|
),
|
|
1237
|
-
"reset-password": () =>
|
|
1230
|
+
"reset-password": () => C(
|
|
1238
1231
|
i.h2(
|
|
1239
1232
|
t.class("bc-auth-form__title"),
|
|
1240
|
-
h(
|
|
1233
|
+
h(r?.resetPasswordTitle, S.$.resetPasswordTitle)
|
|
1241
1234
|
),
|
|
1242
|
-
|
|
1235
|
+
ke({
|
|
1243
1236
|
labels: {
|
|
1244
|
-
backToSignInLink:
|
|
1245
|
-
emailLabel:
|
|
1246
|
-
resetPasswordButton:
|
|
1247
|
-
resetPasswordDescription:
|
|
1237
|
+
backToSignInLink: r?.backToSignInLink,
|
|
1238
|
+
emailLabel: r?.emailLabel,
|
|
1239
|
+
resetPasswordButton: r?.resetPasswordButton,
|
|
1240
|
+
resetPasswordDescription: r?.resetPasswordDescription
|
|
1248
1241
|
},
|
|
1249
1242
|
onResetPassword: w
|
|
1250
1243
|
}),
|
|
1251
|
-
$(t.class("bc-auth-form__footer"),
|
|
1244
|
+
$(t.class("bc-auth-form__footer"), E())
|
|
1252
1245
|
)
|
|
1253
1246
|
}),
|
|
1254
|
-
...
|
|
1247
|
+
...y
|
|
1255
1248
|
);
|
|
1256
1249
|
});
|
|
1257
1250
|
}
|
|
1258
|
-
function
|
|
1259
|
-
return
|
|
1251
|
+
function fo(e) {
|
|
1252
|
+
return de(
|
|
1260
1253
|
{
|
|
1261
1254
|
size: "sm",
|
|
1262
1255
|
dismissable: !0,
|
|
@@ -1264,9 +1257,9 @@ function bo(e) {
|
|
|
1264
1257
|
},
|
|
1265
1258
|
(o, c) => e(
|
|
1266
1259
|
(m) => o({
|
|
1267
|
-
body:
|
|
1268
|
-
header:
|
|
1269
|
-
|
|
1260
|
+
body: ye({ showContainer: !1, ...m }),
|
|
1261
|
+
header: x(
|
|
1262
|
+
q,
|
|
1270
1263
|
(l) => h(m.modalTitle, l.$.authenticationTitle)
|
|
1271
1264
|
)
|
|
1272
1265
|
})
|
|
@@ -1281,8 +1274,8 @@ function ne({
|
|
|
1281
1274
|
t.class("bc-auth-divider"),
|
|
1282
1275
|
t.class(o),
|
|
1283
1276
|
i.div(t.class("bc-auth-divider__line")),
|
|
1284
|
-
|
|
1285
|
-
|
|
1277
|
+
x(
|
|
1278
|
+
q,
|
|
1286
1279
|
(c) => i.span(
|
|
1287
1280
|
t.class("bc-auth-divider__text"),
|
|
1288
1281
|
h(e?.text, c.$.orDivider)
|
|
@@ -1292,66 +1285,66 @@ function ne({
|
|
|
1292
1285
|
);
|
|
1293
1286
|
}
|
|
1294
1287
|
export {
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1288
|
+
po as AmazonLoginButton,
|
|
1289
|
+
je as AppleLoginButton,
|
|
1290
|
+
ye as AuthContainer,
|
|
1298
1291
|
ne as AuthDivider,
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1292
|
+
fo as AuthModal,
|
|
1293
|
+
Ke as DiscordLoginButton,
|
|
1294
|
+
io as EpicLoginButton,
|
|
1295
|
+
Xe as FacebookLoginButton,
|
|
1296
|
+
He as GitHubLoginButton,
|
|
1297
|
+
Ge as GoogleLoginButton,
|
|
1298
|
+
eo as InstagramLoginButton,
|
|
1299
|
+
Qe as LinkedInLoginButton,
|
|
1300
|
+
Je as MicrosoftLoginButton,
|
|
1301
|
+
De as PasswordStrengthBar,
|
|
1302
|
+
_e as PasswordStrengthIndicator,
|
|
1303
|
+
We as PasswordStrengthText,
|
|
1304
|
+
go as PayPalLoginButton,
|
|
1305
|
+
so as PinterestLoginButton,
|
|
1306
|
+
co as PlayStationLoginButton,
|
|
1314
1307
|
no as RedditLoginButton,
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1308
|
+
ke as ResetPasswordForm,
|
|
1309
|
+
we as SignInForm,
|
|
1310
|
+
Le as SignUpForm,
|
|
1311
|
+
to as SnapchatLoginButton,
|
|
1319
1312
|
p as SocialLoginButton,
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1313
|
+
ve as SocialLoginButtons,
|
|
1314
|
+
te as SocialProviders,
|
|
1315
|
+
ro as SteamLoginButton,
|
|
1316
|
+
oo as TiktokLoginButton,
|
|
1317
|
+
ao as TwitchLoginButton,
|
|
1318
|
+
Ze as TwitterLoginButton,
|
|
1319
|
+
uo as WeChatLoginButton,
|
|
1320
|
+
mo as WhatsAppLoginButton,
|
|
1321
|
+
Ye as XLoginButtin,
|
|
1322
|
+
lo as XboxLoginButton,
|
|
1323
|
+
ho as YahooLoginButton,
|
|
1324
|
+
Oe as authSchemas,
|
|
1325
|
+
Q as calculatePasswordStrength,
|
|
1326
|
+
Z as createPasswordSchema,
|
|
1327
|
+
J as createSignInSchema,
|
|
1328
|
+
K as createSignUpSchema,
|
|
1329
|
+
ze as createSocialLoginUrl,
|
|
1337
1330
|
I as defaultPasswordRules,
|
|
1338
1331
|
Fe as defaultSignInSchema,
|
|
1339
1332
|
Me as defaultSignUpSchema,
|
|
1340
1333
|
M as emailSchema,
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1334
|
+
Ue as formatAuthError,
|
|
1335
|
+
fe as formatProviderName,
|
|
1336
|
+
Ae as formatSocialLoginText,
|
|
1337
|
+
be as generateRandomString,
|
|
1338
|
+
Te as getProviderColor,
|
|
1339
|
+
Ie as getProviderIcon,
|
|
1347
1340
|
Ve as isBrowser,
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1341
|
+
Ce as isValidEmail,
|
|
1342
|
+
Ee as openSocialLoginPopup,
|
|
1343
|
+
X as providerInfo,
|
|
1344
|
+
Y as requestToControllerValidation,
|
|
1345
|
+
ae as resetPasswordSchema,
|
|
1353
1346
|
d as socialProviderInfo,
|
|
1354
|
-
|
|
1347
|
+
re as useAuthEmailProp,
|
|
1355
1348
|
Ne as validateEmail,
|
|
1356
1349
|
Re as validatePassword
|
|
1357
1350
|
};
|