@burdenoff/microfe-auth 2026.1101.4 → 2026.1103.1

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.
@@ -1,144 +1,149 @@
1
1
  import { useTr as e } from "../../shared/hooks/useTr.js";
2
2
  import { validateEmail as t, validatePassword as ee, validateUserFields as te } from "../utils/validation.js";
3
3
  import { resolveLegalUrl as n } from "../utils/legalUrls.js";
4
- import { useAuthOperations as r } from "../hooks/useAuthOperations.js";
5
- import { useOAuthOperations as i } from "../hooks/useOAuthOperations.js";
6
- import { AuthLayout as a } from "../components/AuthLayout.js";
7
- import { AlertIcon as o, CheckIcon as s, EmailIcon as c, EyeIcon as l, EyeOffIcon as u, GitHubIcon as ne, GoogleIcon as d, LockIcon as re, MicrosoftIcon as f, SpinnerIcon as p, UserIcon as m, XIcon as h } from "../components/AuthIcons.js";
8
- import { useAuth as ie } from "../providers/AuthProvider.js";
9
- import { CaptchaV2 as ae } from "../components/CaptchaV2.js";
10
- import { useSignupCaptcha as oe } from "../hooks/useSignupCaptcha.js";
11
- import { useState as g } from "react";
12
- import { useNavigate as se } from "react-router";
13
- import { Fragment as ce, jsx as _, jsxs as v } from "react/jsx-runtime";
14
- import { Button as y } from "@burdenoff/fe-libs/button";
15
- import { PagePurpose as le } from "@burdenoff/fe-libs/ui";
4
+ import { authPathWithReturnTo as r, rememberReturnTo as i, sanitizeReturnPath as a } from "../utils/pendingReturnTo.js";
5
+ import { useAuthOperations as o } from "../hooks/useAuthOperations.js";
6
+ import { useOAuthOperations as ne } from "../hooks/useOAuthOperations.js";
7
+ import { AuthLayout as s } from "../components/AuthLayout.js";
8
+ import { AlertIcon as c, CheckIcon as l, EmailIcon as u, EyeIcon as d, EyeOffIcon as f, GitHubIcon as re, GoogleIcon as ie, LockIcon as ae, MicrosoftIcon as oe, SpinnerIcon as se, UserIcon as ce, XIcon as le } from "../components/AuthIcons.js";
9
+ import { useAuth as ue } from "../providers/AuthProvider.js";
10
+ import { CaptchaV2 as p } from "../components/CaptchaV2.js";
11
+ import { useSignupCaptcha as de } from "../hooks/useSignupCaptcha.js";
12
+ import { useEffect as fe, useMemo as pe, useState as m } from "react";
13
+ import { useNavigate as me, useSearchParams as he } from "react-router";
14
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
15
+ import { Button as v } from "@burdenoff/fe-libs/button";
16
+ import { PagePurpose as ge } from "@burdenoff/fe-libs/ui";
16
17
  // src/auth/pages/RegisterPage.tsx
17
- function b() {
18
- let b = e(), { productName: x } = ie(), S = se(), { signUp: C, resendVerification: w, isLoading: T, errorCode: E } = r(), { initiateGoogleOAuth: ue, initiateMicrosoftOAuth: de, isProviderConfigured: D } = i(), [O, fe] = g(!1), [k, A] = g({
18
+ function y() {
19
+ let y = e(), { productName: b } = ue(), x = me(), [_e] = he(), S = _e.get("returnTo"), ve = pe(() => a(S), [S]);
20
+ fe(() => {
21
+ i(S);
22
+ }, [S]);
23
+ let C = r("/auth/login", ve), { signUp: ye, resendVerification: w, isLoading: T, errorCode: E } = o(), { initiateGoogleOAuth: D, initiateMicrosoftOAuth: O, isProviderConfigured: k } = ne(), [A, j] = m(!1), [M, N] = m({
19
24
  email: "",
20
25
  username: "",
21
26
  password: "",
22
27
  firstName: "",
23
28
  lastName: ""
24
- }), [j, M] = g([]), [N, P] = g(!1), [F, I] = g(null), [L, R] = g(null), [z, B] = g(null), [V, pe] = g(0), { enabled: H, siteKey: me } = oe(), [U, W] = g(!1), [G, K] = g(null), q = !!F && E === "ACCOUNT_DEACTIVATED", J = !!F && E === "ACCOUNT_REMOVED", Y = !!F && E === "ACCOUNT_SUSPENDED", X = (() => {
25
- let e = k.password;
29
+ }), [P, F] = m([]), [be, xe] = m(!1), [I, L] = m(null), [R, z] = m(null), [B, V] = m(null), [Se, Ce] = m(0), { enabled: H, siteKey: we } = de(), [U, W] = m(!1), [G, K] = m(null), q = !!I && E === "ACCOUNT_DEACTIVATED", J = !!I && E === "ACCOUNT_REMOVED", Y = !!I && E === "ACCOUNT_SUSPENDED", X = (() => {
30
+ let e = M.password;
26
31
  return [
27
32
  {
28
- label: b("auth.register.pwMin8", "At least 12 characters"),
33
+ label: y("auth.register.pwMin8", "At least 12 characters"),
29
34
  met: e.length >= 12
30
35
  },
31
36
  {
32
- label: b("auth.register.pwUppercase", "One uppercase letter"),
37
+ label: y("auth.register.pwUppercase", "One uppercase letter"),
33
38
  met: /[A-Z]/.test(e)
34
39
  },
35
40
  {
36
- label: b("auth.register.pwLowercase", "One lowercase letter"),
41
+ label: y("auth.register.pwLowercase", "One lowercase letter"),
37
42
  met: /[a-z]/.test(e)
38
43
  },
39
44
  {
40
- label: b("auth.register.pwNumber", "One number"),
45
+ label: y("auth.register.pwNumber", "One number"),
41
46
  met: /\d/.test(e)
42
47
  },
43
48
  {
44
- label: b("auth.register.pwSpecial", "One special character"),
49
+ label: y("auth.register.pwSpecial", "One special character"),
45
50
  met: /[!@#$%^&*(),.?":{}|<>]/.test(e)
46
51
  }
47
52
  ];
48
53
  })(), Z = (() => {
49
54
  let e = X.filter((e) => e.met).length;
50
55
  return e <= 2 ? {
51
- level: b("auth.register.passwordStrengthWeak", "weak"),
56
+ level: y("auth.register.passwordStrengthWeak", "weak"),
52
57
  color: "bg-status-error-bg-subtle0",
53
58
  width: "w-1/4"
54
59
  } : e <= 3 ? {
55
- level: b("auth.register.passwordStrengthFair", "fair"),
60
+ level: y("auth.register.passwordStrengthFair", "fair"),
56
61
  color: "bg-status-warning-text",
57
62
  width: "w-2/4"
58
63
  } : e <= 4 ? {
59
- level: b("auth.register.passwordStrengthGood", "good"),
64
+ level: y("auth.register.passwordStrengthGood", "good"),
60
65
  color: "bg-status-warning-bg-subtle0",
61
66
  width: "w-3/4"
62
67
  } : {
63
- level: b("auth.register.passwordStrengthStrong", "strong"),
68
+ level: y("auth.register.passwordStrengthStrong", "strong"),
64
69
  color: "bg-status-success-text",
65
70
  width: "w-full"
66
71
  };
67
- })(), he = async (e) => {
72
+ })(), Te = async (e) => {
68
73
  e.preventDefault();
69
74
  let n = [];
70
- t(k.email) || n.push(b("auth.register.invalidEmail", "Please enter a valid email address"));
71
- let r = te(k);
72
- r.valid || n.push(...r.errors.map((e) => b(`auth.register.${e.field}_${e.code}`, e.message)));
73
- let i = ee(k.password);
74
- if (i.valid || n.push(...i.errors), H && !z && n.push(b("auth.register.completeCaptcha", "Please complete the reCAPTCHA verification")), n.length > 0) M(n);
75
+ t(M.email) || n.push(y("auth.register.invalidEmail", "Please enter a valid email address"));
76
+ let r = te(M);
77
+ r.valid || n.push(...r.errors.map((e) => y(`auth.register.${e.field}_${e.code}`, e.message)));
78
+ let i = ee(M.password);
79
+ if (i.valid || n.push(...i.errors), H && !B && n.push(y("auth.register.completeCaptcha", "Please complete the reCAPTCHA verification")), n.length > 0) F(n);
75
80
  else {
76
- M([]), I(null);
81
+ F([]), L(null);
77
82
  try {
78
83
  let e = r.values;
79
- await C({
80
- ...k,
84
+ await ye({
85
+ ...M,
81
86
  firstName: e.firstName,
82
87
  lastName: e.lastName,
83
88
  username: e.username,
84
- ...z ? { recaptchaToken: z } : {}
85
- }), P(!0);
89
+ ...B ? { recaptchaToken: B } : {}
90
+ }), xe(!0);
86
91
  } catch (e) {
87
- let t = e instanceof Error ? e.message : b("auth.register.signUpFailed", "Sign up failed");
88
- I(t), console.error("Sign up failed:", e), H && (B(null), pe((e) => e + 1));
92
+ let t = e instanceof Error ? e.message : y("auth.register.signUpFailed", "Sign up failed");
93
+ L(t), console.error("Sign up failed:", e), H && (V(null), Ce((e) => e + 1));
89
94
  }
90
95
  }
91
- }, ge = () => {
92
- R(null);
96
+ }, Ee = () => {
97
+ z(null);
93
98
  try {
94
- ue();
99
+ D();
95
100
  } catch (e) {
96
- R(e instanceof Error ? e.message : b("auth.register.googleSignUpFailed", "Failed to initiate Google sign up"));
101
+ z(e instanceof Error ? e.message : y("auth.register.googleSignUpFailed", "Failed to initiate Google sign up"));
97
102
  }
98
- }, _e = () => {
99
- R(null);
103
+ }, De = () => {
104
+ z(null);
100
105
  try {
101
- de();
106
+ O();
102
107
  } catch (e) {
103
- R(e instanceof Error ? e.message : b("auth.register.microsoftSignUpFailed", "Failed to initiate Microsoft sign up"));
108
+ z(e instanceof Error ? e.message : y("auth.register.microsoftSignUpFailed", "Failed to initiate Microsoft sign up"));
104
109
  }
105
- }, Q = D("google"), $ = D("microsoft"), ve = [
110
+ }, Q = k("google"), $ = k("microsoft"), Oe = [
106
111
  {
107
112
  name: "Google",
108
- icon: d,
109
- onClick: ge,
113
+ icon: ie,
114
+ onClick: Ee,
110
115
  disabled: !Q,
111
- tooltip: Q ? void 0 : b("auth.register.googleNotConfigured", "Google sign up is not configured")
116
+ tooltip: Q ? void 0 : y("auth.register.googleNotConfigured", "Google sign up is not configured")
112
117
  },
113
118
  {
114
119
  name: "GitHub",
115
- icon: ne,
120
+ icon: re,
116
121
  onClick: () => {},
117
122
  disabled: !0,
118
- tooltip: b("auth.register.githubNotConfigured", "GitHub sign up is not configured")
123
+ tooltip: y("auth.register.githubNotConfigured", "GitHub sign up is not configured")
119
124
  },
120
125
  {
121
126
  name: "Microsoft",
122
- icon: f,
123
- onClick: _e,
127
+ icon: oe,
128
+ onClick: De,
124
129
  disabled: !$,
125
- tooltip: $ ? void 0 : b("auth.register.microsoftNotConfigured", "Microsoft sign up is not configured")
130
+ tooltip: $ ? void 0 : y("auth.register.microsoftNotConfigured", "Microsoft sign up is not configured")
126
131
  }
127
- ], [ye, be = ""] = b("auth.register.verificationEmailSentTo", "We've sent a verification email to {{email}}. Please check your inbox and click the verification link to activate your account.").split("{{email}}");
128
- return N ? /* @__PURE__ */ _(a, {
129
- title: b("auth.register.checkEmail", "Check your email"),
130
- subtitle: b("auth.register.verificationLinkSent", "We've sent you a verification link"),
131
- children: /* @__PURE__ */ v("div", {
132
+ ], [ke, Ae = ""] = y("auth.register.verificationEmailSentTo", "We've sent a verification email to {{email}}. Please check your inbox and click the verification link to activate your account.").split("{{email}}");
133
+ return be ? /* @__PURE__ */ g(s, {
134
+ title: y("auth.register.checkEmail", "Check your email"),
135
+ subtitle: y("auth.register.verificationLinkSent", "We've sent you a verification link"),
136
+ children: /* @__PURE__ */ _("div", {
132
137
  className: "flex flex-col items-center justify-center py-6",
133
138
  children: [
134
- /* @__PURE__ */ _("div", {
139
+ /* @__PURE__ */ g("div", {
135
140
  className: "size-20 rounded-full bg-status-success-bg-subtle flex items-center justify-center mb-6",
136
- children: /* @__PURE__ */ _("svg", {
141
+ children: /* @__PURE__ */ g("svg", {
137
142
  className: "size-10 text-status-success-text",
138
143
  fill: "none",
139
144
  viewBox: "0 0 24 24",
140
145
  stroke: "currentColor",
141
- children: /* @__PURE__ */ _("path", {
146
+ children: /* @__PURE__ */ g("path", {
142
147
  strokeLinecap: "round",
143
148
  strokeLinejoin: "round",
144
149
  strokeWidth: 2,
@@ -146,56 +151,56 @@ function b() {
146
151
  })
147
152
  })
148
153
  }),
149
- /* @__PURE__ */ _("h3", {
154
+ /* @__PURE__ */ g("h3", {
150
155
  className: "text-lg font-semibold text-[var(--color-text-primary)] mb-2",
151
- children: b("auth.register.accountCreated", "Account created successfully!")
156
+ children: y("auth.register.accountCreated", "Account created successfully!")
152
157
  }),
153
- /* @__PURE__ */ v("p", {
158
+ /* @__PURE__ */ _("p", {
154
159
  className: "text-center text-[var(--color-text-secondary)] mb-8 max-w-sm",
155
160
  children: [
156
- ye,
157
- /* @__PURE__ */ _("span", {
161
+ ke,
162
+ /* @__PURE__ */ g("span", {
158
163
  className: "font-medium text-[var(--color-text-primary)]",
159
- children: k.email
164
+ children: M.email
160
165
  }),
161
- be
166
+ Ae
162
167
  ]
163
168
  }),
164
- /* @__PURE__ */ v("div", {
169
+ /* @__PURE__ */ _("div", {
165
170
  className: "space-y-3 w-full",
166
171
  children: [
167
- /* @__PURE__ */ _(y, {
172
+ /* @__PURE__ */ g(v, {
168
173
  type: "button",
169
- onClick: () => S("/auth/login"),
174
+ onClick: () => x(C),
170
175
  variant: "default",
171
176
  size: "lg",
172
177
  className: "w-full font-semibold",
173
- children: b("auth.register.continueToSignIn", "Continue to sign in")
178
+ children: y("auth.register.continueToSignIn", "Continue to sign in")
174
179
  }),
175
- G && /* @__PURE__ */ _("p", {
180
+ G && /* @__PURE__ */ g("p", {
176
181
  className: "text-center text-sm text-status-error-text",
177
182
  children: G
178
183
  }),
179
- /* @__PURE__ */ v("p", {
184
+ /* @__PURE__ */ _("p", {
180
185
  className: "text-center text-sm text-[var(--color-text-tertiary)]",
181
186
  children: [
182
- b("auth.register.didntReceiveEmail", "Didn't receive the email? Check your spam folder or"),
187
+ y("auth.register.didntReceiveEmail", "Didn't receive the email? Check your spam folder or"),
183
188
  " ",
184
- /* @__PURE__ */ _("button", {
189
+ /* @__PURE__ */ g("button", {
185
190
  type: "button",
186
191
  disabled: U,
187
192
  onClick: async () => {
188
193
  K(null), W(!0);
189
194
  try {
190
- await w(k.email);
195
+ await w(M.email);
191
196
  } catch (e) {
192
- K(e instanceof Error ? e.message : b("auth.register.resendFailed", "Failed to resend verification email"));
197
+ K(e instanceof Error ? e.message : y("auth.register.resendFailed", "Failed to resend verification email"));
193
198
  } finally {
194
199
  W(!1);
195
200
  }
196
201
  },
197
202
  className: "text-text-link hover:text-text-linkHover font-medium disabled:opacity-50 disabled:cursor-not-allowed",
198
- children: U ? b("auth.register.resending", "resending...") : b("auth.register.tryAgain", "try again")
203
+ children: U ? y("auth.register.resending", "resending...") : y("auth.register.tryAgain", "try again")
199
204
  })
200
205
  ]
201
206
  })
@@ -203,223 +208,223 @@ function b() {
203
208
  })
204
209
  ]
205
210
  })
206
- }) : /* @__PURE__ */ v(a, {
207
- title: b("auth.register.createAccount", "Create your account"),
208
- subtitle: b("auth.register.startJourney", "Start your journey with {{productName}}").replace("{{productName}}", x || "Burdenoff Workspaces"),
209
- productName: x,
211
+ }) : /* @__PURE__ */ _(s, {
212
+ title: y("auth.register.createAccount", "Create your account"),
213
+ subtitle: y("auth.register.startJourney", "Start your journey with {{productName}}").replace("{{productName}}", b || "Burdenoff Workspaces"),
214
+ productName: b,
210
215
  children: [
211
- /* @__PURE__ */ _(le, {
216
+ /* @__PURE__ */ g(ge, {
212
217
  className: "mb-5",
213
- children: b("auth.register.purpose", "Create your account to get a personal workspace and start collaborating. You'll verify your email, then you can sign in and invite your team.")
218
+ children: y("auth.register.purpose", "Create your account to get a personal workspace and start collaborating. You'll verify your email, then you can sign in and invite your team.")
214
219
  }),
215
- /* @__PURE__ */ v("form", {
216
- onSubmit: he,
220
+ /* @__PURE__ */ _("form", {
221
+ onSubmit: Te,
217
222
  className: "space-y-5",
218
223
  children: [
219
- q && /* @__PURE__ */ v("div", {
224
+ q && /* @__PURE__ */ _("div", {
220
225
  className: "flex items-start gap-3 p-4 rounded-xl bg-status-warning-bg-subtle border border-status-warning-border",
221
- children: [/* @__PURE__ */ _(o, { className: "size-5 text-status-warning-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ v("div", {
226
+ children: [/* @__PURE__ */ g(c, { className: "size-5 text-status-warning-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ _("div", {
222
227
  className: "space-y-2",
223
228
  children: [
224
- /* @__PURE__ */ _("p", {
229
+ /* @__PURE__ */ g("p", {
225
230
  className: "text-sm font-medium text-status-warning-text",
226
- children: b("auth.register.accountDeactivated", "This email belongs to a deactivated account.")
231
+ children: y("auth.register.accountDeactivated", "This email belongs to a deactivated account.")
227
232
  }),
228
- /* @__PURE__ */ _("p", {
233
+ /* @__PURE__ */ g("p", {
229
234
  className: "text-xs text-status-warning-text/80",
230
- children: b("auth.register.accountDeactivatedHelp", "If this is your account, you can reactivate it instead of creating a new one.")
235
+ children: y("auth.register.accountDeactivatedHelp", "If this is your account, you can reactivate it instead of creating a new one.")
231
236
  }),
232
- /* @__PURE__ */ _("button", {
237
+ /* @__PURE__ */ g("button", {
233
238
  type: "button",
234
- onClick: () => S("/auth/reactivate", { state: { email: k.email } }),
239
+ onClick: () => x("/auth/reactivate", { state: { email: M.email } }),
235
240
  className: "text-sm font-semibold text-status-warning-text underline underline-offset-2",
236
- children: b("auth.register.reactivateCta", "Reactivate my account")
241
+ children: y("auth.register.reactivateCta", "Reactivate my account")
237
242
  })
238
243
  ]
239
244
  })]
240
245
  }),
241
- (J || Y) && /* @__PURE__ */ v("div", {
246
+ (J || Y) && /* @__PURE__ */ _("div", {
242
247
  className: "flex items-start gap-3 p-4 rounded-xl bg-status-warning-bg-subtle border border-status-warning-border",
243
- children: [/* @__PURE__ */ _(o, { className: "size-5 text-status-warning-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ _("p", {
248
+ children: [/* @__PURE__ */ g(c, { className: "size-5 text-status-warning-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ g("p", {
244
249
  className: "text-sm text-status-warning-text",
245
- children: F
250
+ children: I
246
251
  })]
247
252
  }),
248
- (F && !q && !J && !Y || j.length > 0) && /* @__PURE__ */ v("div", {
253
+ (I && !q && !J && !Y || P.length > 0) && /* @__PURE__ */ _("div", {
249
254
  className: "flex items-start gap-3 p-4 rounded-xl bg-status-error-bg-subtle border border-status-error-border",
250
- children: [/* @__PURE__ */ _(o, { className: "size-5 text-status-error-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ v("div", {
255
+ children: [/* @__PURE__ */ g(c, { className: "size-5 text-status-error-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ _("div", {
251
256
  className: "space-y-1",
252
- children: [F && !q && !J && !Y && /* @__PURE__ */ _("p", {
257
+ children: [I && !q && !J && !Y && /* @__PURE__ */ g("p", {
253
258
  className: "text-sm text-status-error-text",
254
- children: F
255
- }), j.map((e) => /* @__PURE__ */ _("p", {
259
+ children: I
260
+ }), P.map((e) => /* @__PURE__ */ g("p", {
256
261
  className: "text-sm text-status-error-text",
257
262
  children: e
258
263
  }, e))]
259
264
  })]
260
265
  }),
261
- /* @__PURE__ */ v("div", {
266
+ /* @__PURE__ */ _("div", {
262
267
  className: "grid grid-cols-2 gap-4",
263
- children: [/* @__PURE__ */ v("div", {
268
+ children: [/* @__PURE__ */ _("div", {
264
269
  className: "space-y-2",
265
- children: [/* @__PURE__ */ _("label", {
270
+ children: [/* @__PURE__ */ g("label", {
266
271
  htmlFor: "firstName",
267
272
  className: "block text-sm font-medium text-[var(--color-text-primary)]",
268
- children: b("auth.register.firstName", "First Name")
269
- }), /* @__PURE__ */ _("input", {
273
+ children: y("auth.register.firstName", "First Name")
274
+ }), /* @__PURE__ */ g("input", {
270
275
  id: "firstName",
271
276
  type: "text",
272
277
  required: !0,
273
278
  "aria-required": "true",
274
- "aria-label": b("auth.register.firstName", "First Name"),
275
- value: k.firstName,
276
- onChange: (e) => A({
277
- ...k,
279
+ "aria-label": y("auth.register.firstName", "First Name"),
280
+ value: M.firstName,
281
+ onChange: (e) => N({
282
+ ...M,
278
283
  firstName: e.target.value
279
284
  }),
280
285
  className: "block w-full px-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
281
- placeholder: b("auth.register.firstNamePlaceholder", "Enter first name")
286
+ placeholder: y("auth.register.firstNamePlaceholder", "Enter first name")
282
287
  })]
283
- }), /* @__PURE__ */ v("div", {
288
+ }), /* @__PURE__ */ _("div", {
284
289
  className: "space-y-2",
285
- children: [/* @__PURE__ */ _("label", {
290
+ children: [/* @__PURE__ */ g("label", {
286
291
  htmlFor: "lastName",
287
292
  className: "block text-sm font-medium text-[var(--color-text-primary)]",
288
- children: b("auth.register.lastName", "Last Name")
289
- }), /* @__PURE__ */ _("input", {
293
+ children: y("auth.register.lastName", "Last Name")
294
+ }), /* @__PURE__ */ g("input", {
290
295
  id: "lastName",
291
296
  type: "text",
292
297
  required: !0,
293
298
  "aria-required": "true",
294
- "aria-label": b("auth.register.lastName", "Last Name"),
295
- value: k.lastName,
296
- onChange: (e) => A({
297
- ...k,
299
+ "aria-label": y("auth.register.lastName", "Last Name"),
300
+ value: M.lastName,
301
+ onChange: (e) => N({
302
+ ...M,
298
303
  lastName: e.target.value
299
304
  }),
300
305
  className: "block w-full px-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
301
- placeholder: b("auth.register.lastNamePlaceholder", "Enter last name")
306
+ placeholder: y("auth.register.lastNamePlaceholder", "Enter last name")
302
307
  })]
303
308
  })]
304
309
  }),
305
- /* @__PURE__ */ v("div", {
310
+ /* @__PURE__ */ _("div", {
306
311
  className: "space-y-2",
307
- children: [/* @__PURE__ */ _("label", {
312
+ children: [/* @__PURE__ */ g("label", {
308
313
  htmlFor: "username",
309
314
  className: "block text-sm font-medium text-[var(--color-text-primary)]",
310
- children: b("auth.register.username", "Username")
311
- }), /* @__PURE__ */ v("div", {
315
+ children: y("auth.register.username", "Username")
316
+ }), /* @__PURE__ */ _("div", {
312
317
  className: "relative",
313
- children: [/* @__PURE__ */ _("div", {
318
+ children: [/* @__PURE__ */ g("div", {
314
319
  className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
315
- children: /* @__PURE__ */ _(m, { className: "size-5 text-[var(--color-text-tertiary)]" })
316
- }), /* @__PURE__ */ _("input", {
320
+ children: /* @__PURE__ */ g(ce, { className: "size-5 text-[var(--color-text-tertiary)]" })
321
+ }), /* @__PURE__ */ g("input", {
317
322
  id: "username",
318
323
  type: "text",
319
324
  required: !0,
320
325
  "aria-required": "true",
321
- "aria-label": b("auth.register.username", "Username"),
326
+ "aria-label": y("auth.register.username", "Username"),
322
327
  autoComplete: "username",
323
- value: k.username,
324
- onChange: (e) => A({
325
- ...k,
328
+ value: M.username,
329
+ onChange: (e) => N({
330
+ ...M,
326
331
  username: e.target.value
327
332
  }),
328
333
  className: "block w-full pl-[3.5rem] pr-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
329
- placeholder: b("auth.register.usernamePlaceholder", "Choose a username")
334
+ placeholder: y("auth.register.usernamePlaceholder", "Choose a username")
330
335
  })]
331
336
  })]
332
337
  }),
333
- /* @__PURE__ */ v("div", {
338
+ /* @__PURE__ */ _("div", {
334
339
  className: "space-y-2",
335
- children: [/* @__PURE__ */ _("label", {
340
+ children: [/* @__PURE__ */ g("label", {
336
341
  htmlFor: "email",
337
342
  className: "block text-sm font-medium text-[var(--color-text-primary)]",
338
- children: b("auth.register.email", "Email")
339
- }), /* @__PURE__ */ v("div", {
343
+ children: y("auth.register.email", "Email")
344
+ }), /* @__PURE__ */ _("div", {
340
345
  className: "relative",
341
- children: [/* @__PURE__ */ _("div", {
346
+ children: [/* @__PURE__ */ g("div", {
342
347
  className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
343
- children: /* @__PURE__ */ _(c, { className: "size-5 text-[var(--color-text-tertiary)]" })
344
- }), /* @__PURE__ */ _("input", {
348
+ children: /* @__PURE__ */ g(u, { className: "size-5 text-[var(--color-text-tertiary)]" })
349
+ }), /* @__PURE__ */ g("input", {
345
350
  id: "email",
346
351
  type: "email",
347
352
  required: !0,
348
353
  "aria-required": "true",
349
- "aria-label": b("auth.register.email", "Email"),
354
+ "aria-label": y("auth.register.email", "Email"),
350
355
  autoComplete: "email",
351
- value: k.email,
352
- onChange: (e) => A({
353
- ...k,
356
+ value: M.email,
357
+ onChange: (e) => N({
358
+ ...M,
354
359
  email: e.target.value
355
360
  }),
356
361
  className: "block w-full pl-[3.5rem] pr-4 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
357
- placeholder: b("auth.register.emailPlaceholder", "you@example.com")
362
+ placeholder: y("auth.register.emailPlaceholder", "you@example.com")
358
363
  })]
359
364
  })]
360
365
  }),
361
- /* @__PURE__ */ v("div", {
366
+ /* @__PURE__ */ _("div", {
362
367
  className: "space-y-2",
363
368
  children: [
364
- /* @__PURE__ */ _("label", {
369
+ /* @__PURE__ */ g("label", {
365
370
  htmlFor: "password",
366
371
  className: "block text-sm font-medium text-[var(--color-text-primary)]",
367
- children: b("auth.register.password", "Password")
372
+ children: y("auth.register.password", "Password")
368
373
  }),
369
- /* @__PURE__ */ v("div", {
374
+ /* @__PURE__ */ _("div", {
370
375
  className: "relative",
371
376
  children: [
372
- /* @__PURE__ */ _("div", {
377
+ /* @__PURE__ */ g("div", {
373
378
  className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
374
- children: /* @__PURE__ */ _(re, { className: "size-5 text-[var(--color-text-tertiary)]" })
379
+ children: /* @__PURE__ */ g(ae, { className: "size-5 text-[var(--color-text-tertiary)]" })
375
380
  }),
376
- /* @__PURE__ */ _("input", {
381
+ /* @__PURE__ */ g("input", {
377
382
  id: "password",
378
- type: O ? "text" : "password",
383
+ type: A ? "text" : "password",
379
384
  required: !0,
380
385
  "aria-required": "true",
381
- "aria-label": b("auth.register.password", "Password"),
386
+ "aria-label": y("auth.register.password", "Password"),
382
387
  autoComplete: "new-password",
383
- value: k.password,
384
- onChange: (e) => A({
385
- ...k,
388
+ value: M.password,
389
+ onChange: (e) => N({
390
+ ...M,
386
391
  password: e.target.value
387
392
  }),
388
393
  className: "block w-full pl-[3.5rem] pr-12 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
389
- placeholder: b("auth.register.passwordPlaceholder", "Create a strong password")
394
+ placeholder: y("auth.register.passwordPlaceholder", "Create a strong password")
390
395
  }),
391
- /* @__PURE__ */ _("button", {
396
+ /* @__PURE__ */ g("button", {
392
397
  type: "button",
393
- onClick: () => fe(!O),
394
- "aria-label": O ? b("auth.register.hidePassword", "Hide password") : b("auth.register.showPassword", "Show password"),
398
+ onClick: () => j(!A),
399
+ "aria-label": A ? y("auth.register.hidePassword", "Hide password") : y("auth.register.showPassword", "Show password"),
395
400
  className: "absolute inset-y-0 right-0 pr-3.5 flex items-center text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] transition-colors",
396
- children: _(O ? u : l, { className: "size-5" })
401
+ children: g(A ? f : d, { className: "size-5" })
397
402
  })
398
403
  ]
399
404
  }),
400
- k.password && /* @__PURE__ */ v("div", {
405
+ M.password && /* @__PURE__ */ _("div", {
401
406
  className: "space-y-3 pt-2",
402
- children: [/* @__PURE__ */ v("div", {
407
+ children: [/* @__PURE__ */ _("div", {
403
408
  className: "space-y-1",
404
- children: [/* @__PURE__ */ _("div", {
409
+ children: [/* @__PURE__ */ g("div", {
405
410
  className: "h-1.5 bg-[var(--color-bg-sunken)] rounded-full overflow-hidden",
406
- children: /* @__PURE__ */ _("div", { className: `h-full ${Z.color} ${Z.width} transition-all duration-300` })
407
- }), /* @__PURE__ */ v("p", {
411
+ children: /* @__PURE__ */ g("div", { className: `h-full ${Z.color} ${Z.width} transition-all duration-300` })
412
+ }), /* @__PURE__ */ _("p", {
408
413
  className: "text-xs text-[var(--color-text-tertiary)] capitalize",
409
414
  children: [
410
- b("auth.register.passwordStrength", "Password strength:"),
415
+ y("auth.register.passwordStrength", "Password strength:"),
411
416
  " ",
412
- /* @__PURE__ */ _("span", {
417
+ /* @__PURE__ */ g("span", {
413
418
  className: "font-medium",
414
419
  children: Z.level
415
420
  })
416
421
  ]
417
422
  })]
418
- }), /* @__PURE__ */ _("div", {
423
+ }), /* @__PURE__ */ g("div", {
419
424
  className: "grid grid-cols-2 gap-2",
420
- children: X.map((e) => /* @__PURE__ */ v("div", {
425
+ children: X.map((e) => /* @__PURE__ */ _("div", {
421
426
  className: "flex items-center gap-2",
422
- children: [e.met ? /* @__PURE__ */ _(s, { className: "size-4 text-status-success-text" }) : /* @__PURE__ */ _(h, { className: "size-4 text-[var(--color-text-tertiary)]" }), /* @__PURE__ */ _("span", {
427
+ children: [e.met ? /* @__PURE__ */ g(l, { className: "size-4 text-status-success-text" }) : /* @__PURE__ */ g(le, { className: "size-4 text-[var(--color-text-tertiary)]" }), /* @__PURE__ */ g("span", {
423
428
  className: `text-xs ${e.met ? "text-status-success-text" : "text-[var(--color-text-tertiary)]"}`,
424
429
  children: e.label
425
430
  })]
@@ -428,97 +433,97 @@ function b() {
428
433
  })
429
434
  ]
430
435
  }),
431
- /* @__PURE__ */ v("p", {
436
+ /* @__PURE__ */ _("p", {
432
437
  className: "text-xs text-[var(--color-text-tertiary)] leading-relaxed",
433
438
  children: [
434
- b("auth.register.agreeToTerms", "By creating an account, you agree to our"),
439
+ y("auth.register.agreeToTerms", "By creating an account, you agree to our"),
435
440
  " ",
436
- /* @__PURE__ */ _("a", {
441
+ /* @__PURE__ */ g("a", {
437
442
  href: n("/terms"),
438
443
  target: "_blank",
439
444
  rel: "noopener noreferrer",
440
445
  className: "text-text-link underline underline-offset-2",
441
- children: b("auth.register.termsOfService", "Terms of Service")
446
+ children: y("auth.register.termsOfService", "Terms of Service")
442
447
  }),
443
448
  " ",
444
- b("auth.register.and", "and"),
449
+ y("auth.register.and", "and"),
445
450
  " ",
446
- /* @__PURE__ */ _("a", {
451
+ /* @__PURE__ */ g("a", {
447
452
  href: n("/privacy"),
448
453
  target: "_blank",
449
454
  rel: "noopener noreferrer",
450
455
  className: "text-text-link underline underline-offset-2",
451
- children: b("auth.register.privacyPolicy", "Privacy Policy")
456
+ children: y("auth.register.privacyPolicy", "Privacy Policy")
452
457
  }),
453
458
  "."
454
459
  ]
455
460
  }),
456
- /* @__PURE__ */ _(ae, {
461
+ /* @__PURE__ */ g(p, {
457
462
  enabled: H,
458
- siteKey: me,
459
- onVerify: B,
460
- onExpired: () => B(null)
461
- }, V),
462
- /* @__PURE__ */ _(y, {
463
+ siteKey: we,
464
+ onVerify: V,
465
+ onExpired: () => V(null)
466
+ }, Se),
467
+ /* @__PURE__ */ g(v, {
463
468
  type: "submit",
464
469
  disabled: T,
465
470
  variant: "default",
466
471
  size: "lg",
467
472
  className: "w-full font-semibold",
468
- children: T ? /* @__PURE__ */ v(ce, { children: [/* @__PURE__ */ _(p, { className: "size-5 animate-spin" }), /* @__PURE__ */ _("span", { children: b("auth.register.creatingAccount", "Creating account...") })] }) : b("auth.register.createAccountBtn", "Create account")
473
+ children: T ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(se, { className: "size-5 animate-spin" }), /* @__PURE__ */ g("span", { children: y("auth.register.creatingAccount", "Creating account...") })] }) : y("auth.register.createAccountBtn", "Create account")
469
474
  })
470
475
  ]
471
476
  }),
472
- /* @__PURE__ */ v("div", {
477
+ /* @__PURE__ */ _("div", {
473
478
  className: "relative my-8",
474
- children: [/* @__PURE__ */ _("div", {
479
+ children: [/* @__PURE__ */ g("div", {
475
480
  className: "absolute inset-0 flex items-center",
476
- children: /* @__PURE__ */ _("div", { className: "w-full border-t border-[var(--color-border-default)]" })
477
- }), /* @__PURE__ */ _("div", {
481
+ children: /* @__PURE__ */ g("div", { className: "w-full border-t border-[var(--color-border-default)]" })
482
+ }), /* @__PURE__ */ g("div", {
478
483
  className: "relative flex justify-center",
479
- children: /* @__PURE__ */ _("span", {
484
+ children: /* @__PURE__ */ g("span", {
480
485
  className: "px-4 bg-[var(--color-bg-canvas)] text-sm text-[var(--color-text-tertiary)]",
481
- children: b("auth.register.orSignUpWith", "or sign up with")
486
+ children: y("auth.register.orSignUpWith", "or sign up with")
482
487
  })
483
488
  })]
484
489
  }),
485
- L && /* @__PURE__ */ v("div", {
490
+ R && /* @__PURE__ */ _("div", {
486
491
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-error-bg-subtle border-status-error-border",
487
- children: [/* @__PURE__ */ _(o, { className: "size-5 flex-shrink-0 mt-0.5 text-status-error-text" }), /* @__PURE__ */ _("p", {
492
+ children: [/* @__PURE__ */ g(c, { className: "size-5 flex-shrink-0 mt-0.5 text-status-error-text" }), /* @__PURE__ */ g("p", {
488
493
  className: "text-sm text-status-error-text",
489
- children: L
494
+ children: R
490
495
  })]
491
496
  }),
492
- /* @__PURE__ */ _("div", {
497
+ /* @__PURE__ */ g("div", {
493
498
  className: "grid grid-cols-3 gap-3",
494
- children: ve.map((e) => /* @__PURE__ */ v("button", {
499
+ children: Oe.map((e) => /* @__PURE__ */ _("button", {
495
500
  type: "button",
496
501
  onClick: e.onClick,
497
502
  disabled: e.disabled,
498
503
  title: e.tooltip,
499
504
  className: `flex items-center justify-center gap-2 px-4 py-3 rounded-xl border transition-all duration-200 group ${e.disabled ? "border-[var(--color-border-subtle)] bg-[var(--color-bg-disabled)] cursor-not-allowed opacity-50" : "border-[var(--color-border-default)] bg-[var(--color-bg-surface)] hover:bg-[var(--color-bg-sunken)] hover:border-[var(--color-border-strong)]"}`,
500
- children: [/* @__PURE__ */ _(e.icon, { className: `size-5 ${e.disabled ? "opacity-50" : ""}` }), /* @__PURE__ */ _("span", {
505
+ children: [/* @__PURE__ */ g(e.icon, { className: `size-5 ${e.disabled ? "opacity-50" : ""}` }), /* @__PURE__ */ g("span", {
501
506
  className: `sr-only sm:not-sr-only text-sm font-medium transition-colors ${e.disabled ? "text-[var(--color-text-disabled)]" : "text-[var(--color-text-secondary)] group-hover:text-[var(--color-text-primary)]"}`,
502
507
  children: e.name
503
508
  })]
504
509
  }, e.name))
505
510
  }),
506
- /* @__PURE__ */ v("p", {
511
+ /* @__PURE__ */ _("p", {
507
512
  className: "mt-8 text-center text-sm text-[var(--color-text-secondary)]",
508
513
  children: [
509
- b("auth.register.alreadyHaveAccount", "Already have an account?"),
514
+ y("auth.register.alreadyHaveAccount", "Already have an account?"),
510
515
  " ",
511
- /* @__PURE__ */ _("button", {
516
+ /* @__PURE__ */ g("button", {
512
517
  type: "button",
513
- onClick: () => S("/auth/login"),
518
+ onClick: () => x(C),
514
519
  className: "font-semibold text-text-link hover:text-text-linkHover transition-colors",
515
- children: b("auth.register.signIn", "Sign in")
520
+ children: y("auth.register.signIn", "Sign in")
516
521
  })
517
522
  ]
518
523
  })
519
524
  ]
520
525
  });
521
526
  }
522
- export { b as RegisterPage };
527
+ export { y as RegisterPage };
523
528
 
524
529
  //# sourceMappingURL=RegisterPage.js.map