@sisense/sdk-ui 2.28.0 → 2.29.0

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 (98) hide show
  1. package/dist/ai.cjs +1 -1
  2. package/dist/ai.js +5 -5
  3. package/dist/analytics-composer/node.cjs +1 -1
  4. package/dist/analytics-composer/node.js +1256 -1203
  5. package/dist/analytics-composer.cjs +7 -7
  6. package/dist/analytics-composer.js +19 -18
  7. package/dist/apply-styled-options-to-query-CaP4IMrQ.js +6379 -0
  8. package/dist/apply-styled-options-to-query-D5D8pRl2.cjs +1 -0
  9. package/dist/index.cjs +398 -398
  10. package/dist/index.js +22490 -21772
  11. package/dist/index.umd.js +700 -700
  12. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/get-dashboard-model.d.ts +7 -0
  13. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +2 -2
  14. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +10 -1
  15. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +29 -1
  16. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-updates-persistence.d.ts +27 -0
  17. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/deep-merge.d.ts +17 -0
  18. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +15 -0
  19. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/update-types.d.ts +51 -0
  20. package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/data.d.ts +0 -1
  21. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data/filter-and-aggregate-chart-data.d.ts +2 -2
  22. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +27 -23
  23. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/utils.d.ts +4 -4
  24. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/filter-to-readable-label.d.ts +14 -0
  25. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +1 -0
  26. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +5 -0
  27. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill.d.ts +5 -0
  28. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/truncate-pill-label.d.ts +10 -0
  29. package/dist/packages/sdk-ui/src/domains/widgets/change-events.d.ts +6 -0
  30. package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/types.d.ts +11 -0
  31. package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/pivot-table-widget.d.ts +15 -0
  32. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +41 -2
  33. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +6 -0
  34. package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-track-widget-init.d.ts +44 -0
  35. package/dist/packages/sdk-ui/src/domains/widgets/hooks/widget-entity-id.d.ts +30 -0
  36. package/dist/packages/sdk-ui/src/domains/widgets/hooks/widget-tracking-adapters.d.ts +41 -0
  37. package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-style-utils.d.ts +29 -0
  38. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +29 -1
  39. package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +2 -1
  40. package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +1 -7
  41. package/dist/packages/sdk-ui/src/infra/app/settings/types/features.d.ts +1 -9
  42. package/dist/packages/sdk-ui/src/infra/app/types.d.ts +14 -0
  43. package/dist/packages/sdk-ui/src/infra/contexts/sisense-context/sisense-context-provider.d.ts +1 -1
  44. package/dist/packages/sdk-ui/src/infra/formatting/format-data-set.d.ts +21 -0
  45. package/dist/packages/sdk-ui/src/infra/formatting/format-date.d.ts +67 -0
  46. package/dist/packages/sdk-ui/src/infra/formatting/format-number.d.ts +24 -0
  47. package/dist/packages/sdk-ui/src/infra/formatting/index.d.ts +5 -0
  48. package/dist/packages/sdk-ui/src/infra/modules/build-module-graph.d.ts +31 -0
  49. package/dist/packages/sdk-ui/src/infra/modules/build-module-registry.d.ts +31 -0
  50. package/dist/packages/sdk-ui/src/infra/modules/core-module-providers-tree.d.ts +11 -0
  51. package/dist/packages/sdk-ui/src/infra/modules/core-module.d.ts +26 -0
  52. package/dist/packages/sdk-ui/src/infra/modules/index.d.ts +3 -0
  53. package/dist/packages/sdk-ui/src/infra/modules/module-provider.d.ts +17 -0
  54. package/dist/packages/sdk-ui/src/infra/modules/modules-context.d.ts +20 -0
  55. package/dist/packages/sdk-ui/src/infra/modules/types.d.ts +79 -0
  56. package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +52 -2
  57. package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/widget-plugin-registry.d.ts +3 -3
  58. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/dimensions/get-dimension-name.d.ts +9 -0
  59. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/dimensions/translate-dimensions-to-json.d.ts +4 -3
  60. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/filters/get-filter-name.d.ts +10 -0
  61. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/filters/translate-filters-to-json.d.ts +3 -3
  62. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/get-query-element-summary.d.ts +23 -0
  63. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/measures/get-measure-name.d.ts +10 -0
  64. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/constructs/measures/translate-measures-to-json.d.ts +4 -3
  65. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/index.d.ts +3 -1
  66. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-from-json.d.ts +1 -1
  67. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/translate-query-to-json.d.ts +4 -3
  68. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/adapters.d.ts +3 -2
  69. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/data-options/index.d.ts +1 -1
  70. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +70 -9
  71. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/to-widget-props.d.ts +3 -3
  72. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/widget/helpers/translate-envelope-widget-from-json.d.ts +2 -3
  73. package/dist/packages/sdk-ui/src/modules/analytics-composer/types.d.ts +1 -18
  74. package/dist/packages/sdk-ui/src/props.d.ts +9 -0
  75. package/dist/packages/sdk-ui/src/public-api/alpha.d.ts +3 -0
  76. package/dist/packages/sdk-ui/src/public-api/public.d.ts +3 -1
  77. package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +1 -1
  78. package/dist/packages/sdk-ui/src/shared/components/loading-overlay.d.ts +1 -0
  79. package/dist/packages/sdk-ui/src/shared/hooks/use-element-height.d.ts +19 -0
  80. package/dist/packages/sdk-ui/src/shared/hooks/use-synced-state.d.ts +23 -2
  81. package/dist/packages/sdk-ui/src/shared/utils/filter-relations.d.ts +8 -0
  82. package/dist/packages/sdk-ui/src/shared/utils/gradient.d.ts +5 -0
  83. package/dist/types-7YG0uOzO.js +74 -0
  84. package/dist/{types-CzgBH2kL.cjs → types-DlYJ_DZ0.cjs} +1 -1
  85. package/dist/{use-hover-CaSOzp0i.cjs → use-hover-CANskYrn.cjs} +127 -127
  86. package/dist/{use-hover-B6VmMb06.js → use-hover-Dju4Dcv3.js} +11021 -10942
  87. package/dist/{utils-CsV-iYtb.js → utils-BKRpWUGm.js} +1061 -1058
  88. package/dist/{utils-BwGnDoB0.cjs → utils-C4PIba42.cjs} +10 -10
  89. package/dist/{widget-composer-C72Io-3c.cjs → widget-composer-BXEyx308.cjs} +1 -1
  90. package/dist/{widget-composer-Bv_OVu1o.js → widget-composer-DRDw1oBF.js} +3 -3
  91. package/package.json +9 -8
  92. package/dist/apply-styled-options-to-query-23D9br-S.cjs +0 -1
  93. package/dist/apply-styled-options-to-query-BagjzMqm.js +0 -5992
  94. package/dist/dimensions-Bn1EaWiP.js +0 -204
  95. package/dist/dimensions-D8r34WRI.cjs +0 -1
  96. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-scroll-persistence.d.ts +0 -16
  97. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/with-navigator-scroll-save.d.ts +0 -10
  98. package/dist/types-D3fPN43o.js +0 -74
@@ -1,54 +1,53 @@
1
- var sr = Object.defineProperty, nr = Object.defineProperties;
2
- var ir = Object.getOwnPropertyDescriptors;
3
- var ie = Object.getOwnPropertySymbols;
4
- var We = Object.prototype.hasOwnProperty, Ve = Object.prototype.propertyIsEnumerable;
5
- var Pe = (e, t, r) => t in e ? sr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, l = (e, t) => {
1
+ var ur = Object.defineProperty, cr = Object.defineProperties;
2
+ var lr = Object.getOwnPropertyDescriptors;
3
+ var ae = Object.getOwnPropertySymbols;
4
+ var Je = Object.prototype.hasOwnProperty, Ke = Object.prototype.propertyIsEnumerable;
5
+ var je = (e, t, r) => t in e ? ur(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, l = (e, t) => {
6
6
  for (var r in t || (t = {}))
7
- We.call(t, r) && Pe(e, r, t[r]);
8
- if (ie)
9
- for (var r of ie(t))
10
- Ve.call(t, r) && Pe(e, r, t[r]);
7
+ Je.call(t, r) && je(e, r, t[r]);
8
+ if (ae)
9
+ for (var r of ae(t))
10
+ Ke.call(t, r) && je(e, r, t[r]);
11
11
  return e;
12
- }, F = (e, t) => nr(e, ir(t));
13
- var ye = (e, t) => {
12
+ }, E = (e, t) => cr(e, lr(t));
13
+ var Fe = (e, t) => {
14
14
  var r = {};
15
15
  for (var s in e)
16
- We.call(e, s) && t.indexOf(s) < 0 && (r[s] = e[s]);
17
- if (e != null && ie)
18
- for (var s of ie(e))
19
- t.indexOf(s) < 0 && Ve.call(e, s) && (r[s] = e[s]);
16
+ Je.call(e, s) && t.indexOf(s) < 0 && (r[s] = e[s]);
17
+ if (e != null && ae)
18
+ for (var s of ae(e))
19
+ t.indexOf(s) < 0 && Ke.call(e, s) && (r[s] = e[s]);
20
20
  return r;
21
21
  };
22
- import { f as or, J as ar } from "../types-D3fPN43o.js";
23
- import { b as Bi, E as Li, a as zi, i as Ui, e as _i, d as Pi } from "../types-D3fPN43o.js";
24
- import { cj as ur, bs as cr, ck as lr, cl as dr, cm as fr, aw as De, cn as pr, av as mr, co as gr, bb as yr, ax as hr, cp as br, be as Er, bc as Fr, aO as Ar, ba as wr, bd as Tr, d as Sr, c as Cr, k as qr, cq as $r, cr as Or, cs as Dr, ct as xr, cu as vr, cv as Nr, cw as Mr, cx as Rr, cy as Ir, cz as kr, cA as Br, aq as Lr, cB as zr, cC as Ur, S as U, t as ee, h as _r, b as $, ai as _, at as ct, cD as Pr, cE as Wr, cF as Vr, M as j, cc as jr, cG as Jr, aK as Kr, aj as je, au as le, cg as Gr, ch as Yr, bQ as lt, cH as dt, ad as Hr, cI as ft, cJ as pt, A as Qr, b_ as mt, cK as Xr, bH as Zr, aD as es } from "../apply-styled-options-to-query-BagjzMqm.js";
25
- import { i as ts, b as rs, D as ss, d as ns, a as is } from "../dimensions-Bn1EaWiP.js";
26
- function os(e, t) {
27
- const r = e.length, s = t.length, n = Array.from({ length: r + 1 }, (i, o) => Array.from({ length: s + 1 }, (a, u) => o === 0 ? u : u === 0 ? o : 0));
22
+ import { f as fr, J as dr } from "../types-7YG0uOzO.js";
23
+ import { b as Ki, E as Gi, a as Yi, i as Hi, e as Qi, d as Xi } from "../types-7YG0uOzO.js";
24
+ import { ci as mr, bq as pr, cj as gr, ck as yr, cl as hr, cm as br, cn as Fr, at as ve, co as Er, as as Ar, cp as Tr, b9 as wr, au as Sr, cq as Cr, bc as Or, ba as qr, aM as $r, b8 as Dr, bb as xr, cr as Nr, aq as vr, bp as Mr, cs as Rr, e as Ir, ct as kr, cu as Lr, cv as Br, cw as zr, cx as Ur, cy as _r, cz as Pr, cA as Wr, cB as Vr, cC as jr, cD as Jr, al as Kr, cE as Gr, cF as Yr, ap as U, l as te, b as Hr, x as q, a1 as Qr, ad as _, ao as pt, cG as Xr, cH as Zr, cI as es, M as j, cb as ts, cJ as rs, aI as ss, af as Ge, ar as de, cf as ns, cg as is, bO as gt, cK as yt, a8 as as, cL as ht, cM as bt, A as os, bY as Ft, cN as us, bF as cs, aA as ls } from "../apply-styled-options-to-query-CaP4IMrQ.js";
25
+ function fs(e, t) {
26
+ const r = e.length, s = t.length, n = Array.from({ length: r + 1 }, (i, a) => Array.from({ length: s + 1 }, (o, u) => a === 0 ? u : u === 0 ? a : 0));
28
27
  for (let i = 1; i <= r; i++)
29
- for (let o = 1; o <= s; o++)
30
- n[i][o] = Math.min(n[i - 1][o] + 1, n[i][o - 1] + 1, n[i - 1][o - 1] + (e[i - 1] === t[o - 1] ? 0 : 1));
28
+ for (let a = 1; a <= s; a++)
29
+ n[i][a] = Math.min(n[i - 1][a] + 1, n[i][a - 1] + 1, n[i - 1][a - 1] + (e[i - 1] === t[a - 1] ? 0 : 1));
31
30
  return n[r][s];
32
31
  }
33
- function xe(e, t) {
32
+ function Me(e, t) {
34
33
  const r = [];
35
- let s = "", n = 0, i = !1, o = null;
36
- for (let a = 0; a < e.length; a++) {
37
- const u = e[a], c = e[a + 1];
34
+ let s = "", n = 0, i = !1, a = null;
35
+ for (let o = 0; o < e.length; o++) {
36
+ const u = e[o], c = e[o + 1];
38
37
  if (i) {
39
- if (u !== o) {
38
+ if (u !== a) {
40
39
  s += u;
41
40
  continue;
42
41
  }
43
- if (c === o) {
44
- s += u + c, a++;
42
+ if (c === a) {
43
+ s += u + c, o++;
45
44
  continue;
46
45
  }
47
- i = !1, o = null, s += u;
46
+ i = !1, a = null, s += u;
48
47
  continue;
49
48
  } else {
50
49
  if (u === "'" || u === '"') {
51
- i = !0, o = u, s += u;
50
+ i = !0, a = u, s += u;
52
51
  continue;
53
52
  }
54
53
  if ("([{".includes(u) && n++, ")]}".includes(u) && n--, u === t && n === 0) {
@@ -60,58 +59,58 @@ function xe(e, t) {
60
59
  }
61
60
  return s.trim() && r.push(s.trim()), r;
62
61
  }
63
- function as(e, t) {
62
+ function ds(e, t) {
64
63
  let r = 0, s = !1, n = null;
65
64
  for (let i = 0; i < e.length; i++) {
66
- const o = e[i], a = e[i + 1];
65
+ const a = e[i], o = e[i + 1];
67
66
  if (s) {
68
- if (o !== n)
67
+ if (a !== n)
69
68
  continue;
70
- if (a === n) {
69
+ if (o === n) {
71
70
  i++;
72
71
  continue;
73
72
  }
74
73
  s = !1, n = null;
75
74
  } else {
76
- if (o === "'" || o === '"') {
77
- s = !0, n = o;
75
+ if (a === "'" || a === '"') {
76
+ s = !0, n = a;
78
77
  continue;
79
78
  }
80
- if ("([{".includes(o) && r++, ")]}".includes(o) && r--, o === t && r === 0)
79
+ if ("([{".includes(a) && r++, ")]}".includes(a) && r--, a === t && r === 0)
81
80
  return i;
82
81
  }
83
82
  }
84
83
  return -1;
85
84
  }
86
- function us(e, t) {
85
+ function ms(e, t) {
87
86
  if (e[t] !== "(")
88
87
  return -1;
89
88
  let r = 1, s = t + 1, n = !1, i = null;
90
89
  for (; s < e.length; ) {
91
- const o = e[s], a = e[s + 1];
90
+ const a = e[s], o = e[s + 1];
92
91
  if (n) {
93
- if (o !== i) {
92
+ if (a !== i) {
94
93
  s++;
95
94
  continue;
96
95
  }
97
- if (a === i) {
96
+ if (o === i) {
98
97
  s += 2;
99
98
  continue;
100
99
  }
101
100
  n = !1, i = null, s++;
102
101
  } else {
103
- if (o === "'" || o === '"') {
104
- n = !0, i = o, s++;
102
+ if (a === "'" || a === '"') {
103
+ n = !0, i = a, s++;
105
104
  continue;
106
105
  }
107
- if ("([{".includes(o) && r++, ")]}".includes(o) && --r === 0)
106
+ if ("([{".includes(a) && r++, ")]}".includes(a) && --r === 0)
108
107
  return s;
109
108
  s++;
110
109
  }
111
110
  }
112
111
  return -1;
113
112
  }
114
- function cs(e) {
113
+ function ps(e) {
115
114
  return e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e;
116
115
  }
117
116
  function J(e) {
@@ -123,16 +122,16 @@ function J(e) {
123
122
  const r = t.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
124
123
  if (!r)
125
124
  throw new Error(`Invalid composeCode format: expected function call, got '${t}'`);
126
- const s = r[1], n = r[2], i = gt(n);
125
+ const s = r[1], n = r[2], i = Et(n);
127
126
  return {
128
127
  function: s,
129
128
  args: i
130
129
  };
131
130
  }
132
- function gt(e) {
133
- return e.trim() ? xe(e, ",").map(yt) : [];
131
+ function Et(e) {
132
+ return e.trim() ? Me(e, ",").map(At) : [];
134
133
  }
135
- function yt(e) {
134
+ function At(e) {
136
135
  if (!e)
137
136
  throw new Error("Cannot parse empty argument value");
138
137
  if (e === "null")
@@ -153,29 +152,29 @@ function yt(e) {
153
152
  const r = e.slice(1, -1).trim();
154
153
  if (!r)
155
154
  return [];
156
- const s = gt(r);
155
+ const s = Et(r);
157
156
  return s.every((n) => typeof n == "string"), s;
158
157
  }
159
158
  if (e.startsWith("{") && e.endsWith("}")) {
160
159
  const r = e.slice(1, -1).trim();
161
- return r ? ds(r) : {};
160
+ return r ? ys(r) : {};
162
161
  }
163
162
  return e.includes("(") && e.includes(")") ? J(e) : (e.startsWith("DM."), e);
164
163
  }
165
- function ls(e) {
166
- const t = as(e, ":");
164
+ function gs(e) {
165
+ const t = ds(e, ":");
167
166
  if (t === -1)
168
167
  throw new Error(`Invalid object property: expected 'key: value', got '${e}'`);
169
- const r = cs(e.slice(0, t).trim()), s = yt(e.slice(t + 1).trim());
168
+ const r = ps(e.slice(0, t).trim()), s = At(e.slice(t + 1).trim());
170
169
  return [r, s];
171
170
  }
172
- function ds(e) {
171
+ function ys(e) {
173
172
  if (!e.trim())
174
173
  return {};
175
- const t = xe(e, ",").map(ls).filter(([, r]) => r !== null);
174
+ const t = Me(e, ",").map(gs).filter(([, r]) => r !== null);
176
175
  return Object.fromEntries(t);
177
176
  }
178
- class fs {
177
+ class hs {
179
178
  constructor() {
180
179
  this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
181
180
  }
@@ -192,9 +191,9 @@ class fs {
192
191
  this.keyToValue.clear(), this.valueToKey.clear();
193
192
  }
194
193
  }
195
- class ht {
194
+ class Tt {
196
195
  constructor(t) {
197
- this.generateIdentifier = t, this.kv = new fs();
196
+ this.generateIdentifier = t, this.kv = new hs();
198
197
  }
199
198
  register(t, r) {
200
199
  this.kv.getByValue(t) || (r || (r = this.generateIdentifier(t)), this.kv.set(r, t));
@@ -209,7 +208,7 @@ class ht {
209
208
  return this.kv.getByKey(t);
210
209
  }
211
210
  }
212
- class ps extends ht {
211
+ class bs extends Tt {
213
212
  constructor() {
214
213
  super((t) => t.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
215
214
  }
@@ -220,7 +219,7 @@ class ps extends ht {
220
219
  return this.classToAllowedProps.get(t);
221
220
  }
222
221
  }
223
- function ms(e) {
222
+ function Fs(e) {
224
223
  if ("values" in Object)
225
224
  return Object.values(e);
226
225
  const t = [];
@@ -228,8 +227,8 @@ function ms(e) {
228
227
  e.hasOwnProperty(r) && t.push(e[r]);
229
228
  return t;
230
229
  }
231
- function gs(e, t) {
232
- const r = ms(e);
230
+ function Es(e, t) {
231
+ const r = Fs(e);
233
232
  if ("find" in r)
234
233
  return r.find(t);
235
234
  const s = r;
@@ -245,14 +244,14 @@ function K(e, t) {
245
244
  function oe(e, t) {
246
245
  return e.indexOf(t) !== -1;
247
246
  }
248
- function Je(e, t) {
247
+ function Ye(e, t) {
249
248
  for (let r = 0; r < e.length; r++) {
250
249
  const s = e[r];
251
250
  if (t(s))
252
251
  return s;
253
252
  }
254
253
  }
255
- class ys {
254
+ class As {
256
255
  constructor() {
257
256
  this.transfomers = {};
258
257
  }
@@ -260,13 +259,13 @@ class ys {
260
259
  this.transfomers[t.name] = t;
261
260
  }
262
261
  findApplicable(t) {
263
- return gs(this.transfomers, (r) => r.isApplicable(t));
262
+ return Es(this.transfomers, (r) => r.isApplicable(t));
264
263
  }
265
264
  findByName(t) {
266
265
  return this.transfomers[t];
267
266
  }
268
267
  }
269
- const hs = (e) => Object.prototype.toString.call(e).slice(8, -1), bt = (e) => typeof e == "undefined", bs = (e) => e === null, H = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, we = (e) => H(e) && Object.keys(e).length === 0, k = (e) => Array.isArray(e), Es = (e) => typeof e == "string", Fs = (e) => typeof e == "number" && !isNaN(e), As = (e) => typeof e == "boolean", ws = (e) => e instanceof RegExp, Q = (e) => e instanceof Map, X = (e) => e instanceof Set, Et = (e) => hs(e) === "Symbol", Ts = (e) => e instanceof Date && !isNaN(e.valueOf()), Ss = (e) => e instanceof Error, Ke = (e) => typeof e == "number" && isNaN(e), Cs = (e) => As(e) || bs(e) || bt(e) || Fs(e) || Es(e) || Et(e), qs = (e) => typeof e == "bigint", $s = (e) => e === 1 / 0 || e === -1 / 0, Os = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), Ds = (e) => e instanceof URL, Ft = (e) => e.replace(/\./g, "\\."), he = (e) => e.map(String).map(Ft).join("."), Y = (e) => {
268
+ const Ts = (e) => Object.prototype.toString.call(e).slice(8, -1), wt = (e) => typeof e == "undefined", ws = (e) => e === null, Q = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, Ce = (e) => Q(e) && Object.keys(e).length === 0, k = (e) => Array.isArray(e), Ss = (e) => typeof e == "string", Cs = (e) => typeof e == "number" && !isNaN(e), Os = (e) => typeof e == "boolean", qs = (e) => e instanceof RegExp, X = (e) => e instanceof Map, Z = (e) => e instanceof Set, St = (e) => Ts(e) === "Symbol", $s = (e) => e instanceof Date && !isNaN(e.valueOf()), Ds = (e) => e instanceof Error, He = (e) => typeof e == "number" && isNaN(e), xs = (e) => Os(e) || ws(e) || wt(e) || Cs(e) || Ss(e) || St(e), Ns = (e) => typeof e == "bigint", vs = (e) => e === 1 / 0 || e === -1 / 0, Ms = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), Rs = (e) => e instanceof URL, Ct = (e) => e.replace(/\./g, "\\."), Ee = (e) => e.map(String).map(Ct).join("."), Y = (e) => {
270
269
  const t = [];
271
270
  let r = "";
272
271
  for (let n = 0; n < e.length; n++) {
@@ -292,12 +291,12 @@ function I(e, t, r, s) {
292
291
  untransform: s
293
292
  };
294
293
  }
295
- const At = [
296
- I(bt, "undefined", () => null, () => {
294
+ const Ot = [
295
+ I(wt, "undefined", () => null, () => {
297
296
  }),
298
- I(qs, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
299
- I(Ts, "Date", (e) => e.toISOString(), (e) => new Date(e)),
300
- I(Ss, "Error", (e, t) => {
297
+ I(Ns, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
298
+ I($s, "Date", (e) => e.toISOString(), (e) => new Date(e)),
299
+ I(Ds, "Error", (e, t) => {
301
300
  const r = {
302
301
  name: e.name,
303
302
  message: e.message
@@ -311,24 +310,24 @@ const At = [
311
310
  r[s] = e[s];
312
311
  }), r;
313
312
  }),
314
- I(ws, "regexp", (e) => "" + e, (e) => {
313
+ I(qs, "regexp", (e) => "" + e, (e) => {
315
314
  const t = e.slice(1, e.lastIndexOf("/")), r = e.slice(e.lastIndexOf("/") + 1);
316
315
  return new RegExp(t, r);
317
316
  }),
318
317
  I(
319
- X,
318
+ Z,
320
319
  "set",
321
320
  // (sets only exist in es6+)
322
321
  // eslint-disable-next-line es5/no-es6-methods
323
322
  (e) => [...e.values()],
324
323
  (e) => new Set(e)
325
324
  ),
326
- I(Q, "map", (e) => [...e.entries()], (e) => new Map(e)),
327
- I((e) => Ke(e) || $s(e), "number", (e) => Ke(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
325
+ I(X, "map", (e) => [...e.entries()], (e) => new Map(e)),
326
+ I((e) => He(e) || vs(e), "number", (e) => He(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
328
327
  I((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
329
- I(Ds, "URL", (e) => e.toString(), (e) => new URL(e))
328
+ I(Rs, "URL", (e) => e.toString(), (e) => new URL(e))
330
329
  ];
331
- function de(e, t, r, s) {
330
+ function me(e, t, r, s) {
332
331
  return {
333
332
  isApplicable: e,
334
333
  annotation: t,
@@ -336,12 +335,12 @@ function de(e, t, r, s) {
336
335
  untransform: s
337
336
  };
338
337
  }
339
- const wt = de((e, t) => Et(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, r) => {
338
+ const qt = me((e, t) => St(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, r) => {
340
339
  const s = r.symbolRegistry.getValue(t[1]);
341
340
  if (!s)
342
341
  throw new Error("Trying to deserialize unknown symbol");
343
342
  return s;
344
- }), xs = [
343
+ }), Is = [
345
344
  Int8Array,
346
345
  Uint8Array,
347
346
  Int16Array,
@@ -351,16 +350,16 @@ const wt = de((e, t) => Et(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t)
351
350
  Float32Array,
352
351
  Float64Array,
353
352
  Uint8ClampedArray
354
- ].reduce((e, t) => (e[t.name] = t, e), {}), Tt = de(Os, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
355
- const r = xs[t[1]];
353
+ ].reduce((e, t) => (e[t.name] = t, e), {}), $t = me(Ms, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
354
+ const r = Is[t[1]];
356
355
  if (!r)
357
356
  throw new Error("Trying to deserialize unknown typed array");
358
357
  return new r(e);
359
358
  });
360
- function St(e, t) {
359
+ function Dt(e, t) {
361
360
  return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
362
361
  }
363
- const Ct = de(St, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
362
+ const xt = me(Dt, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
364
363
  const r = t.classRegistry.getAllowedProps(e.constructor);
365
364
  if (!r)
366
365
  return l({}, e);
@@ -373,44 +372,44 @@ const Ct = de(St, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructo
373
372
  if (!s)
374
373
  throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
375
374
  return Object.assign(Object.create(s.prototype), e);
376
- }), qt = de((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, r) => {
375
+ }), Nt = me((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, r) => {
377
376
  const s = r.customTransformerRegistry.findByName(t[1]);
378
377
  if (!s)
379
378
  throw new Error("Trying to deserialize unknown custom value");
380
379
  return s.deserialize(e);
381
- }), vs = [Ct, wt, qt, Tt], Ge = (e, t) => {
382
- const r = Je(vs, (n) => n.isApplicable(e, t));
380
+ }), ks = [xt, qt, Nt, $t], Qe = (e, t) => {
381
+ const r = Ye(ks, (n) => n.isApplicable(e, t));
383
382
  if (r)
384
383
  return {
385
384
  value: r.transform(e, t),
386
385
  type: r.annotation(e, t)
387
386
  };
388
- const s = Je(At, (n) => n.isApplicable(e, t));
387
+ const s = Ye(Ot, (n) => n.isApplicable(e, t));
389
388
  if (s)
390
389
  return {
391
390
  value: s.transform(e, t),
392
391
  type: s.annotation
393
392
  };
394
- }, $t = {};
395
- At.forEach((e) => {
396
- $t[e.annotation] = e;
393
+ }, vt = {};
394
+ Ot.forEach((e) => {
395
+ vt[e.annotation] = e;
397
396
  });
398
- const Ns = (e, t, r) => {
397
+ const Ls = (e, t, r) => {
399
398
  if (k(t))
400
399
  switch (t[0]) {
401
400
  case "symbol":
402
- return wt.untransform(e, t, r);
401
+ return qt.untransform(e, t, r);
403
402
  case "class":
404
- return Ct.untransform(e, t, r);
403
+ return xt.untransform(e, t, r);
405
404
  case "custom":
406
- return qt.untransform(e, t, r);
405
+ return Nt.untransform(e, t, r);
407
406
  case "typed-array":
408
- return Tt.untransform(e, t, r);
407
+ return $t.untransform(e, t, r);
409
408
  default:
410
409
  throw new Error("Unknown transformation: " + t);
411
410
  }
412
411
  else {
413
- const s = $t[t];
412
+ const s = vt[t];
414
413
  if (!s)
415
414
  throw new Error("Unknown transformation: " + t);
416
415
  return s.untransform(e, r);
@@ -423,7 +422,7 @@ const Ns = (e, t, r) => {
423
422
  r.next(), t--;
424
423
  return r.next().value;
425
424
  };
426
- function Ot(e) {
425
+ function Mt(e) {
427
426
  if (oe(e, "__proto__"))
428
427
  throw new Error("__proto__ is not allowed as a property");
429
428
  if (oe(e, "prototype"))
@@ -431,44 +430,44 @@ function Ot(e) {
431
430
  if (oe(e, "constructor"))
432
431
  throw new Error("constructor is not allowed as a property");
433
432
  }
434
- const Ms = (e, t) => {
435
- Ot(t);
433
+ const Bs = (e, t) => {
434
+ Mt(t);
436
435
  for (let r = 0; r < t.length; r++) {
437
436
  const s = t[r];
438
- if (X(e))
437
+ if (Z(e))
439
438
  e = V(e, +s);
440
- else if (Q(e)) {
441
- const n = +s, i = +t[++r] == 0 ? "key" : "value", o = V(e, n);
439
+ else if (X(e)) {
440
+ const n = +s, i = +t[++r] == 0 ? "key" : "value", a = V(e, n);
442
441
  switch (i) {
443
442
  case "key":
444
- e = o;
443
+ e = a;
445
444
  break;
446
445
  case "value":
447
- e = e.get(o);
446
+ e = e.get(a);
448
447
  break;
449
448
  }
450
449
  } else
451
450
  e = e[s];
452
451
  }
453
452
  return e;
454
- }, Te = (e, t, r) => {
455
- if (Ot(t), t.length === 0)
453
+ }, Oe = (e, t, r) => {
454
+ if (Mt(t), t.length === 0)
456
455
  return r(e);
457
456
  let s = e;
458
457
  for (let i = 0; i < t.length - 1; i++) {
459
- const o = t[i];
458
+ const a = t[i];
460
459
  if (k(s)) {
461
- const a = +o;
462
- s = s[a];
463
- } else if (H(s))
460
+ const o = +a;
464
461
  s = s[o];
465
- else if (X(s)) {
466
- const a = +o;
467
- s = V(s, a);
468
- } else if (Q(s)) {
462
+ } else if (Q(s))
463
+ s = s[a];
464
+ else if (Z(s)) {
465
+ const o = +a;
466
+ s = V(s, o);
467
+ } else if (X(s)) {
469
468
  if (i === t.length - 2)
470
469
  break;
471
- const u = +o, c = +t[++i] == 0 ? "key" : "value", g = V(s, u);
470
+ const u = +a, c = +t[++i] == 0 ? "key" : "value", g = V(s, u);
472
471
  switch (c) {
473
472
  case "key":
474
473
  s = g;
@@ -480,130 +479,130 @@ const Ms = (e, t) => {
480
479
  }
481
480
  }
482
481
  const n = t[t.length - 1];
483
- if (k(s) ? s[+n] = r(s[+n]) : H(s) && (s[n] = r(s[n])), X(s)) {
484
- const i = V(s, +n), o = r(i);
485
- i !== o && (s.delete(i), s.add(o));
482
+ if (k(s) ? s[+n] = r(s[+n]) : Q(s) && (s[n] = r(s[n])), Z(s)) {
483
+ const i = V(s, +n), a = r(i);
484
+ i !== a && (s.delete(i), s.add(a));
486
485
  }
487
- if (Q(s)) {
488
- const i = +t[t.length - 2], o = V(s, i);
486
+ if (X(s)) {
487
+ const i = +t[t.length - 2], a = V(s, i);
489
488
  switch (+n == 0 ? "key" : "value") {
490
489
  case "key": {
491
- const u = r(o);
492
- s.set(u, s.get(o)), u !== o && s.delete(o);
490
+ const u = r(a);
491
+ s.set(u, s.get(a)), u !== a && s.delete(a);
493
492
  break;
494
493
  }
495
494
  case "value": {
496
- s.set(o, r(s.get(o)));
495
+ s.set(a, r(s.get(a)));
497
496
  break;
498
497
  }
499
498
  }
500
499
  }
501
500
  return e;
502
501
  };
503
- function Se(e, t, r = []) {
502
+ function qe(e, t, r = []) {
504
503
  if (!e)
505
504
  return;
506
505
  if (!k(e)) {
507
- K(e, (i, o) => Se(i, t, [...r, ...Y(o)]));
506
+ K(e, (i, a) => qe(i, t, [...r, ...Y(a)]));
508
507
  return;
509
508
  }
510
509
  const [s, n] = e;
511
- n && K(n, (i, o) => {
512
- Se(i, t, [...r, ...Y(o)]);
510
+ n && K(n, (i, a) => {
511
+ qe(i, t, [...r, ...Y(a)]);
513
512
  }), t(s, r);
514
513
  }
515
- function Rs(e, t, r) {
516
- return Se(t, (s, n) => {
517
- e = Te(e, n, (i) => Ns(i, s, r));
514
+ function zs(e, t, r) {
515
+ return qe(t, (s, n) => {
516
+ e = Oe(e, n, (i) => Ls(i, s, r));
518
517
  }), e;
519
518
  }
520
- function Is(e, t) {
519
+ function Us(e, t) {
521
520
  function r(s, n) {
522
- const i = Ms(e, Y(n));
523
- s.map(Y).forEach((o) => {
524
- e = Te(e, o, () => i);
521
+ const i = Bs(e, Y(n));
522
+ s.map(Y).forEach((a) => {
523
+ e = Oe(e, a, () => i);
525
524
  });
526
525
  }
527
526
  if (k(t)) {
528
527
  const [s, n] = t;
529
528
  s.forEach((i) => {
530
- e = Te(e, Y(i), () => e);
529
+ e = Oe(e, Y(i), () => e);
531
530
  }), n && K(n, r);
532
531
  } else
533
532
  K(t, r);
534
533
  return e;
535
534
  }
536
- const ks = (e, t) => H(e) || k(e) || Q(e) || X(e) || St(e, t);
537
- function Bs(e, t, r) {
535
+ const _s = (e, t) => Q(e) || k(e) || X(e) || Z(e) || Dt(e, t);
536
+ function Ps(e, t, r) {
538
537
  const s = r.get(e);
539
538
  s ? s.push(t) : r.set(e, [t]);
540
539
  }
541
- function Ls(e, t) {
540
+ function Ws(e, t) {
542
541
  const r = {};
543
542
  let s;
544
543
  return e.forEach((n) => {
545
544
  if (n.length <= 1)
546
545
  return;
547
- t || (n = n.map((a) => a.map(String)).sort((a, u) => a.length - u.length));
548
- const [i, ...o] = n;
549
- i.length === 0 ? s = o.map(he) : r[he(i)] = o.map(he);
550
- }), s ? we(r) ? [s] : [s, r] : we(r) ? void 0 : r;
546
+ t || (n = n.map((o) => o.map(String)).sort((o, u) => o.length - u.length));
547
+ const [i, ...a] = n;
548
+ i.length === 0 ? s = a.map(Ee) : r[Ee(i)] = a.map(Ee);
549
+ }), s ? Ce(r) ? [s] : [s, r] : Ce(r) ? void 0 : r;
551
550
  }
552
- const Dt = (e, t, r, s, n = [], i = [], o = /* @__PURE__ */ new Map()) => {
551
+ const Rt = (e, t, r, s, n = [], i = [], a = /* @__PURE__ */ new Map()) => {
553
552
  var h;
554
- const a = Cs(e);
555
- if (!a) {
556
- Bs(e, n, t);
557
- const b = o.get(e);
553
+ const o = xs(e);
554
+ if (!o) {
555
+ Ps(e, n, t);
556
+ const b = a.get(e);
558
557
  if (b)
559
558
  return s ? {
560
559
  transformedValue: null
561
560
  } : b;
562
561
  }
563
- if (!ks(e, r)) {
564
- const b = Ge(e, r), p = b ? {
562
+ if (!_s(e, r)) {
563
+ const b = Qe(e, r), m = b ? {
565
564
  transformedValue: b.value,
566
565
  annotations: [b.type]
567
566
  } : {
568
567
  transformedValue: e
569
568
  };
570
- return a || o.set(e, p), p;
569
+ return o || a.set(e, m), m;
571
570
  }
572
571
  if (oe(i, e))
573
572
  return {
574
573
  transformedValue: null
575
574
  };
576
- const u = Ge(e, r), c = (h = u == null ? void 0 : u.value) != null ? h : e, g = k(c) ? [] : {}, d = {};
577
- K(c, (b, p) => {
578
- if (p === "__proto__" || p === "constructor" || p === "prototype")
579
- throw new Error(`Detected property ${p}. This is a prototype pollution risk, please remove it from your object.`);
580
- const E = Dt(b, t, r, s, [...n, p], [...i, e], o);
581
- g[p] = E.transformedValue, k(E.annotations) ? d[p] = E.annotations : H(E.annotations) && K(E.annotations, (C, v) => {
582
- d[Ft(p) + "." + v] = C;
575
+ const u = Qe(e, r), c = (h = u == null ? void 0 : u.value) != null ? h : e, g = k(c) ? [] : {}, f = {};
576
+ K(c, (b, m) => {
577
+ if (m === "__proto__" || m === "constructor" || m === "prototype")
578
+ throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);
579
+ const F = Rt(b, t, r, s, [...n, m], [...i, e], a);
580
+ g[m] = F.transformedValue, k(F.annotations) ? f[m] = F.annotations : Q(F.annotations) && K(F.annotations, (O, N) => {
581
+ f[Ct(m) + "." + N] = O;
583
582
  });
584
583
  });
585
- const m = we(d) ? {
584
+ const p = Ce(f) ? {
586
585
  transformedValue: g,
587
586
  annotations: u ? [u.type] : void 0
588
587
  } : {
589
588
  transformedValue: g,
590
- annotations: u ? [u.type, d] : d
589
+ annotations: u ? [u.type, f] : f
591
590
  };
592
- return a || o.set(e, m), m;
591
+ return o || a.set(e, p), p;
593
592
  };
594
- function xt(e) {
593
+ function It(e) {
595
594
  return Object.prototype.toString.call(e).slice(8, -1);
596
595
  }
597
- function Ye(e) {
598
- return xt(e) === "Array";
596
+ function Xe(e) {
597
+ return It(e) === "Array";
599
598
  }
600
- function zs(e) {
601
- if (xt(e) !== "Object")
599
+ function Vs(e) {
600
+ if (It(e) !== "Object")
602
601
  return !1;
603
602
  const t = Object.getPrototypeOf(e);
604
603
  return !!t && t.constructor === Object && t === Object.prototype;
605
604
  }
606
- function Us(e, t, r, s, n) {
605
+ function js(e, t, r, s, n) {
607
606
  const i = {}.propertyIsEnumerable.call(s, t) ? "enumerable" : "nonenumerable";
608
607
  i === "enumerable" && (e[t] = r), n && i === "nonenumerable" && Object.defineProperty(e, t, {
609
608
  value: r,
@@ -612,17 +611,17 @@ function Us(e, t, r, s, n) {
612
611
  configurable: !0
613
612
  });
614
613
  }
615
- function Ce(e, t = {}) {
616
- if (Ye(e))
617
- return e.map((n) => Ce(n, t));
618
- if (!zs(e))
614
+ function $e(e, t = {}) {
615
+ if (Xe(e))
616
+ return e.map((n) => $e(n, t));
617
+ if (!Vs(e))
619
618
  return e;
620
619
  const r = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
621
620
  return [...r, ...s].reduce((n, i) => {
622
- if (Ye(t.props) && !t.props.includes(i))
621
+ if (Xe(t.props) && !t.props.includes(i))
623
622
  return n;
624
- const o = e[i], a = Ce(o, t);
625
- return Us(n, i, a, e, t.nonenumerable), n;
623
+ const a = e[i], o = $e(a, t);
624
+ return js(n, i, o, e, t.nonenumerable), n;
626
625
  }, {});
627
626
  }
628
627
  class y {
@@ -630,27 +629,27 @@ class y {
630
629
  * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
631
630
  */
632
631
  constructor({ dedupe: t = !1 } = {}) {
633
- this.classRegistry = new ps(), this.symbolRegistry = new ht((r) => {
632
+ this.classRegistry = new bs(), this.symbolRegistry = new Tt((r) => {
634
633
  var s;
635
634
  return (s = r.description) != null ? s : "";
636
- }), this.customTransformerRegistry = new ys(), this.allowedErrorProps = [], this.dedupe = t;
635
+ }), this.customTransformerRegistry = new As(), this.allowedErrorProps = [], this.dedupe = t;
637
636
  }
638
637
  serialize(t) {
639
- const r = /* @__PURE__ */ new Map(), s = Dt(t, r, this, this.dedupe), n = {
638
+ const r = /* @__PURE__ */ new Map(), s = Rt(t, r, this, this.dedupe), n = {
640
639
  json: s.transformedValue
641
640
  };
642
- s.annotations && (n.meta = F(l({}, n.meta), {
641
+ s.annotations && (n.meta = E(l({}, n.meta), {
643
642
  values: s.annotations
644
643
  }));
645
- const i = Ls(r, this.dedupe);
646
- return i && (n.meta = F(l({}, n.meta), {
644
+ const i = Ws(r, this.dedupe);
645
+ return i && (n.meta = E(l({}, n.meta), {
647
646
  referentialEqualities: i
648
647
  })), n;
649
648
  }
650
649
  deserialize(t) {
651
650
  const { json: r, meta: s } = t;
652
- let n = Ce(r);
653
- return s != null && s.values && (n = Rs(n, s.values, this)), s != null && s.referentialEqualities && (n = Is(n, s.referentialEqualities)), n;
651
+ let n = $e(r);
652
+ return s != null && s.values && (n = zs(n, s.values, this)), s != null && s.referentialEqualities && (n = Us(n, s.referentialEqualities)), n;
654
653
  }
655
654
  stringify(t) {
656
655
  return JSON.stringify(this.serialize(t));
@@ -682,7 +681,7 @@ y.registerClass = y.defaultInstance.registerClass.bind(y.defaultInstance);
682
681
  y.registerSymbol = y.defaultInstance.registerSymbol.bind(y.defaultInstance);
683
682
  y.registerCustom = y.defaultInstance.registerCustom.bind(y.defaultInstance);
684
683
  y.allowErrorProps = y.defaultInstance.allowErrorProps.bind(y.defaultInstance);
685
- const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e.type), ve = (e) => new Sr(
684
+ const P = (e) => e === void 0 ? U.None : e, Js = (e) => new dr(e.metadataItem, e.type), Re = (e) => new Nr(
686
685
  e.name,
687
686
  e.expression,
688
687
  e.type,
@@ -690,7 +689,7 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
690
689
  P(e.sort),
691
690
  e.dataSource,
692
691
  e.composeCode
693
- ), Ne = (e) => new Cr(
692
+ ), Ie = (e) => new vr(
694
693
  e.name,
695
694
  e.expression,
696
695
  e.granularity,
@@ -699,27 +698,27 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
699
698
  P(e.sort),
700
699
  e.dataSource,
701
700
  e.composeCode
702
- ), N = (e) => {
701
+ ), v = (e) => {
703
702
  switch (e.__serializable) {
704
703
  case "DimensionalAttribute":
705
- return ve(e);
704
+ return Re(e);
706
705
  case "DimensionalLevelAttribute":
707
- return Ne(e);
706
+ return Ie(e);
708
707
  default:
709
708
  return e;
710
709
  }
711
- }, vt = (e) => new ss(
710
+ }, kt = (e) => new Mr(
712
711
  e.name,
713
712
  e.expression,
714
- e.attributes.map(N),
715
- e.dimensions.map(Ps),
713
+ e.attributes.map(v),
714
+ e.dimensions.map(Ks),
716
715
  e.type,
717
716
  e.description,
718
717
  P(e.sort),
719
718
  e.dataSource,
720
719
  e.composeCode,
721
- e.defaultAttribute ? N(e.defaultAttribute) : void 0
722
- ), Nt = (e) => new ns(
720
+ e.defaultAttribute ? v(e.defaultAttribute) : void 0
721
+ ), Lt = (e) => new Rr(
723
722
  e.name,
724
723
  e.expression,
725
724
  e.description,
@@ -728,44 +727,59 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
728
727
  e.composeCode,
729
728
  e.indexed,
730
729
  e.merged
731
- ), Ps = (e) => {
730
+ ), Ks = (e) => {
732
731
  switch (e.__serializable) {
733
732
  case "DimensionalDimension":
734
- return vt(e);
733
+ return kt(e);
735
734
  case "DimensionalDateDimension":
736
- return Nt(e);
735
+ return Lt(e);
737
736
  default:
738
737
  return e;
739
738
  }
740
- }, Me = (e) => new qr(
739
+ }, ke = (e) => new Ir(
741
740
  e.name,
742
- N(e.attribute),
741
+ v(e.attribute),
743
742
  e.aggregation,
744
743
  e.format,
745
744
  e.description,
746
745
  P(e.sort),
747
746
  e.dataSource,
748
747
  e.composeCode
749
- ), Re = (e) => {
748
+ ), Le = (e) => {
750
749
  const t = Object.fromEntries(
751
750
  Object.entries(e.context).map(([r, s]) => {
752
751
  if (s && typeof s == "object" && "__serializable" in s)
753
752
  switch (s.__serializable) {
754
753
  case "DimensionalAttribute":
755
- return [r, ve(s)];
754
+ return [r, Re(s)];
756
755
  case "DimensionalLevelAttribute":
757
- return [r, Ne(s)];
756
+ return [r, Ie(s)];
758
757
  case "DimensionalBaseMeasure":
759
- return [r, Me(s)];
758
+ return [r, ke(s)];
760
759
  case "DimensionalCalculatedMeasure":
761
- return [r, Re(s)];
760
+ return [r, Le(s)];
761
+ case "DimensionalMeasureTemplate":
762
+ return [r, Be(s)];
763
+ case "MembersFilter":
764
+ case "LogicalAttributeFilter":
765
+ case "CascadingFilter":
766
+ case "ExcludeFilter":
767
+ case "MeasureFilter":
768
+ case "RankingFilter":
769
+ case "MeasureRankingFilter":
770
+ case "NumericFilter":
771
+ case "TextFilter":
772
+ case "DateRangeFilter":
773
+ case "RelativeDateFilter":
774
+ case "CustomFilter":
775
+ return [r, S(s)];
762
776
  default:
763
777
  return [r, s];
764
778
  }
765
779
  return [r, s];
766
780
  })
767
781
  );
768
- return new $r(
782
+ return new kr(
769
783
  e.name,
770
784
  e.expression,
771
785
  t,
@@ -775,58 +789,58 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
775
789
  e.dataSource,
776
790
  e.composeCode
777
791
  );
778
- }, Mt = (e) => new Or(
792
+ }, Be = (e) => new Lr(
779
793
  e.name,
780
- N(e.attribute),
794
+ v(e.attribute),
781
795
  e.format,
782
796
  e.description,
783
797
  P(e.sort),
784
798
  e.dataSource,
785
799
  e.composeCode
786
- ), be = (e) => {
800
+ ), Ae = (e) => {
787
801
  switch (e.__serializable) {
788
802
  case "DimensionalBaseMeasure":
789
- return Me(e);
803
+ return ke(e);
790
804
  case "DimensionalCalculatedMeasure":
791
- return Re(e);
805
+ return Le(e);
792
806
  case "DimensionalMeasureTemplate":
793
- return Mt(e);
807
+ return Be(e);
794
808
  default:
795
809
  return e;
796
810
  }
797
811
  }, S = (e) => {
798
812
  switch (e.__serializable) {
799
813
  case "MembersFilter":
800
- return new Ur(
801
- N(e.attribute),
814
+ return new Yr(
815
+ v(e.attribute),
802
816
  e.members,
803
- e.config.backgroundFilter ? F(l({}, e.config), { backgroundFilter: S(e.config.backgroundFilter) }) : e.config,
817
+ e.config.backgroundFilter ? E(l({}, e.config), { backgroundFilter: S(e.config.backgroundFilter) }) : e.config,
804
818
  e.composeCode
805
819
  );
806
820
  case "LogicalAttributeFilter":
807
- return new zr(
821
+ return new Gr(
808
822
  e.filters.map((r) => S(r)),
809
823
  e.operator,
810
824
  e.config,
811
825
  e.composeCode
812
826
  );
813
827
  case "CascadingFilter":
814
- return new Lr(
828
+ return new Kr(
815
829
  e._filters.map((r) => S(r)),
816
830
  e.config,
817
831
  e.composeCode
818
832
  );
819
833
  case "ExcludeFilter":
820
- return new Br(
834
+ return new Jr(
821
835
  S(e.filter),
822
836
  e.input ? S(e.input) : void 0,
823
837
  e.config,
824
838
  e.composeCode
825
839
  );
826
840
  case "MeasureFilter":
827
- return new kr(
828
- N(e.attribute),
829
- be(e.measure),
841
+ return new jr(
842
+ v(e.attribute),
843
+ Ae(e.measure),
830
844
  e.operatorA,
831
845
  e.valueA,
832
846
  e.operatorB,
@@ -835,25 +849,25 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
835
849
  e.composeCode
836
850
  );
837
851
  case "RankingFilter":
838
- return new Ir(
839
- N(e.attribute),
840
- be(e.measure),
852
+ return new Vr(
853
+ v(e.attribute),
854
+ Ae(e.measure),
841
855
  e.operator,
842
856
  e.count,
843
857
  e.config,
844
858
  e.composeCode
845
859
  );
846
860
  case "MeasureRankingFilter":
847
- return new Rr(
848
- be(e.measure),
861
+ return new Wr(
862
+ Ae(e.measure),
849
863
  e.operator,
850
864
  e.count,
851
865
  e.config,
852
866
  e.composeCode
853
867
  );
854
868
  case "NumericFilter":
855
- return new Mr(
856
- N(e.attribute),
869
+ return new Pr(
870
+ v(e.attribute),
857
871
  e.operatorA,
858
872
  e.valueA,
859
873
  e.operatorB,
@@ -862,8 +876,8 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
862
876
  e.composeCode
863
877
  );
864
878
  case "TextFilter":
865
- return new Nr(
866
- N(e.attribute),
879
+ return new _r(
880
+ v(e.attribute),
867
881
  e.operatorA,
868
882
  e.valueA,
869
883
  e.config,
@@ -871,8 +885,8 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
871
885
  );
872
886
  case "DateRangeFilter": {
873
887
  const { valueA: r, valueB: s } = e;
874
- return new vr(
875
- N(e.attribute),
888
+ return new Ur(
889
+ v(e.attribute),
876
890
  r,
877
891
  s,
878
892
  e.config,
@@ -880,8 +894,8 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
880
894
  );
881
895
  }
882
896
  case "RelativeDateFilter":
883
- return new xr(
884
- N(e.attribute),
897
+ return new zr(
898
+ v(e.attribute),
885
899
  e.offset,
886
900
  e.count,
887
901
  e.operator,
@@ -890,8 +904,8 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
890
904
  e.composeCode
891
905
  );
892
906
  case "CustomFilter":
893
- return new Dr(
894
- N(e.attribute),
907
+ return new Br(
908
+ v(e.attribute),
895
909
  e.jaqlExpression,
896
910
  e.config,
897
911
  e.composeCode
@@ -902,71 +916,71 @@ const P = (e) => e === void 0 ? U.None : e, _s = (e) => new ar(e.metadataItem, e
902
916
  };
903
917
  y.registerCustom(
904
918
  {
905
- isApplicable: or,
919
+ isApplicable: fr,
906
920
  serialize: (e) => e.serialize(),
907
- deserialize: (e) => _s(e)
921
+ deserialize: (e) => Js(e)
908
922
  },
909
923
  "JaqlElement"
910
924
  );
911
925
  y.registerCustom(
912
926
  {
913
- isApplicable: ur,
927
+ isApplicable: mr,
914
928
  serialize: (e) => e.serialize(),
915
- deserialize: (e) => ve(e)
929
+ deserialize: (e) => Re(e)
916
930
  },
917
931
  "DimensionalAttribute"
918
932
  );
919
933
  y.registerCustom(
920
934
  {
921
- isApplicable: cr,
935
+ isApplicable: pr,
922
936
  serialize: (e) => e.serialize(),
923
- deserialize: (e) => Ne(e)
937
+ deserialize: (e) => Ie(e)
924
938
  },
925
939
  "DimensionalLevelAttribute"
926
940
  );
927
941
  y.registerCustom(
928
942
  {
929
- isApplicable: ts,
943
+ isApplicable: gr,
930
944
  serialize: (e) => e.serialize(),
931
- deserialize: (e) => vt(e)
945
+ deserialize: (e) => kt(e)
932
946
  },
933
947
  "DimensionalDimension"
934
948
  );
935
949
  y.registerCustom(
936
950
  {
937
- isApplicable: rs,
951
+ isApplicable: yr,
938
952
  serialize: (e) => e.serialize(),
939
- deserialize: (e) => Nt(e)
953
+ deserialize: (e) => Lt(e)
940
954
  },
941
955
  "DimensionalDateDimension"
942
956
  );
943
957
  y.registerCustom(
944
958
  {
945
- isApplicable: lr,
959
+ isApplicable: hr,
946
960
  serialize: (e) => e.serialize(),
947
- deserialize: (e) => Me(e)
961
+ deserialize: (e) => ke(e)
948
962
  },
949
963
  "DimensionalBaseMeasure"
950
964
  );
951
965
  y.registerCustom(
952
966
  {
953
- isApplicable: dr,
967
+ isApplicable: br,
954
968
  serialize: (e) => e.serialize(),
955
- deserialize: (e) => Re(e)
969
+ deserialize: (e) => Le(e)
956
970
  },
957
971
  "DimensionalCalculatedMeasure"
958
972
  );
959
973
  y.registerCustom(
960
974
  {
961
- isApplicable: fr,
975
+ isApplicable: Fr,
962
976
  serialize: (e) => e.serialize(),
963
- deserialize: (e) => Mt(e)
977
+ deserialize: (e) => Be(e)
964
978
  },
965
979
  "DimensionalMeasureTemplate"
966
980
  );
967
981
  y.registerCustom(
968
982
  {
969
- isApplicable: De,
983
+ isApplicable: ve,
970
984
  serialize: (e) => e.serialize(),
971
985
  deserialize: (e) => S(e)
972
986
  },
@@ -974,7 +988,7 @@ y.registerCustom(
974
988
  );
975
989
  y.registerCustom(
976
990
  {
977
- isApplicable: pr,
991
+ isApplicable: Er,
978
992
  serialize: (e) => e.serialize(),
979
993
  deserialize: (e) => S(e)
980
994
  },
@@ -982,7 +996,7 @@ y.registerCustom(
982
996
  );
983
997
  y.registerCustom(
984
998
  {
985
- isApplicable: mr,
999
+ isApplicable: Ar,
986
1000
  serialize: (e) => e.serialize(),
987
1001
  deserialize: (e) => S(e)
988
1002
  },
@@ -990,7 +1004,7 @@ y.registerCustom(
990
1004
  );
991
1005
  y.registerCustom(
992
1006
  {
993
- isApplicable: gr,
1007
+ isApplicable: Tr,
994
1008
  serialize: (e) => e.serialize(),
995
1009
  deserialize: (e) => S(e)
996
1010
  },
@@ -998,7 +1012,7 @@ y.registerCustom(
998
1012
  );
999
1013
  y.registerCustom(
1000
1014
  {
1001
- isApplicable: yr,
1015
+ isApplicable: wr,
1002
1016
  serialize: (e) => e.serialize(),
1003
1017
  deserialize: (e) => S(e)
1004
1018
  },
@@ -1006,7 +1020,7 @@ y.registerCustom(
1006
1020
  );
1007
1021
  y.registerCustom(
1008
1022
  {
1009
- isApplicable: hr,
1023
+ isApplicable: Sr,
1010
1024
  serialize: (e) => e.serialize(),
1011
1025
  deserialize: (e) => S(e)
1012
1026
  },
@@ -1014,7 +1028,7 @@ y.registerCustom(
1014
1028
  );
1015
1029
  y.registerCustom(
1016
1030
  {
1017
- isApplicable: br,
1031
+ isApplicable: Cr,
1018
1032
  serialize: (e) => e.serialize(),
1019
1033
  deserialize: (e) => S(e)
1020
1034
  },
@@ -1022,7 +1036,7 @@ y.registerCustom(
1022
1036
  );
1023
1037
  y.registerCustom(
1024
1038
  {
1025
- isApplicable: Er,
1039
+ isApplicable: Or,
1026
1040
  serialize: (e) => e.serialize(),
1027
1041
  deserialize: (e) => S(e)
1028
1042
  },
@@ -1030,7 +1044,7 @@ y.registerCustom(
1030
1044
  );
1031
1045
  y.registerCustom(
1032
1046
  {
1033
- isApplicable: Fr,
1047
+ isApplicable: qr,
1034
1048
  serialize: (e) => e.serialize(),
1035
1049
  deserialize: (e) => S(e)
1036
1050
  },
@@ -1038,7 +1052,7 @@ y.registerCustom(
1038
1052
  );
1039
1053
  y.registerCustom(
1040
1054
  {
1041
- isApplicable: Ar,
1055
+ isApplicable: $r,
1042
1056
  serialize: (e) => e.serialize(),
1043
1057
  deserialize: (e) => S(e)
1044
1058
  },
@@ -1046,7 +1060,7 @@ y.registerCustom(
1046
1060
  );
1047
1061
  y.registerCustom(
1048
1062
  {
1049
- isApplicable: wr,
1063
+ isApplicable: Dr,
1050
1064
  serialize: (e) => e.serialize(),
1051
1065
  deserialize: (e) => S(e)
1052
1066
  },
@@ -1054,64 +1068,64 @@ y.registerCustom(
1054
1068
  );
1055
1069
  y.registerCustom(
1056
1070
  {
1057
- isApplicable: Tr,
1071
+ isApplicable: xr,
1058
1072
  serialize: (e) => e.serialize(),
1059
1073
  deserialize: (e) => S(e)
1060
1074
  },
1061
1075
  "CustomFilter"
1062
1076
  );
1063
- const Di = y, w = "DM.";
1064
- function O(e) {
1077
+ const Bi = y, T = "DM.";
1078
+ function $(e) {
1065
1079
  return typeof e == "object" && e !== null;
1066
1080
  }
1067
- function q(e) {
1081
+ function w(e) {
1068
1082
  return typeof e == "object" && e !== null && "function" in e && "args" in e;
1069
1083
  }
1070
- function Rt(e) {
1071
- return e.every(q);
1084
+ function Bt(e) {
1085
+ return Array.isArray(e) && e.every(w);
1072
1086
  }
1073
- function fe(e) {
1087
+ function pe(e) {
1074
1088
  return "attribute" in e && "config" in e;
1075
1089
  }
1076
- function te(e) {
1090
+ function re(e) {
1077
1091
  return "left" in e && "right" in e && "operator" in e;
1078
1092
  }
1079
- function Ie(e) {
1080
- return !fe(e) && !te(e);
1093
+ function ze(e) {
1094
+ return !pe(e) && !re(e);
1081
1095
  }
1082
- function Ws(e) {
1083
- return O(e) && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
1096
+ function zt(e) {
1097
+ return $(e) && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
1084
1098
  }
1085
- function Vs(e) {
1086
- return !O(e) || !("column" in e) ? !1 : q(e.column);
1099
+ function Ut(e) {
1100
+ return !$(e) || !("column" in e) ? !1 : w(e.column);
1087
1101
  }
1088
- const T = 3;
1102
+ const C = 3;
1089
1103
  function x(e, t, r) {
1090
1104
  if (t.length === 0) return;
1091
1105
  let s = Number.MAX_SAFE_INTEGER, n;
1092
1106
  for (const i of t) {
1093
- const o = r(i), a = os(e, o);
1094
- a < s && (s = a, n = i);
1107
+ const a = r(i), o = fs(e, a);
1108
+ o < s && (s = o, n = i);
1095
1109
  }
1096
1110
  return n !== void 0 ? { best: n, distance: s } : void 0;
1097
1111
  }
1098
- const It = "en";
1099
- function Ee(e, t) {
1100
- return e.localeCompare(t, It, { sensitivity: "accent" }) === 0;
1112
+ const _t = "en";
1113
+ function Te(e, t) {
1114
+ return e.localeCompare(t, _t, { sensitivity: "accent" }) === 0;
1101
1115
  }
1102
- function He(e, t) {
1103
- return t.length <= e.length && e.slice(0, t.length).localeCompare(t, It, { sensitivity: "accent" }) === 0;
1116
+ function Ze(e, t) {
1117
+ return t.length <= e.length && e.slice(0, t.length).localeCompare(t, _t, { sensitivity: "accent" }) === 0;
1104
1118
  }
1105
- function re(e) {
1106
- const t = [...e].sort((i, o) => o.name.length - i.name.length), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1119
+ function se(e) {
1120
+ const t = [...e].sort((i, a) => a.name.length - i.name.length), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1107
1121
  for (const i of e) {
1108
1122
  r.set(i.name, i);
1109
- const o = [...i.columns].sort((u, c) => c.name.length - u.name.length);
1110
- n.set(i.name, o);
1111
- const a = /* @__PURE__ */ new Map();
1123
+ const a = [...i.columns].sort((u, c) => c.name.length - u.name.length);
1124
+ n.set(i.name, a);
1125
+ const o = /* @__PURE__ */ new Map();
1112
1126
  for (const u of i.columns)
1113
- a.set(u.name, u);
1114
- s.set(i.name, a);
1127
+ o.set(u.name, u);
1128
+ s.set(i.name, o);
1115
1129
  }
1116
1130
  return {
1117
1131
  sortedTables: t,
@@ -1120,170 +1134,170 @@ function re(e) {
1120
1134
  columnMap: s
1121
1135
  };
1122
1136
  }
1123
- function ke(e, t) {
1124
- if (!e.startsWith(w))
1137
+ function Ue(e, t) {
1138
+ if (!e.startsWith(T))
1125
1139
  throw new Error(
1126
- `Invalid dimensional element name format: '${e}'. Expected format: '${w}TableName.ColumnName[.Level]'`
1140
+ `Invalid dimensional element name format: '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
1127
1141
  );
1128
- const r = e.slice(w.length);
1142
+ const r = e.slice(T.length);
1129
1143
  if (!r)
1130
1144
  throw new Error(
1131
- `Invalid dimensional element name format: '${e}'. Expected format: '${w}TableName.ColumnName[.Level]'`
1145
+ `Invalid dimensional element name format: '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
1132
1146
  );
1133
1147
  let s, n;
1134
- for (const p of t.sortedTables)
1135
- if (He(r, p.name + ".")) {
1136
- const E = r.slice(p.name.length + 1);
1137
- if (!E)
1148
+ for (const m of t.sortedTables)
1149
+ if (Ze(r, m.name + ".")) {
1150
+ const F = r.slice(m.name.length + 1);
1151
+ if (!F)
1138
1152
  throw new Error(
1139
- `Invalid dimensional element name format: '${e}'. Expected format: '${w}TableName.ColumnName[.Level]'`
1153
+ `Invalid dimensional element name format: '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
1140
1154
  );
1141
- s = p, n = E;
1155
+ s = m, n = F;
1142
1156
  break;
1143
1157
  }
1144
1158
  if (!s) {
1145
- const p = r.indexOf(".");
1146
- if (p === -1)
1159
+ const m = r.indexOf(".");
1160
+ if (m === -1)
1147
1161
  throw new Error(
1148
- `Invalid dimensional element name format: '${e}'. Expected format: '${w}TableName.ColumnName[.Level]'`
1162
+ `Invalid dimensional element name format: '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
1149
1163
  );
1150
- const E = r.slice(0, p), C = x(E, t.sortedTables, (W) => W.name), v = C && C.distance <= T ? ` Did you mean '${C.best.name}'?` : "";
1151
- throw new Error(`Table '${E}' not found in the data model.${v}`);
1164
+ const F = r.slice(0, m), O = x(F, t.sortedTables, (W) => W.name), N = O && O.distance <= C ? ` Did you mean '${O.best.name}'?` : "";
1165
+ throw new Error(`Table '${F}' not found in the data model.${N}`);
1152
1166
  }
1153
1167
  const i = t.tableColumnMap.get(s.name);
1154
1168
  if (!i)
1155
1169
  throw new Error(`Table '${s.name}' found but has no columns`);
1156
- let o, a;
1157
- const u = $.all;
1158
- for (const p of i) {
1159
- if (Ee(n, p.name))
1160
- return { table: s, column: p };
1161
- if (!He(n, p.name + "."))
1170
+ let a, o;
1171
+ const u = q.all;
1172
+ for (const m of i) {
1173
+ if (Te(n, m.name))
1174
+ return { table: s, column: m };
1175
+ if (!Ze(n, m.name + "."))
1162
1176
  continue;
1163
- const E = n.slice(p.name.length + 1);
1164
- if (!E)
1177
+ const F = n.slice(m.name.length + 1);
1178
+ if (!F)
1165
1179
  continue;
1166
- const C = u.includes(E), v = ee(p.dataType);
1167
- if (C) {
1168
- if (v)
1169
- return { table: s, column: p, level: E };
1170
- o || (o = p, a = E);
1180
+ const O = u.includes(F), N = te(m.dataType);
1181
+ if (O) {
1182
+ if (N)
1183
+ return { table: s, column: m, level: F };
1184
+ a || (a = m, o = F);
1171
1185
  continue;
1172
1186
  }
1173
- v && !o && (o = p, a = E);
1187
+ N && !a && (a = m, o = F);
1174
1188
  }
1175
- if (o && a) {
1176
- if (u.includes(a))
1189
+ if (a && o) {
1190
+ if (u.includes(o))
1177
1191
  throw new Error(
1178
- `Invalid date level '${a}' in dimensional element '${e}'. Column '${s.name}.${o.name}' is not a datetime column`
1192
+ `Invalid date level '${o}' in dimensional element '${e}'. Column '${s.name}.${a.name}' is not a datetime column`
1179
1193
  );
1180
- const p = x(a, u, (C) => C), E = p && p.distance <= T ? ` Did you mean '${p.best}'?` : "";
1194
+ const m = x(o, u, (O) => O), F = m && m.distance <= C ? ` Did you mean '${m.best}'?` : "";
1181
1195
  throw new Error(
1182
- `Invalid date level '${a}' in dimensional element '${e}'. Valid levels are: ${u.join(
1196
+ `Invalid date level '${o}' in dimensional element '${e}'. Valid levels are: ${u.join(
1183
1197
  ", "
1184
- )}.${E}`
1198
+ )}.${F}`
1185
1199
  );
1186
1200
  }
1187
- const c = n.indexOf("."), g = c === -1 ? n : n.slice(0, c), d = x(n, i, (p) => p.name), m = d && d.distance <= T && !Ee(d.best.name, g), h = m ? ` Did you mean '${d.best.name}'?` : "", b = !m && n.endsWith(".") && d !== void 0 && Ee(d.best.name, g) ? ` Use '${g}' without a trailing dot.` : "";
1201
+ const c = n.indexOf("."), g = c === -1 ? n : n.slice(0, c), f = x(n, i, (m) => m.name), p = f && f.distance <= C && !Te(f.best.name, g), h = p ? ` Did you mean '${f.best.name}'?` : "", b = !p && n.endsWith(".") && f !== void 0 && Te(f.best.name, g) ? ` Use '${g}' without a trailing dot.` : "";
1188
1202
  throw new Error(
1189
1203
  `Column '${g}' not found in table '${s.name}'.${h}${b}`
1190
1204
  );
1191
1205
  }
1192
- function js(e, t) {
1193
- const { table: r, column: s, level: n } = ke(e, t);
1206
+ function Gs(e, t) {
1207
+ const { table: r, column: s, level: n } = Ue(e, t);
1194
1208
  if (n) {
1195
- if (!ee(s.dataType))
1209
+ if (!te(s.dataType))
1196
1210
  throw new Error(
1197
1211
  `Invalid date level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is not a datetime column`
1198
1212
  );
1199
- const i = $.all;
1213
+ const i = q.all;
1200
1214
  if (!i.includes(n))
1201
1215
  throw new Error(
1202
1216
  `Invalid date level '${n}' in dimensional element '${e}'. Valid levels are: ${i.join(
1203
1217
  ", "
1204
1218
  )}`
1205
1219
  );
1206
- const o = $.dateOnly;
1207
- if (s.dataType === "date" && !o.includes(n))
1220
+ const a = q.dateOnly;
1221
+ if (s.dataType === "date" && !a.includes(n))
1208
1222
  throw new Error(
1209
1223
  `Invalid level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is only a date column, not a datetime column`
1210
1224
  );
1211
- const a = $.timeOnly;
1212
- if (s.dataType === "time" && !a.includes(n))
1225
+ const o = q.timeOnly;
1226
+ if (s.dataType === "time" && !o.includes(n))
1213
1227
  throw new Error(
1214
1228
  `Invalid level '${n}' in dimensional element '${e}'. Column '${r.name}.${s.name}' is only a time column, not a date column`
1215
1229
  );
1216
1230
  }
1217
1231
  return { table: r, column: s, level: n };
1218
1232
  }
1219
- function Z(e, t, r, s) {
1220
- const { table: n, column: i, level: o } = js(e, r);
1221
- let a = o;
1222
- if (ee(i.dataType) && a === void 0 && (s != null && s.inferredDateLevel)) {
1223
- const u = s.inferredDateLevel, c = $.all;
1233
+ function ee(e, t, r, s) {
1234
+ const { table: n, column: i, level: a } = Gs(e, r);
1235
+ let o = a;
1236
+ if (te(i.dataType) && o === void 0 && (s != null && s.inferredDateLevel)) {
1237
+ const u = s.inferredDateLevel, c = q.all;
1224
1238
  if (!c.includes(u))
1225
1239
  throw new Error(
1226
1240
  `Invalid inferred date level '${u}'. Valid levels are: ${c.join(", ")}`
1227
1241
  );
1228
- const g = `${e}.${u}`, d = $.dateOnly;
1229
- if (i.dataType === "date" && !d.includes(u))
1242
+ const g = `${e}.${u}`, f = q.dateOnly;
1243
+ if (i.dataType === "date" && !f.includes(u))
1230
1244
  throw new Error(
1231
1245
  `Invalid level '${u}' in dimensional element '${g}'. Column '${n.name}.${i.name}' is only a date column, not a datetime column`
1232
1246
  );
1233
- const m = $.timeOnly;
1234
- if (i.dataType === "time" && !m.includes(u))
1247
+ const p = q.timeOnly;
1248
+ if (i.dataType === "time" && !p.includes(u))
1235
1249
  throw new Error(
1236
1250
  `Invalid level '${u}' in dimensional element '${g}'. Column '${n.name}.${i.name}' is only a time column, not a date column`
1237
1251
  );
1238
- a = u;
1252
+ o = u;
1239
1253
  }
1240
- return _r({
1254
+ return Hr({
1241
1255
  expression: i.expression,
1242
1256
  dataType: i.dataType,
1243
- granularity: a,
1257
+ granularity: o,
1244
1258
  format: void 0,
1245
1259
  sort: void 0,
1246
1260
  dataSource: t
1247
1261
  });
1248
1262
  }
1249
- function Js(e, t, r) {
1250
- const { column: s, level: n } = ke(e, r);
1263
+ function Ys(e, t, r) {
1264
+ const { column: s, level: n } = Ue(e, r);
1251
1265
  if (n)
1252
1266
  throw new Error(
1253
- `Invalid DateDimension name format: '${e}'. Expected format: '${w}TableName.ColumnName'`
1267
+ `Invalid DateDimension name format: '${e}'. Expected format: '${T}TableName.ColumnName'`
1254
1268
  );
1255
- if (!ee(s.dataType))
1269
+ if (!te(s.dataType))
1256
1270
  throw new Error(
1257
1271
  `Invalid DateDimension name '${e}'. Column '${s.name}' is not a datetime column (got ${s.dataType}).`
1258
1272
  );
1259
- return is({
1273
+ return Qr({
1260
1274
  name: s.name,
1261
1275
  expression: s.expression,
1262
1276
  dataSource: t
1263
1277
  });
1264
1278
  }
1265
- const Ks = (e, t) => {
1279
+ const Hs = (e, t) => {
1266
1280
  if (!e) return;
1267
1281
  const r = typeof e == "object" ? e.direction : e;
1268
- if (!ct(r))
1269
- return F(l({}, t), {
1282
+ if (!pt(r))
1283
+ return E(l({}, t), {
1270
1284
  message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${r}'.`
1271
1285
  });
1272
- }, Gs = (e, t, r, s) => {
1273
- const n = Ks(e.sortType, s);
1286
+ }, Qs = (e, t, r, s) => {
1287
+ const n = Hs(e.sortType, s);
1274
1288
  if (n)
1275
1289
  return {
1276
- attribute: Z(e.column, t, r),
1290
+ attribute: ee(e.column, t, r),
1277
1291
  style: {},
1278
1292
  error: n
1279
1293
  };
1280
- const i = Z(e.column, t, r), o = _(e, "column");
1281
- return { attribute: i, style: o };
1282
- }, Ys = (e, t, r, s) => typeof e == "string" ? { attribute: Z(e, t, r) } : Ws(e) ? Gs(e, t, r, s) : {
1283
- error: F(l({}, s), {
1294
+ const i = ee(e.column, t, r), a = _(e, "column");
1295
+ return { attribute: i, style: a };
1296
+ }, Xs = (e, t, r, s) => typeof e == "string" ? { attribute: ee(e, t, r) } : zt(e) ? Qs(e, t, r, s) : {
1297
+ error: E(l({}, s), {
1284
1298
  message: "Invalid dimension item. Expected a string (composeCode) or object with 'column' and optional 'sortType'."
1285
1299
  })
1286
- }, kt = (e) => {
1300
+ }, Pt = (e) => {
1287
1301
  const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
1288
1302
  if (!t)
1289
1303
  return { success: !0, data: [] };
@@ -1299,13 +1313,13 @@ const Ks = (e, t) => {
1299
1313
  ]
1300
1314
  };
1301
1315
  const n = [], i = [];
1302
- return t.forEach((o, a) => {
1316
+ return t.forEach((a, o) => {
1303
1317
  const u = {
1304
- path: `dimensions[${a}]`,
1305
- input: o
1318
+ path: `dimensions[${o}]`,
1319
+ input: a
1306
1320
  };
1307
1321
  try {
1308
- const c = Ys(o, r, s, u);
1322
+ const c = Xs(a, r, s, u);
1309
1323
  if (c.error) {
1310
1324
  i.push(c.error);
1311
1325
  return;
@@ -1315,47 +1329,47 @@ const Ks = (e, t) => {
1315
1329
  );
1316
1330
  } catch (c) {
1317
1331
  const g = c instanceof Error ? c.message : "Unknown error";
1318
- i.push(F(l({}, u), { message: g }));
1332
+ i.push(E(l({}, u), { message: g }));
1319
1333
  }
1320
1334
  }), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
1321
1335
  };
1322
- function Be(e, t) {
1336
+ function _e(e, t) {
1323
1337
  const r = Reflect.get(e, t);
1324
1338
  if (typeof r != "function")
1325
1339
  throw new Error(`Function '${t}' not found or is not a function`);
1326
1340
  return r;
1327
1341
  }
1328
- function Hs(e, t) {
1329
- const r = e.replace("measureFactory.", ""), n = Be(Pr, r)(...t);
1330
- if (!Ie(n))
1342
+ function Zs(e, t) {
1343
+ const r = e.replace("measureFactory.", ""), n = _e(Xr, r)(...t);
1344
+ if (!ze(n))
1331
1345
  throw new Error(`Function '${e}' did not return a valid Measure`);
1332
1346
  return n;
1333
1347
  }
1334
- function Qs(e, t) {
1335
- const r = e.replace("filterFactory.logic.", ""), n = Be(Wr, r)(...t);
1336
- if (!te(n))
1348
+ function en(e, t) {
1349
+ const r = e.replace("filterFactory.logic.", ""), n = _e(Zr, r)(...t);
1350
+ if (!re(n))
1337
1351
  throw new Error(`Function '${e}' did not return a valid FilterRelations`);
1338
1352
  return n;
1339
1353
  }
1340
- function Xs(e, t) {
1354
+ function tn(e, t) {
1341
1355
  if (e.startsWith("filterFactory.logic."))
1342
- return Qs(e, t);
1343
- const r = e.replace("filterFactory.", ""), n = Be(Vr, r)(...t);
1344
- if (!fe(n) && !te(n))
1356
+ return en(e, t);
1357
+ const r = e.replace("filterFactory.", ""), n = _e(es, r)(...t);
1358
+ if (!pe(n) && !re(n))
1345
1359
  throw new Error(`Function '${e}' did not return a valid Filter or FilterRelations`);
1346
1360
  return n;
1347
1361
  }
1348
- function Zs(e, t) {
1362
+ function rn(e, t) {
1349
1363
  const s = e.split(".")[0];
1350
1364
  if (s === "measureFactory")
1351
- return Hs(e, t);
1365
+ return Zs(e, t);
1352
1366
  if (s === "filterFactory")
1353
- return Xs(e, t);
1367
+ return tn(e, t);
1354
1368
  throw new Error(
1355
1369
  `Unsupported factory: '${s}'. Supported factories: measureFactory, filterFactory`
1356
1370
  );
1357
1371
  }
1358
- const f = (e, t, r, s) => l({ category: e, minArgs: t, maxArgs: r }, s), en = /* @__PURE__ */ new Set([
1372
+ const d = (e, t, r, s) => l({ category: e, minArgs: t, maxArgs: r }, s), sn = /* @__PURE__ */ new Set([
1359
1373
  "CORREL",
1360
1374
  "COVARP",
1361
1375
  "COVAR",
@@ -1374,131 +1388,131 @@ const f = (e, t, r, s) => l({ category: e, minArgs: t, maxArgs: r }, s), en = /*
1374
1388
  "ORDERING",
1375
1389
  "RDOUBLE",
1376
1390
  "RINT"
1377
- ]), ue = {
1391
+ ]), ce = {
1378
1392
  // ── X-diff (datetime difference operators) ──
1379
- SDIFF: f("xdiff", 2, 2, {
1380
- requiredDateLevel: $.Seconds,
1393
+ SDIFF: d("xdiff", 2, 2, {
1394
+ requiredDateLevel: q.Seconds,
1381
1395
  argType: "datetime"
1382
1396
  }),
1383
- MNDIFF: f("xdiff", 2, 2, {
1384
- requiredDateLevel: $.Minutes,
1397
+ MNDIFF: d("xdiff", 2, 2, {
1398
+ requiredDateLevel: q.Minutes,
1385
1399
  argType: "datetime"
1386
1400
  }),
1387
- HDIFF: f("xdiff", 2, 2, {
1388
- requiredDateLevel: $.Hours,
1401
+ HDIFF: d("xdiff", 2, 2, {
1402
+ requiredDateLevel: q.Hours,
1389
1403
  argType: "datetime"
1390
1404
  }),
1391
- DDIFF: f("xdiff", 2, 2, {
1392
- requiredDateLevel: $.Days,
1405
+ DDIFF: d("xdiff", 2, 2, {
1406
+ requiredDateLevel: q.Days,
1393
1407
  argType: "datetime"
1394
1408
  }),
1395
- MDIFF: f("xdiff", 2, 2, {
1396
- requiredDateLevel: $.Months,
1409
+ MDIFF: d("xdiff", 2, 2, {
1410
+ requiredDateLevel: q.Months,
1397
1411
  argType: "datetime"
1398
1412
  }),
1399
- QDIFF: f("xdiff", 2, 2, {
1400
- requiredDateLevel: $.Quarters,
1413
+ QDIFF: d("xdiff", 2, 2, {
1414
+ requiredDateLevel: q.Quarters,
1401
1415
  argType: "datetime"
1402
1416
  }),
1403
- YDIFF: f("xdiff", 2, 2, {
1404
- requiredDateLevel: $.Years,
1417
+ YDIFF: d("xdiff", 2, 2, {
1418
+ requiredDateLevel: q.Years,
1405
1419
  argType: "datetime"
1406
1420
  }),
1407
1421
  // ── Aggregation ──
1408
- ANYVALUE: f("aggregative", 1, 1),
1409
- SUM: f("aggregative", 1, 2),
1410
- AVG: f("aggregative", 1, 2),
1411
- MIN: f("aggregative", 1, 2),
1412
- MAX: f("aggregative", 1, 2),
1413
- COUNT: f("aggregative", 1, 2),
1414
- DUPCOUNT: f("aggregative", 1, 1),
1415
- COUNTDUPLICATES: f("aggregative", 1, 1),
1416
- STDEV: f("aggregative", 1, 2),
1417
- STDEVP: f("aggregative", 1, 2),
1418
- VAR: f("aggregative", 1, 2),
1419
- VARP: f("aggregative", 1, 2),
1420
- MEDIAN: f("aggregative", 1, 2),
1421
- QUARTILE: f("aggregative", 2, 3),
1422
- PERCENTILE: f("aggregative", 2, 3),
1423
- LOWERWHISKERMAX_IQR: f("aggregative", 1, 1),
1424
- LOWERWHISKERMAX_STDEVP: f("aggregative", 1, 1),
1425
- UPPERWHISKERMIN_IQR: f("aggregative", 1, 1),
1426
- UPPERWHISKERMIN_STDEVP: f("aggregative", 1, 1),
1427
- OUTLIERSCOUNT_IQR: f("aggregative", 1, 1),
1428
- OUTLIERSCOUNT_STDEVP: f("aggregative", 1, 1),
1429
- MODE: f("aggregative", 1, 1),
1430
- NOAGGFUNCTION: f("aggregative", 1, 1),
1422
+ ANYVALUE: d("aggregative", 1, 1),
1423
+ SUM: d("aggregative", 1, 2),
1424
+ AVG: d("aggregative", 1, 2),
1425
+ MIN: d("aggregative", 1, 2),
1426
+ MAX: d("aggregative", 1, 2),
1427
+ COUNT: d("aggregative", 1, 2),
1428
+ DUPCOUNT: d("aggregative", 1, 1),
1429
+ COUNTDUPLICATES: d("aggregative", 1, 1),
1430
+ STDEV: d("aggregative", 1, 2),
1431
+ STDEVP: d("aggregative", 1, 2),
1432
+ VAR: d("aggregative", 1, 2),
1433
+ VARP: d("aggregative", 1, 2),
1434
+ MEDIAN: d("aggregative", 1, 2),
1435
+ QUARTILE: d("aggregative", 2, 3),
1436
+ PERCENTILE: d("aggregative", 2, 3),
1437
+ LOWERWHISKERMAX_IQR: d("aggregative", 1, 1),
1438
+ LOWERWHISKERMAX_STDEVP: d("aggregative", 1, 1),
1439
+ UPPERWHISKERMIN_IQR: d("aggregative", 1, 1),
1440
+ UPPERWHISKERMIN_STDEVP: d("aggregative", 1, 1),
1441
+ OUTLIERSCOUNT_IQR: d("aggregative", 1, 1),
1442
+ OUTLIERSCOUNT_STDEVP: d("aggregative", 1, 1),
1443
+ MODE: d("aggregative", 1, 1),
1444
+ NOAGGFUNCTION: d("aggregative", 1, 1),
1431
1445
  // ── Window ──
1432
- RANK: f("window", 0, Number.POSITIVE_INFINITY),
1433
- RSUM: f("window", 1, 2),
1434
- RAVG: f("window", 1, 2),
1435
- YTDSUM: f("window", 1, 1),
1436
- QTDSUM: f("window", 1, 1),
1437
- MTDSUM: f("window", 1, 1),
1438
- WTDSUM: f("window", 1, 1),
1439
- YTDAVG: f("window", 1, 1),
1440
- QTDAVG: f("window", 1, 1),
1441
- MTDAVG: f("window", 1, 1),
1442
- WTDAVG: f("window", 1, 1),
1446
+ RANK: d("window", 0, Number.POSITIVE_INFINITY),
1447
+ RSUM: d("window", 1, 2),
1448
+ RAVG: d("window", 1, 2),
1449
+ YTDSUM: d("window", 1, 1),
1450
+ QTDSUM: d("window", 1, 1),
1451
+ MTDSUM: d("window", 1, 1),
1452
+ WTDSUM: d("window", 1, 1),
1453
+ YTDAVG: d("window", 1, 1),
1454
+ QTDAVG: d("window", 1, 1),
1455
+ MTDAVG: d("window", 1, 1),
1456
+ WTDAVG: d("window", 1, 1),
1443
1457
  // ── String ──
1444
- CONCAT: f("string", 2, Number.POSITIVE_INFINITY),
1445
- LEFT: f("string", 2, 2),
1446
- RIGHT: f("string", 2, 2),
1458
+ CONCAT: d("string", 2, Number.POSITIVE_INFINITY),
1459
+ LEFT: d("string", 2, 2),
1460
+ RIGHT: d("string", 2, 2),
1447
1461
  // ── Scalar / math ──
1448
- ABS: f("scalar", 1, 1),
1449
- ACOS: f("scalar", 1, 1),
1450
- ASIN: f("scalar", 1, 1),
1451
- ATAN: f("scalar", 1, 1),
1452
- CEILING: f("scalar", 1, 1),
1453
- CONTRIBUTION: f("scalar", 1, 1),
1454
- COS: f("scalar", 1, 1),
1455
- COT: f("scalar", 1, 1),
1456
- DIFFPASTDAY: f("scalar", 1, 1),
1457
- DIFFPASTMONTH: f("scalar", 1, 1),
1458
- DIFFPASTPERIOD: f("scalar", 1, 1),
1459
- DIFFPASTQUARTER: f("scalar", 1, 1),
1460
- DIFFPASTWEEK: f("scalar", 1, 1),
1461
- DIFFPASTYEAR: f("scalar", 1, 1),
1462
- EXP: f("scalar", 1, 1),
1463
- FLOOR: f("scalar", 1, 1),
1464
- GROWTH: f("growth", 1, 1),
1465
- GROWTHPASTMONTH: f("growth", 1, 1),
1466
- GROWTHPASTQUARTER: f("growth", 1, 1),
1467
- GROWTHPASTWEEK: f("growth", 1, 1),
1468
- GROWTHPASTYEAR: f("growth", 1, 1),
1469
- GROWTHRATE: f("growth", 1, 1),
1470
- LN: f("scalar", 1, 1),
1471
- LOG10: f("scalar", 1, 1),
1472
- MINUS: f("scalar", 1, 1),
1473
- MOD: f("scalar", 2, 2),
1474
- QUOTIENT: f("scalar", 2, 2),
1475
- PASTDAY: f("date", 1, 2),
1476
- PASTMONTH: f("date", 1, 2),
1477
- PASTPERIOD: f("date", 1, 2),
1478
- PASTQUARTER: f("date", 1, 2),
1479
- PASTWEEK: f("date", 1, 2),
1480
- PASTYEAR: f("date", 1, 2),
1481
- PERCENTILEDISCFORINTERNALUSEONLY: f("scalar", 1, 1),
1482
- PERCENTILECONTFORINTERNALUSEONLY: f("scalar", 1, 1),
1483
- POWER: f("scalar", 2, 2),
1484
- ROUND: f("scalar", 2, 2),
1485
- SIN: f("scalar", 1, 1),
1486
- SQRT: f("scalar", 1, 1),
1487
- TAN: f("scalar", 1, 1)
1488
- }, tn = Object.keys(ue).filter(
1489
- (e) => ue[e].category === "xdiff"
1462
+ ABS: d("scalar", 1, 1),
1463
+ ACOS: d("scalar", 1, 1),
1464
+ ASIN: d("scalar", 1, 1),
1465
+ ATAN: d("scalar", 1, 1),
1466
+ CEILING: d("scalar", 1, 1),
1467
+ CONTRIBUTION: d("scalar", 1, 1),
1468
+ COS: d("scalar", 1, 1),
1469
+ COT: d("scalar", 1, 1),
1470
+ DIFFPASTDAY: d("scalar", 1, 1),
1471
+ DIFFPASTMONTH: d("scalar", 1, 1),
1472
+ DIFFPASTPERIOD: d("scalar", 1, 1),
1473
+ DIFFPASTQUARTER: d("scalar", 1, 1),
1474
+ DIFFPASTWEEK: d("scalar", 1, 1),
1475
+ DIFFPASTYEAR: d("scalar", 1, 1),
1476
+ EXP: d("scalar", 1, 1),
1477
+ FLOOR: d("scalar", 1, 1),
1478
+ GROWTH: d("growth", 1, 1),
1479
+ GROWTHPASTMONTH: d("growth", 1, 1),
1480
+ GROWTHPASTQUARTER: d("growth", 1, 1),
1481
+ GROWTHPASTWEEK: d("growth", 1, 1),
1482
+ GROWTHPASTYEAR: d("growth", 1, 1),
1483
+ GROWTHRATE: d("growth", 1, 1),
1484
+ LN: d("scalar", 1, 1),
1485
+ LOG10: d("scalar", 1, 1),
1486
+ MINUS: d("scalar", 1, 1),
1487
+ MOD: d("scalar", 2, 2),
1488
+ QUOTIENT: d("scalar", 2, 2),
1489
+ PASTDAY: d("date", 1, 2),
1490
+ PASTMONTH: d("date", 1, 2),
1491
+ PASTPERIOD: d("date", 1, 2),
1492
+ PASTQUARTER: d("date", 1, 2),
1493
+ PASTWEEK: d("date", 1, 2),
1494
+ PASTYEAR: d("date", 1, 2),
1495
+ PERCENTILEDISCFORINTERNALUSEONLY: d("scalar", 1, 1),
1496
+ PERCENTILECONTFORINTERNALUSEONLY: d("scalar", 1, 1),
1497
+ POWER: d("scalar", 2, 2),
1498
+ ROUND: d("scalar", 2, 2),
1499
+ SIN: d("scalar", 1, 1),
1500
+ SQRT: d("scalar", 1, 1),
1501
+ TAN: d("scalar", 1, 1)
1502
+ }, nn = Object.keys(ce).filter(
1503
+ (e) => ce[e].category === "xdiff"
1490
1504
  );
1491
- function Bt() {
1492
- return tn;
1505
+ function Wt() {
1506
+ return nn;
1493
1507
  }
1494
- function Lt(e) {
1495
- const t = ue[e.toUpperCase()];
1508
+ function Vt(e) {
1509
+ const t = ce[e.toUpperCase()];
1496
1510
  return t == null ? void 0 : t.requiredDateLevel;
1497
1511
  }
1498
- function rn(e, t) {
1512
+ function an(e, t) {
1499
1513
  return e === t ? e === 1 ? "1 parameter" : `${e} parameters` : t === Number.POSITIVE_INFINITY ? e <= 1 ? "any number of parameters" : `at least ${e} parameters` : `${e} or ${t} parameters`;
1500
1514
  }
1501
- const sn = /\[(\w[\w.-]*)\]/g, zt = /* @__PURE__ */ new Set([
1515
+ const on = /\[(\w[\w.-]*)\]/g, jt = /* @__PURE__ */ new Set([
1502
1516
  // Universal – Aggregative (per Sisense doc: (A) only; Statistical CONTRIBUTION, PERCENTILE, etc. are non-aggregative)
1503
1517
  "AVG",
1504
1518
  "COUNT",
@@ -1519,30 +1533,30 @@ const sn = /\[(\w[\w.-]*)\]/g, zt = /* @__PURE__ */ new Set([
1519
1533
  "YTDSUM"
1520
1534
  // RAVG, RSUM are non-aggregative per Sisense doc (Other Functions, not (A))
1521
1535
  // CORREL, COVAR*, SKEW*, SLOPE, LARGEST are unsupported in custom formulas (see UNSUPPORTED_FORMULA_FUNCTIONS).
1522
- ]), nn = new RegExp(
1523
- `\\b(${Array.from(zt).join("|")})\\s*\\(`,
1536
+ ]), un = new RegExp(
1537
+ `\\b(${Array.from(jt).join("|")})\\s*\\(`,
1524
1538
  "i"
1525
1539
  );
1526
- function Ut(e) {
1527
- return q(e) ? !0 : typeof e == "string" && e.startsWith(w) ? !1 : O(e) && "kind" in e ? e.kind === "measure" : !0;
1540
+ function Jt(e) {
1541
+ return w(e) ? !0 : typeof e == "string" && e.startsWith(T) ? !1 : $(e) && "kind" in e ? e.kind === "measure" : !0;
1528
1542
  }
1529
- function on(e) {
1543
+ function cn(e) {
1530
1544
  const t = /\b(\w+)\s*\(/g, r = /* @__PURE__ */ new Set();
1531
1545
  let s;
1532
1546
  for (; (s = t.exec(e)) !== null; ) {
1533
1547
  const n = s[1];
1534
- zt.has(n.toUpperCase()) || r.add(n);
1548
+ jt.has(n.toUpperCase()) || r.add(n);
1535
1549
  }
1536
1550
  return Array.from(r);
1537
1551
  }
1538
- function an(e) {
1552
+ function ln(e) {
1539
1553
  return e.length === 1 ? `[${e[0]}]` : e.map((t) => `[${t}]`).join(", ");
1540
1554
  }
1541
- function un(e) {
1555
+ function fn(e) {
1542
1556
  return e.length === 0 ? "" : e.length === 1 ? `${e[0]} is not an aggregative function. ` : `${e.join(", ")} are not aggregative functions. `;
1543
1557
  }
1544
- const G = (e) => e.startsWith("[") ? e : `[${e}]`, _t = (e) => e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1) : e;
1545
- function Pt(e, t) {
1558
+ const G = (e) => e.startsWith("[") ? e : `[${e}]`, Kt = (e) => e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1) : e;
1559
+ function Gt(e, t) {
1546
1560
  if (t.length === 0) return [];
1547
1561
  const r = t.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), s = new RegExp(
1548
1562
  `\\b(${r})\\s*\\(\\s*\\[([^\\]]+)\\]\\s*,\\s*\\[([^\\]]+)\\]\\s*\\)`,
@@ -1554,16 +1568,16 @@ function Pt(e, t) {
1554
1568
  ref2: n[3].trim()
1555
1569
  }));
1556
1570
  }
1557
- function cn(e, t, r) {
1558
- var o, a, u;
1559
- const s = Object.keys(t), n = ((o = r.errorPrefix) != null ? o : "customFormula validation").trim(), i = n === "" ? "" : n.endsWith(" ") ? n : `${n} `;
1571
+ function dn(e, t, r) {
1572
+ var a, o, u;
1573
+ const s = Object.keys(t), n = ((a = r.errorPrefix) != null ? a : "customFormula validation").trim(), i = n === "" ? "" : n.endsWith(" ") ? n : `${n} `;
1560
1574
  return {
1561
1575
  formula: e,
1562
1576
  context: t,
1563
1577
  contextKeys: s,
1564
1578
  canonicalContextKeys: new Set(s.map(G)),
1565
1579
  errorPrefix: i,
1566
- warnUnusedContext: (a = r.warnUnusedContext) != null ? a : !0,
1580
+ warnUnusedContext: (o = r.warnUnusedContext) != null ? o : !0,
1567
1581
  errorOnUnusedContext: (u = r.errorOnUnusedContext) != null ? u : !0,
1568
1582
  schemaIndex: r.schemaIndex,
1569
1583
  result: { isValid: !0, errors: [], warnings: [], references: [], unusedContextKeys: [] }
@@ -1572,17 +1586,17 @@ function cn(e, t, r) {
1572
1586
  function R(e, t) {
1573
1587
  e.result.errors.push(t), e.result.isValid = !1;
1574
1588
  }
1575
- const ln = /* @__PURE__ */ new Set(["CASE", "WHEN", "THEN", "ELSE", "END", "AND", "OR"]);
1576
- function dn(e) {
1589
+ const mn = /* @__PURE__ */ new Set(["CASE", "WHEN", "THEN", "ELSE", "END", "AND", "OR"]);
1590
+ function pn(e) {
1577
1591
  const t = /\b(\w+)\s*\[/gi, r = [...e.formula.matchAll(t)].find(
1578
- (s) => !ln.has(s[1].toUpperCase())
1592
+ (s) => !mn.has(s[1].toUpperCase())
1579
1593
  );
1580
1594
  r && R(
1581
1595
  e,
1582
1596
  `${e.errorPrefix}args[1]: Invalid syntax: '${r[1]}' - operator cannot be used before bracket reference without parentheses`
1583
1597
  );
1584
1598
  }
1585
- function fn(e, t) {
1599
+ function gn(e, t) {
1586
1600
  const r = e[t];
1587
1601
  let s = t + 1;
1588
1602
  for (; s < e.length; ) {
@@ -1599,27 +1613,27 @@ function fn(e, t) {
1599
1613
  }
1600
1614
  return e.length;
1601
1615
  }
1602
- function pn(e) {
1603
- return xe(e, ",").filter((t) => t.trim().length > 0).length;
1616
+ function yn(e) {
1617
+ return Me(e, ",").filter((t) => t.trim().length > 0).length;
1604
1618
  }
1605
- function mn(e, t, r, s) {
1619
+ function hn(e, t, r, s) {
1606
1620
  for (; t < e.length && /\s/.test(e[t]); )
1607
1621
  t++;
1608
1622
  if (e[t] !== "(")
1609
1623
  return t;
1610
- const n = t, i = us(e, n);
1624
+ const n = t, i = ms(e, n);
1611
1625
  if (i === -1)
1612
1626
  return n + 1;
1613
- const o = e.slice(n + 1, i);
1614
- return s.push({ name: r.toUpperCase(), argCount: pn(o) }), s.push(...Wt(o)), i + 1;
1627
+ const a = e.slice(n + 1, i);
1628
+ return s.push({ name: r.toUpperCase(), argCount: yn(a) }), s.push(...Yt(a)), i + 1;
1615
1629
  }
1616
- function Wt(e) {
1630
+ function Yt(e) {
1617
1631
  const t = [];
1618
1632
  let r = 0;
1619
1633
  for (; r < e.length; ) {
1620
1634
  const s = e[r];
1621
1635
  if (s === "'" || s === '"') {
1622
- r = fn(e, r);
1636
+ r = gn(e, r);
1623
1637
  continue;
1624
1638
  }
1625
1639
  if (/[A-Za-z_]/.test(s)) {
@@ -1627,122 +1641,122 @@ function Wt(e) {
1627
1641
  for (r++; r < e.length && /[A-Za-z0-9_]/.test(e[r]); )
1628
1642
  r++;
1629
1643
  const i = e.slice(n, r);
1630
- r = mn(e, r, i, t);
1644
+ r = hn(e, r, i, t);
1631
1645
  continue;
1632
1646
  }
1633
1647
  r++;
1634
1648
  }
1635
1649
  return t;
1636
1650
  }
1637
- function gn(e) {
1638
- const t = Wt(e.formula), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
1651
+ function bn(e) {
1652
+ const t = Yt(e.formula), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
1639
1653
  for (const { name: n, argCount: i } of t) {
1640
- if (en.has(n)) {
1654
+ if (sn.has(n)) {
1641
1655
  r.has(n) || (r.add(n), R(
1642
1656
  e,
1643
1657
  `${e.errorPrefix}args[1]: Function ${n} is not supported in custom formulas`
1644
1658
  ));
1645
1659
  continue;
1646
1660
  }
1647
- const o = ue[n];
1648
- if (o && (i < o.minArgs || i > o.maxArgs) && !s.has(n)) {
1661
+ const a = ce[n];
1662
+ if (a && (i < a.minArgs || i > a.maxArgs) && !s.has(n)) {
1649
1663
  s.add(n);
1650
- const a = rn(o.minArgs, o.maxArgs);
1651
- R(e, `${e.errorPrefix}args[1]: Function ${n} accepts ${a}`);
1664
+ const o = an(a.minArgs, a.maxArgs);
1665
+ R(e, `${e.errorPrefix}args[1]: Function ${n} accepts ${o}`);
1652
1666
  }
1653
1667
  }
1654
1668
  }
1655
- function yn(e) {
1669
+ function Fn(e) {
1656
1670
  return [
1657
1671
  ...new Set(
1658
- [...e.matchAll(new RegExp(sn.source, "g"))].map((t) => t[1])
1672
+ [...e.matchAll(new RegExp(on.source, "g"))].map((t) => t[1])
1659
1673
  )
1660
1674
  ];
1661
1675
  }
1662
- function hn(e) {
1676
+ function En(e) {
1663
1677
  const t = e.result.references.filter(
1664
1678
  (n) => !e.canonicalContextKeys.has(G(n))
1665
1679
  );
1666
1680
  if (t.length === 0) return;
1667
- const r = e.contextKeys.map((n) => `[${_t(n)}]`).join(", "), s = t.length === 1 ? `Reference [${t[0]}]` : `References [${t.join("], [")}]`;
1681
+ const r = e.contextKeys.map((n) => `[${Kt(n)}]`).join(", "), s = t.length === 1 ? `Reference [${t[0]}]` : `References [${t.join("], [")}]`;
1668
1682
  R(
1669
1683
  e,
1670
1684
  `${e.errorPrefix}args[1]: ${s} not found in context. Available keys: ${r}`
1671
1685
  );
1672
1686
  }
1673
- function bn(e) {
1674
- if (nn.test(e.formula)) return;
1687
+ function An(e) {
1688
+ if (un.test(e.formula)) return;
1675
1689
  const t = e.result.references.filter((r) => {
1676
1690
  var n;
1677
1691
  const s = (n = e.context[G(r)]) != null ? n : e.context[r];
1678
- return s !== void 0 && !Ut(s);
1692
+ return s !== void 0 && !Jt(s);
1679
1693
  });
1680
1694
  t.length !== 0 && R(
1681
1695
  e,
1682
- `${e.errorPrefix}args[1]: ${un(
1683
- on(e.formula)
1684
- )}Bracket reference(s) ${an(
1696
+ `${e.errorPrefix}args[1]: ${fn(
1697
+ cn(e.formula)
1698
+ )}Bracket reference(s) ${ln(
1685
1699
  t
1686
1700
  )} point to raw attributes and must be wrapped in an aggregative function (e.g. SUM, AVG)`
1687
1701
  );
1688
1702
  }
1689
- function En(e) {
1703
+ function Tn(e) {
1690
1704
  if (!e.warnUnusedContext && !e.errorOnUnusedContext || e.contextKeys.length === 0) return;
1691
1705
  const t = new Set(e.result.references.map(G)), r = e.contextKeys.filter((i) => !t.has(G(i)));
1692
1706
  if (e.result.unusedContextKeys = r, r.length === 0) return;
1693
- const s = r.map((i) => `[${_t(i)}]`).join(", "), n = `${e.errorPrefix}args[2]: Context keys ${s} are defined but not used in formula`;
1707
+ const s = r.map((i) => `[${Kt(i)}]`).join(", "), n = `${e.errorPrefix}args[2]: Context keys ${s} are defined but not used in formula`;
1694
1708
  e.errorOnUnusedContext ? R(e, n) : e.warnUnusedContext && e.result.warnings.push(n);
1695
1709
  }
1696
- function Qe(e, t, r, s) {
1697
- var o;
1698
- const n = (o = s.context[G(e)]) != null ? o : s.context[e];
1710
+ function et(e, t, r, s) {
1711
+ var a;
1712
+ const n = (a = s.context[G(e)]) != null ? a : s.context[e];
1699
1713
  if (n === void 0) return;
1700
- if (!(typeof n == "string" && n.startsWith(w))) {
1701
- Ut(n) && R(
1714
+ if (!(typeof n == "string" && n.startsWith(T))) {
1715
+ Jt(n) && R(
1702
1716
  s,
1703
- `${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimension attributes. Reference [${e}] points to a measure; use an attribute (e.g. ${w}Table.Column.Level).`
1717
+ `${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimension attributes. Reference [${e}] points to a measure; use an attribute (e.g. ${T}Table.Column.Level).`
1704
1718
  );
1705
1719
  return;
1706
1720
  }
1707
1721
  if (s.schemaIndex)
1708
1722
  try {
1709
- const a = ke(n, s.schemaIndex);
1710
- ee(a.column.dataType) ? r && a.level && a.level !== r && R(
1723
+ const o = Ue(n, s.schemaIndex);
1724
+ te(o.column.dataType) ? r && o.level && o.level !== r && R(
1711
1725
  s,
1712
- `${s.errorPrefix}args[1]: ${t.functionName} expects date level '${r}'. Reference [${e}] has level '${a.level}'.`
1726
+ `${s.errorPrefix}args[1]: ${t.functionName} expects date level '${r}'. Reference [${e}] has level '${o.level}'.`
1713
1727
  ) : R(
1714
1728
  s,
1715
- `${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimensions. Reference [${e}] resolves to non-datetime column '${a.column.name}'.`
1729
+ `${s.errorPrefix}args[1]: ${t.functionName} requires datetime dimensions. Reference [${e}] resolves to non-datetime column '${o.column.name}'.`
1716
1730
  );
1717
- } catch (a) {
1718
- const u = a instanceof Error ? a.message : "Unknown error";
1731
+ } catch (o) {
1732
+ const u = o instanceof Error ? o.message : "Unknown error";
1719
1733
  R(s, `${s.errorPrefix}args[1]: ${t.functionName} reference [${e}]: ${u}`);
1720
1734
  }
1721
1735
  }
1722
- function Fn(e) {
1723
- const t = Bt(), r = Pt(e.formula, t);
1736
+ function wn(e) {
1737
+ const t = Wt(), r = Gt(e.formula, t);
1724
1738
  for (const s of r) {
1725
- const n = Lt(s.functionName);
1726
- Qe(s.ref1, s, n, e), Qe(s.ref2, s, n, e);
1739
+ const n = Vt(s.functionName);
1740
+ et(s.ref1, s, n, e), et(s.ref2, s, n, e);
1727
1741
  }
1728
1742
  }
1729
- function An(e, t, r = {}) {
1743
+ function Sn(e, t, r = {}) {
1730
1744
  var n;
1731
- const s = cn(e, t, r);
1732
- return !e || e.trim().length === 0 ? ((n = r.allowEmptyFormula) != null && n || R(s, `${s.errorPrefix}args[1]: Formula cannot be empty`), s.result) : (dn(s), gn(s), s.result.references = yn(e), s.result.references.length === 0 ? (s.result.warnings.push(
1745
+ const s = dn(e, t, r);
1746
+ return !e || e.trim().length === 0 ? ((n = r.allowEmptyFormula) != null && n || R(s, `${s.errorPrefix}args[1]: Formula cannot be empty`), s.result) : (pn(s), bn(s), s.result.references = Fn(e), s.result.references.length === 0 ? (s.result.warnings.push(
1733
1747
  `${s.errorPrefix}args[1]: No bracket references found in formula - ensure this is intentional`
1734
1748
  ), s.result) : s.contextKeys.length === 0 ? (R(
1735
1749
  s,
1736
1750
  `${s.errorPrefix}args[2]: Context cannot be empty - custom formulas require context definitions`
1737
- ), s.result) : (hn(s), bn(s), En(s), Fn(s), s.result));
1751
+ ), s.result) : (En(s), An(s), Tn(s), wn(s), s.result));
1738
1752
  }
1739
- function wn(e, t, r = {}) {
1740
- const s = An(e, t, r);
1753
+ function Cn(e, t, r = {}) {
1754
+ const s = Sn(e, t, r);
1741
1755
  if (!s.isValid)
1742
1756
  throw new Error(s.errors.join("; "));
1743
1757
  s.warnings.length > 0 && console.warn("Formula validation warnings:", s.warnings.join("; "));
1744
1758
  }
1745
- function Tn(e, t) {
1759
+ function On(e, t) {
1746
1760
  if (e.length < 3 || e.length > 5)
1747
1761
  throw new Error(
1748
1762
  `${t.pathPrefix}Expected 3, 4, or 5 arguments for customFormula (title, formula, context, format?, description?)`
@@ -1753,12 +1767,12 @@ function Tn(e, t) {
1753
1767
  `${t.pathPrefix}args[1]: Expected formula string, got ${typeof r}`
1754
1768
  );
1755
1769
  const s = r, n = e[2];
1756
- if (!O(n))
1770
+ if (!$(n))
1757
1771
  throw new Error(
1758
1772
  `${t.pathPrefix}args[2]: Expected context object, got ${n === null ? "null" : typeof n}`
1759
1773
  );
1760
1774
  const i = n;
1761
- wn(s, i, {
1775
+ Cn(s, i, {
1762
1776
  errorPrefix: `${t.pathPrefix}`,
1763
1777
  errorOnUnusedContext: !0,
1764
1778
  // Strict validation: all context keys must be used
@@ -1766,11 +1780,11 @@ function Tn(e, t) {
1766
1780
  // Custom formulas must have content
1767
1781
  schemaIndex: t.schemaIndex
1768
1782
  });
1769
- const o = Sn(s), a = {};
1783
+ const a = qn(s), o = {};
1770
1784
  for (const [u, c] of Object.entries(i)) {
1771
1785
  const g = `args[2].${u}`;
1772
- if (q(c))
1773
- a[`${u}`] = M({
1786
+ if (w(c))
1787
+ o[`${u}`] = M({
1774
1788
  data: c,
1775
1789
  context: {
1776
1790
  dataSource: t.dataSource,
@@ -1778,122 +1792,122 @@ function Tn(e, t) {
1778
1792
  pathPrefix: g
1779
1793
  }
1780
1794
  });
1781
- else if (typeof c == "string" && c.startsWith(w)) {
1782
- const d = u.startsWith("[") && u.endsWith("]") ? u.slice(1, -1) : u, m = o[d];
1795
+ else if (typeof c == "string" && c.startsWith(T)) {
1796
+ const f = u.startsWith("[") && u.endsWith("]") ? u.slice(1, -1) : u, p = a[f];
1783
1797
  try {
1784
- a[`${u}`] = Z(
1798
+ o[`${u}`] = ee(
1785
1799
  c,
1786
1800
  t.dataSource,
1787
1801
  t.schemaIndex,
1788
- m !== void 0 ? { inferredDateLevel: m } : void 0
1802
+ p !== void 0 ? { inferredDateLevel: p } : void 0
1789
1803
  );
1790
1804
  } catch (h) {
1791
1805
  const b = h instanceof Error ? h.message : "Unknown error";
1792
1806
  throw new Error(`${g}: ${b}`);
1793
1807
  }
1794
1808
  } else if (c && typeof c == "object" && "kind" in c)
1795
- a[`${u}`] = c;
1809
+ o[`${u}`] = c;
1796
1810
  else
1797
1811
  throw new Error(
1798
- `${g}: Invalid context value for key '${u}'. Expected a function call or attribute reference (${w}...), but got: ${typeof c}`
1812
+ `${g}: Invalid context value for key '${u}'. Expected a function call or attribute reference (${T}...), but got: ${typeof c}`
1799
1813
  );
1800
1814
  }
1801
- return [e[0], e[1], a, ...e.slice(3)];
1815
+ return [e[0], e[1], o, ...e.slice(3)];
1802
1816
  }
1803
- function Sn(e) {
1804
- const t = Bt(), r = Pt(e, t), s = {};
1817
+ function qn(e) {
1818
+ const t = Wt(), r = Gt(e, t), s = {};
1805
1819
  for (const n of r) {
1806
- const i = Lt(n.functionName);
1820
+ const i = Vt(n.functionName);
1807
1821
  if (i !== void 0)
1808
- for (const o of [n.ref1, n.ref2]) {
1809
- const a = s[o];
1810
- if (a !== void 0 && a !== i)
1822
+ for (const a of [n.ref1, n.ref2]) {
1823
+ const o = s[a];
1824
+ if (o !== void 0 && o !== i)
1811
1825
  throw new Error(
1812
- `Reference [${o}] is used in xdiff functions with conflicting date levels ('${a}' and '${i}'). Specify the date level in the context (e.g. DM.Table.Column.${i}).`
1826
+ `Reference [${a}] is used in xdiff functions with conflicting date levels ('${o}' and '${i}'). Specify the date level in the context (e.g. DM.Table.Column.${i}).`
1813
1827
  );
1814
- s[o] = i;
1828
+ s[a] = i;
1815
1829
  }
1816
1830
  }
1817
1831
  return s;
1818
1832
  }
1819
- function Vt(e) {
1833
+ function Ht(e) {
1820
1834
  return e.type === j.TextAttribute;
1821
1835
  }
1822
- function jt(e) {
1836
+ function Qt(e) {
1823
1837
  return e.type === j.NumericAttribute;
1824
1838
  }
1825
- function Cn(e) {
1839
+ function $n(e) {
1826
1840
  return e.type === j.DateLevel;
1827
1841
  }
1828
- function qn(e) {
1829
- return Vt(e) || jt(e);
1842
+ function Dn(e) {
1843
+ return Ht(e) || Qt(e);
1830
1844
  }
1831
- function pe(e) {
1845
+ function ge(e) {
1832
1846
  return e.type === j.TextAttribute ? "text" : e.type === j.NumericAttribute ? "numeric" : e.type === j.DateLevel ? "date/datetime" : "unknown";
1833
1847
  }
1834
- function Le(e, t) {
1848
+ function Pe(e, t) {
1835
1849
  const r = e[0];
1836
1850
  if (!r || typeof r != "object" || !("type" in r))
1837
1851
  throw new Error(`${t.pathPrefix}args[0]: Expected attribute as first argument`);
1838
1852
  return r;
1839
1853
  }
1840
- function Xe(e, t) {
1841
- const r = Le(e, t);
1842
- if (!qn(r))
1854
+ function tt(e, t) {
1855
+ const r = Pe(e, t);
1856
+ if (!Dn(r))
1843
1857
  throw new Error(
1844
- `${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${pe(
1858
+ `${t.pathPrefix}args[0]: Attribute must be string or numeric type, got ${ge(
1845
1859
  r
1846
1860
  )} attribute`
1847
1861
  );
1848
1862
  return e;
1849
1863
  }
1850
- function L(e, t) {
1851
- const r = Le(e, t);
1852
- if (!jt(r))
1864
+ function B(e, t) {
1865
+ const r = Pe(e, t);
1866
+ if (!Qt(r))
1853
1867
  throw new Error(
1854
- `${t.pathPrefix}args[0]: Attribute must be numeric type, got ${pe(
1868
+ `${t.pathPrefix}args[0]: Attribute must be numeric type, got ${ge(
1855
1869
  r
1856
1870
  )} attribute`
1857
1871
  );
1858
1872
  return e;
1859
1873
  }
1860
1874
  function z(e, t) {
1861
- const r = Le(e, t);
1862
- if (!Vt(r))
1875
+ const r = Pe(e, t);
1876
+ if (!Ht(r))
1863
1877
  throw new Error(
1864
- `${t.pathPrefix}args[0]: Attribute must be string type, got ${pe(
1878
+ `${t.pathPrefix}args[0]: Attribute must be string type, got ${ge(
1865
1879
  r
1866
1880
  )} attribute`
1867
1881
  );
1868
1882
  return e;
1869
1883
  }
1870
- function $n(e, t) {
1884
+ function xn(e, t) {
1871
1885
  const r = e[0];
1872
1886
  if (!r || typeof r != "object" || !("attribute" in r))
1873
1887
  throw new Error(`${t.pathPrefix}args[0]: Expected filter as first argument`);
1874
1888
  return r;
1875
1889
  }
1876
- function On(e, t) {
1877
- const r = $n(e, t);
1878
- if (!De(r))
1890
+ function Nn(e, t) {
1891
+ const r = xn(e, t);
1892
+ if (!ve(r))
1879
1893
  throw new Error(
1880
1894
  `${t.pathPrefix}args[0]: exclude filter only accepts members filter, got ${r.__serializable || "unknown"} filter`
1881
1895
  );
1882
1896
  return e;
1883
1897
  }
1884
- const Dn = {
1885
- "measureFactory.customFormula": Tn,
1898
+ const vn = {
1899
+ "measureFactory.customFormula": On,
1886
1900
  // String | Number filters
1887
- "filterFactory.equals": Xe,
1888
- "filterFactory.doesntEqual": Xe,
1901
+ "filterFactory.equals": tt,
1902
+ "filterFactory.doesntEqual": tt,
1889
1903
  // Numeric filters
1890
- "filterFactory.greaterThan": L,
1891
- "filterFactory.greaterThanOrEqual": L,
1892
- "filterFactory.lessThan": L,
1893
- "filterFactory.lessThanOrEqual": L,
1894
- "filterFactory.between": L,
1895
- "filterFactory.betweenNotEqual": L,
1896
- "filterFactory.numeric": L,
1904
+ "filterFactory.greaterThan": B,
1905
+ "filterFactory.greaterThanOrEqual": B,
1906
+ "filterFactory.lessThan": B,
1907
+ "filterFactory.lessThanOrEqual": B,
1908
+ "filterFactory.between": B,
1909
+ "filterFactory.betweenNotEqual": B,
1910
+ "filterFactory.numeric": B,
1897
1911
  // String filters
1898
1912
  "filterFactory.contains": z,
1899
1913
  "filterFactory.doesntContain": z,
@@ -1903,66 +1917,66 @@ const Dn = {
1903
1917
  "filterFactory.doesntEndWith": z,
1904
1918
  "filterFactory.like": z,
1905
1919
  // Exclude filter
1906
- "filterFactory.exclude": On
1920
+ "filterFactory.exclude": Nn
1907
1921
  };
1908
- function xn(e) {
1909
- return Dn[`${e}`];
1922
+ function Mn(e) {
1923
+ return vn[`${e}`];
1910
1924
  }
1911
- const Jt = {
1925
+ const Xt = {
1912
1926
  // ==================== MEASURE FACTORY FUNCTIONS ====================
1913
1927
  // Basic aggregations
1914
1928
  "measureFactory.sum": [
1915
1929
  { type: "Attribute", required: !0 },
1916
- { type: "string", required: !1 },
1930
+ { type: "string", required: !1, isName: !0 },
1917
1931
  // name
1918
1932
  { type: "string", required: !1 }
1919
1933
  // format
1920
1934
  ],
1921
1935
  "measureFactory.average": [
1922
1936
  { type: "Attribute", required: !0 },
1923
- { type: "string", required: !1 },
1937
+ { type: "string", required: !1, isName: !0 },
1924
1938
  // name
1925
1939
  { type: "string", required: !1 }
1926
1940
  // format
1927
1941
  ],
1928
1942
  "measureFactory.avg": [
1929
1943
  { type: "Attribute", required: !0 },
1930
- { type: "string", required: !1 },
1944
+ { type: "string", required: !1, isName: !0 },
1931
1945
  // name
1932
1946
  { type: "string", required: !1 }
1933
1947
  // format
1934
1948
  ],
1935
1949
  "measureFactory.min": [
1936
1950
  { type: "Attribute", required: !0 },
1937
- { type: "string", required: !1 },
1951
+ { type: "string", required: !1, isName: !0 },
1938
1952
  // name
1939
1953
  { type: "string", required: !1 }
1940
1954
  // format
1941
1955
  ],
1942
1956
  "measureFactory.max": [
1943
1957
  { type: "Attribute", required: !0 },
1944
- { type: "string", required: !1 },
1958
+ { type: "string", required: !1, isName: !0 },
1945
1959
  // name
1946
1960
  { type: "string", required: !1 }
1947
1961
  // format
1948
1962
  ],
1949
1963
  "measureFactory.median": [
1950
1964
  { type: "Attribute", required: !0 },
1951
- { type: "string", required: !1 },
1965
+ { type: "string", required: !1, isName: !0 },
1952
1966
  // name
1953
1967
  { type: "string", required: !1 }
1954
1968
  // format
1955
1969
  ],
1956
1970
  "measureFactory.count": [
1957
1971
  { type: "Attribute", required: !0 },
1958
- { type: "string", required: !1 },
1972
+ { type: "string", required: !1, isName: !0 },
1959
1973
  // name
1960
1974
  { type: "string", required: !1 }
1961
1975
  // format
1962
1976
  ],
1963
1977
  "measureFactory.countDistinct": [
1964
1978
  { type: "Attribute", required: !0 },
1965
- { type: "string", required: !1 },
1979
+ { type: "string", required: !1, isName: !0 },
1966
1980
  // name
1967
1981
  { type: "string", required: !1 }
1968
1982
  // format
@@ -1971,7 +1985,7 @@ const Jt = {
1971
1985
  { type: "Attribute", required: !0 },
1972
1986
  { type: "string", required: !0 },
1973
1987
  // aggregationType
1974
- { type: "string", required: !1 },
1988
+ { type: "string", required: !1, isName: !0 },
1975
1989
  // name
1976
1990
  { type: "string", required: !1 }
1977
1991
  // format
@@ -1979,7 +1993,7 @@ const Jt = {
1979
1993
  // Constants and formulas
1980
1994
  "measureFactory.constant": [{ type: "number", required: !0 }],
1981
1995
  "measureFactory.customFormula": [
1982
- { type: "string", required: !0 },
1996
+ { type: "string", required: !0, isName: !0 },
1983
1997
  // title
1984
1998
  { type: "string", required: !0 },
1985
1999
  // formula
@@ -1994,7 +2008,7 @@ const Jt = {
1994
2008
  "measureFactory.add": [
1995
2009
  { type: "Measure | number", required: !0 },
1996
2010
  { type: "Measure | number", required: !0 },
1997
- { type: "string", required: !1 },
2011
+ { type: "string", required: !1, isName: !0 },
1998
2012
  // name
1999
2013
  { type: "boolean", required: !1 }
2000
2014
  // withParentheses
@@ -2002,7 +2016,7 @@ const Jt = {
2002
2016
  "measureFactory.subtract": [
2003
2017
  { type: "Measure | number", required: !0 },
2004
2018
  { type: "Measure | number", required: !0 },
2005
- { type: "string", required: !1 },
2019
+ { type: "string", required: !1, isName: !0 },
2006
2020
  // name
2007
2021
  { type: "boolean", required: !1 }
2008
2022
  // withParentheses
@@ -2010,7 +2024,7 @@ const Jt = {
2010
2024
  "measureFactory.multiply": [
2011
2025
  { type: "Measure | number", required: !0 },
2012
2026
  { type: "Measure | number", required: !0 },
2013
- { type: "string", required: !1 },
2027
+ { type: "string", required: !1, isName: !0 },
2014
2028
  // name
2015
2029
  { type: "boolean", required: !1 }
2016
2030
  // withParentheses
@@ -2018,7 +2032,7 @@ const Jt = {
2018
2032
  "measureFactory.divide": [
2019
2033
  { type: "Measure | number", required: !0 },
2020
2034
  { type: "Measure | number", required: !0 },
2021
- { type: "string", required: !1 },
2035
+ { type: "string", required: !1, isName: !0 },
2022
2036
  // name
2023
2037
  { type: "boolean", required: !1 }
2024
2038
  // withParentheses
@@ -2027,14 +2041,14 @@ const Jt = {
2027
2041
  "measureFactory.measuredValue": [
2028
2042
  { type: "Measure", required: !0 },
2029
2043
  { type: "Filter[]", required: !0 },
2030
- { type: "string", required: !1 },
2044
+ { type: "string", required: !1, isName: !0 },
2031
2045
  // name
2032
2046
  { type: "string", required: !1 }
2033
2047
  // format
2034
2048
  ],
2035
2049
  "measureFactory.rank": [
2036
2050
  { type: "Measure", required: !0 },
2037
- { type: "string", required: !1 },
2051
+ { type: "string", required: !1, isName: !0 },
2038
2052
  // name
2039
2053
  { type: "string", required: !1 },
2040
2054
  // sort
@@ -2045,14 +2059,14 @@ const Jt = {
2045
2059
  ],
2046
2060
  "measureFactory.trend": [
2047
2061
  { type: "Measure", required: !0 },
2048
- { type: "string", required: !1 },
2062
+ { type: "string", required: !1, isName: !0 },
2049
2063
  // name
2050
2064
  { type: "any", required: !1 }
2051
2065
  // options
2052
2066
  ],
2053
2067
  "measureFactory.forecast": [
2054
2068
  { type: "Measure", required: !0 },
2055
- { type: "string", required: !1 },
2069
+ { type: "string", required: !1, isName: !0 },
2056
2070
  // name
2057
2071
  { type: "any", required: !1 }
2058
2072
  // options
@@ -2060,117 +2074,117 @@ const Jt = {
2060
2074
  // Time-based aggregations
2061
2075
  "measureFactory.yearToDateSum": [
2062
2076
  { type: "Measure", required: !0 },
2063
- { type: "string", required: !1 }
2077
+ { type: "string", required: !1, isName: !0 }
2064
2078
  // name
2065
2079
  ],
2066
2080
  "measureFactory.quarterToDateSum": [
2067
2081
  { type: "Measure", required: !0 },
2068
- { type: "string", required: !1 }
2082
+ { type: "string", required: !1, isName: !0 }
2069
2083
  // name
2070
2084
  ],
2071
2085
  "measureFactory.monthToDateSum": [
2072
2086
  { type: "Measure", required: !0 },
2073
- { type: "string", required: !1 }
2087
+ { type: "string", required: !1, isName: !0 }
2074
2088
  // name
2075
2089
  ],
2076
2090
  "measureFactory.weekToDateSum": [
2077
2091
  { type: "Measure", required: !0 },
2078
- { type: "string", required: !1 }
2092
+ { type: "string", required: !1, isName: !0 }
2079
2093
  // name
2080
2094
  ],
2081
2095
  "measureFactory.runningSum": [
2082
2096
  { type: "Measure", required: !0 },
2083
2097
  { type: "boolean", required: !1 },
2084
2098
  // continuous
2085
- { type: "string", required: !1 }
2099
+ { type: "string", required: !1, isName: !0 }
2086
2100
  // name
2087
2101
  ],
2088
2102
  // Growth and difference calculations
2089
2103
  "measureFactory.growth": [
2090
2104
  { type: "Measure", required: !0 },
2091
- { type: "string", required: !1 }
2105
+ { type: "string", required: !1, isName: !0 }
2092
2106
  // name
2093
2107
  ],
2094
2108
  "measureFactory.growthRate": [
2095
2109
  { type: "Measure", required: !0 },
2096
- { type: "string", required: !1 }
2110
+ { type: "string", required: !1, isName: !0 }
2097
2111
  // name
2098
2112
  ],
2099
2113
  "measureFactory.growthPastWeek": [
2100
2114
  { type: "Measure", required: !0 },
2101
- { type: "string", required: !1 }
2115
+ { type: "string", required: !1, isName: !0 }
2102
2116
  // name
2103
2117
  ],
2104
2118
  "measureFactory.growthPastMonth": [
2105
2119
  { type: "Measure", required: !0 },
2106
- { type: "string", required: !1 }
2120
+ { type: "string", required: !1, isName: !0 }
2107
2121
  // name
2108
2122
  ],
2109
2123
  "measureFactory.growthPastQuarter": [
2110
2124
  { type: "Measure", required: !0 },
2111
- { type: "string", required: !1 }
2125
+ { type: "string", required: !1, isName: !0 }
2112
2126
  // name
2113
2127
  ],
2114
2128
  "measureFactory.growthPastYear": [
2115
2129
  { type: "Measure", required: !0 },
2116
- { type: "string", required: !1 }
2130
+ { type: "string", required: !1, isName: !0 }
2117
2131
  // name
2118
2132
  ],
2119
2133
  "measureFactory.difference": [
2120
2134
  { type: "Measure", required: !0 },
2121
- { type: "string", required: !1 }
2135
+ { type: "string", required: !1, isName: !0 }
2122
2136
  // name
2123
2137
  ],
2124
2138
  "measureFactory.diffPastWeek": [
2125
2139
  { type: "Measure", required: !0 },
2126
- { type: "string", required: !1 }
2140
+ { type: "string", required: !1, isName: !0 }
2127
2141
  // name
2128
2142
  ],
2129
2143
  "measureFactory.diffPastMonth": [
2130
2144
  { type: "Measure", required: !0 },
2131
- { type: "string", required: !1 }
2145
+ { type: "string", required: !1, isName: !0 }
2132
2146
  // name
2133
2147
  ],
2134
2148
  "measureFactory.diffPastQuarter": [
2135
2149
  { type: "Measure", required: !0 },
2136
- { type: "string", required: !1 }
2150
+ { type: "string", required: !1, isName: !0 }
2137
2151
  // name
2138
2152
  ],
2139
2153
  "measureFactory.diffPastYear": [
2140
2154
  { type: "Measure", required: !0 },
2141
- { type: "string", required: !1 }
2155
+ { type: "string", required: !1, isName: !0 }
2142
2156
  // name
2143
2157
  ],
2144
2158
  // Past period measures
2145
2159
  "measureFactory.pastDay": [
2146
2160
  { type: "Measure", required: !0 },
2147
- { type: "string", required: !1 }
2161
+ { type: "string", required: !1, isName: !0 }
2148
2162
  // name
2149
2163
  ],
2150
2164
  "measureFactory.pastWeek": [
2151
2165
  { type: "Measure", required: !0 },
2152
- { type: "string", required: !1 }
2166
+ { type: "string", required: !1, isName: !0 }
2153
2167
  // name
2154
2168
  ],
2155
2169
  "measureFactory.pastMonth": [
2156
2170
  { type: "Measure", required: !0 },
2157
- { type: "string", required: !1 }
2171
+ { type: "string", required: !1, isName: !0 }
2158
2172
  // name
2159
2173
  ],
2160
2174
  "measureFactory.pastQuarter": [
2161
2175
  { type: "Measure", required: !0 },
2162
- { type: "string", required: !1 }
2176
+ { type: "string", required: !1, isName: !0 }
2163
2177
  // name
2164
2178
  ],
2165
2179
  "measureFactory.pastYear": [
2166
2180
  { type: "Measure", required: !0 },
2167
- { type: "string", required: !1 }
2181
+ { type: "string", required: !1, isName: !0 }
2168
2182
  // name
2169
2183
  ],
2170
2184
  // Statistics
2171
2185
  "measureFactory.contribution": [
2172
2186
  { type: "Measure", required: !0 },
2173
- { type: "string", required: !1 }
2187
+ { type: "string", required: !1, isName: !0 }
2174
2188
  // name
2175
2189
  ],
2176
2190
  // ==================== FILTER FACTORY FUNCTIONS ====================
@@ -2435,18 +2449,18 @@ const Jt = {
2435
2449
  { type: "FilterRelationsNode", required: !0 }
2436
2450
  ]
2437
2451
  };
2438
- function ze(e) {
2439
- return Jt[`${e}`];
2452
+ function ye(e) {
2453
+ return Xt[`${e}`];
2440
2454
  }
2441
- function vn(e) {
2442
- const t = ze(e);
2455
+ function Rn(e) {
2456
+ const t = ye(e);
2443
2457
  return t ? t.filter((r) => r.required).length : 0;
2444
2458
  }
2445
- function Nn(e) {
2446
- const t = ze(e);
2459
+ function In(e) {
2460
+ const t = ye(e);
2447
2461
  return t ? t.length : 0;
2448
2462
  }
2449
- function Mn(e) {
2463
+ function kn(e) {
2450
2464
  if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e))
2451
2465
  return !1;
2452
2466
  const r = Date.parse(e);
@@ -2455,319 +2469,319 @@ function Mn(e) {
2455
2469
  const s = new Date(e);
2456
2470
  return !isNaN(s.getTime());
2457
2471
  }
2458
- function Fe(e, t, r, s) {
2459
- if (e.startsWith(w))
2472
+ function we(e, t, r, s) {
2473
+ if (e.startsWith(T))
2460
2474
  try {
2461
- return Z(e, t, r);
2475
+ return ee(e, t, r);
2462
2476
  } catch (n) {
2463
2477
  const i = n instanceof Error ? n.message : "Unknown error";
2464
2478
  throw new Error(`${s}: ${i}`);
2465
2479
  }
2466
2480
  throw new Error(
2467
- `${s}: Invalid attribute '${e}'. Expected format: '${w}TableName.ColumnName[.Level]'`
2481
+ `${s}: Invalid attribute '${e}'. Expected format: '${T}TableName.ColumnName[.Level]'`
2468
2482
  );
2469
2483
  }
2470
- function Rn(e, t, r, s) {
2471
- if (e.startsWith(w))
2484
+ function Ln(e, t, r, s) {
2485
+ if (e.startsWith(T))
2472
2486
  try {
2473
- return Js(e, t, r);
2487
+ return Ys(e, t, r);
2474
2488
  } catch (n) {
2475
2489
  const i = n instanceof Error ? n.message : "Unknown error";
2476
2490
  throw new Error(`${s}: ${i}`);
2477
2491
  }
2478
2492
  throw new Error(
2479
- `${s}: Invalid date dimension string '${e}'. Expected format: '${w}TableName.ColumnName'`
2493
+ `${s}: Invalid date dimension string '${e}'. Expected format: '${T}TableName.ColumnName'`
2480
2494
  );
2481
2495
  }
2482
- function In(e) {
2483
- const t = e.data, { argSchema: r, dataSource: s, schemaIndex: n, pathPrefix: i } = e.context, o = i;
2496
+ function Bn(e) {
2497
+ const t = e.data, { argSchema: r, dataSource: s, schemaIndex: n, pathPrefix: i } = e.context, a = i;
2484
2498
  if (t === void 0) {
2485
2499
  if (r.required)
2486
- throw new Error(`${o}: Required argument is missing (expected ${r.type})`);
2500
+ throw new Error(`${a}: Required argument is missing (expected ${r.type})`);
2487
2501
  return;
2488
2502
  }
2489
2503
  if (!(t === null && !r.required))
2490
2504
  switch (r.type) {
2491
2505
  case "string":
2492
2506
  if (typeof t != "string")
2493
- throw new Error(`${o}: Expected string, got ${typeof t}`);
2507
+ throw new Error(`${a}: Expected string, got ${typeof t}`);
2494
2508
  return t;
2495
2509
  case "number":
2496
2510
  if (typeof t != "number")
2497
- throw new Error(`${o}: Expected number, got ${typeof t}`);
2511
+ throw new Error(`${a}: Expected number, got ${typeof t}`);
2498
2512
  return t;
2499
2513
  case "boolean":
2500
2514
  if (typeof t != "boolean")
2501
- throw new Error(`${o}: Expected boolean, got ${typeof t}`);
2515
+ throw new Error(`${a}: Expected boolean, got ${typeof t}`);
2502
2516
  return t;
2503
2517
  case "string[]":
2504
2518
  if (!Array.isArray(t))
2505
2519
  throw new Error(
2506
- `${o}: Expected array of strings, got ${typeof t}. Example: ['value1', 'value2']`
2520
+ `${a}: Expected array of strings, got ${typeof t}. Example: ['value1', 'value2']`
2507
2521
  );
2508
- if (!t.every((a) => typeof a == "string"))
2522
+ if (!t.every((o) => typeof o == "string"))
2509
2523
  throw new Error(
2510
- `${o}: Expected array of strings, but contains non-string values`
2524
+ `${a}: Expected array of strings, but contains non-string values`
2511
2525
  );
2512
2526
  return t;
2513
2527
  case "number[]":
2514
2528
  if (!Array.isArray(t))
2515
2529
  throw new Error(
2516
- `${o}: Expected array of numbers, got ${typeof t}. Example: [10, 20]`
2530
+ `${a}: Expected array of numbers, got ${typeof t}. Example: [10, 20]`
2517
2531
  );
2518
- if (!t.every((a) => typeof a == "number"))
2532
+ if (!t.every((o) => typeof o == "number"))
2519
2533
  throw new Error(
2520
- `${o}: Expected array of numbers, but contains non-number values`
2534
+ `${a}: Expected array of numbers, but contains non-number values`
2521
2535
  );
2522
2536
  return t;
2523
2537
  case "Attribute":
2524
2538
  if (typeof t != "string")
2525
2539
  throw new Error(
2526
- `${o}: Expected attribute string, got ${typeof t}. Example: 'DM.Commerce.Revenue'`
2540
+ `${a}: Expected attribute string, got ${typeof t}. Example: 'DM.Commerce.Revenue'`
2527
2541
  );
2528
- return Fe(t, s, n, o);
2542
+ return we(t, s, n, a);
2529
2543
  case "Attribute[]":
2530
2544
  if (!Array.isArray(t))
2531
2545
  throw new Error(
2532
- `${o}: Expected array of attributes, got ${typeof t}. Example: ['DM.Commerce.AgeRange']`
2546
+ `${a}: Expected array of attributes, got ${typeof t}. Example: ['DM.Commerce.AgeRange']`
2533
2547
  );
2534
- return t.map((a, u) => {
2535
- if (typeof a != "string")
2536
- throw new Error(`${o}[${u}]: Expected attribute string, got ${typeof a}`);
2537
- return Fe(a, s, n, `${o}[${u}]`);
2548
+ return t.map((o, u) => {
2549
+ if (typeof o != "string")
2550
+ throw new Error(`${a}[${u}]: Expected attribute string, got ${typeof o}`);
2551
+ return we(o, s, n, `${a}[${u}]`);
2538
2552
  });
2539
2553
  case "Measure":
2540
2554
  case "BaseMeasure":
2541
- if (!q(t))
2555
+ if (!w(t))
2542
2556
  throw new Error(
2543
- `${o}: Expected measure function call, got ${typeof t}. Example: {'function': 'measureFactory.sum', 'args': ['DM.Commerce.Revenue']}`
2557
+ `${a}: Expected measure function call, got ${typeof t}. Example: {'function': 'measureFactory.sum', 'args': ['DM.Commerce.Revenue']}`
2544
2558
  );
2545
2559
  return M({
2546
2560
  data: t,
2547
- context: { dataSource: s, schemaIndex: n, pathPrefix: o }
2561
+ context: { dataSource: s, schemaIndex: n, pathPrefix: a }
2548
2562
  });
2549
2563
  case "Measure[]":
2550
2564
  if (!Array.isArray(t))
2551
2565
  throw new Error(
2552
- `${o}: Expected array of measure function calls, got ${typeof t}`
2566
+ `${a}: Expected array of measure function calls, got ${typeof t}`
2553
2567
  );
2554
- return t.map((a, u) => {
2555
- if (!q(a))
2568
+ return t.map((o, u) => {
2569
+ if (!w(o))
2556
2570
  throw new Error(
2557
- `${o}[${u}]: Expected measure function call, got ${typeof a}`
2571
+ `${a}[${u}]: Expected measure function call, got ${typeof o}`
2558
2572
  );
2559
2573
  return M({
2560
- data: a,
2561
- context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
2574
+ data: o,
2575
+ context: { dataSource: s, schemaIndex: n, pathPrefix: `${a}[${u}]` }
2562
2576
  });
2563
2577
  });
2564
2578
  case "Filter":
2565
- if (!q(t))
2579
+ if (!w(t))
2566
2580
  throw new Error(
2567
- `${o}: Expected filter function call, got ${typeof t}. Example: {'function': 'filterFactory.contains', 'args': ['DM.Brand.Brand', 'Apple']}`
2581
+ `${a}: Expected filter function call, got ${typeof t}. Example: {'function': 'filterFactory.contains', 'args': ['DM.Brand.Brand', 'Apple']}`
2568
2582
  );
2569
2583
  return M({
2570
2584
  data: t,
2571
- context: { dataSource: s, schemaIndex: n, pathPrefix: o }
2585
+ context: { dataSource: s, schemaIndex: n, pathPrefix: a }
2572
2586
  });
2573
2587
  case "Filter[]":
2574
2588
  if (!Array.isArray(t))
2575
2589
  throw new Error(
2576
- `${o}: Expected array of filter function calls, got ${typeof t}`
2590
+ `${a}: Expected array of filter function calls, got ${typeof t}`
2577
2591
  );
2578
- return t.map((a, u) => {
2579
- if (!q(a))
2592
+ return t.map((o, u) => {
2593
+ if (!w(o))
2580
2594
  throw new Error(
2581
- `${o}[${u}]: Expected filter function call, got ${typeof a}`
2595
+ `${a}[${u}]: Expected filter function call, got ${typeof o}`
2582
2596
  );
2583
2597
  return M({
2584
- data: a,
2585
- context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
2598
+ data: o,
2599
+ context: { dataSource: s, schemaIndex: n, pathPrefix: `${a}[${u}]` }
2586
2600
  });
2587
2601
  });
2588
2602
  case "FilterRelationsNode":
2589
2603
  if (Array.isArray(t))
2590
- return t.map((a, u) => {
2591
- if (!q(a))
2604
+ return t.map((o, u) => {
2605
+ if (!w(o))
2592
2606
  throw new Error(
2593
- `${o}[${u}]: Expected filter function call, got ${typeof a}`
2607
+ `${a}[${u}]: Expected filter function call, got ${typeof o}`
2594
2608
  );
2595
2609
  return M({
2596
- data: a,
2597
- context: { dataSource: s, schemaIndex: n, pathPrefix: `${o}[${u}]` }
2610
+ data: o,
2611
+ context: { dataSource: s, schemaIndex: n, pathPrefix: `${a}[${u}]` }
2598
2612
  });
2599
2613
  });
2600
- if (q(t))
2614
+ if (w(t))
2601
2615
  return M({
2602
2616
  data: t,
2603
- context: { dataSource: s, schemaIndex: n, pathPrefix: o }
2617
+ context: { dataSource: s, schemaIndex: n, pathPrefix: a }
2604
2618
  });
2605
2619
  throw new Error(
2606
- `${o}: Expected filter function call or array of filters, got ${typeof t}`
2620
+ `${a}: Expected filter function call or array of filters, got ${typeof t}`
2607
2621
  );
2608
2622
  case "DateDimension":
2609
2623
  if (typeof t != "string")
2610
2624
  throw new Error(
2611
- `${o}: Expected date dimension string, got ${typeof t}. Example: 'DM.Commerce.Date'`
2625
+ `${a}: Expected date dimension string, got ${typeof t}. Example: 'DM.Commerce.Date'`
2612
2626
  );
2613
- return Rn(t, s, n, o);
2627
+ return Ln(t, s, n, a);
2614
2628
  case "LevelAttribute": {
2615
2629
  if (typeof t != "string")
2616
2630
  throw new Error(
2617
- `${o}: Expected date attribute string, got ${typeof t}. Example: 'DM.Commerce.Date.Years'`
2631
+ `${a}: Expected date attribute string, got ${typeof t}. Example: 'DM.Commerce.Date.Years'`
2618
2632
  );
2619
- const a = Fe(
2633
+ const o = we(
2620
2634
  t,
2621
2635
  s,
2622
2636
  n,
2623
- o
2637
+ a
2624
2638
  );
2625
- if (!Cn(a))
2639
+ if (!$n(o))
2626
2640
  throw new Error(
2627
- `${o}: Attribute must be date/datetime type, got ${pe(
2628
- a
2641
+ `${a}: Attribute must be date/datetime type, got ${ge(
2642
+ o
2629
2643
  )} attribute`
2630
2644
  );
2631
- return a;
2645
+ return o;
2632
2646
  }
2633
2647
  case "Measure | number":
2634
2648
  if (typeof t == "number")
2635
2649
  return t;
2636
- if (q(t))
2650
+ if (w(t))
2637
2651
  return M({
2638
2652
  data: t,
2639
- context: { dataSource: s, schemaIndex: n, pathPrefix: o }
2653
+ context: { dataSource: s, schemaIndex: n, pathPrefix: a }
2640
2654
  });
2641
2655
  throw new Error(
2642
- `${o}: Expected measure function call or number, got ${typeof t}`
2656
+ `${a}: Expected measure function call or number, got ${typeof t}`
2643
2657
  );
2644
2658
  case "Date | string":
2645
2659
  if (typeof t == "string") {
2646
- if (Mn(t))
2660
+ if (kn(t))
2647
2661
  return t;
2648
2662
  throw new Error(
2649
- `${o}: Expected valid ISO date string or Date object, got invalid date string '${t}'`
2663
+ `${a}: Expected valid ISO date string or Date object, got invalid date string '${t}'`
2650
2664
  );
2651
2665
  } else {
2652
2666
  if (t instanceof Date)
2653
2667
  return t;
2654
2668
  throw new Error(
2655
- `${o}: Expected date string or Date object, got ${typeof t}`
2669
+ `${a}: Expected date string or Date object, got ${typeof t}`
2656
2670
  );
2657
2671
  }
2658
2672
  case "string | number":
2659
2673
  if (typeof t == "string" || typeof t == "number")
2660
2674
  return t;
2661
- throw new Error(`${o}: Expected string or number, got ${typeof t}`);
2675
+ throw new Error(`${a}: Expected string or number, got ${typeof t}`);
2662
2676
  case "BaseFilterConfig":
2663
2677
  case "MembersFilterConfig":
2664
2678
  case "CustomFormulaContext":
2665
2679
  case "any":
2666
2680
  if (t == null && r.required)
2667
- throw new Error(`${o}: Required argument is null/undefined`);
2681
+ throw new Error(`${a}: Required argument is null/undefined`);
2668
2682
  return t;
2669
2683
  default:
2670
2684
  return t;
2671
2685
  }
2672
2686
  }
2673
2687
  function M(e) {
2674
- const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args: o } = t, a = n ? `${n}.` : "", u = ze(i);
2688
+ const { data: t } = e, { dataSource: r, schemaIndex: s, pathPrefix: n } = e.context, { function: i, args: a } = t, o = n ? `${n}.` : "", u = ye(i);
2675
2689
  if (!u) {
2676
- const p = Object.keys(Jt), E = x(i, p, (v) => v), C = E && E.distance <= T ? ` Did you mean '${E.best}'?` : "";
2690
+ const m = Object.keys(Xt), F = x(i, m, (N) => N), O = F && F.distance <= C ? ` Did you mean '${F.best}'?` : "";
2677
2691
  throw new Error(
2678
- `${a}function: Unknown function '${i}'.${C}`
2692
+ `${o}function: Unknown function '${i}'.${O}`
2679
2693
  );
2680
2694
  }
2681
- const c = vn(i), g = Nn(i);
2682
- if (o.length < c)
2695
+ const c = Rn(i), g = In(i);
2696
+ if (a.length < c)
2683
2697
  throw new Error(
2684
- `${a}function: Expected at least ${c} arguments, got ${o.length}`
2698
+ `${o}function: Expected at least ${c} arguments, got ${a.length}`
2685
2699
  );
2686
- if (o.length > g)
2700
+ if (a.length > g)
2687
2701
  throw new Error(
2688
- `${a}function: Expected at most ${g} arguments, got ${o.length}`
2702
+ `${o}function: Expected at most ${g} arguments, got ${a.length}`
2689
2703
  );
2690
- const d = [], m = [];
2691
- for (let p = 0; p < Math.max(o.length, u.length); p++) {
2692
- const E = u[`${p}`], C = o[`${p}`], v = a ? `${a}args[${p}]` : `args[${p}]`;
2693
- if (C === void 0) {
2694
- E != null && E.required && m.push(`${v}: Missing required argument (expected ${E.type})`);
2704
+ const f = [], p = [];
2705
+ for (let m = 0; m < Math.max(a.length, u.length); m++) {
2706
+ const F = u[`${m}`], O = a[`${m}`], N = o ? `${o}args[${m}]` : `args[${m}]`;
2707
+ if (O === void 0) {
2708
+ F != null && F.required && p.push(`${N}: Missing required argument (expected ${F.type})`);
2695
2709
  continue;
2696
2710
  }
2697
- if (!E) {
2698
- m.push(`${v}: Unexpected argument`);
2711
+ if (!F) {
2712
+ p.push(`${N}: Unexpected argument`);
2699
2713
  continue;
2700
2714
  }
2701
2715
  try {
2702
- const W = In({
2703
- data: C,
2716
+ const W = Bn({
2717
+ data: O,
2704
2718
  context: {
2705
2719
  dataSource: r,
2706
2720
  schemaIndex: s,
2707
- pathPrefix: v,
2708
- argSchema: E
2721
+ pathPrefix: N,
2722
+ argSchema: F
2709
2723
  }
2710
2724
  });
2711
- d.push(W);
2725
+ f.push(W);
2712
2726
  } catch (W) {
2713
- const rr = W instanceof Error ? W.message : "Unknown error";
2714
- m.push(rr);
2727
+ const or = W instanceof Error ? W.message : "Unknown error";
2728
+ p.push(or);
2715
2729
  }
2716
2730
  }
2717
- if (m.length > 0) {
2718
- const p = m.join("; ");
2719
- throw new Error(p);
2731
+ if (p.length > 0) {
2732
+ const m = p.join("; ");
2733
+ throw new Error(m);
2720
2734
  }
2721
- let h = d;
2722
- const b = xn(i);
2735
+ let h = f;
2736
+ const b = Mn(i);
2723
2737
  if (b)
2724
2738
  try {
2725
- h = b(d, {
2739
+ h = b(f, {
2726
2740
  dataSource: r,
2727
2741
  schemaIndex: s,
2728
- pathPrefix: a
2742
+ pathPrefix: o
2729
2743
  });
2730
- } catch (p) {
2731
- const E = p instanceof Error ? p.message : "Unknown validation error";
2732
- throw new Error(E);
2744
+ } catch (m) {
2745
+ const F = m instanceof Error ? m.message : "Unknown validation error";
2746
+ throw new Error(F);
2733
2747
  }
2734
- return Zs(i, h);
2748
+ return rn(i, h);
2735
2749
  }
2736
- function Kt(e) {
2750
+ function Zt(e) {
2737
2751
  const { attribute: t, config: r } = e;
2738
- if (De(e) && jr(t)) {
2739
- const { granularity: s } = t, n = e.members.map((a) => s === "Years" && !isNaN(Number(a)) ? `${a}-01-01T00:00:00` : a), i = Jr(r), o = Object.keys(i).length === 0 ? void 0 : i;
2740
- return Kr(t, n, o);
2752
+ if (ve(e) && ts(t)) {
2753
+ const { granularity: s } = t, n = e.members.map((o) => s === "Years" && !isNaN(Number(o)) ? `${o}-01-01T00:00:00` : o), i = rs(r), a = Object.keys(i).length === 0 ? void 0 : i;
2754
+ return ss(t, n, a);
2741
2755
  }
2742
2756
  return e;
2743
2757
  }
2744
- function kn(e) {
2758
+ function zn(e) {
2745
2759
  let t = [];
2746
2760
  for (const r of e)
2747
- te(r) ? t = je(r, t) : t = je([Kt(r)], t);
2761
+ re(r) ? t = Ge(r, t) : t = Ge([Zt(r)], t);
2748
2762
  return t != null ? t : [];
2749
2763
  }
2750
- const Bn = (e) => {
2764
+ const Un = (e) => {
2751
2765
  const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
2752
- return t.forEach((o, a) => {
2766
+ return t.forEach((a, o) => {
2753
2767
  const u = {
2754
- path: `filters[${a}]`,
2755
- input: o
2768
+ path: `filters[${o}]`,
2769
+ input: a
2756
2770
  };
2757
2771
  try {
2758
2772
  const c = M({
2759
- data: o,
2773
+ data: a,
2760
2774
  context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
2761
2775
  });
2762
- !te(c) && !fe(c) ? i.push(F(l({}, u), { message: "Invalid filter JSON" })) : n.push(c);
2776
+ !re(c) && !pe(c) ? i.push(E(l({}, u), { message: "Invalid filter JSON" })) : n.push(c);
2763
2777
  } catch (c) {
2764
2778
  const g = c instanceof Error ? c.message : "Unknown error";
2765
- i.push(F(l({}, u), { message: g }));
2779
+ i.push(E(l({}, u), { message: g }));
2766
2780
  }
2767
- }), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: kn(n) };
2768
- }, se = (e) => {
2781
+ }), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: zn(n) };
2782
+ }, ne = (e) => {
2769
2783
  const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
2770
- return t ? Rt(t) ? Bn({
2784
+ return t ? Bt(t) ? Un({
2771
2785
  data: t,
2772
2786
  context: { dataSource: r, schemaIndex: s }
2773
2787
  }) : {
@@ -2780,27 +2794,27 @@ const Bn = (e) => {
2780
2794
  }
2781
2795
  ]
2782
2796
  } : { success: !0, data: [] };
2783
- }, Ln = (e) => {
2797
+ }, _n = (e) => {
2784
2798
  const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context, n = [], i = [];
2785
- return t.forEach((o, a) => {
2799
+ return t.forEach((a, o) => {
2786
2800
  const u = {
2787
- path: `highlights[${a}]`,
2788
- input: o
2801
+ path: `highlights[${o}]`,
2802
+ input: a
2789
2803
  };
2790
2804
  try {
2791
2805
  const c = M({
2792
- data: o,
2806
+ data: a,
2793
2807
  context: { dataSource: r, schemaIndex: s, pathPrefix: "" }
2794
2808
  });
2795
- fe(c) ? n.push(Kt(c)) : i.push(F(l({}, u), { message: "Invalid filter JSON" }));
2809
+ pe(c) ? n.push(Zt(c)) : i.push(E(l({}, u), { message: "Invalid filter JSON" }));
2796
2810
  } catch (c) {
2797
2811
  const g = c instanceof Error ? c.message : "Unknown error";
2798
- i.push(F(l({}, u), { message: g }));
2812
+ i.push(E(l({}, u), { message: g }));
2799
2813
  }
2800
2814
  }), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
2801
- }, me = (e) => {
2815
+ }, he = (e) => {
2802
2816
  const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
2803
- return t ? Rt(t) ? Ln({
2817
+ return t ? Bt(t) ? _n({
2804
2818
  data: t,
2805
2819
  context: { dataSource: r, schemaIndex: s }
2806
2820
  }) : {
@@ -2813,51 +2827,51 @@ const Bn = (e) => {
2813
2827
  }
2814
2828
  ]
2815
2829
  } : { success: !0, data: [] };
2816
- }, zn = (e, t) => {
2817
- if (e && !ct(e))
2818
- return F(l({}, t), {
2830
+ }, Pn = (e, t) => {
2831
+ if (e && !pt(e))
2832
+ return E(l({}, t), {
2819
2833
  message: `Invalid sort type. Expected 'sortAsc', 'sortDesc', or 'sortNone'. Got: '${e}'.`
2820
2834
  });
2821
- }, Un = (e, t, r) => {
2835
+ }, Wn = (e, t, r) => {
2822
2836
  const { dataSource: s, schemaIndex: n } = t;
2823
2837
  try {
2824
2838
  const i = M({
2825
2839
  data: e,
2826
2840
  context: { dataSource: s, schemaIndex: n, pathPrefix: "" }
2827
2841
  });
2828
- return Ie(i) ? { success: !0, data: i } : {
2842
+ return ze(i) ? { success: !0, data: i } : {
2829
2843
  success: !1,
2830
- errors: [F(l({}, r), { message: "Invalid measure JSON" })]
2844
+ errors: [E(l({}, r), { message: "Invalid measure JSON" })]
2831
2845
  };
2832
2846
  } catch (i) {
2833
- const o = i instanceof Error ? i.message : "Unknown error";
2847
+ const a = i instanceof Error ? i.message : "Unknown error";
2834
2848
  return {
2835
2849
  success: !1,
2836
- errors: [F(l({}, r), { message: o })]
2850
+ errors: [E(l({}, r), { message: a })]
2837
2851
  };
2838
2852
  }
2839
- }, _n = (e, t, r, s) => {
2853
+ }, Vn = (e, t, r, s) => {
2840
2854
  const n = M({
2841
2855
  data: e.column,
2842
2856
  context: { dataSource: t, schemaIndex: r, pathPrefix: "" }
2843
2857
  });
2844
- if (!Ie(n))
2858
+ if (!ze(n))
2845
2859
  return {
2846
2860
  style: {},
2847
- error: F(l({}, s), { message: "Invalid measure JSON" })
2861
+ error: E(l({}, s), { message: "Invalid measure JSON" })
2848
2862
  };
2849
- const i = zn(e.sortType, s);
2863
+ const i = Pn(e.sortType, s);
2850
2864
  if (i) {
2851
- const a = _(e, "column");
2852
- return { measure: n, style: a, error: i };
2865
+ const o = _(e, "column");
2866
+ return { measure: n, style: o, error: i };
2853
2867
  }
2854
- const o = _(e, "column");
2855
- return { measure: n, style: o };
2856
- }, Pn = (e, t, r, s) => {
2857
- if (Vs(e))
2858
- return _n(e, t, r, s);
2859
- if (q(e)) {
2860
- const n = Un(
2868
+ const a = _(e, "column");
2869
+ return { measure: n, style: a };
2870
+ }, jn = (e, t, r, s) => {
2871
+ if (Ut(e))
2872
+ return Vn(e, t, r, s);
2873
+ if (w(e)) {
2874
+ const n = Wn(
2861
2875
  e,
2862
2876
  { dataSource: t, schemaIndex: r },
2863
2877
  s
@@ -2865,11 +2879,11 @@ const Bn = (e) => {
2865
2879
  return n.success ? { measure: n.data } : { error: n.errors[0] };
2866
2880
  }
2867
2881
  return {
2868
- error: F(l({}, s), {
2882
+ error: E(l({}, s), {
2869
2883
  message: "Invalid measure item. Expected a function call (function/args) or object with 'column' and optional 'sortType'."
2870
2884
  })
2871
2885
  };
2872
- }, Gt = (e) => {
2886
+ }, er = (e) => {
2873
2887
  const { data: t } = e, { dataSource: r, schemaIndex: s } = e.context;
2874
2888
  if (!t)
2875
2889
  return { success: !0, data: [] };
@@ -2885,13 +2899,13 @@ const Bn = (e) => {
2885
2899
  ]
2886
2900
  };
2887
2901
  const n = [], i = [];
2888
- return t.forEach((o, a) => {
2902
+ return t.forEach((a, o) => {
2889
2903
  const u = {
2890
- path: `measures[${a}]`,
2891
- input: o
2904
+ path: `measures[${o}]`,
2905
+ input: a
2892
2906
  };
2893
2907
  try {
2894
- const c = Pn(o, r, s, u);
2908
+ const c = jn(a, r, s, u);
2895
2909
  if (c.error) {
2896
2910
  i.push(c.error);
2897
2911
  return;
@@ -2901,14 +2915,14 @@ const Bn = (e) => {
2901
2915
  );
2902
2916
  } catch (c) {
2903
2917
  const g = c instanceof Error ? c.message : "Unknown error";
2904
- i.push(F(l({}, u), { message: g }));
2918
+ i.push(E(l({}, u), { message: g }));
2905
2919
  }
2906
2920
  }), i.length > 0 ? { success: !1, errors: i } : { success: !0, data: n };
2907
2921
  };
2908
- function ae(e) {
2922
+ function ue(e) {
2909
2923
  return typeof e == "string" ? e : e.title;
2910
2924
  }
2911
- function Wn(e) {
2925
+ function Jn(e) {
2912
2926
  const t = {};
2913
2927
  for (const [r, s] of Object.entries(e)) {
2914
2928
  const n = {};
@@ -2916,12 +2930,12 @@ function Wn(e) {
2916
2930
  }
2917
2931
  return Object.keys(t).length > 0 ? t : void 0;
2918
2932
  }
2919
- function Yt(e) {
2933
+ function tr(e) {
2920
2934
  return typeof e == "object" && e !== null && "toJSON" in e && typeof e.toJSON == "function" ? e.toJSON() : e;
2921
2935
  }
2922
- function B(e) {
2923
- return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(B) : e !== null && typeof e == "object" ? Object.fromEntries(
2924
- Object.entries(e).map(([t, r]) => [t, B(r)])
2936
+ function L(e) {
2937
+ return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(L) : e !== null && typeof e == "object" ? Object.fromEntries(
2938
+ Object.entries(e).map(([t, r]) => [t, L(r)])
2925
2939
  ) : e;
2926
2940
  }
2927
2941
  function A(e, t, r) {
@@ -2932,21 +2946,21 @@ function A(e, t, r) {
2932
2946
  }
2933
2947
  return s.data;
2934
2948
  }
2935
- const xi = (e) => {
2936
- const { data: t } = e, { dataSource: r, tables: s } = e.context, n = re(s), i = [], o = A(
2937
- () => kt({
2949
+ const zi = (e) => {
2950
+ const { data: t } = e, { dataSource: r, tables: s } = e.context, n = se(s), i = [], a = A(
2951
+ () => Pt({
2938
2952
  data: t.dimensions || [],
2939
2953
  context: { dataSource: r, schemaIndex: n }
2940
2954
  }),
2941
2955
  i
2942
- ), a = A(
2943
- () => Gt({
2956
+ ), o = A(
2957
+ () => er({
2944
2958
  data: t.measures || [],
2945
2959
  context: { dataSource: r, schemaIndex: n }
2946
2960
  }),
2947
2961
  i
2948
2962
  ), u = A(
2949
- () => se({
2963
+ () => ne({
2950
2964
  data: t.filters || [],
2951
2965
  context: { dataSource: r, schemaIndex: n }
2952
2966
  }),
@@ -2954,7 +2968,7 @@ const xi = (e) => {
2954
2968
  );
2955
2969
  let c = null;
2956
2970
  return t.highlights && (c = A(
2957
- () => me({
2971
+ () => he({
2958
2972
  data: t.highlights || [],
2959
2973
  context: { dataSource: r, schemaIndex: n }
2960
2974
  }),
@@ -2965,53 +2979,53 @@ const xi = (e) => {
2965
2979
  } : {
2966
2980
  success: !0,
2967
2981
  data: l({
2968
- dataSource: le(r),
2969
- dimensions: o ? Gr(o) : [],
2970
- measures: a ? Yr(a) : [],
2982
+ dataSource: de(r),
2983
+ dimensions: a ? ns(a) : [],
2984
+ measures: o ? is(o) : [],
2971
2985
  filters: u || []
2972
2986
  }, c && { highlights: c })
2973
2987
  };
2974
2988
  };
2975
- function Ze(e) {
2989
+ function rt(e) {
2976
2990
  return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
2977
2991
  }
2978
- function Ue(e) {
2992
+ function We(e) {
2979
2993
  const t = [], r = [];
2980
2994
  return e.forEach((s, n) => {
2981
- var d, m, h;
2982
- const i = Ze(s) ? s.column : s, o = Ze(s) ? s : void 0, a = () => Yt(i);
2995
+ var f, p, h;
2996
+ const i = rt(s) ? s.column : s, a = rt(s) ? s : void 0, o = () => tr(i);
2983
2997
  if (!i.composeCode) {
2984
2998
  r.push({
2985
2999
  path: `dimensions[${n}]`,
2986
- input: a(),
3000
+ input: o(),
2987
3001
  message: `Dimension at index ${n} (${i.name || "unnamed"}) is missing composeCode`
2988
3002
  });
2989
3003
  return;
2990
3004
  }
2991
- if (!i.composeCode.startsWith(w)) {
3005
+ if (!i.composeCode.startsWith(T)) {
2992
3006
  r.push({
2993
3007
  path: `dimensions[${n}]`,
2994
- input: a(),
2995
- message: `Expected composeCode to start with '${w}' for dimension at index ${n} (${i.name || "unnamed"}). Got: '${i.composeCode}'`
3008
+ input: o(),
3009
+ message: `Expected composeCode to start with '${T}' for dimension at index ${n} (${i.name || "unnamed"}). Got: '${i.composeCode}'`
2996
3010
  });
2997
3011
  return;
2998
3012
  }
2999
- const u = (h = o != null && o.sortType ? lt(o.sortType) : void 0) != null ? h : ((d = i.getSort) == null ? void 0 : d.call(i)) !== void 0 && ((m = i.getSort) == null ? void 0 : m.call(i)) !== U.None ? i.getSort() : void 0, c = o ? _(o, "column") : {};
3000
- if (u !== void 0 && u !== U.None || o && Object.keys(c).length > 0) {
3013
+ const u = (h = a != null && a.sortType ? gt(a.sortType) : void 0) != null ? h : ((f = i.getSort) == null ? void 0 : f.call(i)) !== void 0 && ((p = i.getSort) == null ? void 0 : p.call(i)) !== U.None ? i.getSort() : void 0, c = a ? _(a, "column") : {};
3014
+ if (u !== void 0 && u !== U.None || a && Object.keys(c).length > 0) {
3001
3015
  const b = l(l({
3002
3016
  column: i.composeCode
3003
- }, u !== void 0 && u !== U.None && { sortType: dt(u) }), c);
3017
+ }, u !== void 0 && u !== U.None && { sortType: yt(u) }), c);
3004
3018
  t.push(b);
3005
3019
  } else
3006
3020
  t.push(i.composeCode);
3007
3021
  }), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
3008
3022
  }
3009
- const qe = "Unknown error";
3010
- function ne(e) {
3023
+ const De = "Unknown error";
3024
+ function ie(e) {
3011
3025
  if (!e)
3012
3026
  return { success: !0, data: [] };
3013
3027
  const t = [];
3014
- if (Hr(e)) {
3028
+ if (as(e)) {
3015
3029
  if (!e.composeCode)
3016
3030
  return {
3017
3031
  success: !1,
@@ -3026,7 +3040,7 @@ function ne(e) {
3026
3040
  try {
3027
3041
  return { success: !0, data: [J(e.composeCode)] };
3028
3042
  } catch (s) {
3029
- const n = s instanceof Error ? s.message : qe;
3043
+ const n = s instanceof Error ? s.message : De;
3030
3044
  return {
3031
3045
  success: !1,
3032
3046
  errors: [
@@ -3051,19 +3065,19 @@ function ne(e) {
3051
3065
  return;
3052
3066
  }
3053
3067
  try {
3054
- const o = J(s.composeCode);
3055
- r.push(o);
3056
- } catch (o) {
3057
- const a = o instanceof Error ? o.message : qe;
3068
+ const a = J(s.composeCode);
3069
+ r.push(a);
3070
+ } catch (a) {
3071
+ const o = a instanceof Error ? a.message : De;
3058
3072
  t.push({
3059
3073
  path: `filters[${n}]`,
3060
3074
  input: s,
3061
- message: `Failed to parse composeCode for filter at index ${n}: ${a}. ComposeCode: '${s.composeCode}'`
3075
+ message: `Failed to parse composeCode for filter at index ${n}: ${o}. ComposeCode: '${s.composeCode}'`
3062
3076
  });
3063
3077
  }
3064
3078
  }), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
3065
3079
  }
3066
- function ge(e) {
3080
+ function be(e) {
3067
3081
  if (!e)
3068
3082
  return { success: !0, data: [] };
3069
3083
  const t = [], r = [];
@@ -3078,62 +3092,62 @@ function ge(e) {
3078
3092
  return;
3079
3093
  }
3080
3094
  try {
3081
- const o = J(s.composeCode);
3082
- t.push(o);
3083
- } catch (o) {
3084
- const a = o instanceof Error ? o.message : qe;
3095
+ const a = J(s.composeCode);
3096
+ t.push(a);
3097
+ } catch (a) {
3098
+ const o = a instanceof Error ? a.message : De;
3085
3099
  r.push({
3086
3100
  path: `highlights[${n}]`,
3087
3101
  input: s,
3088
- message: `Failed to parse composeCode for highlight filter at index ${n}: ${a}. ComposeCode: '${s.composeCode}'`
3102
+ message: `Failed to parse composeCode for highlight filter at index ${n}: ${o}. ComposeCode: '${s.composeCode}'`
3089
3103
  });
3090
3104
  }
3091
3105
  }), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
3092
3106
  }
3093
- function et(e) {
3107
+ function st(e) {
3094
3108
  return typeof e == "object" && e !== null && "column" in e && e.column !== void 0;
3095
3109
  }
3096
- function _e(e) {
3110
+ function Ve(e) {
3097
3111
  const t = [], r = [];
3098
3112
  return e.forEach((s, n) => {
3099
3113
  var u, c, g;
3100
- const i = et(s) ? s.column : s, o = et(s) ? s : void 0, a = () => Yt(i);
3114
+ const i = st(s) ? s.column : s, a = st(s) ? s : void 0, o = () => tr(i);
3101
3115
  if (!i.composeCode) {
3102
3116
  r.push({
3103
3117
  path: `measures[${n}]`,
3104
- input: a(),
3118
+ input: o(),
3105
3119
  message: `Measure at index ${n} (${i.name || "unnamed"}) is missing composeCode`
3106
3120
  });
3107
3121
  return;
3108
3122
  }
3109
3123
  try {
3110
- const d = J(i.composeCode), m = (g = o != null && o.sortType ? lt(o.sortType) : void 0) != null ? g : ((u = i.getSort) == null ? void 0 : u.call(i)) !== void 0 && ((c = i.getSort) == null ? void 0 : c.call(i)) !== U.None ? i.getSort() : void 0;
3111
- if (m !== void 0 && m !== U.None || o && Object.keys(_(o, "column")).length > 0) {
3112
- const b = o ? _(o, "column") : {}, p = l(l({
3113
- column: d
3114
- }, m !== void 0 && m !== U.None && { sortType: dt(m) }), b);
3115
- t.push(p);
3124
+ const f = J(i.composeCode), p = (g = a != null && a.sortType ? gt(a.sortType) : void 0) != null ? g : ((u = i.getSort) == null ? void 0 : u.call(i)) !== void 0 && ((c = i.getSort) == null ? void 0 : c.call(i)) !== U.None ? i.getSort() : void 0;
3125
+ if (p !== void 0 && p !== U.None || a && Object.keys(_(a, "column")).length > 0) {
3126
+ const b = a ? _(a, "column") : {}, m = l(l({
3127
+ column: f
3128
+ }, p !== void 0 && p !== U.None && { sortType: yt(p) }), b);
3129
+ t.push(m);
3116
3130
  } else
3117
- t.push(d);
3118
- } catch (d) {
3119
- const m = d instanceof Error ? d.message : "Unknown error";
3131
+ t.push(f);
3132
+ } catch (f) {
3133
+ const p = f instanceof Error ? f.message : "Unknown error";
3120
3134
  r.push({
3121
3135
  path: `measures[${n}]`,
3122
- input: a(),
3123
- message: `Failed to parse composeCode for measure at index ${n} (${i.name || "unnamed"}): ${m}. ComposeCode: '${i.composeCode}'`
3136
+ input: o(),
3137
+ message: `Failed to parse composeCode for measure at index ${n} (${i.name || "unnamed"}): ${p}. ComposeCode: '${i.composeCode}'`
3124
3138
  });
3125
3139
  }
3126
3140
  }), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
3127
3141
  }
3128
- function tt(e) {
3142
+ function nt(e) {
3129
3143
  var t, r, s, n;
3130
- return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(ft)) != null ? n : !1);
3144
+ return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.trend")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(ht)) != null ? n : !1);
3131
3145
  }
3132
- function rt(e) {
3146
+ function it(e) {
3133
3147
  var t, r, s, n;
3134
- return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(pt)) != null ? n : !1);
3148
+ return ((r = (t = e.composeCode) == null ? void 0 : t.includes("measureFactory.forecast")) != null ? r : !1) || ((n = (s = e.name) == null ? void 0 : s.startsWith(bt)) != null ? n : !1);
3135
3149
  }
3136
- function st(e) {
3150
+ function at(e) {
3137
3151
  try {
3138
3152
  const t = J(e.trim());
3139
3153
  return t.args[2] != null && typeof t.args[2] == "object" ? t.args[2] : void 0;
@@ -3141,67 +3155,67 @@ function st(e) {
3141
3155
  return;
3142
3156
  }
3143
3157
  }
3144
- function Vn(e) {
3158
+ function Kn(e) {
3145
3159
  var s, n, i;
3146
3160
  if (!(e != null && e.length)) return [];
3147
3161
  const t = /* @__PURE__ */ new Set(), r = [];
3148
- for (let o = 0; o < e.length; o++) {
3149
- if (t.has(o)) continue;
3150
- const a = e[o];
3151
- if (tt(a) || rt(a)) {
3152
- r.push(a);
3162
+ for (let a = 0; a < e.length; a++) {
3163
+ if (t.has(a)) continue;
3164
+ const o = e[a];
3165
+ if (nt(o) || it(o)) {
3166
+ r.push(o);
3153
3167
  continue;
3154
3168
  }
3155
- const u = (s = a.name) != null ? s : "Measure", c = `${ft}_${u}`, g = `${pt}_${u}`;
3156
- let d, m, h = o + 1;
3157
- if (h < e.length && !t.has(h) && tt(e[h]) && e[h].name === c) {
3169
+ const u = (s = o.name) != null ? s : "Measure", c = `${ht}_${u}`, g = `${bt}_${u}`;
3170
+ let f, p, h = a + 1;
3171
+ if (h < e.length && !t.has(h) && nt(e[h]) && e[h].name === c) {
3158
3172
  const b = (n = e[h].composeCode) == null ? void 0 : n.trim();
3159
- b && (d = st(b), t.add(h), h++);
3173
+ b && (f = at(b), t.add(h), h++);
3160
3174
  }
3161
- if (h < e.length && !t.has(h) && rt(e[h]) && e[h].name === g) {
3175
+ if (h < e.length && !t.has(h) && it(e[h]) && e[h].name === g) {
3162
3176
  const b = (i = e[h].composeCode) == null ? void 0 : i.trim();
3163
- b && (m = st(b), t.add(h));
3177
+ b && (p = at(b), t.add(h));
3164
3178
  }
3165
- d !== void 0 || m !== void 0 ? r.push(l(l({
3166
- column: a
3167
- }, d && Object.keys(d).length > 0 && { trend: d }), m && Object.keys(m).length > 0 && { forecast: m })) : r.push(a);
3179
+ f !== void 0 || p !== void 0 ? r.push(l(l({
3180
+ column: o
3181
+ }, f && Object.keys(f).length > 0 && { trend: f }), p && Object.keys(p).length > 0 && { forecast: p })) : r.push(o);
3168
3182
  }
3169
3183
  return r;
3170
3184
  }
3171
- function vi(e) {
3185
+ function Ui(e) {
3172
3186
  const t = [], r = A(
3173
- () => Ue(e.dimensions || []),
3187
+ () => We(e.dimensions || []),
3174
3188
  t
3175
- ), s = Vn(e.measures || []), n = A(
3176
- () => _e(s),
3189
+ ), s = Kn(e.measures || []), n = A(
3190
+ () => Ve(s),
3177
3191
  t
3178
3192
  ), i = A(
3179
- () => ne(e.filters),
3193
+ () => ie(e.filters),
3180
3194
  t
3181
3195
  );
3182
- let o = null;
3183
- if (e.highlights && e.highlights.length > 0 && (o = A(
3184
- () => ge(e.highlights),
3196
+ let a = null;
3197
+ if (e.highlights && e.highlights.length > 0 && (a = A(
3198
+ () => be(e.highlights),
3185
3199
  t
3186
3200
  )), t.length > 0)
3187
3201
  return {
3188
3202
  success: !1,
3189
3203
  errors: t
3190
3204
  };
3191
- const a = l({
3205
+ const o = l({
3192
3206
  dimensions: r || [],
3193
3207
  measures: n || [],
3194
3208
  filters: i || []
3195
- }, o && { highlights: o });
3209
+ }, a && { highlights: a });
3196
3210
  return {
3197
3211
  success: !0,
3198
3212
  // Strip [[delimiters]] from all strings to preserve original names with spaces
3199
- data: B(a)
3213
+ data: L(o)
3200
3214
  };
3201
3215
  }
3202
- const Ht = new Set(
3203
- Qr.filter((e) => e !== "image")
3204
- ), nt = Object.freeze([...Ht]), Ae = /* @__PURE__ */ new Set([
3216
+ const rr = new Set(
3217
+ os.filter((e) => e !== "image")
3218
+ ), ot = Object.freeze([...rr]), Se = /* @__PURE__ */ new Set([
3205
3219
  "category",
3206
3220
  "value",
3207
3221
  "breakBy",
@@ -3224,7 +3238,7 @@ const Ht = new Set(
3224
3238
  "min",
3225
3239
  "max",
3226
3240
  "seriesToColorMap"
3227
- ]), jn = {
3241
+ ]), Gn = {
3228
3242
  line: {
3229
3243
  validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
3230
3244
  requiredAxes: ["category", "value"]
@@ -3297,7 +3311,7 @@ const Ht = new Set(
3297
3311
  validAxes: /* @__PURE__ */ new Set(["category", "value", "breakBy", "seriesToColorMap"]),
3298
3312
  requiredAxes: ["category", "value"]
3299
3313
  }
3300
- }, Jn = /* @__PURE__ */ new Set([
3314
+ }, Yn = /* @__PURE__ */ new Set([
3301
3315
  "category",
3302
3316
  "breakBy",
3303
3317
  "breakByPoint",
@@ -3305,7 +3319,7 @@ const Ht = new Set(
3305
3319
  "geo",
3306
3320
  "details",
3307
3321
  "date"
3308
- ]), Kn = /* @__PURE__ */ new Set([
3322
+ ]), Hn = /* @__PURE__ */ new Set([
3309
3323
  "value",
3310
3324
  "size",
3311
3325
  "colorBy",
@@ -3317,34 +3331,34 @@ const Ht = new Set(
3317
3331
  "max",
3318
3332
  "color"
3319
3333
  ]);
3320
- function Gn(e) {
3321
- const t = jn[e];
3334
+ function Qn(e) {
3335
+ const t = Gn[e];
3322
3336
  if (t)
3323
3337
  return {
3324
3338
  validAxes: new Set(t.validAxes),
3325
3339
  requiredAxes: Object.freeze([...t.requiredAxes])
3326
3340
  };
3327
3341
  }
3328
- function Qt(e) {
3329
- return typeof e == "string" && Ht.has(e);
3342
+ function sr(e) {
3343
+ return typeof e == "string" && rr.has(e);
3330
3344
  }
3331
- function Yn(e, t, r) {
3332
- if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" || Jn.has(e))
3345
+ function Xn(e, t, r) {
3346
+ if (r === "boxplot" && e === "value" || r === "calendar-heatmap" && e === "date" || Yn.has(e))
3333
3347
  return !0;
3334
- if (Kn.has(e))
3348
+ if (Hn.has(e))
3335
3349
  return !1;
3336
3350
  const s = Array.isArray(t) ? t[0] : t;
3337
3351
  if (!s)
3338
3352
  return !0;
3339
3353
  let n;
3340
- return O(s) && "column" in s && (n = s.column), !(q(s) || n !== void 0 && q(n));
3354
+ return $(s) && "column" in s && (n = s.column), !(w(s) || n !== void 0 && w(n));
3341
3355
  }
3342
- function Hn(e) {
3356
+ function Zn(e) {
3343
3357
  const t = [], r = {
3344
3358
  chartType: "",
3345
3359
  dataOptions: {}
3346
3360
  };
3347
- if (!O(e))
3361
+ if (!$(e))
3348
3362
  return t.push({
3349
3363
  path: "chartType",
3350
3364
  input: e,
@@ -3352,29 +3366,29 @@ function Hn(e) {
3352
3366
  }), { normalized: r, errors: t };
3353
3367
  const s = e.chartType;
3354
3368
  if (s === void 0) {
3355
- const i = Object.keys(e), o = x("chartType", i, (c) => c), a = o && o.distance <= T ? ` Did you mean 'chartType'? (You may have typed '${o.best}')` : "", u = o && o.distance <= T ? { [o.best]: e[o.best] } : e;
3369
+ const i = Object.keys(e), a = x("chartType", i, (c) => c), o = a && a.distance <= C ? ` Did you mean 'chartType'? (You may have typed '${a.best}')` : "", u = a && a.distance <= C ? { [a.best]: e[a.best] } : e;
3356
3370
  t.push({
3357
3371
  path: "chartType",
3358
3372
  input: u,
3359
- message: `chartType is required.${a}`
3373
+ message: `chartType is required.${o}`
3360
3374
  });
3361
- } else if (Qt(s))
3375
+ } else if (sr(s))
3362
3376
  r.chartType = s;
3363
3377
  else {
3364
- const i = x(String(s), nt, (u) => u), o = i && i.distance <= T ? ` Did you mean '${i.best}'?` : "", a = nt.slice(0, 8).join(", ");
3378
+ const i = x(String(s), ot, (u) => u), a = i && i.distance <= C ? ` Did you mean '${i.best}'?` : "", o = ot.slice(0, 8).join(", ");
3365
3379
  t.push({
3366
3380
  path: "chartType",
3367
3381
  input: s,
3368
- message: `Invalid chartType '${s}'. Valid types: ${a}, ...${o}`
3382
+ message: `Invalid chartType '${s}'. Valid types: ${o}, ...${a}`
3369
3383
  });
3370
3384
  }
3371
3385
  const n = e.dataOptions;
3372
3386
  if (n === void 0) {
3373
- const i = Object.keys(e), o = x("dataOptions", i, (c) => c), a = o && o.distance <= T ? ` Did you mean 'dataOptions'? (You may have typed '${o.best}')` : "", u = o && o.distance <= T ? { [o.best]: e[o.best] } : e;
3387
+ const i = Object.keys(e), a = x("dataOptions", i, (c) => c), o = a && a.distance <= C ? ` Did you mean 'dataOptions'? (You may have typed '${a.best}')` : "", u = a && a.distance <= C ? { [a.best]: e[a.best] } : e;
3374
3388
  t.push({
3375
3389
  path: "dataOptions",
3376
3390
  input: u,
3377
- message: `dataOptions is required.${a}`
3391
+ message: `dataOptions is required.${o}`
3378
3392
  });
3379
3393
  } else n !== null && typeof n == "object" && (r.dataOptions = n);
3380
3394
  return e.styleOptions !== void 0 && (r.styleOptions = e.styleOptions), e.filters !== void 0 && Array.isArray(e.filters) && (r.filters = e.filters), e.highlights !== void 0 && Array.isArray(e.highlights) && (r.highlights = e.highlights), { normalized: r, errors: t };
@@ -3382,149 +3396,156 @@ function Hn(e) {
3382
3396
  function D(e, t) {
3383
3397
  return e === -1 ? "dataOptions" : typeof e == "number" ? `dataOptions[${e}]` : t !== void 0 ? `dataOptions.${e}[${t}]` : `dataOptions.${e}`;
3384
3398
  }
3385
- function Xt(e, t) {
3399
+ function nr(e, t) {
3386
3400
  return e ? t ? `${e}.${t}` : e : t != null ? t : "";
3387
3401
  }
3388
- function Qn(e) {
3389
- return (t) => F(l({}, t), {
3390
- path: Xt(e, t.path)
3402
+ function ei(e) {
3403
+ return (t) => E(l({}, t), {
3404
+ path: nr(e, t.path)
3391
3405
  });
3392
3406
  }
3393
- function Zt(e) {
3394
- return Qn(`widgets[${e}]`);
3407
+ function ir(e) {
3408
+ return ei(`widgets[${e}]`);
3395
3409
  }
3396
- function er(e, t) {
3410
+ function ar(e, t) {
3397
3411
  return e.map(t);
3398
3412
  }
3399
- function Xn(e) {
3413
+ function ti(e) {
3400
3414
  return e.map(
3401
3415
  ({ attribute: t, style: r }) => r ? l({ column: t }, r) : t
3402
3416
  );
3403
3417
  }
3404
- function Zn(e) {
3418
+ function ri(e) {
3405
3419
  return e.map(
3406
3420
  ({ measure: t, style: r }) => r ? l({ column: t }, r) : t
3407
3421
  );
3408
3422
  }
3409
- function tr(e) {
3423
+ function si(e) {
3424
+ return Array.isArray(e) ? e : [e];
3425
+ }
3426
+ function ni(e) {
3427
+ return Array.isArray(e) ? e : [e];
3428
+ }
3429
+ function ii(e) {
3410
3430
  return Array.isArray(e) ? e : [e];
3411
3431
  }
3412
- const ei = /^(dimensions|measures|filters|highlights)(\[\d+\])?$/;
3413
- function $e(e) {
3432
+ const ai = /^(dimensions|measures|filters|highlights)(\[\d+\])?$/;
3433
+ function xe(e) {
3414
3434
  return (t) => {
3415
3435
  const r = t.path.match(/\[(\d+)\]$/), s = r ? Number(r[1]) : void 0, n = D(e, s);
3416
- if (ei.test(t.path) || t.path.startsWith("dataOptions"))
3417
- return F(l({}, t), { path: n });
3436
+ if (ai.test(t.path) || t.path.startsWith("dataOptions"))
3437
+ return E(l({}, t), { path: n });
3418
3438
  const i = t.path.replace(/\[\d+\]$/, "");
3419
- return F(l({}, t), {
3420
- path: Xt(i, n)
3439
+ return E(l({}, t), {
3440
+ path: nr(i, n)
3421
3441
  });
3422
3442
  };
3423
3443
  }
3424
- function ce(e, t, r, s, n) {
3425
- const i = t ? tr(
3426
- t
3427
- ) : [];
3428
- if (i.length === 0)
3429
- return [];
3444
+ function le(e, t, r, s, n) {
3430
3445
  if (r === "dimension") {
3431
- const a = A(
3432
- () => kt({
3433
- data: i,
3446
+ const o = t ? si(t) : [];
3447
+ if (o.length === 0)
3448
+ return [];
3449
+ const u = A(
3450
+ () => Pt({
3451
+ data: o,
3434
3452
  context: s
3435
3453
  }),
3436
3454
  n,
3437
- $e(e)
3455
+ xe(e)
3438
3456
  );
3439
- return a !== null ? Xn(a) : null;
3457
+ return u !== null ? ti(u) : null;
3440
3458
  }
3441
- const o = A(
3442
- () => Gt({
3459
+ const i = t ? ni(t) : [];
3460
+ if (i.length === 0)
3461
+ return [];
3462
+ const a = A(
3463
+ () => er({
3443
3464
  data: i,
3444
3465
  context: s
3445
3466
  }),
3446
3467
  n,
3447
- $e(e)
3468
+ xe(e)
3448
3469
  );
3449
- return o !== null ? Zn(o) : null;
3470
+ return a !== null ? ri(a) : null;
3450
3471
  }
3451
- const it = (e, t) => {
3472
+ const ut = (e, t) => {
3452
3473
  const r = t.path.match(/\[(\d+)\]$/), s = r ? Number(r[1]) : void 0;
3453
- return F(l({}, t), { path: D(e, s) });
3474
+ return E(l({}, t), { path: D(e, s) });
3454
3475
  };
3455
- function ot(e, t, r) {
3476
+ function ct(e, t, r) {
3456
3477
  const s = Array.isArray(t) ? t : t != null ? [t] : [];
3457
3478
  if (r === "dimension") {
3458
- const i = Ue(
3479
+ const i = We(
3459
3480
  s
3460
3481
  );
3461
3482
  return i.success ? { success: !0, data: i.data } : {
3462
3483
  success: !1,
3463
- errors: i.errors.map((o) => it(e, o))
3484
+ errors: i.errors.map((a) => ut(e, a))
3464
3485
  };
3465
3486
  }
3466
- const n = _e(s);
3487
+ const n = Ve(s);
3467
3488
  return n.success ? { success: !0, data: n.data } : {
3468
3489
  success: !1,
3469
- errors: n.errors.map((i) => it(e, i))
3490
+ errors: n.errors.map((i) => ut(e, i))
3470
3491
  };
3471
3492
  }
3472
- function ti(e, t) {
3493
+ function oi(e, t) {
3473
3494
  let r;
3474
- O(e) && "column" in e && (r = e.column);
3475
- const n = !(q(e) || r !== void 0 && q(r)) ? "dimension" : "measure", i = [], o = ce("columns", [e], n, t, i);
3476
- return o !== null ? { success: !0, data: o } : { success: !1, errors: i };
3495
+ $(e) && "column" in e && (r = e.column);
3496
+ const n = !(w(e) || r !== void 0 && w(r)) ? "dimension" : "measure", i = [], a = le("columns", [e], n, t, i);
3497
+ return a !== null ? { success: !0, data: a } : { success: !1, errors: i };
3477
3498
  }
3478
- function ri(e, t, r, s) {
3499
+ function ui(e, t, r, s) {
3479
3500
  const n = [];
3480
3501
  for (const i of e) {
3481
- const o = A(
3482
- () => ti(i, t),
3502
+ const a = A(
3503
+ () => oi(i, t),
3483
3504
  r,
3484
3505
  s
3485
3506
  );
3486
- o && n.push(...o);
3507
+ a && n.push(...a);
3487
3508
  }
3488
3509
  return n;
3489
3510
  }
3490
- function si(e, t, r) {
3491
- if (!e || !O(e))
3511
+ function ci(e, t, r) {
3512
+ if (!e || !$(e))
3492
3513
  return r.push({
3493
3514
  path: D(-1),
3494
3515
  input: e,
3495
3516
  message: "dataOptions is required"
3496
3517
  }), null;
3497
- const s = {}, { chartType: n } = t, i = r.length, o = e, a = Object.keys(e), u = /* @__PURE__ */ new Map();
3498
- for (const d of a)
3499
- if (!Ae.has(d)) {
3500
- const m = x(d, [...Ae], (b) => b), h = m && m.distance <= T ? ` Did you mean '${m.best}'?` : "";
3501
- m && m.distance <= T && u.set(d, m.best), r.push({
3502
- path: D(d),
3503
- input: o[d],
3504
- message: `Unknown dataOptions key '${d}'.${h}`
3518
+ const s = {}, { chartType: n } = t, i = r.length, a = e, o = Object.keys(e), u = /* @__PURE__ */ new Map();
3519
+ for (const f of o)
3520
+ if (!Se.has(f)) {
3521
+ const p = x(f, [...Se], (b) => b), h = p && p.distance <= C ? ` Did you mean '${p.best}'?` : "";
3522
+ p && p.distance <= C && u.set(f, p.best), r.push({
3523
+ path: D(f),
3524
+ input: a[f],
3525
+ message: `Unknown dataOptions key '${f}'.${h}`
3505
3526
  });
3506
3527
  }
3507
- const c = n ? Gn(n) : void 0;
3528
+ const c = n ? Qn(n) : void 0;
3508
3529
  if (c) {
3509
- for (const d of a)
3510
- if (d !== "seriesToColorMap" && !c.validAxes.has(d) && Ae.has(d)) {
3511
- const m = x(d, [...c.validAxes], (p) => p), h = m && m.distance <= T ? ` Did you mean '${m.best}'?` : "", b = [...c.validAxes].join(", ");
3530
+ for (const f of o)
3531
+ if (f !== "seriesToColorMap" && !c.validAxes.has(f) && Se.has(f)) {
3532
+ const p = x(f, [...c.validAxes], (m) => m), h = p && p.distance <= C ? ` Did you mean '${p.best}'?` : "", b = [...c.validAxes].join(", ");
3512
3533
  r.push({
3513
- path: D(d),
3514
- input: o[d],
3515
- message: `Axis '${d}' is not valid for chart type '${n}'. Valid axes: ${b}.${h}`
3534
+ path: D(f),
3535
+ input: a[f],
3536
+ message: `Axis '${f}' is not valid for chart type '${n}'. Valid axes: ${b}.${h}`
3516
3537
  });
3517
3538
  }
3518
- for (const d of c.requiredAxes)
3519
- [...u.values()].includes(d) || (!(d in o) || o[d] == null) && r.push({
3520
- path: D(d),
3539
+ for (const f of c.requiredAxes)
3540
+ [...u.values()].includes(f) || (!(f in a) || a[f] == null) && r.push({
3541
+ path: D(f),
3521
3542
  input: null,
3522
3543
  message: `Chart type '${n}' requires '${c.requiredAxes.join(
3523
3544
  "' and '"
3524
- )}'. Missing: ${d}.`
3545
+ )}'. Missing: ${f}.`
3525
3546
  });
3526
3547
  n === "indicator" && (["value", "secondary", "min", "max"].some(
3527
- (h) => h in o && o[h] != null
3548
+ (h) => h in a && a[h] != null
3528
3549
  ) || r.push({
3529
3550
  path: D(-1),
3530
3551
  input: e,
@@ -3538,66 +3559,66 @@ function si(e, t, r) {
3538
3559
  if (r.length > i)
3539
3560
  return null;
3540
3561
  const g = Object.entries(e);
3541
- for (const [d, m] of g) {
3542
- if (!m) continue;
3543
- if (d === "seriesToColorMap") {
3544
- s[d] = m;
3562
+ for (const [f, p] of g) {
3563
+ if (!p) continue;
3564
+ if (f === "seriesToColorMap") {
3565
+ s[f] = p;
3545
3566
  continue;
3546
3567
  }
3547
- if (d === "columns") {
3548
- s[d] = ri(
3549
- tr(m),
3568
+ if (f === "columns") {
3569
+ s[f] = ui(
3570
+ ii(p),
3550
3571
  t,
3551
3572
  r,
3552
- $e("columns")
3573
+ xe("columns")
3553
3574
  );
3554
3575
  continue;
3555
3576
  }
3556
- const h = Yn(d, m, n) ? "dimension" : "measure", b = ce(
3557
- d,
3558
- m,
3577
+ const h = Xn(f, p, n) ? "dimension" : "measure", b = le(
3578
+ f,
3579
+ p,
3559
3580
  h,
3560
3581
  t,
3561
3582
  r
3562
3583
  );
3563
3584
  if (b !== null) {
3564
- const p = n === "calendar-heatmap" && d === "value";
3565
- s[d] = p || !Array.isArray(m) ? b[0] : b;
3585
+ const m = n === "calendar-heatmap" && f === "value";
3586
+ s[f] = m || !Array.isArray(p) ? b[0] : b;
3566
3587
  }
3567
3588
  }
3568
3589
  return r.length > i ? null : s;
3569
3590
  }
3570
- function ni(e) {
3591
+ function li(e) {
3571
3592
  if (typeof e != "string") return "iqr";
3572
3593
  const t = e.split("/")[1];
3573
3594
  return t === "iqr" || t === "extremums" || t === "standardDeviation" ? t : "iqr";
3574
3595
  }
3575
- const ii = (e) => {
3576
- var p;
3577
- const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } = Hn(t);
3578
- if (o.length > 0)
3579
- return { success: !1, errors: o };
3580
- const a = i.chartType, u = re(n), c = [];
3581
- let g = si(
3596
+ const fi = (e) => {
3597
+ var m;
3598
+ const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: a } = Zn(t);
3599
+ if (a.length > 0)
3600
+ return { success: !1, errors: a };
3601
+ const o = i.chartType, u = se(n), c = [];
3602
+ let g = ci(
3582
3603
  i.dataOptions,
3583
- { dataSource: s, schemaIndex: u, chartType: a },
3604
+ { dataSource: s, schemaIndex: u, chartType: o },
3584
3605
  c
3585
3606
  );
3586
- if (a === "boxplot" && g) {
3587
- const E = ni((p = i.styleOptions) == null ? void 0 : p.subtype), C = E === "iqr" || E === "standardDeviation";
3588
- g = F(l({}, g), { boxType: E, outliersEnabled: C });
3607
+ if (o === "boxplot" && g) {
3608
+ const F = li((m = i.styleOptions) == null ? void 0 : m.subtype), O = F === "iqr" || F === "standardDeviation";
3609
+ g = E(l({}, g), { boxType: F, outliersEnabled: O });
3589
3610
  }
3590
- let d = null;
3591
- i.filters && i.filters.length > 0 && (d = A(
3592
- () => se({
3611
+ let f = null;
3612
+ i.filters && i.filters.length > 0 && (f = A(
3613
+ () => ne({
3593
3614
  data: i.filters || [],
3594
3615
  context: { dataSource: s, schemaIndex: u }
3595
3616
  }),
3596
3617
  c
3597
3618
  ));
3598
- let m = null;
3599
- if (i.highlights && i.highlights.length > 0 && (m = A(
3600
- () => me({
3619
+ let p = null;
3620
+ if (i.highlights && i.highlights.length > 0 && (p = A(
3621
+ () => he({
3601
3622
  data: i.highlights || [],
3602
3623
  context: { dataSource: s, schemaIndex: u }
3603
3624
  }),
@@ -3607,7 +3628,7 @@ const ii = (e) => {
3607
3628
  success: !1,
3608
3629
  errors: c
3609
3630
  };
3610
- if (!Qt(i.chartType))
3631
+ if (!sr(i.chartType))
3611
3632
  return {
3612
3633
  success: !1,
3613
3634
  errors: [
@@ -3622,15 +3643,15 @@ const ii = (e) => {
3622
3643
  return {
3623
3644
  success: !0,
3624
3645
  data: l(l(l({
3625
- dataSet: le(s),
3646
+ dataSet: de(s),
3626
3647
  chartType: h,
3627
3648
  dataOptions: g
3628
3649
  }, i.styleOptions && {
3629
3650
  // Pass-through NLQ JSON; shape matches ChartStyleOptions.
3630
3651
  styleOptions: i.styleOptions
3631
- }), d && { filters: d }), m && { highlights: m })
3652
+ }), f && { filters: f }), p && { highlights: p })
3632
3653
  };
3633
- }, oi = (e) => {
3654
+ }, di = (e) => {
3634
3655
  const t = [];
3635
3656
  if (!e.chartType)
3636
3657
  return {
@@ -3655,27 +3676,27 @@ const ii = (e) => {
3655
3676
  ]
3656
3677
  };
3657
3678
  let r = null;
3658
- const s = ai(e.dataOptions);
3679
+ const s = mi(e.dataOptions);
3659
3680
  s.success ? r = s.data : t.push(...s.errors);
3660
3681
  let n;
3661
3682
  if (e.filters) {
3662
- const a = A(
3663
- () => ne(e.filters),
3683
+ const o = A(
3684
+ () => ie(e.filters),
3664
3685
  t
3665
3686
  );
3666
- n = a != null ? a : void 0;
3687
+ n = o != null ? o : void 0;
3667
3688
  }
3668
3689
  let i;
3669
3690
  if (e.highlights && e.highlights.length > 0) {
3670
- const a = A(
3671
- () => ge(e.highlights),
3691
+ const o = A(
3692
+ () => be(e.highlights),
3672
3693
  t
3673
3694
  );
3674
- i = a != null ? a : void 0;
3695
+ i = o != null ? o : void 0;
3675
3696
  }
3676
3697
  if (t.length > 0 || r === null)
3677
3698
  return { success: !1, errors: t };
3678
- const o = l(l(l({
3699
+ const a = l(l(l({
3679
3700
  chartType: e.chartType,
3680
3701
  dataOptions: r
3681
3702
  }, e.styleOptions && {
@@ -3683,10 +3704,10 @@ const ii = (e) => {
3683
3704
  }), n && n.length > 0 && { filters: n }), i && i.length > 0 && { highlights: i });
3684
3705
  return {
3685
3706
  success: !0,
3686
- data: B(o)
3707
+ data: L(a)
3687
3708
  };
3688
3709
  };
3689
- function ai(e) {
3710
+ function mi(e) {
3690
3711
  const t = {}, r = [], s = /* @__PURE__ */ new Set(["seriesToColorMap", "boxType", "outliersEnabled", "valueTitle"]);
3691
3712
  for (const [n, i] of Object.entries(e)) {
3692
3713
  if (n === "seriesToColorMap" && i) {
@@ -3697,16 +3718,16 @@ function ai(e) {
3697
3718
  i != null && (t[n] = i);
3698
3719
  continue;
3699
3720
  }
3700
- const o = Array.isArray(i) ? i : [i], a = Array.isArray(i), u = [], c = [];
3701
- for (let g = 0; g < o.length; g++) {
3702
- const d = o[g], h = ui(d) ? Ue([
3703
- d
3704
- ]) : _e([d]);
3721
+ const a = Array.isArray(i) ? i : [i], o = Array.isArray(i), u = [], c = [];
3722
+ for (let g = 0; g < a.length; g++) {
3723
+ const f = a[g], h = pi(f) ? We([
3724
+ f
3725
+ ]) : Ve([f]);
3705
3726
  h.success ? u.push(...h.data) : h.errors.forEach((b) => {
3706
- var p;
3707
- c.push(F(l({}, b), {
3727
+ var m;
3728
+ c.push(E(l({}, b), {
3708
3729
  path: D(n, g),
3709
- input: (p = b.input) != null ? p : d
3730
+ input: (m = b.input) != null ? m : f
3710
3731
  }));
3711
3732
  });
3712
3733
  }
@@ -3714,15 +3735,15 @@ function ai(e) {
3714
3735
  r.push(...c);
3715
3736
  continue;
3716
3737
  }
3717
- t[n] = a ? u : u[0];
3738
+ t[n] = o ? u : u[0];
3718
3739
  }
3719
3740
  return r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
3720
3741
  }
3721
- function ui(e) {
3742
+ function pi(e) {
3722
3743
  const t = Array.isArray(e) ? e[0] : e;
3723
- if (!t || !O(t))
3744
+ if (!t || !$(t))
3724
3745
  return !0;
3725
- const r = "column" in t && t.column != null && O(t.column) ? t.column : t;
3746
+ const r = "column" in t && t.column != null && $(t.column) ? t.column : t;
3726
3747
  if ("composeCode" in r) {
3727
3748
  const s = r.composeCode;
3728
3749
  if (typeof s == "string" && s.startsWith("DM."))
@@ -3737,17 +3758,17 @@ function ui(e) {
3737
3758
  }
3738
3759
  return !("aggregation" in r || "attribute" in r && "aggregation" in r);
3739
3760
  }
3740
- const at = ["rows", "columns", "values", "grandTotals"];
3741
- function ci(e) {
3742
- if (!O(e)) return !1;
3761
+ const lt = ["rows", "columns", "values", "grandTotals"];
3762
+ function gi(e) {
3763
+ if (!$(e)) return !1;
3743
3764
  const t = Object.keys(e);
3744
3765
  return t.every((r) => r === "rows" || r === "columns") && t.every((r) => typeof e[r] == "boolean");
3745
3766
  }
3746
- function li(e) {
3767
+ function yi(e) {
3747
3768
  const t = [], r = {
3748
3769
  dataOptions: {}
3749
3770
  };
3750
- if (!O(e))
3771
+ if (!$(e))
3751
3772
  return t.push({
3752
3773
  path: "dataOptions",
3753
3774
  input: e,
@@ -3755,34 +3776,34 @@ function li(e) {
3755
3776
  }), { normalized: r, errors: t };
3756
3777
  const s = e.dataOptions;
3757
3778
  if (s === void 0) {
3758
- const n = Object.keys(e), i = x("dataOptions", n, (u) => u), o = i && i.distance <= T ? ` Did you mean 'dataOptions'? (You may have typed '${i.best}')` : "", a = i && i.distance <= T ? { [i.best]: e[i.best] } : e;
3779
+ const n = Object.keys(e), i = x("dataOptions", n, (u) => u), a = i && i.distance <= C ? ` Did you mean 'dataOptions'? (You may have typed '${i.best}')` : "", o = i && i.distance <= C ? { [i.best]: e[i.best] } : e;
3759
3780
  t.push({
3760
3781
  path: "dataOptions",
3761
- input: a,
3762
- message: `dataOptions is required.${o}`
3782
+ input: o,
3783
+ message: `dataOptions is required.${a}`
3763
3784
  });
3764
- } else if (O(s)) {
3785
+ } else if ($(s)) {
3765
3786
  const n = s;
3766
3787
  r.dataOptions = n;
3767
- for (const o of Object.keys(n))
3768
- if (!at.includes(o)) {
3769
- const a = x(o, [...at], (c) => c), u = a && a.distance <= T ? ` Did you mean '${a.best}'?` : "";
3788
+ for (const a of Object.keys(n))
3789
+ if (!lt.includes(a)) {
3790
+ const o = x(a, [...lt], (c) => c), u = o && o.distance <= C ? ` Did you mean '${o.best}'?` : "";
3770
3791
  t.push({
3771
- path: D(o),
3772
- input: n[o],
3773
- message: `Unknown dataOptions key '${o}'. Valid keys: rows, columns, values, grandTotals.${u}`
3792
+ path: D(a),
3793
+ input: n[a],
3794
+ message: `Unknown dataOptions key '${a}'. Valid keys: rows, columns, values, grandTotals.${u}`
3774
3795
  });
3775
3796
  }
3776
- for (const o of ["rows", "columns", "values"]) {
3777
- const a = n[o];
3778
- a != null && !Array.isArray(a) && t.push({
3779
- path: D(o),
3780
- input: a,
3781
- message: `dataOptions.${o} must be an array`
3797
+ for (const a of ["rows", "columns", "values"]) {
3798
+ const o = n[a];
3799
+ o != null && !Array.isArray(o) && t.push({
3800
+ path: D(a),
3801
+ input: o,
3802
+ message: `dataOptions.${a} must be an array`
3782
3803
  });
3783
3804
  }
3784
3805
  const i = n.grandTotals;
3785
- i != null && !ci(i) && t.push({
3806
+ i != null && !gi(i) && t.push({
3786
3807
  path: D("grandTotals"),
3787
3808
  input: i,
3788
3809
  message: "grandTotals must be an object with optional rows?: boolean, columns?: boolean"
@@ -3790,7 +3811,7 @@ function li(e) {
3790
3811
  }
3791
3812
  return e.styleOptions !== void 0 && (r.styleOptions = e.styleOptions), e.filters !== void 0 && Array.isArray(e.filters) && (r.filters = e.filters), e.highlights !== void 0 && Array.isArray(e.highlights) && (r.highlights = e.highlights), { normalized: r, errors: t };
3792
3813
  }
3793
- function di(e, t, r) {
3814
+ function hi(e, t, r) {
3794
3815
  if (!e || typeof e != "object")
3795
3816
  return r.push({
3796
3817
  path: D(-1),
@@ -3798,17 +3819,17 @@ function di(e, t, r) {
3798
3819
  message: "dataOptions is required"
3799
3820
  }), null;
3800
3821
  const s = {}, n = r.length;
3801
- for (const o of ["rows", "columns"]) {
3802
- const a = ce(
3803
- o,
3804
- e[o],
3822
+ for (const a of ["rows", "columns"]) {
3823
+ const o = le(
3824
+ a,
3825
+ e[a],
3805
3826
  "dimension",
3806
3827
  t,
3807
3828
  r
3808
3829
  );
3809
- a && (s[o] = a);
3830
+ o && (s[a] = o);
3810
3831
  }
3811
- const i = ce(
3832
+ const i = le(
3812
3833
  "values",
3813
3834
  e.values,
3814
3835
  "measure",
@@ -3817,28 +3838,28 @@ function di(e, t, r) {
3817
3838
  );
3818
3839
  return i && (s.values = i), e.grandTotals !== void 0 && (s.grandTotals = e.grandTotals), r.length > n ? null : s;
3819
3840
  }
3820
- const fi = (e) => {
3821
- const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: o } = li(t);
3822
- if (o.length > 0)
3823
- return { success: !1, errors: o };
3824
- const a = re(n), u = [], c = di(
3841
+ const bi = (e) => {
3842
+ const { data: t, context: r } = e, { dataSource: s, tables: n } = r, { normalized: i, errors: a } = yi(t);
3843
+ if (a.length > 0)
3844
+ return { success: !1, errors: a };
3845
+ const o = se(n), u = [], c = hi(
3825
3846
  i.dataOptions,
3826
- { dataSource: s, schemaIndex: a },
3847
+ { dataSource: s, schemaIndex: o },
3827
3848
  u
3828
3849
  );
3829
3850
  let g = null;
3830
3851
  i.filters && i.filters.length > 0 && (g = A(
3831
- () => se({
3852
+ () => ne({
3832
3853
  data: i.filters || [],
3833
- context: { dataSource: s, schemaIndex: a }
3854
+ context: { dataSource: s, schemaIndex: o }
3834
3855
  }),
3835
3856
  u
3836
3857
  ));
3837
- let d = null;
3838
- return i.highlights && i.highlights.length > 0 && (d = A(
3839
- () => me({
3858
+ let f = null;
3859
+ return i.highlights && i.highlights.length > 0 && (f = A(
3860
+ () => he({
3840
3861
  data: i.highlights || [],
3841
- context: { dataSource: s, schemaIndex: a }
3862
+ context: { dataSource: s, schemaIndex: o }
3842
3863
  }),
3843
3864
  u
3844
3865
  )), u.length > 0 || c === null ? {
@@ -3847,11 +3868,11 @@ const fi = (e) => {
3847
3868
  } : {
3848
3869
  success: !0,
3849
3870
  data: l(l(l({
3850
- dataSet: le(s),
3871
+ dataSet: de(s),
3851
3872
  dataOptions: c
3852
- }, i.styleOptions && { styleOptions: i.styleOptions }), g && { filters: g }), d && { highlights: d })
3873
+ }, i.styleOptions && { styleOptions: i.styleOptions }), g && { filters: g }), f && { highlights: f })
3853
3874
  };
3854
- }, pi = (e) => {
3875
+ }, Fi = (e) => {
3855
3876
  const t = [];
3856
3877
  if (!e.dataOptions)
3857
3878
  return {
@@ -3868,54 +3889,54 @@ const fi = (e) => {
3868
3889
  for (const u of ["rows", "columns"]) {
3869
3890
  const c = r[u];
3870
3891
  if (c && c.length > 0) {
3871
- const g = ot(u, c, "dimension");
3892
+ const g = ct(u, c, "dimension");
3872
3893
  g.success ? s[u] = g.data : t.push(...g.errors);
3873
3894
  }
3874
3895
  }
3875
3896
  const n = r.values;
3876
3897
  if (n && n.length > 0) {
3877
- const u = ot("values", n, "measure");
3898
+ const u = ct("values", n, "measure");
3878
3899
  u.success ? s.values = u.data : t.push(...u.errors);
3879
3900
  }
3880
3901
  r.grandTotals !== void 0 && (s.grandTotals = r.grandTotals);
3881
3902
  let i;
3882
3903
  if (e.filters) {
3883
3904
  const u = A(
3884
- () => ne(e.filters),
3905
+ () => ie(e.filters),
3885
3906
  t
3886
3907
  );
3887
3908
  i = u != null ? u : void 0;
3888
3909
  }
3889
- let o;
3910
+ let a;
3890
3911
  if (e.highlights && e.highlights.length > 0) {
3891
3912
  const u = A(
3892
- () => ge(e.highlights),
3913
+ () => be(e.highlights),
3893
3914
  t
3894
3915
  );
3895
- o = u != null ? u : void 0;
3916
+ a = u != null ? u : void 0;
3896
3917
  }
3897
3918
  if (t.length > 0)
3898
3919
  return { success: !1, errors: t };
3899
- const a = l(l(l({
3920
+ const o = l(l(l({
3900
3921
  dataOptions: s
3901
- }, e.styleOptions && { styleOptions: e.styleOptions }), i && i.length > 0 && { filters: i }), o && o.length > 0 && { highlights: o });
3922
+ }, e.styleOptions && { styleOptions: e.styleOptions }), i && i.length > 0 && { filters: i }), a && a.length > 0 && { highlights: a });
3902
3923
  return {
3903
3924
  success: !0,
3904
- data: B(a)
3925
+ data: L(o)
3905
3926
  };
3906
- }, mi = (e, t, r) => {
3907
- const s = re(r.tables), n = { dataSource: r.dataSource, schemaIndex: s }, i = [], o = e && e.length > 0 ? A(
3908
- () => se({ data: e, context: n }),
3927
+ }, Ei = (e, t, r) => {
3928
+ const s = se(r.tables), n = { dataSource: r.dataSource, schemaIndex: s }, i = [], a = e && e.length > 0 ? A(
3929
+ () => ne({ data: e, context: n }),
3909
3930
  i
3910
- ) : void 0, a = t && t.length > 0 ? A(
3911
- () => me({ data: t, context: n }),
3931
+ ) : void 0, o = t && t.length > 0 ? A(
3932
+ () => he({ data: t, context: n }),
3912
3933
  i
3913
3934
  ) : void 0;
3914
3935
  return i.length > 0 ? { success: !1, errors: i } : {
3915
3936
  success: !0,
3916
- data: l(l({}, o != null && { filters: o }), a != null && { highlights: a })
3937
+ data: l(l({}, a != null && { filters: a }), o != null && { highlights: o })
3917
3938
  };
3918
- }, gi = [
3939
+ }, Ai = [
3919
3940
  "widgetType",
3920
3941
  "id",
3921
3942
  "title",
@@ -3923,36 +3944,36 @@ const fi = (e) => {
3923
3944
  "dataSource",
3924
3945
  "config",
3925
3946
  "highlightSelectionDisabled"
3926
- ], ut = (e, t, r, s) => {
3927
- const { id: n, title: i, description: o, dataSource: a, config: u, highlightSelectionDisabled: c } = e, g = _(e, gi), d = r({ data: g, context: t });
3928
- return d.success ? {
3947
+ ], ft = (e, t, r, s) => {
3948
+ const { id: n, title: i, description: a, dataSource: o, config: u, highlightSelectionDisabled: c } = e, g = _(e, Ai), f = r({ data: g, context: t });
3949
+ return f.success ? {
3929
3950
  success: !0,
3930
- data: s(d.data, {
3951
+ data: s(f.data, {
3931
3952
  id: n,
3932
3953
  title: i,
3933
- description: o,
3934
- dataSource: a,
3954
+ description: a,
3955
+ dataSource: o,
3935
3956
  config: u,
3936
3957
  highlightSelectionDisabled: c
3937
3958
  })
3938
- } : d;
3939
- }, yi = (e, t) => {
3940
- const n = e, { dataSet: r } = n, s = ye(n, ["dataSet"]);
3941
- return l(l(l(l(l(F(l({}, s), {
3959
+ } : f;
3960
+ }, Ti = (e, t) => {
3961
+ const n = e, { dataSet: r } = n, s = Fe(n, ["dataSet"]);
3962
+ return l(l(l(l(l(E(l({}, s), {
3942
3963
  widgetType: "chart",
3943
3964
  id: t.id
3944
- }), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 && mt(r) && { dataSource: r }), t.config !== void 0 && { config: t.config }), t.highlightSelectionDisabled !== void 0 && {
3965
+ }), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 && Ft(r) && { dataSource: r }), t.config !== void 0 && { config: t.config }), t.highlightSelectionDisabled !== void 0 && {
3945
3966
  highlightSelectionDisabled: t.highlightSelectionDisabled
3946
3967
  }), t.title !== void 0 && { title: t.title }), t.description !== void 0 && { description: t.description });
3947
- }, hi = (e, t) => {
3948
- const n = e, { dataSet: r } = n, s = ye(n, ["dataSet"]);
3949
- return l(l(l(l(F(l({}, s), {
3968
+ }, wi = (e, t) => {
3969
+ const n = e, { dataSet: r } = n, s = Fe(n, ["dataSet"]);
3970
+ return l(l(l(l(E(l({}, s), {
3950
3971
  widgetType: "pivot",
3951
3972
  id: t.id
3952
- }), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 && mt(r) && { dataSource: r }), t.config !== void 0 && { config: t.config }), t.title !== void 0 && { title: t.title }), t.description !== void 0 && { description: t.description });
3953
- }, Oe = ["chart", "pivot", "text", "custom"], bi = (e) => typeof e == "string" && Oe.includes(e);
3954
- function Ei(e) {
3955
- if (!O(e))
3973
+ }), t.dataSource !== void 0 ? { dataSource: t.dataSource } : r !== void 0 && Ft(r) && { dataSource: r }), t.config !== void 0 && { config: t.config }), t.title !== void 0 && { title: t.title }), t.description !== void 0 && { description: t.description });
3974
+ }, Ne = ["chart", "pivot", "text", "custom"], Si = (e) => typeof e == "string" && Ne.includes(e);
3975
+ function Ci(e) {
3976
+ if (!$(e))
3956
3977
  return {
3957
3978
  path: "widgetType",
3958
3979
  input: e,
@@ -3960,15 +3981,15 @@ function Ei(e) {
3960
3981
  };
3961
3982
  const t = e.widgetType;
3962
3983
  if (t === void 0) {
3963
- const r = Object.keys(e), s = x("widgetType", r, (o) => o), n = s && s.distance <= T ? ` Did you mean 'widgetType'? (You may have typed '${s.best}')` : "";
3984
+ const r = Object.keys(e), s = x("widgetType", r, (a) => a), n = s && s.distance <= C ? ` Did you mean 'widgetType'? (You may have typed '${s.best}')` : "";
3964
3985
  return {
3965
3986
  path: "widgetType",
3966
- input: s && s.distance <= T ? { [s.best]: e[s.best] } : e,
3987
+ input: s && s.distance <= C ? { [s.best]: e[s.best] } : e,
3967
3988
  message: `widgetType is required.${n}`
3968
3989
  };
3969
3990
  }
3970
- if (!bi(t)) {
3971
- const r = x(String(t), Oe, (i) => i), s = r && r.distance <= T ? ` Did you mean '${r.best}'?` : "", n = Oe.join(", ");
3991
+ if (!Si(t)) {
3992
+ const r = x(String(t), Ne, (i) => i), s = r && r.distance <= C ? ` Did you mean '${r.best}'?` : "", n = Ne.join(", ");
3972
3993
  return {
3973
3994
  path: "widgetType",
3974
3995
  input: t,
@@ -3979,30 +4000,30 @@ function Ei(e) {
3979
4000
  }
3980
4001
  return null;
3981
4002
  }
3982
- const Fi = (e) => ({
4003
+ const Oi = (e) => ({
3983
4004
  path: "id",
3984
4005
  input: e,
3985
4006
  message: "Widget id is required"
3986
- }), Ai = (e) => !!e.id, wi = (e) => {
3987
- const { data: t, context: r } = e, s = Ei(t);
4007
+ }), qi = (e) => !!e.id, $i = (e) => {
4008
+ const { data: t, context: r } = e, s = Ci(t);
3988
4009
  if (s)
3989
4010
  return { success: !1, errors: [s] };
3990
- if (!Ai(t))
3991
- return { success: !1, errors: [Fi(t)] };
4011
+ if (!qi(t))
4012
+ return { success: !1, errors: [Oi(t)] };
3992
4013
  switch (t.widgetType) {
3993
4014
  case "chart":
3994
- return ut(
4015
+ return ft(
3995
4016
  t,
3996
4017
  r,
3997
- ii,
3998
- yi
4018
+ fi,
4019
+ Ti
3999
4020
  );
4000
4021
  case "pivot":
4001
- return ut(
4022
+ return ft(
4002
4023
  t,
4003
4024
  r,
4004
- fi,
4005
- hi
4025
+ bi,
4026
+ wi
4006
4027
  );
4007
4028
  case "text":
4008
4029
  return { success: !0, data: l({
@@ -4014,23 +4035,23 @@ const Fi = (e) => ({
4014
4035
  const {
4015
4036
  id: n,
4016
4037
  customWidgetType: i,
4017
- title: o,
4018
- description: a,
4038
+ title: a,
4039
+ description: o,
4019
4040
  dataSource: u,
4020
4041
  config: c,
4021
4042
  filters: g,
4022
- highlights: d,
4023
- dataOptions: m,
4043
+ highlights: f,
4044
+ dataOptions: p,
4024
4045
  styleOptions: h,
4025
4046
  customOptions: b
4026
- } = t, p = mi(g, d, r);
4027
- return p.success ? { success: !0, data: l(l(l(l(l(l({
4047
+ } = t, m = Ei(g, f, r);
4048
+ return m.success ? { success: !0, data: l(l(l(l(l(l({
4028
4049
  widgetType: "custom",
4029
4050
  id: n,
4030
4051
  customWidgetType: i,
4031
- dataSource: u !== void 0 ? u : le(r.dataSource),
4032
- dataOptions: m != null ? m : {}
4033
- }, o !== void 0 && { title: o }), a !== void 0 && { description: a }), c !== void 0 && { config: c }), h !== void 0 && { styleOptions: h }), b !== void 0 && { customOptions: b }), p.data) } : p;
4052
+ dataSource: u !== void 0 ? u : de(r.dataSource),
4053
+ dataOptions: p != null ? p : {}
4054
+ }, a !== void 0 && { title: a }), o !== void 0 && { description: o }), c !== void 0 && { config: c }), h !== void 0 && { styleOptions: h }), b !== void 0 && { customOptions: b }), m.data) } : m;
4034
4055
  }
4035
4056
  default:
4036
4057
  return {
@@ -4046,37 +4067,37 @@ const Fi = (e) => ({
4046
4067
  ]
4047
4068
  };
4048
4069
  }
4049
- }, Ti = (e) => {
4070
+ }, Di = (e) => {
4050
4071
  const { widgetType: t } = e;
4051
4072
  switch (t) {
4052
4073
  case "chart": {
4053
- const r = oi(e);
4074
+ const r = di(e);
4054
4075
  if (!r.success) return r;
4055
- const s = l(l(l(l(l(F(l({}, r.data), {
4076
+ const s = l(l(l(l(l(E(l({}, r.data), {
4056
4077
  widgetType: "chart",
4057
4078
  id: e.id
4058
4079
  }), e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
4059
- dataSource: ae(e.dataSource)
4080
+ dataSource: ue(e.dataSource)
4060
4081
  }), e.config !== void 0 && { config: e.config }), e.highlightSelectionDisabled !== void 0 && {
4061
4082
  highlightSelectionDisabled: e.highlightSelectionDisabled
4062
4083
  });
4063
4084
  return {
4064
4085
  success: !0,
4065
- data: B(s)
4086
+ data: L(s)
4066
4087
  };
4067
4088
  }
4068
4089
  case "pivot": {
4069
- const r = pi(e);
4090
+ const r = Fi(e);
4070
4091
  if (!r.success) return r;
4071
- const s = l(l(l(l(F(l({}, r.data), {
4092
+ const s = l(l(l(l(E(l({}, r.data), {
4072
4093
  widgetType: "pivot",
4073
4094
  id: e.id
4074
4095
  }), e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
4075
- dataSource: ae(e.dataSource)
4096
+ dataSource: ue(e.dataSource)
4076
4097
  }), e.config !== void 0 && { config: e.config });
4077
4098
  return {
4078
4099
  success: !0,
4079
- data: B(s)
4100
+ data: L(s)
4080
4101
  };
4081
4102
  }
4082
4103
  case "text":
@@ -4087,10 +4108,10 @@ const Fi = (e) => ({
4087
4108
  }, e.config !== void 0 && { config: e.config }) };
4088
4109
  case "custom": {
4089
4110
  const r = [], s = e.filters !== void 0 ? A(
4090
- () => ne(e.filters),
4111
+ () => ie(e.filters),
4091
4112
  r
4092
4113
  ) : void 0, n = e.highlights !== void 0 ? A(
4093
- () => ge(e.highlights),
4114
+ () => be(e.highlights),
4094
4115
  r
4095
4116
  ) : void 0;
4096
4117
  return r.length > 0 ? { success: !1, errors: r } : { success: !0, data: l(l(l(l(l(l(l(l(l({
@@ -4098,7 +4119,7 @@ const Fi = (e) => ({
4098
4119
  customWidgetType: e.customWidgetType,
4099
4120
  id: e.id
4100
4121
  }, e.title !== void 0 && { title: e.title }), e.description !== void 0 && { description: e.description }), e.dataSource !== void 0 && {
4101
- dataSource: ae(e.dataSource)
4122
+ dataSource: ue(e.dataSource)
4102
4123
  }), e.config !== void 0 && { config: e.config }), e.dataOptions !== void 0 && {
4103
4124
  dataOptions: e.dataOptions
4104
4125
  }), e.styleOptions !== void 0 && { styleOptions: e.styleOptions }), e.customOptions !== void 0 && {
@@ -4121,13 +4142,13 @@ const Fi = (e) => ({
4121
4142
  ]
4122
4143
  };
4123
4144
  }
4124
- }, Ni = (e) => {
4145
+ }, _i = (e) => {
4125
4146
  const { data: t, context: r } = e, s = [], n = [];
4126
- Array.isArray(t.widgets) ? t.widgets.forEach((a, u) => {
4127
- const c = wi({ data: a, context: r });
4147
+ Array.isArray(t.widgets) ? t.widgets.forEach((o, u) => {
4148
+ const c = $i({ data: o, context: r });
4128
4149
  if (!c.success) {
4129
4150
  s.push(
4130
- ...er(c.errors, Zt(u))
4151
+ ...ar(c.errors, ir(u))
4131
4152
  );
4132
4153
  return;
4133
4154
  }
@@ -4139,11 +4160,11 @@ const Fi = (e) => ({
4139
4160
  });
4140
4161
  let i = null;
4141
4162
  if (t.filters && t.filters.length > 0) {
4142
- const a = re(r.tables);
4163
+ const o = se(r.tables);
4143
4164
  i = A(
4144
- () => se({
4165
+ () => ne({
4145
4166
  data: t.filters,
4146
- context: { dataSource: r.dataSource, schemaIndex: a }
4167
+ context: { dataSource: r.dataSource, schemaIndex: o }
4147
4168
  }),
4148
4169
  s
4149
4170
  );
@@ -4157,13 +4178,13 @@ const Fi = (e) => ({
4157
4178
  }), t.styleOptions !== void 0 && { styleOptions: t.styleOptions }), t.widgetsOptions !== void 0 && {
4158
4179
  widgetsOptions: t.widgetsOptions
4159
4180
  }) };
4160
- }, Mi = (e) => {
4181
+ }, Pi = (e) => {
4161
4182
  const t = [], r = [];
4162
- e.widgets.forEach((o, a) => {
4163
- const u = Ti(o);
4183
+ e.widgets.forEach((a, o) => {
4184
+ const u = Di(a);
4164
4185
  if (!u.success) {
4165
4186
  t.push(
4166
- ...er(u.errors, Zt(a))
4187
+ ...ar(u.errors, ir(o))
4167
4188
  );
4168
4189
  return;
4169
4190
  }
@@ -4171,28 +4192,28 @@ const Fi = (e) => ({
4171
4192
  });
4172
4193
  let s;
4173
4194
  if (e.filters) {
4174
- const o = A(
4175
- () => ne(e.filters),
4195
+ const a = A(
4196
+ () => ie(e.filters),
4176
4197
  t
4177
4198
  );
4178
- s = o != null ? o : void 0;
4199
+ s = a != null ? a : void 0;
4179
4200
  }
4180
4201
  if (t.length > 0)
4181
4202
  return { success: !1, errors: t };
4182
- const n = e.widgetsOptions !== void 0 ? Wn(e.widgetsOptions) : void 0, i = l(l(l(l(l(l(l(l({
4203
+ const n = e.widgetsOptions !== void 0 ? Jn(e.widgetsOptions) : void 0, i = l(l(l(l(l(l(l(l({
4183
4204
  widgets: r
4184
4205
  }, e.id !== void 0 && { id: e.id }), e.title !== void 0 && { title: e.title }), s && s.length > 0 && { filters: s }), e.layoutOptions !== void 0 && {
4185
4206
  layoutOptions: e.layoutOptions
4186
4207
  }), e.config !== void 0 && { config: e.config }), e.defaultDataSource !== void 0 && {
4187
- defaultDataSource: ae(e.defaultDataSource)
4208
+ defaultDataSource: ue(e.defaultDataSource)
4188
4209
  }), e.styleOptions !== void 0 && { styleOptions: e.styleOptions }), n !== void 0 && { widgetsOptions: n });
4189
4210
  return {
4190
4211
  success: !0,
4191
- data: B(i)
4212
+ data: L(i)
4192
4213
  };
4193
4214
  };
4194
- function Si(e) {
4195
- const { filters: t, relations: r } = es(
4215
+ function xi(e) {
4216
+ const { filters: t, relations: r } = ls(
4196
4217
  e.filters || []
4197
4218
  );
4198
4219
  return {
@@ -4205,27 +4226,59 @@ function Si(e) {
4205
4226
  // No count/offset/ungroup - these are execution concerns, not translation concerns
4206
4227
  };
4207
4228
  }
4208
- function Ri(e, t, r = !1) {
4209
- const s = Si(e), n = Xr(s, t);
4210
- return Zr(n, r);
4229
+ function Wi(e, t, r = !1) {
4230
+ const s = xi(e), n = us(s, t);
4231
+ return cs(n, r);
4232
+ }
4233
+ function fe(e) {
4234
+ const t = e.trim();
4235
+ return t.startsWith(T) ? t.slice(T.length) : t;
4236
+ }
4237
+ function H(e) {
4238
+ var s;
4239
+ const t = ye(e.function);
4240
+ if (t) {
4241
+ const n = t.findIndex((i) => i.isName);
4242
+ if (n >= 0) {
4243
+ const i = e.args[n];
4244
+ if (typeof i == "string" && i.length > 0) return i;
4245
+ }
4246
+ }
4247
+ const r = e.args[0];
4248
+ return typeof r == "string" ? fe(r) : w(r) ? H(r) : (s = e.function.split(".").pop()) != null ? s : e.function;
4249
+ }
4250
+ const dt = "filterFactory.logic.";
4251
+ function mt(e) {
4252
+ var r;
4253
+ if (e.function.startsWith(dt))
4254
+ return e.function.slice(dt.length);
4255
+ const t = e.args[0];
4256
+ return typeof t == "string" ? fe(t) : w(t) ? H(t) : (r = e.function.split(".").pop()) != null ? r : e.function;
4257
+ }
4258
+ const Ni = "measureFactory.", vi = "filterFactory.", Mi = (e) => e.function.startsWith(Ni), Ri = (e) => e.function.startsWith(vi);
4259
+ function Vi(e, t) {
4260
+ var s;
4261
+ const r = (s = t == null ? void 0 : t.role) != null ? s : "filter";
4262
+ return typeof e == "string" ? { name: fe(e), type: "dimension" } : zt(e) ? { name: fe(e.column), type: "dimension" } : Ut(e) ? { name: H(e.column), type: "measure" } : w(e) ? Mi(e) ? { name: H(e), type: "measure" } : Ri(e) ? { name: mt(e), type: r } : (t == null ? void 0 : t.role) !== void 0 ? { name: mt(e), type: r } : { name: H(e), type: "measure" } : null;
4211
4263
  }
4212
4264
  export {
4213
- Di as CustomSuperJSON,
4214
- Bi as EMPTY_EXPANDED_QUERY_MODEL,
4215
- Li as EMPTY_SIMPLE_QUERY_MODEL,
4216
- zi as isByIdDashboardCodeParams,
4217
- Ui as isByIdWidgetCodeParams,
4218
- _i as isClientSideDashboardCodeParams,
4219
- Pi as isClientSideWidgetCodeParams,
4220
- ii as translateChartFromJSON,
4221
- oi as translateChartToJSON,
4222
- Ni as translateDashboardFromJSON,
4223
- Mi as translateDashboardToJSON,
4224
- fi as translatePivotTableFromJSON,
4225
- pi as translatePivotTableToJSON,
4226
- xi as translateQueryFromJSON,
4227
- vi as translateQueryToJSON,
4228
- Ri as translateQueryToJaql,
4229
- wi as translateWidgetFromJSON,
4230
- Ti as translateWidgetToJSON
4265
+ Bi as CustomSuperJSON,
4266
+ Ki as EMPTY_EXPANDED_QUERY_MODEL,
4267
+ Gi as EMPTY_SIMPLE_QUERY_MODEL,
4268
+ Vi as getQueryElementSummary,
4269
+ Yi as isByIdDashboardCodeParams,
4270
+ Hi as isByIdWidgetCodeParams,
4271
+ Qi as isClientSideDashboardCodeParams,
4272
+ Xi as isClientSideWidgetCodeParams,
4273
+ fi as translateChartFromJSON,
4274
+ di as translateChartToJSON,
4275
+ _i as translateDashboardFromJSON,
4276
+ Pi as translateDashboardToJSON,
4277
+ bi as translatePivotTableFromJSON,
4278
+ Fi as translatePivotTableToJSON,
4279
+ zi as translateQueryFromJSON,
4280
+ Ui as translateQueryToJSON,
4281
+ Wi as translateQueryToJaql,
4282
+ $i as translateWidgetFromJSON,
4283
+ Di as translateWidgetToJSON
4231
4284
  };