@getauthui/core 0.1.7 → 0.1.8

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,6 +1,6 @@
1
- import { state as d, property as g, customElement as R, query as st } from "lit/decorators.js";
2
- import { css as O, LitElement as rt, nothing as o, html as r, svg as h } from "lit";
3
- import { Client as lt, Account as ct, Teams as xt, ID as H, Avatars as kt } from "appwrite";
1
+ import { state as d, property as g, customElement as T, query as st } from "lit/decorators.js";
2
+ import { css as O, LitElement as rt, nothing as n, html as r, svg as h } from "lit";
3
+ import { Client as lt, Account as ct, Teams as xt, ID as B, Avatars as kt } from "appwrite";
4
4
  const Ct = {
5
5
  signIn: "Sign in",
6
6
  dialogSignIn: "Sign in",
@@ -101,10 +101,13 @@ const Ct = {
101
101
  signOutAllSessions: "Sign out everywhere",
102
102
  signOutAllSessionsDescription: "End every session, including this one.",
103
103
  noConnections: "No connected accounts.",
104
+ noConnectionsDescription: "Link an OAuth provider to sign in faster next time.",
104
105
  disconnect: "Disconnect",
105
106
  connectProvider: "Connect {provider}",
106
107
  noActivity: "No recent activity.",
108
+ noActivityDescription: "Security events for this account will appear here.",
107
109
  noSessions: "No active sessions.",
110
+ noSessionsDescription: "Active sessions will show up here once you sign in on a device.",
108
111
  deleteAccount: "Delete account",
109
112
  deleteAccountDescription: "Deleting disables your account and signs you out everywhere. An administrator can restore it.",
110
113
  deleteAccountConfirm: "Delete my account",
@@ -227,10 +230,10 @@ const At = {
227
230
  zoho: "Zoho",
228
231
  zoom: "Zoom"
229
232
  };
230
- function q(e) {
233
+ function W(e) {
231
234
  return At[e] ?? e.charAt(0).toUpperCase() + e.slice(1);
232
235
  }
233
- const j = (e, t, i = 401) => Object.assign(new Error(t), { type: e, code: i }), A = () => (/* @__PURE__ */ new Date()).toISOString(), U = (e) => new Date(Date.now() - e * 6e4).toISOString(), W = [
236
+ const H = (e, t, i = 401) => Object.assign(new Error(t), { type: e, code: i }), A = () => (/* @__PURE__ */ new Date()).toISOString(), U = (e) => new Date(Date.now() - e * 6e4).toISOString(), j = [
234
237
  "amber",
235
238
  "brave",
236
239
  "calm",
@@ -243,7 +246,7 @@ const j = (e, t, i = 401) => Object.assign(new Error(t), { type: e, code: i }),
243
246
  "juniper",
244
247
  "kite",
245
248
  "lumen"
246
- ], dt = () => `${W[Math.floor(Math.random() * W.length)]}-${W[Math.floor(Math.random() * W.length)]}`, _ = () => Math.random().toString(36).slice(2, 12), ht = () => Array.from({ length: 2 }, () => Math.random().toString(36).slice(2, 7)).join("-"), Pt = {
249
+ ], dt = () => `${j[Math.floor(Math.random() * j.length)]}-${j[Math.floor(Math.random() * j.length)]}`, D = () => Math.random().toString(36).slice(2, 12), ht = () => Array.from({ length: 2 }, () => Math.random().toString(36).slice(2, 7)).join("-"), Pt = {
247
250
  name: "Ada Lovelace",
248
251
  email: "ada@example.com",
249
252
  phone: "+15550100"
@@ -313,7 +316,7 @@ class It {
313
316
  },
314
317
  {
315
318
  ...i,
316
- $id: _(),
319
+ $id: D(),
317
320
  $createdAt: U(300),
318
321
  provider: t,
319
322
  ip: "198.51.100.7",
@@ -330,7 +333,7 @@ class It {
330
333
  },
331
334
  {
332
335
  ...i,
333
- $id: _(),
336
+ $id: D(),
334
337
  $createdAt: U(1440 * 3),
335
338
  provider: "oauth2",
336
339
  ip: "192.0.2.90",
@@ -385,9 +388,9 @@ class It {
385
388
  }
386
389
  requireUser() {
387
390
  if (!this.user)
388
- throw j("general_unauthorized_scope", "User (role: guests) missing scope (account)");
391
+ throw H("general_unauthorized_scope", "User (role: guests) missing scope (account)");
389
392
  if (this.mfaPending)
390
- throw j(
393
+ throw H(
391
394
  "user_more_factors_required",
392
395
  "More factors are required to complete the sign in process."
393
396
  );
@@ -395,7 +398,7 @@ class It {
395
398
  }
396
399
  requireRecentChallenge() {
397
400
  if (Date.now() - this.lastChallenge > 30 * 6e4)
398
- throw j(
401
+ throw H(
399
402
  "user_challenge_required",
400
403
  "A recently successful challenge is required to complete this action."
401
404
  );
@@ -431,7 +434,7 @@ class It {
431
434
  }
432
435
  async createMagicURLToken(t, i) {
433
436
  return this.tokens.set(t, { email: i }), this.delay({
434
- $id: _(),
437
+ $id: D(),
435
438
  $createdAt: A(),
436
439
  userId: t,
437
440
  secret: "",
@@ -441,7 +444,7 @@ class It {
441
444
  }
442
445
  async createEmailToken(t, i) {
443
446
  return this.tokens.set(t, { email: i }), this.delay({
444
- $id: _(),
447
+ $id: D(),
445
448
  $createdAt: A(),
446
449
  userId: t,
447
450
  secret: "",
@@ -450,7 +453,7 @@ class It {
450
453
  });
451
454
  }
452
455
  async createPhoneToken(t, i) {
453
- return this.tokens.set(t, { phone: i }), this.delay({ $id: _(), $createdAt: A(), userId: t, secret: "", expire: "", phrase: "" });
456
+ return this.tokens.set(t, { phone: i }), this.delay({ $id: D(), $createdAt: A(), userId: t, secret: "", expire: "", phrase: "" });
454
457
  }
455
458
  async createSession(t) {
456
459
  return this.delay(() => {
@@ -542,7 +545,7 @@ class It {
542
545
  });
543
546
  }
544
547
  async createMFAChallenge() {
545
- return this.delay({ $id: _(), $createdAt: A(), userId: "preview-user", expire: "" });
548
+ return this.delay({ $id: D(), $createdAt: A(), userId: "preview-user", expire: "" });
546
549
  }
547
550
  async updateMFAChallenge() {
548
551
  return this.delay(() => (this.mfaPending = !1, this.lastChallenge = Date.now(), this.sessions[0]));
@@ -571,7 +574,7 @@ class It {
571
574
  async createMFARecoveryCodes() {
572
575
  return this.delay(() => {
573
576
  if (this.recoveryCodes.length > 0)
574
- throw j("user_recovery_codes_already_exists", "Recovery codes already generated.", 409);
577
+ throw H("user_recovery_codes_already_exists", "Recovery codes already generated.", 409);
575
578
  return this.recoveryCodes = Array.from({ length: 6 }, ht), { recoveryCodes: this.recoveryCodes };
576
579
  });
577
580
  }
@@ -589,13 +592,13 @@ class It {
589
592
  function Et(e) {
590
593
  let t = 2166136261;
591
594
  const i = () => (t ^= t << 13, t ^= t >>> 17, t ^= t << 5, (t >>> 0) / 4294967296);
592
- for (const $ of e) t = (t ^ $.charCodeAt(0)) * 16777619;
595
+ for (const b of e) t = (t ^ b.charCodeAt(0)) * 16777619;
593
596
  const s = 25;
594
597
  let a = "";
595
- const c = ($, x) => `<rect x="${$}" y="${x}" width="7" height="7"/><rect x="${$ + 1}" y="${x + 1}" width="5" height="5" fill="#fff"/><rect x="${$ + 2}" y="${x + 2}" width="3" height="3"/>`;
596
- for (let $ = 0; $ < s; $++)
597
- for (let x = 0; x < s; x++)
598
- !(x < 8 && $ < 8 || x >= s - 8 && $ < 8 || x < 8 && $ >= s - 8) && i() < 0.45 && (a += `<rect x="${x}" y="${$}" width="1" height="1"/>`);
598
+ const c = (b, $) => `<rect x="${b}" y="${$}" width="7" height="7"/><rect x="${b + 1}" y="${$ + 1}" width="5" height="5" fill="#fff"/><rect x="${b + 2}" y="${$ + 2}" width="3" height="3"/>`;
599
+ for (let b = 0; b < s; b++)
600
+ for (let $ = 0; $ < s; $++)
601
+ !($ < 8 && b < 8 || $ >= s - 8 && b < 8 || $ < 8 && b >= s - 8) && i() < 0.45 && (a += `<rect x="${$}" y="${b}" width="1" height="1"/>`);
599
602
  const u = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${s}" shape-rendering="crispEdges"><rect width="${s}" height="${s}" fill="#fff"/><g fill="#000">${c(0, 0)}${c(s - 7, 0)}${c(0, s - 7)}${a}</g></svg>`;
600
603
  return `data:image/svg+xml;utf8,${encodeURIComponent(u)}`;
601
604
  }
@@ -634,7 +637,7 @@ const f = {
634
637
  targetAlreadyExists: "user_target_already_exists",
635
638
  argumentInvalid: "general_argument_invalid"
636
639
  };
637
- function z(e) {
640
+ function _(e) {
638
641
  if (e && typeof e == "object") {
639
642
  const t = e;
640
643
  let i = typeof t.message == "string" ? t.message : "Unknown error";
@@ -646,11 +649,11 @@ function z(e) {
646
649
  }
647
650
  return { message: String(e), type: "", code: 0 };
648
651
  }
649
- function N(e, t) {
650
- return z(e).type === t;
652
+ function q(e, t) {
653
+ return _(e).type === t;
651
654
  }
652
655
  function K(e, t, i = "link") {
653
- const s = z(e);
656
+ const s = _(e);
654
657
  switch (s.type) {
655
658
  case f.invalidCredentials:
656
659
  return i === "password" ? t.errorCurrentPassword : t.errorInvalidCredentials;
@@ -693,14 +696,14 @@ function K(e, t, i = "link") {
693
696
  return s.type === f.projectNotFound || s.type === f.unknownOrigin ? t.errorConfig : s.type === f.routeNotFound ? t.errorConfigEndpoint : s.code === 0 && /fetch|network/i.test(s.message) ? t.errorNetwork : /Invalid `\w+` param/i.test(s.message) ? t.errorGeneric : s.message ? s.message || t.errorGeneric : s.code === 404 || s.type === f.routeNotFound ? t.errorConfigEndpoint : t.errorGeneric;
694
697
  }
695
698
  function Ut(e) {
696
- const t = z(e);
699
+ const t = _(e);
697
700
  return !!(t.type === f.projectNotFound || t.type === f.unknownOrigin || t.type === f.routeNotFound || !t.message && t.code === 404 || t.code === 0 && /fetch|network|load failed|failed to fetch/i.test(t.message));
698
701
  }
699
- const J = (e) => `authui:active-team:${e}`;
702
+ const tt = (e) => `authui:active-team:${e}`;
700
703
  function ut(e) {
701
704
  if (typeof localStorage > "u" || !e) return null;
702
705
  try {
703
- return localStorage.getItem(J(e));
706
+ return localStorage.getItem(tt(e));
704
707
  } catch {
705
708
  return null;
706
709
  }
@@ -708,7 +711,7 @@ function ut(e) {
708
711
  function Mt(e, t) {
709
712
  if (!(typeof localStorage > "u" || !e))
710
713
  try {
711
- t ? localStorage.setItem(J(e), t) : localStorage.removeItem(J(e));
714
+ t ? localStorage.setItem(tt(e), t) : localStorage.removeItem(tt(e));
712
715
  } catch {
713
716
  }
714
717
  }
@@ -724,7 +727,7 @@ function V(e) {
724
727
  }
725
728
  }
726
729
  }
727
- function D() {
730
+ function z() {
728
731
  if (typeof localStorage > "u") return null;
729
732
  try {
730
733
  return localStorage.getItem(at);
@@ -772,7 +775,7 @@ function S(e, t, i) {
772
775
  new Error(`Appwrite SDK is missing ${t[0]}(). Update the appwrite package.`)
773
776
  );
774
777
  }
775
- const tt = "authui", mt = ["userId", "secret", "expire", "project", "error", tt], ft = () => ({
778
+ const et = "authui", mt = ["userId", "secret", "expire", "project", "error", et], ft = () => ({
776
779
  status: "loading",
777
780
  user: null,
778
781
  mfaFactors: null,
@@ -883,7 +886,7 @@ class Ft {
883
886
  this.state = { ...this.state, ...t }, this.emit("change", this.getState());
884
887
  }
885
888
  fail(t) {
886
- const i = z(t);
889
+ const i = _(t);
887
890
  throw this.emit("error", i), t;
888
891
  }
889
892
  acct() {
@@ -903,7 +906,7 @@ class Ft {
903
906
  const i = await this.account.get();
904
907
  this.setState({ status: "signed-in", user: i, mfaFactors: null, configError: null }), t || this.emit("signed-in", i);
905
908
  } catch (i) {
906
- if (N(i, f.moreFactorsRequired)) {
909
+ if (q(i, f.moreFactorsRequired)) {
907
910
  let s = null;
908
911
  try {
909
912
  s = await S(
@@ -914,7 +917,7 @@ class Ft {
914
917
  } catch {
915
918
  }
916
919
  this.setState({ status: "mfa-required", user: null, mfaFactors: s });
917
- } else if (N(i, f.userBlocked))
920
+ } else if (q(i, f.userBlocked))
918
921
  await this.purgeLocalSession(), this.setState({
919
922
  status: "signed-out",
920
923
  user: null,
@@ -930,7 +933,7 @@ class Ft {
930
933
  console.warn(
931
934
  `[authui] ${a} (endpoint=${this.config?.endpoint ?? "?"}, project=${this.config?.project ?? "?"})`
932
935
  );
933
- const c = z(i);
936
+ const c = _(i);
934
937
  this.emit("error", { message: a, type: c.type, code: c.code }), this.setState({
935
938
  status: "signed-out",
936
939
  user: null,
@@ -988,7 +991,7 @@ class Ft {
988
991
  }
989
992
  async signUp(t, i, s) {
990
993
  try {
991
- await this.acct().create(H.unique(), t.trim(), i, s?.trim() || void 0), await this.acct().createEmailPasswordSession(t.trim(), i);
994
+ await this.acct().create(B.unique(), t.trim(), i, s?.trim() || void 0), await this.acct().createEmailPasswordSession(t.trim(), i);
992
995
  } catch (a) {
993
996
  this.fail(a);
994
997
  }
@@ -1031,7 +1034,7 @@ class Ft {
1031
1034
  async sendMagicUrl(t) {
1032
1035
  try {
1033
1036
  return await this.acct().createMagicURLToken(
1034
- H.unique(),
1037
+ B.unique(),
1035
1038
  t.trim(),
1036
1039
  this.redirectUrl("magic-url"),
1037
1040
  this.config?.securityPhrase ?? !0
@@ -1043,7 +1046,7 @@ class Ft {
1043
1046
  async sendEmailOtp(t) {
1044
1047
  try {
1045
1048
  return await this.acct().createEmailToken(
1046
- H.unique(),
1049
+ B.unique(),
1047
1050
  t.trim(),
1048
1051
  this.config?.securityPhrase ?? !0
1049
1052
  );
@@ -1053,7 +1056,7 @@ class Ft {
1053
1056
  }
1054
1057
  async sendPhoneOtp(t) {
1055
1058
  try {
1056
- return await this.acct().createPhoneToken(H.unique(), t.replace(/[\s()-]/g, ""));
1059
+ return await this.acct().createPhoneToken(B.unique(), t.replace(/[\s()-]/g, ""));
1057
1060
  } catch (i) {
1058
1061
  return this.fail(i);
1059
1062
  }
@@ -1328,7 +1331,7 @@ class Ft {
1328
1331
  redirectUrl(t) {
1329
1332
  const i = this.config?.redirectUrl ?? (typeof window < "u" ? window.location.origin + window.location.pathname : ""), s = new URL(i, typeof window < "u" ? window.location.href : void 0);
1330
1333
  for (const a of mt) s.searchParams.delete(a);
1331
- return s.searchParams.set(tt, t), s.toString();
1334
+ return s.searchParams.set(et, t), s.toString();
1332
1335
  }
1333
1336
  setPending(t) {
1334
1337
  this.setState({ pending: t });
@@ -1339,7 +1342,7 @@ class Ft {
1339
1342
  */
1340
1343
  async handleRedirect() {
1341
1344
  if (typeof window > "u") return !1;
1342
- const t = new URLSearchParams(window.location.search), i = t.get(tt);
1345
+ const t = new URLSearchParams(window.location.search), i = t.get(et);
1343
1346
  if (!i) return !1;
1344
1347
  const s = t.get("userId") ?? "", a = t.get("secret") ?? "";
1345
1348
  this.cleanUrl();
@@ -1385,8 +1388,8 @@ class Ft {
1385
1388
  break;
1386
1389
  }
1387
1390
  } catch (u) {
1388
- const $ = z(u), x = K(u, this.getStrings(), "link");
1389
- this.emit("error", $), this.setState({ pending: { type: "notice", message: x, tone: "error" } });
1391
+ const b = _(u), $ = K(u, this.getStrings(), "link");
1392
+ this.emit("error", b), this.setState({ pending: { type: "notice", message: $, tone: "error" } });
1390
1393
  }
1391
1394
  return !0;
1392
1395
  }
@@ -1400,8 +1403,8 @@ class Ft {
1400
1403
  this.client = null, this.account = null, this.teams = null, this.activeTeamId = null, this.preview = null, this.config = null, this.state = ft(), this.listeners.clear();
1401
1404
  }
1402
1405
  }
1403
- const n = new Ft();
1404
- class Tt {
1406
+ const o = new Ft();
1407
+ class Rt {
1405
1408
  constructor() {
1406
1409
  this.listeners = /* @__PURE__ */ new Set(), this.observer = null, this.media = null, this.notify = () => {
1407
1410
  const t = this.isDark("auto");
@@ -1429,14 +1432,14 @@ class Tt {
1429
1432
  this.observer?.disconnect(), this.observer = null, this.media?.removeEventListener?.("change", this.notify), this.media = null;
1430
1433
  }
1431
1434
  }
1432
- const gt = new Tt(), vt = {
1435
+ const gt = new Rt(), vt = {
1433
1436
  none: "0px",
1434
1437
  sm: "0.25rem",
1435
1438
  md: "0.625rem",
1436
1439
  lg: "0.875rem",
1437
1440
  xl: "1.125rem",
1438
1441
  full: "1.5rem"
1439
- }, Rt = O`
1442
+ }, Tt = O`
1440
1443
  :host {
1441
1444
  /* Light theme (matches :root in the console) */
1442
1445
  --authui-background: oklch(1 0 0);
@@ -1514,7 +1517,7 @@ const gt = new Tt(), vt = {
1514
1517
  --authui-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
1515
1518
  color-scheme: dark;
1516
1519
  }
1517
- `, _t = O`
1520
+ `, Dt = O`
1518
1521
  *,
1519
1522
  *::before,
1520
1523
  *::after {
@@ -2229,12 +2232,154 @@ const gt = new Tt(), vt = {
2229
2232
  width: 18px;
2230
2233
  height: 18px;
2231
2234
  }
2235
+ /* OAuth accordion: last-used (or focused) expands; others stay icon-compact. */
2236
+ .providers.accordion {
2237
+ display: flex;
2238
+ width: 100%;
2239
+ gap: 8px;
2240
+ }
2241
+ .providers.accordion > .provider-slot {
2242
+ position: relative;
2243
+ flex: 0 1 2.25rem;
2244
+ min-width: 2.25rem;
2245
+ overflow: visible;
2246
+ transition: flex-grow 480ms cubic-bezier(0.22, 1, 0.36, 1);
2247
+ }
2248
+ .providers.accordion > .provider-slot.is-expanded {
2249
+ flex-grow: 1;
2250
+ }
2251
+ .providers.accordion .btn {
2252
+ position: relative;
2253
+ width: 100%;
2254
+ min-width: 0;
2255
+ justify-content: center;
2256
+ gap: 0;
2257
+ padding-inline: 0;
2258
+ overflow: hidden;
2259
+ }
2260
+ .providers.accordion .btn svg {
2261
+ width: 16px;
2262
+ height: 16px;
2263
+ flex-shrink: 0;
2264
+ }
2265
+ .provider-label {
2266
+ display: grid;
2267
+ min-width: 0;
2268
+ grid-template-columns: 0fr;
2269
+ transition: grid-template-columns 480ms cubic-bezier(0.22, 1, 0.36, 1) 160ms;
2270
+ }
2271
+ .provider-label > span {
2272
+ min-width: 0;
2273
+ overflow: hidden;
2274
+ }
2275
+ .provider-label-text {
2276
+ display: block;
2277
+ white-space: nowrap;
2278
+ padding-inline-start: 6px;
2279
+ opacity: 0;
2280
+ transition: opacity 160ms ease;
2281
+ }
2282
+ .providers.accordion > .provider-slot.is-expanded .provider-label {
2283
+ grid-template-columns: 1fr;
2284
+ transition: grid-template-columns 480ms cubic-bezier(0.22, 1, 0.36, 1);
2285
+ }
2286
+ .providers.accordion > .provider-slot.is-expanded .provider-label-text {
2287
+ opacity: 1;
2288
+ transition: opacity 240ms ease 320ms;
2289
+ }
2290
+ .oauth-last-used {
2291
+ position: absolute;
2292
+ inset: 0;
2293
+ z-index: 10;
2294
+ pointer-events: none;
2295
+ }
2296
+ .oauth-last-used-dot,
2297
+ .oauth-last-used-pill {
2298
+ position: absolute;
2299
+ transition: opacity 180ms ease;
2300
+ }
2301
+ .oauth-last-used-dot {
2302
+ top: -3px;
2303
+ inset-inline-end: -3px;
2304
+ width: 8px;
2305
+ height: 8px;
2306
+ border-radius: 999px;
2307
+ background: var(--authui-brand);
2308
+ box-shadow: 0 0 0 2px var(--authui-card);
2309
+ opacity: 1;
2310
+ }
2311
+ .oauth-last-used-pill {
2312
+ top: -8px;
2313
+ inset-inline-start: 6px;
2314
+ padding: 2px 6px;
2315
+ border-radius: 4px;
2316
+ border: 1px solid var(--authui-border);
2317
+ background: var(--authui-foreground);
2318
+ color: var(--authui-background);
2319
+ font-size: 10px;
2320
+ font-weight: 500;
2321
+ line-height: 1.2;
2322
+ white-space: nowrap;
2323
+ opacity: 0;
2324
+ }
2325
+ .providers.accordion > .provider-slot.is-expanded .oauth-last-used-dot {
2326
+ opacity: 0;
2327
+ }
2328
+ .providers.accordion > .provider-slot.is-expanded .oauth-last-used-pill {
2329
+ opacity: 1;
2330
+ }
2331
+ @media (prefers-reduced-motion: reduce) {
2332
+ .providers.accordion > .provider-slot,
2333
+ .provider-label,
2334
+ .provider-label-text,
2335
+ .oauth-last-used-dot,
2336
+ .oauth-last-used-pill {
2337
+ transition: none;
2338
+ }
2339
+ }
2232
2340
  .empty {
2233
2341
  padding: 24px 0;
2234
2342
  text-align: center;
2235
2343
  font-size: 13px;
2236
2344
  color: var(--authui-muted-foreground);
2237
2345
  }
2346
+ .empty-well {
2347
+ display: flex;
2348
+ flex-direction: column;
2349
+ align-items: center;
2350
+ text-align: center;
2351
+ padding: 28px 16px;
2352
+ border: 1px dashed var(--authui-border);
2353
+ border-radius: var(--authui-radius-xl);
2354
+ background: color-mix(in oklab, var(--authui-card) 50%, transparent);
2355
+ }
2356
+ .empty-icon {
2357
+ width: 48px;
2358
+ height: 48px;
2359
+ border-radius: 999px;
2360
+ background: var(--authui-muted);
2361
+ color: var(--authui-muted-foreground);
2362
+ display: inline-flex;
2363
+ align-items: center;
2364
+ justify-content: center;
2365
+ margin-bottom: 16px;
2366
+ }
2367
+ .empty-icon svg {
2368
+ width: 20px;
2369
+ height: 20px;
2370
+ }
2371
+ .empty-title {
2372
+ margin: 0 0 4px;
2373
+ font-size: 14px;
2374
+ font-weight: 500;
2375
+ color: var(--authui-foreground);
2376
+ }
2377
+ .empty-desc {
2378
+ margin: 0;
2379
+ font-size: 13px;
2380
+ color: var(--authui-muted-foreground);
2381
+ max-width: 280px;
2382
+ }
2238
2383
  .choice {
2239
2384
  display: flex;
2240
2385
  align-items: center;
@@ -2321,19 +2466,19 @@ const gt = new Tt(), vt = {
2321
2466
  }
2322
2467
  }
2323
2468
  `;
2324
- var Dt = Object.defineProperty, zt = (e, t, i, s) => {
2469
+ var zt = Object.defineProperty, _t = (e, t, i, s) => {
2325
2470
  for (var a = void 0, c = e.length - 1, u; c >= 0; c--)
2326
2471
  (u = e[c]) && (a = u(t, i, a) || a);
2327
- return a && Dt(t, i, a), a;
2472
+ return a && zt(t, i, a), a;
2328
2473
  }, M;
2329
2474
  const $t = (M = class extends rt {
2330
2475
  constructor() {
2331
- super(...arguments), this.auth = n.getState(), this.unsubscribeStore = null, this.unsubscribeTheme = null, this.stopKeys = (t) => t.stopPropagation();
2476
+ super(...arguments), this.auth = o.getState(), this.unsubscribeStore = null, this.unsubscribeTheme = null, this.stopKeys = (t) => t.stopPropagation();
2332
2477
  }
2333
2478
  connectedCallback() {
2334
2479
  super.connectedCallback();
2335
2480
  for (const t of M.KEY_EVENTS) this.addEventListener(t, this.stopKeys);
2336
- this.auth = n.getState(), this.unsubscribeStore = n.on("change", (t) => {
2481
+ this.auth = o.getState(), this.unsubscribeStore = o.on("change", (t) => {
2337
2482
  this.auth = t, this.applyBranding();
2338
2483
  }), this.unsubscribeTheme = gt.subscribe(() => this.applyBranding()), this.applyBranding();
2339
2484
  }
@@ -2343,14 +2488,14 @@ const $t = (M = class extends rt {
2343
2488
  this.unsubscribeStore?.(), this.unsubscribeTheme?.(), this.unsubscribeStore = null, this.unsubscribeTheme = null;
2344
2489
  }
2345
2490
  get strings() {
2346
- return n.getStrings();
2491
+ return o.getStrings();
2347
2492
  }
2348
2493
  /** Translate a string key with optional `{placeholders}`. */
2349
2494
  t(t, i) {
2350
2495
  return St(this.strings[t], i);
2351
2496
  }
2352
2497
  get config() {
2353
- return n.getConfig();
2498
+ return o.getConfig();
2354
2499
  }
2355
2500
  get productName() {
2356
2501
  return this.config?.branding?.name ?? "";
@@ -2367,17 +2512,17 @@ const $t = (M = class extends rt {
2367
2512
  fire(t, i) {
2368
2513
  this.dispatchEvent(new CustomEvent(t, { detail: i, bubbles: !0, composed: !0 }));
2369
2514
  }
2370
- }, M.styles = [Rt, _t], M.KEY_EVENTS = ["keydown", "keyup", "keypress"], M);
2371
- zt([
2515
+ }, M.styles = [Tt, Dt], M.KEY_EVENTS = ["keydown", "keyup", "keypress"], M);
2516
+ _t([
2372
2517
  d()
2373
2518
  ], $t.prototype, "auth");
2374
2519
  let E = $t;
2375
- var Lt = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor, y = (e, t, i, s) => {
2520
+ var Lt = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor, w = (e, t, i, s) => {
2376
2521
  for (var a = s > 1 ? void 0 : s ? Vt(t, i) : t, c = e.length - 1, u; c >= 0; c--)
2377
2522
  (u = e[c]) && (a = (s ? u(t, i, a) : u(a)) || a);
2378
2523
  return s && a && Lt(t, i, a), a;
2379
2524
  };
2380
- let b = class extends rt {
2525
+ let y = class extends rt {
2381
2526
  constructor() {
2382
2527
  super(...arguments), this.endpoint = "", this.project = "", this.redirectUrl = "", this.successUrl = "", this.methods = "email-password", this.signUp = "true", this.requireName = "true", this.mfa = "true", this.securityPhrase = "true", this.name = "", this.logo = "", this.theme = "auto", this.radius = "", this.primary = "", this.primaryForeground = "", this.termsUrl = "", this.privacyUrl = "", this.preview = "";
2383
2528
  }
@@ -2390,12 +2535,12 @@ let b = class extends rt {
2390
2535
  configure() {
2391
2536
  if (!this.endpoint || !this.project) {
2392
2537
  queueMicrotask(() => {
2393
- (!this.endpoint || !this.project) && n.notifyConfigIncomplete();
2538
+ (!this.endpoint || !this.project) && o.notifyConfigIncomplete();
2394
2539
  });
2395
2540
  return;
2396
2541
  }
2397
- const e = this.toConfig(), t = n.getConfig();
2398
- t && JSON.stringify(t) === JSON.stringify(e) || n.configure(e);
2542
+ const e = this.toConfig(), t = o.getConfig();
2543
+ t && JSON.stringify(t) === JSON.stringify(e) || o.configure(e);
2399
2544
  }
2400
2545
  toConfig() {
2401
2546
  const e = { oauth: [] }, t = this.methods.split(/[\s,]+/).filter(Boolean);
@@ -2427,69 +2572,69 @@ let b = class extends rt {
2427
2572
  };
2428
2573
  }
2429
2574
  };
2430
- b.styles = O`
2575
+ y.styles = O`
2431
2576
  :host {
2432
2577
  display: none;
2433
2578
  }
2434
2579
  `;
2435
- y([
2580
+ w([
2436
2581
  g({ type: String })
2437
- ], b.prototype, "endpoint", 2);
2438
- y([
2582
+ ], y.prototype, "endpoint", 2);
2583
+ w([
2439
2584
  g({ type: String })
2440
- ], b.prototype, "project", 2);
2441
- y([
2585
+ ], y.prototype, "project", 2);
2586
+ w([
2442
2587
  g({ type: String, attribute: "redirect-url" })
2443
- ], b.prototype, "redirectUrl", 2);
2444
- y([
2588
+ ], y.prototype, "redirectUrl", 2);
2589
+ w([
2445
2590
  g({ type: String, attribute: "success-url" })
2446
- ], b.prototype, "successUrl", 2);
2447
- y([
2591
+ ], y.prototype, "successUrl", 2);
2592
+ w([
2448
2593
  g({ type: String })
2449
- ], b.prototype, "methods", 2);
2450
- y([
2594
+ ], y.prototype, "methods", 2);
2595
+ w([
2451
2596
  g({ type: String, attribute: "sign-up" })
2452
- ], b.prototype, "signUp", 2);
2453
- y([
2597
+ ], y.prototype, "signUp", 2);
2598
+ w([
2454
2599
  g({ type: String, attribute: "require-name" })
2455
- ], b.prototype, "requireName", 2);
2456
- y([
2600
+ ], y.prototype, "requireName", 2);
2601
+ w([
2457
2602
  g({ type: String })
2458
- ], b.prototype, "mfa", 2);
2459
- y([
2603
+ ], y.prototype, "mfa", 2);
2604
+ w([
2460
2605
  g({ type: String, attribute: "security-phrase" })
2461
- ], b.prototype, "securityPhrase", 2);
2462
- y([
2606
+ ], y.prototype, "securityPhrase", 2);
2607
+ w([
2463
2608
  g({ type: String })
2464
- ], b.prototype, "name", 2);
2465
- y([
2609
+ ], y.prototype, "name", 2);
2610
+ w([
2466
2611
  g({ type: String })
2467
- ], b.prototype, "logo", 2);
2468
- y([
2612
+ ], y.prototype, "logo", 2);
2613
+ w([
2469
2614
  g({ type: String })
2470
- ], b.prototype, "theme", 2);
2471
- y([
2615
+ ], y.prototype, "theme", 2);
2616
+ w([
2472
2617
  g({ type: String })
2473
- ], b.prototype, "radius", 2);
2474
- y([
2618
+ ], y.prototype, "radius", 2);
2619
+ w([
2475
2620
  g({ type: String })
2476
- ], b.prototype, "primary", 2);
2477
- y([
2621
+ ], y.prototype, "primary", 2);
2622
+ w([
2478
2623
  g({ type: String, attribute: "primary-foreground" })
2479
- ], b.prototype, "primaryForeground", 2);
2480
- y([
2624
+ ], y.prototype, "primaryForeground", 2);
2625
+ w([
2481
2626
  g({ type: String, attribute: "terms-url" })
2482
- ], b.prototype, "termsUrl", 2);
2483
- y([
2627
+ ], y.prototype, "termsUrl", 2);
2628
+ w([
2484
2629
  g({ type: String, attribute: "privacy-url" })
2485
- ], b.prototype, "privacyUrl", 2);
2486
- y([
2630
+ ], y.prototype, "privacyUrl", 2);
2631
+ w([
2487
2632
  g({ type: String })
2488
- ], b.prototype, "preview", 2);
2489
- b = y([
2490
- R("authui-config")
2491
- ], b);
2492
- var qt = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, Z = (e, t, i, s) => {
2633
+ ], y.prototype, "preview", 2);
2634
+ y = w([
2635
+ T("authui-config")
2636
+ ], y);
2637
+ var qt = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, X = (e, t, i, s) => {
2493
2638
  for (var a = s > 1 ? void 0 : s ? Nt(t, i) : t, c = e.length - 1, u; c >= 0; c--)
2494
2639
  (u = e[c]) && (a = (s ? u(t, i, a) : u(a)) || a);
2495
2640
  return s && a && qt(t, i, a), a;
@@ -2515,43 +2660,43 @@ function Bt() {
2515
2660
  }
2516
2661
  Bt();
2517
2662
  const Ht = ["loading", "signed-out", "signed-in", "mfa-required"];
2518
- function Q(e) {
2663
+ function J(e) {
2519
2664
  return e ? e.split(/[\s,]+/).map((t) => t.trim()).filter((t) => Ht.includes(t)) : [];
2520
2665
  }
2521
- let B = class extends rt {
2666
+ let N = class extends rt {
2522
2667
  constructor() {
2523
- super(...arguments), this.when = "", this.unless = "", this.status = n.getState().status, this.unsubscribe = null;
2668
+ super(...arguments), this.when = "", this.unless = "", this.status = o.getState().status, this.unsubscribe = null;
2524
2669
  }
2525
2670
  connectedCallback() {
2526
- super.connectedCallback(), this.status = n.getState().status, this.unsubscribe = n.on("change", (e) => this.status = e.status);
2671
+ super.connectedCallback(), this.status = o.getState().status, this.unsubscribe = o.on("change", (e) => this.status = e.status);
2527
2672
  }
2528
2673
  disconnectedCallback() {
2529
2674
  super.disconnectedCallback(), this.unsubscribe?.(), this.unsubscribe = null;
2530
2675
  }
2531
2676
  /** Whether the current status satisfies `when` and `unless`. */
2532
2677
  get visible() {
2533
- const e = Q(this.when), t = Q(this.unless);
2678
+ const e = J(this.when), t = J(this.unless);
2534
2679
  return !(this.status === "loading" && !e.includes("loading") || e.length > 0 && !e.includes(this.status) || t.includes(this.status));
2535
2680
  }
2536
2681
  updated() {
2537
- (this.status !== "loading" || Q(this.when).includes("loading")) && (this.setAttribute("ready", ""), this.style.display = "contents");
2682
+ (this.status !== "loading" || J(this.when).includes("loading")) && (this.setAttribute("ready", ""), this.style.display = "contents");
2538
2683
  }
2539
2684
  render() {
2540
- return this.visible ? r`<slot></slot>` : o;
2685
+ return this.visible ? r`<slot></slot>` : n;
2541
2686
  }
2542
2687
  };
2543
- Z([
2688
+ X([
2544
2689
  g({ type: String })
2545
- ], B.prototype, "when", 2);
2546
- Z([
2690
+ ], N.prototype, "when", 2);
2691
+ X([
2547
2692
  g({ type: String })
2548
- ], B.prototype, "unless", 2);
2549
- Z([
2693
+ ], N.prototype, "unless", 2);
2694
+ X([
2550
2695
  d()
2551
- ], B.prototype, "status", 2);
2552
- B = Z([
2553
- R("authui-show")
2554
- ], B);
2696
+ ], N.prototype, "status", 2);
2697
+ N = X([
2698
+ T("authui-show")
2699
+ ], N);
2555
2700
  const jt = O`
2556
2701
  :host {
2557
2702
  display: block;
@@ -2699,70 +2844,70 @@ const jt = O`
2699
2844
  qr: v(
2700
2845
  h`<rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/>`
2701
2846
  )
2702
- }, w = (e, t = "0 0 24 24") => r`<svg xmlns="http://www.w3.org/2000/svg" viewBox=${t} aria-hidden="true">${e}</svg>`, Wt = {
2703
- google: w(
2847
+ }, x = (e, t = "0 0 24 24") => r`<svg xmlns="http://www.w3.org/2000/svg" viewBox=${t} aria-hidden="true">${e}</svg>`, Wt = {
2848
+ google: x(
2704
2849
  h`<path fill="#4285F4" d="M23.49 12.27c0-.79-.07-1.54-.19-2.27H12v4.51h6.47a5.57 5.57 0 0 1-2.4 3.58v3h3.86c2.26-2.09 3.56-5.17 3.56-8.82z"/><path fill="#34A853" d="M12 24c3.24 0 5.95-1.08 7.93-2.91l-3.86-3c-1.08.72-2.45 1.16-4.07 1.16-3.13 0-5.78-2.11-6.73-4.96H1.29v3.09A11.99 11.99 0 0 0 12 24z"/><path fill="#FBBC05" d="M5.27 14.29A7.2 7.2 0 0 1 4.89 12c0-.8.14-1.57.38-2.29V6.62H1.29A11.97 11.97 0 0 0 0 12c0 1.94.46 3.77 1.29 5.38l3.98-3.09z"/><path fill="#EA4335" d="M12 4.75c1.77 0 3.35.61 4.6 1.8l3.42-3.42C17.95 1.19 15.24 0 12 0 7.31 0 3.26 2.69 1.29 6.62l3.98 3.09C6.22 6.86 8.87 4.75 12 4.75z"/>`
2705
2850
  ),
2706
- github: w(
2851
+ github: x(
2707
2852
  h`<path fill="currentColor" d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"/>`
2708
2853
  ),
2709
- apple: w(
2854
+ apple: x(
2710
2855
  h`<path fill="currentColor" d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/>`
2711
2856
  ),
2712
- facebook: w(
2857
+ facebook: x(
2713
2858
  h`<path fill="#1877F2" d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>`
2714
2859
  ),
2715
- x: w(
2860
+ x: x(
2716
2861
  h`<path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>`
2717
2862
  ),
2718
- microsoft: w(
2863
+ microsoft: x(
2719
2864
  h`<path fill="#F25022" d="M1 1h10v10H1z"/><path fill="#7FBA00" d="M13 1h10v10H13z"/><path fill="#00A4EF" d="M1 13h10v10H1z"/><path fill="#FFB900" d="M13 13h10v10H13z"/>`
2720
2865
  ),
2721
- discord: w(
2866
+ discord: x(
2722
2867
  h`<path fill="#5865F2" d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"/>`
2723
2868
  ),
2724
- gitlab: w(
2869
+ gitlab: x(
2725
2870
  h`<path fill="#FC6D26" d="m23.6 9.593-.033-.086L20.3.98a.851.851 0 0 0-.336-.405.876.876 0 0 0-1.001.054.874.874 0 0 0-.29.44l-2.205 6.748H7.535L5.33 1.069a.857.857 0 0 0-.29-.441.876.876 0 0 0-1.001-.054.86.86 0 0 0-.336.405L.436 9.502l-.032.086a6.066 6.066 0 0 0 2.012 7.01l.011.009.03.021 4.976 3.727 2.462 1.863 1.5 1.132a1.009 1.009 0 0 0 1.22 0l1.5-1.132 2.461-1.863 5.006-3.75.013-.01a6.068 6.068 0 0 0 2.006-7.002z"/>`
2726
2871
  ),
2727
- linkedin: w(
2872
+ linkedin: x(
2728
2873
  h`<path fill="#0A66C2" d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/>`
2729
2874
  ),
2730
- slack: w(
2875
+ slack: x(
2731
2876
  h`<path fill="#E01E5A" d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313z"/><path fill="#36C5F0" d="M8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312z"/><path fill="#2EB67D" d="M18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.163 0a2.528 2.528 0 0 1 2.523 2.522v6.312z"/><path fill="#ECB22E" d="M15.163 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.163 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.315A2.527 2.527 0 0 1 24 15.163a2.528 2.528 0 0 1-2.522 2.523h-6.315z"/>`
2732
2877
  ),
2733
- twitch: w(
2878
+ twitch: x(
2734
2879
  h`<path fill="#9146FF" d="M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0 1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"/>`
2735
2880
  ),
2736
- spotify: w(
2881
+ spotify: x(
2737
2882
  h`<path fill="#1DB954" d="M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"/>`
2738
2883
  ),
2739
- notion: w(
2884
+ notion: x(
2740
2885
  h`<path fill="currentColor" d="M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"/>`
2741
2886
  ),
2742
- dropbox: w(
2887
+ dropbox: x(
2743
2888
  h`<path fill="#0061FF" d="M6 1.807 0 5.629l6 3.822 6.001-3.822L6 1.807zm12 0-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zm18-3.822-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z"/>`
2744
2889
  ),
2745
- figma: w(
2890
+ figma: x(
2746
2891
  h`<path fill="#F24E1E" d="M8 24a4 4 0 0 0 4-4v-4H8a4 4 0 0 0 0 8z"/><path fill="#A259FF" d="M4 12a4 4 0 0 1 4-4h4v8H8a4 4 0 0 1-4-4z"/><path fill="#FF7262" d="M4 4a4 4 0 0 1 4-4h4v8H8a4 4 0 0 1-4-4z"/><path fill="#1ABCFE" d="M12 0h4a4 4 0 0 1 0 8h-4V0z"/><path fill="#0ACF83" d="M20 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0z"/>`
2747
2892
  ),
2748
- bitbucket: w(
2893
+ bitbucket: x(
2749
2894
  h`<path fill="#2684FF" d="M.778 1.213a.768.768 0 0 0-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 0 0 .77-.646l3.27-20.03a.768.768 0 0 0-.768-.891zM14.52 15.53H9.522L8.17 8.466h7.561z"/>`
2750
2895
  ),
2751
- amazon: w(
2896
+ amazon: x(
2752
2897
  h`<path fill="currentColor" d="M.045 18.02c.072-.116.187-.124.348-.022 3.636 2.11 7.594 3.166 11.87 3.166 2.852 0 5.668-.533 8.447-1.595l.315-.14c.138-.06.234-.1.293-.13.226-.088.39-.046.525.13.12.174.09.336-.12.48-.256.19-.6.41-1.006.654-1.244.743-2.64 1.316-4.185 1.726a17.617 17.617 0 0 1-10.951-.577 17.88 17.88 0 0 1-5.43-3.35c-.1-.074-.151-.15-.151-.22 0-.047.021-.09.051-.13zm6.565-6.218c0-1.005.247-1.863.743-2.577.495-.71 1.17-1.25 2.04-1.615.796-.335 1.756-.575 2.912-.72.39-.046 1.033-.103 1.92-.174v-.37c0-.93-.105-1.558-.3-1.875-.302-.43-.78-.65-1.44-.65h-.182c-.48.046-.896.196-1.246.46-.35.27-.575.63-.675 1.096-.06.3-.206.465-.435.51l-2.52-.315c-.248-.06-.372-.18-.372-.39 0-.046.007-.09.022-.15.247-1.29.855-2.25 1.82-2.88.976-.616 2.1-.975 3.39-1.05h.54c1.65 0 2.957.434 3.888 1.29.135.15.27.3.405.48.12.165.224.314.283.45.075.134.15.33.195.57.06.254.105.42.135.51.03.104.062.3.076.615.01.313.02.493.02.553v5.28c0 .376.06.72.165 1.036.105.313.21.54.315.674l.51.674c.09.136.136.256.136.36 0 .12-.06.226-.18.314-1.2 1.05-1.86 1.62-1.963 1.71-.165.135-.373.15-.61.045a6.62 6.62 0 0 1-.526-.496l-.31-.347a9.858 9.858 0 0 1-.317-.42l-.3-.435c-.81.886-1.603 1.44-2.4 1.665-.494.15-1.093.227-1.83.227-1.11 0-2.04-.343-2.76-1.034-.72-.69-1.08-1.665-1.08-2.94l-.05-.076zm3.753-.438c0 .566.14 1.02.425 1.364.285.34.675.512 1.155.512.045 0 .106-.007.195-.02.09-.016.134-.023.166-.023.614-.16 1.08-.553 1.424-1.178.165-.28.285-.58.36-.91.09-.32.12-.59.135-.8.015-.195.015-.54.015-1.005v-.54c-.84 0-1.484.06-1.92.18-1.275.36-1.92 1.17-1.92 2.43l-.035-.01zm9.162 7.027c.03-.06.075-.11.132-.17.362-.243.714-.41 1.05-.5a8.094 8.094 0 0 1 1.612-.24c.14-.012.28 0 .41.03.65.06 1.05.168 1.172.33.063.09.099.228.099.39v.15c0 .51-.149 1.11-.424 1.8-.278.69-.664 1.248-1.156 1.68-.073.06-.14.09-.197.09-.03 0-.06 0-.09-.012-.09-.044-.107-.12-.064-.24.54-1.26.806-2.143.806-2.64 0-.15-.03-.27-.087-.344-.145-.166-.55-.257-1.224-.257-.243 0-.533.016-.87.045-.363.045-.7.09-1 .135-.09 0-.148-.014-.18-.044-.03-.03-.036-.06-.02-.106 0-.014.007-.03.02-.06z"/>`
2753
2898
  ),
2754
- paypal: w(
2899
+ paypal: x(
2755
2900
  h`<path fill="#003087" d="M7.076 21.337H2.47a.641.641 0 0 1-.633-.74L4.944.901C5.026.382 5.474 0 5.998 0h7.46c2.57 0 4.578.543 5.69 1.81 1.01 1.15 1.304 2.42 1.012 4.287-.023.143-.047.288-.077.437-.983 5.05-4.349 6.797-8.647 6.797h-2.19c-.524 0-.968.382-1.05.9l-1.12 7.106zm14.146-14.42a3.35 3.35 0 0 0-.607-.541c-.013.076-.026.175-.041.254-.93 4.778-4.005 7.201-9.138 7.201h-2.19a.563.563 0 0 0-.556.479l-1.187 7.527h-.506l-.24 1.516a.56.56 0 0 0 .554.647h3.882c.46 0 .85-.334.922-.788.06-.26.76-4.852.816-5.09a.932.932 0 0 1 .923-.788h.58c3.76 0 6.705-1.528 7.565-5.946.36-1.847.174-3.388-.777-4.471z"/>`
2756
2901
  )
2757
2902
  };
2758
- function et(e) {
2903
+ function Y(e) {
2759
2904
  return Wt[e] ?? l.globe;
2760
2905
  }
2761
2906
  function nt(e) {
2762
2907
  const t = (e.trim()[0] ?? "?").toUpperCase();
2763
2908
  return /[A-Z0-9]/i.test(t) ? t : l.user;
2764
2909
  }
2765
- function Y(e) {
2910
+ function Z(e) {
2766
2911
  typeof document > "u" || (document.querySelector("authui-modal") || document.body.appendChild(document.createElement("authui-modal")), queueMicrotask(() => {
2767
2912
  window.dispatchEvent(new CustomEvent("authui:open", { detail: { view: e } }));
2768
2913
  }));
@@ -2793,21 +2938,21 @@ var Kt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, C = (e, t,
2793
2938
  };
2794
2939
  let k = class extends E {
2795
2940
  constructor() {
2796
- super(...arguments), this.view = "sign-in", this.embedded = !1, this.step = "sign-in", this.busy = !1, this.error = "", this.notice = null, this.showPassword = !1, this.token = null, this.focusOnStep = !1, this.resendCooldownUntil = 0, this.challenge = null, this.recovery = null, this.email = "", this.password = "", this.passwordConfirm = "", this.name = "", this.phone = "", this.code = "", this.onSignIn = (e) => {
2941
+ super(...arguments), this.view = "sign-in", this.embedded = !1, this.step = "sign-in", this.busy = !1, this.error = "", this.notice = null, this.showPassword = !1, this.expandedOAuth = null, this.token = null, this.focusOnStep = !1, this.resendCooldownUntil = 0, this.challenge = null, this.recovery = null, this.email = "", this.password = "", this.passwordConfirm = "", this.name = "", this.phone = "", this.code = "", this.onSignIn = (e) => {
2797
2942
  e.preventDefault(), this.requireValid(e) && this.run(async () => {
2798
- await n.signInWithEmailPassword(this.email, this.password), this.password = "", V("email-password"), this.fire("authui-success", { method: "email-password" });
2943
+ await o.signInWithEmailPassword(this.email, this.password), this.password = "", V("email-password"), this.fire("authui-success", { method: "email-password" });
2799
2944
  });
2800
2945
  }, this.onSignUp = (e) => {
2801
2946
  e.preventDefault(), this.requireValid(e) && this.run(async () => {
2802
- await n.signUp(this.email, this.password, this.name), this.password = "", V("email-password"), this.fire("authui-success", { method: "sign-up" });
2947
+ await o.signUp(this.email, this.password, this.name), this.password = "", V("email-password"), this.fire("authui-success", { method: "sign-up" });
2803
2948
  });
2804
2949
  }, this.onGuest = () => {
2805
2950
  this.run(async () => {
2806
- await n.signInAnonymously(), V("anonymous"), this.fire("authui-success", { method: "anonymous" });
2951
+ await o.signInAnonymously(), V("anonymous"), this.fire("authui-success", { method: "anonymous" });
2807
2952
  });
2808
2953
  }, this.onOAuth = (e) => {
2809
2954
  this.run(async () => {
2810
- if (Ot(e), await n.signInWithOAuth(e), n.isPreview) {
2955
+ if (Ot(e), await o.signInWithOAuth(e), o.isPreview) {
2811
2956
  wt(), this.fire("authui-success", { method: "oauth" });
2812
2957
  return;
2813
2958
  }
@@ -2815,7 +2960,7 @@ let k = class extends E {
2815
2960
  });
2816
2961
  }, this.onForgot = (e) => {
2817
2962
  e.preventDefault(), this.requireValid(e) && this.run(async () => {
2818
- await n.sendPasswordRecovery(this.email), this.notice = { tone: "success", message: this.t("resetLinkSent", { email: this.email }) };
2963
+ await o.sendPasswordRecovery(this.email), this.notice = { tone: "success", message: this.t("resetLinkSent", { email: this.email }) };
2819
2964
  });
2820
2965
  }, this.onReset = (e) => {
2821
2966
  if (e.preventDefault(), !this.requireValid(e)) return;
@@ -2825,11 +2970,11 @@ let k = class extends E {
2825
2970
  }
2826
2971
  const t = this.recovery;
2827
2972
  t && this.run(async () => {
2828
- await n.completePasswordRecovery(t.userId, t.secret, this.password), this.password = "", this.passwordConfirm = "", this.recovery = null, this.auth.pending?.type === "reset-password" && n.setPending(null), this.go("sign-in"), this.notice = { tone: "success", message: this.t("passwordUpdated") };
2973
+ await o.completePasswordRecovery(t.userId, t.secret, this.password), this.password = "", this.passwordConfirm = "", this.recovery = null, this.auth.pending?.type === "reset-password" && o.setPending(null), this.go("sign-in"), this.notice = { tone: "success", message: this.t("passwordUpdated") };
2829
2974
  });
2830
2975
  }, this.onMagicUrl = (e) => {
2831
2976
  e.preventDefault(), this.requireValid(e) && this.run(async () => {
2832
- const t = await n.sendMagicUrl(this.email);
2977
+ const t = await o.sendMagicUrl(this.email);
2833
2978
  this.token = {
2834
2979
  userId: t.userId,
2835
2980
  kind: "magic-url",
@@ -2839,7 +2984,7 @@ let k = class extends E {
2839
2984
  });
2840
2985
  }, this.onEmailOtp = (e) => {
2841
2986
  e.preventDefault(), this.requireValid(e) && this.run(async () => {
2842
- const t = await n.sendEmailOtp(this.email);
2987
+ const t = await o.sendEmailOtp(this.email);
2843
2988
  this.token = {
2844
2989
  userId: t.userId,
2845
2990
  kind: "email-otp",
@@ -2849,37 +2994,37 @@ let k = class extends E {
2849
2994
  });
2850
2995
  }, this.onPhoneOtp = (e) => {
2851
2996
  e.preventDefault(), this.requireValid(e) && this.run(async () => {
2852
- const t = await n.sendPhoneOtp(this.phone);
2997
+ const t = await o.sendPhoneOtp(this.phone);
2853
2998
  this.token = { userId: t.userId, kind: "phone", target: this.phone }, this.code = "";
2854
2999
  });
2855
3000
  }, this.onVerifyCode = (e) => {
2856
3001
  if (e.preventDefault(), !this.requireValid(e)) return;
2857
3002
  const t = this.token;
2858
3003
  t && this.run(async () => {
2859
- await n.signInWithToken(t.userId, this.code), this.code = "", this.token = null, V(t.kind), this.fire("authui-success", { method: t.kind });
3004
+ await o.signInWithToken(t.userId, this.code), this.code = "", this.token = null, V(t.kind), this.fire("authui-success", { method: t.kind });
2860
3005
  }, "code");
2861
3006
  }, this.onChooseFactor = (e) => {
2862
3007
  this.run(async () => {
2863
- const t = await n.createMfaChallenge(e);
3008
+ const t = await o.createMfaChallenge(e);
2864
3009
  this.challenge = { id: t.$id, factor: e }, this.code = "";
2865
3010
  });
2866
3011
  }, this.onVerifyFactor = (e) => {
2867
3012
  if (e.preventDefault(), !this.requireValid(e)) return;
2868
3013
  const t = this.challenge;
2869
3014
  t && this.run(async () => {
2870
- await n.completeMfaChallenge(t.id, this.code), this.code = "", this.challenge = null, this.go("sign-in"), this.fire("authui-success", { method: "mfa" });
3015
+ await o.completeMfaChallenge(t.id, this.code), this.code = "", this.challenge = null, this.go("sign-in"), this.fire("authui-success", { method: "mfa" });
2871
3016
  }, "code");
2872
3017
  }, this.onCancelMfa = () => {
2873
3018
  this.run(async () => {
2874
3019
  try {
2875
- await n.signOut();
3020
+ await o.signOut();
2876
3021
  } catch (e) {
2877
- if (!N(e, f.sessionNotFound)) throw e;
3022
+ if (!q(e, f.sessionNotFound)) throw e;
2878
3023
  }
2879
3024
  this.go("sign-in");
2880
3025
  });
2881
3026
  }, this.onSignOut = () => {
2882
- this.run(() => n.signOut());
3027
+ this.run(() => o.signOut());
2883
3028
  };
2884
3029
  }
2885
3030
  connectedCallback() {
@@ -2903,7 +3048,7 @@ let k = class extends E {
2903
3048
  }
2904
3049
  /** Navigate between screens and reset transient state. */
2905
3050
  dismissNotice() {
2906
- this.notice = null, this.auth.pending?.type === "notice" && n.setPending(null);
3051
+ this.notice = null, this.auth.pending?.type === "notice" && o.setPending(null);
2907
3052
  }
2908
3053
  go(e) {
2909
3054
  e === "sign-up" && this.config?.signUp === !1 && (e = "sign-in"), this.focusOnStep = !0, this.step = e, this.error = "", this.notice = null, this.busy = !1, this.showPassword = !1, this.password = "", this.passwordConfirm = "", e !== "mfa" && (this.challenge = null), e !== "email-otp" && e !== "phone" && e !== "magic-url" && (this.token = null), this.fire("authui-view", { view: e });
@@ -2947,7 +3092,7 @@ let k = class extends E {
2947
3092
  >
2948
3093
  ${l.x}
2949
3094
  </button>
2950
- </div>` : o}
3095
+ </div>` : n}
2951
3096
  ${e}
2952
3097
  </div>
2953
3098
  `;
@@ -2989,10 +3134,10 @@ let k = class extends E {
2989
3134
  @error=${(a) => {
2990
3135
  a.target.hidden = !0;
2991
3136
  }}
2992
- />` : o}
2993
- ${n.isPreview ? r`<span class="badge badge-info preview">${this.t("preview")}</span>` : o}
3137
+ />` : n}
3138
+ ${o.isPreview ? r`<span class="badge badge-info preview">${this.t("preview")}</span>` : n}
2994
3139
  <h2 class="title" id="authui-title">${i}</h2>
2995
- ${s ? r`<p class="description">${s}</p>` : o}
3140
+ ${s ? r`<p class="description">${s}</p>` : n}
2996
3141
  </div>
2997
3142
  `;
2998
3143
  }
@@ -3000,11 +3145,11 @@ let k = class extends E {
3000
3145
  return this.error ? r`<div class="alert alert-error" role="alert">
3001
3146
  ${l.alert}
3002
3147
  <div class="alert-body">${this.error}</div>
3003
- </div>` : o;
3148
+ </div>` : n;
3004
3149
  }
3005
3150
  submitButton(e, t = "btn-primary") {
3006
3151
  return r`<button class="btn ${t} btn-block" type="submit" ?disabled=${this.busy}>
3007
- ${this.busy ? r`<span class="spinner" aria-hidden="true"></span>` : o} ${e}
3152
+ ${this.busy ? r`<span class="spinner" aria-hidden="true"></span>` : n} ${e}
3008
3153
  </button>`;
3009
3154
  }
3010
3155
  passwordField(e) {
@@ -3019,7 +3164,7 @@ let k = class extends E {
3019
3164
  @click=${() => this.go("forgot-password")}
3020
3165
  >
3021
3166
  ${this.t("forgotPassword")}
3022
- </button>` : o}
3167
+ </button>` : n}
3023
3168
  </div>
3024
3169
  <div class="input-wrap">
3025
3170
  <input
@@ -3055,7 +3200,7 @@ let k = class extends E {
3055
3200
  <span></span><span></span><span></span><span></span>
3056
3201
  </div>
3057
3202
  <p class="strength-label">${this.t(i.labelKey)}</p>
3058
- </div>` : e.hint ? r`<p class="hint">${e.hint}</p>` : o}
3203
+ </div>` : e.hint ? r`<p class="hint">${e.hint}</p>` : n}
3059
3204
  </div>
3060
3205
  `;
3061
3206
  }
@@ -3097,11 +3242,11 @@ let k = class extends E {
3097
3242
  }
3098
3243
  legal() {
3099
3244
  const e = this.config?.legal;
3100
- return !e?.termsUrl && !e?.privacyUrl ? o : r`<p class="legal">
3245
+ return !e?.termsUrl && !e?.privacyUrl ? n : r`<p class="legal">
3101
3246
  ${this.t("agreeTo")}
3102
- ${e.termsUrl ? r`<a href=${e.termsUrl} target="_blank" rel="noopener">${this.t("terms")}</a>` : o}
3103
- ${e.termsUrl && e.privacyUrl ? r` ${this.t("and")} ` : o}
3104
- ${e.privacyUrl ? r`<a href=${e.privacyUrl} target="_blank" rel="noopener">${this.t("privacy")}</a>` : o}.
3247
+ ${e.termsUrl ? r`<a href=${e.termsUrl} target="_blank" rel="noopener">${this.t("terms")}</a>` : n}
3248
+ ${e.termsUrl && e.privacyUrl ? r` ${this.t("and")} ` : n}
3249
+ ${e.privacyUrl ? r`<a href=${e.privacyUrl} target="_blank" rel="noopener">${this.t("privacy")}</a>` : n}.
3105
3250
  </p>`;
3106
3251
  }
3107
3252
  backLink(e = "sign-in") {
@@ -3153,7 +3298,7 @@ let k = class extends E {
3153
3298
  <span class="avatar">${nt(t)}</span>
3154
3299
  <div class="row-main">
3155
3300
  <span class="row-title" title=${t}>${t}</span>
3156
- ${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : o}
3301
+ ${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : n}
3157
3302
  </div>
3158
3303
  </div>
3159
3304
  </div>
@@ -3161,11 +3306,11 @@ let k = class extends E {
3161
3306
  <div class="stack-sm">
3162
3307
  ${this.config?.successUrl ? r`<a class="btn btn-primary btn-block" href=${this.config.successUrl}
3163
3308
  >${this.t("continue")}</a
3164
- >` : o}
3309
+ >` : n}
3165
3310
  <button
3166
3311
  class="btn btn-outline btn-block"
3167
3312
  @click=${() => {
3168
- this.embedded ? this.fire("authui-open", { view: "account" }) : Y("account");
3313
+ this.embedded ? this.fire("authui-open", { view: "account" }) : Z("account");
3169
3314
  }}
3170
3315
  >
3171
3316
  ${l.settings} ${this.t("manageAccount")}
@@ -3179,30 +3324,68 @@ let k = class extends E {
3179
3324
  }
3180
3325
  renderProviders() {
3181
3326
  const e = [...this.config?.methods?.oauth ?? []];
3182
- if (e.length === 0) return o;
3183
- const t = D();
3184
- e.sort((s, a) => {
3185
- const c = t === `oauth:${s}` ? 0 : 1, u = t === `oauth:${a}` ? 0 : 1;
3186
- return c - u;
3187
- });
3188
- const i = e.length > 2;
3327
+ if (e.length === 0) return n;
3328
+ const t = z(), i = e.find((a) => t === `oauth:${a}`) ?? null;
3329
+ if (e.length <= 2) {
3330
+ const a = [...e].sort((c, u) => {
3331
+ const b = t === `oauth:${c}` ? 0 : 1, $ = t === `oauth:${u}` ? 0 : 1;
3332
+ return b - $;
3333
+ });
3334
+ return r`
3335
+ <div class="providers">
3336
+ ${a.map((c) => {
3337
+ const u = t === `oauth:${c}`, b = this.t("continueWith", { provider: W(c) });
3338
+ return r`<button
3339
+ type="button"
3340
+ class="btn btn-outline ${u ? "last-used" : ""}"
3341
+ @click=${() => this.onOAuth(c)}
3342
+ ?disabled=${this.busy}
3343
+ aria-label=${u ? `${b}. ${this.t("lastUsed")}` : b}
3344
+ >
3345
+ ${Y(c)}
3346
+ <span>${b}</span>
3347
+ ${u ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : n}
3348
+ </button>`;
3349
+ })}
3350
+ </div>
3351
+ `;
3352
+ }
3353
+ const s = this.expandedOAuth && e.includes(this.expandedOAuth) ? this.expandedOAuth : i ?? e[0];
3189
3354
  return r`
3190
- <div class="providers ${i ? "two" : ""}">
3191
- ${e.map((s) => {
3192
- const a = t === `oauth:${s}`;
3193
- return r`<button
3194
- type="button"
3195
- class="btn btn-outline ${a ? "last-used" : ""}"
3196
- @click=${() => this.onOAuth(s)}
3197
- ?disabled=${this.busy}
3198
- aria-label=${this.t("continueWith", { provider: q(s) })}
3355
+ <div
3356
+ class="providers accordion"
3357
+ @mouseleave=${() => {
3358
+ this.expandedOAuth = i ?? e[0];
3359
+ }}
3360
+ >
3361
+ ${e.map((a) => {
3362
+ const c = t === `oauth:${a}`, u = s === a, b = this.t("continueWith", { provider: W(a) });
3363
+ return r`<div
3364
+ class="provider-slot ${u ? "is-expanded" : ""}"
3365
+ @mouseenter=${() => {
3366
+ this.expandedOAuth = a;
3367
+ }}
3199
3368
  >
3200
- ${et(s)}
3201
- <span
3202
- >${i ? q(s) : this.t("continueWith", { provider: q(s) })}</span
3369
+ <button
3370
+ type="button"
3371
+ class="btn btn-outline"
3372
+ @click=${() => this.onOAuth(a)}
3373
+ @focus=${() => {
3374
+ this.expandedOAuth = a;
3375
+ }}
3376
+ ?disabled=${this.busy}
3377
+ aria-label=${c ? `${b}. ${this.t("lastUsed")}` : b}
3203
3378
  >
3204
- ${a ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : o}
3205
- </button>`;
3379
+ ${Y(a)}
3380
+ <span class="provider-label"
3381
+ ><span><span class="provider-label-text">${b}</span></span></span
3382
+ >
3383
+ ${c ? r`<span class="oauth-last-used" data-last-used=${a} aria-hidden="true">
3384
+ <span class="oauth-last-used-dot"></span>
3385
+ <span class="oauth-last-used-pill">${this.t("lastUsed")}</span>
3386
+ </span>` : n}
3387
+ </button>
3388
+ </div>`;
3206
3389
  })}
3207
3390
  </div>
3208
3391
  `;
@@ -3216,47 +3399,47 @@ let k = class extends E {
3216
3399
  return r`
3217
3400
  <div class="stack">
3218
3401
  ${this.renderProviders()}
3219
- ${i && (t || s.length > 0) ? r`<div class="separator-text">${this.t("or")}</div>` : o}
3402
+ ${i && (t || s.length > 0) ? r`<div class="separator-text">${this.t("or")}</div>` : n}
3220
3403
  ${t ? r`<form
3221
- class="form ${D() === "email-password" ? "last-used-form" : ""}"
3404
+ class="form ${z() === "email-password" ? "last-used-form" : ""}"
3222
3405
  @submit=${this.onSignIn}
3223
3406
  novalidate
3224
3407
  >
3225
- ${D() === "email-password" ? r`<p class="hint">
3408
+ ${z() === "email-password" ? r`<p class="hint">
3226
3409
  <span class="last-used-badge">${this.t("lastUsed")}</span>
3227
- </p>` : o}
3410
+ </p>` : n}
3228
3411
  ${this.emailField()}
3229
3412
  ${this.passwordField({ label: this.t("password"), autocomplete: "current-password", id: "authui-password", field: "password", forgot: !0 })}
3230
3413
  ${this.renderError()} ${this.submitButton(this.t("signIn"))}
3231
3414
  </form>` : this.renderError()}
3232
3415
  ${s.length > 0 ? r`<div class="stack-sm">
3233
3416
  ${s.map((a) => {
3234
- const c = D() === a.step;
3417
+ const c = z() === a.step;
3235
3418
  return r`<button
3236
3419
  type="button"
3237
3420
  class="btn btn-secondary btn-block ${c ? "last-used" : ""}"
3238
3421
  @click=${() => this.go(a.step)}
3239
3422
  >
3240
3423
  ${a.icon} ${a.label}
3241
- ${c ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : o}
3424
+ ${c ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : n}
3242
3425
  </button>`;
3243
3426
  })}
3244
- </div>` : o}
3427
+ </div>` : n}
3245
3428
  ${e.anonymous ? r`<button
3246
3429
  type="button"
3247
- class="btn btn-ghost btn-block ${D() === "anonymous" ? "last-used" : ""}"
3430
+ class="btn btn-ghost btn-block ${z() === "anonymous" ? "last-used" : ""}"
3248
3431
  @click=${this.onGuest}
3249
3432
  ?disabled=${this.busy}
3250
3433
  >
3251
3434
  ${l.ghost} ${this.t("continueAsGuest")}
3252
- ${D() === "anonymous" ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : o}
3253
- </button>` : o}
3435
+ ${z() === "anonymous" ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : n}
3436
+ </button>` : n}
3254
3437
  ${t && this.config?.signUp !== !1 ? r`<div class="links">
3255
3438
  <span>${this.t("noAccount")}</span>
3256
3439
  <button type="button" class="btn btn-link" @click=${() => this.go("sign-up")}>
3257
3440
  ${this.t("signUp")}
3258
3441
  </button>
3259
- </div>` : o}
3442
+ </div>` : n}
3260
3443
  ${this.legal()}
3261
3444
  </div>
3262
3445
  `;
@@ -3265,7 +3448,7 @@ let k = class extends E {
3265
3448
  return r`
3266
3449
  <div class="stack">
3267
3450
  ${this.renderProviders()}
3268
- ${(this.config?.methods?.oauth?.length ?? 0) > 0 ? r`<div class="separator-text">${this.t("or")}</div>` : o}
3451
+ ${(this.config?.methods?.oauth?.length ?? 0) > 0 ? r`<div class="separator-text">${this.t("or")}</div>` : n}
3269
3452
  <form class="form" @submit=${this.onSignUp} novalidate>
3270
3453
  ${this.config?.requireName !== !1 ? r`<div class="field">
3271
3454
  <label class="label" for="authui-name">${this.t("name")}</label>
@@ -3278,7 +3461,7 @@ let k = class extends E {
3278
3461
  .value=${this.name}
3279
3462
  @input=${this.bind("name")}
3280
3463
  />
3281
- </div>` : o}
3464
+ </div>` : n}
3282
3465
  ${this.emailField()}
3283
3466
  ${this.passwordField({ label: this.t("password"), autocomplete: "new-password", id: "authui-password", field: "password", hint: this.t("passwordHint"), meter: !0 })}
3284
3467
  ${this.renderError()} ${this.submitButton(this.t("createAccount"))}
@@ -3348,7 +3531,7 @@ let k = class extends E {
3348
3531
  ${this.t("securityPhrase")}: <span class="code">${e}</span>
3349
3532
  </div>
3350
3533
  <div class="alert-body">${this.t("securityPhraseHint")}</div>
3351
- </div>` : o;
3534
+ </div>` : n;
3352
3535
  }
3353
3536
  renderMagicUrl() {
3354
3537
  return this.token ? r`<div class="stack">
@@ -3370,10 +3553,10 @@ let k = class extends E {
3370
3553
  const e = this.token;
3371
3554
  !e || Date.now() < this.resendCooldownUntil || (this.error = "", await this.run(async () => {
3372
3555
  if (e.kind === "phone") {
3373
- const t = await n.sendPhoneOtp(e.target);
3556
+ const t = await o.sendPhoneOtp(e.target);
3374
3557
  this.token = { userId: t.userId, kind: "phone", target: e.target };
3375
3558
  } else {
3376
- const t = await n.sendEmailOtp(e.target);
3559
+ const t = await o.sendEmailOtp(e.target);
3377
3560
  this.token = {
3378
3561
  userId: t.userId,
3379
3562
  kind: "email-otp",
@@ -3557,6 +3740,9 @@ C([
3557
3740
  C([
3558
3741
  d()
3559
3742
  ], k.prototype, "showPassword", 2);
3743
+ C([
3744
+ d()
3745
+ ], k.prototype, "expandedOAuth", 2);
3560
3746
  C([
3561
3747
  d()
3562
3748
  ], k.prototype, "token", 2);
@@ -3573,7 +3759,7 @@ C([
3573
3759
  st("form input:not([type=hidden])")
3574
3760
  ], k.prototype, "firstInput", 2);
3575
3761
  k = C([
3576
- R("authui-sign-in")
3762
+ T("authui-sign-in")
3577
3763
  ], k);
3578
3764
  var Yt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, m = (e, t, i, s) => {
3579
3765
  for (var a = s > 1 ? void 0 : s ? Zt(t, i) : t, c = e.length - 1, u; c >= 0; c--)
@@ -3597,12 +3783,12 @@ let p = class extends E {
3597
3783
  const a = t[s].id.replace("authui-tab-", "");
3598
3784
  this.select(a), requestAnimationFrame(() => t[s]?.focus());
3599
3785
  }, this.noticeTimer = null, this.factorsLoading = !1, this.onUpdateName = (e) => {
3600
- e.preventDefault(), this.requireValid(e) && this.run("name", () => n.updateName(this.nameInput), this.t("nameUpdated"));
3786
+ e.preventDefault(), this.requireValid(e) && this.run("name", () => o.updateName(this.nameInput), this.t("nameUpdated"));
3601
3787
  }, this.onUpdateEmail = (e) => {
3602
3788
  e.preventDefault(), this.requireValid(e) && this.run(
3603
3789
  "email",
3604
3790
  async () => {
3605
- await n.updateEmail(this.emailInput, this.emailPassword), this.emailPassword = "";
3791
+ await o.updateEmail(this.emailInput, this.emailPassword), this.emailPassword = "";
3606
3792
  },
3607
3793
  this.t("emailUpdated")
3608
3794
  );
@@ -3610,7 +3796,7 @@ let p = class extends E {
3610
3796
  e.preventDefault(), this.requireValid(e) && this.run(
3611
3797
  "phone",
3612
3798
  async () => {
3613
- await n.updatePhone(this.phoneInput, this.phonePassword), this.phonePassword = "";
3799
+ await o.updatePhone(this.phoneInput, this.phonePassword), this.phonePassword = "";
3614
3800
  },
3615
3801
  this.t("phoneUpdated")
3616
3802
  );
@@ -3618,7 +3804,7 @@ let p = class extends E {
3618
3804
  e.preventDefault(), this.requireValid(e) && this.run(
3619
3805
  "guest",
3620
3806
  async () => {
3621
- await n.convertGuest(this.emailInput, this.emailPassword, this.guestName), this.emailPassword = "";
3807
+ await o.convertGuest(this.emailInput, this.emailPassword, this.guestName), this.emailPassword = "";
3622
3808
  },
3623
3809
  this.t("accountConverted")
3624
3810
  );
@@ -3626,19 +3812,19 @@ let p = class extends E {
3626
3812
  Date.now() < this.verifyEmailCooldownUntil || this.run(
3627
3813
  "verify",
3628
3814
  async () => {
3629
- await n.sendEmailVerification(), this.startVerifyEmailCooldown();
3815
+ await o.sendEmailVerification(), this.startVerifyEmailCooldown();
3630
3816
  },
3631
3817
  this.t("verificationSent")
3632
3818
  );
3633
3819
  }, this.onSendPhoneVerification = () => {
3634
3820
  this.run("verify-phone", async () => {
3635
- await n.sendPhoneVerification(), this.phoneCodeSent = !0;
3821
+ await o.sendPhoneVerification(), this.phoneCodeSent = !0;
3636
3822
  });
3637
3823
  }, this.onConfirmPhoneVerification = (e) => {
3638
3824
  e.preventDefault(), this.requireValid(e) && this.run(
3639
3825
  "verify-phone-code",
3640
3826
  async () => {
3641
- await n.confirmPhoneVerification(this.phoneCode), this.phoneCode = "", this.phoneCodeSent = !1;
3827
+ await o.confirmPhoneVerification(this.phoneCode), this.phoneCode = "", this.phoneCodeSent = !1;
3642
3828
  },
3643
3829
  this.t("phoneVerified")
3644
3830
  );
@@ -3651,7 +3837,7 @@ let p = class extends E {
3651
3837
  this.run(
3652
3838
  "password",
3653
3839
  async () => {
3654
- await n.updatePassword(this.newPassword, this.oldPassword), this.oldPassword = this.newPassword = this.newPasswordConfirm = "";
3840
+ await o.updatePassword(this.newPassword, this.oldPassword), this.oldPassword = this.newPassword = this.newPasswordConfirm = "";
3655
3841
  },
3656
3842
  this.t("passwordChanged")
3657
3843
  );
@@ -3659,17 +3845,17 @@ let p = class extends E {
3659
3845
  }, this.onToggleMfa = () => {
3660
3846
  const e = !this.user?.mfa;
3661
3847
  this.run("mfa", async () => {
3662
- await n.setMfaEnabled(e), await this.loadFactors();
3848
+ await o.setMfaEnabled(e), await this.loadFactors();
3663
3849
  });
3664
3850
  }, this.onAddAuthenticator = () => {
3665
3851
  this.run("authenticator", async () => {
3666
- this.authenticator = await n.addAuthenticator(), this.authenticatorCode = "";
3852
+ this.authenticator = await o.addAuthenticator(), this.authenticatorCode = "";
3667
3853
  });
3668
3854
  }, this.onVerifyAuthenticator = (e) => {
3669
3855
  e.preventDefault(), this.requireValid(e) && this.run(
3670
3856
  "authenticator-code",
3671
3857
  async () => {
3672
- await n.verifyAuthenticator(this.authenticatorCode), this.authenticator = null, this.authenticatorCode = "", await this.loadFactors();
3858
+ await o.verifyAuthenticator(this.authenticatorCode), this.authenticator = null, this.authenticatorCode = "", await this.loadFactors();
3673
3859
  },
3674
3860
  this.t("authenticatorAdded")
3675
3861
  );
@@ -3679,15 +3865,15 @@ let p = class extends E {
3679
3865
  return;
3680
3866
  }
3681
3867
  this.confirmRemoveAuthenticator = !1, this.run("remove-authenticator", async () => {
3682
- await n.removeAuthenticator(), await this.loadFactors();
3868
+ await o.removeAuthenticator(), await this.loadFactors();
3683
3869
  });
3684
3870
  }, this.onRecoveryCodes = () => {
3685
3871
  this.run("recovery", async () => {
3686
3872
  try {
3687
- this.recoveryCodes = await n.createRecoveryCodes();
3873
+ this.recoveryCodes = await o.createRecoveryCodes();
3688
3874
  } catch (e) {
3689
- if (!N(e, f.recoveryCodesExist)) throw e;
3690
- this.recoveryCodes = await n.getRecoveryCodes();
3875
+ if (!q(e, f.recoveryCodesExist)) throw e;
3876
+ this.recoveryCodes = await o.getRecoveryCodes();
3691
3877
  }
3692
3878
  await this.loadFactors();
3693
3879
  });
@@ -3697,7 +3883,7 @@ let p = class extends E {
3697
3883
  return;
3698
3884
  }
3699
3885
  this.confirmRegenerate = !1, this.run("recovery", async () => {
3700
- this.recoveryCodes = await n.regenerateRecoveryCodes();
3886
+ this.recoveryCodes = await o.regenerateRecoveryCodes();
3701
3887
  });
3702
3888
  }, this.onCopyCodes = async () => {
3703
3889
  if (this.recoveryCodes)
@@ -3717,7 +3903,7 @@ let p = class extends E {
3717
3903
  }
3718
3904
  }, this.onStepUpFactor = (e) => {
3719
3905
  this.run("stepup", async () => {
3720
- const t = await n.createMfaChallenge(e);
3906
+ const t = await o.createMfaChallenge(e);
3721
3907
  this.stepUp = { ...this.stepUp, challenge: { id: t.$id, factor: e } }, this.stepUpCode = "";
3722
3908
  });
3723
3909
  }, this.onStepUpVerify = (e) => {
@@ -3726,33 +3912,33 @@ let p = class extends E {
3726
3912
  t?.challenge && (async () => {
3727
3913
  let i = !1;
3728
3914
  await this.run("stepup-code", async () => {
3729
- await n.completeMfaChallenge(t.challenge.id, this.stepUpCode, { signIn: !1 }), this.stepUp = null, this.stepUpCode = "", i = !0;
3915
+ await o.completeMfaChallenge(t.challenge.id, this.stepUpCode, { signIn: !1 }), this.stepUp = null, this.stepUpCode = "", i = !0;
3730
3916
  }), i && await t.retry();
3731
3917
  })();
3732
3918
  }, this.onDeleteSession = (e) => {
3733
3919
  this.run(`session-${e}`, async () => {
3734
3920
  if ((this.sessions ?? []).some((i) => i.$id === e && i.current)) {
3735
- await n.signOut(), this.sessions = [];
3921
+ await o.signOut(), this.sessions = [];
3736
3922
  return;
3737
3923
  }
3738
- await n.signOut(e), this.sessions = (this.sessions ?? []).filter((i) => i.$id !== e);
3924
+ await o.signOut(e), this.sessions = (this.sessions ?? []).filter((i) => i.$id !== e);
3739
3925
  });
3740
3926
  }, this.onSignOutAll = () => {
3741
3927
  if (!this.confirmSignOutAll) {
3742
3928
  this.confirmSignOutAll = !0;
3743
3929
  return;
3744
3930
  }
3745
- this.confirmSignOutAll = !1, this.run("sessions-all", () => n.signOutEverywhere());
3931
+ this.confirmSignOutAll = !1, this.run("sessions-all", () => o.signOutEverywhere());
3746
3932
  }, this.onDeleteIdentity = (e) => {
3747
3933
  if (this.confirmDisconnectId !== e) {
3748
3934
  this.confirmDisconnectId = e;
3749
3935
  return;
3750
3936
  }
3751
3937
  this.confirmDisconnectId = null, this.run(`identity-${e}`, async () => {
3752
- await n.deleteIdentity(e), this.identities = (this.identities ?? []).filter((t) => t.$id !== e);
3938
+ await o.deleteIdentity(e), this.identities = (this.identities ?? []).filter((t) => t.$id !== e);
3753
3939
  });
3754
3940
  }, this.onDeleteAccount = () => {
3755
- this.run("delete", () => n.deleteAccount());
3941
+ this.run("delete", () => o.deleteAccount());
3756
3942
  };
3757
3943
  }
3758
3944
  connectedCallback() {
@@ -3784,10 +3970,14 @@ let p = class extends E {
3784
3970
  }
3785
3971
  updated(e) {
3786
3972
  e.has("active") && requestAnimationFrame(() => {
3787
- const t = this.renderRoot.querySelector(
3973
+ const i = this.renderRoot.querySelector(
3788
3974
  '.tab[aria-selected="true"]'
3789
3975
  );
3790
- t && typeof t.scrollIntoView == "function" && t.scrollIntoView({ inline: "nearest", block: "nearest", behavior: "smooth" });
3976
+ i && typeof i.scrollIntoView == "function" && i.scrollIntoView({ inline: "nearest", block: "nearest", behavior: "smooth" });
3977
+ }), (e.has("confirmDelete") && this.confirmDelete || e.has("confirmSignOutAll") && this.confirmSignOutAll || e.has("confirmDisconnectId") && this.confirmDisconnectId !== null) && requestAnimationFrame(() => {
3978
+ this.renderRoot.querySelector(
3979
+ ".card-footer [autofocus], .row-actions [autofocus], .inline [autofocus], .card-footer .btn-outline, .row-actions .btn-outline, .inline .btn-outline"
3980
+ )?.focus({ preventScroll: !0 });
3791
3981
  });
3792
3982
  }
3793
3983
  setNotice(e, t) {
@@ -3805,7 +3995,7 @@ let p = class extends E {
3805
3995
  try {
3806
3996
  await t(), i && this.setNotice("success", i);
3807
3997
  } catch (s) {
3808
- N(s, f.challengeRequired) ? this.stepUp = { retry: () => this.run(e, t, i) } : this.errors = {
3998
+ q(s, f.challengeRequired) ? this.stepUp = { retry: () => this.run(e, t, i) } : this.errors = {
3809
3999
  ...this.errors,
3810
4000
  [e]: K(
3811
4001
  s,
@@ -3821,12 +4011,12 @@ let p = class extends E {
3821
4011
  // ─────────────────────────── loaders ───────────────────────────
3822
4012
  async loadSessions() {
3823
4013
  await this.run("sessions", async () => {
3824
- this.sessions = await n.listSessions();
4014
+ this.sessions = await o.listSessions();
3825
4015
  });
3826
4016
  }
3827
4017
  async loadIdentities() {
3828
4018
  await this.run("identities", async () => {
3829
- this.identities = await n.listIdentities();
4019
+ this.identities = await o.listIdentities();
3830
4020
  });
3831
4021
  }
3832
4022
  /** Probe once so Activity is never shown on servers without /account/logs. */
@@ -3834,7 +4024,7 @@ let p = class extends E {
3834
4024
  if (!this.logsProbeStarted) {
3835
4025
  this.logsProbeStarted = !0;
3836
4026
  try {
3837
- this.logs = await n.listLogs(), this.logsSupported = !0;
4027
+ this.logs = await o.listLogs(), this.logsSupported = !0;
3838
4028
  } catch {
3839
4029
  this.logsSupported = !1, this.logs = [], this.active === "activity" && (this.active = "profile");
3840
4030
  }
@@ -3847,7 +4037,7 @@ let p = class extends E {
3847
4037
  }
3848
4038
  this.busy = "logs";
3849
4039
  try {
3850
- this.logs = await n.listLogs();
4040
+ this.logs = await o.listLogs();
3851
4041
  } catch {
3852
4042
  this.logsSupported = !1, this.logs = [], this.active === "activity" && (this.active = "profile");
3853
4043
  } finally {
@@ -3858,7 +4048,7 @@ let p = class extends E {
3858
4048
  if (!this.factorsLoading) {
3859
4049
  this.factorsLoading = !0;
3860
4050
  try {
3861
- this.factors = await n.listMfaFactors();
4051
+ this.factors = await o.listMfaFactors();
3862
4052
  } catch {
3863
4053
  this.factors = {
3864
4054
  totp: !1,
@@ -3937,7 +4127,7 @@ let p = class extends E {
3937
4127
  >
3938
4128
  ${l.x}
3939
4129
  </button>
3940
- </div>` : o}
4130
+ </div>` : n}
3941
4131
  ${this.stepUp ? this.renderStepUp() : r`<div
3942
4132
  class="tabpanel"
3943
4133
  role="tabpanel"
@@ -3958,13 +4148,13 @@ let p = class extends E {
3958
4148
  <div class="row-main">
3959
4149
  <span class="row-title" title=${t}>
3960
4150
  ${t}
3961
- ${e.mfa ? r`<span class="badge badge-success">${l.shieldCheck} ${this.t("mfaBadge")}</span>` : o}
3962
- ${n.isPreview ? r`<span class="badge badge-info">${this.t("preview")}</span>` : o}
4151
+ ${e.mfa ? r`<span class="badge badge-success">${l.shieldCheck} ${this.t("mfaBadge")}</span>` : n}
4152
+ ${o.isPreview ? r`<span class="badge badge-info">${this.t("preview")}</span>` : n}
3963
4153
  </span>
3964
- ${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : o}
4154
+ ${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : n}
3965
4155
  </div>
3966
4156
  </div>
3967
- <button class="btn btn-outline btn-sm" @click=${() => n.signOut()}>
4157
+ <button class="btn btn-outline btn-sm" @click=${() => o.signOut()}>
3968
4158
  ${l.logOut} ${this.t("signOut")}
3969
4159
  </button>
3970
4160
  </div>
@@ -3989,21 +4179,50 @@ let p = class extends E {
3989
4179
  return t ? r`<div class="alert alert-error" role="alert">
3990
4180
  ${l.alert}
3991
4181
  <div class="alert-body">${t}</div>
3992
- </div>` : o;
4182
+ </div>` : n;
3993
4183
  }
3994
4184
  spinner(e) {
3995
- return this.busy === e ? r`<span class="spinner" aria-hidden="true"></span>` : o;
4185
+ return this.busy === e ? r`<span class="spinner" aria-hidden="true"></span>` : n;
3996
4186
  }
3997
4187
  card(e, t, i, s, a = !1) {
3998
4188
  return r`<section class="card ${a ? "card-danger" : ""}">
3999
4189
  <div class="card-header">
4000
4190
  <h3 class="card-title">${e}</h3>
4001
- ${t ? r`<p class="card-description">${t}</p>` : o}
4191
+ ${t ? r`<p class="card-description">${t}</p>` : n}
4002
4192
  </div>
4003
- <div class="card-body">${i}</div>
4004
- ${s ? r`<div class="card-footer">${s}</div>` : o}
4193
+ ${i !== n ? r`<div class="card-body">${i}</div>` : n}
4194
+ ${s ? r`<div class="card-footer">${s}</div>` : n}
4005
4195
  </section>`;
4006
4196
  }
4197
+ /** Vibes-style confirm footer: Cancel first (autofocus), destructive only on confirm. */
4198
+ confirmFooter(e, t, i, s) {
4199
+ return r`
4200
+ <button
4201
+ type="button"
4202
+ class="btn btn-outline btn-sm"
4203
+ autofocus
4204
+ ?disabled=${!!this.busy}
4205
+ @click=${e}
4206
+ >
4207
+ ${this.t("cancel")}
4208
+ </button>
4209
+ <button
4210
+ type="button"
4211
+ class="btn btn-destructive btn-sm"
4212
+ ?disabled=${!!this.busy}
4213
+ @click=${t}
4214
+ >
4215
+ ${s ? this.spinner(s) : n} ${i}
4216
+ </button>
4217
+ `;
4218
+ }
4219
+ emptyState(e, t, i) {
4220
+ return r`<div class="empty empty-well">
4221
+ <div class="empty-icon" aria-hidden="true">${e}</div>
4222
+ <p class="empty-title">${t}</p>
4223
+ <p class="empty-desc">${i}</p>
4224
+ </div>`;
4225
+ }
4007
4226
  verifiedBadge(e) {
4008
4227
  return e ? r`<span class="badge badge-success">${l.check} ${this.t("verified")}</span>` : r`<span class="badge badge-warning">${this.t("unverified")}</span>`;
4009
4228
  }
@@ -4113,7 +4332,7 @@ let p = class extends E {
4113
4332
  <div class="field">
4114
4333
  <label class="label" for="acc-email"
4115
4334
  >${this.t("email")}
4116
- ${e.email ? this.verifiedBadge(e.emailVerification) : o}</label
4335
+ ${e.email ? this.verifiedBadge(e.emailVerification) : n}</label
4117
4336
  >
4118
4337
  <input
4119
4338
  class="input"
@@ -4138,8 +4357,8 @@ let p = class extends E {
4138
4357
  autocomplete=${e.passwordUpdate ? "current-password" : "new-password"}
4139
4358
  required
4140
4359
  />
4141
- ${e.passwordUpdate ? o : r`<p class="hint">${this.t("createPasswordHint")}</p>`}
4142
- </div>` : o}
4360
+ ${e.passwordUpdate ? n : r`<p class="hint">${this.t("createPasswordHint")}</p>`}
4361
+ </div>` : n}
4143
4362
  ${this.error("email")} ${this.error("verify")}
4144
4363
  </form>`,
4145
4364
  r`
@@ -4156,7 +4375,7 @@ let p = class extends E {
4156
4375
  Math.ceil((this.verifyEmailCooldownUntil - Date.now()) / 1e3)
4157
4376
  )
4158
4377
  }) : this.t("verifyEmail")}
4159
- </button>` : o}
4378
+ </button>` : n}
4160
4379
  <button
4161
4380
  class="btn btn-primary btn-sm"
4162
4381
  type="submit"
@@ -4174,7 +4393,7 @@ let p = class extends E {
4174
4393
  <div class="field">
4175
4394
  <label class="label" for="acc-phone"
4176
4395
  >${this.t("phone")}
4177
- ${e.phone ? this.verifiedBadge(e.phoneVerification) : o}</label
4396
+ ${e.phone ? this.verifiedBadge(e.phoneVerification) : n}</label
4178
4397
  >
4179
4398
  <input
4180
4399
  class="input"
@@ -4199,8 +4418,8 @@ let p = class extends E {
4199
4418
  autocomplete=${e.passwordUpdate ? "current-password" : "new-password"}
4200
4419
  required
4201
4420
  />
4202
- ${e.passwordUpdate ? o : r`<p class="hint">${this.t("createPasswordHint")}</p>`}
4203
- </div>` : o}
4421
+ ${e.passwordUpdate ? n : r`<p class="hint">${this.t("createPasswordHint")}</p>`}
4422
+ </div>` : n}
4204
4423
  ${this.phoneCodeSent ? r`<div class="field">
4205
4424
  <label class="label" for="acc-phone-code">${this.t("code")}</label>
4206
4425
  <input
@@ -4217,7 +4436,7 @@ let p = class extends E {
4217
4436
  t.key === "Enter" && (t.preventDefault(), this.onConfirmPhoneVerification(t));
4218
4437
  }}
4219
4438
  />
4220
- </div>` : o}
4439
+ </div>` : n}
4221
4440
  ${this.error("phone")} ${this.error("verify-phone")} ${this.error("verify-phone-code")}
4222
4441
  </form>`,
4223
4442
  r`
@@ -4228,7 +4447,7 @@ let p = class extends E {
4228
4447
  ?disabled=${!!this.busy}
4229
4448
  >
4230
4449
  ${this.spinner("verify-phone")} ${this.t("sendCode")}
4231
- </button>` : o}
4450
+ </button>` : n}
4232
4451
  ${this.phoneCodeSent ? r`<button
4233
4452
  class="btn btn-outline btn-sm"
4234
4453
  type="button"
@@ -4236,7 +4455,7 @@ let p = class extends E {
4236
4455
  ?disabled=${!!this.busy}
4237
4456
  >
4238
4457
  ${this.spinner("verify-phone-code")} ${this.t("verifyCode")}
4239
- </button>` : o}
4458
+ </button>` : n}
4240
4459
  <button
4241
4460
  class="btn btn-primary btn-sm"
4242
4461
  type="submit"
@@ -4254,25 +4473,20 @@ let p = class extends E {
4254
4473
  return this.card(
4255
4474
  this.t("deleteAccount"),
4256
4475
  this.t("deleteAccountDescription"),
4257
- r`${this.error("delete")}
4258
- ${this.confirmDelete ? r`<div class="inline">
4259
- <button
4260
- class="btn btn-outline btn-sm warn"
4261
- @click=${this.onDeleteAccount}
4262
- ?disabled=${!!this.busy}
4263
- >
4264
- ${this.spinner("delete")} ${this.t("deleteAccountConfirm")}
4265
- </button>
4266
- <button class="btn btn-ghost btn-sm" @click=${() => this.confirmDelete = !1}>
4267
- ${this.t("cancel")}
4268
- </button>
4269
- </div>` : r`<button
4270
- class="btn btn-outline btn-sm warn"
4271
- @click=${() => this.confirmDelete = !0}
4272
- >
4476
+ this.confirmDelete ? this.error("delete") : r`${this.error("delete")}
4477
+ <button class="btn btn-outline btn-sm warn" @click=${() => this.confirmDelete = !0}>
4273
4478
  ${l.userX} ${this.t("deleteAccount")}
4274
- </button>`}`,
4275
- void 0,
4479
+ </button>`,
4480
+ this.confirmDelete ? this.confirmFooter(
4481
+ () => {
4482
+ this.confirmDelete = !1;
4483
+ },
4484
+ () => {
4485
+ this.onDeleteAccount();
4486
+ },
4487
+ this.t("deleteAccountConfirm"),
4488
+ "delete"
4489
+ ) : void 0,
4276
4490
  !0
4277
4491
  );
4278
4492
  }
@@ -4280,7 +4494,7 @@ let p = class extends E {
4280
4494
  renderSecurity() {
4281
4495
  const e = this.user, t = this.config?.mfa !== !1;
4282
4496
  return r`<div class="section">
4283
- ${this.isGuest ? o : this.card(
4497
+ ${this.isGuest ? n : this.card(
4284
4498
  this.t("changePassword"),
4285
4499
  void 0,
4286
4500
  r`<form
@@ -4302,7 +4516,7 @@ let p = class extends E {
4302
4516
  autocomplete="current-password"
4303
4517
  required
4304
4518
  />
4305
- </div>` : o}
4519
+ </div>` : n}
4306
4520
  <div class="field">
4307
4521
  <label class="label" for="acc-new-password">${this.t("newPassword")}</label>
4308
4522
  <input
@@ -4360,12 +4574,12 @@ let p = class extends E {
4360
4574
  ${this.spinner("password")} ${this.t("update")}
4361
4575
  </button>`
4362
4576
  )}
4363
- ${t ? this.renderMfaCard() : o}
4364
- ${t ? this.renderRecoveryCard() : o}
4577
+ ${t ? this.renderMfaCard() : n}
4578
+ ${t ? this.renderRecoveryCard() : n}
4365
4579
  </div>`;
4366
4580
  }
4367
4581
  renderMfaCard() {
4368
- const e = this.user, t = this.factors?.totp ?? !1, i = this.authenticator ? n.isPreview ? Et(this.authenticator.uri) : new kt(n.getClient()).getQR(this.authenticator.uri, 400, 1).toString() : "";
4582
+ const e = this.user, t = this.factors?.totp ?? !1, i = this.authenticator ? o.isPreview ? Et(this.authenticator.uri) : new kt(o.getClient()).getQR(this.authenticator.uri, 400, 1).toString() : "";
4369
4583
  return this.card(
4370
4584
  this.t("twoFactor"),
4371
4585
  this.t("twoFactorDescription"),
@@ -4388,7 +4602,7 @@ let p = class extends E {
4388
4602
  ${l.alert}
4389
4603
  <div class="alert-body">
4390
4604
  ${this.t("mfaNoFactorWarning")}
4391
- ${this.factors?.totp ? o : r`<div class="links">
4605
+ ${this.factors?.totp ? n : r`<div class="links">
4392
4606
  <button
4393
4607
  type="button"
4394
4608
  class="btn btn-link"
@@ -4399,14 +4613,14 @@ let p = class extends E {
4399
4613
  </button>
4400
4614
  </div>`}
4401
4615
  </div>
4402
- </div>` : o}
4616
+ </div>` : n}
4403
4617
  ${this.error("mfa")}
4404
4618
  <div class="separator"></div>
4405
4619
  <div class="toggle-row">
4406
4620
  <div class="row-main">
4407
4621
  <span class="row-title"
4408
4622
  >${l.smartphone} ${this.t("authenticatorApp")}
4409
- ${t ? this.verifiedBadge(!0) : o}</span
4623
+ ${t ? this.verifiedBadge(!0) : n}</span
4410
4624
  >
4411
4625
  </div>
4412
4626
  ${t ? this.confirmRemoveAuthenticator ? r`<div class="inline">
@@ -4429,7 +4643,7 @@ let p = class extends E {
4429
4643
  ?disabled=${!!this.busy}
4430
4644
  >
4431
4645
  ${this.spinner("remove-authenticator")} ${this.t("remove")}
4432
- </button>` : this.authenticator ? o : r`<button
4646
+ </button>` : this.authenticator ? n : r`<button
4433
4647
  class="btn btn-outline btn-sm"
4434
4648
  @click=${this.onAddAuthenticator}
4435
4649
  ?disabled=${!!this.busy}
@@ -4484,7 +4698,7 @@ let p = class extends E {
4484
4698
  ${this.t("cancel")}
4485
4699
  </button>
4486
4700
  </div>
4487
- </form>` : o}
4701
+ </form>` : n}
4488
4702
  </div>`
4489
4703
  );
4490
4704
  }
@@ -4538,7 +4752,7 @@ let p = class extends E {
4538
4752
  ?disabled=${!!this.busy}
4539
4753
  >
4540
4754
  ${l.refresh} ${this.t("regenerateRecoveryCodes")}
4541
- </button>` : o}
4755
+ </button>` : n}
4542
4756
  </div>`}
4543
4757
  ${this.error("recovery")}
4544
4758
  </div>`
@@ -4627,15 +4841,19 @@ let p = class extends E {
4627
4841
  this.t("sessions"),
4628
4842
  void 0,
4629
4843
  r`${this.error("sessions")}
4630
- ${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? r`<div class="empty">${this.t("noSessions")}</div>` : e.map(
4844
+ ${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? this.emptyState(
4845
+ l.monitor,
4846
+ this.t("noSessions"),
4847
+ this.t("noSessionsDescription")
4848
+ ) : e.map(
4631
4849
  (t) => r`<div class="row">
4632
4850
  <div class="inline">
4633
4851
  <span class="device">${this.deviceIcon(t)}</span>
4634
4852
  <div class="row-main">
4635
4853
  <span class="row-title">
4636
4854
  ${t.clientName || t.provider}
4637
- ${t.clientVersion ? r`<span class="muted small">${t.clientVersion}</span>` : o}
4638
- ${t.current ? r`<span class="badge badge-info">${this.t("currentSession")}</span>` : o}
4855
+ ${t.clientVersion ? r`<span class="muted small">${t.clientVersion}</span>` : n}
4856
+ ${t.current ? r`<span class="badge badge-info">${this.t("currentSession")}</span>` : n}
4639
4857
  </span>
4640
4858
  <span class="row-sub"
4641
4859
  >${[t.osName, t.countryName || t.countryCode, t.ip].filter(Boolean).join(" · ")}</span
@@ -4643,7 +4861,7 @@ let p = class extends E {
4643
4861
  </div>
4644
4862
  </div>
4645
4863
  <div class="row-actions">
4646
- ${this.busy === `session-${t.$id}` ? r`<span class="spinner"></span>` : o}
4864
+ ${this.busy === `session-${t.$id}` ? r`<span class="spinner"></span>` : n}
4647
4865
  <button
4648
4866
  class="btn btn-ghost btn-sm"
4649
4867
  @click=${() => this.onDeleteSession(t.$id)}
@@ -4659,29 +4877,24 @@ let p = class extends E {
4659
4877
  ${this.card(
4660
4878
  this.t("signOutAllSessions"),
4661
4879
  this.t("signOutAllSessionsDescription"),
4662
- r`${this.error("sessions-all")}
4663
- ${this.confirmSignOutAll ? r`<div class="inline">
4664
- <button
4665
- class="btn btn-outline btn-sm warn"
4666
- @click=${this.onSignOutAll}
4667
- ?disabled=${!!this.busy}
4668
- >
4669
- ${this.spinner("sessions-all")} ${l.logOut} ${this.t("signOutAllSessions")}
4670
- </button>
4671
- <button
4672
- class="btn btn-ghost btn-sm"
4673
- @click=${() => this.confirmSignOutAll = !1}
4674
- >
4675
- ${this.t("cancel")}
4676
- </button>
4677
- </div>` : r`<button
4880
+ this.confirmSignOutAll ? this.error("sessions-all") : r`${this.error("sessions-all")}
4881
+ <button
4678
4882
  class="btn btn-outline btn-sm warn"
4679
4883
  @click=${this.onSignOutAll}
4680
4884
  ?disabled=${!!this.busy}
4681
4885
  >
4682
4886
  ${this.spinner("sessions-all")} ${l.logOut} ${this.t("signOutAllSessions")}
4683
- </button>`}`,
4684
- void 0,
4887
+ </button>`,
4888
+ this.confirmSignOutAll ? this.confirmFooter(
4889
+ () => {
4890
+ this.confirmSignOutAll = !1;
4891
+ },
4892
+ () => {
4893
+ this.onSignOutAll();
4894
+ },
4895
+ this.t("signOutAllSessions"),
4896
+ "sessions-all"
4897
+ ) : void 0,
4685
4898
  !0
4686
4899
  )}
4687
4900
  </div>`;
@@ -4694,37 +4907,45 @@ let p = class extends E {
4694
4907
  this.t("connections"),
4695
4908
  void 0,
4696
4909
  r`${this.error("identities")}
4697
- ${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? r`<div class="empty">${this.t("noConnections")}</div>` : e.map(
4910
+ ${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? this.emptyState(
4911
+ l.link,
4912
+ this.t("noConnections"),
4913
+ this.t("noConnectionsDescription")
4914
+ ) : e.map(
4698
4915
  (i) => r`<div class="row">
4699
4916
  <div class="inline">
4700
- <span class="device">${et(i.provider)}</span>
4917
+ <span class="device">${Y(i.provider)}</span>
4701
4918
  <div class="row-main">
4702
- <span class="row-title">${q(i.provider)}</span>
4919
+ <span class="row-title">${W(i.provider)}</span>
4703
4920
  <span class="row-sub">${i.providerEmail || i.providerUid}</span>
4704
4921
  </div>
4705
4922
  </div>
4706
4923
  <div class="row-actions">
4707
4924
  ${this.confirmDisconnectId === i.$id ? r`<div class="inline">
4708
4925
  <button
4709
- class="btn btn-outline btn-sm warn"
4710
- @click=${() => this.onDeleteIdentity(i.$id)}
4926
+ type="button"
4927
+ class="btn btn-outline btn-sm"
4928
+ autofocus
4711
4929
  ?disabled=${!!this.busy}
4930
+ @click=${() => this.confirmDisconnectId = null}
4712
4931
  >
4713
- ${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` : o}
4714
- ${this.t("disconnect")}
4932
+ ${this.t("cancel")}
4715
4933
  </button>
4716
4934
  <button
4717
- class="btn btn-ghost btn-sm"
4718
- @click=${() => this.confirmDisconnectId = null}
4935
+ type="button"
4936
+ class="btn btn-destructive btn-sm"
4937
+ @click=${() => this.onDeleteIdentity(i.$id)}
4938
+ ?disabled=${!!this.busy}
4719
4939
  >
4720
- ${this.t("cancel")}
4940
+ ${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` : n}
4941
+ ${this.t("disconnect")}
4721
4942
  </button>
4722
4943
  </div>` : r`<button
4723
4944
  class="btn btn-ghost btn-sm"
4724
4945
  @click=${() => this.onDeleteIdentity(i.$id)}
4725
4946
  ?disabled=${!!this.busy}
4726
4947
  >
4727
- ${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` : o}
4948
+ ${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` : n}
4728
4949
  ${this.t("disconnect")}
4729
4950
  </button>`}
4730
4951
  </div>
@@ -4734,12 +4955,12 @@ let p = class extends E {
4734
4955
  (i) => r`<button
4735
4956
  class="btn btn-outline btn-sm"
4736
4957
  @click=${() => {
4737
- this.run(`connect-${i}`, () => n.signInWithOAuth(i));
4958
+ this.run(`connect-${i}`, () => o.signInWithOAuth(i));
4738
4959
  }}
4739
4960
  ?disabled=${!!this.busy}
4740
4961
  >
4741
- ${this.spinner(`connect-${i}`)} ${et(i)}
4742
- ${this.t("connectProvider", { provider: q(i) })}
4962
+ ${this.spinner(`connect-${i}`)} ${Y(i)}
4963
+ ${this.t("connectProvider", { provider: W(i) })}
4743
4964
  </button>`
4744
4965
  )}` : void 0
4745
4966
  )}
@@ -4752,7 +4973,11 @@ let p = class extends E {
4752
4973
  ${this.card(
4753
4974
  this.t("activity"),
4754
4975
  void 0,
4755
- r`${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? r`<div class="empty">${this.t("noActivity")}</div>` : e.map(
4976
+ r`${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? this.emptyState(
4977
+ l.activity,
4978
+ this.t("noActivity"),
4979
+ this.t("noActivityDescription")
4980
+ ) : e.map(
4756
4981
  (t) => r`<div class="row">
4757
4982
  <div class="row-main">
4758
4983
  <span class="row-title">${t.event}</span>
@@ -4968,7 +5193,7 @@ m([
4968
5193
  d()
4969
5194
  ], p.prototype, "verifyEmailCooldownUntil", 2);
4970
5195
  p = m([
4971
- R("authui-account")
5196
+ T("authui-account")
4972
5197
  ], p);
4973
5198
  var Xt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, F = (e, t, i, s) => {
4974
5199
  for (var a = s > 1 ? void 0 : s ? Qt(t, i) : t, c = e.length - 1, u; c >= 0; c--)
@@ -5063,7 +5288,7 @@ let P = class extends E {
5063
5288
  ${this.open ? t ? r`<authui-account embedded></authui-account>` : r`<authui-sign-in
5064
5289
  embedded
5065
5290
  .view=${this.view === "account" ? "sign-in" : this.view}
5066
- ></authui-sign-in>` : o}
5291
+ ></authui-sign-in>` : n}
5067
5292
  </div>
5068
5293
  <div class="scroll-fade ${this.scrollCue ? "show" : ""}" aria-hidden="true"></div>
5069
5294
  </div>
@@ -5183,9 +5408,9 @@ F([
5183
5408
  st(".body")
5184
5409
  ], P.prototype, "bodyEl", 2);
5185
5410
  P = F([
5186
- R("authui-modal")
5411
+ T("authui-modal")
5187
5412
  ], P);
5188
- var Jt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, X = (e, t, i, s) => {
5413
+ var Jt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, Q = (e, t, i, s) => {
5189
5414
  for (var a = s > 1 ? void 0 : s ? te(t, i) : t, c = e.length - 1, u; c >= 0; c--)
5190
5415
  (u = e[c]) && (a = (s ? u(t, i, a) : u(a)) || a);
5191
5416
  return s && a && Jt(t, i, a), a;
@@ -5198,7 +5423,7 @@ let L = class extends E {
5198
5423
  const e = this.size === "md" ? "" : `btn-${this.size}`;
5199
5424
  return r`<button
5200
5425
  class="btn btn-${this.variant} ${e}"
5201
- @click=${() => Y(this.view)}
5426
+ @click=${() => Z(this.view)}
5202
5427
  part="button"
5203
5428
  >
5204
5429
  <slot
@@ -5218,19 +5443,19 @@ L.styles = [
5218
5443
  }
5219
5444
  `
5220
5445
  ];
5221
- X([
5446
+ Q([
5222
5447
  g({ type: String })
5223
5448
  ], L.prototype, "view", 2);
5224
- X([
5449
+ Q([
5225
5450
  g({ type: String })
5226
5451
  ], L.prototype, "variant", 2);
5227
- X([
5452
+ Q([
5228
5453
  g({ type: String })
5229
5454
  ], L.prototype, "size", 2);
5230
- L = X([
5231
- R("authui-button")
5455
+ L = Q([
5456
+ T("authui-button")
5232
5457
  ], L);
5233
- var ee = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, T = (e, t, i, s) => {
5458
+ var ee = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, R = (e, t, i, s) => {
5234
5459
  for (var a = s > 1 ? void 0 : s ? ie(t, i) : t, c = e.length - 1, u; c >= 0; c--)
5235
5460
  (u = e[c]) && (a = (s ? u(t, i, a) : u(a)) || a);
5236
5461
  return s && a && ee(t, i, a), a;
@@ -5259,7 +5484,7 @@ let I = class extends E {
5259
5484
  }, this.toggleMenu = () => {
5260
5485
  this.menuOpen = !this.menuOpen, this.menuOpen && this.showTeams && this.loadTeams();
5261
5486
  }, this.selectTeam = (e) => {
5262
- n.setActiveTeam({ $id: e.$id, name: e.name }), this.activeTeamId = e.$id, this.dispatchEvent(
5487
+ o.setActiveTeam({ $id: e.$id, name: e.name }), this.activeTeamId = e.$id, this.dispatchEvent(
5263
5488
  new CustomEvent("authui-active-team", {
5264
5489
  detail: { teamId: e.$id, team: e },
5265
5490
  bubbles: !0,
@@ -5280,9 +5505,9 @@ let I = class extends E {
5280
5505
  if (!e || !t) return;
5281
5506
  const i = e.getBoundingClientRect(), s = 6, a = 8;
5282
5507
  t.style.maxHeight = "";
5283
- const c = t.offsetHeight + s, u = window.innerHeight - i.bottom, $ = i.top, x = u < c && $ > u;
5284
- x !== this.menuAbove && (this.menuAbove = x);
5285
- const ot = Math.max(80, (x ? $ : u) - s - a);
5508
+ const c = t.offsetHeight + s, u = window.innerHeight - i.bottom, b = i.top, $ = u < c && b > u;
5509
+ $ !== this.menuAbove && (this.menuAbove = $);
5510
+ const ot = Math.max(80, ($ ? b : u) - s - a);
5286
5511
  t.style.maxHeight = `${ot}px`;
5287
5512
  }
5288
5513
  focusMenuItem(e) {
@@ -5296,9 +5521,9 @@ let I = class extends E {
5296
5521
  })) : this.menuAbove = !1), this.menuOpen && (e.has("teams") || e.has("teamsLoading")) && requestAnimationFrame(() => this.placeMenu());
5297
5522
  }
5298
5523
  async loadTeams() {
5299
- this.teamsLoading = !0, this.activeTeamId = n.getActiveTeamId();
5524
+ this.teamsLoading = !0, this.activeTeamId = o.getActiveTeamId();
5300
5525
  try {
5301
- this.teams = await n.listTeams(), this.activeTeamId && !this.teams.some((e) => e.$id === this.activeTeamId) && (this.activeTeamId = null, n.setActiveTeam(null));
5526
+ this.teams = await o.listTeams(), this.activeTeamId && !this.teams.some((e) => e.$id === this.activeTeamId) && (this.activeTeamId = null, o.setActiveTeam(null));
5302
5527
  } catch {
5303
5528
  this.teams = [];
5304
5529
  } finally {
@@ -5310,7 +5535,7 @@ let I = class extends E {
5310
5535
  if (e === "loading" && i)
5311
5536
  return r`<span class="avatar"><span class="spinner"></span></span>`;
5312
5537
  if (e !== "signed-in" || !t)
5313
- return r`<button class="btn btn-primary btn-sm" @click=${() => Y("sign-in")}>
5538
+ return r`<button class="btn btn-primary btn-sm" @click=${() => Z("sign-in")}>
5314
5539
  <slot>${this.t("signIn")}</slot>
5315
5540
  </button>`;
5316
5541
  const s = t.name || t.email || t.phone || this.t("guestAccount");
@@ -5329,7 +5554,7 @@ let I = class extends E {
5329
5554
  ${this.menuOpen ? r`<div class="menu ${this.menuAbove ? "above" : ""}" role="menu">
5330
5555
  <div class="menu-header">
5331
5556
  <span class="row-title" title=${s}>${s}</span>
5332
- ${t.email && t.name ? r`<span class="row-sub" title=${t.email}>${t.email}</span>` : o}
5557
+ ${t.email && t.name ? r`<span class="row-sub" title=${t.email}>${t.email}</span>` : n}
5333
5558
  </div>
5334
5559
  ${this.showTeams ? r`<div class="menu-section">
5335
5560
  <div class="menu-section-label">${this.t("teamsLabel")}</div>
@@ -5344,15 +5569,15 @@ let I = class extends E {
5344
5569
  >
5345
5570
  ${l.users}
5346
5571
  <span title=${a.name}>${a.name}</span>
5347
- ${a.$id === this.activeTeamId ? r`<span class="check">${l.check}</span>` : o}
5572
+ ${a.$id === this.activeTeamId ? r`<span class="check">${l.check}</span>` : n}
5348
5573
  </button>`
5349
5574
  )}
5350
- </div>` : o}
5575
+ </div>` : n}
5351
5576
  <button
5352
5577
  class="menu-item"
5353
5578
  role="menuitem"
5354
5579
  @click=${() => {
5355
- this.menuOpen = !1, Y("account");
5580
+ this.menuOpen = !1, Z("account");
5356
5581
  }}
5357
5582
  >
5358
5583
  ${l.settings} ${this.t("manageAccount")}
@@ -5361,12 +5586,12 @@ let I = class extends E {
5361
5586
  class="menu-item"
5362
5587
  role="menuitem"
5363
5588
  @click=${() => {
5364
- this.menuOpen = !1, n.signOut();
5589
+ this.menuOpen = !1, o.signOut();
5365
5590
  }}
5366
5591
  >
5367
5592
  ${l.logOut} ${this.t("signOut")}
5368
5593
  </button>
5369
- </div>` : o}
5594
+ </div>` : n}
5370
5595
  `;
5371
5596
  }
5372
5597
  };
@@ -5488,29 +5713,29 @@ I.styles = [
5488
5713
  }
5489
5714
  `
5490
5715
  ];
5491
- T([
5716
+ R([
5492
5717
  g({ type: Boolean, attribute: "show-teams" })
5493
5718
  ], I.prototype, "showTeams", 2);
5494
- T([
5719
+ R([
5495
5720
  g({ type: String })
5496
5721
  ], I.prototype, "src", 2);
5497
- T([
5722
+ R([
5498
5723
  d()
5499
5724
  ], I.prototype, "menuOpen", 2);
5500
- T([
5725
+ R([
5501
5726
  d()
5502
5727
  ], I.prototype, "menuAbove", 2);
5503
- T([
5728
+ R([
5504
5729
  d()
5505
5730
  ], I.prototype, "teams", 2);
5506
- T([
5731
+ R([
5507
5732
  d()
5508
5733
  ], I.prototype, "teamsLoading", 2);
5509
- T([
5734
+ R([
5510
5735
  d()
5511
5736
  ], I.prototype, "activeTeamId", 2);
5512
- I = T([
5513
- R("authui-user-button")
5737
+ I = R([
5738
+ T("authui-user-button")
5514
5739
  ], I);
5515
5740
  export {
5516
5741
  Ft as A,
@@ -5518,29 +5743,29 @@ export {
5518
5743
  f as E,
5519
5744
  bt as F,
5520
5745
  It as P,
5521
- n as a,
5746
+ o as a,
5522
5747
  p as b,
5523
5748
  le as c,
5524
5749
  L as d,
5525
- b as e,
5750
+ y as e,
5526
5751
  E as f,
5527
5752
  P as g,
5528
- B as h,
5753
+ N as h,
5529
5754
  k as i,
5530
5755
  I as j,
5531
5756
  ne as k,
5532
5757
  pt as l,
5533
5758
  Ct as m,
5534
5759
  K as n,
5535
- Y as o,
5536
- D as p,
5760
+ Z as o,
5761
+ z as p,
5537
5762
  ut as q,
5538
5763
  Ut as r,
5539
- q as s,
5764
+ W as s,
5540
5765
  V as t,
5541
5766
  wt as u,
5542
5767
  it as v,
5543
5768
  Mt as w,
5544
5769
  Ot as x,
5545
- z as y
5770
+ _ as y
5546
5771
  };