react-semaphor 0.1.543 → 0.1.544
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/activity/index.js +73 -0
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +51 -50
- package/dist/chunks/{apply-dashboard-operations-CG9S7MGt.js → apply-dashboard-operations-Bz4n1Lq6.js} +44 -44
- package/dist/chunks/{assistant-chat-BFMRUYoB.js → assistant-chat-BNLkCDml.js} +288 -288
- package/dist/chunks/{comparison-window-caption-Bv18samq.js → comparison-window-caption-BTkrN3W4.js} +467 -462
- package/dist/chunks/dashboard-briefing-launcher-DQ_8O_e2.js +3725 -0
- package/dist/chunks/{dashboard-controls-UGpjOM2k.js → dashboard-controls-8RyBTQUO.js} +530 -525
- package/dist/chunks/dashboard-g5a4DKWq.js +14 -0
- package/dist/chunks/{dashboard-json-DG8dz0eX.js → dashboard-json-7qT9jmfL.js} +1 -1
- package/dist/chunks/{document-dashboard-inputs-OwqCbrVp.js → document-dashboard-inputs-BC6p-ESg.js} +4 -4
- package/dist/chunks/{document-sheet-utils-BTb3VZxV.js → document-sheet-utils-Duo9uLoH.js} +11 -11
- package/dist/chunks/{edit-dashboard-visual-CDpA4y5e.js → edit-dashboard-visual-BfJwnRIZ.js} +249 -248
- package/dist/chunks/export-file-format-C-tJsxsf.js +111 -0
- package/dist/chunks/{index-l5LclZvs.js → index-DkAyQvC6.js} +59 -58
- package/dist/chunks/{matrix-formatter-BnsTX90d.js → matrix-formatter-CxJLkztA.js} +1 -1
- package/dist/chunks/{numeric-presentation-F_-H6VAw.js → numeric-presentation-DESvLiu9.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-DupbRk-R.js → pivot-result-lifecycle-DM4CyGKs.js} +285 -393
- package/dist/chunks/{raw-temporal-presentation-D-azM_98.js → raw-temporal-presentation-CLiVi90c.js} +2 -2
- package/dist/chunks/{report-preferences-dialog-CPwRwEJx.js → report-preferences-dialog-Df7VpRVW.js} +195 -195
- package/dist/chunks/{saved-dashboard-context-BKvMfRfC.js → saved-dashboard-context-B-mQ--nV.js} +3 -3
- package/dist/chunks/{semaphor-ready-indicator-CN2AHm2x.js → semaphor-ready-indicator-DDAxk8us.js} +39892 -39380
- package/dist/chunks/{shelf-drop-preview-context-BGl_rxcW.js → shelf-drop-preview-context-BSRPwaED.js} +414 -371
- package/dist/chunks/{table-export-sheet-BDRXLLdq.js → table-export-sheet-CPfGAQ9X.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BnclfB2k.js → use-create-flow-overlay-state-BxzFviM-.js} +67 -78
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +72 -72
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +226 -223
- package/dist/index.js +266 -271
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/activity.d.ts +2 -0
- package/dist/types/components/activity/activity-bell.d.ts +11 -0
- package/dist/types/components/activity/activity-instance.d.ts +50 -0
- package/dist/types/components/activity/activity-notices.d.ts +7 -0
- package/dist/types/components/activity/activity-provider.d.ts +21 -0
- package/dist/types/components/activity/activity-types.d.ts +177 -0
- package/dist/types/components/activity/index.d.ts +6 -0
- package/dist/types/components/activity/use-activity.d.ts +20 -0
- package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
- package/dist/types/components/briefings/briefing-author.d.ts +14 -12
- package/dist/types/components/briefings/dashboard-briefing-launcher.d.ts +5 -0
- package/dist/types/components/briefings/use-briefing-run-detail.d.ts +34 -0
- package/dist/types/components/index.d.ts +1 -4
- package/dist/types/lib/activity-identity.d.ts +21 -0
- package/dist/types/lib/api/exports-api.d.ts +4 -4
- package/dist/types/lib/hooks/index.d.ts +1 -3
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
- package/dist/types/shared/activity/activity-contract.d.ts +84 -0
- package/dist/types/shared/activity/index.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +6 -0
- package/dist/types/shared/format-utils/export-policy.d.ts +12 -0
- package/package.json +5 -1
- package/dist/chunks/dashboard-B9mKTJoy.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-Bdmry_oG.js +0 -4248
- package/dist/types/components/briefings/briefing-author/run-ui.d.ts +0 -81
- package/dist/types/components/briefings/use-briefing-run-polling.d.ts +0 -34
- package/dist/types/components/notifications/export-notification-item.d.ts +0 -24
- package/dist/types/components/notifications/export-notification-list.d.ts +0 -8
- package/dist/types/components/notifications/index.d.ts +0 -3
- package/dist/types/components/notifications/notification-bell.d.ts +0 -13
- package/dist/types/lib/exports/bounded-request.d.ts +0 -12
- package/dist/types/lib/hooks/use-export-polling.d.ts +0 -32
- package/dist/types/lib/hooks/use-export-recovery.d.ts +0 -11
- package/dist/types/lib/stores/export-store.d.ts +0 -62
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { jsx as t, jsxs as i, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
-
import { bz as
|
|
3
|
-
import { B as
|
|
4
|
-
import { c as te, X as
|
|
2
|
+
import { bz as jr, u as C, bA as Hr, bB as nt, bC as qr, bD as zr, bE as Kr, bF as Qr, bG as Wr, bH as Yr, aX as K, aV as ve, bI as ye, bJ as Jr, bu as Ht, bv as qt, bx as Ze, by as et, bK as zt, aH as ot, aQ as ee, bL as Xr, bM as Zr, bN as Kt, bO as ea, bP as Qt, bw as ta, bQ as ra, bR as P, bS as aa, bT as na, bU as oa, as as sa, b6 as ia, bV as da, bW as ca, bX as la, g as ua, L as ma, Y as kt, f as Oe, m as ha, h as We, bY as pa, bZ as fa, b_ as ba, b$ as ga, J as xa, c0 as va, s as ya, c1 as wa, c2 as Na, b8 as Sa, c3 as ka, c4 as Ca, c5 as Ct, c6 as Dt, c7 as Et, c8 as Da, c9 as Ea, ca as Ia, cb as Aa, cc as _e, cd as La, ce as Ma, cf as Ye, cg as Oa, ch as It, l as _a, ci as Pa, cj as Ra, ck as Ta, cl as Ua, cm as $a, cn as Ba, co as Fa, cp as Ga, cq as At } from "./semaphor-ready-indicator-DDAxk8us.js";
|
|
3
|
+
import { B as U, Z as Va, _ as ja, $ as tt, L as Re, l as Ha, r as qa, s as za, t as Ka, u as Qa, v as Wa, P as Ya, a as Ja, b as Xa, m as Lt, n as Mt, o as Ot, p as _t, I as Za } from "./switch-C3jLxlG0.js";
|
|
4
|
+
import { c as te, X as Wt, C as en } from "./x-4f5U2XwU.js";
|
|
5
5
|
import * as I from "react";
|
|
6
|
-
import
|
|
7
|
-
import { ae as D } from "./numeric-presentation-
|
|
6
|
+
import Yt, { useMemo as V, useState as S, useEffect as ge, useRef as Pt, useLayoutEffect as tn } from "react";
|
|
7
|
+
import { ae as D } from "./numeric-presentation-DESvLiu9.js";
|
|
8
8
|
import "./index-CuHybtft.js";
|
|
9
9
|
import "./validators-DMHTpf7a.js";
|
|
10
10
|
import "./matrix-operation-contract-8OIO4gob.js";
|
|
11
11
|
import "./analytics-base-schemas-BFAoRlkU.js";
|
|
12
12
|
import "zod";
|
|
13
13
|
import "../value-format-preferences/index.js";
|
|
14
|
-
import { c as
|
|
15
|
-
import {
|
|
16
|
-
import { I as
|
|
17
|
-
import { h as
|
|
18
|
-
import { createPortal as
|
|
19
|
-
import { a7 as
|
|
20
|
-
import { S as
|
|
21
|
-
import { o as
|
|
22
|
-
import { Z as
|
|
23
|
-
import { r as
|
|
24
|
-
import { u as
|
|
25
|
-
import { s as
|
|
26
|
-
import { B as
|
|
27
|
-
import { S as
|
|
28
|
-
import { P as
|
|
29
|
-
import { B as
|
|
14
|
+
import { c as xe } from "./class-utils-Df1OVOT1.js";
|
|
15
|
+
import { u as rn, A as an, a as nn, e as on, V as sn, b as dn, i as cn, f as ln, U as un } from "./dashboard-briefing-launcher-DQ_8O_e2.js";
|
|
16
|
+
import { I as mn } from "./use-create-flow-overlay-state-BxzFviM-.js";
|
|
17
|
+
import { h as hn, R as pn } from "./report-preferences-dialog-Df7VpRVW.js";
|
|
18
|
+
import { createPortal as fn } from "react-dom";
|
|
19
|
+
import { a7 as we, a8 as st, a9 as Jt, aa as bn, ab as Rt, ac as gn } from "./document-dashboard-inputs-BC6p-ESg.js";
|
|
20
|
+
import { S as xn, C as vn } from "./selection-reducer-Dj_8xD69.js";
|
|
21
|
+
import { o as Xt } from "./matrix-formatter-CxJLkztA.js";
|
|
22
|
+
import { Z as Tt, _ as yn, $ as wn, x as Nn, a as rt } from "./document-sheet-utils-Duo9uLoH.js";
|
|
23
|
+
import { r as Sn } from "./export-file-format-C-tJsxsf.js";
|
|
24
|
+
import { u as kn } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
25
|
+
import { s as Cn } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
|
|
26
|
+
import { B as Te, u as Ut } from "./table-settings-CLZocegs.js";
|
|
27
|
+
import { S as Dn } from "./save-CfJpQQ68.js";
|
|
28
|
+
import { P as En } from "./palette-D10o_yYX.js";
|
|
29
|
+
import { B as In } from "./braces-o9UiRQes.js";
|
|
30
30
|
/**
|
|
31
31
|
* @license lucide-react v0.453.0 - ISC
|
|
32
32
|
*
|
|
33
33
|
* This source code is licensed under the ISC license.
|
|
34
34
|
* See the LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
const
|
|
36
|
+
const An = te("Monitor", [
|
|
37
37
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
38
38
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
39
39
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
@@ -44,7 +44,7 @@ const En = te("Monitor", [
|
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
const
|
|
47
|
+
const Ln = te("Moon", [
|
|
48
48
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
49
49
|
]);
|
|
50
50
|
/**
|
|
@@ -53,7 +53,7 @@ const In = te("Moon", [
|
|
|
53
53
|
* This source code is licensed under the ISC license.
|
|
54
54
|
* See the LICENSE file in the root directory of this source tree.
|
|
55
55
|
*/
|
|
56
|
-
const
|
|
56
|
+
const Mn = te("ShieldX", [
|
|
57
57
|
[
|
|
58
58
|
"path",
|
|
59
59
|
{
|
|
@@ -70,7 +70,7 @@ const An = te("ShieldX", [
|
|
|
70
70
|
* This source code is licensed under the ISC license.
|
|
71
71
|
* See the LICENSE file in the root directory of this source tree.
|
|
72
72
|
*/
|
|
73
|
-
const
|
|
73
|
+
const On = te("Sun", [
|
|
74
74
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
75
75
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
76
76
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -87,7 +87,7 @@ const Ln = te("Sun", [
|
|
|
87
87
|
* This source code is licensed under the ISC license.
|
|
88
88
|
* See the LICENSE file in the root directory of this source tree.
|
|
89
89
|
*/
|
|
90
|
-
const
|
|
90
|
+
const _n = te("UserPlus", [
|
|
91
91
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
92
92
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
93
93
|
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
@@ -99,11 +99,11 @@ const Mn = te("UserPlus", [
|
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
101
|
*/
|
|
102
|
-
const
|
|
102
|
+
const Zt = te("UserRound", [
|
|
103
103
|
["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
|
|
104
104
|
["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
|
|
105
105
|
]);
|
|
106
|
-
var
|
|
106
|
+
var at = { exports: {} }, Je = {};
|
|
107
107
|
/**
|
|
108
108
|
* @license React
|
|
109
109
|
* use-sync-external-store-shim.production.js
|
|
@@ -113,11 +113,11 @@ var rt = { exports: {} }, Ye = {};
|
|
|
113
113
|
* This source code is licensed under the MIT license found in the
|
|
114
114
|
* LICENSE file in the root directory of this source tree.
|
|
115
115
|
*/
|
|
116
|
-
var
|
|
117
|
-
function
|
|
118
|
-
if (
|
|
119
|
-
|
|
120
|
-
var e =
|
|
116
|
+
var $t;
|
|
117
|
+
function Pn() {
|
|
118
|
+
if ($t) return Je;
|
|
119
|
+
$t = 1;
|
|
120
|
+
var e = Yt;
|
|
121
121
|
function n(l, u) {
|
|
122
122
|
return l === u && (l !== 0 || 1 / l === 1 / u) || l !== l && u !== u;
|
|
123
123
|
}
|
|
@@ -152,9 +152,9 @@ function On() {
|
|
|
152
152
|
return u();
|
|
153
153
|
}
|
|
154
154
|
var g = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? f : p;
|
|
155
|
-
return
|
|
155
|
+
return Je.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : g, Je;
|
|
156
156
|
}
|
|
157
|
-
var
|
|
157
|
+
var Xe = {};
|
|
158
158
|
/**
|
|
159
159
|
* @license React
|
|
160
160
|
* use-sync-external-store-shim.development.js
|
|
@@ -164,9 +164,9 @@ var Je = {};
|
|
|
164
164
|
* This source code is licensed under the MIT license found in the
|
|
165
165
|
* LICENSE file in the root directory of this source tree.
|
|
166
166
|
*/
|
|
167
|
-
var
|
|
168
|
-
function
|
|
169
|
-
return
|
|
167
|
+
var Bt;
|
|
168
|
+
function Rn() {
|
|
169
|
+
return Bt || (Bt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
170
170
|
function e(s, x) {
|
|
171
171
|
return s === x && (s !== 0 || 1 / s === 1 / x) || s !== s && x !== x;
|
|
172
172
|
}
|
|
@@ -213,24 +213,24 @@ function _n() {
|
|
|
213
213
|
return x();
|
|
214
214
|
}
|
|
215
215
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
216
|
-
var o =
|
|
217
|
-
|
|
218
|
-
}()),
|
|
216
|
+
var o = Yt, c = typeof Object.is == "function" ? Object.is : e, m = o.useState, p = o.useEffect, b = o.useLayoutEffect, f = o.useDebugValue, g = !1, l = !1, u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
|
|
217
|
+
Xe.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : u, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
218
|
+
}()), Xe;
|
|
219
219
|
}
|
|
220
|
-
process.env.NODE_ENV === "production" ?
|
|
221
|
-
var
|
|
222
|
-
const
|
|
223
|
-
function
|
|
224
|
-
const { theme: e, setTheme: n } =
|
|
220
|
+
process.env.NODE_ENV === "production" ? at.exports = Pn() : at.exports = Rn();
|
|
221
|
+
var Tn = at.exports;
|
|
222
|
+
const Pe = ["light", "dark", "system"];
|
|
223
|
+
function Un() {
|
|
224
|
+
const { theme: e, setTheme: n } = jr(), a = C(
|
|
225
225
|
(m) => m.actions.setDashboardTheme
|
|
226
226
|
);
|
|
227
227
|
function r() {
|
|
228
|
-
const m =
|
|
228
|
+
const m = Pe.includes(e) ? e : "system", p = Pe[(Pe.indexOf(m) + 1) % Pe.length];
|
|
229
229
|
n(p), a(p);
|
|
230
230
|
}
|
|
231
|
-
const o = e === "light" ?
|
|
231
|
+
const o = e === "light" ? On : e === "dark" ? Ln : An, c = e === "light" ? "Theme: light (click for dark)" : e === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
|
|
232
232
|
return /* @__PURE__ */ t(
|
|
233
|
-
|
|
233
|
+
U,
|
|
234
234
|
{
|
|
235
235
|
type: "button",
|
|
236
236
|
variant: "ghost",
|
|
@@ -243,19 +243,19 @@ function Rn() {
|
|
|
243
243
|
}
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
|
-
function
|
|
247
|
-
const { displayPreferences: e, shouldShowElement: n } =
|
|
248
|
-
() =>
|
|
246
|
+
function $n() {
|
|
247
|
+
const { displayPreferences: e, shouldShowElement: n } = Hr(), { currentUser: a, userContext: r } = nt(), o = V(
|
|
248
|
+
() => qr(a),
|
|
249
249
|
[a]
|
|
250
|
-
), c =
|
|
250
|
+
), c = V(() => (p) => o && o[p] !== void 0 && o[p] === !1 ? !1 : n(p), [o, n, e]), m = V(
|
|
251
251
|
() => {
|
|
252
252
|
var p, b, f, g, l;
|
|
253
253
|
return {
|
|
254
|
-
canEdit: ((p = r == null ? void 0 : r.permissions) == null ? void 0 : p.canEdit) ??
|
|
255
|
-
canUseFilters: ((b = r == null ? void 0 : r.permissions) == null ? void 0 : b.canEdit) ??
|
|
256
|
-
canManageDashboards: ((f = r == null ? void 0 : r.permissions) == null ? void 0 : f.canCreateDashboard) ??
|
|
257
|
-
canCreateDashboards: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canCreateDashboard) ??
|
|
258
|
-
canAccessVisuals: ((l = r == null ? void 0 : r.permissions) == null ? void 0 : l.canEdit) ??
|
|
254
|
+
canEdit: ((p = r == null ? void 0 : r.permissions) == null ? void 0 : p.canEdit) ?? Yr(a),
|
|
255
|
+
canUseFilters: ((b = r == null ? void 0 : r.permissions) == null ? void 0 : b.canEdit) ?? Wr(a),
|
|
256
|
+
canManageDashboards: ((f = r == null ? void 0 : r.permissions) == null ? void 0 : f.canCreateDashboard) ?? Qr(a),
|
|
257
|
+
canCreateDashboards: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canCreateDashboard) ?? Kr(a),
|
|
258
|
+
canAccessVisuals: ((l = r == null ? void 0 : r.permissions) == null ? void 0 : l.canEdit) ?? zr(a)
|
|
259
259
|
};
|
|
260
260
|
},
|
|
261
261
|
[a, r]
|
|
@@ -267,7 +267,7 @@ function Un() {
|
|
|
267
267
|
currentUser: a
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function Bn(e, n = []) {
|
|
271
271
|
let a = [];
|
|
272
272
|
function r(c, m) {
|
|
273
273
|
const p = I.createContext(m);
|
|
@@ -299,9 +299,9 @@ function Tn(e, n = []) {
|
|
|
299
299
|
);
|
|
300
300
|
};
|
|
301
301
|
};
|
|
302
|
-
return o.scopeName = e, [r,
|
|
302
|
+
return o.scopeName = e, [r, Fn(o, ...n)];
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function Fn(...e) {
|
|
305
305
|
const n = e[0];
|
|
306
306
|
if (e.length === 1) return n;
|
|
307
307
|
const a = () => {
|
|
@@ -319,7 +319,7 @@ function $n(...e) {
|
|
|
319
319
|
};
|
|
320
320
|
return a.scopeName = n.scopeName, a;
|
|
321
321
|
}
|
|
322
|
-
var
|
|
322
|
+
var Gn = [
|
|
323
323
|
"a",
|
|
324
324
|
"button",
|
|
325
325
|
"div",
|
|
@@ -337,73 +337,73 @@ var Fn = [
|
|
|
337
337
|
"span",
|
|
338
338
|
"svg",
|
|
339
339
|
"ul"
|
|
340
|
-
],
|
|
341
|
-
const a =
|
|
340
|
+
], it = Gn.reduce((e, n) => {
|
|
341
|
+
const a = Va(`Primitive.${n}`), r = I.forwardRef((o, c) => {
|
|
342
342
|
const { asChild: m, ...p } = o, b = m ? a : n;
|
|
343
343
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ t(b, { ...p, ref: c });
|
|
344
344
|
});
|
|
345
345
|
return r.displayName = `Primitive.${n}`, { ...e, [n]: r };
|
|
346
346
|
}, {});
|
|
347
|
-
function
|
|
348
|
-
return
|
|
349
|
-
|
|
347
|
+
function Vn() {
|
|
348
|
+
return Tn.useSyncExternalStore(
|
|
349
|
+
jn,
|
|
350
350
|
() => !0,
|
|
351
351
|
() => !1
|
|
352
352
|
);
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function jn() {
|
|
355
355
|
return () => {
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
|
-
var
|
|
358
|
+
var dt = "Avatar", [Hn] = Bn(dt), [qn, er] = Hn(dt), tr = I.forwardRef(
|
|
359
359
|
(e, n) => {
|
|
360
360
|
const { __scopeAvatar: a, ...r } = e, [o, c] = I.useState("idle");
|
|
361
361
|
return /* @__PURE__ */ t(
|
|
362
|
-
|
|
362
|
+
qn,
|
|
363
363
|
{
|
|
364
364
|
scope: a,
|
|
365
365
|
imageLoadingStatus: o,
|
|
366
366
|
onImageLoadingStatusChange: c,
|
|
367
|
-
children: /* @__PURE__ */ t(
|
|
367
|
+
children: /* @__PURE__ */ t(it.span, { ...r, ref: n })
|
|
368
368
|
}
|
|
369
369
|
);
|
|
370
370
|
}
|
|
371
371
|
);
|
|
372
|
-
|
|
373
|
-
var
|
|
372
|
+
tr.displayName = dt;
|
|
373
|
+
var rr = "AvatarImage", ar = I.forwardRef(
|
|
374
374
|
(e, n) => {
|
|
375
375
|
const { __scopeAvatar: a, src: r, onLoadingStatusChange: o = () => {
|
|
376
|
-
}, ...c } = e, m =
|
|
376
|
+
}, ...c } = e, m = er(rr, a), p = zn(r, c), b = ja((f) => {
|
|
377
377
|
o(f), m.onImageLoadingStatusChange(f);
|
|
378
378
|
});
|
|
379
|
-
return
|
|
379
|
+
return tt(() => {
|
|
380
380
|
p !== "idle" && b(p);
|
|
381
|
-
}, [p, b]), p === "loaded" ? /* @__PURE__ */ t(
|
|
381
|
+
}, [p, b]), p === "loaded" ? /* @__PURE__ */ t(it.img, { ...c, ref: n, src: r }) : null;
|
|
382
382
|
}
|
|
383
383
|
);
|
|
384
|
-
|
|
385
|
-
var
|
|
384
|
+
ar.displayName = rr;
|
|
385
|
+
var nr = "AvatarFallback", or = I.forwardRef(
|
|
386
386
|
(e, n) => {
|
|
387
|
-
const { __scopeAvatar: a, delayMs: r, ...o } = e, c =
|
|
387
|
+
const { __scopeAvatar: a, delayMs: r, ...o } = e, c = er(nr, a), [m, p] = I.useState(r === void 0);
|
|
388
388
|
return I.useEffect(() => {
|
|
389
389
|
if (r !== void 0) {
|
|
390
390
|
const b = window.setTimeout(() => p(!0), r);
|
|
391
391
|
return () => window.clearTimeout(b);
|
|
392
392
|
}
|
|
393
|
-
}, [r]), m && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ t(
|
|
393
|
+
}, [r]), m && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ t(it.span, { ...o, ref: n }) : null;
|
|
394
394
|
}
|
|
395
395
|
);
|
|
396
|
-
|
|
397
|
-
function
|
|
396
|
+
or.displayName = nr;
|
|
397
|
+
function Ft(e, n) {
|
|
398
398
|
return e ? n ? (e.src !== n && (e.src = n), e.complete && e.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
const r =
|
|
402
|
-
() =>
|
|
400
|
+
function zn(e, { referrerPolicy: n, crossOrigin: a }) {
|
|
401
|
+
const r = Vn(), o = I.useRef(null), c = r ? (o.current || (o.current = new window.Image()), o.current) : null, [m, p] = I.useState(
|
|
402
|
+
() => Ft(c, e)
|
|
403
403
|
);
|
|
404
|
-
return
|
|
405
|
-
p(
|
|
406
|
-
}, [c, e]),
|
|
404
|
+
return tt(() => {
|
|
405
|
+
p(Ft(c, e));
|
|
406
|
+
}, [c, e]), tt(() => {
|
|
407
407
|
const b = (l) => () => {
|
|
408
408
|
p(l);
|
|
409
409
|
};
|
|
@@ -414,108 +414,108 @@ function Hn(e, { referrerPolicy: n, crossOrigin: a }) {
|
|
|
414
414
|
};
|
|
415
415
|
}, [c, a, n]), m;
|
|
416
416
|
}
|
|
417
|
-
var
|
|
418
|
-
const
|
|
419
|
-
|
|
417
|
+
var sr = tr, ir = ar, dr = or;
|
|
418
|
+
const cr = I.forwardRef(({ className: e, ...n }, a) => /* @__PURE__ */ t(
|
|
419
|
+
sr,
|
|
420
420
|
{
|
|
421
421
|
ref: a,
|
|
422
|
-
className:
|
|
422
|
+
className: xe(
|
|
423
423
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
424
424
|
e
|
|
425
425
|
),
|
|
426
426
|
...n
|
|
427
427
|
}
|
|
428
428
|
));
|
|
429
|
-
|
|
430
|
-
const
|
|
431
|
-
|
|
429
|
+
cr.displayName = sr.displayName;
|
|
430
|
+
const Kn = I.forwardRef(({ className: e, ...n }, a) => /* @__PURE__ */ t(
|
|
431
|
+
ir,
|
|
432
432
|
{
|
|
433
433
|
ref: a,
|
|
434
|
-
className:
|
|
434
|
+
className: xe("aspect-square h-full w-full", e),
|
|
435
435
|
...n
|
|
436
436
|
}
|
|
437
437
|
));
|
|
438
|
-
|
|
439
|
-
const
|
|
440
|
-
|
|
438
|
+
Kn.displayName = ir.displayName;
|
|
439
|
+
const lr = I.forwardRef(({ className: e, ...n }, a) => /* @__PURE__ */ t(
|
|
440
|
+
dr,
|
|
441
441
|
{
|
|
442
442
|
ref: a,
|
|
443
|
-
className:
|
|
443
|
+
className: xe(
|
|
444
444
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
445
445
|
e
|
|
446
446
|
),
|
|
447
447
|
...n
|
|
448
448
|
}
|
|
449
449
|
));
|
|
450
|
-
|
|
451
|
-
const
|
|
450
|
+
lr.displayName = dr.displayName;
|
|
451
|
+
const Qn = async (e, n, a) => {
|
|
452
452
|
const r = `${e}/management/v1/groups`;
|
|
453
|
-
return await
|
|
454
|
-
},
|
|
453
|
+
return await Jt(r, n, a);
|
|
454
|
+
}, Wn = async (e, n, a, r) => {
|
|
455
455
|
const o = `${e}/management/v1/groups/${a}`;
|
|
456
|
-
return
|
|
457
|
-
},
|
|
456
|
+
return st(o, n, "PATCH", r);
|
|
457
|
+
}, Yn = async (e, n, a) => {
|
|
458
458
|
const r = `${e}/management/v1/groups/${a}`;
|
|
459
|
-
await
|
|
460
|
-
},
|
|
459
|
+
await st(r, n, "DELETE");
|
|
460
|
+
}, Jn = async (e, n, a, r) => {
|
|
461
461
|
const o = `${e}/management/v1/groups/${a}/members`;
|
|
462
|
-
return await
|
|
463
|
-
},
|
|
462
|
+
return await Jt(o, n, r);
|
|
463
|
+
}, Xn = async (e, n, a, r) => {
|
|
464
464
|
const o = `${e}/management/v1/groups/${a}/members`;
|
|
465
|
-
await
|
|
465
|
+
await st(o, n, "DELETE", r);
|
|
466
466
|
};
|
|
467
|
-
function
|
|
468
|
-
const { authToken: e, tokenProps: n } =
|
|
469
|
-
return
|
|
470
|
-
mutationFn: (r) =>
|
|
467
|
+
function Zn() {
|
|
468
|
+
const { authToken: e, tokenProps: n } = K(), a = ve();
|
|
469
|
+
return ye({
|
|
470
|
+
mutationFn: (r) => Qn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r),
|
|
471
471
|
onSuccess: () => {
|
|
472
472
|
a.invalidateQueries({ queryKey: ["groups"] }), D.success("Group created successfully");
|
|
473
473
|
},
|
|
474
474
|
onError: (r) => {
|
|
475
475
|
console.error("Failed to create group:", r), D.error("Failed to create group", {
|
|
476
|
-
description:
|
|
476
|
+
description: we(r, "Failed to create group")
|
|
477
477
|
});
|
|
478
478
|
}
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
const { authToken: e, tokenProps: n } =
|
|
483
|
-
return
|
|
481
|
+
function eo() {
|
|
482
|
+
const { authToken: e, tokenProps: n } = K(), a = ve();
|
|
483
|
+
return ye({
|
|
484
484
|
mutationFn: ({
|
|
485
485
|
groupId: r,
|
|
486
486
|
data: o
|
|
487
|
-
}) =>
|
|
487
|
+
}) => Wn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r, o),
|
|
488
488
|
onSuccess: (r, o) => {
|
|
489
489
|
a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({ queryKey: ["groups"] }), D.success("Group updated successfully");
|
|
490
490
|
},
|
|
491
491
|
onError: (r) => {
|
|
492
492
|
console.error("Failed to update group:", r), D.error("Failed to update group", {
|
|
493
|
-
description:
|
|
493
|
+
description: we(r, "Failed to update group")
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
|
-
function
|
|
499
|
-
const { authToken: e, tokenProps: n } =
|
|
500
|
-
return
|
|
501
|
-
mutationFn: (r) =>
|
|
498
|
+
function to() {
|
|
499
|
+
const { authToken: e, tokenProps: n } = K(), a = ve();
|
|
500
|
+
return ye({
|
|
501
|
+
mutationFn: (r) => Yn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r),
|
|
502
502
|
onSuccess: (r, o) => {
|
|
503
503
|
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", o] }), D.success("Group deleted successfully");
|
|
504
504
|
},
|
|
505
505
|
onError: (r) => {
|
|
506
506
|
console.error("Failed to delete group:", r), D.error("Failed to delete group", {
|
|
507
|
-
description:
|
|
507
|
+
description: we(r, "Failed to delete group")
|
|
508
508
|
});
|
|
509
509
|
}
|
|
510
510
|
});
|
|
511
511
|
}
|
|
512
|
-
function
|
|
513
|
-
const { authToken: e, tokenProps: n } =
|
|
514
|
-
return
|
|
512
|
+
function ro() {
|
|
513
|
+
const { authToken: e, tokenProps: n } = K(), a = ve();
|
|
514
|
+
return ye({
|
|
515
515
|
mutationFn: ({
|
|
516
516
|
groupId: r,
|
|
517
517
|
data: o
|
|
518
|
-
}) =>
|
|
518
|
+
}) => Jn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r, o),
|
|
519
519
|
onSuccess: (r, o) => {
|
|
520
520
|
a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
|
|
521
521
|
queryKey: ["group-members", o.groupId]
|
|
@@ -523,18 +523,18 @@ function eo() {
|
|
|
523
523
|
},
|
|
524
524
|
onError: (r) => {
|
|
525
525
|
console.error("Failed to add group members:", r), D.error("Failed to add members", {
|
|
526
|
-
description:
|
|
526
|
+
description: we(r, "Failed to add members")
|
|
527
527
|
});
|
|
528
528
|
}
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
|
-
function
|
|
532
|
-
const { authToken: e, tokenProps: n } =
|
|
533
|
-
return
|
|
531
|
+
function ao() {
|
|
532
|
+
const { authToken: e, tokenProps: n } = K(), a = ve();
|
|
533
|
+
return ye({
|
|
534
534
|
mutationFn: ({
|
|
535
535
|
groupId: r,
|
|
536
536
|
data: o
|
|
537
|
-
}) =>
|
|
537
|
+
}) => Xn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r, o),
|
|
538
538
|
onSuccess: (r, o) => {
|
|
539
539
|
a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
|
|
540
540
|
queryKey: ["group-members", o.groupId]
|
|
@@ -542,28 +542,28 @@ function to() {
|
|
|
542
542
|
},
|
|
543
543
|
onError: (r) => {
|
|
544
544
|
console.error("Failed to remove group members:", r), D.error("Failed to remove members", {
|
|
545
|
-
description:
|
|
545
|
+
description: we(r, "Failed to remove members")
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
|
-
const
|
|
551
|
-
function
|
|
550
|
+
const no = [];
|
|
551
|
+
function oo({
|
|
552
552
|
open: e,
|
|
553
553
|
onOpenChange: n
|
|
554
554
|
}) {
|
|
555
555
|
var E, A, L;
|
|
556
|
-
const { tokenProps: a } =
|
|
556
|
+
const { tokenProps: a } = K(), { currentUser: r } = nt(), o = (r == null ? void 0 : r.type) === "tenant", c = a == null ? void 0 : a.tenantId, {
|
|
557
557
|
groups: m,
|
|
558
558
|
isLoading: p,
|
|
559
559
|
error: b,
|
|
560
560
|
refetch: f
|
|
561
|
-
} =
|
|
561
|
+
} = Jr({
|
|
562
562
|
type: o ? "TENANT_GROUP" : "all",
|
|
563
563
|
tenantId: o ? c : void 0,
|
|
564
564
|
includeMembers: !1
|
|
565
|
-
}), g = b ?
|
|
566
|
-
|
|
565
|
+
}), g = b ? ur(b, "Unable to load groups.") : null, [l, u] = S({ kind: "list" }), [s, x] = S(null), v = to();
|
|
566
|
+
ge(() => {
|
|
567
567
|
e || (u({ kind: "list" }), x(null));
|
|
568
568
|
}, [e]);
|
|
569
569
|
const w = l.kind === "members" && m.find((N) => N.id === l.groupId) || null, h = async () => {
|
|
@@ -573,10 +573,10 @@ function ao({
|
|
|
573
573
|
} catch {
|
|
574
574
|
}
|
|
575
575
|
};
|
|
576
|
-
return /* @__PURE__ */ t(
|
|
576
|
+
return /* @__PURE__ */ t(Ht, { open: e, onOpenChange: n, children: /* @__PURE__ */ i(qt, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
|
|
577
577
|
l.kind === "list" ? /* @__PURE__ */ i("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
|
|
578
|
-
/* @__PURE__ */ t(
|
|
579
|
-
/* @__PURE__ */ t(
|
|
578
|
+
/* @__PURE__ */ t(Ze, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
|
|
579
|
+
/* @__PURE__ */ t(et, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
|
|
580
580
|
] }) : l.kind === "create" ? /* @__PURE__ */ i("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
581
581
|
/* @__PURE__ */ t(
|
|
582
582
|
"button",
|
|
@@ -585,14 +585,14 @@ function ao({
|
|
|
585
585
|
onClick: () => u({ kind: "list" }),
|
|
586
586
|
"aria-label": "Back",
|
|
587
587
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
588
|
-
children: /* @__PURE__ */ t(
|
|
588
|
+
children: /* @__PURE__ */ t(zt, { className: "h-3.5 w-3.5" })
|
|
589
589
|
}
|
|
590
590
|
),
|
|
591
|
-
/* @__PURE__ */ t(
|
|
592
|
-
/* @__PURE__ */ t(
|
|
591
|
+
/* @__PURE__ */ t(Ze, { className: "truncate text-[13px] font-medium", children: "New group" }),
|
|
592
|
+
/* @__PURE__ */ t(et, { className: "sr-only", children: "Create a new group to organize members." })
|
|
593
593
|
] }) : null,
|
|
594
594
|
l.kind === "list" && /* @__PURE__ */ t(
|
|
595
|
-
|
|
595
|
+
so,
|
|
596
596
|
{
|
|
597
597
|
groups: m,
|
|
598
598
|
isLoading: p,
|
|
@@ -605,7 +605,7 @@ function ao({
|
|
|
605
605
|
}
|
|
606
606
|
),
|
|
607
607
|
l.kind === "members" && w && /* @__PURE__ */ t(
|
|
608
|
-
|
|
608
|
+
lo,
|
|
609
609
|
{
|
|
610
610
|
group: w,
|
|
611
611
|
isTenantViewer: o,
|
|
@@ -620,7 +620,7 @@ function ao({
|
|
|
620
620
|
w.id
|
|
621
621
|
),
|
|
622
622
|
l.kind === "create" && /* @__PURE__ */ t(
|
|
623
|
-
|
|
623
|
+
uo,
|
|
624
624
|
{
|
|
625
625
|
isTenantUser: o,
|
|
626
626
|
tenantId: c,
|
|
@@ -656,7 +656,7 @@ function ao({
|
|
|
656
656
|
disabled: v.isPending,
|
|
657
657
|
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",
|
|
658
658
|
children: [
|
|
659
|
-
v.isPending ? /* @__PURE__ */ t(
|
|
659
|
+
v.isPending ? /* @__PURE__ */ t(Re, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(ot, { className: "h-3 w-3" }),
|
|
660
660
|
"Delete group"
|
|
661
661
|
]
|
|
662
662
|
}
|
|
@@ -665,7 +665,7 @@ function ao({
|
|
|
665
665
|
] })
|
|
666
666
|
] }) });
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function so({
|
|
669
669
|
groups: e,
|
|
670
670
|
isLoading: n,
|
|
671
671
|
errorMessage: a,
|
|
@@ -675,7 +675,7 @@ function no({
|
|
|
675
675
|
onCreate: m,
|
|
676
676
|
onDeleteRequest: p
|
|
677
677
|
}) {
|
|
678
|
-
const [b, f] = S(""), g =
|
|
678
|
+
const [b, f] = S(""), g = V(
|
|
679
679
|
() => e.filter(
|
|
680
680
|
(l) => !b.trim() || l.name.toLowerCase().includes(b.toLowerCase()) || (l.description || "").toLowerCase().includes(b.toLowerCase())
|
|
681
681
|
),
|
|
@@ -684,7 +684,7 @@ function no({
|
|
|
684
684
|
return /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
685
685
|
/* @__PURE__ */ i("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
|
|
686
686
|
/* @__PURE__ */ i("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
|
|
687
|
-
/* @__PURE__ */ t(
|
|
687
|
+
/* @__PURE__ */ t(xn, { className: "h-3 w-3 text-muted-foreground" }),
|
|
688
688
|
/* @__PURE__ */ t(
|
|
689
689
|
"input",
|
|
690
690
|
{
|
|
@@ -700,7 +700,7 @@ function no({
|
|
|
700
700
|
type: "button",
|
|
701
701
|
onClick: () => f(""),
|
|
702
702
|
className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
703
|
-
children: /* @__PURE__ */ t(
|
|
703
|
+
children: /* @__PURE__ */ t(Wt, { className: "h-2.5 w-2.5" })
|
|
704
704
|
}
|
|
705
705
|
)
|
|
706
706
|
] }),
|
|
@@ -724,13 +724,13 @@ function no({
|
|
|
724
724
|
},
|
|
725
725
|
l
|
|
726
726
|
)) }) : a ? /* @__PURE__ */ t(
|
|
727
|
-
|
|
727
|
+
mr,
|
|
728
728
|
{
|
|
729
729
|
title: "Can't load groups",
|
|
730
730
|
message: a,
|
|
731
731
|
onRetry: r
|
|
732
732
|
}
|
|
733
|
-
) : g.length === 0 && e.length === 0 ? /* @__PURE__ */ t(
|
|
733
|
+
) : g.length === 0 && e.length === 0 ? /* @__PURE__ */ t(co, { onCreate: m }) : g.length === 0 ? /* @__PURE__ */ i("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
734
734
|
/* @__PURE__ */ i("div", { className: "text-[12px] text-foreground", children: [
|
|
735
735
|
'No groups match "',
|
|
736
736
|
b,
|
|
@@ -740,7 +740,7 @@ function no({
|
|
|
740
740
|
] }) : g.map((l) => {
|
|
741
741
|
var u;
|
|
742
742
|
return /* @__PURE__ */ t(
|
|
743
|
-
|
|
743
|
+
io,
|
|
744
744
|
{
|
|
745
745
|
group: l,
|
|
746
746
|
canDelete: ((u = l.permissions) == null ? void 0 : u.canDelete) ?? l.createdBy === o,
|
|
@@ -752,7 +752,7 @@ function no({
|
|
|
752
752
|
}) })
|
|
753
753
|
] });
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function io({
|
|
756
756
|
group: e,
|
|
757
757
|
canDelete: n,
|
|
758
758
|
onClick: a,
|
|
@@ -760,7 +760,7 @@ function oo({
|
|
|
760
760
|
}) {
|
|
761
761
|
let o = "";
|
|
762
762
|
try {
|
|
763
|
-
o =
|
|
763
|
+
o = Xt(new Date(e.createdAt), "MMM d, yyyy");
|
|
764
764
|
} catch {
|
|
765
765
|
o = "";
|
|
766
766
|
}
|
|
@@ -771,12 +771,12 @@ function oo({
|
|
|
771
771
|
onClick: a,
|
|
772
772
|
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",
|
|
773
773
|
children: [
|
|
774
|
-
/* @__PURE__ */ t("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__ */ t(
|
|
774
|
+
/* @__PURE__ */ t("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__ */ t(ea, { className: "h-3.5 w-3.5" }) }),
|
|
775
775
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
776
776
|
/* @__PURE__ */ t("div", { className: "truncate text-[13px] font-medium text-foreground", children: e.name }),
|
|
777
777
|
/* @__PURE__ */ i("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
778
778
|
/* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1", children: [
|
|
779
|
-
/* @__PURE__ */ t(
|
|
779
|
+
/* @__PURE__ */ t(Zt, { className: "h-2.5 w-2.5" }),
|
|
780
780
|
e.memberCount,
|
|
781
781
|
" member",
|
|
782
782
|
e.memberCount === 1 ? "" : "s"
|
|
@@ -784,7 +784,7 @@ function oo({
|
|
|
784
784
|
o && /* @__PURE__ */ i($, { children: [
|
|
785
785
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
786
786
|
/* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1", children: [
|
|
787
|
-
/* @__PURE__ */ t(
|
|
787
|
+
/* @__PURE__ */ t(Qt, { className: "h-2.5 w-2.5" }),
|
|
788
788
|
o
|
|
789
789
|
] })
|
|
790
790
|
] }),
|
|
@@ -808,18 +808,18 @@ function oo({
|
|
|
808
808
|
},
|
|
809
809
|
"aria-label": `Delete ${e.name}`,
|
|
810
810
|
className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
811
|
-
children: /* @__PURE__ */ t(
|
|
811
|
+
children: /* @__PURE__ */ t(ot, { className: "h-3 w-3" })
|
|
812
812
|
}
|
|
813
813
|
),
|
|
814
|
-
/* @__PURE__ */ t(
|
|
814
|
+
/* @__PURE__ */ t(vn, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
815
815
|
] })
|
|
816
816
|
]
|
|
817
817
|
}
|
|
818
818
|
);
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function co({ onCreate: e }) {
|
|
821
821
|
return /* @__PURE__ */ i("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
|
|
822
|
-
/* @__PURE__ */ t("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ t(
|
|
822
|
+
/* @__PURE__ */ t("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ t(Kt, { className: "h-4 w-4" }) }),
|
|
823
823
|
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
|
|
824
824
|
/* @__PURE__ */ t("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." }),
|
|
825
825
|
/* @__PURE__ */ i(
|
|
@@ -836,7 +836,7 @@ function so({ onCreate: e }) {
|
|
|
836
836
|
)
|
|
837
837
|
] });
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function lo({
|
|
840
840
|
group: e,
|
|
841
841
|
isTenantViewer: n,
|
|
842
842
|
canEdit: a,
|
|
@@ -852,20 +852,20 @@ function io({
|
|
|
852
852
|
isLoading: g,
|
|
853
853
|
error: l,
|
|
854
854
|
refetch: u
|
|
855
|
-
} =
|
|
855
|
+
} = Xr(e.id), s = (f == null ? void 0 : f.members) ?? no, x = l ? ur(l, "Unable to load members for this group.") : null, v = e.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w } = Zr({
|
|
856
856
|
type: v,
|
|
857
857
|
tenantId: e.tenantId || void 0,
|
|
858
858
|
active: !0,
|
|
859
859
|
limit: 200
|
|
860
|
-
}), h =
|
|
860
|
+
}), h = V(
|
|
861
861
|
() => new Set(s.map((y) => y.userId)),
|
|
862
862
|
[s]
|
|
863
|
-
), E =
|
|
864
|
-
const y =
|
|
865
|
-
return w.filter((
|
|
866
|
-
(
|
|
863
|
+
), E = ro(), A = ao(), L = eo(), [N, k] = S(!1), [re, ae] = S(e.name), [Ne, Q] = S(!1), [W, Y] = S(e.description || ""), [J, Se] = S(""), [ke, ne] = S(!1), oe = V(() => {
|
|
864
|
+
const y = J.trim().toLowerCase();
|
|
865
|
+
return w.filter((R) => !h.has(R.id)).filter(
|
|
866
|
+
(R) => !y || (R.name || "").toLowerCase().includes(y) || (R.email || "").toLowerCase().includes(y)
|
|
867
867
|
).slice(0, 50);
|
|
868
|
-
}, [w, h,
|
|
868
|
+
}, [w, h, J]), se = async () => {
|
|
869
869
|
const y = re.trim();
|
|
870
870
|
if (k(!1), y.length >= 3 && y !== e.name)
|
|
871
871
|
try {
|
|
@@ -875,9 +875,9 @@ function io({
|
|
|
875
875
|
}), p();
|
|
876
876
|
} catch {
|
|
877
877
|
}
|
|
878
|
-
},
|
|
879
|
-
const y =
|
|
880
|
-
if (
|
|
878
|
+
}, ie = async () => {
|
|
879
|
+
const y = W.trim();
|
|
880
|
+
if (Q(!1), y !== (e.description || ""))
|
|
881
881
|
try {
|
|
882
882
|
await L.mutateAsync({
|
|
883
883
|
groupId: e.id,
|
|
@@ -885,9 +885,9 @@ function io({
|
|
|
885
885
|
}), p();
|
|
886
886
|
} catch {
|
|
887
887
|
}
|
|
888
|
-
},
|
|
888
|
+
}, Ce = async (y) => {
|
|
889
889
|
if (o) {
|
|
890
|
-
|
|
890
|
+
Se(""), ne(!1);
|
|
891
891
|
try {
|
|
892
892
|
await E.mutateAsync({
|
|
893
893
|
groupId: e.id,
|
|
@@ -899,7 +899,7 @@ function io({
|
|
|
899
899
|
} catch {
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
},
|
|
902
|
+
}, Ue = async (y) => {
|
|
903
903
|
if (o)
|
|
904
904
|
try {
|
|
905
905
|
await A.mutateAsync({
|
|
@@ -909,11 +909,11 @@ function io({
|
|
|
909
909
|
} catch {
|
|
910
910
|
}
|
|
911
911
|
};
|
|
912
|
-
let
|
|
912
|
+
let j = "";
|
|
913
913
|
try {
|
|
914
|
-
|
|
914
|
+
j = Xt(new Date(e.createdAt), "MMM d, yyyy");
|
|
915
915
|
} catch {
|
|
916
|
-
|
|
916
|
+
j = "";
|
|
917
917
|
}
|
|
918
918
|
return /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
919
919
|
/* @__PURE__ */ i("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
@@ -924,7 +924,7 @@ function io({
|
|
|
924
924
|
onClick: c,
|
|
925
925
|
"aria-label": "Back",
|
|
926
926
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
927
|
-
children: /* @__PURE__ */ t(
|
|
927
|
+
children: /* @__PURE__ */ t(zt, { className: "h-3.5 w-3.5" })
|
|
928
928
|
}
|
|
929
929
|
),
|
|
930
930
|
N ? /* @__PURE__ */ t(
|
|
@@ -933,9 +933,9 @@ function io({
|
|
|
933
933
|
autoFocus: !0,
|
|
934
934
|
value: re,
|
|
935
935
|
onChange: (y) => ae(y.target.value),
|
|
936
|
-
onBlur:
|
|
936
|
+
onBlur: se,
|
|
937
937
|
onKeyDown: (y) => {
|
|
938
|
-
y.key === "Enter" &&
|
|
938
|
+
y.key === "Enter" && se(), y.key === "Escape" && (ae(e.name), k(!1));
|
|
939
939
|
},
|
|
940
940
|
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"
|
|
941
941
|
}
|
|
@@ -953,23 +953,23 @@ function io({
|
|
|
953
953
|
}
|
|
954
954
|
),
|
|
955
955
|
/* @__PURE__ */ i("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
|
|
956
|
-
/* @__PURE__ */ t(
|
|
956
|
+
/* @__PURE__ */ t(Zt, { className: "h-2.5 w-2.5" }),
|
|
957
957
|
s.length,
|
|
958
958
|
" member",
|
|
959
959
|
s.length === 1 ? "" : "s"
|
|
960
960
|
] })
|
|
961
961
|
] }),
|
|
962
|
-
/* @__PURE__ */ t("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children:
|
|
962
|
+
/* @__PURE__ */ t("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: Ne ? /* @__PURE__ */ i("div", { children: [
|
|
963
963
|
/* @__PURE__ */ t(
|
|
964
964
|
"textarea",
|
|
965
965
|
{
|
|
966
966
|
autoFocus: !0,
|
|
967
967
|
rows: 2,
|
|
968
|
-
value:
|
|
969
|
-
onChange: (y) =>
|
|
968
|
+
value: W,
|
|
969
|
+
onChange: (y) => Y(y.target.value),
|
|
970
970
|
maxLength: 200,
|
|
971
971
|
onKeyDown: (y) => {
|
|
972
|
-
y.key === "Escape" && (
|
|
972
|
+
y.key === "Escape" && (Y(e.description || ""), Q(!1)), y.key === "Enter" && (y.metaKey || y.ctrlKey) && ie();
|
|
973
973
|
},
|
|
974
974
|
placeholder: "What is this group for?",
|
|
975
975
|
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"
|
|
@@ -977,7 +977,7 @@ function io({
|
|
|
977
977
|
),
|
|
978
978
|
/* @__PURE__ */ i("div", { className: "mt-1.5 flex items-center justify-between", children: [
|
|
979
979
|
/* @__PURE__ */ i("span", { className: "text-[10.5px] text-muted-foreground", children: [
|
|
980
|
-
|
|
980
|
+
W.length,
|
|
981
981
|
"/200 · Esc to cancel · ⌘↩ to save"
|
|
982
982
|
] }),
|
|
983
983
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
|
|
@@ -986,7 +986,7 @@ function io({
|
|
|
986
986
|
{
|
|
987
987
|
type: "button",
|
|
988
988
|
onClick: () => {
|
|
989
|
-
|
|
989
|
+
Y(e.description || ""), Q(!1);
|
|
990
990
|
},
|
|
991
991
|
className: "h-6 rounded-[5px] px-2 text-[11px] font-medium text-foreground/80 hover:bg-accent",
|
|
992
992
|
children: "Cancel"
|
|
@@ -996,7 +996,7 @@ function io({
|
|
|
996
996
|
"button",
|
|
997
997
|
{
|
|
998
998
|
type: "button",
|
|
999
|
-
onClick:
|
|
999
|
+
onClick: ie,
|
|
1000
1000
|
className: "inline-flex h-6 items-center rounded-[5px] bg-foreground px-2 text-[11px] font-medium text-background hover:opacity-90",
|
|
1001
1001
|
children: "Save"
|
|
1002
1002
|
}
|
|
@@ -1008,7 +1008,7 @@ function io({
|
|
|
1008
1008
|
{
|
|
1009
1009
|
type: "button",
|
|
1010
1010
|
onClick: () => {
|
|
1011
|
-
a && (
|
|
1011
|
+
a && (Y(e.description || ""), Q(!0));
|
|
1012
1012
|
},
|
|
1013
1013
|
disabled: !a,
|
|
1014
1014
|
title: a ? "Click to edit description" : void 0,
|
|
@@ -1016,22 +1016,22 @@ function io({
|
|
|
1016
1016
|
children: [
|
|
1017
1017
|
e.description ? /* @__PURE__ */ t("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: e.description }) : /* @__PURE__ */ t("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: a ? "Add a description…" : "No description" }),
|
|
1018
1018
|
/* @__PURE__ */ i("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
|
|
1019
|
-
|
|
1019
|
+
j ? `Created ${j}` : "Recently created",
|
|
1020
1020
|
a ? " · You can edit this group" : ""
|
|
1021
1021
|
] })
|
|
1022
1022
|
]
|
|
1023
1023
|
}
|
|
1024
1024
|
) }),
|
|
1025
1025
|
o && /* @__PURE__ */ t(
|
|
1026
|
-
|
|
1026
|
+
mo,
|
|
1027
1027
|
{
|
|
1028
|
-
query:
|
|
1029
|
-
setQuery:
|
|
1030
|
-
open:
|
|
1028
|
+
query: J,
|
|
1029
|
+
setQuery: Se,
|
|
1030
|
+
open: ke,
|
|
1031
1031
|
setOpen: ne,
|
|
1032
1032
|
candidates: oe,
|
|
1033
1033
|
showKindChip: !n,
|
|
1034
|
-
onAdd:
|
|
1034
|
+
onAdd: Ce,
|
|
1035
1035
|
busy: E.isPending
|
|
1036
1036
|
}
|
|
1037
1037
|
),
|
|
@@ -1042,7 +1042,7 @@ function io({
|
|
|
1042
1042
|
},
|
|
1043
1043
|
y
|
|
1044
1044
|
)) }) : x ? /* @__PURE__ */ t(
|
|
1045
|
-
|
|
1045
|
+
mr,
|
|
1046
1046
|
{
|
|
1047
1047
|
title: "Can't load members",
|
|
1048
1048
|
message: x,
|
|
@@ -1052,27 +1052,27 @@ function io({
|
|
|
1052
1052
|
/* @__PURE__ */ t("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
|
|
1053
1053
|
/* @__PURE__ */ t("div", { className: "text-[11px] text-muted-foreground", children: o ? "Search above to add people to this group." : "This group does not have any members." })
|
|
1054
1054
|
] }) : s.map((y) => {
|
|
1055
|
-
var
|
|
1055
|
+
var R, H, q, de, z, ce;
|
|
1056
1056
|
return /* @__PURE__ */ i(
|
|
1057
1057
|
"div",
|
|
1058
1058
|
{
|
|
1059
1059
|
className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
|
|
1060
1060
|
children: [
|
|
1061
|
-
/* @__PURE__ */ t(
|
|
1061
|
+
/* @__PURE__ */ t(hr, { name: ((R = y.user) == null ? void 0 : R.name) || ((H = y.user) == null ? void 0 : H.email) || "?" }),
|
|
1062
1062
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
1063
|
-
/* @__PURE__ */ t("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((
|
|
1064
|
-
((
|
|
1063
|
+
/* @__PURE__ */ t("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((q = y.user) == null ? void 0 : q.name) || ((de = y.user) == null ? void 0 : de.email) || "Unknown" }),
|
|
1064
|
+
((z = y.user) == null ? void 0 : z.email) && y.user.name && /* @__PURE__ */ t("div", { className: "truncate text-[10.5px] text-muted-foreground", children: y.user.email })
|
|
1065
1065
|
] }),
|
|
1066
1066
|
!n && /* @__PURE__ */ t("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: y.userType }),
|
|
1067
1067
|
/* @__PURE__ */ t(
|
|
1068
1068
|
"button",
|
|
1069
1069
|
{
|
|
1070
1070
|
type: "button",
|
|
1071
|
-
onClick: () =>
|
|
1071
|
+
onClick: () => Ue(y.userId),
|
|
1072
1072
|
disabled: !o || A.isPending,
|
|
1073
|
-
"aria-label": `Remove ${((
|
|
1073
|
+
"aria-label": `Remove ${((ce = y.user) == null ? void 0 : ce.name) || "member"}`,
|
|
1074
1074
|
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",
|
|
1075
|
-
children: /* @__PURE__ */ t(
|
|
1075
|
+
children: /* @__PURE__ */ t(Wt, { className: "h-3 w-3" })
|
|
1076
1076
|
}
|
|
1077
1077
|
)
|
|
1078
1078
|
]
|
|
@@ -1087,20 +1087,20 @@ function io({
|
|
|
1087
1087
|
onClick: b,
|
|
1088
1088
|
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",
|
|
1089
1089
|
children: [
|
|
1090
|
-
/* @__PURE__ */ t(
|
|
1090
|
+
/* @__PURE__ */ t(ot, { className: "h-3 w-3" }),
|
|
1091
1091
|
"Delete group"
|
|
1092
1092
|
]
|
|
1093
1093
|
}
|
|
1094
1094
|
) })
|
|
1095
1095
|
] });
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function uo({
|
|
1098
1098
|
isTenantUser: e,
|
|
1099
1099
|
tenantId: n,
|
|
1100
1100
|
onCancel: a,
|
|
1101
1101
|
onCreated: r
|
|
1102
1102
|
}) {
|
|
1103
|
-
const [o, c] = S(""), [m, p] = S(""), [b, f] = S(null), g =
|
|
1103
|
+
const [o, c] = S(""), [m, p] = S(""), [b, f] = S(null), g = Zn(), l = o.trim().length >= 3 && o.trim().length <= 50, u = async () => {
|
|
1104
1104
|
if (!l) return;
|
|
1105
1105
|
f(null);
|
|
1106
1106
|
const s = {
|
|
@@ -1118,7 +1118,7 @@ function co({
|
|
|
1118
1118
|
};
|
|
1119
1119
|
return /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
1120
1120
|
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
|
|
1121
|
-
/* @__PURE__ */ t(
|
|
1121
|
+
/* @__PURE__ */ t(Gt, { children: "Name" }),
|
|
1122
1122
|
/* @__PURE__ */ t(
|
|
1123
1123
|
"input",
|
|
1124
1124
|
{
|
|
@@ -1132,7 +1132,7 @@ function co({
|
|
|
1132
1132
|
),
|
|
1133
1133
|
/* @__PURE__ */ t("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
|
|
1134
1134
|
/* @__PURE__ */ i("div", { className: "mt-4", children: [
|
|
1135
|
-
/* @__PURE__ */ t(
|
|
1135
|
+
/* @__PURE__ */ t(Gt, { children: "Description (optional)" }),
|
|
1136
1136
|
/* @__PURE__ */ t(
|
|
1137
1137
|
"textarea",
|
|
1138
1138
|
{
|
|
@@ -1170,7 +1170,7 @@ function co({
|
|
|
1170
1170
|
disabled: !l || g.isPending,
|
|
1171
1171
|
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",
|
|
1172
1172
|
children: g.isPending ? /* @__PURE__ */ i($, { children: [
|
|
1173
|
-
/* @__PURE__ */ t(
|
|
1173
|
+
/* @__PURE__ */ t(Re, { className: "h-3 w-3 animate-spin" }),
|
|
1174
1174
|
"Creating…"
|
|
1175
1175
|
] }) : /* @__PURE__ */ i($, { children: [
|
|
1176
1176
|
/* @__PURE__ */ t(ee, { className: "h-3 w-3" }),
|
|
@@ -1181,7 +1181,7 @@ function co({
|
|
|
1181
1181
|
] })
|
|
1182
1182
|
] });
|
|
1183
1183
|
}
|
|
1184
|
-
function
|
|
1184
|
+
function mo({
|
|
1185
1185
|
query: e,
|
|
1186
1186
|
setQuery: n,
|
|
1187
1187
|
open: a,
|
|
@@ -1191,8 +1191,8 @@ function lo({
|
|
|
1191
1191
|
onAdd: m,
|
|
1192
1192
|
busy: p
|
|
1193
1193
|
}) {
|
|
1194
|
-
const b =
|
|
1195
|
-
|
|
1194
|
+
const b = Pt(null), f = Pt(null), [g, l] = S(null);
|
|
1195
|
+
tn(() => {
|
|
1196
1196
|
if (!a) {
|
|
1197
1197
|
l(null);
|
|
1198
1198
|
return;
|
|
@@ -1211,7 +1211,7 @@ function lo({
|
|
|
1211
1211
|
return s(), window.addEventListener("resize", s), window.addEventListener("scroll", s, !0), () => {
|
|
1212
1212
|
window.removeEventListener("resize", s), window.removeEventListener("scroll", s, !0);
|
|
1213
1213
|
};
|
|
1214
|
-
}, [a, o.length]),
|
|
1214
|
+
}, [a, o.length]), ge(() => {
|
|
1215
1215
|
if (!a) return;
|
|
1216
1216
|
const s = (x) => {
|
|
1217
1217
|
var w, h;
|
|
@@ -1228,7 +1228,7 @@ function lo({
|
|
|
1228
1228
|
ref: b,
|
|
1229
1229
|
className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40",
|
|
1230
1230
|
children: [
|
|
1231
|
-
/* @__PURE__ */ t(
|
|
1231
|
+
/* @__PURE__ */ t(_n, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1232
1232
|
/* @__PURE__ */ t(
|
|
1233
1233
|
"input",
|
|
1234
1234
|
{
|
|
@@ -1245,7 +1245,7 @@ function lo({
|
|
|
1245
1245
|
]
|
|
1246
1246
|
}
|
|
1247
1247
|
),
|
|
1248
|
-
u && typeof document < "u" &&
|
|
1248
|
+
u && typeof document < "u" && fn(
|
|
1249
1249
|
/* @__PURE__ */ t(
|
|
1250
1250
|
"div",
|
|
1251
1251
|
{
|
|
@@ -1265,7 +1265,7 @@ function lo({
|
|
|
1265
1265
|
onClick: () => m(s),
|
|
1266
1266
|
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",
|
|
1267
1267
|
children: [
|
|
1268
|
-
/* @__PURE__ */ t(
|
|
1268
|
+
/* @__PURE__ */ t(hr, { name: s.name || s.email || "?" }),
|
|
1269
1269
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
1270
1270
|
/* @__PURE__ */ t("div", { className: "truncate text-[12px] font-medium text-foreground", children: s.name || s.email || "Unknown" }),
|
|
1271
1271
|
s.email && s.name && /* @__PURE__ */ t("div", { className: "truncate text-[10.5px] text-muted-foreground", children: s.email })
|
|
@@ -1281,7 +1281,7 @@ function lo({
|
|
|
1281
1281
|
)
|
|
1282
1282
|
] });
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function ur(e, n) {
|
|
1285
1285
|
if (!e) return n;
|
|
1286
1286
|
if (e instanceof Error) {
|
|
1287
1287
|
const a = e.message || "", r = a.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
|
|
@@ -1289,7 +1289,7 @@ function cr(e, n) {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
return typeof e == "string" ? e : n;
|
|
1291
1291
|
}
|
|
1292
|
-
function
|
|
1292
|
+
function mr({
|
|
1293
1293
|
title: e,
|
|
1294
1294
|
message: n,
|
|
1295
1295
|
onRetry: a
|
|
@@ -1308,66 +1308,66 @@ function lr({
|
|
|
1308
1308
|
)
|
|
1309
1309
|
] });
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1311
|
+
function Gt({ children: e }) {
|
|
1312
1312
|
return /* @__PURE__ */ t("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: e });
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1314
|
+
function hr({ name: e }) {
|
|
1315
1315
|
const n = e.split(" ").map((a) => a[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
1316
|
-
return /* @__PURE__ */ t(
|
|
1316
|
+
return /* @__PURE__ */ t(cr, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ t(lr, { className: "text-[9px] font-semibold", children: n || "?" }) });
|
|
1317
1317
|
}
|
|
1318
|
-
const
|
|
1319
|
-
function
|
|
1318
|
+
const ho = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
1319
|
+
function po({
|
|
1320
1320
|
open: e,
|
|
1321
1321
|
onOpenChange: n
|
|
1322
1322
|
}) {
|
|
1323
1323
|
const a = C(
|
|
1324
1324
|
(o) => {
|
|
1325
1325
|
var c, m;
|
|
1326
|
-
return
|
|
1326
|
+
return Sn({
|
|
1327
1327
|
dashboardDefault: (m = (c = o.dashboard) == null ? void 0 : c.exportDefaults) == null ? void 0 : m.csvEncoding
|
|
1328
1328
|
});
|
|
1329
1329
|
}
|
|
1330
1330
|
), { setDashboardExportDefaults: r } = C(
|
|
1331
1331
|
(o) => o.actions
|
|
1332
1332
|
);
|
|
1333
|
-
return /* @__PURE__ */ t(
|
|
1334
|
-
/* @__PURE__ */ i(
|
|
1335
|
-
/* @__PURE__ */ t(
|
|
1336
|
-
/* @__PURE__ */ t(
|
|
1333
|
+
return /* @__PURE__ */ t(Ht, { open: e, onOpenChange: n, children: /* @__PURE__ */ i(qt, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
|
|
1334
|
+
/* @__PURE__ */ i(ta, { children: [
|
|
1335
|
+
/* @__PURE__ */ t(Ze, { className: "text-[15px]", children: "Download settings" }),
|
|
1336
|
+
/* @__PURE__ */ t(et, { className: "text-[13px] leading-5", children: "Applies to every CSV downloaded or delivered from this dashboard. People can still change it for a single download." })
|
|
1337
1337
|
] }),
|
|
1338
1338
|
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
1339
|
-
/* @__PURE__ */ t(
|
|
1339
|
+
/* @__PURE__ */ t(Ha, { htmlFor: "dashboard-csv-encoding", className: ho, children: "CSV encoding" }),
|
|
1340
1340
|
/* @__PURE__ */ i(
|
|
1341
|
-
|
|
1341
|
+
qa,
|
|
1342
1342
|
{
|
|
1343
1343
|
value: a,
|
|
1344
1344
|
onValueChange: (o) => r({ csvEncoding: o }),
|
|
1345
1345
|
children: [
|
|
1346
|
-
/* @__PURE__ */ t(
|
|
1347
|
-
/* @__PURE__ */ t(
|
|
1346
|
+
/* @__PURE__ */ t(za, { id: "dashboard-csv-encoding", size: "sm", children: /* @__PURE__ */ t(Ka, {}) }),
|
|
1347
|
+
/* @__PURE__ */ t(Qa, { children: ra.map((o) => /* @__PURE__ */ t(Wa, { value: o.value, children: o.label }, o.value)) })
|
|
1348
1348
|
]
|
|
1349
1349
|
}
|
|
1350
1350
|
)
|
|
1351
1351
|
] })
|
|
1352
1352
|
] }) });
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1354
|
+
function fe(e, n, a) {
|
|
1355
1355
|
var c, m;
|
|
1356
1356
|
const r = (e.controls || []).find(
|
|
1357
1357
|
(p) => p.id === a
|
|
1358
1358
|
);
|
|
1359
1359
|
if (r)
|
|
1360
1360
|
return r.label;
|
|
1361
|
-
const o = (m = (c =
|
|
1361
|
+
const o = (m = (c = Te(e, n)) == null ? void 0 : c.controls) == null ? void 0 : m.find(
|
|
1362
1362
|
(p) => p.id === a
|
|
1363
1363
|
);
|
|
1364
1364
|
return (o == null ? void 0 : o.label) || a;
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1366
|
+
function be(e, n) {
|
|
1367
1367
|
var a;
|
|
1368
|
-
return ((a =
|
|
1368
|
+
return ((a = Te(e, n)) == null ? void 0 : a.title) || n;
|
|
1369
1369
|
}
|
|
1370
|
-
function
|
|
1370
|
+
function fo(e) {
|
|
1371
1371
|
const { errors: n, dashboard: a } = e;
|
|
1372
1372
|
if (!a)
|
|
1373
1373
|
return n;
|
|
@@ -1380,7 +1380,7 @@ function ho(e) {
|
|
|
1380
1380
|
const [, g, l] = c, u = `${g}:${l}:missing-metric`;
|
|
1381
1381
|
r.has(u) || r.set(
|
|
1382
1382
|
u,
|
|
1383
|
-
`"${
|
|
1383
|
+
`"${be(a, g)}" has an outdated "${fe(
|
|
1384
1384
|
a,
|
|
1385
1385
|
g,
|
|
1386
1386
|
l
|
|
@@ -1395,7 +1395,7 @@ function ho(e) {
|
|
|
1395
1395
|
const [, g, l] = m, u = `${g}:${l}:missing-group-by`;
|
|
1396
1396
|
r.has(u) || r.set(
|
|
1397
1397
|
u,
|
|
1398
|
-
`"${
|
|
1398
|
+
`"${be(a, g)}" has an outdated "${fe(
|
|
1399
1399
|
a,
|
|
1400
1400
|
g,
|
|
1401
1401
|
l
|
|
@@ -1410,7 +1410,7 @@ function ho(e) {
|
|
|
1410
1410
|
const [, g, l] = p, u = `${g}:${l}:invalid-metric`;
|
|
1411
1411
|
r.has(u) || r.set(
|
|
1412
1412
|
u,
|
|
1413
|
-
`"${
|
|
1413
|
+
`"${be(a, g)}" has an invalid "${fe(
|
|
1414
1414
|
a,
|
|
1415
1415
|
g,
|
|
1416
1416
|
l
|
|
@@ -1425,7 +1425,7 @@ function ho(e) {
|
|
|
1425
1425
|
const [, g, l] = b, u = `${g}:${l}:invalid-group-by`;
|
|
1426
1426
|
r.has(u) || r.set(
|
|
1427
1427
|
u,
|
|
1428
|
-
`"${
|
|
1428
|
+
`"${be(a, g)}" has an invalid "${fe(
|
|
1429
1429
|
a,
|
|
1430
1430
|
g,
|
|
1431
1431
|
l
|
|
@@ -1440,7 +1440,7 @@ function ho(e) {
|
|
|
1440
1440
|
const [, g, l] = f, u = `${g}:${l}:missing-temporal-group-by`;
|
|
1441
1441
|
r.has(u) || r.set(
|
|
1442
1442
|
u,
|
|
1443
|
-
`"${
|
|
1443
|
+
`"${be(a, g)}" can no longer use "${fe(
|
|
1444
1444
|
a,
|
|
1445
1445
|
g,
|
|
1446
1446
|
l
|
|
@@ -1452,16 +1452,16 @@ function ho(e) {
|
|
|
1452
1452
|
}
|
|
1453
1453
|
return Array.from(r.values());
|
|
1454
1454
|
}
|
|
1455
|
-
function
|
|
1455
|
+
function bo({
|
|
1456
1456
|
visible: e,
|
|
1457
1457
|
onSelect: n
|
|
1458
1458
|
}) {
|
|
1459
1459
|
return e ? /* @__PURE__ */ i(P, { onSelect: n, children: [
|
|
1460
|
-
/* @__PURE__ */ t(
|
|
1460
|
+
/* @__PURE__ */ t(aa, { className: "h-3.5 w-3.5" }),
|
|
1461
1461
|
"Schedule email report"
|
|
1462
1462
|
] }) : null;
|
|
1463
1463
|
}
|
|
1464
|
-
function
|
|
1464
|
+
function go({
|
|
1465
1465
|
scheduleReportVisible: e,
|
|
1466
1466
|
analyticalBriefingVisible: n,
|
|
1467
1467
|
onScheduleReport: a,
|
|
@@ -1469,7 +1469,7 @@ function fo({
|
|
|
1469
1469
|
}) {
|
|
1470
1470
|
return /* @__PURE__ */ i($, { children: [
|
|
1471
1471
|
/* @__PURE__ */ t(
|
|
1472
|
-
|
|
1472
|
+
bo,
|
|
1473
1473
|
{
|
|
1474
1474
|
visible: e,
|
|
1475
1475
|
onSelect: a
|
|
@@ -1481,14 +1481,14 @@ function fo({
|
|
|
1481
1481
|
] }) : null
|
|
1482
1482
|
] });
|
|
1483
1483
|
}
|
|
1484
|
-
function
|
|
1484
|
+
function xo(e) {
|
|
1485
1485
|
var f, g, l;
|
|
1486
|
-
const { saved: n, draft: a, usage: r } = e, o = [], c =
|
|
1486
|
+
const { saved: n, draft: a, usage: r } = e, o = [], c = bn(n);
|
|
1487
1487
|
for (const [u, s] of Object.entries(r.inputs))
|
|
1488
|
-
!s || !
|
|
1488
|
+
!s || !Rt(n, u) || Rt(a, u) || o.push({
|
|
1489
1489
|
target: "input",
|
|
1490
1490
|
id: u,
|
|
1491
|
-
label:
|
|
1491
|
+
label: gn(n, c, u),
|
|
1492
1492
|
bookmarks: s,
|
|
1493
1493
|
remembered: 0
|
|
1494
1494
|
});
|
|
@@ -1503,10 +1503,10 @@ function bo(e) {
|
|
|
1503
1503
|
remembered: 0
|
|
1504
1504
|
});
|
|
1505
1505
|
}
|
|
1506
|
-
const p =
|
|
1506
|
+
const p = Ut(n), b = Ut(a);
|
|
1507
1507
|
for (const [u, s] of Object.entries(r.tables)) {
|
|
1508
1508
|
if (!p.has(u)) continue;
|
|
1509
|
-
const x =
|
|
1509
|
+
const x = Te(n, u), v = ((g = x == null ? void 0 : x.title) == null ? void 0 : g.trim()) || "Untitled table";
|
|
1510
1510
|
if (!b.has(u)) {
|
|
1511
1511
|
o.push({
|
|
1512
1512
|
target: "table",
|
|
@@ -1517,12 +1517,12 @@ function bo(e) {
|
|
|
1517
1517
|
});
|
|
1518
1518
|
continue;
|
|
1519
1519
|
}
|
|
1520
|
-
const w = x ?
|
|
1520
|
+
const w = x ? Tt(x) : void 0, h = Te(a, u), E = h ? Tt(h) : void 0;
|
|
1521
1521
|
if (!(!x || !w || !E))
|
|
1522
1522
|
for (const [A, L] of Object.entries(s.columns)) {
|
|
1523
|
-
if (!(L.bookmarks || L.remembered) ||
|
|
1523
|
+
if (!(L.bookmarks || L.remembered) || yn(A) || !w.has(A) || E.has(A))
|
|
1524
1524
|
continue;
|
|
1525
|
-
const N =
|
|
1525
|
+
const N = wn(x, A), k = ((l = N == null ? void 0 : N.label) == null ? void 0 : l.trim()) || (N == null ? void 0 : N.name);
|
|
1526
1526
|
o.push({
|
|
1527
1527
|
target: "column",
|
|
1528
1528
|
id: A,
|
|
@@ -1535,49 +1535,49 @@ function bo(e) {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
return o;
|
|
1537
1537
|
}
|
|
1538
|
-
const
|
|
1539
|
-
function
|
|
1538
|
+
const vo = "dashboard-bookmark-usage";
|
|
1539
|
+
function yo(e) {
|
|
1540
1540
|
var b;
|
|
1541
|
-
const n = C((f) => f.viewerStateClient), a = (b = e.saved) == null ? void 0 : b.id, o =
|
|
1541
|
+
const n = C((f) => f.viewerStateClient), a = (b = e.saved) == null ? void 0 : b.id, o = na({
|
|
1542
1542
|
// Keyed by the viewer, never by the client object (TanStack drops functions when hashing).
|
|
1543
|
-
queryKey: [
|
|
1543
|
+
queryKey: [vo, (n == null ? void 0 : n.viewerKey) ?? null],
|
|
1544
1544
|
queryFn: () => n.bookmarks.usage(),
|
|
1545
1545
|
enabled: e.enabled && !!n && !!a,
|
|
1546
1546
|
staleTime: 5 * 6e4,
|
|
1547
1547
|
retry: !1
|
|
1548
1548
|
}).data, { saved: c, draft: m, enabled: p } = e;
|
|
1549
|
-
return
|
|
1549
|
+
return V(() => !p || !c || !o ? [] : !o.bookmarks && !Object.keys(o.tables).length ? [] : xo({ saved: c, draft: m, usage: o }), [m, p, c, o]);
|
|
1550
1550
|
}
|
|
1551
|
-
function
|
|
1551
|
+
function Vt(e, n, a) {
|
|
1552
1552
|
return `${e} ${e === 1 ? n : a}`;
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1554
|
+
function wo(e) {
|
|
1555
1555
|
const n = [
|
|
1556
|
-
e.bookmarks ?
|
|
1557
|
-
e.remembered ?
|
|
1556
|
+
e.bookmarks ? Vt(e.bookmarks, "bookmark", "bookmarks") : null,
|
|
1557
|
+
e.remembered ? Vt(e.remembered, "remembered layout", "remembered layouts") : null
|
|
1558
1558
|
].filter(Boolean).join(", ");
|
|
1559
1559
|
return e.target === "sheet" ? { name: `${e.label} sheet`, uses: n } : e.target === "table" ? { name: `${e.label} table`, uses: n } : { name: e.label, uses: n };
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1561
|
+
function No({
|
|
1562
1562
|
saved: e,
|
|
1563
1563
|
draft: n,
|
|
1564
1564
|
enabled: a
|
|
1565
1565
|
}) {
|
|
1566
|
-
const r =
|
|
1567
|
-
return r.length ? /* @__PURE__ */ i(
|
|
1568
|
-
/* @__PURE__ */ t(
|
|
1569
|
-
|
|
1566
|
+
const r = yo({ saved: e, draft: n, enabled: a });
|
|
1567
|
+
return r.length ? /* @__PURE__ */ i(Ya, { children: [
|
|
1568
|
+
/* @__PURE__ */ t(Ja, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1569
|
+
U,
|
|
1570
1570
|
{
|
|
1571
1571
|
variant: "ghost",
|
|
1572
1572
|
size: "xs",
|
|
1573
1573
|
className: "gap-1 text-muted-foreground hover:text-foreground",
|
|
1574
1574
|
children: [
|
|
1575
|
-
/* @__PURE__ */ t(
|
|
1575
|
+
/* @__PURE__ */ t(oa, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
1576
1576
|
"Affects saved views"
|
|
1577
1577
|
]
|
|
1578
1578
|
}
|
|
1579
1579
|
) }),
|
|
1580
|
-
/* @__PURE__ */ i(
|
|
1580
|
+
/* @__PURE__ */ i(Xa, { align: "end", className: "w-[320px] p-3 text-[12px]", children: [
|
|
1581
1581
|
/* @__PURE__ */ t("p", { className: "text-foreground", children: "This edit removes parts of the dashboard that viewers saved. Their views still open, with a note about what no longer applies." }),
|
|
1582
1582
|
/* @__PURE__ */ t(
|
|
1583
1583
|
"ul",
|
|
@@ -1585,7 +1585,7 @@ function yo({
|
|
|
1585
1585
|
"aria-label": "Affected saved views",
|
|
1586
1586
|
className: "mt-2 grid gap-1 border-t border-border/60 pt-2",
|
|
1587
1587
|
children: r.map((o) => {
|
|
1588
|
-
const { name: c, uses: m } =
|
|
1588
|
+
const { name: c, uses: m } = wo(o);
|
|
1589
1589
|
return /* @__PURE__ */ i(
|
|
1590
1590
|
"li",
|
|
1591
1591
|
{
|
|
@@ -1603,55 +1603,59 @@ function yo({
|
|
|
1603
1603
|
] })
|
|
1604
1604
|
] }) : null;
|
|
1605
1605
|
}
|
|
1606
|
-
function
|
|
1606
|
+
function jt(e, n) {
|
|
1607
1607
|
return {
|
|
1608
|
-
dashboard:
|
|
1609
|
-
semanticExecutionPayload:
|
|
1608
|
+
dashboard: rt(e),
|
|
1609
|
+
semanticExecutionPayload: rt(n)
|
|
1610
1610
|
};
|
|
1611
1611
|
}
|
|
1612
|
-
function
|
|
1613
|
-
var
|
|
1614
|
-
Xa(), Za();
|
|
1612
|
+
function Xo() {
|
|
1613
|
+
var vt, yt, wt, Nt, St;
|
|
1615
1614
|
const {
|
|
1616
1615
|
authToken: e,
|
|
1617
1616
|
tokenProps: n,
|
|
1618
1617
|
id: a,
|
|
1619
1618
|
showBriefings: r
|
|
1620
|
-
} =
|
|
1619
|
+
} = K(), o = sa(), { isLocalDev: c } = ia(), {
|
|
1621
1620
|
canEditDashboard: m,
|
|
1622
1621
|
hasInspectionUser: p,
|
|
1623
1622
|
inspectionMessage: b,
|
|
1624
1623
|
isInspectionMode: f,
|
|
1625
1624
|
isInspectionSurface: g
|
|
1626
|
-
} =
|
|
1625
|
+
} = da(), { openBrandStudioPreview: l } = ca(), { permissions: u } = $n(), s = la(), { isLoading: x } = ua(), v = C((d) => d.theme), w = C((d) => d.isDownloadingPdf), h = C((d) => d.dashboard), E = C((d) => d.selectedSheetId), A = (vt = h == null ? void 0 : h.sheets) == null ? void 0 : vt.find(
|
|
1627
1626
|
(d) => d.id === E
|
|
1628
|
-
), L =
|
|
1627
|
+
), L = Nn(A), N = L ? (yt = A == null ? void 0 : A.document) == null ? void 0 : yt.page : void 0, k = C(
|
|
1629
1628
|
(d) => d.isDashboardEditing
|
|
1630
|
-
), { setDashboardTitle: re } = C((d) => d.actions), [ae,
|
|
1631
|
-
|
|
1632
|
-
|
|
1629
|
+
), { setDashboardTitle: re } = C((d) => d.actions), [ae, Ne] = S(!1), [Q, W] = S(!1), [Y, J] = S(!1), [Se, ke] = S(!1), [ne, oe] = S(null), [se, ie] = S(null), { registerBriefingViewer: Ce } = ma();
|
|
1630
|
+
ge(
|
|
1631
|
+
() => Ce((d) => ie(d)),
|
|
1632
|
+
[Ce]
|
|
1633
|
+
);
|
|
1634
|
+
const [Ue, j] = S(!1), [y, R] = S(!1), [H, q] = S(null), [de, z] = S([]), [ce, De] = S(!1), [pr, ct] = S(!1), T = C((d) => d.isVisualEditing);
|
|
1635
|
+
kt((d) => d.card);
|
|
1636
|
+
const fr = Oe(
|
|
1633
1637
|
(d) => d.selectedDashboard
|
|
1634
|
-
),
|
|
1638
|
+
), br = Oe(
|
|
1635
1639
|
(d) => d.initialDashboard
|
|
1636
1640
|
);
|
|
1637
|
-
|
|
1638
|
-
const
|
|
1641
|
+
Oe((d) => d.selectedVisual), C((d) => d.selectedFrameId), kt((d) => d.frame);
|
|
1642
|
+
const lt = C(
|
|
1639
1643
|
(d) => d.showDashboardJSON
|
|
1640
1644
|
);
|
|
1641
1645
|
C((d) => d.onSaveFunction);
|
|
1642
|
-
const { setIsDashboardEditing:
|
|
1646
|
+
const { setIsDashboardEditing: ut, setShowDashboardJSON: mt } = C(
|
|
1643
1647
|
(d) => d.actions
|
|
1644
|
-
), { setInitialDashboard:
|
|
1648
|
+
), { setInitialDashboard: ht, clearSelectedDashboard: $e } = Oe(
|
|
1645
1649
|
(d) => d.actions
|
|
1646
|
-
),
|
|
1650
|
+
), le = !!n.orgUserId || !!(n.tenantId && n.endUserId && n.endUserEmail), { resources: Ee } = ha(We.DASHBOARD), { data: Be } = pa(), gr = ((wt = Be == null ? void 0 : Be.preference) == null ? void 0 : wt.defaultDashboardId) || null, { mutate: xr, isPending: vr } = fa(), { currentUser: yr } = nt(), wr = ba(yr), B = fr || br, G = ga({
|
|
1647
1651
|
config: n.config,
|
|
1648
|
-
canNavigateDashboardHub:
|
|
1649
|
-
canShareDashboard: ((
|
|
1650
|
-
canManageGroups:
|
|
1651
|
-
}),
|
|
1652
|
+
canNavigateDashboardHub: le,
|
|
1653
|
+
canShareDashboard: ((Nt = B == null ? void 0 : B.permissions) == null ? void 0 : Nt.canShare) === !0,
|
|
1654
|
+
canManageGroups: wr
|
|
1655
|
+
}), pt = B ? {
|
|
1652
1656
|
id: B.id,
|
|
1653
1657
|
title: (h == null ? void 0 : h.title) || B.title || "Dashboard"
|
|
1654
|
-
} : null, { handleAddNewFrame:
|
|
1658
|
+
} : null, { handleAddNewFrame: Nr } = xa(), [Fe, Ge] = S(!1), [Sr, ue] = S(!1), [Ve, Ie] = S("close"), me = va(We.DASHBOARD), [M, he] = S(null), kr = async (d, _) => {
|
|
1655
1659
|
if (!f) {
|
|
1656
1660
|
if (!(h != null && h.id)) {
|
|
1657
1661
|
console.log("No dashboard ID found");
|
|
@@ -1661,14 +1665,14 @@ function Yo() {
|
|
|
1661
1665
|
dashboardId: h.id,
|
|
1662
1666
|
newTitle: d,
|
|
1663
1667
|
previousTitle: _
|
|
1664
|
-
}),
|
|
1668
|
+
}), me.mutate(
|
|
1665
1669
|
{
|
|
1666
1670
|
resourceId: h.id,
|
|
1667
1671
|
data: { title: d }
|
|
1668
1672
|
},
|
|
1669
1673
|
{
|
|
1670
1674
|
onSuccess: () => {
|
|
1671
|
-
|
|
1675
|
+
he(
|
|
1672
1676
|
(O) => (O == null ? void 0 : O.dashboard.id) === h.id ? {
|
|
1673
1677
|
...O,
|
|
1674
1678
|
dashboard: { ...O.dashboard, title: d }
|
|
@@ -1684,19 +1688,19 @@ function Yo() {
|
|
|
1684
1688
|
);
|
|
1685
1689
|
}
|
|
1686
1690
|
};
|
|
1687
|
-
|
|
1688
|
-
if (
|
|
1691
|
+
ge(() => {
|
|
1692
|
+
if (Ee && Ee.length > 0) {
|
|
1689
1693
|
const d = h == null ? void 0 : h.id;
|
|
1690
1694
|
if (d) {
|
|
1691
|
-
const _ =
|
|
1695
|
+
const _ = Ee.find(
|
|
1692
1696
|
(O) => O.id === d
|
|
1693
1697
|
);
|
|
1694
|
-
_ &&
|
|
1698
|
+
_ && ht(_);
|
|
1695
1699
|
}
|
|
1696
1700
|
}
|
|
1697
|
-
}, [
|
|
1698
|
-
const
|
|
1699
|
-
() =>
|
|
1701
|
+
}, [Ee, h == null ? void 0 : h.id, ht]);
|
|
1702
|
+
const Cr = n.orgUserId || n.tenantId, je = V(
|
|
1703
|
+
() => So({
|
|
1700
1704
|
accessToken: e == null ? void 0 : e.accessToken,
|
|
1701
1705
|
dashboardId: (h == null ? void 0 : h.id) || a || n.dashboard_id,
|
|
1702
1706
|
selectedSheetId: L ? E : void 0,
|
|
@@ -1715,109 +1719,109 @@ function Yo() {
|
|
|
1715
1719
|
v,
|
|
1716
1720
|
n.dashboard_id
|
|
1717
1721
|
]
|
|
1718
|
-
),
|
|
1722
|
+
), He = k && !T && !f && Cr && m, { setDashboard: qe } = C((d) => d.actions), Dr = C(
|
|
1719
1723
|
(d) => d.semanticExecutionPayload
|
|
1720
|
-
),
|
|
1721
|
-
|
|
1722
|
-
},
|
|
1723
|
-
|
|
1724
|
+
), Er = () => {
|
|
1725
|
+
ut(!0);
|
|
1726
|
+
}, Ae = () => {
|
|
1727
|
+
ut(!1), mt(!1), he(null);
|
|
1724
1728
|
};
|
|
1725
|
-
|
|
1729
|
+
ge(() => {
|
|
1726
1730
|
if (!k) {
|
|
1727
|
-
M &&
|
|
1731
|
+
M && he(null);
|
|
1728
1732
|
return;
|
|
1729
1733
|
}
|
|
1730
1734
|
if (M || !h || x)
|
|
1731
1735
|
return;
|
|
1732
|
-
const d =
|
|
1733
|
-
|
|
1734
|
-
|
|
1736
|
+
const d = ya(C.getState());
|
|
1737
|
+
he(
|
|
1738
|
+
jt(d.dashboard, d.semanticExecutionPayload)
|
|
1735
1739
|
);
|
|
1736
1740
|
}, [
|
|
1737
1741
|
h,
|
|
1738
1742
|
M,
|
|
1739
1743
|
k,
|
|
1740
1744
|
x,
|
|
1741
|
-
|
|
1745
|
+
Dr
|
|
1742
1746
|
]);
|
|
1743
|
-
const
|
|
1747
|
+
const ze = (M == null ? void 0 : M.dashboard) ?? null, { isDirty: Ke, isDirtyPending: Ir, resetDirty: pe } = kn(
|
|
1744
1748
|
h,
|
|
1745
|
-
|
|
1749
|
+
ze,
|
|
1746
1750
|
300,
|
|
1747
1751
|
1e3,
|
|
1748
|
-
|
|
1749
|
-
),
|
|
1750
|
-
|
|
1752
|
+
Cn
|
|
1753
|
+
), ft = rn(
|
|
1754
|
+
ze,
|
|
1751
1755
|
f,
|
|
1752
1756
|
m
|
|
1753
|
-
),
|
|
1757
|
+
), bt = Ke || Ir, Le = Fe || me.isPending, Ar = () => {
|
|
1754
1758
|
if (f) {
|
|
1755
|
-
M &&
|
|
1759
|
+
M && qe(M.dashboard, {
|
|
1756
1760
|
semanticExecutionPayload: M.semanticExecutionPayload
|
|
1757
|
-
}),
|
|
1761
|
+
}), Ae(), pe();
|
|
1758
1762
|
return;
|
|
1759
1763
|
}
|
|
1760
|
-
|
|
1761
|
-
},
|
|
1762
|
-
await
|
|
1764
|
+
ft() ? (Ie("close"), ue(!0)) : (Ae(), pe());
|
|
1765
|
+
}, Lr = async () => {
|
|
1766
|
+
await Qe({
|
|
1763
1767
|
closeAfterSave: !0,
|
|
1764
|
-
navigateHomeAfterSave:
|
|
1768
|
+
navigateHomeAfterSave: Ve === "home"
|
|
1765
1769
|
});
|
|
1766
|
-
},
|
|
1767
|
-
const d =
|
|
1768
|
-
M &&
|
|
1770
|
+
}, Mr = () => {
|
|
1771
|
+
const d = Ve === "home" && !!le;
|
|
1772
|
+
M && qe(M.dashboard, {
|
|
1769
1773
|
semanticExecutionPayload: M.semanticExecutionPayload
|
|
1770
|
-
}),
|
|
1771
|
-
},
|
|
1772
|
-
M && (
|
|
1774
|
+
}), Ae(), d && $e(), Ie("close"), ue(!1), pe();
|
|
1775
|
+
}, Or = () => {
|
|
1776
|
+
M && (qe(M.dashboard, {
|
|
1773
1777
|
semanticExecutionPayload: M.semanticExecutionPayload
|
|
1774
|
-
}),
|
|
1775
|
-
},
|
|
1776
|
-
if (
|
|
1777
|
-
if (k &&
|
|
1778
|
-
|
|
1778
|
+
}), pe());
|
|
1779
|
+
}, _r = () => {
|
|
1780
|
+
if (le) {
|
|
1781
|
+
if (k && ft()) {
|
|
1782
|
+
Ie("home"), ue(!0);
|
|
1779
1783
|
return;
|
|
1780
1784
|
}
|
|
1781
|
-
|
|
1785
|
+
$e();
|
|
1782
1786
|
}
|
|
1783
1787
|
};
|
|
1784
|
-
async function
|
|
1788
|
+
async function Qe(d) {
|
|
1785
1789
|
if (f)
|
|
1786
1790
|
return;
|
|
1787
1791
|
const _ = C.getState().dashboard;
|
|
1788
1792
|
if (!_)
|
|
1789
1793
|
return;
|
|
1790
|
-
const O = (d == null ? void 0 : d.closeAfterSave) ??
|
|
1791
|
-
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1794
|
-
const
|
|
1794
|
+
const O = (d == null ? void 0 : d.closeAfterSave) ?? ce, Z = (d == null ? void 0 : d.navigateHomeAfterSave) ?? !1;
|
|
1795
|
+
De(O), O && ue(!1);
|
|
1796
|
+
const $r = rt(_);
|
|
1797
|
+
R(!0), q(null), z([]), Ge(!0);
|
|
1798
|
+
const Br = {
|
|
1795
1799
|
template: _
|
|
1796
1800
|
};
|
|
1797
|
-
|
|
1801
|
+
me.mutate(
|
|
1798
1802
|
{
|
|
1799
1803
|
resourceId: _.id,
|
|
1800
|
-
data:
|
|
1804
|
+
data: Br
|
|
1801
1805
|
},
|
|
1802
1806
|
{
|
|
1803
1807
|
onSuccess: () => {
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1808
|
+
Ge(!1), D.success("Dashboard saved!"), he(
|
|
1809
|
+
jt(
|
|
1810
|
+
$r,
|
|
1807
1811
|
C.getState().semanticExecutionPayload
|
|
1808
1812
|
)
|
|
1809
|
-
),
|
|
1813
|
+
), R(!1), De(!1), O && (Ae(), pe(), Z && le && $e()), Ie("close");
|
|
1810
1814
|
},
|
|
1811
|
-
onError: (
|
|
1812
|
-
|
|
1813
|
-
const
|
|
1814
|
-
|
|
1815
|
-
) ? (
|
|
1816
|
-
(
|
|
1815
|
+
onError: (Fr) => {
|
|
1816
|
+
Ge(!1), q("Failed to save dashboard. Please try again.");
|
|
1817
|
+
const Me = Fr.details, Gr = Array.isArray(
|
|
1818
|
+
Me == null ? void 0 : Me.errors
|
|
1819
|
+
) ? (Me.errors || []).filter(
|
|
1820
|
+
(Vr) => typeof Vr == "string"
|
|
1817
1821
|
) : [];
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
errors:
|
|
1822
|
+
z(
|
|
1823
|
+
fo({
|
|
1824
|
+
errors: Gr,
|
|
1821
1825
|
dashboard: _ || void 0
|
|
1822
1826
|
})
|
|
1823
1827
|
), D.error("Failed to save dashboard");
|
|
@@ -1825,39 +1829,39 @@ function Yo() {
|
|
|
1825
1829
|
}
|
|
1826
1830
|
);
|
|
1827
1831
|
}
|
|
1828
|
-
const
|
|
1829
|
-
|
|
1830
|
-
title:
|
|
1832
|
+
const gt = h.title;
|
|
1833
|
+
me.isPending && console.log("Title during update:", {
|
|
1834
|
+
title: gt,
|
|
1831
1835
|
dashboardStateTitle: h.title,
|
|
1832
1836
|
dashboardId: h == null ? void 0 : h.id
|
|
1833
1837
|
});
|
|
1834
|
-
const
|
|
1835
|
-
(
|
|
1838
|
+
const Pr = le && !!(e != null && e.accessToken) && !!(n != null && n.apiServiceUrl), Rr = !f && G.showDashboardHub && Pr, Tr = !f && s && G.showDashboardHub, F = (h == null ? void 0 : h.id) || null, xt = wa(
|
|
1839
|
+
(St = n.config) == null ? void 0 : St.showBriefings,
|
|
1836
1840
|
r
|
|
1837
|
-
), X = !!
|
|
1838
|
-
!
|
|
1839
|
-
dashboardId: X ? null :
|
|
1841
|
+
), X = !!F && gr === F, Ur = () => {
|
|
1842
|
+
!F || f || xr({
|
|
1843
|
+
dashboardId: X ? null : F
|
|
1840
1844
|
});
|
|
1841
1845
|
};
|
|
1842
|
-
return !s && !
|
|
1846
|
+
return !s && !T ? null : /* @__PURE__ */ i(
|
|
1843
1847
|
"div",
|
|
1844
1848
|
{
|
|
1845
1849
|
className: "flex min-h-11 shrink-0 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-1.5",
|
|
1846
1850
|
role: "dashboard-controls",
|
|
1847
1851
|
children: [
|
|
1848
1852
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1849
|
-
|
|
1850
|
-
|
|
1853
|
+
Tr && !T && /* @__PURE__ */ t(
|
|
1854
|
+
mn,
|
|
1851
1855
|
{
|
|
1852
1856
|
"aria-label": "Dashboard Hub",
|
|
1853
1857
|
tooltip: "Dashboard Hub",
|
|
1854
|
-
onClick:
|
|
1858
|
+
onClick: _r,
|
|
1855
1859
|
className: "h-7 w-7 px-0",
|
|
1856
1860
|
buttonProps: { size: "xs" },
|
|
1857
|
-
children: /* @__PURE__ */ t(
|
|
1861
|
+
children: /* @__PURE__ */ t(Na, { className: "h-3.5 w-3.5" })
|
|
1858
1862
|
}
|
|
1859
1863
|
),
|
|
1860
|
-
!
|
|
1864
|
+
!T && s && (x ? /* @__PURE__ */ t(
|
|
1861
1865
|
"div",
|
|
1862
1866
|
{
|
|
1863
1867
|
className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
|
|
@@ -1867,9 +1871,9 @@ function Yo() {
|
|
|
1867
1871
|
}
|
|
1868
1872
|
) : /* @__PURE__ */ i($, { children: [
|
|
1869
1873
|
/* @__PURE__ */ t(
|
|
1870
|
-
|
|
1874
|
+
Sa,
|
|
1871
1875
|
{
|
|
1872
|
-
value:
|
|
1876
|
+
value: gt || "Untitled Dashboard",
|
|
1873
1877
|
onSave: (d) => {
|
|
1874
1878
|
console.log("EditableText onSave called:", {
|
|
1875
1879
|
newTitle: d,
|
|
@@ -1877,19 +1881,19 @@ function Yo() {
|
|
|
1877
1881
|
dashboardId: h == null ? void 0 : h.id
|
|
1878
1882
|
});
|
|
1879
1883
|
const _ = (h == null ? void 0 : h.title) || "";
|
|
1880
|
-
re(d),
|
|
1884
|
+
re(d), kr(d, _);
|
|
1881
1885
|
},
|
|
1882
|
-
isEditable:
|
|
1886
|
+
isEditable: ka({
|
|
1883
1887
|
isDashboardEditing: k,
|
|
1884
1888
|
canEditDashboard: m === !0 && !f
|
|
1885
1889
|
}),
|
|
1886
1890
|
displayClassName: "text-[13px] font-medium",
|
|
1887
1891
|
inputClassName: "text-[13px] font-medium",
|
|
1888
1892
|
placeholder: "Dashboard Title",
|
|
1889
|
-
isPending:
|
|
1893
|
+
isPending: me.isPending
|
|
1890
1894
|
}
|
|
1891
1895
|
),
|
|
1892
|
-
|
|
1896
|
+
G.showDashboardHub && X && /* @__PURE__ */ t(
|
|
1893
1897
|
"span",
|
|
1894
1898
|
{
|
|
1895
1899
|
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",
|
|
@@ -1897,42 +1901,42 @@ function Yo() {
|
|
|
1897
1901
|
children: "Default"
|
|
1898
1902
|
}
|
|
1899
1903
|
),
|
|
1900
|
-
|
|
1901
|
-
/* @__PURE__ */ t(
|
|
1902
|
-
|
|
1904
|
+
Rr && F && /* @__PURE__ */ t(Lt, { children: /* @__PURE__ */ i(Mt, { children: [
|
|
1905
|
+
/* @__PURE__ */ t(Ot, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1906
|
+
U,
|
|
1903
1907
|
{
|
|
1904
1908
|
variant: "ghost",
|
|
1905
1909
|
size: "xs",
|
|
1906
|
-
onClick:
|
|
1907
|
-
disabled:
|
|
1908
|
-
className:
|
|
1910
|
+
onClick: Ur,
|
|
1911
|
+
disabled: vr || !(e != null && e.accessToken) || !(n != null && n.apiServiceUrl),
|
|
1912
|
+
className: xe(
|
|
1909
1913
|
"w-7 px-0",
|
|
1910
1914
|
X ? "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary focus-visible:bg-primary/15" : "text-muted-foreground hover:text-foreground"
|
|
1911
1915
|
),
|
|
1912
1916
|
"aria-pressed": X,
|
|
1913
1917
|
"aria-label": X ? "Remove as default dashboard" : "Set as default dashboard",
|
|
1914
|
-
children: /* @__PURE__ */ t(
|
|
1918
|
+
children: /* @__PURE__ */ t(Ca, { className: "h-3.5 w-3.5" })
|
|
1915
1919
|
}
|
|
1916
1920
|
) }),
|
|
1917
|
-
/* @__PURE__ */ t(
|
|
1921
|
+
/* @__PURE__ */ t(_t, { children: /* @__PURE__ */ t("p", { children: X ? "Remove as default dashboard" : "Set as default dashboard" }) })
|
|
1918
1922
|
] }) })
|
|
1919
1923
|
] }))
|
|
1920
1924
|
] }),
|
|
1921
1925
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1922
|
-
|
|
1923
|
-
/* @__PURE__ */ t(
|
|
1924
|
-
/* @__PURE__ */ t(
|
|
1926
|
+
T && /* @__PURE__ */ i($, { children: [
|
|
1927
|
+
/* @__PURE__ */ t(an, {}),
|
|
1928
|
+
/* @__PURE__ */ t(nn, {})
|
|
1925
1929
|
] }),
|
|
1926
|
-
s && !f && /* @__PURE__ */ t(
|
|
1927
|
-
!
|
|
1928
|
-
k && !
|
|
1930
|
+
s && !f && /* @__PURE__ */ t(hn, {}),
|
|
1931
|
+
!T && k && !f && u.canUseFilters && s && /* @__PURE__ */ t(on, {}),
|
|
1932
|
+
k && !T && !f && s && !L && /* @__PURE__ */ i("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
|
|
1929
1933
|
/* @__PURE__ */ i(
|
|
1930
|
-
|
|
1934
|
+
U,
|
|
1931
1935
|
{
|
|
1932
1936
|
variant: "ghost",
|
|
1933
1937
|
size: "xs",
|
|
1934
1938
|
disabled: !k,
|
|
1935
|
-
onClick: () => void
|
|
1939
|
+
onClick: () => void Nr(),
|
|
1936
1940
|
className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
|
|
1937
1941
|
children: [
|
|
1938
1942
|
/* @__PURE__ */ t(ee, { className: "h-3.5 w-3.5" }),
|
|
@@ -1940,24 +1944,24 @@ function Yo() {
|
|
|
1940
1944
|
]
|
|
1941
1945
|
}
|
|
1942
1946
|
),
|
|
1943
|
-
/* @__PURE__ */ i(
|
|
1944
|
-
/* @__PURE__ */ t(
|
|
1945
|
-
|
|
1947
|
+
/* @__PURE__ */ i(Ct, { modal: !1, children: [
|
|
1948
|
+
/* @__PURE__ */ t(Dt, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1949
|
+
U,
|
|
1946
1950
|
{
|
|
1947
1951
|
variant: "ghost",
|
|
1948
1952
|
size: "xs",
|
|
1949
1953
|
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
|
|
1950
1954
|
"aria-label": "Open visual options",
|
|
1951
1955
|
disabled: !k,
|
|
1952
|
-
children: /* @__PURE__ */ t(
|
|
1956
|
+
children: /* @__PURE__ */ t(en, { className: "h-3.5 w-3.5" })
|
|
1953
1957
|
}
|
|
1954
1958
|
) }),
|
|
1955
1959
|
/* @__PURE__ */ t(
|
|
1956
|
-
|
|
1960
|
+
Et,
|
|
1957
1961
|
{
|
|
1958
1962
|
align: "end",
|
|
1959
1963
|
className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
1960
|
-
children: /* @__PURE__ */ i(P, { onClick: () =>
|
|
1964
|
+
children: /* @__PURE__ */ i(P, { onClick: () => ct(!0), children: [
|
|
1961
1965
|
/* @__PURE__ */ t(ee, { className: "h-3.5 w-3.5" }),
|
|
1962
1966
|
"From library..."
|
|
1963
1967
|
] })
|
|
@@ -1965,105 +1969,105 @@ function Yo() {
|
|
|
1965
1969
|
)
|
|
1966
1970
|
] }),
|
|
1967
1971
|
/* @__PURE__ */ t(
|
|
1968
|
-
|
|
1972
|
+
sn,
|
|
1969
1973
|
{
|
|
1970
|
-
open:
|
|
1971
|
-
onOpenChange:
|
|
1974
|
+
open: pr,
|
|
1975
|
+
onOpenChange: ct
|
|
1972
1976
|
}
|
|
1973
1977
|
)
|
|
1974
1978
|
] }),
|
|
1975
|
-
!
|
|
1976
|
-
/* @__PURE__ */ i(
|
|
1977
|
-
/* @__PURE__ */ t(
|
|
1979
|
+
!T && !k && (m || f) && (!g || !p || m !== void 0) && s && /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-1", children: [
|
|
1980
|
+
/* @__PURE__ */ i(U, { size: "xs", onClick: Er, children: [
|
|
1981
|
+
/* @__PURE__ */ t(Da, { className: "h-3.5 w-3.5" }),
|
|
1978
1982
|
f ? "Inspect" : "Edit"
|
|
1979
1983
|
] }),
|
|
1980
|
-
b ? /* @__PURE__ */ t(
|
|
1981
|
-
/* @__PURE__ */ t(
|
|
1984
|
+
b ? /* @__PURE__ */ t(Lt, { children: /* @__PURE__ */ i(Mt, { children: [
|
|
1985
|
+
/* @__PURE__ */ t(Ot, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1982
1986
|
"button",
|
|
1983
1987
|
{
|
|
1984
1988
|
type: "button",
|
|
1985
1989
|
"aria-label": b,
|
|
1986
1990
|
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",
|
|
1987
|
-
children: /* @__PURE__ */ t(
|
|
1991
|
+
children: /* @__PURE__ */ t(Za, { "aria-hidden": "true", className: "size-3.5" })
|
|
1988
1992
|
}
|
|
1989
1993
|
) }),
|
|
1990
|
-
/* @__PURE__ */ t(
|
|
1994
|
+
/* @__PURE__ */ t(_t, { children: /* @__PURE__ */ t("p", { children: b }) })
|
|
1991
1995
|
] }) }) : null
|
|
1992
1996
|
] }),
|
|
1993
|
-
|
|
1994
|
-
|
|
1997
|
+
He && s && Ke && /* @__PURE__ */ t(
|
|
1998
|
+
No,
|
|
1995
1999
|
{
|
|
1996
|
-
saved:
|
|
2000
|
+
saved: ze,
|
|
1997
2001
|
draft: h,
|
|
1998
2002
|
enabled: k && !f
|
|
1999
2003
|
}
|
|
2000
2004
|
),
|
|
2001
|
-
|
|
2002
|
-
|
|
2005
|
+
He && s && Ke && /* @__PURE__ */ i(
|
|
2006
|
+
U,
|
|
2003
2007
|
{
|
|
2004
2008
|
variant: "outline",
|
|
2005
2009
|
size: "xs",
|
|
2006
|
-
onClick:
|
|
2007
|
-
disabled:
|
|
2010
|
+
onClick: Or,
|
|
2011
|
+
disabled: Le,
|
|
2008
2012
|
children: [
|
|
2009
|
-
/* @__PURE__ */ t(
|
|
2013
|
+
/* @__PURE__ */ t(Ea, { className: "h-3.5 w-3.5" }),
|
|
2010
2014
|
"Undo"
|
|
2011
2015
|
]
|
|
2012
2016
|
}
|
|
2013
2017
|
),
|
|
2014
|
-
|
|
2015
|
-
|
|
2018
|
+
He && s && /* @__PURE__ */ i(
|
|
2019
|
+
U,
|
|
2016
2020
|
{
|
|
2017
2021
|
size: "xs",
|
|
2018
|
-
className:
|
|
2019
|
-
disabled:
|
|
2020
|
-
onClick: () =>
|
|
2022
|
+
className: xe(!bt && "opacity-60"),
|
|
2023
|
+
disabled: Le || !bt,
|
|
2024
|
+
onClick: () => Qe(),
|
|
2021
2025
|
children: [
|
|
2022
|
-
|
|
2023
|
-
|
|
2026
|
+
Le ? /* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(Dn, { className: "h-3.5 w-3.5" }),
|
|
2027
|
+
Le ? "Saving..." : "Save"
|
|
2024
2028
|
]
|
|
2025
2029
|
}
|
|
2026
2030
|
),
|
|
2027
|
-
k && !
|
|
2028
|
-
/* @__PURE__ */ t(
|
|
2031
|
+
k && !T && s && /* @__PURE__ */ i(U, { variant: "outline", size: "xs", onClick: Ar, children: [
|
|
2032
|
+
/* @__PURE__ */ t(Ia, { className: "h-3.5 w-3.5" }),
|
|
2029
2033
|
"Close"
|
|
2030
2034
|
] }),
|
|
2031
|
-
!
|
|
2032
|
-
!
|
|
2033
|
-
!
|
|
2034
|
-
/* @__PURE__ */ t(
|
|
2035
|
-
|
|
2035
|
+
!T && s && /* @__PURE__ */ t("div", { className: "ml-2 flex items-center", children: /* @__PURE__ */ t(dn, {}) }),
|
|
2036
|
+
!T && c && /* @__PURE__ */ t(Un, {}),
|
|
2037
|
+
!T && s && !f && /* @__PURE__ */ i(Ct, { children: [
|
|
2038
|
+
/* @__PURE__ */ t(Dt, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2039
|
+
U,
|
|
2036
2040
|
{
|
|
2037
2041
|
variant: "ghost",
|
|
2038
2042
|
size: "xs",
|
|
2039
2043
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
2040
2044
|
"aria-label": "More dashboard options",
|
|
2041
|
-
children: /* @__PURE__ */ t(
|
|
2045
|
+
children: /* @__PURE__ */ t(Aa, { className: "h-3.5 w-3.5" })
|
|
2042
2046
|
}
|
|
2043
2047
|
) }),
|
|
2044
2048
|
/* @__PURE__ */ i(
|
|
2045
|
-
|
|
2049
|
+
Et,
|
|
2046
2050
|
{
|
|
2047
2051
|
align: "end",
|
|
2048
2052
|
className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
|
|
2049
2053
|
children: [
|
|
2050
|
-
/* @__PURE__ */ t(
|
|
2054
|
+
/* @__PURE__ */ t(_e, { children: "Reports & briefings" }),
|
|
2051
2055
|
/* @__PURE__ */ i(
|
|
2052
2056
|
P,
|
|
2053
2057
|
{
|
|
2054
2058
|
disabled: w,
|
|
2055
|
-
onSelect: () =>
|
|
2059
|
+
onSelect: () => j(!0),
|
|
2056
2060
|
children: [
|
|
2057
|
-
/* @__PURE__ */ t(
|
|
2061
|
+
/* @__PURE__ */ t(La, { className: "h-3.5 w-3.5" }),
|
|
2058
2062
|
"Export"
|
|
2059
2063
|
]
|
|
2060
2064
|
}
|
|
2061
2065
|
),
|
|
2062
2066
|
/* @__PURE__ */ t(
|
|
2063
|
-
|
|
2067
|
+
go,
|
|
2064
2068
|
{
|
|
2065
|
-
scheduleReportVisible: !!(
|
|
2066
|
-
analyticalBriefingVisible: !!(
|
|
2069
|
+
scheduleReportVisible: !!(xt && o.surfaceVisible && F && !k),
|
|
2070
|
+
analyticalBriefingVisible: !!(xt && o.surfaceVisible && F && !k),
|
|
2067
2071
|
onScheduleReport: () => oe("scheduled_report"),
|
|
2068
2072
|
onCreateAnalyticalBriefing: () => oe("analytical_briefing")
|
|
2069
2073
|
}
|
|
@@ -2071,40 +2075,40 @@ function Yo() {
|
|
|
2071
2075
|
k && /* @__PURE__ */ i(
|
|
2072
2076
|
P,
|
|
2073
2077
|
{
|
|
2074
|
-
onSelect: () =>
|
|
2078
|
+
onSelect: () => ke(!0),
|
|
2075
2079
|
children: [
|
|
2076
|
-
/* @__PURE__ */ t(
|
|
2080
|
+
/* @__PURE__ */ t(Ma, { className: "h-3.5 w-3.5" }),
|
|
2077
2081
|
"Download settings"
|
|
2078
2082
|
]
|
|
2079
2083
|
}
|
|
2080
2084
|
),
|
|
2081
|
-
/* @__PURE__ */ t(
|
|
2082
|
-
(
|
|
2083
|
-
/* @__PURE__ */ t(
|
|
2084
|
-
|
|
2085
|
-
/* @__PURE__ */ t(
|
|
2085
|
+
/* @__PURE__ */ t(Ye, {}),
|
|
2086
|
+
(G.showDashboardSharing || G.showGroupManagement) && /* @__PURE__ */ i($, { children: [
|
|
2087
|
+
/* @__PURE__ */ t(_e, { children: "Access" }),
|
|
2088
|
+
G.showDashboardSharing && /* @__PURE__ */ i(P, { onSelect: () => Ne(!0), children: [
|
|
2089
|
+
/* @__PURE__ */ t(Oa, { className: "h-3.5 w-3.5" }),
|
|
2086
2090
|
"Share"
|
|
2087
2091
|
] }),
|
|
2088
|
-
|
|
2092
|
+
G.showGroupManagement && /* @__PURE__ */ i(
|
|
2089
2093
|
P,
|
|
2090
2094
|
{
|
|
2091
|
-
onClick: () =>
|
|
2095
|
+
onClick: () => W(!0),
|
|
2092
2096
|
children: [
|
|
2093
|
-
/* @__PURE__ */ t(
|
|
2097
|
+
/* @__PURE__ */ t(Kt, { className: "h-3.5 w-3.5" }),
|
|
2094
2098
|
"Manage Groups"
|
|
2095
2099
|
]
|
|
2096
2100
|
}
|
|
2097
2101
|
),
|
|
2098
|
-
/* @__PURE__ */ t(
|
|
2102
|
+
/* @__PURE__ */ t(Ye, {})
|
|
2099
2103
|
] }),
|
|
2100
|
-
/* @__PURE__ */ t(
|
|
2101
|
-
/* @__PURE__ */ i(P, { onClick: () =>
|
|
2102
|
-
/* @__PURE__ */ t(
|
|
2104
|
+
/* @__PURE__ */ t(_e, { children: "Preferences" }),
|
|
2105
|
+
/* @__PURE__ */ i(P, { onClick: () => J(!0), children: [
|
|
2106
|
+
/* @__PURE__ */ t(Qt, { className: "h-3.5 w-3.5" }),
|
|
2103
2107
|
"Report preferences"
|
|
2104
2108
|
] }),
|
|
2105
2109
|
c && s && /* @__PURE__ */ i($, { children: [
|
|
2106
|
-
/* @__PURE__ */ t(
|
|
2107
|
-
/* @__PURE__ */ t(
|
|
2110
|
+
/* @__PURE__ */ t(Ye, {}),
|
|
2111
|
+
/* @__PURE__ */ t(_e, { children: "Developer" }),
|
|
2108
2112
|
/* @__PURE__ */ i(
|
|
2109
2113
|
P,
|
|
2110
2114
|
{
|
|
@@ -2115,7 +2119,7 @@ function Yo() {
|
|
|
2115
2119
|
).catch(() => D.error("Unable to copy token")) : D.error("Clipboard not available"));
|
|
2116
2120
|
},
|
|
2117
2121
|
children: [
|
|
2118
|
-
/* @__PURE__ */ t(
|
|
2122
|
+
/* @__PURE__ */ t(It, { className: "h-3.5 w-3.5" }),
|
|
2119
2123
|
"Copy token"
|
|
2120
2124
|
]
|
|
2121
2125
|
}
|
|
@@ -2123,16 +2127,16 @@ function Yo() {
|
|
|
2123
2127
|
L && /* @__PURE__ */ i(
|
|
2124
2128
|
P,
|
|
2125
2129
|
{
|
|
2126
|
-
disabled: !
|
|
2130
|
+
disabled: !je,
|
|
2127
2131
|
onSelect: () => {
|
|
2128
2132
|
var d;
|
|
2129
|
-
if (!
|
|
2133
|
+
if (!je) {
|
|
2130
2134
|
D.error(
|
|
2131
2135
|
"Open a document sheet with a token to copy the local PDF URL"
|
|
2132
2136
|
);
|
|
2133
2137
|
return;
|
|
2134
2138
|
}
|
|
2135
|
-
(d = navigator == null ? void 0 : navigator.clipboard) != null && d.writeText ? navigator.clipboard.writeText(
|
|
2139
|
+
(d = navigator == null ? void 0 : navigator.clipboard) != null && d.writeText ? navigator.clipboard.writeText(je).then(
|
|
2136
2140
|
() => D.success(
|
|
2137
2141
|
"Local document PDF URL copied to clipboard"
|
|
2138
2142
|
)
|
|
@@ -2143,7 +2147,7 @@ function Yo() {
|
|
|
2143
2147
|
) : D.error("Clipboard not available");
|
|
2144
2148
|
},
|
|
2145
2149
|
children: [
|
|
2146
|
-
/* @__PURE__ */ t(
|
|
2150
|
+
/* @__PURE__ */ t(It, { className: "h-3.5 w-3.5" }),
|
|
2147
2151
|
"Copy local document PDF URL"
|
|
2148
2152
|
]
|
|
2149
2153
|
}
|
|
@@ -2151,24 +2155,24 @@ function Yo() {
|
|
|
2151
2155
|
/* @__PURE__ */ i(
|
|
2152
2156
|
P,
|
|
2153
2157
|
{
|
|
2154
|
-
onSelect: () =>
|
|
2158
|
+
onSelect: () => cn(n.apiServiceUrl),
|
|
2155
2159
|
children: [
|
|
2156
|
-
/* @__PURE__ */ t(
|
|
2160
|
+
/* @__PURE__ */ t(Mn, { className: "h-3.5 w-3.5" }),
|
|
2157
2161
|
"Invalidate token"
|
|
2158
2162
|
]
|
|
2159
2163
|
}
|
|
2160
2164
|
),
|
|
2161
2165
|
/* @__PURE__ */ i(P, { onSelect: l, children: [
|
|
2162
|
-
/* @__PURE__ */ t(
|
|
2166
|
+
/* @__PURE__ */ t(En, { className: "h-3.5 w-3.5" }),
|
|
2163
2167
|
"Brand Studio"
|
|
2164
2168
|
] }),
|
|
2165
2169
|
k && /* @__PURE__ */ i(
|
|
2166
2170
|
P,
|
|
2167
2171
|
{
|
|
2168
|
-
onSelect: () =>
|
|
2172
|
+
onSelect: () => mt(!lt),
|
|
2169
2173
|
children: [
|
|
2170
|
-
/* @__PURE__ */ t(
|
|
2171
|
-
|
|
2174
|
+
/* @__PURE__ */ t(In, { className: "h-3.5 w-3.5" }),
|
|
2175
|
+
lt ? "Hide dashboard JSON" : "Show dashboard JSON"
|
|
2172
2176
|
]
|
|
2173
2177
|
}
|
|
2174
2178
|
)
|
|
@@ -2177,109 +2181,110 @@ function Yo() {
|
|
|
2177
2181
|
}
|
|
2178
2182
|
)
|
|
2179
2183
|
] }),
|
|
2180
|
-
ae &&
|
|
2181
|
-
|
|
2184
|
+
ae && pt && /* @__PURE__ */ t(
|
|
2185
|
+
_a,
|
|
2182
2186
|
{
|
|
2183
|
-
resource:
|
|
2184
|
-
resourceType:
|
|
2185
|
-
onClose: () =>
|
|
2187
|
+
resource: pt,
|
|
2188
|
+
resourceType: We.DASHBOARD,
|
|
2189
|
+
onClose: () => Ne(!1)
|
|
2186
2190
|
}
|
|
2187
2191
|
),
|
|
2188
|
-
|
|
2189
|
-
|
|
2192
|
+
G.showGroupManagement && /* @__PURE__ */ t(
|
|
2193
|
+
oo,
|
|
2190
2194
|
{
|
|
2191
|
-
open:
|
|
2192
|
-
onOpenChange:
|
|
2195
|
+
open: Q,
|
|
2196
|
+
onOpenChange: W
|
|
2193
2197
|
}
|
|
2194
2198
|
),
|
|
2195
2199
|
/* @__PURE__ */ t(
|
|
2196
|
-
|
|
2200
|
+
pn,
|
|
2197
2201
|
{
|
|
2198
|
-
open:
|
|
2199
|
-
onOpenChange:
|
|
2202
|
+
open: Y,
|
|
2203
|
+
onOpenChange: J
|
|
2200
2204
|
}
|
|
2201
2205
|
),
|
|
2202
2206
|
/* @__PURE__ */ t(
|
|
2203
|
-
|
|
2207
|
+
po,
|
|
2204
2208
|
{
|
|
2205
|
-
open:
|
|
2206
|
-
onOpenChange:
|
|
2209
|
+
open: Se,
|
|
2210
|
+
onOpenChange: ke
|
|
2207
2211
|
}
|
|
2208
2212
|
),
|
|
2209
|
-
|
|
2210
|
-
|
|
2213
|
+
F && (ne || se) ? /* @__PURE__ */ t(
|
|
2214
|
+
ln,
|
|
2211
2215
|
{
|
|
2212
|
-
dashboardId:
|
|
2216
|
+
dashboardId: F,
|
|
2213
2217
|
dashboardTitle: (h == null ? void 0 : h.title) || (B == null ? void 0 : B.title),
|
|
2214
2218
|
open: !0,
|
|
2215
2219
|
onOpenChange: (d) => {
|
|
2216
|
-
d || oe(null);
|
|
2220
|
+
d || (oe(null), ie(null));
|
|
2217
2221
|
},
|
|
2218
2222
|
hideTrigger: !0,
|
|
2219
|
-
workflowIntent: ne
|
|
2223
|
+
workflowIntent: ne ?? void 0,
|
|
2224
|
+
openRun: se ?? void 0
|
|
2220
2225
|
}
|
|
2221
2226
|
) : null,
|
|
2222
2227
|
s && /* @__PURE__ */ t(
|
|
2223
|
-
|
|
2228
|
+
Pa,
|
|
2224
2229
|
{
|
|
2225
|
-
open:
|
|
2226
|
-
onOpenChange:
|
|
2230
|
+
open: Ue,
|
|
2231
|
+
onOpenChange: j
|
|
2227
2232
|
}
|
|
2228
2233
|
),
|
|
2229
2234
|
/* @__PURE__ */ t(
|
|
2230
|
-
|
|
2235
|
+
Ra,
|
|
2231
2236
|
{
|
|
2232
|
-
open:
|
|
2237
|
+
open: y,
|
|
2233
2238
|
onOpenChange: (d) => {
|
|
2234
|
-
!d && Fe && !
|
|
2239
|
+
!d && Fe && !H || (R(d), d || (q(null), z([]), De(!1)));
|
|
2235
2240
|
},
|
|
2236
|
-
children: /* @__PURE__ */ i(
|
|
2237
|
-
/* @__PURE__ */ i(
|
|
2238
|
-
/* @__PURE__ */ t(
|
|
2239
|
-
/* @__PURE__ */ t(
|
|
2240
|
-
|
|
2241
|
+
children: /* @__PURE__ */ i(Ta, { className: "max-w-sm", children: [
|
|
2242
|
+
/* @__PURE__ */ i(Ua, { children: [
|
|
2243
|
+
/* @__PURE__ */ t($a, { children: H ? "Save failed" : "Saving dashboard" }),
|
|
2244
|
+
/* @__PURE__ */ t(Ba, { className: "pt-2", children: H ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
2245
|
+
de.length > 0 && /* @__PURE__ */ i("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
2241
2246
|
/* @__PURE__ */ t("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
2242
|
-
/* @__PURE__ */ t("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children:
|
|
2247
|
+
/* @__PURE__ */ t("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: de.slice(0, 5).map((d) => /* @__PURE__ */ t("li", { children: d }, d)) })
|
|
2243
2248
|
] })
|
|
2244
2249
|
] }),
|
|
2245
|
-
/* @__PURE__ */ t(
|
|
2250
|
+
/* @__PURE__ */ t(Fa, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: H ? /* @__PURE__ */ i($, { children: [
|
|
2246
2251
|
/* @__PURE__ */ t(
|
|
2247
|
-
|
|
2252
|
+
Ga,
|
|
2248
2253
|
{
|
|
2249
2254
|
onClick: () => {
|
|
2250
|
-
|
|
2255
|
+
R(!1), q(null), z([]), De(!1);
|
|
2251
2256
|
},
|
|
2252
2257
|
className: "m-0",
|
|
2253
2258
|
children: "Close"
|
|
2254
2259
|
}
|
|
2255
2260
|
),
|
|
2256
2261
|
/* @__PURE__ */ t(
|
|
2257
|
-
|
|
2262
|
+
At,
|
|
2258
2263
|
{
|
|
2259
|
-
onClick: () =>
|
|
2260
|
-
closeAfterSave:
|
|
2261
|
-
navigateHomeAfterSave:
|
|
2264
|
+
onClick: () => Qe({
|
|
2265
|
+
closeAfterSave: ce,
|
|
2266
|
+
navigateHomeAfterSave: Ve === "home"
|
|
2262
2267
|
}),
|
|
2263
2268
|
className: "m-0",
|
|
2264
2269
|
children: "Retry"
|
|
2265
2270
|
}
|
|
2266
2271
|
)
|
|
2267
|
-
] }) : /* @__PURE__ */ i(
|
|
2268
|
-
/* @__PURE__ */ t(
|
|
2272
|
+
] }) : /* @__PURE__ */ i(At, { disabled: !0, className: "m-0 cursor-default", children: [
|
|
2273
|
+
/* @__PURE__ */ t(Re, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2269
2274
|
"Saving..."
|
|
2270
2275
|
] }) })
|
|
2271
2276
|
] })
|
|
2272
2277
|
}
|
|
2273
2278
|
),
|
|
2274
2279
|
/* @__PURE__ */ t(
|
|
2275
|
-
|
|
2280
|
+
un,
|
|
2276
2281
|
{
|
|
2277
|
-
open:
|
|
2282
|
+
open: Sr,
|
|
2278
2283
|
onOpenChange: (d) => {
|
|
2279
|
-
|
|
2284
|
+
ue(d);
|
|
2280
2285
|
},
|
|
2281
|
-
onSave:
|
|
2282
|
-
onDiscard:
|
|
2286
|
+
onSave: Lr,
|
|
2287
|
+
onDiscard: Mr,
|
|
2283
2288
|
isSaving: Fe,
|
|
2284
2289
|
saveLabel: "Save",
|
|
2285
2290
|
discardLabel: "Discard changes"
|
|
@@ -2290,7 +2295,7 @@ function Yo() {
|
|
|
2290
2295
|
}
|
|
2291
2296
|
);
|
|
2292
2297
|
}
|
|
2293
|
-
function
|
|
2298
|
+
function So({
|
|
2294
2299
|
accessToken: e,
|
|
2295
2300
|
dashboardId: n,
|
|
2296
2301
|
selectedSheetId: a,
|
|
@@ -2306,5 +2311,5 @@ function wo({
|
|
|
2306
2311
|
return p.searchParams.set("pdfMode", "document"), p.searchParams.set("pageSize", r || "letter"), p.searchParams.set("orientation", o || "portrait"), p.searchParams.set("url", m.toString()), p.toString();
|
|
2307
2312
|
}
|
|
2308
2313
|
export {
|
|
2309
|
-
|
|
2314
|
+
Xo as default
|
|
2310
2315
|
};
|