@burdenoff/microfe-bigconsole 2026.615.1 → 2026.615.3

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.
@@ -4,34 +4,35 @@ import "../../store/index.js";
4
4
  import a from "../../hooks/useWidgetData.js";
5
5
  import { getWidgetDefinition as o } from "./WidgetRegistry.js";
6
6
  import { formatTimeUntilRefresh as ee, useWidgetAutoRefresh as te } from "../../hooks/useAutoRefresh.js";
7
- import ne from "../../hooks/useWidgetExport.js";
8
- import re from "../../hooks/useDrilldown.js";
7
+ import ne from "../../hooks/useWidgetComments.js";
8
+ import re from "../../hooks/useWidgetExport.js";
9
+ import ie from "../../hooks/useDrilldown.js";
9
10
  import "../../hooks/index.js";
10
- import ie from "./WidgetHeader.js";
11
+ import ae from "./WidgetHeader.js";
11
12
  import s from "./states/LoadingState.js";
12
- import ae from "./states/ErrorState.js";
13
+ import oe from "./states/ErrorState.js";
13
14
  import c from "./states/EmptyState.js";
14
- import l from "./WidgetErrorBoundary.js";
15
- import { hasCustomIframeConfig as u, hasRenderableCustomConfig as oe } from "./custom/config.js";
16
- import se from "../../renderers/factory/WidgetRendererFactory.js";
17
- import d from "./widget-actions/WidgetActions.js";
15
+ import se from "./WidgetErrorBoundary.js";
16
+ import { hasCustomIframeConfig as ce, hasRenderableCustomConfig as le } from "./custom/config.js";
17
+ import ue from "../../renderers/factory/WidgetRendererFactory.js";
18
+ import de from "./widget-actions/WidgetActions.js";
18
19
  import "./widget-actions/index.js";
19
- import { Suspense as ce, lazy as f, memo as p, useCallback as m, useEffect as le, useMemo as h, useRef as g } from "react";
20
- import { jsx as _, jsxs as ue } from "react/jsx-runtime";
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
22
  //#region src/bigconsole/components/widgets/WidgetWrapper.tsx
22
- var de = f(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), v = f(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), y = f(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), fe = f(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), pe = f(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), me = f(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), he = f(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), ge = f(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), _e = f(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), ve = f(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), ye = f(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), be = f(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), xe = f(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Se = f(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), Ce = f(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget }))), we = f(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
23
- function b(e, t) {
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("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), Ce = u(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), we = u(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), Te = u(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Ee = u(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), De = u(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Oe = u(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), ke = u(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget }))), Ae = u(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget }))), je = u(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments })));
24
+ function _(e, t) {
24
25
  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;
25
26
  if (e.actions && t.actions) {
26
27
  for (let n = 0; n < e.actions.length; n++) if (e.actions[n]?.id !== t.actions[n]?.id) return !1;
27
28
  }
28
29
  return !(e.data !== t.data || JSON.stringify(e.filterValues) !== JSON.stringify(t.filterValues));
29
30
  }
30
- var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoading: Te, error: Ee, onRefresh: S, onDrilldown: C, actions: w, onAction: T, filterValues: E }) {
31
- let D = r((e) => e.viewMode === "edit"), O = t((e) => e.selectWidget), k = e(f.id), A = n(f.id), j = i(), De = !!f.dataSinkId || !!f.datasetId || !!f.parserId, { data: M, loading: Oe } = a(f.id, {
32
- skip: !De,
33
- pollInterval: (f.refreshInterval ?? 0) * 1e3 || 0
34
- }), N = h(() => {
31
+ var v = d(function({ widget: u, children: d, data: _, className: v = "", isLoading: Me, error: Ne, onRefresh: y, onDrilldown: Pe, 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(), Fe = !!u.dataSinkId || !!u.datasetId || !!u.parserId, { data: O, loading: Ie } = a(u.id, {
33
+ skip: !Fe,
34
+ pollInterval: (u.refreshInterval ?? 0) * 1e3 || 0
35
+ }), k = p(() => {
35
36
  if (typeof window > "u") return {};
36
37
  let e = new URLSearchParams(window.location.search), t = {};
37
38
  return e.forEach((e, n) => {
@@ -40,37 +41,42 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
40
41
  r.startsWith("__") || (t[r] = e);
41
42
  }
42
43
  }), t;
43
- }, []), P = h(() => {
44
+ }, []), A = p(() => {
44
45
  let e = {};
45
- return N && Object.keys(N).length > 0 && Object.assign(e, N), j && Object.keys(j).length > 0 && Object.assign(e, j), E && Object.keys(E).length > 0 && Object.assign(e, E), 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;
46
47
  }, [
47
- N,
48
- j,
49
- E
50
- ]), F = Object.keys(P).length > 0, I = Te ?? (Oe && !M) ?? A.isLoading, L = Ee ?? A.errorMessage, ke = o(f.type), R = g(S);
51
- le(() => {
52
- R.current = S;
53
- }, [S]);
54
- let Ae = m(async () => {
55
- R.current && await R.current();
56
- }, []), { timeUntilRefresh: je, isPaused: Me } = te({
57
- widgetId: f.id,
58
- refreshInterval: f.refreshInterval,
59
- onRefresh: Ae,
60
- enabled: !D && !!f.refreshInterval
61
- }), z = g(null), B = h(() => {
62
- if (b && Array.isArray(b)) return b;
63
- let e = f.data;
48
+ k,
49
+ D,
50
+ S
51
+ ]), j = Object.keys(A).length > 0, M = Me ?? (Ie && !O) ?? E.isLoading, N = Ne ?? E.errorMessage, Le = o(u.type), P = m(y);
52
+ fe(() => {
53
+ P.current = y;
54
+ }, [y]);
55
+ let F = f(async () => {
56
+ P.current && await P.current();
57
+ }, []), { timeUntilRefresh: Re, isPaused: ze } = 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, Be] = h(!1), { count: Ve } = ne(u.id, z), He = f(() => {
63
+ R((e) => {
64
+ let t = !e;
65
+ return t && Be(!0), t;
66
+ });
67
+ }, []), B = p(() => {
68
+ if (_ && Array.isArray(_)) return _;
69
+ let e = u.data;
64
70
  if (e?.processed && Array.isArray(e.processed)) return e.processed;
65
71
  if (e?.raw) {
66
72
  let t = typeof e.raw == "string" ? JSON.parse(e.raw) : e.raw;
67
73
  if (Array.isArray(t)) return t;
68
74
  }
69
75
  return null;
70
- }, [b, f]), { exportCSV: Ne, exportPNG: Pe } = ne(f, {
76
+ }, [_, u]), { exportCSV: Ue, exportPNG: We } = re(u, {
71
77
  data: B,
72
- containerRef: z
73
- }), V = m((e) => {
78
+ containerRef: I
79
+ }), V = f((e) => {
74
80
  if (e == null) return !1;
75
81
  if (Array.isArray(e)) return e.length > 0;
76
82
  if (typeof e == "object") {
@@ -81,10 +87,10 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
81
87
  });
82
88
  }
83
89
  return !0;
84
- }, []), H = m((e) => {
85
- if (!F || !e) return e;
90
+ }, []), H = f((e) => {
91
+ if (!j || !e) return e;
86
92
  let t = {}, n = {};
87
- Object.entries(P || {}).forEach(([e, r]) => {
93
+ Object.entries(A || {}).forEach(([e, r]) => {
88
94
  if (e.startsWith("ctx_")) {
89
95
  let n = e.slice(4);
90
96
  t[n] = r;
@@ -202,21 +208,21 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
202
208
  }
203
209
  return e;
204
210
  }, [
205
- F,
206
- P,
207
- f.id
208
- ]), U = h(() => {
211
+ j,
212
+ A,
213
+ u.id
214
+ ]), U = p(() => {
209
215
  let e = null;
210
- if (b && V(b)) e = b;
211
- else if (M) {
212
- let t = M;
216
+ if (_ && V(_)) e = _;
217
+ else if (O) {
218
+ let t = O;
213
219
  if (t?.processed && V(t.processed)) e = t.processed;
214
220
  else if (t?.raw) try {
215
221
  let n = typeof t.raw == "string" ? JSON.parse(t.raw) : t.raw;
216
222
  V(n) && (e = n);
217
223
  } catch {}
218
224
  } else {
219
- let t = f.data;
225
+ let t = u.data;
220
226
  if (t?.processed && V(t.processed)) e = t.processed;
221
227
  else if (t?.raw) try {
222
228
  let n = typeof t.raw == "string" ? JSON.parse(t.raw) : t.raw;
@@ -224,48 +230,48 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
224
230
  } catch {}
225
231
  }
226
232
  if (!e) {
227
- let t = f.config?.mockData;
233
+ let t = u.config?.mockData;
228
234
  if (t) try {
229
235
  let n = typeof t == "string" ? JSON.parse(t) : t;
230
236
  V(n) && (e = n);
231
237
  } catch {}
232
238
  }
233
- return F && e ? H(e) : e;
239
+ return j && e ? H(e) : e;
234
240
  }, [
235
- b,
236
- f,
237
- M,
238
- F,
241
+ _,
242
+ u,
243
+ O,
244
+ j,
239
245
  H,
240
- P,
246
+ A,
241
247
  V
242
- ]), W = h(() => U ?? null, [U]), { executeDrilldown: G, canDrilldown: K } = re({ onDrilldown: (e, t) => {
243
- C?.(e);
244
- } }), q = h(() => K(f), [f, K]), J = m((e) => {
245
- if (!f.drilldown?.enabled) return;
248
+ ]), W = p(() => U ?? null, [U]), { executeDrilldown: G, canDrilldown: K } = ie({ onDrilldown: (e, t) => {
249
+ Pe?.(e);
250
+ } }), q = p(() => K(u), [u, K]), J = f((e) => {
251
+ if (!u.drilldown?.enabled) return;
246
252
  let t = {
247
253
  selectedData: e || {},
248
- globalFilters: j || {},
254
+ globalFilters: D || {},
249
255
  widgetData: W || {},
250
256
  metadata: {
251
- widgetId: f.id,
252
- widgetType: f.type,
253
- widgetTitle: f.title
257
+ widgetId: u.id,
258
+ widgetType: u.type,
259
+ widgetTitle: u.title
254
260
  },
255
- sourceDashboardId: f.dashboardId
261
+ sourceDashboardId: u.dashboardId
256
262
  };
257
- G(f.drilldown, t);
263
+ G(u.drilldown, t);
258
264
  }, [
259
- f,
265
+ u,
260
266
  W,
261
- j,
267
+ D,
262
268
  G
263
- ]), Y = g(null), Fe = m((e) => {
269
+ ]), Y = m(null), Ge = f((e) => {
264
270
  Y.current = {
265
271
  x: e.clientX,
266
272
  y: e.clientY
267
273
  };
268
- }, []), Ie = m((e) => {
274
+ }, []), Ke = f((e) => {
269
275
  if (e.stopPropagation(), Y.current) {
270
276
  let t = Math.abs(e.clientX - Y.current.x), n = Math.abs(e.clientY - Y.current.y);
271
277
  if (t > 5 || n > 5) {
@@ -273,42 +279,42 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
273
279
  return;
274
280
  }
275
281
  }
276
- Y.current = null, D && O(f.id);
282
+ Y.current = null, C && w(u.id);
277
283
  }, [
278
- D,
279
- O,
280
- f.id
281
- ]), Le = m((e) => {
282
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), D && O(f.id));
284
+ C,
285
+ w,
286
+ u.id
287
+ ]), qe = f((e) => {
288
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), C && w(u.id));
283
289
  }, [
284
- D,
285
- O,
286
- f.id
287
- ]), Re = h(() => f.type === "custom" && oe(f.config), [f.type, f.config]), ze = h(() => f.type === "custom" && u(f.config), [f.type, f.config]), X = q && !ze, Be = !I && !L && !W && !Re, Z = h(() => f.renderer, [f]), Q = h(() => Z && Z !== "BIGCONSOLE", [Z]), Ve = h(() => ({
288
- widgetId: f.id,
290
+ C,
291
+ w,
292
+ u.id
293
+ ]), Je = p(() => u.type === "custom" && le(u.config), [u.type, u.config]), Ye = p(() => u.type === "custom" && ce(u.config), [u.type, u.config]), X = q && !Ye, Xe = !M && !N && !W && !Je, Z = p(() => u.renderer, [u]), Q = p(() => Z && Z !== "BIGCONSOLE", [Z]), Ze = p(() => ({
294
+ widgetId: u.id,
289
295
  data: W || {}
290
- }), [f.id, W]), $ = m((e, t) => {
291
- if (!T) return;
292
- let n = w?.find((t) => t.name === e.name);
293
- T(n || e, t);
294
- }, [T, w]), He = m(() => {
296
+ }), [u.id, W]), $ = f((e, t) => {
297
+ if (!x) return;
298
+ let n = b?.find((t) => t.name === e.name);
299
+ x(n || e, t);
300
+ }, [x, b]), Qe = f(() => {
295
301
  let e = {
296
- widget: f,
302
+ widget: u,
297
303
  data: (() => {
298
304
  if (!W) return W;
299
- if (f.type === "table" || f.type === "pivot_table") {
305
+ if (u.type === "table" || u.type === "pivot_table") {
300
306
  if (Array.isArray(W)) return W;
301
307
  if (W && typeof W == "object" && "rows" in W) return W.rows;
302
308
  }
303
- if (f.type === "list") {
309
+ if (u.type === "list") {
304
310
  if (Array.isArray(W)) return W;
305
311
  if (W && typeof W == "object" && "items" in W) return W.items;
306
312
  }
307
- if (f.type === "funnel_chart") {
313
+ if (u.type === "funnel_chart") {
308
314
  if (Array.isArray(W)) return W;
309
315
  if (W && typeof W == "object" && "stages" in W) return W.stages;
310
316
  }
311
- if (f.type === "chart") {
317
+ if (u.type === "chart") {
312
318
  if (Array.isArray(W)) return W;
313
319
  if (W && typeof W == "object" && "datasets" in W) {
314
320
  let e = W;
@@ -320,7 +326,7 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
320
326
  });
321
327
  }
322
328
  }
323
- if (f.type === "text" && W && typeof W == "object" && !("content" in W)) {
329
+ if (u.type === "text" && W && typeof W == "object" && !("content" in W)) {
324
330
  let e = W, t = [];
325
331
  for (let [n, r] of Object.entries(e)) if (r && typeof r == "object" && !Array.isArray(r)) {
326
332
  t.push(`### ${n}`);
@@ -336,13 +342,13 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
336
342
  format: "markdown"
337
343
  };
338
344
  }
339
- if (f.type === "custom") {
340
- let e = f.config?.valueField;
345
+ if (u.type === "custom") {
346
+ let e = u.config?.valueField;
341
347
  if (e && W && typeof W == "object" && !Array.isArray(W)) {
342
348
  let t = W;
343
349
  if (e in t) return {
344
350
  value: t[e],
345
- label: f.title,
351
+ label: u.title,
346
352
  data: t
347
353
  };
348
354
  }
@@ -353,164 +359,174 @@ var x = p(function({ widget: f, children: p, data: b, className: x = "", isLoadi
353
359
  };
354
360
  if (Q) {
355
361
  let e = {};
356
- if (U && typeof U == "object" && !Array.isArray(U) && Object.keys(U).length > 0 && (e = { ...U }), f.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
357
- let t = f.config?.valueField;
362
+ if (U && typeof U == "object" && !Array.isArray(U) && Object.keys(U).length > 0 && (e = { ...U }), u.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
363
+ let t = u.config?.valueField;
358
364
  if (t && t in e) {
359
365
  let n = e[t], r = typeof n == "number" ? n.toLocaleString() : String(n);
360
366
  e = {
361
367
  ...e,
362
368
  value: n,
363
369
  title: e.title || r,
364
- description: e.description || f.title || "",
370
+ description: e.description || u.title || "",
365
371
  text: e.text || r
366
372
  };
367
373
  }
368
374
  }
369
- return /* @__PURE__ */ _(se, {
370
- widget: f,
375
+ return /* @__PURE__ */ g(ue, {
376
+ widget: u,
371
377
  data: e,
372
- isEditMode: D,
373
- isSelected: k,
374
- isLoading: I,
375
- error: L,
378
+ isEditMode: C,
379
+ isSelected: T,
380
+ isLoading: M,
381
+ error: N,
376
382
  onDrilldown: q ? J : void 0,
377
383
  onAction: $
378
384
  });
379
385
  }
380
- switch (f.type?.toLowerCase() || "") {
381
- case "metric_card": return /* @__PURE__ */ _(de, { ...e });
382
- case "kpi_card_comparison": return /* @__PURE__ */ _(ye, { ...e });
386
+ switch (u.type?.toLowerCase() || "") {
387
+ case "metric_card": return /* @__PURE__ */ g(me, { ...e });
388
+ case "kpi_card_comparison": return /* @__PURE__ */ g(Te, { ...e });
383
389
  case "chart":
384
- case "funnel_chart": return /* @__PURE__ */ _(v, { ...e });
385
- case "table":
386
- case "pivot_table": return /* @__PURE__ */ _(y, { ...e });
387
- case "gauge": return /* @__PURE__ */ _(fe, { ...e });
388
- case "progress": return /* @__PURE__ */ _(pe, { ...e });
389
- case "list": return /* @__PURE__ */ _(me, { ...e });
390
- case "heatmap": return /* @__PURE__ */ _(he, { ...e });
391
- case "calendar": return /* @__PURE__ */ _(ge, { ...e });
392
- case "timeline": return /* @__PURE__ */ _(ve, { ...e });
393
- case "kanban": return /* @__PURE__ */ _(_e, { ...e });
394
- case "form": return /* @__PURE__ */ _(we, { ...e });
395
- case "text": return /* @__PURE__ */ _(be, { ...e });
396
- case "iframe": return /* @__PURE__ */ _(Se, { ...e });
397
- case "map": return /* @__PURE__ */ _(xe, { ...e });
398
- case "custom": return /* @__PURE__ */ _(Ce, { ...e });
399
- default: return p || /* @__PURE__ */ _(c, { widgetType: f.type });
390
+ case "funnel_chart": return /* @__PURE__ */ g(he, { ...e });
391
+ case "table": return /* @__PURE__ */ g(ge, { ...e });
392
+ case "pivot_table": return /* @__PURE__ */ g(_e, { ...e });
393
+ case "gauge": return /* @__PURE__ */ g(ve, { ...e });
394
+ case "progress": return /* @__PURE__ */ g(ye, { ...e });
395
+ case "list": return /* @__PURE__ */ g(be, { ...e });
396
+ case "heatmap": return /* @__PURE__ */ g(xe, { ...e });
397
+ case "calendar": return /* @__PURE__ */ g(Se, { ...e });
398
+ case "timeline": return /* @__PURE__ */ g(we, { ...e });
399
+ case "kanban": return /* @__PURE__ */ g(Ce, { ...e });
400
+ case "form": return /* @__PURE__ */ g(Ae, { ...e });
401
+ case "text": return /* @__PURE__ */ g(Ee, { ...e });
402
+ case "iframe": return /* @__PURE__ */ g(Oe, { ...e });
403
+ case "map": return /* @__PURE__ */ g(De, { ...e });
404
+ case "custom": return /* @__PURE__ */ g(ke, { ...e });
405
+ default: return d || /* @__PURE__ */ g(c, { widgetType: u.type });
400
406
  }
401
407
  }, [
402
- f,
408
+ u,
403
409
  W,
404
- p,
410
+ d,
405
411
  q,
406
412
  J,
407
413
  Q,
408
- D,
409
- k,
410
- I,
411
- L,
414
+ C,
415
+ T,
416
+ M,
417
+ N,
412
418
  $,
413
419
  U
414
420
  ]);
415
- return /* @__PURE__ */ ue("div", {
416
- ref: z,
421
+ return /* @__PURE__ */ pe("div", {
422
+ ref: I,
417
423
  className: `
418
424
  group relative flex flex-col
419
425
  h-full w-full
420
426
  rounded-lg border
421
427
  bg-bg-surface
422
428
  transition-all duration-200
423
- ${k && D ? "border-action-primary-border ring-2 ring-action-primary-border/30" : "border-border-default hover:border-action-primary-bg"}
424
- ${D ? "cursor-pointer" : ""}
425
- ${x}
429
+ ${T && C ? "border-action-primary-border ring-2 ring-action-primary-border/30" : "border-border-default hover:border-action-primary-bg"}
430
+ ${C ? "cursor-pointer" : ""}
431
+ ${v}
426
432
  `,
427
- onMouseDown: Fe,
428
- onClick: Ie,
429
- onKeyDown: Le,
430
- tabIndex: D ? 0 : -1,
431
- role: D ? "button" : void 0,
432
- "aria-selected": k,
433
- "aria-label": `Widget: ${f.title}`,
434
- "data-widget-id": f.id,
435
- "data-widget-type": f.type,
433
+ onMouseDown: Ge,
434
+ onClick: Ke,
435
+ onKeyDown: qe,
436
+ tabIndex: C ? 0 : -1,
437
+ role: C ? "button" : void 0,
438
+ "aria-selected": T,
439
+ "aria-label": `Widget: ${u.title}`,
440
+ "data-widget-id": u.id,
441
+ "data-widget-type": u.type,
436
442
  children: [
437
- /* @__PURE__ */ _(ie, {
438
- widget: f,
439
- definition: ke,
440
- isSelected: k,
441
- isEditMode: D,
442
- isLoading: I,
443
- timeUntilRefresh: f.refreshInterval && !Me ? ee(je) : void 0,
443
+ /* @__PURE__ */ g(ae, {
444
+ widget: u,
445
+ definition: Le,
446
+ isSelected: T,
447
+ isEditMode: C,
448
+ isLoading: M,
449
+ timeUntilRefresh: u.refreshInterval && !ze ? ee(Re) : void 0,
444
450
  hasDrilldown: q,
445
- onRefresh: S,
446
- onExportCSV: B ? Ne : void 0,
447
- onExportPNG: Pe,
448
- onDrilldown: q ? () => J() : void 0
451
+ onRefresh: y,
452
+ onExportCSV: B ? Ue : void 0,
453
+ onExportPNG: We,
454
+ onDrilldown: q ? () => J() : void 0,
455
+ onToggleComments: He,
456
+ commentsOpen: L,
457
+ commentCount: z ? Ve : void 0
449
458
  }),
450
- /* @__PURE__ */ _("div", {
459
+ /* @__PURE__ */ g("div", {
451
460
  className: `
452
461
  flex-1 overflow-hidden p-4 min-h-0
453
- ${X && !D ? "cursor-pointer" : ""}
462
+ ${X && !C ? "cursor-pointer" : ""}
454
463
  `,
455
- title: X && !D ? "Click data to drill down" : void 0,
456
- children: /* @__PURE__ */ _("div", {
464
+ title: X && !C ? "Click data to drill down" : void 0,
465
+ children: /* @__PURE__ */ g("div", {
457
466
  className: "h-full overflow-auto",
458
467
  children: (() => {
459
- if (I) return /* @__PURE__ */ _(s, {});
460
- if (L) return /* @__PURE__ */ _(ae, {
461
- error: L,
462
- onRetry: S
468
+ if (M) return /* @__PURE__ */ g(s, {});
469
+ if (N) return /* @__PURE__ */ g(oe, {
470
+ error: N,
471
+ onRetry: y
463
472
  });
464
- if (Be && !p) return /* @__PURE__ */ _(c, {
465
- widgetType: f.type,
466
- hasDataSource: !!f.parserId || !!f.dataSinkId
473
+ if (Xe && !d) return /* @__PURE__ */ g(c, {
474
+ widgetType: u.type,
475
+ hasDataSource: !!u.parserId || !!u.dataSinkId
467
476
  });
468
- let e = `${f.parserId ?? ""}|${f.dataSinkId ?? ""}|${f.updatedAt ?? ""}`;
469
- return /* @__PURE__ */ _(l, {
470
- widgetId: f.id,
471
- widgetType: f.type,
472
- widgetTitle: f.title,
477
+ let e = `${u.parserId ?? ""}|${u.dataSinkId ?? ""}|${u.updatedAt ?? ""}`;
478
+ return /* @__PURE__ */ g(se, {
479
+ widgetId: u.id,
480
+ widgetType: u.type,
481
+ widgetTitle: u.title,
473
482
  resetKey: e,
474
- children: p ?? /* @__PURE__ */ _(ce, {
475
- fallback: /* @__PURE__ */ _(s, {}),
476
- children: He()
483
+ children: d ?? /* @__PURE__ */ g(l, {
484
+ fallback: /* @__PURE__ */ g(s, {}),
485
+ children: Qe()
477
486
  })
478
487
  });
479
488
  })()
480
489
  })
481
490
  }),
482
- w && w.length > 0 && !I && !L && /* @__PURE__ */ _("div", {
491
+ b && b.length > 0 && !M && !N && /* @__PURE__ */ g("div", {
483
492
  className: "px-4 py-3 border-t border-border-default bg-bg-muted",
484
493
  style: { flexShrink: 0 },
485
- children: /* @__PURE__ */ _(d, {
486
- actions: w,
487
- context: Ve,
488
- onAction: T,
489
- disabled: D,
494
+ children: /* @__PURE__ */ g(de, {
495
+ actions: b,
496
+ context: Ze,
497
+ onAction: x,
498
+ disabled: C,
490
499
  layout: "horizontal",
491
500
  size: "sm"
492
501
  })
493
502
  }),
494
- X && !D && /* @__PURE__ */ _("div", {
503
+ X && !C && /* @__PURE__ */ g("div", {
495
504
  className: "\n absolute bottom-2 right-2\n opacity-0 group-hover:opacity-100\n transition-opacity duration-200\n ",
496
505
  title: "Click to drill down",
497
- children: /* @__PURE__ */ _("svg", {
506
+ children: /* @__PURE__ */ g("svg", {
498
507
  className: "w-4 h-4 text-text-secondary",
499
508
  fill: "none",
500
509
  stroke: "currentColor",
501
510
  viewBox: "0 0 24 24",
502
- children: /* @__PURE__ */ _("path", {
511
+ children: /* @__PURE__ */ g("path", {
503
512
  strokeLinecap: "round",
504
513
  strokeLinejoin: "round",
505
514
  strokeWidth: 2,
506
515
  d: "M13 7l5 5m0 0l-5 5m5-5H6"
507
516
  })
508
517
  })
518
+ }),
519
+ L && /* @__PURE__ */ g(l, {
520
+ fallback: null,
521
+ children: /* @__PURE__ */ g(je, {
522
+ widgetId: u.id,
523
+ onClose: () => R(!1)
524
+ })
509
525
  })
510
526
  ]
511
527
  });
512
- }, b);
528
+ }, _);
513
529
  //#endregion
514
- export { x as default };
530
+ export { v as default };
515
531
 
516
532
  //# sourceMappingURL=WidgetWrapper.js.map