@sisense/sdk-ui 2.21.0 → 2.22.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 (136) hide show
  1. package/dist/ai.cjs +58 -58
  2. package/dist/ai.js +863 -846
  3. package/dist/analytics-composer/node.cjs +1 -1
  4. package/dist/analytics-composer/node.js +718 -709
  5. package/dist/analytics-composer.cjs +1 -1
  6. package/dist/analytics-composer.js +6 -6
  7. package/dist/{dimensions-DuUqQgpi.js → dimensions-BiLyFpCg.js} +1 -1
  8. package/dist/{dimensions-DVGn8ORR.cjs → dimensions-X4_igtmO.cjs} +1 -1
  9. package/dist/{execute-query-B21bnb05.js → execute-query-BEeqqDl6.js} +1483 -1490
  10. package/dist/execute-query-DJDE0zRU.cjs +1 -0
  11. package/dist/{index-0brX9D6q.cjs → index-NyouhE_A.cjs} +1 -1
  12. package/dist/{index-Ck90GjPy.js → index-kxX21arA.js} +15 -1
  13. package/dist/index.cjs +404 -404
  14. package/dist/index.js +22869 -21774
  15. package/dist/index.umd.js +644 -644
  16. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/index.d.ts +1 -1
  17. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +8 -1
  18. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +9 -2
  19. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/index.d.ts +4 -0
  20. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +13 -0
  21. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/{use-dashboard-model-reducer.d.ts → dashboard-model-reducer/types.d.ts} +19 -36
  22. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/use-dashboard-model-reducer.d.ts +9 -0
  23. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/utils.d.ts +28 -0
  24. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/use-dashboard-persistence.d.ts +4 -4
  25. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/duplicate-widget-utils.d.ts +34 -0
  26. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/index.d.ts +2 -0
  27. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +57 -0
  28. package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +43 -2
  29. package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +15 -3
  30. package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +7 -0
  31. package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/cascading-level-filter.d.ts +4 -1
  32. package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/use-cascadding-filter-tile-menu-items/use-cascadding-filter-tile-lock-menu-item.d.ts +13 -0
  33. package/dist/packages/sdk-ui/src/domains/filters/components/cascading-filter-tile/use-cascadding-filter-tile-menu-items/use-cascadding-filter-tile-menu-items.d.ts +14 -0
  34. package/dist/packages/sdk-ui/src/domains/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +7 -0
  35. package/dist/packages/sdk-ui/src/domains/filters/components/custom-filter-tile.d.ts +7 -0
  36. package/dist/packages/sdk-ui/src/domains/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +7 -0
  37. package/dist/packages/sdk-ui/src/domains/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +7 -0
  38. package/dist/packages/sdk-ui/src/domains/filters/components/{filter-tile.d.ts → filter-tile/filter-tile.d.ts} +7 -0
  39. package/dist/packages/sdk-ui/src/domains/filters/components/filter-tile/index.d.ts +1 -0
  40. package/dist/packages/sdk-ui/src/domains/filters/components/filter-tile/types.d.ts +36 -0
  41. package/dist/packages/sdk-ui/src/domains/filters/components/filter-tile-container.d.ts +6 -0
  42. package/dist/packages/sdk-ui/src/domains/filters/components/filters-panel/types.d.ts +13 -0
  43. package/dist/packages/sdk-ui/src/domains/filters/components/index.d.ts +1 -1
  44. package/dist/packages/sdk-ui/src/domains/filters/components/member-filter-tile/member-filter-tile.d.ts +7 -0
  45. package/dist/packages/sdk-ui/src/domains/filters/components/unsupported-filter-tile.d.ts +10 -1
  46. package/dist/packages/sdk-ui/src/domains/filters/shared/clone-filter-and-toggle-locked.d.ts +7 -0
  47. package/dist/packages/sdk-ui/src/domains/filters/shared/filter-tile-menu-button.d.ts +10 -0
  48. package/dist/packages/sdk-ui/src/domains/filters/shared/use-filter-tile-menu-items/use-filter-tile-lock-menu-item.d.ts +15 -0
  49. package/dist/packages/sdk-ui/src/domains/filters/shared/use-filter-tile-menu-items/use-filter-tile-menu-items.d.ts +14 -0
  50. package/dist/packages/sdk-ui/src/domains/formulas/index.d.ts +0 -1
  51. package/dist/packages/sdk-ui/src/domains/formulas/use-get-shared-formula.d.ts +20 -7
  52. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/index.d.ts +1 -0
  53. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +63 -0
  54. package/dist/packages/sdk-ui/src/domains/widgets/helpers/header-menu-utils.d.ts +1 -1
  55. package/dist/packages/sdk-ui/src/domains/widgets/helpers/index.d.ts +1 -1
  56. package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/types.d.ts +1 -17
  57. package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/widget-menu-button.d.ts +1 -1
  58. package/dist/packages/sdk-ui/src/infra/api/types/dashboard-dto.d.ts +2 -1
  59. package/dist/packages/sdk-ui/src/infra/app/client-application.d.ts +17 -0
  60. package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +3 -0
  61. package/dist/packages/sdk-ui/src/infra/app/settings/types/deployment-props.d.ts +1 -1
  62. package/dist/packages/sdk-ui/src/infra/app/settings/types/features.d.ts +18 -1
  63. package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/index.d.ts +5 -0
  64. package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/plugin-context.d.ts +15 -0
  65. package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/plugin-provider.d.ts +21 -0
  66. package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/types.d.ts +50 -0
  67. package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/validate-plugins.d.ts +9 -0
  68. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +14 -0
  69. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +14 -0
  70. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +14 -0
  71. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +14 -0
  72. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +14 -0
  73. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +14 -0
  74. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +14 -0
  75. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +14 -0
  76. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +14 -0
  77. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +14 -0
  78. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +14 -0
  79. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +14 -0
  80. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +14 -0
  81. package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +14 -0
  82. package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +28 -0
  83. package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +2 -1
  84. package/dist/packages/sdk-ui/src/modules/ai/api/narration-endpoints.d.ts +2 -1
  85. package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +1 -0
  86. package/dist/packages/sdk-ui/src/props.d.ts +13 -20
  87. package/dist/packages/sdk-ui/src/public-api/internal.d.ts +1 -0
  88. package/dist/packages/sdk-ui/src/public-api/public.d.ts +2 -2
  89. package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +6 -0
  90. package/dist/packages/sdk-ui/src/shared/components/alert/alert.d.ts +91 -0
  91. package/dist/packages/sdk-ui/src/shared/components/alert/index.d.ts +2 -0
  92. package/dist/packages/sdk-ui/src/shared/components/menu/menu-button.d.ts +2 -1
  93. package/dist/packages/sdk-ui/src/shared/components/quota-notification/quota-notification.d.ts +32 -0
  94. package/dist/packages/sdk-ui/src/shared/hooks/use-app-settings.d.ts +11 -0
  95. package/dist/packages/sdk-ui/src/shared/hooks/use-quota-notification.d.ts +54 -0
  96. package/dist/packages/sdk-ui/src/shared/hooks/use-quota-warning-dismissed.d.ts +8 -0
  97. package/dist/packages/sdk-ui/src/shared/icons/warning-icon.d.ts +6 -0
  98. package/dist/packages/sdk-ui/src/shared/icons/x-circle-icon.d.ts +6 -0
  99. package/dist/packages/sdk-ui/src/shared/types/menu-item.d.ts +17 -0
  100. package/dist/{use-common-filters-DBqRT0et.js → quota-notification-D6oMJal8.js} +10460 -10234
  101. package/dist/{use-common-filters-CXJN3RSs.cjs → quota-notification-z3dv2KoH.cjs} +129 -129
  102. package/dist/translations/de-de.cjs +1 -1
  103. package/dist/translations/de-de.js +16 -2
  104. package/dist/translations/en-us.cjs +1 -1
  105. package/dist/translations/en-us.js +1 -1
  106. package/dist/translations/es-ar.cjs +1 -1
  107. package/dist/translations/es-ar.js +16 -2
  108. package/dist/translations/es-es.cjs +1 -1
  109. package/dist/translations/es-es.js +16 -2
  110. package/dist/translations/fr-fr.cjs +1 -1
  111. package/dist/translations/fr-fr.js +16 -2
  112. package/dist/translations/it-it.cjs +1 -1
  113. package/dist/translations/it-it.js +16 -2
  114. package/dist/translations/ja-jp.cjs +1 -1
  115. package/dist/translations/ja-jp.js +16 -2
  116. package/dist/translations/ko-kr.cjs +1 -1
  117. package/dist/translations/ko-kr.js +16 -2
  118. package/dist/translations/nl-nl.cjs +1 -1
  119. package/dist/translations/nl-nl.js +16 -2
  120. package/dist/translations/pt-br.cjs +1 -1
  121. package/dist/translations/pt-br.js +16 -2
  122. package/dist/translations/ru-ru.cjs +1 -1
  123. package/dist/translations/ru-ru.js +16 -2
  124. package/dist/translations/tr-tr.cjs +1 -1
  125. package/dist/translations/tr-tr.js +16 -2
  126. package/dist/translations/zh-cn.cjs +1 -1
  127. package/dist/translations/zh-cn.js +16 -2
  128. package/dist/{types-Ch9J6ycn.cjs → types-CoY6F8Ma.cjs} +1 -1
  129. package/dist/{types-Ockb-LJ0.js → types-ixSwJkxM.js} +1 -1
  130. package/dist/{utils-BXDqo_yg.js → utils-BP-BglHE.js} +4181 -4157
  131. package/dist/{utils-DH69_bUK.cjs → utils-C8YMrOdw.cjs} +36 -36
  132. package/dist/{widget-composer-DfVCQL2G.js → widget-composer-CUUFoCb9.js} +3 -3
  133. package/dist/{widget-composer-DgCWcMJ1.cjs → widget-composer-DI4sHaNe.cjs} +3 -3
  134. package/package.json +10 -9
  135. package/dist/execute-query-BIkhszY1.cjs +0 -1
  136. /package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/{use-dasboard-model-utils.d.ts → use-dashboard-model-utils.d.ts} +0 -0
@@ -1,20 +1,20 @@
1
- var Xe = Object.defineProperty, ve = Object.defineProperties;
2
- var er = Object.getOwnPropertyDescriptors;
3
- var pe = Object.getOwnPropertySymbols;
4
- var rr = Object.prototype.hasOwnProperty, tr = Object.prototype.propertyIsEnumerable;
5
- var ye = (e, r, t) => r in e ? Xe(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, p = (e, r) => {
1
+ var er = Object.defineProperty, rr = Object.defineProperties;
2
+ var tr = Object.getOwnPropertyDescriptors;
3
+ var ye = Object.getOwnPropertySymbols;
4
+ var sr = Object.prototype.hasOwnProperty, nr = Object.prototype.propertyIsEnumerable;
5
+ var ge = (e, r, t) => r in e ? er(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, g = (e, r) => {
6
6
  for (var t in r || (r = {}))
7
- rr.call(r, t) && ye(e, t, r[t]);
8
- if (pe)
9
- for (var t of pe(r))
10
- tr.call(r, t) && ye(e, t, r[t]);
7
+ sr.call(r, t) && ge(e, t, r[t]);
8
+ if (ye)
9
+ for (var t of ye(r))
10
+ nr.call(r, t) && ge(e, t, r[t]);
11
11
  return e;
12
- }, b = (e, r) => ve(e, er(r));
13
- import { f as sr, J as nr } from "../types-Ockb-LJ0.js";
14
- import { b as _s, E as Us, a as Ws, i as js, e as Js, d as Gs } from "../types-Ockb-LJ0.js";
15
- import { bW as ir, bA as or, bX as ar, bY as ur, bZ as cr, aw as se, b_ as lr, av as fr, b$ as dr, b8 as mr, ax as pr, c0 as yr, bb as gr, b9 as hr, aL as br, b7 as Fr, ba as wr, d as qr, c as Er, k as Cr, c1 as $r, c2 as Ar, c3 as xr, c4 as Dr, c5 as Mr, c6 as Sr, c7 as Tr, c8 as Nr, c9 as Rr, ca as Or, cb as Ir, au as zr, cc as Pr, cd as Br, S as ne, h as kr, s as ie, b as U, M as O, ce as Ee, bG as Ce, cf as Lr, cg as Vr, ch as _r, ci as Ur, cj as Wr, aH as jr, an as ge, am as Jr, ck as $e, a7 as Gr, cl as Kr, y as Qr, x as Yr } from "../execute-query-B21bnb05.js";
16
- import { i as Hr, b as Zr, D as Xr, d as vr, a as et } from "../dimensions-DuUqQgpi.js";
17
- class rt {
12
+ }, h = (e, r) => rr(e, tr(r));
13
+ import { f as ir, J as or } from "../types-ixSwJkxM.js";
14
+ import { b as Ws, E as js, a as Js, i as Ks, e as Gs, d as Qs } from "../types-ixSwJkxM.js";
15
+ import { bW as ar, bA as ur, bX as cr, bY as lr, bZ as fr, aw as ne, b_ as dr, av as mr, b$ as pr, b8 as yr, ax as gr, c0 as hr, bb as br, b9 as Fr, aL as wr, b7 as qr, ba as Er, d as Cr, c as $r, k as Ar, c1 as xr, c2 as Dr, c3 as Mr, c4 as Sr, c5 as Tr, c6 as Nr, c7 as Rr, c8 as Or, c9 as Ir, ca as zr, cb as Br, au as Pr, cc as kr, cd as Lr, S as ie, h as Vr, s as oe, b as W, M as I, aj as $e, bG as Ae, ce as _r, cf as Ur, cg as Wr, ch as jr, ci as Jr, aH as Kr, an as he, am as Gr, cj as xe, a6 as Qr, ck as Yr, x as Hr, v as Zr } from "../execute-query-BEeqqDl6.js";
16
+ import { i as Xr, b as vr, D as et, d as rt, a as tt } from "../dimensions-BiLyFpCg.js";
17
+ class st {
18
18
  constructor() {
19
19
  this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
20
20
  }
@@ -31,9 +31,9 @@ class rt {
31
31
  this.keyToValue.clear(), this.valueToKey.clear();
32
32
  }
33
33
  }
34
- class Ae {
34
+ class De {
35
35
  constructor(r) {
36
- this.generateIdentifier = r, this.kv = new rt();
36
+ this.generateIdentifier = r, this.kv = new st();
37
37
  }
38
38
  register(r, t) {
39
39
  this.kv.getByValue(r) || (t || (t = this.generateIdentifier(r)), this.kv.set(t, r));
@@ -48,7 +48,7 @@ class Ae {
48
48
  return this.kv.getByKey(r);
49
49
  }
50
50
  }
51
- class tt extends Ae {
51
+ class nt extends De {
52
52
  constructor() {
53
53
  super((r) => r.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
54
54
  }
@@ -59,7 +59,7 @@ class tt extends Ae {
59
59
  return this.classToAllowedProps.get(r);
60
60
  }
61
61
  }
62
- function st(e) {
62
+ function it(e) {
63
63
  if ("values" in Object)
64
64
  return Object.values(e);
65
65
  const r = [];
@@ -67,8 +67,8 @@ function st(e) {
67
67
  e.hasOwnProperty(t) && r.push(e[t]);
68
68
  return r;
69
69
  }
70
- function nt(e, r) {
71
- const t = st(e);
70
+ function ot(e, r) {
71
+ const t = it(e);
72
72
  if ("find" in t)
73
73
  return t.find(r);
74
74
  const s = t;
@@ -78,20 +78,20 @@ function nt(e, r) {
78
78
  return o;
79
79
  }
80
80
  }
81
- function I(e, r) {
81
+ function z(e, r) {
82
82
  Object.entries(e).forEach(([t, s]) => r(s, t));
83
83
  }
84
- function W(e, r) {
84
+ function j(e, r) {
85
85
  return e.indexOf(r) !== -1;
86
86
  }
87
- function he(e, r) {
87
+ function be(e, r) {
88
88
  for (let t = 0; t < e.length; t++) {
89
89
  const s = e[t];
90
90
  if (r(s))
91
91
  return s;
92
92
  }
93
93
  }
94
- class it {
94
+ class at {
95
95
  constructor() {
96
96
  this.transfomers = {};
97
97
  }
@@ -99,13 +99,13 @@ class it {
99
99
  this.transfomers[r.name] = r;
100
100
  }
101
101
  findApplicable(r) {
102
- return nt(this.transfomers, (t) => t.isApplicable(r));
102
+ return ot(this.transfomers, (t) => t.isApplicable(r));
103
103
  }
104
104
  findByName(r) {
105
105
  return this.transfomers[r];
106
106
  }
107
107
  }
108
- const ot = (e) => Object.prototype.toString.call(e).slice(8, -1), xe = (e) => typeof e == "undefined", at = (e) => e === null, B = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, Z = (e) => B(e) && Object.keys(e).length === 0, D = (e) => Array.isArray(e), ut = (e) => typeof e == "string", ct = (e) => typeof e == "number" && !isNaN(e), lt = (e) => typeof e == "boolean", ft = (e) => e instanceof RegExp, k = (e) => e instanceof Map, L = (e) => e instanceof Set, De = (e) => ot(e) === "Symbol", dt = (e) => e instanceof Date && !isNaN(e.valueOf()), mt = (e) => e instanceof Error, be = (e) => typeof e == "number" && isNaN(e), pt = (e) => lt(e) || at(e) || xe(e) || ct(e) || ut(e) || De(e), yt = (e) => typeof e == "bigint", gt = (e) => e === 1 / 0 || e === -1 / 0, ht = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), bt = (e) => e instanceof URL, Me = (e) => e.replace(/\./g, "\\."), Q = (e) => e.map(String).map(Me).join("."), P = (e) => {
108
+ const ut = (e) => Object.prototype.toString.call(e).slice(8, -1), Me = (e) => typeof e == "undefined", ct = (e) => e === null, k = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, X = (e) => k(e) && Object.keys(e).length === 0, S = (e) => Array.isArray(e), lt = (e) => typeof e == "string", ft = (e) => typeof e == "number" && !isNaN(e), dt = (e) => typeof e == "boolean", mt = (e) => e instanceof RegExp, L = (e) => e instanceof Map, V = (e) => e instanceof Set, Se = (e) => ut(e) === "Symbol", pt = (e) => e instanceof Date && !isNaN(e.valueOf()), yt = (e) => e instanceof Error, Fe = (e) => typeof e == "number" && isNaN(e), gt = (e) => dt(e) || ct(e) || Me(e) || ft(e) || lt(e) || Se(e), ht = (e) => typeof e == "bigint", bt = (e) => e === 1 / 0 || e === -1 / 0, Ft = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), wt = (e) => e instanceof URL, Te = (e) => e.replace(/\./g, "\\."), Y = (e) => e.map(String).map(Te).join("."), P = (e) => {
109
109
  const r = [];
110
110
  let t = "";
111
111
  for (let n = 0; n < e.length; n++) {
@@ -123,7 +123,7 @@ const ot = (e) => Object.prototype.toString.call(e).slice(8, -1), xe = (e) => ty
123
123
  const s = t;
124
124
  return r.push(s), r;
125
125
  };
126
- function $(e, r, t, s) {
126
+ function A(e, r, t, s) {
127
127
  return {
128
128
  isApplicable: e,
129
129
  annotation: r,
@@ -131,12 +131,12 @@ function $(e, r, t, s) {
131
131
  untransform: s
132
132
  };
133
133
  }
134
- const Se = [
135
- $(xe, "undefined", () => null, () => {
134
+ const Ne = [
135
+ A(Me, "undefined", () => null, () => {
136
136
  }),
137
- $(yt, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
138
- $(dt, "Date", (e) => e.toISOString(), (e) => new Date(e)),
139
- $(mt, "Error", (e, r) => {
137
+ A(ht, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
138
+ A(pt, "Date", (e) => e.toISOString(), (e) => new Date(e)),
139
+ A(yt, "Error", (e, r) => {
140
140
  const t = {
141
141
  name: e.name,
142
142
  message: e.message
@@ -150,24 +150,24 @@ const Se = [
150
150
  t[s] = e[s];
151
151
  }), t;
152
152
  }),
153
- $(ft, "regexp", (e) => "" + e, (e) => {
153
+ A(mt, "regexp", (e) => "" + e, (e) => {
154
154
  const r = e.slice(1, e.lastIndexOf("/")), t = e.slice(e.lastIndexOf("/") + 1);
155
155
  return new RegExp(r, t);
156
156
  }),
157
- $(
158
- L,
157
+ A(
158
+ V,
159
159
  "set",
160
160
  // (sets only exist in es6+)
161
161
  // eslint-disable-next-line es5/no-es6-methods
162
162
  (e) => [...e.values()],
163
163
  (e) => new Set(e)
164
164
  ),
165
- $(k, "map", (e) => [...e.entries()], (e) => new Map(e)),
166
- $((e) => be(e) || gt(e), "number", (e) => be(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
167
- $((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
168
- $(bt, "URL", (e) => e.toString(), (e) => new URL(e))
165
+ A(L, "map", (e) => [...e.entries()], (e) => new Map(e)),
166
+ A((e) => Fe(e) || bt(e), "number", (e) => Fe(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
167
+ A((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
168
+ A(wt, "URL", (e) => e.toString(), (e) => new URL(e))
169
169
  ];
170
- function j(e, r, t, s) {
170
+ function J(e, r, t, s) {
171
171
  return {
172
172
  isApplicable: e,
173
173
  annotation: r,
@@ -175,12 +175,12 @@ function j(e, r, t, s) {
175
175
  untransform: s
176
176
  };
177
177
  }
178
- const Te = j((e, r) => De(e) ? !!r.symbolRegistry.getIdentifier(e) : !1, (e, r) => ["symbol", r.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, r, t) => {
178
+ const Re = J((e, r) => Se(e) ? !!r.symbolRegistry.getIdentifier(e) : !1, (e, r) => ["symbol", r.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, r, t) => {
179
179
  const s = t.symbolRegistry.getValue(r[1]);
180
180
  if (!s)
181
181
  throw new Error("Trying to deserialize unknown symbol");
182
182
  return s;
183
- }), Ft = [
183
+ }), qt = [
184
184
  Int8Array,
185
185
  Uint8Array,
186
186
  Int16Array,
@@ -190,19 +190,19 @@ const Te = j((e, r) => De(e) ? !!r.symbolRegistry.getIdentifier(e) : !1, (e, r)
190
190
  Float32Array,
191
191
  Float64Array,
192
192
  Uint8ClampedArray
193
- ].reduce((e, r) => (e[r.name] = r, e), {}), Ne = j(ht, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, r) => {
194
- const t = Ft[r[1]];
193
+ ].reduce((e, r) => (e[r.name] = r, e), {}), Oe = J(Ft, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, r) => {
194
+ const t = qt[r[1]];
195
195
  if (!t)
196
196
  throw new Error("Trying to deserialize unknown typed array");
197
197
  return new t(e);
198
198
  });
199
- function Re(e, r) {
199
+ function Ie(e, r) {
200
200
  return e != null && e.constructor ? !!r.classRegistry.getIdentifier(e.constructor) : !1;
201
201
  }
202
- const Oe = j(Re, (e, r) => ["class", r.classRegistry.getIdentifier(e.constructor)], (e, r) => {
202
+ const ze = J(Ie, (e, r) => ["class", r.classRegistry.getIdentifier(e.constructor)], (e, r) => {
203
203
  const t = r.classRegistry.getAllowedProps(e.constructor);
204
204
  if (!t)
205
- return p({}, e);
205
+ return g({}, e);
206
206
  const s = {};
207
207
  return t.forEach((n) => {
208
208
  s[n] = e[n];
@@ -212,49 +212,49 @@ const Oe = j(Re, (e, r) => ["class", r.classRegistry.getIdentifier(e.constructor
212
212
  if (!s)
213
213
  throw new Error(`Trying to deserialize unknown class '${r[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
214
214
  return Object.assign(Object.create(s.prototype), e);
215
- }), Ie = j((e, r) => !!r.customTransformerRegistry.findApplicable(e), (e, r) => ["custom", r.customTransformerRegistry.findApplicable(e).name], (e, r) => r.customTransformerRegistry.findApplicable(e).serialize(e), (e, r, t) => {
215
+ }), Be = J((e, r) => !!r.customTransformerRegistry.findApplicable(e), (e, r) => ["custom", r.customTransformerRegistry.findApplicable(e).name], (e, r) => r.customTransformerRegistry.findApplicable(e).serialize(e), (e, r, t) => {
216
216
  const s = t.customTransformerRegistry.findByName(r[1]);
217
217
  if (!s)
218
218
  throw new Error("Trying to deserialize unknown custom value");
219
219
  return s.deserialize(e);
220
- }), wt = [Oe, Te, Ie, Ne], Fe = (e, r) => {
221
- const t = he(wt, (n) => n.isApplicable(e, r));
220
+ }), Et = [ze, Re, Be, Oe], we = (e, r) => {
221
+ const t = be(Et, (n) => n.isApplicable(e, r));
222
222
  if (t)
223
223
  return {
224
224
  value: t.transform(e, r),
225
225
  type: t.annotation(e, r)
226
226
  };
227
- const s = he(Se, (n) => n.isApplicable(e, r));
227
+ const s = be(Ne, (n) => n.isApplicable(e, r));
228
228
  if (s)
229
229
  return {
230
230
  value: s.transform(e, r),
231
231
  type: s.annotation
232
232
  };
233
- }, ze = {};
234
- Se.forEach((e) => {
235
- ze[e.annotation] = e;
233
+ }, Pe = {};
234
+ Ne.forEach((e) => {
235
+ Pe[e.annotation] = e;
236
236
  });
237
- const qt = (e, r, t) => {
238
- if (D(r))
237
+ const Ct = (e, r, t) => {
238
+ if (S(r))
239
239
  switch (r[0]) {
240
240
  case "symbol":
241
- return Te.untransform(e, r, t);
241
+ return Re.untransform(e, r, t);
242
242
  case "class":
243
- return Oe.untransform(e, r, t);
243
+ return ze.untransform(e, r, t);
244
244
  case "custom":
245
- return Ie.untransform(e, r, t);
245
+ return Be.untransform(e, r, t);
246
246
  case "typed-array":
247
- return Ne.untransform(e, r, t);
247
+ return Oe.untransform(e, r, t);
248
248
  default:
249
249
  throw new Error("Unknown transformation: " + r);
250
250
  }
251
251
  else {
252
- const s = ze[r];
252
+ const s = Pe[r];
253
253
  if (!s)
254
254
  throw new Error("Unknown transformation: " + r);
255
255
  return s.untransform(e, t);
256
256
  }
257
- }, R = (e, r) => {
257
+ }, O = (e, r) => {
258
258
  if (r > e.size)
259
259
  throw new Error("index out of bounds");
260
260
  const t = e.keys();
@@ -262,22 +262,22 @@ const qt = (e, r, t) => {
262
262
  t.next(), r--;
263
263
  return t.next().value;
264
264
  };
265
- function Pe(e) {
266
- if (W(e, "__proto__"))
265
+ function ke(e) {
266
+ if (j(e, "__proto__"))
267
267
  throw new Error("__proto__ is not allowed as a property");
268
- if (W(e, "prototype"))
268
+ if (j(e, "prototype"))
269
269
  throw new Error("prototype is not allowed as a property");
270
- if (W(e, "constructor"))
270
+ if (j(e, "constructor"))
271
271
  throw new Error("constructor is not allowed as a property");
272
272
  }
273
- const Et = (e, r) => {
274
- Pe(r);
273
+ const $t = (e, r) => {
274
+ ke(r);
275
275
  for (let t = 0; t < r.length; t++) {
276
276
  const s = r[t];
277
- if (L(e))
278
- e = R(e, +s);
279
- else if (k(e)) {
280
- const n = +s, o = +r[++t] == 0 ? "key" : "value", i = R(e, n);
277
+ if (V(e))
278
+ e = O(e, +s);
279
+ else if (L(e)) {
280
+ const n = +s, o = +r[++t] == 0 ? "key" : "value", i = O(e, n);
281
281
  switch (o) {
282
282
  case "key":
283
283
  e = i;
@@ -290,41 +290,41 @@ const Et = (e, r) => {
290
290
  e = e[s];
291
291
  }
292
292
  return e;
293
- }, X = (e, r, t) => {
294
- if (Pe(r), r.length === 0)
293
+ }, v = (e, r, t) => {
294
+ if (ke(r), r.length === 0)
295
295
  return t(e);
296
296
  let s = e;
297
297
  for (let o = 0; o < r.length - 1; o++) {
298
298
  const i = r[o];
299
- if (D(s)) {
299
+ if (S(s)) {
300
300
  const a = +i;
301
301
  s = s[a];
302
- } else if (B(s))
302
+ } else if (k(s))
303
303
  s = s[i];
304
- else if (L(s)) {
304
+ else if (V(s)) {
305
305
  const a = +i;
306
- s = R(s, a);
307
- } else if (k(s)) {
306
+ s = O(s, a);
307
+ } else if (L(s)) {
308
308
  if (o === r.length - 2)
309
309
  break;
310
- const u = +i, c = +r[++o] == 0 ? "key" : "value", m = R(s, u);
310
+ const u = +i, c = +r[++o] == 0 ? "key" : "value", p = O(s, u);
311
311
  switch (c) {
312
312
  case "key":
313
- s = m;
313
+ s = p;
314
314
  break;
315
315
  case "value":
316
- s = s.get(m);
316
+ s = s.get(p);
317
317
  break;
318
318
  }
319
319
  }
320
320
  }
321
321
  const n = r[r.length - 1];
322
- if (D(s) ? s[+n] = t(s[+n]) : B(s) && (s[n] = t(s[n])), L(s)) {
323
- const o = R(s, +n), i = t(o);
322
+ if (S(s) ? s[+n] = t(s[+n]) : k(s) && (s[n] = t(s[n])), V(s)) {
323
+ const o = O(s, +n), i = t(o);
324
324
  o !== i && (s.delete(o), s.add(i));
325
325
  }
326
- if (k(s)) {
327
- const o = +r[r.length - 2], i = R(s, o);
326
+ if (L(s)) {
327
+ const o = +r[r.length - 2], i = O(s, o);
328
328
  switch (+n == 0 ? "key" : "value") {
329
329
  case "key": {
330
330
  const u = t(i);
@@ -339,45 +339,45 @@ const Et = (e, r) => {
339
339
  }
340
340
  return e;
341
341
  };
342
- function v(e, r, t = []) {
342
+ function ee(e, r, t = []) {
343
343
  if (!e)
344
344
  return;
345
- if (!D(e)) {
346
- I(e, (o, i) => v(o, r, [...t, ...P(i)]));
345
+ if (!S(e)) {
346
+ z(e, (o, i) => ee(o, r, [...t, ...P(i)]));
347
347
  return;
348
348
  }
349
349
  const [s, n] = e;
350
- n && I(n, (o, i) => {
351
- v(o, r, [...t, ...P(i)]);
350
+ n && z(n, (o, i) => {
351
+ ee(o, r, [...t, ...P(i)]);
352
352
  }), r(s, t);
353
353
  }
354
- function Ct(e, r, t) {
355
- return v(r, (s, n) => {
356
- e = X(e, n, (o) => qt(o, s, t));
354
+ function At(e, r, t) {
355
+ return ee(r, (s, n) => {
356
+ e = v(e, n, (o) => Ct(o, s, t));
357
357
  }), e;
358
358
  }
359
- function $t(e, r) {
359
+ function xt(e, r) {
360
360
  function t(s, n) {
361
- const o = Et(e, P(n));
361
+ const o = $t(e, P(n));
362
362
  s.map(P).forEach((i) => {
363
- e = X(e, i, () => o);
363
+ e = v(e, i, () => o);
364
364
  });
365
365
  }
366
- if (D(r)) {
366
+ if (S(r)) {
367
367
  const [s, n] = r;
368
368
  s.forEach((o) => {
369
- e = X(e, P(o), () => e);
370
- }), n && I(n, t);
369
+ e = v(e, P(o), () => e);
370
+ }), n && z(n, t);
371
371
  } else
372
- I(r, t);
372
+ z(r, t);
373
373
  return e;
374
374
  }
375
- const At = (e, r) => B(e) || D(e) || k(e) || L(e) || Re(e, r);
376
- function xt(e, r, t) {
375
+ const Dt = (e, r) => k(e) || S(e) || L(e) || V(e) || Ie(e, r);
376
+ function Mt(e, r, t) {
377
377
  const s = t.get(e);
378
378
  s ? s.push(r) : t.set(e, [r]);
379
379
  }
380
- function Dt(e, r) {
380
+ function St(e, r) {
381
381
  const t = {};
382
382
  let s;
383
383
  return e.forEach((n) => {
@@ -385,64 +385,64 @@ function Dt(e, r) {
385
385
  return;
386
386
  r || (n = n.map((a) => a.map(String)).sort((a, u) => a.length - u.length));
387
387
  const [o, ...i] = n;
388
- o.length === 0 ? s = i.map(Q) : t[Q(o)] = i.map(Q);
389
- }), s ? Z(t) ? [s] : [s, t] : Z(t) ? void 0 : t;
388
+ o.length === 0 ? s = i.map(Y) : t[Y(o)] = i.map(Y);
389
+ }), s ? X(t) ? [s] : [s, t] : X(t) ? void 0 : t;
390
390
  }
391
- const Be = (e, r, t, s, n = [], o = [], i = /* @__PURE__ */ new Map()) => {
392
- var g;
393
- const a = pt(e);
391
+ const Le = (e, r, t, s, n = [], o = [], i = /* @__PURE__ */ new Map()) => {
392
+ var x;
393
+ const a = gt(e);
394
394
  if (!a) {
395
- xt(e, n, r);
395
+ Mt(e, n, r);
396
396
  const f = i.get(e);
397
397
  if (f)
398
398
  return s ? {
399
399
  transformedValue: null
400
400
  } : f;
401
401
  }
402
- if (!At(e, t)) {
403
- const f = Fe(e, t), h = f ? {
402
+ if (!Dt(e, t)) {
403
+ const f = we(e, t), d = f ? {
404
404
  transformedValue: f.value,
405
405
  annotations: [f.type]
406
406
  } : {
407
407
  transformedValue: e
408
408
  };
409
- return a || i.set(e, h), h;
409
+ return a || i.set(e, d), d;
410
410
  }
411
- if (W(o, e))
411
+ if (j(o, e))
412
412
  return {
413
413
  transformedValue: null
414
414
  };
415
- const u = Fe(e, t), c = (g = u == null ? void 0 : u.value) != null ? g : e, m = D(c) ? [] : {}, d = {};
416
- I(c, (f, h) => {
417
- if (h === "__proto__" || h === "constructor" || h === "prototype")
418
- throw new Error(`Detected property ${h}. This is a prototype pollution risk, please remove it from your object.`);
419
- const A = Be(f, r, t, s, [...n, h], [...o, e], i);
420
- m[h] = A.transformedValue, D(A.annotations) ? d[h] = A.annotations : B(A.annotations) && I(A.annotations, (z, N) => {
421
- d[Me(h) + "." + N] = z;
415
+ const u = we(e, t), c = (x = u == null ? void 0 : u.value) != null ? x : e, p = S(c) ? [] : {}, m = {};
416
+ z(c, (f, d) => {
417
+ if (d === "__proto__" || d === "constructor" || d === "prototype")
418
+ throw new Error(`Detected property ${d}. This is a prototype pollution risk, please remove it from your object.`);
419
+ const w = Le(f, r, t, s, [...n, d], [...o, e], i);
420
+ p[d] = w.transformedValue, S(w.annotations) ? m[d] = w.annotations : k(w.annotations) && z(w.annotations, ($, D) => {
421
+ m[Te(d) + "." + D] = $;
422
422
  });
423
423
  });
424
- const y = Z(d) ? {
425
- transformedValue: m,
424
+ const y = X(m) ? {
425
+ transformedValue: p,
426
426
  annotations: u ? [u.type] : void 0
427
427
  } : {
428
- transformedValue: m,
429
- annotations: u ? [u.type, d] : d
428
+ transformedValue: p,
429
+ annotations: u ? [u.type, m] : m
430
430
  };
431
431
  return a || i.set(e, y), y;
432
432
  };
433
- function ke(e) {
433
+ function Ve(e) {
434
434
  return Object.prototype.toString.call(e).slice(8, -1);
435
435
  }
436
- function we(e) {
437
- return ke(e) === "Array";
436
+ function qe(e) {
437
+ return Ve(e) === "Array";
438
438
  }
439
- function Mt(e) {
440
- if (ke(e) !== "Object")
439
+ function Tt(e) {
440
+ if (Ve(e) !== "Object")
441
441
  return !1;
442
442
  const r = Object.getPrototypeOf(e);
443
443
  return !!r && r.constructor === Object && r === Object.prototype;
444
444
  }
445
- function St(e, r, t, s, n) {
445
+ function Nt(e, r, t, s, n) {
446
446
  const o = {}.propertyIsEnumerable.call(s, r) ? "enumerable" : "nonenumerable";
447
447
  o === "enumerable" && (e[r] = t), n && o === "nonenumerable" && Object.defineProperty(e, r, {
448
448
  value: t,
@@ -451,17 +451,17 @@ function St(e, r, t, s, n) {
451
451
  configurable: !0
452
452
  });
453
453
  }
454
- function ee(e, r = {}) {
455
- if (we(e))
456
- return e.map((n) => ee(n, r));
457
- if (!Mt(e))
454
+ function re(e, r = {}) {
455
+ if (qe(e))
456
+ return e.map((n) => re(n, r));
457
+ if (!Tt(e))
458
458
  return e;
459
459
  const t = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
460
460
  return [...t, ...s].reduce((n, o) => {
461
- if (we(r.props) && !r.props.includes(o))
461
+ if (qe(r.props) && !r.props.includes(o))
462
462
  return n;
463
- const i = e[o], a = ee(i, r);
464
- return St(n, o, a, e, r.nonenumerable), n;
463
+ const i = e[o], a = re(i, r);
464
+ return Nt(n, o, a, e, r.nonenumerable), n;
465
465
  }, {});
466
466
  }
467
467
  class l {
@@ -469,27 +469,27 @@ class l {
469
469
  * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
470
470
  */
471
471
  constructor({ dedupe: r = !1 } = {}) {
472
- this.classRegistry = new tt(), this.symbolRegistry = new Ae((t) => {
472
+ this.classRegistry = new nt(), this.symbolRegistry = new De((t) => {
473
473
  var s;
474
474
  return (s = t.description) != null ? s : "";
475
- }), this.customTransformerRegistry = new it(), this.allowedErrorProps = [], this.dedupe = r;
475
+ }), this.customTransformerRegistry = new at(), this.allowedErrorProps = [], this.dedupe = r;
476
476
  }
477
477
  serialize(r) {
478
- const t = /* @__PURE__ */ new Map(), s = Be(r, t, this, this.dedupe), n = {
478
+ const t = /* @__PURE__ */ new Map(), s = Le(r, t, this, this.dedupe), n = {
479
479
  json: s.transformedValue
480
480
  };
481
- s.annotations && (n.meta = b(p({}, n.meta), {
481
+ s.annotations && (n.meta = h(g({}, n.meta), {
482
482
  values: s.annotations
483
483
  }));
484
- const o = Dt(t, this.dedupe);
485
- return o && (n.meta = b(p({}, n.meta), {
484
+ const o = St(t, this.dedupe);
485
+ return o && (n.meta = h(g({}, n.meta), {
486
486
  referentialEqualities: o
487
487
  })), n;
488
488
  }
489
489
  deserialize(r) {
490
490
  const { json: t, meta: s } = r;
491
- let n = ee(t);
492
- return s != null && s.values && (n = Ct(n, s.values, this)), s != null && s.referentialEqualities && (n = $t(n, s.referentialEqualities)), n;
491
+ let n = re(t);
492
+ return s != null && s.values && (n = At(n, s.values, this)), s != null && s.referentialEqualities && (n = xt(n, s.referentialEqualities)), n;
493
493
  }
494
494
  stringify(r) {
495
495
  return JSON.stringify(this.serialize(r));
@@ -504,7 +504,7 @@ class l {
504
504
  this.symbolRegistry.register(r, t);
505
505
  }
506
506
  registerCustom(r, t) {
507
- this.customTransformerRegistry.register(p({
507
+ this.customTransformerRegistry.register(g({
508
508
  name: t
509
509
  }, r));
510
510
  }
@@ -521,149 +521,149 @@ l.registerClass = l.defaultInstance.registerClass.bind(l.defaultInstance);
521
521
  l.registerSymbol = l.defaultInstance.registerSymbol.bind(l.defaultInstance);
522
522
  l.registerCustom = l.defaultInstance.registerCustom.bind(l.defaultInstance);
523
523
  l.allowErrorProps = l.defaultInstance.allowErrorProps.bind(l.defaultInstance);
524
- const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem, e.type), oe = (e) => new qr(
524
+ const R = (e) => e === void 0 ? ie.None : e, Rt = (e) => new or(e.metadataItem, e.type), ae = (e) => new Cr(
525
525
  e.name,
526
526
  e.expression,
527
527
  e.type,
528
528
  e.description,
529
- T(e.sort),
529
+ R(e.sort),
530
530
  e.dataSource,
531
531
  e.composeCode
532
- ), ae = (e) => new Er(
532
+ ), ue = (e) => new $r(
533
533
  e.name,
534
534
  e.expression,
535
535
  e.granularity,
536
536
  e.format,
537
537
  e.description,
538
- T(e.sort),
538
+ R(e.sort),
539
539
  e.dataSource,
540
540
  e.composeCode
541
541
  ), q = (e) => {
542
542
  switch (e.__serializable) {
543
543
  case "DimensionalAttribute":
544
- return oe(e);
545
- case "DimensionalLevelAttribute":
546
544
  return ae(e);
545
+ case "DimensionalLevelAttribute":
546
+ return ue(e);
547
547
  default:
548
548
  return e;
549
549
  }
550
- }, Le = (e) => new Xr(
550
+ }, _e = (e) => new et(
551
551
  e.name,
552
552
  e.expression,
553
553
  e.attributes.map(q),
554
- e.dimensions.map(Nt),
554
+ e.dimensions.map(Ot),
555
555
  e.type,
556
556
  e.description,
557
- T(e.sort),
557
+ R(e.sort),
558
558
  e.dataSource,
559
559
  e.composeCode,
560
560
  e.defaultAttribute ? q(e.defaultAttribute) : void 0
561
- ), Ve = (e) => new vr(
561
+ ), Ue = (e) => new rt(
562
562
  e.name,
563
563
  e.expression,
564
564
  e.description,
565
- T(e.sort),
565
+ R(e.sort),
566
566
  e.dataSource,
567
567
  e.composeCode
568
- ), Nt = (e) => {
568
+ ), Ot = (e) => {
569
569
  switch (e.__serializable) {
570
570
  case "DimensionalDimension":
571
- return Le(e);
571
+ return _e(e);
572
572
  case "DimensionalDateDimension":
573
- return Ve(e);
573
+ return Ue(e);
574
574
  default:
575
575
  return e;
576
576
  }
577
- }, ue = (e) => new Cr(
577
+ }, ce = (e) => new Ar(
578
578
  e.name,
579
579
  q(e.attribute),
580
580
  e.aggregation,
581
581
  e.format,
582
582
  e.description,
583
- T(e.sort),
583
+ R(e.sort),
584
584
  e.dataSource,
585
585
  e.composeCode
586
- ), ce = (e) => {
586
+ ), le = (e) => {
587
587
  const r = Object.fromEntries(
588
588
  Object.entries(e.context).map(([t, s]) => {
589
589
  if (s && typeof s == "object" && "__serializable" in s)
590
590
  switch (s.__serializable) {
591
591
  case "DimensionalAttribute":
592
- return [t, oe(s)];
593
- case "DimensionalLevelAttribute":
594
592
  return [t, ae(s)];
595
- case "DimensionalBaseMeasure":
593
+ case "DimensionalLevelAttribute":
596
594
  return [t, ue(s)];
597
- case "DimensionalCalculatedMeasure":
595
+ case "DimensionalBaseMeasure":
598
596
  return [t, ce(s)];
597
+ case "DimensionalCalculatedMeasure":
598
+ return [t, le(s)];
599
599
  default:
600
600
  return [t, s];
601
601
  }
602
602
  return [t, s];
603
603
  })
604
604
  );
605
- return new $r(
605
+ return new xr(
606
606
  e.name,
607
607
  e.expression,
608
608
  r,
609
609
  e.format,
610
610
  e.description,
611
- T(e.sort),
611
+ R(e.sort),
612
612
  e.dataSource,
613
613
  e.composeCode
614
614
  );
615
- }, _e = (e) => new Ar(
615
+ }, We = (e) => new Dr(
616
616
  e.name,
617
617
  q(e.attribute),
618
618
  e.format,
619
619
  e.description,
620
- T(e.sort),
620
+ R(e.sort),
621
621
  e.dataSource,
622
622
  e.composeCode
623
- ), Y = (e) => {
623
+ ), H = (e) => {
624
624
  switch (e.__serializable) {
625
625
  case "DimensionalBaseMeasure":
626
- return ue(e);
627
- case "DimensionalCalculatedMeasure":
628
626
  return ce(e);
627
+ case "DimensionalCalculatedMeasure":
628
+ return le(e);
629
629
  case "DimensionalMeasureTemplate":
630
- return _e(e);
630
+ return We(e);
631
631
  default:
632
632
  return e;
633
633
  }
634
- }, F = (e) => {
634
+ }, b = (e) => {
635
635
  switch (e.__serializable) {
636
636
  case "MembersFilter":
637
- return new Br(
637
+ return new Lr(
638
638
  q(e.attribute),
639
639
  e.members,
640
- e.config.backgroundFilter ? b(p({}, e.config), { backgroundFilter: F(e.config.backgroundFilter) }) : e.config,
640
+ e.config.backgroundFilter ? h(g({}, e.config), { backgroundFilter: b(e.config.backgroundFilter) }) : e.config,
641
641
  e.composeCode
642
642
  );
643
643
  case "LogicalAttributeFilter":
644
- return new Pr(
645
- e.filters.map((t) => F(t)),
644
+ return new kr(
645
+ e.filters.map((t) => b(t)),
646
646
  e.operator,
647
647
  e.config,
648
648
  e.composeCode
649
649
  );
650
650
  case "CascadingFilter":
651
- return new zr(
652
- e._filters.map((t) => F(t)),
651
+ return new Pr(
652
+ e._filters.map((t) => b(t)),
653
653
  e.config,
654
654
  e.composeCode
655
655
  );
656
656
  case "ExcludeFilter":
657
- return new Ir(
658
- F(e.filter),
659
- e.input ? F(e.input) : void 0,
657
+ return new Br(
658
+ b(e.filter),
659
+ e.input ? b(e.input) : void 0,
660
660
  e.config,
661
661
  e.composeCode
662
662
  );
663
663
  case "MeasureFilter":
664
- return new Or(
664
+ return new zr(
665
665
  q(e.attribute),
666
- Y(e.measure),
666
+ H(e.measure),
667
667
  e.operatorA,
668
668
  e.valueA,
669
669
  e.operatorB,
@@ -672,24 +672,24 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
672
672
  e.composeCode
673
673
  );
674
674
  case "RankingFilter":
675
- return new Rr(
675
+ return new Ir(
676
676
  q(e.attribute),
677
- Y(e.measure),
677
+ H(e.measure),
678
678
  e.operator,
679
679
  e.count,
680
680
  e.config,
681
681
  e.composeCode
682
682
  );
683
683
  case "MeasureRankingFilter":
684
- return new Nr(
685
- Y(e.measure),
684
+ return new Or(
685
+ H(e.measure),
686
686
  e.operator,
687
687
  e.count,
688
688
  e.config,
689
689
  e.composeCode
690
690
  );
691
691
  case "NumericFilter":
692
- return new Tr(
692
+ return new Rr(
693
693
  q(e.attribute),
694
694
  e.operatorA,
695
695
  e.valueA,
@@ -699,7 +699,7 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
699
699
  e.composeCode
700
700
  );
701
701
  case "TextFilter":
702
- return new Sr(
702
+ return new Nr(
703
703
  q(e.attribute),
704
704
  e.operatorA,
705
705
  e.valueA,
@@ -708,7 +708,7 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
708
708
  );
709
709
  case "DateRangeFilter": {
710
710
  const { valueA: t, valueB: s } = e;
711
- return new Mr(
711
+ return new Tr(
712
712
  q(e.attribute),
713
713
  t,
714
714
  s,
@@ -717,7 +717,7 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
717
717
  );
718
718
  }
719
719
  case "RelativeDateFilter":
720
- return new Dr(
720
+ return new Sr(
721
721
  q(e.attribute),
722
722
  e.offset,
723
723
  e.count,
@@ -727,7 +727,7 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
727
727
  e.composeCode
728
728
  );
729
729
  case "CustomFilter":
730
- return new xr(
730
+ return new Mr(
731
731
  q(e.attribute),
732
732
  e.jaqlExpression,
733
733
  e.config,
@@ -739,188 +739,188 @@ const T = (e) => e === void 0 ? ne.None : e, Tt = (e) => new nr(e.metadataItem,
739
739
  };
740
740
  l.registerCustom(
741
741
  {
742
- isApplicable: sr,
742
+ isApplicable: ir,
743
743
  serialize: (e) => e.serialize(),
744
- deserialize: (e) => Tt(e)
744
+ deserialize: (e) => Rt(e)
745
745
  },
746
746
  "JaqlElement"
747
747
  );
748
748
  l.registerCustom(
749
749
  {
750
- isApplicable: ir,
750
+ isApplicable: ar,
751
751
  serialize: (e) => e.serialize(),
752
- deserialize: (e) => oe(e)
752
+ deserialize: (e) => ae(e)
753
753
  },
754
754
  "DimensionalAttribute"
755
755
  );
756
756
  l.registerCustom(
757
757
  {
758
- isApplicable: or,
758
+ isApplicable: ur,
759
759
  serialize: (e) => e.serialize(),
760
- deserialize: (e) => ae(e)
760
+ deserialize: (e) => ue(e)
761
761
  },
762
762
  "DimensionalLevelAttribute"
763
763
  );
764
764
  l.registerCustom(
765
765
  {
766
- isApplicable: Hr,
766
+ isApplicable: Xr,
767
767
  serialize: (e) => e.serialize(),
768
- deserialize: (e) => Le(e)
768
+ deserialize: (e) => _e(e)
769
769
  },
770
770
  "DimensionalDimension"
771
771
  );
772
772
  l.registerCustom(
773
773
  {
774
- isApplicable: Zr,
774
+ isApplicable: vr,
775
775
  serialize: (e) => e.serialize(),
776
- deserialize: (e) => Ve(e)
776
+ deserialize: (e) => Ue(e)
777
777
  },
778
778
  "DimensionalDateDimension"
779
779
  );
780
780
  l.registerCustom(
781
781
  {
782
- isApplicable: ar,
782
+ isApplicable: cr,
783
783
  serialize: (e) => e.serialize(),
784
- deserialize: (e) => ue(e)
784
+ deserialize: (e) => ce(e)
785
785
  },
786
786
  "DimensionalBaseMeasure"
787
787
  );
788
788
  l.registerCustom(
789
789
  {
790
- isApplicable: ur,
790
+ isApplicable: lr,
791
791
  serialize: (e) => e.serialize(),
792
- deserialize: (e) => ce(e)
792
+ deserialize: (e) => le(e)
793
793
  },
794
794
  "DimensionalCalculatedMeasure"
795
795
  );
796
796
  l.registerCustom(
797
797
  {
798
- isApplicable: cr,
798
+ isApplicable: fr,
799
799
  serialize: (e) => e.serialize(),
800
- deserialize: (e) => _e(e)
800
+ deserialize: (e) => We(e)
801
801
  },
802
802
  "DimensionalMeasureTemplate"
803
803
  );
804
804
  l.registerCustom(
805
805
  {
806
- isApplicable: se,
806
+ isApplicable: ne,
807
807
  serialize: (e) => e.serialize(),
808
- deserialize: (e) => F(e)
808
+ deserialize: (e) => b(e)
809
809
  },
810
810
  "MembersFilter"
811
811
  );
812
812
  l.registerCustom(
813
813
  {
814
- isApplicable: lr,
814
+ isApplicable: dr,
815
815
  serialize: (e) => e.serialize(),
816
- deserialize: (e) => F(e)
816
+ deserialize: (e) => b(e)
817
817
  },
818
818
  "LogicalAttributeFilter"
819
819
  );
820
820
  l.registerCustom(
821
821
  {
822
- isApplicable: fr,
822
+ isApplicable: mr,
823
823
  serialize: (e) => e.serialize(),
824
- deserialize: (e) => F(e)
824
+ deserialize: (e) => b(e)
825
825
  },
826
826
  "CascadingFilter"
827
827
  );
828
828
  l.registerCustom(
829
829
  {
830
- isApplicable: dr,
830
+ isApplicable: pr,
831
831
  serialize: (e) => e.serialize(),
832
- deserialize: (e) => F(e)
832
+ deserialize: (e) => b(e)
833
833
  },
834
834
  "ExcludeFilter"
835
835
  );
836
836
  l.registerCustom(
837
837
  {
838
- isApplicable: mr,
838
+ isApplicable: yr,
839
839
  serialize: (e) => e.serialize(),
840
- deserialize: (e) => F(e)
840
+ deserialize: (e) => b(e)
841
841
  },
842
842
  "MeasureFilter"
843
843
  );
844
844
  l.registerCustom(
845
845
  {
846
- isApplicable: pr,
846
+ isApplicable: gr,
847
847
  serialize: (e) => e.serialize(),
848
- deserialize: (e) => F(e)
848
+ deserialize: (e) => b(e)
849
849
  },
850
850
  "RankingFilter"
851
851
  );
852
852
  l.registerCustom(
853
853
  {
854
- isApplicable: yr,
854
+ isApplicable: hr,
855
855
  serialize: (e) => e.serialize(),
856
- deserialize: (e) => F(e)
856
+ deserialize: (e) => b(e)
857
857
  },
858
858
  "MeasureRankingFilter"
859
859
  );
860
860
  l.registerCustom(
861
861
  {
862
- isApplicable: gr,
862
+ isApplicable: br,
863
863
  serialize: (e) => e.serialize(),
864
- deserialize: (e) => F(e)
864
+ deserialize: (e) => b(e)
865
865
  },
866
866
  "NumericFilter"
867
867
  );
868
868
  l.registerCustom(
869
869
  {
870
- isApplicable: hr,
870
+ isApplicable: Fr,
871
871
  serialize: (e) => e.serialize(),
872
- deserialize: (e) => F(e)
872
+ deserialize: (e) => b(e)
873
873
  },
874
874
  "TextFilter"
875
875
  );
876
876
  l.registerCustom(
877
877
  {
878
- isApplicable: br,
878
+ isApplicable: wr,
879
879
  serialize: (e) => e.serialize(),
880
- deserialize: (e) => F(e)
880
+ deserialize: (e) => b(e)
881
881
  },
882
882
  "DateRangeFilter"
883
883
  );
884
884
  l.registerCustom(
885
885
  {
886
- isApplicable: Fr,
886
+ isApplicable: qr,
887
887
  serialize: (e) => e.serialize(),
888
- deserialize: (e) => F(e)
888
+ deserialize: (e) => b(e)
889
889
  },
890
890
  "RelativeDateFilter"
891
891
  );
892
892
  l.registerCustom(
893
893
  {
894
- isApplicable: wr,
894
+ isApplicable: Er,
895
895
  serialize: (e) => e.serialize(),
896
- deserialize: (e) => F(e)
896
+ deserialize: (e) => b(e)
897
897
  },
898
898
  "CustomFilter"
899
899
  );
900
- const zs = l, w = "DM.";
900
+ const Ps = l, F = "DM.";
901
901
  function E(e) {
902
902
  return typeof e == "object" && e !== null && "function" in e && "args" in e;
903
903
  }
904
- function Ue(e) {
904
+ function je(e) {
905
905
  return e.every(E);
906
906
  }
907
- function J(e) {
907
+ function K(e) {
908
908
  return "attribute" in e && "config" in e;
909
909
  }
910
- function _(e) {
910
+ function U(e) {
911
911
  return "left" in e && "right" in e && "operator" in e;
912
912
  }
913
- function le(e) {
914
- return !J(e) && !_(e);
913
+ function fe(e) {
914
+ return !K(e) && !U(e);
915
915
  }
916
- function Rt(e) {
916
+ function It(e) {
917
917
  return typeof e == "object" && e !== null && "column" in e && typeof e.column == "string" && !("function" in e && "args" in e);
918
918
  }
919
- function Ot(e) {
919
+ function zt(e) {
920
920
  const r = e;
921
921
  return typeof e != "object" || e === null || r === null || !("column" in r) ? !1 : E(r.column);
922
922
  }
923
- function It(e) {
923
+ function Bt(e) {
924
924
  const r = [...e].sort((o, i) => i.name.length - o.name.length), t = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
925
925
  for (const o of e) {
926
926
  t.set(o.name, o);
@@ -938,57 +938,57 @@ function It(e) {
938
938
  columnMap: s
939
939
  };
940
940
  }
941
- function We(e, r) {
942
- if (!e.startsWith(w))
941
+ function Je(e, r) {
942
+ if (!e.startsWith(F))
943
943
  throw new Error(
944
- `Invalid dimensional element name format: "${e}". Expected format: "${w}TableName.ColumnName[.Level]"`
944
+ `Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
945
945
  );
946
- const t = e.slice(w.length);
946
+ const t = e.slice(F.length);
947
947
  if (!t)
948
948
  throw new Error(
949
- `Invalid dimensional element name format: "${e}". Expected format: "${w}TableName.ColumnName[.Level]"`
949
+ `Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
950
950
  );
951
951
  let s, n;
952
- for (const d of r.sortedTables)
953
- if (t.startsWith(d.name + ".")) {
954
- const y = t.slice(d.name.length + 1);
952
+ for (const m of r.sortedTables)
953
+ if (t.startsWith(m.name + ".")) {
954
+ const y = t.slice(m.name.length + 1);
955
955
  if (!y)
956
956
  throw new Error(
957
- `Invalid dimensional element name format: "${e}". Expected format: "${w}TableName.ColumnName[.Level]"`
957
+ `Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
958
958
  );
959
- s = d, n = y;
959
+ s = m, n = y;
960
960
  break;
961
961
  }
962
962
  if (!s) {
963
- const d = t.indexOf(".");
964
- if (d === -1)
963
+ const m = t.indexOf(".");
964
+ if (m === -1)
965
965
  throw new Error(
966
- `Invalid dimensional element name format: "${e}". Expected format: "${w}TableName.ColumnName[.Level]"`
966
+ `Invalid dimensional element name format: "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
967
967
  );
968
- const y = t.slice(0, d);
968
+ const y = t.slice(0, m);
969
969
  throw new Error(`Table "${y}" not found in the data model`);
970
970
  }
971
971
  const o = r.tableColumnMap.get(s.name);
972
972
  if (!o)
973
973
  throw new Error(`Table "${s.name}" found but has no columns`);
974
974
  let i, a;
975
- const u = U.all;
976
- for (const d of o) {
977
- if (n === d.name)
978
- return { table: s, column: d };
979
- if (!n.startsWith(d.name + "."))
975
+ const u = W.all;
976
+ for (const m of o) {
977
+ if (n === m.name)
978
+ return { table: s, column: m };
979
+ if (!n.startsWith(m.name + "."))
980
980
  continue;
981
- const y = n.slice(d.name.length + 1);
981
+ const y = n.slice(m.name.length + 1);
982
982
  if (!y)
983
983
  continue;
984
- const g = u.includes(y), f = ie(d.dataType);
985
- if (g) {
984
+ const x = u.includes(y), f = oe(m.dataType);
985
+ if (x) {
986
986
  if (f)
987
- return { table: s, column: d, level: y };
988
- i || (i = d, a = y);
987
+ return { table: s, column: m, level: y };
988
+ i || (i = m, a = y);
989
989
  continue;
990
990
  }
991
- f && !i && (i = d, a = y);
991
+ f && !i && (i = m, a = y);
992
992
  }
993
993
  if (i && a)
994
994
  throw u.includes(a) ? new Error(
@@ -998,29 +998,29 @@ function We(e, r) {
998
998
  ", "
999
999
  )}`
1000
1000
  );
1001
- const c = n.indexOf("."), m = c === -1 ? n : n.slice(0, c);
1002
- throw new Error(`Column "${m}" not found in table "${s.name}"`);
1001
+ const c = n.indexOf("."), p = c === -1 ? n : n.slice(0, c);
1002
+ throw new Error(`Column "${p}" not found in table "${s.name}"`);
1003
1003
  }
1004
- function zt(e, r) {
1005
- const { table: t, column: s, level: n } = We(e, r);
1004
+ function Pt(e, r) {
1005
+ const { table: t, column: s, level: n } = Je(e, r);
1006
1006
  if (n) {
1007
- if (!ie(s.dataType))
1007
+ if (!oe(s.dataType))
1008
1008
  throw new Error(
1009
1009
  `Invalid date level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is not a datetime column`
1010
1010
  );
1011
- const o = U.all;
1011
+ const o = W.all;
1012
1012
  if (!o.includes(n))
1013
1013
  throw new Error(
1014
1014
  `Invalid date level "${n}" in dimensional element "${e}". Valid levels are: ${o.join(
1015
1015
  ", "
1016
1016
  )}`
1017
1017
  );
1018
- const i = U.dateOnly;
1018
+ const i = W.dateOnly;
1019
1019
  if (s.dataType === "date" && !i.includes(n))
1020
1020
  throw new Error(
1021
1021
  `Invalid level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is only a date column, not a datetime column`
1022
1022
  );
1023
- const a = U.timeOnly;
1023
+ const a = W.timeOnly;
1024
1024
  if (s.dataType === "time" && !a.includes(n))
1025
1025
  throw new Error(
1026
1026
  `Invalid level "${n}" in dimensional element "${e}". Column "${t.name}.${s.name}" is only a time column, not a date column`
@@ -1028,24 +1028,24 @@ function zt(e, r) {
1028
1028
  }
1029
1029
  return { column: s, level: n };
1030
1030
  }
1031
- function je(e) {
1032
- return e.type === O.TextAttribute;
1031
+ function Ke(e) {
1032
+ return e.type === I.TextAttribute;
1033
1033
  }
1034
- function Je(e) {
1035
- return e.type === O.NumericAttribute;
1034
+ function Ge(e) {
1035
+ return e.type === I.NumericAttribute;
1036
1036
  }
1037
- function Pt(e) {
1038
- return e.type === O.DateLevel;
1037
+ function kt(e) {
1038
+ return e.type === I.DateLevel;
1039
1039
  }
1040
- function Bt(e) {
1041
- return je(e) || Je(e);
1040
+ function Lt(e) {
1041
+ return Ke(e) || Ge(e);
1042
1042
  }
1043
1043
  function G(e) {
1044
- return e.type === O.TextAttribute ? "text" : e.type === O.NumericAttribute ? "numeric" : e.type === O.DateLevel ? "date/datetime" : "unknown";
1044
+ return e.type === I.TextAttribute ? "text" : e.type === I.NumericAttribute ? "numeric" : e.type === I.DateLevel ? "date/datetime" : "unknown";
1045
1045
  }
1046
- function K(e, r, t) {
1047
- const { column: s, level: n } = zt(e, t);
1048
- return kr({
1046
+ function Q(e, r, t) {
1047
+ const { column: s, level: n } = Pt(e, t);
1048
+ return Vr({
1049
1049
  expression: s.expression,
1050
1050
  dataType: s.dataType,
1051
1051
  granularity: n,
@@ -1054,44 +1054,44 @@ function K(e, r, t) {
1054
1054
  dataSource: r
1055
1055
  });
1056
1056
  }
1057
- function kt(e, r, t) {
1058
- const { column: s, level: n } = We(e, t);
1057
+ function Vt(e, r, t) {
1058
+ const { column: s, level: n } = Je(e, t);
1059
1059
  if (n)
1060
1060
  throw new Error(
1061
- `Invalid DateDimension name format: "${e}". Expected format: "${w}TableName.ColumnName"`
1061
+ `Invalid DateDimension name format: "${e}". Expected format: "${F}TableName.ColumnName"`
1062
1062
  );
1063
- if (!ie(s.dataType))
1063
+ if (!oe(s.dataType))
1064
1064
  throw new Error(
1065
1065
  `Invalid DateDimension name "${e}". Column "${s.name}" is not a datetime column (got ${s.dataType}).`
1066
1066
  );
1067
- return et({
1067
+ return tt({
1068
1068
  name: s.name,
1069
1069
  expression: s.expression,
1070
1070
  dataSource: r
1071
1071
  });
1072
1072
  }
1073
- function x(e, r) {
1073
+ function M(e, r) {
1074
1074
  const t = e();
1075
1075
  return t.success ? t.data : (r.push(...t.errors), null);
1076
1076
  }
1077
- const Lt = (e, r, t) => {
1077
+ const _t = (e, r, t) => {
1078
1078
  if (!r)
1079
1079
  return { attribute: e };
1080
1080
  const s = typeof r == "object" ? r.direction : r;
1081
- return Ee(s) ? { attribute: e.sort(Ce(s)) } : {
1081
+ return $e(s) ? { attribute: e.sort(Ae(s)) } : {
1082
1082
  attribute: e,
1083
- error: b(p({}, t), {
1083
+ error: h(g({}, t), {
1084
1084
  message: `Invalid sort type. Expected "sortAsc", "sortDesc", or "sortNone". Got: "${s}".`
1085
1085
  })
1086
1086
  };
1087
- }, Vt = (e, r, t, s) => {
1088
- const n = K(e.column, r, t);
1089
- return Lt(n, e.sortType, s);
1090
- }, _t = (e, r, t, s) => typeof e == "string" ? { attribute: K(e, r, t) } : Rt(e) ? Vt(e, r, t, s) : {
1091
- error: b(p({}, s), {
1087
+ }, Ut = (e, r, t, s) => {
1088
+ const n = Q(e.column, r, t);
1089
+ return _t(n, e.sortType, s);
1090
+ }, Wt = (e, r, t, s) => typeof e == "string" ? { attribute: Q(e, r, t) } : It(e) ? Ut(e, r, t, s) : {
1091
+ error: h(g({}, s), {
1092
1092
  message: 'Invalid dimension item. Expected a string (composeCode) or object with "column" and optional "sortType".'
1093
1093
  })
1094
- }, Ut = (e) => {
1094
+ }, jt = (e) => {
1095
1095
  const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
1096
1096
  if (!r)
1097
1097
  return { success: !0, data: [] };
@@ -1115,55 +1115,55 @@ const Lt = (e, r, t) => {
1115
1115
  input: i
1116
1116
  };
1117
1117
  try {
1118
- const c = _t(i, t, s, u);
1118
+ const c = Wt(i, t, s, u);
1119
1119
  if (c.error) {
1120
1120
  o.push(c.error);
1121
1121
  return;
1122
1122
  }
1123
1123
  c.attribute && n.push(c.attribute);
1124
1124
  } catch (c) {
1125
- const m = c instanceof Error ? c.message : "Unknown error";
1126
- o.push(b(p({}, u), { message: m }));
1125
+ const p = c instanceof Error ? c.message : "Unknown error";
1126
+ o.push(h(g({}, u), { message: p }));
1127
1127
  }
1128
1128
  }), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
1129
1129
  };
1130
- function fe(e, r) {
1130
+ function de(e, r) {
1131
1131
  const t = Reflect.get(e, r);
1132
1132
  if (typeof t != "function")
1133
1133
  throw new Error(`Function "${r}" not found or is not a function`);
1134
1134
  return t;
1135
1135
  }
1136
- function Wt(e, r) {
1137
- const t = e.replace("measureFactory.", ""), n = fe(Lr, t)(...r);
1138
- if (!le(n))
1136
+ function Jt(e, r) {
1137
+ const t = e.replace("measureFactory.", ""), n = de(_r, t)(...r);
1138
+ if (!fe(n))
1139
1139
  throw new Error(`Function "${e}" did not return a valid Measure`);
1140
1140
  return n;
1141
1141
  }
1142
- function jt(e, r) {
1143
- const t = e.replace("filterFactory.logic.", ""), n = fe(Vr, t)(...r);
1144
- if (!_(n))
1142
+ function Kt(e, r) {
1143
+ const t = e.replace("filterFactory.logic.", ""), n = de(Ur, t)(...r);
1144
+ if (!U(n))
1145
1145
  throw new Error(`Function "${e}" did not return a valid FilterRelations`);
1146
1146
  return n;
1147
1147
  }
1148
- function Jt(e, r) {
1148
+ function Gt(e, r) {
1149
1149
  if (e.startsWith("filterFactory.logic."))
1150
- return jt(e, r);
1151
- const t = e.replace("filterFactory.", ""), n = fe(_r, t)(...r);
1152
- if (!J(n) && !_(n))
1150
+ return Kt(e, r);
1151
+ const t = e.replace("filterFactory.", ""), n = de(Wr, t)(...r);
1152
+ if (!K(n) && !U(n))
1153
1153
  throw new Error(`Function "${e}" did not return a valid Filter or FilterRelations`);
1154
1154
  return n;
1155
1155
  }
1156
- function Gt(e, r) {
1156
+ function Qt(e, r) {
1157
1157
  const s = e.split(".")[0];
1158
1158
  if (s === "measureFactory")
1159
- return Wt(e, r);
1160
- if (s === "filterFactory")
1161
1159
  return Jt(e, r);
1160
+ if (s === "filterFactory")
1161
+ return Gt(e, r);
1162
1162
  throw new Error(
1163
1163
  `Unsupported factory: "${s}". Supported factories: measureFactory, filterFactory`
1164
1164
  );
1165
1165
  }
1166
- const Kt = /\[([a-zA-Z_][a-zA-Z0-9_.-]*)\]/g, Ge = /* @__PURE__ */ new Set([
1166
+ const Yt = /\[(\w[\w.-]*)\]/g, Qe = /* @__PURE__ */ new Set([
1167
1167
  // Universal – Aggregative (per Sisense doc: (A) only; Statistical CONTRIBUTION, PERCENTILE, etc. are non-aggregative)
1168
1168
  "AVG",
1169
1169
  "COUNT",
@@ -1191,29 +1191,30 @@ const Kt = /\[([a-zA-Z_][a-zA-Z0-9_.-]*)\]/g, Ge = /* @__PURE__ */ new Set([
1191
1191
  "SKEWP",
1192
1192
  "SKEW",
1193
1193
  "SLOPE"
1194
- ]), Qt = new RegExp(
1195
- `\\b(${Array.from(Ge).join("|")})\\s*\\(`,
1194
+ ]), Ht = new RegExp(
1195
+ `\\b(${Array.from(Qe).join("|")})\\s*\\(`,
1196
1196
  "i"
1197
1197
  );
1198
- function Yt(e) {
1199
- return E(e) ? !0 : typeof e == "string" && e.startsWith(w) ? !1 : e && typeof e == "object" && "kind" in e ? e.kind === "measure" : !0;
1198
+ function Zt(e) {
1199
+ return E(e) ? !0 : typeof e == "string" && e.startsWith(F) ? !1 : e && typeof e == "object" && "kind" in e ? e.kind === "measure" : !0;
1200
1200
  }
1201
- function Ht(e) {
1201
+ function Xt(e) {
1202
1202
  const r = /\b(\w+)\s*\(/g, t = /* @__PURE__ */ new Set();
1203
1203
  let s;
1204
1204
  for (; (s = r.exec(e)) !== null; ) {
1205
1205
  const n = s[1];
1206
- Ge.has(n.toUpperCase()) || t.add(n);
1206
+ Qe.has(n.toUpperCase()) || t.add(n);
1207
1207
  }
1208
1208
  return Array.from(t);
1209
1209
  }
1210
- function Zt(e) {
1210
+ function vt(e) {
1211
1211
  return e.length === 1 ? `[${e[0]}]` : e.map((r) => `[${r}]`).join(", ");
1212
1212
  }
1213
- function Xt(e) {
1213
+ function es(e) {
1214
1214
  return e.length === 0 ? "" : e.length === 1 ? `${e[0]} is not an aggregative function. ` : `${e.join(", ")} are not aggregative functions. `;
1215
1215
  }
1216
- function vt(e, r, t = {}) {
1216
+ const B = (e) => e.startsWith("[") ? e : `[${e}]`, Ee = (e) => e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1) : e;
1217
+ function rs(e, r, t = {}) {
1217
1218
  const {
1218
1219
  warnUnusedContext: s = !0,
1219
1220
  errorOnUnusedContext: n = !0,
@@ -1230,68 +1231,75 @@ function vt(e, r, t = {}) {
1230
1231
  return o || (a.errors.push(`${i}args[1]: Formula cannot be empty`), a.isValid = !1), a;
1231
1232
  const u = /\b\w+\s*\[/gi, c = e.match(u);
1232
1233
  if (c) {
1233
- const g = c[0].replace(/\s*\[.*$/, "");
1234
+ const f = c[0].replace(/\s*\[.*$/, "");
1234
1235
  a.errors.push(
1235
- `${i}args[1]: Invalid syntax: '${g}' - operator cannot be used before bracket reference without parentheses`
1236
+ `${i}args[1]: Invalid syntax: '${f}' - operator cannot be used before bracket reference without parentheses`
1236
1237
  ), a.isValid = !1;
1237
1238
  }
1238
1239
  a.references = [
1239
1240
  ...new Set(
1240
- [...e.matchAll(new RegExp(Kt.source, "g"))].map((g) => g[1])
1241
+ [...e.matchAll(new RegExp(Yt.source, "g"))].map((f) => f[1])
1241
1242
  )
1242
1243
  ];
1243
- const m = Object.keys(r);
1244
+ const p = Object.keys(r);
1244
1245
  if (a.references.length === 0)
1245
1246
  return a.warnings.push(
1246
1247
  `${i}args[1]: No bracket references found in formula - ensure this is intentional`
1247
1248
  ), a;
1248
- if (m.length === 0)
1249
+ if (p.length === 0)
1249
1250
  return a.errors.push(
1250
1251
  `${i}args[2]: Context cannot be empty - custom formulas require context definitions`
1251
1252
  ), a.isValid = !1, a;
1252
- const d = a.references.filter((g) => !m.includes(g));
1253
- if (d.length > 0 && (a.isValid = !1, d.length === 1 ? a.errors.push(
1254
- `${i}args[1]: Reference [${d[0]}] not found in context. Available keys: ${m.join(", ")}`
1255
- ) : a.errors.push(
1256
- `${i}args[1]: References [${d.join(
1257
- "], ["
1258
- )}] not found in context. Available keys: ${m.join(", ")}`
1259
- )), !Qt.test(e)) {
1260
- const g = a.references.filter(
1261
- (f) => f in r && !Yt(r[f])
1253
+ const m = new Set(p.map(B)), y = a.references.filter(
1254
+ (f) => !m.has(B(f))
1255
+ );
1256
+ if (y.length > 0) {
1257
+ a.isValid = !1;
1258
+ const f = p.map((d) => `[${Ee(d)}]`).join(", ");
1259
+ y.length === 1 ? a.errors.push(
1260
+ `${i}args[1]: Reference [${y[0]}] not found in context. Available keys: ${f}`
1261
+ ) : a.errors.push(
1262
+ `${i}args[1]: References [${y.join(
1263
+ "], ["
1264
+ )}] not found in context. Available keys: ${f}`
1262
1265
  );
1263
- g.length > 0 && (a.errors.push(
1264
- `${i}args[1]: ${Xt(
1265
- Ht(e)
1266
- )}Bracket reference(s) ${Zt(
1267
- g
1266
+ }
1267
+ if (!Ht.test(e)) {
1268
+ const f = a.references.filter((d) => {
1269
+ var $;
1270
+ const w = ($ = r[B(d)]) != null ? $ : r[d];
1271
+ return w !== void 0 && !Zt(w);
1272
+ });
1273
+ f.length > 0 && (a.errors.push(
1274
+ `${i}args[1]: ${es(
1275
+ Xt(e)
1276
+ )}Bracket reference(s) ${vt(
1277
+ f
1268
1278
  )} point to raw attributes and must be wrapped in an aggregative function (e.g. SUM, AVG)`
1269
1279
  ), a.isValid = !1);
1270
1280
  }
1271
- if ((s || n) && m.length > 0) {
1272
- const g = m.filter((f) => !a.references.includes(f));
1273
- if (a.unusedContextKeys = g, g.length > 0) {
1274
- const f = `${i}args[2]: Context keys [${g.join(
1275
- ", "
1276
- )}] are defined but not used in formula`;
1277
- n ? (a.errors.push(f), a.isValid = !1) : s && a.warnings.push(f);
1281
+ if ((s || n) && p.length > 0) {
1282
+ const f = new Set(a.references.map(B)), d = p.filter((w) => !f.has(B(w)));
1283
+ if (a.unusedContextKeys = d, d.length > 0) {
1284
+ const w = d.map((D) => `[${Ee(D)}]`).join(", "), $ = `${i}args[2]: Context keys ${w} are defined but not used in formula`;
1285
+ n ? (a.errors.push($), a.isValid = !1) : s && a.warnings.push($);
1278
1286
  }
1279
1287
  }
1280
1288
  return a;
1281
1289
  }
1282
- function es(e, r, t = {}) {
1283
- const s = vt(e, r, t);
1290
+ function ts(e, r, t = {}) {
1291
+ const s = rs(e, r, t);
1284
1292
  if (!s.isValid)
1285
1293
  throw new Error(s.errors.join("; "));
1286
1294
  s.warnings.length > 0 && console.warn("Formula validation warnings:", s.warnings.join("; "));
1287
1295
  }
1288
- function rs(e, r) {
1296
+ function ss(e, r) {
1289
1297
  if (e.length < 3 || e.length > 5)
1290
1298
  throw new Error(
1291
1299
  `${r.pathPrefix}Expected 3, 4, or 5 arguments for customFormula (title, formula, context, format?, description?)`
1292
1300
  );
1293
1301
  const t = e[1], s = e[2];
1294
- es(t, s, {
1302
+ ts(t, s, {
1295
1303
  errorPrefix: `${r.pathPrefix}`,
1296
1304
  errorOnUnusedContext: !0,
1297
1305
  // Strict validation: all context keys must be used
@@ -1310,9 +1318,9 @@ function rs(e, r) {
1310
1318
  pathPrefix: a
1311
1319
  }
1312
1320
  });
1313
- else if (typeof i == "string" && i.startsWith(w))
1321
+ else if (typeof i == "string" && i.startsWith(F))
1314
1322
  try {
1315
- n[`${o}`] = K(
1323
+ n[`${o}`] = Q(
1316
1324
  i,
1317
1325
  r.dataSource,
1318
1326
  r.schemaIndex
@@ -1325,85 +1333,85 @@ function rs(e, r) {
1325
1333
  n[`${o}`] = i;
1326
1334
  else
1327
1335
  throw new Error(
1328
- `${a}: Invalid context value for key '${o}'. Expected a function call or attribute reference (${w}...), but got: ${typeof i}`
1336
+ `${a}: Invalid context value for key '${o}'. Expected a function call or attribute reference (${F}...), but got: ${typeof i}`
1329
1337
  );
1330
1338
  }
1331
1339
  e[2] = n;
1332
1340
  }
1333
- function de(e, r) {
1341
+ function me(e, r) {
1334
1342
  const t = e[0];
1335
1343
  if (!t || typeof t != "object" || !("type" in t))
1336
1344
  throw new Error(`${r.pathPrefix}args[0]: Expected attribute as first argument`);
1337
1345
  return t;
1338
1346
  }
1339
- function qe(e, r) {
1340
- const t = de(e, r);
1341
- if (!Bt(t))
1347
+ function Ce(e, r) {
1348
+ const t = me(e, r);
1349
+ if (!Lt(t))
1342
1350
  throw new Error(
1343
1351
  `${r.pathPrefix}args[0]: Attribute must be string or numeric type, got ${G(
1344
1352
  t
1345
1353
  )} attribute`
1346
1354
  );
1347
1355
  }
1348
- function M(e, r) {
1349
- const t = de(e, r);
1350
- if (!Je(t))
1356
+ function T(e, r) {
1357
+ const t = me(e, r);
1358
+ if (!Ge(t))
1351
1359
  throw new Error(
1352
1360
  `${r.pathPrefix}args[0]: Attribute must be numeric type, got ${G(
1353
1361
  t
1354
1362
  )} attribute`
1355
1363
  );
1356
1364
  }
1357
- function S(e, r) {
1358
- const t = de(e, r);
1359
- if (!je(t))
1365
+ function N(e, r) {
1366
+ const t = me(e, r);
1367
+ if (!Ke(t))
1360
1368
  throw new Error(
1361
1369
  `${r.pathPrefix}args[0]: Attribute must be string type, got ${G(
1362
1370
  t
1363
1371
  )} attribute`
1364
1372
  );
1365
1373
  }
1366
- function ts(e, r) {
1374
+ function ns(e, r) {
1367
1375
  const t = e[0];
1368
1376
  if (!t || typeof t != "object" || !("attribute" in t))
1369
1377
  throw new Error(`${r.pathPrefix}args[0]: Expected filter as first argument`);
1370
1378
  return t;
1371
1379
  }
1372
- function ss(e, r) {
1373
- const t = ts(e, r);
1374
- if (!se(t))
1380
+ function is(e, r) {
1381
+ const t = ns(e, r);
1382
+ if (!ne(t))
1375
1383
  throw new Error(
1376
1384
  `${r.pathPrefix}args[0]: exclude filter only accepts members filter, got ${t.__serializable || "unknown"} filter`
1377
1385
  );
1378
1386
  }
1379
- const ns = {
1380
- "measureFactory.customFormula": rs,
1387
+ const os = {
1388
+ "measureFactory.customFormula": ss,
1381
1389
  // String | Number filters
1382
- "filterFactory.equals": qe,
1383
- "filterFactory.doesntEqual": qe,
1390
+ "filterFactory.equals": Ce,
1391
+ "filterFactory.doesntEqual": Ce,
1384
1392
  // Numeric filters
1385
- "filterFactory.greaterThan": M,
1386
- "filterFactory.greaterThanOrEqual": M,
1387
- "filterFactory.lessThan": M,
1388
- "filterFactory.lessThanOrEqual": M,
1389
- "filterFactory.between": M,
1390
- "filterFactory.betweenNotEqual": M,
1391
- "filterFactory.numeric": M,
1393
+ "filterFactory.greaterThan": T,
1394
+ "filterFactory.greaterThanOrEqual": T,
1395
+ "filterFactory.lessThan": T,
1396
+ "filterFactory.lessThanOrEqual": T,
1397
+ "filterFactory.between": T,
1398
+ "filterFactory.betweenNotEqual": T,
1399
+ "filterFactory.numeric": T,
1392
1400
  // String filters
1393
- "filterFactory.contains": S,
1394
- "filterFactory.doesntContain": S,
1395
- "filterFactory.startsWith": S,
1396
- "filterFactory.doesntStartWith": S,
1397
- "filterFactory.endsWith": S,
1398
- "filterFactory.doesntEndWith": S,
1399
- "filterFactory.like": S,
1401
+ "filterFactory.contains": N,
1402
+ "filterFactory.doesntContain": N,
1403
+ "filterFactory.startsWith": N,
1404
+ "filterFactory.doesntStartWith": N,
1405
+ "filterFactory.endsWith": N,
1406
+ "filterFactory.doesntEndWith": N,
1407
+ "filterFactory.like": N,
1400
1408
  // Exclude filter
1401
- "filterFactory.exclude": ss
1409
+ "filterFactory.exclude": is
1402
1410
  };
1403
- function is(e) {
1404
- return ns[`${e}`];
1411
+ function as(e) {
1412
+ return os[`${e}`];
1405
1413
  }
1406
- const os = {
1414
+ const us = {
1407
1415
  // ==================== MEASURE FACTORY FUNCTIONS ====================
1408
1416
  // Basic aggregations
1409
1417
  "measureFactory.sum": [
@@ -1930,18 +1938,18 @@ const os = {
1930
1938
  { type: "FilterRelationsNode", required: !0 }
1931
1939
  ]
1932
1940
  };
1933
- function me(e) {
1934
- return os[`${e}`];
1941
+ function pe(e) {
1942
+ return us[`${e}`];
1935
1943
  }
1936
- function as(e) {
1937
- const r = me(e);
1944
+ function cs(e) {
1945
+ const r = pe(e);
1938
1946
  return r ? r.filter((t) => t.required).length : 0;
1939
1947
  }
1940
- function us(e) {
1941
- const r = me(e);
1948
+ function ls(e) {
1949
+ const r = pe(e);
1942
1950
  return r ? r.length : 0;
1943
1951
  }
1944
- function cs(e) {
1952
+ function fs(e) {
1945
1953
  if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}/.test(e))
1946
1954
  return !1;
1947
1955
  const t = Date.parse(e);
@@ -1950,293 +1958,294 @@ function cs(e) {
1950
1958
  const s = new Date(e);
1951
1959
  return !isNaN(s.getTime());
1952
1960
  }
1953
- function H(e, r, t, s) {
1954
- if (e.startsWith(w))
1961
+ function Z(e, r, t, s) {
1962
+ if (e.startsWith(F))
1955
1963
  try {
1956
- return K(e, r, t);
1964
+ return Q(e, r, t);
1957
1965
  } catch (n) {
1958
1966
  const o = n instanceof Error ? n.message : "Unknown error";
1959
1967
  throw new Error(`${s}: ${o}`);
1960
1968
  }
1961
1969
  throw new Error(
1962
- `${s}: Invalid attribute "${e}". Expected format: "${w}TableName.ColumnName[.Level]"`
1970
+ `${s}: Invalid attribute "${e}". Expected format: "${F}TableName.ColumnName[.Level]"`
1963
1971
  );
1964
1972
  }
1965
- function ls(e, r, t, s) {
1966
- if (e.startsWith(w))
1973
+ function ds(e, r, t, s) {
1974
+ if (e.startsWith(F))
1967
1975
  try {
1968
- return kt(e, r, t);
1976
+ return Vt(e, r, t);
1969
1977
  } catch (n) {
1970
1978
  const o = n instanceof Error ? n.message : "Unknown error";
1971
1979
  throw new Error(`${s}: ${o}`);
1972
1980
  }
1973
1981
  throw new Error(
1974
- `${s}: Invalid date dimension string "${e}". Expected format: "${w}TableName.ColumnName"`
1982
+ `${s}: Invalid date dimension string "${e}". Expected format: "${F}TableName.ColumnName"`
1975
1983
  );
1976
1984
  }
1977
- function fs(e) {
1985
+ function ms(e) {
1978
1986
  const r = e.data, { argSchema: t, dataSource: s, schemaIndex: n, pathPrefix: o } = e.context, i = o;
1979
1987
  if (r === void 0) {
1980
1988
  if (t.required)
1981
1989
  throw new Error(`${i}: Required argument is missing (expected ${t.type})`);
1982
1990
  return;
1983
1991
  }
1984
- switch (t.type) {
1985
- case "string":
1986
- if (typeof r != "string")
1987
- throw new Error(`${i}: Expected string, got ${typeof r}`);
1988
- return r;
1989
- case "number":
1990
- if (typeof r != "number")
1991
- throw new Error(`${i}: Expected number, got ${typeof r}`);
1992
- return r;
1993
- case "boolean":
1994
- if (typeof r != "boolean")
1995
- throw new Error(`${i}: Expected boolean, got ${typeof r}`);
1996
- return r;
1997
- case "string[]":
1998
- if (!Array.isArray(r))
1999
- throw new Error(
2000
- `${i}: Expected array of strings, got ${typeof r}. Example: ["value1", "value2"]`
2001
- );
2002
- if (!r.every((a) => typeof a == "string"))
2003
- throw new Error(
2004
- `${i}: Expected array of strings, but contains non-string values`
2005
- );
2006
- return r;
2007
- case "number[]":
2008
- if (!Array.isArray(r))
2009
- throw new Error(
2010
- `${i}: Expected array of numbers, got ${typeof r}. Example: [10, 20]`
2011
- );
2012
- if (!r.every((a) => typeof a == "number"))
2013
- throw new Error(
2014
- `${i}: Expected array of numbers, but contains non-number values`
2015
- );
2016
- return r;
2017
- case "Attribute":
2018
- if (typeof r != "string")
2019
- throw new Error(
2020
- `${i}: Expected attribute string, got ${typeof r}. Example: "DM.Commerce.Revenue"`
2021
- );
2022
- return H(r, s, n, i);
2023
- case "Attribute[]":
2024
- if (!Array.isArray(r))
2025
- throw new Error(
2026
- `${i}: Expected array of attributes, got ${typeof r}. Example: ["DM.Commerce.AgeRange"]`
2027
- );
2028
- return r.map((a, u) => {
2029
- if (typeof a != "string")
2030
- throw new Error(`${i}[${u}]: Expected attribute string, got ${typeof a}`);
2031
- return H(a, s, n, `${i}[${u}]`);
2032
- });
2033
- case "Measure":
2034
- case "BaseMeasure":
2035
- if (!E(r))
2036
- throw new Error(
2037
- `${i}: Expected measure function call, got ${typeof r}. Example: {"function": "measureFactory.sum", "args": ["DM.Commerce.Revenue"]}`
2038
- );
2039
- return C({
2040
- data: r,
2041
- context: { dataSource: s, schemaIndex: n, pathPrefix: i }
2042
- });
2043
- case "Measure[]":
2044
- if (!Array.isArray(r))
2045
- throw new Error(
2046
- `${i}: Expected array of measure function calls, got ${typeof r}`
2047
- );
2048
- return r.map((a, u) => {
2049
- if (!E(a))
1992
+ if (!(r === null && !t.required))
1993
+ switch (t.type) {
1994
+ case "string":
1995
+ if (typeof r != "string")
1996
+ throw new Error(`${i}: Expected string, got ${typeof r}`);
1997
+ return r;
1998
+ case "number":
1999
+ if (typeof r != "number")
2000
+ throw new Error(`${i}: Expected number, got ${typeof r}`);
2001
+ return r;
2002
+ case "boolean":
2003
+ if (typeof r != "boolean")
2004
+ throw new Error(`${i}: Expected boolean, got ${typeof r}`);
2005
+ return r;
2006
+ case "string[]":
2007
+ if (!Array.isArray(r))
2050
2008
  throw new Error(
2051
- `${i}[${u}]: Expected measure function call, got ${typeof a}`
2009
+ `${i}: Expected array of strings, got ${typeof r}. Example: ["value1", "value2"]`
2052
2010
  );
2053
- return C({
2054
- data: a,
2055
- context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
2011
+ if (!r.every((a) => typeof a == "string"))
2012
+ throw new Error(
2013
+ `${i}: Expected array of strings, but contains non-string values`
2014
+ );
2015
+ return r;
2016
+ case "number[]":
2017
+ if (!Array.isArray(r))
2018
+ throw new Error(
2019
+ `${i}: Expected array of numbers, got ${typeof r}. Example: [10, 20]`
2020
+ );
2021
+ if (!r.every((a) => typeof a == "number"))
2022
+ throw new Error(
2023
+ `${i}: Expected array of numbers, but contains non-number values`
2024
+ );
2025
+ return r;
2026
+ case "Attribute":
2027
+ if (typeof r != "string")
2028
+ throw new Error(
2029
+ `${i}: Expected attribute string, got ${typeof r}. Example: "DM.Commerce.Revenue"`
2030
+ );
2031
+ return Z(r, s, n, i);
2032
+ case "Attribute[]":
2033
+ if (!Array.isArray(r))
2034
+ throw new Error(
2035
+ `${i}: Expected array of attributes, got ${typeof r}. Example: ["DM.Commerce.AgeRange"]`
2036
+ );
2037
+ return r.map((a, u) => {
2038
+ if (typeof a != "string")
2039
+ throw new Error(`${i}[${u}]: Expected attribute string, got ${typeof a}`);
2040
+ return Z(a, s, n, `${i}[${u}]`);
2056
2041
  });
2057
- });
2058
- case "Filter":
2059
- if (!E(r))
2060
- throw new Error(
2061
- `${i}: Expected filter function call, got ${typeof r}. Example: {"function": "filterFactory.contains", "args": ["DM.Brand.Brand", "Apple"]}`
2062
- );
2063
- return C({
2064
- data: r,
2065
- context: { dataSource: s, schemaIndex: n, pathPrefix: i }
2066
- });
2067
- case "Filter[]":
2068
- if (!Array.isArray(r))
2069
- throw new Error(
2070
- `${i}: Expected array of filter function calls, got ${typeof r}`
2071
- );
2072
- return r.map((a, u) => {
2073
- if (!E(a))
2042
+ case "Measure":
2043
+ case "BaseMeasure":
2044
+ if (!E(r))
2074
2045
  throw new Error(
2075
- `${i}[${u}]: Expected filter function call, got ${typeof a}`
2046
+ `${i}: Expected measure function call, got ${typeof r}. Example: {"function": "measureFactory.sum", "args": ["DM.Commerce.Revenue"]}`
2076
2047
  );
2077
2048
  return C({
2078
- data: a,
2079
- context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
2049
+ data: r,
2050
+ context: { dataSource: s, schemaIndex: n, pathPrefix: i }
2080
2051
  });
2081
- });
2082
- case "FilterRelationsNode":
2083
- if (Array.isArray(r))
2052
+ case "Measure[]":
2053
+ if (!Array.isArray(r))
2054
+ throw new Error(
2055
+ `${i}: Expected array of measure function calls, got ${typeof r}`
2056
+ );
2084
2057
  return r.map((a, u) => {
2085
2058
  if (!E(a))
2086
2059
  throw new Error(
2087
- `${i}[${u}]: Expected filter function call, got ${typeof a}`
2060
+ `${i}[${u}]: Expected measure function call, got ${typeof a}`
2088
2061
  );
2089
2062
  return C({
2090
2063
  data: a,
2091
2064
  context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
2092
2065
  });
2093
2066
  });
2094
- if (E(r))
2067
+ case "Filter":
2068
+ if (!E(r))
2069
+ throw new Error(
2070
+ `${i}: Expected filter function call, got ${typeof r}. Example: {"function": "filterFactory.contains", "args": ["DM.Brand.Brand", "Apple"]}`
2071
+ );
2095
2072
  return C({
2096
2073
  data: r,
2097
2074
  context: { dataSource: s, schemaIndex: n, pathPrefix: i }
2098
2075
  });
2099
- throw new Error(
2100
- `${i}: Expected filter function call or array of filters, got ${typeof r}`
2101
- );
2102
- case "DateDimension":
2103
- if (typeof r != "string")
2104
- throw new Error(
2105
- `${i}: Expected date dimension string, got ${typeof r}. Example: "DM.Commerce.Date"`
2106
- );
2107
- return ls(r, s, n, i);
2108
- case "LevelAttribute": {
2109
- if (typeof r != "string")
2076
+ case "Filter[]":
2077
+ if (!Array.isArray(r))
2078
+ throw new Error(
2079
+ `${i}: Expected array of filter function calls, got ${typeof r}`
2080
+ );
2081
+ return r.map((a, u) => {
2082
+ if (!E(a))
2083
+ throw new Error(
2084
+ `${i}[${u}]: Expected filter function call, got ${typeof a}`
2085
+ );
2086
+ return C({
2087
+ data: a,
2088
+ context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
2089
+ });
2090
+ });
2091
+ case "FilterRelationsNode":
2092
+ if (Array.isArray(r))
2093
+ return r.map((a, u) => {
2094
+ if (!E(a))
2095
+ throw new Error(
2096
+ `${i}[${u}]: Expected filter function call, got ${typeof a}`
2097
+ );
2098
+ return C({
2099
+ data: a,
2100
+ context: { dataSource: s, schemaIndex: n, pathPrefix: `${i}[${u}]` }
2101
+ });
2102
+ });
2103
+ if (E(r))
2104
+ return C({
2105
+ data: r,
2106
+ context: { dataSource: s, schemaIndex: n, pathPrefix: i }
2107
+ });
2110
2108
  throw new Error(
2111
- `${i}: Expected date attribute string, got ${typeof r}. Example: "DM.Commerce.Date.Years"`
2109
+ `${i}: Expected filter function call or array of filters, got ${typeof r}`
2112
2110
  );
2113
- const a = H(
2114
- r,
2115
- s,
2116
- n,
2117
- i
2118
- );
2119
- if (!Pt(a))
2120
- throw new Error(
2121
- `${i}: Attribute must be date/datetime type, got ${G(
2122
- a
2123
- )} attribute`
2111
+ case "DateDimension":
2112
+ if (typeof r != "string")
2113
+ throw new Error(
2114
+ `${i}: Expected date dimension string, got ${typeof r}. Example: "DM.Commerce.Date"`
2115
+ );
2116
+ return ds(r, s, n, i);
2117
+ case "LevelAttribute": {
2118
+ if (typeof r != "string")
2119
+ throw new Error(
2120
+ `${i}: Expected date attribute string, got ${typeof r}. Example: "DM.Commerce.Date.Years"`
2121
+ );
2122
+ const a = Z(
2123
+ r,
2124
+ s,
2125
+ n,
2126
+ i
2124
2127
  );
2125
- return a;
2126
- }
2127
- case "Measure | number":
2128
- if (typeof r == "number")
2129
- return r;
2130
- if (E(r))
2131
- return C({
2132
- data: r,
2133
- context: { dataSource: s, schemaIndex: n, pathPrefix: i }
2134
- });
2135
- throw new Error(
2136
- `${i}: Expected measure function call or number, got ${typeof r}`
2137
- );
2138
- case "Date | string":
2139
- if (typeof r == "string") {
2140
- if (cs(r))
2128
+ if (!kt(a))
2129
+ throw new Error(
2130
+ `${i}: Attribute must be date/datetime type, got ${G(
2131
+ a
2132
+ )} attribute`
2133
+ );
2134
+ return a;
2135
+ }
2136
+ case "Measure | number":
2137
+ if (typeof r == "number")
2141
2138
  return r;
2139
+ if (E(r))
2140
+ return C({
2141
+ data: r,
2142
+ context: { dataSource: s, schemaIndex: n, pathPrefix: i }
2143
+ });
2142
2144
  throw new Error(
2143
- `${i}: Expected valid ISO date string or Date object, got invalid date string "${r}"`
2145
+ `${i}: Expected measure function call or number, got ${typeof r}`
2144
2146
  );
2145
- } else {
2146
- if (r instanceof Date)
2147
+ case "Date | string":
2148
+ if (typeof r == "string") {
2149
+ if (fs(r))
2150
+ return r;
2151
+ throw new Error(
2152
+ `${i}: Expected valid ISO date string or Date object, got invalid date string "${r}"`
2153
+ );
2154
+ } else {
2155
+ if (r instanceof Date)
2156
+ return r;
2157
+ throw new Error(
2158
+ `${i}: Expected date string or Date object, got ${typeof r}`
2159
+ );
2160
+ }
2161
+ case "string | number":
2162
+ if (typeof r == "string" || typeof r == "number")
2147
2163
  return r;
2148
- throw new Error(
2149
- `${i}: Expected date string or Date object, got ${typeof r}`
2150
- );
2151
- }
2152
- case "string | number":
2153
- if (typeof r == "string" || typeof r == "number")
2164
+ throw new Error(`${i}: Expected string or number, got ${typeof r}`);
2165
+ case "BaseFilterConfig":
2166
+ case "MembersFilterConfig":
2167
+ case "CustomFormulaContext":
2168
+ case "any":
2169
+ if (r == null && t.required)
2170
+ throw new Error(`${i}: Required argument is null/undefined`);
2154
2171
  return r;
2155
- throw new Error(`${i}: Expected string or number, got ${typeof r}`);
2156
- case "BaseFilterConfig":
2157
- case "MembersFilterConfig":
2158
- case "CustomFormulaContext":
2159
- case "any":
2160
- if (r == null && t.required)
2161
- throw new Error(`${i}: Required argument is null/undefined`);
2162
- return r;
2163
- default:
2164
- return r;
2165
- }
2172
+ default:
2173
+ return r;
2174
+ }
2166
2175
  }
2167
2176
  function C(e) {
2168
- const { data: r } = e, { dataSource: t, schemaIndex: s, pathPrefix: n } = e.context, { function: o, args: i } = r, a = n ? `${n}.` : "", u = me(o);
2177
+ const { data: r } = e, { dataSource: t, schemaIndex: s, pathPrefix: n } = e.context, { function: o, args: i } = r, a = n ? `${n}.` : "", u = pe(o);
2169
2178
  if (!u)
2170
2179
  throw new Error(`${a}function: Unknown function "${o}"`);
2171
- const c = as(o), m = us(o);
2180
+ const c = cs(o), p = ls(o);
2172
2181
  if (i.length < c)
2173
2182
  throw new Error(
2174
2183
  `${a}function: Expected at least ${c} arguments, got ${i.length}`
2175
2184
  );
2176
- if (i.length > m)
2185
+ if (i.length > p)
2177
2186
  throw new Error(
2178
- `${a}function: Expected at most ${m} arguments, got ${i.length}`
2187
+ `${a}function: Expected at most ${p} arguments, got ${i.length}`
2179
2188
  );
2180
- const d = [], y = [];
2189
+ const m = [], y = [];
2181
2190
  for (let f = 0; f < Math.max(i.length, u.length); f++) {
2182
- const h = u[`${f}`], A = i[`${f}`], z = a ? `${a}args[${f}]` : `args[${f}]`;
2183
- if (A === void 0) {
2184
- h != null && h.required && y.push(`${z}: Missing required argument (expected ${h.type})`);
2191
+ const d = u[`${f}`], w = i[`${f}`], $ = a ? `${a}args[${f}]` : `args[${f}]`;
2192
+ if (w === void 0) {
2193
+ d != null && d.required && y.push(`${$}: Missing required argument (expected ${d.type})`);
2185
2194
  continue;
2186
2195
  }
2187
- if (!h) {
2188
- y.push(`${z}: Unexpected argument`);
2196
+ if (!d) {
2197
+ y.push(`${$}: Unexpected argument`);
2189
2198
  continue;
2190
2199
  }
2191
2200
  try {
2192
- const N = fs({
2193
- data: A,
2201
+ const D = ms({
2202
+ data: w,
2194
2203
  context: {
2195
2204
  dataSource: t,
2196
2205
  schemaIndex: s,
2197
- pathPrefix: z,
2198
- argSchema: h
2206
+ pathPrefix: $,
2207
+ argSchema: d
2199
2208
  }
2200
2209
  });
2201
- d.push(N);
2202
- } catch (N) {
2203
- const Ze = N instanceof Error ? N.message : "Unknown error";
2204
- y.push(Ze);
2210
+ m.push(D);
2211
+ } catch (D) {
2212
+ const ve = D instanceof Error ? D.message : "Unknown error";
2213
+ y.push(ve);
2205
2214
  }
2206
2215
  }
2207
2216
  if (y.length > 0) {
2208
2217
  const f = y.join("; ");
2209
2218
  throw new Error(f);
2210
2219
  }
2211
- const g = is(o);
2212
- if (g)
2220
+ const x = as(o);
2221
+ if (x)
2213
2222
  try {
2214
- g(d, {
2223
+ x(m, {
2215
2224
  dataSource: t,
2216
2225
  schemaIndex: s,
2217
2226
  pathPrefix: a
2218
2227
  });
2219
2228
  } catch (f) {
2220
- const h = f instanceof Error ? f.message : "Unknown validation error";
2221
- throw new Error(h);
2229
+ const d = f instanceof Error ? f.message : "Unknown validation error";
2230
+ throw new Error(d);
2222
2231
  }
2223
- return Gt(o, d);
2232
+ return Qt(o, m);
2224
2233
  }
2225
- function Ke(e) {
2234
+ function Ye(e) {
2226
2235
  const { attribute: r, config: t } = e;
2227
- if (se(e) && Ur(r)) {
2228
- const { granularity: s } = r, n = e.members.map((a) => s === "Years" && !isNaN(Number(a)) ? `${a}-01-01T00:00:00` : a), o = Wr(t), i = Object.keys(o).length === 0 ? void 0 : o;
2229
- return jr(r, n, i);
2236
+ if (ne(e) && jr(r)) {
2237
+ const { granularity: s } = r, n = e.members.map((a) => s === "Years" && !isNaN(Number(a)) ? `${a}-01-01T00:00:00` : a), o = Jr(t), i = Object.keys(o).length === 0 ? void 0 : o;
2238
+ return Kr(r, n, i);
2230
2239
  }
2231
2240
  return e;
2232
2241
  }
2233
- function ds(e) {
2242
+ function ps(e) {
2234
2243
  let r = [];
2235
2244
  for (const t of e)
2236
- _(t) ? r = ge(t, r) : r = ge([Ke(t)], r);
2245
+ U(t) ? r = he(t, r) : r = he([Ye(t)], r);
2237
2246
  return r != null ? r : [];
2238
2247
  }
2239
- const ms = (e) => {
2248
+ const ys = (e) => {
2240
2249
  const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context, n = [], o = [];
2241
2250
  return r.forEach((i, a) => {
2242
2251
  const u = {
@@ -2249,15 +2258,15 @@ const ms = (e) => {
2249
2258
  data: i,
2250
2259
  context: { dataSource: t, schemaIndex: s, pathPrefix: "" }
2251
2260
  });
2252
- !_(c) && !J(c) ? o.push(b(p({}, u), { message: "Invalid filter JSON" })) : n.push(c);
2261
+ !U(c) && !K(c) ? o.push(h(g({}, u), { message: "Invalid filter JSON" })) : n.push(c);
2253
2262
  } catch (c) {
2254
- const m = c instanceof Error ? c.message : "Unknown error";
2255
- o.push(b(p({}, u), { message: m }));
2263
+ const p = c instanceof Error ? c.message : "Unknown error";
2264
+ o.push(h(g({}, u), { message: p }));
2256
2265
  }
2257
- }), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: ds(n) };
2258
- }, ps = (e) => {
2266
+ }), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: ps(n) };
2267
+ }, gs = (e) => {
2259
2268
  const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
2260
- return r ? Ue(r) ? ms({
2269
+ return r ? je(r) ? ys({
2261
2270
  data: r,
2262
2271
  context: { dataSource: t, schemaIndex: s }
2263
2272
  }) : {
@@ -2271,7 +2280,7 @@ const ms = (e) => {
2271
2280
  }
2272
2281
  ]
2273
2282
  } : { success: !0, data: [] };
2274
- }, ys = (e) => {
2283
+ }, hs = (e) => {
2275
2284
  const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context, n = [], o = [];
2276
2285
  return r.forEach((i, a) => {
2277
2286
  const u = {
@@ -2284,15 +2293,15 @@ const ms = (e) => {
2284
2293
  data: i,
2285
2294
  context: { dataSource: t, schemaIndex: s, pathPrefix: "" }
2286
2295
  });
2287
- J(c) ? n.push(Ke(c)) : o.push(b(p({}, u), { message: "Invalid filter JSON" }));
2296
+ K(c) ? n.push(Ye(c)) : o.push(h(g({}, u), { message: "Invalid filter JSON" }));
2288
2297
  } catch (c) {
2289
- const m = c instanceof Error ? c.message : "Unknown error";
2290
- o.push(b(p({}, u), { message: m }));
2298
+ const p = c instanceof Error ? c.message : "Unknown error";
2299
+ o.push(h(g({}, u), { message: p }));
2291
2300
  }
2292
2301
  }), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
2293
- }, gs = (e) => {
2302
+ }, bs = (e) => {
2294
2303
  const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
2295
- return r ? Ue(r) ? ys({
2304
+ return r ? je(r) ? hs({
2296
2305
  data: r,
2297
2306
  context: { dataSource: t, schemaIndex: s }
2298
2307
  }) : {
@@ -2306,40 +2315,40 @@ const ms = (e) => {
2306
2315
  }
2307
2316
  ]
2308
2317
  } : { success: !0, data: [] };
2309
- }, hs = (e, r, t) => {
2318
+ }, Fs = (e, r, t) => {
2310
2319
  const { dataSource: s, schemaIndex: n } = r;
2311
2320
  try {
2312
2321
  const o = C({
2313
2322
  data: e,
2314
2323
  context: { dataSource: s, schemaIndex: n, pathPrefix: "" }
2315
2324
  });
2316
- return le(o) ? { success: !0, data: o } : {
2325
+ return fe(o) ? { success: !0, data: o } : {
2317
2326
  success: !1,
2318
- errors: [b(p({}, t), { message: "Invalid measure JSON" })]
2327
+ errors: [h(g({}, t), { message: "Invalid measure JSON" })]
2319
2328
  };
2320
2329
  } catch (o) {
2321
2330
  const i = o instanceof Error ? o.message : "Unknown error";
2322
2331
  return {
2323
2332
  success: !1,
2324
- errors: [b(p({}, t), { message: i })]
2333
+ errors: [h(g({}, t), { message: i })]
2325
2334
  };
2326
2335
  }
2327
- }, bs = (e, r, t) => r ? Ee(r) ? { measure: e.sort(Ce(r)) } : {
2336
+ }, ws = (e, r, t) => r ? $e(r) ? { measure: e.sort(Ae(r)) } : {
2328
2337
  measure: e,
2329
- error: b(p({}, t), {
2338
+ error: h(g({}, t), {
2330
2339
  message: `Invalid sort type. Expected "sortAsc", "sortDesc", or "sortNone". Got: "${r}".`
2331
2340
  })
2332
- } : { measure: e }, Fs = (e, r, t, s) => {
2341
+ } : { measure: e }, qs = (e, r, t, s) => {
2333
2342
  const n = C({
2334
2343
  data: e.column,
2335
2344
  context: { dataSource: r, schemaIndex: t, pathPrefix: "" }
2336
2345
  });
2337
- return le(n) ? bs(n, e.sortType, s) : { error: b(p({}, s), { message: "Invalid measure JSON" }) };
2338
- }, ws = (e, r, t, s) => {
2339
- if (Ot(e))
2340
- return Fs(e, r, t, s);
2346
+ return fe(n) ? ws(n, e.sortType, s) : { error: h(g({}, s), { message: "Invalid measure JSON" }) };
2347
+ }, Es = (e, r, t, s) => {
2348
+ if (zt(e))
2349
+ return qs(e, r, t, s);
2341
2350
  if (E(e)) {
2342
- const n = hs(
2351
+ const n = Fs(
2343
2352
  e,
2344
2353
  { dataSource: r, schemaIndex: t },
2345
2354
  s
@@ -2347,11 +2356,11 @@ const ms = (e) => {
2347
2356
  return n.success ? { measure: n.data } : { error: n.errors[0] };
2348
2357
  }
2349
2358
  return {
2350
- error: b(p({}, s), {
2359
+ error: h(g({}, s), {
2351
2360
  message: 'Invalid measure item. Expected a function call (function/args) or object with "column" and optional "sortType".'
2352
2361
  })
2353
2362
  };
2354
- }, qs = (e) => {
2363
+ }, Cs = (e) => {
2355
2364
  const { data: r } = e, { dataSource: t, schemaIndex: s } = e.context;
2356
2365
  if (!r)
2357
2366
  return { success: !0, data: [] };
@@ -2375,40 +2384,40 @@ const ms = (e) => {
2375
2384
  input: i
2376
2385
  };
2377
2386
  try {
2378
- const c = ws(i, t, s, u);
2387
+ const c = Es(i, t, s, u);
2379
2388
  if (c.error) {
2380
2389
  o.push(c.error);
2381
2390
  return;
2382
2391
  }
2383
2392
  c.measure && n.push(c.measure);
2384
2393
  } catch (c) {
2385
- const m = c instanceof Error ? c.message : "Unknown error";
2386
- o.push(b(p({}, u), { message: m }));
2394
+ const p = c instanceof Error ? c.message : "Unknown error";
2395
+ o.push(h(g({}, u), { message: p }));
2387
2396
  }
2388
2397
  }), o.length > 0 ? { success: !1, errors: o } : { success: !0, data: n };
2389
- }, Ps = (e) => {
2390
- const { data: r } = e, { dataSource: t, tables: s } = e.context, n = It(s), o = [], i = x(
2391
- () => Ut({
2398
+ }, ks = (e) => {
2399
+ const { data: r } = e, { dataSource: t, tables: s } = e.context, n = Bt(s), o = [], i = M(
2400
+ () => jt({
2392
2401
  data: r.dimensions || [],
2393
2402
  context: { dataSource: t, schemaIndex: n }
2394
2403
  }),
2395
2404
  o
2396
- ), a = x(
2397
- () => qs({
2405
+ ), a = M(
2406
+ () => Cs({
2398
2407
  data: r.measures || [],
2399
2408
  context: { dataSource: t, schemaIndex: n }
2400
2409
  }),
2401
2410
  o
2402
- ), u = x(
2403
- () => ps({
2411
+ ), u = M(
2412
+ () => gs({
2404
2413
  data: r.filters || [],
2405
2414
  context: { dataSource: t, schemaIndex: n }
2406
2415
  }),
2407
2416
  o
2408
2417
  );
2409
2418
  let c = null;
2410
- return r.highlights && (c = x(
2411
- () => gs({
2419
+ return r.highlights && (c = M(
2420
+ () => bs({
2412
2421
  data: r.highlights || [],
2413
2422
  context: { dataSource: t, schemaIndex: n }
2414
2423
  }),
@@ -2418,15 +2427,15 @@ const ms = (e) => {
2418
2427
  errors: o
2419
2428
  } : {
2420
2429
  success: !0,
2421
- data: p({
2422
- dataSource: Jr(t),
2430
+ data: g({
2431
+ dataSource: Gr(t),
2423
2432
  dimensions: i || [],
2424
2433
  measures: a || [],
2425
2434
  filters: u || []
2426
2435
  }, c && { highlights: c })
2427
2436
  };
2428
2437
  };
2429
- function Es(e) {
2438
+ function $s(e) {
2430
2439
  const r = [], t = [];
2431
2440
  return e.forEach((s, n) => {
2432
2441
  const o = () => typeof s.toJSON == "function" ? s.toJSON() : s;
@@ -2439,27 +2448,27 @@ function Es(e) {
2439
2448
  });
2440
2449
  return;
2441
2450
  }
2442
- if (!s.composeCode.startsWith(w)) {
2451
+ if (!s.composeCode.startsWith(F)) {
2443
2452
  t.push({
2444
2453
  category: "dimensions",
2445
2454
  index: n,
2446
2455
  input: o(),
2447
- message: `Expected composeCode to start with "${w}" for dimension at index ${n} (${s.name || "unnamed"}). Got: "${s.composeCode}"`
2456
+ message: `Expected composeCode to start with "${F}" for dimension at index ${n} (${s.name || "unnamed"}). Got: "${s.composeCode}"`
2448
2457
  });
2449
2458
  return;
2450
2459
  }
2451
2460
  const i = s.getSort();
2452
- if (i !== void 0 && i !== ne.None) {
2461
+ if (i !== void 0 && i !== ie.None) {
2453
2462
  const a = {
2454
2463
  column: s.composeCode,
2455
- sortType: $e(i)
2464
+ sortType: xe(i)
2456
2465
  };
2457
2466
  r.push(a);
2458
2467
  } else
2459
2468
  r.push(s.composeCode);
2460
2469
  }), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
2461
2470
  }
2462
- function Qe(e, r) {
2471
+ function He(e, r) {
2463
2472
  const t = [];
2464
2473
  let s = "", n = 0, o = !1, i = null;
2465
2474
  for (let a = 0; a < e.length; a++) {
@@ -2489,7 +2498,7 @@ function Qe(e, r) {
2489
2498
  }
2490
2499
  return s.trim() && t.push(s.trim()), t;
2491
2500
  }
2492
- function Cs(e, r) {
2501
+ function As(e, r) {
2493
2502
  let t = 0, s = !1, n = null;
2494
2503
  for (let o = 0; o < e.length; o++) {
2495
2504
  const i = e[o], a = e[o + 1];
@@ -2510,10 +2519,10 @@ function Cs(e, r) {
2510
2519
  }
2511
2520
  return -1;
2512
2521
  }
2513
- function $s(e) {
2522
+ function xs(e) {
2514
2523
  return e.startsWith("'") && e.endsWith("'") || e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e;
2515
2524
  }
2516
- function V(e) {
2525
+ function _(e) {
2517
2526
  if (!e || typeof e != "string")
2518
2527
  throw new Error(`Invalid composeCode: expected non-empty string, got ${typeof e}`);
2519
2528
  const r = e.trim();
@@ -2522,16 +2531,16 @@ function V(e) {
2522
2531
  const t = r.match(/^([a-zA-Z_$][a-zA-Z0-9_.$]*)\s*\((.*)\)$/);
2523
2532
  if (!t)
2524
2533
  throw new Error(`Invalid composeCode format: expected function call, got "${r}"`);
2525
- const s = t[1], n = t[2], o = Ye(n);
2534
+ const s = t[1], n = t[2], o = Ze(n);
2526
2535
  return {
2527
2536
  function: s,
2528
2537
  args: o
2529
2538
  };
2530
2539
  }
2531
- function Ye(e) {
2532
- return e.trim() ? Qe(e, ",").map(He) : [];
2540
+ function Ze(e) {
2541
+ return e.trim() ? He(e, ",").map(Xe) : [];
2533
2542
  }
2534
- function He(e) {
2543
+ function Xe(e) {
2535
2544
  if (!e)
2536
2545
  throw new Error("Cannot parse empty argument value");
2537
2546
  if (e === "null")
@@ -2552,33 +2561,33 @@ function He(e) {
2552
2561
  const t = e.slice(1, -1).trim();
2553
2562
  if (!t)
2554
2563
  return [];
2555
- const s = Ye(t);
2564
+ const s = Ze(t);
2556
2565
  return s.every((n) => typeof n == "string"), s;
2557
2566
  }
2558
2567
  if (e.startsWith("{") && e.endsWith("}")) {
2559
2568
  const t = e.slice(1, -1).trim();
2560
- return t ? xs(t) : {};
2569
+ return t ? Ms(t) : {};
2561
2570
  }
2562
- return e.includes("(") && e.includes(")") ? V(e) : (e.startsWith("DM."), e);
2571
+ return e.includes("(") && e.includes(")") ? _(e) : (e.startsWith("DM."), e);
2563
2572
  }
2564
- function As(e) {
2565
- const r = Cs(e, ":");
2573
+ function Ds(e) {
2574
+ const r = As(e, ":");
2566
2575
  if (r === -1)
2567
2576
  throw new Error(`Invalid object property: expected "key: value", got "${e}"`);
2568
- const t = $s(e.slice(0, r).trim()), s = He(e.slice(r + 1).trim());
2577
+ const t = xs(e.slice(0, r).trim()), s = Xe(e.slice(r + 1).trim());
2569
2578
  return [t, s];
2570
2579
  }
2571
- function xs(e) {
2580
+ function Ms(e) {
2572
2581
  if (!e.trim()) return {};
2573
- const r = Qe(e, ",").map(As).filter(([, t]) => t !== null);
2582
+ const r = He(e, ",").map(Ds).filter(([, t]) => t !== null);
2574
2583
  return Object.fromEntries(r);
2575
2584
  }
2576
- const re = "Unknown error";
2577
- function Ds(e) {
2585
+ const te = "Unknown error";
2586
+ function Ss(e) {
2578
2587
  if (!e)
2579
2588
  return { success: !0, data: [] };
2580
2589
  const r = [];
2581
- if (Gr(e)) {
2590
+ if (Qr(e)) {
2582
2591
  if (!e.composeCode)
2583
2592
  return {
2584
2593
  success: !1,
@@ -2592,9 +2601,9 @@ function Ds(e) {
2592
2601
  ]
2593
2602
  };
2594
2603
  try {
2595
- return { success: !0, data: [V(e.composeCode)] };
2604
+ return { success: !0, data: [_(e.composeCode)] };
2596
2605
  } catch (s) {
2597
- const n = s instanceof Error ? s.message : re;
2606
+ const n = s instanceof Error ? s.message : te;
2598
2607
  return {
2599
2608
  success: !1,
2600
2609
  errors: [
@@ -2620,10 +2629,10 @@ function Ds(e) {
2620
2629
  return;
2621
2630
  }
2622
2631
  try {
2623
- const o = V(s.composeCode);
2632
+ const o = _(s.composeCode);
2624
2633
  t.push(o);
2625
2634
  } catch (o) {
2626
- const i = o instanceof Error ? o.message : re;
2635
+ const i = o instanceof Error ? o.message : te;
2627
2636
  r.push({
2628
2637
  category: "filters",
2629
2638
  index: n,
@@ -2633,7 +2642,7 @@ function Ds(e) {
2633
2642
  }
2634
2643
  }), r.length > 0 ? { success: !1, errors: r } : { success: !0, data: t };
2635
2644
  }
2636
- function Ms(e) {
2645
+ function Ts(e) {
2637
2646
  if (!e)
2638
2647
  return { success: !0, data: [] };
2639
2648
  const r = [], t = [];
@@ -2648,10 +2657,10 @@ function Ms(e) {
2648
2657
  return;
2649
2658
  }
2650
2659
  try {
2651
- const o = V(s.composeCode);
2660
+ const o = _(s.composeCode);
2652
2661
  r.push(o);
2653
2662
  } catch (o) {
2654
- const i = o instanceof Error ? o.message : re;
2663
+ const i = o instanceof Error ? o.message : te;
2655
2664
  t.push({
2656
2665
  category: "highlights",
2657
2666
  index: n,
@@ -2661,7 +2670,7 @@ function Ms(e) {
2661
2670
  }
2662
2671
  }), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
2663
2672
  }
2664
- function Ss(e) {
2673
+ function Ns(e) {
2665
2674
  const r = [], t = [];
2666
2675
  return e.forEach((s, n) => {
2667
2676
  const o = () => typeof s.toJSON == "function" ? s.toJSON() : s;
@@ -2675,11 +2684,11 @@ function Ss(e) {
2675
2684
  return;
2676
2685
  }
2677
2686
  try {
2678
- const i = V(s.composeCode), a = s.getSort();
2679
- if (a !== void 0 && a !== ne.None) {
2687
+ const i = _(s.composeCode), a = s.getSort();
2688
+ if (a !== void 0 && a !== ie.None) {
2680
2689
  const u = {
2681
2690
  column: i,
2682
- sortType: $e(a)
2691
+ sortType: xe(a)
2683
2692
  };
2684
2693
  r.push(u);
2685
2694
  } else
@@ -2695,32 +2704,32 @@ function Ss(e) {
2695
2704
  }
2696
2705
  }), t.length > 0 ? { success: !1, errors: t } : { success: !0, data: r };
2697
2706
  }
2698
- function te(e) {
2699
- return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(te) : e !== null && typeof e == "object" ? Object.fromEntries(
2700
- Object.entries(e).map(([r, t]) => [r, te(t)])
2707
+ function se(e) {
2708
+ return typeof e == "string" ? e.replace(/\[\[([^\]]+)\]\]/g, "$1") : Array.isArray(e) ? e.map(se) : e !== null && typeof e == "object" ? Object.fromEntries(
2709
+ Object.entries(e).map(([r, t]) => [r, se(t)])
2701
2710
  ) : e;
2702
2711
  }
2703
- function Bs(e) {
2704
- const r = [], t = x(
2705
- () => Es(e.dimensions || []),
2712
+ function Ls(e) {
2713
+ const r = [], t = M(
2714
+ () => $s(e.dimensions || []),
2706
2715
  r
2707
- ), s = x(
2708
- () => Ss(e.measures || []),
2716
+ ), s = M(
2717
+ () => Ns(e.measures || []),
2709
2718
  r
2710
- ), n = x(
2711
- () => Ds(e.filters),
2719
+ ), n = M(
2720
+ () => Ss(e.filters),
2712
2721
  r
2713
2722
  );
2714
2723
  let o = null;
2715
- if (e.highlights && e.highlights.length > 0 && (o = x(
2716
- () => Ms(e.highlights),
2724
+ if (e.highlights && e.highlights.length > 0 && (o = M(
2725
+ () => Ts(e.highlights),
2717
2726
  r
2718
2727
  )), r.length > 0)
2719
2728
  return {
2720
2729
  success: !1,
2721
2730
  errors: r
2722
2731
  };
2723
- const i = p({
2732
+ const i = g({
2724
2733
  dimensions: t || [],
2725
2734
  measures: s || [],
2726
2735
  filters: n || []
@@ -2728,11 +2737,11 @@ function Bs(e) {
2728
2737
  return {
2729
2738
  success: !0,
2730
2739
  // Strip [[delimiters]] from all strings to preserve original names with spaces
2731
- data: te(i)
2740
+ data: se(i)
2732
2741
  };
2733
2742
  }
2734
- function Ts(e) {
2735
- const { filters: r, relations: t } = Yr(
2743
+ function Rs(e) {
2744
+ const { filters: r, relations: t } = Zr(
2736
2745
  e.filters || []
2737
2746
  );
2738
2747
  return {
@@ -2745,19 +2754,19 @@ function Ts(e) {
2745
2754
  // No count/offset/ungroup - these are execution concerns, not translation concerns
2746
2755
  };
2747
2756
  }
2748
- function ks(e, r, t = !1) {
2749
- const s = Ts(e), n = Kr(s, r);
2750
- return Qr(n, t);
2757
+ function Vs(e, r, t = !1) {
2758
+ const s = Rs(e), n = Yr(s, r);
2759
+ return Hr(n, t);
2751
2760
  }
2752
2761
  export {
2753
- zs as CustomSuperJSON,
2754
- _s as EMPTY_EXPANDED_QUERY_MODEL,
2755
- Us as EMPTY_SIMPLE_QUERY_MODEL,
2756
- Ws as isByIdDashboardCodeParams,
2757
- js as isByIdWidgetCodeParams,
2758
- Js as isClientSideDashboardCodeParams,
2759
- Gs as isClientSideWidgetCodeParams,
2760
- Ps as translateQueryFromJSON,
2761
- Bs as translateQueryToJSON,
2762
- ks as translateQueryToJaql
2762
+ Ps as CustomSuperJSON,
2763
+ Ws as EMPTY_EXPANDED_QUERY_MODEL,
2764
+ js as EMPTY_SIMPLE_QUERY_MODEL,
2765
+ Js as isByIdDashboardCodeParams,
2766
+ Ks as isByIdWidgetCodeParams,
2767
+ Gs as isClientSideDashboardCodeParams,
2768
+ Qs as isClientSideWidgetCodeParams,
2769
+ ks as translateQueryFromJSON,
2770
+ Ls as translateQueryToJSON,
2771
+ Vs as translateQueryToJaql
2763
2772
  };