@streamoid/settings 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -41,11 +41,13 @@ __export(index_exports, {
41
41
  ExportDateModal: () => ExportDateModal,
42
42
  INITIAL_USAGE_LOGS_STATE: () => INITIAL_USAGE_LOGS_STATE,
43
43
  InviteUpdateModal: () => InviteUpdateModal,
44
+ MOCK_REFERRED_USERS: () => MOCK_REFERRED_USERS,
44
45
  MemberCreditLimitModal: () => MemberCreditLimitModal,
45
46
  MemberListFrame: () => MemberListFrame,
46
47
  MemberListToolbar: () => MemberListToolbar,
47
48
  OrganizationContent: () => OrganizationContent,
48
49
  OrganizationIntegrationsContent: () => OrganizationIntegrationsContent,
50
+ OrganizationLoginMethodsContent: () => OrganizationLoginMethodsContent,
49
51
  OrganizationMemberModal: () => OrganizationMemberModal,
50
52
  OrganizationModal: () => OrganizationModal,
51
53
  OrganizationPicker: () => OrganizationPicker,
@@ -56,6 +58,7 @@ __export(index_exports, {
56
58
  ProfileAvatar: () => ProfileAvatar,
57
59
  ProfileTab: () => ProfileTab,
58
60
  REMOVE_REASON_MAX_LENGTH: () => REMOVE_REASON_MAX_LENGTH,
61
+ ReferralHistoryView: () => ReferralHistoryView,
59
62
  ReferralTab: () => ReferralTab,
60
63
  RemovePoolMemberModal: () => RemovePoolMemberModal,
61
64
  SCOPE_LABELS: () => SCOPE_LABELS,
@@ -118,6 +121,7 @@ __export(index_exports, {
118
121
  limitSourceLabel: () => limitSourceLabel,
119
122
  loadCurrentPlan: () => loadCurrentPlan,
120
123
  loadWorkspaceOrganization: () => loadWorkspaceOrganization,
124
+ loginMethodsSwitchState: () => loginMethodsSwitchState,
121
125
  memberRoleUpdate: () => memberRoleUpdate,
122
126
  minPoolEndDate: () => minPoolEndDate,
123
127
  minimumCreditLimit: () => minimumCreditLimit,
@@ -132,7 +136,9 @@ __export(index_exports, {
132
136
  productsForCountry: () => productsForCountry,
133
137
  readSettingsCaller: () => readSettingsCaller,
134
138
  referralCodeOf: () => referralCodeOf,
139
+ referralCountLabel: () => referralCountLabel,
135
140
  referralLink: () => referralLink,
141
+ referralSignupDate: () => referralSignupDate,
136
142
  rememberSettingsCaller: () => rememberSettingsCaller,
137
143
  resolveSettingsTabFromPath: () => resolveSettingsTabFromPath,
138
144
  roundCredits: () => roundCredits,
@@ -140,6 +146,7 @@ __export(index_exports, {
140
146
  sharedPoolBannerText: () => sharedPoolBannerText,
141
147
  sharedPoolEndsText: () => sharedPoolEndsText,
142
148
  sliceUsageLogsPage: () => sliceUsageLogsPage,
149
+ sortReferredUsers: () => sortReferredUsers,
143
150
  sponsoredCreditsText: () => sponsoredCreditsText,
144
151
  toCsv: () => toCsv,
145
152
  toLocalDateInput: () => toLocalDateInput,
@@ -424,7 +431,8 @@ var TAB_SCOPE = {
424
431
  billing: "workspace",
425
432
  apikey: "workspace",
426
433
  connectedApps: "account",
427
- organizationIntegrations: "organization"
434
+ organizationIntegrations: "organization",
435
+ organizationLoginMethods: "organization"
428
436
  };
429
437
  var SCOPE_LABELS = {
430
438
  account: "Account",
@@ -445,7 +453,8 @@ var TAB_TO_URL = {
445
453
  billing: "billing",
446
454
  apikey: "api-keys",
447
455
  connectedApps: "connected-apps",
448
- organizationIntegrations: "organization/integrations"
456
+ organizationIntegrations: "organization/integrations",
457
+ organizationLoginMethods: "organization/login-methods"
449
458
  };
450
459
  var URL_TO_TAB = {
451
460
  /* Canonical, scope-first slugs. */
@@ -456,6 +465,7 @@ var URL_TO_TAB = {
456
465
  "organization/people": "organization",
457
466
  "organization/workspaces": "organizationWorkspaces",
458
467
  "organization/integrations": "organizationIntegrations",
468
+ "organization/login-methods": "organizationLoginMethods",
459
469
  /* The Domains tab is gone; its join requests live under Workspaces. */
460
470
  "organization/domains": "organizationWorkspaces",
461
471
  /* Unscoped destinations. */
@@ -487,7 +497,8 @@ var TAB_LABELS = {
487
497
  billing: "Billing & usage",
488
498
  apikey: "API Keys",
489
499
  connectedApps: "Connected apps",
490
- organizationIntegrations: "Integrations"
500
+ organizationIntegrations: "Integrations",
501
+ organizationLoginMethods: "Login methods"
491
502
  };
492
503
  var TAB_DESCRIPTIONS = {
493
504
  profile: "Your name, photo, language and personalisation",
@@ -502,7 +513,8 @@ var TAB_DESCRIPTIONS = {
502
513
  billing: "Workspace plan, credits, invoices and usage history",
503
514
  apikey: "Create and revoke keys for calling the Streamoid APIs",
504
515
  connectedApps: "Apps like ChatGPT and Codex that you've allowed to use CXO for you",
505
- organizationIntegrations: "Turn ChatGPT and Codex on for the organization, and revoke any member's connection"
516
+ organizationIntegrations: "Turn ChatGPT and Codex on for the organization, and revoke any member's connection",
517
+ organizationLoginMethods: "Choose whether people sign in with an email code, company SSO, or either"
506
518
  };
507
519
  function resolveSettingsTabFromPath(path) {
508
520
  const segments = path.split("/").filter(Boolean);
@@ -540,6 +552,7 @@ function AdministrationOverview({
540
552
  isWorkspaceAdmin,
541
553
  showConnectedApps,
542
554
  showIntegrations,
555
+ showLoginMethods = false,
543
556
  showReferral = false,
544
557
  canInvite,
545
558
  onNavigate,
@@ -558,7 +571,7 @@ function AdministrationOverview({
558
571
  {
559
572
  title: "Organization",
560
573
  scopeName: hasOrganization ? organizationName : null,
561
- tabs: ["organizationList", ...hasOrganization ? ["organization", "organizationWorkspaces"] : [], ...showIntegrations ? ["organizationIntegrations"] : []]
574
+ tabs: ["organizationList", ...hasOrganization ? ["organization", "organizationWorkspaces"] : [], ...showIntegrations ? ["organizationIntegrations"] : [], ...showLoginMethods ? ["organizationLoginMethods"] : []]
562
575
  }
563
576
  ];
564
577
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: administration_overview_default.overview, children: groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: administration_overview_default.section, "aria-label": group.scopeName ? `${group.title} \xB7 ${group.scopeName}` : group.title, children: [
@@ -762,11 +775,11 @@ function useWorkspaceOrganization({
762
775
  }
763
776
 
764
777
  // src/settings-content.tsx
765
- var import_react27 = require("react");
766
- var import_ui21 = require("@streamoid/ui");
778
+ var import_react28 = require("react");
767
779
  var import_ui22 = require("@streamoid/ui");
768
780
  var import_ui23 = require("@streamoid/ui");
769
781
  var import_ui24 = require("@streamoid/ui");
782
+ var import_ui25 = require("@streamoid/ui");
770
783
  var import_icons18 = require("@streamoid/icons");
771
784
 
772
785
  // src/icons/SiconKey.tsx
@@ -9786,7 +9799,11 @@ function Spinner() {
9786
9799
  }
9787
9800
  );
9788
9801
  }
9789
- function LoadError({ message, onRetry }) {
9802
+ function LoadError({
9803
+ message,
9804
+ onRetry,
9805
+ retryLabel = "Try again"
9806
+ }) {
9790
9807
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
9791
9808
  "div",
9792
9809
  {
@@ -9801,7 +9818,7 @@ function LoadError({ message, onRetry }) {
9801
9818
  },
9802
9819
  children: [
9803
9820
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { style: { margin: 0, fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.primary }, children: message }),
9804
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_ui13.ScButton, { text: "Try again", variant: "outline", size: "sm", onClick: onRetry })
9821
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_ui13.ScButton, { text: retryLabel, variant: "outline", size: "sm", onClick: onRetry })
9805
9822
  ]
9806
9823
  }
9807
9824
  );
@@ -14493,14 +14510,158 @@ function referralCodeOf(user) {
14493
14510
  function referralLink(code, origin) {
14494
14511
  return code && origin ? `${origin}?referral_code=${encodeURIComponent(code)}` : "";
14495
14512
  }
14513
+ var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
14514
+ function referralSignupDate(iso) {
14515
+ const date = iso ? new Date(iso) : null;
14516
+ if (!date || Number.isNaN(date.valueOf())) return "\u2013";
14517
+ return `${date.getDate()} ${MONTHS[date.getMonth()]} ${date.getFullYear()}`;
14518
+ }
14519
+ function sortReferredUsers(users) {
14520
+ const time = (u) => {
14521
+ const t = new Date(u.createdAt).valueOf();
14522
+ return Number.isNaN(t) ? -Infinity : t;
14523
+ };
14524
+ return [...users].sort((a, b) => time(b) - time(a));
14525
+ }
14526
+ function referralCountLabel(count) {
14527
+ return `${count} ${count === 1 ? "person" : "people"} signed up with your link`;
14528
+ }
14529
+ var MOCK_REFERRED_USERS = [
14530
+ { id: "r1", email: "chris@kepler.com", createdAt: "2025-11-09T10:30:00.000Z" },
14531
+ { id: "r2", email: "maya@northwind.studio", createdAt: "2026-11-24T06:15:00.000Z" },
14532
+ { id: "r3", email: "arjun@lumen.co", createdAt: "2026-03-02T12:00:00.000Z" }
14533
+ ];
14534
+
14535
+ // src/referral-history.tsx
14536
+ var import_jsx_runtime32 = require("react/jsx-runtime");
14537
+ var TITLE_ID = "settings-referral-history-title";
14538
+ var SKELETON_ROWS = 3;
14539
+ var REFERRAL_HISTORY_EMPTY = "No one has signed up with your link yet. Share it to get started.";
14540
+ var LOAD_FAILED = "Couldn't load your referral history.";
14541
+ function ReferralHistory({
14542
+ load
14543
+ }) {
14544
+ const { value, error, retry } = useLoad(
14545
+ "referred-users",
14546
+ (signal) => load(signal),
14547
+ LOAD_FAILED
14548
+ );
14549
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ReferralHistoryView, { users: value, error, onRetry: retry });
14550
+ }
14551
+ function ReferralHistoryView({ users, error, onRetry }) {
14552
+ let body;
14553
+ if (error) {
14554
+ body = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LoadError, { message: error, onRetry, retryLabel: "Retry" });
14555
+ } else if (!users) {
14556
+ body = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(HistorySkeleton, {});
14557
+ } else if (users.length === 0) {
14558
+ body = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Card2, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { style: { padding: T15.sp6xl }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Muted, { children: REFERRAL_HISTORY_EMPTY }) }) });
14559
+ } else {
14560
+ body = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(HistoryTable, { users: sortReferredUsers(users) });
14561
+ }
14562
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("section", { "aria-labelledby": TITLE_ID, className: "flex flex-col w-full", style: { gap: T15.spXl }, children: [
14563
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col", style: { gap: T15.spXs }, children: [
14564
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14565
+ "h2",
14566
+ {
14567
+ id: TITLE_ID,
14568
+ style: {
14569
+ margin: 0,
14570
+ fontFamily: T15.font,
14571
+ fontSize: T15.fsSm,
14572
+ fontWeight: 400,
14573
+ lineHeight: T15.lhSm,
14574
+ color: "var(--alias-text---icons-tertiary)"
14575
+ },
14576
+ children: "Referral History"
14577
+ }
14578
+ ),
14579
+ !error && users && users.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Muted, { children: referralCountLabel(users.length) })
14580
+ ] }),
14581
+ body
14582
+ ] });
14583
+ }
14584
+ function Card2({ children }) {
14585
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14586
+ "div",
14587
+ {
14588
+ className: "w-full overflow-clip",
14589
+ style: {
14590
+ backgroundColor: T15.surfaceBase,
14591
+ border: `1px solid ${T15.borderSubtle}`,
14592
+ borderRadius: T15.r3xl
14593
+ },
14594
+ children
14595
+ }
14596
+ );
14597
+ }
14598
+ var CELL = { padding: `${T15.spXl} ${T15.sp6xl}`, textAlign: "left" };
14599
+ var HEAD_CELL = {
14600
+ ...CELL,
14601
+ fontFamily: T15.font,
14602
+ fontSize: T15.fsXs,
14603
+ lineHeight: T15.lhXs,
14604
+ fontWeight: 500,
14605
+ color: T15.muted
14606
+ };
14607
+ var BODY_CELL = {
14608
+ ...CELL,
14609
+ fontFamily: T15.font,
14610
+ fontSize: T15.fsSm,
14611
+ lineHeight: T15.lhSm,
14612
+ borderTop: `1px solid ${T15.borderDivider}`
14613
+ };
14614
+ function HistoryTable({ users }) {
14615
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Card2, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("table", { className: "w-full", style: { borderCollapse: "collapse" }, children: [
14616
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("tr", { children: [
14617
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("th", { scope: "col", style: HEAD_CELL, children: "Email" }),
14618
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("th", { scope: "col", style: { ...HEAD_CELL, textAlign: "right" }, children: "Signed up" })
14619
+ ] }) }),
14620
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("tbody", { children: users.map((user) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("tr", { children: [
14621
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { style: { ...BODY_CELL, color: T15.primary, wordBreak: "break-all" }, children: user.email }),
14622
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { style: { ...BODY_CELL, color: T15.muted, textAlign: "right", whiteSpace: "nowrap" }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("time", { dateTime: user.createdAt, children: referralSignupDate(user.createdAt) }) })
14623
+ ] }, user.id)) })
14624
+ ] }) });
14625
+ }
14626
+ function Bar({ width }) {
14627
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14628
+ "div",
14629
+ {
14630
+ className: "animate-pulse",
14631
+ style: {
14632
+ width,
14633
+ height: 12,
14634
+ borderRadius: "var(--radius-full)",
14635
+ backgroundColor: "var(--alias-fill-neutral-neutral)"
14636
+ }
14637
+ }
14638
+ );
14639
+ }
14640
+ function HistorySkeleton() {
14641
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { role: "status", "aria-label": "Loading referral history", className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Card2, { children: Array.from({ length: SKELETON_ROWS }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
14642
+ "div",
14643
+ {
14644
+ className: "flex items-center justify-between",
14645
+ style: {
14646
+ padding: `${T15.spXl} ${T15.sp6xl}`,
14647
+ borderTop: i === 0 ? void 0 : `1px solid ${T15.borderDivider}`
14648
+ },
14649
+ children: [
14650
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Bar, { width: 180 }),
14651
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Bar, { width: 72 })
14652
+ ]
14653
+ },
14654
+ i
14655
+ )) }) });
14656
+ }
14496
14657
 
14497
14658
  // src/organization-integrations-content.tsx
14498
14659
  var import_react26 = require("react");
14499
14660
  var import_ui20 = require("@streamoid/ui");
14500
- var import_jsx_runtime32 = require("react/jsx-runtime");
14661
+ var import_jsx_runtime33 = require("react/jsx-runtime");
14501
14662
  var COLUMN = { app: "6.5rem", workspace: "9rem", date: "6.5rem", action: "4.75rem" };
14502
14663
  function HeaderRow() {
14503
- const cell = (label, width) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14664
+ const cell = (label, width) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14504
14665
  "span",
14505
14666
  {
14506
14667
  className: width ? "shrink-0" : "flex-1 min-w-0",
@@ -14518,7 +14679,7 @@ function HeaderRow() {
14518
14679
  children: label
14519
14680
  }
14520
14681
  );
14521
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
14682
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
14522
14683
  "div",
14523
14684
  {
14524
14685
  className: "flex items-center",
@@ -14529,7 +14690,7 @@ function HeaderRow() {
14529
14690
  cell("Workspace", COLUMN.workspace),
14530
14691
  cell("Connected", COLUMN.date),
14531
14692
  cell("Last used", COLUMN.date),
14532
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "shrink-0", style: { width: COLUMN.action } })
14693
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "shrink-0", style: { width: COLUMN.action } })
14533
14694
  ]
14534
14695
  }
14535
14696
  );
@@ -14538,7 +14699,7 @@ function ConnectionRow({ app, onRevoke }) {
14538
14699
  const name = app.user?.name?.trim();
14539
14700
  const email = app.user?.email ?? "";
14540
14701
  const active = app.status === "active";
14541
- const text2 = (value, width, color = T15.primary) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14702
+ const text2 = (value, width, color = T15.primary) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14542
14703
  "span",
14543
14704
  {
14544
14705
  className: "truncate shrink-0",
@@ -14547,7 +14708,7 @@ function ConnectionRow({ app, onRevoke }) {
14547
14708
  children: value
14548
14709
  }
14549
14710
  );
14550
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
14711
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
14551
14712
  "div",
14552
14713
  {
14553
14714
  className: "flex items-center",
@@ -14558,10 +14719,10 @@ function ConnectionRow({ app, onRevoke }) {
14558
14719
  opacity: active ? 1 : 0.6
14559
14720
  },
14560
14721
  children: [
14561
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center flex-1 min-w-0", style: { minWidth: 200, gap: T15.spMd }, children: [
14562
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ProfileAvatar, { name: name || email || "Member", size: 32 }),
14563
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col min-w-0", children: [
14564
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14722
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center flex-1 min-w-0", style: { minWidth: 200, gap: T15.spMd }, children: [
14723
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ProfileAvatar, { name: name || email || "Member", size: 32 }),
14724
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col min-w-0", children: [
14725
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14565
14726
  "span",
14566
14727
  {
14567
14728
  className: "truncate",
@@ -14569,17 +14730,17 @@ function ConnectionRow({ app, onRevoke }) {
14569
14730
  children: name || email || "A member"
14570
14731
  }
14571
14732
  ),
14572
- name && email && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "truncate", style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.muted }, children: email })
14733
+ name && email && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "truncate", style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.muted }, children: email })
14573
14734
  ] })
14574
14735
  ] }),
14575
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center shrink-0", style: { width: COLUMN.app, gap: T15.spMd }, children: [
14576
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AppMark, { name: app.clientName, size: 24 }),
14577
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "truncate", style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.primary }, children: app.clientName })
14736
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center shrink-0", style: { width: COLUMN.app, gap: T15.spMd }, children: [
14737
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AppMark, { name: app.clientName, size: 24 }),
14738
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "truncate", style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.primary }, children: app.clientName })
14578
14739
  ] }),
14579
14740
  text2(workspaceLabel(app), COLUMN.workspace),
14580
14741
  text2(formatDate2(app.createdAt), COLUMN.date),
14581
14742
  text2(active ? lastUsedLabel(app.lastUsedAt) : "Revoked", COLUMN.date, T15.muted),
14582
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex justify-end shrink-0", style: { width: COLUMN.action }, children: active && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14743
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex justify-end shrink-0", style: { width: COLUMN.action }, children: active && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14583
14744
  import_ui20.ScButton,
14584
14745
  {
14585
14746
  text: "Revoke",
@@ -14599,7 +14760,7 @@ function AccessCard({
14599
14760
  activeCount,
14600
14761
  onToggle
14601
14762
  }) {
14602
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
14763
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
14603
14764
  "section",
14604
14765
  {
14605
14766
  "aria-label": "ChatGPT and Codex access",
@@ -14612,19 +14773,19 @@ function AccessCard({
14612
14773
  borderRadius: T15.r3xl
14613
14774
  },
14614
14775
  children: [
14615
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AppMark, { name: "ChatGPT and Codex" }),
14616
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col flex-1 min-w-0", style: { gap: T15.spXs }, children: [
14617
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { style: { fontFamily: T15.font, fontSize: T15.fsMd, fontWeight: 600, lineHeight: T15.lhMd, color: T15.primary }, children: "ChatGPT & Codex" }),
14618
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Muted, { children: "Let members use CXO from ChatGPT and Codex. Each member still chooses which workspace an app can reach, and the app gets only that member's permissions there." }),
14619
- enabled === false && activeCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.primary }, children: [
14776
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AppMark, { name: "ChatGPT and Codex" }),
14777
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col flex-1 min-w-0", style: { gap: T15.spXs }, children: [
14778
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: { fontFamily: T15.font, fontSize: T15.fsMd, fontWeight: 600, lineHeight: T15.lhMd, color: T15.primary }, children: "ChatGPT & Codex" }),
14779
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Muted, { children: "Let members use CXO from ChatGPT and Codex. Each member still chooses which workspace an app can reach, and the app gets only that member's permissions there." }),
14780
+ enabled === false && activeCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.primary }, children: [
14620
14781
  "Off: the ",
14621
14782
  countLabel(activeCount, "connection"),
14622
14783
  " below can't start new work until you turn this back on."
14623
14784
  ] })
14624
14785
  ] }),
14625
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center shrink-0", style: { alignSelf: "center", gap: T15.spMd, minHeight: 26 }, children: [
14626
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.muted }, children: enabled === null ? "" : enabled ? "On" : "Off" }),
14627
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { style: { display: "inline-flex", width: 41, height: 25, alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14786
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center shrink-0", style: { alignSelf: "center", gap: T15.spMd, minHeight: 26 }, children: [
14787
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.muted }, children: enabled === null ? "" : enabled ? "On" : "Off" }),
14788
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: { display: "inline-flex", width: 41, height: 25, alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14628
14789
  import_ui20.ScToggleSwitch,
14629
14790
  {
14630
14791
  checked: !!enabled,
@@ -14670,7 +14831,7 @@ function OrganizationIntegrationsContent() {
14670
14831
  const [confirmOff, setConfirmOff] = (0, import_react26.useState)(false);
14671
14832
  const [revoking, setRevoking] = (0, import_react26.useState)(null);
14672
14833
  if (!canLoad) {
14673
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex flex-col flex-1 min-w-0", style: { gap: T15.sp3xl }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Muted, { children: !supported ? "Integrations aren't available here yet." : "Integrations are managed by organization admins." }) });
14834
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col flex-1 min-w-0", style: { gap: T15.sp3xl }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Muted, { children: !supported ? "Integrations aren't available here yet." : "Integrations are managed by organization admins." }) });
14674
14835
  }
14675
14836
  const value = data.value;
14676
14837
  const rows = value ? sortConnections(value.rows) : [];
@@ -14708,8 +14869,8 @@ function OrganizationIntegrationsContent() {
14708
14869
  toast.error(errorMessage(cause, { method: "DELETE" }));
14709
14870
  }
14710
14871
  }
14711
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", style: { gap: T15.sp3xl }, children: [
14712
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14872
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", style: { gap: T15.sp3xl }, children: [
14873
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14713
14874
  ScopeHeader,
14714
14875
  {
14715
14876
  kind: "organization",
@@ -14719,10 +14880,10 @@ function OrganizationIntegrationsContent() {
14719
14880
  facts: [value && countLabel(activeRows.length, "active connection")]
14720
14881
  }
14721
14882
  ),
14722
- data.error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LoadError, { message: data.error, onRetry: data.retry }),
14723
- !value && !data.error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Spinner, {}),
14724
- value && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
14725
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14883
+ data.error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(LoadError, { message: data.error, onRetry: data.retry }),
14884
+ !value && !data.error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Spinner, {}),
14885
+ value && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
14886
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14726
14887
  AccessCard,
14727
14888
  {
14728
14889
  enabled: value.enabled,
@@ -14731,7 +14892,7 @@ function OrganizationIntegrationsContent() {
14731
14892
  onToggle: (next) => next ? void setAccess(true) : setConfirmOff(true)
14732
14893
  }
14733
14894
  ),
14734
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14895
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14735
14896
  MemberListToolbar,
14736
14897
  {
14737
14898
  activeTab: "active",
@@ -14741,7 +14902,7 @@ function OrganizationIntegrationsContent() {
14741
14902
  activeCount: visible.length,
14742
14903
  searchQuery: search,
14743
14904
  onSearchChange: setSearch,
14744
- action: revokedCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14905
+ action: revokedCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14745
14906
  import_ui20.ScButton,
14746
14907
  {
14747
14908
  text: showRevoked ? "Hide revoked" : `Show revoked (${revokedCount})`,
@@ -14752,30 +14913,30 @@ function OrganizationIntegrationsContent() {
14752
14913
  ) : void 0
14753
14914
  }
14754
14915
  ),
14755
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14916
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14756
14917
  MemberListFrame,
14757
14918
  {
14758
- header: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(HeaderRow, {}),
14919
+ header: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(HeaderRow, {}),
14759
14920
  isEmpty: visible.length === 0,
14760
14921
  emptyText: q ? "No connections match your search" : value.enabled ? "No one has connected ChatGPT or Codex yet" : "Turn on ChatGPT & Codex to let members connect",
14761
14922
  grow: "fill",
14762
- children: visible.map((app) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ConnectionRow, { app, onRevoke: () => setRevoking(app) }, app.id))
14923
+ children: visible.map((app) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ConnectionRow, { app, onRevoke: () => setRevoking(app) }, app.id))
14763
14924
  }
14764
14925
  )
14765
14926
  ] }),
14766
- confirmOff && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14927
+ confirmOff && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14767
14928
  ConfirmActionModal,
14768
14929
  {
14769
14930
  title: "Turn off ChatGPT & Codex?",
14770
- body: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
14771
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { children: [
14931
+ body: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
14932
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
14772
14933
  "Members of ",
14773
14934
  current?.name || "this organization",
14774
14935
  " won't be able to connect ChatGPT or Codex",
14775
14936
  activeRows.length > 0 ? `, and the ${countLabel(activeRows.length, "existing connection")} will stop working` : "",
14776
14937
  "."
14777
14938
  ] }),
14778
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { style: { color: T15.muted, fontSize: T15.fsSm, lineHeight: T15.lhSm }, children: [
14939
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { style: { color: T15.muted, fontSize: T15.fsSm, lineHeight: T15.lhSm }, children: [
14779
14940
  REVOKE_TIMING,
14780
14941
  " Connections come back when you turn this on again."
14781
14942
  ] })
@@ -14786,20 +14947,20 @@ function OrganizationIntegrationsContent() {
14786
14947
  onConfirm: () => setAccess(false)
14787
14948
  }
14788
14949
  ),
14789
- revoking && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14950
+ revoking && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14790
14951
  ConfirmActionModal,
14791
14952
  {
14792
14953
  title: `Revoke ${revoking.clientName}?`,
14793
- body: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
14794
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { children: [
14954
+ body: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
14955
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
14795
14956
  revoking.user?.name || revoking.user?.email || "This member",
14796
14957
  "'s ",
14797
14958
  revoking.clientName,
14798
14959
  " will no longer be able to use CXO in ",
14799
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { style: { fontWeight: 600 }, children: workspaceLabel(revoking) }),
14960
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: { fontWeight: 600 }, children: workspaceLabel(revoking) }),
14800
14961
  "."
14801
14962
  ] }),
14802
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { style: { color: T15.muted, fontSize: T15.fsSm, lineHeight: T15.lhSm }, children: [
14963
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { style: { color: T15.muted, fontSize: T15.fsSm, lineHeight: T15.lhSm }, children: [
14803
14964
  REVOKE_TIMING,
14804
14965
  " They can connect again unless you turn access off."
14805
14966
  ] })
@@ -14813,8 +14974,271 @@ function OrganizationIntegrationsContent() {
14813
14974
  ] });
14814
14975
  }
14815
14976
 
14977
+ // src/organization-login-methods-content.tsx
14978
+ var import_react27 = require("react");
14979
+ var import_ui21 = require("@streamoid/ui");
14980
+ var import_jsx_runtime34 = require("react/jsx-runtime");
14981
+ var AT_LEAST_ONE_HINT = "At least one login method must stay on, or nobody can sign in.";
14982
+ var NO_SSO_HINT = "Company SSO isn't set up for your organization. Contact Streamoid to set it up.";
14983
+ var SELF_GUARD_HINT = "Sign in once with company SSO before turning email codes off.";
14984
+ var SESSION_NOTE = "People already signed in stay signed in until their session ends (up to 7 days).";
14985
+ function loginMethodsSwitchState(data) {
14986
+ const hasConnection = !!data.connection;
14987
+ let emailHint = null;
14988
+ if (data.emailCode) {
14989
+ if (!hasConnection) emailHint = null;
14990
+ else if (!data.sso) emailHint = AT_LEAST_ONE_HINT;
14991
+ else if (data.constraints.selfLockoutGuard) emailHint = SELF_GUARD_HINT;
14992
+ }
14993
+ const emailLocked = data.emailCode && (!data.constraints.canDisableEmailCode || data.constraints.selfLockoutGuard);
14994
+ let ssoHint = null;
14995
+ if (!hasConnection) ssoHint = NO_SSO_HINT;
14996
+ else if (data.sso && !data.emailCode) ssoHint = AT_LEAST_ONE_HINT;
14997
+ const ssoLocked = !hasConnection || data.sso && !data.emailCode;
14998
+ return {
14999
+ emailCode: { checked: data.emailCode, disabled: emailLocked, hint: emailHint },
15000
+ sso: { checked: data.sso, disabled: ssoLocked, hint: ssoHint }
15001
+ };
15002
+ }
15003
+ var domainsLabel = (domains) => domains.length ? domains.map((d) => `@${d}`).join(" or ") : "your organization's";
15004
+ var memberCsv = (members) => toCsv([["Name", "Email", "Role"], ...members.map((m) => [m.name ?? "", m.email, m.role])]);
15005
+ function SwitchRow({
15006
+ title,
15007
+ description,
15008
+ state,
15009
+ busy,
15010
+ onToggle
15011
+ }) {
15012
+ const disabled = state.disabled || busy;
15013
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-start w-full", style: { gap: T15.spXl }, children: [
15014
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col flex-1 min-w-0", style: { gap: T15.spXs }, children: [
15015
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { style: { fontFamily: T15.font, fontSize: T15.fsMd, fontWeight: 600, lineHeight: T15.lhMd, color: T15.primary }, children: title }),
15016
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Muted, { children: description }),
15017
+ state.hint && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.primary }, children: state.hint })
15018
+ ] }),
15019
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center shrink-0", style: { alignSelf: "center", gap: T15.spMd, minHeight: 26 }, children: [
15020
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.muted }, children: state.checked ? "On" : "Off" }),
15021
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { style: { display: "inline-flex", width: 41, height: 25, alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
15022
+ import_ui21.ScToggleSwitch,
15023
+ {
15024
+ checked: state.checked,
15025
+ disabled,
15026
+ onToggle,
15027
+ role: "switch",
15028
+ "aria-checked": state.checked,
15029
+ "aria-disabled": disabled,
15030
+ "aria-label": title,
15031
+ tabIndex: 0,
15032
+ onKeyDown: (event) => {
15033
+ if ((event.key === " " || event.key === "Enter") && !disabled) {
15034
+ event.preventDefault();
15035
+ onToggle(!state.checked);
15036
+ }
15037
+ }
15038
+ }
15039
+ ) })
15040
+ ] })
15041
+ ] });
15042
+ }
15043
+ function MemberList({ members }) {
15044
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
15045
+ "ul",
15046
+ {
15047
+ "aria-label": "Not signed in with SSO yet",
15048
+ className: "flex flex-col w-full",
15049
+ style: { maxHeight: 240, overflowY: "auto", border: `1px solid ${T15.borderSubtle}`, borderRadius: T15.rXl },
15050
+ children: members.map((m) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
15051
+ "li",
15052
+ {
15053
+ className: "flex items-center w-full",
15054
+ style: { gap: T15.spMd, padding: `${T15.spMd} ${T15.spXl}`, borderBottom: `1px solid ${T15.borderSubtle}` },
15055
+ children: [
15056
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "flex-1 min-w-0 truncate", style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.primary }, children: m.name || m.email }),
15057
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "flex-1 min-w-0 truncate", style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.muted }, children: m.email }),
15058
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "shrink-0", style: { fontFamily: T15.font, fontSize: T15.fsSm, lineHeight: T15.lhSm, color: T15.muted, textTransform: "capitalize" }, children: m.role })
15059
+ ]
15060
+ },
15061
+ m.userId
15062
+ ))
15063
+ }
15064
+ );
15065
+ }
15066
+ var card = {
15067
+ gap: T15.spXl,
15068
+ padding: T15.sp3xl,
15069
+ backgroundColor: T15.surfaceBase,
15070
+ border: `1px solid ${T15.borderSubtle}`,
15071
+ borderRadius: T15.r3xl
15072
+ };
15073
+ function OrganizationLoginMethodsContent() {
15074
+ const { loginMethods, organization, toast } = useSettingsAdapters();
15075
+ const current = organization.current;
15076
+ const orgId = current?.id ?? null;
15077
+ const canLoad = !!loginMethods && !!orgId && current?.role === "admin";
15078
+ const data = useLoad(
15079
+ canLoad ? orgId : null,
15080
+ (signal) => loginMethods.get(orgId, signal),
15081
+ "Couldn't load this organization's login methods."
15082
+ );
15083
+ const [saving, setSaving] = (0, import_react27.useState)(false);
15084
+ const [confirmEmailOff, setConfirmEmailOff] = (0, import_react27.useState)(false);
15085
+ if (!canLoad) {
15086
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex flex-col flex-1 min-w-0", style: { gap: T15.sp3xl }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Muted, { children: !loginMethods ? "Login methods aren't available here yet." : "Login methods are managed by organization admins." }) });
15087
+ }
15088
+ const value = data.value;
15089
+ const state = value ? loginMethodsSwitchState(value) : null;
15090
+ const ssoName = value?.connection?.displayName ?? "company";
15091
+ const domains = domainsLabel(value?.coveredDomains ?? []);
15092
+ const notYet = value?.readiness?.notYet ?? [];
15093
+ async function save(next) {
15094
+ if (saving || !value) return;
15095
+ setSaving(true);
15096
+ try {
15097
+ const result = await loginMethods.update(orgId, next);
15098
+ data.setValue(result);
15099
+ toast.success("Login methods updated. Changes apply within a minute.");
15100
+ setConfirmEmailOff(false);
15101
+ } catch (cause) {
15102
+ toast.error(errorMessage(cause, { method: "PUT" }));
15103
+ } finally {
15104
+ setSaving(false);
15105
+ }
15106
+ }
15107
+ async function copyEmails() {
15108
+ try {
15109
+ await navigator.clipboard.writeText(notYet.map((m) => m.email).join("\n"));
15110
+ toast.success(`Copied ${notYet.length} email ${notYet.length === 1 ? "address" : "addresses"}`);
15111
+ } catch {
15112
+ toast.error("Couldn't copy to the clipboard.");
15113
+ }
15114
+ }
15115
+ function downloadCsv() {
15116
+ const blob = new Blob([memberCsv(notYet)], { type: "text/csv;charset=utf-8;" });
15117
+ const url = URL.createObjectURL(blob);
15118
+ const link = document.createElement("a");
15119
+ link.href = url;
15120
+ link.download = `not-signed-in-with-sso-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`;
15121
+ link.click();
15122
+ URL.revokeObjectURL(url);
15123
+ }
15124
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
15125
+ "div",
15126
+ {
15127
+ className: "flex flex-col flex-1 min-w-0 min-h-0 h-full overflow-y-auto",
15128
+ style: { gap: T15.sp3xl, paddingBottom: T15.sp6xl },
15129
+ children: [
15130
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ScopeHeader, { kind: "organization", name: current?.name, imageUrl: current?.imageUrl, role: current?.role }),
15131
+ data.error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LoadError, { message: data.error, onRetry: data.retry }),
15132
+ !value && !data.error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Spinner, {}),
15133
+ value && state && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
15134
+ value.failOpen && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { role: "alert", className: "flex flex-col w-full", style: { ...card, gap: T15.spXs }, children: [
15135
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { style: { fontFamily: T15.font, fontSize: T15.fsSm, fontWeight: 600, lineHeight: T15.lhSm, color: T15.primary }, children: "Company SSO isn't working right now, so email codes still work." }),
15136
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Muted, { children: "Your organization is set to company SSO only. Contact Streamoid to fix the SSO connection." })
15137
+ ] }),
15138
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("section", { "aria-label": "Login methods", className: "flex flex-col w-full shrink-0", style: card, children: [
15139
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
15140
+ SwitchRow,
15141
+ {
15142
+ title: "Email code",
15143
+ description: `Anyone with an ${domains} address gets a one-time code by email. Google and Microsoft sign-in follow this switch.`,
15144
+ state: state.emailCode,
15145
+ busy: saving,
15146
+ onToggle: (next) => next ? save({ emailCode: true, sso: value.sso }) : setConfirmEmailOff(true)
15147
+ }
15148
+ ),
15149
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { style: { borderTop: `1px solid ${T15.borderSubtle}` } }),
15150
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
15151
+ SwitchRow,
15152
+ {
15153
+ title: "Company SSO",
15154
+ description: `People your IT team has given access sign in through ${ssoName} SSO.`,
15155
+ state: state.sso,
15156
+ busy: saving,
15157
+ onToggle: (next) => save({ emailCode: value.emailCode, sso: next })
15158
+ }
15159
+ )
15160
+ ] }),
15161
+ value.readiness && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("section", { "aria-label": "SSO readiness", className: "flex flex-col w-full shrink-0", style: card, children: [
15162
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { style: { fontFamily: T15.font, fontSize: T15.fsMd, fontWeight: 600, lineHeight: T15.lhMd, color: T15.primary }, children: [
15163
+ value.readiness.signedInWithSso,
15164
+ " of ",
15165
+ value.readiness.affectedTotal,
15166
+ " ",
15167
+ value.readiness.affectedTotal === 1 ? "person" : "people",
15168
+ " at ",
15169
+ domains,
15170
+ " have signed in with SSO.",
15171
+ notYet.length > 0 ? ` ${notYet.length} haven't yet.` : ""
15172
+ ] }),
15173
+ notYet.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
15174
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Muted, { children: [
15175
+ "Send this list to your IT team to give them access to ",
15176
+ ssoName,
15177
+ " SSO. When it's empty, it's safe to turn email codes off."
15178
+ ] }),
15179
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MemberList, { members: notYet }),
15180
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center", style: { gap: T15.spMd }, children: [
15181
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui21.ScButton, { text: "Copy emails", variant: "outline", size: "sm", onClick: copyEmails }),
15182
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui21.ScButton, { text: "Download CSV", variant: "outline", size: "sm", onClick: downloadCsv })
15183
+ ] })
15184
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Muted, { children: "Everyone has signed in with SSO at least once." }),
15185
+ value.readiness.notAffected > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Muted, { children: [
15186
+ value.readiness.notAffected,
15187
+ " ",
15188
+ value.readiness.notAffected === 1 ? "member uses" : "members use",
15189
+ " an address on another domain and ",
15190
+ value.readiness.notAffected === 1 ? "isn't" : "aren't",
15191
+ " affected by these switches."
15192
+ ] })
15193
+ ] }),
15194
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col", style: { gap: T15.spXs }, children: [
15195
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Muted, { children: [
15196
+ "Changes apply within a minute. ",
15197
+ SESSION_NOTE
15198
+ ] }),
15199
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Muted, { children: value.source === "org" && value.updatedAt ? `Last changed${value.updatedBy?.email ? ` by ${value.updatedBy.email}` : ""} on ${formatDate2(value.updatedAt)}.` : "Using Streamoid's default for your organization. Nobody has changed it yet." })
15200
+ ] }),
15201
+ confirmEmailOff && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
15202
+ ConfirmActionModal,
15203
+ {
15204
+ title: "Turn off email codes?",
15205
+ body: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col", style: { gap: T15.spMd }, children: [
15206
+ notYet.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
15207
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
15208
+ "These ",
15209
+ notYet.length,
15210
+ " ",
15211
+ notYet.length === 1 ? "person has" : "people have",
15212
+ " never signed in with",
15213
+ " ",
15214
+ ssoName,
15215
+ " SSO and will be locked out until IT gives them access:"
15216
+ ] }),
15217
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MemberList, { members: notYet }),
15218
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui21.ScButton, { text: "Copy emails", variant: "outline", size: "sm", onClick: copyEmails }) })
15219
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
15220
+ "Everyone at ",
15221
+ domains,
15222
+ " will have to sign in with ",
15223
+ ssoName,
15224
+ " SSO. Google and Microsoft sign-in turn off too."
15225
+ ] }),
15226
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: SESSION_NOTE })
15227
+ ] }),
15228
+ confirmText: "Turn off email codes",
15229
+ busyText: "Turning off\u2026",
15230
+ onClose: () => setConfirmEmailOff(false),
15231
+ onConfirm: () => save({ emailCode: false, sso: value.sso })
15232
+ }
15233
+ )
15234
+ ] })
15235
+ ]
15236
+ }
15237
+ );
15238
+ }
15239
+
14816
15240
  // src/settings-content.tsx
14817
- var import_jsx_runtime33 = require("react/jsx-runtime");
15241
+ var import_jsx_runtime35 = require("react/jsx-runtime");
14818
15242
  function deriveInitials(name) {
14819
15243
  return name.split(/\s+/).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("") || "WS";
14820
15244
  }
@@ -14850,8 +15274,8 @@ function SettingsNavItem({
14850
15274
  onTabChange
14851
15275
  }) {
14852
15276
  const isActive = activeTab === tab;
14853
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SettingsTooltip, { content: TAB_DESCRIPTIONS[tab], placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14854
- import_ui21.ScSidebarMenu,
15277
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SettingsTooltip, { content: TAB_DESCRIPTIONS[tab], placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15278
+ import_ui22.ScSidebarMenu,
14855
15279
  {
14856
15280
  icon: icon(isActive ? PRIMARY_COLOR3 : MUTED_COLOR2),
14857
15281
  text: label,
@@ -14880,9 +15304,10 @@ function SettingsNav({
14880
15304
  isWorkspaceAdmin,
14881
15305
  showConnectedApps = false,
14882
15306
  showIntegrations = false,
15307
+ showLoginMethods = false,
14883
15308
  showReferral = false
14884
15309
  }) {
14885
- const item = (tab, icon) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15310
+ const item = (tab, icon) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
14886
15311
  SettingsNavItem,
14887
15312
  {
14888
15313
  tab,
@@ -14892,7 +15317,7 @@ function SettingsNav({
14892
15317
  onTabChange
14893
15318
  }
14894
15319
  );
14895
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
15320
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
14896
15321
  "div",
14897
15322
  {
14898
15323
  className: "flex flex-col items-start shrink-0 relative overflow-y-auto",
@@ -14915,43 +15340,44 @@ function SettingsNav({
14915
15340
  gap: "var(--spacing-5xl)"
14916
15341
  },
14917
15342
  children: [
14918
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col w-full", style: { gap: "var(--spacing-md)" }, children: [
14919
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { padding: "4px 12px", fontSize: 11, fontWeight: 500, color: MUTED_COLOR2, textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Account" }),
14920
- item("profile", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconUser, { className: "w-5 h-5", color })),
14921
- item("workspaceList", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconSwitch, { className: "w-5 h-5", color })),
14922
- showConnectedApps && item("connectedApps", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SiconPlug_default, { className: "w-5 h-5", color })),
14923
- showReferral && item("referral", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconReferral, { className: "w-5 h-5", color }))
15343
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col w-full", style: { gap: "var(--spacing-md)" }, children: [
15344
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { style: { padding: "4px 12px", fontSize: 11, fontWeight: 500, color: MUTED_COLOR2, textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Account" }),
15345
+ item("profile", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconUser, { className: "w-5 h-5", color })),
15346
+ item("workspaceList", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconSwitch, { className: "w-5 h-5", color })),
15347
+ showConnectedApps && item("connectedApps", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SiconPlug_default, { className: "w-5 h-5", color })),
15348
+ showReferral && item("referral", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconReferral, { className: "w-5 h-5", color }))
14924
15349
  ] }),
14925
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui21.ScHDivider, {}),
14926
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col w-full", style: { gap: "var(--spacing-md)" }, children: [
14927
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { title: workspaceName ?? void 0, style: { padding: "4px 12px", fontSize: 11, fontWeight: 500, color: MUTED_COLOR2, textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Workspace" }),
14928
- item("workspace", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconSettings, { className: "w-5 h-5", color })),
14929
- item("workspaceMembers", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconTeam, { className: "w-5 h-5", color })),
14930
- isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
14931
- item("billing", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconBilling, { className: "w-5 h-5", color })),
14932
- item("apikey", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SiconKey_default, { className: "w-5 h-5", color }))
15350
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui22.ScHDivider, {}),
15351
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col w-full", style: { gap: "var(--spacing-md)" }, children: [
15352
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { title: workspaceName ?? void 0, style: { padding: "4px 12px", fontSize: 11, fontWeight: 500, color: MUTED_COLOR2, textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Workspace" }),
15353
+ item("workspace", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconSettings, { className: "w-5 h-5", color })),
15354
+ item("workspaceMembers", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconTeam, { className: "w-5 h-5", color })),
15355
+ isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
15356
+ item("billing", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconBilling, { className: "w-5 h-5", color })),
15357
+ item("apikey", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SiconKey_default, { className: "w-5 h-5", color }))
14933
15358
  ] }),
14934
- !isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { style: { margin: "4px 12px", fontSize: 12, lineHeight: "18px", color: MUTED_COLOR2 }, children: "Contact your workspace admin for credit top-ups and billing history." })
15359
+ !isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { style: { margin: "4px 12px", fontSize: 12, lineHeight: "18px", color: MUTED_COLOR2 }, children: "Contact your workspace admin for credit top-ups and billing history." })
14935
15360
  ] }),
14936
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui21.ScHDivider, {}),
14937
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col w-full", style: { gap: "var(--spacing-md)" }, children: hasOrganization ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
14938
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { padding: "4px 12px", fontSize: 11, fontWeight: 500, color: MUTED_COLOR2, textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Organization" }),
14939
- item("organizationList", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconSwitch, { className: "w-5 h-5", color })),
14940
- item("organization", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconTeam, { className: "w-5 h-5", color })),
14941
- item("organizationWorkspaces", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconWorkspace, { className: "w-5 h-5", color })),
14942
- showIntegrations && item("organizationIntegrations", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SiconPlug_default, { className: "w-5 h-5", color }))
14943
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
14944
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15361
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui22.ScHDivider, {}),
15362
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex flex-col w-full", style: { gap: "var(--spacing-md)" }, children: hasOrganization ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
15363
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { style: { padding: "4px 12px", fontSize: 11, fontWeight: 500, color: MUTED_COLOR2, textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Organization" }),
15364
+ item("organizationList", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconSwitch, { className: "w-5 h-5", color })),
15365
+ item("organization", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconTeam, { className: "w-5 h-5", color })),
15366
+ item("organizationWorkspaces", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconWorkspace, { className: "w-5 h-5", color })),
15367
+ showIntegrations && item("organizationIntegrations", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SiconPlug_default, { className: "w-5 h-5", color })),
15368
+ showLoginMethods && item("organizationLoginMethods", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconLock, { className: "w-5 h-5", color }))
15369
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
15370
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
14945
15371
  SettingsNavItem,
14946
15372
  {
14947
15373
  tab: "organization",
14948
15374
  label: "Organization",
14949
- icon: (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconGlobe, { className: "w-5 h-5", color }),
15375
+ icon: (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconGlobe, { className: "w-5 h-5", color }),
14950
15376
  activeTab,
14951
15377
  onTabChange
14952
15378
  }
14953
15379
  ),
14954
- item("organizationList", (color) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconSwitch, { className: "w-5 h-5", color }))
15380
+ item("organizationList", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconSwitch, { className: "w-5 h-5", color }))
14955
15381
  ] }) })
14956
15382
  ]
14957
15383
  }
@@ -14960,7 +15386,7 @@ function SettingsNav({
14960
15386
  var SPECIALIZATION_ICON_SIZE = 24;
14961
15387
  function SpecializationIcon({ iconUrl }) {
14962
15388
  if (iconUrl) {
14963
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15389
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
14964
15390
  "img",
14965
15391
  {
14966
15392
  src: iconUrl,
@@ -14973,7 +15399,7 @@ function SpecializationIcon({ iconUrl }) {
14973
15399
  }
14974
15400
  );
14975
15401
  }
14976
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15402
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
14977
15403
  import_icons18.SiconBolt,
14978
15404
  {
14979
15405
  style: {
@@ -15005,10 +15431,10 @@ function SpecializationDropdown({
15005
15431
  disabled
15006
15432
  }) {
15007
15433
  const { auth } = useSettingsAdapters();
15008
- const [open, setOpen] = (0, import_react27.useState)(false);
15009
- const containerRef = (0, import_react27.useRef)(null);
15010
- const [options, setOptions] = (0, import_react27.useState)([]);
15011
- (0, import_react27.useEffect)(() => {
15434
+ const [open, setOpen] = (0, import_react28.useState)(false);
15435
+ const containerRef = (0, import_react28.useRef)(null);
15436
+ const [options, setOptions] = (0, import_react28.useState)([]);
15437
+ (0, import_react28.useEffect)(() => {
15012
15438
  if (!auth.getSpecializations) return;
15013
15439
  let cancelled = false;
15014
15440
  auth.getSpecializations().then((items) => {
@@ -15028,7 +15454,7 @@ function SpecializationDropdown({
15028
15454
  cancelled = true;
15029
15455
  };
15030
15456
  }, [auth]);
15031
- (0, import_react27.useEffect)(() => {
15457
+ (0, import_react28.useEffect)(() => {
15032
15458
  if (!open) return;
15033
15459
  function handleMouseDown(e) {
15034
15460
  if (containerRef.current && !containerRef.current.contains(e.target)) {
@@ -15046,15 +15472,15 @@ function SpecializationDropdown({
15046
15472
  };
15047
15473
  }, [open]);
15048
15474
  const selected = options.find((o) => o.id === value);
15049
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
15475
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15050
15476
  "div",
15051
15477
  {
15052
15478
  ref: containerRef,
15053
15479
  className: "w-full",
15054
15480
  style: { position: "relative" },
15055
15481
  children: [
15056
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("style", { children: DROPDOWN_TRIGGER_STYLES }),
15057
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15482
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("style", { children: DROPDOWN_TRIGGER_STYLES }),
15483
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15058
15484
  "div",
15059
15485
  {
15060
15486
  className: "spec-dropdown-trigger",
@@ -15062,16 +15488,16 @@ function SpecializationDropdown({
15062
15488
  onClick: () => !disabled && setOpen((v) => !v),
15063
15489
  "aria-haspopup": "listbox",
15064
15490
  "aria-expanded": open,
15065
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15066
- import_ui22.ScTextField,
15491
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15492
+ import_ui23.ScTextField,
15067
15493
  {
15068
15494
  label: "Specialization",
15069
15495
  labelGroup: "label",
15070
15496
  value: selected?.label ?? "",
15071
15497
  placeholderFilled: "Select specialization",
15072
15498
  tfGroup: "icon-left-right",
15073
- tfLeftIcon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SpecializationIcon, { iconUrl: selected?.iconUrl }),
15074
- tfRightIcon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15499
+ tfLeftIcon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SpecializationIcon, { iconUrl: selected?.iconUrl }),
15500
+ tfRightIcon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15075
15501
  "span",
15076
15502
  {
15077
15503
  style: {
@@ -15081,7 +15507,7 @@ function SpecializationDropdown({
15081
15507
  transform: open ? "rotate(180deg)" : "none",
15082
15508
  transition: "transform 120ms ease-out"
15083
15509
  },
15084
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconDown, {})
15510
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconDown, {})
15085
15511
  }
15086
15512
  ),
15087
15513
  className: "sc-text-field-full-width",
@@ -15092,7 +15518,7 @@ function SpecializationDropdown({
15092
15518
  )
15093
15519
  }
15094
15520
  ),
15095
- open && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15521
+ open && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15096
15522
  "div",
15097
15523
  {
15098
15524
  role: "listbox",
@@ -15114,11 +15540,11 @@ function SpecializationDropdown({
15114
15540
  },
15115
15541
  children: options.map((opt) => {
15116
15542
  const isActive = opt.id === value;
15117
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15118
- import_ui21.ScMenuOptions,
15543
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15544
+ import_ui22.ScMenuOptions,
15119
15545
  {
15120
15546
  text: opt.label,
15121
- icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SpecializationIcon, { iconUrl: opt.iconUrl }),
15547
+ icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SpecializationIcon, { iconUrl: opt.iconUrl }),
15122
15548
  hover: isActive ? "true" : "false",
15123
15549
  variant: "default",
15124
15550
  role: "option",
@@ -15143,9 +15569,9 @@ function LanguageDropdown({
15143
15569
  onChange,
15144
15570
  disabled
15145
15571
  }) {
15146
- const [open, setOpen] = (0, import_react27.useState)(false);
15147
- const containerRef = (0, import_react27.useRef)(null);
15148
- (0, import_react27.useEffect)(() => {
15572
+ const [open, setOpen] = (0, import_react28.useState)(false);
15573
+ const containerRef = (0, import_react28.useRef)(null);
15574
+ (0, import_react28.useEffect)(() => {
15149
15575
  if (!open) return;
15150
15576
  function handleMouseDown(e) {
15151
15577
  if (containerRef.current && !containerRef.current.contains(e.target)) {
@@ -15162,15 +15588,15 @@ function LanguageDropdown({
15162
15588
  document.removeEventListener("keydown", handleKeyDown);
15163
15589
  };
15164
15590
  }, [open]);
15165
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
15591
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15166
15592
  "div",
15167
15593
  {
15168
15594
  ref: containerRef,
15169
15595
  className: "w-full",
15170
15596
  style: { position: "relative" },
15171
15597
  children: [
15172
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("style", { children: DROPDOWN_TRIGGER_STYLES }),
15173
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15598
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("style", { children: DROPDOWN_TRIGGER_STYLES }),
15599
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15174
15600
  "div",
15175
15601
  {
15176
15602
  className: "spec-dropdown-trigger",
@@ -15178,15 +15604,15 @@ function LanguageDropdown({
15178
15604
  onClick: () => !disabled && setOpen((v) => !v),
15179
15605
  "aria-haspopup": "listbox",
15180
15606
  "aria-expanded": open,
15181
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15182
- import_ui22.ScTextField,
15607
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15608
+ import_ui23.ScTextField,
15183
15609
  {
15184
15610
  label: "Language",
15185
15611
  labelGroup: "label",
15186
15612
  value: userLanguageLabel(value),
15187
15613
  placeholderFilled: "Select language",
15188
15614
  tfGroup: "icon-right",
15189
- tfRightIcon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15615
+ tfRightIcon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15190
15616
  "span",
15191
15617
  {
15192
15618
  style: {
@@ -15196,7 +15622,7 @@ function LanguageDropdown({
15196
15622
  transform: open ? "rotate(180deg)" : "none",
15197
15623
  transition: "transform 120ms ease-out"
15198
15624
  },
15199
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconDown, {})
15625
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconDown, {})
15200
15626
  }
15201
15627
  ),
15202
15628
  className: "sc-text-field-full-width",
@@ -15207,7 +15633,7 @@ function LanguageDropdown({
15207
15633
  )
15208
15634
  }
15209
15635
  ),
15210
- open && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15636
+ open && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15211
15637
  "div",
15212
15638
  {
15213
15639
  role: "listbox",
@@ -15233,11 +15659,11 @@ function LanguageDropdown({
15233
15659
  },
15234
15660
  children: USER_LANGUAGES.map((lang) => {
15235
15661
  const isActive = lang.code === value;
15236
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15237
- import_ui21.ScMenuOptions,
15662
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15663
+ import_ui22.ScMenuOptions,
15238
15664
  {
15239
15665
  text: lang.label,
15240
- icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, {}),
15666
+ icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, {}),
15241
15667
  hover: isActive ? "true" : "false",
15242
15668
  variant: "default",
15243
15669
  role: "option",
@@ -15263,28 +15689,28 @@ function ProfileTab() {
15263
15689
  const derivedName = user?.name ?? "";
15264
15690
  const derivedSpec = user?.userSpecialization ?? "";
15265
15691
  const derivedLanguage = user?.language?.trim() || DEFAULT_USER_LANGUAGE;
15266
- const [fullName, setFullName] = (0, import_react27.useState)(derivedName);
15267
- const [selectedSpec, setSelectedSpec] = (0, import_react27.useState)(derivedSpec);
15268
- const [selectedLanguage, setSelectedLanguage] = (0, import_react27.useState)(derivedLanguage);
15269
- const [saving, setSaving] = (0, import_react27.useState)(false);
15270
- const [imageSaving, setImageSaving] = (0, import_react27.useState)(false);
15271
- const [imagePreview, setImagePreview] = (0, import_react27.useState)(
15692
+ const [fullName, setFullName] = (0, import_react28.useState)(derivedName);
15693
+ const [selectedSpec, setSelectedSpec] = (0, import_react28.useState)(derivedSpec);
15694
+ const [selectedLanguage, setSelectedLanguage] = (0, import_react28.useState)(derivedLanguage);
15695
+ const [saving, setSaving] = (0, import_react28.useState)(false);
15696
+ const [imageSaving, setImageSaving] = (0, import_react28.useState)(false);
15697
+ const [imagePreview, setImagePreview] = (0, import_react28.useState)(
15272
15698
  void 0
15273
15699
  );
15274
- const fileInputRef = (0, import_react27.useRef)(null);
15700
+ const fileInputRef = (0, import_react28.useRef)(null);
15275
15701
  const profileDisplayName = fullName || user?.email || "User";
15276
15702
  const profileImage = imagePreview ?? getUserProfileImage(user);
15277
15703
  const profileInitial = profileDisplayName.charAt(0).toUpperCase();
15278
15704
  const disableAllActions = saving || imageSaving;
15279
15705
  const dirty = fullName.trim() !== derivedName || selectedSpec !== derivedSpec || selectedLanguage !== derivedLanguage;
15280
- (0, import_react27.useEffect)(() => {
15706
+ (0, import_react28.useEffect)(() => {
15281
15707
  setFullName(derivedName);
15282
15708
  setImagePreview(void 0);
15283
15709
  }, [derivedName]);
15284
- (0, import_react27.useEffect)(() => {
15710
+ (0, import_react28.useEffect)(() => {
15285
15711
  setSelectedSpec(derivedSpec);
15286
15712
  }, [derivedSpec]);
15287
- (0, import_react27.useEffect)(() => {
15713
+ (0, import_react28.useEffect)(() => {
15288
15714
  setSelectedLanguage(derivedLanguage);
15289
15715
  }, [derivedLanguage]);
15290
15716
  const handleSave = async () => {
@@ -15366,13 +15792,13 @@ function ProfileTab() {
15366
15792
  }
15367
15793
  auth.clearAuth();
15368
15794
  };
15369
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
15795
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15370
15796
  "div",
15371
15797
  {
15372
15798
  className: "flex flex-col items-start flex-1 min-w-0 min-h-0 overflow-y-auto",
15373
15799
  style: { gap: "var(--spacing-3xl)" },
15374
15800
  children: [
15375
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
15801
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15376
15802
  "div",
15377
15803
  {
15378
15804
  className: "sc-profile-card flex flex-col items-start w-full",
@@ -15385,13 +15811,13 @@ function ProfileTab() {
15385
15811
  gap: "var(--spacing-6xl)"
15386
15812
  },
15387
15813
  children: [
15388
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
15814
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15389
15815
  "div",
15390
15816
  {
15391
15817
  className: "flex items-center shrink-0 w-full",
15392
15818
  style: { gap: 24, flexWrap: "wrap" },
15393
15819
  children: [
15394
- profileImage ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15820
+ profileImage ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15395
15821
  "img",
15396
15822
  {
15397
15823
  src: profileImage,
@@ -15404,7 +15830,7 @@ function ProfileTab() {
15404
15830
  flexShrink: 0
15405
15831
  }
15406
15832
  }
15407
- ) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15833
+ ) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15408
15834
  "div",
15409
15835
  {
15410
15836
  "aria-label": "Profile",
@@ -15417,7 +15843,7 @@ function ProfileTab() {
15417
15843
  border: "1px solid var(--alias-border-subtle)",
15418
15844
  flexShrink: 0
15419
15845
  },
15420
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15846
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15421
15847
  "span",
15422
15848
  {
15423
15849
  style: {
@@ -15432,7 +15858,7 @@ function ProfileTab() {
15432
15858
  )
15433
15859
  }
15434
15860
  ),
15435
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15861
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15436
15862
  "input",
15437
15863
  {
15438
15864
  ref: fileInputRef,
@@ -15442,17 +15868,17 @@ function ProfileTab() {
15442
15868
  onChange: handleImageChange
15443
15869
  }
15444
15870
  ),
15445
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
15871
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15446
15872
  "div",
15447
15873
  {
15448
15874
  className: "flex items-center",
15449
15875
  style: { gap: 12, flexWrap: "wrap" },
15450
15876
  children: [
15451
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15452
- import_ui23.ScButton,
15877
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15878
+ import_ui24.ScButton,
15453
15879
  {
15454
15880
  text: "Upload photo",
15455
- icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconUpload, { className: "w-5 h-5", color: PRIMARY_COLOR3 }),
15881
+ icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconUpload, { className: "w-5 h-5", color: PRIMARY_COLOR3 }),
15456
15882
  styleVariant: "icon-left",
15457
15883
  variant: "outline",
15458
15884
  size: "md",
@@ -15460,11 +15886,11 @@ function ProfileTab() {
15460
15886
  onClick: handleUploadClick
15461
15887
  }
15462
15888
  ),
15463
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15464
- import_ui23.ScButton,
15889
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15890
+ import_ui24.ScButton,
15465
15891
  {
15466
15892
  text: "Remove photo",
15467
- icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15893
+ icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15468
15894
  import_icons18.SiconDelete,
15469
15895
  {
15470
15896
  className: "w-5 h-5",
@@ -15484,16 +15910,16 @@ function ProfileTab() {
15484
15910
  ]
15485
15911
  }
15486
15912
  ),
15487
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui21.ScHDivider, {}),
15488
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
15913
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui22.ScHDivider, {}),
15914
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15489
15915
  "div",
15490
15916
  {
15491
15917
  className: "sc-profile-fields flex flex-col min-w-0 w-full",
15492
15918
  style: { gap: 24 },
15493
15919
  children: [
15494
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { display: "grid", width: "100%", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 240px), 1fr))", gap: 24 }, children: [
15495
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1 min-w-0", style: { overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15496
- import_ui22.ScTextField,
15920
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { style: { display: "grid", width: "100%", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 240px), 1fr))", gap: 24 }, children: [
15921
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex-1 min-w-0", style: { overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15922
+ import_ui23.ScTextField,
15497
15923
  {
15498
15924
  label: "Full Name",
15499
15925
  labelGroup: "label",
@@ -15506,7 +15932,7 @@ function ProfileTab() {
15506
15932
  onChange: (e) => setFullName(e.target.value)
15507
15933
  }
15508
15934
  ) }),
15509
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15935
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15510
15936
  SpecializationDropdown,
15511
15937
  {
15512
15938
  value: selectedSpec,
@@ -15515,8 +15941,8 @@ function ProfileTab() {
15515
15941
  }
15516
15942
  ) })
15517
15943
  ] }),
15518
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-start w-full", style: { gap: "var(--spacing-3xl)" }, children: [
15519
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15944
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-start w-full", style: { gap: "var(--spacing-3xl)" }, children: [
15945
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15520
15946
  LanguageDropdown,
15521
15947
  {
15522
15948
  value: selectedLanguage,
@@ -15524,10 +15950,10 @@ function ProfileTab() {
15524
15950
  disabled: disableAllActions
15525
15951
  }
15526
15952
  ) }),
15527
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1 min-w-0" })
15953
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex-1 min-w-0" })
15528
15954
  ] }),
15529
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-full", style: { overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15530
- import_ui22.ScTextField,
15955
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-full", style: { overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15956
+ import_ui23.ScTextField,
15531
15957
  {
15532
15958
  label: "Email ID",
15533
15959
  labelGroup: "label",
@@ -15535,7 +15961,7 @@ function ProfileTab() {
15535
15961
  value: user?.email ?? "",
15536
15962
  placeholderFilled: user?.email ?? "chris@kepler.com",
15537
15963
  tfGroup: "icon-right",
15538
- tfRightIcon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15964
+ tfRightIcon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15539
15965
  import_icons18.SiconLock,
15540
15966
  {
15541
15967
  className: "w-6 h-6",
@@ -15547,13 +15973,13 @@ function ProfileTab() {
15547
15973
  readOnly: true
15548
15974
  }
15549
15975
  ) }),
15550
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15976
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15551
15977
  "div",
15552
15978
  {
15553
15979
  className: "flex items-center w-full",
15554
15980
  style: { justifyContent: "flex-end", paddingTop: "var(--spacing-md)" },
15555
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15556
- import_ui23.ScButton,
15981
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15982
+ import_ui24.ScButton,
15557
15983
  {
15558
15984
  text: saving ? "Saving..." : "Save changes",
15559
15985
  variant: "secondary",
@@ -15570,7 +15996,7 @@ function ProfileTab() {
15570
15996
  ]
15571
15997
  }
15572
15998
  ),
15573
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
15999
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15574
16000
  "div",
15575
16001
  {
15576
16002
  className: "flex items-center w-full",
@@ -15582,8 +16008,8 @@ function ProfileTab() {
15582
16008
  gap: "var(--spacing-3xl)"
15583
16009
  },
15584
16010
  children: [
15585
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col min-w-0 flex-1", style: { gap: "var(--spacing-xs)" }, children: [
15586
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16011
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col min-w-0 flex-1", style: { gap: "var(--spacing-xs)" }, children: [
16012
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15587
16013
  "span",
15588
16014
  {
15589
16015
  style: {
@@ -15596,7 +16022,7 @@ function ProfileTab() {
15596
16022
  children: "Session"
15597
16023
  }
15598
16024
  ),
15599
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16025
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15600
16026
  "span",
15601
16027
  {
15602
16028
  className: "truncate",
@@ -15611,8 +16037,8 @@ function ProfileTab() {
15611
16037
  }
15612
16038
  )
15613
16039
  ] }),
15614
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15615
- import_ui23.ScButton,
16040
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16041
+ import_ui24.ScButton,
15616
16042
  {
15617
16043
  text: "Log out",
15618
16044
  variant: "outline",
@@ -15675,11 +16101,11 @@ function WorkspaceListTab({
15675
16101
  const currentOrganization = organizations.find(
15676
16102
  (org) => org._id && org._id === currentWorkspace?.organizationId
15677
16103
  );
15678
- const [page, setPage] = (0, import_react27.useState)(0);
15679
- const [serverPage, setServerPage] = (0, import_react27.useState)(null);
15680
- const [serverFailed, setServerFailed] = (0, import_react27.useState)(false);
16104
+ const [page, setPage] = (0, import_react28.useState)(0);
16105
+ const [serverPage, setServerPage] = (0, import_react28.useState)(null);
16106
+ const [serverFailed, setServerFailed] = (0, import_react28.useState)(false);
15681
16107
  const serverMode = !!listPage && !serverFailed;
15682
- (0, import_react27.useEffect)(() => {
16108
+ (0, import_react28.useEffect)(() => {
15683
16109
  if (!listPage || serverFailed) return;
15684
16110
  let cancelled = false;
15685
16111
  listPage({ limit: pageSize, offset: page * pageSize }).then((result) => {
@@ -15720,21 +16146,21 @@ function WorkspaceListTab({
15720
16146
  const pageRows = serverMode ? (serverPage?.items ?? []).map((ws) => ({ ws, group: serverGroupOf(ws) })) : rows.slice(pageStart, pageStart + pageSize);
15721
16147
  const pageWorkspaces = pageRows.map((row) => row.ws);
15722
16148
  const listLoading = loading || serverMode && !serverPage;
15723
- const [plans, setPlans] = (0, import_react27.useState)({});
15724
- const requestedPlans = (0, import_react27.useRef)(/* @__PURE__ */ new Set());
16149
+ const [plans, setPlans] = (0, import_react28.useState)({});
16150
+ const requestedPlans = (0, import_react28.useRef)(/* @__PURE__ */ new Set());
15725
16151
  const visibleIds = [
15726
16152
  ...currentWorkspace ? [currentWorkspace._id] : [],
15727
16153
  ...pageWorkspaces.map((ws) => ws._id)
15728
16154
  ];
15729
16155
  const visibleKey = visibleIds.join(",");
15730
- const mounted = (0, import_react27.useRef)(true);
15731
- (0, import_react27.useEffect)(() => {
16156
+ const mounted = (0, import_react28.useRef)(true);
16157
+ (0, import_react28.useEffect)(() => {
15732
16158
  mounted.current = true;
15733
16159
  return () => {
15734
16160
  mounted.current = false;
15735
16161
  };
15736
16162
  }, []);
15737
- (0, import_react27.useEffect)(() => {
16163
+ (0, import_react28.useEffect)(() => {
15738
16164
  if (!fetchPlans || listLoading) return;
15739
16165
  const missing = visibleKey.split(",").filter((id) => id && !requestedPlans.current.has(id));
15740
16166
  if (!missing.length) return;
@@ -15745,13 +16171,13 @@ function WorkspaceListTab({
15745
16171
  });
15746
16172
  }, [fetchPlans, listLoading, visibleKey]);
15747
16173
  const planOf = (ws) => fetchPlans ? plans[ws._id] ?? "" : ws.plan ?? "";
15748
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
16174
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15749
16175
  "div",
15750
16176
  {
15751
16177
  className: "flex flex-col items-start flex-1 min-w-0",
15752
16178
  style: { gap: "var(--spacing-3xl)", height: "100%" },
15753
16179
  children: [
15754
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16180
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15755
16181
  "p",
15756
16182
  {
15757
16183
  className: "shrink-0 w-full",
@@ -15764,7 +16190,7 @@ function WorkspaceListTab({
15764
16190
  children: "Switching changes which workspace the rest of Settings acts on."
15765
16191
  }
15766
16192
  ),
15767
- listLoading && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16193
+ listLoading && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15768
16194
  "p",
15769
16195
  {
15770
16196
  style: {
@@ -15775,13 +16201,13 @@ function WorkspaceListTab({
15775
16201
  children: "Loading workspaces\u2026"
15776
16202
  }
15777
16203
  ),
15778
- !listLoading && currentWorkspace && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
16204
+ !listLoading && currentWorkspace && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15779
16205
  "div",
15780
16206
  {
15781
16207
  className: "flex flex-col items-start shrink-0 w-full",
15782
16208
  style: { gap: 16, padding: "var(--spacing-md) 0" },
15783
16209
  children: [
15784
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
16210
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15785
16211
  "p",
15786
16212
  {
15787
16213
  className: "w-full overflow-hidden text-ellipsis whitespace-nowrap",
@@ -15798,8 +16224,8 @@ function WorkspaceListTab({
15798
16224
  ]
15799
16225
  }
15800
16226
  ),
15801
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15802
- import_ui24.ScWorkspaceSwitchCard,
16227
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16228
+ import_ui25.ScWorkspaceSwitchCard,
15803
16229
  {
15804
16230
  wsName: currentWorkspace.name,
15805
16231
  initials: currentWorkspace.initials,
@@ -15815,7 +16241,7 @@ function WorkspaceListTab({
15815
16241
  ]
15816
16242
  }
15817
16243
  ),
15818
- !listLoading && currentWorkspace && listTotal > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16244
+ !listLoading && currentWorkspace && listTotal > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15819
16245
  "div",
15820
16246
  {
15821
16247
  className: "shrink-0 w-full",
@@ -15825,19 +16251,19 @@ function WorkspaceListTab({
15825
16251
  }
15826
16252
  }
15827
16253
  ),
15828
- !listLoading && listTotal > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
16254
+ !listLoading && listTotal > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15829
16255
  "div",
15830
16256
  {
15831
16257
  className: "flex flex-col items-start flex-1 min-h-0 w-full",
15832
16258
  style: { gap: 16, overflowY: "auto" },
15833
16259
  children: [
15834
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16260
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15835
16261
  "div",
15836
16262
  {
15837
16263
  className: "flex flex-col items-start w-full",
15838
16264
  style: { gap: 16 },
15839
- children: pageRows.map(({ ws, group }, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react27.Fragment, { children: [
15840
- (index === 0 || pageRows[index - 1].group.key !== group.key) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16265
+ children: pageRows.map(({ ws, group }, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react28.Fragment, { children: [
16266
+ (index === 0 || pageRows[index - 1].group.key !== group.key) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
15841
16267
  "p",
15842
16268
  {
15843
16269
  className: "w-full overflow-hidden text-ellipsis whitespace-nowrap shrink-0",
@@ -15852,8 +16278,8 @@ function WorkspaceListTab({
15852
16278
  children: group.label
15853
16279
  }
15854
16280
  ),
15855
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15856
- import_ui24.ScWorkspaceSwitchCard,
16281
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16282
+ import_ui25.ScWorkspaceSwitchCard,
15857
16283
  {
15858
16284
  wsName: ws.name,
15859
16285
  initials: ws.initials,
@@ -15870,13 +16296,13 @@ function WorkspaceListTab({
15870
16296
  ] }, ws._id))
15871
16297
  }
15872
16298
  ),
15873
- pageCount > 1 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
16299
+ pageCount > 1 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15874
16300
  "div",
15875
16301
  {
15876
16302
  className: "flex items-center justify-between shrink-0 w-full",
15877
16303
  style: { gap: "var(--spacing-md)" },
15878
16304
  children: [
15879
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
16305
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15880
16306
  "span",
15881
16307
  {
15882
16308
  style: {
@@ -15895,9 +16321,9 @@ function WorkspaceListTab({
15895
16321
  ]
15896
16322
  }
15897
16323
  ),
15898
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center", style: { gap: "var(--spacing-md)" }, children: [
15899
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15900
- import_ui23.ScButton,
16324
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center", style: { gap: "var(--spacing-md)" }, children: [
16325
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16326
+ import_ui24.ScButton,
15901
16327
  {
15902
16328
  text: "Previous",
15903
16329
  variant: "tertiary",
@@ -15906,8 +16332,8 @@ function WorkspaceListTab({
15906
16332
  onClick: safePage === 0 ? void 0 : () => setPage(safePage - 1)
15907
16333
  }
15908
16334
  ),
15909
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15910
- import_ui23.ScButton,
16335
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16336
+ import_ui24.ScButton,
15911
16337
  {
15912
16338
  text: "Next",
15913
16339
  variant: "tertiary",
@@ -15929,12 +16355,12 @@ function WorkspaceListTab({
15929
16355
  }
15930
16356
  var WorkspaceTab = WorkspaceListTab;
15931
16357
  function ReferralTab() {
15932
- const { auth, toast } = useSettingsAdapters();
16358
+ const { auth, toast, api } = useSettingsAdapters();
15933
16359
  const domain = typeof window !== "undefined" ? window.location.origin : "";
15934
16360
  const link = referralLink(referralCodeOf(auth.user), domain);
15935
- const [copied, setCopied] = (0, import_react27.useState)(false);
15936
- const copiedTimer = (0, import_react27.useRef)(null);
15937
- (0, import_react27.useEffect)(() => () => {
16361
+ const [copied, setCopied] = (0, import_react28.useState)(false);
16362
+ const copiedTimer = (0, import_react28.useRef)(null);
16363
+ (0, import_react28.useEffect)(() => () => {
15938
16364
  if (copiedTimer.current) clearTimeout(copiedTimer.current);
15939
16365
  }, []);
15940
16366
  const copyLink = async () => {
@@ -15949,68 +16375,71 @@ function ReferralTab() {
15949
16375
  toast.error("Couldn't copy the referral link");
15950
16376
  }
15951
16377
  };
15952
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16378
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
15953
16379
  "div",
15954
16380
  {
15955
16381
  className: "flex flex-col items-start flex-1 min-w-0",
15956
16382
  style: { gap: "var(--spacing-3xl)" },
15957
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15958
- "div",
15959
- {
15960
- className: "w-full relative",
15961
- style: {
15962
- backgroundColor: "var(--alias-surface-base)",
15963
- borderRadius: "var(--radius-3xl)",
15964
- padding: "var(--spacing-6xl)"
15965
- },
15966
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
15967
- import_ui22.ScTextField,
15968
- {
15969
- label: "Your Referral Link",
15970
- labelGroup: "label",
15971
- state: "filled",
15972
- value: link,
15973
- placeholderFilled: "https://your-domain.com?referral_code=ABC123",
15974
- tfGroup: "none",
15975
- rightSlot: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
15976
- "button",
15977
- {
15978
- type: "button",
15979
- "aria-label": copied ? "Copied" : "Copy referral link",
15980
- title: copied ? "Copied" : "Copy referral link",
15981
- disabled: !link,
15982
- onClick: () => void copyLink(),
15983
- className: "flex items-center justify-center shrink-0 cursor-pointer border-none",
15984
- style: {
15985
- gap: "var(--spacing-xs)",
15986
- padding: "0 var(--spacing-md)",
15987
- height: 32,
15988
- borderRadius: "var(--radius-lg)",
15989
- background: "transparent",
15990
- color: "var(--alias-text---icons-primary)",
15991
- fontSize: "var(--font-size-font-size-sm)",
15992
- fontWeight: 500
15993
- },
15994
- onMouseEnter: (e) => {
15995
- e.currentTarget.style.background = "var(--alias-fill-neutral-neutralplus)";
15996
- },
15997
- onMouseLeave: (e) => {
15998
- e.currentTarget.style.background = "transparent";
15999
- },
16000
- children: [
16001
- copied ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconCheck, { className: "w-4 h-4", color: "var(--alias-text---icons-primary)" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconCopy, { className: "w-4 h-4", color: "var(--alias-text---icons-primary)" }),
16002
- copied ? "Copied" : "Copy"
16003
- ]
16004
- }
16005
- ),
16006
- desc: "Share this link. When someone opens it and creates a new Streamoid account, it's recorded as your referral.",
16007
- className: "sc-text-field-full-width w-full min-w-0",
16008
- readOnly: true,
16009
- onFocus: (e) => e.currentTarget.select()
16010
- }
16011
- )
16012
- }
16013
- )
16383
+ children: [
16384
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16385
+ "div",
16386
+ {
16387
+ className: "w-full relative",
16388
+ style: {
16389
+ backgroundColor: "var(--alias-surface-base)",
16390
+ borderRadius: "var(--radius-3xl)",
16391
+ padding: "var(--spacing-6xl)"
16392
+ },
16393
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16394
+ import_ui23.ScTextField,
16395
+ {
16396
+ label: "Your Referral Link",
16397
+ labelGroup: "label",
16398
+ state: "filled",
16399
+ value: link,
16400
+ placeholderFilled: "https://your-domain.com?referral_code=ABC123",
16401
+ tfGroup: "none",
16402
+ rightSlot: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
16403
+ "button",
16404
+ {
16405
+ type: "button",
16406
+ "aria-label": copied ? "Copied" : "Copy referral link",
16407
+ title: copied ? "Copied" : "Copy referral link",
16408
+ disabled: !link,
16409
+ onClick: () => void copyLink(),
16410
+ className: "flex items-center justify-center shrink-0 cursor-pointer border-none",
16411
+ style: {
16412
+ gap: "var(--spacing-xs)",
16413
+ padding: "0 var(--spacing-md)",
16414
+ height: 32,
16415
+ borderRadius: "var(--radius-lg)",
16416
+ background: "transparent",
16417
+ color: "var(--alias-text---icons-primary)",
16418
+ fontSize: "var(--font-size-font-size-sm)",
16419
+ fontWeight: 500
16420
+ },
16421
+ onMouseEnter: (e) => {
16422
+ e.currentTarget.style.background = "var(--alias-fill-neutral-neutralplus)";
16423
+ },
16424
+ onMouseLeave: (e) => {
16425
+ e.currentTarget.style.background = "transparent";
16426
+ },
16427
+ children: [
16428
+ copied ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconCheck, { className: "w-4 h-4", color: "var(--alias-text---icons-primary)" }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconCopy, { className: "w-4 h-4", color: "var(--alias-text---icons-primary)" }),
16429
+ copied ? "Copied" : "Copy"
16430
+ ]
16431
+ }
16432
+ ),
16433
+ desc: "Share this link. When someone opens it and creates a new Streamoid account, it's recorded as your referral.",
16434
+ className: "sc-text-field-full-width w-full min-w-0",
16435
+ readOnly: true,
16436
+ onFocus: (e) => e.currentTarget.select()
16437
+ }
16438
+ )
16439
+ }
16440
+ ),
16441
+ api.getReferredUsers && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ReferralHistory, { load: (signal) => api.getReferredUsers(signal) })
16442
+ ]
16014
16443
  }
16015
16444
  );
16016
16445
  }
@@ -16027,7 +16456,7 @@ function SettingsContent({
16027
16456
  inviteRequested,
16028
16457
  onInviteRequestHandled
16029
16458
  }) {
16030
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SettingsAdaptersProvider, { adapters, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16459
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SettingsAdaptersProvider, { adapters, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16031
16460
  SettingsContentInner,
16032
16461
  {
16033
16462
  activeTab,
@@ -16065,7 +16494,8 @@ function SettingsContentInner({
16065
16494
  organization,
16066
16495
  navigation,
16067
16496
  toast,
16068
- integrations
16497
+ integrations,
16498
+ loginMethods
16069
16499
  } = adapters;
16070
16500
  const overviewDetail = presentation === "overview-detail";
16071
16501
  const isOverview = overviewDetail && showOverview;
@@ -16073,14 +16503,15 @@ function SettingsContentInner({
16073
16503
  const showConnectedApps = !!integrations;
16074
16504
  const showReferral = !!referralCodeOf(adapters.auth.user);
16075
16505
  const showIntegrations = !!integrations?.listOrganizationConnections && !!integrations.getOrganizationAccess && organization.current?.role === "admin";
16506
+ const showLoginMethods = !!loginMethods && organization.current?.role === "admin";
16076
16507
  const workspaceId = workspace.current?.id ?? null;
16077
16508
  const workspaceOwner = useWorkspaceOrganization({ workspaceId, request: workspace.organizationRequest ?? unavailableOrganizationRequest, enabled: !!workspace.organizationRequest });
16078
16509
  const workspaceOwnerName = workspace.organizationRequest ? workspaceOwner.organizationName : void 0;
16079
- const [workspaceList, setWorkspaceList] = (0, import_react27.useState)([]);
16510
+ const [workspaceList, setWorkspaceList] = (0, import_react28.useState)([]);
16080
16511
  const currentWorkspaceRole = workspace.current?.role ?? workspaceList.find((item) => item._id === workspaceId)?.role;
16081
16512
  const isWorkspaceAdmin = currentWorkspaceRole?.trim().toLowerCase() === "admin";
16082
- const [workspaceListLoading, setWorkspaceListLoading] = (0, import_react27.useState)(false);
16083
- const refreshWorkspaceList = (0, import_react27.useCallback)(async () => {
16513
+ const [workspaceListLoading, setWorkspaceListLoading] = (0, import_react28.useState)(false);
16514
+ const refreshWorkspaceList = (0, import_react28.useCallback)(async () => {
16084
16515
  setWorkspaceListLoading(true);
16085
16516
  try {
16086
16517
  const items = await workspace.list();
@@ -16101,11 +16532,11 @@ function SettingsContentInner({
16101
16532
  setWorkspaceListLoading(false);
16102
16533
  }
16103
16534
  }, [workspace, workspaceId]);
16104
- (0, import_react27.useEffect)(() => {
16535
+ (0, import_react28.useEffect)(() => {
16105
16536
  void refreshWorkspaceList();
16106
16537
  }, [refreshWorkspaceList]);
16107
16538
  const hostListPage = workspace.listPage;
16108
- const listWorkspacePage = (0, import_react27.useMemo)(
16539
+ const listWorkspacePage = (0, import_react28.useMemo)(
16109
16540
  () => hostListPage ? async (params) => {
16110
16541
  const result = await hostListPage(params);
16111
16542
  return {
@@ -16122,8 +16553,8 @@ function SettingsContentInner({
16122
16553
  } : void 0,
16123
16554
  [hostListPage, workspaceId]
16124
16555
  );
16125
- const [listOrganizations, setListOrganizations] = (0, import_react27.useState)([]);
16126
- (0, import_react27.useEffect)(() => {
16556
+ const [listOrganizations, setListOrganizations] = (0, import_react28.useState)([]);
16557
+ (0, import_react28.useEffect)(() => {
16127
16558
  if (activeTab !== "workspaceList" || typeof organization?.list !== "function") {
16128
16559
  return;
16129
16560
  }
@@ -16144,7 +16575,7 @@ function SettingsContentInner({
16144
16575
  cancelled = true;
16145
16576
  };
16146
16577
  }, [activeTab, organization]);
16147
- const switchWorkspace = (0, import_react27.useCallback)(
16578
+ const switchWorkspace = (0, import_react28.useCallback)(
16148
16579
  async (id) => {
16149
16580
  await workspace.switch(id);
16150
16581
  },
@@ -16153,38 +16584,38 @@ function SettingsContentInner({
16153
16584
  const setActiveTab = (tab) => {
16154
16585
  navigation.navigateToTab(tab);
16155
16586
  };
16156
- const [creatingWorkspace, setCreatingWorkspace] = (0, import_react27.useState)(false);
16157
- const [updatingWorkspace, setUpdatingWorkspace] = (0, import_react27.useState)(false);
16158
- const [teamInviteOpen, setTeamInviteOpen] = (0, import_react27.useState)(false);
16587
+ const [creatingWorkspace, setCreatingWorkspace] = (0, import_react28.useState)(false);
16588
+ const [updatingWorkspace, setUpdatingWorkspace] = (0, import_react28.useState)(false);
16589
+ const [teamInviteOpen, setTeamInviteOpen] = (0, import_react28.useState)(false);
16159
16590
  const teamPermissionScope = JSON.stringify([workspaceId, _auth.user?.id, workspace.current?.role]);
16160
- const [teamInvitePermission, setTeamInvitePermission] = (0, import_react27.useState)(null);
16591
+ const [teamInvitePermission, setTeamInvitePermission] = (0, import_react28.useState)(null);
16161
16592
  const teamCanInvite = teamInvitePermission?.scope === teamPermissionScope && teamInvitePermission.api === adapters.api ? teamInvitePermission.canInvite : null;
16162
- const receiveTeamInvitePermission = (0, import_react27.useCallback)((canInvite) => {
16593
+ const receiveTeamInvitePermission = (0, import_react28.useCallback)((canInvite) => {
16163
16594
  setTeamInvitePermission((previous) => previous?.scope === teamPermissionScope && previous.api === adapters.api && previous.canInvite === canInvite ? previous : { scope: teamPermissionScope, api: adapters.api, canInvite });
16164
16595
  }, [teamPermissionScope, adapters.api]);
16165
16596
  const canUseHeaderInvite = overviewDetail ? activeTab === "workspaceMembers" && !isOverview ? teamCanInvite === true : !overviewInvite.isLoading && overviewInvite.canInvite : teamCanInvite ?? isWorkspaceAdmin;
16166
- const [tokenShowRevoked, setTokenShowRevoked] = (0, import_react27.useState)(false);
16167
- const [tokenCreateOpen, setTokenCreateOpen] = (0, import_react27.useState)(false);
16168
- const [billingShowPlans, setBillingShowPlans] = (0, import_react27.useState)(false);
16597
+ const [tokenShowRevoked, setTokenShowRevoked] = (0, import_react28.useState)(false);
16598
+ const [tokenCreateOpen, setTokenCreateOpen] = (0, import_react28.useState)(false);
16599
+ const [billingShowPlans, setBillingShowPlans] = (0, import_react28.useState)(false);
16169
16600
  const isBillingPlans = activeTab === "billing" && isWorkspaceAdmin && billingShowPlans;
16170
- const [billingShowPerUserLimits, setBillingShowPerUserLimits] = (0, import_react27.useState)(false);
16601
+ const [billingShowPerUserLimits, setBillingShowPerUserLimits] = (0, import_react28.useState)(false);
16171
16602
  const isBillingPerUserLimits = activeTab === "billing" && isWorkspaceAdmin && billingShowPerUserLimits && !billingShowPlans;
16172
- const [billingShowSharedCredits, setBillingShowSharedCredits] = (0, import_react27.useState)(false);
16603
+ const [billingShowSharedCredits, setBillingShowSharedCredits] = (0, import_react28.useState)(false);
16173
16604
  const isBillingSharedCredits = activeTab === "billing" && isWorkspaceAdmin && billingShowSharedCredits && !billingShowPlans && !billingShowPerUserLimits;
16174
16605
  const isBillingSubView = isBillingPlans || isBillingPerUserLimits || isBillingSharedCredits;
16175
- (0, import_react27.useEffect)(() => {
16606
+ (0, import_react28.useEffect)(() => {
16176
16607
  if (isOverview || activeTab !== "billing" || !isWorkspaceAdmin) {
16177
16608
  setBillingShowPlans(false);
16178
16609
  setBillingShowPerUserLimits(false);
16179
16610
  setBillingShowSharedCredits(false);
16180
16611
  }
16181
16612
  }, [activeTab, isWorkspaceAdmin, isOverview]);
16182
- (0, import_react27.useEffect)(() => {
16613
+ (0, import_react28.useEffect)(() => {
16183
16614
  setBillingShowPlans(false);
16184
16615
  setBillingShowPerUserLimits(false);
16185
16616
  setBillingShowSharedCredits(false);
16186
16617
  }, [workspaceId]);
16187
- (0, import_react27.useEffect)(() => {
16618
+ (0, import_react28.useEffect)(() => {
16188
16619
  if (!onClose) return;
16189
16620
  const handleKeyDown = (e) => {
16190
16621
  if (e.key !== "Escape" || e.defaultPrevented) return;
@@ -16206,14 +16637,14 @@ function SettingsContentInner({
16206
16637
  document.addEventListener("keydown", handleKeyDown);
16207
16638
  return () => document.removeEventListener("keydown", handleKeyDown);
16208
16639
  }, [onClose, billingShowPlans, billingShowPerUserLimits, billingShowSharedCredits]);
16209
- const [localWorkspaces, setLocalWorkspaces] = (0, import_react27.useState)(null);
16210
- const [wsModalOpen, setWsModalOpen] = (0, import_react27.useState)(false);
16211
- const [wsModalMode, setWsModalMode] = (0, import_react27.useState)("create");
16212
- const [editingWorkspace, setEditingWorkspace] = (0, import_react27.useState)(null);
16213
- const [confirmLeaveOpen, setConfirmLeaveOpen] = (0, import_react27.useState)(false);
16214
- const [leavingWorkspace, setLeavingWorkspace] = (0, import_react27.useState)(null);
16215
- const [confirmDeleteOpen, setConfirmDeleteOpen] = (0, import_react27.useState)(false);
16216
- const [deletingWorkspace, setDeletingWorkspace] = (0, import_react27.useState)(null);
16640
+ const [localWorkspaces, setLocalWorkspaces] = (0, import_react28.useState)(null);
16641
+ const [wsModalOpen, setWsModalOpen] = (0, import_react28.useState)(false);
16642
+ const [wsModalMode, setWsModalMode] = (0, import_react28.useState)("create");
16643
+ const [editingWorkspace, setEditingWorkspace] = (0, import_react28.useState)(null);
16644
+ const [confirmLeaveOpen, setConfirmLeaveOpen] = (0, import_react28.useState)(false);
16645
+ const [leavingWorkspace, setLeavingWorkspace] = (0, import_react28.useState)(null);
16646
+ const [confirmDeleteOpen, setConfirmDeleteOpen] = (0, import_react28.useState)(false);
16647
+ const [deletingWorkspace, setDeletingWorkspace] = (0, import_react28.useState)(null);
16217
16648
  const toWorkspaceData = (ws) => ({
16218
16649
  id: ws._id,
16219
16650
  name: ws.name ?? "",
@@ -16303,7 +16734,7 @@ function SettingsContentInner({
16303
16734
  }
16304
16735
  return true;
16305
16736
  };
16306
- (0, import_react27.useEffect)(() => {
16737
+ (0, import_react28.useEffect)(() => {
16307
16738
  if (workspaceList.length > 0 && localWorkspaces === null) {
16308
16739
  setLocalWorkspaces(workspaceList.map(toWorkspaceData));
16309
16740
  }
@@ -16480,7 +16911,7 @@ function SettingsContentInner({
16480
16911
  setConfirmLeaveOpen(true);
16481
16912
  return false;
16482
16913
  }
16483
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
16914
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
16484
16915
  "div",
16485
16916
  {
16486
16917
  "data-streamoid-settings": "",
@@ -16491,8 +16922,8 @@ function SettingsContentInner({
16491
16922
  ...isOverview ? { display: "block", overflowY: "auto" } : {}
16492
16923
  },
16493
16924
  children: [
16494
- !isOverview && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SettingsAppearance, {}),
16495
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16925
+ !isOverview && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SettingsAppearance, {}),
16926
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16496
16927
  "div",
16497
16928
  {
16498
16929
  className: "flex flex-col items-start relative h-full overflow-hidden",
@@ -16503,8 +16934,8 @@ function SettingsContentInner({
16503
16934
  width: "100%",
16504
16935
  ...isOverview ? { height: "auto", minHeight: "100%", overflow: "visible", marginInline: "auto" } : {}
16505
16936
  },
16506
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col w-full flex-1 min-h-0", style: { gap: 20, paddingTop: 16 }, children: [
16507
- !overviewDetail && onBack !== null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center shrink-0", style: { paddingLeft: 20 }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
16937
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col w-full flex-1 min-h-0", style: { gap: 20, paddingTop: 16 }, children: [
16938
+ !overviewDetail && onBack !== null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center shrink-0", style: { paddingLeft: 20 }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
16508
16939
  "button",
16509
16940
  {
16510
16941
  type: "button",
@@ -16536,19 +16967,19 @@ function SettingsContentInner({
16536
16967
  else window.history.back();
16537
16968
  },
16538
16969
  children: [
16539
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconLeft, { className: "w-4 h-4 shrink-0", color: "var(--alias-text---icons-muted)" }),
16970
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconLeft, { className: "w-4 h-4 shrink-0", color: "var(--alias-text---icons-muted)" }),
16540
16971
  "Back"
16541
16972
  ]
16542
16973
  }
16543
16974
  ) }),
16544
- overviewDetail && !isOverview && (isBillingSubView || onOverview) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center shrink-0", style: { paddingLeft: 20 }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16545
- import_ui23.ScButton,
16975
+ overviewDetail && !isOverview && (isBillingSubView || onOverview) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center shrink-0", style: { paddingLeft: 20 }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16976
+ import_ui24.ScButton,
16546
16977
  {
16547
16978
  text: isBillingSubView ? "Back to billing" : "Back to account and workspace settings",
16548
16979
  variant: "tertiary",
16549
16980
  size: "sm",
16550
16981
  styleVariant: "icon-left",
16551
- icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconArrowLeft, { size: 18, "aria-hidden": "true" }),
16982
+ icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconArrowLeft, { size: 18, "aria-hidden": "true" }),
16552
16983
  onClick: () => {
16553
16984
  if (isBillingSubView) {
16554
16985
  setBillingShowPlans(false);
@@ -16560,7 +16991,7 @@ function SettingsContentInner({
16560
16991
  }
16561
16992
  }
16562
16993
  ) }),
16563
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
16994
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
16564
16995
  "div",
16565
16996
  {
16566
16997
  className: "flex items-center shrink-0 w-full",
@@ -16571,9 +17002,9 @@ function SettingsContentInner({
16571
17002
  paddingRight: 20
16572
17003
  },
16573
17004
  children: [
16574
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center flex-1 min-w-0", style: { gap: 8, paddingLeft: 20 }, children: [
16575
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconSettings, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
16576
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17005
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center flex-1 min-w-0", style: { gap: 8, paddingLeft: 20 }, children: [
17006
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconSettings, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
17007
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16577
17008
  "h1",
16578
17009
  {
16579
17010
  style: {
@@ -16587,10 +17018,10 @@ function SettingsContentInner({
16587
17018
  children: overviewDetail ? "Account and workspace settings" : "Settings"
16588
17019
  }
16589
17020
  ),
16590
- !isOverview && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("nav", { "aria-label": "Breadcrumb", className: "flex items-center min-w-0", style: { gap: 8 }, children: [
16591
- scopeCrumb && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
16592
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
16593
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17021
+ !isOverview && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("nav", { "aria-label": "Breadcrumb", className: "flex items-center min-w-0", style: { gap: 8 }, children: [
17022
+ scopeCrumb && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
17023
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
17024
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16594
17025
  "span",
16595
17026
  {
16596
17027
  className: "truncate",
@@ -16607,8 +17038,8 @@ function SettingsContentInner({
16607
17038
  }
16608
17039
  )
16609
17040
  ] }),
16610
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
16611
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17041
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
17042
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16612
17043
  "span",
16613
17044
  {
16614
17045
  style: {
@@ -16621,9 +17052,9 @@ function SettingsContentInner({
16621
17052
  children: leafLabel
16622
17053
  }
16623
17054
  ),
16624
- isBillingPlans && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
16625
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
16626
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17055
+ isBillingPlans && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
17056
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
17057
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16627
17058
  "span",
16628
17059
  {
16629
17060
  style: {
@@ -16637,9 +17068,9 @@ function SettingsContentInner({
16637
17068
  }
16638
17069
  )
16639
17070
  ] }),
16640
- isBillingPerUserLimits && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
16641
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
16642
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17071
+ isBillingPerUserLimits && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
17072
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
17073
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16643
17074
  "span",
16644
17075
  {
16645
17076
  style: {
@@ -16653,9 +17084,9 @@ function SettingsContentInner({
16653
17084
  }
16654
17085
  )
16655
17086
  ] }),
16656
- isBillingSharedCredits && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
16657
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
16658
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17087
+ isBillingSharedCredits && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
17088
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
17089
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16659
17090
  "span",
16660
17091
  {
16661
17092
  style: {
@@ -16671,20 +17102,20 @@ function SettingsContentInner({
16671
17102
  ] })
16672
17103
  ] })
16673
17104
  ] }),
16674
- !isOverview && activeTab === "workspaceList" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17105
+ !isOverview && activeTab === "workspaceList" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16675
17106
  SettingsTooltip,
16676
17107
  {
16677
17108
  content: "Start a new workspace with its own team, members and billing",
16678
17109
  placement: "bottom",
16679
17110
  inline: true,
16680
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16681
- import_ui23.ScButton,
17111
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
17112
+ import_ui24.ScButton,
16682
17113
  {
16683
17114
  text: "Create Workspace",
16684
17115
  variant: "secondary",
16685
17116
  size: "md",
16686
17117
  styleVariant: "icon-left",
16687
- icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17118
+ icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16688
17119
  import_icons18.SiconWorkspace,
16689
17120
  {
16690
17121
  className: "w-5 h-5",
@@ -16696,21 +17127,21 @@ function SettingsContentInner({
16696
17127
  )
16697
17128
  }
16698
17129
  ),
16699
- !isOverview && activeTab === "workspaceMembers" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17130
+ !isOverview && activeTab === "workspaceMembers" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16700
17131
  SettingsTooltip,
16701
17132
  {
16702
17133
  content: "Send someone an invite to join this workspace",
16703
17134
  placement: "bottom",
16704
17135
  inline: true,
16705
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16706
- import_ui23.ScButton,
17136
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
17137
+ import_ui24.ScButton,
16707
17138
  {
16708
17139
  text: overviewDetail ? "Invite people" : "Invite user",
16709
17140
  variant: "secondary",
16710
17141
  size: "md",
16711
17142
  styleVariant: "icon-left",
16712
17143
  state: canUseHeaderInvite ? "default" : "disabled",
16713
- icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17144
+ icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16714
17145
  import_icons18.SiconUserAdd,
16715
17146
  {
16716
17147
  className: "w-5 h-5",
@@ -16724,15 +17155,15 @@ function SettingsContentInner({
16724
17155
  )
16725
17156
  }
16726
17157
  ),
16727
- !isOverview && activeTab === "apikey" && isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center shrink-0", style: { gap: "var(--spacing-md)" }, children: [
16728
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17158
+ !isOverview && activeTab === "apikey" && isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center shrink-0", style: { gap: "var(--spacing-md)" }, children: [
17159
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16729
17160
  SettingsTooltip,
16730
17161
  {
16731
17162
  content: "Include keys you have already revoked in the list below",
16732
17163
  placement: "bottom",
16733
17164
  inline: true,
16734
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16735
- import_ui23.ScButton,
17165
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
17166
+ import_ui24.ScButton,
16736
17167
  {
16737
17168
  text: tokenShowRevoked ? "Hide Revoked" : "Show Revoked",
16738
17169
  variant: "outline",
@@ -16742,20 +17173,20 @@ function SettingsContentInner({
16742
17173
  )
16743
17174
  }
16744
17175
  ),
16745
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17176
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16746
17177
  SettingsTooltip,
16747
17178
  {
16748
17179
  content: "Generate a key for calling the Streamoid APIs from your own code",
16749
17180
  placement: "bottom",
16750
17181
  inline: true,
16751
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16752
- import_ui23.ScButton,
17182
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
17183
+ import_ui24.ScButton,
16753
17184
  {
16754
17185
  text: "New API Key",
16755
17186
  variant: "secondary",
16756
17187
  size: "md",
16757
17188
  styleVariant: "icon-left",
16758
- icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17189
+ icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16759
17190
  import_icons18.SiconPlus,
16760
17191
  {
16761
17192
  className: "w-5 h-5",
@@ -16768,13 +17199,13 @@ function SettingsContentInner({
16768
17199
  }
16769
17200
  )
16770
17201
  ] }),
16771
- overviewDetail && onClose && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SettingsTooltip, { content: "Close settings", placement: "bottom", inline: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16772
- import_ui23.ScButton,
17202
+ overviewDetail && onClose && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SettingsTooltip, { content: "Close settings", placement: "bottom", inline: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
17203
+ import_ui24.ScButton,
16773
17204
  {
16774
17205
  styleVariant: "icon-only",
16775
17206
  variant: "outline",
16776
17207
  size: "md",
16777
- icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconClose, { className: "w-5 h-5", color: PRIMARY_COLOR3 }),
17208
+ icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconClose, { className: "w-5 h-5", color: PRIMARY_COLOR3 }),
16778
17209
  "aria-label": "Close settings",
16779
17210
  style: isOverview ? { width: "2rem", height: "2rem", padding: 0 } : void 0,
16780
17211
  onClick: onClose
@@ -16783,7 +17214,7 @@ function SettingsContentInner({
16783
17214
  ]
16784
17215
  }
16785
17216
  ),
16786
- isOverview ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17217
+ isOverview ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16787
17218
  AdministrationOverview,
16788
17219
  {
16789
17220
  workspaceName: workspaceScopeName,
@@ -16793,18 +17224,19 @@ function SettingsContentInner({
16793
17224
  isWorkspaceAdmin,
16794
17225
  showConnectedApps,
16795
17226
  showIntegrations,
17227
+ showLoginMethods,
16796
17228
  showReferral,
16797
17229
  canInvite: !overviewInvite.isLoading && overviewInvite.canInvite,
16798
17230
  onNavigate: setActiveTab,
16799
17231
  onInvitePeople
16800
17232
  }
16801
- ) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
17233
+ ) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
16802
17234
  "div",
16803
17235
  {
16804
17236
  className: "flex items-start flex-1 min-h-0 w-full overflow-hidden",
16805
17237
  style: { gap: 20 },
16806
17238
  children: [
16807
- !overviewDetail && !isBillingSubView && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17239
+ !overviewDetail && !isBillingSubView && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16808
17240
  SettingsNav,
16809
17241
  {
16810
17242
  isWorkspaceAdmin,
@@ -16815,11 +17247,12 @@ function SettingsContentInner({
16815
17247
  hasOrganization,
16816
17248
  showConnectedApps,
16817
17249
  showIntegrations,
17250
+ showLoginMethods,
16818
17251
  showReferral
16819
17252
  }
16820
17253
  ),
16821
- activeTab === "profile" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ProfileTab, {}),
16822
- activeTab === "workspace" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17254
+ activeTab === "profile" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ProfileTab, {}),
17255
+ activeTab === "workspace" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16823
17256
  WorkspaceGeneralTab,
16824
17257
  {
16825
17258
  workspace: currentWorkspaceData,
@@ -16841,7 +17274,7 @@ function SettingsContentInner({
16841
17274
  }
16842
17275
  }
16843
17276
  ) }),
16844
- activeTab === "workspaceMembers" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17277
+ activeTab === "workspaceMembers" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16845
17278
  TeamsContent,
16846
17279
  {
16847
17280
  embedded: true,
@@ -16856,7 +17289,7 @@ function SettingsContentInner({
16856
17289
  hiddenApps
16857
17290
  }
16858
17291
  ) }),
16859
- activeTab === "workspaceList" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17292
+ activeTab === "workspaceList" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16860
17293
  WorkspaceListTab,
16861
17294
  {
16862
17295
  workspaces: displayWorkspaces,
@@ -16881,11 +17314,12 @@ function SettingsContentInner({
16881
17314
  }
16882
17315
  }
16883
17316
  ),
16884
- activeTab === "referral" && showReferral && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ReferralTab, {}),
16885
- activeTab === "connectedApps" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ConnectedAppsContent, {}),
16886
- activeTab === "organizationIntegrations" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OrganizationIntegrationsContent, {}),
16887
- activeTab === "organizationList" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OrganizationListContent, {}),
16888
- (activeTab === "organization" || activeTab === "organizationWorkspaces" || activeTab === "organizationDomains") && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: organization.managementUrl ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17317
+ activeTab === "referral" && showReferral && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ReferralTab, {}),
17318
+ activeTab === "connectedApps" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ConnectedAppsContent, {}),
17319
+ activeTab === "organizationIntegrations" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OrganizationIntegrationsContent, {}),
17320
+ activeTab === "organizationLoginMethods" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OrganizationLoginMethodsContent, {}),
17321
+ activeTab === "organizationList" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OrganizationListContent, {}),
17322
+ (activeTab === "organization" || activeTab === "organizationWorkspaces" || activeTab === "organizationDomains") && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: organization.managementUrl ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16889
17323
  ManagedOrganizationSummary,
16890
17324
  {
16891
17325
  name: workspaceOwner.organizationName,
@@ -16893,14 +17327,14 @@ function SettingsContentInner({
16893
17327
  status: workspaceOwner.organizationStatus,
16894
17328
  managementUrl: organization.managementUrl
16895
17329
  }
16896
- ) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17330
+ ) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16897
17331
  OrganizationContent,
16898
17332
  {
16899
17333
  embedded: true,
16900
17334
  view: activeTab === "organizationWorkspaces" || activeTab === "organizationDomains" ? "workspaces" : "people"
16901
17335
  }
16902
17336
  ) }),
16903
- activeTab === "billing" && isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17337
+ activeTab === "billing" && isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16904
17338
  BillingContent,
16905
17339
  {
16906
17340
  embedded: true,
@@ -16930,14 +17364,14 @@ function SettingsContentInner({
16930
17364
  }
16931
17365
  }
16932
17366
  ) }),
16933
- (activeTab === "billing" || activeTab === "apikey") && !isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { role: "status", className: "flex flex-col flex-1 min-w-0", style: { padding: 28, gap: 12, background: "var(--alias-surface-base)", border: "1px solid var(--alias-border-default)", borderRadius: "var(--radius-3xl, 16px)" }, children: [
16934
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconLock, { size: 24, color: MUTED_COLOR2 }),
16935
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h2", { style: { margin: 0, fontSize: 18, fontWeight: 600, color: PRIMARY_COLOR3 }, children: "Contact your workspace admin" }),
16936
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { style: { margin: 0, fontSize: 14, lineHeight: "22px", color: MUTED_COLOR2, maxWidth: 480 }, children: activeTab === "billing" ? "Your workspace admin manages credit top-ups, plans and billing history. Get in touch with them to add credits or request billing details." : "API Keys are available to workspace Admins only. Get in touch with your workspace admin to manage API access." }),
16937
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", onClick: () => setActiveTab("workspaceMembers"), style: { alignSelf: "flex-start", marginTop: 8, padding: "8px 12px", background: "transparent", color: PRIMARY_COLOR3, border: "1px solid var(--alias-border-default)", borderRadius: 8, cursor: "pointer" }, children: "View workspace members" })
17367
+ (activeTab === "billing" || activeTab === "apikey") && !isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("section", { role: "status", className: "flex flex-col flex-1 min-w-0", style: { padding: 28, gap: 12, background: "var(--alias-surface-base)", border: "1px solid var(--alias-border-default)", borderRadius: "var(--radius-3xl, 16px)" }, children: [
17368
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconLock, { size: 24, color: MUTED_COLOR2 }),
17369
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h2", { style: { margin: 0, fontSize: 18, fontWeight: 600, color: PRIMARY_COLOR3 }, children: "Contact your workspace admin" }),
17370
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { style: { margin: 0, fontSize: 14, lineHeight: "22px", color: MUTED_COLOR2, maxWidth: 480 }, children: activeTab === "billing" ? "Your workspace admin manages credit top-ups, plans and billing history. Get in touch with them to add credits or request billing details." : "API Keys are available to workspace Admins only. Get in touch with your workspace admin to manage API access." }),
17371
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", onClick: () => setActiveTab("workspaceMembers"), style: { alignSelf: "flex-start", marginTop: 8, padding: "8px 12px", background: "transparent", color: PRIMARY_COLOR3, border: "1px solid var(--alias-border-default)", borderRadius: 8, cursor: "pointer" }, children: "View workspace members" })
16938
17372
  ] }),
16939
- activeTab === "apikey" && isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: [
16940
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
17373
+ activeTab === "apikey" && isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col flex-1 min-w-0 min-h-0 h-full", children: [
17374
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
16941
17375
  "a",
16942
17376
  {
16943
17377
  href: "https://docs.streamoid.com",
@@ -16947,19 +17381,19 @@ function SettingsContentInner({
16947
17381
  className: "flex items-center shrink-0",
16948
17382
  style: { gap: 14, padding: "16px 20px", marginBottom: 16, border: "1px solid var(--alias-border-default)", borderRadius: "var(--radius-3xl, 16px)", background: "var(--alias-surface-base)", color: PRIMARY_COLOR3, textDecoration: "none" },
16949
17383
  children: [
16950
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconBookOpen, { size: 24 }),
16951
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { style: { display: "flex", flexDirection: "column", gap: 4, flex: 1 }, children: [
16952
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: { fontSize: 14, fontWeight: 600 }, children: "Build with the Streamoid API" }),
16953
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: { fontSize: 13, lineHeight: "20px", color: MUTED_COLOR2 }, children: "Explore authentication, API references and integration guides." })
17384
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconBookOpen, { size: 24 }),
17385
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { style: { display: "flex", flexDirection: "column", gap: 4, flex: 1 }, children: [
17386
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { style: { fontSize: 14, fontWeight: 600 }, children: "Build with the Streamoid API" }),
17387
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { style: { fontSize: 13, lineHeight: "20px", color: MUTED_COLOR2 }, children: "Explore authentication, API references and integration guides." })
16954
17388
  ] }),
16955
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 6, fontSize: 13, whiteSpace: "nowrap" }, children: [
17389
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 6, fontSize: 13, whiteSpace: "nowrap" }, children: [
16956
17390
  "View docs ",
16957
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons18.SiconExternalLink, { size: 16 })
17391
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconExternalLink, { size: 16 })
16958
17392
  ] })
16959
17393
  ]
16960
17394
  }
16961
17395
  ),
16962
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17396
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16963
17397
  TokensContent,
16964
17398
  {
16965
17399
  embedded: true,
@@ -16976,7 +17410,7 @@ function SettingsContentInner({
16976
17410
  ] })
16977
17411
  }
16978
17412
  ),
16979
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17413
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16980
17414
  WorkspaceModal,
16981
17415
  {
16982
17416
  open: wsModalOpen,
@@ -16995,7 +17429,7 @@ function SettingsContentInner({
16995
17429
  }
16996
17430
  }
16997
17431
  ),
16998
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17432
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
16999
17433
  ConfirmLeaveModal,
17000
17434
  {
17001
17435
  open: confirmLeaveOpen,
@@ -17028,7 +17462,7 @@ function SettingsContentInner({
17028
17462
  }
17029
17463
  }
17030
17464
  ),
17031
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
17465
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
17032
17466
  ConfirmDeleteModal,
17033
17467
  {
17034
17468
  open: confirmDeleteOpen,
@@ -17058,10 +17492,10 @@ function SettingsContentInner({
17058
17492
  }
17059
17493
 
17060
17494
  // src/workspace-picker.tsx
17061
- var import_react28 = require("react");
17062
- var import_ui25 = require("@streamoid/ui");
17495
+ var import_react29 = require("react");
17496
+ var import_ui26 = require("@streamoid/ui");
17063
17497
  var import_icons19 = require("@streamoid/icons");
17064
- var import_jsx_runtime34 = require("react/jsx-runtime");
17498
+ var import_jsx_runtime36 = require("react/jsx-runtime");
17065
17499
  var T19 = {
17066
17500
  primary: "var(--alias-text---icons-primary)",
17067
17501
  muted: "var(--alias-text---icons-muted)",
@@ -17102,14 +17536,14 @@ function WorkspacePicker({
17102
17536
  }
17103
17537
  ];
17104
17538
  const grouped = !!groups && sections.length > 1;
17105
- const [selected, setSelected] = (0, import_react28.useState)(/* @__PURE__ */ new Set());
17106
- const [collapsed, setCollapsed] = (0, import_react28.useState)(/* @__PURE__ */ new Set());
17107
- const [creating, setCreating] = (0, import_react28.useState)(false);
17108
- const [name, setName] = (0, import_react28.useState)("");
17109
- const [visibility, setVisibility] = (0, import_react28.useState)("shared");
17539
+ const [selected, setSelected] = (0, import_react29.useState)(/* @__PURE__ */ new Set());
17540
+ const [collapsed, setCollapsed] = (0, import_react29.useState)(/* @__PURE__ */ new Set());
17541
+ const [creating, setCreating] = (0, import_react29.useState)(false);
17542
+ const [name, setName] = (0, import_react29.useState)("");
17543
+ const [visibility, setVisibility] = (0, import_react29.useState)("shared");
17110
17544
  const creatable = onCreate ? sections.filter((s) => s.canCreate) : [];
17111
- const [createOrgId, setCreateOrgId] = (0, import_react28.useState)("");
17112
- const [busy, setBusy] = (0, import_react28.useState)(false);
17545
+ const [createOrgId, setCreateOrgId] = (0, import_react29.useState)("");
17546
+ const [busy, setBusy] = (0, import_react29.useState)(false);
17113
17547
  const total = sections.reduce((n, s) => n + s.workspaces.length, 0);
17114
17548
  const hasWorkspaces = total > 0;
17115
17549
  const canCreate = creatable.length > 0;
@@ -17144,7 +17578,7 @@ function WorkspacePicker({
17144
17578
  );
17145
17579
  const workspaceRow = (workspace, first) => {
17146
17580
  const checked = selected.has(workspace._id);
17147
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
17581
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
17148
17582
  "div",
17149
17583
  {
17150
17584
  role: "checkbox",
@@ -17165,8 +17599,8 @@ function WorkspacePicker({
17165
17599
  }
17166
17600
  },
17167
17601
  children: [
17168
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui25.ScCheckbox, { checked }),
17169
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17602
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_ui26.ScCheckbox, { checked }),
17603
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17170
17604
  ProfileAvatar,
17171
17605
  {
17172
17606
  name: workspace.name,
@@ -17175,8 +17609,8 @@ function WorkspacePicker({
17175
17609
  borderRadius: T19.rLg
17176
17610
  }
17177
17611
  ),
17178
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col min-w-0", children: [
17179
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17612
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col min-w-0", children: [
17613
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17180
17614
  "span",
17181
17615
  {
17182
17616
  className: "truncate",
@@ -17184,7 +17618,7 @@ function WorkspacePicker({
17184
17618
  children: workspace.name
17185
17619
  }
17186
17620
  ),
17187
- workspace.ownerName && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
17621
+ workspace.ownerName && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
17188
17622
  "span",
17189
17623
  {
17190
17624
  className: "truncate",
@@ -17205,8 +17639,8 @@ function WorkspacePicker({
17205
17639
  const isCollapsed = collapsed.has(section.organizationId);
17206
17640
  const picked = section.workspaces.filter((w) => selected.has(w._id)).length;
17207
17641
  const Chevron = isCollapsed ? import_icons19.SiconChevronRight : import_icons19.SiconChevronDown;
17208
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col w-full", children: [
17209
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
17642
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col w-full", children: [
17643
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
17210
17644
  "div",
17211
17645
  {
17212
17646
  role: "button",
@@ -17230,8 +17664,8 @@ function WorkspacePicker({
17230
17664
  }
17231
17665
  },
17232
17666
  children: [
17233
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Chevron, { className: "w-4 h-4", color: T19.muted }),
17234
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17667
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Chevron, { className: "w-4 h-4", color: T19.muted }),
17668
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17235
17669
  ProfileAvatar,
17236
17670
  {
17237
17671
  name: section.organizationName,
@@ -17240,7 +17674,7 @@ function WorkspacePicker({
17240
17674
  borderRadius: T19.rLg
17241
17675
  }
17242
17676
  ),
17243
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17677
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17244
17678
  "span",
17245
17679
  {
17246
17680
  className: "truncate flex-1 min-w-0",
@@ -17248,11 +17682,11 @@ function WorkspacePicker({
17248
17682
  children: section.organizationName
17249
17683
  }
17250
17684
  ),
17251
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { style: { color: T19.muted, fontSize: T19.fsXs, lineHeight: T19.lhXs, flexShrink: 0 }, children: picked ? `${picked} of ${section.workspaces.length} selected` : `${section.workspaces.length} workspace${section.workspaces.length === 1 ? "" : "s"}` })
17685
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { style: { color: T19.muted, fontSize: T19.fsXs, lineHeight: T19.lhXs, flexShrink: 0 }, children: picked ? `${picked} of ${section.workspaces.length} selected` : `${section.workspaces.length} workspace${section.workspaces.length === 1 ? "" : "s"}` })
17252
17686
  ]
17253
17687
  }
17254
17688
  ),
17255
- !isCollapsed && (section.workspaces.length ? section.workspaces.map((w) => workspaceRow(w, false)) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17689
+ !isCollapsed && (section.workspaces.length ? section.workspaces.map((w) => workspaceRow(w, false)) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17256
17690
  "div",
17257
17691
  {
17258
17692
  style: {
@@ -17267,14 +17701,14 @@ function WorkspacePicker({
17267
17701
  ))
17268
17702
  ] }, section.organizationId);
17269
17703
  };
17270
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
17704
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
17271
17705
  "div",
17272
17706
  {
17273
17707
  className: "flex flex-col w-full",
17274
17708
  style: { maxWidth: 520, gap: T19.sp5xl, fontFamily: T19.font },
17275
17709
  children: [
17276
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col", style: { gap: T19.spMd }, children: [
17277
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17710
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col", style: { gap: T19.spMd }, children: [
17711
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17278
17712
  "p",
17279
17713
  {
17280
17714
  style: {
@@ -17287,9 +17721,9 @@ function WorkspacePicker({
17287
17721
  children: "Choose your workspaces"
17288
17722
  }
17289
17723
  ),
17290
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { style: { color: T19.muted, fontSize: T19.fsSm, lineHeight: T19.lhSm, margin: 0 }, children: hasWorkspaces || loading ? canCreate ? `Join one or more workspaces in ${orgLabel} as a member, or create your own.` : `Join one or more workspaces in ${orgLabel} as a member.` : canCreate ? `There are no workspaces to join in ${orgLabel} yet. Create one to get started.` : `There are no workspaces you can join in ${orgLabel} yet. Ask an admin${grouped ? "" : ` of ${orgLabel}`} to invite you to one.` })
17724
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { style: { color: T19.muted, fontSize: T19.fsSm, lineHeight: T19.lhSm, margin: 0 }, children: hasWorkspaces || loading ? canCreate ? `Join one or more workspaces in ${orgLabel} as a member, or create your own.` : `Join one or more workspaces in ${orgLabel} as a member.` : canCreate ? `There are no workspaces to join in ${orgLabel} yet. Create one to get started.` : `There are no workspaces you can join in ${orgLabel} yet. Ask an admin${grouped ? "" : ` of ${orgLabel}`} to invite you to one.` })
17291
17725
  ] }),
17292
- (loading || hasWorkspaces) && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17726
+ (loading || hasWorkspaces) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17293
17727
  "div",
17294
17728
  {
17295
17729
  className: "flex flex-col w-full overflow-y-auto",
@@ -17299,7 +17733,7 @@ function WorkspacePicker({
17299
17733
  border: `1px solid ${T19.borderSubtle}`,
17300
17734
  borderRadius: T19.r3xl
17301
17735
  },
17302
- children: loading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17736
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17303
17737
  "div",
17304
17738
  {
17305
17739
  className: "flex items-center justify-center",
@@ -17309,9 +17743,9 @@ function WorkspacePicker({
17309
17743
  ) : grouped ? sections.map(groupSection) : sections[0].workspaces.map((w, index) => workspaceRow(w, index === 0))
17310
17744
  }
17311
17745
  ),
17312
- showCreate ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T19.spMd }, children: [
17313
- creatable.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
17314
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17746
+ showCreate ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T19.spMd }, children: [
17747
+ creatable.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
17748
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17315
17749
  "label",
17316
17750
  {
17317
17751
  htmlFor: "workspace-picker-organization",
@@ -17319,7 +17753,7 @@ function WorkspacePicker({
17319
17753
  children: "Organization"
17320
17754
  }
17321
17755
  ),
17322
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17756
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17323
17757
  "select",
17324
17758
  {
17325
17759
  id: "workspace-picker-organization",
@@ -17336,11 +17770,11 @@ function WorkspacePicker({
17336
17770
  fontFamily: T19.font,
17337
17771
  fontSize: T19.fsSm
17338
17772
  },
17339
- children: creatable.map((s) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("option", { value: s.organizationId, children: s.organizationName }, s.organizationId))
17773
+ children: creatable.map((s) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("option", { value: s.organizationId, children: s.organizationName }, s.organizationId))
17340
17774
  }
17341
17775
  )
17342
17776
  ] }),
17343
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17777
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17344
17778
  "label",
17345
17779
  {
17346
17780
  htmlFor: "workspace-picker-name",
@@ -17348,7 +17782,7 @@ function WorkspacePicker({
17348
17782
  children: "New workspace name"
17349
17783
  }
17350
17784
  ),
17351
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17785
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17352
17786
  "input",
17353
17787
  {
17354
17788
  id: "workspace-picker-name",
@@ -17372,12 +17806,12 @@ function WorkspacePicker({
17372
17806
  }
17373
17807
  }
17374
17808
  ),
17375
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { role: "radiogroup", className: "flex w-full", style: { gap: T19.spMd }, children: [
17809
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { role: "radiogroup", className: "flex w-full", style: { gap: T19.spMd }, children: [
17376
17810
  ["shared", "Shared", `Anyone in ${createLabel} can join`],
17377
17811
  ["private", "Private", "Invite only"]
17378
17812
  ].map(([value, label, hint]) => {
17379
17813
  const active = visibility === value;
17380
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
17814
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
17381
17815
  "div",
17382
17816
  {
17383
17817
  role: "radio",
@@ -17398,7 +17832,7 @@ function WorkspacePicker({
17398
17832
  border: `1px solid ${active ? T19.primary : T19.borderSubtle}`
17399
17833
  },
17400
17834
  children: [
17401
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17835
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17402
17836
  "span",
17403
17837
  {
17404
17838
  style: {
@@ -17410,15 +17844,15 @@ function WorkspacePicker({
17410
17844
  children: label
17411
17845
  }
17412
17846
  ),
17413
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { style: { color: T19.muted, fontSize: T19.fsXs, lineHeight: T19.lhXs }, children: hint })
17847
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { style: { color: T19.muted, fontSize: T19.fsXs, lineHeight: T19.lhXs }, children: hint })
17414
17848
  ]
17415
17849
  },
17416
17850
  value
17417
17851
  );
17418
17852
  }) }),
17419
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-end w-full", style: { gap: T19.spMd }, children: [
17420
- hasWorkspaces && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17421
- import_ui25.ScButton,
17853
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-end w-full", style: { gap: T19.spMd }, children: [
17854
+ hasWorkspaces && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17855
+ import_ui26.ScButton,
17422
17856
  {
17423
17857
  text: "Back",
17424
17858
  variant: "tertiary",
@@ -17426,8 +17860,8 @@ function WorkspacePicker({
17426
17860
  onClick: () => setCreating(false)
17427
17861
  }
17428
17862
  ),
17429
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17430
- import_ui25.ScButton,
17863
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17864
+ import_ui26.ScButton,
17431
17865
  {
17432
17866
  text: busy ? "Creating\u2026" : "Create workspace",
17433
17867
  variant: "primary",
@@ -17437,9 +17871,9 @@ function WorkspacePicker({
17437
17871
  }
17438
17872
  )
17439
17873
  ] })
17440
- ] }) : !loading && !hasWorkspaces ? null : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-wrap items-center justify-between w-full", style: { gap: T19.spMd }, children: [
17441
- canCreate ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17442
- import_ui25.ScButton,
17874
+ ] }) : !loading && !hasWorkspaces ? null : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-wrap items-center justify-between w-full", style: { gap: T19.spMd }, children: [
17875
+ canCreate ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17876
+ import_ui26.ScButton,
17443
17877
  {
17444
17878
  text: "Create a workspace",
17445
17879
  variant: "tertiary",
@@ -17447,9 +17881,9 @@ function WorkspacePicker({
17447
17881
  state: loading || busy ? "disabled" : "default",
17448
17882
  onClick: loading || busy ? void 0 : () => setCreating(true)
17449
17883
  }
17450
- ) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", {}),
17451
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
17452
- import_ui25.ScButton,
17884
+ ) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", {}),
17885
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
17886
+ import_ui26.ScButton,
17453
17887
  {
17454
17888
  text: busy ? "Joining\u2026" : selected.size > 1 ? `Join ${selected.size} workspaces` : "Join workspace",
17455
17889
  variant: "primary",
@@ -17465,9 +17899,9 @@ function WorkspacePicker({
17465
17899
  }
17466
17900
 
17467
17901
  // src/organization-picker.tsx
17468
- var import_react29 = require("react");
17469
- var import_ui26 = require("@streamoid/ui");
17470
- var import_jsx_runtime35 = require("react/jsx-runtime");
17902
+ var import_react30 = require("react");
17903
+ var import_ui27 = require("@streamoid/ui");
17904
+ var import_jsx_runtime37 = require("react/jsx-runtime");
17471
17905
  var T20 = {
17472
17906
  primary: "var(--alias-text---icons-primary)",
17473
17907
  muted: "var(--alias-text---icons-muted)",
@@ -17501,17 +17935,17 @@ function OrganizationPicker({
17501
17935
  onJoin,
17502
17936
  onCreate
17503
17937
  }) {
17504
- const [selected, setSelected] = (0, import_react29.useState)(/* @__PURE__ */ new Set());
17938
+ const [selected, setSelected] = (0, import_react30.useState)(/* @__PURE__ */ new Set());
17505
17939
  const toggle = (id) => setSelected((prev) => {
17506
17940
  const next = new Set(prev);
17507
17941
  if (next.has(id)) next.delete(id);
17508
17942
  else next.add(id);
17509
17943
  return next;
17510
17944
  });
17511
- const [name, setName] = (0, import_react29.useState)(suggestedName);
17512
- const [type, setType] = (0, import_react29.useState)("shared");
17513
- const [busy, setBusy] = (0, import_react29.useState)(false);
17514
- (0, import_react29.useEffect)(() => {
17945
+ const [name, setName] = (0, import_react30.useState)(suggestedName);
17946
+ const [type, setType] = (0, import_react30.useState)("shared");
17947
+ const [busy, setBusy] = (0, import_react30.useState)(false);
17948
+ (0, import_react30.useEffect)(() => {
17515
17949
  setName((current) => current || suggestedName);
17516
17950
  }, [suggestedName]);
17517
17951
  const choosing = organizations.length > 0;
@@ -17527,18 +17961,18 @@ function OrganizationPicker({
17527
17961
  const heading = choosing ? "Choose your organization" : "Create your organization";
17528
17962
  const subheading = choosing ? `${companyDomain ?? "Your company"} has more than one organization. Pick the ones to join as a member.` : publicDomain ? "Create an organization for your team. Or, if your team already uses Streamoid, ask them to invite you." : `Nobody from ${companyDomain ?? "your company"} has set up an organization you can join yet. Create one; you'll be its admin.`;
17529
17963
  const textStyle = { margin: 0, fontFamily: T20.font };
17530
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
17964
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
17531
17965
  "div",
17532
17966
  {
17533
17967
  className: "flex flex-col w-full",
17534
17968
  style: { maxWidth: 520, gap: T20.sp5xl, fontFamily: T20.font },
17535
17969
  children: [
17536
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col", style: { gap: T20.spMd }, children: [
17537
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { style: { ...textStyle, color: T20.primary, fontSize: T20.fsXl, fontWeight: 600, lineHeight: T20.lhXl }, children: heading }),
17538
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { style: { ...textStyle, color: T20.muted, fontSize: T20.fsSm, lineHeight: T20.lhSm }, children: loading ? "Looking up your company\u2026" : subheading })
17970
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col", style: { gap: T20.spMd }, children: [
17971
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { style: { ...textStyle, color: T20.primary, fontSize: T20.fsXl, fontWeight: 600, lineHeight: T20.lhXl }, children: heading }),
17972
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { style: { ...textStyle, color: T20.muted, fontSize: T20.fsSm, lineHeight: T20.lhSm }, children: loading ? "Looking up your company\u2026" : subheading })
17539
17973
  ] }),
17540
- !loading && choosing && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
17541
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
17974
+ !loading && choosing && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
17975
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
17542
17976
  "div",
17543
17977
  {
17544
17978
  role: "group",
@@ -17551,7 +17985,7 @@ function OrganizationPicker({
17551
17985
  },
17552
17986
  children: organizations.map((org, index) => {
17553
17987
  const checked = selected.has(org._id);
17554
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
17988
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
17555
17989
  "div",
17556
17990
  {
17557
17991
  role: "checkbox",
@@ -17572,11 +18006,11 @@ function OrganizationPicker({
17572
18006
  }
17573
18007
  },
17574
18008
  children: [
17575
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui26.ScCheckbox, { checked }),
17576
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ProfileAvatar, { name: org.name, profileImage: org.imageUrl, size: 32, borderRadius: T20.rLg }),
17577
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col min-w-0", children: [
17578
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "truncate", style: { color: T20.primary, fontSize: T20.fsSm, fontWeight: 500, lineHeight: T20.lhSm }, children: org.name }),
17579
- org.domain && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "truncate", style: { color: T20.muted, fontSize: T20.fsXs, lineHeight: T20.lhXs }, children: org.domain })
18009
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_ui27.ScCheckbox, { checked }),
18010
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ProfileAvatar, { name: org.name, profileImage: org.imageUrl, size: 32, borderRadius: T20.rLg }),
18011
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col min-w-0", children: [
18012
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "truncate", style: { color: T20.primary, fontSize: T20.fsSm, fontWeight: 500, lineHeight: T20.lhSm }, children: org.name }),
18013
+ org.domain && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "truncate", style: { color: T20.muted, fontSize: T20.fsXs, lineHeight: T20.lhXs }, children: org.domain })
17580
18014
  ] })
17581
18015
  ]
17582
18016
  },
@@ -17585,8 +18019,8 @@ function OrganizationPicker({
17585
18019
  })
17586
18020
  }
17587
18021
  ),
17588
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
17589
- import_ui26.ScButton,
18022
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
18023
+ import_ui27.ScButton,
17590
18024
  {
17591
18025
  text: busy ? "Joining\u2026" : selected.size > 1 ? `Join ${selected.size} organizations` : "Join organization",
17592
18026
  variant: "primary",
@@ -17596,10 +18030,10 @@ function OrganizationPicker({
17596
18030
  }
17597
18031
  ) })
17598
18032
  ] }),
17599
- !loading && !choosing && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T20.sp3xl }, children: [
17600
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T20.spMd }, children: [
17601
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("label", { htmlFor: "organization-picker-name", style: { color: T20.tertiary, fontSize: T20.fsSm, lineHeight: T20.lhSm }, children: "Organization name" }),
17602
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
18033
+ !loading && !choosing && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T20.sp3xl }, children: [
18034
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T20.spMd }, children: [
18035
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("label", { htmlFor: "organization-picker-name", style: { color: T20.tertiary, fontSize: T20.fsSm, lineHeight: T20.lhSm }, children: "Organization name" }),
18036
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
17603
18037
  "input",
17604
18038
  {
17605
18039
  id: "organization-picker-name",
@@ -17621,14 +18055,14 @@ function OrganizationPicker({
17621
18055
  }
17622
18056
  )
17623
18057
  ] }),
17624
- !publicDomain && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T20.spMd }, children: [
17625
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { style: { color: T20.tertiary, fontSize: T20.fsSm, lineHeight: T20.lhSm }, children: "Who can join" }),
17626
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { role: "radiogroup", className: "flex w-full", style: { gap: T20.spMd }, children: [
18058
+ !publicDomain && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T20.spMd }, children: [
18059
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { style: { color: T20.tertiary, fontSize: T20.fsSm, lineHeight: T20.lhSm }, children: "Who can join" }),
18060
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { role: "radiogroup", className: "flex w-full", style: { gap: T20.spMd }, children: [
17627
18061
  ["shared", "Shared"],
17628
18062
  ["private", "Private"]
17629
18063
  ].map(([value, label]) => {
17630
18064
  const active = type === value;
17631
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
18065
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
17632
18066
  "div",
17633
18067
  {
17634
18068
  role: "radio",
@@ -17647,12 +18081,12 @@ function OrganizationPicker({
17647
18081
  borderRadius: T20.r3xl,
17648
18082
  border: `1px solid ${active ? T20.primary : T20.borderSubtle}`
17649
18083
  },
17650
- children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { style: { color: T20.primary, fontSize: T20.fsSm, lineHeight: T20.lhSm, fontWeight: active ? 600 : 400 }, children: label })
18084
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { style: { color: T20.primary, fontSize: T20.fsSm, lineHeight: T20.lhSm, fontWeight: active ? 600 : 400 }, children: label })
17651
18085
  },
17652
18086
  value
17653
18087
  );
17654
18088
  }) }),
17655
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
18089
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
17656
18090
  "span",
17657
18091
  {
17658
18092
  "data-testid": "organization-visibility-message",
@@ -17662,8 +18096,8 @@ function OrganizationPicker({
17662
18096
  }
17663
18097
  )
17664
18098
  ] }),
17665
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
17666
- import_ui26.ScButton,
18099
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
18100
+ import_ui27.ScButton,
17667
18101
  {
17668
18102
  text: busy ? "Creating\u2026" : "Create organization",
17669
18103
  variant: "primary",
@@ -17679,13 +18113,13 @@ function OrganizationPicker({
17679
18113
  }
17680
18114
 
17681
18115
  // src/use-billing-entitlement.ts
17682
- var import_react30 = require("react");
18116
+ var import_react31 = require("react");
17683
18117
  function useBillingEntitlement(fetchCurrentPlan, key) {
17684
- const fetchRef = (0, import_react30.useRef)(fetchCurrentPlan);
18118
+ const fetchRef = (0, import_react31.useRef)(fetchCurrentPlan);
17685
18119
  fetchRef.current = fetchCurrentPlan;
17686
- const [state, setState] = (0, import_react30.useState)(null);
17687
- const [loading, setLoading] = (0, import_react30.useState)(false);
17688
- (0, import_react30.useEffect)(() => {
18120
+ const [state, setState] = (0, import_react31.useState)(null);
18121
+ const [loading, setLoading] = (0, import_react31.useState)(false);
18122
+ (0, import_react31.useEffect)(() => {
17689
18123
  const fetch2 = fetchRef.current;
17690
18124
  setState(null);
17691
18125
  if (!key || !fetch2) {
@@ -17748,7 +18182,7 @@ function readSettingsCaller(base, state, entryKey, fallback = `${normalizedBase(
17748
18182
  }
17749
18183
 
17750
18184
  // src/app-settings-page.tsx
17751
- var import_react31 = require("react");
18185
+ var import_react32 = require("react");
17752
18186
  var import_icons20 = require("@streamoid/icons");
17753
18187
 
17754
18188
  // src/app-settings-page.module.css
@@ -17770,18 +18204,18 @@ var app_settings_page_default = {
17770
18204
  };
17771
18205
 
17772
18206
  // src/app-settings-page.tsx
17773
- var import_jsx_runtime36 = require("react/jsx-runtime");
18207
+ var import_jsx_runtime38 = require("react/jsx-runtime");
17774
18208
  function AppSettingsHeader({ administrationHref, onOpenAdministration, onClose }) {
17775
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("header", { className: app_settings_page_default.header, children: [
17776
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h1", { children: "App settings" }),
17777
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: app_settings_page_default.actions, children: [
17778
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("a", { href: administrationHref, onClick: (event) => {
18209
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("header", { className: app_settings_page_default.header, children: [
18210
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { children: "App settings" }),
18211
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: app_settings_page_default.actions, children: [
18212
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("a", { href: administrationHref, onClick: (event) => {
17779
18213
  if (onOpenAdministration && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey && event.button === 0) {
17780
18214
  event.preventDefault();
17781
18215
  onOpenAdministration();
17782
18216
  }
17783
18217
  }, children: "Account and workspace settings" }),
17784
- onClose ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", className: app_settings_page_default.close, "aria-label": "Close App settings", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons20.SiconX, { size: 20, "aria-hidden": "true" }) }) : null
18218
+ onClose ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", className: app_settings_page_default.close, "aria-label": "Close App settings", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons20.SiconX, { size: 20, "aria-hidden": "true" }) }) : null
17785
18219
  ] })
17786
18220
  ] });
17787
18221
  }
@@ -17793,43 +18227,43 @@ function AppSettingsPage({
17793
18227
  emptyDescription = "Account, workspace and organization settings are available above.",
17794
18228
  children
17795
18229
  }) {
17796
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: app_settings_page_default.page, children: [
17797
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AppSettingsHeader, { administrationHref, onOpenAdministration, onClose }),
17798
- children ?? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("section", { className: app_settings_page_default.empty, "aria-label": "App settings empty state", children: [
17799
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h2", { children: emptyTitle }),
17800
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { children: emptyDescription })
18230
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: app_settings_page_default.page, children: [
18231
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AppSettingsHeader, { administrationHref, onOpenAdministration, onClose }),
18232
+ children ?? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: app_settings_page_default.empty, "aria-label": "App settings empty state", children: [
18233
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { children: emptyTitle }),
18234
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: emptyDescription })
17801
18235
  ] })
17802
18236
  ] });
17803
18237
  }
17804
18238
  function AppSettingsSection({ title, action, children }) {
17805
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("section", { className: app_settings_page_default.section, "aria-label": title, children: [
17806
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: app_settings_page_default.sectionHeader, children: [
17807
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h2", { children: title }),
17808
- action ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: app_settings_page_default.sectionAction, children: action }) : null
18239
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: app_settings_page_default.section, "aria-label": title, children: [
18240
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: app_settings_page_default.sectionHeader, children: [
18241
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { children: title }),
18242
+ action ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: app_settings_page_default.sectionAction, children: action }) : null
17809
18243
  ] }),
17810
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children })
18244
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children })
17811
18245
  ] });
17812
18246
  }
17813
18247
  function AppSettingsRow({ title, description, summary, href, onClick, disabled, disabledReason, ariaLabel, trailing }) {
17814
- const reasonId = (0, import_react31.useId)();
17815
- const content = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
17816
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: app_settings_page_default.rowCopy, children: [
17817
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: app_settings_page_default.rowTitle, children: title }),
17818
- description ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: app_settings_page_default.rowDescription, children: description }) : null
18248
+ const reasonId = (0, import_react32.useId)();
18249
+ const content = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
18250
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: app_settings_page_default.rowCopy, children: [
18251
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: app_settings_page_default.rowTitle, children: title }),
18252
+ description ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: app_settings_page_default.rowDescription, children: description }) : null
17819
18253
  ] }),
17820
- summary || trailing || href || onClick ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: app_settings_page_default.rowEnd, children: [
18254
+ summary || trailing || href || onClick ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: app_settings_page_default.rowEnd, children: [
17821
18255
  summary,
17822
- trailing ?? (!disabled && (href || onClick) ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons20.SiconArrowRight, { size: 18, "aria-hidden": "true" }) : null)
18256
+ trailing ?? (!disabled && (href || onClick) ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons20.SiconArrowRight, { size: 18, "aria-hidden": "true" }) : null)
17823
18257
  ] }) : null,
17824
- disabledReason ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: app_settings_page_default.srOnly, id: reasonId, children: disabledReason }) : null
18258
+ disabledReason ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: app_settings_page_default.srOnly, id: reasonId, children: disabledReason }) : null
17825
18259
  ] });
17826
18260
  const props = { className: app_settings_page_default.row, "aria-label": ariaLabel, "aria-describedby": disabledReason ? reasonId : void 0 };
17827
- if (href && !disabled) return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("a", { ...props, href, onClick: (event) => {
18261
+ if (href && !disabled) return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("a", { ...props, href, onClick: (event) => {
17828
18262
  if (onClick && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey && event.button === 0) {
17829
18263
  event.preventDefault();
17830
18264
  onClick();
17831
18265
  }
17832
18266
  }, children: content });
17833
- if (onClick || disabled) return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { ...props, type: "button", disabled, onClick, children: content });
17834
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ...props, children: content });
18267
+ if (onClick || disabled) return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { ...props, type: "button", disabled, onClick, children: content });
18268
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { ...props, children: content });
17835
18269
  }