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