@cedros/login-react 0.0.46 → 0.0.47
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/README.md +32 -2
- package/dist/EmailRegisterForm-ByYQ43yL.cjs +1 -0
- package/dist/EmailRegisterForm-ByYQ43yL.cjs.map +1 -0
- package/dist/EmailRegisterForm-DMUcNQT-.js +781 -0
- package/dist/EmailRegisterForm-DMUcNQT-.js.map +1 -0
- package/dist/GoogleLoginButton-DEwtBp56.cjs +1 -0
- package/dist/GoogleLoginButton-DEwtBp56.cjs.map +1 -0
- package/dist/{GoogleLoginButton-C1WNu7W3.js → GoogleLoginButton-DwyxvhnL.js} +82 -80
- package/dist/GoogleLoginButton-DwyxvhnL.js.map +1 -0
- package/dist/{PermissionsSection-mm9hfp-u.js → PermissionsSection-0oNHPZzL.js} +383 -415
- package/dist/PermissionsSection-0oNHPZzL.js.map +1 -0
- package/dist/PermissionsSection-CZsJuxo4.cjs +1 -0
- package/dist/PermissionsSection-CZsJuxo4.cjs.map +1 -0
- package/dist/SolanaLoginButton-2504p6cr.cjs +1 -0
- package/dist/SolanaLoginButton-2504p6cr.cjs.map +1 -0
- package/dist/SolanaLoginButton-C7Kc_m6n.js +234 -0
- package/dist/SolanaLoginButton-C7Kc_m6n.js.map +1 -0
- package/dist/{TeamSection-Km7EwLWD.cjs → TeamSection-DN8PEHH3.cjs} +1 -1
- package/dist/{TeamSection-Km7EwLWD.cjs.map → TeamSection-DN8PEHH3.cjs.map} +1 -1
- package/dist/{TeamSection-C_eODdLU.js → TeamSection-gUyP4YDM.js} +1 -1
- package/dist/{TeamSection-C_eODdLU.js.map → TeamSection-gUyP4YDM.js.map} +1 -1
- package/dist/{UsersSection-C1Tt0ePx.cjs → UsersSection-8wLuD0fr.cjs} +1 -1
- package/dist/{UsersSection-C1Tt0ePx.cjs.map → UsersSection-8wLuD0fr.cjs.map} +1 -1
- package/dist/{UsersSection-Ct_E-MBF.js → UsersSection-CnsFrG-6.js} +1 -1
- package/dist/{UsersSection-Ct_E-MBF.js.map → UsersSection-CnsFrG-6.js.map} +1 -1
- package/dist/admin-only.cjs +1 -1
- package/dist/admin-only.js +1 -1
- package/dist/email-only.cjs +1 -1
- package/dist/email-only.d.ts +10 -2
- package/dist/email-only.js +2 -2
- package/dist/google-only.cjs +1 -1
- package/dist/google-only.d.ts +7 -2
- package/dist/google-only.js +2 -2
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +182 -11
- package/dist/index.js +5221 -4657
- package/dist/index.js.map +1 -1
- package/dist/login-react.css +1 -1
- package/dist/{plugin-Ci67QMGG.cjs → plugin-DNFjEfYp.cjs} +1 -1
- package/dist/{plugin-Ci67QMGG.cjs.map → plugin-DNFjEfYp.cjs.map} +1 -1
- package/dist/{plugin-Cm8Q6O4-.js → plugin-WYMrRNbz.js} +1 -1
- package/dist/{plugin-Cm8Q6O4-.js.map → plugin-WYMrRNbz.js.map} +1 -1
- package/dist/solana-only.cjs +1 -1
- package/dist/solana-only.d.ts +6 -1
- package/dist/solana-only.js +2 -2
- package/dist/useAuth-2vgrAH-M.cjs +1 -0
- package/dist/useAuth-2vgrAH-M.cjs.map +1 -0
- package/dist/{useAuth-l-itM5am.js → useAuth-CNflw856.js} +465 -469
- package/dist/useAuth-CNflw856.js.map +1 -0
- package/dist/useServerFeatures-9_aNPaa6.cjs +1 -0
- package/dist/useServerFeatures-9_aNPaa6.cjs.map +1 -0
- package/dist/useServerFeatures-DSkYdan-.js +82 -0
- package/dist/useServerFeatures-DSkYdan-.js.map +1 -0
- package/dist/{useUsersStatsSummary-BGeh3RnI.js → useUsersStatsSummary-B4_RBEYy.js} +504 -442
- package/dist/useUsersStatsSummary-B4_RBEYy.js.map +1 -0
- package/dist/useUsersStatsSummary-CHRMrlk4.cjs +1 -0
- package/dist/useUsersStatsSummary-CHRMrlk4.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/EmailRegisterForm-p2X5QP58.js +0 -750
- package/dist/EmailRegisterForm-p2X5QP58.js.map +0 -1
- package/dist/EmailRegisterForm-xFb6MaVA.cjs +0 -1
- package/dist/EmailRegisterForm-xFb6MaVA.cjs.map +0 -1
- package/dist/GoogleLoginButton-2zNTIKMm.cjs +0 -1
- package/dist/GoogleLoginButton-2zNTIKMm.cjs.map +0 -1
- package/dist/GoogleLoginButton-C1WNu7W3.js.map +0 -1
- package/dist/PermissionsSection-4zcE9Zs9.cjs +0 -1
- package/dist/PermissionsSection-4zcE9Zs9.cjs.map +0 -1
- package/dist/PermissionsSection-mm9hfp-u.js.map +0 -1
- package/dist/SolanaLoginButton-CqdzSSeJ.cjs +0 -1
- package/dist/SolanaLoginButton-CqdzSSeJ.cjs.map +0 -1
- package/dist/SolanaLoginButton-CyeX35eU.js +0 -232
- package/dist/SolanaLoginButton-CyeX35eU.js.map +0 -1
- package/dist/sanitization-Bo_tn-L2.cjs +0 -1
- package/dist/sanitization-Bo_tn-L2.cjs.map +0 -1
- package/dist/sanitization-CQ-H1MSg.js +0 -39
- package/dist/sanitization-CQ-H1MSg.js.map +0 -1
- package/dist/useAuth-B1yS_YiD.cjs +0 -1
- package/dist/useAuth-B1yS_YiD.cjs.map +0 -1
- package/dist/useAuth-l-itM5am.js.map +0 -1
- package/dist/useUsersStatsSummary-BGeh3RnI.js.map +0 -1
- package/dist/useUsersStatsSummary-DnsYtFGX.cjs +0 -1
- package/dist/useUsersStatsSummary-DnsYtFGX.cjs.map +0 -1
|
@@ -1,168 +1,167 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as m, jsx as s, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useMemo as _, useCallback as S, useRef as T, useEffect as L } from "react";
|
|
3
3
|
import { L as O } from "./LoadingSpinner-6vml-zwr.js";
|
|
4
4
|
import { E as P } from "./ErrorMessage-CcEK0pYO.js";
|
|
5
|
-
import { a as B } from "./
|
|
6
|
-
import { b as
|
|
7
|
-
import { A as
|
|
5
|
+
import { a as B, u as W } from "./useServerFeatures-DSkYdan-.js";
|
|
6
|
+
import { b as G } from "./validation-B8kMV3BL.js";
|
|
7
|
+
import { A as U, h as R, u as F } from "./useCedrosLogin-CFfID-0i.js";
|
|
8
8
|
import { u as H } from "./useOrgs-C90KT9KP.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function ye({
|
|
9
|
+
const K = ["owner", "admin", "member"];
|
|
10
|
+
function fe({
|
|
12
11
|
members: e,
|
|
13
|
-
currentUserId:
|
|
14
|
-
isLoading:
|
|
15
|
-
error:
|
|
16
|
-
canManage:
|
|
12
|
+
currentUserId: t,
|
|
13
|
+
isLoading: r = !1,
|
|
14
|
+
error: i,
|
|
15
|
+
canManage: n = !1,
|
|
17
16
|
canChangeRoles: c = !1,
|
|
18
17
|
onUpdateRole: f,
|
|
19
|
-
onRemove:
|
|
20
|
-
className:
|
|
18
|
+
onRemove: g,
|
|
19
|
+
className: u = ""
|
|
21
20
|
}) {
|
|
22
|
-
const [o, E] =
|
|
23
|
-
o ===
|
|
24
|
-
},
|
|
25
|
-
const
|
|
26
|
-
return [...e].sort((
|
|
27
|
-
let
|
|
21
|
+
const [o, E] = b("name"), [d, y] = b("asc"), h = (l) => {
|
|
22
|
+
o === l ? y(d === "asc" ? "desc" : "asc") : (E(l), y("asc"));
|
|
23
|
+
}, a = _(() => {
|
|
24
|
+
const l = { owner: 0, admin: 1, member: 2 };
|
|
25
|
+
return [...e].sort((p, w) => {
|
|
26
|
+
let C, v;
|
|
28
27
|
switch (o) {
|
|
29
28
|
case "name":
|
|
30
|
-
|
|
29
|
+
C = (p.user.name || p.user.email || "").toLowerCase(), v = (w.user.name || w.user.email || "").toLowerCase();
|
|
31
30
|
break;
|
|
32
31
|
case "role":
|
|
33
|
-
|
|
32
|
+
C = l[p.role] ?? 99, v = l[w.role] ?? 99;
|
|
34
33
|
break;
|
|
35
34
|
case "joinedAt":
|
|
36
|
-
|
|
35
|
+
C = new Date(p.joinedAt).getTime(), v = new Date(w.joinedAt).getTime();
|
|
37
36
|
break;
|
|
38
37
|
default:
|
|
39
38
|
return 0;
|
|
40
39
|
}
|
|
41
|
-
return
|
|
40
|
+
return C < v ? d === "asc" ? -1 : 1 : C > v ? d === "asc" ? 1 : -1 : 0;
|
|
42
41
|
});
|
|
43
|
-
}, [e, o,
|
|
44
|
-
return
|
|
42
|
+
}, [e, o, d]);
|
|
43
|
+
return r && e.length === 0 ? /* @__PURE__ */ m("div", { className: `cedros-member-list cedros-member-list-loading ${u}`, children: [
|
|
45
44
|
/* @__PURE__ */ s(O, {}),
|
|
46
45
|
/* @__PURE__ */ s("span", { children: "Loading members..." })
|
|
47
|
-
] }) :
|
|
48
|
-
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */ s("th", { children: /* @__PURE__ */
|
|
46
|
+
] }) : i ? /* @__PURE__ */ s("div", { className: `cedros-member-list ${u}`, children: /* @__PURE__ */ s(P, { error: i }) }) : e.length === 0 ? /* @__PURE__ */ s("div", { className: `cedros-member-list cedros-member-list-empty ${u}`, children: /* @__PURE__ */ s("p", { children: "No members found." }) }) : /* @__PURE__ */ s("div", { className: `cedros-member-list ${u}`, children: /* @__PURE__ */ m("table", { className: "cedros-member-table", children: [
|
|
47
|
+
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ m("tr", { children: [
|
|
48
|
+
/* @__PURE__ */ s("th", { children: /* @__PURE__ */ m(
|
|
50
49
|
"button",
|
|
51
50
|
{
|
|
52
51
|
type: "button",
|
|
53
52
|
className: `cedros-admin-sort-button ${o === "name" ? "cedros-admin-sort-active" : ""}`,
|
|
54
|
-
onClick: () =>
|
|
53
|
+
onClick: () => h("name"),
|
|
55
54
|
children: [
|
|
56
55
|
"Member",
|
|
57
56
|
" ",
|
|
58
|
-
/* @__PURE__ */ s("span", { className: "cedros-admin-sort-icon", children: o === "name" ?
|
|
57
|
+
/* @__PURE__ */ s("span", { className: "cedros-admin-sort-icon", children: o === "name" ? d === "asc" ? "↑" : "↓" : "↕" })
|
|
59
58
|
]
|
|
60
59
|
}
|
|
61
60
|
) }),
|
|
62
|
-
/* @__PURE__ */ s("th", { children: /* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ s("th", { children: /* @__PURE__ */ m(
|
|
63
62
|
"button",
|
|
64
63
|
{
|
|
65
64
|
type: "button",
|
|
66
65
|
className: `cedros-admin-sort-button ${o === "role" ? "cedros-admin-sort-active" : ""}`,
|
|
67
|
-
onClick: () =>
|
|
66
|
+
onClick: () => h("role"),
|
|
68
67
|
children: [
|
|
69
68
|
"Role",
|
|
70
69
|
" ",
|
|
71
|
-
/* @__PURE__ */ s("span", { className: "cedros-admin-sort-icon", children: o === "role" ?
|
|
70
|
+
/* @__PURE__ */ s("span", { className: "cedros-admin-sort-icon", children: o === "role" ? d === "asc" ? "↑" : "↓" : "↕" })
|
|
72
71
|
]
|
|
73
72
|
}
|
|
74
73
|
) }),
|
|
75
|
-
/* @__PURE__ */ s("th", { children: /* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ s("th", { children: /* @__PURE__ */ m(
|
|
76
75
|
"button",
|
|
77
76
|
{
|
|
78
77
|
type: "button",
|
|
79
78
|
className: `cedros-admin-sort-button ${o === "joinedAt" ? "cedros-admin-sort-active" : ""}`,
|
|
80
|
-
onClick: () =>
|
|
79
|
+
onClick: () => h("joinedAt"),
|
|
81
80
|
children: [
|
|
82
81
|
"Joined",
|
|
83
82
|
" ",
|
|
84
|
-
/* @__PURE__ */ s("span", { className: "cedros-admin-sort-icon", children: o === "joinedAt" ?
|
|
83
|
+
/* @__PURE__ */ s("span", { className: "cedros-admin-sort-icon", children: o === "joinedAt" ? d === "asc" ? "↑" : "↓" : "↕" })
|
|
85
84
|
]
|
|
86
85
|
}
|
|
87
86
|
) }),
|
|
88
|
-
(
|
|
87
|
+
(n || c) && /* @__PURE__ */ s("th", { children: "Actions" })
|
|
89
88
|
] }) }),
|
|
90
|
-
/* @__PURE__ */ s("tbody", { children:
|
|
91
|
-
|
|
89
|
+
/* @__PURE__ */ s("tbody", { children: a.map((l) => /* @__PURE__ */ s(
|
|
90
|
+
V,
|
|
92
91
|
{
|
|
93
|
-
member:
|
|
94
|
-
isCurrentUser:
|
|
95
|
-
canManage:
|
|
92
|
+
member: l,
|
|
93
|
+
isCurrentUser: l.userId === t,
|
|
94
|
+
canManage: n,
|
|
96
95
|
canChangeRoles: c,
|
|
97
96
|
onUpdateRole: f,
|
|
98
|
-
onRemove:
|
|
97
|
+
onRemove: g
|
|
99
98
|
},
|
|
100
|
-
|
|
99
|
+
l.id
|
|
101
100
|
)) })
|
|
102
101
|
] }) });
|
|
103
102
|
}
|
|
104
|
-
function
|
|
103
|
+
function V({
|
|
105
104
|
member: e,
|
|
106
|
-
isCurrentUser:
|
|
107
|
-
canManage:
|
|
108
|
-
canChangeRoles:
|
|
109
|
-
onUpdateRole:
|
|
105
|
+
isCurrentUser: t,
|
|
106
|
+
canManage: r,
|
|
107
|
+
canChangeRoles: i,
|
|
108
|
+
onUpdateRole: n,
|
|
110
109
|
onRemove: c
|
|
111
110
|
}) {
|
|
112
|
-
const [f,
|
|
113
|
-
async (
|
|
114
|
-
if (!(!
|
|
115
|
-
|
|
111
|
+
const [f, g] = b(!1), [u, o] = b(e.role), E = S(
|
|
112
|
+
async (a) => {
|
|
113
|
+
if (!(!n || a === e.role)) {
|
|
114
|
+
g(!0);
|
|
116
115
|
try {
|
|
117
|
-
await
|
|
116
|
+
await n(e.userId, a), o(a);
|
|
118
117
|
} catch {
|
|
119
118
|
o(e.role);
|
|
120
119
|
} finally {
|
|
121
|
-
|
|
120
|
+
g(!1);
|
|
122
121
|
}
|
|
123
122
|
}
|
|
124
123
|
},
|
|
125
|
-
[e.userId, e.role,
|
|
126
|
-
),
|
|
124
|
+
[e.userId, e.role, n]
|
|
125
|
+
), d = S(async () => {
|
|
127
126
|
if (!(!c || !window.confirm(
|
|
128
127
|
`Are you sure you want to remove ${e.user.name || e.user.email} from this organization?`
|
|
129
128
|
))) {
|
|
130
|
-
|
|
129
|
+
g(!0);
|
|
131
130
|
try {
|
|
132
131
|
await c(e.userId);
|
|
133
132
|
} finally {
|
|
134
|
-
|
|
133
|
+
g(!1);
|
|
135
134
|
}
|
|
136
135
|
}
|
|
137
|
-
}, [e.userId, e.user.name, e.user.email, c]), y = e.role === "owner",
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
136
|
+
}, [e.userId, e.user.name, e.user.email, c]), y = e.role === "owner", h = !t && !y;
|
|
137
|
+
return /* @__PURE__ */ m("tr", { className: `cedros-member-row ${t ? "cedros-member-row-current" : ""}`, children: [
|
|
138
|
+
/* @__PURE__ */ m("td", { className: "cedros-member-info", children: [
|
|
140
139
|
/* @__PURE__ */ s(J, { user: e.user }),
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ m("div", { className: "cedros-member-details", children: [
|
|
141
|
+
/* @__PURE__ */ m("span", { className: "cedros-member-name", children: [
|
|
143
142
|
e.user.name || "Unknown",
|
|
144
|
-
|
|
143
|
+
t && /* @__PURE__ */ s("span", { className: "cedros-member-you", children: "(you)" })
|
|
145
144
|
] }),
|
|
146
145
|
/* @__PURE__ */ s("span", { className: "cedros-member-email", children: e.user.email })
|
|
147
146
|
] })
|
|
148
147
|
] }),
|
|
149
|
-
/* @__PURE__ */ s("td", { className: "cedros-member-role", children:
|
|
148
|
+
/* @__PURE__ */ s("td", { className: "cedros-member-role", children: i && h && n ? /* @__PURE__ */ s(
|
|
150
149
|
"select",
|
|
151
150
|
{
|
|
152
|
-
value:
|
|
153
|
-
onChange: (
|
|
151
|
+
value: u,
|
|
152
|
+
onChange: (a) => E(a.target.value),
|
|
154
153
|
disabled: f,
|
|
155
154
|
className: "cedros-role-select",
|
|
156
|
-
children:
|
|
155
|
+
children: K.map((a) => /* @__PURE__ */ s("option", { value: a, children: a.charAt(0).toUpperCase() + a.slice(1) }, a))
|
|
157
156
|
}
|
|
158
157
|
) : /* @__PURE__ */ s("span", { className: `cedros-role-badge cedros-role-badge-${e.role}`, children: e.role.charAt(0).toUpperCase() + e.role.slice(1) }) }),
|
|
159
158
|
/* @__PURE__ */ s("td", { className: "cedros-member-joined", children: Q(e.joinedAt) }),
|
|
160
|
-
(
|
|
159
|
+
(r || i) && /* @__PURE__ */ s("td", { className: "cedros-member-actions", children: r && h && c && /* @__PURE__ */ s(
|
|
161
160
|
"button",
|
|
162
161
|
{
|
|
163
162
|
type: "button",
|
|
164
163
|
className: "cedros-button cedros-button-danger cedros-button-sm",
|
|
165
|
-
onClick:
|
|
164
|
+
onClick: d,
|
|
166
165
|
disabled: f,
|
|
167
166
|
"aria-label": `Remove ${e.user.name || e.user.email}`,
|
|
168
167
|
children: f ? /* @__PURE__ */ s(O, { size: "sm" }) : "Remove"
|
|
@@ -171,19 +170,19 @@ function K({
|
|
|
171
170
|
] });
|
|
172
171
|
}
|
|
173
172
|
function J({ user: e }) {
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
173
|
+
const t = B(e.picture);
|
|
174
|
+
if (t)
|
|
176
175
|
return /* @__PURE__ */ s(
|
|
177
176
|
"img",
|
|
178
177
|
{
|
|
179
|
-
src:
|
|
178
|
+
src: t,
|
|
180
179
|
alt: e.name || e.email || "Member",
|
|
181
180
|
className: "cedros-member-avatar",
|
|
182
181
|
referrerPolicy: "no-referrer"
|
|
183
182
|
}
|
|
184
183
|
);
|
|
185
|
-
const
|
|
186
|
-
return /* @__PURE__ */ s("div", { className: "cedros-member-avatar-placeholder", children:
|
|
184
|
+
const r = (e.name?.[0] || e.email?.[0] || "?").toUpperCase();
|
|
185
|
+
return /* @__PURE__ */ s("div", { className: "cedros-member-avatar-placeholder", children: r });
|
|
187
186
|
}
|
|
188
187
|
function Q(e) {
|
|
189
188
|
return new Date(e).toLocaleDateString(void 0, {
|
|
@@ -193,47 +192,47 @@ function Q(e) {
|
|
|
193
192
|
});
|
|
194
193
|
}
|
|
195
194
|
const Y = ["admin", "member"];
|
|
196
|
-
function
|
|
195
|
+
function pe({
|
|
197
196
|
onSubmit: e,
|
|
198
|
-
isLoading:
|
|
199
|
-
error:
|
|
200
|
-
availableRoles:
|
|
201
|
-
defaultRole:
|
|
197
|
+
isLoading: t = !1,
|
|
198
|
+
error: r,
|
|
199
|
+
availableRoles: i = Y,
|
|
200
|
+
defaultRole: n = "member",
|
|
202
201
|
className: c = ""
|
|
203
202
|
}) {
|
|
204
|
-
const [f,
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
const [f, g] = b(""), [u, o] = b(n), [E, d] = b(null), [y, h] = b(!1), a = T(null), l = T(!0);
|
|
204
|
+
L(() => (l.current = !0, () => {
|
|
205
|
+
l.current = !1, a.current !== null && (window.clearTimeout(a.current), a.current = null);
|
|
207
206
|
}), []);
|
|
208
|
-
const
|
|
207
|
+
const p = S(
|
|
209
208
|
async (w) => {
|
|
210
|
-
w.preventDefault(),
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
213
|
-
|
|
209
|
+
w.preventDefault(), d(null), h(!1);
|
|
210
|
+
const C = f.trim();
|
|
211
|
+
if (!C) {
|
|
212
|
+
d("Email is required");
|
|
214
213
|
return;
|
|
215
214
|
}
|
|
216
|
-
if (!
|
|
217
|
-
|
|
215
|
+
if (!G(C)) {
|
|
216
|
+
d("Please enter a valid email address");
|
|
218
217
|
return;
|
|
219
218
|
}
|
|
220
219
|
try {
|
|
221
|
-
await e(
|
|
222
|
-
|
|
220
|
+
await e(C, u), g(""), o(n), h(!0), a.current !== null && window.clearTimeout(a.current), a.current = window.setTimeout(() => {
|
|
221
|
+
l.current && h(!1), a.current = null;
|
|
223
222
|
}, 3e3);
|
|
224
223
|
} catch {
|
|
225
224
|
}
|
|
226
225
|
},
|
|
227
|
-
[f,
|
|
226
|
+
[f, u, n, e]
|
|
228
227
|
);
|
|
229
|
-
return /* @__PURE__ */
|
|
230
|
-
(
|
|
231
|
-
y && /* @__PURE__ */
|
|
228
|
+
return /* @__PURE__ */ m("form", { className: `cedros-invite-form ${c}`, onSubmit: p, children: [
|
|
229
|
+
(r || E) && /* @__PURE__ */ s(P, { error: E ?? r ?? null }),
|
|
230
|
+
y && /* @__PURE__ */ m("div", { className: "cedros-invite-success", role: "status", children: [
|
|
232
231
|
/* @__PURE__ */ s(X, {}),
|
|
233
232
|
/* @__PURE__ */ s("span", { children: "Invitation sent successfully!" })
|
|
234
233
|
] }),
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ m("div", { className: "cedros-invite-form-row", children: [
|
|
235
|
+
/* @__PURE__ */ m("div", { className: "cedros-form-group cedros-invite-email-group", children: [
|
|
237
236
|
/* @__PURE__ */ s("label", { htmlFor: "invite-email", className: "cedros-form-label", children: "Email Address" }),
|
|
238
237
|
/* @__PURE__ */ s(
|
|
239
238
|
"input",
|
|
@@ -242,24 +241,24 @@ function we({
|
|
|
242
241
|
type: "email",
|
|
243
242
|
className: "cedros-form-input",
|
|
244
243
|
value: f,
|
|
245
|
-
onChange: (w) =>
|
|
244
|
+
onChange: (w) => g(w.target.value),
|
|
246
245
|
placeholder: "colleague@example.com",
|
|
247
|
-
disabled:
|
|
246
|
+
disabled: t,
|
|
248
247
|
autoComplete: "email"
|
|
249
248
|
}
|
|
250
249
|
)
|
|
251
250
|
] }),
|
|
252
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ m("div", { className: "cedros-form-group cedros-invite-role-group", children: [
|
|
253
252
|
/* @__PURE__ */ s("label", { htmlFor: "invite-role", className: "cedros-form-label", children: "Role" }),
|
|
254
253
|
/* @__PURE__ */ s(
|
|
255
254
|
"select",
|
|
256
255
|
{
|
|
257
256
|
id: "invite-role",
|
|
258
257
|
className: "cedros-form-select",
|
|
259
|
-
value:
|
|
258
|
+
value: u,
|
|
260
259
|
onChange: (w) => o(w.target.value),
|
|
261
|
-
disabled:
|
|
262
|
-
children:
|
|
260
|
+
disabled: t,
|
|
261
|
+
children: i.map((w) => /* @__PURE__ */ s("option", { value: w, children: w.charAt(0).toUpperCase() + w.slice(1) }, w))
|
|
263
262
|
}
|
|
264
263
|
)
|
|
265
264
|
] }),
|
|
@@ -268,8 +267,8 @@ function we({
|
|
|
268
267
|
{
|
|
269
268
|
type: "submit",
|
|
270
269
|
className: "cedros-button cedros-button-primary cedros-invite-submit",
|
|
271
|
-
disabled:
|
|
272
|
-
children:
|
|
270
|
+
disabled: t || !f.trim(),
|
|
271
|
+
children: t ? /* @__PURE__ */ s(O, { size: "sm" }) : "Send Invite"
|
|
273
272
|
}
|
|
274
273
|
)
|
|
275
274
|
] }),
|
|
@@ -299,93 +298,93 @@ function X() {
|
|
|
299
298
|
}
|
|
300
299
|
);
|
|
301
300
|
}
|
|
302
|
-
function
|
|
301
|
+
function ge({
|
|
303
302
|
invites: e,
|
|
304
|
-
isLoading:
|
|
305
|
-
error:
|
|
306
|
-
canManage:
|
|
307
|
-
onCancel:
|
|
303
|
+
isLoading: t = !1,
|
|
304
|
+
error: r,
|
|
305
|
+
canManage: i = !1,
|
|
306
|
+
onCancel: n,
|
|
308
307
|
onResend: c,
|
|
309
308
|
className: f = ""
|
|
310
309
|
}) {
|
|
311
|
-
return
|
|
310
|
+
return t && e.length === 0 ? /* @__PURE__ */ m("div", { className: `cedros-invite-list cedros-invite-list-loading ${f}`, children: [
|
|
312
311
|
/* @__PURE__ */ s(O, {}),
|
|
313
312
|
/* @__PURE__ */ s("span", { children: "Loading invites..." })
|
|
314
|
-
] }) :
|
|
313
|
+
] }) : r ? /* @__PURE__ */ s("div", { className: `cedros-invite-list ${f}`, children: /* @__PURE__ */ s(P, { error: r }) }) : e.length === 0 ? /* @__PURE__ */ s("div", { className: `cedros-invite-list cedros-invite-list-empty ${f}`, children: /* @__PURE__ */ s("p", { children: "No pending invites." }) }) : /* @__PURE__ */ s("div", { className: `cedros-invite-list ${f}`, children: /* @__PURE__ */ s("ul", { className: "cedros-invite-items", children: e.map((g) => /* @__PURE__ */ s(
|
|
315
314
|
Z,
|
|
316
315
|
{
|
|
317
|
-
invite:
|
|
318
|
-
canManage:
|
|
319
|
-
onCancel:
|
|
316
|
+
invite: g,
|
|
317
|
+
canManage: i,
|
|
318
|
+
onCancel: n,
|
|
320
319
|
onResend: c
|
|
321
320
|
},
|
|
322
|
-
|
|
321
|
+
g.id
|
|
323
322
|
)) }) });
|
|
324
323
|
}
|
|
325
|
-
function Z({ invite: e, canManage:
|
|
326
|
-
const [
|
|
327
|
-
if (!(!
|
|
324
|
+
function Z({ invite: e, canManage: t, onCancel: r, onResend: i }) {
|
|
325
|
+
const [n, c] = b(!1), [f, g] = b(!1), u = T(null), o = new Date(e.expiresAt) < /* @__PURE__ */ new Date(), E = S(async () => {
|
|
326
|
+
if (!(!r || !window.confirm(
|
|
328
327
|
`Are you sure you want to cancel the invite for ${e.email}?`
|
|
329
328
|
))) {
|
|
330
329
|
c(!0);
|
|
331
330
|
try {
|
|
332
|
-
await
|
|
331
|
+
await r(e.id);
|
|
333
332
|
} finally {
|
|
334
333
|
c(!1);
|
|
335
334
|
}
|
|
336
335
|
}
|
|
337
|
-
}, [e.id, e.email,
|
|
338
|
-
if (
|
|
339
|
-
c(!0),
|
|
336
|
+
}, [e.id, e.email, r]), d = S(async () => {
|
|
337
|
+
if (i) {
|
|
338
|
+
c(!0), g(!1);
|
|
340
339
|
try {
|
|
341
|
-
await
|
|
342
|
-
|
|
340
|
+
await i(e.id), g(!0), u.current !== null && window.clearTimeout(u.current), u.current = window.setTimeout(() => {
|
|
341
|
+
g(!1), u.current = null;
|
|
343
342
|
}, 3e3);
|
|
344
343
|
} finally {
|
|
345
344
|
c(!1);
|
|
346
345
|
}
|
|
347
346
|
}
|
|
348
|
-
}, [e.id,
|
|
349
|
-
return
|
|
350
|
-
|
|
351
|
-
}, []), /* @__PURE__ */
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
347
|
+
}, [e.id, i]);
|
|
348
|
+
return L(() => () => {
|
|
349
|
+
u.current !== null && (window.clearTimeout(u.current), u.current = null);
|
|
350
|
+
}, []), /* @__PURE__ */ m("li", { className: `cedros-invite-item ${o ? "cedros-invite-item-expired" : ""}`, children: [
|
|
351
|
+
/* @__PURE__ */ m("div", { className: "cedros-invite-item-info", children: [
|
|
352
|
+
/* @__PURE__ */ m("div", { className: "cedros-invite-item-main", children: [
|
|
354
353
|
/* @__PURE__ */ s("span", { className: "cedros-invite-item-email", children: e.email }),
|
|
355
354
|
/* @__PURE__ */ s("span", { className: `cedros-role-badge cedros-role-badge-${e.role}`, children: e.role.charAt(0).toUpperCase() + e.role.slice(1) }),
|
|
356
355
|
o && /* @__PURE__ */ s("span", { className: "cedros-invite-expired-badge", children: "Expired" })
|
|
357
356
|
] }),
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ m("div", { className: "cedros-invite-item-meta", children: [
|
|
358
|
+
/* @__PURE__ */ m("span", { className: "cedros-invite-item-date", children: [
|
|
360
359
|
"Invited ",
|
|
361
360
|
x(e.createdAt)
|
|
362
361
|
] }),
|
|
363
|
-
!o && /* @__PURE__ */
|
|
362
|
+
!o && /* @__PURE__ */ m("span", { className: "cedros-invite-item-expires", children: [
|
|
364
363
|
"Expires ",
|
|
365
364
|
ee(e.expiresAt)
|
|
366
365
|
] })
|
|
367
366
|
] })
|
|
368
367
|
] }),
|
|
369
|
-
|
|
368
|
+
t && /* @__PURE__ */ m("div", { className: "cedros-invite-item-actions", children: [
|
|
370
369
|
f && /* @__PURE__ */ s("span", { className: "cedros-invite-resend-success", children: "Sent!" }),
|
|
371
|
-
|
|
370
|
+
i && !o && /* @__PURE__ */ s(
|
|
372
371
|
"button",
|
|
373
372
|
{
|
|
374
373
|
type: "button",
|
|
375
374
|
className: "cedros-button cedros-button-outline cedros-button-sm",
|
|
376
|
-
onClick:
|
|
377
|
-
disabled:
|
|
375
|
+
onClick: d,
|
|
376
|
+
disabled: n,
|
|
378
377
|
"aria-label": `Resend invite to ${e.email}`,
|
|
379
|
-
children:
|
|
378
|
+
children: n ? /* @__PURE__ */ s(O, { size: "sm" }) : "Resend"
|
|
380
379
|
}
|
|
381
380
|
),
|
|
382
|
-
|
|
381
|
+
r && /* @__PURE__ */ s(
|
|
383
382
|
"button",
|
|
384
383
|
{
|
|
385
384
|
type: "button",
|
|
386
385
|
className: "cedros-button cedros-button-danger cedros-button-sm",
|
|
387
386
|
onClick: E,
|
|
388
|
-
disabled:
|
|
387
|
+
disabled: n,
|
|
389
388
|
"aria-label": `Cancel invite for ${e.email}`,
|
|
390
389
|
children: "Cancel"
|
|
391
390
|
}
|
|
@@ -401,27 +400,27 @@ function x(e) {
|
|
|
401
400
|
});
|
|
402
401
|
}
|
|
403
402
|
function ee(e) {
|
|
404
|
-
const
|
|
405
|
-
return
|
|
403
|
+
const t = new Date(e), r = /* @__PURE__ */ new Date(), i = t.getTime() - r.getTime(), n = Math.ceil(i / (1e3 * 60 * 60 * 24));
|
|
404
|
+
return n < 0 ? "expired" : n === 0 ? "today" : n === 1 ? "tomorrow" : n < 7 ? `in ${n} days` : x(e);
|
|
406
405
|
}
|
|
407
406
|
class se {
|
|
408
407
|
client;
|
|
409
|
-
constructor(
|
|
410
|
-
this.client = new
|
|
408
|
+
constructor(t, r, i, n) {
|
|
409
|
+
this.client = new U({ baseUrl: t, timeoutMs: r, retryAttempts: i, getAccessToken: n });
|
|
411
410
|
}
|
|
412
411
|
/**
|
|
413
412
|
* List all members of an organization
|
|
414
413
|
*/
|
|
415
|
-
async listMembers(
|
|
414
|
+
async listMembers(t, r = 50, i = 0) {
|
|
416
415
|
try {
|
|
417
|
-
const
|
|
418
|
-
`/orgs/${
|
|
416
|
+
const n = await this.client.get(
|
|
417
|
+
`/orgs/${t}/members?limit=${r}&offset=${i}`
|
|
419
418
|
);
|
|
420
419
|
return {
|
|
421
|
-
members:
|
|
420
|
+
members: n.members.map((c) => ({
|
|
422
421
|
id: c.id,
|
|
423
422
|
userId: c.userId,
|
|
424
|
-
orgId:
|
|
423
|
+
orgId: t,
|
|
425
424
|
role: c.role,
|
|
426
425
|
joinedAt: c.joinedAt,
|
|
427
426
|
user: {
|
|
@@ -430,126 +429,126 @@ class se {
|
|
|
430
429
|
name: c.name
|
|
431
430
|
}
|
|
432
431
|
})),
|
|
433
|
-
total:
|
|
432
|
+
total: n.total
|
|
434
433
|
};
|
|
435
|
-
} catch (
|
|
436
|
-
throw
|
|
434
|
+
} catch (n) {
|
|
435
|
+
throw R(n, "Failed to list members");
|
|
437
436
|
}
|
|
438
437
|
}
|
|
439
438
|
/**
|
|
440
439
|
* Update a member's role
|
|
441
440
|
*/
|
|
442
|
-
async updateMemberRole(
|
|
441
|
+
async updateMemberRole(t, r, i) {
|
|
443
442
|
try {
|
|
444
|
-
return await this.client.patch(`/orgs/${
|
|
445
|
-
} catch (
|
|
446
|
-
throw
|
|
443
|
+
return await this.client.patch(`/orgs/${t}/members/${r}`, i);
|
|
444
|
+
} catch (n) {
|
|
445
|
+
throw R(n, "Failed to update member role");
|
|
447
446
|
}
|
|
448
447
|
}
|
|
449
448
|
/**
|
|
450
449
|
* Remove a member from the organization
|
|
451
450
|
*/
|
|
452
|
-
async removeMember(
|
|
451
|
+
async removeMember(t, r) {
|
|
453
452
|
try {
|
|
454
|
-
await this.client.delete(`/orgs/${
|
|
455
|
-
} catch (
|
|
456
|
-
throw
|
|
453
|
+
await this.client.delete(`/orgs/${t}/members/${r}`);
|
|
454
|
+
} catch (i) {
|
|
455
|
+
throw R(i, "Failed to remove member");
|
|
457
456
|
}
|
|
458
457
|
}
|
|
459
458
|
}
|
|
460
|
-
function
|
|
461
|
-
const { config:
|
|
459
|
+
function ye(e) {
|
|
460
|
+
const { config: t, authState: r, _internal: i } = F(), [n, c] = b([]), [f, g] = b(0), [u, o] = b(!1), [E, d] = b(null), y = T(void 0), h = T(0), a = _(
|
|
462
461
|
() => new se(
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
462
|
+
t.serverUrl,
|
|
463
|
+
t.requestTimeout,
|
|
464
|
+
t.retryAttempts,
|
|
465
|
+
i?.getAccessToken
|
|
467
466
|
),
|
|
468
|
-
[
|
|
469
|
-
),
|
|
470
|
-
|
|
471
|
-
const
|
|
472
|
-
async (
|
|
473
|
-
if (!e ||
|
|
474
|
-
c([]),
|
|
467
|
+
[t.serverUrl, t.requestTimeout, t.retryAttempts, i]
|
|
468
|
+
), l = T(a);
|
|
469
|
+
l.current = a;
|
|
470
|
+
const p = S(
|
|
471
|
+
async (v) => {
|
|
472
|
+
if (!e || r !== "authenticated") {
|
|
473
|
+
c([]), g(0);
|
|
475
474
|
return;
|
|
476
475
|
}
|
|
477
|
-
o(!0),
|
|
478
|
-
const N = ++
|
|
476
|
+
o(!0), d(null);
|
|
477
|
+
const N = ++h.current;
|
|
479
478
|
try {
|
|
480
|
-
const { limit: A = 50, offset:
|
|
481
|
-
if (N !==
|
|
482
|
-
c(
|
|
479
|
+
const { limit: A = 50, offset: $ = 0 } = v ?? {}, I = await l.current.listMembers(e, A, $);
|
|
480
|
+
if (N !== h.current) return;
|
|
481
|
+
c(I.members), g(I.total);
|
|
483
482
|
} catch (A) {
|
|
484
|
-
if (N !==
|
|
485
|
-
|
|
483
|
+
if (N !== h.current) return;
|
|
484
|
+
d(A);
|
|
486
485
|
} finally {
|
|
487
|
-
N ===
|
|
486
|
+
N === h.current && o(!1);
|
|
488
487
|
}
|
|
489
488
|
},
|
|
490
|
-
[e,
|
|
489
|
+
[e, r]
|
|
491
490
|
);
|
|
492
|
-
|
|
493
|
-
if (
|
|
491
|
+
L(() => {
|
|
492
|
+
if (r !== "authenticated") {
|
|
494
493
|
y.current = void 0;
|
|
495
494
|
return;
|
|
496
495
|
}
|
|
497
|
-
e !== y.current && (y.current = e,
|
|
498
|
-
}, [e,
|
|
496
|
+
e !== y.current && (y.current = e, p());
|
|
497
|
+
}, [e, r, p]);
|
|
499
498
|
const w = S(
|
|
500
|
-
async (
|
|
499
|
+
async (v, N) => {
|
|
501
500
|
if (!e)
|
|
502
501
|
throw new Error("No organization selected");
|
|
503
|
-
o(!0),
|
|
502
|
+
o(!0), d(null);
|
|
504
503
|
try {
|
|
505
|
-
await
|
|
504
|
+
await l.current.updateMemberRole(e, v, { role: N }), await p();
|
|
506
505
|
} catch (A) {
|
|
507
|
-
throw
|
|
506
|
+
throw d(A), A;
|
|
508
507
|
} finally {
|
|
509
508
|
o(!1);
|
|
510
509
|
}
|
|
511
510
|
},
|
|
512
|
-
[e,
|
|
513
|
-
),
|
|
514
|
-
async (
|
|
511
|
+
[e, p]
|
|
512
|
+
), C = S(
|
|
513
|
+
async (v) => {
|
|
515
514
|
if (!e)
|
|
516
515
|
throw new Error("No organization selected");
|
|
517
|
-
o(!0),
|
|
516
|
+
o(!0), d(null);
|
|
518
517
|
try {
|
|
519
|
-
await
|
|
518
|
+
await l.current.removeMember(e, v), await p();
|
|
520
519
|
} catch (N) {
|
|
521
|
-
throw
|
|
520
|
+
throw d(N), N;
|
|
522
521
|
} finally {
|
|
523
522
|
o(!1);
|
|
524
523
|
}
|
|
525
524
|
},
|
|
526
|
-
[e,
|
|
525
|
+
[e, p]
|
|
527
526
|
);
|
|
528
527
|
return {
|
|
529
|
-
members:
|
|
528
|
+
members: n,
|
|
530
529
|
total: f,
|
|
531
|
-
isLoading:
|
|
530
|
+
isLoading: u,
|
|
532
531
|
error: E,
|
|
533
|
-
fetchMembers:
|
|
532
|
+
fetchMembers: p,
|
|
534
533
|
updateMemberRole: w,
|
|
535
|
-
removeMember:
|
|
534
|
+
removeMember: C
|
|
536
535
|
};
|
|
537
536
|
}
|
|
538
|
-
class
|
|
537
|
+
class te {
|
|
539
538
|
client;
|
|
540
|
-
constructor(
|
|
541
|
-
this.client = new
|
|
539
|
+
constructor(t, r, i, n) {
|
|
540
|
+
this.client = new U({ baseUrl: t, timeoutMs: r, retryAttempts: i, getAccessToken: n });
|
|
542
541
|
}
|
|
543
542
|
/**
|
|
544
543
|
* List all pending invites for an organization
|
|
545
544
|
*/
|
|
546
|
-
async listInvites(
|
|
545
|
+
async listInvites(t, r = 50, i = 0) {
|
|
547
546
|
try {
|
|
548
|
-
const
|
|
549
|
-
`/orgs/${
|
|
547
|
+
const n = await this.client.get(
|
|
548
|
+
`/orgs/${t}/invites?limit=${r}&offset=${i}`
|
|
550
549
|
);
|
|
551
550
|
return {
|
|
552
|
-
invites:
|
|
551
|
+
invites: n.invites.map((c) => ({
|
|
553
552
|
id: c.id,
|
|
554
553
|
orgId: c.orgId,
|
|
555
554
|
email: c.email,
|
|
@@ -558,157 +557,157 @@ class re {
|
|
|
558
557
|
createdAt: c.createdAt,
|
|
559
558
|
expiresAt: c.expiresAt
|
|
560
559
|
})),
|
|
561
|
-
total:
|
|
560
|
+
total: n.total
|
|
562
561
|
};
|
|
563
|
-
} catch (
|
|
564
|
-
throw
|
|
562
|
+
} catch (n) {
|
|
563
|
+
throw R(n, "Failed to list invites");
|
|
565
564
|
}
|
|
566
565
|
}
|
|
567
566
|
/**
|
|
568
567
|
* Create a new invite
|
|
569
568
|
*/
|
|
570
|
-
async createInvite(
|
|
569
|
+
async createInvite(t, r) {
|
|
571
570
|
try {
|
|
572
|
-
return await this.client.post(`/orgs/${
|
|
573
|
-
} catch (
|
|
574
|
-
throw
|
|
571
|
+
return await this.client.post(`/orgs/${t}/invites`, r);
|
|
572
|
+
} catch (i) {
|
|
573
|
+
throw R(i, "Failed to create invite");
|
|
575
574
|
}
|
|
576
575
|
}
|
|
577
576
|
/**
|
|
578
577
|
* Cancel a pending invite
|
|
579
578
|
*/
|
|
580
|
-
async cancelInvite(
|
|
579
|
+
async cancelInvite(t, r) {
|
|
581
580
|
try {
|
|
582
|
-
await this.client.delete(`/orgs/${
|
|
583
|
-
} catch (
|
|
584
|
-
throw
|
|
581
|
+
await this.client.delete(`/orgs/${t}/invites/${r}`);
|
|
582
|
+
} catch (i) {
|
|
583
|
+
throw R(i, "Failed to cancel invite");
|
|
585
584
|
}
|
|
586
585
|
}
|
|
587
586
|
/**
|
|
588
587
|
* Resend an invite email
|
|
589
588
|
*/
|
|
590
|
-
async resendInvite(
|
|
589
|
+
async resendInvite(t, r) {
|
|
591
590
|
try {
|
|
592
|
-
await this.client.post(`/orgs/${
|
|
593
|
-
} catch (
|
|
594
|
-
throw
|
|
591
|
+
await this.client.post(`/orgs/${t}/invites/${r}/resend`, {});
|
|
592
|
+
} catch (i) {
|
|
593
|
+
throw R(i, "Failed to resend invite");
|
|
595
594
|
}
|
|
596
595
|
}
|
|
597
596
|
/**
|
|
598
597
|
* Accept an invite (public endpoint)
|
|
599
598
|
*/
|
|
600
|
-
async acceptInvite(
|
|
599
|
+
async acceptInvite(t) {
|
|
601
600
|
try {
|
|
602
|
-
return await this.client.post("/invites/accept",
|
|
603
|
-
} catch (
|
|
604
|
-
throw
|
|
601
|
+
return await this.client.post("/invites/accept", t);
|
|
602
|
+
} catch (r) {
|
|
603
|
+
throw R(r, "Failed to accept invite");
|
|
605
604
|
}
|
|
606
605
|
}
|
|
607
606
|
}
|
|
608
|
-
function
|
|
609
|
-
const { config:
|
|
610
|
-
() => new
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
607
|
+
function we(e) {
|
|
608
|
+
const { config: t, authState: r, _internal: i } = F(), [n, c] = b([]), [f, g] = b(0), [u, o] = b(!1), [E, d] = b(null), y = T(void 0), h = T(0), a = _(
|
|
609
|
+
() => new te(
|
|
610
|
+
t.serverUrl,
|
|
611
|
+
t.requestTimeout,
|
|
612
|
+
t.retryAttempts,
|
|
613
|
+
i?.getAccessToken
|
|
615
614
|
),
|
|
616
|
-
[
|
|
617
|
-
),
|
|
618
|
-
|
|
619
|
-
const
|
|
615
|
+
[t.serverUrl, t.requestTimeout, t.retryAttempts, i]
|
|
616
|
+
), l = T(a);
|
|
617
|
+
l.current = a;
|
|
618
|
+
const p = S(
|
|
620
619
|
async (A) => {
|
|
621
|
-
if (!e ||
|
|
622
|
-
c([]),
|
|
620
|
+
if (!e || r !== "authenticated") {
|
|
621
|
+
c([]), g(0);
|
|
623
622
|
return;
|
|
624
623
|
}
|
|
625
|
-
o(!0),
|
|
626
|
-
const
|
|
624
|
+
o(!0), d(null);
|
|
625
|
+
const $ = ++h.current;
|
|
627
626
|
try {
|
|
628
|
-
const { limit:
|
|
629
|
-
if (
|
|
630
|
-
c(q.invites),
|
|
631
|
-
} catch (
|
|
632
|
-
if (
|
|
633
|
-
|
|
627
|
+
const { limit: I = 50, offset: j = 0 } = A ?? {}, q = await l.current.listInvites(e, I, j);
|
|
628
|
+
if ($ !== h.current) return;
|
|
629
|
+
c(q.invites), g(q.total);
|
|
630
|
+
} catch (I) {
|
|
631
|
+
if ($ !== h.current) return;
|
|
632
|
+
d(I);
|
|
634
633
|
} finally {
|
|
635
|
-
|
|
634
|
+
$ === h.current && o(!1);
|
|
636
635
|
}
|
|
637
636
|
},
|
|
638
|
-
[e,
|
|
637
|
+
[e, r]
|
|
639
638
|
);
|
|
640
|
-
|
|
641
|
-
if (
|
|
639
|
+
L(() => {
|
|
640
|
+
if (r !== "authenticated") {
|
|
642
641
|
y.current = void 0;
|
|
643
642
|
return;
|
|
644
643
|
}
|
|
645
|
-
e !== y.current && (y.current = e,
|
|
646
|
-
}, [e,
|
|
644
|
+
e !== y.current && (y.current = e, p());
|
|
645
|
+
}, [e, r, p]);
|
|
647
646
|
const w = S(
|
|
648
|
-
async (A,
|
|
647
|
+
async (A, $ = "member") => {
|
|
649
648
|
if (!e)
|
|
650
649
|
throw new Error("No organization selected");
|
|
651
|
-
o(!0),
|
|
650
|
+
o(!0), d(null);
|
|
652
651
|
try {
|
|
653
|
-
await
|
|
654
|
-
} catch (
|
|
655
|
-
throw
|
|
652
|
+
await l.current.createInvite(e, { email: A, role: $ }), await p();
|
|
653
|
+
} catch (I) {
|
|
654
|
+
throw d(I), I;
|
|
656
655
|
} finally {
|
|
657
656
|
o(!1);
|
|
658
657
|
}
|
|
659
658
|
},
|
|
660
|
-
[e,
|
|
661
|
-
),
|
|
659
|
+
[e, p]
|
|
660
|
+
), C = S(
|
|
662
661
|
async (A) => {
|
|
663
662
|
if (!e)
|
|
664
663
|
throw new Error("No organization selected");
|
|
665
|
-
o(!0),
|
|
664
|
+
o(!0), d(null);
|
|
666
665
|
try {
|
|
667
|
-
await
|
|
668
|
-
} catch (
|
|
669
|
-
throw
|
|
666
|
+
await l.current.cancelInvite(e, A), await p();
|
|
667
|
+
} catch ($) {
|
|
668
|
+
throw d($), $;
|
|
670
669
|
} finally {
|
|
671
670
|
o(!1);
|
|
672
671
|
}
|
|
673
672
|
},
|
|
674
|
-
[e,
|
|
675
|
-
),
|
|
673
|
+
[e, p]
|
|
674
|
+
), v = S(
|
|
676
675
|
async (A) => {
|
|
677
676
|
if (!e)
|
|
678
677
|
throw new Error("No organization selected");
|
|
679
|
-
o(!0),
|
|
678
|
+
o(!0), d(null);
|
|
680
679
|
try {
|
|
681
|
-
await
|
|
682
|
-
} catch (
|
|
683
|
-
throw
|
|
680
|
+
await l.current.resendInvite(e, A);
|
|
681
|
+
} catch ($) {
|
|
682
|
+
throw d($), $;
|
|
684
683
|
} finally {
|
|
685
684
|
o(!1);
|
|
686
685
|
}
|
|
687
686
|
},
|
|
688
687
|
[e]
|
|
689
688
|
), N = S(async (A) => {
|
|
690
|
-
o(!0),
|
|
689
|
+
o(!0), d(null);
|
|
691
690
|
try {
|
|
692
|
-
return await
|
|
693
|
-
} catch (
|
|
694
|
-
throw
|
|
691
|
+
return await l.current.acceptInvite({ token: A });
|
|
692
|
+
} catch ($) {
|
|
693
|
+
throw d($), $;
|
|
695
694
|
} finally {
|
|
696
695
|
o(!1);
|
|
697
696
|
}
|
|
698
697
|
}, []);
|
|
699
698
|
return {
|
|
700
|
-
invites:
|
|
699
|
+
invites: n,
|
|
701
700
|
total: f,
|
|
702
|
-
isLoading:
|
|
701
|
+
isLoading: u,
|
|
703
702
|
error: E,
|
|
704
|
-
fetchInvites:
|
|
703
|
+
fetchInvites: p,
|
|
705
704
|
createInvite: w,
|
|
706
|
-
cancelInvite:
|
|
707
|
-
resendInvite:
|
|
705
|
+
cancelInvite: C,
|
|
706
|
+
resendInvite: v,
|
|
708
707
|
acceptInvite: N
|
|
709
708
|
};
|
|
710
709
|
}
|
|
711
|
-
const
|
|
710
|
+
const re = [
|
|
712
711
|
"users",
|
|
713
712
|
"team",
|
|
714
713
|
"referrals",
|
|
@@ -717,12 +716,14 @@ const te = [
|
|
|
717
716
|
"compliance",
|
|
718
717
|
"accreditation-queue",
|
|
719
718
|
"sanctions",
|
|
719
|
+
"signup-gating",
|
|
720
720
|
"settings-wallet",
|
|
721
721
|
"settings-auth",
|
|
722
722
|
"settings-messaging",
|
|
723
723
|
"settings-credits",
|
|
724
724
|
"settings-compliance",
|
|
725
725
|
"settings-referrals",
|
|
726
|
+
"settings-signup",
|
|
726
727
|
"settings-server",
|
|
727
728
|
"settings-images"
|
|
728
729
|
], ne = [
|
|
@@ -736,7 +737,7 @@ const te = [
|
|
|
736
737
|
"pay-payment",
|
|
737
738
|
"pay-messaging",
|
|
738
739
|
"pay-settings"
|
|
739
|
-
],
|
|
740
|
+
], M = {
|
|
740
741
|
// Cedros Login
|
|
741
742
|
users: "Users",
|
|
742
743
|
team: "Team",
|
|
@@ -746,12 +747,14 @@ const te = [
|
|
|
746
747
|
compliance: "Compliance",
|
|
747
748
|
"accreditation-queue": "Accreditation Queue",
|
|
748
749
|
sanctions: "Sanctions",
|
|
750
|
+
"signup-gating": "Signup Gating",
|
|
749
751
|
"settings-wallet": "Wallet Settings",
|
|
750
752
|
"settings-auth": "Auth Settings",
|
|
751
753
|
"settings-messaging": "Messages Settings",
|
|
752
754
|
"settings-credits": "Credits Settings",
|
|
753
755
|
"settings-compliance": "Compliance & Gating",
|
|
754
756
|
"settings-referrals": "Referrals & Rewards",
|
|
757
|
+
"settings-signup": "Signup Gating",
|
|
755
758
|
"settings-server": "Server Settings",
|
|
756
759
|
"settings-images": "Image Storage",
|
|
757
760
|
// Cedros Pay
|
|
@@ -776,12 +779,14 @@ const te = [
|
|
|
776
779
|
compliance: !0,
|
|
777
780
|
"accreditation-queue": !0,
|
|
778
781
|
sanctions: !0,
|
|
782
|
+
"signup-gating": !0,
|
|
779
783
|
"settings-wallet": !0,
|
|
780
784
|
"settings-auth": !0,
|
|
781
785
|
"settings-messaging": !0,
|
|
782
786
|
"settings-credits": !0,
|
|
783
787
|
"settings-compliance": !0,
|
|
784
788
|
"settings-referrals": !0,
|
|
789
|
+
"settings-signup": !0,
|
|
785
790
|
"settings-server": !0,
|
|
786
791
|
"settings-images": !0,
|
|
787
792
|
// Cedros Pay
|
|
@@ -806,12 +811,14 @@ const te = [
|
|
|
806
811
|
compliance: !1,
|
|
807
812
|
"accreditation-queue": !1,
|
|
808
813
|
sanctions: !1,
|
|
814
|
+
"signup-gating": !1,
|
|
809
815
|
"settings-wallet": !1,
|
|
810
816
|
"settings-auth": !1,
|
|
811
817
|
"settings-messaging": !1,
|
|
812
818
|
"settings-credits": !1,
|
|
813
819
|
"settings-compliance": !1,
|
|
814
820
|
"settings-referrals": !1,
|
|
821
|
+
"settings-signup": !1,
|
|
815
822
|
"settings-server": !1,
|
|
816
823
|
"settings-images": !1,
|
|
817
824
|
// Cedros Pay
|
|
@@ -827,34 +834,34 @@ const te = [
|
|
|
827
834
|
"pay-settings": !1
|
|
828
835
|
}
|
|
829
836
|
};
|
|
830
|
-
function
|
|
831
|
-
const { config: e, authState:
|
|
837
|
+
function ie() {
|
|
838
|
+
const { config: e, authState: t, _internal: r } = F(), { activeOrg: i, role: n } = H(), [c, f] = b(
|
|
832
839
|
k
|
|
833
|
-
), [
|
|
834
|
-
() => new
|
|
840
|
+
), [g, u] = b(!1), [o, E] = b(!1), [d, y] = b(null), h = T(0), a = _(
|
|
841
|
+
() => new U({
|
|
835
842
|
baseUrl: e.serverUrl,
|
|
836
843
|
timeoutMs: e.requestTimeout,
|
|
837
844
|
retryAttempts: e.retryAttempts,
|
|
838
|
-
getAccessToken:
|
|
845
|
+
getAccessToken: r?.getAccessToken
|
|
839
846
|
}),
|
|
840
|
-
[e.serverUrl, e.requestTimeout, e.retryAttempts,
|
|
841
|
-
),
|
|
842
|
-
|
|
843
|
-
const
|
|
844
|
-
if (
|
|
847
|
+
[e.serverUrl, e.requestTimeout, e.retryAttempts, r]
|
|
848
|
+
), l = T(a);
|
|
849
|
+
l.current = a;
|
|
850
|
+
const p = S(async () => {
|
|
851
|
+
if (t !== "authenticated" || !i) {
|
|
845
852
|
f(k);
|
|
846
853
|
return;
|
|
847
854
|
}
|
|
848
|
-
|
|
849
|
-
const
|
|
855
|
+
u(!0), y(null);
|
|
856
|
+
const v = ++h.current;
|
|
850
857
|
try {
|
|
851
|
-
const N = await
|
|
858
|
+
const N = await l.current.get(
|
|
852
859
|
"/admin/dashboard-permissions"
|
|
853
860
|
);
|
|
854
|
-
if (
|
|
861
|
+
if (v !== h.current) return;
|
|
855
862
|
f(N.permissions);
|
|
856
863
|
} catch (N) {
|
|
857
|
-
if (
|
|
864
|
+
if (v !== h.current) return;
|
|
858
865
|
if (N instanceof Error && N.message.includes("404"))
|
|
859
866
|
f(k);
|
|
860
867
|
else {
|
|
@@ -862,21 +869,21 @@ function ae() {
|
|
|
862
869
|
y({ code: "NETWORK_ERROR", message: A }), f(k);
|
|
863
870
|
}
|
|
864
871
|
} finally {
|
|
865
|
-
|
|
872
|
+
v === h.current && u(!1);
|
|
866
873
|
}
|
|
867
|
-
}, [
|
|
868
|
-
async (
|
|
869
|
-
if (
|
|
874
|
+
}, [t, i]), w = S(
|
|
875
|
+
async (v) => {
|
|
876
|
+
if (t !== "authenticated" || !i)
|
|
870
877
|
throw new Error("Not authenticated");
|
|
871
|
-
if (
|
|
878
|
+
if (n !== "owner")
|
|
872
879
|
throw new Error("Only owners can modify dashboard permissions");
|
|
873
880
|
E(!0), y(null);
|
|
874
881
|
try {
|
|
875
|
-
await
|
|
882
|
+
await l.current.request({
|
|
876
883
|
method: "PUT",
|
|
877
884
|
path: "/admin/dashboard-permissions",
|
|
878
|
-
body:
|
|
879
|
-
}), f(
|
|
885
|
+
body: v
|
|
886
|
+
}), f(v);
|
|
880
887
|
} catch (N) {
|
|
881
888
|
const A = N instanceof Error ? N.message : "Failed to update permissions";
|
|
882
889
|
throw y({ code: "NETWORK_ERROR", message: A }), new Error(A);
|
|
@@ -884,173 +891,134 @@ function ae() {
|
|
|
884
891
|
E(!1);
|
|
885
892
|
}
|
|
886
893
|
},
|
|
887
|
-
[
|
|
888
|
-
),
|
|
889
|
-
(
|
|
890
|
-
[
|
|
894
|
+
[t, i, n]
|
|
895
|
+
), C = S(
|
|
896
|
+
(v) => !i || !n || n === "owner" ? !0 : c[n]?.[v] ?? !1,
|
|
897
|
+
[i, n, c]
|
|
891
898
|
);
|
|
892
|
-
return
|
|
893
|
-
|
|
894
|
-
}, [
|
|
899
|
+
return L(() => {
|
|
900
|
+
i?.id && p();
|
|
901
|
+
}, [i?.id, p]), {
|
|
895
902
|
permissions: c,
|
|
896
|
-
canAccess:
|
|
903
|
+
canAccess: C,
|
|
897
904
|
updatePermissions: w,
|
|
898
|
-
isLoading:
|
|
905
|
+
isLoading: g,
|
|
899
906
|
isUpdating: o,
|
|
900
|
-
error:
|
|
901
|
-
fetchPermissions:
|
|
907
|
+
error: d,
|
|
908
|
+
fetchPermissions: p
|
|
902
909
|
};
|
|
903
910
|
}
|
|
904
|
-
|
|
905
|
-
organizations: !1,
|
|
906
|
-
sso: !1,
|
|
907
|
-
mfa: !1,
|
|
908
|
-
mfaRequired: !1,
|
|
909
|
-
walletSigning: !1,
|
|
910
|
-
credits: !1,
|
|
911
|
-
userWithdrawals: !1,
|
|
912
|
-
cedrosPay: !1
|
|
913
|
-
};
|
|
914
|
-
function ce() {
|
|
915
|
-
const { settings: e, isLoading: r, error: n, fetchSettings: a, getValue: t } = V(), [c, f] = v(!1);
|
|
916
|
-
I(() => {
|
|
917
|
-
c || (a(), f(!0));
|
|
918
|
-
}, [a, c]);
|
|
919
|
-
const u = S((l) => l === void 0 ? !1 : l === "true" || l === "1", []), m = M(() => Object.keys(e).length === 0 ? ie : {
|
|
920
|
-
organizations: u(t("feature_organizations")),
|
|
921
|
-
sso: u(t("feature_sso")),
|
|
922
|
-
mfa: u(t("feature_mfa")),
|
|
923
|
-
mfaRequired: u(t("security_require_mfa")),
|
|
924
|
-
walletSigning: u(t("feature_wallet_signing")),
|
|
925
|
-
credits: u(t("feature_credits")),
|
|
926
|
-
userWithdrawals: u(t("feature_user_withdrawals")),
|
|
927
|
-
cedrosPay: u(t("feature_cedros_pay"))
|
|
928
|
-
}, [e, t, u]), o = S(async () => {
|
|
929
|
-
await a();
|
|
930
|
-
}, [a]), E = S(
|
|
931
|
-
(l) => m[l],
|
|
932
|
-
[m]
|
|
933
|
-
);
|
|
934
|
-
return {
|
|
935
|
-
features: m,
|
|
936
|
-
isLoading: r,
|
|
937
|
-
error: n,
|
|
938
|
-
refetch: o,
|
|
939
|
-
isEnabled: E
|
|
940
|
-
};
|
|
941
|
-
}
|
|
942
|
-
function D({ checked: e, onChange: r, disabled: n, label: a }) {
|
|
911
|
+
function D({ checked: e, onChange: t, disabled: r, label: i }) {
|
|
943
912
|
return /* @__PURE__ */ s(
|
|
944
913
|
"button",
|
|
945
914
|
{
|
|
946
915
|
type: "button",
|
|
947
916
|
role: "switch",
|
|
948
917
|
"aria-checked": e,
|
|
949
|
-
"aria-label":
|
|
950
|
-
disabled:
|
|
951
|
-
className: `cedros-toggle cedros-toggle-sm ${e ? "cedros-toggle-on" : "cedros-toggle-off"} ${
|
|
952
|
-
onClick: () => !
|
|
918
|
+
"aria-label": i,
|
|
919
|
+
disabled: r,
|
|
920
|
+
className: `cedros-toggle cedros-toggle-sm ${e ? "cedros-toggle-on" : "cedros-toggle-off"} ${r ? "cedros-toggle-disabled" : ""}`,
|
|
921
|
+
onClick: () => !r && t(!e),
|
|
953
922
|
children: /* @__PURE__ */ s("span", { className: "cedros-toggle-track", children: /* @__PURE__ */ s("span", { className: "cedros-toggle-thumb" }) })
|
|
954
923
|
}
|
|
955
924
|
);
|
|
956
925
|
}
|
|
957
|
-
function
|
|
958
|
-
const { permissions:
|
|
959
|
-
(
|
|
960
|
-
o.current =
|
|
961
|
-
o.current && (
|
|
926
|
+
function ve({ userRole: e }) {
|
|
927
|
+
const { permissions: t, updatePermissions: r, isLoading: i, isUpdating: n, error: c } = ie(), { features: f, isLoading: g } = W(), u = T(null), o = T(null), E = e === "owner", d = f.cedrosPay, y = S(
|
|
928
|
+
(a) => {
|
|
929
|
+
o.current = a, u.current && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
930
|
+
o.current && (r(o.current).catch(() => {
|
|
962
931
|
}), o.current = null);
|
|
963
932
|
}, 500);
|
|
964
933
|
},
|
|
965
|
-
[
|
|
934
|
+
[r]
|
|
966
935
|
);
|
|
967
|
-
|
|
968
|
-
|
|
936
|
+
L(() => () => {
|
|
937
|
+
u.current && clearTimeout(u.current);
|
|
969
938
|
}, []);
|
|
970
|
-
const
|
|
971
|
-
(
|
|
939
|
+
const h = S(
|
|
940
|
+
(a, l, p) => {
|
|
972
941
|
const w = {
|
|
973
|
-
...
|
|
974
|
-
[
|
|
975
|
-
...
|
|
976
|
-
[
|
|
942
|
+
...t,
|
|
943
|
+
[a]: {
|
|
944
|
+
...t[a],
|
|
945
|
+
[l]: p
|
|
977
946
|
}
|
|
978
947
|
};
|
|
979
948
|
y(w);
|
|
980
949
|
},
|
|
981
|
-
[
|
|
950
|
+
[t, y]
|
|
982
951
|
);
|
|
983
|
-
return
|
|
984
|
-
/* @__PURE__ */
|
|
952
|
+
return i || g ? /* @__PURE__ */ s("div", { className: "cedros-dashboard__section", children: /* @__PURE__ */ s("div", { className: "cedros-dashboard__loading", children: "Loading permissions..." }) }) : E ? /* @__PURE__ */ m("div", { className: "cedros-dashboard__section cedros-permissions-section", children: [
|
|
953
|
+
/* @__PURE__ */ m("div", { className: "cedros-permissions-header", children: [
|
|
985
954
|
/* @__PURE__ */ s("p", { className: "cedros-permissions-description", children: "Configure which dashboard sections each role can access. Owners always have full access." }),
|
|
986
955
|
c && /* @__PURE__ */ s("div", { className: "cedros-permissions-error", children: c.message }),
|
|
987
|
-
|
|
956
|
+
n && /* @__PURE__ */ s("span", { className: "cedros-permissions-saving", children: "Saving..." })
|
|
988
957
|
] }),
|
|
989
|
-
/* @__PURE__ */ s("div", { className: "cedros-permissions-matrix", children: /* @__PURE__ */ s("table", { className: "cedros-permissions-table", children: /* @__PURE__ */
|
|
990
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ s("div", { className: "cedros-permissions-matrix", children: /* @__PURE__ */ s("table", { className: "cedros-permissions-table", children: /* @__PURE__ */ m("tbody", { children: [
|
|
959
|
+
/* @__PURE__ */ m("tr", { className: "cedros-permissions-group-header", children: [
|
|
991
960
|
/* @__PURE__ */ s("th", { className: "cedros-permissions-section-header", children: "Cedros Login" }),
|
|
992
961
|
/* @__PURE__ */ s("th", { className: "cedros-permissions-role-header", children: "Admin" }),
|
|
993
962
|
/* @__PURE__ */ s("th", { className: "cedros-permissions-role-header", children: "Member" })
|
|
994
963
|
] }),
|
|
995
|
-
|
|
996
|
-
/* @__PURE__ */ s("td", { className: "cedros-permissions-section-label", children:
|
|
964
|
+
re.map((a) => /* @__PURE__ */ m("tr", { className: "cedros-permissions-row", children: [
|
|
965
|
+
/* @__PURE__ */ s("td", { className: "cedros-permissions-section-label", children: M[a] }),
|
|
997
966
|
/* @__PURE__ */ s("td", { className: "cedros-permissions-toggle-cell", children: /* @__PURE__ */ s(
|
|
998
967
|
D,
|
|
999
968
|
{
|
|
1000
|
-
checked:
|
|
1001
|
-
onChange: (
|
|
1002
|
-
disabled:
|
|
1003
|
-
label: `Admin access to ${
|
|
969
|
+
checked: t.admin[a] ?? !1,
|
|
970
|
+
onChange: (l) => h("admin", a, l),
|
|
971
|
+
disabled: n,
|
|
972
|
+
label: `Admin access to ${M[a]}`
|
|
1004
973
|
}
|
|
1005
974
|
) }),
|
|
1006
975
|
/* @__PURE__ */ s("td", { className: "cedros-permissions-toggle-cell", children: /* @__PURE__ */ s(
|
|
1007
976
|
D,
|
|
1008
977
|
{
|
|
1009
|
-
checked:
|
|
1010
|
-
onChange: (
|
|
1011
|
-
disabled:
|
|
1012
|
-
label: `Member access to ${
|
|
978
|
+
checked: t.member[a] ?? !1,
|
|
979
|
+
onChange: (l) => h("member", a, l),
|
|
980
|
+
disabled: n,
|
|
981
|
+
label: `Member access to ${M[a]}`
|
|
1013
982
|
}
|
|
1014
983
|
) })
|
|
1015
|
-
] },
|
|
1016
|
-
|
|
1017
|
-
/* @__PURE__ */
|
|
984
|
+
] }, a)),
|
|
985
|
+
d && /* @__PURE__ */ m(z, { children: [
|
|
986
|
+
/* @__PURE__ */ m("tr", { className: "cedros-permissions-group-header", children: [
|
|
1018
987
|
/* @__PURE__ */ s("th", { className: "cedros-permissions-section-header", children: "Cedros Pay" }),
|
|
1019
988
|
/* @__PURE__ */ s("th", { className: "cedros-permissions-role-header", children: "Admin" }),
|
|
1020
989
|
/* @__PURE__ */ s("th", { className: "cedros-permissions-role-header", children: "Member" })
|
|
1021
990
|
] }),
|
|
1022
|
-
ne.map((
|
|
1023
|
-
/* @__PURE__ */ s("td", { className: "cedros-permissions-section-label", children:
|
|
991
|
+
ne.map((a) => /* @__PURE__ */ m("tr", { className: "cedros-permissions-row", children: [
|
|
992
|
+
/* @__PURE__ */ s("td", { className: "cedros-permissions-section-label", children: M[a] }),
|
|
1024
993
|
/* @__PURE__ */ s("td", { className: "cedros-permissions-toggle-cell", children: /* @__PURE__ */ s(
|
|
1025
994
|
D,
|
|
1026
995
|
{
|
|
1027
|
-
checked:
|
|
1028
|
-
onChange: (
|
|
1029
|
-
disabled:
|
|
1030
|
-
label: `Admin access to ${
|
|
996
|
+
checked: t.admin[a] ?? !1,
|
|
997
|
+
onChange: (l) => h("admin", a, l),
|
|
998
|
+
disabled: n,
|
|
999
|
+
label: `Admin access to ${M[a]}`
|
|
1031
1000
|
}
|
|
1032
1001
|
) }),
|
|
1033
1002
|
/* @__PURE__ */ s("td", { className: "cedros-permissions-toggle-cell", children: /* @__PURE__ */ s(
|
|
1034
1003
|
D,
|
|
1035
1004
|
{
|
|
1036
|
-
checked:
|
|
1037
|
-
onChange: (
|
|
1038
|
-
disabled:
|
|
1039
|
-
label: `Member access to ${
|
|
1005
|
+
checked: t.member[a] ?? !1,
|
|
1006
|
+
onChange: (l) => h("member", a, l),
|
|
1007
|
+
disabled: n,
|
|
1008
|
+
label: `Member access to ${M[a]}`
|
|
1040
1009
|
}
|
|
1041
1010
|
) })
|
|
1042
|
-
] },
|
|
1011
|
+
] }, a))
|
|
1043
1012
|
] })
|
|
1044
1013
|
] }) }) })
|
|
1045
1014
|
] }) : /* @__PURE__ */ s("div", { className: "cedros-dashboard__section", children: /* @__PURE__ */ s("div", { className: "cedros-dashboard__empty", children: "Only organization owners can configure dashboard permissions." }) });
|
|
1046
1015
|
}
|
|
1047
1016
|
export {
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
be as u
|
|
1017
|
+
pe as I,
|
|
1018
|
+
fe as M,
|
|
1019
|
+
ve as P,
|
|
1020
|
+
we as a,
|
|
1021
|
+
ge as b,
|
|
1022
|
+
ie as c,
|
|
1023
|
+
ye as u
|
|
1056
1024
|
};
|