@authowl/react 0.21.1 → 0.21.2
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.cjs
CHANGED
|
@@ -236,11 +236,12 @@ function useAccount() {
|
|
|
236
236
|
return useAuthClient().account;
|
|
237
237
|
}
|
|
238
238
|
function usePublicConfig() {
|
|
239
|
-
const { config, configState } = useAuthOwlContext();
|
|
239
|
+
const { config, configState, retryPublicConfig } = useAuthOwlContext();
|
|
240
240
|
return {
|
|
241
241
|
config,
|
|
242
242
|
isLoading: configState === "loading",
|
|
243
|
-
isError: configState === "error"
|
|
243
|
+
isError: configState === "error",
|
|
244
|
+
retry: retryPublicConfig
|
|
244
245
|
};
|
|
245
246
|
}
|
|
246
247
|
function useSession() {
|
|
@@ -748,7 +749,7 @@ function warnPublicConfigFailed(resolved, error) {
|
|
|
748
749
|
warnedConfigProjects.add(key);
|
|
749
750
|
const reason = error instanceof Error ? error.message : String(error);
|
|
750
751
|
console.warn(
|
|
751
|
-
`[AuthOwl] Could not load this project's public config from ${origin} (${reason}).
|
|
752
|
+
`[AuthOwl] Could not load this project's public config from ${origin} (${reason}). Authentication UI is unavailable until the request succeeds. Likely causes: the API is unreachable, \`apiUrl\` is wrong, or the publishable key points at a missing/mismatched project. Check \`apiUrl\` and \`publishableKey\` on <AuthOwlProvider>. (This warning is dev-only.)`
|
|
752
753
|
);
|
|
753
754
|
}
|
|
754
755
|
function detectLocale() {
|
|
@@ -784,6 +785,8 @@ function AuthOwlProvider({
|
|
|
784
785
|
const client = React5.useMemo(() => (0, import_core2.createAuthOwlClient)(resolved), [resolved]);
|
|
785
786
|
const [config, setConfig] = React5.useState(null);
|
|
786
787
|
const [configState, setConfigState] = React5.useState("loading");
|
|
788
|
+
const [configAttempt, setConfigAttempt] = React5.useState(0);
|
|
789
|
+
const retryPublicConfig = React5.useCallback(() => setConfigAttempt((attempt) => attempt + 1), []);
|
|
787
790
|
React5.useEffect(() => {
|
|
788
791
|
let active = true;
|
|
789
792
|
setConfigState("loading");
|
|
@@ -800,7 +803,7 @@ function AuthOwlProvider({
|
|
|
800
803
|
return () => {
|
|
801
804
|
active = false;
|
|
802
805
|
};
|
|
803
|
-
}, [resolved]);
|
|
806
|
+
}, [resolved, configAttempt]);
|
|
804
807
|
const merged = resolveAppearance(appearance, config);
|
|
805
808
|
const [autoLocale, setAutoLocale] = React5.useState(null);
|
|
806
809
|
React5.useEffect(() => {
|
|
@@ -811,8 +814,8 @@ function AuthOwlProvider({
|
|
|
811
814
|
(0, import_core2.captureInvitationClaim)();
|
|
812
815
|
}, []);
|
|
813
816
|
const ctxValue = React5.useMemo(
|
|
814
|
-
() => ({ client, appearance, config, configState, locale }),
|
|
815
|
-
[client, appearance, config, configState, locale]
|
|
817
|
+
() => ({ client, appearance, config, configState, retryPublicConfig, locale }),
|
|
818
|
+
[client, appearance, config, configState, retryPublicConfig, locale]
|
|
816
819
|
);
|
|
817
820
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Context.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
818
821
|
"div",
|
|
@@ -2836,34 +2839,34 @@ function TeamMembersPanel({
|
|
|
2836
2839
|
}
|
|
2837
2840
|
);
|
|
2838
2841
|
};
|
|
2839
|
-
return /* @__PURE__ */ (0,
|
|
2840
|
-
/* @__PURE__ */ (0,
|
|
2841
|
-
canAdd && availableMembers.length > 0 && members !== null && /* @__PURE__ */ (0,
|
|
2842
|
-
/* @__PURE__ */ (0,
|
|
2842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ba-organization-user-invitations", children: [
|
|
2843
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h4", { children: t("organization.profile.teams.manageMembers") }),
|
|
2844
|
+
canAdd && availableMembers.length > 0 && members !== null && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("form", { method: "post", className: "ba-organization-invite-form", onSubmit: addMember, children: [
|
|
2845
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("label", { className: "ba-label", children: [
|
|
2843
2846
|
t("organization.profile.teams.addMember"),
|
|
2844
|
-
/* @__PURE__ */ (0,
|
|
2847
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("select", { className: "ba-input", value: addableUserId, onChange: (event) => setUserId(event.target.value), children: availableMembers.map((member) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("option", { value: member.userId, children: member.user.name || member.user.email || member.userId }, member.userId)) })
|
|
2845
2848
|
] }),
|
|
2846
|
-
/* @__PURE__ */ (0,
|
|
2849
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("button", { className: "ba-button", type: "submit", disabled: pending || !addableUserId, children: t("organization.profile.teams.addMember") })
|
|
2847
2850
|
] }),
|
|
2848
|
-
/* @__PURE__ */ (0,
|
|
2849
|
-
error && /* @__PURE__ */ (0,
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
2851
|
-
/* @__PURE__ */ (0,
|
|
2851
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(FormError, { children: actionError }),
|
|
2852
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ba-inline-error", children: [
|
|
2853
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(FormError, { children: error }),
|
|
2854
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void reload(), children: t("organization.retry") })
|
|
2852
2855
|
] }),
|
|
2853
|
-
members?.length ? /* @__PURE__ */ (0,
|
|
2856
|
+
members?.length ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("ul", { className: "ba-organization-list", children: members.map((member) => {
|
|
2854
2857
|
const organizationMember = organization.members.find((entry) => entry.userId === member.userId);
|
|
2855
2858
|
const displayName = organizationMember?.user.name || member.userId;
|
|
2856
|
-
return /* @__PURE__ */ (0,
|
|
2857
|
-
/* @__PURE__ */ (0,
|
|
2858
|
-
/* @__PURE__ */ (0,
|
|
2859
|
-
organizationMember?.user.email && /* @__PURE__ */ (0,
|
|
2859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("li", { className: "ba-organization-member", children: [
|
|
2860
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "ba-organization-member-copy", children: [
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("strong", { children: displayName }),
|
|
2862
|
+
organizationMember?.user.email && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("small", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Bidi, { children: organizationMember.user.email }) })
|
|
2860
2863
|
] }),
|
|
2861
|
-
canRemove && /* @__PURE__ */ (0,
|
|
2864
|
+
canRemove && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => removeMember(member), children: t("organization.profile.teams.removeMember") })
|
|
2862
2865
|
] }, member.id);
|
|
2863
|
-
}) }) : error ? null : members === null ? /* @__PURE__ */ (0,
|
|
2866
|
+
}) }) : error ? null : members === null ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ba-skeleton", "aria-label": t("common.loading") }) : members.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "ba-muted", children: t("organization.profile.teams.membersEmpty") }) : null
|
|
2864
2867
|
] });
|
|
2865
2868
|
}
|
|
2866
|
-
var React53,
|
|
2869
|
+
var React53, import_jsx_runtime59;
|
|
2867
2870
|
var init_TeamMembersPanel = __esm({
|
|
2868
2871
|
"src/components/organization/TeamMembersPanel.tsx"() {
|
|
2869
2872
|
"use strict";
|
|
@@ -2874,7 +2877,7 @@ var init_TeamMembersPanel = __esm({
|
|
|
2874
2877
|
init_FormError();
|
|
2875
2878
|
init_use_submit_action();
|
|
2876
2879
|
init_use_team_resources();
|
|
2877
|
-
|
|
2880
|
+
import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2878
2881
|
}
|
|
2879
2882
|
});
|
|
2880
2883
|
|
|
@@ -2953,42 +2956,42 @@ function TeamsSection({
|
|
|
2953
2956
|
);
|
|
2954
2957
|
};
|
|
2955
2958
|
const selectedTeam = teams?.find((team) => team.id === selectedTeamId);
|
|
2956
|
-
return /* @__PURE__ */ (0,
|
|
2957
|
-
/* @__PURE__ */ (0,
|
|
2958
|
-
/* @__PURE__ */ (0,
|
|
2959
|
-
/* @__PURE__ */ (0,
|
|
2959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { className: "ba-organization-section", children: [
|
|
2960
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h3", { className: "ba-title", children: t("organization.profile.teams.title") }),
|
|
2962
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "ba-muted", children: t("organization.profile.teams.description") })
|
|
2960
2963
|
] }),
|
|
2961
|
-
capabilities.createTeam ? /* @__PURE__ */ (0,
|
|
2962
|
-
/* @__PURE__ */ (0,
|
|
2964
|
+
capabilities.createTeam ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("form", { method: "post", className: "ba-organization-invite-form", onSubmit: create, children: [
|
|
2965
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("label", { className: "ba-label", children: [
|
|
2963
2966
|
t("organization.profile.teams.create"),
|
|
2964
|
-
/* @__PURE__ */ (0,
|
|
2967
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { className: "ba-input", value: name, onChange: (event) => setName(event.target.value), required: true })
|
|
2965
2968
|
] }),
|
|
2966
|
-
/* @__PURE__ */ (0,
|
|
2969
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-button", type: "submit", disabled: pending || !name.trim(), "aria-busy": pending || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.teams.create") }) })
|
|
2967
2970
|
] }) : null,
|
|
2968
|
-
/* @__PURE__ */ (0,
|
|
2969
|
-
teamsError && /* @__PURE__ */ (0,
|
|
2970
|
-
/* @__PURE__ */ (0,
|
|
2971
|
-
/* @__PURE__ */ (0,
|
|
2971
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormError, { children: actionError }),
|
|
2972
|
+
teamsError && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ba-inline-error", children: [
|
|
2973
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormError, { children: teamsError }),
|
|
2974
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void reload(), children: t("organization.retry") })
|
|
2972
2975
|
] }),
|
|
2973
|
-
teams?.length ? /* @__PURE__ */ (0,
|
|
2974
|
-
/* @__PURE__ */ (0,
|
|
2975
|
-
editingTeamId === team.id ? /* @__PURE__ */ (0,
|
|
2976
|
-
/* @__PURE__ */ (0,
|
|
2976
|
+
teams?.length ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("ul", { className: "ba-organization-list", children: teams.map((team) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("li", { className: "ba-organization-member", children: [
|
|
2977
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: team.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
2978
|
+
editingTeamId === team.id ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("form", { method: "post", className: "ba-organization-invite-form", onSubmit: (event) => rename(event, team), children: [
|
|
2979
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("label", { className: "ba-label", children: [
|
|
2977
2980
|
t("organization.profile.teams.rename"),
|
|
2978
|
-
/* @__PURE__ */ (0,
|
|
2981
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { className: "ba-input", value: editingName, onChange: (event) => setEditingName(event.target.value), required: true, autoFocus: true })
|
|
2979
2982
|
] }),
|
|
2980
|
-
/* @__PURE__ */ (0,
|
|
2981
|
-
/* @__PURE__ */ (0,
|
|
2982
|
-
] }) : /* @__PURE__ */ (0,
|
|
2983
|
-
/* @__PURE__ */ (0,
|
|
2984
|
-
/* @__PURE__ */ (0,
|
|
2985
|
-
/* @__PURE__ */ (0,
|
|
2986
|
-
capabilities.updateTeam && /* @__PURE__ */ (0,
|
|
2987
|
-
capabilities.deleteTeam && /* @__PURE__ */ (0,
|
|
2983
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-button", type: "submit", disabled: pending || !editingName.trim(), children: t("organization.profile.teams.rename") }),
|
|
2984
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: () => setEditingTeamId(null), children: t("organization.profile.teams.cancel") })
|
|
2985
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
2986
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "ba-organization-member-copy", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("strong", { children: team.name }) }),
|
|
2987
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "ba-organization-member-actions", children: [
|
|
2988
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-link-button", type: "button", disabled: pending, "aria-expanded": selectedTeamId === team.id, onClick: () => setSelectedTeamId(selectedTeamId === team.id ? null : team.id), children: t("organization.profile.teams.manageMembers") }),
|
|
2989
|
+
capabilities.updateTeam && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: () => beginRename(team), children: t("organization.profile.teams.rename") }),
|
|
2990
|
+
capabilities.deleteTeam && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => remove(team), children: t("organization.profile.teams.removeTeam") })
|
|
2988
2991
|
] })
|
|
2989
2992
|
] })
|
|
2990
|
-
] }, team.id)) }) : teamsError ? null : teams === null ? /* @__PURE__ */ (0,
|
|
2991
|
-
selectedTeam && /* @__PURE__ */ (0,
|
|
2993
|
+
] }, team.id)) }) : teamsError ? null : teams === null ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "ba-skeleton", "aria-label": t("common.loading") }) : teams.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "ba-muted", children: t("organization.profile.teams.empty") }) : null,
|
|
2994
|
+
selectedTeam && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2992
2995
|
TeamMembersPanel,
|
|
2993
2996
|
{
|
|
2994
2997
|
organization,
|
|
@@ -2999,7 +3002,7 @@ function TeamsSection({
|
|
|
2999
3002
|
)
|
|
3000
3003
|
] });
|
|
3001
3004
|
}
|
|
3002
|
-
var React54,
|
|
3005
|
+
var React54, import_jsx_runtime60;
|
|
3003
3006
|
var init_TeamsSection = __esm({
|
|
3004
3007
|
"src/components/organization/TeamsSection.tsx"() {
|
|
3005
3008
|
"use strict";
|
|
@@ -3014,7 +3017,7 @@ var init_TeamsSection = __esm({
|
|
|
3014
3017
|
init_model();
|
|
3015
3018
|
init_use_organization_roles();
|
|
3016
3019
|
init_use_team_resources();
|
|
3017
|
-
|
|
3020
|
+
import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3018
3021
|
}
|
|
3019
3022
|
});
|
|
3020
3023
|
|
|
@@ -4485,8 +4488,27 @@ function InvitationBanner() {
|
|
|
4485
4488
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "ba-muted", "data-testid": "authowl-invitation-banner", children: t("organization.invitationBanner") });
|
|
4486
4489
|
}
|
|
4487
4490
|
|
|
4488
|
-
// src/components/
|
|
4491
|
+
// src/components/PublicConfigError.tsx
|
|
4492
|
+
init_hooks();
|
|
4493
|
+
init_i18n();
|
|
4489
4494
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4495
|
+
function PublicConfigError({
|
|
4496
|
+
showBadge,
|
|
4497
|
+
showBranding = true
|
|
4498
|
+
}) {
|
|
4499
|
+
const t = useT();
|
|
4500
|
+
const { retry } = usePublicConfig();
|
|
4501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "ba-form", "data-testid": "authowl-config-error", role: "alert", children: [
|
|
4502
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AuthOwlBranding, {}) : null,
|
|
4503
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { className: "ba-title", children: t("publicConfig.error.title") }),
|
|
4504
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "ba-muted", children: t("publicConfig.error.description") }),
|
|
4505
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "ba-button", type: "button", onClick: retry, children: t("publicConfig.retry") }),
|
|
4506
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AuthOwlBadge, { force: showBadge })
|
|
4507
|
+
] });
|
|
4508
|
+
}
|
|
4509
|
+
|
|
4510
|
+
// src/components/SignIn.tsx
|
|
4511
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4490
4512
|
function SignIn({
|
|
4491
4513
|
redirectTo,
|
|
4492
4514
|
onSignedIn,
|
|
@@ -4528,41 +4550,44 @@ function SignIn({
|
|
|
4528
4550
|
redirectTo,
|
|
4529
4551
|
onSignedIn
|
|
4530
4552
|
});
|
|
4531
|
-
const badge = /* @__PURE__ */ (0,
|
|
4532
|
-
const branding = showBranding ? /* @__PURE__ */ (0,
|
|
4553
|
+
const badge = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AuthOwlBadge, { force: showBadge });
|
|
4554
|
+
const branding = showBranding ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AuthOwlBranding, {}) : null;
|
|
4533
4555
|
if (isLoading) {
|
|
4534
|
-
return /* @__PURE__ */ (0,
|
|
4535
|
-
/* @__PURE__ */ (0,
|
|
4536
|
-
/* @__PURE__ */ (0,
|
|
4556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-loading", "aria-busy": "true", children: [
|
|
4557
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "ba-skeleton" }),
|
|
4558
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "ba-skeleton" })
|
|
4537
4559
|
] });
|
|
4538
4560
|
}
|
|
4561
|
+
if (isError) {
|
|
4562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PublicConfigError, { showBadge, showBranding });
|
|
4563
|
+
}
|
|
4539
4564
|
if (mfaEnrolment !== "clear") {
|
|
4540
|
-
return /* @__PURE__ */ (0,
|
|
4565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-mfa-enrolment", "aria-busy": mfaEnrolment === "confirming", children: [
|
|
4541
4566
|
branding,
|
|
4542
|
-
mfaEnrolment === "pending" ? /* @__PURE__ */ (0,
|
|
4567
|
+
mfaEnrolment === "pending" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MfaEnrollmentStep, {}) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "ba-skeleton" }),
|
|
4543
4568
|
badge
|
|
4544
4569
|
] });
|
|
4545
4570
|
}
|
|
4546
4571
|
if (challenge) {
|
|
4547
|
-
return /* @__PURE__ */ (0,
|
|
4572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-mfa", children: [
|
|
4548
4573
|
branding,
|
|
4549
|
-
/* @__PURE__ */ (0,
|
|
4574
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MFAChallenge, { onVerified: () => finishSignIn({ sessionStore, redirectTo, onSignedIn }) }),
|
|
4550
4575
|
badge
|
|
4551
4576
|
] });
|
|
4552
4577
|
}
|
|
4553
4578
|
if (view === "forgot" && resetPasswordUrl) {
|
|
4554
|
-
return /* @__PURE__ */ (0,
|
|
4579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-forgot", children: [
|
|
4555
4580
|
branding,
|
|
4556
|
-
/* @__PURE__ */ (0,
|
|
4557
|
-
/* @__PURE__ */ (0,
|
|
4581
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "ba-title", children: t("signIn.forgotTitle") }),
|
|
4582
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ForgotPassword, { resetPasswordUrl, onBack: () => setView("sign-in") }),
|
|
4558
4583
|
badge
|
|
4559
4584
|
] });
|
|
4560
4585
|
}
|
|
4561
4586
|
if (view === "otp-code") {
|
|
4562
|
-
return /* @__PURE__ */ (0,
|
|
4587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-otp-code", children: [
|
|
4563
4588
|
branding,
|
|
4564
|
-
/* @__PURE__ */ (0,
|
|
4565
|
-
/* @__PURE__ */ (0,
|
|
4589
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "ba-title", children: t("signIn.title") }),
|
|
4590
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4566
4591
|
OtpCodeForm,
|
|
4567
4592
|
{
|
|
4568
4593
|
email,
|
|
@@ -4588,18 +4613,18 @@ function SignIn({
|
|
|
4588
4613
|
] });
|
|
4589
4614
|
}
|
|
4590
4615
|
if (view === "magic-sent") {
|
|
4591
|
-
return /* @__PURE__ */ (0,
|
|
4616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-magic-sent", children: [
|
|
4592
4617
|
branding,
|
|
4593
|
-
/* @__PURE__ */ (0,
|
|
4594
|
-
/* @__PURE__ */ (0,
|
|
4595
|
-
/* @__PURE__ */ (0,
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "ba-title", children: t("signIn.title") }),
|
|
4619
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "ba-muted", children: t("magicLink.sent") }),
|
|
4620
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { type: "button", className: "ba-link-button", onClick: () => setView("sign-in"), children: t("forgotPassword.backToSignIn") }),
|
|
4596
4621
|
badge
|
|
4597
4622
|
] });
|
|
4598
4623
|
}
|
|
4599
4624
|
if (view === "phone") {
|
|
4600
|
-
return /* @__PURE__ */ (0,
|
|
4625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-phone", children: [
|
|
4601
4626
|
branding,
|
|
4602
|
-
/* @__PURE__ */ (0,
|
|
4627
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4603
4628
|
PhoneOTP,
|
|
4604
4629
|
{
|
|
4605
4630
|
redirectTo,
|
|
@@ -4676,14 +4701,13 @@ function SignIn({
|
|
|
4676
4701
|
{ key: "otp", enabled: plan.emailOtp, action: doRequestOtp, label: t("emailOtp.requestSubmit"), pendingLabel: t("common.sending") },
|
|
4677
4702
|
{ key: "sso", enabled: plan.sso, action: doSso, label: t("sso.continueWith"), pendingLabel: t("sso.redirecting") }
|
|
4678
4703
|
];
|
|
4679
|
-
return /* @__PURE__ */ (0,
|
|
4704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ba-form", "data-testid": "signin-form", children: [
|
|
4680
4705
|
branding,
|
|
4681
|
-
/* @__PURE__ */ (0,
|
|
4682
|
-
/* @__PURE__ */ (0,
|
|
4683
|
-
|
|
4684
|
-
/* @__PURE__ */ (0,
|
|
4685
|
-
|
|
4686
|
-
hasCredentialForm && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4706
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "ba-title", children: t("signIn.title") }),
|
|
4707
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(InvitationBanner, {}),
|
|
4708
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SocialButtons, { providers: plan.social, callbackURL: redirectTo }),
|
|
4709
|
+
showDivider && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "ba-divider", children: t("common.orDivider") }),
|
|
4710
|
+
hasCredentialForm && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4687
4711
|
"form",
|
|
4688
4712
|
{
|
|
4689
4713
|
method: "post",
|
|
@@ -4694,9 +4718,9 @@ function SignIn({
|
|
|
4694
4718
|
else if (plan.primary) PRIMARY_ACTION[plan.primary]();
|
|
4695
4719
|
},
|
|
4696
4720
|
children: [
|
|
4697
|
-
credentialMode === "email" ? /* @__PURE__ */ (0,
|
|
4721
|
+
credentialMode === "email" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "ba-label", children: [
|
|
4698
4722
|
t("common.emailLabel"),
|
|
4699
|
-
/* @__PURE__ */ (0,
|
|
4723
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4700
4724
|
"input",
|
|
4701
4725
|
{
|
|
4702
4726
|
ref: emailRef,
|
|
@@ -4711,9 +4735,9 @@ function SignIn({
|
|
|
4711
4735
|
required: true
|
|
4712
4736
|
}
|
|
4713
4737
|
)
|
|
4714
|
-
] }) : /* @__PURE__ */ (0,
|
|
4738
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "ba-label", children: [
|
|
4715
4739
|
t("common.usernameLabel"),
|
|
4716
|
-
/* @__PURE__ */ (0,
|
|
4740
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4717
4741
|
"input",
|
|
4718
4742
|
{
|
|
4719
4743
|
className: "ba-input",
|
|
@@ -4728,9 +4752,9 @@ function SignIn({
|
|
|
4728
4752
|
}
|
|
4729
4753
|
)
|
|
4730
4754
|
] }),
|
|
4731
|
-
plan.password && /* @__PURE__ */ (0,
|
|
4755
|
+
plan.password && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "ba-label", children: [
|
|
4732
4756
|
t("common.passwordLabel"),
|
|
4733
|
-
/* @__PURE__ */ (0,
|
|
4757
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4734
4758
|
"input",
|
|
4735
4759
|
{
|
|
4736
4760
|
className: "ba-input",
|
|
@@ -4746,19 +4770,19 @@ function SignIn({
|
|
|
4746
4770
|
)
|
|
4747
4771
|
] }),
|
|
4748
4772
|
authChallenge.control,
|
|
4749
|
-
/* @__PURE__ */ (0,
|
|
4750
|
-
plan.password && /* @__PURE__ */ (0,
|
|
4751
|
-
/* @__PURE__ */ (0,
|
|
4773
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(FormError, { children: error }),
|
|
4774
|
+
plan.password && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4775
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4752
4776
|
"button",
|
|
4753
4777
|
{
|
|
4754
4778
|
className: "ba-button",
|
|
4755
4779
|
type: "submit",
|
|
4756
4780
|
disabled: pending || authChallenge.configPending,
|
|
4757
4781
|
"aria-busy": pending && inFlight === "password" || void 0,
|
|
4758
|
-
children: /* @__PURE__ */ (0,
|
|
4782
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Busy, { busy: pending && inFlight === "password", label: t("signIn.submitPending"), children: t("signIn.submit") })
|
|
4759
4783
|
}
|
|
4760
4784
|
),
|
|
4761
|
-
resetPasswordUrl && /* @__PURE__ */ (0,
|
|
4785
|
+
resetPasswordUrl && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4762
4786
|
"button",
|
|
4763
4787
|
{
|
|
4764
4788
|
type: "button",
|
|
@@ -4770,7 +4794,7 @@ function SignIn({
|
|
|
4770
4794
|
] }),
|
|
4771
4795
|
credentialMode === "email" && alternates.filter((a) => a.enabled).map(({ key, action, label: label2, pendingLabel }) => {
|
|
4772
4796
|
const isPrimary = plan.primary === key;
|
|
4773
|
-
return /* @__PURE__ */ (0,
|
|
4797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4774
4798
|
"button",
|
|
4775
4799
|
{
|
|
4776
4800
|
type: isPrimary ? "submit" : "button",
|
|
@@ -4778,12 +4802,12 @@ function SignIn({
|
|
|
4778
4802
|
disabled: pending || authChallenge.configPending,
|
|
4779
4803
|
"aria-busy": pending && inFlight === key || void 0,
|
|
4780
4804
|
onClick: isPrimary ? void 0 : withEmail(action),
|
|
4781
|
-
children: /* @__PURE__ */ (0,
|
|
4805
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Busy, { busy: pending && inFlight === key, label: pendingLabel, children: label2 })
|
|
4782
4806
|
},
|
|
4783
4807
|
key
|
|
4784
4808
|
);
|
|
4785
4809
|
}),
|
|
4786
|
-
plan.username && /* @__PURE__ */ (0,
|
|
4810
|
+
plan.username && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4787
4811
|
"button",
|
|
4788
4812
|
{
|
|
4789
4813
|
type: "button",
|
|
@@ -4799,8 +4823,8 @@ function SignIn({
|
|
|
4799
4823
|
]
|
|
4800
4824
|
}
|
|
4801
4825
|
),
|
|
4802
|
-
plan.passkey && /* @__PURE__ */ (0,
|
|
4803
|
-
plan.phoneOtp && /* @__PURE__ */ (0,
|
|
4826
|
+
plan.passkey && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PasskeyButton, { redirectTo, onSignedIn }),
|
|
4827
|
+
plan.phoneOtp && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4804
4828
|
"button",
|
|
4805
4829
|
{
|
|
4806
4830
|
type: "button",
|
|
@@ -4809,7 +4833,7 @@ function SignIn({
|
|
|
4809
4833
|
children: t("phoneOtp.usePhone")
|
|
4810
4834
|
}
|
|
4811
4835
|
),
|
|
4812
|
-
!plan.renderable && /* @__PURE__ */ (0,
|
|
4836
|
+
!plan.renderable && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "ba-muted", children: plan.emptyReason === "unsupported" ? t("signIn.empty.unsupported") : t("signIn.empty.none") }),
|
|
4813
4837
|
badge
|
|
4814
4838
|
] });
|
|
4815
4839
|
}
|
|
@@ -4826,7 +4850,7 @@ init_i18n();
|
|
|
4826
4850
|
init_use_submit_action();
|
|
4827
4851
|
init_Spinner();
|
|
4828
4852
|
init_FormError();
|
|
4829
|
-
var
|
|
4853
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4830
4854
|
function VerificationPending({
|
|
4831
4855
|
email,
|
|
4832
4856
|
callbackURL,
|
|
@@ -4844,10 +4868,10 @@ function VerificationPending({
|
|
|
4844
4868
|
const [code, setCode] = React20.useState("");
|
|
4845
4869
|
const [verified, setVerified] = React20.useState(false);
|
|
4846
4870
|
if (verified) {
|
|
4847
|
-
return /* @__PURE__ */ (0,
|
|
4871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "ba-success", role: "status", "data-testid": "verify-code-success", children: t("verifyEmail.success") });
|
|
4848
4872
|
}
|
|
4849
4873
|
if (method === "code") {
|
|
4850
|
-
return /* @__PURE__ */ (0,
|
|
4874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4851
4875
|
"form",
|
|
4852
4876
|
{
|
|
4853
4877
|
method: "post",
|
|
@@ -4864,12 +4888,12 @@ function VerificationPending({
|
|
|
4864
4888
|
);
|
|
4865
4889
|
},
|
|
4866
4890
|
children: [
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
4868
|
-
email: /* @__PURE__ */ (0,
|
|
4891
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "ba-muted", children: richMessage(t("verifyPending.codeBody"), {
|
|
4892
|
+
email: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("strong", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Bidi, { children: email }) })
|
|
4869
4893
|
}) }),
|
|
4870
|
-
/* @__PURE__ */ (0,
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "ba-label", children: [
|
|
4871
4895
|
t("verifyPending.codeLabel"),
|
|
4872
|
-
/* @__PURE__ */ (0,
|
|
4896
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4873
4897
|
"input",
|
|
4874
4898
|
{
|
|
4875
4899
|
className: "ba-input",
|
|
@@ -4881,20 +4905,20 @@ function VerificationPending({
|
|
|
4881
4905
|
}
|
|
4882
4906
|
)
|
|
4883
4907
|
] }),
|
|
4884
|
-
resent && /* @__PURE__ */ (0,
|
|
4908
|
+
resent && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "ba-muted", children: t("verifyPending.resent") }),
|
|
4885
4909
|
authChallenge.control,
|
|
4886
|
-
/* @__PURE__ */ (0,
|
|
4887
|
-
/* @__PURE__ */ (0,
|
|
4910
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormError, { children: error }),
|
|
4911
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4888
4912
|
"button",
|
|
4889
4913
|
{
|
|
4890
4914
|
className: "ba-button",
|
|
4891
4915
|
type: "submit",
|
|
4892
4916
|
disabled: pending || !code,
|
|
4893
4917
|
"aria-busy": pending || void 0,
|
|
4894
|
-
children: /* @__PURE__ */ (0,
|
|
4918
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Busy, { busy: pending, label: t("common.verifying"), children: t("emailOtp.verifySubmit") })
|
|
4895
4919
|
}
|
|
4896
4920
|
),
|
|
4897
|
-
/* @__PURE__ */ (0,
|
|
4921
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4898
4922
|
"button",
|
|
4899
4923
|
{
|
|
4900
4924
|
type: "button",
|
|
@@ -4920,14 +4944,14 @@ function VerificationPending({
|
|
|
4920
4944
|
}
|
|
4921
4945
|
);
|
|
4922
4946
|
}
|
|
4923
|
-
return /* @__PURE__ */ (0,
|
|
4924
|
-
/* @__PURE__ */ (0,
|
|
4925
|
-
email: /* @__PURE__ */ (0,
|
|
4947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "ba-fields", "data-testid": "verify-pending", children: [
|
|
4948
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "ba-muted", children: richMessage(t("verifyPending.body"), {
|
|
4949
|
+
email: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("strong", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Bidi, { children: email }) })
|
|
4926
4950
|
}) }),
|
|
4927
|
-
resent && /* @__PURE__ */ (0,
|
|
4951
|
+
resent && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "ba-muted", children: t("verifyPending.resent") }),
|
|
4928
4952
|
authChallenge.control,
|
|
4929
|
-
/* @__PURE__ */ (0,
|
|
4930
|
-
/* @__PURE__ */ (0,
|
|
4953
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormError, { children: error }),
|
|
4954
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4931
4955
|
"button",
|
|
4932
4956
|
{
|
|
4933
4957
|
type: "button",
|
|
@@ -4938,7 +4962,7 @@ function VerificationPending({
|
|
|
4938
4962
|
failure: t("verifyPending.error.resendFailed"),
|
|
4939
4963
|
onSuccess: () => setResent(true)
|
|
4940
4964
|
}),
|
|
4941
|
-
children: /* @__PURE__ */ (0,
|
|
4965
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("verifyPending.resendButton") })
|
|
4942
4966
|
}
|
|
4943
4967
|
)
|
|
4944
4968
|
] });
|
|
@@ -4951,7 +4975,7 @@ init_i18n();
|
|
|
4951
4975
|
init_use_submit_action();
|
|
4952
4976
|
init_Spinner();
|
|
4953
4977
|
init_FormError();
|
|
4954
|
-
var
|
|
4978
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4955
4979
|
function PasswordlessSignUp({ onAuthenticated }) {
|
|
4956
4980
|
const t = useT();
|
|
4957
4981
|
const { sendEmailOtp, signInEmailOtp } = useSignIn();
|
|
@@ -4961,7 +4985,7 @@ function PasswordlessSignUp({ onAuthenticated }) {
|
|
|
4961
4985
|
const [code, setCode] = React21.useState("");
|
|
4962
4986
|
const [codeSent, setCodeSent] = React21.useState(false);
|
|
4963
4987
|
if (codeSent) {
|
|
4964
|
-
return /* @__PURE__ */ (0,
|
|
4988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "ba-fields", "data-testid": "signup-emailotp-code", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4965
4989
|
OtpCodeForm,
|
|
4966
4990
|
{
|
|
4967
4991
|
email,
|
|
@@ -4981,7 +5005,7 @@ function PasswordlessSignUp({ onAuthenticated }) {
|
|
|
4981
5005
|
}
|
|
4982
5006
|
) });
|
|
4983
5007
|
}
|
|
4984
|
-
return /* @__PURE__ */ (0,
|
|
5008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4985
5009
|
"form",
|
|
4986
5010
|
{
|
|
4987
5011
|
method: "post",
|
|
@@ -4995,9 +5019,9 @@ function PasswordlessSignUp({ onAuthenticated }) {
|
|
|
4995
5019
|
});
|
|
4996
5020
|
},
|
|
4997
5021
|
children: [
|
|
4998
|
-
/* @__PURE__ */ (0,
|
|
5022
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "ba-label", children: [
|
|
4999
5023
|
t("common.emailLabel"),
|
|
5000
|
-
/* @__PURE__ */ (0,
|
|
5024
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5001
5025
|
"input",
|
|
5002
5026
|
{
|
|
5003
5027
|
className: "ba-input",
|
|
@@ -5010,15 +5034,15 @@ function PasswordlessSignUp({ onAuthenticated }) {
|
|
|
5010
5034
|
)
|
|
5011
5035
|
] }),
|
|
5012
5036
|
authChallenge.control,
|
|
5013
|
-
/* @__PURE__ */ (0,
|
|
5014
|
-
/* @__PURE__ */ (0,
|
|
5037
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(FormError, { children: error }),
|
|
5038
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
5015
5039
|
"button",
|
|
5016
5040
|
{
|
|
5017
5041
|
className: "ba-button ba-button-secondary",
|
|
5018
5042
|
type: "submit",
|
|
5019
5043
|
disabled: pending || authChallenge.configPending,
|
|
5020
5044
|
"aria-busy": pending || void 0,
|
|
5021
|
-
children: /* @__PURE__ */ (0,
|
|
5045
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("signUp.passwordlessSubmit") })
|
|
5022
5046
|
}
|
|
5023
5047
|
)
|
|
5024
5048
|
]
|
|
@@ -5032,16 +5056,16 @@ init_i18n();
|
|
|
5032
5056
|
init_use_submit_action();
|
|
5033
5057
|
init_Spinner();
|
|
5034
5058
|
init_FormError();
|
|
5035
|
-
var
|
|
5059
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
5036
5060
|
function PasskeySignUpCompletion({ onComplete }) {
|
|
5037
5061
|
const t = useT();
|
|
5038
5062
|
const { addPasskey } = usePasskeys();
|
|
5039
5063
|
const { pending, error, run } = useSubmitAction();
|
|
5040
|
-
return /* @__PURE__ */ (0,
|
|
5041
|
-
/* @__PURE__ */ (0,
|
|
5042
|
-
/* @__PURE__ */ (0,
|
|
5043
|
-
/* @__PURE__ */ (0,
|
|
5044
|
-
/* @__PURE__ */ (0,
|
|
5064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "ba-fields", "data-testid": "signup-passkey-completion", children: [
|
|
5065
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h3", { className: "ba-title", children: t("signUp.passkeyTitle") }),
|
|
5066
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "ba-muted", children: t("signUp.passkeyDescription") }),
|
|
5067
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FormError, { children: error }),
|
|
5068
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5045
5069
|
"button",
|
|
5046
5070
|
{
|
|
5047
5071
|
className: "ba-button",
|
|
@@ -5052,10 +5076,10 @@ function PasskeySignUpCompletion({ onComplete }) {
|
|
|
5052
5076
|
failure: t("signUp.error.passkeyFailed"),
|
|
5053
5077
|
onSuccess: onComplete
|
|
5054
5078
|
}),
|
|
5055
|
-
children: /* @__PURE__ */ (0,
|
|
5079
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Busy, { busy: pending, label: t("passkey.waiting"), children: t("signUp.passkeySubmit") })
|
|
5056
5080
|
}
|
|
5057
5081
|
),
|
|
5058
|
-
/* @__PURE__ */ (0,
|
|
5082
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: onComplete, children: t("signUp.passkeySkip") })
|
|
5059
5083
|
] });
|
|
5060
5084
|
}
|
|
5061
5085
|
|
|
@@ -5070,7 +5094,7 @@ init_i18n();
|
|
|
5070
5094
|
init_FormError();
|
|
5071
5095
|
init_Spinner();
|
|
5072
5096
|
init_use_submit_action();
|
|
5073
|
-
var
|
|
5097
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5074
5098
|
function Waitlist({ onJoined, showBadge, showBranding = true } = {}) {
|
|
5075
5099
|
const t = useT();
|
|
5076
5100
|
const { join } = useWaitlist();
|
|
@@ -5079,18 +5103,18 @@ function Waitlist({ onJoined, showBadge, showBranding = true } = {}) {
|
|
|
5079
5103
|
const [email, setEmail] = React22.useState("");
|
|
5080
5104
|
const [joined, setJoined] = React22.useState(false);
|
|
5081
5105
|
if (joined) {
|
|
5082
|
-
return /* @__PURE__ */ (0,
|
|
5083
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
5084
|
-
/* @__PURE__ */ (0,
|
|
5085
|
-
/* @__PURE__ */ (0,
|
|
5086
|
-
/* @__PURE__ */ (0,
|
|
5106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "ba-form", "data-testid": "waitlist-accepted", children: [
|
|
5107
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AuthOwlBranding, {}) : null,
|
|
5108
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h2", { className: "ba-title", children: t("waitlist.acceptedTitle") }),
|
|
5109
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "ba-muted", children: t("waitlist.acceptedDescription") }),
|
|
5110
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AuthOwlBadge, { force: showBadge })
|
|
5087
5111
|
] });
|
|
5088
5112
|
}
|
|
5089
|
-
return /* @__PURE__ */ (0,
|
|
5090
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
5091
|
-
/* @__PURE__ */ (0,
|
|
5092
|
-
/* @__PURE__ */ (0,
|
|
5093
|
-
/* @__PURE__ */ (0,
|
|
5113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "ba-form", "data-testid": "waitlist-form", children: [
|
|
5114
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AuthOwlBranding, {}) : null,
|
|
5115
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h2", { className: "ba-title", children: t("waitlist.title") }),
|
|
5116
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "ba-muted", children: t("waitlist.description") }),
|
|
5117
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
5094
5118
|
"form",
|
|
5095
5119
|
{
|
|
5096
5120
|
method: "post",
|
|
@@ -5112,9 +5136,9 @@ function Waitlist({ onJoined, showBadge, showBranding = true } = {}) {
|
|
|
5112
5136
|
);
|
|
5113
5137
|
},
|
|
5114
5138
|
children: [
|
|
5115
|
-
/* @__PURE__ */ (0,
|
|
5139
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "ba-label", children: [
|
|
5116
5140
|
t("common.emailLabel"),
|
|
5117
|
-
/* @__PURE__ */ (0,
|
|
5141
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5118
5142
|
"input",
|
|
5119
5143
|
{
|
|
5120
5144
|
className: "ba-input",
|
|
@@ -5128,26 +5152,26 @@ function Waitlist({ onJoined, showBadge, showBranding = true } = {}) {
|
|
|
5128
5152
|
)
|
|
5129
5153
|
] }),
|
|
5130
5154
|
authChallenge.control,
|
|
5131
|
-
/* @__PURE__ */ (0,
|
|
5132
|
-
/* @__PURE__ */ (0,
|
|
5155
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormError, { children: error }),
|
|
5156
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5133
5157
|
"button",
|
|
5134
5158
|
{
|
|
5135
5159
|
className: "ba-button",
|
|
5136
5160
|
type: "submit",
|
|
5137
5161
|
disabled: pending || authChallenge.configPending,
|
|
5138
5162
|
"aria-busy": pending || void 0,
|
|
5139
|
-
children: /* @__PURE__ */ (0,
|
|
5163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Busy, { busy: pending, label: t("waitlist.submitPending"), children: t("waitlist.submit") })
|
|
5140
5164
|
}
|
|
5141
5165
|
)
|
|
5142
5166
|
]
|
|
5143
5167
|
}
|
|
5144
5168
|
),
|
|
5145
|
-
/* @__PURE__ */ (0,
|
|
5169
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AuthOwlBadge, { force: showBadge })
|
|
5146
5170
|
] });
|
|
5147
5171
|
}
|
|
5148
5172
|
|
|
5149
5173
|
// src/components/SignUp.tsx
|
|
5150
|
-
var
|
|
5174
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5151
5175
|
function SignUp({
|
|
5152
5176
|
redirectTo,
|
|
5153
5177
|
onSignedUp,
|
|
@@ -5159,7 +5183,7 @@ function SignUp({
|
|
|
5159
5183
|
const t = useT();
|
|
5160
5184
|
const toServerError = useServerError();
|
|
5161
5185
|
const { signUp } = useSignUp();
|
|
5162
|
-
const { config, isLoading } = usePublicConfig();
|
|
5186
|
+
const { config, isLoading, isError } = usePublicConfig();
|
|
5163
5187
|
const authChallenge = useAuthChallenge();
|
|
5164
5188
|
const [email, setEmail] = React23.useState("");
|
|
5165
5189
|
const [password, setPassword] = React23.useState("");
|
|
@@ -5231,18 +5255,21 @@ function SignUp({
|
|
|
5231
5255
|
}
|
|
5232
5256
|
}
|
|
5233
5257
|
if (isLoading) {
|
|
5234
|
-
return /* @__PURE__ */ (0,
|
|
5235
|
-
/* @__PURE__ */ (0,
|
|
5236
|
-
/* @__PURE__ */ (0,
|
|
5258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ba-form", "data-testid": "signup-loading", "aria-busy": "true", children: [
|
|
5259
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ba-skeleton" }),
|
|
5260
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ba-skeleton" })
|
|
5237
5261
|
] });
|
|
5238
5262
|
}
|
|
5263
|
+
if (isError) {
|
|
5264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PublicConfigError, { showBadge, showBranding });
|
|
5265
|
+
}
|
|
5239
5266
|
if (config?.signUp?.mode === "waitlist") {
|
|
5240
|
-
return /* @__PURE__ */ (0,
|
|
5267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Waitlist, { onJoined: onWaitlisted, showBadge, showBranding });
|
|
5241
5268
|
}
|
|
5242
5269
|
if (pendingEmail) {
|
|
5243
|
-
return /* @__PURE__ */ (0,
|
|
5244
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
5245
|
-
/* @__PURE__ */ (0,
|
|
5270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ba-form", "data-testid": "signup-verify-pending", children: [
|
|
5271
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBranding, {}) : null,
|
|
5272
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5246
5273
|
VerificationPending,
|
|
5247
5274
|
{
|
|
5248
5275
|
email: pendingEmail,
|
|
@@ -5250,7 +5277,7 @@ function SignUp({
|
|
|
5250
5277
|
method: capabilities.emailVerificationMethod
|
|
5251
5278
|
}
|
|
5252
5279
|
),
|
|
5253
|
-
/* @__PURE__ */ (0,
|
|
5280
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBadge, { force: showBadge })
|
|
5254
5281
|
] });
|
|
5255
5282
|
}
|
|
5256
5283
|
const methods = config?.enabledMethods ?? ["password"];
|
|
@@ -5260,22 +5287,22 @@ function SignUp({
|
|
|
5260
5287
|
const showPasswordless = publicSignupAllowed && capabilities.emailOtpSignIn && capabilities.emailSignUp && !consentRequired && !capabilities.mfaRequired;
|
|
5261
5288
|
const renderable = showPassword || showPasswordless || social.length > 0;
|
|
5262
5289
|
if (completeWithPasskey) {
|
|
5263
|
-
return /* @__PURE__ */ (0,
|
|
5264
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
5265
|
-
/* @__PURE__ */ (0,
|
|
5266
|
-
/* @__PURE__ */ (0,
|
|
5290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ba-form", "data-testid": "signup-passkey-step", children: [
|
|
5291
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBranding, {}) : null,
|
|
5292
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PasskeySignUpCompletion, { onComplete: finishSignUp }),
|
|
5293
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBadge, { force: showBadge })
|
|
5267
5294
|
] });
|
|
5268
5295
|
}
|
|
5269
|
-
return /* @__PURE__ */ (0,
|
|
5270
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
5271
|
-
/* @__PURE__ */ (0,
|
|
5272
|
-
/* @__PURE__ */ (0,
|
|
5273
|
-
/* @__PURE__ */ (0,
|
|
5274
|
-
showPassword && social.length > 0 && /* @__PURE__ */ (0,
|
|
5275
|
-
showPassword && /* @__PURE__ */ (0,
|
|
5276
|
-
capabilities.legacyNameField && /* @__PURE__ */ (0,
|
|
5296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ba-form", "data-testid": "signup-form", children: [
|
|
5297
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBranding, {}) : null,
|
|
5298
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h2", { className: "ba-title", children: t("signUp.title") }),
|
|
5299
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(InvitationBanner, {}),
|
|
5300
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SocialButtons, { providers: social, callbackURL: redirectTo }),
|
|
5301
|
+
showPassword && social.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ba-divider", children: t("common.orDivider") }),
|
|
5302
|
+
showPassword && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("form", { method: "post", onSubmit, className: "ba-fields", children: [
|
|
5303
|
+
capabilities.legacyNameField && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5277
5304
|
t("signUp.nameLabel"),
|
|
5278
|
-
/* @__PURE__ */ (0,
|
|
5305
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5279
5306
|
"input",
|
|
5280
5307
|
{
|
|
5281
5308
|
className: "ba-input",
|
|
@@ -5289,10 +5316,10 @@ function SignUp({
|
|
|
5289
5316
|
}
|
|
5290
5317
|
)
|
|
5291
5318
|
] }),
|
|
5292
|
-
capabilities.firstLastName && /* @__PURE__ */ (0,
|
|
5293
|
-
/* @__PURE__ */ (0,
|
|
5319
|
+
capabilities.firstLastName && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
5320
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5294
5321
|
t("signUp.firstNameLabel"),
|
|
5295
|
-
/* @__PURE__ */ (0,
|
|
5322
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5296
5323
|
"input",
|
|
5297
5324
|
{
|
|
5298
5325
|
className: "ba-input",
|
|
@@ -5305,9 +5332,9 @@ function SignUp({
|
|
|
5305
5332
|
}
|
|
5306
5333
|
)
|
|
5307
5334
|
] }),
|
|
5308
|
-
/* @__PURE__ */ (0,
|
|
5335
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5309
5336
|
t("signUp.lastNameLabel"),
|
|
5310
|
-
/* @__PURE__ */ (0,
|
|
5337
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5311
5338
|
"input",
|
|
5312
5339
|
{
|
|
5313
5340
|
className: "ba-input",
|
|
@@ -5321,9 +5348,9 @@ function SignUp({
|
|
|
5321
5348
|
)
|
|
5322
5349
|
] })
|
|
5323
5350
|
] }),
|
|
5324
|
-
capabilities.collectUsername && /* @__PURE__ */ (0,
|
|
5351
|
+
capabilities.collectUsername && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5325
5352
|
t("common.usernameLabel"),
|
|
5326
|
-
/* @__PURE__ */ (0,
|
|
5353
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5327
5354
|
"input",
|
|
5328
5355
|
{
|
|
5329
5356
|
className: "ba-input",
|
|
@@ -5337,9 +5364,9 @@ function SignUp({
|
|
|
5337
5364
|
}
|
|
5338
5365
|
)
|
|
5339
5366
|
] }),
|
|
5340
|
-
/* @__PURE__ */ (0,
|
|
5367
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5341
5368
|
t("common.emailLabel"),
|
|
5342
|
-
/* @__PURE__ */ (0,
|
|
5369
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5343
5370
|
"input",
|
|
5344
5371
|
{
|
|
5345
5372
|
className: "ba-input",
|
|
@@ -5354,9 +5381,9 @@ function SignUp({
|
|
|
5354
5381
|
}
|
|
5355
5382
|
)
|
|
5356
5383
|
] }),
|
|
5357
|
-
/* @__PURE__ */ (0,
|
|
5384
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "ba-label", children: [
|
|
5358
5385
|
t("common.passwordLabel"),
|
|
5359
|
-
/* @__PURE__ */ (0,
|
|
5386
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5360
5387
|
"input",
|
|
5361
5388
|
{
|
|
5362
5389
|
className: "ba-input",
|
|
@@ -5374,7 +5401,7 @@ function SignUp({
|
|
|
5374
5401
|
)
|
|
5375
5402
|
] }),
|
|
5376
5403
|
authChallenge.control,
|
|
5377
|
-
legal && /* @__PURE__ */ (0,
|
|
5404
|
+
legal && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5378
5405
|
LegalConsentCheckbox,
|
|
5379
5406
|
{
|
|
5380
5407
|
legal,
|
|
@@ -5383,20 +5410,20 @@ function SignUp({
|
|
|
5383
5410
|
testId: "signup-consent"
|
|
5384
5411
|
}
|
|
5385
5412
|
),
|
|
5386
|
-
/* @__PURE__ */ (0,
|
|
5387
|
-
/* @__PURE__ */ (0,
|
|
5413
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FormError, { children: error }),
|
|
5414
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5388
5415
|
"button",
|
|
5389
5416
|
{
|
|
5390
5417
|
className: "ba-button",
|
|
5391
5418
|
type: "submit",
|
|
5392
5419
|
disabled: submitting || consentBlocked || authChallenge.configPending,
|
|
5393
5420
|
"aria-busy": submitting || void 0,
|
|
5394
|
-
children: /* @__PURE__ */ (0,
|
|
5421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Busy, { busy: submitting, label: t("signUp.submitPending"), children: t("signUp.submit") })
|
|
5395
5422
|
}
|
|
5396
5423
|
)
|
|
5397
5424
|
] }),
|
|
5398
|
-
showPasswordless && (showPassword || social.length > 0) && /* @__PURE__ */ (0,
|
|
5399
|
-
showPasswordless && /* @__PURE__ */ (0,
|
|
5425
|
+
showPasswordless && (showPassword || social.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ba-divider", children: t("common.orDivider") }),
|
|
5426
|
+
showPasswordless && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5400
5427
|
PasswordlessSignUp,
|
|
5401
5428
|
{
|
|
5402
5429
|
onAuthenticated: () => {
|
|
@@ -5405,8 +5432,8 @@ function SignUp({
|
|
|
5405
5432
|
}
|
|
5406
5433
|
}
|
|
5407
5434
|
),
|
|
5408
|
-
!renderable && /* @__PURE__ */ (0,
|
|
5409
|
-
/* @__PURE__ */ (0,
|
|
5435
|
+
!renderable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "ba-muted", children: publicSignupAllowed && methods.length > 0 ? t("signUp.empty.unsupported") : t("signUp.empty.none") }),
|
|
5436
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AuthOwlBadge, { force: showBadge })
|
|
5410
5437
|
] });
|
|
5411
5438
|
}
|
|
5412
5439
|
|
|
@@ -5416,19 +5443,19 @@ init_i18n();
|
|
|
5416
5443
|
init_use_submit_action();
|
|
5417
5444
|
init_Spinner();
|
|
5418
5445
|
init_FormError();
|
|
5419
|
-
var
|
|
5446
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5420
5447
|
function ConsentGate({ children, title }) {
|
|
5421
5448
|
const t = useT();
|
|
5422
5449
|
const { needsConsent, status, accept } = useConsent();
|
|
5423
5450
|
const { pending, error, run } = useSubmitAction();
|
|
5424
|
-
if (!needsConsent) return /* @__PURE__ */ (0,
|
|
5425
|
-
return /* @__PURE__ */ (0,
|
|
5426
|
-
/* @__PURE__ */ (0,
|
|
5427
|
-
/* @__PURE__ */ (0,
|
|
5428
|
-
links: /* @__PURE__ */ (0,
|
|
5451
|
+
if (!needsConsent) return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children });
|
|
5452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ba-form", "data-testid": "consent-gate", children: [
|
|
5453
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", { className: "ba-title", children: title ?? t("consent.gateTitle") }),
|
|
5454
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "ba-muted", children: richMessage(t("consent.gateBody"), {
|
|
5455
|
+
links: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ConsentDocLinks, { termsUrl: status?.termsUrl, privacyUrl: status?.privacyUrl })
|
|
5429
5456
|
}) }),
|
|
5430
|
-
/* @__PURE__ */ (0,
|
|
5431
|
-
/* @__PURE__ */ (0,
|
|
5457
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(FormError, { children: error }),
|
|
5458
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5432
5459
|
"button",
|
|
5433
5460
|
{
|
|
5434
5461
|
className: "ba-button",
|
|
@@ -5442,22 +5469,22 @@ function ConsentGate({ children, title }) {
|
|
|
5442
5469
|
},
|
|
5443
5470
|
{ failure: t("consent.error.acceptFailed") }
|
|
5444
5471
|
),
|
|
5445
|
-
children: /* @__PURE__ */ (0,
|
|
5472
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Busy, { busy: pending, label: t("consent.acceptPending"), children: t("consent.acceptSubmit") })
|
|
5446
5473
|
}
|
|
5447
5474
|
),
|
|
5448
|
-
/* @__PURE__ */ (0,
|
|
5475
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AuthOwlBadge, {})
|
|
5449
5476
|
] });
|
|
5450
5477
|
}
|
|
5451
5478
|
|
|
5452
5479
|
// src/components/MFARequiredGate.tsx
|
|
5453
|
-
var
|
|
5480
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5454
5481
|
function MFARequiredGate({ children, title }) {
|
|
5455
5482
|
const state = useConfirmedMfaPending();
|
|
5456
|
-
if (state === "clear") return /* @__PURE__ */ (0,
|
|
5483
|
+
if (state === "clear") return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
|
|
5457
5484
|
if (state === "confirming") return null;
|
|
5458
|
-
return /* @__PURE__ */ (0,
|
|
5459
|
-
/* @__PURE__ */ (0,
|
|
5460
|
-
/* @__PURE__ */ (0,
|
|
5485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "ba-form", "data-testid": "mfa-required-gate", children: [
|
|
5486
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MfaEnrollmentStep, { title }),
|
|
5487
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AuthOwlBadge, {})
|
|
5461
5488
|
] });
|
|
5462
5489
|
}
|
|
5463
5490
|
|
|
@@ -5468,7 +5495,7 @@ init_i18n();
|
|
|
5468
5495
|
init_use_submit_action();
|
|
5469
5496
|
init_Spinner();
|
|
5470
5497
|
init_FormError();
|
|
5471
|
-
var
|
|
5498
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
5472
5499
|
function BackupCodesManager({ title }) {
|
|
5473
5500
|
const t = useT();
|
|
5474
5501
|
const { user } = useUser();
|
|
@@ -5487,20 +5514,20 @@ function BackupCodesManager({ title }) {
|
|
|
5487
5514
|
}
|
|
5488
5515
|
});
|
|
5489
5516
|
};
|
|
5490
|
-
return /* @__PURE__ */ (0,
|
|
5491
|
-
title !== null && /* @__PURE__ */ (0,
|
|
5492
|
-
/* @__PURE__ */ (0,
|
|
5493
|
-
codes ? /* @__PURE__ */ (0,
|
|
5494
|
-
/* @__PURE__ */ (0,
|
|
5495
|
-
/* @__PURE__ */ (0,
|
|
5517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ba-form", "data-testid": "backup-codes-manager", children: [
|
|
5518
|
+
title !== null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h2", { className: "ba-title", children: title ?? t("backupCodes.title") }),
|
|
5519
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "ba-muted", children: t("backupCodes.hint") }),
|
|
5520
|
+
codes ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
5521
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("p", { className: "ba-muted", children: [
|
|
5522
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: t("mfa.enroll.backupCodesWarningStrong") }),
|
|
5496
5523
|
" ",
|
|
5497
5524
|
t("mfa.enroll.backupCodesWarningRest")
|
|
5498
5525
|
] }),
|
|
5499
|
-
/* @__PURE__ */ (0,
|
|
5500
|
-
] }) : /* @__PURE__ */ (0,
|
|
5501
|
-
/* @__PURE__ */ (0,
|
|
5526
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "ba-passkey-list", "data-testid": "backup-codes-list", children: codes.map((c) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("li", { className: "ba-passkey-item", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("code", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("bdi", { children: c }) }) }, c)) })
|
|
5527
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
5528
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "ba-label", children: [
|
|
5502
5529
|
t("common.passwordLabel"),
|
|
5503
|
-
/* @__PURE__ */ (0,
|
|
5530
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5504
5531
|
"input",
|
|
5505
5532
|
{
|
|
5506
5533
|
className: "ba-input",
|
|
@@ -5512,8 +5539,8 @@ function BackupCodesManager({ title }) {
|
|
|
5512
5539
|
}
|
|
5513
5540
|
)
|
|
5514
5541
|
] }),
|
|
5515
|
-
/* @__PURE__ */ (0,
|
|
5516
|
-
/* @__PURE__ */ (0,
|
|
5542
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FormError, { children: error }),
|
|
5543
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { className: "ba-button", type: "submit", disabled: pending || !password, "aria-busy": pending || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Busy, { busy: pending, label: t("backupCodes.pending"), children: t("backupCodes.submit") }) })
|
|
5517
5544
|
] })
|
|
5518
5545
|
] });
|
|
5519
5546
|
}
|
|
@@ -5525,7 +5552,7 @@ init_i18n();
|
|
|
5525
5552
|
init_use_submit_action();
|
|
5526
5553
|
init_Spinner();
|
|
5527
5554
|
init_FormError();
|
|
5528
|
-
var
|
|
5555
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5529
5556
|
function MagicLinkForm({ callbackURL, webauthnAutofill }) {
|
|
5530
5557
|
const t = useT();
|
|
5531
5558
|
const { signInMagicLink } = useSignIn();
|
|
@@ -5534,9 +5561,9 @@ function MagicLinkForm({ callbackURL, webauthnAutofill }) {
|
|
|
5534
5561
|
const [email, setEmail] = React25.useState("");
|
|
5535
5562
|
const [sent, setSent] = React25.useState(false);
|
|
5536
5563
|
if (sent) {
|
|
5537
|
-
return /* @__PURE__ */ (0,
|
|
5564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "ba-muted", "data-testid": "magiclink-sent", children: t("magicLink.sent") });
|
|
5538
5565
|
}
|
|
5539
|
-
return /* @__PURE__ */ (0,
|
|
5566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
5540
5567
|
"form",
|
|
5541
5568
|
{
|
|
5542
5569
|
method: "post",
|
|
@@ -5550,9 +5577,9 @@ function MagicLinkForm({ callbackURL, webauthnAutofill }) {
|
|
|
5550
5577
|
className: "ba-fields",
|
|
5551
5578
|
"data-testid": "magiclink-form",
|
|
5552
5579
|
children: [
|
|
5553
|
-
/* @__PURE__ */ (0,
|
|
5580
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "ba-label", children: [
|
|
5554
5581
|
t("common.emailLabel"),
|
|
5555
|
-
/* @__PURE__ */ (0,
|
|
5582
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5556
5583
|
"input",
|
|
5557
5584
|
{
|
|
5558
5585
|
className: "ba-input",
|
|
@@ -5565,15 +5592,15 @@ function MagicLinkForm({ callbackURL, webauthnAutofill }) {
|
|
|
5565
5592
|
)
|
|
5566
5593
|
] }),
|
|
5567
5594
|
authChallenge.control,
|
|
5568
|
-
/* @__PURE__ */ (0,
|
|
5569
|
-
/* @__PURE__ */ (0,
|
|
5595
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FormError, { children: error }),
|
|
5596
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5570
5597
|
"button",
|
|
5571
5598
|
{
|
|
5572
5599
|
className: "ba-button",
|
|
5573
5600
|
type: "submit",
|
|
5574
5601
|
disabled: pending || authChallenge.configPending,
|
|
5575
5602
|
"aria-busy": pending || void 0,
|
|
5576
|
-
children: /* @__PURE__ */ (0,
|
|
5603
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("magicLink.submit") })
|
|
5577
5604
|
}
|
|
5578
5605
|
)
|
|
5579
5606
|
]
|
|
@@ -5588,7 +5615,7 @@ init_i18n();
|
|
|
5588
5615
|
init_use_submit_action();
|
|
5589
5616
|
init_Spinner();
|
|
5590
5617
|
init_FormError();
|
|
5591
|
-
var
|
|
5618
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5592
5619
|
function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
|
|
5593
5620
|
const t = useT();
|
|
5594
5621
|
const { sessionStore } = useAuthClient();
|
|
@@ -5599,7 +5626,7 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
|
|
|
5599
5626
|
const [otp, setOtp] = React26.useState("");
|
|
5600
5627
|
const [stage, setStage] = React26.useState("email");
|
|
5601
5628
|
if (stage === "code") {
|
|
5602
|
-
return /* @__PURE__ */ (0,
|
|
5629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5603
5630
|
OtpCodeForm,
|
|
5604
5631
|
{
|
|
5605
5632
|
email,
|
|
@@ -5622,7 +5649,7 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
|
|
|
5622
5649
|
}
|
|
5623
5650
|
);
|
|
5624
5651
|
}
|
|
5625
|
-
return /* @__PURE__ */ (0,
|
|
5652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
5626
5653
|
"form",
|
|
5627
5654
|
{
|
|
5628
5655
|
method: "post",
|
|
@@ -5636,9 +5663,9 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
|
|
|
5636
5663
|
className: "ba-fields",
|
|
5637
5664
|
"data-testid": "emailotp-email",
|
|
5638
5665
|
children: [
|
|
5639
|
-
/* @__PURE__ */ (0,
|
|
5666
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "ba-label", children: [
|
|
5640
5667
|
t("common.emailLabel"),
|
|
5641
|
-
/* @__PURE__ */ (0,
|
|
5668
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5642
5669
|
"input",
|
|
5643
5670
|
{
|
|
5644
5671
|
className: "ba-input",
|
|
@@ -5654,15 +5681,15 @@ function EmailOtpForm({ redirectTo, onSignedIn, webauthnAutofill }) {
|
|
|
5654
5681
|
)
|
|
5655
5682
|
] }),
|
|
5656
5683
|
authChallenge.control,
|
|
5657
|
-
/* @__PURE__ */ (0,
|
|
5658
|
-
/* @__PURE__ */ (0,
|
|
5684
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FormError, { children: error }),
|
|
5685
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5659
5686
|
"button",
|
|
5660
5687
|
{
|
|
5661
5688
|
className: "ba-button",
|
|
5662
5689
|
type: "submit",
|
|
5663
5690
|
disabled: pending || authChallenge.configPending,
|
|
5664
5691
|
"aria-busy": pending || void 0,
|
|
5665
|
-
children: /* @__PURE__ */ (0,
|
|
5692
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("emailOtp.requestSubmit") })
|
|
5666
5693
|
}
|
|
5667
5694
|
)
|
|
5668
5695
|
]
|
|
@@ -5677,7 +5704,7 @@ init_i18n();
|
|
|
5677
5704
|
init_use_submit_action();
|
|
5678
5705
|
init_Spinner();
|
|
5679
5706
|
init_FormError();
|
|
5680
|
-
var
|
|
5707
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5681
5708
|
function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
|
|
5682
5709
|
const t = useT();
|
|
5683
5710
|
const { resetPassword } = usePasswordReset();
|
|
@@ -5697,15 +5724,15 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
|
|
|
5697
5724
|
setReady(true);
|
|
5698
5725
|
}, [tokenProp]);
|
|
5699
5726
|
if (!ready) {
|
|
5700
|
-
return /* @__PURE__ */ (0,
|
|
5727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ba-form", "aria-busy": "true", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ba-skeleton" }) });
|
|
5701
5728
|
}
|
|
5702
5729
|
if (!token) {
|
|
5703
|
-
return /* @__PURE__ */ (0,
|
|
5730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormError, { "data-testid": "reset-invalid", children: t("resetPassword.invalidLink") });
|
|
5704
5731
|
}
|
|
5705
5732
|
if (done) {
|
|
5706
|
-
return /* @__PURE__ */ (0,
|
|
5733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "ba-muted", "data-testid": "reset-done", children: t("resetPassword.done") });
|
|
5707
5734
|
}
|
|
5708
|
-
return /* @__PURE__ */ (0,
|
|
5735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
5709
5736
|
"form",
|
|
5710
5737
|
{
|
|
5711
5738
|
method: "post",
|
|
@@ -5731,9 +5758,9 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
|
|
|
5731
5758
|
});
|
|
5732
5759
|
},
|
|
5733
5760
|
children: [
|
|
5734
|
-
/* @__PURE__ */ (0,
|
|
5761
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "ba-label", children: [
|
|
5735
5762
|
t("resetPassword.newPasswordLabel"),
|
|
5736
|
-
/* @__PURE__ */ (0,
|
|
5763
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5737
5764
|
"input",
|
|
5738
5765
|
{
|
|
5739
5766
|
className: "ba-input",
|
|
@@ -5750,9 +5777,9 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
|
|
|
5750
5777
|
}
|
|
5751
5778
|
)
|
|
5752
5779
|
] }),
|
|
5753
|
-
/* @__PURE__ */ (0,
|
|
5780
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "ba-label", children: [
|
|
5754
5781
|
t("resetPassword.confirmPasswordLabel"),
|
|
5755
|
-
/* @__PURE__ */ (0,
|
|
5782
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5756
5783
|
"input",
|
|
5757
5784
|
{
|
|
5758
5785
|
className: "ba-input",
|
|
@@ -5769,8 +5796,8 @@ function ResetPassword({ token: tokenProp, redirectTo, onReset }) {
|
|
|
5769
5796
|
}
|
|
5770
5797
|
)
|
|
5771
5798
|
] }),
|
|
5772
|
-
/* @__PURE__ */ (0,
|
|
5773
|
-
/* @__PURE__ */ (0,
|
|
5799
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormError, { children: error }),
|
|
5800
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { className: "ba-button", type: "submit", disabled: pending, "aria-busy": pending || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Busy, { busy: pending, label: t("resetPassword.submitPending"), children: t("resetPassword.submit") }) })
|
|
5774
5801
|
]
|
|
5775
5802
|
}
|
|
5776
5803
|
);
|
|
@@ -5783,7 +5810,7 @@ init_i18n();
|
|
|
5783
5810
|
init_use_submit_action();
|
|
5784
5811
|
init_Spinner();
|
|
5785
5812
|
init_FormError();
|
|
5786
|
-
var
|
|
5813
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
5787
5814
|
function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
|
|
5788
5815
|
const t = useT();
|
|
5789
5816
|
const { sendVerificationEmail } = useEmailVerification();
|
|
@@ -5803,12 +5830,12 @@ function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
|
|
|
5803
5830
|
}
|
|
5804
5831
|
}, [onVerified, redirectTo]);
|
|
5805
5832
|
if (!ready) {
|
|
5806
|
-
return /* @__PURE__ */ (0,
|
|
5833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ba-form", "aria-busy": "true", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ba-skeleton" }) });
|
|
5807
5834
|
}
|
|
5808
5835
|
if (!failed) {
|
|
5809
|
-
return /* @__PURE__ */ (0,
|
|
5836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "ba-muted", "data-testid": "verify-success", children: t("verifyEmail.success") });
|
|
5810
5837
|
}
|
|
5811
|
-
return /* @__PURE__ */ (0,
|
|
5838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
5812
5839
|
"form",
|
|
5813
5840
|
{
|
|
5814
5841
|
method: "post",
|
|
@@ -5823,11 +5850,11 @@ function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
|
|
|
5823
5850
|
});
|
|
5824
5851
|
},
|
|
5825
5852
|
children: [
|
|
5826
|
-
/* @__PURE__ */ (0,
|
|
5827
|
-
resent ? /* @__PURE__ */ (0,
|
|
5828
|
-
/* @__PURE__ */ (0,
|
|
5853
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FormError, { children: t("verifyEmail.invalidLink") }),
|
|
5854
|
+
resent ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "ba-muted", children: richMessage(t("verifyEmail.resent"), { email: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Bidi, { children: email }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
5855
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { className: "ba-label", children: [
|
|
5829
5856
|
t("common.emailLabel"),
|
|
5830
|
-
/* @__PURE__ */ (0,
|
|
5857
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5831
5858
|
"input",
|
|
5832
5859
|
{
|
|
5833
5860
|
className: "ba-input",
|
|
@@ -5840,15 +5867,15 @@ function VerifyEmail({ redirectTo, onVerified, callbackURL }) {
|
|
|
5840
5867
|
)
|
|
5841
5868
|
] }),
|
|
5842
5869
|
authChallenge.control,
|
|
5843
|
-
/* @__PURE__ */ (0,
|
|
5844
|
-
/* @__PURE__ */ (0,
|
|
5870
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FormError, { children: error }),
|
|
5871
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5845
5872
|
"button",
|
|
5846
5873
|
{
|
|
5847
5874
|
className: "ba-button",
|
|
5848
5875
|
type: "submit",
|
|
5849
5876
|
disabled: pending || authChallenge.configPending,
|
|
5850
5877
|
"aria-busy": pending || void 0,
|
|
5851
|
-
children: /* @__PURE__ */ (0,
|
|
5878
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("verifyEmail.resendSubmit") })
|
|
5852
5879
|
}
|
|
5853
5880
|
)
|
|
5854
5881
|
] })
|
|
@@ -5864,17 +5891,17 @@ init_i18n();
|
|
|
5864
5891
|
init_use_submit_action();
|
|
5865
5892
|
init_Spinner();
|
|
5866
5893
|
init_FormError();
|
|
5867
|
-
var
|
|
5894
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5868
5895
|
function PasskeyManager({ title, allowAdd = true } = {}) {
|
|
5869
5896
|
const t = useT();
|
|
5870
5897
|
const { user, isLoaded, isSignedIn } = useUser();
|
|
5871
5898
|
if (!isLoaded) {
|
|
5872
|
-
return /* @__PURE__ */ (0,
|
|
5899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ba-form", "data-testid": "passkey-manager-loading", "aria-busy": "true", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ba-skeleton" }) });
|
|
5873
5900
|
}
|
|
5874
5901
|
if (!isSignedIn || !user) {
|
|
5875
|
-
return /* @__PURE__ */ (0,
|
|
5902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "ba-muted", children: t("passkeys.signedOut") });
|
|
5876
5903
|
}
|
|
5877
|
-
return /* @__PURE__ */ (0,
|
|
5904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PasskeyManagerBody, { title, allowAdd }, user.id);
|
|
5878
5905
|
}
|
|
5879
5906
|
function PasskeyManagerBody({
|
|
5880
5907
|
title,
|
|
@@ -5923,13 +5950,13 @@ function PasskeyManagerBody({
|
|
|
5923
5950
|
onSuccess: load
|
|
5924
5951
|
});
|
|
5925
5952
|
}
|
|
5926
|
-
return /* @__PURE__ */ (0,
|
|
5927
|
-
title !== null && /* @__PURE__ */ (0,
|
|
5928
|
-
passkeys === null ? error ? null : /* @__PURE__ */ (0,
|
|
5929
|
-
(passkeys ?? []).map((pk) => /* @__PURE__ */ (0,
|
|
5930
|
-
/* @__PURE__ */ (0,
|
|
5931
|
-
/* @__PURE__ */ (0,
|
|
5932
|
-
/* @__PURE__ */ (0,
|
|
5953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ba-form", "data-testid": "passkey-manager", children: [
|
|
5954
|
+
title !== null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { className: "ba-title", children: title ?? t("passkeys.title") }),
|
|
5955
|
+
passkeys === null ? error ? null : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ba-skeleton" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("ul", { className: "ba-passkey-list", children: [
|
|
5956
|
+
(passkeys ?? []).map((pk) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("li", { className: "ba-passkey-item", children: [
|
|
5957
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "ba-passkey-name", children: pk.name?.trim() || t("passkeys.unnamed") }),
|
|
5958
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "ba-passkey-actions", children: [
|
|
5959
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5933
5960
|
"button",
|
|
5934
5961
|
{
|
|
5935
5962
|
type: "button",
|
|
@@ -5939,7 +5966,7 @@ function PasskeyManagerBody({
|
|
|
5939
5966
|
children: t("passkeys.rename")
|
|
5940
5967
|
}
|
|
5941
5968
|
),
|
|
5942
|
-
/* @__PURE__ */ (0,
|
|
5969
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5943
5970
|
"button",
|
|
5944
5971
|
{
|
|
5945
5972
|
type: "button",
|
|
@@ -5951,13 +5978,13 @@ function PasskeyManagerBody({
|
|
|
5951
5978
|
)
|
|
5952
5979
|
] })
|
|
5953
5980
|
] }, pk.id)),
|
|
5954
|
-
passkeys !== null && passkeys.length === 0 && /* @__PURE__ */ (0,
|
|
5981
|
+
passkeys !== null && passkeys.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { className: "ba-muted", children: t("passkeys.empty") })
|
|
5955
5982
|
] }),
|
|
5956
|
-
error && /* @__PURE__ */ (0,
|
|
5957
|
-
/* @__PURE__ */ (0,
|
|
5958
|
-
passkeys === null && /* @__PURE__ */ (0,
|
|
5983
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ba-inline-error", children: [
|
|
5984
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormError, { children: error }),
|
|
5985
|
+
passkeys === null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void load(), children: t("userProfile.retry") })
|
|
5959
5986
|
] }),
|
|
5960
|
-
passkeys !== null && allowAdd && /* @__PURE__ */ (0,
|
|
5987
|
+
passkeys !== null && allowAdd && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5961
5988
|
"button",
|
|
5962
5989
|
{
|
|
5963
5990
|
className: "ba-button",
|
|
@@ -5968,7 +5995,7 @@ function PasskeyManagerBody({
|
|
|
5968
5995
|
failure: t("passkeys.error.addFailed"),
|
|
5969
5996
|
onSuccess: load
|
|
5970
5997
|
}),
|
|
5971
|
-
children: /* @__PURE__ */ (0,
|
|
5998
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("passkeys.add") })
|
|
5972
5999
|
}
|
|
5973
6000
|
)
|
|
5974
6001
|
] });
|
|
@@ -5979,14 +6006,14 @@ var import_core6 = require("@authowl/core");
|
|
|
5979
6006
|
init_hooks();
|
|
5980
6007
|
init_i18n();
|
|
5981
6008
|
init_Spinner();
|
|
5982
|
-
var
|
|
6009
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5983
6010
|
function SignedIn({ children }) {
|
|
5984
6011
|
const { isLoaded, isSignedIn } = useUser();
|
|
5985
|
-
return isLoaded && isSignedIn ? /* @__PURE__ */ (0,
|
|
6012
|
+
return isLoaded && isSignedIn ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children }) : null;
|
|
5986
6013
|
}
|
|
5987
6014
|
function SignedOut({ children }) {
|
|
5988
6015
|
const { isLoaded, isSignedIn } = useUser();
|
|
5989
|
-
return isLoaded && !isSignedIn ? /* @__PURE__ */ (0,
|
|
6016
|
+
return isLoaded && !isSignedIn ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children }) : null;
|
|
5990
6017
|
}
|
|
5991
6018
|
function Protect({
|
|
5992
6019
|
children,
|
|
@@ -5999,25 +6026,25 @@ function Protect({
|
|
|
5999
6026
|
const { user, isLoaded, isSignedIn } = useUser();
|
|
6000
6027
|
const membership = useSession().data?.session?.membership ?? null;
|
|
6001
6028
|
if (!isLoaded) return null;
|
|
6002
|
-
if (!isSignedIn || !user) return /* @__PURE__ */ (0,
|
|
6029
|
+
if (!isSignedIn || !user) return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: fallback });
|
|
6003
6030
|
if ((role !== void 0 || permission !== void 0 || teamId !== void 0) && !(0, import_core6.membershipHas)(membership, { role, permission, teamId })) {
|
|
6004
|
-
return /* @__PURE__ */ (0,
|
|
6031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: fallback });
|
|
6005
6032
|
}
|
|
6006
|
-
if (condition && !condition(user)) return /* @__PURE__ */ (0,
|
|
6007
|
-
return /* @__PURE__ */ (0,
|
|
6033
|
+
if (condition && !condition(user)) return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: fallback });
|
|
6034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children });
|
|
6008
6035
|
}
|
|
6009
6036
|
function AuthLoading({ children }) {
|
|
6010
6037
|
const t = useT();
|
|
6011
6038
|
const { isLoaded } = useUser();
|
|
6012
6039
|
if (isLoaded) return null;
|
|
6013
|
-
if (children !== void 0) return /* @__PURE__ */ (0,
|
|
6014
|
-
return /* @__PURE__ */ (0,
|
|
6015
|
-
/* @__PURE__ */ (0,
|
|
6016
|
-
/* @__PURE__ */ (0,
|
|
6040
|
+
if (children !== void 0) return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children });
|
|
6041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "ba-auth-loading", role: "status", "aria-busy": "true", "data-testid": "auth-loading", children: [
|
|
6042
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Spinner, {}),
|
|
6043
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "ba-sr-only", children: t("common.loading") })
|
|
6017
6044
|
] });
|
|
6018
6045
|
}
|
|
6019
6046
|
function AuthLoaded({ children }) {
|
|
6020
|
-
return useUser().isLoaded ? /* @__PURE__ */ (0,
|
|
6047
|
+
return useUser().isLoaded ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children }) : null;
|
|
6021
6048
|
}
|
|
6022
6049
|
|
|
6023
6050
|
// src/index.ts
|
|
@@ -6028,13 +6055,13 @@ var React30 = __toESM(require("react"), 1);
|
|
|
6028
6055
|
init_hooks();
|
|
6029
6056
|
init_i18n();
|
|
6030
6057
|
init_Spinner();
|
|
6031
|
-
var
|
|
6058
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6032
6059
|
function SignOutButton({ children, redirectTo, onSignedOut, className }) {
|
|
6033
6060
|
const t = useT();
|
|
6034
6061
|
const { signOut } = useSignOut();
|
|
6035
6062
|
const [pending, setPending] = React30.useState(false);
|
|
6036
6063
|
const content = children ?? t("signOut.button");
|
|
6037
|
-
return /* @__PURE__ */ (0,
|
|
6064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6038
6065
|
"button",
|
|
6039
6066
|
{
|
|
6040
6067
|
type: "button",
|
|
@@ -6052,7 +6079,7 @@ function SignOutButton({ children, redirectTo, onSignedOut, className }) {
|
|
|
6052
6079
|
setPending(false);
|
|
6053
6080
|
}
|
|
6054
6081
|
},
|
|
6055
|
-
children: /* @__PURE__ */ (0,
|
|
6082
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Busy, { busy: pending, label: content, children: content })
|
|
6056
6083
|
}
|
|
6057
6084
|
);
|
|
6058
6085
|
}
|
|
@@ -6074,7 +6101,7 @@ init_i18n();
|
|
|
6074
6101
|
init_use_submit_action();
|
|
6075
6102
|
init_Spinner();
|
|
6076
6103
|
init_FormError();
|
|
6077
|
-
var
|
|
6104
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6078
6105
|
function EmailSection({ allowChange }) {
|
|
6079
6106
|
const t = useT();
|
|
6080
6107
|
const account = useAccount();
|
|
@@ -6084,9 +6111,9 @@ function EmailSection({ allowChange }) {
|
|
|
6084
6111
|
const [sent, setSent] = React31.useState(false);
|
|
6085
6112
|
const titleId = React31.useId();
|
|
6086
6113
|
if (!user?.email) {
|
|
6087
|
-
return /* @__PURE__ */ (0,
|
|
6088
|
-
/* @__PURE__ */ (0,
|
|
6089
|
-
/* @__PURE__ */ (0,
|
|
6114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6115
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.email.title") }),
|
|
6116
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "ba-muted", children: t("userProfile.email.unavailable") })
|
|
6090
6117
|
] });
|
|
6091
6118
|
}
|
|
6092
6119
|
const submit = (event) => {
|
|
@@ -6106,19 +6133,19 @@ function EmailSection({ allowChange }) {
|
|
|
6106
6133
|
}
|
|
6107
6134
|
);
|
|
6108
6135
|
};
|
|
6109
|
-
return /* @__PURE__ */ (0,
|
|
6110
|
-
/* @__PURE__ */ (0,
|
|
6111
|
-
/* @__PURE__ */ (0,
|
|
6112
|
-
/* @__PURE__ */ (0,
|
|
6136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6137
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6138
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.email.title") }),
|
|
6139
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "ba-muted", children: t("userProfile.email.description") })
|
|
6113
6140
|
] }),
|
|
6114
|
-
/* @__PURE__ */ (0,
|
|
6115
|
-
/* @__PURE__ */ (0,
|
|
6116
|
-
/* @__PURE__ */ (0,
|
|
6141
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "ba-profile-current", children: [
|
|
6142
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: t("userProfile.email.current") }),
|
|
6143
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Bidi, { children: user.email }) })
|
|
6117
6144
|
] }),
|
|
6118
|
-
!allowChange ? /* @__PURE__ */ (0,
|
|
6119
|
-
/* @__PURE__ */ (0,
|
|
6145
|
+
!allowChange ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "ba-muted", "data-testid": "email-change-disabled", children: t("userProfile.email.changeDisabled") }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
6146
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { className: "ba-label", children: [
|
|
6120
6147
|
t("userProfile.email.newLabel"),
|
|
6121
|
-
/* @__PURE__ */ (0,
|
|
6148
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6122
6149
|
"input",
|
|
6123
6150
|
{
|
|
6124
6151
|
className: "ba-input",
|
|
@@ -6130,16 +6157,16 @@ function EmailSection({ allowChange }) {
|
|
|
6130
6157
|
}
|
|
6131
6158
|
)
|
|
6132
6159
|
] }),
|
|
6133
|
-
/* @__PURE__ */ (0,
|
|
6134
|
-
sent && /* @__PURE__ */ (0,
|
|
6135
|
-
/* @__PURE__ */ (0,
|
|
6160
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(FormError, { children: error }),
|
|
6161
|
+
sent && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "ba-success", role: "status", children: t("userProfile.email.sent") }),
|
|
6162
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6136
6163
|
"button",
|
|
6137
6164
|
{
|
|
6138
6165
|
className: "ba-button ba-profile-submit",
|
|
6139
6166
|
type: "submit",
|
|
6140
6167
|
disabled: pending || !newEmail.trim(),
|
|
6141
6168
|
"aria-busy": pending || void 0,
|
|
6142
|
-
children: /* @__PURE__ */ (0,
|
|
6169
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Busy, { busy: pending, label: t("common.sending"), children: t("userProfile.email.submit") })
|
|
6143
6170
|
}
|
|
6144
6171
|
)
|
|
6145
6172
|
] })
|
|
@@ -6153,7 +6180,7 @@ init_i18n();
|
|
|
6153
6180
|
init_use_submit_action();
|
|
6154
6181
|
init_Spinner();
|
|
6155
6182
|
init_FormError();
|
|
6156
|
-
var
|
|
6183
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
6157
6184
|
function DeleteAccountSection({ onDeleted }) {
|
|
6158
6185
|
const t = useT();
|
|
6159
6186
|
const account = useAccount();
|
|
@@ -6178,18 +6205,18 @@ function DeleteAccountSection({ onDeleted }) {
|
|
|
6178
6205
|
}
|
|
6179
6206
|
);
|
|
6180
6207
|
};
|
|
6181
|
-
return /* @__PURE__ */ (0,
|
|
6182
|
-
/* @__PURE__ */ (0,
|
|
6183
|
-
/* @__PURE__ */ (0,
|
|
6184
|
-
/* @__PURE__ */ (0,
|
|
6208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { className: "ba-profile-section ba-profile-danger-zone", "aria-labelledby": titleId, children: [
|
|
6209
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6210
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.delete.title") }),
|
|
6211
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "ba-muted", children: t("userProfile.delete.description") })
|
|
6185
6212
|
] }),
|
|
6186
|
-
/* @__PURE__ */ (0,
|
|
6187
|
-
/* @__PURE__ */ (0,
|
|
6188
|
-
/* @__PURE__ */ (0,
|
|
6213
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
6214
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "ba-profile-delete-warning", children: t("userProfile.delete.warning", { identifier }) }),
|
|
6215
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "ba-label", children: [
|
|
6189
6216
|
t("userProfile.delete.confirmLabel"),
|
|
6190
6217
|
" ",
|
|
6191
|
-
/* @__PURE__ */ (0,
|
|
6192
|
-
/* @__PURE__ */ (0,
|
|
6218
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Bidi, { children: identifier }),
|
|
6219
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6193
6220
|
"input",
|
|
6194
6221
|
{
|
|
6195
6222
|
className: "ba-input",
|
|
@@ -6203,15 +6230,15 @@ function DeleteAccountSection({ onDeleted }) {
|
|
|
6203
6230
|
}
|
|
6204
6231
|
)
|
|
6205
6232
|
] }),
|
|
6206
|
-
/* @__PURE__ */ (0,
|
|
6207
|
-
/* @__PURE__ */ (0,
|
|
6233
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormError, { children: error }),
|
|
6234
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6208
6235
|
"button",
|
|
6209
6236
|
{
|
|
6210
6237
|
className: "ba-button ba-danger-button ba-profile-submit",
|
|
6211
6238
|
type: "submit",
|
|
6212
6239
|
disabled: pending || !confirmed,
|
|
6213
6240
|
"aria-busy": pending || void 0,
|
|
6214
|
-
children: /* @__PURE__ */ (0,
|
|
6241
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.delete.submit") })
|
|
6215
6242
|
}
|
|
6216
6243
|
)
|
|
6217
6244
|
] })
|
|
@@ -6225,7 +6252,7 @@ init_i18n();
|
|
|
6225
6252
|
init_use_submit_action();
|
|
6226
6253
|
init_Spinner();
|
|
6227
6254
|
init_FormError();
|
|
6228
|
-
var
|
|
6255
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
6229
6256
|
function MfaSection() {
|
|
6230
6257
|
const t = useT();
|
|
6231
6258
|
const { user } = useUser();
|
|
@@ -6238,12 +6265,12 @@ function MfaSection() {
|
|
|
6238
6265
|
const titleId = React33.useId();
|
|
6239
6266
|
const required = (0, import_core3.resolveProjectCapabilities)(config).mfaRequired;
|
|
6240
6267
|
if (!user?.twoFactorEnabled) {
|
|
6241
|
-
return /* @__PURE__ */ (0,
|
|
6242
|
-
/* @__PURE__ */ (0,
|
|
6243
|
-
/* @__PURE__ */ (0,
|
|
6244
|
-
/* @__PURE__ */ (0,
|
|
6268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6269
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6270
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.mfa.title") }),
|
|
6271
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "ba-muted", children: required ? t("userProfile.mfa.requiredDescription") : t("userProfile.mfa.description") })
|
|
6245
6272
|
] }),
|
|
6246
|
-
/* @__PURE__ */ (0,
|
|
6273
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6247
6274
|
MFAEnrollment,
|
|
6248
6275
|
{
|
|
6249
6276
|
title: null,
|
|
@@ -6266,16 +6293,16 @@ function MfaSection() {
|
|
|
6266
6293
|
}
|
|
6267
6294
|
);
|
|
6268
6295
|
};
|
|
6269
|
-
return /* @__PURE__ */ (0,
|
|
6270
|
-
/* @__PURE__ */ (0,
|
|
6271
|
-
/* @__PURE__ */ (0,
|
|
6272
|
-
/* @__PURE__ */ (0,
|
|
6296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6297
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6298
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.mfa.title") }),
|
|
6299
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "ba-muted", children: required ? t("userProfile.mfa.requiredActive") : t("userProfile.mfa.active") })
|
|
6273
6300
|
] }),
|
|
6274
|
-
/* @__PURE__ */ (0,
|
|
6275
|
-
/* @__PURE__ */ (0,
|
|
6276
|
-
/* @__PURE__ */ (0,
|
|
6301
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "ba-profile-status", role: "status", children: [
|
|
6302
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: t("userProfile.mfa.enabled") }),
|
|
6303
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: t("userProfile.mfa.authenticator") })
|
|
6277
6304
|
] }),
|
|
6278
|
-
!showDisable ? /* @__PURE__ */ (0,
|
|
6305
|
+
!showDisable ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6279
6306
|
"button",
|
|
6280
6307
|
{
|
|
6281
6308
|
className: "ba-button ba-button-secondary ba-profile-submit",
|
|
@@ -6283,11 +6310,11 @@ function MfaSection() {
|
|
|
6283
6310
|
onClick: () => setShowDisable(true),
|
|
6284
6311
|
children: required ? t("userProfile.mfa.replace") : t("userProfile.mfa.disable")
|
|
6285
6312
|
}
|
|
6286
|
-
) : /* @__PURE__ */ (0,
|
|
6287
|
-
/* @__PURE__ */ (0,
|
|
6288
|
-
/* @__PURE__ */ (0,
|
|
6313
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("form", { method: "post", className: "ba-fields ba-profile-security-form", onSubmit: submitDisable, children: [
|
|
6314
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "ba-muted", children: required ? t("userProfile.mfa.replaceWarning") : t("userProfile.mfa.disableWarning") }),
|
|
6315
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "ba-label", children: [
|
|
6289
6316
|
t("common.passwordLabel"),
|
|
6290
|
-
/* @__PURE__ */ (0,
|
|
6317
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6291
6318
|
"input",
|
|
6292
6319
|
{
|
|
6293
6320
|
className: "ba-input",
|
|
@@ -6299,19 +6326,19 @@ function MfaSection() {
|
|
|
6299
6326
|
}
|
|
6300
6327
|
)
|
|
6301
6328
|
] }),
|
|
6302
|
-
/* @__PURE__ */ (0,
|
|
6303
|
-
/* @__PURE__ */ (0,
|
|
6304
|
-
/* @__PURE__ */ (0,
|
|
6329
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormError, { children: error }),
|
|
6330
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "ba-profile-action-row", children: [
|
|
6331
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6305
6332
|
"button",
|
|
6306
6333
|
{
|
|
6307
6334
|
className: "ba-button ba-danger-button",
|
|
6308
6335
|
type: "submit",
|
|
6309
6336
|
disabled: pending || !password,
|
|
6310
6337
|
"aria-busy": pending || void 0,
|
|
6311
|
-
children: /* @__PURE__ */ (0,
|
|
6338
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Busy, { busy: pending, label: t("common.working"), children: required ? t("userProfile.mfa.replaceConfirm") : t("userProfile.mfa.disableConfirm") })
|
|
6312
6339
|
}
|
|
6313
6340
|
),
|
|
6314
|
-
/* @__PURE__ */ (0,
|
|
6341
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6315
6342
|
"button",
|
|
6316
6343
|
{
|
|
6317
6344
|
className: "ba-button ba-button-secondary",
|
|
@@ -6336,7 +6363,7 @@ init_i18n();
|
|
|
6336
6363
|
init_use_submit_action();
|
|
6337
6364
|
init_Spinner();
|
|
6338
6365
|
init_FormError();
|
|
6339
|
-
var
|
|
6366
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
6340
6367
|
function PasswordSection() {
|
|
6341
6368
|
const t = useT();
|
|
6342
6369
|
const account = useAccount();
|
|
@@ -6372,43 +6399,43 @@ function PasswordSection() {
|
|
|
6372
6399
|
}
|
|
6373
6400
|
);
|
|
6374
6401
|
};
|
|
6375
|
-
return /* @__PURE__ */ (0,
|
|
6376
|
-
/* @__PURE__ */ (0,
|
|
6377
|
-
/* @__PURE__ */ (0,
|
|
6378
|
-
/* @__PURE__ */ (0,
|
|
6402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6403
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6404
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.password.title") }),
|
|
6405
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "ba-muted", children: t("userProfile.password.description") })
|
|
6379
6406
|
] }),
|
|
6380
|
-
/* @__PURE__ */ (0,
|
|
6381
|
-
/* @__PURE__ */ (0,
|
|
6407
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
6408
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "ba-label", children: [
|
|
6382
6409
|
t("userProfile.password.currentLabel"),
|
|
6383
|
-
/* @__PURE__ */ (0,
|
|
6410
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { className: "ba-input", type: "password", autoComplete: "current-password", value: currentPassword, onChange: (event) => {
|
|
6384
6411
|
setCurrentPassword(event.target.value);
|
|
6385
6412
|
setError(null);
|
|
6386
6413
|
}, required: true })
|
|
6387
6414
|
] }),
|
|
6388
|
-
/* @__PURE__ */ (0,
|
|
6415
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "ba-label", children: [
|
|
6389
6416
|
t("resetPassword.newPasswordLabel"),
|
|
6390
|
-
/* @__PURE__ */ (0,
|
|
6417
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { className: "ba-input", type: "password", autoComplete: "new-password", value: newPassword, onChange: (event) => {
|
|
6391
6418
|
setNewPassword(event.target.value);
|
|
6392
6419
|
setError(null);
|
|
6393
6420
|
}, minLength: passwordMinLength, maxLength: passwordMaxLength, required: true })
|
|
6394
6421
|
] }),
|
|
6395
|
-
/* @__PURE__ */ (0,
|
|
6422
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "ba-label", children: [
|
|
6396
6423
|
t("resetPassword.confirmPasswordLabel"),
|
|
6397
|
-
/* @__PURE__ */ (0,
|
|
6424
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { className: "ba-input", type: "password", autoComplete: "new-password", value: confirmPassword, onChange: (event) => {
|
|
6398
6425
|
setConfirmPassword(event.target.value);
|
|
6399
6426
|
setError(null);
|
|
6400
6427
|
}, minLength: passwordMinLength, maxLength: passwordMaxLength, required: true })
|
|
6401
6428
|
] }),
|
|
6402
|
-
/* @__PURE__ */ (0,
|
|
6403
|
-
saved && /* @__PURE__ */ (0,
|
|
6404
|
-
/* @__PURE__ */ (0,
|
|
6429
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormError, { children: error }),
|
|
6430
|
+
saved && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "ba-success", role: "status", children: t("userProfile.password.saved") }),
|
|
6431
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
6405
6432
|
"button",
|
|
6406
6433
|
{
|
|
6407
6434
|
className: "ba-button ba-profile-submit",
|
|
6408
6435
|
type: "submit",
|
|
6409
6436
|
disabled: pending || !currentPassword || !newPassword || !confirmPassword,
|
|
6410
6437
|
"aria-busy": pending || void 0,
|
|
6411
|
-
children: /* @__PURE__ */ (0,
|
|
6438
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.password.submit") })
|
|
6412
6439
|
}
|
|
6413
6440
|
)
|
|
6414
6441
|
] })
|
|
@@ -6418,16 +6445,16 @@ function PasswordSection() {
|
|
|
6418
6445
|
// src/components/user-profile/PasskeysSection.tsx
|
|
6419
6446
|
var React35 = __toESM(require("react"), 1);
|
|
6420
6447
|
init_i18n();
|
|
6421
|
-
var
|
|
6448
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
6422
6449
|
function PasskeysSection({ allowAdd }) {
|
|
6423
6450
|
const t = useT();
|
|
6424
6451
|
const titleId = React35.useId();
|
|
6425
|
-
return /* @__PURE__ */ (0,
|
|
6426
|
-
/* @__PURE__ */ (0,
|
|
6427
|
-
/* @__PURE__ */ (0,
|
|
6428
|
-
/* @__PURE__ */ (0,
|
|
6452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6453
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6454
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.passkeys.title") }),
|
|
6455
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "ba-muted", children: t("userProfile.passkeys.description") })
|
|
6429
6456
|
] }),
|
|
6430
|
-
/* @__PURE__ */ (0,
|
|
6457
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PasskeyManager, { title: null, allowAdd })
|
|
6431
6458
|
] });
|
|
6432
6459
|
}
|
|
6433
6460
|
|
|
@@ -6438,7 +6465,7 @@ init_i18n();
|
|
|
6438
6465
|
init_use_submit_action();
|
|
6439
6466
|
init_Spinner();
|
|
6440
6467
|
init_FormError();
|
|
6441
|
-
var
|
|
6468
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
6442
6469
|
function ProfileSection({
|
|
6443
6470
|
firstLastName,
|
|
6444
6471
|
usernameEnabled,
|
|
@@ -6480,15 +6507,15 @@ function ProfileSection({
|
|
|
6480
6507
|
}
|
|
6481
6508
|
);
|
|
6482
6509
|
};
|
|
6483
|
-
return /* @__PURE__ */ (0,
|
|
6484
|
-
/* @__PURE__ */ (0,
|
|
6485
|
-
/* @__PURE__ */ (0,
|
|
6486
|
-
/* @__PURE__ */ (0,
|
|
6510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6511
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6512
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.profile.title") }),
|
|
6513
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "ba-muted", children: t("userProfile.profile.description") })
|
|
6487
6514
|
] }),
|
|
6488
|
-
/* @__PURE__ */ (0,
|
|
6489
|
-
legacyNameField && /* @__PURE__ */ (0,
|
|
6515
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
6516
|
+
legacyNameField && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "ba-label", children: [
|
|
6490
6517
|
t("signUp.nameLabel"),
|
|
6491
|
-
/* @__PURE__ */ (0,
|
|
6518
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6492
6519
|
"input",
|
|
6493
6520
|
{
|
|
6494
6521
|
className: "ba-input",
|
|
@@ -6499,10 +6526,10 @@ function ProfileSection({
|
|
|
6499
6526
|
}
|
|
6500
6527
|
)
|
|
6501
6528
|
] }),
|
|
6502
|
-
firstLastName && /* @__PURE__ */ (0,
|
|
6503
|
-
/* @__PURE__ */ (0,
|
|
6529
|
+
firstLastName && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
6530
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "ba-label", children: [
|
|
6504
6531
|
t("signUp.firstNameLabel"),
|
|
6505
|
-
/* @__PURE__ */ (0,
|
|
6532
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6506
6533
|
"input",
|
|
6507
6534
|
{
|
|
6508
6535
|
className: "ba-input",
|
|
@@ -6512,9 +6539,9 @@ function ProfileSection({
|
|
|
6512
6539
|
}
|
|
6513
6540
|
)
|
|
6514
6541
|
] }),
|
|
6515
|
-
/* @__PURE__ */ (0,
|
|
6542
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "ba-label", children: [
|
|
6516
6543
|
t("signUp.lastNameLabel"),
|
|
6517
|
-
/* @__PURE__ */ (0,
|
|
6544
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6518
6545
|
"input",
|
|
6519
6546
|
{
|
|
6520
6547
|
className: "ba-input",
|
|
@@ -6525,9 +6552,9 @@ function ProfileSection({
|
|
|
6525
6552
|
)
|
|
6526
6553
|
] })
|
|
6527
6554
|
] }),
|
|
6528
|
-
usernameEnabled && /* @__PURE__ */ (0,
|
|
6555
|
+
usernameEnabled && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "ba-label", children: [
|
|
6529
6556
|
t("common.usernameLabel"),
|
|
6530
|
-
/* @__PURE__ */ (0,
|
|
6557
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6531
6558
|
"input",
|
|
6532
6559
|
{
|
|
6533
6560
|
className: "ba-input",
|
|
@@ -6537,9 +6564,9 @@ function ProfileSection({
|
|
|
6537
6564
|
}
|
|
6538
6565
|
)
|
|
6539
6566
|
] }),
|
|
6540
|
-
/* @__PURE__ */ (0,
|
|
6567
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "ba-label", children: [
|
|
6541
6568
|
t("userProfile.profile.imageLabel"),
|
|
6542
|
-
/* @__PURE__ */ (0,
|
|
6569
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6543
6570
|
"input",
|
|
6544
6571
|
{
|
|
6545
6572
|
className: "ba-input",
|
|
@@ -6550,16 +6577,16 @@ function ProfileSection({
|
|
|
6550
6577
|
}
|
|
6551
6578
|
)
|
|
6552
6579
|
] }),
|
|
6553
|
-
/* @__PURE__ */ (0,
|
|
6554
|
-
saved && /* @__PURE__ */ (0,
|
|
6555
|
-
/* @__PURE__ */ (0,
|
|
6580
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormError, { children: error }),
|
|
6581
|
+
saved && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "ba-success", role: "status", children: t("userProfile.profile.saved") }),
|
|
6582
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6556
6583
|
"button",
|
|
6557
6584
|
{
|
|
6558
6585
|
className: "ba-button ba-profile-submit",
|
|
6559
6586
|
type: "submit",
|
|
6560
6587
|
disabled: pending || legacyNameField && !name.trim(),
|
|
6561
6588
|
"aria-busy": pending || void 0,
|
|
6562
|
-
children: /* @__PURE__ */ (0,
|
|
6589
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("userProfile.save") })
|
|
6563
6590
|
}
|
|
6564
6591
|
)
|
|
6565
6592
|
] })
|
|
@@ -6570,24 +6597,24 @@ function ProfileSection({
|
|
|
6570
6597
|
var React37 = __toESM(require("react"), 1);
|
|
6571
6598
|
init_hooks();
|
|
6572
6599
|
init_i18n();
|
|
6573
|
-
var
|
|
6600
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6574
6601
|
function RecoverySection() {
|
|
6575
6602
|
const t = useT();
|
|
6576
6603
|
const { user } = useUser();
|
|
6577
6604
|
const titleId = React37.useId();
|
|
6578
|
-
return /* @__PURE__ */ (0,
|
|
6579
|
-
/* @__PURE__ */ (0,
|
|
6580
|
-
/* @__PURE__ */ (0,
|
|
6581
|
-
/* @__PURE__ */ (0,
|
|
6605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6606
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6607
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.recovery.title") }),
|
|
6608
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "ba-muted", children: t("userProfile.recovery.description") })
|
|
6582
6609
|
] }),
|
|
6583
|
-
/* @__PURE__ */ (0,
|
|
6584
|
-
/* @__PURE__ */ (0,
|
|
6585
|
-
user?.email && user.emailVerified ? /* @__PURE__ */ (0,
|
|
6586
|
-
/* @__PURE__ */ (0,
|
|
6587
|
-
/* @__PURE__ */ (0,
|
|
6588
|
-
] }) : /* @__PURE__ */ (0,
|
|
6610
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "ba-profile-recovery-card", children: [
|
|
6611
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("strong", { children: t("userProfile.recovery.emailTitle") }),
|
|
6612
|
+
user?.email && user.emailVerified ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
6613
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { children: t("userProfile.recovery.emailDescription") }),
|
|
6614
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Bidi, { children: user.email })
|
|
6615
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { children: t("userProfile.recovery.emailUnavailable") })
|
|
6589
6616
|
] }),
|
|
6590
|
-
/* @__PURE__ */ (0,
|
|
6617
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(BackupCodesManager, { title: null })
|
|
6591
6618
|
] });
|
|
6592
6619
|
}
|
|
6593
6620
|
|
|
@@ -6684,7 +6711,7 @@ function useAccountResource(loader2, failure) {
|
|
|
6684
6711
|
|
|
6685
6712
|
// src/components/user-profile/SessionsSection.tsx
|
|
6686
6713
|
init_FormError();
|
|
6687
|
-
var
|
|
6714
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
6688
6715
|
function SessionsSection() {
|
|
6689
6716
|
const t = useT();
|
|
6690
6717
|
const locale = useLocale();
|
|
@@ -6713,31 +6740,31 @@ function SessionsSection() {
|
|
|
6713
6740
|
}
|
|
6714
6741
|
);
|
|
6715
6742
|
};
|
|
6716
|
-
return /* @__PURE__ */ (0,
|
|
6717
|
-
/* @__PURE__ */ (0,
|
|
6718
|
-
/* @__PURE__ */ (0,
|
|
6719
|
-
/* @__PURE__ */ (0,
|
|
6743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6744
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6745
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.sessions.title") }),
|
|
6746
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "ba-muted", children: t("userProfile.sessions.description") })
|
|
6720
6747
|
] }),
|
|
6721
|
-
resource.data === null ? resource.loading ? /* @__PURE__ */ (0,
|
|
6722
|
-
/* @__PURE__ */ (0,
|
|
6723
|
-
/* @__PURE__ */ (0,
|
|
6724
|
-
] }) : null : /* @__PURE__ */ (0,
|
|
6748
|
+
resource.data === null ? resource.loading ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "ba-profile-list-skeleton", "aria-busy": "true", children: [
|
|
6749
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "ba-skeleton" }),
|
|
6750
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "ba-skeleton" })
|
|
6751
|
+
] }) : null : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("ul", { className: "ba-profile-list", children: [
|
|
6725
6752
|
sessions.map((session) => {
|
|
6726
6753
|
const label2 = session.userAgent?.trim() || t("userProfile.sessions.unknownDevice");
|
|
6727
|
-
return /* @__PURE__ */ (0,
|
|
6728
|
-
/* @__PURE__ */ (0,
|
|
6729
|
-
/* @__PURE__ */ (0,
|
|
6730
|
-
/* @__PURE__ */ (0,
|
|
6731
|
-
session.id === currentId && /* @__PURE__ */ (0,
|
|
6754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("li", { className: "ba-profile-list-item", children: [
|
|
6755
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
6756
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: label2 }),
|
|
6757
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("small", { children: [
|
|
6758
|
+
session.id === currentId && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("em", { children: t("userProfile.sessions.current") }),
|
|
6732
6759
|
formatSessionTime(session.updatedAt, locale)
|
|
6733
6760
|
] })
|
|
6734
6761
|
] }),
|
|
6735
|
-
/* @__PURE__ */ (0,
|
|
6762
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { className: "ba-link-button ba-danger", type: "button", disabled: mutation.pending, onClick: () => revoke(session.id, label2), children: t("userProfile.sessions.revoke") })
|
|
6736
6763
|
] }, session.id);
|
|
6737
6764
|
}),
|
|
6738
|
-
sessions.length === 0 && /* @__PURE__ */ (0,
|
|
6765
|
+
sessions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { className: "ba-muted", children: t("userProfile.sessions.empty") })
|
|
6739
6766
|
] }),
|
|
6740
|
-
sessions.some((session) => session.id !== currentId) && /* @__PURE__ */ (0,
|
|
6767
|
+
sessions.some((session) => session.id !== currentId) && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6741
6768
|
"button",
|
|
6742
6769
|
{
|
|
6743
6770
|
className: "ba-button ba-button-secondary ba-profile-submit",
|
|
@@ -6753,11 +6780,11 @@ function SessionsSection() {
|
|
|
6753
6780
|
children: t("userProfile.sessions.revokeOthers")
|
|
6754
6781
|
}
|
|
6755
6782
|
),
|
|
6756
|
-
resource.error && /* @__PURE__ */ (0,
|
|
6757
|
-
/* @__PURE__ */ (0,
|
|
6758
|
-
/* @__PURE__ */ (0,
|
|
6783
|
+
resource.error && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "ba-profile-inline-error", children: [
|
|
6784
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FormError, { children: resource.error }),
|
|
6785
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void resource.load(), children: t("userProfile.retry") })
|
|
6759
6786
|
] }),
|
|
6760
|
-
/* @__PURE__ */ (0,
|
|
6787
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FormError, { children: mutation.error })
|
|
6761
6788
|
] });
|
|
6762
6789
|
}
|
|
6763
6790
|
|
|
@@ -6767,7 +6794,7 @@ init_hooks();
|
|
|
6767
6794
|
init_i18n();
|
|
6768
6795
|
init_use_submit_action();
|
|
6769
6796
|
init_FormError();
|
|
6770
|
-
var
|
|
6797
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6771
6798
|
function providerLabel(provider) {
|
|
6772
6799
|
return provider.charAt(0).toUpperCase() + provider.slice(1);
|
|
6773
6800
|
}
|
|
@@ -6807,18 +6834,18 @@ function SocialSection() {
|
|
|
6807
6834
|
{ failure: t("userProfile.social.unlinkError"), onSuccess: resource.load }
|
|
6808
6835
|
);
|
|
6809
6836
|
};
|
|
6810
|
-
return /* @__PURE__ */ (0,
|
|
6811
|
-
/* @__PURE__ */ (0,
|
|
6812
|
-
/* @__PURE__ */ (0,
|
|
6813
|
-
/* @__PURE__ */ (0,
|
|
6837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { className: "ba-profile-section", "aria-labelledby": titleId, children: [
|
|
6838
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("header", { className: "ba-profile-section-header", children: [
|
|
6839
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { id: titleId, className: "ba-title", children: t("userProfile.social.title") }),
|
|
6840
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "ba-muted", children: t("userProfile.social.description") })
|
|
6814
6841
|
] }),
|
|
6815
|
-
resource.data === null ? resource.loading ? /* @__PURE__ */ (0,
|
|
6816
|
-
linked.map((item) => /* @__PURE__ */ (0,
|
|
6817
|
-
/* @__PURE__ */ (0,
|
|
6818
|
-
/* @__PURE__ */ (0,
|
|
6819
|
-
/* @__PURE__ */ (0,
|
|
6842
|
+
resource.data === null ? resource.loading ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "ba-profile-list-skeleton", "aria-busy": "true", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "ba-skeleton" }) }) : null : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("ul", { className: "ba-profile-list", children: [
|
|
6843
|
+
linked.map((item) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("li", { className: "ba-profile-list-item", children: [
|
|
6844
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { children: [
|
|
6845
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: providerLabel(item.providerId) }),
|
|
6846
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("small", { children: item.canUnlink ? t("userProfile.social.connected") : t("userProfile.social.lastMethod") })
|
|
6820
6847
|
] }),
|
|
6821
|
-
/* @__PURE__ */ (0,
|
|
6848
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6822
6849
|
"button",
|
|
6823
6850
|
{
|
|
6824
6851
|
className: "ba-link-button ba-danger",
|
|
@@ -6833,17 +6860,17 @@ function SocialSection() {
|
|
|
6833
6860
|
}
|
|
6834
6861
|
)
|
|
6835
6862
|
] }, item.id)),
|
|
6836
|
-
linked.length === 0 && /* @__PURE__ */ (0,
|
|
6863
|
+
linked.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { className: "ba-muted", children: t("userProfile.social.empty") })
|
|
6837
6864
|
] }),
|
|
6838
|
-
available.length > 0 && /* @__PURE__ */ (0,
|
|
6839
|
-
/* @__PURE__ */ (0,
|
|
6840
|
-
available.map((provider) => /* @__PURE__ */ (0,
|
|
6865
|
+
available.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "ba-profile-provider-actions", children: [
|
|
6866
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "ba-profile-subtitle", children: t("userProfile.social.add") }),
|
|
6867
|
+
available.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", className: "ba-button ba-button-secondary", disabled: mutation.pending, onClick: () => link(provider), children: t("userProfile.social.connectProvider", { provider: providerLabel(provider) }) }, provider))
|
|
6841
6868
|
] }),
|
|
6842
|
-
resource.error && /* @__PURE__ */ (0,
|
|
6843
|
-
/* @__PURE__ */ (0,
|
|
6844
|
-
/* @__PURE__ */ (0,
|
|
6869
|
+
resource.error && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "ba-profile-inline-error", children: [
|
|
6870
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormError, { children: resource.error }),
|
|
6871
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void resource.load(), children: t("userProfile.retry") })
|
|
6845
6872
|
] }),
|
|
6846
|
-
/* @__PURE__ */ (0,
|
|
6873
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormError, { children: mutation.error })
|
|
6847
6874
|
] });
|
|
6848
6875
|
}
|
|
6849
6876
|
|
|
@@ -6851,7 +6878,7 @@ function SocialSection() {
|
|
|
6851
6878
|
var React41 = __toESM(require("react"), 1);
|
|
6852
6879
|
init_i18n();
|
|
6853
6880
|
init_ModalSurface();
|
|
6854
|
-
var
|
|
6881
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6855
6882
|
function UserProfileModal({
|
|
6856
6883
|
children,
|
|
6857
6884
|
onClose,
|
|
@@ -6859,7 +6886,7 @@ function UserProfileModal({
|
|
|
6859
6886
|
}) {
|
|
6860
6887
|
const t = useT();
|
|
6861
6888
|
const titleId = React41.useId();
|
|
6862
|
-
return /* @__PURE__ */ (0,
|
|
6889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
6863
6890
|
ModalSurface,
|
|
6864
6891
|
{
|
|
6865
6892
|
overlayClassName: "ba-profile-overlay",
|
|
@@ -6868,13 +6895,13 @@ function UserProfileModal({
|
|
|
6868
6895
|
testId: "user-profile-modal",
|
|
6869
6896
|
onClose,
|
|
6870
6897
|
children: [
|
|
6871
|
-
/* @__PURE__ */ (0,
|
|
6872
|
-
/* @__PURE__ */ (0,
|
|
6898
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "ba-profile-modal-header", children: [
|
|
6899
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { children: [
|
|
6873
6900
|
branding,
|
|
6874
|
-
/* @__PURE__ */ (0,
|
|
6875
|
-
/* @__PURE__ */ (0,
|
|
6901
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h1", { id: titleId, children: t("userProfile.title") }),
|
|
6902
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { children: t("userProfile.description") })
|
|
6876
6903
|
] }),
|
|
6877
|
-
/* @__PURE__ */ (0,
|
|
6904
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6878
6905
|
"button",
|
|
6879
6906
|
{
|
|
6880
6907
|
type: "button",
|
|
@@ -6882,7 +6909,7 @@ function UserProfileModal({
|
|
|
6882
6909
|
"aria-label": t("userProfile.close"),
|
|
6883
6910
|
onClick: onClose,
|
|
6884
6911
|
autoFocus: true,
|
|
6885
|
-
children: /* @__PURE__ */ (0,
|
|
6912
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6886
6913
|
"path",
|
|
6887
6914
|
{
|
|
6888
6915
|
d: "M6 6l12 12M18 6L6 18",
|
|
@@ -6895,14 +6922,14 @@ function UserProfileModal({
|
|
|
6895
6922
|
)
|
|
6896
6923
|
] }),
|
|
6897
6924
|
children,
|
|
6898
|
-
/* @__PURE__ */ (0,
|
|
6925
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("footer", { className: "ba-profile-modal-footer", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(AuthOwlBadge, {}) })
|
|
6899
6926
|
]
|
|
6900
6927
|
}
|
|
6901
6928
|
);
|
|
6902
6929
|
}
|
|
6903
6930
|
|
|
6904
6931
|
// src/components/UserProfile.tsx
|
|
6905
|
-
var
|
|
6932
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6906
6933
|
var SECTION_KEYS = {
|
|
6907
6934
|
profile: "userProfile.nav.profile",
|
|
6908
6935
|
email: "userProfile.nav.email",
|
|
@@ -6968,11 +6995,11 @@ function UserProfile(props = {}) {
|
|
|
6968
6995
|
window.history.replaceState(null, "", userProfileSectionHash(next));
|
|
6969
6996
|
}
|
|
6970
6997
|
};
|
|
6971
|
-
const content = !isLoaded ? /* @__PURE__ */ (0,
|
|
6972
|
-
/* @__PURE__ */ (0,
|
|
6973
|
-
/* @__PURE__ */ (0,
|
|
6974
|
-
/* @__PURE__ */ (0,
|
|
6975
|
-
] }) : !isSignedIn || !user ? /* @__PURE__ */ (0,
|
|
6998
|
+
const content = !isLoaded ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "ba-profile-loading", "aria-busy": "true", children: [
|
|
6999
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "ba-skeleton" }),
|
|
7000
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "ba-skeleton" }),
|
|
7001
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "ba-skeleton" })
|
|
7002
|
+
] }) : !isSignedIn || !user ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "ba-muted", children: t("userProfile.signedOut") }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6976
7003
|
UserProfileBody,
|
|
6977
7004
|
{
|
|
6978
7005
|
active: visibleActive,
|
|
@@ -6984,23 +7011,23 @@ function UserProfile(props = {}) {
|
|
|
6984
7011
|
user.id
|
|
6985
7012
|
);
|
|
6986
7013
|
if (props.mode === "modal") {
|
|
6987
|
-
return /* @__PURE__ */ (0,
|
|
7014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6988
7015
|
UserProfileModal,
|
|
6989
7016
|
{
|
|
6990
7017
|
onClose: props.onClose,
|
|
6991
|
-
branding: showBranding ? /* @__PURE__ */ (0,
|
|
7018
|
+
branding: showBranding ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AuthOwlBranding, {}) : null,
|
|
6992
7019
|
children: content
|
|
6993
7020
|
}
|
|
6994
7021
|
);
|
|
6995
7022
|
}
|
|
6996
|
-
return /* @__PURE__ */ (0,
|
|
6997
|
-
/* @__PURE__ */ (0,
|
|
6998
|
-
showBranding ? /* @__PURE__ */ (0,
|
|
6999
|
-
/* @__PURE__ */ (0,
|
|
7000
|
-
/* @__PURE__ */ (0,
|
|
7023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("article", { className: "ba-profile ba-profile-page", "data-testid": "user-profile", children: [
|
|
7024
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("header", { className: "ba-profile-heading", children: [
|
|
7025
|
+
showBranding ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AuthOwlBranding, {}) : null,
|
|
7026
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h1", { children: t("userProfile.title") }),
|
|
7027
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { children: t("userProfile.description") })
|
|
7001
7028
|
] }),
|
|
7002
7029
|
content,
|
|
7003
|
-
/* @__PURE__ */ (0,
|
|
7030
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("footer", { className: "ba-profile-modal-footer", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AuthOwlBadge, {}) })
|
|
7004
7031
|
] });
|
|
7005
7032
|
}
|
|
7006
7033
|
function UserProfileBody({
|
|
@@ -7011,8 +7038,8 @@ function UserProfileBody({
|
|
|
7011
7038
|
capabilities
|
|
7012
7039
|
}) {
|
|
7013
7040
|
const t = useT();
|
|
7014
|
-
return /* @__PURE__ */ (0,
|
|
7015
|
-
/* @__PURE__ */ (0,
|
|
7041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "ba-profile-layout", children: [
|
|
7042
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("nav", { className: "ba-profile-nav", "aria-label": t("userProfile.nav.aria"), children: sections.map((item) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7016
7043
|
"button",
|
|
7017
7044
|
{
|
|
7018
7045
|
type: "button",
|
|
@@ -7023,8 +7050,8 @@ function UserProfileBody({
|
|
|
7023
7050
|
},
|
|
7024
7051
|
item
|
|
7025
7052
|
)) }),
|
|
7026
|
-
/* @__PURE__ */ (0,
|
|
7027
|
-
active === "profile" && /* @__PURE__ */ (0,
|
|
7053
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "ba-profile-content", "data-section": active, children: [
|
|
7054
|
+
active === "profile" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7028
7055
|
ProfileSection,
|
|
7029
7056
|
{
|
|
7030
7057
|
firstLastName: capabilities.firstLastName,
|
|
@@ -7032,43 +7059,54 @@ function UserProfileBody({
|
|
|
7032
7059
|
legacyNameField: capabilities.legacyNameField
|
|
7033
7060
|
}
|
|
7034
7061
|
),
|
|
7035
|
-
active === "email" && /* @__PURE__ */ (0,
|
|
7036
|
-
active === "password" && /* @__PURE__ */ (0,
|
|
7037
|
-
active === "social" && /* @__PURE__ */ (0,
|
|
7038
|
-
active === "sessions" && /* @__PURE__ */ (0,
|
|
7039
|
-
active === "passkeys" && /* @__PURE__ */ (0,
|
|
7040
|
-
active === "mfa" && /* @__PURE__ */ (0,
|
|
7041
|
-
active === "recovery" && /* @__PURE__ */ (0,
|
|
7042
|
-
active === "danger" && /* @__PURE__ */ (0,
|
|
7062
|
+
active === "email" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(EmailSection, { allowChange: capabilities.emailChange }),
|
|
7063
|
+
active === "password" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PasswordSection, {}),
|
|
7064
|
+
active === "social" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SocialSection, {}),
|
|
7065
|
+
active === "sessions" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SessionsSection, {}),
|
|
7066
|
+
active === "passkeys" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PasskeysSection, { allowAdd: capabilities.passkeyAdd }),
|
|
7067
|
+
active === "mfa" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(MfaSection, {}),
|
|
7068
|
+
active === "recovery" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RecoverySection, {}),
|
|
7069
|
+
active === "danger" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DeleteAccountSection, { onDeleted })
|
|
7043
7070
|
] })
|
|
7044
7071
|
] });
|
|
7045
7072
|
}
|
|
7046
7073
|
|
|
7047
7074
|
// src/components/UserButton.tsx
|
|
7048
|
-
var
|
|
7075
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
7049
7076
|
function UserButton() {
|
|
7050
7077
|
const t = useT();
|
|
7051
7078
|
const { user, isLoaded } = useUser();
|
|
7052
7079
|
const { signOut } = useSignOut();
|
|
7053
7080
|
const [open, setOpen] = React43.useState(false);
|
|
7054
7081
|
const [profileOpen, setProfileOpen] = React43.useState(false);
|
|
7082
|
+
const [failedImage, setFailedImage] = React43.useState(null);
|
|
7055
7083
|
const triggerRef = React43.useRef(null);
|
|
7056
7084
|
if (!isLoaded || !user) return null;
|
|
7057
7085
|
const identity = user.email ?? user.phoneNumber ?? user.name ?? "?";
|
|
7058
|
-
|
|
7059
|
-
|
|
7086
|
+
const image = user.image ?? null;
|
|
7087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "ba-user-button", "data-testid": "user-button", children: [
|
|
7088
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7060
7089
|
"button",
|
|
7061
7090
|
{
|
|
7062
7091
|
ref: triggerRef,
|
|
7063
7092
|
className: "ba-user-button-trigger",
|
|
7064
7093
|
"aria-label": t("userButton.openMenuAria"),
|
|
7065
7094
|
onClick: () => setOpen((v) => !v),
|
|
7066
|
-
children:
|
|
7095
|
+
children: image && failedImage !== image ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7096
|
+
"img",
|
|
7097
|
+
{
|
|
7098
|
+
className: "ba-avatar",
|
|
7099
|
+
src: image,
|
|
7100
|
+
alt: "",
|
|
7101
|
+
referrerPolicy: "no-referrer",
|
|
7102
|
+
onError: () => setFailedImage(image)
|
|
7103
|
+
}
|
|
7104
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "ba-avatar ba-avatar-fallback", children: identity[0]?.toUpperCase() })
|
|
7067
7105
|
}
|
|
7068
7106
|
),
|
|
7069
|
-
open && /* @__PURE__ */ (0,
|
|
7070
|
-
/* @__PURE__ */ (0,
|
|
7071
|
-
/* @__PURE__ */ (0,
|
|
7107
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "ba-menu", children: [
|
|
7108
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "ba-menu-label", children: identity }),
|
|
7109
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7072
7110
|
"button",
|
|
7073
7111
|
{
|
|
7074
7112
|
className: "ba-menu-item",
|
|
@@ -7079,10 +7117,10 @@ function UserButton() {
|
|
|
7079
7117
|
children: t("userButton.manageAccount")
|
|
7080
7118
|
}
|
|
7081
7119
|
),
|
|
7082
|
-
/* @__PURE__ */ (0,
|
|
7083
|
-
/* @__PURE__ */ (0,
|
|
7120
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { className: "ba-menu-item", onClick: () => signOut(), children: t("userButton.signOut") }),
|
|
7121
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "ba-menu-badge", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(AuthOwlBadge, {}) })
|
|
7084
7122
|
] }),
|
|
7085
|
-
profileOpen && /* @__PURE__ */ (0,
|
|
7123
|
+
profileOpen && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7086
7124
|
UserProfile,
|
|
7087
7125
|
{
|
|
7088
7126
|
mode: "modal",
|
|
@@ -7110,7 +7148,7 @@ init_model();
|
|
|
7110
7148
|
init_use_submit_action();
|
|
7111
7149
|
init_Spinner();
|
|
7112
7150
|
init_FormError();
|
|
7113
|
-
var
|
|
7151
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
7114
7152
|
function CreateOrganization({ onCreated, title } = {}) {
|
|
7115
7153
|
const t = useT();
|
|
7116
7154
|
const { config, isLoading: configLoading } = usePublicConfig();
|
|
@@ -7122,10 +7160,10 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7122
7160
|
const [logo, setLogo] = React44.useState("");
|
|
7123
7161
|
const [slugTouched, setSlugTouched] = React44.useState(false);
|
|
7124
7162
|
if (configLoading || !isLoaded) {
|
|
7125
|
-
return /* @__PURE__ */ (0,
|
|
7163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
|
|
7126
7164
|
}
|
|
7127
7165
|
if (config?.organizations !== true) return null;
|
|
7128
|
-
if (!isSignedIn) return /* @__PURE__ */ (0,
|
|
7166
|
+
if (!isSignedIn) return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "ba-muted", children: t("organization.signedOut") });
|
|
7129
7167
|
const submit = (event) => {
|
|
7130
7168
|
event.preventDefault();
|
|
7131
7169
|
const normalizedName = name.trim();
|
|
@@ -7150,15 +7188,15 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7150
7188
|
}
|
|
7151
7189
|
);
|
|
7152
7190
|
};
|
|
7153
|
-
return /* @__PURE__ */ (0,
|
|
7154
|
-
title !== null && /* @__PURE__ */ (0,
|
|
7155
|
-
/* @__PURE__ */ (0,
|
|
7156
|
-
/* @__PURE__ */ (0,
|
|
7191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("section", { className: "ba-organization-create", children: [
|
|
7192
|
+
title !== null && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
7193
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h2", { className: "ba-title", children: title ?? t("organization.create.title") }),
|
|
7194
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "ba-muted", children: t("organization.create.description") })
|
|
7157
7195
|
] }),
|
|
7158
|
-
/* @__PURE__ */ (0,
|
|
7159
|
-
/* @__PURE__ */ (0,
|
|
7196
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
7197
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "ba-label", children: [
|
|
7160
7198
|
t("organization.create.name"),
|
|
7161
|
-
/* @__PURE__ */ (0,
|
|
7199
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7162
7200
|
"input",
|
|
7163
7201
|
{
|
|
7164
7202
|
className: "ba-input",
|
|
@@ -7173,9 +7211,9 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7173
7211
|
}
|
|
7174
7212
|
)
|
|
7175
7213
|
] }),
|
|
7176
|
-
/* @__PURE__ */ (0,
|
|
7214
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "ba-label", children: [
|
|
7177
7215
|
t("organization.create.slug"),
|
|
7178
|
-
/* @__PURE__ */ (0,
|
|
7216
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7179
7217
|
"input",
|
|
7180
7218
|
{
|
|
7181
7219
|
className: "ba-input",
|
|
@@ -7190,9 +7228,9 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7190
7228
|
}
|
|
7191
7229
|
)
|
|
7192
7230
|
] }),
|
|
7193
|
-
/* @__PURE__ */ (0,
|
|
7231
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "ba-label", children: [
|
|
7194
7232
|
t("organization.create.logo"),
|
|
7195
|
-
/* @__PURE__ */ (0,
|
|
7233
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7196
7234
|
"input",
|
|
7197
7235
|
{
|
|
7198
7236
|
className: "ba-input",
|
|
@@ -7204,15 +7242,15 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7204
7242
|
}
|
|
7205
7243
|
)
|
|
7206
7244
|
] }),
|
|
7207
|
-
/* @__PURE__ */ (0,
|
|
7208
|
-
/* @__PURE__ */ (0,
|
|
7245
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FormError, { children: error }),
|
|
7246
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7209
7247
|
"button",
|
|
7210
7248
|
{
|
|
7211
7249
|
className: "ba-button ba-profile-submit",
|
|
7212
7250
|
type: "submit",
|
|
7213
7251
|
disabled: pending || !name.trim() || !slug.trim(),
|
|
7214
7252
|
"aria-busy": pending || void 0,
|
|
7215
|
-
children: /* @__PURE__ */ (0,
|
|
7253
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("organization.create.submit") })
|
|
7216
7254
|
}
|
|
7217
7255
|
)
|
|
7218
7256
|
] })
|
|
@@ -7223,7 +7261,7 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
7223
7261
|
var React45 = __toESM(require("react"), 1);
|
|
7224
7262
|
init_i18n();
|
|
7225
7263
|
init_ModalSurface();
|
|
7226
|
-
var
|
|
7264
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
7227
7265
|
function OrganizationModal({
|
|
7228
7266
|
title,
|
|
7229
7267
|
onClose,
|
|
@@ -7232,7 +7270,7 @@ function OrganizationModal({
|
|
|
7232
7270
|
}) {
|
|
7233
7271
|
const t = useT();
|
|
7234
7272
|
const titleId = React45.useId();
|
|
7235
|
-
return /* @__PURE__ */ (0,
|
|
7273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
7236
7274
|
ModalSurface,
|
|
7237
7275
|
{
|
|
7238
7276
|
overlayClassName: "ba-organization-overlay",
|
|
@@ -7241,9 +7279,9 @@ function OrganizationModal({
|
|
|
7241
7279
|
returnFocusRef,
|
|
7242
7280
|
onClose,
|
|
7243
7281
|
children: [
|
|
7244
|
-
/* @__PURE__ */ (0,
|
|
7245
|
-
/* @__PURE__ */ (0,
|
|
7246
|
-
/* @__PURE__ */ (0,
|
|
7282
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "ba-organization-modal-header", children: [
|
|
7283
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h2", { id: titleId, className: "ba-title", children: title }),
|
|
7284
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
7247
7285
|
"button",
|
|
7248
7286
|
{
|
|
7249
7287
|
className: "ba-profile-close",
|
|
@@ -7255,7 +7293,7 @@ function OrganizationModal({
|
|
|
7255
7293
|
}
|
|
7256
7294
|
)
|
|
7257
7295
|
] }),
|
|
7258
|
-
/* @__PURE__ */ (0,
|
|
7296
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "ba-organization-modal-body", children })
|
|
7259
7297
|
]
|
|
7260
7298
|
}
|
|
7261
7299
|
);
|
|
@@ -7330,7 +7368,7 @@ init_use_submit_action();
|
|
|
7330
7368
|
init_Spinner();
|
|
7331
7369
|
init_model();
|
|
7332
7370
|
init_FormError();
|
|
7333
|
-
var
|
|
7371
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
7334
7372
|
function DangerSection({
|
|
7335
7373
|
organization,
|
|
7336
7374
|
membership,
|
|
@@ -7371,37 +7409,37 @@ function DangerSection({
|
|
|
7371
7409
|
}
|
|
7372
7410
|
);
|
|
7373
7411
|
};
|
|
7374
|
-
return /* @__PURE__ */ (0,
|
|
7375
|
-
/* @__PURE__ */ (0,
|
|
7376
|
-
/* @__PURE__ */ (0,
|
|
7377
|
-
/* @__PURE__ */ (0,
|
|
7412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { className: "ba-organization-section ba-organization-danger", children: [
|
|
7413
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
7414
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h3", { className: "ba-title", children: t("organization.profile.danger.title") }),
|
|
7415
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "ba-muted", children: t("organization.profile.danger.description") })
|
|
7378
7416
|
] }),
|
|
7379
|
-
/* @__PURE__ */ (0,
|
|
7380
|
-
/* @__PURE__ */ (0,
|
|
7381
|
-
/* @__PURE__ */ (0,
|
|
7382
|
-
/* @__PURE__ */ (0,
|
|
7417
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ba-organization-danger-action", children: [
|
|
7418
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: t("organization.profile.danger.leaveTitle") }),
|
|
7419
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "ba-muted", children: isOwner ? t("organization.profile.danger.ownerLeaveHint") : t("organization.profile.danger.leaveHint") }),
|
|
7420
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { className: "ba-button ba-button-secondary", type: "button", disabled: pending, onClick: leave, children: t("organization.profile.danger.leave") })
|
|
7383
7421
|
] }),
|
|
7384
|
-
isOwner && /* @__PURE__ */ (0,
|
|
7385
|
-
/* @__PURE__ */ (0,
|
|
7386
|
-
/* @__PURE__ */ (0,
|
|
7387
|
-
/* @__PURE__ */ (0,
|
|
7422
|
+
isOwner && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("form", { method: "post", className: "ba-organization-danger-action ba-organization-delete", onSubmit: remove, children: [
|
|
7423
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: t("organization.profile.danger.deleteTitle") }),
|
|
7424
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "ba-muted", children: t("organization.profile.danger.deleteHint") }),
|
|
7425
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("label", { className: "ba-label", children: [
|
|
7388
7426
|
t("organization.profile.danger.deleteConfirm"),
|
|
7389
7427
|
" ",
|
|
7390
|
-
/* @__PURE__ */ (0,
|
|
7391
|
-
/* @__PURE__ */ (0,
|
|
7428
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Bidi, { children: organization.slug }),
|
|
7429
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("input", { className: "ba-input", dir: "ltr", value: confirmation, onChange: (event) => setConfirmation(event.target.value), autoComplete: "off", required: true })
|
|
7392
7430
|
] }),
|
|
7393
|
-
/* @__PURE__ */ (0,
|
|
7431
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7394
7432
|
"button",
|
|
7395
7433
|
{
|
|
7396
7434
|
className: "ba-button ba-danger-button",
|
|
7397
7435
|
type: "submit",
|
|
7398
7436
|
disabled: pending || !confirmed,
|
|
7399
7437
|
"aria-busy": pending || void 0,
|
|
7400
|
-
children: /* @__PURE__ */ (0,
|
|
7438
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.danger.delete") })
|
|
7401
7439
|
}
|
|
7402
7440
|
)
|
|
7403
7441
|
] }),
|
|
7404
|
-
/* @__PURE__ */ (0,
|
|
7442
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(FormError, { children: error })
|
|
7405
7443
|
] });
|
|
7406
7444
|
}
|
|
7407
7445
|
|
|
@@ -7413,7 +7451,7 @@ init_use_submit_action();
|
|
|
7413
7451
|
init_Spinner();
|
|
7414
7452
|
init_model();
|
|
7415
7453
|
init_FormError();
|
|
7416
|
-
var
|
|
7454
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
7417
7455
|
function GeneralSection({
|
|
7418
7456
|
organization,
|
|
7419
7457
|
canManage,
|
|
@@ -7431,16 +7469,16 @@ function GeneralSection({
|
|
|
7431
7469
|
setLogo(organization.logo ?? "");
|
|
7432
7470
|
}, [organization.id, organization.logo, organization.name, organization.slug]);
|
|
7433
7471
|
if (!canManage) {
|
|
7434
|
-
return /* @__PURE__ */ (0,
|
|
7435
|
-
/* @__PURE__ */ (0,
|
|
7436
|
-
/* @__PURE__ */ (0,
|
|
7437
|
-
/* @__PURE__ */ (0,
|
|
7438
|
-
/* @__PURE__ */ (0,
|
|
7439
|
-
/* @__PURE__ */ (0,
|
|
7472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("section", { className: "ba-organization-section", children: [
|
|
7473
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "ba-muted", children: t("organization.profile.general.readOnly") }),
|
|
7474
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("dl", { className: "ba-organization-facts", children: [
|
|
7475
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
|
|
7476
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("dt", { children: t("organization.create.name") }),
|
|
7477
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("dd", { children: organization.name })
|
|
7440
7478
|
] }),
|
|
7441
|
-
/* @__PURE__ */ (0,
|
|
7442
|
-
/* @__PURE__ */ (0,
|
|
7443
|
-
/* @__PURE__ */ (0,
|
|
7479
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
|
|
7480
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("dt", { children: t("organization.create.slug") }),
|
|
7481
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Bidi, { children: organization.slug }) })
|
|
7444
7482
|
] })
|
|
7445
7483
|
] })
|
|
7446
7484
|
] });
|
|
@@ -7458,19 +7496,19 @@ function GeneralSection({
|
|
|
7458
7496
|
}
|
|
7459
7497
|
);
|
|
7460
7498
|
};
|
|
7461
|
-
return /* @__PURE__ */ (0,
|
|
7462
|
-
/* @__PURE__ */ (0,
|
|
7463
|
-
/* @__PURE__ */ (0,
|
|
7464
|
-
/* @__PURE__ */ (0,
|
|
7499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("section", { className: "ba-organization-section", children: [
|
|
7500
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
7501
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("h3", { className: "ba-title", children: t("organization.profile.general.title") }),
|
|
7502
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "ba-muted", children: t("organization.profile.general.description") })
|
|
7465
7503
|
] }),
|
|
7466
|
-
/* @__PURE__ */ (0,
|
|
7467
|
-
/* @__PURE__ */ (0,
|
|
7504
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
7505
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("label", { className: "ba-label", children: [
|
|
7468
7506
|
t("organization.create.name"),
|
|
7469
|
-
/* @__PURE__ */ (0,
|
|
7507
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("input", { className: "ba-input", value: name, onChange: (event) => setName(event.target.value), required: true })
|
|
7470
7508
|
] }),
|
|
7471
|
-
/* @__PURE__ */ (0,
|
|
7509
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("label", { className: "ba-label", children: [
|
|
7472
7510
|
t("organization.create.slug"),
|
|
7473
|
-
/* @__PURE__ */ (0,
|
|
7511
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7474
7512
|
"input",
|
|
7475
7513
|
{
|
|
7476
7514
|
className: "ba-input",
|
|
@@ -7482,19 +7520,19 @@ function GeneralSection({
|
|
|
7482
7520
|
}
|
|
7483
7521
|
)
|
|
7484
7522
|
] }),
|
|
7485
|
-
/* @__PURE__ */ (0,
|
|
7523
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("label", { className: "ba-label", children: [
|
|
7486
7524
|
t("organization.create.logo"),
|
|
7487
|
-
/* @__PURE__ */ (0,
|
|
7525
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("input", { className: "ba-input", type: "url", dir: "ltr", value: logo, onChange: (event) => setLogo(event.target.value), placeholder: "https://" })
|
|
7488
7526
|
] }),
|
|
7489
|
-
/* @__PURE__ */ (0,
|
|
7490
|
-
/* @__PURE__ */ (0,
|
|
7527
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormError, { children: error }),
|
|
7528
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7491
7529
|
"button",
|
|
7492
7530
|
{
|
|
7493
7531
|
className: "ba-button ba-profile-submit",
|
|
7494
7532
|
type: "submit",
|
|
7495
7533
|
disabled: pending || !name.trim() || !slug.trim(),
|
|
7496
7534
|
"aria-busy": pending || void 0,
|
|
7497
|
-
children: /* @__PURE__ */ (0,
|
|
7535
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.general.save") })
|
|
7498
7536
|
}
|
|
7499
7537
|
)
|
|
7500
7538
|
] })
|
|
@@ -7524,7 +7562,7 @@ function organizationRoleLabel(role, t) {
|
|
|
7524
7562
|
// src/components/organization/InvitationsSection.tsx
|
|
7525
7563
|
init_use_organization_roles();
|
|
7526
7564
|
init_FormError();
|
|
7527
|
-
var
|
|
7565
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7528
7566
|
function InvitationsSection({
|
|
7529
7567
|
organization,
|
|
7530
7568
|
onChanged
|
|
@@ -7556,38 +7594,38 @@ function InvitationsSection({
|
|
|
7556
7594
|
{ failure: t("organization.profile.invitations.cancelError"), onSuccess: onChanged }
|
|
7557
7595
|
);
|
|
7558
7596
|
};
|
|
7559
|
-
return /* @__PURE__ */ (0,
|
|
7560
|
-
/* @__PURE__ */ (0,
|
|
7561
|
-
/* @__PURE__ */ (0,
|
|
7562
|
-
/* @__PURE__ */ (0,
|
|
7597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("section", { className: "ba-organization-section", children: [
|
|
7598
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
7599
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("h3", { className: "ba-title", children: t("organization.profile.invitations.title") }),
|
|
7600
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "ba-muted", children: t("organization.profile.invitations.description") })
|
|
7563
7601
|
] }),
|
|
7564
|
-
/* @__PURE__ */ (0,
|
|
7565
|
-
/* @__PURE__ */ (0,
|
|
7602
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("form", { method: "post", className: "ba-organization-invite-form", onSubmit: invite, children: [
|
|
7603
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("label", { className: "ba-label", children: [
|
|
7566
7604
|
t("organization.profile.invitations.email"),
|
|
7567
|
-
/* @__PURE__ */ (0,
|
|
7605
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("input", { className: "ba-input", type: "email", dir: "ltr", value: email, onChange: (event) => setEmail(event.target.value), required: true })
|
|
7568
7606
|
] }),
|
|
7569
|
-
/* @__PURE__ */ (0,
|
|
7607
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("label", { className: "ba-label", children: [
|
|
7570
7608
|
t("organization.profile.members.role"),
|
|
7571
|
-
/* @__PURE__ */ (0,
|
|
7609
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("select", { className: "ba-input", value: role, onChange: (event) => setRole(event.target.value), children: roles.map((option) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("option", { value: option, children: organizationRoleLabel(option, t) }, option)) })
|
|
7572
7610
|
] }),
|
|
7573
|
-
/* @__PURE__ */ (0,
|
|
7611
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7574
7612
|
"button",
|
|
7575
7613
|
{
|
|
7576
7614
|
className: "ba-button",
|
|
7577
7615
|
type: "submit",
|
|
7578
7616
|
disabled: pending || !email.trim(),
|
|
7579
7617
|
"aria-busy": pending || void 0,
|
|
7580
|
-
children: /* @__PURE__ */ (0,
|
|
7618
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Busy, { busy: pending, label: t("common.working"), children: t("organization.profile.invitations.invite") })
|
|
7581
7619
|
}
|
|
7582
7620
|
)
|
|
7583
7621
|
] }),
|
|
7584
|
-
/* @__PURE__ */ (0,
|
|
7585
|
-
invitations.length === 0 ? /* @__PURE__ */ (0,
|
|
7586
|
-
/* @__PURE__ */ (0,
|
|
7587
|
-
/* @__PURE__ */ (0,
|
|
7588
|
-
/* @__PURE__ */ (0,
|
|
7622
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FormError, { children: error }),
|
|
7623
|
+
invitations.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "ba-muted", children: t("organization.profile.invitations.empty") }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("li", { className: "ba-organization-invitation", children: [
|
|
7624
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { children: [
|
|
7625
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("strong", { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Bidi, { children: invitation.email }) }),
|
|
7626
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("small", { children: organizationRoleLabel(invitation.role, t) })
|
|
7589
7627
|
] }),
|
|
7590
|
-
/* @__PURE__ */ (0,
|
|
7628
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => cancel(invitation), children: t("organization.profile.invitations.cancel") })
|
|
7591
7629
|
] }, invitation.id)) })
|
|
7592
7630
|
] });
|
|
7593
7631
|
}
|
|
@@ -7599,7 +7637,7 @@ init_use_submit_action();
|
|
|
7599
7637
|
init_model();
|
|
7600
7638
|
init_use_organization_roles();
|
|
7601
7639
|
init_FormError();
|
|
7602
|
-
var
|
|
7640
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7603
7641
|
function MembersSection({
|
|
7604
7642
|
organization,
|
|
7605
7643
|
userId,
|
|
@@ -7626,27 +7664,27 @@ function MembersSection({
|
|
|
7626
7664
|
{ failure: t("organization.profile.members.removeError"), onSuccess: onChanged }
|
|
7627
7665
|
);
|
|
7628
7666
|
};
|
|
7629
|
-
return /* @__PURE__ */ (0,
|
|
7630
|
-
/* @__PURE__ */ (0,
|
|
7631
|
-
/* @__PURE__ */ (0,
|
|
7632
|
-
/* @__PURE__ */ (0,
|
|
7667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("section", { className: "ba-organization-section", children: [
|
|
7668
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
7669
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h3", { className: "ba-title", children: t("organization.profile.members.title") }),
|
|
7670
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "ba-muted", children: t("organization.profile.members.description") })
|
|
7633
7671
|
] }),
|
|
7634
|
-
/* @__PURE__ */ (0,
|
|
7635
|
-
/* @__PURE__ */ (0,
|
|
7672
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FormError, { children: error }),
|
|
7673
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { className: "ba-organization-list", children: organization.members.map((member) => {
|
|
7636
7674
|
const primaryRole = organizationRoles(member.role)[0] ?? member.role;
|
|
7637
7675
|
const isCurrent = member.userId === userId;
|
|
7638
|
-
return /* @__PURE__ */ (0,
|
|
7639
|
-
/* @__PURE__ */ (0,
|
|
7640
|
-
/* @__PURE__ */ (0,
|
|
7641
|
-
/* @__PURE__ */ (0,
|
|
7676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("li", { className: "ba-organization-member", children: [
|
|
7677
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: member.user.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
7678
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "ba-organization-member-copy", children: [
|
|
7679
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("strong", { children: [
|
|
7642
7680
|
member.user.name,
|
|
7643
7681
|
isCurrent ? ` ${t("organization.profile.members.you")}` : ""
|
|
7644
7682
|
] }),
|
|
7645
|
-
/* @__PURE__ */ (0,
|
|
7683
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("small", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Bidi, { children: member.user.email }) })
|
|
7646
7684
|
] }),
|
|
7647
|
-
canManage && !isCurrent ? /* @__PURE__ */ (0,
|
|
7648
|
-
/* @__PURE__ */ (0,
|
|
7649
|
-
/* @__PURE__ */ (0,
|
|
7685
|
+
canManage && !isCurrent ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "ba-organization-member-actions", children: [
|
|
7686
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "ba-sr-only", htmlFor: `organization-role-${member.id}`, children: t("organization.profile.members.role") }),
|
|
7687
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7650
7688
|
"select",
|
|
7651
7689
|
{
|
|
7652
7690
|
id: `organization-role-${member.id}`,
|
|
@@ -7654,11 +7692,11 @@ function MembersSection({
|
|
|
7654
7692
|
value: primaryRole,
|
|
7655
7693
|
disabled: pending,
|
|
7656
7694
|
onChange: (event) => updateRole(member, event.target.value),
|
|
7657
|
-
children: (roles.includes(primaryRole) ? roles : [primaryRole, ...roles]).map((role) => /* @__PURE__ */ (0,
|
|
7695
|
+
children: (roles.includes(primaryRole) ? roles : [primaryRole, ...roles]).map((role) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("option", { value: role, children: organizationRoleLabel(role, t) }, role))
|
|
7658
7696
|
}
|
|
7659
7697
|
),
|
|
7660
|
-
/* @__PURE__ */ (0,
|
|
7661
|
-
] }) : /* @__PURE__ */ (0,
|
|
7698
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("button", { className: "ba-link-button ba-danger", type: "button", disabled: pending, onClick: () => remove(member), children: t("organization.profile.members.remove") })
|
|
7699
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "ba-organization-role-label", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Bidi, { children: organizationRoleLabel(member.role, t) }) })
|
|
7662
7700
|
] }, member.id);
|
|
7663
7701
|
}) })
|
|
7664
7702
|
] });
|
|
@@ -7667,7 +7705,7 @@ function MembersSection({
|
|
|
7667
7705
|
// src/components/OrganizationProfile.tsx
|
|
7668
7706
|
init_model();
|
|
7669
7707
|
init_FormError();
|
|
7670
|
-
var
|
|
7708
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
7671
7709
|
var SECTION_KEYS2 = {
|
|
7672
7710
|
general: "organization.profile.nav.general",
|
|
7673
7711
|
members: "organization.profile.nav.members",
|
|
@@ -7722,20 +7760,20 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
7722
7760
|
requestRef.current += 1;
|
|
7723
7761
|
};
|
|
7724
7762
|
}, [load]);
|
|
7725
|
-
if (configLoading || !isLoaded) return /* @__PURE__ */ (0,
|
|
7763
|
+
if (configLoading || !isLoaded) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
|
|
7726
7764
|
if (config?.organizations !== true) return null;
|
|
7727
|
-
if (!isSignedIn || !user) return /* @__PURE__ */ (0,
|
|
7728
|
-
if (wasRemoved) return /* @__PURE__ */ (0,
|
|
7729
|
-
if (!requestedId) return /* @__PURE__ */ (0,
|
|
7765
|
+
if (!isSignedIn || !user) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "ba-muted", children: t("organization.signedOut") });
|
|
7766
|
+
if (wasRemoved) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "ba-muted", children: t("organization.profile.noActive") });
|
|
7767
|
+
if (!requestedId) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "ba-muted", children: t("organization.profile.noActive") });
|
|
7730
7768
|
if (error) {
|
|
7731
|
-
return /* @__PURE__ */ (0,
|
|
7732
|
-
/* @__PURE__ */ (0,
|
|
7733
|
-
/* @__PURE__ */ (0,
|
|
7769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ba-inline-error", children: [
|
|
7770
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(FormError, { children: error }),
|
|
7771
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void load(), children: t("organization.retry") })
|
|
7734
7772
|
] });
|
|
7735
7773
|
}
|
|
7736
|
-
if (!organization) return /* @__PURE__ */ (0,
|
|
7774
|
+
if (!organization) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
|
|
7737
7775
|
const membership = organization.members.find((member) => member.userId === user.id);
|
|
7738
|
-
if (!membership) return /* @__PURE__ */ (0,
|
|
7776
|
+
if (!membership) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "ba-muted", children: t("organization.profile.notMember") });
|
|
7739
7777
|
const canManage = canManageOrganization(membership);
|
|
7740
7778
|
const visibleSections = canManage ? ["general", "members", "teams", "invitations", "danger"] : ["general", "members", "teams", "danger"];
|
|
7741
7779
|
const activeSection = visibleSections.includes(section) ? section : "general";
|
|
@@ -7744,16 +7782,16 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
7744
7782
|
setOrganization(null);
|
|
7745
7783
|
callback?.(removedOrganization);
|
|
7746
7784
|
};
|
|
7747
|
-
return /* @__PURE__ */ (0,
|
|
7748
|
-
/* @__PURE__ */ (0,
|
|
7749
|
-
/* @__PURE__ */ (0,
|
|
7750
|
-
/* @__PURE__ */ (0,
|
|
7751
|
-
/* @__PURE__ */ (0,
|
|
7752
|
-
/* @__PURE__ */ (0,
|
|
7785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("article", { className: "ba-organization-profile", children: [
|
|
7786
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("header", { className: "ba-organization-profile-heading", children: [
|
|
7787
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "ba-organization-avatar ba-organization-avatar-large", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
7788
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { children: [
|
|
7789
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h2", { className: "ba-title", children: organization.name }),
|
|
7790
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "ba-muted", children: organization.slug })
|
|
7753
7791
|
] })
|
|
7754
7792
|
] }),
|
|
7755
|
-
/* @__PURE__ */ (0,
|
|
7756
|
-
/* @__PURE__ */ (0,
|
|
7793
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ba-organization-profile-layout", children: [
|
|
7794
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("nav", { className: "ba-organization-profile-nav", "aria-label": t("organization.profile.nav.label"), children: visibleSections.map((item) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7757
7795
|
"button",
|
|
7758
7796
|
{
|
|
7759
7797
|
className: "ba-profile-nav-item",
|
|
@@ -7764,12 +7802,12 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
7764
7802
|
},
|
|
7765
7803
|
item
|
|
7766
7804
|
)) }),
|
|
7767
|
-
/* @__PURE__ */ (0,
|
|
7768
|
-
activeSection === "general" && /* @__PURE__ */ (0,
|
|
7769
|
-
activeSection === "members" && /* @__PURE__ */ (0,
|
|
7770
|
-
activeSection === "teams" && /* @__PURE__ */ (0,
|
|
7771
|
-
activeSection === "invitations" && /* @__PURE__ */ (0,
|
|
7772
|
-
activeSection === "danger" && /* @__PURE__ */ (0,
|
|
7805
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ba-organization-profile-content", children: [
|
|
7806
|
+
activeSection === "general" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GeneralSection, { organization, canManage, onChanged: load }),
|
|
7807
|
+
activeSection === "members" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(MembersSection, { organization, userId: user.id, canManage, onChanged: load }),
|
|
7808
|
+
activeSection === "teams" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(React55.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TeamsSection2, { organization, membership }) }),
|
|
7809
|
+
activeSection === "invitations" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(InvitationsSection, { organization, onChanged: load }),
|
|
7810
|
+
activeSection === "danger" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7773
7811
|
DangerSection,
|
|
7774
7812
|
{
|
|
7775
7813
|
organization,
|
|
@@ -7786,7 +7824,7 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
7786
7824
|
// src/components/OrganizationSwitcher.tsx
|
|
7787
7825
|
init_use_submit_action();
|
|
7788
7826
|
init_FormError();
|
|
7789
|
-
var
|
|
7827
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
7790
7828
|
function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChange } = {}) {
|
|
7791
7829
|
const t = useT();
|
|
7792
7830
|
const { config, isLoading: configLoading } = usePublicConfig();
|
|
@@ -7819,9 +7857,9 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
|
|
|
7819
7857
|
document.removeEventListener("keydown", onKeyDown);
|
|
7820
7858
|
};
|
|
7821
7859
|
}, [open]);
|
|
7822
|
-
if (configLoading || !isLoaded) return /* @__PURE__ */ (0,
|
|
7860
|
+
if (configLoading || !isLoaded) return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ba-skeleton ba-organization-switcher-skeleton", "aria-label": t("organization.loading") });
|
|
7823
7861
|
if (config?.organizations !== true) return null;
|
|
7824
|
-
if (!isSignedIn) return /* @__PURE__ */ (0,
|
|
7862
|
+
if (!isSignedIn) return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "ba-muted", children: t("organization.signedOut") });
|
|
7825
7863
|
const select = (organization) => {
|
|
7826
7864
|
void run(
|
|
7827
7865
|
() => api.setActive({ organizationId: organization?.id ?? null }),
|
|
@@ -7864,9 +7902,9 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
|
|
|
7864
7902
|
else if (event.key === "ArrowDown") items[(current + 1 + items.length) % items.length]?.focus();
|
|
7865
7903
|
else items[(current - 1 + items.length) % items.length]?.focus();
|
|
7866
7904
|
};
|
|
7867
|
-
return /* @__PURE__ */ (0,
|
|
7868
|
-
/* @__PURE__ */ (0,
|
|
7869
|
-
/* @__PURE__ */ (0,
|
|
7905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
7906
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { ref: rootRef, className: "ba-organization-switcher", children: [
|
|
7907
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
7870
7908
|
"button",
|
|
7871
7909
|
{
|
|
7872
7910
|
ref: triggerRef,
|
|
@@ -7883,43 +7921,43 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
|
|
|
7883
7921
|
focusMenuItem(event.key === "ArrowDown" ? "first" : "last");
|
|
7884
7922
|
},
|
|
7885
7923
|
children: [
|
|
7886
|
-
/* @__PURE__ */ (0,
|
|
7887
|
-
/* @__PURE__ */ (0,
|
|
7888
|
-
/* @__PURE__ */ (0,
|
|
7924
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: active?.name.trim().charAt(0).toUpperCase() || "P" }),
|
|
7925
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { children: active?.name ?? t("organization.personal") }),
|
|
7926
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { "aria-hidden": "true", children: "\u2304" })
|
|
7889
7927
|
]
|
|
7890
7928
|
}
|
|
7891
7929
|
),
|
|
7892
|
-
open && /* @__PURE__ */ (0,
|
|
7893
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
7894
|
-
showPersonalWorkspace && /* @__PURE__ */ (0,
|
|
7895
|
-
/* @__PURE__ */ (0,
|
|
7896
|
-
/* @__PURE__ */ (0,
|
|
7930
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { ref: menuRef, id: menuId, className: "ba-organization-menu", role: "menu", "aria-label": t("organization.switcher.label"), onKeyDown: onMenuKeyDown, children: [
|
|
7931
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "ba-skeleton" }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
7932
|
+
showPersonalWorkspace && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("button", { className: "ba-organization-menu-item", type: "button", role: "menuitem", "aria-current": activeId === null ? "true" : void 0, disabled: pending, onClick: () => select(null), children: [
|
|
7933
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: "P" }),
|
|
7934
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { children: t("organization.personal") })
|
|
7897
7935
|
] }),
|
|
7898
|
-
organizations?.map((organization) => /* @__PURE__ */ (0,
|
|
7899
|
-
/* @__PURE__ */ (0,
|
|
7900
|
-
/* @__PURE__ */ (0,
|
|
7936
|
+
organizations?.map((organization) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("button", { className: "ba-organization-menu-item", type: "button", role: "menuitem", "aria-current": activeId === organization.id ? "true" : void 0, disabled: pending, onClick: () => select(organization), children: [
|
|
7937
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
7938
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("span", { children: [
|
|
7901
7939
|
organization.name,
|
|
7902
|
-
/* @__PURE__ */ (0,
|
|
7940
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("small", { children: organization.slug })
|
|
7903
7941
|
] })
|
|
7904
7942
|
] }, organization.id))
|
|
7905
7943
|
] }),
|
|
7906
|
-
(loadError || error) && /* @__PURE__ */ (0,
|
|
7907
|
-
/* @__PURE__ */ (0,
|
|
7908
|
-
loadError && /* @__PURE__ */ (0,
|
|
7944
|
+
(loadError || error) && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ba-inline-error", children: [
|
|
7945
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(FormError, { children: loadError ?? error }),
|
|
7946
|
+
loadError && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void refresh(), children: t("organization.retry") })
|
|
7909
7947
|
] }),
|
|
7910
|
-
/* @__PURE__ */ (0,
|
|
7911
|
-
active && /* @__PURE__ */ (0,
|
|
7948
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ba-organization-menu-actions", children: [
|
|
7949
|
+
active && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("button", { className: "ba-menu-item", type: "button", role: "menuitem", onClick: () => {
|
|
7912
7950
|
setOpen(false);
|
|
7913
7951
|
setDialog("profile");
|
|
7914
7952
|
}, children: t("organization.switcher.manage") }),
|
|
7915
|
-
/* @__PURE__ */ (0,
|
|
7953
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("button", { className: "ba-menu-item", type: "button", role: "menuitem", onClick: () => {
|
|
7916
7954
|
setOpen(false);
|
|
7917
7955
|
setDialog("create");
|
|
7918
7956
|
}, children: t("organization.switcher.create") })
|
|
7919
7957
|
] })
|
|
7920
7958
|
] })
|
|
7921
7959
|
] }),
|
|
7922
|
-
dialog === "create" && /* @__PURE__ */ (0,
|
|
7960
|
+
dialog === "create" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(OrganizationModal, { title: t("organization.create.title"), returnFocusRef: triggerRef, onClose: () => setDialog(null), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
7923
7961
|
CreateOrganization,
|
|
7924
7962
|
{
|
|
7925
7963
|
title: null,
|
|
@@ -7933,7 +7971,7 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
|
|
|
7933
7971
|
}
|
|
7934
7972
|
}
|
|
7935
7973
|
) }),
|
|
7936
|
-
dialog === "profile" && active && /* @__PURE__ */ (0,
|
|
7974
|
+
dialog === "profile" && active && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(OrganizationModal, { title: t("organization.profile.title"), returnFocusRef: triggerRef, onClose: () => setDialog(null), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(OrganizationProfile, { organizationId: active.id, onDeleted: () => void afterProfileRemoval(), onLeft: () => void afterProfileRemoval() }) })
|
|
7937
7975
|
] });
|
|
7938
7976
|
}
|
|
7939
7977
|
|
|
@@ -7946,7 +7984,7 @@ init_hooks();
|
|
|
7946
7984
|
init_i18n();
|
|
7947
7985
|
init_use_submit_action();
|
|
7948
7986
|
init_FormError();
|
|
7949
|
-
var
|
|
7987
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
7950
7988
|
function OrganizationList({ onOrganizationChange } = {}) {
|
|
7951
7989
|
const t = useT();
|
|
7952
7990
|
const toServerError = useServerError();
|
|
@@ -7995,9 +8033,9 @@ function OrganizationList({ onOrganizationChange } = {}) {
|
|
|
7995
8033
|
invitationRequestRef.current += 1;
|
|
7996
8034
|
};
|
|
7997
8035
|
}, [isLoaded, loadInvitations, user?.id]);
|
|
7998
|
-
if (configLoading || !isLoaded) return /* @__PURE__ */ (0,
|
|
8036
|
+
if (configLoading || !isLoaded) return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ba-skeleton", "aria-label": t("organization.loading") });
|
|
7999
8037
|
if (config?.organizations !== true) return null;
|
|
8000
|
-
if (!isSignedIn) return /* @__PURE__ */ (0,
|
|
8038
|
+
if (!isSignedIn) return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "ba-muted", children: t("organization.signedOut") });
|
|
8001
8039
|
const setActive = (organization) => {
|
|
8002
8040
|
void run(
|
|
8003
8041
|
() => api.setActive({ organizationId: organization.id }),
|
|
@@ -8038,66 +8076,66 @@ function OrganizationList({ onOrganizationChange } = {}) {
|
|
|
8038
8076
|
setDialog(null);
|
|
8039
8077
|
setProfileId(null);
|
|
8040
8078
|
};
|
|
8041
|
-
return /* @__PURE__ */ (0,
|
|
8042
|
-
/* @__PURE__ */ (0,
|
|
8043
|
-
/* @__PURE__ */ (0,
|
|
8044
|
-
/* @__PURE__ */ (0,
|
|
8045
|
-
/* @__PURE__ */ (0,
|
|
8046
|
-
/* @__PURE__ */ (0,
|
|
8079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
8080
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("section", { className: "ba-organization-directory", children: [
|
|
8081
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("header", { className: "ba-organization-directory-header", children: [
|
|
8082
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { children: [
|
|
8083
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h2", { className: "ba-title", children: t("organization.list.title") }),
|
|
8084
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "ba-muted", children: t("organization.list.description") })
|
|
8047
8085
|
] }),
|
|
8048
|
-
/* @__PURE__ */ (0,
|
|
8086
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-button", type: "button", onClick: (event) => {
|
|
8049
8087
|
dialogReturnFocusRef.current = event.currentTarget;
|
|
8050
8088
|
setDialog("create");
|
|
8051
8089
|
}, children: t("organization.switcher.create") })
|
|
8052
8090
|
] }),
|
|
8053
|
-
(organizationError || error) && /* @__PURE__ */ (0,
|
|
8054
|
-
/* @__PURE__ */ (0,
|
|
8055
|
-
organizationError && /* @__PURE__ */ (0,
|
|
8091
|
+
(organizationError || error) && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ba-inline-error", children: [
|
|
8092
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FormError, { children: organizationError ?? error }),
|
|
8093
|
+
organizationError && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void refresh(), children: t("organization.retry") })
|
|
8056
8094
|
] }),
|
|
8057
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
8058
|
-
/* @__PURE__ */ (0,
|
|
8059
|
-
/* @__PURE__ */ (0,
|
|
8060
|
-
] }) : organizations?.length ? /* @__PURE__ */ (0,
|
|
8061
|
-
/* @__PURE__ */ (0,
|
|
8062
|
-
/* @__PURE__ */ (0,
|
|
8063
|
-
/* @__PURE__ */ (0,
|
|
8064
|
-
/* @__PURE__ */ (0,
|
|
8095
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ba-organization-card-grid", children: [
|
|
8096
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ba-skeleton" }),
|
|
8097
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ba-skeleton" })
|
|
8098
|
+
] }) : organizations?.length ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("ul", { className: "ba-organization-card-grid", children: organizations.map((organization) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("li", { className: "ba-organization-card", children: [
|
|
8099
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ba-organization-avatar ba-organization-avatar-large", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
8100
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "ba-organization-card-copy", children: [
|
|
8101
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("strong", { children: organization.name }),
|
|
8102
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("small", { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Bidi, { children: organization.slug }) })
|
|
8065
8103
|
] }),
|
|
8066
|
-
activeId === organization.id && /* @__PURE__ */ (0,
|
|
8067
|
-
/* @__PURE__ */ (0,
|
|
8068
|
-
activeId !== organization.id && /* @__PURE__ */ (0,
|
|
8069
|
-
/* @__PURE__ */ (0,
|
|
8104
|
+
activeId === organization.id && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ba-organization-active", children: t("organization.list.active") }),
|
|
8105
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "ba-organization-card-actions", children: [
|
|
8106
|
+
activeId !== organization.id && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-button ba-button-secondary", type: "button", disabled: pending, onClick: () => setActive(organization), children: t("organization.list.switch") }),
|
|
8107
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-link-button", type: "button", onClick: (event) => openProfile(organization, event.currentTarget), children: t("organization.list.manage") })
|
|
8070
8108
|
] })
|
|
8071
|
-
] }, organization.id)) }) : organizationError ? null : /* @__PURE__ */ (0,
|
|
8072
|
-
/* @__PURE__ */ (0,
|
|
8073
|
-
/* @__PURE__ */ (0,
|
|
8074
|
-
/* @__PURE__ */ (0,
|
|
8075
|
-
/* @__PURE__ */ (0,
|
|
8109
|
+
] }, organization.id)) }) : organizationError ? null : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "ba-muted", children: t("organization.list.empty") }),
|
|
8110
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("section", { className: "ba-organization-user-invitations", children: [
|
|
8111
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("header", { className: "ba-organization-section-header", children: [
|
|
8112
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h3", { className: "ba-title", children: t("organization.list.invitationsTitle") }),
|
|
8113
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "ba-muted", children: t("organization.list.invitationsDescription") })
|
|
8076
8114
|
] }),
|
|
8077
|
-
invitationError && /* @__PURE__ */ (0,
|
|
8078
|
-
/* @__PURE__ */ (0,
|
|
8079
|
-
/* @__PURE__ */ (0,
|
|
8115
|
+
invitationError && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ba-inline-error", children: [
|
|
8116
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FormError, { children: invitationError }),
|
|
8117
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-link-button", type: "button", onClick: () => void loadInvitations(), children: t("organization.retry") })
|
|
8080
8118
|
] }),
|
|
8081
|
-
invitations?.length ? /* @__PURE__ */ (0,
|
|
8082
|
-
/* @__PURE__ */ (0,
|
|
8083
|
-
/* @__PURE__ */ (0,
|
|
8084
|
-
/* @__PURE__ */ (0,
|
|
8119
|
+
invitations?.length ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("li", { className: "ba-organization-invitation", children: [
|
|
8120
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { children: [
|
|
8121
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("strong", { children: invitation.organizationName }),
|
|
8122
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("small", { children: organizationRoleLabel(invitation.role, t) })
|
|
8085
8123
|
] }),
|
|
8086
|
-
/* @__PURE__ */ (0,
|
|
8087
|
-
/* @__PURE__ */ (0,
|
|
8088
|
-
/* @__PURE__ */ (0,
|
|
8124
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "ba-organization-card-actions", children: [
|
|
8125
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-button", type: "button", disabled: pending, onClick: () => invitationAction(invitation, "accept"), children: t("organization.list.accept") }),
|
|
8126
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: () => invitationAction(invitation, "reject"), children: t("organization.list.reject") })
|
|
8089
8127
|
] })
|
|
8090
|
-
] }, invitation.id)) }) : invitationError ? null : invitations === null ? /* @__PURE__ */ (0,
|
|
8128
|
+
] }, invitation.id)) }) : invitationError ? null : invitations === null ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "ba-skeleton" }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "ba-muted", children: t("organization.list.noInvitations") })
|
|
8091
8129
|
] })
|
|
8092
8130
|
] }),
|
|
8093
|
-
dialog === "create" && /* @__PURE__ */ (0,
|
|
8131
|
+
dialog === "create" && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(OrganizationModal, { title: t("organization.create.title"), returnFocusRef: dialogReturnFocusRef, onClose: () => setDialog(null), children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CreateOrganization, { title: null, onCreated: () => {
|
|
8094
8132
|
void (async () => {
|
|
8095
8133
|
await refresh();
|
|
8096
8134
|
await session.refetch({ query: { disableCookieCache: true } });
|
|
8097
8135
|
setDialog(null);
|
|
8098
8136
|
})();
|
|
8099
8137
|
} }) }),
|
|
8100
|
-
dialog === "profile" && profileId && /* @__PURE__ */ (0,
|
|
8138
|
+
dialog === "profile" && profileId && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(OrganizationModal, { title: t("organization.profile.title"), returnFocusRef: dialogReturnFocusRef, onClose: () => setDialog(null), children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(OrganizationProfile, { organizationId: profileId, onDeleted: () => void afterProfileRemoval(), onLeft: () => void afterProfileRemoval() }) })
|
|
8101
8139
|
] });
|
|
8102
8140
|
}
|
|
8103
8141
|
|