react-semaphor 0.1.461 → 0.1.462

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