react-semaphor 0.1.203 → 0.1.205
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/chunks/dashboard-controls-DekrQ0yg.js +42 -0
- package/dist/chunks/dashboard-controls-n5_oB_dp.js +1584 -0
- package/dist/chunks/{dashboard-json-Cwh8kbV9.js → dashboard-json-B5YyWsMv.js} +5 -5
- package/dist/chunks/{dashboard-json-Dh8csIFq.js → dashboard-json-VG8uFdaU.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-_3iUVFkC.js → dashboard-summary-settings-dialog-B7_fbNYb.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-BL4vn4lZ.js → dashboard-summary-settings-dialog-DnfxWTj2.js} +55 -55
- package/dist/chunks/{edit-dashboard-visual-RiCeBX0X.js → edit-dashboard-visual-BxDQKLvc.js} +9 -9
- package/dist/chunks/{edit-dashboard-visual-DEc3lB9j.js → edit-dashboard-visual-bl33bktZ.js} +928 -914
- package/dist/chunks/{editor-action-buttons-BfLWRprW.js → editor-action-buttons-BUAzU5tX.js} +1 -1
- package/dist/chunks/{editor-action-buttons-DovtyKKL.js → editor-action-buttons-DngVSXyw.js} +65 -65
- package/dist/chunks/index-CtLqMYAL.js +1109 -0
- package/dist/chunks/{index-DaQXz6Oi.js → index-em2ecoK3.js} +33535 -29709
- package/dist/chunks/notification-bell-BWh1ZNB4.js +11 -0
- package/dist/chunks/{notification-bell-Cn3-W-S3.js → notification-bell-Ck-SNMez.js} +232 -233
- package/dist/chunks/{resource-management-panel-qsbMXn91.js → resource-management-panel-BGJ4XMn5.js} +188 -188
- package/dist/chunks/{resource-management-panel-DBnpAHFb.js → resource-management-panel-Ji1DZtnk.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-B22nZN2c.js → use-role-aware-display-preferences-C0-SK5cT.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-CnipXO4k.js → use-role-aware-display-preferences-DEkMGyx9.js} +1 -1
- package/dist/chunks/{use-visual-utils-JlfPxiXq.js → use-visual-utils-BLdGPBdR.js} +1 -1
- package/dist/chunks/{use-visual-utils-B9X7-yfe.js → use-visual-utils-BYBat4tj.js} +28 -28
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +258 -173
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/main.d.ts +813 -2
- package/dist/types/types.d.ts +222 -0
- package/package.json +2 -1
- package/dist/chunks/dashboard-controls-D5VrI40y.js +0 -42
- package/dist/chunks/dashboard-controls-p7I_UrIz.js +0 -1661
- package/dist/chunks/index-CpnMO9b6.js +0 -1087
- package/dist/chunks/notification-bell-DsJcuxld.js +0 -11
|
@@ -1,1661 +0,0 @@
|
|
|
1
|
-
import { jsxs as n, jsx as e, Fragment as I } from "react/jsx-runtime";
|
|
2
|
-
import { b3 as ee, cf as Xs, u as w, bm as Oe, bn as Ie, B as A, bp as _e, bq as Y, cg as Te, ax as rs, aK as j, aL as Pe, ch as Ys, br as Ge, aM as Re, aN as Ue, aO as Fe, aP as os, aS as xe, b2 as Z, aV as Zs, I as F, ci as ea, bv as sa, cj as aa, ck as Ze, cl as is, c as de, cm as cs, ba as ue, cn as me, aX as L, co as ls, c0 as ta, cp as na, aW as V, bu as $, cq as ra, cr as oa, cs as we, ct as ia, cu as ca, cv as ds, cw as us, cx as ce, cy as le, bZ as Ce, bB as De, cz as Ee, bw as ms, cA as Le, c1 as hs, e as ps, cB as la, bE as fs, bF as gs, bG as vs, bH as bs, bI as ys, bJ as Ns, bK as Ss, bL as Ae, bk as da, cC as ua, G as ma, az as es, A as oe, cD as ha, N as pa, H as ye, cE as fa, cF as ga, cG as va, cH as ba, bs as ya, Z as Na, cI as Sa, cJ as xa, cK as wa, cL as Ca, cM as Da, bo as Ea, by as La, cN as Aa, M as Ma, Y as ka } from "./index-DaQXz6Oi.js";
|
|
3
|
-
import * as D from "react";
|
|
4
|
-
import xs, { useState as S, useMemo as ie, useEffect as Oa } from "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
import { b as Ia, u as _a, c as Ta, A as Pa, V as Ga, S as Ra, N as Ua, U as Fa } from "./notification-bell-Cn3-W-S3.js";
|
|
7
|
-
import { u as ja } from "./use-role-aware-display-preferences-CnipXO4k.js";
|
|
8
|
-
import { d as qa } from "./date-formatter-Y8Za1ib3.js";
|
|
9
|
-
import { C as Va, D as $a } from "./dashboard-summary-settings-dialog-BL4vn4lZ.js";
|
|
10
|
-
import { S as ss } from "./editor-action-buttons-DovtyKKL.js";
|
|
11
|
-
/**
|
|
12
|
-
* @license lucide-react v0.453.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/
|
|
17
|
-
const za = ee("Glasses", [
|
|
18
|
-
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
19
|
-
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
20
|
-
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
21
|
-
["path", { d: "M2.5 13 5 7c.7-1.3 1.4-2 3-2", key: "1hm1gs" }],
|
|
22
|
-
["path", { d: "M21.5 13 19 7c-.7-1.3-1.5-2-3-2", key: "1r31ai" }]
|
|
23
|
-
]);
|
|
24
|
-
/**
|
|
25
|
-
* @license lucide-react v0.453.0 - ISC
|
|
26
|
-
*
|
|
27
|
-
* This source code is licensed under the ISC license.
|
|
28
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/
|
|
30
|
-
const Ha = ee("Menu", [
|
|
31
|
-
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
32
|
-
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
33
|
-
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
34
|
-
]);
|
|
35
|
-
/**
|
|
36
|
-
* @license lucide-react v0.453.0 - ISC
|
|
37
|
-
*
|
|
38
|
-
* This source code is licensed under the ISC license.
|
|
39
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/
|
|
41
|
-
const Ba = ee("Moon", [
|
|
42
|
-
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
43
|
-
]);
|
|
44
|
-
/**
|
|
45
|
-
* @license lucide-react v0.453.0 - ISC
|
|
46
|
-
*
|
|
47
|
-
* This source code is licensed under the ISC license.
|
|
48
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
-
*/
|
|
50
|
-
const Ka = ee("ShieldX", [
|
|
51
|
-
[
|
|
52
|
-
"path",
|
|
53
|
-
{
|
|
54
|
-
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
55
|
-
key: "oel41y"
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
["path", { d: "m14.5 9.5-5 5", key: "17q4r4" }],
|
|
59
|
-
["path", { d: "m9.5 9.5 5 5", key: "18nt4w" }]
|
|
60
|
-
]);
|
|
61
|
-
/**
|
|
62
|
-
* @license lucide-react v0.453.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/
|
|
67
|
-
const Qa = ee("Sun", [
|
|
68
|
-
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
69
|
-
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
70
|
-
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
71
|
-
["path", { d: "m4.93 4.93 1.41 1.41", key: "149t6j" }],
|
|
72
|
-
["path", { d: "m17.66 17.66 1.41 1.41", key: "ptbguv" }],
|
|
73
|
-
["path", { d: "M2 12h2", key: "1t8f8n" }],
|
|
74
|
-
["path", { d: "M20 12h2", key: "1q8mjw" }],
|
|
75
|
-
["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
|
|
76
|
-
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
|
|
77
|
-
]);
|
|
78
|
-
var Me = { exports: {} }, Ne = {};
|
|
79
|
-
/**
|
|
80
|
-
* @license React
|
|
81
|
-
* use-sync-external-store-shim.production.js
|
|
82
|
-
*
|
|
83
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
84
|
-
*
|
|
85
|
-
* This source code is licensed under the MIT license found in the
|
|
86
|
-
* LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/
|
|
88
|
-
var as;
|
|
89
|
-
function Ja() {
|
|
90
|
-
if (as) return Ne;
|
|
91
|
-
as = 1;
|
|
92
|
-
var s = xs;
|
|
93
|
-
function r(l, h) {
|
|
94
|
-
return l === h && (l !== 0 || 1 / l === 1 / h) || l !== l && h !== h;
|
|
95
|
-
}
|
|
96
|
-
var a = typeof Object.is == "function" ? Object.is : r, t = s.useState, i = s.useEffect, o = s.useLayoutEffect, u = s.useDebugValue;
|
|
97
|
-
function m(l, h) {
|
|
98
|
-
var p = h(), g = t({ inst: { value: p, getSnapshot: h } }), y = g[0].inst, N = g[1];
|
|
99
|
-
return o(
|
|
100
|
-
function() {
|
|
101
|
-
y.value = p, y.getSnapshot = h, f(y) && N({ inst: y });
|
|
102
|
-
},
|
|
103
|
-
[l, p, h]
|
|
104
|
-
), i(
|
|
105
|
-
function() {
|
|
106
|
-
return f(y) && N({ inst: y }), l(function() {
|
|
107
|
-
f(y) && N({ inst: y });
|
|
108
|
-
});
|
|
109
|
-
},
|
|
110
|
-
[l]
|
|
111
|
-
), u(p), p;
|
|
112
|
-
}
|
|
113
|
-
function f(l) {
|
|
114
|
-
var h = l.getSnapshot;
|
|
115
|
-
l = l.value;
|
|
116
|
-
try {
|
|
117
|
-
var p = h();
|
|
118
|
-
return !a(l, p);
|
|
119
|
-
} catch {
|
|
120
|
-
return !0;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
function v(l, h) {
|
|
124
|
-
return h();
|
|
125
|
-
}
|
|
126
|
-
var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : m;
|
|
127
|
-
return Ne.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : d, Ne;
|
|
128
|
-
}
|
|
129
|
-
var Se = {};
|
|
130
|
-
/**
|
|
131
|
-
* @license React
|
|
132
|
-
* use-sync-external-store-shim.development.js
|
|
133
|
-
*
|
|
134
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
135
|
-
*
|
|
136
|
-
* This source code is licensed under the MIT license found in the
|
|
137
|
-
* LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/
|
|
139
|
-
var ts;
|
|
140
|
-
function Wa() {
|
|
141
|
-
return ts || (ts = 1, process.env.NODE_ENV !== "production" && function() {
|
|
142
|
-
function s(p, g) {
|
|
143
|
-
return p === g && (p !== 0 || 1 / p === 1 / g) || p !== p && g !== g;
|
|
144
|
-
}
|
|
145
|
-
function r(p, g) {
|
|
146
|
-
d || i.startTransition === void 0 || (d = !0, console.error(
|
|
147
|
-
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
148
|
-
));
|
|
149
|
-
var y = g();
|
|
150
|
-
if (!l) {
|
|
151
|
-
var N = g();
|
|
152
|
-
o(y, N) || (console.error(
|
|
153
|
-
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
154
|
-
), l = !0);
|
|
155
|
-
}
|
|
156
|
-
N = u({
|
|
157
|
-
inst: { value: y, getSnapshot: g }
|
|
158
|
-
});
|
|
159
|
-
var E = N[0].inst, _ = N[1];
|
|
160
|
-
return f(
|
|
161
|
-
function() {
|
|
162
|
-
E.value = y, E.getSnapshot = g, a(E) && _({ inst: E });
|
|
163
|
-
},
|
|
164
|
-
[p, y, g]
|
|
165
|
-
), m(
|
|
166
|
-
function() {
|
|
167
|
-
return a(E) && _({ inst: E }), p(function() {
|
|
168
|
-
a(E) && _({ inst: E });
|
|
169
|
-
});
|
|
170
|
-
},
|
|
171
|
-
[p]
|
|
172
|
-
), v(y), y;
|
|
173
|
-
}
|
|
174
|
-
function a(p) {
|
|
175
|
-
var g = p.getSnapshot;
|
|
176
|
-
p = p.value;
|
|
177
|
-
try {
|
|
178
|
-
var y = g();
|
|
179
|
-
return !o(p, y);
|
|
180
|
-
} catch {
|
|
181
|
-
return !0;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
function t(p, g) {
|
|
185
|
-
return g();
|
|
186
|
-
}
|
|
187
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
188
|
-
var i = xs, o = typeof Object.is == "function" ? Object.is : s, u = i.useState, m = i.useEffect, f = i.useLayoutEffect, v = i.useDebugValue, d = !1, l = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t : r;
|
|
189
|
-
Se.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
190
|
-
}()), Se;
|
|
191
|
-
}
|
|
192
|
-
process.env.NODE_ENV === "production" ? Me.exports = Ja() : Me.exports = Wa();
|
|
193
|
-
var Xa = Me.exports;
|
|
194
|
-
function Ya() {
|
|
195
|
-
const { setTheme: s } = Xs(), r = w(
|
|
196
|
-
(a) => a.actions.setDashboardTheme
|
|
197
|
-
);
|
|
198
|
-
return /* @__PURE__ */ n(Oe, { children: [
|
|
199
|
-
/* @__PURE__ */ e(Ie, { asChild: !0, children: /* @__PURE__ */ n(A, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
|
|
200
|
-
/* @__PURE__ */ e(
|
|
201
|
-
Qa,
|
|
202
|
-
{
|
|
203
|
-
strokeWidth: 1.5,
|
|
204
|
-
className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
|
|
205
|
-
}
|
|
206
|
-
),
|
|
207
|
-
/* @__PURE__ */ e(
|
|
208
|
-
Ba,
|
|
209
|
-
{
|
|
210
|
-
strokeWidth: 1.5,
|
|
211
|
-
className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
|
|
212
|
-
}
|
|
213
|
-
),
|
|
214
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
|
|
215
|
-
] }) }),
|
|
216
|
-
/* @__PURE__ */ n(_e, { align: "end", children: [
|
|
217
|
-
/* @__PURE__ */ e(
|
|
218
|
-
Y,
|
|
219
|
-
{
|
|
220
|
-
onClick: () => {
|
|
221
|
-
s("light"), r("light");
|
|
222
|
-
},
|
|
223
|
-
children: "Light"
|
|
224
|
-
}
|
|
225
|
-
),
|
|
226
|
-
/* @__PURE__ */ e(
|
|
227
|
-
Y,
|
|
228
|
-
{
|
|
229
|
-
onClick: () => {
|
|
230
|
-
s("dark"), r("dark");
|
|
231
|
-
},
|
|
232
|
-
children: "Dark"
|
|
233
|
-
}
|
|
234
|
-
),
|
|
235
|
-
/* @__PURE__ */ e(
|
|
236
|
-
Y,
|
|
237
|
-
{
|
|
238
|
-
onClick: () => {
|
|
239
|
-
s("system"), r("system");
|
|
240
|
-
},
|
|
241
|
-
children: "System"
|
|
242
|
-
}
|
|
243
|
-
)
|
|
244
|
-
] })
|
|
245
|
-
] });
|
|
246
|
-
}
|
|
247
|
-
async function Za(s, r, a, t, i) {
|
|
248
|
-
if (!i)
|
|
249
|
-
return null;
|
|
250
|
-
const o = JSON.stringify(a), u = `${s}/v1/lens`;
|
|
251
|
-
return await Te(u, i, {
|
|
252
|
-
name: r,
|
|
253
|
-
template: o,
|
|
254
|
-
filterValues: t,
|
|
255
|
-
operation: "create"
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
async function ke(s, r, a) {
|
|
259
|
-
if (!a)
|
|
260
|
-
return null;
|
|
261
|
-
const { id: t, template: i, filterValues: o, isDefault: u, shared: m } = r, f = `${s}/v1/lens`;
|
|
262
|
-
return await Te(f, a, {
|
|
263
|
-
lensId: t,
|
|
264
|
-
template: i,
|
|
265
|
-
filterValues: o,
|
|
266
|
-
isDefault: u,
|
|
267
|
-
shared: m,
|
|
268
|
-
operation: "update"
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
async function et(s, r, a) {
|
|
272
|
-
if (!a)
|
|
273
|
-
return null;
|
|
274
|
-
const t = `${s}/v1/lens`;
|
|
275
|
-
return await Te(t, a, {
|
|
276
|
-
operation: "delete",
|
|
277
|
-
lensId: r
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
function st() {
|
|
281
|
-
const [s, r] = S(""), [a, t] = S(!1), i = w((N) => N.lenses), { setLenses: o, setSelectedLensId: u } = rs(), [m, f] = S(!1), [v, d] = S(!1), l = w((N) => N.dashboard), h = w((N) => N.filterValues), { authToken: p, tokenProps: g } = j();
|
|
282
|
-
async function y() {
|
|
283
|
-
f(!0);
|
|
284
|
-
const N = await Za(
|
|
285
|
-
g.apiServiceUrl,
|
|
286
|
-
s,
|
|
287
|
-
l,
|
|
288
|
-
h,
|
|
289
|
-
p == null ? void 0 : p.accessToken
|
|
290
|
-
);
|
|
291
|
-
N && (o([...i || [], N]), u(N.id), d(!1)), f(!1);
|
|
292
|
-
}
|
|
293
|
-
return /* @__PURE__ */ n(Pe, { open: v, onOpenChange: d, children: [
|
|
294
|
-
/* @__PURE__ */ e(Ys, { asChild: !0, children: /* @__PURE__ */ n(
|
|
295
|
-
A,
|
|
296
|
-
{
|
|
297
|
-
variant: "secondary",
|
|
298
|
-
className: "h-7 p-2",
|
|
299
|
-
size: "sm",
|
|
300
|
-
children: [
|
|
301
|
-
/* @__PURE__ */ e(Ge, { className: "mr-2 h-4 w-4" }),
|
|
302
|
-
"Lens"
|
|
303
|
-
]
|
|
304
|
-
}
|
|
305
|
-
) }),
|
|
306
|
-
/* @__PURE__ */ n(Re, { className: "sm:max-w-[425px]", children: [
|
|
307
|
-
/* @__PURE__ */ n(Ue, { children: [
|
|
308
|
-
/* @__PURE__ */ e(Fe, { children: "Create Lens" }),
|
|
309
|
-
/* @__PURE__ */ e(os, { children: "Lenses are private by default and are only visible to you." })
|
|
310
|
-
] }),
|
|
311
|
-
/* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ n("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
312
|
-
/* @__PURE__ */ e(xe, { className: "text-right", children: "Name" }),
|
|
313
|
-
/* @__PURE__ */ e(
|
|
314
|
-
Z,
|
|
315
|
-
{
|
|
316
|
-
value: s,
|
|
317
|
-
onChange: (N) => {
|
|
318
|
-
r(N.target.value);
|
|
319
|
-
},
|
|
320
|
-
id: "name",
|
|
321
|
-
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
322
|
-
}
|
|
323
|
-
)
|
|
324
|
-
] }) }),
|
|
325
|
-
a && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
326
|
-
/* @__PURE__ */ e(Zs, { children: /* @__PURE__ */ e(
|
|
327
|
-
A,
|
|
328
|
-
{
|
|
329
|
-
size: "sm",
|
|
330
|
-
variant: "outline",
|
|
331
|
-
type: "submit",
|
|
332
|
-
onClick: y,
|
|
333
|
-
disabled: m,
|
|
334
|
-
children: m ? "Creating..." : "Add"
|
|
335
|
-
}
|
|
336
|
-
) })
|
|
337
|
-
] })
|
|
338
|
-
] });
|
|
339
|
-
}
|
|
340
|
-
function at() {
|
|
341
|
-
const [s, r] = S(!1), a = w((l) => l.lenses), t = w((l) => l.selectedLensId), { setLenses: i, setSelectedLensId: o } = rs(), { authToken: u, tokenProps: m } = j();
|
|
342
|
-
async function f(l) {
|
|
343
|
-
o(l);
|
|
344
|
-
}
|
|
345
|
-
async function v(l) {
|
|
346
|
-
if (await et(m.apiServiceUrl, l, u == null ? void 0 : u.accessToken)) {
|
|
347
|
-
const p = a == null ? void 0 : a.filter((g) => g.id !== l);
|
|
348
|
-
i(p || []), o("original");
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
async function d(l) {
|
|
352
|
-
const h = a == null ? void 0 : a.map((y) => y.id === l.id ? {
|
|
353
|
-
...y,
|
|
354
|
-
isDefault: !l.isDefault
|
|
355
|
-
} : {
|
|
356
|
-
...y,
|
|
357
|
-
isDefault: !1
|
|
358
|
-
});
|
|
359
|
-
i(h || []);
|
|
360
|
-
const p = {
|
|
361
|
-
...l,
|
|
362
|
-
isDefault: !l.isDefault
|
|
363
|
-
};
|
|
364
|
-
await ke(m.apiServiceUrl, p, u == null ? void 0 : u.accessToken);
|
|
365
|
-
const g = a == null ? void 0 : a.find((y) => y.isDefault);
|
|
366
|
-
if (g && g.id !== l.id) {
|
|
367
|
-
const y = {
|
|
368
|
-
...g,
|
|
369
|
-
isDefault: !1
|
|
370
|
-
};
|
|
371
|
-
await ke(m.apiServiceUrl, y, u == null ? void 0 : u.accessToken);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
return /* @__PURE__ */ n(Oe, { open: s, onOpenChange: r, children: [
|
|
375
|
-
/* @__PURE__ */ e(Ie, { asChild: !0, children: /* @__PURE__ */ e(F, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(za, { className: "h-4 w-4" }) }) }),
|
|
376
|
-
/* @__PURE__ */ n(_e, { align: "end", className: "w-60", children: [
|
|
377
|
-
/* @__PURE__ */ e(ea, { className: "px-3", children: "Lenses" }),
|
|
378
|
-
/* @__PURE__ */ e(sa, {}),
|
|
379
|
-
/* @__PURE__ */ n(
|
|
380
|
-
aa,
|
|
381
|
-
{
|
|
382
|
-
value: t,
|
|
383
|
-
onValueChange: f,
|
|
384
|
-
children: [
|
|
385
|
-
/* @__PURE__ */ e(Ze, { value: "original", children: "Original" }),
|
|
386
|
-
a == null ? void 0 : a.map((l) => /* @__PURE__ */ n(
|
|
387
|
-
Ze,
|
|
388
|
-
{
|
|
389
|
-
className: "group flex justify-between gap-2",
|
|
390
|
-
value: l.id,
|
|
391
|
-
children: [
|
|
392
|
-
/* @__PURE__ */ e("p", { children: l.name }),
|
|
393
|
-
/* @__PURE__ */ n("span", { className: "flex items-center gap-3", children: [
|
|
394
|
-
/* @__PURE__ */ e(
|
|
395
|
-
is,
|
|
396
|
-
{
|
|
397
|
-
onClick: (h) => {
|
|
398
|
-
h.preventDefault(), d(l);
|
|
399
|
-
},
|
|
400
|
-
className: de(
|
|
401
|
-
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
402
|
-
{
|
|
403
|
-
invisible: !l.isDefault,
|
|
404
|
-
"text-green-500": l.isDefault
|
|
405
|
-
}
|
|
406
|
-
),
|
|
407
|
-
strokeWidth: 1.5
|
|
408
|
-
}
|
|
409
|
-
),
|
|
410
|
-
/* @__PURE__ */ e(
|
|
411
|
-
cs,
|
|
412
|
-
{
|
|
413
|
-
onClick: (h) => {
|
|
414
|
-
h.preventDefault(), v(l.id);
|
|
415
|
-
},
|
|
416
|
-
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
417
|
-
strokeWidth: 1.5
|
|
418
|
-
}
|
|
419
|
-
)
|
|
420
|
-
] })
|
|
421
|
-
]
|
|
422
|
-
},
|
|
423
|
-
l.id
|
|
424
|
-
))
|
|
425
|
-
]
|
|
426
|
-
}
|
|
427
|
-
)
|
|
428
|
-
] })
|
|
429
|
-
] });
|
|
430
|
-
}
|
|
431
|
-
const tt = async (s, r, a) => {
|
|
432
|
-
const t = `${s}/management/v1/groups`;
|
|
433
|
-
return await ls(t, r, a);
|
|
434
|
-
}, nt = async (s, r, a) => {
|
|
435
|
-
const t = `${s}/management/v1/groups/${a}`, i = await fetch(t, {
|
|
436
|
-
method: "DELETE",
|
|
437
|
-
headers: {
|
|
438
|
-
Authorization: `Bearer ${r}`
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
if (!i.ok) {
|
|
442
|
-
const o = await i.text();
|
|
443
|
-
throw new Error(o || "Failed to delete group");
|
|
444
|
-
}
|
|
445
|
-
}, rt = async (s, r, a, t) => {
|
|
446
|
-
const i = `${s}/management/v1/groups/${a}/members`;
|
|
447
|
-
return await ls(i, r, t);
|
|
448
|
-
}, ot = async (s, r, a, t) => {
|
|
449
|
-
const i = `${s}/management/v1/groups/${a}/members`, o = await fetch(i, {
|
|
450
|
-
method: "DELETE",
|
|
451
|
-
headers: {
|
|
452
|
-
"Content-Type": "application/json",
|
|
453
|
-
Authorization: `Bearer ${r}`
|
|
454
|
-
},
|
|
455
|
-
body: JSON.stringify(t)
|
|
456
|
-
});
|
|
457
|
-
if (!o.ok) {
|
|
458
|
-
const u = await o.text();
|
|
459
|
-
throw new Error(u || "Failed to remove group members");
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
function it() {
|
|
463
|
-
const { authToken: s, tokenProps: r } = j(), a = ue();
|
|
464
|
-
return me({
|
|
465
|
-
mutationFn: (t) => tt(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
466
|
-
onSuccess: () => {
|
|
467
|
-
a.invalidateQueries({ queryKey: ["groups"] }), L.success("Group created successfully");
|
|
468
|
-
},
|
|
469
|
-
onError: (t) => {
|
|
470
|
-
console.error("Failed to create group:", t), L.error("Failed to create group", {
|
|
471
|
-
description: t.message
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
function ct() {
|
|
477
|
-
const { authToken: s, tokenProps: r } = j(), a = ue();
|
|
478
|
-
return me({
|
|
479
|
-
mutationFn: (t) => nt(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
480
|
-
onSuccess: (t, i) => {
|
|
481
|
-
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", i] }), L.success("Group deleted successfully");
|
|
482
|
-
},
|
|
483
|
-
onError: (t) => {
|
|
484
|
-
console.error("Failed to delete group:", t), L.error("Failed to delete group", {
|
|
485
|
-
description: t.message
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
function lt() {
|
|
491
|
-
const { authToken: s, tokenProps: r } = j(), a = ue();
|
|
492
|
-
return me({
|
|
493
|
-
mutationFn: ({
|
|
494
|
-
groupId: t,
|
|
495
|
-
data: i
|
|
496
|
-
}) => rt(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
|
|
497
|
-
onSuccess: (t, i) => {
|
|
498
|
-
a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
|
|
499
|
-
queryKey: ["group-members", i.groupId]
|
|
500
|
-
}), a.invalidateQueries({ queryKey: ["groups"] }), L.success("Members added successfully");
|
|
501
|
-
},
|
|
502
|
-
onError: (t) => {
|
|
503
|
-
console.error("Failed to add group members:", t), L.error("Failed to add members", {
|
|
504
|
-
description: t.message
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
function dt() {
|
|
510
|
-
const { authToken: s, tokenProps: r } = j(), a = ue();
|
|
511
|
-
return me({
|
|
512
|
-
mutationFn: ({
|
|
513
|
-
groupId: t,
|
|
514
|
-
data: i
|
|
515
|
-
}) => ot(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
|
|
516
|
-
onSuccess: (t, i) => {
|
|
517
|
-
a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
|
|
518
|
-
queryKey: ["group-members", i.groupId]
|
|
519
|
-
}), a.invalidateQueries({ queryKey: ["groups"] }), L.success("Members removed successfully");
|
|
520
|
-
},
|
|
521
|
-
onError: (t) => {
|
|
522
|
-
console.error("Failed to remove group members:", t), L.error("Failed to remove members", {
|
|
523
|
-
description: t.message
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
function ut({
|
|
529
|
-
onSuccess: s,
|
|
530
|
-
tenantId: r,
|
|
531
|
-
isTenantUser: a
|
|
532
|
-
}) {
|
|
533
|
-
const [t, i] = S(""), [o, u] = S(""), [m, f] = S({}), v = it(), d = () => {
|
|
534
|
-
const h = {};
|
|
535
|
-
return t.trim() ? t.length < 3 ? h.name = "Group name must be at least 3 characters" : t.length > 50 && (h.name = "Group name must be less than 50 characters") : h.name = "Group name is required", o && o.length > 200 && (h.description = "Description must be less than 200 characters"), f(h), Object.keys(h).length === 0;
|
|
536
|
-
};
|
|
537
|
-
return /* @__PURE__ */ n("form", { onSubmit: async (h) => {
|
|
538
|
-
if (h.preventDefault(), !d()) return;
|
|
539
|
-
const p = {
|
|
540
|
-
name: t.trim(),
|
|
541
|
-
description: o.trim() || void 0,
|
|
542
|
-
type: a ? "TENANT_GROUP" : "ORG_GROUP",
|
|
543
|
-
...a && r ? { tenantId: r } : {}
|
|
544
|
-
};
|
|
545
|
-
try {
|
|
546
|
-
await v.mutateAsync(p), i(""), u(""), f({}), s();
|
|
547
|
-
} catch (g) {
|
|
548
|
-
console.error("Failed to create group:", g);
|
|
549
|
-
}
|
|
550
|
-
}, className: "space-y-6", children: [
|
|
551
|
-
/* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
552
|
-
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
553
|
-
/* @__PURE__ */ n(xe, { htmlFor: "group-name", children: [
|
|
554
|
-
"Group Name ",
|
|
555
|
-
/* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
|
|
556
|
-
] }),
|
|
557
|
-
/* @__PURE__ */ e(
|
|
558
|
-
Z,
|
|
559
|
-
{
|
|
560
|
-
id: "group-name",
|
|
561
|
-
placeholder: "e.g., Marketing Team, Engineering Squad",
|
|
562
|
-
value: t,
|
|
563
|
-
onChange: (h) => {
|
|
564
|
-
i(h.target.value), m.name && f((p) => ({ ...p, name: "" }));
|
|
565
|
-
},
|
|
566
|
-
className: m.name ? "border-destructive" : "",
|
|
567
|
-
disabled: v.isPending
|
|
568
|
-
}
|
|
569
|
-
),
|
|
570
|
-
m.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.name })
|
|
571
|
-
] }),
|
|
572
|
-
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
573
|
-
/* @__PURE__ */ n(xe, { htmlFor: "group-description", children: [
|
|
574
|
-
"Description",
|
|
575
|
-
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
|
|
576
|
-
] }),
|
|
577
|
-
/* @__PURE__ */ e(
|
|
578
|
-
ta,
|
|
579
|
-
{
|
|
580
|
-
id: "group-description",
|
|
581
|
-
placeholder: "Describe the purpose of this group...",
|
|
582
|
-
value: o,
|
|
583
|
-
onChange: (h) => {
|
|
584
|
-
u(h.target.value), m.description && f((p) => ({ ...p, description: "" }));
|
|
585
|
-
},
|
|
586
|
-
className: m.description ? "border-destructive" : "",
|
|
587
|
-
disabled: v.isPending,
|
|
588
|
-
rows: 3
|
|
589
|
-
}
|
|
590
|
-
),
|
|
591
|
-
m.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: m.description }),
|
|
592
|
-
/* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground", children: [
|
|
593
|
-
o.length,
|
|
594
|
-
"/200 characters"
|
|
595
|
-
] })
|
|
596
|
-
] }),
|
|
597
|
-
/* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ n("div", { className: "flex gap-3", children: [
|
|
598
|
-
/* @__PURE__ */ e(na, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
|
|
599
|
-
/* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground", children: "This group will be accessible to users in your workspace. You can add members after creating the group." })
|
|
600
|
-
] }) })
|
|
601
|
-
] }),
|
|
602
|
-
/* @__PURE__ */ n("div", { className: "flex justify-end gap-3", children: [
|
|
603
|
-
/* @__PURE__ */ e(
|
|
604
|
-
A,
|
|
605
|
-
{
|
|
606
|
-
type: "button",
|
|
607
|
-
variant: "outline",
|
|
608
|
-
onClick: () => {
|
|
609
|
-
i(""), u(""), f({});
|
|
610
|
-
},
|
|
611
|
-
disabled: v.isPending,
|
|
612
|
-
children: "Clear"
|
|
613
|
-
}
|
|
614
|
-
),
|
|
615
|
-
/* @__PURE__ */ e(
|
|
616
|
-
A,
|
|
617
|
-
{
|
|
618
|
-
type: "submit",
|
|
619
|
-
disabled: v.isPending || !t.trim(),
|
|
620
|
-
children: v.isPending ? /* @__PURE__ */ n(I, { children: [
|
|
621
|
-
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
622
|
-
"Creating..."
|
|
623
|
-
] }) : /* @__PURE__ */ n(I, { children: [
|
|
624
|
-
/* @__PURE__ */ e($, { className: "mr-2 h-4 w-4" }),
|
|
625
|
-
"Create Group"
|
|
626
|
-
] })
|
|
627
|
-
}
|
|
628
|
-
)
|
|
629
|
-
] })
|
|
630
|
-
] });
|
|
631
|
-
}
|
|
632
|
-
function mt(s, r = []) {
|
|
633
|
-
let a = [];
|
|
634
|
-
function t(o, u) {
|
|
635
|
-
const m = D.createContext(u);
|
|
636
|
-
m.displayName = o + "Context";
|
|
637
|
-
const f = a.length;
|
|
638
|
-
a = [...a, u];
|
|
639
|
-
const v = (l) => {
|
|
640
|
-
var E;
|
|
641
|
-
const { scope: h, children: p, ...g } = l, y = ((E = h == null ? void 0 : h[s]) == null ? void 0 : E[f]) || m, N = D.useMemo(() => g, Object.values(g));
|
|
642
|
-
return /* @__PURE__ */ e(y.Provider, { value: N, children: p });
|
|
643
|
-
};
|
|
644
|
-
v.displayName = o + "Provider";
|
|
645
|
-
function d(l, h) {
|
|
646
|
-
var y;
|
|
647
|
-
const p = ((y = h == null ? void 0 : h[s]) == null ? void 0 : y[f]) || m, g = D.useContext(p);
|
|
648
|
-
if (g) return g;
|
|
649
|
-
if (u !== void 0) return u;
|
|
650
|
-
throw new Error(`\`${l}\` must be used within \`${o}\``);
|
|
651
|
-
}
|
|
652
|
-
return [v, d];
|
|
653
|
-
}
|
|
654
|
-
const i = () => {
|
|
655
|
-
const o = a.map((u) => D.createContext(u));
|
|
656
|
-
return function(m) {
|
|
657
|
-
const f = (m == null ? void 0 : m[s]) || o;
|
|
658
|
-
return D.useMemo(
|
|
659
|
-
() => ({ [`__scope${s}`]: { ...m, [s]: f } }),
|
|
660
|
-
[m, f]
|
|
661
|
-
);
|
|
662
|
-
};
|
|
663
|
-
};
|
|
664
|
-
return i.scopeName = s, [t, ht(i, ...r)];
|
|
665
|
-
}
|
|
666
|
-
function ht(...s) {
|
|
667
|
-
const r = s[0];
|
|
668
|
-
if (s.length === 1) return r;
|
|
669
|
-
const a = () => {
|
|
670
|
-
const t = s.map((i) => ({
|
|
671
|
-
useScope: i(),
|
|
672
|
-
scopeName: i.scopeName
|
|
673
|
-
}));
|
|
674
|
-
return function(o) {
|
|
675
|
-
const u = t.reduce((m, { useScope: f, scopeName: v }) => {
|
|
676
|
-
const l = f(o)[`__scope${v}`];
|
|
677
|
-
return { ...m, ...l };
|
|
678
|
-
}, {});
|
|
679
|
-
return D.useMemo(() => ({ [`__scope${r.scopeName}`]: u }), [u]);
|
|
680
|
-
};
|
|
681
|
-
};
|
|
682
|
-
return a.scopeName = r.scopeName, a;
|
|
683
|
-
}
|
|
684
|
-
var pt = [
|
|
685
|
-
"a",
|
|
686
|
-
"button",
|
|
687
|
-
"div",
|
|
688
|
-
"form",
|
|
689
|
-
"h2",
|
|
690
|
-
"h3",
|
|
691
|
-
"img",
|
|
692
|
-
"input",
|
|
693
|
-
"label",
|
|
694
|
-
"li",
|
|
695
|
-
"nav",
|
|
696
|
-
"ol",
|
|
697
|
-
"p",
|
|
698
|
-
"select",
|
|
699
|
-
"span",
|
|
700
|
-
"svg",
|
|
701
|
-
"ul"
|
|
702
|
-
], je = pt.reduce((s, r) => {
|
|
703
|
-
const a = ra(`Primitive.${r}`), t = D.forwardRef((i, o) => {
|
|
704
|
-
const { asChild: u, ...m } = i, f = u ? a : r;
|
|
705
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(f, { ...m, ref: o });
|
|
706
|
-
});
|
|
707
|
-
return t.displayName = `Primitive.${r}`, { ...s, [r]: t };
|
|
708
|
-
}, {});
|
|
709
|
-
function ft() {
|
|
710
|
-
return Xa.useSyncExternalStore(
|
|
711
|
-
gt,
|
|
712
|
-
() => !0,
|
|
713
|
-
() => !1
|
|
714
|
-
);
|
|
715
|
-
}
|
|
716
|
-
function gt() {
|
|
717
|
-
return () => {
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
|
-
var qe = "Avatar", [vt] = mt(qe), [bt, ws] = vt(qe), Cs = D.forwardRef(
|
|
721
|
-
(s, r) => {
|
|
722
|
-
const { __scopeAvatar: a, ...t } = s, [i, o] = D.useState("idle");
|
|
723
|
-
return /* @__PURE__ */ e(
|
|
724
|
-
bt,
|
|
725
|
-
{
|
|
726
|
-
scope: a,
|
|
727
|
-
imageLoadingStatus: i,
|
|
728
|
-
onImageLoadingStatusChange: o,
|
|
729
|
-
children: /* @__PURE__ */ e(je.span, { ...t, ref: r })
|
|
730
|
-
}
|
|
731
|
-
);
|
|
732
|
-
}
|
|
733
|
-
);
|
|
734
|
-
Cs.displayName = qe;
|
|
735
|
-
var Ds = "AvatarImage", Es = D.forwardRef(
|
|
736
|
-
(s, r) => {
|
|
737
|
-
const { __scopeAvatar: a, src: t, onLoadingStatusChange: i = () => {
|
|
738
|
-
}, ...o } = s, u = ws(Ds, a), m = yt(t, o), f = oa((v) => {
|
|
739
|
-
i(v), u.onImageLoadingStatusChange(v);
|
|
740
|
-
});
|
|
741
|
-
return we(() => {
|
|
742
|
-
m !== "idle" && f(m);
|
|
743
|
-
}, [m, f]), m === "loaded" ? /* @__PURE__ */ e(je.img, { ...o, ref: r, src: t }) : null;
|
|
744
|
-
}
|
|
745
|
-
);
|
|
746
|
-
Es.displayName = Ds;
|
|
747
|
-
var Ls = "AvatarFallback", As = D.forwardRef(
|
|
748
|
-
(s, r) => {
|
|
749
|
-
const { __scopeAvatar: a, delayMs: t, ...i } = s, o = ws(Ls, a), [u, m] = D.useState(t === void 0);
|
|
750
|
-
return D.useEffect(() => {
|
|
751
|
-
if (t !== void 0) {
|
|
752
|
-
const f = window.setTimeout(() => m(!0), t);
|
|
753
|
-
return () => window.clearTimeout(f);
|
|
754
|
-
}
|
|
755
|
-
}, [t]), u && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(je.span, { ...i, ref: r }) : null;
|
|
756
|
-
}
|
|
757
|
-
);
|
|
758
|
-
As.displayName = Ls;
|
|
759
|
-
function ns(s, r) {
|
|
760
|
-
return s ? r ? (s.src !== r && (s.src = r), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
761
|
-
}
|
|
762
|
-
function yt(s, { referrerPolicy: r, crossOrigin: a }) {
|
|
763
|
-
const t = ft(), i = D.useRef(null), o = t ? (i.current || (i.current = new window.Image()), i.current) : null, [u, m] = D.useState(
|
|
764
|
-
() => ns(o, s)
|
|
765
|
-
);
|
|
766
|
-
return we(() => {
|
|
767
|
-
m(ns(o, s));
|
|
768
|
-
}, [o, s]), we(() => {
|
|
769
|
-
const f = (l) => () => {
|
|
770
|
-
m(l);
|
|
771
|
-
};
|
|
772
|
-
if (!o) return;
|
|
773
|
-
const v = f("loaded"), d = f("error");
|
|
774
|
-
return o.addEventListener("load", v), o.addEventListener("error", d), r && (o.referrerPolicy = r), typeof a == "string" && (o.crossOrigin = a), () => {
|
|
775
|
-
o.removeEventListener("load", v), o.removeEventListener("error", d);
|
|
776
|
-
};
|
|
777
|
-
}, [o, a, r]), u;
|
|
778
|
-
}
|
|
779
|
-
var Ms = Cs, ks = Es, Os = As;
|
|
780
|
-
const Ve = D.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
|
|
781
|
-
Ms,
|
|
782
|
-
{
|
|
783
|
-
ref: a,
|
|
784
|
-
className: de(
|
|
785
|
-
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
786
|
-
s
|
|
787
|
-
),
|
|
788
|
-
...r
|
|
789
|
-
}
|
|
790
|
-
));
|
|
791
|
-
Ve.displayName = Ms.displayName;
|
|
792
|
-
const Nt = D.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
|
|
793
|
-
ks,
|
|
794
|
-
{
|
|
795
|
-
ref: a,
|
|
796
|
-
className: de("aspect-square h-full w-full", s),
|
|
797
|
-
...r
|
|
798
|
-
}
|
|
799
|
-
));
|
|
800
|
-
Nt.displayName = ks.displayName;
|
|
801
|
-
const $e = D.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
|
|
802
|
-
Os,
|
|
803
|
-
{
|
|
804
|
-
ref: a,
|
|
805
|
-
className: de(
|
|
806
|
-
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
807
|
-
s
|
|
808
|
-
),
|
|
809
|
-
...r
|
|
810
|
-
}
|
|
811
|
-
));
|
|
812
|
-
$e.displayName = Os.displayName;
|
|
813
|
-
function St({
|
|
814
|
-
open: s,
|
|
815
|
-
onOpenChange: r,
|
|
816
|
-
group: a,
|
|
817
|
-
onUpdate: t
|
|
818
|
-
}) {
|
|
819
|
-
const [i, o] = S("members"), [u, m] = S(""), [f, v] = S([]), [d, l] = S([]), { data: h, isLoading: p, refetch: g } = ia(a.id), y = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: N, isLoading: E } = ca({
|
|
820
|
-
type: y,
|
|
821
|
-
tenantId: a.tenantId || void 0,
|
|
822
|
-
active: !0,
|
|
823
|
-
limit: 100
|
|
824
|
-
}), _ = lt(), P = dt(), k = (h == null ? void 0 : h.members) || [], z = ie(() => new Set(k.map((b) => b.userId)), [k]), R = ie(() => N.filter((b) => !z.has(b.id)), [N, z]), H = ie(() => {
|
|
825
|
-
if (!u) return R;
|
|
826
|
-
const b = u.toLowerCase();
|
|
827
|
-
return R.filter(
|
|
828
|
-
(M) => {
|
|
829
|
-
var T, x;
|
|
830
|
-
return ((T = M.name) == null ? void 0 : T.toLowerCase().includes(b)) || ((x = M.email) == null ? void 0 : x.toLowerCase().includes(b));
|
|
831
|
-
}
|
|
832
|
-
);
|
|
833
|
-
}, [R, u]), C = ie(() => {
|
|
834
|
-
if (!u) return k;
|
|
835
|
-
const b = u.toLowerCase();
|
|
836
|
-
return k.filter(
|
|
837
|
-
(M) => {
|
|
838
|
-
var T, x, U, q;
|
|
839
|
-
return ((x = (T = M.user) == null ? void 0 : T.name) == null ? void 0 : x.toLowerCase().includes(b)) || ((q = (U = M.user) == null ? void 0 : U.email) == null ? void 0 : q.toLowerCase().includes(b));
|
|
840
|
-
}
|
|
841
|
-
);
|
|
842
|
-
}, [k, u]), G = async () => {
|
|
843
|
-
if (f.length !== 0)
|
|
844
|
-
try {
|
|
845
|
-
await _.mutateAsync({
|
|
846
|
-
groupId: a.id,
|
|
847
|
-
data: {
|
|
848
|
-
userIds: f,
|
|
849
|
-
userType: y === "tenant" ? "tenant" : "org"
|
|
850
|
-
}
|
|
851
|
-
}), v([]), o("members"), g(), t == null || t();
|
|
852
|
-
} catch (b) {
|
|
853
|
-
console.error("Failed to add members:", b);
|
|
854
|
-
}
|
|
855
|
-
}, B = async () => {
|
|
856
|
-
if (d.length !== 0)
|
|
857
|
-
try {
|
|
858
|
-
await P.mutateAsync({
|
|
859
|
-
groupId: a.id,
|
|
860
|
-
data: {
|
|
861
|
-
userIds: d
|
|
862
|
-
}
|
|
863
|
-
}), l([]), g(), t == null || t();
|
|
864
|
-
} catch (b) {
|
|
865
|
-
console.error("Failed to remove members:", b);
|
|
866
|
-
}
|
|
867
|
-
}, he = (b) => {
|
|
868
|
-
v(
|
|
869
|
-
(M) => M.includes(b) ? M.filter((T) => T !== b) : [...M, b]
|
|
870
|
-
);
|
|
871
|
-
}, K = (b) => {
|
|
872
|
-
l(
|
|
873
|
-
(M) => M.includes(b) ? M.filter((T) => T !== b) : [...M, b]
|
|
874
|
-
);
|
|
875
|
-
};
|
|
876
|
-
return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(Pe, { open: s, onOpenChange: r, children: /* @__PURE__ */ n(Re, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
877
|
-
/* @__PURE__ */ n(Ue, { children: [
|
|
878
|
-
/* @__PURE__ */ e(Fe, { children: a.name }),
|
|
879
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ n("p", { className: "text-sm text-muted-foreground", children: [
|
|
880
|
-
k.length,
|
|
881
|
-
" ",
|
|
882
|
-
k.length === 1 ? "member" : "members"
|
|
883
|
-
] }) }),
|
|
884
|
-
/* @__PURE__ */ n("p", { id: "group-members-description", className: "sr-only", children: [
|
|
885
|
-
"Add or remove members from the ",
|
|
886
|
-
a.name,
|
|
887
|
-
" group"
|
|
888
|
-
] })
|
|
889
|
-
] }),
|
|
890
|
-
/* @__PURE__ */ n(ds, { value: i, onValueChange: (b) => {
|
|
891
|
-
o(b), m(""), l([]);
|
|
892
|
-
}, className: "mt-4", children: [
|
|
893
|
-
/* @__PURE__ */ n(us, { className: "grid w-full grid-cols-2", children: [
|
|
894
|
-
/* @__PURE__ */ e(ce, { value: "members", children: "Current Members" }),
|
|
895
|
-
/* @__PURE__ */ e(ce, { value: "add", children: "Add Members" })
|
|
896
|
-
] }),
|
|
897
|
-
/* @__PURE__ */ n(le, { value: "members", className: "mt-4 space-y-4", children: [
|
|
898
|
-
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
899
|
-
/* @__PURE__ */ e(Ce, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
900
|
-
/* @__PURE__ */ e(
|
|
901
|
-
Z,
|
|
902
|
-
{
|
|
903
|
-
placeholder: "Search members...",
|
|
904
|
-
value: u,
|
|
905
|
-
onChange: (b) => m(b.target.value),
|
|
906
|
-
className: "pl-10"
|
|
907
|
-
}
|
|
908
|
-
)
|
|
909
|
-
] }),
|
|
910
|
-
/* @__PURE__ */ e(De, { className: d.length > 0 ? "h-[300px]" : "h-[350px]", children: p ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((b) => /* @__PURE__ */ e(Ee, { className: "h-16 w-full" }, b)) }) : C.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
911
|
-
/* @__PURE__ */ e($, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
912
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: u ? "No members found" : "No members yet" }),
|
|
913
|
-
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
|
|
914
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: C.map((b) => /* @__PURE__ */ e(
|
|
915
|
-
xt,
|
|
916
|
-
{
|
|
917
|
-
member: b,
|
|
918
|
-
selected: d.includes(b.userId),
|
|
919
|
-
onToggle: () => K(b.userId)
|
|
920
|
-
},
|
|
921
|
-
b.id
|
|
922
|
-
)) }) }),
|
|
923
|
-
d.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
924
|
-
/* @__PURE__ */ n("span", { className: "text-sm text-muted-foreground", children: [
|
|
925
|
-
d.length,
|
|
926
|
-
" member",
|
|
927
|
-
d.length !== 1 ? "s" : "",
|
|
928
|
-
" selected"
|
|
929
|
-
] }),
|
|
930
|
-
/* @__PURE__ */ e(
|
|
931
|
-
A,
|
|
932
|
-
{
|
|
933
|
-
variant: "destructive",
|
|
934
|
-
size: "sm",
|
|
935
|
-
onClick: B,
|
|
936
|
-
disabled: P.isPending,
|
|
937
|
-
children: P.isPending ? /* @__PURE__ */ n(I, { children: [
|
|
938
|
-
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
939
|
-
"Removing..."
|
|
940
|
-
] }) : /* @__PURE__ */ n(I, { children: [
|
|
941
|
-
/* @__PURE__ */ e(ms, { className: "mr-2 h-4 w-4" }),
|
|
942
|
-
"Remove Selected"
|
|
943
|
-
] })
|
|
944
|
-
}
|
|
945
|
-
)
|
|
946
|
-
] })
|
|
947
|
-
] }),
|
|
948
|
-
/* @__PURE__ */ n(le, { value: "add", className: "mt-4 space-y-4", children: [
|
|
949
|
-
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
950
|
-
/* @__PURE__ */ e(Ce, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
951
|
-
/* @__PURE__ */ e(
|
|
952
|
-
Z,
|
|
953
|
-
{
|
|
954
|
-
placeholder: "Search users to add...",
|
|
955
|
-
value: u,
|
|
956
|
-
onChange: (b) => m(b.target.value),
|
|
957
|
-
className: "pl-10"
|
|
958
|
-
}
|
|
959
|
-
)
|
|
960
|
-
] }),
|
|
961
|
-
/* @__PURE__ */ e(De, { className: "h-[300px]", children: E ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((b) => /* @__PURE__ */ e(Ee, { className: "h-16 w-full" }, b)) }) : H.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
962
|
-
/* @__PURE__ */ e(Le, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
963
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
964
|
-
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : "All eligible users are already members" })
|
|
965
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: H.map((b) => /* @__PURE__ */ e(
|
|
966
|
-
wt,
|
|
967
|
-
{
|
|
968
|
-
user: b,
|
|
969
|
-
selected: f.includes(b.id),
|
|
970
|
-
onToggle: () => he(b.id)
|
|
971
|
-
},
|
|
972
|
-
b.id
|
|
973
|
-
)) }) }),
|
|
974
|
-
f.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
975
|
-
/* @__PURE__ */ n("span", { className: "text-sm text-muted-foreground", children: [
|
|
976
|
-
f.length,
|
|
977
|
-
" user",
|
|
978
|
-
f.length !== 1 ? "s" : "",
|
|
979
|
-
" selected"
|
|
980
|
-
] }),
|
|
981
|
-
/* @__PURE__ */ e(
|
|
982
|
-
A,
|
|
983
|
-
{
|
|
984
|
-
onClick: G,
|
|
985
|
-
disabled: _.isPending,
|
|
986
|
-
children: _.isPending ? /* @__PURE__ */ n(I, { children: [
|
|
987
|
-
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
988
|
-
"Adding..."
|
|
989
|
-
] }) : /* @__PURE__ */ n(I, { children: [
|
|
990
|
-
/* @__PURE__ */ e(Le, { className: "mr-2 h-4 w-4" }),
|
|
991
|
-
"Add Members"
|
|
992
|
-
] })
|
|
993
|
-
}
|
|
994
|
-
)
|
|
995
|
-
] })
|
|
996
|
-
] })
|
|
997
|
-
] })
|
|
998
|
-
] }) }) });
|
|
999
|
-
}
|
|
1000
|
-
function xt({
|
|
1001
|
-
member: s,
|
|
1002
|
-
selected: r,
|
|
1003
|
-
onToggle: a
|
|
1004
|
-
}) {
|
|
1005
|
-
var i, o, u, m;
|
|
1006
|
-
const t = ((o = (i = s.user) == null ? void 0 : i.name) == null ? void 0 : o.split(" ").map((f) => f[0]).join("").toUpperCase()) || "?";
|
|
1007
|
-
return /* @__PURE__ */ n(
|
|
1008
|
-
"div",
|
|
1009
|
-
{
|
|
1010
|
-
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1011
|
-
onClick: a,
|
|
1012
|
-
children: [
|
|
1013
|
-
/* @__PURE__ */ e(hs, { checked: r }),
|
|
1014
|
-
/* @__PURE__ */ e(Ve, { className: "h-8 w-8", children: /* @__PURE__ */ e($e, { className: "text-xs", children: t }) }),
|
|
1015
|
-
/* @__PURE__ */ n("div", { className: "flex-1", children: [
|
|
1016
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((u = s.user) == null ? void 0 : u.name) || "Unknown User" }),
|
|
1017
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (m = s.user) == null ? void 0 : m.email })
|
|
1018
|
-
] })
|
|
1019
|
-
]
|
|
1020
|
-
}
|
|
1021
|
-
);
|
|
1022
|
-
}
|
|
1023
|
-
function wt({
|
|
1024
|
-
user: s,
|
|
1025
|
-
selected: r,
|
|
1026
|
-
onToggle: a
|
|
1027
|
-
}) {
|
|
1028
|
-
var i;
|
|
1029
|
-
const t = ((i = s.name) == null ? void 0 : i.split(" ").map((o) => o[0]).join("").toUpperCase()) || "?";
|
|
1030
|
-
return /* @__PURE__ */ n(
|
|
1031
|
-
"div",
|
|
1032
|
-
{
|
|
1033
|
-
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1034
|
-
onClick: a,
|
|
1035
|
-
children: [
|
|
1036
|
-
/* @__PURE__ */ e(hs, { checked: r }),
|
|
1037
|
-
/* @__PURE__ */ e(Ve, { className: "h-8 w-8", children: /* @__PURE__ */ e($e, { className: "text-xs", children: t }) }),
|
|
1038
|
-
/* @__PURE__ */ n("div", { className: "flex-1", children: [
|
|
1039
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s.name }),
|
|
1040
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s.email })
|
|
1041
|
-
] })
|
|
1042
|
-
]
|
|
1043
|
-
}
|
|
1044
|
-
);
|
|
1045
|
-
}
|
|
1046
|
-
function Ct({
|
|
1047
|
-
open: s,
|
|
1048
|
-
onOpenChange: r
|
|
1049
|
-
}) {
|
|
1050
|
-
const [a, t] = S("groups"), [i, o] = S(""), [u, m] = S(null), [f, v] = S(!1), [d, l] = S(null), { tokenProps: h } = j(), { currentUser: p } = ps(), g = ct(), y = (p == null ? void 0 : p.type) === "tenant", N = h == null ? void 0 : h.tenantId, { groups: E, isLoading: _, refetch: P } = la({
|
|
1051
|
-
type: y ? "TENANT_GROUP" : "all",
|
|
1052
|
-
tenantId: y ? N : void 0,
|
|
1053
|
-
includeMembers: !1
|
|
1054
|
-
}), k = E.filter(
|
|
1055
|
-
(C) => {
|
|
1056
|
-
var G;
|
|
1057
|
-
return C.name.toLowerCase().includes(i.toLowerCase()) || ((G = C.description) == null ? void 0 : G.toLowerCase().includes(i.toLowerCase()));
|
|
1058
|
-
}
|
|
1059
|
-
), z = async () => {
|
|
1060
|
-
if (d)
|
|
1061
|
-
try {
|
|
1062
|
-
await g.mutateAsync(d.id), l(null), P();
|
|
1063
|
-
} catch (C) {
|
|
1064
|
-
console.error("Failed to delete group:", C);
|
|
1065
|
-
}
|
|
1066
|
-
}, R = (C) => {
|
|
1067
|
-
m(C), v(!0);
|
|
1068
|
-
}, H = () => {
|
|
1069
|
-
t("groups"), P();
|
|
1070
|
-
};
|
|
1071
|
-
return /* @__PURE__ */ n(I, { children: [
|
|
1072
|
-
/* @__PURE__ */ e(Pe, { open: s, onOpenChange: r, children: /* @__PURE__ */ n(Re, { className: "max-w-4xl max-h-[80vh]", children: [
|
|
1073
|
-
/* @__PURE__ */ n(Ue, { children: [
|
|
1074
|
-
/* @__PURE__ */ n(Fe, { className: "flex items-center gap-2", children: [
|
|
1075
|
-
/* @__PURE__ */ e($, { className: "h-5 w-5" }),
|
|
1076
|
-
"Group Management"
|
|
1077
|
-
] }),
|
|
1078
|
-
/* @__PURE__ */ e(os, { children: "Manage your groups, create new groups, and control group membership" })
|
|
1079
|
-
] }),
|
|
1080
|
-
/* @__PURE__ */ n(ds, { value: a, onValueChange: t, className: "mt-4", children: [
|
|
1081
|
-
/* @__PURE__ */ n(us, { className: "grid w-full grid-cols-2", children: [
|
|
1082
|
-
/* @__PURE__ */ n(ce, { value: "groups", className: "flex items-center gap-2", children: [
|
|
1083
|
-
/* @__PURE__ */ e($, { className: "h-4 w-4" }),
|
|
1084
|
-
"Groups"
|
|
1085
|
-
] }),
|
|
1086
|
-
/* @__PURE__ */ n(ce, { value: "create", className: "flex items-center gap-2", children: [
|
|
1087
|
-
/* @__PURE__ */ e(Ge, { className: "h-4 w-4" }),
|
|
1088
|
-
"Create Group"
|
|
1089
|
-
] })
|
|
1090
|
-
] }),
|
|
1091
|
-
/* @__PURE__ */ e(le, { value: "groups", className: "mt-4", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
1092
|
-
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
1093
|
-
/* @__PURE__ */ e(Ce, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
1094
|
-
/* @__PURE__ */ e(
|
|
1095
|
-
Z,
|
|
1096
|
-
{
|
|
1097
|
-
placeholder: "Search groups...",
|
|
1098
|
-
value: i,
|
|
1099
|
-
onChange: (C) => o(C.target.value),
|
|
1100
|
-
className: "pl-10"
|
|
1101
|
-
}
|
|
1102
|
-
)
|
|
1103
|
-
] }),
|
|
1104
|
-
/* @__PURE__ */ e(De, { className: "h-[400px]", children: _ ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((C) => /* @__PURE__ */ e(Ee, { className: "h-24 w-full" }, C)) }) : k.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
1105
|
-
/* @__PURE__ */ e($, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
1106
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
|
|
1107
|
-
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: i ? "Try a different search" : "Create your first group to get started" })
|
|
1108
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: k.map((C) => /* @__PURE__ */ e(
|
|
1109
|
-
Dt,
|
|
1110
|
-
{
|
|
1111
|
-
group: C,
|
|
1112
|
-
onManageMembers: () => R(C),
|
|
1113
|
-
onDelete: () => l(C),
|
|
1114
|
-
currentUserId: p == null ? void 0 : p.id
|
|
1115
|
-
},
|
|
1116
|
-
C.id
|
|
1117
|
-
)) }) })
|
|
1118
|
-
] }) }),
|
|
1119
|
-
/* @__PURE__ */ e(le, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1120
|
-
ut,
|
|
1121
|
-
{
|
|
1122
|
-
onSuccess: H,
|
|
1123
|
-
tenantId: N,
|
|
1124
|
-
isTenantUser: y
|
|
1125
|
-
}
|
|
1126
|
-
) })
|
|
1127
|
-
] })
|
|
1128
|
-
] }) }),
|
|
1129
|
-
u && /* @__PURE__ */ e(
|
|
1130
|
-
St,
|
|
1131
|
-
{
|
|
1132
|
-
open: f,
|
|
1133
|
-
onOpenChange: v,
|
|
1134
|
-
group: u,
|
|
1135
|
-
onUpdate: () => P()
|
|
1136
|
-
}
|
|
1137
|
-
),
|
|
1138
|
-
/* @__PURE__ */ e(
|
|
1139
|
-
fs,
|
|
1140
|
-
{
|
|
1141
|
-
open: !!d,
|
|
1142
|
-
onOpenChange: () => l(null),
|
|
1143
|
-
children: /* @__PURE__ */ n(gs, { children: [
|
|
1144
|
-
/* @__PURE__ */ n(vs, { children: [
|
|
1145
|
-
/* @__PURE__ */ e(bs, { children: "Delete Group" }),
|
|
1146
|
-
/* @__PURE__ */ n(ys, { children: [
|
|
1147
|
-
'Are you sure you want to delete "',
|
|
1148
|
-
d == null ? void 0 : d.name,
|
|
1149
|
-
'"? This action cannot be undone and will remove all members from the group.'
|
|
1150
|
-
] })
|
|
1151
|
-
] }),
|
|
1152
|
-
/* @__PURE__ */ n(Ns, { children: [
|
|
1153
|
-
/* @__PURE__ */ e(Ss, { children: "Cancel" }),
|
|
1154
|
-
/* @__PURE__ */ e(
|
|
1155
|
-
Ae,
|
|
1156
|
-
{
|
|
1157
|
-
onClick: z,
|
|
1158
|
-
disabled: g.isPending,
|
|
1159
|
-
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1160
|
-
children: g.isPending ? /* @__PURE__ */ n(I, { children: [
|
|
1161
|
-
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1162
|
-
"Deleting..."
|
|
1163
|
-
] }) : "Delete Group"
|
|
1164
|
-
}
|
|
1165
|
-
)
|
|
1166
|
-
] })
|
|
1167
|
-
] })
|
|
1168
|
-
}
|
|
1169
|
-
)
|
|
1170
|
-
] });
|
|
1171
|
-
}
|
|
1172
|
-
function Dt({
|
|
1173
|
-
group: s,
|
|
1174
|
-
onManageMembers: r,
|
|
1175
|
-
onDelete: a,
|
|
1176
|
-
currentUserId: t
|
|
1177
|
-
}) {
|
|
1178
|
-
const i = s.createdBy === t;
|
|
1179
|
-
return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-3", children: [
|
|
1180
|
-
/* @__PURE__ */ n("div", { className: "flex-1 space-y-2", children: [
|
|
1181
|
-
/* @__PURE__ */ n("div", { children: [
|
|
1182
|
-
/* @__PURE__ */ e("h4", { className: "font-medium", children: s.name }),
|
|
1183
|
-
s.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mt-1", children: s.description })
|
|
1184
|
-
] }),
|
|
1185
|
-
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
|
|
1186
|
-
/* @__PURE__ */ n("span", { className: "flex items-center gap-1", children: [
|
|
1187
|
-
/* @__PURE__ */ e($, { className: "h-3 w-3" }),
|
|
1188
|
-
s.memberCount,
|
|
1189
|
-
" ",
|
|
1190
|
-
s.memberCount === 1 ? "member" : "members"
|
|
1191
|
-
] }),
|
|
1192
|
-
/* @__PURE__ */ n("span", { children: [
|
|
1193
|
-
"Created ",
|
|
1194
|
-
qa(new Date(s.createdAt), "MMM d, yyyy")
|
|
1195
|
-
] })
|
|
1196
|
-
] })
|
|
1197
|
-
] }),
|
|
1198
|
-
/* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
|
|
1199
|
-
/* @__PURE__ */ e(
|
|
1200
|
-
A,
|
|
1201
|
-
{
|
|
1202
|
-
variant: "ghost",
|
|
1203
|
-
size: "sm",
|
|
1204
|
-
onClick: r,
|
|
1205
|
-
title: "Manage members",
|
|
1206
|
-
children: /* @__PURE__ */ e(Le, { className: "h-4 w-4" })
|
|
1207
|
-
}
|
|
1208
|
-
),
|
|
1209
|
-
i && /* @__PURE__ */ e(
|
|
1210
|
-
A,
|
|
1211
|
-
{
|
|
1212
|
-
variant: "ghost",
|
|
1213
|
-
size: "sm",
|
|
1214
|
-
onClick: a,
|
|
1215
|
-
title: "Delete group",
|
|
1216
|
-
className: "text-destructive hover:text-destructive",
|
|
1217
|
-
children: /* @__PURE__ */ e(ms, { className: "h-4 w-4" })
|
|
1218
|
-
}
|
|
1219
|
-
)
|
|
1220
|
-
] })
|
|
1221
|
-
] }) });
|
|
1222
|
-
}
|
|
1223
|
-
function Gt() {
|
|
1224
|
-
var We, Xe, Ye;
|
|
1225
|
-
Ia(), _a();
|
|
1226
|
-
const {
|
|
1227
|
-
authToken: s,
|
|
1228
|
-
tokenProps: r,
|
|
1229
|
-
id: a
|
|
1230
|
-
} = j(), { isLocalDev: t } = da(), { permissions: i } = ja(), o = ua(), { isLoading: u } = ma();
|
|
1231
|
-
w((c) => c.theme);
|
|
1232
|
-
const m = w((c) => c.lenses), f = w((c) => c.selectedLensId), v = m == null ? void 0 : m.find((c) => c.id === f), d = w((c) => c.dashboard);
|
|
1233
|
-
w((c) => c.selectedSheetId);
|
|
1234
|
-
const l = w(
|
|
1235
|
-
(c) => c.isDashboardEditing
|
|
1236
|
-
), { setDashboardTitle: h } = w((c) => c.actions), [p, g] = S(!1), [y, N] = S(!1), [E, _] = S(!1), [P, k] = S(!1), [z, R] = S(!1), [H, C] = S(!1), [G, B] = S(null), [he, K] = S(!1), b = w((c) => c.isDashboardPanelOpen), M = w(
|
|
1237
|
-
(c) => c.actions.setIsDashboardPanelOpen
|
|
1238
|
-
), T = w((c) => c.filterValues), x = w((c) => c.isVisualEditing);
|
|
1239
|
-
es((c) => c.card);
|
|
1240
|
-
const U = oe(
|
|
1241
|
-
(c) => c.selectedDashboard
|
|
1242
|
-
), q = oe(
|
|
1243
|
-
(c) => c.initialDashboard
|
|
1244
|
-
);
|
|
1245
|
-
oe((c) => c.selectedVisual), w((c) => c.selectedFrameId), es((c) => c.frame);
|
|
1246
|
-
const se = U ? (Xe = U == null ? void 0 : U.permissions) == null ? void 0 : Xe.canEdit : (We = q == null ? void 0 : q.permissions) == null ? void 0 : We.canEdit, Is = w((c) => c.showFilters), _s = ha((c) => c.setPanelOpen), Ts = w(
|
|
1247
|
-
(c) => c.showDashboardJSON
|
|
1248
|
-
), pe = w((c) => c.onSaveFunction), Ps = w(
|
|
1249
|
-
(c) => c.actions.setShowFilters
|
|
1250
|
-
), { setIsDashboardEditing: ze, setShowDashboardJSON: He } = w(
|
|
1251
|
-
(c) => c.actions
|
|
1252
|
-
), { setInitialDashboard: Be, clearSelectedDashboard: Gs } = oe(
|
|
1253
|
-
(c) => c.actions
|
|
1254
|
-
), { resources: ae } = pa(ye.DASHBOARD), { currentUser: Rs } = ps(), Us = fa(Rs), Q = U || q, Ke = Q ? {
|
|
1255
|
-
id: Q.id,
|
|
1256
|
-
title: (d == null ? void 0 : d.title) || Q.title || "Dashboard"
|
|
1257
|
-
} : null, { handleAddNewFrame: Fs } = ga(), [J, fe] = S(!1), [js, te] = S(!1), ne = va(ye.DASHBOARD), [W, ge] = S(
|
|
1258
|
-
null
|
|
1259
|
-
), qs = async (c, O) => {
|
|
1260
|
-
if (!(d != null && d.id)) {
|
|
1261
|
-
console.log("No dashboard ID found");
|
|
1262
|
-
return;
|
|
1263
|
-
}
|
|
1264
|
-
console.log("Updating dashboard title:", {
|
|
1265
|
-
dashboardId: d.id,
|
|
1266
|
-
newTitle: c,
|
|
1267
|
-
previousTitle: O
|
|
1268
|
-
}), ne.mutate(
|
|
1269
|
-
{
|
|
1270
|
-
resourceId: d.id,
|
|
1271
|
-
data: { title: c }
|
|
1272
|
-
},
|
|
1273
|
-
{
|
|
1274
|
-
onSuccess: () => {
|
|
1275
|
-
console.log("Dashboard title updated successfully"), L.success("Dashboard title updated");
|
|
1276
|
-
},
|
|
1277
|
-
onError: (X) => {
|
|
1278
|
-
console.error("Failed to update dashboard title:", X), L.error("Failed to update dashboard title"), h(O);
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
);
|
|
1282
|
-
};
|
|
1283
|
-
Oa(() => {
|
|
1284
|
-
if (ae && ae.length > 0) {
|
|
1285
|
-
const c = d == null ? void 0 : d.id;
|
|
1286
|
-
if (c) {
|
|
1287
|
-
const O = ae.find(
|
|
1288
|
-
(X) => X.id === c
|
|
1289
|
-
);
|
|
1290
|
-
O && Be(O);
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
}, [ae, d == null ? void 0 : d.id, Be]);
|
|
1294
|
-
const re = r.orgUserId || r.tenantId, Vs = l && !x && re && se, { setDashboard: Qe } = w((c) => c.actions), $s = () => {
|
|
1295
|
-
ze(!0);
|
|
1296
|
-
}, ve = () => {
|
|
1297
|
-
ze(!1), He(!1), ge(null);
|
|
1298
|
-
};
|
|
1299
|
-
Ta(
|
|
1300
|
-
l,
|
|
1301
|
-
d,
|
|
1302
|
-
W,
|
|
1303
|
-
(c) => ge(c)
|
|
1304
|
-
);
|
|
1305
|
-
const zs = () => W ? JSON.stringify(d) !== JSON.stringify(W) : !1, Hs = () => {
|
|
1306
|
-
zs() ? te(!0) : ve();
|
|
1307
|
-
}, Bs = async () => {
|
|
1308
|
-
await be({ closeAfterSave: !0 });
|
|
1309
|
-
}, Ks = () => {
|
|
1310
|
-
W && Qe(W), ve(), te(!1);
|
|
1311
|
-
};
|
|
1312
|
-
async function be(c) {
|
|
1313
|
-
const O = (c == null ? void 0 : c.closeAfterSave) ?? he;
|
|
1314
|
-
K(O), O && te(!1);
|
|
1315
|
-
const X = ka(d);
|
|
1316
|
-
C(!0), B(null), fe(!0);
|
|
1317
|
-
const Ws = {
|
|
1318
|
-
template: d
|
|
1319
|
-
};
|
|
1320
|
-
ne.mutate(
|
|
1321
|
-
{
|
|
1322
|
-
resourceId: d.id,
|
|
1323
|
-
data: Ws
|
|
1324
|
-
},
|
|
1325
|
-
{
|
|
1326
|
-
onSuccess: () => {
|
|
1327
|
-
fe(!1), L.success("Dashboard saved!"), ge(X), C(!1), K(!1), O && ve();
|
|
1328
|
-
},
|
|
1329
|
-
onError: () => {
|
|
1330
|
-
fe(!1), B("Failed to save dashboard. Please try again."), L.error("Failed to save dashboard");
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
);
|
|
1334
|
-
}
|
|
1335
|
-
async function Qs() {
|
|
1336
|
-
if (g(!0), !f || !v) return;
|
|
1337
|
-
const c = JSON.stringify(d), O = {
|
|
1338
|
-
...v,
|
|
1339
|
-
template: c,
|
|
1340
|
-
filterValues: T
|
|
1341
|
-
};
|
|
1342
|
-
await ke(
|
|
1343
|
-
r.apiServiceUrl,
|
|
1344
|
-
O,
|
|
1345
|
-
s == null ? void 0 : s.accessToken
|
|
1346
|
-
), L.success("Lens saved"), pe == null || pe(d), g(!1);
|
|
1347
|
-
}
|
|
1348
|
-
const Je = (v == null ? void 0 : v.name) || d.title;
|
|
1349
|
-
ne.isPending && console.log("Title during update:", {
|
|
1350
|
-
title: Je,
|
|
1351
|
-
dashboardStateTitle: d.title,
|
|
1352
|
-
dashboardId: d == null ? void 0 : d.id,
|
|
1353
|
-
currentLensName: v == null ? void 0 : v.name
|
|
1354
|
-
});
|
|
1355
|
-
const Js = r.orgUserId || r.tenantId && r.endUserId && r.endUserEmail;
|
|
1356
|
-
return /* @__PURE__ */ n(
|
|
1357
|
-
"div",
|
|
1358
|
-
{
|
|
1359
|
-
className: "flex h-11 shrink-0 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-2",
|
|
1360
|
-
role: "dashboard-controls",
|
|
1361
|
-
children: [
|
|
1362
|
-
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1363
|
-
Js && /* @__PURE__ */ n(I, { children: [
|
|
1364
|
-
/* @__PURE__ */ e(
|
|
1365
|
-
F,
|
|
1366
|
-
{
|
|
1367
|
-
"aria-label": "Manage Dashboards",
|
|
1368
|
-
tooltip: "Manage Dashboards",
|
|
1369
|
-
onClick: () => {
|
|
1370
|
-
M(!b);
|
|
1371
|
-
},
|
|
1372
|
-
className: "h-7 p-2",
|
|
1373
|
-
children: /* @__PURE__ */ e(Ha, { className: "h-4 w-4" })
|
|
1374
|
-
}
|
|
1375
|
-
),
|
|
1376
|
-
o && !x && /* @__PURE__ */ e(
|
|
1377
|
-
F,
|
|
1378
|
-
{
|
|
1379
|
-
"aria-label": "Dashboard Hub",
|
|
1380
|
-
tooltip: "Dashboard Hub",
|
|
1381
|
-
onClick: () => Gs(),
|
|
1382
|
-
className: "h-7 p-2",
|
|
1383
|
-
children: /* @__PURE__ */ e(is, { className: "h-4 w-4" })
|
|
1384
|
-
}
|
|
1385
|
-
)
|
|
1386
|
-
] }),
|
|
1387
|
-
!x && o && (u ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1388
|
-
/* @__PURE__ */ e(V, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
|
|
1389
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
|
|
1390
|
-
] }) : /* @__PURE__ */ e(
|
|
1391
|
-
ba,
|
|
1392
|
-
{
|
|
1393
|
-
value: Je || "Untitled Dashboard",
|
|
1394
|
-
onSave: (c) => {
|
|
1395
|
-
console.log("EditableText onSave called:", {
|
|
1396
|
-
newTitle: c,
|
|
1397
|
-
canEditDashboard: se,
|
|
1398
|
-
dashboardId: d == null ? void 0 : d.id
|
|
1399
|
-
});
|
|
1400
|
-
const O = (d == null ? void 0 : d.title) || "";
|
|
1401
|
-
h(c), qs(c, O);
|
|
1402
|
-
},
|
|
1403
|
-
isEditable: se && !v,
|
|
1404
|
-
displayClassName: "text-sm font-medium",
|
|
1405
|
-
inputClassName: "text-sm font-medium",
|
|
1406
|
-
placeholder: "Dashboard Title",
|
|
1407
|
-
isPending: ne.isPending
|
|
1408
|
-
}
|
|
1409
|
-
))
|
|
1410
|
-
] }),
|
|
1411
|
-
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1412
|
-
x && /* @__PURE__ */ n(I, { children: [
|
|
1413
|
-
/* @__PURE__ */ e(Pa, { className: "mr-2" }),
|
|
1414
|
-
/* @__PURE__ */ e(Ga, { className: "h-7" })
|
|
1415
|
-
] }),
|
|
1416
|
-
t && !x && /* @__PURE__ */ n(I, { children: [
|
|
1417
|
-
/* @__PURE__ */ e(
|
|
1418
|
-
F,
|
|
1419
|
-
{
|
|
1420
|
-
tooltip: "Copy Token",
|
|
1421
|
-
onClick: () => {
|
|
1422
|
-
var c;
|
|
1423
|
-
s != null && s.accessToken && ((c = navigator == null ? void 0 : navigator.clipboard) != null && c.writeText ? navigator.clipboard.writeText(s.accessToken).then(() => L.success("Token copied to clipboard")).catch(() => L.error("Unable to copy token")) : L.error("Clipboard not available"));
|
|
1424
|
-
},
|
|
1425
|
-
className: "h-7 p-2",
|
|
1426
|
-
children: /* @__PURE__ */ e(ya, { className: "h-4 w-4" })
|
|
1427
|
-
}
|
|
1428
|
-
),
|
|
1429
|
-
/* @__PURE__ */ e(
|
|
1430
|
-
F,
|
|
1431
|
-
{
|
|
1432
|
-
tooltip: "Invalidate Token",
|
|
1433
|
-
onClick: () => Na(r.apiServiceUrl),
|
|
1434
|
-
className: "h-7 p-2",
|
|
1435
|
-
children: /* @__PURE__ */ e(Ka, { className: "h-4 w-4" })
|
|
1436
|
-
}
|
|
1437
|
-
)
|
|
1438
|
-
] }),
|
|
1439
|
-
!x && o && /* @__PURE__ */ e(Sa, {}),
|
|
1440
|
-
!x && o && /* @__PURE__ */ e(Ra, {}),
|
|
1441
|
-
!x && o && /* @__PURE__ */ e(Ua, {}),
|
|
1442
|
-
!x && o && Us && /* @__PURE__ */ e(
|
|
1443
|
-
F,
|
|
1444
|
-
{
|
|
1445
|
-
tooltip: "Manage Groups",
|
|
1446
|
-
onClick: () => _(!0),
|
|
1447
|
-
className: "h-7 p-2",
|
|
1448
|
-
children: /* @__PURE__ */ e($, { className: "h-4 w-4" })
|
|
1449
|
-
}
|
|
1450
|
-
),
|
|
1451
|
-
!x && o && ((Ye = Q == null ? void 0 : Q.permissions) == null ? void 0 : Ye.canShare) && /* @__PURE__ */ e(
|
|
1452
|
-
F,
|
|
1453
|
-
{
|
|
1454
|
-
tooltip: "Share Dashboard",
|
|
1455
|
-
onClick: () => N(!0),
|
|
1456
|
-
className: "h-7 p-2",
|
|
1457
|
-
children: /* @__PURE__ */ e(xa, { className: "h-4 w-4" })
|
|
1458
|
-
}
|
|
1459
|
-
),
|
|
1460
|
-
!Is && !x && l && i.canUseFilters && o && /* @__PURE__ */ e(
|
|
1461
|
-
A,
|
|
1462
|
-
{
|
|
1463
|
-
className: "h-7 p-2",
|
|
1464
|
-
variant: "outline",
|
|
1465
|
-
onClick: () => {
|
|
1466
|
-
_s("dashboard", !1), Ps(!0);
|
|
1467
|
-
},
|
|
1468
|
-
size: "sm",
|
|
1469
|
-
children: /* @__PURE__ */ e(wa, { className: "h-4 w-4" })
|
|
1470
|
-
}
|
|
1471
|
-
),
|
|
1472
|
-
l && !x && re && t && o && /* @__PURE__ */ e(st, {}),
|
|
1473
|
-
!x && re && t && o && /* @__PURE__ */ e(at, {}),
|
|
1474
|
-
l && !x && re && v && t && o && /* @__PURE__ */ n(
|
|
1475
|
-
A,
|
|
1476
|
-
{
|
|
1477
|
-
className: "h-7 p-2",
|
|
1478
|
-
variant: "secondary",
|
|
1479
|
-
disabled: p,
|
|
1480
|
-
onClick: Qs,
|
|
1481
|
-
size: "sm",
|
|
1482
|
-
children: [
|
|
1483
|
-
/* @__PURE__ */ e(ss, { className: "mr-2 h-4 w-4" }),
|
|
1484
|
-
"Save Lens"
|
|
1485
|
-
]
|
|
1486
|
-
}
|
|
1487
|
-
),
|
|
1488
|
-
l && !x && o && /* @__PURE__ */ n(
|
|
1489
|
-
A,
|
|
1490
|
-
{
|
|
1491
|
-
variant: "outline",
|
|
1492
|
-
className: "h-7 p-2",
|
|
1493
|
-
size: "sm",
|
|
1494
|
-
disabled: !l,
|
|
1495
|
-
onClick: () => Fs(),
|
|
1496
|
-
children: [
|
|
1497
|
-
/* @__PURE__ */ e(Ge, { className: "mr-2 h-4 w-4" }),
|
|
1498
|
-
"Visual"
|
|
1499
|
-
]
|
|
1500
|
-
}
|
|
1501
|
-
),
|
|
1502
|
-
!x && !l && se && o && /* @__PURE__ */ n(
|
|
1503
|
-
A,
|
|
1504
|
-
{
|
|
1505
|
-
variant: "outline",
|
|
1506
|
-
className: "h-7 p-2",
|
|
1507
|
-
onClick: $s,
|
|
1508
|
-
size: "sm",
|
|
1509
|
-
children: [
|
|
1510
|
-
/* @__PURE__ */ e(Ca, { className: "mr-2 h-4 w-4" }),
|
|
1511
|
-
"Edit"
|
|
1512
|
-
]
|
|
1513
|
-
}
|
|
1514
|
-
),
|
|
1515
|
-
Vs && o && /* @__PURE__ */ n(
|
|
1516
|
-
A,
|
|
1517
|
-
{
|
|
1518
|
-
className: "h-7 p-2",
|
|
1519
|
-
disabled: J,
|
|
1520
|
-
onClick: () => be(),
|
|
1521
|
-
size: "sm",
|
|
1522
|
-
children: [
|
|
1523
|
-
J ? /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(ss, { className: "mr-2 h-4 w-4" }),
|
|
1524
|
-
J ? "Saving..." : "Save"
|
|
1525
|
-
]
|
|
1526
|
-
}
|
|
1527
|
-
),
|
|
1528
|
-
!x && l && t && o && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
|
|
1529
|
-
A,
|
|
1530
|
-
{
|
|
1531
|
-
className: "h-7 p-2",
|
|
1532
|
-
onClick: () => He(!Ts),
|
|
1533
|
-
size: "sm",
|
|
1534
|
-
variant: "ghost",
|
|
1535
|
-
children: /* @__PURE__ */ e(Da, { className: "h-4 w-4" })
|
|
1536
|
-
}
|
|
1537
|
-
) }),
|
|
1538
|
-
!x && t && /* @__PURE__ */ e(Ya, {}),
|
|
1539
|
-
l && !x && o && /* @__PURE__ */ n(
|
|
1540
|
-
A,
|
|
1541
|
-
{
|
|
1542
|
-
variant: "outline",
|
|
1543
|
-
className: "h-7 p-2",
|
|
1544
|
-
onClick: Hs,
|
|
1545
|
-
children: [
|
|
1546
|
-
/* @__PURE__ */ e(cs, { className: "mr-2 h-4 w-4" }),
|
|
1547
|
-
"Close"
|
|
1548
|
-
]
|
|
1549
|
-
}
|
|
1550
|
-
),
|
|
1551
|
-
!x && o && /* @__PURE__ */ n(Oe, { children: [
|
|
1552
|
-
/* @__PURE__ */ e(Ie, { asChild: !0, children: /* @__PURE__ */ e(F, { tooltip: "More Options", className: "h-7 p-2", children: /* @__PURE__ */ e(Ea, { className: "h-4 w-4" }) }) }),
|
|
1553
|
-
/* @__PURE__ */ n(_e, { align: "end", children: [
|
|
1554
|
-
/* @__PURE__ */ n(Y, { onClick: () => k(!0), children: [
|
|
1555
|
-
/* @__PURE__ */ e(La, { className: "mr-2 h-4 w-4" }),
|
|
1556
|
-
"Calendar Preferences"
|
|
1557
|
-
] }),
|
|
1558
|
-
/* @__PURE__ */ n(Y, { onClick: () => R(!0), children: [
|
|
1559
|
-
/* @__PURE__ */ e(Aa, { className: "mr-2 h-4 w-4" }),
|
|
1560
|
-
"Summary Settings"
|
|
1561
|
-
] })
|
|
1562
|
-
] })
|
|
1563
|
-
] }),
|
|
1564
|
-
y && Ke && /* @__PURE__ */ e(
|
|
1565
|
-
Ma,
|
|
1566
|
-
{
|
|
1567
|
-
resource: Ke,
|
|
1568
|
-
resourceType: ye.DASHBOARD,
|
|
1569
|
-
onClose: () => N(!1)
|
|
1570
|
-
}
|
|
1571
|
-
),
|
|
1572
|
-
/* @__PURE__ */ e(
|
|
1573
|
-
Ct,
|
|
1574
|
-
{
|
|
1575
|
-
open: E,
|
|
1576
|
-
onOpenChange: _
|
|
1577
|
-
}
|
|
1578
|
-
),
|
|
1579
|
-
/* @__PURE__ */ e(
|
|
1580
|
-
Va,
|
|
1581
|
-
{
|
|
1582
|
-
open: P,
|
|
1583
|
-
onOpenChange: k
|
|
1584
|
-
}
|
|
1585
|
-
),
|
|
1586
|
-
/* @__PURE__ */ e(
|
|
1587
|
-
$a,
|
|
1588
|
-
{
|
|
1589
|
-
open: z,
|
|
1590
|
-
onOpenChange: R,
|
|
1591
|
-
dashboard: d,
|
|
1592
|
-
disabled: !l,
|
|
1593
|
-
onApply: (c) => Qe({
|
|
1594
|
-
...d,
|
|
1595
|
-
summary: c
|
|
1596
|
-
})
|
|
1597
|
-
}
|
|
1598
|
-
),
|
|
1599
|
-
/* @__PURE__ */ e(
|
|
1600
|
-
fs,
|
|
1601
|
-
{
|
|
1602
|
-
open: H,
|
|
1603
|
-
onOpenChange: (c) => {
|
|
1604
|
-
!c && J && !G || (C(c), c || (B(null), K(!1)));
|
|
1605
|
-
},
|
|
1606
|
-
children: /* @__PURE__ */ n(gs, { className: "max-w-sm", children: [
|
|
1607
|
-
/* @__PURE__ */ n(vs, { children: [
|
|
1608
|
-
/* @__PURE__ */ e(bs, { children: G ? "Save failed" : "Saving dashboard" }),
|
|
1609
|
-
/* @__PURE__ */ e(ys, { className: "pt-2", children: G ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
|
|
1610
|
-
] }),
|
|
1611
|
-
/* @__PURE__ */ e(Ns, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: G ? /* @__PURE__ */ n(I, { children: [
|
|
1612
|
-
/* @__PURE__ */ e(
|
|
1613
|
-
Ss,
|
|
1614
|
-
{
|
|
1615
|
-
onClick: () => {
|
|
1616
|
-
C(!1), B(null), K(!1);
|
|
1617
|
-
},
|
|
1618
|
-
className: "m-0",
|
|
1619
|
-
children: "Close"
|
|
1620
|
-
}
|
|
1621
|
-
),
|
|
1622
|
-
/* @__PURE__ */ e(
|
|
1623
|
-
Ae,
|
|
1624
|
-
{
|
|
1625
|
-
onClick: () => be(),
|
|
1626
|
-
className: "m-0",
|
|
1627
|
-
children: "Retry"
|
|
1628
|
-
}
|
|
1629
|
-
)
|
|
1630
|
-
] }) : /* @__PURE__ */ n(
|
|
1631
|
-
Ae,
|
|
1632
|
-
{
|
|
1633
|
-
disabled: !0,
|
|
1634
|
-
className: "m-0 cursor-default",
|
|
1635
|
-
children: [
|
|
1636
|
-
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1637
|
-
"Saving..."
|
|
1638
|
-
]
|
|
1639
|
-
}
|
|
1640
|
-
) })
|
|
1641
|
-
] })
|
|
1642
|
-
}
|
|
1643
|
-
),
|
|
1644
|
-
/* @__PURE__ */ e(
|
|
1645
|
-
Fa,
|
|
1646
|
-
{
|
|
1647
|
-
open: js,
|
|
1648
|
-
onOpenChange: te,
|
|
1649
|
-
onSave: Bs,
|
|
1650
|
-
onDiscard: Ks,
|
|
1651
|
-
isSaving: J
|
|
1652
|
-
}
|
|
1653
|
-
)
|
|
1654
|
-
] })
|
|
1655
|
-
]
|
|
1656
|
-
}
|
|
1657
|
-
);
|
|
1658
|
-
}
|
|
1659
|
-
export {
|
|
1660
|
-
Gt as default
|
|
1661
|
-
};
|