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