react-semaphor 0.1.544 → 0.1.545
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/analytics-protocol/index.js +35 -34
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/briefings/index.js +50 -47
- package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
- package/dist/chunks/{apply-dashboard-operations-Bz4n1Lq6.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
- package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-D7sWTypJ.js} +308 -309
- package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
- package/dist/chunks/{comparison-window-caption-BTkrN3W4.js → comparison-window-caption-D4E6IHPD.js} +56 -55
- package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
- package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-B1tMju0u.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DQ_8O_e2.js → dashboard-briefing-launcher-CePgIu0Z.js} +771 -776
- package/dist/chunks/{dashboard-controls-8RyBTQUO.js → dashboard-controls-Cq05n3e0.js} +28 -28
- package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-CoYRPqxx.js} +3 -3
- package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
- package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-JPtNfJRb.js} +5624 -5615
- package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
- package/dist/chunks/{index-DkAyQvC6.js → index-DRWiuqyd.js} +378 -333
- package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DnCyRXJE.js} +13 -13
- package/dist/chunks/{numeric-presentation-DESvLiu9.js → numeric-presentation-7X_IrD58.js} +2571 -2572
- package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-C3mUgnEx.js} +1 -1
- package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
- package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
- package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-DUtuUL_5.js} +631 -603
- package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
- package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
- package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
- package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-BxF96Yhv.js} +45764 -46519
- package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-CNaM_Gmh.js} +885 -866
- package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
- package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-YzMioA7Y.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-CjB7ig1o.js} +105 -105
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +556 -544
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +163 -152
- package/dist/index.js +351 -323
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/attachments.d.ts +33 -6
- package/dist/types/briefings/index.d.ts +6 -5
- package/dist/types/components/surfboard/filter/types.d.ts +0 -14
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +35 -1
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
- package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
- package/dist/types/lib/download-pdf.d.ts +75 -1
- package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
- package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
- package/dist/types/lib/stores/dashboard-store.d.ts +39 -55
- package/dist/types/lib/stores/editor-store.d.ts +0 -3
- package/dist/types/lib/types/common-types.d.ts +21 -6
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +92 -0
- package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
- package/package.json +2 -2
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
- package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
- package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
- package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { jsx as t, jsxs as r, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { ae as
|
|
4
|
-
import { B as
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as r, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import At, { useState as k, useEffect as ge, useCallback as ae, useMemo as re, useLayoutEffect as Nt, useRef as rt, useContext as Kt } from "react";
|
|
3
|
+
import { ae as E, ar as Gt } from "./numeric-presentation-7X_IrD58.js";
|
|
4
|
+
import { B as L, l as De, q as nt, L as ne, j as Ft, c as st, i as Xt, P as Me, a as Re, b as Oe, S as It } from "./switch-uDtPgQlQ.js";
|
|
5
|
+
import { cv as ot, by as Ae, bz as Fe, bB as Ie, cw as Yt, cx as Zt, a_ as Et, aY as $e, cy as Jt, cz as We, cA as it, a0 as qe, Z as de, u as D, cB as ea, cC as ta, cD as aa, $ as ee, ba as ra, cE as na, cF as sa, aT as be, ck as Tt, aK as _e, o as oa, k as ia, cG as la, cn as lt, co as dt, cp as ct, cq as ut, cr as ht, cs as mt, ct as pt, cu as Vt, aI as ft, cH as da, cI as ca, cc as Je, c9 as Qe, ca as He, cJ as Lt, cb as Ke, bV as Y, cl as ua, cj as ze, cK as ha, bT as ma, bA as gt, bC as bt, cL as pa, bx as fa, cM as Bt, cN as xt, cO as ga, bZ as ba, i as xa, cP as va, cQ as ya, cR as G, cS as Ca, R as Pt, cT as wa, cU as Na, cV as Sa, cW as ka, aF as Da, cX as he, cY as Aa, P as vt, cZ as Fa, c_ as Ia, c$ as Ea, d0 as Ta, d1 as Va, d2 as La, d3 as Ba, d4 as Ut, d5 as Pa, d6 as Ua, d7 as Ma, d8 as Mt, d9 as Ra, da as Be, db as Oa, dc as _a, dd as za, A as ja, au as $a, av as Wa, aa as qa, a9 as Qa, a8 as Ha, a7 as Ka, a4 as Ga, a2 as Xa, de as Ya, df as Za, dg as Ja, dh as er, di as tr, as as ar } from "./semaphor-ready-indicator-BxF96Yhv.js";
|
|
6
6
|
import { L as yt } from "./layout-grid-Bgzth8vd.js";
|
|
7
|
-
import { c as xe, X as
|
|
7
|
+
import { c as xe, X as Ge, C as Rt } from "./x-4f5U2XwU.js";
|
|
8
8
|
import "./index-CuHybtft.js";
|
|
9
|
-
import { t as
|
|
9
|
+
import { t as rr } from "./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 { S as
|
|
14
|
+
import { c as J } from "./_commonjsHelpers-DimLPMtv.js";
|
|
15
|
+
import { S as nr } from "./selection-reducer-Dj_8xD69.js";
|
|
16
16
|
import { s as Pe } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
|
|
17
|
-
import { f as
|
|
18
|
-
import {
|
|
17
|
+
import { f as sr } from "./editor-draft-sync-BN5qYHPF.js";
|
|
18
|
+
import { ce as je, cf as or, cd as ir, bW as lr, a5 as dr, cg as cr, aX as ur } from "./resolve-dashboard-input-context-DJ2tICwz.js";
|
|
19
19
|
import "react-dom";
|
|
20
20
|
import "./pivot-result-lifecycle-DM4CyGKs.js";
|
|
21
|
-
import { F as
|
|
22
|
-
import { S as
|
|
23
|
-
import { V as
|
|
24
|
-
import { v as St } from "./custom-visual-inputs-
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { g as
|
|
21
|
+
import { F as hr } from "./table-settings-CLZocegs.js";
|
|
22
|
+
import { S as Ot } from "./save-CfJpQQ68.js";
|
|
23
|
+
import { V as mr, L as pr, a as fr, u as _t, C as zt, F as gr, b as br } from "./use-create-flow-overlay-state-CjB7ig1o.js";
|
|
24
|
+
import { v as St } from "./custom-visual-inputs-DLCD9Y5V.js";
|
|
25
|
+
import { q as kt } from "./matrix-formatter-DnCyRXJE.js";
|
|
26
|
+
import { g as xr, f as vr } from "./document-dashboard-inputs-BesAHZvB.js";
|
|
27
|
+
import { g as le, d as yr, a as Cr } from "./index-DRWiuqyd.js";
|
|
28
28
|
/**
|
|
29
29
|
* @license lucide-react v0.453.0 - ISC
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the ISC license.
|
|
32
32
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
33
|
*/
|
|
34
|
-
const
|
|
34
|
+
const wr = xe("ArrowUpRight", [
|
|
35
35
|
["path", { d: "M7 7h10v10", key: "1tivn9" }],
|
|
36
36
|
["path", { d: "M7 17 17 7", key: "1vkiza" }]
|
|
37
37
|
]);
|
|
@@ -41,7 +41,7 @@ const Nr = xe("ArrowUpRight", [
|
|
|
41
41
|
* This source code is licensed under the ISC license.
|
|
42
42
|
* See the LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
const
|
|
44
|
+
const Nr = xe("Bell", [
|
|
45
45
|
["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
|
|
46
46
|
["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }]
|
|
47
47
|
]);
|
|
@@ -51,7 +51,7 @@ const Sr = xe("Bell", [
|
|
|
51
51
|
* This source code is licensed under the ISC license.
|
|
52
52
|
* See the LICENSE file in the root directory of this source tree.
|
|
53
53
|
*/
|
|
54
|
-
const
|
|
54
|
+
const Sr = xe("CalendarRange", [
|
|
55
55
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
56
56
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
57
57
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
@@ -67,7 +67,7 @@ const kr = xe("CalendarRange", [
|
|
|
67
67
|
* This source code is licensed under the ISC license.
|
|
68
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
69
69
|
*/
|
|
70
|
-
const
|
|
70
|
+
const kr = xe("CodeXml", [
|
|
71
71
|
["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
|
|
72
72
|
["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
|
|
73
73
|
["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
|
|
@@ -78,7 +78,7 @@ const Dr = xe("CodeXml", [
|
|
|
78
78
|
* This source code is licensed under the ISC license.
|
|
79
79
|
* See the LICENSE file in the root directory of this source tree.
|
|
80
80
|
*/
|
|
81
|
-
const
|
|
81
|
+
const Dr = xe("MousePointer2", [
|
|
82
82
|
[
|
|
83
83
|
"path",
|
|
84
84
|
{
|
|
@@ -93,7 +93,7 @@ const Ar = xe("MousePointer2", [
|
|
|
93
93
|
* This source code is licensed under the ISC license.
|
|
94
94
|
* See the LICENSE file in the root directory of this source tree.
|
|
95
95
|
*/
|
|
96
|
-
const
|
|
96
|
+
const Ar = xe("Newspaper", [
|
|
97
97
|
[
|
|
98
98
|
"path",
|
|
99
99
|
{
|
|
@@ -105,7 +105,7 @@ const Fr = xe("Newspaper", [
|
|
|
105
105
|
["path", { d: "M15 18h-5", key: "95g1m2" }],
|
|
106
106
|
["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
|
|
107
107
|
]);
|
|
108
|
-
function
|
|
108
|
+
function Fr() {
|
|
109
109
|
return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((e, a) => /* @__PURE__ */ r(
|
|
110
110
|
"div",
|
|
111
111
|
{
|
|
@@ -121,7 +121,7 @@ function Ir() {
|
|
|
121
121
|
a
|
|
122
122
|
)) });
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Ir({
|
|
125
125
|
open: e,
|
|
126
126
|
onOpenChange: a,
|
|
127
127
|
onSubmit: o,
|
|
@@ -152,7 +152,7 @@ function Er({
|
|
|
152
152
|
] })
|
|
153
153
|
] }),
|
|
154
154
|
/* @__PURE__ */ t(
|
|
155
|
-
|
|
155
|
+
L,
|
|
156
156
|
{
|
|
157
157
|
size: "xs",
|
|
158
158
|
variant: "ghost",
|
|
@@ -160,7 +160,7 @@ function Er({
|
|
|
160
160
|
onClick: () => u(!1),
|
|
161
161
|
"aria-label": "Close",
|
|
162
162
|
disabled: s,
|
|
163
|
-
children: /* @__PURE__ */ t(
|
|
163
|
+
children: /* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5" })
|
|
164
164
|
}
|
|
165
165
|
)
|
|
166
166
|
] }),
|
|
@@ -200,7 +200,7 @@ function Er({
|
|
|
200
200
|
] }),
|
|
201
201
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
|
|
202
202
|
/* @__PURE__ */ t(
|
|
203
|
-
|
|
203
|
+
L,
|
|
204
204
|
{
|
|
205
205
|
size: "xs",
|
|
206
206
|
variant: "outline",
|
|
@@ -210,12 +210,12 @@ function Er({
|
|
|
210
210
|
}
|
|
211
211
|
),
|
|
212
212
|
/* @__PURE__ */ t(
|
|
213
|
-
|
|
213
|
+
L,
|
|
214
214
|
{
|
|
215
215
|
size: "xs",
|
|
216
216
|
onClick: h,
|
|
217
217
|
disabled: !n.trim() || s,
|
|
218
|
-
children: s ? /* @__PURE__ */ r(
|
|
218
|
+
children: s ? /* @__PURE__ */ r(_, { children: [
|
|
219
219
|
/* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
220
220
|
"Creating..."
|
|
221
221
|
] }) : "Create library visual"
|
|
@@ -226,8 +226,8 @@ function Er({
|
|
|
226
226
|
}
|
|
227
227
|
) });
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
const [a, o] = k(null), [s, i] = k(null), n =
|
|
229
|
+
function Er(e) {
|
|
230
|
+
const [a, o] = k(null), [s, i] = k(null), n = Yt();
|
|
231
231
|
return ge(() => {
|
|
232
232
|
if (!e || e.trim() === "") {
|
|
233
233
|
o(null), i(null);
|
|
@@ -293,13 +293,13 @@ function Tr(e, a) {
|
|
|
293
293
|
}
|
|
294
294
|
return e[0].id;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Vr(e, a) {
|
|
297
297
|
return a ? {
|
|
298
298
|
...e,
|
|
299
299
|
settings: a
|
|
300
300
|
} : e;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function Lr(e, a) {
|
|
303
303
|
const o = a.selectedConnectionId || e.connectionId || "";
|
|
304
304
|
if (!e.dataSource) {
|
|
305
305
|
if (!o)
|
|
@@ -324,7 +324,7 @@ function Br(e, a) {
|
|
|
324
324
|
connectionId: a.selectedConnectionId || e.dataSource.connectionId || e.connectionId || ""
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Br(e, {
|
|
328
328
|
isDevMode: a,
|
|
329
329
|
cardSql: o,
|
|
330
330
|
selectedSchemaName: s,
|
|
@@ -335,10 +335,10 @@ function Pr(e, {
|
|
|
335
335
|
remoteChartSettings: l,
|
|
336
336
|
stripConfig: h
|
|
337
337
|
}) {
|
|
338
|
-
const u = a ||
|
|
338
|
+
const u = a || Zt(e);
|
|
339
339
|
return {
|
|
340
340
|
...e,
|
|
341
|
-
dataSource:
|
|
341
|
+
dataSource: Lr(e, {
|
|
342
342
|
selectedConnectionId: c,
|
|
343
343
|
selectedDatabaseName: n,
|
|
344
344
|
selectedSchemaName: s,
|
|
@@ -354,13 +354,13 @@ function Pr(e, {
|
|
|
354
354
|
config: a || !e.config ? void 0 : h(e.config),
|
|
355
355
|
customCfg: e.customCfg,
|
|
356
356
|
preferences: e.preferences,
|
|
357
|
-
customCardPreferences:
|
|
357
|
+
customCardPreferences: Vr(
|
|
358
358
|
e.customCardPreferences,
|
|
359
359
|
l
|
|
360
360
|
)
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
const
|
|
363
|
+
const Pr = (e) => {
|
|
364
364
|
if (!e || !("detailTableBackup" in e))
|
|
365
365
|
return e;
|
|
366
366
|
const { detailTableBackup: a, ...o } = e;
|
|
@@ -373,7 +373,7 @@ async function Dt(e, a, o, s, i = "Opening library visual...") {
|
|
|
373
373
|
if (d)
|
|
374
374
|
return console.log("Using cached visual data for:", o), { data: d, fromCache: !0 };
|
|
375
375
|
console.log("Fetching visual data from network for:", o);
|
|
376
|
-
const c =
|
|
376
|
+
const c = E.loading(i, {
|
|
377
377
|
position: "top-center"
|
|
378
378
|
});
|
|
379
379
|
try {
|
|
@@ -388,12 +388,12 @@ async function Dt(e, a, o, s, i = "Opening library visual...") {
|
|
|
388
388
|
if (!l.ok)
|
|
389
389
|
throw new Error("Failed to load visual");
|
|
390
390
|
const h = await l.json();
|
|
391
|
-
return s.setQueryData(n, h),
|
|
391
|
+
return s.setQueryData(n, h), E.dismiss(c), { data: h, fromCache: !1 };
|
|
392
392
|
} catch (l) {
|
|
393
|
-
throw
|
|
393
|
+
throw E.dismiss(c), l;
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function jt(e) {
|
|
397
397
|
if (typeof e == "string")
|
|
398
398
|
return JSON.parse(e);
|
|
399
399
|
if (typeof e == "object")
|
|
@@ -405,29 +405,29 @@ function Ur(e, a) {
|
|
|
405
405
|
const o = (e == null ? void 0 : e.frameObject) ?? ((n = e == null ? void 0 : e.visual) == null ? void 0 : n.frameObject);
|
|
406
406
|
if (!o)
|
|
407
407
|
return !1;
|
|
408
|
-
const s =
|
|
408
|
+
const s = jt(o);
|
|
409
409
|
if (!(s != null && s.cards) || s.cards.length === 0)
|
|
410
410
|
return !1;
|
|
411
411
|
const i = (d = s.cards) == null ? void 0 : d.find(
|
|
412
412
|
(c) => c.id === s.activeCardId
|
|
413
413
|
);
|
|
414
|
-
return i ? (
|
|
414
|
+
return i ? (aa({
|
|
415
415
|
...a,
|
|
416
416
|
frame: s,
|
|
417
417
|
card: i,
|
|
418
418
|
visualId: (e == null ? void 0 : e.id) || s.visualId
|
|
419
419
|
}), !0) : !1;
|
|
420
420
|
}
|
|
421
|
-
function
|
|
422
|
-
const e =
|
|
421
|
+
function Mr() {
|
|
422
|
+
const e = ee(
|
|
423
423
|
(s) => {
|
|
424
424
|
var i;
|
|
425
425
|
return ((i = s.card.customCardPreferences) == null ? void 0 : i.url) || "";
|
|
426
426
|
}
|
|
427
|
-
), a =
|
|
427
|
+
), a = Er(e);
|
|
428
428
|
return { getUpdatedFrame: ae(() => {
|
|
429
429
|
var v;
|
|
430
|
-
|
|
430
|
+
sr();
|
|
431
431
|
const {
|
|
432
432
|
frame: s,
|
|
433
433
|
card: i,
|
|
@@ -437,7 +437,7 @@ function Rr() {
|
|
|
437
437
|
selectedDatabaseName: l,
|
|
438
438
|
selectedTableName: h,
|
|
439
439
|
selectedConnectionId: u
|
|
440
|
-
} =
|
|
440
|
+
} = ee.getState(), m = i.sql, p = (v = a == null ? void 0 : a.getState()) == null ? void 0 : v.settings, g = Br(i, {
|
|
441
441
|
isDevMode: n,
|
|
442
442
|
cardSql: m,
|
|
443
443
|
selectedSchemaName: d,
|
|
@@ -446,9 +446,9 @@ function Rr() {
|
|
|
446
446
|
selectedTableName: h,
|
|
447
447
|
selectedConnectionId: u,
|
|
448
448
|
remoteChartSettings: p,
|
|
449
|
-
stripConfig:
|
|
449
|
+
stripConfig: Pr
|
|
450
450
|
}), f = s.cards.map(
|
|
451
|
-
(
|
|
451
|
+
(N) => N.id === i.id ? g : N
|
|
452
452
|
);
|
|
453
453
|
return {
|
|
454
454
|
...s,
|
|
@@ -458,7 +458,7 @@ function Rr() {
|
|
|
458
458
|
}, [a]) };
|
|
459
459
|
}
|
|
460
460
|
function ve() {
|
|
461
|
-
const { authToken: e, tokenProps: a } =
|
|
461
|
+
const { authToken: e, tokenProps: a } = Et(), o = $e(), s = Jt(), i = We(), { selectVisual: n } = it(), {
|
|
462
462
|
setFrame: d,
|
|
463
463
|
setCard: c,
|
|
464
464
|
setIsDevMode: l,
|
|
@@ -469,33 +469,32 @@ function ve() {
|
|
|
469
469
|
setSelectedConnectionId: g,
|
|
470
470
|
setSelectedDatabaseName: f,
|
|
471
471
|
setSelectedSchemaName: v,
|
|
472
|
-
setSelectedTableName:
|
|
473
|
-
setSelectedDatamodelId:
|
|
474
|
-
setFilterValues: M,
|
|
472
|
+
setSelectedTableName: N,
|
|
473
|
+
setSelectedDatamodelId: T,
|
|
475
474
|
setInlineFilterValuesMap: U,
|
|
476
|
-
setApplyFilters:
|
|
477
|
-
clearEditorContext:
|
|
475
|
+
setApplyFilters: M,
|
|
476
|
+
clearEditorContext: A
|
|
478
477
|
} = qe(), {
|
|
479
|
-
setIsDashboardEditing:
|
|
480
|
-
setIsVisualEditing:
|
|
481
|
-
setSelectedFrameId:
|
|
482
|
-
clearSelectedFrameId:
|
|
483
|
-
} =
|
|
484
|
-
(
|
|
485
|
-
),
|
|
478
|
+
setIsDashboardEditing: O,
|
|
479
|
+
setIsVisualEditing: C,
|
|
480
|
+
setSelectedFrameId: w,
|
|
481
|
+
clearSelectedFrameId: x
|
|
482
|
+
} = de(), F = D((Q) => Q.selectedSheetId), S = D((Q) => Q.selectedFrameId), j = D((Q) => Q.dashboard), I = D(
|
|
483
|
+
(Q) => Q.inlineFilterValuesMap
|
|
484
|
+
), V = ea((i == null ? void 0 : i.id) || "", {
|
|
486
485
|
enabled: !!(i != null && i.id) && !!(e != null && e.accessToken)
|
|
487
|
-
}),
|
|
488
|
-
async (
|
|
486
|
+
}), Z = ae(
|
|
487
|
+
async (Q) => {
|
|
489
488
|
try {
|
|
490
|
-
n(
|
|
491
|
-
const { data:
|
|
489
|
+
n(Q), x(), A();
|
|
490
|
+
const { data: H, fromCache: ce } = await Dt(
|
|
492
491
|
a.apiServiceUrl,
|
|
493
492
|
(e == null ? void 0 : e.accessToken) || "",
|
|
494
|
-
|
|
493
|
+
Q.id,
|
|
495
494
|
o,
|
|
496
495
|
"Opening library visual..."
|
|
497
496
|
);
|
|
498
|
-
if (!Ur(
|
|
497
|
+
if (!Ur(H, {
|
|
499
498
|
setFrame: d,
|
|
500
499
|
setCard: c,
|
|
501
500
|
setIsDevMode: l,
|
|
@@ -506,23 +505,21 @@ function ve() {
|
|
|
506
505
|
setSelectedConnectionId: g,
|
|
507
506
|
setSelectedDatabaseName: f,
|
|
508
507
|
setSelectedSchemaName: v,
|
|
509
|
-
setSelectedTableName:
|
|
510
|
-
setSelectedDatamodelId:
|
|
511
|
-
setFilterValues: M,
|
|
508
|
+
setSelectedTableName: N,
|
|
509
|
+
setSelectedDatamodelId: T,
|
|
512
510
|
setInlineFilterValuesMap: U,
|
|
513
|
-
setApplyFilters:
|
|
514
|
-
setIsDashboardEditing:
|
|
515
|
-
setIsVisualEditing:
|
|
516
|
-
dashboard:
|
|
517
|
-
selectedSheetId:
|
|
518
|
-
selectedFrameId:
|
|
519
|
-
|
|
520
|
-
inlineFilterValuesMap: K
|
|
511
|
+
setApplyFilters: M,
|
|
512
|
+
setIsDashboardEditing: O,
|
|
513
|
+
setIsVisualEditing: C,
|
|
514
|
+
dashboard: j,
|
|
515
|
+
selectedSheetId: F,
|
|
516
|
+
selectedFrameId: S,
|
|
517
|
+
inlineFilterValuesMap: I
|
|
521
518
|
}))
|
|
522
519
|
throw new Error("Failed to setup editor with visual data");
|
|
523
|
-
return { success: !0, fromCache:
|
|
524
|
-
} catch (
|
|
525
|
-
return console.error("Error editing visual:",
|
|
520
|
+
return { success: !0, fromCache: ce };
|
|
521
|
+
} catch (H) {
|
|
522
|
+
return console.error("Error editing visual:", H), { success: !1, error: "Failed to load visual for editing" };
|
|
526
523
|
}
|
|
527
524
|
},
|
|
528
525
|
[
|
|
@@ -532,8 +529,8 @@ function ve() {
|
|
|
532
529
|
n,
|
|
533
530
|
d,
|
|
534
531
|
c,
|
|
532
|
+
O,
|
|
535
533
|
C,
|
|
536
|
-
N,
|
|
537
534
|
l,
|
|
538
535
|
h,
|
|
539
536
|
u,
|
|
@@ -542,51 +539,49 @@ function ve() {
|
|
|
542
539
|
g,
|
|
543
540
|
f,
|
|
544
541
|
v,
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
M,
|
|
542
|
+
N,
|
|
543
|
+
T,
|
|
548
544
|
U,
|
|
545
|
+
M,
|
|
549
546
|
A,
|
|
550
|
-
|
|
551
|
-
|
|
547
|
+
x,
|
|
548
|
+
j,
|
|
552
549
|
F,
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
R,
|
|
556
|
-
K
|
|
550
|
+
S,
|
|
551
|
+
I
|
|
557
552
|
]
|
|
558
|
-
),
|
|
559
|
-
async (
|
|
560
|
-
var
|
|
561
|
-
const
|
|
553
|
+
), K = ae(
|
|
554
|
+
async (Q) => {
|
|
555
|
+
var ce;
|
|
556
|
+
const H = (z) => (E.error(z), { success: !1, error: z });
|
|
562
557
|
try {
|
|
563
|
-
if (n(
|
|
564
|
-
return
|
|
565
|
-
const { data:
|
|
558
|
+
if (n(Q), !F)
|
|
559
|
+
return H("No sheet selected. Please select a sheet first.");
|
|
560
|
+
const { data: z, fromCache: ye } = await Dt(
|
|
566
561
|
a.apiServiceUrl,
|
|
567
562
|
(e == null ? void 0 : e.accessToken) || "",
|
|
568
|
-
|
|
563
|
+
Q.id,
|
|
569
564
|
o,
|
|
570
565
|
"Adding visual to dashboard..."
|
|
571
|
-
),
|
|
572
|
-
if (!
|
|
573
|
-
return
|
|
574
|
-
const
|
|
575
|
-
if (!(
|
|
576
|
-
return
|
|
577
|
-
const
|
|
578
|
-
...
|
|
579
|
-
visualId:
|
|
566
|
+
), X = (z == null ? void 0 : z.frameObject) ?? ((ce = z == null ? void 0 : z.visual) == null ? void 0 : ce.frameObject);
|
|
567
|
+
if (!X)
|
|
568
|
+
return H("Visual has no frame data");
|
|
569
|
+
const R = jt(X);
|
|
570
|
+
if (!(R != null && R.cards) || R.cards.length === 0)
|
|
571
|
+
return H("Visual frame is malformed");
|
|
572
|
+
const te = {
|
|
573
|
+
...ta(R),
|
|
574
|
+
visualId: Q.id
|
|
580
575
|
// Link this frame to the library visual
|
|
581
576
|
};
|
|
582
577
|
return await s(
|
|
583
|
-
|
|
584
|
-
|
|
578
|
+
F,
|
|
579
|
+
te,
|
|
585
580
|
"end"
|
|
586
|
-
),
|
|
587
|
-
} catch (
|
|
588
|
-
return console.error("Error adding visual:",
|
|
589
|
-
|
|
581
|
+
), O(!0), w(te.id), { success: !0, fromCache: ye };
|
|
582
|
+
} catch (z) {
|
|
583
|
+
return console.error("Error adding visual:", z), H(
|
|
584
|
+
z instanceof Error ? z.message : "Failed to add visual to dashboard"
|
|
590
585
|
);
|
|
591
586
|
}
|
|
592
587
|
},
|
|
@@ -595,51 +590,51 @@ function ve() {
|
|
|
595
590
|
a.apiServiceUrl,
|
|
596
591
|
o,
|
|
597
592
|
n,
|
|
593
|
+
F,
|
|
594
|
+
O,
|
|
598
595
|
w,
|
|
599
|
-
C,
|
|
600
|
-
x,
|
|
601
596
|
s
|
|
602
597
|
]
|
|
603
598
|
);
|
|
604
599
|
return {
|
|
605
|
-
visual:
|
|
606
|
-
isLoading:
|
|
607
|
-
isError:
|
|
608
|
-
error:
|
|
609
|
-
handleEditLibraryVisual:
|
|
610
|
-
handleAddLibraryVisual:
|
|
611
|
-
getUpdatedFrame:
|
|
612
|
-
refetch:
|
|
600
|
+
visual: V.data,
|
|
601
|
+
isLoading: V.isLoading,
|
|
602
|
+
isError: V.isError,
|
|
603
|
+
error: V.error,
|
|
604
|
+
handleEditLibraryVisual: Z,
|
|
605
|
+
handleAddLibraryVisual: K,
|
|
606
|
+
getUpdatedFrame: Mr().getUpdatedFrame,
|
|
607
|
+
refetch: V.refetch
|
|
613
608
|
};
|
|
614
609
|
}
|
|
615
|
-
function
|
|
610
|
+
function $t(e) {
|
|
616
611
|
return e ? new Date(e).toLocaleDateString("en-US", {
|
|
617
612
|
month: "short",
|
|
618
613
|
day: "numeric",
|
|
619
614
|
year: "numeric"
|
|
620
615
|
}) : "Unknown";
|
|
621
616
|
}
|
|
622
|
-
function
|
|
617
|
+
function Wt(e, a) {
|
|
623
618
|
var s;
|
|
624
619
|
const o = (s = e.ownership.createdBy) == null ? void 0 : s.type;
|
|
625
620
|
return o === "tenant" || o === "organization" && a;
|
|
626
621
|
}
|
|
627
622
|
function Ct(e, a) {
|
|
628
623
|
var o, s;
|
|
629
|
-
return
|
|
624
|
+
return Wt(e, a) ? ((o = e.ownership.createdBy) == null ? void 0 : o.name) || ((s = e.createdByTenantUserRel) == null ? void 0 : s.name) || e.lastModifiedBy || "Unknown" : "Organization";
|
|
630
625
|
}
|
|
631
|
-
function
|
|
626
|
+
function Rr(e, a) {
|
|
632
627
|
return Ct(e, a).split(/\s+/).filter(Boolean).slice(0, 2).map((s) => s.charAt(0).toUpperCase()).join("") || "?";
|
|
633
628
|
}
|
|
634
|
-
function
|
|
629
|
+
function Or(e) {
|
|
635
630
|
const a = (e || "").toLowerCase();
|
|
636
|
-
return a.includes("table") ?
|
|
631
|
+
return a.includes("table") ? Ft : a.includes("pie") || a.includes("donut") ? da : a.includes("line") ? ca : a.includes("bar") ? Xt : yt;
|
|
637
632
|
}
|
|
638
|
-
function
|
|
633
|
+
function _r({ visual: e }) {
|
|
639
634
|
const a = e.ownership.status === "public" ? "Public" : e.ownership.status === "shared" || e.ownership.sharedCount > 0 ? "Shared" : "Private";
|
|
640
635
|
return /* @__PURE__ */ t("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
|
|
641
636
|
}
|
|
642
|
-
function
|
|
637
|
+
function ns({
|
|
643
638
|
open: e,
|
|
644
639
|
onOpenChange: a
|
|
645
640
|
}) {
|
|
@@ -647,111 +642,111 @@ function ss({
|
|
|
647
642
|
null
|
|
648
643
|
), [m, p] = k(
|
|
649
644
|
null
|
|
650
|
-
), [g, f] = k(!1), [v,
|
|
651
|
-
d(/* @__PURE__ */ new Set()), u(null), p(null), f(!1),
|
|
645
|
+
), [g, f] = k(!1), [v, N] = k(null), [T, U] = k(null), M = () => {
|
|
646
|
+
d(/* @__PURE__ */ new Set()), u(null), p(null), f(!1), N(null);
|
|
652
647
|
}, A = () => {
|
|
653
|
-
a(!1),
|
|
654
|
-
}, { selectVisual: O } = it(), { handleAddLibraryVisual: C, handleEditLibraryVisual:
|
|
655
|
-
resources:
|
|
656
|
-
isLoading:
|
|
657
|
-
isError:
|
|
658
|
-
createResource:
|
|
659
|
-
updateResource:
|
|
660
|
-
deleteResourceAsync:
|
|
661
|
-
duplicateResource:
|
|
662
|
-
isCreating:
|
|
663
|
-
isDeleting:
|
|
664
|
-
} =
|
|
648
|
+
a(!1), M();
|
|
649
|
+
}, { selectVisual: O } = it(), { handleAddLibraryVisual: C, handleEditLibraryVisual: w } = ve(), { isConsoleMode: x } = ra(), {
|
|
650
|
+
resources: F,
|
|
651
|
+
isLoading: S,
|
|
652
|
+
isError: j,
|
|
653
|
+
createResource: I,
|
|
654
|
+
updateResource: V,
|
|
655
|
+
deleteResourceAsync: Z,
|
|
656
|
+
duplicateResource: K,
|
|
657
|
+
isCreating: Q,
|
|
658
|
+
isDeleting: H
|
|
659
|
+
} = na(
|
|
665
660
|
void 0,
|
|
666
661
|
(b) => {
|
|
667
|
-
l(!1), b && (O(b),
|
|
662
|
+
l(!1), b && (O(b), w(b), A());
|
|
668
663
|
}
|
|
669
664
|
), {
|
|
670
|
-
startUpdating:
|
|
671
|
-
stopUpdating:
|
|
672
|
-
isUpdating:
|
|
673
|
-
} =
|
|
665
|
+
startUpdating: ce,
|
|
666
|
+
stopUpdating: z,
|
|
667
|
+
isUpdating: ye
|
|
668
|
+
} = sa(), X = F, R = re(() => {
|
|
674
669
|
const b = s.trim().toLowerCase();
|
|
675
|
-
return b ?
|
|
670
|
+
return b ? X.filter(
|
|
676
671
|
(B) => {
|
|
677
|
-
var
|
|
678
|
-
return ((
|
|
672
|
+
var q, ie, ue;
|
|
673
|
+
return ((q = B.title) == null ? void 0 : q.toLowerCase().includes(b)) || ((ie = B.description) == null ? void 0 : ie.toLowerCase().includes(b)) || ((ue = B.kind) == null ? void 0 : ue.toLowerCase().includes(b));
|
|
679
674
|
}
|
|
680
|
-
) :
|
|
681
|
-
}, [s,
|
|
682
|
-
() =>
|
|
675
|
+
) : X;
|
|
676
|
+
}, [s, X]), te = re(
|
|
677
|
+
() => X.filter(
|
|
683
678
|
(b) => n.has(b.id)
|
|
684
679
|
),
|
|
685
|
-
[n,
|
|
686
|
-
),
|
|
680
|
+
[n, X]
|
|
681
|
+
), me = te.filter(
|
|
687
682
|
(b) => b.permissions.canDelete
|
|
688
|
-
),
|
|
683
|
+
), pe = te.filter(
|
|
689
684
|
(b) => b.permissions.canShare
|
|
690
|
-
), Ce =
|
|
685
|
+
), Ce = R.length > 0 && R.every(
|
|
691
686
|
(b) => n.has(b.id)
|
|
692
|
-
), Ee =
|
|
687
|
+
), Ee = R.some(
|
|
693
688
|
(b) => n.has(b.id)
|
|
694
|
-
),
|
|
689
|
+
), Xe = (b) => {
|
|
695
690
|
const B = new Set(n);
|
|
696
691
|
b(B), d(B);
|
|
697
|
-
},
|
|
698
|
-
|
|
692
|
+
}, $ = (b) => {
|
|
693
|
+
Xe((B) => {
|
|
699
694
|
B.has(b) ? B.delete(b) : B.add(b);
|
|
700
695
|
});
|
|
701
|
-
},
|
|
696
|
+
}, W = () => {
|
|
702
697
|
d((b) => {
|
|
703
698
|
const B = new Set(b);
|
|
704
|
-
return Ce ?
|
|
705
|
-
(
|
|
706
|
-
) :
|
|
707
|
-
(
|
|
699
|
+
return Ce ? R.forEach(
|
|
700
|
+
(q) => B.delete(q.id)
|
|
701
|
+
) : R.forEach(
|
|
702
|
+
(q) => B.add(q.id)
|
|
708
703
|
), B;
|
|
709
704
|
});
|
|
710
|
-
},
|
|
705
|
+
}, se = async (b) => {
|
|
711
706
|
(await C(b)).success && A();
|
|
712
707
|
}, we = async () => {
|
|
713
|
-
const b =
|
|
708
|
+
const b = te;
|
|
714
709
|
if (b.length === 0) return;
|
|
715
710
|
let B = !1;
|
|
716
|
-
for (const
|
|
717
|
-
if (!(await C(
|
|
711
|
+
for (const q of b)
|
|
712
|
+
if (!(await C(q)).success) {
|
|
718
713
|
B = !0;
|
|
719
714
|
break;
|
|
720
715
|
}
|
|
721
716
|
B || A();
|
|
722
|
-
},
|
|
723
|
-
|
|
717
|
+
}, Ye = (b) => {
|
|
718
|
+
w(b), A();
|
|
724
719
|
}, fe = (b) => {
|
|
725
|
-
|
|
726
|
-
onSettled: () =>
|
|
720
|
+
U(b), K(b, {
|
|
721
|
+
onSettled: () => U(null)
|
|
727
722
|
});
|
|
728
|
-
},
|
|
729
|
-
if (
|
|
730
|
-
|
|
723
|
+
}, Te = () => {
|
|
724
|
+
if (me.length === 0) {
|
|
725
|
+
E.error("Select a visual you can delete");
|
|
731
726
|
return;
|
|
732
727
|
}
|
|
733
|
-
|
|
728
|
+
N(null), f(!0);
|
|
734
729
|
}, Ze = async () => {
|
|
735
|
-
const b = v ? [v] :
|
|
730
|
+
const b = v ? [v] : me;
|
|
736
731
|
try {
|
|
737
732
|
for (const B of b)
|
|
738
|
-
await
|
|
733
|
+
await Z(B.id);
|
|
739
734
|
d((B) => {
|
|
740
|
-
const
|
|
735
|
+
const q = new Set(B);
|
|
741
736
|
return b.forEach(
|
|
742
|
-
(
|
|
743
|
-
),
|
|
744
|
-
}), f(!1),
|
|
737
|
+
(ie) => q.delete(ie.id)
|
|
738
|
+
), q;
|
|
739
|
+
}), f(!1), N(null);
|
|
745
740
|
} catch {
|
|
746
741
|
}
|
|
747
742
|
}, Ne = () => {
|
|
748
|
-
if (
|
|
749
|
-
|
|
743
|
+
if (te.length !== 1) {
|
|
744
|
+
E.error("Select one visual to share");
|
|
750
745
|
return;
|
|
751
746
|
}
|
|
752
|
-
const [b] =
|
|
747
|
+
const [b] = te;
|
|
753
748
|
if (!b.permissions.canShare) {
|
|
754
|
-
|
|
749
|
+
E.error("You do not have permission to share this visual");
|
|
755
750
|
return;
|
|
756
751
|
}
|
|
757
752
|
u(b);
|
|
@@ -760,31 +755,31 @@ function ss({
|
|
|
760
755
|
description: B
|
|
761
756
|
}) => {
|
|
762
757
|
if (!m) return;
|
|
763
|
-
const
|
|
764
|
-
if (b !== m.title && (
|
|
758
|
+
const q = {};
|
|
759
|
+
if (b !== m.title && (q.title = b), (m.description || "") !== B && (q.description = B), Object.keys(q).length === 0) {
|
|
765
760
|
p(null);
|
|
766
761
|
return;
|
|
767
762
|
}
|
|
768
|
-
const
|
|
769
|
-
|
|
763
|
+
const ie = Object.keys(q), ue = ie.length === 1 ? ie[0] : void 0;
|
|
764
|
+
ce(m.id, ue), V(
|
|
770
765
|
{
|
|
771
766
|
resourceId: m.id,
|
|
772
|
-
data:
|
|
767
|
+
data: q
|
|
773
768
|
},
|
|
774
769
|
{
|
|
775
770
|
onSuccess: () => {
|
|
776
|
-
|
|
771
|
+
z(m.id, ue), p(null);
|
|
777
772
|
},
|
|
778
773
|
onError: () => {
|
|
779
|
-
|
|
774
|
+
z(m.id, ue);
|
|
780
775
|
}
|
|
781
776
|
}
|
|
782
777
|
);
|
|
783
|
-
},
|
|
784
|
-
a(b), b ||
|
|
785
|
-
}, ke = v ? 1 :
|
|
786
|
-
return /* @__PURE__ */ r(
|
|
787
|
-
/* @__PURE__ */ t(Ae, { open: e, onOpenChange:
|
|
778
|
+
}, oe = (b) => {
|
|
779
|
+
a(b), b || M();
|
|
780
|
+
}, ke = v ? 1 : me.length;
|
|
781
|
+
return /* @__PURE__ */ r(_, { children: [
|
|
782
|
+
/* @__PURE__ */ t(Ae, { open: e, onOpenChange: oe, children: /* @__PURE__ */ r(
|
|
788
783
|
Fe,
|
|
789
784
|
{
|
|
790
785
|
showCloseButton: !1,
|
|
@@ -793,19 +788,19 @@ function ss({
|
|
|
793
788
|
children: [
|
|
794
789
|
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
795
790
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
796
|
-
/* @__PURE__ */ t(
|
|
791
|
+
/* @__PURE__ */ t(Ft, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
797
792
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
798
793
|
/* @__PURE__ */ t(Ie, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
|
|
799
794
|
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
|
|
800
795
|
] })
|
|
801
796
|
] }),
|
|
802
797
|
/* @__PURE__ */ t(
|
|
803
|
-
|
|
798
|
+
L,
|
|
804
799
|
{
|
|
805
800
|
size: "xs",
|
|
806
801
|
variant: "ghost",
|
|
807
802
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
808
|
-
onClick: () =>
|
|
803
|
+
onClick: () => oe(!1),
|
|
809
804
|
"aria-label": "Close visuals library",
|
|
810
805
|
children: "×"
|
|
811
806
|
}
|
|
@@ -813,7 +808,7 @@ function ss({
|
|
|
813
808
|
] }),
|
|
814
809
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
|
|
815
810
|
/* @__PURE__ */ r("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
|
|
816
|
-
/* @__PURE__ */ t(
|
|
811
|
+
/* @__PURE__ */ t(nr, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
817
812
|
/* @__PURE__ */ t(
|
|
818
813
|
"input",
|
|
819
814
|
{
|
|
@@ -827,7 +822,7 @@ function ss({
|
|
|
827
822
|
)
|
|
828
823
|
] }),
|
|
829
824
|
/* @__PURE__ */ r(
|
|
830
|
-
|
|
825
|
+
L,
|
|
831
826
|
{
|
|
832
827
|
size: "xs",
|
|
833
828
|
variant: "outline",
|
|
@@ -840,41 +835,41 @@ function ss({
|
|
|
840
835
|
}
|
|
841
836
|
)
|
|
842
837
|
] }),
|
|
843
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children:
|
|
838
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: S ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(Fr, {}) }) : j ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ t("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : R.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
844
839
|
/* @__PURE__ */ t(yt, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
845
840
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: s ? "No visuals found" : "No visuals yet" }),
|
|
846
841
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: s ? "Try a different search." : "Create a saved visual to add it here." })
|
|
847
842
|
] }) : /* @__PURE__ */ t(
|
|
848
|
-
|
|
843
|
+
zr,
|
|
849
844
|
{
|
|
850
|
-
visuals:
|
|
845
|
+
visuals: R,
|
|
851
846
|
selectedIds: n,
|
|
852
847
|
allFilteredSelected: Ce,
|
|
853
848
|
someFilteredSelected: Ee,
|
|
854
|
-
onSelectAll:
|
|
855
|
-
onToggleSelection:
|
|
856
|
-
onAddVisual:
|
|
857
|
-
onOpenVisual:
|
|
849
|
+
onSelectAll: W,
|
|
850
|
+
onToggleSelection: $,
|
|
851
|
+
onAddVisual: se,
|
|
852
|
+
onOpenVisual: Ye,
|
|
858
853
|
onEditDetails: p,
|
|
859
854
|
onShareVisual: u,
|
|
860
855
|
onDeleteVisual: (b) => {
|
|
861
|
-
|
|
856
|
+
N(b), f(!0);
|
|
862
857
|
},
|
|
863
858
|
onDuplicateVisual: fe,
|
|
864
|
-
duplicatingId:
|
|
865
|
-
isDeleting:
|
|
859
|
+
duplicatingId: T,
|
|
860
|
+
isDeleting: H,
|
|
866
861
|
isConsoleMode: x
|
|
867
862
|
}
|
|
868
863
|
) }),
|
|
869
864
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
|
|
870
|
-
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: n.size > 0 && /* @__PURE__ */ r(
|
|
865
|
+
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: n.size > 0 && /* @__PURE__ */ r(_, { children: [
|
|
871
866
|
/* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
872
867
|
/* @__PURE__ */ t("span", { className: "font-medium tabular-nums text-foreground", children: n.size }),
|
|
873
868
|
" ",
|
|
874
869
|
"selected"
|
|
875
870
|
] }),
|
|
876
871
|
/* @__PURE__ */ t(
|
|
877
|
-
|
|
872
|
+
L,
|
|
878
873
|
{
|
|
879
874
|
size: "xs",
|
|
880
875
|
variant: "ghost",
|
|
@@ -883,12 +878,12 @@ function ss({
|
|
|
883
878
|
}
|
|
884
879
|
),
|
|
885
880
|
/* @__PURE__ */ r(
|
|
886
|
-
|
|
881
|
+
L,
|
|
887
882
|
{
|
|
888
883
|
size: "xs",
|
|
889
884
|
variant: "outline",
|
|
890
885
|
onClick: Ne,
|
|
891
|
-
disabled:
|
|
886
|
+
disabled: te.length !== 1 || pe.length !== 1,
|
|
892
887
|
children: [
|
|
893
888
|
/* @__PURE__ */ t(Tt, { className: "h-3.5 w-3.5" }),
|
|
894
889
|
"Share"
|
|
@@ -896,33 +891,33 @@ function ss({
|
|
|
896
891
|
}
|
|
897
892
|
),
|
|
898
893
|
/* @__PURE__ */ r(
|
|
899
|
-
|
|
894
|
+
L,
|
|
900
895
|
{
|
|
901
896
|
size: "xs",
|
|
902
897
|
variant: "outline",
|
|
903
898
|
className: "text-destructive hover:text-destructive",
|
|
904
|
-
onClick:
|
|
905
|
-
disabled:
|
|
899
|
+
onClick: Te,
|
|
900
|
+
disabled: me.length === 0,
|
|
906
901
|
children: [
|
|
907
902
|
/* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5" }),
|
|
908
903
|
"Delete ",
|
|
909
|
-
|
|
904
|
+
me.length || n.size
|
|
910
905
|
]
|
|
911
906
|
}
|
|
912
907
|
)
|
|
913
908
|
] }) }),
|
|
914
909
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
915
910
|
/* @__PURE__ */ t(
|
|
916
|
-
|
|
911
|
+
L,
|
|
917
912
|
{
|
|
918
913
|
size: "xs",
|
|
919
914
|
variant: "outline",
|
|
920
|
-
onClick: () =>
|
|
915
|
+
onClick: () => oe(!1),
|
|
921
916
|
children: "Close"
|
|
922
917
|
}
|
|
923
918
|
),
|
|
924
919
|
/* @__PURE__ */ r(
|
|
925
|
-
|
|
920
|
+
L,
|
|
926
921
|
{
|
|
927
922
|
size: "xs",
|
|
928
923
|
onClick: we,
|
|
@@ -939,24 +934,24 @@ function ss({
|
|
|
939
934
|
}
|
|
940
935
|
) }),
|
|
941
936
|
/* @__PURE__ */ t(
|
|
942
|
-
|
|
937
|
+
Ir,
|
|
943
938
|
{
|
|
944
939
|
open: c,
|
|
945
940
|
onOpenChange: l,
|
|
946
|
-
onSubmit:
|
|
947
|
-
isCreating:
|
|
941
|
+
onSubmit: I,
|
|
942
|
+
isCreating: Q
|
|
948
943
|
}
|
|
949
944
|
),
|
|
950
945
|
h && /* @__PURE__ */ t(
|
|
951
|
-
|
|
946
|
+
oa,
|
|
952
947
|
{
|
|
953
948
|
resource: h,
|
|
954
|
-
resourceType:
|
|
949
|
+
resourceType: ia.VISUAL,
|
|
955
950
|
onClose: () => u(null)
|
|
956
951
|
}
|
|
957
952
|
),
|
|
958
953
|
m && /* @__PURE__ */ t(
|
|
959
|
-
|
|
954
|
+
la,
|
|
960
955
|
{
|
|
961
956
|
open: !!m,
|
|
962
957
|
resourceLabel: "Visual",
|
|
@@ -964,7 +959,7 @@ function ss({
|
|
|
964
959
|
initialDescription: m.description || "",
|
|
965
960
|
onClose: () => p(null),
|
|
966
961
|
onSave: Se,
|
|
967
|
-
isSaving:
|
|
962
|
+
isSaving: ye(m.id)
|
|
968
963
|
}
|
|
969
964
|
),
|
|
970
965
|
/* @__PURE__ */ t(
|
|
@@ -972,7 +967,7 @@ function ss({
|
|
|
972
967
|
{
|
|
973
968
|
open: g,
|
|
974
969
|
onOpenChange: (b) => {
|
|
975
|
-
!b &&
|
|
970
|
+
!b && H || (f(b), b || N(null));
|
|
976
971
|
},
|
|
977
972
|
children: /* @__PURE__ */ r(dt, { children: [
|
|
978
973
|
/* @__PURE__ */ r(ct, { children: [
|
|
@@ -986,17 +981,17 @@ function ss({
|
|
|
986
981
|
/* @__PURE__ */ t(ht, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
987
982
|
] }),
|
|
988
983
|
/* @__PURE__ */ r(mt, { children: [
|
|
989
|
-
/* @__PURE__ */ t(pt, { disabled:
|
|
984
|
+
/* @__PURE__ */ t(pt, { disabled: H, children: "Cancel" }),
|
|
990
985
|
/* @__PURE__ */ r(
|
|
991
|
-
|
|
986
|
+
Vt,
|
|
992
987
|
{
|
|
993
988
|
onClick: (b) => {
|
|
994
989
|
b.preventDefault(), Ze();
|
|
995
990
|
},
|
|
996
|
-
disabled:
|
|
991
|
+
disabled: H || ke === 0,
|
|
997
992
|
children: [
|
|
998
|
-
|
|
999
|
-
|
|
993
|
+
H ? /* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5" }),
|
|
994
|
+
H ? "Deleting..." : "Delete"
|
|
1000
995
|
]
|
|
1001
996
|
}
|
|
1002
997
|
)
|
|
@@ -1006,7 +1001,7 @@ function ss({
|
|
|
1006
1001
|
)
|
|
1007
1002
|
] });
|
|
1008
1003
|
}
|
|
1009
|
-
function
|
|
1004
|
+
function zr({
|
|
1010
1005
|
visuals: e,
|
|
1011
1006
|
selectedIds: a,
|
|
1012
1007
|
allFilteredSelected: o,
|
|
@@ -1041,7 +1036,7 @@ function jr({
|
|
|
1041
1036
|
/* @__PURE__ */ t("span", { className: "text-right", children: "Actions" })
|
|
1042
1037
|
] }),
|
|
1043
1038
|
e.map((v) => /* @__PURE__ */ t(
|
|
1044
|
-
|
|
1039
|
+
jr,
|
|
1045
1040
|
{
|
|
1046
1041
|
visual: v,
|
|
1047
1042
|
selected: a.has(v.id),
|
|
@@ -1060,7 +1055,7 @@ function jr({
|
|
|
1060
1055
|
))
|
|
1061
1056
|
] });
|
|
1062
1057
|
}
|
|
1063
|
-
function
|
|
1058
|
+
function jr({
|
|
1064
1059
|
visual: e,
|
|
1065
1060
|
selected: a,
|
|
1066
1061
|
onToggleSelection: o,
|
|
@@ -1075,13 +1070,13 @@ function $r({
|
|
|
1075
1070
|
isConsoleMode: m
|
|
1076
1071
|
}) {
|
|
1077
1072
|
var f;
|
|
1078
|
-
const p =
|
|
1073
|
+
const p = Or(e.kind), g = () => {
|
|
1079
1074
|
s(e);
|
|
1080
1075
|
};
|
|
1081
1076
|
return /* @__PURE__ */ r(
|
|
1082
1077
|
"div",
|
|
1083
1078
|
{
|
|
1084
|
-
className:
|
|
1079
|
+
className: J(
|
|
1085
1080
|
"group grid min-h-12 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/50 px-3 text-[13px] hover:bg-muted/50",
|
|
1086
1081
|
a && "bg-muted/70"
|
|
1087
1082
|
),
|
|
@@ -1125,14 +1120,14 @@ function $r({
|
|
|
1125
1120
|
}
|
|
1126
1121
|
),
|
|
1127
1122
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
1128
|
-
/* @__PURE__ */ t("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children:
|
|
1123
|
+
/* @__PURE__ */ t("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Rr(e, m) }),
|
|
1129
1124
|
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: Ct(e, m) })
|
|
1130
1125
|
] }),
|
|
1131
|
-
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children:
|
|
1132
|
-
/* @__PURE__ */ t(
|
|
1126
|
+
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: $t(e.updatedAt) }),
|
|
1127
|
+
/* @__PURE__ */ t(_r, { visual: e }),
|
|
1133
1128
|
/* @__PURE__ */ t("span", { className: "text-right tabular-nums text-muted-foreground", children: e.ownership.sharedCount > 0 ? e.ownership.sharedCount : "—" }),
|
|
1134
1129
|
/* @__PURE__ */ t(
|
|
1135
|
-
|
|
1130
|
+
$r,
|
|
1136
1131
|
{
|
|
1137
1132
|
visual: e,
|
|
1138
1133
|
onOpenVisual: i,
|
|
@@ -1149,7 +1144,7 @@ function $r({
|
|
|
1149
1144
|
}
|
|
1150
1145
|
);
|
|
1151
1146
|
}
|
|
1152
|
-
function
|
|
1147
|
+
function $r({
|
|
1153
1148
|
visual: e,
|
|
1154
1149
|
onOpenVisual: a,
|
|
1155
1150
|
onEditDetails: o,
|
|
@@ -1167,7 +1162,7 @@ function Wr({
|
|
|
1167
1162
|
onClick: (h) => h.stopPropagation(),
|
|
1168
1163
|
children: [
|
|
1169
1164
|
/* @__PURE__ */ t(
|
|
1170
|
-
|
|
1165
|
+
L,
|
|
1171
1166
|
{
|
|
1172
1167
|
size: "xs",
|
|
1173
1168
|
variant: "ghost",
|
|
@@ -1179,17 +1174,17 @@ function Wr({
|
|
|
1179
1174
|
),
|
|
1180
1175
|
/* @__PURE__ */ r(Qe, { modal: !1, children: [
|
|
1181
1176
|
/* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1182
|
-
|
|
1177
|
+
L,
|
|
1183
1178
|
{
|
|
1184
1179
|
size: "xs",
|
|
1185
1180
|
variant: "ghost",
|
|
1186
1181
|
className: "w-7 px-0",
|
|
1187
1182
|
"aria-label": "More actions",
|
|
1188
|
-
children: /* @__PURE__ */ t(
|
|
1183
|
+
children: /* @__PURE__ */ t(Lt, { className: "h-3.5 w-3.5" })
|
|
1189
1184
|
}
|
|
1190
1185
|
) }),
|
|
1191
1186
|
/* @__PURE__ */ r(
|
|
1192
|
-
|
|
1187
|
+
Ke,
|
|
1193
1188
|
{
|
|
1194
1189
|
align: "end",
|
|
1195
1190
|
className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
@@ -1204,7 +1199,7 @@ function Wr({
|
|
|
1204
1199
|
onClick: () => n(e.id),
|
|
1205
1200
|
disabled: d === e.id,
|
|
1206
1201
|
children: [
|
|
1207
|
-
d === e.id ? /* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(
|
|
1202
|
+
d === e.id ? /* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(ua, { className: "h-3.5 w-3.5" }),
|
|
1208
1203
|
d === e.id ? "Duplicating..." : "Duplicate"
|
|
1209
1204
|
]
|
|
1210
1205
|
}
|
|
@@ -1217,7 +1212,7 @@ function Wr({
|
|
|
1217
1212
|
/* @__PURE__ */ t(Tt, { className: "h-3.5 w-3.5" }),
|
|
1218
1213
|
"Share"
|
|
1219
1214
|
] }),
|
|
1220
|
-
e.permissions.canDelete && /* @__PURE__ */ r(
|
|
1215
|
+
e.permissions.canDelete && /* @__PURE__ */ r(_, { children: [
|
|
1221
1216
|
/* @__PURE__ */ t(ze, {}),
|
|
1222
1217
|
/* @__PURE__ */ r(
|
|
1223
1218
|
Y,
|
|
@@ -1234,13 +1229,13 @@ function Wr({
|
|
|
1234
1229
|
] }),
|
|
1235
1230
|
/* @__PURE__ */ t(ze, {}),
|
|
1236
1231
|
/* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
1237
|
-
|
|
1238
|
-
/* @__PURE__ */ t(
|
|
1232
|
+
Wt(e, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
1233
|
+
/* @__PURE__ */ t(ha, { className: "h-3 w-3" }),
|
|
1239
1234
|
/* @__PURE__ */ t("span", { className: "truncate", children: Ct(e, l) })
|
|
1240
1235
|
] }),
|
|
1241
1236
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
1242
|
-
/* @__PURE__ */ t(
|
|
1243
|
-
/* @__PURE__ */ t("span", { children:
|
|
1237
|
+
/* @__PURE__ */ t(ma, { className: "h-3 w-3" }),
|
|
1238
|
+
/* @__PURE__ */ t("span", { children: $t(e.updatedAt) })
|
|
1244
1239
|
] })
|
|
1245
1240
|
] })
|
|
1246
1241
|
]
|
|
@@ -1251,7 +1246,7 @@ function Wr({
|
|
|
1251
1246
|
}
|
|
1252
1247
|
);
|
|
1253
1248
|
}
|
|
1254
|
-
function
|
|
1249
|
+
function ss(e, a, o = !1) {
|
|
1255
1250
|
const s = D((h) => h.dashboard), i = D(
|
|
1256
1251
|
(h) => h.isDashboardEditing
|
|
1257
1252
|
), n = D(
|
|
@@ -1290,7 +1285,7 @@ function os(e, a, o = !1) {
|
|
|
1290
1285
|
}));
|
|
1291
1286
|
}, [c, n]), d;
|
|
1292
1287
|
}
|
|
1293
|
-
function
|
|
1288
|
+
function Wr({
|
|
1294
1289
|
open: e,
|
|
1295
1290
|
onOpenChange: a,
|
|
1296
1291
|
isLibraryVisual: o,
|
|
@@ -1302,7 +1297,7 @@ function qr({
|
|
|
1302
1297
|
const [c, l] = k(
|
|
1303
1298
|
o && s ? `Copy of ${s}` : s || ""
|
|
1304
1299
|
), [h, u] = k("");
|
|
1305
|
-
|
|
1300
|
+
At.useEffect(() => {
|
|
1306
1301
|
e && (l(
|
|
1307
1302
|
o && s ? `Copy of ${s}` : s || ""
|
|
1308
1303
|
), u(""));
|
|
@@ -1338,7 +1333,7 @@ function qr({
|
|
|
1338
1333
|
/* @__PURE__ */ r(Ie, { className: "flex items-center gap-2", children: [
|
|
1339
1334
|
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
1340
1335
|
p.badgeType !== "local" && /* @__PURE__ */ t(
|
|
1341
|
-
|
|
1336
|
+
mr,
|
|
1342
1337
|
{
|
|
1343
1338
|
type: p.badgeType,
|
|
1344
1339
|
showLabel: !0,
|
|
@@ -1365,7 +1360,7 @@ function qr({
|
|
|
1365
1360
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
1366
1361
|
/* @__PURE__ */ t(De, { htmlFor: "description", children: "Description (optional)" }),
|
|
1367
1362
|
/* @__PURE__ */ t(
|
|
1368
|
-
|
|
1363
|
+
pa,
|
|
1369
1364
|
{
|
|
1370
1365
|
id: "description",
|
|
1371
1366
|
value: h,
|
|
@@ -1377,9 +1372,9 @@ function qr({
|
|
|
1377
1372
|
)
|
|
1378
1373
|
] })
|
|
1379
1374
|
] }),
|
|
1380
|
-
/* @__PURE__ */ r(
|
|
1375
|
+
/* @__PURE__ */ r(fa, { children: [
|
|
1381
1376
|
/* @__PURE__ */ t(
|
|
1382
|
-
|
|
1377
|
+
L,
|
|
1383
1378
|
{
|
|
1384
1379
|
variant: "outline",
|
|
1385
1380
|
onClick: () => a(!1),
|
|
@@ -1387,7 +1382,7 @@ function qr({
|
|
|
1387
1382
|
children: "Cancel"
|
|
1388
1383
|
}
|
|
1389
1384
|
),
|
|
1390
|
-
/* @__PURE__ */ r(
|
|
1385
|
+
/* @__PURE__ */ r(L, { onClick: g, disabled: !m || i, children: [
|
|
1391
1386
|
i && /* @__PURE__ */ t(ne, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1392
1387
|
p.actionLabel
|
|
1393
1388
|
] })
|
|
@@ -1397,21 +1392,21 @@ function qr({
|
|
|
1397
1392
|
function wt(e) {
|
|
1398
1393
|
var a;
|
|
1399
1394
|
for (const o of e.cards)
|
|
1400
|
-
if (o.type === "matrixTable" && !
|
|
1401
|
-
return
|
|
1395
|
+
if (o.type === "matrixTable" && !rr.safeParse((a = o.config) == null ? void 0 : a.matrix).success)
|
|
1396
|
+
return E.error("Matrix requires at least one row field, one metric, and valid settings."), !1;
|
|
1402
1397
|
return !0;
|
|
1403
1398
|
}
|
|
1404
1399
|
function et({
|
|
1405
1400
|
className: e,
|
|
1406
1401
|
variant: a = "outline"
|
|
1407
1402
|
}) {
|
|
1408
|
-
const o =
|
|
1403
|
+
const o = ee((n) => n.onSave), { getUpdatedFrame: s } = ve();
|
|
1409
1404
|
function i() {
|
|
1410
1405
|
const n = s();
|
|
1411
1406
|
wt(n) && (o == null || o(n));
|
|
1412
1407
|
}
|
|
1413
1408
|
return /* @__PURE__ */ r(
|
|
1414
|
-
|
|
1409
|
+
L,
|
|
1415
1410
|
{
|
|
1416
1411
|
onClick: i,
|
|
1417
1412
|
className: e,
|
|
@@ -1424,13 +1419,13 @@ function et({
|
|
|
1424
1419
|
}
|
|
1425
1420
|
);
|
|
1426
1421
|
}
|
|
1427
|
-
function
|
|
1422
|
+
function qr({
|
|
1428
1423
|
className: e,
|
|
1429
1424
|
variant: a = "default"
|
|
1430
1425
|
}) {
|
|
1431
|
-
const o = $e(), [s, i] = k(!1), { setIsVisualEditing: n } =
|
|
1426
|
+
const o = $e(), [s, i] = k(!1), { setIsVisualEditing: n } = de(), { getUpdatedFrame: d } = ve(), c = We(), l = ee((m) => m.frame), h = Bt();
|
|
1432
1427
|
return /* @__PURE__ */ t(
|
|
1433
|
-
|
|
1428
|
+
L,
|
|
1434
1429
|
{
|
|
1435
1430
|
onClick: () => {
|
|
1436
1431
|
const m = d();
|
|
@@ -1438,7 +1433,7 @@ function Qr({
|
|
|
1438
1433
|
return;
|
|
1439
1434
|
const p = (l == null ? void 0 : l.visualId) || (c == null ? void 0 : c.id);
|
|
1440
1435
|
if (!p) {
|
|
1441
|
-
|
|
1436
|
+
E.error("No visual to save");
|
|
1442
1437
|
return;
|
|
1443
1438
|
}
|
|
1444
1439
|
i(!0), h.mutate(
|
|
@@ -1450,13 +1445,13 @@ function Qr({
|
|
|
1450
1445
|
},
|
|
1451
1446
|
{
|
|
1452
1447
|
onSuccess: () => {
|
|
1453
|
-
i(!1),
|
|
1448
|
+
i(!1), E.success("Visual updated successfully"), o.invalidateQueries({
|
|
1454
1449
|
queryKey: ["resource-by-id", "visual", p],
|
|
1455
1450
|
exact: !0
|
|
1456
1451
|
});
|
|
1457
1452
|
},
|
|
1458
1453
|
onError: () => {
|
|
1459
|
-
i(!1),
|
|
1454
|
+
i(!1), E.error("Failed to update visual");
|
|
1460
1455
|
}
|
|
1461
1456
|
}
|
|
1462
1457
|
);
|
|
@@ -1464,31 +1459,31 @@ function Qr({
|
|
|
1464
1459
|
className: e,
|
|
1465
1460
|
size: "xs",
|
|
1466
1461
|
variant: a,
|
|
1467
|
-
children: s ? /* @__PURE__ */ r(
|
|
1462
|
+
children: s ? /* @__PURE__ */ r(_, { children: [
|
|
1468
1463
|
/* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1469
1464
|
"Saving"
|
|
1470
|
-
] }) : /* @__PURE__ */ r(
|
|
1471
|
-
/* @__PURE__ */ t(
|
|
1465
|
+
] }) : /* @__PURE__ */ r(_, { children: [
|
|
1466
|
+
/* @__PURE__ */ t(Ot, { className: "h-3.5 w-3.5" }),
|
|
1472
1467
|
"Save to Library"
|
|
1473
1468
|
] })
|
|
1474
1469
|
}
|
|
1475
1470
|
);
|
|
1476
1471
|
}
|
|
1477
|
-
function
|
|
1472
|
+
function Qr({
|
|
1478
1473
|
className: e
|
|
1479
1474
|
}) {
|
|
1480
|
-
const a = $e(), [o, s] = k(!1), i = We(), n =
|
|
1475
|
+
const a = $e(), [o, s] = k(!1), i = We(), n = ee((f) => f.frame), d = D((f) => f.selectedSheetId), c = D((f) => f.dashboard), { updateFrame: l, setIsVisualEditing: h } = de(), { getUpdatedFrame: u } = ve(), m = Bt(), p = xt();
|
|
1481
1476
|
return /* @__PURE__ */ t(
|
|
1482
|
-
|
|
1477
|
+
L,
|
|
1483
1478
|
{
|
|
1484
1479
|
onClick: async () => {
|
|
1485
1480
|
if (!d) {
|
|
1486
|
-
|
|
1481
|
+
E.error("No sheet selected");
|
|
1487
1482
|
return;
|
|
1488
1483
|
}
|
|
1489
1484
|
const f = (n == null ? void 0 : n.visualId) || (i == null ? void 0 : i.id);
|
|
1490
1485
|
if (!f) {
|
|
1491
|
-
|
|
1486
|
+
E.error("No visual to update");
|
|
1492
1487
|
return;
|
|
1493
1488
|
}
|
|
1494
1489
|
s(!0);
|
|
@@ -1498,25 +1493,25 @@ function Hr({
|
|
|
1498
1493
|
s(!1);
|
|
1499
1494
|
return;
|
|
1500
1495
|
}
|
|
1501
|
-
const
|
|
1496
|
+
const N = {
|
|
1502
1497
|
...v,
|
|
1503
1498
|
visualId: f
|
|
1504
1499
|
// Keep the link to library visual
|
|
1505
|
-
},
|
|
1506
|
-
previousFrame:
|
|
1500
|
+
}, T = je(c, N.id), U = await p(N, {
|
|
1501
|
+
previousFrame: T
|
|
1507
1502
|
});
|
|
1508
1503
|
await m.mutateAsync({
|
|
1509
1504
|
visualId: f,
|
|
1510
1505
|
data: {
|
|
1511
1506
|
frameObject: v
|
|
1512
1507
|
}
|
|
1513
|
-
}), l(d,
|
|
1514
|
-
semanticExecutionPayload:
|
|
1515
|
-
}), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual", f] }),
|
|
1508
|
+
}), l(d, N, {
|
|
1509
|
+
semanticExecutionPayload: U
|
|
1510
|
+
}), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual", f] }), E.success("Saved to library and applied locally"), setTimeout(() => {
|
|
1516
1511
|
h(!1);
|
|
1517
1512
|
}, 300);
|
|
1518
1513
|
} catch (v) {
|
|
1519
|
-
console.error("Failed to save and apply:", v),
|
|
1514
|
+
console.error("Failed to save and apply:", v), E.error(
|
|
1520
1515
|
v instanceof Error ? v.message : "Failed to save and apply changes"
|
|
1521
1516
|
);
|
|
1522
1517
|
} finally {
|
|
@@ -1527,18 +1522,18 @@ function Hr({
|
|
|
1527
1522
|
size: "xs",
|
|
1528
1523
|
variant: "default",
|
|
1529
1524
|
disabled: o,
|
|
1530
|
-
children: o ? /* @__PURE__ */ r(
|
|
1525
|
+
children: o ? /* @__PURE__ */ r(_, { children: [
|
|
1531
1526
|
/* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1532
1527
|
"Saving..."
|
|
1533
|
-
] }) : /* @__PURE__ */ r(
|
|
1534
|
-
/* @__PURE__ */ t(
|
|
1528
|
+
] }) : /* @__PURE__ */ r(_, { children: [
|
|
1529
|
+
/* @__PURE__ */ t(Ot, { className: "h-3.5 w-3.5" }),
|
|
1535
1530
|
"Save & Apply"
|
|
1536
1531
|
] })
|
|
1537
1532
|
}
|
|
1538
1533
|
);
|
|
1539
1534
|
}
|
|
1540
1535
|
function tt({ className: e }) {
|
|
1541
|
-
const { setTempQueryData: a, setSqlGen: o } = qe(), s = $e(), i =
|
|
1536
|
+
const { setTempQueryData: a, setSqlGen: o } = qe(), s = $e(), i = ee((c) => c.tempQueryData), n = ee((c) => c.onClose);
|
|
1542
1537
|
function d() {
|
|
1543
1538
|
if (i) {
|
|
1544
1539
|
const { queryKey: c, queryData: l } = i;
|
|
@@ -1547,41 +1542,41 @@ function tt({ className: e }) {
|
|
|
1547
1542
|
o({}), n == null || n();
|
|
1548
1543
|
}
|
|
1549
1544
|
return /* @__PURE__ */ r(
|
|
1550
|
-
|
|
1545
|
+
L,
|
|
1551
1546
|
{
|
|
1552
1547
|
onClick: d,
|
|
1553
1548
|
className: e,
|
|
1554
1549
|
size: "xs",
|
|
1555
1550
|
variant: "outline",
|
|
1556
1551
|
children: [
|
|
1557
|
-
/* @__PURE__ */ t(
|
|
1552
|
+
/* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5" }),
|
|
1558
1553
|
"Close"
|
|
1559
1554
|
]
|
|
1560
1555
|
}
|
|
1561
1556
|
);
|
|
1562
1557
|
}
|
|
1563
|
-
function
|
|
1564
|
-
const [e, a] = k(!1), [o, s] = k(!1), [i, n] = k(null), [d, c] = k(null), l =
|
|
1565
|
-
var
|
|
1566
|
-
return ((
|
|
1567
|
-
})(), O =
|
|
1568
|
-
|
|
1558
|
+
function Hr() {
|
|
1559
|
+
const [e, a] = k(!1), [o, s] = k(!1), [i, n] = k(null), [d, c] = k(null), l = ee((w) => w.frame), h = ee((w) => w.card), u = We(), m = D((w) => w.selectedSheetId), p = D((w) => w.dashboard), { getUpdatedFrame: g } = ve(), { selectVisual: f } = it(), { addFrame: v, setSelectedFrameId: N, setIsVisualEditing: T } = de(), U = xt(), M = !!(l != null && l.visualId), A = (() => {
|
|
1560
|
+
var w, x;
|
|
1561
|
+
return ((w = l == null ? void 0 : l.cards) == null ? void 0 : w.length) === 1 && ((x = l.cards[0]) != null && x.title) ? l.cards[0].title : u != null && u.title ? u.title : (h == null ? void 0 : h.title) || "Untitled Visual";
|
|
1562
|
+
})(), O = ga((w) => {
|
|
1563
|
+
w != null && w.id && (f(w), o && i && d && m && (async () => {
|
|
1569
1564
|
try {
|
|
1570
1565
|
const x = {
|
|
1571
1566
|
...i,
|
|
1572
1567
|
id: St(),
|
|
1573
|
-
visualId:
|
|
1568
|
+
visualId: w.id
|
|
1574
1569
|
// Link to the newly created library visual
|
|
1575
1570
|
};
|
|
1576
1571
|
v(m, x, {
|
|
1577
1572
|
placement: "end",
|
|
1578
1573
|
semanticExecutionPayload: d
|
|
1579
|
-
}),
|
|
1574
|
+
}), N(x.id), s(!1), n(null), c(null), T(!1);
|
|
1580
1575
|
} catch (x) {
|
|
1581
1576
|
console.error(
|
|
1582
1577
|
"Failed to promote semantic metadata for saved visual:",
|
|
1583
1578
|
x
|
|
1584
|
-
),
|
|
1579
|
+
), E.error(
|
|
1585
1580
|
x instanceof Error ? x.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1586
1581
|
);
|
|
1587
1582
|
}
|
|
@@ -1590,83 +1585,83 @@ function Gr() {
|
|
|
1590
1585
|
return {
|
|
1591
1586
|
saveAsDialogOpen: e,
|
|
1592
1587
|
setSaveAsDialogOpen: a,
|
|
1593
|
-
handleSaveAs: async (
|
|
1588
|
+
handleSaveAs: async (w) => {
|
|
1594
1589
|
if (!m) {
|
|
1595
|
-
|
|
1590
|
+
E.error("No sheet selected");
|
|
1596
1591
|
return;
|
|
1597
1592
|
}
|
|
1598
|
-
const x = g(),
|
|
1593
|
+
const x = g(), S = x.cards.length === 1 ? {
|
|
1599
1594
|
...x,
|
|
1600
|
-
cards: x.cards.map((
|
|
1601
|
-
...
|
|
1602
|
-
title:
|
|
1595
|
+
cards: x.cards.map((j) => ({
|
|
1596
|
+
...j,
|
|
1597
|
+
title: w.name
|
|
1603
1598
|
// Use visual name as card title
|
|
1604
1599
|
}))
|
|
1605
1600
|
} : x;
|
|
1606
|
-
if (
|
|
1607
|
-
let
|
|
1608
|
-
if (
|
|
1601
|
+
if (w.saveToLibrary) {
|
|
1602
|
+
let j = null;
|
|
1603
|
+
if (w.saveToCurrentDashboard)
|
|
1609
1604
|
try {
|
|
1610
|
-
|
|
1611
|
-
previousFrame: je(p,
|
|
1605
|
+
j = await U(S, {
|
|
1606
|
+
previousFrame: je(p, S.id)
|
|
1612
1607
|
});
|
|
1613
|
-
} catch (
|
|
1608
|
+
} catch (V) {
|
|
1614
1609
|
console.error(
|
|
1615
1610
|
"Failed to prepare semantic metadata before saving visual:",
|
|
1616
|
-
|
|
1617
|
-
),
|
|
1618
|
-
|
|
1611
|
+
V
|
|
1612
|
+
), E.error(
|
|
1613
|
+
V instanceof Error ? V.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1619
1614
|
);
|
|
1620
1615
|
return;
|
|
1621
1616
|
}
|
|
1622
|
-
s(
|
|
1623
|
-
const
|
|
1624
|
-
title:
|
|
1625
|
-
description:
|
|
1626
|
-
frameObject:
|
|
1617
|
+
s(w.saveToCurrentDashboard), n(S), c(j);
|
|
1618
|
+
const I = {
|
|
1619
|
+
title: w.name,
|
|
1620
|
+
description: w.description,
|
|
1621
|
+
frameObject: S,
|
|
1627
1622
|
// Card title synced for single-card frames
|
|
1628
1623
|
isPrivate: !1
|
|
1629
1624
|
};
|
|
1630
|
-
O.mutate(
|
|
1631
|
-
} else if (
|
|
1632
|
-
const
|
|
1633
|
-
...
|
|
1625
|
+
O.mutate(I);
|
|
1626
|
+
} else if (w.saveToCurrentDashboard) {
|
|
1627
|
+
const j = {
|
|
1628
|
+
...S,
|
|
1634
1629
|
// Card title already synced
|
|
1635
1630
|
id: St(),
|
|
1636
1631
|
visualId: void 0
|
|
1637
1632
|
// Explicitly no visualId for local visuals
|
|
1638
1633
|
};
|
|
1639
1634
|
try {
|
|
1640
|
-
const
|
|
1641
|
-
previousFrame: je(p,
|
|
1635
|
+
const I = await U(S, {
|
|
1636
|
+
previousFrame: je(p, S.id)
|
|
1642
1637
|
});
|
|
1643
|
-
v(m,
|
|
1638
|
+
v(m, j, {
|
|
1644
1639
|
placement: "end",
|
|
1645
|
-
semanticExecutionPayload:
|
|
1646
|
-
}),
|
|
1647
|
-
} catch (
|
|
1648
|
-
console.error("Failed to save visual to dashboard:",
|
|
1649
|
-
|
|
1640
|
+
semanticExecutionPayload: I
|
|
1641
|
+
}), N(j.id), E.success("Visual saved to dashboard"), a(!1), T(!1);
|
|
1642
|
+
} catch (I) {
|
|
1643
|
+
console.error("Failed to save visual to dashboard:", I), E.error(
|
|
1644
|
+
I instanceof Error ? I.message : "Failed to prepare semantic metadata for the visual"
|
|
1650
1645
|
);
|
|
1651
1646
|
}
|
|
1652
1647
|
}
|
|
1653
1648
|
},
|
|
1654
|
-
isLibraryVisual:
|
|
1649
|
+
isLibraryVisual: M,
|
|
1655
1650
|
currentVisualName: A,
|
|
1656
1651
|
isSaving: O.isPending
|
|
1657
1652
|
};
|
|
1658
1653
|
}
|
|
1659
|
-
function
|
|
1660
|
-
const { isInspectionMode: a } =
|
|
1661
|
-
saveAsDialogOpen:
|
|
1654
|
+
function os(e = {}) {
|
|
1655
|
+
const { isInspectionMode: a } = ba(), o = ee((I) => I.frame), s = ee((I) => I.editorContext), i = xa((I) => I.selectedVisual), n = D((I) => I.selectedFrameId), d = D((I) => I.selectedSheetId), c = D((I) => I.dashboard), { setIsVisualEditing: l, updateFrame: h } = de(), [u, m] = k(!1), [p, g] = k("both"), f = xt(), v = (s == null ? void 0 : s.type) === "documentSection", N = !!(o != null && o.visualId || i != null && i.id), T = !!(o != null && o.visualId && n), U = N && !T, {
|
|
1656
|
+
saveAsDialogOpen: M,
|
|
1662
1657
|
setSaveAsDialogOpen: A,
|
|
1663
1658
|
handleSaveAs: O,
|
|
1664
1659
|
isLibraryVisual: C,
|
|
1665
|
-
currentVisualName:
|
|
1660
|
+
currentVisualName: w,
|
|
1666
1661
|
isSaving: x
|
|
1667
|
-
} =
|
|
1662
|
+
} = Hr(), { getUpdatedFrame: F } = ve();
|
|
1668
1663
|
if (a)
|
|
1669
|
-
return /* @__PURE__ */ r(
|
|
1664
|
+
return /* @__PURE__ */ r(_, { children: [
|
|
1670
1665
|
/* @__PURE__ */ t(
|
|
1671
1666
|
et,
|
|
1672
1667
|
{
|
|
@@ -1677,68 +1672,68 @@ function is(e = {}) {
|
|
|
1677
1672
|
/* @__PURE__ */ t(tt, {})
|
|
1678
1673
|
] });
|
|
1679
1674
|
if (v)
|
|
1680
|
-
return /* @__PURE__ */ r(
|
|
1675
|
+
return /* @__PURE__ */ r(_, { children: [
|
|
1681
1676
|
/* @__PURE__ */ t(et, { className: "rounded-control", variant: "default" }),
|
|
1682
1677
|
/* @__PURE__ */ t(tt, {})
|
|
1683
1678
|
] });
|
|
1684
|
-
const
|
|
1679
|
+
const S = async () => {
|
|
1685
1680
|
if (!d) {
|
|
1686
|
-
|
|
1681
|
+
E.error("No sheet selected");
|
|
1687
1682
|
return;
|
|
1688
1683
|
}
|
|
1689
1684
|
if (u) return;
|
|
1690
1685
|
m(!0);
|
|
1691
|
-
const
|
|
1692
|
-
...
|
|
1686
|
+
const V = {
|
|
1687
|
+
...F(),
|
|
1693
1688
|
visualId: void 0
|
|
1694
|
-
},
|
|
1689
|
+
}, Z = je(c, V.id);
|
|
1695
1690
|
try {
|
|
1696
|
-
const
|
|
1697
|
-
previousFrame:
|
|
1691
|
+
const K = await f(V, {
|
|
1692
|
+
previousFrame: Z
|
|
1698
1693
|
});
|
|
1699
|
-
h(d,
|
|
1700
|
-
semanticExecutionPayload:
|
|
1694
|
+
h(d, V, {
|
|
1695
|
+
semanticExecutionPayload: K
|
|
1701
1696
|
});
|
|
1702
|
-
} catch (
|
|
1703
|
-
console.error("Failed to apply local semantic metadata:",
|
|
1704
|
-
|
|
1697
|
+
} catch (K) {
|
|
1698
|
+
console.error("Failed to apply local semantic metadata:", K), m(!1), E.error(
|
|
1699
|
+
K instanceof Error ? K.message : "Failed to prepare semantic metadata for this visual"
|
|
1705
1700
|
);
|
|
1706
1701
|
return;
|
|
1707
1702
|
}
|
|
1708
1703
|
setTimeout(() => {
|
|
1709
|
-
m(!1),
|
|
1704
|
+
m(!1), E.success("Changes applied. Visual is now local to this dashboard"), l(!1);
|
|
1710
1705
|
}, 300);
|
|
1711
|
-
},
|
|
1712
|
-
g(
|
|
1706
|
+
}, j = (I) => {
|
|
1707
|
+
g(I), A(!0);
|
|
1713
1708
|
};
|
|
1714
|
-
return /* @__PURE__ */ r(
|
|
1709
|
+
return /* @__PURE__ */ r(_, { children: [
|
|
1715
1710
|
/* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
1716
|
-
!
|
|
1717
|
-
|
|
1718
|
-
|
|
1711
|
+
!N && /* @__PURE__ */ t(et, { className: "!rounded-none", variant: "default" }),
|
|
1712
|
+
N && U && /* @__PURE__ */ t(qr, { className: "!rounded-none", variant: "default" }),
|
|
1713
|
+
N && T && /* @__PURE__ */ t(Qr, { className: "!rounded-none" }),
|
|
1719
1714
|
/* @__PURE__ */ r(Qe, { modal: !1, children: [
|
|
1720
1715
|
/* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1721
|
-
|
|
1716
|
+
L,
|
|
1722
1717
|
{
|
|
1723
1718
|
variant: "default",
|
|
1724
1719
|
size: "xs",
|
|
1725
1720
|
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
1726
1721
|
"aria-label": "Open visual save options",
|
|
1727
1722
|
disabled: x || u,
|
|
1728
|
-
children: /* @__PURE__ */ t(
|
|
1723
|
+
children: /* @__PURE__ */ t(Rt, { className: "h-3.5 w-3.5" })
|
|
1729
1724
|
}
|
|
1730
1725
|
) }),
|
|
1731
1726
|
/* @__PURE__ */ r(
|
|
1732
|
-
|
|
1727
|
+
Ke,
|
|
1733
1728
|
{
|
|
1734
1729
|
align: "end",
|
|
1735
1730
|
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
1736
1731
|
children: [
|
|
1737
|
-
|
|
1732
|
+
T && /* @__PURE__ */ r(_, { children: [
|
|
1738
1733
|
/* @__PURE__ */ r(
|
|
1739
1734
|
Y,
|
|
1740
1735
|
{
|
|
1741
|
-
onClick:
|
|
1736
|
+
onClick: S,
|
|
1742
1737
|
disabled: u,
|
|
1743
1738
|
children: [
|
|
1744
1739
|
/* @__PURE__ */ t(st, { className: "h-3.5 w-3.5" }),
|
|
@@ -1751,7 +1746,7 @@ function is(e = {}) {
|
|
|
1751
1746
|
/* @__PURE__ */ r(
|
|
1752
1747
|
Y,
|
|
1753
1748
|
{
|
|
1754
|
-
onClick: () =>
|
|
1749
|
+
onClick: () => j("local"),
|
|
1755
1750
|
disabled: x,
|
|
1756
1751
|
children: [
|
|
1757
1752
|
/* @__PURE__ */ t(be, { className: "h-3.5 w-3.5" }),
|
|
@@ -1762,10 +1757,10 @@ function is(e = {}) {
|
|
|
1762
1757
|
/* @__PURE__ */ r(
|
|
1763
1758
|
Y,
|
|
1764
1759
|
{
|
|
1765
|
-
onClick: () =>
|
|
1760
|
+
onClick: () => j("library"),
|
|
1766
1761
|
disabled: x,
|
|
1767
1762
|
children: [
|
|
1768
|
-
/* @__PURE__ */ t(
|
|
1763
|
+
/* @__PURE__ */ t(pr, { className: "h-3.5 w-3.5" }),
|
|
1769
1764
|
"Save as Library Visual"
|
|
1770
1765
|
]
|
|
1771
1766
|
}
|
|
@@ -1773,10 +1768,10 @@ function is(e = {}) {
|
|
|
1773
1768
|
/* @__PURE__ */ r(
|
|
1774
1769
|
Y,
|
|
1775
1770
|
{
|
|
1776
|
-
onClick: () =>
|
|
1771
|
+
onClick: () => j("both"),
|
|
1777
1772
|
disabled: x,
|
|
1778
1773
|
children: [
|
|
1779
|
-
/* @__PURE__ */ t(
|
|
1774
|
+
/* @__PURE__ */ t(fr, { className: "h-3.5 w-3.5" }),
|
|
1780
1775
|
"Save Copy as Linked Visual"
|
|
1781
1776
|
]
|
|
1782
1777
|
}
|
|
@@ -1788,14 +1783,14 @@ function is(e = {}) {
|
|
|
1788
1783
|
] }),
|
|
1789
1784
|
/* @__PURE__ */ t(tt, {}),
|
|
1790
1785
|
/* @__PURE__ */ t(
|
|
1791
|
-
|
|
1786
|
+
Wr,
|
|
1792
1787
|
{
|
|
1793
|
-
open:
|
|
1794
|
-
onOpenChange: (
|
|
1795
|
-
x || A(
|
|
1788
|
+
open: M,
|
|
1789
|
+
onOpenChange: (I) => {
|
|
1790
|
+
x || A(I);
|
|
1796
1791
|
},
|
|
1797
1792
|
isLibraryVisual: C,
|
|
1798
|
-
currentVisualName:
|
|
1793
|
+
currentVisualName: w,
|
|
1799
1794
|
isSaving: x,
|
|
1800
1795
|
destinationMode: p,
|
|
1801
1796
|
onConfirm: O
|
|
@@ -1803,11 +1798,11 @@ function is(e = {}) {
|
|
|
1803
1798
|
)
|
|
1804
1799
|
] });
|
|
1805
1800
|
}
|
|
1806
|
-
function
|
|
1807
|
-
const a =
|
|
1808
|
-
if (!s || !d || !
|
|
1801
|
+
function is({ className: e }) {
|
|
1802
|
+
const a = ee((u) => u.isDevMode), o = ee((u) => u.card.type), s = D((u) => u.isVisualEditing), { setIsDevMode: i } = qe(), { config: n } = Kt(va).tokenProps, d = (n == null ? void 0 : n.showAdvancedMode) !== !1;
|
|
1803
|
+
if (!s || !d || !Gt(o))
|
|
1809
1804
|
return null;
|
|
1810
|
-
const c = a ?
|
|
1805
|
+
const c = a ? Dr : kr, l = a ? "Visual editor" : "SQL editor", h = a ? "Switch to visual editor" : "Switch to SQL editor";
|
|
1811
1806
|
return /* @__PURE__ */ r(
|
|
1812
1807
|
"button",
|
|
1813
1808
|
{
|
|
@@ -1815,7 +1810,7 @@ function ls({ className: e }) {
|
|
|
1815
1810
|
"aria-label": h,
|
|
1816
1811
|
title: h,
|
|
1817
1812
|
onClick: () => i(!a),
|
|
1818
|
-
className:
|
|
1813
|
+
className: J(
|
|
1819
1814
|
"inline-flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 text-[12px] font-medium text-foreground transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:outline-none",
|
|
1820
1815
|
e
|
|
1821
1816
|
),
|
|
@@ -1826,7 +1821,7 @@ function ls({ className: e }) {
|
|
|
1826
1821
|
}
|
|
1827
1822
|
);
|
|
1828
1823
|
}
|
|
1829
|
-
function
|
|
1824
|
+
function ls({
|
|
1830
1825
|
open: e,
|
|
1831
1826
|
onOpenChange: a,
|
|
1832
1827
|
onSave: o,
|
|
@@ -1847,7 +1842,7 @@ function ds({
|
|
|
1847
1842
|
] }),
|
|
1848
1843
|
/* @__PURE__ */ r(mt, { children: [
|
|
1849
1844
|
/* @__PURE__ */ t(
|
|
1850
|
-
|
|
1845
|
+
L,
|
|
1851
1846
|
{
|
|
1852
1847
|
type: "button",
|
|
1853
1848
|
size: "xs",
|
|
@@ -1859,14 +1854,14 @@ function ds({
|
|
|
1859
1854
|
}
|
|
1860
1855
|
),
|
|
1861
1856
|
/* @__PURE__ */ t(pt, { disabled: i, children: c }),
|
|
1862
|
-
/* @__PURE__ */ t(
|
|
1857
|
+
/* @__PURE__ */ t(L, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ r(_, { children: [
|
|
1863
1858
|
/* @__PURE__ */ t(ne, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1864
1859
|
"Saving..."
|
|
1865
1860
|
] }) : h })
|
|
1866
1861
|
] })
|
|
1867
1862
|
] }) });
|
|
1868
1863
|
}
|
|
1869
|
-
async function
|
|
1864
|
+
async function ds(e) {
|
|
1870
1865
|
var n, d;
|
|
1871
1866
|
const a = (d = (n = D.getState()) == null ? void 0 : n.authToken) == null ? void 0 : d.accessToken;
|
|
1872
1867
|
if (!a)
|
|
@@ -1898,7 +1893,7 @@ function Kr(e) {
|
|
|
1898
1893
|
return { text: G.inProgress };
|
|
1899
1894
|
}
|
|
1900
1895
|
}
|
|
1901
|
-
function
|
|
1896
|
+
function Gr(e) {
|
|
1902
1897
|
var o;
|
|
1903
1898
|
const a = e.item;
|
|
1904
1899
|
return a.kind === "export" ? {
|
|
@@ -1909,7 +1904,7 @@ function Yr(e) {
|
|
|
1909
1904
|
running: Kr(a.stage),
|
|
1910
1905
|
finishedDetail: [
|
|
1911
1906
|
a.totalRows !== null ? `${a.totalRows.toLocaleString("en-US")} rows` : null,
|
|
1912
|
-
a.fileSize ?
|
|
1907
|
+
a.fileSize ? Da(a.fileSize) : null
|
|
1913
1908
|
].filter((s) => !!s),
|
|
1914
1909
|
failure: ((o = a.failure) == null ? void 0 : o.kind) === "export" ? a.failure.message : a.status === "failed" ? G.failedFallback : null,
|
|
1915
1910
|
note: null
|
|
@@ -1921,36 +1916,36 @@ function Yr(e) {
|
|
|
1921
1916
|
running: { text: a.stageLabel ?? G.inProgress },
|
|
1922
1917
|
finishedDetail: [],
|
|
1923
1918
|
failure: null,
|
|
1924
|
-
note: a.omittedAttachmentCount > 0 ?
|
|
1919
|
+
note: a.omittedAttachmentCount > 0 ? he.attachmentsLeftOut(a.omittedAttachmentCount) : null
|
|
1925
1920
|
};
|
|
1926
1921
|
}
|
|
1927
1922
|
function Xr({ row: e, now: a, api: o }) {
|
|
1928
|
-
const [s, i] = k("idle"), n =
|
|
1923
|
+
const [s, i] = k("idle"), n = Gr(e), d = ya(e, o), c = async () => {
|
|
1929
1924
|
if (!d) return;
|
|
1930
1925
|
i("working");
|
|
1931
|
-
const f = await
|
|
1926
|
+
const f = await Aa(o, e, d);
|
|
1932
1927
|
i(f === "done" ? "idle" : f);
|
|
1933
|
-
}, l = n.status === "ready" ? "bg-emerald-500" : n.status === "failed" ? "bg-destructive" : n.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", h = n.status === "ready" ? G.ready : n.status === "failed" ? G.failed : n.status === "cancelled" ? G.cancelled : G.inProgress, u = Date.parse(n.startedAt), m = kt(Date.parse(n.finishedAt ?? n.startedAt), a, { addSuffix: !0 }), p = n.status === "running" && e.item.kind === "export" && a - u >=
|
|
1928
|
+
}, l = n.status === "ready" ? "bg-emerald-500" : n.status === "failed" ? "bg-destructive" : n.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", h = n.status === "ready" ? G.ready : n.status === "failed" ? G.failed : n.status === "cancelled" ? G.cancelled : G.inProgress, u = Date.parse(n.startedAt), m = kt(Date.parse(n.finishedAt ?? n.startedAt), a, { addSuffix: !0 }), p = n.status === "running" && e.item.kind === "export" && a - u >= Ca, g = /* @__PURE__ */ t("span", { className: "text-muted-foreground/50", children: "·" });
|
|
1934
1929
|
return /* @__PURE__ */ r("div", { className: "group flex items-start gap-2.5 px-3 py-2 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
1935
1930
|
/* @__PURE__ */ t("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ t("span", { className: `h-1.5 w-1.5 rounded-full ${l}` }) }),
|
|
1936
1931
|
/* @__PURE__ */ t("span", { className: "sr-only", children: h }),
|
|
1937
1932
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
1938
1933
|
/* @__PURE__ */ r("div", { className: "flex h-5 items-center gap-2", children: [
|
|
1939
1934
|
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: n.title }),
|
|
1940
|
-
d && s === "working" && /* @__PURE__ */ t("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: /* @__PURE__ */ t(
|
|
1935
|
+
d && s === "working" && /* @__PURE__ */ t("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: /* @__PURE__ */ t(Pt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }) }),
|
|
1941
1936
|
d && s !== "working" && /* @__PURE__ */ t(
|
|
1942
1937
|
"button",
|
|
1943
1938
|
{
|
|
1944
1939
|
type: "button",
|
|
1945
1940
|
onClick: () => void c(),
|
|
1946
1941
|
className: "shrink-0 text-[12px] font-medium text-foreground/80 underline-offset-2 hover:text-foreground hover:underline focus-visible:underline focus-visible:outline-none",
|
|
1947
|
-
children:
|
|
1942
|
+
children: wa[d]
|
|
1948
1943
|
}
|
|
1949
1944
|
)
|
|
1950
1945
|
] }),
|
|
1951
1946
|
n.status === "running" && n.running && /* @__PURE__ */ r("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
|
|
1952
1947
|
/* @__PURE__ */ t("span", { className: "tabular-nums", children: n.running.text }),
|
|
1953
|
-
n.running.detail && /* @__PURE__ */ r(
|
|
1948
|
+
n.running.detail && /* @__PURE__ */ r(_, { children: [
|
|
1954
1949
|
" ",
|
|
1955
1950
|
g,
|
|
1956
1951
|
" ",
|
|
@@ -1960,20 +1955,20 @@ function Xr({ row: e, now: a, api: o }) {
|
|
|
1960
1955
|
g,
|
|
1961
1956
|
" ",
|
|
1962
1957
|
/* @__PURE__ */ t("span", { children: G.started(kt(u, a)) }),
|
|
1963
|
-
n.running.bar !== void 0 && /* @__PURE__ */ t(
|
|
1958
|
+
n.running.bar !== void 0 && /* @__PURE__ */ t(Na, { value: n.running.bar, className: "mt-1.5 h-1" }),
|
|
1964
1959
|
p && /* @__PURE__ */ t("div", { className: "mt-1", children: G.longRunning })
|
|
1965
1960
|
] }),
|
|
1966
1961
|
n.status !== "running" && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
|
|
1967
1962
|
n.status === "ready" && n.finishedDetail.length > 0 ? (
|
|
1968
1963
|
// Disclosed on hover or focus only; the time is what a reader scans.
|
|
1969
1964
|
/* @__PURE__ */ r("span", { className: "hidden group-hover:contents group-focus-within:contents", children: [
|
|
1970
|
-
n.finishedDetail.map((f, v) => /* @__PURE__ */ r(
|
|
1965
|
+
n.finishedDetail.map((f, v) => /* @__PURE__ */ r(At.Fragment, { children: [
|
|
1971
1966
|
v > 0 && g,
|
|
1972
1967
|
/* @__PURE__ */ t("span", { children: f })
|
|
1973
1968
|
] }, v)),
|
|
1974
1969
|
g
|
|
1975
1970
|
] })
|
|
1976
|
-
) : n.status !== "ready" ? /* @__PURE__ */ r(
|
|
1971
|
+
) : n.status !== "ready" ? /* @__PURE__ */ r(_, { children: [
|
|
1977
1972
|
/* @__PURE__ */ t("span", { children: h }),
|
|
1978
1973
|
g
|
|
1979
1974
|
] }) : null,
|
|
@@ -1982,27 +1977,27 @@ function Xr({ row: e, now: a, api: o }) {
|
|
|
1982
1977
|
n.note && /* @__PURE__ */ t("div", { className: "text-[12px] leading-4 text-muted-foreground", children: n.note }),
|
|
1983
1978
|
n.status === "failed" && n.failure && /* @__PURE__ */ t("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: n.failure }),
|
|
1984
1979
|
(s === "denied" || s === "blocked") && /* @__PURE__ */ r("div", { role: "alert", className: "mt-1 flex items-start gap-1.5 text-[12px] leading-4 text-foreground", children: [
|
|
1985
|
-
/* @__PURE__ */ t(
|
|
1986
|
-
/* @__PURE__ */ t("span", { children:
|
|
1980
|
+
/* @__PURE__ */ t(Sa, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
|
|
1981
|
+
/* @__PURE__ */ t("span", { children: ka(s) })
|
|
1987
1982
|
] })
|
|
1988
1983
|
] })
|
|
1989
1984
|
] });
|
|
1990
1985
|
}
|
|
1991
|
-
function
|
|
1986
|
+
function cs({ variant: e }) {
|
|
1992
1987
|
const { snapshot: a, markSeen: o } = vt(), s = a.runningCount > 0 ? a.runningCount > 9 ? "9+" : String(a.runningCount) : a.hasUnseenFinished ? "" : null;
|
|
1993
|
-
return /* @__PURE__ */ r(
|
|
1988
|
+
return /* @__PURE__ */ r(Me, { onOpenChange: (i) => {
|
|
1994
1989
|
i && o();
|
|
1995
1990
|
}, children: [
|
|
1996
1991
|
/* @__PURE__ */ t(Re, { asChild: !0, children: /* @__PURE__ */ r(
|
|
1997
|
-
|
|
1992
|
+
L,
|
|
1998
1993
|
{
|
|
1999
1994
|
variant: e ?? "ghost",
|
|
2000
1995
|
size: "xs",
|
|
2001
1996
|
className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
2002
|
-
"aria-label":
|
|
2003
|
-
title:
|
|
1997
|
+
"aria-label": he.title,
|
|
1998
|
+
title: he.title,
|
|
2004
1999
|
children: [
|
|
2005
|
-
/* @__PURE__ */ t(
|
|
2000
|
+
/* @__PURE__ */ t(Nr, { className: "h-3.5 w-3.5" }),
|
|
2006
2001
|
s !== null && /* @__PURE__ */ t(
|
|
2007
2002
|
"span",
|
|
2008
2003
|
{
|
|
@@ -2013,32 +2008,32 @@ function us({ variant: e }) {
|
|
|
2013
2008
|
]
|
|
2014
2009
|
}
|
|
2015
2010
|
) }),
|
|
2016
|
-
/* @__PURE__ */ t(Oe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(
|
|
2011
|
+
/* @__PURE__ */ t(Oe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(Yr, {}) })
|
|
2017
2012
|
] });
|
|
2018
2013
|
}
|
|
2019
|
-
function
|
|
2020
|
-
const e = vt(), a =
|
|
2014
|
+
function Yr() {
|
|
2015
|
+
const e = vt(), a = Fa(), { rows: o, activeTruncated: s } = e.snapshot, i = o.some((n) => Ia(n.item.status));
|
|
2021
2016
|
return o.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
|
|
2022
|
-
/* @__PURE__ */ t("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ t(
|
|
2023
|
-
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children:
|
|
2024
|
-
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children:
|
|
2017
|
+
/* @__PURE__ */ t("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ t(Ea, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
|
|
2018
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: he.title }),
|
|
2019
|
+
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: he.empty })
|
|
2025
2020
|
] }) : /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
2026
2021
|
/* @__PURE__ */ r("div", { className: "flex h-8 items-center gap-2 border-b border-border px-3", children: [
|
|
2027
|
-
/* @__PURE__ */ t("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children:
|
|
2022
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: he.title }),
|
|
2028
2023
|
/* @__PURE__ */ t("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: o.length }),
|
|
2029
2024
|
/* @__PURE__ */ r("div", { className: "ml-auto flex items-center gap-0.5", children: [
|
|
2030
2025
|
i && /* @__PURE__ */ t(
|
|
2031
|
-
|
|
2026
|
+
L,
|
|
2032
2027
|
{
|
|
2033
2028
|
variant: "ghost",
|
|
2034
2029
|
size: "xs",
|
|
2035
2030
|
className: "h-6 px-1.5 text-[12px] text-muted-foreground hover:text-foreground",
|
|
2036
2031
|
onClick: e.clearFinished,
|
|
2037
|
-
children:
|
|
2032
|
+
children: he.clear
|
|
2038
2033
|
}
|
|
2039
2034
|
),
|
|
2040
2035
|
/* @__PURE__ */ t(
|
|
2041
|
-
|
|
2036
|
+
L,
|
|
2042
2037
|
{
|
|
2043
2038
|
variant: "ghost",
|
|
2044
2039
|
size: "xs",
|
|
@@ -2046,16 +2041,16 @@ function Zr() {
|
|
|
2046
2041
|
onClick: e.refresh,
|
|
2047
2042
|
title: "Refresh status",
|
|
2048
2043
|
"aria-label": "Refresh status",
|
|
2049
|
-
children: /* @__PURE__ */ t(
|
|
2044
|
+
children: /* @__PURE__ */ t(Pt, { strokeWidth: 1.75, className: "h-3.5 w-3.5" })
|
|
2050
2045
|
}
|
|
2051
2046
|
)
|
|
2052
2047
|
] })
|
|
2053
2048
|
] }),
|
|
2054
|
-
s && /* @__PURE__ */ t("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children:
|
|
2049
|
+
s && /* @__PURE__ */ t("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children: he.truncated }),
|
|
2055
2050
|
/* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y divide-border/70", children: o.map((n) => /* @__PURE__ */ t(Xr, { row: n, now: a, api: e }, Ta(n))) }) })
|
|
2056
2051
|
] });
|
|
2057
2052
|
}
|
|
2058
|
-
function
|
|
2053
|
+
function Zr(e) {
|
|
2059
2054
|
if (e)
|
|
2060
2055
|
return {
|
|
2061
2056
|
renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
|
|
@@ -2064,7 +2059,7 @@ function Jr(e) {
|
|
|
2064
2059
|
affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
|
|
2065
2060
|
};
|
|
2066
2061
|
}
|
|
2067
|
-
function
|
|
2062
|
+
function Jr({
|
|
2068
2063
|
open: e,
|
|
2069
2064
|
onOpenChange: a,
|
|
2070
2065
|
trigger: o,
|
|
@@ -2078,7 +2073,7 @@ function en({
|
|
|
2078
2073
|
preventPassiveDismissDuringCreate: h,
|
|
2079
2074
|
resolvedOpen: u,
|
|
2080
2075
|
setIsCreateFlowActive: m
|
|
2081
|
-
} =
|
|
2076
|
+
} = _t({
|
|
2082
2077
|
open: e,
|
|
2083
2078
|
onOpenChange: a,
|
|
2084
2079
|
initialCreateFlowActive: i === "create",
|
|
@@ -2089,44 +2084,44 @@ function en({
|
|
|
2089
2084
|
// create and make consumers use `forceClose()` from a dedicated
|
|
2090
2085
|
// button.
|
|
2091
2086
|
dismissMode: s ? "passive" : "explicit-only"
|
|
2092
|
-
}), p = D((x) => x.dashboard), { setDashboardControlsModel: g } =
|
|
2087
|
+
}), p = D((x) => x.dashboard), { setDashboardControlsModel: g } = de(), { participants: f } = Va(hr(p)), v = Array.from(
|
|
2093
2088
|
new Map(
|
|
2094
2089
|
f.flatMap(
|
|
2095
|
-
(x) => x.fieldChoices.map((
|
|
2096
|
-
var
|
|
2090
|
+
(x) => x.fieldChoices.map((F) => {
|
|
2091
|
+
var S;
|
|
2097
2092
|
return [
|
|
2098
|
-
|
|
2093
|
+
F.value,
|
|
2099
2094
|
{
|
|
2100
|
-
option:
|
|
2101
|
-
target: (
|
|
2095
|
+
option: F,
|
|
2096
|
+
target: (S = x.fieldTargetMap) == null ? void 0 : S[F.value]
|
|
2102
2097
|
}
|
|
2103
2098
|
];
|
|
2104
2099
|
})
|
|
2105
2100
|
)
|
|
2106
2101
|
).values()
|
|
2107
|
-
),
|
|
2102
|
+
), N = Array.from(
|
|
2108
2103
|
new Map(
|
|
2109
2104
|
f.flatMap(
|
|
2110
|
-
(x) => x.metricChoices.map((
|
|
2111
|
-
var
|
|
2105
|
+
(x) => x.metricChoices.map((F) => {
|
|
2106
|
+
var S;
|
|
2112
2107
|
return [
|
|
2113
|
-
|
|
2108
|
+
F.value,
|
|
2114
2109
|
{
|
|
2115
|
-
option:
|
|
2116
|
-
target: (
|
|
2110
|
+
option: F,
|
|
2111
|
+
target: (S = x.metricTargetMap) == null ? void 0 : S[F.value]
|
|
2117
2112
|
}
|
|
2118
2113
|
];
|
|
2119
2114
|
})
|
|
2120
2115
|
)
|
|
2121
2116
|
).values()
|
|
2122
|
-
),
|
|
2117
|
+
), T = or({
|
|
2123
2118
|
...p || {},
|
|
2124
2119
|
controls: []
|
|
2125
|
-
}),
|
|
2120
|
+
}), U = La(p), M = (x, F, S) => {
|
|
2126
2121
|
g(
|
|
2127
2122
|
x,
|
|
2128
|
-
|
|
2129
|
-
|
|
2123
|
+
F,
|
|
2124
|
+
Zr(S)
|
|
2130
2125
|
);
|
|
2131
2126
|
}, A = ae(() => {
|
|
2132
2127
|
if (n) {
|
|
@@ -2135,33 +2130,33 @@ function en({
|
|
|
2135
2130
|
}
|
|
2136
2131
|
m(!1);
|
|
2137
2132
|
}, [n, d, m]), O = /* @__PURE__ */ t(
|
|
2138
|
-
|
|
2133
|
+
zt,
|
|
2139
2134
|
{
|
|
2140
2135
|
scope: "dashboard",
|
|
2141
2136
|
controls: p.controls || [],
|
|
2142
|
-
reservedControlIds:
|
|
2137
|
+
reservedControlIds: T,
|
|
2143
2138
|
defaultValues: p.defaultControlValues || {},
|
|
2144
|
-
usageByControlId:
|
|
2139
|
+
usageByControlId: Ba(p),
|
|
2145
2140
|
availableFieldChoices: v,
|
|
2146
|
-
availableMetricChoices:
|
|
2141
|
+
availableMetricChoices: N,
|
|
2147
2142
|
structuralParticipants: f,
|
|
2148
|
-
structuralParticipantIdsByControlId:
|
|
2143
|
+
structuralParticipantIdsByControlId: U,
|
|
2149
2144
|
initialCreateFlow: i === "create",
|
|
2150
2145
|
onCreateFlowActiveChange: m,
|
|
2151
2146
|
onCreateFlowComplete: A,
|
|
2152
|
-
onChange:
|
|
2147
|
+
onChange: M,
|
|
2153
2148
|
emptyMessage: "No dashboard controls yet."
|
|
2154
2149
|
}
|
|
2155
|
-
), C = l ? "Add dashboard control" : "Dashboard Controls",
|
|
2150
|
+
), C = l ? "Add dashboard control" : "Dashboard Controls", w = /* @__PURE__ */ r(_, { children: [
|
|
2156
2151
|
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
2157
2152
|
/* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
2158
2153
|
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
|
|
2159
2154
|
] }),
|
|
2160
2155
|
O
|
|
2161
2156
|
] });
|
|
2162
|
-
return s ? /* @__PURE__ */ r(
|
|
2163
|
-
/* @__PURE__ */ t(Re, { asChild: !0, children: o || /* @__PURE__ */ r(
|
|
2164
|
-
/* @__PURE__ */ t(
|
|
2157
|
+
return s ? /* @__PURE__ */ r(Me, { open: u, onOpenChange: c, children: [
|
|
2158
|
+
/* @__PURE__ */ t(Re, { asChild: !0, children: o || /* @__PURE__ */ r(L, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
2159
|
+
/* @__PURE__ */ t(It, { className: "mr-2 h-4 w-4" }),
|
|
2165
2160
|
"Controls"
|
|
2166
2161
|
] }) }),
|
|
2167
2162
|
/* @__PURE__ */ t(
|
|
@@ -2171,7 +2166,7 @@ function en({
|
|
|
2171
2166
|
align: "end",
|
|
2172
2167
|
onEscapeKeyDown: h,
|
|
2173
2168
|
onPointerDownOutside: h,
|
|
2174
|
-
children:
|
|
2169
|
+
children: w
|
|
2175
2170
|
}
|
|
2176
2171
|
)
|
|
2177
2172
|
] }) : /* @__PURE__ */ t(Ae, { open: u, onOpenChange: c, children: /* @__PURE__ */ r(
|
|
@@ -2202,7 +2197,7 @@ function en({
|
|
|
2202
2197
|
}
|
|
2203
2198
|
) });
|
|
2204
2199
|
}
|
|
2205
|
-
const
|
|
2200
|
+
const en = [
|
|
2206
2201
|
"enum",
|
|
2207
2202
|
"multi_enum",
|
|
2208
2203
|
"text",
|
|
@@ -2210,12 +2205,12 @@ const tn = [
|
|
|
2210
2205
|
"boolean",
|
|
2211
2206
|
"date"
|
|
2212
2207
|
];
|
|
2213
|
-
function
|
|
2208
|
+
function tn({
|
|
2214
2209
|
open: e,
|
|
2215
2210
|
onOpenChange: a,
|
|
2216
2211
|
initialMode: o = "manage"
|
|
2217
2212
|
}) {
|
|
2218
|
-
var
|
|
2213
|
+
var w;
|
|
2219
2214
|
const s = o === "create", {
|
|
2220
2215
|
forceClose: i,
|
|
2221
2216
|
handleOpenChange: n,
|
|
@@ -2223,29 +2218,29 @@ function an({
|
|
|
2223
2218
|
preventPassiveDismissDuringCreate: c,
|
|
2224
2219
|
resolvedOpen: l,
|
|
2225
2220
|
setIsCreateFlowActive: h
|
|
2226
|
-
} =
|
|
2221
|
+
} = _t({
|
|
2227
2222
|
open: e,
|
|
2228
2223
|
onOpenChange: a,
|
|
2229
2224
|
initialCreateFlowActive: o === "create",
|
|
2230
2225
|
dismissMode: "explicit-only"
|
|
2231
|
-
}), u = D((x) => x.dashboard), m = D((x) => x.selectedSheetId), { setDashboardInputs: p } =
|
|
2226
|
+
}), u = D((x) => x.dashboard), m = D((x) => x.selectedSheetId), { setDashboardInputs: p } = de(), g = (w = u.sheets) == null ? void 0 : w.find(
|
|
2232
2227
|
(x) => x.id === m
|
|
2233
2228
|
), f = (g == null ? void 0 : g.kind) === "document" && !!g.document, v = re(
|
|
2234
|
-
() => f && (g != null && g.document) ?
|
|
2229
|
+
() => f && (g != null && g.document) ? xr(u, g.id) : [],
|
|
2235
2230
|
[u, f, g == null ? void 0 : g.document, g == null ? void 0 : g.id]
|
|
2236
|
-
),
|
|
2231
|
+
), N = re(
|
|
2237
2232
|
() => v.filter(
|
|
2238
2233
|
(x) => x.kind === "control"
|
|
2239
2234
|
),
|
|
2240
2235
|
[v]
|
|
2241
|
-
),
|
|
2242
|
-
() =>
|
|
2243
|
-
[
|
|
2244
|
-
), M = re(
|
|
2245
|
-
() => nn(E),
|
|
2246
|
-
[E]
|
|
2236
|
+
), T = re(
|
|
2237
|
+
() => N.map((x) => x.control),
|
|
2238
|
+
[N]
|
|
2247
2239
|
), U = re(
|
|
2248
|
-
() => rn(
|
|
2240
|
+
() => rn(T),
|
|
2241
|
+
[T]
|
|
2242
|
+
), M = re(
|
|
2243
|
+
() => an(u),
|
|
2249
2244
|
[u]
|
|
2250
2245
|
), A = ae(() => {
|
|
2251
2246
|
if (s) {
|
|
@@ -2254,15 +2249,15 @@ function an({
|
|
|
2254
2249
|
}
|
|
2255
2250
|
h(!1);
|
|
2256
2251
|
}, [s, i, h]), O = ae(
|
|
2257
|
-
(x,
|
|
2252
|
+
(x, F, S) => {
|
|
2258
2253
|
!f || !(g != null && g.document) || p(
|
|
2259
|
-
|
|
2254
|
+
sn({
|
|
2260
2255
|
allInputs: u.inputs || [],
|
|
2261
2256
|
documentSheetId: g.id,
|
|
2262
2257
|
currentDocumentInputs: v,
|
|
2263
2258
|
nextControls: x,
|
|
2264
|
-
nextDefaultValues:
|
|
2265
|
-
change:
|
|
2259
|
+
nextDefaultValues: F,
|
|
2260
|
+
change: S
|
|
2266
2261
|
})
|
|
2267
2262
|
);
|
|
2268
2263
|
},
|
|
@@ -2292,18 +2287,18 @@ function an({
|
|
|
2292
2287
|
)
|
|
2293
2288
|
] }),
|
|
2294
2289
|
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ t(
|
|
2295
|
-
|
|
2290
|
+
zt,
|
|
2296
2291
|
{
|
|
2297
2292
|
scope: "dashboard",
|
|
2298
|
-
controls:
|
|
2299
|
-
reservedControlIds:
|
|
2300
|
-
defaultValues:
|
|
2293
|
+
controls: T,
|
|
2294
|
+
reservedControlIds: M,
|
|
2295
|
+
defaultValues: U,
|
|
2301
2296
|
usageByControlId: {},
|
|
2302
2297
|
availableFieldChoices: [],
|
|
2303
2298
|
availableMetricChoices: [],
|
|
2304
2299
|
structuralParticipants: [],
|
|
2305
2300
|
structuralParticipantIdsByControlId: {},
|
|
2306
|
-
allowedControlTypes:
|
|
2301
|
+
allowedControlTypes: en,
|
|
2307
2302
|
initialCreateFlow: o === "create",
|
|
2308
2303
|
onCreateFlowActiveChange: h,
|
|
2309
2304
|
onCreateFlowComplete: A,
|
|
@@ -2315,22 +2310,22 @@ function an({
|
|
|
2315
2310
|
}
|
|
2316
2311
|
) });
|
|
2317
2312
|
}
|
|
2318
|
-
function
|
|
2313
|
+
function an(e) {
|
|
2319
2314
|
return (e.controls || []).map((a) => a.id);
|
|
2320
2315
|
}
|
|
2321
|
-
function
|
|
2316
|
+
function rn(e) {
|
|
2322
2317
|
const a = {};
|
|
2323
2318
|
for (const o of e)
|
|
2324
2319
|
o.defaultValue !== void 0 && (a[o.id] = o.defaultValue);
|
|
2325
2320
|
return a;
|
|
2326
2321
|
}
|
|
2327
|
-
function
|
|
2322
|
+
function nn(e, a) {
|
|
2328
2323
|
return a ? Object.prototype.hasOwnProperty.call(a, e.id) ? {
|
|
2329
2324
|
...e,
|
|
2330
2325
|
defaultValue: a[e.id]
|
|
2331
2326
|
} : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 };
|
|
2332
2327
|
}
|
|
2333
|
-
function
|
|
2328
|
+
function sn({
|
|
2334
2329
|
allInputs: e,
|
|
2335
2330
|
documentSheetId: a,
|
|
2336
2331
|
currentDocumentInputs: o,
|
|
@@ -2341,7 +2336,7 @@ function on({
|
|
|
2341
2336
|
const d = new Map(
|
|
2342
2337
|
s.map((p) => [
|
|
2343
2338
|
p.id,
|
|
2344
|
-
|
|
2339
|
+
nn(p, i)
|
|
2345
2340
|
])
|
|
2346
2341
|
), c = (n == null ? void 0 : n.type) === "rename" ? { oldId: n.oldId, newId: n.newId } : null, l = /* @__PURE__ */ new Set(), h = [];
|
|
2347
2342
|
for (const p of o) {
|
|
@@ -2353,10 +2348,10 @@ function on({
|
|
|
2353
2348
|
if (!g)
|
|
2354
2349
|
continue;
|
|
2355
2350
|
l.add(g.id);
|
|
2356
|
-
const f =
|
|
2351
|
+
const f = ir(
|
|
2357
2352
|
g.id,
|
|
2358
2353
|
[...e, ...h].filter(
|
|
2359
|
-
(
|
|
2354
|
+
(N) => N.id !== p.id
|
|
2360
2355
|
)
|
|
2361
2356
|
), v = g.id === f ? g : { ...g, id: f };
|
|
2362
2357
|
h.push({
|
|
@@ -2369,7 +2364,7 @@ function on({
|
|
|
2369
2364
|
}
|
|
2370
2365
|
for (const p of d.values())
|
|
2371
2366
|
l.has(p.id) || h.push(
|
|
2372
|
-
|
|
2367
|
+
vr({
|
|
2373
2368
|
control: p,
|
|
2374
2369
|
existingInputs: [...e, ...h],
|
|
2375
2370
|
sheetId: a
|
|
@@ -2382,7 +2377,7 @@ function on({
|
|
|
2382
2377
|
(p) => !u.has(p.id)
|
|
2383
2378
|
), ...h];
|
|
2384
2379
|
}
|
|
2385
|
-
function
|
|
2380
|
+
function on({
|
|
2386
2381
|
showFilters: e,
|
|
2387
2382
|
onShowFiltersChange: a,
|
|
2388
2383
|
pickerContent: o,
|
|
@@ -2398,7 +2393,7 @@ function ln({
|
|
|
2398
2393
|
return /* @__PURE__ */ r(
|
|
2399
2394
|
"div",
|
|
2400
2395
|
{
|
|
2401
|
-
className:
|
|
2396
|
+
className: J(
|
|
2402
2397
|
// Height lives on the shell so the outer border is part of the
|
|
2403
2398
|
// h-7 box (matches regular `size="xs"` buttons). Inner triggers
|
|
2404
2399
|
// stretch to fill via `h-full`.
|
|
@@ -2407,18 +2402,18 @@ function ln({
|
|
|
2407
2402
|
n
|
|
2408
2403
|
),
|
|
2409
2404
|
children: [
|
|
2410
|
-
/* @__PURE__ */ r(
|
|
2405
|
+
/* @__PURE__ */ r(Me, { open: e, onOpenChange: a, children: [
|
|
2411
2406
|
/* @__PURE__ */ t(Re, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2412
|
-
|
|
2407
|
+
L,
|
|
2413
2408
|
{
|
|
2414
2409
|
variant: "ghost",
|
|
2415
2410
|
size: "xs",
|
|
2416
|
-
className:
|
|
2411
|
+
className: J(
|
|
2417
2412
|
"h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
|
|
2418
2413
|
d
|
|
2419
2414
|
),
|
|
2420
2415
|
children: [
|
|
2421
|
-
e ? /* @__PURE__ */ t(
|
|
2416
|
+
e ? /* @__PURE__ */ t(gr, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Ut, { className: "h-3.5 w-3.5" }),
|
|
2422
2417
|
"Filter"
|
|
2423
2418
|
]
|
|
2424
2419
|
}
|
|
@@ -2428,7 +2423,7 @@ function ln({
|
|
|
2428
2423
|
{
|
|
2429
2424
|
align: "end",
|
|
2430
2425
|
sideOffset: 6,
|
|
2431
|
-
className:
|
|
2426
|
+
className: J(
|
|
2432
2427
|
"w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
|
|
2433
2428
|
l
|
|
2434
2429
|
),
|
|
@@ -2437,18 +2432,18 @@ function ln({
|
|
|
2437
2432
|
}
|
|
2438
2433
|
)
|
|
2439
2434
|
] }),
|
|
2440
|
-
/* @__PURE__ */ r(
|
|
2435
|
+
/* @__PURE__ */ r(Me, { open: m, onOpenChange: p, children: [
|
|
2441
2436
|
/* @__PURE__ */ t(Re, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2442
|
-
|
|
2437
|
+
L,
|
|
2443
2438
|
{
|
|
2444
2439
|
variant: "ghost",
|
|
2445
2440
|
size: "xs",
|
|
2446
|
-
className:
|
|
2441
|
+
className: J(
|
|
2447
2442
|
"h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
|
|
2448
2443
|
c
|
|
2449
2444
|
),
|
|
2450
2445
|
"aria-label": "Filter and control actions",
|
|
2451
|
-
children: /* @__PURE__ */ t(
|
|
2446
|
+
children: /* @__PURE__ */ t(Rt, { className: "h-3.5 w-3.5" })
|
|
2452
2447
|
}
|
|
2453
2448
|
) }),
|
|
2454
2449
|
/* @__PURE__ */ t(
|
|
@@ -2456,7 +2451,7 @@ function ln({
|
|
|
2456
2451
|
{
|
|
2457
2452
|
align: "end",
|
|
2458
2453
|
sideOffset: 6,
|
|
2459
|
-
className:
|
|
2454
|
+
className: J(
|
|
2460
2455
|
"w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
|
|
2461
2456
|
h
|
|
2462
2457
|
),
|
|
@@ -2469,9 +2464,9 @@ function ln({
|
|
|
2469
2464
|
}
|
|
2470
2465
|
);
|
|
2471
2466
|
}
|
|
2472
|
-
function
|
|
2473
|
-
|
|
2474
|
-
const e = D((l) => l.selectedSheetId), a = D((l) => l.selectedFrameId), o = D((l) => l.dashboard), s = D((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } =
|
|
2467
|
+
function ln() {
|
|
2468
|
+
br();
|
|
2469
|
+
const e = D((l) => l.selectedSheetId), a = D((l) => l.selectedFrameId), o = D((l) => l.dashboard), s = D((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = de(), { setCard: n } = qe(), d = ee((l) => l.card.dataSource);
|
|
2475
2470
|
return ge(() => {
|
|
2476
2471
|
var h, u;
|
|
2477
2472
|
let l = s();
|
|
@@ -2487,23 +2482,28 @@ function dn() {
|
|
|
2487
2482
|
hasEntities: !!(d != null && d.selectedEntities && d.selectedEntities.length > 0)
|
|
2488
2483
|
};
|
|
2489
2484
|
}
|
|
2490
|
-
function
|
|
2485
|
+
function dn() {
|
|
2491
2486
|
const e = D((l) => l.dashboard), a = D(
|
|
2492
2487
|
(l) => l.semanticExecutionPayload
|
|
2493
|
-
), o = D(
|
|
2494
|
-
() =>
|
|
2488
|
+
), o = D(
|
|
2489
|
+
(l) => l.actions.addFilterInput
|
|
2490
|
+
), { hasEntities: s } = ln(), { isLoading: i } = Pa(), n = re(
|
|
2491
|
+
() => lr(e, a),
|
|
2495
2492
|
[e, a]
|
|
2496
|
-
), c = !
|
|
2493
|
+
), c = !dr(e) && n.hasEligibleCards && !i;
|
|
2497
2494
|
return /* @__PURE__ */ r("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
|
|
2498
2495
|
c && /* @__PURE__ */ t("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
|
|
2499
2496
|
"button",
|
|
2500
2497
|
{
|
|
2501
2498
|
type: "button",
|
|
2502
|
-
onClick: () => o(
|
|
2499
|
+
onClick: () => o(cr(), {
|
|
2500
|
+
kind: "allSheets",
|
|
2501
|
+
sheetKinds: ["dashboard"]
|
|
2502
|
+
}),
|
|
2503
2503
|
title: `Applies to ${n.eligibleCardCount} of ${n.totalCardCount} date-aware cards`,
|
|
2504
2504
|
className: "flex w-full items-start gap-2 rounded-control px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border",
|
|
2505
2505
|
children: [
|
|
2506
|
-
/* @__PURE__ */ t(
|
|
2506
|
+
/* @__PURE__ */ t(Sr, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
2507
2507
|
/* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col", children: [
|
|
2508
2508
|
/* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
|
|
2509
2509
|
/* @__PURE__ */ t("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
|
|
@@ -2516,11 +2516,10 @@ function cn() {
|
|
|
2516
2516
|
/* @__PURE__ */ t("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
|
|
2517
2517
|
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
|
|
2518
2518
|
] }),
|
|
2519
|
-
s && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(
|
|
2519
|
+
s && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(Ma, { context: "filter" }) })
|
|
2520
2520
|
] });
|
|
2521
2521
|
}
|
|
2522
|
-
|
|
2523
|
-
function un({
|
|
2522
|
+
function cn({
|
|
2524
2523
|
onAddFilter: e,
|
|
2525
2524
|
onAddControl: a,
|
|
2526
2525
|
onManageControls: o,
|
|
@@ -2528,10 +2527,8 @@ function un({
|
|
|
2528
2527
|
}) {
|
|
2529
2528
|
const i = D(
|
|
2530
2529
|
(c) => c.dashboard.filterLayout
|
|
2531
|
-
), { setFilterLayout: n } =
|
|
2532
|
-
|
|
2533
|
-
const d = (i == null ? void 0 : i.toolbarWrap) ?? !1;
|
|
2534
|
-
return i == null || i.showDownloadButton, /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
|
|
2530
|
+
), { setFilterLayout: n } = de(), d = (i == null ? void 0 : i.toolbarWrap) ?? !1;
|
|
2531
|
+
return /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
|
|
2535
2532
|
/* @__PURE__ */ r("div", { className: "p-1", children: [
|
|
2536
2533
|
/* @__PURE__ */ t(
|
|
2537
2534
|
at,
|
|
@@ -2546,7 +2543,7 @@ function un({
|
|
|
2546
2543
|
/* @__PURE__ */ t(
|
|
2547
2544
|
at,
|
|
2548
2545
|
{
|
|
2549
|
-
icon:
|
|
2546
|
+
icon: It,
|
|
2550
2547
|
label: "Add control",
|
|
2551
2548
|
onClick: () => {
|
|
2552
2549
|
a(), s();
|
|
@@ -2556,7 +2553,7 @@ function un({
|
|
|
2556
2553
|
/* @__PURE__ */ t(
|
|
2557
2554
|
at,
|
|
2558
2555
|
{
|
|
2559
|
-
icon:
|
|
2556
|
+
icon: Mt,
|
|
2560
2557
|
label: "Manage controls",
|
|
2561
2558
|
onClick: () => {
|
|
2562
2559
|
o(), s();
|
|
@@ -2567,17 +2564,15 @@ function un({
|
|
|
2567
2564
|
/* @__PURE__ */ t("div", { className: "border-t border-border/60" }),
|
|
2568
2565
|
/* @__PURE__ */ r("div", { className: "space-y-1 p-2", children: [
|
|
2569
2566
|
/* @__PURE__ */ t("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
|
|
2570
|
-
At,
|
|
2571
2567
|
/* @__PURE__ */ t(
|
|
2572
|
-
|
|
2568
|
+
un,
|
|
2573
2569
|
{
|
|
2574
2570
|
id: "filter-display-wrap",
|
|
2575
2571
|
label: "Wrap to multiple lines",
|
|
2576
2572
|
checked: d,
|
|
2577
2573
|
onCheckedChange: (c) => n({ toolbarWrap: c === !0 })
|
|
2578
2574
|
}
|
|
2579
|
-
)
|
|
2580
|
-
At
|
|
2575
|
+
)
|
|
2581
2576
|
] })
|
|
2582
2577
|
] });
|
|
2583
2578
|
}
|
|
@@ -2599,7 +2594,7 @@ function at({
|
|
|
2599
2594
|
}
|
|
2600
2595
|
);
|
|
2601
2596
|
}
|
|
2602
|
-
function
|
|
2597
|
+
function un({
|
|
2603
2598
|
id: e,
|
|
2604
2599
|
label: a,
|
|
2605
2600
|
checked: o,
|
|
@@ -2617,7 +2612,7 @@ function hn({
|
|
|
2617
2612
|
)
|
|
2618
2613
|
] });
|
|
2619
2614
|
}
|
|
2620
|
-
function
|
|
2615
|
+
function us({
|
|
2621
2616
|
size: e,
|
|
2622
2617
|
className: a,
|
|
2623
2618
|
primaryButtonClassName: o,
|
|
@@ -2628,11 +2623,11 @@ function hs({
|
|
|
2628
2623
|
var O;
|
|
2629
2624
|
const [d, c] = k(null), l = D((C) => C.dashboard), h = D((C) => C.selectedSheetId), u = D((C) => C.showFilters), m = D((C) => C.actions), { setDocumentPanelTarget: p, setShowFilters: g } = m, f = (O = l.sheets) == null ? void 0 : O.find(
|
|
2630
2625
|
(C) => C.id === h
|
|
2631
|
-
), v =
|
|
2626
|
+
), v = ur(f), N = ae((C) => {
|
|
2632
2627
|
window.setTimeout(() => {
|
|
2633
2628
|
c(C);
|
|
2634
2629
|
}, 0);
|
|
2635
|
-
}, []),
|
|
2630
|
+
}, []), T = ae(
|
|
2636
2631
|
(C) => {
|
|
2637
2632
|
if (v && h) {
|
|
2638
2633
|
C && p(h, {
|
|
@@ -2649,25 +2644,25 @@ function hs({
|
|
|
2649
2644
|
p,
|
|
2650
2645
|
g
|
|
2651
2646
|
]
|
|
2652
|
-
),
|
|
2653
|
-
|
|
2654
|
-
}, [
|
|
2655
|
-
|
|
2656
|
-
}, [
|
|
2657
|
-
|
|
2658
|
-
}, [
|
|
2659
|
-
return /* @__PURE__ */ r(
|
|
2647
|
+
), U = ae(() => {
|
|
2648
|
+
T(!0);
|
|
2649
|
+
}, [T]), M = ae(() => {
|
|
2650
|
+
N("create");
|
|
2651
|
+
}, [N]), A = ae(() => {
|
|
2652
|
+
N("manage");
|
|
2653
|
+
}, [N]);
|
|
2654
|
+
return /* @__PURE__ */ r(_, { children: [
|
|
2660
2655
|
/* @__PURE__ */ t(
|
|
2661
|
-
|
|
2656
|
+
on,
|
|
2662
2657
|
{
|
|
2663
2658
|
showFilters: v ? !1 : u,
|
|
2664
|
-
onShowFiltersChange:
|
|
2665
|
-
pickerContent: /* @__PURE__ */ t(
|
|
2659
|
+
onShowFiltersChange: T,
|
|
2660
|
+
pickerContent: /* @__PURE__ */ t(dn, {}),
|
|
2666
2661
|
settingsContent: (C) => /* @__PURE__ */ t(
|
|
2667
|
-
|
|
2662
|
+
cn,
|
|
2668
2663
|
{
|
|
2669
|
-
onAddFilter:
|
|
2670
|
-
onAddControl:
|
|
2664
|
+
onAddFilter: U,
|
|
2665
|
+
onAddControl: M,
|
|
2671
2666
|
onManageControls: A,
|
|
2672
2667
|
onDismiss: C
|
|
2673
2668
|
}
|
|
@@ -2681,7 +2676,7 @@ function hs({
|
|
|
2681
2676
|
}
|
|
2682
2677
|
),
|
|
2683
2678
|
d ? v ? /* @__PURE__ */ t(
|
|
2684
|
-
|
|
2679
|
+
tn,
|
|
2685
2680
|
{
|
|
2686
2681
|
open: !0,
|
|
2687
2682
|
onOpenChange: (C) => {
|
|
@@ -2690,7 +2685,7 @@ function hs({
|
|
|
2690
2685
|
initialMode: d
|
|
2691
2686
|
}
|
|
2692
2687
|
) : /* @__PURE__ */ t(
|
|
2693
|
-
|
|
2688
|
+
Jr,
|
|
2694
2689
|
{
|
|
2695
2690
|
open: !0,
|
|
2696
2691
|
onOpenChange: (C) => {
|
|
@@ -2702,7 +2697,7 @@ function hs({
|
|
|
2702
2697
|
) : null
|
|
2703
2698
|
] });
|
|
2704
2699
|
}
|
|
2705
|
-
function
|
|
2700
|
+
function hn({
|
|
2706
2701
|
disabled: e,
|
|
2707
2702
|
briefingCount: a,
|
|
2708
2703
|
className: o,
|
|
@@ -2710,28 +2705,28 @@ function mn({
|
|
|
2710
2705
|
}) {
|
|
2711
2706
|
const i = typeof a == "number" && a > 0;
|
|
2712
2707
|
return /* @__PURE__ */ r(
|
|
2713
|
-
|
|
2708
|
+
L,
|
|
2714
2709
|
{
|
|
2715
2710
|
type: "button",
|
|
2716
2711
|
size: "xs",
|
|
2717
2712
|
variant: "outline",
|
|
2718
2713
|
disabled: e,
|
|
2719
|
-
className:
|
|
2714
|
+
className: J("gap-1.5", o),
|
|
2720
2715
|
onClick: s,
|
|
2721
2716
|
"aria-label": "Reports & briefings",
|
|
2722
2717
|
children: [
|
|
2723
|
-
/* @__PURE__ */ t(
|
|
2718
|
+
/* @__PURE__ */ t(Ar, { className: "h-3.5 w-3.5" }),
|
|
2724
2719
|
"Reports & briefings",
|
|
2725
2720
|
i ? /* @__PURE__ */ t("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
|
|
2726
2721
|
]
|
|
2727
2722
|
}
|
|
2728
2723
|
);
|
|
2729
2724
|
}
|
|
2730
|
-
const
|
|
2731
|
-
function
|
|
2725
|
+
const mn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", qt = "inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", Ue = "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-3 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50";
|
|
2726
|
+
function pn(e) {
|
|
2732
2727
|
return e === "dashboard" ? "This dashboard" : "Project";
|
|
2733
2728
|
}
|
|
2734
|
-
function
|
|
2729
|
+
function fn(e) {
|
|
2735
2730
|
if (!e) return "Never";
|
|
2736
2731
|
const a = new Date(e);
|
|
2737
2732
|
if (Number.isNaN(a.getTime())) return "Unknown";
|
|
@@ -2745,26 +2740,26 @@ function gn(e) {
|
|
|
2745
2740
|
const d = Math.round(n / 7);
|
|
2746
2741
|
return d < 5 ? `${d}w ago` : `${Math.round(n / 30)}mo ago`;
|
|
2747
2742
|
}
|
|
2748
|
-
function
|
|
2749
|
-
return e.scheduleExpr ?
|
|
2743
|
+
function gn(e) {
|
|
2744
|
+
return e.scheduleExpr ? yr(
|
|
2750
2745
|
e.scheduleExpr,
|
|
2751
2746
|
e.timezone || "UTC"
|
|
2752
2747
|
) ?? "Invalid schedule" : "On demand";
|
|
2753
2748
|
}
|
|
2754
|
-
function
|
|
2749
|
+
function bn(e) {
|
|
2755
2750
|
if (e.lastRunStatus) {
|
|
2756
2751
|
const a = e.lastRunStatus.toString().toUpperCase();
|
|
2757
2752
|
return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${e.lastRunStatus.toString().toLowerCase()}`;
|
|
2758
2753
|
}
|
|
2759
2754
|
return null;
|
|
2760
2755
|
}
|
|
2761
|
-
function
|
|
2756
|
+
function Qt(e) {
|
|
2762
2757
|
return e.hasActiveRun ? "Running" : e.lastRunStatus ? `Last run ${e.lastRunStatus.toString().toLowerCase()}` : "Idle";
|
|
2763
2758
|
}
|
|
2764
|
-
function
|
|
2759
|
+
function xn(e) {
|
|
2765
2760
|
return e.source.type === "dashboard" ? "This dashboard" : "Project";
|
|
2766
2761
|
}
|
|
2767
|
-
function
|
|
2762
|
+
function vn({
|
|
2768
2763
|
activeView: e,
|
|
2769
2764
|
onChange: a
|
|
2770
2765
|
}) {
|
|
@@ -2783,11 +2778,11 @@ function yn({
|
|
|
2783
2778
|
role: "tab",
|
|
2784
2779
|
"aria-selected": s,
|
|
2785
2780
|
onClick: () => a(o),
|
|
2786
|
-
className:
|
|
2781
|
+
className: J(
|
|
2787
2782
|
"h-6 rounded-[3px] px-2 text-[11px] transition-colors",
|
|
2788
2783
|
s ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
2789
2784
|
),
|
|
2790
|
-
children:
|
|
2785
|
+
children: pn(o)
|
|
2791
2786
|
},
|
|
2792
2787
|
o
|
|
2793
2788
|
);
|
|
@@ -2795,7 +2790,7 @@ function yn({
|
|
|
2795
2790
|
}
|
|
2796
2791
|
);
|
|
2797
2792
|
}
|
|
2798
|
-
function
|
|
2793
|
+
function yn({
|
|
2799
2794
|
briefings: e,
|
|
2800
2795
|
dashboardLabel: a,
|
|
2801
2796
|
sourceView: o,
|
|
@@ -2812,22 +2807,22 @@ function Cn({
|
|
|
2812
2807
|
onTogglePause: g,
|
|
2813
2808
|
onDelete: f,
|
|
2814
2809
|
selectingId: v,
|
|
2815
|
-
busyId:
|
|
2816
|
-
manageBriefingsHref:
|
|
2817
|
-
contentKind:
|
|
2818
|
-
hideHeader:
|
|
2810
|
+
busyId: N,
|
|
2811
|
+
manageBriefingsHref: T,
|
|
2812
|
+
contentKind: U,
|
|
2813
|
+
hideHeader: M = !1
|
|
2819
2814
|
}) {
|
|
2820
|
-
const A = e.length, O = e.filter((
|
|
2815
|
+
const A = e.length, O = e.filter((S) => S.status === "ACTIVE").length, C = U === "reports" ? A === 1 ? "report" : "reports" : U === "briefings" ? A === 1 ? "briefing" : "briefings" : A === 1 ? "item" : "items", w = e.find((S) => S.hasActiveRun) ?? null, x = U ?? "reports & briefings", F = o === "dashboard" ? a : `Project ${x}`;
|
|
2821
2816
|
return /* @__PURE__ */ r(
|
|
2822
2817
|
"section",
|
|
2823
2818
|
{
|
|
2824
2819
|
"aria-label": `Dashboard ${x.replace("&", "and")}`,
|
|
2825
2820
|
className: "flex h-full min-h-0 flex-col bg-background text-foreground",
|
|
2826
2821
|
children: [
|
|
2827
|
-
|
|
2822
|
+
M ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
2828
2823
|
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
2829
|
-
/* @__PURE__ */ t("div", { className:
|
|
2830
|
-
/* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children:
|
|
2824
|
+
/* @__PURE__ */ t("div", { className: mn, children: x }),
|
|
2825
|
+
/* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: F })
|
|
2831
2826
|
] }),
|
|
2832
2827
|
/* @__PURE__ */ t(
|
|
2833
2828
|
"button",
|
|
@@ -2836,14 +2831,14 @@ function Cn({
|
|
|
2836
2831
|
onClick: d,
|
|
2837
2832
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2838
2833
|
"aria-label": `Close ${x.replace("&", "and")} panel`,
|
|
2839
|
-
children: /* @__PURE__ */ t(
|
|
2834
|
+
children: /* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5" })
|
|
2840
2835
|
}
|
|
2841
2836
|
)
|
|
2842
2837
|
] }),
|
|
2843
2838
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 border-b border-border px-4 py-2", children: [
|
|
2844
2839
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
2845
2840
|
/* @__PURE__ */ t(
|
|
2846
|
-
|
|
2841
|
+
vn,
|
|
2847
2842
|
{
|
|
2848
2843
|
activeView: o,
|
|
2849
2844
|
onChange: n
|
|
@@ -2857,7 +2852,7 @@ function Cn({
|
|
|
2857
2852
|
"No ",
|
|
2858
2853
|
x,
|
|
2859
2854
|
" yet"
|
|
2860
|
-
] }) : /* @__PURE__ */ r(
|
|
2855
|
+
] }) : /* @__PURE__ */ r(_, { children: [
|
|
2861
2856
|
/* @__PURE__ */ r("span", { className: "font-medium text-foreground/80", children: [
|
|
2862
2857
|
A,
|
|
2863
2858
|
" ",
|
|
@@ -2879,11 +2874,11 @@ function Cn({
|
|
|
2879
2874
|
/* @__PURE__ */ t(ne, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
|
|
2880
2875
|
) : null,
|
|
2881
2876
|
A > 0 && h ? m && u ? /* @__PURE__ */ r(Qe, { children: [
|
|
2882
|
-
/* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ r("button", { className:
|
|
2877
|
+
/* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Ue, children: [
|
|
2883
2878
|
/* @__PURE__ */ t(be, { className: "h-3 w-3" }),
|
|
2884
2879
|
" New"
|
|
2885
2880
|
] }) }),
|
|
2886
|
-
/* @__PURE__ */ r(
|
|
2881
|
+
/* @__PURE__ */ r(Ke, { align: "end", children: [
|
|
2887
2882
|
/* @__PURE__ */ t(Y, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
|
|
2888
2883
|
/* @__PURE__ */ t(
|
|
2889
2884
|
Y,
|
|
@@ -2897,7 +2892,7 @@ function Cn({
|
|
|
2897
2892
|
"button",
|
|
2898
2893
|
{
|
|
2899
2894
|
onClick: () => l("scheduled_report"),
|
|
2900
|
-
className:
|
|
2895
|
+
className: Ue,
|
|
2901
2896
|
children: [
|
|
2902
2897
|
/* @__PURE__ */ t(be, { className: "h-3 w-3" }),
|
|
2903
2898
|
" Schedule report"
|
|
@@ -2907,7 +2902,7 @@ function Cn({
|
|
|
2907
2902
|
"button",
|
|
2908
2903
|
{
|
|
2909
2904
|
onClick: () => l("analytical_briefing"),
|
|
2910
|
-
className:
|
|
2905
|
+
className: Ue,
|
|
2911
2906
|
children: [
|
|
2912
2907
|
/* @__PURE__ */ t(be, { className: "h-3 w-3" }),
|
|
2913
2908
|
" New briefing"
|
|
@@ -2916,46 +2911,46 @@ function Cn({
|
|
|
2916
2911
|
) : null : null
|
|
2917
2912
|
] })
|
|
2918
2913
|
] }),
|
|
2919
|
-
|
|
2914
|
+
w ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
|
|
2920
2915
|
/* @__PURE__ */ t(ne, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
|
|
2921
|
-
/* @__PURE__ */ t("span", { className: "font-medium text-foreground", children:
|
|
2916
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: w.name }),
|
|
2922
2917
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
2923
|
-
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children:
|
|
2918
|
+
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: Qt(w) })
|
|
2924
2919
|
] }) : null,
|
|
2925
2920
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
|
|
2926
2921
|
s ? /* @__PURE__ */ t("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: s }) : null,
|
|
2927
2922
|
!i && e.length === 0 && !s ? /* @__PURE__ */ t(
|
|
2928
|
-
|
|
2923
|
+
Cn,
|
|
2929
2924
|
{
|
|
2930
2925
|
onNew: l,
|
|
2931
2926
|
canCreate: h,
|
|
2932
2927
|
canCreateScheduledReport: u,
|
|
2933
2928
|
analyticalBriefingsEnabled: m,
|
|
2934
|
-
contentKind:
|
|
2929
|
+
contentKind: U
|
|
2935
2930
|
}
|
|
2936
2931
|
) : null,
|
|
2937
|
-
e.map((
|
|
2938
|
-
|
|
2932
|
+
e.map((S) => /* @__PURE__ */ t(
|
|
2933
|
+
Nn,
|
|
2939
2934
|
{
|
|
2940
|
-
briefing:
|
|
2941
|
-
isOpening: v ===
|
|
2942
|
-
isBusy:
|
|
2943
|
-
onOpen: () => c(
|
|
2944
|
-
onRunNow: () => p(
|
|
2945
|
-
onTogglePause: () => g(
|
|
2946
|
-
onDelete: () => f(
|
|
2935
|
+
briefing: S,
|
|
2936
|
+
isOpening: v === S.id,
|
|
2937
|
+
isBusy: N === S.id,
|
|
2938
|
+
onOpen: () => c(S.id),
|
|
2939
|
+
onRunNow: () => p(S),
|
|
2940
|
+
onTogglePause: () => g(S),
|
|
2941
|
+
onDelete: () => f(S)
|
|
2947
2942
|
},
|
|
2948
|
-
|
|
2943
|
+
S.id
|
|
2949
2944
|
))
|
|
2950
2945
|
] }),
|
|
2951
|
-
|
|
2946
|
+
T ? /* @__PURE__ */ t("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
|
|
2952
2947
|
"a",
|
|
2953
2948
|
{
|
|
2954
|
-
href:
|
|
2955
|
-
className:
|
|
2949
|
+
href: T,
|
|
2950
|
+
className: J(qt, "h-6 px-1 text-[11px]"),
|
|
2956
2951
|
children: [
|
|
2957
2952
|
"Manage all reports & briefings",
|
|
2958
|
-
/* @__PURE__ */ t(
|
|
2953
|
+
/* @__PURE__ */ t(wr, { className: "h-3 w-3" })
|
|
2959
2954
|
]
|
|
2960
2955
|
}
|
|
2961
2956
|
) }) : null
|
|
@@ -2963,7 +2958,7 @@ function Cn({
|
|
|
2963
2958
|
}
|
|
2964
2959
|
);
|
|
2965
2960
|
}
|
|
2966
|
-
function
|
|
2961
|
+
function Cn({
|
|
2967
2962
|
onNew: e,
|
|
2968
2963
|
canCreate: a,
|
|
2969
2964
|
canCreateScheduledReport: o,
|
|
@@ -2978,7 +2973,7 @@ function wn({
|
|
|
2978
2973
|
description: "Create an analytical briefing to monitor this dashboard and brief your team."
|
|
2979
2974
|
} : null;
|
|
2980
2975
|
return /* @__PURE__ */ r("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
|
|
2981
|
-
/* @__PURE__ */ t(
|
|
2976
|
+
/* @__PURE__ */ t(wn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
|
|
2982
2977
|
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: (n == null ? void 0 : n.title) ?? "Have an analyst brief your team" }),
|
|
2983
2978
|
/* @__PURE__ */ t("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (n == null ? void 0 : n.description) ?? "Describe what to watch. An analyst digs into this dashboard and the data behind it, then briefs your team on the cadence you choose." }),
|
|
2984
2979
|
a ? /* @__PURE__ */ r("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
|
|
@@ -2986,7 +2981,7 @@ function wn({
|
|
|
2986
2981
|
"button",
|
|
2987
2982
|
{
|
|
2988
2983
|
onClick: () => e("scheduled_report"),
|
|
2989
|
-
className:
|
|
2984
|
+
className: Ue,
|
|
2990
2985
|
children: [
|
|
2991
2986
|
/* @__PURE__ */ t(be, { className: "h-3 w-3" }),
|
|
2992
2987
|
" Schedule a report"
|
|
@@ -2997,14 +2992,14 @@ function wn({
|
|
|
2997
2992
|
"button",
|
|
2998
2993
|
{
|
|
2999
2994
|
onClick: () => e("analytical_briefing"),
|
|
3000
|
-
className:
|
|
2995
|
+
className: qt,
|
|
3001
2996
|
children: "Create analytical briefing"
|
|
3002
2997
|
}
|
|
3003
2998
|
) : null
|
|
3004
2999
|
] }) : null
|
|
3005
3000
|
] });
|
|
3006
3001
|
}
|
|
3007
|
-
function
|
|
3002
|
+
function wn({ className: e }) {
|
|
3008
3003
|
return /* @__PURE__ */ r(
|
|
3009
3004
|
"svg",
|
|
3010
3005
|
{
|
|
@@ -3181,7 +3176,7 @@ function Nn({ className: e }) {
|
|
|
3181
3176
|
}
|
|
3182
3177
|
);
|
|
3183
3178
|
}
|
|
3184
|
-
function
|
|
3179
|
+
function Nn({
|
|
3185
3180
|
briefing: e,
|
|
3186
3181
|
isOpening: a,
|
|
3187
3182
|
isBusy: o,
|
|
@@ -3190,11 +3185,11 @@ function Sn({
|
|
|
3190
3185
|
onTogglePause: n,
|
|
3191
3186
|
onDelete: d
|
|
3192
3187
|
}) {
|
|
3193
|
-
const c = e.status === "PAUSED", l = e.hasActiveRun, h =
|
|
3188
|
+
const c = e.status === "PAUSED", l = e.hasActiveRun, h = bn(e), u = fn(e.lastRunAt), m = e.lastRunStatus, p = le(e), g = m === "SUCCESS" ? Be.success.dot : m === "FAILED" ? Be.danger.dot : m ? Be.warning.dot : Be.neutral.dot;
|
|
3194
3189
|
return /* @__PURE__ */ r(
|
|
3195
3190
|
"div",
|
|
3196
3191
|
{
|
|
3197
|
-
className:
|
|
3192
|
+
className: J(
|
|
3198
3193
|
"group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
|
|
3199
3194
|
c && "opacity-70"
|
|
3200
3195
|
),
|
|
@@ -3217,11 +3212,11 @@ function Sn({
|
|
|
3217
3212
|
/* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
|
|
3218
3213
|
/* @__PURE__ */ t("span", { children: p.typeLabel }),
|
|
3219
3214
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
3220
|
-
/* @__PURE__ */ t("span", { children:
|
|
3215
|
+
/* @__PURE__ */ t("span", { children: xn(e) }),
|
|
3221
3216
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
3222
|
-
/* @__PURE__ */ t(
|
|
3223
|
-
/* @__PURE__ */ t("span", { className: "truncate", children:
|
|
3224
|
-
e.lastRunAt ? /* @__PURE__ */ r(
|
|
3217
|
+
/* @__PURE__ */ t(Ra, { className: "h-3 w-3" }),
|
|
3218
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: gn(e) }),
|
|
3219
|
+
e.lastRunAt ? /* @__PURE__ */ r(_, { children: [
|
|
3225
3220
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
3226
3221
|
/* @__PURE__ */ r("span", { children: [
|
|
3227
3222
|
"Last run ",
|
|
@@ -3233,13 +3228,13 @@ function Sn({
|
|
|
3233
3228
|
l ? /* @__PURE__ */ t(ne, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ t(
|
|
3234
3229
|
"span",
|
|
3235
3230
|
{
|
|
3236
|
-
className:
|
|
3231
|
+
className: J(
|
|
3237
3232
|
"inline-block h-1.5 w-1.5 shrink-0 rounded-full",
|
|
3238
3233
|
g
|
|
3239
3234
|
)
|
|
3240
3235
|
}
|
|
3241
3236
|
),
|
|
3242
|
-
/* @__PURE__ */ t("span", { className: "truncate", children: l ?
|
|
3237
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: l ? Qt(e) : h })
|
|
3243
3238
|
] }) : null
|
|
3244
3239
|
]
|
|
3245
3240
|
}
|
|
@@ -3252,12 +3247,12 @@ function Sn({
|
|
|
3252
3247
|
onClick: (f) => f.stopPropagation(),
|
|
3253
3248
|
className: "inline-flex h-6 w-6 items-center justify-center rounded-control text-muted-foreground/70 opacity-60 hover:bg-muted hover:text-foreground/80 focus-visible:opacity-100 group-hover:opacity-100",
|
|
3254
3249
|
"aria-label": `${p.noun === "report" ? "Report" : "Briefing"} actions`,
|
|
3255
|
-
children: /* @__PURE__ */ t(
|
|
3250
|
+
children: /* @__PURE__ */ t(Lt, { className: "h-3.5 w-3.5" })
|
|
3256
3251
|
}
|
|
3257
3252
|
) }),
|
|
3258
|
-
/* @__PURE__ */ r(
|
|
3253
|
+
/* @__PURE__ */ r(Ke, { align: "end", className: "w-44", children: [
|
|
3259
3254
|
/* @__PURE__ */ r(Y, { onClick: s, children: [
|
|
3260
|
-
/* @__PURE__ */ t(
|
|
3255
|
+
/* @__PURE__ */ t(Mt, { className: "h-3.5 w-3.5" }),
|
|
3261
3256
|
"Edit ",
|
|
3262
3257
|
p.noun
|
|
3263
3258
|
] }),
|
|
@@ -3268,7 +3263,7 @@ function Sn({
|
|
|
3268
3263
|
f.preventDefault(), i();
|
|
3269
3264
|
},
|
|
3270
3265
|
children: [
|
|
3271
|
-
/* @__PURE__ */ t(
|
|
3266
|
+
/* @__PURE__ */ t(Oa, { className: "h-3.5 w-3.5" }),
|
|
3272
3267
|
"Run now"
|
|
3273
3268
|
]
|
|
3274
3269
|
}
|
|
@@ -3279,11 +3274,11 @@ function Sn({
|
|
|
3279
3274
|
onClick: (f) => {
|
|
3280
3275
|
f.preventDefault(), n();
|
|
3281
3276
|
},
|
|
3282
|
-
children: c ? /* @__PURE__ */ r(
|
|
3283
|
-
/* @__PURE__ */ t(
|
|
3277
|
+
children: c ? /* @__PURE__ */ r(_, { children: [
|
|
3278
|
+
/* @__PURE__ */ t(_a, { className: "h-3.5 w-3.5" }),
|
|
3284
3279
|
"Resume"
|
|
3285
|
-
] }) : /* @__PURE__ */ r(
|
|
3286
|
-
/* @__PURE__ */ t(
|
|
3280
|
+
] }) : /* @__PURE__ */ r(_, { children: [
|
|
3281
|
+
/* @__PURE__ */ t(za, { className: "h-3.5 w-3.5" }),
|
|
3287
3282
|
"Pause"
|
|
3288
3283
|
] })
|
|
3289
3284
|
}
|
|
@@ -3309,18 +3304,18 @@ function Sn({
|
|
|
3309
3304
|
}
|
|
3310
3305
|
);
|
|
3311
3306
|
}
|
|
3312
|
-
function
|
|
3307
|
+
function Sn(e) {
|
|
3313
3308
|
return (e == null ? void 0 : e.trim()) || "This dashboard";
|
|
3314
3309
|
}
|
|
3315
|
-
function
|
|
3310
|
+
function kn(e) {
|
|
3316
3311
|
return e === "This dashboard" ? "Watch this dashboard" : `Watch ${e}`;
|
|
3317
3312
|
}
|
|
3318
|
-
function
|
|
3313
|
+
function Dn(e, a, o) {
|
|
3319
3314
|
return a !== "dashboard" ? e : e.filter(
|
|
3320
3315
|
(s) => s.source.type === "dashboard" && s.source.dashboardId === o
|
|
3321
3316
|
);
|
|
3322
3317
|
}
|
|
3323
|
-
async function
|
|
3318
|
+
async function An(e) {
|
|
3324
3319
|
const o = [];
|
|
3325
3320
|
let s = 1, i = 0, n = Number.POSITIVE_INFINITY;
|
|
3326
3321
|
for (; i < n; ) {
|
|
@@ -3334,18 +3329,18 @@ async function Fn(e) {
|
|
|
3334
3329
|
}
|
|
3335
3330
|
return o;
|
|
3336
3331
|
}
|
|
3337
|
-
const
|
|
3332
|
+
const Fn = {
|
|
3338
3333
|
listBriefings: Xa,
|
|
3339
|
-
getBriefing:
|
|
3334
|
+
getBriefing: Ga,
|
|
3340
3335
|
pauseBriefing: Ka,
|
|
3341
|
-
resumeBriefing:
|
|
3342
|
-
deleteBriefing:
|
|
3343
|
-
runBriefingNow:
|
|
3336
|
+
resumeBriefing: Ha,
|
|
3337
|
+
deleteBriefing: Qa,
|
|
3338
|
+
runBriefingNow: qa
|
|
3344
3339
|
};
|
|
3345
|
-
function
|
|
3346
|
-
return /* @__PURE__ */ t(
|
|
3340
|
+
function hs(e) {
|
|
3341
|
+
return /* @__PURE__ */ t(ja, { authToken: e.token ? { accessToken: e.token } : void 0, children: /* @__PURE__ */ t($a, { children: /* @__PURE__ */ t(In, { ...e }) }) });
|
|
3347
3342
|
}
|
|
3348
|
-
function
|
|
3343
|
+
function In({
|
|
3349
3344
|
dashboardId: e,
|
|
3350
3345
|
dashboardTitle: a,
|
|
3351
3346
|
apiServiceUrl: o,
|
|
@@ -3360,177 +3355,177 @@ function En({
|
|
|
3360
3355
|
openRun: m,
|
|
3361
3356
|
client: p
|
|
3362
3357
|
}) {
|
|
3363
|
-
const { authToken: g, tokenProps: f } =
|
|
3364
|
-
c === void 0 &&
|
|
3358
|
+
const { authToken: g, tokenProps: f } = Et(), v = Wa(), N = !u || v.canCreate && (u === "scheduled_report" || v.analyticalBriefingsEnabled), [T, U] = k(!1), M = c ?? T, A = (y) => {
|
|
3359
|
+
c === void 0 && U(y), l == null || l(y);
|
|
3365
3360
|
}, [O, C] = k(
|
|
3366
3361
|
u ? "author" : "list"
|
|
3367
|
-
), [
|
|
3362
|
+
), [w, x] = k(
|
|
3368
3363
|
u ?? "analytical_briefing"
|
|
3369
|
-
), [
|
|
3364
|
+
), [F, S] = k("dashboard"), [j, I] = k(
|
|
3370
3365
|
[]
|
|
3371
|
-
), [
|
|
3366
|
+
), [V, Z] = k(null), K = u && !N && !V ? "list" : O, [Q, H] = k(!1), [ce, z] = k(null), [ye, X] = k(null), [R, te] = k(
|
|
3372
3367
|
null
|
|
3373
|
-
), [
|
|
3368
|
+
), [me, pe] = k(null), Ce = rt(null), Ee = rt(M);
|
|
3374
3369
|
ge(() => {
|
|
3375
|
-
const y =
|
|
3376
|
-
Ee.current =
|
|
3377
|
-
}, [
|
|
3378
|
-
const
|
|
3370
|
+
const y = M && !Ee.current;
|
|
3371
|
+
Ee.current = M, !(!y || !u) && (Z(null), S("dashboard"), x(u), C("author"), pe(null));
|
|
3372
|
+
}, [M, u]);
|
|
3373
|
+
const Xe = vt(), $ = o ?? (f == null ? void 0 : f.apiServiceUrl), W = s ?? (g == null ? void 0 : g.accessToken), se = re(() => ({ ...Fn, ...p }), [p]), [we, Ye] = k(null);
|
|
3379
3374
|
ge(() => {
|
|
3380
|
-
if (!m ||
|
|
3375
|
+
if (!m || !$ || !W) return;
|
|
3381
3376
|
let y = !0;
|
|
3382
|
-
return
|
|
3383
|
-
y && (
|
|
3377
|
+
return se.getBriefing($, W, m.briefingId).then(({ briefing: P }) => {
|
|
3378
|
+
y && (Z(P), Ye(m), C("author"));
|
|
3384
3379
|
}, (P) => {
|
|
3385
|
-
y &&
|
|
3380
|
+
y && E.error(P instanceof Error ? P.message : "Could not open the run.");
|
|
3386
3381
|
}), () => {
|
|
3387
3382
|
y = !1;
|
|
3388
3383
|
};
|
|
3389
|
-
}, [m,
|
|
3390
|
-
const fe =
|
|
3391
|
-
const y =
|
|
3392
|
-
|
|
3393
|
-
|
|
3384
|
+
}, [m, $, W, se]);
|
|
3385
|
+
const fe = Sn(a), Te = re(() => {
|
|
3386
|
+
const y = Dn(
|
|
3387
|
+
j,
|
|
3388
|
+
F,
|
|
3394
3389
|
e
|
|
3395
3390
|
);
|
|
3396
3391
|
if (!u)
|
|
3397
3392
|
return y;
|
|
3398
3393
|
const P = u === "scheduled_report" ? "report" : "briefing";
|
|
3399
3394
|
return y.filter(
|
|
3400
|
-
(
|
|
3395
|
+
(Ve) => le(Ve).noun === P
|
|
3401
3396
|
);
|
|
3402
|
-
}, [e,
|
|
3397
|
+
}, [e, j, F, u]), Ze = re(() => F === "dashboard" ? {
|
|
3403
3398
|
source: { type: "dashboard", dashboardId: e },
|
|
3404
3399
|
label: fe,
|
|
3405
|
-
detail:
|
|
3400
|
+
detail: kn(fe)
|
|
3406
3401
|
} : {
|
|
3407
3402
|
source: { type: "project" },
|
|
3408
3403
|
label: "This project",
|
|
3409
3404
|
detail: "Use any data in this project."
|
|
3410
|
-
}, [e, fe,
|
|
3405
|
+
}, [e, fe, F]), Ne = !!($ && W), Se = Cr({
|
|
3411
3406
|
canCreate: v.canCreate,
|
|
3412
3407
|
analyticalBriefingsEnabled: v.analyticalBriefingsEnabled,
|
|
3413
|
-
scheduledReportAvailable:
|
|
3414
|
-
}),
|
|
3415
|
-
if (!(
|
|
3416
|
-
|
|
3408
|
+
scheduledReportAvailable: F === "dashboard"
|
|
3409
|
+
}), oe = ae(async () => {
|
|
3410
|
+
if (!(!$ || !W)) {
|
|
3411
|
+
H(!0), pe(null);
|
|
3417
3412
|
try {
|
|
3418
|
-
|
|
3419
|
-
await
|
|
3420
|
-
apiClient:
|
|
3421
|
-
apiServiceUrl:
|
|
3422
|
-
token:
|
|
3413
|
+
I(
|
|
3414
|
+
await An({
|
|
3415
|
+
apiClient: se,
|
|
3416
|
+
apiServiceUrl: $,
|
|
3417
|
+
token: W
|
|
3423
3418
|
})
|
|
3424
3419
|
);
|
|
3425
3420
|
} catch (y) {
|
|
3426
|
-
|
|
3421
|
+
pe(
|
|
3427
3422
|
y instanceof Error ? y.message : "Could not load briefings."
|
|
3428
3423
|
);
|
|
3429
3424
|
} finally {
|
|
3430
|
-
|
|
3425
|
+
H(!1);
|
|
3431
3426
|
}
|
|
3432
3427
|
}
|
|
3433
|
-
}, [
|
|
3428
|
+
}, [se, $, W]);
|
|
3434
3429
|
ge(() => {
|
|
3435
|
-
!
|
|
3436
|
-
}, [Ne,
|
|
3430
|
+
!M || K !== "list" || !Ne || oe();
|
|
3431
|
+
}, [Ne, K, oe, M]);
|
|
3437
3432
|
const ke = () => {
|
|
3438
|
-
|
|
3433
|
+
Z(null), S("dashboard"), C("list"), A(!0);
|
|
3439
3434
|
}, b = (y) => {
|
|
3440
|
-
|
|
3435
|
+
Z(null), x(y), C("author");
|
|
3441
3436
|
}, B = async (y) => {
|
|
3442
|
-
if (!(
|
|
3443
|
-
|
|
3437
|
+
if (!(!$ || !W)) {
|
|
3438
|
+
z(y), pe(null);
|
|
3444
3439
|
try {
|
|
3445
|
-
const P = await
|
|
3446
|
-
|
|
3447
|
-
|
|
3440
|
+
const P = await se.getBriefing(
|
|
3441
|
+
$,
|
|
3442
|
+
W,
|
|
3448
3443
|
y
|
|
3449
3444
|
);
|
|
3450
|
-
|
|
3445
|
+
Z(P.briefing), C("author");
|
|
3451
3446
|
} catch (P) {
|
|
3452
|
-
|
|
3447
|
+
pe(
|
|
3453
3448
|
P instanceof Error ? P.message : "Could not open briefing."
|
|
3454
3449
|
);
|
|
3455
3450
|
} finally {
|
|
3456
|
-
|
|
3451
|
+
z(null);
|
|
3457
3452
|
}
|
|
3458
3453
|
}
|
|
3459
|
-
},
|
|
3460
|
-
if (!(
|
|
3461
|
-
|
|
3454
|
+
}, q = async (y) => {
|
|
3455
|
+
if (!(!$ || !W)) {
|
|
3456
|
+
X(y.id);
|
|
3462
3457
|
try {
|
|
3463
|
-
const P = await
|
|
3464
|
-
|
|
3465
|
-
|
|
3458
|
+
const P = await se.runBriefingNow(
|
|
3459
|
+
$,
|
|
3460
|
+
W,
|
|
3466
3461
|
y.id,
|
|
3467
|
-
{ requestId:
|
|
3462
|
+
{ requestId: En() }
|
|
3468
3463
|
);
|
|
3469
|
-
|
|
3464
|
+
Xe.track({ kind: "briefing", id: P.run.id, title: y.name, briefingId: y.id }), oe();
|
|
3470
3465
|
} catch (P) {
|
|
3471
|
-
|
|
3466
|
+
E.error(
|
|
3472
3467
|
P instanceof Error ? P.message : "Could not start the run."
|
|
3473
3468
|
);
|
|
3474
3469
|
} finally {
|
|
3475
|
-
|
|
3470
|
+
X(null);
|
|
3476
3471
|
}
|
|
3477
3472
|
}
|
|
3478
|
-
},
|
|
3479
|
-
if (
|
|
3480
|
-
const { noun: P } =
|
|
3481
|
-
|
|
3473
|
+
}, ie = async (y) => {
|
|
3474
|
+
if (!$ || !W) return;
|
|
3475
|
+
const { noun: P } = le(y), Ve = P === "report" ? "Report" : "Briefing";
|
|
3476
|
+
X(y.id);
|
|
3482
3477
|
try {
|
|
3483
|
-
const Le = y.status === "PAUSED" ? await
|
|
3484
|
-
|
|
3485
|
-
|
|
3478
|
+
const Le = y.status === "PAUSED" ? await se.resumeBriefing(
|
|
3479
|
+
$,
|
|
3480
|
+
W,
|
|
3486
3481
|
y.id
|
|
3487
|
-
) : await
|
|
3488
|
-
|
|
3489
|
-
|
|
3482
|
+
) : await se.pauseBriefing(
|
|
3483
|
+
$,
|
|
3484
|
+
W,
|
|
3490
3485
|
y.id
|
|
3491
3486
|
);
|
|
3492
|
-
|
|
3493
|
-
Le.briefing.status === "PAUSED" ? `${
|
|
3494
|
-
),
|
|
3487
|
+
E.success(
|
|
3488
|
+
Le.briefing.status === "PAUSED" ? `${Ve} paused` : `${Ve} resumed`
|
|
3489
|
+
), oe();
|
|
3495
3490
|
} catch (Le) {
|
|
3496
|
-
|
|
3491
|
+
E.error(
|
|
3497
3492
|
Le instanceof Error ? Le.message : `Could not update the ${P} status.`
|
|
3498
3493
|
);
|
|
3499
3494
|
} finally {
|
|
3500
|
-
|
|
3495
|
+
X(null);
|
|
3501
3496
|
}
|
|
3502
|
-
},
|
|
3503
|
-
if (
|
|
3504
|
-
const y =
|
|
3505
|
-
|
|
3497
|
+
}, ue = async () => {
|
|
3498
|
+
if (!R || !$ || !W) return;
|
|
3499
|
+
const y = R;
|
|
3500
|
+
X(y.id);
|
|
3506
3501
|
try {
|
|
3507
|
-
await
|
|
3508
|
-
|
|
3509
|
-
|
|
3502
|
+
await se.deleteBriefing(
|
|
3503
|
+
$,
|
|
3504
|
+
W,
|
|
3510
3505
|
y.id
|
|
3511
3506
|
);
|
|
3512
|
-
const { noun: P } =
|
|
3513
|
-
|
|
3507
|
+
const { noun: P } = le(y);
|
|
3508
|
+
E.success(`${P === "report" ? "Report" : "Briefing"} deleted`), te(null), oe();
|
|
3514
3509
|
} catch (P) {
|
|
3515
|
-
|
|
3510
|
+
E.error(
|
|
3516
3511
|
P instanceof Error ? P.message : "Could not delete the briefing."
|
|
3517
3512
|
);
|
|
3518
3513
|
} finally {
|
|
3519
|
-
|
|
3514
|
+
X(null);
|
|
3520
3515
|
}
|
|
3521
|
-
},
|
|
3522
|
-
return v.surfaceVisible ? /* @__PURE__ */ r(
|
|
3516
|
+
}, Ht = Te.length;
|
|
3517
|
+
return v.surfaceVisible ? /* @__PURE__ */ r(Ya, { open: M, onOpenChange: A, children: [
|
|
3523
3518
|
h ? null : /* @__PURE__ */ t(
|
|
3524
|
-
|
|
3519
|
+
hn,
|
|
3525
3520
|
{
|
|
3526
3521
|
disabled: i || !Ne,
|
|
3527
|
-
briefingCount:
|
|
3522
|
+
briefingCount: Ht,
|
|
3528
3523
|
className: n,
|
|
3529
3524
|
onClick: ke
|
|
3530
3525
|
}
|
|
3531
3526
|
),
|
|
3532
3527
|
/* @__PURE__ */ r(
|
|
3533
|
-
|
|
3528
|
+
Za,
|
|
3534
3529
|
{
|
|
3535
3530
|
ref: Ce,
|
|
3536
3531
|
side: "right",
|
|
@@ -3541,9 +3536,9 @@ function En({
|
|
|
3541
3536
|
y.preventDefault(), (P = Ce.current) == null || P.focus({ preventScroll: !0 });
|
|
3542
3537
|
},
|
|
3543
3538
|
children: [
|
|
3544
|
-
/* @__PURE__ */ r(
|
|
3545
|
-
/* @__PURE__ */ t(
|
|
3546
|
-
/* @__PURE__ */ t(
|
|
3539
|
+
/* @__PURE__ */ r(Ja, { className: "sr-only", children: [
|
|
3540
|
+
/* @__PURE__ */ t(er, { children: "Reports & briefings" }),
|
|
3541
|
+
/* @__PURE__ */ t(tr, { children: "Manage reports and briefings for this dashboard." })
|
|
3547
3542
|
] }),
|
|
3548
3543
|
u ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
|
|
3549
3544
|
/* @__PURE__ */ r(
|
|
@@ -3558,17 +3553,17 @@ function En({
|
|
|
3558
3553
|
{
|
|
3559
3554
|
type: "button",
|
|
3560
3555
|
role: "tab",
|
|
3561
|
-
"aria-selected":
|
|
3562
|
-
disabled: !
|
|
3563
|
-
className:
|
|
3556
|
+
"aria-selected": K === "author",
|
|
3557
|
+
disabled: !N,
|
|
3558
|
+
className: J(
|
|
3564
3559
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3565
|
-
|
|
3566
|
-
!
|
|
3560
|
+
K === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
|
|
3561
|
+
!N && "cursor-not-allowed opacity-50"
|
|
3567
3562
|
),
|
|
3568
3563
|
onClick: () => {
|
|
3569
|
-
|
|
3564
|
+
N && (Z(null), x(u), S("dashboard"), C("author"));
|
|
3570
3565
|
},
|
|
3571
|
-
children:
|
|
3566
|
+
children: V ? `Edit ${le(V).noun}` : u === "scheduled_report" ? "Schedule report" : "Create briefing"
|
|
3572
3567
|
}
|
|
3573
3568
|
),
|
|
3574
3569
|
/* @__PURE__ */ t(
|
|
@@ -3576,10 +3571,10 @@ function En({
|
|
|
3576
3571
|
{
|
|
3577
3572
|
type: "button",
|
|
3578
3573
|
role: "tab",
|
|
3579
|
-
"aria-selected":
|
|
3580
|
-
className:
|
|
3574
|
+
"aria-selected": K === "list",
|
|
3575
|
+
className: J(
|
|
3581
3576
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3582
|
-
|
|
3577
|
+
K === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3583
3578
|
),
|
|
3584
3579
|
onClick: () => C("list"),
|
|
3585
3580
|
children: u === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
@@ -3595,19 +3590,19 @@ function En({
|
|
|
3595
3590
|
onClick: () => A(!1),
|
|
3596
3591
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3597
3592
|
"aria-label": u === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
|
|
3598
|
-
children: /* @__PURE__ */ t(
|
|
3593
|
+
children: /* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5" })
|
|
3599
3594
|
}
|
|
3600
3595
|
)
|
|
3601
3596
|
] }) : null,
|
|
3602
|
-
|
|
3603
|
-
|
|
3597
|
+
K === "list" ? /* @__PURE__ */ t(
|
|
3598
|
+
yn,
|
|
3604
3599
|
{
|
|
3605
|
-
briefings:
|
|
3600
|
+
briefings: Te,
|
|
3606
3601
|
dashboardLabel: fe,
|
|
3607
|
-
sourceView:
|
|
3608
|
-
error:
|
|
3609
|
-
loading:
|
|
3610
|
-
onSourceViewChange:
|
|
3602
|
+
sourceView: F,
|
|
3603
|
+
error: me,
|
|
3604
|
+
loading: Q,
|
|
3605
|
+
onSourceViewChange: S,
|
|
3611
3606
|
onClose: () => A(!1),
|
|
3612
3607
|
onEdit: (y) => {
|
|
3613
3608
|
B(y);
|
|
@@ -3621,40 +3616,40 @@ function En({
|
|
|
3621
3616
|
"analytical_briefing"
|
|
3622
3617
|
),
|
|
3623
3618
|
onRunNow: (y) => {
|
|
3624
|
-
|
|
3619
|
+
q(y);
|
|
3625
3620
|
},
|
|
3626
3621
|
onTogglePause: (y) => {
|
|
3627
|
-
|
|
3622
|
+
ie(y);
|
|
3628
3623
|
},
|
|
3629
|
-
onDelete: (y) =>
|
|
3630
|
-
selectingId:
|
|
3631
|
-
busyId:
|
|
3624
|
+
onDelete: (y) => te(y),
|
|
3625
|
+
selectingId: ce,
|
|
3626
|
+
busyId: ye,
|
|
3632
3627
|
manageBriefingsHref: d,
|
|
3633
3628
|
contentKind: u === "scheduled_report" ? "reports" : u === "analytical_briefing" ? "briefings" : void 0,
|
|
3634
3629
|
hideHeader: !!u
|
|
3635
3630
|
}
|
|
3636
3631
|
) : /* @__PURE__ */ t(
|
|
3637
|
-
|
|
3632
|
+
ar,
|
|
3638
3633
|
{
|
|
3639
|
-
apiServiceUrl:
|
|
3640
|
-
token:
|
|
3641
|
-
briefing:
|
|
3642
|
-
initialRunId: we && (
|
|
3643
|
-
intent:
|
|
3644
|
-
sourceContext:
|
|
3645
|
-
title:
|
|
3634
|
+
apiServiceUrl: $,
|
|
3635
|
+
token: W,
|
|
3636
|
+
briefing: V,
|
|
3637
|
+
initialRunId: we && (V == null ? void 0 : V.id) === we.briefingId ? we.runId : void 0,
|
|
3638
|
+
intent: w,
|
|
3639
|
+
sourceContext: V ? void 0 : Ze,
|
|
3640
|
+
title: V ? `Edit ${le(V).noun}` : w === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
|
|
3646
3641
|
hideHeader: !!u,
|
|
3647
3642
|
className: "h-full min-h-0 max-w-none border-0 shadow-none",
|
|
3648
3643
|
onBack: u ? void 0 : () => C("list"),
|
|
3649
3644
|
onCancel: () => A(!1),
|
|
3650
3645
|
onDeleted: () => {
|
|
3651
|
-
const y =
|
|
3652
|
-
|
|
3646
|
+
const y = V ? le(V).noun : "briefing";
|
|
3647
|
+
E.success(`${y === "report" ? "Report" : "Briefing"} deleted`), Z(null), C("list"), oe();
|
|
3653
3648
|
},
|
|
3654
3649
|
onRunStarted: () => {
|
|
3655
3650
|
},
|
|
3656
3651
|
onSaved: (y) => {
|
|
3657
|
-
|
|
3652
|
+
Z(y), oe();
|
|
3658
3653
|
},
|
|
3659
3654
|
onMinimizeRun: () => {
|
|
3660
3655
|
A(!1);
|
|
@@ -3667,35 +3662,35 @@ function En({
|
|
|
3667
3662
|
/* @__PURE__ */ t(
|
|
3668
3663
|
lt,
|
|
3669
3664
|
{
|
|
3670
|
-
open:
|
|
3665
|
+
open: !!R,
|
|
3671
3666
|
onOpenChange: (y) => {
|
|
3672
|
-
y ||
|
|
3667
|
+
y || te(null);
|
|
3673
3668
|
},
|
|
3674
3669
|
children: /* @__PURE__ */ r(dt, { children: [
|
|
3675
3670
|
/* @__PURE__ */ r(ct, { children: [
|
|
3676
3671
|
/* @__PURE__ */ r(ut, { children: [
|
|
3677
3672
|
"Delete",
|
|
3678
3673
|
" ",
|
|
3679
|
-
|
|
3674
|
+
R ? le(R).noun : "briefing",
|
|
3680
3675
|
"?"
|
|
3681
3676
|
] }),
|
|
3682
3677
|
/* @__PURE__ */ r(ht, { children: [
|
|
3683
3678
|
"This permanently deletes ",
|
|
3684
|
-
/* @__PURE__ */ t("strong", { children:
|
|
3679
|
+
/* @__PURE__ */ t("strong", { children: R == null ? void 0 : R.name }),
|
|
3685
3680
|
". Recipients will stop receiving it."
|
|
3686
3681
|
] })
|
|
3687
3682
|
] }),
|
|
3688
3683
|
/* @__PURE__ */ r(mt, { children: [
|
|
3689
3684
|
/* @__PURE__ */ t(pt, { children: "Cancel" }),
|
|
3690
3685
|
/* @__PURE__ */ r(
|
|
3691
|
-
|
|
3686
|
+
Vt,
|
|
3692
3687
|
{
|
|
3693
3688
|
className: "bg-destructive/90 hover:bg-destructive",
|
|
3694
|
-
onClick:
|
|
3689
|
+
onClick: ue,
|
|
3695
3690
|
children: [
|
|
3696
3691
|
"Delete",
|
|
3697
3692
|
" ",
|
|
3698
|
-
|
|
3693
|
+
R ? le(R).noun : "briefing"
|
|
3699
3694
|
]
|
|
3700
3695
|
}
|
|
3701
3696
|
)
|
|
@@ -3705,21 +3700,21 @@ function En({
|
|
|
3705
3700
|
)
|
|
3706
3701
|
] }) : null;
|
|
3707
3702
|
}
|
|
3708
|
-
function
|
|
3703
|
+
function En() {
|
|
3709
3704
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
3710
3705
|
}
|
|
3711
3706
|
export {
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3707
|
+
is as A,
|
|
3708
|
+
Jr as D,
|
|
3709
|
+
ls as U,
|
|
3710
|
+
ns as V,
|
|
3711
|
+
hn as W,
|
|
3712
|
+
os as a,
|
|
3713
|
+
cs as b,
|
|
3714
|
+
tn as c,
|
|
3715
|
+
on as d,
|
|
3716
|
+
us as e,
|
|
3717
|
+
hs as f,
|
|
3718
|
+
ds as i,
|
|
3719
|
+
ss as u
|
|
3725
3720
|
};
|