@streamoid/settings 0.19.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +94 -3
- package/dist/index.d.ts +94 -3
- package/dist/index.js +667 -384
- package/dist/index.mjs +627 -344
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ __export(index_exports, {
|
|
|
47
47
|
MemberListToolbar: () => MemberListToolbar,
|
|
48
48
|
OrganizationContent: () => OrganizationContent,
|
|
49
49
|
OrganizationIntegrationsContent: () => OrganizationIntegrationsContent,
|
|
50
|
+
OrganizationLoginMethodsContent: () => OrganizationLoginMethodsContent,
|
|
50
51
|
OrganizationMemberModal: () => OrganizationMemberModal,
|
|
51
52
|
OrganizationModal: () => OrganizationModal,
|
|
52
53
|
OrganizationPicker: () => OrganizationPicker,
|
|
@@ -120,6 +121,7 @@ __export(index_exports, {
|
|
|
120
121
|
limitSourceLabel: () => limitSourceLabel,
|
|
121
122
|
loadCurrentPlan: () => loadCurrentPlan,
|
|
122
123
|
loadWorkspaceOrganization: () => loadWorkspaceOrganization,
|
|
124
|
+
loginMethodsSwitchState: () => loginMethodsSwitchState,
|
|
123
125
|
memberRoleUpdate: () => memberRoleUpdate,
|
|
124
126
|
minPoolEndDate: () => minPoolEndDate,
|
|
125
127
|
minimumCreditLimit: () => minimumCreditLimit,
|
|
@@ -146,6 +148,7 @@ __export(index_exports, {
|
|
|
146
148
|
sliceUsageLogsPage: () => sliceUsageLogsPage,
|
|
147
149
|
sortReferredUsers: () => sortReferredUsers,
|
|
148
150
|
sponsoredCreditsText: () => sponsoredCreditsText,
|
|
151
|
+
ssoLabel: () => ssoLabel,
|
|
149
152
|
toCsv: () => toCsv,
|
|
150
153
|
toLocalDateInput: () => toLocalDateInput,
|
|
151
154
|
usageLogsCsvRows: () => usageLogsCsvRows,
|
|
@@ -429,7 +432,8 @@ var TAB_SCOPE = {
|
|
|
429
432
|
billing: "workspace",
|
|
430
433
|
apikey: "workspace",
|
|
431
434
|
connectedApps: "account",
|
|
432
|
-
organizationIntegrations: "organization"
|
|
435
|
+
organizationIntegrations: "organization",
|
|
436
|
+
organizationLoginMethods: "organization"
|
|
433
437
|
};
|
|
434
438
|
var SCOPE_LABELS = {
|
|
435
439
|
account: "Account",
|
|
@@ -450,7 +454,8 @@ var TAB_TO_URL = {
|
|
|
450
454
|
billing: "billing",
|
|
451
455
|
apikey: "api-keys",
|
|
452
456
|
connectedApps: "connected-apps",
|
|
453
|
-
organizationIntegrations: "organization/integrations"
|
|
457
|
+
organizationIntegrations: "organization/integrations",
|
|
458
|
+
organizationLoginMethods: "organization/login-methods"
|
|
454
459
|
};
|
|
455
460
|
var URL_TO_TAB = {
|
|
456
461
|
/* Canonical, scope-first slugs. */
|
|
@@ -461,6 +466,7 @@ var URL_TO_TAB = {
|
|
|
461
466
|
"organization/people": "organization",
|
|
462
467
|
"organization/workspaces": "organizationWorkspaces",
|
|
463
468
|
"organization/integrations": "organizationIntegrations",
|
|
469
|
+
"organization/login-methods": "organizationLoginMethods",
|
|
464
470
|
/* The Domains tab is gone; its join requests live under Workspaces. */
|
|
465
471
|
"organization/domains": "organizationWorkspaces",
|
|
466
472
|
/* Unscoped destinations. */
|
|
@@ -492,7 +498,8 @@ var TAB_LABELS = {
|
|
|
492
498
|
billing: "Billing & usage",
|
|
493
499
|
apikey: "API Keys",
|
|
494
500
|
connectedApps: "Connected apps",
|
|
495
|
-
organizationIntegrations: "Integrations"
|
|
501
|
+
organizationIntegrations: "Integrations",
|
|
502
|
+
organizationLoginMethods: "Login methods"
|
|
496
503
|
};
|
|
497
504
|
var TAB_DESCRIPTIONS = {
|
|
498
505
|
profile: "Your name, photo, language and personalisation",
|
|
@@ -507,7 +514,8 @@ var TAB_DESCRIPTIONS = {
|
|
|
507
514
|
billing: "Workspace plan, credits, invoices and usage history",
|
|
508
515
|
apikey: "Create and revoke keys for calling the Streamoid APIs",
|
|
509
516
|
connectedApps: "Apps like ChatGPT and Codex that you've allowed to use CXO for you",
|
|
510
|
-
organizationIntegrations: "Turn ChatGPT and Codex on for the organization, and revoke any member's connection"
|
|
517
|
+
organizationIntegrations: "Turn ChatGPT and Codex on for the organization, and revoke any member's connection",
|
|
518
|
+
organizationLoginMethods: "Choose whether people sign in with an email code, company SSO, or either"
|
|
511
519
|
};
|
|
512
520
|
function resolveSettingsTabFromPath(path) {
|
|
513
521
|
const segments = path.split("/").filter(Boolean);
|
|
@@ -545,6 +553,7 @@ function AdministrationOverview({
|
|
|
545
553
|
isWorkspaceAdmin,
|
|
546
554
|
showConnectedApps,
|
|
547
555
|
showIntegrations,
|
|
556
|
+
showLoginMethods = false,
|
|
548
557
|
showReferral = false,
|
|
549
558
|
canInvite,
|
|
550
559
|
onNavigate,
|
|
@@ -563,7 +572,7 @@ function AdministrationOverview({
|
|
|
563
572
|
{
|
|
564
573
|
title: "Organization",
|
|
565
574
|
scopeName: hasOrganization ? organizationName : null,
|
|
566
|
-
tabs: ["organizationList", ...hasOrganization ? ["organization", "organizationWorkspaces"] : [], ...showIntegrations ? ["organizationIntegrations"] : []]
|
|
575
|
+
tabs: ["organizationList", ...hasOrganization ? ["organization", "organizationWorkspaces"] : [], ...showIntegrations ? ["organizationIntegrations"] : [], ...showLoginMethods ? ["organizationLoginMethods"] : []]
|
|
567
576
|
}
|
|
568
577
|
];
|
|
569
578
|
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: [
|
|
@@ -767,11 +776,11 @@ function useWorkspaceOrganization({
|
|
|
767
776
|
}
|
|
768
777
|
|
|
769
778
|
// src/settings-content.tsx
|
|
770
|
-
var
|
|
771
|
-
var import_ui21 = require("@streamoid/ui");
|
|
779
|
+
var import_react28 = require("react");
|
|
772
780
|
var import_ui22 = require("@streamoid/ui");
|
|
773
781
|
var import_ui23 = require("@streamoid/ui");
|
|
774
782
|
var import_ui24 = require("@streamoid/ui");
|
|
783
|
+
var import_ui25 = require("@streamoid/ui");
|
|
775
784
|
var import_icons18 = require("@streamoid/icons");
|
|
776
785
|
|
|
777
786
|
// src/icons/SiconKey.tsx
|
|
@@ -14966,8 +14975,275 @@ function OrganizationIntegrationsContent() {
|
|
|
14966
14975
|
] });
|
|
14967
14976
|
}
|
|
14968
14977
|
|
|
14969
|
-
// src/
|
|
14978
|
+
// src/organization-login-methods-content.tsx
|
|
14979
|
+
var import_react27 = require("react");
|
|
14980
|
+
var import_ui21 = require("@streamoid/ui");
|
|
14970
14981
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
14982
|
+
var AT_LEAST_ONE_HINT = "At least one login method must stay on, or nobody can sign in.";
|
|
14983
|
+
var NO_SSO_HINT = "Company SSO isn't set up for your organization. Contact Streamoid to set it up.";
|
|
14984
|
+
var SELF_GUARD_HINT = "Sign in once with company SSO before turning email codes off.";
|
|
14985
|
+
var SESSION_NOTE = "People already signed in stay signed in until their session ends (up to 7 days).";
|
|
14986
|
+
function ssoLabel(displayName) {
|
|
14987
|
+
const name = displayName.trim();
|
|
14988
|
+
return /\bSSO\b/i.test(name) ? name : `${name} SSO`;
|
|
14989
|
+
}
|
|
14990
|
+
function loginMethodsSwitchState(data) {
|
|
14991
|
+
const hasConnection = !!data.connection;
|
|
14992
|
+
let emailHint = null;
|
|
14993
|
+
if (data.emailCode) {
|
|
14994
|
+
if (!hasConnection) emailHint = null;
|
|
14995
|
+
else if (!data.sso) emailHint = AT_LEAST_ONE_HINT;
|
|
14996
|
+
else if (data.constraints.selfLockoutGuard) emailHint = SELF_GUARD_HINT;
|
|
14997
|
+
}
|
|
14998
|
+
const emailLocked = data.emailCode && (!data.constraints.canDisableEmailCode || data.constraints.selfLockoutGuard);
|
|
14999
|
+
let ssoHint = null;
|
|
15000
|
+
if (!hasConnection) ssoHint = NO_SSO_HINT;
|
|
15001
|
+
else if (data.sso && !data.emailCode) ssoHint = AT_LEAST_ONE_HINT;
|
|
15002
|
+
const ssoLocked = !hasConnection || data.sso && !data.emailCode;
|
|
15003
|
+
return {
|
|
15004
|
+
emailCode: { checked: data.emailCode, disabled: emailLocked, hint: emailHint },
|
|
15005
|
+
sso: { checked: data.sso, disabled: ssoLocked, hint: ssoHint }
|
|
15006
|
+
};
|
|
15007
|
+
}
|
|
15008
|
+
var domainsLabel = (domains) => domains.length ? domains.map((d) => `@${d}`).join(" or ") : "your organization's";
|
|
15009
|
+
var memberCsv = (members) => toCsv([["Name", "Email", "Role"], ...members.map((m) => [m.name ?? "", m.email, m.role])]);
|
|
15010
|
+
function SwitchRow({
|
|
15011
|
+
title,
|
|
15012
|
+
description,
|
|
15013
|
+
state,
|
|
15014
|
+
busy,
|
|
15015
|
+
onToggle
|
|
15016
|
+
}) {
|
|
15017
|
+
const disabled = state.disabled || busy;
|
|
15018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-start w-full", style: { gap: T15.spXl }, children: [
|
|
15019
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col flex-1 min-w-0", style: { gap: T15.spXs }, children: [
|
|
15020
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { style: { fontFamily: T15.font, fontSize: T15.fsMd, fontWeight: 600, lineHeight: T15.lhMd, color: T15.primary }, children: title }),
|
|
15021
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Muted, { children: description }),
|
|
15022
|
+
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 })
|
|
15023
|
+
] }),
|
|
15024
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center shrink-0", style: { alignSelf: "center", gap: T15.spMd, minHeight: 26 }, children: [
|
|
15025
|
+
/* @__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" }),
|
|
15026
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { style: { display: "inline-flex", width: 41, height: 25, alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
15027
|
+
import_ui21.ScToggleSwitch,
|
|
15028
|
+
{
|
|
15029
|
+
checked: state.checked,
|
|
15030
|
+
disabled,
|
|
15031
|
+
onToggle,
|
|
15032
|
+
role: "switch",
|
|
15033
|
+
"aria-checked": state.checked,
|
|
15034
|
+
"aria-disabled": disabled,
|
|
15035
|
+
"aria-label": title,
|
|
15036
|
+
tabIndex: 0,
|
|
15037
|
+
onKeyDown: (event) => {
|
|
15038
|
+
if ((event.key === " " || event.key === "Enter") && !disabled) {
|
|
15039
|
+
event.preventDefault();
|
|
15040
|
+
onToggle(!state.checked);
|
|
15041
|
+
}
|
|
15042
|
+
}
|
|
15043
|
+
}
|
|
15044
|
+
) })
|
|
15045
|
+
] })
|
|
15046
|
+
] });
|
|
15047
|
+
}
|
|
15048
|
+
function MemberList({ members }) {
|
|
15049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
15050
|
+
"ul",
|
|
15051
|
+
{
|
|
15052
|
+
"aria-label": "Not signed in with SSO yet",
|
|
15053
|
+
className: "flex flex-col w-full",
|
|
15054
|
+
style: { maxHeight: 240, overflowY: "auto", border: `1px solid ${T15.borderSubtle}`, borderRadius: T15.rXl },
|
|
15055
|
+
children: members.map((m) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
15056
|
+
"li",
|
|
15057
|
+
{
|
|
15058
|
+
className: "flex items-center w-full",
|
|
15059
|
+
style: { gap: T15.spMd, padding: `${T15.spMd} ${T15.spXl}`, borderBottom: `1px solid ${T15.borderSubtle}` },
|
|
15060
|
+
children: [
|
|
15061
|
+
/* @__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 }),
|
|
15062
|
+
/* @__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 }),
|
|
15063
|
+
/* @__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 })
|
|
15064
|
+
]
|
|
15065
|
+
},
|
|
15066
|
+
m.userId
|
|
15067
|
+
))
|
|
15068
|
+
}
|
|
15069
|
+
);
|
|
15070
|
+
}
|
|
15071
|
+
var card = {
|
|
15072
|
+
gap: T15.spXl,
|
|
15073
|
+
padding: T15.sp3xl,
|
|
15074
|
+
backgroundColor: T15.surfaceBase,
|
|
15075
|
+
border: `1px solid ${T15.borderSubtle}`,
|
|
15076
|
+
borderRadius: T15.r3xl
|
|
15077
|
+
};
|
|
15078
|
+
function OrganizationLoginMethodsContent() {
|
|
15079
|
+
const { loginMethods, organization, toast } = useSettingsAdapters();
|
|
15080
|
+
const current = organization.current;
|
|
15081
|
+
const orgId = current?.id ?? null;
|
|
15082
|
+
const canLoad = !!loginMethods && !!orgId && current?.role === "admin";
|
|
15083
|
+
const data = useLoad(
|
|
15084
|
+
canLoad ? orgId : null,
|
|
15085
|
+
(signal) => loginMethods.get(orgId, signal),
|
|
15086
|
+
"Couldn't load this organization's login methods."
|
|
15087
|
+
);
|
|
15088
|
+
const [saving, setSaving] = (0, import_react27.useState)(false);
|
|
15089
|
+
const [confirmEmailOff, setConfirmEmailOff] = (0, import_react27.useState)(false);
|
|
15090
|
+
if (!canLoad) {
|
|
15091
|
+
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." }) });
|
|
15092
|
+
}
|
|
15093
|
+
const value = data.value;
|
|
15094
|
+
const state = value ? loginMethodsSwitchState(value) : null;
|
|
15095
|
+
const sso = ssoLabel(value?.connection?.displayName ?? "company");
|
|
15096
|
+
const domains = domainsLabel(value?.coveredDomains ?? []);
|
|
15097
|
+
const notYet = value?.readiness?.notYet ?? [];
|
|
15098
|
+
async function save(next) {
|
|
15099
|
+
if (saving || !value) return;
|
|
15100
|
+
setSaving(true);
|
|
15101
|
+
try {
|
|
15102
|
+
const result = await loginMethods.update(orgId, next);
|
|
15103
|
+
data.setValue(result);
|
|
15104
|
+
toast.success("Login methods updated. Changes apply within a minute.");
|
|
15105
|
+
setConfirmEmailOff(false);
|
|
15106
|
+
} catch (cause) {
|
|
15107
|
+
toast.error(errorMessage(cause, { method: "PUT" }));
|
|
15108
|
+
} finally {
|
|
15109
|
+
setSaving(false);
|
|
15110
|
+
}
|
|
15111
|
+
}
|
|
15112
|
+
async function copyEmails() {
|
|
15113
|
+
try {
|
|
15114
|
+
await navigator.clipboard.writeText(notYet.map((m) => m.email).join("\n"));
|
|
15115
|
+
toast.success(`Copied ${notYet.length} email ${notYet.length === 1 ? "address" : "addresses"}`);
|
|
15116
|
+
} catch {
|
|
15117
|
+
toast.error("Couldn't copy to the clipboard.");
|
|
15118
|
+
}
|
|
15119
|
+
}
|
|
15120
|
+
function downloadCsv() {
|
|
15121
|
+
const blob = new Blob([memberCsv(notYet)], { type: "text/csv;charset=utf-8;" });
|
|
15122
|
+
const url = URL.createObjectURL(blob);
|
|
15123
|
+
const link = document.createElement("a");
|
|
15124
|
+
link.href = url;
|
|
15125
|
+
link.download = `not-signed-in-with-sso-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`;
|
|
15126
|
+
link.click();
|
|
15127
|
+
URL.revokeObjectURL(url);
|
|
15128
|
+
}
|
|
15129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
15130
|
+
"div",
|
|
15131
|
+
{
|
|
15132
|
+
className: "flex flex-col flex-1 min-w-0 min-h-0 h-full overflow-y-auto",
|
|
15133
|
+
style: { gap: T15.sp3xl, paddingBottom: T15.sp6xl },
|
|
15134
|
+
children: [
|
|
15135
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ScopeHeader, { kind: "organization", name: current?.name, imageUrl: current?.imageUrl, role: current?.role }),
|
|
15136
|
+
data.error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LoadError, { message: data.error, onRetry: data.retry }),
|
|
15137
|
+
!value && !data.error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Spinner, {}),
|
|
15138
|
+
value && state && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
15139
|
+
value.failOpen && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { role: "alert", className: "flex flex-col w-full", style: { ...card, gap: T15.spXs }, children: [
|
|
15140
|
+
/* @__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." }),
|
|
15141
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Muted, { children: "Your organization is set to company SSO only. Contact Streamoid to fix the SSO connection." })
|
|
15142
|
+
] }),
|
|
15143
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("section", { "aria-label": "Login methods", className: "flex flex-col w-full shrink-0", style: card, children: [
|
|
15144
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
15145
|
+
SwitchRow,
|
|
15146
|
+
{
|
|
15147
|
+
title: "Email code",
|
|
15148
|
+
description: `Anyone with an ${domains} address gets a one-time code by email. Google and Microsoft sign-in follow this switch.`,
|
|
15149
|
+
state: state.emailCode,
|
|
15150
|
+
busy: saving,
|
|
15151
|
+
onToggle: (next) => next ? save({ emailCode: true, sso: value.sso }) : setConfirmEmailOff(true)
|
|
15152
|
+
}
|
|
15153
|
+
),
|
|
15154
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { style: { borderTop: `1px solid ${T15.borderSubtle}` } }),
|
|
15155
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
15156
|
+
SwitchRow,
|
|
15157
|
+
{
|
|
15158
|
+
title: "Company SSO",
|
|
15159
|
+
description: `People your IT team has given access sign in through ${sso}.`,
|
|
15160
|
+
state: state.sso,
|
|
15161
|
+
busy: saving,
|
|
15162
|
+
onToggle: (next) => save({ emailCode: value.emailCode, sso: next })
|
|
15163
|
+
}
|
|
15164
|
+
)
|
|
15165
|
+
] }),
|
|
15166
|
+
value.readiness && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("section", { "aria-label": "SSO readiness", className: "flex flex-col w-full shrink-0", style: card, children: [
|
|
15167
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { style: { fontFamily: T15.font, fontSize: T15.fsMd, fontWeight: 600, lineHeight: T15.lhMd, color: T15.primary }, children: [
|
|
15168
|
+
value.readiness.signedInWithSso,
|
|
15169
|
+
" of ",
|
|
15170
|
+
value.readiness.affectedTotal,
|
|
15171
|
+
" ",
|
|
15172
|
+
value.readiness.affectedTotal === 1 ? "person" : "people",
|
|
15173
|
+
" at ",
|
|
15174
|
+
domains,
|
|
15175
|
+
" have signed in with SSO.",
|
|
15176
|
+
notYet.length > 0 ? ` ${notYet.length} haven't yet.` : ""
|
|
15177
|
+
] }),
|
|
15178
|
+
notYet.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
15179
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Muted, { children: [
|
|
15180
|
+
"Send this list to your IT team to give them access to ",
|
|
15181
|
+
sso,
|
|
15182
|
+
". When it's empty, it's safe to turn email codes off."
|
|
15183
|
+
] }),
|
|
15184
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MemberList, { members: notYet }),
|
|
15185
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center", style: { gap: T15.spMd }, children: [
|
|
15186
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui21.ScButton, { text: "Copy emails", variant: "outline", size: "sm", onClick: copyEmails }),
|
|
15187
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui21.ScButton, { text: "Download CSV", variant: "outline", size: "sm", onClick: downloadCsv })
|
|
15188
|
+
] })
|
|
15189
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Muted, { children: "Everyone has signed in with SSO at least once." }),
|
|
15190
|
+
value.readiness.notAffected > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Muted, { children: [
|
|
15191
|
+
value.readiness.notAffected,
|
|
15192
|
+
" ",
|
|
15193
|
+
value.readiness.notAffected === 1 ? "member uses" : "members use",
|
|
15194
|
+
" an address on another domain and ",
|
|
15195
|
+
value.readiness.notAffected === 1 ? "isn't" : "aren't",
|
|
15196
|
+
" affected by these switches."
|
|
15197
|
+
] })
|
|
15198
|
+
] }),
|
|
15199
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col", style: { gap: T15.spXs }, children: [
|
|
15200
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Muted, { children: [
|
|
15201
|
+
"Changes apply within a minute. ",
|
|
15202
|
+
SESSION_NOTE
|
|
15203
|
+
] }),
|
|
15204
|
+
/* @__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." })
|
|
15205
|
+
] }),
|
|
15206
|
+
confirmEmailOff && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
15207
|
+
ConfirmActionModal,
|
|
15208
|
+
{
|
|
15209
|
+
title: "Turn off email codes?",
|
|
15210
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col", style: { gap: T15.spMd }, children: [
|
|
15211
|
+
notYet.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
15212
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
|
|
15213
|
+
"These ",
|
|
15214
|
+
notYet.length,
|
|
15215
|
+
" ",
|
|
15216
|
+
notYet.length === 1 ? "person has" : "people have",
|
|
15217
|
+
" never signed in with",
|
|
15218
|
+
" ",
|
|
15219
|
+
sso,
|
|
15220
|
+
" and will be locked out until IT gives them access:"
|
|
15221
|
+
] }),
|
|
15222
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MemberList, { members: notYet }),
|
|
15223
|
+
/* @__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 }) })
|
|
15224
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
|
|
15225
|
+
"Everyone at ",
|
|
15226
|
+
domains,
|
|
15227
|
+
" will have to sign in with ",
|
|
15228
|
+
sso,
|
|
15229
|
+
". Google and Microsoft sign-in turn off too."
|
|
15230
|
+
] }),
|
|
15231
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: SESSION_NOTE })
|
|
15232
|
+
] }),
|
|
15233
|
+
confirmText: "Turn off email codes",
|
|
15234
|
+
busyText: "Turning off\u2026",
|
|
15235
|
+
onClose: () => setConfirmEmailOff(false),
|
|
15236
|
+
onConfirm: () => save({ emailCode: false, sso: value.sso })
|
|
15237
|
+
}
|
|
15238
|
+
)
|
|
15239
|
+
] })
|
|
15240
|
+
]
|
|
15241
|
+
}
|
|
15242
|
+
);
|
|
15243
|
+
}
|
|
15244
|
+
|
|
15245
|
+
// src/settings-content.tsx
|
|
15246
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
14971
15247
|
function deriveInitials(name) {
|
|
14972
15248
|
return name.split(/\s+/).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("") || "WS";
|
|
14973
15249
|
}
|
|
@@ -15003,8 +15279,8 @@ function SettingsNavItem({
|
|
|
15003
15279
|
onTabChange
|
|
15004
15280
|
}) {
|
|
15005
15281
|
const isActive = activeTab === tab;
|
|
15006
|
-
return /* @__PURE__ */ (0,
|
|
15007
|
-
|
|
15282
|
+
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)(
|
|
15283
|
+
import_ui22.ScSidebarMenu,
|
|
15008
15284
|
{
|
|
15009
15285
|
icon: icon(isActive ? PRIMARY_COLOR3 : MUTED_COLOR2),
|
|
15010
15286
|
text: label,
|
|
@@ -15033,9 +15309,10 @@ function SettingsNav({
|
|
|
15033
15309
|
isWorkspaceAdmin,
|
|
15034
15310
|
showConnectedApps = false,
|
|
15035
15311
|
showIntegrations = false,
|
|
15312
|
+
showLoginMethods = false,
|
|
15036
15313
|
showReferral = false
|
|
15037
15314
|
}) {
|
|
15038
|
-
const item = (tab, icon) => /* @__PURE__ */ (0,
|
|
15315
|
+
const item = (tab, icon) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15039
15316
|
SettingsNavItem,
|
|
15040
15317
|
{
|
|
15041
15318
|
tab,
|
|
@@ -15045,7 +15322,7 @@ function SettingsNav({
|
|
|
15045
15322
|
onTabChange
|
|
15046
15323
|
}
|
|
15047
15324
|
);
|
|
15048
|
-
return /* @__PURE__ */ (0,
|
|
15325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15049
15326
|
"div",
|
|
15050
15327
|
{
|
|
15051
15328
|
className: "flex flex-col items-start shrink-0 relative overflow-y-auto",
|
|
@@ -15068,43 +15345,44 @@ function SettingsNav({
|
|
|
15068
15345
|
gap: "var(--spacing-5xl)"
|
|
15069
15346
|
},
|
|
15070
15347
|
children: [
|
|
15071
|
-
/* @__PURE__ */ (0,
|
|
15072
|
-
/* @__PURE__ */ (0,
|
|
15073
|
-
item("profile", (color) => /* @__PURE__ */ (0,
|
|
15074
|
-
item("workspaceList", (color) => /* @__PURE__ */ (0,
|
|
15075
|
-
showConnectedApps && item("connectedApps", (color) => /* @__PURE__ */ (0,
|
|
15076
|
-
showReferral && item("referral", (color) => /* @__PURE__ */ (0,
|
|
15348
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col w-full", style: { gap: "var(--spacing-md)" }, children: [
|
|
15349
|
+
/* @__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" }),
|
|
15350
|
+
item("profile", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconUser, { className: "w-5 h-5", color })),
|
|
15351
|
+
item("workspaceList", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconSwitch, { className: "w-5 h-5", color })),
|
|
15352
|
+
showConnectedApps && item("connectedApps", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SiconPlug_default, { className: "w-5 h-5", color })),
|
|
15353
|
+
showReferral && item("referral", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconReferral, { className: "w-5 h-5", color }))
|
|
15077
15354
|
] }),
|
|
15078
|
-
/* @__PURE__ */ (0,
|
|
15079
|
-
/* @__PURE__ */ (0,
|
|
15080
|
-
/* @__PURE__ */ (0,
|
|
15081
|
-
item("workspace", (color) => /* @__PURE__ */ (0,
|
|
15082
|
-
item("workspaceMembers", (color) => /* @__PURE__ */ (0,
|
|
15083
|
-
isWorkspaceAdmin && /* @__PURE__ */ (0,
|
|
15084
|
-
item("billing", (color) => /* @__PURE__ */ (0,
|
|
15085
|
-
item("apikey", (color) => /* @__PURE__ */ (0,
|
|
15355
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui22.ScHDivider, {}),
|
|
15356
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col w-full", style: { gap: "var(--spacing-md)" }, children: [
|
|
15357
|
+
/* @__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" }),
|
|
15358
|
+
item("workspace", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconSettings, { className: "w-5 h-5", color })),
|
|
15359
|
+
item("workspaceMembers", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconTeam, { className: "w-5 h-5", color })),
|
|
15360
|
+
isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
15361
|
+
item("billing", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconBilling, { className: "w-5 h-5", color })),
|
|
15362
|
+
item("apikey", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SiconKey_default, { className: "w-5 h-5", color }))
|
|
15086
15363
|
] }),
|
|
15087
|
-
!isWorkspaceAdmin && /* @__PURE__ */ (0,
|
|
15364
|
+
!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." })
|
|
15088
15365
|
] }),
|
|
15089
|
-
/* @__PURE__ */ (0,
|
|
15090
|
-
/* @__PURE__ */ (0,
|
|
15091
|
-
/* @__PURE__ */ (0,
|
|
15092
|
-
item("organizationList", (color) => /* @__PURE__ */ (0,
|
|
15093
|
-
item("organization", (color) => /* @__PURE__ */ (0,
|
|
15094
|
-
item("organizationWorkspaces", (color) => /* @__PURE__ */ (0,
|
|
15095
|
-
showIntegrations && item("organizationIntegrations", (color) => /* @__PURE__ */ (0,
|
|
15096
|
-
|
|
15097
|
-
|
|
15366
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui22.ScHDivider, {}),
|
|
15367
|
+
/* @__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: [
|
|
15368
|
+
/* @__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" }),
|
|
15369
|
+
item("organizationList", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconSwitch, { className: "w-5 h-5", color })),
|
|
15370
|
+
item("organization", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconTeam, { className: "w-5 h-5", color })),
|
|
15371
|
+
item("organizationWorkspaces", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconWorkspace, { className: "w-5 h-5", color })),
|
|
15372
|
+
showIntegrations && item("organizationIntegrations", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SiconPlug_default, { className: "w-5 h-5", color })),
|
|
15373
|
+
showLoginMethods && item("organizationLoginMethods", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconLock, { className: "w-5 h-5", color }))
|
|
15374
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
15375
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15098
15376
|
SettingsNavItem,
|
|
15099
15377
|
{
|
|
15100
15378
|
tab: "organization",
|
|
15101
15379
|
label: "Organization",
|
|
15102
|
-
icon: (color) => /* @__PURE__ */ (0,
|
|
15380
|
+
icon: (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconGlobe, { className: "w-5 h-5", color }),
|
|
15103
15381
|
activeTab,
|
|
15104
15382
|
onTabChange
|
|
15105
15383
|
}
|
|
15106
15384
|
),
|
|
15107
|
-
item("organizationList", (color) => /* @__PURE__ */ (0,
|
|
15385
|
+
item("organizationList", (color) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconSwitch, { className: "w-5 h-5", color }))
|
|
15108
15386
|
] }) })
|
|
15109
15387
|
]
|
|
15110
15388
|
}
|
|
@@ -15113,7 +15391,7 @@ function SettingsNav({
|
|
|
15113
15391
|
var SPECIALIZATION_ICON_SIZE = 24;
|
|
15114
15392
|
function SpecializationIcon({ iconUrl }) {
|
|
15115
15393
|
if (iconUrl) {
|
|
15116
|
-
return /* @__PURE__ */ (0,
|
|
15394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15117
15395
|
"img",
|
|
15118
15396
|
{
|
|
15119
15397
|
src: iconUrl,
|
|
@@ -15126,7 +15404,7 @@ function SpecializationIcon({ iconUrl }) {
|
|
|
15126
15404
|
}
|
|
15127
15405
|
);
|
|
15128
15406
|
}
|
|
15129
|
-
return /* @__PURE__ */ (0,
|
|
15407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15130
15408
|
import_icons18.SiconBolt,
|
|
15131
15409
|
{
|
|
15132
15410
|
style: {
|
|
@@ -15158,10 +15436,10 @@ function SpecializationDropdown({
|
|
|
15158
15436
|
disabled
|
|
15159
15437
|
}) {
|
|
15160
15438
|
const { auth } = useSettingsAdapters();
|
|
15161
|
-
const [open, setOpen] = (0,
|
|
15162
|
-
const containerRef = (0,
|
|
15163
|
-
const [options, setOptions] = (0,
|
|
15164
|
-
(0,
|
|
15439
|
+
const [open, setOpen] = (0, import_react28.useState)(false);
|
|
15440
|
+
const containerRef = (0, import_react28.useRef)(null);
|
|
15441
|
+
const [options, setOptions] = (0, import_react28.useState)([]);
|
|
15442
|
+
(0, import_react28.useEffect)(() => {
|
|
15165
15443
|
if (!auth.getSpecializations) return;
|
|
15166
15444
|
let cancelled = false;
|
|
15167
15445
|
auth.getSpecializations().then((items) => {
|
|
@@ -15181,7 +15459,7 @@ function SpecializationDropdown({
|
|
|
15181
15459
|
cancelled = true;
|
|
15182
15460
|
};
|
|
15183
15461
|
}, [auth]);
|
|
15184
|
-
(0,
|
|
15462
|
+
(0, import_react28.useEffect)(() => {
|
|
15185
15463
|
if (!open) return;
|
|
15186
15464
|
function handleMouseDown(e) {
|
|
15187
15465
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -15199,15 +15477,15 @@ function SpecializationDropdown({
|
|
|
15199
15477
|
};
|
|
15200
15478
|
}, [open]);
|
|
15201
15479
|
const selected = options.find((o) => o.id === value);
|
|
15202
|
-
return /* @__PURE__ */ (0,
|
|
15480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15203
15481
|
"div",
|
|
15204
15482
|
{
|
|
15205
15483
|
ref: containerRef,
|
|
15206
15484
|
className: "w-full",
|
|
15207
15485
|
style: { position: "relative" },
|
|
15208
15486
|
children: [
|
|
15209
|
-
/* @__PURE__ */ (0,
|
|
15210
|
-
/* @__PURE__ */ (0,
|
|
15487
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("style", { children: DROPDOWN_TRIGGER_STYLES }),
|
|
15488
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15211
15489
|
"div",
|
|
15212
15490
|
{
|
|
15213
15491
|
className: "spec-dropdown-trigger",
|
|
@@ -15215,16 +15493,16 @@ function SpecializationDropdown({
|
|
|
15215
15493
|
onClick: () => !disabled && setOpen((v) => !v),
|
|
15216
15494
|
"aria-haspopup": "listbox",
|
|
15217
15495
|
"aria-expanded": open,
|
|
15218
|
-
children: /* @__PURE__ */ (0,
|
|
15219
|
-
|
|
15496
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15497
|
+
import_ui23.ScTextField,
|
|
15220
15498
|
{
|
|
15221
15499
|
label: "Specialization",
|
|
15222
15500
|
labelGroup: "label",
|
|
15223
15501
|
value: selected?.label ?? "",
|
|
15224
15502
|
placeholderFilled: "Select specialization",
|
|
15225
15503
|
tfGroup: "icon-left-right",
|
|
15226
|
-
tfLeftIcon: /* @__PURE__ */ (0,
|
|
15227
|
-
tfRightIcon: /* @__PURE__ */ (0,
|
|
15504
|
+
tfLeftIcon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SpecializationIcon, { iconUrl: selected?.iconUrl }),
|
|
15505
|
+
tfRightIcon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15228
15506
|
"span",
|
|
15229
15507
|
{
|
|
15230
15508
|
style: {
|
|
@@ -15234,7 +15512,7 @@ function SpecializationDropdown({
|
|
|
15234
15512
|
transform: open ? "rotate(180deg)" : "none",
|
|
15235
15513
|
transition: "transform 120ms ease-out"
|
|
15236
15514
|
},
|
|
15237
|
-
children: /* @__PURE__ */ (0,
|
|
15515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconDown, {})
|
|
15238
15516
|
}
|
|
15239
15517
|
),
|
|
15240
15518
|
className: "sc-text-field-full-width",
|
|
@@ -15245,7 +15523,7 @@ function SpecializationDropdown({
|
|
|
15245
15523
|
)
|
|
15246
15524
|
}
|
|
15247
15525
|
),
|
|
15248
|
-
open && /* @__PURE__ */ (0,
|
|
15526
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15249
15527
|
"div",
|
|
15250
15528
|
{
|
|
15251
15529
|
role: "listbox",
|
|
@@ -15267,11 +15545,11 @@ function SpecializationDropdown({
|
|
|
15267
15545
|
},
|
|
15268
15546
|
children: options.map((opt) => {
|
|
15269
15547
|
const isActive = opt.id === value;
|
|
15270
|
-
return /* @__PURE__ */ (0,
|
|
15271
|
-
|
|
15548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15549
|
+
import_ui22.ScMenuOptions,
|
|
15272
15550
|
{
|
|
15273
15551
|
text: opt.label,
|
|
15274
|
-
icon: /* @__PURE__ */ (0,
|
|
15552
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SpecializationIcon, { iconUrl: opt.iconUrl }),
|
|
15275
15553
|
hover: isActive ? "true" : "false",
|
|
15276
15554
|
variant: "default",
|
|
15277
15555
|
role: "option",
|
|
@@ -15296,9 +15574,9 @@ function LanguageDropdown({
|
|
|
15296
15574
|
onChange,
|
|
15297
15575
|
disabled
|
|
15298
15576
|
}) {
|
|
15299
|
-
const [open, setOpen] = (0,
|
|
15300
|
-
const containerRef = (0,
|
|
15301
|
-
(0,
|
|
15577
|
+
const [open, setOpen] = (0, import_react28.useState)(false);
|
|
15578
|
+
const containerRef = (0, import_react28.useRef)(null);
|
|
15579
|
+
(0, import_react28.useEffect)(() => {
|
|
15302
15580
|
if (!open) return;
|
|
15303
15581
|
function handleMouseDown(e) {
|
|
15304
15582
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -15315,15 +15593,15 @@ function LanguageDropdown({
|
|
|
15315
15593
|
document.removeEventListener("keydown", handleKeyDown);
|
|
15316
15594
|
};
|
|
15317
15595
|
}, [open]);
|
|
15318
|
-
return /* @__PURE__ */ (0,
|
|
15596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15319
15597
|
"div",
|
|
15320
15598
|
{
|
|
15321
15599
|
ref: containerRef,
|
|
15322
15600
|
className: "w-full",
|
|
15323
15601
|
style: { position: "relative" },
|
|
15324
15602
|
children: [
|
|
15325
|
-
/* @__PURE__ */ (0,
|
|
15326
|
-
/* @__PURE__ */ (0,
|
|
15603
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("style", { children: DROPDOWN_TRIGGER_STYLES }),
|
|
15604
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15327
15605
|
"div",
|
|
15328
15606
|
{
|
|
15329
15607
|
className: "spec-dropdown-trigger",
|
|
@@ -15331,15 +15609,15 @@ function LanguageDropdown({
|
|
|
15331
15609
|
onClick: () => !disabled && setOpen((v) => !v),
|
|
15332
15610
|
"aria-haspopup": "listbox",
|
|
15333
15611
|
"aria-expanded": open,
|
|
15334
|
-
children: /* @__PURE__ */ (0,
|
|
15335
|
-
|
|
15612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15613
|
+
import_ui23.ScTextField,
|
|
15336
15614
|
{
|
|
15337
15615
|
label: "Language",
|
|
15338
15616
|
labelGroup: "label",
|
|
15339
15617
|
value: userLanguageLabel(value),
|
|
15340
15618
|
placeholderFilled: "Select language",
|
|
15341
15619
|
tfGroup: "icon-right",
|
|
15342
|
-
tfRightIcon: /* @__PURE__ */ (0,
|
|
15620
|
+
tfRightIcon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15343
15621
|
"span",
|
|
15344
15622
|
{
|
|
15345
15623
|
style: {
|
|
@@ -15349,7 +15627,7 @@ function LanguageDropdown({
|
|
|
15349
15627
|
transform: open ? "rotate(180deg)" : "none",
|
|
15350
15628
|
transition: "transform 120ms ease-out"
|
|
15351
15629
|
},
|
|
15352
|
-
children: /* @__PURE__ */ (0,
|
|
15630
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconDown, {})
|
|
15353
15631
|
}
|
|
15354
15632
|
),
|
|
15355
15633
|
className: "sc-text-field-full-width",
|
|
@@ -15360,7 +15638,7 @@ function LanguageDropdown({
|
|
|
15360
15638
|
)
|
|
15361
15639
|
}
|
|
15362
15640
|
),
|
|
15363
|
-
open && /* @__PURE__ */ (0,
|
|
15641
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15364
15642
|
"div",
|
|
15365
15643
|
{
|
|
15366
15644
|
role: "listbox",
|
|
@@ -15386,11 +15664,11 @@ function LanguageDropdown({
|
|
|
15386
15664
|
},
|
|
15387
15665
|
children: USER_LANGUAGES.map((lang) => {
|
|
15388
15666
|
const isActive = lang.code === value;
|
|
15389
|
-
return /* @__PURE__ */ (0,
|
|
15390
|
-
|
|
15667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15668
|
+
import_ui22.ScMenuOptions,
|
|
15391
15669
|
{
|
|
15392
15670
|
text: lang.label,
|
|
15393
|
-
icon: /* @__PURE__ */ (0,
|
|
15671
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, {}),
|
|
15394
15672
|
hover: isActive ? "true" : "false",
|
|
15395
15673
|
variant: "default",
|
|
15396
15674
|
role: "option",
|
|
@@ -15416,28 +15694,28 @@ function ProfileTab() {
|
|
|
15416
15694
|
const derivedName = user?.name ?? "";
|
|
15417
15695
|
const derivedSpec = user?.userSpecialization ?? "";
|
|
15418
15696
|
const derivedLanguage = user?.language?.trim() || DEFAULT_USER_LANGUAGE;
|
|
15419
|
-
const [fullName, setFullName] = (0,
|
|
15420
|
-
const [selectedSpec, setSelectedSpec] = (0,
|
|
15421
|
-
const [selectedLanguage, setSelectedLanguage] = (0,
|
|
15422
|
-
const [saving, setSaving] = (0,
|
|
15423
|
-
const [imageSaving, setImageSaving] = (0,
|
|
15424
|
-
const [imagePreview, setImagePreview] = (0,
|
|
15697
|
+
const [fullName, setFullName] = (0, import_react28.useState)(derivedName);
|
|
15698
|
+
const [selectedSpec, setSelectedSpec] = (0, import_react28.useState)(derivedSpec);
|
|
15699
|
+
const [selectedLanguage, setSelectedLanguage] = (0, import_react28.useState)(derivedLanguage);
|
|
15700
|
+
const [saving, setSaving] = (0, import_react28.useState)(false);
|
|
15701
|
+
const [imageSaving, setImageSaving] = (0, import_react28.useState)(false);
|
|
15702
|
+
const [imagePreview, setImagePreview] = (0, import_react28.useState)(
|
|
15425
15703
|
void 0
|
|
15426
15704
|
);
|
|
15427
|
-
const fileInputRef = (0,
|
|
15705
|
+
const fileInputRef = (0, import_react28.useRef)(null);
|
|
15428
15706
|
const profileDisplayName = fullName || user?.email || "User";
|
|
15429
15707
|
const profileImage = imagePreview ?? getUserProfileImage(user);
|
|
15430
15708
|
const profileInitial = profileDisplayName.charAt(0).toUpperCase();
|
|
15431
15709
|
const disableAllActions = saving || imageSaving;
|
|
15432
15710
|
const dirty = fullName.trim() !== derivedName || selectedSpec !== derivedSpec || selectedLanguage !== derivedLanguage;
|
|
15433
|
-
(0,
|
|
15711
|
+
(0, import_react28.useEffect)(() => {
|
|
15434
15712
|
setFullName(derivedName);
|
|
15435
15713
|
setImagePreview(void 0);
|
|
15436
15714
|
}, [derivedName]);
|
|
15437
|
-
(0,
|
|
15715
|
+
(0, import_react28.useEffect)(() => {
|
|
15438
15716
|
setSelectedSpec(derivedSpec);
|
|
15439
15717
|
}, [derivedSpec]);
|
|
15440
|
-
(0,
|
|
15718
|
+
(0, import_react28.useEffect)(() => {
|
|
15441
15719
|
setSelectedLanguage(derivedLanguage);
|
|
15442
15720
|
}, [derivedLanguage]);
|
|
15443
15721
|
const handleSave = async () => {
|
|
@@ -15519,13 +15797,13 @@ function ProfileTab() {
|
|
|
15519
15797
|
}
|
|
15520
15798
|
auth.clearAuth();
|
|
15521
15799
|
};
|
|
15522
|
-
return /* @__PURE__ */ (0,
|
|
15800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15523
15801
|
"div",
|
|
15524
15802
|
{
|
|
15525
15803
|
className: "flex flex-col items-start flex-1 min-w-0 min-h-0 overflow-y-auto",
|
|
15526
15804
|
style: { gap: "var(--spacing-3xl)" },
|
|
15527
15805
|
children: [
|
|
15528
|
-
/* @__PURE__ */ (0,
|
|
15806
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15529
15807
|
"div",
|
|
15530
15808
|
{
|
|
15531
15809
|
className: "sc-profile-card flex flex-col items-start w-full",
|
|
@@ -15538,13 +15816,13 @@ function ProfileTab() {
|
|
|
15538
15816
|
gap: "var(--spacing-6xl)"
|
|
15539
15817
|
},
|
|
15540
15818
|
children: [
|
|
15541
|
-
/* @__PURE__ */ (0,
|
|
15819
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15542
15820
|
"div",
|
|
15543
15821
|
{
|
|
15544
15822
|
className: "flex items-center shrink-0 w-full",
|
|
15545
15823
|
style: { gap: 24, flexWrap: "wrap" },
|
|
15546
15824
|
children: [
|
|
15547
|
-
profileImage ? /* @__PURE__ */ (0,
|
|
15825
|
+
profileImage ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15548
15826
|
"img",
|
|
15549
15827
|
{
|
|
15550
15828
|
src: profileImage,
|
|
@@ -15557,7 +15835,7 @@ function ProfileTab() {
|
|
|
15557
15835
|
flexShrink: 0
|
|
15558
15836
|
}
|
|
15559
15837
|
}
|
|
15560
|
-
) : /* @__PURE__ */ (0,
|
|
15838
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15561
15839
|
"div",
|
|
15562
15840
|
{
|
|
15563
15841
|
"aria-label": "Profile",
|
|
@@ -15570,7 +15848,7 @@ function ProfileTab() {
|
|
|
15570
15848
|
border: "1px solid var(--alias-border-subtle)",
|
|
15571
15849
|
flexShrink: 0
|
|
15572
15850
|
},
|
|
15573
|
-
children: /* @__PURE__ */ (0,
|
|
15851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15574
15852
|
"span",
|
|
15575
15853
|
{
|
|
15576
15854
|
style: {
|
|
@@ -15585,7 +15863,7 @@ function ProfileTab() {
|
|
|
15585
15863
|
)
|
|
15586
15864
|
}
|
|
15587
15865
|
),
|
|
15588
|
-
/* @__PURE__ */ (0,
|
|
15866
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15589
15867
|
"input",
|
|
15590
15868
|
{
|
|
15591
15869
|
ref: fileInputRef,
|
|
@@ -15595,17 +15873,17 @@ function ProfileTab() {
|
|
|
15595
15873
|
onChange: handleImageChange
|
|
15596
15874
|
}
|
|
15597
15875
|
),
|
|
15598
|
-
/* @__PURE__ */ (0,
|
|
15876
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15599
15877
|
"div",
|
|
15600
15878
|
{
|
|
15601
15879
|
className: "flex items-center",
|
|
15602
15880
|
style: { gap: 12, flexWrap: "wrap" },
|
|
15603
15881
|
children: [
|
|
15604
|
-
/* @__PURE__ */ (0,
|
|
15605
|
-
|
|
15882
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15883
|
+
import_ui24.ScButton,
|
|
15606
15884
|
{
|
|
15607
15885
|
text: "Upload photo",
|
|
15608
|
-
icon: /* @__PURE__ */ (0,
|
|
15886
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconUpload, { className: "w-5 h-5", color: PRIMARY_COLOR3 }),
|
|
15609
15887
|
styleVariant: "icon-left",
|
|
15610
15888
|
variant: "outline",
|
|
15611
15889
|
size: "md",
|
|
@@ -15613,11 +15891,11 @@ function ProfileTab() {
|
|
|
15613
15891
|
onClick: handleUploadClick
|
|
15614
15892
|
}
|
|
15615
15893
|
),
|
|
15616
|
-
/* @__PURE__ */ (0,
|
|
15617
|
-
|
|
15894
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15895
|
+
import_ui24.ScButton,
|
|
15618
15896
|
{
|
|
15619
15897
|
text: "Remove photo",
|
|
15620
|
-
icon: /* @__PURE__ */ (0,
|
|
15898
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15621
15899
|
import_icons18.SiconDelete,
|
|
15622
15900
|
{
|
|
15623
15901
|
className: "w-5 h-5",
|
|
@@ -15637,16 +15915,16 @@ function ProfileTab() {
|
|
|
15637
15915
|
]
|
|
15638
15916
|
}
|
|
15639
15917
|
),
|
|
15640
|
-
/* @__PURE__ */ (0,
|
|
15641
|
-
/* @__PURE__ */ (0,
|
|
15918
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui22.ScHDivider, {}),
|
|
15919
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15642
15920
|
"div",
|
|
15643
15921
|
{
|
|
15644
15922
|
className: "sc-profile-fields flex flex-col min-w-0 w-full",
|
|
15645
15923
|
style: { gap: 24 },
|
|
15646
15924
|
children: [
|
|
15647
|
-
/* @__PURE__ */ (0,
|
|
15648
|
-
/* @__PURE__ */ (0,
|
|
15649
|
-
|
|
15925
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { style: { display: "grid", width: "100%", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 240px), 1fr))", gap: 24 }, children: [
|
|
15926
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex-1 min-w-0", style: { overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15927
|
+
import_ui23.ScTextField,
|
|
15650
15928
|
{
|
|
15651
15929
|
label: "Full Name",
|
|
15652
15930
|
labelGroup: "label",
|
|
@@ -15659,7 +15937,7 @@ function ProfileTab() {
|
|
|
15659
15937
|
onChange: (e) => setFullName(e.target.value)
|
|
15660
15938
|
}
|
|
15661
15939
|
) }),
|
|
15662
|
-
/* @__PURE__ */ (0,
|
|
15940
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15663
15941
|
SpecializationDropdown,
|
|
15664
15942
|
{
|
|
15665
15943
|
value: selectedSpec,
|
|
@@ -15668,8 +15946,8 @@ function ProfileTab() {
|
|
|
15668
15946
|
}
|
|
15669
15947
|
) })
|
|
15670
15948
|
] }),
|
|
15671
|
-
/* @__PURE__ */ (0,
|
|
15672
|
-
/* @__PURE__ */ (0,
|
|
15949
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-start w-full", style: { gap: "var(--spacing-3xl)" }, children: [
|
|
15950
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15673
15951
|
LanguageDropdown,
|
|
15674
15952
|
{
|
|
15675
15953
|
value: selectedLanguage,
|
|
@@ -15677,10 +15955,10 @@ function ProfileTab() {
|
|
|
15677
15955
|
disabled: disableAllActions
|
|
15678
15956
|
}
|
|
15679
15957
|
) }),
|
|
15680
|
-
/* @__PURE__ */ (0,
|
|
15958
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex-1 min-w-0" })
|
|
15681
15959
|
] }),
|
|
15682
|
-
/* @__PURE__ */ (0,
|
|
15683
|
-
|
|
15960
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-full", style: { overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15961
|
+
import_ui23.ScTextField,
|
|
15684
15962
|
{
|
|
15685
15963
|
label: "Email ID",
|
|
15686
15964
|
labelGroup: "label",
|
|
@@ -15688,7 +15966,7 @@ function ProfileTab() {
|
|
|
15688
15966
|
value: user?.email ?? "",
|
|
15689
15967
|
placeholderFilled: user?.email ?? "chris@kepler.com",
|
|
15690
15968
|
tfGroup: "icon-right",
|
|
15691
|
-
tfRightIcon: /* @__PURE__ */ (0,
|
|
15969
|
+
tfRightIcon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15692
15970
|
import_icons18.SiconLock,
|
|
15693
15971
|
{
|
|
15694
15972
|
className: "w-6 h-6",
|
|
@@ -15700,13 +15978,13 @@ function ProfileTab() {
|
|
|
15700
15978
|
readOnly: true
|
|
15701
15979
|
}
|
|
15702
15980
|
) }),
|
|
15703
|
-
/* @__PURE__ */ (0,
|
|
15981
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15704
15982
|
"div",
|
|
15705
15983
|
{
|
|
15706
15984
|
className: "flex items-center w-full",
|
|
15707
15985
|
style: { justifyContent: "flex-end", paddingTop: "var(--spacing-md)" },
|
|
15708
|
-
children: /* @__PURE__ */ (0,
|
|
15709
|
-
|
|
15986
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15987
|
+
import_ui24.ScButton,
|
|
15710
15988
|
{
|
|
15711
15989
|
text: saving ? "Saving..." : "Save changes",
|
|
15712
15990
|
variant: "secondary",
|
|
@@ -15723,7 +16001,7 @@ function ProfileTab() {
|
|
|
15723
16001
|
]
|
|
15724
16002
|
}
|
|
15725
16003
|
),
|
|
15726
|
-
/* @__PURE__ */ (0,
|
|
16004
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15727
16005
|
"div",
|
|
15728
16006
|
{
|
|
15729
16007
|
className: "flex items-center w-full",
|
|
@@ -15735,8 +16013,8 @@ function ProfileTab() {
|
|
|
15735
16013
|
gap: "var(--spacing-3xl)"
|
|
15736
16014
|
},
|
|
15737
16015
|
children: [
|
|
15738
|
-
/* @__PURE__ */ (0,
|
|
15739
|
-
/* @__PURE__ */ (0,
|
|
16016
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col min-w-0 flex-1", style: { gap: "var(--spacing-xs)" }, children: [
|
|
16017
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15740
16018
|
"span",
|
|
15741
16019
|
{
|
|
15742
16020
|
style: {
|
|
@@ -15749,7 +16027,7 @@ function ProfileTab() {
|
|
|
15749
16027
|
children: "Session"
|
|
15750
16028
|
}
|
|
15751
16029
|
),
|
|
15752
|
-
/* @__PURE__ */ (0,
|
|
16030
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15753
16031
|
"span",
|
|
15754
16032
|
{
|
|
15755
16033
|
className: "truncate",
|
|
@@ -15764,8 +16042,8 @@ function ProfileTab() {
|
|
|
15764
16042
|
}
|
|
15765
16043
|
)
|
|
15766
16044
|
] }),
|
|
15767
|
-
/* @__PURE__ */ (0,
|
|
15768
|
-
|
|
16045
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16046
|
+
import_ui24.ScButton,
|
|
15769
16047
|
{
|
|
15770
16048
|
text: "Log out",
|
|
15771
16049
|
variant: "outline",
|
|
@@ -15828,11 +16106,11 @@ function WorkspaceListTab({
|
|
|
15828
16106
|
const currentOrganization = organizations.find(
|
|
15829
16107
|
(org) => org._id && org._id === currentWorkspace?.organizationId
|
|
15830
16108
|
);
|
|
15831
|
-
const [page, setPage] = (0,
|
|
15832
|
-
const [serverPage, setServerPage] = (0,
|
|
15833
|
-
const [serverFailed, setServerFailed] = (0,
|
|
16109
|
+
const [page, setPage] = (0, import_react28.useState)(0);
|
|
16110
|
+
const [serverPage, setServerPage] = (0, import_react28.useState)(null);
|
|
16111
|
+
const [serverFailed, setServerFailed] = (0, import_react28.useState)(false);
|
|
15834
16112
|
const serverMode = !!listPage && !serverFailed;
|
|
15835
|
-
(0,
|
|
16113
|
+
(0, import_react28.useEffect)(() => {
|
|
15836
16114
|
if (!listPage || serverFailed) return;
|
|
15837
16115
|
let cancelled = false;
|
|
15838
16116
|
listPage({ limit: pageSize, offset: page * pageSize }).then((result) => {
|
|
@@ -15873,21 +16151,21 @@ function WorkspaceListTab({
|
|
|
15873
16151
|
const pageRows = serverMode ? (serverPage?.items ?? []).map((ws) => ({ ws, group: serverGroupOf(ws) })) : rows.slice(pageStart, pageStart + pageSize);
|
|
15874
16152
|
const pageWorkspaces = pageRows.map((row) => row.ws);
|
|
15875
16153
|
const listLoading = loading || serverMode && !serverPage;
|
|
15876
|
-
const [plans, setPlans] = (0,
|
|
15877
|
-
const requestedPlans = (0,
|
|
16154
|
+
const [plans, setPlans] = (0, import_react28.useState)({});
|
|
16155
|
+
const requestedPlans = (0, import_react28.useRef)(/* @__PURE__ */ new Set());
|
|
15878
16156
|
const visibleIds = [
|
|
15879
16157
|
...currentWorkspace ? [currentWorkspace._id] : [],
|
|
15880
16158
|
...pageWorkspaces.map((ws) => ws._id)
|
|
15881
16159
|
];
|
|
15882
16160
|
const visibleKey = visibleIds.join(",");
|
|
15883
|
-
const mounted = (0,
|
|
15884
|
-
(0,
|
|
16161
|
+
const mounted = (0, import_react28.useRef)(true);
|
|
16162
|
+
(0, import_react28.useEffect)(() => {
|
|
15885
16163
|
mounted.current = true;
|
|
15886
16164
|
return () => {
|
|
15887
16165
|
mounted.current = false;
|
|
15888
16166
|
};
|
|
15889
16167
|
}, []);
|
|
15890
|
-
(0,
|
|
16168
|
+
(0, import_react28.useEffect)(() => {
|
|
15891
16169
|
if (!fetchPlans || listLoading) return;
|
|
15892
16170
|
const missing = visibleKey.split(",").filter((id) => id && !requestedPlans.current.has(id));
|
|
15893
16171
|
if (!missing.length) return;
|
|
@@ -15898,13 +16176,13 @@ function WorkspaceListTab({
|
|
|
15898
16176
|
});
|
|
15899
16177
|
}, [fetchPlans, listLoading, visibleKey]);
|
|
15900
16178
|
const planOf = (ws) => fetchPlans ? plans[ws._id] ?? "" : ws.plan ?? "";
|
|
15901
|
-
return /* @__PURE__ */ (0,
|
|
16179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15902
16180
|
"div",
|
|
15903
16181
|
{
|
|
15904
16182
|
className: "flex flex-col items-start flex-1 min-w-0",
|
|
15905
16183
|
style: { gap: "var(--spacing-3xl)", height: "100%" },
|
|
15906
16184
|
children: [
|
|
15907
|
-
/* @__PURE__ */ (0,
|
|
16185
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15908
16186
|
"p",
|
|
15909
16187
|
{
|
|
15910
16188
|
className: "shrink-0 w-full",
|
|
@@ -15917,7 +16195,7 @@ function WorkspaceListTab({
|
|
|
15917
16195
|
children: "Switching changes which workspace the rest of Settings acts on."
|
|
15918
16196
|
}
|
|
15919
16197
|
),
|
|
15920
|
-
listLoading && /* @__PURE__ */ (0,
|
|
16198
|
+
listLoading && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15921
16199
|
"p",
|
|
15922
16200
|
{
|
|
15923
16201
|
style: {
|
|
@@ -15928,13 +16206,13 @@ function WorkspaceListTab({
|
|
|
15928
16206
|
children: "Loading workspaces\u2026"
|
|
15929
16207
|
}
|
|
15930
16208
|
),
|
|
15931
|
-
!listLoading && currentWorkspace && /* @__PURE__ */ (0,
|
|
16209
|
+
!listLoading && currentWorkspace && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15932
16210
|
"div",
|
|
15933
16211
|
{
|
|
15934
16212
|
className: "flex flex-col items-start shrink-0 w-full",
|
|
15935
16213
|
style: { gap: 16, padding: "var(--spacing-md) 0" },
|
|
15936
16214
|
children: [
|
|
15937
|
-
/* @__PURE__ */ (0,
|
|
16215
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15938
16216
|
"p",
|
|
15939
16217
|
{
|
|
15940
16218
|
className: "w-full overflow-hidden text-ellipsis whitespace-nowrap",
|
|
@@ -15951,8 +16229,8 @@ function WorkspaceListTab({
|
|
|
15951
16229
|
]
|
|
15952
16230
|
}
|
|
15953
16231
|
),
|
|
15954
|
-
/* @__PURE__ */ (0,
|
|
15955
|
-
|
|
16232
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16233
|
+
import_ui25.ScWorkspaceSwitchCard,
|
|
15956
16234
|
{
|
|
15957
16235
|
wsName: currentWorkspace.name,
|
|
15958
16236
|
initials: currentWorkspace.initials,
|
|
@@ -15968,7 +16246,7 @@ function WorkspaceListTab({
|
|
|
15968
16246
|
]
|
|
15969
16247
|
}
|
|
15970
16248
|
),
|
|
15971
|
-
!listLoading && currentWorkspace && listTotal > 0 && /* @__PURE__ */ (0,
|
|
16249
|
+
!listLoading && currentWorkspace && listTotal > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15972
16250
|
"div",
|
|
15973
16251
|
{
|
|
15974
16252
|
className: "shrink-0 w-full",
|
|
@@ -15978,19 +16256,19 @@ function WorkspaceListTab({
|
|
|
15978
16256
|
}
|
|
15979
16257
|
}
|
|
15980
16258
|
),
|
|
15981
|
-
!listLoading && listTotal > 0 && /* @__PURE__ */ (0,
|
|
16259
|
+
!listLoading && listTotal > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
15982
16260
|
"div",
|
|
15983
16261
|
{
|
|
15984
16262
|
className: "flex flex-col items-start flex-1 min-h-0 w-full",
|
|
15985
16263
|
style: { gap: 16, overflowY: "auto" },
|
|
15986
16264
|
children: [
|
|
15987
|
-
/* @__PURE__ */ (0,
|
|
16265
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15988
16266
|
"div",
|
|
15989
16267
|
{
|
|
15990
16268
|
className: "flex flex-col items-start w-full",
|
|
15991
16269
|
style: { gap: 16 },
|
|
15992
|
-
children: pageRows.map(({ ws, group }, index) => /* @__PURE__ */ (0,
|
|
15993
|
-
(index === 0 || pageRows[index - 1].group.key !== group.key) && /* @__PURE__ */ (0,
|
|
16270
|
+
children: pageRows.map(({ ws, group }, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react28.Fragment, { children: [
|
|
16271
|
+
(index === 0 || pageRows[index - 1].group.key !== group.key) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
15994
16272
|
"p",
|
|
15995
16273
|
{
|
|
15996
16274
|
className: "w-full overflow-hidden text-ellipsis whitespace-nowrap shrink-0",
|
|
@@ -16005,8 +16283,8 @@ function WorkspaceListTab({
|
|
|
16005
16283
|
children: group.label
|
|
16006
16284
|
}
|
|
16007
16285
|
),
|
|
16008
|
-
/* @__PURE__ */ (0,
|
|
16009
|
-
|
|
16286
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16287
|
+
import_ui25.ScWorkspaceSwitchCard,
|
|
16010
16288
|
{
|
|
16011
16289
|
wsName: ws.name,
|
|
16012
16290
|
initials: ws.initials,
|
|
@@ -16023,13 +16301,13 @@ function WorkspaceListTab({
|
|
|
16023
16301
|
] }, ws._id))
|
|
16024
16302
|
}
|
|
16025
16303
|
),
|
|
16026
|
-
pageCount > 1 && /* @__PURE__ */ (0,
|
|
16304
|
+
pageCount > 1 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
16027
16305
|
"div",
|
|
16028
16306
|
{
|
|
16029
16307
|
className: "flex items-center justify-between shrink-0 w-full",
|
|
16030
16308
|
style: { gap: "var(--spacing-md)" },
|
|
16031
16309
|
children: [
|
|
16032
|
-
/* @__PURE__ */ (0,
|
|
16310
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
16033
16311
|
"span",
|
|
16034
16312
|
{
|
|
16035
16313
|
style: {
|
|
@@ -16048,9 +16326,9 @@ function WorkspaceListTab({
|
|
|
16048
16326
|
]
|
|
16049
16327
|
}
|
|
16050
16328
|
),
|
|
16051
|
-
/* @__PURE__ */ (0,
|
|
16052
|
-
/* @__PURE__ */ (0,
|
|
16053
|
-
|
|
16329
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center", style: { gap: "var(--spacing-md)" }, children: [
|
|
16330
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16331
|
+
import_ui24.ScButton,
|
|
16054
16332
|
{
|
|
16055
16333
|
text: "Previous",
|
|
16056
16334
|
variant: "tertiary",
|
|
@@ -16059,8 +16337,8 @@ function WorkspaceListTab({
|
|
|
16059
16337
|
onClick: safePage === 0 ? void 0 : () => setPage(safePage - 1)
|
|
16060
16338
|
}
|
|
16061
16339
|
),
|
|
16062
|
-
/* @__PURE__ */ (0,
|
|
16063
|
-
|
|
16340
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16341
|
+
import_ui24.ScButton,
|
|
16064
16342
|
{
|
|
16065
16343
|
text: "Next",
|
|
16066
16344
|
variant: "tertiary",
|
|
@@ -16085,9 +16363,9 @@ function ReferralTab() {
|
|
|
16085
16363
|
const { auth, toast, api } = useSettingsAdapters();
|
|
16086
16364
|
const domain = typeof window !== "undefined" ? window.location.origin : "";
|
|
16087
16365
|
const link = referralLink(referralCodeOf(auth.user), domain);
|
|
16088
|
-
const [copied, setCopied] = (0,
|
|
16089
|
-
const copiedTimer = (0,
|
|
16090
|
-
(0,
|
|
16366
|
+
const [copied, setCopied] = (0, import_react28.useState)(false);
|
|
16367
|
+
const copiedTimer = (0, import_react28.useRef)(null);
|
|
16368
|
+
(0, import_react28.useEffect)(() => () => {
|
|
16091
16369
|
if (copiedTimer.current) clearTimeout(copiedTimer.current);
|
|
16092
16370
|
}, []);
|
|
16093
16371
|
const copyLink = async () => {
|
|
@@ -16102,13 +16380,13 @@ function ReferralTab() {
|
|
|
16102
16380
|
toast.error("Couldn't copy the referral link");
|
|
16103
16381
|
}
|
|
16104
16382
|
};
|
|
16105
|
-
return /* @__PURE__ */ (0,
|
|
16383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
16106
16384
|
"div",
|
|
16107
16385
|
{
|
|
16108
16386
|
className: "flex flex-col items-start flex-1 min-w-0",
|
|
16109
16387
|
style: { gap: "var(--spacing-3xl)" },
|
|
16110
16388
|
children: [
|
|
16111
|
-
/* @__PURE__ */ (0,
|
|
16389
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16112
16390
|
"div",
|
|
16113
16391
|
{
|
|
16114
16392
|
className: "w-full relative",
|
|
@@ -16117,8 +16395,8 @@ function ReferralTab() {
|
|
|
16117
16395
|
borderRadius: "var(--radius-3xl)",
|
|
16118
16396
|
padding: "var(--spacing-6xl)"
|
|
16119
16397
|
},
|
|
16120
|
-
children: /* @__PURE__ */ (0,
|
|
16121
|
-
|
|
16398
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16399
|
+
import_ui23.ScTextField,
|
|
16122
16400
|
{
|
|
16123
16401
|
label: "Your Referral Link",
|
|
16124
16402
|
labelGroup: "label",
|
|
@@ -16126,7 +16404,7 @@ function ReferralTab() {
|
|
|
16126
16404
|
value: link,
|
|
16127
16405
|
placeholderFilled: "https://your-domain.com?referral_code=ABC123",
|
|
16128
16406
|
tfGroup: "none",
|
|
16129
|
-
rightSlot: /* @__PURE__ */ (0,
|
|
16407
|
+
rightSlot: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
16130
16408
|
"button",
|
|
16131
16409
|
{
|
|
16132
16410
|
type: "button",
|
|
@@ -16152,7 +16430,7 @@ function ReferralTab() {
|
|
|
16152
16430
|
e.currentTarget.style.background = "transparent";
|
|
16153
16431
|
},
|
|
16154
16432
|
children: [
|
|
16155
|
-
copied ? /* @__PURE__ */ (0,
|
|
16433
|
+
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)" }),
|
|
16156
16434
|
copied ? "Copied" : "Copy"
|
|
16157
16435
|
]
|
|
16158
16436
|
}
|
|
@@ -16165,7 +16443,7 @@ function ReferralTab() {
|
|
|
16165
16443
|
)
|
|
16166
16444
|
}
|
|
16167
16445
|
),
|
|
16168
|
-
api.getReferredUsers && /* @__PURE__ */ (0,
|
|
16446
|
+
api.getReferredUsers && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ReferralHistory, { load: (signal) => api.getReferredUsers(signal) })
|
|
16169
16447
|
]
|
|
16170
16448
|
}
|
|
16171
16449
|
);
|
|
@@ -16183,7 +16461,7 @@ function SettingsContent({
|
|
|
16183
16461
|
inviteRequested,
|
|
16184
16462
|
onInviteRequestHandled
|
|
16185
16463
|
}) {
|
|
16186
|
-
return /* @__PURE__ */ (0,
|
|
16464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SettingsAdaptersProvider, { adapters, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16187
16465
|
SettingsContentInner,
|
|
16188
16466
|
{
|
|
16189
16467
|
activeTab,
|
|
@@ -16221,7 +16499,8 @@ function SettingsContentInner({
|
|
|
16221
16499
|
organization,
|
|
16222
16500
|
navigation,
|
|
16223
16501
|
toast,
|
|
16224
|
-
integrations
|
|
16502
|
+
integrations,
|
|
16503
|
+
loginMethods
|
|
16225
16504
|
} = adapters;
|
|
16226
16505
|
const overviewDetail = presentation === "overview-detail";
|
|
16227
16506
|
const isOverview = overviewDetail && showOverview;
|
|
@@ -16229,14 +16508,15 @@ function SettingsContentInner({
|
|
|
16229
16508
|
const showConnectedApps = !!integrations;
|
|
16230
16509
|
const showReferral = !!referralCodeOf(adapters.auth.user);
|
|
16231
16510
|
const showIntegrations = !!integrations?.listOrganizationConnections && !!integrations.getOrganizationAccess && organization.current?.role === "admin";
|
|
16511
|
+
const showLoginMethods = !!loginMethods && organization.current?.role === "admin";
|
|
16232
16512
|
const workspaceId = workspace.current?.id ?? null;
|
|
16233
16513
|
const workspaceOwner = useWorkspaceOrganization({ workspaceId, request: workspace.organizationRequest ?? unavailableOrganizationRequest, enabled: !!workspace.organizationRequest });
|
|
16234
16514
|
const workspaceOwnerName = workspace.organizationRequest ? workspaceOwner.organizationName : void 0;
|
|
16235
|
-
const [workspaceList, setWorkspaceList] = (0,
|
|
16515
|
+
const [workspaceList, setWorkspaceList] = (0, import_react28.useState)([]);
|
|
16236
16516
|
const currentWorkspaceRole = workspace.current?.role ?? workspaceList.find((item) => item._id === workspaceId)?.role;
|
|
16237
16517
|
const isWorkspaceAdmin = currentWorkspaceRole?.trim().toLowerCase() === "admin";
|
|
16238
|
-
const [workspaceListLoading, setWorkspaceListLoading] = (0,
|
|
16239
|
-
const refreshWorkspaceList = (0,
|
|
16518
|
+
const [workspaceListLoading, setWorkspaceListLoading] = (0, import_react28.useState)(false);
|
|
16519
|
+
const refreshWorkspaceList = (0, import_react28.useCallback)(async () => {
|
|
16240
16520
|
setWorkspaceListLoading(true);
|
|
16241
16521
|
try {
|
|
16242
16522
|
const items = await workspace.list();
|
|
@@ -16257,11 +16537,11 @@ function SettingsContentInner({
|
|
|
16257
16537
|
setWorkspaceListLoading(false);
|
|
16258
16538
|
}
|
|
16259
16539
|
}, [workspace, workspaceId]);
|
|
16260
|
-
(0,
|
|
16540
|
+
(0, import_react28.useEffect)(() => {
|
|
16261
16541
|
void refreshWorkspaceList();
|
|
16262
16542
|
}, [refreshWorkspaceList]);
|
|
16263
16543
|
const hostListPage = workspace.listPage;
|
|
16264
|
-
const listWorkspacePage = (0,
|
|
16544
|
+
const listWorkspacePage = (0, import_react28.useMemo)(
|
|
16265
16545
|
() => hostListPage ? async (params) => {
|
|
16266
16546
|
const result = await hostListPage(params);
|
|
16267
16547
|
return {
|
|
@@ -16278,8 +16558,8 @@ function SettingsContentInner({
|
|
|
16278
16558
|
} : void 0,
|
|
16279
16559
|
[hostListPage, workspaceId]
|
|
16280
16560
|
);
|
|
16281
|
-
const [listOrganizations, setListOrganizations] = (0,
|
|
16282
|
-
(0,
|
|
16561
|
+
const [listOrganizations, setListOrganizations] = (0, import_react28.useState)([]);
|
|
16562
|
+
(0, import_react28.useEffect)(() => {
|
|
16283
16563
|
if (activeTab !== "workspaceList" || typeof organization?.list !== "function") {
|
|
16284
16564
|
return;
|
|
16285
16565
|
}
|
|
@@ -16300,7 +16580,7 @@ function SettingsContentInner({
|
|
|
16300
16580
|
cancelled = true;
|
|
16301
16581
|
};
|
|
16302
16582
|
}, [activeTab, organization]);
|
|
16303
|
-
const switchWorkspace = (0,
|
|
16583
|
+
const switchWorkspace = (0, import_react28.useCallback)(
|
|
16304
16584
|
async (id) => {
|
|
16305
16585
|
await workspace.switch(id);
|
|
16306
16586
|
},
|
|
@@ -16309,38 +16589,38 @@ function SettingsContentInner({
|
|
|
16309
16589
|
const setActiveTab = (tab) => {
|
|
16310
16590
|
navigation.navigateToTab(tab);
|
|
16311
16591
|
};
|
|
16312
|
-
const [creatingWorkspace, setCreatingWorkspace] = (0,
|
|
16313
|
-
const [updatingWorkspace, setUpdatingWorkspace] = (0,
|
|
16314
|
-
const [teamInviteOpen, setTeamInviteOpen] = (0,
|
|
16592
|
+
const [creatingWorkspace, setCreatingWorkspace] = (0, import_react28.useState)(false);
|
|
16593
|
+
const [updatingWorkspace, setUpdatingWorkspace] = (0, import_react28.useState)(false);
|
|
16594
|
+
const [teamInviteOpen, setTeamInviteOpen] = (0, import_react28.useState)(false);
|
|
16315
16595
|
const teamPermissionScope = JSON.stringify([workspaceId, _auth.user?.id, workspace.current?.role]);
|
|
16316
|
-
const [teamInvitePermission, setTeamInvitePermission] = (0,
|
|
16596
|
+
const [teamInvitePermission, setTeamInvitePermission] = (0, import_react28.useState)(null);
|
|
16317
16597
|
const teamCanInvite = teamInvitePermission?.scope === teamPermissionScope && teamInvitePermission.api === adapters.api ? teamInvitePermission.canInvite : null;
|
|
16318
|
-
const receiveTeamInvitePermission = (0,
|
|
16598
|
+
const receiveTeamInvitePermission = (0, import_react28.useCallback)((canInvite) => {
|
|
16319
16599
|
setTeamInvitePermission((previous) => previous?.scope === teamPermissionScope && previous.api === adapters.api && previous.canInvite === canInvite ? previous : { scope: teamPermissionScope, api: adapters.api, canInvite });
|
|
16320
16600
|
}, [teamPermissionScope, adapters.api]);
|
|
16321
16601
|
const canUseHeaderInvite = overviewDetail ? activeTab === "workspaceMembers" && !isOverview ? teamCanInvite === true : !overviewInvite.isLoading && overviewInvite.canInvite : teamCanInvite ?? isWorkspaceAdmin;
|
|
16322
|
-
const [tokenShowRevoked, setTokenShowRevoked] = (0,
|
|
16323
|
-
const [tokenCreateOpen, setTokenCreateOpen] = (0,
|
|
16324
|
-
const [billingShowPlans, setBillingShowPlans] = (0,
|
|
16602
|
+
const [tokenShowRevoked, setTokenShowRevoked] = (0, import_react28.useState)(false);
|
|
16603
|
+
const [tokenCreateOpen, setTokenCreateOpen] = (0, import_react28.useState)(false);
|
|
16604
|
+
const [billingShowPlans, setBillingShowPlans] = (0, import_react28.useState)(false);
|
|
16325
16605
|
const isBillingPlans = activeTab === "billing" && isWorkspaceAdmin && billingShowPlans;
|
|
16326
|
-
const [billingShowPerUserLimits, setBillingShowPerUserLimits] = (0,
|
|
16606
|
+
const [billingShowPerUserLimits, setBillingShowPerUserLimits] = (0, import_react28.useState)(false);
|
|
16327
16607
|
const isBillingPerUserLimits = activeTab === "billing" && isWorkspaceAdmin && billingShowPerUserLimits && !billingShowPlans;
|
|
16328
|
-
const [billingShowSharedCredits, setBillingShowSharedCredits] = (0,
|
|
16608
|
+
const [billingShowSharedCredits, setBillingShowSharedCredits] = (0, import_react28.useState)(false);
|
|
16329
16609
|
const isBillingSharedCredits = activeTab === "billing" && isWorkspaceAdmin && billingShowSharedCredits && !billingShowPlans && !billingShowPerUserLimits;
|
|
16330
16610
|
const isBillingSubView = isBillingPlans || isBillingPerUserLimits || isBillingSharedCredits;
|
|
16331
|
-
(0,
|
|
16611
|
+
(0, import_react28.useEffect)(() => {
|
|
16332
16612
|
if (isOverview || activeTab !== "billing" || !isWorkspaceAdmin) {
|
|
16333
16613
|
setBillingShowPlans(false);
|
|
16334
16614
|
setBillingShowPerUserLimits(false);
|
|
16335
16615
|
setBillingShowSharedCredits(false);
|
|
16336
16616
|
}
|
|
16337
16617
|
}, [activeTab, isWorkspaceAdmin, isOverview]);
|
|
16338
|
-
(0,
|
|
16618
|
+
(0, import_react28.useEffect)(() => {
|
|
16339
16619
|
setBillingShowPlans(false);
|
|
16340
16620
|
setBillingShowPerUserLimits(false);
|
|
16341
16621
|
setBillingShowSharedCredits(false);
|
|
16342
16622
|
}, [workspaceId]);
|
|
16343
|
-
(0,
|
|
16623
|
+
(0, import_react28.useEffect)(() => {
|
|
16344
16624
|
if (!onClose) return;
|
|
16345
16625
|
const handleKeyDown = (e) => {
|
|
16346
16626
|
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
@@ -16362,14 +16642,14 @@ function SettingsContentInner({
|
|
|
16362
16642
|
document.addEventListener("keydown", handleKeyDown);
|
|
16363
16643
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
16364
16644
|
}, [onClose, billingShowPlans, billingShowPerUserLimits, billingShowSharedCredits]);
|
|
16365
|
-
const [localWorkspaces, setLocalWorkspaces] = (0,
|
|
16366
|
-
const [wsModalOpen, setWsModalOpen] = (0,
|
|
16367
|
-
const [wsModalMode, setWsModalMode] = (0,
|
|
16368
|
-
const [editingWorkspace, setEditingWorkspace] = (0,
|
|
16369
|
-
const [confirmLeaveOpen, setConfirmLeaveOpen] = (0,
|
|
16370
|
-
const [leavingWorkspace, setLeavingWorkspace] = (0,
|
|
16371
|
-
const [confirmDeleteOpen, setConfirmDeleteOpen] = (0,
|
|
16372
|
-
const [deletingWorkspace, setDeletingWorkspace] = (0,
|
|
16645
|
+
const [localWorkspaces, setLocalWorkspaces] = (0, import_react28.useState)(null);
|
|
16646
|
+
const [wsModalOpen, setWsModalOpen] = (0, import_react28.useState)(false);
|
|
16647
|
+
const [wsModalMode, setWsModalMode] = (0, import_react28.useState)("create");
|
|
16648
|
+
const [editingWorkspace, setEditingWorkspace] = (0, import_react28.useState)(null);
|
|
16649
|
+
const [confirmLeaveOpen, setConfirmLeaveOpen] = (0, import_react28.useState)(false);
|
|
16650
|
+
const [leavingWorkspace, setLeavingWorkspace] = (0, import_react28.useState)(null);
|
|
16651
|
+
const [confirmDeleteOpen, setConfirmDeleteOpen] = (0, import_react28.useState)(false);
|
|
16652
|
+
const [deletingWorkspace, setDeletingWorkspace] = (0, import_react28.useState)(null);
|
|
16373
16653
|
const toWorkspaceData = (ws) => ({
|
|
16374
16654
|
id: ws._id,
|
|
16375
16655
|
name: ws.name ?? "",
|
|
@@ -16459,7 +16739,7 @@ function SettingsContentInner({
|
|
|
16459
16739
|
}
|
|
16460
16740
|
return true;
|
|
16461
16741
|
};
|
|
16462
|
-
(0,
|
|
16742
|
+
(0, import_react28.useEffect)(() => {
|
|
16463
16743
|
if (workspaceList.length > 0 && localWorkspaces === null) {
|
|
16464
16744
|
setLocalWorkspaces(workspaceList.map(toWorkspaceData));
|
|
16465
16745
|
}
|
|
@@ -16636,7 +16916,7 @@ function SettingsContentInner({
|
|
|
16636
16916
|
setConfirmLeaveOpen(true);
|
|
16637
16917
|
return false;
|
|
16638
16918
|
}
|
|
16639
|
-
return /* @__PURE__ */ (0,
|
|
16919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
16640
16920
|
"div",
|
|
16641
16921
|
{
|
|
16642
16922
|
"data-streamoid-settings": "",
|
|
@@ -16647,8 +16927,8 @@ function SettingsContentInner({
|
|
|
16647
16927
|
...isOverview ? { display: "block", overflowY: "auto" } : {}
|
|
16648
16928
|
},
|
|
16649
16929
|
children: [
|
|
16650
|
-
!isOverview && /* @__PURE__ */ (0,
|
|
16651
|
-
/* @__PURE__ */ (0,
|
|
16930
|
+
!isOverview && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SettingsAppearance, {}),
|
|
16931
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16652
16932
|
"div",
|
|
16653
16933
|
{
|
|
16654
16934
|
className: "flex flex-col items-start relative h-full overflow-hidden",
|
|
@@ -16659,8 +16939,8 @@ function SettingsContentInner({
|
|
|
16659
16939
|
width: "100%",
|
|
16660
16940
|
...isOverview ? { height: "auto", minHeight: "100%", overflow: "visible", marginInline: "auto" } : {}
|
|
16661
16941
|
},
|
|
16662
|
-
children: /* @__PURE__ */ (0,
|
|
16663
|
-
!overviewDetail && onBack !== null && /* @__PURE__ */ (0,
|
|
16942
|
+
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: [
|
|
16943
|
+
!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)(
|
|
16664
16944
|
"button",
|
|
16665
16945
|
{
|
|
16666
16946
|
type: "button",
|
|
@@ -16692,19 +16972,19 @@ function SettingsContentInner({
|
|
|
16692
16972
|
else window.history.back();
|
|
16693
16973
|
},
|
|
16694
16974
|
children: [
|
|
16695
|
-
/* @__PURE__ */ (0,
|
|
16975
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconLeft, { className: "w-4 h-4 shrink-0", color: "var(--alias-text---icons-muted)" }),
|
|
16696
16976
|
"Back"
|
|
16697
16977
|
]
|
|
16698
16978
|
}
|
|
16699
16979
|
) }),
|
|
16700
|
-
overviewDetail && !isOverview && (isBillingSubView || onOverview) && /* @__PURE__ */ (0,
|
|
16701
|
-
|
|
16980
|
+
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)(
|
|
16981
|
+
import_ui24.ScButton,
|
|
16702
16982
|
{
|
|
16703
16983
|
text: isBillingSubView ? "Back to billing" : "Back to account and workspace settings",
|
|
16704
16984
|
variant: "tertiary",
|
|
16705
16985
|
size: "sm",
|
|
16706
16986
|
styleVariant: "icon-left",
|
|
16707
|
-
icon: /* @__PURE__ */ (0,
|
|
16987
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconArrowLeft, { size: 18, "aria-hidden": "true" }),
|
|
16708
16988
|
onClick: () => {
|
|
16709
16989
|
if (isBillingSubView) {
|
|
16710
16990
|
setBillingShowPlans(false);
|
|
@@ -16716,7 +16996,7 @@ function SettingsContentInner({
|
|
|
16716
16996
|
}
|
|
16717
16997
|
}
|
|
16718
16998
|
) }),
|
|
16719
|
-
/* @__PURE__ */ (0,
|
|
16999
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
16720
17000
|
"div",
|
|
16721
17001
|
{
|
|
16722
17002
|
className: "flex items-center shrink-0 w-full",
|
|
@@ -16727,9 +17007,9 @@ function SettingsContentInner({
|
|
|
16727
17007
|
paddingRight: 20
|
|
16728
17008
|
},
|
|
16729
17009
|
children: [
|
|
16730
|
-
/* @__PURE__ */ (0,
|
|
16731
|
-
/* @__PURE__ */ (0,
|
|
16732
|
-
/* @__PURE__ */ (0,
|
|
17010
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center flex-1 min-w-0", style: { gap: 8, paddingLeft: 20 }, children: [
|
|
17011
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconSettings, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
|
|
17012
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16733
17013
|
"h1",
|
|
16734
17014
|
{
|
|
16735
17015
|
style: {
|
|
@@ -16743,10 +17023,10 @@ function SettingsContentInner({
|
|
|
16743
17023
|
children: overviewDetail ? "Account and workspace settings" : "Settings"
|
|
16744
17024
|
}
|
|
16745
17025
|
),
|
|
16746
|
-
!isOverview && /* @__PURE__ */ (0,
|
|
16747
|
-
scopeCrumb && /* @__PURE__ */ (0,
|
|
16748
|
-
/* @__PURE__ */ (0,
|
|
16749
|
-
/* @__PURE__ */ (0,
|
|
17026
|
+
!isOverview && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("nav", { "aria-label": "Breadcrumb", className: "flex items-center min-w-0", style: { gap: 8 }, children: [
|
|
17027
|
+
scopeCrumb && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
17028
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
|
|
17029
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16750
17030
|
"span",
|
|
16751
17031
|
{
|
|
16752
17032
|
className: "truncate",
|
|
@@ -16763,8 +17043,8 @@ function SettingsContentInner({
|
|
|
16763
17043
|
}
|
|
16764
17044
|
)
|
|
16765
17045
|
] }),
|
|
16766
|
-
/* @__PURE__ */ (0,
|
|
16767
|
-
/* @__PURE__ */ (0,
|
|
17046
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
|
|
17047
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16768
17048
|
"span",
|
|
16769
17049
|
{
|
|
16770
17050
|
style: {
|
|
@@ -16777,9 +17057,9 @@ function SettingsContentInner({
|
|
|
16777
17057
|
children: leafLabel
|
|
16778
17058
|
}
|
|
16779
17059
|
),
|
|
16780
|
-
isBillingPlans && /* @__PURE__ */ (0,
|
|
16781
|
-
/* @__PURE__ */ (0,
|
|
16782
|
-
/* @__PURE__ */ (0,
|
|
17060
|
+
isBillingPlans && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
17061
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
|
|
17062
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16783
17063
|
"span",
|
|
16784
17064
|
{
|
|
16785
17065
|
style: {
|
|
@@ -16793,9 +17073,9 @@ function SettingsContentInner({
|
|
|
16793
17073
|
}
|
|
16794
17074
|
)
|
|
16795
17075
|
] }),
|
|
16796
|
-
isBillingPerUserLimits && /* @__PURE__ */ (0,
|
|
16797
|
-
/* @__PURE__ */ (0,
|
|
16798
|
-
/* @__PURE__ */ (0,
|
|
17076
|
+
isBillingPerUserLimits && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
17077
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
|
|
17078
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16799
17079
|
"span",
|
|
16800
17080
|
{
|
|
16801
17081
|
style: {
|
|
@@ -16809,9 +17089,9 @@ function SettingsContentInner({
|
|
|
16809
17089
|
}
|
|
16810
17090
|
)
|
|
16811
17091
|
] }),
|
|
16812
|
-
isBillingSharedCredits && /* @__PURE__ */ (0,
|
|
16813
|
-
/* @__PURE__ */ (0,
|
|
16814
|
-
/* @__PURE__ */ (0,
|
|
17092
|
+
isBillingSharedCredits && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
17093
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconRight, { className: "w-6 h-6 shrink-0", color: "var(--alias-text---icons-primary)" }),
|
|
17094
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16815
17095
|
"span",
|
|
16816
17096
|
{
|
|
16817
17097
|
style: {
|
|
@@ -16827,20 +17107,20 @@ function SettingsContentInner({
|
|
|
16827
17107
|
] })
|
|
16828
17108
|
] })
|
|
16829
17109
|
] }),
|
|
16830
|
-
!isOverview && activeTab === "workspaceList" && /* @__PURE__ */ (0,
|
|
17110
|
+
!isOverview && activeTab === "workspaceList" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16831
17111
|
SettingsTooltip,
|
|
16832
17112
|
{
|
|
16833
17113
|
content: "Start a new workspace with its own team, members and billing",
|
|
16834
17114
|
placement: "bottom",
|
|
16835
17115
|
inline: true,
|
|
16836
|
-
children: /* @__PURE__ */ (0,
|
|
16837
|
-
|
|
17116
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17117
|
+
import_ui24.ScButton,
|
|
16838
17118
|
{
|
|
16839
17119
|
text: "Create Workspace",
|
|
16840
17120
|
variant: "secondary",
|
|
16841
17121
|
size: "md",
|
|
16842
17122
|
styleVariant: "icon-left",
|
|
16843
|
-
icon: /* @__PURE__ */ (0,
|
|
17123
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16844
17124
|
import_icons18.SiconWorkspace,
|
|
16845
17125
|
{
|
|
16846
17126
|
className: "w-5 h-5",
|
|
@@ -16852,21 +17132,21 @@ function SettingsContentInner({
|
|
|
16852
17132
|
)
|
|
16853
17133
|
}
|
|
16854
17134
|
),
|
|
16855
|
-
!isOverview && activeTab === "workspaceMembers" && /* @__PURE__ */ (0,
|
|
17135
|
+
!isOverview && activeTab === "workspaceMembers" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16856
17136
|
SettingsTooltip,
|
|
16857
17137
|
{
|
|
16858
17138
|
content: "Send someone an invite to join this workspace",
|
|
16859
17139
|
placement: "bottom",
|
|
16860
17140
|
inline: true,
|
|
16861
|
-
children: /* @__PURE__ */ (0,
|
|
16862
|
-
|
|
17141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17142
|
+
import_ui24.ScButton,
|
|
16863
17143
|
{
|
|
16864
17144
|
text: overviewDetail ? "Invite people" : "Invite user",
|
|
16865
17145
|
variant: "secondary",
|
|
16866
17146
|
size: "md",
|
|
16867
17147
|
styleVariant: "icon-left",
|
|
16868
17148
|
state: canUseHeaderInvite ? "default" : "disabled",
|
|
16869
|
-
icon: /* @__PURE__ */ (0,
|
|
17149
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16870
17150
|
import_icons18.SiconUserAdd,
|
|
16871
17151
|
{
|
|
16872
17152
|
className: "w-5 h-5",
|
|
@@ -16880,15 +17160,15 @@ function SettingsContentInner({
|
|
|
16880
17160
|
)
|
|
16881
17161
|
}
|
|
16882
17162
|
),
|
|
16883
|
-
!isOverview && activeTab === "apikey" && isWorkspaceAdmin && /* @__PURE__ */ (0,
|
|
16884
|
-
/* @__PURE__ */ (0,
|
|
17163
|
+
!isOverview && activeTab === "apikey" && isWorkspaceAdmin && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center shrink-0", style: { gap: "var(--spacing-md)" }, children: [
|
|
17164
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16885
17165
|
SettingsTooltip,
|
|
16886
17166
|
{
|
|
16887
17167
|
content: "Include keys you have already revoked in the list below",
|
|
16888
17168
|
placement: "bottom",
|
|
16889
17169
|
inline: true,
|
|
16890
|
-
children: /* @__PURE__ */ (0,
|
|
16891
|
-
|
|
17170
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17171
|
+
import_ui24.ScButton,
|
|
16892
17172
|
{
|
|
16893
17173
|
text: tokenShowRevoked ? "Hide Revoked" : "Show Revoked",
|
|
16894
17174
|
variant: "outline",
|
|
@@ -16898,20 +17178,20 @@ function SettingsContentInner({
|
|
|
16898
17178
|
)
|
|
16899
17179
|
}
|
|
16900
17180
|
),
|
|
16901
|
-
/* @__PURE__ */ (0,
|
|
17181
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16902
17182
|
SettingsTooltip,
|
|
16903
17183
|
{
|
|
16904
17184
|
content: "Generate a key for calling the Streamoid APIs from your own code",
|
|
16905
17185
|
placement: "bottom",
|
|
16906
17186
|
inline: true,
|
|
16907
|
-
children: /* @__PURE__ */ (0,
|
|
16908
|
-
|
|
17187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17188
|
+
import_ui24.ScButton,
|
|
16909
17189
|
{
|
|
16910
17190
|
text: "New API Key",
|
|
16911
17191
|
variant: "secondary",
|
|
16912
17192
|
size: "md",
|
|
16913
17193
|
styleVariant: "icon-left",
|
|
16914
|
-
icon: /* @__PURE__ */ (0,
|
|
17194
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16915
17195
|
import_icons18.SiconPlus,
|
|
16916
17196
|
{
|
|
16917
17197
|
className: "w-5 h-5",
|
|
@@ -16924,13 +17204,13 @@ function SettingsContentInner({
|
|
|
16924
17204
|
}
|
|
16925
17205
|
)
|
|
16926
17206
|
] }),
|
|
16927
|
-
overviewDetail && onClose && /* @__PURE__ */ (0,
|
|
16928
|
-
|
|
17207
|
+
overviewDetail && onClose && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SettingsTooltip, { content: "Close settings", placement: "bottom", inline: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17208
|
+
import_ui24.ScButton,
|
|
16929
17209
|
{
|
|
16930
17210
|
styleVariant: "icon-only",
|
|
16931
17211
|
variant: "outline",
|
|
16932
17212
|
size: "md",
|
|
16933
|
-
icon: /* @__PURE__ */ (0,
|
|
17213
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconClose, { className: "w-5 h-5", color: PRIMARY_COLOR3 }),
|
|
16934
17214
|
"aria-label": "Close settings",
|
|
16935
17215
|
style: isOverview ? { width: "2rem", height: "2rem", padding: 0 } : void 0,
|
|
16936
17216
|
onClick: onClose
|
|
@@ -16939,7 +17219,7 @@ function SettingsContentInner({
|
|
|
16939
17219
|
]
|
|
16940
17220
|
}
|
|
16941
17221
|
),
|
|
16942
|
-
isOverview ? /* @__PURE__ */ (0,
|
|
17222
|
+
isOverview ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16943
17223
|
AdministrationOverview,
|
|
16944
17224
|
{
|
|
16945
17225
|
workspaceName: workspaceScopeName,
|
|
@@ -16949,18 +17229,19 @@ function SettingsContentInner({
|
|
|
16949
17229
|
isWorkspaceAdmin,
|
|
16950
17230
|
showConnectedApps,
|
|
16951
17231
|
showIntegrations,
|
|
17232
|
+
showLoginMethods,
|
|
16952
17233
|
showReferral,
|
|
16953
17234
|
canInvite: !overviewInvite.isLoading && overviewInvite.canInvite,
|
|
16954
17235
|
onNavigate: setActiveTab,
|
|
16955
17236
|
onInvitePeople
|
|
16956
17237
|
}
|
|
16957
|
-
) : /* @__PURE__ */ (0,
|
|
17238
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
16958
17239
|
"div",
|
|
16959
17240
|
{
|
|
16960
17241
|
className: "flex items-start flex-1 min-h-0 w-full overflow-hidden",
|
|
16961
17242
|
style: { gap: 20 },
|
|
16962
17243
|
children: [
|
|
16963
|
-
!overviewDetail && !isBillingSubView && /* @__PURE__ */ (0,
|
|
17244
|
+
!overviewDetail && !isBillingSubView && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
16964
17245
|
SettingsNav,
|
|
16965
17246
|
{
|
|
16966
17247
|
isWorkspaceAdmin,
|
|
@@ -16971,11 +17252,12 @@ function SettingsContentInner({
|
|
|
16971
17252
|
hasOrganization,
|
|
16972
17253
|
showConnectedApps,
|
|
16973
17254
|
showIntegrations,
|
|
17255
|
+
showLoginMethods,
|
|
16974
17256
|
showReferral
|
|
16975
17257
|
}
|
|
16976
17258
|
),
|
|
16977
|
-
activeTab === "profile" && /* @__PURE__ */ (0,
|
|
16978
|
-
activeTab === "workspace" && /* @__PURE__ */ (0,
|
|
17259
|
+
activeTab === "profile" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ProfileTab, {}),
|
|
17260
|
+
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)(
|
|
16979
17261
|
WorkspaceGeneralTab,
|
|
16980
17262
|
{
|
|
16981
17263
|
workspace: currentWorkspaceData,
|
|
@@ -16997,7 +17279,7 @@ function SettingsContentInner({
|
|
|
16997
17279
|
}
|
|
16998
17280
|
}
|
|
16999
17281
|
) }),
|
|
17000
|
-
activeTab === "workspaceMembers" && /* @__PURE__ */ (0,
|
|
17282
|
+
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)(
|
|
17001
17283
|
TeamsContent,
|
|
17002
17284
|
{
|
|
17003
17285
|
embedded: true,
|
|
@@ -17012,7 +17294,7 @@ function SettingsContentInner({
|
|
|
17012
17294
|
hiddenApps
|
|
17013
17295
|
}
|
|
17014
17296
|
) }),
|
|
17015
|
-
activeTab === "workspaceList" && /* @__PURE__ */ (0,
|
|
17297
|
+
activeTab === "workspaceList" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17016
17298
|
WorkspaceListTab,
|
|
17017
17299
|
{
|
|
17018
17300
|
workspaces: displayWorkspaces,
|
|
@@ -17037,11 +17319,12 @@ function SettingsContentInner({
|
|
|
17037
17319
|
}
|
|
17038
17320
|
}
|
|
17039
17321
|
),
|
|
17040
|
-
activeTab === "referral" && showReferral && /* @__PURE__ */ (0,
|
|
17041
|
-
activeTab === "connectedApps" && /* @__PURE__ */ (0,
|
|
17042
|
-
activeTab === "organizationIntegrations" && /* @__PURE__ */ (0,
|
|
17043
|
-
activeTab === "
|
|
17044
|
-
|
|
17322
|
+
activeTab === "referral" && showReferral && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ReferralTab, {}),
|
|
17323
|
+
activeTab === "connectedApps" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ConnectedAppsContent, {}),
|
|
17324
|
+
activeTab === "organizationIntegrations" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OrganizationIntegrationsContent, {}),
|
|
17325
|
+
activeTab === "organizationLoginMethods" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OrganizationLoginMethodsContent, {}),
|
|
17326
|
+
activeTab === "organizationList" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OrganizationListContent, {}),
|
|
17327
|
+
(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)(
|
|
17045
17328
|
ManagedOrganizationSummary,
|
|
17046
17329
|
{
|
|
17047
17330
|
name: workspaceOwner.organizationName,
|
|
@@ -17049,14 +17332,14 @@ function SettingsContentInner({
|
|
|
17049
17332
|
status: workspaceOwner.organizationStatus,
|
|
17050
17333
|
managementUrl: organization.managementUrl
|
|
17051
17334
|
}
|
|
17052
|
-
) : /* @__PURE__ */ (0,
|
|
17335
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17053
17336
|
OrganizationContent,
|
|
17054
17337
|
{
|
|
17055
17338
|
embedded: true,
|
|
17056
17339
|
view: activeTab === "organizationWorkspaces" || activeTab === "organizationDomains" ? "workspaces" : "people"
|
|
17057
17340
|
}
|
|
17058
17341
|
) }),
|
|
17059
|
-
activeTab === "billing" && isWorkspaceAdmin && /* @__PURE__ */ (0,
|
|
17342
|
+
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)(
|
|
17060
17343
|
BillingContent,
|
|
17061
17344
|
{
|
|
17062
17345
|
embedded: true,
|
|
@@ -17086,14 +17369,14 @@ function SettingsContentInner({
|
|
|
17086
17369
|
}
|
|
17087
17370
|
}
|
|
17088
17371
|
) }),
|
|
17089
|
-
(activeTab === "billing" || activeTab === "apikey") && !isWorkspaceAdmin && /* @__PURE__ */ (0,
|
|
17090
|
-
/* @__PURE__ */ (0,
|
|
17091
|
-
/* @__PURE__ */ (0,
|
|
17092
|
-
/* @__PURE__ */ (0,
|
|
17093
|
-
/* @__PURE__ */ (0,
|
|
17372
|
+
(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: [
|
|
17373
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconLock, { size: 24, color: MUTED_COLOR2 }),
|
|
17374
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h2", { style: { margin: 0, fontSize: 18, fontWeight: 600, color: PRIMARY_COLOR3 }, children: "Contact your workspace admin" }),
|
|
17375
|
+
/* @__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." }),
|
|
17376
|
+
/* @__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" })
|
|
17094
17377
|
] }),
|
|
17095
|
-
activeTab === "apikey" && isWorkspaceAdmin && /* @__PURE__ */ (0,
|
|
17096
|
-
/* @__PURE__ */ (0,
|
|
17378
|
+
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: [
|
|
17379
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
17097
17380
|
"a",
|
|
17098
17381
|
{
|
|
17099
17382
|
href: "https://docs.streamoid.com",
|
|
@@ -17103,19 +17386,19 @@ function SettingsContentInner({
|
|
|
17103
17386
|
className: "flex items-center shrink-0",
|
|
17104
17387
|
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" },
|
|
17105
17388
|
children: [
|
|
17106
|
-
/* @__PURE__ */ (0,
|
|
17107
|
-
/* @__PURE__ */ (0,
|
|
17108
|
-
/* @__PURE__ */ (0,
|
|
17109
|
-
/* @__PURE__ */ (0,
|
|
17389
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconBookOpen, { size: 24 }),
|
|
17390
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { style: { display: "flex", flexDirection: "column", gap: 4, flex: 1 }, children: [
|
|
17391
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { style: { fontSize: 14, fontWeight: 600 }, children: "Build with the Streamoid API" }),
|
|
17392
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { style: { fontSize: 13, lineHeight: "20px", color: MUTED_COLOR2 }, children: "Explore authentication, API references and integration guides." })
|
|
17110
17393
|
] }),
|
|
17111
|
-
/* @__PURE__ */ (0,
|
|
17394
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 6, fontSize: 13, whiteSpace: "nowrap" }, children: [
|
|
17112
17395
|
"View docs ",
|
|
17113
|
-
/* @__PURE__ */ (0,
|
|
17396
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons18.SiconExternalLink, { size: 16 })
|
|
17114
17397
|
] })
|
|
17115
17398
|
]
|
|
17116
17399
|
}
|
|
17117
17400
|
),
|
|
17118
|
-
/* @__PURE__ */ (0,
|
|
17401
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17119
17402
|
TokensContent,
|
|
17120
17403
|
{
|
|
17121
17404
|
embedded: true,
|
|
@@ -17132,7 +17415,7 @@ function SettingsContentInner({
|
|
|
17132
17415
|
] })
|
|
17133
17416
|
}
|
|
17134
17417
|
),
|
|
17135
|
-
/* @__PURE__ */ (0,
|
|
17418
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17136
17419
|
WorkspaceModal,
|
|
17137
17420
|
{
|
|
17138
17421
|
open: wsModalOpen,
|
|
@@ -17151,7 +17434,7 @@ function SettingsContentInner({
|
|
|
17151
17434
|
}
|
|
17152
17435
|
}
|
|
17153
17436
|
),
|
|
17154
|
-
/* @__PURE__ */ (0,
|
|
17437
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17155
17438
|
ConfirmLeaveModal,
|
|
17156
17439
|
{
|
|
17157
17440
|
open: confirmLeaveOpen,
|
|
@@ -17184,7 +17467,7 @@ function SettingsContentInner({
|
|
|
17184
17467
|
}
|
|
17185
17468
|
}
|
|
17186
17469
|
),
|
|
17187
|
-
/* @__PURE__ */ (0,
|
|
17470
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17188
17471
|
ConfirmDeleteModal,
|
|
17189
17472
|
{
|
|
17190
17473
|
open: confirmDeleteOpen,
|
|
@@ -17214,10 +17497,10 @@ function SettingsContentInner({
|
|
|
17214
17497
|
}
|
|
17215
17498
|
|
|
17216
17499
|
// src/workspace-picker.tsx
|
|
17217
|
-
var
|
|
17218
|
-
var
|
|
17500
|
+
var import_react29 = require("react");
|
|
17501
|
+
var import_ui26 = require("@streamoid/ui");
|
|
17219
17502
|
var import_icons19 = require("@streamoid/icons");
|
|
17220
|
-
var
|
|
17503
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
17221
17504
|
var T19 = {
|
|
17222
17505
|
primary: "var(--alias-text---icons-primary)",
|
|
17223
17506
|
muted: "var(--alias-text---icons-muted)",
|
|
@@ -17258,14 +17541,14 @@ function WorkspacePicker({
|
|
|
17258
17541
|
}
|
|
17259
17542
|
];
|
|
17260
17543
|
const grouped = !!groups && sections.length > 1;
|
|
17261
|
-
const [selected, setSelected] = (0,
|
|
17262
|
-
const [collapsed, setCollapsed] = (0,
|
|
17263
|
-
const [creating, setCreating] = (0,
|
|
17264
|
-
const [name, setName] = (0,
|
|
17265
|
-
const [visibility, setVisibility] = (0,
|
|
17544
|
+
const [selected, setSelected] = (0, import_react29.useState)(/* @__PURE__ */ new Set());
|
|
17545
|
+
const [collapsed, setCollapsed] = (0, import_react29.useState)(/* @__PURE__ */ new Set());
|
|
17546
|
+
const [creating, setCreating] = (0, import_react29.useState)(false);
|
|
17547
|
+
const [name, setName] = (0, import_react29.useState)("");
|
|
17548
|
+
const [visibility, setVisibility] = (0, import_react29.useState)("shared");
|
|
17266
17549
|
const creatable = onCreate ? sections.filter((s) => s.canCreate) : [];
|
|
17267
|
-
const [createOrgId, setCreateOrgId] = (0,
|
|
17268
|
-
const [busy, setBusy] = (0,
|
|
17550
|
+
const [createOrgId, setCreateOrgId] = (0, import_react29.useState)("");
|
|
17551
|
+
const [busy, setBusy] = (0, import_react29.useState)(false);
|
|
17269
17552
|
const total = sections.reduce((n, s) => n + s.workspaces.length, 0);
|
|
17270
17553
|
const hasWorkspaces = total > 0;
|
|
17271
17554
|
const canCreate = creatable.length > 0;
|
|
@@ -17300,7 +17583,7 @@ function WorkspacePicker({
|
|
|
17300
17583
|
);
|
|
17301
17584
|
const workspaceRow = (workspace, first) => {
|
|
17302
17585
|
const checked = selected.has(workspace._id);
|
|
17303
|
-
return /* @__PURE__ */ (0,
|
|
17586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
17304
17587
|
"div",
|
|
17305
17588
|
{
|
|
17306
17589
|
role: "checkbox",
|
|
@@ -17321,8 +17604,8 @@ function WorkspacePicker({
|
|
|
17321
17604
|
}
|
|
17322
17605
|
},
|
|
17323
17606
|
children: [
|
|
17324
|
-
/* @__PURE__ */ (0,
|
|
17325
|
-
/* @__PURE__ */ (0,
|
|
17607
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_ui26.ScCheckbox, { checked }),
|
|
17608
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17326
17609
|
ProfileAvatar,
|
|
17327
17610
|
{
|
|
17328
17611
|
name: workspace.name,
|
|
@@ -17331,8 +17614,8 @@ function WorkspacePicker({
|
|
|
17331
17614
|
borderRadius: T19.rLg
|
|
17332
17615
|
}
|
|
17333
17616
|
),
|
|
17334
|
-
/* @__PURE__ */ (0,
|
|
17335
|
-
/* @__PURE__ */ (0,
|
|
17617
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col min-w-0", children: [
|
|
17618
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17336
17619
|
"span",
|
|
17337
17620
|
{
|
|
17338
17621
|
className: "truncate",
|
|
@@ -17340,7 +17623,7 @@ function WorkspacePicker({
|
|
|
17340
17623
|
children: workspace.name
|
|
17341
17624
|
}
|
|
17342
17625
|
),
|
|
17343
|
-
workspace.ownerName && /* @__PURE__ */ (0,
|
|
17626
|
+
workspace.ownerName && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
17344
17627
|
"span",
|
|
17345
17628
|
{
|
|
17346
17629
|
className: "truncate",
|
|
@@ -17361,8 +17644,8 @@ function WorkspacePicker({
|
|
|
17361
17644
|
const isCollapsed = collapsed.has(section.organizationId);
|
|
17362
17645
|
const picked = section.workspaces.filter((w) => selected.has(w._id)).length;
|
|
17363
17646
|
const Chevron = isCollapsed ? import_icons19.SiconChevronRight : import_icons19.SiconChevronDown;
|
|
17364
|
-
return /* @__PURE__ */ (0,
|
|
17365
|
-
/* @__PURE__ */ (0,
|
|
17647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col w-full", children: [
|
|
17648
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
17366
17649
|
"div",
|
|
17367
17650
|
{
|
|
17368
17651
|
role: "button",
|
|
@@ -17386,8 +17669,8 @@ function WorkspacePicker({
|
|
|
17386
17669
|
}
|
|
17387
17670
|
},
|
|
17388
17671
|
children: [
|
|
17389
|
-
/* @__PURE__ */ (0,
|
|
17390
|
-
/* @__PURE__ */ (0,
|
|
17672
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Chevron, { className: "w-4 h-4", color: T19.muted }),
|
|
17673
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17391
17674
|
ProfileAvatar,
|
|
17392
17675
|
{
|
|
17393
17676
|
name: section.organizationName,
|
|
@@ -17396,7 +17679,7 @@ function WorkspacePicker({
|
|
|
17396
17679
|
borderRadius: T19.rLg
|
|
17397
17680
|
}
|
|
17398
17681
|
),
|
|
17399
|
-
/* @__PURE__ */ (0,
|
|
17682
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17400
17683
|
"span",
|
|
17401
17684
|
{
|
|
17402
17685
|
className: "truncate flex-1 min-w-0",
|
|
@@ -17404,11 +17687,11 @@ function WorkspacePicker({
|
|
|
17404
17687
|
children: section.organizationName
|
|
17405
17688
|
}
|
|
17406
17689
|
),
|
|
17407
|
-
/* @__PURE__ */ (0,
|
|
17690
|
+
/* @__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"}` })
|
|
17408
17691
|
]
|
|
17409
17692
|
}
|
|
17410
17693
|
),
|
|
17411
|
-
!isCollapsed && (section.workspaces.length ? section.workspaces.map((w) => workspaceRow(w, false)) : /* @__PURE__ */ (0,
|
|
17694
|
+
!isCollapsed && (section.workspaces.length ? section.workspaces.map((w) => workspaceRow(w, false)) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17412
17695
|
"div",
|
|
17413
17696
|
{
|
|
17414
17697
|
style: {
|
|
@@ -17423,14 +17706,14 @@ function WorkspacePicker({
|
|
|
17423
17706
|
))
|
|
17424
17707
|
] }, section.organizationId);
|
|
17425
17708
|
};
|
|
17426
|
-
return /* @__PURE__ */ (0,
|
|
17709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
17427
17710
|
"div",
|
|
17428
17711
|
{
|
|
17429
17712
|
className: "flex flex-col w-full",
|
|
17430
17713
|
style: { maxWidth: 520, gap: T19.sp5xl, fontFamily: T19.font },
|
|
17431
17714
|
children: [
|
|
17432
|
-
/* @__PURE__ */ (0,
|
|
17433
|
-
/* @__PURE__ */ (0,
|
|
17715
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col", style: { gap: T19.spMd }, children: [
|
|
17716
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17434
17717
|
"p",
|
|
17435
17718
|
{
|
|
17436
17719
|
style: {
|
|
@@ -17443,9 +17726,9 @@ function WorkspacePicker({
|
|
|
17443
17726
|
children: "Choose your workspaces"
|
|
17444
17727
|
}
|
|
17445
17728
|
),
|
|
17446
|
-
/* @__PURE__ */ (0,
|
|
17729
|
+
/* @__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.` })
|
|
17447
17730
|
] }),
|
|
17448
|
-
(loading || hasWorkspaces) && /* @__PURE__ */ (0,
|
|
17731
|
+
(loading || hasWorkspaces) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17449
17732
|
"div",
|
|
17450
17733
|
{
|
|
17451
17734
|
className: "flex flex-col w-full overflow-y-auto",
|
|
@@ -17455,7 +17738,7 @@ function WorkspacePicker({
|
|
|
17455
17738
|
border: `1px solid ${T19.borderSubtle}`,
|
|
17456
17739
|
borderRadius: T19.r3xl
|
|
17457
17740
|
},
|
|
17458
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
17741
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17459
17742
|
"div",
|
|
17460
17743
|
{
|
|
17461
17744
|
className: "flex items-center justify-center",
|
|
@@ -17465,9 +17748,9 @@ function WorkspacePicker({
|
|
|
17465
17748
|
) : grouped ? sections.map(groupSection) : sections[0].workspaces.map((w, index) => workspaceRow(w, index === 0))
|
|
17466
17749
|
}
|
|
17467
17750
|
),
|
|
17468
|
-
showCreate ? /* @__PURE__ */ (0,
|
|
17469
|
-
creatable.length > 1 && /* @__PURE__ */ (0,
|
|
17470
|
-
/* @__PURE__ */ (0,
|
|
17751
|
+
showCreate ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T19.spMd }, children: [
|
|
17752
|
+
creatable.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
17753
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17471
17754
|
"label",
|
|
17472
17755
|
{
|
|
17473
17756
|
htmlFor: "workspace-picker-organization",
|
|
@@ -17475,7 +17758,7 @@ function WorkspacePicker({
|
|
|
17475
17758
|
children: "Organization"
|
|
17476
17759
|
}
|
|
17477
17760
|
),
|
|
17478
|
-
/* @__PURE__ */ (0,
|
|
17761
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17479
17762
|
"select",
|
|
17480
17763
|
{
|
|
17481
17764
|
id: "workspace-picker-organization",
|
|
@@ -17492,11 +17775,11 @@ function WorkspacePicker({
|
|
|
17492
17775
|
fontFamily: T19.font,
|
|
17493
17776
|
fontSize: T19.fsSm
|
|
17494
17777
|
},
|
|
17495
|
-
children: creatable.map((s) => /* @__PURE__ */ (0,
|
|
17778
|
+
children: creatable.map((s) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("option", { value: s.organizationId, children: s.organizationName }, s.organizationId))
|
|
17496
17779
|
}
|
|
17497
17780
|
)
|
|
17498
17781
|
] }),
|
|
17499
|
-
/* @__PURE__ */ (0,
|
|
17782
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17500
17783
|
"label",
|
|
17501
17784
|
{
|
|
17502
17785
|
htmlFor: "workspace-picker-name",
|
|
@@ -17504,7 +17787,7 @@ function WorkspacePicker({
|
|
|
17504
17787
|
children: "New workspace name"
|
|
17505
17788
|
}
|
|
17506
17789
|
),
|
|
17507
|
-
/* @__PURE__ */ (0,
|
|
17790
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17508
17791
|
"input",
|
|
17509
17792
|
{
|
|
17510
17793
|
id: "workspace-picker-name",
|
|
@@ -17528,12 +17811,12 @@ function WorkspacePicker({
|
|
|
17528
17811
|
}
|
|
17529
17812
|
}
|
|
17530
17813
|
),
|
|
17531
|
-
/* @__PURE__ */ (0,
|
|
17814
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { role: "radiogroup", className: "flex w-full", style: { gap: T19.spMd }, children: [
|
|
17532
17815
|
["shared", "Shared", `Anyone in ${createLabel} can join`],
|
|
17533
17816
|
["private", "Private", "Invite only"]
|
|
17534
17817
|
].map(([value, label, hint]) => {
|
|
17535
17818
|
const active = visibility === value;
|
|
17536
|
-
return /* @__PURE__ */ (0,
|
|
17819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
17537
17820
|
"div",
|
|
17538
17821
|
{
|
|
17539
17822
|
role: "radio",
|
|
@@ -17554,7 +17837,7 @@ function WorkspacePicker({
|
|
|
17554
17837
|
border: `1px solid ${active ? T19.primary : T19.borderSubtle}`
|
|
17555
17838
|
},
|
|
17556
17839
|
children: [
|
|
17557
|
-
/* @__PURE__ */ (0,
|
|
17840
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17558
17841
|
"span",
|
|
17559
17842
|
{
|
|
17560
17843
|
style: {
|
|
@@ -17566,15 +17849,15 @@ function WorkspacePicker({
|
|
|
17566
17849
|
children: label
|
|
17567
17850
|
}
|
|
17568
17851
|
),
|
|
17569
|
-
/* @__PURE__ */ (0,
|
|
17852
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { style: { color: T19.muted, fontSize: T19.fsXs, lineHeight: T19.lhXs }, children: hint })
|
|
17570
17853
|
]
|
|
17571
17854
|
},
|
|
17572
17855
|
value
|
|
17573
17856
|
);
|
|
17574
17857
|
}) }),
|
|
17575
|
-
/* @__PURE__ */ (0,
|
|
17576
|
-
hasWorkspaces && /* @__PURE__ */ (0,
|
|
17577
|
-
|
|
17858
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-end w-full", style: { gap: T19.spMd }, children: [
|
|
17859
|
+
hasWorkspaces && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17860
|
+
import_ui26.ScButton,
|
|
17578
17861
|
{
|
|
17579
17862
|
text: "Back",
|
|
17580
17863
|
variant: "tertiary",
|
|
@@ -17582,8 +17865,8 @@ function WorkspacePicker({
|
|
|
17582
17865
|
onClick: () => setCreating(false)
|
|
17583
17866
|
}
|
|
17584
17867
|
),
|
|
17585
|
-
/* @__PURE__ */ (0,
|
|
17586
|
-
|
|
17868
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17869
|
+
import_ui26.ScButton,
|
|
17587
17870
|
{
|
|
17588
17871
|
text: busy ? "Creating\u2026" : "Create workspace",
|
|
17589
17872
|
variant: "primary",
|
|
@@ -17593,9 +17876,9 @@ function WorkspacePicker({
|
|
|
17593
17876
|
}
|
|
17594
17877
|
)
|
|
17595
17878
|
] })
|
|
17596
|
-
] }) : !loading && !hasWorkspaces ? null : /* @__PURE__ */ (0,
|
|
17597
|
-
canCreate ? /* @__PURE__ */ (0,
|
|
17598
|
-
|
|
17879
|
+
] }) : !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: [
|
|
17880
|
+
canCreate ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17881
|
+
import_ui26.ScButton,
|
|
17599
17882
|
{
|
|
17600
17883
|
text: "Create a workspace",
|
|
17601
17884
|
variant: "tertiary",
|
|
@@ -17603,9 +17886,9 @@ function WorkspacePicker({
|
|
|
17603
17886
|
state: loading || busy ? "disabled" : "default",
|
|
17604
17887
|
onClick: loading || busy ? void 0 : () => setCreating(true)
|
|
17605
17888
|
}
|
|
17606
|
-
) : /* @__PURE__ */ (0,
|
|
17607
|
-
/* @__PURE__ */ (0,
|
|
17608
|
-
|
|
17889
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", {}),
|
|
17890
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17891
|
+
import_ui26.ScButton,
|
|
17609
17892
|
{
|
|
17610
17893
|
text: busy ? "Joining\u2026" : selected.size > 1 ? `Join ${selected.size} workspaces` : "Join workspace",
|
|
17611
17894
|
variant: "primary",
|
|
@@ -17621,9 +17904,9 @@ function WorkspacePicker({
|
|
|
17621
17904
|
}
|
|
17622
17905
|
|
|
17623
17906
|
// src/organization-picker.tsx
|
|
17624
|
-
var
|
|
17625
|
-
var
|
|
17626
|
-
var
|
|
17907
|
+
var import_react30 = require("react");
|
|
17908
|
+
var import_ui27 = require("@streamoid/ui");
|
|
17909
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
17627
17910
|
var T20 = {
|
|
17628
17911
|
primary: "var(--alias-text---icons-primary)",
|
|
17629
17912
|
muted: "var(--alias-text---icons-muted)",
|
|
@@ -17657,17 +17940,17 @@ function OrganizationPicker({
|
|
|
17657
17940
|
onJoin,
|
|
17658
17941
|
onCreate
|
|
17659
17942
|
}) {
|
|
17660
|
-
const [selected, setSelected] = (0,
|
|
17943
|
+
const [selected, setSelected] = (0, import_react30.useState)(/* @__PURE__ */ new Set());
|
|
17661
17944
|
const toggle = (id) => setSelected((prev) => {
|
|
17662
17945
|
const next = new Set(prev);
|
|
17663
17946
|
if (next.has(id)) next.delete(id);
|
|
17664
17947
|
else next.add(id);
|
|
17665
17948
|
return next;
|
|
17666
17949
|
});
|
|
17667
|
-
const [name, setName] = (0,
|
|
17668
|
-
const [type, setType] = (0,
|
|
17669
|
-
const [busy, setBusy] = (0,
|
|
17670
|
-
(0,
|
|
17950
|
+
const [name, setName] = (0, import_react30.useState)(suggestedName);
|
|
17951
|
+
const [type, setType] = (0, import_react30.useState)("shared");
|
|
17952
|
+
const [busy, setBusy] = (0, import_react30.useState)(false);
|
|
17953
|
+
(0, import_react30.useEffect)(() => {
|
|
17671
17954
|
setName((current) => current || suggestedName);
|
|
17672
17955
|
}, [suggestedName]);
|
|
17673
17956
|
const choosing = organizations.length > 0;
|
|
@@ -17683,18 +17966,18 @@ function OrganizationPicker({
|
|
|
17683
17966
|
const heading = choosing ? "Choose your organization" : "Create your organization";
|
|
17684
17967
|
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.`;
|
|
17685
17968
|
const textStyle = { margin: 0, fontFamily: T20.font };
|
|
17686
|
-
return /* @__PURE__ */ (0,
|
|
17969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
17687
17970
|
"div",
|
|
17688
17971
|
{
|
|
17689
17972
|
className: "flex flex-col w-full",
|
|
17690
17973
|
style: { maxWidth: 520, gap: T20.sp5xl, fontFamily: T20.font },
|
|
17691
17974
|
children: [
|
|
17692
|
-
/* @__PURE__ */ (0,
|
|
17693
|
-
/* @__PURE__ */ (0,
|
|
17694
|
-
/* @__PURE__ */ (0,
|
|
17975
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col", style: { gap: T20.spMd }, children: [
|
|
17976
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { style: { ...textStyle, color: T20.primary, fontSize: T20.fsXl, fontWeight: 600, lineHeight: T20.lhXl }, children: heading }),
|
|
17977
|
+
/* @__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 })
|
|
17695
17978
|
] }),
|
|
17696
|
-
!loading && choosing && /* @__PURE__ */ (0,
|
|
17697
|
-
/* @__PURE__ */ (0,
|
|
17979
|
+
!loading && choosing && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
17980
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
17698
17981
|
"div",
|
|
17699
17982
|
{
|
|
17700
17983
|
role: "group",
|
|
@@ -17707,7 +17990,7 @@ function OrganizationPicker({
|
|
|
17707
17990
|
},
|
|
17708
17991
|
children: organizations.map((org, index) => {
|
|
17709
17992
|
const checked = selected.has(org._id);
|
|
17710
|
-
return /* @__PURE__ */ (0,
|
|
17993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
17711
17994
|
"div",
|
|
17712
17995
|
{
|
|
17713
17996
|
role: "checkbox",
|
|
@@ -17728,11 +18011,11 @@ function OrganizationPicker({
|
|
|
17728
18011
|
}
|
|
17729
18012
|
},
|
|
17730
18013
|
children: [
|
|
17731
|
-
/* @__PURE__ */ (0,
|
|
17732
|
-
/* @__PURE__ */ (0,
|
|
17733
|
-
/* @__PURE__ */ (0,
|
|
17734
|
-
/* @__PURE__ */ (0,
|
|
17735
|
-
org.domain && /* @__PURE__ */ (0,
|
|
18014
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_ui27.ScCheckbox, { checked }),
|
|
18015
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ProfileAvatar, { name: org.name, profileImage: org.imageUrl, size: 32, borderRadius: T20.rLg }),
|
|
18016
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col min-w-0", children: [
|
|
18017
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "truncate", style: { color: T20.primary, fontSize: T20.fsSm, fontWeight: 500, lineHeight: T20.lhSm }, children: org.name }),
|
|
18018
|
+
org.domain && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "truncate", style: { color: T20.muted, fontSize: T20.fsXs, lineHeight: T20.lhXs }, children: org.domain })
|
|
17736
18019
|
] })
|
|
17737
18020
|
]
|
|
17738
18021
|
},
|
|
@@ -17741,8 +18024,8 @@ function OrganizationPicker({
|
|
|
17741
18024
|
})
|
|
17742
18025
|
}
|
|
17743
18026
|
),
|
|
17744
|
-
/* @__PURE__ */ (0,
|
|
17745
|
-
|
|
18027
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
18028
|
+
import_ui27.ScButton,
|
|
17746
18029
|
{
|
|
17747
18030
|
text: busy ? "Joining\u2026" : selected.size > 1 ? `Join ${selected.size} organizations` : "Join organization",
|
|
17748
18031
|
variant: "primary",
|
|
@@ -17752,10 +18035,10 @@ function OrganizationPicker({
|
|
|
17752
18035
|
}
|
|
17753
18036
|
) })
|
|
17754
18037
|
] }),
|
|
17755
|
-
!loading && !choosing && /* @__PURE__ */ (0,
|
|
17756
|
-
/* @__PURE__ */ (0,
|
|
17757
|
-
/* @__PURE__ */ (0,
|
|
17758
|
-
/* @__PURE__ */ (0,
|
|
18038
|
+
!loading && !choosing && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T20.sp3xl }, children: [
|
|
18039
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T20.spMd }, children: [
|
|
18040
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("label", { htmlFor: "organization-picker-name", style: { color: T20.tertiary, fontSize: T20.fsSm, lineHeight: T20.lhSm }, children: "Organization name" }),
|
|
18041
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
17759
18042
|
"input",
|
|
17760
18043
|
{
|
|
17761
18044
|
id: "organization-picker-name",
|
|
@@ -17777,14 +18060,14 @@ function OrganizationPicker({
|
|
|
17777
18060
|
}
|
|
17778
18061
|
)
|
|
17779
18062
|
] }),
|
|
17780
|
-
!publicDomain && /* @__PURE__ */ (0,
|
|
17781
|
-
/* @__PURE__ */ (0,
|
|
17782
|
-
/* @__PURE__ */ (0,
|
|
18063
|
+
!publicDomain && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T20.spMd }, children: [
|
|
18064
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { style: { color: T20.tertiary, fontSize: T20.fsSm, lineHeight: T20.lhSm }, children: "Who can join" }),
|
|
18065
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { role: "radiogroup", className: "flex w-full", style: { gap: T20.spMd }, children: [
|
|
17783
18066
|
["shared", "Shared"],
|
|
17784
18067
|
["private", "Private"]
|
|
17785
18068
|
].map(([value, label]) => {
|
|
17786
18069
|
const active = type === value;
|
|
17787
|
-
return /* @__PURE__ */ (0,
|
|
18070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
17788
18071
|
"div",
|
|
17789
18072
|
{
|
|
17790
18073
|
role: "radio",
|
|
@@ -17803,12 +18086,12 @@ function OrganizationPicker({
|
|
|
17803
18086
|
borderRadius: T20.r3xl,
|
|
17804
18087
|
border: `1px solid ${active ? T20.primary : T20.borderSubtle}`
|
|
17805
18088
|
},
|
|
17806
|
-
children: /* @__PURE__ */ (0,
|
|
18089
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { style: { color: T20.primary, fontSize: T20.fsSm, lineHeight: T20.lhSm, fontWeight: active ? 600 : 400 }, children: label })
|
|
17807
18090
|
},
|
|
17808
18091
|
value
|
|
17809
18092
|
);
|
|
17810
18093
|
}) }),
|
|
17811
|
-
/* @__PURE__ */ (0,
|
|
18094
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
17812
18095
|
"span",
|
|
17813
18096
|
{
|
|
17814
18097
|
"data-testid": "organization-visibility-message",
|
|
@@ -17818,8 +18101,8 @@ function OrganizationPicker({
|
|
|
17818
18101
|
}
|
|
17819
18102
|
)
|
|
17820
18103
|
] }),
|
|
17821
|
-
/* @__PURE__ */ (0,
|
|
17822
|
-
|
|
18104
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
18105
|
+
import_ui27.ScButton,
|
|
17823
18106
|
{
|
|
17824
18107
|
text: busy ? "Creating\u2026" : "Create organization",
|
|
17825
18108
|
variant: "primary",
|
|
@@ -17835,13 +18118,13 @@ function OrganizationPicker({
|
|
|
17835
18118
|
}
|
|
17836
18119
|
|
|
17837
18120
|
// src/use-billing-entitlement.ts
|
|
17838
|
-
var
|
|
18121
|
+
var import_react31 = require("react");
|
|
17839
18122
|
function useBillingEntitlement(fetchCurrentPlan, key) {
|
|
17840
|
-
const fetchRef = (0,
|
|
18123
|
+
const fetchRef = (0, import_react31.useRef)(fetchCurrentPlan);
|
|
17841
18124
|
fetchRef.current = fetchCurrentPlan;
|
|
17842
|
-
const [state, setState] = (0,
|
|
17843
|
-
const [loading, setLoading] = (0,
|
|
17844
|
-
(0,
|
|
18125
|
+
const [state, setState] = (0, import_react31.useState)(null);
|
|
18126
|
+
const [loading, setLoading] = (0, import_react31.useState)(false);
|
|
18127
|
+
(0, import_react31.useEffect)(() => {
|
|
17845
18128
|
const fetch2 = fetchRef.current;
|
|
17846
18129
|
setState(null);
|
|
17847
18130
|
if (!key || !fetch2) {
|
|
@@ -17904,7 +18187,7 @@ function readSettingsCaller(base, state, entryKey, fallback = `${normalizedBase(
|
|
|
17904
18187
|
}
|
|
17905
18188
|
|
|
17906
18189
|
// src/app-settings-page.tsx
|
|
17907
|
-
var
|
|
18190
|
+
var import_react32 = require("react");
|
|
17908
18191
|
var import_icons20 = require("@streamoid/icons");
|
|
17909
18192
|
|
|
17910
18193
|
// src/app-settings-page.module.css
|
|
@@ -17926,18 +18209,18 @@ var app_settings_page_default = {
|
|
|
17926
18209
|
};
|
|
17927
18210
|
|
|
17928
18211
|
// src/app-settings-page.tsx
|
|
17929
|
-
var
|
|
18212
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
17930
18213
|
function AppSettingsHeader({ administrationHref, onOpenAdministration, onClose }) {
|
|
17931
|
-
return /* @__PURE__ */ (0,
|
|
17932
|
-
/* @__PURE__ */ (0,
|
|
17933
|
-
/* @__PURE__ */ (0,
|
|
17934
|
-
/* @__PURE__ */ (0,
|
|
18214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("header", { className: app_settings_page_default.header, children: [
|
|
18215
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { children: "App settings" }),
|
|
18216
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: app_settings_page_default.actions, children: [
|
|
18217
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("a", { href: administrationHref, onClick: (event) => {
|
|
17935
18218
|
if (onOpenAdministration && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey && event.button === 0) {
|
|
17936
18219
|
event.preventDefault();
|
|
17937
18220
|
onOpenAdministration();
|
|
17938
18221
|
}
|
|
17939
18222
|
}, children: "Account and workspace settings" }),
|
|
17940
|
-
onClose ? /* @__PURE__ */ (0,
|
|
18223
|
+
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
|
|
17941
18224
|
] })
|
|
17942
18225
|
] });
|
|
17943
18226
|
}
|
|
@@ -17949,43 +18232,43 @@ function AppSettingsPage({
|
|
|
17949
18232
|
emptyDescription = "Account, workspace and organization settings are available above.",
|
|
17950
18233
|
children
|
|
17951
18234
|
}) {
|
|
17952
|
-
return /* @__PURE__ */ (0,
|
|
17953
|
-
/* @__PURE__ */ (0,
|
|
17954
|
-
children ?? /* @__PURE__ */ (0,
|
|
17955
|
-
/* @__PURE__ */ (0,
|
|
17956
|
-
/* @__PURE__ */ (0,
|
|
18235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: app_settings_page_default.page, children: [
|
|
18236
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(AppSettingsHeader, { administrationHref, onOpenAdministration, onClose }),
|
|
18237
|
+
children ?? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: app_settings_page_default.empty, "aria-label": "App settings empty state", children: [
|
|
18238
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { children: emptyTitle }),
|
|
18239
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: emptyDescription })
|
|
17957
18240
|
] })
|
|
17958
18241
|
] });
|
|
17959
18242
|
}
|
|
17960
18243
|
function AppSettingsSection({ title, action, children }) {
|
|
17961
|
-
return /* @__PURE__ */ (0,
|
|
17962
|
-
/* @__PURE__ */ (0,
|
|
17963
|
-
/* @__PURE__ */ (0,
|
|
17964
|
-
action ? /* @__PURE__ */ (0,
|
|
18244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: app_settings_page_default.section, "aria-label": title, children: [
|
|
18245
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: app_settings_page_default.sectionHeader, children: [
|
|
18246
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { children: title }),
|
|
18247
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: app_settings_page_default.sectionAction, children: action }) : null
|
|
17965
18248
|
] }),
|
|
17966
|
-
/* @__PURE__ */ (0,
|
|
18249
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children })
|
|
17967
18250
|
] });
|
|
17968
18251
|
}
|
|
17969
18252
|
function AppSettingsRow({ title, description, summary, href, onClick, disabled, disabledReason, ariaLabel, trailing }) {
|
|
17970
|
-
const reasonId = (0,
|
|
17971
|
-
const content = /* @__PURE__ */ (0,
|
|
17972
|
-
/* @__PURE__ */ (0,
|
|
17973
|
-
/* @__PURE__ */ (0,
|
|
17974
|
-
description ? /* @__PURE__ */ (0,
|
|
18253
|
+
const reasonId = (0, import_react32.useId)();
|
|
18254
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
18255
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: app_settings_page_default.rowCopy, children: [
|
|
18256
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: app_settings_page_default.rowTitle, children: title }),
|
|
18257
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: app_settings_page_default.rowDescription, children: description }) : null
|
|
17975
18258
|
] }),
|
|
17976
|
-
summary || trailing || href || onClick ? /* @__PURE__ */ (0,
|
|
18259
|
+
summary || trailing || href || onClick ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: app_settings_page_default.rowEnd, children: [
|
|
17977
18260
|
summary,
|
|
17978
|
-
trailing ?? (!disabled && (href || onClick) ? /* @__PURE__ */ (0,
|
|
18261
|
+
trailing ?? (!disabled && (href || onClick) ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons20.SiconArrowRight, { size: 18, "aria-hidden": "true" }) : null)
|
|
17979
18262
|
] }) : null,
|
|
17980
|
-
disabledReason ? /* @__PURE__ */ (0,
|
|
18263
|
+
disabledReason ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: app_settings_page_default.srOnly, id: reasonId, children: disabledReason }) : null
|
|
17981
18264
|
] });
|
|
17982
18265
|
const props = { className: app_settings_page_default.row, "aria-label": ariaLabel, "aria-describedby": disabledReason ? reasonId : void 0 };
|
|
17983
|
-
if (href && !disabled) return /* @__PURE__ */ (0,
|
|
18266
|
+
if (href && !disabled) return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("a", { ...props, href, onClick: (event) => {
|
|
17984
18267
|
if (onClick && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey && event.button === 0) {
|
|
17985
18268
|
event.preventDefault();
|
|
17986
18269
|
onClick();
|
|
17987
18270
|
}
|
|
17988
18271
|
}, children: content });
|
|
17989
|
-
if (onClick || disabled) return /* @__PURE__ */ (0,
|
|
17990
|
-
return /* @__PURE__ */ (0,
|
|
18272
|
+
if (onClick || disabled) return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { ...props, type: "button", disabled, onClick, children: content });
|
|
18273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { ...props, children: content });
|
|
17991
18274
|
}
|