@getauthui/core 0.1.7 → 0.1.9

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,7 +696,7 @@ 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
702
  const J = (e) => `authui:active-team:${e}`;
@@ -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);
@@ -732,7 +735,7 @@ function D() {
732
735
  return null;
733
736
  }
734
737
  }
735
- function ne() {
738
+ function oe() {
736
739
  if (!(typeof localStorage > "u"))
737
740
  try {
738
741
  localStorage.removeItem(at);
@@ -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
  }
@@ -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,74 +2572,74 @@ 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;
2496
2641
  };
2497
- const bt = "authui-show:not([ready]){display:none}", oe = "authui-show:not([ready]){display:none}authui-button:not(:defined),authui-user-button:not(:defined){visibility:hidden}";
2642
+ const bt = "authui-show:not([ready]){display:none}", le = "authui-show:not([ready]){display:none}authui-button:not(:defined),authui-user-button:not(:defined){visibility:hidden}";
2498
2643
  let yt = !1;
2499
2644
  function Bt() {
2500
2645
  if (!(typeof document > "u" || yt)) {
@@ -2515,44 +2660,47 @@ function Bt() {
2515
2660
  }
2516
2661
  Bt();
2517
2662
  const Ht = ["loading", "signed-out", "signed-in", "mfa-required"];
2518
- function Q(e) {
2663
+ function et(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
+ function jt(e, t, i) {
2667
+ const s = et(t), a = et(i);
2668
+ return !(e === "loading" && !s.includes("loading") || s.length > 0 && !s.includes(e) || a.includes(e));
2669
+ }
2670
+ let N = class extends rt {
2522
2671
  constructor() {
2523
- super(...arguments), this.when = "", this.unless = "", this.status = n.getState().status, this.unsubscribe = null;
2672
+ super(...arguments), this.when = "", this.unless = "", this.status = o.getState().status, this.unsubscribe = null;
2524
2673
  }
2525
2674
  connectedCallback() {
2526
- super.connectedCallback(), this.status = n.getState().status, this.unsubscribe = n.on("change", (e) => this.status = e.status);
2675
+ super.connectedCallback(), this.status = o.getState().status, this.unsubscribe = o.on("change", (e) => this.status = e.status);
2527
2676
  }
2528
2677
  disconnectedCallback() {
2529
2678
  super.disconnectedCallback(), this.unsubscribe?.(), this.unsubscribe = null;
2530
2679
  }
2531
2680
  /** Whether the current status satisfies `when` and `unless`. */
2532
2681
  get visible() {
2533
- const e = Q(this.when), t = Q(this.unless);
2534
- return !(this.status === "loading" && !e.includes("loading") || e.length > 0 && !e.includes(this.status) || t.includes(this.status));
2682
+ return jt(this.status, this.when, this.unless);
2535
2683
  }
2536
2684
  updated() {
2537
- (this.status !== "loading" || Q(this.when).includes("loading")) && (this.setAttribute("ready", ""), this.style.display = "contents");
2685
+ (this.status !== "loading" || et(this.when).includes("loading")) && (this.setAttribute("ready", ""), this.style.display = "contents");
2538
2686
  }
2539
2687
  render() {
2540
- return this.visible ? r`<slot></slot>` : o;
2688
+ return this.visible ? r`<slot></slot>` : n;
2541
2689
  }
2542
2690
  };
2543
- Z([
2691
+ X([
2544
2692
  g({ type: String })
2545
- ], B.prototype, "when", 2);
2546
- Z([
2693
+ ], N.prototype, "when", 2);
2694
+ X([
2547
2695
  g({ type: String })
2548
- ], B.prototype, "unless", 2);
2549
- Z([
2696
+ ], N.prototype, "unless", 2);
2697
+ X([
2550
2698
  d()
2551
- ], B.prototype, "status", 2);
2552
- B = Z([
2553
- R("authui-show")
2554
- ], B);
2555
- const jt = O`
2699
+ ], N.prototype, "status", 2);
2700
+ N = X([
2701
+ T("authui-show")
2702
+ ], N);
2703
+ const Wt = O`
2556
2704
  :host {
2557
2705
  display: block;
2558
2706
  width: 100%;
@@ -2699,75 +2847,75 @@ const jt = O`
2699
2847
  qr: v(
2700
2848
  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
2849
  )
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(
2850
+ }, x = (e, t = "0 0 24 24") => r`<svg xmlns="http://www.w3.org/2000/svg" viewBox=${t} aria-hidden="true">${e}</svg>`, Kt = {
2851
+ google: x(
2704
2852
  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
2853
  ),
2706
- github: w(
2854
+ github: x(
2707
2855
  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
2856
  ),
2709
- apple: w(
2857
+ apple: x(
2710
2858
  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
2859
  ),
2712
- facebook: w(
2860
+ facebook: x(
2713
2861
  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
2862
  ),
2715
- x: w(
2863
+ x: x(
2716
2864
  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
2865
  ),
2718
- microsoft: w(
2866
+ microsoft: x(
2719
2867
  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
2868
  ),
2721
- discord: w(
2869
+ discord: x(
2722
2870
  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
2871
  ),
2724
- gitlab: w(
2872
+ gitlab: x(
2725
2873
  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
2874
  ),
2727
- linkedin: w(
2875
+ linkedin: x(
2728
2876
  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
2877
  ),
2730
- slack: w(
2878
+ slack: x(
2731
2879
  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
2880
  ),
2733
- twitch: w(
2881
+ twitch: x(
2734
2882
  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
2883
  ),
2736
- spotify: w(
2884
+ spotify: x(
2737
2885
  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
2886
  ),
2739
- notion: w(
2887
+ notion: x(
2740
2888
  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
2889
  ),
2742
- dropbox: w(
2890
+ dropbox: x(
2743
2891
  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
2892
  ),
2745
- figma: w(
2893
+ figma: x(
2746
2894
  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
2895
  ),
2748
- bitbucket: w(
2896
+ bitbucket: x(
2749
2897
  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
2898
  ),
2751
- amazon: w(
2899
+ amazon: x(
2752
2900
  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
2901
  ),
2754
- paypal: w(
2902
+ paypal: x(
2755
2903
  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
2904
  )
2757
2905
  };
2758
- function et(e) {
2759
- return Wt[e] ?? l.globe;
2906
+ function Y(e) {
2907
+ return Kt[e] ?? l.globe;
2760
2908
  }
2761
2909
  function nt(e) {
2762
2910
  const t = (e.trim()[0] ?? "?").toUpperCase();
2763
2911
  return /[A-Z0-9]/i.test(t) ? t : l.user;
2764
2912
  }
2765
- function Y(e) {
2913
+ function Z(e) {
2766
2914
  typeof document > "u" || (document.querySelector("authui-modal") || document.body.appendChild(document.createElement("authui-modal")), queueMicrotask(() => {
2767
2915
  window.dispatchEvent(new CustomEvent("authui:open", { detail: { view: e } }));
2768
2916
  }));
2769
2917
  }
2770
- function le() {
2918
+ function ce() {
2771
2919
  typeof window > "u" || window.dispatchEvent(new CustomEvent("authui:close"));
2772
2920
  }
2773
2921
  function it(e) {
@@ -2786,28 +2934,28 @@ function it(e) {
2786
2934
  let s, a;
2787
2935
  return !t.length || i <= 1 ? (s = 1, a = "passwordStrengthTooWeak") : i === 2 ? (s = 2, a = "passwordStrengthWeak") : i === 3 ? (s = 3, a = "passwordStrengthFair") : i >= 5 && t.long && t.lower && t.upper && t.number && t.symbol ? (s = 4, a = "passwordStrengthVeryStrong") : (s = 4, a = "passwordStrengthStrong"), { level: s, percent: s * 25, labelKey: a, checks: t };
2788
2936
  }
2789
- var Kt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, C = (e, t, i, s) => {
2790
- for (var a = s > 1 ? void 0 : s ? Gt(t, i) : t, c = e.length - 1, u; c >= 0; c--)
2937
+ var Gt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, C = (e, t, i, s) => {
2938
+ for (var a = s > 1 ? void 0 : s ? Yt(t, i) : t, c = e.length - 1, u; c >= 0; c--)
2791
2939
  (u = e[c]) && (a = (s ? u(t, i, a) : u(a)) || a);
2792
- return s && a && Kt(t, i, a), a;
2940
+ return s && a && Gt(t, i, a), a;
2793
2941
  };
2794
2942
  let k = class extends E {
2795
2943
  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) => {
2944
+ 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
2945
  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" });
2946
+ await o.signInWithEmailPassword(this.email, this.password), this.password = "", V("email-password"), this.fire("authui-success", { method: "email-password" });
2799
2947
  });
2800
2948
  }, this.onSignUp = (e) => {
2801
2949
  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" });
2950
+ await o.signUp(this.email, this.password, this.name), this.password = "", V("email-password"), this.fire("authui-success", { method: "sign-up" });
2803
2951
  });
2804
2952
  }, this.onGuest = () => {
2805
2953
  this.run(async () => {
2806
- await n.signInAnonymously(), V("anonymous"), this.fire("authui-success", { method: "anonymous" });
2954
+ await o.signInAnonymously(), V("anonymous"), this.fire("authui-success", { method: "anonymous" });
2807
2955
  });
2808
2956
  }, this.onOAuth = (e) => {
2809
2957
  this.run(async () => {
2810
- if (Ot(e), await n.signInWithOAuth(e), n.isPreview) {
2958
+ if (Ot(e), await o.signInWithOAuth(e), o.isPreview) {
2811
2959
  wt(), this.fire("authui-success", { method: "oauth" });
2812
2960
  return;
2813
2961
  }
@@ -2815,7 +2963,7 @@ let k = class extends E {
2815
2963
  });
2816
2964
  }, this.onForgot = (e) => {
2817
2965
  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 }) };
2966
+ await o.sendPasswordRecovery(this.email), this.notice = { tone: "success", message: this.t("resetLinkSent", { email: this.email }) };
2819
2967
  });
2820
2968
  }, this.onReset = (e) => {
2821
2969
  if (e.preventDefault(), !this.requireValid(e)) return;
@@ -2825,11 +2973,11 @@ let k = class extends E {
2825
2973
  }
2826
2974
  const t = this.recovery;
2827
2975
  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") };
2976
+ 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
2977
  });
2830
2978
  }, this.onMagicUrl = (e) => {
2831
2979
  e.preventDefault(), this.requireValid(e) && this.run(async () => {
2832
- const t = await n.sendMagicUrl(this.email);
2980
+ const t = await o.sendMagicUrl(this.email);
2833
2981
  this.token = {
2834
2982
  userId: t.userId,
2835
2983
  kind: "magic-url",
@@ -2839,7 +2987,7 @@ let k = class extends E {
2839
2987
  });
2840
2988
  }, this.onEmailOtp = (e) => {
2841
2989
  e.preventDefault(), this.requireValid(e) && this.run(async () => {
2842
- const t = await n.sendEmailOtp(this.email);
2990
+ const t = await o.sendEmailOtp(this.email);
2843
2991
  this.token = {
2844
2992
  userId: t.userId,
2845
2993
  kind: "email-otp",
@@ -2849,37 +2997,37 @@ let k = class extends E {
2849
2997
  });
2850
2998
  }, this.onPhoneOtp = (e) => {
2851
2999
  e.preventDefault(), this.requireValid(e) && this.run(async () => {
2852
- const t = await n.sendPhoneOtp(this.phone);
3000
+ const t = await o.sendPhoneOtp(this.phone);
2853
3001
  this.token = { userId: t.userId, kind: "phone", target: this.phone }, this.code = "";
2854
3002
  });
2855
3003
  }, this.onVerifyCode = (e) => {
2856
3004
  if (e.preventDefault(), !this.requireValid(e)) return;
2857
3005
  const t = this.token;
2858
3006
  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 });
3007
+ await o.signInWithToken(t.userId, this.code), this.code = "", this.token = null, V(t.kind), this.fire("authui-success", { method: t.kind });
2860
3008
  }, "code");
2861
3009
  }, this.onChooseFactor = (e) => {
2862
3010
  this.run(async () => {
2863
- const t = await n.createMfaChallenge(e);
3011
+ const t = await o.createMfaChallenge(e);
2864
3012
  this.challenge = { id: t.$id, factor: e }, this.code = "";
2865
3013
  });
2866
3014
  }, this.onVerifyFactor = (e) => {
2867
3015
  if (e.preventDefault(), !this.requireValid(e)) return;
2868
3016
  const t = this.challenge;
2869
3017
  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" });
3018
+ await o.completeMfaChallenge(t.id, this.code), this.code = "", this.challenge = null, this.go("sign-in"), this.fire("authui-success", { method: "mfa" });
2871
3019
  }, "code");
2872
3020
  }, this.onCancelMfa = () => {
2873
3021
  this.run(async () => {
2874
3022
  try {
2875
- await n.signOut();
3023
+ await o.signOut();
2876
3024
  } catch (e) {
2877
- if (!N(e, f.sessionNotFound)) throw e;
3025
+ if (!q(e, f.sessionNotFound)) throw e;
2878
3026
  }
2879
3027
  this.go("sign-in");
2880
3028
  });
2881
3029
  }, this.onSignOut = () => {
2882
- this.run(() => n.signOut());
3030
+ this.run(() => o.signOut());
2883
3031
  };
2884
3032
  }
2885
3033
  connectedCallback() {
@@ -2903,7 +3051,7 @@ let k = class extends E {
2903
3051
  }
2904
3052
  /** Navigate between screens and reset transient state. */
2905
3053
  dismissNotice() {
2906
- this.notice = null, this.auth.pending?.type === "notice" && n.setPending(null);
3054
+ this.notice = null, this.auth.pending?.type === "notice" && o.setPending(null);
2907
3055
  }
2908
3056
  go(e) {
2909
3057
  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 +3095,7 @@ let k = class extends E {
2947
3095
  >
2948
3096
  ${l.x}
2949
3097
  </button>
2950
- </div>` : o}
3098
+ </div>` : n}
2951
3099
  ${e}
2952
3100
  </div>
2953
3101
  `;
@@ -2989,10 +3137,10 @@ let k = class extends E {
2989
3137
  @error=${(a) => {
2990
3138
  a.target.hidden = !0;
2991
3139
  }}
2992
- />` : o}
2993
- ${n.isPreview ? r`<span class="badge badge-info preview">${this.t("preview")}</span>` : o}
3140
+ />` : n}
3141
+ ${o.isPreview ? r`<span class="badge badge-info preview">${this.t("preview")}</span>` : n}
2994
3142
  <h2 class="title" id="authui-title">${i}</h2>
2995
- ${s ? r`<p class="description">${s}</p>` : o}
3143
+ ${s ? r`<p class="description">${s}</p>` : n}
2996
3144
  </div>
2997
3145
  `;
2998
3146
  }
@@ -3000,11 +3148,11 @@ let k = class extends E {
3000
3148
  return this.error ? r`<div class="alert alert-error" role="alert">
3001
3149
  ${l.alert}
3002
3150
  <div class="alert-body">${this.error}</div>
3003
- </div>` : o;
3151
+ </div>` : n;
3004
3152
  }
3005
3153
  submitButton(e, t = "btn-primary") {
3006
3154
  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}
3155
+ ${this.busy ? r`<span class="spinner" aria-hidden="true"></span>` : n} ${e}
3008
3156
  </button>`;
3009
3157
  }
3010
3158
  passwordField(e) {
@@ -3019,7 +3167,7 @@ let k = class extends E {
3019
3167
  @click=${() => this.go("forgot-password")}
3020
3168
  >
3021
3169
  ${this.t("forgotPassword")}
3022
- </button>` : o}
3170
+ </button>` : n}
3023
3171
  </div>
3024
3172
  <div class="input-wrap">
3025
3173
  <input
@@ -3055,7 +3203,7 @@ let k = class extends E {
3055
3203
  <span></span><span></span><span></span><span></span>
3056
3204
  </div>
3057
3205
  <p class="strength-label">${this.t(i.labelKey)}</p>
3058
- </div>` : e.hint ? r`<p class="hint">${e.hint}</p>` : o}
3206
+ </div>` : e.hint ? r`<p class="hint">${e.hint}</p>` : n}
3059
3207
  </div>
3060
3208
  `;
3061
3209
  }
@@ -3097,11 +3245,11 @@ let k = class extends E {
3097
3245
  }
3098
3246
  legal() {
3099
3247
  const e = this.config?.legal;
3100
- return !e?.termsUrl && !e?.privacyUrl ? o : r`<p class="legal">
3248
+ return !e?.termsUrl && !e?.privacyUrl ? n : r`<p class="legal">
3101
3249
  ${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}.
3250
+ ${e.termsUrl ? r`<a href=${e.termsUrl} target="_blank" rel="noopener">${this.t("terms")}</a>` : n}
3251
+ ${e.termsUrl && e.privacyUrl ? r` ${this.t("and")} ` : n}
3252
+ ${e.privacyUrl ? r`<a href=${e.privacyUrl} target="_blank" rel="noopener">${this.t("privacy")}</a>` : n}.
3105
3253
  </p>`;
3106
3254
  }
3107
3255
  backLink(e = "sign-in") {
@@ -3153,7 +3301,7 @@ let k = class extends E {
3153
3301
  <span class="avatar">${nt(t)}</span>
3154
3302
  <div class="row-main">
3155
3303
  <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}
3304
+ ${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : n}
3157
3305
  </div>
3158
3306
  </div>
3159
3307
  </div>
@@ -3161,11 +3309,11 @@ let k = class extends E {
3161
3309
  <div class="stack-sm">
3162
3310
  ${this.config?.successUrl ? r`<a class="btn btn-primary btn-block" href=${this.config.successUrl}
3163
3311
  >${this.t("continue")}</a
3164
- >` : o}
3312
+ >` : n}
3165
3313
  <button
3166
3314
  class="btn btn-outline btn-block"
3167
3315
  @click=${() => {
3168
- this.embedded ? this.fire("authui-open", { view: "account" }) : Y("account");
3316
+ this.embedded ? this.fire("authui-open", { view: "account" }) : Z("account");
3169
3317
  }}
3170
3318
  >
3171
3319
  ${l.settings} ${this.t("manageAccount")}
@@ -3179,30 +3327,68 @@ let k = class extends E {
3179
3327
  }
3180
3328
  renderProviders() {
3181
3329
  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;
3330
+ if (e.length === 0) return n;
3331
+ const t = z(), i = e.find((a) => t === `oauth:${a}`) ?? null;
3332
+ if (e.length <= 2) {
3333
+ const a = [...e].sort((c, u) => {
3334
+ const b = t === `oauth:${c}` ? 0 : 1, $ = t === `oauth:${u}` ? 0 : 1;
3335
+ return b - $;
3336
+ });
3337
+ return r`
3338
+ <div class="providers">
3339
+ ${a.map((c) => {
3340
+ const u = t === `oauth:${c}`, b = this.t("continueWith", { provider: W(c) });
3341
+ return r`<button
3342
+ type="button"
3343
+ class="btn btn-outline ${u ? "last-used" : ""}"
3344
+ @click=${() => this.onOAuth(c)}
3345
+ ?disabled=${this.busy}
3346
+ aria-label=${u ? `${b}. ${this.t("lastUsed")}` : b}
3347
+ >
3348
+ ${Y(c)}
3349
+ <span>${b}</span>
3350
+ ${u ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : n}
3351
+ </button>`;
3352
+ })}
3353
+ </div>
3354
+ `;
3355
+ }
3356
+ const s = this.expandedOAuth && e.includes(this.expandedOAuth) ? this.expandedOAuth : i ?? e[0];
3189
3357
  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) })}
3358
+ <div
3359
+ class="providers accordion"
3360
+ @mouseleave=${() => {
3361
+ this.expandedOAuth = i ?? e[0];
3362
+ }}
3363
+ >
3364
+ ${e.map((a) => {
3365
+ const c = t === `oauth:${a}`, u = s === a, b = this.t("continueWith", { provider: W(a) });
3366
+ return r`<div
3367
+ class="provider-slot ${u ? "is-expanded" : ""}"
3368
+ @mouseenter=${() => {
3369
+ this.expandedOAuth = a;
3370
+ }}
3199
3371
  >
3200
- ${et(s)}
3201
- <span
3202
- >${i ? q(s) : this.t("continueWith", { provider: q(s) })}</span
3372
+ <button
3373
+ type="button"
3374
+ class="btn btn-outline"
3375
+ @click=${() => this.onOAuth(a)}
3376
+ @focus=${() => {
3377
+ this.expandedOAuth = a;
3378
+ }}
3379
+ ?disabled=${this.busy}
3380
+ aria-label=${c ? `${b}. ${this.t("lastUsed")}` : b}
3203
3381
  >
3204
- ${a ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : o}
3205
- </button>`;
3382
+ ${Y(a)}
3383
+ <span class="provider-label"
3384
+ ><span><span class="provider-label-text">${b}</span></span></span
3385
+ >
3386
+ ${c ? r`<span class="oauth-last-used" data-last-used=${a} aria-hidden="true">
3387
+ <span class="oauth-last-used-dot"></span>
3388
+ <span class="oauth-last-used-pill">${this.t("lastUsed")}</span>
3389
+ </span>` : n}
3390
+ </button>
3391
+ </div>`;
3206
3392
  })}
3207
3393
  </div>
3208
3394
  `;
@@ -3216,47 +3402,47 @@ let k = class extends E {
3216
3402
  return r`
3217
3403
  <div class="stack">
3218
3404
  ${this.renderProviders()}
3219
- ${i && (t || s.length > 0) ? r`<div class="separator-text">${this.t("or")}</div>` : o}
3405
+ ${i && (t || s.length > 0) ? r`<div class="separator-text">${this.t("or")}</div>` : n}
3220
3406
  ${t ? r`<form
3221
- class="form ${D() === "email-password" ? "last-used-form" : ""}"
3407
+ class="form ${z() === "email-password" ? "last-used-form" : ""}"
3222
3408
  @submit=${this.onSignIn}
3223
3409
  novalidate
3224
3410
  >
3225
- ${D() === "email-password" ? r`<p class="hint">
3411
+ ${z() === "email-password" ? r`<p class="hint">
3226
3412
  <span class="last-used-badge">${this.t("lastUsed")}</span>
3227
- </p>` : o}
3413
+ </p>` : n}
3228
3414
  ${this.emailField()}
3229
3415
  ${this.passwordField({ label: this.t("password"), autocomplete: "current-password", id: "authui-password", field: "password", forgot: !0 })}
3230
3416
  ${this.renderError()} ${this.submitButton(this.t("signIn"))}
3231
3417
  </form>` : this.renderError()}
3232
3418
  ${s.length > 0 ? r`<div class="stack-sm">
3233
3419
  ${s.map((a) => {
3234
- const c = D() === a.step;
3420
+ const c = z() === a.step;
3235
3421
  return r`<button
3236
3422
  type="button"
3237
3423
  class="btn btn-secondary btn-block ${c ? "last-used" : ""}"
3238
3424
  @click=${() => this.go(a.step)}
3239
3425
  >
3240
3426
  ${a.icon} ${a.label}
3241
- ${c ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : o}
3427
+ ${c ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : n}
3242
3428
  </button>`;
3243
3429
  })}
3244
- </div>` : o}
3430
+ </div>` : n}
3245
3431
  ${e.anonymous ? r`<button
3246
3432
  type="button"
3247
- class="btn btn-ghost btn-block ${D() === "anonymous" ? "last-used" : ""}"
3433
+ class="btn btn-ghost btn-block ${z() === "anonymous" ? "last-used" : ""}"
3248
3434
  @click=${this.onGuest}
3249
3435
  ?disabled=${this.busy}
3250
3436
  >
3251
3437
  ${l.ghost} ${this.t("continueAsGuest")}
3252
- ${D() === "anonymous" ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : o}
3253
- </button>` : o}
3438
+ ${z() === "anonymous" ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : n}
3439
+ </button>` : n}
3254
3440
  ${t && this.config?.signUp !== !1 ? r`<div class="links">
3255
3441
  <span>${this.t("noAccount")}</span>
3256
3442
  <button type="button" class="btn btn-link" @click=${() => this.go("sign-up")}>
3257
3443
  ${this.t("signUp")}
3258
3444
  </button>
3259
- </div>` : o}
3445
+ </div>` : n}
3260
3446
  ${this.legal()}
3261
3447
  </div>
3262
3448
  `;
@@ -3265,7 +3451,7 @@ let k = class extends E {
3265
3451
  return r`
3266
3452
  <div class="stack">
3267
3453
  ${this.renderProviders()}
3268
- ${(this.config?.methods?.oauth?.length ?? 0) > 0 ? r`<div class="separator-text">${this.t("or")}</div>` : o}
3454
+ ${(this.config?.methods?.oauth?.length ?? 0) > 0 ? r`<div class="separator-text">${this.t("or")}</div>` : n}
3269
3455
  <form class="form" @submit=${this.onSignUp} novalidate>
3270
3456
  ${this.config?.requireName !== !1 ? r`<div class="field">
3271
3457
  <label class="label" for="authui-name">${this.t("name")}</label>
@@ -3278,7 +3464,7 @@ let k = class extends E {
3278
3464
  .value=${this.name}
3279
3465
  @input=${this.bind("name")}
3280
3466
  />
3281
- </div>` : o}
3467
+ </div>` : n}
3282
3468
  ${this.emailField()}
3283
3469
  ${this.passwordField({ label: this.t("password"), autocomplete: "new-password", id: "authui-password", field: "password", hint: this.t("passwordHint"), meter: !0 })}
3284
3470
  ${this.renderError()} ${this.submitButton(this.t("createAccount"))}
@@ -3348,7 +3534,7 @@ let k = class extends E {
3348
3534
  ${this.t("securityPhrase")}: <span class="code">${e}</span>
3349
3535
  </div>
3350
3536
  <div class="alert-body">${this.t("securityPhraseHint")}</div>
3351
- </div>` : o;
3537
+ </div>` : n;
3352
3538
  }
3353
3539
  renderMagicUrl() {
3354
3540
  return this.token ? r`<div class="stack">
@@ -3370,10 +3556,10 @@ let k = class extends E {
3370
3556
  const e = this.token;
3371
3557
  !e || Date.now() < this.resendCooldownUntil || (this.error = "", await this.run(async () => {
3372
3558
  if (e.kind === "phone") {
3373
- const t = await n.sendPhoneOtp(e.target);
3559
+ const t = await o.sendPhoneOtp(e.target);
3374
3560
  this.token = { userId: t.userId, kind: "phone", target: e.target };
3375
3561
  } else {
3376
- const t = await n.sendEmailOtp(e.target);
3562
+ const t = await o.sendEmailOtp(e.target);
3377
3563
  this.token = {
3378
3564
  userId: t.userId,
3379
3565
  kind: "email-otp",
@@ -3535,7 +3721,7 @@ let k = class extends E {
3535
3721
  `;
3536
3722
  }
3537
3723
  };
3538
- k.styles = [...E.styles, jt];
3724
+ k.styles = [...E.styles, Wt];
3539
3725
  C([
3540
3726
  g({ type: String })
3541
3727
  ], k.prototype, "view", 2);
@@ -3557,6 +3743,9 @@ C([
3557
3743
  C([
3558
3744
  d()
3559
3745
  ], k.prototype, "showPassword", 2);
3746
+ C([
3747
+ d()
3748
+ ], k.prototype, "expandedOAuth", 2);
3560
3749
  C([
3561
3750
  d()
3562
3751
  ], k.prototype, "token", 2);
@@ -3573,12 +3762,12 @@ C([
3573
3762
  st("form input:not([type=hidden])")
3574
3763
  ], k.prototype, "firstInput", 2);
3575
3764
  k = C([
3576
- R("authui-sign-in")
3765
+ T("authui-sign-in")
3577
3766
  ], k);
3578
- var Yt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, m = (e, t, i, s) => {
3579
- for (var a = s > 1 ? void 0 : s ? Zt(t, i) : t, c = e.length - 1, u; c >= 0; c--)
3767
+ var Zt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, m = (e, t, i, s) => {
3768
+ for (var a = s > 1 ? void 0 : s ? Xt(t, i) : t, c = e.length - 1, u; c >= 0; c--)
3580
3769
  (u = e[c]) && (a = (s ? u(t, i, a) : u(a)) || a);
3581
- return s && a && Yt(t, i, a), a;
3770
+ return s && a && Zt(t, i, a), a;
3582
3771
  };
3583
3772
  let p = class extends E {
3584
3773
  constructor() {
@@ -3597,12 +3786,12 @@ let p = class extends E {
3597
3786
  const a = t[s].id.replace("authui-tab-", "");
3598
3787
  this.select(a), requestAnimationFrame(() => t[s]?.focus());
3599
3788
  }, 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"));
3789
+ e.preventDefault(), this.requireValid(e) && this.run("name", () => o.updateName(this.nameInput), this.t("nameUpdated"));
3601
3790
  }, this.onUpdateEmail = (e) => {
3602
3791
  e.preventDefault(), this.requireValid(e) && this.run(
3603
3792
  "email",
3604
3793
  async () => {
3605
- await n.updateEmail(this.emailInput, this.emailPassword), this.emailPassword = "";
3794
+ await o.updateEmail(this.emailInput, this.emailPassword), this.emailPassword = "";
3606
3795
  },
3607
3796
  this.t("emailUpdated")
3608
3797
  );
@@ -3610,7 +3799,7 @@ let p = class extends E {
3610
3799
  e.preventDefault(), this.requireValid(e) && this.run(
3611
3800
  "phone",
3612
3801
  async () => {
3613
- await n.updatePhone(this.phoneInput, this.phonePassword), this.phonePassword = "";
3802
+ await o.updatePhone(this.phoneInput, this.phonePassword), this.phonePassword = "";
3614
3803
  },
3615
3804
  this.t("phoneUpdated")
3616
3805
  );
@@ -3618,7 +3807,7 @@ let p = class extends E {
3618
3807
  e.preventDefault(), this.requireValid(e) && this.run(
3619
3808
  "guest",
3620
3809
  async () => {
3621
- await n.convertGuest(this.emailInput, this.emailPassword, this.guestName), this.emailPassword = "";
3810
+ await o.convertGuest(this.emailInput, this.emailPassword, this.guestName), this.emailPassword = "";
3622
3811
  },
3623
3812
  this.t("accountConverted")
3624
3813
  );
@@ -3626,19 +3815,19 @@ let p = class extends E {
3626
3815
  Date.now() < this.verifyEmailCooldownUntil || this.run(
3627
3816
  "verify",
3628
3817
  async () => {
3629
- await n.sendEmailVerification(), this.startVerifyEmailCooldown();
3818
+ await o.sendEmailVerification(), this.startVerifyEmailCooldown();
3630
3819
  },
3631
3820
  this.t("verificationSent")
3632
3821
  );
3633
3822
  }, this.onSendPhoneVerification = () => {
3634
3823
  this.run("verify-phone", async () => {
3635
- await n.sendPhoneVerification(), this.phoneCodeSent = !0;
3824
+ await o.sendPhoneVerification(), this.phoneCodeSent = !0;
3636
3825
  });
3637
3826
  }, this.onConfirmPhoneVerification = (e) => {
3638
3827
  e.preventDefault(), this.requireValid(e) && this.run(
3639
3828
  "verify-phone-code",
3640
3829
  async () => {
3641
- await n.confirmPhoneVerification(this.phoneCode), this.phoneCode = "", this.phoneCodeSent = !1;
3830
+ await o.confirmPhoneVerification(this.phoneCode), this.phoneCode = "", this.phoneCodeSent = !1;
3642
3831
  },
3643
3832
  this.t("phoneVerified")
3644
3833
  );
@@ -3651,7 +3840,7 @@ let p = class extends E {
3651
3840
  this.run(
3652
3841
  "password",
3653
3842
  async () => {
3654
- await n.updatePassword(this.newPassword, this.oldPassword), this.oldPassword = this.newPassword = this.newPasswordConfirm = "";
3843
+ await o.updatePassword(this.newPassword, this.oldPassword), this.oldPassword = this.newPassword = this.newPasswordConfirm = "";
3655
3844
  },
3656
3845
  this.t("passwordChanged")
3657
3846
  );
@@ -3659,17 +3848,17 @@ let p = class extends E {
3659
3848
  }, this.onToggleMfa = () => {
3660
3849
  const e = !this.user?.mfa;
3661
3850
  this.run("mfa", async () => {
3662
- await n.setMfaEnabled(e), await this.loadFactors();
3851
+ await o.setMfaEnabled(e), await this.loadFactors();
3663
3852
  });
3664
3853
  }, this.onAddAuthenticator = () => {
3665
3854
  this.run("authenticator", async () => {
3666
- this.authenticator = await n.addAuthenticator(), this.authenticatorCode = "";
3855
+ this.authenticator = await o.addAuthenticator(), this.authenticatorCode = "";
3667
3856
  });
3668
3857
  }, this.onVerifyAuthenticator = (e) => {
3669
3858
  e.preventDefault(), this.requireValid(e) && this.run(
3670
3859
  "authenticator-code",
3671
3860
  async () => {
3672
- await n.verifyAuthenticator(this.authenticatorCode), this.authenticator = null, this.authenticatorCode = "", await this.loadFactors();
3861
+ await o.verifyAuthenticator(this.authenticatorCode), this.authenticator = null, this.authenticatorCode = "", await this.loadFactors();
3673
3862
  },
3674
3863
  this.t("authenticatorAdded")
3675
3864
  );
@@ -3679,15 +3868,15 @@ let p = class extends E {
3679
3868
  return;
3680
3869
  }
3681
3870
  this.confirmRemoveAuthenticator = !1, this.run("remove-authenticator", async () => {
3682
- await n.removeAuthenticator(), await this.loadFactors();
3871
+ await o.removeAuthenticator(), await this.loadFactors();
3683
3872
  });
3684
3873
  }, this.onRecoveryCodes = () => {
3685
3874
  this.run("recovery", async () => {
3686
3875
  try {
3687
- this.recoveryCodes = await n.createRecoveryCodes();
3876
+ this.recoveryCodes = await o.createRecoveryCodes();
3688
3877
  } catch (e) {
3689
- if (!N(e, f.recoveryCodesExist)) throw e;
3690
- this.recoveryCodes = await n.getRecoveryCodes();
3878
+ if (!q(e, f.recoveryCodesExist)) throw e;
3879
+ this.recoveryCodes = await o.getRecoveryCodes();
3691
3880
  }
3692
3881
  await this.loadFactors();
3693
3882
  });
@@ -3697,7 +3886,7 @@ let p = class extends E {
3697
3886
  return;
3698
3887
  }
3699
3888
  this.confirmRegenerate = !1, this.run("recovery", async () => {
3700
- this.recoveryCodes = await n.regenerateRecoveryCodes();
3889
+ this.recoveryCodes = await o.regenerateRecoveryCodes();
3701
3890
  });
3702
3891
  }, this.onCopyCodes = async () => {
3703
3892
  if (this.recoveryCodes)
@@ -3717,7 +3906,7 @@ let p = class extends E {
3717
3906
  }
3718
3907
  }, this.onStepUpFactor = (e) => {
3719
3908
  this.run("stepup", async () => {
3720
- const t = await n.createMfaChallenge(e);
3909
+ const t = await o.createMfaChallenge(e);
3721
3910
  this.stepUp = { ...this.stepUp, challenge: { id: t.$id, factor: e } }, this.stepUpCode = "";
3722
3911
  });
3723
3912
  }, this.onStepUpVerify = (e) => {
@@ -3726,33 +3915,33 @@ let p = class extends E {
3726
3915
  t?.challenge && (async () => {
3727
3916
  let i = !1;
3728
3917
  await this.run("stepup-code", async () => {
3729
- await n.completeMfaChallenge(t.challenge.id, this.stepUpCode, { signIn: !1 }), this.stepUp = null, this.stepUpCode = "", i = !0;
3918
+ await o.completeMfaChallenge(t.challenge.id, this.stepUpCode, { signIn: !1 }), this.stepUp = null, this.stepUpCode = "", i = !0;
3730
3919
  }), i && await t.retry();
3731
3920
  })();
3732
3921
  }, this.onDeleteSession = (e) => {
3733
3922
  this.run(`session-${e}`, async () => {
3734
3923
  if ((this.sessions ?? []).some((i) => i.$id === e && i.current)) {
3735
- await n.signOut(), this.sessions = [];
3924
+ await o.signOut(), this.sessions = [];
3736
3925
  return;
3737
3926
  }
3738
- await n.signOut(e), this.sessions = (this.sessions ?? []).filter((i) => i.$id !== e);
3927
+ await o.signOut(e), this.sessions = (this.sessions ?? []).filter((i) => i.$id !== e);
3739
3928
  });
3740
3929
  }, this.onSignOutAll = () => {
3741
3930
  if (!this.confirmSignOutAll) {
3742
3931
  this.confirmSignOutAll = !0;
3743
3932
  return;
3744
3933
  }
3745
- this.confirmSignOutAll = !1, this.run("sessions-all", () => n.signOutEverywhere());
3934
+ this.confirmSignOutAll = !1, this.run("sessions-all", () => o.signOutEverywhere());
3746
3935
  }, this.onDeleteIdentity = (e) => {
3747
3936
  if (this.confirmDisconnectId !== e) {
3748
3937
  this.confirmDisconnectId = e;
3749
3938
  return;
3750
3939
  }
3751
3940
  this.confirmDisconnectId = null, this.run(`identity-${e}`, async () => {
3752
- await n.deleteIdentity(e), this.identities = (this.identities ?? []).filter((t) => t.$id !== e);
3941
+ await o.deleteIdentity(e), this.identities = (this.identities ?? []).filter((t) => t.$id !== e);
3753
3942
  });
3754
3943
  }, this.onDeleteAccount = () => {
3755
- this.run("delete", () => n.deleteAccount());
3944
+ this.run("delete", () => o.deleteAccount());
3756
3945
  };
3757
3946
  }
3758
3947
  connectedCallback() {
@@ -3784,10 +3973,14 @@ let p = class extends E {
3784
3973
  }
3785
3974
  updated(e) {
3786
3975
  e.has("active") && requestAnimationFrame(() => {
3787
- const t = this.renderRoot.querySelector(
3976
+ const i = this.renderRoot.querySelector(
3788
3977
  '.tab[aria-selected="true"]'
3789
3978
  );
3790
- t && typeof t.scrollIntoView == "function" && t.scrollIntoView({ inline: "nearest", block: "nearest", behavior: "smooth" });
3979
+ i && typeof i.scrollIntoView == "function" && i.scrollIntoView({ inline: "nearest", block: "nearest", behavior: "smooth" });
3980
+ }), (e.has("confirmDelete") && this.confirmDelete || e.has("confirmSignOutAll") && this.confirmSignOutAll || e.has("confirmDisconnectId") && this.confirmDisconnectId !== null) && requestAnimationFrame(() => {
3981
+ this.renderRoot.querySelector(
3982
+ ".card-footer [autofocus], .row-actions [autofocus], .inline [autofocus], .card-footer .btn-outline, .row-actions .btn-outline, .inline .btn-outline"
3983
+ )?.focus({ preventScroll: !0 });
3791
3984
  });
3792
3985
  }
3793
3986
  setNotice(e, t) {
@@ -3805,7 +3998,7 @@ let p = class extends E {
3805
3998
  try {
3806
3999
  await t(), i && this.setNotice("success", i);
3807
4000
  } catch (s) {
3808
- N(s, f.challengeRequired) ? this.stepUp = { retry: () => this.run(e, t, i) } : this.errors = {
4001
+ q(s, f.challengeRequired) ? this.stepUp = { retry: () => this.run(e, t, i) } : this.errors = {
3809
4002
  ...this.errors,
3810
4003
  [e]: K(
3811
4004
  s,
@@ -3821,12 +4014,12 @@ let p = class extends E {
3821
4014
  // ─────────────────────────── loaders ───────────────────────────
3822
4015
  async loadSessions() {
3823
4016
  await this.run("sessions", async () => {
3824
- this.sessions = await n.listSessions();
4017
+ this.sessions = await o.listSessions();
3825
4018
  });
3826
4019
  }
3827
4020
  async loadIdentities() {
3828
4021
  await this.run("identities", async () => {
3829
- this.identities = await n.listIdentities();
4022
+ this.identities = await o.listIdentities();
3830
4023
  });
3831
4024
  }
3832
4025
  /** Probe once so Activity is never shown on servers without /account/logs. */
@@ -3834,7 +4027,7 @@ let p = class extends E {
3834
4027
  if (!this.logsProbeStarted) {
3835
4028
  this.logsProbeStarted = !0;
3836
4029
  try {
3837
- this.logs = await n.listLogs(), this.logsSupported = !0;
4030
+ this.logs = await o.listLogs(), this.logsSupported = !0;
3838
4031
  } catch {
3839
4032
  this.logsSupported = !1, this.logs = [], this.active === "activity" && (this.active = "profile");
3840
4033
  }
@@ -3847,7 +4040,7 @@ let p = class extends E {
3847
4040
  }
3848
4041
  this.busy = "logs";
3849
4042
  try {
3850
- this.logs = await n.listLogs();
4043
+ this.logs = await o.listLogs();
3851
4044
  } catch {
3852
4045
  this.logsSupported = !1, this.logs = [], this.active === "activity" && (this.active = "profile");
3853
4046
  } finally {
@@ -3858,7 +4051,7 @@ let p = class extends E {
3858
4051
  if (!this.factorsLoading) {
3859
4052
  this.factorsLoading = !0;
3860
4053
  try {
3861
- this.factors = await n.listMfaFactors();
4054
+ this.factors = await o.listMfaFactors();
3862
4055
  } catch {
3863
4056
  this.factors = {
3864
4057
  totp: !1,
@@ -3937,7 +4130,7 @@ let p = class extends E {
3937
4130
  >
3938
4131
  ${l.x}
3939
4132
  </button>
3940
- </div>` : o}
4133
+ </div>` : n}
3941
4134
  ${this.stepUp ? this.renderStepUp() : r`<div
3942
4135
  class="tabpanel"
3943
4136
  role="tabpanel"
@@ -3958,13 +4151,13 @@ let p = class extends E {
3958
4151
  <div class="row-main">
3959
4152
  <span class="row-title" title=${t}>
3960
4153
  ${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}
4154
+ ${e.mfa ? r`<span class="badge badge-success">${l.shieldCheck} ${this.t("mfaBadge")}</span>` : n}
4155
+ ${o.isPreview ? r`<span class="badge badge-info">${this.t("preview")}</span>` : n}
3963
4156
  </span>
3964
- ${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : o}
4157
+ ${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : n}
3965
4158
  </div>
3966
4159
  </div>
3967
- <button class="btn btn-outline btn-sm" @click=${() => n.signOut()}>
4160
+ <button class="btn btn-outline btn-sm" @click=${() => o.signOut()}>
3968
4161
  ${l.logOut} ${this.t("signOut")}
3969
4162
  </button>
3970
4163
  </div>
@@ -3989,21 +4182,50 @@ let p = class extends E {
3989
4182
  return t ? r`<div class="alert alert-error" role="alert">
3990
4183
  ${l.alert}
3991
4184
  <div class="alert-body">${t}</div>
3992
- </div>` : o;
4185
+ </div>` : n;
3993
4186
  }
3994
4187
  spinner(e) {
3995
- return this.busy === e ? r`<span class="spinner" aria-hidden="true"></span>` : o;
4188
+ return this.busy === e ? r`<span class="spinner" aria-hidden="true"></span>` : n;
3996
4189
  }
3997
4190
  card(e, t, i, s, a = !1) {
3998
4191
  return r`<section class="card ${a ? "card-danger" : ""}">
3999
4192
  <div class="card-header">
4000
4193
  <h3 class="card-title">${e}</h3>
4001
- ${t ? r`<p class="card-description">${t}</p>` : o}
4194
+ ${t ? r`<p class="card-description">${t}</p>` : n}
4002
4195
  </div>
4003
- <div class="card-body">${i}</div>
4004
- ${s ? r`<div class="card-footer">${s}</div>` : o}
4196
+ ${i !== n ? r`<div class="card-body">${i}</div>` : n}
4197
+ ${s ? r`<div class="card-footer">${s}</div>` : n}
4005
4198
  </section>`;
4006
4199
  }
4200
+ /** Vibes-style confirm footer: Cancel first (autofocus), destructive only on confirm. */
4201
+ confirmFooter(e, t, i, s) {
4202
+ return r`
4203
+ <button
4204
+ type="button"
4205
+ class="btn btn-outline btn-sm"
4206
+ autofocus
4207
+ ?disabled=${!!this.busy}
4208
+ @click=${e}
4209
+ >
4210
+ ${this.t("cancel")}
4211
+ </button>
4212
+ <button
4213
+ type="button"
4214
+ class="btn btn-destructive btn-sm"
4215
+ ?disabled=${!!this.busy}
4216
+ @click=${t}
4217
+ >
4218
+ ${s ? this.spinner(s) : n} ${i}
4219
+ </button>
4220
+ `;
4221
+ }
4222
+ emptyState(e, t, i) {
4223
+ return r`<div class="empty empty-well">
4224
+ <div class="empty-icon" aria-hidden="true">${e}</div>
4225
+ <p class="empty-title">${t}</p>
4226
+ <p class="empty-desc">${i}</p>
4227
+ </div>`;
4228
+ }
4007
4229
  verifiedBadge(e) {
4008
4230
  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
4231
  }
@@ -4113,7 +4335,7 @@ let p = class extends E {
4113
4335
  <div class="field">
4114
4336
  <label class="label" for="acc-email"
4115
4337
  >${this.t("email")}
4116
- ${e.email ? this.verifiedBadge(e.emailVerification) : o}</label
4338
+ ${e.email ? this.verifiedBadge(e.emailVerification) : n}</label
4117
4339
  >
4118
4340
  <input
4119
4341
  class="input"
@@ -4138,8 +4360,8 @@ let p = class extends E {
4138
4360
  autocomplete=${e.passwordUpdate ? "current-password" : "new-password"}
4139
4361
  required
4140
4362
  />
4141
- ${e.passwordUpdate ? o : r`<p class="hint">${this.t("createPasswordHint")}</p>`}
4142
- </div>` : o}
4363
+ ${e.passwordUpdate ? n : r`<p class="hint">${this.t("createPasswordHint")}</p>`}
4364
+ </div>` : n}
4143
4365
  ${this.error("email")} ${this.error("verify")}
4144
4366
  </form>`,
4145
4367
  r`
@@ -4156,7 +4378,7 @@ let p = class extends E {
4156
4378
  Math.ceil((this.verifyEmailCooldownUntil - Date.now()) / 1e3)
4157
4379
  )
4158
4380
  }) : this.t("verifyEmail")}
4159
- </button>` : o}
4381
+ </button>` : n}
4160
4382
  <button
4161
4383
  class="btn btn-primary btn-sm"
4162
4384
  type="submit"
@@ -4174,7 +4396,7 @@ let p = class extends E {
4174
4396
  <div class="field">
4175
4397
  <label class="label" for="acc-phone"
4176
4398
  >${this.t("phone")}
4177
- ${e.phone ? this.verifiedBadge(e.phoneVerification) : o}</label
4399
+ ${e.phone ? this.verifiedBadge(e.phoneVerification) : n}</label
4178
4400
  >
4179
4401
  <input
4180
4402
  class="input"
@@ -4199,8 +4421,8 @@ let p = class extends E {
4199
4421
  autocomplete=${e.passwordUpdate ? "current-password" : "new-password"}
4200
4422
  required
4201
4423
  />
4202
- ${e.passwordUpdate ? o : r`<p class="hint">${this.t("createPasswordHint")}</p>`}
4203
- </div>` : o}
4424
+ ${e.passwordUpdate ? n : r`<p class="hint">${this.t("createPasswordHint")}</p>`}
4425
+ </div>` : n}
4204
4426
  ${this.phoneCodeSent ? r`<div class="field">
4205
4427
  <label class="label" for="acc-phone-code">${this.t("code")}</label>
4206
4428
  <input
@@ -4217,7 +4439,7 @@ let p = class extends E {
4217
4439
  t.key === "Enter" && (t.preventDefault(), this.onConfirmPhoneVerification(t));
4218
4440
  }}
4219
4441
  />
4220
- </div>` : o}
4442
+ </div>` : n}
4221
4443
  ${this.error("phone")} ${this.error("verify-phone")} ${this.error("verify-phone-code")}
4222
4444
  </form>`,
4223
4445
  r`
@@ -4228,7 +4450,7 @@ let p = class extends E {
4228
4450
  ?disabled=${!!this.busy}
4229
4451
  >
4230
4452
  ${this.spinner("verify-phone")} ${this.t("sendCode")}
4231
- </button>` : o}
4453
+ </button>` : n}
4232
4454
  ${this.phoneCodeSent ? r`<button
4233
4455
  class="btn btn-outline btn-sm"
4234
4456
  type="button"
@@ -4236,7 +4458,7 @@ let p = class extends E {
4236
4458
  ?disabled=${!!this.busy}
4237
4459
  >
4238
4460
  ${this.spinner("verify-phone-code")} ${this.t("verifyCode")}
4239
- </button>` : o}
4461
+ </button>` : n}
4240
4462
  <button
4241
4463
  class="btn btn-primary btn-sm"
4242
4464
  type="submit"
@@ -4254,25 +4476,20 @@ let p = class extends E {
4254
4476
  return this.card(
4255
4477
  this.t("deleteAccount"),
4256
4478
  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
- >
4479
+ this.confirmDelete ? this.error("delete") : r`${this.error("delete")}
4480
+ <button class="btn btn-outline btn-sm warn" @click=${() => this.confirmDelete = !0}>
4273
4481
  ${l.userX} ${this.t("deleteAccount")}
4274
- </button>`}`,
4275
- void 0,
4482
+ </button>`,
4483
+ this.confirmDelete ? this.confirmFooter(
4484
+ () => {
4485
+ this.confirmDelete = !1;
4486
+ },
4487
+ () => {
4488
+ this.onDeleteAccount();
4489
+ },
4490
+ this.t("deleteAccountConfirm"),
4491
+ "delete"
4492
+ ) : void 0,
4276
4493
  !0
4277
4494
  );
4278
4495
  }
@@ -4280,7 +4497,7 @@ let p = class extends E {
4280
4497
  renderSecurity() {
4281
4498
  const e = this.user, t = this.config?.mfa !== !1;
4282
4499
  return r`<div class="section">
4283
- ${this.isGuest ? o : this.card(
4500
+ ${this.isGuest ? n : this.card(
4284
4501
  this.t("changePassword"),
4285
4502
  void 0,
4286
4503
  r`<form
@@ -4302,7 +4519,7 @@ let p = class extends E {
4302
4519
  autocomplete="current-password"
4303
4520
  required
4304
4521
  />
4305
- </div>` : o}
4522
+ </div>` : n}
4306
4523
  <div class="field">
4307
4524
  <label class="label" for="acc-new-password">${this.t("newPassword")}</label>
4308
4525
  <input
@@ -4360,12 +4577,12 @@ let p = class extends E {
4360
4577
  ${this.spinner("password")} ${this.t("update")}
4361
4578
  </button>`
4362
4579
  )}
4363
- ${t ? this.renderMfaCard() : o}
4364
- ${t ? this.renderRecoveryCard() : o}
4580
+ ${t ? this.renderMfaCard() : n}
4581
+ ${t ? this.renderRecoveryCard() : n}
4365
4582
  </div>`;
4366
4583
  }
4367
4584
  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() : "";
4585
+ 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
4586
  return this.card(
4370
4587
  this.t("twoFactor"),
4371
4588
  this.t("twoFactorDescription"),
@@ -4388,7 +4605,7 @@ let p = class extends E {
4388
4605
  ${l.alert}
4389
4606
  <div class="alert-body">
4390
4607
  ${this.t("mfaNoFactorWarning")}
4391
- ${this.factors?.totp ? o : r`<div class="links">
4608
+ ${this.factors?.totp ? n : r`<div class="links">
4392
4609
  <button
4393
4610
  type="button"
4394
4611
  class="btn btn-link"
@@ -4399,14 +4616,14 @@ let p = class extends E {
4399
4616
  </button>
4400
4617
  </div>`}
4401
4618
  </div>
4402
- </div>` : o}
4619
+ </div>` : n}
4403
4620
  ${this.error("mfa")}
4404
4621
  <div class="separator"></div>
4405
4622
  <div class="toggle-row">
4406
4623
  <div class="row-main">
4407
4624
  <span class="row-title"
4408
4625
  >${l.smartphone} ${this.t("authenticatorApp")}
4409
- ${t ? this.verifiedBadge(!0) : o}</span
4626
+ ${t ? this.verifiedBadge(!0) : n}</span
4410
4627
  >
4411
4628
  </div>
4412
4629
  ${t ? this.confirmRemoveAuthenticator ? r`<div class="inline">
@@ -4429,7 +4646,7 @@ let p = class extends E {
4429
4646
  ?disabled=${!!this.busy}
4430
4647
  >
4431
4648
  ${this.spinner("remove-authenticator")} ${this.t("remove")}
4432
- </button>` : this.authenticator ? o : r`<button
4649
+ </button>` : this.authenticator ? n : r`<button
4433
4650
  class="btn btn-outline btn-sm"
4434
4651
  @click=${this.onAddAuthenticator}
4435
4652
  ?disabled=${!!this.busy}
@@ -4484,7 +4701,7 @@ let p = class extends E {
4484
4701
  ${this.t("cancel")}
4485
4702
  </button>
4486
4703
  </div>
4487
- </form>` : o}
4704
+ </form>` : n}
4488
4705
  </div>`
4489
4706
  );
4490
4707
  }
@@ -4538,7 +4755,7 @@ let p = class extends E {
4538
4755
  ?disabled=${!!this.busy}
4539
4756
  >
4540
4757
  ${l.refresh} ${this.t("regenerateRecoveryCodes")}
4541
- </button>` : o}
4758
+ </button>` : n}
4542
4759
  </div>`}
4543
4760
  ${this.error("recovery")}
4544
4761
  </div>`
@@ -4627,15 +4844,19 @@ let p = class extends E {
4627
4844
  this.t("sessions"),
4628
4845
  void 0,
4629
4846
  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(
4847
+ ${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? this.emptyState(
4848
+ l.monitor,
4849
+ this.t("noSessions"),
4850
+ this.t("noSessionsDescription")
4851
+ ) : e.map(
4631
4852
  (t) => r`<div class="row">
4632
4853
  <div class="inline">
4633
4854
  <span class="device">${this.deviceIcon(t)}</span>
4634
4855
  <div class="row-main">
4635
4856
  <span class="row-title">
4636
4857
  ${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}
4858
+ ${t.clientVersion ? r`<span class="muted small">${t.clientVersion}</span>` : n}
4859
+ ${t.current ? r`<span class="badge badge-info">${this.t("currentSession")}</span>` : n}
4639
4860
  </span>
4640
4861
  <span class="row-sub"
4641
4862
  >${[t.osName, t.countryName || t.countryCode, t.ip].filter(Boolean).join(" · ")}</span
@@ -4643,7 +4864,7 @@ let p = class extends E {
4643
4864
  </div>
4644
4865
  </div>
4645
4866
  <div class="row-actions">
4646
- ${this.busy === `session-${t.$id}` ? r`<span class="spinner"></span>` : o}
4867
+ ${this.busy === `session-${t.$id}` ? r`<span class="spinner"></span>` : n}
4647
4868
  <button
4648
4869
  class="btn btn-ghost btn-sm"
4649
4870
  @click=${() => this.onDeleteSession(t.$id)}
@@ -4659,29 +4880,24 @@ let p = class extends E {
4659
4880
  ${this.card(
4660
4881
  this.t("signOutAllSessions"),
4661
4882
  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
4883
+ this.confirmSignOutAll ? this.error("sessions-all") : r`${this.error("sessions-all")}
4884
+ <button
4678
4885
  class="btn btn-outline btn-sm warn"
4679
4886
  @click=${this.onSignOutAll}
4680
4887
  ?disabled=${!!this.busy}
4681
4888
  >
4682
4889
  ${this.spinner("sessions-all")} ${l.logOut} ${this.t("signOutAllSessions")}
4683
- </button>`}`,
4684
- void 0,
4890
+ </button>`,
4891
+ this.confirmSignOutAll ? this.confirmFooter(
4892
+ () => {
4893
+ this.confirmSignOutAll = !1;
4894
+ },
4895
+ () => {
4896
+ this.onSignOutAll();
4897
+ },
4898
+ this.t("signOutAllSessions"),
4899
+ "sessions-all"
4900
+ ) : void 0,
4685
4901
  !0
4686
4902
  )}
4687
4903
  </div>`;
@@ -4694,37 +4910,45 @@ let p = class extends E {
4694
4910
  this.t("connections"),
4695
4911
  void 0,
4696
4912
  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(
4913
+ ${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? this.emptyState(
4914
+ l.link,
4915
+ this.t("noConnections"),
4916
+ this.t("noConnectionsDescription")
4917
+ ) : e.map(
4698
4918
  (i) => r`<div class="row">
4699
4919
  <div class="inline">
4700
- <span class="device">${et(i.provider)}</span>
4920
+ <span class="device">${Y(i.provider)}</span>
4701
4921
  <div class="row-main">
4702
- <span class="row-title">${q(i.provider)}</span>
4922
+ <span class="row-title">${W(i.provider)}</span>
4703
4923
  <span class="row-sub">${i.providerEmail || i.providerUid}</span>
4704
4924
  </div>
4705
4925
  </div>
4706
4926
  <div class="row-actions">
4707
4927
  ${this.confirmDisconnectId === i.$id ? r`<div class="inline">
4708
4928
  <button
4709
- class="btn btn-outline btn-sm warn"
4710
- @click=${() => this.onDeleteIdentity(i.$id)}
4929
+ type="button"
4930
+ class="btn btn-outline btn-sm"
4931
+ autofocus
4711
4932
  ?disabled=${!!this.busy}
4933
+ @click=${() => this.confirmDisconnectId = null}
4712
4934
  >
4713
- ${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` : o}
4714
- ${this.t("disconnect")}
4935
+ ${this.t("cancel")}
4715
4936
  </button>
4716
4937
  <button
4717
- class="btn btn-ghost btn-sm"
4718
- @click=${() => this.confirmDisconnectId = null}
4938
+ type="button"
4939
+ class="btn btn-destructive btn-sm"
4940
+ @click=${() => this.onDeleteIdentity(i.$id)}
4941
+ ?disabled=${!!this.busy}
4719
4942
  >
4720
- ${this.t("cancel")}
4943
+ ${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` : n}
4944
+ ${this.t("disconnect")}
4721
4945
  </button>
4722
4946
  </div>` : r`<button
4723
4947
  class="btn btn-ghost btn-sm"
4724
4948
  @click=${() => this.onDeleteIdentity(i.$id)}
4725
4949
  ?disabled=${!!this.busy}
4726
4950
  >
4727
- ${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` : o}
4951
+ ${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` : n}
4728
4952
  ${this.t("disconnect")}
4729
4953
  </button>`}
4730
4954
  </div>
@@ -4734,12 +4958,12 @@ let p = class extends E {
4734
4958
  (i) => r`<button
4735
4959
  class="btn btn-outline btn-sm"
4736
4960
  @click=${() => {
4737
- this.run(`connect-${i}`, () => n.signInWithOAuth(i));
4961
+ this.run(`connect-${i}`, () => o.signInWithOAuth(i));
4738
4962
  }}
4739
4963
  ?disabled=${!!this.busy}
4740
4964
  >
4741
- ${this.spinner(`connect-${i}`)} ${et(i)}
4742
- ${this.t("connectProvider", { provider: q(i) })}
4965
+ ${this.spinner(`connect-${i}`)} ${Y(i)}
4966
+ ${this.t("connectProvider", { provider: W(i) })}
4743
4967
  </button>`
4744
4968
  )}` : void 0
4745
4969
  )}
@@ -4752,7 +4976,11 @@ let p = class extends E {
4752
4976
  ${this.card(
4753
4977
  this.t("activity"),
4754
4978
  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(
4979
+ r`${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? this.emptyState(
4980
+ l.activity,
4981
+ this.t("noActivity"),
4982
+ this.t("noActivityDescription")
4983
+ ) : e.map(
4756
4984
  (t) => r`<div class="row">
4757
4985
  <div class="row-main">
4758
4986
  <span class="row-title">${t.event}</span>
@@ -4968,12 +5196,12 @@ m([
4968
5196
  d()
4969
5197
  ], p.prototype, "verifyEmailCooldownUntil", 2);
4970
5198
  p = m([
4971
- R("authui-account")
5199
+ T("authui-account")
4972
5200
  ], p);
4973
- var Xt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, F = (e, t, i, s) => {
4974
- for (var a = s > 1 ? void 0 : s ? Qt(t, i) : t, c = e.length - 1, u; c >= 0; c--)
5201
+ var Qt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, F = (e, t, i, s) => {
5202
+ for (var a = s > 1 ? void 0 : s ? Jt(t, i) : t, c = e.length - 1, u; c >= 0; c--)
4975
5203
  (u = e[c]) && (a = (s ? u(t, i, a) : u(a)) || a);
4976
- return s && a && Xt(t, i, a), a;
5204
+ return s && a && Qt(t, i, a), a;
4977
5205
  };
4978
5206
  let P = class extends E {
4979
5207
  constructor() {
@@ -5063,7 +5291,7 @@ let P = class extends E {
5063
5291
  ${this.open ? t ? r`<authui-account embedded></authui-account>` : r`<authui-sign-in
5064
5292
  embedded
5065
5293
  .view=${this.view === "account" ? "sign-in" : this.view}
5066
- ></authui-sign-in>` : o}
5294
+ ></authui-sign-in>` : n}
5067
5295
  </div>
5068
5296
  <div class="scroll-fade ${this.scrollCue ? "show" : ""}" aria-hidden="true"></div>
5069
5297
  </div>
@@ -5168,7 +5396,20 @@ F([
5168
5396
  g({ type: String })
5169
5397
  ], P.prototype, "view", 2);
5170
5398
  F([
5171
- g({ type: Boolean, attribute: "close-on-success" })
5399
+ g({
5400
+ attribute: "close-on-success",
5401
+ reflect: !0,
5402
+ converter: {
5403
+ fromAttribute(e) {
5404
+ if (e === null) return !0;
5405
+ const t = e.trim().toLowerCase();
5406
+ return !(t === "false" || t === "0" || t === "off" || t === "no");
5407
+ },
5408
+ toAttribute(e) {
5409
+ return e ? null : "false";
5410
+ }
5411
+ }
5412
+ })
5172
5413
  ], P.prototype, "closeOnSuccess", 2);
5173
5414
  F([
5174
5415
  d()
@@ -5183,12 +5424,12 @@ F([
5183
5424
  st(".body")
5184
5425
  ], P.prototype, "bodyEl", 2);
5185
5426
  P = F([
5186
- R("authui-modal")
5427
+ T("authui-modal")
5187
5428
  ], P);
5188
- var Jt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, X = (e, t, i, s) => {
5189
- for (var a = s > 1 ? void 0 : s ? te(t, i) : t, c = e.length - 1, u; c >= 0; c--)
5429
+ var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, Q = (e, t, i, s) => {
5430
+ for (var a = s > 1 ? void 0 : s ? ee(t, i) : t, c = e.length - 1, u; c >= 0; c--)
5190
5431
  (u = e[c]) && (a = (s ? u(t, i, a) : u(a)) || a);
5191
- return s && a && Jt(t, i, a), a;
5432
+ return s && a && te(t, i, a), a;
5192
5433
  };
5193
5434
  let L = class extends E {
5194
5435
  constructor() {
@@ -5198,7 +5439,7 @@ let L = class extends E {
5198
5439
  const e = this.size === "md" ? "" : `btn-${this.size}`;
5199
5440
  return r`<button
5200
5441
  class="btn btn-${this.variant} ${e}"
5201
- @click=${() => Y(this.view)}
5442
+ @click=${() => Z(this.view)}
5202
5443
  part="button"
5203
5444
  >
5204
5445
  <slot
@@ -5218,22 +5459,22 @@ L.styles = [
5218
5459
  }
5219
5460
  `
5220
5461
  ];
5221
- X([
5462
+ Q([
5222
5463
  g({ type: String })
5223
5464
  ], L.prototype, "view", 2);
5224
- X([
5465
+ Q([
5225
5466
  g({ type: String })
5226
5467
  ], L.prototype, "variant", 2);
5227
- X([
5468
+ Q([
5228
5469
  g({ type: String })
5229
5470
  ], L.prototype, "size", 2);
5230
- L = X([
5231
- R("authui-button")
5471
+ L = Q([
5472
+ T("authui-button")
5232
5473
  ], L);
5233
- var ee = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, T = (e, t, i, s) => {
5234
- for (var a = s > 1 ? void 0 : s ? ie(t, i) : t, c = e.length - 1, u; c >= 0; c--)
5474
+ var ie = Object.defineProperty, se = Object.getOwnPropertyDescriptor, R = (e, t, i, s) => {
5475
+ for (var a = s > 1 ? void 0 : s ? se(t, i) : t, c = e.length - 1, u; c >= 0; c--)
5235
5476
  (u = e[c]) && (a = (s ? u(t, i, a) : u(a)) || a);
5236
- return s && a && ee(t, i, a), a;
5477
+ return s && a && ie(t, i, a), a;
5237
5478
  };
5238
5479
  let I = class extends E {
5239
5480
  constructor() {
@@ -5259,7 +5500,7 @@ let I = class extends E {
5259
5500
  }, this.toggleMenu = () => {
5260
5501
  this.menuOpen = !this.menuOpen, this.menuOpen && this.showTeams && this.loadTeams();
5261
5502
  }, this.selectTeam = (e) => {
5262
- n.setActiveTeam({ $id: e.$id, name: e.name }), this.activeTeamId = e.$id, this.dispatchEvent(
5503
+ o.setActiveTeam({ $id: e.$id, name: e.name }), this.activeTeamId = e.$id, this.dispatchEvent(
5263
5504
  new CustomEvent("authui-active-team", {
5264
5505
  detail: { teamId: e.$id, team: e },
5265
5506
  bubbles: !0,
@@ -5280,9 +5521,9 @@ let I = class extends E {
5280
5521
  if (!e || !t) return;
5281
5522
  const i = e.getBoundingClientRect(), s = 6, a = 8;
5282
5523
  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);
5524
+ const c = t.offsetHeight + s, u = window.innerHeight - i.bottom, b = i.top, $ = u < c && b > u;
5525
+ $ !== this.menuAbove && (this.menuAbove = $);
5526
+ const ot = Math.max(80, ($ ? b : u) - s - a);
5286
5527
  t.style.maxHeight = `${ot}px`;
5287
5528
  }
5288
5529
  focusMenuItem(e) {
@@ -5296,9 +5537,9 @@ let I = class extends E {
5296
5537
  })) : this.menuAbove = !1), this.menuOpen && (e.has("teams") || e.has("teamsLoading")) && requestAnimationFrame(() => this.placeMenu());
5297
5538
  }
5298
5539
  async loadTeams() {
5299
- this.teamsLoading = !0, this.activeTeamId = n.getActiveTeamId();
5540
+ this.teamsLoading = !0, this.activeTeamId = o.getActiveTeamId();
5300
5541
  try {
5301
- this.teams = await n.listTeams(), this.activeTeamId && !this.teams.some((e) => e.$id === this.activeTeamId) && (this.activeTeamId = null, n.setActiveTeam(null));
5542
+ this.teams = await o.listTeams(), this.activeTeamId && !this.teams.some((e) => e.$id === this.activeTeamId) && (this.activeTeamId = null, o.setActiveTeam(null));
5302
5543
  } catch {
5303
5544
  this.teams = [];
5304
5545
  } finally {
@@ -5310,7 +5551,7 @@ let I = class extends E {
5310
5551
  if (e === "loading" && i)
5311
5552
  return r`<span class="avatar"><span class="spinner"></span></span>`;
5312
5553
  if (e !== "signed-in" || !t)
5313
- return r`<button class="btn btn-primary btn-sm" @click=${() => Y("sign-in")}>
5554
+ return r`<button class="btn btn-primary btn-sm" @click=${() => Z("sign-in")}>
5314
5555
  <slot>${this.t("signIn")}</slot>
5315
5556
  </button>`;
5316
5557
  const s = t.name || t.email || t.phone || this.t("guestAccount");
@@ -5329,7 +5570,7 @@ let I = class extends E {
5329
5570
  ${this.menuOpen ? r`<div class="menu ${this.menuAbove ? "above" : ""}" role="menu">
5330
5571
  <div class="menu-header">
5331
5572
  <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}
5573
+ ${t.email && t.name ? r`<span class="row-sub" title=${t.email}>${t.email}</span>` : n}
5333
5574
  </div>
5334
5575
  ${this.showTeams ? r`<div class="menu-section">
5335
5576
  <div class="menu-section-label">${this.t("teamsLabel")}</div>
@@ -5344,15 +5585,15 @@ let I = class extends E {
5344
5585
  >
5345
5586
  ${l.users}
5346
5587
  <span title=${a.name}>${a.name}</span>
5347
- ${a.$id === this.activeTeamId ? r`<span class="check">${l.check}</span>` : o}
5588
+ ${a.$id === this.activeTeamId ? r`<span class="check">${l.check}</span>` : n}
5348
5589
  </button>`
5349
5590
  )}
5350
- </div>` : o}
5591
+ </div>` : n}
5351
5592
  <button
5352
5593
  class="menu-item"
5353
5594
  role="menuitem"
5354
5595
  @click=${() => {
5355
- this.menuOpen = !1, Y("account");
5596
+ this.menuOpen = !1, Z("account");
5356
5597
  }}
5357
5598
  >
5358
5599
  ${l.settings} ${this.t("manageAccount")}
@@ -5361,12 +5602,12 @@ let I = class extends E {
5361
5602
  class="menu-item"
5362
5603
  role="menuitem"
5363
5604
  @click=${() => {
5364
- this.menuOpen = !1, n.signOut();
5605
+ this.menuOpen = !1, o.signOut();
5365
5606
  }}
5366
5607
  >
5367
5608
  ${l.logOut} ${this.t("signOut")}
5368
5609
  </button>
5369
- </div>` : o}
5610
+ </div>` : n}
5370
5611
  `;
5371
5612
  }
5372
5613
  };
@@ -5488,59 +5729,60 @@ I.styles = [
5488
5729
  }
5489
5730
  `
5490
5731
  ];
5491
- T([
5732
+ R([
5492
5733
  g({ type: Boolean, attribute: "show-teams" })
5493
5734
  ], I.prototype, "showTeams", 2);
5494
- T([
5735
+ R([
5495
5736
  g({ type: String })
5496
5737
  ], I.prototype, "src", 2);
5497
- T([
5738
+ R([
5498
5739
  d()
5499
5740
  ], I.prototype, "menuOpen", 2);
5500
- T([
5741
+ R([
5501
5742
  d()
5502
5743
  ], I.prototype, "menuAbove", 2);
5503
- T([
5744
+ R([
5504
5745
  d()
5505
5746
  ], I.prototype, "teams", 2);
5506
- T([
5747
+ R([
5507
5748
  d()
5508
5749
  ], I.prototype, "teamsLoading", 2);
5509
- T([
5750
+ R([
5510
5751
  d()
5511
5752
  ], I.prototype, "activeTeamId", 2);
5512
- I = T([
5513
- R("authui-user-button")
5753
+ I = R([
5754
+ T("authui-user-button")
5514
5755
  ], I);
5515
5756
  export {
5516
5757
  Ft as A,
5517
- oe as C,
5758
+ le as C,
5518
5759
  f as E,
5519
5760
  bt as F,
5520
5761
  It as P,
5521
- n as a,
5762
+ o as a,
5522
5763
  p as b,
5523
- le as c,
5764
+ ce as c,
5524
5765
  L as d,
5525
- b as e,
5766
+ y as e,
5526
5767
  E as f,
5527
5768
  P as g,
5528
- B as h,
5769
+ N as h,
5529
5770
  k as i,
5530
5771
  I as j,
5531
- ne as k,
5772
+ oe as k,
5532
5773
  pt as l,
5533
5774
  Ct as m,
5534
5775
  K as n,
5535
- Y as o,
5536
- D as p,
5776
+ Z as o,
5777
+ z as p,
5537
5778
  ut as q,
5538
5779
  Ut as r,
5539
- q as s,
5780
+ W as s,
5540
5781
  V as t,
5541
5782
  wt as u,
5542
5783
  it as v,
5543
5784
  Mt as w,
5544
5785
  Ot as x,
5545
- z as y
5786
+ _ as y,
5787
+ jt as z
5546
5788
  };