react-semaphor 0.1.435 → 0.1.437
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{dashboard-BSHDErvU.js → dashboard--OqogTLn.js} +23217 -23170
- package/dist/chunks/{dashboard-Bp3M6YmS.js → dashboard-BJr7m1TP.js} +208 -208
- package/dist/chunks/dashboard-briefing-launcher-BRjtoHFz.js +31 -0
- package/dist/chunks/{dashboard-briefing-launcher-D-QS3bYN.js → dashboard-briefing-launcher-Cegf8sog.js} +752 -740
- package/dist/chunks/{dashboard-controls-BKaTTk-y.js → dashboard-controls-BjWzQbOT.js} +884 -874
- package/dist/chunks/dashboard-controls-DbOKYwbJ.js +36 -0
- package/dist/chunks/{dashboard-json-BkL6Xf10.js → dashboard-json-BYHE2Xi7.js} +1 -1
- package/dist/chunks/{dashboard-json-DrOZ5EP1.js → dashboard-json-D3rtzp8l.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DOFAJpQh.js → edit-dashboard-visual-3rc-aeNO.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-BcV0QmRp.js → edit-dashboard-visual-BKTpoR38.js} +702 -699
- package/dist/chunks/{report-preferences-dialog-BiCnXwKt.js → report-preferences-dialog-CoYKKbFc.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-Nib_Yl_j.js → report-preferences-dialog-VVM61k5R.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CG5Se5yF.js → use-create-flow-overlay-state-CpH9832I.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CNdny3Z2.js → use-create-flow-overlay-state-Doo8NeYf.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +2 -0
- package/dist/types/main.d.ts +2 -0
- package/dist/types/surfboard.d.ts +2 -0
- package/dist/types/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-briefing-launcher-C9phmdyP.js +0 -31
- package/dist/chunks/dashboard-controls-Znhp6MTa.js +0 -36
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as e, jsxs as n, Fragment as
|
|
2
|
-
import { u as D, B as
|
|
3
|
-
import { bC as
|
|
4
|
-
import { c as Z, X as
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { u as D, B as R, aw as ct, A as ta, O as ja, Z as Ka, c as ve, ax as ut, ay as Qa, az as Wa, aA as aa, aB as ye, aC as mt, aD as ra, L as $e, aE as sa, aF as Ja, E as zt, Q as Ya, V as Xa, W as Za, Y as er, o as tr, aG as ar } from "./code-editor-C8zzmSgt.js";
|
|
3
|
+
import { bC as rr, bD as sr, az as _, aH as na, bE as nr, aZ as H, aI as oa, aJ as or, aK as ot, aL as it, aF as ir, bF as xe, bG as Be, bH as dr, bI as _t, bJ as ia, bK as da, bL as lr, bM as ht, bN as cr, bO as ur, bP as mr, bQ as hr, bR as pr, bS as fr, b8 as we, bT as Ne, aG as I, bU as gr, bV as la, br as pt, bW as br, bX as xr, bY as ca, bZ as vr, b_ as ua, b$ as T, c0 as yr, aj as wr, c1 as Nr, c2 as Dr, c3 as Cr, an as kr, av as Te, aw as Sr, w as st, c4 as Ir, c5 as Mr, c6 as Er, c7 as Lr, ai as Ar, c8 as Pr, c9 as Ur, I as qt, ca as Rr, cb as Vr, cc as Fr, cd as Or, ce as Tr, cf as Ht, cg as jt, ch as Kt, ci as Gr, cj as Br, ck as $r, cl as zr, b1 as Qt, cm as _r, cn as qr, co as Hr, y as jr, cp as Kr, aP as Qr, aS as Wr, aT as Jr, aU as Yr, aV as Xr, aW as Zr, aX as es, aY as Wt, g as dt } from "./dashboard--OqogTLn.js";
|
|
4
|
+
import { c as Z, X as ma, C as ts } from "./index-xHCrHprY.js";
|
|
5
5
|
import "./analyze-result-contract-CfOBEwaC.js";
|
|
6
6
|
import "../value-format-preferences/index.js";
|
|
7
|
-
import * as
|
|
8
|
-
import { useState as
|
|
7
|
+
import * as U from "react";
|
|
8
|
+
import { useState as v, useMemo as X, useEffect as ze, useRef as Jt, useLayoutEffect as as, useCallback as rs } from "react";
|
|
9
9
|
import "./index-If0wlXGi.js";
|
|
10
10
|
import "./comparison-document-migration-Dj6xZMCb.js";
|
|
11
|
-
import { createPortal as
|
|
11
|
+
import { createPortal as ss } from "react-dom";
|
|
12
12
|
import "../briefings/index.js";
|
|
13
|
-
import { g as
|
|
14
|
-
import { S as
|
|
15
|
-
import { d as
|
|
16
|
-
import { R as
|
|
17
|
-
import { u as
|
|
18
|
-
import { s as
|
|
19
|
-
import { S as
|
|
20
|
-
import { P as
|
|
21
|
-
import { B as
|
|
13
|
+
import { g as ns, u as os, A as is, V as ds, c as ls, f as cs, N as us, D as ms, U as hs } from "./dashboard-briefing-launcher-Cegf8sog.js";
|
|
14
|
+
import { S as ps, C as fs } from "./search-DHZCro8B.js";
|
|
15
|
+
import { d as ha } from "./index-CnujJ3fa.js";
|
|
16
|
+
import { R as gs } from "./report-preferences-dialog-VVM61k5R.js";
|
|
17
|
+
import { u as bs } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
18
|
+
import { s as nt } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
19
|
+
import { S as Yt } from "./save-HCJjjzdX.js";
|
|
20
|
+
import { P as xs } from "./palette-jqaAcwiQ.js";
|
|
21
|
+
import { B as vs } from "./braces-BdbUk_r9.js";
|
|
22
22
|
/**
|
|
23
23
|
* @license lucide-react v0.453.0 - ISC
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const ys = Z("Glasses", [
|
|
29
29
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
30
30
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
31
31
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -38,7 +38,7 @@ const bs = Z("Glasses", [
|
|
|
38
38
|
* This source code is licensed under the ISC license.
|
|
39
39
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
|
-
const
|
|
41
|
+
const ws = Z("Monitor", [
|
|
42
42
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
43
43
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
44
44
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
@@ -49,7 +49,7 @@ const xs = Z("Monitor", [
|
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
51
|
*/
|
|
52
|
-
const
|
|
52
|
+
const Ns = Z("Moon", [
|
|
53
53
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
54
54
|
]);
|
|
55
55
|
/**
|
|
@@ -58,7 +58,7 @@ const vs = Z("Moon", [
|
|
|
58
58
|
* This source code is licensed under the ISC license.
|
|
59
59
|
* See the LICENSE file in the root directory of this source tree.
|
|
60
60
|
*/
|
|
61
|
-
const
|
|
61
|
+
const Ds = Z("ShieldX", [
|
|
62
62
|
[
|
|
63
63
|
"path",
|
|
64
64
|
{
|
|
@@ -75,7 +75,7 @@ const ys = Z("ShieldX", [
|
|
|
75
75
|
* This source code is licensed under the ISC license.
|
|
76
76
|
* See the LICENSE file in the root directory of this source tree.
|
|
77
77
|
*/
|
|
78
|
-
const
|
|
78
|
+
const Cs = Z("Sun", [
|
|
79
79
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
80
80
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
81
81
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -92,7 +92,7 @@ const ws = Z("Sun", [
|
|
|
92
92
|
* This source code is licensed under the ISC license.
|
|
93
93
|
* See the LICENSE file in the root directory of this source tree.
|
|
94
94
|
*/
|
|
95
|
-
const
|
|
95
|
+
const ks = Z("UserPlus", [
|
|
96
96
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
97
97
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
98
98
|
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
@@ -104,35 +104,35 @@ const Ns = Z("UserPlus", [
|
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
106
|
*/
|
|
107
|
-
const
|
|
107
|
+
const pa = Z("UserRound", [
|
|
108
108
|
["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
|
|
109
109
|
["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
|
|
110
|
-
]),
|
|
111
|
-
function
|
|
112
|
-
const { theme: t, setTheme: s } =
|
|
113
|
-
(
|
|
110
|
+
]), Ge = ["light", "dark", "system"];
|
|
111
|
+
function Ss() {
|
|
112
|
+
const { theme: t, setTheme: s } = rr(), r = D(
|
|
113
|
+
(h) => h.actions.setDashboardTheme
|
|
114
114
|
);
|
|
115
115
|
function a() {
|
|
116
|
-
const
|
|
117
|
-
s(
|
|
116
|
+
const h = Ge.includes(t) ? t : "system", l = Ge[(Ge.indexOf(h) + 1) % Ge.length];
|
|
117
|
+
s(l), r(l);
|
|
118
118
|
}
|
|
119
|
-
const o = t === "light" ?
|
|
119
|
+
const o = t === "light" ? Cs : t === "dark" ? Ns : ws, c = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
|
|
120
120
|
return /* @__PURE__ */ e(
|
|
121
|
-
|
|
121
|
+
R,
|
|
122
122
|
{
|
|
123
123
|
type: "button",
|
|
124
124
|
variant: "ghost",
|
|
125
125
|
size: "xs",
|
|
126
126
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
|
|
127
127
|
onClick: a,
|
|
128
|
-
"aria-label":
|
|
129
|
-
title:
|
|
128
|
+
"aria-label": c,
|
|
129
|
+
title: c,
|
|
130
130
|
children: /* @__PURE__ */ e(o, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
|
|
131
131
|
}
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
const s = (/* @__PURE__ */ new Date()).toISOString(), r =
|
|
134
|
+
function fa(t) {
|
|
135
|
+
const s = (/* @__PURE__ */ new Date()).toISOString(), r = sr({
|
|
136
136
|
dashboard: t.dashboard,
|
|
137
137
|
sheetIds: (t.dashboard.sheets || []).filter((a) => a.kind !== "document").map((a) => a.id),
|
|
138
138
|
sheetKind: "dashboard",
|
|
@@ -151,163 +151,163 @@ function ha(t) {
|
|
|
151
151
|
dashboardInputValues: r.dashboardInputValues
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
async function
|
|
155
|
-
if (!
|
|
154
|
+
async function Is(t, s, r, a, o, c) {
|
|
155
|
+
if (!c)
|
|
156
156
|
return null;
|
|
157
|
-
const
|
|
158
|
-
return await
|
|
157
|
+
const h = JSON.stringify(r), l = `${t}/v1/lens`;
|
|
158
|
+
return await ct(l, c, {
|
|
159
159
|
name: s,
|
|
160
|
-
template:
|
|
160
|
+
template: h,
|
|
161
161
|
filterValues: a,
|
|
162
162
|
inputValues: o,
|
|
163
163
|
operation: "create"
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
-
async function
|
|
166
|
+
async function lt(t, s, r) {
|
|
167
167
|
if (!r)
|
|
168
168
|
return null;
|
|
169
169
|
const {
|
|
170
170
|
id: a,
|
|
171
171
|
template: o,
|
|
172
|
-
filterValues:
|
|
173
|
-
inputValues:
|
|
174
|
-
isDefault:
|
|
175
|
-
shared:
|
|
176
|
-
} = s,
|
|
177
|
-
return await
|
|
172
|
+
filterValues: c,
|
|
173
|
+
inputValues: h,
|
|
174
|
+
isDefault: l,
|
|
175
|
+
shared: b
|
|
176
|
+
} = s, x = `${t}/v1/lens`;
|
|
177
|
+
return await ct(x, r, {
|
|
178
178
|
lensId: a,
|
|
179
179
|
template: o,
|
|
180
|
-
filterValues:
|
|
181
|
-
inputValues:
|
|
182
|
-
isDefault:
|
|
183
|
-
shared:
|
|
180
|
+
filterValues: c,
|
|
181
|
+
inputValues: h,
|
|
182
|
+
isDefault: l,
|
|
183
|
+
shared: b,
|
|
184
184
|
operation: "update"
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
async function
|
|
187
|
+
async function Ms(t, s, r) {
|
|
188
188
|
if (!r)
|
|
189
189
|
return null;
|
|
190
190
|
const a = `${t}/v1/lens`;
|
|
191
|
-
return await
|
|
191
|
+
return await ct(a, r, {
|
|
192
192
|
operation: "delete",
|
|
193
193
|
lensId: s
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
const
|
|
197
|
-
function
|
|
196
|
+
const Es = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
197
|
+
function Ls({
|
|
198
198
|
open: t,
|
|
199
199
|
onOpenChange: s
|
|
200
200
|
} = {}) {
|
|
201
|
-
const [r, a] =
|
|
202
|
-
|
|
203
|
-
},
|
|
204
|
-
async function
|
|
201
|
+
const [r, a] = v(""), [o, c] = v(!1), h = D((w) => w.lenses), { setLenses: l, setSelectedLensId: b } = ta(), [x, d] = v(!1), [u, g] = v(!1), p = t !== void 0, y = p ? t : u, N = (w) => {
|
|
202
|
+
p || g(w), s == null || s(w);
|
|
203
|
+
}, C = D((w) => w.dashboard), S = D((w) => w.filterValues), { authToken: m, tokenProps: B } = _();
|
|
204
|
+
async function V() {
|
|
205
205
|
d(!0);
|
|
206
|
-
const
|
|
207
|
-
dashboard:
|
|
208
|
-
dashboardInputValues:
|
|
209
|
-
filterValues:
|
|
210
|
-
controlValues:
|
|
211
|
-
inlineFilterValuesMap:
|
|
212
|
-
cardControlValuesMap:
|
|
213
|
-
}),
|
|
214
|
-
|
|
206
|
+
const w = D.getState(), M = fa({
|
|
207
|
+
dashboard: C,
|
|
208
|
+
dashboardInputValues: w.dashboardInputValues,
|
|
209
|
+
filterValues: S,
|
|
210
|
+
controlValues: w.controlValues,
|
|
211
|
+
inlineFilterValuesMap: w.inlineFilterValuesMap,
|
|
212
|
+
cardControlValuesMap: w.cardControlValuesMap
|
|
213
|
+
}), k = await Is(
|
|
214
|
+
B.apiServiceUrl,
|
|
215
215
|
r,
|
|
216
|
-
|
|
216
|
+
C,
|
|
217
|
+
S,
|
|
217
218
|
M,
|
|
218
|
-
|
|
219
|
-
S == null ? void 0 : S.accessToken
|
|
219
|
+
m == null ? void 0 : m.accessToken
|
|
220
220
|
);
|
|
221
|
-
|
|
221
|
+
k && (l([...h || [], k]), b(k.id), N(!1)), d(!1);
|
|
222
222
|
}
|
|
223
|
-
return /* @__PURE__ */ n(
|
|
224
|
-
|
|
223
|
+
return /* @__PURE__ */ n(na, { open: y, onOpenChange: N, children: [
|
|
224
|
+
p ? null : /* @__PURE__ */ e(nr, { asChild: !0, children: /* @__PURE__ */ n(R, { variant: "secondary", size: "xs", children: [
|
|
225
225
|
/* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
|
|
226
226
|
"Lens"
|
|
227
227
|
] }) }),
|
|
228
|
-
/* @__PURE__ */ n(
|
|
229
|
-
/* @__PURE__ */ n(
|
|
230
|
-
/* @__PURE__ */ e(
|
|
231
|
-
/* @__PURE__ */ e(
|
|
228
|
+
/* @__PURE__ */ n(oa, { className: "rounded-control border-border/60 sm:max-w-[420px] sm:rounded-control", children: [
|
|
229
|
+
/* @__PURE__ */ n(or, { children: [
|
|
230
|
+
/* @__PURE__ */ e(ot, { className: "text-[15px]", children: "Create lens" }),
|
|
231
|
+
/* @__PURE__ */ e(it, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
|
|
232
232
|
] }),
|
|
233
233
|
/* @__PURE__ */ n("div", { className: "space-y-1.5 py-1", children: [
|
|
234
|
-
/* @__PURE__ */ e(
|
|
234
|
+
/* @__PURE__ */ e(ja, { htmlFor: "lens-name", className: Es, children: "Name" }),
|
|
235
235
|
/* @__PURE__ */ e(
|
|
236
|
-
|
|
236
|
+
Ka,
|
|
237
237
|
{
|
|
238
238
|
id: "lens-name",
|
|
239
239
|
size: "xs",
|
|
240
240
|
value: r,
|
|
241
241
|
placeholder: "Monthly review, West region, …",
|
|
242
|
-
onChange: (
|
|
242
|
+
onChange: (w) => a(w.target.value)
|
|
243
243
|
}
|
|
244
244
|
),
|
|
245
245
|
o && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: "A lens with this name already exists. Pick a different one." })
|
|
246
246
|
] }),
|
|
247
|
-
/* @__PURE__ */ n(
|
|
248
|
-
/* @__PURE__ */ e(
|
|
247
|
+
/* @__PURE__ */ n(ir, { children: [
|
|
248
|
+
/* @__PURE__ */ e(R, { variant: "outline", size: "xs", onClick: () => N(!1), children: "Cancel" }),
|
|
249
249
|
/* @__PURE__ */ e(
|
|
250
|
-
|
|
250
|
+
R,
|
|
251
251
|
{
|
|
252
252
|
size: "xs",
|
|
253
253
|
type: "submit",
|
|
254
|
-
onClick:
|
|
255
|
-
disabled:
|
|
256
|
-
children:
|
|
254
|
+
onClick: V,
|
|
255
|
+
disabled: x || !r.trim(),
|
|
256
|
+
children: x ? "Creating…" : "Create"
|
|
257
257
|
}
|
|
258
258
|
)
|
|
259
259
|
] })
|
|
260
260
|
] })
|
|
261
261
|
] });
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
const s = D((d) => d.lenses), r = D((d) => d.selectedLensId), { setLenses: a, setSelectedLensId: o } =
|
|
265
|
-
async function
|
|
263
|
+
function As({ includeLabel: t = !1 } = {}) {
|
|
264
|
+
const s = D((d) => d.lenses), r = D((d) => d.selectedLensId), { setLenses: a, setSelectedLensId: o } = ta(), { authToken: c, tokenProps: h } = _();
|
|
265
|
+
async function l(d) {
|
|
266
266
|
o(d);
|
|
267
267
|
}
|
|
268
|
-
async function
|
|
269
|
-
if (await
|
|
270
|
-
const
|
|
271
|
-
a(
|
|
268
|
+
async function b(d) {
|
|
269
|
+
if (await Ms(h.apiServiceUrl, d, c == null ? void 0 : c.accessToken)) {
|
|
270
|
+
const g = s == null ? void 0 : s.filter((p) => p.id !== d);
|
|
271
|
+
a(g || []), o("original");
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
async function
|
|
275
|
-
const u = s == null ? void 0 : s.map((
|
|
276
|
-
...
|
|
274
|
+
async function x(d) {
|
|
275
|
+
const u = s == null ? void 0 : s.map((y) => y.id === d.id ? {
|
|
276
|
+
...y,
|
|
277
277
|
isDefault: !d.isDefault
|
|
278
278
|
} : {
|
|
279
|
-
...
|
|
279
|
+
...y,
|
|
280
280
|
isDefault: !1
|
|
281
281
|
});
|
|
282
282
|
a(u || []);
|
|
283
|
-
const
|
|
283
|
+
const g = {
|
|
284
284
|
...d,
|
|
285
285
|
isDefault: !d.isDefault
|
|
286
286
|
};
|
|
287
|
-
await
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
290
|
-
const
|
|
291
|
-
...
|
|
287
|
+
await lt(h.apiServiceUrl, g, c == null ? void 0 : c.accessToken);
|
|
288
|
+
const p = s == null ? void 0 : s.find((y) => y.isDefault);
|
|
289
|
+
if (p && p.id !== d.id) {
|
|
290
|
+
const y = {
|
|
291
|
+
...p,
|
|
292
292
|
isDefault: !1
|
|
293
293
|
};
|
|
294
|
-
await
|
|
294
|
+
await lt(h.apiServiceUrl, y, c == null ? void 0 : c.accessToken);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
return /* @__PURE__ */ n(
|
|
298
|
-
t ? /* @__PURE__ */ n(
|
|
299
|
-
/* @__PURE__ */ e(
|
|
300
|
-
/* @__PURE__ */ e(
|
|
297
|
+
return /* @__PURE__ */ n(G, { children: [
|
|
298
|
+
t ? /* @__PURE__ */ n(G, { children: [
|
|
299
|
+
/* @__PURE__ */ e(xe, { className: "px-3", children: "Lenses" }),
|
|
300
|
+
/* @__PURE__ */ e(Be, {})
|
|
301
301
|
] }) : null,
|
|
302
302
|
/* @__PURE__ */ n(
|
|
303
|
-
|
|
303
|
+
dr,
|
|
304
304
|
{
|
|
305
305
|
value: r,
|
|
306
|
-
onValueChange:
|
|
306
|
+
onValueChange: l,
|
|
307
307
|
children: [
|
|
308
|
-
/* @__PURE__ */ e(
|
|
308
|
+
/* @__PURE__ */ e(_t, { value: "original", children: "Original" }),
|
|
309
309
|
s == null ? void 0 : s.map((d) => /* @__PURE__ */ n(
|
|
310
|
-
|
|
310
|
+
_t,
|
|
311
311
|
{
|
|
312
312
|
className: "group flex justify-between gap-2",
|
|
313
313
|
value: d.id,
|
|
@@ -315,12 +315,12 @@ function Ms({ includeLabel: t = !1 } = {}) {
|
|
|
315
315
|
/* @__PURE__ */ e("p", { children: d.name }),
|
|
316
316
|
/* @__PURE__ */ n("span", { className: "flex items-center gap-3", children: [
|
|
317
317
|
/* @__PURE__ */ e(
|
|
318
|
-
|
|
318
|
+
ia,
|
|
319
319
|
{
|
|
320
320
|
onClick: (u) => {
|
|
321
|
-
u.preventDefault(),
|
|
321
|
+
u.preventDefault(), x(d);
|
|
322
322
|
},
|
|
323
|
-
className:
|
|
323
|
+
className: ve(
|
|
324
324
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
325
325
|
{
|
|
326
326
|
invisible: !d.isDefault,
|
|
@@ -331,10 +331,10 @@ function Ms({ includeLabel: t = !1 } = {}) {
|
|
|
331
331
|
}
|
|
332
332
|
),
|
|
333
333
|
/* @__PURE__ */ e(
|
|
334
|
-
|
|
334
|
+
da,
|
|
335
335
|
{
|
|
336
336
|
onClick: (u) => {
|
|
337
|
-
u.preventDefault(),
|
|
337
|
+
u.preventDefault(), b(d.id);
|
|
338
338
|
},
|
|
339
339
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
340
340
|
strokeWidth: 1.5
|
|
@@ -350,111 +350,111 @@ function Ms({ includeLabel: t = !1 } = {}) {
|
|
|
350
350
|
)
|
|
351
351
|
] });
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
const { displayPreferences: t, shouldShowElement: s } =
|
|
355
|
-
() =>
|
|
353
|
+
function Ps() {
|
|
354
|
+
const { displayPreferences: t, shouldShowElement: s } = lr(), { currentUser: r, userContext: a } = ht(), o = X(
|
|
355
|
+
() => cr(r),
|
|
356
356
|
[r]
|
|
357
|
-
),
|
|
357
|
+
), c = X(() => (l) => o && o[l] !== void 0 && o[l] === !1 ? !1 : s(l), [o, s, t]), h = X(
|
|
358
358
|
() => {
|
|
359
|
-
var
|
|
359
|
+
var l, b, x, d, u;
|
|
360
360
|
return {
|
|
361
|
-
canEdit: ((
|
|
362
|
-
canUseFilters: ((
|
|
363
|
-
canManageDashboards: ((
|
|
364
|
-
canCreateDashboards: ((d = a == null ? void 0 : a.permissions) == null ? void 0 : d.canCreateDashboard) ??
|
|
365
|
-
canAccessVisuals: ((u = a == null ? void 0 : a.permissions) == null ? void 0 : u.canEdit) ??
|
|
361
|
+
canEdit: ((l = a == null ? void 0 : a.permissions) == null ? void 0 : l.canEdit) ?? fr(r),
|
|
362
|
+
canUseFilters: ((b = a == null ? void 0 : a.permissions) == null ? void 0 : b.canEdit) ?? pr(r),
|
|
363
|
+
canManageDashboards: ((x = a == null ? void 0 : a.permissions) == null ? void 0 : x.canCreateDashboard) ?? hr(r),
|
|
364
|
+
canCreateDashboards: ((d = a == null ? void 0 : a.permissions) == null ? void 0 : d.canCreateDashboard) ?? mr(r),
|
|
365
|
+
canAccessVisuals: ((u = a == null ? void 0 : a.permissions) == null ? void 0 : u.canEdit) ?? ur(r)
|
|
366
366
|
};
|
|
367
367
|
},
|
|
368
368
|
[r, a]
|
|
369
369
|
);
|
|
370
370
|
return {
|
|
371
371
|
displayPreferences: t,
|
|
372
|
-
shouldShowElement:
|
|
373
|
-
permissions:
|
|
372
|
+
shouldShowElement: c,
|
|
373
|
+
permissions: h,
|
|
374
374
|
currentUser: r
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
|
-
var
|
|
377
|
+
var ft = "Avatar", [Us] = Qa(ft), Rs = [
|
|
378
378
|
0,
|
|
379
379
|
() => {
|
|
380
380
|
}
|
|
381
|
-
], [
|
|
381
|
+
], [Vs, ga] = Us(ft), gt = U.forwardRef(
|
|
382
382
|
(t, s) => {
|
|
383
|
-
const { __scopeAvatar: r, ...a } = t, [o,
|
|
383
|
+
const { __scopeAvatar: r, ...a } = t, [o, c] = U.useState("idle"), [h, l] = Os();
|
|
384
384
|
return /* @__PURE__ */ e(
|
|
385
|
-
|
|
385
|
+
Vs,
|
|
386
386
|
{
|
|
387
387
|
scope: r,
|
|
388
388
|
imageLoadingStatus: o,
|
|
389
|
-
setImageLoadingStatus:
|
|
390
|
-
imageCount:
|
|
391
|
-
setImageCount:
|
|
392
|
-
children: /* @__PURE__ */ e(
|
|
389
|
+
setImageLoadingStatus: c,
|
|
390
|
+
imageCount: h,
|
|
391
|
+
setImageCount: l,
|
|
392
|
+
children: /* @__PURE__ */ e(ut.span, { ...a, ref: s })
|
|
393
393
|
}
|
|
394
394
|
);
|
|
395
395
|
}
|
|
396
396
|
);
|
|
397
|
-
|
|
398
|
-
var
|
|
397
|
+
gt.displayName = ft;
|
|
398
|
+
var ba = "AvatarImage", bt = U.forwardRef(
|
|
399
399
|
(t, s) => {
|
|
400
|
-
const { __scopeAvatar: r, src: a, onLoadingStatusChange: o, ...
|
|
401
|
-
|
|
402
|
-
const
|
|
403
|
-
referrerPolicy:
|
|
404
|
-
crossOrigin:
|
|
405
|
-
loadingStatus:
|
|
406
|
-
setLoadingStatus:
|
|
407
|
-
}),
|
|
400
|
+
const { __scopeAvatar: r, src: a, onLoadingStatusChange: o, ...c } = t, h = ga(ba, r);
|
|
401
|
+
Ts(h.setImageCount);
|
|
402
|
+
const l = Fs(a, {
|
|
403
|
+
referrerPolicy: c.referrerPolicy,
|
|
404
|
+
crossOrigin: c.crossOrigin,
|
|
405
|
+
loadingStatus: h.imageLoadingStatus,
|
|
406
|
+
setLoadingStatus: h.setImageLoadingStatus
|
|
407
|
+
}), b = Wa((d) => {
|
|
408
408
|
o == null || o(d);
|
|
409
|
-
}),
|
|
410
|
-
return
|
|
411
|
-
const d =
|
|
412
|
-
|
|
413
|
-
}, [
|
|
409
|
+
}), x = U.useRef(l);
|
|
410
|
+
return aa(() => {
|
|
411
|
+
const d = x.current;
|
|
412
|
+
x.current = l, l !== d && b(l);
|
|
413
|
+
}, [l, b]), l === "loaded" ? /* @__PURE__ */ e(ut.img, { ...c, ref: s, src: a }) : null;
|
|
414
414
|
}
|
|
415
415
|
);
|
|
416
|
-
|
|
417
|
-
var
|
|
416
|
+
bt.displayName = ba;
|
|
417
|
+
var xa = "AvatarFallback", xt = U.forwardRef(
|
|
418
418
|
(t, s) => {
|
|
419
|
-
const { __scopeAvatar: r, delayMs: a, ...o } = t,
|
|
420
|
-
return
|
|
419
|
+
const { __scopeAvatar: r, delayMs: a, ...o } = t, c = ga(xa, r), [h, l] = U.useState(a === void 0);
|
|
420
|
+
return U.useEffect(() => {
|
|
421
421
|
if (a !== void 0) {
|
|
422
|
-
const
|
|
423
|
-
return () => window.clearTimeout(
|
|
422
|
+
const b = window.setTimeout(() => l(!0), a);
|
|
423
|
+
return () => window.clearTimeout(b);
|
|
424
424
|
}
|
|
425
|
-
}, [a]),
|
|
425
|
+
}, [a]), h && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(ut.span, { ...o, ref: s }) : null;
|
|
426
426
|
}
|
|
427
427
|
);
|
|
428
|
-
|
|
429
|
-
function
|
|
428
|
+
xt.displayName = xa;
|
|
429
|
+
function Fs(t, {
|
|
430
430
|
loadingStatus: s,
|
|
431
431
|
setLoadingStatus: r,
|
|
432
432
|
referrerPolicy: a,
|
|
433
433
|
crossOrigin: o
|
|
434
434
|
}) {
|
|
435
|
-
return
|
|
435
|
+
return aa(() => {
|
|
436
436
|
if (!t) {
|
|
437
437
|
r("error");
|
|
438
438
|
return;
|
|
439
439
|
}
|
|
440
|
-
const
|
|
441
|
-
const
|
|
442
|
-
r(
|
|
443
|
-
},
|
|
444
|
-
return
|
|
445
|
-
|
|
440
|
+
const c = new window.Image(), h = (b) => {
|
|
441
|
+
const x = b.currentTarget;
|
|
442
|
+
r(Xt(x));
|
|
443
|
+
}, l = () => r("error");
|
|
444
|
+
return c.addEventListener("load", h), c.addEventListener("error", l), a && (c.referrerPolicy = a), c.crossOrigin = o ?? null, c.src = t, r(Xt(c)), () => {
|
|
445
|
+
c.removeEventListener("load", h), c.removeEventListener("error", l), r("idle");
|
|
446
446
|
};
|
|
447
447
|
}, [t, o, a, r]), s;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function Xt(t) {
|
|
450
450
|
return t.complete ? t.naturalWidth > 0 ? "loaded" : "error" : "loading";
|
|
451
451
|
}
|
|
452
|
-
function
|
|
453
|
-
let t =
|
|
452
|
+
function Os() {
|
|
453
|
+
let t = Rs;
|
|
454
454
|
{
|
|
455
|
-
t =
|
|
456
|
-
const [s] = t, r =
|
|
457
|
-
|
|
455
|
+
t = U.useState(0);
|
|
456
|
+
const [s] = t, r = U.useRef(!1);
|
|
457
|
+
U.useEffect(() => {
|
|
458
458
|
s > 1 && !r.current && (r.current = !0, console.warn(
|
|
459
459
|
"Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior."
|
|
460
460
|
));
|
|
@@ -462,230 +462,230 @@ function Rs() {
|
|
|
462
462
|
}
|
|
463
463
|
return t;
|
|
464
464
|
}
|
|
465
|
-
function
|
|
466
|
-
|
|
465
|
+
function Ts(t) {
|
|
466
|
+
U.useEffect(() => (t((s) => s + 1), () => {
|
|
467
467
|
t((s) => s - 1);
|
|
468
468
|
}), [t]);
|
|
469
469
|
}
|
|
470
|
-
const
|
|
471
|
-
|
|
470
|
+
const va = U.forwardRef(({ className: t, ...s }, r) => /* @__PURE__ */ e(
|
|
471
|
+
gt,
|
|
472
472
|
{
|
|
473
473
|
ref: r,
|
|
474
|
-
className:
|
|
474
|
+
className: ve(
|
|
475
475
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
476
476
|
t
|
|
477
477
|
),
|
|
478
478
|
...s
|
|
479
479
|
}
|
|
480
480
|
));
|
|
481
|
-
|
|
482
|
-
const
|
|
483
|
-
|
|
481
|
+
va.displayName = gt.displayName;
|
|
482
|
+
const Gs = U.forwardRef(({ className: t, ...s }, r) => /* @__PURE__ */ e(
|
|
483
|
+
bt,
|
|
484
484
|
{
|
|
485
485
|
ref: r,
|
|
486
|
-
className:
|
|
486
|
+
className: ve("aspect-square h-full w-full", t),
|
|
487
487
|
...s
|
|
488
488
|
}
|
|
489
489
|
));
|
|
490
|
-
|
|
491
|
-
const
|
|
492
|
-
|
|
490
|
+
Gs.displayName = bt.displayName;
|
|
491
|
+
const ya = U.forwardRef(({ className: t, ...s }, r) => /* @__PURE__ */ e(
|
|
492
|
+
xt,
|
|
493
493
|
{
|
|
494
494
|
ref: r,
|
|
495
|
-
className:
|
|
495
|
+
className: ve(
|
|
496
496
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
497
497
|
t
|
|
498
498
|
),
|
|
499
499
|
...s
|
|
500
500
|
}
|
|
501
501
|
));
|
|
502
|
-
|
|
503
|
-
const
|
|
502
|
+
ya.displayName = xt.displayName;
|
|
503
|
+
const Bs = async (t, s, r) => {
|
|
504
504
|
const a = `${t}/management/v1/groups`;
|
|
505
|
-
return await
|
|
506
|
-
},
|
|
505
|
+
return await ra(a, s, r);
|
|
506
|
+
}, $s = async (t, s, r, a) => {
|
|
507
507
|
const o = `${t}/management/v1/groups/${r}`;
|
|
508
|
-
return
|
|
509
|
-
},
|
|
508
|
+
return mt(o, s, "PATCH", a);
|
|
509
|
+
}, zs = async (t, s, r) => {
|
|
510
510
|
const a = `${t}/management/v1/groups/${r}`;
|
|
511
|
-
await
|
|
512
|
-
},
|
|
511
|
+
await mt(a, s, "DELETE");
|
|
512
|
+
}, _s = async (t, s, r, a) => {
|
|
513
513
|
const o = `${t}/management/v1/groups/${r}/members`;
|
|
514
|
-
return await
|
|
515
|
-
},
|
|
514
|
+
return await ra(o, s, a);
|
|
515
|
+
}, qs = async (t, s, r, a) => {
|
|
516
516
|
const o = `${t}/management/v1/groups/${r}/members`;
|
|
517
|
-
await
|
|
517
|
+
await mt(o, s, "DELETE", a);
|
|
518
518
|
};
|
|
519
|
-
function
|
|
520
|
-
const { authToken: t, tokenProps: s } =
|
|
521
|
-
return
|
|
522
|
-
mutationFn: (a) =>
|
|
519
|
+
function Hs() {
|
|
520
|
+
const { authToken: t, tokenProps: s } = _(), r = we();
|
|
521
|
+
return Ne({
|
|
522
|
+
mutationFn: (a) => Bs(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a),
|
|
523
523
|
onSuccess: () => {
|
|
524
|
-
r.invalidateQueries({ queryKey: ["groups"] }),
|
|
524
|
+
r.invalidateQueries({ queryKey: ["groups"] }), I.success("Group created successfully");
|
|
525
525
|
},
|
|
526
526
|
onError: (a) => {
|
|
527
|
-
console.error("Failed to create group:", a),
|
|
528
|
-
description:
|
|
527
|
+
console.error("Failed to create group:", a), I.error("Failed to create group", {
|
|
528
|
+
description: ye(a, "Failed to create group")
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
const { authToken: t, tokenProps: s } =
|
|
535
|
-
return
|
|
533
|
+
function js() {
|
|
534
|
+
const { authToken: t, tokenProps: s } = _(), r = we();
|
|
535
|
+
return Ne({
|
|
536
536
|
mutationFn: ({
|
|
537
537
|
groupId: a,
|
|
538
538
|
data: o
|
|
539
|
-
}) =>
|
|
539
|
+
}) => $s(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
|
|
540
540
|
onSuccess: (a, o) => {
|
|
541
|
-
r.invalidateQueries({ queryKey: ["group", o.groupId] }), r.invalidateQueries({ queryKey: ["groups"] }),
|
|
541
|
+
r.invalidateQueries({ queryKey: ["group", o.groupId] }), r.invalidateQueries({ queryKey: ["groups"] }), I.success("Group updated successfully");
|
|
542
542
|
},
|
|
543
543
|
onError: (a) => {
|
|
544
|
-
console.error("Failed to update group:", a),
|
|
545
|
-
description:
|
|
544
|
+
console.error("Failed to update group:", a), I.error("Failed to update group", {
|
|
545
|
+
description: ye(a, "Failed to update group")
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
|
-
function
|
|
551
|
-
const { authToken: t, tokenProps: s } =
|
|
552
|
-
return
|
|
553
|
-
mutationFn: (a) =>
|
|
550
|
+
function Ks() {
|
|
551
|
+
const { authToken: t, tokenProps: s } = _(), r = we();
|
|
552
|
+
return Ne({
|
|
553
|
+
mutationFn: (a) => zs(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a),
|
|
554
554
|
onSuccess: (a, o) => {
|
|
555
|
-
r.invalidateQueries({ queryKey: ["groups"] }), r.removeQueries({ queryKey: ["group", o] }),
|
|
555
|
+
r.invalidateQueries({ queryKey: ["groups"] }), r.removeQueries({ queryKey: ["group", o] }), I.success("Group deleted successfully");
|
|
556
556
|
},
|
|
557
557
|
onError: (a) => {
|
|
558
|
-
console.error("Failed to delete group:", a),
|
|
559
|
-
description:
|
|
558
|
+
console.error("Failed to delete group:", a), I.error("Failed to delete group", {
|
|
559
|
+
description: ye(a, "Failed to delete group")
|
|
560
560
|
});
|
|
561
561
|
}
|
|
562
562
|
});
|
|
563
563
|
}
|
|
564
|
-
function
|
|
565
|
-
const { authToken: t, tokenProps: s } =
|
|
566
|
-
return
|
|
564
|
+
function Qs() {
|
|
565
|
+
const { authToken: t, tokenProps: s } = _(), r = we();
|
|
566
|
+
return Ne({
|
|
567
567
|
mutationFn: ({
|
|
568
568
|
groupId: a,
|
|
569
569
|
data: o
|
|
570
|
-
}) =>
|
|
570
|
+
}) => _s(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
|
|
571
571
|
onSuccess: (a, o) => {
|
|
572
572
|
r.invalidateQueries({ queryKey: ["group", o.groupId] }), r.invalidateQueries({
|
|
573
573
|
queryKey: ["group-members", o.groupId]
|
|
574
|
-
}), r.invalidateQueries({ queryKey: ["groups"] }),
|
|
574
|
+
}), r.invalidateQueries({ queryKey: ["groups"] }), I.success("Members added successfully");
|
|
575
575
|
},
|
|
576
576
|
onError: (a) => {
|
|
577
|
-
console.error("Failed to add group members:", a),
|
|
578
|
-
description:
|
|
577
|
+
console.error("Failed to add group members:", a), I.error("Failed to add members", {
|
|
578
|
+
description: ye(a, "Failed to add members")
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
581
|
});
|
|
582
582
|
}
|
|
583
|
-
function
|
|
584
|
-
const { authToken: t, tokenProps: s } =
|
|
585
|
-
return
|
|
583
|
+
function Ws() {
|
|
584
|
+
const { authToken: t, tokenProps: s } = _(), r = we();
|
|
585
|
+
return Ne({
|
|
586
586
|
mutationFn: ({
|
|
587
587
|
groupId: a,
|
|
588
588
|
data: o
|
|
589
|
-
}) =>
|
|
589
|
+
}) => qs(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
|
|
590
590
|
onSuccess: (a, o) => {
|
|
591
591
|
r.invalidateQueries({ queryKey: ["group", o.groupId] }), r.invalidateQueries({
|
|
592
592
|
queryKey: ["group-members", o.groupId]
|
|
593
|
-
}), r.invalidateQueries({ queryKey: ["groups"] }),
|
|
593
|
+
}), r.invalidateQueries({ queryKey: ["groups"] }), I.success("Members removed successfully");
|
|
594
594
|
},
|
|
595
595
|
onError: (a) => {
|
|
596
|
-
console.error("Failed to remove group members:", a),
|
|
597
|
-
description:
|
|
596
|
+
console.error("Failed to remove group members:", a), I.error("Failed to remove members", {
|
|
597
|
+
description: ye(a, "Failed to remove members")
|
|
598
598
|
});
|
|
599
599
|
}
|
|
600
600
|
});
|
|
601
601
|
}
|
|
602
|
-
const
|
|
603
|
-
function
|
|
602
|
+
const Js = [];
|
|
603
|
+
function Ys({
|
|
604
604
|
open: t,
|
|
605
605
|
onOpenChange: s
|
|
606
606
|
}) {
|
|
607
|
-
var
|
|
608
|
-
const { tokenProps: r } =
|
|
609
|
-
groups:
|
|
610
|
-
isLoading:
|
|
611
|
-
error:
|
|
612
|
-
refetch:
|
|
613
|
-
} =
|
|
607
|
+
var m, B, V;
|
|
608
|
+
const { tokenProps: r } = _(), { currentUser: a } = ht(), o = (a == null ? void 0 : a.type) === "tenant", c = r == null ? void 0 : r.tenantId, {
|
|
609
|
+
groups: h,
|
|
610
|
+
isLoading: l,
|
|
611
|
+
error: b,
|
|
612
|
+
refetch: x
|
|
613
|
+
} = gr({
|
|
614
614
|
type: o ? "TENANT_GROUP" : "all",
|
|
615
|
-
tenantId: o ?
|
|
615
|
+
tenantId: o ? c : void 0,
|
|
616
616
|
includeMembers: !1
|
|
617
|
-
}), d =
|
|
618
|
-
|
|
619
|
-
t || (
|
|
617
|
+
}), d = b ? wa(b, "Unable to load groups.") : null, [u, g] = v({ kind: "list" }), [p, y] = v(null), N = Ks();
|
|
618
|
+
ze(() => {
|
|
619
|
+
t || (g({ kind: "list" }), y(null));
|
|
620
620
|
}, [t]);
|
|
621
|
-
const
|
|
622
|
-
if (
|
|
621
|
+
const C = u.kind === "members" && h.find((w) => w.id === u.groupId) || null, S = async () => {
|
|
622
|
+
if (p)
|
|
623
623
|
try {
|
|
624
|
-
await
|
|
624
|
+
await N.mutateAsync(p.id), y(null), g({ kind: "list" }), x();
|
|
625
625
|
} catch {
|
|
626
626
|
}
|
|
627
627
|
};
|
|
628
|
-
return /* @__PURE__ */ e(
|
|
628
|
+
return /* @__PURE__ */ e(na, { open: t, onOpenChange: s, children: /* @__PURE__ */ n(oa, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
|
|
629
629
|
u.kind === "list" ? /* @__PURE__ */ n("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
|
|
630
|
-
/* @__PURE__ */ e(
|
|
631
|
-
/* @__PURE__ */ e(
|
|
630
|
+
/* @__PURE__ */ e(ot, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
|
|
631
|
+
/* @__PURE__ */ e(it, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
|
|
632
632
|
] }) : u.kind === "create" ? /* @__PURE__ */ n("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
633
633
|
/* @__PURE__ */ e(
|
|
634
634
|
"button",
|
|
635
635
|
{
|
|
636
636
|
type: "button",
|
|
637
|
-
onClick: () =>
|
|
637
|
+
onClick: () => g({ kind: "list" }),
|
|
638
638
|
"aria-label": "Back",
|
|
639
639
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
640
|
-
children: /* @__PURE__ */ e(
|
|
640
|
+
children: /* @__PURE__ */ e(la, { className: "h-3.5 w-3.5" })
|
|
641
641
|
}
|
|
642
642
|
),
|
|
643
|
-
/* @__PURE__ */ e(
|
|
644
|
-
/* @__PURE__ */ e(
|
|
643
|
+
/* @__PURE__ */ e(ot, { className: "truncate text-[13px] font-medium", children: "New group" }),
|
|
644
|
+
/* @__PURE__ */ e(it, { className: "sr-only", children: "Create a new group to organize members." })
|
|
645
645
|
] }) : null,
|
|
646
646
|
u.kind === "list" && /* @__PURE__ */ e(
|
|
647
|
-
|
|
647
|
+
Xs,
|
|
648
648
|
{
|
|
649
|
-
groups:
|
|
650
|
-
isLoading:
|
|
649
|
+
groups: h,
|
|
650
|
+
isLoading: l,
|
|
651
651
|
errorMessage: d,
|
|
652
|
-
onRetry: () =>
|
|
652
|
+
onRetry: () => x(),
|
|
653
653
|
currentUserId: a == null ? void 0 : a.id,
|
|
654
|
-
onOpenGroup: (
|
|
655
|
-
onCreate: () =>
|
|
656
|
-
onDeleteRequest: (
|
|
654
|
+
onOpenGroup: (w) => g({ kind: "members", groupId: w }),
|
|
655
|
+
onCreate: () => g({ kind: "create" }),
|
|
656
|
+
onDeleteRequest: (w) => y(w)
|
|
657
657
|
}
|
|
658
658
|
),
|
|
659
|
-
u.kind === "members" &&
|
|
660
|
-
|
|
659
|
+
u.kind === "members" && C && /* @__PURE__ */ e(
|
|
660
|
+
tn,
|
|
661
661
|
{
|
|
662
|
-
group:
|
|
662
|
+
group: C,
|
|
663
663
|
isTenantViewer: o,
|
|
664
|
-
canEdit: ((
|
|
665
|
-
canDelete: ((
|
|
666
|
-
canManageMembers: ((
|
|
667
|
-
onBack: () =>
|
|
668
|
-
onMembersChanged:
|
|
669
|
-
onUpdated:
|
|
670
|
-
onRequestDelete: () =>
|
|
664
|
+
canEdit: ((m = C.permissions) == null ? void 0 : m.canEdit) ?? C.createdBy === (a == null ? void 0 : a.id),
|
|
665
|
+
canDelete: ((B = C.permissions) == null ? void 0 : B.canDelete) ?? C.createdBy === (a == null ? void 0 : a.id),
|
|
666
|
+
canManageMembers: ((V = C.permissions) == null ? void 0 : V.canManageMembers) ?? C.createdBy === (a == null ? void 0 : a.id),
|
|
667
|
+
onBack: () => g({ kind: "list" }),
|
|
668
|
+
onMembersChanged: x,
|
|
669
|
+
onUpdated: x,
|
|
670
|
+
onRequestDelete: () => y(C)
|
|
671
671
|
},
|
|
672
|
-
|
|
672
|
+
C.id
|
|
673
673
|
),
|
|
674
674
|
u.kind === "create" && /* @__PURE__ */ e(
|
|
675
|
-
|
|
675
|
+
an,
|
|
676
676
|
{
|
|
677
677
|
isTenantUser: o,
|
|
678
|
-
tenantId:
|
|
679
|
-
onCancel: () =>
|
|
680
|
-
onCreated: (
|
|
681
|
-
|
|
678
|
+
tenantId: c,
|
|
679
|
+
onCancel: () => g({ kind: "list" }),
|
|
680
|
+
onCreated: (w) => {
|
|
681
|
+
x(), g({ kind: "members", groupId: w });
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
684
|
),
|
|
685
|
-
|
|
685
|
+
p && /* @__PURE__ */ n("div", { className: "flex shrink-0 items-center justify-between gap-3 border-t border-border bg-muted/40 px-5 py-2.5", children: [
|
|
686
686
|
/* @__PURE__ */ n("div", { className: "min-w-0 text-[12px] text-foreground", children: [
|
|
687
687
|
"Delete ",
|
|
688
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children:
|
|
688
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: p.name }),
|
|
689
689
|
"?",
|
|
690
690
|
/* @__PURE__ */ e("span", { className: "ml-2 text-muted-foreground", children: "Members lose any access granted via this group." })
|
|
691
691
|
] }),
|
|
@@ -694,8 +694,8 @@ function Qs({
|
|
|
694
694
|
"button",
|
|
695
695
|
{
|
|
696
696
|
type: "button",
|
|
697
|
-
onClick: () =>
|
|
698
|
-
disabled:
|
|
697
|
+
onClick: () => y(null),
|
|
698
|
+
disabled: N.isPending,
|
|
699
699
|
className: "h-7 rounded-[5px] px-2.5 text-[12px] font-medium text-foreground/80 hover:bg-background",
|
|
700
700
|
children: "Cancel"
|
|
701
701
|
}
|
|
@@ -704,11 +704,11 @@ function Qs({
|
|
|
704
704
|
"button",
|
|
705
705
|
{
|
|
706
706
|
type: "button",
|
|
707
|
-
onClick:
|
|
708
|
-
disabled:
|
|
707
|
+
onClick: S,
|
|
708
|
+
disabled: N.isPending,
|
|
709
709
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-rose-600 px-2.5 text-[12px] font-medium text-white hover:bg-rose-700 disabled:opacity-60",
|
|
710
710
|
children: [
|
|
711
|
-
|
|
711
|
+
N.isPending ? /* @__PURE__ */ e($e, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(pt, { className: "h-3 w-3" }),
|
|
712
712
|
"Delete group"
|
|
713
713
|
]
|
|
714
714
|
}
|
|
@@ -717,42 +717,42 @@ function Qs({
|
|
|
717
717
|
] })
|
|
718
718
|
] }) });
|
|
719
719
|
}
|
|
720
|
-
function
|
|
720
|
+
function Xs({
|
|
721
721
|
groups: t,
|
|
722
722
|
isLoading: s,
|
|
723
723
|
errorMessage: r,
|
|
724
724
|
onRetry: a,
|
|
725
725
|
currentUserId: o,
|
|
726
|
-
onOpenGroup:
|
|
727
|
-
onCreate:
|
|
728
|
-
onDeleteRequest:
|
|
726
|
+
onOpenGroup: c,
|
|
727
|
+
onCreate: h,
|
|
728
|
+
onDeleteRequest: l
|
|
729
729
|
}) {
|
|
730
|
-
const [
|
|
730
|
+
const [b, x] = v(""), d = X(
|
|
731
731
|
() => t.filter(
|
|
732
|
-
(u) => !
|
|
732
|
+
(u) => !b.trim() || u.name.toLowerCase().includes(b.toLowerCase()) || (u.description || "").toLowerCase().includes(b.toLowerCase())
|
|
733
733
|
),
|
|
734
|
-
[t,
|
|
734
|
+
[t, b]
|
|
735
735
|
);
|
|
736
736
|
return /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
737
737
|
/* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
|
|
738
738
|
/* @__PURE__ */ n("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
|
|
739
|
-
/* @__PURE__ */ e(
|
|
739
|
+
/* @__PURE__ */ e(ps, { className: "h-3 w-3 text-muted-foreground" }),
|
|
740
740
|
/* @__PURE__ */ e(
|
|
741
741
|
"input",
|
|
742
742
|
{
|
|
743
|
-
value:
|
|
744
|
-
onChange: (u) =>
|
|
743
|
+
value: b,
|
|
744
|
+
onChange: (u) => x(u.target.value),
|
|
745
745
|
placeholder: "Search groups…",
|
|
746
746
|
className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none"
|
|
747
747
|
}
|
|
748
748
|
),
|
|
749
|
-
|
|
749
|
+
b && /* @__PURE__ */ e(
|
|
750
750
|
"button",
|
|
751
751
|
{
|
|
752
752
|
type: "button",
|
|
753
|
-
onClick: () =>
|
|
753
|
+
onClick: () => x(""),
|
|
754
754
|
className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
755
|
-
children: /* @__PURE__ */ e(
|
|
755
|
+
children: /* @__PURE__ */ e(ma, { className: "h-2.5 w-2.5" })
|
|
756
756
|
}
|
|
757
757
|
)
|
|
758
758
|
] }),
|
|
@@ -760,7 +760,7 @@ function Ws({
|
|
|
760
760
|
"button",
|
|
761
761
|
{
|
|
762
762
|
type: "button",
|
|
763
|
-
onClick:
|
|
763
|
+
onClick: h,
|
|
764
764
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90",
|
|
765
765
|
children: [
|
|
766
766
|
/* @__PURE__ */ e(H, { className: "h-3 w-3" }),
|
|
@@ -776,35 +776,35 @@ function Ws({
|
|
|
776
776
|
},
|
|
777
777
|
u
|
|
778
778
|
)) }) : r ? /* @__PURE__ */ e(
|
|
779
|
-
|
|
779
|
+
Na,
|
|
780
780
|
{
|
|
781
781
|
title: "Can't load groups",
|
|
782
782
|
message: r,
|
|
783
783
|
onRetry: a
|
|
784
784
|
}
|
|
785
|
-
) : d.length === 0 && t.length === 0 ? /* @__PURE__ */ e(
|
|
785
|
+
) : d.length === 0 && t.length === 0 ? /* @__PURE__ */ e(en, { onCreate: h }) : d.length === 0 ? /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
786
786
|
/* @__PURE__ */ n("div", { className: "text-[12px] text-foreground", children: [
|
|
787
787
|
'No groups match "',
|
|
788
|
-
|
|
788
|
+
b,
|
|
789
789
|
'"'
|
|
790
790
|
] }),
|
|
791
791
|
/* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: "Try a different search." })
|
|
792
792
|
] }) : d.map((u) => {
|
|
793
|
-
var
|
|
793
|
+
var g;
|
|
794
794
|
return /* @__PURE__ */ e(
|
|
795
|
-
|
|
795
|
+
Zs,
|
|
796
796
|
{
|
|
797
797
|
group: u,
|
|
798
|
-
canDelete: ((
|
|
799
|
-
onClick: () =>
|
|
800
|
-
onDelete: () =>
|
|
798
|
+
canDelete: ((g = u.permissions) == null ? void 0 : g.canDelete) ?? u.createdBy === o,
|
|
799
|
+
onClick: () => c(u.id),
|
|
800
|
+
onDelete: () => l(u)
|
|
801
801
|
},
|
|
802
802
|
u.id
|
|
803
803
|
);
|
|
804
804
|
}) })
|
|
805
805
|
] });
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function Zs({
|
|
808
808
|
group: t,
|
|
809
809
|
canDelete: s,
|
|
810
810
|
onClick: r,
|
|
@@ -812,7 +812,7 @@ function Js({
|
|
|
812
812
|
}) {
|
|
813
813
|
let o = "";
|
|
814
814
|
try {
|
|
815
|
-
o =
|
|
815
|
+
o = ha(new Date(t.createdAt), "MMM d, yyyy");
|
|
816
816
|
} catch {
|
|
817
817
|
o = "";
|
|
818
818
|
}
|
|
@@ -823,24 +823,24 @@ function Js({
|
|
|
823
823
|
onClick: r,
|
|
824
824
|
className: "group flex w-full items-center gap-3 border-b border-border/60 px-5 py-2.5 text-left hover:bg-accent/40",
|
|
825
825
|
children: [
|
|
826
|
-
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(
|
|
826
|
+
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(vr, { className: "h-3.5 w-3.5" }) }),
|
|
827
827
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
828
828
|
/* @__PURE__ */ e("div", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
|
|
829
829
|
/* @__PURE__ */ n("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
830
830
|
/* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1", children: [
|
|
831
|
-
/* @__PURE__ */ e(
|
|
831
|
+
/* @__PURE__ */ e(pa, { className: "h-2.5 w-2.5" }),
|
|
832
832
|
t.memberCount,
|
|
833
833
|
" member",
|
|
834
834
|
t.memberCount === 1 ? "" : "s"
|
|
835
835
|
] }),
|
|
836
|
-
o && /* @__PURE__ */ n(
|
|
836
|
+
o && /* @__PURE__ */ n(G, { children: [
|
|
837
837
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
838
838
|
/* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1", children: [
|
|
839
|
-
/* @__PURE__ */ e(
|
|
839
|
+
/* @__PURE__ */ e(ua, { className: "h-2.5 w-2.5" }),
|
|
840
840
|
o
|
|
841
841
|
] })
|
|
842
842
|
] }),
|
|
843
|
-
t.description && /* @__PURE__ */ n(
|
|
843
|
+
t.description && /* @__PURE__ */ n(G, { children: [
|
|
844
844
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
845
845
|
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: t.description })
|
|
846
846
|
] })
|
|
@@ -852,26 +852,26 @@ function Js({
|
|
|
852
852
|
{
|
|
853
853
|
role: "button",
|
|
854
854
|
tabIndex: 0,
|
|
855
|
-
onClick: (
|
|
856
|
-
|
|
855
|
+
onClick: (c) => {
|
|
856
|
+
c.stopPropagation(), a();
|
|
857
857
|
},
|
|
858
|
-
onKeyDown: (
|
|
859
|
-
(
|
|
858
|
+
onKeyDown: (c) => {
|
|
859
|
+
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.stopPropagation(), a());
|
|
860
860
|
},
|
|
861
861
|
"aria-label": `Delete ${t.name}`,
|
|
862
862
|
className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
863
|
-
children: /* @__PURE__ */ e(
|
|
863
|
+
children: /* @__PURE__ */ e(pt, { className: "h-3 w-3" })
|
|
864
864
|
}
|
|
865
865
|
),
|
|
866
|
-
/* @__PURE__ */ e(
|
|
866
|
+
/* @__PURE__ */ e(fs, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
867
867
|
] })
|
|
868
868
|
]
|
|
869
869
|
}
|
|
870
870
|
);
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function en({ onCreate: t }) {
|
|
873
873
|
return /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
|
|
874
|
-
/* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(
|
|
874
|
+
/* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(ca, { className: "h-4 w-4" }) }),
|
|
875
875
|
/* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
|
|
876
876
|
/* @__PURE__ */ e("div", { className: "max-w-[320px] text-[11.5px] leading-[1.55] text-muted-foreground", children: "Groups let you grant shared access to dashboards. Create one and add members." }),
|
|
877
877
|
/* @__PURE__ */ n(
|
|
@@ -888,84 +888,84 @@ function Ys({ onCreate: t }) {
|
|
|
888
888
|
)
|
|
889
889
|
] });
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function tn({
|
|
892
892
|
group: t,
|
|
893
893
|
isTenantViewer: s,
|
|
894
894
|
canEdit: r,
|
|
895
895
|
canDelete: a,
|
|
896
896
|
canManageMembers: o,
|
|
897
|
-
onBack:
|
|
898
|
-
onMembersChanged:
|
|
899
|
-
onUpdated:
|
|
900
|
-
onRequestDelete:
|
|
897
|
+
onBack: c,
|
|
898
|
+
onMembersChanged: h,
|
|
899
|
+
onUpdated: l,
|
|
900
|
+
onRequestDelete: b
|
|
901
901
|
}) {
|
|
902
902
|
const {
|
|
903
|
-
data:
|
|
903
|
+
data: x,
|
|
904
904
|
isLoading: d,
|
|
905
905
|
error: u,
|
|
906
|
-
refetch:
|
|
907
|
-
} =
|
|
908
|
-
type:
|
|
906
|
+
refetch: g
|
|
907
|
+
} = br(t.id), p = (x == null ? void 0 : x.members) ?? Js, y = u ? wa(u, "Unable to load members for this group.") : null, N = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: C } = xr({
|
|
908
|
+
type: N,
|
|
909
909
|
tenantId: t.tenantId || void 0,
|
|
910
910
|
active: !0,
|
|
911
911
|
limit: 200
|
|
912
|
-
}),
|
|
913
|
-
() => new Set(
|
|
914
|
-
[
|
|
915
|
-
),
|
|
916
|
-
const
|
|
917
|
-
return
|
|
918
|
-
(
|
|
912
|
+
}), S = X(
|
|
913
|
+
() => new Set(p.map((f) => f.userId)),
|
|
914
|
+
[p]
|
|
915
|
+
), m = Qs(), B = Ws(), V = js(), [w, M] = v(!1), [k, ee] = v(t.name), [_e, q] = v(!1), [re, j] = v(t.description || ""), [se, ne] = v(""), [qe, oe] = v(!1), De = X(() => {
|
|
916
|
+
const f = se.trim().toLowerCase();
|
|
917
|
+
return C.filter((F) => !S.has(F.id)).filter(
|
|
918
|
+
(F) => !f || (F.name || "").toLowerCase().includes(f) || (F.email || "").toLowerCase().includes(f)
|
|
919
919
|
).slice(0, 50);
|
|
920
|
-
}, [
|
|
921
|
-
const
|
|
922
|
-
if (
|
|
920
|
+
}, [C, S, se]), te = async () => {
|
|
921
|
+
const f = k.trim();
|
|
922
|
+
if (M(!1), f.length >= 3 && f !== t.name)
|
|
923
923
|
try {
|
|
924
|
-
await
|
|
924
|
+
await V.mutateAsync({
|
|
925
925
|
groupId: t.id,
|
|
926
|
-
data: { name:
|
|
927
|
-
}),
|
|
926
|
+
data: { name: f }
|
|
927
|
+
}), l();
|
|
928
928
|
} catch {
|
|
929
929
|
}
|
|
930
|
-
},
|
|
931
|
-
const
|
|
932
|
-
if (
|
|
930
|
+
}, Ce = async () => {
|
|
931
|
+
const f = re.trim();
|
|
932
|
+
if (q(!1), f !== (t.description || ""))
|
|
933
933
|
try {
|
|
934
|
-
await
|
|
934
|
+
await V.mutateAsync({
|
|
935
935
|
groupId: t.id,
|
|
936
|
-
data: { description:
|
|
937
|
-
}),
|
|
936
|
+
data: { description: f }
|
|
937
|
+
}), l();
|
|
938
938
|
} catch {
|
|
939
939
|
}
|
|
940
|
-
},
|
|
940
|
+
}, ke = async (f) => {
|
|
941
941
|
if (o) {
|
|
942
|
-
|
|
942
|
+
ne(""), oe(!1);
|
|
943
943
|
try {
|
|
944
|
-
await
|
|
944
|
+
await m.mutateAsync({
|
|
945
945
|
groupId: t.id,
|
|
946
946
|
data: {
|
|
947
|
-
userIds: [
|
|
948
|
-
userType:
|
|
947
|
+
userIds: [f.id],
|
|
948
|
+
userType: N === "tenant" ? "tenant" : "org"
|
|
949
949
|
}
|
|
950
|
-
}),
|
|
950
|
+
}), g(), h();
|
|
951
951
|
} catch {
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
|
-
},
|
|
954
|
+
}, He = async (f) => {
|
|
955
955
|
if (o)
|
|
956
956
|
try {
|
|
957
|
-
await
|
|
957
|
+
await B.mutateAsync({
|
|
958
958
|
groupId: t.id,
|
|
959
|
-
data: { userIds: [
|
|
960
|
-
}),
|
|
959
|
+
data: { userIds: [f] }
|
|
960
|
+
}), g(), h();
|
|
961
961
|
} catch {
|
|
962
962
|
}
|
|
963
963
|
};
|
|
964
|
-
let
|
|
964
|
+
let K = "";
|
|
965
965
|
try {
|
|
966
|
-
|
|
966
|
+
K = ha(new Date(t.createdAt), "MMM d, yyyy");
|
|
967
967
|
} catch {
|
|
968
|
-
|
|
968
|
+
K = "";
|
|
969
969
|
}
|
|
970
970
|
return /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
971
971
|
/* @__PURE__ */ n("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
@@ -973,21 +973,21 @@ function Xs({
|
|
|
973
973
|
"button",
|
|
974
974
|
{
|
|
975
975
|
type: "button",
|
|
976
|
-
onClick:
|
|
976
|
+
onClick: c,
|
|
977
977
|
"aria-label": "Back",
|
|
978
978
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
979
|
-
children: /* @__PURE__ */ e(
|
|
979
|
+
children: /* @__PURE__ */ e(la, { className: "h-3.5 w-3.5" })
|
|
980
980
|
}
|
|
981
981
|
),
|
|
982
|
-
|
|
982
|
+
w ? /* @__PURE__ */ e(
|
|
983
983
|
"input",
|
|
984
984
|
{
|
|
985
985
|
autoFocus: !0,
|
|
986
|
-
value:
|
|
987
|
-
onChange: (
|
|
988
|
-
onBlur:
|
|
989
|
-
onKeyDown: (
|
|
990
|
-
|
|
986
|
+
value: k,
|
|
987
|
+
onChange: (f) => ee(f.target.value),
|
|
988
|
+
onBlur: te,
|
|
989
|
+
onKeyDown: (f) => {
|
|
990
|
+
f.key === "Enter" && te(), f.key === "Escape" && (ee(t.name), M(!1));
|
|
991
991
|
},
|
|
992
992
|
className: "h-6 min-w-0 flex-1 rounded-[3px] border border-border bg-background px-1.5 text-[13px] font-medium text-foreground focus:border-foreground/40 focus:outline-none"
|
|
993
993
|
}
|
|
@@ -996,7 +996,7 @@ function Xs({
|
|
|
996
996
|
{
|
|
997
997
|
type: "button",
|
|
998
998
|
onClick: () => {
|
|
999
|
-
r && (
|
|
999
|
+
r && (ee(t.name), M(!0));
|
|
1000
1000
|
},
|
|
1001
1001
|
title: r ? "Click to rename" : t.name,
|
|
1002
1002
|
disabled: !r,
|
|
@@ -1005,23 +1005,23 @@ function Xs({
|
|
|
1005
1005
|
}
|
|
1006
1006
|
),
|
|
1007
1007
|
/* @__PURE__ */ n("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
|
|
1008
|
-
/* @__PURE__ */ e(
|
|
1009
|
-
|
|
1008
|
+
/* @__PURE__ */ e(pa, { className: "h-2.5 w-2.5" }),
|
|
1009
|
+
p.length,
|
|
1010
1010
|
" member",
|
|
1011
|
-
|
|
1011
|
+
p.length === 1 ? "" : "s"
|
|
1012
1012
|
] })
|
|
1013
1013
|
] }),
|
|
1014
|
-
/* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children:
|
|
1014
|
+
/* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: _e ? /* @__PURE__ */ n("div", { children: [
|
|
1015
1015
|
/* @__PURE__ */ e(
|
|
1016
1016
|
"textarea",
|
|
1017
1017
|
{
|
|
1018
1018
|
autoFocus: !0,
|
|
1019
1019
|
rows: 2,
|
|
1020
|
-
value:
|
|
1021
|
-
onChange: (
|
|
1020
|
+
value: re,
|
|
1021
|
+
onChange: (f) => j(f.target.value),
|
|
1022
1022
|
maxLength: 200,
|
|
1023
|
-
onKeyDown: (
|
|
1024
|
-
|
|
1023
|
+
onKeyDown: (f) => {
|
|
1024
|
+
f.key === "Escape" && (j(t.description || ""), q(!1)), f.key === "Enter" && (f.metaKey || f.ctrlKey) && Ce();
|
|
1025
1025
|
},
|
|
1026
1026
|
placeholder: "What is this group for?",
|
|
1027
1027
|
className: "block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
@@ -1029,7 +1029,7 @@ function Xs({
|
|
|
1029
1029
|
),
|
|
1030
1030
|
/* @__PURE__ */ n("div", { className: "mt-1.5 flex items-center justify-between", children: [
|
|
1031
1031
|
/* @__PURE__ */ n("span", { className: "text-[10.5px] text-muted-foreground", children: [
|
|
1032
|
-
|
|
1032
|
+
re.length,
|
|
1033
1033
|
"/200 · Esc to cancel · ⌘↩ to save"
|
|
1034
1034
|
] }),
|
|
1035
1035
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
|
|
@@ -1038,7 +1038,7 @@ function Xs({
|
|
|
1038
1038
|
{
|
|
1039
1039
|
type: "button",
|
|
1040
1040
|
onClick: () => {
|
|
1041
|
-
|
|
1041
|
+
j(t.description || ""), q(!1);
|
|
1042
1042
|
},
|
|
1043
1043
|
className: "h-6 rounded-[5px] px-2 text-[11px] font-medium text-foreground/80 hover:bg-accent",
|
|
1044
1044
|
children: "Cancel"
|
|
@@ -1048,7 +1048,7 @@ function Xs({
|
|
|
1048
1048
|
"button",
|
|
1049
1049
|
{
|
|
1050
1050
|
type: "button",
|
|
1051
|
-
onClick:
|
|
1051
|
+
onClick: Ce,
|
|
1052
1052
|
className: "inline-flex h-6 items-center rounded-[5px] bg-foreground px-2 text-[11px] font-medium text-background hover:opacity-90",
|
|
1053
1053
|
children: "Save"
|
|
1054
1054
|
}
|
|
@@ -1060,7 +1060,7 @@ function Xs({
|
|
|
1060
1060
|
{
|
|
1061
1061
|
type: "button",
|
|
1062
1062
|
onClick: () => {
|
|
1063
|
-
r && (
|
|
1063
|
+
r && (j(t.description || ""), q(!0));
|
|
1064
1064
|
},
|
|
1065
1065
|
disabled: !r,
|
|
1066
1066
|
title: r ? "Click to edit description" : void 0,
|
|
@@ -1068,115 +1068,115 @@ function Xs({
|
|
|
1068
1068
|
children: [
|
|
1069
1069
|
t.description ? /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: t.description }) : /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: r ? "Add a description…" : "No description" }),
|
|
1070
1070
|
/* @__PURE__ */ n("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
|
|
1071
|
-
|
|
1071
|
+
K ? `Created ${K}` : "Recently created",
|
|
1072
1072
|
r ? " · You can edit this group" : ""
|
|
1073
1073
|
] })
|
|
1074
1074
|
]
|
|
1075
1075
|
}
|
|
1076
1076
|
) }),
|
|
1077
1077
|
o && /* @__PURE__ */ e(
|
|
1078
|
-
|
|
1078
|
+
rn,
|
|
1079
1079
|
{
|
|
1080
|
-
query:
|
|
1081
|
-
setQuery:
|
|
1082
|
-
open:
|
|
1083
|
-
setOpen:
|
|
1084
|
-
candidates:
|
|
1080
|
+
query: se,
|
|
1081
|
+
setQuery: ne,
|
|
1082
|
+
open: qe,
|
|
1083
|
+
setOpen: oe,
|
|
1084
|
+
candidates: De,
|
|
1085
1085
|
showKindChip: !s,
|
|
1086
|
-
onAdd:
|
|
1087
|
-
busy:
|
|
1086
|
+
onAdd: ke,
|
|
1087
|
+
busy: m.isPending
|
|
1088
1088
|
}
|
|
1089
1089
|
),
|
|
1090
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: d ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((
|
|
1090
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: d ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(
|
|
1091
1091
|
"div",
|
|
1092
1092
|
{
|
|
1093
1093
|
className: "h-10 animate-pulse rounded-[4px] bg-muted/60"
|
|
1094
1094
|
},
|
|
1095
|
-
|
|
1096
|
-
)) }) :
|
|
1097
|
-
|
|
1095
|
+
f
|
|
1096
|
+
)) }) : y ? /* @__PURE__ */ e(
|
|
1097
|
+
Na,
|
|
1098
1098
|
{
|
|
1099
1099
|
title: "Can't load members",
|
|
1100
|
-
message:
|
|
1101
|
-
onRetry: () =>
|
|
1100
|
+
message: y,
|
|
1101
|
+
onRetry: () => g()
|
|
1102
1102
|
}
|
|
1103
|
-
) :
|
|
1103
|
+
) : p.length === 0 ? /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
1104
1104
|
/* @__PURE__ */ e("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
|
|
1105
1105
|
/* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: o ? "Search above to add people to this group." : "This group does not have any members." })
|
|
1106
|
-
] }) :
|
|
1107
|
-
var
|
|
1106
|
+
] }) : p.map((f) => {
|
|
1107
|
+
var F, Q, W, ie, J, de;
|
|
1108
1108
|
return /* @__PURE__ */ n(
|
|
1109
1109
|
"div",
|
|
1110
1110
|
{
|
|
1111
1111
|
className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
|
|
1112
1112
|
children: [
|
|
1113
|
-
/* @__PURE__ */ e(
|
|
1113
|
+
/* @__PURE__ */ e(Da, { name: ((F = f.user) == null ? void 0 : F.name) || ((Q = f.user) == null ? void 0 : Q.email) || "?" }),
|
|
1114
1114
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
1115
|
-
/* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((W =
|
|
1116
|
-
((J =
|
|
1115
|
+
/* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((W = f.user) == null ? void 0 : W.name) || ((ie = f.user) == null ? void 0 : ie.email) || "Unknown" }),
|
|
1116
|
+
((J = f.user) == null ? void 0 : J.email) && f.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: f.user.email })
|
|
1117
1117
|
] }),
|
|
1118
|
-
!s && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children:
|
|
1118
|
+
!s && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: f.userType }),
|
|
1119
1119
|
/* @__PURE__ */ e(
|
|
1120
1120
|
"button",
|
|
1121
1121
|
{
|
|
1122
1122
|
type: "button",
|
|
1123
|
-
onClick: () =>
|
|
1124
|
-
disabled: !o ||
|
|
1125
|
-
"aria-label": `Remove ${((
|
|
1123
|
+
onClick: () => He(f.userId),
|
|
1124
|
+
disabled: !o || B.isPending,
|
|
1125
|
+
"aria-label": `Remove ${((de = f.user) == null ? void 0 : de.name) || "member"}`,
|
|
1126
1126
|
className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100 disabled:opacity-30",
|
|
1127
|
-
children: /* @__PURE__ */ e(
|
|
1127
|
+
children: /* @__PURE__ */ e(ma, { className: "h-3 w-3" })
|
|
1128
1128
|
}
|
|
1129
1129
|
)
|
|
1130
1130
|
]
|
|
1131
1131
|
},
|
|
1132
|
-
|
|
1132
|
+
f.id
|
|
1133
1133
|
);
|
|
1134
1134
|
}) }),
|
|
1135
1135
|
a && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: /* @__PURE__ */ n(
|
|
1136
1136
|
"button",
|
|
1137
1137
|
{
|
|
1138
1138
|
type: "button",
|
|
1139
|
-
onClick:
|
|
1139
|
+
onClick: b,
|
|
1140
1140
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] border border-rose-200 bg-background px-2.5 text-[12px] font-medium text-rose-600 hover:bg-rose-50 dark:border-rose-900/60 dark:text-rose-400 dark:hover:bg-rose-950/30",
|
|
1141
1141
|
children: [
|
|
1142
|
-
/* @__PURE__ */ e(
|
|
1142
|
+
/* @__PURE__ */ e(pt, { className: "h-3 w-3" }),
|
|
1143
1143
|
"Delete group"
|
|
1144
1144
|
]
|
|
1145
1145
|
}
|
|
1146
1146
|
) })
|
|
1147
1147
|
] });
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1149
|
+
function an({
|
|
1150
1150
|
isTenantUser: t,
|
|
1151
1151
|
tenantId: s,
|
|
1152
1152
|
onCancel: r,
|
|
1153
1153
|
onCreated: a
|
|
1154
1154
|
}) {
|
|
1155
|
-
const [o,
|
|
1155
|
+
const [o, c] = v(""), [h, l] = v(""), [b, x] = v(null), d = Hs(), u = o.trim().length >= 3 && o.trim().length <= 50, g = async () => {
|
|
1156
1156
|
if (!u) return;
|
|
1157
|
-
|
|
1158
|
-
const
|
|
1157
|
+
x(null);
|
|
1158
|
+
const p = {
|
|
1159
1159
|
name: o.trim(),
|
|
1160
|
-
description:
|
|
1160
|
+
description: h.trim() || void 0,
|
|
1161
1161
|
type: t ? "TENANT_GROUP" : "ORG_GROUP",
|
|
1162
1162
|
...t && s ? { tenantId: s } : {}
|
|
1163
1163
|
};
|
|
1164
1164
|
try {
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
} catch (
|
|
1168
|
-
|
|
1165
|
+
const y = await d.mutateAsync(p), N = y == null ? void 0 : y.id;
|
|
1166
|
+
N ? a(N) : r();
|
|
1167
|
+
} catch (y) {
|
|
1168
|
+
x(y instanceof Error ? y.message : "Failed to create group");
|
|
1169
1169
|
}
|
|
1170
1170
|
};
|
|
1171
1171
|
return /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
1172
1172
|
/* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
|
|
1173
|
-
/* @__PURE__ */ e(
|
|
1173
|
+
/* @__PURE__ */ e(Zt, { children: "Name" }),
|
|
1174
1174
|
/* @__PURE__ */ e(
|
|
1175
1175
|
"input",
|
|
1176
1176
|
{
|
|
1177
1177
|
autoFocus: !0,
|
|
1178
1178
|
value: o,
|
|
1179
|
-
onChange: (
|
|
1179
|
+
onChange: (p) => c(p.target.value),
|
|
1180
1180
|
placeholder: "Marketing leads, North America sales, …",
|
|
1181
1181
|
maxLength: 50,
|
|
1182
1182
|
className: "mt-1 block h-7 w-full rounded-[5px] border border-border bg-background px-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
@@ -1184,24 +1184,24 @@ function Zs({
|
|
|
1184
1184
|
),
|
|
1185
1185
|
/* @__PURE__ */ e("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
|
|
1186
1186
|
/* @__PURE__ */ n("div", { className: "mt-4", children: [
|
|
1187
|
-
/* @__PURE__ */ e(
|
|
1187
|
+
/* @__PURE__ */ e(Zt, { children: "Description (optional)" }),
|
|
1188
1188
|
/* @__PURE__ */ e(
|
|
1189
1189
|
"textarea",
|
|
1190
1190
|
{
|
|
1191
1191
|
rows: 2,
|
|
1192
|
-
value:
|
|
1193
|
-
onChange: (
|
|
1192
|
+
value: h,
|
|
1193
|
+
onChange: (p) => l(p.target.value),
|
|
1194
1194
|
maxLength: 200,
|
|
1195
1195
|
placeholder: "What is this group for?",
|
|
1196
1196
|
className: "mt-1 block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
1197
1197
|
}
|
|
1198
1198
|
),
|
|
1199
1199
|
/* @__PURE__ */ n("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
|
|
1200
|
-
|
|
1200
|
+
h.length,
|
|
1201
1201
|
"/200"
|
|
1202
1202
|
] })
|
|
1203
1203
|
] }),
|
|
1204
|
-
|
|
1204
|
+
b && /* @__PURE__ */ e("div", { className: "mt-3 rounded-[5px] border border-rose-200 bg-rose-50 px-2 py-1.5 text-[11.5px] text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300", children: b })
|
|
1205
1205
|
] }),
|
|
1206
1206
|
/* @__PURE__ */ n("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: [
|
|
1207
1207
|
/* @__PURE__ */ e(
|
|
@@ -1218,13 +1218,13 @@ function Zs({
|
|
|
1218
1218
|
"button",
|
|
1219
1219
|
{
|
|
1220
1220
|
type: "button",
|
|
1221
|
-
onClick:
|
|
1221
|
+
onClick: g,
|
|
1222
1222
|
disabled: !u || d.isPending,
|
|
1223
1223
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
|
|
1224
|
-
children: d.isPending ? /* @__PURE__ */ n(
|
|
1225
|
-
/* @__PURE__ */ e(
|
|
1224
|
+
children: d.isPending ? /* @__PURE__ */ n(G, { children: [
|
|
1225
|
+
/* @__PURE__ */ e($e, { className: "h-3 w-3 animate-spin" }),
|
|
1226
1226
|
"Creating…"
|
|
1227
|
-
] }) : /* @__PURE__ */ n(
|
|
1227
|
+
] }) : /* @__PURE__ */ n(G, { children: [
|
|
1228
1228
|
/* @__PURE__ */ e(H, { className: "h-3 w-3" }),
|
|
1229
1229
|
"Create group"
|
|
1230
1230
|
] })
|
|
@@ -1233,75 +1233,75 @@ function Zs({
|
|
|
1233
1233
|
] })
|
|
1234
1234
|
] });
|
|
1235
1235
|
}
|
|
1236
|
-
function
|
|
1236
|
+
function rn({
|
|
1237
1237
|
query: t,
|
|
1238
1238
|
setQuery: s,
|
|
1239
1239
|
open: r,
|
|
1240
1240
|
setOpen: a,
|
|
1241
1241
|
candidates: o,
|
|
1242
|
-
showKindChip:
|
|
1243
|
-
onAdd:
|
|
1244
|
-
busy:
|
|
1242
|
+
showKindChip: c,
|
|
1243
|
+
onAdd: h,
|
|
1244
|
+
busy: l
|
|
1245
1245
|
}) {
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1246
|
+
const b = Jt(null), x = Jt(null), [d, u] = v(null);
|
|
1247
|
+
as(() => {
|
|
1248
1248
|
if (!r) {
|
|
1249
1249
|
u(null);
|
|
1250
1250
|
return;
|
|
1251
1251
|
}
|
|
1252
|
-
const
|
|
1253
|
-
const
|
|
1254
|
-
if (!
|
|
1255
|
-
const
|
|
1252
|
+
const p = () => {
|
|
1253
|
+
const y = b.current;
|
|
1254
|
+
if (!y) return;
|
|
1255
|
+
const N = y.getBoundingClientRect(), C = 240, m = window.innerHeight - N.bottom < C + 16 && N.top > C;
|
|
1256
1256
|
u({
|
|
1257
|
-
left:
|
|
1258
|
-
top:
|
|
1259
|
-
width:
|
|
1260
|
-
above:
|
|
1257
|
+
left: N.left,
|
|
1258
|
+
top: m ? N.top - 6 : N.bottom + 6,
|
|
1259
|
+
width: N.width,
|
|
1260
|
+
above: m
|
|
1261
1261
|
});
|
|
1262
1262
|
};
|
|
1263
|
-
return
|
|
1264
|
-
window.removeEventListener("resize",
|
|
1263
|
+
return p(), window.addEventListener("resize", p), window.addEventListener("scroll", p, !0), () => {
|
|
1264
|
+
window.removeEventListener("resize", p), window.removeEventListener("scroll", p, !0);
|
|
1265
1265
|
};
|
|
1266
|
-
}, [r, o.length]),
|
|
1266
|
+
}, [r, o.length]), ze(() => {
|
|
1267
1267
|
if (!r) return;
|
|
1268
|
-
const
|
|
1269
|
-
var
|
|
1270
|
-
const
|
|
1271
|
-
(
|
|
1268
|
+
const p = (y) => {
|
|
1269
|
+
var C, S;
|
|
1270
|
+
const N = y.target;
|
|
1271
|
+
(C = b.current) != null && C.contains(N) || (S = x.current) != null && S.contains(N) || a(!1);
|
|
1272
1272
|
};
|
|
1273
|
-
return document.addEventListener("mousedown",
|
|
1273
|
+
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
1274
1274
|
}, [r, a]);
|
|
1275
|
-
const
|
|
1275
|
+
const g = r && o.length > 0 && d;
|
|
1276
1276
|
return /* @__PURE__ */ n("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
|
|
1277
1277
|
/* @__PURE__ */ n(
|
|
1278
1278
|
"div",
|
|
1279
1279
|
{
|
|
1280
|
-
ref:
|
|
1280
|
+
ref: b,
|
|
1281
1281
|
className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40",
|
|
1282
1282
|
children: [
|
|
1283
|
-
/* @__PURE__ */ e(
|
|
1283
|
+
/* @__PURE__ */ e(ks, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1284
1284
|
/* @__PURE__ */ e(
|
|
1285
1285
|
"input",
|
|
1286
1286
|
{
|
|
1287
1287
|
value: t,
|
|
1288
|
-
onChange: (
|
|
1289
|
-
s(
|
|
1288
|
+
onChange: (p) => {
|
|
1289
|
+
s(p.target.value), a(!0);
|
|
1290
1290
|
},
|
|
1291
1291
|
onFocus: () => a(!0),
|
|
1292
1292
|
placeholder: "Add a member by name or email…",
|
|
1293
|
-
disabled:
|
|
1293
|
+
disabled: l,
|
|
1294
1294
|
className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed"
|
|
1295
1295
|
}
|
|
1296
1296
|
)
|
|
1297
1297
|
]
|
|
1298
1298
|
}
|
|
1299
1299
|
),
|
|
1300
|
-
|
|
1300
|
+
g && typeof document < "u" && ss(
|
|
1301
1301
|
/* @__PURE__ */ e(
|
|
1302
1302
|
"div",
|
|
1303
1303
|
{
|
|
1304
|
-
ref:
|
|
1304
|
+
ref: x,
|
|
1305
1305
|
style: {
|
|
1306
1306
|
position: "fixed",
|
|
1307
1307
|
left: d.left,
|
|
@@ -1310,22 +1310,22 @@ function en({
|
|
|
1310
1310
|
transform: d.above ? "translateY(-100%)" : void 0
|
|
1311
1311
|
},
|
|
1312
1312
|
className: "z-[60] max-h-[240px] overflow-y-auto rounded-[5px] border border-border bg-background shadow-[0_8px_24px_-12px_rgba(0,0,0,0.18)]",
|
|
1313
|
-
children: o.map((
|
|
1313
|
+
children: o.map((p) => /* @__PURE__ */ n(
|
|
1314
1314
|
"button",
|
|
1315
1315
|
{
|
|
1316
1316
|
type: "button",
|
|
1317
|
-
onClick: () => p
|
|
1317
|
+
onClick: () => h(p),
|
|
1318
1318
|
className: "flex w-full items-center gap-2 border-b border-border/60 px-2.5 py-2 text-left last:border-b-0 hover:bg-accent",
|
|
1319
1319
|
children: [
|
|
1320
|
-
/* @__PURE__ */ e(
|
|
1320
|
+
/* @__PURE__ */ e(Da, { name: p.name || p.email || "?" }),
|
|
1321
1321
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
1322
|
-
/* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children:
|
|
1323
|
-
|
|
1322
|
+
/* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children: p.name || p.email || "Unknown" }),
|
|
1323
|
+
p.email && p.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: p.email })
|
|
1324
1324
|
] }),
|
|
1325
|
-
|
|
1325
|
+
c && p.type && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: p.type === "tenant" ? "tenant" : "org" })
|
|
1326
1326
|
]
|
|
1327
1327
|
},
|
|
1328
|
-
|
|
1328
|
+
p.id
|
|
1329
1329
|
))
|
|
1330
1330
|
}
|
|
1331
1331
|
),
|
|
@@ -1333,7 +1333,7 @@ function en({
|
|
|
1333
1333
|
)
|
|
1334
1334
|
] });
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1336
|
+
function wa(t, s) {
|
|
1337
1337
|
if (!t) return s;
|
|
1338
1338
|
if (t instanceof Error) {
|
|
1339
1339
|
const r = t.message || "", a = r.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
|
|
@@ -1341,7 +1341,7 @@ function va(t, s) {
|
|
|
1341
1341
|
}
|
|
1342
1342
|
return typeof t == "string" ? t : s;
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function Na({
|
|
1345
1345
|
title: t,
|
|
1346
1346
|
message: s,
|
|
1347
1347
|
onRetry: r
|
|
@@ -1360,43 +1360,43 @@ function ya({
|
|
|
1360
1360
|
)
|
|
1361
1361
|
] });
|
|
1362
1362
|
}
|
|
1363
|
-
function
|
|
1363
|
+
function Zt({ children: t }) {
|
|
1364
1364
|
return /* @__PURE__ */ e("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: t });
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1366
|
+
function Da({ name: t }) {
|
|
1367
1367
|
const s = t.split(" ").map((r) => r[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
1368
|
-
return /* @__PURE__ */ e(
|
|
1368
|
+
return /* @__PURE__ */ e(va, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(ya, { className: "text-[9px] font-semibold", children: s || "?" }) });
|
|
1369
1369
|
}
|
|
1370
|
-
function
|
|
1371
|
-
var
|
|
1370
|
+
function ge(t, s, r) {
|
|
1371
|
+
var c, h;
|
|
1372
1372
|
const a = (t.controls || []).find(
|
|
1373
|
-
(
|
|
1373
|
+
(l) => l.id === r
|
|
1374
1374
|
);
|
|
1375
1375
|
if (a)
|
|
1376
1376
|
return a.label;
|
|
1377
|
-
const o = (
|
|
1378
|
-
(
|
|
1377
|
+
const o = (h = (c = sa(t, s)) == null ? void 0 : c.controls) == null ? void 0 : h.find(
|
|
1378
|
+
(l) => l.id === r
|
|
1379
1379
|
);
|
|
1380
1380
|
return (o == null ? void 0 : o.label) || r;
|
|
1381
1381
|
}
|
|
1382
|
-
function
|
|
1382
|
+
function be(t, s) {
|
|
1383
1383
|
var r;
|
|
1384
|
-
return ((r =
|
|
1384
|
+
return ((r = sa(t, s)) == null ? void 0 : r.title) || s;
|
|
1385
1385
|
}
|
|
1386
|
-
function
|
|
1386
|
+
function sn(t) {
|
|
1387
1387
|
const { errors: s, dashboard: r } = t;
|
|
1388
1388
|
if (!r)
|
|
1389
1389
|
return s;
|
|
1390
1390
|
const a = /* @__PURE__ */ new Map();
|
|
1391
1391
|
for (const o of s) {
|
|
1392
|
-
const
|
|
1392
|
+
const c = o.match(
|
|
1393
1393
|
/^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
|
|
1394
1394
|
);
|
|
1395
|
-
if (
|
|
1396
|
-
const [, d, u] =
|
|
1397
|
-
a.has(
|
|
1398
|
-
|
|
1399
|
-
`"${
|
|
1395
|
+
if (c) {
|
|
1396
|
+
const [, d, u] = c, g = `${d}:${u}:missing-metric`;
|
|
1397
|
+
a.has(g) || a.set(
|
|
1398
|
+
g,
|
|
1399
|
+
`"${be(r, d)}" has an outdated "${ge(
|
|
1400
1400
|
r,
|
|
1401
1401
|
d,
|
|
1402
1402
|
u
|
|
@@ -1404,14 +1404,14 @@ function tn(t) {
|
|
|
1404
1404
|
);
|
|
1405
1405
|
continue;
|
|
1406
1406
|
}
|
|
1407
|
-
const
|
|
1407
|
+
const h = o.match(
|
|
1408
1408
|
/^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
|
|
1409
1409
|
);
|
|
1410
|
-
if (
|
|
1411
|
-
const [, d, u] =
|
|
1412
|
-
a.has(
|
|
1413
|
-
|
|
1414
|
-
`"${
|
|
1410
|
+
if (h) {
|
|
1411
|
+
const [, d, u] = h, g = `${d}:${u}:missing-group-by`;
|
|
1412
|
+
a.has(g) || a.set(
|
|
1413
|
+
g,
|
|
1414
|
+
`"${be(r, d)}" has an outdated "${ge(
|
|
1415
1415
|
r,
|
|
1416
1416
|
d,
|
|
1417
1417
|
u
|
|
@@ -1419,14 +1419,14 @@ function tn(t) {
|
|
|
1419
1419
|
);
|
|
1420
1420
|
continue;
|
|
1421
1421
|
}
|
|
1422
|
-
const
|
|
1422
|
+
const l = o.match(
|
|
1423
1423
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
|
|
1424
1424
|
);
|
|
1425
|
-
if (
|
|
1426
|
-
const [, d, u] =
|
|
1427
|
-
a.has(
|
|
1428
|
-
|
|
1429
|
-
`"${
|
|
1425
|
+
if (l) {
|
|
1426
|
+
const [, d, u] = l, g = `${d}:${u}:invalid-metric`;
|
|
1427
|
+
a.has(g) || a.set(
|
|
1428
|
+
g,
|
|
1429
|
+
`"${be(r, d)}" has an invalid "${ge(
|
|
1430
1430
|
r,
|
|
1431
1431
|
d,
|
|
1432
1432
|
u
|
|
@@ -1434,14 +1434,14 @@ function tn(t) {
|
|
|
1434
1434
|
);
|
|
1435
1435
|
continue;
|
|
1436
1436
|
}
|
|
1437
|
-
const
|
|
1437
|
+
const b = o.match(
|
|
1438
1438
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
|
|
1439
1439
|
);
|
|
1440
|
-
if (
|
|
1441
|
-
const [, d, u] =
|
|
1442
|
-
a.has(
|
|
1443
|
-
|
|
1444
|
-
`"${
|
|
1440
|
+
if (b) {
|
|
1441
|
+
const [, d, u] = b, g = `${d}:${u}:invalid-group-by`;
|
|
1442
|
+
a.has(g) || a.set(
|
|
1443
|
+
g,
|
|
1444
|
+
`"${be(r, d)}" has an invalid "${ge(
|
|
1445
1445
|
r,
|
|
1446
1446
|
d,
|
|
1447
1447
|
u
|
|
@@ -1449,14 +1449,14 @@ function tn(t) {
|
|
|
1449
1449
|
);
|
|
1450
1450
|
continue;
|
|
1451
1451
|
}
|
|
1452
|
-
const
|
|
1452
|
+
const x = o.match(
|
|
1453
1453
|
/^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
|
|
1454
1454
|
);
|
|
1455
|
-
if (
|
|
1456
|
-
const [, d, u] =
|
|
1457
|
-
a.has(
|
|
1458
|
-
|
|
1459
|
-
`"${
|
|
1455
|
+
if (x) {
|
|
1456
|
+
const [, d, u] = x, g = `${d}:${u}:missing-temporal-group-by`;
|
|
1457
|
+
a.has(g) || a.set(
|
|
1458
|
+
g,
|
|
1459
|
+
`"${be(r, d)}" can no longer use "${ge(
|
|
1460
1460
|
r,
|
|
1461
1461
|
d,
|
|
1462
1462
|
u
|
|
@@ -1468,299 +1468,309 @@ function tn(t) {
|
|
|
1468
1468
|
}
|
|
1469
1469
|
return Array.from(a.values());
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1471
|
+
function nn({
|
|
1472
1472
|
visible: t,
|
|
1473
1473
|
onSelect: s
|
|
1474
1474
|
}) {
|
|
1475
|
-
return t ? /* @__PURE__ */ n(
|
|
1476
|
-
/* @__PURE__ */ e(
|
|
1475
|
+
return t ? /* @__PURE__ */ n(T, { onSelect: s, children: [
|
|
1476
|
+
/* @__PURE__ */ e(yr, { className: "h-3.5 w-3.5" }),
|
|
1477
1477
|
"Schedule email report"
|
|
1478
1478
|
] }) : null;
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1480
|
+
function on({
|
|
1481
1481
|
scheduleReportVisible: t,
|
|
1482
1482
|
analyticalBriefingVisible: s,
|
|
1483
1483
|
onScheduleReport: r,
|
|
1484
1484
|
onCreateAnalyticalBriefing: a
|
|
1485
1485
|
}) {
|
|
1486
|
-
return /* @__PURE__ */ n(
|
|
1486
|
+
return /* @__PURE__ */ n(G, { children: [
|
|
1487
1487
|
/* @__PURE__ */ e(
|
|
1488
|
-
|
|
1488
|
+
nn,
|
|
1489
1489
|
{
|
|
1490
1490
|
visible: t,
|
|
1491
1491
|
onSelect: r
|
|
1492
1492
|
}
|
|
1493
1493
|
),
|
|
1494
|
-
s ? /* @__PURE__ */ n(
|
|
1494
|
+
s ? /* @__PURE__ */ n(T, { onSelect: a, children: [
|
|
1495
1495
|
/* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
|
|
1496
1496
|
"Create analytical briefing"
|
|
1497
1497
|
] }) : null
|
|
1498
1498
|
] });
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function ea(t, s) {
|
|
1501
1501
|
return {
|
|
1502
|
-
dashboard:
|
|
1503
|
-
semanticExecutionPayload:
|
|
1502
|
+
dashboard: dt(t),
|
|
1503
|
+
semanticExecutionPayload: dt(s)
|
|
1504
1504
|
};
|
|
1505
1505
|
}
|
|
1506
|
-
function
|
|
1507
|
-
var
|
|
1508
|
-
|
|
1506
|
+
function En() {
|
|
1507
|
+
var Ut, Rt, Vt, Ft, Ot, Tt, Gt, Bt;
|
|
1508
|
+
ns(), os();
|
|
1509
1509
|
const {
|
|
1510
1510
|
authToken: t,
|
|
1511
1511
|
tokenProps: s,
|
|
1512
1512
|
id: r,
|
|
1513
1513
|
showBriefings: a
|
|
1514
|
-
} =
|
|
1514
|
+
} = _(), o = wr(), { isLocalDev: c, preferences: h } = Nr(), l = ((Ut = h == null ? void 0 : h.uiMode) == null ? void 0 : Ut.inspection) === !0, { openBrandStudioPreview: b } = Dr(), { permissions: x } = Ps(), d = Cr(), { isLoading: u } = kr(), g = D((i) => i.theme), p = D((i) => i.isDownloadingPdf), y = D(
|
|
1515
1515
|
(i) => i.dashboardAssistantDraftScopeKey
|
|
1516
|
-
),
|
|
1517
|
-
(i) => i.id ===
|
|
1518
|
-
),
|
|
1516
|
+
), N = D((i) => i.lenses), C = D((i) => i.selectedLensId), S = N == null ? void 0 : N.find((i) => i.id === C), m = D((i) => i.dashboard), B = D((i) => i.selectedSheetId), V = (Rt = m == null ? void 0 : m.sheets) == null ? void 0 : Rt.find(
|
|
1517
|
+
(i) => i.id === B
|
|
1518
|
+
), w = Ja(V), M = w ? (Vt = V == null ? void 0 : V.document) == null ? void 0 : Vt.page : void 0, k = D(
|
|
1519
1519
|
(i) => i.isDashboardEditing
|
|
1520
|
-
), { setDashboardTitle:
|
|
1521
|
-
|
|
1522
|
-
const
|
|
1520
|
+
), { setDashboardTitle: ee } = D((i) => i.actions), [_e, q] = v(!1), [re, j] = v(!1), [se, ne] = v(!1), [qe, oe] = v(!1), [De, te] = v(null), [Ce, ke] = v(!1), [He, K] = v(!1), [f, F] = v(!1), [Q, W] = v(null), [ie, J] = v([]), [de, Se] = v(!1), [Ca, vt] = v(!1), yt = D((i) => i.filterValues), A = D((i) => i.isVisualEditing);
|
|
1521
|
+
zt((i) => i.card);
|
|
1522
|
+
const le = Te(
|
|
1523
1523
|
(i) => i.selectedDashboard
|
|
1524
|
-
),
|
|
1524
|
+
), Ie = Te(
|
|
1525
1525
|
(i) => i.initialDashboard
|
|
1526
1526
|
);
|
|
1527
|
-
|
|
1528
|
-
const
|
|
1527
|
+
Te((i) => i.selectedVisual), D((i) => i.selectedFrameId), zt((i) => i.frame);
|
|
1528
|
+
const Me = le ? (Ot = le == null ? void 0 : le.permissions) == null ? void 0 : Ot.canEdit : (Ft = Ie == null ? void 0 : Ie.permissions) == null ? void 0 : Ft.canEdit, wt = D(
|
|
1529
1529
|
(i) => i.showDashboardJSON
|
|
1530
|
-
),
|
|
1531
|
-
setIsDashboardEditing:
|
|
1532
|
-
setShowDashboardJSON:
|
|
1533
|
-
} = D((i) => i.actions), { setInitialDashboard:
|
|
1530
|
+
), je = D((i) => i.onSaveFunction), {
|
|
1531
|
+
setIsDashboardEditing: Nt,
|
|
1532
|
+
setShowDashboardJSON: Dt
|
|
1533
|
+
} = D((i) => i.actions), { setInitialDashboard: Ct, clearSelectedDashboard: Ke } = Te(
|
|
1534
1534
|
(i) => i.actions
|
|
1535
|
-
),
|
|
1535
|
+
), ce = !!s.orgUserId || !!(s.tenantId && s.endUserId && s.endUserEmail), { resources: Ee } = Sr(st.DASHBOARD), { data: Qe } = Ir(), ka = ((Tt = Qe == null ? void 0 : Qe.preference) == null ? void 0 : Tt.defaultDashboardId) || null, { mutate: Sa, isPending: Ia } = Mr(), { currentUser: Ma } = ht(), Ea = Er(Ma), $ = le || Ie, ae = Lr({
|
|
1536
1536
|
config: s.config,
|
|
1537
|
-
canNavigateDashboardHub:
|
|
1538
|
-
canShareDashboard: ((
|
|
1539
|
-
canManageGroups:
|
|
1540
|
-
}),
|
|
1541
|
-
id:
|
|
1542
|
-
title: (
|
|
1543
|
-
} : null, { handleAddNewFrame:
|
|
1544
|
-
if (!
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
{
|
|
1558
|
-
onSuccess: () => {
|
|
1559
|
-
console.log("Dashboard title updated successfully"), C.success("Dashboard title updated");
|
|
1537
|
+
canNavigateDashboardHub: ce,
|
|
1538
|
+
canShareDashboard: ((Gt = $ == null ? void 0 : $.permissions) == null ? void 0 : Gt.canShare) === !0,
|
|
1539
|
+
canManageGroups: Ea
|
|
1540
|
+
}), kt = $ ? {
|
|
1541
|
+
id: $.id,
|
|
1542
|
+
title: (m == null ? void 0 : m.title) || $.title || "Dashboard"
|
|
1543
|
+
} : null, { handleAddNewFrame: La } = Ar(), [We, Je] = v(!1), [Aa, ue] = v(!1), [Ye, Le] = v("close"), me = Pr(st.DASHBOARD), [L, Ae] = v(null), Pa = async (i, E) => {
|
|
1544
|
+
if (!l) {
|
|
1545
|
+
if (!(m != null && m.id)) {
|
|
1546
|
+
console.log("No dashboard ID found");
|
|
1547
|
+
return;
|
|
1548
|
+
}
|
|
1549
|
+
console.log("Updating dashboard title:", {
|
|
1550
|
+
dashboardId: m.id,
|
|
1551
|
+
newTitle: i,
|
|
1552
|
+
previousTitle: E
|
|
1553
|
+
}), me.mutate(
|
|
1554
|
+
{
|
|
1555
|
+
resourceId: m.id,
|
|
1556
|
+
data: { title: i }
|
|
1560
1557
|
},
|
|
1561
|
-
|
|
1562
|
-
|
|
1558
|
+
{
|
|
1559
|
+
onSuccess: () => {
|
|
1560
|
+
console.log("Dashboard title updated successfully"), I.success("Dashboard title updated");
|
|
1561
|
+
},
|
|
1562
|
+
onError: (O) => {
|
|
1563
|
+
console.error("Failed to update dashboard title:", O), I.error("Failed to update dashboard title"), ee(E);
|
|
1564
|
+
}
|
|
1563
1565
|
}
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
+
);
|
|
1567
|
+
}
|
|
1566
1568
|
};
|
|
1567
|
-
|
|
1568
|
-
if (
|
|
1569
|
-
const i =
|
|
1569
|
+
ze(() => {
|
|
1570
|
+
if (Ee && Ee.length > 0) {
|
|
1571
|
+
const i = m == null ? void 0 : m.id;
|
|
1570
1572
|
if (i) {
|
|
1571
|
-
const
|
|
1572
|
-
(
|
|
1573
|
+
const E = Ee.find(
|
|
1574
|
+
(O) => O.id === i
|
|
1573
1575
|
);
|
|
1574
|
-
|
|
1576
|
+
E && Ct(E);
|
|
1575
1577
|
}
|
|
1576
1578
|
}
|
|
1577
|
-
}, [
|
|
1578
|
-
const
|
|
1579
|
-
() =>
|
|
1579
|
+
}, [Ee, m == null ? void 0 : m.id, Ct]);
|
|
1580
|
+
const he = s.orgUserId || s.tenantId, Xe = X(
|
|
1581
|
+
() => dn({
|
|
1580
1582
|
accessToken: t == null ? void 0 : t.accessToken,
|
|
1581
|
-
dashboardId: (
|
|
1582
|
-
selectedSheetId:
|
|
1583
|
-
pageSize:
|
|
1584
|
-
orientation:
|
|
1585
|
-
theme:
|
|
1583
|
+
dashboardId: (m == null ? void 0 : m.id) || r || s.dashboard_id,
|
|
1584
|
+
selectedSheetId: w ? B : void 0,
|
|
1585
|
+
pageSize: M == null ? void 0 : M.size,
|
|
1586
|
+
orientation: M == null ? void 0 : M.orientation,
|
|
1587
|
+
theme: g
|
|
1586
1588
|
}),
|
|
1587
1589
|
[
|
|
1588
1590
|
t == null ? void 0 : t.accessToken,
|
|
1589
1591
|
r,
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1592
|
+
m == null ? void 0 : m.id,
|
|
1593
|
+
w,
|
|
1594
|
+
M == null ? void 0 : M.orientation,
|
|
1595
|
+
M == null ? void 0 : M.size,
|
|
1596
|
+
B,
|
|
1597
|
+
g,
|
|
1596
1598
|
s.dashboard_id
|
|
1597
1599
|
]
|
|
1598
|
-
),
|
|
1600
|
+
), St = k && !A && !l && he && Me, { setDashboard: Ze } = D((i) => i.actions), It = D(
|
|
1599
1601
|
(i) => i.semanticExecutionPayload
|
|
1600
|
-
),
|
|
1601
|
-
|
|
1602
|
-
},
|
|
1603
|
-
|
|
1602
|
+
), Ua = () => {
|
|
1603
|
+
Nt(!0);
|
|
1604
|
+
}, Pe = () => {
|
|
1605
|
+
Nt(!1), Dt(!1), Ae(null);
|
|
1604
1606
|
};
|
|
1605
|
-
|
|
1606
|
-
if (!
|
|
1607
|
-
|
|
1607
|
+
ze(() => {
|
|
1608
|
+
if (!k) {
|
|
1609
|
+
L && Ae(null);
|
|
1608
1610
|
return;
|
|
1609
1611
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1612
|
+
L || !m || u || Ae(
|
|
1613
|
+
ea(
|
|
1614
|
+
m,
|
|
1615
|
+
It
|
|
1614
1616
|
)
|
|
1615
1617
|
);
|
|
1616
1618
|
}, [
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1619
|
+
m,
|
|
1620
|
+
L,
|
|
1621
|
+
k,
|
|
1622
|
+
u,
|
|
1623
|
+
It
|
|
1622
1624
|
]);
|
|
1623
|
-
const
|
|
1624
|
-
|
|
1625
|
-
|
|
1625
|
+
const Ue = (L == null ? void 0 : L.dashboard) ?? null, { isDirty: Mt, isDirtyPending: Ra, resetDirty: pe } = bs(
|
|
1626
|
+
m,
|
|
1627
|
+
Ue,
|
|
1626
1628
|
300,
|
|
1627
1629
|
1e3,
|
|
1628
|
-
|
|
1629
|
-
),
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1630
|
+
nt
|
|
1631
|
+
), Et = rs(() => Ue ? nt(m) !== nt(Ue) : !1, [m, Ue]), Lt = Mt || Ra, Re = We || me.isPending, Va = () => {
|
|
1632
|
+
if (l) {
|
|
1633
|
+
L && Ze(L.dashboard, {
|
|
1634
|
+
semanticExecutionPayload: L.semanticExecutionPayload
|
|
1635
|
+
}), Pe(), pe();
|
|
1636
|
+
return;
|
|
1637
|
+
}
|
|
1638
|
+
Et() ? (Le("close"), ue(!0)) : (Pe(), pe());
|
|
1639
|
+
}, Fa = async () => {
|
|
1640
|
+
await et({
|
|
1633
1641
|
closeAfterSave: !0,
|
|
1634
|
-
navigateHomeAfterSave:
|
|
1642
|
+
navigateHomeAfterSave: Ye === "home"
|
|
1635
1643
|
});
|
|
1636
|
-
},
|
|
1637
|
-
const i =
|
|
1638
|
-
|
|
1639
|
-
semanticExecutionPayload:
|
|
1640
|
-
}),
|
|
1641
|
-
},
|
|
1642
|
-
|
|
1643
|
-
semanticExecutionPayload:
|
|
1644
|
-
}),
|
|
1645
|
-
},
|
|
1646
|
-
if (
|
|
1647
|
-
if (
|
|
1648
|
-
|
|
1644
|
+
}, Oa = () => {
|
|
1645
|
+
const i = Ye === "home" && !!ce;
|
|
1646
|
+
L && Ze(L.dashboard, {
|
|
1647
|
+
semanticExecutionPayload: L.semanticExecutionPayload
|
|
1648
|
+
}), Pe(), i && Ke(), Le("close"), ue(!1), pe();
|
|
1649
|
+
}, Ta = () => {
|
|
1650
|
+
L && (Ze(L.dashboard, {
|
|
1651
|
+
semanticExecutionPayload: L.semanticExecutionPayload
|
|
1652
|
+
}), pe());
|
|
1653
|
+
}, Ga = () => {
|
|
1654
|
+
if (ce) {
|
|
1655
|
+
if (k && Et()) {
|
|
1656
|
+
Le("home"), ue(!0);
|
|
1649
1657
|
return;
|
|
1650
1658
|
}
|
|
1651
|
-
|
|
1659
|
+
Ke();
|
|
1652
1660
|
}
|
|
1653
1661
|
};
|
|
1654
|
-
async function
|
|
1655
|
-
|
|
1656
|
-
|
|
1662
|
+
async function et(i) {
|
|
1663
|
+
if (l)
|
|
1664
|
+
return;
|
|
1665
|
+
const E = D.getState().dashboard;
|
|
1666
|
+
if (!E)
|
|
1657
1667
|
return;
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1660
|
-
const
|
|
1661
|
-
|
|
1662
|
-
const
|
|
1663
|
-
template:
|
|
1668
|
+
const O = (i == null ? void 0 : i.closeAfterSave) ?? de, tt = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
|
|
1669
|
+
Se(O), O && ue(!1);
|
|
1670
|
+
const at = dt(E);
|
|
1671
|
+
F(!0), W(null), J([]), Je(!0);
|
|
1672
|
+
const Ha = {
|
|
1673
|
+
template: E
|
|
1664
1674
|
};
|
|
1665
|
-
|
|
1675
|
+
me.mutate(
|
|
1666
1676
|
{
|
|
1667
|
-
resourceId:
|
|
1668
|
-
data:
|
|
1677
|
+
resourceId: E.id,
|
|
1678
|
+
data: Ha
|
|
1669
1679
|
},
|
|
1670
1680
|
{
|
|
1671
|
-
onSuccess: (
|
|
1672
|
-
var
|
|
1673
|
-
const Y = (
|
|
1674
|
-
if (!
|
|
1675
|
-
const
|
|
1676
|
-
(
|
|
1681
|
+
onSuccess: (P) => {
|
|
1682
|
+
var Ve, Fe, $t;
|
|
1683
|
+
const Y = (P == null ? void 0 : P.id) || ((Ve = P == null ? void 0 : P.dashboard) == null ? void 0 : Ve.id) || ((Fe = P == null ? void 0 : P.resource) == null ? void 0 : Fe.id) || (($t = P == null ? void 0 : P.template) == null ? void 0 : $t.id) || null;
|
|
1684
|
+
if (!E.id && Y) {
|
|
1685
|
+
const rt = ar.getState(), Oe = rt.pendingDashboardDraftMigration;
|
|
1686
|
+
(Oe == null ? void 0 : Oe.scopeKey) === y ? rt.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
|
|
1677
1687
|
Y
|
|
1678
|
-
) :
|
|
1688
|
+
) : Oe && rt.actions.clearPendingDashboardDraftMigration();
|
|
1679
1689
|
}
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1690
|
+
Je(!1), I.success("Dashboard saved!"), Ae(
|
|
1691
|
+
ea(
|
|
1692
|
+
at,
|
|
1683
1693
|
D.getState().semanticExecutionPayload
|
|
1684
1694
|
)
|
|
1685
|
-
),
|
|
1695
|
+
), F(!1), Se(!1), O && (Pe(), pe(), tt && ce && Ke()), Le("close");
|
|
1686
1696
|
},
|
|
1687
|
-
onError: (
|
|
1688
|
-
|
|
1689
|
-
const Y =
|
|
1697
|
+
onError: (P) => {
|
|
1698
|
+
Je(!1), W("Failed to save dashboard. Please try again.");
|
|
1699
|
+
const Y = P.details, Ve = Array.isArray(
|
|
1690
1700
|
Y == null ? void 0 : Y.errors
|
|
1691
1701
|
) ? (Y.errors || []).filter(
|
|
1692
|
-
(
|
|
1702
|
+
(Fe) => typeof Fe == "string"
|
|
1693
1703
|
) : [];
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
errors:
|
|
1697
|
-
dashboard:
|
|
1704
|
+
J(
|
|
1705
|
+
sn({
|
|
1706
|
+
errors: Ve,
|
|
1707
|
+
dashboard: E || void 0
|
|
1698
1708
|
})
|
|
1699
|
-
),
|
|
1709
|
+
), I.error("Failed to save dashboard");
|
|
1700
1710
|
}
|
|
1701
1711
|
}
|
|
1702
1712
|
);
|
|
1703
1713
|
}
|
|
1704
|
-
async function
|
|
1705
|
-
if (
|
|
1714
|
+
async function Ba() {
|
|
1715
|
+
if (l || (q(!0), !C || !S)) return;
|
|
1706
1716
|
const i = D.getState().dashboard;
|
|
1707
1717
|
if (!i) {
|
|
1708
|
-
|
|
1718
|
+
q(!1);
|
|
1709
1719
|
return;
|
|
1710
1720
|
}
|
|
1711
|
-
const
|
|
1721
|
+
const E = JSON.stringify(i), O = D.getState(), tt = fa({
|
|
1712
1722
|
dashboard: i,
|
|
1713
|
-
dashboardInputValues:
|
|
1714
|
-
filterValues:
|
|
1715
|
-
controlValues:
|
|
1716
|
-
inlineFilterValuesMap:
|
|
1717
|
-
cardControlValuesMap:
|
|
1718
|
-
}),
|
|
1719
|
-
...
|
|
1720
|
-
template:
|
|
1721
|
-
filterValues:
|
|
1722
|
-
inputValues:
|
|
1723
|
+
dashboardInputValues: O.dashboardInputValues,
|
|
1724
|
+
filterValues: yt,
|
|
1725
|
+
controlValues: O.controlValues,
|
|
1726
|
+
inlineFilterValuesMap: O.inlineFilterValuesMap,
|
|
1727
|
+
cardControlValuesMap: O.cardControlValuesMap
|
|
1728
|
+
}), at = {
|
|
1729
|
+
...S,
|
|
1730
|
+
template: E,
|
|
1731
|
+
filterValues: yt,
|
|
1732
|
+
inputValues: tt
|
|
1723
1733
|
};
|
|
1724
|
-
await
|
|
1734
|
+
await lt(
|
|
1725
1735
|
s.apiServiceUrl,
|
|
1726
|
-
|
|
1736
|
+
at,
|
|
1727
1737
|
t == null ? void 0 : t.accessToken
|
|
1728
|
-
),
|
|
1738
|
+
), I.success("Lens saved"), je == null || je(i), q(!1);
|
|
1729
1739
|
}
|
|
1730
|
-
const
|
|
1731
|
-
|
|
1732
|
-
title:
|
|
1733
|
-
dashboardStateTitle:
|
|
1734
|
-
dashboardId:
|
|
1735
|
-
currentLensName:
|
|
1740
|
+
const At = (S == null ? void 0 : S.name) || m.title;
|
|
1741
|
+
me.isPending && console.log("Title during update:", {
|
|
1742
|
+
title: At,
|
|
1743
|
+
dashboardStateTitle: m.title,
|
|
1744
|
+
dashboardId: m == null ? void 0 : m.id,
|
|
1745
|
+
currentLensName: S == null ? void 0 : S.name
|
|
1736
1746
|
});
|
|
1737
|
-
const
|
|
1738
|
-
(
|
|
1747
|
+
const $a = ce && !!(t != null && t.accessToken) && !!(s != null && s.apiServiceUrl), za = !l && ae.showDashboardHub && $a, _a = !l && d && ae.showDashboardHub, z = (m == null ? void 0 : m.id) || null, Pt = Ur(
|
|
1748
|
+
(Bt = s.config) == null ? void 0 : Bt.showBriefings,
|
|
1739
1749
|
a
|
|
1740
|
-
),
|
|
1741
|
-
|
|
1742
|
-
dashboardId:
|
|
1750
|
+
), fe = !!z && ka === z, qa = () => {
|
|
1751
|
+
!z || l || Sa({
|
|
1752
|
+
dashboardId: fe ? null : z
|
|
1743
1753
|
});
|
|
1744
1754
|
};
|
|
1745
|
-
return !
|
|
1755
|
+
return !d && !A ? null : /* @__PURE__ */ n(
|
|
1746
1756
|
"div",
|
|
1747
1757
|
{
|
|
1748
1758
|
className: "flex h-11 shrink-0 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-2",
|
|
1749
1759
|
role: "dashboard-controls",
|
|
1750
1760
|
children: [
|
|
1751
1761
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1752
|
-
|
|
1753
|
-
|
|
1762
|
+
_a && !A && /* @__PURE__ */ e(
|
|
1763
|
+
qt,
|
|
1754
1764
|
{
|
|
1755
1765
|
"aria-label": "Dashboard Hub",
|
|
1756
1766
|
tooltip: "Dashboard Hub",
|
|
1757
|
-
onClick:
|
|
1767
|
+
onClick: Ga,
|
|
1758
1768
|
className: "h-7 w-7 px-0",
|
|
1759
1769
|
buttonProps: { size: "xs" },
|
|
1760
|
-
children: /* @__PURE__ */ e(
|
|
1770
|
+
children: /* @__PURE__ */ e(ia, { className: "h-3.5 w-3.5" })
|
|
1761
1771
|
}
|
|
1762
1772
|
),
|
|
1763
|
-
!
|
|
1773
|
+
!A && d && (u ? /* @__PURE__ */ e(
|
|
1764
1774
|
"div",
|
|
1765
1775
|
{
|
|
1766
1776
|
className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
|
|
@@ -1768,32 +1778,32 @@ function Sn() {
|
|
|
1768
1778
|
role: "status",
|
|
1769
1779
|
children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Loading dashboard title" })
|
|
1770
1780
|
}
|
|
1771
|
-
) : /* @__PURE__ */ n(
|
|
1781
|
+
) : /* @__PURE__ */ n(G, { children: [
|
|
1772
1782
|
/* @__PURE__ */ e(
|
|
1773
|
-
|
|
1783
|
+
Rr,
|
|
1774
1784
|
{
|
|
1775
|
-
value:
|
|
1785
|
+
value: At || "Untitled Dashboard",
|
|
1776
1786
|
onSave: (i) => {
|
|
1777
1787
|
console.log("EditableText onSave called:", {
|
|
1778
1788
|
newTitle: i,
|
|
1779
|
-
canEditDashboard:
|
|
1780
|
-
dashboardId:
|
|
1789
|
+
canEditDashboard: Me,
|
|
1790
|
+
dashboardId: m == null ? void 0 : m.id
|
|
1781
1791
|
});
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1792
|
+
const E = (m == null ? void 0 : m.title) || "";
|
|
1793
|
+
ee(i), Pa(i, E);
|
|
1784
1794
|
},
|
|
1785
|
-
isEditable:
|
|
1786
|
-
isDashboardEditing:
|
|
1787
|
-
canEditDashboard:
|
|
1788
|
-
hasCurrentLens: !!
|
|
1795
|
+
isEditable: Vr({
|
|
1796
|
+
isDashboardEditing: k,
|
|
1797
|
+
canEditDashboard: Me === !0 && !l,
|
|
1798
|
+
hasCurrentLens: !!S
|
|
1789
1799
|
}),
|
|
1790
1800
|
displayClassName: "text-[13px] font-medium",
|
|
1791
1801
|
inputClassName: "text-[13px] font-medium",
|
|
1792
1802
|
placeholder: "Dashboard Title",
|
|
1793
|
-
isPending:
|
|
1803
|
+
isPending: me.isPending
|
|
1794
1804
|
}
|
|
1795
1805
|
),
|
|
1796
|
-
|
|
1806
|
+
ae.showDashboardHub && fe && /* @__PURE__ */ e(
|
|
1797
1807
|
"span",
|
|
1798
1808
|
{
|
|
1799
1809
|
className: "shrink-0 rounded-[4px] border border-border/60 px-1.5 py-px text-[10px] font-medium uppercase tracking-[0.06em] text-muted-foreground",
|
|
@@ -1801,62 +1811,62 @@ function Sn() {
|
|
|
1801
1811
|
children: "Default"
|
|
1802
1812
|
}
|
|
1803
1813
|
),
|
|
1804
|
-
|
|
1805
|
-
/* @__PURE__ */ e(
|
|
1806
|
-
|
|
1814
|
+
za && z && /* @__PURE__ */ e(Ya, { children: /* @__PURE__ */ n(Xa, { children: [
|
|
1815
|
+
/* @__PURE__ */ e(Za, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1816
|
+
R,
|
|
1807
1817
|
{
|
|
1808
1818
|
variant: "ghost",
|
|
1809
1819
|
size: "xs",
|
|
1810
|
-
onClick:
|
|
1811
|
-
disabled:
|
|
1820
|
+
onClick: qa,
|
|
1821
|
+
disabled: Ia || !(t != null && t.accessToken) || !(s != null && s.apiServiceUrl),
|
|
1812
1822
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
1813
|
-
"aria-label":
|
|
1814
|
-
children:
|
|
1823
|
+
"aria-label": fe ? "Clear default dashboard" : "Set as default dashboard",
|
|
1824
|
+
children: fe ? /* @__PURE__ */ e(Fr, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(Or, { className: "h-3.5 w-3.5" })
|
|
1815
1825
|
}
|
|
1816
1826
|
) }),
|
|
1817
|
-
/* @__PURE__ */ e(
|
|
1827
|
+
/* @__PURE__ */ e(er, { children: /* @__PURE__ */ e("p", { children: fe ? "Clear default" : "Set as default" }) })
|
|
1818
1828
|
] }) })
|
|
1819
1829
|
] }))
|
|
1820
1830
|
] }),
|
|
1821
1831
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1822
|
-
|
|
1823
|
-
/* @__PURE__ */ e(
|
|
1824
|
-
/* @__PURE__ */ e(
|
|
1832
|
+
A && /* @__PURE__ */ n(G, { children: [
|
|
1833
|
+
/* @__PURE__ */ e(is, {}),
|
|
1834
|
+
/* @__PURE__ */ e(ds, {})
|
|
1825
1835
|
] }),
|
|
1826
|
-
!
|
|
1827
|
-
|
|
1836
|
+
!A && d && !l && ae.showDashboardSharing && /* @__PURE__ */ n(
|
|
1837
|
+
R,
|
|
1828
1838
|
{
|
|
1829
1839
|
variant: "outline",
|
|
1830
1840
|
size: "xs",
|
|
1831
|
-
onClick: () =>
|
|
1841
|
+
onClick: () => j(!0),
|
|
1832
1842
|
children: [
|
|
1833
|
-
/* @__PURE__ */ e(
|
|
1843
|
+
/* @__PURE__ */ e(Tr, { className: "h-3.5 w-3.5" }),
|
|
1834
1844
|
"Share"
|
|
1835
1845
|
]
|
|
1836
1846
|
}
|
|
1837
1847
|
),
|
|
1838
|
-
!
|
|
1839
|
-
|
|
1840
|
-
|
|
1848
|
+
!A && k && !l && x.canUseFilters && d && /* @__PURE__ */ e(ls, {}),
|
|
1849
|
+
k && !A && !l && he && S && c && d && /* @__PURE__ */ n(
|
|
1850
|
+
R,
|
|
1841
1851
|
{
|
|
1842
1852
|
variant: "secondary",
|
|
1843
1853
|
size: "xs",
|
|
1844
|
-
disabled:
|
|
1845
|
-
onClick:
|
|
1854
|
+
disabled: _e,
|
|
1855
|
+
onClick: Ba,
|
|
1846
1856
|
children: [
|
|
1847
|
-
/* @__PURE__ */ e(
|
|
1857
|
+
/* @__PURE__ */ e(Yt, { className: "h-3.5 w-3.5" }),
|
|
1848
1858
|
"Save Lens"
|
|
1849
1859
|
]
|
|
1850
1860
|
}
|
|
1851
1861
|
),
|
|
1852
|
-
|
|
1862
|
+
k && !A && !l && d && !w && /* @__PURE__ */ n("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
|
|
1853
1863
|
/* @__PURE__ */ n(
|
|
1854
|
-
|
|
1864
|
+
R,
|
|
1855
1865
|
{
|
|
1856
1866
|
variant: "ghost",
|
|
1857
1867
|
size: "xs",
|
|
1858
|
-
disabled: !
|
|
1859
|
-
onClick: () => void
|
|
1868
|
+
disabled: !k,
|
|
1869
|
+
onClick: () => void La(),
|
|
1860
1870
|
className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
|
|
1861
1871
|
children: [
|
|
1862
1872
|
/* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
|
|
@@ -1864,24 +1874,24 @@ function Sn() {
|
|
|
1864
1874
|
]
|
|
1865
1875
|
}
|
|
1866
1876
|
),
|
|
1867
|
-
/* @__PURE__ */ n(
|
|
1868
|
-
/* @__PURE__ */ e(
|
|
1869
|
-
|
|
1877
|
+
/* @__PURE__ */ n(Ht, { modal: !1, children: [
|
|
1878
|
+
/* @__PURE__ */ e(jt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1879
|
+
R,
|
|
1870
1880
|
{
|
|
1871
1881
|
variant: "ghost",
|
|
1872
1882
|
size: "xs",
|
|
1873
1883
|
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
|
|
1874
1884
|
"aria-label": "Open visual options",
|
|
1875
|
-
disabled: !
|
|
1876
|
-
children: /* @__PURE__ */ e(
|
|
1885
|
+
disabled: !k,
|
|
1886
|
+
children: /* @__PURE__ */ e(ts, { className: "h-3.5 w-3.5" })
|
|
1877
1887
|
}
|
|
1878
1888
|
) }),
|
|
1879
1889
|
/* @__PURE__ */ e(
|
|
1880
|
-
|
|
1890
|
+
Kt,
|
|
1881
1891
|
{
|
|
1882
1892
|
align: "end",
|
|
1883
1893
|
className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
1884
|
-
children: /* @__PURE__ */ n(
|
|
1894
|
+
children: /* @__PURE__ */ n(T, { onClick: () => vt(!0), children: [
|
|
1885
1895
|
/* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
|
|
1886
1896
|
"From library..."
|
|
1887
1897
|
] })
|
|
@@ -1889,52 +1899,52 @@ function Sn() {
|
|
|
1889
1899
|
)
|
|
1890
1900
|
] }),
|
|
1891
1901
|
/* @__PURE__ */ e(
|
|
1892
|
-
|
|
1902
|
+
cs,
|
|
1893
1903
|
{
|
|
1894
|
-
open:
|
|
1895
|
-
onOpenChange:
|
|
1904
|
+
open: Ca,
|
|
1905
|
+
onOpenChange: vt
|
|
1896
1906
|
}
|
|
1897
1907
|
)
|
|
1898
1908
|
] }),
|
|
1899
|
-
!
|
|
1900
|
-
/* @__PURE__ */ e(
|
|
1901
|
-
"Edit"
|
|
1909
|
+
!A && !k && (Me || l) && d && /* @__PURE__ */ n(R, { size: "xs", onClick: Ua, children: [
|
|
1910
|
+
/* @__PURE__ */ e(Gr, { className: "h-3.5 w-3.5" }),
|
|
1911
|
+
l ? "Inspect" : "Edit"
|
|
1902
1912
|
] }),
|
|
1903
|
-
|
|
1904
|
-
|
|
1913
|
+
St && d && Mt && /* @__PURE__ */ n(
|
|
1914
|
+
R,
|
|
1905
1915
|
{
|
|
1906
1916
|
variant: "outline",
|
|
1907
1917
|
size: "xs",
|
|
1908
|
-
onClick:
|
|
1909
|
-
disabled:
|
|
1918
|
+
onClick: Ta,
|
|
1919
|
+
disabled: Re,
|
|
1910
1920
|
children: [
|
|
1911
|
-
/* @__PURE__ */ e(
|
|
1921
|
+
/* @__PURE__ */ e(Br, { className: "h-3.5 w-3.5" }),
|
|
1912
1922
|
"Undo"
|
|
1913
1923
|
]
|
|
1914
1924
|
}
|
|
1915
1925
|
),
|
|
1916
|
-
|
|
1917
|
-
|
|
1926
|
+
St && d && /* @__PURE__ */ n(
|
|
1927
|
+
R,
|
|
1918
1928
|
{
|
|
1919
1929
|
size: "xs",
|
|
1920
|
-
className:
|
|
1921
|
-
disabled:
|
|
1922
|
-
onClick: () =>
|
|
1930
|
+
className: ve(!Lt && "opacity-60"),
|
|
1931
|
+
disabled: Re || !Lt,
|
|
1932
|
+
onClick: () => et(),
|
|
1923
1933
|
children: [
|
|
1924
|
-
|
|
1925
|
-
|
|
1934
|
+
Re ? /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Yt, { className: "h-3.5 w-3.5" }),
|
|
1935
|
+
Re ? "Saving..." : "Save"
|
|
1926
1936
|
]
|
|
1927
1937
|
}
|
|
1928
1938
|
),
|
|
1929
|
-
|
|
1930
|
-
/* @__PURE__ */ e(
|
|
1939
|
+
k && !A && d && /* @__PURE__ */ n(R, { variant: "outline", size: "xs", onClick: Va, children: [
|
|
1940
|
+
/* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" }),
|
|
1931
1941
|
"Close"
|
|
1932
1942
|
] }),
|
|
1933
|
-
!
|
|
1934
|
-
!
|
|
1935
|
-
!
|
|
1936
|
-
/* @__PURE__ */ e(
|
|
1937
|
-
|
|
1943
|
+
!A && d && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(us, {}) }),
|
|
1944
|
+
!A && c && /* @__PURE__ */ e(Ss, {}),
|
|
1945
|
+
!A && d && !l && /* @__PURE__ */ n(Ht, { children: [
|
|
1946
|
+
/* @__PURE__ */ e(jt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1947
|
+
qt,
|
|
1938
1948
|
{
|
|
1939
1949
|
tooltip: "More Options",
|
|
1940
1950
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
@@ -1943,240 +1953,240 @@ function Sn() {
|
|
|
1943
1953
|
variant: "ghost",
|
|
1944
1954
|
"aria-label": "More dashboard options"
|
|
1945
1955
|
},
|
|
1946
|
-
children: /* @__PURE__ */ e(
|
|
1956
|
+
children: /* @__PURE__ */ e($r, { className: "h-3.5 w-3.5" })
|
|
1947
1957
|
}
|
|
1948
1958
|
) }),
|
|
1949
1959
|
/* @__PURE__ */ n(
|
|
1950
|
-
|
|
1960
|
+
Kt,
|
|
1951
1961
|
{
|
|
1952
1962
|
align: "end",
|
|
1953
1963
|
className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
|
|
1954
1964
|
children: [
|
|
1955
|
-
/* @__PURE__ */ e(
|
|
1965
|
+
/* @__PURE__ */ e(xe, { children: "Reports & briefings" }),
|
|
1956
1966
|
/* @__PURE__ */ n(
|
|
1957
|
-
|
|
1967
|
+
T,
|
|
1958
1968
|
{
|
|
1959
|
-
disabled:
|
|
1960
|
-
onSelect: () =>
|
|
1969
|
+
disabled: p,
|
|
1970
|
+
onSelect: () => K(!0),
|
|
1961
1971
|
children: [
|
|
1962
|
-
/* @__PURE__ */ e(
|
|
1972
|
+
/* @__PURE__ */ e(zr, { className: "h-3.5 w-3.5" }),
|
|
1963
1973
|
"Export"
|
|
1964
1974
|
]
|
|
1965
1975
|
}
|
|
1966
1976
|
),
|
|
1967
1977
|
/* @__PURE__ */ e(
|
|
1968
|
-
|
|
1978
|
+
on,
|
|
1969
1979
|
{
|
|
1970
|
-
scheduleReportVisible: !!(
|
|
1971
|
-
analyticalBriefingVisible: !!(
|
|
1972
|
-
onScheduleReport: () =>
|
|
1973
|
-
onCreateAnalyticalBriefing: () =>
|
|
1980
|
+
scheduleReportVisible: !!(Pt && o.surfaceVisible && z && !k),
|
|
1981
|
+
analyticalBriefingVisible: !!(Pt && o.surfaceVisible && z && !k),
|
|
1982
|
+
onScheduleReport: () => te("scheduled_report"),
|
|
1983
|
+
onCreateAnalyticalBriefing: () => te("analytical_briefing")
|
|
1974
1984
|
}
|
|
1975
1985
|
),
|
|
1976
|
-
/* @__PURE__ */ e(
|
|
1977
|
-
|
|
1978
|
-
/* @__PURE__ */ e(
|
|
1986
|
+
/* @__PURE__ */ e(Be, {}),
|
|
1987
|
+
ae.showGroupManagement && /* @__PURE__ */ n(G, { children: [
|
|
1988
|
+
/* @__PURE__ */ e(xe, { children: "Access" }),
|
|
1979
1989
|
/* @__PURE__ */ n(
|
|
1980
|
-
|
|
1990
|
+
T,
|
|
1981
1991
|
{
|
|
1982
|
-
onClick: () =>
|
|
1992
|
+
onClick: () => ne(!0),
|
|
1983
1993
|
children: [
|
|
1984
|
-
/* @__PURE__ */ e(
|
|
1994
|
+
/* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" }),
|
|
1985
1995
|
"Manage Groups"
|
|
1986
1996
|
]
|
|
1987
1997
|
}
|
|
1988
1998
|
),
|
|
1989
|
-
/* @__PURE__ */ e(
|
|
1999
|
+
/* @__PURE__ */ e(Be, {})
|
|
1990
2000
|
] }),
|
|
1991
|
-
/* @__PURE__ */ e(
|
|
1992
|
-
/* @__PURE__ */ n(
|
|
1993
|
-
/* @__PURE__ */ e(
|
|
2001
|
+
/* @__PURE__ */ e(xe, { children: "Preferences" }),
|
|
2002
|
+
/* @__PURE__ */ n(T, { onClick: () => oe(!0), children: [
|
|
2003
|
+
/* @__PURE__ */ e(ua, { className: "h-3.5 w-3.5" }),
|
|
1994
2004
|
"Report preferences"
|
|
1995
2005
|
] }),
|
|
1996
|
-
|
|
1997
|
-
/* @__PURE__ */ e(
|
|
1998
|
-
/* @__PURE__ */ e(
|
|
2006
|
+
c && d && /* @__PURE__ */ n(G, { children: [
|
|
2007
|
+
/* @__PURE__ */ e(Be, {}),
|
|
2008
|
+
/* @__PURE__ */ e(xe, { children: "Developer" }),
|
|
1999
2009
|
/* @__PURE__ */ n(
|
|
2000
|
-
|
|
2010
|
+
T,
|
|
2001
2011
|
{
|
|
2002
2012
|
onSelect: () => {
|
|
2003
2013
|
var i;
|
|
2004
2014
|
t != null && t.accessToken && ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(t.accessToken).then(
|
|
2005
|
-
() =>
|
|
2006
|
-
).catch(() =>
|
|
2015
|
+
() => I.success("Token copied to clipboard")
|
|
2016
|
+
).catch(() => I.error("Unable to copy token")) : I.error("Clipboard not available"));
|
|
2007
2017
|
},
|
|
2008
2018
|
children: [
|
|
2009
|
-
/* @__PURE__ */ e(
|
|
2019
|
+
/* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
|
|
2010
2020
|
"Copy token"
|
|
2011
2021
|
]
|
|
2012
2022
|
}
|
|
2013
2023
|
),
|
|
2014
|
-
|
|
2015
|
-
|
|
2024
|
+
w && /* @__PURE__ */ n(
|
|
2025
|
+
T,
|
|
2016
2026
|
{
|
|
2017
|
-
disabled: !
|
|
2027
|
+
disabled: !Xe,
|
|
2018
2028
|
onSelect: () => {
|
|
2019
2029
|
var i;
|
|
2020
|
-
if (!
|
|
2021
|
-
|
|
2030
|
+
if (!Xe) {
|
|
2031
|
+
I.error(
|
|
2022
2032
|
"Open a document sheet with a token to copy the local PDF URL"
|
|
2023
2033
|
);
|
|
2024
2034
|
return;
|
|
2025
2035
|
}
|
|
2026
|
-
(i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(
|
|
2027
|
-
() =>
|
|
2036
|
+
(i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(Xe).then(
|
|
2037
|
+
() => I.success(
|
|
2028
2038
|
"Local document PDF URL copied to clipboard"
|
|
2029
2039
|
)
|
|
2030
2040
|
).catch(
|
|
2031
|
-
() =>
|
|
2041
|
+
() => I.error(
|
|
2032
2042
|
"Unable to copy local document PDF URL"
|
|
2033
2043
|
)
|
|
2034
|
-
) :
|
|
2044
|
+
) : I.error("Clipboard not available");
|
|
2035
2045
|
},
|
|
2036
2046
|
children: [
|
|
2037
|
-
/* @__PURE__ */ e(
|
|
2047
|
+
/* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
|
|
2038
2048
|
"Copy local document PDF URL"
|
|
2039
2049
|
]
|
|
2040
2050
|
}
|
|
2041
2051
|
),
|
|
2042
2052
|
/* @__PURE__ */ n(
|
|
2043
|
-
|
|
2053
|
+
T,
|
|
2044
2054
|
{
|
|
2045
|
-
onSelect: () =>
|
|
2055
|
+
onSelect: () => tr(s.apiServiceUrl),
|
|
2046
2056
|
children: [
|
|
2047
|
-
/* @__PURE__ */ e(
|
|
2057
|
+
/* @__PURE__ */ e(Ds, { className: "h-3.5 w-3.5" }),
|
|
2048
2058
|
"Invalidate token"
|
|
2049
2059
|
]
|
|
2050
2060
|
}
|
|
2051
2061
|
),
|
|
2052
|
-
/* @__PURE__ */ n(
|
|
2053
|
-
/* @__PURE__ */ e(
|
|
2062
|
+
/* @__PURE__ */ n(T, { onSelect: b, children: [
|
|
2063
|
+
/* @__PURE__ */ e(xs, { className: "h-3.5 w-3.5" }),
|
|
2054
2064
|
"Brand Studio"
|
|
2055
2065
|
] }),
|
|
2056
|
-
|
|
2057
|
-
|
|
2066
|
+
k && /* @__PURE__ */ n(
|
|
2067
|
+
T,
|
|
2058
2068
|
{
|
|
2059
|
-
onSelect: () =>
|
|
2069
|
+
onSelect: () => Dt(!wt),
|
|
2060
2070
|
children: [
|
|
2061
|
-
/* @__PURE__ */ e(
|
|
2062
|
-
|
|
2071
|
+
/* @__PURE__ */ e(vs, { className: "h-3.5 w-3.5" }),
|
|
2072
|
+
wt ? "Hide dashboard JSON" : "Show dashboard JSON"
|
|
2063
2073
|
]
|
|
2064
2074
|
}
|
|
2065
2075
|
),
|
|
2066
|
-
|
|
2076
|
+
he && k && /* @__PURE__ */ n(T, { onSelect: () => ke(!0), children: [
|
|
2067
2077
|
/* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
|
|
2068
2078
|
"Add lens"
|
|
2069
2079
|
] }),
|
|
2070
|
-
|
|
2071
|
-
/* @__PURE__ */ n(
|
|
2072
|
-
/* @__PURE__ */ e(
|
|
2080
|
+
he && /* @__PURE__ */ n(_r, { children: [
|
|
2081
|
+
/* @__PURE__ */ n(qr, { children: [
|
|
2082
|
+
/* @__PURE__ */ e(ys, { className: "h-3.5 w-3.5" }),
|
|
2073
2083
|
"Lenses"
|
|
2074
2084
|
] }),
|
|
2075
|
-
/* @__PURE__ */ e(
|
|
2085
|
+
/* @__PURE__ */ e(Hr, { className: "w-60", children: /* @__PURE__ */ e(As, {}) })
|
|
2076
2086
|
] })
|
|
2077
2087
|
] })
|
|
2078
2088
|
]
|
|
2079
2089
|
}
|
|
2080
2090
|
)
|
|
2081
2091
|
] }),
|
|
2082
|
-
|
|
2083
|
-
|
|
2092
|
+
re && kt && /* @__PURE__ */ e(
|
|
2093
|
+
jr,
|
|
2084
2094
|
{
|
|
2085
|
-
resource:
|
|
2086
|
-
resourceType:
|
|
2087
|
-
onClose: () =>
|
|
2095
|
+
resource: kt,
|
|
2096
|
+
resourceType: st.DASHBOARD,
|
|
2097
|
+
onClose: () => j(!1)
|
|
2088
2098
|
}
|
|
2089
2099
|
),
|
|
2090
|
-
|
|
2091
|
-
|
|
2100
|
+
ae.showGroupManagement && /* @__PURE__ */ e(
|
|
2101
|
+
Ys,
|
|
2092
2102
|
{
|
|
2093
|
-
open:
|
|
2094
|
-
onOpenChange:
|
|
2103
|
+
open: se,
|
|
2104
|
+
onOpenChange: ne
|
|
2095
2105
|
}
|
|
2096
2106
|
),
|
|
2097
2107
|
/* @__PURE__ */ e(
|
|
2098
|
-
|
|
2108
|
+
gs,
|
|
2099
2109
|
{
|
|
2100
|
-
open:
|
|
2101
|
-
onOpenChange:
|
|
2110
|
+
open: qe,
|
|
2111
|
+
onOpenChange: oe
|
|
2102
2112
|
}
|
|
2103
2113
|
),
|
|
2104
|
-
|
|
2105
|
-
|
|
2114
|
+
z && De ? /* @__PURE__ */ e(
|
|
2115
|
+
ms,
|
|
2106
2116
|
{
|
|
2107
|
-
dashboardId:
|
|
2108
|
-
dashboardTitle: (
|
|
2117
|
+
dashboardId: z,
|
|
2118
|
+
dashboardTitle: (m == null ? void 0 : m.title) || ($ == null ? void 0 : $.title),
|
|
2109
2119
|
open: !0,
|
|
2110
2120
|
onOpenChange: (i) => {
|
|
2111
|
-
i ||
|
|
2121
|
+
i || te(null);
|
|
2112
2122
|
},
|
|
2113
2123
|
hideTrigger: !0,
|
|
2114
|
-
workflowIntent:
|
|
2124
|
+
workflowIntent: De
|
|
2115
2125
|
}
|
|
2116
2126
|
) : null,
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2127
|
+
c && he && d && /* @__PURE__ */ e(Ls, { open: Ce, onOpenChange: ke }),
|
|
2128
|
+
d && /* @__PURE__ */ e(
|
|
2129
|
+
Kr,
|
|
2120
2130
|
{
|
|
2121
|
-
open:
|
|
2122
|
-
onOpenChange:
|
|
2131
|
+
open: He,
|
|
2132
|
+
onOpenChange: K
|
|
2123
2133
|
}
|
|
2124
2134
|
),
|
|
2125
2135
|
/* @__PURE__ */ e(
|
|
2126
|
-
|
|
2136
|
+
Qr,
|
|
2127
2137
|
{
|
|
2128
|
-
open:
|
|
2138
|
+
open: f,
|
|
2129
2139
|
onOpenChange: (i) => {
|
|
2130
|
-
!i &&
|
|
2140
|
+
!i && We && !Q || (F(i), i || (W(null), J([]), Se(!1)));
|
|
2131
2141
|
},
|
|
2132
|
-
children: /* @__PURE__ */ n(
|
|
2133
|
-
/* @__PURE__ */ n(
|
|
2134
|
-
/* @__PURE__ */ e(
|
|
2135
|
-
/* @__PURE__ */ e(
|
|
2136
|
-
|
|
2142
|
+
children: /* @__PURE__ */ n(Wr, { className: "max-w-sm", children: [
|
|
2143
|
+
/* @__PURE__ */ n(Jr, { children: [
|
|
2144
|
+
/* @__PURE__ */ e(Yr, { children: Q ? "Save failed" : "Saving dashboard" }),
|
|
2145
|
+
/* @__PURE__ */ e(Xr, { className: "pt-2", children: Q ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
2146
|
+
ie.length > 0 && /* @__PURE__ */ n("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
2137
2147
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
2138
|
-
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children:
|
|
2148
|
+
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: ie.slice(0, 5).map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
|
|
2139
2149
|
] })
|
|
2140
2150
|
] }),
|
|
2141
|
-
/* @__PURE__ */ e(
|
|
2151
|
+
/* @__PURE__ */ e(Zr, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: Q ? /* @__PURE__ */ n(G, { children: [
|
|
2142
2152
|
/* @__PURE__ */ e(
|
|
2143
|
-
|
|
2153
|
+
es,
|
|
2144
2154
|
{
|
|
2145
2155
|
onClick: () => {
|
|
2146
|
-
|
|
2156
|
+
F(!1), W(null), J([]), Se(!1);
|
|
2147
2157
|
},
|
|
2148
2158
|
className: "m-0",
|
|
2149
2159
|
children: "Close"
|
|
2150
2160
|
}
|
|
2151
2161
|
),
|
|
2152
2162
|
/* @__PURE__ */ e(
|
|
2153
|
-
|
|
2163
|
+
Wt,
|
|
2154
2164
|
{
|
|
2155
|
-
onClick: () =>
|
|
2156
|
-
closeAfterSave:
|
|
2157
|
-
navigateHomeAfterSave:
|
|
2165
|
+
onClick: () => et({
|
|
2166
|
+
closeAfterSave: de,
|
|
2167
|
+
navigateHomeAfterSave: Ye === "home"
|
|
2158
2168
|
}),
|
|
2159
2169
|
className: "m-0",
|
|
2160
2170
|
children: "Retry"
|
|
2161
2171
|
}
|
|
2162
2172
|
)
|
|
2163
|
-
] }) : /* @__PURE__ */ n(
|
|
2164
|
-
/* @__PURE__ */ e(
|
|
2173
|
+
] }) : /* @__PURE__ */ n(Wt, { disabled: !0, className: "m-0 cursor-default", children: [
|
|
2174
|
+
/* @__PURE__ */ e($e, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2165
2175
|
"Saving..."
|
|
2166
2176
|
] }) })
|
|
2167
2177
|
] })
|
|
2168
2178
|
}
|
|
2169
2179
|
),
|
|
2170
2180
|
/* @__PURE__ */ e(
|
|
2171
|
-
|
|
2181
|
+
hs,
|
|
2172
2182
|
{
|
|
2173
|
-
open:
|
|
2183
|
+
open: Aa,
|
|
2174
2184
|
onOpenChange: (i) => {
|
|
2175
|
-
|
|
2185
|
+
ue(i);
|
|
2176
2186
|
},
|
|
2177
|
-
onSave:
|
|
2178
|
-
onDiscard:
|
|
2179
|
-
isSaving:
|
|
2187
|
+
onSave: Fa,
|
|
2188
|
+
onDiscard: Oa,
|
|
2189
|
+
isSaving: We,
|
|
2180
2190
|
saveLabel: "Save",
|
|
2181
2191
|
discardLabel: "Discard"
|
|
2182
2192
|
}
|
|
@@ -2186,21 +2196,21 @@ function Sn() {
|
|
|
2186
2196
|
}
|
|
2187
2197
|
);
|
|
2188
2198
|
}
|
|
2189
|
-
function
|
|
2199
|
+
function dn({
|
|
2190
2200
|
accessToken: t,
|
|
2191
2201
|
dashboardId: s,
|
|
2192
2202
|
selectedSheetId: r,
|
|
2193
2203
|
pageSize: a,
|
|
2194
2204
|
orientation: o,
|
|
2195
|
-
theme:
|
|
2205
|
+
theme: c
|
|
2196
2206
|
}) {
|
|
2197
2207
|
if (!t || !r)
|
|
2198
2208
|
return null;
|
|
2199
|
-
const
|
|
2200
|
-
|
|
2201
|
-
const
|
|
2202
|
-
return
|
|
2209
|
+
const h = new URL("http://localhost:5173/print-document");
|
|
2210
|
+
h.searchParams.set("token", t), s && h.searchParams.set("dashboardId", s), h.searchParams.set("selectedSheetId", r), c && h.searchParams.set("theme", c);
|
|
2211
|
+
const l = new URL("http://127.0.0.1:3002/");
|
|
2212
|
+
return l.searchParams.set("pdfMode", "document"), l.searchParams.set("pageSize", a || "letter"), l.searchParams.set("orientation", o || "portrait"), l.searchParams.set("url", h.toString()), l.toString();
|
|
2203
2213
|
}
|
|
2204
2214
|
export {
|
|
2205
|
-
|
|
2215
|
+
En as default
|
|
2206
2216
|
};
|