@nice2dev/auth 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,148 +1,183 @@
1
- import { useState as _, useCallback as A, forwardRef as T } from "react";
2
- import { jsxs as t, jsx as e, Fragment as q } from "react/jsx-runtime";
3
- function W(a = {}) {
4
- const { onLogin: n, onRefresh: d, onLogout: u, storageKey: h = "nice_auth", persistAuth: f = !1 } = a, [i, m] = _(() => {
1
+ import { useState as _, useCallback as x, forwardRef as E, useMemo as q } from "react";
2
+ import { jsxs as t, jsx as e, Fragment as V } from "react/jsx-runtime";
3
+ function X(a = {}) {
4
+ const { onLogin: n, onRefresh: o, onLogout: d, storageKey: u = "nice_auth", persistAuth: f = !1 } = a, [r, m] = _(() => {
5
5
  if (f && typeof window < "u")
6
6
  try {
7
- const o = localStorage.getItem(h);
8
- if (o)
9
- return { ...JSON.parse(o), loading: !1, error: null };
7
+ const s = localStorage.getItem(u);
8
+ if (s)
9
+ return { ...JSON.parse(s), loading: !1, error: null };
10
10
  } catch {
11
11
  }
12
12
  return { isAuthenticated: !1, user: null, tokens: null, loading: !1, error: null };
13
- }), s = A((o) => {
14
- m((l) => {
15
- const p = { ...l, ...o };
16
- return f && typeof window < "u" && (p.isAuthenticated ? localStorage.setItem(h, JSON.stringify({ isAuthenticated: !0, user: p.user })) : localStorage.removeItem(h)), p;
13
+ }), c = x((s) => {
14
+ m((h) => {
15
+ const p = { ...h, ...s };
16
+ return f && typeof window < "u" && (p.isAuthenticated ? localStorage.setItem(u, JSON.stringify({ isAuthenticated: !0, user: p.user })) : localStorage.removeItem(u)), p;
17
17
  });
18
- }, [f, h]), w = A(async (o, l) => {
19
- s({ loading: !0, error: null });
18
+ }, [f, u]), v = x(async (s, h) => {
19
+ c({ loading: !0, error: null });
20
20
  try {
21
21
  if (n) {
22
- const p = await n(o, l);
23
- return s({ isAuthenticated: !0, user: p.user, tokens: p.tokens, loading: !1 }), !0;
22
+ const p = await n(s, h);
23
+ return c({ isAuthenticated: !0, user: p.user, tokens: p.tokens, loading: !1 }), !0;
24
24
  }
25
- return s({ loading: !1, error: "No login handler configured" }), !1;
25
+ return c({ loading: !1, error: "No login handler configured" }), !1;
26
26
  } catch (p) {
27
- return s({ loading: !1, error: (p == null ? void 0 : p.message) ?? "Login failed" }), !1;
27
+ return c({ loading: !1, error: (p == null ? void 0 : p.message) ?? "Login failed" }), !1;
28
28
  }
29
- }, [n, s]), c = A(() => {
30
- u == null || u(), s({ isAuthenticated: !1, user: null, tokens: null, loading: !1, error: null });
31
- }, [u, s]), k = A(async () => {
32
- var o;
33
- if (!((o = i.tokens) != null && o.refreshToken) || !d) return !1;
29
+ }, [n, c]), i = x(() => {
30
+ d == null || d(), c({ isAuthenticated: !1, user: null, tokens: null, loading: !1, error: null });
31
+ }, [d, c]), k = x(async () => {
32
+ var s;
33
+ if (!((s = r.tokens) != null && s.refreshToken) || !o) return !1;
34
34
  try {
35
- const l = await d(i.tokens.refreshToken);
36
- return s({ tokens: l }), !0;
35
+ const h = await o(r.tokens.refreshToken);
36
+ return c({ tokens: h }), !0;
37
37
  } catch {
38
- return c(), !1;
38
+ return i(), !1;
39
39
  }
40
- }, [i.tokens, d, s, c]), b = A((o, l) => {
41
- s({ isAuthenticated: !0, user: o, tokens: l, loading: !1, error: null });
42
- }, [s]), C = A((...o) => i.user ? o.every((l) => i.user.roles.includes(l)) : !1, [i.user]), y = A((...o) => i.user ? o.every((l) => i.user.permissions.includes(l)) : !1, [i.user]), $ = A(() => {
43
- s({ error: null });
44
- }, [s]);
40
+ }, [r.tokens, o, c, i]), b = x((s, h) => {
41
+ c({ isAuthenticated: !0, user: s, tokens: h, loading: !1, error: null });
42
+ }, [c]), C = x((...s) => r.user ? s.every((h) => r.user.roles.includes(h)) : !1, [r.user]), w = x((...s) => r.user ? s.every((h) => r.user.permissions.includes(h)) : !1, [r.user]), A = x(() => {
43
+ c({ error: null });
44
+ }, [c]);
45
45
  return {
46
- ...i,
47
- login: w,
48
- logout: c,
46
+ ...r,
47
+ login: v,
48
+ logout: i,
49
49
  refreshToken: k,
50
50
  setAuth: b,
51
51
  hasRoles: C,
52
- hasPermissions: y,
53
- clearError: $
52
+ hasPermissions: w,
53
+ clearError: A
54
54
  };
55
55
  }
56
- const V = T(({
57
- onSubmit: a,
58
- loading: n = !1,
59
- error: d,
60
- showRememberMe: u = !0,
61
- showForgotPassword: h = !0,
62
- onForgotPassword: f,
63
- showRegisterLink: i = !0,
64
- onRegisterClick: m,
65
- title: s = "Sign In",
66
- submitLabel: w = "Sign In",
67
- logo: c,
68
- footer: k,
69
- className: b,
70
- style: C,
71
- emailLabel: y = "Email",
72
- passwordLabel: $ = "Password"
73
- }, o) => {
74
- const [l, p] = _(""), [F, g] = _(""), [P, v] = _(!1), S = A((x) => {
75
- x.preventDefault(), a == null || a({ email: l, password: F, rememberMe: P });
76
- }, [l, F, P, a]);
77
- return /* @__PURE__ */ t(
78
- "form",
79
- {
80
- ref: o,
81
- className: `nice-login-form${b ? ` ${b}` : ""}`,
82
- style: C,
83
- onSubmit: S,
84
- noValidate: !0,
85
- children: [
86
- c && /* @__PURE__ */ e("div", { className: "nice-login-form__logo", children: c }),
87
- /* @__PURE__ */ e("h2", { className: "nice-login-form__title", children: s }),
88
- d && /* @__PURE__ */ e("div", { className: "nice-login-form__error", role: "alert", children: d }),
89
- /* @__PURE__ */ t("div", { className: "nice-login-form__field", children: [
90
- /* @__PURE__ */ e("label", { htmlFor: "nice-login-email", children: y }),
91
- /* @__PURE__ */ e(
92
- "input",
93
- {
94
- id: "nice-login-email",
95
- className: "nice-input",
96
- type: "email",
97
- value: l,
98
- onChange: (x) => p(x.target.value),
99
- autoComplete: "email",
100
- required: !0,
101
- disabled: n
102
- }
103
- )
104
- ] }),
105
- /* @__PURE__ */ t("div", { className: "nice-login-form__field", children: [
106
- /* @__PURE__ */ e("label", { htmlFor: "nice-login-password", children: $ }),
56
+ const j = E(
57
+ ({
58
+ onSubmit: a,
59
+ loading: n = !1,
60
+ error: o,
61
+ showRememberMe: d = !0,
62
+ showForgotPassword: u = !0,
63
+ onForgotPassword: f,
64
+ showRegisterLink: r = !0,
65
+ onRegisterClick: m,
66
+ title: c = "Sign In",
67
+ submitLabel: v = "Sign In",
68
+ logo: i,
69
+ footer: k,
70
+ className: b,
71
+ style: C,
72
+ emailLabel: w = "Email",
73
+ passwordLabel: A = "Password",
74
+ tracelessPolicy: s,
75
+ privacyMessage: h
76
+ }, p) => {
77
+ const [$, g] = _(""), [S, y] = _(""), [T, R] = _(!1), L = q(() => !(!d || s && !s.cookiesAllowed), [d, s]), P = x(
78
+ (F) => {
79
+ F.preventDefault();
80
+ const D = (s == null ? void 0 : s.cookiesAllowed) === !1 ? !1 : T;
81
+ a == null || a({ email: $, password: S, rememberMe: D });
82
+ },
83
+ [$, S, T, a, s]
84
+ );
85
+ return /* @__PURE__ */ t(
86
+ "form",
87
+ {
88
+ ref: p,
89
+ className: `nice-login-form${b ? ` ${b}` : ""}`,
90
+ style: C,
91
+ onSubmit: P,
92
+ noValidate: !0,
93
+ children: [
94
+ i && /* @__PURE__ */ e("div", { className: "nice-login-form__logo", children: i }),
95
+ /* @__PURE__ */ e("h2", { className: "nice-login-form__title", children: c }),
96
+ o && /* @__PURE__ */ e("div", { className: "nice-login-form__error", role: "alert", children: o }),
97
+ /* @__PURE__ */ t("div", { className: "nice-login-form__field", children: [
98
+ /* @__PURE__ */ e("label", { htmlFor: "nice-login-email", children: w }),
99
+ /* @__PURE__ */ e(
100
+ "input",
101
+ {
102
+ id: "nice-login-email",
103
+ className: "nice-input",
104
+ type: "email",
105
+ value: $,
106
+ onChange: (F) => g(F.target.value),
107
+ autoComplete: "email",
108
+ required: !0,
109
+ disabled: n
110
+ }
111
+ )
112
+ ] }),
113
+ /* @__PURE__ */ t("div", { className: "nice-login-form__field", children: [
114
+ /* @__PURE__ */ e("label", { htmlFor: "nice-login-password", children: A }),
115
+ /* @__PURE__ */ e(
116
+ "input",
117
+ {
118
+ id: "nice-login-password",
119
+ className: "nice-input",
120
+ type: "password",
121
+ value: S,
122
+ onChange: (F) => y(F.target.value),
123
+ autoComplete: "current-password",
124
+ required: !0,
125
+ disabled: n
126
+ }
127
+ )
128
+ ] }),
129
+ /* @__PURE__ */ t("div", { className: "nice-login-form__options", children: [
130
+ L && /* @__PURE__ */ t("label", { className: "nice-login-form__remember", children: [
131
+ /* @__PURE__ */ e(
132
+ "input",
133
+ {
134
+ type: "checkbox",
135
+ checked: T,
136
+ onChange: (F) => R(F.target.checked),
137
+ disabled: n
138
+ }
139
+ ),
140
+ /* @__PURE__ */ e("span", { children: "Remember me" })
141
+ ] }),
142
+ !L && d && h && /* @__PURE__ */ e("span", { className: "nice-login-form__privacy-notice", children: h }),
143
+ u && /* @__PURE__ */ e(
144
+ "button",
145
+ {
146
+ type: "button",
147
+ className: "nice-login-form__forgot",
148
+ onClick: f,
149
+ disabled: n,
150
+ children: "Forgot password?"
151
+ }
152
+ )
153
+ ] }),
107
154
  /* @__PURE__ */ e(
108
- "input",
155
+ "button",
109
156
  {
110
- id: "nice-login-password",
111
- className: "nice-input",
112
- type: "password",
113
- value: F,
114
- onChange: (x) => g(x.target.value),
115
- autoComplete: "current-password",
116
- required: !0,
117
- disabled: n
157
+ type: "submit",
158
+ className: "nice-btn nice-btn--primary nice-login-form__submit",
159
+ disabled: n || !$ || !S,
160
+ children: n ? "…" : v
118
161
  }
119
- )
120
- ] }),
121
- /* @__PURE__ */ t("div", { className: "nice-login-form__options", children: [
122
- u && /* @__PURE__ */ t("label", { className: "nice-login-form__remember", children: [
123
- /* @__PURE__ */ e("input", { type: "checkbox", checked: P, onChange: (x) => v(x.target.checked), disabled: n }),
124
- /* @__PURE__ */ e("span", { children: "Remember me" })
162
+ ),
163
+ r && /* @__PURE__ */ t("div", { className: "nice-login-form__register", children: [
164
+ /* @__PURE__ */ e("span", { children: "Don't have an account? " }),
165
+ /* @__PURE__ */ e("button", { type: "button", onClick: m, disabled: n, children: "Register" })
125
166
  ] }),
126
- h && /* @__PURE__ */ e("button", { type: "button", className: "nice-login-form__forgot", onClick: f, disabled: n, children: "Forgot password?" })
127
- ] }),
128
- /* @__PURE__ */ e("button", { type: "submit", className: "nice-btn nice-btn--primary nice-login-form__submit", disabled: n || !l || !F, children: n ? "…" : w }),
129
- i && /* @__PURE__ */ t("div", { className: "nice-login-form__register", children: [
130
- /* @__PURE__ */ e("span", { children: "Don't have an account? " }),
131
- /* @__PURE__ */ e("button", { type: "button", onClick: m, disabled: n, children: "Register" })
132
- ] }),
133
- k && /* @__PURE__ */ e("div", { className: "nice-login-form__footer", children: k })
134
- ]
135
- }
136
- );
137
- });
138
- V.displayName = "NiceLoginForm";
139
- const j = {
167
+ k && /* @__PURE__ */ e("div", { className: "nice-login-form__footer", children: k })
168
+ ]
169
+ }
170
+ );
171
+ }
172
+ );
173
+ j.displayName = "NiceLoginForm";
174
+ const B = {
140
175
  0: "Very weak",
141
176
  1: "Weak",
142
177
  2: "Fair",
143
178
  3: "Strong",
144
179
  4: "Very strong"
145
- }, B = {
180
+ }, G = {
146
181
  0: "#d9534f",
147
182
  1: "#f0ad4e",
148
183
  2: "#5bc0de",
@@ -154,127 +189,127 @@ function I(a) {
154
189
  let n = 0;
155
190
  return a.length >= 8 && n++, a.length >= 12 && n++, /[a-z]/.test(a) && /[A-Z]/.test(a) && n++, /\d/.test(a) && n++, /[^a-zA-Z0-9]/.test(a) && n++, Math.min(4, n);
156
191
  }
157
- const M = T(({
192
+ const M = E(({
158
193
  password: a,
159
194
  strength: n,
160
- showLabel: d = !0,
161
- labels: u = j,
162
- className: h
195
+ showLabel: o = !0,
196
+ labels: d = B,
197
+ className: u
163
198
  }, f) => {
164
- const i = n ?? I(a), m = B[i], s = (i + 1) / 5 * 100;
165
- return /* @__PURE__ */ t("div", { ref: f, className: `nice-password-strength${h ? ` ${h}` : ""}`, children: [
166
- /* @__PURE__ */ e("div", { className: "nice-password-strength__bar", children: /* @__PURE__ */ e("div", { className: "nice-password-strength__fill", style: { width: `${s}%`, backgroundColor: m } }) }),
167
- d && /* @__PURE__ */ e("span", { className: "nice-password-strength__label", style: { color: m }, children: u[i] })
199
+ const r = n ?? I(a), m = G[r], c = (r + 1) / 5 * 100;
200
+ return /* @__PURE__ */ t("div", { ref: f, className: `nice-password-strength${u ? ` ${u}` : ""}`, children: [
201
+ /* @__PURE__ */ e("div", { className: "nice-password-strength__bar", children: /* @__PURE__ */ e("div", { className: "nice-password-strength__fill", style: { width: `${c}%`, backgroundColor: m } }) }),
202
+ o && /* @__PURE__ */ e("span", { className: "nice-password-strength__label", style: { color: m }, children: d[r] })
168
203
  ] });
169
204
  });
170
205
  M.displayName = "NicePasswordStrength";
171
- const G = T(({
206
+ const Q = E(({
172
207
  onSubmit: a,
173
208
  loading: n = !1,
174
- error: d,
175
- onLoginClick: u,
176
- showPasswordStrength: h = !0,
209
+ error: o,
210
+ onLoginClick: d,
211
+ showPasswordStrength: u = !0,
177
212
  minPasswordStrength: f = 2,
178
- termsUrl: i,
213
+ termsUrl: r,
179
214
  privacyUrl: m,
180
- title: s = "Create Account",
181
- logo: w,
182
- footer: c,
215
+ title: c = "Create Account",
216
+ logo: v,
217
+ footer: i,
183
218
  className: k,
184
219
  style: b
185
220
  }, C) => {
186
- const [y, $] = _(""), [o, l] = _(""), [p, F] = _(""), [g, P] = _(""), [v, S] = _(""), [x, D] = _(!1), L = I(g), E = g === v, R = y && p && g && E && x && L >= f && !n, r = A((N) => {
187
- N.preventDefault(), R && (a == null || a({ firstName: y, lastName: o, email: p, password: g, acceptTerms: x }));
188
- }, [R, y, o, p, g, x, a]);
221
+ const [w, A] = _(""), [s, h] = _(""), [p, $] = _(""), [g, S] = _(""), [y, T] = _(""), [R, L] = _(!1), P = I(g), F = g === y, D = w && p && g && F && R && P >= f && !n, l = x((N) => {
222
+ N.preventDefault(), D && (a == null || a({ firstName: w, lastName: s, email: p, password: g, acceptTerms: R }));
223
+ }, [D, w, s, p, g, R, a]);
189
224
  return /* @__PURE__ */ t(
190
225
  "form",
191
226
  {
192
227
  ref: C,
193
228
  className: `nice-register-form${k ? ` ${k}` : ""}`,
194
229
  style: b,
195
- onSubmit: r,
230
+ onSubmit: l,
196
231
  noValidate: !0,
197
232
  children: [
198
- w && /* @__PURE__ */ e("div", { className: "nice-register-form__logo", children: w }),
199
- /* @__PURE__ */ e("h2", { className: "nice-register-form__title", children: s }),
200
- d && /* @__PURE__ */ e("div", { className: "nice-register-form__error", role: "alert", children: d }),
233
+ v && /* @__PURE__ */ e("div", { className: "nice-register-form__logo", children: v }),
234
+ /* @__PURE__ */ e("h2", { className: "nice-register-form__title", children: c }),
235
+ o && /* @__PURE__ */ e("div", { className: "nice-register-form__error", role: "alert", children: o }),
201
236
  /* @__PURE__ */ t("div", { className: "nice-register-form__row", children: [
202
237
  /* @__PURE__ */ t("div", { className: "nice-register-form__field", children: [
203
238
  /* @__PURE__ */ e("label", { htmlFor: "nice-reg-first", children: "First name *" }),
204
- /* @__PURE__ */ e("input", { id: "nice-reg-first", className: "nice-input", type: "text", value: y, onChange: (N) => $(N.target.value), required: !0, disabled: n, autoComplete: "given-name" })
239
+ /* @__PURE__ */ e("input", { id: "nice-reg-first", className: "nice-input", type: "text", value: w, onChange: (N) => A(N.target.value), required: !0, disabled: n, autoComplete: "given-name" })
205
240
  ] }),
206
241
  /* @__PURE__ */ t("div", { className: "nice-register-form__field", children: [
207
242
  /* @__PURE__ */ e("label", { htmlFor: "nice-reg-last", children: "Last name" }),
208
- /* @__PURE__ */ e("input", { id: "nice-reg-last", className: "nice-input", type: "text", value: o, onChange: (N) => l(N.target.value), disabled: n, autoComplete: "family-name" })
243
+ /* @__PURE__ */ e("input", { id: "nice-reg-last", className: "nice-input", type: "text", value: s, onChange: (N) => h(N.target.value), disabled: n, autoComplete: "family-name" })
209
244
  ] })
210
245
  ] }),
211
246
  /* @__PURE__ */ t("div", { className: "nice-register-form__field", children: [
212
247
  /* @__PURE__ */ e("label", { htmlFor: "nice-reg-email", children: "Email *" }),
213
- /* @__PURE__ */ e("input", { id: "nice-reg-email", className: "nice-input", type: "email", value: p, onChange: (N) => F(N.target.value), required: !0, disabled: n, autoComplete: "email" })
248
+ /* @__PURE__ */ e("input", { id: "nice-reg-email", className: "nice-input", type: "email", value: p, onChange: (N) => $(N.target.value), required: !0, disabled: n, autoComplete: "email" })
214
249
  ] }),
215
250
  /* @__PURE__ */ t("div", { className: "nice-register-form__field", children: [
216
251
  /* @__PURE__ */ e("label", { htmlFor: "nice-reg-pass", children: "Password *" }),
217
- /* @__PURE__ */ e("input", { id: "nice-reg-pass", className: "nice-input", type: "password", value: g, onChange: (N) => P(N.target.value), required: !0, disabled: n, autoComplete: "new-password" }),
218
- h && g.length > 0 && /* @__PURE__ */ e(M, { password: g })
252
+ /* @__PURE__ */ e("input", { id: "nice-reg-pass", className: "nice-input", type: "password", value: g, onChange: (N) => S(N.target.value), required: !0, disabled: n, autoComplete: "new-password" }),
253
+ u && g.length > 0 && /* @__PURE__ */ e(M, { password: g })
219
254
  ] }),
220
255
  /* @__PURE__ */ t("div", { className: "nice-register-form__field", children: [
221
256
  /* @__PURE__ */ e("label", { htmlFor: "nice-reg-confirm", children: "Confirm password *" }),
222
- /* @__PURE__ */ e("input", { id: "nice-reg-confirm", className: "nice-input", type: "password", value: v, onChange: (N) => S(N.target.value), required: !0, disabled: n, autoComplete: "new-password" }),
223
- v && !E && /* @__PURE__ */ e("span", { className: "nice-error-text", children: "Passwords do not match" })
257
+ /* @__PURE__ */ e("input", { id: "nice-reg-confirm", className: "nice-input", type: "password", value: y, onChange: (N) => T(N.target.value), required: !0, disabled: n, autoComplete: "new-password" }),
258
+ y && !F && /* @__PURE__ */ e("span", { className: "nice-error-text", children: "Passwords do not match" })
224
259
  ] }),
225
260
  /* @__PURE__ */ t("label", { className: "nice-register-form__terms", children: [
226
- /* @__PURE__ */ e("input", { type: "checkbox", checked: x, onChange: (N) => D(N.target.checked), disabled: n }),
261
+ /* @__PURE__ */ e("input", { type: "checkbox", checked: R, onChange: (N) => L(N.target.checked), disabled: n }),
227
262
  /* @__PURE__ */ t("span", { children: [
228
263
  "I accept the",
229
264
  " ",
230
- i ? /* @__PURE__ */ e("a", { href: i, target: "_blank", rel: "noopener noreferrer", children: "Terms" }) : "Terms",
231
- m && /* @__PURE__ */ t(q, { children: [
265
+ r ? /* @__PURE__ */ e("a", { href: r, target: "_blank", rel: "noopener noreferrer", children: "Terms" }) : "Terms",
266
+ m && /* @__PURE__ */ t(V, { children: [
232
267
  " and ",
233
268
  /* @__PURE__ */ e("a", { href: m, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" })
234
269
  ] }),
235
270
  " *"
236
271
  ] })
237
272
  ] }),
238
- /* @__PURE__ */ e("button", { type: "submit", className: "nice-btn nice-btn--primary nice-register-form__submit", disabled: !R, children: n ? "…" : "Register" }),
239
- u && /* @__PURE__ */ t("div", { className: "nice-register-form__login", children: [
273
+ /* @__PURE__ */ e("button", { type: "submit", className: "nice-btn nice-btn--primary nice-register-form__submit", disabled: !D, children: n ? "…" : "Register" }),
274
+ d && /* @__PURE__ */ t("div", { className: "nice-register-form__login", children: [
240
275
  /* @__PURE__ */ e("span", { children: "Already have an account? " }),
241
- /* @__PURE__ */ e("button", { type: "button", onClick: u, children: "Sign in" })
276
+ /* @__PURE__ */ e("button", { type: "button", onClick: d, children: "Sign in" })
242
277
  ] }),
243
- c && /* @__PURE__ */ e("div", { className: "nice-register-form__footer", children: c })
278
+ i && /* @__PURE__ */ e("div", { className: "nice-register-form__footer", children: i })
244
279
  ]
245
280
  }
246
281
  );
247
282
  });
248
- G.displayName = "NiceRegistrationForm";
249
- const Q = T(({
283
+ Q.displayName = "NiceRegistrationForm";
284
+ const z = E(({
250
285
  requireCurrentPassword: a = !0,
251
286
  onSubmit: n,
252
- loading: d = !1,
253
- error: u,
254
- success: h,
287
+ loading: o = !1,
288
+ error: d,
289
+ success: u,
255
290
  minPasswordStrength: f = 2,
256
- title: i = "Change Password",
291
+ title: r = "Change Password",
257
292
  className: m,
258
- style: s
259
- }, w) => {
260
- const [c, k] = _(""), [b, C] = _(""), [y, $] = _(""), o = I(b), l = b === y, p = (!a || c.length > 0) && b.length > 0 && l && o >= f && !d, F = A((g) => {
293
+ style: c
294
+ }, v) => {
295
+ const [i, k] = _(""), [b, C] = _(""), [w, A] = _(""), s = I(b), h = b === w, p = (!a || i.length > 0) && b.length > 0 && h && s >= f && !o, $ = x((g) => {
261
296
  g.preventDefault(), p && (n == null || n({
262
- currentPassword: a ? c : void 0,
297
+ currentPassword: a ? i : void 0,
263
298
  newPassword: b
264
299
  }));
265
- }, [p, c, b, a, n]);
300
+ }, [p, i, b, a, n]);
266
301
  return /* @__PURE__ */ t(
267
302
  "form",
268
303
  {
269
- ref: w,
304
+ ref: v,
270
305
  className: `nice-change-password${m ? ` ${m}` : ""}`,
271
- style: s,
272
- onSubmit: F,
306
+ style: c,
307
+ onSubmit: $,
273
308
  noValidate: !0,
274
309
  children: [
275
- /* @__PURE__ */ e("h3", { className: "nice-change-password__title", children: i }),
276
- u && /* @__PURE__ */ e("div", { className: "nice-change-password__error", role: "alert", children: u }),
277
- h && /* @__PURE__ */ e("div", { className: "nice-change-password__success", role: "status", children: h }),
310
+ /* @__PURE__ */ e("h3", { className: "nice-change-password__title", children: r }),
311
+ d && /* @__PURE__ */ e("div", { className: "nice-change-password__error", role: "alert", children: d }),
312
+ u && /* @__PURE__ */ e("div", { className: "nice-change-password__success", role: "status", children: u }),
278
313
  a && /* @__PURE__ */ t("div", { className: "nice-change-password__field", children: [
279
314
  /* @__PURE__ */ e("label", { htmlFor: "nice-cp-current", children: "Current password" }),
280
315
  /* @__PURE__ */ e(
@@ -283,10 +318,10 @@ const Q = T(({
283
318
  id: "nice-cp-current",
284
319
  className: "nice-input",
285
320
  type: "password",
286
- value: c,
321
+ value: i,
287
322
  onChange: (g) => k(g.target.value),
288
323
  autoComplete: "current-password",
289
- disabled: d,
324
+ disabled: o,
290
325
  required: !0
291
326
  }
292
327
  )
@@ -302,7 +337,7 @@ const Q = T(({
302
337
  value: b,
303
338
  onChange: (g) => C(g.target.value),
304
339
  autoComplete: "new-password",
305
- disabled: d,
340
+ disabled: o,
306
341
  required: !0
307
342
  }
308
343
  ),
@@ -316,56 +351,56 @@ const Q = T(({
316
351
  id: "nice-cp-confirm",
317
352
  className: "nice-input",
318
353
  type: "password",
319
- value: y,
320
- onChange: (g) => $(g.target.value),
354
+ value: w,
355
+ onChange: (g) => A(g.target.value),
321
356
  autoComplete: "new-password",
322
- disabled: d,
357
+ disabled: o,
323
358
  required: !0
324
359
  }
325
360
  ),
326
- y && !l && /* @__PURE__ */ e("span", { className: "nice-error-text", children: "Passwords do not match" })
361
+ w && !h && /* @__PURE__ */ e("span", { className: "nice-error-text", children: "Passwords do not match" })
327
362
  ] }),
328
- /* @__PURE__ */ e("button", { type: "submit", className: "nice-btn nice-btn--primary", disabled: !p, children: d ? "…" : "Change Password" })
363
+ /* @__PURE__ */ e("button", { type: "submit", className: "nice-btn nice-btn--primary", disabled: !p, children: o ? "…" : "Change Password" })
329
364
  ]
330
365
  }
331
366
  );
332
367
  });
333
- Q.displayName = "NiceChangePassword";
334
- const z = T(({
368
+ z.displayName = "NiceChangePassword";
369
+ const J = E(({
335
370
  secret: a,
336
371
  qrCodeUrl: n,
337
- issuer: d,
338
- accountName: u,
339
- onVerify: h,
372
+ issuer: o,
373
+ accountName: d,
374
+ onVerify: u,
340
375
  loading: f = !1,
341
- error: i,
376
+ error: r,
342
377
  onCancel: m,
343
- recoveryCodes: s,
344
- step: w = "setup",
345
- onStepChange: c,
378
+ recoveryCodes: c,
379
+ step: v = "setup",
380
+ onStepChange: i,
346
381
  className: k,
347
382
  style: b
348
383
  }, C) => {
349
- const [y, $] = _(""), [o, l] = _(!1), [p, F] = _(!1), g = A((v) => {
350
- v.preventDefault(), y.length >= 6 && (h == null || h(y));
351
- }, [y, h]), P = `otpauth://totp/${d ? `${d}:` : ""}${u ?? "user"}?secret=${a}${d ? `&issuer=${d}` : ""}&digits=6&period=30`;
384
+ const [w, A] = _(""), [s, h] = _(!1), [p, $] = _(!1), g = x((y) => {
385
+ y.preventDefault(), w.length >= 6 && (u == null || u(w));
386
+ }, [w, u]), S = `otpauth://totp/${o ? `${o}:` : ""}${d ?? "user"}?secret=${a}${o ? `&issuer=${o}` : ""}&digits=6&period=30`;
352
387
  return /* @__PURE__ */ t("div", { ref: C, className: `nice-2fa-setup${k ? ` ${k}` : ""}`, style: b, children: [
353
388
  /* @__PURE__ */ e("h3", { className: "nice-2fa-setup__title", children: "Two-Factor Authentication" }),
354
- w === "setup" && /* @__PURE__ */ t("div", { className: "nice-2fa-setup__step", children: [
389
+ v === "setup" && /* @__PURE__ */ t("div", { className: "nice-2fa-setup__step", children: [
355
390
  /* @__PURE__ */ e("p", { className: "nice-2fa-setup__instruction", children: "Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.):" }),
356
391
  n ? /* @__PURE__ */ e("img", { src: n, alt: "2FA QR Code", className: "nice-2fa-setup__qr" }) : /* @__PURE__ */ t("div", { className: "nice-2fa-setup__qr-placeholder", children: [
357
392
  /* @__PURE__ */ e("span", { children: "QR Code" }),
358
- /* @__PURE__ */ e("code", { className: "nice-2fa-setup__uri", children: P })
393
+ /* @__PURE__ */ e("code", { className: "nice-2fa-setup__uri", children: S })
359
394
  ] }),
360
395
  /* @__PURE__ */ t("div", { className: "nice-2fa-setup__secret", children: [
361
396
  /* @__PURE__ */ e("span", { children: "Or enter manually: " }),
362
- o ? /* @__PURE__ */ e("code", { className: "nice-2fa-setup__secret-key", children: a }) : /* @__PURE__ */ e("button", { type: "button", onClick: () => l(!0), children: "Show secret key" })
397
+ s ? /* @__PURE__ */ e("code", { className: "nice-2fa-setup__secret-key", children: a }) : /* @__PURE__ */ e("button", { type: "button", onClick: () => h(!0), children: "Show secret key" })
363
398
  ] }),
364
- /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: () => c == null ? void 0 : c("verify"), children: "Next — Verify" })
399
+ /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: () => i == null ? void 0 : i("verify"), children: "Next — Verify" })
365
400
  ] }),
366
- w === "verify" && /* @__PURE__ */ t("form", { className: "nice-2fa-setup__step", onSubmit: g, children: [
401
+ v === "verify" && /* @__PURE__ */ t("form", { className: "nice-2fa-setup__step", onSubmit: g, children: [
367
402
  /* @__PURE__ */ e("p", { className: "nice-2fa-setup__instruction", children: "Enter the 6-digit code from your authenticator app:" }),
368
- i && /* @__PURE__ */ e("div", { className: "nice-2fa-setup__error", role: "alert", children: i }),
403
+ r && /* @__PURE__ */ e("div", { className: "nice-2fa-setup__error", role: "alert", children: r }),
369
404
  /* @__PURE__ */ e(
370
405
  "input",
371
406
  {
@@ -373,8 +408,8 @@ const z = T(({
373
408
  type: "text",
374
409
  inputMode: "numeric",
375
410
  maxLength: 6,
376
- value: y,
377
- onChange: (v) => $(v.target.value.replace(/\D/g, "").slice(0, 6)),
411
+ value: w,
412
+ onChange: (y) => A(y.target.value.replace(/\D/g, "").slice(0, 6)),
378
413
  placeholder: "000000",
379
414
  autoFocus: !0,
380
415
  disabled: f,
@@ -382,52 +417,52 @@ const z = T(({
382
417
  }
383
418
  ),
384
419
  /* @__PURE__ */ t("div", { className: "nice-2fa-setup__actions", children: [
385
- /* @__PURE__ */ e("button", { type: "button", className: "nice-btn", onClick: () => c == null ? void 0 : c("setup"), children: "Back" }),
386
- /* @__PURE__ */ e("button", { type: "submit", className: "nice-btn nice-btn--primary", disabled: f || y.length < 6, children: f ? "…" : "Verify" })
420
+ /* @__PURE__ */ e("button", { type: "button", className: "nice-btn", onClick: () => i == null ? void 0 : i("setup"), children: "Back" }),
421
+ /* @__PURE__ */ e("button", { type: "submit", className: "nice-btn nice-btn--primary", disabled: f || w.length < 6, children: f ? "…" : "Verify" })
387
422
  ] })
388
423
  ] }),
389
- w === "recovery" && s && /* @__PURE__ */ t("div", { className: "nice-2fa-setup__step", children: [
424
+ v === "recovery" && c && /* @__PURE__ */ t("div", { className: "nice-2fa-setup__step", children: [
390
425
  /* @__PURE__ */ e("p", { className: "nice-2fa-setup__instruction", children: "Save these recovery codes in a safe place. Each code can only be used once:" }),
391
- /* @__PURE__ */ e("div", { className: "nice-2fa-setup__recovery-codes", children: s.map((v, S) => /* @__PURE__ */ e("code", { className: "nice-2fa-setup__recovery-code", children: v }, S)) }),
426
+ /* @__PURE__ */ e("div", { className: "nice-2fa-setup__recovery-codes", children: c.map((y, T) => /* @__PURE__ */ e("code", { className: "nice-2fa-setup__recovery-code", children: y }, T)) }),
392
427
  /* @__PURE__ */ e(
393
428
  "button",
394
429
  {
395
430
  type: "button",
396
431
  className: "nice-btn",
397
432
  onClick: () => {
398
- var v;
399
- (v = navigator.clipboard) == null || v.writeText(s.join(`
400
- `)), F(!0);
433
+ var y;
434
+ (y = navigator.clipboard) == null || y.writeText(c.join(`
435
+ `)), $(!0);
401
436
  },
402
437
  children: p ? "Copied!" : "Copy all codes"
403
438
  }
404
439
  ),
405
440
  m && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: m, children: "Done" })
406
441
  ] }),
407
- m && w !== "recovery" && /* @__PURE__ */ e("button", { type: "button", className: "nice-2fa-setup__cancel", onClick: m, children: "Cancel" })
442
+ m && v !== "recovery" && /* @__PURE__ */ e("button", { type: "button", className: "nice-2fa-setup__cancel", onClick: m, children: "Cancel" })
408
443
  ] });
409
444
  });
410
- z.displayName = "NiceTwoFaSetup";
411
- const J = T(({
445
+ J.displayName = "NiceTwoFaSetup";
446
+ const K = E(({
412
447
  provider: a = "custom",
413
448
  siteKey: n,
414
- onVerify: d,
415
- onExpire: u,
416
- onError: h,
449
+ onVerify: o,
450
+ onExpire: d,
451
+ onError: u,
417
452
  theme: f = "light",
418
- size: i = "normal",
453
+ size: r = "normal",
419
454
  customRender: m,
420
- className: s,
421
- style: w
422
- }, c) => a === "custom" && m ? /* @__PURE__ */ e("div", { ref: c, className: `nice-captcha nice-captcha--custom${s ? ` ${s}` : ""}`, style: w, children: m }) : /* @__PURE__ */ e(
455
+ className: c,
456
+ style: v
457
+ }, i) => a === "custom" && m ? /* @__PURE__ */ e("div", { ref: i, className: `nice-captcha nice-captcha--custom${c ? ` ${c}` : ""}`, style: v, children: m }) : /* @__PURE__ */ e(
423
458
  "div",
424
459
  {
425
- ref: c,
426
- className: `nice-captcha nice-captcha--${a} nice-captcha--${f}${i === "compact" ? " nice-captcha--compact" : ""}${s ? ` ${s}` : ""}`,
427
- style: w,
460
+ ref: i,
461
+ className: `nice-captcha nice-captcha--${a} nice-captcha--${f}${r === "compact" ? " nice-captcha--compact" : ""}${c ? ` ${c}` : ""}`,
462
+ style: v,
428
463
  "data-sitekey": n,
429
464
  "data-theme": f,
430
- "data-size": i,
465
+ "data-size": r,
431
466
  children: /* @__PURE__ */ t("div", { className: "nice-captcha__placeholder", children: [
432
467
  /* @__PURE__ */ t("span", { children: [
433
468
  "🔒 Captcha (",
@@ -442,97 +477,97 @@ const J = T(({
442
477
  ] })
443
478
  }
444
479
  ));
445
- J.displayName = "NiceCaptcha";
446
- const K = [
480
+ K.displayName = "NiceCaptcha";
481
+ const U = [
447
482
  { id: "google", label: "Google", icon: "🔵", color: "#4285f4", textColor: "#fff" },
448
483
  { id: "microsoft", label: "Microsoft", icon: "🟦", color: "#00a4ef", textColor: "#fff" },
449
484
  { id: "discord", label: "Discord", icon: "💬", color: "#5865f2", textColor: "#fff" },
450
485
  { id: "spotify", label: "Spotify", icon: "🎵", color: "#1db954", textColor: "#fff" },
451
486
  { id: "github", label: "GitHub", icon: "🐙", color: "#24292e", textColor: "#fff" }
452
- ], U = T(({
453
- providers: a = K,
487
+ ], Z = E(({
488
+ providers: a = U,
454
489
  onProviderClick: n,
455
- disabled: d = !1,
456
- loadingProvider: u,
457
- direction: h = "vertical",
490
+ disabled: o = !1,
491
+ loadingProvider: d,
492
+ direction: u = "vertical",
458
493
  separatorText: f = "or continue with",
459
- showSeparator: i = !0,
494
+ showSeparator: r = !0,
460
495
  className: m,
461
- style: s
462
- }, w) => /* @__PURE__ */ t(
496
+ style: c
497
+ }, v) => /* @__PURE__ */ t(
463
498
  "div",
464
499
  {
465
- ref: w,
466
- className: `nice-oauth nice-oauth--${h}${m ? ` ${m}` : ""}`,
467
- style: s,
500
+ ref: v,
501
+ className: `nice-oauth nice-oauth--${u}${m ? ` ${m}` : ""}`,
502
+ style: c,
468
503
  children: [
469
- i && /* @__PURE__ */ t("div", { className: "nice-oauth__separator", children: [
504
+ r && /* @__PURE__ */ t("div", { className: "nice-oauth__separator", children: [
470
505
  /* @__PURE__ */ e("hr", {}),
471
506
  /* @__PURE__ */ e("span", { children: f }),
472
507
  /* @__PURE__ */ e("hr", {})
473
508
  ] }),
474
- /* @__PURE__ */ e("div", { className: "nice-oauth__buttons", children: a.map((c) => /* @__PURE__ */ t(
509
+ /* @__PURE__ */ e("div", { className: "nice-oauth__buttons", children: a.map((i) => /* @__PURE__ */ t(
475
510
  "button",
476
511
  {
477
512
  type: "button",
478
- className: `nice-oauth__btn${u === c.id ? " nice-oauth__btn--loading" : ""}`,
479
- style: { backgroundColor: c.color, color: c.textColor },
480
- onClick: () => n == null ? void 0 : n(c.id),
481
- disabled: d || !!u,
513
+ className: `nice-oauth__btn${d === i.id ? " nice-oauth__btn--loading" : ""}`,
514
+ style: { backgroundColor: i.color, color: i.textColor },
515
+ onClick: () => n == null ? void 0 : n(i.id),
516
+ disabled: o || !!d,
482
517
  children: [
483
- c.icon && /* @__PURE__ */ e("span", { className: "nice-oauth__btn-icon", children: c.icon }),
484
- /* @__PURE__ */ e("span", { className: "nice-oauth__btn-label", children: u === c.id ? "…" : c.label })
518
+ i.icon && /* @__PURE__ */ e("span", { className: "nice-oauth__btn-icon", children: i.icon }),
519
+ /* @__PURE__ */ e("span", { className: "nice-oauth__btn-label", children: d === i.id ? "…" : i.label })
485
520
  ]
486
521
  },
487
- c.id
522
+ i.id
488
523
  )) })
489
524
  ]
490
525
  }
491
526
  ));
492
- U.displayName = "NiceOAuthButtons";
493
- const X = T(function(n, d) {
527
+ Z.displayName = "NiceOAuthButtons";
528
+ const Y = E(function(n, o) {
494
529
  const {
495
- tokens: u,
496
- onCreate: h,
530
+ tokens: d,
531
+ onCreate: u,
497
532
  onRevoke: f,
498
- availableScopes: i = [],
533
+ availableScopes: r = [],
499
534
  maxTokens: m = 10,
500
- title: s = "API Tokens",
501
- className: w,
502
- style: c
503
- } = n, [k, b] = _(!1), [C, y] = _(""), [$, o] = _([]), [l, p] = _("90"), [F, g] = _(null), [P, v] = _(!1), [S, x] = _(null), D = A(async () => {
504
- if (!(!h || !C.trim())) {
505
- v(!0);
535
+ title: c = "API Tokens",
536
+ className: v,
537
+ style: i
538
+ } = n, [k, b] = _(!1), [C, w] = _(""), [A, s] = _([]), [h, p] = _("90"), [$, g] = _(null), [S, y] = _(!1), [T, R] = _(null), L = x(async () => {
539
+ if (!(!u || !C.trim())) {
540
+ y(!0);
506
541
  try {
507
- const r = l ? parseInt(l, 10) : void 0, N = await h(C.trim(), $, r);
508
- g(N), y(""), o([]), b(!1);
542
+ const l = h ? parseInt(h, 10) : void 0, N = await u(C.trim(), A, l);
543
+ g(N), w(""), s([]), b(!1);
509
544
  } finally {
510
- v(!1);
545
+ y(!1);
511
546
  }
512
547
  }
513
- }, [h, C, $, l]), L = A(async (r) => {
548
+ }, [u, C, A, h]), P = x(async (l) => {
514
549
  if (f) {
515
- x(r);
550
+ R(l);
516
551
  try {
517
- await f(r);
552
+ await f(l);
518
553
  } finally {
519
- x(null);
554
+ R(null);
520
555
  }
521
556
  }
522
- }, [f]), E = (r) => {
523
- o((N) => N.includes(r) ? N.filter((O) => O !== r) : [...N, r]);
524
- }, R = u.length < m;
525
- return /* @__PURE__ */ t("div", { ref: d, className: `nice-token-management ${w ?? ""}`, style: c, children: [
557
+ }, [f]), F = (l) => {
558
+ s((N) => N.includes(l) ? N.filter((O) => O !== l) : [...N, l]);
559
+ }, D = d.length < m;
560
+ return /* @__PURE__ */ t("div", { ref: o, className: `nice-token-management ${v ?? ""}`, style: i, children: [
526
561
  /* @__PURE__ */ t("div", { className: "nice-token-management__header", children: [
527
- /* @__PURE__ */ e("h3", { children: s }),
528
- R && /* @__PURE__ */ e("button", { className: "nice-token-management__new-btn", onClick: () => b(!0), disabled: k, children: "+ New Token" })
562
+ /* @__PURE__ */ e("h3", { children: c }),
563
+ D && /* @__PURE__ */ e("button", { className: "nice-token-management__new-btn", onClick: () => b(!0), disabled: k, children: "+ New Token" })
529
564
  ] }),
530
- F && /* @__PURE__ */ t("div", { className: "nice-token-management__reveal", children: [
565
+ $ && /* @__PURE__ */ t("div", { className: "nice-token-management__reveal", children: [
531
566
  /* @__PURE__ */ t("p", { children: [
532
567
  /* @__PURE__ */ e("strong", { children: "New token created!" }),
533
568
  " Copy it now — it won't be shown again."
534
569
  ] }),
535
- /* @__PURE__ */ e("code", { className: "nice-token-management__token-value", children: F }),
570
+ /* @__PURE__ */ e("code", { className: "nice-token-management__token-value", children: $ }),
536
571
  /* @__PURE__ */ e("button", { onClick: () => g(null), children: "Dismiss" })
537
572
  ] }),
538
573
  k && /* @__PURE__ */ t("div", { className: "nice-token-management__create-form", children: [
@@ -543,25 +578,25 @@ const X = T(function(n, d) {
543
578
  {
544
579
  type: "text",
545
580
  value: C,
546
- onChange: (r) => y(r.target.value),
581
+ onChange: (l) => w(l.target.value),
547
582
  placeholder: "My API token",
548
583
  maxLength: 64
549
584
  }
550
585
  )
551
586
  ] }),
552
- i.length > 0 && /* @__PURE__ */ t("fieldset", { children: [
587
+ r.length > 0 && /* @__PURE__ */ t("fieldset", { children: [
553
588
  /* @__PURE__ */ e("legend", { children: "Scopes" }),
554
- i.map((r) => /* @__PURE__ */ t("label", { className: "nice-token-management__scope", children: [
589
+ r.map((l) => /* @__PURE__ */ t("label", { className: "nice-token-management__scope", children: [
555
590
  /* @__PURE__ */ e(
556
591
  "input",
557
592
  {
558
593
  type: "checkbox",
559
- checked: $.includes(r),
560
- onChange: () => E(r)
594
+ checked: A.includes(l),
595
+ onChange: () => F(l)
561
596
  }
562
597
  ),
563
- r
564
- ] }, r))
598
+ l
599
+ ] }, l))
565
600
  ] }),
566
601
  /* @__PURE__ */ t("label", { children: [
567
602
  "Expires in (days)",
@@ -569,19 +604,19 @@ const X = T(function(n, d) {
569
604
  "input",
570
605
  {
571
606
  type: "number",
572
- value: l,
573
- onChange: (r) => p(r.target.value),
607
+ value: h,
608
+ onChange: (l) => p(l.target.value),
574
609
  min: 1,
575
610
  max: 365
576
611
  }
577
612
  )
578
613
  ] }),
579
614
  /* @__PURE__ */ t("div", { className: "nice-token-management__create-actions", children: [
580
- /* @__PURE__ */ e("button", { onClick: D, disabled: P || !C.trim(), children: P ? "Creating…" : "Create Token" }),
615
+ /* @__PURE__ */ e("button", { onClick: L, disabled: S || !C.trim(), children: S ? "Creating…" : "Create Token" }),
581
616
  /* @__PURE__ */ e("button", { onClick: () => b(!1), children: "Cancel" })
582
617
  ] })
583
618
  ] }),
584
- u.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-token-management__empty", children: "No API tokens yet." }) : /* @__PURE__ */ t("table", { className: "nice-token-management__table", children: [
619
+ d.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-token-management__empty", children: "No API tokens yet." }) : /* @__PURE__ */ t("table", { className: "nice-token-management__table", children: [
585
620
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
586
621
  /* @__PURE__ */ e("th", { children: "Name" }),
587
622
  /* @__PURE__ */ e("th", { children: "Prefix" }),
@@ -591,42 +626,42 @@ const X = T(function(n, d) {
591
626
  /* @__PURE__ */ e("th", { children: "Scopes" }),
592
627
  /* @__PURE__ */ e("th", {})
593
628
  ] }) }),
594
- /* @__PURE__ */ e("tbody", { children: u.map((r) => {
629
+ /* @__PURE__ */ e("tbody", { children: d.map((l) => {
595
630
  var N;
596
631
  return /* @__PURE__ */ t("tr", { children: [
597
- /* @__PURE__ */ e("td", { children: r.name }),
632
+ /* @__PURE__ */ e("td", { children: l.name }),
598
633
  /* @__PURE__ */ e("td", { children: /* @__PURE__ */ t("code", { children: [
599
- r.prefix,
634
+ l.prefix,
600
635
  "…"
601
636
  ] }) }),
602
- /* @__PURE__ */ e("td", { children: r.createdAt }),
603
- /* @__PURE__ */ e("td", { children: r.expiresAt ?? "—" }),
604
- /* @__PURE__ */ e("td", { children: r.lastUsedAt ?? "Never" }),
605
- /* @__PURE__ */ e("td", { children: ((N = r.scopes) == null ? void 0 : N.join(", ")) || "—" }),
637
+ /* @__PURE__ */ e("td", { children: l.createdAt }),
638
+ /* @__PURE__ */ e("td", { children: l.expiresAt ?? "—" }),
639
+ /* @__PURE__ */ e("td", { children: l.lastUsedAt ?? "Never" }),
640
+ /* @__PURE__ */ e("td", { children: ((N = l.scopes) == null ? void 0 : N.join(", ")) || "—" }),
606
641
  /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
607
642
  "button",
608
643
  {
609
644
  className: "nice-token-management__revoke-btn",
610
- onClick: () => L(r.id),
611
- disabled: S === r.id,
612
- children: S === r.id ? "Revoking…" : "Revoke"
645
+ onClick: () => P(l.id),
646
+ disabled: T === l.id,
647
+ children: T === l.id ? "Revoking…" : "Revoke"
613
648
  }
614
649
  ) })
615
- ] }, r.id);
650
+ ] }, l.id);
616
651
  }) })
617
652
  ] })
618
653
  ] });
619
654
  });
620
655
  export {
621
- J as NiceCaptcha,
622
- Q as NiceChangePassword,
623
- V as NiceLoginForm,
624
- U as NiceOAuthButtons,
656
+ K as NiceCaptcha,
657
+ z as NiceChangePassword,
658
+ j as NiceLoginForm,
659
+ Z as NiceOAuthButtons,
625
660
  M as NicePasswordStrength,
626
- G as NiceRegistrationForm,
627
- X as NiceTokenManagement,
628
- z as NiceTwoFaSetup,
661
+ Q as NiceRegistrationForm,
662
+ Y as NiceTokenManagement,
663
+ J as NiceTwoFaSetup,
629
664
  I as calcPasswordStrength,
630
- W as useAuth
665
+ X as useAuth
631
666
  };
632
667
  //# sourceMappingURL=index.mjs.map