react-semaphor 0.1.303 → 0.1.305
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/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/chunks/common-types-C6cAQgyh.js +9 -0
- package/dist/chunks/common-types-nBuCd3u2.js +1 -0
- package/dist/chunks/dashboard-controls-BcwXajYv.js +47 -0
- package/dist/chunks/{dashboard-controls-BCJZOzrL.js → dashboard-controls-DjOO0fkG.js} +799 -774
- package/dist/chunks/{dashboard-filter-controls-button-C-e7230k.js → dashboard-filter-controls-button-CR0_duPw.js} +3 -3
- package/dist/chunks/{dashboard-filter-controls-button-Cfbac4Jw.js → dashboard-filter-controls-button-YvRfoUuN.js} +142 -142
- package/dist/chunks/{dashboard-json-BzvLPhGM.js → dashboard-json-BYLaWi0-.js} +2 -2
- package/dist/chunks/{dashboard-json-BM5ywMgp.js → dashboard-json-tOsNVccY.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-ChK3344r.js → dashboard-summary-settings-dialog-CMxi2arh.js} +2 -2
- package/dist/chunks/{dashboard-summary-settings-dialog-BdxKl1UF.js → dashboard-summary-settings-dialog-DioOegLQ.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-nNaZ2IK1.js → edit-dashboard-visual-331vOmKT.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-D725CWD5.js → edit-dashboard-visual-ClLcFLD_.js} +164 -164
- package/dist/chunks/index-BOGpMmRo.js +1360 -0
- package/dist/chunks/{index-CYWgnME0.js → index-DJFckbGE.js} +42308 -40062
- package/dist/chunks/{palette-B9DJXMGo.js → palette-BqJlrRto.js} +1 -1
- package/dist/chunks/{palette-DGOzbtsn.js → palette-DD-i7bNS.js} +1 -1
- package/dist/chunks/{resource-management-panel-CE0-NcLL.js → resource-management-panel-BS9nfJbb.js} +65 -65
- package/dist/chunks/{resource-management-panel-mJmc5dMT.js → resource-management-panel-CoHy6cOi.js} +1 -1
- package/dist/chunks/{rotate-ccw-Bs7YJn10.js → rotate-ccw-CdGW8Rxm.js} +1 -1
- package/dist/chunks/{rotate-ccw-YsjQwpKm.js → rotate-ccw-X8MbX_hF.js} +1 -1
- package/dist/chunks/{save-Bj1y1rug.js → save-CFBIhbHD.js} +1 -1
- package/dist/chunks/{save-CUrexoNl.js → save-j-clxFtx.js} +1 -1
- package/dist/chunks/{switch-oojO-gal.js → switch-BFhVVwh9.js} +4248 -3243
- package/dist/chunks/switch-BH17qlxH.js +163 -0
- package/dist/chunks/use-create-flow-overlay-state-BSUi4chy.js +16 -0
- package/dist/chunks/{use-create-flow-overlay-state-BHDKxe7I.js → use-create-flow-overlay-state-Lmk-mIkA.js} +318 -316
- package/dist/chunks/{use-visual-utils-DYDXMl5v.js → use-visual-utils-CR9nLyEz.js} +1 -1
- package/dist/chunks/{use-visual-utils-CjFzlR0P.js → use-visual-utils-CikIkKb2.js} +2 -2
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +5 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +60 -59
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +6 -6
- package/dist/types/dashboard.d.ts +168 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +8 -11
- package/dist/types/main.d.ts +194 -2
- package/dist/types/shared.d.ts +120 -0
- package/dist/types/surfboard.d.ts +168 -0
- package/dist/types/types.d.ts +168 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-CVFoOPti.js +0 -47
- package/dist/chunks/index-BWjB_9uz.js +0 -1356
- package/dist/chunks/switch-CiEX68py.js +0 -163
- package/dist/chunks/use-create-flow-overlay-state-D2I2wNey.js +0 -16
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as e, jsxs as c, Fragment as T } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import Ea, { useState as
|
|
2
|
+
import { c as X, u as S, B as L, aH as Nt, m as St, L as dt, I as ue, a as J, aI as Re, aJ as da, aK as ua, E as ls, f as Y, aL as ds, aM as us, aN as ut, T as ma, q as ha, r as _e, t as Ue, s as mt, aO as pa, aP as ms, n as ta, z as hs, A as ps, D as fs, F as gs, K as vs, aQ as bs } from "./switch-BFhVVwh9.js";
|
|
3
|
+
import { c5 as ys, u as j, b as Ge, c6 as xs, bl as ht, c as $e, d as Ve, e as ze, f as wt, o as Ns, c7 as de, by as Te, c8 as Ss, c9 as aa, ca as fa, cb as ga, cc as ws, bO as Dt, cd as Ds, ce as Cs, cf as Es, cg as Is, ch as As, ci as Ls, r as qe, z as Be, p as A, bV as Ms, cj as Os, ck as ks, bS as pt, cl as ft, bx as Ct, bc as va, cm as gt, ba, cn as Ps, bF as ya, bG as xa, bH as Na, bI as Sa, bJ as wa, bK as Da, bL as Ca, bM as vt, co as Ts, cp as _s, cq as Us, bp as Fs, cr as Rs, cs as Gs, X as $s, W as ke, ct as Vs, a1 as zs, Y as nt, cu as qs, cv as Bs, cw as Hs, ad as js, cx as Ks, L as rt, cy as Qs, cz as Ws, cA as Js, c4 as Ys, cB as Xs, bq as Zs, br as en, bs as tn, bt as an, bu as $, bZ as sn, N as nn, bA as rn, cC as on, bv as sa, cD as cn, cE as ln, cF as dn, a0 as un, O as mn, cG as hn, K as bt } from "./index-DJFckbGE.js";
|
|
4
|
+
import * as M from "react";
|
|
5
|
+
import Ea, { useState as N, useMemo as F, useCallback as Fe, useEffect as ot } from "react";
|
|
6
6
|
import "./index-CJdxSyQq.js";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
import { b as
|
|
9
|
-
import { d as
|
|
10
|
-
import { C as
|
|
11
|
-
import { u as
|
|
8
|
+
import { b as pn, u as fn, A as gn, V as vn, c as bn, D as yn, N as xn, U as Nn } from "./dashboard-filter-controls-button-YvRfoUuN.js";
|
|
9
|
+
import { d as Sn } from "./index-DFOb_6HB.js";
|
|
10
|
+
import { C as wn, D as Dn } from "./dashboard-summary-settings-dialog-CMxi2arh.js";
|
|
11
|
+
import { u as Cn } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
12
12
|
import { s as it } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
13
|
-
import { u as
|
|
14
|
-
import { S as na } from "./save-
|
|
15
|
-
import { P as
|
|
13
|
+
import { u as En, e as In } from "./use-create-flow-overlay-state-Lmk-mIkA.js";
|
|
14
|
+
import { S as na } from "./save-j-clxFtx.js";
|
|
15
|
+
import { P as An, B as Ln } from "./palette-DD-i7bNS.js";
|
|
16
16
|
/**
|
|
17
17
|
* @license lucide-react v0.453.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
21
|
*/
|
|
22
|
-
const Mn =
|
|
22
|
+
const Mn = X("Glasses", [
|
|
23
23
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
24
24
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
25
25
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -32,7 +32,7 @@ const Mn = Z("Glasses", [
|
|
|
32
32
|
* This source code is licensed under the ISC license.
|
|
33
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
34
34
|
*/
|
|
35
|
-
const
|
|
35
|
+
const On = X("Menu", [
|
|
36
36
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
37
37
|
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
38
38
|
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
@@ -43,7 +43,7 @@ const An = Z("Menu", [
|
|
|
43
43
|
* This source code is licensed under the ISC license.
|
|
44
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
45
|
*/
|
|
46
|
-
const
|
|
46
|
+
const kn = X("Monitor", [
|
|
47
47
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
48
48
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
49
49
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
@@ -54,7 +54,7 @@ const Ln = Z("Monitor", [
|
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
55
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
56
|
*/
|
|
57
|
-
const
|
|
57
|
+
const Pn = X("Moon", [
|
|
58
58
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
59
59
|
]);
|
|
60
60
|
/**
|
|
@@ -63,7 +63,7 @@ const On = Z("Moon", [
|
|
|
63
63
|
* This source code is licensed under the ISC license.
|
|
64
64
|
* See the LICENSE file in the root directory of this source tree.
|
|
65
65
|
*/
|
|
66
|
-
const
|
|
66
|
+
const Tn = X("ShieldX", [
|
|
67
67
|
[
|
|
68
68
|
"path",
|
|
69
69
|
{
|
|
@@ -80,7 +80,7 @@ const kn = Z("ShieldX", [
|
|
|
80
80
|
* This source code is licensed under the ISC license.
|
|
81
81
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
82
|
*/
|
|
83
|
-
const
|
|
83
|
+
const _n = X("Sun", [
|
|
84
84
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
85
85
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
86
86
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -102,45 +102,45 @@ var yt = { exports: {} }, ct = {};
|
|
|
102
102
|
* LICENSE file in the root directory of this source tree.
|
|
103
103
|
*/
|
|
104
104
|
var ra;
|
|
105
|
-
function
|
|
105
|
+
function Un() {
|
|
106
106
|
if (ra) return ct;
|
|
107
107
|
ra = 1;
|
|
108
108
|
var t = Ea;
|
|
109
|
-
function
|
|
110
|
-
return
|
|
109
|
+
function a(f, h) {
|
|
110
|
+
return f === h && (f !== 0 || 1 / f === 1 / h) || f !== f && h !== h;
|
|
111
111
|
}
|
|
112
|
-
var n = typeof Object.is == "function" ? Object.is :
|
|
113
|
-
function
|
|
114
|
-
var
|
|
115
|
-
return
|
|
112
|
+
var n = typeof Object.is == "function" ? Object.is : a, s = t.useState, i = t.useEffect, u = t.useLayoutEffect, l = t.useDebugValue;
|
|
113
|
+
function p(f, h) {
|
|
114
|
+
var d = h(), r = s({ inst: { value: d, getSnapshot: h } }), b = r[0].inst, D = r[1];
|
|
115
|
+
return u(
|
|
116
116
|
function() {
|
|
117
|
-
b.value =
|
|
117
|
+
b.value = d, b.getSnapshot = h, g(b) && D({ inst: b });
|
|
118
118
|
},
|
|
119
|
-
[
|
|
120
|
-
),
|
|
119
|
+
[f, d, h]
|
|
120
|
+
), i(
|
|
121
121
|
function() {
|
|
122
|
-
return
|
|
123
|
-
|
|
122
|
+
return g(b) && D({ inst: b }), f(function() {
|
|
123
|
+
g(b) && D({ inst: b });
|
|
124
124
|
});
|
|
125
125
|
},
|
|
126
|
-
[
|
|
127
|
-
), l(
|
|
126
|
+
[f]
|
|
127
|
+
), l(d), d;
|
|
128
128
|
}
|
|
129
|
-
function f
|
|
130
|
-
var
|
|
131
|
-
|
|
129
|
+
function g(f) {
|
|
130
|
+
var h = f.getSnapshot;
|
|
131
|
+
f = f.value;
|
|
132
132
|
try {
|
|
133
|
-
var
|
|
134
|
-
return !n(
|
|
133
|
+
var d = h();
|
|
134
|
+
return !n(f, d);
|
|
135
135
|
} catch {
|
|
136
136
|
return !0;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
function v(
|
|
140
|
-
return
|
|
139
|
+
function v(f, h) {
|
|
140
|
+
return h();
|
|
141
141
|
}
|
|
142
|
-
var
|
|
143
|
-
return ct.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore :
|
|
142
|
+
var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : p;
|
|
143
|
+
return ct.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : m, ct;
|
|
144
144
|
}
|
|
145
145
|
var lt = {};
|
|
146
146
|
/**
|
|
@@ -153,138 +153,138 @@ var lt = {};
|
|
|
153
153
|
* LICENSE file in the root directory of this source tree.
|
|
154
154
|
*/
|
|
155
155
|
var oa;
|
|
156
|
-
function
|
|
156
|
+
function Fn() {
|
|
157
157
|
return oa || (oa = 1, process.env.NODE_ENV !== "production" && function() {
|
|
158
|
-
function t(
|
|
159
|
-
return
|
|
158
|
+
function t(d, r) {
|
|
159
|
+
return d === r && (d !== 0 || 1 / d === 1 / r) || d !== d && r !== r;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
|
|
161
|
+
function a(d, r) {
|
|
162
|
+
m || i.startTransition === void 0 || (m = !0, console.error(
|
|
163
163
|
"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."
|
|
164
164
|
));
|
|
165
|
-
var b =
|
|
166
|
-
if (!
|
|
167
|
-
var
|
|
168
|
-
|
|
165
|
+
var b = r();
|
|
166
|
+
if (!f) {
|
|
167
|
+
var D = r();
|
|
168
|
+
u(b, D) || (console.error(
|
|
169
169
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
170
|
-
),
|
|
170
|
+
), f = !0);
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
inst: { value: b, getSnapshot:
|
|
172
|
+
D = l({
|
|
173
|
+
inst: { value: b, getSnapshot: r }
|
|
174
174
|
});
|
|
175
|
-
var w =
|
|
176
|
-
return
|
|
175
|
+
var w = D[0].inst, C = D[1];
|
|
176
|
+
return g(
|
|
177
177
|
function() {
|
|
178
|
-
w.value = b, w.getSnapshot =
|
|
178
|
+
w.value = b, w.getSnapshot = r, n(w) && C({ inst: w });
|
|
179
179
|
},
|
|
180
|
-
[
|
|
181
|
-
),
|
|
180
|
+
[d, b, r]
|
|
181
|
+
), p(
|
|
182
182
|
function() {
|
|
183
|
-
return n(w) &&
|
|
184
|
-
n(w) &&
|
|
183
|
+
return n(w) && C({ inst: w }), d(function() {
|
|
184
|
+
n(w) && C({ inst: w });
|
|
185
185
|
});
|
|
186
186
|
},
|
|
187
|
-
[
|
|
187
|
+
[d]
|
|
188
188
|
), v(b), b;
|
|
189
189
|
}
|
|
190
|
-
function n(
|
|
191
|
-
var
|
|
192
|
-
|
|
190
|
+
function n(d) {
|
|
191
|
+
var r = d.getSnapshot;
|
|
192
|
+
d = d.value;
|
|
193
193
|
try {
|
|
194
|
-
var b =
|
|
195
|
-
return !d
|
|
194
|
+
var b = r();
|
|
195
|
+
return !u(d, b);
|
|
196
196
|
} catch {
|
|
197
197
|
return !0;
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
return
|
|
200
|
+
function s(d, r) {
|
|
201
|
+
return r();
|
|
202
202
|
}
|
|
203
203
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
204
|
-
var
|
|
205
|
-
lt.useSyncExternalStore =
|
|
204
|
+
var i = Ea, u = typeof Object.is == "function" ? Object.is : t, l = i.useState, p = i.useEffect, g = i.useLayoutEffect, v = i.useDebugValue, m = !1, f = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? s : a;
|
|
205
|
+
lt.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
206
206
|
}()), lt;
|
|
207
207
|
}
|
|
208
|
-
process.env.NODE_ENV === "production" ? yt.exports =
|
|
209
|
-
var
|
|
208
|
+
process.env.NODE_ENV === "production" ? yt.exports = Un() : yt.exports = Fn();
|
|
209
|
+
var Rn = yt.exports;
|
|
210
210
|
const Pe = ["light", "dark", "system"];
|
|
211
|
-
function
|
|
212
|
-
const { theme: t, setTheme:
|
|
211
|
+
function Gn() {
|
|
212
|
+
const { theme: t, setTheme: a } = ys(), n = S(
|
|
213
213
|
(l) => l.actions.setDashboardTheme
|
|
214
214
|
);
|
|
215
|
-
function
|
|
216
|
-
const l = Pe.includes(t) ? t : "system",
|
|
217
|
-
|
|
215
|
+
function s() {
|
|
216
|
+
const l = Pe.includes(t) ? t : "system", p = Pe[(Pe.indexOf(l) + 1) % Pe.length];
|
|
217
|
+
a(p), n(p);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const i = t === "light" ? _n : t === "dark" ? Pn : kn, u = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
|
|
220
220
|
return /* @__PURE__ */ e(
|
|
221
|
-
|
|
221
|
+
L,
|
|
222
222
|
{
|
|
223
223
|
type: "button",
|
|
224
224
|
variant: "ghost",
|
|
225
225
|
size: "xs",
|
|
226
226
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
|
|
227
|
-
onClick:
|
|
228
|
-
"aria-label":
|
|
229
|
-
title:
|
|
230
|
-
children: /* @__PURE__ */ e(
|
|
227
|
+
onClick: s,
|
|
228
|
+
"aria-label": u,
|
|
229
|
+
title: u,
|
|
230
|
+
children: /* @__PURE__ */ e(i, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
async function
|
|
235
|
-
if (!
|
|
234
|
+
async function $n(t, a, n, s, i) {
|
|
235
|
+
if (!i)
|
|
236
236
|
return null;
|
|
237
|
-
const
|
|
238
|
-
return await
|
|
239
|
-
name:
|
|
240
|
-
template:
|
|
241
|
-
filterValues:
|
|
237
|
+
const u = JSON.stringify(n), l = `${t}/v1/lens`;
|
|
238
|
+
return await Nt(l, i, {
|
|
239
|
+
name: a,
|
|
240
|
+
template: u,
|
|
241
|
+
filterValues: s,
|
|
242
242
|
operation: "create"
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
async function xt(t,
|
|
245
|
+
async function xt(t, a, n) {
|
|
246
246
|
if (!n)
|
|
247
247
|
return null;
|
|
248
|
-
const { id:
|
|
249
|
-
return await
|
|
250
|
-
lensId:
|
|
251
|
-
template:
|
|
252
|
-
filterValues:
|
|
248
|
+
const { id: s, template: i, filterValues: u, isDefault: l, shared: p } = a, g = `${t}/v1/lens`;
|
|
249
|
+
return await Nt(g, n, {
|
|
250
|
+
lensId: s,
|
|
251
|
+
template: i,
|
|
252
|
+
filterValues: u,
|
|
253
253
|
isDefault: l,
|
|
254
|
-
shared:
|
|
254
|
+
shared: p,
|
|
255
255
|
operation: "update"
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
-
async function
|
|
258
|
+
async function Vn(t, a, n) {
|
|
259
259
|
if (!n)
|
|
260
260
|
return null;
|
|
261
|
-
const
|
|
262
|
-
return await
|
|
261
|
+
const s = `${t}/v1/lens`;
|
|
262
|
+
return await Nt(s, n, {
|
|
263
263
|
operation: "delete",
|
|
264
|
-
lensId:
|
|
264
|
+
lensId: a
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
|
-
const
|
|
268
|
-
function
|
|
267
|
+
const zn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
268
|
+
function qn({
|
|
269
269
|
open: t,
|
|
270
|
-
onOpenChange:
|
|
270
|
+
onOpenChange: a
|
|
271
271
|
} = {}) {
|
|
272
|
-
const [n,
|
|
273
|
-
|
|
274
|
-
},
|
|
272
|
+
const [n, s] = N(""), [i, u] = N(!1), l = S((I) => I.lenses), { setLenses: p, setSelectedLensId: g } = St(), [v, m] = N(!1), [f, h] = N(!1), d = t !== void 0, r = d ? t : f, b = (I) => {
|
|
273
|
+
d || h(I), a == null || a(I);
|
|
274
|
+
}, D = S((I) => I.dashboard), w = S((I) => I.filterValues), { authToken: C, tokenProps: E } = j();
|
|
275
275
|
async function O() {
|
|
276
|
-
|
|
277
|
-
const I = await
|
|
276
|
+
m(!0);
|
|
277
|
+
const I = await $n(
|
|
278
278
|
E.apiServiceUrl,
|
|
279
279
|
n,
|
|
280
|
-
|
|
280
|
+
D,
|
|
281
281
|
w,
|
|
282
|
-
|
|
282
|
+
C == null ? void 0 : C.accessToken
|
|
283
283
|
);
|
|
284
|
-
I && (
|
|
284
|
+
I && (p([...l || [], I]), g(I.id), b(!1)), m(!1);
|
|
285
285
|
}
|
|
286
|
-
return /* @__PURE__ */ c(Ge, { open:
|
|
287
|
-
|
|
286
|
+
return /* @__PURE__ */ c(Ge, { open: r, onOpenChange: b, children: [
|
|
287
|
+
d ? null : /* @__PURE__ */ e(xs, { asChild: !0, children: /* @__PURE__ */ c(L, { variant: "secondary", size: "xs", children: [
|
|
288
288
|
/* @__PURE__ */ e(ht, { className: "h-3.5 w-3.5" }),
|
|
289
289
|
"Lens"
|
|
290
290
|
] }) }),
|
|
@@ -294,7 +294,7 @@ function Vn({
|
|
|
294
294
|
/* @__PURE__ */ e(wt, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
|
|
295
295
|
] }),
|
|
296
296
|
/* @__PURE__ */ c("div", { className: "space-y-1.5 py-1", children: [
|
|
297
|
-
/* @__PURE__ */ e(dt, { htmlFor: "lens-name", className:
|
|
297
|
+
/* @__PURE__ */ e(dt, { htmlFor: "lens-name", className: zn, children: "Name" }),
|
|
298
298
|
/* @__PURE__ */ e(
|
|
299
299
|
ue,
|
|
300
300
|
{
|
|
@@ -302,15 +302,15 @@ function Vn({
|
|
|
302
302
|
size: "xs",
|
|
303
303
|
value: n,
|
|
304
304
|
placeholder: "Monthly review, West region, …",
|
|
305
|
-
onChange: (I) =>
|
|
305
|
+
onChange: (I) => s(I.target.value)
|
|
306
306
|
}
|
|
307
307
|
),
|
|
308
|
-
|
|
308
|
+
i && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: "A lens with this name already exists. Pick a different one." })
|
|
309
309
|
] }),
|
|
310
|
-
/* @__PURE__ */ c(
|
|
311
|
-
/* @__PURE__ */ e(
|
|
310
|
+
/* @__PURE__ */ c(Ns, { children: [
|
|
311
|
+
/* @__PURE__ */ e(L, { variant: "outline", size: "xs", onClick: () => b(!1), children: "Cancel" }),
|
|
312
312
|
/* @__PURE__ */ e(
|
|
313
|
-
|
|
313
|
+
L,
|
|
314
314
|
{
|
|
315
315
|
size: "xs",
|
|
316
316
|
type: "submit",
|
|
@@ -323,38 +323,38 @@ function Vn({
|
|
|
323
323
|
] })
|
|
324
324
|
] });
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
const
|
|
328
|
-
async function
|
|
329
|
-
|
|
326
|
+
function Bn({ includeLabel: t = !1 } = {}) {
|
|
327
|
+
const a = S((m) => m.lenses), n = S((m) => m.selectedLensId), { setLenses: s, setSelectedLensId: i } = St(), { authToken: u, tokenProps: l } = j();
|
|
328
|
+
async function p(m) {
|
|
329
|
+
i(m);
|
|
330
330
|
}
|
|
331
|
-
async function
|
|
332
|
-
if (await
|
|
333
|
-
const
|
|
334
|
-
|
|
331
|
+
async function g(m) {
|
|
332
|
+
if (await Vn(l.apiServiceUrl, m, u == null ? void 0 : u.accessToken)) {
|
|
333
|
+
const h = a == null ? void 0 : a.filter((d) => d.id !== m);
|
|
334
|
+
s(h || []), i("original");
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
async function v(
|
|
338
|
-
const
|
|
339
|
-
...
|
|
340
|
-
isDefault: !
|
|
337
|
+
async function v(m) {
|
|
338
|
+
const f = a == null ? void 0 : a.map((r) => r.id === m.id ? {
|
|
339
|
+
...r,
|
|
340
|
+
isDefault: !m.isDefault
|
|
341
341
|
} : {
|
|
342
|
-
...
|
|
342
|
+
...r,
|
|
343
343
|
isDefault: !1
|
|
344
344
|
});
|
|
345
|
-
|
|
346
|
-
const
|
|
347
|
-
...
|
|
348
|
-
isDefault: !
|
|
345
|
+
s(f || []);
|
|
346
|
+
const h = {
|
|
347
|
+
...m,
|
|
348
|
+
isDefault: !m.isDefault
|
|
349
349
|
};
|
|
350
|
-
await xt(l.apiServiceUrl,
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
const
|
|
354
|
-
...
|
|
350
|
+
await xt(l.apiServiceUrl, h, u == null ? void 0 : u.accessToken);
|
|
351
|
+
const d = a == null ? void 0 : a.find((r) => r.isDefault);
|
|
352
|
+
if (d && d.id !== m.id) {
|
|
353
|
+
const r = {
|
|
354
|
+
...d,
|
|
355
355
|
isDefault: !1
|
|
356
356
|
};
|
|
357
|
-
await xt(l.apiServiceUrl,
|
|
357
|
+
await xt(l.apiServiceUrl, r, u == null ? void 0 : u.accessToken);
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
return /* @__PURE__ */ c(T, { children: [
|
|
@@ -363,31 +363,31 @@ function zn({ includeLabel: t = !1 } = {}) {
|
|
|
363
363
|
/* @__PURE__ */ e(Te, {})
|
|
364
364
|
] }) : null,
|
|
365
365
|
/* @__PURE__ */ c(
|
|
366
|
-
|
|
366
|
+
Ss,
|
|
367
367
|
{
|
|
368
368
|
value: n,
|
|
369
|
-
onValueChange:
|
|
369
|
+
onValueChange: p,
|
|
370
370
|
children: [
|
|
371
371
|
/* @__PURE__ */ e(aa, { value: "original", children: "Original" }),
|
|
372
|
-
|
|
372
|
+
a == null ? void 0 : a.map((m) => /* @__PURE__ */ c(
|
|
373
373
|
aa,
|
|
374
374
|
{
|
|
375
375
|
className: "group flex justify-between gap-2",
|
|
376
|
-
value:
|
|
376
|
+
value: m.id,
|
|
377
377
|
children: [
|
|
378
|
-
/* @__PURE__ */ e("p", { children:
|
|
378
|
+
/* @__PURE__ */ e("p", { children: m.name }),
|
|
379
379
|
/* @__PURE__ */ c("span", { className: "flex items-center gap-3", children: [
|
|
380
380
|
/* @__PURE__ */ e(
|
|
381
381
|
fa,
|
|
382
382
|
{
|
|
383
|
-
onClick: (
|
|
384
|
-
|
|
383
|
+
onClick: (f) => {
|
|
384
|
+
f.preventDefault(), v(m);
|
|
385
385
|
},
|
|
386
|
-
className:
|
|
386
|
+
className: J(
|
|
387
387
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
388
388
|
{
|
|
389
|
-
invisible: !
|
|
390
|
-
"text-green-500":
|
|
389
|
+
invisible: !m.isDefault,
|
|
390
|
+
"text-green-500": m.isDefault
|
|
391
391
|
}
|
|
392
392
|
),
|
|
393
393
|
strokeWidth: 1.5
|
|
@@ -396,8 +396,8 @@ function zn({ includeLabel: t = !1 } = {}) {
|
|
|
396
396
|
/* @__PURE__ */ e(
|
|
397
397
|
ga,
|
|
398
398
|
{
|
|
399
|
-
onClick: (
|
|
400
|
-
|
|
399
|
+
onClick: (f) => {
|
|
400
|
+
f.preventDefault(), g(m.id);
|
|
401
401
|
},
|
|
402
402
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
403
403
|
strokeWidth: 1.5
|
|
@@ -406,138 +406,138 @@ function zn({ includeLabel: t = !1 } = {}) {
|
|
|
406
406
|
] })
|
|
407
407
|
]
|
|
408
408
|
},
|
|
409
|
-
|
|
409
|
+
m.id
|
|
410
410
|
))
|
|
411
411
|
]
|
|
412
412
|
}
|
|
413
413
|
)
|
|
414
414
|
] });
|
|
415
415
|
}
|
|
416
|
-
function
|
|
417
|
-
const { displayPreferences: t, shouldShowElement:
|
|
416
|
+
function Hn() {
|
|
417
|
+
const { displayPreferences: t, shouldShowElement: a } = ws(), { currentUser: n, userContext: s } = Dt(), i = F(
|
|
418
418
|
() => Ds(n),
|
|
419
419
|
[n]
|
|
420
|
-
),
|
|
420
|
+
), u = F(() => (p) => i && i[p] !== void 0 && i[p] === !1 ? !1 : a(p), [i, a, t]), l = F(
|
|
421
421
|
() => {
|
|
422
|
-
var
|
|
422
|
+
var p, g, v, m, f;
|
|
423
423
|
return {
|
|
424
|
-
canEdit: ((
|
|
425
|
-
canUseFilters: ((
|
|
426
|
-
canManageDashboards: ((v =
|
|
427
|
-
canCreateDashboards: ((
|
|
428
|
-
canAccessVisuals: ((
|
|
424
|
+
canEdit: ((p = s == null ? void 0 : s.permissions) == null ? void 0 : p.canEdit) ?? Ls(n),
|
|
425
|
+
canUseFilters: ((g = s == null ? void 0 : s.permissions) == null ? void 0 : g.canEdit) ?? As(n),
|
|
426
|
+
canManageDashboards: ((v = s == null ? void 0 : s.permissions) == null ? void 0 : v.canCreateDashboard) ?? Is(n),
|
|
427
|
+
canCreateDashboards: ((m = s == null ? void 0 : s.permissions) == null ? void 0 : m.canCreateDashboard) ?? Es(n),
|
|
428
|
+
canAccessVisuals: ((f = s == null ? void 0 : s.permissions) == null ? void 0 : f.canEdit) ?? Cs(n)
|
|
429
429
|
};
|
|
430
430
|
},
|
|
431
|
-
[n,
|
|
431
|
+
[n, s]
|
|
432
432
|
);
|
|
433
433
|
return {
|
|
434
434
|
displayPreferences: t,
|
|
435
|
-
shouldShowElement:
|
|
435
|
+
shouldShowElement: u,
|
|
436
436
|
permissions: l,
|
|
437
437
|
currentUser: n
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
|
-
const
|
|
441
|
-
const
|
|
442
|
-
return await ua(
|
|
443
|
-
},
|
|
444
|
-
const
|
|
445
|
-
await da(
|
|
446
|
-
},
|
|
447
|
-
const
|
|
448
|
-
return await ua(
|
|
449
|
-
},
|
|
450
|
-
const
|
|
451
|
-
await da(
|
|
440
|
+
const jn = async (t, a, n) => {
|
|
441
|
+
const s = `${t}/management/v1/groups`;
|
|
442
|
+
return await ua(s, a, n);
|
|
443
|
+
}, Kn = async (t, a, n) => {
|
|
444
|
+
const s = `${t}/management/v1/groups/${n}`;
|
|
445
|
+
await da(s, a, "DELETE");
|
|
446
|
+
}, Qn = async (t, a, n, s) => {
|
|
447
|
+
const i = `${t}/management/v1/groups/${n}/members`;
|
|
448
|
+
return await ua(i, a, s);
|
|
449
|
+
}, Wn = async (t, a, n, s) => {
|
|
450
|
+
const i = `${t}/management/v1/groups/${n}/members`;
|
|
451
|
+
await da(i, a, "DELETE", s);
|
|
452
452
|
};
|
|
453
|
-
function
|
|
454
|
-
const { authToken: t, tokenProps:
|
|
453
|
+
function Jn() {
|
|
454
|
+
const { authToken: t, tokenProps: a } = j(), n = qe();
|
|
455
455
|
return Be({
|
|
456
|
-
mutationFn: (
|
|
456
|
+
mutationFn: (s) => jn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s),
|
|
457
457
|
onSuccess: () => {
|
|
458
|
-
n.invalidateQueries({ queryKey: ["groups"] }),
|
|
458
|
+
n.invalidateQueries({ queryKey: ["groups"] }), A.success("Group created successfully");
|
|
459
459
|
},
|
|
460
|
-
onError: (
|
|
461
|
-
console.error("Failed to create group:",
|
|
462
|
-
description: Re(
|
|
460
|
+
onError: (s) => {
|
|
461
|
+
console.error("Failed to create group:", s), A.error("Failed to create group", {
|
|
462
|
+
description: Re(s, "Failed to create group")
|
|
463
463
|
});
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
|
-
function
|
|
468
|
-
const { authToken: t, tokenProps:
|
|
467
|
+
function Yn() {
|
|
468
|
+
const { authToken: t, tokenProps: a } = j(), n = qe();
|
|
469
469
|
return Be({
|
|
470
|
-
mutationFn: (
|
|
471
|
-
onSuccess: (
|
|
472
|
-
n.invalidateQueries({ queryKey: ["groups"] }), n.removeQueries({ queryKey: ["group",
|
|
470
|
+
mutationFn: (s) => Kn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s),
|
|
471
|
+
onSuccess: (s, i) => {
|
|
472
|
+
n.invalidateQueries({ queryKey: ["groups"] }), n.removeQueries({ queryKey: ["group", i] }), A.success("Group deleted successfully");
|
|
473
473
|
},
|
|
474
|
-
onError: (
|
|
475
|
-
console.error("Failed to delete group:",
|
|
476
|
-
description: Re(
|
|
474
|
+
onError: (s) => {
|
|
475
|
+
console.error("Failed to delete group:", s), A.error("Failed to delete group", {
|
|
476
|
+
description: Re(s, "Failed to delete group")
|
|
477
477
|
});
|
|
478
478
|
}
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
const { authToken: t, tokenProps:
|
|
481
|
+
function Xn() {
|
|
482
|
+
const { authToken: t, tokenProps: a } = j(), n = qe();
|
|
483
483
|
return Be({
|
|
484
484
|
mutationFn: ({
|
|
485
|
-
groupId:
|
|
486
|
-
data:
|
|
487
|
-
}) =>
|
|
488
|
-
onSuccess: (
|
|
489
|
-
n.invalidateQueries({ queryKey: ["group",
|
|
490
|
-
queryKey: ["group-members",
|
|
491
|
-
}), n.invalidateQueries({ queryKey: ["groups"] }),
|
|
485
|
+
groupId: s,
|
|
486
|
+
data: i
|
|
487
|
+
}) => Qn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s, i),
|
|
488
|
+
onSuccess: (s, i) => {
|
|
489
|
+
n.invalidateQueries({ queryKey: ["group", i.groupId] }), n.invalidateQueries({
|
|
490
|
+
queryKey: ["group-members", i.groupId]
|
|
491
|
+
}), n.invalidateQueries({ queryKey: ["groups"] }), A.success("Members added successfully");
|
|
492
492
|
},
|
|
493
|
-
onError: (
|
|
494
|
-
console.error("Failed to add group members:",
|
|
495
|
-
description: Re(
|
|
493
|
+
onError: (s) => {
|
|
494
|
+
console.error("Failed to add group members:", s), A.error("Failed to add members", {
|
|
495
|
+
description: Re(s, "Failed to add members")
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
|
-
function
|
|
501
|
-
const { authToken: t, tokenProps:
|
|
500
|
+
function Zn() {
|
|
501
|
+
const { authToken: t, tokenProps: a } = j(), n = qe();
|
|
502
502
|
return Be({
|
|
503
503
|
mutationFn: ({
|
|
504
|
-
groupId:
|
|
505
|
-
data:
|
|
506
|
-
}) =>
|
|
507
|
-
onSuccess: (
|
|
508
|
-
n.invalidateQueries({ queryKey: ["group",
|
|
509
|
-
queryKey: ["group-members",
|
|
510
|
-
}), n.invalidateQueries({ queryKey: ["groups"] }),
|
|
504
|
+
groupId: s,
|
|
505
|
+
data: i
|
|
506
|
+
}) => Wn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", s, i),
|
|
507
|
+
onSuccess: (s, i) => {
|
|
508
|
+
n.invalidateQueries({ queryKey: ["group", i.groupId] }), n.invalidateQueries({
|
|
509
|
+
queryKey: ["group-members", i.groupId]
|
|
510
|
+
}), n.invalidateQueries({ queryKey: ["groups"] }), A.success("Members removed successfully");
|
|
511
511
|
},
|
|
512
|
-
onError: (
|
|
513
|
-
console.error("Failed to remove group members:",
|
|
514
|
-
description: Re(
|
|
512
|
+
onError: (s) => {
|
|
513
|
+
console.error("Failed to remove group members:", s), A.error("Failed to remove members", {
|
|
514
|
+
description: Re(s, "Failed to remove members")
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
517
|
});
|
|
518
518
|
}
|
|
519
519
|
const ia = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
520
|
-
function
|
|
520
|
+
function er({
|
|
521
521
|
onSuccess: t,
|
|
522
|
-
tenantId:
|
|
522
|
+
tenantId: a,
|
|
523
523
|
isTenantUser: n
|
|
524
524
|
}) {
|
|
525
|
-
const [
|
|
526
|
-
const
|
|
527
|
-
return
|
|
525
|
+
const [s, i] = N(""), [u, l] = N(""), [p, g] = N({}), v = Jn(), m = () => {
|
|
526
|
+
const h = {};
|
|
527
|
+
return s.trim() ? s.length < 3 ? h.name = "Group name must be at least 3 characters" : s.length > 50 && (h.name = "Group name must be less than 50 characters") : h.name = "Group name is required", u && u.length > 200 && (h.description = "Description must be less than 200 characters"), g(h), Object.keys(h).length === 0;
|
|
528
528
|
};
|
|
529
|
-
return /* @__PURE__ */ c("form", { onSubmit: async (
|
|
530
|
-
if (
|
|
531
|
-
const
|
|
532
|
-
name:
|
|
533
|
-
description:
|
|
529
|
+
return /* @__PURE__ */ c("form", { onSubmit: async (h) => {
|
|
530
|
+
if (h.preventDefault(), !m()) return;
|
|
531
|
+
const d = {
|
|
532
|
+
name: s.trim(),
|
|
533
|
+
description: u.trim() || void 0,
|
|
534
534
|
type: n ? "TENANT_GROUP" : "ORG_GROUP",
|
|
535
|
-
...n &&
|
|
535
|
+
...n && a ? { tenantId: a } : {}
|
|
536
536
|
};
|
|
537
537
|
try {
|
|
538
|
-
await v.mutateAsync(
|
|
539
|
-
} catch (
|
|
540
|
-
console.error("Failed to create group:",
|
|
538
|
+
await v.mutateAsync(d), i(""), l(""), g({}), t();
|
|
539
|
+
} catch (r) {
|
|
540
|
+
console.error("Failed to create group:", r);
|
|
541
541
|
}
|
|
542
542
|
}, className: "space-y-4", children: [
|
|
543
543
|
/* @__PURE__ */ c("div", { className: "space-y-1.5", children: [
|
|
@@ -551,34 +551,34 @@ function Xn({
|
|
|
551
551
|
id: "group-name",
|
|
552
552
|
size: "xs",
|
|
553
553
|
placeholder: "e.g., Marketing Team, Engineering Squad",
|
|
554
|
-
value:
|
|
555
|
-
onChange: (
|
|
556
|
-
|
|
554
|
+
value: s,
|
|
555
|
+
onChange: (h) => {
|
|
556
|
+
i(h.target.value), p.name && g((d) => ({ ...d, name: "" }));
|
|
557
557
|
},
|
|
558
|
-
className:
|
|
558
|
+
className: p.name ? "border-destructive" : "",
|
|
559
559
|
disabled: v.isPending
|
|
560
560
|
}
|
|
561
561
|
),
|
|
562
|
-
|
|
562
|
+
p.name && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: p.name })
|
|
563
563
|
] }),
|
|
564
564
|
/* @__PURE__ */ c("div", { className: "space-y-1.5", children: [
|
|
565
565
|
/* @__PURE__ */ e(dt, { htmlFor: "group-description", className: ia, children: "Description (optional)" }),
|
|
566
566
|
/* @__PURE__ */ e(
|
|
567
|
-
|
|
567
|
+
Ms,
|
|
568
568
|
{
|
|
569
569
|
id: "group-description",
|
|
570
570
|
placeholder: "Describe the purpose of this group…",
|
|
571
|
-
value:
|
|
572
|
-
onChange: (
|
|
573
|
-
l(
|
|
571
|
+
value: u,
|
|
572
|
+
onChange: (h) => {
|
|
573
|
+
l(h.target.value), p.description && g((d) => ({ ...d, description: "" }));
|
|
574
574
|
},
|
|
575
|
-
className: `text-[13px] ${
|
|
575
|
+
className: `text-[13px] ${p.description ? "border-destructive" : ""}`,
|
|
576
576
|
disabled: v.isPending,
|
|
577
577
|
rows: 3
|
|
578
578
|
}
|
|
579
579
|
),
|
|
580
|
-
|
|
581
|
-
|
|
580
|
+
p.description ? /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: p.description }) : /* @__PURE__ */ c("p", { className: "text-[11px] text-muted-foreground", children: [
|
|
581
|
+
u.length,
|
|
582
582
|
"/200"
|
|
583
583
|
] })
|
|
584
584
|
] }),
|
|
@@ -588,26 +588,26 @@ function Xn({
|
|
|
588
588
|
] }),
|
|
589
589
|
/* @__PURE__ */ c("div", { className: "flex justify-end gap-1.5 pt-1", children: [
|
|
590
590
|
/* @__PURE__ */ e(
|
|
591
|
-
|
|
591
|
+
L,
|
|
592
592
|
{
|
|
593
593
|
type: "button",
|
|
594
594
|
variant: "outline",
|
|
595
595
|
size: "xs",
|
|
596
596
|
onClick: () => {
|
|
597
|
-
|
|
597
|
+
i(""), l(""), g({});
|
|
598
598
|
},
|
|
599
599
|
disabled: v.isPending,
|
|
600
600
|
children: "Clear"
|
|
601
601
|
}
|
|
602
602
|
),
|
|
603
603
|
/* @__PURE__ */ e(
|
|
604
|
-
|
|
604
|
+
L,
|
|
605
605
|
{
|
|
606
606
|
type: "submit",
|
|
607
607
|
size: "xs",
|
|
608
|
-
disabled: v.isPending || !
|
|
608
|
+
disabled: v.isPending || !s.trim(),
|
|
609
609
|
children: v.isPending ? /* @__PURE__ */ c(T, { children: [
|
|
610
|
-
/* @__PURE__ */ e(
|
|
610
|
+
/* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
611
611
|
"Creating…"
|
|
612
612
|
] }) : "Create group"
|
|
613
613
|
}
|
|
@@ -615,59 +615,59 @@ function Xn({
|
|
|
615
615
|
] })
|
|
616
616
|
] });
|
|
617
617
|
}
|
|
618
|
-
function
|
|
618
|
+
function tr(t, a = []) {
|
|
619
619
|
let n = [];
|
|
620
|
-
function
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
const
|
|
620
|
+
function s(u, l) {
|
|
621
|
+
const p = M.createContext(l);
|
|
622
|
+
p.displayName = u + "Context";
|
|
623
|
+
const g = n.length;
|
|
624
624
|
n = [...n, l];
|
|
625
|
-
const v = (
|
|
625
|
+
const v = (f) => {
|
|
626
626
|
var w;
|
|
627
|
-
const { scope:
|
|
628
|
-
return /* @__PURE__ */ e(b.Provider, { value:
|
|
627
|
+
const { scope: h, children: d, ...r } = f, b = ((w = h == null ? void 0 : h[t]) == null ? void 0 : w[g]) || p, D = M.useMemo(() => r, Object.values(r));
|
|
628
|
+
return /* @__PURE__ */ e(b.Provider, { value: D, children: d });
|
|
629
629
|
};
|
|
630
|
-
v.displayName =
|
|
631
|
-
function
|
|
630
|
+
v.displayName = u + "Provider";
|
|
631
|
+
function m(f, h) {
|
|
632
632
|
var b;
|
|
633
|
-
const
|
|
634
|
-
if (
|
|
633
|
+
const d = ((b = h == null ? void 0 : h[t]) == null ? void 0 : b[g]) || p, r = M.useContext(d);
|
|
634
|
+
if (r) return r;
|
|
635
635
|
if (l !== void 0) return l;
|
|
636
|
-
throw new Error(`\`${
|
|
636
|
+
throw new Error(`\`${f}\` must be used within \`${u}\``);
|
|
637
637
|
}
|
|
638
|
-
return [v,
|
|
638
|
+
return [v, m];
|
|
639
639
|
}
|
|
640
|
-
const
|
|
641
|
-
const
|
|
642
|
-
return function(
|
|
643
|
-
const
|
|
644
|
-
return
|
|
645
|
-
() => ({ [`__scope${t}`]: { ...
|
|
646
|
-
[
|
|
640
|
+
const i = () => {
|
|
641
|
+
const u = n.map((l) => M.createContext(l));
|
|
642
|
+
return function(p) {
|
|
643
|
+
const g = (p == null ? void 0 : p[t]) || u;
|
|
644
|
+
return M.useMemo(
|
|
645
|
+
() => ({ [`__scope${t}`]: { ...p, [t]: g } }),
|
|
646
|
+
[p, g]
|
|
647
647
|
);
|
|
648
648
|
};
|
|
649
649
|
};
|
|
650
|
-
return
|
|
650
|
+
return i.scopeName = t, [s, ar(i, ...a)];
|
|
651
651
|
}
|
|
652
|
-
function
|
|
653
|
-
const
|
|
654
|
-
if (t.length === 1) return
|
|
652
|
+
function ar(...t) {
|
|
653
|
+
const a = t[0];
|
|
654
|
+
if (t.length === 1) return a;
|
|
655
655
|
const n = () => {
|
|
656
|
-
const
|
|
657
|
-
useScope:
|
|
658
|
-
scopeName:
|
|
656
|
+
const s = t.map((i) => ({
|
|
657
|
+
useScope: i(),
|
|
658
|
+
scopeName: i.scopeName
|
|
659
659
|
}));
|
|
660
|
-
return function(
|
|
661
|
-
const l =
|
|
662
|
-
const
|
|
663
|
-
return { ...
|
|
660
|
+
return function(u) {
|
|
661
|
+
const l = s.reduce((p, { useScope: g, scopeName: v }) => {
|
|
662
|
+
const f = g(u)[`__scope${v}`];
|
|
663
|
+
return { ...p, ...f };
|
|
664
664
|
}, {});
|
|
665
|
-
return
|
|
665
|
+
return M.useMemo(() => ({ [`__scope${a.scopeName}`]: l }), [l]);
|
|
666
666
|
};
|
|
667
667
|
};
|
|
668
|
-
return n.scopeName =
|
|
668
|
+
return n.scopeName = a.scopeName, n;
|
|
669
669
|
}
|
|
670
|
-
var
|
|
670
|
+
var sr = [
|
|
671
671
|
"a",
|
|
672
672
|
"button",
|
|
673
673
|
"div",
|
|
@@ -685,135 +685,135 @@ var tr = [
|
|
|
685
685
|
"span",
|
|
686
686
|
"svg",
|
|
687
687
|
"ul"
|
|
688
|
-
], Et =
|
|
689
|
-
const n = ds(`Primitive.${
|
|
690
|
-
const { asChild: l, ...
|
|
691
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(
|
|
688
|
+
], Et = sr.reduce((t, a) => {
|
|
689
|
+
const n = ds(`Primitive.${a}`), s = M.forwardRef((i, u) => {
|
|
690
|
+
const { asChild: l, ...p } = i, g = l ? n : a;
|
|
691
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(g, { ...p, ref: u });
|
|
692
692
|
});
|
|
693
|
-
return
|
|
693
|
+
return s.displayName = `Primitive.${a}`, { ...t, [a]: s };
|
|
694
694
|
}, {});
|
|
695
|
-
function
|
|
696
|
-
return
|
|
697
|
-
|
|
695
|
+
function nr() {
|
|
696
|
+
return Rn.useSyncExternalStore(
|
|
697
|
+
rr,
|
|
698
698
|
() => !0,
|
|
699
699
|
() => !1
|
|
700
700
|
);
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function rr() {
|
|
703
703
|
return () => {
|
|
704
704
|
};
|
|
705
705
|
}
|
|
706
|
-
var It = "Avatar", [
|
|
707
|
-
(t,
|
|
708
|
-
const { __scopeAvatar: n, ...
|
|
706
|
+
var It = "Avatar", [or] = tr(It), [ir, Ia] = or(It), Aa = M.forwardRef(
|
|
707
|
+
(t, a) => {
|
|
708
|
+
const { __scopeAvatar: n, ...s } = t, [i, u] = M.useState("idle");
|
|
709
709
|
return /* @__PURE__ */ e(
|
|
710
|
-
|
|
710
|
+
ir,
|
|
711
711
|
{
|
|
712
712
|
scope: n,
|
|
713
|
-
imageLoadingStatus:
|
|
714
|
-
onImageLoadingStatusChange:
|
|
715
|
-
children: /* @__PURE__ */ e(Et.span, { ...
|
|
713
|
+
imageLoadingStatus: i,
|
|
714
|
+
onImageLoadingStatusChange: u,
|
|
715
|
+
children: /* @__PURE__ */ e(Et.span, { ...s, ref: a })
|
|
716
716
|
}
|
|
717
717
|
);
|
|
718
718
|
}
|
|
719
719
|
);
|
|
720
|
-
|
|
721
|
-
var
|
|
722
|
-
(t,
|
|
723
|
-
const { __scopeAvatar: n, src:
|
|
724
|
-
}, ...
|
|
725
|
-
|
|
720
|
+
Aa.displayName = It;
|
|
721
|
+
var La = "AvatarImage", Ma = M.forwardRef(
|
|
722
|
+
(t, a) => {
|
|
723
|
+
const { __scopeAvatar: n, src: s, onLoadingStatusChange: i = () => {
|
|
724
|
+
}, ...u } = t, l = Ia(La, n), p = cr(s, u), g = us((v) => {
|
|
725
|
+
i(v), l.onImageLoadingStatusChange(v);
|
|
726
726
|
});
|
|
727
727
|
return ut(() => {
|
|
728
|
-
|
|
729
|
-
}, [
|
|
728
|
+
p !== "idle" && g(p);
|
|
729
|
+
}, [p, g]), p === "loaded" ? /* @__PURE__ */ e(Et.img, { ...u, ref: a, src: s }) : null;
|
|
730
730
|
}
|
|
731
731
|
);
|
|
732
|
-
|
|
733
|
-
var Oa = "AvatarFallback", ka =
|
|
734
|
-
(t,
|
|
735
|
-
const { __scopeAvatar: n, delayMs:
|
|
736
|
-
return
|
|
737
|
-
if (
|
|
738
|
-
const
|
|
739
|
-
return () => window.clearTimeout(
|
|
732
|
+
Ma.displayName = La;
|
|
733
|
+
var Oa = "AvatarFallback", ka = M.forwardRef(
|
|
734
|
+
(t, a) => {
|
|
735
|
+
const { __scopeAvatar: n, delayMs: s, ...i } = t, u = Ia(Oa, n), [l, p] = M.useState(s === void 0);
|
|
736
|
+
return M.useEffect(() => {
|
|
737
|
+
if (s !== void 0) {
|
|
738
|
+
const g = window.setTimeout(() => p(!0), s);
|
|
739
|
+
return () => window.clearTimeout(g);
|
|
740
740
|
}
|
|
741
|
-
}, [
|
|
741
|
+
}, [s]), l && u.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Et.span, { ...i, ref: a }) : null;
|
|
742
742
|
}
|
|
743
743
|
);
|
|
744
744
|
ka.displayName = Oa;
|
|
745
|
-
function ca(t,
|
|
746
|
-
return t ?
|
|
745
|
+
function ca(t, a) {
|
|
746
|
+
return t ? a ? (t.src !== a && (t.src = a), t.complete && t.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
747
747
|
}
|
|
748
|
-
function
|
|
749
|
-
const
|
|
750
|
-
() => ca(
|
|
748
|
+
function cr(t, { referrerPolicy: a, crossOrigin: n }) {
|
|
749
|
+
const s = nr(), i = M.useRef(null), u = s ? (i.current || (i.current = new window.Image()), i.current) : null, [l, p] = M.useState(
|
|
750
|
+
() => ca(u, t)
|
|
751
751
|
);
|
|
752
752
|
return ut(() => {
|
|
753
|
-
|
|
754
|
-
}, [
|
|
755
|
-
const
|
|
756
|
-
|
|
753
|
+
p(ca(u, t));
|
|
754
|
+
}, [u, t]), ut(() => {
|
|
755
|
+
const g = (f) => () => {
|
|
756
|
+
p(f);
|
|
757
757
|
};
|
|
758
|
-
if (!
|
|
759
|
-
const v =
|
|
760
|
-
return
|
|
761
|
-
|
|
758
|
+
if (!u) return;
|
|
759
|
+
const v = g("loaded"), m = g("error");
|
|
760
|
+
return u.addEventListener("load", v), u.addEventListener("error", m), a && (u.referrerPolicy = a), typeof n == "string" && (u.crossOrigin = n), () => {
|
|
761
|
+
u.removeEventListener("load", v), u.removeEventListener("error", m);
|
|
762
762
|
};
|
|
763
|
-
}, [
|
|
763
|
+
}, [u, n, a]), l;
|
|
764
764
|
}
|
|
765
|
-
var Pa =
|
|
766
|
-
const
|
|
765
|
+
var Pa = Aa, Ta = Ma, _a = ka;
|
|
766
|
+
const At = M.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
767
767
|
Pa,
|
|
768
768
|
{
|
|
769
769
|
ref: n,
|
|
770
|
-
className:
|
|
770
|
+
className: J(
|
|
771
771
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
772
772
|
t
|
|
773
773
|
),
|
|
774
|
-
...
|
|
774
|
+
...a
|
|
775
775
|
}
|
|
776
776
|
));
|
|
777
|
-
|
|
778
|
-
const
|
|
777
|
+
At.displayName = Pa.displayName;
|
|
778
|
+
const lr = M.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
779
779
|
Ta,
|
|
780
780
|
{
|
|
781
781
|
ref: n,
|
|
782
|
-
className:
|
|
783
|
-
...
|
|
782
|
+
className: J("aspect-square h-full w-full", t),
|
|
783
|
+
...a
|
|
784
784
|
}
|
|
785
785
|
));
|
|
786
|
-
|
|
787
|
-
const
|
|
786
|
+
lr.displayName = Ta.displayName;
|
|
787
|
+
const Lt = M.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
788
788
|
_a,
|
|
789
789
|
{
|
|
790
790
|
ref: n,
|
|
791
|
-
className:
|
|
791
|
+
className: J(
|
|
792
792
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
793
793
|
t
|
|
794
794
|
),
|
|
795
|
-
...
|
|
795
|
+
...a
|
|
796
796
|
}
|
|
797
797
|
));
|
|
798
|
-
|
|
799
|
-
function
|
|
798
|
+
Lt.displayName = _a.displayName;
|
|
799
|
+
function dr({
|
|
800
800
|
open: t,
|
|
801
|
-
onOpenChange:
|
|
801
|
+
onOpenChange: a,
|
|
802
802
|
group: n,
|
|
803
|
-
onUpdate:
|
|
803
|
+
onUpdate: s
|
|
804
804
|
}) {
|
|
805
|
-
const [
|
|
805
|
+
const [i, u] = N("members"), [l, p] = N(""), [g, v] = N([]), [m, f] = N([]), { data: h, isLoading: d, refetch: r } = Os(n.id), b = n.type === "TENANT_GROUP" ? "tenant" : "organization", { users: D, isLoading: w } = ks({
|
|
806
806
|
type: b,
|
|
807
807
|
tenantId: n.tenantId || void 0,
|
|
808
808
|
active: !0,
|
|
809
809
|
limit: 100
|
|
810
|
-
}),
|
|
810
|
+
}), C = Xn(), E = Zn(), O = (h == null ? void 0 : h.members) || [], I = F(() => new Set(O.map((y) => y.userId)), [O]), V = F(() => D.filter((y) => !I.has(y.id)), [D, I]), z = F(() => {
|
|
811
811
|
if (!l) return V;
|
|
812
812
|
const y = l.toLowerCase();
|
|
813
813
|
return V.filter(
|
|
814
814
|
(k) => {
|
|
815
|
-
var G,
|
|
816
|
-
return ((G = k.name) == null ? void 0 : G.toLowerCase().includes(y)) || ((
|
|
815
|
+
var G, H;
|
|
816
|
+
return ((G = k.name) == null ? void 0 : G.toLowerCase().includes(y)) || ((H = k.email) == null ? void 0 : H.toLowerCase().includes(y));
|
|
817
817
|
}
|
|
818
818
|
);
|
|
819
819
|
}, [V, l]), x = F(() => {
|
|
@@ -821,45 +821,45 @@ function cr({
|
|
|
821
821
|
const y = l.toLowerCase();
|
|
822
822
|
return O.filter(
|
|
823
823
|
(k) => {
|
|
824
|
-
var G,
|
|
825
|
-
return ((
|
|
824
|
+
var G, H, me, te;
|
|
825
|
+
return ((H = (G = k.user) == null ? void 0 : G.name) == null ? void 0 : H.toLowerCase().includes(y)) || ((te = (me = k.user) == null ? void 0 : me.email) == null ? void 0 : te.toLowerCase().includes(y));
|
|
826
826
|
}
|
|
827
827
|
);
|
|
828
828
|
}, [O, l]), B = async () => {
|
|
829
|
-
if (
|
|
829
|
+
if (g.length !== 0)
|
|
830
830
|
try {
|
|
831
|
-
await
|
|
831
|
+
await C.mutateAsync({
|
|
832
832
|
groupId: n.id,
|
|
833
833
|
data: {
|
|
834
|
-
userIds:
|
|
834
|
+
userIds: g,
|
|
835
835
|
userType: b === "tenant" ? "tenant" : "org"
|
|
836
836
|
}
|
|
837
|
-
}), v([]),
|
|
837
|
+
}), v([]), u("members"), r(), s == null || s();
|
|
838
838
|
} catch (y) {
|
|
839
839
|
console.error("Failed to add members:", y);
|
|
840
840
|
}
|
|
841
|
-
},
|
|
842
|
-
if (
|
|
841
|
+
}, Q = async () => {
|
|
842
|
+
if (m.length !== 0)
|
|
843
843
|
try {
|
|
844
844
|
await E.mutateAsync({
|
|
845
845
|
groupId: n.id,
|
|
846
846
|
data: {
|
|
847
|
-
userIds:
|
|
847
|
+
userIds: m
|
|
848
848
|
}
|
|
849
|
-
}),
|
|
849
|
+
}), f([]), r(), s == null || s();
|
|
850
850
|
} catch (y) {
|
|
851
851
|
console.error("Failed to remove members:", y);
|
|
852
852
|
}
|
|
853
|
-
},
|
|
853
|
+
}, Z = (y) => {
|
|
854
854
|
v(
|
|
855
855
|
(k) => k.includes(y) ? k.filter((G) => G !== y) : [...k, y]
|
|
856
856
|
);
|
|
857
857
|
}, ee = (y) => {
|
|
858
|
-
|
|
858
|
+
f(
|
|
859
859
|
(k) => k.includes(y) ? k.filter((G) => G !== y) : [...k, y]
|
|
860
860
|
);
|
|
861
861
|
};
|
|
862
|
-
return /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(Ge, { open: t, onOpenChange:
|
|
862
|
+
return /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(Ge, { open: t, onOpenChange: a, children: /* @__PURE__ */ c($e, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
863
863
|
/* @__PURE__ */ c(Ve, { children: [
|
|
864
864
|
/* @__PURE__ */ e(ze, { children: n.name }),
|
|
865
865
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: [
|
|
@@ -873,8 +873,8 @@ function cr({
|
|
|
873
873
|
" group"
|
|
874
874
|
] })
|
|
875
875
|
] }),
|
|
876
|
-
/* @__PURE__ */ c(ma, { value:
|
|
877
|
-
|
|
876
|
+
/* @__PURE__ */ c(ma, { value: i, onValueChange: (y) => {
|
|
877
|
+
u(y), p(""), f([]);
|
|
878
878
|
}, className: "mt-4", children: [
|
|
879
879
|
/* @__PURE__ */ c(ha, { className: "grid w-full grid-cols-2", children: [
|
|
880
880
|
/* @__PURE__ */ e(_e, { value: "members", children: "Current Members" }),
|
|
@@ -888,40 +888,40 @@ function cr({
|
|
|
888
888
|
{
|
|
889
889
|
placeholder: "Search members...",
|
|
890
890
|
value: l,
|
|
891
|
-
onChange: (y) =>
|
|
891
|
+
onChange: (y) => p(y.target.value),
|
|
892
892
|
className: "pl-10"
|
|
893
893
|
}
|
|
894
894
|
)
|
|
895
895
|
] }),
|
|
896
|
-
/* @__PURE__ */ e(mt, { className:
|
|
896
|
+
/* @__PURE__ */ e(mt, { className: m.length > 0 ? "h-[300px]" : "h-[350px]", children: d ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((y) => /* @__PURE__ */ e(ft, { className: "h-16 w-full" }, y)) }) : x.length === 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
897
897
|
/* @__PURE__ */ e(Ct, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
898
898
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: l ? "No members found" : "No members yet" }),
|
|
899
899
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
|
|
900
900
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: x.map((y) => /* @__PURE__ */ e(
|
|
901
|
-
|
|
901
|
+
ur,
|
|
902
902
|
{
|
|
903
903
|
member: y,
|
|
904
|
-
selected:
|
|
904
|
+
selected: m.includes(y.userId),
|
|
905
905
|
onToggle: () => ee(y.userId)
|
|
906
906
|
},
|
|
907
907
|
y.id
|
|
908
908
|
)) }) }),
|
|
909
|
-
|
|
909
|
+
m.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
910
910
|
/* @__PURE__ */ c("span", { className: "text-sm text-muted-foreground", children: [
|
|
911
|
-
|
|
911
|
+
m.length,
|
|
912
912
|
" member",
|
|
913
|
-
|
|
913
|
+
m.length !== 1 ? "s" : "",
|
|
914
914
|
" selected"
|
|
915
915
|
] }),
|
|
916
916
|
/* @__PURE__ */ e(
|
|
917
|
-
|
|
917
|
+
L,
|
|
918
918
|
{
|
|
919
919
|
variant: "destructive",
|
|
920
920
|
size: "sm",
|
|
921
|
-
onClick:
|
|
921
|
+
onClick: Q,
|
|
922
922
|
disabled: E.isPending,
|
|
923
923
|
children: E.isPending ? /* @__PURE__ */ c(T, { children: [
|
|
924
|
-
/* @__PURE__ */ e(
|
|
924
|
+
/* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
925
925
|
"Removing..."
|
|
926
926
|
] }) : /* @__PURE__ */ c(T, { children: [
|
|
927
927
|
/* @__PURE__ */ e(va, { className: "mr-2 h-4 w-4" }),
|
|
@@ -939,7 +939,7 @@ function cr({
|
|
|
939
939
|
{
|
|
940
940
|
placeholder: "Search users to add...",
|
|
941
941
|
value: l,
|
|
942
|
-
onChange: (y) =>
|
|
942
|
+
onChange: (y) => p(y.target.value),
|
|
943
943
|
className: "pl-10"
|
|
944
944
|
}
|
|
945
945
|
)
|
|
@@ -949,28 +949,28 @@ function cr({
|
|
|
949
949
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
950
950
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "All eligible users are already members" })
|
|
951
951
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: z.map((y) => /* @__PURE__ */ e(
|
|
952
|
-
|
|
952
|
+
mr,
|
|
953
953
|
{
|
|
954
954
|
user: y,
|
|
955
|
-
selected:
|
|
956
|
-
onToggle: () =>
|
|
955
|
+
selected: g.includes(y.id),
|
|
956
|
+
onToggle: () => Z(y.id)
|
|
957
957
|
},
|
|
958
958
|
y.id
|
|
959
959
|
)) }) }),
|
|
960
|
-
|
|
960
|
+
g.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-4 border-t", children: [
|
|
961
961
|
/* @__PURE__ */ c("span", { className: "text-sm text-muted-foreground", children: [
|
|
962
|
-
|
|
962
|
+
g.length,
|
|
963
963
|
" user",
|
|
964
|
-
|
|
964
|
+
g.length !== 1 ? "s" : "",
|
|
965
965
|
" selected"
|
|
966
966
|
] }),
|
|
967
967
|
/* @__PURE__ */ e(
|
|
968
|
-
|
|
968
|
+
L,
|
|
969
969
|
{
|
|
970
970
|
onClick: B,
|
|
971
|
-
disabled:
|
|
972
|
-
children:
|
|
973
|
-
/* @__PURE__ */ e(
|
|
971
|
+
disabled: C.isPending,
|
|
972
|
+
children: C.isPending ? /* @__PURE__ */ c(T, { children: [
|
|
973
|
+
/* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
974
974
|
"Adding..."
|
|
975
975
|
] }) : /* @__PURE__ */ c(T, { children: [
|
|
976
976
|
/* @__PURE__ */ e(gt, { className: "mr-2 h-4 w-4" }),
|
|
@@ -983,44 +983,44 @@ function cr({
|
|
|
983
983
|
] })
|
|
984
984
|
] }) }) });
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function ur({
|
|
987
987
|
member: t,
|
|
988
|
-
selected:
|
|
988
|
+
selected: a,
|
|
989
989
|
onToggle: n
|
|
990
990
|
}) {
|
|
991
|
-
var
|
|
992
|
-
const
|
|
991
|
+
var i, u, l, p;
|
|
992
|
+
const s = ((u = (i = t.user) == null ? void 0 : i.name) == null ? void 0 : u.split(" ").map((g) => g[0]).join("").toUpperCase()) || "?";
|
|
993
993
|
return /* @__PURE__ */ c(
|
|
994
994
|
"div",
|
|
995
995
|
{
|
|
996
996
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
997
997
|
onClick: n,
|
|
998
998
|
children: [
|
|
999
|
-
/* @__PURE__ */ e(ba, { checked:
|
|
1000
|
-
/* @__PURE__ */ e(
|
|
999
|
+
/* @__PURE__ */ e(ba, { checked: a }),
|
|
1000
|
+
/* @__PURE__ */ e(At, { className: "h-8 w-8", children: /* @__PURE__ */ e(Lt, { className: "text-xs", children: s }) }),
|
|
1001
1001
|
/* @__PURE__ */ c("div", { className: "flex-1", children: [
|
|
1002
1002
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((l = t.user) == null ? void 0 : l.name) || "Unknown User" }),
|
|
1003
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (
|
|
1003
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (p = t.user) == null ? void 0 : p.email })
|
|
1004
1004
|
] })
|
|
1005
1005
|
]
|
|
1006
1006
|
}
|
|
1007
1007
|
);
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function mr({
|
|
1010
1010
|
user: t,
|
|
1011
|
-
selected:
|
|
1011
|
+
selected: a,
|
|
1012
1012
|
onToggle: n
|
|
1013
1013
|
}) {
|
|
1014
|
-
var
|
|
1015
|
-
const
|
|
1014
|
+
var i;
|
|
1015
|
+
const s = ((i = t.name) == null ? void 0 : i.split(" ").map((u) => u[0]).join("").toUpperCase()) || "?";
|
|
1016
1016
|
return /* @__PURE__ */ c(
|
|
1017
1017
|
"div",
|
|
1018
1018
|
{
|
|
1019
1019
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1020
1020
|
onClick: n,
|
|
1021
1021
|
children: [
|
|
1022
|
-
/* @__PURE__ */ e(ba, { checked:
|
|
1023
|
-
/* @__PURE__ */ e(
|
|
1022
|
+
/* @__PURE__ */ e(ba, { checked: a }),
|
|
1023
|
+
/* @__PURE__ */ e(At, { className: "h-8 w-8", children: /* @__PURE__ */ e(Lt, { className: "text-xs", children: s }) }),
|
|
1024
1024
|
/* @__PURE__ */ c("div", { className: "flex-1", children: [
|
|
1025
1025
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: t.name }),
|
|
1026
1026
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: t.email })
|
|
@@ -1029,33 +1029,33 @@ function dr({
|
|
|
1029
1029
|
}
|
|
1030
1030
|
);
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function hr({
|
|
1033
1033
|
open: t,
|
|
1034
|
-
onOpenChange:
|
|
1034
|
+
onOpenChange: a
|
|
1035
1035
|
}) {
|
|
1036
|
-
const [n,
|
|
1036
|
+
const [n, s] = N("groups"), [i, u] = N(""), [l, p] = N(null), [g, v] = N(!1), [m, f] = N(null), { tokenProps: h } = j(), { currentUser: d } = Dt(), r = Yn(), b = (d == null ? void 0 : d.type) === "tenant", D = h == null ? void 0 : h.tenantId, { groups: w, isLoading: C, refetch: E } = Ps({
|
|
1037
1037
|
type: b ? "TENANT_GROUP" : "all",
|
|
1038
|
-
tenantId: b ?
|
|
1038
|
+
tenantId: b ? D : void 0,
|
|
1039
1039
|
includeMembers: !1
|
|
1040
1040
|
}), O = w.filter(
|
|
1041
1041
|
(x) => {
|
|
1042
1042
|
var B;
|
|
1043
|
-
return x.name.toLowerCase().includes(
|
|
1043
|
+
return x.name.toLowerCase().includes(i.toLowerCase()) || ((B = x.description) == null ? void 0 : B.toLowerCase().includes(i.toLowerCase()));
|
|
1044
1044
|
}
|
|
1045
1045
|
), I = async () => {
|
|
1046
|
-
if (
|
|
1046
|
+
if (m)
|
|
1047
1047
|
try {
|
|
1048
|
-
await
|
|
1048
|
+
await r.mutateAsync(m.id), f(null), E();
|
|
1049
1049
|
} catch (x) {
|
|
1050
1050
|
console.error("Failed to delete group:", x);
|
|
1051
1051
|
}
|
|
1052
1052
|
}, V = (x) => {
|
|
1053
|
-
|
|
1053
|
+
p(x), v(!0);
|
|
1054
1054
|
}, z = () => {
|
|
1055
|
-
|
|
1055
|
+
s("groups"), E();
|
|
1056
1056
|
};
|
|
1057
1057
|
return /* @__PURE__ */ c(T, { children: [
|
|
1058
|
-
/* @__PURE__ */ e(Ge, { open: t, onOpenChange:
|
|
1058
|
+
/* @__PURE__ */ e(Ge, { open: t, onOpenChange: a, children: /* @__PURE__ */ c($e, { className: "max-h-[80vh] max-w-3xl rounded-[6px] border-border/60 sm:rounded-[6px]", children: [
|
|
1059
1059
|
/* @__PURE__ */ c(Ve, { children: [
|
|
1060
1060
|
/* @__PURE__ */ e(ze, { className: "text-[15px]", children: "Group management" }),
|
|
1061
1061
|
/* @__PURE__ */ e(wt, { className: "text-[13px] leading-5", children: "Manage groups, create new ones, and control membership." })
|
|
@@ -1064,7 +1064,7 @@ function ur({
|
|
|
1064
1064
|
ma,
|
|
1065
1065
|
{
|
|
1066
1066
|
value: n,
|
|
1067
|
-
onValueChange:
|
|
1067
|
+
onValueChange: s,
|
|
1068
1068
|
className: "mt-2",
|
|
1069
1069
|
children: [
|
|
1070
1070
|
/* @__PURE__ */ c(ha, { className: "h-8 w-full justify-start gap-1 bg-transparent p-0 border-b border-border/60 rounded-none", children: [
|
|
@@ -1093,13 +1093,13 @@ function ur({
|
|
|
1093
1093
|
{
|
|
1094
1094
|
size: "xs",
|
|
1095
1095
|
placeholder: "Search groups…",
|
|
1096
|
-
value:
|
|
1097
|
-
onChange: (x) =>
|
|
1096
|
+
value: i,
|
|
1097
|
+
onChange: (x) => u(x.target.value),
|
|
1098
1098
|
className: "pl-7"
|
|
1099
1099
|
}
|
|
1100
1100
|
)
|
|
1101
1101
|
] }),
|
|
1102
|
-
/* @__PURE__ */ e(mt, { className: "h-[400px]", children:
|
|
1102
|
+
/* @__PURE__ */ e(mt, { className: "h-[400px]", children: C ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((x) => /* @__PURE__ */ e(
|
|
1103
1103
|
ft,
|
|
1104
1104
|
{
|
|
1105
1105
|
className: "h-16 w-full rounded-[6px]"
|
|
@@ -1107,23 +1107,23 @@ function ur({
|
|
|
1107
1107
|
x
|
|
1108
1108
|
)) }) : O.length === 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
1109
1109
|
/* @__PURE__ */ e("p", { className: "text-[13px]", children: "No groups found." }),
|
|
1110
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-[12px]", children:
|
|
1110
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-[12px]", children: i ? "Try a different search." : "Create your first group to get started." })
|
|
1111
1111
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2 pr-2", children: O.map((x) => /* @__PURE__ */ e(
|
|
1112
|
-
|
|
1112
|
+
pr,
|
|
1113
1113
|
{
|
|
1114
1114
|
group: x,
|
|
1115
1115
|
onManageMembers: () => V(x),
|
|
1116
|
-
onDelete: () =>
|
|
1117
|
-
currentUserId:
|
|
1116
|
+
onDelete: () => f(x),
|
|
1117
|
+
currentUserId: d == null ? void 0 : d.id
|
|
1118
1118
|
},
|
|
1119
1119
|
x.id
|
|
1120
1120
|
)) }) })
|
|
1121
1121
|
] }) }),
|
|
1122
1122
|
/* @__PURE__ */ e(Ue, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1123
|
-
|
|
1123
|
+
er,
|
|
1124
1124
|
{
|
|
1125
1125
|
onSuccess: z,
|
|
1126
|
-
tenantId:
|
|
1126
|
+
tenantId: D,
|
|
1127
1127
|
isTenantUser: b
|
|
1128
1128
|
}
|
|
1129
1129
|
) })
|
|
@@ -1132,9 +1132,9 @@ function ur({
|
|
|
1132
1132
|
)
|
|
1133
1133
|
] }) }),
|
|
1134
1134
|
l && /* @__PURE__ */ e(
|
|
1135
|
-
|
|
1135
|
+
dr,
|
|
1136
1136
|
{
|
|
1137
|
-
open:
|
|
1137
|
+
open: g,
|
|
1138
1138
|
onOpenChange: v,
|
|
1139
1139
|
group: l,
|
|
1140
1140
|
onUpdate: () => E()
|
|
@@ -1143,14 +1143,14 @@ function ur({
|
|
|
1143
1143
|
/* @__PURE__ */ e(
|
|
1144
1144
|
ya,
|
|
1145
1145
|
{
|
|
1146
|
-
open: !!
|
|
1147
|
-
onOpenChange: () =>
|
|
1146
|
+
open: !!m,
|
|
1147
|
+
onOpenChange: () => f(null),
|
|
1148
1148
|
children: /* @__PURE__ */ c(xa, { children: [
|
|
1149
|
-
/* @__PURE__ */ c(
|
|
1150
|
-
/* @__PURE__ */ e(
|
|
1149
|
+
/* @__PURE__ */ c(Na, { children: [
|
|
1150
|
+
/* @__PURE__ */ e(Sa, { children: "Delete group" }),
|
|
1151
1151
|
/* @__PURE__ */ c(wa, { children: [
|
|
1152
1152
|
'Delete "',
|
|
1153
|
-
|
|
1153
|
+
m == null ? void 0 : m.name,
|
|
1154
1154
|
`"? This removes all members and can't be undone.`
|
|
1155
1155
|
] })
|
|
1156
1156
|
] }),
|
|
@@ -1160,10 +1160,10 @@ function ur({
|
|
|
1160
1160
|
vt,
|
|
1161
1161
|
{
|
|
1162
1162
|
onClick: I,
|
|
1163
|
-
disabled:
|
|
1163
|
+
disabled: r.isPending,
|
|
1164
1164
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1165
|
-
children:
|
|
1166
|
-
/* @__PURE__ */ e(
|
|
1165
|
+
children: r.isPending ? /* @__PURE__ */ c(T, { children: [
|
|
1166
|
+
/* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1167
1167
|
"Deleting…"
|
|
1168
1168
|
] }) : "Delete group"
|
|
1169
1169
|
}
|
|
@@ -1174,13 +1174,13 @@ function ur({
|
|
|
1174
1174
|
)
|
|
1175
1175
|
] });
|
|
1176
1176
|
}
|
|
1177
|
-
function
|
|
1177
|
+
function pr({
|
|
1178
1178
|
group: t,
|
|
1179
|
-
onManageMembers:
|
|
1179
|
+
onManageMembers: a,
|
|
1180
1180
|
onDelete: n,
|
|
1181
|
-
currentUserId:
|
|
1181
|
+
currentUserId: s
|
|
1182
1182
|
}) {
|
|
1183
|
-
const
|
|
1183
|
+
const i = t.createdBy === s;
|
|
1184
1184
|
return /* @__PURE__ */ e("div", { className: "rounded-[6px] border border-border/60 bg-card px-3 py-2.5 transition-colors hover:bg-muted/30", children: /* @__PURE__ */ c("div", { className: "flex items-start justify-between gap-2", children: [
|
|
1185
1185
|
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
1186
1186
|
/* @__PURE__ */ e("h4", { className: "text-[13px] font-medium text-foreground", children: t.name }),
|
|
@@ -1194,25 +1194,25 @@ function mr({
|
|
|
1194
1194
|
] }),
|
|
1195
1195
|
/* @__PURE__ */ c("span", { children: [
|
|
1196
1196
|
"Created ",
|
|
1197
|
-
|
|
1197
|
+
Sn(new Date(t.createdAt), "MMM d, yyyy")
|
|
1198
1198
|
] })
|
|
1199
1199
|
] })
|
|
1200
1200
|
] }),
|
|
1201
1201
|
/* @__PURE__ */ c("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
1202
1202
|
/* @__PURE__ */ e(
|
|
1203
|
-
|
|
1203
|
+
L,
|
|
1204
1204
|
{
|
|
1205
1205
|
variant: "ghost",
|
|
1206
1206
|
size: "xs",
|
|
1207
1207
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
|
|
1208
|
-
onClick:
|
|
1208
|
+
onClick: a,
|
|
1209
1209
|
title: "Manage members",
|
|
1210
1210
|
"aria-label": "Manage members",
|
|
1211
1211
|
children: /* @__PURE__ */ e(gt, { className: "h-3.5 w-3.5" })
|
|
1212
1212
|
}
|
|
1213
1213
|
),
|
|
1214
|
-
|
|
1215
|
-
|
|
1214
|
+
i && /* @__PURE__ */ e(
|
|
1215
|
+
L,
|
|
1216
1216
|
{
|
|
1217
1217
|
variant: "ghost",
|
|
1218
1218
|
size: "xs",
|
|
@@ -1226,108 +1226,108 @@ function mr({
|
|
|
1226
1226
|
] })
|
|
1227
1227
|
] }) });
|
|
1228
1228
|
}
|
|
1229
|
-
function ce(t,
|
|
1230
|
-
var
|
|
1231
|
-
const
|
|
1232
|
-
(
|
|
1229
|
+
function ce(t, a, n) {
|
|
1230
|
+
var u, l;
|
|
1231
|
+
const s = (t.controls || []).find(
|
|
1232
|
+
(p) => p.id === n
|
|
1233
1233
|
);
|
|
1234
|
-
if (
|
|
1235
|
-
return
|
|
1236
|
-
const
|
|
1237
|
-
(
|
|
1234
|
+
if (s)
|
|
1235
|
+
return s.label;
|
|
1236
|
+
const i = (l = (u = pa(t, a)) == null ? void 0 : u.controls) == null ? void 0 : l.find(
|
|
1237
|
+
(p) => p.id === n
|
|
1238
1238
|
);
|
|
1239
|
-
return (
|
|
1239
|
+
return (i == null ? void 0 : i.label) || n;
|
|
1240
1240
|
}
|
|
1241
|
-
function le(t,
|
|
1241
|
+
function le(t, a) {
|
|
1242
1242
|
var n;
|
|
1243
|
-
return ((n = pa(t,
|
|
1243
|
+
return ((n = pa(t, a)) == null ? void 0 : n.title) || a;
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1246
|
-
const { errors:
|
|
1245
|
+
function fr(t) {
|
|
1246
|
+
const { errors: a, dashboard: n } = t;
|
|
1247
1247
|
if (!n)
|
|
1248
|
-
return
|
|
1249
|
-
const
|
|
1250
|
-
for (const
|
|
1251
|
-
const
|
|
1248
|
+
return a;
|
|
1249
|
+
const s = /* @__PURE__ */ new Map();
|
|
1250
|
+
for (const i of a) {
|
|
1251
|
+
const u = i.match(
|
|
1252
1252
|
/^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
|
|
1253
1253
|
);
|
|
1254
|
-
if (
|
|
1255
|
-
const [,
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
`"${le(n,
|
|
1254
|
+
if (u) {
|
|
1255
|
+
const [, m, f] = u, h = `${m}:${f}:missing-metric`;
|
|
1256
|
+
s.has(h) || s.set(
|
|
1257
|
+
h,
|
|
1258
|
+
`"${le(n, m)}" has an outdated "${ce(
|
|
1259
1259
|
n,
|
|
1260
|
-
|
|
1261
|
-
|
|
1260
|
+
m,
|
|
1261
|
+
f
|
|
1262
1262
|
)}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1263
1263
|
);
|
|
1264
1264
|
continue;
|
|
1265
1265
|
}
|
|
1266
|
-
const l =
|
|
1266
|
+
const l = i.match(
|
|
1267
1267
|
/^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
|
|
1268
1268
|
);
|
|
1269
1269
|
if (l) {
|
|
1270
|
-
const [,
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
`"${le(n,
|
|
1270
|
+
const [, m, f] = l, h = `${m}:${f}:missing-group-by`;
|
|
1271
|
+
s.has(h) || s.set(
|
|
1272
|
+
h,
|
|
1273
|
+
`"${le(n, m)}" has an outdated "${ce(
|
|
1274
1274
|
n,
|
|
1275
|
-
|
|
1276
|
-
|
|
1275
|
+
m,
|
|
1276
|
+
f
|
|
1277
1277
|
)}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1278
1278
|
);
|
|
1279
1279
|
continue;
|
|
1280
1280
|
}
|
|
1281
|
-
const
|
|
1281
|
+
const p = i.match(
|
|
1282
1282
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
|
|
1283
1283
|
);
|
|
1284
|
-
if (
|
|
1285
|
-
const [,
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
`"${le(n,
|
|
1284
|
+
if (p) {
|
|
1285
|
+
const [, m, f] = p, h = `${m}:${f}:invalid-metric`;
|
|
1286
|
+
s.has(h) || s.set(
|
|
1287
|
+
h,
|
|
1288
|
+
`"${le(n, m)}" has an invalid "${ce(
|
|
1289
1289
|
n,
|
|
1290
|
-
|
|
1291
|
-
|
|
1290
|
+
m,
|
|
1291
|
+
f
|
|
1292
1292
|
)}" metric mapping. Open the card controls and choose a valid metric for each option.`
|
|
1293
1293
|
);
|
|
1294
1294
|
continue;
|
|
1295
1295
|
}
|
|
1296
|
-
const
|
|
1296
|
+
const g = i.match(
|
|
1297
1297
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
|
|
1298
1298
|
);
|
|
1299
|
-
if (
|
|
1300
|
-
const [,
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
`"${le(n,
|
|
1299
|
+
if (g) {
|
|
1300
|
+
const [, m, f] = g, h = `${m}:${f}:invalid-group-by`;
|
|
1301
|
+
s.has(h) || s.set(
|
|
1302
|
+
h,
|
|
1303
|
+
`"${le(n, m)}" has an invalid "${ce(
|
|
1304
1304
|
n,
|
|
1305
|
-
|
|
1306
|
-
|
|
1305
|
+
m,
|
|
1306
|
+
f
|
|
1307
1307
|
)}" field mapping. Open the card controls and choose a valid field for each option.`
|
|
1308
1308
|
);
|
|
1309
1309
|
continue;
|
|
1310
1310
|
}
|
|
1311
|
-
const v =
|
|
1311
|
+
const v = i.match(
|
|
1312
1312
|
/^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
|
|
1313
1313
|
);
|
|
1314
1314
|
if (v) {
|
|
1315
|
-
const [,
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
`"${le(n,
|
|
1315
|
+
const [, m, f] = v, h = `${m}:${f}:missing-temporal-group-by`;
|
|
1316
|
+
s.has(h) || s.set(
|
|
1317
|
+
h,
|
|
1318
|
+
`"${le(n, m)}" can no longer use "${ce(
|
|
1319
1319
|
n,
|
|
1320
|
-
|
|
1321
|
-
|
|
1320
|
+
m,
|
|
1321
|
+
f
|
|
1322
1322
|
)}" for time grain because the card does not currently group by a date field.`
|
|
1323
1323
|
);
|
|
1324
1324
|
continue;
|
|
1325
1325
|
}
|
|
1326
|
-
|
|
1326
|
+
s.set(i, i);
|
|
1327
1327
|
}
|
|
1328
|
-
return Array.from(
|
|
1328
|
+
return Array.from(s.values());
|
|
1329
1329
|
}
|
|
1330
|
-
const
|
|
1330
|
+
const gr = [
|
|
1331
1331
|
"enum",
|
|
1332
1332
|
"multi_enum",
|
|
1333
1333
|
"text",
|
|
@@ -1335,69 +1335,76 @@ const pr = [
|
|
|
1335
1335
|
"boolean",
|
|
1336
1336
|
"date"
|
|
1337
1337
|
];
|
|
1338
|
-
function
|
|
1338
|
+
function vr({
|
|
1339
1339
|
open: t,
|
|
1340
|
-
onOpenChange:
|
|
1340
|
+
onOpenChange: a,
|
|
1341
1341
|
initialMode: n = "manage"
|
|
1342
1342
|
}) {
|
|
1343
1343
|
var z;
|
|
1344
|
-
const
|
|
1345
|
-
forceClose:
|
|
1346
|
-
handleOpenChange:
|
|
1344
|
+
const s = n === "create", {
|
|
1345
|
+
forceClose: i,
|
|
1346
|
+
handleOpenChange: u,
|
|
1347
1347
|
isCreateFlowActive: l,
|
|
1348
|
-
preventPassiveDismissDuringCreate:
|
|
1349
|
-
resolvedOpen:
|
|
1348
|
+
preventPassiveDismissDuringCreate: p,
|
|
1349
|
+
resolvedOpen: g,
|
|
1350
1350
|
setIsCreateFlowActive: v
|
|
1351
|
-
} =
|
|
1351
|
+
} = En({
|
|
1352
1352
|
open: t,
|
|
1353
|
-
onOpenChange:
|
|
1353
|
+
onOpenChange: a,
|
|
1354
1354
|
initialCreateFlowActive: n === "create",
|
|
1355
1355
|
dismissMode: "explicit-only"
|
|
1356
|
-
}),
|
|
1357
|
-
(x) => x.id ===
|
|
1358
|
-
),
|
|
1359
|
-
() =>
|
|
1360
|
-
[
|
|
1361
|
-
),
|
|
1356
|
+
}), m = S((x) => x.dashboard), f = S((x) => x.selectedSheetId), { setDashboardInputs: h } = St(), d = (z = m.sheets) == null ? void 0 : z.find(
|
|
1357
|
+
(x) => x.id === f
|
|
1358
|
+
), r = (d == null ? void 0 : d.kind) === "document" && !!d.document, b = F(
|
|
1359
|
+
() => r && (d != null && d.document) ? Ts(m, d.id) : [],
|
|
1360
|
+
[m, r, d == null ? void 0 : d.document, d == null ? void 0 : d.id]
|
|
1361
|
+
), D = F(
|
|
1362
1362
|
() => b.filter(
|
|
1363
1363
|
(x) => x.kind === "control"
|
|
1364
1364
|
),
|
|
1365
1365
|
[b]
|
|
1366
1366
|
), w = F(
|
|
1367
|
-
() =>
|
|
1368
|
-
[
|
|
1369
|
-
),
|
|
1370
|
-
() =>
|
|
1367
|
+
() => D.map((x) => x.control),
|
|
1368
|
+
[D]
|
|
1369
|
+
), C = F(
|
|
1370
|
+
() => yr(w),
|
|
1371
1371
|
[w]
|
|
1372
1372
|
), E = F(
|
|
1373
|
-
() =>
|
|
1374
|
-
[
|
|
1373
|
+
() => br(m),
|
|
1374
|
+
[m]
|
|
1375
1375
|
), O = Fe(() => {
|
|
1376
|
-
if (
|
|
1377
|
-
|
|
1376
|
+
if (s) {
|
|
1377
|
+
i();
|
|
1378
1378
|
return;
|
|
1379
1379
|
}
|
|
1380
1380
|
v(!1);
|
|
1381
|
-
}, [
|
|
1382
|
-
(x, B,
|
|
1383
|
-
!
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1381
|
+
}, [s, i, v]), I = Fe(
|
|
1382
|
+
(x, B, Q) => {
|
|
1383
|
+
!r || !(d != null && d.document) || h(
|
|
1384
|
+
Nr({
|
|
1385
|
+
allInputs: m.inputs || [],
|
|
1386
|
+
documentSheetId: d.id,
|
|
1387
|
+
currentDocumentInputs: b,
|
|
1387
1388
|
nextControls: x,
|
|
1388
1389
|
nextDefaultValues: B,
|
|
1389
|
-
change:
|
|
1390
|
+
change: Q
|
|
1390
1391
|
})
|
|
1391
|
-
|
|
1392
|
+
);
|
|
1392
1393
|
},
|
|
1393
|
-
[
|
|
1394
|
+
[
|
|
1395
|
+
m.inputs,
|
|
1396
|
+
b,
|
|
1397
|
+
r,
|
|
1398
|
+
d,
|
|
1399
|
+
h
|
|
1400
|
+
]
|
|
1394
1401
|
);
|
|
1395
|
-
return !
|
|
1402
|
+
return !r || !(d != null && d.document) ? null : /* @__PURE__ */ e(Ge, { open: g, onOpenChange: u, children: /* @__PURE__ */ c(
|
|
1396
1403
|
$e,
|
|
1397
1404
|
{
|
|
1398
1405
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1399
|
-
onEscapeKeyDown:
|
|
1400
|
-
onPointerDownOutside:
|
|
1406
|
+
onEscapeKeyDown: p,
|
|
1407
|
+
onPointerDownOutside: p,
|
|
1401
1408
|
children: [
|
|
1402
1409
|
/* @__PURE__ */ c(Ve, { className: l ? "space-y-0" : void 0, children: [
|
|
1403
1410
|
/* @__PURE__ */ e(ze, { className: "text-[15px]", children: l ? "Add document control" : "Document Controls" }),
|
|
@@ -1410,18 +1417,18 @@ function fr({
|
|
|
1410
1417
|
)
|
|
1411
1418
|
] }),
|
|
1412
1419
|
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ e(
|
|
1413
|
-
|
|
1420
|
+
In,
|
|
1414
1421
|
{
|
|
1415
1422
|
scope: "dashboard",
|
|
1416
1423
|
controls: w,
|
|
1417
1424
|
reservedControlIds: E,
|
|
1418
|
-
defaultValues:
|
|
1425
|
+
defaultValues: C,
|
|
1419
1426
|
usageByControlId: {},
|
|
1420
1427
|
availableFieldChoices: [],
|
|
1421
1428
|
availableMetricChoices: [],
|
|
1422
1429
|
structuralParticipants: [],
|
|
1423
1430
|
structuralParticipantIdsByControlId: {},
|
|
1424
|
-
allowedControlTypes:
|
|
1431
|
+
allowedControlTypes: gr,
|
|
1425
1432
|
initialCreateFlow: n === "create",
|
|
1426
1433
|
onCreateFlowActiveChange: v,
|
|
1427
1434
|
onCreateFlowComplete: O,
|
|
@@ -1433,158 +1440,176 @@ function fr({
|
|
|
1433
1440
|
}
|
|
1434
1441
|
) });
|
|
1435
1442
|
}
|
|
1436
|
-
function
|
|
1437
|
-
return (t.controls || []).map((
|
|
1443
|
+
function br(t) {
|
|
1444
|
+
return (t.controls || []).map((a) => a.id);
|
|
1438
1445
|
}
|
|
1439
|
-
function
|
|
1440
|
-
const
|
|
1446
|
+
function yr(t) {
|
|
1447
|
+
const a = {};
|
|
1441
1448
|
for (const n of t)
|
|
1442
|
-
n.defaultValue !== void 0 && (
|
|
1443
|
-
return
|
|
1449
|
+
n.defaultValue !== void 0 && (a[n.id] = n.defaultValue);
|
|
1450
|
+
return a;
|
|
1444
1451
|
}
|
|
1445
|
-
function
|
|
1446
|
-
return
|
|
1452
|
+
function xr(t, a) {
|
|
1453
|
+
return a ? Object.prototype.hasOwnProperty.call(a, t.id) ? {
|
|
1447
1454
|
...t,
|
|
1448
|
-
defaultValue:
|
|
1455
|
+
defaultValue: a[t.id]
|
|
1449
1456
|
} : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 };
|
|
1450
1457
|
}
|
|
1451
|
-
function
|
|
1452
|
-
|
|
1458
|
+
function Nr({
|
|
1459
|
+
allInputs: t,
|
|
1460
|
+
documentSheetId: a,
|
|
1461
|
+
currentDocumentInputs: n,
|
|
1453
1462
|
nextControls: s,
|
|
1454
|
-
nextDefaultValues:
|
|
1455
|
-
change:
|
|
1463
|
+
nextDefaultValues: i,
|
|
1464
|
+
change: u
|
|
1456
1465
|
}) {
|
|
1457
|
-
const
|
|
1458
|
-
s.map((
|
|
1459
|
-
|
|
1460
|
-
|
|
1466
|
+
const l = new Map(
|
|
1467
|
+
s.map((h) => [
|
|
1468
|
+
h.id,
|
|
1469
|
+
xr(h, i)
|
|
1461
1470
|
])
|
|
1462
|
-
),
|
|
1463
|
-
for (const
|
|
1464
|
-
if (
|
|
1465
|
-
|
|
1471
|
+
), p = (u == null ? void 0 : u.type) === "rename" ? { oldId: u.oldId, newId: u.newId } : null, g = /* @__PURE__ */ new Set(), v = [];
|
|
1472
|
+
for (const h of n) {
|
|
1473
|
+
if (h.kind !== "control") {
|
|
1474
|
+
v.push(h);
|
|
1466
1475
|
continue;
|
|
1467
1476
|
}
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1477
|
+
const d = l.get(h.control.id) || ((p == null ? void 0 : p.oldId) === h.control.id ? l.get(p.newId) : void 0);
|
|
1478
|
+
if (!d)
|
|
1479
|
+
continue;
|
|
1480
|
+
g.add(d.id);
|
|
1481
|
+
const r = _s(
|
|
1482
|
+
d.id,
|
|
1483
|
+
[...t, ...v].filter(
|
|
1484
|
+
(D) => D.id !== h.id
|
|
1485
|
+
)
|
|
1486
|
+
), b = d.id === r ? d : { ...d, id: r };
|
|
1487
|
+
v.push({
|
|
1488
|
+
...h,
|
|
1489
|
+
label: b.label,
|
|
1490
|
+
variableName: r,
|
|
1491
|
+
requiredAtExecution: b.requiredAtExecution,
|
|
1492
|
+
control: b
|
|
1493
|
+
});
|
|
1475
1494
|
}
|
|
1476
|
-
for (const
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
control:
|
|
1480
|
-
existingInputs:
|
|
1495
|
+
for (const h of l.values())
|
|
1496
|
+
g.has(h.id) || v.push(
|
|
1497
|
+
Us({
|
|
1498
|
+
control: h,
|
|
1499
|
+
existingInputs: [...t, ...v],
|
|
1500
|
+
sheetId: a
|
|
1481
1501
|
})
|
|
1482
1502
|
);
|
|
1483
|
-
|
|
1503
|
+
const m = new Set(
|
|
1504
|
+
n.map((h) => h.id)
|
|
1505
|
+
);
|
|
1506
|
+
return [...t.filter(
|
|
1507
|
+
(h) => !m.has(h.id)
|
|
1508
|
+
), ...v];
|
|
1484
1509
|
}
|
|
1485
|
-
function la(t,
|
|
1510
|
+
function la(t, a) {
|
|
1486
1511
|
return {
|
|
1487
1512
|
dashboard: bt(t),
|
|
1488
|
-
semanticExecutionPayload: bt(
|
|
1513
|
+
semanticExecutionPayload: bt(a)
|
|
1489
1514
|
};
|
|
1490
1515
|
}
|
|
1491
|
-
function
|
|
1516
|
+
function Fr() {
|
|
1492
1517
|
var Qt, Wt, Jt, Yt, Xt, Zt;
|
|
1493
|
-
|
|
1518
|
+
pn(), fn();
|
|
1494
1519
|
const {
|
|
1495
1520
|
authToken: t,
|
|
1496
|
-
tokenProps:
|
|
1521
|
+
tokenProps: a,
|
|
1497
1522
|
id: n
|
|
1498
|
-
} =
|
|
1499
|
-
(
|
|
1500
|
-
),
|
|
1501
|
-
(
|
|
1502
|
-
), w = ms(
|
|
1503
|
-
(
|
|
1504
|
-
), { setDashboardTitle: O } =
|
|
1505
|
-
(
|
|
1506
|
-
), $a =
|
|
1507
|
-
ta((
|
|
1523
|
+
} = j(), { isLocalDev: s } = Fs(), { openBrandStudioPreview: i } = Rs(), { permissions: u } = Hn(), l = Gs(), { isLoading: p } = $s(), g = S((o) => o.theme), v = S((o) => o.isDownloadingPdf), m = S(
|
|
1524
|
+
(o) => o.dashboardAssistantDraftScopeKey
|
|
1525
|
+
), f = S((o) => o.lenses), h = S((o) => o.selectedLensId), d = f == null ? void 0 : f.find((o) => o.id === h), r = S((o) => o.dashboard), b = S((o) => o.selectedSheetId), D = (Qt = r == null ? void 0 : r.sheets) == null ? void 0 : Qt.find(
|
|
1526
|
+
(o) => o.id === b
|
|
1527
|
+
), w = ms(D), C = w ? (Wt = D == null ? void 0 : D.document) == null ? void 0 : Wt.page : void 0, E = S(
|
|
1528
|
+
(o) => o.isDashboardEditing
|
|
1529
|
+
), { setDashboardTitle: O } = S((o) => o.actions), [I, V] = N(!1), [z, x] = N(!1), [B, Q] = N(!1), [Z, ee] = N(!1), [y, k] = N(!1), [G, H] = N(!1), [me, te] = N(!1), [Ua, Mt] = N(!1), [He, he] = N(null), [Fa, pe] = N(!1), [fe, ge] = N(null), [Ot, ve] = N([]), [kt, be] = N(!1), Ra = S((o) => o.isDashboardPanelOpen), Ga = S(
|
|
1530
|
+
(o) => o.actions.setIsDashboardPanelOpen
|
|
1531
|
+
), $a = S((o) => o.filterValues), _ = S((o) => o.isVisualEditing);
|
|
1532
|
+
ta((o) => o.card);
|
|
1508
1533
|
const ae = ke(
|
|
1509
|
-
(
|
|
1534
|
+
(o) => o.selectedDashboard
|
|
1510
1535
|
), ye = ke(
|
|
1511
|
-
(
|
|
1536
|
+
(o) => o.initialDashboard
|
|
1512
1537
|
);
|
|
1513
|
-
ke((
|
|
1514
|
-
const xe = ae ? (Yt = ae == null ? void 0 : ae.permissions) == null ? void 0 : Yt.canEdit : (Jt = ye == null ? void 0 : ye.permissions) == null ? void 0 : Jt.canEdit,
|
|
1515
|
-
(
|
|
1516
|
-
), je =
|
|
1517
|
-
(
|
|
1538
|
+
ke((o) => o.selectedVisual), S((o) => o.selectedFrameId), ta((o) => o.frame);
|
|
1539
|
+
const xe = ae ? (Yt = ae == null ? void 0 : ae.permissions) == null ? void 0 : Yt.canEdit : (Jt = ye == null ? void 0 : ye.permissions) == null ? void 0 : Jt.canEdit, Ne = S((o) => o.showFilters), Pt = Vs((o) => o.setPanelOpen), Tt = S(
|
|
1540
|
+
(o) => o.showDashboardJSON
|
|
1541
|
+
), je = S((o) => o.onSaveFunction), _t = S(
|
|
1542
|
+
(o) => o.actions.setShowFilters
|
|
1518
1543
|
), {
|
|
1519
1544
|
setDocumentInspectorTab: Ut,
|
|
1520
1545
|
setIsDashboardEditing: Ft,
|
|
1521
1546
|
setShowDashboardJSON: Rt
|
|
1522
|
-
} =
|
|
1523
|
-
(
|
|
1524
|
-
), { resources:
|
|
1525
|
-
id:
|
|
1526
|
-
title: (
|
|
1527
|
-
} : null, { handleAddNewFrame: ja } =
|
|
1547
|
+
} = S((o) => o.actions), { setInitialDashboard: Gt, clearSelectedDashboard: Ke } = ke(
|
|
1548
|
+
(o) => o.actions
|
|
1549
|
+
), { resources: Se } = zs(nt.DASHBOARD), { data: Qe } = qs(), Va = ((Xt = Qe == null ? void 0 : Qe.preference) == null ? void 0 : Xt.defaultDashboardId) || null, { mutate: za, isPending: qa } = Bs(), { currentUser: Ba } = Dt(), Ha = Hs(Ba), W = ae || ye, $t = W ? {
|
|
1550
|
+
id: W.id,
|
|
1551
|
+
title: (r == null ? void 0 : r.title) || W.title || "Dashboard"
|
|
1552
|
+
} : null, { handleAddNewFrame: ja } = js(), [We, Je] = N(!1), [Ka, se] = N(!1), [Ye, we] = N("close"), ne = Ks(nt.DASHBOARD), [R, De] = N(null), Vt = Fe((o) => {
|
|
1528
1553
|
window.setTimeout(() => {
|
|
1529
|
-
he(
|
|
1554
|
+
he(o);
|
|
1530
1555
|
}, 0);
|
|
1531
|
-
}, []), Qa = async (
|
|
1532
|
-
if (!(
|
|
1556
|
+
}, []), Qa = async (o, P) => {
|
|
1557
|
+
if (!(r != null && r.id)) {
|
|
1533
1558
|
console.log("No dashboard ID found");
|
|
1534
1559
|
return;
|
|
1535
1560
|
}
|
|
1536
1561
|
console.log("Updating dashboard title:", {
|
|
1537
|
-
dashboardId:
|
|
1538
|
-
newTitle:
|
|
1562
|
+
dashboardId: r.id,
|
|
1563
|
+
newTitle: o,
|
|
1539
1564
|
previousTitle: P
|
|
1540
1565
|
}), ne.mutate(
|
|
1541
1566
|
{
|
|
1542
|
-
resourceId:
|
|
1543
|
-
data: { title:
|
|
1567
|
+
resourceId: r.id,
|
|
1568
|
+
data: { title: o }
|
|
1544
1569
|
},
|
|
1545
1570
|
{
|
|
1546
1571
|
onSuccess: () => {
|
|
1547
|
-
console.log("Dashboard title updated successfully"),
|
|
1572
|
+
console.log("Dashboard title updated successfully"), A.success("Dashboard title updated");
|
|
1548
1573
|
},
|
|
1549
1574
|
onError: (q) => {
|
|
1550
|
-
console.error("Failed to update dashboard title:", q),
|
|
1575
|
+
console.error("Failed to update dashboard title:", q), A.error("Failed to update dashboard title"), O(P);
|
|
1551
1576
|
}
|
|
1552
1577
|
}
|
|
1553
1578
|
);
|
|
1554
1579
|
};
|
|
1555
1580
|
ot(() => {
|
|
1556
|
-
if (
|
|
1557
|
-
const
|
|
1558
|
-
if (
|
|
1559
|
-
const P =
|
|
1560
|
-
(q) => q.id ===
|
|
1581
|
+
if (Se && Se.length > 0) {
|
|
1582
|
+
const o = r == null ? void 0 : r.id;
|
|
1583
|
+
if (o) {
|
|
1584
|
+
const P = Se.find(
|
|
1585
|
+
(q) => q.id === o
|
|
1561
1586
|
);
|
|
1562
1587
|
P && Gt(P);
|
|
1563
1588
|
}
|
|
1564
1589
|
}
|
|
1565
|
-
}, [
|
|
1566
|
-
const re =
|
|
1567
|
-
() =>
|
|
1590
|
+
}, [Se, r == null ? void 0 : r.id, Gt]);
|
|
1591
|
+
const re = a.orgUserId || a.tenantId, Xe = F(
|
|
1592
|
+
() => Sr({
|
|
1568
1593
|
accessToken: t == null ? void 0 : t.accessToken,
|
|
1569
|
-
dashboardId: (
|
|
1594
|
+
dashboardId: (r == null ? void 0 : r.id) || n || a.dashboard_id,
|
|
1570
1595
|
selectedSheetId: w ? b : void 0,
|
|
1571
|
-
pageSize:
|
|
1572
|
-
orientation:
|
|
1573
|
-
theme:
|
|
1596
|
+
pageSize: C == null ? void 0 : C.size,
|
|
1597
|
+
orientation: C == null ? void 0 : C.orientation,
|
|
1598
|
+
theme: g
|
|
1574
1599
|
}),
|
|
1575
1600
|
[
|
|
1576
1601
|
t == null ? void 0 : t.accessToken,
|
|
1577
1602
|
n,
|
|
1578
|
-
|
|
1603
|
+
r == null ? void 0 : r.id,
|
|
1579
1604
|
w,
|
|
1580
|
-
|
|
1581
|
-
|
|
1605
|
+
C == null ? void 0 : C.orientation,
|
|
1606
|
+
C == null ? void 0 : C.size,
|
|
1582
1607
|
b,
|
|
1583
|
-
|
|
1584
|
-
|
|
1608
|
+
g,
|
|
1609
|
+
a.dashboard_id
|
|
1585
1610
|
]
|
|
1586
|
-
), zt = E && !_ && re && xe, { setDashboard: Ze } =
|
|
1587
|
-
(
|
|
1611
|
+
), zt = E && !_ && re && xe, { setDashboard: Ze } = S((o) => o.actions), et = S(
|
|
1612
|
+
(o) => o.semanticExecutionPayload
|
|
1588
1613
|
), Wa = () => {
|
|
1589
1614
|
Ft(!0);
|
|
1590
1615
|
}, tt = () => {
|
|
@@ -1595,26 +1620,26 @@ function _r() {
|
|
|
1595
1620
|
R && De(null);
|
|
1596
1621
|
return;
|
|
1597
1622
|
}
|
|
1598
|
-
R || !
|
|
1623
|
+
R || !r || p || De(
|
|
1599
1624
|
la(
|
|
1600
|
-
|
|
1625
|
+
r,
|
|
1601
1626
|
et
|
|
1602
1627
|
)
|
|
1603
1628
|
);
|
|
1604
1629
|
}, [
|
|
1605
|
-
|
|
1630
|
+
r,
|
|
1606
1631
|
R,
|
|
1607
1632
|
E,
|
|
1608
|
-
|
|
1633
|
+
p,
|
|
1609
1634
|
et
|
|
1610
1635
|
]);
|
|
1611
|
-
const Ce = (R == null ? void 0 : R.dashboard) ?? null, { isDirty: qt, isDirtyPending: Ja, resetDirty: Ee } =
|
|
1612
|
-
|
|
1636
|
+
const Ce = (R == null ? void 0 : R.dashboard) ?? null, { isDirty: qt, isDirtyPending: Ja, resetDirty: Ee } = Cn(
|
|
1637
|
+
r,
|
|
1613
1638
|
Ce,
|
|
1614
1639
|
300,
|
|
1615
1640
|
1e3,
|
|
1616
1641
|
it
|
|
1617
|
-
), Bt = Fe(() => Ce ? it(
|
|
1642
|
+
), Bt = Fe(() => Ce ? it(r) !== it(Ce) : !1, [r, Ce]), Ht = qt || Ja, Ie = We || ne.isPending, Ya = () => {
|
|
1618
1643
|
Bt() ? (we("close"), se(!0)) : (tt(), Ee());
|
|
1619
1644
|
}, Xa = async () => {
|
|
1620
1645
|
await at({
|
|
@@ -1636,11 +1661,11 @@ function _r() {
|
|
|
1636
1661
|
}
|
|
1637
1662
|
Ke();
|
|
1638
1663
|
};
|
|
1639
|
-
async function at(
|
|
1640
|
-
const P =
|
|
1664
|
+
async function at(o) {
|
|
1665
|
+
const P = S.getState().dashboard;
|
|
1641
1666
|
if (!P)
|
|
1642
1667
|
return;
|
|
1643
|
-
const q = (
|
|
1668
|
+
const q = (o == null ? void 0 : o.closeAfterSave) ?? kt, os = (o == null ? void 0 : o.navigateHomeAfterSave) ?? !1;
|
|
1644
1669
|
be(q), q && se(!1);
|
|
1645
1670
|
const is = bt(P);
|
|
1646
1671
|
pe(!0), ge(null), ve([]), Je(!0);
|
|
@@ -1654,70 +1679,70 @@ function _r() {
|
|
|
1654
1679
|
},
|
|
1655
1680
|
{
|
|
1656
1681
|
onSuccess: (U) => {
|
|
1657
|
-
var
|
|
1658
|
-
const
|
|
1659
|
-
if (!P.id &&
|
|
1682
|
+
var Le, Me, ea;
|
|
1683
|
+
const K = (U == null ? void 0 : U.id) || ((Le = U == null ? void 0 : U.dashboard) == null ? void 0 : Le.id) || ((Me = U == null ? void 0 : U.resource) == null ? void 0 : Me.id) || ((ea = U == null ? void 0 : U.template) == null ? void 0 : ea.id) || null;
|
|
1684
|
+
if (!P.id && K) {
|
|
1660
1685
|
const st = bs.getState(), Oe = st.pendingDashboardDraftMigration;
|
|
1661
|
-
(Oe == null ? void 0 : Oe.scopeKey) ===
|
|
1662
|
-
|
|
1686
|
+
(Oe == null ? void 0 : Oe.scopeKey) === m ? st.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
|
|
1687
|
+
K
|
|
1663
1688
|
) : Oe && st.actions.clearPendingDashboardDraftMigration();
|
|
1664
1689
|
}
|
|
1665
|
-
Je(!1),
|
|
1690
|
+
Je(!1), A.success("Dashboard saved!"), De(
|
|
1666
1691
|
la(
|
|
1667
1692
|
is,
|
|
1668
|
-
|
|
1693
|
+
S.getState().semanticExecutionPayload
|
|
1669
1694
|
)
|
|
1670
1695
|
), pe(!1), be(!1), q && (tt(), Ee(), os && Ke()), we("close");
|
|
1671
1696
|
},
|
|
1672
1697
|
onError: (U) => {
|
|
1673
1698
|
Je(!1), ge("Failed to save dashboard. Please try again.");
|
|
1674
|
-
const
|
|
1675
|
-
|
|
1676
|
-
) ? (
|
|
1677
|
-
(
|
|
1699
|
+
const K = U.details, Le = Array.isArray(
|
|
1700
|
+
K == null ? void 0 : K.errors
|
|
1701
|
+
) ? (K.errors || []).filter(
|
|
1702
|
+
(Me) => typeof Me == "string"
|
|
1678
1703
|
) : [];
|
|
1679
1704
|
ve(
|
|
1680
|
-
|
|
1681
|
-
errors:
|
|
1705
|
+
fr({
|
|
1706
|
+
errors: Le,
|
|
1682
1707
|
dashboard: P || void 0
|
|
1683
1708
|
})
|
|
1684
|
-
),
|
|
1709
|
+
), A.error("Failed to save dashboard");
|
|
1685
1710
|
}
|
|
1686
1711
|
}
|
|
1687
1712
|
);
|
|
1688
1713
|
}
|
|
1689
1714
|
async function as() {
|
|
1690
|
-
if (V(!0), !
|
|
1691
|
-
const
|
|
1692
|
-
if (!
|
|
1715
|
+
if (V(!0), !h || !d) return;
|
|
1716
|
+
const o = S.getState().dashboard;
|
|
1717
|
+
if (!o) {
|
|
1693
1718
|
V(!1);
|
|
1694
1719
|
return;
|
|
1695
1720
|
}
|
|
1696
|
-
const P = JSON.stringify(
|
|
1697
|
-
...
|
|
1721
|
+
const P = JSON.stringify(o), q = {
|
|
1722
|
+
...d,
|
|
1698
1723
|
template: P,
|
|
1699
1724
|
filterValues: $a
|
|
1700
1725
|
};
|
|
1701
1726
|
await xt(
|
|
1702
|
-
|
|
1727
|
+
a.apiServiceUrl,
|
|
1703
1728
|
q,
|
|
1704
1729
|
t == null ? void 0 : t.accessToken
|
|
1705
|
-
),
|
|
1730
|
+
), A.success("Lens saved"), je == null || je(o), V(!1);
|
|
1706
1731
|
}
|
|
1707
|
-
const jt = (
|
|
1732
|
+
const jt = (d == null ? void 0 : d.name) || r.title, oe = !!(r != null && r.id);
|
|
1708
1733
|
ne.isPending && console.log("Title during update:", {
|
|
1709
1734
|
title: jt,
|
|
1710
|
-
dashboardStateTitle:
|
|
1711
|
-
dashboardId:
|
|
1712
|
-
currentLensName:
|
|
1735
|
+
dashboardStateTitle: r.title,
|
|
1736
|
+
dashboardId: r == null ? void 0 : r.id,
|
|
1737
|
+
currentLensName: d == null ? void 0 : d.name
|
|
1713
1738
|
});
|
|
1714
|
-
const Kt =
|
|
1739
|
+
const Kt = a.orgUserId || a.tenantId && a.endUserId && a.endUserEmail, ss = !!Kt && !!(t != null && t.accessToken) && !!(a != null && a.apiServiceUrl);
|
|
1715
1740
|
ot(() => {
|
|
1716
|
-
!oe &&
|
|
1717
|
-
}, [oe,
|
|
1718
|
-
const ns = l, ie = (
|
|
1741
|
+
!oe && Z && ee(!1);
|
|
1742
|
+
}, [oe, Z]);
|
|
1743
|
+
const ns = l, ie = (r == null ? void 0 : r.id) || null, Ae = !!ie && Va === ie, rs = () => {
|
|
1719
1744
|
ie && za({
|
|
1720
|
-
dashboardId:
|
|
1745
|
+
dashboardId: Ae ? null : ie
|
|
1721
1746
|
});
|
|
1722
1747
|
};
|
|
1723
1748
|
return /* @__PURE__ */ c(
|
|
@@ -1738,7 +1763,7 @@ function _r() {
|
|
|
1738
1763
|
},
|
|
1739
1764
|
className: "h-7 w-7 px-0",
|
|
1740
1765
|
buttonProps: { size: "xs" },
|
|
1741
|
-
children: /* @__PURE__ */ e(
|
|
1766
|
+
children: /* @__PURE__ */ e(On, { className: "h-3.5 w-3.5" })
|
|
1742
1767
|
}
|
|
1743
1768
|
),
|
|
1744
1769
|
ns && !_ && /* @__PURE__ */ e(
|
|
@@ -1753,7 +1778,7 @@ function _r() {
|
|
|
1753
1778
|
}
|
|
1754
1779
|
)
|
|
1755
1780
|
] }),
|
|
1756
|
-
!_ && l && (
|
|
1781
|
+
!_ && l && (p ? /* @__PURE__ */ e(
|
|
1757
1782
|
"div",
|
|
1758
1783
|
{
|
|
1759
1784
|
className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
|
|
@@ -1763,19 +1788,19 @@ function _r() {
|
|
|
1763
1788
|
}
|
|
1764
1789
|
) : /* @__PURE__ */ c(T, { children: [
|
|
1765
1790
|
/* @__PURE__ */ e(
|
|
1766
|
-
|
|
1791
|
+
Qs,
|
|
1767
1792
|
{
|
|
1768
1793
|
value: jt || "Untitled Dashboard",
|
|
1769
|
-
onSave: (
|
|
1794
|
+
onSave: (o) => {
|
|
1770
1795
|
console.log("EditableText onSave called:", {
|
|
1771
|
-
newTitle:
|
|
1796
|
+
newTitle: o,
|
|
1772
1797
|
canEditDashboard: xe,
|
|
1773
|
-
dashboardId:
|
|
1798
|
+
dashboardId: r == null ? void 0 : r.id
|
|
1774
1799
|
});
|
|
1775
|
-
const P = (
|
|
1776
|
-
O(
|
|
1800
|
+
const P = (r == null ? void 0 : r.title) || "";
|
|
1801
|
+
O(o), Qa(o, P);
|
|
1777
1802
|
},
|
|
1778
|
-
isEditable: xe && !
|
|
1803
|
+
isEditable: xe && !d,
|
|
1779
1804
|
displayClassName: "text-[13px] font-medium",
|
|
1780
1805
|
inputClassName: "text-[13px] font-medium",
|
|
1781
1806
|
placeholder: "Dashboard Title",
|
|
@@ -1784,63 +1809,63 @@ function _r() {
|
|
|
1784
1809
|
),
|
|
1785
1810
|
ss && ie && /* @__PURE__ */ e(hs, { children: /* @__PURE__ */ c(ps, { children: [
|
|
1786
1811
|
/* @__PURE__ */ e(fs, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1787
|
-
|
|
1812
|
+
L,
|
|
1788
1813
|
{
|
|
1789
1814
|
variant: "ghost",
|
|
1790
1815
|
size: "xs",
|
|
1791
1816
|
onClick: rs,
|
|
1792
|
-
disabled: qa || !(t != null && t.accessToken) || !(
|
|
1817
|
+
disabled: qa || !(t != null && t.accessToken) || !(a != null && a.apiServiceUrl),
|
|
1793
1818
|
className: "w-7 px-0",
|
|
1794
|
-
"aria-label":
|
|
1819
|
+
"aria-label": Ae ? "Remove as default dashboard" : "Make this a default dashboard",
|
|
1795
1820
|
children: /* @__PURE__ */ e(
|
|
1796
|
-
|
|
1821
|
+
Ws,
|
|
1797
1822
|
{
|
|
1798
|
-
className:
|
|
1823
|
+
className: J(
|
|
1799
1824
|
"h-3.5 w-3.5 transition-colors",
|
|
1800
|
-
|
|
1825
|
+
Ae ? "fill-foreground text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
1801
1826
|
)
|
|
1802
1827
|
}
|
|
1803
1828
|
)
|
|
1804
1829
|
}
|
|
1805
1830
|
) }),
|
|
1806
|
-
/* @__PURE__ */ e(gs, { children: /* @__PURE__ */ e("p", { children:
|
|
1831
|
+
/* @__PURE__ */ e(gs, { children: /* @__PURE__ */ e("p", { children: Ae ? "Remove as default dashboard" : "Make this a default dashboard" }) })
|
|
1807
1832
|
] }) })
|
|
1808
1833
|
] }))
|
|
1809
1834
|
] }),
|
|
1810
1835
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1811
1836
|
_ && /* @__PURE__ */ c(T, { children: [
|
|
1812
|
-
/* @__PURE__ */ e(
|
|
1813
|
-
/* @__PURE__ */ e(
|
|
1837
|
+
/* @__PURE__ */ e(gn, {}),
|
|
1838
|
+
/* @__PURE__ */ e(vn, {})
|
|
1814
1839
|
] }),
|
|
1815
|
-
!_ && l && ((Zt =
|
|
1816
|
-
|
|
1840
|
+
!_ && l && ((Zt = W == null ? void 0 : W.permissions) == null ? void 0 : Zt.canShare) && /* @__PURE__ */ c(
|
|
1841
|
+
L,
|
|
1817
1842
|
{
|
|
1818
1843
|
variant: "outline",
|
|
1819
1844
|
size: "xs",
|
|
1820
1845
|
onClick: () => x(!0),
|
|
1821
1846
|
children: [
|
|
1822
|
-
/* @__PURE__ */ e(
|
|
1847
|
+
/* @__PURE__ */ e(Js, { className: "h-3.5 w-3.5" }),
|
|
1823
1848
|
"Share"
|
|
1824
1849
|
]
|
|
1825
1850
|
}
|
|
1826
1851
|
),
|
|
1827
|
-
!_ && E &&
|
|
1828
|
-
|
|
1852
|
+
!_ && E && u.canUseFilters && l && /* @__PURE__ */ e(
|
|
1853
|
+
bn,
|
|
1829
1854
|
{
|
|
1830
|
-
showFilters: w ? !1 :
|
|
1855
|
+
showFilters: w ? !1 : Ne,
|
|
1831
1856
|
onToggleFilters: () => {
|
|
1832
1857
|
if (w && b) {
|
|
1833
1858
|
Ut(b, "inputs");
|
|
1834
1859
|
return;
|
|
1835
1860
|
}
|
|
1836
|
-
|
|
1861
|
+
Ne || Pt("dashboard", !1), _t(!Ne);
|
|
1837
1862
|
},
|
|
1838
1863
|
onAddFilter: () => {
|
|
1839
1864
|
if (w && b) {
|
|
1840
1865
|
Ut(b, "inputs");
|
|
1841
1866
|
return;
|
|
1842
1867
|
}
|
|
1843
|
-
|
|
1868
|
+
Ne || (Pt("dashboard", !1), _t(!0));
|
|
1844
1869
|
},
|
|
1845
1870
|
onAddControl: () => {
|
|
1846
1871
|
Vt("create");
|
|
@@ -1849,27 +1874,27 @@ function _r() {
|
|
|
1849
1874
|
}
|
|
1850
1875
|
),
|
|
1851
1876
|
E && !_ && l && He ? w ? /* @__PURE__ */ e(
|
|
1852
|
-
|
|
1877
|
+
vr,
|
|
1853
1878
|
{
|
|
1854
1879
|
open: !0,
|
|
1855
|
-
onOpenChange: (
|
|
1856
|
-
|
|
1880
|
+
onOpenChange: (o) => {
|
|
1881
|
+
o || he(null);
|
|
1857
1882
|
},
|
|
1858
1883
|
initialMode: He
|
|
1859
1884
|
}
|
|
1860
1885
|
) : /* @__PURE__ */ e(
|
|
1861
|
-
|
|
1886
|
+
yn,
|
|
1862
1887
|
{
|
|
1863
1888
|
open: !0,
|
|
1864
|
-
onOpenChange: (
|
|
1865
|
-
|
|
1889
|
+
onOpenChange: (o) => {
|
|
1890
|
+
o || he(null);
|
|
1866
1891
|
},
|
|
1867
1892
|
showTrigger: !1,
|
|
1868
1893
|
initialMode: He
|
|
1869
1894
|
}
|
|
1870
1895
|
) : null,
|
|
1871
|
-
E && !_ && re &&
|
|
1872
|
-
|
|
1896
|
+
E && !_ && re && d && s && l && /* @__PURE__ */ c(
|
|
1897
|
+
L,
|
|
1873
1898
|
{
|
|
1874
1899
|
variant: "secondary",
|
|
1875
1900
|
size: "xs",
|
|
@@ -1882,7 +1907,7 @@ function _r() {
|
|
|
1882
1907
|
}
|
|
1883
1908
|
),
|
|
1884
1909
|
E && !_ && l && !w && /* @__PURE__ */ c(
|
|
1885
|
-
|
|
1910
|
+
L,
|
|
1886
1911
|
{
|
|
1887
1912
|
variant: "outline",
|
|
1888
1913
|
size: "xs",
|
|
@@ -1894,44 +1919,44 @@ function _r() {
|
|
|
1894
1919
|
]
|
|
1895
1920
|
}
|
|
1896
1921
|
),
|
|
1897
|
-
!_ && !E && xe && l && /* @__PURE__ */ c(
|
|
1898
|
-
/* @__PURE__ */ e(
|
|
1922
|
+
!_ && !E && xe && l && /* @__PURE__ */ c(L, { size: "xs", onClick: Wa, children: [
|
|
1923
|
+
/* @__PURE__ */ e(Ys, { className: "h-3.5 w-3.5" }),
|
|
1899
1924
|
"Edit"
|
|
1900
1925
|
] }),
|
|
1901
1926
|
zt && l && qt && /* @__PURE__ */ c(
|
|
1902
|
-
|
|
1927
|
+
L,
|
|
1903
1928
|
{
|
|
1904
1929
|
variant: "outline",
|
|
1905
1930
|
size: "xs",
|
|
1906
1931
|
onClick: es,
|
|
1907
1932
|
disabled: Ie,
|
|
1908
1933
|
children: [
|
|
1909
|
-
/* @__PURE__ */ e(
|
|
1934
|
+
/* @__PURE__ */ e(Xs, { className: "h-3.5 w-3.5" }),
|
|
1910
1935
|
"Undo"
|
|
1911
1936
|
]
|
|
1912
1937
|
}
|
|
1913
1938
|
),
|
|
1914
1939
|
zt && l && /* @__PURE__ */ c(
|
|
1915
|
-
|
|
1940
|
+
L,
|
|
1916
1941
|
{
|
|
1917
1942
|
size: "xs",
|
|
1918
|
-
className:
|
|
1943
|
+
className: J(!Ht && "opacity-60"),
|
|
1919
1944
|
disabled: Ie || !Ht,
|
|
1920
1945
|
onClick: () => at(),
|
|
1921
1946
|
children: [
|
|
1922
|
-
Ie ? /* @__PURE__ */ e(
|
|
1947
|
+
Ie ? /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(na, { className: "h-3.5 w-3.5" }),
|
|
1923
1948
|
Ie ? "Saving..." : "Save"
|
|
1924
1949
|
]
|
|
1925
1950
|
}
|
|
1926
1951
|
),
|
|
1927
|
-
E && !_ && l && /* @__PURE__ */ c(
|
|
1952
|
+
E && !_ && l && /* @__PURE__ */ c(L, { variant: "outline", size: "xs", onClick: Ya, children: [
|
|
1928
1953
|
/* @__PURE__ */ e(ga, { className: "h-3.5 w-3.5" }),
|
|
1929
1954
|
"Close"
|
|
1930
1955
|
] }),
|
|
1931
|
-
!_ && l && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(
|
|
1932
|
-
!_ &&
|
|
1933
|
-
!_ && l && /* @__PURE__ */ c(
|
|
1934
|
-
/* @__PURE__ */ e(
|
|
1956
|
+
!_ && l && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(xn, {}) }),
|
|
1957
|
+
!_ && s && /* @__PURE__ */ e(Gn, {}),
|
|
1958
|
+
!_ && l && /* @__PURE__ */ c(Zs, { children: [
|
|
1959
|
+
/* @__PURE__ */ e(en, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1935
1960
|
rt,
|
|
1936
1961
|
{
|
|
1937
1962
|
tooltip: "More Options",
|
|
@@ -1941,11 +1966,11 @@ function _r() {
|
|
|
1941
1966
|
variant: "ghost",
|
|
1942
1967
|
"aria-label": "More dashboard options"
|
|
1943
1968
|
},
|
|
1944
|
-
children: /* @__PURE__ */ e(
|
|
1969
|
+
children: /* @__PURE__ */ e(tn, { className: "h-3.5 w-3.5" })
|
|
1945
1970
|
}
|
|
1946
1971
|
) }),
|
|
1947
1972
|
/* @__PURE__ */ c(
|
|
1948
|
-
|
|
1973
|
+
an,
|
|
1949
1974
|
{
|
|
1950
1975
|
align: "end",
|
|
1951
1976
|
className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
|
|
@@ -1955,9 +1980,9 @@ function _r() {
|
|
|
1955
1980
|
$,
|
|
1956
1981
|
{
|
|
1957
1982
|
disabled: v,
|
|
1958
|
-
onSelect: () =>
|
|
1983
|
+
onSelect: () => Mt(!0),
|
|
1959
1984
|
children: [
|
|
1960
|
-
/* @__PURE__ */ e(
|
|
1985
|
+
/* @__PURE__ */ e(sn, { className: "h-3.5 w-3.5" }),
|
|
1961
1986
|
"Export"
|
|
1962
1987
|
]
|
|
1963
1988
|
}
|
|
@@ -1970,7 +1995,7 @@ function _r() {
|
|
|
1970
1995
|
oe && ee(!0);
|
|
1971
1996
|
},
|
|
1972
1997
|
children: [
|
|
1973
|
-
/* @__PURE__ */ e(
|
|
1998
|
+
/* @__PURE__ */ e(nn, { className: "h-3.5 w-3.5" }),
|
|
1974
1999
|
"Schedule"
|
|
1975
2000
|
]
|
|
1976
2001
|
}
|
|
@@ -1981,7 +2006,7 @@ function _r() {
|
|
|
1981
2006
|
/* @__PURE__ */ c(
|
|
1982
2007
|
$,
|
|
1983
2008
|
{
|
|
1984
|
-
onClick: () =>
|
|
2009
|
+
onClick: () => Q(!0),
|
|
1985
2010
|
children: [
|
|
1986
2011
|
/* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" }),
|
|
1987
2012
|
"Manage Groups"
|
|
@@ -1992,24 +2017,24 @@ function _r() {
|
|
|
1992
2017
|
] }),
|
|
1993
2018
|
/* @__PURE__ */ e(de, { children: "Preferences" }),
|
|
1994
2019
|
/* @__PURE__ */ c($, { onClick: () => k(!0), children: [
|
|
1995
|
-
/* @__PURE__ */ e(
|
|
2020
|
+
/* @__PURE__ */ e(rn, { className: "h-3.5 w-3.5" }),
|
|
1996
2021
|
"Calendar Preferences"
|
|
1997
2022
|
] }),
|
|
1998
|
-
/* @__PURE__ */ c($, { onClick: () =>
|
|
1999
|
-
/* @__PURE__ */ e(
|
|
2023
|
+
/* @__PURE__ */ c($, { onClick: () => H(!0), children: [
|
|
2024
|
+
/* @__PURE__ */ e(on, { className: "h-3.5 w-3.5" }),
|
|
2000
2025
|
"Summary Settings"
|
|
2001
2026
|
] }),
|
|
2002
|
-
|
|
2027
|
+
s && l && /* @__PURE__ */ c(T, { children: [
|
|
2003
2028
|
/* @__PURE__ */ e(Te, {}),
|
|
2004
2029
|
/* @__PURE__ */ e(de, { children: "Developer" }),
|
|
2005
2030
|
/* @__PURE__ */ c(
|
|
2006
2031
|
$,
|
|
2007
2032
|
{
|
|
2008
2033
|
onSelect: () => {
|
|
2009
|
-
var
|
|
2010
|
-
t != null && t.accessToken && ((
|
|
2011
|
-
() =>
|
|
2012
|
-
).catch(() =>
|
|
2034
|
+
var o;
|
|
2035
|
+
t != null && t.accessToken && ((o = navigator == null ? void 0 : navigator.clipboard) != null && o.writeText ? navigator.clipboard.writeText(t.accessToken).then(
|
|
2036
|
+
() => A.success("Token copied to clipboard")
|
|
2037
|
+
).catch(() => A.error("Unable to copy token")) : A.error("Clipboard not available"));
|
|
2013
2038
|
},
|
|
2014
2039
|
children: [
|
|
2015
2040
|
/* @__PURE__ */ e(sa, { className: "h-3.5 w-3.5" }),
|
|
@@ -2022,22 +2047,22 @@ function _r() {
|
|
|
2022
2047
|
{
|
|
2023
2048
|
disabled: !Xe,
|
|
2024
2049
|
onSelect: () => {
|
|
2025
|
-
var
|
|
2050
|
+
var o;
|
|
2026
2051
|
if (!Xe) {
|
|
2027
|
-
|
|
2052
|
+
A.error(
|
|
2028
2053
|
"Open a document sheet with a token to copy the local PDF URL"
|
|
2029
2054
|
);
|
|
2030
2055
|
return;
|
|
2031
2056
|
}
|
|
2032
|
-
(
|
|
2033
|
-
() =>
|
|
2057
|
+
(o = navigator == null ? void 0 : navigator.clipboard) != null && o.writeText ? navigator.clipboard.writeText(Xe).then(
|
|
2058
|
+
() => A.success(
|
|
2034
2059
|
"Local document PDF URL copied to clipboard"
|
|
2035
2060
|
)
|
|
2036
2061
|
).catch(
|
|
2037
|
-
() =>
|
|
2062
|
+
() => A.error(
|
|
2038
2063
|
"Unable to copy local document PDF URL"
|
|
2039
2064
|
)
|
|
2040
|
-
) :
|
|
2065
|
+
) : A.error("Clipboard not available");
|
|
2041
2066
|
},
|
|
2042
2067
|
children: [
|
|
2043
2068
|
/* @__PURE__ */ e(sa, { className: "h-3.5 w-3.5" }),
|
|
@@ -2048,15 +2073,15 @@ function _r() {
|
|
|
2048
2073
|
/* @__PURE__ */ c(
|
|
2049
2074
|
$,
|
|
2050
2075
|
{
|
|
2051
|
-
onSelect: () => vs(
|
|
2076
|
+
onSelect: () => vs(a.apiServiceUrl),
|
|
2052
2077
|
children: [
|
|
2053
|
-
/* @__PURE__ */ e(
|
|
2078
|
+
/* @__PURE__ */ e(Tn, { className: "h-3.5 w-3.5" }),
|
|
2054
2079
|
"Invalidate token"
|
|
2055
2080
|
]
|
|
2056
2081
|
}
|
|
2057
2082
|
),
|
|
2058
|
-
/* @__PURE__ */ c($, { onSelect:
|
|
2059
|
-
/* @__PURE__ */ e(
|
|
2083
|
+
/* @__PURE__ */ c($, { onSelect: i, children: [
|
|
2084
|
+
/* @__PURE__ */ e(An, { className: "h-3.5 w-3.5" }),
|
|
2060
2085
|
"Brand Studio"
|
|
2061
2086
|
] }),
|
|
2062
2087
|
E && /* @__PURE__ */ c(
|
|
@@ -2064,7 +2089,7 @@ function _r() {
|
|
|
2064
2089
|
{
|
|
2065
2090
|
onSelect: () => Rt(!Tt),
|
|
2066
2091
|
children: [
|
|
2067
|
-
/* @__PURE__ */ e(
|
|
2092
|
+
/* @__PURE__ */ e(Ln, { className: "h-3.5 w-3.5" }),
|
|
2068
2093
|
Tt ? "Hide dashboard JSON" : "Show dashboard JSON"
|
|
2069
2094
|
]
|
|
2070
2095
|
}
|
|
@@ -2073,12 +2098,12 @@ function _r() {
|
|
|
2073
2098
|
/* @__PURE__ */ e(ht, { className: "h-3.5 w-3.5" }),
|
|
2074
2099
|
"Add lens"
|
|
2075
2100
|
] }),
|
|
2076
|
-
re && /* @__PURE__ */ c(
|
|
2077
|
-
/* @__PURE__ */ c(
|
|
2101
|
+
re && /* @__PURE__ */ c(cn, { children: [
|
|
2102
|
+
/* @__PURE__ */ c(ln, { children: [
|
|
2078
2103
|
/* @__PURE__ */ e(Mn, { className: "h-3.5 w-3.5" }),
|
|
2079
2104
|
"Lenses"
|
|
2080
2105
|
] }),
|
|
2081
|
-
/* @__PURE__ */ e(
|
|
2106
|
+
/* @__PURE__ */ e(dn, { className: "w-60", children: /* @__PURE__ */ e(Bn, {}) })
|
|
2082
2107
|
] })
|
|
2083
2108
|
] })
|
|
2084
2109
|
]
|
|
@@ -2086,7 +2111,7 @@ function _r() {
|
|
|
2086
2111
|
)
|
|
2087
2112
|
] }),
|
|
2088
2113
|
z && $t && /* @__PURE__ */ e(
|
|
2089
|
-
|
|
2114
|
+
un,
|
|
2090
2115
|
{
|
|
2091
2116
|
resource: $t,
|
|
2092
2117
|
resourceType: nt.DASHBOARD,
|
|
@@ -2094,39 +2119,39 @@ function _r() {
|
|
|
2094
2119
|
}
|
|
2095
2120
|
),
|
|
2096
2121
|
/* @__PURE__ */ e(
|
|
2097
|
-
|
|
2122
|
+
hr,
|
|
2098
2123
|
{
|
|
2099
2124
|
open: B,
|
|
2100
|
-
onOpenChange:
|
|
2125
|
+
onOpenChange: Q
|
|
2101
2126
|
}
|
|
2102
2127
|
),
|
|
2103
|
-
oe && (
|
|
2104
|
-
|
|
2128
|
+
oe && (r == null ? void 0 : r.id) && /* @__PURE__ */ e(
|
|
2129
|
+
mn,
|
|
2105
2130
|
{
|
|
2106
|
-
open:
|
|
2131
|
+
open: Z,
|
|
2107
2132
|
onOpenChange: ee,
|
|
2108
|
-
dashboardId:
|
|
2109
|
-
dashboardName:
|
|
2133
|
+
dashboardId: r.id,
|
|
2134
|
+
dashboardName: r == null ? void 0 : r.title
|
|
2110
2135
|
}
|
|
2111
2136
|
),
|
|
2112
2137
|
/* @__PURE__ */ e(
|
|
2113
|
-
|
|
2138
|
+
wn,
|
|
2114
2139
|
{
|
|
2115
2140
|
open: y,
|
|
2116
2141
|
onOpenChange: k
|
|
2117
2142
|
}
|
|
2118
2143
|
),
|
|
2119
2144
|
/* @__PURE__ */ e(
|
|
2120
|
-
|
|
2145
|
+
Dn,
|
|
2121
2146
|
{
|
|
2122
2147
|
open: G,
|
|
2123
|
-
onOpenChange:
|
|
2124
|
-
dashboard:
|
|
2148
|
+
onOpenChange: H,
|
|
2149
|
+
dashboard: r,
|
|
2125
2150
|
disabled: !E,
|
|
2126
|
-
onApply: (
|
|
2151
|
+
onApply: (o) => Ze(
|
|
2127
2152
|
{
|
|
2128
|
-
...
|
|
2129
|
-
summary:
|
|
2153
|
+
...r,
|
|
2154
|
+
summary: o
|
|
2130
2155
|
},
|
|
2131
2156
|
{
|
|
2132
2157
|
semanticExecutionPayload: et
|
|
@@ -2134,28 +2159,28 @@ function _r() {
|
|
|
2134
2159
|
)
|
|
2135
2160
|
}
|
|
2136
2161
|
),
|
|
2137
|
-
|
|
2162
|
+
s && re && l && /* @__PURE__ */ e(qn, { open: me, onOpenChange: te }),
|
|
2138
2163
|
l && /* @__PURE__ */ e(
|
|
2139
|
-
|
|
2164
|
+
hn,
|
|
2140
2165
|
{
|
|
2141
2166
|
open: Ua,
|
|
2142
|
-
onOpenChange:
|
|
2167
|
+
onOpenChange: Mt
|
|
2143
2168
|
}
|
|
2144
2169
|
),
|
|
2145
2170
|
/* @__PURE__ */ e(
|
|
2146
2171
|
ya,
|
|
2147
2172
|
{
|
|
2148
2173
|
open: Fa,
|
|
2149
|
-
onOpenChange: (
|
|
2150
|
-
!
|
|
2174
|
+
onOpenChange: (o) => {
|
|
2175
|
+
!o && We && !fe || (pe(o), o || (ge(null), ve([]), be(!1)));
|
|
2151
2176
|
},
|
|
2152
2177
|
children: /* @__PURE__ */ c(xa, { className: "max-w-sm", children: [
|
|
2153
|
-
/* @__PURE__ */ c(
|
|
2154
|
-
/* @__PURE__ */ e(
|
|
2178
|
+
/* @__PURE__ */ c(Na, { children: [
|
|
2179
|
+
/* @__PURE__ */ e(Sa, { children: fe ? "Save failed" : "Saving dashboard" }),
|
|
2155
2180
|
/* @__PURE__ */ e(wa, { className: "pt-2", children: fe ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
2156
2181
|
Ot.length > 0 && /* @__PURE__ */ c("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
2157
2182
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
2158
|
-
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: Ot.slice(0, 5).map((
|
|
2183
|
+
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: Ot.slice(0, 5).map((o) => /* @__PURE__ */ e("li", { children: o }, o)) })
|
|
2159
2184
|
] })
|
|
2160
2185
|
] }),
|
|
2161
2186
|
/* @__PURE__ */ e(Da, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: fe ? /* @__PURE__ */ c(T, { children: [
|
|
@@ -2181,18 +2206,18 @@ function _r() {
|
|
|
2181
2206
|
}
|
|
2182
2207
|
)
|
|
2183
2208
|
] }) : /* @__PURE__ */ c(vt, { disabled: !0, className: "m-0 cursor-default", children: [
|
|
2184
|
-
/* @__PURE__ */ e(
|
|
2209
|
+
/* @__PURE__ */ e(Y, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2185
2210
|
"Saving..."
|
|
2186
2211
|
] }) })
|
|
2187
2212
|
] })
|
|
2188
2213
|
}
|
|
2189
2214
|
),
|
|
2190
2215
|
/* @__PURE__ */ e(
|
|
2191
|
-
|
|
2216
|
+
Nn,
|
|
2192
2217
|
{
|
|
2193
2218
|
open: Ka,
|
|
2194
|
-
onOpenChange: (
|
|
2195
|
-
se(
|
|
2219
|
+
onOpenChange: (o) => {
|
|
2220
|
+
se(o);
|
|
2196
2221
|
},
|
|
2197
2222
|
onSave: Xa,
|
|
2198
2223
|
onDiscard: Za,
|
|
@@ -2206,21 +2231,21 @@ function _r() {
|
|
|
2206
2231
|
}
|
|
2207
2232
|
);
|
|
2208
2233
|
}
|
|
2209
|
-
function
|
|
2234
|
+
function Sr({
|
|
2210
2235
|
accessToken: t,
|
|
2211
|
-
dashboardId:
|
|
2236
|
+
dashboardId: a,
|
|
2212
2237
|
selectedSheetId: n,
|
|
2213
|
-
pageSize:
|
|
2214
|
-
orientation:
|
|
2215
|
-
theme:
|
|
2238
|
+
pageSize: s,
|
|
2239
|
+
orientation: i,
|
|
2240
|
+
theme: u
|
|
2216
2241
|
}) {
|
|
2217
2242
|
if (!t || !n)
|
|
2218
2243
|
return null;
|
|
2219
2244
|
const l = new URL("http://localhost:5173/print-document");
|
|
2220
|
-
l.searchParams.set("token", t),
|
|
2221
|
-
const
|
|
2222
|
-
return
|
|
2245
|
+
l.searchParams.set("token", t), a && l.searchParams.set("dashboardId", a), l.searchParams.set("selectedSheetId", n), u && l.searchParams.set("theme", u);
|
|
2246
|
+
const p = new URL("http://127.0.0.1:3002/");
|
|
2247
|
+
return p.searchParams.set("pdfMode", "document"), p.searchParams.set("pageSize", s || "letter"), p.searchParams.set("orientation", i || "portrait"), p.searchParams.set("url", l.toString()), p.toString();
|
|
2223
2248
|
}
|
|
2224
2249
|
export {
|
|
2225
|
-
|
|
2250
|
+
Fr as default
|
|
2226
2251
|
};
|