@burdenoff/microfe-bigconsole 2026.622.1 → 2026.624.1

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.
@@ -1,38 +1,55 @@
1
1
  import { useIsWidgetSelected as e, useWidgetStore as t, useWidgetUIState as n } from "../../store/widgetStore.js";
2
2
  import { useDashboardStore as r, useGlobalFilterValues as i } from "../../store/dashboardStore.js";
3
3
  import "../../store/index.js";
4
- import a from "../../hooks/useWidgetData.js";
5
- import { getWidgetDefinition as o } from "./WidgetRegistry.js";
4
+ import { GetDashboardDocument as a } from "../../../generated/wspace-operations.js";
5
+ import o from "../../hooks/useWidgetData.js";
6
+ import { getWidgetDefinition as s } from "./WidgetRegistry.js";
6
7
  import { formatTimeUntilRefresh as ee, useWidgetAutoRefresh as te } from "../../hooks/useAutoRefresh.js";
7
8
  import ne from "../../hooks/useWidgetComments.js";
8
9
  import re from "../../hooks/useWidgetExport.js";
9
10
  import ie from "../../hooks/useDrilldown.js";
10
11
  import "../../hooks/index.js";
11
12
  import ae from "./WidgetHeader.js";
12
- import s from "./states/LoadingState.js";
13
+ import c from "./states/LoadingState.js";
13
14
  import oe from "./states/ErrorState.js";
14
- import c from "./states/EmptyState.js";
15
+ import l from "./states/EmptyState.js";
15
16
  import se from "./WidgetErrorBoundary.js";
16
17
  import { hasCustomIframeConfig as ce, hasRenderableCustomConfig as le } from "./custom/config.js";
17
18
  import ue from "../../renderers/factory/WidgetRendererFactory.js";
18
19
  import de from "./widget-actions/WidgetActions.js";
19
20
  import "./widget-actions/index.js";
20
- import { Suspense as l, lazy as u, memo as d, useCallback as f, useEffect as fe, useMemo as p, useRef as m, useState as h } from "react";
21
- import { jsx as g, jsxs as pe } from "react/jsx-runtime";
21
+ import { Suspense as u, lazy as d, memo as f, useCallback as p, useEffect as fe, useMemo as m, useRef as h, useState as g } from "react";
22
+ import { useApolloClient as pe } from "@apollo/client/react";
23
+ import { jsx as _, jsxs as me } from "react/jsx-runtime";
22
24
  //#region src/bigconsole/components/widgets/WidgetWrapper.tsx
23
- var me = u(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), he = u(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), ge = u(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), _e = u(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), ve = u(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), ye = u(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), be = u(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), xe = u(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), Se = u(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), Ce = u(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), we = u(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), Te = u(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), Ee = u(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), De = u(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), Oe = u(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), ke = u(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), Ae = u(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget }))), je = u(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget }))), Me = u(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments })));
24
- function _(e, t) {
25
+ var he = d(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), ge = d(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), _e = d(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), ve = d(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), ye = d(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), be = d(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), xe = d(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), Se = d(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), Ce = d(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), we = d(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), Te = d(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), Ee = d(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), De = d(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Oe = d(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), ke = d(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Ae = d(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), je = d(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget }))), Me = d(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget }))), Ne = d(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments })));
26
+ function v(e, t) {
25
27
  if (e.widget.id !== t.widget.id || e.widget.updatedAt !== t.widget.updatedAt || e.isLoading !== t.isLoading || e.error !== t.error || (e.actions?.length ?? 0) !== (t.actions?.length ?? 0)) return !1;
26
28
  if (e.actions && t.actions) {
27
29
  for (let n = 0; n < e.actions.length; n++) if (e.actions[n]?.id !== t.actions[n]?.id) return !1;
28
30
  }
29
31
  return !(e.data !== t.data || JSON.stringify(e.filterValues) !== JSON.stringify(t.filterValues));
30
32
  }
31
- var v = d(function({ widget: u, children: d, data: _, className: v = "", isLoading: Ne, error: Pe, onRefresh: y, onDrilldown: Fe, actions: b, onAction: x, filterValues: S }) {
32
- let C = r((e) => e.viewMode === "edit"), w = t((e) => e.selectWidget), T = e(u.id), E = n(u.id), D = i(), Ie = !!u.dataSinkId || !!u.datasetId || !!u.parserId, { data: O, loading: Le } = a(u.id, {
33
- skip: !Ie,
34
- pollInterval: (u.refreshInterval ?? 0) * 1e3 || 0
35
- }), k = p(() => {
33
+ var y = f(function({ widget: d, children: f, data: v, className: y = "", isLoading: Pe, error: Fe, onRefresh: b, onDrilldown: Ie, actions: x, onAction: S, filterValues: C }) {
34
+ let w = r((e) => e.viewMode === "edit"), T = t((e) => e.selectWidget), E = e(d.id), D = n(d.id), O = i(), Le = pe(), k = d.dashboardId, A = m(() => {
35
+ if (!k) return {};
36
+ try {
37
+ let e = Le.readQuery({
38
+ query: a,
39
+ variables: { id: k }
40
+ }), t = {};
41
+ for (let n of e?.getDashboard?.globalFilters ?? []) {
42
+ let e = n.config?.field;
43
+ typeof e == "string" && e && (t[n.id] = e);
44
+ }
45
+ return t;
46
+ } catch {
47
+ return {};
48
+ }
49
+ }, [Le, k]), Re = !!d.dataSinkId || !!d.datasetId || !!d.parserId, { data: j, loading: ze } = o(d.id, {
50
+ skip: !Re,
51
+ pollInterval: (d.refreshInterval ?? 0) * 1e3 || 0
52
+ }), M = m(() => {
36
53
  if (typeof window > "u") return {};
37
54
  let e = new URLSearchParams(window.location.search), t = {};
38
55
  return e.forEach((e, n) => {
@@ -41,56 +58,56 @@ var v = d(function({ widget: u, children: d, data: _, className: v = "", isLoadi
41
58
  r.startsWith("__") || (t[r] = e);
42
59
  }
43
60
  }), t;
44
- }, []), A = p(() => {
61
+ }, []), N = m(() => {
45
62
  let e = {};
46
- return k && Object.keys(k).length > 0 && Object.assign(e, k), D && Object.keys(D).length > 0 && Object.assign(e, D), S && Object.keys(S).length > 0 && Object.assign(e, S), e;
63
+ return M && Object.keys(M).length > 0 && Object.assign(e, M), O && Object.keys(O).length > 0 && Object.assign(e, O), C && Object.keys(C).length > 0 && Object.assign(e, C), e;
47
64
  }, [
48
- k,
49
- D,
50
- S
51
- ]), j = Object.keys(A).length > 0, M = Ne ?? (Le && !O) ?? E.isLoading, N = Pe ?? E.errorMessage, Re = o(u.type), P = m(y);
65
+ M,
66
+ O,
67
+ C
68
+ ]), P = Object.keys(N).length > 0, F = Pe ?? (ze && !j) ?? D.isLoading, I = Fe ?? D.errorMessage, Be = s(d.type), L = h(b);
52
69
  fe(() => {
53
- P.current = y;
54
- }, [y]);
55
- let F = f(async () => {
56
- P.current && await P.current();
57
- }, []), { timeUntilRefresh: ze, isPaused: Be } = te({
58
- widgetId: u.id,
59
- refreshInterval: u.refreshInterval,
60
- onRefresh: F,
61
- enabled: !C && !!u.refreshInterval
62
- }), I = m(null), [L, R] = h(!1), [z, Ve] = h(!1), { count: He } = ne(u.id, z), Ue = f(() => {
63
- R((e) => {
70
+ L.current = b;
71
+ }, [b]);
72
+ let Ve = p(async () => {
73
+ L.current && await L.current();
74
+ }, []), { timeUntilRefresh: He, isPaused: Ue } = te({
75
+ widgetId: d.id,
76
+ refreshInterval: d.refreshInterval,
77
+ onRefresh: Ve,
78
+ enabled: !w && !!d.refreshInterval
79
+ }), R = h(null), [z, B] = g(!1), [V, We] = g(!1), { count: Ge } = ne(d.id, V), Ke = p(() => {
80
+ B((e) => {
64
81
  let t = !e;
65
- return t && Ve(!0), t;
82
+ return t && We(!0), t;
66
83
  });
67
- }, []), B = p(() => {
68
- if (_ && Array.isArray(_)) return _;
69
- let e = u.data;
84
+ }, []), H = m(() => {
85
+ if (v && Array.isArray(v)) return v;
86
+ let e = d.data;
70
87
  if (e?.processed && Array.isArray(e.processed)) return e.processed;
71
88
  if (e?.raw) {
72
89
  let t = typeof e.raw == "string" ? JSON.parse(e.raw) : e.raw;
73
90
  if (Array.isArray(t)) return t;
74
91
  }
75
92
  return null;
76
- }, [_, u]), { exportCSV: We, exportPNG: Ge } = re(u, {
77
- data: B,
78
- containerRef: I
79
- }), V = f((e) => {
93
+ }, [v, d]), { exportCSV: qe, exportPNG: Je } = re(d, {
94
+ data: H,
95
+ containerRef: R
96
+ }), U = p((e) => {
80
97
  if (e == null) return !1;
81
98
  if (Array.isArray(e)) return e.length > 0;
82
99
  if (typeof e == "object") {
83
100
  let t = e, n = Object.keys(t);
84
101
  return n.length === 0 ? !1 : n.some((e) => {
85
102
  let n = t[e];
86
- return n == null || n === "" ? !1 : Array.isArray(n) ? n.length > 0 : typeof n == "object" ? V(n) : !0;
103
+ return n == null || n === "" ? !1 : Array.isArray(n) ? n.length > 0 : typeof n == "object" ? U(n) : !0;
87
104
  });
88
105
  }
89
106
  return !0;
90
- }, []), H = f((e) => {
91
- if (!j || !e) return e;
107
+ }, []), W = p((e) => {
108
+ if (!P || !e) return e;
92
109
  let t = {}, n = {};
93
- Object.entries(A || {}).forEach(([e, r]) => {
110
+ Object.entries(N || {}).forEach(([e, r]) => {
94
111
  if (e.startsWith("ctx_")) {
95
112
  let n = e.slice(4);
96
113
  t[n] = r;
@@ -151,19 +168,29 @@ var v = d(function({ widget: u, children: d, data: _, className: v = "", isLoadi
151
168
  continue;
152
169
  }
153
170
  }
154
- let n = i(e, t);
155
- if (n !== void 0) {
156
- if (!r(n, a)) return !1;
171
+ if (typeof a == "object" && a && !Array.isArray(a)) continue;
172
+ let n = A[t];
173
+ if (n) {
174
+ let t = i(e, n);
175
+ if (t !== void 0) {
176
+ if (!r(t, a)) return !1;
177
+ continue;
178
+ }
179
+ continue;
180
+ }
181
+ let o = i(e, t);
182
+ if (o !== void 0) {
183
+ if (!r(o, a)) return !1;
157
184
  continue;
158
185
  }
159
- let o = String(a).toLowerCase();
160
- if (!Object.values(e).map((e) => String(e).toLowerCase()).some((e) => e === o || e.includes(o))) {
186
+ let s = String(a).toLowerCase();
187
+ if (!Object.values(e).map((e) => String(e).toLowerCase()).some((e) => e === s || e.includes(s))) {
161
188
  let t = Object.keys(e).map((e) => e.toLowerCase()).filter((e) => e.includes("category") || e.includes("type") || e.includes("status") || e.includes("name") || e.includes("region") || e.includes("group")), n = !1;
162
189
  for (let r of t) {
163
190
  let t = Object.keys(e).find((e) => e.toLowerCase() === r);
164
191
  if (t) {
165
192
  let r = String(e[t]).toLowerCase();
166
- if (r === o || r.includes(o)) {
193
+ if (r === s || r.includes(s)) {
167
194
  n = !0;
168
195
  break;
169
196
  }
@@ -209,123 +236,124 @@ var v = d(function({ widget: u, children: d, data: _, className: v = "", isLoadi
209
236
  }
210
237
  return e;
211
238
  }, [
212
- j,
213
- A,
214
- u.id
215
- ]), U = p(() => {
239
+ P,
240
+ N,
241
+ d.id,
242
+ A
243
+ ]), G = m(() => {
216
244
  let e = null;
217
- if (_ && V(_)) e = _;
218
- else if (O) {
219
- let t = O;
220
- if (t?.processed && V(t.processed)) e = t.processed;
245
+ if (v && U(v)) e = v;
246
+ else if (j) {
247
+ let t = j;
248
+ if (t?.processed && U(t.processed)) e = t.processed;
221
249
  else if (t?.raw) try {
222
250
  let n = typeof t.raw == "string" ? JSON.parse(t.raw) : t.raw;
223
- V(n) && (e = n);
251
+ U(n) && (e = n);
224
252
  } catch {}
225
253
  } else {
226
- let t = u.data;
227
- if (t?.processed && V(t.processed)) e = t.processed;
254
+ let t = d.data;
255
+ if (t?.processed && U(t.processed)) e = t.processed;
228
256
  else if (t?.raw) try {
229
257
  let n = typeof t.raw == "string" ? JSON.parse(t.raw) : t.raw;
230
- V(n) && (e = n);
258
+ U(n) && (e = n);
231
259
  } catch {}
232
260
  }
233
261
  if (!e) {
234
- let t = u.config?.mockData;
262
+ let t = d.config?.mockData;
235
263
  if (t) try {
236
264
  let n = typeof t == "string" ? JSON.parse(t) : t;
237
- V(n) && (e = n);
265
+ U(n) && (e = n);
238
266
  } catch {}
239
267
  }
240
268
  if (e && typeof e == "object" && !Array.isArray(e)) {
241
- let t = u.config, n = t?.dataKey ?? t?.dataPath ?? t?.seriesPath;
269
+ let t = d.config, n = t?.dataKey ?? t?.dataPath ?? t?.seriesPath;
242
270
  if (n && typeof n == "string") {
243
271
  let t = n.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
244
- t != null && V(t) && (e = t);
272
+ t != null && U(t) && (e = t);
245
273
  }
246
274
  }
247
- return j && e ? H(e) : e;
275
+ return P && e ? W(e) : e;
248
276
  }, [
249
- _,
250
- u,
251
- O,
277
+ v,
278
+ d,
252
279
  j,
253
- H,
254
- A,
255
- V
256
- ]), W = p(() => U ?? null, [U]), { executeDrilldown: G, canDrilldown: K } = ie({ onDrilldown: (e, t) => {
257
- Fe?.(e);
258
- } }), q = p(() => K(u), [u, K]), J = f((e) => {
259
- if (!u.drilldown?.enabled) return;
280
+ P,
281
+ W,
282
+ N,
283
+ U
284
+ ]), K = m(() => G ?? null, [G]), { executeDrilldown: q, canDrilldown: J } = ie({ onDrilldown: (e, t) => {
285
+ Ie?.(e);
286
+ } }), Y = m(() => J(d), [d, J]), X = p((e) => {
287
+ if (!d.drilldown?.enabled) return;
260
288
  let t = {
261
289
  selectedData: e || {},
262
- globalFilters: D || {},
263
- widgetData: W || {},
290
+ globalFilters: O || {},
291
+ widgetData: K || {},
264
292
  metadata: {
265
- widgetId: u.id,
266
- widgetType: u.type,
267
- widgetTitle: u.title
293
+ widgetId: d.id,
294
+ widgetType: d.type,
295
+ widgetTitle: d.title
268
296
  },
269
- sourceDashboardId: u.dashboardId
297
+ sourceDashboardId: d.dashboardId
270
298
  };
271
- G(u.drilldown, t);
299
+ q(d.drilldown, t);
272
300
  }, [
273
- u,
274
- W,
275
- D,
276
- G
277
- ]), Y = m(null), Ke = f((e) => {
278
- Y.current = {
301
+ d,
302
+ K,
303
+ O,
304
+ q
305
+ ]), Z = h(null), Ye = p((e) => {
306
+ Z.current = {
279
307
  x: e.clientX,
280
308
  y: e.clientY
281
309
  };
282
- }, []), qe = f((e) => {
283
- if (e.stopPropagation(), Y.current) {
284
- let t = Math.abs(e.clientX - Y.current.x), n = Math.abs(e.clientY - Y.current.y);
310
+ }, []), Xe = p((e) => {
311
+ if (e.stopPropagation(), Z.current) {
312
+ let t = Math.abs(e.clientX - Z.current.x), n = Math.abs(e.clientY - Z.current.y);
285
313
  if (t > 5 || n > 5) {
286
- Y.current = null;
314
+ Z.current = null;
287
315
  return;
288
316
  }
289
317
  }
290
- Y.current = null, C && w(u.id);
318
+ Z.current = null, w && T(d.id);
291
319
  }, [
292
- C,
293
320
  w,
294
- u.id
295
- ]), Je = f((e) => {
296
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), C && w(u.id));
321
+ T,
322
+ d.id
323
+ ]), Ze = p((e) => {
324
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), w && T(d.id));
297
325
  }, [
298
- C,
299
326
  w,
300
- u.id
301
- ]), Ye = p(() => u.type === "custom" && le(u.config), [u.type, u.config]), Xe = p(() => u.type === "custom" && ce(u.config), [u.type, u.config]), X = q && !Xe, Ze = !M && !N && !W && !Ye, Z = p(() => u.renderer, [u]), Q = p(() => Z && Z !== "BIGCONSOLE", [Z]), Qe = p(() => ({
302
- widgetId: u.id,
303
- data: W || {}
304
- }), [u.id, W]), $ = f((e, t) => {
305
- if (!x) return;
306
- let n = b?.find((t) => t.name === e.name);
307
- x(n || e, t);
308
- }, [x, b]), $e = f(() => {
327
+ T,
328
+ d.id
329
+ ]), Qe = m(() => d.type === "custom" && le(d.config), [d.type, d.config]), $e = m(() => d.type === "custom" && ce(d.config), [d.type, d.config]), Q = Y && !$e, et = !F && !I && !K && !Qe, $ = m(() => d.renderer, [d]), tt = m(() => $ && $ !== "BIGCONSOLE", [$]), nt = m(() => ({
330
+ widgetId: d.id,
331
+ data: K || {}
332
+ }), [d.id, K]), rt = p((e, t) => {
333
+ if (!S) return;
334
+ let n = x?.find((t) => t.name === e.name);
335
+ S(n || e, t);
336
+ }, [S, x]), it = p(() => {
309
337
  let e = {
310
- widget: u,
338
+ widget: d,
311
339
  data: (() => {
312
- if (!W) return W;
313
- if (u.type === "table" || u.type === "pivot_table") {
314
- if (Array.isArray(W)) return W;
315
- if (W && typeof W == "object" && "rows" in W) return W.rows;
340
+ if (!K) return K;
341
+ if (d.type === "table" || d.type === "pivot_table") {
342
+ if (Array.isArray(K)) return K;
343
+ if (K && typeof K == "object" && "rows" in K) return K.rows;
316
344
  }
317
- if (u.type === "list") {
318
- if (Array.isArray(W)) return W;
319
- if (W && typeof W == "object" && "items" in W) return W.items;
345
+ if (d.type === "list") {
346
+ if (Array.isArray(K)) return K;
347
+ if (K && typeof K == "object" && "items" in K) return K.items;
320
348
  }
321
- if (u.type === "funnel_chart") {
322
- if (Array.isArray(W)) return W;
323
- if (W && typeof W == "object" && "stages" in W) return W.stages;
349
+ if (d.type === "funnel_chart") {
350
+ if (Array.isArray(K)) return K;
351
+ if (K && typeof K == "object" && "stages" in K) return K.stages;
324
352
  }
325
- if (u.type === "chart") {
326
- if (Array.isArray(W)) return W;
327
- if (W && typeof W == "object" && "datasets" in W) {
328
- let e = W;
353
+ if (d.type === "chart") {
354
+ if (Array.isArray(K)) return K;
355
+ if (K && typeof K == "object" && "datasets" in K) {
356
+ let e = K;
329
357
  if (e.labels && e.datasets) return e.labels.map((t, n) => {
330
358
  let r = { name: t };
331
359
  return e.datasets?.forEach((e) => {
@@ -334,8 +362,8 @@ var v = d(function({ widget: u, children: d, data: _, className: v = "", isLoadi
334
362
  });
335
363
  }
336
364
  }
337
- if (u.type === "text" && W && typeof W == "object" && !("content" in W)) {
338
- let e = W, t = [];
365
+ if (d.type === "text" && K && typeof K == "object" && !("content" in K)) {
366
+ let e = K, t = [];
339
367
  for (let [n, r] of Object.entries(e)) if (r && typeof r == "object" && !Array.isArray(r)) {
340
368
  t.push(`### ${n}`);
341
369
  for (let [e, n] of Object.entries(r)) t.push(`- **${e}:** ${n}`);
@@ -350,174 +378,174 @@ var v = d(function({ widget: u, children: d, data: _, className: v = "", isLoadi
350
378
  format: "markdown"
351
379
  };
352
380
  }
353
- if (u.type === "custom") {
354
- let e = u.config?.valueField;
355
- if (e && W && typeof W == "object" && !Array.isArray(W)) {
356
- let t = W;
381
+ if (d.type === "custom") {
382
+ let e = d.config?.valueField;
383
+ if (e && K && typeof K == "object" && !Array.isArray(K)) {
384
+ let t = K;
357
385
  if (e in t) return {
358
386
  value: t[e],
359
- label: u.title,
387
+ label: d.title,
360
388
  data: t
361
389
  };
362
390
  }
363
391
  }
364
- return W;
392
+ return K;
365
393
  })(),
366
- onDrilldown: q ? J : void 0
394
+ onDrilldown: Y ? X : void 0
367
395
  };
368
- if (Q) {
396
+ if (tt) {
369
397
  let e = {};
370
- if (U && typeof U == "object" && !Array.isArray(U) && Object.keys(U).length > 0 && (e = { ...U }), u.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
371
- let t = u.config?.valueField;
398
+ if (G && typeof G == "object" && !Array.isArray(G) && Object.keys(G).length > 0 && (e = { ...G }), d.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
399
+ let t = d.config?.valueField;
372
400
  if (t && t in e) {
373
401
  let n = e[t], r = typeof n == "number" ? n.toLocaleString() : String(n);
374
402
  e = {
375
403
  ...e,
376
404
  value: n,
377
405
  title: e.title || r,
378
- description: e.description || u.title || "",
406
+ description: e.description || d.title || "",
379
407
  text: e.text || r
380
408
  };
381
409
  }
382
410
  }
383
- return /* @__PURE__ */ g(ue, {
384
- widget: u,
411
+ return /* @__PURE__ */ _(ue, {
412
+ widget: d,
385
413
  data: e,
386
- isEditMode: C,
387
- isSelected: T,
388
- isLoading: M,
389
- error: N,
390
- onDrilldown: q ? J : void 0,
391
- onAction: $
414
+ isEditMode: w,
415
+ isSelected: E,
416
+ isLoading: F,
417
+ error: I,
418
+ onDrilldown: Y ? X : void 0,
419
+ onAction: rt
392
420
  });
393
421
  }
394
- switch (u.type?.toLowerCase() || "") {
395
- case "metric_card": return /* @__PURE__ */ g(me, { ...e });
396
- case "kpi_card_comparison": return /* @__PURE__ */ g(Ee, { ...e });
422
+ switch (d.type?.toLowerCase() || "") {
423
+ case "metric_card": return /* @__PURE__ */ _(he, { ...e });
424
+ case "kpi_card_comparison": return /* @__PURE__ */ _(De, { ...e });
397
425
  case "chart":
398
- case "funnel_chart": return /* @__PURE__ */ g(he, { ...e });
399
- case "table": return /* @__PURE__ */ g(ge, { ...e });
400
- case "pivot_table": return /* @__PURE__ */ g(_e, { ...e });
401
- case "gauge": return /* @__PURE__ */ g(ve, { ...e });
402
- case "progress": return /* @__PURE__ */ g(ye, { ...e });
403
- case "list": return /* @__PURE__ */ g(be, { ...e });
404
- case "heatmap": return /* @__PURE__ */ g(xe, { ...e });
405
- case "retention": return /* @__PURE__ */ g(Se, { ...e });
406
- case "calendar": return /* @__PURE__ */ g(Ce, { ...e });
407
- case "timeline": return /* @__PURE__ */ g(Te, { ...e });
408
- case "kanban": return /* @__PURE__ */ g(we, { ...e });
409
- case "form": return /* @__PURE__ */ g(je, { ...e });
410
- case "text": return /* @__PURE__ */ g(De, { ...e });
411
- case "iframe": return /* @__PURE__ */ g(ke, { ...e });
412
- case "map": return /* @__PURE__ */ g(Oe, { ...e });
413
- case "custom": return /* @__PURE__ */ g(Ae, { ...e });
414
- default: return d || /* @__PURE__ */ g(c, { widgetType: u.type });
426
+ case "funnel_chart": return /* @__PURE__ */ _(ge, { ...e });
427
+ case "table": return /* @__PURE__ */ _(_e, { ...e });
428
+ case "pivot_table": return /* @__PURE__ */ _(ve, { ...e });
429
+ case "gauge": return /* @__PURE__ */ _(ye, { ...e });
430
+ case "progress": return /* @__PURE__ */ _(be, { ...e });
431
+ case "list": return /* @__PURE__ */ _(xe, { ...e });
432
+ case "heatmap": return /* @__PURE__ */ _(Se, { ...e });
433
+ case "retention": return /* @__PURE__ */ _(Ce, { ...e });
434
+ case "calendar": return /* @__PURE__ */ _(we, { ...e });
435
+ case "timeline": return /* @__PURE__ */ _(Ee, { ...e });
436
+ case "kanban": return /* @__PURE__ */ _(Te, { ...e });
437
+ case "form": return /* @__PURE__ */ _(Me, { ...e });
438
+ case "text": return /* @__PURE__ */ _(Oe, { ...e });
439
+ case "iframe": return /* @__PURE__ */ _(Ae, { ...e });
440
+ case "map": return /* @__PURE__ */ _(ke, { ...e });
441
+ case "custom": return /* @__PURE__ */ _(je, { ...e });
442
+ default: return f || /* @__PURE__ */ _(l, { widgetType: d.type });
415
443
  }
416
444
  }, [
417
- u,
418
- W,
419
445
  d,
420
- q,
421
- J,
422
- Q,
423
- C,
424
- T,
425
- M,
426
- N,
427
- $,
428
- U
446
+ K,
447
+ f,
448
+ Y,
449
+ X,
450
+ tt,
451
+ w,
452
+ E,
453
+ F,
454
+ I,
455
+ rt,
456
+ G
429
457
  ]);
430
- return /* @__PURE__ */ pe("div", {
431
- ref: I,
458
+ return /* @__PURE__ */ me("div", {
459
+ ref: R,
432
460
  className: `
433
461
  group relative flex flex-col
434
462
  h-full w-full
435
463
  rounded-lg border
436
464
  bg-bg-surface
437
465
  transition-all duration-200
438
- ${T && C ? "border-action-primary-border ring-2 ring-action-primary-border/30" : "border-border-default hover:border-action-primary-bg"}
439
- ${C ? "cursor-pointer" : ""}
440
- ${v}
466
+ ${E && w ? "border-action-primary-border ring-2 ring-action-primary-border/30" : "border-border-default hover:border-action-primary-bg"}
467
+ ${w ? "cursor-pointer" : ""}
468
+ ${y}
441
469
  `,
442
- onMouseDown: Ke,
443
- onClick: qe,
444
- onKeyDown: Je,
445
- tabIndex: C ? 0 : -1,
446
- role: C ? "button" : void 0,
447
- "aria-selected": T,
448
- "aria-label": `Widget: ${u.title}`,
449
- "data-widget-id": u.id,
450
- "data-widget-type": u.type,
470
+ onMouseDown: Ye,
471
+ onClick: Xe,
472
+ onKeyDown: Ze,
473
+ tabIndex: w ? 0 : -1,
474
+ role: w ? "button" : void 0,
475
+ "aria-selected": E,
476
+ "aria-label": `Widget: ${d.title}`,
477
+ "data-widget-id": d.id,
478
+ "data-widget-type": d.type,
451
479
  children: [
452
- /* @__PURE__ */ g(ae, {
453
- widget: u,
454
- definition: Re,
455
- isSelected: T,
456
- isEditMode: C,
457
- isLoading: M,
458
- timeUntilRefresh: u.refreshInterval && !Be ? ee(ze) : void 0,
459
- hasDrilldown: q,
460
- onRefresh: y,
461
- onExportCSV: B ? We : void 0,
462
- onExportPNG: Ge,
463
- onDrilldown: q ? () => J() : void 0,
464
- onToggleComments: Ue,
465
- commentsOpen: L,
466
- commentCount: z ? He : void 0
480
+ /* @__PURE__ */ _(ae, {
481
+ widget: d,
482
+ definition: Be,
483
+ isSelected: E,
484
+ isEditMode: w,
485
+ isLoading: F,
486
+ timeUntilRefresh: d.refreshInterval && !Ue ? ee(He) : void 0,
487
+ hasDrilldown: Y,
488
+ onRefresh: b,
489
+ onExportCSV: H ? qe : void 0,
490
+ onExportPNG: Je,
491
+ onDrilldown: Y ? () => X() : void 0,
492
+ onToggleComments: Ke,
493
+ commentsOpen: z,
494
+ commentCount: V ? Ge : void 0
467
495
  }),
468
- /* @__PURE__ */ g("div", {
496
+ /* @__PURE__ */ _("div", {
469
497
  className: `
470
498
  flex-1 overflow-hidden p-4 min-h-0
471
- ${X && !C ? "cursor-pointer" : ""}
499
+ ${Q && !w ? "cursor-pointer" : ""}
472
500
  `,
473
- title: X && !C ? "Click data to drill down" : void 0,
474
- children: /* @__PURE__ */ g("div", {
501
+ title: Q && !w ? "Click data to drill down" : void 0,
502
+ children: /* @__PURE__ */ _("div", {
475
503
  className: "h-full overflow-auto",
476
504
  children: (() => {
477
- if (M) return /* @__PURE__ */ g(s, {});
478
- if (N) return /* @__PURE__ */ g(oe, {
479
- error: N,
480
- onRetry: y
505
+ if (F) return /* @__PURE__ */ _(c, {});
506
+ if (I) return /* @__PURE__ */ _(oe, {
507
+ error: I,
508
+ onRetry: b
481
509
  });
482
- if (Ze && !d) return /* @__PURE__ */ g(c, {
483
- widgetType: u.type,
484
- hasDataSource: !!u.parserId || !!u.dataSinkId
510
+ if (et && !f) return /* @__PURE__ */ _(l, {
511
+ widgetType: d.type,
512
+ hasDataSource: !!d.parserId || !!d.dataSinkId
485
513
  });
486
- let e = `${u.parserId ?? ""}|${u.dataSinkId ?? ""}|${u.updatedAt ?? ""}`;
487
- return /* @__PURE__ */ g(se, {
488
- widgetId: u.id,
489
- widgetType: u.type,
490
- widgetTitle: u.title,
514
+ let e = `${d.parserId ?? ""}|${d.dataSinkId ?? ""}|${d.updatedAt ?? ""}`;
515
+ return /* @__PURE__ */ _(se, {
516
+ widgetId: d.id,
517
+ widgetType: d.type,
518
+ widgetTitle: d.title,
491
519
  resetKey: e,
492
- children: d ?? /* @__PURE__ */ g(l, {
493
- fallback: /* @__PURE__ */ g(s, {}),
494
- children: $e()
520
+ children: f ?? /* @__PURE__ */ _(u, {
521
+ fallback: /* @__PURE__ */ _(c, {}),
522
+ children: it()
495
523
  })
496
524
  });
497
525
  })()
498
526
  })
499
527
  }),
500
- b && b.length > 0 && !M && !N && /* @__PURE__ */ g("div", {
528
+ x && x.length > 0 && !F && !I && /* @__PURE__ */ _("div", {
501
529
  className: "px-4 py-3 border-t border-border-default bg-bg-muted",
502
530
  style: { flexShrink: 0 },
503
- children: /* @__PURE__ */ g(de, {
504
- actions: b,
505
- context: Qe,
506
- onAction: x,
507
- disabled: C,
531
+ children: /* @__PURE__ */ _(de, {
532
+ actions: x,
533
+ context: nt,
534
+ onAction: S,
535
+ disabled: w,
508
536
  layout: "horizontal",
509
537
  size: "sm"
510
538
  })
511
539
  }),
512
- X && !C && /* @__PURE__ */ g("div", {
540
+ Q && !w && /* @__PURE__ */ _("div", {
513
541
  className: "\n absolute bottom-2 right-2\n opacity-0 group-hover:opacity-100\n transition-opacity duration-200\n ",
514
542
  title: "Click to drill down",
515
- children: /* @__PURE__ */ g("svg", {
543
+ children: /* @__PURE__ */ _("svg", {
516
544
  className: "w-4 h-4 text-text-secondary",
517
545
  fill: "none",
518
546
  stroke: "currentColor",
519
547
  viewBox: "0 0 24 24",
520
- children: /* @__PURE__ */ g("path", {
548
+ children: /* @__PURE__ */ _("path", {
521
549
  strokeLinecap: "round",
522
550
  strokeLinejoin: "round",
523
551
  strokeWidth: 2,
@@ -525,17 +553,17 @@ var v = d(function({ widget: u, children: d, data: _, className: v = "", isLoadi
525
553
  })
526
554
  })
527
555
  }),
528
- L && /* @__PURE__ */ g(l, {
556
+ z && /* @__PURE__ */ _(u, {
529
557
  fallback: null,
530
- children: /* @__PURE__ */ g(Me, {
531
- widgetId: u.id,
532
- onClose: () => R(!1)
558
+ children: /* @__PURE__ */ _(Ne, {
559
+ widgetId: d.id,
560
+ onClose: () => B(!1)
533
561
  })
534
562
  })
535
563
  ]
536
564
  });
537
- }, _);
565
+ }, v);
538
566
  //#endregion
539
- export { v as default };
567
+ export { y as default };
540
568
 
541
569
  //# sourceMappingURL=WidgetWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WidgetWrapper.js","names":[],"sources":["../../../../src/bigconsole/components/widgets/WidgetWrapper.tsx"],"sourcesContent":["/**\n * WidgetWrapper Component (v2.1)\n *\n * Common wrapper for all widget types. Handles:\n * - Header with title and menu\n * - Loading, error, and empty states\n * - Selection highlighting\n * - Edit mode controls\n * - Real data only — no mock fallback; widgets show empty state when data is missing\n * - v2.0: Multi-renderer support via WidgetRendererFactory\n * - v2.0: Widget actions support\n */\n\nimport {\n type FC,\n type ReactNode,\n type RefObject,\n useCallback,\n memo,\n useMemo,\n useRef,\n useState,\n useEffect,\n lazy,\n Suspense,\n} from 'react';\nimport type { Widget } from '../../types';\nimport {\n useWidgetStore,\n useDashboardStore,\n useIsWidgetSelected,\n useWidgetUIState,\n useGlobalFilterValues,\n} from '../../store';\nimport {\n useWidgetAutoRefresh,\n formatTimeUntilRefresh,\n useWidgetExport,\n useDrilldown,\n useWidgetData,\n useWidgetComments,\n type DrilldownContext,\n} from '../../hooks';\nimport { getWidgetDefinition } from './WidgetRegistry';\nimport { WidgetHeader } from './WidgetHeader';\nimport { WidgetLoadingState } from './states/LoadingState';\nimport { WidgetErrorState } from './states/ErrorState';\nimport { WidgetEmptyState } from './states/EmptyState';\nimport { WidgetErrorBoundary } from './WidgetErrorBoundary';\nimport { hasRenderableCustomConfig, hasCustomIframeConfig } from './custom/config';\n\n// v2.0: Renderer factory and actions\nimport { WidgetRendererFactory } from '../../renderers/factory/WidgetRendererFactory';\nimport { WidgetActions } from './widget-actions';\nimport type { WidgetAction, ActionContext, ActionResult, RendererType } from '../../renderers/types/renderer';\n// Widget components - lazy loaded for better code splitting\n// Each widget loads only when its type is rendered\nconst MetricCardWidget = lazy(() => import('./metric-card').then((m) => ({ default: m.MetricCardWidget })));\nconst ChartWidget = lazy(() => import('./chart').then((m) => ({ default: m.ChartWidget })));\nconst TableWidget = lazy(() => import('./table').then((m) => ({ default: m.TableWidget })));\nconst PivotTableWidget = lazy(() => import('./pivot-table').then((m) => ({ default: m.PivotTableWidget })));\nconst GaugeWidget = lazy(() => import('./gauge').then((m) => ({ default: m.GaugeWidget })));\nconst ProgressWidget = lazy(() => import('./progress').then((m) => ({ default: m.ProgressWidget })));\nconst ListWidget = lazy(() => import('./list').then((m) => ({ default: m.ListWidget })));\nconst HeatmapWidget = lazy(() => import('./heatmap').then((m) => ({ default: m.HeatmapWidget })));\nconst RetentionWidget = lazy(() => import('./retention').then((m) => ({ default: m.RetentionWidget })));\nconst CalendarWidget = lazy(() => import('./calendar').then((m) => ({ default: m.CalendarWidget })));\nconst KanbanWidget = lazy(() => import('./kanban').then((m) => ({ default: m.KanbanWidget })));\nconst TimelineWidget = lazy(() => import('./timeline').then((m) => ({ default: m.TimelineWidget })));\nconst KPIComparisonWidget = lazy(() => import('./kpi-comparison').then((m) => ({ default: m.KPIComparisonWidget })));\nconst TextWidget = lazy(() => import('./text-widget').then((m) => ({ default: m.TextWidget })));\nconst MapWidget = lazy(() => import('./map-widget').then((m) => ({ default: m.MapWidget })));\nconst IframeWidget = lazy(() => import('./iframe-widget').then((m) => ({ default: m.IframeWidget })));\nconst CustomWidget = lazy(() => import('./custom').then((m) => ({ default: m.CustomWidget })));\n// AdaptiveCardWidget is HUGE (984KB) - lazy load only when 'form' type is used\nconst AdaptiveCardWidget = lazy(() => import('./adaptive-card').then((m) => ({ default: m.AdaptiveCardWidget })));\n// Comments panel - lazy loaded; only mounts when the user opens comments\nconst WidgetComments = lazy(() => import('./comments/WidgetComments').then((m) => ({ default: m.WidgetComments })));\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface WidgetWrapperProps {\n /** The widget data */\n widget: Widget;\n /** Widget content to render */\n children?: ReactNode;\n /** Data for the widget */\n data?: Record<string, unknown> | null;\n /** Custom class name */\n className?: string;\n /** Whether the widget is loading */\n isLoading?: boolean;\n /** Error message */\n error?: string | null;\n /** Callback to refresh widget data */\n onRefresh?: () => Promise<void>;\n /** Callback for drilldown navigation */\n onDrilldown?: (params: Record<string, unknown>) => void;\n /** v2.0: Widget actions */\n actions?: WidgetAction[];\n /** v2.0: Callback for action events */\n onAction?: (action: WidgetAction, context: ActionContext) => Promise<ActionResult | void>;\n /** Phase 2: Global filter values to apply to widget data */\n filterValues?: Record<string, unknown>;\n}\n\n// ============================================================================\n// Custom comparison for memo - ensures actions changes trigger re-render\n// ============================================================================\n\nfunction arePropsEqual(prevProps: WidgetWrapperProps, nextProps: WidgetWrapperProps): boolean {\n // Always re-render if widget ID changes\n if (prevProps.widget.id !== nextProps.widget.id) return false;\n // Re-render if widget was updated\n if (prevProps.widget.updatedAt !== nextProps.widget.updatedAt) return false;\n // Re-render if loading state changes\n if (prevProps.isLoading !== nextProps.isLoading) return false;\n // Re-render if error changes\n if (prevProps.error !== nextProps.error) return false;\n // Re-render if actions count changes\n if ((prevProps.actions?.length ?? 0) !== (nextProps.actions?.length ?? 0)) return false;\n // Check if any action ID changed\n if (prevProps.actions && nextProps.actions) {\n for (let i = 0; i < prevProps.actions.length; i++) {\n if (prevProps.actions[i]?.id !== nextProps.actions[i]?.id) return false;\n }\n }\n // Also check data changes\n if (prevProps.data !== nextProps.data) return false;\n // Phase 2: Re-render if filter values changed\n if (JSON.stringify(prevProps.filterValues) !== JSON.stringify(nextProps.filterValues)) return false;\n return true;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport const WidgetWrapper: FC<WidgetWrapperProps> = memo(function WidgetWrapper({\n widget,\n children,\n data,\n className = '',\n isLoading: isLoadingProp,\n error: errorProp,\n onRefresh,\n onDrilldown,\n actions,\n onAction,\n filterValues,\n}) {\n // Store state - use Dashboard store for edit mode (synced with toolbar)\n const isEditMode = useDashboardStore((state) => state.viewMode === 'edit');\n const selectWidget = useWidgetStore((state) => state.selectWidget);\n const isSelected = useIsWidgetSelected(widget.id);\n const uiState = useWidgetUIState(widget.id);\n const globalFilterValues = useGlobalFilterValues();\n\n // Fetch per-widget data from backend (parser-processed data)\n // This is needed because listWidgetsByDashboard uses WidgetListFields (without data)\n // for performance, so each widget fetches its own data individually\n const hasDataSource =\n !!(widget as unknown as Record<string, unknown>).dataSinkId ||\n !!(widget as unknown as Record<string, unknown>).datasetId ||\n !!(widget as unknown as Record<string, unknown>).parserId;\n const { data: fetchedWidgetData, loading: widgetDataLoading } = useWidgetData(widget.id, {\n skip: !hasDataSource,\n pollInterval: (widget.refreshInterval ?? 0) * 1000 || 0,\n });\n\n // WORKAROUND: If Zustand store is empty, directly read filter_* params from URL\n // This handles race conditions where the store hasn't been populated yet\n const urlFilterValues = useMemo(() => {\n if (typeof window === 'undefined') return {};\n\n const params = new URLSearchParams(window.location.search);\n const filters: Record<string, unknown> = {};\n\n params.forEach((value, key) => {\n if (key.startsWith('filter_')) {\n const filterId = key.slice('filter_'.length);\n // Skip internal metadata keys\n if (!filterId.startsWith('__')) {\n filters[filterId] = value;\n }\n }\n });\n\n return filters;\n }, []);\n\n // Phase 2: Merge global filter values (from URL) with explicit filterValues prop\n // This ensures both URL params (filter_*) and drilldown params work together\n const mergedFilterValues = useMemo(() => {\n const merged: Record<string, unknown> = {};\n\n // First, add URL filter values as fallback (in case Zustand store hasn't loaded yet)\n if (urlFilterValues && Object.keys(urlFilterValues).length > 0) {\n Object.assign(merged, urlFilterValues);\n }\n\n // Then, add global filter values from Zustand store (if populated)\n if (globalFilterValues && Object.keys(globalFilterValues).length > 0) {\n Object.assign(merged, globalFilterValues);\n }\n\n // Finally, add/override with explicit filterValues prop (e.g., from drilldown modal)\n if (filterValues && Object.keys(filterValues).length > 0) {\n Object.assign(merged, filterValues);\n }\n\n return merged;\n }, [urlFilterValues, globalFilterValues, filterValues]);\n\n // Track active filters (client-side filtering until backend supports it)\n const hasFilters = Object.keys(mergedFilterValues).length > 0;\n\n // Merge loading/error from props and store\n // Show loading if widget data is being fetched for the first time (no data yet)\n const isLoading = isLoadingProp ?? (widgetDataLoading && !fetchedWidgetData) ?? uiState.isLoading;\n const error = errorProp ?? uiState.errorMessage;\n\n // Get widget definition\n const definition = getWidgetDefinition(widget.type);\n\n // Stable refresh callback - use ref to avoid creating new function on each render\n const onRefreshRef = useRef(onRefresh);\n useEffect(() => {\n onRefreshRef.current = onRefresh;\n }, [onRefresh]);\n\n const stableOnRefresh = useCallback(async () => {\n if (onRefreshRef.current) {\n await onRefreshRef.current();\n }\n }, []);\n\n // Auto-refresh\n const { timeUntilRefresh, isPaused } = useWidgetAutoRefresh({\n widgetId: widget.id,\n refreshInterval: widget.refreshInterval,\n onRefresh: stableOnRefresh,\n enabled: !isEditMode && !!widget.refreshInterval,\n });\n\n // Container ref for PNG export\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Comments panel. The count query stays disabled until the panel is first\n // opened, so a dashboard of N widgets doesn't fire N comment queries on load.\n const [showComments, setShowComments] = useState(false);\n const [commentsEverOpened, setCommentsEverOpened] = useState(false);\n const { count: commentCount } = useWidgetComments(widget.id, commentsEverOpened);\n const toggleComments = useCallback(() => {\n setShowComments((open) => {\n const next = !open;\n if (next) setCommentsEverOpened(true);\n return next;\n });\n }, []);\n\n // Get widget data for export (computed early for hook)\n const exportData = useMemo(() => {\n if (data && Array.isArray(data)) return data;\n const rawData = (widget as unknown as Record<string, unknown>).data as Record<string, unknown> | undefined;\n if (rawData?.processed && Array.isArray(rawData.processed)) {\n return rawData.processed;\n }\n if (rawData?.raw) {\n const parsed = typeof rawData.raw === 'string' ? JSON.parse(rawData.raw) : rawData.raw;\n if (Array.isArray(parsed)) return parsed;\n }\n return null;\n }, [data, widget]);\n\n // Export functionality\n const { exportCSV, exportPNG } = useWidgetExport(widget, {\n data: exportData,\n containerRef: containerRef as unknown as RefObject<HTMLElement>,\n });\n\n // Helper to check if data is actually usable (has real content)\n const isUsableData = useCallback((d: unknown): boolean => {\n if (d === null || d === undefined) return false;\n if (Array.isArray(d)) return d.length > 0;\n if (typeof d === 'object') {\n const obj = d as Record<string, unknown>;\n const keys = Object.keys(obj);\n if (keys.length === 0) return false;\n // Check recursively for actual data content\n return keys.some((key) => {\n const val = obj[key];\n if (val === null || val === undefined || val === '') return false;\n if (Array.isArray(val)) return val.length > 0;\n if (typeof val === 'object') return isUsableData(val);\n return true;\n });\n }\n return true;\n }, []);\n\n // Phase 2: Client-side filter function for widget data\n const applyClientFilters = useCallback(\n (\n widgetData: Record<string, unknown> | Record<string, unknown>[]\n ): Record<string, unknown> | Record<string, unknown>[] => {\n if (!hasFilters || !widgetData) return widgetData;\n\n // Separate drilldown context filters (ctx_*) from regular filters\n const contextFilters: Record<string, unknown> = {};\n const regularFilters: Record<string, unknown> = {};\n\n Object.entries(mergedFilterValues || {}).forEach(([key, value]) => {\n if (key.startsWith('ctx_')) {\n // Strip ctx_ prefix to get the target field name\n const fieldName = key.slice(4); // Remove 'ctx_'\n contextFilters[fieldName] = value;\n } else if (!key.startsWith('__')) {\n // Skip internal metadata keys (__drilldown_depth, etc.)\n regularFilters[key] = value;\n }\n });\n\n // Helper to match a value against a filter (case-insensitive)\n const matchesFilter = (itemValue: unknown, filterValue: unknown): boolean => {\n if (filterValue === undefined || filterValue === null || filterValue === '') return true;\n if (itemValue === undefined || itemValue === null) return false;\n\n const itemStr = String(itemValue).toLowerCase();\n const filterStr = String(filterValue).toLowerCase();\n\n // Exact match or contains\n return itemStr === filterStr || itemStr.includes(filterStr);\n };\n\n // Helper to find a matching field in the item (case-insensitive key matching)\n const findFieldValue = (item: Record<string, unknown>, targetField: string): unknown => {\n const targetLower = targetField.toLowerCase();\n\n // Try exact match first\n if (item[targetField] !== undefined) return item[targetField];\n\n // Try case-insensitive match\n const matchingKey = Object.keys(item).find((k) => k.toLowerCase() === targetLower);\n if (matchingKey) return item[matchingKey];\n\n // Try partial match (e.g., 'region' matches 'regionName' or 'user_region')\n const partialMatch = Object.keys(item).find(\n (k) => k.toLowerCase().includes(targetLower) || targetLower.includes(k.toLowerCase())\n );\n if (partialMatch) return item[partialMatch];\n\n // Try stripping common prefixes from target field (e.g., 'kpiId' -> 'id', 'rowName' -> 'name')\n // This handles drilldown context where widget passes 'kpiId' but data has 'id'\n const commonPrefixes = ['kpi', 'row', 'item', 'data', 'cell', 'record', 'entry'];\n for (const prefix of commonPrefixes) {\n if (targetLower.startsWith(prefix) && targetLower.length > prefix.length) {\n const strippedField = targetLower.slice(prefix.length);\n // Try exact match with stripped field\n const strippedMatch = Object.keys(item).find((k) => k.toLowerCase() === strippedField);\n if (strippedMatch) return item[strippedMatch];\n }\n }\n\n return undefined;\n };\n\n // Helper function to filter an array of items\n const filterItems = (items: Record<string, unknown>[]): Record<string, unknown>[] => {\n return items.filter((item: Record<string, unknown>) => {\n // Only object rows are field-filterable. An array of primitives (e.g.\n // a heatmap's `rows: [\"5W-MedSurg\", …]`) carries no named fields — keep\n // every element. Without this, `findFieldValue` indexes into the string\n // by character offset and spuriously \"matches\" a filter, dropping rows.\n if (item === null || typeof item !== 'object' || Array.isArray(item)) {\n return true;\n }\n // First, apply drilldown context filters (ctx_*) - these have explicit field names\n for (const [fieldName, filterValue] of Object.entries(contextFilters)) {\n if (filterValue === undefined || filterValue === null || filterValue === '') continue;\n\n const itemValue = findFieldValue(item, fieldName);\n // If the field doesn't exist in this data item, skip this context filter.\n // Drilldown context params (e.g., source=support_status) are metadata about\n // the drilldown origin and should NOT filter out data when the target\n // dashboard's widgets don't have a matching field.\n if (itemValue === undefined) continue;\n if (!matchesFilter(itemValue, filterValue)) {\n return false;\n }\n }\n\n // Then, apply regular filters\n for (const [filterKey, filterValue] of Object.entries(regularFilters)) {\n if (filterValue === undefined || filterValue === null || filterValue === '') continue;\n\n // For date range filters\n if (typeof filterValue === 'object') {\n const fv = filterValue as Record<string, unknown>;\n if (fv.start || fv.end) {\n const dateFields = Object.entries(item).filter(\n ([k, _v]) => k.toLowerCase().includes('date') || k.toLowerCase().includes('time')\n );\n if (dateFields.length > 0) {\n const itemDate = new Date(dateFields[0][1] as string);\n if (fv.start && itemDate < new Date(fv.start as string)) return false;\n if (fv.end && itemDate > new Date(fv.end as string)) return false;\n }\n continue;\n }\n }\n\n // For numeric range filters\n if (typeof filterValue === 'object') {\n const nv = filterValue as Record<string, unknown>;\n if (nv.min !== undefined || nv.max !== undefined) {\n const numericFields = Object.entries(item).filter(([_k, v]) => typeof v === 'number');\n if (numericFields.length > 0) {\n const itemNum = numericFields[0][1] as number;\n if (nv.min !== undefined && itemNum < (nv.min as number)) return false;\n if (nv.max !== undefined && itemNum > (nv.max as number)) return false;\n }\n continue;\n }\n }\n\n // Try to match by filter key name first (for named filters). When\n // the widget's data actually carries the filter's field, the filter\n // is authoritative — a mismatch excludes the row.\n const fieldValue = findFieldValue(item, filterKey);\n if (fieldValue !== undefined) {\n if (!matchesFilter(fieldValue, filterValue)) {\n return false;\n }\n continue;\n }\n\n // For text/category filters - try multiple matching strategies\n const filterStr = String(filterValue).toLowerCase();\n\n // Strategy 1: Check all field values for exact or partial match\n const itemValues = Object.values(item).map((v) => String(v).toLowerCase());\n const hasMatch = itemValues.some((v) => v === filterStr || v.includes(filterStr));\n\n if (!hasMatch) {\n // Strategy 2: Try to find a field name that matches the filter value context\n const fieldNames = Object.keys(item).map((k) => k.toLowerCase());\n const possibleFields = fieldNames.filter(\n (f) =>\n f.includes('category') ||\n f.includes('type') ||\n f.includes('status') ||\n f.includes('name') ||\n f.includes('region') ||\n f.includes('group')\n );\n\n let fieldMatch = false;\n for (const fieldName of possibleFields) {\n const originalKey = Object.keys(item).find((k) => k.toLowerCase() === fieldName);\n if (originalKey) {\n const itemFieldValue = String(item[originalKey]).toLowerCase();\n if (itemFieldValue === filterStr || itemFieldValue.includes(filterStr)) {\n fieldMatch = true;\n break;\n }\n }\n }\n\n // The filter's field is NOT present in this dataset (named-field\n // lookup failed AND no value/heuristic match). A global filter that\n // doesn't apply to a widget's shape must be a no-op for that widget\n // — not a silent \"exclude every row\". This mirrors the ctx_* rule\n // above (skip when the targeted field is absent). Without this, an\n // always-active required filter (e.g. campus=main) blanks every\n // parser-derived widget whose output has no campus column.\n if (!fieldMatch) {\n continue;\n }\n }\n }\n return true;\n });\n };\n\n // If data is an array, filter the items directly\n if (Array.isArray(widgetData)) {\n const filtered = filterItems(widgetData);\n return filtered;\n }\n\n // Handle object with array properties (rows, items, members, questions, data, etc.)\n if (widgetData && typeof widgetData === 'object') {\n // Common array property names in widget data\n const arrayPropertyNames = [\n 'kpis', // KPI Comparison widget\n 'rows', // Table widget\n 'items', // List widget\n 'members', // Team/member widgets\n 'questions', // Form widget\n 'data', // Generic data\n 'records', // Database-style data\n 'results', // Search/query results\n 'entries', // Log/feed entries\n 'list', // Generic list\n 'values', // Value arrays\n 'series', // Chart series\n 'datasets', // Chart datasets\n ];\n\n for (const propName of arrayPropertyNames) {\n if (widgetData[propName] && Array.isArray(widgetData[propName])) {\n const filteredArray = filterItems(widgetData[propName]);\n return {\n ...widgetData,\n [propName]: filteredArray,\n ...(propName === 'rows' ? { totalRows: filteredArray.length } : {}),\n };\n }\n }\n\n // If no known array property found, check for any array property\n const arrayProps = Object.entries(widgetData).filter(([_key, v]) => Array.isArray(v));\n if (arrayProps.length > 0) {\n const [propName, propValue] = arrayProps[0];\n const filteredArray = filterItems(propValue as Record<string, unknown>[]);\n return {\n ...widgetData,\n [propName]: filteredArray,\n };\n }\n }\n\n // For non-filterable data, return as-is\n return widgetData;\n },\n [hasFilters, mergedFilterValues, widget.id]\n );\n\n // Get widget data from the widget itself (fetched from backend)\n const realWidgetData = useMemo(() => {\n let rawWidgetData = null;\n\n // Priority 1: Explicitly passed data prop\n if (data && isUsableData(data)) {\n rawWidgetData = data;\n }\n // Priority 2: Per-widget fetched data (from useWidgetData hook)\n // fetchedWidgetData IS a WidgetData object: { raw, processed, fetchedAt, cached }\n else if (fetchedWidgetData) {\n const fetched = fetchedWidgetData as unknown as Record<string, unknown>;\n if (fetched?.processed && isUsableData(fetched.processed)) {\n rawWidgetData = fetched.processed;\n } else if (fetched?.raw) {\n try {\n const parsed = typeof fetched.raw === 'string' ? JSON.parse(fetched.raw as string) : fetched.raw;\n if (isUsableData(parsed)) rawWidgetData = parsed;\n } catch {\n // Invalid JSON, ignore\n }\n }\n }\n // Priority 3: widget.data from GraphQL response (if already on widget object)\n else {\n const rawData = (widget as unknown as Record<string, unknown>).data as Record<string, unknown> | undefined;\n if (rawData?.processed && isUsableData(rawData.processed)) {\n rawWidgetData = rawData.processed;\n } else if (rawData?.raw) {\n try {\n const parsed = typeof rawData.raw === 'string' ? JSON.parse(rawData.raw) : rawData.raw;\n if (isUsableData(parsed)) rawWidgetData = parsed;\n } catch {\n // Invalid JSON, ignore\n }\n }\n }\n\n // Priority 4: config.mockData — user-configured sample JSON from Widget Properties Data tab\n // This is NOT auto-generated mock data; it's explicit JSON the user pasted in the UI\n if (!rawWidgetData) {\n const configMockData = (widget.config as Record<string, unknown> | undefined)?.mockData;\n if (configMockData) {\n try {\n const parsed = typeof configMockData === 'string' ? JSON.parse(configMockData) : configMockData;\n if (isUsableData(parsed)) {\n rawWidgetData = parsed;\n }\n } catch (e) {}\n }\n }\n\n // Generic parser-output resolution: a widget may bind to a parser whose\n // output is an envelope ({ byUnit:[...], house:{...} }) rather than the\n // exact array/object the renderer wants. config.dataKey / dataPath /\n // seriesPath is a dot-path INTO the resolved data that points at the\n // renderable subtree (e.g. \"byUnit\" for a table, \"rows\" for a chart).\n // Resolving it here keeps every renderer generic — the use-case-specific\n // shape knowledge lives in the widget config (set by the seed/UI), not in\n // the renderer. valueField (single-value metric path) is intentionally NOT\n // applied here: MetricCardWidget resolves it itself against the envelope.\n if (rawWidgetData && typeof rawWidgetData === 'object' && !Array.isArray(rawWidgetData)) {\n const cfg = widget.config as Record<string, unknown> | undefined;\n const pathKey = (cfg?.dataKey ?? cfg?.dataPath ?? cfg?.seriesPath) as string | undefined;\n if (pathKey && typeof pathKey === 'string') {\n const resolved = pathKey.split('.').reduce<unknown>((cur, seg) => {\n return cur && typeof cur === 'object' ? (cur as Record<string, unknown>)[seg] : undefined;\n }, rawWidgetData);\n if (resolved !== undefined && resolved !== null && isUsableData(resolved)) {\n rawWidgetData = resolved as Record<string, unknown>;\n }\n }\n }\n\n // Phase 2: Apply client-side filters if active\n if (hasFilters && rawWidgetData) {\n const filtered = applyClientFilters(rawWidgetData);\n return filtered;\n }\n\n return rawWidgetData;\n }, [data, widget, fetchedWidgetData, hasFilters, applyClientFilters, mergedFilterValues, isUsableData]);\n\n // Final widget data - real data only, no mock fallback\n const widgetData = useMemo(() => {\n return realWidgetData ?? null;\n }, [realWidgetData]);\n\n // Drilldown navigation (must be after widgetData is defined)\n const { executeDrilldown, canDrilldown } = useDrilldown({\n onDrilldown: (params, _mode) => {\n onDrilldown?.(params);\n },\n });\n\n // Check if widget has drilldown configured\n const hasDrilldown = useMemo(() => canDrilldown(widget), [widget, canDrilldown]);\n\n // Handle drilldown execution with context\n const handleDrilldown = useCallback(\n (selectedData?: Record<string, unknown>) => {\n if (!widget.drilldown?.enabled) return;\n\n const context: DrilldownContext = {\n selectedData: selectedData || {},\n globalFilters: globalFilterValues || {},\n widgetData: widgetData || {},\n metadata: {\n widgetId: widget.id,\n widgetType: widget.type,\n widgetTitle: widget.title,\n },\n sourceDashboardId: widget.dashboardId,\n };\n\n executeDrilldown(widget.drilldown, context);\n },\n [widget, widgetData, globalFilterValues, executeDrilldown]\n );\n\n // Track mouse position to distinguish click from drag\n const mouseDownPos = useRef<{ x: number; y: number } | null>(null);\n const DRAG_THRESHOLD = 5; // pixels - if mouse moves more than this, it's a drag\n\n // Handle mouse down - record position\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n mouseDownPos.current = { x: e.clientX, y: e.clientY };\n }, []);\n\n // Handle widget click - Edit mode only (View mode drilldown is triggered by data clicks)\n // Only trigger if mouse hasn't moved much (not a drag)\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation(); // Prevent DashboardGrid from also handling\n\n // Check if this was a drag (mouse moved significantly)\n if (mouseDownPos.current) {\n const dx = Math.abs(e.clientX - mouseDownPos.current.x);\n const dy = Math.abs(e.clientY - mouseDownPos.current.y);\n if (dx > DRAG_THRESHOLD || dy > DRAG_THRESHOLD) {\n // This was a drag, not a click - don't open config panel\n mouseDownPos.current = null;\n return;\n }\n }\n mouseDownPos.current = null;\n\n if (isEditMode) {\n // Edit mode: select widget for editing\n selectWidget(widget.id);\n }\n // View mode: drilldown is triggered by clicking specific data elements\n // (table rows, chart points, etc.) - not by clicking the widget itself\n },\n [isEditMode, selectWidget, widget.id]\n );\n\n // Handle keyboard navigation (Edit mode only)\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.stopPropagation();\n if (isEditMode) {\n selectWidget(widget.id);\n }\n }\n },\n [isEditMode, selectWidget, widget.id]\n );\n\n const hasRenderableCustomWidgetConfig = useMemo(\n () => widget.type === 'custom' && hasRenderableCustomConfig(widget.config),\n [widget.type, widget.config]\n );\n\n const customWidgetHasIframeConfig = useMemo(\n () => widget.type === 'custom' && hasCustomIframeConfig(widget.config),\n [widget.type, widget.config]\n );\n\n const showContainerDrilldownHints = hasDrilldown && !customWidgetHasIframeConfig;\n\n // Determine if data is empty\n const isEmpty = !isLoading && !error && !widgetData && !hasRenderableCustomWidgetConfig;\n\n // v2.0: Check if widget has a renderer specified (non-BIGCONSOLE)\n const widgetRenderer = useMemo(() => {\n const widgetWithRenderer = widget as Widget & { renderer?: RendererType };\n return widgetWithRenderer.renderer;\n }, [widget]);\n\n // v2.0: Determine if we should use the factory (non-BIGCONSOLE renderer)\n const useRendererFactory = useMemo(() => {\n const shouldUse = widgetRenderer && widgetRenderer !== 'BIGCONSOLE';\n return shouldUse;\n }, [widgetRenderer]);\n\n // v2.0: Create action context\n const actionContext = useMemo<ActionContext>(\n () => ({\n widgetId: widget.id,\n data: widgetData || {},\n }),\n [widget.id, widgetData]\n );\n\n // v2.0: Handle action callback from WidgetRendererFactory\n // Receives (action: WidgetAction, context: ActionContext) and forwards to parent\n // Checks if a more detailed backend action exists with same name\n const handleActionFromFactory = useCallback(\n (action: WidgetAction, context: ActionContext) => {\n if (!onAction) return;\n\n // Try to find a matching backend action by name (has more details like confirmation)\n const existingAction = actions?.find((a) => a.name === action.name);\n\n if (existingAction) {\n // Use existing backend action (has confirmation, style, icon, etc.)\n onAction(existingAction, context);\n } else {\n // Use the action from WidgetRendererFactory as-is\n onAction(action, context);\n }\n },\n [onAction, actions]\n );\n\n // Render the appropriate widget component based on type (v1.0 snake_case)\n const renderWidgetComponent = useCallback(() => {\n // Extract data based on widget type expectations\n // Different widgets expect different data formats\n const getDataForWidget = () => {\n if (!widgetData) return widgetData;\n\n // If data has 'rows' property (table data), extract rows\n if (widget.type === 'table' || widget.type === 'pivot_table') {\n if (Array.isArray(widgetData)) return widgetData;\n if (widgetData && typeof widgetData === 'object' && 'rows' in widgetData) {\n return (widgetData as { rows: unknown[] }).rows;\n }\n }\n\n // If data has 'items' property (list data), extract items\n if (widget.type === 'list') {\n if (Array.isArray(widgetData)) return widgetData;\n if (widgetData && typeof widgetData === 'object' && 'items' in widgetData) {\n return (widgetData as { items: unknown[] }).items;\n }\n }\n\n // If data has 'stages' property (old funnel format), extract stages\n if (widget.type === 'funnel_chart') {\n if (Array.isArray(widgetData)) return widgetData;\n if (widgetData && typeof widgetData === 'object' && 'stages' in widgetData) {\n return (widgetData as { stages: unknown[] }).stages;\n }\n }\n\n // If data has 'datasets' property (old chart format), convert to array format\n if (widget.type === 'chart') {\n if (Array.isArray(widgetData)) return widgetData;\n if (widgetData && typeof widgetData === 'object' && 'datasets' in widgetData) {\n // Convert old format to new array format\n const oldData = widgetData as { labels?: string[]; datasets?: { name: string; data: number[] }[] };\n if (oldData.labels && oldData.datasets) {\n return oldData.labels.map((label, i) => {\n const point: Record<string, unknown> = { name: label };\n oldData.datasets?.forEach((ds) => {\n point[ds.name.toLowerCase()] = ds.data[i];\n });\n return point;\n });\n }\n }\n }\n\n // For text widgets: convert parsed object data to {content, format} shape\n if (widget.type === 'text') {\n if (widgetData && typeof widgetData === 'object' && !('content' in (widgetData as Record<string, unknown>))) {\n // Auto-format parsed data as markdown content\n const obj = widgetData as Record<string, unknown>;\n const lines: string[] = [];\n for (const [key, val] of Object.entries(obj)) {\n if (val && typeof val === 'object' && !Array.isArray(val)) {\n lines.push(`### ${key}`);\n for (const [k2, v2] of Object.entries(val as Record<string, unknown>)) {\n lines.push(`- **${k2}:** ${v2}`);\n }\n } else if (Array.isArray(val)) {\n lines.push(`### ${key}`);\n val.slice(0, 10).forEach((item: unknown) => {\n if (item && typeof item === 'object') {\n const entries = Object.entries(item as Record<string, unknown>);\n lines.push(`- ${entries.map(([k, v]) => `**${k}:** ${v}`).join(' | ')}`);\n } else {\n lines.push(`- ${item}`);\n }\n });\n } else {\n lines.push(`- **${key}:** ${val}`);\n }\n }\n return { content: lines.join('\\n'), format: 'markdown' };\n }\n }\n\n // For custom widgets: pass data through with extracted value if configured\n if (widget.type === 'custom') {\n const config = widget.config as Record<string, unknown> | undefined;\n const valueField = config?.valueField as string | undefined;\n if (valueField && widgetData && typeof widgetData === 'object' && !Array.isArray(widgetData)) {\n const obj = widgetData as Record<string, unknown>;\n if (valueField in obj) {\n return { value: obj[valueField], label: widget.title, data: obj };\n }\n }\n }\n\n return widgetData;\n };\n\n const normalizedData = getDataForWidget();\n const props = {\n widget,\n data: normalizedData,\n onDrilldown: hasDrilldown ? handleDrilldown : undefined,\n };\n\n // v2.0: Use WidgetRendererFactory for non-BIGCONSOLE renderers\n if (useRendererFactory) {\n // For factory renderers (Adaptive Card, BlockKit, Custom), pass the RAW\n // processed data — NOT the type-normalized data. Normalization (e.g., text→markdown)\n // is only for BIGCONSOLE renderer widgets. Factory renderers handle their own\n // template interpolation against the raw data object.\n let factoryData: Record<string, unknown> = {};\n\n if (\n realWidgetData &&\n typeof realWidgetData === 'object' &&\n !Array.isArray(realWidgetData) &&\n Object.keys(realWidgetData as Record<string, unknown>).length > 0\n ) {\n // Use real data from backend (raw processed, not type-normalized)\n factoryData = { ...(realWidgetData as Record<string, unknown>) };\n }\n\n // For CUSTOM renderer: enrich data with standard fields expected by built-in components.\n // Built-in components (Counter, Card, SimpleText) read specific fields from data:\n // Counter: data.value, Card: data.title/data.description, SimpleText: data.text\n // Parsed data from datasinks has domain-specific fields (totalFiles, totalMessages, etc.)\n // Use config.valueField to extract the primary value and map it to standard fields.\n const internalType = (widget.config as Record<string, unknown> | undefined)?._internalWidgetType as\n | string\n | undefined;\n if (internalType === 'custom' && Object.keys(factoryData).length > 0) {\n const config = widget.config as Record<string, unknown> | undefined;\n const valueField = config?.valueField as string | undefined;\n if (valueField && valueField in factoryData) {\n const val = factoryData[valueField];\n const formatted = typeof val === 'number' ? val.toLocaleString() : String(val);\n // Map to standard fields for all built-in custom components\n factoryData = {\n ...factoryData,\n value: val, // Counter component\n title: factoryData.title || formatted, // Card component\n description: factoryData.description || widget.title || '', // Card component\n text: factoryData.text || formatted, // SimpleText component\n };\n }\n }\n\n return (\n <WidgetRendererFactory\n widget={widget}\n data={factoryData}\n isEditMode={isEditMode}\n isSelected={isSelected}\n isLoading={isLoading}\n error={error}\n onDrilldown={hasDrilldown ? handleDrilldown : undefined}\n onAction={handleActionFromFactory}\n />\n );\n }\n\n // v1.0: Use switch-case for BIGCONSOLE renderer (default)\n // Normalize widget type to lowercase for case-insensitive matching\n const normalizedType = widget.type?.toLowerCase() || '';\n switch (normalizedType) {\n case 'metric_card':\n return <MetricCardWidget {...props} />;\n case 'kpi_card_comparison':\n return <KPIComparisonWidget {...props} />;\n case 'chart':\n case 'funnel_chart':\n return <ChartWidget {...props} />;\n case 'table':\n return <TableWidget {...props} />;\n case 'pivot_table':\n return <PivotTableWidget {...props} />;\n case 'gauge':\n return <GaugeWidget {...props} />;\n case 'progress':\n return <ProgressWidget {...props} />;\n case 'list':\n return <ListWidget {...props} />;\n case 'heatmap':\n return <HeatmapWidget {...props} />;\n case 'retention':\n return <RetentionWidget {...props} />;\n case 'calendar':\n return <CalendarWidget {...props} />;\n case 'timeline':\n return <TimelineWidget {...props} />;\n case 'kanban':\n return <KanbanWidget {...props} />;\n case 'form':\n return <AdaptiveCardWidget {...props} />;\n case 'text':\n return <TextWidget {...props} />;\n case 'iframe':\n return <IframeWidget {...props} />;\n case 'map':\n return <MapWidget {...props} />;\n case 'custom':\n return <CustomWidget {...props} />;\n default:\n return children || <WidgetEmptyState widgetType={widget.type} />;\n }\n }, [\n widget,\n widgetData,\n children,\n hasDrilldown,\n handleDrilldown,\n useRendererFactory,\n isEditMode,\n isSelected,\n isLoading,\n error,\n handleActionFromFactory,\n realWidgetData,\n ]);\n\n // Determine content to render\n const renderContent = () => {\n if (isLoading) {\n return <WidgetLoadingState />;\n }\n\n if (error) {\n return <WidgetErrorState error={error} onRetry={onRefresh} />;\n }\n\n if (isEmpty && !children) {\n // v2.0: Check parserId (primary) or dataSinkId (for context/drilldowns)\n return (\n <WidgetEmptyState\n widgetType={widget.type}\n hasDataSource={\n !!(widget as unknown as Record<string, unknown>).parserId ||\n !!(widget as unknown as Record<string, unknown>).dataSinkId\n }\n />\n );\n }\n\n // resetKey auto-resets the boundary on parser/sink re-bind or config edit without widget.id changing (BOFF-2242).\n const resetKey = `${widget.parserId ?? ''}|${widget.dataSinkId ?? ''}|${widget.updatedAt ?? ''}`;\n\n return (\n <WidgetErrorBoundary widgetId={widget.id} widgetType={widget.type} widgetTitle={widget.title} resetKey={resetKey}>\n {children ?? <Suspense fallback={<WidgetLoadingState />}>{renderWidgetComponent()}</Suspense>}\n </WidgetErrorBoundary>\n );\n };\n\n return (\n <div\n ref={containerRef}\n className={`\n group relative flex flex-col\n h-full w-full\n rounded-lg border\n bg-bg-surface\n transition-all duration-200\n ${\n isSelected && isEditMode\n ? 'border-action-primary-border ring-2 ring-action-primary-border/30'\n : 'border-border-default hover:border-action-primary-bg'\n }\n ${isEditMode ? 'cursor-pointer' : ''}\n ${className}\n `}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n tabIndex={isEditMode ? 0 : -1}\n role={isEditMode ? 'button' : undefined}\n aria-selected={isSelected}\n aria-label={`Widget: ${widget.title}`}\n data-widget-id={widget.id}\n data-widget-type={widget.type}\n >\n {/* Header */}\n <WidgetHeader\n widget={widget}\n definition={definition}\n isSelected={isSelected}\n isEditMode={isEditMode}\n isLoading={isLoading}\n timeUntilRefresh={widget.refreshInterval && !isPaused ? formatTimeUntilRefresh(timeUntilRefresh) : undefined}\n hasDrilldown={hasDrilldown}\n onRefresh={onRefresh}\n onExportCSV={exportData ? exportCSV : undefined}\n onExportPNG={exportPNG}\n onDrilldown={hasDrilldown ? () => handleDrilldown() : undefined}\n onToggleComments={toggleComments}\n commentsOpen={showComments}\n commentCount={commentsEverOpened ? commentCount : undefined}\n />\n\n {/* Content Area */}\n <div\n className={`\n flex-1 overflow-hidden p-4 min-h-0\n ${showContainerDrilldownHints && !isEditMode ? 'cursor-pointer' : ''}\n `}\n title={showContainerDrilldownHints && !isEditMode ? 'Click data to drill down' : undefined}\n >\n <div className=\"h-full overflow-auto\">{renderContent()}</div>\n </div>\n\n {/* v2.0: Widget Actions */}\n {actions && actions.length > 0 && !isLoading && !error && (\n <div className=\"px-4 py-3 border-t border-border-default bg-bg-muted\" style={{ flexShrink: 0 }}>\n <WidgetActions\n actions={actions}\n context={actionContext}\n onAction={onAction}\n disabled={isEditMode}\n layout=\"horizontal\"\n size=\"sm\"\n />\n </div>\n )}\n\n {/* Edit mode: react-grid-layout provides resize handles */}\n\n {/* Drilldown Indicator */}\n {showContainerDrilldownHints && !isEditMode && (\n <div\n className=\"\n absolute bottom-2 right-2\n opacity-0 group-hover:opacity-100\n transition-opacity duration-200\n \"\n title=\"Click to drill down\"\n >\n <svg className=\"w-4 h-4 text-text-secondary\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 7l5 5m0 0l-5 5m5-5H6\" />\n </svg>\n </div>\n )}\n\n {/* Comments panel (overlay) */}\n {showComments && (\n <Suspense fallback={null}>\n <WidgetComments widgetId={widget.id} onClose={() => setShowComments(false)} />\n </Suspense>\n )}\n </div>\n );\n}, arePropsEqual);\n\nexport default WidgetWrapper;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAM,KAAmB,QAAW,OAAO,0BAAiB,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,EACrG,KAAc,QAAW,OAAO,oBAAW,MAAM,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,EACrF,KAAc,QAAW,OAAO,oBAAW,MAAM,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,EACrF,KAAmB,QAAW,OAAO,0BAAiB,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,EACrG,KAAc,QAAW,OAAO,oBAAW,MAAM,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,EACrF,KAAiB,QAAW,OAAO,uBAAc,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,EAC9F,KAAa,QAAW,OAAO,mBAAU,MAAM,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EAClF,KAAgB,QAAW,OAAO,sBAAa,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,EAC3F,KAAkB,QAAW,OAAO,wBAAe,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,EACjG,KAAiB,QAAW,OAAO,uBAAc,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,EAC9F,KAAe,QAAW,OAAO,qBAAY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AO,aAAa;AAE5F,aACE,kBAAC,IAAD;OAAqB,UAAU,EAAO;OAAI,YAAY,EAAO;OAAM,aAAa,EAAO;OAAiB;iBACrG,KAAY,kBAAC,GAAD;QAAU,UAAU,kBAAC,GAAD,EAAsB,CAAA;kBAAG,IAAuB;QAAY,CAAA;OACzE,CAAA;SAyDkC;KAAO,CAAA;IACzD,CAAA;GAGL,KAAW,EAAQ,SAAS,KAAK,CAAC,KAAa,CAAC,KAC/C,kBAAC,OAAD;IAAK,WAAU;IAAuD,OAAO,EAAE,YAAY,GAAG;cAC5F,kBAAC,IAAD;KACW;KACT,SAAS;KACC;KACV,UAAU;KACV,QAAO;KACP,MAAK;KACL,CAAA;IACE,CAAA;GAMP,KAA+B,CAAC,KAC/B,kBAAC,OAAD;IACE,WAAU;IAKV,OAAM;cAEN,kBAAC,OAAD;KAAK,WAAU;KAA8B,MAAK;KAAO,QAAO;KAAe,SAAQ;eACrF,kBAAC,QAAD;MAAM,eAAc;MAAQ,gBAAe;MAAQ,aAAa;MAAG,GAAE;MAA6B,CAAA;KAC9F,CAAA;IACF,CAAA;GAIP,KACC,kBAAC,GAAD;IAAU,UAAU;cAClB,kBAAC,IAAD;KAAgB,UAAU,EAAO;KAAI,eAAe,EAAgB,GAAM;KAAI,CAAA;IACrE,CAAA;GAET;;GAEP,EAAc"}
1
+ {"version":3,"file":"WidgetWrapper.js","names":[],"sources":["../../../../src/bigconsole/components/widgets/WidgetWrapper.tsx"],"sourcesContent":["/**\n * WidgetWrapper Component (v2.1)\n *\n * Common wrapper for all widget types. Handles:\n * - Header with title and menu\n * - Loading, error, and empty states\n * - Selection highlighting\n * - Edit mode controls\n * - Real data only — no mock fallback; widgets show empty state when data is missing\n * - v2.0: Multi-renderer support via WidgetRendererFactory\n * - v2.0: Widget actions support\n */\n\nimport {\n type FC,\n type ReactNode,\n type RefObject,\n useCallback,\n memo,\n useMemo,\n useRef,\n useState,\n useEffect,\n lazy,\n Suspense,\n} from 'react';\nimport type { Widget } from '../../types';\nimport {\n useWidgetStore,\n useDashboardStore,\n useIsWidgetSelected,\n useWidgetUIState,\n useGlobalFilterValues,\n} from '../../store';\nimport {\n useWidgetAutoRefresh,\n formatTimeUntilRefresh,\n useWidgetExport,\n useDrilldown,\n useWidgetData,\n useWidgetComments,\n type DrilldownContext,\n} from '../../hooks';\nimport { useApolloClient } from '@apollo/client/react';\nimport { GetDashboardDocument } from '../../../generated/wspace-operations';\nimport { getWidgetDefinition } from './WidgetRegistry';\nimport { WidgetHeader } from './WidgetHeader';\nimport { WidgetLoadingState } from './states/LoadingState';\nimport { WidgetErrorState } from './states/ErrorState';\nimport { WidgetEmptyState } from './states/EmptyState';\nimport { WidgetErrorBoundary } from './WidgetErrorBoundary';\nimport { hasRenderableCustomConfig, hasCustomIframeConfig } from './custom/config';\n\n// v2.0: Renderer factory and actions\nimport { WidgetRendererFactory } from '../../renderers/factory/WidgetRendererFactory';\nimport { WidgetActions } from './widget-actions';\nimport type { WidgetAction, ActionContext, ActionResult, RendererType } from '../../renderers/types/renderer';\n// Widget components - lazy loaded for better code splitting\n// Each widget loads only when its type is rendered\nconst MetricCardWidget = lazy(() => import('./metric-card').then((m) => ({ default: m.MetricCardWidget })));\nconst ChartWidget = lazy(() => import('./chart').then((m) => ({ default: m.ChartWidget })));\nconst TableWidget = lazy(() => import('./table').then((m) => ({ default: m.TableWidget })));\nconst PivotTableWidget = lazy(() => import('./pivot-table').then((m) => ({ default: m.PivotTableWidget })));\nconst GaugeWidget = lazy(() => import('./gauge').then((m) => ({ default: m.GaugeWidget })));\nconst ProgressWidget = lazy(() => import('./progress').then((m) => ({ default: m.ProgressWidget })));\nconst ListWidget = lazy(() => import('./list').then((m) => ({ default: m.ListWidget })));\nconst HeatmapWidget = lazy(() => import('./heatmap').then((m) => ({ default: m.HeatmapWidget })));\nconst RetentionWidget = lazy(() => import('./retention').then((m) => ({ default: m.RetentionWidget })));\nconst CalendarWidget = lazy(() => import('./calendar').then((m) => ({ default: m.CalendarWidget })));\nconst KanbanWidget = lazy(() => import('./kanban').then((m) => ({ default: m.KanbanWidget })));\nconst TimelineWidget = lazy(() => import('./timeline').then((m) => ({ default: m.TimelineWidget })));\nconst KPIComparisonWidget = lazy(() => import('./kpi-comparison').then((m) => ({ default: m.KPIComparisonWidget })));\nconst TextWidget = lazy(() => import('./text-widget').then((m) => ({ default: m.TextWidget })));\nconst MapWidget = lazy(() => import('./map-widget').then((m) => ({ default: m.MapWidget })));\nconst IframeWidget = lazy(() => import('./iframe-widget').then((m) => ({ default: m.IframeWidget })));\nconst CustomWidget = lazy(() => import('./custom').then((m) => ({ default: m.CustomWidget })));\n// AdaptiveCardWidget is HUGE (984KB) - lazy load only when 'form' type is used\nconst AdaptiveCardWidget = lazy(() => import('./adaptive-card').then((m) => ({ default: m.AdaptiveCardWidget })));\n// Comments panel - lazy loaded; only mounts when the user opens comments\nconst WidgetComments = lazy(() => import('./comments/WidgetComments').then((m) => ({ default: m.WidgetComments })));\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface WidgetWrapperProps {\n /** The widget data */\n widget: Widget;\n /** Widget content to render */\n children?: ReactNode;\n /** Data for the widget */\n data?: Record<string, unknown> | null;\n /** Custom class name */\n className?: string;\n /** Whether the widget is loading */\n isLoading?: boolean;\n /** Error message */\n error?: string | null;\n /** Callback to refresh widget data */\n onRefresh?: () => Promise<void>;\n /** Callback for drilldown navigation */\n onDrilldown?: (params: Record<string, unknown>) => void;\n /** v2.0: Widget actions */\n actions?: WidgetAction[];\n /** v2.0: Callback for action events */\n onAction?: (action: WidgetAction, context: ActionContext) => Promise<ActionResult | void>;\n /** Phase 2: Global filter values to apply to widget data */\n filterValues?: Record<string, unknown>;\n}\n\n// ============================================================================\n// Custom comparison for memo - ensures actions changes trigger re-render\n// ============================================================================\n\nfunction arePropsEqual(prevProps: WidgetWrapperProps, nextProps: WidgetWrapperProps): boolean {\n // Always re-render if widget ID changes\n if (prevProps.widget.id !== nextProps.widget.id) return false;\n // Re-render if widget was updated\n if (prevProps.widget.updatedAt !== nextProps.widget.updatedAt) return false;\n // Re-render if loading state changes\n if (prevProps.isLoading !== nextProps.isLoading) return false;\n // Re-render if error changes\n if (prevProps.error !== nextProps.error) return false;\n // Re-render if actions count changes\n if ((prevProps.actions?.length ?? 0) !== (nextProps.actions?.length ?? 0)) return false;\n // Check if any action ID changed\n if (prevProps.actions && nextProps.actions) {\n for (let i = 0; i < prevProps.actions.length; i++) {\n if (prevProps.actions[i]?.id !== nextProps.actions[i]?.id) return false;\n }\n }\n // Also check data changes\n if (prevProps.data !== nextProps.data) return false;\n // Phase 2: Re-render if filter values changed\n if (JSON.stringify(prevProps.filterValues) !== JSON.stringify(nextProps.filterValues)) return false;\n return true;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport const WidgetWrapper: FC<WidgetWrapperProps> = memo(function WidgetWrapper({\n widget,\n children,\n data,\n className = '',\n isLoading: isLoadingProp,\n error: errorProp,\n onRefresh,\n onDrilldown,\n actions,\n onAction,\n filterValues,\n}) {\n // Store state - use Dashboard store for edit mode (synced with toolbar)\n const isEditMode = useDashboardStore((state) => state.viewMode === 'edit');\n const selectWidget = useWidgetStore((state) => state.selectWidget);\n const isSelected = useIsWidgetSelected(widget.id);\n const uiState = useWidgetUIState(widget.id);\n const globalFilterValues = useGlobalFilterValues();\n const apolloClient = useApolloClient();\n\n // Map a global-filter's id -> the data field it targets (`config.field`).\n // Global CATEGORY/TEXT filter values are keyed in the store by filter id (a\n // UUID), not by the data column they filter. Without this map, applyClientFilters\n // can only fall back to value/heuristic matching, which fails to narrow rows\n // whose targeted column (e.g. `country`, `cohort`) isn't in the hardcoded\n // heuristic list — so a selected Country/Cohort would not actually filter the\n // widget. We resolve the targeted field from the dashboard's globalFilters\n // (already in the Apollo cache from the page load) so a UUID-keyed filter\n // matches the row's configured field exactly.\n const widgetDashboardId = (widget as unknown as Record<string, unknown>).dashboardId as string | undefined;\n const filterFieldMap = useMemo<Record<string, string>>(() => {\n if (!widgetDashboardId) return {};\n try {\n const cached = apolloClient.readQuery<{\n getDashboard?: {\n globalFilters?: Array<{ id: string; config?: Record<string, unknown> | null }>;\n };\n }>({ query: GetDashboardDocument, variables: { id: widgetDashboardId } });\n const map: Record<string, string> = {};\n for (const f of cached?.getDashboard?.globalFilters ?? []) {\n const field = f.config?.field;\n if (typeof field === 'string' && field) map[f.id] = field;\n }\n return map;\n } catch {\n return {};\n }\n }, [apolloClient, widgetDashboardId]);\n\n // Fetch per-widget data from backend (parser-processed data)\n // This is needed because listWidgetsByDashboard uses WidgetListFields (without data)\n // for performance, so each widget fetches its own data individually\n const hasDataSource =\n !!(widget as unknown as Record<string, unknown>).dataSinkId ||\n !!(widget as unknown as Record<string, unknown>).datasetId ||\n !!(widget as unknown as Record<string, unknown>).parserId;\n const { data: fetchedWidgetData, loading: widgetDataLoading } = useWidgetData(widget.id, {\n skip: !hasDataSource,\n pollInterval: (widget.refreshInterval ?? 0) * 1000 || 0,\n });\n\n // WORKAROUND: If Zustand store is empty, directly read filter_* params from URL\n // This handles race conditions where the store hasn't been populated yet\n const urlFilterValues = useMemo(() => {\n if (typeof window === 'undefined') return {};\n\n const params = new URLSearchParams(window.location.search);\n const filters: Record<string, unknown> = {};\n\n params.forEach((value, key) => {\n if (key.startsWith('filter_')) {\n const filterId = key.slice('filter_'.length);\n // Skip internal metadata keys\n if (!filterId.startsWith('__')) {\n filters[filterId] = value;\n }\n }\n });\n\n return filters;\n }, []);\n\n // Phase 2: Merge global filter values (from URL) with explicit filterValues prop\n // This ensures both URL params (filter_*) and drilldown params work together\n const mergedFilterValues = useMemo(() => {\n const merged: Record<string, unknown> = {};\n\n // First, add URL filter values as fallback (in case Zustand store hasn't loaded yet)\n if (urlFilterValues && Object.keys(urlFilterValues).length > 0) {\n Object.assign(merged, urlFilterValues);\n }\n\n // Then, add global filter values from Zustand store (if populated)\n if (globalFilterValues && Object.keys(globalFilterValues).length > 0) {\n Object.assign(merged, globalFilterValues);\n }\n\n // Finally, add/override with explicit filterValues prop (e.g., from drilldown modal)\n if (filterValues && Object.keys(filterValues).length > 0) {\n Object.assign(merged, filterValues);\n }\n\n return merged;\n }, [urlFilterValues, globalFilterValues, filterValues]);\n\n // Track active filters (client-side filtering until backend supports it)\n const hasFilters = Object.keys(mergedFilterValues).length > 0;\n\n // Merge loading/error from props and store\n // Show loading if widget data is being fetched for the first time (no data yet)\n const isLoading = isLoadingProp ?? (widgetDataLoading && !fetchedWidgetData) ?? uiState.isLoading;\n const error = errorProp ?? uiState.errorMessage;\n\n // Get widget definition\n const definition = getWidgetDefinition(widget.type);\n\n // Stable refresh callback - use ref to avoid creating new function on each render\n const onRefreshRef = useRef(onRefresh);\n useEffect(() => {\n onRefreshRef.current = onRefresh;\n }, [onRefresh]);\n\n const stableOnRefresh = useCallback(async () => {\n if (onRefreshRef.current) {\n await onRefreshRef.current();\n }\n }, []);\n\n // Auto-refresh\n const { timeUntilRefresh, isPaused } = useWidgetAutoRefresh({\n widgetId: widget.id,\n refreshInterval: widget.refreshInterval,\n onRefresh: stableOnRefresh,\n enabled: !isEditMode && !!widget.refreshInterval,\n });\n\n // Container ref for PNG export\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Comments panel. The count query stays disabled until the panel is first\n // opened, so a dashboard of N widgets doesn't fire N comment queries on load.\n const [showComments, setShowComments] = useState(false);\n const [commentsEverOpened, setCommentsEverOpened] = useState(false);\n const { count: commentCount } = useWidgetComments(widget.id, commentsEverOpened);\n const toggleComments = useCallback(() => {\n setShowComments((open) => {\n const next = !open;\n if (next) setCommentsEverOpened(true);\n return next;\n });\n }, []);\n\n // Get widget data for export (computed early for hook)\n const exportData = useMemo(() => {\n if (data && Array.isArray(data)) return data;\n const rawData = (widget as unknown as Record<string, unknown>).data as Record<string, unknown> | undefined;\n if (rawData?.processed && Array.isArray(rawData.processed)) {\n return rawData.processed;\n }\n if (rawData?.raw) {\n const parsed = typeof rawData.raw === 'string' ? JSON.parse(rawData.raw) : rawData.raw;\n if (Array.isArray(parsed)) return parsed;\n }\n return null;\n }, [data, widget]);\n\n // Export functionality\n const { exportCSV, exportPNG } = useWidgetExport(widget, {\n data: exportData,\n containerRef: containerRef as unknown as RefObject<HTMLElement>,\n });\n\n // Helper to check if data is actually usable (has real content)\n const isUsableData = useCallback((d: unknown): boolean => {\n if (d === null || d === undefined) return false;\n if (Array.isArray(d)) return d.length > 0;\n if (typeof d === 'object') {\n const obj = d as Record<string, unknown>;\n const keys = Object.keys(obj);\n if (keys.length === 0) return false;\n // Check recursively for actual data content\n return keys.some((key) => {\n const val = obj[key];\n if (val === null || val === undefined || val === '') return false;\n if (Array.isArray(val)) return val.length > 0;\n if (typeof val === 'object') return isUsableData(val);\n return true;\n });\n }\n return true;\n }, []);\n\n // Phase 2: Client-side filter function for widget data\n const applyClientFilters = useCallback(\n (\n widgetData: Record<string, unknown> | Record<string, unknown>[]\n ): Record<string, unknown> | Record<string, unknown>[] => {\n if (!hasFilters || !widgetData) return widgetData;\n\n // Separate drilldown context filters (ctx_*) from regular filters\n const contextFilters: Record<string, unknown> = {};\n const regularFilters: Record<string, unknown> = {};\n\n Object.entries(mergedFilterValues || {}).forEach(([key, value]) => {\n if (key.startsWith('ctx_')) {\n // Strip ctx_ prefix to get the target field name\n const fieldName = key.slice(4); // Remove 'ctx_'\n contextFilters[fieldName] = value;\n } else if (!key.startsWith('__')) {\n // Skip internal metadata keys (__drilldown_depth, etc.)\n regularFilters[key] = value;\n }\n });\n\n // Helper to match a value against a filter (case-insensitive)\n const matchesFilter = (itemValue: unknown, filterValue: unknown): boolean => {\n if (filterValue === undefined || filterValue === null || filterValue === '') return true;\n if (itemValue === undefined || itemValue === null) return false;\n\n const itemStr = String(itemValue).toLowerCase();\n const filterStr = String(filterValue).toLowerCase();\n\n // Exact match or contains\n return itemStr === filterStr || itemStr.includes(filterStr);\n };\n\n // Helper to find a matching field in the item (case-insensitive key matching)\n const findFieldValue = (item: Record<string, unknown>, targetField: string): unknown => {\n const targetLower = targetField.toLowerCase();\n\n // Try exact match first\n if (item[targetField] !== undefined) return item[targetField];\n\n // Try case-insensitive match\n const matchingKey = Object.keys(item).find((k) => k.toLowerCase() === targetLower);\n if (matchingKey) return item[matchingKey];\n\n // Try partial match (e.g., 'region' matches 'regionName' or 'user_region')\n const partialMatch = Object.keys(item).find(\n (k) => k.toLowerCase().includes(targetLower) || targetLower.includes(k.toLowerCase())\n );\n if (partialMatch) return item[partialMatch];\n\n // Try stripping common prefixes from target field (e.g., 'kpiId' -> 'id', 'rowName' -> 'name')\n // This handles drilldown context where widget passes 'kpiId' but data has 'id'\n const commonPrefixes = ['kpi', 'row', 'item', 'data', 'cell', 'record', 'entry'];\n for (const prefix of commonPrefixes) {\n if (targetLower.startsWith(prefix) && targetLower.length > prefix.length) {\n const strippedField = targetLower.slice(prefix.length);\n // Try exact match with stripped field\n const strippedMatch = Object.keys(item).find((k) => k.toLowerCase() === strippedField);\n if (strippedMatch) return item[strippedMatch];\n }\n }\n\n return undefined;\n };\n\n // Helper function to filter an array of items\n const filterItems = (items: Record<string, unknown>[]): Record<string, unknown>[] => {\n return items.filter((item: Record<string, unknown>) => {\n // Only object rows are field-filterable. An array of primitives (e.g.\n // a heatmap's `rows: [\"5W-MedSurg\", …]`) carries no named fields — keep\n // every element. Without this, `findFieldValue` indexes into the string\n // by character offset and spuriously \"matches\" a filter, dropping rows.\n if (item === null || typeof item !== 'object' || Array.isArray(item)) {\n return true;\n }\n // First, apply drilldown context filters (ctx_*) - these have explicit field names\n for (const [fieldName, filterValue] of Object.entries(contextFilters)) {\n if (filterValue === undefined || filterValue === null || filterValue === '') continue;\n\n const itemValue = findFieldValue(item, fieldName);\n // If the field doesn't exist in this data item, skip this context filter.\n // Drilldown context params (e.g., source=support_status) are metadata about\n // the drilldown origin and should NOT filter out data when the target\n // dashboard's widgets don't have a matching field.\n if (itemValue === undefined) continue;\n if (!matchesFilter(itemValue, filterValue)) {\n return false;\n }\n }\n\n // Then, apply regular filters\n for (const [filterKey, filterValue] of Object.entries(regularFilters)) {\n if (filterValue === undefined || filterValue === null || filterValue === '') continue;\n\n // For date range filters\n if (typeof filterValue === 'object') {\n const fv = filterValue as Record<string, unknown>;\n if (fv.start || fv.end) {\n const dateFields = Object.entries(item).filter(\n ([k, _v]) => k.toLowerCase().includes('date') || k.toLowerCase().includes('time')\n );\n if (dateFields.length > 0) {\n const itemDate = new Date(dateFields[0][1] as string);\n if (fv.start && itemDate < new Date(fv.start as string)) return false;\n if (fv.end && itemDate > new Date(fv.end as string)) return false;\n }\n continue;\n }\n }\n\n // For numeric range filters\n if (typeof filterValue === 'object') {\n const nv = filterValue as Record<string, unknown>;\n if (nv.min !== undefined || nv.max !== undefined) {\n const numericFields = Object.entries(item).filter(([_k, v]) => typeof v === 'number');\n if (numericFields.length > 0) {\n const itemNum = numericFields[0][1] as number;\n if (nv.min !== undefined && itemNum < (nv.min as number)) return false;\n if (nv.max !== undefined && itemNum > (nv.max as number)) return false;\n }\n continue;\n }\n }\n\n // Any other object-shaped filter value (e.g. a DATE_RANGE filter set\n // to a preset like { preset: \"last_30_days\" } with no resolved\n // start/end, or a structured value we don't understand) cannot be\n // compared with the scalar matchers below. Passing it through would\n // stringify it to \"[object Object]\" and, via fuzzy field matching\n // (e.g. an `enrolledAt` filter partial-matching an `enrolled` number\n // column), spuriously exclude EVERY row. Treat such values as a no-op\n // for client-side filtering — the row set is unchanged until the\n // filter resolves to concrete start/end or scalar values.\n if (filterValue !== null && typeof filterValue === 'object' && !Array.isArray(filterValue)) {\n continue;\n }\n\n // Global CATEGORY/TEXT filters are keyed by filter id (UUID). Resolve\n // the data column they target from the filter's config.field. When the\n // widget's rows carry that column, the filter is authoritative — a\n // mismatch excludes the row; a missing column is a no-op (the filter\n // simply doesn't apply to this widget's shape). This is what makes a\n // selected Country/Cohort actually narrow the visible data.\n const targetField = filterFieldMap[filterKey];\n if (targetField) {\n const mappedValue = findFieldValue(item, targetField);\n if (mappedValue !== undefined) {\n if (!matchesFilter(mappedValue, filterValue)) {\n return false;\n }\n continue;\n }\n // Configured field absent from this widget's rows → filter is a\n // no-op for this widget (do not fall through to value heuristics,\n // which could spuriously match an unrelated column).\n continue;\n }\n\n // Try to match by filter key name first (for named filters). When\n // the widget's data actually carries the filter's field, the filter\n // is authoritative — a mismatch excludes the row.\n const fieldValue = findFieldValue(item, filterKey);\n if (fieldValue !== undefined) {\n if (!matchesFilter(fieldValue, filterValue)) {\n return false;\n }\n continue;\n }\n\n // For text/category filters - try multiple matching strategies\n const filterStr = String(filterValue).toLowerCase();\n\n // Strategy 1: Check all field values for exact or partial match\n const itemValues = Object.values(item).map((v) => String(v).toLowerCase());\n const hasMatch = itemValues.some((v) => v === filterStr || v.includes(filterStr));\n\n if (!hasMatch) {\n // Strategy 2: Try to find a field name that matches the filter value context\n const fieldNames = Object.keys(item).map((k) => k.toLowerCase());\n const possibleFields = fieldNames.filter(\n (f) =>\n f.includes('category') ||\n f.includes('type') ||\n f.includes('status') ||\n f.includes('name') ||\n f.includes('region') ||\n f.includes('group')\n );\n\n let fieldMatch = false;\n for (const fieldName of possibleFields) {\n const originalKey = Object.keys(item).find((k) => k.toLowerCase() === fieldName);\n if (originalKey) {\n const itemFieldValue = String(item[originalKey]).toLowerCase();\n if (itemFieldValue === filterStr || itemFieldValue.includes(filterStr)) {\n fieldMatch = true;\n break;\n }\n }\n }\n\n // The filter's field is NOT present in this dataset (named-field\n // lookup failed AND no value/heuristic match). A global filter that\n // doesn't apply to a widget's shape must be a no-op for that widget\n // — not a silent \"exclude every row\". This mirrors the ctx_* rule\n // above (skip when the targeted field is absent). Without this, an\n // always-active required filter (e.g. campus=main) blanks every\n // parser-derived widget whose output has no campus column.\n if (!fieldMatch) {\n continue;\n }\n }\n }\n return true;\n });\n };\n\n // If data is an array, filter the items directly\n if (Array.isArray(widgetData)) {\n const filtered = filterItems(widgetData);\n return filtered;\n }\n\n // Handle object with array properties (rows, items, members, questions, data, etc.)\n if (widgetData && typeof widgetData === 'object') {\n // Common array property names in widget data\n const arrayPropertyNames = [\n 'kpis', // KPI Comparison widget\n 'rows', // Table widget\n 'items', // List widget\n 'members', // Team/member widgets\n 'questions', // Form widget\n 'data', // Generic data\n 'records', // Database-style data\n 'results', // Search/query results\n 'entries', // Log/feed entries\n 'list', // Generic list\n 'values', // Value arrays\n 'series', // Chart series\n 'datasets', // Chart datasets\n ];\n\n for (const propName of arrayPropertyNames) {\n if (widgetData[propName] && Array.isArray(widgetData[propName])) {\n const filteredArray = filterItems(widgetData[propName]);\n return {\n ...widgetData,\n [propName]: filteredArray,\n ...(propName === 'rows' ? { totalRows: filteredArray.length } : {}),\n };\n }\n }\n\n // If no known array property found, check for any array property\n const arrayProps = Object.entries(widgetData).filter(([_key, v]) => Array.isArray(v));\n if (arrayProps.length > 0) {\n const [propName, propValue] = arrayProps[0];\n const filteredArray = filterItems(propValue as Record<string, unknown>[]);\n return {\n ...widgetData,\n [propName]: filteredArray,\n };\n }\n }\n\n // For non-filterable data, return as-is\n return widgetData;\n },\n [hasFilters, mergedFilterValues, widget.id, filterFieldMap]\n );\n\n // Get widget data from the widget itself (fetched from backend)\n const realWidgetData = useMemo(() => {\n let rawWidgetData = null;\n\n // Priority 1: Explicitly passed data prop\n if (data && isUsableData(data)) {\n rawWidgetData = data;\n }\n // Priority 2: Per-widget fetched data (from useWidgetData hook)\n // fetchedWidgetData IS a WidgetData object: { raw, processed, fetchedAt, cached }\n else if (fetchedWidgetData) {\n const fetched = fetchedWidgetData as unknown as Record<string, unknown>;\n if (fetched?.processed && isUsableData(fetched.processed)) {\n rawWidgetData = fetched.processed;\n } else if (fetched?.raw) {\n try {\n const parsed = typeof fetched.raw === 'string' ? JSON.parse(fetched.raw as string) : fetched.raw;\n if (isUsableData(parsed)) rawWidgetData = parsed;\n } catch {\n // Invalid JSON, ignore\n }\n }\n }\n // Priority 3: widget.data from GraphQL response (if already on widget object)\n else {\n const rawData = (widget as unknown as Record<string, unknown>).data as Record<string, unknown> | undefined;\n if (rawData?.processed && isUsableData(rawData.processed)) {\n rawWidgetData = rawData.processed;\n } else if (rawData?.raw) {\n try {\n const parsed = typeof rawData.raw === 'string' ? JSON.parse(rawData.raw) : rawData.raw;\n if (isUsableData(parsed)) rawWidgetData = parsed;\n } catch {\n // Invalid JSON, ignore\n }\n }\n }\n\n // Priority 4: config.mockData — user-configured sample JSON from Widget Properties Data tab\n // This is NOT auto-generated mock data; it's explicit JSON the user pasted in the UI\n if (!rawWidgetData) {\n const configMockData = (widget.config as Record<string, unknown> | undefined)?.mockData;\n if (configMockData) {\n try {\n const parsed = typeof configMockData === 'string' ? JSON.parse(configMockData) : configMockData;\n if (isUsableData(parsed)) {\n rawWidgetData = parsed;\n }\n } catch (e) {}\n }\n }\n\n // Generic parser-output resolution: a widget may bind to a parser whose\n // output is an envelope ({ byUnit:[...], house:{...} }) rather than the\n // exact array/object the renderer wants. config.dataKey / dataPath /\n // seriesPath is a dot-path INTO the resolved data that points at the\n // renderable subtree (e.g. \"byUnit\" for a table, \"rows\" for a chart).\n // Resolving it here keeps every renderer generic — the use-case-specific\n // shape knowledge lives in the widget config (set by the seed/UI), not in\n // the renderer. valueField (single-value metric path) is intentionally NOT\n // applied here: MetricCardWidget resolves it itself against the envelope.\n if (rawWidgetData && typeof rawWidgetData === 'object' && !Array.isArray(rawWidgetData)) {\n const cfg = widget.config as Record<string, unknown> | undefined;\n const pathKey = (cfg?.dataKey ?? cfg?.dataPath ?? cfg?.seriesPath) as string | undefined;\n if (pathKey && typeof pathKey === 'string') {\n const resolved = pathKey.split('.').reduce<unknown>((cur, seg) => {\n return cur && typeof cur === 'object' ? (cur as Record<string, unknown>)[seg] : undefined;\n }, rawWidgetData);\n if (resolved !== undefined && resolved !== null && isUsableData(resolved)) {\n rawWidgetData = resolved as Record<string, unknown>;\n }\n }\n }\n\n // Phase 2: Apply client-side filters if active\n if (hasFilters && rawWidgetData) {\n const filtered = applyClientFilters(rawWidgetData);\n return filtered;\n }\n\n return rawWidgetData;\n }, [data, widget, fetchedWidgetData, hasFilters, applyClientFilters, mergedFilterValues, isUsableData]);\n\n // Final widget data - real data only, no mock fallback\n const widgetData = useMemo(() => {\n return realWidgetData ?? null;\n }, [realWidgetData]);\n\n // Drilldown navigation (must be after widgetData is defined)\n const { executeDrilldown, canDrilldown } = useDrilldown({\n onDrilldown: (params, _mode) => {\n onDrilldown?.(params);\n },\n });\n\n // Check if widget has drilldown configured\n const hasDrilldown = useMemo(() => canDrilldown(widget), [widget, canDrilldown]);\n\n // Handle drilldown execution with context\n const handleDrilldown = useCallback(\n (selectedData?: Record<string, unknown>) => {\n if (!widget.drilldown?.enabled) return;\n\n const context: DrilldownContext = {\n selectedData: selectedData || {},\n globalFilters: globalFilterValues || {},\n widgetData: widgetData || {},\n metadata: {\n widgetId: widget.id,\n widgetType: widget.type,\n widgetTitle: widget.title,\n },\n sourceDashboardId: widget.dashboardId,\n };\n\n executeDrilldown(widget.drilldown, context);\n },\n [widget, widgetData, globalFilterValues, executeDrilldown]\n );\n\n // Track mouse position to distinguish click from drag\n const mouseDownPos = useRef<{ x: number; y: number } | null>(null);\n const DRAG_THRESHOLD = 5; // pixels - if mouse moves more than this, it's a drag\n\n // Handle mouse down - record position\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n mouseDownPos.current = { x: e.clientX, y: e.clientY };\n }, []);\n\n // Handle widget click - Edit mode only (View mode drilldown is triggered by data clicks)\n // Only trigger if mouse hasn't moved much (not a drag)\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation(); // Prevent DashboardGrid from also handling\n\n // Check if this was a drag (mouse moved significantly)\n if (mouseDownPos.current) {\n const dx = Math.abs(e.clientX - mouseDownPos.current.x);\n const dy = Math.abs(e.clientY - mouseDownPos.current.y);\n if (dx > DRAG_THRESHOLD || dy > DRAG_THRESHOLD) {\n // This was a drag, not a click - don't open config panel\n mouseDownPos.current = null;\n return;\n }\n }\n mouseDownPos.current = null;\n\n if (isEditMode) {\n // Edit mode: select widget for editing\n selectWidget(widget.id);\n }\n // View mode: drilldown is triggered by clicking specific data elements\n // (table rows, chart points, etc.) - not by clicking the widget itself\n },\n [isEditMode, selectWidget, widget.id]\n );\n\n // Handle keyboard navigation (Edit mode only)\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.stopPropagation();\n if (isEditMode) {\n selectWidget(widget.id);\n }\n }\n },\n [isEditMode, selectWidget, widget.id]\n );\n\n const hasRenderableCustomWidgetConfig = useMemo(\n () => widget.type === 'custom' && hasRenderableCustomConfig(widget.config),\n [widget.type, widget.config]\n );\n\n const customWidgetHasIframeConfig = useMemo(\n () => widget.type === 'custom' && hasCustomIframeConfig(widget.config),\n [widget.type, widget.config]\n );\n\n const showContainerDrilldownHints = hasDrilldown && !customWidgetHasIframeConfig;\n\n // Determine if data is empty\n const isEmpty = !isLoading && !error && !widgetData && !hasRenderableCustomWidgetConfig;\n\n // v2.0: Check if widget has a renderer specified (non-BIGCONSOLE)\n const widgetRenderer = useMemo(() => {\n const widgetWithRenderer = widget as Widget & { renderer?: RendererType };\n return widgetWithRenderer.renderer;\n }, [widget]);\n\n // v2.0: Determine if we should use the factory (non-BIGCONSOLE renderer)\n const useRendererFactory = useMemo(() => {\n const shouldUse = widgetRenderer && widgetRenderer !== 'BIGCONSOLE';\n return shouldUse;\n }, [widgetRenderer]);\n\n // v2.0: Create action context\n const actionContext = useMemo<ActionContext>(\n () => ({\n widgetId: widget.id,\n data: widgetData || {},\n }),\n [widget.id, widgetData]\n );\n\n // v2.0: Handle action callback from WidgetRendererFactory\n // Receives (action: WidgetAction, context: ActionContext) and forwards to parent\n // Checks if a more detailed backend action exists with same name\n const handleActionFromFactory = useCallback(\n (action: WidgetAction, context: ActionContext) => {\n if (!onAction) return;\n\n // Try to find a matching backend action by name (has more details like confirmation)\n const existingAction = actions?.find((a) => a.name === action.name);\n\n if (existingAction) {\n // Use existing backend action (has confirmation, style, icon, etc.)\n onAction(existingAction, context);\n } else {\n // Use the action from WidgetRendererFactory as-is\n onAction(action, context);\n }\n },\n [onAction, actions]\n );\n\n // Render the appropriate widget component based on type (v1.0 snake_case)\n const renderWidgetComponent = useCallback(() => {\n // Extract data based on widget type expectations\n // Different widgets expect different data formats\n const getDataForWidget = () => {\n if (!widgetData) return widgetData;\n\n // If data has 'rows' property (table data), extract rows\n if (widget.type === 'table' || widget.type === 'pivot_table') {\n if (Array.isArray(widgetData)) return widgetData;\n if (widgetData && typeof widgetData === 'object' && 'rows' in widgetData) {\n return (widgetData as { rows: unknown[] }).rows;\n }\n }\n\n // If data has 'items' property (list data), extract items\n if (widget.type === 'list') {\n if (Array.isArray(widgetData)) return widgetData;\n if (widgetData && typeof widgetData === 'object' && 'items' in widgetData) {\n return (widgetData as { items: unknown[] }).items;\n }\n }\n\n // If data has 'stages' property (old funnel format), extract stages\n if (widget.type === 'funnel_chart') {\n if (Array.isArray(widgetData)) return widgetData;\n if (widgetData && typeof widgetData === 'object' && 'stages' in widgetData) {\n return (widgetData as { stages: unknown[] }).stages;\n }\n }\n\n // If data has 'datasets' property (old chart format), convert to array format\n if (widget.type === 'chart') {\n if (Array.isArray(widgetData)) return widgetData;\n if (widgetData && typeof widgetData === 'object' && 'datasets' in widgetData) {\n // Convert old format to new array format\n const oldData = widgetData as { labels?: string[]; datasets?: { name: string; data: number[] }[] };\n if (oldData.labels && oldData.datasets) {\n return oldData.labels.map((label, i) => {\n const point: Record<string, unknown> = { name: label };\n oldData.datasets?.forEach((ds) => {\n point[ds.name.toLowerCase()] = ds.data[i];\n });\n return point;\n });\n }\n }\n }\n\n // For text widgets: convert parsed object data to {content, format} shape\n if (widget.type === 'text') {\n if (widgetData && typeof widgetData === 'object' && !('content' in (widgetData as Record<string, unknown>))) {\n // Auto-format parsed data as markdown content\n const obj = widgetData as Record<string, unknown>;\n const lines: string[] = [];\n for (const [key, val] of Object.entries(obj)) {\n if (val && typeof val === 'object' && !Array.isArray(val)) {\n lines.push(`### ${key}`);\n for (const [k2, v2] of Object.entries(val as Record<string, unknown>)) {\n lines.push(`- **${k2}:** ${v2}`);\n }\n } else if (Array.isArray(val)) {\n lines.push(`### ${key}`);\n val.slice(0, 10).forEach((item: unknown) => {\n if (item && typeof item === 'object') {\n const entries = Object.entries(item as Record<string, unknown>);\n lines.push(`- ${entries.map(([k, v]) => `**${k}:** ${v}`).join(' | ')}`);\n } else {\n lines.push(`- ${item}`);\n }\n });\n } else {\n lines.push(`- **${key}:** ${val}`);\n }\n }\n return { content: lines.join('\\n'), format: 'markdown' };\n }\n }\n\n // For custom widgets: pass data through with extracted value if configured\n if (widget.type === 'custom') {\n const config = widget.config as Record<string, unknown> | undefined;\n const valueField = config?.valueField as string | undefined;\n if (valueField && widgetData && typeof widgetData === 'object' && !Array.isArray(widgetData)) {\n const obj = widgetData as Record<string, unknown>;\n if (valueField in obj) {\n return { value: obj[valueField], label: widget.title, data: obj };\n }\n }\n }\n\n return widgetData;\n };\n\n const normalizedData = getDataForWidget();\n const props = {\n widget,\n data: normalizedData,\n onDrilldown: hasDrilldown ? handleDrilldown : undefined,\n };\n\n // v2.0: Use WidgetRendererFactory for non-BIGCONSOLE renderers\n if (useRendererFactory) {\n // For factory renderers (Adaptive Card, BlockKit, Custom), pass the RAW\n // processed data — NOT the type-normalized data. Normalization (e.g., text→markdown)\n // is only for BIGCONSOLE renderer widgets. Factory renderers handle their own\n // template interpolation against the raw data object.\n let factoryData: Record<string, unknown> = {};\n\n if (\n realWidgetData &&\n typeof realWidgetData === 'object' &&\n !Array.isArray(realWidgetData) &&\n Object.keys(realWidgetData as Record<string, unknown>).length > 0\n ) {\n // Use real data from backend (raw processed, not type-normalized)\n factoryData = { ...(realWidgetData as Record<string, unknown>) };\n }\n\n // For CUSTOM renderer: enrich data with standard fields expected by built-in components.\n // Built-in components (Counter, Card, SimpleText) read specific fields from data:\n // Counter: data.value, Card: data.title/data.description, SimpleText: data.text\n // Parsed data from datasinks has domain-specific fields (totalFiles, totalMessages, etc.)\n // Use config.valueField to extract the primary value and map it to standard fields.\n const internalType = (widget.config as Record<string, unknown> | undefined)?._internalWidgetType as\n | string\n | undefined;\n if (internalType === 'custom' && Object.keys(factoryData).length > 0) {\n const config = widget.config as Record<string, unknown> | undefined;\n const valueField = config?.valueField as string | undefined;\n if (valueField && valueField in factoryData) {\n const val = factoryData[valueField];\n const formatted = typeof val === 'number' ? val.toLocaleString() : String(val);\n // Map to standard fields for all built-in custom components\n factoryData = {\n ...factoryData,\n value: val, // Counter component\n title: factoryData.title || formatted, // Card component\n description: factoryData.description || widget.title || '', // Card component\n text: factoryData.text || formatted, // SimpleText component\n };\n }\n }\n\n return (\n <WidgetRendererFactory\n widget={widget}\n data={factoryData}\n isEditMode={isEditMode}\n isSelected={isSelected}\n isLoading={isLoading}\n error={error}\n onDrilldown={hasDrilldown ? handleDrilldown : undefined}\n onAction={handleActionFromFactory}\n />\n );\n }\n\n // v1.0: Use switch-case for BIGCONSOLE renderer (default)\n // Normalize widget type to lowercase for case-insensitive matching\n const normalizedType = widget.type?.toLowerCase() || '';\n switch (normalizedType) {\n case 'metric_card':\n return <MetricCardWidget {...props} />;\n case 'kpi_card_comparison':\n return <KPIComparisonWidget {...props} />;\n case 'chart':\n case 'funnel_chart':\n return <ChartWidget {...props} />;\n case 'table':\n return <TableWidget {...props} />;\n case 'pivot_table':\n return <PivotTableWidget {...props} />;\n case 'gauge':\n return <GaugeWidget {...props} />;\n case 'progress':\n return <ProgressWidget {...props} />;\n case 'list':\n return <ListWidget {...props} />;\n case 'heatmap':\n return <HeatmapWidget {...props} />;\n case 'retention':\n return <RetentionWidget {...props} />;\n case 'calendar':\n return <CalendarWidget {...props} />;\n case 'timeline':\n return <TimelineWidget {...props} />;\n case 'kanban':\n return <KanbanWidget {...props} />;\n case 'form':\n return <AdaptiveCardWidget {...props} />;\n case 'text':\n return <TextWidget {...props} />;\n case 'iframe':\n return <IframeWidget {...props} />;\n case 'map':\n return <MapWidget {...props} />;\n case 'custom':\n return <CustomWidget {...props} />;\n default:\n return children || <WidgetEmptyState widgetType={widget.type} />;\n }\n }, [\n widget,\n widgetData,\n children,\n hasDrilldown,\n handleDrilldown,\n useRendererFactory,\n isEditMode,\n isSelected,\n isLoading,\n error,\n handleActionFromFactory,\n realWidgetData,\n ]);\n\n // Determine content to render\n const renderContent = () => {\n if (isLoading) {\n return <WidgetLoadingState />;\n }\n\n if (error) {\n return <WidgetErrorState error={error} onRetry={onRefresh} />;\n }\n\n if (isEmpty && !children) {\n // v2.0: Check parserId (primary) or dataSinkId (for context/drilldowns)\n return (\n <WidgetEmptyState\n widgetType={widget.type}\n hasDataSource={\n !!(widget as unknown as Record<string, unknown>).parserId ||\n !!(widget as unknown as Record<string, unknown>).dataSinkId\n }\n />\n );\n }\n\n // resetKey auto-resets the boundary on parser/sink re-bind or config edit without widget.id changing (BOFF-2242).\n const resetKey = `${widget.parserId ?? ''}|${widget.dataSinkId ?? ''}|${widget.updatedAt ?? ''}`;\n\n return (\n <WidgetErrorBoundary widgetId={widget.id} widgetType={widget.type} widgetTitle={widget.title} resetKey={resetKey}>\n {children ?? <Suspense fallback={<WidgetLoadingState />}>{renderWidgetComponent()}</Suspense>}\n </WidgetErrorBoundary>\n );\n };\n\n return (\n <div\n ref={containerRef}\n className={`\n group relative flex flex-col\n h-full w-full\n rounded-lg border\n bg-bg-surface\n transition-all duration-200\n ${\n isSelected && isEditMode\n ? 'border-action-primary-border ring-2 ring-action-primary-border/30'\n : 'border-border-default hover:border-action-primary-bg'\n }\n ${isEditMode ? 'cursor-pointer' : ''}\n ${className}\n `}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n tabIndex={isEditMode ? 0 : -1}\n role={isEditMode ? 'button' : undefined}\n aria-selected={isSelected}\n aria-label={`Widget: ${widget.title}`}\n data-widget-id={widget.id}\n data-widget-type={widget.type}\n >\n {/* Header */}\n <WidgetHeader\n widget={widget}\n definition={definition}\n isSelected={isSelected}\n isEditMode={isEditMode}\n isLoading={isLoading}\n timeUntilRefresh={widget.refreshInterval && !isPaused ? formatTimeUntilRefresh(timeUntilRefresh) : undefined}\n hasDrilldown={hasDrilldown}\n onRefresh={onRefresh}\n onExportCSV={exportData ? exportCSV : undefined}\n onExportPNG={exportPNG}\n onDrilldown={hasDrilldown ? () => handleDrilldown() : undefined}\n onToggleComments={toggleComments}\n commentsOpen={showComments}\n commentCount={commentsEverOpened ? commentCount : undefined}\n />\n\n {/* Content Area */}\n <div\n className={`\n flex-1 overflow-hidden p-4 min-h-0\n ${showContainerDrilldownHints && !isEditMode ? 'cursor-pointer' : ''}\n `}\n title={showContainerDrilldownHints && !isEditMode ? 'Click data to drill down' : undefined}\n >\n <div className=\"h-full overflow-auto\">{renderContent()}</div>\n </div>\n\n {/* v2.0: Widget Actions */}\n {actions && actions.length > 0 && !isLoading && !error && (\n <div className=\"px-4 py-3 border-t border-border-default bg-bg-muted\" style={{ flexShrink: 0 }}>\n <WidgetActions\n actions={actions}\n context={actionContext}\n onAction={onAction}\n disabled={isEditMode}\n layout=\"horizontal\"\n size=\"sm\"\n />\n </div>\n )}\n\n {/* Edit mode: react-grid-layout provides resize handles */}\n\n {/* Drilldown Indicator */}\n {showContainerDrilldownHints && !isEditMode && (\n <div\n className=\"\n absolute bottom-2 right-2\n opacity-0 group-hover:opacity-100\n transition-opacity duration-200\n \"\n title=\"Click to drill down\"\n >\n <svg className=\"w-4 h-4 text-text-secondary\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 7l5 5m0 0l-5 5m5-5H6\" />\n </svg>\n </div>\n )}\n\n {/* Comments panel (overlay) */}\n {showComments && (\n <Suspense fallback={null}>\n <WidgetComments widgetId={widget.id} onClose={() => setShowComments(false)} />\n </Suspense>\n )}\n </div>\n );\n}, arePropsEqual);\n\nexport default WidgetWrapper;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2DA,IAAM,KAA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"description": "BigConsole - AI-powered analytics and dashboard platform",
5
5
  "type": "module",
6
6
  "files": [