@burdenoff/microfe-bigconsole 2026.1118.10 → 2026.1119.2

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 (51) hide show
  1. package/dist/bigconsole/asof/AsOfBanner.d.ts +3 -0
  2. package/dist/bigconsole/asof/AsOfBanner.js +52 -0
  3. package/dist/bigconsole/asof/AsOfControl.d.ts +4 -0
  4. package/dist/bigconsole/asof/AsOfControl.js +164 -0
  5. package/dist/bigconsole/asof/AsOfProvider.d.ts +31 -0
  6. package/dist/bigconsole/asof/AsOfProvider.js +98 -0
  7. package/dist/bigconsole/asof/asOfMessage.d.ts +12 -0
  8. package/dist/bigconsole/asof/asOfMessage.js +12 -0
  9. package/dist/bigconsole/asof/asOfParam.d.ts +48 -0
  10. package/dist/bigconsole/asof/asOfParam.js +34 -0
  11. package/dist/bigconsole/asof/index.d.ts +7 -0
  12. package/dist/bigconsole/asof/index.js +6 -0
  13. package/dist/bigconsole/compare/compareEngine.d.ts +104 -0
  14. package/dist/bigconsole/compare/compareEngine.js +172 -0
  15. package/dist/bigconsole/compare/compareParam.d.ts +9 -0
  16. package/dist/bigconsole/compare/compareParam.js +13 -0
  17. package/dist/bigconsole/compare/compareSide.d.ts +5 -0
  18. package/dist/bigconsole/compare/compareSide.js +39 -0
  19. package/dist/bigconsole/compare/index.d.ts +3 -0
  20. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +142 -138
  21. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +97 -92
  22. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +78 -74
  23. package/dist/bigconsole/components/widgets/WidgetCompareView.d.ts +12 -0
  24. package/dist/bigconsole/components/widgets/WidgetCompareView.js +215 -0
  25. package/dist/bigconsole/components/widgets/WidgetMenu.js +98 -96
  26. package/dist/bigconsole/components/widgets/WidgetWrapper.js +399 -311
  27. package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.js +47 -148
  28. package/dist/bigconsole/components/widgets/metric-card/metricData.d.ts +23 -0
  29. package/dist/bigconsole/components/widgets/metric-card/metricData.js +105 -0
  30. package/dist/bigconsole/components/widgets/table/TableCell.d.ts +2 -1
  31. package/dist/bigconsole/components/widgets/table/TableCell.js +1 -1
  32. package/dist/bigconsole/components/widgets/table/TableWidget.js +142 -168
  33. package/dist/bigconsole/components/widgets/table/tableRows.d.ts +17 -0
  34. package/dist/bigconsole/components/widgets/table/tableRows.js +35 -0
  35. package/dist/bigconsole/hooks/index.d.ts +1 -0
  36. package/dist/bigconsole/hooks/index.js +25 -24
  37. package/dist/bigconsole/hooks/useFilterFieldValues.js +52 -22
  38. package/dist/bigconsole/hooks/useWidgetCompareData.d.ts +8 -0
  39. package/dist/bigconsole/hooks/useWidgetCompareData.js +24 -0
  40. package/dist/bigconsole/hooks/useWidgetData.d.ts +7 -0
  41. package/dist/bigconsole/hooks/useWidgetData.js +53 -43
  42. package/dist/bigconsole/pages/DashboardViewPage.d.ts +7 -1
  43. package/dist/bigconsole/pages/DashboardViewPage.js +300 -278
  44. package/dist/bigconsole/pages/index.d.ts +1 -1
  45. package/dist/bigconsole/types/index.d.ts +13 -0
  46. package/dist/bigconsole/utils/widgetDisplayData.d.ts +16 -0
  47. package/dist/bigconsole/utils/widgetDisplayData.js +12 -1
  48. package/dist/generated/wspace-operations.d.ts +47 -0
  49. package/dist/generated/wspace-operations.js +261 -16
  50. package/dist/generated/wspace-types.d.ts +78 -0
  51. package/package.json +1 -1
@@ -3,57 +3,66 @@ import { useDashboardStore as r, useGlobalFilterValues as ee } from "../../store
3
3
  import "../../store/index.js";
4
4
  import "../../hooks/index.js";
5
5
  import te from "../../hooks/useWidgetData.js";
6
- import { GetDashboardDocument as ne } from "../../../generated/wspace-operations.js";
7
- import { formatTimeUntilRefresh as re, useWidgetAutoRefresh as ie } from "../../hooks/useAutoRefresh.js";
8
- import ae from "../../hooks/useWidgetComments.js";
9
- import oe from "../../hooks/useWidgetExport.js";
10
- import se from "../../hooks/useDrilldown.js";
11
- import { getWidgetDefinition as ce } from "./WidgetRegistry.js";
12
- import { resolveTextData as le } from "./text-widget/textData.js";
13
- import { WidgetHeader as ue } from "./WidgetHeader.js";
14
- import { WidgetMenu as i } from "./WidgetMenu.js";
15
- import { useBigConsoleSettings as de } from "../../hooks/useBigConsoleSettings.js";
16
- import { WidgetLoadingState as a } from "./states/LoadingState.js";
17
- import { WidgetErrorState as fe } from "./states/ErrorState.js";
18
- import { WidgetEmptyState as o } from "./states/EmptyState.js";
19
- import { WidgetErrorBoundary as pe } from "./WidgetErrorBoundary.js";
20
- import { hasCustomIframeConfig as me, hasRenderableCustomConfig as he } from "./custom/config.js";
21
- import { getBindingForWidget as ge } from "../../utils/widgetBinding.js";
22
- import { filterMetaFromDashboard as _e, findInapplicableFilters as ve } from "../../utils/globalFilterMatching.js";
23
- import { applyGlobalFilters as ye } from "../../utils/applyGlobalFilters.js";
24
- import { extractOutlierSeries as be } from "../insights/outlierSeries.js";
25
- import { OutlierSpottingDialog as xe } from "../insights/OutlierSpottingDialog.js";
26
- import { canReconcileWidget as Se } from "../reconcile/reconcileModel.js";
27
- import { isUsableWidgetData as Ce, resolveWidgetDisplayData as we, widgetDataSourcePolicy as Te, widgetExportRows as Ee } from "../../utils/widgetDisplayData.js";
28
- import { WidgetRendererFactory as De } from "../../renderers/factory/WidgetRendererFactory.js";
29
- import { WidgetActions as Oe } from "./widget-actions/WidgetActions.js";
6
+ import { useWidgetCompareData as ne } from "../../hooks/useWidgetCompareData.js";
7
+ import { GetDashboardDocument as re } from "../../../generated/wspace-operations.js";
8
+ import { formatTimeUntilRefresh as ie, useWidgetAutoRefresh as ae } from "../../hooks/useAutoRefresh.js";
9
+ import oe from "../../hooks/useWidgetComments.js";
10
+ import se from "../../hooks/useWidgetExport.js";
11
+ import ce from "../../hooks/useDrilldown.js";
12
+ import { getWidgetDefinition as le } from "./WidgetRegistry.js";
13
+ import { resolveTextData as ue } from "./text-widget/textData.js";
14
+ import { useAsOf as de } from "../../asof/AsOfProvider.js";
15
+ import { formatWhen as fe } from "../../asof/AsOfControl.js";
16
+ import { asOfUnavailableMessage as i } from "../../asof/asOfMessage.js";
17
+ import { WidgetHeader as pe } from "./WidgetHeader.js";
18
+ import { WidgetMenu as a } from "./WidgetMenu.js";
19
+ import { useBigConsoleSettings as me } from "../../hooks/useBigConsoleSettings.js";
20
+ import "../../asof/index.js";
21
+ import { compareWidget as he, isCompareSupported as ge } from "../../compare/compareEngine.js";
22
+ import { readCompareSide as _e } from "../../compare/compareSide.js";
23
+ import { WidgetCompareView as ve } from "./WidgetCompareView.js";
24
+ import { WidgetLoadingState as o } from "./states/LoadingState.js";
25
+ import { WidgetErrorState as s } from "./states/ErrorState.js";
26
+ import { WidgetEmptyState as ye } from "./states/EmptyState.js";
27
+ import { WidgetErrorBoundary as be } from "./WidgetErrorBoundary.js";
28
+ import { hasCustomIframeConfig as xe, hasRenderableCustomConfig as Se } from "./custom/config.js";
29
+ import { getBindingForWidget as Ce } from "../../utils/widgetBinding.js";
30
+ import { filterMetaFromDashboard as we, findInapplicableFilters as Te } from "../../utils/globalFilterMatching.js";
31
+ import { applyGlobalFilters as Ee } from "../../utils/applyGlobalFilters.js";
32
+ import { extractOutlierSeries as De } from "../insights/outlierSeries.js";
33
+ import { OutlierSpottingDialog as Oe } from "../insights/OutlierSpottingDialog.js";
34
+ import { canReconcileWidget as ke } from "../reconcile/reconcileModel.js";
35
+ import { resolveWidgetDataPath as Ae, resolveWidgetDisplayData as je, widgetDataSourcePolicy as Me, widgetExportRows as Ne } from "../../utils/widgetDisplayData.js";
36
+ import { WidgetRendererFactory as Pe } from "../../renderers/factory/WidgetRendererFactory.js";
37
+ import { WidgetActions as Fe } from "./widget-actions/WidgetActions.js";
30
38
  import "./widget-actions/index.js";
31
- import { dashboardSuggestAnchorProps as ke } from "../../proactive/entities.js";
32
- import { Suspense as s, lazy as c, memo as l, useCallback as u, useEffect as Ae, useMemo as d, useRef as f, useState as p } from "react";
33
- import { useI18n as je } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
34
- import { useQuery as Me } from "@apollo/client/react";
35
- import { jsx as m, jsxs as Ne } from "react/jsx-runtime";
39
+ import { dashboardSuggestAnchorProps as Ie } from "../../proactive/entities.js";
40
+ import { Suspense as c, lazy as l, memo as u, useCallback as d, useEffect as Le, useMemo as f, useRef as p, useState as m } from "react";
41
+ import { useI18n as Re } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
42
+ import { useQuery as ze } from "@apollo/client/react";
43
+ import { jsx as h, jsxs as Be } from "react/jsx-runtime";
36
44
  // src/bigconsole/components/widgets/WidgetWrapper.tsx
37
- var Pe = c(() => import("../reconcile/KpiReconcileDialog.js").then((e) => ({ default: e.KpiReconcileDialog }))), Fe = c(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), Ie = c(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), Le = c(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), Re = c(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), ze = c(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), Be = c(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), Ve = c(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), He = c(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), Ue = c(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), We = c(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), Ge = c(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), Ke = c(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), qe = c(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Je = c(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), Ye = c(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Xe = c(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), Ze = c(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget })));
38
- c(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
39
- var Qe = c(() => import("./form/index.js").then((e) => ({ default: e.FormWidget }))), $e = c(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.SankeyWidget }))), et = c(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.BoxPlotWidget }))), tt = c(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.WaterfallWidget }))), nt = c(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments }))), rt = /* @__PURE__ */ new Set([
45
+ var Ve = l(() => import("../reconcile/KpiReconcileDialog.js").then((e) => ({ default: e.KpiReconcileDialog }))), He = l(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), Ue = l(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), We = l(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), Ge = l(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), Ke = l(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), qe = l(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), Je = l(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), Ye = l(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), Xe = l(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), Ze = l(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), Qe = l(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), $e = l(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), et = l(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), tt = l(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), nt = l(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), rt = l(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), it = l(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget })));
46
+ l(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
47
+ var at = l(() => import("./form/index.js").then((e) => ({ default: e.FormWidget }))), ot = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.SankeyWidget }))), st = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.BoxPlotWidget }))), ct = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.WaterfallWidget }))), lt = l(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments }))), ut = /* @__PURE__ */ new Set([
40
48
  "text",
41
49
  "iframe",
42
50
  "form",
43
51
  "adaptive_card"
44
52
  ]);
45
- function h(e, t) {
53
+ function dt(e, t) {
46
54
  return e.previewOnly === t.previewOnly && e.widget.id === t.widget.id && e.widget.updatedAt === t.widget.updatedAt && e.isLoading === t.isLoading && e.error === t.error && e.actions === t.actions && e.data === t.data && JSON.stringify(e.filterValues) === JSON.stringify(t.filterValues) && e.narrativeOpen === t.narrativeOpen && e.narrativePanel === t.narrativePanel;
47
55
  }
48
- var it = l(function({ widget: i, children: c, data: l, className: h = "", isLoading: it, error: g, onRefresh: _, onDrilldown: v, actions: y, onAction: b, filterValues: x, onToggleNarrative: at, narrativeOpen: ot = !1, narrativePanel: st, previewOnly: S = !1 }) {
49
- let C = de(), ct = r((e) => e.viewMode === "edit"), w = !S && ct, T = t((e) => e.selectWidget), E = e(i.id), D = n(i.id), O = ee(), { t: lt } = je(), k = i.dashboardId, { data: ut } = Me(ne, {
50
- variables: { id: k ?? "" },
51
- skip: !k,
56
+ var ft = u(function({ widget: a, children: l, data: u, className: dt = "", isLoading: ft, error: g, onRefresh: _, onDrilldown: pt, actions: v, onAction: y, filterValues: b, onToggleNarrative: mt, narrativeOpen: ht = !1, narrativePanel: gt, previewOnly: x = !1 }) {
57
+ let S = me(), _t = r((e) => e.viewMode === "edit"), C = !x && _t, w = t((e) => e.selectWidget), T = e(a.id), vt = n(a.id), E = ee(), { t: D } = Re(), yt = a.dashboardId, { data: bt } = ze(re, {
58
+ variables: { id: yt ?? "" },
59
+ skip: !yt,
52
60
  fetchPolicy: "cache-only"
53
- }), A = ut?.getDashboard?.globalFilters, j = d(() => _e(A), [A]), M = d(() => Object.fromEntries(Object.entries(j).map(([e, t]) => [e, t.field])), [j]), N = d(() => ge(i), [i]), { hasDataSource: P, allowSamples: F, mockSource: I } = Te(i, N), { data: L, loading: dt, error: ft } = te(i.id, {
54
- skip: S || !P,
55
- pollInterval: (i.refreshInterval ?? 0) * 1e3 || 0
56
- }), R = d(() => {
61
+ }), xt = bt?.getDashboard?.globalFilters, O = f(() => we(xt), [xt]), k = f(() => Object.fromEntries(Object.entries(O).map(([e, t]) => [e, t.field])), [O]), A = f(() => Ce(a), [a]), { hasDataSource: j, allowSamples: St, mockSource: Ct } = Me(a, A), { asOf: M, compareTo: N } = de(), { data: P, loading: wt, error: Tt, asOfInfo: Et } = te(a.id, {
62
+ skip: x || !j,
63
+ pollInterval: M ? 0 : (a.refreshInterval ?? 0) * 1e3 || 0,
64
+ asOf: M
65
+ }), F = f(() => {
57
66
  if (typeof window > "u") return {};
58
67
  let e = new URLSearchParams(window.location.search), t = {};
59
68
  return e.forEach((e, n) => {
@@ -62,149 +71,184 @@ var it = l(function({ widget: i, children: c, data: l, className: h = "", isLoad
62
71
  r.startsWith("__") || (t[r] = e);
63
72
  }
64
73
  }), t;
65
- }, []), z = d(() => {
74
+ }, []), I = f(() => {
66
75
  let e = {};
67
- return R && Object.keys(R).length > 0 && Object.assign(e, R), O && Object.keys(O).length > 0 && Object.assign(e, O), x && Object.keys(x).length > 0 && Object.assign(e, x), e;
76
+ return F && Object.keys(F).length > 0 && Object.assign(e, F), E && Object.keys(E).length > 0 && Object.assign(e, E), b && Object.keys(b).length > 0 && Object.assign(e, b), e;
68
77
  }, [
69
- R,
70
- O,
71
- x
72
- ]), B = Object.keys(z).length > 0, V = it ?? (dt && !L) ?? D.isLoading, H = g ?? ft?.message ?? D.errorMessage, pt = ce(i.type), U = f(_);
73
- Ae(() => {
74
- U.current = _;
78
+ F,
79
+ E,
80
+ b
81
+ ]), L = Object.keys(I).length > 0, R = ft ?? (wt && !P) ?? vt.isLoading, Dt = M ? i(Et, D) : null, z = g ?? Dt ?? Tt?.message ?? (M ? null : vt.errorMessage), Ot = le(a.type), B = p(_);
82
+ Le(() => {
83
+ B.current = _;
75
84
  }, [_]);
76
- let mt = u(async () => {
77
- U.current && await U.current();
78
- }, []), { timeUntilRefresh: ht, isPaused: gt } = ie({
79
- widgetId: i.id,
80
- refreshInterval: i.refreshInterval,
81
- onRefresh: mt,
82
- enabled: !S && !w && !!i.refreshInterval
83
- }), W = f(null), [_t, vt] = p(!1), [yt, bt] = p(!1), { count: xt } = ae(i.id, yt), St = u(() => {
84
- bt(!0), vt((e) => !e);
85
- }, []), G = d(() => we({
86
- explicit: l,
87
- fetched: L,
88
- persisted: i.data,
89
- config: i.config,
90
- allowSamples: F,
91
- mockSource: I,
92
- widgetType: i.type
85
+ let kt = d(async () => {
86
+ B.current && await B.current();
87
+ }, []), { timeUntilRefresh: At, isPaused: jt } = ae({
88
+ widgetId: a.id,
89
+ refreshInterval: a.refreshInterval,
90
+ onRefresh: kt,
91
+ enabled: !x && !C && !!a.refreshInterval && !M
92
+ }), Mt = p(null), [Nt, Pt] = m(!1), [Ft, It] = m(!1), { count: Lt } = oe(a.id, Ft), Rt = d(() => {
93
+ It(!0), Pt((e) => !e);
94
+ }, []), V = f(() => je({
95
+ explicit: u,
96
+ fetched: P,
97
+ persisted: a.data,
98
+ config: a.config,
99
+ allowSamples: St,
100
+ mockSource: Ct,
101
+ widgetType: a.type,
102
+ asOf: M !== null
93
103
  }), [
94
- l,
104
+ u,
105
+ P,
106
+ a,
107
+ St,
108
+ Ct,
109
+ M
110
+ ]), H = f(() => {
111
+ let e = V.data;
112
+ return Ae(e, a.config);
113
+ }, [V, a.config]), U = f(() => L ? Ee(H, {
114
+ filterValues: I,
115
+ filterFieldMap: k,
116
+ widgetType: a.type
117
+ }) : H, [
118
+ H,
95
119
  L,
96
- i,
97
- F,
98
- I
99
- ]), K = d(() => {
100
- let e = G.data;
101
- if (e && typeof e == "object" && !Array.isArray(e)) {
102
- let t = i.config, n = t?.dataKey ?? t?.dataPath ?? t?.seriesPath;
103
- if (n && typeof n == "string") {
104
- let t = n.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
105
- t != null && Ce(t) && (e = t);
106
- }
107
- }
108
- return e;
109
- }, [G, i.config]), q = d(() => B ? ye(K, {
110
- filterValues: z,
111
- filterFieldMap: M,
112
- widgetType: i.type
113
- }) : K, [
114
- K,
115
- B,
116
- z,
120
+ I,
121
+ k,
122
+ a.type
123
+ ]), W = M !== null && N !== null && ge(a.type), G = ne(a.id, N, x || !j || !W), K = d((e) => L ? Ee(e, {
124
+ filterValues: I,
125
+ filterFieldMap: k,
126
+ widgetType: a.type
127
+ }) : e, [
128
+ L,
129
+ I,
130
+ k,
131
+ a.type
132
+ ]), zt = f(() => {
133
+ if (!W) return null;
134
+ let e = a.config;
135
+ return he({
136
+ widgetType: a.type,
137
+ config: e,
138
+ from: _e(P, e, K),
139
+ to: _e(G.data, e, K)
140
+ });
141
+ }, [
142
+ W,
143
+ a.type,
144
+ a.config,
145
+ P,
146
+ G.data,
147
+ K
148
+ ]), q = f(() => ({
149
+ from: M ? fe(M) : "",
150
+ to: N instanceof Date ? fe(N) : D("bigconsole.compare.label.now", "Now")
151
+ }), [
117
152
  M,
118
- i.type
119
- ]), Ct = q !== null && G.isSample, wt = d(() => rt.has(i.type) ? [] : ve(K, j, z, i.type), [
120
- K,
121
- j,
122
- z,
123
- i.type
124
- ]), Tt = d(() => Ee(q, i.type), [q, i.type]), Et = d(() => {
125
- let e = i.config;
126
- return be(q, {
153
+ N,
154
+ D
155
+ ]), Bt = U !== null && V.isSample, Vt = f(() => ut.has(a.type) ? [] : Te(H, O, I, a.type), [
156
+ H,
157
+ O,
158
+ I,
159
+ a.type
160
+ ]), Ht = f(() => Ne(U, a.type), [U, a.type]), Ut = f(() => {
161
+ let e = a.config;
162
+ return De(U, {
127
163
  xAxisKey: typeof e?.xAxisKey == "string" ? e.xAxisKey : void 0,
128
164
  selectedFields: Array.isArray(e?.selectedFields) ? e.selectedFields.filter((e) => typeof e == "string") : void 0
129
165
  });
130
- }, [q, i.config]), [Dt, Ot] = p(!1), [kt, At] = p(!1), jt = Se(i.type, S), { exportCSV: Mt, exportPNG: Nt } = oe(i, {
131
- data: Tt,
132
- containerRef: W
133
- }), { executeDrilldown: Pt, canDrilldown: Ft } = se({ onDrilldown: (e, t) => {
134
- v?.(e);
135
- } }), J = d(() => Ft(i), [i, Ft]), It = u((e) => {
136
- if (!i.drilldown?.enabled) return;
166
+ }, [U, a.config]), [Wt, J] = m(!1), [Gt, Kt] = m(!1), qt = ke(a.type, x), { exportCSV: Jt, exportPNG: Yt } = se(a, {
167
+ data: Ht,
168
+ containerRef: Mt
169
+ }), { executeDrilldown: Xt, canDrilldown: Zt } = ce({ onDrilldown: (e, t) => {
170
+ pt?.(e);
171
+ } }), Y = f(() => Zt(a) && !M, [
172
+ a,
173
+ Zt,
174
+ M
175
+ ]), Qt = d((e) => {
176
+ if (!a.drilldown?.enabled) return;
137
177
  let t = {
138
178
  selectedData: e || {},
139
- globalFilters: O || {},
140
- widgetData: q || {},
179
+ globalFilters: E || {},
180
+ widgetData: U || {},
141
181
  metadata: {
142
- widgetId: i.id,
143
- widgetType: i.type,
144
- widgetTitle: i.title
182
+ widgetId: a.id,
183
+ widgetType: a.type,
184
+ widgetTitle: a.title
145
185
  },
146
- sourceDashboardId: i.dashboardId
186
+ sourceDashboardId: a.dashboardId
147
187
  };
148
- Pt(i.drilldown, t);
188
+ Xt(a.drilldown, t);
149
189
  }, [
150
- i,
151
- q,
152
- O,
153
- Pt
154
- ]), Y = J && !w ? It : void 0, X = f(null), Lt = u((e) => {
155
- X.current = {
190
+ a,
191
+ U,
192
+ E,
193
+ Xt
194
+ ]), X = Y && !C && !M ? Qt : void 0, Z = p(null), $t = d((e) => {
195
+ Z.current = {
156
196
  x: e.clientX,
157
197
  y: e.clientY
158
198
  };
159
- }, []), Rt = u((e) => {
160
- if (e.stopPropagation(), X.current) {
161
- let t = Math.abs(e.clientX - X.current.x), n = Math.abs(e.clientY - X.current.y);
199
+ }, []), en = d((e) => {
200
+ if (e.stopPropagation(), Z.current) {
201
+ let t = Math.abs(e.clientX - Z.current.x), n = Math.abs(e.clientY - Z.current.y);
162
202
  if (t > 5 || n > 5) {
163
- X.current = null;
203
+ Z.current = null;
164
204
  return;
165
205
  }
166
206
  }
167
- X.current = null, w && T(i.id);
207
+ Z.current = null, C && w(a.id);
168
208
  }, [
209
+ C,
169
210
  w,
170
- T,
171
- i.id
172
- ]), zt = u((e) => {
173
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), w && T(i.id));
211
+ a.id
212
+ ]), tn = d((e) => {
213
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), C && w(a.id));
174
214
  }, [
215
+ C,
175
216
  w,
176
- T,
177
- i.id
178
- ]), Bt = d(() => i.type === "custom" && he(i.config), [i.type, i.config]), Vt = d(() => i.type === "custom" && me(i.config), [i.type, i.config]), Z = J && !Vt, Ht = d(() => i.type === "text" && le(i.config, q).hasContent, [
179
- i.type,
180
- i.config,
181
- q
182
- ]), Ut = !V && !H && !q && !Bt && !Ht, Q = d(() => i.renderer, [i]), Wt = d(() => Q && Q !== "BIGCONSOLE", [Q]), Gt = d(() => ({
183
- widgetId: i.id,
184
- data: q || {}
185
- }), [i.id, q]), $ = u((e, t) => {
186
- if (!b) return;
187
- let n = y?.find((t) => t.name === e.name);
188
- b(n || e, t);
189
- }, [b, y]), Kt = u(() => {
217
+ a.id
218
+ ]), nn = f(() => a.type === "custom" && Se(a.config), [a.type, a.config]), rn = f(() => a.type === "custom" && xe(a.config), [a.type, a.config]), Q = Y && !rn, an = a.type === "iframe" || a.type === "custom", on = f(() => a.type === "text" && ue(a.config, U).hasContent, [
219
+ a.type,
220
+ a.config,
221
+ U
222
+ ]), sn = !R && !z && !U && !nn && !on, $ = f(() => a.renderer, [a]), cn = f(() => $ && $ !== "BIGCONSOLE", [$]), ln = f(() => ({
223
+ widgetId: a.id,
224
+ data: U || {}
225
+ }), [a.id, U]), un = d((e, t) => {
226
+ if (!y || M) return;
227
+ let n = v?.find((t) => t.name === e.name);
228
+ y(n || e, t);
229
+ }, [
230
+ y,
231
+ v,
232
+ M
233
+ ]), dn = d(() => {
190
234
  let e = (() => {
191
- if (!q) return q;
192
- if (i.type === "pivot_table") {
193
- if (Array.isArray(q)) return q;
194
- if (q && typeof q == "object" && "rows" in q) return q.rows;
235
+ if (!U) return U;
236
+ if (a.type === "pivot_table") {
237
+ if (Array.isArray(U)) return U;
238
+ if (U && typeof U == "object" && "rows" in U) return U.rows;
195
239
  }
196
- if (i.type === "list") {
197
- if (Array.isArray(q)) return q;
198
- if (q && typeof q == "object" && "items" in q) return q.items;
240
+ if (a.type === "list") {
241
+ if (Array.isArray(U)) return U;
242
+ if (U && typeof U == "object" && "items" in U) return U.items;
199
243
  }
200
- if (i.type === "funnel_chart") {
201
- if (Array.isArray(q)) return q;
202
- if (q && typeof q == "object" && "stages" in q) return q.stages;
244
+ if (a.type === "funnel_chart") {
245
+ if (Array.isArray(U)) return U;
246
+ if (U && typeof U == "object" && "stages" in U) return U.stages;
203
247
  }
204
- if (i.type === "chart") {
205
- if (Array.isArray(q)) return q;
206
- if (q && typeof q == "object" && "datasets" in q) {
207
- let e = q;
248
+ if (a.type === "chart") {
249
+ if (Array.isArray(U)) return U;
250
+ if (U && typeof U == "object" && "datasets" in U) {
251
+ let e = U;
208
252
  if (e.labels && e.datasets) return e.labels.map((t, n) => {
209
253
  let r = { name: t };
210
254
  return e.datasets?.forEach((e) => {
@@ -213,269 +257,295 @@ var it = l(function({ widget: i, children: c, data: l, className: h = "", isLoad
213
257
  });
214
258
  }
215
259
  }
216
- if (i.type === "text") {
217
- let e = le(i.config, q);
260
+ if (a.type === "text") {
261
+ let e = ue(a.config, U);
218
262
  return {
219
263
  content: e.content,
220
264
  format: e.format,
221
265
  alignment: e.alignment
222
266
  };
223
267
  }
224
- if (i.type === "custom") {
225
- let e = i.config?.valueField;
226
- if (e && q && typeof q == "object" && !Array.isArray(q)) {
227
- let t = q;
268
+ if (a.type === "custom") {
269
+ let e = a.config?.valueField;
270
+ if (e && U && typeof U == "object" && !Array.isArray(U)) {
271
+ let t = U;
228
272
  if (e in t) return {
229
273
  value: t[e],
230
- label: i.title,
274
+ label: a.title,
231
275
  data: t
232
276
  };
233
277
  }
234
278
  }
235
- return q;
279
+ return U;
236
280
  })(), t = {
237
- widget: i,
238
- onDrilldown: Y
281
+ widget: a,
282
+ onDrilldown: X
239
283
  };
240
- if (Wt) {
284
+ if (cn) {
241
285
  let e = {};
242
- if (q && typeof q == "object" && !Array.isArray(q) && Object.keys(q).length > 0 && (e = { ...q }), i.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
243
- let t = i.config?.valueField;
286
+ if (U && typeof U == "object" && !Array.isArray(U) && Object.keys(U).length > 0 && (e = { ...U }), a.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
287
+ let t = a.config?.valueField;
244
288
  if (t && t in e) {
245
289
  let n = e[t], r = typeof n == "number" ? n.toLocaleString() : String(n);
246
290
  e = {
247
291
  ...e,
248
292
  value: n,
249
293
  title: e.title || r,
250
- description: e.description || i.title || "",
294
+ description: e.description || a.title || "",
251
295
  text: e.text || r
252
296
  };
253
297
  }
254
298
  }
255
- return /* @__PURE__ */ m(De, {
256
- widget: i,
299
+ return /* @__PURE__ */ h(Pe, {
300
+ widget: a,
257
301
  data: e,
258
- isEditMode: w,
259
- isSelected: E,
260
- isLoading: V,
261
- error: H,
262
- onDrilldown: Y,
263
- onAction: $
302
+ isEditMode: C,
303
+ isSelected: T,
304
+ isLoading: R,
305
+ error: z,
306
+ onDrilldown: X,
307
+ onAction: M ? void 0 : un
264
308
  });
265
309
  }
266
- switch (i.type?.toLowerCase() || "") {
267
- case "metric_card": return /* @__PURE__ */ m(Fe, {
310
+ switch (a.type?.toLowerCase() || "") {
311
+ case "metric_card": return /* @__PURE__ */ h(He, {
268
312
  ...t,
269
313
  data: e
270
314
  });
271
- case "kpi_card_comparison": return /* @__PURE__ */ m(qe, {
315
+ case "kpi_card_comparison": return /* @__PURE__ */ h(et, {
272
316
  ...t,
273
317
  data: e
274
318
  });
275
319
  case "chart":
276
- case "funnel_chart": return /* @__PURE__ */ m(Ie, {
320
+ case "funnel_chart": return /* @__PURE__ */ h(Ue, {
277
321
  ...t,
278
322
  data: e
279
323
  });
280
- case "waterfall": return /* @__PURE__ */ m(tt, {
324
+ case "waterfall": return /* @__PURE__ */ h(ct, {
281
325
  ...t,
282
326
  data: e
283
327
  });
284
- case "sankey": return /* @__PURE__ */ m($e, {
328
+ case "sankey": return /* @__PURE__ */ h(ot, {
285
329
  ...t,
286
330
  data: e
287
331
  });
288
- case "box_plot": return /* @__PURE__ */ m(et, {
332
+ case "box_plot": return /* @__PURE__ */ h(st, {
289
333
  ...t,
290
334
  data: e
291
335
  });
292
- case "table": return /* @__PURE__ */ m(Le, {
336
+ case "table": return /* @__PURE__ */ h(We, {
293
337
  ...t,
294
338
  data: e
295
339
  });
296
- case "pivot_table": return /* @__PURE__ */ m(Re, {
340
+ case "pivot_table": return /* @__PURE__ */ h(Ge, {
297
341
  ...t,
298
342
  data: e
299
343
  });
300
- case "gauge": return /* @__PURE__ */ m(ze, {
344
+ case "gauge": return /* @__PURE__ */ h(Ke, {
301
345
  ...t,
302
346
  data: e
303
347
  });
304
- case "progress": return /* @__PURE__ */ m(Be, {
348
+ case "progress": return /* @__PURE__ */ h(qe, {
305
349
  ...t,
306
350
  data: e
307
351
  });
308
- case "list": return /* @__PURE__ */ m(Ve, {
352
+ case "list": return /* @__PURE__ */ h(Je, {
309
353
  ...t,
310
354
  data: e
311
355
  });
312
- case "heatmap": return /* @__PURE__ */ m(He, {
356
+ case "heatmap": return /* @__PURE__ */ h(Ye, {
313
357
  ...t,
314
358
  data: e
315
359
  });
316
- case "retention": return /* @__PURE__ */ m(Ue, {
360
+ case "retention": return /* @__PURE__ */ h(Xe, {
317
361
  ...t,
318
362
  data: e
319
363
  });
320
- case "calendar": return /* @__PURE__ */ m(We, {
364
+ case "calendar": return /* @__PURE__ */ h(Ze, {
321
365
  ...t,
322
366
  data: e
323
367
  });
324
- case "timeline": return /* @__PURE__ */ m(Ke, {
368
+ case "timeline": return /* @__PURE__ */ h($e, {
325
369
  ...t,
326
370
  data: e
327
371
  });
328
- case "kanban": return /* @__PURE__ */ m(Ge, {
372
+ case "kanban": return /* @__PURE__ */ h(Qe, {
329
373
  ...t,
330
374
  data: e
331
375
  });
332
- case "form": return /* @__PURE__ */ m(Qe, {
376
+ case "form": return /* @__PURE__ */ h(at, {
333
377
  ...t,
334
378
  data: e
335
379
  });
336
- case "text": return /* @__PURE__ */ m(Je, {
380
+ case "text": return /* @__PURE__ */ h(tt, {
337
381
  ...t,
338
382
  data: e
339
383
  });
340
- case "iframe": return /* @__PURE__ */ m(Xe, {
384
+ case "iframe": return /* @__PURE__ */ h(rt, {
341
385
  ...t,
342
386
  data: e
343
387
  });
344
- case "map": return /* @__PURE__ */ m(Ye, {
388
+ case "map": return /* @__PURE__ */ h(nt, {
345
389
  ...t,
346
390
  data: e
347
391
  });
348
- case "custom": return /* @__PURE__ */ m(Ze, {
392
+ case "custom": return /* @__PURE__ */ h(it, {
349
393
  ...t,
350
394
  data: e
351
395
  });
352
- default: return c || /* @__PURE__ */ m(o, { widgetType: i.type });
396
+ default: return l || /* @__PURE__ */ h(ye, { widgetType: a.type });
353
397
  }
354
398
  }, [
355
- i,
356
- q,
357
- c,
358
- Y,
359
- Wt,
360
- w,
361
- E,
362
- V,
363
- H,
364
- $
365
- ]), qt = () => {
366
- if (V) return /* @__PURE__ */ m(a, {});
367
- if (H) return /* @__PURE__ */ m(fe, {
368
- error: H,
369
- onRetry: _
399
+ a,
400
+ U,
401
+ l,
402
+ X,
403
+ cn,
404
+ C,
405
+ T,
406
+ R,
407
+ z,
408
+ un,
409
+ M
410
+ ]), fn = () => {
411
+ if (M && an) {
412
+ let e = i({
413
+ historyAvailable: !1,
414
+ reason: "HISTORY_NOT_AVAILABLE"
415
+ }, D);
416
+ return /* @__PURE__ */ h(s, { error: e ?? "" });
417
+ }
418
+ if (M && N && !ge(a.type)) return /* @__PURE__ */ h(ve, {
419
+ result: {
420
+ kind: "unsupported",
421
+ widgetType: a.type
422
+ },
423
+ fromLabel: q.from,
424
+ toLabel: q.to
370
425
  });
371
- if (Ut && !c) return /* @__PURE__ */ m(o, {
372
- widgetType: i.type,
373
- hideEditHint: S,
374
- hasDataSource: P,
375
- compact: (i.position?.height ?? i.positionHeight ?? 4) <= 2,
376
- templateSlot: typeof i.metadata?.templateDataSinkSlot == "string" ? i.metadata.templateDataSinkSlot : null
426
+ if (zt) {
427
+ if (R || G.loading) return /* @__PURE__ */ h(o, {});
428
+ let e = Tt?.message ?? G.error?.message ?? g;
429
+ return e ? /* @__PURE__ */ h(s, { error: e }) : /* @__PURE__ */ h(ve, {
430
+ result: zt,
431
+ fromLabel: q.from,
432
+ toLabel: q.to,
433
+ config: a.config
434
+ });
435
+ }
436
+ if (R) return /* @__PURE__ */ h(o, {});
437
+ if (z) return /* @__PURE__ */ h(s, {
438
+ error: z,
439
+ onRetry: M ? void 0 : _
377
440
  });
378
- let e = `${N.source.kind}|${N.source.ref ?? ""}|${N.parserId ?? ""}|${i.updatedAt ?? ""}`;
379
- return /* @__PURE__ */ m(pe, {
380
- widgetId: i.id,
381
- widgetType: i.type,
382
- widgetTitle: i.title,
441
+ if (sn && !l) return /* @__PURE__ */ h(ye, {
442
+ widgetType: a.type,
443
+ hideEditHint: x,
444
+ hasDataSource: j,
445
+ compact: (a.position?.height ?? a.positionHeight ?? 4) <= 2,
446
+ templateSlot: typeof a.metadata?.templateDataSinkSlot == "string" ? a.metadata.templateDataSinkSlot : null
447
+ });
448
+ let e = `${A.source.kind}|${A.source.ref ?? ""}|${A.parserId ?? ""}|${a.updatedAt ?? ""}`;
449
+ return /* @__PURE__ */ h(be, {
450
+ widgetId: a.id,
451
+ widgetType: a.type,
452
+ widgetTitle: a.title,
383
453
  resetKey: e,
384
- children: c ?? /* @__PURE__ */ m(s, {
385
- fallback: /* @__PURE__ */ m(a, {}),
386
- children: Kt()
454
+ children: l ?? /* @__PURE__ */ h(c, {
455
+ fallback: /* @__PURE__ */ h(o, {}),
456
+ children: dn()
387
457
  })
388
458
  });
389
459
  };
390
- return /* @__PURE__ */ Ne("div", {
391
- ref: W,
392
- ...S ? {} : ke(i.dashboardId, i.id),
460
+ return /* @__PURE__ */ Be("div", {
461
+ ref: Mt,
462
+ ...x ? {} : Ie(a.dashboardId, a.id),
393
463
  className: `
394
464
  group relative flex flex-col
395
465
  h-full w-full min-w-0
396
466
  rounded-card border
397
467
  bg-bg-surface
398
468
  shadow-[var(--shadow-elevation-1)]
399
- ${C.animationsEnabled ? "motion-safe:transition-[box-shadow,border-color] motion-safe:duration-200" : ""}
400
- ${E && w ? "border-[var(--color-action-primary-border)] ring-2 ring-[var(--color-action-primary-border)]/30 shadow-[var(--shadow-elevation-2)]" : C.showWidgetBorders ? "border-[var(--color-border-subtle)] hover:border-action-primary-bg hover:shadow-[var(--shadow-elevation-2)]" : "border-transparent"}
401
- ${w ? "cursor-pointer" : ""}
402
- ${h}
469
+ ${S.animationsEnabled ? "motion-safe:transition-[box-shadow,border-color] motion-safe:duration-200" : ""}
470
+ ${T && C ? "border-[var(--color-action-primary-border)] ring-2 ring-[var(--color-action-primary-border)]/30 shadow-[var(--shadow-elevation-2)]" : S.showWidgetBorders ? "border-[var(--color-border-subtle)] hover:border-action-primary-bg hover:shadow-[var(--shadow-elevation-2)]" : "border-transparent"}
471
+ ${C ? "cursor-pointer" : ""}
472
+ ${dt}
403
473
  `,
404
- onMouseDown: Lt,
405
- onClick: Rt,
406
- onKeyDown: zt,
407
- tabIndex: w ? 0 : -1,
408
- role: w ? "button" : void 0,
409
- "aria-selected": E,
410
- "aria-label": `Widget: ${i.title}`,
411
- "data-widget-id": i.id,
412
- "data-widget-type": i.type,
474
+ onMouseDown: $t,
475
+ onClick: en,
476
+ onKeyDown: tn,
477
+ tabIndex: C ? 0 : -1,
478
+ role: C ? "button" : void 0,
479
+ "aria-selected": T,
480
+ "aria-label": `Widget: ${a.title}`,
481
+ "data-widget-id": a.id,
482
+ "data-widget-type": a.type,
413
483
  children: [
414
- /* @__PURE__ */ m(ue, {
415
- widget: i,
416
- previewOnly: S,
417
- definition: pt,
418
- isSelected: E,
419
- isEditMode: w,
420
- isLoading: V,
421
- isSampleData: Ct,
422
- timeUntilRefresh: i.refreshInterval && !gt ? re(ht) : void 0,
423
- hasDrilldown: J,
424
- onRefresh: _,
425
- onExportCSV: Tt ? Mt : void 0,
426
- onExportPNG: Nt,
427
- onDrilldown: Y ? () => Y() : void 0,
428
- onToggleComments: S ? void 0 : St,
429
- commentsOpen: _t,
430
- commentCount: yt ? xt : void 0,
431
- onExplain: S ? void 0 : at,
432
- explainOpen: ot,
433
- onSpotOutliers: Et.length > 0 ? () => Ot(!0) : void 0,
434
- onReconcile: jt ? () => At(!0) : void 0
484
+ /* @__PURE__ */ h(pe, {
485
+ widget: a,
486
+ previewOnly: x,
487
+ definition: Ot,
488
+ isSelected: T,
489
+ isEditMode: C,
490
+ isLoading: R,
491
+ isSampleData: Bt,
492
+ timeUntilRefresh: a.refreshInterval && !jt ? ie(At) : void 0,
493
+ hasDrilldown: Y,
494
+ onRefresh: M ? void 0 : _,
495
+ onExportCSV: Ht ? Jt : void 0,
496
+ onExportPNG: Yt,
497
+ onDrilldown: X ? () => X() : void 0,
498
+ onToggleComments: x ? void 0 : Rt,
499
+ commentsOpen: Nt,
500
+ commentCount: Ft ? Lt : void 0,
501
+ onExplain: x || M ? void 0 : mt,
502
+ explainOpen: ht,
503
+ onSpotOutliers: Ut.length > 0 ? () => J(!0) : void 0,
504
+ onReconcile: qt && !M ? () => Kt(!0) : void 0
435
505
  }),
436
- ot && st,
437
- wt.length > 0 && /* @__PURE__ */ m("div", {
506
+ ht && !M && gt,
507
+ Vt.length > 0 && /* @__PURE__ */ h("div", {
438
508
  role: "status",
439
509
  "data-testid": "widget-filter-not-applicable",
440
510
  className: "mx-3 mt-2 rounded bg-status-warning-bg-subtle px-2 py-1 text-xs text-status-warning-text",
441
- children: wt.map((e) => lt("bigconsole.widget.filterNotApplicable", "Filter '{{name}}' does not apply to this widget (no field '{{field}}')", {
511
+ children: Vt.map((e) => D("bigconsole.widget.filterNotApplicable", "Filter '{{name}}' does not apply to this widget (no field '{{field}}')", {
442
512
  name: e.name,
443
513
  field: e.field
444
514
  })).join(" ")
445
515
  }),
446
- /* @__PURE__ */ m("div", {
516
+ /* @__PURE__ */ h("div", {
447
517
  className: `
448
518
  flex-1 overflow-hidden min-h-0 min-w-0
449
- ${C.compactMode ? "p-2" : "p-3 sm:p-4"}
450
- ${Z && !w ? "cursor-pointer" : ""}
519
+ ${S.compactMode ? "p-2" : "p-3 sm:p-4"}
520
+ ${Q && !C ? "cursor-pointer" : ""}
451
521
  `,
452
- title: Z && !w ? "Click data to drill down" : void 0,
453
- children: /* @__PURE__ */ m("div", {
522
+ title: Q && !C ? "Click data to drill down" : void 0,
523
+ children: /* @__PURE__ */ h("div", {
454
524
  className: "h-full min-w-0 overflow-auto",
455
- children: qt()
525
+ children: fn()
456
526
  })
457
527
  }),
458
- y && y.length > 0 && !V && !H && /* @__PURE__ */ m("div", {
528
+ v && v.length > 0 && !R && !z && !M && /* @__PURE__ */ h("div", {
459
529
  className: "min-w-0 border-t border-[var(--color-border-subtle)] bg-bg-sunken px-3 py-2 sm:px-4",
460
530
  style: { flexShrink: 0 },
461
- children: /* @__PURE__ */ m(Oe, {
462
- actions: y,
463
- context: Gt,
464
- onAction: b,
465
- disabled: w,
531
+ children: /* @__PURE__ */ h(Fe, {
532
+ actions: v,
533
+ context: ln,
534
+ onAction: y,
535
+ disabled: C,
466
536
  layout: "horizontal",
467
537
  size: "sm"
468
538
  })
469
539
  }),
470
- Z && !w && /* @__PURE__ */ m("div", {
540
+ Q && !C && /* @__PURE__ */ h("div", {
471
541
  className: "\n absolute bottom-2 right-2\n opacity-0 group-hover:opacity-100\n transition-opacity duration-200\n ",
472
542
  title: "Click to drill down",
473
- children: /* @__PURE__ */ m("svg", {
543
+ children: /* @__PURE__ */ h("svg", {
474
544
  className: "w-4 h-4 text-text-secondary",
475
545
  fill: "none",
476
546
  stroke: "currentColor",
477
547
  viewBox: "0 0 24 24",
478
- children: /* @__PURE__ */ m("path", {
548
+ children: /* @__PURE__ */ h("path", {
479
549
  strokeLinecap: "round",
480
550
  strokeLinejoin: "round",
481
551
  strokeWidth: 2,
@@ -483,48 +553,66 @@ var it = l(function({ widget: i, children: c, data: l, className: h = "", isLoad
483
553
  })
484
554
  })
485
555
  }),
486
- _t && /* @__PURE__ */ m(s, {
556
+ Nt && /* @__PURE__ */ h(c, {
487
557
  fallback: null,
488
- children: /* @__PURE__ */ m(nt, {
489
- widgetId: i.id,
490
- onClose: () => vt(!1)
558
+ children: /* @__PURE__ */ h(lt, {
559
+ widgetId: a.id,
560
+ onClose: () => Pt(!1)
491
561
  })
492
562
  }),
493
- /* @__PURE__ */ m(xe, {
494
- open: Dt,
495
- onClose: () => Ot(!1),
496
- widgetTitle: i.title,
497
- series: Et
563
+ /* @__PURE__ */ h(Oe, {
564
+ open: Wt,
565
+ onClose: () => J(!1),
566
+ widgetTitle: a.title,
567
+ series: Ut
498
568
  }),
499
- kt && /* @__PURE__ */ m(s, {
569
+ Gt && !M && /* @__PURE__ */ h(c, {
500
570
  fallback: null,
501
- children: /* @__PURE__ */ m(Pe, {
502
- open: kt,
503
- onClose: () => At(!1),
504
- widget: i
571
+ children: /* @__PURE__ */ h(Ve, {
572
+ open: Gt,
573
+ onClose: () => Kt(!1),
574
+ widget: a
505
575
  })
506
576
  })
507
577
  ]
508
578
  });
509
- }, h), g = c(() => import("../explore/SavedQueryWidget.js").then((e) => ({ default: e.SavedQueryWidget })));
579
+ }, dt), g = l(() => import("../explore/SavedQueryWidget.js").then((e) => ({ default: e.SavedQueryWidget })));
510
580
  function _({ widget: e }) {
511
- return r((e) => e.viewMode === "edit") ? /* @__PURE__ */ m("div", {
581
+ return r((e) => e.viewMode === "edit") ? /* @__PURE__ */ h("div", {
512
582
  className: "float-right ml-2",
513
- children: /* @__PURE__ */ m(i, {
583
+ children: /* @__PURE__ */ h(a, {
514
584
  widget: e,
515
585
  isEditMode: !0
516
586
  })
517
587
  }) : null;
518
588
  }
519
- var v = (e) => e.widget.savedQueryId ? /* @__PURE__ */ m(s, {
520
- fallback: /* @__PURE__ */ m("span", {
521
- role: "status",
522
- children: "Loading widget…"
523
- }),
524
- children: /* @__PURE__ */ m(g, {
525
- id: e.widget.id,
526
- title: e.widget.title,
527
- controls: e.previewOnly ? void 0 : /* @__PURE__ */ m(_, { widget: e.widget })
528
- })
529
- }) : /* @__PURE__ */ m(it, { ...e });
589
+ function pt({ title: e }) {
590
+ let { t } = Re(), n = i({
591
+ historyAvailable: !1,
592
+ reason: "HISTORY_NOT_AVAILABLE"
593
+ }, t);
594
+ return /* @__PURE__ */ Be("section", {
595
+ "aria-label": e ?? void 0,
596
+ "data-testid": "saved-query-history-unavailable",
597
+ className: "h-full min-w-0 rounded-lg border border-[var(--color-border-subtle)] bg-bg-surface p-3",
598
+ children: [e && /* @__PURE__ */ h("h3", {
599
+ className: "mb-2 truncate text-sm font-medium text-text-primary",
600
+ children: e
601
+ }), n && /* @__PURE__ */ h(s, { error: n })]
602
+ });
603
+ }
604
+ var v = (e) => {
605
+ let { asOf: t } = de();
606
+ return e.widget.savedQueryId ? t ? /* @__PURE__ */ h(pt, { title: e.widget.title }) : /* @__PURE__ */ h(c, {
607
+ fallback: /* @__PURE__ */ h("span", {
608
+ role: "status",
609
+ children: "Loading widget…"
610
+ }),
611
+ children: /* @__PURE__ */ h(g, {
612
+ id: e.widget.id,
613
+ title: e.widget.title,
614
+ controls: e.previewOnly ? void 0 : /* @__PURE__ */ h(_, { widget: e.widget })
615
+ })
616
+ }) : /* @__PURE__ */ h(ft, { ...e });
617
+ };
530
618
  export { v as WidgetWrapper, v as default };