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