react-semaphor 0.1.437 → 0.1.438

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/brand-studio/index.js +1 -1
  2. package/dist/chunks/{code-editor-C8zzmSgt.js → code-editor-25d16KDV.js} +34 -34
  3. package/dist/chunks/{dashboard-BJr7m1TP.js → dashboard-Cm4D_4sW.js} +167 -167
  4. package/dist/chunks/{dashboard--OqogTLn.js → dashboard-H2ONqclF.js} +16132 -16124
  5. package/dist/chunks/{dashboard-briefing-launcher-Cegf8sog.js → dashboard-briefing-launcher-B2ktS4sN.js} +881 -882
  6. package/dist/chunks/dashboard-briefing-launcher-BevUTBG_.js +31 -0
  7. package/dist/chunks/dashboard-controls-8G5EZjyA.js +36 -0
  8. package/dist/chunks/{dashboard-controls-BjWzQbOT.js → dashboard-controls-BMy5GxU5.js} +926 -906
  9. package/dist/chunks/{dashboard-json-BYHE2Xi7.js → dashboard-json-BLxeyDM2.js} +2 -2
  10. package/dist/chunks/{dashboard-json-D3rtzp8l.js → dashboard-json-DWF407Fp.js} +1 -1
  11. package/dist/chunks/{edit-dashboard-visual-3rc-aeNO.js → edit-dashboard-visual-C0-7PJ0V.js} +9 -9
  12. package/dist/chunks/{edit-dashboard-visual-BKTpoR38.js → edit-dashboard-visual-DCx9r7g2.js} +3168 -3147
  13. package/dist/chunks/{report-preferences-dialog-VVM61k5R.js → report-preferences-dialog-D98RpVTB.js} +2 -2
  14. package/dist/chunks/{report-preferences-dialog-CoYKKbFc.js → report-preferences-dialog-Sl3VZLDC.js} +1 -1
  15. package/dist/chunks/{use-create-flow-overlay-state-Doo8NeYf.js → use-create-flow-overlay-state-B7nbDg72.js} +1 -1
  16. package/dist/chunks/{use-create-flow-overlay-state-CpH9832I.js → use-create-flow-overlay-state-D2y57BqL.js} +2 -2
  17. package/dist/dashboard/index.cjs +1 -1
  18. package/dist/dashboard/index.js +1 -1
  19. package/dist/data-app-builder/index.cjs +1 -1
  20. package/dist/data-app-builder/index.js +2 -2
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +6 -6
  23. package/dist/surfboard/index.cjs +1 -1
  24. package/dist/surfboard/index.js +2 -2
  25. package/dist/types/dashboard.d.ts +4 -1
  26. package/dist/types/main.d.ts +4 -1
  27. package/dist/types/surfboard.d.ts +4 -1
  28. package/dist/types/types.d.ts +4 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/dashboard-briefing-launcher-BRjtoHFz.js +0 -31
  31. package/dist/chunks/dashboard-controls-DbOKYwbJ.js +0 -36
@@ -1,25 +1,25 @@
1
1
  import { jsx as e, jsxs as r, Fragment as W } from "react/jsx-runtime";
2
- import Wt, { useState as k, useEffect as J, useMemo as te, useContext as Ht, useRef as me, useCallback as G } from "react";
3
- import { aH as ke, aI as Ae, aK as Ee, bb as Ct, c1 as wt, cq as Gt, cr as qt, aZ as be, ce as Nt, br as Re, y as Kt, w as Xt, cs as Yt, aP as Je, aS as et, aT as tt, aU as rt, aV as at, aW as nt, aX as st, aY as St, bq as ot, aG as z, ct as Zt, cu as Qt, cv as qe, cf as ze, cg as _e, cw as Dt, ch as $e, b$ as H, b1 as Jt, bG as Ue, cx as er, b_ as tr, aJ as it, aL as lt, cy as rr, aF as ar, ba as nr, bp as kt, cz as sr, av as or, aM as ir, b3 as lr, az as je, at as he, a6 as ct, a3 as At, a2 as dt, as as Et, a4 as cr, Y as dr, cl as ur, cA as hr, bB as mr, N as ft, R as pr, au as fr, cB as gr, cC as br, cD as xr, cE as vr, cF as yr, cG as Cr, cH as wr, cI as Nr, cJ as It, cK as Sr, b4 as Dr, cL as kr, ci as Ft, cM as Ar, cN as Er, cO as Te, cP as Ir, cQ as Fr, cR as Lr, o as Br, aj as Tr, ae as Vr, T as Rr, ad as Ur, aa as Pr, Z as Mr, a9 as Or, cS as zr, cT as _r, cU as $r, cV as jr, cW as Wr, B as Hr, cX as Gr, cY as qr, a1 as Kr, cZ as Xr, c_ as Yr, c$ as Zr } from "./dashboard--OqogTLn.js";
4
- import { B as T, O as De, Z as Ze, L as re, M as Lt, d as Bt, c as q, K as Qr, E as xe, u as M, A as ve, aH as gt, a7 as Tt, a6 as Qe, D as Vt, S as ut, P as Pe, a as Me, b as Oe, aI as Jr, aJ as ea, aK as ta, aL as ra, aM as aa, aF as na } from "./code-editor-C8zzmSgt.js";
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 De, aI as ke, aK as Ae, bb as Ct, c1 as Ht, cr as Gt, cs as Kt, aZ as fe, cf as wt, br as Ve, y as qt, w as Xt, ct as Yt, aP as Je, aS as et, aT as tt, aU as rt, aV as at, aW as nt, aX as st, aY as Nt, bq as ot, aG as O, cu as Zt, cv as Qt, cw as Ke, cg as Oe, ch as ze, cx as St, ci as _e, b$ as K, b1 as Jt, bG as Re, cy as er, b_ as tr, aJ as it, aL as lt, cz as rr, aF as ar, ba as nr, bp as Dt, cA as sr, c2 as or, av as ir, aM as lr, b3 as cr, az as $e, at as ue, a6 as ct, a3 as kt, a2 as dt, as as At, a4 as dr, Y as ur, cm as hr, cB as mr, bB as pr, N as ft, R as fr, au as gr, cC as br, cD as xr, cE as vr, cF as yr, cG as Cr, cH as wr, cI as Nr, cJ as Sr, cK as Et, cL as Dr, b4 as kr, cM as Ar, cj as It, cN as Er, cO as Ir, cP as Be, cQ as Fr, cR as Lr, cS as Br, o as Tr, aj as Vr, ae as Rr, T as Ur, ad as Pr, aa as Mr, Z as Or, a9 as zr, cT as _r, cU as $r, cV as jr, cW as Wr, cX as Hr, B as Gr, cY as Kr, cZ as qr, a1 as Xr, c_ as Yr, c$ as Zr, d0 as Qr } from "./dashboard-H2ONqclF.js";
4
+ import { B, O as Se, Z as Ze, L as te, M as Ft, d as Lt, c as X, K as Jr, E as ge, u as P, A as be, aH as gt, a7 as Bt, a6 as Qe, D as Tt, S as ut, P as Ue, a as Pe, b as Me, aI as ea, aJ as ta, aK as ra, aL as aa, aM as na, aF as sa } from "./code-editor-25d16KDV.js";
5
5
  import { L as ht } from "./layout-grid-D5tYJg1-.js";
6
- import { c as ye, X as We, C as Rt } from "./index-xHCrHprY.js";
7
- import { u as mt, V as sa, E as Ke, a as Xe, b as oa, c as ia, L as la, d as ca, e as Ut, C as Pt, f as da } from "./use-create-flow-overlay-state-CpH9832I.js";
6
+ import { c as xe, X as je, C as Vt } from "./index-xHCrHprY.js";
7
+ import { u as mt, 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 } from "./use-create-flow-overlay-state-D2y57BqL.js";
8
8
  import "./analyze-result-contract-CfOBEwaC.js";
9
9
  import "../value-format-preferences/index.js";
10
- import { S as ua } from "./search-DHZCro8B.js";
10
+ import { S as ha } from "./search-DHZCro8B.js";
11
11
  import { j as bt } from "./csv-utils-BZDvO2Fw.js";
12
12
  import "./index-If0wlXGi.js";
13
13
  import "./comparison-document-migration-Dj6xZMCb.js";
14
14
  import "react-dom";
15
- import { getBriefingPresentation as oe, describeBriefingSchedule as ha, getBriefingCreationIntents as ma } from "../briefings/index.js";
15
+ import { getBriefingPresentation as se, describeBriefingSchedule as ma, getBriefingCreationIntents as pa } from "../briefings/index.js";
16
16
  /**
17
17
  * @license lucide-react v0.453.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
21
  */
22
- const pa = ye("ArrowUpRight", [
22
+ const fa = xe("ArrowUpRight", [
23
23
  ["path", { d: "M7 7h10v10", key: "1tivn9" }],
24
24
  ["path", { d: "M7 17 17 7", key: "1vkiza" }]
25
25
  ]);
@@ -29,7 +29,7 @@ const pa = ye("ArrowUpRight", [
29
29
  * This source code is licensed under the ISC license.
30
30
  * See the LICENSE file in the root directory of this source tree.
31
31
  */
32
- const fa = ye("CalendarRange", [
32
+ const ga = xe("CalendarRange", [
33
33
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
34
34
  ["path", { d: "M16 2v4", key: "4m81vk" }],
35
35
  ["path", { d: "M3 10h18", key: "8toen8" }],
@@ -45,7 +45,7 @@ const fa = ye("CalendarRange", [
45
45
  * This source code is licensed under the ISC license.
46
46
  * See the LICENSE file in the root directory of this source tree.
47
47
  */
48
- const ga = ye("CircleX", [
48
+ const ba = xe("CircleX", [
49
49
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
50
50
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
51
51
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -56,7 +56,7 @@ const ga = ye("CircleX", [
56
56
  * This source code is licensed under the ISC license.
57
57
  * See the LICENSE file in the root directory of this source tree.
58
58
  */
59
- const xt = ye("FileDown", [
59
+ const xt = xe("FileDown", [
60
60
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
61
61
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
62
62
  ["path", { d: "M12 18v-6", key: "17g6i2" }],
@@ -68,7 +68,7 @@ const xt = ye("FileDown", [
68
68
  * This source code is licensed under the ISC license.
69
69
  * See the LICENSE file in the root directory of this source tree.
70
70
  */
71
- const ba = ye("FilterX", [
71
+ const xa = xe("FilterX", [
72
72
  ["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
73
73
  ["path", { d: "m22 3-5 5", key: "12jva0" }],
74
74
  ["path", { d: "m17 3 5 5", key: "k36vhe" }]
@@ -79,7 +79,7 @@ const ba = ye("FilterX", [
79
79
  * This source code is licensed under the ISC license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
81
  */
82
- const xa = ye("Newspaper", [
82
+ const va = xe("Newspaper", [
83
83
  [
84
84
  "path",
85
85
  {
@@ -91,7 +91,7 @@ const xa = ye("Newspaper", [
91
91
  ["path", { d: "M15 18h-5", key: "95g1m2" }],
92
92
  ["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
93
93
  ]);
94
- function va() {
94
+ function ya() {
95
95
  return /* @__PURE__ */ e("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((t, a) => /* @__PURE__ */ r(
96
96
  "div",
97
97
  {
@@ -107,13 +107,13 @@ function va() {
107
107
  a
108
108
  )) });
109
109
  }
110
- function ya({
110
+ function Ca({
111
111
  open: t,
112
112
  onOpenChange: a,
113
113
  onSubmit: i,
114
114
  isCreating: s
115
115
  }) {
116
- const [n, c] = k(""), [u, m] = k("");
116
+ const [n, c] = E(""), [u, m] = E("");
117
117
  J(() => {
118
118
  t || (c(""), m(""));
119
119
  }, [t]);
@@ -122,8 +122,8 @@ function ya({
122
122
  }, d = (o) => {
123
123
  a(o);
124
124
  };
125
- return /* @__PURE__ */ e(ke, { open: t, onOpenChange: d, children: /* @__PURE__ */ r(
126
- Ae,
125
+ return /* @__PURE__ */ e(De, { open: t, onOpenChange: d, children: /* @__PURE__ */ r(
126
+ ke,
127
127
  {
128
128
  showCloseButton: !1,
129
129
  className: "flex max-w-lg grid-cols-none flex-col gap-0 overflow-hidden rounded-[6px] border-border/60 p-0 shadow-lg",
@@ -132,12 +132,12 @@ function ya({
132
132
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
133
133
  /* @__PURE__ */ e(ht, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
134
134
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
135
- /* @__PURE__ */ e(Ee, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
135
+ /* @__PURE__ */ e(Ae, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
136
136
  /* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
137
137
  ] })
138
138
  ] }),
139
139
  /* @__PURE__ */ e(
140
- T,
140
+ B,
141
141
  {
142
142
  size: "xs",
143
143
  variant: "ghost",
@@ -145,14 +145,14 @@ function ya({
145
145
  onClick: () => d(!1),
146
146
  "aria-label": "Close",
147
147
  disabled: s,
148
- children: /* @__PURE__ */ e(We, { className: "h-3.5 w-3.5" })
148
+ children: /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" })
149
149
  }
150
150
  )
151
151
  ] }),
152
152
  /* @__PURE__ */ r("div", { className: "space-y-3 px-4 py-3", children: [
153
153
  /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
154
154
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
155
- /* @__PURE__ */ e(De, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
155
+ /* @__PURE__ */ e(Se, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
156
156
  /* @__PURE__ */ e(
157
157
  Ze,
158
158
  {
@@ -169,7 +169,7 @@ function ya({
169
169
  )
170
170
  ] }),
171
171
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
172
- /* @__PURE__ */ e(De, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
172
+ /* @__PURE__ */ e(Se, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
173
173
  /* @__PURE__ */ e(
174
174
  Ze,
175
175
  {
@@ -185,7 +185,7 @@ function ya({
185
185
  ] }),
186
186
  /* @__PURE__ */ r("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
187
187
  /* @__PURE__ */ e(
188
- T,
188
+ B,
189
189
  {
190
190
  size: "xs",
191
191
  variant: "outline",
@@ -195,13 +195,13 @@ function ya({
195
195
  }
196
196
  ),
197
197
  /* @__PURE__ */ e(
198
- T,
198
+ B,
199
199
  {
200
200
  size: "xs",
201
201
  onClick: l,
202
202
  disabled: !n.trim() || s,
203
203
  children: s ? /* @__PURE__ */ r(W, { children: [
204
- /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin" }),
204
+ /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin" }),
205
205
  "Creating..."
206
206
  ] }) : "Create library visual"
207
207
  }
@@ -211,199 +211,199 @@ function ya({
211
211
  }
212
212
  ) });
213
213
  }
214
- function Mt(t) {
214
+ function Pt(t) {
215
215
  return t ? new Date(t).toLocaleDateString("en-US", {
216
216
  month: "short",
217
217
  day: "numeric",
218
218
  year: "numeric"
219
219
  }) : "Unknown";
220
220
  }
221
- function Ot(t, a) {
221
+ function Mt(t, a) {
222
222
  var s;
223
223
  const i = (s = t.ownership.createdBy) == null ? void 0 : s.type;
224
224
  return i === "tenant" || i === "organization" && a;
225
225
  }
226
226
  function pt(t, a) {
227
227
  var i, s;
228
- return Ot(t, a) ? ((i = t.ownership.createdBy) == null ? void 0 : i.name) || ((s = t.createdByTenantUserRel) == null ? void 0 : s.name) || t.lastModifiedBy || "Unknown" : "Organization";
228
+ 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";
229
229
  }
230
- function Ca(t, a) {
230
+ function wa(t, a) {
231
231
  return pt(t, a).split(/\s+/).filter(Boolean).slice(0, 2).map((s) => s.charAt(0).toUpperCase()).join("") || "?";
232
232
  }
233
- function wa(t) {
233
+ function Na(t) {
234
234
  const a = (t || "").toLowerCase();
235
- return a.includes("table") ? Lt : a.includes("pie") || a.includes("donut") ? Zt : a.includes("line") ? Qt : a.includes("bar") ? Qr : ht;
235
+ return a.includes("table") ? Ft : a.includes("pie") || a.includes("donut") ? Zt : a.includes("line") ? Qt : a.includes("bar") ? Jr : ht;
236
236
  }
237
- function Na({ visual: t }) {
237
+ function Sa({ visual: t }) {
238
238
  const a = t.ownership.status === "public" ? "Public" : t.ownership.status === "shared" || t.ownership.sharedCount > 0 ? "Shared" : "Private";
239
239
  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 });
240
240
  }
241
- function Rn({
241
+ function Un({
242
242
  open: t,
243
243
  onOpenChange: a
244
244
  }) {
245
- const [i, s] = k(""), [n, c] = k(/* @__PURE__ */ new Set()), [u, m] = k(!1), [l, d] = k(
245
+ const [i, s] = E(""), [n, c] = E(/* @__PURE__ */ new Set()), [u, m] = E(!1), [l, d] = E(
246
246
  null
247
- ), [o, f] = k(
247
+ ), [o, f] = E(
248
248
  null
249
- ), [h, p] = k(!1), [y, v] = k(null), [A, E] = k(null), N = () => {
250
- c(/* @__PURE__ */ new Set()), d(null), f(null), p(!1), v(null);
249
+ ), [h, p] = E(!1), [C, y] = E(null), [D, I] = E(null), N = () => {
250
+ c(/* @__PURE__ */ new Set()), d(null), f(null), p(!1), y(null);
251
251
  }, g = () => {
252
252
  a(!1), N();
253
- }, { selectVisual: S } = Ct(), { handleAddLibraryVisual: D, handleEditLibraryVisual: P } = mt(), { isConsoleMode: b } = wt(), {
254
- resources: C,
255
- isLoading: F,
256
- isError: L,
257
- createResource: K,
258
- updateResource: V,
259
- deleteResourceAsync: R,
260
- duplicateResource: I,
261
- isCreating: pe,
262
- isDeleting: X
253
+ }, { selectVisual: S } = Ct(), { handleAddLibraryVisual: k, handleEditLibraryVisual: U } = mt(), { isConsoleMode: b } = Ht(), {
254
+ resources: x,
255
+ isLoading: T,
256
+ isError: F,
257
+ createResource: H,
258
+ updateResource: A,
259
+ deleteResourceAsync: V,
260
+ duplicateResource: j,
261
+ isCreating: ve,
262
+ isDeleting: G
263
263
  } = Gt(
264
264
  void 0,
265
- (x) => {
266
- m(!1), x && (S(x), P(x), g());
265
+ (v) => {
266
+ m(!1), v && (S(v), U(v), g());
267
267
  }
268
268
  ), {
269
- startUpdating: Ce,
270
- stopUpdating: ee,
269
+ startUpdating: We,
270
+ stopUpdating: ye,
271
271
  isUpdating: He
272
- } = qt(), Z = C, _ = te(() => {
273
- const x = i.trim().toLowerCase();
274
- return x ? Z.filter(
275
- (B) => {
276
- var O, ne, ie;
277
- return ((O = B.title) == null ? void 0 : O.toLowerCase().includes(x)) || ((ne = B.description) == null ? void 0 : ne.toLowerCase().includes(x)) || ((ie = B.kind) == null ? void 0 : ie.toLowerCase().includes(x));
272
+ } = Kt(), Z = x, z = ee(() => {
273
+ const v = i.trim().toLowerCase();
274
+ return v ? Z.filter(
275
+ (L) => {
276
+ var M, ae, oe;
277
+ 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));
278
278
  }
279
279
  ) : Z;
280
- }, [i, Z]), ae = te(
280
+ }, [i, Z]), re = ee(
281
281
  () => Z.filter(
282
- (x) => n.has(x.id)
282
+ (v) => n.has(v.id)
283
283
  ),
284
284
  [n, Z]
285
- ), le = ae.filter(
286
- (x) => x.permissions.canDelete
287
- ), ce = ae.filter(
288
- (x) => x.permissions.canShare
289
- ), we = _.length > 0 && _.every(
290
- (x) => n.has(x.id)
291
- ), Ie = _.some(
292
- (x) => n.has(x.id)
293
- ), de = (x) => {
294
- const B = new Set(n);
295
- x(B), c(B);
296
- }, fe = (x) => {
297
- de((B) => {
298
- B.has(x) ? B.delete(x) : B.add(x);
285
+ ), ie = re.filter(
286
+ (v) => v.permissions.canDelete
287
+ ), le = re.filter(
288
+ (v) => v.permissions.canShare
289
+ ), Ce = z.length > 0 && z.every(
290
+ (v) => n.has(v.id)
291
+ ), Ee = z.some(
292
+ (v) => n.has(v.id)
293
+ ), ce = (v) => {
294
+ const L = new Set(n);
295
+ v(L), c(L);
296
+ }, me = (v) => {
297
+ ce((L) => {
298
+ L.has(v) ? L.delete(v) : L.add(v);
299
299
  });
300
300
  }, Q = () => {
301
- c((x) => {
302
- const B = new Set(x);
303
- return we ? _.forEach(
304
- (O) => B.delete(O.id)
305
- ) : _.forEach(
306
- (O) => B.add(O.id)
307
- ), B;
301
+ c((v) => {
302
+ const L = new Set(v);
303
+ return Ce ? z.forEach(
304
+ (M) => L.delete(M.id)
305
+ ) : z.forEach(
306
+ (M) => L.add(M.id)
307
+ ), L;
308
308
  });
309
- }, Ne = async (x) => {
310
- (await D(x)).success && g();
311
- }, $ = async () => {
312
- const x = ae;
313
- if (x.length === 0) return;
314
- let B = !1;
315
- for (const O of x)
316
- if (!(await D(O)).success) {
317
- B = !0;
309
+ }, we = async (v) => {
310
+ (await k(v)).success && g();
311
+ }, _ = async () => {
312
+ const v = re;
313
+ if (v.length === 0) return;
314
+ let L = !1;
315
+ for (const M of v)
316
+ if (!(await k(M)).success) {
317
+ L = !0;
318
318
  break;
319
319
  }
320
- B || g();
321
- }, j = (x) => {
322
- P(x), g();
323
- }, se = (x) => {
324
- E(x), I(x, {
325
- onSettled: () => E(null)
320
+ L || g();
321
+ }, $ = (v) => {
322
+ U(v), g();
323
+ }, ne = (v) => {
324
+ I(v), j(v, {
325
+ onSettled: () => I(null)
326
326
  });
327
- }, ge = () => {
328
- if (le.length === 0) {
329
- z.error("Select a visual you can delete");
327
+ }, pe = () => {
328
+ if (ie.length === 0) {
329
+ O.error("Select a visual you can delete");
330
330
  return;
331
331
  }
332
- v(null), p(!0);
333
- }, Fe = async () => {
334
- const x = y ? [y] : le;
332
+ y(null), p(!0);
333
+ }, Ie = async () => {
334
+ const v = C ? [C] : ie;
335
335
  try {
336
- for (const B of x)
337
- await R(B.id);
338
- c((B) => {
339
- const O = new Set(B);
340
- return x.forEach(
341
- (ne) => O.delete(ne.id)
342
- ), O;
343
- }), p(!1), v(null);
336
+ for (const L of v)
337
+ await V(L.id);
338
+ c((L) => {
339
+ const M = new Set(L);
340
+ return v.forEach(
341
+ (ae) => M.delete(ae.id)
342
+ ), M;
343
+ }), p(!1), y(null);
344
344
  } catch {
345
345
  }
346
346
  }, Ge = () => {
347
- if (ae.length !== 1) {
348
- z.error("Select one visual to share");
347
+ if (re.length !== 1) {
348
+ O.error("Select one visual to share");
349
349
  return;
350
350
  }
351
- const [x] = ae;
352
- if (!x.permissions.canShare) {
353
- z.error("You do not have permission to share this visual");
351
+ const [v] = re;
352
+ if (!v.permissions.canShare) {
353
+ O.error("You do not have permission to share this visual");
354
354
  return;
355
355
  }
356
- d(x);
357
- }, Se = ({
358
- title: x,
359
- description: B
356
+ d(v);
357
+ }, Ne = ({
358
+ title: v,
359
+ description: L
360
360
  }) => {
361
361
  if (!o) return;
362
- const O = {};
363
- if (x !== o.title && (O.title = x), (o.description || "") !== B && (O.description = B), Object.keys(O).length === 0) {
362
+ const M = {};
363
+ if (v !== o.title && (M.title = v), (o.description || "") !== L && (M.description = L), Object.keys(M).length === 0) {
364
364
  f(null);
365
365
  return;
366
366
  }
367
- const ne = Object.keys(O), ie = ne.length === 1 ? ne[0] : void 0;
368
- Ce(o.id, ie), V(
367
+ const ae = Object.keys(M), oe = ae.length === 1 ? ae[0] : void 0;
368
+ We(o.id, oe), A(
369
369
  {
370
370
  resourceId: o.id,
371
- data: O
371
+ data: M
372
372
  },
373
373
  {
374
374
  onSuccess: () => {
375
- ee(o.id, ie), f(null);
375
+ ye(o.id, oe), f(null);
376
376
  },
377
377
  onError: () => {
378
- ee(o.id, ie);
378
+ ye(o.id, oe);
379
379
  }
380
380
  }
381
381
  );
382
- }, ue = (x) => {
383
- a(x), x || N();
384
- }, Y = y ? 1 : le.length;
382
+ }, de = (v) => {
383
+ a(v), v || N();
384
+ }, Y = C ? 1 : ie.length;
385
385
  return /* @__PURE__ */ r(W, { children: [
386
- /* @__PURE__ */ e(ke, { open: t, onOpenChange: ue, children: /* @__PURE__ */ r(
387
- Ae,
386
+ /* @__PURE__ */ e(De, { open: t, onOpenChange: de, children: /* @__PURE__ */ r(
387
+ ke,
388
388
  {
389
389
  showCloseButton: !1,
390
390
  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",
391
391
  children: [
392
392
  /* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
393
393
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
394
- /* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
394
+ /* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
395
395
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
396
- /* @__PURE__ */ e(Ee, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
396
+ /* @__PURE__ */ e(Ae, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
397
397
  /* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
398
398
  ] })
399
399
  ] }),
400
400
  /* @__PURE__ */ e(
401
- T,
401
+ B,
402
402
  {
403
403
  size: "xs",
404
404
  variant: "ghost",
405
405
  className: "w-7 px-0 text-muted-foreground hover:text-foreground",
406
- onClick: () => ue(!1),
406
+ onClick: () => de(!1),
407
407
  "aria-label": "Close visuals library",
408
408
  children: "×"
409
409
  }
@@ -411,13 +411,13 @@ function Rn({
411
411
  ] }),
412
412
  /* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
413
413
  /* @__PURE__ */ r("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
414
- /* @__PURE__ */ e(ua, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
414
+ /* @__PURE__ */ e(ha, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
415
415
  /* @__PURE__ */ e(
416
416
  "input",
417
417
  {
418
418
  autoFocus: !0,
419
419
  value: i,
420
- onChange: (x) => s(x.target.value),
420
+ onChange: (v) => s(v.target.value),
421
421
  placeholder: "Search visuals...",
422
422
  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",
423
423
  "aria-label": "Search visuals"
@@ -425,42 +425,42 @@ function Rn({
425
425
  )
426
426
  ] }),
427
427
  /* @__PURE__ */ r(
428
- T,
428
+ B,
429
429
  {
430
430
  size: "xs",
431
431
  variant: "outline",
432
432
  className: "ml-auto",
433
433
  onClick: () => m(!0),
434
434
  children: [
435
- /* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" }),
435
+ /* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" }),
436
436
  "New library visual"
437
437
  ]
438
438
  }
439
439
  )
440
440
  ] }),
441
- /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: F ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(va, {}) }) : L ? /* @__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" }) }) : _.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
441
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: T ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(ya, {}) }) : 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: [
442
442
  /* @__PURE__ */ e(ht, { className: "h-5 w-5 text-muted-foreground/60" }),
443
443
  /* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: i ? "No visuals found" : "No visuals yet" }),
444
444
  /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: i ? "Try a different search." : "Create a saved visual to add it here." })
445
445
  ] }) : /* @__PURE__ */ e(
446
- Sa,
446
+ Da,
447
447
  {
448
- visuals: _,
448
+ visuals: z,
449
449
  selectedIds: n,
450
- allFilteredSelected: we,
451
- someFilteredSelected: Ie,
450
+ allFilteredSelected: Ce,
451
+ someFilteredSelected: Ee,
452
452
  onSelectAll: Q,
453
- onToggleSelection: fe,
454
- onAddVisual: Ne,
455
- onOpenVisual: j,
453
+ onToggleSelection: me,
454
+ onAddVisual: we,
455
+ onOpenVisual: $,
456
456
  onEditDetails: f,
457
457
  onShareVisual: d,
458
- onDeleteVisual: (x) => {
459
- v(x), p(!0);
458
+ onDeleteVisual: (v) => {
459
+ y(v), p(!0);
460
460
  },
461
- onDuplicateVisual: se,
462
- duplicatingId: A,
463
- isDeleting: X,
461
+ onDuplicateVisual: ne,
462
+ duplicatingId: D,
463
+ isDeleting: G,
464
464
  isConsoleMode: b
465
465
  }
466
466
  ) }),
@@ -472,7 +472,7 @@ function Rn({
472
472
  "selected"
473
473
  ] }),
474
474
  /* @__PURE__ */ e(
475
- T,
475
+ B,
476
476
  {
477
477
  size: "xs",
478
478
  variant: "ghost",
@@ -481,52 +481,52 @@ function Rn({
481
481
  }
482
482
  ),
483
483
  /* @__PURE__ */ r(
484
- T,
484
+ B,
485
485
  {
486
486
  size: "xs",
487
487
  variant: "outline",
488
488
  onClick: Ge,
489
- disabled: ae.length !== 1 || ce.length !== 1,
489
+ disabled: re.length !== 1 || le.length !== 1,
490
490
  children: [
491
- /* @__PURE__ */ e(Nt, { className: "h-3.5 w-3.5" }),
491
+ /* @__PURE__ */ e(wt, { className: "h-3.5 w-3.5" }),
492
492
  "Share"
493
493
  ]
494
494
  }
495
495
  ),
496
496
  /* @__PURE__ */ r(
497
- T,
497
+ B,
498
498
  {
499
499
  size: "xs",
500
500
  variant: "outline",
501
501
  className: "text-destructive hover:text-destructive",
502
- onClick: ge,
503
- disabled: le.length === 0,
502
+ onClick: pe,
503
+ disabled: ie.length === 0,
504
504
  children: [
505
- /* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5" }),
505
+ /* @__PURE__ */ e(Ve, { className: "h-3.5 w-3.5" }),
506
506
  "Delete ",
507
- le.length || n.size
507
+ ie.length || n.size
508
508
  ]
509
509
  }
510
510
  )
511
511
  ] }) }),
512
512
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
513
513
  /* @__PURE__ */ e(
514
- T,
514
+ B,
515
515
  {
516
516
  size: "xs",
517
517
  variant: "outline",
518
- onClick: () => ue(!1),
518
+ onClick: () => de(!1),
519
519
  children: "Close"
520
520
  }
521
521
  ),
522
522
  /* @__PURE__ */ r(
523
- T,
523
+ B,
524
524
  {
525
525
  size: "xs",
526
- onClick: $,
526
+ onClick: _,
527
527
  disabled: n.size === 0,
528
528
  children: [
529
- /* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" }),
529
+ /* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5" }),
530
530
  n.size === 0 ? "Add to dashboard" : `Add ${n.size} visual${n.size === 1 ? "" : "s"}`
531
531
  ]
532
532
  }
@@ -537,16 +537,16 @@ function Rn({
537
537
  }
538
538
  ) }),
539
539
  /* @__PURE__ */ e(
540
- ya,
540
+ Ca,
541
541
  {
542
542
  open: u,
543
543
  onOpenChange: m,
544
- onSubmit: K,
545
- isCreating: pe
544
+ onSubmit: H,
545
+ isCreating: ve
546
546
  }
547
547
  ),
548
548
  l && /* @__PURE__ */ e(
549
- Kt,
549
+ qt,
550
550
  {
551
551
  resource: l,
552
552
  resourceType: Xt.VISUAL,
@@ -561,7 +561,7 @@ function Rn({
561
561
  initialTitle: o.title || "",
562
562
  initialDescription: o.description || "",
563
563
  onClose: () => f(null),
564
- onSave: Se,
564
+ onSave: Ne,
565
565
  isSaving: He(o.id)
566
566
  }
567
567
  ),
@@ -569,8 +569,8 @@ function Rn({
569
569
  Je,
570
570
  {
571
571
  open: h,
572
- onOpenChange: (x) => {
573
- !x && X || (p(x), x || v(null));
572
+ onOpenChange: (v) => {
573
+ !v && G || (p(v), v || y(null));
574
574
  },
575
575
  children: /* @__PURE__ */ r(et, { children: [
576
576
  /* @__PURE__ */ r(tt, { children: [
@@ -584,17 +584,17 @@ function Rn({
584
584
  /* @__PURE__ */ e(at, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
585
585
  ] }),
586
586
  /* @__PURE__ */ r(nt, { children: [
587
- /* @__PURE__ */ e(st, { disabled: X, children: "Cancel" }),
587
+ /* @__PURE__ */ e(st, { disabled: G, children: "Cancel" }),
588
588
  /* @__PURE__ */ r(
589
- St,
589
+ Nt,
590
590
  {
591
- onClick: (x) => {
592
- x.preventDefault(), Fe();
591
+ onClick: (v) => {
592
+ v.preventDefault(), Ie();
593
593
  },
594
- disabled: X || Y === 0,
594
+ disabled: G || Y === 0,
595
595
  children: [
596
- X ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5" }),
597
- X ? "Deleting..." : "Delete"
596
+ G ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Ve, { className: "h-3.5 w-3.5" }),
597
+ G ? "Deleting..." : "Delete"
598
598
  ]
599
599
  }
600
600
  )
@@ -604,7 +604,7 @@ function Rn({
604
604
  )
605
605
  ] });
606
606
  }
607
- function Sa({
607
+ function Da({
608
608
  visuals: t,
609
609
  selectedIds: a,
610
610
  allFilteredSelected: i,
@@ -619,7 +619,7 @@ function Sa({
619
619
  onDuplicateVisual: f,
620
620
  duplicatingId: h,
621
621
  isDeleting: p,
622
- isConsoleMode: y
622
+ isConsoleMode: C
623
623
  }) {
624
624
  return /* @__PURE__ */ r("div", { className: "min-w-[48rem]", children: [
625
625
  /* @__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: [
@@ -638,11 +638,11 @@ function Sa({
638
638
  /* @__PURE__ */ e("span", { className: "text-right", children: "Shared" }),
639
639
  /* @__PURE__ */ e("span", { className: "text-right", children: "Actions" })
640
640
  ] }),
641
- t.map((v) => /* @__PURE__ */ e(
642
- Da,
641
+ t.map((y) => /* @__PURE__ */ e(
642
+ ka,
643
643
  {
644
- visual: v,
645
- selected: a.has(v.id),
644
+ visual: y,
645
+ selected: a.has(y.id),
646
646
  onToggleSelection: c,
647
647
  onAddVisual: u,
648
648
  onOpenVisual: m,
@@ -652,13 +652,13 @@ function Sa({
652
652
  onDuplicateVisual: f,
653
653
  duplicatingId: h,
654
654
  isDeleting: p,
655
- isConsoleMode: y
655
+ isConsoleMode: C
656
656
  },
657
- v.id
657
+ y.id
658
658
  ))
659
659
  ] });
660
660
  }
661
- function Da({
661
+ function ka({
662
662
  visual: t,
663
663
  selected: a,
664
664
  onToggleSelection: i,
@@ -672,14 +672,14 @@ function Da({
672
672
  isDeleting: o,
673
673
  isConsoleMode: f
674
674
  }) {
675
- var y;
676
- const h = wa(t.kind), p = () => {
675
+ var C;
676
+ const h = Na(t.kind), p = () => {
677
677
  s(t);
678
678
  };
679
679
  return /* @__PURE__ */ r(
680
680
  "div",
681
681
  {
682
- className: q(
682
+ className: X(
683
683
  "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",
684
684
  a && "bg-muted/70"
685
685
  ),
@@ -710,7 +710,7 @@ function Da({
710
710
  children: t.title || "Untitled Visual"
711
711
  }
712
712
  ),
713
- ((y = t.description) == null ? void 0 : y.trim()) && /* @__PURE__ */ e(
713
+ ((C = t.description) == null ? void 0 : C.trim()) && /* @__PURE__ */ e(
714
714
  "div",
715
715
  {
716
716
  className: "truncate text-[11px] text-muted-foreground",
@@ -723,14 +723,14 @@ function Da({
723
723
  }
724
724
  ),
725
725
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
726
- /* @__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: Ca(t, f) }),
726
+ /* @__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: wa(t, f) }),
727
727
  /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: pt(t, f) })
728
728
  ] }),
729
- /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: Mt(t.updatedAt) }),
730
- /* @__PURE__ */ e(Na, { visual: t }),
729
+ /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: Pt(t.updatedAt) }),
730
+ /* @__PURE__ */ e(Sa, { visual: t }),
731
731
  /* @__PURE__ */ e("span", { className: "text-right tabular-nums text-muted-foreground", children: t.ownership.sharedCount > 0 ? t.ownership.sharedCount : "—" }),
732
732
  /* @__PURE__ */ e(
733
- ka,
733
+ Aa,
734
734
  {
735
735
  visual: t,
736
736
  onOpenVisual: n,
@@ -747,7 +747,7 @@ function Da({
747
747
  }
748
748
  );
749
749
  }
750
- function ka({
750
+ function Aa({
751
751
  visual: t,
752
752
  onOpenVisual: a,
753
753
  onEditDetails: i,
@@ -765,80 +765,80 @@ function ka({
765
765
  onClick: (d) => d.stopPropagation(),
766
766
  children: [
767
767
  /* @__PURE__ */ e(
768
- T,
768
+ B,
769
769
  {
770
770
  size: "xs",
771
771
  variant: "ghost",
772
772
  className: "w-7 px-0",
773
773
  onClick: () => a(t),
774
774
  "aria-label": "Edit visual",
775
- children: /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" })
775
+ children: /* @__PURE__ */ e(Ke, { className: "h-3.5 w-3.5" })
776
776
  }
777
777
  ),
778
- /* @__PURE__ */ r(ze, { modal: !1, children: [
779
- /* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(
780
- T,
778
+ /* @__PURE__ */ r(Oe, { modal: !1, children: [
779
+ /* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ e(
780
+ B,
781
781
  {
782
782
  size: "xs",
783
783
  variant: "ghost",
784
784
  className: "w-7 px-0",
785
785
  "aria-label": "More actions",
786
- children: /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" })
786
+ children: /* @__PURE__ */ e(St, { className: "h-3.5 w-3.5" })
787
787
  }
788
788
  ) }),
789
789
  /* @__PURE__ */ r(
790
- $e,
790
+ _e,
791
791
  {
792
792
  align: "end",
793
793
  className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
794
794
  children: [
795
- /* @__PURE__ */ r(H, { onClick: () => a(t), children: [
796
- /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" }),
795
+ /* @__PURE__ */ r(K, { onClick: () => a(t), children: [
796
+ /* @__PURE__ */ e(Ke, { className: "h-3.5 w-3.5" }),
797
797
  "Edit visual"
798
798
  ] }),
799
799
  /* @__PURE__ */ r(
800
- H,
800
+ K,
801
801
  {
802
802
  onClick: () => c(t.id),
803
803
  disabled: u === t.id,
804
804
  children: [
805
- u === t.id ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Jt, { className: "h-3.5 w-3.5" }),
805
+ 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" }),
806
806
  u === t.id ? "Duplicating..." : "Duplicate"
807
807
  ]
808
808
  }
809
809
  ),
810
- t.permissions.canEdit && /* @__PURE__ */ r(H, { onClick: () => i(t), children: [
811
- /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" }),
810
+ t.permissions.canEdit && /* @__PURE__ */ r(K, { onClick: () => i(t), children: [
811
+ /* @__PURE__ */ e(Ke, { className: "h-3.5 w-3.5" }),
812
812
  "Edit details"
813
813
  ] }),
814
- t.permissions.canShare && /* @__PURE__ */ r(H, { onClick: () => s(t), children: [
815
- /* @__PURE__ */ e(Nt, { className: "h-3.5 w-3.5" }),
814
+ t.permissions.canShare && /* @__PURE__ */ r(K, { onClick: () => s(t), children: [
815
+ /* @__PURE__ */ e(wt, { className: "h-3.5 w-3.5" }),
816
816
  "Share"
817
817
  ] }),
818
818
  t.permissions.canDelete && /* @__PURE__ */ r(W, { children: [
819
- /* @__PURE__ */ e(Ue, {}),
819
+ /* @__PURE__ */ e(Re, {}),
820
820
  /* @__PURE__ */ r(
821
- H,
821
+ K,
822
822
  {
823
823
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
824
824
  onClick: () => n(t),
825
825
  disabled: m,
826
826
  children: [
827
- /* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5" }),
827
+ /* @__PURE__ */ e(Ve, { className: "h-3.5 w-3.5" }),
828
828
  m ? "Deleting..." : "Delete"
829
829
  ]
830
830
  }
831
831
  )
832
832
  ] }),
833
- /* @__PURE__ */ e(Ue, {}),
833
+ /* @__PURE__ */ e(Re, {}),
834
834
  /* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
835
- Ot(t, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
835
+ Mt(t, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
836
836
  /* @__PURE__ */ e(er, { className: "h-3 w-3" }),
837
837
  /* @__PURE__ */ e("span", { className: "truncate", children: pt(t, l) })
838
838
  ] }),
839
839
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
840
840
  /* @__PURE__ */ e(tr, { className: "h-3 w-3" }),
841
- /* @__PURE__ */ e("span", { children: Mt(t.updatedAt) })
841
+ /* @__PURE__ */ e("span", { children: Pt(t.updatedAt) })
842
842
  ] })
843
843
  ] })
844
844
  ]
@@ -849,7 +849,7 @@ function ka({
849
849
  }
850
850
  );
851
851
  }
852
- function Aa({
852
+ function Ea({
853
853
  open: t,
854
854
  onOpenChange: a,
855
855
  isLibraryVisual: i,
@@ -858,10 +858,10 @@ function Aa({
858
858
  destinationMode: c = "both",
859
859
  onConfirm: u
860
860
  }) {
861
- const [m, l] = k(
861
+ const [m, l] = E(
862
862
  i && s ? `Copy of ${s}` : s || ""
863
- ), [d, o] = k("");
864
- Wt.useEffect(() => {
863
+ ), [d, o] = E("");
864
+ jt.useEffect(() => {
865
865
  t && (l(
866
866
  i && s ? `Copy of ${s}` : s || ""
867
867
  ), o(""));
@@ -892,12 +892,12 @@ function Aa({
892
892
  saveToCurrentDashboard: h.saveToCurrentDashboard
893
893
  });
894
894
  };
895
- return /* @__PURE__ */ e(ke, { open: t, onOpenChange: a, children: /* @__PURE__ */ r(Ae, { className: "sm:max-w-[500px]", children: [
895
+ return /* @__PURE__ */ e(De, { open: t, onOpenChange: a, children: /* @__PURE__ */ r(ke, { className: "sm:max-w-[500px]", children: [
896
896
  /* @__PURE__ */ r(it, { children: [
897
- /* @__PURE__ */ r(Ee, { className: "flex items-center gap-2", children: [
897
+ /* @__PURE__ */ r(Ae, { className: "flex items-center gap-2", children: [
898
898
  /* @__PURE__ */ e("span", { children: "Save Visual As" }),
899
899
  h.badgeType !== "local" && /* @__PURE__ */ e(
900
- sa,
900
+ oa,
901
901
  {
902
902
  type: h.badgeType,
903
903
  showLabel: !0,
@@ -909,26 +909,26 @@ function Aa({
909
909
  ] }),
910
910
  /* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
911
911
  /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
912
- /* @__PURE__ */ e(De, { htmlFor: "name", children: "Name" }),
912
+ /* @__PURE__ */ e(Se, { htmlFor: "name", children: "Name" }),
913
913
  /* @__PURE__ */ e(
914
914
  Ze,
915
915
  {
916
916
  id: "name",
917
917
  value: m,
918
- onChange: (y) => l(y.target.value),
918
+ onChange: (C) => l(C.target.value),
919
919
  placeholder: "Enter visual name",
920
920
  disabled: n
921
921
  }
922
922
  )
923
923
  ] }),
924
924
  /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
925
- /* @__PURE__ */ e(De, { htmlFor: "description", children: "Description (optional)" }),
925
+ /* @__PURE__ */ e(Se, { htmlFor: "description", children: "Description (optional)" }),
926
926
  /* @__PURE__ */ e(
927
927
  rr,
928
928
  {
929
929
  id: "description",
930
930
  value: d,
931
- onChange: (y) => o(y.target.value),
931
+ onChange: (C) => o(C.target.value),
932
932
  placeholder: "Enter visual description",
933
933
  rows: 3,
934
934
  disabled: n
@@ -938,7 +938,7 @@ function Aa({
938
938
  ] }),
939
939
  /* @__PURE__ */ r(ar, { children: [
940
940
  /* @__PURE__ */ e(
941
- T,
941
+ B,
942
942
  {
943
943
  variant: "outline",
944
944
  onClick: () => a(!1),
@@ -946,36 +946,36 @@ function Aa({
946
946
  children: "Cancel"
947
947
  }
948
948
  ),
949
- /* @__PURE__ */ r(T, { onClick: p, disabled: !f || n, children: [
950
- n && /* @__PURE__ */ e(re, { className: "mr-2 h-4 w-4 animate-spin" }),
949
+ /* @__PURE__ */ r(B, { onClick: p, disabled: !f || n, children: [
950
+ n && /* @__PURE__ */ e(te, { className: "mr-2 h-4 w-4 animate-spin" }),
951
951
  h.actionLabel
952
952
  ] })
953
953
  ] })
954
954
  ] }) });
955
955
  }
956
- function Ea() {
957
- const [t, a] = k(!1), [i, s] = k(!1), [n, c] = k(null), [u, m] = k(null), l = xe((b) => b.frame), d = xe((b) => b.card), o = nr(), f = M((b) => b.selectedSheetId), h = M((b) => b.dashboard), { getUpdatedFrame: p } = mt(), { selectVisual: y } = Ct(), { addFrame: v, setSelectedFrameId: A, setIsVisualEditing: E } = ve(), N = kt(), g = !!(l != null && l.visualId), S = (() => {
958
- var b, C;
959
- return ((b = l == null ? void 0 : l.cards) == null ? void 0 : b.length) === 1 && ((C = l.cards[0]) != null && C.title) ? l.cards[0].title : o != null && o.title ? o.title : (d == null ? void 0 : d.title) || "Untitled Visual";
960
- })(), D = sr((b) => {
961
- b != null && b.id && (y(b), i && n && u && f && (async () => {
956
+ function Ia() {
957
+ 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 } = mt(), { selectVisual: C } = Ct(), { addFrame: y, setSelectedFrameId: D, setIsVisualEditing: I } = be(), N = Dt(), g = !!(l != null && l.visualId), S = (() => {
958
+ var b, x;
959
+ 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";
960
+ })(), k = sr((b) => {
961
+ b != null && b.id && (C(b), i && n && u && f && (async () => {
962
962
  try {
963
- const C = {
963
+ const x = {
964
964
  ...n,
965
965
  id: gt(),
966
966
  visualId: b.id
967
967
  // Link to the newly created library visual
968
968
  };
969
- v(f, C, {
969
+ y(f, x, {
970
970
  position: "end",
971
971
  semanticExecutionPayload: u
972
- }), A(C.id), s(!1), c(null), m(null), E(!1);
973
- } catch (C) {
972
+ }), D(x.id), s(!1), c(null), m(null), I(!1);
973
+ } catch (x) {
974
974
  console.error(
975
975
  "Failed to promote semantic metadata for saved visual:",
976
- C
977
- ), z.error(
978
- C instanceof Error ? C.message : "Failed to prepare semantic metadata for the saved visual"
976
+ x
977
+ ), O.error(
978
+ x instanceof Error ? x.message : "Failed to prepare semantic metadata for the saved visual"
979
979
  );
980
980
  }
981
981
  })(), a(!1));
@@ -985,89 +985,88 @@ function Ea() {
985
985
  setSaveAsDialogOpen: a,
986
986
  handleSaveAs: async (b) => {
987
987
  if (!f) {
988
- z.error("No sheet selected");
988
+ O.error("No sheet selected");
989
989
  return;
990
990
  }
991
- const C = p(), F = Tt(C);
992
- if (F) {
993
- z.error(F);
991
+ const x = p(), T = Bt(x);
992
+ if (T) {
993
+ O.error(T);
994
994
  return;
995
995
  }
996
- const K = C.cards.length === 1 ? {
997
- ...C,
998
- cards: C.cards.map((V) => ({
999
- ...V,
996
+ const H = x.cards.length === 1 ? {
997
+ ...x,
998
+ cards: x.cards.map((A) => ({
999
+ ...A,
1000
1000
  title: b.name
1001
1001
  // Use visual name as card title
1002
1002
  }))
1003
- } : C;
1003
+ } : x;
1004
1004
  if (b.saveToLibrary) {
1005
- let V = null;
1005
+ let A = null;
1006
1006
  if (b.saveToCurrentDashboard)
1007
1007
  try {
1008
- V = await N(K, {
1009
- previousFrame: Qe(h, K.id)
1008
+ A = await N(H, {
1009
+ previousFrame: Qe(h, H.id)
1010
1010
  });
1011
- } catch (I) {
1011
+ } catch (j) {
1012
1012
  console.error(
1013
1013
  "Failed to prepare semantic metadata before saving visual:",
1014
- I
1015
- ), z.error(
1016
- I instanceof Error ? I.message : "Failed to prepare semantic metadata for the saved visual"
1014
+ j
1015
+ ), O.error(
1016
+ j instanceof Error ? j.message : "Failed to prepare semantic metadata for the saved visual"
1017
1017
  );
1018
1018
  return;
1019
1019
  }
1020
- s(b.saveToCurrentDashboard), c(K), m(V);
1021
- const R = {
1020
+ s(b.saveToCurrentDashboard), c(H), m(A);
1021
+ const V = {
1022
1022
  title: b.name,
1023
1023
  description: b.description,
1024
- frameObject: K,
1024
+ frameObject: H,
1025
1025
  // Card title synced for single-card frames
1026
1026
  isPrivate: !1
1027
1027
  };
1028
- D.mutate(R);
1028
+ k.mutate(V);
1029
1029
  } else if (b.saveToCurrentDashboard) {
1030
- const V = {
1031
- ...K,
1030
+ const A = {
1031
+ ...H,
1032
1032
  // Card title already synced
1033
1033
  id: gt(),
1034
1034
  visualId: void 0
1035
1035
  // Explicitly no visualId for local visuals
1036
1036
  };
1037
1037
  try {
1038
- const R = await N(K, {
1039
- previousFrame: Qe(h, K.id)
1038
+ const V = await N(H, {
1039
+ previousFrame: Qe(h, H.id)
1040
1040
  });
1041
- v(f, V, {
1041
+ y(f, A, {
1042
1042
  position: "end",
1043
- semanticExecutionPayload: R
1044
- }), A(V.id), z.success("Visual saved to dashboard"), a(!1), E(!1);
1045
- } catch (R) {
1046
- console.error("Failed to save visual to dashboard:", R), z.error(
1047
- R instanceof Error ? R.message : "Failed to prepare semantic metadata for the visual"
1043
+ semanticExecutionPayload: V
1044
+ }), D(A.id), O.success("Visual saved to dashboard"), a(!1), I(!1);
1045
+ } catch (V) {
1046
+ console.error("Failed to save visual to dashboard:", V), O.error(
1047
+ V instanceof Error ? V.message : "Failed to prepare semantic metadata for the visual"
1048
1048
  );
1049
1049
  }
1050
1050
  }
1051
1051
  },
1052
1052
  isLibraryVisual: g,
1053
1053
  currentVisualName: S,
1054
- isSaving: D.isPending
1054
+ isSaving: k.isPending
1055
1055
  };
1056
1056
  }
1057
- function Un(t = {}) {
1058
- var R;
1059
- const { preferences: a } = wt(), i = ((R = a == null ? void 0 : a.uiMode) == null ? void 0 : R.inspection) === !0, s = xe((I) => I.frame), n = xe((I) => I.editorContext), c = or((I) => I.selectedVisual), u = M((I) => I.selectedFrameId), m = M((I) => I.selectedSheetId), l = M((I) => I.dashboard), { setIsVisualEditing: d, updateFrame: o } = ve(), [f, h] = k(!1), [p, y] = k("both"), v = kt(), A = (n == null ? void 0 : n.type) === "documentSection", E = !!(s != null && s.visualId || c != null && c.id), N = !!(s != null && s.visualId && u), g = E && !N, {
1060
- saveAsDialogOpen: S,
1061
- setSaveAsDialogOpen: D,
1062
- handleSaveAs: P,
1063
- isLibraryVisual: b,
1064
- currentVisualName: C,
1065
- isSaving: F
1066
- } = Ea(), { getUpdatedFrame: L } = mt();
1067
- if (i)
1057
+ function Pn(t = {}) {
1058
+ 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 = Dt(), 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, {
1059
+ saveAsDialogOpen: g,
1060
+ setSaveAsDialogOpen: S,
1061
+ handleSaveAs: k,
1062
+ isLibraryVisual: U,
1063
+ currentVisualName: b,
1064
+ isSaving: x
1065
+ } = Ia(), { getUpdatedFrame: T } = mt();
1066
+ if (a)
1068
1067
  return /* @__PURE__ */ r(W, { children: [
1069
1068
  /* @__PURE__ */ e(
1070
- Ke,
1069
+ qe,
1071
1070
  {
1072
1071
  className: "rounded-control",
1073
1072
  variant: "default"
@@ -1075,112 +1074,112 @@ function Un(t = {}) {
1075
1074
  ),
1076
1075
  /* @__PURE__ */ e(Xe, {})
1077
1076
  ] });
1078
- if (A)
1077
+ if (y)
1079
1078
  return /* @__PURE__ */ r(W, { children: [
1080
- /* @__PURE__ */ e(Ke, { className: "rounded-control", variant: "default" }),
1079
+ /* @__PURE__ */ e(qe, { className: "rounded-control", variant: "default" }),
1081
1080
  /* @__PURE__ */ e(Xe, {})
1082
1081
  ] });
1083
- const K = async () => {
1084
- if (!m) {
1085
- z.error("No sheet selected");
1082
+ const F = async () => {
1083
+ if (!u) {
1084
+ O.error("No sheet selected");
1086
1085
  return;
1087
1086
  }
1088
- if (f) return;
1089
- h(!0);
1090
- const I = L(), pe = Tt(I);
1091
- if (pe) {
1092
- h(!1), z.error(pe);
1087
+ if (o) return;
1088
+ f(!0);
1089
+ const A = T(), V = Bt(A);
1090
+ if (V) {
1091
+ f(!1), O.error(V);
1093
1092
  return;
1094
1093
  }
1095
- const X = {
1096
- ...I,
1094
+ const j = {
1095
+ ...A,
1097
1096
  visualId: void 0
1098
- }, Ce = Qe(l, X.id);
1097
+ }, ve = Qe(m, j.id);
1099
1098
  try {
1100
- const ee = await v(X, {
1101
- previousFrame: Ce
1099
+ const G = await C(j, {
1100
+ previousFrame: ve
1102
1101
  });
1103
- o(m, X, {
1104
- semanticExecutionPayload: ee
1102
+ d(u, j, {
1103
+ semanticExecutionPayload: G
1105
1104
  });
1106
- } catch (ee) {
1107
- console.error("Failed to apply local semantic metadata:", ee), h(!1), z.error(
1108
- ee instanceof Error ? ee.message : "Failed to prepare semantic metadata for this visual"
1105
+ } catch (G) {
1106
+ console.error("Failed to apply local semantic metadata:", G), f(!1), O.error(
1107
+ G instanceof Error ? G.message : "Failed to prepare semantic metadata for this visual"
1109
1108
  );
1110
1109
  return;
1111
1110
  }
1112
1111
  setTimeout(() => {
1113
- h(!1), z.success("Changes applied. Visual is now local to this dashboard"), d(!1);
1112
+ f(!1), O.success("Changes applied. Visual is now local to this dashboard"), l(!1);
1114
1113
  }, 300);
1115
- }, V = (I) => {
1116
- y(I), D(!0);
1114
+ }, H = (A) => {
1115
+ p(A), S(!0);
1117
1116
  };
1118
1117
  return /* @__PURE__ */ r(W, { children: [
1119
1118
  /* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
1120
- !E && /* @__PURE__ */ e(Ke, { className: "!rounded-none", variant: "default" }),
1121
- E && g && /* @__PURE__ */ e(oa, { className: "!rounded-none", variant: "default" }),
1122
- E && N && /* @__PURE__ */ e(ia, { className: "!rounded-none" }),
1123
- /* @__PURE__ */ r(ze, { modal: !1, children: [
1124
- /* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(
1125
- T,
1119
+ !D && /* @__PURE__ */ e(qe, { className: "!rounded-none", variant: "default" }),
1120
+ D && N && /* @__PURE__ */ e(ia, { className: "!rounded-none", variant: "default" }),
1121
+ D && I && /* @__PURE__ */ e(la, { className: "!rounded-none" }),
1122
+ /* @__PURE__ */ r(Oe, { modal: !1, children: [
1123
+ /* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ e(
1124
+ B,
1126
1125
  {
1127
1126
  variant: "default",
1128
1127
  size: "xs",
1129
1128
  className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
1130
1129
  "aria-label": "Open visual save options",
1131
- disabled: F || f,
1132
- children: /* @__PURE__ */ e(Rt, { className: "h-3.5 w-3.5" })
1130
+ disabled: x || o,
1131
+ children: /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5" })
1133
1132
  }
1134
1133
  ) }),
1135
1134
  /* @__PURE__ */ r(
1136
- $e,
1135
+ _e,
1137
1136
  {
1138
1137
  align: "end",
1139
1138
  className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
1140
1139
  children: [
1141
- N && /* @__PURE__ */ r(W, { children: [
1140
+ I && /* @__PURE__ */ r(W, { children: [
1142
1141
  /* @__PURE__ */ r(
1143
- H,
1142
+ K,
1144
1143
  {
1145
- onClick: K,
1146
- disabled: f,
1144
+ onClick: F,
1145
+ disabled: o,
1147
1146
  children: [
1148
- /* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" }),
1149
- f ? "Applying..." : "Apply Locally"
1147
+ /* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5" }),
1148
+ o ? "Applying..." : "Apply Locally"
1150
1149
  ]
1151
1150
  }
1152
1151
  ),
1153
- /* @__PURE__ */ e(Ue, {})
1152
+ /* @__PURE__ */ e(Re, {})
1154
1153
  ] }),
1155
1154
  /* @__PURE__ */ r(
1156
- H,
1155
+ K,
1157
1156
  {
1158
- onClick: () => V("local"),
1159
- disabled: F,
1157
+ onClick: () => H("local"),
1158
+ disabled: x,
1160
1159
  children: [
1161
- /* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" }),
1160
+ /* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" }),
1162
1161
  "Add to Dashboard (Local)"
1163
1162
  ]
1164
1163
  }
1165
1164
  ),
1166
1165
  /* @__PURE__ */ r(
1167
- H,
1166
+ K,
1168
1167
  {
1169
- onClick: () => V("library"),
1170
- disabled: F,
1168
+ onClick: () => H("library"),
1169
+ disabled: x,
1171
1170
  children: [
1172
- /* @__PURE__ */ e(la, { className: "h-3.5 w-3.5" }),
1171
+ /* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" }),
1173
1172
  "Save as Library Visual"
1174
1173
  ]
1175
1174
  }
1176
1175
  ),
1177
1176
  /* @__PURE__ */ r(
1178
- H,
1177
+ K,
1179
1178
  {
1180
- onClick: () => V("both"),
1181
- disabled: F,
1179
+ onClick: () => H("both"),
1180
+ disabled: x,
1182
1181
  children: [
1183
- /* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" }),
1182
+ /* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" }),
1184
1183
  "Save Copy as Linked Visual"
1185
1184
  ]
1186
1185
  }
@@ -1192,26 +1191,26 @@ function Un(t = {}) {
1192
1191
  ] }),
1193
1192
  /* @__PURE__ */ e(Xe, {}),
1194
1193
  /* @__PURE__ */ e(
1195
- Aa,
1194
+ Ea,
1196
1195
  {
1197
- open: S,
1198
- onOpenChange: (I) => {
1199
- F || D(I);
1196
+ open: g,
1197
+ onOpenChange: (A) => {
1198
+ x || S(A);
1200
1199
  },
1201
- isLibraryVisual: b,
1202
- currentVisualName: C,
1203
- isSaving: F,
1204
- destinationMode: p,
1205
- onConfirm: P
1200
+ isLibraryVisual: U,
1201
+ currentVisualName: b,
1202
+ isSaving: x,
1203
+ destinationMode: h,
1204
+ onConfirm: k
1206
1205
  }
1207
1206
  )
1208
1207
  ] });
1209
1208
  }
1210
- function Pn({ className: t }) {
1211
- const a = xe((d) => d.isDevMode), i = M((d) => d.isVisualEditing), { setIsDevMode: s } = Vt(), { config: n } = Ht(ir).tokenProps, c = (n == null ? void 0 : n.showAdvancedMode) !== !1;
1209
+ function Mn({ className: t }) {
1210
+ const a = ge((d) => d.isDevMode), i = P((d) => d.isVisualEditing), { setIsDevMode: s } = Tt(), { config: n } = Wt(lr).tokenProps, c = (n == null ? void 0 : n.showAdvancedMode) !== !1;
1212
1211
  if (!i || !c)
1213
1212
  return null;
1214
- const u = a ? ut : lr, m = a ? "Drag & drop" : "SQL", l = a ? "Switch to drag-and-drop mode" : "Switch to SQL mode";
1213
+ const u = a ? ut : cr, m = a ? "Drag & drop" : "SQL", l = a ? "Switch to drag-and-drop mode" : "Switch to SQL mode";
1215
1214
  return /* @__PURE__ */ r(
1216
1215
  "button",
1217
1216
  {
@@ -1219,7 +1218,7 @@ function Pn({ className: t }) {
1219
1218
  "aria-label": l,
1220
1219
  title: l,
1221
1220
  onClick: () => s(!a),
1222
- className: q(
1221
+ className: X(
1223
1222
  "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",
1224
1223
  t
1225
1224
  ),
@@ -1230,7 +1229,7 @@ function Pn({ className: t }) {
1230
1229
  }
1231
1230
  );
1232
1231
  }
1233
- function Mn({
1232
+ function On({
1234
1233
  open: t,
1235
1234
  onOpenChange: a,
1236
1235
  onSave: i,
@@ -1251,7 +1250,7 @@ function Mn({
1251
1250
  ] }),
1252
1251
  /* @__PURE__ */ r(nt, { children: [
1253
1252
  /* @__PURE__ */ e(
1254
- T,
1253
+ B,
1255
1254
  {
1256
1255
  type: "button",
1257
1256
  size: "xs",
@@ -1263,23 +1262,23 @@ function Mn({
1263
1262
  }
1264
1263
  ),
1265
1264
  /* @__PURE__ */ e(st, { disabled: n, children: m }),
1266
- /* @__PURE__ */ e(T, { type: "button", size: "xs", onClick: i, disabled: n, children: n ? /* @__PURE__ */ r(W, { children: [
1267
- /* @__PURE__ */ e(re, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
1265
+ /* @__PURE__ */ e(B, { type: "button", size: "xs", onClick: i, disabled: n, children: n ? /* @__PURE__ */ r(W, { children: [
1266
+ /* @__PURE__ */ e(te, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
1268
1267
  "Saving..."
1269
1268
  ] }) : d })
1270
1269
  ] })
1271
1270
  ] }) });
1272
1271
  }
1273
- const Ia = 1e4, Fa = 15e3, La = 3e4, Ba = 3e4, Ta = 12e4, vt = 2 * 60 * 60 * 1e3;
1274
- function Va(t) {
1272
+ const Fa = 1e4, La = 15e3, Ba = 3e4, Ta = 3e4, Va = 12e4, vt = 2 * 60 * 60 * 1e3;
1273
+ function Ra(t) {
1275
1274
  const a = Date.now() - t.getTime();
1276
- return a < Ba ? Ia : a < Ta ? Fa : La;
1275
+ return a < Ta ? Fa : a < Va ? La : Ba;
1277
1276
  }
1278
- function On() {
1279
- const { authToken: t, tokenProps: a } = je(), i = he((h) => h.activeExports), [s, n] = k(
1277
+ function zn() {
1278
+ const { authToken: t, tokenProps: a } = $e(), i = ue((h) => h.activeExports), [s, n] = E(
1280
1279
  typeof document < "u" ? !document.hidden : !0
1281
- ), c = me(null), u = me(!1), m = me(void 0), l = a == null ? void 0 : a.apiServiceUrl, d = t == null ? void 0 : t.accessToken, o = G(() => {
1282
- const h = he.getState().activeExports;
1280
+ ), 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(() => {
1281
+ const h = ue.getState().activeExports;
1283
1282
  return Array.from(h.values()).filter(
1284
1283
  (p) => ct(p.status)
1285
1284
  );
@@ -1293,7 +1292,7 @@ function On() {
1293
1292
  document.removeEventListener("visibilitychange", h);
1294
1293
  };
1295
1294
  }, []);
1296
- const f = G(async () => {
1295
+ const f = q(async () => {
1297
1296
  if (!l || !d) {
1298
1297
  u.current = !1;
1299
1298
  return;
@@ -1303,37 +1302,37 @@ function On() {
1303
1302
  u.current = !1;
1304
1303
  return;
1305
1304
  }
1306
- const p = Date.now(), y = h.filter(
1305
+ const p = Date.now(), C = h.filter(
1307
1306
  (g) => p - g.startedAt.getTime() > vt
1308
1307
  );
1309
- if (y.length > 0) {
1310
- const { updateExport: g } = he.getState().actions;
1311
- for (const S of y)
1308
+ if (C.length > 0) {
1309
+ const { updateExport: g } = ue.getState().actions;
1310
+ for (const S of C)
1312
1311
  g(S.id, {
1313
1312
  status: "failed",
1314
1313
  error: "Export timed out. Please try again or contact support.",
1315
1314
  lastUpdatedAt: /* @__PURE__ */ new Date()
1316
1315
  });
1317
1316
  }
1318
- const v = h.filter(
1317
+ const y = h.filter(
1319
1318
  (g) => p - g.startedAt.getTime() <= vt
1320
1319
  );
1321
- if (v.length === 0) {
1320
+ if (y.length === 0) {
1322
1321
  u.current = !1;
1323
1322
  return;
1324
1323
  }
1325
- const A = await Promise.allSettled(
1326
- v.map(async (g) => {
1324
+ const D = await Promise.allSettled(
1325
+ y.map(async (g) => {
1327
1326
  try {
1328
- const S = await At(l, d, g.id);
1329
- let D;
1327
+ const S = await kt(l, d, g.id);
1328
+ let k;
1330
1329
  if (S.status === "completed")
1331
1330
  try {
1332
- D = await dt(l, d, g.id);
1333
- } catch (P) {
1331
+ k = await dt(l, d, g.id);
1332
+ } catch (U) {
1334
1333
  console.error(
1335
1334
  `[useExportPolling] Failed to get download URL for ${g.id}:`,
1336
- P
1335
+ U
1337
1336
  );
1338
1337
  }
1339
1338
  return {
@@ -1345,7 +1344,7 @@ function On() {
1345
1344
  lastUpdatedAt: /* @__PURE__ */ new Date(),
1346
1345
  fileSize: S.fileSize,
1347
1346
  error: S.error,
1348
- downloadUrl: D
1347
+ downloadUrl: k
1349
1348
  };
1350
1349
  } catch (S) {
1351
1350
  return console.error(
@@ -1354,18 +1353,18 @@ function On() {
1354
1353
  ), null;
1355
1354
  }
1356
1355
  })
1357
- ), { updateExport: E } = he.getState().actions;
1358
- for (const g of A)
1359
- g.status === "fulfilled" && g.value && E(g.value.id, g.value);
1356
+ ), { updateExport: I } = ue.getState().actions;
1357
+ for (const g of D)
1358
+ g.status === "fulfilled" && g.value && I(g.value.id, g.value);
1360
1359
  const N = o();
1361
1360
  if (N.length > 0 && !document.hidden) {
1362
1361
  const g = N.reduce(
1363
- (D, P) => P.startedAt < D ? P.startedAt : D,
1362
+ (k, U) => U.startedAt < k ? U.startedAt : k,
1364
1363
  N[0].startedAt
1365
- ), S = Va(g);
1364
+ ), S = Ra(g);
1366
1365
  c.current && clearTimeout(c.current), c.current = setTimeout(() => {
1367
- var D;
1368
- (D = m.current) == null || D.call(m);
1366
+ var k;
1367
+ (k = m.current) == null || k.call(m);
1369
1368
  }, S);
1370
1369
  } else
1371
1370
  u.current = !1;
@@ -1389,13 +1388,13 @@ function On() {
1389
1388
  inProgressCount: o().length
1390
1389
  };
1391
1390
  }
1392
- function zn() {
1393
- const { authToken: t, tokenProps: a } = je(), i = he((m) => m.activeExports), { addExport: s } = Et(), n = me(!1), c = a == null ? void 0 : a.apiServiceUrl, u = t == null ? void 0 : t.accessToken;
1391
+ function _n() {
1392
+ const { authToken: t, tokenProps: a } = $e(), i = ue((m) => m.activeExports), { addExport: s } = At(), n = he(!1), c = a == null ? void 0 : a.apiServiceUrl, u = t == null ? void 0 : t.accessToken;
1394
1393
  J(() => {
1395
1394
  if (n.current || !c || !u) return;
1396
1395
  (async () => {
1397
1396
  try {
1398
- const { exports: l } = await cr(c, u, {
1397
+ const { exports: l } = await dr(c, u, {
1399
1398
  status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
1400
1399
  limit: 20
1401
1400
  // Limit to recent exports
@@ -1417,7 +1416,7 @@ function zn() {
1417
1416
  id: d.id,
1418
1417
  status: d.status,
1419
1418
  progress: o,
1420
- title: Ra(d),
1419
+ title: Ua(d),
1421
1420
  totalRows: d.totalRows,
1422
1421
  totalChunks: d.totalChunks,
1423
1422
  completedChunks: d.completedChunks,
@@ -1438,12 +1437,12 @@ function zn() {
1438
1437
  })();
1439
1438
  }, [c, u, s, i]);
1440
1439
  }
1441
- function Ra(t) {
1440
+ function Ua(t) {
1442
1441
  return t.title ? t.title : ct(
1443
1442
  t.status
1444
1443
  ) ? "Export in progress..." : t.status === "completed" ? "Export completed" : t.status === "failed" ? "Export failed" : "Export";
1445
1444
  }
1446
- function Ua({
1445
+ function Pa({
1447
1446
  export: t,
1448
1447
  onRemove: a
1449
1448
  }) {
@@ -1454,11 +1453,11 @@ function Ua({
1454
1453
  }, n = () => {
1455
1454
  switch (t.status) {
1456
1455
  case "completed":
1457
- return /* @__PURE__ */ e(mr, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
1456
+ return /* @__PURE__ */ e(pr, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
1458
1457
  case "failed":
1459
- return /* @__PURE__ */ e(ga, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
1458
+ return /* @__PURE__ */ e(ba, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
1460
1459
  default:
1461
- return /* @__PURE__ */ e(re, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
1460
+ return /* @__PURE__ */ e(te, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
1462
1461
  }
1463
1462
  }, c = ct(t.status), u = (() => {
1464
1463
  switch (t.status) {
@@ -1487,7 +1486,7 @@ function Ua({
1487
1486
  ] }),
1488
1487
  t.fileSize && /* @__PURE__ */ r(W, { children: [
1489
1488
  /* @__PURE__ */ e("span", { children: "•" }),
1490
- /* @__PURE__ */ e("span", { children: dr(t.fileSize) })
1489
+ /* @__PURE__ */ e("span", { children: ur(t.fileSize) })
1491
1490
  ] })
1492
1491
  ] }),
1493
1492
  c && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: u }),
@@ -1495,14 +1494,14 @@ function Ua({
1495
1494
  ] })
1496
1495
  ] }),
1497
1496
  /* @__PURE__ */ e(
1498
- T,
1497
+ B,
1499
1498
  {
1500
1499
  variant: "ghost",
1501
1500
  size: "icon",
1502
1501
  className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
1503
1502
  onClick: s,
1504
1503
  "aria-label": "Remove notification",
1505
- children: /* @__PURE__ */ e(We, { className: "h-4 w-4" })
1504
+ children: /* @__PURE__ */ e(je, { className: "h-4 w-4" })
1506
1505
  }
1507
1506
  )
1508
1507
  ] }),
@@ -1510,21 +1509,21 @@ function Ua({
1510
1509
  t.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
1511
1510
  /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: bt(t.startedAt, { addSuffix: !0 }) }),
1512
1511
  t.downloadUrl && /* @__PURE__ */ r(
1513
- T,
1512
+ B,
1514
1513
  {
1515
1514
  size: "sm",
1516
1515
  variant: "outline",
1517
1516
  className: "h-8 bg-transparent",
1518
1517
  onClick: i,
1519
1518
  children: [
1520
- /* @__PURE__ */ e(ur, { className: "mr-1.5 h-3.5 w-3.5" }),
1519
+ /* @__PURE__ */ e(hr, { className: "mr-1.5 h-3.5 w-3.5" }),
1521
1520
  "Download"
1522
1521
  ]
1523
1522
  }
1524
1523
  )
1525
1524
  ] }),
1526
1525
  c && /* @__PURE__ */ r("div", { children: [
1527
- /* @__PURE__ */ e(hr, { value: t.progress, className: "h-1.5" }),
1526
+ /* @__PURE__ */ e(mr, { value: t.progress, className: "h-1.5" }),
1528
1527
  /* @__PURE__ */ r("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
1529
1528
  t.progress,
1530
1529
  "% complete"
@@ -1534,31 +1533,31 @@ function Ua({
1534
1533
  ] })
1535
1534
  ] });
1536
1535
  }
1537
- function Pa() {
1538
- const { authToken: t, tokenProps: a } = je(), i = he((v) => v.activeExports), { clearCompleted: s, removeExport: n, updateExport: c } = Et(), [u, m] = k(!1), [l, d] = k(!1), o = Array.from(i.values()).sort(
1539
- (v, A) => A.startedAt.getTime() - v.startedAt.getTime()
1536
+ function Ma() {
1537
+ const { authToken: t, tokenProps: a } = $e(), i = ue((y) => y.activeExports), { clearCompleted: s, removeExport: n, updateExport: c } = At(), [u, m] = E(!1), [l, d] = E(!1), o = Array.from(i.values()).sort(
1538
+ (y, D) => D.startedAt.getTime() - y.startedAt.getTime()
1540
1539
  ), f = o.some(
1541
- (v) => v.status === "completed" || v.status === "failed"
1542
- ), h = G(async () => {
1543
- const v = a == null ? void 0 : a.apiServiceUrl, A = t == null ? void 0 : t.accessToken;
1544
- if (!(!v || !A)) {
1540
+ (y) => y.status === "completed" || y.status === "failed"
1541
+ ), h = q(async () => {
1542
+ const y = a == null ? void 0 : a.apiServiceUrl, D = t == null ? void 0 : t.accessToken;
1543
+ if (!(!y || !D)) {
1545
1544
  m(!0);
1546
1545
  try {
1547
- const E = Array.from(i.values());
1546
+ const I = Array.from(i.values());
1548
1547
  await Promise.all(
1549
- E.map(async (N) => {
1548
+ I.map(async (N) => {
1550
1549
  try {
1551
- const g = await At(v, A, N.id);
1550
+ const g = await kt(y, D, N.id);
1552
1551
  let S;
1553
1552
  if (g.status === "completed")
1554
1553
  try {
1555
1554
  S = await dt(
1556
- v,
1557
- A,
1555
+ y,
1556
+ D,
1558
1557
  N.id
1559
1558
  );
1560
- } catch (D) {
1561
- console.error(`Failed to get download URL for ${N.id}:`, D);
1559
+ } catch (k) {
1560
+ console.error(`Failed to get download URL for ${N.id}:`, k);
1562
1561
  }
1563
1562
  c(N.id, {
1564
1563
  status: g.status,
@@ -1584,18 +1583,18 @@ function Pa() {
1584
1583
  t == null ? void 0 : t.accessToken,
1585
1584
  a == null ? void 0 : a.apiServiceUrl,
1586
1585
  c
1587
- ]), p = G(async () => {
1588
- const v = a == null ? void 0 : a.apiServiceUrl, A = t == null ? void 0 : t.accessToken;
1589
- if (!v || !A) {
1586
+ ]), p = q(async () => {
1587
+ const y = a == null ? void 0 : a.apiServiceUrl, D = t == null ? void 0 : t.accessToken;
1588
+ if (!y || !D) {
1590
1589
  s();
1591
1590
  return;
1592
1591
  }
1593
1592
  d(!0);
1594
1593
  try {
1595
- const E = o.filter(
1594
+ const I = o.filter(
1596
1595
  (g) => g.status === "completed" || g.status === "failed"
1597
1596
  ), N = await Promise.allSettled(
1598
- E.map(async (g) => (await ft(v, A, g.id), g.id))
1597
+ I.map(async (g) => (await ft(y, D, g.id), g.id))
1599
1598
  );
1600
1599
  for (const g of N)
1601
1600
  g.status === "fulfilled" ? n(g.value) : console.error("Failed to delete export:", g.reason);
@@ -1608,17 +1607,17 @@ function Pa() {
1608
1607
  t == null ? void 0 : t.accessToken,
1609
1608
  s,
1610
1609
  n
1611
- ]), y = G(
1612
- async (v) => {
1613
- const A = a == null ? void 0 : a.apiServiceUrl, E = t == null ? void 0 : t.accessToken;
1614
- if (A && E)
1610
+ ]), C = q(
1611
+ async (y) => {
1612
+ const D = a == null ? void 0 : a.apiServiceUrl, I = t == null ? void 0 : t.accessToken;
1613
+ if (D && I)
1615
1614
  try {
1616
- await ft(A, E, v), n(v);
1615
+ await ft(D, I, y), n(y);
1617
1616
  return;
1618
1617
  } catch (N) {
1619
- console.error(`Failed to cancel export ${v}:`, N);
1618
+ console.error(`Failed to cancel export ${y}:`, N);
1620
1619
  }
1621
- n(v);
1620
+ n(y);
1622
1621
  },
1623
1622
  [a == null ? void 0 : a.apiServiceUrl, t == null ? void 0 : t.accessToken, n]
1624
1623
  );
@@ -1634,7 +1633,7 @@ function Pa() {
1634
1633
  ] }),
1635
1634
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
1636
1635
  /* @__PURE__ */ e(
1637
- T,
1636
+ B,
1638
1637
  {
1639
1638
  variant: "ghost",
1640
1639
  size: "sm",
@@ -1643,7 +1642,7 @@ function Pa() {
1643
1642
  disabled: u,
1644
1643
  title: "Refresh status",
1645
1644
  children: /* @__PURE__ */ e(
1646
- pr,
1645
+ fr,
1647
1646
  {
1648
1647
  className: `h-4 w-4 ${u ? "animate-spin" : ""}`
1649
1648
  }
@@ -1651,7 +1650,7 @@ function Pa() {
1651
1650
  }
1652
1651
  ),
1653
1652
  f && /* @__PURE__ */ e(
1654
- T,
1653
+ B,
1655
1654
  {
1656
1655
  variant: "ghost",
1657
1656
  size: "sm",
@@ -1663,32 +1662,32 @@ function Pa() {
1663
1662
  )
1664
1663
  ] })
1665
1664
  ] }),
1666
- /* @__PURE__ */ e("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y", children: o.map((v) => /* @__PURE__ */ e(
1667
- Ua,
1665
+ /* @__PURE__ */ e("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y", children: o.map((y) => /* @__PURE__ */ e(
1666
+ Pa,
1668
1667
  {
1669
- export: v,
1670
- onRemove: y
1668
+ export: y,
1669
+ onRemove: C
1671
1670
  },
1672
- v.id
1671
+ y.id
1673
1672
  )) }) })
1674
1673
  ] });
1675
1674
  }
1676
- function _n({
1675
+ function $n({
1677
1676
  variant: t
1678
1677
  }) {
1679
- const a = he((l) => l.activeExports), i = fr(), s = a.size > 0, n = Array.from(a.values()).some(
1678
+ const a = ue((l) => l.activeExports), i = gr(), s = a.size > 0, n = Array.from(a.values()).some(
1680
1679
  (l) => l.status === "completed" || l.status === "failed"
1681
1680
  ), u = i > 0 ? i > 9 ? "9+" : String(i) : null;
1682
- return /* @__PURE__ */ r(Pe, { children: [
1683
- /* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ r(
1684
- T,
1681
+ return /* @__PURE__ */ r(Ue, { children: [
1682
+ /* @__PURE__ */ e(Pe, { asChild: !0, children: /* @__PURE__ */ r(
1683
+ B,
1685
1684
  {
1686
1685
  variant: t ?? "ghost",
1687
1686
  size: "xs",
1688
1687
  className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
1689
1688
  "aria-label": "Export notifications",
1690
1689
  children: [
1691
- /* @__PURE__ */ e(gr, { className: "h-3.5 w-3.5" }),
1690
+ /* @__PURE__ */ e(br, { className: "h-3.5 w-3.5" }),
1692
1691
  s && /* @__PURE__ */ e(
1693
1692
  "span",
1694
1693
  {
@@ -1699,10 +1698,10 @@ function _n({
1699
1698
  ]
1700
1699
  }
1701
1700
  ) }),
1702
- /* @__PURE__ */ e(Oe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ e(Pa, {}) })
1701
+ /* @__PURE__ */ e(Me, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ e(Ma, {}) })
1703
1702
  ] });
1704
1703
  }
1705
- function Ma(t) {
1704
+ function Oa(t) {
1706
1705
  if (t)
1707
1706
  return {
1708
1707
  renamed: t.type === "rename" ? { oldId: t.oldId, newId: t.newId } : void 0,
@@ -1711,7 +1710,7 @@ function Ma(t) {
1711
1710
  affectedBindingControlIds: t.type === "add" || t.type === "update" ? t.affectedBindingControlIds : void 0
1712
1711
  };
1713
1712
  }
1714
- function Oa({
1713
+ function za({
1715
1714
  open: t,
1716
1715
  onOpenChange: a,
1717
1716
  trigger: i,
@@ -1725,7 +1724,7 @@ function Oa({
1725
1724
  preventPassiveDismissDuringCreate: d,
1726
1725
  resolvedOpen: o,
1727
1726
  setIsCreateFlowActive: f
1728
- } = Ut({
1727
+ } = Rt({
1729
1728
  open: t,
1730
1729
  onOpenChange: a,
1731
1730
  initialCreateFlowActive: n === "create",
@@ -1736,62 +1735,62 @@ function Oa({
1736
1735
  // create and make consumers use `forceClose()` from a dedicated
1737
1736
  // button.
1738
1737
  dismissMode: s ? "passive" : "explicit-only"
1739
- }), h = M((C) => C.dashboard), { setDashboardControlsModel: p } = ve(), { participants: y } = br(Jr(h)), v = Array.from(
1738
+ }), h = P((x) => x.dashboard), { setDashboardControlsModel: p } = be(), { participants: C } = xr(ea(h)), y = Array.from(
1740
1739
  new Map(
1741
- y.flatMap(
1742
- (C) => C.fieldChoices.map((F) => {
1743
- var L;
1740
+ C.flatMap(
1741
+ (x) => x.fieldChoices.map((T) => {
1742
+ var F;
1744
1743
  return [
1745
- F.value,
1744
+ T.value,
1746
1745
  {
1747
- option: F,
1748
- target: (L = C.fieldTargetMap) == null ? void 0 : L[F.value]
1746
+ option: T,
1747
+ target: (F = x.fieldTargetMap) == null ? void 0 : F[T.value]
1749
1748
  }
1750
1749
  ];
1751
1750
  })
1752
1751
  )
1753
1752
  ).values()
1754
- ), A = Array.from(
1753
+ ), D = Array.from(
1755
1754
  new Map(
1756
- y.flatMap(
1757
- (C) => C.metricChoices.map((F) => {
1758
- var L;
1755
+ C.flatMap(
1756
+ (x) => x.metricChoices.map((T) => {
1757
+ var F;
1759
1758
  return [
1760
- F.value,
1759
+ T.value,
1761
1760
  {
1762
- option: F,
1763
- target: (L = C.metricTargetMap) == null ? void 0 : L[F.value]
1761
+ option: T,
1762
+ target: (F = x.metricTargetMap) == null ? void 0 : F[T.value]
1764
1763
  }
1765
1764
  ];
1766
1765
  })
1767
1766
  )
1768
1767
  ).values()
1769
- ), E = ea({
1768
+ ), I = ta({
1770
1769
  ...h || {},
1771
1770
  controls: []
1772
- }), N = xr(h), g = (C, F, L) => {
1771
+ }), N = vr(h), g = (x, T, F) => {
1773
1772
  p(
1774
- C,
1775
- F,
1776
- Ma(L)
1773
+ x,
1774
+ T,
1775
+ Oa(F)
1777
1776
  );
1778
- }, S = G(() => {
1777
+ }, S = q(() => {
1779
1778
  if (c) {
1780
1779
  u();
1781
1780
  return;
1782
1781
  }
1783
1782
  f(!1);
1784
- }, [c, u, f]), D = /* @__PURE__ */ e(
1785
- Pt,
1783
+ }, [c, u, f]), k = /* @__PURE__ */ e(
1784
+ Ut,
1786
1785
  {
1787
1786
  scope: "dashboard",
1788
1787
  controls: h.controls || [],
1789
- reservedControlIds: E,
1788
+ reservedControlIds: I,
1790
1789
  defaultValues: h.defaultControlValues || {},
1791
- usageByControlId: vr(h),
1792
- availableFieldChoices: v,
1793
- availableMetricChoices: A,
1794
- structuralParticipants: y,
1790
+ usageByControlId: yr(h),
1791
+ availableFieldChoices: y,
1792
+ availableMetricChoices: D,
1793
+ structuralParticipants: C,
1795
1794
  structuralParticipantIdsByControlId: N,
1796
1795
  initialCreateFlow: n === "create",
1797
1796
  onCreateFlowActiveChange: f,
@@ -1799,20 +1798,20 @@ function Oa({
1799
1798
  onChange: g,
1800
1799
  emptyMessage: "No dashboard controls yet."
1801
1800
  }
1802
- ), P = l ? "Add dashboard control" : "Dashboard Controls", b = /* @__PURE__ */ r(W, { children: [
1801
+ ), U = l ? "Add dashboard control" : "Dashboard Controls", b = /* @__PURE__ */ r(W, { children: [
1803
1802
  /* @__PURE__ */ r("div", { className: "space-y-1", children: [
1804
1803
  /* @__PURE__ */ e("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
1805
1804
  /* @__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." })
1806
1805
  ] }),
1807
- D
1806
+ k
1808
1807
  ] });
1809
- return s ? /* @__PURE__ */ r(Pe, { open: o, onOpenChange: m, children: [
1810
- /* @__PURE__ */ e(Me, { asChild: !0, children: i || /* @__PURE__ */ r(T, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
1808
+ return s ? /* @__PURE__ */ r(Ue, { open: o, onOpenChange: m, children: [
1809
+ /* @__PURE__ */ e(Pe, { asChild: !0, children: i || /* @__PURE__ */ r(B, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
1811
1810
  /* @__PURE__ */ e(ut, { className: "mr-2 h-4 w-4" }),
1812
1811
  "Controls"
1813
1812
  ] }) }),
1814
1813
  /* @__PURE__ */ e(
1815
- Oe,
1814
+ Me,
1816
1815
  {
1817
1816
  className: "w-[620px] max-w-[95vw] space-y-4",
1818
1817
  align: "end",
@@ -1821,8 +1820,8 @@ function Oa({
1821
1820
  children: b
1822
1821
  }
1823
1822
  )
1824
- ] }) : /* @__PURE__ */ e(ke, { open: o, onOpenChange: m, children: /* @__PURE__ */ r(
1825
- Ae,
1823
+ ] }) : /* @__PURE__ */ e(De, { open: o, onOpenChange: m, children: /* @__PURE__ */ r(
1824
+ ke,
1826
1825
  {
1827
1826
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
1828
1827
  onEscapeKeyDown: d,
@@ -1833,7 +1832,7 @@ function Oa({
1833
1832
  {
1834
1833
  className: l ? "space-y-0" : void 0,
1835
1834
  children: [
1836
- /* @__PURE__ */ e(Ee, { className: "text-[15px]", children: P }),
1835
+ /* @__PURE__ */ e(Ae, { className: "text-[15px]", children: U }),
1837
1836
  /* @__PURE__ */ e(
1838
1837
  lt,
1839
1838
  {
@@ -1844,12 +1843,12 @@ function Oa({
1844
1843
  ]
1845
1844
  }
1846
1845
  ),
1847
- /* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: D })
1846
+ /* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: k })
1848
1847
  ]
1849
1848
  }
1850
1849
  ) });
1851
1850
  }
1852
- const za = [
1851
+ const _a = [
1853
1852
  "enum",
1854
1853
  "multi_enum",
1855
1854
  "text",
@@ -1857,7 +1856,7 @@ const za = [
1857
1856
  "boolean",
1858
1857
  "date"
1859
1858
  ];
1860
- function _a({
1859
+ function $a({
1861
1860
  open: t,
1862
1861
  onOpenChange: a,
1863
1862
  initialMode: i = "manage"
@@ -1870,66 +1869,66 @@ function _a({
1870
1869
  preventPassiveDismissDuringCreate: m,
1871
1870
  resolvedOpen: l,
1872
1871
  setIsCreateFlowActive: d
1873
- } = Ut({
1872
+ } = Rt({
1874
1873
  open: t,
1875
1874
  onOpenChange: a,
1876
1875
  initialCreateFlowActive: i === "create",
1877
1876
  dismissMode: "explicit-only"
1878
- }), o = M((C) => C.dashboard), f = M((C) => C.selectedSheetId), { setDashboardInputs: h } = ve(), p = (b = o.sheets) == null ? void 0 : b.find(
1879
- (C) => C.id === f
1880
- ), y = (p == null ? void 0 : p.kind) === "document" && !!p.document, v = te(
1881
- () => y && (p != null && p.document) ? yr(o, p.id) : [],
1882
- [o, y, p == null ? void 0 : p.document, p == null ? void 0 : p.id]
1883
- ), A = te(
1884
- () => v.filter(
1885
- (C) => C.kind === "control"
1877
+ }), o = P((x) => x.dashboard), f = P((x) => x.selectedSheetId), { setDashboardInputs: h } = be(), p = (b = o.sheets) == null ? void 0 : b.find(
1878
+ (x) => x.id === f
1879
+ ), C = (p == null ? void 0 : p.kind) === "document" && !!p.document, y = ee(
1880
+ () => C && (p != null && p.document) ? Cr(o, p.id) : [],
1881
+ [o, C, p == null ? void 0 : p.document, p == null ? void 0 : p.id]
1882
+ ), D = ee(
1883
+ () => y.filter(
1884
+ (x) => x.kind === "control"
1886
1885
  ),
1887
- [v]
1888
- ), E = te(
1889
- () => A.map((C) => C.control),
1890
- [A]
1891
- ), N = te(
1892
- () => ja(E),
1893
- [E]
1894
- ), g = te(
1895
- () => $a(o),
1886
+ [y]
1887
+ ), I = ee(
1888
+ () => D.map((x) => x.control),
1889
+ [D]
1890
+ ), N = ee(
1891
+ () => Wa(I),
1892
+ [I]
1893
+ ), g = ee(
1894
+ () => ja(o),
1896
1895
  [o]
1897
- ), S = G(() => {
1896
+ ), S = q(() => {
1898
1897
  if (s) {
1899
1898
  n();
1900
1899
  return;
1901
1900
  }
1902
1901
  d(!1);
1903
- }, [s, n, d]), D = G(
1904
- (C, F, L) => {
1905
- !y || !(p != null && p.document) || h(
1906
- Ha({
1902
+ }, [s, n, d]), k = q(
1903
+ (x, T, F) => {
1904
+ !C || !(p != null && p.document) || h(
1905
+ Ga({
1907
1906
  allInputs: o.inputs || [],
1908
1907
  documentSheetId: p.id,
1909
- currentDocumentInputs: v,
1910
- nextControls: C,
1911
- nextDefaultValues: F,
1912
- change: L
1908
+ currentDocumentInputs: y,
1909
+ nextControls: x,
1910
+ nextDefaultValues: T,
1911
+ change: F
1913
1912
  })
1914
1913
  );
1915
1914
  },
1916
1915
  [
1917
1916
  o.inputs,
1918
- v,
1919
1917
  y,
1918
+ C,
1920
1919
  p,
1921
1920
  h
1922
1921
  ]
1923
1922
  );
1924
- return !y || !(p != null && p.document) ? null : /* @__PURE__ */ e(ke, { open: l, onOpenChange: c, children: /* @__PURE__ */ r(
1925
- Ae,
1923
+ return !C || !(p != null && p.document) ? null : /* @__PURE__ */ e(De, { open: l, onOpenChange: c, children: /* @__PURE__ */ r(
1924
+ ke,
1926
1925
  {
1927
1926
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
1928
1927
  onEscapeKeyDown: m,
1929
1928
  onPointerDownOutside: m,
1930
1929
  children: [
1931
1930
  /* @__PURE__ */ r(it, { className: u ? "space-y-0" : void 0, children: [
1932
- /* @__PURE__ */ e(Ee, { className: "text-[15px]", children: u ? "Add document control" : "Document Controls" }),
1931
+ /* @__PURE__ */ e(Ae, { className: "text-[15px]", children: u ? "Add document control" : "Document Controls" }),
1933
1932
  /* @__PURE__ */ e(
1934
1933
  lt,
1935
1934
  {
@@ -1939,10 +1938,10 @@ function _a({
1939
1938
  )
1940
1939
  ] }),
1941
1940
  /* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ e(
1942
- Pt,
1941
+ Ut,
1943
1942
  {
1944
1943
  scope: "dashboard",
1945
- controls: E,
1944
+ controls: I,
1946
1945
  reservedControlIds: g,
1947
1946
  defaultValues: N,
1948
1947
  usageByControlId: {},
@@ -1950,11 +1949,11 @@ function _a({
1950
1949
  availableMetricChoices: [],
1951
1950
  structuralParticipants: [],
1952
1951
  structuralParticipantIdsByControlId: {},
1953
- allowedControlTypes: za,
1952
+ allowedControlTypes: _a,
1954
1953
  initialCreateFlow: i === "create",
1955
1954
  onCreateFlowActiveChange: d,
1956
1955
  onCreateFlowComplete: S,
1957
- onChange: D,
1956
+ onChange: k,
1958
1957
  emptyMessage: "No document controls yet."
1959
1958
  }
1960
1959
  ) })
@@ -1962,22 +1961,22 @@ function _a({
1962
1961
  }
1963
1962
  ) });
1964
1963
  }
1965
- function $a(t) {
1964
+ function ja(t) {
1966
1965
  return (t.controls || []).map((a) => a.id);
1967
1966
  }
1968
- function ja(t) {
1967
+ function Wa(t) {
1969
1968
  const a = {};
1970
1969
  for (const i of t)
1971
1970
  i.defaultValue !== void 0 && (a[i.id] = i.defaultValue);
1972
1971
  return a;
1973
1972
  }
1974
- function Wa(t, a) {
1973
+ function Ha(t, a) {
1975
1974
  return a ? Object.prototype.hasOwnProperty.call(a, t.id) ? {
1976
1975
  ...t,
1977
1976
  defaultValue: a[t.id]
1978
1977
  } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 };
1979
1978
  }
1980
- function Ha({
1979
+ function Ga({
1981
1980
  allInputs: t,
1982
1981
  documentSheetId: a,
1983
1982
  currentDocumentInputs: i,
@@ -1988,7 +1987,7 @@ function Ha({
1988
1987
  const u = new Map(
1989
1988
  s.map((h) => [
1990
1989
  h.id,
1991
- Wa(h, n)
1990
+ Ha(h, n)
1992
1991
  ])
1993
1992
  ), m = (c == null ? void 0 : c.type) === "rename" ? { oldId: c.oldId, newId: c.newId } : null, l = /* @__PURE__ */ new Set(), d = [];
1994
1993
  for (const h of i) {
@@ -2000,23 +1999,23 @@ function Ha({
2000
1999
  if (!p)
2001
2000
  continue;
2002
2001
  l.add(p.id);
2003
- const y = Cr(
2002
+ const C = wr(
2004
2003
  p.id,
2005
2004
  [...t, ...d].filter(
2006
- (A) => A.id !== h.id
2005
+ (D) => D.id !== h.id
2007
2006
  )
2008
- ), v = p.id === y ? p : { ...p, id: y };
2007
+ ), y = p.id === C ? p : { ...p, id: C };
2009
2008
  d.push({
2010
2009
  ...h,
2011
- label: v.label,
2012
- variableName: y,
2013
- requiredAtExecution: v.requiredAtExecution,
2014
- control: v
2010
+ label: y.label,
2011
+ variableName: C,
2012
+ requiredAtExecution: y.requiredAtExecution,
2013
+ control: y
2015
2014
  });
2016
2015
  }
2017
2016
  for (const h of u.values())
2018
2017
  l.has(h.id) || d.push(
2019
- wr({
2018
+ Nr({
2020
2019
  control: h,
2021
2020
  existingInputs: [...t, ...d],
2022
2021
  sheetId: a
@@ -2029,7 +2028,7 @@ function Ha({
2029
2028
  (h) => !o.has(h.id)
2030
2029
  ), ...d];
2031
2030
  }
2032
- function Ga({
2031
+ function Ka({
2033
2032
  showFilters: t,
2034
2033
  onShowFiltersChange: a,
2035
2034
  pickerContent: i,
@@ -2041,11 +2040,11 @@ function Ga({
2041
2040
  pickerContentClassName: l,
2042
2041
  settingsContentClassName: d
2043
2042
  }) {
2044
- const o = n === "toolbar", [f, h] = k(!1), p = Nr("interactive");
2043
+ const o = n === "toolbar", [f, h] = E(!1), p = Sr("interactive");
2045
2044
  return /* @__PURE__ */ r(
2046
2045
  "div",
2047
2046
  {
2048
- className: q(
2047
+ className: X(
2049
2048
  // Height lives on the shell so the outer border is part of the
2050
2049
  // h-7 box (matches regular `size="xs"` buttons). Inner triggers
2051
2050
  // stretch to fill via `h-full`.
@@ -2054,28 +2053,28 @@ function Ga({
2054
2053
  c
2055
2054
  ),
2056
2055
  children: [
2057
- /* @__PURE__ */ r(Pe, { open: t, onOpenChange: a, children: [
2058
- /* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ r(
2059
- T,
2056
+ /* @__PURE__ */ r(Ue, { open: t, onOpenChange: a, children: [
2057
+ /* @__PURE__ */ e(Pe, { asChild: !0, children: /* @__PURE__ */ r(
2058
+ B,
2060
2059
  {
2061
2060
  variant: "ghost",
2062
2061
  size: "xs",
2063
- className: q(
2062
+ className: X(
2064
2063
  "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",
2065
2064
  u
2066
2065
  ),
2067
2066
  children: [
2068
- t ? /* @__PURE__ */ e(ba, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(It, { className: "h-3.5 w-3.5" }),
2067
+ t ? /* @__PURE__ */ e(xa, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(Et, { className: "h-3.5 w-3.5" }),
2069
2068
  "Filter"
2070
2069
  ]
2071
2070
  }
2072
2071
  ) }),
2073
2072
  /* @__PURE__ */ e(
2074
- Oe,
2073
+ Me,
2075
2074
  {
2076
2075
  align: "end",
2077
2076
  sideOffset: 6,
2078
- className: q(
2077
+ className: X(
2079
2078
  "w-auto rounded-card border border-border/60 p-0 shadow-sm",
2080
2079
  l
2081
2080
  ),
@@ -2084,26 +2083,26 @@ function Ga({
2084
2083
  }
2085
2084
  )
2086
2085
  ] }),
2087
- /* @__PURE__ */ r(Pe, { open: f, onOpenChange: h, children: [
2088
- /* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e(
2089
- T,
2086
+ /* @__PURE__ */ r(Ue, { open: f, onOpenChange: h, children: [
2087
+ /* @__PURE__ */ e(Pe, { asChild: !0, children: /* @__PURE__ */ e(
2088
+ B,
2090
2089
  {
2091
2090
  variant: "ghost",
2092
2091
  size: "xs",
2093
- className: q(
2092
+ className: X(
2094
2093
  "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",
2095
2094
  m
2096
2095
  ),
2097
2096
  "aria-label": "Filter and control actions",
2098
- children: /* @__PURE__ */ e(Rt, { className: "h-3.5 w-3.5" })
2097
+ children: /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5" })
2099
2098
  }
2100
2099
  ) }),
2101
2100
  /* @__PURE__ */ e(
2102
- Oe,
2101
+ Me,
2103
2102
  {
2104
2103
  align: "end",
2105
2104
  sideOffset: 6,
2106
- className: q(
2105
+ className: X(
2107
2106
  "w-auto rounded-card border border-border/60 p-0 shadow-sm",
2108
2107
  d
2109
2108
  ),
@@ -2117,8 +2116,8 @@ function Ga({
2117
2116
  );
2118
2117
  }
2119
2118
  function qa() {
2120
- da();
2121
- const t = M((l) => l.selectedSheetId), a = M((l) => l.selectedFrameId), i = M((l) => l.dashboard), s = M((l) => l.actions.getSelectedFrame), { setSelectedFrameId: n } = ve(), { setCard: c } = Vt(), u = xe((l) => l.card.dataSource);
2119
+ ua();
2120
+ 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 } = Tt(), u = ge((l) => l.card.dataSource);
2122
2121
  return J(() => {
2123
2122
  var d, o;
2124
2123
  let l = s();
@@ -2134,23 +2133,23 @@ function qa() {
2134
2133
  hasEntities: !!(u != null && u.selectedEntities && u.selectedEntities.length > 0)
2135
2134
  };
2136
2135
  }
2137
- function Ka() {
2138
- const t = M((l) => l.dashboard), a = M(
2136
+ function Xa() {
2137
+ const t = P((l) => l.dashboard), a = P(
2139
2138
  (l) => l.semanticExecutionPayload
2140
- ), i = M((l) => l.actions.addFilter), { hasEntities: s } = qa(), { isLoading: n } = Sr(), c = te(
2141
- () => ta(t, a),
2139
+ ), i = P((l) => l.actions.addFilter), { hasEntities: s } = qa(), { isLoading: n } = Dr(), c = ee(
2140
+ () => ra(t, a),
2142
2141
  [t, a]
2143
- ), m = !ra(t.filters) && c.hasEligibleCards && !n;
2142
+ ), m = !aa(t.filters) && c.hasEligibleCards && !n;
2144
2143
  return /* @__PURE__ */ r("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
2145
2144
  m && /* @__PURE__ */ e("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
2146
2145
  "button",
2147
2146
  {
2148
2147
  type: "button",
2149
- onClick: () => i(aa()),
2148
+ onClick: () => i(na()),
2150
2149
  title: `Applies to ${c.eligibleCardCount} of ${c.totalCardCount} date-aware cards`,
2151
2150
  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",
2152
2151
  children: [
2153
- /* @__PURE__ */ e(fa, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2152
+ /* @__PURE__ */ e(ga, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2154
2153
  /* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col", children: [
2155
2154
  /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
2156
2155
  /* @__PURE__ */ e("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
@@ -2159,23 +2158,23 @@ function Ka() {
2159
2158
  }
2160
2159
  ) }),
2161
2160
  !s && /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
2162
- /* @__PURE__ */ e(Dr, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
2161
+ /* @__PURE__ */ e(kr, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
2163
2162
  /* @__PURE__ */ e("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
2164
2163
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
2165
2164
  ] }),
2166
- s && /* @__PURE__ */ e("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ e(kr, { context: "filter" }) })
2165
+ s && /* @__PURE__ */ e("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ e(Ar, { context: "filter" }) })
2167
2166
  ] });
2168
2167
  }
2169
2168
  const yt = !1;
2170
- function Xa({
2169
+ function Ya({
2171
2170
  onAddFilter: t,
2172
2171
  onAddControl: a,
2173
2172
  onManageControls: i,
2174
2173
  onDismiss: s
2175
2174
  }) {
2176
- const n = M(
2175
+ const n = P(
2177
2176
  (m) => m.dashboard.filterLayout
2178
- ), { setFilterLayout: c } = ve();
2177
+ ), { setFilterLayout: c } = be();
2179
2178
  n != null && n.displayMode;
2180
2179
  const u = (n == null ? void 0 : n.toolbarWrap) ?? !1;
2181
2180
  return n == null || n.showDownloadButton, /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
@@ -2183,7 +2182,7 @@ function Xa({
2183
2182
  /* @__PURE__ */ e(
2184
2183
  Ye,
2185
2184
  {
2186
- icon: It,
2185
+ icon: Et,
2187
2186
  label: "Add filter",
2188
2187
  onClick: () => {
2189
2188
  t(), s();
@@ -2203,7 +2202,7 @@ function Xa({
2203
2202
  /* @__PURE__ */ e(
2204
2203
  Ye,
2205
2204
  {
2206
- icon: Ft,
2205
+ icon: It,
2207
2206
  label: "Manage controls",
2208
2207
  onClick: () => {
2209
2208
  i(), s();
@@ -2216,7 +2215,7 @@ function Xa({
2216
2215
  /* @__PURE__ */ e("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
2217
2216
  yt,
2218
2217
  /* @__PURE__ */ e(
2219
- Ya,
2218
+ Za,
2220
2219
  {
2221
2220
  id: "filter-display-wrap",
2222
2221
  label: "Wrap to multiple lines",
@@ -2246,7 +2245,7 @@ function Ye({
2246
2245
  }
2247
2246
  );
2248
2247
  }
2249
- function Ya({
2248
+ function Za({
2250
2249
  id: t,
2251
2250
  label: a,
2252
2251
  checked: i,
@@ -2255,7 +2254,7 @@ function Ya({
2255
2254
  return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-[4px] px-1 py-1 transition-colors hover:bg-muted/40", children: [
2256
2255
  /* @__PURE__ */ e(ot, { id: t, checked: i, onCheckedChange: s }),
2257
2256
  /* @__PURE__ */ e(
2258
- De,
2257
+ Se,
2259
2258
  {
2260
2259
  htmlFor: t,
2261
2260
  className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
@@ -2264,7 +2263,7 @@ function Ya({
2264
2263
  )
2265
2264
  ] });
2266
2265
  }
2267
- function $n({
2266
+ function jn({
2268
2267
  size: t,
2269
2268
  className: a,
2270
2269
  primaryButtonClassName: i,
@@ -2272,48 +2271,48 @@ function $n({
2272
2271
  pickerContentClassName: n,
2273
2272
  settingsContentClassName: c
2274
2273
  }) {
2275
- var P;
2276
- const [u, m] = k(null), l = M((b) => b.dashboard), d = M((b) => b.selectedSheetId), o = M((b) => b.showFilters), f = Ar((b) => b.setPanelOpen), h = M((b) => b.actions), { setDocumentInspectorTab: p, setShowFilters: y } = h, v = (P = l.sheets) == null ? void 0 : P.find(
2274
+ var U;
2275
+ const [u, m] = E(null), l = P((b) => b.dashboard), d = P((b) => b.selectedSheetId), o = P((b) => b.showFilters), f = Er((b) => b.setPanelOpen), h = P((b) => b.actions), { setDocumentInspectorTab: p, setShowFilters: C } = h, y = (U = l.sheets) == null ? void 0 : U.find(
2277
2276
  (b) => b.id === d
2278
- ), A = na(v), E = G((b) => {
2277
+ ), D = sa(y), I = q((b) => {
2279
2278
  window.setTimeout(() => {
2280
2279
  m(b);
2281
2280
  }, 0);
2282
- }, []), N = G(
2281
+ }, []), N = q(
2283
2282
  (b) => {
2284
- if (A && d) {
2283
+ if (D && d) {
2285
2284
  b && p(d, "inputs");
2286
2285
  return;
2287
2286
  }
2288
- b && f("dashboard", !1), y(b);
2287
+ b && f("dashboard", !1), C(b);
2289
2288
  },
2290
2289
  [
2291
- A,
2290
+ D,
2292
2291
  d,
2293
2292
  p,
2294
2293
  f,
2295
- y
2294
+ C
2296
2295
  ]
2297
- ), g = G(() => {
2296
+ ), g = q(() => {
2298
2297
  N(!0);
2299
- }, [N]), S = G(() => {
2300
- E("create");
2301
- }, [E]), D = G(() => {
2302
- E("manage");
2303
- }, [E]);
2298
+ }, [N]), S = q(() => {
2299
+ I("create");
2300
+ }, [I]), k = q(() => {
2301
+ I("manage");
2302
+ }, [I]);
2304
2303
  return /* @__PURE__ */ r(W, { children: [
2305
2304
  /* @__PURE__ */ e(
2306
- Ga,
2305
+ Ka,
2307
2306
  {
2308
- showFilters: A ? !1 : o,
2307
+ showFilters: D ? !1 : o,
2309
2308
  onShowFiltersChange: N,
2310
- pickerContent: /* @__PURE__ */ e(Ka, {}),
2309
+ pickerContent: /* @__PURE__ */ e(Xa, {}),
2311
2310
  settingsContent: (b) => /* @__PURE__ */ e(
2312
- Xa,
2311
+ Ya,
2313
2312
  {
2314
2313
  onAddFilter: g,
2315
2314
  onAddControl: S,
2316
- onManageControls: D,
2315
+ onManageControls: k,
2317
2316
  onDismiss: b
2318
2317
  }
2319
2318
  ),
@@ -2325,8 +2324,8 @@ function $n({
2325
2324
  settingsContentClassName: c
2326
2325
  }
2327
2326
  ),
2328
- u ? A ? /* @__PURE__ */ e(
2329
- _a,
2327
+ u ? D ? /* @__PURE__ */ e(
2328
+ $a,
2330
2329
  {
2331
2330
  open: !0,
2332
2331
  onOpenChange: (b) => {
@@ -2335,7 +2334,7 @@ function $n({
2335
2334
  initialMode: u
2336
2335
  }
2337
2336
  ) : /* @__PURE__ */ e(
2338
- Oa,
2337
+ za,
2339
2338
  {
2340
2339
  open: !0,
2341
2340
  onOpenChange: (b) => {
@@ -2347,7 +2346,7 @@ function $n({
2347
2346
  ) : null
2348
2347
  ] });
2349
2348
  }
2350
- function Za({
2349
+ function Qa({
2351
2350
  disabled: t,
2352
2351
  briefingCount: a,
2353
2352
  className: i,
@@ -2355,28 +2354,28 @@ function Za({
2355
2354
  }) {
2356
2355
  const n = typeof a == "number" && a > 0;
2357
2356
  return /* @__PURE__ */ r(
2358
- T,
2357
+ B,
2359
2358
  {
2360
2359
  type: "button",
2361
2360
  size: "xs",
2362
2361
  variant: "outline",
2363
2362
  disabled: t,
2364
- className: q("gap-1.5", i),
2363
+ className: X("gap-1.5", i),
2365
2364
  onClick: s,
2366
2365
  "aria-label": "Reports & briefings",
2367
2366
  children: [
2368
- /* @__PURE__ */ e(xa, { className: "h-3.5 w-3.5" }),
2367
+ /* @__PURE__ */ e(va, { className: "h-3.5 w-3.5" }),
2369
2368
  "Reports & briefings",
2370
2369
  n ? /* @__PURE__ */ e("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
2371
2370
  ]
2372
2371
  }
2373
2372
  );
2374
2373
  }
2375
- const Qa = "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", Ve = "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";
2376
- function Ja(t) {
2374
+ const Ja = "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";
2375
+ function en(t) {
2377
2376
  return t === "dashboard" ? "This dashboard" : "Project";
2378
2377
  }
2379
- function en(t) {
2378
+ function tn(t) {
2380
2379
  if (!t) return "Never";
2381
2380
  const a = new Date(t);
2382
2381
  if (Number.isNaN(a.getTime())) return "Unknown";
@@ -2390,26 +2389,26 @@ function en(t) {
2390
2389
  const u = Math.round(c / 7);
2391
2390
  return u < 5 ? `${u}w ago` : `${Math.round(c / 30)}mo ago`;
2392
2391
  }
2393
- function tn(t) {
2394
- return t.scheduleExpr ? ha(
2392
+ function rn(t) {
2393
+ return t.scheduleExpr ? ma(
2395
2394
  t.scheduleExpr,
2396
2395
  t.timezone || "UTC"
2397
2396
  ) ?? "Invalid schedule" : "On demand";
2398
2397
  }
2399
- function rn(t) {
2398
+ function an(t) {
2400
2399
  if (t.lastRunStatus) {
2401
2400
  const a = t.lastRunStatus.toString().toUpperCase();
2402
2401
  return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${t.lastRunStatus.toString().toLowerCase()}`;
2403
2402
  }
2404
2403
  return null;
2405
2404
  }
2406
- function _t(t) {
2405
+ function zt(t) {
2407
2406
  return t.hasActiveRun ? "Running" : t.lastRunStatus ? `Last run ${t.lastRunStatus.toString().toLowerCase()}` : "Idle";
2408
2407
  }
2409
- function an(t) {
2408
+ function nn(t) {
2410
2409
  return t.source.type === "dashboard" ? "This dashboard" : "Project";
2411
2410
  }
2412
- function nn({
2411
+ function sn({
2413
2412
  activeView: t,
2414
2413
  onChange: a
2415
2414
  }) {
@@ -2428,11 +2427,11 @@ function nn({
2428
2427
  role: "tab",
2429
2428
  "aria-selected": s,
2430
2429
  onClick: () => a(i),
2431
- className: q(
2430
+ className: X(
2432
2431
  "h-6 rounded-[3px] px-2 text-[11px] transition-colors",
2433
2432
  s ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
2434
2433
  ),
2435
- children: Ja(i)
2434
+ children: en(i)
2436
2435
  },
2437
2436
  i
2438
2437
  );
@@ -2440,7 +2439,7 @@ function nn({
2440
2439
  }
2441
2440
  );
2442
2441
  }
2443
- function sn({
2442
+ function on({
2444
2443
  briefings: t,
2445
2444
  dashboardLabel: a,
2446
2445
  sourceView: i,
@@ -2455,24 +2454,24 @@ function sn({
2455
2454
  analyticalBriefingsEnabled: f,
2456
2455
  onRunNow: h,
2457
2456
  onTogglePause: p,
2458
- onDelete: y,
2459
- selectingId: v,
2460
- busyId: A,
2461
- manageBriefingsHref: E,
2457
+ onDelete: C,
2458
+ selectingId: y,
2459
+ busyId: D,
2460
+ manageBriefingsHref: I,
2462
2461
  contentKind: N,
2463
2462
  hideHeader: g = !1
2464
2463
  }) {
2465
- const S = t.length, D = t.filter((L) => L.status === "ACTIVE").length, P = N === "reports" ? S === 1 ? "report" : "reports" : N === "briefings" ? S === 1 ? "briefing" : "briefings" : S === 1 ? "item" : "items", b = t.find((L) => L.hasActiveRun) ?? null, C = N ?? "reports & briefings", F = i === "dashboard" ? a : `Project ${C}`;
2464
+ 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}`;
2466
2465
  return /* @__PURE__ */ r(
2467
2466
  "section",
2468
2467
  {
2469
- "aria-label": `Dashboard ${C.replace("&", "and")}`,
2468
+ "aria-label": `Dashboard ${x.replace("&", "and")}`,
2470
2469
  className: "flex h-full min-h-0 flex-col bg-background text-foreground",
2471
2470
  children: [
2472
2471
  g ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
2473
2472
  /* @__PURE__ */ r("div", { className: "min-w-0", children: [
2474
- /* @__PURE__ */ e("div", { className: Qa, children: C }),
2475
- /* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: F })
2473
+ /* @__PURE__ */ e("div", { className: Ja, children: x }),
2474
+ /* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: T })
2476
2475
  ] }),
2477
2476
  /* @__PURE__ */ e(
2478
2477
  "button",
@@ -2480,15 +2479,15 @@ function sn({
2480
2479
  type: "button",
2481
2480
  onClick: u,
2482
2481
  className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
2483
- "aria-label": `Close ${C.replace("&", "and")} panel`,
2484
- children: /* @__PURE__ */ e(We, { className: "h-3.5 w-3.5" })
2482
+ "aria-label": `Close ${x.replace("&", "and")} panel`,
2483
+ children: /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" })
2485
2484
  }
2486
2485
  )
2487
2486
  ] }),
2488
2487
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 border-b border-border px-4 py-2", children: [
2489
2488
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-3", children: [
2490
2489
  /* @__PURE__ */ e(
2491
- nn,
2490
+ sn,
2492
2491
  {
2493
2492
  activeView: i,
2494
2493
  onChange: c
@@ -2496,21 +2495,21 @@ function sn({
2496
2495
  ),
2497
2496
  /* @__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: [
2498
2497
  "Loading ",
2499
- C,
2498
+ x,
2500
2499
  "…"
2501
2500
  ] }) : S === 0 ? /* @__PURE__ */ r("span", { children: [
2502
2501
  "No ",
2503
- C,
2502
+ x,
2504
2503
  " yet"
2505
2504
  ] }) : /* @__PURE__ */ r(W, { children: [
2506
2505
  /* @__PURE__ */ r("span", { className: "font-medium text-foreground/80", children: [
2507
2506
  S,
2508
2507
  " ",
2509
- P
2508
+ U
2510
2509
  ] }),
2511
2510
  /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2512
2511
  /* @__PURE__ */ r("span", { children: [
2513
- D,
2512
+ k,
2514
2513
  " active"
2515
2514
  ] })
2516
2515
  ] }) })
@@ -2521,17 +2520,17 @@ function sn({
2521
2520
  // when a manual reload is in flight, but don't show a separate
2522
2521
  // refresh button — close+reopen handles the rare "stale list"
2523
2522
  // case without crowding the toolbar.
2524
- /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
2523
+ /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
2525
2524
  ) : null,
2526
- S > 0 && d ? f && o ? /* @__PURE__ */ r(ze, { children: [
2527
- /* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Ve, children: [
2528
- /* @__PURE__ */ e(be, { className: "h-3 w-3" }),
2525
+ S > 0 && d ? f && o ? /* @__PURE__ */ r(Oe, { children: [
2526
+ /* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Te, children: [
2527
+ /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
2529
2528
  " New"
2530
2529
  ] }) }),
2531
- /* @__PURE__ */ r($e, { align: "end", children: [
2532
- /* @__PURE__ */ e(H, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
2530
+ /* @__PURE__ */ r(_e, { align: "end", children: [
2531
+ /* @__PURE__ */ e(K, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
2533
2532
  /* @__PURE__ */ e(
2534
- H,
2533
+ K,
2535
2534
  {
2536
2535
  onClick: () => l("analytical_briefing"),
2537
2536
  children: "Create analytical briefing"
@@ -2542,9 +2541,9 @@ function sn({
2542
2541
  "button",
2543
2542
  {
2544
2543
  onClick: () => l("scheduled_report"),
2545
- className: Ve,
2544
+ className: Te,
2546
2545
  children: [
2547
- /* @__PURE__ */ e(be, { className: "h-3 w-3" }),
2546
+ /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
2548
2547
  " Schedule report"
2549
2548
  ]
2550
2549
  }
@@ -2552,9 +2551,9 @@ function sn({
2552
2551
  "button",
2553
2552
  {
2554
2553
  onClick: () => l("analytical_briefing"),
2555
- className: Ve,
2554
+ className: Te,
2556
2555
  children: [
2557
- /* @__PURE__ */ e(be, { className: "h-3 w-3" }),
2556
+ /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
2558
2557
  " New briefing"
2559
2558
  ]
2560
2559
  }
@@ -2562,15 +2561,15 @@ function sn({
2562
2561
  ] })
2563
2562
  ] }),
2564
2563
  b ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
2565
- /* @__PURE__ */ e(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
2564
+ /* @__PURE__ */ e(te, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
2566
2565
  /* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: b.name }),
2567
2566
  /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2568
- /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: _t(b) })
2567
+ /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: zt(b) })
2569
2568
  ] }) : null,
2570
2569
  /* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
2571
2570
  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,
2572
2571
  !n && t.length === 0 && !s ? /* @__PURE__ */ e(
2573
- on,
2572
+ ln,
2574
2573
  {
2575
2574
  onNew: l,
2576
2575
  canCreate: d,
@@ -2579,28 +2578,28 @@ function sn({
2579
2578
  contentKind: N
2580
2579
  }
2581
2580
  ) : null,
2582
- t.map((L) => /* @__PURE__ */ e(
2583
- cn,
2581
+ t.map((F) => /* @__PURE__ */ e(
2582
+ dn,
2584
2583
  {
2585
- briefing: L,
2586
- isOpening: v === L.id,
2587
- isBusy: A === L.id,
2588
- onOpen: () => m(L.id),
2589
- onRunNow: () => h(L),
2590
- onTogglePause: () => p(L),
2591
- onDelete: () => y(L)
2584
+ briefing: F,
2585
+ isOpening: y === F.id,
2586
+ isBusy: D === F.id,
2587
+ onOpen: () => m(F.id),
2588
+ onRunNow: () => h(F),
2589
+ onTogglePause: () => p(F),
2590
+ onDelete: () => C(F)
2592
2591
  },
2593
- L.id
2592
+ F.id
2594
2593
  ))
2595
2594
  ] }),
2596
- E ? /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
2595
+ I ? /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
2597
2596
  "a",
2598
2597
  {
2599
- href: E,
2600
- className: q(zt, "h-6 px-1 text-[11px]"),
2598
+ href: I,
2599
+ className: X(Ot, "h-6 px-1 text-[11px]"),
2601
2600
  children: [
2602
2601
  "Manage all reports & briefings",
2603
- /* @__PURE__ */ e(pa, { className: "h-3 w-3" })
2602
+ /* @__PURE__ */ e(fa, { className: "h-3 w-3" })
2604
2603
  ]
2605
2604
  }
2606
2605
  ) }) : null
@@ -2608,7 +2607,7 @@ function sn({
2608
2607
  }
2609
2608
  );
2610
2609
  }
2611
- function on({
2610
+ function ln({
2612
2611
  onNew: t,
2613
2612
  canCreate: a,
2614
2613
  canCreateScheduledReport: i,
@@ -2623,7 +2622,7 @@ function on({
2623
2622
  description: "Create an analytical briefing to monitor this dashboard and brief your team."
2624
2623
  } : null;
2625
2624
  return /* @__PURE__ */ r("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
2626
- /* @__PURE__ */ e(ln, { className: "mb-5 h-[88px] w-[112px] text-border" }),
2625
+ /* @__PURE__ */ e(cn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
2627
2626
  /* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: (c == null ? void 0 : c.title) ?? "Have an analyst brief your team" }),
2628
2627
  /* @__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." }),
2629
2628
  a ? /* @__PURE__ */ r("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
@@ -2631,9 +2630,9 @@ function on({
2631
2630
  "button",
2632
2631
  {
2633
2632
  onClick: () => t("scheduled_report"),
2634
- className: Ve,
2633
+ className: Te,
2635
2634
  children: [
2636
- /* @__PURE__ */ e(be, { className: "h-3 w-3" }),
2635
+ /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
2637
2636
  " Schedule a report"
2638
2637
  ]
2639
2638
  }
@@ -2642,14 +2641,14 @@ function on({
2642
2641
  "button",
2643
2642
  {
2644
2643
  onClick: () => t("analytical_briefing"),
2645
- className: zt,
2644
+ className: Ot,
2646
2645
  children: "Create analytical briefing"
2647
2646
  }
2648
2647
  ) : null
2649
2648
  ] }) : null
2650
2649
  ] });
2651
2650
  }
2652
- function ln({ className: t }) {
2651
+ function cn({ className: t }) {
2653
2652
  return /* @__PURE__ */ r(
2654
2653
  "svg",
2655
2654
  {
@@ -2826,7 +2825,7 @@ function ln({ className: t }) {
2826
2825
  }
2827
2826
  );
2828
2827
  }
2829
- function cn({
2828
+ function dn({
2830
2829
  briefing: t,
2831
2830
  isOpening: a,
2832
2831
  isBusy: i,
@@ -2835,11 +2834,11 @@ function cn({
2835
2834
  onTogglePause: c,
2836
2835
  onDelete: u
2837
2836
  }) {
2838
- const m = t.status === "PAUSED", l = t.hasActiveRun, d = rn(t), o = en(t.lastRunAt), f = t.lastRunStatus, h = oe(t), p = f === "SUCCESS" ? Te.success.dot : f === "FAILED" ? Te.danger.dot : f ? Te.warning.dot : Te.neutral.dot;
2837
+ const m = t.status === "PAUSED", l = t.hasActiveRun, d = an(t), o = tn(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;
2839
2838
  return /* @__PURE__ */ r(
2840
2839
  "div",
2841
2840
  {
2842
- className: q(
2841
+ className: X(
2843
2842
  "group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
2844
2843
  m && "opacity-70"
2845
2844
  ),
@@ -2850,8 +2849,8 @@ function cn({
2850
2849
  role: "button",
2851
2850
  tabIndex: 0,
2852
2851
  onClick: s,
2853
- onKeyDown: (y) => {
2854
- (y.key === "Enter" || y.key === " ") && (y.preventDefault(), s());
2852
+ onKeyDown: (C) => {
2853
+ (C.key === "Enter" || C.key === " ") && (C.preventDefault(), s());
2855
2854
  },
2856
2855
  className: "cursor-pointer pr-8",
2857
2856
  children: [
@@ -2862,10 +2861,10 @@ function cn({
2862
2861
  /* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
2863
2862
  /* @__PURE__ */ e("span", { children: h.typeLabel }),
2864
2863
  /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2865
- /* @__PURE__ */ e("span", { children: an(t) }),
2864
+ /* @__PURE__ */ e("span", { children: nn(t) }),
2866
2865
  /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2867
- /* @__PURE__ */ e(Er, { className: "h-3 w-3" }),
2868
- /* @__PURE__ */ e("span", { className: "truncate", children: tn(t) }),
2866
+ /* @__PURE__ */ e(Ir, { className: "h-3 w-3" }),
2867
+ /* @__PURE__ */ e("span", { className: "truncate", children: rn(t) }),
2869
2868
  t.lastRunAt ? /* @__PURE__ */ r(W, { children: [
2870
2869
  /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
2871
2870
  /* @__PURE__ */ r("span", { children: [
@@ -2875,74 +2874,74 @@ function cn({
2875
2874
  ] }) : null
2876
2875
  ] }),
2877
2876
  d || l ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
2878
- l ? /* @__PURE__ */ e(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ e(
2877
+ l ? /* @__PURE__ */ e(te, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ e(
2879
2878
  "span",
2880
2879
  {
2881
- className: q(
2880
+ className: X(
2882
2881
  "inline-block h-1.5 w-1.5 shrink-0 rounded-full",
2883
2882
  p
2884
2883
  )
2885
2884
  }
2886
2885
  ),
2887
- /* @__PURE__ */ e("span", { className: "truncate", children: l ? _t(t) : d })
2886
+ /* @__PURE__ */ e("span", { className: "truncate", children: l ? zt(t) : d })
2888
2887
  ] }) : null
2889
2888
  ]
2890
2889
  }
2891
2890
  ),
2892
- /* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: i ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r(ze, { children: [
2893
- /* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(
2891
+ /* @__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: [
2892
+ /* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ e(
2894
2893
  "button",
2895
2894
  {
2896
2895
  type: "button",
2897
- onClick: (y) => y.stopPropagation(),
2896
+ onClick: (C) => C.stopPropagation(),
2898
2897
  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",
2899
2898
  "aria-label": `${h.noun === "report" ? "Report" : "Briefing"} actions`,
2900
- children: /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" })
2899
+ children: /* @__PURE__ */ e(St, { className: "h-3.5 w-3.5" })
2901
2900
  }
2902
2901
  ) }),
2903
- /* @__PURE__ */ r($e, { align: "end", className: "w-44", children: [
2904
- /* @__PURE__ */ r(H, { onClick: s, children: [
2905
- /* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5" }),
2902
+ /* @__PURE__ */ r(_e, { align: "end", className: "w-44", children: [
2903
+ /* @__PURE__ */ r(K, { onClick: s, children: [
2904
+ /* @__PURE__ */ e(It, { className: "h-3.5 w-3.5" }),
2906
2905
  "Edit ",
2907
2906
  h.noun
2908
2907
  ] }),
2909
2908
  /* @__PURE__ */ r(
2910
- H,
2909
+ K,
2911
2910
  {
2912
- onClick: (y) => {
2913
- y.preventDefault(), n();
2911
+ onClick: (C) => {
2912
+ C.preventDefault(), n();
2914
2913
  },
2915
2914
  children: [
2916
- /* @__PURE__ */ e(Ir, { className: "h-3.5 w-3.5" }),
2915
+ /* @__PURE__ */ e(Fr, { className: "h-3.5 w-3.5" }),
2917
2916
  "Run now"
2918
2917
  ]
2919
2918
  }
2920
2919
  ),
2921
2920
  t.scheduleExpr ? /* @__PURE__ */ e(
2922
- H,
2921
+ K,
2923
2922
  {
2924
- onClick: (y) => {
2925
- y.preventDefault(), c();
2923
+ onClick: (C) => {
2924
+ C.preventDefault(), c();
2926
2925
  },
2927
2926
  children: m ? /* @__PURE__ */ r(W, { children: [
2928
- /* @__PURE__ */ e(Fr, { className: "h-3.5 w-3.5" }),
2927
+ /* @__PURE__ */ e(Lr, { className: "h-3.5 w-3.5" }),
2929
2928
  "Resume"
2930
2929
  ] }) : /* @__PURE__ */ r(W, { children: [
2931
- /* @__PURE__ */ e(Lr, { className: "h-3.5 w-3.5" }),
2930
+ /* @__PURE__ */ e(Br, { className: "h-3.5 w-3.5" }),
2932
2931
  "Pause"
2933
2932
  ] })
2934
2933
  }
2935
2934
  ) : null,
2936
- /* @__PURE__ */ e(Ue, {}),
2935
+ /* @__PURE__ */ e(Re, {}),
2937
2936
  /* @__PURE__ */ r(
2938
- H,
2937
+ K,
2939
2938
  {
2940
- onClick: (y) => {
2941
- y.preventDefault(), u();
2939
+ onClick: (C) => {
2940
+ C.preventDefault(), u();
2942
2941
  },
2943
2942
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
2944
2943
  children: [
2945
- /* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5" }),
2944
+ /* @__PURE__ */ e(Ve, { className: "h-3.5 w-3.5" }),
2946
2945
  "Delete ",
2947
2946
  h.noun
2948
2947
  ]
@@ -2954,19 +2953,19 @@ function cn({
2954
2953
  }
2955
2954
  );
2956
2955
  }
2957
- const dn = 2e3, un = 20 * 6e4;
2958
- function hn(t) {
2956
+ const un = 2e3, hn = 20 * 6e4;
2957
+ function mn(t) {
2959
2958
  return (t == null ? void 0 : t.trim()) || "This dashboard";
2960
2959
  }
2961
- function mn(t) {
2960
+ function pn(t) {
2962
2961
  return t === "This dashboard" ? "Watch this dashboard" : `Watch ${t}`;
2963
2962
  }
2964
- function pn(t, a, i) {
2963
+ function fn(t, a, i) {
2965
2964
  return a !== "dashboard" ? t : t.filter(
2966
2965
  (s) => s.source.type === "dashboard" && s.source.dashboardId === i
2967
2966
  );
2968
2967
  }
2969
- async function fn(t) {
2968
+ async function gn(t) {
2970
2969
  const i = [];
2971
2970
  let s = 1, n = 0, c = Number.POSITIVE_INFINITY;
2972
2971
  for (; n < c; ) {
@@ -2980,15 +2979,15 @@ async function fn(t) {
2980
2979
  }
2981
2980
  return i;
2982
2981
  }
2983
- const gn = {
2984
- listBriefings: Or,
2985
- getBriefing: Mr,
2986
- pauseBriefing: Pr,
2987
- resumeBriefing: Ur,
2988
- deleteBriefing: Rr,
2989
- runBriefingNow: Vr
2982
+ const bn = {
2983
+ listBriefings: zr,
2984
+ getBriefing: Or,
2985
+ pauseBriefing: Mr,
2986
+ resumeBriefing: Pr,
2987
+ deleteBriefing: Ur,
2988
+ runBriefingNow: Rr
2990
2989
  };
2991
- function bn({
2990
+ function xn({
2992
2991
  briefingId: t,
2993
2992
  initialRun: a,
2994
2993
  apiServiceUrl: i,
@@ -2997,16 +2996,16 @@ function bn({
2997
2996
  onTimeout: c,
2998
2997
  onExpand: u
2999
2998
  }) {
3000
- const [m, l] = k(a), { startRun: d } = qr({
2999
+ const [m, l] = E(a), { startRun: d } = qr({
3001
3000
  apiServiceUrl: i,
3002
3001
  token: s,
3003
- intervalMs: dn,
3004
- timeoutMs: un,
3002
+ intervalMs: un,
3003
+ timeoutMs: hn,
3005
3004
  fetchRun: ({
3006
3005
  apiServiceUrl: f,
3007
3006
  token: h,
3008
3007
  runId: p
3009
- }) => Kr(f, h, t, p),
3008
+ }) => Xr(f, h, t, p),
3010
3009
  onRun: (f) => {
3011
3010
  l(f);
3012
3011
  },
@@ -3016,15 +3015,15 @@ function bn({
3016
3015
  onTimeout: () => {
3017
3016
  c();
3018
3017
  }
3019
- }), o = me(!1);
3018
+ }), o = he(!1);
3020
3019
  return J(() => {
3021
- o.current || (o.current = !0, Xr(a.status) ? d(a) : Yr(a.status) && n(a));
3022
- }, [a, n, d]), /* @__PURE__ */ e(Zr, { run: m, onExpand: u });
3020
+ o.current || (o.current = !0, Yr(a.status) ? d(a) : Zr(a.status) && n(a));
3021
+ }, [a, n, d]), /* @__PURE__ */ e(Qr, { run: m, onExpand: u });
3023
3022
  }
3024
- function jn(t) {
3025
- return /* @__PURE__ */ e(Br, { children: /* @__PURE__ */ e(xn, { ...t }) });
3023
+ function Wn(t) {
3024
+ return /* @__PURE__ */ e(Tr, { children: /* @__PURE__ */ e(vn, { ...t }) });
3026
3025
  }
3027
- function xn({
3026
+ function vn({
3028
3027
  dashboardId: t,
3029
3028
  dashboardTitle: a,
3030
3029
  apiServiceUrl: i,
@@ -3038,179 +3037,179 @@ function xn({
3038
3037
  workflowIntent: o,
3039
3038
  client: f
3040
3039
  }) {
3041
- const { authToken: h, tokenProps: p } = je(), y = Tr(), v = !o || y.canCreate && (o === "scheduled_report" || y.analyticalBriefingsEnabled), [A, E] = k(!1), N = m ?? A, g = (w) => {
3042
- m === void 0 && E(w), l == null || l(w);
3043
- }, [S, D] = k(
3040
+ const { authToken: h, tokenProps: p } = $e(), C = Vr(), y = !o || C.canCreate && (o === "scheduled_report" || C.analyticalBriefingsEnabled), [D, I] = E(!1), N = m ?? D, g = (w) => {
3041
+ m === void 0 && I(w), l == null || l(w);
3042
+ }, [S, k] = E(
3044
3043
  o ? "author" : "list"
3045
- ), [P, b] = k(
3044
+ ), [U, b] = E(
3046
3045
  o ?? "analytical_briefing"
3047
- ), [C, F] = k("dashboard"), [L, K] = k(
3046
+ ), [x, T] = E("dashboard"), [F, H] = E(
3048
3047
  []
3049
- ), [V, R] = k(null), I = o && !v && !V ? "list" : S, [pe, X] = k(!1), [Ce, ee] = k(null), [He, Z] = k(null), [_, ae] = k(
3048
+ ), [A, V] = E(null), j = o && !y && !A ? "list" : S, [ve, G] = E(!1), [We, ye] = E(null), [He, Z] = E(null), [z, re] = E(
3050
3049
  null
3051
- ), [le, ce] = k(null), we = me(null), Ie = me(N);
3050
+ ), [ie, le] = E(null), Ce = he(null), Ee = he(N);
3052
3051
  J(() => {
3053
- const w = N && !Ie.current;
3054
- Ie.current = N, !(!w || !o) && (R(null), F("dashboard"), b(o), D("author"), ce(null));
3052
+ const w = N && !Ee.current;
3053
+ Ee.current = N, !(!w || !o) && (V(null), T("dashboard"), b(o), k("author"), le(null));
3055
3054
  }, [N, o]);
3056
- const [de, fe] = k(
3055
+ const [ce, me] = E(
3057
3056
  null
3058
- ), [Q, Ne] = k(null), $ = i ?? (p == null ? void 0 : p.apiServiceUrl), j = s ?? (h == null ? void 0 : h.accessToken), se = te(() => ({ ...gn, ...f }), [f]), ge = hn(a), Fe = te(() => {
3059
- const w = pn(
3060
- L,
3061
- C,
3057
+ ), [Q, we] = E(null), _ = i ?? (p == null ? void 0 : p.apiServiceUrl), $ = s ?? (h == null ? void 0 : h.accessToken), ne = ee(() => ({ ...bn, ...f }), [f]), pe = mn(a), Ie = ee(() => {
3058
+ const w = fn(
3059
+ F,
3060
+ x,
3062
3061
  t
3063
3062
  );
3064
3063
  if (!o)
3065
3064
  return w;
3066
- const U = o === "scheduled_report" ? "report" : "briefing";
3065
+ const R = o === "scheduled_report" ? "report" : "briefing";
3067
3066
  return w.filter(
3068
- (Le) => oe(Le).noun === U
3067
+ (Fe) => se(Fe).noun === R
3069
3068
  );
3070
- }, [t, L, C, o]), Ge = te(() => C === "dashboard" ? {
3069
+ }, [t, F, x, o]), Ge = ee(() => x === "dashboard" ? {
3071
3070
  source: { type: "dashboard", dashboardId: t },
3072
- label: ge,
3073
- detail: mn(ge)
3071
+ label: pe,
3072
+ detail: pn(pe)
3074
3073
  } : {
3075
3074
  source: { type: "project" },
3076
3075
  label: "This project",
3077
3076
  detail: "Use any data in this project."
3078
- }, [t, ge, C]), Se = !!($ && j), ue = ma({
3079
- canCreate: y.canCreate,
3080
- analyticalBriefingsEnabled: y.analyticalBriefingsEnabled,
3081
- scheduledReportAvailable: C === "dashboard"
3082
- }), Y = G(async () => {
3083
- if (!(!$ || !j)) {
3084
- X(!0), ce(null);
3077
+ }, [t, pe, x]), Ne = !!(_ && $), de = pa({
3078
+ canCreate: C.canCreate,
3079
+ analyticalBriefingsEnabled: C.analyticalBriefingsEnabled,
3080
+ scheduledReportAvailable: x === "dashboard"
3081
+ }), Y = q(async () => {
3082
+ if (!(!_ || !$)) {
3083
+ G(!0), le(null);
3085
3084
  try {
3086
- K(
3087
- await fn({
3088
- apiClient: se,
3089
- apiServiceUrl: $,
3090
- token: j
3085
+ H(
3086
+ await gn({
3087
+ apiClient: ne,
3088
+ apiServiceUrl: _,
3089
+ token: $
3091
3090
  })
3092
3091
  );
3093
3092
  } catch (w) {
3094
- ce(
3093
+ le(
3095
3094
  w instanceof Error ? w.message : "Could not load briefings."
3096
3095
  );
3097
3096
  } finally {
3098
- X(!1);
3097
+ G(!1);
3099
3098
  }
3100
3099
  }
3101
- }, [se, $, j]);
3100
+ }, [ne, _, $]);
3102
3101
  J(() => {
3103
- !N || I !== "list" || !Se || Y();
3104
- }, [Se, I, Y, N]);
3105
- const x = () => {
3106
- R(null), F("dashboard"), D("list"), g(!0);
3107
- }, B = (w) => {
3108
- R(null), b(w), D("author");
3109
- }, O = async (w) => {
3110
- if (!(!$ || !j)) {
3111
- ee(w), ce(null);
3102
+ !N || j !== "list" || !Ne || Y();
3103
+ }, [Ne, j, Y, N]);
3104
+ const v = () => {
3105
+ V(null), T("dashboard"), k("list"), g(!0);
3106
+ }, L = (w) => {
3107
+ V(null), b(w), k("author");
3108
+ }, M = async (w) => {
3109
+ if (!(!_ || !$)) {
3110
+ ye(w), le(null);
3112
3111
  try {
3113
- const U = await se.getBriefing(
3112
+ const R = await ne.getBriefing(
3113
+ _,
3114
3114
  $,
3115
- j,
3116
3115
  w
3117
3116
  );
3118
- R(U.briefing), D("author");
3119
- } catch (U) {
3120
- ce(
3121
- U instanceof Error ? U.message : "Could not open briefing."
3117
+ V(R.briefing), k("author");
3118
+ } catch (R) {
3119
+ le(
3120
+ R instanceof Error ? R.message : "Could not open briefing."
3122
3121
  );
3123
3122
  } finally {
3124
- ee(null);
3123
+ ye(null);
3125
3124
  }
3126
3125
  }
3127
- }, ne = async (w) => {
3128
- if (!(!$ || !j)) {
3126
+ }, ae = async (w) => {
3127
+ if (!(!_ || !$)) {
3129
3128
  Z(w.id);
3130
3129
  try {
3131
- await se.runBriefingNow(
3130
+ await ne.runBriefingNow(
3131
+ _,
3132
3132
  $,
3133
- j,
3134
3133
  w.id,
3135
- { requestId: vn() }
3134
+ { requestId: yn() }
3136
3135
  ), Y();
3137
- } catch (U) {
3138
- z.error(
3139
- U instanceof Error ? U.message : "Could not start the run."
3136
+ } catch (R) {
3137
+ O.error(
3138
+ R instanceof Error ? R.message : "Could not start the run."
3140
3139
  );
3141
3140
  } finally {
3142
3141
  Z(null);
3143
3142
  }
3144
3143
  }
3145
- }, ie = async (w) => {
3146
- if (!$ || !j) return;
3147
- const { noun: U } = oe(w), Le = U === "report" ? "Report" : "Briefing";
3144
+ }, oe = async (w) => {
3145
+ if (!_ || !$) return;
3146
+ const { noun: R } = se(w), Fe = R === "report" ? "Report" : "Briefing";
3148
3147
  Z(w.id);
3149
3148
  try {
3150
- const Be = w.status === "PAUSED" ? await se.resumeBriefing(
3149
+ const Le = w.status === "PAUSED" ? await ne.resumeBriefing(
3150
+ _,
3151
3151
  $,
3152
- j,
3153
3152
  w.id
3154
- ) : await se.pauseBriefing(
3153
+ ) : await ne.pauseBriefing(
3154
+ _,
3155
3155
  $,
3156
- j,
3157
3156
  w.id
3158
3157
  );
3159
- z.success(
3160
- Be.briefing.status === "PAUSED" ? `${Le} paused` : `${Le} resumed`
3158
+ O.success(
3159
+ Le.briefing.status === "PAUSED" ? `${Fe} paused` : `${Fe} resumed`
3161
3160
  ), Y();
3162
- } catch (Be) {
3163
- z.error(
3164
- Be instanceof Error ? Be.message : `Could not update the ${U} status.`
3161
+ } catch (Le) {
3162
+ O.error(
3163
+ Le instanceof Error ? Le.message : `Could not update the ${R} status.`
3165
3164
  );
3166
3165
  } finally {
3167
3166
  Z(null);
3168
3167
  }
3169
- }, $t = async () => {
3170
- if (!_ || !$ || !j) return;
3171
- const w = _;
3168
+ }, _t = async () => {
3169
+ if (!z || !_ || !$) return;
3170
+ const w = z;
3172
3171
  Z(w.id);
3173
3172
  try {
3174
- await se.deleteBriefing(
3173
+ await ne.deleteBriefing(
3174
+ _,
3175
3175
  $,
3176
- j,
3177
3176
  w.id
3178
3177
  );
3179
- const { noun: U } = oe(w);
3180
- z.success(`${U === "report" ? "Report" : "Briefing"} deleted`), ae(null), Y();
3181
- } catch (U) {
3182
- z.error(
3183
- U instanceof Error ? U.message : "Could not delete the briefing."
3178
+ const { noun: R } = se(w);
3179
+ O.success(`${R === "report" ? "Report" : "Briefing"} deleted`), re(null), Y();
3180
+ } catch (R) {
3181
+ O.error(
3182
+ R instanceof Error ? R.message : "Could not delete the briefing."
3184
3183
  );
3185
3184
  } finally {
3186
3185
  Z(null);
3187
3186
  }
3188
- }, jt = Fe.length;
3189
- return y.surfaceVisible ? /* @__PURE__ */ r(zr, { open: N, onOpenChange: g, children: [
3187
+ }, $t = Ie.length;
3188
+ return C.surfaceVisible ? /* @__PURE__ */ r(_r, { open: N, onOpenChange: g, children: [
3190
3189
  d ? null : /* @__PURE__ */ e(
3191
- Za,
3190
+ Qa,
3192
3191
  {
3193
- disabled: n || !Se,
3194
- briefingCount: jt,
3192
+ disabled: n || !Ne,
3193
+ briefingCount: $t,
3195
3194
  className: c,
3196
- onClick: x
3195
+ onClick: v
3197
3196
  }
3198
3197
  ),
3199
3198
  /* @__PURE__ */ r(
3200
- _r,
3199
+ $r,
3201
3200
  {
3202
- ref: we,
3201
+ ref: Ce,
3203
3202
  side: "right",
3204
3203
  hideClose: !0,
3205
3204
  className: "flex h-full w-full flex-col overflow-hidden p-0 outline-none sm:max-w-[560px]",
3206
3205
  onOpenAutoFocus: (w) => {
3207
- var U;
3208
- w.preventDefault(), (U = we.current) == null || U.focus({ preventScroll: !0 });
3206
+ var R;
3207
+ w.preventDefault(), (R = Ce.current) == null || R.focus({ preventScroll: !0 });
3209
3208
  },
3210
3209
  children: [
3211
- /* @__PURE__ */ r($r, { className: "sr-only", children: [
3212
- /* @__PURE__ */ e(jr, { children: "Reports & briefings" }),
3213
- /* @__PURE__ */ e(Wr, { children: "Manage reports and briefings for this dashboard." })
3210
+ /* @__PURE__ */ r(jr, { className: "sr-only", children: [
3211
+ /* @__PURE__ */ e(Wr, { children: "Reports & briefings" }),
3212
+ /* @__PURE__ */ e(Hr, { children: "Manage reports and briefings for this dashboard." })
3214
3213
  ] }),
3215
3214
  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: [
3216
3215
  /* @__PURE__ */ r(
@@ -3225,17 +3224,17 @@ function xn({
3225
3224
  {
3226
3225
  type: "button",
3227
3226
  role: "tab",
3228
- "aria-selected": I === "author",
3229
- disabled: !v,
3230
- className: q(
3227
+ "aria-selected": j === "author",
3228
+ disabled: !y,
3229
+ className: X(
3231
3230
  "-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
3232
- I === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
3233
- !v && "cursor-not-allowed opacity-50"
3231
+ j === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
3232
+ !y && "cursor-not-allowed opacity-50"
3234
3233
  ),
3235
3234
  onClick: () => {
3236
- v && (R(null), b(o), F("dashboard"), D("author"));
3235
+ y && (V(null), b(o), T("dashboard"), k("author"));
3237
3236
  },
3238
- children: V ? `Edit ${oe(V).noun}` : o === "scheduled_report" ? "Schedule report" : "Create briefing"
3237
+ children: A ? `Edit ${se(A).noun}` : o === "scheduled_report" ? "Schedule report" : "Create briefing"
3239
3238
  }
3240
3239
  ),
3241
3240
  /* @__PURE__ */ e(
@@ -3243,12 +3242,12 @@ function xn({
3243
3242
  {
3244
3243
  type: "button",
3245
3244
  role: "tab",
3246
- "aria-selected": I === "list",
3247
- className: q(
3245
+ "aria-selected": j === "list",
3246
+ className: X(
3248
3247
  "-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
3249
- I === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
3248
+ j === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
3250
3249
  ),
3251
- onClick: () => D("list"),
3250
+ onClick: () => k("list"),
3252
3251
  children: o === "scheduled_report" ? "Manage reports" : "Manage briefings"
3253
3252
  }
3254
3253
  )
@@ -3262,97 +3261,97 @@ function xn({
3262
3261
  onClick: () => g(!1),
3263
3262
  className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
3264
3263
  "aria-label": o === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
3265
- children: /* @__PURE__ */ e(We, { className: "h-3.5 w-3.5" })
3264
+ children: /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" })
3266
3265
  }
3267
3266
  )
3268
3267
  ] }) : null,
3269
- I === "list" ? /* @__PURE__ */ e(
3270
- sn,
3268
+ j === "list" ? /* @__PURE__ */ e(
3269
+ on,
3271
3270
  {
3272
- briefings: Fe,
3273
- dashboardLabel: ge,
3274
- sourceView: C,
3275
- error: le,
3276
- loading: pe,
3277
- onSourceViewChange: F,
3271
+ briefings: Ie,
3272
+ dashboardLabel: pe,
3273
+ sourceView: x,
3274
+ error: ie,
3275
+ loading: ve,
3276
+ onSourceViewChange: T,
3278
3277
  onClose: () => g(!1),
3279
3278
  onEdit: (w) => {
3280
- O(w);
3279
+ M(w);
3281
3280
  },
3282
- onNew: B,
3283
- canCreate: !o && ue.length > 0,
3284
- canCreateScheduledReport: ue.includes(
3281
+ onNew: L,
3282
+ canCreate: !o && de.length > 0,
3283
+ canCreateScheduledReport: de.includes(
3285
3284
  "scheduled_report"
3286
3285
  ),
3287
- analyticalBriefingsEnabled: ue.includes(
3286
+ analyticalBriefingsEnabled: de.includes(
3288
3287
  "analytical_briefing"
3289
3288
  ),
3290
3289
  onRunNow: (w) => {
3291
- ne(w);
3290
+ ae(w);
3292
3291
  },
3293
3292
  onTogglePause: (w) => {
3294
- ie(w);
3293
+ oe(w);
3295
3294
  },
3296
- onDelete: (w) => ae(w),
3297
- selectingId: Ce,
3295
+ onDelete: (w) => re(w),
3296
+ selectingId: We,
3298
3297
  busyId: He,
3299
3298
  manageBriefingsHref: u,
3300
3299
  contentKind: o === "scheduled_report" ? "reports" : o === "analytical_briefing" ? "briefings" : void 0,
3301
3300
  hideHeader: !!o
3302
3301
  }
3303
3302
  ) : /* @__PURE__ */ e(
3304
- Hr,
3303
+ Gr,
3305
3304
  {
3306
- apiServiceUrl: $,
3307
- token: j,
3308
- briefing: V,
3309
- intent: P,
3310
- sourceContext: V ? void 0 : Ge,
3311
- title: V ? `Edit ${oe(V).noun}` : P === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
3305
+ apiServiceUrl: _,
3306
+ token: $,
3307
+ briefing: A,
3308
+ intent: U,
3309
+ sourceContext: A ? void 0 : Ge,
3310
+ title: A ? `Edit ${se(A).noun}` : U === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
3312
3311
  hideHeader: !!o,
3313
3312
  className: "h-full min-h-0 max-w-none border-0 shadow-none",
3314
- onBack: o ? void 0 : () => D("list"),
3313
+ onBack: o ? void 0 : () => k("list"),
3315
3314
  onCancel: () => g(!1),
3316
3315
  onDeleted: () => {
3317
- const w = V ? oe(V).noun : "briefing";
3318
- z.success(`${w === "report" ? "Report" : "Briefing"} deleted`), R(null), D("list"), Y();
3316
+ const w = A ? se(A).noun : "briefing";
3317
+ O.success(`${w === "report" ? "Report" : "Briefing"} deleted`), V(null), k("list"), Y();
3319
3318
  },
3320
3319
  onRunStarted: () => {
3321
3320
  },
3322
3321
  onSaved: (w) => {
3323
- R(w), Y();
3322
+ V(w), Y();
3324
3323
  },
3325
- onMinimizeRun: ({ briefing: w, run: U }) => {
3326
- fe({ briefing: w, run: U }), g(!1);
3324
+ onMinimizeRun: ({ briefing: w, run: R }) => {
3325
+ me({ briefing: w, run: R }), g(!1);
3327
3326
  }
3328
3327
  }
3329
3328
  )
3330
3329
  ]
3331
3330
  }
3332
3331
  ),
3333
- de && $ && j ? /* @__PURE__ */ e(
3334
- bn,
3332
+ ce && _ && $ ? /* @__PURE__ */ e(
3333
+ xn,
3335
3334
  {
3336
- briefingId: de.briefing.id,
3337
- initialRun: de.run,
3338
- apiServiceUrl: $,
3339
- token: j,
3335
+ briefingId: ce.briefing.id,
3336
+ initialRun: ce.run,
3337
+ apiServiceUrl: _,
3338
+ token: $,
3340
3339
  onTerminal: (w) => {
3341
- Ne({
3342
- briefing: de.briefing,
3340
+ we({
3341
+ briefing: ce.briefing,
3343
3342
  run: w
3344
- }), fe(null), Y();
3343
+ }), me(null), Y();
3345
3344
  },
3346
3345
  onTimeout: () => {
3347
- fe(null), Y();
3346
+ me(null), Y();
3348
3347
  },
3349
3348
  onExpand: () => {
3350
- R(de.briefing), D("author"), fe(null), g(!0);
3349
+ V(ce.briefing), k("author"), me(null), g(!0);
3351
3350
  }
3352
3351
  }
3353
3352
  ) : null,
3354
3353
  Q ? /* @__PURE__ */ e("div", { className: "fixed bottom-4 right-4 z-50 w-[360px]", children: /* @__PURE__ */ e(
3355
- Gr,
3354
+ Kr,
3356
3355
  {
3357
3356
  title: Q.run.status === "SUCCESS" ? `${Q.briefing.name} is ready` : `${Q.briefing.name} run failed`,
3358
3357
  durationSeconds: Q.run.startedAt && Q.run.completedAt ? Math.max(
@@ -3363,43 +3362,43 @@ function xn({
3363
3362
  ) : null,
3364
3363
  status: Q.run.status === "SUCCESS" ? "success" : "failed",
3365
3364
  onView: () => {
3366
- R(Q.briefing), D("author"), Ne(null), g(!0);
3365
+ V(Q.briefing), k("author"), we(null), g(!0);
3367
3366
  },
3368
- onDismiss: () => Ne(null)
3367
+ onDismiss: () => we(null)
3369
3368
  }
3370
3369
  ) }) : null,
3371
3370
  /* @__PURE__ */ e(
3372
3371
  Je,
3373
3372
  {
3374
- open: !!_,
3373
+ open: !!z,
3375
3374
  onOpenChange: (w) => {
3376
- w || ae(null);
3375
+ w || re(null);
3377
3376
  },
3378
3377
  children: /* @__PURE__ */ r(et, { children: [
3379
3378
  /* @__PURE__ */ r(tt, { children: [
3380
3379
  /* @__PURE__ */ r(rt, { children: [
3381
3380
  "Delete",
3382
3381
  " ",
3383
- _ ? oe(_).noun : "briefing",
3382
+ z ? se(z).noun : "briefing",
3384
3383
  "?"
3385
3384
  ] }),
3386
3385
  /* @__PURE__ */ r(at, { children: [
3387
3386
  "This permanently deletes ",
3388
- /* @__PURE__ */ e("strong", { children: _ == null ? void 0 : _.name }),
3387
+ /* @__PURE__ */ e("strong", { children: z == null ? void 0 : z.name }),
3389
3388
  ". Recipients will stop receiving it."
3390
3389
  ] })
3391
3390
  ] }),
3392
3391
  /* @__PURE__ */ r(nt, { children: [
3393
3392
  /* @__PURE__ */ e(st, { children: "Cancel" }),
3394
3393
  /* @__PURE__ */ r(
3395
- St,
3394
+ Nt,
3396
3395
  {
3397
3396
  className: "bg-destructive/90 hover:bg-destructive",
3398
- onClick: $t,
3397
+ onClick: _t,
3399
3398
  children: [
3400
3399
  "Delete",
3401
3400
  " ",
3402
- _ ? oe(_).noun : "briefing"
3401
+ z ? se(z).noun : "briefing"
3403
3402
  ]
3404
3403
  }
3405
3404
  )
@@ -3409,23 +3408,23 @@ function xn({
3409
3408
  )
3410
3409
  ] }) : null;
3411
3410
  }
3412
- function vn() {
3411
+ function yn() {
3413
3412
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
3414
3413
  }
3415
3414
  export {
3416
- Pn as A,
3417
- jn as D,
3418
- Ua as E,
3419
- _n as N,
3420
- Mn as U,
3421
- Un as V,
3422
- Za as W,
3423
- Oa as a,
3424
- Ga as b,
3425
- $n as c,
3426
- _a as d,
3427
- Pa as e,
3428
- Rn as f,
3429
- zn as g,
3430
- On as u
3415
+ Mn as A,
3416
+ Wn as D,
3417
+ Pa as E,
3418
+ $n as N,
3419
+ On as U,
3420
+ Pn as V,
3421
+ Qa as W,
3422
+ za as a,
3423
+ Ka as b,
3424
+ jn as c,
3425
+ $a as d,
3426
+ Ma as e,
3427
+ Un as f,
3428
+ _n as g,
3429
+ zn as u
3431
3430
  };