react-semaphor 0.1.261 → 0.1.263
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-BYi_r2lH.js → dashboard-controls-DVMSiuTb.js} +781 -791
- package/dist/chunks/dashboard-controls-JZ-mgUSY.js +42 -0
- package/dist/chunks/{dashboard-filter-controls-button-BPCw1GMh.js → dashboard-filter-controls-button-ClYx7NdN.js} +3 -3
- package/dist/chunks/{dashboard-filter-controls-button-f4pDkDUL.js → dashboard-filter-controls-button-CnijsTUC.js} +1 -1
- package/dist/chunks/{dashboard-json-Dpy-zKf2.js → dashboard-json-BILMCUhG.js} +1 -1
- package/dist/chunks/{dashboard-json-2NJCXsDD.js → dashboard-json-CKWfqC0m.js} +1 -1
- package/dist/chunks/dashboard-summary-settings-dialog-5JMWm5zV.js +1 -0
- package/dist/chunks/dashboard-summary-settings-dialog-6SEdlbOP.js +535 -0
- package/dist/chunks/{edit-dashboard-visual-CqTlmuYL.js → edit-dashboard-visual-BjU_0_QA.js} +890 -884
- package/dist/chunks/{edit-dashboard-visual-Bon08erH.js → edit-dashboard-visual-DPqnhyq1.js} +5 -5
- package/dist/chunks/index-BUNYVJ8g.js +1114 -0
- package/dist/chunks/{index-C2c-_lPE.js → index-D2dG8YFx.js} +29265 -29226
- package/dist/chunks/{resource-management-panel-BtLPW2b4.js → resource-management-panel-BAytqOVf.js} +1 -1
- package/dist/chunks/{resource-management-panel-Bva2_0OU.js → resource-management-panel-I5Q6TQbc.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-Vyd5mSnf.js → use-create-flow-overlay-state-CPUI4zrE.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-9X7GyUzl.js → use-create-flow-overlay-state-DakZJeCH.js} +1 -1
- package/dist/chunks/{use-visual-utils-OPk_1t4I.js → use-visual-utils-B_9CT1PY.js} +1 -1
- package/dist/chunks/{use-visual-utils-Jv4hWSLm.js → use-visual-utils-Cd9d6nnp.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/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-0hbftZxY.js +0 -42
- package/dist/chunks/dashboard-summary-settings-dialog-B9zRCvc-.js +0 -544
- package/dist/chunks/dashboard-summary-settings-dialog-Be3JilRI.js +0 -1
- package/dist/chunks/index-BoJEr_9F.js +0 -1114
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsxs as o, jsx as e, Fragment as
|
|
2
|
-
import { bL as de, dn as
|
|
1
|
+
import { jsxs as o, jsx as e, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { bL as de, dn as qs, u as x, cy as ra, cz as na, B as M, cB as oa, cC as Q, dp as ia, N as qa, b as $, e as la, dq as Hs, cp as ca, f as da, g as ua, h as ma, i as Ha, L as Qe, I as ce, v as js, a6 as K, dr as we, cG as We, ds as zs, dt as Pa, du as ja, c as Y, dv as za, dw as Bs, cX as ha, dx as Ks, dy as Qs, dz as Ws, dA as Js, dB as Xs, dC as Ys, H as Ae, V as Me, x as k, dD as Le, dE as Ba, dF as Ka, d5 as Zs, dG as et, w as Z, cF as J, dH as at, dI as st, dJ as Je, dK as tt, dL as rt, dM as Qa, dN as Wa, dO as Ce, dP as Ee, d1 as Xe, cL as Ye, dQ as Ze, cc as Ja, dR as ea, c7 as Xa, dS as nt, cO as Ya, cP as Za, cQ as es, cR as as, cS as ss, cT as ts, cU as rs, cV as aa, dT as ns, cx as ot, dU as it, af as lt, U as Ua, ae as De, dV as ct, al as dt, ag as je, dW as ut, dX as mt, dY as ht, aA as pt, dZ as ft, d_ as gt, bS as vt, bT as bt, bU as yt, d$ as Nt, bV as St, cD as xt, as as Dt, e0 as wt, e1 as Ct, dm as Et, e2 as At, e3 as Mt, cA as Lt, a8 as kt, cI as It, e4 as Ot, ak as Tt, a9 as _t, ar as Pt, e5 as Ut } from "./index-D2dG8YFx.js";
|
|
3
3
|
import * as A from "react";
|
|
4
|
-
import
|
|
4
|
+
import os, { useState as N, useMemo as W, useCallback as Ra, useEffect as Rt } from "react";
|
|
5
5
|
import "react-dom";
|
|
6
|
-
import { b as
|
|
7
|
-
import { l as
|
|
8
|
-
import { C as
|
|
9
|
-
import { u as
|
|
10
|
-
import { s as
|
|
11
|
-
import { S as Ga } from "./use-create-flow-overlay-state-
|
|
6
|
+
import { b as Gt, u as Ft, d as $t, A as Vt, V as qt, N as Ht, c as jt, D as zt, U as Bt } from "./dashboard-filter-controls-button-ClYx7NdN.js";
|
|
7
|
+
import { l as Kt } from "./date-formatter-vkCj9Ct-.js";
|
|
8
|
+
import { C as Qt, D as Wt } from "./dashboard-summary-settings-dialog-6SEdlbOP.js";
|
|
9
|
+
import { u as Jt } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
10
|
+
import { s as ze } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
11
|
+
import { S as Ga } from "./use-create-flow-overlay-state-CPUI4zrE.js";
|
|
12
12
|
/**
|
|
13
13
|
* @license lucide-react v0.453.0 - ISC
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the ISC license.
|
|
16
16
|
* See the LICENSE file in the root directory of this source tree.
|
|
17
17
|
*/
|
|
18
|
-
const
|
|
18
|
+
const Xt = de("Glasses", [
|
|
19
19
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
20
20
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
21
21
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -28,7 +28,7 @@ const Qt = de("Glasses", [
|
|
|
28
28
|
* This source code is licensed under the ISC license.
|
|
29
29
|
* See the LICENSE file in the root directory of this source tree.
|
|
30
30
|
*/
|
|
31
|
-
const
|
|
31
|
+
const Yt = de("Menu", [
|
|
32
32
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
33
33
|
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
34
34
|
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
@@ -39,7 +39,7 @@ const Wt = de("Menu", [
|
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
41
|
*/
|
|
42
|
-
const
|
|
42
|
+
const Zt = de("Moon", [
|
|
43
43
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
44
44
|
]);
|
|
45
45
|
/**
|
|
@@ -48,7 +48,7 @@ const Jt = de("Moon", [
|
|
|
48
48
|
* This source code is licensed under the ISC license.
|
|
49
49
|
* See the LICENSE file in the root directory of this source tree.
|
|
50
50
|
*/
|
|
51
|
-
const
|
|
51
|
+
const er = de("ShieldX", [
|
|
52
52
|
[
|
|
53
53
|
"path",
|
|
54
54
|
{
|
|
@@ -65,7 +65,7 @@ const Xt = de("ShieldX", [
|
|
|
65
65
|
* This source code is licensed under the ISC license.
|
|
66
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
67
|
*/
|
|
68
|
-
const
|
|
68
|
+
const ar = de("Sun", [
|
|
69
69
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
70
70
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
71
71
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -76,7 +76,7 @@ const Yt = de("Sun", [
|
|
|
76
76
|
["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
|
|
77
77
|
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
|
|
78
78
|
]);
|
|
79
|
-
var
|
|
79
|
+
var sa = { exports: {} }, Be = {};
|
|
80
80
|
/**
|
|
81
81
|
* @license React
|
|
82
82
|
* use-sync-external-store-shim.production.js
|
|
@@ -86,48 +86,48 @@ var aa = { exports: {} }, ze = {};
|
|
|
86
86
|
* This source code is licensed under the MIT license found in the
|
|
87
87
|
* LICENSE file in the root directory of this source tree.
|
|
88
88
|
*/
|
|
89
|
-
var
|
|
90
|
-
function
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
var a =
|
|
94
|
-
function n(
|
|
95
|
-
return
|
|
89
|
+
var Fa;
|
|
90
|
+
function sr() {
|
|
91
|
+
if (Fa) return Be;
|
|
92
|
+
Fa = 1;
|
|
93
|
+
var a = os;
|
|
94
|
+
function n(r, d) {
|
|
95
|
+
return r === d && (r !== 0 || 1 / r === 1 / d) || r !== r && d !== d;
|
|
96
96
|
}
|
|
97
|
-
var
|
|
98
|
-
function
|
|
99
|
-
var f = d(), v =
|
|
97
|
+
var s = typeof Object.is == "function" ? Object.is : n, t = a.useState, l = a.useEffect, c = a.useLayoutEffect, m = a.useDebugValue;
|
|
98
|
+
function u(r, d) {
|
|
99
|
+
var f = d(), v = t({ inst: { value: f, getSnapshot: d } }), b = v[0].inst, S = v[1];
|
|
100
100
|
return c(
|
|
101
101
|
function() {
|
|
102
102
|
b.value = f, b.getSnapshot = d, p(b) && S({ inst: b });
|
|
103
103
|
},
|
|
104
|
-
[
|
|
105
|
-
),
|
|
104
|
+
[r, f, d]
|
|
105
|
+
), l(
|
|
106
106
|
function() {
|
|
107
|
-
return p(b) && S({ inst: b }),
|
|
107
|
+
return p(b) && S({ inst: b }), r(function() {
|
|
108
108
|
p(b) && S({ inst: b });
|
|
109
109
|
});
|
|
110
110
|
},
|
|
111
|
-
[
|
|
112
|
-
),
|
|
111
|
+
[r]
|
|
112
|
+
), m(f), f;
|
|
113
113
|
}
|
|
114
|
-
function p(
|
|
115
|
-
var d =
|
|
116
|
-
|
|
114
|
+
function p(r) {
|
|
115
|
+
var d = r.getSnapshot;
|
|
116
|
+
r = r.value;
|
|
117
117
|
try {
|
|
118
118
|
var f = d();
|
|
119
|
-
return !
|
|
119
|
+
return !s(r, f);
|
|
120
120
|
} catch {
|
|
121
121
|
return !0;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
function y(
|
|
124
|
+
function y(r, d) {
|
|
125
125
|
return d();
|
|
126
126
|
}
|
|
127
|
-
var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? y :
|
|
128
|
-
return
|
|
127
|
+
var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? y : u;
|
|
128
|
+
return Be.useSyncExternalStore = a.useSyncExternalStore !== void 0 ? a.useSyncExternalStore : h, Be;
|
|
129
129
|
}
|
|
130
|
-
var
|
|
130
|
+
var Ke = {};
|
|
131
131
|
/**
|
|
132
132
|
* @license React
|
|
133
133
|
* use-sync-external-store-shim.development.js
|
|
@@ -137,42 +137,42 @@ var Be = {};
|
|
|
137
137
|
* This source code is licensed under the MIT license found in the
|
|
138
138
|
* LICENSE file in the root directory of this source tree.
|
|
139
139
|
*/
|
|
140
|
-
var
|
|
141
|
-
function
|
|
142
|
-
return
|
|
140
|
+
var $a;
|
|
141
|
+
function tr() {
|
|
142
|
+
return $a || ($a = 1, process.env.NODE_ENV !== "production" && function() {
|
|
143
143
|
function a(f, v) {
|
|
144
144
|
return f === v && (f !== 0 || 1 / f === 1 / v) || f !== f && v !== v;
|
|
145
145
|
}
|
|
146
146
|
function n(f, v) {
|
|
147
|
-
h ||
|
|
147
|
+
h || l.startTransition === void 0 || (h = !0, console.error(
|
|
148
148
|
"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."
|
|
149
149
|
));
|
|
150
150
|
var b = v();
|
|
151
|
-
if (!
|
|
151
|
+
if (!r) {
|
|
152
152
|
var S = v();
|
|
153
153
|
c(b, S) || (console.error(
|
|
154
154
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
155
|
-
),
|
|
155
|
+
), r = !0);
|
|
156
156
|
}
|
|
157
|
-
S =
|
|
157
|
+
S = m({
|
|
158
158
|
inst: { value: b, getSnapshot: v }
|
|
159
159
|
});
|
|
160
160
|
var C = S[0].inst, P = S[1];
|
|
161
161
|
return p(
|
|
162
162
|
function() {
|
|
163
|
-
C.value = b, C.getSnapshot = v,
|
|
163
|
+
C.value = b, C.getSnapshot = v, s(C) && P({ inst: C });
|
|
164
164
|
},
|
|
165
165
|
[f, b, v]
|
|
166
|
-
),
|
|
166
|
+
), u(
|
|
167
167
|
function() {
|
|
168
|
-
return
|
|
169
|
-
|
|
168
|
+
return s(C) && P({ inst: C }), f(function() {
|
|
169
|
+
s(C) && P({ inst: C });
|
|
170
170
|
});
|
|
171
171
|
},
|
|
172
172
|
[f]
|
|
173
173
|
), y(b), b;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function s(f) {
|
|
176
176
|
var v = f.getSnapshot;
|
|
177
177
|
f = f.value;
|
|
178
178
|
try {
|
|
@@ -182,31 +182,31 @@ function er() {
|
|
|
182
182
|
return !0;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function t(f, v) {
|
|
186
186
|
return v();
|
|
187
187
|
}
|
|
188
188
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
189
|
-
var
|
|
190
|
-
|
|
191
|
-
}()),
|
|
189
|
+
var l = os, c = typeof Object.is == "function" ? Object.is : a, m = l.useState, u = l.useEffect, p = l.useLayoutEffect, y = l.useDebugValue, h = !1, r = !1, d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t : n;
|
|
190
|
+
Ke.useSyncExternalStore = l.useSyncExternalStore !== void 0 ? l.useSyncExternalStore : d, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
191
|
+
}()), Ke;
|
|
192
192
|
}
|
|
193
|
-
process.env.NODE_ENV === "production" ?
|
|
194
|
-
var
|
|
195
|
-
function
|
|
196
|
-
const { setTheme: a } =
|
|
197
|
-
(
|
|
193
|
+
process.env.NODE_ENV === "production" ? sa.exports = sr() : sa.exports = tr();
|
|
194
|
+
var rr = sa.exports;
|
|
195
|
+
function nr() {
|
|
196
|
+
const { setTheme: a } = qs(), n = x(
|
|
197
|
+
(s) => s.actions.setDashboardTheme
|
|
198
198
|
);
|
|
199
|
-
return /* @__PURE__ */ o(
|
|
200
|
-
/* @__PURE__ */ e(
|
|
199
|
+
return /* @__PURE__ */ o(ra, { children: [
|
|
200
|
+
/* @__PURE__ */ e(na, { asChild: !0, children: /* @__PURE__ */ o(M, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
|
|
201
201
|
/* @__PURE__ */ e(
|
|
202
|
-
|
|
202
|
+
ar,
|
|
203
203
|
{
|
|
204
204
|
strokeWidth: 1.5,
|
|
205
205
|
className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
|
|
206
206
|
}
|
|
207
207
|
),
|
|
208
208
|
/* @__PURE__ */ e(
|
|
209
|
-
|
|
209
|
+
Zt,
|
|
210
210
|
{
|
|
211
211
|
strokeWidth: 1.5,
|
|
212
212
|
className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
|
|
@@ -214,9 +214,9 @@ function sr() {
|
|
|
214
214
|
),
|
|
215
215
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
|
|
216
216
|
] }) }),
|
|
217
|
-
/* @__PURE__ */ o(
|
|
217
|
+
/* @__PURE__ */ o(oa, { align: "end", children: [
|
|
218
218
|
/* @__PURE__ */ e(
|
|
219
|
-
|
|
219
|
+
Q,
|
|
220
220
|
{
|
|
221
221
|
onClick: () => {
|
|
222
222
|
a("light"), n("light");
|
|
@@ -225,7 +225,7 @@ function sr() {
|
|
|
225
225
|
}
|
|
226
226
|
),
|
|
227
227
|
/* @__PURE__ */ e(
|
|
228
|
-
|
|
228
|
+
Q,
|
|
229
229
|
{
|
|
230
230
|
onClick: () => {
|
|
231
231
|
a("dark"), n("dark");
|
|
@@ -234,7 +234,7 @@ function sr() {
|
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
236
|
/* @__PURE__ */ e(
|
|
237
|
-
|
|
237
|
+
Q,
|
|
238
238
|
{
|
|
239
239
|
onClick: () => {
|
|
240
240
|
a("system"), n("system");
|
|
@@ -245,72 +245,72 @@ function sr() {
|
|
|
245
245
|
] })
|
|
246
246
|
] });
|
|
247
247
|
}
|
|
248
|
-
async function
|
|
249
|
-
if (!
|
|
248
|
+
async function or(a, n, s, t, l) {
|
|
249
|
+
if (!l)
|
|
250
250
|
return null;
|
|
251
|
-
const c = JSON.stringify(
|
|
252
|
-
return await
|
|
251
|
+
const c = JSON.stringify(s), m = `${a}/v1/lens`;
|
|
252
|
+
return await ia(m, l, {
|
|
253
253
|
name: n,
|
|
254
254
|
template: c,
|
|
255
|
-
filterValues:
|
|
255
|
+
filterValues: t,
|
|
256
256
|
operation: "create"
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
|
-
async function
|
|
260
|
-
if (!
|
|
259
|
+
async function ta(a, n, s) {
|
|
260
|
+
if (!s)
|
|
261
261
|
return null;
|
|
262
|
-
const { id:
|
|
263
|
-
return await
|
|
264
|
-
lensId:
|
|
265
|
-
template:
|
|
262
|
+
const { id: t, template: l, filterValues: c, isDefault: m, shared: u } = n, p = `${a}/v1/lens`;
|
|
263
|
+
return await ia(p, s, {
|
|
264
|
+
lensId: t,
|
|
265
|
+
template: l,
|
|
266
266
|
filterValues: c,
|
|
267
|
-
isDefault:
|
|
268
|
-
shared:
|
|
267
|
+
isDefault: m,
|
|
268
|
+
shared: u,
|
|
269
269
|
operation: "update"
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
-
async function
|
|
273
|
-
if (!
|
|
272
|
+
async function ir(a, n, s) {
|
|
273
|
+
if (!s)
|
|
274
274
|
return null;
|
|
275
|
-
const
|
|
276
|
-
return await
|
|
275
|
+
const t = `${a}/v1/lens`;
|
|
276
|
+
return await ia(t, s, {
|
|
277
277
|
operation: "delete",
|
|
278
278
|
lensId: n
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
const [a, n] = N(""), [
|
|
281
|
+
function lr() {
|
|
282
|
+
const [a, n] = N(""), [s, t] = N(!1), l = x((S) => S.lenses), { setLenses: c, setSelectedLensId: m } = qa(), [u, p] = N(!1), [y, h] = N(!1), r = x((S) => S.dashboard), d = x((S) => S.filterValues), { authToken: f, tokenProps: v } = $();
|
|
283
283
|
async function b() {
|
|
284
284
|
p(!0);
|
|
285
|
-
const S = await
|
|
285
|
+
const S = await or(
|
|
286
286
|
v.apiServiceUrl,
|
|
287
287
|
a,
|
|
288
|
-
|
|
288
|
+
r,
|
|
289
289
|
d,
|
|
290
290
|
f == null ? void 0 : f.accessToken
|
|
291
291
|
);
|
|
292
|
-
S && (c([...
|
|
292
|
+
S && (c([...l || [], S]), m(S.id), h(!1)), p(!1);
|
|
293
293
|
}
|
|
294
|
-
return /* @__PURE__ */ o(
|
|
295
|
-
/* @__PURE__ */ e(
|
|
294
|
+
return /* @__PURE__ */ o(la, { open: y, onOpenChange: h, children: [
|
|
295
|
+
/* @__PURE__ */ e(Hs, { asChild: !0, children: /* @__PURE__ */ o(
|
|
296
296
|
M,
|
|
297
297
|
{
|
|
298
298
|
variant: "secondary",
|
|
299
299
|
className: "h-7 p-2",
|
|
300
300
|
size: "sm",
|
|
301
301
|
children: [
|
|
302
|
-
/* @__PURE__ */ e(
|
|
302
|
+
/* @__PURE__ */ e(ca, { className: "mr-2 h-4 w-4" }),
|
|
303
303
|
"Lens"
|
|
304
304
|
]
|
|
305
305
|
}
|
|
306
306
|
) }),
|
|
307
|
-
/* @__PURE__ */ o(
|
|
308
|
-
/* @__PURE__ */ o(
|
|
309
|
-
/* @__PURE__ */ e(
|
|
310
|
-
/* @__PURE__ */ e(
|
|
307
|
+
/* @__PURE__ */ o(da, { className: "sm:max-w-[425px]", children: [
|
|
308
|
+
/* @__PURE__ */ o(ua, { children: [
|
|
309
|
+
/* @__PURE__ */ e(ma, { children: "Create Lens" }),
|
|
310
|
+
/* @__PURE__ */ e(Ha, { children: "Lenses are private by default and are only visible to you." })
|
|
311
311
|
] }),
|
|
312
312
|
/* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ o("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
313
|
-
/* @__PURE__ */ e(
|
|
313
|
+
/* @__PURE__ */ e(Qe, { className: "text-right", children: "Name" }),
|
|
314
314
|
/* @__PURE__ */ e(
|
|
315
315
|
ce,
|
|
316
316
|
{
|
|
@@ -323,96 +323,96 @@ function nr() {
|
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
] }) }),
|
|
326
|
-
|
|
327
|
-
/* @__PURE__ */ e(
|
|
326
|
+
s && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
327
|
+
/* @__PURE__ */ e(js, { children: /* @__PURE__ */ e(
|
|
328
328
|
M,
|
|
329
329
|
{
|
|
330
330
|
size: "sm",
|
|
331
331
|
variant: "outline",
|
|
332
332
|
type: "submit",
|
|
333
333
|
onClick: b,
|
|
334
|
-
disabled:
|
|
335
|
-
children:
|
|
334
|
+
disabled: u,
|
|
335
|
+
children: u ? "Creating..." : "Add"
|
|
336
336
|
}
|
|
337
337
|
) })
|
|
338
338
|
] })
|
|
339
339
|
] });
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
const [a, n] = N(!1),
|
|
343
|
-
async function p(
|
|
344
|
-
c(
|
|
341
|
+
function cr() {
|
|
342
|
+
const [a, n] = N(!1), s = x((r) => r.lenses), t = x((r) => r.selectedLensId), { setLenses: l, setSelectedLensId: c } = qa(), { authToken: m, tokenProps: u } = $();
|
|
343
|
+
async function p(r) {
|
|
344
|
+
c(r);
|
|
345
345
|
}
|
|
346
|
-
async function y(
|
|
347
|
-
if (await
|
|
348
|
-
const f =
|
|
349
|
-
|
|
346
|
+
async function y(r) {
|
|
347
|
+
if (await ir(u.apiServiceUrl, r, m == null ? void 0 : m.accessToken)) {
|
|
348
|
+
const f = s == null ? void 0 : s.filter((v) => v.id !== r);
|
|
349
|
+
l(f || []), c("original");
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
async function h(
|
|
353
|
-
const d =
|
|
352
|
+
async function h(r) {
|
|
353
|
+
const d = s == null ? void 0 : s.map((b) => b.id === r.id ? {
|
|
354
354
|
...b,
|
|
355
|
-
isDefault: !
|
|
355
|
+
isDefault: !r.isDefault
|
|
356
356
|
} : {
|
|
357
357
|
...b,
|
|
358
358
|
isDefault: !1
|
|
359
359
|
});
|
|
360
|
-
|
|
360
|
+
l(d || []);
|
|
361
361
|
const f = {
|
|
362
|
-
...
|
|
363
|
-
isDefault: !
|
|
362
|
+
...r,
|
|
363
|
+
isDefault: !r.isDefault
|
|
364
364
|
};
|
|
365
|
-
await
|
|
366
|
-
const v =
|
|
367
|
-
if (v && v.id !==
|
|
365
|
+
await ta(u.apiServiceUrl, f, m == null ? void 0 : m.accessToken);
|
|
366
|
+
const v = s == null ? void 0 : s.find((b) => b.isDefault);
|
|
367
|
+
if (v && v.id !== r.id) {
|
|
368
368
|
const b = {
|
|
369
369
|
...v,
|
|
370
370
|
isDefault: !1
|
|
371
371
|
};
|
|
372
|
-
await
|
|
372
|
+
await ta(u.apiServiceUrl, b, m == null ? void 0 : m.accessToken);
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
-
return /* @__PURE__ */ o(
|
|
376
|
-
/* @__PURE__ */ e(
|
|
377
|
-
/* @__PURE__ */ o(
|
|
378
|
-
/* @__PURE__ */ e(
|
|
379
|
-
/* @__PURE__ */ e(
|
|
375
|
+
return /* @__PURE__ */ o(ra, { open: a, onOpenChange: n, children: [
|
|
376
|
+
/* @__PURE__ */ e(na, { asChild: !0, children: /* @__PURE__ */ e(K, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Xt, { className: "h-4 w-4" }) }) }),
|
|
377
|
+
/* @__PURE__ */ o(oa, { align: "end", className: "w-60", children: [
|
|
378
|
+
/* @__PURE__ */ e(we, { className: "px-3", children: "Lenses" }),
|
|
379
|
+
/* @__PURE__ */ e(We, {}),
|
|
380
380
|
/* @__PURE__ */ o(
|
|
381
|
-
|
|
381
|
+
zs,
|
|
382
382
|
{
|
|
383
|
-
value:
|
|
383
|
+
value: t,
|
|
384
384
|
onValueChange: p,
|
|
385
385
|
children: [
|
|
386
|
-
/* @__PURE__ */ e(
|
|
387
|
-
|
|
388
|
-
|
|
386
|
+
/* @__PURE__ */ e(Pa, { value: "original", children: "Original" }),
|
|
387
|
+
s == null ? void 0 : s.map((r) => /* @__PURE__ */ o(
|
|
388
|
+
Pa,
|
|
389
389
|
{
|
|
390
390
|
className: "group flex justify-between gap-2",
|
|
391
|
-
value:
|
|
391
|
+
value: r.id,
|
|
392
392
|
children: [
|
|
393
|
-
/* @__PURE__ */ e("p", { children:
|
|
393
|
+
/* @__PURE__ */ e("p", { children: r.name }),
|
|
394
394
|
/* @__PURE__ */ o("span", { className: "flex items-center gap-3", children: [
|
|
395
395
|
/* @__PURE__ */ e(
|
|
396
|
-
|
|
396
|
+
ja,
|
|
397
397
|
{
|
|
398
398
|
onClick: (d) => {
|
|
399
|
-
d.preventDefault(), h(
|
|
399
|
+
d.preventDefault(), h(r);
|
|
400
400
|
},
|
|
401
|
-
className:
|
|
401
|
+
className: Y(
|
|
402
402
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
403
403
|
{
|
|
404
|
-
invisible: !
|
|
405
|
-
"text-green-500":
|
|
404
|
+
invisible: !r.isDefault,
|
|
405
|
+
"text-green-500": r.isDefault
|
|
406
406
|
}
|
|
407
407
|
),
|
|
408
408
|
strokeWidth: 1.5
|
|
409
409
|
}
|
|
410
410
|
),
|
|
411
411
|
/* @__PURE__ */ e(
|
|
412
|
-
|
|
412
|
+
za,
|
|
413
413
|
{
|
|
414
414
|
onClick: (d) => {
|
|
415
|
-
d.preventDefault(), y(
|
|
415
|
+
d.preventDefault(), y(r.id);
|
|
416
416
|
},
|
|
417
417
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
418
418
|
strokeWidth: 1.5
|
|
@@ -421,7 +421,7 @@ function or() {
|
|
|
421
421
|
] })
|
|
422
422
|
]
|
|
423
423
|
},
|
|
424
|
-
|
|
424
|
+
r.id
|
|
425
425
|
))
|
|
426
426
|
]
|
|
427
427
|
}
|
|
@@ -429,153 +429,135 @@ function or() {
|
|
|
429
429
|
] })
|
|
430
430
|
] });
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
const { displayPreferences: a, shouldShowElement: n } =
|
|
434
|
-
() =>
|
|
435
|
-
[
|
|
436
|
-
), c =
|
|
432
|
+
function dr() {
|
|
433
|
+
const { displayPreferences: a, shouldShowElement: n } = Bs(), { currentUser: s, userContext: t } = ha(), l = W(
|
|
434
|
+
() => Ks(s),
|
|
435
|
+
[s]
|
|
436
|
+
), c = W(() => (u) => l && l[u] !== void 0 && l[u] === !1 ? !1 : n(u), [l, n, a]), m = W(
|
|
437
437
|
() => {
|
|
438
|
-
var
|
|
438
|
+
var u, p, y, h, r;
|
|
439
439
|
return {
|
|
440
|
-
canEdit: ((
|
|
441
|
-
canUseFilters: ((p =
|
|
442
|
-
canManageDashboards: ((y =
|
|
443
|
-
canCreateDashboards: ((h =
|
|
444
|
-
canAccessVisuals: ((
|
|
440
|
+
canEdit: ((u = t == null ? void 0 : t.permissions) == null ? void 0 : u.canEdit) ?? Ys(s),
|
|
441
|
+
canUseFilters: ((p = t == null ? void 0 : t.permissions) == null ? void 0 : p.canEdit) ?? Xs(s),
|
|
442
|
+
canManageDashboards: ((y = t == null ? void 0 : t.permissions) == null ? void 0 : y.canCreateDashboard) ?? Js(s),
|
|
443
|
+
canCreateDashboards: ((h = t == null ? void 0 : t.permissions) == null ? void 0 : h.canCreateDashboard) ?? Ws(s),
|
|
444
|
+
canAccessVisuals: ((r = t == null ? void 0 : t.permissions) == null ? void 0 : r.canEdit) ?? Qs(s)
|
|
445
445
|
};
|
|
446
446
|
},
|
|
447
|
-
[
|
|
447
|
+
[s, t]
|
|
448
448
|
);
|
|
449
449
|
return {
|
|
450
450
|
displayPreferences: a,
|
|
451
451
|
shouldShowElement: c,
|
|
452
|
-
permissions:
|
|
453
|
-
currentUser:
|
|
452
|
+
permissions: m,
|
|
453
|
+
currentUser: s
|
|
454
454
|
};
|
|
455
455
|
}
|
|
456
|
-
const
|
|
457
|
-
const
|
|
458
|
-
return await
|
|
459
|
-
},
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
throw new Error(c || "Failed to delete group");
|
|
469
|
-
}
|
|
470
|
-
}, dr = async (a, n, t, r) => {
|
|
471
|
-
const i = `${a}/management/v1/groups/${t}/members`;
|
|
472
|
-
return await za(i, n, r);
|
|
473
|
-
}, ur = async (a, n, t, r) => {
|
|
474
|
-
const i = `${a}/management/v1/groups/${t}/members`, c = await fetch(i, {
|
|
475
|
-
method: "DELETE",
|
|
476
|
-
headers: {
|
|
477
|
-
"Content-Type": "application/json",
|
|
478
|
-
Authorization: `Bearer ${n}`
|
|
479
|
-
},
|
|
480
|
-
body: JSON.stringify(r)
|
|
481
|
-
});
|
|
482
|
-
if (!c.ok) {
|
|
483
|
-
const u = await c.text();
|
|
484
|
-
throw new Error(u || "Failed to remove group members");
|
|
485
|
-
}
|
|
456
|
+
const ur = async (a, n, s) => {
|
|
457
|
+
const t = `${a}/management/v1/groups`;
|
|
458
|
+
return await Ka(t, n, s);
|
|
459
|
+
}, mr = async (a, n, s) => {
|
|
460
|
+
const t = `${a}/management/v1/groups/${s}`;
|
|
461
|
+
await Ba(t, n, "DELETE");
|
|
462
|
+
}, hr = async (a, n, s, t) => {
|
|
463
|
+
const l = `${a}/management/v1/groups/${s}/members`;
|
|
464
|
+
return await Ka(l, n, t);
|
|
465
|
+
}, pr = async (a, n, s, t) => {
|
|
466
|
+
const l = `${a}/management/v1/groups/${s}/members`;
|
|
467
|
+
await Ba(l, n, "DELETE", t);
|
|
486
468
|
};
|
|
487
|
-
function
|
|
488
|
-
const { authToken: a, tokenProps: n } =
|
|
469
|
+
function fr() {
|
|
470
|
+
const { authToken: a, tokenProps: n } = $(), s = Ae();
|
|
489
471
|
return Me({
|
|
490
|
-
mutationFn: (
|
|
472
|
+
mutationFn: (t) => ur(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t),
|
|
491
473
|
onSuccess: () => {
|
|
492
|
-
|
|
474
|
+
s.invalidateQueries({ queryKey: ["groups"] }), k.success("Group created successfully");
|
|
493
475
|
},
|
|
494
|
-
onError: (
|
|
495
|
-
console.error("Failed to create group:",
|
|
496
|
-
description:
|
|
476
|
+
onError: (t) => {
|
|
477
|
+
console.error("Failed to create group:", t), k.error("Failed to create group", {
|
|
478
|
+
description: Le(t, "Failed to create group")
|
|
497
479
|
});
|
|
498
480
|
}
|
|
499
481
|
});
|
|
500
482
|
}
|
|
501
|
-
function
|
|
502
|
-
const { authToken: a, tokenProps: n } =
|
|
483
|
+
function gr() {
|
|
484
|
+
const { authToken: a, tokenProps: n } = $(), s = Ae();
|
|
503
485
|
return Me({
|
|
504
|
-
mutationFn: (
|
|
505
|
-
onSuccess: (
|
|
506
|
-
|
|
486
|
+
mutationFn: (t) => mr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t),
|
|
487
|
+
onSuccess: (t, l) => {
|
|
488
|
+
s.invalidateQueries({ queryKey: ["groups"] }), s.removeQueries({ queryKey: ["group", l] }), k.success("Group deleted successfully");
|
|
507
489
|
},
|
|
508
|
-
onError: (
|
|
509
|
-
console.error("Failed to delete group:",
|
|
510
|
-
description:
|
|
490
|
+
onError: (t) => {
|
|
491
|
+
console.error("Failed to delete group:", t), k.error("Failed to delete group", {
|
|
492
|
+
description: Le(t, "Failed to delete group")
|
|
511
493
|
});
|
|
512
494
|
}
|
|
513
495
|
});
|
|
514
496
|
}
|
|
515
|
-
function
|
|
516
|
-
const { authToken: a, tokenProps: n } =
|
|
497
|
+
function vr() {
|
|
498
|
+
const { authToken: a, tokenProps: n } = $(), s = Ae();
|
|
517
499
|
return Me({
|
|
518
500
|
mutationFn: ({
|
|
519
|
-
groupId:
|
|
520
|
-
data:
|
|
521
|
-
}) =>
|
|
522
|
-
onSuccess: (
|
|
523
|
-
|
|
524
|
-
queryKey: ["group-members",
|
|
525
|
-
}),
|
|
501
|
+
groupId: t,
|
|
502
|
+
data: l
|
|
503
|
+
}) => hr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t, l),
|
|
504
|
+
onSuccess: (t, l) => {
|
|
505
|
+
s.invalidateQueries({ queryKey: ["group", l.groupId] }), s.invalidateQueries({
|
|
506
|
+
queryKey: ["group-members", l.groupId]
|
|
507
|
+
}), s.invalidateQueries({ queryKey: ["groups"] }), k.success("Members added successfully");
|
|
526
508
|
},
|
|
527
|
-
onError: (
|
|
528
|
-
console.error("Failed to add group members:",
|
|
529
|
-
description:
|
|
509
|
+
onError: (t) => {
|
|
510
|
+
console.error("Failed to add group members:", t), k.error("Failed to add members", {
|
|
511
|
+
description: Le(t, "Failed to add members")
|
|
530
512
|
});
|
|
531
513
|
}
|
|
532
514
|
});
|
|
533
515
|
}
|
|
534
|
-
function
|
|
535
|
-
const { authToken: a, tokenProps: n } =
|
|
516
|
+
function br() {
|
|
517
|
+
const { authToken: a, tokenProps: n } = $(), s = Ae();
|
|
536
518
|
return Me({
|
|
537
519
|
mutationFn: ({
|
|
538
|
-
groupId:
|
|
539
|
-
data:
|
|
540
|
-
}) =>
|
|
541
|
-
onSuccess: (
|
|
542
|
-
|
|
543
|
-
queryKey: ["group-members",
|
|
544
|
-
}),
|
|
520
|
+
groupId: t,
|
|
521
|
+
data: l
|
|
522
|
+
}) => pr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t, l),
|
|
523
|
+
onSuccess: (t, l) => {
|
|
524
|
+
s.invalidateQueries({ queryKey: ["group", l.groupId] }), s.invalidateQueries({
|
|
525
|
+
queryKey: ["group-members", l.groupId]
|
|
526
|
+
}), s.invalidateQueries({ queryKey: ["groups"] }), k.success("Members removed successfully");
|
|
545
527
|
},
|
|
546
|
-
onError: (
|
|
547
|
-
console.error("Failed to remove group members:",
|
|
548
|
-
description:
|
|
528
|
+
onError: (t) => {
|
|
529
|
+
console.error("Failed to remove group members:", t), k.error("Failed to remove members", {
|
|
530
|
+
description: Le(t, "Failed to remove members")
|
|
549
531
|
});
|
|
550
532
|
}
|
|
551
533
|
});
|
|
552
534
|
}
|
|
553
|
-
function
|
|
535
|
+
function yr({
|
|
554
536
|
onSuccess: a,
|
|
555
537
|
tenantId: n,
|
|
556
|
-
isTenantUser:
|
|
538
|
+
isTenantUser: s
|
|
557
539
|
}) {
|
|
558
|
-
const [
|
|
540
|
+
const [t, l] = N(""), [c, m] = N(""), [u, p] = N({}), y = fr(), h = () => {
|
|
559
541
|
const d = {};
|
|
560
|
-
return
|
|
542
|
+
return t.trim() ? t.length < 3 ? d.name = "Group name must be at least 3 characters" : t.length > 50 && (d.name = "Group name must be less than 50 characters") : d.name = "Group name is required", c && c.length > 200 && (d.description = "Description must be less than 200 characters"), p(d), Object.keys(d).length === 0;
|
|
561
543
|
};
|
|
562
544
|
return /* @__PURE__ */ o("form", { onSubmit: async (d) => {
|
|
563
545
|
if (d.preventDefault(), !h()) return;
|
|
564
546
|
const f = {
|
|
565
|
-
name:
|
|
547
|
+
name: t.trim(),
|
|
566
548
|
description: c.trim() || void 0,
|
|
567
|
-
type:
|
|
568
|
-
...
|
|
549
|
+
type: s ? "TENANT_GROUP" : "ORG_GROUP",
|
|
550
|
+
...s && n ? { tenantId: n } : {}
|
|
569
551
|
};
|
|
570
552
|
try {
|
|
571
|
-
await y.mutateAsync(f),
|
|
553
|
+
await y.mutateAsync(f), l(""), m(""), p({}), a();
|
|
572
554
|
} catch (v) {
|
|
573
555
|
console.error("Failed to create group:", v);
|
|
574
556
|
}
|
|
575
557
|
}, className: "space-y-6", children: [
|
|
576
558
|
/* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
577
559
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
578
|
-
/* @__PURE__ */ o(
|
|
560
|
+
/* @__PURE__ */ o(Qe, { htmlFor: "group-name", children: [
|
|
579
561
|
"Group Name ",
|
|
580
562
|
/* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
|
|
581
563
|
] }),
|
|
@@ -584,43 +566,43 @@ function gr({
|
|
|
584
566
|
{
|
|
585
567
|
id: "group-name",
|
|
586
568
|
placeholder: "e.g., Marketing Team, Engineering Squad",
|
|
587
|
-
value:
|
|
569
|
+
value: t,
|
|
588
570
|
onChange: (d) => {
|
|
589
|
-
|
|
571
|
+
l(d.target.value), u.name && p((f) => ({ ...f, name: "" }));
|
|
590
572
|
},
|
|
591
|
-
className:
|
|
573
|
+
className: u.name ? "border-destructive" : "",
|
|
592
574
|
disabled: y.isPending
|
|
593
575
|
}
|
|
594
576
|
),
|
|
595
|
-
|
|
577
|
+
u.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.name })
|
|
596
578
|
] }),
|
|
597
579
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
598
|
-
/* @__PURE__ */ o(
|
|
580
|
+
/* @__PURE__ */ o(Qe, { htmlFor: "group-description", children: [
|
|
599
581
|
"Description",
|
|
600
582
|
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
|
|
601
583
|
] }),
|
|
602
584
|
/* @__PURE__ */ e(
|
|
603
|
-
|
|
585
|
+
Zs,
|
|
604
586
|
{
|
|
605
587
|
id: "group-description",
|
|
606
588
|
placeholder: "Describe the purpose of this group...",
|
|
607
589
|
value: c,
|
|
608
590
|
onChange: (d) => {
|
|
609
|
-
|
|
591
|
+
m(d.target.value), u.description && p((f) => ({ ...f, description: "" }));
|
|
610
592
|
},
|
|
611
|
-
className:
|
|
593
|
+
className: u.description ? "border-destructive" : "",
|
|
612
594
|
disabled: y.isPending,
|
|
613
595
|
rows: 3
|
|
614
596
|
}
|
|
615
597
|
),
|
|
616
|
-
|
|
598
|
+
u.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.description }),
|
|
617
599
|
/* @__PURE__ */ o("p", { className: "text-xs text-muted-foreground", children: [
|
|
618
600
|
c.length,
|
|
619
601
|
"/200 characters"
|
|
620
602
|
] })
|
|
621
603
|
] }),
|
|
622
604
|
/* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ o("div", { className: "flex gap-3", children: [
|
|
623
|
-
/* @__PURE__ */ e(
|
|
605
|
+
/* @__PURE__ */ e(et, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
|
|
624
606
|
/* @__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." })
|
|
625
607
|
] }) })
|
|
626
608
|
] }),
|
|
@@ -631,7 +613,7 @@ function gr({
|
|
|
631
613
|
type: "button",
|
|
632
614
|
variant: "outline",
|
|
633
615
|
onClick: () => {
|
|
634
|
-
|
|
616
|
+
l(""), m(""), p({});
|
|
635
617
|
},
|
|
636
618
|
disabled: y.isPending,
|
|
637
619
|
children: "Clear"
|
|
@@ -641,12 +623,12 @@ function gr({
|
|
|
641
623
|
M,
|
|
642
624
|
{
|
|
643
625
|
type: "submit",
|
|
644
|
-
disabled: y.isPending || !
|
|
645
|
-
children: y.isPending ? /* @__PURE__ */ o(
|
|
646
|
-
/* @__PURE__ */ e(
|
|
626
|
+
disabled: y.isPending || !t.trim(),
|
|
627
|
+
children: y.isPending ? /* @__PURE__ */ o(I, { children: [
|
|
628
|
+
/* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
647
629
|
"Creating..."
|
|
648
|
-
] }) : /* @__PURE__ */ o(
|
|
649
|
-
/* @__PURE__ */ e(
|
|
630
|
+
] }) : /* @__PURE__ */ o(I, { children: [
|
|
631
|
+
/* @__PURE__ */ e(J, { className: "mr-2 h-4 w-4" }),
|
|
650
632
|
"Create Group"
|
|
651
633
|
] })
|
|
652
634
|
}
|
|
@@ -654,59 +636,59 @@ function gr({
|
|
|
654
636
|
] })
|
|
655
637
|
] });
|
|
656
638
|
}
|
|
657
|
-
function
|
|
658
|
-
let
|
|
659
|
-
function
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
const p =
|
|
663
|
-
|
|
664
|
-
const y = (
|
|
639
|
+
function Nr(a, n = []) {
|
|
640
|
+
let s = [];
|
|
641
|
+
function t(c, m) {
|
|
642
|
+
const u = A.createContext(m);
|
|
643
|
+
u.displayName = c + "Context";
|
|
644
|
+
const p = s.length;
|
|
645
|
+
s = [...s, m];
|
|
646
|
+
const y = (r) => {
|
|
665
647
|
var C;
|
|
666
|
-
const { scope: d, children: f, ...v } =
|
|
648
|
+
const { scope: d, children: f, ...v } = r, b = ((C = d == null ? void 0 : d[a]) == null ? void 0 : C[p]) || u, S = A.useMemo(() => v, Object.values(v));
|
|
667
649
|
return /* @__PURE__ */ e(b.Provider, { value: S, children: f });
|
|
668
650
|
};
|
|
669
651
|
y.displayName = c + "Provider";
|
|
670
|
-
function h(
|
|
652
|
+
function h(r, d) {
|
|
671
653
|
var b;
|
|
672
|
-
const f = ((b = d == null ? void 0 : d[a]) == null ? void 0 : b[p]) ||
|
|
654
|
+
const f = ((b = d == null ? void 0 : d[a]) == null ? void 0 : b[p]) || u, v = A.useContext(f);
|
|
673
655
|
if (v) return v;
|
|
674
|
-
if (
|
|
675
|
-
throw new Error(`\`${
|
|
656
|
+
if (m !== void 0) return m;
|
|
657
|
+
throw new Error(`\`${r}\` must be used within \`${c}\``);
|
|
676
658
|
}
|
|
677
659
|
return [y, h];
|
|
678
660
|
}
|
|
679
|
-
const
|
|
680
|
-
const c =
|
|
681
|
-
return function(
|
|
682
|
-
const p = (
|
|
661
|
+
const l = () => {
|
|
662
|
+
const c = s.map((m) => A.createContext(m));
|
|
663
|
+
return function(u) {
|
|
664
|
+
const p = (u == null ? void 0 : u[a]) || c;
|
|
683
665
|
return A.useMemo(
|
|
684
|
-
() => ({ [`__scope${a}`]: { ...
|
|
685
|
-
[
|
|
666
|
+
() => ({ [`__scope${a}`]: { ...u, [a]: p } }),
|
|
667
|
+
[u, p]
|
|
686
668
|
);
|
|
687
669
|
};
|
|
688
670
|
};
|
|
689
|
-
return
|
|
671
|
+
return l.scopeName = a, [t, Sr(l, ...n)];
|
|
690
672
|
}
|
|
691
|
-
function
|
|
673
|
+
function Sr(...a) {
|
|
692
674
|
const n = a[0];
|
|
693
675
|
if (a.length === 1) return n;
|
|
694
|
-
const
|
|
695
|
-
const
|
|
696
|
-
useScope:
|
|
697
|
-
scopeName:
|
|
676
|
+
const s = () => {
|
|
677
|
+
const t = a.map((l) => ({
|
|
678
|
+
useScope: l(),
|
|
679
|
+
scopeName: l.scopeName
|
|
698
680
|
}));
|
|
699
681
|
return function(c) {
|
|
700
|
-
const
|
|
701
|
-
const
|
|
702
|
-
return { ...
|
|
682
|
+
const m = t.reduce((u, { useScope: p, scopeName: y }) => {
|
|
683
|
+
const r = p(c)[`__scope${y}`];
|
|
684
|
+
return { ...u, ...r };
|
|
703
685
|
}, {});
|
|
704
|
-
return A.useMemo(() => ({ [`__scope${n.scopeName}`]:
|
|
686
|
+
return A.useMemo(() => ({ [`__scope${n.scopeName}`]: m }), [m]);
|
|
705
687
|
};
|
|
706
688
|
};
|
|
707
|
-
return
|
|
689
|
+
return s.scopeName = n.scopeName, s;
|
|
708
690
|
}
|
|
709
|
-
var
|
|
691
|
+
var xr = [
|
|
710
692
|
"a",
|
|
711
693
|
"button",
|
|
712
694
|
"div",
|
|
@@ -724,156 +706,156 @@ var yr = [
|
|
|
724
706
|
"span",
|
|
725
707
|
"svg",
|
|
726
708
|
"ul"
|
|
727
|
-
],
|
|
728
|
-
const
|
|
729
|
-
const { asChild:
|
|
730
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...
|
|
709
|
+
], pa = xr.reduce((a, n) => {
|
|
710
|
+
const s = at(`Primitive.${n}`), t = A.forwardRef((l, c) => {
|
|
711
|
+
const { asChild: m, ...u } = l, p = m ? s : n;
|
|
712
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...u, ref: c });
|
|
731
713
|
});
|
|
732
|
-
return
|
|
714
|
+
return t.displayName = `Primitive.${n}`, { ...a, [n]: t };
|
|
733
715
|
}, {});
|
|
734
|
-
function
|
|
735
|
-
return
|
|
736
|
-
|
|
716
|
+
function Dr() {
|
|
717
|
+
return rr.useSyncExternalStore(
|
|
718
|
+
wr,
|
|
737
719
|
() => !0,
|
|
738
720
|
() => !1
|
|
739
721
|
);
|
|
740
722
|
}
|
|
741
|
-
function
|
|
723
|
+
function wr() {
|
|
742
724
|
return () => {
|
|
743
725
|
};
|
|
744
726
|
}
|
|
745
|
-
var
|
|
727
|
+
var fa = "Avatar", [Cr] = Nr(fa), [Er, is] = Cr(fa), ls = A.forwardRef(
|
|
746
728
|
(a, n) => {
|
|
747
|
-
const { __scopeAvatar:
|
|
729
|
+
const { __scopeAvatar: s, ...t } = a, [l, c] = A.useState("idle");
|
|
748
730
|
return /* @__PURE__ */ e(
|
|
749
|
-
|
|
731
|
+
Er,
|
|
750
732
|
{
|
|
751
|
-
scope:
|
|
752
|
-
imageLoadingStatus:
|
|
733
|
+
scope: s,
|
|
734
|
+
imageLoadingStatus: l,
|
|
753
735
|
onImageLoadingStatusChange: c,
|
|
754
|
-
children: /* @__PURE__ */ e(
|
|
736
|
+
children: /* @__PURE__ */ e(pa.span, { ...t, ref: n })
|
|
755
737
|
}
|
|
756
738
|
);
|
|
757
739
|
}
|
|
758
740
|
);
|
|
759
|
-
|
|
760
|
-
var
|
|
741
|
+
ls.displayName = fa;
|
|
742
|
+
var cs = "AvatarImage", ds = A.forwardRef(
|
|
761
743
|
(a, n) => {
|
|
762
|
-
const { __scopeAvatar:
|
|
763
|
-
}, ...c } = a,
|
|
764
|
-
|
|
744
|
+
const { __scopeAvatar: s, src: t, onLoadingStatusChange: l = () => {
|
|
745
|
+
}, ...c } = a, m = is(cs, s), u = Ar(t, c), p = st((y) => {
|
|
746
|
+
l(y), m.onImageLoadingStatusChange(y);
|
|
765
747
|
});
|
|
766
|
-
return
|
|
767
|
-
|
|
768
|
-
}, [
|
|
748
|
+
return Je(() => {
|
|
749
|
+
u !== "idle" && p(u);
|
|
750
|
+
}, [u, p]), u === "loaded" ? /* @__PURE__ */ e(pa.img, { ...c, ref: n, src: t }) : null;
|
|
769
751
|
}
|
|
770
752
|
);
|
|
771
|
-
|
|
772
|
-
var
|
|
753
|
+
ds.displayName = cs;
|
|
754
|
+
var us = "AvatarFallback", ms = A.forwardRef(
|
|
773
755
|
(a, n) => {
|
|
774
|
-
const { __scopeAvatar:
|
|
756
|
+
const { __scopeAvatar: s, delayMs: t, ...l } = a, c = is(us, s), [m, u] = A.useState(t === void 0);
|
|
775
757
|
return A.useEffect(() => {
|
|
776
|
-
if (
|
|
777
|
-
const p = window.setTimeout(() =>
|
|
758
|
+
if (t !== void 0) {
|
|
759
|
+
const p = window.setTimeout(() => u(!0), t);
|
|
778
760
|
return () => window.clearTimeout(p);
|
|
779
761
|
}
|
|
780
|
-
}, [
|
|
762
|
+
}, [t]), m && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(pa.span, { ...l, ref: n }) : null;
|
|
781
763
|
}
|
|
782
764
|
);
|
|
783
|
-
|
|
784
|
-
function
|
|
765
|
+
ms.displayName = us;
|
|
766
|
+
function Va(a, n) {
|
|
785
767
|
return a ? n ? (a.src !== n && (a.src = n), a.complete && a.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
786
768
|
}
|
|
787
|
-
function
|
|
788
|
-
const
|
|
789
|
-
() =>
|
|
769
|
+
function Ar(a, { referrerPolicy: n, crossOrigin: s }) {
|
|
770
|
+
const t = Dr(), l = A.useRef(null), c = t ? (l.current || (l.current = new window.Image()), l.current) : null, [m, u] = A.useState(
|
|
771
|
+
() => Va(c, a)
|
|
790
772
|
);
|
|
791
|
-
return
|
|
792
|
-
|
|
793
|
-
}, [c, a]),
|
|
794
|
-
const p = (
|
|
795
|
-
|
|
773
|
+
return Je(() => {
|
|
774
|
+
u(Va(c, a));
|
|
775
|
+
}, [c, a]), Je(() => {
|
|
776
|
+
const p = (r) => () => {
|
|
777
|
+
u(r);
|
|
796
778
|
};
|
|
797
779
|
if (!c) return;
|
|
798
780
|
const y = p("loaded"), h = p("error");
|
|
799
|
-
return c.addEventListener("load", y), c.addEventListener("error", h), n && (c.referrerPolicy = n), typeof
|
|
781
|
+
return c.addEventListener("load", y), c.addEventListener("error", h), n && (c.referrerPolicy = n), typeof s == "string" && (c.crossOrigin = s), () => {
|
|
800
782
|
c.removeEventListener("load", y), c.removeEventListener("error", h);
|
|
801
783
|
};
|
|
802
|
-
}, [c,
|
|
784
|
+
}, [c, s, n]), m;
|
|
803
785
|
}
|
|
804
|
-
var
|
|
805
|
-
const
|
|
806
|
-
|
|
786
|
+
var hs = ls, ps = ds, fs = ms;
|
|
787
|
+
const ga = A.forwardRef(({ className: a, ...n }, s) => /* @__PURE__ */ e(
|
|
788
|
+
hs,
|
|
807
789
|
{
|
|
808
|
-
ref:
|
|
809
|
-
className:
|
|
790
|
+
ref: s,
|
|
791
|
+
className: Y(
|
|
810
792
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
811
793
|
a
|
|
812
794
|
),
|
|
813
795
|
...n
|
|
814
796
|
}
|
|
815
797
|
));
|
|
816
|
-
|
|
817
|
-
const
|
|
818
|
-
|
|
798
|
+
ga.displayName = hs.displayName;
|
|
799
|
+
const Mr = A.forwardRef(({ className: a, ...n }, s) => /* @__PURE__ */ e(
|
|
800
|
+
ps,
|
|
819
801
|
{
|
|
820
|
-
ref:
|
|
821
|
-
className:
|
|
802
|
+
ref: s,
|
|
803
|
+
className: Y("aspect-square h-full w-full", a),
|
|
822
804
|
...n
|
|
823
805
|
}
|
|
824
806
|
));
|
|
825
|
-
|
|
826
|
-
const
|
|
827
|
-
|
|
807
|
+
Mr.displayName = ps.displayName;
|
|
808
|
+
const va = A.forwardRef(({ className: a, ...n }, s) => /* @__PURE__ */ e(
|
|
809
|
+
fs,
|
|
828
810
|
{
|
|
829
|
-
ref:
|
|
830
|
-
className:
|
|
811
|
+
ref: s,
|
|
812
|
+
className: Y(
|
|
831
813
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
832
814
|
a
|
|
833
815
|
),
|
|
834
816
|
...n
|
|
835
817
|
}
|
|
836
818
|
));
|
|
837
|
-
|
|
838
|
-
function
|
|
819
|
+
va.displayName = fs.displayName;
|
|
820
|
+
function Lr({
|
|
839
821
|
open: a,
|
|
840
822
|
onOpenChange: n,
|
|
841
|
-
group:
|
|
842
|
-
onUpdate:
|
|
823
|
+
group: s,
|
|
824
|
+
onUpdate: t
|
|
843
825
|
}) {
|
|
844
|
-
const [
|
|
826
|
+
const [l, c] = N("members"), [m, u] = N(""), [p, y] = N([]), [h, r] = N([]), { data: d, isLoading: f, refetch: v } = tt(s.id), b = s.type === "TENANT_GROUP" ? "tenant" : "organization", { users: S, isLoading: C } = rt({
|
|
845
827
|
type: b,
|
|
846
|
-
tenantId:
|
|
828
|
+
tenantId: s.tenantId || void 0,
|
|
847
829
|
active: !0,
|
|
848
830
|
limit: 100
|
|
849
|
-
}), P =
|
|
850
|
-
if (!
|
|
851
|
-
const g =
|
|
852
|
-
return
|
|
831
|
+
}), P = vr(), U = br(), _ = (d == null ? void 0 : d.members) || [], V = W(() => new Set(_.map((g) => g.userId)), [_]), q = W(() => S.filter((g) => !V.has(g.id)), [S, V]), H = W(() => {
|
|
832
|
+
if (!m) return q;
|
|
833
|
+
const g = m.toLowerCase();
|
|
834
|
+
return q.filter(
|
|
853
835
|
(E) => {
|
|
854
|
-
var
|
|
855
|
-
return ((
|
|
836
|
+
var O, F;
|
|
837
|
+
return ((O = E.name) == null ? void 0 : O.toLowerCase().includes(g)) || ((F = E.email) == null ? void 0 : F.toLowerCase().includes(g));
|
|
856
838
|
}
|
|
857
839
|
);
|
|
858
|
-
}, [
|
|
859
|
-
if (!
|
|
860
|
-
const g =
|
|
840
|
+
}, [q, m]), D = W(() => {
|
|
841
|
+
if (!m) return _;
|
|
842
|
+
const g = m.toLowerCase();
|
|
861
843
|
return _.filter(
|
|
862
844
|
(E) => {
|
|
863
|
-
var
|
|
864
|
-
return ((
|
|
845
|
+
var O, F, z, ae;
|
|
846
|
+
return ((F = (O = E.user) == null ? void 0 : O.name) == null ? void 0 : F.toLowerCase().includes(g)) || ((ae = (z = E.user) == null ? void 0 : z.email) == null ? void 0 : ae.toLowerCase().includes(g));
|
|
865
847
|
}
|
|
866
848
|
);
|
|
867
|
-
}, [_,
|
|
849
|
+
}, [_, m]), j = async () => {
|
|
868
850
|
if (p.length !== 0)
|
|
869
851
|
try {
|
|
870
852
|
await P.mutateAsync({
|
|
871
|
-
groupId:
|
|
853
|
+
groupId: s.id,
|
|
872
854
|
data: {
|
|
873
855
|
userIds: p,
|
|
874
856
|
userType: b === "tenant" ? "tenant" : "org"
|
|
875
857
|
}
|
|
876
|
-
}), y([]), c("members"), v(),
|
|
858
|
+
}), y([]), c("members"), v(), t == null || t();
|
|
877
859
|
} catch (g) {
|
|
878
860
|
console.error("Failed to add members:", g);
|
|
879
861
|
}
|
|
@@ -881,26 +863,26 @@ function Er({
|
|
|
881
863
|
if (h.length !== 0)
|
|
882
864
|
try {
|
|
883
865
|
await U.mutateAsync({
|
|
884
|
-
groupId:
|
|
866
|
+
groupId: s.id,
|
|
885
867
|
data: {
|
|
886
868
|
userIds: h
|
|
887
869
|
}
|
|
888
|
-
}),
|
|
870
|
+
}), r([]), v(), t == null || t();
|
|
889
871
|
} catch (g) {
|
|
890
872
|
console.error("Failed to remove members:", g);
|
|
891
873
|
}
|
|
892
|
-
},
|
|
874
|
+
}, ee = (g) => {
|
|
893
875
|
y(
|
|
894
|
-
(E) => E.includes(g) ? E.filter((
|
|
876
|
+
(E) => E.includes(g) ? E.filter((O) => O !== g) : [...E, g]
|
|
895
877
|
);
|
|
896
|
-
},
|
|
897
|
-
|
|
898
|
-
(E) => E.includes(g) ? E.filter((
|
|
878
|
+
}, ke = (g) => {
|
|
879
|
+
r(
|
|
880
|
+
(E) => E.includes(g) ? E.filter((O) => O !== g) : [...E, g]
|
|
899
881
|
);
|
|
900
882
|
};
|
|
901
|
-
return /* @__PURE__ */ e(
|
|
902
|
-
/* @__PURE__ */ o(
|
|
903
|
-
/* @__PURE__ */ e(
|
|
883
|
+
return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(la, { open: a, onOpenChange: n, children: /* @__PURE__ */ o(da, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
884
|
+
/* @__PURE__ */ o(ua, { children: [
|
|
885
|
+
/* @__PURE__ */ e(ma, { children: s.name }),
|
|
904
886
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ o("p", { className: "text-sm text-muted-foreground", children: [
|
|
905
887
|
_.length,
|
|
906
888
|
" ",
|
|
@@ -908,40 +890,40 @@ function Er({
|
|
|
908
890
|
] }) }),
|
|
909
891
|
/* @__PURE__ */ o("p", { id: "group-members-description", className: "sr-only", children: [
|
|
910
892
|
"Add or remove members from the ",
|
|
911
|
-
|
|
893
|
+
s.name,
|
|
912
894
|
" group"
|
|
913
895
|
] })
|
|
914
896
|
] }),
|
|
915
|
-
/* @__PURE__ */ o(
|
|
916
|
-
c(g),
|
|
897
|
+
/* @__PURE__ */ o(Qa, { value: l, onValueChange: (g) => {
|
|
898
|
+
c(g), u(""), r([]);
|
|
917
899
|
}, className: "mt-4", children: [
|
|
918
|
-
/* @__PURE__ */ o(
|
|
900
|
+
/* @__PURE__ */ o(Wa, { className: "grid w-full grid-cols-2", children: [
|
|
919
901
|
/* @__PURE__ */ e(Ce, { value: "members", children: "Current Members" }),
|
|
920
902
|
/* @__PURE__ */ e(Ce, { value: "add", children: "Add Members" })
|
|
921
903
|
] }),
|
|
922
904
|
/* @__PURE__ */ o(Ee, { value: "members", className: "mt-4 space-y-4", children: [
|
|
923
905
|
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
924
|
-
/* @__PURE__ */ e(
|
|
906
|
+
/* @__PURE__ */ e(Xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
925
907
|
/* @__PURE__ */ e(
|
|
926
908
|
ce,
|
|
927
909
|
{
|
|
928
910
|
placeholder: "Search members...",
|
|
929
|
-
value:
|
|
930
|
-
onChange: (g) =>
|
|
911
|
+
value: m,
|
|
912
|
+
onChange: (g) => u(g.target.value),
|
|
931
913
|
className: "pl-10"
|
|
932
914
|
}
|
|
933
915
|
)
|
|
934
916
|
] }),
|
|
935
|
-
/* @__PURE__ */ e(
|
|
936
|
-
/* @__PURE__ */ e(
|
|
937
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children:
|
|
938
|
-
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children:
|
|
939
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children:
|
|
940
|
-
|
|
917
|
+
/* @__PURE__ */ e(Ye, { className: h.length > 0 ? "h-[300px]" : "h-[350px]", children: f ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ze, { className: "h-16 w-full" }, g)) }) : D.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
918
|
+
/* @__PURE__ */ e(J, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
919
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: m ? "No members found" : "No members yet" }),
|
|
920
|
+
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: m ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
|
|
921
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: D.map((g) => /* @__PURE__ */ e(
|
|
922
|
+
kr,
|
|
941
923
|
{
|
|
942
924
|
member: g,
|
|
943
925
|
selected: h.includes(g.userId),
|
|
944
|
-
onToggle: () =>
|
|
926
|
+
onToggle: () => ke(g.userId)
|
|
945
927
|
},
|
|
946
928
|
g.id
|
|
947
929
|
)) }) }),
|
|
@@ -959,11 +941,11 @@ function Er({
|
|
|
959
941
|
size: "sm",
|
|
960
942
|
onClick: ue,
|
|
961
943
|
disabled: U.isPending,
|
|
962
|
-
children: U.isPending ? /* @__PURE__ */ o(
|
|
963
|
-
/* @__PURE__ */ e(
|
|
944
|
+
children: U.isPending ? /* @__PURE__ */ o(I, { children: [
|
|
945
|
+
/* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
964
946
|
"Removing..."
|
|
965
|
-
] }) : /* @__PURE__ */ o(
|
|
966
|
-
/* @__PURE__ */ e(
|
|
947
|
+
] }) : /* @__PURE__ */ o(I, { children: [
|
|
948
|
+
/* @__PURE__ */ e(Ja, { className: "mr-2 h-4 w-4" }),
|
|
967
949
|
"Remove Selected"
|
|
968
950
|
] })
|
|
969
951
|
}
|
|
@@ -972,27 +954,27 @@ function Er({
|
|
|
972
954
|
] }),
|
|
973
955
|
/* @__PURE__ */ o(Ee, { value: "add", className: "mt-4 space-y-4", children: [
|
|
974
956
|
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
975
|
-
/* @__PURE__ */ e(
|
|
957
|
+
/* @__PURE__ */ e(Xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
976
958
|
/* @__PURE__ */ e(
|
|
977
959
|
ce,
|
|
978
960
|
{
|
|
979
961
|
placeholder: "Search users to add...",
|
|
980
|
-
value:
|
|
981
|
-
onChange: (g) =>
|
|
962
|
+
value: m,
|
|
963
|
+
onChange: (g) => u(g.target.value),
|
|
982
964
|
className: "pl-10"
|
|
983
965
|
}
|
|
984
966
|
)
|
|
985
967
|
] }),
|
|
986
|
-
/* @__PURE__ */ e(
|
|
987
|
-
/* @__PURE__ */ e(
|
|
968
|
+
/* @__PURE__ */ e(Ye, { className: "h-[300px]", children: C ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ze, { className: "h-16 w-full" }, g)) }) : H.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
969
|
+
/* @__PURE__ */ e(ea, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
988
970
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
989
|
-
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children:
|
|
990
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children:
|
|
991
|
-
|
|
971
|
+
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: m ? "Try a different search" : "All eligible users are already members" })
|
|
972
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: H.map((g) => /* @__PURE__ */ e(
|
|
973
|
+
Ir,
|
|
992
974
|
{
|
|
993
975
|
user: g,
|
|
994
976
|
selected: p.includes(g.id),
|
|
995
|
-
onToggle: () =>
|
|
977
|
+
onToggle: () => ee(g.id)
|
|
996
978
|
},
|
|
997
979
|
g.id
|
|
998
980
|
)) }) }),
|
|
@@ -1006,13 +988,13 @@ function Er({
|
|
|
1006
988
|
/* @__PURE__ */ e(
|
|
1007
989
|
M,
|
|
1008
990
|
{
|
|
1009
|
-
onClick:
|
|
991
|
+
onClick: j,
|
|
1010
992
|
disabled: P.isPending,
|
|
1011
|
-
children: P.isPending ? /* @__PURE__ */ o(
|
|
1012
|
-
/* @__PURE__ */ e(
|
|
993
|
+
children: P.isPending ? /* @__PURE__ */ o(I, { children: [
|
|
994
|
+
/* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1013
995
|
"Adding..."
|
|
1014
|
-
] }) : /* @__PURE__ */ o(
|
|
1015
|
-
/* @__PURE__ */ e(
|
|
996
|
+
] }) : /* @__PURE__ */ o(I, { children: [
|
|
997
|
+
/* @__PURE__ */ e(ea, { className: "mr-2 h-4 w-4" }),
|
|
1016
998
|
"Add Members"
|
|
1017
999
|
] })
|
|
1018
1000
|
}
|
|
@@ -1022,44 +1004,44 @@ function Er({
|
|
|
1022
1004
|
] })
|
|
1023
1005
|
] }) }) });
|
|
1024
1006
|
}
|
|
1025
|
-
function
|
|
1007
|
+
function kr({
|
|
1026
1008
|
member: a,
|
|
1027
1009
|
selected: n,
|
|
1028
|
-
onToggle:
|
|
1010
|
+
onToggle: s
|
|
1029
1011
|
}) {
|
|
1030
|
-
var
|
|
1031
|
-
const
|
|
1012
|
+
var l, c, m, u;
|
|
1013
|
+
const t = ((c = (l = a.user) == null ? void 0 : l.name) == null ? void 0 : c.split(" ").map((p) => p[0]).join("").toUpperCase()) || "?";
|
|
1032
1014
|
return /* @__PURE__ */ o(
|
|
1033
1015
|
"div",
|
|
1034
1016
|
{
|
|
1035
1017
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1036
|
-
onClick:
|
|
1018
|
+
onClick: s,
|
|
1037
1019
|
children: [
|
|
1038
|
-
/* @__PURE__ */ e(
|
|
1039
|
-
/* @__PURE__ */ e(
|
|
1020
|
+
/* @__PURE__ */ e(Xa, { checked: n }),
|
|
1021
|
+
/* @__PURE__ */ e(ga, { className: "h-8 w-8", children: /* @__PURE__ */ e(va, { className: "text-xs", children: t }) }),
|
|
1040
1022
|
/* @__PURE__ */ o("div", { className: "flex-1", children: [
|
|
1041
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((
|
|
1042
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (
|
|
1023
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((m = a.user) == null ? void 0 : m.name) || "Unknown User" }),
|
|
1024
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (u = a.user) == null ? void 0 : u.email })
|
|
1043
1025
|
] })
|
|
1044
1026
|
]
|
|
1045
1027
|
}
|
|
1046
1028
|
);
|
|
1047
1029
|
}
|
|
1048
|
-
function
|
|
1030
|
+
function Ir({
|
|
1049
1031
|
user: a,
|
|
1050
1032
|
selected: n,
|
|
1051
|
-
onToggle:
|
|
1033
|
+
onToggle: s
|
|
1052
1034
|
}) {
|
|
1053
|
-
var
|
|
1054
|
-
const
|
|
1035
|
+
var l;
|
|
1036
|
+
const t = ((l = a.name) == null ? void 0 : l.split(" ").map((c) => c[0]).join("").toUpperCase()) || "?";
|
|
1055
1037
|
return /* @__PURE__ */ o(
|
|
1056
1038
|
"div",
|
|
1057
1039
|
{
|
|
1058
1040
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1059
|
-
onClick:
|
|
1041
|
+
onClick: s,
|
|
1060
1042
|
children: [
|
|
1061
|
-
/* @__PURE__ */ e(
|
|
1062
|
-
/* @__PURE__ */ e(
|
|
1043
|
+
/* @__PURE__ */ e(Xa, { checked: n }),
|
|
1044
|
+
/* @__PURE__ */ e(ga, { className: "h-8 w-8", children: /* @__PURE__ */ e(va, { className: "text-xs", children: t }) }),
|
|
1063
1045
|
/* @__PURE__ */ o("div", { className: "flex-1", children: [
|
|
1064
1046
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: a.name }),
|
|
1065
1047
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: a.email })
|
|
@@ -1068,122 +1050,122 @@ function Mr({
|
|
|
1068
1050
|
}
|
|
1069
1051
|
);
|
|
1070
1052
|
}
|
|
1071
|
-
function
|
|
1053
|
+
function Or({
|
|
1072
1054
|
open: a,
|
|
1073
1055
|
onOpenChange: n
|
|
1074
1056
|
}) {
|
|
1075
|
-
const [
|
|
1057
|
+
const [s, t] = N("groups"), [l, c] = N(""), [m, u] = N(null), [p, y] = N(!1), [h, r] = N(null), { tokenProps: d } = $(), { currentUser: f } = ha(), v = gr(), b = (f == null ? void 0 : f.type) === "tenant", S = d == null ? void 0 : d.tenantId, { groups: C, isLoading: P, refetch: U } = nt({
|
|
1076
1058
|
type: b ? "TENANT_GROUP" : "all",
|
|
1077
1059
|
tenantId: b ? S : void 0,
|
|
1078
1060
|
includeMembers: !1
|
|
1079
1061
|
}), _ = C.filter(
|
|
1080
|
-
(
|
|
1081
|
-
var
|
|
1082
|
-
return
|
|
1062
|
+
(D) => {
|
|
1063
|
+
var j;
|
|
1064
|
+
return D.name.toLowerCase().includes(l.toLowerCase()) || ((j = D.description) == null ? void 0 : j.toLowerCase().includes(l.toLowerCase()));
|
|
1083
1065
|
}
|
|
1084
|
-
),
|
|
1066
|
+
), V = async () => {
|
|
1085
1067
|
if (h)
|
|
1086
1068
|
try {
|
|
1087
|
-
await v.mutateAsync(h.id),
|
|
1088
|
-
} catch (
|
|
1089
|
-
console.error("Failed to delete group:",
|
|
1069
|
+
await v.mutateAsync(h.id), r(null), U();
|
|
1070
|
+
} catch (D) {
|
|
1071
|
+
console.error("Failed to delete group:", D);
|
|
1090
1072
|
}
|
|
1091
|
-
},
|
|
1092
|
-
|
|
1093
|
-
},
|
|
1094
|
-
|
|
1073
|
+
}, q = (D) => {
|
|
1074
|
+
u(D), y(!0);
|
|
1075
|
+
}, H = () => {
|
|
1076
|
+
t("groups"), U();
|
|
1095
1077
|
};
|
|
1096
|
-
return /* @__PURE__ */ o(
|
|
1097
|
-
/* @__PURE__ */ e(
|
|
1098
|
-
/* @__PURE__ */ o(
|
|
1099
|
-
/* @__PURE__ */ o(
|
|
1100
|
-
/* @__PURE__ */ e(
|
|
1078
|
+
return /* @__PURE__ */ o(I, { children: [
|
|
1079
|
+
/* @__PURE__ */ e(la, { open: a, onOpenChange: n, children: /* @__PURE__ */ o(da, { className: "max-w-4xl max-h-[80vh]", children: [
|
|
1080
|
+
/* @__PURE__ */ o(ua, { children: [
|
|
1081
|
+
/* @__PURE__ */ o(ma, { className: "flex items-center gap-2", children: [
|
|
1082
|
+
/* @__PURE__ */ e(J, { className: "h-5 w-5" }),
|
|
1101
1083
|
"Group Management"
|
|
1102
1084
|
] }),
|
|
1103
|
-
/* @__PURE__ */ e(
|
|
1085
|
+
/* @__PURE__ */ e(Ha, { children: "Manage your groups, create new groups, and control group membership" })
|
|
1104
1086
|
] }),
|
|
1105
|
-
/* @__PURE__ */ o(
|
|
1106
|
-
/* @__PURE__ */ o(
|
|
1087
|
+
/* @__PURE__ */ o(Qa, { value: s, onValueChange: t, className: "mt-4", children: [
|
|
1088
|
+
/* @__PURE__ */ o(Wa, { className: "grid w-full grid-cols-2", children: [
|
|
1107
1089
|
/* @__PURE__ */ o(Ce, { value: "groups", className: "flex items-center gap-2", children: [
|
|
1108
|
-
/* @__PURE__ */ e(
|
|
1090
|
+
/* @__PURE__ */ e(J, { className: "h-4 w-4" }),
|
|
1109
1091
|
"Groups"
|
|
1110
1092
|
] }),
|
|
1111
1093
|
/* @__PURE__ */ o(Ce, { value: "create", className: "flex items-center gap-2", children: [
|
|
1112
|
-
/* @__PURE__ */ e(
|
|
1094
|
+
/* @__PURE__ */ e(ca, { className: "h-4 w-4" }),
|
|
1113
1095
|
"Create Group"
|
|
1114
1096
|
] })
|
|
1115
1097
|
] }),
|
|
1116
1098
|
/* @__PURE__ */ e(Ee, { value: "groups", className: "mt-4", children: /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
1117
1099
|
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
1118
|
-
/* @__PURE__ */ e(
|
|
1100
|
+
/* @__PURE__ */ e(Xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
1119
1101
|
/* @__PURE__ */ e(
|
|
1120
1102
|
ce,
|
|
1121
1103
|
{
|
|
1122
1104
|
placeholder: "Search groups...",
|
|
1123
|
-
value:
|
|
1124
|
-
onChange: (
|
|
1105
|
+
value: l,
|
|
1106
|
+
onChange: (D) => c(D.target.value),
|
|
1125
1107
|
className: "pl-10"
|
|
1126
1108
|
}
|
|
1127
1109
|
)
|
|
1128
1110
|
] }),
|
|
1129
|
-
/* @__PURE__ */ e(
|
|
1130
|
-
/* @__PURE__ */ e(
|
|
1111
|
+
/* @__PURE__ */ e(Ye, { className: "h-[400px]", children: P ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Ze, { className: "h-24 w-full" }, D)) }) : _.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
1112
|
+
/* @__PURE__ */ e(J, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
1131
1113
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
|
|
1132
|
-
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children:
|
|
1133
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: _.map((
|
|
1134
|
-
|
|
1114
|
+
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
|
|
1115
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: _.map((D) => /* @__PURE__ */ e(
|
|
1116
|
+
Tr,
|
|
1135
1117
|
{
|
|
1136
|
-
group:
|
|
1137
|
-
onManageMembers: () =>
|
|
1138
|
-
onDelete: () =>
|
|
1118
|
+
group: D,
|
|
1119
|
+
onManageMembers: () => q(D),
|
|
1120
|
+
onDelete: () => r(D),
|
|
1139
1121
|
currentUserId: f == null ? void 0 : f.id
|
|
1140
1122
|
},
|
|
1141
|
-
|
|
1123
|
+
D.id
|
|
1142
1124
|
)) }) })
|
|
1143
1125
|
] }) }),
|
|
1144
1126
|
/* @__PURE__ */ e(Ee, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1145
|
-
|
|
1127
|
+
yr,
|
|
1146
1128
|
{
|
|
1147
|
-
onSuccess:
|
|
1129
|
+
onSuccess: H,
|
|
1148
1130
|
tenantId: S,
|
|
1149
1131
|
isTenantUser: b
|
|
1150
1132
|
}
|
|
1151
1133
|
) })
|
|
1152
1134
|
] })
|
|
1153
1135
|
] }) }),
|
|
1154
|
-
|
|
1155
|
-
|
|
1136
|
+
m && /* @__PURE__ */ e(
|
|
1137
|
+
Lr,
|
|
1156
1138
|
{
|
|
1157
1139
|
open: p,
|
|
1158
1140
|
onOpenChange: y,
|
|
1159
|
-
group:
|
|
1141
|
+
group: m,
|
|
1160
1142
|
onUpdate: () => U()
|
|
1161
1143
|
}
|
|
1162
1144
|
),
|
|
1163
1145
|
/* @__PURE__ */ e(
|
|
1164
|
-
|
|
1146
|
+
Ya,
|
|
1165
1147
|
{
|
|
1166
1148
|
open: !!h,
|
|
1167
|
-
onOpenChange: () =>
|
|
1168
|
-
children: /* @__PURE__ */ o(
|
|
1169
|
-
/* @__PURE__ */ o(
|
|
1170
|
-
/* @__PURE__ */ e(
|
|
1171
|
-
/* @__PURE__ */ o(
|
|
1149
|
+
onOpenChange: () => r(null),
|
|
1150
|
+
children: /* @__PURE__ */ o(Za, { children: [
|
|
1151
|
+
/* @__PURE__ */ o(es, { children: [
|
|
1152
|
+
/* @__PURE__ */ e(as, { children: "Delete Group" }),
|
|
1153
|
+
/* @__PURE__ */ o(ss, { children: [
|
|
1172
1154
|
'Are you sure you want to delete "',
|
|
1173
1155
|
h == null ? void 0 : h.name,
|
|
1174
1156
|
'"? This action cannot be undone and will remove all members from the group.'
|
|
1175
1157
|
] })
|
|
1176
1158
|
] }),
|
|
1177
|
-
/* @__PURE__ */ o(
|
|
1178
|
-
/* @__PURE__ */ e(
|
|
1159
|
+
/* @__PURE__ */ o(ts, { children: [
|
|
1160
|
+
/* @__PURE__ */ e(rs, { children: "Cancel" }),
|
|
1179
1161
|
/* @__PURE__ */ e(
|
|
1180
|
-
|
|
1162
|
+
aa,
|
|
1181
1163
|
{
|
|
1182
|
-
onClick:
|
|
1164
|
+
onClick: V,
|
|
1183
1165
|
disabled: v.isPending,
|
|
1184
1166
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1185
|
-
children: v.isPending ? /* @__PURE__ */ o(
|
|
1186
|
-
/* @__PURE__ */ e(
|
|
1167
|
+
children: v.isPending ? /* @__PURE__ */ o(I, { children: [
|
|
1168
|
+
/* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1187
1169
|
"Deleting..."
|
|
1188
1170
|
] }) : "Delete Group"
|
|
1189
1171
|
}
|
|
@@ -1194,13 +1176,13 @@ function Lr({
|
|
|
1194
1176
|
)
|
|
1195
1177
|
] });
|
|
1196
1178
|
}
|
|
1197
|
-
function
|
|
1179
|
+
function Tr({
|
|
1198
1180
|
group: a,
|
|
1199
1181
|
onManageMembers: n,
|
|
1200
|
-
onDelete:
|
|
1201
|
-
currentUserId:
|
|
1182
|
+
onDelete: s,
|
|
1183
|
+
currentUserId: t
|
|
1202
1184
|
}) {
|
|
1203
|
-
const
|
|
1185
|
+
const l = a.createdBy === t;
|
|
1204
1186
|
return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */ o("div", { className: "flex items-start justify-between gap-3", children: [
|
|
1205
1187
|
/* @__PURE__ */ o("div", { className: "flex-1 space-y-2", children: [
|
|
1206
1188
|
/* @__PURE__ */ o("div", { children: [
|
|
@@ -1209,14 +1191,14 @@ function kr({
|
|
|
1209
1191
|
] }),
|
|
1210
1192
|
/* @__PURE__ */ o("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
|
|
1211
1193
|
/* @__PURE__ */ o("span", { className: "flex items-center gap-1", children: [
|
|
1212
|
-
/* @__PURE__ */ e(
|
|
1194
|
+
/* @__PURE__ */ e(J, { className: "h-3 w-3" }),
|
|
1213
1195
|
a.memberCount,
|
|
1214
1196
|
" ",
|
|
1215
1197
|
a.memberCount === 1 ? "member" : "members"
|
|
1216
1198
|
] }),
|
|
1217
1199
|
/* @__PURE__ */ o("span", { children: [
|
|
1218
1200
|
"Created ",
|
|
1219
|
-
|
|
1201
|
+
Kt(new Date(a.createdAt), "MMM d, yyyy")
|
|
1220
1202
|
] })
|
|
1221
1203
|
] })
|
|
1222
1204
|
] }),
|
|
@@ -1228,304 +1210,312 @@ function kr({
|
|
|
1228
1210
|
size: "sm",
|
|
1229
1211
|
onClick: n,
|
|
1230
1212
|
title: "Manage members",
|
|
1231
|
-
children: /* @__PURE__ */ e(
|
|
1213
|
+
children: /* @__PURE__ */ e(ea, { className: "h-4 w-4" })
|
|
1232
1214
|
}
|
|
1233
1215
|
),
|
|
1234
|
-
|
|
1216
|
+
l && /* @__PURE__ */ e(
|
|
1235
1217
|
M,
|
|
1236
1218
|
{
|
|
1237
1219
|
variant: "ghost",
|
|
1238
1220
|
size: "sm",
|
|
1239
|
-
onClick:
|
|
1221
|
+
onClick: s,
|
|
1240
1222
|
title: "Delete group",
|
|
1241
1223
|
className: "text-destructive hover:text-destructive",
|
|
1242
|
-
children: /* @__PURE__ */ e(
|
|
1224
|
+
children: /* @__PURE__ */ e(Ja, { className: "h-4 w-4" })
|
|
1243
1225
|
}
|
|
1244
1226
|
)
|
|
1245
1227
|
] })
|
|
1246
1228
|
] }) });
|
|
1247
1229
|
}
|
|
1248
|
-
function ie(a, n,
|
|
1249
|
-
var c,
|
|
1250
|
-
const
|
|
1251
|
-
(
|
|
1230
|
+
function ie(a, n, s) {
|
|
1231
|
+
var c, m;
|
|
1232
|
+
const t = (a.controls || []).find(
|
|
1233
|
+
(u) => u.id === s
|
|
1252
1234
|
);
|
|
1253
|
-
if (
|
|
1254
|
-
return
|
|
1255
|
-
const
|
|
1256
|
-
(
|
|
1235
|
+
if (t)
|
|
1236
|
+
return t.label;
|
|
1237
|
+
const l = (m = (c = ns(a, n)) == null ? void 0 : c.controls) == null ? void 0 : m.find(
|
|
1238
|
+
(u) => u.id === s
|
|
1257
1239
|
);
|
|
1258
|
-
return (
|
|
1240
|
+
return (l == null ? void 0 : l.label) || s;
|
|
1259
1241
|
}
|
|
1260
1242
|
function le(a, n) {
|
|
1261
|
-
var
|
|
1262
|
-
return ((
|
|
1243
|
+
var s;
|
|
1244
|
+
return ((s = ns(a, n)) == null ? void 0 : s.title) || n;
|
|
1263
1245
|
}
|
|
1264
|
-
function
|
|
1265
|
-
const { errors: n, dashboard:
|
|
1266
|
-
if (!
|
|
1246
|
+
function _r(a) {
|
|
1247
|
+
const { errors: n, dashboard: s } = a;
|
|
1248
|
+
if (!s)
|
|
1267
1249
|
return n;
|
|
1268
|
-
const
|
|
1269
|
-
for (const
|
|
1270
|
-
const c =
|
|
1250
|
+
const t = /* @__PURE__ */ new Map();
|
|
1251
|
+
for (const l of n) {
|
|
1252
|
+
const c = l.match(
|
|
1271
1253
|
/^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
|
|
1272
1254
|
);
|
|
1273
1255
|
if (c) {
|
|
1274
|
-
const [, h,
|
|
1275
|
-
|
|
1256
|
+
const [, h, r] = c, d = `${h}:${r}:missing-metric`;
|
|
1257
|
+
t.has(d) || t.set(
|
|
1276
1258
|
d,
|
|
1277
|
-
`"${le(
|
|
1278
|
-
|
|
1259
|
+
`"${le(s, h)}" has an outdated "${ie(
|
|
1260
|
+
s,
|
|
1279
1261
|
h,
|
|
1280
|
-
|
|
1262
|
+
r
|
|
1281
1263
|
)}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1282
1264
|
);
|
|
1283
1265
|
continue;
|
|
1284
1266
|
}
|
|
1285
|
-
const
|
|
1267
|
+
const m = l.match(
|
|
1286
1268
|
/^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
|
|
1287
1269
|
);
|
|
1288
|
-
if (
|
|
1289
|
-
const [, h,
|
|
1290
|
-
|
|
1270
|
+
if (m) {
|
|
1271
|
+
const [, h, r] = m, d = `${h}:${r}:missing-group-by`;
|
|
1272
|
+
t.has(d) || t.set(
|
|
1291
1273
|
d,
|
|
1292
|
-
`"${le(
|
|
1293
|
-
|
|
1274
|
+
`"${le(s, h)}" has an outdated "${ie(
|
|
1275
|
+
s,
|
|
1294
1276
|
h,
|
|
1295
|
-
|
|
1277
|
+
r
|
|
1296
1278
|
)}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1297
1279
|
);
|
|
1298
1280
|
continue;
|
|
1299
1281
|
}
|
|
1300
|
-
const
|
|
1282
|
+
const u = l.match(
|
|
1301
1283
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
|
|
1302
1284
|
);
|
|
1303
|
-
if (
|
|
1304
|
-
const [, h,
|
|
1305
|
-
|
|
1285
|
+
if (u) {
|
|
1286
|
+
const [, h, r] = u, d = `${h}:${r}:invalid-metric`;
|
|
1287
|
+
t.has(d) || t.set(
|
|
1306
1288
|
d,
|
|
1307
|
-
`"${le(
|
|
1308
|
-
|
|
1289
|
+
`"${le(s, h)}" has an invalid "${ie(
|
|
1290
|
+
s,
|
|
1309
1291
|
h,
|
|
1310
|
-
|
|
1292
|
+
r
|
|
1311
1293
|
)}" metric mapping. Open the card controls and choose a valid metric for each option.`
|
|
1312
1294
|
);
|
|
1313
1295
|
continue;
|
|
1314
1296
|
}
|
|
1315
|
-
const p =
|
|
1297
|
+
const p = l.match(
|
|
1316
1298
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
|
|
1317
1299
|
);
|
|
1318
1300
|
if (p) {
|
|
1319
|
-
const [, h,
|
|
1320
|
-
|
|
1301
|
+
const [, h, r] = p, d = `${h}:${r}:invalid-group-by`;
|
|
1302
|
+
t.has(d) || t.set(
|
|
1321
1303
|
d,
|
|
1322
|
-
`"${le(
|
|
1323
|
-
|
|
1304
|
+
`"${le(s, h)}" has an invalid "${ie(
|
|
1305
|
+
s,
|
|
1324
1306
|
h,
|
|
1325
|
-
|
|
1307
|
+
r
|
|
1326
1308
|
)}" field mapping. Open the card controls and choose a valid field for each option.`
|
|
1327
1309
|
);
|
|
1328
1310
|
continue;
|
|
1329
1311
|
}
|
|
1330
|
-
const y =
|
|
1312
|
+
const y = l.match(
|
|
1331
1313
|
/^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
|
|
1332
1314
|
);
|
|
1333
1315
|
if (y) {
|
|
1334
|
-
const [, h,
|
|
1335
|
-
|
|
1316
|
+
const [, h, r] = y, d = `${h}:${r}:missing-temporal-group-by`;
|
|
1317
|
+
t.has(d) || t.set(
|
|
1336
1318
|
d,
|
|
1337
|
-
`"${le(
|
|
1338
|
-
|
|
1319
|
+
`"${le(s, h)}" can no longer use "${ie(
|
|
1320
|
+
s,
|
|
1339
1321
|
h,
|
|
1340
|
-
|
|
1322
|
+
r
|
|
1341
1323
|
)}" for time grain because the card does not currently group by a date field.`
|
|
1342
1324
|
);
|
|
1343
1325
|
continue;
|
|
1344
1326
|
}
|
|
1345
|
-
|
|
1327
|
+
t.set(l, l);
|
|
1346
1328
|
}
|
|
1347
|
-
return Array.from(
|
|
1329
|
+
return Array.from(t.values());
|
|
1348
1330
|
}
|
|
1349
|
-
function
|
|
1350
|
-
var
|
|
1351
|
-
|
|
1331
|
+
function zr() {
|
|
1332
|
+
var ka, Ia, Oa, Ta;
|
|
1333
|
+
Gt(), Ft();
|
|
1352
1334
|
const {
|
|
1353
1335
|
authToken: a,
|
|
1354
1336
|
tokenProps: n,
|
|
1355
|
-
id:
|
|
1356
|
-
} =
|
|
1357
|
-
x((
|
|
1358
|
-
const
|
|
1359
|
-
(
|
|
1360
|
-
), p = x((
|
|
1361
|
-
x((
|
|
1337
|
+
id: s
|
|
1338
|
+
} = $(), { isLocalDev: t } = ot(), { permissions: l } = dr(), c = it(), { isLoading: m } = lt();
|
|
1339
|
+
x((i) => i.theme);
|
|
1340
|
+
const u = x(
|
|
1341
|
+
(i) => i.dashboardAssistantDraftScopeKey
|
|
1342
|
+
), p = x((i) => i.lenses), y = x((i) => i.selectedLensId), h = p == null ? void 0 : p.find((i) => i.id === y), r = x((i) => i.dashboard);
|
|
1343
|
+
x((i) => i.selectedSheetId);
|
|
1362
1344
|
const d = x(
|
|
1363
|
-
(
|
|
1364
|
-
), { setDashboardTitle: f } = x((
|
|
1365
|
-
(
|
|
1366
|
-
),
|
|
1367
|
-
|
|
1368
|
-
const
|
|
1369
|
-
(
|
|
1370
|
-
), he =
|
|
1371
|
-
(
|
|
1345
|
+
(i) => i.isDashboardEditing
|
|
1346
|
+
), { setDashboardTitle: f } = x((i) => i.actions), [v, b] = N(!1), [S, C] = N(!1), [P, U] = N(!1), [_, V] = N(!1), [q, H] = N(!1), [D, j] = N(!1), [ue, ee] = N(null), [ke, g] = N(!1), [E, O] = N(null), [F, z] = N([]), [ae, me] = N(!1), gs = x((i) => i.isDashboardPanelOpen), vs = x(
|
|
1347
|
+
(i) => i.actions.setIsDashboardPanelOpen
|
|
1348
|
+
), bs = x((i) => i.filterValues), w = x((i) => i.isVisualEditing);
|
|
1349
|
+
Ua((i) => i.card);
|
|
1350
|
+
const se = De(
|
|
1351
|
+
(i) => i.selectedDashboard
|
|
1352
|
+
), he = De(
|
|
1353
|
+
(i) => i.initialDashboard
|
|
1372
1354
|
);
|
|
1373
|
-
|
|
1374
|
-
const pe =
|
|
1375
|
-
(
|
|
1376
|
-
),
|
|
1377
|
-
(
|
|
1378
|
-
), { setIsDashboardEditing:
|
|
1379
|
-
(
|
|
1380
|
-
), { setInitialDashboard:
|
|
1381
|
-
(
|
|
1382
|
-
), { resources: ge } =
|
|
1383
|
-
id:
|
|
1384
|
-
title: (
|
|
1385
|
-
} : null, { handleAddNewFrame:
|
|
1355
|
+
De((i) => i.selectedVisual), x((i) => i.selectedFrameId), Ua((i) => i.frame);
|
|
1356
|
+
const pe = se ? (Ia = se == null ? void 0 : se.permissions) == null ? void 0 : Ia.canEdit : (ka = he == null ? void 0 : he.permissions) == null ? void 0 : ka.canEdit, fe = x((i) => i.showFilters), ba = ct((i) => i.setPanelOpen), ys = x(
|
|
1357
|
+
(i) => i.showDashboardJSON
|
|
1358
|
+
), Ie = x((i) => i.onSaveFunction), ya = x(
|
|
1359
|
+
(i) => i.actions.setShowFilters
|
|
1360
|
+
), { setIsDashboardEditing: Na, setShowDashboardJSON: Sa } = x(
|
|
1361
|
+
(i) => i.actions
|
|
1362
|
+
), { setInitialDashboard: xa, clearSelectedDashboard: Oe } = De(
|
|
1363
|
+
(i) => i.actions
|
|
1364
|
+
), { resources: ge } = dt(je.DASHBOARD), { data: Te } = ut(), Ns = ((Oa = Te == null ? void 0 : Te.preference) == null ? void 0 : Oa.defaultDashboardId) || null, { mutate: Ss, isPending: xs } = mt(), { currentUser: Ds } = ha(), ws = ht(Ds), X = se || he, Da = X ? {
|
|
1365
|
+
id: X.id,
|
|
1366
|
+
title: (r == null ? void 0 : r.title) || X.title || "Dashboard"
|
|
1367
|
+
} : null, { handleAddNewFrame: Cs } = pt(), [_e, Pe] = N(!1), [Es, te] = N(!1), [Ue, ve] = N("close"), re = ft(je.DASHBOARD), [R, Re] = N(
|
|
1386
1368
|
null
|
|
1387
|
-
), wa =
|
|
1388
|
-
(
|
|
1369
|
+
), wa = Ra(
|
|
1370
|
+
(i) => {
|
|
1389
1371
|
window.setTimeout(() => {
|
|
1390
|
-
|
|
1372
|
+
ee(i);
|
|
1391
1373
|
}, 0);
|
|
1392
1374
|
},
|
|
1393
1375
|
[]
|
|
1394
|
-
),
|
|
1395
|
-
if (!(
|
|
1376
|
+
), As = async (i, L) => {
|
|
1377
|
+
if (!(r != null && r.id)) {
|
|
1396
1378
|
console.log("No dashboard ID found");
|
|
1397
1379
|
return;
|
|
1398
1380
|
}
|
|
1399
1381
|
console.log("Updating dashboard title:", {
|
|
1400
|
-
dashboardId:
|
|
1401
|
-
newTitle:
|
|
1402
|
-
previousTitle:
|
|
1403
|
-
}),
|
|
1382
|
+
dashboardId: r.id,
|
|
1383
|
+
newTitle: i,
|
|
1384
|
+
previousTitle: L
|
|
1385
|
+
}), re.mutate(
|
|
1404
1386
|
{
|
|
1405
|
-
resourceId:
|
|
1406
|
-
data: { title:
|
|
1387
|
+
resourceId: r.id,
|
|
1388
|
+
data: { title: i }
|
|
1407
1389
|
},
|
|
1408
1390
|
{
|
|
1409
1391
|
onSuccess: () => {
|
|
1410
|
-
console.log("Dashboard title updated successfully"),
|
|
1392
|
+
console.log("Dashboard title updated successfully"), k.success("Dashboard title updated");
|
|
1411
1393
|
},
|
|
1412
|
-
onError: (
|
|
1413
|
-
console.error("Failed to update dashboard title:",
|
|
1394
|
+
onError: (G) => {
|
|
1395
|
+
console.error("Failed to update dashboard title:", G), k.error("Failed to update dashboard title"), f(L);
|
|
1414
1396
|
}
|
|
1415
1397
|
}
|
|
1416
1398
|
);
|
|
1417
1399
|
};
|
|
1418
|
-
|
|
1400
|
+
Rt(() => {
|
|
1419
1401
|
if (ge && ge.length > 0) {
|
|
1420
|
-
const
|
|
1421
|
-
if (
|
|
1422
|
-
const
|
|
1423
|
-
(
|
|
1402
|
+
const i = r == null ? void 0 : r.id;
|
|
1403
|
+
if (i) {
|
|
1404
|
+
const L = ge.find(
|
|
1405
|
+
(G) => G.id === i
|
|
1424
1406
|
);
|
|
1425
|
-
|
|
1407
|
+
L && xa(L);
|
|
1426
1408
|
}
|
|
1427
1409
|
}
|
|
1428
|
-
}, [ge,
|
|
1429
|
-
const be = n.orgUserId || n.tenantId,
|
|
1430
|
-
|
|
1431
|
-
},
|
|
1432
|
-
|
|
1410
|
+
}, [ge, r == null ? void 0 : r.id, xa]);
|
|
1411
|
+
const be = n.orgUserId || n.tenantId, Ca = d && !w && be && pe, { setDashboard: Ge } = x((i) => i.actions), Ms = () => {
|
|
1412
|
+
Na(!0);
|
|
1413
|
+
}, Fe = () => {
|
|
1414
|
+
Na(!1), Sa(!1), Re(null), ee(null);
|
|
1433
1415
|
};
|
|
1434
|
-
|
|
1416
|
+
$t(
|
|
1435
1417
|
d,
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
(
|
|
1418
|
+
r,
|
|
1419
|
+
R,
|
|
1420
|
+
(i) => Re(i)
|
|
1439
1421
|
);
|
|
1440
|
-
const { isDirty:
|
|
1441
|
-
|
|
1442
|
-
|
|
1422
|
+
const { isDirty: Ea, isDirtyPending: Ls, resetDirty: ye } = Jt(
|
|
1423
|
+
r,
|
|
1424
|
+
R,
|
|
1443
1425
|
300,
|
|
1444
1426
|
1e3,
|
|
1445
|
-
|
|
1446
|
-
),
|
|
1447
|
-
|
|
1448
|
-
},
|
|
1449
|
-
await
|
|
1427
|
+
ze
|
|
1428
|
+
), Aa = Ra(() => R ? ze(r) !== ze(R) : !1, [r, R]), $e = Ea || Ls, ne = _e || re.isPending, ks = () => {
|
|
1429
|
+
Aa() ? (ve("close"), te(!0)) : (Fe(), ye());
|
|
1430
|
+
}, Is = async () => {
|
|
1431
|
+
await Ve({
|
|
1450
1432
|
closeAfterSave: !0,
|
|
1451
|
-
navigateHomeAfterSave:
|
|
1433
|
+
navigateHomeAfterSave: Ue === "home"
|
|
1452
1434
|
});
|
|
1453
|
-
}, ks = () => {
|
|
1454
|
-
G && Ge(G), Re(), Pe === "home" && Ie(), ve("close"), se(!1), ye();
|
|
1455
|
-
}, Is = () => {
|
|
1456
|
-
G && (Ge(G), ye());
|
|
1457
1435
|
}, Os = () => {
|
|
1458
|
-
|
|
1459
|
-
|
|
1436
|
+
R && Ge(R), Fe(), Ue === "home" && Oe(), ve("close"), te(!1), ye();
|
|
1437
|
+
}, Ts = () => {
|
|
1438
|
+
R && (Ge(R), ye());
|
|
1439
|
+
}, _s = () => {
|
|
1440
|
+
if (d && Aa()) {
|
|
1441
|
+
ve("home"), te(!0);
|
|
1460
1442
|
return;
|
|
1461
1443
|
}
|
|
1462
|
-
|
|
1444
|
+
Oe();
|
|
1463
1445
|
};
|
|
1464
|
-
async function
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1446
|
+
async function Ve(i) {
|
|
1447
|
+
const L = x.getState().dashboard;
|
|
1448
|
+
if (!L)
|
|
1449
|
+
return;
|
|
1450
|
+
const G = (i == null ? void 0 : i.closeAfterSave) ?? ae, Fs = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
|
|
1451
|
+
me(G), G && te(!1);
|
|
1452
|
+
const $s = Pt(L);
|
|
1453
|
+
g(!0), O(null), z([]), Pe(!0);
|
|
1454
|
+
const Vs = {
|
|
1455
|
+
template: L
|
|
1471
1456
|
};
|
|
1472
|
-
|
|
1457
|
+
re.mutate(
|
|
1473
1458
|
{
|
|
1474
|
-
resourceId:
|
|
1475
|
-
data:
|
|
1459
|
+
resourceId: L.id,
|
|
1460
|
+
data: Vs
|
|
1476
1461
|
},
|
|
1477
1462
|
{
|
|
1478
|
-
onSuccess: (
|
|
1479
|
-
var Ne, Se,
|
|
1480
|
-
const
|
|
1481
|
-
if (!
|
|
1482
|
-
const
|
|
1483
|
-
(xe == null ? void 0 : xe.scopeKey) ===
|
|
1484
|
-
|
|
1485
|
-
) : xe &&
|
|
1463
|
+
onSuccess: (T) => {
|
|
1464
|
+
var Ne, Se, _a;
|
|
1465
|
+
const B = (T == null ? void 0 : T.id) || ((Ne = T == null ? void 0 : T.dashboard) == null ? void 0 : Ne.id) || ((Se = T == null ? void 0 : T.resource) == null ? void 0 : Se.id) || ((_a = T == null ? void 0 : T.template) == null ? void 0 : _a.id) || null;
|
|
1466
|
+
if (!L.id && B) {
|
|
1467
|
+
const He = Ut.getState(), xe = He.pendingDashboardDraftMigration;
|
|
1468
|
+
(xe == null ? void 0 : xe.scopeKey) === u ? He.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
|
|
1469
|
+
B
|
|
1470
|
+
) : xe && He.actions.clearPendingDashboardDraftMigration();
|
|
1486
1471
|
}
|
|
1487
|
-
|
|
1472
|
+
Pe(!1), k.success("Dashboard saved!"), Re($s), g(!1), me(!1), G && (Fe(), ye(), Fs && Oe()), ve("close");
|
|
1488
1473
|
},
|
|
1489
|
-
onError: (
|
|
1490
|
-
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1493
|
-
) ? (
|
|
1474
|
+
onError: (T) => {
|
|
1475
|
+
Pe(!1), O("Failed to save dashboard. Please try again.");
|
|
1476
|
+
const B = T.details, Ne = Array.isArray(
|
|
1477
|
+
B == null ? void 0 : B.errors
|
|
1478
|
+
) ? (B.errors || []).filter(
|
|
1494
1479
|
(Se) => typeof Se == "string"
|
|
1495
1480
|
) : [];
|
|
1496
|
-
|
|
1497
|
-
|
|
1481
|
+
z(
|
|
1482
|
+
_r({
|
|
1498
1483
|
errors: Ne,
|
|
1499
|
-
dashboard:
|
|
1484
|
+
dashboard: L || void 0
|
|
1500
1485
|
})
|
|
1501
|
-
),
|
|
1486
|
+
), k.error("Failed to save dashboard");
|
|
1502
1487
|
}
|
|
1503
1488
|
}
|
|
1504
1489
|
);
|
|
1505
1490
|
}
|
|
1506
|
-
async function
|
|
1491
|
+
async function Ps() {
|
|
1507
1492
|
if (b(!0), !y || !h) return;
|
|
1508
|
-
const
|
|
1493
|
+
const i = x.getState().dashboard;
|
|
1494
|
+
if (!i) {
|
|
1495
|
+
b(!1);
|
|
1496
|
+
return;
|
|
1497
|
+
}
|
|
1498
|
+
const L = JSON.stringify(i), G = {
|
|
1509
1499
|
...h,
|
|
1510
|
-
template:
|
|
1511
|
-
filterValues:
|
|
1500
|
+
template: L,
|
|
1501
|
+
filterValues: bs
|
|
1512
1502
|
};
|
|
1513
|
-
await
|
|
1503
|
+
await ta(
|
|
1514
1504
|
n.apiServiceUrl,
|
|
1515
|
-
|
|
1505
|
+
G,
|
|
1516
1506
|
a == null ? void 0 : a.accessToken
|
|
1517
|
-
),
|
|
1507
|
+
), k.success("Lens saved"), Ie == null || Ie(i), b(!1);
|
|
1518
1508
|
}
|
|
1519
|
-
const
|
|
1520
|
-
|
|
1521
|
-
title:
|
|
1522
|
-
dashboardStateTitle:
|
|
1523
|
-
dashboardId:
|
|
1509
|
+
const Ma = (h == null ? void 0 : h.name) || r.title;
|
|
1510
|
+
re.isPending && console.log("Title during update:", {
|
|
1511
|
+
title: Ma,
|
|
1512
|
+
dashboardStateTitle: r.title,
|
|
1513
|
+
dashboardId: r == null ? void 0 : r.id,
|
|
1524
1514
|
currentLensName: h == null ? void 0 : h.name
|
|
1525
1515
|
});
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1528
|
-
dashboardId:
|
|
1516
|
+
const La = n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail, Us = !!La && !!(a != null && a.accessToken) && !!(n != null && n.apiServiceUrl), Rs = c, oe = (r == null ? void 0 : r.id) || null, qe = !!oe && Ns === oe, Gs = () => {
|
|
1517
|
+
oe && Ss({
|
|
1518
|
+
dashboardId: qe ? null : oe
|
|
1529
1519
|
});
|
|
1530
1520
|
};
|
|
1531
1521
|
return /* @__PURE__ */ o(
|
|
@@ -1535,31 +1525,31 @@ function qr() {
|
|
|
1535
1525
|
role: "dashboard-controls",
|
|
1536
1526
|
children: [
|
|
1537
1527
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
1538
|
-
|
|
1528
|
+
La && /* @__PURE__ */ o(I, { children: [
|
|
1539
1529
|
/* @__PURE__ */ e(
|
|
1540
|
-
|
|
1530
|
+
K,
|
|
1541
1531
|
{
|
|
1542
1532
|
"aria-label": "Manage Dashboards",
|
|
1543
1533
|
tooltip: "Manage Dashboards",
|
|
1544
1534
|
onClick: () => {
|
|
1545
|
-
|
|
1535
|
+
vs(!gs);
|
|
1546
1536
|
},
|
|
1547
1537
|
className: "h-7 p-2",
|
|
1548
|
-
children: /* @__PURE__ */ e(
|
|
1538
|
+
children: /* @__PURE__ */ e(Yt, { className: "h-4 w-4" })
|
|
1549
1539
|
}
|
|
1550
1540
|
),
|
|
1551
|
-
|
|
1552
|
-
|
|
1541
|
+
Rs && !w && /* @__PURE__ */ e(
|
|
1542
|
+
K,
|
|
1553
1543
|
{
|
|
1554
1544
|
"aria-label": "Dashboard Hub",
|
|
1555
1545
|
tooltip: "Dashboard Hub",
|
|
1556
|
-
onClick:
|
|
1546
|
+
onClick: _s,
|
|
1557
1547
|
className: "h-7 p-2",
|
|
1558
|
-
children: /* @__PURE__ */ e(
|
|
1548
|
+
children: /* @__PURE__ */ e(ja, { className: "h-4 w-4" })
|
|
1559
1549
|
}
|
|
1560
1550
|
)
|
|
1561
1551
|
] }),
|
|
1562
|
-
!
|
|
1552
|
+
!w && c && (m ? /* @__PURE__ */ e(
|
|
1563
1553
|
"div",
|
|
1564
1554
|
{
|
|
1565
1555
|
className: "h-4 w-28 rounded-md bg-muted/70 animate-pulse",
|
|
@@ -1567,99 +1557,99 @@ function qr() {
|
|
|
1567
1557
|
role: "status",
|
|
1568
1558
|
children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Loading dashboard title" })
|
|
1569
1559
|
}
|
|
1570
|
-
) : /* @__PURE__ */ o(
|
|
1560
|
+
) : /* @__PURE__ */ o(I, { children: [
|
|
1571
1561
|
/* @__PURE__ */ e(
|
|
1572
|
-
|
|
1562
|
+
gt,
|
|
1573
1563
|
{
|
|
1574
|
-
value:
|
|
1575
|
-
onSave: (
|
|
1564
|
+
value: Ma || "Untitled Dashboard",
|
|
1565
|
+
onSave: (i) => {
|
|
1576
1566
|
console.log("EditableText onSave called:", {
|
|
1577
|
-
newTitle:
|
|
1567
|
+
newTitle: i,
|
|
1578
1568
|
canEditDashboard: pe,
|
|
1579
|
-
dashboardId:
|
|
1569
|
+
dashboardId: r == null ? void 0 : r.id
|
|
1580
1570
|
});
|
|
1581
|
-
const
|
|
1582
|
-
f(
|
|
1571
|
+
const L = (r == null ? void 0 : r.title) || "";
|
|
1572
|
+
f(i), As(i, L);
|
|
1583
1573
|
},
|
|
1584
1574
|
isEditable: pe && !h,
|
|
1585
1575
|
displayClassName: "text-sm font-medium",
|
|
1586
1576
|
inputClassName: "text-sm font-medium",
|
|
1587
1577
|
placeholder: "Dashboard Title",
|
|
1588
|
-
isPending:
|
|
1578
|
+
isPending: re.isPending
|
|
1589
1579
|
}
|
|
1590
1580
|
),
|
|
1591
|
-
|
|
1592
|
-
/* @__PURE__ */ e(
|
|
1581
|
+
Us && oe && /* @__PURE__ */ e(vt, { children: /* @__PURE__ */ o(bt, { children: [
|
|
1582
|
+
/* @__PURE__ */ e(yt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1593
1583
|
M,
|
|
1594
1584
|
{
|
|
1595
1585
|
variant: "ghost",
|
|
1596
1586
|
size: "icon",
|
|
1597
|
-
onClick:
|
|
1598
|
-
disabled:
|
|
1587
|
+
onClick: Gs,
|
|
1588
|
+
disabled: xs || !(a != null && a.accessToken) || !(n != null && n.apiServiceUrl),
|
|
1599
1589
|
className: "h-7 w-7",
|
|
1600
1590
|
children: /* @__PURE__ */ e(
|
|
1601
|
-
|
|
1591
|
+
Nt,
|
|
1602
1592
|
{
|
|
1603
|
-
className:
|
|
1593
|
+
className: Y(
|
|
1604
1594
|
"h-4 w-4 transition-colors",
|
|
1605
|
-
|
|
1595
|
+
qe ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground hover:text-yellow-400"
|
|
1606
1596
|
)
|
|
1607
1597
|
}
|
|
1608
1598
|
)
|
|
1609
1599
|
}
|
|
1610
1600
|
) }),
|
|
1611
|
-
/* @__PURE__ */ e(
|
|
1601
|
+
/* @__PURE__ */ e(St, { children: /* @__PURE__ */ e("p", { children: qe ? "Remove as default dashboard" : "Make this a default dashboard" }) })
|
|
1612
1602
|
] }) })
|
|
1613
1603
|
] }))
|
|
1614
1604
|
] }),
|
|
1615
1605
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
1616
|
-
|
|
1617
|
-
/* @__PURE__ */ e(
|
|
1618
|
-
/* @__PURE__ */ e(
|
|
1606
|
+
w && /* @__PURE__ */ o(I, { children: [
|
|
1607
|
+
/* @__PURE__ */ e(Vt, { className: "mr-2" }),
|
|
1608
|
+
/* @__PURE__ */ e(qt, { className: "h-7" })
|
|
1619
1609
|
] }),
|
|
1620
|
-
|
|
1610
|
+
t && !w && /* @__PURE__ */ o(I, { children: [
|
|
1621
1611
|
/* @__PURE__ */ e(
|
|
1622
|
-
|
|
1612
|
+
K,
|
|
1623
1613
|
{
|
|
1624
1614
|
tooltip: "Copy Token",
|
|
1625
1615
|
onClick: () => {
|
|
1626
|
-
var
|
|
1627
|
-
a != null && a.accessToken && ((
|
|
1616
|
+
var i;
|
|
1617
|
+
a != null && a.accessToken && ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(a.accessToken).then(() => k.success("Token copied to clipboard")).catch(() => k.error("Unable to copy token")) : k.error("Clipboard not available"));
|
|
1628
1618
|
},
|
|
1629
1619
|
className: "h-7 p-2",
|
|
1630
|
-
children: /* @__PURE__ */ e(
|
|
1620
|
+
children: /* @__PURE__ */ e(xt, { className: "h-4 w-4" })
|
|
1631
1621
|
}
|
|
1632
1622
|
),
|
|
1633
1623
|
/* @__PURE__ */ e(
|
|
1634
|
-
|
|
1624
|
+
K,
|
|
1635
1625
|
{
|
|
1636
1626
|
tooltip: "Invalidate Token",
|
|
1637
|
-
onClick: () =>
|
|
1627
|
+
onClick: () => Dt(n.apiServiceUrl),
|
|
1638
1628
|
className: "h-7 p-2",
|
|
1639
|
-
children: /* @__PURE__ */ e(
|
|
1629
|
+
children: /* @__PURE__ */ e(er, { className: "h-4 w-4" })
|
|
1640
1630
|
}
|
|
1641
1631
|
)
|
|
1642
1632
|
] }),
|
|
1643
|
-
!
|
|
1644
|
-
!
|
|
1645
|
-
!
|
|
1646
|
-
|
|
1633
|
+
!w && c && /* @__PURE__ */ e(wt, {}),
|
|
1634
|
+
!w && c && /* @__PURE__ */ e(Ht, {}),
|
|
1635
|
+
!w && c && ((Ta = X == null ? void 0 : X.permissions) == null ? void 0 : Ta.canShare) && /* @__PURE__ */ e(
|
|
1636
|
+
K,
|
|
1647
1637
|
{
|
|
1648
1638
|
tooltip: "Share Dashboard",
|
|
1649
1639
|
onClick: () => C(!0),
|
|
1650
1640
|
className: "h-7 p-2",
|
|
1651
|
-
children: /* @__PURE__ */ e(
|
|
1641
|
+
children: /* @__PURE__ */ e(Ct, { className: "h-4 w-4" })
|
|
1652
1642
|
}
|
|
1653
1643
|
),
|
|
1654
|
-
!
|
|
1655
|
-
|
|
1644
|
+
!w && d && l.canUseFilters && c && /* @__PURE__ */ e(
|
|
1645
|
+
jt,
|
|
1656
1646
|
{
|
|
1657
1647
|
showFilters: fe,
|
|
1658
1648
|
onToggleFilters: () => {
|
|
1659
|
-
fe ||
|
|
1649
|
+
fe || ba("dashboard", !1), ya(!fe);
|
|
1660
1650
|
},
|
|
1661
1651
|
onAddFilter: () => {
|
|
1662
|
-
fe || (
|
|
1652
|
+
fe || (ba("dashboard", !1), ya(!0));
|
|
1663
1653
|
},
|
|
1664
1654
|
onAddControl: () => {
|
|
1665
1655
|
wa("create");
|
|
@@ -1667,26 +1657,26 @@ function qr() {
|
|
|
1667
1657
|
onManageControls: () => wa("manage")
|
|
1668
1658
|
}
|
|
1669
1659
|
),
|
|
1670
|
-
d && !
|
|
1671
|
-
|
|
1660
|
+
d && !w && c && ue ? /* @__PURE__ */ e(
|
|
1661
|
+
zt,
|
|
1672
1662
|
{
|
|
1673
1663
|
open: !0,
|
|
1674
|
-
onOpenChange: (
|
|
1675
|
-
|
|
1664
|
+
onOpenChange: (i) => {
|
|
1665
|
+
i || ee(null);
|
|
1676
1666
|
},
|
|
1677
1667
|
showTrigger: !1,
|
|
1678
1668
|
initialMode: ue
|
|
1679
1669
|
}
|
|
1680
1670
|
) : null,
|
|
1681
|
-
d && !
|
|
1682
|
-
!
|
|
1683
|
-
d && !
|
|
1671
|
+
d && !w && be && t && c && /* @__PURE__ */ e(lr, {}),
|
|
1672
|
+
!w && be && t && c && /* @__PURE__ */ e(cr, {}),
|
|
1673
|
+
d && !w && be && h && t && c && /* @__PURE__ */ o(
|
|
1684
1674
|
M,
|
|
1685
1675
|
{
|
|
1686
1676
|
className: "h-7 p-2",
|
|
1687
1677
|
variant: "secondary",
|
|
1688
1678
|
disabled: v,
|
|
1689
|
-
onClick:
|
|
1679
|
+
onClick: Ps,
|
|
1690
1680
|
size: "sm",
|
|
1691
1681
|
children: [
|
|
1692
1682
|
/* @__PURE__ */ e(Ga, { className: "mr-2 h-4 w-4" }),
|
|
@@ -1694,62 +1684,62 @@ function qr() {
|
|
|
1694
1684
|
]
|
|
1695
1685
|
}
|
|
1696
1686
|
),
|
|
1697
|
-
d && !
|
|
1687
|
+
d && !w && c && /* @__PURE__ */ o(
|
|
1698
1688
|
M,
|
|
1699
1689
|
{
|
|
1700
1690
|
variant: "outline",
|
|
1701
1691
|
className: "h-7 p-2",
|
|
1702
1692
|
size: "sm",
|
|
1703
1693
|
disabled: !d,
|
|
1704
|
-
onClick: () =>
|
|
1694
|
+
onClick: () => Cs(),
|
|
1705
1695
|
children: [
|
|
1706
|
-
/* @__PURE__ */ e(
|
|
1696
|
+
/* @__PURE__ */ e(ca, { className: "mr-2 h-4 w-4" }),
|
|
1707
1697
|
"Visual"
|
|
1708
1698
|
]
|
|
1709
1699
|
}
|
|
1710
1700
|
),
|
|
1711
|
-
!
|
|
1701
|
+
!w && !d && pe && c && /* @__PURE__ */ o(
|
|
1712
1702
|
M,
|
|
1713
1703
|
{
|
|
1714
1704
|
variant: "outline",
|
|
1715
1705
|
className: "h-7 p-2",
|
|
1716
|
-
onClick:
|
|
1706
|
+
onClick: Ms,
|
|
1717
1707
|
size: "sm",
|
|
1718
1708
|
children: [
|
|
1719
|
-
/* @__PURE__ */ e(
|
|
1709
|
+
/* @__PURE__ */ e(Et, { className: "mr-2 h-4 w-4" }),
|
|
1720
1710
|
"Edit"
|
|
1721
1711
|
]
|
|
1722
1712
|
}
|
|
1723
1713
|
),
|
|
1724
|
-
|
|
1714
|
+
Ca && c && Ea && /* @__PURE__ */ o(
|
|
1725
1715
|
M,
|
|
1726
1716
|
{
|
|
1727
1717
|
variant: "outline",
|
|
1728
1718
|
className: "h-7 p-2",
|
|
1729
|
-
onClick:
|
|
1719
|
+
onClick: Ts,
|
|
1730
1720
|
size: "sm",
|
|
1731
|
-
disabled:
|
|
1721
|
+
disabled: ne,
|
|
1732
1722
|
children: [
|
|
1733
|
-
/* @__PURE__ */ e(
|
|
1723
|
+
/* @__PURE__ */ e(At, { className: "mr-2 h-4 w-4" }),
|
|
1734
1724
|
"Undo"
|
|
1735
1725
|
]
|
|
1736
1726
|
}
|
|
1737
1727
|
),
|
|
1738
|
-
|
|
1728
|
+
Ca && c && /* @__PURE__ */ o("div", { className: "relative inline-flex", children: [
|
|
1739
1729
|
/* @__PURE__ */ o(
|
|
1740
1730
|
M,
|
|
1741
1731
|
{
|
|
1742
|
-
className:
|
|
1743
|
-
disabled:
|
|
1744
|
-
onClick: () =>
|
|
1732
|
+
className: Y("h-7 p-2", !$e && "opacity-60"),
|
|
1733
|
+
disabled: ne || !$e,
|
|
1734
|
+
onClick: () => Ve(),
|
|
1745
1735
|
size: "sm",
|
|
1746
1736
|
children: [
|
|
1747
|
-
|
|
1748
|
-
|
|
1737
|
+
ne ? /* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Ga, { className: "mr-2 h-4 w-4" }),
|
|
1738
|
+
ne ? "Saving..." : "Save"
|
|
1749
1739
|
]
|
|
1750
1740
|
}
|
|
1751
1741
|
),
|
|
1752
|
-
|
|
1742
|
+
$e && !ne && /* @__PURE__ */ e(
|
|
1753
1743
|
"span",
|
|
1754
1744
|
{
|
|
1755
1745
|
"aria-hidden": "true",
|
|
@@ -1757,92 +1747,92 @@ function qr() {
|
|
|
1757
1747
|
}
|
|
1758
1748
|
)
|
|
1759
1749
|
] }),
|
|
1760
|
-
!
|
|
1750
|
+
!w && d && t && c && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
|
|
1761
1751
|
M,
|
|
1762
1752
|
{
|
|
1763
1753
|
className: "h-7 p-2",
|
|
1764
|
-
onClick: () =>
|
|
1754
|
+
onClick: () => Sa(!ys),
|
|
1765
1755
|
size: "sm",
|
|
1766
1756
|
variant: "ghost",
|
|
1767
|
-
children: /* @__PURE__ */ e(
|
|
1757
|
+
children: /* @__PURE__ */ e(Mt, { className: "h-4 w-4" })
|
|
1768
1758
|
}
|
|
1769
1759
|
) }),
|
|
1770
|
-
!
|
|
1771
|
-
d && !
|
|
1760
|
+
!w && t && /* @__PURE__ */ e(nr, {}),
|
|
1761
|
+
d && !w && c && /* @__PURE__ */ o(
|
|
1772
1762
|
M,
|
|
1773
1763
|
{
|
|
1774
1764
|
variant: "outline",
|
|
1775
1765
|
className: "h-7 p-2",
|
|
1776
|
-
onClick:
|
|
1766
|
+
onClick: ks,
|
|
1777
1767
|
children: [
|
|
1778
|
-
/* @__PURE__ */ e(
|
|
1768
|
+
/* @__PURE__ */ e(za, { className: "mr-2 h-4 w-4" }),
|
|
1779
1769
|
"Close"
|
|
1780
1770
|
]
|
|
1781
1771
|
}
|
|
1782
1772
|
),
|
|
1783
|
-
!
|
|
1784
|
-
/* @__PURE__ */ e(
|
|
1785
|
-
|
|
1773
|
+
!w && c && /* @__PURE__ */ o(ra, { children: [
|
|
1774
|
+
/* @__PURE__ */ e(na, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1775
|
+
K,
|
|
1786
1776
|
{
|
|
1787
1777
|
tooltip: "More Options",
|
|
1788
1778
|
className: "h-8 w-8 rounded-md border border-transparent p-0 text-muted-foreground hover:bg-muted/50 hover:text-foreground",
|
|
1789
1779
|
buttonProps: { "aria-label": "More dashboard options" },
|
|
1790
|
-
children: /* @__PURE__ */ e(
|
|
1780
|
+
children: /* @__PURE__ */ e(Lt, { className: "h-4 w-4" })
|
|
1791
1781
|
}
|
|
1792
1782
|
) }),
|
|
1793
1783
|
/* @__PURE__ */ o(
|
|
1794
|
-
|
|
1784
|
+
oa,
|
|
1795
1785
|
{
|
|
1796
1786
|
align: "end",
|
|
1797
1787
|
className: "w-56 rounded-xl border border-border/60 p-1 shadow-sm",
|
|
1798
1788
|
children: [
|
|
1799
|
-
/* @__PURE__ */ e(
|
|
1789
|
+
/* @__PURE__ */ e(we, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Automation" }),
|
|
1800
1790
|
/* @__PURE__ */ o(
|
|
1801
|
-
|
|
1791
|
+
Q,
|
|
1802
1792
|
{
|
|
1803
|
-
onClick: () =>
|
|
1793
|
+
onClick: () => V(!0),
|
|
1804
1794
|
className: "flex items-center gap-2",
|
|
1805
1795
|
children: [
|
|
1806
|
-
/* @__PURE__ */ e(
|
|
1796
|
+
/* @__PURE__ */ e(kt, { className: "mr-2 h-4 w-4" }),
|
|
1807
1797
|
"Schedule Dashboard"
|
|
1808
1798
|
]
|
|
1809
1799
|
}
|
|
1810
1800
|
),
|
|
1811
|
-
/* @__PURE__ */ e(
|
|
1812
|
-
|
|
1813
|
-
/* @__PURE__ */ e(
|
|
1801
|
+
/* @__PURE__ */ e(We, {}),
|
|
1802
|
+
ws && /* @__PURE__ */ o(I, { children: [
|
|
1803
|
+
/* @__PURE__ */ e(we, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Access" }),
|
|
1814
1804
|
/* @__PURE__ */ o(
|
|
1815
|
-
|
|
1805
|
+
Q,
|
|
1816
1806
|
{
|
|
1817
1807
|
onClick: () => U(!0),
|
|
1818
1808
|
className: "flex items-center gap-2",
|
|
1819
1809
|
children: [
|
|
1820
|
-
/* @__PURE__ */ e(
|
|
1810
|
+
/* @__PURE__ */ e(J, { className: "mr-2 h-4 w-4" }),
|
|
1821
1811
|
"Manage Groups"
|
|
1822
1812
|
]
|
|
1823
1813
|
}
|
|
1824
1814
|
),
|
|
1825
|
-
/* @__PURE__ */ e(
|
|
1815
|
+
/* @__PURE__ */ e(We, {})
|
|
1826
1816
|
] }),
|
|
1827
|
-
/* @__PURE__ */ e(
|
|
1817
|
+
/* @__PURE__ */ e(we, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Preferences" }),
|
|
1828
1818
|
/* @__PURE__ */ o(
|
|
1829
|
-
|
|
1819
|
+
Q,
|
|
1830
1820
|
{
|
|
1831
|
-
onClick: () =>
|
|
1821
|
+
onClick: () => H(!0),
|
|
1832
1822
|
className: "flex items-center gap-2",
|
|
1833
1823
|
children: [
|
|
1834
|
-
/* @__PURE__ */ e(
|
|
1824
|
+
/* @__PURE__ */ e(It, { className: "mr-2 h-4 w-4" }),
|
|
1835
1825
|
"Calendar Preferences"
|
|
1836
1826
|
]
|
|
1837
1827
|
}
|
|
1838
1828
|
),
|
|
1839
1829
|
/* @__PURE__ */ o(
|
|
1840
|
-
|
|
1830
|
+
Q,
|
|
1841
1831
|
{
|
|
1842
|
-
onClick: () =>
|
|
1832
|
+
onClick: () => j(!0),
|
|
1843
1833
|
className: "flex items-center gap-2",
|
|
1844
1834
|
children: [
|
|
1845
|
-
/* @__PURE__ */ e(
|
|
1835
|
+
/* @__PURE__ */ e(Ot, { className: "mr-2 h-4 w-4" }),
|
|
1846
1836
|
"Summary Settings"
|
|
1847
1837
|
]
|
|
1848
1838
|
}
|
|
@@ -1851,95 +1841,95 @@ function qr() {
|
|
|
1851
1841
|
}
|
|
1852
1842
|
)
|
|
1853
1843
|
] }),
|
|
1854
|
-
S &&
|
|
1855
|
-
|
|
1844
|
+
S && Da && /* @__PURE__ */ e(
|
|
1845
|
+
Tt,
|
|
1856
1846
|
{
|
|
1857
|
-
resource:
|
|
1858
|
-
resourceType:
|
|
1847
|
+
resource: Da,
|
|
1848
|
+
resourceType: je.DASHBOARD,
|
|
1859
1849
|
onClose: () => C(!1)
|
|
1860
1850
|
}
|
|
1861
1851
|
),
|
|
1862
1852
|
/* @__PURE__ */ e(
|
|
1863
|
-
|
|
1853
|
+
Or,
|
|
1864
1854
|
{
|
|
1865
1855
|
open: P,
|
|
1866
1856
|
onOpenChange: U
|
|
1867
1857
|
}
|
|
1868
1858
|
),
|
|
1869
|
-
(
|
|
1870
|
-
|
|
1859
|
+
(r == null ? void 0 : r.id) && /* @__PURE__ */ e(
|
|
1860
|
+
_t,
|
|
1871
1861
|
{
|
|
1872
1862
|
open: _,
|
|
1873
|
-
onOpenChange:
|
|
1874
|
-
dashboardId:
|
|
1875
|
-
dashboardName:
|
|
1863
|
+
onOpenChange: V,
|
|
1864
|
+
dashboardId: r.id,
|
|
1865
|
+
dashboardName: r == null ? void 0 : r.title
|
|
1876
1866
|
}
|
|
1877
1867
|
),
|
|
1878
1868
|
/* @__PURE__ */ e(
|
|
1879
|
-
|
|
1869
|
+
Qt,
|
|
1880
1870
|
{
|
|
1881
|
-
open:
|
|
1882
|
-
onOpenChange:
|
|
1871
|
+
open: q,
|
|
1872
|
+
onOpenChange: H
|
|
1883
1873
|
}
|
|
1884
1874
|
),
|
|
1885
1875
|
/* @__PURE__ */ e(
|
|
1886
|
-
|
|
1876
|
+
Wt,
|
|
1887
1877
|
{
|
|
1888
|
-
open:
|
|
1889
|
-
onOpenChange:
|
|
1890
|
-
dashboard:
|
|
1878
|
+
open: D,
|
|
1879
|
+
onOpenChange: j,
|
|
1880
|
+
dashboard: r,
|
|
1891
1881
|
disabled: !d,
|
|
1892
|
-
onApply: (
|
|
1893
|
-
...
|
|
1894
|
-
summary:
|
|
1882
|
+
onApply: (i) => Ge({
|
|
1883
|
+
...r,
|
|
1884
|
+
summary: i
|
|
1895
1885
|
})
|
|
1896
1886
|
}
|
|
1897
1887
|
),
|
|
1898
1888
|
/* @__PURE__ */ e(
|
|
1899
|
-
|
|
1889
|
+
Ya,
|
|
1900
1890
|
{
|
|
1901
|
-
open:
|
|
1902
|
-
onOpenChange: (
|
|
1903
|
-
!
|
|
1891
|
+
open: ke,
|
|
1892
|
+
onOpenChange: (i) => {
|
|
1893
|
+
!i && _e && !E || (g(i), i || (O(null), z([]), me(!1)));
|
|
1904
1894
|
},
|
|
1905
|
-
children: /* @__PURE__ */ o(
|
|
1906
|
-
/* @__PURE__ */ o(
|
|
1907
|
-
/* @__PURE__ */ e(
|
|
1908
|
-
/* @__PURE__ */ e(
|
|
1909
|
-
|
|
1895
|
+
children: /* @__PURE__ */ o(Za, { className: "max-w-sm", children: [
|
|
1896
|
+
/* @__PURE__ */ o(es, { children: [
|
|
1897
|
+
/* @__PURE__ */ e(as, { children: E ? "Save failed" : "Saving dashboard" }),
|
|
1898
|
+
/* @__PURE__ */ e(ss, { className: "pt-2", children: E ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
1899
|
+
F.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
1910
1900
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
1911
|
-
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children:
|
|
1901
|
+
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: F.slice(0, 5).map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
|
|
1912
1902
|
] })
|
|
1913
1903
|
] }),
|
|
1914
|
-
/* @__PURE__ */ e(
|
|
1904
|
+
/* @__PURE__ */ e(ts, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: E ? /* @__PURE__ */ o(I, { children: [
|
|
1915
1905
|
/* @__PURE__ */ e(
|
|
1916
|
-
|
|
1906
|
+
rs,
|
|
1917
1907
|
{
|
|
1918
1908
|
onClick: () => {
|
|
1919
|
-
g(!1),
|
|
1909
|
+
g(!1), O(null), z([]), me(!1);
|
|
1920
1910
|
},
|
|
1921
1911
|
className: "m-0",
|
|
1922
1912
|
children: "Close"
|
|
1923
1913
|
}
|
|
1924
1914
|
),
|
|
1925
1915
|
/* @__PURE__ */ e(
|
|
1926
|
-
|
|
1916
|
+
aa,
|
|
1927
1917
|
{
|
|
1928
|
-
onClick: () =>
|
|
1929
|
-
closeAfterSave:
|
|
1930
|
-
navigateHomeAfterSave:
|
|
1918
|
+
onClick: () => Ve({
|
|
1919
|
+
closeAfterSave: ae,
|
|
1920
|
+
navigateHomeAfterSave: Ue === "home"
|
|
1931
1921
|
}),
|
|
1932
1922
|
className: "m-0",
|
|
1933
1923
|
children: "Retry"
|
|
1934
1924
|
}
|
|
1935
1925
|
)
|
|
1936
1926
|
] }) : /* @__PURE__ */ o(
|
|
1937
|
-
|
|
1927
|
+
aa,
|
|
1938
1928
|
{
|
|
1939
1929
|
disabled: !0,
|
|
1940
1930
|
className: "m-0 cursor-default",
|
|
1941
1931
|
children: [
|
|
1942
|
-
/* @__PURE__ */ e(
|
|
1932
|
+
/* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1943
1933
|
"Saving..."
|
|
1944
1934
|
]
|
|
1945
1935
|
}
|
|
@@ -1948,15 +1938,15 @@ function qr() {
|
|
|
1948
1938
|
}
|
|
1949
1939
|
),
|
|
1950
1940
|
/* @__PURE__ */ e(
|
|
1951
|
-
|
|
1941
|
+
Bt,
|
|
1952
1942
|
{
|
|
1953
|
-
open:
|
|
1954
|
-
onOpenChange: (
|
|
1955
|
-
|
|
1943
|
+
open: Es,
|
|
1944
|
+
onOpenChange: (i) => {
|
|
1945
|
+
te(i);
|
|
1956
1946
|
},
|
|
1957
|
-
onSave:
|
|
1958
|
-
onDiscard:
|
|
1959
|
-
isSaving:
|
|
1947
|
+
onSave: Is,
|
|
1948
|
+
onDiscard: Os,
|
|
1949
|
+
isSaving: _e,
|
|
1960
1950
|
saveLabel: "Save",
|
|
1961
1951
|
discardLabel: "Discard"
|
|
1962
1952
|
}
|
|
@@ -1967,5 +1957,5 @@ function qr() {
|
|
|
1967
1957
|
);
|
|
1968
1958
|
}
|
|
1969
1959
|
export {
|
|
1970
|
-
|
|
1960
|
+
zr as default
|
|
1971
1961
|
};
|