react-semaphor 0.1.531 → 0.1.533
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brand-studio/index.js +1 -1
- package/dist/chunks/{dashboard-BHMHze_t.js → dashboard-DUCg1mNJ.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-nHbT_XPG.js → dashboard-briefing-launcher-B0PuQUiR.js} +1401 -1383
- package/dist/chunks/{dashboard-controls-Chv8n1oV.js → dashboard-controls-Cl3fLg9W.js} +39 -39
- package/dist/chunks/{dashboard-json-XgY8U_hG.js → dashboard-json-BSOgXGwr.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CcxZN7C6.js → edit-dashboard-visual-CQDyMxM7.js} +516 -516
- package/dist/chunks/{editor-action-buttons-CCzvDROJ.js → editor-action-buttons-BKVrZnRQ.js} +2 -2
- package/dist/chunks/{matrix-formatter-DDjECnMd.js → matrix-formatter-DY1y9odV.js} +2 -1
- package/dist/chunks/{pivot-header-presentation-BTOXdU6S.js → pivot-header-presentation-Bb6b3Ch2.js} +232 -210
- package/dist/chunks/{report-preferences-dialog-D2Tz_5WT.js → report-preferences-dialog-WDM7qWxV.js} +16 -16
- package/dist/chunks/{semaphor-ready-indicator-CpbyewzC.js → semaphor-ready-indicator-yZ0JtL4D.js} +36174 -36148
- package/dist/chunks/{slider-p0D5yTI_.js → slider-0mB67Lls.js} +3 -3
- package/dist/chunks/{switch-JmX27lNB.js → switch-D95vek6N.js} +1690 -1683
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +90 -89
- package/dist/index.js +120 -119
- package/dist/surfboard/index.js +1 -1
- package/dist/types/components/surfboard/filter/date-range-filter-v2.d.ts +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +9 -0
- package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -6
- package/dist/types/lib/api/exports-api.d.ts +30 -3
- package/dist/types/lib/csv-download.d.ts +4 -2
- package/dist/types/lib/export-messages.d.ts +47 -0
- package/dist/types/lib/exports/bounded-request.d.ts +12 -0
- package/dist/types/lib/exports/export-status.d.ts +2 -0
- package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
- package/dist/types/lib/hooks/use-export-polling.d.ts +9 -1
- package/dist/types/lib/matrix-table/submit-matrix-delivery.d.ts +14 -2
- package/dist/types/lib/matrix-table/use-matrix.d.ts +4 -0
- package/dist/types/lib/stores/export-store.d.ts +11 -0
- package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +6 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +28 -4
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx as t, jsxs as r, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { B as
|
|
4
|
-
import {
|
|
5
|
-
import { L as
|
|
6
|
-
import { c as
|
|
7
|
-
import { a as
|
|
1
|
+
import { jsx as t, jsxs as r, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import Dt, { useState as E, useEffect as Y, useMemo as Q, useCallback as H, useLayoutEffect as yt, useRef as ue, useContext as Xt } from "react";
|
|
3
|
+
import { B as R, m as ke, r as at, L as ae, k as kt, d as Et, aj as $, c as X, j as Kt, u as T, a2 as fe, a0 as ve, aN as nt, a3 as At, P as ze, a as $e, b as je, aW as Yt, aX as Zt, S as It, aY as Qt, aZ as Jt, a_ as er, a$ as tr, ah as rr } from "./switch-D95vek6N.js";
|
|
4
|
+
import { ch as st, aZ as Ee, a_ as Ae, b0 as Ie, b6 as Lt, aO as ar, ci as nr, cj as sr, bn as xe, bX as Ft, be as We, q as or, m as ir, ck as lr, c9 as ot, ca as it, cb as lt, cc as dt, cd as ct, ce as ut, cf as ht, cg as Tt, bc as mt, cl as dr, cm as cr, cn as Je, bY as Ge, bZ as Xe, co as Bt, b_ as Ke, bJ as G, c7 as ur, c6 as He, cp as hr, bH as mr, a$ as pt, b1 as ft, cq as pr, aY as fr, b5 as gr, bq as Rt, cr as br, bL as xr, u as vr, cs as yr, ct as Cr, aC as Ye, L as me, av as De, ar as Ut, as as qe, cu as z, N as Vt, aq as wr, cv as Nr, ax as Sr, R as Pt, cw as Dr, cx as kr, at as Ct, P as Er, cy as Ar, cz as Ir, cA as Lr, cB as Fr, cC as Tr, cD as Br, cE as _t, cF as Rr, cG as Ur, cH as Vr, b$ as Mt, cI as Pr, cJ as _r, cK as _e, cL as Mr, cM as Or, cN as zr, am as $r, an as jr, a2 as Wr, a1 as Hr, a0 as qr, $ as Gr, Y as Xr, W as Kr, cO as Yr, cP as Zr, cQ as Qr, cR as Jr, cS as ea, ak as ta, cT as ra, cU as aa, a8 as na, cV as sa, cW as oa, cX as ia } from "./semaphor-ready-indicator-yZ0JtL4D.js";
|
|
5
|
+
import { L as gt } from "./layout-grid-CiubineE.js";
|
|
6
|
+
import { c as Le, X as Ze, C as Ot } from "./x-CXDkqdur.js";
|
|
7
|
+
import { a as bt, V as la, E as et, b as tt, c as da, d as ca, L as ua, e as ha, g as zt, C as $t, F as ma, h as pa } from "./editor-action-buttons-BKVrZnRQ.js";
|
|
8
8
|
import "./validators-BS521dum.js";
|
|
9
9
|
import "./matrix-operation-contract-BotZ-6zT.js";
|
|
10
10
|
import "zod";
|
|
11
11
|
import "../value-format-preferences/index.js";
|
|
12
|
-
import { S as
|
|
13
|
-
import { s as
|
|
14
|
-
import { v as
|
|
15
|
-
import { l as
|
|
16
|
-
import { d as
|
|
12
|
+
import { S as fa } from "./selection-reducer-DQok8gsC.js";
|
|
13
|
+
import { s as Me } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
|
|
14
|
+
import { v as wt, s as ga } from "./card-config-utils-DqyASiD_.js";
|
|
15
|
+
import { l as Nt } from "./matrix-formatter-DY1y9odV.js";
|
|
16
|
+
import { d as oe, e as ba, h as xa } from "./index-BpAM7UE0.js";
|
|
17
17
|
/**
|
|
18
18
|
* @license lucide-react v0.453.0 - ISC
|
|
19
19
|
*
|
|
20
20
|
* This source code is licensed under the ISC license.
|
|
21
21
|
* See the LICENSE file in the root directory of this source tree.
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const va = Le("ArrowUpRight", [
|
|
24
24
|
["path", { d: "M7 7h10v10", key: "1tivn9" }],
|
|
25
25
|
["path", { d: "M7 17 17 7", key: "1vkiza" }]
|
|
26
26
|
]);
|
|
@@ -30,7 +30,7 @@ const ba = Ee("ArrowUpRight", [
|
|
|
30
30
|
* This source code is licensed under the ISC license.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
32
|
*/
|
|
33
|
-
const
|
|
33
|
+
const ya = Le("CalendarRange", [
|
|
34
34
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
35
35
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
36
36
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
@@ -46,7 +46,7 @@ const xa = Ee("CalendarRange", [
|
|
|
46
46
|
* This source code is licensed under the ISC license.
|
|
47
47
|
* See the LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/
|
|
49
|
-
const
|
|
49
|
+
const Ca = Le("FileDown", [
|
|
50
50
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
51
51
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
52
52
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
@@ -58,7 +58,7 @@ const va = Ee("FileDown", [
|
|
|
58
58
|
* This source code is licensed under the ISC license.
|
|
59
59
|
* See the LICENSE file in the root directory of this source tree.
|
|
60
60
|
*/
|
|
61
|
-
const
|
|
61
|
+
const wa = Le("MousePointer2", [
|
|
62
62
|
[
|
|
63
63
|
"path",
|
|
64
64
|
{
|
|
@@ -73,7 +73,7 @@ const ya = Ee("MousePointer2", [
|
|
|
73
73
|
* This source code is licensed under the ISC license.
|
|
74
74
|
* See the LICENSE file in the root directory of this source tree.
|
|
75
75
|
*/
|
|
76
|
-
const
|
|
76
|
+
const Na = Le("Newspaper", [
|
|
77
77
|
[
|
|
78
78
|
"path",
|
|
79
79
|
{
|
|
@@ -85,7 +85,7 @@ const Ca = Ee("Newspaper", [
|
|
|
85
85
|
["path", { d: "M15 18h-5", key: "95g1m2" }],
|
|
86
86
|
["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
|
|
87
87
|
]);
|
|
88
|
-
function
|
|
88
|
+
function Sa() {
|
|
89
89
|
return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((e, a) => /* @__PURE__ */ r(
|
|
90
90
|
"div",
|
|
91
91
|
{
|
|
@@ -101,38 +101,38 @@ function wa() {
|
|
|
101
101
|
a
|
|
102
102
|
)) });
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Da({
|
|
105
105
|
open: e,
|
|
106
106
|
onOpenChange: a,
|
|
107
|
-
onSubmit:
|
|
107
|
+
onSubmit: i,
|
|
108
108
|
isCreating: n
|
|
109
109
|
}) {
|
|
110
|
-
const
|
|
110
|
+
const l = st("interactive"), [s, u] = E(""), [p, o] = E("");
|
|
111
111
|
Y(() => {
|
|
112
|
-
e || (
|
|
112
|
+
e || (u(""), o(""));
|
|
113
113
|
}, [e]);
|
|
114
|
-
const
|
|
115
|
-
s.trim() &&
|
|
116
|
-
}, d = (
|
|
117
|
-
a(
|
|
114
|
+
const c = () => {
|
|
115
|
+
s.trim() && i({ title: s, description: p });
|
|
116
|
+
}, d = (m) => {
|
|
117
|
+
a(m);
|
|
118
118
|
};
|
|
119
|
-
return /* @__PURE__ */ t(
|
|
120
|
-
|
|
119
|
+
return /* @__PURE__ */ t(Ee, { open: e, onOpenChange: d, children: /* @__PURE__ */ r(
|
|
120
|
+
Ae,
|
|
121
121
|
{
|
|
122
122
|
showCloseButton: !1,
|
|
123
123
|
className: "flex max-w-lg grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
|
|
124
|
-
style:
|
|
124
|
+
style: l.dialogStyle,
|
|
125
125
|
children: [
|
|
126
126
|
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
127
127
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
128
|
-
/* @__PURE__ */ t(
|
|
128
|
+
/* @__PURE__ */ t(gt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
129
129
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
130
|
-
/* @__PURE__ */ t(
|
|
130
|
+
/* @__PURE__ */ t(Ie, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
|
|
131
131
|
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
|
|
132
132
|
] })
|
|
133
133
|
] }),
|
|
134
134
|
/* @__PURE__ */ t(
|
|
135
|
-
|
|
135
|
+
R,
|
|
136
136
|
{
|
|
137
137
|
size: "xs",
|
|
138
138
|
variant: "ghost",
|
|
@@ -140,39 +140,39 @@ function Na({
|
|
|
140
140
|
onClick: () => d(!1),
|
|
141
141
|
"aria-label": "Close",
|
|
142
142
|
disabled: n,
|
|
143
|
-
children: /* @__PURE__ */ t(
|
|
143
|
+
children: /* @__PURE__ */ t(Ze, { className: "h-3.5 w-3.5" })
|
|
144
144
|
}
|
|
145
145
|
)
|
|
146
146
|
] }),
|
|
147
147
|
/* @__PURE__ */ r("div", { className: "space-y-3 px-4 py-3", children: [
|
|
148
148
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
|
|
149
149
|
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
150
|
-
/* @__PURE__ */ t(
|
|
150
|
+
/* @__PURE__ */ t(ke, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
|
|
151
151
|
/* @__PURE__ */ t(
|
|
152
|
-
|
|
152
|
+
at,
|
|
153
153
|
{
|
|
154
154
|
id: "visual-title",
|
|
155
155
|
size: "sm",
|
|
156
156
|
placeholder: "Untitled visual",
|
|
157
157
|
value: s,
|
|
158
|
-
onChange: (
|
|
158
|
+
onChange: (m) => u(m.target.value),
|
|
159
159
|
disabled: n,
|
|
160
|
-
onKeyDown: (
|
|
161
|
-
|
|
160
|
+
onKeyDown: (m) => {
|
|
161
|
+
m.key === "Enter" && !m.shiftKey && (m.preventDefault(), c());
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
)
|
|
165
165
|
] }),
|
|
166
166
|
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
167
|
-
/* @__PURE__ */ t(
|
|
167
|
+
/* @__PURE__ */ t(ke, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
|
|
168
168
|
/* @__PURE__ */ t(
|
|
169
|
-
|
|
169
|
+
at,
|
|
170
170
|
{
|
|
171
171
|
id: "visual-description",
|
|
172
172
|
size: "sm",
|
|
173
173
|
placeholder: "Optional",
|
|
174
|
-
value:
|
|
175
|
-
onChange: (
|
|
174
|
+
value: p,
|
|
175
|
+
onChange: (m) => o(m.target.value),
|
|
176
176
|
disabled: n
|
|
177
177
|
}
|
|
178
178
|
)
|
|
@@ -180,7 +180,7 @@ function Na({
|
|
|
180
180
|
] }),
|
|
181
181
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
|
|
182
182
|
/* @__PURE__ */ t(
|
|
183
|
-
|
|
183
|
+
R,
|
|
184
184
|
{
|
|
185
185
|
size: "xs",
|
|
186
186
|
variant: "outline",
|
|
@@ -190,13 +190,13 @@ function Na({
|
|
|
190
190
|
}
|
|
191
191
|
),
|
|
192
192
|
/* @__PURE__ */ t(
|
|
193
|
-
|
|
193
|
+
R,
|
|
194
194
|
{
|
|
195
195
|
size: "xs",
|
|
196
|
-
onClick:
|
|
196
|
+
onClick: c,
|
|
197
197
|
disabled: !s.trim() || n,
|
|
198
|
-
children: n ? /* @__PURE__ */ r(
|
|
199
|
-
/* @__PURE__ */ t(
|
|
198
|
+
children: n ? /* @__PURE__ */ r(j, { children: [
|
|
199
|
+
/* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
200
200
|
"Creating..."
|
|
201
201
|
] }) : "Create library visual"
|
|
202
202
|
}
|
|
@@ -206,195 +206,195 @@ function Na({
|
|
|
206
206
|
}
|
|
207
207
|
) });
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function jt(e) {
|
|
210
210
|
return e ? new Date(e).toLocaleDateString("en-US", {
|
|
211
211
|
month: "short",
|
|
212
212
|
day: "numeric",
|
|
213
213
|
year: "numeric"
|
|
214
214
|
}) : "Unknown";
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function Wt(e, a) {
|
|
217
217
|
var n;
|
|
218
|
-
const
|
|
219
|
-
return
|
|
218
|
+
const i = (n = e.ownership.createdBy) == null ? void 0 : n.type;
|
|
219
|
+
return i === "tenant" || i === "organization" && a;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
var
|
|
223
|
-
return
|
|
221
|
+
function xt(e, a) {
|
|
222
|
+
var i, n;
|
|
223
|
+
return Wt(e, a) ? ((i = e.ownership.createdBy) == null ? void 0 : i.name) || ((n = e.createdByTenantUserRel) == null ? void 0 : n.name) || e.lastModifiedBy || "Unknown" : "Organization";
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
return
|
|
225
|
+
function ka(e, a) {
|
|
226
|
+
return xt(e, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function Ea(e) {
|
|
229
229
|
const a = (e || "").toLowerCase();
|
|
230
|
-
return a.includes("table") ?
|
|
230
|
+
return a.includes("table") ? kt : a.includes("pie") || a.includes("donut") ? dr : a.includes("line") ? cr : a.includes("bar") ? Kt : gt;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function Aa({ visual: e }) {
|
|
233
233
|
const a = e.ownership.status === "public" ? "Public" : e.ownership.status === "shared" || e.ownership.sharedCount > 0 ? "Shared" : "Private";
|
|
234
234
|
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 });
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function Hn({
|
|
237
237
|
open: e,
|
|
238
238
|
onOpenChange: a
|
|
239
239
|
}) {
|
|
240
|
-
const
|
|
240
|
+
const i = st("interactive"), [n, l] = E(""), [s, u] = E(/* @__PURE__ */ new Set()), [p, o] = E(!1), [c, d] = E(
|
|
241
241
|
null
|
|
242
|
-
), [
|
|
242
|
+
), [m, h] = E(
|
|
243
243
|
null
|
|
244
|
-
), [f,
|
|
245
|
-
|
|
244
|
+
), [f, b] = E(!1), [k, I] = E(null), [y, S] = E(null), D = () => {
|
|
245
|
+
u(/* @__PURE__ */ new Set()), d(null), h(null), b(!1), I(null);
|
|
246
246
|
}, w = () => {
|
|
247
|
-
a(!1),
|
|
248
|
-
}, { selectVisual:
|
|
249
|
-
resources:
|
|
250
|
-
isLoading:
|
|
251
|
-
isError:
|
|
252
|
-
createResource:
|
|
247
|
+
a(!1), D();
|
|
248
|
+
}, { selectVisual: C } = Lt(), { handleAddLibraryVisual: F, handleEditLibraryVisual: g } = bt(), { isConsoleMode: v } = ar(), {
|
|
249
|
+
resources: U,
|
|
250
|
+
isLoading: A,
|
|
251
|
+
isError: q,
|
|
252
|
+
createResource: L,
|
|
253
253
|
updateResource: P,
|
|
254
|
-
deleteResourceAsync:
|
|
255
|
-
duplicateResource:
|
|
256
|
-
isCreating:
|
|
257
|
-
isDeleting:
|
|
258
|
-
} =
|
|
254
|
+
deleteResourceAsync: J,
|
|
255
|
+
duplicateResource: ne,
|
|
256
|
+
isCreating: Fe,
|
|
257
|
+
isDeleting: ie
|
|
258
|
+
} = nr(
|
|
259
259
|
void 0,
|
|
260
|
-
(
|
|
261
|
-
|
|
260
|
+
(x) => {
|
|
261
|
+
o(!1), x && (C(x), g(x), w());
|
|
262
262
|
}
|
|
263
263
|
), {
|
|
264
|
-
startUpdating:
|
|
265
|
-
stopUpdating:
|
|
266
|
-
isUpdating:
|
|
267
|
-
} =
|
|
268
|
-
const
|
|
269
|
-
return
|
|
264
|
+
startUpdating: Te,
|
|
265
|
+
stopUpdating: Be,
|
|
266
|
+
isUpdating: le
|
|
267
|
+
} = sr(), W = U, ee = Q(() => {
|
|
268
|
+
const x = n.trim().toLowerCase();
|
|
269
|
+
return x ? W.filter(
|
|
270
270
|
(B) => {
|
|
271
|
-
var
|
|
272
|
-
return ((
|
|
271
|
+
var _, re, ce;
|
|
272
|
+
return ((_ = B.title) == null ? void 0 : _.toLowerCase().includes(x)) || ((re = B.description) == null ? void 0 : re.toLowerCase().includes(x)) || ((ce = B.kind) == null ? void 0 : ce.toLowerCase().includes(x));
|
|
273
273
|
}
|
|
274
|
-
) :
|
|
275
|
-
}, [n,
|
|
276
|
-
() =>
|
|
277
|
-
(
|
|
274
|
+
) : W;
|
|
275
|
+
}, [n, W]), de = Q(
|
|
276
|
+
() => W.filter(
|
|
277
|
+
(x) => s.has(x.id)
|
|
278
278
|
),
|
|
279
|
-
[s,
|
|
280
|
-
),
|
|
281
|
-
(
|
|
282
|
-
),
|
|
283
|
-
(
|
|
284
|
-
),
|
|
285
|
-
(
|
|
286
|
-
),
|
|
287
|
-
(
|
|
288
|
-
),
|
|
279
|
+
[s, W]
|
|
280
|
+
), te = de.filter(
|
|
281
|
+
(x) => x.permissions.canDelete
|
|
282
|
+
), Re = de.filter(
|
|
283
|
+
(x) => x.permissions.canShare
|
|
284
|
+
), ye = ee.length > 0 && ee.every(
|
|
285
|
+
(x) => s.has(x.id)
|
|
286
|
+
), he = ee.some(
|
|
287
|
+
(x) => s.has(x.id)
|
|
288
|
+
), ge = (x) => {
|
|
289
289
|
const B = new Set(s);
|
|
290
|
-
|
|
291
|
-
},
|
|
292
|
-
|
|
293
|
-
B.has(
|
|
290
|
+
x(B), u(B);
|
|
291
|
+
}, Z = (x) => {
|
|
292
|
+
ge((B) => {
|
|
293
|
+
B.has(x) ? B.delete(x) : B.add(x);
|
|
294
294
|
});
|
|
295
|
-
},
|
|
296
|
-
|
|
297
|
-
const B = new Set(
|
|
298
|
-
return
|
|
299
|
-
(
|
|
300
|
-
) :
|
|
301
|
-
(
|
|
295
|
+
}, Ce = () => {
|
|
296
|
+
u((x) => {
|
|
297
|
+
const B = new Set(x);
|
|
298
|
+
return ye ? ee.forEach(
|
|
299
|
+
(_) => B.delete(_.id)
|
|
300
|
+
) : ee.forEach(
|
|
301
|
+
(_) => B.add(_.id)
|
|
302
302
|
), B;
|
|
303
303
|
});
|
|
304
|
-
},
|
|
305
|
-
(await
|
|
304
|
+
}, M = async (x) => {
|
|
305
|
+
(await F(x)).success && w();
|
|
306
306
|
}, O = async () => {
|
|
307
|
-
const
|
|
308
|
-
if (
|
|
307
|
+
const x = de;
|
|
308
|
+
if (x.length === 0) return;
|
|
309
309
|
let B = !1;
|
|
310
|
-
for (const
|
|
311
|
-
if (!(await
|
|
310
|
+
for (const _ of x)
|
|
311
|
+
if (!(await F(_)).success) {
|
|
312
312
|
B = !0;
|
|
313
313
|
break;
|
|
314
314
|
}
|
|
315
315
|
B || w();
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
},
|
|
319
|
-
S(
|
|
316
|
+
}, se = (x) => {
|
|
317
|
+
g(x), w();
|
|
318
|
+
}, be = (x) => {
|
|
319
|
+
S(x), ne(x, {
|
|
320
320
|
onSettled: () => S(null)
|
|
321
321
|
});
|
|
322
|
-
},
|
|
323
|
-
if (
|
|
324
|
-
|
|
322
|
+
}, Ue = () => {
|
|
323
|
+
if (te.length === 0) {
|
|
324
|
+
$.error("Select a visual you can delete");
|
|
325
325
|
return;
|
|
326
326
|
}
|
|
327
|
-
|
|
328
|
-
},
|
|
329
|
-
const
|
|
327
|
+
I(null), b(!0);
|
|
328
|
+
}, Qe = async () => {
|
|
329
|
+
const x = k ? [k] : te;
|
|
330
330
|
try {
|
|
331
|
-
for (const B of
|
|
332
|
-
await
|
|
333
|
-
|
|
334
|
-
const
|
|
335
|
-
return
|
|
336
|
-
(
|
|
337
|
-
),
|
|
338
|
-
}),
|
|
331
|
+
for (const B of x)
|
|
332
|
+
await J(B.id);
|
|
333
|
+
u((B) => {
|
|
334
|
+
const _ = new Set(B);
|
|
335
|
+
return x.forEach(
|
|
336
|
+
(re) => _.delete(re.id)
|
|
337
|
+
), _;
|
|
338
|
+
}), b(!1), I(null);
|
|
339
339
|
} catch {
|
|
340
340
|
}
|
|
341
|
-
},
|
|
342
|
-
if (
|
|
343
|
-
|
|
341
|
+
}, we = () => {
|
|
342
|
+
if (de.length !== 1) {
|
|
343
|
+
$.error("Select one visual to share");
|
|
344
344
|
return;
|
|
345
345
|
}
|
|
346
|
-
const [
|
|
347
|
-
if (!
|
|
348
|
-
|
|
346
|
+
const [x] = de;
|
|
347
|
+
if (!x.permissions.canShare) {
|
|
348
|
+
$.error("You do not have permission to share this visual");
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
351
|
-
d(
|
|
352
|
-
},
|
|
353
|
-
title:
|
|
351
|
+
d(x);
|
|
352
|
+
}, Ne = ({
|
|
353
|
+
title: x,
|
|
354
354
|
description: B
|
|
355
355
|
}) => {
|
|
356
|
-
if (!
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
356
|
+
if (!m) return;
|
|
357
|
+
const _ = {};
|
|
358
|
+
if (x !== m.title && (_.title = x), (m.description || "") !== B && (_.description = B), Object.keys(_).length === 0) {
|
|
359
359
|
h(null);
|
|
360
360
|
return;
|
|
361
361
|
}
|
|
362
|
-
const
|
|
363
|
-
|
|
362
|
+
const re = Object.keys(_), ce = re.length === 1 ? re[0] : void 0;
|
|
363
|
+
Te(m.id, ce), P(
|
|
364
364
|
{
|
|
365
|
-
resourceId:
|
|
366
|
-
data:
|
|
365
|
+
resourceId: m.id,
|
|
366
|
+
data: _
|
|
367
367
|
},
|
|
368
368
|
{
|
|
369
369
|
onSuccess: () => {
|
|
370
|
-
|
|
370
|
+
Be(m.id, ce), h(null);
|
|
371
371
|
},
|
|
372
372
|
onError: () => {
|
|
373
|
-
|
|
373
|
+
Be(m.id, ce);
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
);
|
|
377
|
-
}, K = (
|
|
378
|
-
a(
|
|
379
|
-
},
|
|
380
|
-
return /* @__PURE__ */ r(
|
|
381
|
-
/* @__PURE__ */ t(
|
|
382
|
-
|
|
377
|
+
}, K = (x) => {
|
|
378
|
+
a(x), x || D();
|
|
379
|
+
}, Se = k ? 1 : te.length;
|
|
380
|
+
return /* @__PURE__ */ r(j, { children: [
|
|
381
|
+
/* @__PURE__ */ t(Ee, { open: e, onOpenChange: K, children: /* @__PURE__ */ r(
|
|
382
|
+
Ae,
|
|
383
383
|
{
|
|
384
384
|
showCloseButton: !1,
|
|
385
385
|
className: "flex max-h-[80vh] w-[min(72rem,calc(100vw-2rem))] max-w-none grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
|
|
386
|
-
style:
|
|
386
|
+
style: i.dialogStyle,
|
|
387
387
|
children: [
|
|
388
388
|
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
389
389
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
390
|
-
/* @__PURE__ */ t(
|
|
390
|
+
/* @__PURE__ */ t(kt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
391
391
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
392
|
-
/* @__PURE__ */ t(
|
|
392
|
+
/* @__PURE__ */ t(Ie, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
|
|
393
393
|
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
|
|
394
394
|
] })
|
|
395
395
|
] }),
|
|
396
396
|
/* @__PURE__ */ t(
|
|
397
|
-
|
|
397
|
+
R,
|
|
398
398
|
{
|
|
399
399
|
size: "xs",
|
|
400
400
|
variant: "ghost",
|
|
@@ -407,13 +407,13 @@ function _n({
|
|
|
407
407
|
] }),
|
|
408
408
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
|
|
409
409
|
/* @__PURE__ */ r("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
|
|
410
|
-
/* @__PURE__ */ t(
|
|
410
|
+
/* @__PURE__ */ t(fa, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
411
411
|
/* @__PURE__ */ t(
|
|
412
412
|
"input",
|
|
413
413
|
{
|
|
414
414
|
autoFocus: !0,
|
|
415
415
|
value: n,
|
|
416
|
-
onChange: (
|
|
416
|
+
onChange: (x) => l(x.target.value),
|
|
417
417
|
placeholder: "Search visuals...",
|
|
418
418
|
className: "h-7 w-full rounded-control border border-input bg-background pl-7 pr-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-ring focus:outline-none",
|
|
419
419
|
"aria-label": "Search visuals"
|
|
@@ -421,93 +421,93 @@ function _n({
|
|
|
421
421
|
)
|
|
422
422
|
] }),
|
|
423
423
|
/* @__PURE__ */ r(
|
|
424
|
-
|
|
424
|
+
R,
|
|
425
425
|
{
|
|
426
426
|
size: "xs",
|
|
427
427
|
variant: "outline",
|
|
428
428
|
className: "ml-auto",
|
|
429
|
-
onClick: () =>
|
|
429
|
+
onClick: () => o(!0),
|
|
430
430
|
children: [
|
|
431
|
-
/* @__PURE__ */ t(
|
|
431
|
+
/* @__PURE__ */ t(xe, { className: "h-3.5 w-3.5" }),
|
|
432
432
|
"New library visual"
|
|
433
433
|
]
|
|
434
434
|
}
|
|
435
435
|
)
|
|
436
436
|
] }),
|
|
437
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children:
|
|
438
|
-
/* @__PURE__ */ t(
|
|
437
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: A ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(Sa, {}) }) : q ? /* @__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" }) }) : ee.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
438
|
+
/* @__PURE__ */ t(gt, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
439
439
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
|
|
440
440
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
|
|
441
441
|
] }) : /* @__PURE__ */ t(
|
|
442
|
-
|
|
442
|
+
Ia,
|
|
443
443
|
{
|
|
444
|
-
visuals:
|
|
444
|
+
visuals: ee,
|
|
445
445
|
selectedIds: s,
|
|
446
|
-
allFilteredSelected:
|
|
447
|
-
someFilteredSelected:
|
|
448
|
-
onSelectAll:
|
|
449
|
-
onToggleSelection:
|
|
450
|
-
onAddVisual:
|
|
451
|
-
onOpenVisual:
|
|
446
|
+
allFilteredSelected: ye,
|
|
447
|
+
someFilteredSelected: he,
|
|
448
|
+
onSelectAll: Ce,
|
|
449
|
+
onToggleSelection: Z,
|
|
450
|
+
onAddVisual: M,
|
|
451
|
+
onOpenVisual: se,
|
|
452
452
|
onEditDetails: h,
|
|
453
453
|
onShareVisual: d,
|
|
454
|
-
onDeleteVisual: (
|
|
455
|
-
x
|
|
454
|
+
onDeleteVisual: (x) => {
|
|
455
|
+
I(x), b(!0);
|
|
456
456
|
},
|
|
457
|
-
onDuplicateVisual:
|
|
458
|
-
duplicatingId:
|
|
459
|
-
isDeleting:
|
|
460
|
-
isConsoleMode:
|
|
457
|
+
onDuplicateVisual: be,
|
|
458
|
+
duplicatingId: y,
|
|
459
|
+
isDeleting: ie,
|
|
460
|
+
isConsoleMode: v
|
|
461
461
|
}
|
|
462
462
|
) }),
|
|
463
463
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
|
|
464
|
-
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: s.size > 0 && /* @__PURE__ */ r(
|
|
464
|
+
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: s.size > 0 && /* @__PURE__ */ r(j, { children: [
|
|
465
465
|
/* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
466
466
|
/* @__PURE__ */ t("span", { className: "font-medium tabular-nums text-foreground", children: s.size }),
|
|
467
467
|
" ",
|
|
468
468
|
"selected"
|
|
469
469
|
] }),
|
|
470
470
|
/* @__PURE__ */ t(
|
|
471
|
-
|
|
471
|
+
R,
|
|
472
472
|
{
|
|
473
473
|
size: "xs",
|
|
474
474
|
variant: "ghost",
|
|
475
|
-
onClick: () =>
|
|
475
|
+
onClick: () => u(/* @__PURE__ */ new Set()),
|
|
476
476
|
children: "Clear"
|
|
477
477
|
}
|
|
478
478
|
),
|
|
479
479
|
/* @__PURE__ */ r(
|
|
480
|
-
|
|
480
|
+
R,
|
|
481
481
|
{
|
|
482
482
|
size: "xs",
|
|
483
483
|
variant: "outline",
|
|
484
|
-
onClick:
|
|
485
|
-
disabled:
|
|
484
|
+
onClick: we,
|
|
485
|
+
disabled: de.length !== 1 || Re.length !== 1,
|
|
486
486
|
children: [
|
|
487
|
-
/* @__PURE__ */ t(
|
|
487
|
+
/* @__PURE__ */ t(Ft, { className: "h-3.5 w-3.5" }),
|
|
488
488
|
"Share"
|
|
489
489
|
]
|
|
490
490
|
}
|
|
491
491
|
),
|
|
492
492
|
/* @__PURE__ */ r(
|
|
493
|
-
|
|
493
|
+
R,
|
|
494
494
|
{
|
|
495
495
|
size: "xs",
|
|
496
496
|
variant: "outline",
|
|
497
497
|
className: "text-destructive hover:text-destructive",
|
|
498
|
-
onClick:
|
|
499
|
-
disabled:
|
|
498
|
+
onClick: Ue,
|
|
499
|
+
disabled: te.length === 0,
|
|
500
500
|
children: [
|
|
501
|
-
/* @__PURE__ */ t(
|
|
501
|
+
/* @__PURE__ */ t(We, { className: "h-3.5 w-3.5" }),
|
|
502
502
|
"Delete ",
|
|
503
|
-
|
|
503
|
+
te.length || s.size
|
|
504
504
|
]
|
|
505
505
|
}
|
|
506
506
|
)
|
|
507
507
|
] }) }),
|
|
508
508
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
509
509
|
/* @__PURE__ */ t(
|
|
510
|
-
|
|
510
|
+
R,
|
|
511
511
|
{
|
|
512
512
|
size: "xs",
|
|
513
513
|
variant: "outline",
|
|
@@ -516,13 +516,13 @@ function _n({
|
|
|
516
516
|
}
|
|
517
517
|
),
|
|
518
518
|
/* @__PURE__ */ r(
|
|
519
|
-
|
|
519
|
+
R,
|
|
520
520
|
{
|
|
521
521
|
size: "xs",
|
|
522
522
|
onClick: O,
|
|
523
523
|
disabled: s.size === 0,
|
|
524
524
|
children: [
|
|
525
|
-
/* @__PURE__ */ t(
|
|
525
|
+
/* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" }),
|
|
526
526
|
s.size === 0 ? "Add to dashboard" : `Add ${s.size} visual${s.size === 1 ? "" : "s"}`
|
|
527
527
|
]
|
|
528
528
|
}
|
|
@@ -533,64 +533,64 @@ function _n({
|
|
|
533
533
|
}
|
|
534
534
|
) }),
|
|
535
535
|
/* @__PURE__ */ t(
|
|
536
|
-
|
|
536
|
+
Da,
|
|
537
537
|
{
|
|
538
|
-
open:
|
|
539
|
-
onOpenChange:
|
|
540
|
-
onSubmit:
|
|
541
|
-
isCreating:
|
|
538
|
+
open: p,
|
|
539
|
+
onOpenChange: o,
|
|
540
|
+
onSubmit: L,
|
|
541
|
+
isCreating: Fe
|
|
542
542
|
}
|
|
543
543
|
),
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
c && /* @__PURE__ */ t(
|
|
545
|
+
or,
|
|
546
546
|
{
|
|
547
|
-
resource:
|
|
548
|
-
resourceType:
|
|
547
|
+
resource: c,
|
|
548
|
+
resourceType: ir.VISUAL,
|
|
549
549
|
onClose: () => d(null)
|
|
550
550
|
}
|
|
551
551
|
),
|
|
552
|
-
|
|
553
|
-
|
|
552
|
+
m && /* @__PURE__ */ t(
|
|
553
|
+
lr,
|
|
554
554
|
{
|
|
555
|
-
open: !!
|
|
555
|
+
open: !!m,
|
|
556
556
|
resourceLabel: "Visual",
|
|
557
|
-
initialTitle:
|
|
558
|
-
initialDescription:
|
|
557
|
+
initialTitle: m.title || "",
|
|
558
|
+
initialDescription: m.description || "",
|
|
559
559
|
onClose: () => h(null),
|
|
560
|
-
onSave:
|
|
561
|
-
isSaving:
|
|
560
|
+
onSave: Ne,
|
|
561
|
+
isSaving: le(m.id)
|
|
562
562
|
}
|
|
563
563
|
),
|
|
564
564
|
/* @__PURE__ */ t(
|
|
565
|
-
|
|
565
|
+
ot,
|
|
566
566
|
{
|
|
567
567
|
open: f,
|
|
568
|
-
onOpenChange: (
|
|
569
|
-
!
|
|
568
|
+
onOpenChange: (x) => {
|
|
569
|
+
!x && ie || (b(x), x || I(null));
|
|
570
570
|
},
|
|
571
|
-
children: /* @__PURE__ */ r(
|
|
572
|
-
/* @__PURE__ */ r(
|
|
573
|
-
/* @__PURE__ */ r(
|
|
571
|
+
children: /* @__PURE__ */ r(it, { children: [
|
|
572
|
+
/* @__PURE__ */ r(lt, { children: [
|
|
573
|
+
/* @__PURE__ */ r(dt, { children: [
|
|
574
574
|
"Delete ",
|
|
575
|
-
|
|
575
|
+
Se,
|
|
576
576
|
" visual",
|
|
577
|
-
|
|
577
|
+
Se === 1 ? "" : "s",
|
|
578
578
|
"?"
|
|
579
579
|
] }),
|
|
580
|
-
/* @__PURE__ */ t(
|
|
580
|
+
/* @__PURE__ */ t(ct, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
581
581
|
] }),
|
|
582
|
-
/* @__PURE__ */ r(
|
|
583
|
-
/* @__PURE__ */ t(
|
|
582
|
+
/* @__PURE__ */ r(ut, { children: [
|
|
583
|
+
/* @__PURE__ */ t(ht, { disabled: ie, children: "Cancel" }),
|
|
584
584
|
/* @__PURE__ */ r(
|
|
585
|
-
|
|
585
|
+
Tt,
|
|
586
586
|
{
|
|
587
|
-
onClick: (
|
|
588
|
-
|
|
587
|
+
onClick: (x) => {
|
|
588
|
+
x.preventDefault(), Qe();
|
|
589
589
|
},
|
|
590
|
-
disabled:
|
|
590
|
+
disabled: ie || Se === 0,
|
|
591
591
|
children: [
|
|
592
|
-
|
|
593
|
-
|
|
592
|
+
ie ? /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(We, { className: "h-3.5 w-3.5" }),
|
|
593
|
+
ie ? "Deleting..." : "Delete"
|
|
594
594
|
]
|
|
595
595
|
}
|
|
596
596
|
)
|
|
@@ -600,30 +600,30 @@ function _n({
|
|
|
600
600
|
)
|
|
601
601
|
] });
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function Ia({
|
|
604
604
|
visuals: e,
|
|
605
605
|
selectedIds: a,
|
|
606
|
-
allFilteredSelected:
|
|
606
|
+
allFilteredSelected: i,
|
|
607
607
|
someFilteredSelected: n,
|
|
608
|
-
onSelectAll:
|
|
608
|
+
onSelectAll: l,
|
|
609
609
|
onToggleSelection: s,
|
|
610
|
-
onAddVisual:
|
|
611
|
-
onOpenVisual:
|
|
612
|
-
onEditDetails:
|
|
613
|
-
onShareVisual:
|
|
610
|
+
onAddVisual: u,
|
|
611
|
+
onOpenVisual: p,
|
|
612
|
+
onEditDetails: o,
|
|
613
|
+
onShareVisual: c,
|
|
614
614
|
onDeleteVisual: d,
|
|
615
|
-
onDuplicateVisual:
|
|
615
|
+
onDuplicateVisual: m,
|
|
616
616
|
duplicatingId: h,
|
|
617
617
|
isDeleting: f,
|
|
618
|
-
isConsoleMode:
|
|
618
|
+
isConsoleMode: b
|
|
619
619
|
}) {
|
|
620
620
|
return /* @__PURE__ */ r("div", { className: "min-w-[48rem]", children: [
|
|
621
621
|
/* @__PURE__ */ r("div", { className: "grid h-9 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/60 px-3 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: [
|
|
622
622
|
/* @__PURE__ */ t(
|
|
623
|
-
|
|
623
|
+
mt,
|
|
624
624
|
{
|
|
625
|
-
checked:
|
|
626
|
-
onCheckedChange:
|
|
625
|
+
checked: i ? !0 : n ? "indeterminate" : !1,
|
|
626
|
+
onCheckedChange: l,
|
|
627
627
|
"aria-label": "Select all visuals"
|
|
628
628
|
}
|
|
629
629
|
),
|
|
@@ -635,56 +635,56 @@ function Ea({
|
|
|
635
635
|
/* @__PURE__ */ t("span", { className: "text-right", children: "Actions" })
|
|
636
636
|
] }),
|
|
637
637
|
e.map((k) => /* @__PURE__ */ t(
|
|
638
|
-
|
|
638
|
+
La,
|
|
639
639
|
{
|
|
640
640
|
visual: k,
|
|
641
641
|
selected: a.has(k.id),
|
|
642
642
|
onToggleSelection: s,
|
|
643
|
-
onAddVisual:
|
|
644
|
-
onOpenVisual:
|
|
645
|
-
onEditDetails:
|
|
646
|
-
onShareVisual:
|
|
643
|
+
onAddVisual: u,
|
|
644
|
+
onOpenVisual: p,
|
|
645
|
+
onEditDetails: o,
|
|
646
|
+
onShareVisual: c,
|
|
647
647
|
onDeleteVisual: d,
|
|
648
|
-
onDuplicateVisual:
|
|
648
|
+
onDuplicateVisual: m,
|
|
649
649
|
duplicatingId: h,
|
|
650
650
|
isDeleting: f,
|
|
651
|
-
isConsoleMode:
|
|
651
|
+
isConsoleMode: b
|
|
652
652
|
},
|
|
653
653
|
k.id
|
|
654
654
|
))
|
|
655
655
|
] });
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function La({
|
|
658
658
|
visual: e,
|
|
659
659
|
selected: a,
|
|
660
|
-
onToggleSelection:
|
|
660
|
+
onToggleSelection: i,
|
|
661
661
|
onAddVisual: n,
|
|
662
|
-
onOpenVisual:
|
|
662
|
+
onOpenVisual: l,
|
|
663
663
|
onEditDetails: s,
|
|
664
|
-
onShareVisual:
|
|
665
|
-
onDeleteVisual:
|
|
666
|
-
onDuplicateVisual:
|
|
667
|
-
duplicatingId:
|
|
664
|
+
onShareVisual: u,
|
|
665
|
+
onDeleteVisual: p,
|
|
666
|
+
onDuplicateVisual: o,
|
|
667
|
+
duplicatingId: c,
|
|
668
668
|
isDeleting: d,
|
|
669
|
-
isConsoleMode:
|
|
669
|
+
isConsoleMode: m
|
|
670
670
|
}) {
|
|
671
|
-
var
|
|
672
|
-
const h =
|
|
671
|
+
var b;
|
|
672
|
+
const h = Ea(e.kind), f = () => {
|
|
673
673
|
n(e);
|
|
674
674
|
};
|
|
675
675
|
return /* @__PURE__ */ r(
|
|
676
676
|
"div",
|
|
677
677
|
{
|
|
678
|
-
className:
|
|
678
|
+
className: X(
|
|
679
679
|
"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",
|
|
680
680
|
a && "bg-muted/70"
|
|
681
681
|
),
|
|
682
682
|
children: [
|
|
683
683
|
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
684
|
-
|
|
684
|
+
mt,
|
|
685
685
|
{
|
|
686
686
|
checked: a,
|
|
687
|
-
onCheckedChange: () =>
|
|
687
|
+
onCheckedChange: () => i(e.id),
|
|
688
688
|
"aria-label": `Select ${e.title || "visual"}`
|
|
689
689
|
}
|
|
690
690
|
) }),
|
|
@@ -706,7 +706,7 @@ function Aa({
|
|
|
706
706
|
children: e.title || "Untitled Visual"
|
|
707
707
|
}
|
|
708
708
|
),
|
|
709
|
-
((
|
|
709
|
+
((b = e.description) == null ? void 0 : b.trim()) && /* @__PURE__ */ t(
|
|
710
710
|
"div",
|
|
711
711
|
{
|
|
712
712
|
className: "truncate text-[11px] text-muted-foreground",
|
|
@@ -719,122 +719,122 @@ function Aa({
|
|
|
719
719
|
}
|
|
720
720
|
),
|
|
721
721
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
722
|
-
/* @__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:
|
|
723
|
-
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children:
|
|
722
|
+
/* @__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: ka(e, m) }),
|
|
723
|
+
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: xt(e, m) })
|
|
724
724
|
] }),
|
|
725
|
-
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children:
|
|
726
|
-
/* @__PURE__ */ t(
|
|
725
|
+
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: jt(e.updatedAt) }),
|
|
726
|
+
/* @__PURE__ */ t(Aa, { visual: e }),
|
|
727
727
|
/* @__PURE__ */ t("span", { className: "text-right tabular-nums text-muted-foreground", children: e.ownership.sharedCount > 0 ? e.ownership.sharedCount : "—" }),
|
|
728
728
|
/* @__PURE__ */ t(
|
|
729
|
-
|
|
729
|
+
Fa,
|
|
730
730
|
{
|
|
731
731
|
visual: e,
|
|
732
|
-
onOpenVisual:
|
|
732
|
+
onOpenVisual: l,
|
|
733
733
|
onEditDetails: s,
|
|
734
|
-
onShareVisual:
|
|
735
|
-
onDeleteVisual:
|
|
736
|
-
onDuplicateVisual:
|
|
737
|
-
duplicatingId:
|
|
734
|
+
onShareVisual: u,
|
|
735
|
+
onDeleteVisual: p,
|
|
736
|
+
onDuplicateVisual: o,
|
|
737
|
+
duplicatingId: c,
|
|
738
738
|
isDeleting: d,
|
|
739
|
-
isConsoleMode:
|
|
739
|
+
isConsoleMode: m
|
|
740
740
|
}
|
|
741
741
|
)
|
|
742
742
|
]
|
|
743
743
|
}
|
|
744
744
|
);
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Fa({
|
|
747
747
|
visual: e,
|
|
748
748
|
onOpenVisual: a,
|
|
749
|
-
onEditDetails:
|
|
749
|
+
onEditDetails: i,
|
|
750
750
|
onShareVisual: n,
|
|
751
|
-
onDeleteVisual:
|
|
751
|
+
onDeleteVisual: l,
|
|
752
752
|
onDuplicateVisual: s,
|
|
753
|
-
duplicatingId:
|
|
754
|
-
isDeleting:
|
|
755
|
-
isConsoleMode:
|
|
753
|
+
duplicatingId: u,
|
|
754
|
+
isDeleting: p,
|
|
755
|
+
isConsoleMode: o
|
|
756
756
|
}) {
|
|
757
757
|
return /* @__PURE__ */ r(
|
|
758
758
|
"div",
|
|
759
759
|
{
|
|
760
760
|
className: "flex items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
|
|
761
|
-
onClick: (
|
|
761
|
+
onClick: (c) => c.stopPropagation(),
|
|
762
762
|
children: [
|
|
763
763
|
/* @__PURE__ */ t(
|
|
764
|
-
|
|
764
|
+
R,
|
|
765
765
|
{
|
|
766
766
|
size: "xs",
|
|
767
767
|
variant: "ghost",
|
|
768
768
|
className: "w-7 px-0",
|
|
769
769
|
onClick: () => a(e),
|
|
770
770
|
"aria-label": "Edit visual",
|
|
771
|
-
children: /* @__PURE__ */ t(
|
|
771
|
+
children: /* @__PURE__ */ t(Je, { className: "h-3.5 w-3.5" })
|
|
772
772
|
}
|
|
773
773
|
),
|
|
774
|
-
/* @__PURE__ */ r(
|
|
775
|
-
/* @__PURE__ */ t(
|
|
776
|
-
|
|
774
|
+
/* @__PURE__ */ r(Ge, { modal: !1, children: [
|
|
775
|
+
/* @__PURE__ */ t(Xe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
776
|
+
R,
|
|
777
777
|
{
|
|
778
778
|
size: "xs",
|
|
779
779
|
variant: "ghost",
|
|
780
780
|
className: "w-7 px-0",
|
|
781
781
|
"aria-label": "More actions",
|
|
782
|
-
children: /* @__PURE__ */ t(
|
|
782
|
+
children: /* @__PURE__ */ t(Bt, { className: "h-3.5 w-3.5" })
|
|
783
783
|
}
|
|
784
784
|
) }),
|
|
785
785
|
/* @__PURE__ */ r(
|
|
786
|
-
|
|
786
|
+
Ke,
|
|
787
787
|
{
|
|
788
788
|
align: "end",
|
|
789
789
|
className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
790
790
|
children: [
|
|
791
|
-
/* @__PURE__ */ r(
|
|
792
|
-
/* @__PURE__ */ t(
|
|
791
|
+
/* @__PURE__ */ r(G, { onClick: () => a(e), children: [
|
|
792
|
+
/* @__PURE__ */ t(Je, { className: "h-3.5 w-3.5" }),
|
|
793
793
|
"Edit visual"
|
|
794
794
|
] }),
|
|
795
795
|
/* @__PURE__ */ r(
|
|
796
|
-
|
|
796
|
+
G,
|
|
797
797
|
{
|
|
798
798
|
onClick: () => s(e.id),
|
|
799
|
-
disabled:
|
|
799
|
+
disabled: u === e.id,
|
|
800
800
|
children: [
|
|
801
|
-
|
|
802
|
-
|
|
801
|
+
u === e.id ? /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(ur, { className: "h-3.5 w-3.5" }),
|
|
802
|
+
u === e.id ? "Duplicating..." : "Duplicate"
|
|
803
803
|
]
|
|
804
804
|
}
|
|
805
805
|
),
|
|
806
|
-
e.permissions.canEdit && /* @__PURE__ */ r(
|
|
807
|
-
/* @__PURE__ */ t(
|
|
806
|
+
e.permissions.canEdit && /* @__PURE__ */ r(G, { onClick: () => i(e), children: [
|
|
807
|
+
/* @__PURE__ */ t(Je, { className: "h-3.5 w-3.5" }),
|
|
808
808
|
"Edit details"
|
|
809
809
|
] }),
|
|
810
|
-
e.permissions.canShare && /* @__PURE__ */ r(
|
|
811
|
-
/* @__PURE__ */ t(
|
|
810
|
+
e.permissions.canShare && /* @__PURE__ */ r(G, { onClick: () => n(e), children: [
|
|
811
|
+
/* @__PURE__ */ t(Ft, { className: "h-3.5 w-3.5" }),
|
|
812
812
|
"Share"
|
|
813
813
|
] }),
|
|
814
|
-
e.permissions.canDelete && /* @__PURE__ */ r(
|
|
815
|
-
/* @__PURE__ */ t(
|
|
814
|
+
e.permissions.canDelete && /* @__PURE__ */ r(j, { children: [
|
|
815
|
+
/* @__PURE__ */ t(He, {}),
|
|
816
816
|
/* @__PURE__ */ r(
|
|
817
|
-
|
|
817
|
+
G,
|
|
818
818
|
{
|
|
819
819
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
820
|
-
onClick: () =>
|
|
821
|
-
disabled:
|
|
820
|
+
onClick: () => l(e),
|
|
821
|
+
disabled: p,
|
|
822
822
|
children: [
|
|
823
|
-
/* @__PURE__ */ t(
|
|
824
|
-
|
|
823
|
+
/* @__PURE__ */ t(We, { className: "h-3.5 w-3.5" }),
|
|
824
|
+
p ? "Deleting..." : "Delete"
|
|
825
825
|
]
|
|
826
826
|
}
|
|
827
827
|
)
|
|
828
828
|
] }),
|
|
829
|
-
/* @__PURE__ */ t(
|
|
829
|
+
/* @__PURE__ */ t(He, {}),
|
|
830
830
|
/* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
831
|
-
|
|
832
|
-
/* @__PURE__ */ t(
|
|
833
|
-
/* @__PURE__ */ t("span", { className: "truncate", children:
|
|
831
|
+
Wt(e, o) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
832
|
+
/* @__PURE__ */ t(hr, { className: "h-3 w-3" }),
|
|
833
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: xt(e, o) })
|
|
834
834
|
] }),
|
|
835
835
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
836
|
-
/* @__PURE__ */ t(
|
|
837
|
-
/* @__PURE__ */ t("span", { children:
|
|
836
|
+
/* @__PURE__ */ t(mr, { className: "h-3 w-3" }),
|
|
837
|
+
/* @__PURE__ */ t("span", { children: jt(e.updatedAt) })
|
|
838
838
|
] })
|
|
839
839
|
] })
|
|
840
840
|
]
|
|
@@ -845,63 +845,63 @@ function Ia({
|
|
|
845
845
|
}
|
|
846
846
|
);
|
|
847
847
|
}
|
|
848
|
-
function
|
|
849
|
-
const n =
|
|
850
|
-
(
|
|
851
|
-
), s =
|
|
852
|
-
(
|
|
853
|
-
),
|
|
854
|
-
const
|
|
855
|
-
return a || !e || !
|
|
848
|
+
function qn(e, a, i = !1) {
|
|
849
|
+
const n = T((c) => c.dashboard), l = T(
|
|
850
|
+
(c) => c.isDashboardEditing
|
|
851
|
+
), s = T(
|
|
852
|
+
(c) => c.onDashboardLifecycleEvent
|
|
853
|
+
), u = H(() => {
|
|
854
|
+
const c = T.getState().dashboard;
|
|
855
|
+
return a || !e || !c || c.id !== e.id ? !1 : Me(c) !== Me(e);
|
|
856
856
|
}, [e, a]);
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
}), [
|
|
860
|
-
const
|
|
857
|
+
yt(() => (T.setState({ checkUnsavedDashboardChanges: u }), () => {
|
|
858
|
+
T.getState().checkUnsavedDashboardChanges === u && T.setState({ checkUnsavedDashboardChanges: null });
|
|
859
|
+
}), [u]);
|
|
860
|
+
const p = Q(() => !i || a || !n || l && (!e || n.id !== e.id) ? null : {
|
|
861
861
|
dashboardId: n.id,
|
|
862
|
-
dirty:
|
|
862
|
+
dirty: l && e ? Me(n) !== Me(e) : !1
|
|
863
863
|
}, [
|
|
864
|
-
|
|
864
|
+
l,
|
|
865
865
|
a,
|
|
866
|
-
|
|
866
|
+
i,
|
|
867
867
|
e,
|
|
868
868
|
n
|
|
869
|
-
]),
|
|
870
|
-
return
|
|
871
|
-
if (!s || !
|
|
872
|
-
|
|
869
|
+
]), o = ue(null);
|
|
870
|
+
return yt(() => {
|
|
871
|
+
if (!s || !p) {
|
|
872
|
+
o.current = null;
|
|
873
873
|
return;
|
|
874
874
|
}
|
|
875
|
-
const
|
|
876
|
-
(
|
|
875
|
+
const c = o.current;
|
|
876
|
+
(c == null ? void 0 : c.callback) === s && c.dashboardId === p.dashboardId && c.dirty === p.dirty || (o.current = {
|
|
877
877
|
callback: s,
|
|
878
|
-
dashboardId:
|
|
879
|
-
dirty:
|
|
878
|
+
dashboardId: p.dashboardId,
|
|
879
|
+
dirty: p.dirty
|
|
880
880
|
}, s({
|
|
881
881
|
type: "dashboard:dirty-state",
|
|
882
|
-
dashboardId:
|
|
883
|
-
payload: { dirty:
|
|
882
|
+
dashboardId: p.dashboardId,
|
|
883
|
+
payload: { dirty: p.dirty }
|
|
884
884
|
}));
|
|
885
|
-
}, [
|
|
885
|
+
}, [p, s]), u;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
887
|
+
function Ta({
|
|
888
888
|
open: e,
|
|
889
889
|
onOpenChange: a,
|
|
890
|
-
isLibraryVisual:
|
|
890
|
+
isLibraryVisual: i,
|
|
891
891
|
currentVisualName: n,
|
|
892
|
-
isSaving:
|
|
892
|
+
isSaving: l = !1,
|
|
893
893
|
destinationMode: s = "both",
|
|
894
|
-
onConfirm:
|
|
894
|
+
onConfirm: u
|
|
895
895
|
}) {
|
|
896
|
-
const [
|
|
897
|
-
|
|
898
|
-
), [
|
|
899
|
-
|
|
900
|
-
e && (
|
|
901
|
-
|
|
896
|
+
const [p, o] = E(
|
|
897
|
+
i && n ? `Copy of ${n}` : n || ""
|
|
898
|
+
), [c, d] = E("");
|
|
899
|
+
Dt.useEffect(() => {
|
|
900
|
+
e && (o(
|
|
901
|
+
i && n ? `Copy of ${n}` : n || ""
|
|
902
902
|
), d(""));
|
|
903
|
-
}, [e,
|
|
904
|
-
const
|
|
903
|
+
}, [e, i, n]);
|
|
904
|
+
const m = !!p.trim(), h = s === "local" ? {
|
|
905
905
|
saveToLibrary: !1,
|
|
906
906
|
saveToCurrentDashboard: !0,
|
|
907
907
|
badgeType: "local",
|
|
@@ -920,19 +920,19 @@ function Fa({
|
|
|
920
920
|
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
921
921
|
actionLabel: "Save Copy as Linked Visual"
|
|
922
922
|
}, f = () => {
|
|
923
|
-
!
|
|
924
|
-
name:
|
|
925
|
-
description:
|
|
923
|
+
!m || l || u({
|
|
924
|
+
name: p.trim(),
|
|
925
|
+
description: c.trim() || void 0,
|
|
926
926
|
saveToLibrary: h.saveToLibrary,
|
|
927
927
|
saveToCurrentDashboard: h.saveToCurrentDashboard
|
|
928
928
|
});
|
|
929
929
|
};
|
|
930
|
-
return /* @__PURE__ */ t(
|
|
931
|
-
/* @__PURE__ */ r(
|
|
932
|
-
/* @__PURE__ */ r(
|
|
930
|
+
return /* @__PURE__ */ t(Ee, { open: e, onOpenChange: a, children: /* @__PURE__ */ r(Ae, { className: "sm:max-w-[500px]", children: [
|
|
931
|
+
/* @__PURE__ */ r(pt, { children: [
|
|
932
|
+
/* @__PURE__ */ r(Ie, { className: "flex items-center gap-2", children: [
|
|
933
933
|
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
934
934
|
h.badgeType !== "local" && /* @__PURE__ */ t(
|
|
935
|
-
|
|
935
|
+
la,
|
|
936
936
|
{
|
|
937
937
|
type: h.badgeType,
|
|
938
938
|
showLabel: !0,
|
|
@@ -940,77 +940,77 @@ function Fa({
|
|
|
940
940
|
}
|
|
941
941
|
)
|
|
942
942
|
] }),
|
|
943
|
-
/* @__PURE__ */ t(
|
|
943
|
+
/* @__PURE__ */ t(ft, { children: h.description })
|
|
944
944
|
] }),
|
|
945
945
|
/* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
|
|
946
946
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
947
|
-
/* @__PURE__ */ t(
|
|
947
|
+
/* @__PURE__ */ t(ke, { htmlFor: "name", children: "Name" }),
|
|
948
948
|
/* @__PURE__ */ t(
|
|
949
|
-
|
|
949
|
+
at,
|
|
950
950
|
{
|
|
951
951
|
id: "name",
|
|
952
|
-
value:
|
|
953
|
-
onChange: (
|
|
952
|
+
value: p,
|
|
953
|
+
onChange: (b) => o(b.target.value),
|
|
954
954
|
placeholder: "Enter visual name",
|
|
955
|
-
disabled:
|
|
955
|
+
disabled: l
|
|
956
956
|
}
|
|
957
957
|
)
|
|
958
958
|
] }),
|
|
959
959
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
960
|
-
/* @__PURE__ */ t(
|
|
960
|
+
/* @__PURE__ */ t(ke, { htmlFor: "description", children: "Description (optional)" }),
|
|
961
961
|
/* @__PURE__ */ t(
|
|
962
|
-
|
|
962
|
+
pr,
|
|
963
963
|
{
|
|
964
964
|
id: "description",
|
|
965
|
-
value:
|
|
966
|
-
onChange: (
|
|
965
|
+
value: c,
|
|
966
|
+
onChange: (b) => d(b.target.value),
|
|
967
967
|
placeholder: "Enter visual description",
|
|
968
968
|
rows: 3,
|
|
969
|
-
disabled:
|
|
969
|
+
disabled: l
|
|
970
970
|
}
|
|
971
971
|
)
|
|
972
972
|
] })
|
|
973
973
|
] }),
|
|
974
|
-
/* @__PURE__ */ r(
|
|
974
|
+
/* @__PURE__ */ r(fr, { children: [
|
|
975
975
|
/* @__PURE__ */ t(
|
|
976
|
-
|
|
976
|
+
R,
|
|
977
977
|
{
|
|
978
978
|
variant: "outline",
|
|
979
979
|
onClick: () => a(!1),
|
|
980
|
-
disabled:
|
|
980
|
+
disabled: l,
|
|
981
981
|
children: "Cancel"
|
|
982
982
|
}
|
|
983
983
|
),
|
|
984
|
-
/* @__PURE__ */ r(
|
|
985
|
-
|
|
984
|
+
/* @__PURE__ */ r(R, { onClick: f, disabled: !m || l, children: [
|
|
985
|
+
l && /* @__PURE__ */ t(ae, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
986
986
|
h.actionLabel
|
|
987
987
|
] })
|
|
988
988
|
] })
|
|
989
989
|
] }) });
|
|
990
990
|
}
|
|
991
|
-
function
|
|
992
|
-
const [e, a] =
|
|
993
|
-
var
|
|
994
|
-
return ((
|
|
995
|
-
})(),
|
|
996
|
-
|
|
991
|
+
function Ba() {
|
|
992
|
+
const [e, a] = E(!1), [i, n] = E(!1), [l, s] = E(null), [u, p] = E(null), o = fe((g) => g.frame), c = fe((g) => g.card), d = gr(), m = T((g) => g.selectedSheetId), h = T((g) => g.dashboard), { getUpdatedFrame: f } = bt(), { selectVisual: b } = Lt(), { addFrame: k, setSelectedFrameId: I, setIsVisualEditing: y } = ve(), S = Rt(), D = !!(o != null && o.visualId), w = (() => {
|
|
993
|
+
var g, v;
|
|
994
|
+
return ((g = o == null ? void 0 : o.cards) == null ? void 0 : g.length) === 1 && ((v = o.cards[0]) != null && v.title) ? o.cards[0].title : d != null && d.title ? d.title : (c == null ? void 0 : c.title) || "Untitled Visual";
|
|
995
|
+
})(), C = br((g) => {
|
|
996
|
+
g != null && g.id && (b(g), i && l && u && m && (async () => {
|
|
997
997
|
try {
|
|
998
|
-
const
|
|
999
|
-
...
|
|
1000
|
-
id:
|
|
1001
|
-
visualId:
|
|
998
|
+
const v = {
|
|
999
|
+
...l,
|
|
1000
|
+
id: wt(),
|
|
1001
|
+
visualId: g.id
|
|
1002
1002
|
// Link to the newly created library visual
|
|
1003
1003
|
};
|
|
1004
|
-
k(
|
|
1004
|
+
k(m, v, {
|
|
1005
1005
|
position: "end",
|
|
1006
|
-
semanticExecutionPayload:
|
|
1007
|
-
}),
|
|
1008
|
-
} catch (
|
|
1006
|
+
semanticExecutionPayload: u
|
|
1007
|
+
}), I(v.id), n(!1), s(null), p(null), y(!1);
|
|
1008
|
+
} catch (v) {
|
|
1009
1009
|
console.error(
|
|
1010
1010
|
"Failed to promote semantic metadata for saved visual:",
|
|
1011
|
-
|
|
1012
|
-
),
|
|
1013
|
-
|
|
1011
|
+
v
|
|
1012
|
+
), $.error(
|
|
1013
|
+
v instanceof Error ? v.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1014
1014
|
);
|
|
1015
1015
|
}
|
|
1016
1016
|
})(), a(!1));
|
|
@@ -1018,193 +1018,193 @@ function La() {
|
|
|
1018
1018
|
return {
|
|
1019
1019
|
saveAsDialogOpen: e,
|
|
1020
1020
|
setSaveAsDialogOpen: a,
|
|
1021
|
-
handleSaveAs: async (
|
|
1022
|
-
if (!
|
|
1023
|
-
|
|
1021
|
+
handleSaveAs: async (g) => {
|
|
1022
|
+
if (!m) {
|
|
1023
|
+
$.error("No sheet selected");
|
|
1024
1024
|
return;
|
|
1025
1025
|
}
|
|
1026
|
-
const
|
|
1027
|
-
...
|
|
1028
|
-
cards:
|
|
1029
|
-
...
|
|
1030
|
-
title:
|
|
1026
|
+
const v = f(), A = v.cards.length === 1 ? {
|
|
1027
|
+
...v,
|
|
1028
|
+
cards: v.cards.map((q) => ({
|
|
1029
|
+
...q,
|
|
1030
|
+
title: g.name
|
|
1031
1031
|
// Use visual name as card title
|
|
1032
1032
|
}))
|
|
1033
|
-
} :
|
|
1034
|
-
if (
|
|
1035
|
-
let
|
|
1036
|
-
if (
|
|
1033
|
+
} : v;
|
|
1034
|
+
if (g.saveToLibrary) {
|
|
1035
|
+
let q = null;
|
|
1036
|
+
if (g.saveToCurrentDashboard)
|
|
1037
1037
|
try {
|
|
1038
|
-
|
|
1039
|
-
previousFrame:
|
|
1038
|
+
q = await S(A, {
|
|
1039
|
+
previousFrame: nt(h, A.id)
|
|
1040
1040
|
});
|
|
1041
1041
|
} catch (P) {
|
|
1042
1042
|
console.error(
|
|
1043
1043
|
"Failed to prepare semantic metadata before saving visual:",
|
|
1044
1044
|
P
|
|
1045
|
-
),
|
|
1045
|
+
), $.error(
|
|
1046
1046
|
P instanceof Error ? P.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1047
1047
|
);
|
|
1048
1048
|
return;
|
|
1049
1049
|
}
|
|
1050
|
-
n(
|
|
1051
|
-
const
|
|
1052
|
-
title:
|
|
1053
|
-
description:
|
|
1054
|
-
frameObject:
|
|
1050
|
+
n(g.saveToCurrentDashboard), s(A), p(q);
|
|
1051
|
+
const L = {
|
|
1052
|
+
title: g.name,
|
|
1053
|
+
description: g.description,
|
|
1054
|
+
frameObject: A,
|
|
1055
1055
|
// Card title synced for single-card frames
|
|
1056
1056
|
isPrivate: !1
|
|
1057
1057
|
};
|
|
1058
|
-
|
|
1059
|
-
} else if (
|
|
1060
|
-
const
|
|
1061
|
-
...
|
|
1058
|
+
C.mutate(L);
|
|
1059
|
+
} else if (g.saveToCurrentDashboard) {
|
|
1060
|
+
const q = {
|
|
1061
|
+
...A,
|
|
1062
1062
|
// Card title already synced
|
|
1063
|
-
id:
|
|
1063
|
+
id: wt(),
|
|
1064
1064
|
visualId: void 0
|
|
1065
1065
|
// Explicitly no visualId for local visuals
|
|
1066
1066
|
};
|
|
1067
1067
|
try {
|
|
1068
|
-
const
|
|
1069
|
-
previousFrame:
|
|
1068
|
+
const L = await S(A, {
|
|
1069
|
+
previousFrame: nt(h, A.id)
|
|
1070
1070
|
});
|
|
1071
|
-
k(
|
|
1071
|
+
k(m, q, {
|
|
1072
1072
|
position: "end",
|
|
1073
|
-
semanticExecutionPayload:
|
|
1074
|
-
}),
|
|
1075
|
-
} catch (
|
|
1076
|
-
console.error("Failed to save visual to dashboard:",
|
|
1077
|
-
|
|
1073
|
+
semanticExecutionPayload: L
|
|
1074
|
+
}), I(q.id), $.success("Visual saved to dashboard"), a(!1), y(!1);
|
|
1075
|
+
} catch (L) {
|
|
1076
|
+
console.error("Failed to save visual to dashboard:", L), $.error(
|
|
1077
|
+
L instanceof Error ? L.message : "Failed to prepare semantic metadata for the visual"
|
|
1078
1078
|
);
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
1081
|
},
|
|
1082
|
-
isLibraryVisual:
|
|
1082
|
+
isLibraryVisual: D,
|
|
1083
1083
|
currentVisualName: w,
|
|
1084
|
-
isSaving:
|
|
1084
|
+
isSaving: C.isPending
|
|
1085
1085
|
};
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1088
|
-
const { isInspectionMode: a } =
|
|
1089
|
-
saveAsDialogOpen:
|
|
1087
|
+
function Gn(e = {}) {
|
|
1088
|
+
const { isInspectionMode: a } = xr(), i = fe((L) => L.frame), n = fe((L) => L.editorContext), l = vr((L) => L.selectedVisual), s = T((L) => L.selectedFrameId), u = T((L) => L.selectedSheetId), p = T((L) => L.dashboard), { setIsVisualEditing: o, updateFrame: c } = ve(), [d, m] = E(!1), [h, f] = E("both"), b = Rt(), k = (n == null ? void 0 : n.type) === "documentSection", I = !!(i != null && i.visualId || l != null && l.id), y = !!(i != null && i.visualId && s), S = I && !y, {
|
|
1089
|
+
saveAsDialogOpen: D,
|
|
1090
1090
|
setSaveAsDialogOpen: w,
|
|
1091
|
-
handleSaveAs:
|
|
1092
|
-
isLibraryVisual:
|
|
1093
|
-
currentVisualName:
|
|
1094
|
-
isSaving:
|
|
1095
|
-
} =
|
|
1091
|
+
handleSaveAs: C,
|
|
1092
|
+
isLibraryVisual: F,
|
|
1093
|
+
currentVisualName: g,
|
|
1094
|
+
isSaving: v
|
|
1095
|
+
} = Ba(), { getUpdatedFrame: U } = bt();
|
|
1096
1096
|
if (a)
|
|
1097
|
-
return /* @__PURE__ */ r(
|
|
1097
|
+
return /* @__PURE__ */ r(j, { children: [
|
|
1098
1098
|
/* @__PURE__ */ t(
|
|
1099
|
-
|
|
1099
|
+
et,
|
|
1100
1100
|
{
|
|
1101
1101
|
className: "rounded-control",
|
|
1102
1102
|
variant: "default"
|
|
1103
1103
|
}
|
|
1104
1104
|
),
|
|
1105
|
-
/* @__PURE__ */ t(
|
|
1105
|
+
/* @__PURE__ */ t(tt, {})
|
|
1106
1106
|
] });
|
|
1107
1107
|
if (k)
|
|
1108
|
-
return /* @__PURE__ */ r(
|
|
1109
|
-
/* @__PURE__ */ t(
|
|
1110
|
-
/* @__PURE__ */ t(
|
|
1108
|
+
return /* @__PURE__ */ r(j, { children: [
|
|
1109
|
+
/* @__PURE__ */ t(et, { className: "rounded-control", variant: "default" }),
|
|
1110
|
+
/* @__PURE__ */ t(tt, {})
|
|
1111
1111
|
] });
|
|
1112
|
-
const
|
|
1113
|
-
if (!
|
|
1114
|
-
|
|
1112
|
+
const A = async () => {
|
|
1113
|
+
if (!u) {
|
|
1114
|
+
$.error("No sheet selected");
|
|
1115
1115
|
return;
|
|
1116
1116
|
}
|
|
1117
1117
|
if (d) return;
|
|
1118
|
-
|
|
1118
|
+
m(!0);
|
|
1119
1119
|
const P = {
|
|
1120
|
-
...
|
|
1120
|
+
...U(),
|
|
1121
1121
|
visualId: void 0
|
|
1122
|
-
},
|
|
1122
|
+
}, J = nt(p, P.id);
|
|
1123
1123
|
try {
|
|
1124
|
-
const
|
|
1125
|
-
previousFrame:
|
|
1124
|
+
const ne = await b(P, {
|
|
1125
|
+
previousFrame: J
|
|
1126
1126
|
});
|
|
1127
|
-
u
|
|
1128
|
-
semanticExecutionPayload:
|
|
1127
|
+
c(u, P, {
|
|
1128
|
+
semanticExecutionPayload: ne
|
|
1129
1129
|
});
|
|
1130
|
-
} catch (
|
|
1131
|
-
console.error("Failed to apply local semantic metadata:",
|
|
1132
|
-
|
|
1130
|
+
} catch (ne) {
|
|
1131
|
+
console.error("Failed to apply local semantic metadata:", ne), m(!1), $.error(
|
|
1132
|
+
ne instanceof Error ? ne.message : "Failed to prepare semantic metadata for this visual"
|
|
1133
1133
|
);
|
|
1134
1134
|
return;
|
|
1135
1135
|
}
|
|
1136
1136
|
setTimeout(() => {
|
|
1137
|
-
|
|
1137
|
+
m(!1), $.success("Changes applied. Visual is now local to this dashboard"), o(!1);
|
|
1138
1138
|
}, 300);
|
|
1139
|
-
},
|
|
1140
|
-
f(
|
|
1139
|
+
}, q = (L) => {
|
|
1140
|
+
f(L), w(!0);
|
|
1141
1141
|
};
|
|
1142
|
-
return /* @__PURE__ */ r(
|
|
1142
|
+
return /* @__PURE__ */ r(j, { children: [
|
|
1143
1143
|
/* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
1144
|
-
!
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
/* @__PURE__ */ r(
|
|
1148
|
-
/* @__PURE__ */ t(
|
|
1149
|
-
|
|
1144
|
+
!I && /* @__PURE__ */ t(et, { className: "!rounded-none", variant: "default" }),
|
|
1145
|
+
I && S && /* @__PURE__ */ t(da, { className: "!rounded-none", variant: "default" }),
|
|
1146
|
+
I && y && /* @__PURE__ */ t(ca, { className: "!rounded-none" }),
|
|
1147
|
+
/* @__PURE__ */ r(Ge, { modal: !1, children: [
|
|
1148
|
+
/* @__PURE__ */ t(Xe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1149
|
+
R,
|
|
1150
1150
|
{
|
|
1151
1151
|
variant: "default",
|
|
1152
1152
|
size: "xs",
|
|
1153
1153
|
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
1154
1154
|
"aria-label": "Open visual save options",
|
|
1155
|
-
disabled:
|
|
1156
|
-
children: /* @__PURE__ */ t(
|
|
1155
|
+
disabled: v || d,
|
|
1156
|
+
children: /* @__PURE__ */ t(Ot, { className: "h-3.5 w-3.5" })
|
|
1157
1157
|
}
|
|
1158
1158
|
) }),
|
|
1159
1159
|
/* @__PURE__ */ r(
|
|
1160
|
-
|
|
1160
|
+
Ke,
|
|
1161
1161
|
{
|
|
1162
1162
|
align: "end",
|
|
1163
1163
|
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
1164
1164
|
children: [
|
|
1165
|
-
|
|
1165
|
+
y && /* @__PURE__ */ r(j, { children: [
|
|
1166
1166
|
/* @__PURE__ */ r(
|
|
1167
|
-
|
|
1167
|
+
G,
|
|
1168
1168
|
{
|
|
1169
|
-
onClick:
|
|
1169
|
+
onClick: A,
|
|
1170
1170
|
disabled: d,
|
|
1171
1171
|
children: [
|
|
1172
|
-
/* @__PURE__ */ t(
|
|
1172
|
+
/* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" }),
|
|
1173
1173
|
d ? "Applying..." : "Apply Locally"
|
|
1174
1174
|
]
|
|
1175
1175
|
}
|
|
1176
1176
|
),
|
|
1177
|
-
/* @__PURE__ */ t(
|
|
1177
|
+
/* @__PURE__ */ t(He, {})
|
|
1178
1178
|
] }),
|
|
1179
1179
|
/* @__PURE__ */ r(
|
|
1180
|
-
|
|
1180
|
+
G,
|
|
1181
1181
|
{
|
|
1182
|
-
onClick: () =>
|
|
1183
|
-
disabled:
|
|
1182
|
+
onClick: () => q("local"),
|
|
1183
|
+
disabled: v,
|
|
1184
1184
|
children: [
|
|
1185
|
-
/* @__PURE__ */ t(
|
|
1185
|
+
/* @__PURE__ */ t(xe, { className: "h-3.5 w-3.5" }),
|
|
1186
1186
|
"Add to Dashboard (Local)"
|
|
1187
1187
|
]
|
|
1188
1188
|
}
|
|
1189
1189
|
),
|
|
1190
1190
|
/* @__PURE__ */ r(
|
|
1191
|
-
|
|
1191
|
+
G,
|
|
1192
1192
|
{
|
|
1193
|
-
onClick: () =>
|
|
1194
|
-
disabled:
|
|
1193
|
+
onClick: () => q("library"),
|
|
1194
|
+
disabled: v,
|
|
1195
1195
|
children: [
|
|
1196
|
-
/* @__PURE__ */ t(
|
|
1196
|
+
/* @__PURE__ */ t(ua, { className: "h-3.5 w-3.5" }),
|
|
1197
1197
|
"Save as Library Visual"
|
|
1198
1198
|
]
|
|
1199
1199
|
}
|
|
1200
1200
|
),
|
|
1201
1201
|
/* @__PURE__ */ r(
|
|
1202
|
-
|
|
1202
|
+
G,
|
|
1203
1203
|
{
|
|
1204
|
-
onClick: () =>
|
|
1205
|
-
disabled:
|
|
1204
|
+
onClick: () => q("both"),
|
|
1205
|
+
disabled: v,
|
|
1206
1206
|
children: [
|
|
1207
|
-
/* @__PURE__ */ t(
|
|
1207
|
+
/* @__PURE__ */ t(ha, { className: "h-3.5 w-3.5" }),
|
|
1208
1208
|
"Save Copy as Linked Visual"
|
|
1209
1209
|
]
|
|
1210
1210
|
}
|
|
@@ -1214,87 +1214,87 @@ function zn(e = {}) {
|
|
|
1214
1214
|
)
|
|
1215
1215
|
] })
|
|
1216
1216
|
] }),
|
|
1217
|
-
/* @__PURE__ */ t(
|
|
1217
|
+
/* @__PURE__ */ t(tt, {}),
|
|
1218
1218
|
/* @__PURE__ */ t(
|
|
1219
|
-
|
|
1219
|
+
Ta,
|
|
1220
1220
|
{
|
|
1221
|
-
open:
|
|
1222
|
-
onOpenChange: (
|
|
1223
|
-
|
|
1221
|
+
open: D,
|
|
1222
|
+
onOpenChange: (L) => {
|
|
1223
|
+
v || w(L);
|
|
1224
1224
|
},
|
|
1225
|
-
isLibraryVisual:
|
|
1226
|
-
currentVisualName:
|
|
1227
|
-
isSaving:
|
|
1225
|
+
isLibraryVisual: F,
|
|
1226
|
+
currentVisualName: g,
|
|
1227
|
+
isSaving: v,
|
|
1228
1228
|
destinationMode: h,
|
|
1229
|
-
onConfirm:
|
|
1229
|
+
onConfirm: C
|
|
1230
1230
|
}
|
|
1231
1231
|
)
|
|
1232
1232
|
] });
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1235
|
-
const a =
|
|
1236
|
-
if (!n || !
|
|
1234
|
+
function Xn({ className: e }) {
|
|
1235
|
+
const a = fe((d) => d.isDevMode), i = fe((d) => d.card.type), n = T((d) => d.isVisualEditing), { setIsDevMode: l } = At(), { config: s } = Xt(yr).tokenProps, u = (s == null ? void 0 : s.showAdvancedMode) !== !1;
|
|
1236
|
+
if (!n || !u || !ga(i))
|
|
1237
1237
|
return null;
|
|
1238
|
-
const
|
|
1238
|
+
const p = a ? wa : Cr, o = a ? "Visual editor" : "SQL editor", c = a ? "Switch to visual editor" : "Switch to SQL editor";
|
|
1239
1239
|
return /* @__PURE__ */ r(
|
|
1240
1240
|
"button",
|
|
1241
1241
|
{
|
|
1242
1242
|
type: "button",
|
|
1243
|
-
"aria-label":
|
|
1244
|
-
title:
|
|
1245
|
-
onClick: () =>
|
|
1246
|
-
className:
|
|
1243
|
+
"aria-label": c,
|
|
1244
|
+
title: c,
|
|
1245
|
+
onClick: () => l(!a),
|
|
1246
|
+
className: X(
|
|
1247
1247
|
"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",
|
|
1248
1248
|
e
|
|
1249
1249
|
),
|
|
1250
1250
|
children: [
|
|
1251
|
-
/* @__PURE__ */ t(
|
|
1252
|
-
|
|
1251
|
+
/* @__PURE__ */ t(p, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1252
|
+
o
|
|
1253
1253
|
]
|
|
1254
1254
|
}
|
|
1255
1255
|
);
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function Kn({
|
|
1258
1258
|
open: e,
|
|
1259
1259
|
onOpenChange: a,
|
|
1260
|
-
onSave:
|
|
1260
|
+
onSave: i,
|
|
1261
1261
|
onDiscard: n,
|
|
1262
|
-
isSaving:
|
|
1262
|
+
isSaving: l,
|
|
1263
1263
|
title: s = "Unsaved changes",
|
|
1264
|
-
description:
|
|
1265
|
-
cancelLabel:
|
|
1266
|
-
discardLabel:
|
|
1267
|
-
saveLabel:
|
|
1264
|
+
description: u = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
1265
|
+
cancelLabel: p = "Cancel",
|
|
1266
|
+
discardLabel: o = "Discard changes",
|
|
1267
|
+
saveLabel: c = "Save"
|
|
1268
1268
|
}) {
|
|
1269
|
-
return /* @__PURE__ */ t(
|
|
1270
|
-
!
|
|
1271
|
-
}, children: /* @__PURE__ */ r(
|
|
1272
|
-
/* @__PURE__ */ r(st, { children: [
|
|
1273
|
-
/* @__PURE__ */ t(ot, { children: s }),
|
|
1274
|
-
/* @__PURE__ */ t(it, { children: c })
|
|
1275
|
-
] }),
|
|
1269
|
+
return /* @__PURE__ */ t(ot, { open: e, onOpenChange: (m) => {
|
|
1270
|
+
!m && l || a(m);
|
|
1271
|
+
}, children: /* @__PURE__ */ r(it, { children: [
|
|
1276
1272
|
/* @__PURE__ */ r(lt, { children: [
|
|
1273
|
+
/* @__PURE__ */ t(dt, { children: s }),
|
|
1274
|
+
/* @__PURE__ */ t(ct, { children: u })
|
|
1275
|
+
] }),
|
|
1276
|
+
/* @__PURE__ */ r(ut, { children: [
|
|
1277
1277
|
/* @__PURE__ */ t(
|
|
1278
|
-
|
|
1278
|
+
R,
|
|
1279
1279
|
{
|
|
1280
1280
|
type: "button",
|
|
1281
1281
|
size: "xs",
|
|
1282
1282
|
onClick: n,
|
|
1283
|
-
disabled:
|
|
1283
|
+
disabled: l,
|
|
1284
1284
|
variant: "outline",
|
|
1285
1285
|
className: "mr-auto text-destructive hover:border-destructive/40 hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
|
|
1286
|
-
children:
|
|
1286
|
+
children: o
|
|
1287
1287
|
}
|
|
1288
1288
|
),
|
|
1289
|
-
/* @__PURE__ */ t(
|
|
1290
|
-
/* @__PURE__ */ t(
|
|
1291
|
-
/* @__PURE__ */ t(
|
|
1289
|
+
/* @__PURE__ */ t(ht, { disabled: l, children: p }),
|
|
1290
|
+
/* @__PURE__ */ t(R, { type: "button", size: "xs", onClick: i, disabled: l, children: l ? /* @__PURE__ */ r(j, { children: [
|
|
1291
|
+
/* @__PURE__ */ t(ae, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1292
1292
|
"Saving..."
|
|
1293
|
-
] }) :
|
|
1293
|
+
] }) : c })
|
|
1294
1294
|
] })
|
|
1295
1295
|
] }) });
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function vt(e, a) {
|
|
1298
1298
|
return {
|
|
1299
1299
|
id: e.id,
|
|
1300
1300
|
status: e.status,
|
|
@@ -1307,202 +1307,208 @@ function bt(e, a) {
|
|
|
1307
1307
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
1308
1308
|
fileSize: e.fileSize,
|
|
1309
1309
|
error: e.error,
|
|
1310
|
+
phase: e.phase,
|
|
1311
|
+
deadlineAt: e.deadlineAt ? new Date(e.deadlineAt) : void 0,
|
|
1310
1312
|
// A refreshed result replaces prior authorization, including a failed URL fetch.
|
|
1311
1313
|
downloadUrl: a
|
|
1312
1314
|
};
|
|
1313
1315
|
}
|
|
1314
|
-
const
|
|
1315
|
-
function
|
|
1316
|
+
const Ra = 15e3;
|
|
1317
|
+
function pe(e) {
|
|
1318
|
+
const a = new AbortController();
|
|
1319
|
+
let i;
|
|
1320
|
+
const n = new Promise((l, s) => {
|
|
1321
|
+
i = setTimeout(() => {
|
|
1322
|
+
a.abort(), s(new Error("Export request timed out."));
|
|
1323
|
+
}, Ra);
|
|
1324
|
+
});
|
|
1325
|
+
return Promise.race([e(a.signal), n]).finally(() => clearTimeout(i));
|
|
1326
|
+
}
|
|
1327
|
+
const Ua = 1e4, Va = 15e3, Pa = 3e4, _a = 3e4, Ma = 12e4, Oa = 5 * 6e4, za = 2 * 60 * 60 * 1e3;
|
|
1328
|
+
function $a(e) {
|
|
1329
|
+
return e.deadlineAt ? e.deadlineAt.getTime() + Oa : e.startedAt.getTime() + za;
|
|
1330
|
+
}
|
|
1331
|
+
function ja(e) {
|
|
1316
1332
|
const a = Date.now() - e.getTime();
|
|
1317
|
-
return a <
|
|
1333
|
+
return a < _a ? Ua : a < Ma ? Va : Pa;
|
|
1318
1334
|
}
|
|
1319
|
-
function
|
|
1320
|
-
const { authToken: e, tokenProps: a } =
|
|
1335
|
+
function Yn() {
|
|
1336
|
+
const { authToken: e, tokenProps: a } = Ye(), i = me((h) => h.activeExports), [n, l] = E(
|
|
1321
1337
|
typeof document < "u" ? !document.hidden : !0
|
|
1322
|
-
), s =
|
|
1323
|
-
const h =
|
|
1338
|
+
), s = ue(null), u = ue(!1), p = ue(void 0), o = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken, d = H(() => {
|
|
1339
|
+
const h = me.getState().activeExports;
|
|
1324
1340
|
return Array.from(h.values()).filter(
|
|
1325
|
-
(f) =>
|
|
1341
|
+
(f) => De(f.status)
|
|
1326
1342
|
);
|
|
1327
1343
|
}, []);
|
|
1328
1344
|
Y(() => {
|
|
1329
1345
|
if (typeof document > "u") return;
|
|
1330
1346
|
const h = () => {
|
|
1331
|
-
|
|
1347
|
+
l(!document.hidden);
|
|
1332
1348
|
};
|
|
1333
1349
|
return document.addEventListener("visibilitychange", h), () => {
|
|
1334
1350
|
document.removeEventListener("visibilitychange", h);
|
|
1335
1351
|
};
|
|
1336
1352
|
}, []);
|
|
1337
|
-
const
|
|
1338
|
-
if (!
|
|
1339
|
-
|
|
1353
|
+
const m = H(async () => {
|
|
1354
|
+
if (!o || !c) {
|
|
1355
|
+
u.current = !1;
|
|
1340
1356
|
return;
|
|
1341
1357
|
}
|
|
1342
1358
|
const h = d();
|
|
1343
1359
|
if (h.length === 0) {
|
|
1344
|
-
|
|
1360
|
+
u.current = !1;
|
|
1345
1361
|
return;
|
|
1346
1362
|
}
|
|
1347
|
-
const f = Date.now(),
|
|
1348
|
-
(
|
|
1349
|
-
);
|
|
1350
|
-
if (g.length > 0) {
|
|
1351
|
-
const { updateExport: C } = he.getState().actions;
|
|
1352
|
-
for (const w of g)
|
|
1353
|
-
C(w.id, {
|
|
1354
|
-
status: "failed",
|
|
1355
|
-
error: "Export timed out. Please try again or contact support.",
|
|
1356
|
-
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
1357
|
-
});
|
|
1358
|
-
}
|
|
1359
|
-
const k = h.filter(
|
|
1360
|
-
(C) => f - C.startedAt.getTime() <= Ct
|
|
1361
|
-
);
|
|
1362
|
-
if (k.length === 0) {
|
|
1363
|
-
c.current = !1;
|
|
1364
|
-
return;
|
|
1365
|
-
}
|
|
1366
|
-
const x = await Promise.allSettled(
|
|
1367
|
-
k.map(async (C) => {
|
|
1363
|
+
const f = Date.now(), b = await Promise.allSettled(
|
|
1364
|
+
h.map(async (D) => {
|
|
1368
1365
|
try {
|
|
1369
|
-
const w = await
|
|
1370
|
-
let
|
|
1366
|
+
const w = await pe((F) => Ut(o, c, D.id, F));
|
|
1367
|
+
let C;
|
|
1371
1368
|
if (w.status === "completed")
|
|
1372
1369
|
try {
|
|
1373
|
-
|
|
1374
|
-
} catch (
|
|
1370
|
+
C = await pe((F) => qe(o, c, D.id, F));
|
|
1371
|
+
} catch (F) {
|
|
1375
1372
|
console.error(
|
|
1376
|
-
`[useExportPolling] Failed to get download URL for ${
|
|
1377
|
-
|
|
1373
|
+
`[useExportPolling] Failed to get download URL for ${D.id}:`,
|
|
1374
|
+
F
|
|
1378
1375
|
);
|
|
1379
1376
|
}
|
|
1380
|
-
return
|
|
1377
|
+
return vt(w, C);
|
|
1381
1378
|
} catch (w) {
|
|
1382
1379
|
return console.error(
|
|
1383
|
-
`[useExportPolling] Failed to poll export ${
|
|
1380
|
+
`[useExportPolling] Failed to poll export ${D.id}:`,
|
|
1384
1381
|
w
|
|
1385
1382
|
), null;
|
|
1386
1383
|
}
|
|
1387
1384
|
})
|
|
1388
|
-
), { updateExport:
|
|
1389
|
-
|
|
1390
|
-
|
|
1385
|
+
), { updateExport: k, applyServerStatus: I } = me.getState().actions, y = (D) => {
|
|
1386
|
+
const w = me.getState().activeExports.get(D);
|
|
1387
|
+
return !!w && De(w.status);
|
|
1388
|
+
};
|
|
1389
|
+
h.forEach((D, w) => {
|
|
1390
|
+
if (!y(D.id)) return;
|
|
1391
|
+
const C = b[w], F = C.status === "fulfilled" ? C.value : null;
|
|
1392
|
+
if (f > $a(D) && !(F && !De(F.status))) {
|
|
1393
|
+
k(D.id, {
|
|
1394
|
+
status: "failed",
|
|
1395
|
+
error: z.unconfirmed,
|
|
1396
|
+
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
1397
|
+
});
|
|
1398
|
+
return;
|
|
1399
|
+
}
|
|
1400
|
+
F && I(F.id, F);
|
|
1401
|
+
});
|
|
1391
1402
|
const S = d();
|
|
1392
1403
|
if (S.length > 0 && !document.hidden) {
|
|
1393
|
-
const
|
|
1394
|
-
(
|
|
1404
|
+
const D = S.reduce(
|
|
1405
|
+
(C, F) => F.startedAt < C ? F.startedAt : C,
|
|
1395
1406
|
S[0].startedAt
|
|
1396
|
-
), w =
|
|
1407
|
+
), w = ja(D);
|
|
1397
1408
|
s.current && clearTimeout(s.current), s.current = setTimeout(() => {
|
|
1398
|
-
var
|
|
1399
|
-
(
|
|
1409
|
+
var C;
|
|
1410
|
+
(C = p.current) == null || C.call(p);
|
|
1400
1411
|
}, w);
|
|
1401
1412
|
} else
|
|
1402
|
-
|
|
1403
|
-
}, [
|
|
1413
|
+
u.current = !1;
|
|
1414
|
+
}, [o, c, d]);
|
|
1404
1415
|
return Y(() => {
|
|
1405
|
-
|
|
1406
|
-
}, [
|
|
1416
|
+
p.current = m;
|
|
1417
|
+
}, [m]), Y(() => {
|
|
1407
1418
|
var f;
|
|
1408
|
-
d().length > 0 && n && !
|
|
1409
|
-
}, [
|
|
1419
|
+
d().length > 0 && n && !u.current && (u.current = !0, (f = p.current) == null || f.call(p));
|
|
1420
|
+
}, [i, n, d]), Y(() => {
|
|
1410
1421
|
var f;
|
|
1411
1422
|
const h = d();
|
|
1412
|
-
n && h.length > 0 && !
|
|
1423
|
+
n && h.length > 0 && !u.current && (u.current = !0, (f = p.current) == null || f.call(p));
|
|
1413
1424
|
}, [n, d]), Y(() => {
|
|
1414
|
-
!n && s.current && (clearTimeout(s.current), s.current = null,
|
|
1425
|
+
!n && s.current && (clearTimeout(s.current), s.current = null, u.current = !1);
|
|
1415
1426
|
}, [n]), Y(() => () => {
|
|
1416
1427
|
s.current && (clearTimeout(s.current), s.current = null);
|
|
1417
1428
|
}, []), {
|
|
1418
|
-
isPolling:
|
|
1429
|
+
isPolling: u.current,
|
|
1419
1430
|
isTabVisible: n,
|
|
1420
1431
|
inProgressCount: d().length
|
|
1421
1432
|
};
|
|
1422
1433
|
}
|
|
1423
|
-
function
|
|
1424
|
-
const { authToken: e, tokenProps: a } =
|
|
1434
|
+
function Zn() {
|
|
1435
|
+
const { authToken: e, tokenProps: a } = Ye(), i = me((p) => p.activeExports), { recoverExport: n } = Vt(), l = ue(!1), s = a == null ? void 0 : a.apiServiceUrl, u = e == null ? void 0 : e.accessToken;
|
|
1425
1436
|
Y(() => {
|
|
1426
|
-
if (
|
|
1437
|
+
if (l.current || !s || !u) return;
|
|
1427
1438
|
(async () => {
|
|
1428
1439
|
try {
|
|
1429
|
-
const { exports:
|
|
1430
|
-
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
1440
|
+
const { exports: o } = await pe((c) => wr(s, u, {
|
|
1441
|
+
status: ["pending", "processing", "chunking", "compacting", "completed", "failed", "cancelled"],
|
|
1431
1442
|
limit: 20
|
|
1432
1443
|
// Limit to recent exports
|
|
1433
|
-
});
|
|
1434
|
-
for (const
|
|
1435
|
-
if (
|
|
1444
|
+
}, c));
|
|
1445
|
+
for (const c of o) {
|
|
1446
|
+
if (i.has(c.id)) continue;
|
|
1436
1447
|
let d;
|
|
1437
|
-
if (
|
|
1448
|
+
if (c.status === "completed")
|
|
1438
1449
|
try {
|
|
1439
|
-
d = await
|
|
1450
|
+
d = await pe((h) => qe(s, u, c.id, h));
|
|
1440
1451
|
} catch (h) {
|
|
1441
1452
|
console.error(
|
|
1442
|
-
`[useExportRecovery] Failed to get download URL for ${
|
|
1453
|
+
`[useExportRecovery] Failed to get download URL for ${c.id}:`,
|
|
1443
1454
|
h
|
|
1444
1455
|
);
|
|
1445
1456
|
}
|
|
1446
|
-
const
|
|
1447
|
-
...
|
|
1448
|
-
title:
|
|
1449
|
-
startedAt: new Date(
|
|
1450
|
-
expiresAt: new Date(
|
|
1457
|
+
const m = {
|
|
1458
|
+
...vt(c, d),
|
|
1459
|
+
title: Wa(c),
|
|
1460
|
+
startedAt: new Date(c.createdAt),
|
|
1461
|
+
expiresAt: new Date(c.expiresAt)
|
|
1451
1462
|
};
|
|
1452
|
-
n(
|
|
1463
|
+
n(m);
|
|
1453
1464
|
}
|
|
1454
|
-
|
|
1455
|
-
} catch (
|
|
1456
|
-
console.error("[useExportRecovery] Failed to recover exports:",
|
|
1465
|
+
l.current = !0;
|
|
1466
|
+
} catch (o) {
|
|
1467
|
+
console.error("[useExportRecovery] Failed to recover exports:", o), l.current = !0;
|
|
1457
1468
|
}
|
|
1458
1469
|
})();
|
|
1459
|
-
}, [s,
|
|
1470
|
+
}, [s, u, n, i]);
|
|
1460
1471
|
}
|
|
1461
|
-
function
|
|
1462
|
-
return e.title ? e.title :
|
|
1472
|
+
function Wa(e) {
|
|
1473
|
+
return e.title ? e.title : De(
|
|
1463
1474
|
e.status
|
|
1464
1475
|
) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
|
|
1465
1476
|
}
|
|
1466
|
-
function
|
|
1477
|
+
function Ha({
|
|
1467
1478
|
export: e,
|
|
1468
1479
|
onRemove: a,
|
|
1469
|
-
onDownload:
|
|
1480
|
+
onDownload: i
|
|
1470
1481
|
}) {
|
|
1471
|
-
const [n,
|
|
1482
|
+
const [n, l] = E("idle");
|
|
1472
1483
|
Y(() => {
|
|
1473
|
-
e.downloadUrl &&
|
|
1484
|
+
e.downloadUrl && l("idle");
|
|
1474
1485
|
}, [e.downloadUrl]);
|
|
1475
1486
|
const s = async () => {
|
|
1476
|
-
if (!
|
|
1487
|
+
if (!i) {
|
|
1477
1488
|
e.downloadUrl && window.open(e.downloadUrl, "_blank");
|
|
1478
1489
|
return;
|
|
1479
1490
|
}
|
|
1480
|
-
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1483
|
-
},
|
|
1484
|
-
|
|
1485
|
-
},
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
return "Finalizing...";
|
|
1491
|
-
default:
|
|
1492
|
-
return "Processing...";
|
|
1493
|
-
}
|
|
1494
|
-
})(), u = e.status === "completed" ? "bg-emerald-500" : e.status === "failed" ? "bg-destructive" : e.status === "pending" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", d = e.status === "completed" ? "Ready" : e.status === "failed" ? "Failed" : "In progress", p = pa(e.startedAt, { addSuffix: !0 }), h = [
|
|
1491
|
+
l("preparing");
|
|
1492
|
+
const k = await i(e);
|
|
1493
|
+
l(k === "denied" ? "denied" : "idle");
|
|
1494
|
+
}, u = (k) => {
|
|
1495
|
+
k.stopPropagation(), a == null || a(e.id);
|
|
1496
|
+
}, p = De(e.status), o = e.status === "pending" ? { text: z.queued } : e.status === "compacting" || e.phase === "finalizing" ? { text: z.finalizing } : e.phase === "preparing" ? { text: z.preparing } : e.phase === "acquiring" ? { text: z.fetchingRows(e.rowsProcessed ?? 0) } : {
|
|
1497
|
+
text: z.processing,
|
|
1498
|
+
detail: e.progress !== null ? z.percentComplete(e.progress) : e.rowsProcessed !== void 0 ? z.rowsProcessed(e.rowsProcessed) : void 0,
|
|
1499
|
+
bar: e.progress
|
|
1500
|
+
}, c = p && Date.now() - e.startedAt.getTime() >= Nr, d = e.status === "completed" ? "bg-emerald-500" : e.status === "failed" ? "bg-destructive" : e.status === "pending" || e.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", m = e.status === "completed" ? z.ready : e.status === "failed" ? z.failed : e.status === "cancelled" ? z.cancelled : z.inProgress, h = Nt(e.startedAt, { addSuffix: !0 }), f = [
|
|
1495
1501
|
e.status === "completed" && e.totalRows !== null ? `${e.totalRows.toLocaleString()} rows` : null,
|
|
1496
|
-
e.status === "completed" && e.fileSize ?
|
|
1497
|
-
].filter((
|
|
1502
|
+
e.status === "completed" && e.fileSize ? Sr(e.fileSize) : null
|
|
1503
|
+
].filter((k) => !!k), b = /* @__PURE__ */ t("span", { className: "text-muted-foreground/50", children: "·" });
|
|
1498
1504
|
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: [
|
|
1499
|
-
/* @__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 ${
|
|
1500
|
-
/* @__PURE__ */ t("span", { className: "sr-only", children:
|
|
1505
|
+
/* @__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 ${d}` }) }),
|
|
1506
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: m }),
|
|
1501
1507
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
1502
1508
|
/* @__PURE__ */ r("div", { className: "flex h-5 items-center gap-2", children: [
|
|
1503
1509
|
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: e.title }),
|
|
1504
1510
|
e.status === "completed" && n === "preparing" && /* @__PURE__ */ r("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: [
|
|
1505
|
-
/* @__PURE__ */ t(
|
|
1511
|
+
/* @__PURE__ */ t(Pt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }),
|
|
1506
1512
|
"Preparing"
|
|
1507
1513
|
] }),
|
|
1508
1514
|
e.status === "completed" && n !== "preparing" && /* @__PURE__ */ t(
|
|
@@ -1515,229 +1521,241 @@ function _a({
|
|
|
1515
1521
|
}
|
|
1516
1522
|
),
|
|
1517
1523
|
/* @__PURE__ */ t(
|
|
1518
|
-
|
|
1524
|
+
R,
|
|
1519
1525
|
{
|
|
1520
1526
|
variant: "ghost",
|
|
1521
1527
|
size: "xs",
|
|
1522
1528
|
className: "-mr-1.5 h-5 w-5 shrink-0 px-0 text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100",
|
|
1523
|
-
onClick:
|
|
1529
|
+
onClick: u,
|
|
1524
1530
|
"aria-label": "Remove notification",
|
|
1525
1531
|
title: "Remove",
|
|
1526
|
-
children: /* @__PURE__ */ t(
|
|
1532
|
+
children: /* @__PURE__ */ t(Ze, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
|
|
1527
1533
|
}
|
|
1528
1534
|
)
|
|
1529
1535
|
] }),
|
|
1530
|
-
|
|
1531
|
-
|
|
1536
|
+
e.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
|
|
1537
|
+
f.length > 0 && // Disclosed on hover or focus only; the time is what a reader scans.
|
|
1532
1538
|
/* @__PURE__ */ r("span", { className: "hidden group-hover:contents group-focus-within:contents", children: [
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
/* @__PURE__ */ t("span", { children:
|
|
1536
|
-
] },
|
|
1537
|
-
|
|
1539
|
+
f.map((k, I) => /* @__PURE__ */ r(Dt.Fragment, { children: [
|
|
1540
|
+
I > 0 && b,
|
|
1541
|
+
/* @__PURE__ */ t("span", { children: k })
|
|
1542
|
+
] }, I)),
|
|
1543
|
+
b
|
|
1538
1544
|
] }),
|
|
1539
|
-
/* @__PURE__ */ t("span", { children:
|
|
1545
|
+
/* @__PURE__ */ t("span", { children: h })
|
|
1540
1546
|
] }),
|
|
1541
1547
|
e.status === "completed" && n === "denied" && /* @__PURE__ */ r("div", { role: "alert", className: "mt-1 flex items-start gap-1.5 text-[12px] leading-4 text-foreground", children: [
|
|
1542
|
-
/* @__PURE__ */ t(
|
|
1543
|
-
/* @__PURE__ */ t("span", { children:
|
|
1548
|
+
/* @__PURE__ */ t(Dr, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
|
|
1549
|
+
/* @__PURE__ */ t("span", { children: z.linkExpired })
|
|
1544
1550
|
] }),
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1551
|
+
p && /* @__PURE__ */ r("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
|
|
1552
|
+
/* @__PURE__ */ t("span", { className: "tabular-nums", children: o.text }),
|
|
1553
|
+
o.detail && /* @__PURE__ */ r(j, { children: [
|
|
1548
1554
|
" ",
|
|
1549
|
-
|
|
1555
|
+
b,
|
|
1550
1556
|
" ",
|
|
1551
|
-
/* @__PURE__ */ t("span", { className: "tabular-nums", children:
|
|
1557
|
+
/* @__PURE__ */ t("span", { className: "tabular-nums", children: o.detail })
|
|
1552
1558
|
] }),
|
|
1553
|
-
|
|
1559
|
+
" ",
|
|
1560
|
+
b,
|
|
1561
|
+
" ",
|
|
1562
|
+
/* @__PURE__ */ t("span", { children: z.started(Nt(e.startedAt)) }),
|
|
1563
|
+
o.bar !== void 0 && o.bar !== null && /* @__PURE__ */ t(kr, { value: o.bar, className: "mt-1.5 h-1" }),
|
|
1564
|
+
c && /* @__PURE__ */ t("div", { className: "mt-1", children: z.longRunning })
|
|
1554
1565
|
] }),
|
|
1555
|
-
e.status === "
|
|
1566
|
+
e.status === "cancelled" && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
|
|
1567
|
+
/* @__PURE__ */ t("span", { children: z.cancelled }),
|
|
1568
|
+
b,
|
|
1569
|
+
/* @__PURE__ */ t("span", { children: h })
|
|
1570
|
+
] }),
|
|
1571
|
+
e.status === "failed" && /* @__PURE__ */ r(j, { children: [
|
|
1556
1572
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
|
|
1557
|
-
/* @__PURE__ */ t("span", { children:
|
|
1558
|
-
|
|
1559
|
-
/* @__PURE__ */ t("span", { children:
|
|
1573
|
+
/* @__PURE__ */ t("span", { children: z.failed }),
|
|
1574
|
+
b,
|
|
1575
|
+
/* @__PURE__ */ t("span", { children: h })
|
|
1560
1576
|
] }),
|
|
1561
|
-
/* @__PURE__ */ t("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: e.error ||
|
|
1577
|
+
/* @__PURE__ */ t("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: e.error || z.failedFallback })
|
|
1562
1578
|
] })
|
|
1563
1579
|
] })
|
|
1564
1580
|
] });
|
|
1565
1581
|
}
|
|
1566
|
-
function
|
|
1567
|
-
const { authToken: e, tokenProps: a } =
|
|
1568
|
-
(
|
|
1569
|
-
),
|
|
1570
|
-
(
|
|
1571
|
-
),
|
|
1572
|
-
const
|
|
1573
|
-
if (!(!
|
|
1574
|
-
|
|
1582
|
+
function qa() {
|
|
1583
|
+
const { authToken: e, tokenProps: a } = Ye(), i = me((y) => y.activeExports), { clearCompleted: n, removeExport: l, updateExport: s, applyServerStatus: u } = Vt(), [p, o] = E(!1), [c, d] = E(!1), m = Array.from(i.values()).sort(
|
|
1584
|
+
(y, S) => S.startedAt.getTime() - y.startedAt.getTime()
|
|
1585
|
+
), h = m.some(
|
|
1586
|
+
(y) => y.status === "completed" || y.status === "failed" || y.status === "cancelled"
|
|
1587
|
+
), f = H(async () => {
|
|
1588
|
+
const y = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
|
|
1589
|
+
if (!(!y || !S)) {
|
|
1590
|
+
o(!0);
|
|
1575
1591
|
try {
|
|
1576
|
-
const
|
|
1592
|
+
const D = Array.from(i.values());
|
|
1577
1593
|
await Promise.all(
|
|
1578
|
-
|
|
1594
|
+
D.map(async (w) => {
|
|
1579
1595
|
try {
|
|
1580
|
-
const
|
|
1581
|
-
let
|
|
1582
|
-
if (
|
|
1596
|
+
const C = await pe((g) => Ut(y, S, w.id, g));
|
|
1597
|
+
let F;
|
|
1598
|
+
if (C.status === "completed")
|
|
1583
1599
|
try {
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1600
|
+
F = await pe((g) => qe(
|
|
1601
|
+
y,
|
|
1602
|
+
S,
|
|
1603
|
+
w.id,
|
|
1604
|
+
g
|
|
1605
|
+
));
|
|
1606
|
+
} catch (g) {
|
|
1607
|
+
console.error(`Failed to get download URL for ${w.id}:`, g);
|
|
1591
1608
|
}
|
|
1592
|
-
|
|
1593
|
-
} catch (
|
|
1594
|
-
s(
|
|
1609
|
+
u(w.id, vt(C, F));
|
|
1610
|
+
} catch (C) {
|
|
1611
|
+
s(w.id, { downloadUrl: void 0 }), console.error(`Failed to refresh export ${w.id}:`, C);
|
|
1595
1612
|
}
|
|
1596
1613
|
})
|
|
1597
1614
|
);
|
|
1598
1615
|
} finally {
|
|
1599
|
-
|
|
1616
|
+
o(!1);
|
|
1600
1617
|
}
|
|
1601
1618
|
}
|
|
1602
1619
|
}, [
|
|
1603
|
-
|
|
1620
|
+
i,
|
|
1604
1621
|
e == null ? void 0 : e.accessToken,
|
|
1605
1622
|
a == null ? void 0 : a.apiServiceUrl,
|
|
1606
|
-
s
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1623
|
+
s,
|
|
1624
|
+
u
|
|
1625
|
+
]), b = H(async () => {
|
|
1626
|
+
const y = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
|
|
1627
|
+
if (!y || !S) {
|
|
1610
1628
|
n();
|
|
1611
1629
|
return;
|
|
1612
1630
|
}
|
|
1613
|
-
|
|
1631
|
+
d(!0);
|
|
1614
1632
|
try {
|
|
1615
|
-
const
|
|
1616
|
-
(
|
|
1617
|
-
),
|
|
1618
|
-
|
|
1633
|
+
const D = m.filter(
|
|
1634
|
+
(C) => C.status === "completed" || C.status === "failed" || C.status === "cancelled"
|
|
1635
|
+
), w = await Promise.allSettled(
|
|
1636
|
+
D.map(async (C) => (await Ct(y, S, C.id), C.id))
|
|
1619
1637
|
);
|
|
1620
|
-
for (const
|
|
1621
|
-
|
|
1638
|
+
for (const C of w)
|
|
1639
|
+
C.status === "fulfilled" ? l(C.value) : console.error("Failed to delete export:", C.reason);
|
|
1622
1640
|
} finally {
|
|
1623
|
-
|
|
1641
|
+
d(!1);
|
|
1624
1642
|
}
|
|
1625
1643
|
}, [
|
|
1626
|
-
|
|
1644
|
+
m,
|
|
1627
1645
|
a == null ? void 0 : a.apiServiceUrl,
|
|
1628
1646
|
e == null ? void 0 : e.accessToken,
|
|
1629
1647
|
n,
|
|
1630
|
-
|
|
1631
|
-
]),
|
|
1632
|
-
async (
|
|
1633
|
-
const
|
|
1634
|
-
if (
|
|
1648
|
+
l
|
|
1649
|
+
]), k = H(
|
|
1650
|
+
async (y) => {
|
|
1651
|
+
const S = a == null ? void 0 : a.apiServiceUrl, D = e == null ? void 0 : e.accessToken;
|
|
1652
|
+
if (S && D)
|
|
1635
1653
|
try {
|
|
1636
|
-
await
|
|
1654
|
+
await Ct(S, D, y), l(y);
|
|
1637
1655
|
return;
|
|
1638
|
-
} catch (
|
|
1639
|
-
console.error(`Failed to cancel export ${
|
|
1656
|
+
} catch (w) {
|
|
1657
|
+
console.error(`Failed to cancel export ${y}:`, w);
|
|
1640
1658
|
}
|
|
1641
|
-
|
|
1659
|
+
l(y);
|
|
1642
1660
|
},
|
|
1643
|
-
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken,
|
|
1644
|
-
),
|
|
1645
|
-
async (
|
|
1646
|
-
if (
|
|
1647
|
-
return window.open(
|
|
1648
|
-
const
|
|
1649
|
-
if (!
|
|
1661
|
+
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, l]
|
|
1662
|
+
), I = H(
|
|
1663
|
+
async (y) => {
|
|
1664
|
+
if (y.downloadUrl)
|
|
1665
|
+
return window.open(y.downloadUrl, "_blank"), "opened";
|
|
1666
|
+
const S = a == null ? void 0 : a.apiServiceUrl, D = e == null ? void 0 : e.accessToken;
|
|
1667
|
+
if (!S || !D) return "denied";
|
|
1650
1668
|
try {
|
|
1651
|
-
const
|
|
1652
|
-
return s(
|
|
1653
|
-
} catch (
|
|
1654
|
-
return console.error(`Failed to get download URL for ${
|
|
1669
|
+
const w = await pe((C) => qe(S, D, y.id, C));
|
|
1670
|
+
return s(y.id, { downloadUrl: w }), window.open(w, "_blank"), "opened";
|
|
1671
|
+
} catch (w) {
|
|
1672
|
+
return console.error(`Failed to get download URL for ${y.id}:`, w), s(y.id, { downloadUrl: void 0 }), "denied";
|
|
1655
1673
|
}
|
|
1656
1674
|
},
|
|
1657
1675
|
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, s]
|
|
1658
1676
|
);
|
|
1659
|
-
return
|
|
1660
|
-
/* @__PURE__ */ t("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ t(
|
|
1677
|
+
return m.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
|
|
1678
|
+
/* @__PURE__ */ t("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ t(Ca, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
|
|
1661
1679
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: "No exports yet" }),
|
|
1662
1680
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Large exports run in the background and land here." })
|
|
1663
1681
|
] }) : /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
1664
1682
|
/* @__PURE__ */ r("div", { className: "flex h-8 items-center gap-2 border-b border-border px-3", children: [
|
|
1665
1683
|
/* @__PURE__ */ t("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Exports" }),
|
|
1666
|
-
/* @__PURE__ */ t("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children:
|
|
1684
|
+
/* @__PURE__ */ t("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: m.length }),
|
|
1667
1685
|
/* @__PURE__ */ r("div", { className: "ml-auto flex items-center gap-0.5", children: [
|
|
1668
|
-
|
|
1669
|
-
|
|
1686
|
+
h && /* @__PURE__ */ t(
|
|
1687
|
+
R,
|
|
1670
1688
|
{
|
|
1671
1689
|
variant: "ghost",
|
|
1672
1690
|
size: "xs",
|
|
1673
1691
|
className: "h-6 px-1.5 text-[12px] text-muted-foreground hover:text-foreground",
|
|
1674
|
-
onClick:
|
|
1675
|
-
disabled:
|
|
1676
|
-
children:
|
|
1692
|
+
onClick: b,
|
|
1693
|
+
disabled: c,
|
|
1694
|
+
children: c ? "Clearing" : "Clear all"
|
|
1677
1695
|
}
|
|
1678
1696
|
),
|
|
1679
1697
|
/* @__PURE__ */ t(
|
|
1680
|
-
|
|
1698
|
+
R,
|
|
1681
1699
|
{
|
|
1682
1700
|
variant: "ghost",
|
|
1683
1701
|
size: "xs",
|
|
1684
1702
|
className: "h-6 w-6 px-0 text-muted-foreground hover:text-foreground",
|
|
1685
|
-
onClick:
|
|
1686
|
-
disabled:
|
|
1703
|
+
onClick: f,
|
|
1704
|
+
disabled: p,
|
|
1687
1705
|
title: "Refresh status",
|
|
1688
1706
|
"aria-label": "Refresh status",
|
|
1689
1707
|
children: /* @__PURE__ */ t(
|
|
1690
|
-
|
|
1708
|
+
Pt,
|
|
1691
1709
|
{
|
|
1692
1710
|
strokeWidth: 1.75,
|
|
1693
|
-
className: `h-3.5 w-3.5 ${
|
|
1711
|
+
className: `h-3.5 w-3.5 ${p ? "animate-spin" : ""}`
|
|
1694
1712
|
}
|
|
1695
1713
|
)
|
|
1696
1714
|
}
|
|
1697
1715
|
)
|
|
1698
1716
|
] })
|
|
1699
1717
|
] }),
|
|
1700
|
-
/* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y divide-border/70", children:
|
|
1701
|
-
|
|
1718
|
+
/* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y divide-border/70", children: m.map((y) => /* @__PURE__ */ t(
|
|
1719
|
+
Ha,
|
|
1702
1720
|
{
|
|
1703
|
-
export:
|
|
1704
|
-
onRemove:
|
|
1705
|
-
onDownload:
|
|
1721
|
+
export: y,
|
|
1722
|
+
onRemove: k,
|
|
1723
|
+
onDownload: I
|
|
1706
1724
|
},
|
|
1707
|
-
|
|
1725
|
+
y.id
|
|
1708
1726
|
)) }) })
|
|
1709
1727
|
] });
|
|
1710
1728
|
}
|
|
1711
|
-
function
|
|
1729
|
+
function Qn({
|
|
1712
1730
|
variant: e
|
|
1713
1731
|
}) {
|
|
1714
|
-
const a =
|
|
1715
|
-
(
|
|
1716
|
-
),
|
|
1717
|
-
return /* @__PURE__ */ r(
|
|
1718
|
-
/* @__PURE__ */ t(
|
|
1719
|
-
|
|
1732
|
+
const a = me((o) => o.activeExports), i = Er(), n = a.size > 0, l = Array.from(a.values()).some(
|
|
1733
|
+
(o) => o.status === "completed" || o.status === "failed"
|
|
1734
|
+
), u = i > 0 ? i > 9 ? "9+" : String(i) : null;
|
|
1735
|
+
return /* @__PURE__ */ r(ze, { children: [
|
|
1736
|
+
/* @__PURE__ */ t($e, { asChild: !0, children: /* @__PURE__ */ r(
|
|
1737
|
+
R,
|
|
1720
1738
|
{
|
|
1721
1739
|
variant: e ?? "ghost",
|
|
1722
1740
|
size: "xs",
|
|
1723
1741
|
className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
1724
1742
|
"aria-label": "Export notifications",
|
|
1725
1743
|
children: [
|
|
1726
|
-
/* @__PURE__ */ t(
|
|
1744
|
+
/* @__PURE__ */ t(Ar, { className: "h-3.5 w-3.5" }),
|
|
1727
1745
|
n && /* @__PURE__ */ t(
|
|
1728
1746
|
"span",
|
|
1729
1747
|
{
|
|
1730
|
-
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${
|
|
1731
|
-
children:
|
|
1748
|
+
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${u ? "-right-0.5 -top-0.5 h-3.5 min-w-3.5 px-0.5 text-[9px] font-semibold" : "right-1 top-1 h-1.5 w-1.5"}`,
|
|
1749
|
+
children: u
|
|
1732
1750
|
}
|
|
1733
1751
|
)
|
|
1734
1752
|
]
|
|
1735
1753
|
}
|
|
1736
1754
|
) }),
|
|
1737
|
-
/* @__PURE__ */ t(
|
|
1755
|
+
/* @__PURE__ */ t(je, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(qa, {}) })
|
|
1738
1756
|
] });
|
|
1739
1757
|
}
|
|
1740
|
-
function
|
|
1758
|
+
function Ga(e) {
|
|
1741
1759
|
if (e)
|
|
1742
1760
|
return {
|
|
1743
1761
|
renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
|
|
@@ -1746,24 +1764,24 @@ function za(e) {
|
|
|
1746
1764
|
affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
|
|
1747
1765
|
};
|
|
1748
1766
|
}
|
|
1749
|
-
function
|
|
1767
|
+
function Xa({
|
|
1750
1768
|
open: e,
|
|
1751
1769
|
onOpenChange: a,
|
|
1752
|
-
trigger:
|
|
1770
|
+
trigger: i,
|
|
1753
1771
|
showTrigger: n = !0,
|
|
1754
|
-
initialMode:
|
|
1772
|
+
initialMode: l = "manage"
|
|
1755
1773
|
}) {
|
|
1756
|
-
const s =
|
|
1757
|
-
forceClose:
|
|
1758
|
-
handleOpenChange:
|
|
1759
|
-
isCreateFlowActive:
|
|
1760
|
-
preventPassiveDismissDuringCreate:
|
|
1774
|
+
const s = l === "create", {
|
|
1775
|
+
forceClose: u,
|
|
1776
|
+
handleOpenChange: p,
|
|
1777
|
+
isCreateFlowActive: o,
|
|
1778
|
+
preventPassiveDismissDuringCreate: c,
|
|
1761
1779
|
resolvedOpen: d,
|
|
1762
|
-
setIsCreateFlowActive:
|
|
1763
|
-
} =
|
|
1780
|
+
setIsCreateFlowActive: m
|
|
1781
|
+
} = zt({
|
|
1764
1782
|
open: e,
|
|
1765
1783
|
onOpenChange: a,
|
|
1766
|
-
initialCreateFlowActive:
|
|
1784
|
+
initialCreateFlowActive: l === "create",
|
|
1767
1785
|
// Dialog mode renders a built-in X close button — allow explicit
|
|
1768
1786
|
// closes through `handleOpenChange`. Popover mode has no X; its
|
|
1769
1787
|
// only close-via-trigger path is a re-click that would silently
|
|
@@ -1771,120 +1789,120 @@ function $a({
|
|
|
1771
1789
|
// create and make consumers use `forceClose()` from a dedicated
|
|
1772
1790
|
// button.
|
|
1773
1791
|
dismissMode: n ? "passive" : "explicit-only"
|
|
1774
|
-
}), h =
|
|
1792
|
+
}), h = T((v) => v.dashboard), { setDashboardControlsModel: f } = ve(), { participants: b } = Ir(Yt(h)), k = Array.from(
|
|
1775
1793
|
new Map(
|
|
1776
|
-
|
|
1777
|
-
(
|
|
1778
|
-
var
|
|
1794
|
+
b.flatMap(
|
|
1795
|
+
(v) => v.fieldChoices.map((U) => {
|
|
1796
|
+
var A;
|
|
1779
1797
|
return [
|
|
1780
|
-
|
|
1798
|
+
U.value,
|
|
1781
1799
|
{
|
|
1782
|
-
option:
|
|
1783
|
-
target: (
|
|
1800
|
+
option: U,
|
|
1801
|
+
target: (A = v.fieldTargetMap) == null ? void 0 : A[U.value]
|
|
1784
1802
|
}
|
|
1785
1803
|
];
|
|
1786
1804
|
})
|
|
1787
1805
|
)
|
|
1788
1806
|
).values()
|
|
1789
|
-
),
|
|
1807
|
+
), I = Array.from(
|
|
1790
1808
|
new Map(
|
|
1791
|
-
|
|
1792
|
-
(
|
|
1793
|
-
var
|
|
1809
|
+
b.flatMap(
|
|
1810
|
+
(v) => v.metricChoices.map((U) => {
|
|
1811
|
+
var A;
|
|
1794
1812
|
return [
|
|
1795
|
-
|
|
1813
|
+
U.value,
|
|
1796
1814
|
{
|
|
1797
|
-
option:
|
|
1798
|
-
target: (
|
|
1815
|
+
option: U,
|
|
1816
|
+
target: (A = v.metricTargetMap) == null ? void 0 : A[U.value]
|
|
1799
1817
|
}
|
|
1800
1818
|
];
|
|
1801
1819
|
})
|
|
1802
1820
|
)
|
|
1803
1821
|
).values()
|
|
1804
|
-
),
|
|
1822
|
+
), y = Zt({
|
|
1805
1823
|
...h || {},
|
|
1806
1824
|
controls: []
|
|
1807
|
-
}), S =
|
|
1825
|
+
}), S = Lr(h), D = (v, U, A) => {
|
|
1808
1826
|
f(
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1827
|
+
v,
|
|
1828
|
+
U,
|
|
1829
|
+
Ga(A)
|
|
1812
1830
|
);
|
|
1813
|
-
}, w =
|
|
1831
|
+
}, w = H(() => {
|
|
1814
1832
|
if (s) {
|
|
1815
|
-
|
|
1833
|
+
u();
|
|
1816
1834
|
return;
|
|
1817
1835
|
}
|
|
1818
|
-
|
|
1819
|
-
}, [s,
|
|
1820
|
-
|
|
1836
|
+
m(!1);
|
|
1837
|
+
}, [s, u, m]), C = /* @__PURE__ */ t(
|
|
1838
|
+
$t,
|
|
1821
1839
|
{
|
|
1822
1840
|
scope: "dashboard",
|
|
1823
1841
|
controls: h.controls || [],
|
|
1824
|
-
reservedControlIds:
|
|
1842
|
+
reservedControlIds: y,
|
|
1825
1843
|
defaultValues: h.defaultControlValues || {},
|
|
1826
|
-
usageByControlId:
|
|
1844
|
+
usageByControlId: Fr(h),
|
|
1827
1845
|
availableFieldChoices: k,
|
|
1828
|
-
availableMetricChoices:
|
|
1829
|
-
structuralParticipants:
|
|
1846
|
+
availableMetricChoices: I,
|
|
1847
|
+
structuralParticipants: b,
|
|
1830
1848
|
structuralParticipantIdsByControlId: S,
|
|
1831
|
-
initialCreateFlow:
|
|
1832
|
-
onCreateFlowActiveChange:
|
|
1849
|
+
initialCreateFlow: l === "create",
|
|
1850
|
+
onCreateFlowActiveChange: m,
|
|
1833
1851
|
onCreateFlowComplete: w,
|
|
1834
|
-
onChange:
|
|
1852
|
+
onChange: D,
|
|
1835
1853
|
emptyMessage: "No dashboard controls yet."
|
|
1836
1854
|
}
|
|
1837
|
-
),
|
|
1855
|
+
), F = o ? "Add dashboard control" : "Dashboard Controls", g = /* @__PURE__ */ r(j, { children: [
|
|
1838
1856
|
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
1839
1857
|
/* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
1840
1858
|
/* @__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." })
|
|
1841
1859
|
] }),
|
|
1842
|
-
|
|
1860
|
+
C
|
|
1843
1861
|
] });
|
|
1844
|
-
return n ? /* @__PURE__ */ r(
|
|
1845
|
-
/* @__PURE__ */ t(
|
|
1846
|
-
/* @__PURE__ */ t(
|
|
1862
|
+
return n ? /* @__PURE__ */ r(ze, { open: d, onOpenChange: p, children: [
|
|
1863
|
+
/* @__PURE__ */ t($e, { asChild: !0, children: i || /* @__PURE__ */ r(R, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
1864
|
+
/* @__PURE__ */ t(It, { className: "mr-2 h-4 w-4" }),
|
|
1847
1865
|
"Controls"
|
|
1848
1866
|
] }) }),
|
|
1849
1867
|
/* @__PURE__ */ t(
|
|
1850
|
-
|
|
1868
|
+
je,
|
|
1851
1869
|
{
|
|
1852
1870
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
1853
1871
|
align: "end",
|
|
1854
|
-
onEscapeKeyDown:
|
|
1855
|
-
onPointerDownOutside:
|
|
1856
|
-
children:
|
|
1872
|
+
onEscapeKeyDown: c,
|
|
1873
|
+
onPointerDownOutside: c,
|
|
1874
|
+
children: g
|
|
1857
1875
|
}
|
|
1858
1876
|
)
|
|
1859
|
-
] }) : /* @__PURE__ */ t(
|
|
1860
|
-
|
|
1877
|
+
] }) : /* @__PURE__ */ t(Ee, { open: d, onOpenChange: p, children: /* @__PURE__ */ r(
|
|
1878
|
+
Ae,
|
|
1861
1879
|
{
|
|
1862
1880
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1863
|
-
onEscapeKeyDown:
|
|
1864
|
-
onPointerDownOutside:
|
|
1881
|
+
onEscapeKeyDown: c,
|
|
1882
|
+
onPointerDownOutside: c,
|
|
1865
1883
|
children: [
|
|
1866
1884
|
/* @__PURE__ */ r(
|
|
1867
|
-
|
|
1885
|
+
pt,
|
|
1868
1886
|
{
|
|
1869
|
-
className:
|
|
1887
|
+
className: o ? "space-y-0" : void 0,
|
|
1870
1888
|
children: [
|
|
1871
|
-
/* @__PURE__ */ t(
|
|
1889
|
+
/* @__PURE__ */ t(Ie, { className: "text-[15px]", children: F }),
|
|
1872
1890
|
/* @__PURE__ */ t(
|
|
1873
|
-
|
|
1891
|
+
ft,
|
|
1874
1892
|
{
|
|
1875
|
-
className:
|
|
1876
|
-
children:
|
|
1893
|
+
className: o ? "sr-only" : "text-[13px]",
|
|
1894
|
+
children: o ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
|
|
1877
1895
|
}
|
|
1878
1896
|
)
|
|
1879
1897
|
]
|
|
1880
1898
|
}
|
|
1881
1899
|
),
|
|
1882
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children:
|
|
1900
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: C })
|
|
1883
1901
|
]
|
|
1884
1902
|
}
|
|
1885
1903
|
) });
|
|
1886
1904
|
}
|
|
1887
|
-
const
|
|
1905
|
+
const Ka = [
|
|
1888
1906
|
"enum",
|
|
1889
1907
|
"multi_enum",
|
|
1890
1908
|
"text",
|
|
@@ -1892,104 +1910,104 @@ const ja = [
|
|
|
1892
1910
|
"boolean",
|
|
1893
1911
|
"date"
|
|
1894
1912
|
];
|
|
1895
|
-
function
|
|
1913
|
+
function Ya({
|
|
1896
1914
|
open: e,
|
|
1897
1915
|
onOpenChange: a,
|
|
1898
|
-
initialMode:
|
|
1916
|
+
initialMode: i = "manage"
|
|
1899
1917
|
}) {
|
|
1900
|
-
var
|
|
1901
|
-
const n =
|
|
1902
|
-
forceClose:
|
|
1918
|
+
var g;
|
|
1919
|
+
const n = i === "create", {
|
|
1920
|
+
forceClose: l,
|
|
1903
1921
|
handleOpenChange: s,
|
|
1904
|
-
isCreateFlowActive:
|
|
1905
|
-
preventPassiveDismissDuringCreate:
|
|
1906
|
-
resolvedOpen:
|
|
1907
|
-
setIsCreateFlowActive:
|
|
1908
|
-
} =
|
|
1922
|
+
isCreateFlowActive: u,
|
|
1923
|
+
preventPassiveDismissDuringCreate: p,
|
|
1924
|
+
resolvedOpen: o,
|
|
1925
|
+
setIsCreateFlowActive: c
|
|
1926
|
+
} = zt({
|
|
1909
1927
|
open: e,
|
|
1910
1928
|
onOpenChange: a,
|
|
1911
|
-
initialCreateFlowActive:
|
|
1929
|
+
initialCreateFlowActive: i === "create",
|
|
1912
1930
|
dismissMode: "explicit-only"
|
|
1913
|
-
}), d =
|
|
1914
|
-
(
|
|
1915
|
-
),
|
|
1916
|
-
() =>
|
|
1917
|
-
[d,
|
|
1918
|
-
),
|
|
1931
|
+
}), d = T((v) => v.dashboard), m = T((v) => v.selectedSheetId), { setDashboardInputs: h } = ve(), f = (g = d.sheets) == null ? void 0 : g.find(
|
|
1932
|
+
(v) => v.id === m
|
|
1933
|
+
), b = (f == null ? void 0 : f.kind) === "document" && !!f.document, k = Q(
|
|
1934
|
+
() => b && (f != null && f.document) ? Tr(d, f.id) : [],
|
|
1935
|
+
[d, b, f == null ? void 0 : f.document, f == null ? void 0 : f.id]
|
|
1936
|
+
), I = Q(
|
|
1919
1937
|
() => k.filter(
|
|
1920
|
-
(
|
|
1938
|
+
(v) => v.kind === "control"
|
|
1921
1939
|
),
|
|
1922
1940
|
[k]
|
|
1923
|
-
),
|
|
1924
|
-
() =>
|
|
1925
|
-
[
|
|
1926
|
-
), S =
|
|
1927
|
-
() =>
|
|
1928
|
-
[
|
|
1929
|
-
),
|
|
1930
|
-
() =>
|
|
1941
|
+
), y = Q(
|
|
1942
|
+
() => I.map((v) => v.control),
|
|
1943
|
+
[I]
|
|
1944
|
+
), S = Q(
|
|
1945
|
+
() => Qa(y),
|
|
1946
|
+
[y]
|
|
1947
|
+
), D = Q(
|
|
1948
|
+
() => Za(d),
|
|
1931
1949
|
[d]
|
|
1932
|
-
), w =
|
|
1950
|
+
), w = H(() => {
|
|
1933
1951
|
if (n) {
|
|
1934
|
-
|
|
1952
|
+
l();
|
|
1935
1953
|
return;
|
|
1936
1954
|
}
|
|
1937
|
-
|
|
1938
|
-
}, [n,
|
|
1939
|
-
(
|
|
1940
|
-
!
|
|
1941
|
-
|
|
1955
|
+
c(!1);
|
|
1956
|
+
}, [n, l, c]), C = H(
|
|
1957
|
+
(v, U, A) => {
|
|
1958
|
+
!b || !(f != null && f.document) || h(
|
|
1959
|
+
en({
|
|
1942
1960
|
allInputs: d.inputs || [],
|
|
1943
1961
|
documentSheetId: f.id,
|
|
1944
1962
|
currentDocumentInputs: k,
|
|
1945
|
-
nextControls:
|
|
1946
|
-
nextDefaultValues:
|
|
1947
|
-
change:
|
|
1963
|
+
nextControls: v,
|
|
1964
|
+
nextDefaultValues: U,
|
|
1965
|
+
change: A
|
|
1948
1966
|
})
|
|
1949
1967
|
);
|
|
1950
1968
|
},
|
|
1951
1969
|
[
|
|
1952
1970
|
d.inputs,
|
|
1953
1971
|
k,
|
|
1954
|
-
|
|
1972
|
+
b,
|
|
1955
1973
|
f,
|
|
1956
1974
|
h
|
|
1957
1975
|
]
|
|
1958
1976
|
);
|
|
1959
|
-
return !
|
|
1960
|
-
|
|
1977
|
+
return !b || !(f != null && f.document) ? null : /* @__PURE__ */ t(Ee, { open: o, onOpenChange: s, children: /* @__PURE__ */ r(
|
|
1978
|
+
Ae,
|
|
1961
1979
|
{
|
|
1962
1980
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1963
|
-
onEscapeKeyDown:
|
|
1964
|
-
onPointerDownOutside:
|
|
1981
|
+
onEscapeKeyDown: p,
|
|
1982
|
+
onPointerDownOutside: p,
|
|
1965
1983
|
children: [
|
|
1966
|
-
/* @__PURE__ */ r(
|
|
1967
|
-
/* @__PURE__ */ t(
|
|
1984
|
+
/* @__PURE__ */ r(pt, { className: u ? "space-y-0" : void 0, children: [
|
|
1985
|
+
/* @__PURE__ */ t(Ie, { className: "text-[15px]", children: u ? "Add document control" : "Document Controls" }),
|
|
1968
1986
|
/* @__PURE__ */ t(
|
|
1969
|
-
|
|
1987
|
+
ft,
|
|
1970
1988
|
{
|
|
1971
|
-
className:
|
|
1972
|
-
children:
|
|
1989
|
+
className: u ? "sr-only" : "text-[13px]",
|
|
1990
|
+
children: u ? "Configure and add a document-local control input." : "Add document-local control inputs. They are stored on this document sheet and are not dashboard controls."
|
|
1973
1991
|
}
|
|
1974
1992
|
)
|
|
1975
1993
|
] }),
|
|
1976
1994
|
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ t(
|
|
1977
|
-
|
|
1995
|
+
$t,
|
|
1978
1996
|
{
|
|
1979
1997
|
scope: "dashboard",
|
|
1980
|
-
controls:
|
|
1981
|
-
reservedControlIds:
|
|
1998
|
+
controls: y,
|
|
1999
|
+
reservedControlIds: D,
|
|
1982
2000
|
defaultValues: S,
|
|
1983
2001
|
usageByControlId: {},
|
|
1984
2002
|
availableFieldChoices: [],
|
|
1985
2003
|
availableMetricChoices: [],
|
|
1986
2004
|
structuralParticipants: [],
|
|
1987
2005
|
structuralParticipantIdsByControlId: {},
|
|
1988
|
-
allowedControlTypes:
|
|
1989
|
-
initialCreateFlow:
|
|
1990
|
-
onCreateFlowActiveChange:
|
|
2006
|
+
allowedControlTypes: Ka,
|
|
2007
|
+
initialCreateFlow: i === "create",
|
|
2008
|
+
onCreateFlowActiveChange: c,
|
|
1991
2009
|
onCreateFlowComplete: w,
|
|
1992
|
-
onChange:
|
|
2010
|
+
onChange: C,
|
|
1993
2011
|
emptyMessage: "No document controls yet."
|
|
1994
2012
|
}
|
|
1995
2013
|
) })
|
|
@@ -1997,90 +2015,90 @@ function Wa({
|
|
|
1997
2015
|
}
|
|
1998
2016
|
) });
|
|
1999
2017
|
}
|
|
2000
|
-
function
|
|
2018
|
+
function Za(e) {
|
|
2001
2019
|
return (e.controls || []).map((a) => a.id);
|
|
2002
2020
|
}
|
|
2003
|
-
function
|
|
2021
|
+
function Qa(e) {
|
|
2004
2022
|
const a = {};
|
|
2005
|
-
for (const
|
|
2006
|
-
|
|
2023
|
+
for (const i of e)
|
|
2024
|
+
i.defaultValue !== void 0 && (a[i.id] = i.defaultValue);
|
|
2007
2025
|
return a;
|
|
2008
2026
|
}
|
|
2009
|
-
function
|
|
2027
|
+
function Ja(e, a) {
|
|
2010
2028
|
return a ? Object.prototype.hasOwnProperty.call(a, e.id) ? {
|
|
2011
2029
|
...e,
|
|
2012
2030
|
defaultValue: a[e.id]
|
|
2013
2031
|
} : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 };
|
|
2014
2032
|
}
|
|
2015
|
-
function
|
|
2033
|
+
function en({
|
|
2016
2034
|
allInputs: e,
|
|
2017
2035
|
documentSheetId: a,
|
|
2018
|
-
currentDocumentInputs:
|
|
2036
|
+
currentDocumentInputs: i,
|
|
2019
2037
|
nextControls: n,
|
|
2020
|
-
nextDefaultValues:
|
|
2038
|
+
nextDefaultValues: l,
|
|
2021
2039
|
change: s
|
|
2022
2040
|
}) {
|
|
2023
|
-
const
|
|
2041
|
+
const u = new Map(
|
|
2024
2042
|
n.map((h) => [
|
|
2025
2043
|
h.id,
|
|
2026
|
-
|
|
2044
|
+
Ja(h, l)
|
|
2027
2045
|
])
|
|
2028
|
-
),
|
|
2029
|
-
for (const h of
|
|
2046
|
+
), p = (s == null ? void 0 : s.type) === "rename" ? { oldId: s.oldId, newId: s.newId } : null, o = /* @__PURE__ */ new Set(), c = [];
|
|
2047
|
+
for (const h of i) {
|
|
2030
2048
|
if (h.kind !== "control") {
|
|
2031
|
-
|
|
2049
|
+
c.push(h);
|
|
2032
2050
|
continue;
|
|
2033
2051
|
}
|
|
2034
|
-
const f =
|
|
2052
|
+
const f = u.get(h.control.id) || ((p == null ? void 0 : p.oldId) === h.control.id ? u.get(p.newId) : void 0);
|
|
2035
2053
|
if (!f)
|
|
2036
2054
|
continue;
|
|
2037
|
-
|
|
2038
|
-
const
|
|
2055
|
+
o.add(f.id);
|
|
2056
|
+
const b = Qt(
|
|
2039
2057
|
f.id,
|
|
2040
|
-
[...e, ...
|
|
2041
|
-
(
|
|
2058
|
+
[...e, ...c].filter(
|
|
2059
|
+
(I) => I.id !== h.id
|
|
2042
2060
|
)
|
|
2043
|
-
), k = f.id ===
|
|
2044
|
-
|
|
2061
|
+
), k = f.id === b ? f : { ...f, id: b };
|
|
2062
|
+
c.push({
|
|
2045
2063
|
...h,
|
|
2046
2064
|
label: k.label,
|
|
2047
|
-
variableName:
|
|
2065
|
+
variableName: b,
|
|
2048
2066
|
requiredAtExecution: k.requiredAtExecution,
|
|
2049
2067
|
control: k
|
|
2050
2068
|
});
|
|
2051
2069
|
}
|
|
2052
|
-
for (const h of
|
|
2053
|
-
|
|
2054
|
-
|
|
2070
|
+
for (const h of u.values())
|
|
2071
|
+
o.has(h.id) || c.push(
|
|
2072
|
+
Br({
|
|
2055
2073
|
control: h,
|
|
2056
|
-
existingInputs: [...e, ...
|
|
2074
|
+
existingInputs: [...e, ...c],
|
|
2057
2075
|
sheetId: a
|
|
2058
2076
|
})
|
|
2059
2077
|
);
|
|
2060
2078
|
const d = new Set(
|
|
2061
|
-
|
|
2079
|
+
i.map((h) => h.id)
|
|
2062
2080
|
);
|
|
2063
2081
|
return [...e.filter(
|
|
2064
2082
|
(h) => !d.has(h.id)
|
|
2065
|
-
), ...
|
|
2083
|
+
), ...c];
|
|
2066
2084
|
}
|
|
2067
|
-
function
|
|
2085
|
+
function tn({
|
|
2068
2086
|
showFilters: e,
|
|
2069
2087
|
onShowFiltersChange: a,
|
|
2070
|
-
pickerContent:
|
|
2088
|
+
pickerContent: i,
|
|
2071
2089
|
settingsContent: n,
|
|
2072
|
-
size:
|
|
2090
|
+
size: l = "default",
|
|
2073
2091
|
className: s,
|
|
2074
|
-
primaryButtonClassName:
|
|
2075
|
-
secondaryButtonClassName:
|
|
2076
|
-
pickerContentClassName:
|
|
2077
|
-
settingsContentClassName:
|
|
2092
|
+
primaryButtonClassName: u,
|
|
2093
|
+
secondaryButtonClassName: p,
|
|
2094
|
+
pickerContentClassName: o,
|
|
2095
|
+
settingsContentClassName: c
|
|
2078
2096
|
}) {
|
|
2079
|
-
const d =
|
|
2097
|
+
const d = l === "toolbar", [m, h] = E(!1), f = st("interactive");
|
|
2080
2098
|
return /* @__PURE__ */ r(
|
|
2081
2099
|
"div",
|
|
2082
2100
|
{
|
|
2083
|
-
className:
|
|
2101
|
+
className: X(
|
|
2084
2102
|
// Height lives on the shell so the outer border is part of the
|
|
2085
2103
|
// h-7 box (matches regular `size="xs"` buttons). Inner triggers
|
|
2086
2104
|
// stretch to fill via `h-full`.
|
|
@@ -2089,58 +2107,58 @@ function Ya({
|
|
|
2089
2107
|
s
|
|
2090
2108
|
),
|
|
2091
2109
|
children: [
|
|
2092
|
-
/* @__PURE__ */ r(
|
|
2093
|
-
/* @__PURE__ */ t(
|
|
2094
|
-
|
|
2110
|
+
/* @__PURE__ */ r(ze, { open: e, onOpenChange: a, children: [
|
|
2111
|
+
/* @__PURE__ */ t($e, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2112
|
+
R,
|
|
2095
2113
|
{
|
|
2096
2114
|
variant: "ghost",
|
|
2097
2115
|
size: "xs",
|
|
2098
|
-
className:
|
|
2116
|
+
className: X(
|
|
2099
2117
|
"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",
|
|
2100
|
-
|
|
2118
|
+
u
|
|
2101
2119
|
),
|
|
2102
2120
|
children: [
|
|
2103
|
-
e ? /* @__PURE__ */ t(
|
|
2121
|
+
e ? /* @__PURE__ */ t(ma, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5" }),
|
|
2104
2122
|
"Filter"
|
|
2105
2123
|
]
|
|
2106
2124
|
}
|
|
2107
2125
|
) }),
|
|
2108
2126
|
/* @__PURE__ */ t(
|
|
2109
|
-
|
|
2127
|
+
je,
|
|
2110
2128
|
{
|
|
2111
2129
|
align: "end",
|
|
2112
2130
|
sideOffset: 6,
|
|
2113
|
-
className:
|
|
2131
|
+
className: X(
|
|
2114
2132
|
"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)]",
|
|
2115
|
-
|
|
2133
|
+
o
|
|
2116
2134
|
),
|
|
2117
2135
|
style: f.contentStyle,
|
|
2118
|
-
children:
|
|
2136
|
+
children: i
|
|
2119
2137
|
}
|
|
2120
2138
|
)
|
|
2121
2139
|
] }),
|
|
2122
|
-
/* @__PURE__ */ r(
|
|
2123
|
-
/* @__PURE__ */ t(
|
|
2124
|
-
|
|
2140
|
+
/* @__PURE__ */ r(ze, { open: m, onOpenChange: h, children: [
|
|
2141
|
+
/* @__PURE__ */ t($e, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2142
|
+
R,
|
|
2125
2143
|
{
|
|
2126
2144
|
variant: "ghost",
|
|
2127
2145
|
size: "xs",
|
|
2128
|
-
className:
|
|
2146
|
+
className: X(
|
|
2129
2147
|
"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",
|
|
2130
|
-
|
|
2148
|
+
p
|
|
2131
2149
|
),
|
|
2132
2150
|
"aria-label": "Filter and control actions",
|
|
2133
|
-
children: /* @__PURE__ */ t(
|
|
2151
|
+
children: /* @__PURE__ */ t(Ot, { className: "h-3.5 w-3.5" })
|
|
2134
2152
|
}
|
|
2135
2153
|
) }),
|
|
2136
2154
|
/* @__PURE__ */ t(
|
|
2137
|
-
|
|
2155
|
+
je,
|
|
2138
2156
|
{
|
|
2139
2157
|
align: "end",
|
|
2140
2158
|
sideOffset: 6,
|
|
2141
|
-
className:
|
|
2159
|
+
className: X(
|
|
2142
2160
|
"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)]",
|
|
2143
|
-
|
|
2161
|
+
c
|
|
2144
2162
|
),
|
|
2145
2163
|
style: f.contentStyle,
|
|
2146
2164
|
children: n(() => h(!1))
|
|
@@ -2151,41 +2169,41 @@ function Ya({
|
|
|
2151
2169
|
}
|
|
2152
2170
|
);
|
|
2153
2171
|
}
|
|
2154
|
-
function
|
|
2155
|
-
|
|
2156
|
-
const e =
|
|
2172
|
+
function rn() {
|
|
2173
|
+
pa();
|
|
2174
|
+
const e = T((o) => o.selectedSheetId), a = T((o) => o.selectedFrameId), i = T((o) => o.dashboard), n = T((o) => o.actions.getSelectedFrame), { setSelectedFrameId: l } = ve(), { setCard: s } = At(), u = fe((o) => o.card.dataSource);
|
|
2157
2175
|
return Y(() => {
|
|
2158
|
-
var
|
|
2159
|
-
let
|
|
2160
|
-
if (!
|
|
2161
|
-
const
|
|
2162
|
-
h && (
|
|
2176
|
+
var c, d;
|
|
2177
|
+
let o = n();
|
|
2178
|
+
if (!o) {
|
|
2179
|
+
const m = (c = i == null ? void 0 : i.sheets) == null ? void 0 : c.find((f) => f.id === e), h = (d = m == null ? void 0 : m.frames) == null ? void 0 : d[0];
|
|
2180
|
+
h && (l(h.id), o = h);
|
|
2163
2181
|
}
|
|
2164
|
-
if (
|
|
2165
|
-
const
|
|
2166
|
-
|
|
2182
|
+
if (o) {
|
|
2183
|
+
const m = o.cards.find((h) => h.id === o.activeCardId);
|
|
2184
|
+
m && s(m);
|
|
2167
2185
|
}
|
|
2168
|
-
}, [n, e, a,
|
|
2169
|
-
hasEntities: !!(
|
|
2186
|
+
}, [n, e, a, i, l, s]), {
|
|
2187
|
+
hasEntities: !!(u != null && u.selectedEntities && u.selectedEntities.length > 0)
|
|
2170
2188
|
};
|
|
2171
2189
|
}
|
|
2172
|
-
function
|
|
2173
|
-
const e =
|
|
2174
|
-
(
|
|
2175
|
-
),
|
|
2176
|
-
() =>
|
|
2190
|
+
function an() {
|
|
2191
|
+
const e = T((o) => o.dashboard), a = T(
|
|
2192
|
+
(o) => o.semanticExecutionPayload
|
|
2193
|
+
), i = T((o) => o.actions.addFilter), { hasEntities: n } = rn(), { isLoading: l } = Rr(), s = Q(
|
|
2194
|
+
() => Jt(e, a),
|
|
2177
2195
|
[e, a]
|
|
2178
|
-
),
|
|
2196
|
+
), p = !er(e.filters) && s.hasEligibleCards && !l;
|
|
2179
2197
|
return /* @__PURE__ */ r("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
|
|
2180
|
-
|
|
2198
|
+
p && /* @__PURE__ */ t("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
|
|
2181
2199
|
"button",
|
|
2182
2200
|
{
|
|
2183
2201
|
type: "button",
|
|
2184
|
-
onClick: () =>
|
|
2202
|
+
onClick: () => i(tr()),
|
|
2185
2203
|
title: `Applies to ${s.eligibleCardCount} of ${s.totalCardCount} date-aware cards`,
|
|
2186
2204
|
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",
|
|
2187
2205
|
children: [
|
|
2188
|
-
/* @__PURE__ */ t(
|
|
2206
|
+
/* @__PURE__ */ t(ya, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
2189
2207
|
/* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col", children: [
|
|
2190
2208
|
/* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
|
|
2191
2209
|
/* @__PURE__ */ t("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
|
|
@@ -2194,31 +2212,31 @@ function Xa() {
|
|
|
2194
2212
|
}
|
|
2195
2213
|
) }),
|
|
2196
2214
|
!n && /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
|
|
2197
|
-
/* @__PURE__ */ t(
|
|
2215
|
+
/* @__PURE__ */ t(Ur, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
|
|
2198
2216
|
/* @__PURE__ */ t("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
|
|
2199
2217
|
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
|
|
2200
2218
|
] }),
|
|
2201
|
-
n && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(
|
|
2219
|
+
n && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(Vr, { context: "filter" }) })
|
|
2202
2220
|
] });
|
|
2203
2221
|
}
|
|
2204
|
-
const
|
|
2205
|
-
function
|
|
2222
|
+
const St = !1;
|
|
2223
|
+
function nn({
|
|
2206
2224
|
onAddFilter: e,
|
|
2207
2225
|
onAddControl: a,
|
|
2208
|
-
onManageControls:
|
|
2226
|
+
onManageControls: i,
|
|
2209
2227
|
onDismiss: n
|
|
2210
2228
|
}) {
|
|
2211
|
-
const
|
|
2212
|
-
(
|
|
2213
|
-
), { setFilterLayout: s } =
|
|
2214
|
-
|
|
2215
|
-
const
|
|
2216
|
-
return
|
|
2229
|
+
const l = T(
|
|
2230
|
+
(p) => p.dashboard.filterLayout
|
|
2231
|
+
), { setFilterLayout: s } = ve();
|
|
2232
|
+
l != null && l.displayMode;
|
|
2233
|
+
const u = (l == null ? void 0 : l.toolbarWrap) ?? !1;
|
|
2234
|
+
return l == null || l.showDownloadButton, /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
|
|
2217
2235
|
/* @__PURE__ */ r("div", { className: "p-1", children: [
|
|
2218
2236
|
/* @__PURE__ */ t(
|
|
2219
|
-
|
|
2237
|
+
rt,
|
|
2220
2238
|
{
|
|
2221
|
-
icon:
|
|
2239
|
+
icon: _t,
|
|
2222
2240
|
label: "Add filter",
|
|
2223
2241
|
onClick: () => {
|
|
2224
2242
|
e(), n();
|
|
@@ -2226,9 +2244,9 @@ function Za({
|
|
|
2226
2244
|
}
|
|
2227
2245
|
),
|
|
2228
2246
|
/* @__PURE__ */ t(
|
|
2229
|
-
|
|
2247
|
+
rt,
|
|
2230
2248
|
{
|
|
2231
|
-
icon:
|
|
2249
|
+
icon: It,
|
|
2232
2250
|
label: "Add control",
|
|
2233
2251
|
onClick: () => {
|
|
2234
2252
|
a(), n();
|
|
@@ -2236,12 +2254,12 @@ function Za({
|
|
|
2236
2254
|
}
|
|
2237
2255
|
),
|
|
2238
2256
|
/* @__PURE__ */ t(
|
|
2239
|
-
|
|
2257
|
+
rt,
|
|
2240
2258
|
{
|
|
2241
|
-
icon:
|
|
2259
|
+
icon: Mt,
|
|
2242
2260
|
label: "Manage controls",
|
|
2243
2261
|
onClick: () => {
|
|
2244
|
-
|
|
2262
|
+
i(), n();
|
|
2245
2263
|
}
|
|
2246
2264
|
}
|
|
2247
2265
|
)
|
|
@@ -2249,30 +2267,30 @@ function Za({
|
|
|
2249
2267
|
/* @__PURE__ */ t("div", { className: "border-t border-border/60" }),
|
|
2250
2268
|
/* @__PURE__ */ r("div", { className: "space-y-1 p-2", children: [
|
|
2251
2269
|
/* @__PURE__ */ t("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
|
|
2252
|
-
|
|
2270
|
+
St,
|
|
2253
2271
|
/* @__PURE__ */ t(
|
|
2254
|
-
|
|
2272
|
+
sn,
|
|
2255
2273
|
{
|
|
2256
2274
|
id: "filter-display-wrap",
|
|
2257
2275
|
label: "Wrap to multiple lines",
|
|
2258
|
-
checked:
|
|
2259
|
-
onCheckedChange: (
|
|
2276
|
+
checked: u,
|
|
2277
|
+
onCheckedChange: (p) => s({ toolbarWrap: p === !0 })
|
|
2260
2278
|
}
|
|
2261
2279
|
),
|
|
2262
|
-
|
|
2280
|
+
St
|
|
2263
2281
|
] })
|
|
2264
2282
|
] });
|
|
2265
2283
|
}
|
|
2266
|
-
function
|
|
2284
|
+
function rt({
|
|
2267
2285
|
icon: e,
|
|
2268
2286
|
label: a,
|
|
2269
|
-
onClick:
|
|
2287
|
+
onClick: i
|
|
2270
2288
|
}) {
|
|
2271
2289
|
return /* @__PURE__ */ r(
|
|
2272
2290
|
"button",
|
|
2273
2291
|
{
|
|
2274
2292
|
type: "button",
|
|
2275
|
-
onClick:
|
|
2293
|
+
onClick: i,
|
|
2276
2294
|
className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[13px] text-foreground outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40",
|
|
2277
2295
|
children: [
|
|
2278
2296
|
/* @__PURE__ */ t(e, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
@@ -2281,16 +2299,16 @@ function Je({
|
|
|
2281
2299
|
}
|
|
2282
2300
|
);
|
|
2283
2301
|
}
|
|
2284
|
-
function
|
|
2302
|
+
function sn({
|
|
2285
2303
|
id: e,
|
|
2286
2304
|
label: a,
|
|
2287
|
-
checked:
|
|
2305
|
+
checked: i,
|
|
2288
2306
|
onCheckedChange: n
|
|
2289
2307
|
}) {
|
|
2290
2308
|
return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-control px-1 py-1 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
2291
|
-
/* @__PURE__ */ t(
|
|
2309
|
+
/* @__PURE__ */ t(mt, { id: e, checked: i, onCheckedChange: n }),
|
|
2292
2310
|
/* @__PURE__ */ t(
|
|
2293
|
-
|
|
2311
|
+
ke,
|
|
2294
2312
|
{
|
|
2295
2313
|
htmlFor: e,
|
|
2296
2314
|
className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
|
|
@@ -2299,155 +2317,155 @@ function Ja({
|
|
|
2299
2317
|
)
|
|
2300
2318
|
] });
|
|
2301
2319
|
}
|
|
2302
|
-
function
|
|
2320
|
+
function Jn({
|
|
2303
2321
|
size: e,
|
|
2304
2322
|
className: a,
|
|
2305
|
-
primaryButtonClassName:
|
|
2323
|
+
primaryButtonClassName: i,
|
|
2306
2324
|
secondaryButtonClassName: n,
|
|
2307
|
-
pickerContentClassName:
|
|
2325
|
+
pickerContentClassName: l,
|
|
2308
2326
|
settingsContentClassName: s
|
|
2309
2327
|
}) {
|
|
2310
|
-
var
|
|
2311
|
-
const [
|
|
2312
|
-
(
|
|
2313
|
-
),
|
|
2328
|
+
var F;
|
|
2329
|
+
const [u, p] = E(null), o = T((g) => g.dashboard), c = T((g) => g.selectedSheetId), d = T((g) => g.showFilters), m = Pr((g) => g.setPanelOpen), h = T((g) => g.actions), { setDocumentPanelTarget: f, setShowFilters: b } = h, k = (F = o.sheets) == null ? void 0 : F.find(
|
|
2330
|
+
(g) => g.id === c
|
|
2331
|
+
), I = rr(k), y = H((g) => {
|
|
2314
2332
|
window.setTimeout(() => {
|
|
2315
|
-
|
|
2333
|
+
p(g);
|
|
2316
2334
|
}, 0);
|
|
2317
|
-
}, []), S =
|
|
2318
|
-
(
|
|
2319
|
-
if (
|
|
2320
|
-
|
|
2335
|
+
}, []), S = H(
|
|
2336
|
+
(g) => {
|
|
2337
|
+
if (I && c) {
|
|
2338
|
+
g && f(c, {
|
|
2321
2339
|
kind: "document",
|
|
2322
2340
|
group: "inputs"
|
|
2323
2341
|
});
|
|
2324
2342
|
return;
|
|
2325
2343
|
}
|
|
2326
|
-
|
|
2344
|
+
g && m("dashboard", !1), b(g);
|
|
2327
2345
|
},
|
|
2328
2346
|
[
|
|
2329
|
-
|
|
2330
|
-
|
|
2347
|
+
I,
|
|
2348
|
+
c,
|
|
2331
2349
|
f,
|
|
2332
|
-
|
|
2333
|
-
|
|
2350
|
+
m,
|
|
2351
|
+
b
|
|
2334
2352
|
]
|
|
2335
|
-
),
|
|
2353
|
+
), D = H(() => {
|
|
2336
2354
|
S(!0);
|
|
2337
|
-
}, [S]), w =
|
|
2338
|
-
|
|
2339
|
-
}, [
|
|
2340
|
-
|
|
2341
|
-
}, [
|
|
2342
|
-
return /* @__PURE__ */ r(
|
|
2355
|
+
}, [S]), w = H(() => {
|
|
2356
|
+
y("create");
|
|
2357
|
+
}, [y]), C = H(() => {
|
|
2358
|
+
y("manage");
|
|
2359
|
+
}, [y]);
|
|
2360
|
+
return /* @__PURE__ */ r(j, { children: [
|
|
2343
2361
|
/* @__PURE__ */ t(
|
|
2344
|
-
|
|
2362
|
+
tn,
|
|
2345
2363
|
{
|
|
2346
|
-
showFilters:
|
|
2364
|
+
showFilters: I ? !1 : d,
|
|
2347
2365
|
onShowFiltersChange: S,
|
|
2348
|
-
pickerContent: /* @__PURE__ */ t(
|
|
2349
|
-
settingsContent: (
|
|
2350
|
-
|
|
2366
|
+
pickerContent: /* @__PURE__ */ t(an, {}),
|
|
2367
|
+
settingsContent: (g) => /* @__PURE__ */ t(
|
|
2368
|
+
nn,
|
|
2351
2369
|
{
|
|
2352
|
-
onAddFilter:
|
|
2370
|
+
onAddFilter: D,
|
|
2353
2371
|
onAddControl: w,
|
|
2354
|
-
onManageControls:
|
|
2355
|
-
onDismiss:
|
|
2372
|
+
onManageControls: C,
|
|
2373
|
+
onDismiss: g
|
|
2356
2374
|
}
|
|
2357
2375
|
),
|
|
2358
2376
|
size: e,
|
|
2359
2377
|
className: a,
|
|
2360
|
-
primaryButtonClassName:
|
|
2378
|
+
primaryButtonClassName: i,
|
|
2361
2379
|
secondaryButtonClassName: n,
|
|
2362
|
-
pickerContentClassName:
|
|
2380
|
+
pickerContentClassName: l,
|
|
2363
2381
|
settingsContentClassName: s
|
|
2364
2382
|
}
|
|
2365
2383
|
),
|
|
2366
|
-
|
|
2367
|
-
|
|
2384
|
+
u ? I ? /* @__PURE__ */ t(
|
|
2385
|
+
Ya,
|
|
2368
2386
|
{
|
|
2369
2387
|
open: !0,
|
|
2370
|
-
onOpenChange: (
|
|
2371
|
-
|
|
2388
|
+
onOpenChange: (g) => {
|
|
2389
|
+
g || p(null);
|
|
2372
2390
|
},
|
|
2373
|
-
initialMode:
|
|
2391
|
+
initialMode: u
|
|
2374
2392
|
}
|
|
2375
2393
|
) : /* @__PURE__ */ t(
|
|
2376
|
-
|
|
2394
|
+
Xa,
|
|
2377
2395
|
{
|
|
2378
2396
|
open: !0,
|
|
2379
|
-
onOpenChange: (
|
|
2380
|
-
|
|
2397
|
+
onOpenChange: (g) => {
|
|
2398
|
+
g || p(null);
|
|
2381
2399
|
},
|
|
2382
2400
|
showTrigger: !1,
|
|
2383
|
-
initialMode:
|
|
2401
|
+
initialMode: u
|
|
2384
2402
|
}
|
|
2385
2403
|
) : null
|
|
2386
2404
|
] });
|
|
2387
2405
|
}
|
|
2388
|
-
function
|
|
2406
|
+
function on({
|
|
2389
2407
|
disabled: e,
|
|
2390
2408
|
briefingCount: a,
|
|
2391
|
-
className:
|
|
2409
|
+
className: i,
|
|
2392
2410
|
onClick: n
|
|
2393
2411
|
}) {
|
|
2394
|
-
const
|
|
2412
|
+
const l = typeof a == "number" && a > 0;
|
|
2395
2413
|
return /* @__PURE__ */ r(
|
|
2396
|
-
|
|
2414
|
+
R,
|
|
2397
2415
|
{
|
|
2398
2416
|
type: "button",
|
|
2399
2417
|
size: "xs",
|
|
2400
2418
|
variant: "outline",
|
|
2401
2419
|
disabled: e,
|
|
2402
|
-
className:
|
|
2420
|
+
className: X("gap-1.5", i),
|
|
2403
2421
|
onClick: n,
|
|
2404
2422
|
"aria-label": "Reports & briefings",
|
|
2405
2423
|
children: [
|
|
2406
|
-
/* @__PURE__ */ t(
|
|
2424
|
+
/* @__PURE__ */ t(Na, { className: "h-3.5 w-3.5" }),
|
|
2407
2425
|
"Reports & briefings",
|
|
2408
|
-
|
|
2426
|
+
l ? /* @__PURE__ */ t("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
|
|
2409
2427
|
]
|
|
2410
2428
|
}
|
|
2411
2429
|
);
|
|
2412
2430
|
}
|
|
2413
|
-
const
|
|
2414
|
-
function
|
|
2431
|
+
const ln = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Ht = "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", Oe = "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";
|
|
2432
|
+
function dn(e) {
|
|
2415
2433
|
return e === "dashboard" ? "This dashboard" : "Project";
|
|
2416
2434
|
}
|
|
2417
|
-
function
|
|
2435
|
+
function cn(e) {
|
|
2418
2436
|
if (!e) return "Never";
|
|
2419
2437
|
const a = new Date(e);
|
|
2420
2438
|
if (Number.isNaN(a.getTime())) return "Unknown";
|
|
2421
|
-
const
|
|
2439
|
+
const i = Date.now() - a.getTime(), n = Math.round(i / 6e4);
|
|
2422
2440
|
if (n < 1) return "now";
|
|
2423
2441
|
if (n < 60) return `${n}m ago`;
|
|
2424
|
-
const
|
|
2425
|
-
if (
|
|
2426
|
-
const s = Math.round(
|
|
2442
|
+
const l = Math.round(n / 60);
|
|
2443
|
+
if (l < 24) return `${l}h ago`;
|
|
2444
|
+
const s = Math.round(l / 24);
|
|
2427
2445
|
if (s < 7) return `${s}d ago`;
|
|
2428
|
-
const
|
|
2429
|
-
return
|
|
2446
|
+
const u = Math.round(s / 7);
|
|
2447
|
+
return u < 5 ? `${u}w ago` : `${Math.round(s / 30)}mo ago`;
|
|
2430
2448
|
}
|
|
2431
|
-
function
|
|
2432
|
-
return e.scheduleExpr ?
|
|
2449
|
+
function un(e) {
|
|
2450
|
+
return e.scheduleExpr ? ba(
|
|
2433
2451
|
e.scheduleExpr,
|
|
2434
2452
|
e.timezone || "UTC"
|
|
2435
2453
|
) ?? "Invalid schedule" : "On demand";
|
|
2436
2454
|
}
|
|
2437
|
-
function
|
|
2455
|
+
function hn(e) {
|
|
2438
2456
|
if (e.lastRunStatus) {
|
|
2439
2457
|
const a = e.lastRunStatus.toString().toUpperCase();
|
|
2440
2458
|
return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${e.lastRunStatus.toString().toLowerCase()}`;
|
|
2441
2459
|
}
|
|
2442
2460
|
return null;
|
|
2443
2461
|
}
|
|
2444
|
-
function
|
|
2462
|
+
function qt(e) {
|
|
2445
2463
|
return e.hasActiveRun ? "Running" : e.lastRunStatus ? `Last run ${e.lastRunStatus.toString().toLowerCase()}` : "Idle";
|
|
2446
2464
|
}
|
|
2447
|
-
function
|
|
2465
|
+
function mn(e) {
|
|
2448
2466
|
return e.source.type === "dashboard" ? "This dashboard" : "Project";
|
|
2449
2467
|
}
|
|
2450
|
-
function
|
|
2468
|
+
function pn({
|
|
2451
2469
|
activeView: e,
|
|
2452
2470
|
onChange: a
|
|
2453
2471
|
}) {
|
|
@@ -2457,121 +2475,121 @@ function ln({
|
|
|
2457
2475
|
className: "flex shrink-0 items-center gap-1 rounded-control bg-muted p-0.5",
|
|
2458
2476
|
role: "tablist",
|
|
2459
2477
|
"aria-label": "Briefing source view",
|
|
2460
|
-
children: ["dashboard", "project"].map((
|
|
2461
|
-
const n = e ===
|
|
2478
|
+
children: ["dashboard", "project"].map((i) => {
|
|
2479
|
+
const n = e === i;
|
|
2462
2480
|
return /* @__PURE__ */ t(
|
|
2463
2481
|
"button",
|
|
2464
2482
|
{
|
|
2465
2483
|
type: "button",
|
|
2466
2484
|
role: "tab",
|
|
2467
2485
|
"aria-selected": n,
|
|
2468
|
-
onClick: () => a(
|
|
2469
|
-
className:
|
|
2486
|
+
onClick: () => a(i),
|
|
2487
|
+
className: X(
|
|
2470
2488
|
"h-6 rounded-[3px] px-2 text-[11px] transition-colors",
|
|
2471
2489
|
n ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
2472
2490
|
),
|
|
2473
|
-
children:
|
|
2491
|
+
children: dn(i)
|
|
2474
2492
|
},
|
|
2475
|
-
|
|
2493
|
+
i
|
|
2476
2494
|
);
|
|
2477
2495
|
})
|
|
2478
2496
|
}
|
|
2479
2497
|
);
|
|
2480
2498
|
}
|
|
2481
|
-
function
|
|
2499
|
+
function fn({
|
|
2482
2500
|
briefings: e,
|
|
2483
2501
|
dashboardLabel: a,
|
|
2484
|
-
sourceView:
|
|
2502
|
+
sourceView: i,
|
|
2485
2503
|
error: n,
|
|
2486
|
-
loading:
|
|
2504
|
+
loading: l,
|
|
2487
2505
|
onSourceViewChange: s,
|
|
2488
|
-
onClose:
|
|
2489
|
-
onEdit:
|
|
2490
|
-
onNew:
|
|
2491
|
-
canCreate:
|
|
2506
|
+
onClose: u,
|
|
2507
|
+
onEdit: p,
|
|
2508
|
+
onNew: o,
|
|
2509
|
+
canCreate: c,
|
|
2492
2510
|
canCreateScheduledReport: d,
|
|
2493
|
-
analyticalBriefingsEnabled:
|
|
2511
|
+
analyticalBriefingsEnabled: m,
|
|
2494
2512
|
onRunNow: h,
|
|
2495
2513
|
onTogglePause: f,
|
|
2496
|
-
onDelete:
|
|
2514
|
+
onDelete: b,
|
|
2497
2515
|
selectingId: k,
|
|
2498
|
-
busyId:
|
|
2499
|
-
manageBriefingsHref:
|
|
2516
|
+
busyId: I,
|
|
2517
|
+
manageBriefingsHref: y,
|
|
2500
2518
|
contentKind: S,
|
|
2501
|
-
hideHeader:
|
|
2519
|
+
hideHeader: D = !1
|
|
2502
2520
|
}) {
|
|
2503
|
-
const w = e.length,
|
|
2521
|
+
const w = e.length, C = e.filter((A) => A.status === "ACTIVE").length, F = S === "reports" ? w === 1 ? "report" : "reports" : S === "briefings" ? w === 1 ? "briefing" : "briefings" : w === 1 ? "item" : "items", g = e.find((A) => A.hasActiveRun) ?? null, v = S ?? "reports & briefings", U = i === "dashboard" ? a : `Project ${v}`;
|
|
2504
2522
|
return /* @__PURE__ */ r(
|
|
2505
2523
|
"section",
|
|
2506
2524
|
{
|
|
2507
|
-
"aria-label": `Dashboard ${
|
|
2525
|
+
"aria-label": `Dashboard ${v.replace("&", "and")}`,
|
|
2508
2526
|
className: "flex h-full min-h-0 flex-col bg-background text-foreground",
|
|
2509
2527
|
children: [
|
|
2510
|
-
|
|
2528
|
+
D ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
2511
2529
|
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
2512
|
-
/* @__PURE__ */ t("div", { className:
|
|
2513
|
-
/* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children:
|
|
2530
|
+
/* @__PURE__ */ t("div", { className: ln, children: v }),
|
|
2531
|
+
/* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: U })
|
|
2514
2532
|
] }),
|
|
2515
2533
|
/* @__PURE__ */ t(
|
|
2516
2534
|
"button",
|
|
2517
2535
|
{
|
|
2518
2536
|
type: "button",
|
|
2519
|
-
onClick:
|
|
2537
|
+
onClick: u,
|
|
2520
2538
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2521
|
-
"aria-label": `Close ${
|
|
2522
|
-
children: /* @__PURE__ */ t(
|
|
2539
|
+
"aria-label": `Close ${v.replace("&", "and")} panel`,
|
|
2540
|
+
children: /* @__PURE__ */ t(Ze, { className: "h-3.5 w-3.5" })
|
|
2523
2541
|
}
|
|
2524
2542
|
)
|
|
2525
2543
|
] }),
|
|
2526
2544
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 border-b border-border px-4 py-2", children: [
|
|
2527
2545
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
2528
2546
|
/* @__PURE__ */ t(
|
|
2529
|
-
|
|
2547
|
+
pn,
|
|
2530
2548
|
{
|
|
2531
|
-
activeView:
|
|
2549
|
+
activeView: i,
|
|
2532
2550
|
onChange: s
|
|
2533
2551
|
}
|
|
2534
2552
|
),
|
|
2535
|
-
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children:
|
|
2553
|
+
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: l && w === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
2536
2554
|
"Loading ",
|
|
2537
|
-
|
|
2555
|
+
v,
|
|
2538
2556
|
"…"
|
|
2539
2557
|
] }) : w === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
2540
2558
|
"No ",
|
|
2541
|
-
|
|
2559
|
+
v,
|
|
2542
2560
|
" yet"
|
|
2543
|
-
] }) : /* @__PURE__ */ r(
|
|
2561
|
+
] }) : /* @__PURE__ */ r(j, { children: [
|
|
2544
2562
|
/* @__PURE__ */ r("span", { className: "font-medium text-foreground/80", children: [
|
|
2545
2563
|
w,
|
|
2546
2564
|
" ",
|
|
2547
|
-
|
|
2565
|
+
F
|
|
2548
2566
|
] }),
|
|
2549
2567
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
2550
2568
|
/* @__PURE__ */ r("span", { children: [
|
|
2551
|
-
|
|
2569
|
+
C,
|
|
2552
2570
|
" active"
|
|
2553
2571
|
] })
|
|
2554
2572
|
] }) })
|
|
2555
2573
|
] }),
|
|
2556
2574
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
2557
|
-
|
|
2575
|
+
l ? (
|
|
2558
2576
|
// Auto-refresh on open; surface a quiet spinner near the count
|
|
2559
2577
|
// when a manual reload is in flight, but don't show a separate
|
|
2560
2578
|
// refresh button — close+reopen handles the rare "stale list"
|
|
2561
2579
|
// case without crowding the toolbar.
|
|
2562
|
-
/* @__PURE__ */ t(
|
|
2580
|
+
/* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
|
|
2563
2581
|
) : null,
|
|
2564
|
-
w > 0 &&
|
|
2565
|
-
/* @__PURE__ */ t(
|
|
2566
|
-
/* @__PURE__ */ t(
|
|
2582
|
+
w > 0 && c ? m && d ? /* @__PURE__ */ r(Ge, { children: [
|
|
2583
|
+
/* @__PURE__ */ t(Xe, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Oe, children: [
|
|
2584
|
+
/* @__PURE__ */ t(xe, { className: "h-3 w-3" }),
|
|
2567
2585
|
" New"
|
|
2568
2586
|
] }) }),
|
|
2569
|
-
/* @__PURE__ */ r(
|
|
2570
|
-
/* @__PURE__ */ t(
|
|
2587
|
+
/* @__PURE__ */ r(Ke, { align: "end", children: [
|
|
2588
|
+
/* @__PURE__ */ t(G, { onClick: () => o("scheduled_report"), children: "Schedule a report" }),
|
|
2571
2589
|
/* @__PURE__ */ t(
|
|
2572
|
-
|
|
2590
|
+
G,
|
|
2573
2591
|
{
|
|
2574
|
-
onClick: () =>
|
|
2592
|
+
onClick: () => o("analytical_briefing"),
|
|
2575
2593
|
children: "Create analytical briefing"
|
|
2576
2594
|
}
|
|
2577
2595
|
)
|
|
@@ -2579,66 +2597,66 @@ function dn({
|
|
|
2579
2597
|
] }) : d ? /* @__PURE__ */ r(
|
|
2580
2598
|
"button",
|
|
2581
2599
|
{
|
|
2582
|
-
onClick: () =>
|
|
2583
|
-
className:
|
|
2600
|
+
onClick: () => o("scheduled_report"),
|
|
2601
|
+
className: Oe,
|
|
2584
2602
|
children: [
|
|
2585
|
-
/* @__PURE__ */ t(
|
|
2603
|
+
/* @__PURE__ */ t(xe, { className: "h-3 w-3" }),
|
|
2586
2604
|
" Schedule report"
|
|
2587
2605
|
]
|
|
2588
2606
|
}
|
|
2589
|
-
) :
|
|
2607
|
+
) : m ? /* @__PURE__ */ r(
|
|
2590
2608
|
"button",
|
|
2591
2609
|
{
|
|
2592
|
-
onClick: () =>
|
|
2593
|
-
className:
|
|
2610
|
+
onClick: () => o("analytical_briefing"),
|
|
2611
|
+
className: Oe,
|
|
2594
2612
|
children: [
|
|
2595
|
-
/* @__PURE__ */ t(
|
|
2613
|
+
/* @__PURE__ */ t(xe, { className: "h-3 w-3" }),
|
|
2596
2614
|
" New briefing"
|
|
2597
2615
|
]
|
|
2598
2616
|
}
|
|
2599
2617
|
) : null : null
|
|
2600
2618
|
] })
|
|
2601
2619
|
] }),
|
|
2602
|
-
|
|
2603
|
-
/* @__PURE__ */ t(
|
|
2604
|
-
/* @__PURE__ */ t("span", { className: "font-medium text-foreground", children:
|
|
2620
|
+
g ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
|
|
2621
|
+
/* @__PURE__ */ t(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
|
|
2622
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: g.name }),
|
|
2605
2623
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
2606
|
-
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children:
|
|
2624
|
+
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: qt(g) })
|
|
2607
2625
|
] }) : null,
|
|
2608
2626
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
|
|
2609
2627
|
n ? /* @__PURE__ */ t("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: n }) : null,
|
|
2610
|
-
!
|
|
2611
|
-
|
|
2628
|
+
!l && e.length === 0 && !n ? /* @__PURE__ */ t(
|
|
2629
|
+
gn,
|
|
2612
2630
|
{
|
|
2613
|
-
onNew:
|
|
2614
|
-
canCreate:
|
|
2631
|
+
onNew: o,
|
|
2632
|
+
canCreate: c,
|
|
2615
2633
|
canCreateScheduledReport: d,
|
|
2616
|
-
analyticalBriefingsEnabled:
|
|
2634
|
+
analyticalBriefingsEnabled: m,
|
|
2617
2635
|
contentKind: S
|
|
2618
2636
|
}
|
|
2619
2637
|
) : null,
|
|
2620
|
-
e.map((
|
|
2621
|
-
|
|
2638
|
+
e.map((A) => /* @__PURE__ */ t(
|
|
2639
|
+
xn,
|
|
2622
2640
|
{
|
|
2623
|
-
briefing:
|
|
2624
|
-
isOpening: k ===
|
|
2625
|
-
isBusy:
|
|
2626
|
-
onOpen: () =>
|
|
2627
|
-
onRunNow: () => h(
|
|
2628
|
-
onTogglePause: () => f(
|
|
2629
|
-
onDelete: () =>
|
|
2641
|
+
briefing: A,
|
|
2642
|
+
isOpening: k === A.id,
|
|
2643
|
+
isBusy: I === A.id,
|
|
2644
|
+
onOpen: () => p(A.id),
|
|
2645
|
+
onRunNow: () => h(A),
|
|
2646
|
+
onTogglePause: () => f(A),
|
|
2647
|
+
onDelete: () => b(A)
|
|
2630
2648
|
},
|
|
2631
|
-
|
|
2649
|
+
A.id
|
|
2632
2650
|
))
|
|
2633
2651
|
] }),
|
|
2634
|
-
|
|
2652
|
+
y ? /* @__PURE__ */ t("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
|
|
2635
2653
|
"a",
|
|
2636
2654
|
{
|
|
2637
|
-
href:
|
|
2638
|
-
className:
|
|
2655
|
+
href: y,
|
|
2656
|
+
className: X(Ht, "h-6 px-1 text-[11px]"),
|
|
2639
2657
|
children: [
|
|
2640
2658
|
"Manage all reports & briefings",
|
|
2641
|
-
/* @__PURE__ */ t(
|
|
2659
|
+
/* @__PURE__ */ t(va, { className: "h-3 w-3" })
|
|
2642
2660
|
]
|
|
2643
2661
|
}
|
|
2644
2662
|
) }) : null
|
|
@@ -2646,32 +2664,32 @@ function dn({
|
|
|
2646
2664
|
}
|
|
2647
2665
|
);
|
|
2648
2666
|
}
|
|
2649
|
-
function
|
|
2667
|
+
function gn({
|
|
2650
2668
|
onNew: e,
|
|
2651
2669
|
canCreate: a,
|
|
2652
|
-
canCreateScheduledReport:
|
|
2670
|
+
canCreateScheduledReport: i,
|
|
2653
2671
|
analyticalBriefingsEnabled: n,
|
|
2654
|
-
contentKind:
|
|
2672
|
+
contentKind: l
|
|
2655
2673
|
}) {
|
|
2656
|
-
const s =
|
|
2674
|
+
const s = l === "reports" ? {
|
|
2657
2675
|
title: "No reports yet",
|
|
2658
2676
|
description: "Schedule an emailed dashboard or visual report to see it here."
|
|
2659
|
-
} :
|
|
2677
|
+
} : l === "briefings" ? {
|
|
2660
2678
|
title: "No briefings yet",
|
|
2661
2679
|
description: "Create an analytical briefing to monitor this dashboard and brief your team."
|
|
2662
2680
|
} : null;
|
|
2663
2681
|
return /* @__PURE__ */ r("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
|
|
2664
|
-
/* @__PURE__ */ t(
|
|
2682
|
+
/* @__PURE__ */ t(bn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
|
|
2665
2683
|
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: (s == null ? void 0 : s.title) ?? "Have an analyst brief your team" }),
|
|
2666
2684
|
/* @__PURE__ */ t("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (s == null ? void 0 : s.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." }),
|
|
2667
2685
|
a ? /* @__PURE__ */ r("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
|
|
2668
|
-
|
|
2686
|
+
i ? /* @__PURE__ */ r(
|
|
2669
2687
|
"button",
|
|
2670
2688
|
{
|
|
2671
2689
|
onClick: () => e("scheduled_report"),
|
|
2672
|
-
className:
|
|
2690
|
+
className: Oe,
|
|
2673
2691
|
children: [
|
|
2674
|
-
/* @__PURE__ */ t(
|
|
2692
|
+
/* @__PURE__ */ t(xe, { className: "h-3 w-3" }),
|
|
2675
2693
|
" Schedule a report"
|
|
2676
2694
|
]
|
|
2677
2695
|
}
|
|
@@ -2680,14 +2698,14 @@ function cn({
|
|
|
2680
2698
|
"button",
|
|
2681
2699
|
{
|
|
2682
2700
|
onClick: () => e("analytical_briefing"),
|
|
2683
|
-
className:
|
|
2701
|
+
className: Ht,
|
|
2684
2702
|
children: "Create analytical briefing"
|
|
2685
2703
|
}
|
|
2686
2704
|
) : null
|
|
2687
2705
|
] }) : null
|
|
2688
2706
|
] });
|
|
2689
2707
|
}
|
|
2690
|
-
function
|
|
2708
|
+
function bn({ className: e }) {
|
|
2691
2709
|
return /* @__PURE__ */ r(
|
|
2692
2710
|
"svg",
|
|
2693
2711
|
{
|
|
@@ -2864,22 +2882,22 @@ function un({ className: e }) {
|
|
|
2864
2882
|
}
|
|
2865
2883
|
);
|
|
2866
2884
|
}
|
|
2867
|
-
function
|
|
2885
|
+
function xn({
|
|
2868
2886
|
briefing: e,
|
|
2869
2887
|
isOpening: a,
|
|
2870
|
-
isBusy:
|
|
2888
|
+
isBusy: i,
|
|
2871
2889
|
onOpen: n,
|
|
2872
|
-
onRunNow:
|
|
2890
|
+
onRunNow: l,
|
|
2873
2891
|
onTogglePause: s,
|
|
2874
|
-
onDelete:
|
|
2892
|
+
onDelete: u
|
|
2875
2893
|
}) {
|
|
2876
|
-
const
|
|
2894
|
+
const p = e.status === "PAUSED", o = e.hasActiveRun, c = hn(e), d = cn(e.lastRunAt), m = e.lastRunStatus, h = oe(e), f = m === "SUCCESS" ? _e.success.dot : m === "FAILED" ? _e.danger.dot : m ? _e.warning.dot : _e.neutral.dot;
|
|
2877
2895
|
return /* @__PURE__ */ r(
|
|
2878
2896
|
"div",
|
|
2879
2897
|
{
|
|
2880
|
-
className:
|
|
2898
|
+
className: X(
|
|
2881
2899
|
"group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
|
|
2882
|
-
|
|
2900
|
+
p && "opacity-70"
|
|
2883
2901
|
),
|
|
2884
2902
|
children: [
|
|
2885
2903
|
/* @__PURE__ */ r(
|
|
@@ -2888,23 +2906,23 @@ function hn({
|
|
|
2888
2906
|
role: "button",
|
|
2889
2907
|
tabIndex: 0,
|
|
2890
2908
|
onClick: n,
|
|
2891
|
-
onKeyDown: (
|
|
2892
|
-
(
|
|
2909
|
+
onKeyDown: (b) => {
|
|
2910
|
+
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), n());
|
|
2893
2911
|
},
|
|
2894
2912
|
className: "cursor-pointer pr-8",
|
|
2895
2913
|
children: [
|
|
2896
2914
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2897
2915
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.name }),
|
|
2898
|
-
|
|
2916
|
+
p ? /* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
|
|
2899
2917
|
] }),
|
|
2900
2918
|
/* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
|
|
2901
2919
|
/* @__PURE__ */ t("span", { children: h.typeLabel }),
|
|
2902
2920
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
2903
|
-
/* @__PURE__ */ t("span", { children:
|
|
2921
|
+
/* @__PURE__ */ t("span", { children: mn(e) }),
|
|
2904
2922
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
2905
|
-
/* @__PURE__ */ t(
|
|
2906
|
-
/* @__PURE__ */ t("span", { className: "truncate", children:
|
|
2907
|
-
e.lastRunAt ? /* @__PURE__ */ r(
|
|
2923
|
+
/* @__PURE__ */ t(_r, { className: "h-3 w-3" }),
|
|
2924
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: un(e) }),
|
|
2925
|
+
e.lastRunAt ? /* @__PURE__ */ r(j, { children: [
|
|
2908
2926
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
2909
2927
|
/* @__PURE__ */ r("span", { children: [
|
|
2910
2928
|
"Last run ",
|
|
@@ -2912,75 +2930,75 @@ function hn({
|
|
|
2912
2930
|
] })
|
|
2913
2931
|
] }) : null
|
|
2914
2932
|
] }),
|
|
2915
|
-
|
|
2916
|
-
|
|
2933
|
+
c || o ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
|
|
2934
|
+
o ? /* @__PURE__ */ t(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ t(
|
|
2917
2935
|
"span",
|
|
2918
2936
|
{
|
|
2919
|
-
className:
|
|
2937
|
+
className: X(
|
|
2920
2938
|
"inline-block h-1.5 w-1.5 shrink-0 rounded-full",
|
|
2921
2939
|
f
|
|
2922
2940
|
)
|
|
2923
2941
|
}
|
|
2924
2942
|
),
|
|
2925
|
-
/* @__PURE__ */ t("span", { className: "truncate", children:
|
|
2943
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: o ? qt(e) : c })
|
|
2926
2944
|
] }) : null
|
|
2927
2945
|
]
|
|
2928
2946
|
}
|
|
2929
2947
|
),
|
|
2930
|
-
/* @__PURE__ */ t("div", { className: "absolute right-3 top-3", children:
|
|
2931
|
-
/* @__PURE__ */ t(
|
|
2948
|
+
/* @__PURE__ */ t("div", { className: "absolute right-3 top-3", children: i ? /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r(Ge, { children: [
|
|
2949
|
+
/* @__PURE__ */ t(Xe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2932
2950
|
"button",
|
|
2933
2951
|
{
|
|
2934
2952
|
type: "button",
|
|
2935
|
-
onClick: (
|
|
2953
|
+
onClick: (b) => b.stopPropagation(),
|
|
2936
2954
|
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",
|
|
2937
2955
|
"aria-label": `${h.noun === "report" ? "Report" : "Briefing"} actions`,
|
|
2938
|
-
children: /* @__PURE__ */ t(
|
|
2956
|
+
children: /* @__PURE__ */ t(Bt, { className: "h-3.5 w-3.5" })
|
|
2939
2957
|
}
|
|
2940
2958
|
) }),
|
|
2941
|
-
/* @__PURE__ */ r(
|
|
2942
|
-
/* @__PURE__ */ r(
|
|
2943
|
-
/* @__PURE__ */ t(
|
|
2959
|
+
/* @__PURE__ */ r(Ke, { align: "end", className: "w-44", children: [
|
|
2960
|
+
/* @__PURE__ */ r(G, { onClick: n, children: [
|
|
2961
|
+
/* @__PURE__ */ t(Mt, { className: "h-3.5 w-3.5" }),
|
|
2944
2962
|
"Edit ",
|
|
2945
2963
|
h.noun
|
|
2946
2964
|
] }),
|
|
2947
2965
|
/* @__PURE__ */ r(
|
|
2948
|
-
|
|
2966
|
+
G,
|
|
2949
2967
|
{
|
|
2950
|
-
onClick: (
|
|
2951
|
-
|
|
2968
|
+
onClick: (b) => {
|
|
2969
|
+
b.preventDefault(), l();
|
|
2952
2970
|
},
|
|
2953
2971
|
children: [
|
|
2954
|
-
/* @__PURE__ */ t(
|
|
2972
|
+
/* @__PURE__ */ t(Mr, { className: "h-3.5 w-3.5" }),
|
|
2955
2973
|
"Run now"
|
|
2956
2974
|
]
|
|
2957
2975
|
}
|
|
2958
2976
|
),
|
|
2959
2977
|
e.scheduleExpr ? /* @__PURE__ */ t(
|
|
2960
|
-
|
|
2978
|
+
G,
|
|
2961
2979
|
{
|
|
2962
|
-
onClick: (
|
|
2963
|
-
|
|
2980
|
+
onClick: (b) => {
|
|
2981
|
+
b.preventDefault(), s();
|
|
2964
2982
|
},
|
|
2965
|
-
children:
|
|
2966
|
-
/* @__PURE__ */ t(
|
|
2983
|
+
children: p ? /* @__PURE__ */ r(j, { children: [
|
|
2984
|
+
/* @__PURE__ */ t(Or, { className: "h-3.5 w-3.5" }),
|
|
2967
2985
|
"Resume"
|
|
2968
|
-
] }) : /* @__PURE__ */ r(
|
|
2969
|
-
/* @__PURE__ */ t(
|
|
2986
|
+
] }) : /* @__PURE__ */ r(j, { children: [
|
|
2987
|
+
/* @__PURE__ */ t(zr, { className: "h-3.5 w-3.5" }),
|
|
2970
2988
|
"Pause"
|
|
2971
2989
|
] })
|
|
2972
2990
|
}
|
|
2973
2991
|
) : null,
|
|
2974
|
-
/* @__PURE__ */ t(
|
|
2992
|
+
/* @__PURE__ */ t(He, {}),
|
|
2975
2993
|
/* @__PURE__ */ r(
|
|
2976
|
-
|
|
2994
|
+
G,
|
|
2977
2995
|
{
|
|
2978
|
-
onClick: (
|
|
2979
|
-
|
|
2996
|
+
onClick: (b) => {
|
|
2997
|
+
b.preventDefault(), u();
|
|
2980
2998
|
},
|
|
2981
2999
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
2982
3000
|
children: [
|
|
2983
|
-
/* @__PURE__ */ t(
|
|
3001
|
+
/* @__PURE__ */ t(We, { className: "h-3.5 w-3.5" }),
|
|
2984
3002
|
"Delete ",
|
|
2985
3003
|
h.noun
|
|
2986
3004
|
]
|
|
@@ -2992,263 +3010,263 @@ function hn({
|
|
|
2992
3010
|
}
|
|
2993
3011
|
);
|
|
2994
3012
|
}
|
|
2995
|
-
const
|
|
2996
|
-
function
|
|
3013
|
+
const vn = 2e3, yn = 20 * 6e4;
|
|
3014
|
+
function Cn(e) {
|
|
2997
3015
|
return (e == null ? void 0 : e.trim()) || "This dashboard";
|
|
2998
3016
|
}
|
|
2999
|
-
function
|
|
3017
|
+
function wn(e) {
|
|
3000
3018
|
return e === "This dashboard" ? "Watch this dashboard" : `Watch ${e}`;
|
|
3001
3019
|
}
|
|
3002
|
-
function
|
|
3020
|
+
function Nn(e, a, i) {
|
|
3003
3021
|
return a !== "dashboard" ? e : e.filter(
|
|
3004
|
-
(n) => n.source.type === "dashboard" && n.source.dashboardId ===
|
|
3022
|
+
(n) => n.source.type === "dashboard" && n.source.dashboardId === i
|
|
3005
3023
|
);
|
|
3006
3024
|
}
|
|
3007
|
-
async function
|
|
3008
|
-
const
|
|
3009
|
-
let n = 1,
|
|
3010
|
-
for (;
|
|
3011
|
-
const
|
|
3025
|
+
async function Sn(e) {
|
|
3026
|
+
const i = [];
|
|
3027
|
+
let n = 1, l = 0, s = Number.POSITIVE_INFINITY;
|
|
3028
|
+
for (; l < s; ) {
|
|
3029
|
+
const u = await e.apiClient.listBriefings(
|
|
3012
3030
|
e.apiServiceUrl,
|
|
3013
3031
|
e.token,
|
|
3014
3032
|
{ scope: "organization", page: n, pageSize: 100 }
|
|
3015
3033
|
);
|
|
3016
|
-
if (
|
|
3034
|
+
if (i.push(...u.briefings), l += u.briefings.length, s = u.total, u.briefings.length === 0 || l >= s) break;
|
|
3017
3035
|
n += 1;
|
|
3018
3036
|
}
|
|
3019
|
-
return
|
|
3037
|
+
return i;
|
|
3020
3038
|
}
|
|
3021
|
-
const
|
|
3022
|
-
listBriefings:
|
|
3023
|
-
getBriefing:
|
|
3024
|
-
pauseBriefing:
|
|
3025
|
-
resumeBriefing:
|
|
3026
|
-
deleteBriefing:
|
|
3027
|
-
runBriefingNow:
|
|
3039
|
+
const Dn = {
|
|
3040
|
+
listBriefings: Kr,
|
|
3041
|
+
getBriefing: Xr,
|
|
3042
|
+
pauseBriefing: Gr,
|
|
3043
|
+
resumeBriefing: qr,
|
|
3044
|
+
deleteBriefing: Hr,
|
|
3045
|
+
runBriefingNow: Wr
|
|
3028
3046
|
};
|
|
3029
|
-
function
|
|
3047
|
+
function kn({
|
|
3030
3048
|
briefingId: e,
|
|
3031
3049
|
initialRun: a,
|
|
3032
|
-
apiServiceUrl:
|
|
3050
|
+
apiServiceUrl: i,
|
|
3033
3051
|
token: n,
|
|
3034
|
-
onTerminal:
|
|
3052
|
+
onTerminal: l,
|
|
3035
3053
|
onTimeout: s,
|
|
3036
|
-
onExpand:
|
|
3054
|
+
onExpand: u
|
|
3037
3055
|
}) {
|
|
3038
|
-
const [
|
|
3039
|
-
apiServiceUrl:
|
|
3056
|
+
const [p, o] = E(a), { startRun: c } = aa({
|
|
3057
|
+
apiServiceUrl: i,
|
|
3040
3058
|
token: n,
|
|
3041
|
-
intervalMs:
|
|
3042
|
-
timeoutMs:
|
|
3059
|
+
intervalMs: vn,
|
|
3060
|
+
timeoutMs: yn,
|
|
3043
3061
|
fetchRun: ({
|
|
3044
|
-
apiServiceUrl:
|
|
3062
|
+
apiServiceUrl: m,
|
|
3045
3063
|
token: h,
|
|
3046
3064
|
runId: f
|
|
3047
|
-
}) =>
|
|
3048
|
-
onRun: (
|
|
3049
|
-
|
|
3065
|
+
}) => na(m, h, e, f),
|
|
3066
|
+
onRun: (m) => {
|
|
3067
|
+
o(m);
|
|
3050
3068
|
},
|
|
3051
|
-
onTerminalRun: (
|
|
3052
|
-
|
|
3069
|
+
onTerminalRun: (m) => {
|
|
3070
|
+
l(m);
|
|
3053
3071
|
},
|
|
3054
3072
|
onTimeout: () => {
|
|
3055
3073
|
s();
|
|
3056
3074
|
}
|
|
3057
|
-
}), d =
|
|
3075
|
+
}), d = ue(!1);
|
|
3058
3076
|
return Y(() => {
|
|
3059
|
-
d.current || (d.current = !0,
|
|
3060
|
-
}, [a,
|
|
3077
|
+
d.current || (d.current = !0, sa(a.status) ? c(a) : oa(a.status) && l(a));
|
|
3078
|
+
}, [a, l, c]), /* @__PURE__ */ t(ia, { run: p, onExpand: u });
|
|
3061
3079
|
}
|
|
3062
|
-
function
|
|
3063
|
-
return /* @__PURE__ */ t(
|
|
3080
|
+
function es(e) {
|
|
3081
|
+
return /* @__PURE__ */ t($r, { children: /* @__PURE__ */ t(En, { ...e }) });
|
|
3064
3082
|
}
|
|
3065
|
-
function
|
|
3083
|
+
function En({
|
|
3066
3084
|
dashboardId: e,
|
|
3067
3085
|
dashboardTitle: a,
|
|
3068
|
-
apiServiceUrl:
|
|
3086
|
+
apiServiceUrl: i,
|
|
3069
3087
|
token: n,
|
|
3070
|
-
disabled:
|
|
3088
|
+
disabled: l,
|
|
3071
3089
|
className: s,
|
|
3072
|
-
manageBriefingsHref:
|
|
3073
|
-
open:
|
|
3074
|
-
onOpenChange:
|
|
3075
|
-
hideTrigger:
|
|
3090
|
+
manageBriefingsHref: u,
|
|
3091
|
+
open: p,
|
|
3092
|
+
onOpenChange: o,
|
|
3093
|
+
hideTrigger: c = !1,
|
|
3076
3094
|
workflowIntent: d,
|
|
3077
|
-
client:
|
|
3095
|
+
client: m
|
|
3078
3096
|
}) {
|
|
3079
|
-
const { authToken: h, tokenProps: f } =
|
|
3080
|
-
|
|
3081
|
-
}, [w,
|
|
3097
|
+
const { authToken: h, tokenProps: f } = Ye(), b = jr(), k = !d || b.canCreate && (d === "scheduled_report" || b.analyticalBriefingsEnabled), [I, y] = E(!1), S = p ?? I, D = (N) => {
|
|
3098
|
+
p === void 0 && y(N), o == null || o(N);
|
|
3099
|
+
}, [w, C] = E(
|
|
3082
3100
|
d ? "author" : "list"
|
|
3083
|
-
), [
|
|
3101
|
+
), [F, g] = E(
|
|
3084
3102
|
d ?? "analytical_briefing"
|
|
3085
|
-
), [
|
|
3103
|
+
), [v, U] = E("dashboard"), [A, q] = E(
|
|
3086
3104
|
[]
|
|
3087
|
-
), [
|
|
3105
|
+
), [L, P] = E(null), J = d && !k && !L ? "list" : w, [ne, Fe] = E(!1), [ie, Te] = E(null), [Be, le] = E(null), [W, ee] = E(
|
|
3088
3106
|
null
|
|
3089
|
-
), [
|
|
3107
|
+
), [de, te] = E(null), Re = ue(null), ye = ue(S);
|
|
3090
3108
|
Y(() => {
|
|
3091
|
-
const N = S && !
|
|
3092
|
-
|
|
3109
|
+
const N = S && !ye.current;
|
|
3110
|
+
ye.current = S, !(!N || !d) && (P(null), U("dashboard"), g(d), C("author"), te(null));
|
|
3093
3111
|
}, [S, d]);
|
|
3094
|
-
const [
|
|
3112
|
+
const [he, ge] = E(
|
|
3095
3113
|
null
|
|
3096
|
-
), [
|
|
3097
|
-
const N =
|
|
3098
|
-
|
|
3099
|
-
|
|
3114
|
+
), [Z, Ce] = E(null), M = i ?? (f == null ? void 0 : f.apiServiceUrl), O = n ?? (h == null ? void 0 : h.accessToken), se = Q(() => ({ ...Dn, ...m }), [m]), be = Cn(a), Ue = Q(() => {
|
|
3115
|
+
const N = Nn(
|
|
3116
|
+
A,
|
|
3117
|
+
v,
|
|
3100
3118
|
e
|
|
3101
3119
|
);
|
|
3102
3120
|
if (!d)
|
|
3103
3121
|
return N;
|
|
3104
3122
|
const V = d === "scheduled_report" ? "report" : "briefing";
|
|
3105
3123
|
return N.filter(
|
|
3106
|
-
(
|
|
3124
|
+
(Ve) => oe(Ve).noun === V
|
|
3107
3125
|
);
|
|
3108
|
-
}, [e,
|
|
3126
|
+
}, [e, A, v, d]), Qe = Q(() => v === "dashboard" ? {
|
|
3109
3127
|
source: { type: "dashboard", dashboardId: e },
|
|
3110
|
-
label:
|
|
3111
|
-
detail:
|
|
3128
|
+
label: be,
|
|
3129
|
+
detail: wn(be)
|
|
3112
3130
|
} : {
|
|
3113
3131
|
source: { type: "project" },
|
|
3114
3132
|
label: "This project",
|
|
3115
3133
|
detail: "Use any data in this project."
|
|
3116
|
-
}, [e,
|
|
3117
|
-
canCreate:
|
|
3118
|
-
analyticalBriefingsEnabled:
|
|
3119
|
-
scheduledReportAvailable:
|
|
3120
|
-
}), K =
|
|
3121
|
-
if (!(!
|
|
3122
|
-
|
|
3134
|
+
}, [e, be, v]), we = !!(M && O), Ne = xa({
|
|
3135
|
+
canCreate: b.canCreate,
|
|
3136
|
+
analyticalBriefingsEnabled: b.analyticalBriefingsEnabled,
|
|
3137
|
+
scheduledReportAvailable: v === "dashboard"
|
|
3138
|
+
}), K = H(async () => {
|
|
3139
|
+
if (!(!M || !O)) {
|
|
3140
|
+
Fe(!0), te(null);
|
|
3123
3141
|
try {
|
|
3124
|
-
|
|
3125
|
-
await
|
|
3126
|
-
apiClient:
|
|
3127
|
-
apiServiceUrl:
|
|
3142
|
+
q(
|
|
3143
|
+
await Sn({
|
|
3144
|
+
apiClient: se,
|
|
3145
|
+
apiServiceUrl: M,
|
|
3128
3146
|
token: O
|
|
3129
3147
|
})
|
|
3130
3148
|
);
|
|
3131
3149
|
} catch (N) {
|
|
3132
|
-
|
|
3150
|
+
te(
|
|
3133
3151
|
N instanceof Error ? N.message : "Could not load briefings."
|
|
3134
3152
|
);
|
|
3135
3153
|
} finally {
|
|
3136
|
-
|
|
3154
|
+
Fe(!1);
|
|
3137
3155
|
}
|
|
3138
3156
|
}
|
|
3139
|
-
}, [
|
|
3157
|
+
}, [se, M, O]);
|
|
3140
3158
|
Y(() => {
|
|
3141
|
-
!S ||
|
|
3142
|
-
}, [
|
|
3143
|
-
const
|
|
3144
|
-
P(null),
|
|
3145
|
-
},
|
|
3146
|
-
P(null),
|
|
3159
|
+
!S || J !== "list" || !we || K();
|
|
3160
|
+
}, [we, J, K, S]);
|
|
3161
|
+
const Se = () => {
|
|
3162
|
+
P(null), U("dashboard"), C("list"), D(!0);
|
|
3163
|
+
}, x = (N) => {
|
|
3164
|
+
P(null), g(N), C("author");
|
|
3147
3165
|
}, B = async (N) => {
|
|
3148
|
-
if (!(!
|
|
3149
|
-
|
|
3166
|
+
if (!(!M || !O)) {
|
|
3167
|
+
Te(N), te(null);
|
|
3150
3168
|
try {
|
|
3151
|
-
const V = await
|
|
3152
|
-
|
|
3169
|
+
const V = await se.getBriefing(
|
|
3170
|
+
M,
|
|
3153
3171
|
O,
|
|
3154
3172
|
N
|
|
3155
3173
|
);
|
|
3156
|
-
P(V.briefing),
|
|
3174
|
+
P(V.briefing), C("author");
|
|
3157
3175
|
} catch (V) {
|
|
3158
|
-
|
|
3176
|
+
te(
|
|
3159
3177
|
V instanceof Error ? V.message : "Could not open briefing."
|
|
3160
3178
|
);
|
|
3161
3179
|
} finally {
|
|
3162
|
-
|
|
3180
|
+
Te(null);
|
|
3163
3181
|
}
|
|
3164
3182
|
}
|
|
3165
|
-
},
|
|
3166
|
-
if (!(!
|
|
3167
|
-
|
|
3183
|
+
}, _ = async (N) => {
|
|
3184
|
+
if (!(!M || !O)) {
|
|
3185
|
+
le(N.id);
|
|
3168
3186
|
try {
|
|
3169
|
-
await
|
|
3170
|
-
|
|
3187
|
+
await se.runBriefingNow(
|
|
3188
|
+
M,
|
|
3171
3189
|
O,
|
|
3172
3190
|
N.id,
|
|
3173
|
-
{ requestId:
|
|
3191
|
+
{ requestId: An() }
|
|
3174
3192
|
), K();
|
|
3175
3193
|
} catch (V) {
|
|
3176
|
-
|
|
3194
|
+
$.error(
|
|
3177
3195
|
V instanceof Error ? V.message : "Could not start the run."
|
|
3178
3196
|
);
|
|
3179
3197
|
} finally {
|
|
3180
|
-
|
|
3198
|
+
le(null);
|
|
3181
3199
|
}
|
|
3182
3200
|
}
|
|
3183
|
-
},
|
|
3184
|
-
if (!
|
|
3185
|
-
const { noun: V } =
|
|
3186
|
-
|
|
3201
|
+
}, re = async (N) => {
|
|
3202
|
+
if (!M || !O) return;
|
|
3203
|
+
const { noun: V } = oe(N), Ve = V === "report" ? "Report" : "Briefing";
|
|
3204
|
+
le(N.id);
|
|
3187
3205
|
try {
|
|
3188
|
-
const
|
|
3189
|
-
|
|
3206
|
+
const Pe = N.status === "PAUSED" ? await se.resumeBriefing(
|
|
3207
|
+
M,
|
|
3190
3208
|
O,
|
|
3191
3209
|
N.id
|
|
3192
|
-
) : await
|
|
3193
|
-
|
|
3210
|
+
) : await se.pauseBriefing(
|
|
3211
|
+
M,
|
|
3194
3212
|
O,
|
|
3195
3213
|
N.id
|
|
3196
3214
|
);
|
|
3197
|
-
|
|
3198
|
-
|
|
3215
|
+
$.success(
|
|
3216
|
+
Pe.briefing.status === "PAUSED" ? `${Ve} paused` : `${Ve} resumed`
|
|
3199
3217
|
), K();
|
|
3200
|
-
} catch (
|
|
3201
|
-
|
|
3202
|
-
|
|
3218
|
+
} catch (Pe) {
|
|
3219
|
+
$.error(
|
|
3220
|
+
Pe instanceof Error ? Pe.message : `Could not update the ${V} status.`
|
|
3203
3221
|
);
|
|
3204
3222
|
} finally {
|
|
3205
|
-
|
|
3223
|
+
le(null);
|
|
3206
3224
|
}
|
|
3207
|
-
},
|
|
3208
|
-
if (!
|
|
3209
|
-
const N =
|
|
3210
|
-
|
|
3225
|
+
}, ce = async () => {
|
|
3226
|
+
if (!W || !M || !O) return;
|
|
3227
|
+
const N = W;
|
|
3228
|
+
le(N.id);
|
|
3211
3229
|
try {
|
|
3212
|
-
await
|
|
3213
|
-
|
|
3230
|
+
await se.deleteBriefing(
|
|
3231
|
+
M,
|
|
3214
3232
|
O,
|
|
3215
3233
|
N.id
|
|
3216
3234
|
);
|
|
3217
|
-
const { noun: V } =
|
|
3218
|
-
|
|
3235
|
+
const { noun: V } = oe(N);
|
|
3236
|
+
$.success(`${V === "report" ? "Report" : "Briefing"} deleted`), ee(null), K();
|
|
3219
3237
|
} catch (V) {
|
|
3220
|
-
|
|
3238
|
+
$.error(
|
|
3221
3239
|
V instanceof Error ? V.message : "Could not delete the briefing."
|
|
3222
3240
|
);
|
|
3223
3241
|
} finally {
|
|
3224
|
-
|
|
3242
|
+
le(null);
|
|
3225
3243
|
}
|
|
3226
|
-
},
|
|
3227
|
-
return
|
|
3228
|
-
|
|
3229
|
-
|
|
3244
|
+
}, Gt = Ue.length;
|
|
3245
|
+
return b.surfaceVisible ? /* @__PURE__ */ r(Yr, { open: S, onOpenChange: D, children: [
|
|
3246
|
+
c ? null : /* @__PURE__ */ t(
|
|
3247
|
+
on,
|
|
3230
3248
|
{
|
|
3231
|
-
disabled:
|
|
3232
|
-
briefingCount:
|
|
3249
|
+
disabled: l || !we,
|
|
3250
|
+
briefingCount: Gt,
|
|
3233
3251
|
className: s,
|
|
3234
|
-
onClick:
|
|
3252
|
+
onClick: Se
|
|
3235
3253
|
}
|
|
3236
3254
|
),
|
|
3237
3255
|
/* @__PURE__ */ r(
|
|
3238
|
-
|
|
3256
|
+
Zr,
|
|
3239
3257
|
{
|
|
3240
|
-
ref:
|
|
3258
|
+
ref: Re,
|
|
3241
3259
|
side: "right",
|
|
3242
3260
|
hideClose: !0,
|
|
3243
3261
|
className: "flex h-full w-full flex-col overflow-hidden p-0 outline-none sm:max-w-[560px]",
|
|
3244
3262
|
onOpenAutoFocus: (N) => {
|
|
3245
3263
|
var V;
|
|
3246
|
-
N.preventDefault(), (V =
|
|
3264
|
+
N.preventDefault(), (V = Re.current) == null || V.focus({ preventScroll: !0 });
|
|
3247
3265
|
},
|
|
3248
3266
|
children: [
|
|
3249
|
-
/* @__PURE__ */ r(
|
|
3250
|
-
/* @__PURE__ */ t(
|
|
3251
|
-
/* @__PURE__ */ t(
|
|
3267
|
+
/* @__PURE__ */ r(Qr, { className: "sr-only", children: [
|
|
3268
|
+
/* @__PURE__ */ t(Jr, { children: "Reports & briefings" }),
|
|
3269
|
+
/* @__PURE__ */ t(ea, { children: "Manage reports and briefings for this dashboard." })
|
|
3252
3270
|
] }),
|
|
3253
3271
|
d ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
|
|
3254
3272
|
/* @__PURE__ */ r(
|
|
@@ -3263,17 +3281,17 @@ function Cn({
|
|
|
3263
3281
|
{
|
|
3264
3282
|
type: "button",
|
|
3265
3283
|
role: "tab",
|
|
3266
|
-
"aria-selected":
|
|
3284
|
+
"aria-selected": J === "author",
|
|
3267
3285
|
disabled: !k,
|
|
3268
|
-
className:
|
|
3286
|
+
className: X(
|
|
3269
3287
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3270
|
-
|
|
3288
|
+
J === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
|
|
3271
3289
|
!k && "cursor-not-allowed opacity-50"
|
|
3272
3290
|
),
|
|
3273
3291
|
onClick: () => {
|
|
3274
|
-
k && (P(null),
|
|
3292
|
+
k && (P(null), g(d), U("dashboard"), C("author"));
|
|
3275
3293
|
},
|
|
3276
|
-
children:
|
|
3294
|
+
children: L ? `Edit ${oe(L).noun}` : d === "scheduled_report" ? "Schedule report" : "Create briefing"
|
|
3277
3295
|
}
|
|
3278
3296
|
),
|
|
3279
3297
|
/* @__PURE__ */ t(
|
|
@@ -3281,12 +3299,12 @@ function Cn({
|
|
|
3281
3299
|
{
|
|
3282
3300
|
type: "button",
|
|
3283
3301
|
role: "tab",
|
|
3284
|
-
"aria-selected":
|
|
3285
|
-
className:
|
|
3302
|
+
"aria-selected": J === "list",
|
|
3303
|
+
className: X(
|
|
3286
3304
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3287
|
-
|
|
3305
|
+
J === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3288
3306
|
),
|
|
3289
|
-
onClick: () =>
|
|
3307
|
+
onClick: () => C("list"),
|
|
3290
3308
|
children: d === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
3291
3309
|
}
|
|
3292
3310
|
)
|
|
@@ -3297,63 +3315,63 @@ function Cn({
|
|
|
3297
3315
|
"button",
|
|
3298
3316
|
{
|
|
3299
3317
|
type: "button",
|
|
3300
|
-
onClick: () =>
|
|
3318
|
+
onClick: () => D(!1),
|
|
3301
3319
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3302
3320
|
"aria-label": d === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
|
|
3303
|
-
children: /* @__PURE__ */ t(
|
|
3321
|
+
children: /* @__PURE__ */ t(Ze, { className: "h-3.5 w-3.5" })
|
|
3304
3322
|
}
|
|
3305
3323
|
)
|
|
3306
3324
|
] }) : null,
|
|
3307
|
-
|
|
3308
|
-
|
|
3325
|
+
J === "list" ? /* @__PURE__ */ t(
|
|
3326
|
+
fn,
|
|
3309
3327
|
{
|
|
3310
|
-
briefings:
|
|
3311
|
-
dashboardLabel:
|
|
3312
|
-
sourceView:
|
|
3313
|
-
error:
|
|
3314
|
-
loading:
|
|
3315
|
-
onSourceViewChange:
|
|
3316
|
-
onClose: () =>
|
|
3328
|
+
briefings: Ue,
|
|
3329
|
+
dashboardLabel: be,
|
|
3330
|
+
sourceView: v,
|
|
3331
|
+
error: de,
|
|
3332
|
+
loading: ne,
|
|
3333
|
+
onSourceViewChange: U,
|
|
3334
|
+
onClose: () => D(!1),
|
|
3317
3335
|
onEdit: (N) => {
|
|
3318
3336
|
B(N);
|
|
3319
3337
|
},
|
|
3320
|
-
onNew:
|
|
3321
|
-
canCreate: !d &&
|
|
3322
|
-
canCreateScheduledReport:
|
|
3338
|
+
onNew: x,
|
|
3339
|
+
canCreate: !d && Ne.length > 0,
|
|
3340
|
+
canCreateScheduledReport: Ne.includes(
|
|
3323
3341
|
"scheduled_report"
|
|
3324
3342
|
),
|
|
3325
|
-
analyticalBriefingsEnabled:
|
|
3343
|
+
analyticalBriefingsEnabled: Ne.includes(
|
|
3326
3344
|
"analytical_briefing"
|
|
3327
3345
|
),
|
|
3328
3346
|
onRunNow: (N) => {
|
|
3329
|
-
|
|
3347
|
+
_(N);
|
|
3330
3348
|
},
|
|
3331
3349
|
onTogglePause: (N) => {
|
|
3332
|
-
|
|
3350
|
+
re(N);
|
|
3333
3351
|
},
|
|
3334
|
-
onDelete: (N) =>
|
|
3335
|
-
selectingId:
|
|
3336
|
-
busyId:
|
|
3337
|
-
manageBriefingsHref:
|
|
3352
|
+
onDelete: (N) => ee(N),
|
|
3353
|
+
selectingId: ie,
|
|
3354
|
+
busyId: Be,
|
|
3355
|
+
manageBriefingsHref: u,
|
|
3338
3356
|
contentKind: d === "scheduled_report" ? "reports" : d === "analytical_briefing" ? "briefings" : void 0,
|
|
3339
3357
|
hideHeader: !!d
|
|
3340
3358
|
}
|
|
3341
3359
|
) : /* @__PURE__ */ t(
|
|
3342
|
-
|
|
3360
|
+
ta,
|
|
3343
3361
|
{
|
|
3344
|
-
apiServiceUrl:
|
|
3362
|
+
apiServiceUrl: M,
|
|
3345
3363
|
token: O,
|
|
3346
|
-
briefing:
|
|
3347
|
-
intent:
|
|
3348
|
-
sourceContext:
|
|
3349
|
-
title:
|
|
3364
|
+
briefing: L,
|
|
3365
|
+
intent: F,
|
|
3366
|
+
sourceContext: L ? void 0 : Qe,
|
|
3367
|
+
title: L ? `Edit ${oe(L).noun}` : F === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
|
|
3350
3368
|
hideHeader: !!d,
|
|
3351
3369
|
className: "h-full min-h-0 max-w-none border-0 shadow-none",
|
|
3352
|
-
onBack: d ? void 0 : () =>
|
|
3353
|
-
onCancel: () =>
|
|
3370
|
+
onBack: d ? void 0 : () => C("list"),
|
|
3371
|
+
onCancel: () => D(!1),
|
|
3354
3372
|
onDeleted: () => {
|
|
3355
|
-
const N =
|
|
3356
|
-
|
|
3373
|
+
const N = L ? oe(L).noun : "briefing";
|
|
3374
|
+
$.success(`${N === "report" ? "Report" : "Briefing"} deleted`), P(null), C("list"), K();
|
|
3357
3375
|
},
|
|
3358
3376
|
onRunStarted: () => {
|
|
3359
3377
|
},
|
|
@@ -3361,83 +3379,83 @@ function Cn({
|
|
|
3361
3379
|
P(N), K();
|
|
3362
3380
|
},
|
|
3363
3381
|
onMinimizeRun: ({ briefing: N, run: V }) => {
|
|
3364
|
-
|
|
3382
|
+
ge({ briefing: N, run: V }), D(!1);
|
|
3365
3383
|
}
|
|
3366
3384
|
}
|
|
3367
3385
|
)
|
|
3368
3386
|
]
|
|
3369
3387
|
}
|
|
3370
3388
|
),
|
|
3371
|
-
|
|
3372
|
-
|
|
3389
|
+
he && M && O ? /* @__PURE__ */ t(
|
|
3390
|
+
kn,
|
|
3373
3391
|
{
|
|
3374
|
-
briefingId:
|
|
3375
|
-
initialRun:
|
|
3376
|
-
apiServiceUrl:
|
|
3392
|
+
briefingId: he.briefing.id,
|
|
3393
|
+
initialRun: he.run,
|
|
3394
|
+
apiServiceUrl: M,
|
|
3377
3395
|
token: O,
|
|
3378
3396
|
onTerminal: (N) => {
|
|
3379
|
-
|
|
3380
|
-
briefing:
|
|
3397
|
+
Ce({
|
|
3398
|
+
briefing: he.briefing,
|
|
3381
3399
|
run: N
|
|
3382
|
-
}),
|
|
3400
|
+
}), ge(null), K();
|
|
3383
3401
|
},
|
|
3384
3402
|
onTimeout: () => {
|
|
3385
|
-
|
|
3403
|
+
ge(null), K();
|
|
3386
3404
|
},
|
|
3387
3405
|
onExpand: () => {
|
|
3388
|
-
P(
|
|
3406
|
+
P(he.briefing), C("author"), ge(null), D(!0);
|
|
3389
3407
|
}
|
|
3390
3408
|
}
|
|
3391
3409
|
) : null,
|
|
3392
|
-
|
|
3393
|
-
|
|
3410
|
+
Z ? /* @__PURE__ */ t("div", { className: "fixed bottom-4 right-4 z-50 w-[360px]", children: /* @__PURE__ */ t(
|
|
3411
|
+
ra,
|
|
3394
3412
|
{
|
|
3395
|
-
title:
|
|
3396
|
-
durationSeconds:
|
|
3413
|
+
title: Z.run.status === "SUCCESS" ? `${Z.briefing.name} is ready` : `${Z.briefing.name} run failed`,
|
|
3414
|
+
durationSeconds: Z.run.startedAt && Z.run.completedAt ? Math.max(
|
|
3397
3415
|
0,
|
|
3398
3416
|
Math.floor(
|
|
3399
|
-
(new Date(
|
|
3417
|
+
(new Date(Z.run.completedAt).getTime() - new Date(Z.run.startedAt).getTime()) / 1e3
|
|
3400
3418
|
)
|
|
3401
3419
|
) : null,
|
|
3402
|
-
status:
|
|
3420
|
+
status: Z.run.status === "SUCCESS" ? "success" : "failed",
|
|
3403
3421
|
onView: () => {
|
|
3404
|
-
P(
|
|
3422
|
+
P(Z.briefing), C("author"), Ce(null), D(!0);
|
|
3405
3423
|
},
|
|
3406
|
-
onDismiss: () =>
|
|
3424
|
+
onDismiss: () => Ce(null)
|
|
3407
3425
|
}
|
|
3408
3426
|
) }) : null,
|
|
3409
3427
|
/* @__PURE__ */ t(
|
|
3410
|
-
|
|
3428
|
+
ot,
|
|
3411
3429
|
{
|
|
3412
|
-
open: !!
|
|
3430
|
+
open: !!W,
|
|
3413
3431
|
onOpenChange: (N) => {
|
|
3414
|
-
N ||
|
|
3432
|
+
N || ee(null);
|
|
3415
3433
|
},
|
|
3416
|
-
children: /* @__PURE__ */ r(
|
|
3417
|
-
/* @__PURE__ */ r(
|
|
3418
|
-
/* @__PURE__ */ r(
|
|
3434
|
+
children: /* @__PURE__ */ r(it, { children: [
|
|
3435
|
+
/* @__PURE__ */ r(lt, { children: [
|
|
3436
|
+
/* @__PURE__ */ r(dt, { children: [
|
|
3419
3437
|
"Delete",
|
|
3420
3438
|
" ",
|
|
3421
|
-
|
|
3439
|
+
W ? oe(W).noun : "briefing",
|
|
3422
3440
|
"?"
|
|
3423
3441
|
] }),
|
|
3424
|
-
/* @__PURE__ */ r(
|
|
3442
|
+
/* @__PURE__ */ r(ct, { children: [
|
|
3425
3443
|
"This permanently deletes ",
|
|
3426
|
-
/* @__PURE__ */ t("strong", { children:
|
|
3444
|
+
/* @__PURE__ */ t("strong", { children: W == null ? void 0 : W.name }),
|
|
3427
3445
|
". Recipients will stop receiving it."
|
|
3428
3446
|
] })
|
|
3429
3447
|
] }),
|
|
3430
|
-
/* @__PURE__ */ r(
|
|
3431
|
-
/* @__PURE__ */ t(
|
|
3448
|
+
/* @__PURE__ */ r(ut, { children: [
|
|
3449
|
+
/* @__PURE__ */ t(ht, { children: "Cancel" }),
|
|
3432
3450
|
/* @__PURE__ */ r(
|
|
3433
|
-
|
|
3451
|
+
Tt,
|
|
3434
3452
|
{
|
|
3435
3453
|
className: "bg-destructive/90 hover:bg-destructive",
|
|
3436
|
-
onClick:
|
|
3454
|
+
onClick: ce,
|
|
3437
3455
|
children: [
|
|
3438
3456
|
"Delete",
|
|
3439
3457
|
" ",
|
|
3440
|
-
|
|
3458
|
+
W ? oe(W).noun : "briefing"
|
|
3441
3459
|
]
|
|
3442
3460
|
}
|
|
3443
3461
|
)
|
|
@@ -3447,24 +3465,24 @@ function Cn({
|
|
|
3447
3465
|
)
|
|
3448
3466
|
] }) : null;
|
|
3449
3467
|
}
|
|
3450
|
-
function
|
|
3468
|
+
function An() {
|
|
3451
3469
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
3452
3470
|
}
|
|
3453
3471
|
export {
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3472
|
+
Xn as A,
|
|
3473
|
+
Xa as D,
|
|
3474
|
+
qa as E,
|
|
3475
|
+
Qn as N,
|
|
3476
|
+
Kn as U,
|
|
3477
|
+
Hn as V,
|
|
3478
|
+
on as W,
|
|
3479
|
+
Gn as a,
|
|
3480
|
+
Ha as b,
|
|
3481
|
+
Yn as c,
|
|
3482
|
+
Zn as d,
|
|
3483
|
+
Ya as e,
|
|
3484
|
+
tn as f,
|
|
3485
|
+
Jn as g,
|
|
3486
|
+
es as h,
|
|
3487
|
+
qn as u
|
|
3470
3488
|
};
|