@burdenoff/microfe-auth 2026.514.2 → 2026.514.4

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.
@@ -4,16 +4,16 @@ import { useMyWorkspaces as n } from "../hooks/useMyWorkspaces.js";
4
4
  import { useOAuthOperations as r } from "../hooks/useOAuthOperations.js";
5
5
  import "../hooks/index.js";
6
6
  import { AuthLayout as i } from "../components/AuthLayout.js";
7
- import { AlertIcon as a, EmailIcon as ee, EyeIcon as te, EyeOffIcon as ne, GitHubIcon as re, GoogleIcon as o, LockIcon as ie, MicrosoftIcon as s, SpinnerIcon as c } from "../components/AuthIcons.js";
8
- import { useCaptchaV3 as ae } from "../hooks/useCaptchaV3.js";
9
- import { useCallback as l, useEffect as u, useRef as oe, useState as d } from "react";
10
- import { SSORedirectSpinner as se, getSSORedirectUrl as ce } from "@burdenoff/fe-libs/shared/components";
11
- import { useLocation as le, useNavigate as ue, useSearchParams as de } from "react-router-dom";
12
- import { useActiveContext as fe, useI18n as pe } from "@burdenoff/fe-libs/shared/providers/shell";
13
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
14
- import { getProfileTokens as me, getProfileUser as he, getProfiles as ge, resolveActiveProfileId as _e } from "@burdenoff/fe-libs/shared/providers/shell/ProfileStorageManager";
7
+ import { AlertIcon as a, EmailIcon as ee, EyeIcon as te, EyeOffIcon as ne, GoogleIcon as re, LockIcon as ie, MicrosoftIcon as ae, SpinnerIcon as oe } from "../components/AuthIcons.js";
8
+ import { useCaptchaV3 as se } from "../hooks/useCaptchaV3.js";
9
+ import { useCallback as o, useEffect as s, useRef as ce, useState as c } from "react";
10
+ import { SSORedirectSpinner as le, getSSORedirectUrl as ue } from "@burdenoff/fe-libs/shared/components";
11
+ import { useLocation as de, useNavigate as fe, useSearchParams as pe } from "react-router-dom";
12
+ import { useActiveContext as me, useI18n as he } from "@burdenoff/fe-libs/shared/providers/shell";
13
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
14
+ import { getProfileTokens as ge, getProfileUser as _e, getProfiles as ve, resolveActiveProfileId as ye } from "@burdenoff/fe-libs/shared/providers/shell/ProfileStorageManager";
15
15
  //#region src/auth/pages/LoginPage.tsx
16
- function ve(e) {
16
+ function be(e) {
17
17
  try {
18
18
  let t = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "="), r = JSON.parse(atob(n));
19
19
  return typeof r.exp == "number" && r.exp > Date.now() / 1e3;
@@ -21,7 +21,7 @@ function ve(e) {
21
21
  return !1;
22
22
  }
23
23
  }
24
- function ye(e) {
24
+ function xe(e) {
25
25
  if (!e) return null;
26
26
  try {
27
27
  let t = new URL(decodeURIComponent(e), window.location.origin);
@@ -30,11 +30,11 @@ function ye(e) {
30
30
  return null;
31
31
  }
32
32
  }
33
- function h() {
34
- let h = ue(), g = le(), [_] = de(), { t: v } = pe(), y = l((e, t) => {
35
- let n = v(e);
33
+ function f() {
34
+ let f = fe(), p = de(), [m] = pe(), { t: h } = he(), g = o((e, t) => {
35
+ let n = h(e);
36
36
  return n === e ? t : n;
37
- }, [v]), { signIn: be, isLoading: b, error: x, errorCode: S, resendVerification: xe } = t(), { completeAuthFlow: Se } = n(), { setWorkspace: C, setOrganization: w } = fe(), { initiateGoogleOAuth: Ce, initiateMicrosoftOAuth: we, isProviderConfigured: T } = r(), E = e((e) => e.mfaRequired), { executeRecaptcha: Te } = ae(), [D, O] = d(!1), [Ee, De] = d(!1), k = l((e) => {
37
+ }, [h]), { signIn: Se, isLoading: _, error: v, errorCode: y, resendVerification: Ce } = t(), { completeAuthFlow: we } = n(), { setWorkspace: b, setOrganization: x } = me(), { initiateGoogleOAuth: Te, initiateMicrosoftOAuth: Ee, isProviderConfigured: S } = r(), C = e((e) => e.mfaRequired), { executeRecaptcha: De } = se(), [w, T] = c(!1), [Oe, ke] = c(!1), E = o((e) => {
38
38
  if (typeof window < "u") {
39
39
  try {
40
40
  sessionStorage.setItem("bf-post-login-return-to", e);
@@ -42,36 +42,36 @@ function h() {
42
42
  window.location.assign(e);
43
43
  return;
44
44
  }
45
- h(e);
46
- }, [h]), [A, Oe] = d(!1), [j, M] = d(!1), [ke, N] = d(!1), [Ae, P] = d(!1), [F, I] = d(!1), [L, R] = d(!1), [z, B] = d(!1), [je, V] = d(!1), [H, U] = d(null), [W, Me] = d(null), [G, K] = d({
45
+ f(e);
46
+ }, [f]), [D, Ae] = c(!1), [O, k] = c(!1), [je, A] = c(!1), [Me, j] = c(!1), [M, N] = c(!1), [P, F] = c(!1), [I, L] = c(!1), [Ne, R] = c(!1), [z, B] = c(null), [V, H] = c(null), [U, W] = c({
47
47
  email: "",
48
48
  password: "",
49
49
  rememberMe: !1
50
- }), [q, J] = d(null), [Ne, Y] = d(!1), X = _.get("mode") === "add-account", Z = _.get("returnTo"), Q = oe(Z);
51
- u(() => {
52
- !Q.current && Z && (Q.current = Z);
53
- }, [Z]), u(() => {
54
- if (X || D) return;
55
- let t = _e();
50
+ }), [G, K] = c(null), [q, J] = c(!1), Y = m.get("mode") === "add-account", X = m.get("returnTo"), Z = ce(X);
51
+ s(() => {
52
+ !Z.current && X && (Z.current = X);
53
+ }, [X]), s(() => {
54
+ if (Y || w) return;
55
+ let t = ye();
56
56
  if (t) {
57
- let n = me(t), r = he(t);
58
- if (n?.accessToken && r && ve(n.accessToken)) {
59
- e.getState().loadFromProfile(t), k(ye(Z) ?? "/");
57
+ let n = ge(t), r = _e(t);
58
+ if (n?.accessToken && r && be(n.accessToken)) {
59
+ e.getState().loadFromProfile(t), E(xe(X) ?? "/");
60
60
  return;
61
61
  }
62
62
  }
63
- let n = ce();
64
- n && (De(!0), window.location.replace(n));
63
+ let n = ue();
64
+ n && (ke(!0), window.location.replace(n));
65
65
  }, [
66
- X,
67
- D,
68
- k,
69
- Z
70
- ]), u(() => {
66
+ Y,
67
+ w,
68
+ E,
69
+ X
70
+ ]), s(() => {
71
71
  try {
72
72
  localStorage.removeItem("remembered_password");
73
73
  let e = localStorage.getItem("remembered_email");
74
- e && K((t) => ({
74
+ e && W((t) => ({
75
75
  ...t,
76
76
  email: e,
77
77
  rememberMe: !0
@@ -79,13 +79,13 @@ function h() {
79
79
  } catch (e) {
80
80
  console.warn("[LoginPage] Failed to load remembered email:", e);
81
81
  }
82
- }, []), u(() => {
83
- let e = g.state;
84
- e?.message && Me(e.message), e?.email && K((t) => ({
82
+ }, []), s(() => {
83
+ let e = p.state;
84
+ e?.message && H(e.message), e?.email && W((t) => ({
85
85
  ...t,
86
86
  email: e.email
87
87
  })), e && window.history.replaceState({}, document.title);
88
- }, [g.state]);
88
+ }, [p.state]);
89
89
  let Pe = (e, t) => {
90
90
  if (t) switch (t) {
91
91
  case "ACCOUNT_DELETED": return "DELETED";
@@ -99,44 +99,44 @@ function h() {
99
99
  let n = e.toLowerCase();
100
100
  return n.includes("deleted") || n.includes("permanently deleted") ? "DELETED" : n.includes("suspended") ? "SUSPENDED" : n.includes("oauth provider") || n.includes("oauth-only") || n.includes("oauth only") ? "OAUTH_ONLY" : n.includes("inactive") || n.includes("deactivated") || n.includes("not active") ? "INACTIVE" : n.includes("verify your email") || n.includes("email not verified") || n.includes("email_not_verified") ? "EMAIL_NOT_VERIFIED" : null;
101
101
  };
102
- u(() => {
103
- let e = _.get("email");
104
- if (e && K((t) => ({
102
+ s(() => {
103
+ let e = m.get("email");
104
+ if (e && W((t) => ({
105
105
  ...t,
106
106
  email: e
107
- })), _.get("expired") === "true") {
108
- Me(y("auth.login.sessionExpired", "Your session has expired. Please sign in again."));
107
+ })), m.get("expired") === "true") {
108
+ H(g("auth.login.sessionExpired", "Your session has expired. Please sign in again."));
109
109
  let e = window.location.pathname;
110
110
  window.history.replaceState({}, document.title, e);
111
111
  }
112
- }, [_, y]), u(() => {
113
- E && h("/auth/mfa-verify");
114
- }, [E, h]);
112
+ }, [m, g]), s(() => {
113
+ C && f("/auth/mfa-verify");
114
+ }, [C, f]);
115
115
  let Fe = async (t) => {
116
- t.preventDefault(), M(!1), N(!1), P(!1), I(!1), R(!1), Y(!1), V(!1), J(null);
117
- let n = (G.email ?? "").trim();
116
+ t.preventDefault(), k(!1), A(!1), j(!1), N(!1), F(!1), J(!1), R(!1), K(null);
117
+ let n = (U.email ?? "").trim();
118
118
  if (!n) {
119
- J(y("auth.login.enterEmailOrUsername", "Please enter your email or username"));
119
+ K(g("auth.login.enterEmailOrUsername", "Please enter your email or username"));
120
120
  return;
121
121
  }
122
122
  if (n.includes("@") && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)) {
123
- J(y("auth.login.invalidEmail", "Please enter a valid email address"));
123
+ K(g("auth.login.invalidEmail", "Please enter a valid email address"));
124
124
  return;
125
125
  }
126
- if (!G.password || G.password.length < 1) {
127
- J(y("auth.login.enterPassword", "Please enter your password"));
126
+ if (!U.password || U.password.length < 1) {
127
+ K(g("auth.login.enterPassword", "Please enter your password"));
128
128
  return;
129
129
  }
130
- if (X && ge().some((e) => e.email.toLowerCase() === n.toLowerCase())) {
131
- Y(!0), J(null);
130
+ if (Y && ve().some((e) => e.email.toLowerCase() === n.toLowerCase())) {
131
+ J(!0), K(null);
132
132
  return;
133
133
  }
134
- Y(!1);
134
+ J(!1);
135
135
  try {
136
- let e = await Te("login"), t = await be({
136
+ let e = await De("login"), t = await Se({
137
137
  email: n,
138
- password: G.password,
139
- rememberMe: G.rememberMe,
138
+ password: U.password,
139
+ rememberMe: U.rememberMe,
140
140
  ...e ? { recaptchaToken: e } : {}
141
141
  });
142
142
  if (t.requiresMFA) return;
@@ -152,14 +152,14 @@ function h() {
152
152
  }
153
153
  } catch {}
154
154
  try {
155
- G.rememberMe ? localStorage.setItem("remembered_email", n) : localStorage.removeItem("remembered_email");
155
+ U.rememberMe ? localStorage.setItem("remembered_email", n) : localStorage.removeItem("remembered_email");
156
156
  } catch (e) {
157
157
  console.warn("[LoginPage] Failed to save/clear remembered email:", e);
158
158
  }
159
- O(!0);
160
- let e = Q.current || Z, r = e ? decodeURIComponent(e) : "/dashboard";
159
+ T(!0);
160
+ let e = Z.current || X, r = e ? decodeURIComponent(e) : "/dashboard";
161
161
  try {
162
- let e = await Promise.race([Se(t.token), new Promise((e) => {
162
+ let e = await Promise.race([we(t.token), new Promise((e) => {
163
163
  window.setTimeout(() => {
164
164
  e({
165
165
  success: !1,
@@ -167,280 +167,270 @@ function h() {
167
167
  });
168
168
  }, 5e3);
169
169
  })]);
170
- e.success ? (e.workspace && (C(e.workspace.id), e.workspace.organizationId && w(e.workspace.organizationId)), k(r)) : e.error?.includes("No workspaces found") ? h("/onboarding/create-workspace") : (e.workspace && (C(e.workspace.id), e.workspace.organizationId && w(e.workspace.organizationId)), console.warn("Auth flow warning:", e.error), k(r));
170
+ e.success ? (e.workspace && (b(e.workspace.id), e.workspace.organizationId && x(e.workspace.organizationId)), E(r)) : e.error?.includes("No workspaces found") ? f("/onboarding/create-workspace") : (e.workspace && (b(e.workspace.id), e.workspace.organizationId && x(e.workspace.organizationId)), console.warn("Auth flow warning:", e.error), E(r));
171
171
  } catch (e) {
172
- console.error("Auth flow error (login succeeded):", e), k(r);
172
+ console.error("Auth flow error (login succeeded):", e), E(r);
173
173
  } finally {
174
- O(!1);
174
+ T(!1);
175
175
  }
176
176
  }
177
177
  } catch (t) {
178
178
  let n = t instanceof Error ? t.message : String(t);
179
- n.includes("reCAPTCHA") && J(n);
179
+ n.includes("reCAPTCHA") && K(n);
180
180
  let r = e.getState().errorCode, i = Pe(n, r);
181
- i === "DELETED" ? N(!0) : i === "SUSPENDED" ? P(!0) : i === "OAUTH_ONLY" ? I(!0) : i === "INACTIVE" ? M(!0) : i === "EMAIL_NOT_VERIFIED" && R(!0);
181
+ i === "DELETED" ? A(!0) : i === "SUSPENDED" ? j(!0) : i === "OAUTH_ONLY" ? N(!0) : i === "INACTIVE" ? k(!0) : i === "EMAIL_NOT_VERIFIED" && F(!0);
182
182
  }
183
183
  };
184
- u(() => {
185
- if (x) {
186
- let e = Pe(x, S);
187
- e === "DELETED" ? N(!0) : e === "SUSPENDED" ? P(!0) : e === "OAUTH_ONLY" ? I(!0) : e === "INACTIVE" ? M(!0) : e === "EMAIL_NOT_VERIFIED" && R(!0);
184
+ s(() => {
185
+ if (v) {
186
+ let e = Pe(v, y);
187
+ e === "DELETED" ? A(!0) : e === "SUSPENDED" ? j(!0) : e === "OAUTH_ONLY" ? N(!0) : e === "INACTIVE" ? k(!0) : e === "EMAIL_NOT_VERIFIED" && F(!0);
188
188
  }
189
- }, [x, S]);
189
+ }, [v, y]);
190
190
  let Ie = () => {
191
- U(null);
191
+ B(null);
192
192
  try {
193
- Ce();
193
+ Te();
194
194
  } catch (e) {
195
- U(e instanceof Error ? e.message : y("auth.login.googleSignInFailed", "Failed to initiate Google sign in"));
195
+ B(e instanceof Error ? e.message : g("auth.login.googleSignInFailed", "Failed to initiate Google sign in"));
196
196
  }
197
- }, Le = () => {
198
- U(null);
197
+ }, Q = () => {
198
+ B(null);
199
199
  try {
200
- we();
200
+ Ee();
201
201
  } catch (e) {
202
- U(e instanceof Error ? e.message : y("auth.login.microsoftSignInFailed", "Failed to initiate Microsoft sign in"));
202
+ B(e instanceof Error ? e.message : g("auth.login.microsoftSignInFailed", "Failed to initiate Microsoft sign in"));
203
203
  }
204
- }, Re = async () => {
205
- B(!0), V(!1);
204
+ }, Le = async () => {
205
+ L(!0), R(!1);
206
206
  try {
207
- (await xe((G.email ?? "").trim())).success ? V(!0) : J(y("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
207
+ (await Ce((U.email ?? "").trim())).success ? R(!0) : K(g("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
208
208
  } catch (e) {
209
- console.error("Failed to resend verification email:", e), J(e instanceof Error ? e.message : y("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
209
+ console.error("Failed to resend verification email:", e), K(e instanceof Error ? e.message : g("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
210
210
  } finally {
211
- B(!1);
211
+ L(!1);
212
212
  }
213
- }, ze = T("google"), $ = T("microsoft"), Be = [
214
- {
215
- name: "Google",
216
- icon: o,
217
- onClick: Ie,
218
- disabled: !ze,
219
- tooltip: ze ? void 0 : y("auth.login.googleNotConfigured", "Google sign in is not configured")
220
- },
221
- {
222
- name: "GitHub",
223
- icon: re,
224
- onClick: () => {},
225
- disabled: !0,
226
- tooltip: y("auth.login.githubNotConfigured", "GitHub sign in is not configured")
227
- },
228
- {
229
- name: "Microsoft",
230
- icon: s,
231
- onClick: Le,
232
- disabled: !$,
233
- tooltip: $ ? void 0 : y("auth.login.microsoftNotConfigured", "Microsoft sign in is not configured")
234
- }
235
- ];
236
- return Ee ? /* @__PURE__ */ p(se, {}) : /* @__PURE__ */ m(i, {
237
- title: y("auth.login.welcomeBack", "Welcome back"),
238
- subtitle: y("auth.login.enterCredentials", "Enter your credentials to continue"),
213
+ }, Re = S("google"), $ = S("microsoft"), ze = [{
214
+ name: "Google",
215
+ icon: re,
216
+ onClick: Ie,
217
+ disabled: !Re,
218
+ tooltip: Re ? void 0 : g("auth.login.googleNotConfigured", "Google sign in is not configured")
219
+ }, {
220
+ name: "Microsoft",
221
+ icon: ae,
222
+ onClick: Q,
223
+ disabled: !$,
224
+ tooltip: $ ? void 0 : g("auth.login.microsoftNotConfigured", "Microsoft sign in is not configured")
225
+ }];
226
+ return Oe ? /* @__PURE__ */ u(le, {}) : /* @__PURE__ */ d(i, {
227
+ title: g("auth.login.welcomeBack", "Welcome back"),
228
+ subtitle: g("auth.login.enterCredentials", "Enter your credentials to continue"),
239
229
  children: [
240
- /* @__PURE__ */ m("form", {
230
+ /* @__PURE__ */ d("form", {
241
231
  onSubmit: Fe,
242
232
  className: "space-y-5",
243
233
  children: [
244
- W && /* @__PURE__ */ m("div", {
234
+ V && /* @__PURE__ */ d("div", {
245
235
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-info-bg-subtle border-status-info-border",
246
- children: [/* @__PURE__ */ p("svg", {
236
+ children: [/* @__PURE__ */ u("svg", {
247
237
  className: "w-5 h-5 flex-shrink-0 mt-0.5 text-text-link",
248
238
  fill: "none",
249
239
  viewBox: "0 0 24 24",
250
240
  stroke: "currentColor",
251
- children: /* @__PURE__ */ p("path", {
241
+ children: /* @__PURE__ */ u("path", {
252
242
  strokeLinecap: "round",
253
243
  strokeLinejoin: "round",
254
244
  strokeWidth: 2,
255
245
  d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
256
246
  })
257
- }), /* @__PURE__ */ p("p", {
247
+ }), /* @__PURE__ */ u("p", {
258
248
  className: "text-sm text-status-info-text",
259
- children: W
249
+ children: V
260
250
  })]
261
251
  }),
262
- q && /* @__PURE__ */ m("div", {
252
+ G && /* @__PURE__ */ d("div", {
263
253
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-warning-bg-subtle border-status-warning-border",
264
- children: [/* @__PURE__ */ p(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ p("p", {
254
+ children: [/* @__PURE__ */ u(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ u("p", {
265
255
  className: "text-sm text-status-warning-text",
266
- children: q
256
+ children: G
267
257
  })]
268
258
  }),
269
- Ne && /* @__PURE__ */ m("div", {
259
+ q && /* @__PURE__ */ d("div", {
270
260
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-warning-bg-subtle border-status-warning-border",
271
- children: [/* @__PURE__ */ p(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ m("div", {
261
+ children: [/* @__PURE__ */ u(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ d("div", {
272
262
  className: "flex-1",
273
263
  children: [
274
- /* @__PURE__ */ p("p", {
264
+ /* @__PURE__ */ u("p", {
275
265
  className: "text-sm font-medium text-status-warning-text",
276
- children: y("auth.login.duplicateAccount", "This account is already signed in.")
266
+ children: g("auth.login.duplicateAccount", "This account is already signed in.")
277
267
  }),
278
- /* @__PURE__ */ p("p", {
268
+ /* @__PURE__ */ u("p", {
279
269
  className: "mt-1 text-sm text-status-warning-text/80",
280
- children: y("auth.login.duplicateAccountHint", "Please use a different account, or go back and switch to this account from the profile menu.")
270
+ children: g("auth.login.duplicateAccountHint", "Please use a different account, or go back and switch to this account from the profile menu.")
281
271
  }),
282
- (Q.current || Z) && /* @__PURE__ */ m("button", {
272
+ (Z.current || X) && /* @__PURE__ */ d("button", {
283
273
  type: "button",
284
- onClick: () => h(decodeURIComponent(Q.current || Z || "/dashboard")),
274
+ onClick: () => f(decodeURIComponent(Z.current || X || "/dashboard")),
285
275
  className: "mt-3 inline-flex items-center gap-2 px-4 py-2.5 rounded-xl border border-status-warning-border bg-bg-surface text-status-warning-text text-sm font-medium hover:bg-status-warning-bg-subtle hover:border-status-warning-border transition-all shadow-sm",
286
- children: [/* @__PURE__ */ p("svg", {
276
+ children: [/* @__PURE__ */ u("svg", {
287
277
  className: "w-4 h-4",
288
278
  fill: "none",
289
279
  viewBox: "0 0 24 24",
290
280
  stroke: "currentColor",
291
- children: /* @__PURE__ */ p("path", {
281
+ children: /* @__PURE__ */ u("path", {
292
282
  strokeLinecap: "round",
293
283
  strokeLinejoin: "round",
294
284
  strokeWidth: 2,
295
285
  d: "M10 19l-7-7m0 0l7-7m-7 7h18"
296
286
  })
297
- }), y("auth.login.goBackSwitchAccount", "Go back and switch account")]
287
+ }), g("auth.login.goBackSwitchAccount", "Go back and switch account")]
298
288
  })
299
289
  ]
300
290
  })]
301
291
  }),
302
- x && !q && !Ne && /* @__PURE__ */ m("div", {
303
- className: `flex items-start gap-3 p-4 rounded-xl border ${j || F || L ? "bg-status-warning-bg-subtle border-status-warning-border" : "bg-status-error-bg-subtle border-status-error-border"}`,
304
- children: [/* @__PURE__ */ p(a, { className: `w-5 h-5 flex-shrink-0 mt-0.5 ${j || F || L ? "text-status-warning-text" : "text-status-error-text"}` }), /* @__PURE__ */ m("div", {
292
+ v && !G && !q && /* @__PURE__ */ d("div", {
293
+ className: `flex items-start gap-3 p-4 rounded-xl border ${O || M || P ? "bg-status-warning-bg-subtle border-status-warning-border" : "bg-status-error-bg-subtle border-status-error-border"}`,
294
+ children: [/* @__PURE__ */ u(a, { className: `w-5 h-5 flex-shrink-0 mt-0.5 ${O || M || P ? "text-status-warning-text" : "text-status-error-text"}` }), /* @__PURE__ */ d("div", {
305
295
  className: "flex-1",
306
296
  children: [
307
- /* @__PURE__ */ p("p", {
308
- className: `text-sm ${j || F || L ? "text-status-warning-text" : "text-status-error-text"}`,
309
- children: ke ? y("auth.login.accountDeleted", "This account has been permanently deleted and cannot be recovered.") : Ae ? y("auth.login.accountSuspended", "Your account has been suspended. Please contact support for assistance.") : j ? y("auth.login.accountDeactivated", "Your account has been deactivated.") : F ? y("auth.login.oauthOnly", "This account uses OAuth sign-in. Please use Google or Microsoft to sign in.") : L ? y("auth.login.emailNotVerified", "Please verify your email before signing in. Check your inbox for the verification link.") : x
297
+ /* @__PURE__ */ u("p", {
298
+ className: `text-sm ${O || M || P ? "text-status-warning-text" : "text-status-error-text"}`,
299
+ children: je ? g("auth.login.accountDeleted", "This account has been permanently deleted and cannot be recovered.") : Me ? g("auth.login.accountSuspended", "Your account has been suspended. Please contact support for assistance.") : O ? g("auth.login.accountDeactivated", "Your account has been deactivated.") : M ? g("auth.login.oauthOnly", "This account uses OAuth sign-in. Please use Google or Microsoft to sign in.") : P ? g("auth.login.emailNotVerified", "Please verify your email before signing in. Check your inbox for the verification link.") : v
310
300
  }),
311
- j && /* @__PURE__ */ p("button", {
301
+ O && /* @__PURE__ */ u("button", {
312
302
  type: "button",
313
- onClick: () => h("/auth/reactivate", { state: { email: G.email } }),
303
+ onClick: () => f("/auth/reactivate", { state: { email: U.email } }),
314
304
  className: "mt-2 text-sm font-semibold text-status-warning-text hover:text-status-warning-text underline underline-offset-2",
315
- children: y("auth.login.clickReactivate", "Click here to reactivate your account")
305
+ children: g("auth.login.clickReactivate", "Click here to reactivate your account")
316
306
  }),
317
- L && /* @__PURE__ */ p("div", {
307
+ P && /* @__PURE__ */ u("div", {
318
308
  className: "mt-3",
319
- children: je ? /* @__PURE__ */ m("div", {
309
+ children: Ne ? /* @__PURE__ */ d("div", {
320
310
  className: "flex items-center gap-2 text-sm text-status-success-text",
321
- children: [/* @__PURE__ */ p("svg", {
311
+ children: [/* @__PURE__ */ u("svg", {
322
312
  className: "w-4 h-4",
323
313
  fill: "none",
324
314
  viewBox: "0 0 24 24",
325
315
  stroke: "currentColor",
326
- children: /* @__PURE__ */ p("path", {
316
+ children: /* @__PURE__ */ u("path", {
327
317
  strokeLinecap: "round",
328
318
  strokeLinejoin: "round",
329
319
  strokeWidth: 2,
330
320
  d: "M5 13l4 4L19 7"
331
321
  })
332
- }), y("auth.login.verificationSent", "Verification email sent! Please check your inbox.")]
333
- }) : /* @__PURE__ */ p("button", {
322
+ }), g("auth.login.verificationSent", "Verification email sent! Please check your inbox.")]
323
+ }) : /* @__PURE__ */ u("button", {
334
324
  type: "button",
335
- onClick: Re,
336
- disabled: z,
325
+ onClick: Le,
326
+ disabled: I,
337
327
  className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-xl border border-status-warning-border bg-bg-surface text-status-warning-text text-sm font-medium hover:bg-status-warning-bg-subtle hover:border-status-warning-border transition-all shadow-sm disabled:opacity-50 disabled:cursor-not-allowed",
338
- children: z ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(c, { className: "w-4 h-4 animate-spin" }), y("auth.login.sending", "Sending...")] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("svg", {
328
+ children: I ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(oe, { className: "w-4 h-4 animate-spin" }), g("auth.login.sending", "Sending...")] }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("svg", {
339
329
  className: "w-4 h-4",
340
330
  fill: "none",
341
331
  viewBox: "0 0 24 24",
342
332
  stroke: "currentColor",
343
- children: /* @__PURE__ */ p("path", {
333
+ children: /* @__PURE__ */ u("path", {
344
334
  strokeLinecap: "round",
345
335
  strokeLinejoin: "round",
346
336
  strokeWidth: 2,
347
337
  d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
348
338
  })
349
- }), y("auth.login.resendVerification", "Resend verification email")] })
339
+ }), g("auth.login.resendVerification", "Resend verification email")] })
350
340
  })
351
341
  }),
352
- F && /* @__PURE__ */ m("div", {
342
+ M && /* @__PURE__ */ d("div", {
353
343
  className: "mt-3 flex flex-col gap-2",
354
- children: [T("google") && /* @__PURE__ */ m("button", {
344
+ children: [S("google") && /* @__PURE__ */ d("button", {
355
345
  type: "button",
356
346
  onClick: Ie,
357
347
  className: "inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border border-border-default bg-bg-surface text-text-primary text-sm font-medium hover:bg-bg-canvas hover:border-border-default transition-all shadow-sm",
358
- children: [/* @__PURE__ */ p(o, { className: "w-5 h-5" }), y("auth.login.signInWithGoogle", "Sign in with Google")]
359
- }), T("microsoft") && /* @__PURE__ */ m("button", {
348
+ children: [/* @__PURE__ */ u(re, { className: "w-5 h-5" }), g("auth.login.signInWithGoogle", "Sign in with Google")]
349
+ }), S("microsoft") && /* @__PURE__ */ d("button", {
360
350
  type: "button",
361
- onClick: Le,
351
+ onClick: Q,
362
352
  className: "inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border border-border-default bg-bg-surface text-text-primary text-sm font-medium hover:bg-bg-canvas hover:border-border-default transition-all shadow-sm",
363
- children: [/* @__PURE__ */ p(s, { className: "w-5 h-5" }), y("auth.login.signInWithMicrosoft", "Sign in with Microsoft")]
353
+ children: [/* @__PURE__ */ u(ae, { className: "w-5 h-5" }), g("auth.login.signInWithMicrosoft", "Sign in with Microsoft")]
364
354
  })]
365
355
  })
366
356
  ]
367
357
  })]
368
358
  }),
369
- /* @__PURE__ */ m("div", {
359
+ /* @__PURE__ */ d("div", {
370
360
  className: "space-y-2",
371
- children: [/* @__PURE__ */ p("label", {
361
+ children: [/* @__PURE__ */ u("label", {
372
362
  htmlFor: "email",
373
363
  className: "block text-sm font-medium text-[var(--color-text-primary)]",
374
- children: y("auth.login.emailLabel", "Email")
375
- }), /* @__PURE__ */ m("div", {
364
+ children: g("auth.login.emailLabel", "Email")
365
+ }), /* @__PURE__ */ d("div", {
376
366
  className: "relative",
377
- children: [/* @__PURE__ */ p("div", {
367
+ children: [/* @__PURE__ */ u("div", {
378
368
  className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
379
- children: /* @__PURE__ */ p(ee, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
380
- }), /* @__PURE__ */ p("input", {
369
+ children: /* @__PURE__ */ u(ee, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
370
+ }), /* @__PURE__ */ u("input", {
381
371
  id: "email",
382
372
  type: "text",
383
373
  autoComplete: "email username",
384
374
  required: !0,
385
- value: G.email,
386
- onChange: (e) => K({
387
- ...G,
375
+ value: U.email,
376
+ onChange: (e) => W({
377
+ ...U,
388
378
  email: e.target.value
389
379
  }),
390
380
  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",
391
- placeholder: y("auth.login.emailPlaceholder", "you@example.com")
381
+ placeholder: g("auth.login.emailPlaceholder", "you@example.com")
392
382
  })]
393
383
  })]
394
384
  }),
395
- /* @__PURE__ */ m("div", {
385
+ /* @__PURE__ */ d("div", {
396
386
  className: "space-y-2",
397
- children: [/* @__PURE__ */ p("label", {
387
+ children: [/* @__PURE__ */ u("label", {
398
388
  htmlFor: "password",
399
389
  className: "block text-sm font-medium text-[var(--color-text-primary)]",
400
- children: y("auth.login.passwordLabel", "Password")
401
- }), /* @__PURE__ */ m("div", {
390
+ children: g("auth.login.passwordLabel", "Password")
391
+ }), /* @__PURE__ */ d("div", {
402
392
  className: "relative",
403
393
  children: [
404
- /* @__PURE__ */ p("div", {
394
+ /* @__PURE__ */ u("div", {
405
395
  className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
406
- children: /* @__PURE__ */ p(ie, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
396
+ children: /* @__PURE__ */ u(ie, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
407
397
  }),
408
- /* @__PURE__ */ p("input", {
398
+ /* @__PURE__ */ u("input", {
409
399
  id: "password",
410
- type: A ? "text" : "password",
400
+ type: D ? "text" : "password",
411
401
  autoComplete: "current-password",
412
402
  required: !0,
413
- value: G.password,
414
- onChange: (e) => K({
415
- ...G,
403
+ value: U.password,
404
+ onChange: (e) => W({
405
+ ...U,
416
406
  password: e.target.value
417
407
  }),
418
408
  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",
419
- placeholder: y("auth.login.passwordPlaceholder", "Enter your password")
409
+ placeholder: g("auth.login.passwordPlaceholder", "Enter your password")
420
410
  }),
421
- /* @__PURE__ */ p("button", {
411
+ /* @__PURE__ */ u("button", {
422
412
  type: "button",
423
- onClick: () => Oe(!A),
424
- "aria-label": A ? "Hide password" : "Show password",
413
+ onClick: () => Ae(!D),
414
+ "aria-label": D ? "Hide password" : "Show password",
425
415
  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",
426
- children: p(A ? ne : te, { className: "w-5 h-5" })
416
+ children: u(D ? ne : te, { className: "w-5 h-5" })
427
417
  })
428
418
  ]
429
419
  })]
430
420
  }),
431
- /* @__PURE__ */ m("div", {
421
+ /* @__PURE__ */ d("div", {
432
422
  className: "flex items-center justify-between",
433
- children: [/* @__PURE__ */ m("label", {
423
+ children: [/* @__PURE__ */ d("label", {
434
424
  className: "flex items-center gap-2 cursor-pointer group",
435
- children: [/* @__PURE__ */ m("div", {
425
+ children: [/* @__PURE__ */ d("div", {
436
426
  className: "relative",
437
- children: [/* @__PURE__ */ p("input", {
427
+ children: [/* @__PURE__ */ u("input", {
438
428
  type: "checkbox",
439
- checked: G.rememberMe,
429
+ checked: U.rememberMe,
440
430
  onChange: (e) => {
441
431
  let t = e.target.checked;
442
- if (K({
443
- ...G,
432
+ if (W({
433
+ ...U,
444
434
  rememberMe: t
445
435
  }), !t) try {
446
436
  localStorage.removeItem("remembered_email");
@@ -449,120 +439,98 @@ function h() {
449
439
  }
450
440
  },
451
441
  className: "sr-only peer"
452
- }), /* @__PURE__ */ p("div", {
442
+ }), /* @__PURE__ */ u("div", {
453
443
  className: "w-5 h-5 rounded-md border-2 border-[var(--color-border-default)] bg-[var(--color-bg-surface)] peer-checked:bg-status-info-bg-subtle0 peer-checked:border-action-primary-bg transition-all peer-focus:ring-2 peer-focus:ring-action-primary-bg/20",
454
- children: /* @__PURE__ */ p("svg", {
444
+ children: /* @__PURE__ */ u("svg", {
455
445
  className: "w-full h-full text-white opacity-0 peer-checked:opacity-100 transition-opacity p-0.5",
456
446
  fill: "none",
457
447
  viewBox: "0 0 24 24",
458
448
  stroke: "currentColor",
459
449
  strokeWidth: 3,
460
- children: /* @__PURE__ */ p("path", {
450
+ children: /* @__PURE__ */ u("path", {
461
451
  strokeLinecap: "round",
462
452
  strokeLinejoin: "round",
463
453
  d: "M5 13l4 4L19 7"
464
454
  })
465
455
  })
466
456
  })]
467
- }), /* @__PURE__ */ p("span", {
457
+ }), /* @__PURE__ */ u("span", {
468
458
  className: "text-sm text-[var(--color-text-secondary)] group-hover:text-[var(--color-text-primary)] transition-colors",
469
- children: y("auth.login.rememberMe", "Remember me")
459
+ children: g("auth.login.rememberMe", "Remember me")
470
460
  })]
471
- }), /* @__PURE__ */ p("button", {
461
+ }), /* @__PURE__ */ u("button", {
472
462
  type: "button",
473
- onClick: () => h("/auth/reset-password"),
463
+ onClick: () => f("/auth/reset-password"),
474
464
  className: "text-sm font-medium text-text-link hover:text-text-linkHover transition-colors",
475
- children: y("auth.login.forgotPassword", "Forgot password?")
465
+ children: g("auth.login.forgotPassword", "Forgot password?")
476
466
  })]
477
467
  }),
478
- /* @__PURE__ */ p("button", {
468
+ /* @__PURE__ */ u("button", {
479
469
  type: "submit",
480
- disabled: b || D,
470
+ disabled: _ || w,
481
471
  className: "auth-primary-button flex w-full items-center justify-center gap-2 px-4 py-3 font-semibold",
482
- children: b || D ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(c, { className: "w-5 h-5 animate-spin" }), /* @__PURE__ */ p("span", { children: D ? y("auth.login.settingUpWorkspace", "Setting up workspace...") : y("auth.login.signingIn", "Signing in...") })] }) : y("auth.login.signIn", "Sign in")
472
+ children: _ || w ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(oe, { className: "w-5 h-5 animate-spin" }), /* @__PURE__ */ u("span", { children: w ? g("auth.login.settingUpWorkspace", "Setting up workspace...") : g("auth.login.signingIn", "Signing in...") })] }) : g("auth.login.signIn", "Sign in")
483
473
  })
484
474
  ]
485
475
  }),
486
- /* @__PURE__ */ m("div", {
476
+ /* @__PURE__ */ d("div", {
487
477
  className: "relative my-8",
488
- children: [/* @__PURE__ */ p("div", {
478
+ children: [/* @__PURE__ */ u("div", {
489
479
  className: "absolute inset-0 flex items-center",
490
- children: /* @__PURE__ */ p("div", { className: "w-full border-t border-[var(--color-border-default)]" })
491
- }), /* @__PURE__ */ p("div", {
480
+ children: /* @__PURE__ */ u("div", { className: "w-full border-t border-[var(--color-border-default)]" })
481
+ }), /* @__PURE__ */ u("div", {
492
482
  className: "relative flex justify-center",
493
- children: /* @__PURE__ */ p("span", {
483
+ children: /* @__PURE__ */ u("span", {
494
484
  className: "px-4 bg-[var(--color-bg-canvas)] text-sm text-[var(--color-text-tertiary)]",
495
- children: y("auth.login.orContinueWith", "or continue with")
485
+ children: g("auth.login.orContinueWith", "or continue with")
496
486
  })
497
487
  })]
498
488
  }),
499
- H && /* @__PURE__ */ m("div", {
489
+ z && /* @__PURE__ */ d("div", {
500
490
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-error-bg-subtle border-status-error-border",
501
- children: [/* @__PURE__ */ p(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-error-text" }), /* @__PURE__ */ p("p", {
491
+ children: [/* @__PURE__ */ u(a, { className: "w-5 h-5 flex-shrink-0 mt-0.5 text-status-error-text" }), /* @__PURE__ */ u("p", {
502
492
  className: "text-sm text-status-error-text",
503
- children: H
493
+ children: z
504
494
  })]
505
495
  }),
506
- /* @__PURE__ */ p("div", {
496
+ /* @__PURE__ */ u("div", {
507
497
  className: "grid grid-cols-3 gap-3",
508
- children: Be.map((e) => /* @__PURE__ */ m("button", {
498
+ children: ze.map((e) => /* @__PURE__ */ d("button", {
509
499
  type: "button",
510
500
  onClick: e.onClick,
511
501
  disabled: e.disabled,
512
502
  title: e.tooltip,
513
503
  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)]"}`,
514
- children: [/* @__PURE__ */ p(e.icon, { className: `w-5 h-5 ${e.disabled ? "opacity-50" : ""}` }), /* @__PURE__ */ p("span", {
504
+ children: [/* @__PURE__ */ u(e.icon, { className: `w-5 h-5 ${e.disabled ? "opacity-50" : ""}` }), /* @__PURE__ */ u("span", {
515
505
  className: `sr-only sm:not-sr-only text-sm font-medium transition-colors hidden sm:inline ${e.disabled ? "text-[var(--color-text-disabled)]" : "text-[var(--color-text-secondary)] group-hover:text-[var(--color-text-primary)]"}`,
516
506
  children: e.name
517
507
  })]
518
508
  }, e.name))
519
509
  }),
520
- /* @__PURE__ */ p("div", {
521
- className: "mt-6",
522
- children: /* @__PURE__ */ m("button", {
523
- onClick: () => h("/auth/sso/login"),
524
- className: "w-full flex items-center justify-center gap-3 px-4 py-3 rounded-xl border-2 border-dashed border-[var(--color-border-default)] hover:border-action-primary-bg bg-[var(--color-bg-surface)] hover:bg-status-info-bg-subtle transition-all duration-200 group",
525
- children: [/* @__PURE__ */ p("svg", {
526
- className: "w-5 h-5 text-[var(--color-text-tertiary)] group-hover:text-text-link",
527
- fill: "none",
528
- viewBox: "0 0 24 24",
529
- stroke: "currentColor",
530
- children: /* @__PURE__ */ p("path", {
531
- strokeLinecap: "round",
532
- strokeLinejoin: "round",
533
- strokeWidth: 1.5,
534
- d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"
535
- })
536
- }), /* @__PURE__ */ p("span", {
537
- className: "text-sm font-medium text-[var(--color-text-secondary)] group-hover:text-text-link",
538
- children: y("auth.login.enterpriseSso", "Sign in with Enterprise SSO")
539
- })]
540
- })
541
- }),
542
- /* @__PURE__ */ p("div", {
510
+ /* @__PURE__ */ u("div", {
543
511
  className: "mt-4 text-center",
544
- children: /* @__PURE__ */ m("button", {
545
- onClick: () => h("/auth/magic-link"),
512
+ children: /* @__PURE__ */ d("button", {
513
+ onClick: () => f("/auth/magic-link"),
546
514
  className: "text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] transition-colors",
547
515
  children: [
548
- y("auth.login.preferPasswordless", "Prefer passwordless login?"),
516
+ g("auth.login.preferPasswordless", "Prefer passwordless login?"),
549
517
  " ",
550
- /* @__PURE__ */ p("span", {
518
+ /* @__PURE__ */ u("span", {
551
519
  className: "font-semibold text-text-link hover:text-text-linkHover",
552
- children: y("auth.login.signInMagicLink", "Sign in with Magic Link")
520
+ children: g("auth.login.signInMagicLink", "Sign in with Magic Link")
553
521
  })
554
522
  ]
555
523
  })
556
524
  }),
557
- /* @__PURE__ */ m("p", {
525
+ /* @__PURE__ */ d("p", {
558
526
  className: "mt-6 text-center text-sm text-[var(--color-text-secondary)]",
559
527
  children: [
560
- y("auth.login.dontHaveAccount", "Don't have an account?"),
528
+ g("auth.login.dontHaveAccount", "Don't have an account?"),
561
529
  " ",
562
- /* @__PURE__ */ p("button", {
563
- onClick: () => h("/auth/register"),
530
+ /* @__PURE__ */ u("button", {
531
+ onClick: () => f("/auth/register"),
564
532
  className: "font-semibold text-text-link hover:text-text-linkHover transition-colors",
565
- children: y("auth.login.signUp", "Sign up")
533
+ children: g("auth.login.signUp", "Sign up")
566
534
  })
567
535
  ]
568
536
  })
@@ -570,6 +538,6 @@ function h() {
570
538
  });
571
539
  }
572
540
  //#endregion
573
- export { h as LoginPage };
541
+ export { f as LoginPage };
574
542
 
575
543
  //# sourceMappingURL=LoginPage.js.map