serverside_pivot 0.0.95 → 0.0.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/react/chunks/ContextMenu-DJuS4qTZ.mjs +198 -0
  2. package/dist/react/chunks/{DetailDrawer-DCKIxSpW.mjs → DetailDrawer-DgKSC5Vu.mjs} +1 -1
  3. package/dist/react/chunks/{DetailSidePanel-DgUWPBQk.mjs → DetailSidePanel-CC5Dugyl.mjs} +1 -1
  4. package/dist/react/chunks/{DetailSurfaceContent-BEL6xuaZ.mjs → DetailSurfaceContent-CrQVHlcU.mjs} +52 -53
  5. package/dist/react/chunks/{ECharts2dRenderer-Dgkp9_1P.mjs → ECharts2dRenderer-46gLrUdf.mjs} +1 -1
  6. package/dist/react/chunks/{ECharts3dRenderer-70VOp8V0.mjs → ECharts3dRenderer-Dg4ta5Bl.mjs} +1 -1
  7. package/dist/react/chunks/{EditSidePanel-CygqVXLX.mjs → EditSidePanel-CkShaByb.mjs} +1 -1
  8. package/dist/react/chunks/{InlineDetailPanel-BUBRWdFW.mjs → InlineDetailPanel-mnwjoD0I.mjs} +1 -1
  9. package/dist/react/chunks/{PivotCharts-VX5-mEEp.mjs → PivotCharts-MX-Z7DlR.mjs} +1207 -1193
  10. package/dist/react/chunks/{ReportEditor-B5j-CU9-.mjs → ReportEditor-U0E42xKL.mjs} +506 -480
  11. package/dist/react/chunks/SidebarPanel-BzRW1Kgq.mjs +3944 -0
  12. package/dist/react/chunks/{SparklineDetailGraph-Cfe2KcOp.mjs → SparklineDetailGraph-35Tim_8B.mjs} +1 -1
  13. package/dist/react/chunks/{installCanvasRenderer-C4h5pc1p.mjs → installCanvasRenderer-DRq0xpXO.mjs} +1 -1
  14. package/dist/react/chunks/react-CL4GbEOd.mjs +33206 -0
  15. package/dist/react/chunks/{xlsx.mini.min-CzdkdH3N.mjs → xlsx.mini.min-kfIgXMVB.mjs} +1 -1
  16. package/dist/react/components/DashTanstackPivot.react.d.ts +4 -0
  17. package/dist/react/components/ShimmerFallback.d.ts +11 -0
  18. package/dist/react/components/ThemedSelect.d.ts +8 -0
  19. package/dist/react/contexts/PivotThemeContext.d.ts +1 -0
  20. package/dist/react/hooks/useColumnDefs.d.ts +1 -1
  21. package/dist/react/hooks/useRenderHelpers.d.ts +1 -1
  22. package/dist/react/hooks/useServerSideRowModel.d.ts +1 -1
  23. package/dist/react/index.mjs +5 -5
  24. package/dist/react/react.d.ts +1 -1
  25. package/dist/react/runtime/client/clientPivotTransport.d.ts +1 -0
  26. package/dist/react/runtime/client/duckdbWasmExecutor.d.ts +3 -0
  27. package/dist/react/runtime/client/types.d.ts +12 -0
  28. package/dist/react/runtime/runtimeDomains.d.ts +94 -2
  29. package/dist/react/runtime/useRuntimeColumnAutoSizing.d.ts +1 -1
  30. package/dist/react/runtime/useRuntimeViewSnapshot.d.ts +1 -1
  31. package/dist/react/utils/dataBars.d.ts +1 -0
  32. package/dist/react/utils/domEvents.d.ts +1 -0
  33. package/dist/react/utils/helpers.d.ts +5 -0
  34. package/dist/react/utils/pivotLayoutUtils.d.ts +4 -0
  35. package/dist/react/utils/sorting.d.ts +1 -1
  36. package/package.json +1 -1
  37. package/dist/react/chunks/ContextMenu-1G-o1ms9.mjs +0 -195
  38. package/dist/react/chunks/SidebarPanel-LXUE6nPd.mjs +0 -3742
  39. package/dist/react/chunks/react-CDa-ADnG.mjs +0 -31199
@@ -1,6 +1,6 @@
1
- import t, { useState as H, useRef as ke, useMemo as z, useCallback as B, useEffect as $e } from "react";
2
- import { aa as Et, am as St, z as v, an as Ct, ac as wt, Z as M, ao as At } from "./react-CDa-ADnG.mjs";
3
- const ae = () => `r${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`, Xe = [
1
+ import t, { useState as H, useRef as Fe, useMemo as W, useCallback as B, useEffect as Ee } from "react";
2
+ import { ab as St, an as wt, I as m, ao as Ct, T as U, ad as kt, _ as M, ap as At } from "./react-CL4GbEOd.mjs";
3
+ const oe = () => `r${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`, Qe = [
4
4
  { value: "eq", label: "Equals" },
5
5
  { value: "not_eq", label: "Not equals" },
6
6
  { value: "in", label: "In list" },
@@ -11,7 +11,7 @@ const ae = () => `r${Date.now().toString(36)}${Math.random().toString(36).slice(
11
11
  { value: "gte", label: "Greater or equal" },
12
12
  { value: "lt", label: "Less than" },
13
13
  { value: "lte", label: "Less or equal" }
14
- ], de = /* @__PURE__ */ new Set(["in", "not_in"]), kt = {
14
+ ], pe = /* @__PURE__ */ new Set(["in", "not_in"]), $t = {
15
15
  eq: "=",
16
16
  not_eq: "!=",
17
17
  in: "in",
@@ -22,7 +22,7 @@ const ae = () => `r${Date.now().toString(36)}${Math.random().toString(36).slice(
22
22
  gte: ">=",
23
23
  lt: "<",
24
24
  lte: "<="
25
- }, $t = /* @__PURE__ */ new Set([
25
+ }, Ft = /* @__PURE__ */ new Set([
26
26
  "depth",
27
27
  "_id",
28
28
  "_path",
@@ -32,8 +32,8 @@ const ae = () => `r${Date.now().toString(36)}${Math.random().toString(36).slice(
32
32
  "_has_children",
33
33
  "_is_expanded",
34
34
  "__col_schema"
35
- ]), T = "default", Be = "branch:", Qe = ["", "solid", "dashed", "dotted", "double"], Ue = (e = "") => ({ _id: ae(), field: e, operator: "eq", value: "", values: [] }), Pe = () => ({ op: "AND", clauses: [] }), Ft = () => ({ _id: ae(), label: "", condition: Pe(), child: null }), me = (e = {}) => {
36
- const l = e && typeof e == "object" ? e : {}, n = Number(l.indent), a = Number(l.borderWidth), r = typeof l.borderStyle == "string" && Qe.includes(l.borderStyle) ? l.borderStyle : "";
35
+ ]), T = "default", De = "branch:", Ue = ["", "solid", "dashed", "dotted", "double"], et = (e = "") => ({ _id: oe(), field: e, operator: "eq", value: "", values: [] }), Le = () => ({ op: "AND", clauses: [] }), Bt = () => ({ _id: oe(), label: "", condition: Le(), child: null }), Se = (e = {}) => {
36
+ const l = e && typeof e == "object" ? e : {}, n = Number(l.indent), a = Number(l.borderWidth), r = typeof l.borderStyle == "string" && Ue.includes(l.borderStyle) ? l.borderStyle : "";
37
37
  return {
38
38
  indent: Number.isFinite(n) && n >= 0 ? Math.floor(n) : "",
39
39
  bold: l.bold === !0,
@@ -47,7 +47,7 @@ const ae = () => `r${Date.now().toString(36)}${Math.random().toString(36).slice(
47
47
  borderWidth: Number.isFinite(a) && a > 0 ? Math.floor(a) : ""
48
48
  };
49
49
  }, Y = (e = "") => ({
50
- _id: ae(),
50
+ _id: oe(),
51
51
  field: e,
52
52
  label: "",
53
53
  topN: null,
@@ -55,37 +55,37 @@ const ae = () => `r${Date.now().toString(36)}${Math.random().toString(36).slice(
55
55
  sortDir: "desc",
56
56
  sortAbs: !1,
57
57
  filters: null,
58
- format: me(),
58
+ format: Se(),
59
59
  defaultChild: null,
60
60
  branches: []
61
- }), Bt = (e) => !e || typeof e.field != "string" || !e.field ? null : {
62
- _id: typeof e._id == "string" ? e._id : ae(),
61
+ }), Dt = (e) => !e || typeof e.field != "string" || !e.field ? null : {
62
+ _id: typeof e._id == "string" ? e._id : oe(),
63
63
  field: e.field,
64
- operator: Xe.some((l) => l.value === e.operator) ? e.operator : "eq",
64
+ operator: Qe.some((l) => l.value === e.operator) ? e.operator : "eq",
65
65
  value: e.value !== void 0 && e.value !== null ? String(e.value) : "",
66
66
  values: Array.isArray(e.values) ? e.values.map(String).filter(Boolean) : []
67
- }, Le = (e) => ({
67
+ }, ze = (e) => ({
68
68
  op: e && e.op === "OR" ? "OR" : "AND",
69
- clauses: Array.isArray(e && e.clauses) ? e.clauses.map(Bt).filter(Boolean) : []
70
- }), De = (e) => !e || typeof e != "object" ? null : {
71
- _id: typeof e._id == "string" ? e._id : ae(),
69
+ clauses: Array.isArray(e && e.clauses) ? e.clauses.map(Dt).filter(Boolean) : []
70
+ }), Re = (e) => !e || typeof e != "object" ? null : {
71
+ _id: typeof e._id == "string" ? e._id : oe(),
72
72
  label: typeof e.label == "string" ? e.label : "",
73
- condition: Le(e.condition),
73
+ condition: ze(e.condition),
74
74
  sourceRowPath: Array.isArray(e.sourceRowPath) ? e.sourceRowPath.map(String).filter(Boolean) : [],
75
75
  sourcePathFields: Array.isArray(e.sourcePathFields) ? e.sourcePathFields.map(String).filter(Boolean) : [],
76
76
  child: e.child ? V(e.child) : null
77
77
  };
78
78
  function V(e) {
79
79
  if (!e || typeof e != "object") return null;
80
- let l = Array.isArray(e.branches) ? e.branches.map(De).filter(Boolean) : [];
81
- l.length === 0 && e.childrenByValue && typeof e.childrenByValue == "object" && (l = Object.entries(e.childrenByValue).filter(([a]) => a).map(([a, r]) => De({
80
+ let l = Array.isArray(e.branches) ? e.branches.map(Re).filter(Boolean) : [];
81
+ l.length === 0 && e.childrenByValue && typeof e.childrenByValue == "object" && (l = Object.entries(e.childrenByValue).filter(([a]) => a).map(([a, r]) => Re({
82
82
  label: a,
83
83
  condition: { op: "AND", clauses: [{ field: e.field || "", operator: "eq", value: a, values: [] }] },
84
84
  child: r
85
85
  })).filter(Boolean));
86
- const n = e.filters && typeof e.filters == "object" ? Le(e.filters) : null;
86
+ const n = e.filters && typeof e.filters == "object" ? ze(e.filters) : null;
87
87
  return {
88
- _id: typeof e._id == "string" ? e._id : ae(),
88
+ _id: typeof e._id == "string" ? e._id : oe(),
89
89
  field: typeof e.field == "string" ? e.field : "",
90
90
  label: typeof e.label == "string" ? e.label : "",
91
91
  topN: Number.isFinite(Number(e.topN)) && Number(e.topN) > 0 ? Math.floor(Number(e.topN)) : null,
@@ -93,16 +93,16 @@ function V(e) {
93
93
  sortDir: e.sortDir === "asc" ? "asc" : "desc",
94
94
  sortAbs: e.sortAbs === !0,
95
95
  filters: n && n.clauses.length > 0 ? n : null,
96
- format: me(e.format),
96
+ format: Se(e.format),
97
97
  defaultChild: e.defaultChild ? V(e.defaultChild) : null,
98
98
  branches: l
99
99
  };
100
100
  }
101
- const _e = (e) => `${Be}${e}`, Se = (e) => {
102
- if (typeof e != "string" || !e.startsWith(Be)) return -1;
103
- const l = parseInt(e.slice(Be.length), 10);
101
+ const _e = (e) => `${De}${e}`, Ce = (e) => {
102
+ if (typeof e != "string" || !e.startsWith(De)) return -1;
103
+ const l = parseInt(e.slice(De.length), 10);
104
104
  return Number.isFinite(l) ? l : -1;
105
- }, Dt = (e, l) => {
105
+ }, Rt = (e, l) => {
106
106
  const n = new Set(
107
107
  (l || []).filter(
108
108
  /** @param {any} [config] @returns {any} */
@@ -114,9 +114,9 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
114
114
  );
115
115
  return (e || []).filter(
116
116
  /** @param {any} [field] @returns {any} */
117
- (a) => a && typeof a == "string" && !$t.has(a) && (!a.startsWith("_") || wt(a)) && !n.has(a)
117
+ (a) => a && typeof a == "string" && !Ft.has(a) && (!a.startsWith("_") || kt(a)) && !n.has(a)
118
118
  );
119
- }, Rt = (e) => {
119
+ }, Nt = (e) => {
120
120
  const l = [
121
121
  { value: "", label: "(default)" },
122
122
  { value: "__field__", label: "Field value (A→Z / Z→A)" }
@@ -129,24 +129,24 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
129
129
  l.push({ value: a, label: r });
130
130
  }
131
131
  ), l;
132
- }, Ce = (e) => !e || !e.clauses || e.clauses.length === 0 ? "No filter" : e.clauses.map(
132
+ }, ke = (e) => !e || !e.clauses || e.clauses.length === 0 ? "No filter" : e.clauses.map(
133
133
  /** @param {any} [clause] @returns {any} */
134
134
  (l) => {
135
- const n = M(l.field), a = kt[l.operator] || l.operator;
136
- if (de.has(l.operator)) {
135
+ const n = M(l.field), a = $t[l.operator] || l.operator;
136
+ if (pe.has(l.operator)) {
137
137
  const r = l.values.slice(0, 3), i = l.values.length > 3 ? ` +${l.values.length - 3}` : "";
138
138
  return `${n} ${a} [${r.join(", ")}${i}]`;
139
139
  }
140
140
  return `${n} ${a} ${l.value || "..."}`;
141
141
  }
142
- ).join(` ${e.op} `), et = (e, l) => {
142
+ ).join(` ${e.op} `), tt = (e, l) => {
143
143
  if (!e) return "";
144
144
  const n = (l || []).find(
145
145
  /** @param {any} [item] @returns {any} */
146
146
  (a) => a.value === e
147
147
  );
148
148
  return n ? n.label : M(e);
149
- }, tt = (e) => e ? e.label && e.label.trim() ? e.label.trim() : e.field ? M(e.field) : "Select field" : "Select field", Nt = (e) => !e || !e.field ? !1 : de.has(e.operator) ? Array.isArray(e.values) && e.values.length > 0 : e.value !== void 0 && e.value !== null && String(e.value).trim() !== "", Re = (e) => !!(e && Array.isArray(e.clauses) && e.clauses.length > 0) && e.clauses.every(Nt), Ke = (e, l) => {
149
+ }, lt = (e) => e ? e.label && e.label.trim() ? e.label.trim() : e.field ? M(e.field) : "Select field" : "Select field", It = (e) => !e || !e.field ? !1 : pe.has(e.operator) ? Array.isArray(e.values) && e.values.length > 0 : e.value !== void 0 && e.value !== null && String(e.value).trim() !== "", Ne = (e) => !!(e && Array.isArray(e.clauses) && e.clauses.length > 0) && e.clauses.every(It), Ge = (e, l) => {
150
150
  if (!e || !l || typeof l != "object") return !1;
151
151
  const n = l[e.field], a = n == null ? "" : String(n), r = e.value === void 0 || e.value === null ? "" : String(e.value), i = Array.isArray(e.values) ? e.values.map(String) : [], s = Number(a), f = Number(r);
152
152
  switch (e.operator) {
@@ -172,8 +172,8 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
172
172
  default:
173
173
  return a === r;
174
174
  }
175
- }, Ge = (e, l) => {
176
- if (!Re(e) || !Array.isArray(l) || l.length === 0) return !0;
175
+ }, Ye = (e, l) => {
176
+ if (!Ne(e) || !Array.isArray(l) || l.length === 0) return !0;
177
177
  const n = l.filter((r) => r && typeof r == "object" && !r._isTotal && !r._isOther);
178
178
  return n.some(
179
179
  /** @param {any} [row] @returns {any} */
@@ -185,17 +185,17 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
185
185
  /** @param {any} [row] @returns {any} */
186
186
  (r) => e.op === "OR" ? e.clauses.some(
187
187
  /** @param {any} [clause] @returns {any} */
188
- (i) => Ke(i, r)
188
+ (i) => Ge(i, r)
189
189
  ) : e.clauses.every(
190
190
  /** @param {any} [clause] @returns {any} */
191
- (i) => Ke(i, r)
191
+ (i) => Ge(i, r)
192
192
  )
193
193
  ) : !0;
194
- }, It = (e, l) => {
194
+ }, Pt = (e, l) => {
195
195
  if (!Array.isArray(e) || e.length === 0 || !Array.isArray(l) || l.length === 0) return !0;
196
196
  const n = e.map(String).join("|||");
197
197
  return l.some((a) => a && typeof a == "object" && a._path === n);
198
- }, Ye = (e, {
198
+ }, Ze = (e, {
199
199
  allFields: l = [],
200
200
  valConfigs: n = [],
201
201
  data: a = []
@@ -203,48 +203,48 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
203
203
  const r = [], i = [], s = (n || []).some(
204
204
  /** @param {any} [config] @returns {any} */
205
205
  (y) => y && y.field && y.agg
206
- ), f = new Set(Array.isArray(l) ? l : []), m = /* @__PURE__ */ new Map(), g = Array.isArray(a) ? a : [], F = (y, w) => {
206
+ ), f = new Set(Array.isArray(l) ? l : []), E = /* @__PURE__ */ new Map(), b = Array.isArray(a) ? a : [], F = (y, C) => {
207
207
  const c = y.trim().toLowerCase();
208
208
  if (c) {
209
- if (m.has(c)) {
210
- r.push(`Duplicate header "${y}" at ${w}; already used at ${m.get(c)}.`);
209
+ if (E.has(c)) {
210
+ r.push(`Duplicate header "${y}" at ${C}; already used at ${E.get(c)}.`);
211
211
  return;
212
212
  }
213
- m.set(c, w);
213
+ E.set(c, C);
214
214
  }
215
- }, N = (y, w, c = /* @__PURE__ */ new Set()) => {
215
+ }, N = (y, C, c = /* @__PURE__ */ new Set()) => {
216
216
  if (!y) return;
217
- const E = y._id || `${w}:${y.field || ""}`;
218
- if (c.has(E)) {
219
- r.push(`Circular row override detected at ${w}.`);
217
+ const h = y._id || `${C}:${y.field || ""}`;
218
+ if (c.has(h)) {
219
+ r.push(`Circular row override detected at ${C}.`);
220
220
  return;
221
221
  }
222
- const h = new Set(c);
223
- h.add(E), y.field ? f.size > 0 && !f.has(y.field) && r.push(`Field "${M(y.field)}" at ${w} is no longer available.`) : r.push(`Missing field at ${w}.`), F(tt(y), w), y.topN && !s && r.push(`Top-N at ${w} needs at least one measure selected.`), y.filters && !Re(y.filters) ? r.push(`Level filter at ${w} has incomplete rules.`) : y.filters && !Ge(y.filters, g) && r.push(`Level filter at ${w} does not match any loaded rows.`), y.defaultChild && N(y.defaultChild, `${w} > Default children`, h), (y.branches || []).forEach(
222
+ const v = new Set(c);
223
+ v.add(h), y.field ? f.size > 0 && !f.has(y.field) && r.push(`Field "${M(y.field)}" at ${C} is no longer available.`) : r.push(`Missing field at ${C}.`), F(lt(y), C), y.topN && !s && r.push(`Top-N at ${C} needs at least one measure selected.`), y.filters && !Ne(y.filters) ? r.push(`Level filter at ${C} has incomplete rules.`) : y.filters && !Ye(y.filters, b) && r.push(`Level filter at ${C} does not match any loaded rows.`), y.defaultChild && N(y.defaultChild, `${C} > Default children`, v), (y.branches || []).forEach(
224
224
  /** @param {any} [branch] @param {any} [index] @returns {any} */
225
225
  (u, D) => {
226
- const R = u.label && u.label.trim() ? u.label.trim() : `Row override ${D + 1}`, x = `${w} > ${R}`;
227
- Re(u.condition) ? Ge(u.condition, g) || r.push(`Row override "${R}" does not match any loaded rows.`) : r.push(`Row override "${R}" needs a complete row rule.`), Array.isArray(u.sourcePathFields) && u.sourcePathFields.length > 0 && u.sourcePathFields[u.sourcePathFields.length - 1] !== y.field && r.push(`Row override "${R}" was created for another level and no longer points to this row path.`), It(u.sourceRowPath, g) || i.push(`Row override "${R}" points to a row path that is not in the current loaded rows.`), u.child && N(u.child, `${x} > Custom children`, h), u.child || i.push(`Row override "${R}" has no Custom children; it only renames the matching row.`);
226
+ const R = u.label && u.label.trim() ? u.label.trim() : `Row override ${D + 1}`, x = `${C} > ${R}`;
227
+ Ne(u.condition) ? Ye(u.condition, b) || r.push(`Row override "${R}" does not match any loaded rows.`) : r.push(`Row override "${R}" needs a complete row rule.`), Array.isArray(u.sourcePathFields) && u.sourcePathFields.length > 0 && u.sourcePathFields[u.sourcePathFields.length - 1] !== y.field && r.push(`Row override "${R}" was created for another level and no longer points to this row path.`), Pt(u.sourceRowPath, b) || i.push(`Row override "${R}" points to a row path that is not in the current loaded rows.`), u.child && N(u.child, `${x} > Custom children`, v), u.child || i.push(`Row override "${R}" has no Custom children; it only renames the matching row.`);
228
228
  }
229
229
  );
230
230
  };
231
231
  return e ? N(e, "Level 1") : r.push("Report needs at least Level 1."), { errors: r, warnings: i, valid: r.length === 0 };
232
- }, Pt = (e) => !e || !e.branchBadge ? `Level ${e ? e.levelNumber : 1}` : e.branchDepth === 0 ? `Override children ${e.branchBadge}` : `Override child level ${e.branchBadge}.${e.branchDepth + 1}`, ne = (e, l) => {
232
+ }, Lt = (e) => !e || !e.branchBadge ? `Level ${e ? e.levelNumber : 1}` : e.branchDepth === 0 ? `Override children ${e.branchBadge}` : `Override child level ${e.branchBadge}.${e.branchDepth + 1}`, ae = (e, l) => {
233
233
  let n = e;
234
234
  for (let a = 0; n && a < l.length; a += 1) {
235
235
  const r = l[a];
236
236
  if (r === T)
237
237
  n = n.defaultChild || null;
238
238
  else {
239
- const i = Se(r);
239
+ const i = Ce(r);
240
240
  n = i >= 0 && n.branches[i] ? n.branches[i].child : null;
241
241
  }
242
242
  }
243
243
  return n || null;
244
- }, Fe = (e, l, n) => {
245
- const a = ne(e, l);
244
+ }, Be = (e, l, n) => {
245
+ const a = ae(e, l);
246
246
  return a && a.branches[n] ? a.branches[n] : null;
247
- }, O = (e, l, n) => {
247
+ }, _ = (e, l, n) => {
248
248
  if (!e) return e;
249
249
  const a = (r, i) => {
250
250
  if (!r) return r;
@@ -255,17 +255,17 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
255
255
  ...r,
256
256
  defaultChild: a(r.defaultChild, i + 1)
257
257
  });
258
- const f = Se(s);
258
+ const f = Ce(s);
259
259
  return f < 0 || f >= r.branches.length ? r : V({
260
260
  ...r,
261
261
  branches: r.branches.map(
262
262
  /** @param {any} [branch] @param {any} [index] @returns {any} */
263
- (m, g) => g === f ? { ...m, child: a(m.child, i + 1) } : m
263
+ (E, b) => b === f ? { ...E, child: a(E.child, i + 1) } : E
264
264
  )
265
265
  });
266
266
  };
267
267
  return a(e, 0);
268
- }, ve = (e, l, n, a) => e && O(
268
+ }, me = (e, l, n, a) => e && _(
269
269
  e,
270
270
  l,
271
271
  /** @param {any} [node] @returns {any} */
@@ -273,10 +273,10 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
273
273
  ...r,
274
274
  branches: r.branches.map(
275
275
  /** @param {any} [branch] @param {any} [index] @returns {any} */
276
- (i, s) => s === n ? De(a(i)) : i
276
+ (i, s) => s === n ? Re(a(i)) : i
277
277
  )
278
278
  }
279
- ), Lt = (e) => {
279
+ ), zt = (e) => {
280
280
  if (!e) return [];
281
281
  const l = [], n = (a, r) => {
282
282
  a && (l.push({
@@ -321,13 +321,13 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
321
321
  branchBadge: null,
322
322
  branchDepth: 0
323
323
  }), l;
324
- }, le = (e = []) => e.join(">"), we = (e = [], l = []) => le(e) === le(l), Q = (e) => e == null ? "" : String(e), Z = (e) => e ? e.type === "node" ? `node:${le(e.path)}` : e.type === "branch" ? `branch:${le(e.nodePath)}:${e.branchIndex}` : e.type === "rowPath" ? `rowPath:${le(e.nodePath)}:${e.field}:${Q(e.value)}` : "" : "", Ee = (e, l) => (e || []).find(
324
+ }, re = (e = []) => e.join(">"), Ae = (e = [], l = []) => re(e) === re(l), Q = (e) => e == null ? "" : String(e), Z = (e) => e ? e.type === "node" ? `node:${re(e.path)}` : e.type === "branch" ? `branch:${re(e.nodePath)}:${e.branchIndex}` : e.type === "rowPath" ? `rowPath:${re(e.nodePath)}:${e.field}:${Q(e.value)}` : "" : "", we = (e, l) => (e || []).find(
325
325
  /** @param {any} [item] @returns {any} */
326
- (n) => n.kind === "node" && we(n.nodePath, l)
327
- ) || null, lt = (e, l, n) => (e || []).find(
326
+ (n) => n.kind === "node" && Ae(n.nodePath, l)
327
+ ) || null, rt = (e, l, n) => (e || []).find(
328
328
  /** @param {any} [item] @returns {any} */
329
- (a) => a.kind === "branch" && we(a.nodePath, l) && a.branchIndex === n
330
- ) || null, Ze = (e, l, n) => {
329
+ (a) => a.kind === "branch" && Ae(a.nodePath, l) && a.branchIndex === n
330
+ ) || null, Xe = (e, l, n) => {
331
331
  if (!e || !l) return !1;
332
332
  const a = Q(n);
333
333
  return (e.condition && Array.isArray(e.condition.clauses) ? e.condition.clauses : []).some(
@@ -335,12 +335,12 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
335
335
  (i) => !i || i.field !== l ? !1 : i.operator === "eq" || i.operator === "=" ? Q(i.value) === a : i.operator === "in" ? Array.isArray(i.values) && i.values.map(Q).includes(a) : !1
336
336
  );
337
337
  }, _t = (e, l, n, a = "") => ({
338
- ...Ft(),
338
+ ...Bt(),
339
339
  label: Q(n || l),
340
340
  condition: {
341
341
  op: "AND",
342
342
  clauses: [{
343
- ...Ue(e),
343
+ ...et(e),
344
344
  operator: "eq",
345
345
  value: Q(l),
346
346
  values: []
@@ -354,7 +354,7 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
354
354
  } catch {
355
355
  return V(e);
356
356
  }
357
- }, Ne = (e) => Array.from({ length: Math.max(0, e) }, () => T), We = (e, l = 1, n = []) => {
357
+ }, Ie = (e) => Array.from({ length: Math.max(0, e) }, () => T), We = (e, l = 1, n = []) => {
358
358
  const a = [];
359
359
  let r = e, i = 0, s = Array.isArray(n) ? [...n] : [];
360
360
  for (; r; )
@@ -374,7 +374,7 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
374
374
  defaultChild: l
375
375
  });
376
376
  return l;
377
- }, rt = (e, l, n) => {
377
+ }, nt = (e, l, n) => {
378
378
  const a = We(e).map(
379
379
  /** @param {any} [item] @returns {any} */
380
380
  (s) => s.node
@@ -383,45 +383,45 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
383
383
  return e;
384
384
  const r = [...a], [i] = r.splice(l, 1);
385
385
  return r.splice(n, 0, i), Wt(r);
386
- }, zt = (e) => {
386
+ }, Tt = (e) => {
387
387
  const l = Oe(e);
388
388
  return !l || !l.field ? null : l;
389
- }, Tt = (e, l) => l ? l.type === "node" ? Ee(e, l.path) : l.type === "branch" ? lt(e, l.nodePath, l.branchIndex) : null : null, jt = (e, l) => {
389
+ }, jt = (e, l) => l ? l.type === "node" ? we(e, l.path) : l.type === "branch" ? rt(e, l.nodePath, l.branchIndex) : null : null, Mt = (e, l) => {
390
390
  if (!l) return [];
391
391
  const n = [], a = (s) => {
392
- const f = Ee(e, s);
392
+ const f = we(e, s);
393
393
  f && n.push(f);
394
394
  }, r = (s, f) => {
395
- const m = lt(e, s, f);
396
- m && n.push(m);
395
+ const E = rt(e, s, f);
396
+ E && n.push(E);
397
397
  }, i = (s) => {
398
398
  if (a([]), !Array.isArray(s) || s.length === 0) return;
399
399
  let f = [];
400
- s.forEach((m) => {
401
- if (m === T) {
402
- f = [...f, m], a(f);
400
+ s.forEach((E) => {
401
+ if (E === T) {
402
+ f = [...f, E], a(f);
403
403
  return;
404
404
  }
405
- const g = Se(m);
406
- g >= 0 && (r(f, g), f = [...f, m], a(f));
405
+ const b = Ce(E);
406
+ b >= 0 && (r(f, b), f = [...f, E], a(f));
407
407
  });
408
408
  };
409
409
  return l.type === "node" ? (i(l.path), n) : (i(l.nodePath), r(l.nodePath, l.branchIndex), n);
410
- }, Mt = (e, l) => {
410
+ }, Ht = (e, l) => {
411
411
  if (!l) return [];
412
412
  if (l.type === "node") {
413
- const a = [], r = Ee(e, [...l.path, T]);
413
+ const a = [], r = we(e, [...l.path, T]);
414
414
  r && a.push(r);
415
415
  const i = (e || []).filter(
416
416
  /** @param {any} [item] @returns {any} */
417
- (s) => s.kind === "branch" && we(s.nodePath, l.path)
417
+ (s) => s.kind === "branch" && Ae(s.nodePath, l.path)
418
418
  ).sort(
419
419
  /** @param {any} [left] @param {any} [right] @returns {any} */
420
420
  (s, f) => s.branchIndex - f.branchIndex
421
421
  );
422
422
  return [...a, ...i];
423
423
  }
424
- const n = Ee(e, [...l.nodePath, _e(l.branchIndex)]);
424
+ const n = we(e, [...l.nodePath, _e(l.branchIndex)]);
425
425
  return n ? [n] : [];
426
426
  }, q = (e, l = {}) => ({
427
427
  border: `1px solid ${e.border}`,
@@ -457,7 +457,7 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
457
457
  alignItems: "center",
458
458
  gap: "6px",
459
459
  marginBottom: "10px"
460
- }), pe = (e) => ({
460
+ }), ue = (e) => ({
461
461
  border: `1px solid ${e.border}`,
462
462
  borderRadius: "14px",
463
463
  background: e.surfaceBg || e.background || "#fff",
@@ -465,13 +465,13 @@ const _e = (e) => `${Be}${e}`, Se = (e) => {
465
465
  display: "flex",
466
466
  flexDirection: "column",
467
467
  gap: "12px"
468
- }), Ht = (e) => ({
468
+ }), Vt = (e) => ({
469
469
  borderTop: `2px solid ${e.textSec || "#334155"}`,
470
470
  paddingTop: "14px",
471
471
  display: "flex",
472
472
  flexDirection: "column",
473
473
  gap: "12px"
474
- }), nt = (e, l, n) => ({
474
+ }), at = (e, l, n) => ({
475
475
  width: `calc(100% - ${n * 14}px)`,
476
476
  marginLeft: `${n * 14}px`,
477
477
  border: `1px solid ${l ? e.primary || "#2563EB" : e.border}`,
@@ -505,7 +505,7 @@ function X({ children: e, theme: l, tone: n = "neutral" }) {
505
505
  e
506
506
  );
507
507
  }
508
- function re({
508
+ function ne({
509
509
  theme: e,
510
510
  title: l,
511
511
  description: n,
@@ -514,45 +514,54 @@ function re({
514
514
  sectionId: i,
515
515
  children: s
516
516
  }) {
517
- return /* @__PURE__ */ t.createElement("section", { "data-report-section": i || l, style: Ht(e) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "12px" } }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", gap: "8px", minWidth: 0 } }, /* @__PURE__ */ t.createElement("div", { style: { color: e.textSec, display: "flex", alignItems: "center", paddingTop: "1px", flexShrink: 0 } }, a), /* @__PURE__ */ t.createElement("div", { style: { minWidth: 0 } }, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "13px", fontWeight: 900, color: e.text } }, l), n && /* @__PURE__ */ t.createElement("div", { style: { fontSize: "11px", color: e.textSec, lineHeight: 1.45, marginTop: "2px" } }, n))), r && /* @__PURE__ */ t.createElement("div", { style: { flexShrink: 0 } }, r)), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, s));
517
+ return /* @__PURE__ */ t.createElement("section", { "data-report-section": i || l, style: Vt(e) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "12px" } }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", gap: "8px", minWidth: 0 } }, /* @__PURE__ */ t.createElement("div", { style: { color: e.textSec, display: "flex", alignItems: "center", paddingTop: "1px", flexShrink: 0 } }, a), /* @__PURE__ */ t.createElement("div", { style: { minWidth: 0 } }, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "13px", fontWeight: 900, color: e.text } }, l), n && /* @__PURE__ */ t.createElement("div", { style: { fontSize: "11px", color: e.textSec, lineHeight: 1.45, marginTop: "2px" } }, n))), r && /* @__PURE__ */ t.createElement("div", { style: { flexShrink: 0 } }, r)), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, s));
518
518
  }
519
- function Ie({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClose: r, theme: i, title: s, description: f }) {
520
- const [m, g] = H(() => Le(e)), F = q(i), N = B(() => {
521
- g(
519
+ function Pe({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClose: r, theme: i, title: s, description: f }) {
520
+ const [E, b] = H(() => ze(e)), F = q(i), N = B(() => {
521
+ b(
522
522
  /** @param {any} [prev] @returns {any} */
523
- (c) => ({ ...c, clauses: [...c.clauses, Ue(l[0] || "")] })
523
+ (c) => ({ ...c, clauses: [...c.clauses, et(l[0] || "")] })
524
524
  );
525
- }, [l]), y = B((c, E) => {
526
- g(
525
+ }, [l]), y = B((c, h) => {
526
+ b(
527
527
  /** @param {any} [prev] @returns {any} */
528
- (h) => ({
529
- ...h,
530
- clauses: h.clauses.map(
528
+ (v) => ({
529
+ ...v,
530
+ clauses: v.clauses.map(
531
531
  /** @param {any} [clause] @param {any} [clauseIndex] @returns {any} */
532
- (u, D) => D === c ? { ...u, ...E } : u
532
+ (u, D) => D === c ? { ...u, ...h } : u
533
533
  )
534
534
  })
535
535
  );
536
- }, []), w = B((c) => {
537
- g(
536
+ }, []), C = B((c) => {
537
+ b(
538
538
  /** @param {any} [prev] @returns {any} */
539
- (E) => ({
540
- ...E,
541
- clauses: E.clauses.filter(
539
+ (h) => ({
540
+ ...h,
541
+ clauses: h.clauses.filter(
542
542
  /** @param {any} [_] @param {any} [clauseIndex] @returns {any} */
543
- (h, u) => u !== c
543
+ (v, u) => u !== c
544
544
  )
545
545
  })
546
546
  );
547
547
  }, []);
548
- return /* @__PURE__ */ t.createElement(
548
+ return Ee(() => {
549
+ if (typeof r != "function") return;
550
+ const c = (h) => {
551
+ h.key === "Escape" && !h.defaultPrevented && (h.preventDefault(), r());
552
+ };
553
+ return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
554
+ }, [r]), /* @__PURE__ */ t.createElement(
549
555
  "div",
550
556
  {
557
+ className: "sp-dialog-backdrop",
551
558
  style: {
552
559
  position: "fixed",
553
560
  inset: 0,
554
561
  zIndex: 9999,
555
- background: "rgba(15, 23, 42, 0.45)",
562
+ background: "rgba(15, 23, 42, 0.38)",
563
+ backdropFilter: "blur(6px)",
564
+ WebkitBackdropFilter: "blur(6px)",
556
565
  display: "flex",
557
566
  alignItems: "center",
558
567
  justifyContent: "center"
@@ -562,25 +571,28 @@ function Ie({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClo
562
571
  /* @__PURE__ */ t.createElement(
563
572
  "div",
564
573
  {
574
+ className: "sp-dialog-surface",
575
+ role: "dialog",
576
+ "aria-modal": "true",
565
577
  style: {
566
- ...pe(i),
578
+ ...ue(i),
567
579
  width: "520px",
568
580
  maxWidth: "95vw",
569
581
  maxHeight: "85vh",
570
582
  overflowY: "auto",
571
- boxShadow: "0 24px 64px rgba(15, 23, 42, 0.22)"
583
+ boxShadow: i.shadow || "0 24px 64px rgba(15, 23, 42, 0.26)"
572
584
  },
573
585
  onClick: (c) => c.stopPropagation()
574
586
  },
575
- /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: "10px" } }, /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "14px", fontWeight: 800, color: i.text } }, s || "Edit row override rule"), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "12px", color: i.textSec, marginTop: "2px" } }, f || "Add one or more clauses to decide when this row override should be used.")), /* @__PURE__ */ t.createElement("button", { type: "button", onClick: r, style: { background: "none", border: "none", cursor: "pointer", color: i.textSec } }, /* @__PURE__ */ t.createElement(v.Close, null))),
576
- m.clauses.length > 1 && /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "6px", alignItems: "center", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement("span", { style: { fontSize: "11px", color: i.textSec, fontWeight: 700 } }, "Match:"), ["AND", "OR"].map((c) => /* @__PURE__ */ t.createElement(
587
+ /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: "10px" } }, /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "14px", fontWeight: 800, letterSpacing: "-0.01em", color: i.text } }, s || "Edit row override rule"), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "12px", color: i.textSec, marginTop: "2px" } }, f || "Add one or more clauses to decide when this row override should be used.")), /* @__PURE__ */ t.createElement("button", { type: "button", className: "sp-btn sp-btn-ghost", onClick: r, style: { background: "transparent", border: "none", borderRadius: "6px", cursor: "pointer", color: i.textSec, padding: "4px", display: "inline-flex", alignItems: "center" } }, /* @__PURE__ */ t.createElement(m.Close, null))),
588
+ E.clauses.length > 1 && /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "6px", alignItems: "center", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement("span", { style: { fontSize: "11px", color: i.textSec, fontWeight: 700 } }, "Match:"), ["AND", "OR"].map((c) => /* @__PURE__ */ t.createElement(
577
589
  "button",
578
590
  {
579
591
  key: c,
580
592
  type: "button",
581
- onClick: () => g(
593
+ onClick: () => b(
582
594
  /** @param {any} [prev] @returns {any} */
583
- (E) => ({ ...E, op: c })
595
+ (h) => ({ ...h, op: c })
584
596
  ),
585
597
  style: {
586
598
  padding: "5px 12px",
@@ -589,15 +601,15 @@ function Ie({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClo
589
601
  fontWeight: 800,
590
602
  border: "none",
591
603
  cursor: "pointer",
592
- background: m.op === c ? i.primary || "#2563EB" : i.hover || "#F3F4F6",
593
- color: m.op === c ? "#fff" : i.textSec
604
+ background: E.op === c ? i.primary || "#2563EB" : i.hover || "#F3F4F6",
605
+ color: E.op === c ? "#fff" : i.textSec
594
606
  }
595
607
  },
596
608
  c
597
609
  ))),
598
- /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, m.clauses.length === 0 && /* @__PURE__ */ t.createElement("div", { style: { fontSize: "12px", color: i.textSec, fontStyle: "italic" } }, "No clauses means this row override matches every row at this level."), m.clauses.map(
610
+ /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, E.clauses.length === 0 && /* @__PURE__ */ t.createElement("div", { style: { fontSize: "12px", color: i.textSec, fontStyle: "italic" } }, "No clauses means this row override matches every row at this level."), E.clauses.map(
599
611
  /** @param {any} [clause] @param {any} [index] @returns {any} */
600
- (c, E) => /* @__PURE__ */ t.createElement(
612
+ (c, h) => /* @__PURE__ */ t.createElement(
601
613
  "div",
602
614
  {
603
615
  key: c._id,
@@ -611,25 +623,29 @@ function Ie({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClo
611
623
  alignItems: "flex-start"
612
624
  }
613
625
  },
614
- /* @__PURE__ */ t.createElement("div", { style: { width: "32px", paddingTop: "6px", textAlign: "center", fontSize: "10px", fontWeight: 800, color: i.textSec } }, E > 0 ? m.op : ""),
626
+ /* @__PURE__ */ t.createElement("div", { style: { width: "32px", paddingTop: "6px", textAlign: "center", fontSize: "10px", fontWeight: 800, color: i.textSec } }, h > 0 ? E.op : ""),
615
627
  /* @__PURE__ */ t.createElement("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "8px" } }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "8px", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement(
616
- "select",
628
+ U,
617
629
  {
630
+ size: "sm",
631
+ "aria-label": "Filter field",
618
632
  value: c.field,
619
- onChange: (h) => y(E, { field: h.target.value }),
633
+ onChange: (v) => y(h, { field: v.target.value }),
620
634
  style: { ...F, flex: 1, minWidth: "140px" }
621
635
  },
622
636
  l.map(
623
637
  /** @param {any} [field] @returns {any} */
624
- (h) => /* @__PURE__ */ t.createElement("option", { key: h, value: h }, n(h))
638
+ (v) => /* @__PURE__ */ t.createElement("option", { key: v, value: v }, n(v))
625
639
  )
626
640
  ), /* @__PURE__ */ t.createElement(
627
- "select",
641
+ U,
628
642
  {
643
+ size: "sm",
644
+ "aria-label": "Filter operator",
629
645
  value: c.operator,
630
- onChange: (h) => {
631
- const u = h.target.value, D = de.has(u), R = de.has(c.operator);
632
- y(E, {
646
+ onChange: (v) => {
647
+ const u = v.target.value, D = pe.has(u), R = pe.has(c.operator);
648
+ y(h, {
633
649
  operator: u,
634
650
  values: D ? R ? c.values : c.value ? [c.value] : [] : c.values,
635
651
  value: D ? c.value : c.values[0] || c.value || ""
@@ -637,14 +653,14 @@ function Ie({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClo
637
653
  },
638
654
  style: { ...F, width: "160px", flexShrink: 0 }
639
655
  },
640
- Xe.map((h) => /* @__PURE__ */ t.createElement("option", { key: h.value, value: h.value }, h.label))
641
- )), de.has(c.operator) ? /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, c.values.length > 0 && /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "6px" } }, c.values.map(
656
+ Qe.map((v) => /* @__PURE__ */ t.createElement("option", { key: v.value, value: v.value }, v.label))
657
+ )), pe.has(c.operator) ? /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, c.values.length > 0 && /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "6px" } }, c.values.map(
642
658
  /** @param {any} [value] @param {any} [valueIndex] @returns {any} */
643
- (h, u) => /* @__PURE__ */ t.createElement(X, { key: `${c._id}-${u}`, theme: i, tone: "primary" }, /* @__PURE__ */ t.createElement("span", null, h), /* @__PURE__ */ t.createElement(
659
+ (v, u) => /* @__PURE__ */ t.createElement(X, { key: `${c._id}-${u}`, theme: i, tone: "primary" }, /* @__PURE__ */ t.createElement("span", null, v), /* @__PURE__ */ t.createElement(
644
660
  "button",
645
661
  {
646
662
  type: "button",
647
- onClick: () => y(E, {
663
+ onClick: () => y(h, {
648
664
  values: c.values.filter(
649
665
  /** @param {any} [_] @param {any} [currentIndex] @returns {any} */
650
666
  (D, R) => R !== u
@@ -661,9 +677,9 @@ function Ie({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClo
661
677
  style: F,
662
678
  onKeyDown: (
663
679
  /** @param {any} event */
664
- ((h) => {
665
- const u = h.target.value.trim();
666
- h.key === "Enter" && u && (c.values.includes(u) || y(E, { values: [...c.values, u] }), h.target.value = "", h.preventDefault());
680
+ ((v) => {
681
+ const u = v.target.value.trim();
682
+ v.key === "Enter" && u && (c.values.includes(u) || y(h, { values: [...c.values, u] }), v.target.value = "", v.preventDefault());
667
683
  })
668
684
  )
669
685
  }
@@ -671,7 +687,7 @@ function Ie({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClo
671
687
  "input",
672
688
  {
673
689
  value: c.value,
674
- onChange: (h) => y(E, { value: h.target.value }),
690
+ onChange: (v) => y(h, { value: v.target.value }),
675
691
  placeholder: "Value",
676
692
  style: F
677
693
  }
@@ -680,10 +696,10 @@ function Ie({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClo
680
696
  "button",
681
697
  {
682
698
  type: "button",
683
- onClick: () => w(E),
699
+ onClick: () => C(h),
684
700
  style: { background: "none", border: "none", cursor: "pointer", color: "#B91C1C", padding: "6px" }
685
701
  },
686
- /* @__PURE__ */ t.createElement(v.Delete, null)
702
+ /* @__PURE__ */ t.createElement(m.Delete, null)
687
703
  )
688
704
  )
689
705
  )),
@@ -698,7 +714,7 @@ function Ie({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClo
698
714
  borderStyle: "dashed"
699
715
  }
700
716
  },
701
- /* @__PURE__ */ t.createElement(v.Add, null),
717
+ /* @__PURE__ */ t.createElement(m.Add, null),
702
718
  " Add clause"
703
719
  ),
704
720
  /* @__PURE__ */ t.createElement("div", { style: { display: "flex", justifyContent: "flex-end", gap: "8px", borderTop: `1px solid ${i.border}`, paddingTop: "12px" } }, /* @__PURE__ */ t.createElement("button", { type: "button", onClick: r, style: j(i) }, "Cancel"), /* @__PURE__ */ t.createElement(
@@ -706,7 +722,7 @@ function Ie({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClo
706
722
  {
707
723
  type: "button",
708
724
  onClick: () => {
709
- a(m), r();
725
+ a(E), r();
710
726
  },
711
727
  style: {
712
728
  background: i.primary || "#2563EB",
@@ -724,11 +740,11 @@ function Ie({ condition: e, allFields: l, getFieldLabel: n = M, onSave: a, onClo
724
740
  )
725
741
  );
726
742
  }
727
- function at({ value: e, onChange: l, theme: n }) {
728
- const a = me(e), r = q(n), i = (s) => l(me({ ...a, ...s }));
729
- return /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ t.createElement("div", { style: L(n) }, "Presentation"), /* @__PURE__ */ t.createElement("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "8px" } }, /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Indent px", /* @__PURE__ */ t.createElement("input", { type: "number", min: "0", value: a.indent, onChange: (s) => i({ indent: s.target.value }), placeholder: "Auto", style: r })), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Row color", /* @__PURE__ */ t.createElement("input", { value: a.rowColor, onChange: (s) => i({ rowColor: s.target.value }), placeholder: "#F8FAFC", style: r })), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Label prefix", /* @__PURE__ */ t.createElement("input", { value: a.labelPrefix, onChange: (s) => i({ labelPrefix: s.target.value }), placeholder: "Optional", style: r })), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Label suffix", /* @__PURE__ */ t.createElement("input", { value: a.labelSuffix, onChange: (s) => i({ labelSuffix: s.target.value }), placeholder: "Optional", style: r })), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec, gridColumn: "1 / -1" } }, "Number format override", /* @__PURE__ */ t.createElement("input", { value: a.numberFormat, onChange: (s) => i({ numberFormat: s.target.value }), placeholder: "fixed:2, percent, currency:$", style: r }))), /* @__PURE__ */ t.createElement("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: "8px" } }, /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Border", /* @__PURE__ */ t.createElement("select", { value: a.borderStyle, onChange: (s) => i({ borderStyle: s.target.value }), style: r }, Qe.map((s) => /* @__PURE__ */ t.createElement("option", { key: s || "none", value: s }, s || "None")))), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Border color", /* @__PURE__ */ t.createElement("input", { value: a.borderColor, onChange: (s) => i({ borderColor: s.target.value }), placeholder: "#CBD5E1", style: r })), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Width", /* @__PURE__ */ t.createElement("input", { type: "number", min: "1", value: a.borderWidth, onChange: (s) => i({ borderWidth: s.target.value }), placeholder: "1", style: r }))), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "14px", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement("label", { style: { display: "inline-flex", alignItems: "center", gap: "7px", fontSize: "12px", color: n.text, fontWeight: 700 } }, /* @__PURE__ */ t.createElement("input", { type: "checkbox", checked: a.bold, onChange: (s) => i({ bold: s.target.checked }) }), "Bold row"), /* @__PURE__ */ t.createElement("label", { style: { display: "inline-flex", alignItems: "center", gap: "7px", fontSize: "12px", color: n.text, fontWeight: 700 } }, /* @__PURE__ */ t.createElement("input", { type: "checkbox", checked: a.showSubtotal, onChange: (s) => i({ showSubtotal: s.target.checked }) }), "Show subtotal/other rows")));
743
+ function ot({ value: e, onChange: l, theme: n }) {
744
+ const a = Se(e), r = q(n), i = (s) => l(Se({ ...a, ...s }));
745
+ return /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ t.createElement("div", { style: L(n) }, "Presentation"), /* @__PURE__ */ t.createElement("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "8px" } }, /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Indent px", /* @__PURE__ */ t.createElement("input", { type: "number", min: "0", value: a.indent, onChange: (s) => i({ indent: s.target.value }), placeholder: "Auto", style: r })), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Row color", /* @__PURE__ */ t.createElement("input", { value: a.rowColor, onChange: (s) => i({ rowColor: s.target.value }), placeholder: "#F8FAFC", style: r })), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Label prefix", /* @__PURE__ */ t.createElement("input", { value: a.labelPrefix, onChange: (s) => i({ labelPrefix: s.target.value }), placeholder: "Optional", style: r })), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Label suffix", /* @__PURE__ */ t.createElement("input", { value: a.labelSuffix, onChange: (s) => i({ labelSuffix: s.target.value }), placeholder: "Optional", style: r })), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec, gridColumn: "1 / -1" } }, "Number format override", /* @__PURE__ */ t.createElement("input", { value: a.numberFormat, onChange: (s) => i({ numberFormat: s.target.value }), placeholder: "fixed:2, percent, currency:$", style: r }))), /* @__PURE__ */ t.createElement("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: "8px" } }, /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Border", /* @__PURE__ */ t.createElement(U, { size: "sm", "aria-label": "Border", value: a.borderStyle, onChange: (s) => i({ borderStyle: s.target.value }), style: { ...r, width: "100%" } }, Ue.map((s) => /* @__PURE__ */ t.createElement("option", { key: s || "none", value: s }, s || "None")))), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Border color", /* @__PURE__ */ t.createElement("input", { value: a.borderColor, onChange: (s) => i({ borderColor: s.target.value }), placeholder: "#CBD5E1", style: r })), /* @__PURE__ */ t.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", fontSize: "11px", color: n.textSec } }, "Width", /* @__PURE__ */ t.createElement("input", { type: "number", min: "1", value: a.borderWidth, onChange: (s) => i({ borderWidth: s.target.value }), placeholder: "1", style: r }))), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "14px", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement("label", { style: { display: "inline-flex", alignItems: "center", gap: "7px", fontSize: "12px", color: n.text, fontWeight: 700 } }, /* @__PURE__ */ t.createElement("input", { type: "checkbox", checked: a.bold, onChange: (s) => i({ bold: s.target.checked }) }), "Bold row"), /* @__PURE__ */ t.createElement("label", { style: { display: "inline-flex", alignItems: "center", gap: "7px", fontSize: "12px", color: n.text, fontWeight: 700 } }, /* @__PURE__ */ t.createElement("input", { type: "checkbox", checked: a.showSubtotal, onChange: (s) => i({ showSubtotal: s.target.checked }) }), "Show subtotal/other rows")));
730
746
  }
731
- function Vt({ validation: e, theme: l }) {
747
+ function qt({ validation: e, theme: l }) {
732
748
  const n = e && Array.isArray(e.errors) ? e.errors : [], a = e && Array.isArray(e.warnings) ? e.warnings : [];
733
749
  return n.length === 0 && a.length === 0 ? null : /* @__PURE__ */ t.createElement("div", { "data-report-validation": "true", style: { border: `1px solid ${n.length > 0 ? "#FCA5A5" : "#FDE68A"}`, borderRadius: "12px", padding: "10px 12px", background: n.length > 0 ? "#FEF2F2" : "#FFFBEB", color: n.length > 0 ? "#991B1B" : "#92400E", fontSize: "11px", lineHeight: 1.45, display: "flex", flexDirection: "column", gap: "6px" } }, n.length > 0 && /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: { fontWeight: 900, marginBottom: "4px" } }, "Fix before applying or saving"), n.map(
734
750
  /** @param {any} [message] @returns {any} */
@@ -738,7 +754,7 @@ function Vt({ validation: e, theme: l }) {
738
754
  (r) => /* @__PURE__ */ t.createElement("div", { key: `warn:${r}` }, r)
739
755
  )));
740
756
  }
741
- function qt({ debug: e, theme: l }) {
757
+ function Kt({ debug: e, theme: l }) {
742
758
  if (!e || typeof e != "object") return null;
743
759
  const n = [
744
760
  ["Matched level", e.matchedLevel || e.levelLabel || ""],
@@ -752,7 +768,7 @@ function qt({ debug: e, theme: l }) {
752
768
  ([a, r]) => /* @__PURE__ */ t.createElement("div", { key: a, style: { display: "flex", justifyContent: "space-between", gap: "10px", fontSize: "11px" } }, /* @__PURE__ */ t.createElement("span", { style: { color: l.textSec, fontWeight: 800 } }, a), /* @__PURE__ */ t.createElement("span", { style: { color: l.text, textAlign: "right", overflowWrap: "anywhere" } }, r))
753
769
  ));
754
770
  }
755
- function ot({
771
+ function it({
756
772
  title: e,
757
773
  summary: l,
758
774
  theme: n,
@@ -794,21 +810,21 @@ function ot({
794
810
  },
795
811
  "aria-expanded": i
796
812
  },
797
- /* @__PURE__ */ t.createElement("span", { style: { display: "inline-flex", color: n.textSec, flexShrink: 0 } }, i ? /* @__PURE__ */ t.createElement(v.ChevronDown, null) : /* @__PURE__ */ t.createElement(v.ChevronRight, null)),
813
+ /* @__PURE__ */ t.createElement("span", { style: { display: "inline-flex", color: n.textSec, flexShrink: 0 } }, i ? /* @__PURE__ */ t.createElement(m.ChevronDown, null) : /* @__PURE__ */ t.createElement(m.ChevronRight, null)),
798
814
  /* @__PURE__ */ t.createElement("span", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ t.createElement("span", { style: { display: "block", fontSize: "12px", fontWeight: 900, color: n.text } }, e), l && /* @__PURE__ */ t.createElement("span", { style: { display: "block", fontSize: "11px", color: n.textSec, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", marginTop: "2px" } }, l))
799
815
  ),
800
816
  i && /* @__PURE__ */ t.createElement("div", { style: { borderTop: `1px solid ${n.border}`, padding: "12px", display: "flex", flexDirection: "column", gap: "12px" } }, r)
801
817
  );
802
818
  }
803
819
  function Jt({ item: e, selected: l, theme: n, sortByOptions: a, getFieldLabel: r = M, onSelect: i }) {
804
- const s = e.node, f = Pt(e), m = s.field ? r(s.field) : "Select field", g = tt(s), F = et(s.sortBy, a);
805
- return /* @__PURE__ */ t.createElement("button", { type: "button", onClick: i, style: nt(n, l, e.depth) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "10px" } }, /* @__PURE__ */ t.createElement("div", { style: { minWidth: 0, display: "flex", flexDirection: "column", gap: "7px" } }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement(X, { theme: n, tone: e.branchBadge ? "primary" : "neutral" }, f), /* @__PURE__ */ t.createElement("span", { style: { fontSize: "12px", fontWeight: 800, color: n.text } }, m)), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "11px", color: n.textSec } }, "Header: ", g), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "6px", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement(X, { theme: n }, s.topN ? `Top ${s.topN}` : "All rows"), /* @__PURE__ */ t.createElement(X, { theme: n }, F ? `Sort ${s.sortDir}${s.sortAbs ? " |abs|" : ""} by ${F}` : "Default sort"), s.defaultChild && /* @__PURE__ */ t.createElement(X, { theme: n }, "Has next level"), s.branches.length > 0 && /* @__PURE__ */ t.createElement(X, { theme: n, tone: "primary" }, s.branches.length, " row override", s.branches.length === 1 ? "" : "s"))), /* @__PURE__ */ t.createElement("span", { style: { color: l ? n.primary || "#2563EB" : n.textSec, flexShrink: 0 } }, /* @__PURE__ */ t.createElement(v.ChevronRight, null))));
820
+ const s = e.node, f = Lt(e), E = s.field ? r(s.field) : "Select field", b = lt(s), F = tt(s.sortBy, a);
821
+ return /* @__PURE__ */ t.createElement("button", { type: "button", onClick: i, style: at(n, l, e.depth) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "10px" } }, /* @__PURE__ */ t.createElement("div", { style: { minWidth: 0, display: "flex", flexDirection: "column", gap: "7px" } }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement(X, { theme: n, tone: e.branchBadge ? "primary" : "neutral" }, f), /* @__PURE__ */ t.createElement("span", { style: { fontSize: "12px", fontWeight: 800, color: n.text } }, E)), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "11px", color: n.textSec } }, "Header: ", b), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "6px", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement(X, { theme: n }, s.topN ? `Top ${s.topN}` : "All rows"), /* @__PURE__ */ t.createElement(X, { theme: n }, F ? `Sort ${s.sortDir}${s.sortAbs ? " |abs|" : ""} by ${F}` : "Default sort"), s.defaultChild && /* @__PURE__ */ t.createElement(X, { theme: n }, "Has next level"), s.branches.length > 0 && /* @__PURE__ */ t.createElement(X, { theme: n, tone: "primary" }, s.branches.length, " row override", s.branches.length === 1 ? "" : "s"))), /* @__PURE__ */ t.createElement("span", { style: { color: l ? n.primary || "#2563EB" : n.textSec, flexShrink: 0 } }, /* @__PURE__ */ t.createElement(m.ChevronRight, null))));
806
822
  }
807
- function Kt({ item: e, selected: l, theme: n, onSelect: a }) {
823
+ function Gt({ item: e, selected: l, theme: n, onSelect: a }) {
808
824
  const r = e.branch, i = r.label && r.label.trim() ? r.label.trim() : "Display original label";
809
- return /* @__PURE__ */ t.createElement("button", { type: "button", onClick: a, style: nt(n, l, e.depth) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "10px" } }, /* @__PURE__ */ t.createElement("div", { style: { minWidth: 0, display: "flex", flexDirection: "column", gap: "7px" } }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement(X, { theme: n, tone: "primary" }, `Row override ${e.badge}`), /* @__PURE__ */ t.createElement("span", { style: { fontSize: "12px", fontWeight: 800, color: n.text } }, i)), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "11px", color: n.textSec, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, Ce(r.condition)), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "6px", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement(X, { theme: n }, r.child ? "Custom children" : "Default children"))), /* @__PURE__ */ t.createElement("span", { style: { color: l ? n.primary || "#2563EB" : n.textSec, flexShrink: 0 } }, /* @__PURE__ */ t.createElement(v.ChevronRight, null))));
825
+ return /* @__PURE__ */ t.createElement("button", { type: "button", onClick: a, style: at(n, l, e.depth) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "10px" } }, /* @__PURE__ */ t.createElement("div", { style: { minWidth: 0, display: "flex", flexDirection: "column", gap: "7px" } }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement(X, { theme: n, tone: "primary" }, `Row override ${e.badge}`), /* @__PURE__ */ t.createElement("span", { style: { fontSize: "12px", fontWeight: 800, color: n.text } }, i)), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "11px", color: n.textSec, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, ke(r.condition)), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "6px", flexWrap: "wrap" } }, /* @__PURE__ */ t.createElement(X, { theme: n }, r.child ? "Custom children" : "Default children"))), /* @__PURE__ */ t.createElement("span", { style: { color: l ? n.primary || "#2563EB" : n.textSec, flexShrink: 0 } }, /* @__PURE__ */ t.createElement(m.ChevronRight, null))));
810
826
  }
811
- function it({
827
+ function st({
812
828
  item: e,
813
829
  selected: l,
814
830
  theme: n,
@@ -817,9 +833,9 @@ function it({
817
833
  onSelect: i,
818
834
  onDragStart: s,
819
835
  onDragOver: f,
820
- onDrop: m
836
+ onDrop: E
821
837
  }) {
822
- const g = e.node, F = g.field ? r(g.field) : "Select field", N = g.label && g.label.trim() ? g.label.trim() : F, y = et(g.sortBy, a);
838
+ const b = e.node, F = b.field ? r(b.field) : "Select field", N = b.label && b.label.trim() ? b.label.trim() : F, y = tt(b.sortBy, a);
823
839
  return /* @__PURE__ */ t.createElement(
824
840
  "button",
825
841
  {
@@ -827,7 +843,7 @@ function it({
827
843
  draggable: !0,
828
844
  onDragStart: s,
829
845
  onDragOver: f,
830
- onDrop: m,
846
+ onDrop: E,
831
847
  onClick: i,
832
848
  style: {
833
849
  width: "100%",
@@ -842,12 +858,12 @@ function it({
842
858
  gap: "10px"
843
859
  }
844
860
  },
845
- /* @__PURE__ */ t.createElement("span", { style: { cursor: "grab", display: "inline-flex" } }, /* @__PURE__ */ t.createElement(v.DragIndicator, null)),
846
- /* @__PURE__ */ t.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "center", gap: "7px", minWidth: 0 } }, /* @__PURE__ */ t.createElement("span", { style: { fontSize: "11px", fontWeight: 800, color: n.textSec, flexShrink: 0 } }, "Level ", e.levelNumber), /* @__PURE__ */ t.createElement("span", { style: { fontSize: "12px", fontWeight: 800, color: n.text, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, N)), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "11px", color: n.textSec, marginTop: "3px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, F, y ? ` · ${g.sortDir === "asc" ? "Asc" : "Desc"}${g.sortAbs ? " |abs|" : ""} by ${y}` : "", g.topN ? ` · Top ${g.topN}` : "", g.filters && g.filters.clauses && g.filters.clauses.length > 0 ? ` · ${g.filters.clauses.length} filter${g.filters.clauses.length === 1 ? "" : "s"}` : "")),
847
- /* @__PURE__ */ t.createElement("span", { style: { color: l ? n.primary || "#2563EB" : n.textSec, flexShrink: 0 } }, /* @__PURE__ */ t.createElement(v.ChevronRight, null))
861
+ /* @__PURE__ */ t.createElement("span", { style: { cursor: "grab", display: "inline-flex" } }, /* @__PURE__ */ t.createElement(m.DragIndicator, null)),
862
+ /* @__PURE__ */ t.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "center", gap: "7px", minWidth: 0 } }, /* @__PURE__ */ t.createElement("span", { style: { fontSize: "11px", fontWeight: 800, color: n.textSec, flexShrink: 0 } }, "Level ", e.levelNumber), /* @__PURE__ */ t.createElement("span", { style: { fontSize: "12px", fontWeight: 800, color: n.text, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, N)), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "11px", color: n.textSec, marginTop: "3px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, F, y ? ` · ${b.sortDir === "asc" ? "Asc" : "Desc"}${b.sortAbs ? " |abs|" : ""} by ${y}` : "", b.topN ? ` · Top ${b.topN}` : "", b.filters && b.filters.clauses && b.filters.clauses.length > 0 ? ` · ${b.filters.clauses.length} filter${b.filters.clauses.length === 1 ? "" : "s"}` : "")),
863
+ /* @__PURE__ */ t.createElement("span", { style: { color: l ? n.primary || "#2563EB" : n.textSec, flexShrink: 0 } }, /* @__PURE__ */ t.createElement(m.ChevronRight, null))
848
864
  );
849
865
  }
850
- function Gt({
866
+ function Yt({
851
867
  item: e,
852
868
  node: l,
853
869
  allFields: n,
@@ -856,18 +872,18 @@ function Gt({
856
872
  theme: i,
857
873
  onUpdate: s,
858
874
  onApply: f,
859
- onRemove: m,
860
- onEditFilter: g,
875
+ onRemove: E,
876
+ onEditFilter: b,
861
877
  titleLabel: F = "Title",
862
878
  canRemove: N = !0
863
879
  }) {
864
- const y = q(i), w = e && e.levelNumber ? `Level ${e.levelNumber}` : "Level", c = !!(l.filters && l.filters.clauses && l.filters.clauses.length > 0), h = [
880
+ const y = q(i), C = e && e.levelNumber ? `Level ${e.levelNumber}` : "Level", c = !!(l.filters && l.filters.clauses && l.filters.clauses.length > 0), v = [
865
881
  l.field ? a(l.field) : "Select field",
866
882
  l.label && l.label.trim() ? `Title: ${l.label.trim()}` : null,
867
883
  l.topN ? `Top ${l.topN}` : null,
868
884
  c ? `${l.filters.clauses.length} filter${l.filters.clauses.length === 1 ? "" : "s"}` : null
869
885
  ].filter(Boolean);
870
- return /* @__PURE__ */ t.createElement("div", { style: pe(i) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "12px" } }, /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "14px", fontWeight: 800, color: i.text } }, w)), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "8px", flexShrink: 0 } }, /* @__PURE__ */ t.createElement(
886
+ return /* @__PURE__ */ t.createElement("div", { style: ue(i) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "12px" } }, /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "14px", fontWeight: 800, color: i.text } }, C)), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "8px", flexShrink: 0 } }, /* @__PURE__ */ t.createElement(
871
887
  "button",
872
888
  {
873
889
  type: "button",
@@ -884,20 +900,22 @@ function Gt({
884
900
  }
885
901
  },
886
902
  "Apply"
887
- ), N && /* @__PURE__ */ t.createElement("button", { type: "button", onClick: m, style: j(i, !1, !0) }, /* @__PURE__ */ t.createElement(v.Delete, null), " ", e && e.path && e.path.length === 0 ? "Clear report" : "Remove level"))), /* @__PURE__ */ t.createElement(
888
- ot,
903
+ ), N && /* @__PURE__ */ t.createElement("button", { type: "button", onClick: E, style: j(i, !1, !0) }, /* @__PURE__ */ t.createElement(m.Delete, null), " ", e && e.path && e.path.length === 0 ? "Clear report" : "Remove level"))), /* @__PURE__ */ t.createElement(
904
+ it,
889
905
  {
890
- title: `${w} settings`,
891
- summary: h.join(" · "),
906
+ title: `${C} settings`,
907
+ summary: v.join(" · "),
892
908
  theme: i,
893
909
  defaultOpen: !1
894
910
  },
895
911
  /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(i) }, "Break Down By"), /* @__PURE__ */ t.createElement(
896
- "select",
912
+ U,
897
913
  {
914
+ size: "sm",
915
+ "aria-label": "Break down by",
898
916
  value: l.field,
899
917
  onChange: (u) => s({ ...l, field: u.target.value }),
900
- style: y
918
+ style: { ...y, width: "100%" }
901
919
  },
902
920
  /* @__PURE__ */ t.createElement("option", { value: "" }, "Select field..."),
903
921
  n.map(
@@ -928,11 +946,13 @@ function Gt({
928
946
  style: { ...y, textAlign: "center" }
929
947
  }
930
948
  ), /* @__PURE__ */ t.createElement(
931
- "select",
949
+ U,
932
950
  {
951
+ size: "sm",
952
+ "aria-label": "Sort by",
933
953
  value: l.sortBy || "",
934
954
  onChange: (u) => s({ ...l, sortBy: u.target.value || null }),
935
- style: y
955
+ style: { ...y, width: "100%" }
936
956
  },
937
957
  r.map(
938
958
  /** @param {any} [option] @returns {any} */
@@ -975,13 +995,13 @@ function Gt({
975
995
  },
976
996
  title: l.sortDir === "asc" ? "Ascending" : "Descending"
977
997
  },
978
- l.sortDir === "asc" ? /* @__PURE__ */ t.createElement(v.SortAsc, null) : /* @__PURE__ */ t.createElement(v.SortDesc, null)
998
+ l.sortDir === "asc" ? /* @__PURE__ */ t.createElement(m.SortAsc, null) : /* @__PURE__ */ t.createElement(m.SortDesc, null)
979
999
  ))),
980
1000
  /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(i) }, "Level Filter"), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "8px", alignItems: "stretch" } }, /* @__PURE__ */ t.createElement(
981
1001
  "button",
982
1002
  {
983
1003
  type: "button",
984
- onClick: g,
1004
+ onClick: b,
985
1005
  style: q(i, {
986
1006
  flex: 1,
987
1007
  display: "flex",
@@ -993,8 +1013,8 @@ function Gt({
993
1013
  borderColor: c ? `${i.primary || "#2563EB"}45` : void 0
994
1014
  })
995
1015
  },
996
- /* @__PURE__ */ t.createElement(v.Filter, null),
997
- /* @__PURE__ */ t.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", flex: 1 } }, c ? Ce(l.filters) : "No filter (show all rows)")
1016
+ /* @__PURE__ */ t.createElement(m.Filter, null),
1017
+ /* @__PURE__ */ t.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", flex: 1 } }, c ? ke(l.filters) : "No filter (show all rows)")
998
1018
  ), c && /* @__PURE__ */ t.createElement(
999
1019
  "button",
1000
1020
  {
@@ -1014,10 +1034,10 @@ function Gt({
1014
1034
  },
1015
1035
  title: "Clear filter"
1016
1036
  },
1017
- /* @__PURE__ */ t.createElement(v.Close, null)
1037
+ /* @__PURE__ */ t.createElement(m.Close, null)
1018
1038
  )), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "11px", color: i.textSec, marginTop: "6px", lineHeight: 1.4 } }, `Rows that don't match the filter are grouped into "Others" to keep totals intact.`)),
1019
1039
  /* @__PURE__ */ t.createElement(
1020
- at,
1040
+ ot,
1021
1041
  {
1022
1042
  value: l.format,
1023
1043
  theme: i,
@@ -1029,7 +1049,7 @@ function Gt({
1029
1049
  )
1030
1050
  ));
1031
1051
  }
1032
- function Yt({
1052
+ function Zt({
1033
1053
  draft: e,
1034
1054
  allFields: l,
1035
1055
  getFieldLabel: n = M,
@@ -1039,42 +1059,42 @@ function Yt({
1039
1059
  onApply: s,
1040
1060
  onCancel: f
1041
1061
  }) {
1042
- const [m, g] = H(null), [F, N] = H(!1), y = e && e.child ? e.child : Y(""), w = Array.isArray(e && e.selectedPath) ? e.selectedPath : [], c = ne(y, w) || y, E = !!(c.filters && c.filters.clauses && c.filters.clauses.length > 0), h = We(y, e.childLevelNumber || 2), u = Math.max(0, w.length), D = (e && Number.isFinite(Number(e.childLevelNumber)) ? Number(e.childLevelNumber) : 2) + w.length, R = q(r), x = [
1062
+ const [E, b] = H(null), [F, N] = H(!1), y = e && e.child ? e.child : Y(""), C = Array.isArray(e && e.selectedPath) ? e.selectedPath : [], c = ae(y, C) || y, h = !!(c.filters && c.filters.clauses && c.filters.clauses.length > 0), v = We(y, e.childLevelNumber || 2), u = Math.max(0, C.length), D = (e && Number.isFinite(Number(e.childLevelNumber)) ? Number(e.childLevelNumber) : 2) + C.length, R = q(r), x = [
1043
1063
  c.field ? n(c.field) : "Select field",
1044
1064
  e.title && e.title.trim() ? `Title: ${e.title.trim()}` : null,
1045
1065
  c.topN ? `Top ${c.topN}` : null,
1046
- E ? `${c.filters.clauses.length} filter${c.filters.clauses.length === 1 ? "" : "s"}` : null
1047
- ].filter(Boolean), C = (d) => {
1066
+ h ? `${c.filters.clauses.length} filter${c.filters.clauses.length === 1 ? "" : "s"}` : null
1067
+ ].filter(Boolean), w = (d) => {
1048
1068
  i({
1049
1069
  ...e,
1050
- child: O(y, w, () => d)
1070
+ child: _(y, C, () => d)
1051
1071
  });
1052
- }, J = (d) => {
1072
+ }, K = (d) => {
1053
1073
  i({
1054
1074
  ...e,
1055
- selectedPath: Ne(d)
1075
+ selectedPath: Ie(d)
1056
1076
  });
1057
- }, ue = () => {
1058
- const d = [...w, T];
1077
+ }, fe = () => {
1078
+ const d = [...C, T];
1059
1079
  i({
1060
1080
  ...e,
1061
- child: O(
1081
+ child: _(
1062
1082
  y,
1063
- w,
1083
+ C,
1064
1084
  /** @param {any} [node] @returns {any} */
1065
- (k) => ({
1066
- ...k,
1067
- defaultChild: k.defaultChild || Y("")
1085
+ (A) => ({
1086
+ ...A,
1087
+ defaultChild: A.defaultChild || Y("")
1068
1088
  })
1069
1089
  ),
1070
1090
  selectedPath: d
1071
1091
  });
1072
- }, oe = () => {
1092
+ }, ie = () => {
1073
1093
  i({
1074
1094
  ...e,
1075
- child: O(
1095
+ child: _(
1076
1096
  y,
1077
- w,
1097
+ C,
1078
1098
  /** @param {any} [node] @returns {any} */
1079
1099
  (d) => ({
1080
1100
  ...d,
@@ -1082,14 +1102,14 @@ function Yt({
1082
1102
  })
1083
1103
  )
1084
1104
  });
1085
- }, fe = (d, k) => {
1086
- d === null || d === k || (i({
1105
+ }, ye = (d, A) => {
1106
+ d === null || d === A || (i({
1087
1107
  ...e,
1088
- child: rt(y, d, k),
1089
- selectedPath: Ne(k)
1090
- }), g(null));
1108
+ child: nt(y, d, A),
1109
+ selectedPath: Ie(A)
1110
+ }), b(null));
1091
1111
  };
1092
- return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", { style: pe(r) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "12px" } }, /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "14px", fontWeight: 800, color: r.text } }, e.rowLabel || "Selected row"), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "12px", color: r.textSec, marginTop: "2px" } }, "Override applies to this row only.")), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "8px", flexShrink: 0 } }, /* @__PURE__ */ t.createElement("button", { type: "button", onClick: f, style: j(r) }, /* @__PURE__ */ t.createElement(v.Close, null), " Close"), /* @__PURE__ */ t.createElement(
1112
+ return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", { style: ue(r) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "12px" } }, /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "14px", fontWeight: 800, color: r.text } }, e.rowLabel || "Selected row"), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "12px", color: r.textSec, marginTop: "2px" } }, "Override applies to this row only.")), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "8px", flexShrink: 0 } }, /* @__PURE__ */ t.createElement("button", { type: "button", onClick: f, style: j(r) }, /* @__PURE__ */ t.createElement(m.Close, null), " Close"), /* @__PURE__ */ t.createElement(
1093
1113
  "button",
1094
1114
  {
1095
1115
  type: "button",
@@ -1106,10 +1126,10 @@ function Yt({
1106
1126
  }
1107
1127
  },
1108
1128
  "Apply"
1109
- ))), /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(r) }, "Level"), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "12px", fontWeight: 800, color: r.text } }, `Level ${D}`)), /* @__PURE__ */ t.createElement(qt, { debug: e.request && e.request.debug, theme: r }), h.length > 1 && /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, h.map(
1129
+ ))), /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(r) }, "Level"), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "12px", fontWeight: 800, color: r.text } }, `Level ${D}`)), /* @__PURE__ */ t.createElement(Kt, { debug: e.request && e.request.debug, theme: r }), v.length > 1 && /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, v.map(
1110
1130
  /** @param {any} [item] @returns {any} */
1111
1131
  (d) => /* @__PURE__ */ t.createElement(
1112
- it,
1132
+ st,
1113
1133
  {
1114
1134
  key: `draft-level:${d.index}:${d.node._id}`,
1115
1135
  item: d,
@@ -1117,27 +1137,27 @@ function Yt({
1117
1137
  theme: r,
1118
1138
  sortByOptions: a,
1119
1139
  getFieldLabel: n,
1120
- onSelect: () => J(d.index),
1140
+ onSelect: () => K(d.index),
1121
1141
  onDragStart: (
1122
1142
  /** @param {any} [event] @returns {any} */
1123
- ((k) => {
1124
- g(d.index), k.dataTransfer.effectAllowed = "move";
1143
+ ((A) => {
1144
+ b(d.index), A.dataTransfer.effectAllowed = "move";
1125
1145
  })
1126
1146
  ),
1127
1147
  onDragOver: (
1128
1148
  /** @param {any} [event] @returns {any} */
1129
- ((k) => k.preventDefault())
1149
+ ((A) => A.preventDefault())
1130
1150
  ),
1131
1151
  onDrop: (
1132
1152
  /** @param {any} [event] @returns {any} */
1133
- ((k) => {
1134
- k.preventDefault(), fe(m, d.index);
1153
+ ((A) => {
1154
+ A.preventDefault(), ye(E, d.index);
1135
1155
  })
1136
1156
  )
1137
1157
  }
1138
1158
  )
1139
1159
  )), /* @__PURE__ */ t.createElement(
1140
- ot,
1160
+ it,
1141
1161
  {
1142
1162
  title: `Level ${D} settings`,
1143
1163
  summary: x.join(" · "),
@@ -1154,11 +1174,13 @@ function Yt({
1154
1174
  }
1155
1175
  )),
1156
1176
  /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(r) }, "Break Down By"), /* @__PURE__ */ t.createElement(
1157
- "select",
1177
+ U,
1158
1178
  {
1179
+ size: "sm",
1180
+ "aria-label": "Break down by",
1159
1181
  value: c.field,
1160
- onChange: (d) => C({ ...c, field: d.target.value }),
1161
- style: R
1182
+ onChange: (d) => w({ ...c, field: d.target.value }),
1183
+ style: { ...R, width: "100%" }
1162
1184
  },
1163
1185
  /* @__PURE__ */ t.createElement("option", { value: "" }, "Select field..."),
1164
1186
  l.map(
@@ -1173,18 +1195,20 @@ function Yt({
1173
1195
  min: "1",
1174
1196
  value: c.topN || "",
1175
1197
  onChange: (d) => {
1176
- const k = d.target.value === "" ? null : parseInt(d.target.value, 10);
1177
- C({ ...c, topN: k && k > 0 ? k : null });
1198
+ const A = d.target.value === "" ? null : parseInt(d.target.value, 10);
1199
+ w({ ...c, topN: A && A > 0 ? A : null });
1178
1200
  },
1179
1201
  placeholder: "All",
1180
1202
  style: { ...R, textAlign: "center" }
1181
1203
  }
1182
1204
  ), /* @__PURE__ */ t.createElement(
1183
- "select",
1205
+ U,
1184
1206
  {
1207
+ size: "sm",
1208
+ "aria-label": "Sort by",
1185
1209
  value: c.sortBy || "",
1186
- onChange: (d) => C({ ...c, sortBy: d.target.value || null }),
1187
- style: R
1210
+ onChange: (d) => w({ ...c, sortBy: d.target.value || null }),
1211
+ style: { ...R, width: "100%" }
1188
1212
  },
1189
1213
  a.map(
1190
1214
  /** @param {any} [option] @returns {any} */
@@ -1194,7 +1218,7 @@ function Yt({
1194
1218
  "button",
1195
1219
  {
1196
1220
  type: "button",
1197
- onClick: () => C({ ...c, sortAbs: !c.sortAbs }),
1221
+ onClick: () => w({ ...c, sortAbs: !c.sortAbs }),
1198
1222
  style: {
1199
1223
  border: `1px solid ${c.sortAbs ? r.primary || "#2563EB" : r.border}`,
1200
1224
  borderRadius: "10px",
@@ -1214,7 +1238,7 @@ function Yt({
1214
1238
  "button",
1215
1239
  {
1216
1240
  type: "button",
1217
- onClick: () => C({ ...c, sortDir: c.sortDir === "asc" ? "desc" : "asc" }),
1241
+ onClick: () => w({ ...c, sortDir: c.sortDir === "asc" ? "desc" : "asc" }),
1218
1242
  style: {
1219
1243
  border: `1px solid ${r.border}`,
1220
1244
  borderRadius: "10px",
@@ -1227,7 +1251,7 @@ function Yt({
1227
1251
  },
1228
1252
  title: c.sortDir === "asc" ? "Ascending" : "Descending"
1229
1253
  },
1230
- c.sortDir === "asc" ? /* @__PURE__ */ t.createElement(v.SortAsc, null) : /* @__PURE__ */ t.createElement(v.SortDesc, null)
1254
+ c.sortDir === "asc" ? /* @__PURE__ */ t.createElement(m.SortAsc, null) : /* @__PURE__ */ t.createElement(m.SortDesc, null)
1231
1255
  ))),
1232
1256
  /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(r) }, "Filter (this row's children only)"), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "8px", alignItems: "stretch" } }, /* @__PURE__ */ t.createElement(
1233
1257
  "button",
@@ -1241,17 +1265,17 @@ function Yt({
1241
1265
  gap: "8px",
1242
1266
  textAlign: "left",
1243
1267
  cursor: "pointer",
1244
- background: E ? `${r.primary || "#2563EB"}08` : r.hover || "#F8FAFC",
1245
- borderColor: E ? `${r.primary || "#2563EB"}45` : void 0
1268
+ background: h ? `${r.primary || "#2563EB"}08` : r.hover || "#F8FAFC",
1269
+ borderColor: h ? `${r.primary || "#2563EB"}45` : void 0
1246
1270
  })
1247
1271
  },
1248
- /* @__PURE__ */ t.createElement(v.Filter, null),
1249
- /* @__PURE__ */ t.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", flex: 1 } }, E ? Ce(c.filters) : "No filter (show all children)")
1250
- ), E && /* @__PURE__ */ t.createElement(
1272
+ /* @__PURE__ */ t.createElement(m.Filter, null),
1273
+ /* @__PURE__ */ t.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", flex: 1 } }, h ? ke(c.filters) : "No filter (show all children)")
1274
+ ), h && /* @__PURE__ */ t.createElement(
1251
1275
  "button",
1252
1276
  {
1253
1277
  type: "button",
1254
- onClick: () => C({ ...c, filters: null }),
1278
+ onClick: () => w({ ...c, filters: null }),
1255
1279
  style: {
1256
1280
  border: `1px solid ${r.border}`,
1257
1281
  borderRadius: "10px",
@@ -1266,16 +1290,16 @@ function Yt({
1266
1290
  },
1267
1291
  title: "Clear filter"
1268
1292
  },
1269
- /* @__PURE__ */ t.createElement(v.Close, null)
1293
+ /* @__PURE__ */ t.createElement(m.Close, null)
1270
1294
  )), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "11px", color: r.textSec, marginTop: "6px", lineHeight: 1.4 } }, 'Filtered-out children are grouped into "Others" to keep totals intact.')),
1271
1295
  /* @__PURE__ */ t.createElement(
1272
- at,
1296
+ ot,
1273
1297
  {
1274
1298
  value: c.format,
1275
1299
  theme: r,
1276
1300
  onChange: (
1277
1301
  /** @param {any} [format] @returns {any} */
1278
- ((d) => C({ ...c, format: d }))
1302
+ ((d) => w({ ...c, format: d }))
1279
1303
  )
1280
1304
  }
1281
1305
  ),
@@ -1283,27 +1307,27 @@ function Yt({
1283
1307
  "button",
1284
1308
  {
1285
1309
  type: "button",
1286
- onClick: ue,
1310
+ onClick: fe,
1287
1311
  disabled: !c.field,
1288
1312
  style: { ...j(r, !!c.defaultChild), opacity: c.field ? 1 : 0.5 }
1289
1313
  },
1290
- /* @__PURE__ */ t.createElement(v.Add, null),
1314
+ /* @__PURE__ */ t.createElement(m.Add, null),
1291
1315
  " ",
1292
1316
  c.defaultChild ? "Open next level" : "Add next level"
1293
- ), c.defaultChild && /* @__PURE__ */ t.createElement("button", { type: "button", onClick: oe, style: j(r, !1, !0) }, /* @__PURE__ */ t.createElement(v.Delete, null), " Remove next level"))
1317
+ ), c.defaultChild && /* @__PURE__ */ t.createElement("button", { type: "button", onClick: ie, style: j(r, !1, !0) }, /* @__PURE__ */ t.createElement(m.Delete, null), " Remove next level"))
1294
1318
  )), F && /* @__PURE__ */ t.createElement(
1295
- Ie,
1319
+ Pe,
1296
1320
  {
1297
1321
  title: `Filter children of "${e.rowLabel || "this row"}"`,
1298
1322
  description: "Only children matching this filter are shown. Filtered-out rows are grouped into 'Others' to keep totals intact.",
1299
- condition: c.filters || Pe(),
1323
+ condition: c.filters || Le(),
1300
1324
  allFields: l,
1301
1325
  getFieldLabel: n,
1302
1326
  theme: r,
1303
1327
  onSave: (
1304
1328
  /** @param {any} [nextCondition] @returns {any} */
1305
1329
  ((d) => {
1306
- C({
1330
+ w({
1307
1331
  ...c,
1308
1332
  filters: d.clauses.length > 0 ? d : null
1309
1333
  });
@@ -1313,7 +1337,7 @@ function Yt({
1313
1337
  }
1314
1338
  ));
1315
1339
  }
1316
- function Zt({
1340
+ function Xt({
1317
1341
  item: e,
1318
1342
  branch: l,
1319
1343
  theme: n,
@@ -1323,21 +1347,21 @@ function Zt({
1323
1347
  onRemoveCustomChildren: s,
1324
1348
  onRemove: f
1325
1349
  }) {
1326
- const m = q(n), g = Ce(l.condition);
1327
- return /* @__PURE__ */ t.createElement("div", { style: pe(n) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "12px" } }, /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "14px", fontWeight: 800, color: n.text } }, `Row override ${e.badge}`), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "12px", color: n.textSec, marginTop: "2px" } }, "Use a row override when matching rows need a different label or child breakdown.")), /* @__PURE__ */ t.createElement("button", { type: "button", onClick: f, style: j(n, !1, !0) }, /* @__PURE__ */ t.createElement(v.Delete, null), " Remove override")), /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(n) }, "Display As"), /* @__PURE__ */ t.createElement(
1350
+ const E = q(n), b = ke(l.condition);
1351
+ return /* @__PURE__ */ t.createElement("div", { style: ue(n) }, /* @__PURE__ */ t.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "12px" } }, /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "14px", fontWeight: 800, color: n.text } }, `Row override ${e.badge}`), /* @__PURE__ */ t.createElement("div", { style: { fontSize: "12px", color: n.textSec, marginTop: "2px" } }, "Use a row override when matching rows need a different label or child breakdown.")), /* @__PURE__ */ t.createElement("button", { type: "button", onClick: f, style: j(n, !1, !0) }, /* @__PURE__ */ t.createElement(m.Delete, null), " Remove override")), /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(n) }, "Display As"), /* @__PURE__ */ t.createElement(
1328
1352
  "input",
1329
1353
  {
1330
1354
  value: l.label,
1331
1355
  onChange: (F) => a({ ...l, label: F.target.value }),
1332
1356
  placeholder: "Label to show for matching rows",
1333
- style: m
1357
+ style: E
1334
1358
  }
1335
1359
  )), /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(n) }, "Rule"), /* @__PURE__ */ t.createElement(
1336
1360
  "button",
1337
1361
  {
1338
1362
  type: "button",
1339
1363
  onClick: r,
1340
- title: g,
1364
+ title: b,
1341
1365
  style: {
1342
1366
  ...q(n),
1343
1367
  display: "flex",
@@ -1348,9 +1372,9 @@ function Zt({
1348
1372
  background: n.hover || "#F8FAFC"
1349
1373
  }
1350
1374
  },
1351
- /* @__PURE__ */ t.createElement(v.Filter, null),
1352
- /* @__PURE__ */ t.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, g)
1353
- )), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" } }, /* @__PURE__ */ t.createElement("button", { type: "button", onClick: i, style: j(n, !!l.child) }, /* @__PURE__ */ t.createElement(v.Add, null), " ", l.child ? "Open Custom children" : "Add Custom children"), l.child && /* @__PURE__ */ t.createElement("button", { type: "button", onClick: s, style: j(n, !1, !0) }, /* @__PURE__ */ t.createElement(v.Delete, null), " Remove Custom children")), /* @__PURE__ */ t.createElement(
1375
+ /* @__PURE__ */ t.createElement(m.Filter, null),
1376
+ /* @__PURE__ */ t.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, b)
1377
+ )), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" } }, /* @__PURE__ */ t.createElement("button", { type: "button", onClick: i, style: j(n, !!l.child) }, /* @__PURE__ */ t.createElement(m.Add, null), " ", l.child ? "Open Custom children" : "Add Custom children"), l.child && /* @__PURE__ */ t.createElement("button", { type: "button", onClick: s, style: j(n, !1, !0) }, /* @__PURE__ */ t.createElement(m.Delete, null), " Remove Custom children")), /* @__PURE__ */ t.createElement(
1354
1378
  "div",
1355
1379
  {
1356
1380
  style: {
@@ -1365,7 +1389,7 @@ function Zt({
1365
1389
  "Override applies to this row only. Rows without this override continue with Default children."
1366
1390
  ));
1367
1391
  }
1368
- function Ut({
1392
+ function el({
1369
1393
  reportDef: e,
1370
1394
  setReportDef: l,
1371
1395
  availableFields: n,
@@ -1374,146 +1398,146 @@ function Ut({
1374
1398
  data: i = [],
1375
1399
  valConfigs: s,
1376
1400
  colFields: f,
1377
- setColFields: m,
1378
- setValConfigs: g,
1401
+ setColFields: E,
1402
+ setValConfigs: b,
1379
1403
  savedReports: F,
1380
1404
  setSavedReports: N,
1381
1405
  activeReportId: y,
1382
- setActiveReportId: w,
1406
+ setActiveReportId: C,
1383
1407
  showNotification: c,
1384
- requestedSelection: E = null,
1385
- showReportConfigColumn: h = !0,
1408
+ requestedSelection: h = null,
1409
+ showReportConfigColumn: v = !0,
1386
1410
  setShowReportConfigColumn: u
1387
1411
  }) {
1388
- const [D, R] = H(""), [x, C] = H(null), [J, ue] = H(null), [oe, fe] = H(null), [d, k] = H(null), [st, ze] = H(null), ye = ke(null), ie = ke(!1), Te = ke(null), b = z(
1412
+ const [D, R] = H(""), [x, w] = H(null), [K, fe] = H(null), [ie, ye] = H(null), [d, A] = H(null), [ct, Te] = H(null), xe = Fe(null), se = Fe(!1), je = Fe(null), g = W(
1389
1413
  () => e && e.root ? V(e.root) : null,
1390
1414
  [e]
1391
- ), W = z(
1392
- () => Dt(n, s),
1415
+ ), O = W(
1416
+ () => Rt(n, s),
1393
1417
  [n, s]
1394
- ), U = B(
1395
- (o) => Et(o, a),
1418
+ ), ee = B(
1419
+ (o) => St(o, a),
1396
1420
  [a]
1397
- ), xe = z(
1398
- () => Rt(s),
1421
+ ), be = W(
1422
+ () => Nt(s),
1399
1423
  [s]
1400
- ), K = z(
1401
- () => Ye(b, { allFields: W, valConfigs: s, data: i }),
1402
- [b, W, s, i]
1424
+ ), J = W(
1425
+ () => Ze(g, { allFields: O, valConfigs: s, data: i }),
1426
+ [g, O, s, i]
1403
1427
  ), $ = B((o) => {
1404
1428
  l(
1405
1429
  /** @param {any} [prev] @returns {any} */
1406
1430
  (p) => {
1407
- const S = p && typeof p == "object" ? p : {}, A = S.root ? V(S.root) : null, P = typeof o == "function" ? o(A) : o;
1431
+ const S = p && typeof p == "object" ? p : {}, k = S.root ? V(S.root) : null, P = typeof o == "function" ? o(k) : o;
1408
1432
  return { ...S, root: P };
1409
1433
  }
1410
1434
  );
1411
- }, [l]), ee = z(() => Lt(b), [b]), I = z(() => We(b), [b]), se = z(
1412
- () => Tt(ee, x),
1413
- [ee, x]
1435
+ }, [l]), te = W(() => zt(g), [g]), I = W(() => We(g), [g]), ce = W(
1436
+ () => jt(te, x),
1437
+ [te, x]
1414
1438
  );
1415
- z(
1416
- () => jt(ee, x),
1417
- [ee, x]
1418
- ), z(
1419
- () => Mt(ee, x),
1420
- [ee, x]
1439
+ W(
1440
+ () => Mt(te, x),
1441
+ [te, x]
1442
+ ), W(
1443
+ () => Ht(te, x),
1444
+ [te, x]
1421
1445
  );
1422
- const te = z(() => {
1423
- if (!b || !x) return null;
1446
+ const le = W(() => {
1447
+ if (!g || !x) return null;
1424
1448
  if (x.type === "node") {
1425
- const o = ne(b, x.path);
1449
+ const o = ae(g, x.path);
1426
1450
  return o ? { type: "node", node: o } : null;
1427
1451
  }
1428
1452
  if (x.type === "branch") {
1429
- const o = Fe(b, x.nodePath, x.branchIndex);
1453
+ const o = Be(g, x.nodePath, x.branchIndex);
1430
1454
  return o ? { type: "branch", branch: o } : null;
1431
1455
  }
1432
1456
  return null;
1433
- }, [b, x]), Ae = z(() => !J || !b ? null : Fe(b, J.nodePath, J.branchIndex), [J, b]), je = B((o) => {
1434
- if (!o || o.type !== "rowPath" || !b) return !1;
1435
- const p = Array.isArray(o.nodePath) ? o.nodePath : [], S = ne(b, p);
1457
+ }, [g, x]), $e = W(() => !K || !g ? null : Be(g, K.nodePath, K.branchIndex), [K, g]), Me = B((o) => {
1458
+ if (!o || o.type !== "rowPath" || !g) return !1;
1459
+ const p = Array.isArray(o.nodePath) ? o.nodePath : [], S = ae(g, p);
1436
1460
  if (!S) return !1;
1437
- const A = Array.isArray(S.branches) ? S.branches : [], P = A.findIndex(
1461
+ const k = Array.isArray(S.branches) ? S.branches : [], P = k.findIndex(
1438
1462
  /** @param {any} [branch] @returns {any} */
1439
- (ce) => Ze(ce, o.field, o.value)
1440
- ), _ = P >= 0 ? A[P] : null, be = _ && _.child ? _.child : S.defaultChild || Y(""), G = Q(o.label || o.value);
1441
- return k({
1463
+ (de) => Xe(de, o.field, o.value)
1464
+ ), z = P >= 0 ? k[P] : null, he = z && z.child ? z.child : S.defaultChild || Y(""), G = Q(o.label || o.value);
1465
+ return A({
1442
1466
  request: o,
1443
1467
  nodePath: p,
1444
1468
  branchIndex: P,
1445
1469
  rowLabel: G,
1446
- title: _ && _.label ? _.label : G,
1447
- child: Oe(be) || Y(""),
1470
+ title: z && z.label ? z.label : G,
1471
+ child: Oe(he) || Y(""),
1448
1472
  selectedPath: [],
1449
1473
  childLevelNumber: Number.isFinite(Number(o.levelNumber)) ? Number(o.levelNumber) + 1 : 2
1450
- }), C({ type: "node", path: p }), !0;
1451
- }, [b]);
1452
- $e(() => {
1453
- if (!b) {
1454
- x !== null && C(null);
1474
+ }), w({ type: "node", path: p }), !0;
1475
+ }, [g]);
1476
+ Ee(() => {
1477
+ if (!g) {
1478
+ x !== null && w(null);
1455
1479
  return;
1456
1480
  }
1457
1481
  if (x) {
1458
1482
  if (x.type === "node") {
1459
- ne(b, x.path) || C({ type: "node", path: [] });
1483
+ ae(g, x.path) || w({ type: "node", path: [] });
1460
1484
  return;
1461
1485
  }
1462
- Fe(b, x.nodePath, x.branchIndex) || C({ type: "node", path: x.nodePath });
1486
+ Be(g, x.nodePath, x.branchIndex) || w({ type: "node", path: x.nodePath });
1463
1487
  }
1464
- }, [b, x]);
1488
+ }, [g, x]);
1465
1489
  const ge = B(() => {
1466
- const o = ye.current;
1490
+ const o = xe.current;
1467
1491
  !o || typeof o.scrollIntoView != "function" || window.requestAnimationFrame(() => {
1468
1492
  o.scrollIntoView({ block: "start", behavior: "smooth" });
1469
1493
  });
1470
1494
  }, []);
1471
- $e(() => {
1472
- if (E && Te.current !== E) {
1473
- if (Te.current = E, ie.current = !0, E.type === "rowPath") {
1474
- je(E) || (ie.current = !1);
1495
+ Ee(() => {
1496
+ if (h && je.current !== h) {
1497
+ if (je.current = h, se.current = !0, h.type === "rowPath") {
1498
+ Me(h) || (se.current = !1);
1475
1499
  return;
1476
1500
  }
1477
- if (Z(E) === Z(x)) {
1478
- ie.current = !1, ge();
1501
+ if (Z(h) === Z(x)) {
1502
+ se.current = !1, ge();
1479
1503
  return;
1480
1504
  }
1481
- C(E);
1505
+ w(h);
1482
1506
  }
1483
- }, [je, E, ge, x]), $e(() => {
1484
- ie.current && (ie.current = !1, ge());
1507
+ }, [Me, h, ge, x]), Ee(() => {
1508
+ se.current && (se.current = !1, ge());
1485
1509
  }, [ge, x]);
1486
- const Me = B((o, p) => {
1510
+ const He = B((o, p) => {
1487
1511
  $(
1488
1512
  /** @param {any} [prevRoot] @returns {any} */
1489
- (S) => O(S, o, () => p)
1513
+ (S) => _(S, o, () => p)
1490
1514
  );
1491
- }, [$]), He = B((o, p, S) => {
1515
+ }, [$]), Ve = B((o, p, S) => {
1492
1516
  $(
1493
1517
  /** @param {any} [prevRoot] @returns {any} */
1494
- (A) => ve(A, o, p, () => S)
1518
+ (k) => me(k, o, p, () => S)
1495
1519
  );
1496
- }, [$]), ct = B((o) => {
1520
+ }, [$]), dt = B((o) => {
1497
1521
  const p = Y(o);
1498
- $(p), k(null), C({ type: "node", path: [] });
1522
+ $(p), A(null), w({ type: "node", path: [] });
1499
1523
  }, [$]);
1500
1524
  B((o, p) => {
1501
1525
  p || $(
1502
1526
  /** @param {any} [prevRoot] @returns {any} */
1503
- (S) => O(
1527
+ (S) => _(
1504
1528
  S,
1505
1529
  o,
1506
1530
  /** @param {any} [node] @returns {any} */
1507
- (A) => ({
1508
- ...A,
1531
+ (k) => ({
1532
+ ...k,
1509
1533
  defaultChild: Y("")
1510
1534
  })
1511
1535
  )
1512
- ), C({ type: "node", path: [...o, T] });
1536
+ ), w({ type: "node", path: [...o, T] });
1513
1537
  }, [$]), B((o) => {
1514
1538
  $(
1515
1539
  /** @param {any} [prevRoot] @returns {any} */
1516
- (p) => O(
1540
+ (p) => _(
1517
1541
  p,
1518
1542
  o,
1519
1543
  /** @param {any} [node] @returns {any} */
@@ -1522,163 +1546,163 @@ function Ut({
1522
1546
  defaultChild: null
1523
1547
  })
1524
1548
  )
1525
- ), C({ type: "node", path: o });
1549
+ ), w({ type: "node", path: o });
1526
1550
  }, [$]);
1527
- const dt = B((o, p, S) => {
1551
+ const pt = B((o, p, S) => {
1528
1552
  S || $(
1529
1553
  /** @param {any} [prevRoot] @returns {any} */
1530
- (A) => ve(
1531
- A,
1554
+ (k) => me(
1555
+ k,
1532
1556
  o,
1533
1557
  p,
1534
1558
  /** @param {any} [branch] @returns {any} */
1535
1559
  (P) => ({
1536
1560
  ...P,
1537
- child: Y(W[0] || "")
1561
+ child: Y(O[0] || "")
1538
1562
  })
1539
1563
  )
1540
- ), C({ type: "node", path: [...o, _e(p)] });
1541
- }, [W, $]), pt = B((o, p) => {
1564
+ ), w({ type: "node", path: [...o, _e(p)] });
1565
+ }, [O, $]), ut = B((o, p) => {
1542
1566
  $(
1543
1567
  /** @param {any} [prevRoot] @returns {any} */
1544
- (S) => ve(
1568
+ (S) => me(
1545
1569
  S,
1546
1570
  o,
1547
1571
  p,
1548
1572
  /** @param {any} [branch] @returns {any} */
1549
- (A) => ({
1550
- ...A,
1573
+ (k) => ({
1574
+ ...k,
1551
1575
  child: null
1552
1576
  })
1553
1577
  )
1554
- ), C({ type: "branch", nodePath: o, branchIndex: p });
1555
- }, [$]), ut = B((o) => {
1578
+ ), w({ type: "branch", nodePath: o, branchIndex: p });
1579
+ }, [$]), ft = B((o) => {
1556
1580
  if (o.length === 0) {
1557
- $(null), k(null), C(null);
1581
+ $(null), A(null), w(null);
1558
1582
  return;
1559
1583
  }
1560
1584
  const p = o.slice(0, -1), S = o[o.length - 1];
1561
1585
  if (S === T) {
1562
1586
  $(
1563
1587
  /** @param {any} [prevRoot] @returns {any} */
1564
- (P) => O(
1588
+ (P) => _(
1565
1589
  P,
1566
1590
  p,
1567
1591
  /** @param {any} [node] @returns {any} */
1568
- (_) => ({
1569
- ..._,
1592
+ (z) => ({
1593
+ ...z,
1570
1594
  defaultChild: null
1571
1595
  })
1572
1596
  )
1573
- ), C({ type: "node", path: p });
1597
+ ), w({ type: "node", path: p });
1574
1598
  return;
1575
1599
  }
1576
- const A = Se(S);
1577
- A >= 0 && ($(
1600
+ const k = Ce(S);
1601
+ k >= 0 && ($(
1578
1602
  /** @param {any} [prevRoot] @returns {any} */
1579
- (P) => ve(
1603
+ (P) => me(
1580
1604
  P,
1581
1605
  p,
1582
- A,
1606
+ k,
1583
1607
  /** @param {any} [branch] @returns {any} */
1584
- (_) => ({
1585
- ..._,
1608
+ (z) => ({
1609
+ ...z,
1586
1610
  child: null
1587
1611
  })
1588
1612
  )
1589
- ), C({ type: "branch", nodePath: p, branchIndex: A }));
1590
- }, [$]), ft = B((o, p) => {
1613
+ ), w({ type: "branch", nodePath: p, branchIndex: k }));
1614
+ }, [$]), yt = B((o, p) => {
1591
1615
  $(
1592
1616
  /** @param {any} [prevRoot] @returns {any} */
1593
- (S) => O(
1617
+ (S) => _(
1594
1618
  S,
1595
1619
  o,
1596
1620
  /** @param {any} [node] @returns {any} */
1597
- (A) => ({
1598
- ...A,
1599
- branches: A.branches.filter(
1621
+ (k) => ({
1622
+ ...k,
1623
+ branches: k.branches.filter(
1600
1624
  /** @param {any} [_] @param {any} [index] @returns {any} */
1601
- (P, _) => _ !== p
1625
+ (P, z) => z !== p
1602
1626
  )
1603
1627
  })
1604
1628
  )
1605
- ), C({ type: "node", path: o });
1606
- }, [$]), yt = B((o) => {
1607
- k(null), C({ type: "node", path: o });
1608
- }, []), Ve = B((o) => {
1629
+ ), w({ type: "node", path: o });
1630
+ }, [$]), xt = B((o) => {
1631
+ A(null), w({ type: "node", path: o });
1632
+ }, []), qe = B((o) => {
1609
1633
  if (o) {
1610
- if (k(null), o.kind === "branch") {
1611
- C({ type: "branch", nodePath: o.nodePath, branchIndex: o.branchIndex });
1634
+ if (A(null), o.kind === "branch") {
1635
+ w({ type: "branch", nodePath: o.nodePath, branchIndex: o.branchIndex });
1612
1636
  return;
1613
1637
  }
1614
- C({ type: "node", path: o.nodePath });
1638
+ w({ type: "node", path: o.nodePath });
1615
1639
  }
1616
- }, []), xt = B(() => {
1617
- if (!b || !I.length) return;
1640
+ }, []), bt = B(() => {
1641
+ if (!g || !I.length) return;
1618
1642
  const o = I[I.length - 1];
1619
1643
  if (!o || !o.node || !o.node.field) return;
1620
1644
  const p = [...o.path, T];
1621
- k(null), $(
1645
+ A(null), $(
1622
1646
  /** @param {any} [prevRoot] @returns {any} */
1623
- (S) => O(
1647
+ (S) => _(
1624
1648
  S,
1625
1649
  o.path,
1626
1650
  /** @param {any} [node] @returns {any} */
1627
- (A) => ({
1628
- ...A,
1629
- defaultChild: A.defaultChild || Y("")
1651
+ (k) => ({
1652
+ ...k,
1653
+ defaultChild: k.defaultChild || Y("")
1630
1654
  })
1631
1655
  )
1632
- ), C({ type: "node", path: p });
1633
- }, [I, b, $]), gt = B((o, p) => {
1656
+ ), w({ type: "node", path: p });
1657
+ }, [I, g, $]), gt = B((o, p) => {
1634
1658
  o === null || o === p || ($(
1635
1659
  /** @param {any} [prevRoot] @returns {any} */
1636
- (S) => rt(S, o, p)
1637
- ), C({ type: "node", path: Ne(p) }), ze(null));
1638
- }, [$]), bt = B(() => {
1639
- k(null), C(null);
1640
- }, []), ht = B(() => {
1641
- if (!K.valid) {
1642
- c && c(K.errors[0] || "Fix report validation errors before applying.", "error");
1660
+ (S) => nt(S, o, p)
1661
+ ), w({ type: "node", path: Ie(p) }), Te(null));
1662
+ }, [$]), ht = B(() => {
1663
+ A(null), w(null);
1664
+ }, []), vt = B(() => {
1665
+ if (!J.valid) {
1666
+ c && c(J.errors[0] || "Fix report validation errors before applying.", "error");
1643
1667
  return;
1644
1668
  }
1645
- C(null);
1646
- }, [K, c]), vt = B(() => {
1669
+ w(null);
1670
+ }, [J, c]), mt = B(() => {
1647
1671
  if (!d || !d.request) return;
1648
- const o = d.request, p = Array.isArray(d.nodePath) ? d.nodePath : [], S = zt(d.child), A = {
1672
+ const o = d.request, p = Array.isArray(d.nodePath) ? d.nodePath : [], S = Tt(d.child), k = {
1649
1673
  ..._t(o.field, o.value, d.title || d.rowLabel, ""),
1650
1674
  label: Q(d.title || d.rowLabel || o.value),
1651
1675
  sourceRowPath: Array.isArray(o.pathValues) ? o.pathValues.map(String).filter(Boolean) : [],
1652
1676
  sourcePathFields: Array.isArray(o.pathFields) ? o.pathFields.map(String).filter(Boolean) : [],
1653
1677
  child: S
1654
1678
  }, P = (G) => {
1655
- const ce = Array.isArray(G.branches) ? G.branches : [], Je = ce.findIndex(
1679
+ const de = Array.isArray(G.branches) ? G.branches : [], Je = de.findIndex(
1656
1680
  /** @param {any} [branch] @returns {any} */
1657
- (he) => Ze(he, o.field, o.value)
1681
+ (ve) => Xe(ve, o.field, o.value)
1658
1682
  );
1659
1683
  return Je >= 0 ? {
1660
1684
  ...G,
1661
- branches: ce.map(
1685
+ branches: de.map(
1662
1686
  /** @param {any} [branch] @param {any} [index] @returns {any} */
1663
- (he, mt) => mt === Je ? { ...A, _id: he._id || A._id } : he
1687
+ (ve, Et) => Et === Je ? { ...k, _id: ve._id || k._id } : ve
1664
1688
  )
1665
1689
  } : {
1666
1690
  ...G,
1667
- branches: [...ce, A]
1691
+ branches: [...de, k]
1668
1692
  };
1669
- }, _ = O(b, p, P), be = Ye(_, { allFields: W, valConfigs: s, data: i });
1670
- if (!be.valid) {
1671
- c && c(be.errors[0] || "Fix report validation errors before applying.", "error");
1693
+ }, z = _(g, p, P), he = Ze(z, { allFields: O, valConfigs: s, data: i });
1694
+ if (!he.valid) {
1695
+ c && c(he.errors[0] || "Fix report validation errors before applying.", "error");
1672
1696
  return;
1673
1697
  }
1674
1698
  $(
1675
1699
  /** @param {any} [prevRoot] @returns {any} */
1676
- (G) => O(G, p, P)
1677
- ), k(null), C(null), c && c(`Applied settings for ${d.rowLabel || "row"}`, "info");
1678
- }, [W, i, b, d, $, c, s]), qe = B(() => {
1679
- if (!b || !b.field) return;
1680
- if (!K.valid) {
1681
- c && c(K.errors[0] || "Fix report validation errors before saving.", "error");
1700
+ (G) => _(G, p, P)
1701
+ ), A(null), w(null), c && c(`Applied settings for ${d.rowLabel || "row"}`, "info");
1702
+ }, [O, i, g, d, $, c, s]), Ke = B(() => {
1703
+ if (!g || !g.field) return;
1704
+ if (!J.valid) {
1705
+ c && c(J.errors[0] || "Fix report validation errors before saving.", "error");
1682
1706
  return;
1683
1707
  }
1684
1708
  const o = `report-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 6)}`, p = D.trim() || `Report ${(F || []).length + 1}`;
@@ -1688,19 +1712,19 @@ function Ut({
1688
1712
  id: o,
1689
1713
  name: p,
1690
1714
  reportDef: JSON.parse(JSON.stringify(e)),
1691
- layout: St(f, s),
1715
+ layout: wt(f, s),
1692
1716
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
1693
1717
  }
1694
- ]), w(o), R(""), c && c(`Report "${p}" saved`, "info");
1695
- }, [f, s, e, D, K, b, F, w, N, c]);
1696
- return /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "18px", padding: "2px 0 8px" } }, (F || []).length > 0 && /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(r) }, /* @__PURE__ */ t.createElement(v.Save, null), " Saved Reports"), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "6px" } }, (F || []).map(
1718
+ ]), C(o), R(""), c && c(`Report "${p}" saved`, "info");
1719
+ }, [f, s, e, D, J, g, F, C, N, c]);
1720
+ return /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "18px", padding: "2px 0 8px" } }, (F || []).length > 0 && /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(r) }, /* @__PURE__ */ t.createElement(m.Save, null), " Saved Reports"), /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "6px" } }, (F || []).map(
1697
1721
  /** @param {any} [report] @returns {any} */
1698
1722
  (o) => /* @__PURE__ */ t.createElement(
1699
1723
  "div",
1700
1724
  {
1701
1725
  key: o.id,
1702
1726
  onClick: () => {
1703
- Ct(o, { setReportDef: l, setActiveReportId: w, setColFields: m, setValConfigs: g }), k(null), C({ type: "node", path: [] });
1727
+ Ct(o, { setReportDef: l, setActiveReportId: C, setColFields: E, setValConfigs: b }), A(null), w({ type: "node", path: [] });
1704
1728
  },
1705
1729
  style: {
1706
1730
  display: "flex",
@@ -1713,7 +1737,7 @@ function Ut({
1713
1737
  border: `1px solid ${o.id === y ? r.primary || "#2563EB" : r.border}`
1714
1738
  }
1715
1739
  },
1716
- /* @__PURE__ */ t.createElement(v.Report, null),
1740
+ /* @__PURE__ */ t.createElement(m.Report, null),
1717
1741
  /* @__PURE__ */ t.createElement("div", { style: { flex: 1, minWidth: 0, fontSize: "12px", fontWeight: 700, color: r.text, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, o.name),
1718
1742
  /* @__PURE__ */ t.createElement(
1719
1743
  "button",
@@ -1724,39 +1748,39 @@ function Ut({
1724
1748
  /** @param {any} [prev] @returns {any} */
1725
1749
  (S) => (S || []).filter(
1726
1750
  /** @param {any} [current] @returns {any} */
1727
- (A) => A.id !== o.id
1751
+ (k) => k.id !== o.id
1728
1752
  )
1729
- ), y === o.id && w(null);
1753
+ ), y === o.id && C(null);
1730
1754
  },
1731
1755
  style: { background: "none", border: "none", cursor: "pointer", color: "#B91C1C", padding: "2px", flexShrink: 0 }
1732
1756
  },
1733
- /* @__PURE__ */ t.createElement(v.Delete, null)
1757
+ /* @__PURE__ */ t.createElement(m.Delete, null)
1734
1758
  )
1735
1759
  )
1736
1760
  ))), /* @__PURE__ */ t.createElement(
1737
- re,
1761
+ ne,
1738
1762
  {
1739
1763
  theme: r,
1740
1764
  sectionId: "report-levels",
1741
1765
  title: "Report Levels",
1742
1766
  description: "Default hierarchy applied to every row unless a row override changes its children.",
1743
- icon: /* @__PURE__ */ t.createElement(v.ReportLevel, null),
1744
- action: b && /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "8px", flexWrap: "wrap", justifyContent: "flex-end" } }, typeof u == "function" && /* @__PURE__ */ t.createElement(
1767
+ icon: /* @__PURE__ */ t.createElement(m.ReportLevel, null),
1768
+ action: g && /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "8px", flexWrap: "wrap", justifyContent: "flex-end" } }, typeof u == "function" && /* @__PURE__ */ t.createElement(
1745
1769
  "button",
1746
1770
  {
1747
1771
  type: "button",
1748
1772
  onClick: () => u((o) => o === !1),
1749
- style: j(r, h !== !1, !1),
1750
- title: h !== !1 ? "Hide row gear column" : "Show row gear column"
1773
+ style: j(r, v !== !1, !1),
1774
+ title: v !== !1 ? "Hide row gear column" : "Show row gear column"
1751
1775
  },
1752
- /* @__PURE__ */ t.createElement(v.Settings, null),
1776
+ /* @__PURE__ */ t.createElement(m.Settings, null),
1753
1777
  " ",
1754
- h !== !1 ? "Hide row gears" : "Show row gears"
1778
+ v !== !1 ? "Hide row gears" : "Show row gears"
1755
1779
  ), /* @__PURE__ */ t.createElement(
1756
1780
  "button",
1757
1781
  {
1758
1782
  type: "button",
1759
- onClick: xt,
1783
+ onClick: bt,
1760
1784
  disabled: !I.length || !I[I.length - 1].node.field,
1761
1785
  style: {
1762
1786
  ...j(r, !1, !1),
@@ -1764,26 +1788,26 @@ function Ut({
1764
1788
  pointerEvents: !I.length || !I[I.length - 1].node.field ? "none" : "auto"
1765
1789
  }
1766
1790
  },
1767
- /* @__PURE__ */ t.createElement(v.Add, null),
1791
+ /* @__PURE__ */ t.createElement(m.Add, null),
1768
1792
  " Add next level"
1769
1793
  ))
1770
1794
  },
1771
- b ? /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, I.map(
1795
+ g ? /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, I.map(
1772
1796
  /** @param {any} [item] @returns {any} */
1773
1797
  (o) => /* @__PURE__ */ t.createElement(
1774
- it,
1798
+ st,
1775
1799
  {
1776
1800
  key: `default-level:${o.index}:${o.node._id}`,
1777
1801
  item: o,
1778
1802
  selected: !d && Z(x) === Z({ type: "node", path: o.path }),
1779
1803
  theme: r,
1780
- sortByOptions: xe,
1781
- getFieldLabel: U,
1782
- onSelect: () => yt(o.path),
1804
+ sortByOptions: be,
1805
+ getFieldLabel: ee,
1806
+ onSelect: () => xt(o.path),
1783
1807
  onDragStart: (
1784
1808
  /** @param {any} [event] @returns {any} */
1785
1809
  ((p) => {
1786
- ze(o.index), p.dataTransfer.effectAllowed = "move";
1810
+ Te(o.index), p.dataTransfer.effectAllowed = "move";
1787
1811
  })
1788
1812
  ),
1789
1813
  onDragOver: (
@@ -1793,41 +1817,43 @@ function Ut({
1793
1817
  onDrop: (
1794
1818
  /** @param {any} [event] @returns {any} */
1795
1819
  ((p) => {
1796
- p.preventDefault(), gt(st, o.index);
1820
+ p.preventDefault(), gt(ct, o.index);
1797
1821
  })
1798
1822
  )
1799
1823
  }
1800
1824
  )
1801
- )) : /* @__PURE__ */ t.createElement("div", { style: pe(r) }, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "14px", fontWeight: 800, color: r.text } }, "Level 1"), /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(r) }, "Break Down By"), /* @__PURE__ */ t.createElement(
1802
- "select",
1825
+ )) : /* @__PURE__ */ t.createElement("div", { style: ue(r) }, /* @__PURE__ */ t.createElement("div", { style: { fontSize: "14px", fontWeight: 800, color: r.text } }, "Level 1"), /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement("div", { style: L(r) }, "Break Down By"), /* @__PURE__ */ t.createElement(
1826
+ U,
1803
1827
  {
1828
+ size: "sm",
1829
+ "aria-label": "Level 1 field",
1804
1830
  value: "",
1805
1831
  onChange: (o) => {
1806
- o.target.value && ct(o.target.value);
1832
+ o.target.value && dt(o.target.value);
1807
1833
  },
1808
- style: q(r)
1834
+ style: { ...q(r), width: "100%" }
1809
1835
  },
1810
1836
  /* @__PURE__ */ t.createElement("option", { value: "" }, "Select field..."),
1811
- W.map(
1837
+ O.map(
1812
1838
  /** @param {any} [field] @returns {any} */
1813
- (o) => /* @__PURE__ */ t.createElement("option", { key: o, value: o }, U(o))
1839
+ (o) => /* @__PURE__ */ t.createElement("option", { key: o, value: o }, ee(o))
1814
1840
  )
1815
1841
  )))
1816
- ), b && /* @__PURE__ */ t.createElement(
1817
- re,
1842
+ ), g && /* @__PURE__ */ t.createElement(
1843
+ ne,
1818
1844
  {
1819
1845
  theme: r,
1820
1846
  sectionId: "report-outline",
1821
1847
  title: "Report Outline",
1822
1848
  description: "Default levels plus every row override, shown as a separate map of Default children.",
1823
- icon: /* @__PURE__ */ t.createElement(v.Report, null)
1849
+ icon: /* @__PURE__ */ t.createElement(m.Report, null)
1824
1850
  },
1825
- /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, ee.map(
1851
+ /* @__PURE__ */ t.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "8px" } }, te.map(
1826
1852
  /** @param {any} [item] @returns {any} */
1827
1853
  (o) => o.kind === "branch" ? /* @__PURE__ */ t.createElement(
1828
- Kt,
1854
+ Gt,
1829
1855
  {
1830
- key: `outline-branch:${le(o.nodePath)}:${o.branchIndex}:${o.branch._id}`,
1856
+ key: `outline-branch:${re(o.nodePath)}:${o.branchIndex}:${o.branch._id}`,
1831
1857
  item: o,
1832
1858
  selected: !d && Z(x) === Z({
1833
1859
  type: "branch",
@@ -1835,116 +1861,116 @@ function Ut({
1835
1861
  branchIndex: o.branchIndex
1836
1862
  }),
1837
1863
  theme: r,
1838
- onSelect: () => Ve(o)
1864
+ onSelect: () => qe(o)
1839
1865
  }
1840
1866
  ) : /* @__PURE__ */ t.createElement(
1841
1867
  Jt,
1842
1868
  {
1843
- key: `outline-node:${le(o.nodePath)}:${o.node._id}`,
1869
+ key: `outline-node:${re(o.nodePath)}:${o.node._id}`,
1844
1870
  item: o,
1845
1871
  selected: !d && Z(x) === Z({ type: "node", path: o.nodePath }),
1846
1872
  theme: r,
1847
- sortByOptions: xe,
1848
- getFieldLabel: U,
1849
- onSelect: () => Ve(o)
1873
+ sortByOptions: be,
1874
+ getFieldLabel: ee,
1875
+ onSelect: () => qe(o)
1850
1876
  }
1851
1877
  )
1852
1878
  ))
1853
- ), b && d && /* @__PURE__ */ t.createElement("div", { ref: ye }, /* @__PURE__ */ t.createElement(
1854
- re,
1879
+ ), g && d && /* @__PURE__ */ t.createElement("div", { ref: xe }, /* @__PURE__ */ t.createElement(
1880
+ ne,
1855
1881
  {
1856
1882
  theme: r,
1857
1883
  sectionId: "selected-row",
1858
1884
  title: "Selected Row",
1859
1885
  description: "Configure Custom children for the row gear you clicked.",
1860
- icon: /* @__PURE__ */ t.createElement(v.Settings, null)
1886
+ icon: /* @__PURE__ */ t.createElement(m.Settings, null)
1861
1887
  },
1862
1888
  /* @__PURE__ */ t.createElement(
1863
- Yt,
1889
+ Zt,
1864
1890
  {
1865
1891
  draft: d,
1866
- allFields: W,
1867
- getFieldLabel: U,
1868
- sortByOptions: xe,
1892
+ allFields: O,
1893
+ getFieldLabel: ee,
1894
+ sortByOptions: be,
1869
1895
  theme: r,
1870
- onChange: k,
1871
- onApply: vt,
1872
- onCancel: bt
1896
+ onChange: A,
1897
+ onApply: mt,
1898
+ onCancel: ht
1873
1899
  }
1874
1900
  )
1875
- )), b && !d && x && te && te.type === "node" && /* @__PURE__ */ t.createElement("div", { ref: ye }, /* @__PURE__ */ t.createElement(
1876
- re,
1901
+ )), g && !d && x && le && le.type === "node" && /* @__PURE__ */ t.createElement("div", { ref: xe }, /* @__PURE__ */ t.createElement(
1902
+ ne,
1877
1903
  {
1878
1904
  theme: r,
1879
1905
  sectionId: "selected-level",
1880
1906
  title: "Selected Level",
1881
1907
  description: "Edit the selected default level or override child level.",
1882
- icon: /* @__PURE__ */ t.createElement(v.Edit, null)
1908
+ icon: /* @__PURE__ */ t.createElement(m.Edit, null)
1883
1909
  },
1884
1910
  /* @__PURE__ */ t.createElement(
1885
- Gt,
1911
+ Yt,
1886
1912
  {
1887
1913
  item: I.find(
1888
1914
  /** @param {any} [item] @returns {any} */
1889
- (o) => we(o.path, x.path)
1890
- ) || (se ? { ...se, path: se.nodePath } : { path: x.path, levelNumber: x.path.length + 1 }),
1891
- node: te.node,
1892
- allFields: W,
1893
- getFieldLabel: U,
1894
- sortByOptions: xe,
1915
+ (o) => Ae(o.path, x.path)
1916
+ ) || (ce ? { ...ce, path: ce.nodePath } : { path: x.path, levelNumber: x.path.length + 1 }),
1917
+ node: le.node,
1918
+ allFields: O,
1919
+ getFieldLabel: ee,
1920
+ sortByOptions: be,
1895
1921
  theme: r,
1896
1922
  onUpdate: (
1897
1923
  /** @param {any} [nextNode] @returns {any} */
1898
- ((o) => Me(x.path, o))
1924
+ ((o) => He(x.path, o))
1899
1925
  ),
1900
- onApply: ht,
1901
- onRemove: () => ut(x.path),
1902
- onEditFilter: () => fe(x.path),
1926
+ onApply: vt,
1927
+ onRemove: () => ft(x.path),
1928
+ onEditFilter: () => ye(x.path),
1903
1929
  titleLabel: "Title"
1904
1930
  }
1905
1931
  )
1906
- )), b && !d && x && te && te.type === "branch" && se && /* @__PURE__ */ t.createElement("div", { ref: ye }, /* @__PURE__ */ t.createElement(
1907
- re,
1932
+ )), g && !d && x && le && le.type === "branch" && ce && /* @__PURE__ */ t.createElement("div", { ref: xe }, /* @__PURE__ */ t.createElement(
1933
+ ne,
1908
1934
  {
1909
1935
  theme: r,
1910
1936
  sectionId: "row-override",
1911
1937
  title: "Row Override",
1912
1938
  description: "Override applies to this row only. Configure its rule and Custom children.",
1913
- icon: /* @__PURE__ */ t.createElement(v.Settings, null)
1939
+ icon: /* @__PURE__ */ t.createElement(m.Settings, null)
1914
1940
  },
1915
1941
  /* @__PURE__ */ t.createElement(
1916
- Zt,
1942
+ Xt,
1917
1943
  {
1918
- item: se,
1919
- branch: te.branch,
1944
+ item: ce,
1945
+ branch: le.branch,
1920
1946
  theme: r,
1921
1947
  onUpdate: (
1922
1948
  /** @param {any} [nextBranch] @returns {any} */
1923
- ((o) => He(x.nodePath, x.branchIndex, o))
1949
+ ((o) => Ve(x.nodePath, x.branchIndex, o))
1924
1950
  ),
1925
- onEditCondition: () => ue({ nodePath: x.nodePath, branchIndex: x.branchIndex }),
1926
- onOpenCustomChildren: () => dt(x.nodePath, x.branchIndex, !!te.branch.child),
1927
- onRemoveCustomChildren: () => pt(x.nodePath, x.branchIndex),
1928
- onRemove: () => ft(x.nodePath, x.branchIndex)
1951
+ onEditCondition: () => fe({ nodePath: x.nodePath, branchIndex: x.branchIndex }),
1952
+ onOpenCustomChildren: () => pt(x.nodePath, x.branchIndex, !!le.branch.child),
1953
+ onRemoveCustomChildren: () => ut(x.nodePath, x.branchIndex),
1954
+ onRemove: () => yt(x.nodePath, x.branchIndex)
1929
1955
  }
1930
1956
  )
1931
1957
  )), /* @__PURE__ */ t.createElement(
1932
- re,
1958
+ ne,
1933
1959
  {
1934
1960
  theme: r,
1935
1961
  sectionId: "save-report",
1936
1962
  title: "Save Report",
1937
1963
  description: "Store the current report levels and row overrides.",
1938
- icon: /* @__PURE__ */ t.createElement(v.Save, null)
1964
+ icon: /* @__PURE__ */ t.createElement(m.Save, null)
1939
1965
  },
1940
- /* @__PURE__ */ t.createElement(Vt, { validation: K, theme: r }),
1966
+ /* @__PURE__ */ t.createElement(qt, { validation: J, theme: r }),
1941
1967
  /* @__PURE__ */ t.createElement("div", { style: { display: "flex", gap: "8px" } }, /* @__PURE__ */ t.createElement(
1942
1968
  "input",
1943
1969
  {
1944
1970
  value: D,
1945
1971
  onChange: (o) => R(o.target.value),
1946
1972
  onKeyDown: (o) => {
1947
- o.key === "Enter" && qe();
1973
+ o.key === "Enter" && Ke();
1948
1974
  },
1949
1975
  placeholder: "Report name...",
1950
1976
  style: { ...q(r), flex: 1 }
@@ -1953,8 +1979,8 @@ function Ut({
1953
1979
  "button",
1954
1980
  {
1955
1981
  type: "button",
1956
- onClick: qe,
1957
- disabled: !b || !b.field || !K.valid,
1982
+ onClick: Ke,
1983
+ disabled: !g || !g.field || !J.valid,
1958
1984
  style: {
1959
1985
  display: "inline-flex",
1960
1986
  alignItems: "center",
@@ -1967,55 +1993,55 @@ function Ut({
1967
1993
  fontWeight: 800,
1968
1994
  color: "#fff",
1969
1995
  cursor: "pointer",
1970
- opacity: !b || !b.field || !K.valid ? 0.5 : 1
1996
+ opacity: !g || !g.field || !J.valid ? 0.5 : 1
1971
1997
  }
1972
1998
  },
1973
- /* @__PURE__ */ t.createElement(v.Save, null),
1999
+ /* @__PURE__ */ t.createElement(m.Save, null),
1974
2000
  " Save"
1975
2001
  ))
1976
- ), J && Ae && /* @__PURE__ */ t.createElement(
1977
- Ie,
2002
+ ), K && $e && /* @__PURE__ */ t.createElement(
2003
+ Pe,
1978
2004
  {
1979
- condition: Ae.condition,
1980
- allFields: W,
1981
- getFieldLabel: U,
2005
+ condition: $e.condition,
2006
+ allFields: O,
2007
+ getFieldLabel: ee,
1982
2008
  theme: r,
1983
2009
  onSave: (
1984
2010
  /** @param {any} [nextCondition] @returns {any} */
1985
2011
  ((o) => {
1986
- He(J.nodePath, J.branchIndex, {
1987
- ...Ae,
2012
+ Ve(K.nodePath, K.branchIndex, {
2013
+ ...$e,
1988
2014
  condition: o
1989
2015
  });
1990
2016
  })
1991
2017
  ),
1992
- onClose: () => ue(null)
2018
+ onClose: () => fe(null)
1993
2019
  }
1994
- ), oe && (() => {
1995
- const o = ne(b, oe);
2020
+ ), ie && (() => {
2021
+ const o = ae(g, ie);
1996
2022
  return o ? /* @__PURE__ */ t.createElement(
1997
- Ie,
2023
+ Pe,
1998
2024
  {
1999
2025
  title: "Edit level filter",
2000
2026
  description: "Rows that don't match are grouped into 'Others' to keep totals intact. Applies to this level and all its children.",
2001
- condition: o.filters || Pe(),
2002
- allFields: W,
2003
- getFieldLabel: U,
2027
+ condition: o.filters || Le(),
2028
+ allFields: O,
2029
+ getFieldLabel: ee,
2004
2030
  theme: r,
2005
2031
  onSave: (
2006
2032
  /** @param {any} [nextCondition] @returns {any} */
2007
2033
  ((p) => {
2008
- Me(oe, {
2034
+ He(ie, {
2009
2035
  ...o,
2010
2036
  filters: p.clauses.length > 0 ? p : null
2011
2037
  });
2012
2038
  })
2013
2039
  ),
2014
- onClose: () => fe(null)
2040
+ onClose: () => ye(null)
2015
2041
  }
2016
2042
  ) : null;
2017
2043
  })());
2018
2044
  }
2019
2045
  export {
2020
- Ut as ReportEditor
2046
+ el as ReportEditor
2021
2047
  };