react-semaphor 0.1.553 → 0.1.555

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 (70) hide show
  1. package/dist/analytics-protocol/index.js +228 -227
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +3 -3
  4. package/dist/briefings/index.js +5 -5
  5. package/dist/chunks/{assistant-chat-DaIdRbbd.js → assistant-chat-8NZP6m-u.js} +12 -12
  6. package/dist/chunks/{bookmark-state-aGO7_ryE.js → bookmark-state-BAeGKd3s.js} +3 -3
  7. package/dist/chunks/{comparison-window-caption-BugAu7zS.js → comparison-window-caption-C2WNTlxK.js} +44 -44
  8. package/dist/chunks/{custom-visual-inputs-D7ez5sab.js → custom-visual-inputs-Gw-Ggg3O.js} +1 -1
  9. package/dist/chunks/{dashboard-z3GYw7xR.js → dashboard-Ds68ckO3.js} +1 -1
  10. package/dist/chunks/{dashboard-briefing-launcher-DBJ0xrfF.js → dashboard-briefing-launcher-DlTr-VGc.js} +13 -13
  11. package/dist/chunks/{dashboard-controls-CDX74NTl.js → dashboard-controls-oNXJZN6x.js} +13 -13
  12. package/dist/chunks/{dashboard-json-Cf5dpYTr.js → dashboard-json-CW7Q_efH.js} +4 -4
  13. package/dist/chunks/{document-dashboard-inputs-LMMWPOwU.js → document-dashboard-inputs-C21mL3ib.js} +10 -10
  14. package/dist/chunks/{edit-dashboard-visual-hCGiyxgm.js → edit-dashboard-visual-BnnT_oKR.js} +4087 -3979
  15. package/dist/chunks/{filter-reach-copy-BG5qVZKS.js → filter-reach-copy-DlNPHbE-.js} +13 -13
  16. package/dist/chunks/{filter-value-text-DwP5dN9m.js → filter-value-text-DMrpj4h9.js} +2 -2
  17. package/dist/chunks/{global-date-filter-utils-Ce6Ydv2W.js → global-date-filter-utils-7OboTgrM.js} +2358 -2301
  18. package/dist/chunks/{index-C_UIqop8.js → index-B2k6KtUN.js} +9 -9
  19. package/dist/chunks/{matrix-analytical-definition-cvzKdxPE.js → matrix-analytical-definition-DPVGg1mU.js} +12 -12
  20. package/dist/chunks/matrix-card-D9bsdAye.js +42 -0
  21. package/dist/chunks/{matrix-formatter-B27bz08Y.js → matrix-formatter-K2OVPJQI.js} +18 -18
  22. package/dist/chunks/{matrix-member-presentation-DyC-e9pD.js → matrix-member-presentation-DRWcJ8Mi.js} +1 -1
  23. package/dist/chunks/{matrix-operation-contract-L_SiObB7.js → matrix-operation-contract--lMaLlpV.js} +64 -61
  24. package/dist/chunks/{metric-comparison-B5gyyW9k.js → metric-comparison-CYIt2F5X.js} +1 -1
  25. package/dist/chunks/{pivot-header-presentation-BQFfowp1.js → pivot-header-presentation-CX4fkRuG.js} +1 -1
  26. package/dist/chunks/{pivot-result-identity-dZIYsMrY.js → pivot-result-identity-BHJGZwIc.js} +1 -1
  27. package/dist/chunks/{pivot-result-lifecycle-D0kSz5QX.js → pivot-result-lifecycle-BygCpOhk.js} +20 -20
  28. package/dist/chunks/{raw-temporal-presentation-BWRH754b.js → raw-temporal-presentation-CivONfcO.js} +6 -6
  29. package/dist/chunks/{report-preferences-dialog-DvabpYcC.js → report-preferences-dialog-D_KyuEFx.js} +15 -15
  30. package/dist/chunks/{report-runtime-context-CKiIubIu.js → report-runtime-context-BaIKSaja.js} +1 -1
  31. package/dist/chunks/{resolve-dashboard-input-context-Ctq1YCDV.js → resolve-dashboard-input-context-CIm9A8_j.js} +431 -429
  32. package/dist/chunks/{saved-dashboard-context-Bt1E9d1l.js → saved-dashboard-context-akb9JfOL.js} +8 -8
  33. package/dist/chunks/{selection-reducer-DdPwKDDQ.js → selection-reducer-yw_JgICP.js} +1 -1
  34. package/dist/chunks/{semaphor-ready-indicator-Cc1TG_gw.js → semaphor-ready-indicator-Ba7dwP5_.js} +26 -26
  35. package/dist/chunks/{shelf-drop-preview-context-Ch9XqytU.js → shelf-drop-preview-context-5rg3pJHW.js} +6 -6
  36. package/dist/chunks/{source-entity-resolution-DkW3Iek5.js → source-entity-resolution-CGymm5td.js} +1 -1
  37. package/dist/chunks/{switch-gm7RW-PW.js → switch-B-UTI6v-.js} +2 -2
  38. package/dist/chunks/{table-export-sheet-C7bDdC8r.js → table-export-sheet-CgO6gaSM.js} +1 -1
  39. package/dist/chunks/{table-settings-CBm7G0yx.js → table-settings-DOT_Bv1m.js} +2 -2
  40. package/dist/chunks/{temporal-bucket-BikY3FFR.js → temporal-bucket-C4rqmwaQ.js} +24 -24
  41. package/dist/chunks/{token-types-B1p9F_wS.js → token-types-DYECHYGH.js} +1 -1
  42. package/dist/chunks/{use-create-flow-overlay-state-CZdDRUpc.js → use-create-flow-overlay-state-BHNs0wl7.js} +6 -6
  43. package/dist/chunks/{validators-BdBzm_EV.js → validators-ClKLGDGZ.js} +1078 -1056
  44. package/dist/dashboard/index.js +2 -2
  45. package/dist/dashboard-authoring/index.js +21 -19
  46. package/dist/data-app-sdk/index.js +5 -5
  47. package/dist/data-app-sdk-adapters/index.js +2 -2
  48. package/dist/data-app-sdk-validation/index.js +5 -5
  49. package/dist/format-utils/index.js +15 -15
  50. package/dist/index.js +21 -21
  51. package/dist/report-runtime-context/index.js +1 -1
  52. package/dist/surfboard/index.js +2 -2
  53. package/dist/types/index.js +6 -6
  54. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +3 -2
  55. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -2
  56. package/dist/types/lib/utils/card-config-utils.d.ts +1 -1
  57. package/dist/types/lib/utils/card-definition.d.ts +2 -1
  58. package/dist/types/shared/analytics-protocol/index.d.ts +2 -2
  59. package/dist/types/shared/analytics-protocol/matrix-analytical-definition.d.ts +1 -0
  60. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +59 -21
  61. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +12 -7
  62. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +16 -9
  63. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -1
  64. package/dist/types/shared/dashboard-authoring/legacy-table-routing.d.ts +14 -16
  65. package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -1
  66. package/dist/types/shared/dashboard-authoring/matrix-card.d.ts +8 -0
  67. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
  68. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +4 -2
  69. package/package.json +1 -1
  70. package/dist/chunks/matrix-card-VFE-yDlr.js +0 -38
@@ -1,24 +1,24 @@
1
- import { M as Se, j as U, l as Be, m as Mt, o as Rt, q as Tt, v as Et, g as Le, h as W, t as Nt, c as Ve } from "./analytics-base-schemas-BKs3flFS.js";
1
+ import { M as we, j as U, l as Le, m as Rt, o as Tt, q as Et, v as Nt, g as Ve, h as ee, t as $t, c as qe } from "./analytics-base-schemas-BKs3flFS.js";
2
2
  import { z as n } from "zod";
3
- function $t(e) {
3
+ function jt(e) {
4
4
  return typeof e == "string" || typeof e == "number" && Number.isFinite(e) || typeof e == "boolean";
5
5
  }
6
- function jt(e) {
7
- return !Array.isArray(e) || e.length === 0 || e.length > Se || !e.every($t) ? {
6
+ function Ct(e) {
7
+ return !Array.isArray(e) || e.length === 0 || e.length > we || !e.every(jt) ? {
8
8
  ok: !1,
9
- error: `matchValues must be 1 to ${Se} string, number or boolean values.`
9
+ error: `matchValues must be 1 to ${we} string, number or boolean values.`
10
10
  } : { ok: !0, values: e };
11
11
  }
12
- const Ct = [
12
+ const Ot = [
13
13
  "day",
14
14
  "week",
15
15
  "month",
16
16
  "quarter",
17
17
  "year"
18
- ], Wn = ["this", "previous"], Ot = ["now", "latest_available"], Yt = [
18
+ ], ea = ["this", "previous"], Yt = ["now", "latest_available"], Pt = [
19
19
  "include_partial",
20
20
  "complete_periods"
21
- ], Jn = {
21
+ ], ta = {
22
22
  second: 31536e4,
23
23
  minute: 5256e3,
24
24
  hour: 87600,
@@ -28,23 +28,23 @@ const Ct = [
28
28
  quarter: 40,
29
29
  year: 10
30
30
  };
31
- function Pt(e) {
31
+ function Bt(e) {
32
32
  return e.anchor ?? "latest_available";
33
33
  }
34
34
  function R(e) {
35
35
  return !!e && (e.kind === void 0 || e.kind === "relative");
36
36
  }
37
- function Bt(e) {
37
+ function Lt(e) {
38
38
  return (e == null ? void 0 : e.kind) === "calendar";
39
39
  }
40
- function ea(e) {
41
- return R(e) && e.anchor === "latest_available" || Vt(e) ? null : R(e) && e.unit === "day" && e.completeness !== "complete_periods" ? { mode: "between", unit: "day", from: 1 - e.value, to: 0 } : qt(R(e) ? { ...e, anchor: "now" } : e);
40
+ function ia(e) {
41
+ return R(e) && e.anchor === "latest_available" || qt(e) ? null : R(e) && e.unit === "day" && e.completeness !== "complete_periods" ? { mode: "between", unit: "day", from: 1 - e.value, to: 0 } : Ut(R(e) ? { ...e, anchor: "now" } : e);
42
42
  }
43
- const Lt = /* @__PURE__ */ new Set(["week", "month", "quarter", "year"]);
44
- function Vt(e) {
45
- return R(e) && Lt.has(e.unit) && e.completeness !== "complete_periods";
43
+ const Vt = /* @__PURE__ */ new Set(["week", "month", "quarter", "year"]);
44
+ function qt(e) {
45
+ return R(e) && Vt.has(e.unit) && e.completeness !== "complete_periods";
46
46
  }
47
- function ta(e) {
47
+ function na(e) {
48
48
  const t = e;
49
49
  return t.mode === "between" ? t.unit === "day" && t.to === 0 && typeof t.from == "number" && t.from <= 0 ? { unit: "day", value: 1 - t.from } : null : t.mode === "last" && typeof t.n == "number" ? t.relativeTo === "latest_data" ? null : {
50
50
  unit: t.unit,
@@ -53,8 +53,8 @@ function ta(e) {
53
53
  completeness: t.complete ? "complete_periods" : "include_partial"
54
54
  } : t.mode === "this" ? t.boundary ? null : { kind: "calendar", unit: t.unit, period: "this", ...t.toDate ? { toDate: !0 } : {} } : t.mode === "previous" ? { kind: "calendar", unit: t.unit, period: "previous" } : null;
55
55
  }
56
- function qt(e, t = {}) {
57
- if (Bt(e))
56
+ function Ut(e, t = {}) {
57
+ if (Lt(e))
58
58
  return e.period === "previous" ? { mode: "previous", unit: e.unit } : {
59
59
  mode: "this",
60
60
  unit: e.unit,
@@ -62,56 +62,56 @@ function qt(e, t = {}) {
62
62
  };
63
63
  if (!R(e))
64
64
  return null;
65
- const i = Pt(e) === "latest_available" ? { relativeTo: "latest_data" } : {}, o = e.value, a = (t.completeness ?? e.completeness) === "complete_periods";
65
+ const i = Bt(e) === "latest_available" ? { relativeTo: "latest_data" } : {}, o = e.value, r = (t.completeness ?? e.completeness) === "complete_periods";
66
66
  switch (e.unit) {
67
67
  case "second":
68
68
  return null;
69
69
  case "minute":
70
70
  case "hour":
71
- return a ? null : { mode: "last", n: o, unit: e.unit, ...i };
71
+ return r ? null : { mode: "last", n: o, unit: e.unit, ...i };
72
72
  default:
73
73
  return {
74
74
  mode: "last",
75
75
  n: o,
76
76
  unit: e.unit,
77
- ...a ? { complete: !0 } : {},
77
+ ...r ? { complete: !0 } : {},
78
78
  ...i
79
79
  };
80
80
  }
81
81
  }
82
- function r(e, t, i) {
82
+ function s(e, t, i) {
83
83
  return i ? { code: e, message: t, path: i } : { code: e, message: t };
84
84
  }
85
85
  function m(e) {
86
86
  return typeof e == "string" && e.trim().length > 0;
87
87
  }
88
- function Ut(e) {
88
+ function Ht(e) {
89
89
  const t = /* @__PURE__ */ new Set();
90
- return Ht(e, (i) => (t.add(i), `{${i}}`)), Array.from(t);
91
- }
92
- function Ht(e, t) {
93
- let i = "", o = 0, a = 0;
94
- for (; a < e.length; ) {
95
- const s = e[a];
96
- if (s === "'" || s === '"') {
97
- a = Gt(e, a);
90
+ return Gt(e, (i) => (t.add(i), `{${i}}`)), Array.from(t);
91
+ }
92
+ function Gt(e, t) {
93
+ let i = "", o = 0, r = 0;
94
+ for (; r < e.length; ) {
95
+ const a = e[r];
96
+ if (a === "'" || a === '"') {
97
+ r = zt(e, r);
98
98
  continue;
99
99
  }
100
- if (s === "{") {
101
- const l = e.indexOf("}", a + 1);
100
+ if (a === "{") {
101
+ const l = e.indexOf("}", r + 1);
102
102
  if (l === -1) {
103
- a += 1;
103
+ r += 1;
104
104
  continue;
105
105
  }
106
- const d = e.slice(a + 1, l);
107
- /^[A-Za-z_][A-Za-z0-9_]*$/.test(d) && (i += e.slice(o, a) + t(d), o = l + 1), a = l + 1;
106
+ const d = e.slice(r + 1, l);
107
+ /^[A-Za-z_][A-Za-z0-9_]*$/.test(d) && (i += e.slice(o, r) + t(d), o = l + 1), r = l + 1;
108
108
  continue;
109
109
  }
110
- a += 1;
110
+ r += 1;
111
111
  }
112
112
  return i + e.slice(o);
113
113
  }
114
- function Gt(e, t) {
114
+ function zt(e, t) {
115
115
  const i = e[t];
116
116
  let o = t + 1;
117
117
  for (; o < e.length; ) {
@@ -129,7 +129,7 @@ function Gt(e, t) {
129
129
  function f(e) {
130
130
  return !!(e && typeof e == "object" && !Array.isArray(e));
131
131
  }
132
- const zt = /* @__PURE__ */ new Set([
132
+ const Qt = /* @__PURE__ */ new Set([
133
133
  "SUM",
134
134
  "COUNT",
135
135
  "AVG",
@@ -138,22 +138,22 @@ const zt = /* @__PURE__ */ new Set([
138
138
  "MEDIAN",
139
139
  "DISTINCT"
140
140
  ]);
141
- function le(e, t, i) {
141
+ function ue(e, t, i) {
142
142
  if (!e || typeof e != "object") {
143
143
  i.push(
144
- r("missing_source", "Analytics intent needs a source.", t)
144
+ s("missing_source", "Analytics intent needs a source.", t)
145
145
  );
146
146
  return;
147
147
  }
148
148
  if (e.kind === "semantic") {
149
149
  m(e.domainId) || i.push(
150
- r(
150
+ s(
151
151
  "missing_semantic_domain",
152
152
  "Semantic source needs a domainId.",
153
153
  `${t}.domainId`
154
154
  )
155
155
  ), m(e.datasetName) || i.push(
156
- r(
156
+ s(
157
157
  "missing_dataset_name",
158
158
  "Semantic source needs a datasetName.",
159
159
  `${t}.datasetName`
@@ -163,13 +163,13 @@ function le(e, t, i) {
163
163
  }
164
164
  if (e.kind === "physical") {
165
165
  m(e.connectionId) || i.push(
166
- r(
166
+ s(
167
167
  "missing_connection_id",
168
168
  "Physical source needs a connectionId.",
169
169
  `${t}.connectionId`
170
170
  )
171
171
  ), m(e.tableName) || i.push(
172
- r(
172
+ s(
173
173
  "missing_table_name",
174
174
  "Physical source needs a tableName.",
175
175
  `${t}.tableName`
@@ -179,7 +179,7 @@ function le(e, t, i) {
179
179
  }
180
180
  if (e.kind === "sql") {
181
181
  m(e.connectionId) || i.push(
182
- r(
182
+ s(
183
183
  "missing_connection_id",
184
184
  "SQL source needs a connectionId.",
185
185
  `${t}.connectionId`
@@ -188,47 +188,47 @@ function le(e, t, i) {
188
188
  return;
189
189
  }
190
190
  i.push(
191
- r("invalid_source_kind", "Source kind is not supported.", t)
191
+ s("invalid_source_kind", "Source kind is not supported.", t)
192
192
  );
193
193
  }
194
194
  function b(e, t, i, o = {}) {
195
195
  if (!e || !f(e)) {
196
196
  o.required && i.push(
197
- r("missing_field_ref", "Field reference needs a name.", t)
197
+ s("missing_field_ref", "Field reference needs a name.", t)
198
198
  );
199
199
  return;
200
200
  }
201
201
  m(e.name) || i.push(
202
- r(
202
+ s(
203
203
  "missing_field_ref",
204
204
  "Field reference needs a name.",
205
205
  `${t}.name`
206
206
  )
207
- ), e.source !== void 0 && le(e.source, `${t}.source`, i), de(e.aggregate, `${t}.aggregate`, i);
207
+ ), e.source !== void 0 && ue(e.source, `${t}.source`, i), ce(e.aggregate, `${t}.aggregate`, i);
208
208
  }
209
- function de(e, t, i) {
210
- e !== void 0 && (typeof e != "string" || !zt.has(e)) && i.push(
211
- r(
209
+ function ce(e, t, i) {
210
+ e !== void 0 && (typeof e != "string" || !Qt.has(e)) && i.push(
211
+ s(
212
212
  "invalid_aggregate",
213
213
  "Field aggregate must be SUM, COUNT, AVG, MIN, MAX, MEDIAN, or DISTINCT.",
214
214
  t
215
215
  )
216
216
  );
217
217
  }
218
- const Qt = /* @__PURE__ */ new Set([
218
+ const Kt = /* @__PURE__ */ new Set([
219
219
  "measure",
220
220
  "dimension",
221
221
  "date",
222
222
  "id",
223
223
  "unknown"
224
- ]), Kt = /* @__PURE__ */ new Set(["row", "aggregate"]), qe = /* @__PURE__ */ new Set([
224
+ ]), Xt = /* @__PURE__ */ new Set(["row", "aggregate"]), Ue = /* @__PURE__ */ new Set([
225
225
  "string",
226
226
  "number",
227
227
  "boolean",
228
228
  "date",
229
229
  "datetime",
230
230
  "unknown"
231
- ]), Xt = /* @__PURE__ */ new Set([
231
+ ]), Zt = /* @__PURE__ */ new Set([
232
232
  "number",
233
233
  "currency",
234
234
  "percent",
@@ -239,19 +239,19 @@ const Qt = /* @__PURE__ */ new Set([
239
239
  "duration",
240
240
  "string",
241
241
  "temporal_bucket"
242
- ]), Zt = /* @__PURE__ */ new Set([
242
+ ]), Jt = /* @__PURE__ */ new Set([
243
243
  "millisecond",
244
244
  "second",
245
245
  "minute",
246
246
  "hour",
247
247
  "day"
248
248
  ]), Wt = /* @__PURE__ */ new Set(["compact", "digital", "long"]);
249
- function Ue(e, t, i) {
249
+ function He(e, t, i) {
250
250
  if (e === void 0)
251
251
  return;
252
252
  if (!f(e)) {
253
253
  i.push(
254
- r(
254
+ s(
255
255
  "invalid_value_format",
256
256
  "Value format must be a structured object.",
257
257
  t
@@ -260,20 +260,20 @@ function Ue(e, t, i) {
260
260
  return;
261
261
  }
262
262
  const o = e;
263
- (typeof o.type != "string" || !Xt.has(o.type)) && i.push(
264
- r(
263
+ (typeof o.type != "string" || !Zt.has(o.type)) && i.push(
264
+ s(
265
265
  "invalid_value_format_type",
266
266
  "Value format type must be number, currency, percent, percentage, scientific, date, datetime, duration, string, or temporal_bucket.",
267
267
  `${t}.type`
268
268
  )
269
269
  ), o.type === "temporal_bucket" && !U.safeParse(e).success && i.push(
270
- r(
270
+ s(
271
271
  "invalid_temporal_bucket_format",
272
272
  "Temporal bucket format must contain a valid auto, preset, or pattern presentation.",
273
273
  t
274
274
  )
275
275
  ), (o.type === "number" || o.type === "currency" || o.type === "percent" || o.type === "percentage" || o.type === "scientific") && Object.prototype.hasOwnProperty.call(e, "locale") && i.push(
276
- r(
276
+ s(
277
277
  "invalid_value_format",
278
278
  "Numeric value formats cannot define viewer locale.",
279
279
  `${t}.locale`
@@ -287,36 +287,36 @@ function Ue(e, t, i) {
287
287
  `${t}.maximumFractionDigits`,
288
288
  i
289
289
  ), Y(e.scale, `${t}.scale`, i), Y(e.maxUnits, `${t}.maxUnits`, i), e.useGrouping !== void 0 && typeof e.useGrouping != "boolean" && i.push(
290
- r(
290
+ s(
291
291
  "invalid_value_format_use_grouping",
292
292
  "Value format useGrouping must be boolean.",
293
293
  `${t}.useGrouping`
294
294
  )
295
295
  ), e.negativeStyle !== void 0 && e.negativeStyle !== "minus" && e.negativeStyle !== "parentheses" && i.push(
296
- r(
296
+ s(
297
297
  "invalid_value_format_negative_style",
298
298
  "Value format negativeStyle must be minus or parentheses.",
299
299
  `${t}.negativeStyle`
300
300
  )
301
301
  ), e.percentValueMode !== void 0 && e.percentValueMode !== "fraction" && e.percentValueMode !== "whole" && i.push(
302
- r(
302
+ s(
303
303
  "invalid_value_format_percent_mode",
304
304
  "Value format percentValueMode must be fraction or whole.",
305
305
  `${t}.percentValueMode`
306
306
  )
307
307
  );
308
- for (const a of ["inputUnit", "largestUnit", "smallestUnit"]) {
309
- const s = e[a];
310
- s !== void 0 && (typeof s != "string" || !Zt.has(s)) && i.push(
311
- r(
308
+ for (const r of ["inputUnit", "largestUnit", "smallestUnit"]) {
309
+ const a = e[r];
310
+ a !== void 0 && (typeof a != "string" || !Jt.has(a)) && i.push(
311
+ s(
312
312
  "invalid_value_format_duration_unit",
313
313
  "Duration format units must be millisecond, second, minute, hour, or day.",
314
- `${t}.${a}`
314
+ `${t}.${r}`
315
315
  )
316
316
  );
317
317
  }
318
318
  e.outputStyle !== void 0 && (typeof e.outputStyle != "string" || !Wt.has(e.outputStyle)) && i.push(
319
- r(
319
+ s(
320
320
  "invalid_value_format_duration_style",
321
321
  "Duration format outputStyle must be compact, digital, or long.",
322
322
  `${t}.outputStyle`
@@ -325,30 +325,30 @@ function Ue(e, t, i) {
325
325
  }
326
326
  function Y(e, t, i) {
327
327
  e !== void 0 && (typeof e != "number" || !Number.isFinite(e)) && i.push(
328
- r(
328
+ s(
329
329
  "invalid_value_format_number",
330
330
  "Value format numeric options must be finite numbers.",
331
331
  t
332
332
  )
333
333
  );
334
334
  }
335
- const Jt = /* @__PURE__ */ new Set([
335
+ const ei = /* @__PURE__ */ new Set([
336
336
  "additive",
337
337
  "non_additive",
338
338
  "ratio_of_sums",
339
339
  "weighted",
340
340
  "pre_aggregated",
341
341
  "snapshot"
342
- ]), ei = /* @__PURE__ */ new Set([
342
+ ]), ti = /* @__PURE__ */ new Set([
343
343
  "default",
344
344
  "symmetric_aggregate",
345
345
  "aggregate_then_join",
346
346
  "weighted"
347
347
  ]);
348
- function ti(e, t, i) {
348
+ function ii(e, t, i) {
349
349
  if (!e || !f(e)) {
350
350
  i.push(
351
- r(
351
+ s(
352
352
  "invalid_derived_field_input",
353
353
  "Derived field inputs must be structured input references.",
354
354
  t
@@ -357,122 +357,122 @@ function ti(e, t, i) {
357
357
  return;
358
358
  }
359
359
  if (e.kind === "field") {
360
- b(e.field, `${t}.field`, i, { required: !0 }), de(e.aggregate, `${t}.aggregate`, i);
360
+ b(e.field, `${t}.field`, i, { required: !0 }), ce(e.aggregate, `${t}.aggregate`, i);
361
361
  return;
362
362
  }
363
363
  i.push(
364
- r(
364
+ s(
365
365
  "invalid_derived_field_input",
366
366
  "Derived field input kind must be field.",
367
367
  `${t}.kind`
368
368
  )
369
369
  );
370
370
  }
371
- function ue(e) {
371
+ function pe(e) {
372
372
  const t = [];
373
373
  if (!f(e))
374
374
  return t.push(
375
- r(
375
+ s(
376
376
  "invalid_derived_field",
377
377
  "Derived field definition must be a structured object."
378
378
  )
379
379
  ), { ok: !1, errors: t, warnings: [] };
380
380
  if (e.kind !== "derived_field" && t.push(
381
- r(
381
+ s(
382
382
  "invalid_derived_field_kind",
383
383
  "Derived field kind must be derived_field.",
384
384
  "kind"
385
385
  )
386
386
  ), m(e.name) || t.push(
387
- r(
387
+ s(
388
388
  "invalid_derived_field_name",
389
389
  "Derived field needs a name.",
390
390
  "name"
391
391
  )
392
392
  ), m(e.label) || t.push(
393
- r(
393
+ s(
394
394
  "invalid_derived_field_label",
395
395
  "Derived field needs a label.",
396
396
  "label"
397
397
  )
398
- ), Qt.has(e.resultRole) || t.push(
399
- r(
398
+ ), Kt.has(e.resultRole) || t.push(
399
+ s(
400
400
  "invalid_derived_field_role",
401
401
  "Derived field resultRole must be measure, dimension, date, id, or unknown.",
402
402
  "resultRole"
403
403
  )
404
- ), qe.has(e.dataType) || t.push(
405
- r(
404
+ ), Ue.has(e.dataType) || t.push(
405
+ s(
406
406
  "invalid_derived_field_data_type",
407
407
  "Derived field dataType must be string, number, boolean, date, datetime, or unknown.",
408
408
  "dataType"
409
409
  )
410
- ), Kt.has(e.computeStage) || t.push(
411
- r(
410
+ ), Xt.has(e.computeStage) || t.push(
411
+ s(
412
412
  "invalid_derived_field_compute_stage",
413
413
  "Derived field computeStage must be row or aggregate.",
414
414
  "computeStage"
415
415
  )
416
416
  ), e.computeStage === "aggregate" && e.resultRole !== "measure" && t.push(
417
- r(
417
+ s(
418
418
  "invalid_derived_field_compute_stage",
419
419
  "Aggregate-stage derived fields must have resultRole measure.",
420
420
  "computeStage"
421
421
  )
422
422
  ), e.resultRole !== "measure" && e.defaultAggregate !== void 0 && t.push(
423
- r(
423
+ s(
424
424
  "invalid_derived_field_aggregate",
425
425
  "Only measure derived fields may declare defaultAggregate.",
426
426
  "defaultAggregate"
427
427
  )
428
428
  ), e.computeStage === "row" && e.resultRole === "measure" && e.defaultAggregate === void 0 && t.push(
429
- r(
429
+ s(
430
430
  "missing_derived_field_default_aggregate",
431
431
  "Row-stage measure derived fields must declare defaultAggregate so row results have explicit rollup semantics.",
432
432
  "defaultAggregate"
433
433
  )
434
- ), de(
434
+ ), ce(
435
435
  e.defaultAggregate,
436
436
  "defaultAggregate",
437
437
  t
438
- ), e.aggregationBehavior !== void 0 && !Jt.has(
438
+ ), e.aggregationBehavior !== void 0 && !ei.has(
439
439
  e.aggregationBehavior
440
440
  ) && t.push(
441
- r(
441
+ s(
442
442
  "invalid_derived_field_aggregation_behavior",
443
443
  "Derived field aggregationBehavior is not supported.",
444
444
  "aggregationBehavior"
445
445
  )
446
- ), e.aggregationStrategy !== void 0 && !ei.has(
446
+ ), e.aggregationStrategy !== void 0 && !ti.has(
447
447
  e.aggregationStrategy
448
448
  ) && t.push(
449
- r(
449
+ s(
450
450
  "invalid_derived_field_aggregation_strategy",
451
451
  "Derived field aggregationStrategy is not supported.",
452
452
  "aggregationStrategy"
453
453
  )
454
454
  ), m(e.expression) || t.push(
455
- r(
455
+ s(
456
456
  "invalid_derived_field_expression",
457
457
  "Derived field needs a named-token expression.",
458
458
  "expression"
459
459
  )
460
460
  ), e.expressionLanguage !== void 0 && e.expressionLanguage !== "semaphor_sql_template" && t.push(
461
- r(
461
+ s(
462
462
  "invalid_derived_field_expression_language",
463
463
  "Derived field expressionLanguage must be semaphor_sql_template.",
464
464
  "expressionLanguage"
465
465
  )
466
466
  ), !f(e.inputs) || Object.keys(e.inputs).length === 0 ? t.push(
467
- r(
467
+ s(
468
468
  "invalid_derived_field_inputs",
469
469
  "Derived field needs at least one typed input.",
470
470
  "inputs"
471
471
  )
472
- ) : Object.entries(e.inputs).forEach(([o, a]) => {
472
+ ) : Object.entries(e.inputs).forEach(([o, r]) => {
473
473
  if (!m(o)) {
474
474
  t.push(
475
- r(
475
+ s(
476
476
  "invalid_derived_field_input_name",
477
477
  "Derived field input names must be non-empty strings.",
478
478
  "inputs"
@@ -480,28 +480,28 @@ function ue(e) {
480
480
  );
481
481
  return;
482
482
  }
483
- ti(
484
- a,
483
+ ii(
484
+ r,
485
485
  `inputs.${o}`,
486
486
  t
487
487
  );
488
488
  }), m(e.expression) && f(e.inputs)) {
489
- const o = Ut(
489
+ const o = Ht(
490
490
  e.expression
491
- ), a = new Set(o), s = Object.keys(e.inputs).filter(
491
+ ), r = new Set(o), a = Object.keys(e.inputs).filter(
492
492
  (l) => m(l)
493
493
  );
494
494
  o.forEach((l) => {
495
495
  Object.prototype.hasOwnProperty.call(e.inputs, l) || t.push(
496
- r(
496
+ s(
497
497
  "invalid_derived_field_expression_token",
498
498
  `Derived field expression token "{${l}}" needs a matching inputs.${l} entry.`,
499
499
  "expression"
500
500
  )
501
501
  );
502
- }), s.forEach((l) => {
503
- a.has(l) || t.push(
504
- r(
502
+ }), a.forEach((l) => {
503
+ r.has(l) || t.push(
504
+ s(
505
505
  "unused_derived_field_input",
506
506
  `Derived field input "${l}" is not referenced by expression.`,
507
507
  `inputs.${l}`
@@ -511,68 +511,68 @@ function ue(e) {
511
511
  }
512
512
  const i = e.format;
513
513
  return f(i) && i.type === "temporal_bucket" ? t.push(
514
- r(
514
+ s(
515
515
  "invalid_derived_field_format",
516
516
  "Derived field computation metadata cannot own temporal bucket presentation; declare grain and format on the grouped field.",
517
517
  "format"
518
518
  )
519
- ) : Ue(i, "format", t), e.tags !== void 0 && (!Array.isArray(e.tags) || e.tags.some((o) => !m(o))) && t.push(
520
- r(
519
+ ) : He(i, "format", t), e.tags !== void 0 && (!Array.isArray(e.tags) || e.tags.some((o) => !m(o))) && t.push(
520
+ s(
521
521
  "invalid_derived_field_tags",
522
522
  "Derived field tags must be non-empty strings.",
523
523
  "tags"
524
524
  )
525
525
  ), { ok: t.length === 0, errors: t, warnings: [] };
526
526
  }
527
- const M = n.string().min(1).refine((e) => e.trim().length > 0, "Must not be blank."), [ii, ni, ai, oi] = Be.options, He = n.union([
528
- ii.innerType().omit({ locale: !0 }).strict().superRefine((e, t) => {
527
+ const M = n.string().min(1).refine((e) => e.trim().length > 0, "Must not be blank."), [ni, ai, oi, si] = Le.options, Ge = n.union([
528
+ ni.innerType().omit({ locale: !0 }).strict().superRefine((e, t) => {
529
529
  const { minimumFractionDigits: i = 0, maximumFractionDigits: o = 2 } = e;
530
- (![i, o].every((a) => Number.isInteger(a) && a >= 0 && a <= 20) || i > o) && t.addIssue({
530
+ (![i, o].every((r) => Number.isInteger(r) && r >= 0 && r <= 20) || i > o) && t.addIssue({
531
531
  code: "custom",
532
532
  message: "Fraction digits must be integers from 0 to 20 with minimum <= maximum."
533
533
  }), e.scale !== void 0 && !Number.isFinite(e.scale) && t.addIssue({ code: "custom", message: "Scale must be finite." });
534
534
  }),
535
- ni.strict(),
536
535
  ai.strict(),
537
- oi.strict()
536
+ oi.strict(),
537
+ si.strict()
538
538
  ]), ke = n.union([
539
- He,
539
+ Ge,
540
540
  U
541
- ]), ce = n.union([
542
- Mt.extend({ domainId: M, datasetName: M }).strict(),
543
- Rt.extend({ connectionId: M, tableName: M }).strict()
544
- ]), Ge = Tt.extend({
541
+ ]), me = n.union([
542
+ Rt.extend({ domainId: M, datasetName: M }).strict(),
543
+ Tt.extend({ connectionId: M, tableName: M }).strict()
544
+ ]), ze = Et.extend({
545
545
  name: M,
546
- source: ce.optional()
547
- }).strict(), pe = Et.extend({
548
- format: He.optional(),
546
+ source: me.optional()
547
+ }).strict(), fe = Nt.extend({
548
+ format: Ge.optional(),
549
549
  inputs: n.record(
550
550
  n.object({
551
551
  kind: n.literal("field"),
552
- field: Ge,
553
- aggregate: Le.optional()
552
+ field: ze,
553
+ aggregate: Ve.optional()
554
554
  }).strict()
555
555
  )
556
556
  }).strict().superRefine((e, t) => {
557
557
  var i;
558
- for (const o of ue(e).errors)
558
+ for (const o of pe(e).errors)
559
559
  t.addIssue({
560
560
  code: "custom",
561
561
  path: ((i = o.path) == null ? void 0 : i.split(".")) ?? [],
562
562
  message: o.message
563
563
  });
564
- }), si = Ge.extend({
565
- derivedField: pe.optional()
564
+ }), ri = ze.extend({
565
+ derivedField: fe.optional()
566
566
  }).strict();
567
- function me(e) {
567
+ function ge(e) {
568
568
  return typeof e == "string" ? e.trim().toLowerCase() : "";
569
569
  }
570
- function ri(e) {
570
+ function li(e) {
571
571
  return String(
572
572
  e.column_name || e.name || e.qualifiedFieldName || ""
573
573
  );
574
574
  }
575
- function li(e) {
575
+ function di(e) {
576
576
  return Array.from(
577
577
  new Set(
578
578
  [e.column_name, e.name, e.qualifiedFieldName, e.alias].filter(
@@ -581,11 +581,11 @@ function li(e) {
581
581
  )
582
582
  );
583
583
  }
584
- function fe(e) {
585
- const t = Qe(e);
586
- return t ? pi(t) ? "number" : t.includes("timestamp") || t.includes("datetime") || t.startsWith("time") ? "datetime" : t.includes("date") ? "date" : t.includes("bool") ? "boolean" : "string" : "unknown";
584
+ function he(e) {
585
+ const t = Ke(e);
586
+ return t ? mi(t) ? "number" : t.includes("timestamp") || t.includes("datetime") || t.startsWith("time") ? "datetime" : t.includes("date") ? "date" : t.includes("bool") ? "boolean" : "string" : "unknown";
587
587
  }
588
- const Q = /* @__PURE__ */ new Map([
588
+ const K = /* @__PURE__ */ new Map([
589
589
  // Integer families (PostgreSQL, ClickHouse, DuckDB, MySQL).
590
590
  ["int", "integer"],
591
591
  ["uint", "integer"],
@@ -614,87 +614,87 @@ const Q = /* @__PURE__ */ new Map([
614
614
  ["money", null],
615
615
  ["currency", null],
616
616
  ["percent", null]
617
- ]), di = ["int", "uint", "decimal", "float"];
618
- function ui(e) {
617
+ ]), ui = ["int", "uint", "decimal", "float"];
618
+ function ci(e) {
619
619
  return e.length > 0 && Array.from(e).every((t) => t >= "0" && t <= "9");
620
620
  }
621
- function ci(e) {
621
+ function pi(e) {
622
622
  var i;
623
623
  const t = (i = /^number\s*\(\s*\d+\s*,\s*(\d+)\s*\)$/.exec(e)) == null ? void 0 : i[1];
624
624
  return t === void 0 ? null : Number(t) === 0 ? "integer" : "decimal";
625
625
  }
626
- function ze(e) {
626
+ function Qe(e) {
627
627
  const t = e.split(/[\s(]/, 1)[0] || "";
628
628
  if (t === "number")
629
- return { numeric: !0, kind: ci(e) };
630
- if (Q.has(t))
631
- return { numeric: !0, kind: Q.get(t) ?? null };
632
- const i = di.find(
633
- (o) => t.startsWith(o) && ui(t.slice(o.length))
629
+ return { numeric: !0, kind: pi(e) };
630
+ if (K.has(t))
631
+ return { numeric: !0, kind: K.get(t) ?? null };
632
+ const i = ui.find(
633
+ (o) => t.startsWith(o) && ci(t.slice(o.length))
634
634
  );
635
- return i ? { numeric: !0, kind: Q.get(i) ?? null } : { numeric: !1, kind: null };
636
- }
637
- function pi(e) {
638
- return ze(e).numeric;
635
+ return i ? { numeric: !0, kind: K.get(i) ?? null } : { numeric: !1, kind: null };
639
636
  }
640
637
  function mi(e) {
641
- return ze(Qe(e)).kind;
638
+ return Qe(e).numeric;
642
639
  }
643
- function Qe(e) {
644
- let t = me(e), i = "";
640
+ function fi(e) {
641
+ return Qe(Ke(e)).kind;
642
+ }
643
+ function Ke(e) {
644
+ let t = ge(e), i = "";
645
645
  for (; t && t !== i; )
646
- i = t, t = we(t, "nullable"), t = we(t, "lowcardinality");
646
+ i = t, t = Ae(t, "nullable"), t = Ae(t, "lowcardinality");
647
647
  return t;
648
648
  }
649
- function we(e, t) {
649
+ function Ae(e, t) {
650
650
  const i = `${t}(`;
651
651
  return !e.startsWith(i) || !e.endsWith(")") ? e : e.slice(i.length, -1).trim();
652
652
  }
653
- function fi(e) {
654
- const t = fe(e);
653
+ function gi(e) {
654
+ const t = he(e);
655
655
  return t === "date" || t === "datetime";
656
656
  }
657
- function Ke(e) {
658
- return fi(e.dataType || e.data_type);
659
- }
660
657
  function Xe(e) {
661
- const t = Ze(e);
658
+ return gi(e.dataType || e.data_type);
659
+ }
660
+ function Ze(e) {
661
+ const t = Je(e);
662
662
  return t === "id" || t === "row_id";
663
663
  }
664
- function Ae(e) {
665
- const t = Ze(e);
666
- return Xe(e) || t.endsWith("_id") || t.endsWith("_key") || t.endsWith("_number");
664
+ function Fe(e) {
665
+ const t = Je(e);
666
+ return Ze(e) || t.endsWith("_id") || t.endsWith("_key") || t.endsWith("_number");
667
667
  }
668
- function Ze(e) {
669
- return me(
670
- ri(e) || e.name || e.alias
668
+ function Je(e) {
669
+ return ge(
670
+ li(e) || e.name || e.alias
671
671
  ).replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
672
672
  }
673
673
  function We(e, t = {}) {
674
- const i = me(e.role);
675
- return i === "metric" || i === "measure" ? !t.excludeIdentifiers || !Ae(e) : i === "groupby" || i === "dimension" || i === "date" || i === "id" ? !1 : fe(
674
+ const i = ge(e.role);
675
+ return i === "metric" || i === "measure" ? !t.excludeIdentifiers || !Fe(e) : i === "groupby" || i === "dimension" || i === "date" || i === "id" ? !1 : he(
676
676
  e.dataType || e.data_type
677
- ) === "number" && (!t.excludeIdentifiers || !Ae(e));
677
+ ) === "number" && (!t.excludeIdentifiers || !Fe(e));
678
678
  }
679
- function ia(e) {
680
- return !We(e) && !Ke(e);
679
+ function aa(e) {
680
+ return !We(e) && !Xe(e);
681
681
  }
682
- function na(e) {
682
+ function oa(e) {
683
683
  const t = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
684
- for (const a of e) {
685
- if (Xe(a))
684
+ for (const r of e) {
685
+ if (Ze(r))
686
686
  continue;
687
- const s = li(a);
688
- if (s.length !== 0) {
689
- if (Ke(a)) {
690
- s.forEach((l) => i.add(l));
687
+ const a = di(r);
688
+ if (a.length !== 0) {
689
+ if (Xe(r)) {
690
+ a.forEach((l) => i.add(l));
691
691
  continue;
692
692
  }
693
- if (We(a, { excludeIdentifiers: !0 })) {
694
- s.forEach((l) => t.add(l));
693
+ if (We(r, { excludeIdentifiers: !0 })) {
694
+ a.forEach((l) => t.add(l));
695
695
  continue;
696
696
  }
697
- s.forEach((l) => o.add(l));
697
+ a.forEach((l) => o.add(l));
698
698
  }
699
699
  }
700
700
  return {
@@ -714,73 +714,73 @@ function L(e) {
714
714
  } : null;
715
715
  }
716
716
  function xe(e) {
717
- const { sign: t, whole: i, fraction: o = "", exponent: a } = e, s = (i + o).replace(/^0+/, ""), l = s.replace(/0+$/, ""), d = a - o.length + s.length - l.length;
718
- return !Number.isSafeInteger(a) || !Number.isSafeInteger(d) ? null : l ? `${t === "-" ? "-" : ""}${l}e${d}` : "0";
717
+ const { sign: t, whole: i, fraction: o = "", exponent: r } = e, a = (i + o).replace(/^0+/, ""), l = a.replace(/0+$/, ""), d = r - o.length + a.length - l.length;
718
+ return !Number.isSafeInteger(r) || !Number.isSafeInteger(d) ? null : l ? `${t === "-" ? "-" : ""}${l}e${d}` : "0";
719
719
  }
720
- function gi(e) {
720
+ function hi(e) {
721
721
  const t = L(e);
722
722
  if (!t) return null;
723
723
  const i = t.sign === "+" ? e.slice(1) : e, o = Number(e);
724
724
  if (!Number.isFinite(o)) return i;
725
- const a = xe(t), s = L(String(o));
726
- return a !== null && s !== null && a === xe(s) ? o : i;
725
+ const r = xe(t), a = L(String(o));
726
+ return r !== null && a !== null && r === xe(a) ? o : i;
727
727
  }
728
- function hi(e) {
728
+ function _i(e) {
729
729
  if (e.length > T)
730
730
  throw new RangeError("Exact numeric text exceeds 16 KiB.");
731
731
  const t = L(e);
732
732
  if (!t) throw new TypeError("Expected finite decimal text.");
733
- const { sign: i, whole: o, fraction: a, exponent: s } = t, l = `${i}${o || "0"}${a ? `.${a}` : ""}`;
734
- return x(`${l}e${s}`);
733
+ const { sign: i, whole: o, fraction: r, exponent: a } = t, l = `${i}${o || "0"}${r ? `.${r}` : ""}`;
734
+ return F(`${l}e${a}`);
735
735
  }
736
- function x(e) {
736
+ function F(e) {
737
737
  if (e.length > T)
738
738
  throw new RangeError("Exact numeric text exceeds 16 KiB.");
739
739
  const t = L(e);
740
740
  if (!t || t.whole === "" || t.fraction === "")
741
741
  throw new TypeError("Expected finite decimal text.");
742
- const { sign: i, whole: o, fraction: a = "", exponent: s } = t;
743
- if (!Number.isSafeInteger(s) || Math.abs(s) > T)
742
+ const { sign: i, whole: o, fraction: r = "", exponent: a } = t;
743
+ if (!Number.isSafeInteger(a) || Math.abs(a) > T)
744
744
  throw new RangeError("Exact numeric exponent exceeds the text budget.");
745
- const l = o + a, d = o.length + s;
745
+ const l = o + r, d = o.length + a;
746
746
  if (Math.max(l.length, d) + Math.max(0, -d) + 3 > T)
747
747
  throw new RangeError("Normalized exact numeric text exceeds 16 KiB.");
748
748
  let p;
749
749
  d <= 0 ? p = `0.${"0".repeat(-d)}${l}` : d >= l.length ? p = l + "0".repeat(d - l.length) : p = `${l.slice(0, d)}.${l.slice(d)}`;
750
- const [u, _ = ""] = p.split("."), y = u.replace(/^0+(?=\d)/, ""), I = _.replace(/0+$/, ""), h = y + (I ? `.${I}` : "");
751
- return i === "-" && h !== "0" ? `-${h}` : h;
750
+ const [u, h = ""] = p.split("."), y = u.replace(/^0+(?=\d)/, ""), S = h.replace(/0+$/, ""), _ = y + (S ? `.${S}` : "");
751
+ return i === "-" && _ !== "0" ? `-${_}` : _;
752
752
  }
753
- function Je(e, t) {
753
+ function et(e, t) {
754
754
  const i = e.startsWith("-"), o = t.startsWith("-");
755
755
  if (i !== o) return i ? -1 : 1;
756
- const [a, s = ""] = (i ? e.slice(1) : e).split("."), [l, d = ""] = (o ? t.slice(1) : t).split(".");
757
- let c = Math.sign(a.length - l.length);
758
- if (!c && a !== l && (c = a < l ? -1 : 1), !c) {
759
- const p = Math.max(s.length, d.length), u = s.padEnd(p, "0"), _ = d.padEnd(p, "0");
760
- c = u === _ ? 0 : u < _ ? -1 : 1;
756
+ const [r, a = ""] = (i ? e.slice(1) : e).split("."), [l, d = ""] = (o ? t.slice(1) : t).split(".");
757
+ let c = Math.sign(r.length - l.length);
758
+ if (!c && r !== l && (c = r < l ? -1 : 1), !c) {
759
+ const p = Math.max(a.length, d.length), u = a.padEnd(p, "0"), h = d.padEnd(p, "0");
760
+ c = u === h ? 0 : u < h ? -1 : 1;
761
761
  }
762
762
  return c === 0 ? 0 : i ? -c : c;
763
763
  }
764
- function aa(e, t) {
764
+ function sa(e, t) {
765
765
  if (typeof t == "number" && !Number.isFinite(t))
766
766
  throw new TypeError("Numeric scale must be finite.");
767
- const i = [e, x(String(t))].map((s) => {
768
- const [l, d = ""] = s.split(".");
767
+ const i = [e, F(String(t))].map((a) => {
768
+ const [l, d = ""] = a.split(".");
769
769
  return { coefficient: BigInt(l + d), digits: d.length };
770
- }), o = i[0].coefficient * i[1].coefficient, a = i[0].digits + i[1].digits;
771
- return x(`${o}e-${a}`);
770
+ }), o = i[0].coefficient * i[1].coefficient, r = i[0].digits + i[1].digits;
771
+ return F(`${o}e-${r}`);
772
772
  }
773
- function _i(e) {
773
+ function yi(e) {
774
774
  try {
775
- return x(e) === e;
775
+ return F(e) === e;
776
776
  } catch {
777
777
  return !1;
778
778
  }
779
779
  }
780
- const et = n.object({
780
+ const tt = n.object({
781
781
  kind: n.literal("exact_number"),
782
782
  type: n.enum(["integer", "decimal"]),
783
- value: n.string().max(T).refine(_i, "Expected canonical decimal text.")
783
+ value: n.string().max(T).refine(yi, "Expected canonical decimal text.")
784
784
  }).strict().superRefine((e, t) => {
785
785
  e.type === "integer" && e.value.includes(".") && t.addIssue({ code: "custom", path: ["value"], message: "An integer cannot have fractional digits." });
786
786
  }), B = n.union([
@@ -788,16 +788,16 @@ const et = n.object({
788
788
  n.string(),
789
789
  n.boolean(),
790
790
  n.number().finite(),
791
- et
791
+ tt
792
792
  ]);
793
- function yi(e, t) {
794
- return et.parse({ kind: "exact_number", type: t, value: x(e) });
793
+ function bi(e, t) {
794
+ return tt.parse({ kind: "exact_number", type: t, value: F(e) });
795
795
  }
796
796
  function V(e) {
797
797
  return typeof e == "object" && e !== null && "kind" in e && e.kind === "exact_number" && "type" in e && (e.type === "integer" || e.type === "decimal") && "value" in e && typeof e.value == "string";
798
798
  }
799
- function oa(e) {
800
- const t = mi(e.nativeDataType);
799
+ function ra(e) {
800
+ const t = fi(e.nativeDataType);
801
801
  if (!t) throw new TypeError("Numeric result type is not established.");
802
802
  if (e.value === null) return null;
803
803
  if (t === "float") {
@@ -807,12 +807,12 @@ function oa(e) {
807
807
  }
808
808
  if (e.exactText === void 0)
809
809
  throw new TypeError("Exact numeric sidecar is required; rounded result values cannot substitute.");
810
- return yi(e.exactText, t);
810
+ return bi(e.exactText, t);
811
811
  }
812
- const ge = n.string().uuid(), he = n.enum(["rows", "columns"]), bi = n.enum(["member", "subtotal", "grand_total", "others"]), vi = n.discriminatedUnion("kind", [
812
+ const _e = n.string().uuid(), H = n.enum(["rows", "columns"]), vi = n.enum(["member", "subtotal", "grand_total", "others"]), Ii = n.discriminatedUnion("kind", [
813
813
  n.object({ kind: n.literal("value"), value: B }).strict(),
814
- n.object({ kind: n.literal("others"), rankingId: ge }).strict()
815
- ]), F = n.array(n.object({ levelId: ge, member: vi }).strict()).readonly().superRefine((e, t) => {
814
+ n.object({ kind: n.literal("others"), rankingId: _e }).strict()
815
+ ]), x = n.array(n.object({ levelId: _e, member: Ii }).strict()).readonly().superRefine((e, t) => {
816
816
  new Set(e.map((i) => i.levelId)).size !== e.length && t.addIssue({
817
817
  code: "custom",
818
818
  path: [],
@@ -824,12 +824,12 @@ const ge = n.string().uuid(), he = n.enum(["rows", "columns"]), bi = n.enum(["me
824
824
  path: [],
825
825
  message: "Others is terminal."
826
826
  });
827
- }), sa = n.object({
828
- rowPath: F,
829
- columnPath: F,
830
- measureId: ge
827
+ }), la = n.object({
828
+ rowPath: x,
829
+ columnPath: x,
830
+ measureId: _e
831
831
  }).strict();
832
- function tt(e) {
832
+ function it(e) {
833
833
  return JSON.stringify(
834
834
  e.map(({ levelId: t, member: i }) => [
835
835
  t,
@@ -837,8 +837,8 @@ function tt(e) {
837
837
  ])
838
838
  );
839
839
  }
840
- const J = "SEMAPHOR_CALCULATED_FIELD", Ii = "calculated_fields";
841
- function Si(e) {
840
+ const te = "SEMAPHOR_CALCULATED_FIELD", Si = "calculated_fields";
841
+ function wi(e) {
842
842
  return (e == null ? void 0 : e.sourceField) || (e == null ? void 0 : e.name) || "";
843
843
  }
844
844
  const ki = [
@@ -876,17 +876,17 @@ const ki = [
876
876
  // Custom format
877
877
  "custom"
878
878
  ];
879
- function ra(e) {
879
+ function da(e) {
880
880
  return e.role === "metric" && "expression" in e && !!e.expression;
881
881
  }
882
- function la(e) {
882
+ function ua(e) {
883
883
  return !!e.expression;
884
884
  }
885
- function wi(e) {
886
- return !!(e && (e.calculationRepresentation || e.expression || e.derivedField || e.calculatedFieldOrigin || e.calculatedFormula || ee(e)));
885
+ function Ai(e) {
886
+ return !!(e && (e.calculationRepresentation || e.expression || e.derivedField || e.calculatedFieldOrigin || e.calculatedFormula || ie(e)));
887
887
  }
888
- function it(e) {
889
- var _, y, I;
888
+ function nt(e) {
889
+ var h, y, S;
890
890
  if (!e)
891
891
  return {
892
892
  representation: "physical",
@@ -895,22 +895,22 @@ function it(e) {
895
895
  runtimeExecutable: !1,
896
896
  legacyManual: !1
897
897
  };
898
- const t = e.fieldScope === "domain" ? "domain" : "local", i = ((_ = e.derivedField) == null ? void 0 : _.computeStage) || ((y = e.calculatedFormula) == null ? void 0 : y.computeStage), o = !e.calculatedFormula || Array.isArray(e.calculatedFormula.inputFields) && e.calculatedFormula.inputFields.every((h) => {
899
- const O = h && Si(h);
898
+ const t = e.fieldScope === "domain" ? "domain" : "local", i = ((h = e.derivedField) == null ? void 0 : h.computeStage) || ((y = e.calculatedFormula) == null ? void 0 : y.computeStage), o = !e.calculatedFormula || Array.isArray(e.calculatedFormula.inputFields) && e.calculatedFormula.inputFields.every((_) => {
899
+ const O = _ && wi(_);
900
900
  return typeof O == "string" && !!O.trim();
901
- }), a = typeof e.expression == "string" && !!e.expression.trim() && o, s = e.calculationRepresentation;
902
- if (e.derivedField || s === "typed-derived") {
903
- const h = e.derivedField !== void 0 && ue(e.derivedField).ok;
901
+ }), r = typeof e.expression == "string" && !!e.expression.trim() && o, a = e.calculationRepresentation;
902
+ if (e.derivedField || a === "typed-derived") {
903
+ const _ = e.derivedField !== void 0 && pe(e.derivedField).ok;
904
904
  return {
905
905
  representation: "typed-derived",
906
906
  ownership: t,
907
- completeness: (!s || s === "typed-derived") && h && (!e.expression && !e.calculatedFormula || a) ? "complete" : "incomplete",
907
+ completeness: (!a || a === "typed-derived") && _ && (!e.expression && !e.calculatedFormula || r) ? "complete" : "incomplete",
908
908
  computeStage: i,
909
- runtimeExecutable: a,
909
+ runtimeExecutable: r,
910
910
  legacyManual: !1
911
911
  };
912
912
  }
913
- if (!(!!s || wi(e)))
913
+ if (!(!!a || Ai(e)))
914
914
  return {
915
915
  representation: "physical",
916
916
  ownership: t,
@@ -918,99 +918,99 @@ function it(e) {
918
918
  runtimeExecutable: !1,
919
919
  legacyManual: !1
920
920
  };
921
- const d = i || (e.role === "groupby" || ((I = e.calculatedFieldOrigin) == null ? void 0 : I.role) === "groupby" ? "row" : void 0), c = t === "domain" || ee(e) || e.fieldScope === "card" || e.fieldScope === "sheet" || e.fieldScope === "dashboard" ? "manual" : "inline-expression", p = s === "manual" || s === "inline-expression" ? s : c, u = (!s || s === "manual" || s === "inline-expression") && !(s === "inline-expression" && ee(e));
921
+ const d = i || (e.role === "groupby" || ((S = e.calculatedFieldOrigin) == null ? void 0 : S.role) === "groupby" ? "row" : void 0), c = t === "domain" || ie(e) || e.fieldScope === "card" || e.fieldScope === "sheet" || e.fieldScope === "dashboard" ? "manual" : "inline-expression", p = a === "manual" || a === "inline-expression" ? a : c, u = (!a || a === "manual" || a === "inline-expression") && !(a === "inline-expression" && ie(e));
922
922
  return {
923
923
  representation: p,
924
924
  ownership: t,
925
- completeness: a && u ? "complete" : "incomplete",
925
+ completeness: r && u ? "complete" : "incomplete",
926
926
  computeStage: d,
927
- runtimeExecutable: a,
927
+ runtimeExecutable: r,
928
928
  legacyManual: p === "manual" && t === "local" && !d
929
929
  };
930
930
  }
931
- function da(e) {
931
+ function ca(e) {
932
932
  if (e.calculationRepresentation) return e;
933
- const { representation: t } = it(e);
933
+ const { representation: t } = nt(e);
934
934
  return t === "physical" ? e : { ...e, calculationRepresentation: t };
935
935
  }
936
- function ua(e) {
937
- return it(e).computeStage;
936
+ function pa(e) {
937
+ return nt(e).computeStage;
938
938
  }
939
- function ca(e, t) {
939
+ function ma(e, t) {
940
940
  return e === "aggregate" && t === "default";
941
941
  }
942
- function pa(e) {
942
+ function fa(e) {
943
943
  var i, o;
944
944
  const t = e;
945
945
  return !!(t != null && t.expression && ((o = (i = t.calculatedFormula) == null ? void 0 : i.inputFields) != null && o.length));
946
946
  }
947
- function ma(e) {
948
- return !!(e && (e.entityName === J || e.entityId === J));
947
+ function ga(e) {
948
+ return !!(e && (e.entityName === te || e.entityId === te));
949
949
  }
950
- function ee(e) {
950
+ function ie(e) {
951
951
  return e ? [e.entityName, e.entityId, e.qualifiedEntityName].some(
952
- (t) => t === J || t === Ii
952
+ (t) => t === te || t === Si
953
953
  ) : !1;
954
954
  }
955
- var Ai = /* @__PURE__ */ ((e) => (e.SUBTOTAL = "__SUBTOTAL__", e.TOTAL = "__TOTAL__", e.ALL = "__ALL__", e))(Ai || {});
956
- function fa(e) {
955
+ var Fi = /* @__PURE__ */ ((e) => (e.SUBTOTAL = "__SUBTOTAL__", e.TOTAL = "__TOTAL__", e.ALL = "__ALL__", e))(Fi || {});
956
+ function ha(e) {
957
957
  return typeof e == "object" && e !== null && e.mode === "last" && e.relativeTo === "latest_data";
958
958
  }
959
959
  function xi(e) {
960
960
  return e === "between" || e === "not between";
961
961
  }
962
- const H = n.enum(["day", "week", "month", "quarter", "year"]), Fi = n.enum(["minute", "hour"]), nt = n.number().int().positive(), Fe = n.number().int(), at = n.object({
962
+ const G = n.enum(["day", "week", "month", "quarter", "year"]), Di = n.enum(["minute", "hour"]), at = n.number().int().positive(), De = n.number().int(), ot = n.object({
963
963
  mode: n.literal("last"),
964
- n: nt,
965
- unit: Fi,
964
+ n: at,
965
+ unit: Di,
966
966
  complete: n.literal(!1).optional(),
967
967
  relativeTo: n.literal("latest_data").optional()
968
- }), ot = n.object({
968
+ }), st = n.object({
969
969
  mode: n.literal("last"),
970
- n: nt,
971
- unit: H,
970
+ n: at,
971
+ unit: G,
972
972
  complete: n.boolean().optional(),
973
973
  relativeTo: n.literal("latest_data").optional()
974
- }), st = n.object({
974
+ }), rt = n.object({
975
975
  mode: n.literal("this"),
976
- unit: H,
976
+ unit: G,
977
977
  toDate: n.boolean().optional(),
978
978
  boundary: n.enum(["first_day", "last_day"]).optional()
979
- }), rt = n.object({ mode: n.literal("previous"), unit: H }), lt = n.object({
979
+ }), lt = n.object({ mode: n.literal("previous"), unit: G }), dt = n.object({
980
980
  mode: n.literal("between"),
981
- unit: H,
982
- from: Fe,
983
- to: Fe
984
- }), te = {
981
+ unit: G,
982
+ from: De,
983
+ to: De
984
+ }), ne = {
985
985
  check: (e) => e.boundary === void 0 || e.unit === "month",
986
986
  message: 'A month boundary requires unit "month".'
987
- }, Di = n.union([
988
- at.strict(),
987
+ }, Mi = n.union([
989
988
  ot.strict(),
990
- st.strict().refine(te.check, {
991
- message: te.message,
989
+ st.strict(),
990
+ rt.strict().refine(ne.check, {
991
+ message: ne.message,
992
992
  path: ["boundary"]
993
993
  }),
994
- rt.strict(),
995
- lt.strict()
996
- ]), Mi = n.union([
997
- at,
994
+ lt.strict(),
995
+ dt.strict()
996
+ ]), Ri = n.union([
998
997
  ot,
999
- st.refine(te.check),
1000
- rt,
1001
- lt
998
+ st,
999
+ rt.refine(ne.check),
1000
+ lt,
1001
+ dt
1002
1002
  ]);
1003
- function ga(e) {
1004
- const t = Mi.safeParse(e);
1003
+ function _a(e) {
1004
+ const t = Ri.safeParse(e);
1005
1005
  return t.success ? t.data : void 0;
1006
1006
  }
1007
- const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1008
- Ri.innerType().strict(),
1009
- Ti.extend({ type: n.literal("date") }).strict(),
1010
- Ei.strict(),
1007
+ const [Ti, Ei, Ni, $i] = Le.options, ji = n.union([
1008
+ Ti.innerType().strict(),
1009
+ Ei.extend({ type: n.literal("date") }).strict(),
1011
1010
  Ni.strict(),
1011
+ $i.strict(),
1012
1012
  U
1013
- ]), v = n.string().min(1), De = n.enum(["groupby", "metric", "sortby", "pivotby", "detail"]), dt = n.enum([
1013
+ ]), I = n.string().min(1), Me = n.enum(["groupby", "metric", "sortby", "pivotby", "detail"]), ut = n.enum([
1014
1014
  "table",
1015
1015
  "view",
1016
1016
  "materialized view",
@@ -1019,8 +1019,8 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1019
1019
  "dataset",
1020
1020
  "url",
1021
1021
  "upload"
1022
- ]), K = n.object({
1023
- connectionId: v,
1022
+ ]), X = n.object({
1023
+ connectionId: I,
1024
1024
  connectionType: n.enum([
1025
1025
  "GoogleSheets",
1026
1026
  "FileUpload",
@@ -1035,13 +1035,13 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1035
1035
  "API",
1036
1036
  "none"
1037
1037
  ]),
1038
- type: dt,
1039
- name: v,
1038
+ type: ut,
1039
+ name: I,
1040
1040
  // Grounded relationship plans retain semantic identity and display metadata.
1041
1041
  // SQL stays server-resolved; it is not accepted inside a join entity.
1042
1042
  alias: n.string().optional(),
1043
- id: v.optional(),
1044
- domainId: v.optional(),
1043
+ id: I.optional(),
1044
+ domainId: I.optional(),
1045
1045
  datasetType: n.enum(["physical", "virtual"]).optional(),
1046
1046
  label: n.string().optional(),
1047
1047
  description: n.string().optional(),
@@ -1060,39 +1060,39 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1060
1060
  ]).optional()
1061
1061
  }).strict(), q = n.lazy(
1062
1062
  () => n.object({
1063
- id: v,
1064
- name: v,
1063
+ id: I,
1064
+ name: I,
1065
1065
  label: n.string(),
1066
1066
  /** Set when `label` was synthesized from `name`; see `Field.derivedLabel`. */
1067
1067
  derivedLabel: n.string().optional(),
1068
- qualifiedFieldName: v,
1069
- dataType: v,
1070
- entityId: v,
1071
- entityName: v,
1072
- entityType: dt,
1068
+ qualifiedFieldName: I,
1069
+ dataType: I,
1070
+ entityId: I,
1071
+ entityName: I,
1072
+ entityType: ut,
1073
1073
  alias: n.string().optional(),
1074
1074
  sourceField: n.string().optional(),
1075
- source: ce.optional(),
1075
+ source: me.optional(),
1076
1076
  nativeDataType: n.string().optional(),
1077
1077
  description: n.string().optional(),
1078
1078
  qualifiedEntityName: n.string().optional(),
1079
1079
  dateFormat: n.enum(ki).optional(),
1080
1080
  customFormat: n.string().optional(),
1081
- granularity: W.optional(),
1082
- role: De.optional(),
1081
+ granularity: ee.optional(),
1082
+ role: Me.optional(),
1083
1083
  calculationRepresentation: n.enum(["inline-expression", "manual", "typed-derived"]).optional(),
1084
- calculatedFieldOrigin: n.object({ id: v, role: De.optional() }).strict().optional(),
1084
+ calculatedFieldOrigin: n.object({ id: I, role: Me.optional() }).strict().optional(),
1085
1085
  aggregateOrigin: n.enum(["default", "explicit"]).optional(),
1086
1086
  labelOrigin: n.enum(["semantic", "override"]).optional(),
1087
1087
  formatOrigin: n.enum(["semantic", "override"]).optional(),
1088
1088
  expression: n.string().optional(),
1089
- derivedField: pe.optional(),
1090
- format: $i.optional(),
1089
+ derivedField: fe.optional(),
1090
+ format: ji.optional(),
1091
1091
  semanticTemporalPresentation: n.object({
1092
- granularity: W,
1092
+ granularity: ee,
1093
1093
  format: U
1094
1094
  }).strict().optional(),
1095
- aggregate: Le.optional(),
1095
+ aggregate: Ve.optional(),
1096
1096
  fieldScope: n.enum(["card", "sheet", "dashboard", "domain"]).optional(),
1097
1097
  calculatedFormula: n.object({
1098
1098
  operation: n.enum([
@@ -1110,14 +1110,14 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1110
1110
  computeStage: n.enum(["row", "aggregate"]).optional()
1111
1111
  }).strict().optional()
1112
1112
  }).strict()
1113
- ), ji = n.union([
1113
+ ), Ci = n.union([
1114
1114
  n.string(),
1115
1115
  n.number().finite(),
1116
1116
  n.boolean(),
1117
1117
  n.date(),
1118
1118
  n.null()
1119
- ]), Ci = n.object({
1120
- id: v,
1119
+ ]), Oi = n.object({
1120
+ id: I,
1121
1121
  field: q,
1122
1122
  operator: n.enum([
1123
1123
  "=",
@@ -1138,10 +1138,10 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1138
1138
  "isNull",
1139
1139
  "isNotNull"
1140
1140
  ]),
1141
- value: n.union([ji, n.array(n.string()), n.array(n.number().finite())]),
1141
+ value: n.union([Ci, n.array(n.string()), n.array(n.number().finite())]),
1142
1142
  label: n.string().optional(),
1143
- temporalBucket: Nt.optional(),
1144
- relativeMeta: Di.optional(),
1143
+ temporalBucket: $t.optional(),
1144
+ relativeMeta: Mi.optional(),
1145
1145
  latestValue: n.literal(!0).optional(),
1146
1146
  latestValuePolicy: n.literal("snapshot").optional()
1147
1147
  }).strict().superRefine((e, t) => {
@@ -1155,8 +1155,8 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1155
1155
  path: ["relativeMeta"],
1156
1156
  message: "A relative date requires between or not between."
1157
1157
  }), e.latestValue) {
1158
- const s = [e.field.nativeDataType, e.field.dataType].map((l) => fe(l)).some((l) => l === "date" || l === "datetime");
1159
- (i !== "=" || !s) && t.addIssue({
1158
+ const a = [e.field.nativeDataType, e.field.dataType].map((l) => he(l)).some((l) => l === "date" || l === "datetime");
1159
+ (i !== "=" || !a) && t.addIssue({
1160
1160
  code: "custom",
1161
1161
  path: ["latestValue"],
1162
1162
  message: "Latest value requires = on a date or timestamp field."
@@ -1167,21 +1167,21 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1167
1167
  path: ["value"],
1168
1168
  message: "Membership requires an array."
1169
1169
  });
1170
- }), ut = n.lazy(
1170
+ }), ct = n.lazy(
1171
1171
  () => n.object({
1172
- id: v,
1172
+ id: I,
1173
1173
  logicalOperator: n.enum(["AND", "OR"]),
1174
1174
  negate: n.boolean(),
1175
- conditions: n.array(Ci),
1176
- groups: n.array(ut)
1175
+ conditions: n.array(Oi),
1176
+ groups: n.array(ct)
1177
1177
  }).strict()
1178
- ), Oi = n.object({
1179
- baseEntity: K,
1178
+ ), Yi = n.object({
1179
+ baseEntity: X,
1180
1180
  joins: n.array(
1181
1181
  n.object({
1182
- id: v,
1183
- source: K,
1184
- target: K,
1182
+ id: I,
1183
+ source: X,
1184
+ target: X,
1185
1185
  joinType: n.enum(["INNER", "LEFT", "RIGHT", "FULL"]),
1186
1186
  sequence: n.number().int().nonnegative(),
1187
1187
  autoResolved: n.boolean().optional(),
@@ -1191,7 +1191,7 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1191
1191
  relationshipTraversalDirection: n.enum(["forward", "reverse"]).optional(),
1192
1192
  joinKeyGroups: n.array(
1193
1193
  n.object({
1194
- id: v,
1194
+ id: I,
1195
1195
  operator: n.enum(["AND", "OR"]),
1196
1196
  keys: n.array(
1197
1197
  n.object({
@@ -1205,14 +1205,14 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1205
1205
  ).min(1)
1206
1206
  }).strict()
1207
1207
  )
1208
- }).strict(), Yi = n.object({
1209
- axis: he,
1208
+ }).strict(), Pi = n.object({
1209
+ axis: H,
1210
1210
  levelId: n.string().uuid().optional(),
1211
1211
  // Persisted table preferences are edited through Immer; runtime paths remain readonly.
1212
- oppositePath: F.transform((e) => [...e]).optional()
1213
- }).strict(), k = n.string().min(1), Pi = n.array(
1212
+ oppositePath: x.transform((e) => [...e]).optional()
1213
+ }).strict(), w = n.string().min(1), Bi = n.array(
1214
1214
  n.enum(["body", "header", "footer", "subtotal", "grandTotal"])
1215
- ), Bi = n.enum(["normal", "medium", "semibold", "bold"]), Li = n.enum(["none", "underline", "line-through"]), ct = n.object({
1215
+ ), Li = n.enum(["normal", "medium", "semibold", "bold"]), Vi = n.enum(["none", "underline", "line-through"]), pt = n.object({
1216
1216
  version: n.literal(1),
1217
1217
  rules: n.array(
1218
1218
  n.object({
@@ -1221,11 +1221,11 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1221
1221
  enabled: n.boolean().optional(),
1222
1222
  target: n.object({
1223
1223
  level: n.enum(["cell", "row"]),
1224
- matrix: Yi.optional(),
1225
- columnIds: n.array(k).optional(),
1226
- conditionColumnId: k.optional(),
1227
- applyToColumnIds: n.array(k).optional(),
1228
- tableParts: Pi.optional(),
1224
+ matrix: Pi.optional(),
1225
+ columnIds: n.array(w).optional(),
1226
+ conditionColumnId: w.optional(),
1227
+ applyToColumnIds: n.array(w).optional(),
1228
+ tableParts: Bi.optional(),
1229
1229
  rowRoles: n.array(n.string()).optional(),
1230
1230
  depth: n.number().int().nonnegative().optional(),
1231
1231
  includeTotals: n.boolean().optional(),
@@ -1234,38 +1234,38 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1234
1234
  condition: n.discriminatedUnion("kind", [
1235
1235
  n.object({
1236
1236
  kind: n.literal("comparison"),
1237
- columnId: k,
1237
+ columnId: w,
1238
1238
  operator: n.enum(["eq", "neq", "gt", "gte", "lt", "lte"]),
1239
1239
  value: B
1240
1240
  }).strict(),
1241
1241
  n.object({
1242
1242
  kind: n.literal("between"),
1243
- columnId: k,
1243
+ columnId: w,
1244
1244
  min: B,
1245
1245
  max: B,
1246
1246
  inclusive: n.boolean().optional()
1247
1247
  }).strict(),
1248
1248
  n.object({
1249
1249
  kind: n.literal("blank"),
1250
- columnId: k,
1250
+ columnId: w,
1251
1251
  isBlank: n.boolean()
1252
1252
  }).strict(),
1253
1253
  n.object({
1254
1254
  kind: n.literal("contains"),
1255
- columnId: k,
1255
+ columnId: w,
1256
1256
  value: n.string(),
1257
1257
  caseSensitive: n.boolean().optional(),
1258
1258
  exact: n.boolean().optional()
1259
1259
  }).strict(),
1260
1260
  n.object({
1261
1261
  kind: n.literal("topBottom"),
1262
- columnId: k,
1262
+ columnId: w,
1263
1263
  direction: n.enum(["top", "bottom"]),
1264
1264
  count: n.number().int().positive()
1265
1265
  }).strict(),
1266
1266
  n.object({
1267
1267
  kind: n.literal("colorScale"),
1268
- columnId: k,
1268
+ columnId: w,
1269
1269
  range: n.enum(["auto", "manual"]),
1270
1270
  min: n.number().finite().optional(),
1271
1271
  mid: n.number().finite().optional(),
@@ -1278,7 +1278,7 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1278
1278
  }).strict(),
1279
1279
  n.object({
1280
1280
  kind: n.literal("dataBar"),
1281
- columnId: k,
1281
+ columnId: w,
1282
1282
  range: n.enum(["auto", "manual"]),
1283
1283
  min: n.number().finite().optional(),
1284
1284
  max: n.number().finite().optional(),
@@ -1289,64 +1289,64 @@ const [Ri, Ti, Ei, Ni] = Be.options, $i = n.union([
1289
1289
  style: n.object({
1290
1290
  backgroundColor: n.string().optional(),
1291
1291
  textColor: n.string().optional(),
1292
- fontWeight: Bi.optional(),
1292
+ fontWeight: Li.optional(),
1293
1293
  italic: n.boolean().optional(),
1294
- textDecoration: Li.optional(),
1294
+ textDecoration: Vi.optional(),
1295
1295
  icon: n.enum(["arrowUp", "arrowDown", "warning", "check", "x"]).optional(),
1296
1296
  dataBar: n.object({ color: n.string(), showValue: n.boolean() }).strict().optional()
1297
1297
  }).strict().optional()
1298
1298
  }).strict()
1299
1299
  )
1300
1300
  }).strict();
1301
- function ha(e, t) {
1302
- const i = (s) => {
1303
- if (V(s)) return s.value;
1304
- const l = typeof s == "string" ? gi(s.trim()) ?? ie(s) : ie(s);
1301
+ function ya(e, t) {
1302
+ const i = (a) => {
1303
+ if (V(a)) return a.value;
1304
+ const l = typeof a == "string" ? hi(a.trim()) ?? ae(a) : ae(a);
1305
1305
  if (l === null) return null;
1306
1306
  try {
1307
- return hi(String(l));
1307
+ return _i(String(l));
1308
1308
  } catch {
1309
1309
  return null;
1310
1310
  }
1311
- }, o = i(e), a = i(t);
1312
- return o === null || a === null ? null : Je(o, a);
1311
+ }, o = i(e), r = i(t);
1312
+ return o === null || r === null ? null : et(o, r);
1313
1313
  }
1314
- function _a(e, t, i) {
1315
- const o = Ui(e);
1314
+ function ba(e, t, i) {
1315
+ const o = Hi(e);
1316
1316
  if (o === null) return null;
1317
1317
  if (typeof o == "number" && typeof t == "number" && typeof i == "number") {
1318
- const h = Hi(o, t, i);
1319
- return { ratio: h, midpointComparison: Math.sign(h - 0.5) };
1318
+ const _ = Gi(o, t, i);
1319
+ return { ratio: _, midpointComparison: Math.sign(_ - 0.5) };
1320
1320
  }
1321
- if ([t, i].some((h) => typeof h == "number" && !Number.isFinite(h))) return null;
1322
- const a = [o, t, i].map((h) => {
1323
- const O = typeof h == "number" ? x(String(h)) : h.value, [Dt, Ie = ""] = O.split(".");
1324
- return { coefficient: Dt + Ie, scale: Ie.length };
1325
- }), s = Math.max(...a.map((h) => h.scale)), [l, d, c] = a.map(
1326
- (h) => BigInt(h.coefficient) * 10n ** BigInt(s - h.scale)
1321
+ if ([t, i].some((_) => typeof _ == "number" && !Number.isFinite(_))) return null;
1322
+ const r = [o, t, i].map((_) => {
1323
+ const O = typeof _ == "number" ? F(String(_)) : _.value, [Mt, Se = ""] = O.split(".");
1324
+ return { coefficient: Mt + Se, scale: Se.length };
1325
+ }), a = Math.max(...r.map((_) => _.scale)), [l, d, c] = r.map(
1326
+ (_) => BigInt(_.coefficient) * 10n ** BigInt(a - _.scale)
1327
1327
  ), p = c - d, u = l - d;
1328
1328
  if (p <= 0n)
1329
1329
  return {
1330
1330
  ratio: l >= c ? 1 : 0,
1331
1331
  midpointComparison: l >= c ? 1 : -1
1332
1332
  };
1333
- const _ = u * 2n - p, y = _ < 0n ? -1 : _ > 0n ? 1 : 0;
1333
+ const h = u * 2n - p, y = h < 0n ? -1 : h > 0n ? 1 : 0;
1334
1334
  return { ratio: u <= 0n ? 0 : u >= p ? 1 : Number(u * 1000000000n / p) / 1e9, midpointComparison: y };
1335
1335
  }
1336
- function ya(e) {
1336
+ function va(e) {
1337
1337
  return !!e && typeof e == "object" && !Array.isArray(e);
1338
1338
  }
1339
- function ba(e) {
1339
+ function Ia(e) {
1340
1340
  return e.enabled !== !1;
1341
1341
  }
1342
- function va(e) {
1342
+ function Sa(e) {
1343
1343
  return e.kind === "topBottom" || e.kind === "colorScale" && e.range === "auto" || e.kind === "dataBar" && e.range === "auto";
1344
1344
  }
1345
- function Vi(e) {
1345
+ function qi(e) {
1346
1346
  return e.columnId;
1347
1347
  }
1348
- function qi(e) {
1349
- const t = [Vi(e.condition)];
1348
+ function Ui(e) {
1349
+ const t = [qi(e.condition)];
1350
1350
  return { validationRefs: [.../* @__PURE__ */ new Set([
1351
1351
  ...t,
1352
1352
  ...e.target.conditionColumnId === void 0 ? [] : [e.target.conditionColumnId],
@@ -1354,7 +1354,7 @@ function qi(e) {
1354
1354
  ...e.target.applyToColumnIds ?? []
1355
1355
  ])], evaluationInputs: t };
1356
1356
  }
1357
- function ie(e) {
1357
+ function ae(e) {
1358
1358
  if (typeof e == "number")
1359
1359
  return Number.isFinite(e) ? e : null;
1360
1360
  if (typeof e == "string" && e.trim() !== "") {
@@ -1363,10 +1363,10 @@ function ie(e) {
1363
1363
  }
1364
1364
  return null;
1365
1365
  }
1366
- function Ui(e) {
1367
- return V(e) ? e : ie(e);
1366
+ function Hi(e) {
1367
+ return V(e) ? e : ae(e);
1368
1368
  }
1369
- function Ia(e) {
1369
+ function wa(e) {
1370
1370
  const t = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
1371
1371
  for (const o of e)
1372
1372
  V(o) ? i.add(o.value) : t.add(o);
@@ -1374,19 +1374,19 @@ function Ia(e) {
1374
1374
  has: (o) => V(o) ? i.has(o.value) : t.has(o)
1375
1375
  };
1376
1376
  }
1377
- function Sa(e, t) {
1378
- return typeof e == "number" && typeof t == "number" ? Math.sign(e - t) : Je(
1379
- typeof e == "number" ? x(String(e)) : e.value,
1380
- typeof t == "number" ? x(String(t)) : t.value
1377
+ function ka(e, t) {
1378
+ return typeof e == "number" && typeof t == "number" ? Math.sign(e - t) : et(
1379
+ typeof e == "number" ? F(String(e)) : e.value,
1380
+ typeof t == "number" ? F(String(t)) : t.value
1381
1381
  );
1382
1382
  }
1383
- function ka(e) {
1383
+ function Aa(e) {
1384
1384
  return e == null || e === "";
1385
1385
  }
1386
- function Hi(e, t, i) {
1386
+ function Gi(e, t, i) {
1387
1387
  return !Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(i) ? 0 : i === t ? e >= i ? 1 : 0 : Math.max(0, Math.min(1, (e - t) / (i - t)));
1388
1388
  }
1389
- function Gi(e) {
1389
+ function zi(e) {
1390
1390
  switch (e) {
1391
1391
  case "bold":
1392
1392
  return 700;
@@ -1400,134 +1400,149 @@ function Gi(e) {
1400
1400
  return;
1401
1401
  }
1402
1402
  }
1403
- function wa(e) {
1404
- return e ? pt({
1405
- fontWeight: Gi(e.fontWeight),
1403
+ function Fa(e) {
1404
+ return e ? mt({
1405
+ fontWeight: zi(e.fontWeight),
1406
1406
  fontStyle: e.italic ? "italic" : void 0,
1407
1407
  color: e.textColor,
1408
1408
  backgroundColor: e.backgroundColor,
1409
1409
  textDecoration: e.textDecoration
1410
1410
  }) : {};
1411
1411
  }
1412
- function Aa(...e) {
1412
+ function xa(...e) {
1413
1413
  return Object.assign(
1414
1414
  {},
1415
- ...e.filter((t) => !!t).map(pt)
1415
+ ...e.filter((t) => !!t).map(mt)
1416
1416
  );
1417
1417
  }
1418
- function pt(e) {
1418
+ function mt(e) {
1419
1419
  return Object.fromEntries(
1420
1420
  Object.entries(e).filter(([, t]) => t !== void 0)
1421
1421
  );
1422
1422
  }
1423
- const S = n.string().uuid(), zi = n.string().min(1), Qi = n.number().int().positive().max(Number.MAX_SAFE_INTEGER), Ki = n.enum([
1423
+ const v = n.string().uuid(), Qi = n.string().min(1), Ki = n.number().int().positive().max(Number.MAX_SAFE_INTEGER), Xi = n.enum([
1424
1424
  "SUM",
1425
1425
  "COUNT",
1426
1426
  "DISTINCT",
1427
1427
  "AVG",
1428
1428
  "MIN",
1429
- "MAX"
1430
- ]), mt = si.omit({
1429
+ "MAX",
1430
+ "MEDIAN"
1431
+ ]), ft = ri.omit({
1431
1432
  aggregate: !0
1432
- }), Xi = {
1433
- id: S,
1434
- field: mt,
1435
- grain: W.optional()
1436
- }, ne = n.object(Xi).strict(), Zi = n.object({
1437
- id: S,
1433
+ }), Zi = {
1434
+ id: v,
1435
+ field: ft,
1436
+ grain: ee.optional()
1437
+ }, oe = n.object(Zi).strict(), Ji = n.object({
1438
+ id: v,
1438
1439
  kind: n.literal("aggregate"),
1439
- field: mt,
1440
- aggregate: Ki
1440
+ field: ft,
1441
+ aggregate: Xi
1441
1442
  }).strict(), Wi = n.object({
1442
- id: S,
1443
+ id: v,
1443
1444
  kind: n.literal("calculated"),
1444
- definition: pe
1445
- }).strict(), ft = n.discriminatedUnion("kind", [Zi, Wi]), Ji = n.discriminatedUnion("kind", [
1445
+ definition: fe
1446
+ }).strict(), gt = n.discriminatedUnion("kind", [Ji, Wi]), en = n.discriminatedUnion("kind", [
1446
1447
  n.object({ kind: n.literal("member") }).strict(),
1447
1448
  n.object({
1448
1449
  kind: n.literal("measure"),
1449
- measureId: S,
1450
- oppositePath: F
1450
+ measureId: v,
1451
+ oppositePath: x
1451
1452
  }).strict()
1452
- ]), en = {
1453
- axis: he,
1454
- levelId: S,
1453
+ ]), tn = {
1454
+ axis: H,
1455
+ levelId: v,
1455
1456
  scope: n.discriminatedUnion("kind", [
1456
1457
  n.object({ kind: n.literal("level") }).strict(),
1457
- n.object({ kind: n.literal("branch"), parent: F }).strict()
1458
+ n.object({ kind: n.literal("branch"), parent: x }).strict()
1458
1459
  ]),
1459
- target: Ji,
1460
+ target: en,
1460
1461
  direction: n.enum(["asc", "desc"]),
1461
1462
  nulls: n.enum(["first", "last"])
1462
- }, gt = n.object(en).strict(), tn = n.object({
1463
- id: S,
1464
- axis: he,
1465
- levelId: S,
1463
+ }, ht = n.object(tn).strict(), nn = n.object({
1464
+ id: v,
1465
+ axis: H,
1466
+ levelId: v,
1466
1467
  direction: n.enum(["top", "bottom"]),
1467
- count: Qi,
1468
- measureId: S,
1469
- oppositePath: F,
1468
+ count: Ki,
1469
+ measureId: v,
1470
+ oppositePath: x,
1470
1471
  others: n.boolean()
1471
- }).strict(), ht = n.object({
1472
- source: ce,
1473
- rows: n.array(ne).min(1).readonly(),
1474
- columns: n.array(ne).readonly(),
1475
- measures: n.array(ft).min(1).readonly(),
1476
- filters: ut.optional(),
1477
- joinPlan: Oi.optional(),
1478
- relationshipHint: n.object({ relationshipIds: n.array(zi).optional() }).strict().optional(),
1479
- sorts: n.array(gt).readonly(),
1480
- rankings: n.array(tn).readonly()
1472
+ }).strict(), Z = n.number().finite(), an = n.object({
1473
+ id: v,
1474
+ axis: H,
1475
+ levelId: v,
1476
+ measureId: v,
1477
+ operator: n.enum(["=", "!=", ">", ">=", "<", "<=", "between", "not between"]),
1478
+ value: n.union([
1479
+ Z,
1480
+ n.tuple([Z, Z]).readonly()
1481
+ ])
1482
+ }).strict().superRefine((e, t) => {
1483
+ const i = e.operator === "between" || e.operator === "not between";
1484
+ i !== Array.isArray(e.value) ? g(t, ["value"], i ? "A range condition needs a low and a high bound." : "A comparison needs one number.") : i && e.value[0] > e.value[1] && g(t, ["value"], "The low bound must not exceed the high bound.");
1485
+ }), _t = n.object({
1486
+ source: me,
1487
+ rows: n.array(oe).min(1).readonly(),
1488
+ columns: n.array(oe).readonly(),
1489
+ measures: n.array(gt).min(1).readonly(),
1490
+ filters: ct.optional(),
1491
+ joinPlan: Yi.optional(),
1492
+ relationshipHint: n.object({ relationshipIds: n.array(Qi).optional() }).strict().optional(),
1493
+ sorts: n.array(ht).readonly(),
1494
+ rankings: n.array(nn).readonly(),
1495
+ measureFilters: n.array(an).readonly().optional()
1481
1496
  }).strict();
1482
- function _t(e) {
1497
+ function yt(e) {
1483
1498
  return JSON.stringify([
1484
1499
  e.axis,
1485
1500
  e.levelId,
1486
1501
  e.scope.kind,
1487
- e.scope.kind === "branch" ? tt(e.scope.parent) : null
1502
+ e.scope.kind === "branch" ? it(e.scope.parent) : null
1488
1503
  ]);
1489
1504
  }
1490
1505
  function g(e, t, i) {
1491
1506
  e.addIssue({ code: "custom", path: t, message: i });
1492
1507
  }
1493
- function A(e, t, i) {
1508
+ function k(e, t, i) {
1494
1509
  new Set(e).size !== e.length && g(t, i, "Duplicate identity.");
1495
1510
  }
1496
- function $(e, t, i, o, a, s = !1) {
1497
- i.length > e[t].length && g(o, a, "Path exceeds axis depth."), i.forEach((l, d) => {
1511
+ function $(e, t, i, o, r, a = !1) {
1512
+ i.length > e[t].length && g(o, r, "Path exceeds axis depth."), i.forEach((l, d) => {
1498
1513
  var c;
1499
- if (l.levelId !== ((c = e[t][d]) == null ? void 0 : c.id) && g(o, [...a, d], "Path must be an ordered axis prefix."), l.member.kind === "others") {
1514
+ if (l.levelId !== ((c = e[t][d]) == null ? void 0 : c.id) && g(o, [...r, d], "Path must be an ordered axis prefix."), l.member.kind === "others") {
1500
1515
  const p = l.member.rankingId;
1501
- (s || d !== i.length - 1 || !e.rankings.some(
1516
+ (a || d !== i.length - 1 || !e.rankings.some(
1502
1517
  (u) => u.id === p && u.others && u.axis === t && u.levelId === l.levelId
1503
1518
  )) && g(
1504
1519
  o,
1505
- [...a, d],
1520
+ [...r, d],
1506
1521
  "Others must terminate a path at its enabled ranking and cannot be a sort/rank target."
1507
1522
  );
1508
1523
  }
1509
1524
  });
1510
1525
  }
1511
- function yt(e, t, i, o) {
1512
- A(t.map(_t), i, o), t.forEach((a, s) => {
1513
- const l = [...o, s], d = e[a.axis].findIndex((c) => c.id === a.levelId);
1514
- if (d < 0 && g(i, l, "Sort level is not on its axis."), a.scope.kind === "branch" && ($(
1526
+ function bt(e, t, i, o) {
1527
+ k(t.map(yt), i, o), t.forEach((r, a) => {
1528
+ const l = [...o, a], d = e[r.axis].findIndex((c) => c.id === r.levelId);
1529
+ if (d < 0 && g(i, l, "Sort level is not on its axis."), r.scope.kind === "branch" && ($(
1515
1530
  e,
1516
- a.axis,
1517
- a.scope.parent,
1531
+ r.axis,
1532
+ r.scope.parent,
1518
1533
  i,
1519
1534
  [...l, "scope", "parent"],
1520
1535
  !0
1521
- ), a.scope.parent.length !== d && g(
1536
+ ), r.scope.parent.length !== d && g(
1522
1537
  i,
1523
1538
  l,
1524
1539
  "Branch sort must name the immediate parent of its level."
1525
- )), a.target.kind === "measure") {
1526
- const c = a.target.measureId;
1540
+ )), r.target.kind === "measure") {
1541
+ const c = r.target.measureId;
1527
1542
  e.measures.some((p) => p.id === c) || g(i, l, "Unknown sort measure."), $(
1528
1543
  e,
1529
- a.axis === "rows" ? "columns" : "rows",
1530
- a.target.oppositePath,
1544
+ r.axis === "rows" ? "columns" : "rows",
1545
+ r.target.oppositePath,
1531
1546
  i,
1532
1547
  [...l, "target", "oppositePath"],
1533
1548
  !0
@@ -1542,28 +1557,26 @@ function P(e, t, i, o) {
1542
1557
  "Field source must belong to the same semantic domain or physical connection."
1543
1558
  );
1544
1559
  }
1545
- function X(e, t, i) {
1546
- (e.defaultAggregate === "MEDIAN" || Object.values(e.inputs).some(
1547
- (o) => o.aggregate === "MEDIAN" || o.field.aggregate === "MEDIAN"
1548
- )) && g(t, i, "MEDIAN dependencies are not supported at launch."), (e.aggregationBehavior === "snapshot" || e.aggregationBehavior === "weighted" || e.aggregationStrategy === "weighted") && g(t, i, "This measure semantic requires a later capability.");
1560
+ function J(e, t, i) {
1561
+ (e.aggregationBehavior === "snapshot" || e.aggregationBehavior === "weighted" || e.aggregationStrategy === "weighted") && g(t, i, "This measure semantic requires a later capability.");
1549
1562
  }
1550
- function bt(e, t) {
1551
- A(
1563
+ function vt(e, t) {
1564
+ k(
1552
1565
  [...e.rows, ...e.columns, ...e.measures].map((a) => a.id),
1553
1566
  t,
1554
1567
  []
1555
- ), A(
1568
+ ), k(
1556
1569
  e.rankings.map((a) => a.id),
1557
1570
  t,
1558
1571
  ["rankings"]
1559
- ), A(
1572
+ ), k(
1560
1573
  e.rankings.map((a) => JSON.stringify([a.axis, a.levelId])),
1561
1574
  t,
1562
1575
  ["rankings"]
1563
1576
  );
1564
1577
  for (const a of ["rows", "columns"])
1565
- e[a].forEach((s, l) => {
1566
- s.grain && s.field.dataType !== void 0 && !["date", "datetime", "unknown"].includes(s.field.dataType) && g(t, [a, l, "grain"], "Grain requires a temporal field.");
1578
+ e[a].forEach((l, d) => {
1579
+ l.grain && l.field.dataType !== void 0 && !["date", "datetime", "unknown"].includes(l.field.dataType) && g(t, [a, d, "grain"], "Grain requires a temporal field.");
1567
1580
  });
1568
1581
  const i = [
1569
1582
  ...e.rows,
@@ -1580,9 +1593,9 @@ function bt(e, t) {
1580
1593
  t,
1581
1594
  [a.id],
1582
1595
  "Aggregate-stage calculations cannot be grouped or wrapped in an aggregate."
1583
- ), X(a.field.derivedField, t, [a.id]);
1584
- for (const s of Object.values(a.field.derivedField.inputs))
1585
- P(s.field.source, e.source, t, [a.id, "inputs"]);
1596
+ ), J(a.field.derivedField, t, [a.id]);
1597
+ for (const l of Object.values(a.field.derivedField.inputs))
1598
+ P(l.field.source, e.source, t, [a.id, "inputs"]);
1586
1599
  }
1587
1600
  for (const a of e.measures)
1588
1601
  if (a.kind === "calculated") {
@@ -1590,89 +1603,97 @@ function bt(e, t) {
1590
1603
  t,
1591
1604
  [a.id],
1592
1605
  "Calculated measures require aggregate stage and measure role."
1593
- ), X(a.definition, t, [a.id]);
1594
- for (const s of Object.values(a.definition.inputs))
1595
- P(s.field.source, e.source, t, [
1606
+ ), J(a.definition, t, [a.id]);
1607
+ for (const l of Object.values(a.definition.inputs))
1608
+ P(l.field.source, e.source, t, [
1596
1609
  a.id,
1597
1610
  "inputs"
1598
1611
  ]);
1599
1612
  }
1600
1613
  const o = (a) => {
1601
- const s = (l, d) => {
1602
- var c, p;
1603
- if ((l.aggregate || ((c = l.derivedField) == null ? void 0 : c.computeStage) === "aggregate") && g(t, d, "Aggregate/HAVING filters are not supported."), l.derivedField) {
1604
- X(l.derivedField, t, d);
1605
- for (const u of Object.values(l.derivedField.inputs))
1606
- P(u.field.source, e.source, t, d);
1614
+ const l = (d, c) => {
1615
+ var p, u;
1616
+ if ((d.aggregate || ((p = d.derivedField) == null ? void 0 : p.computeStage) === "aggregate") && g(t, c, "Aggregate/HAVING filters are not supported."), d.derivedField) {
1617
+ J(d.derivedField, t, c);
1618
+ for (const h of Object.values(d.derivedField.inputs))
1619
+ P(h.field.source, e.source, t, c);
1607
1620
  }
1608
- for (const u of ((p = l.calculatedFormula) == null ? void 0 : p.inputFields) ?? [])
1609
- s(u, d);
1621
+ for (const h of ((u = d.calculatedFormula) == null ? void 0 : u.inputFields) ?? [])
1622
+ l(h, c);
1610
1623
  };
1611
- for (const l of a.conditions)
1612
- s(l.field, ["filters", l.id]);
1624
+ for (const d of a.conditions)
1625
+ l(d.field, ["filters", d.id]);
1613
1626
  a.groups.forEach(o);
1614
1627
  };
1615
1628
  if (e.filters && o(e.filters), e.joinPlan) {
1616
1629
  const a = [
1617
1630
  e.joinPlan.baseEntity,
1618
- ...e.joinPlan.joins.flatMap((s) => [s.source, s.target])
1631
+ ...e.joinPlan.joins.flatMap((l) => [l.source, l.target])
1619
1632
  ];
1620
- (new Set(a.map((s) => s.connectionId)).size > 1 || e.source.kind === "physical" && a[0].connectionId !== e.source.connectionId) && g(t, ["joinPlan"], "Joins must stay within the source connection."), A(
1621
- e.joinPlan.joins.map((s) => s.id),
1633
+ (new Set(a.map((l) => l.connectionId)).size > 1 || e.source.kind === "physical" && a[0].connectionId !== e.source.connectionId) && g(t, ["joinPlan"], "Joins must stay within the source connection."), k(
1634
+ e.joinPlan.joins.map((l) => l.id),
1622
1635
  t,
1623
1636
  ["joinPlan", "joins"]
1624
1637
  );
1625
1638
  }
1626
- yt(e, e.sorts, t, ["sorts"]), e.rankings.forEach((a, s) => {
1627
- (!e[a.axis].some((l) => l.id === a.levelId) || !e.measures.some((l) => l.id === a.measureId)) && g(t, ["rankings", s], "Unknown ranking level or measure."), $(
1639
+ bt(e, e.sorts, t, ["sorts"]);
1640
+ const r = e.measureFilters ?? [];
1641
+ k(r.map((a) => a.id), t, ["measureFilters"]), k(
1642
+ r.map((a) => JSON.stringify([a.axis, a.levelId])),
1643
+ t,
1644
+ ["measureFilters"]
1645
+ ), r.forEach((a, l) => {
1646
+ (!e[a.axis].some((d) => d.id === a.levelId) || !e.measures.some((d) => d.id === a.measureId)) && g(t, ["measureFilters", l], "Unknown measure filter level or measure.");
1647
+ }), e.rankings.forEach((a, l) => {
1648
+ (!e[a.axis].some((d) => d.id === a.levelId) || !e.measures.some((d) => d.id === a.measureId)) && g(t, ["rankings", l], "Unknown ranking level or measure."), $(
1628
1649
  e,
1629
1650
  a.axis === "rows" ? "columns" : "rows",
1630
1651
  a.oppositePath,
1631
1652
  t,
1632
- ["rankings", s, "oppositePath"],
1653
+ ["rankings", l, "oppositePath"],
1633
1654
  !0
1634
1655
  );
1635
1656
  });
1636
1657
  }
1637
- const C = ht.superRefine(bt), nn = ht.extend({
1638
- rows: n.array(ne).readonly(),
1639
- measures: n.array(ft).readonly()
1640
- }), an = nn.superRefine(bt), on = C.innerType().extend({ kind: n.literal("matrix") }), sn = on.superRefine(({ kind: e, ...t }, i) => {
1658
+ const C = _t.superRefine(vt), on = _t.extend({
1659
+ rows: n.array(oe).readonly(),
1660
+ measures: n.array(gt).readonly()
1661
+ }), sn = on.superRefine(vt), rn = C.innerType().extend({ kind: n.literal("matrix") }), ln = rn.superRefine(({ kind: e, ...t }, i) => {
1641
1662
  const o = C.safeParse(t);
1642
- o.success || o.error.issues.forEach((a) => i.addIssue(a));
1643
- }), rn = "{member}", Me = n.object({
1663
+ o.success || o.error.issues.forEach((r) => i.addIssue(r));
1664
+ }), dn = "{member}", Re = n.object({
1644
1665
  visible: n.boolean(),
1645
1666
  position: n.enum(["before", "after"]),
1646
1667
  /** As written; a subtotal's `{member}` becomes its member's name. */
1647
1668
  label: n.string().optional()
1648
- }).strict(), Re = n.object({
1649
- grand: Me,
1650
- levels: n.record(S, Me).readonly(),
1669
+ }).strict(), Te = n.object({
1670
+ grand: Re,
1671
+ levels: n.record(v, Re).readonly(),
1651
1672
  /**
1652
1673
  * Skip a subtotal that only repeats one row: an expanded group with
1653
1674
  * exactly one child shows no subtotal. Off when absent.
1654
1675
  */
1655
1676
  skipRedundant: n.boolean().optional()
1656
- }).strict(), Te = ct.shape.rules.element, ln = ct.extend({
1657
- rules: n.array(Te.extend({
1658
- target: Te.shape.target.extend({
1659
- rowRoles: n.array(bi).optional()
1677
+ }).strict(), Ee = pt.shape.rules.element, un = pt.extend({
1678
+ rules: n.array(Ee.extend({
1679
+ target: Ee.shape.target.extend({
1680
+ rowRoles: n.array(vi).optional()
1660
1681
  })
1661
1682
  }))
1662
1683
  }).superRefine((e, t) => {
1663
1684
  var i;
1664
- A(e.rules.map((o) => o.id), t, ["rules"]);
1685
+ k(e.rules.map((o) => o.id), t, ["rules"]);
1665
1686
  for (const o of e.rules) {
1666
- const a = o.condition;
1667
- a.kind === "topBottom" && g(
1687
+ const r = o.condition;
1688
+ r.kind === "topBottom" && g(
1668
1689
  t,
1669
1690
  ["rules", o.id],
1670
1691
  "Relative highlighting is deferred."
1671
- ), (a.kind === "dataBar" || a.kind === "colorScale") && ((a.range !== "manual" || a.min === void 0 || a.max === void 0 || a.min >= a.max) && g(
1692
+ ), (r.kind === "dataBar" || r.kind === "colorScale") && ((r.range !== "manual" || r.min === void 0 || r.max === void 0 || r.min >= r.max) && g(
1672
1693
  t,
1673
1694
  ["rules", o.id],
1674
1695
  "Explicit increasing range endpoints are required."
1675
- ), a.kind === "colorScale" && a.mid !== void 0 && (a.mid <= a.min || a.mid >= a.max) && g(
1696
+ ), r.kind === "colorScale" && r.mid !== void 0 && (r.mid <= r.min || r.mid >= r.max) && g(
1676
1697
  t,
1677
1698
  ["rules", o.id],
1678
1699
  "Midpoint must be inside the range."
@@ -1683,97 +1704,97 @@ const C = ht.superRefine(bt), nn = ht.extend({
1683
1704
  );
1684
1705
  }
1685
1706
  });
1686
- function dn(e, t, i, o, a = []) {
1687
- for (const s of e.rules) {
1688
- const l = [...a, "rules", s.id], d = s.target.matrix;
1689
- d && (d.levelId !== void 0 && !t[d.axis].some((c) => c.id === d.levelId) && g(o, [...l, "target", "matrix", "levelId"], "Conditional-format level is not on the selected axis."), d.oppositePath !== void 0 && $(t, d.axis === "rows" ? "columns" : "rows", d.oppositePath, o, [...l, "target", "matrix", "oppositePath"])), qi(s).validationRefs.some((c) => !i.has(c)) && g(o, l, "Conditional rules must reference displayed measures.");
1707
+ function cn(e, t, i, o, r = []) {
1708
+ for (const a of e.rules) {
1709
+ const l = [...r, "rules", a.id], d = a.target.matrix;
1710
+ d && (d.levelId !== void 0 && !t[d.axis].some((c) => c.id === d.levelId) && g(o, [...l, "target", "matrix", "levelId"], "Conditional-format level is not on the selected axis."), d.oppositePath !== void 0 && $(t, d.axis === "rows" ? "columns" : "rows", d.oppositePath, o, [...l, "target", "matrix", "oppositePath"])), Ui(a).validationRefs.some((c) => !i.has(c)) && g(o, l, "Conditional rules must reference displayed measures.");
1690
1711
  }
1691
1712
  }
1692
- const un = {
1713
+ const pn = {
1693
1714
  layout: n.discriminatedUnion("kind", [
1694
1715
  n.object({ kind: n.literal("compact") }).strict(),
1695
1716
  n.object({ kind: n.literal("tabular"), repeatLabels: n.boolean() }).strict()
1696
1717
  ]),
1697
1718
  absence: n.object({ emptyText: n.string(), nullText: n.string() }).strict(),
1698
- levelLabels: n.record(S, n.string()).readonly(),
1699
- measureLabels: n.record(S, n.string()).readonly(),
1700
- levelFormats: n.record(S, ke).readonly(),
1701
- measureFormats: n.record(S, ke).readonly(),
1702
- totals: n.object({ rows: Re, columns: Re }).strict(),
1703
- conditionalFormatting: ln.optional()
1704
- }, _e = n.object(un).strict(), cn = n.object({
1719
+ levelLabels: n.record(v, n.string()).readonly(),
1720
+ measureLabels: n.record(v, n.string()).readonly(),
1721
+ levelFormats: n.record(v, ke).readonly(),
1722
+ measureFormats: n.record(v, ke).readonly(),
1723
+ totals: n.object({ rows: Te, columns: Te }).strict(),
1724
+ conditionalFormatting: un.optional()
1725
+ }, ye = n.object(pn).strict(), mn = n.object({
1705
1726
  depth: n.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
1706
1727
  overrides: n.array(
1707
- n.object({ path: F, expanded: n.boolean() }).strict()
1728
+ n.object({ path: x, expanded: n.boolean() }).strict()
1708
1729
  ).readonly()
1709
- }).strict(), Ee = cn.superRefine(
1710
- (e, t) => A(
1711
- e.overrides.map((i) => tt(i.path)),
1730
+ }).strict(), Ne = mn.superRefine(
1731
+ (e, t) => k(
1732
+ e.overrides.map((i) => it(i.path)),
1712
1733
  t,
1713
1734
  ["overrides"]
1714
1735
  )
1715
- ), pn = { rows: Ee, columns: Ee }, G = n.object(pn).strict(), mn = G.extend({ sorts: n.array(gt).readonly() }).strict(), fn = mn.superRefine(
1716
- (e, t) => A(e.sorts.map(_t), t, ["sorts"])
1736
+ ), fn = { rows: Ne, columns: Ne }, z = n.object(fn).strict(), gn = z.extend({ sorts: n.array(ht).readonly() }).strict(), hn = gn.superRefine(
1737
+ (e, t) => k(e.sorts.map(yt), t, ["sorts"])
1717
1738
  );
1718
- function z(e, t) {
1739
+ function Q(e, t) {
1719
1740
  var c, p;
1720
- const { spec: i, presentation: o, defaults: a, session: s } = e, l = new Set([...i.rows, ...i.columns].map((u) => u.id)), d = new Set(i.measures.map((u) => u.id));
1741
+ const { spec: i, presentation: o, defaults: r, session: a } = e, l = new Set([...i.rows, ...i.columns].map((u) => u.id)), d = new Set(i.measures.map((u) => u.id));
1721
1742
  for (const u of [
1722
1743
  "levelLabels",
1723
1744
  "levelFormats",
1724
1745
  "measureLabels",
1725
1746
  "measureFormats"
1726
1747
  ]) {
1727
- const _ = u.startsWith("level") ? l : d;
1748
+ const h = u.startsWith("level") ? l : d;
1728
1749
  for (const y of Object.keys(o[u]))
1729
- _.has(y) || g(
1750
+ h.has(y) || g(
1730
1751
  t,
1731
1752
  ["presentation", u, y],
1732
1753
  "Unknown presentation reference."
1733
1754
  );
1734
1755
  }
1735
- for (const [u, _] of Object.entries(o.measureFormats))
1736
- _.type === "temporal_bucket" && g(
1756
+ for (const [u, h] of Object.entries(o.measureFormats))
1757
+ h.type === "temporal_bucket" && g(
1737
1758
  t,
1738
1759
  ["presentation", "measureFormats", u],
1739
1760
  "Measures cannot own temporal bucket formats."
1740
1761
  );
1741
- for (const [u, _] of Object.entries(o.levelFormats))
1742
- _.type === "temporal_bucket" && !((c = [...i.rows, ...i.columns].find((y) => y.id === u)) != null && c.grain) && g(
1762
+ for (const [u, h] of Object.entries(o.levelFormats))
1763
+ h.type === "temporal_bucket" && !((c = [...i.rows, ...i.columns].find((y) => y.id === u)) != null && c.grain) && g(
1743
1764
  t,
1744
1765
  ["presentation", "levelFormats", u],
1745
1766
  "Temporal bucket formats require a grain."
1746
1767
  );
1747
1768
  for (const u of ["rows", "columns"]) {
1748
1769
  (p = o.totals[u].grand.label) != null && p.includes(
1749
- rn
1770
+ dn
1750
1771
  ) && g(
1751
1772
  t,
1752
1773
  ["presentation", "totals", u, "grand", "label"],
1753
1774
  "The grand total has no member, so its label cannot use {member}."
1754
1775
  );
1755
- const _ = Object.keys(o.totals[u].levels);
1756
- (_.length !== i[u].length || _.some((y) => !i[u].some((I) => I.id === y))) && g(
1776
+ const h = Object.keys(o.totals[u].levels);
1777
+ (h.length !== i[u].length || h.some((y) => !i[u].some((S) => S.id === y))) && g(
1757
1778
  t,
1758
1779
  ["presentation", "totals", u],
1759
1780
  "Subtotal map must contain exactly the current axis levels."
1760
1781
  );
1761
- for (const y of [a, ...s ? [s] : []])
1762
- for (const I of y[u].overrides)
1782
+ for (const y of [r, ...a ? [a] : []])
1783
+ for (const S of y[u].overrides)
1763
1784
  $(
1764
1785
  i,
1765
1786
  u,
1766
- I.path,
1787
+ S.path,
1767
1788
  t,
1768
1789
  [u, "overrides"],
1769
1790
  !0
1770
- ), I.path.length || g(
1791
+ ), S.path.length || g(
1771
1792
  t,
1772
1793
  [u, "overrides"],
1773
1794
  "Use depth to expand/collapse the root."
1774
1795
  );
1775
1796
  }
1776
- s && yt(i, s.sorts, t, ["session", "sorts"]), o.conditionalFormatting && dn(
1797
+ a && bt(i, a.sorts, t, ["session", "sorts"]), o.conditionalFormatting && cn(
1777
1798
  o.conditionalFormatting,
1778
1799
  i,
1779
1800
  d,
@@ -1781,32 +1802,32 @@ function z(e, t) {
1781
1802
  ["presentation", "conditionalFormatting"]
1782
1803
  );
1783
1804
  }
1784
- const gn = n.object({
1805
+ const _n = n.object({
1785
1806
  spec: C,
1786
- presentation: _e,
1787
- defaults: G,
1788
- session: fn.optional()
1789
- }).strict(), xa = gn.superRefine(z), hn = n.object({
1807
+ presentation: ye,
1808
+ defaults: z,
1809
+ session: hn.optional()
1810
+ }).strict(), Da = _n.superRefine(Q), yn = n.object({
1790
1811
  version: n.literal(1),
1791
1812
  spec: C,
1792
- presentation: _e,
1793
- defaultView: G
1794
- }).strict(), _n = hn.superRefine(
1795
- (e, t) => z({ ...e, defaults: e.defaultView }, t)
1796
- ), yn = _n.innerType().extend({
1797
- spec: an
1798
- }), Fa = yn.superRefine((e, t) => z({ ...e, defaults: e.defaultView }, t)), Ne = n.object({ spec: C, presentation: _e }).strict(), bn = n.union([
1799
- Ne.extend({
1813
+ presentation: ye,
1814
+ defaultView: z
1815
+ }).strict(), bn = yn.superRefine(
1816
+ (e, t) => Q({ ...e, defaults: e.defaultView }, t)
1817
+ ), vn = bn.innerType().extend({
1818
+ spec: sn
1819
+ }), Ma = vn.superRefine((e, t) => Q({ ...e, defaults: e.defaultView }, t)), $e = n.object({ spec: C, presentation: ye }).strict(), In = n.union([
1820
+ $e.extend({
1800
1821
  mode: n.literal("layout"),
1801
1822
  format: n.enum(["csv", "xlsx", "pdf"]),
1802
1823
  expansion: n.union([
1803
- G.extend({ kind: n.literal("current") }).strict(),
1824
+ z.extend({ kind: n.literal("current") }).strict(),
1804
1825
  n.object({ kind: n.literal("all") }).strict()
1805
1826
  ])
1806
1827
  }).strict(),
1807
- Ne.extend({ mode: n.literal("flat"), format: n.enum(["csv", "xlsx"]) }).strict()
1808
- ]), Da = bn.superRefine(
1809
- (e, t) => z(
1828
+ $e.extend({ mode: n.literal("flat"), format: n.enum(["csv", "xlsx"]) }).strict()
1829
+ ]), Ra = In.superRefine(
1830
+ (e, t) => Q(
1810
1831
  {
1811
1832
  ...e,
1812
1833
  defaults: e.mode === "layout" && e.expansion.kind === "current" ? e.expansion : {
@@ -1817,29 +1838,29 @@ const gn = n.object({
1817
1838
  t
1818
1839
  )
1819
1840
  );
1820
- function Ma(e) {
1841
+ function Ta(e) {
1821
1842
  return e && "id" in e ? e.id : void 0;
1822
1843
  }
1823
- const vn = "SUM";
1824
- function w(e) {
1844
+ const Sn = "SUM";
1845
+ function A(e) {
1825
1846
  return typeof e == "string" && e.trim().length > 0;
1826
1847
  }
1827
1848
  function E(e) {
1828
- return w(e) ? e.trim().toLowerCase() : "";
1849
+ return A(e) ? e.trim().toLowerCase() : "";
1829
1850
  }
1830
- function Ra(e) {
1831
- const t = w(e.id) ? e.id.trim() : void 0;
1851
+ function Ea(e) {
1852
+ const t = A(e.id) ? e.id.trim() : void 0;
1832
1853
  if (!t) return;
1833
- const i = E(t), o = w(e.table) ? e.table.trim() : void 0;
1854
+ const i = E(t), o = A(e.table) ? e.table.trim() : void 0;
1834
1855
  if (!(i === E(e.name) || o && i === E(o)))
1835
1856
  return t;
1836
1857
  }
1837
1858
  function D(e) {
1838
- const t = w(e.datasetId) ? e.datasetId.trim() : void 0;
1859
+ const t = A(e.datasetId) ? e.datasetId.trim() : void 0;
1839
1860
  if (t)
1840
1861
  return E(t) === E(e.datasetName) ? void 0 : t;
1841
1862
  }
1842
- function vt(e) {
1863
+ function It(e) {
1843
1864
  if (e.kind !== "semantic") return e;
1844
1865
  const t = D(e), { datasetId: i, ...o } = e;
1845
1866
  return {
@@ -1847,10 +1868,10 @@ function vt(e) {
1847
1868
  ...t ? { datasetId: t } : {}
1848
1869
  };
1849
1870
  }
1850
- function Ta(e) {
1851
- return e ? e.kind === "semantic" ? !!(w(e.domainId) && (w(e.datasetId) || w(e.datasetName))) : e.kind === "physical" ? w(e.connectionId) && w(e.tableName) : w(e.connectionId) : !1;
1871
+ function Na(e) {
1872
+ return e ? e.kind === "semantic" ? !!(A(e.domainId) && (A(e.datasetId) || A(e.datasetName))) : e.kind === "physical" ? A(e.connectionId) && A(e.tableName) : A(e.connectionId) : !1;
1852
1873
  }
1853
- function ae(e) {
1874
+ function se(e) {
1854
1875
  if (!e)
1855
1876
  return "";
1856
1877
  if (e.kind === "semantic") {
@@ -1874,7 +1895,7 @@ function ae(e) {
1874
1895
  e.label || ""
1875
1896
  ].join(":");
1876
1897
  }
1877
- function ye(e, t) {
1898
+ function be(e, t) {
1878
1899
  if (!e || !t)
1879
1900
  return e === t;
1880
1901
  if (e.kind !== t.kind)
@@ -1885,10 +1906,10 @@ function ye(e, t) {
1885
1906
  const i = D(e), o = D(t);
1886
1907
  return i && o ? i === o : e.datasetName === t.datasetName;
1887
1908
  }
1888
- return ae(e) === ae(t);
1909
+ return se(e) === se(t);
1889
1910
  }
1890
- function It(e, t) {
1891
- return e.kind !== "semantic" || t.kind !== "semantic" ? e : vt({
1911
+ function St(e, t) {
1912
+ return e.kind !== "semantic" || t.kind !== "semantic" ? e : It({
1892
1913
  ...e,
1893
1914
  datasetName: e.datasetName || t.datasetName,
1894
1915
  datasetId: D(e) || D(t),
@@ -1896,79 +1917,79 @@ function It(e, t) {
1896
1917
  connectionId: e.connectionId || t.connectionId
1897
1918
  });
1898
1919
  }
1899
- function Ea(e) {
1920
+ function $a(e) {
1900
1921
  const t = [];
1901
1922
  for (const i of e) {
1902
- const o = vt(
1923
+ const o = It(
1903
1924
  i
1904
- ), a = t.findIndex(
1905
- (s) => ye(s, o)
1925
+ ), r = t.findIndex(
1926
+ (a) => be(a, o)
1906
1927
  );
1907
- if (a === -1) {
1928
+ if (r === -1) {
1908
1929
  t.push(o);
1909
1930
  continue;
1910
1931
  }
1911
- t[a] = It(
1912
- t[a],
1932
+ t[r] = St(
1933
+ t[r],
1913
1934
  o
1914
1935
  );
1915
1936
  }
1916
1937
  return t;
1917
1938
  }
1918
- function In(e, t) {
1919
- return e.name === t.name && ye(e.source, t.source);
1939
+ function wn(e, t) {
1940
+ return e.name === t.name && be(e.source, t.source);
1920
1941
  }
1921
- function Na(e) {
1942
+ function ja(e) {
1922
1943
  return [
1923
- e.source ? ae(e.source) : "unknown",
1924
- St(e),
1944
+ e.source ? se(e.source) : "unknown",
1945
+ wt(e),
1925
1946
  e.name
1926
1947
  ].filter(Boolean).join(":");
1927
1948
  }
1928
- function St(e) {
1929
- return Sn(
1930
- e.aggregate || vn
1949
+ function wt(e) {
1950
+ return kn(
1951
+ e.aggregate || Sn
1931
1952
  );
1932
1953
  }
1933
- function Sn(e) {
1954
+ function kn(e) {
1934
1955
  return e.trim().toUpperCase();
1935
1956
  }
1936
- function $a(e, t) {
1957
+ function Ca(e, t) {
1937
1958
  return {
1938
1959
  ...e,
1939
1960
  label: e.label || t.label,
1940
1961
  role: e.role || t.role,
1941
1962
  dataType: e.dataType || t.dataType,
1942
- source: e.source && t.source ? It(e.source, t.source) : e.source || t.source
1963
+ source: e.source && t.source ? St(e.source, t.source) : e.source || t.source
1943
1964
  };
1944
1965
  }
1945
- function kn(e) {
1966
+ function An(e) {
1946
1967
  for (let t = 0; t < e.length; t += 1) {
1947
1968
  const i = e[t];
1948
1969
  if (e.some(
1949
- (o, a) => a !== t && wt(o, i)
1970
+ (o, r) => r !== t && At(o, i)
1950
1971
  ))
1951
1972
  return !1;
1952
1973
  }
1953
1974
  return !0;
1954
1975
  }
1955
1976
  function kt(e, t) {
1956
- return In(e, t);
1977
+ return wn(e, t);
1957
1978
  }
1958
- function wt(e, t) {
1979
+ function At(e, t) {
1959
1980
  return kt(e, t) && j(e) === j(t);
1960
1981
  }
1961
- function wn(e) {
1982
+ function Fn(e) {
1962
1983
  return `Metric intent has duplicate measure "${e.name}" with the same aggregate (${j(e)}). Use different aggregates to request both, or remove one entry.`;
1963
1984
  }
1964
- function $e(e) {
1985
+ function je(e) {
1965
1986
  return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
1966
1987
  }
1967
- function An(e, t, i) {
1988
+ function xn(e, t, i) {
1968
1989
  if (e !== void 0) {
1969
1990
  if (!e || typeof e != "object" || Array.isArray(e)) {
1970
1991
  i.push(
1971
- r(
1992
+ s(
1972
1993
  "invalid_sql_default_parameters",
1973
1994
  "SQL defaultParameters must be an object keyed by parameter name.",
1974
1995
  t
@@ -1976,10 +1997,10 @@ function An(e, t, i) {
1976
1997
  );
1977
1998
  return;
1978
1999
  }
1979
- Object.entries(e).forEach(([o, a]) => {
2000
+ Object.entries(e).forEach(([o, r]) => {
1980
2001
  if (!o.trim()) {
1981
2002
  i.push(
1982
- r(
2003
+ s(
1983
2004
  "invalid_sql_default_parameter_name",
1984
2005
  "SQL defaultParameters names must be non-empty strings.",
1985
2006
  `${t}.${o}`
@@ -1987,8 +2008,8 @@ function An(e, t, i) {
1987
2008
  );
1988
2009
  return;
1989
2010
  }
1990
- (Array.isArray(a) ? a.every($e) : $e(a)) || i.push(
1991
- r(
2011
+ (Array.isArray(r) ? r.every(je) : je(r)) || i.push(
2012
+ s(
1992
2013
  "invalid_sql_default_parameter_value",
1993
2014
  "SQL defaultParameters values must be strings, numbers, booleans, nulls, or arrays of those scalar values.",
1994
2015
  `${t}.${o}`
@@ -1997,72 +2018,72 @@ function An(e, t, i) {
1997
2018
  });
1998
2019
  }
1999
2020
  }
2000
- function xn(e, t) {
2001
- return be(e, t).length === 1;
2021
+ function Dn(e, t) {
2022
+ return ve(e, t).length === 1;
2002
2023
  }
2003
- function Fn(e, t) {
2004
- return be(e, t).length === 1;
2024
+ function Mn(e, t) {
2025
+ return ve(e, t).length === 1;
2005
2026
  }
2006
- function be(e, t) {
2027
+ function ve(e, t) {
2007
2028
  return t.filter(
2008
- (o) => Dn(e, o)
2029
+ (o) => Rn(e, o)
2009
2030
  );
2010
2031
  }
2011
- function Dn(e, t) {
2012
- return Mn(e, t) ? e.source ? kt(t, e) : !0 : !1;
2032
+ function Rn(e, t) {
2033
+ return Tn(e, t) ? e.source ? kt(t, e) : !0 : !1;
2013
2034
  }
2014
- function Mn(e, t) {
2015
- return !(t.name !== e.name || e.role !== void 0 && t.role !== void 0 && t.role !== e.role || Rn(e, t) && j(t) !== j(e));
2035
+ function Tn(e, t) {
2036
+ return !(t.name !== e.name || e.role !== void 0 && t.role !== void 0 && t.role !== e.role || En(e, t) && j(t) !== j(e));
2016
2037
  }
2017
- function Rn(e, t) {
2038
+ function En(e, t) {
2018
2039
  return e.role === "measure" || t.role === "measure" || e.aggregate !== void 0 || t.aggregate !== void 0;
2019
2040
  }
2020
2041
  function j(e) {
2021
- return St(e);
2042
+ return wt(e);
2022
2043
  }
2023
- const Tn = /^(\d{4})-(\d{2})-(\d{2})$/, At = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|[+-]\d{2}:\d{2})$/;
2024
- function oe(e) {
2044
+ const Nn = /^(\d{4})-(\d{2})-(\d{2})$/, Ft = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|[+-]\d{2}:\d{2})$/;
2045
+ function re(e) {
2025
2046
  if (typeof e != "string")
2026
2047
  return null;
2027
- const t = e.trim(), i = Tn.exec(t);
2048
+ const t = e.trim(), i = Nn.exec(t);
2028
2049
  if (i) {
2029
- const [, y, I, h] = i;
2030
- return je(y, I, h) ? new Date(Date.UTC(Number(y), Number(I) - 1, Number(h))) : null;
2050
+ const [, y, S, _] = i;
2051
+ return Ce(y, S, _) ? new Date(Date.UTC(Number(y), Number(S) - 1, Number(_))) : null;
2031
2052
  }
2032
- const o = At.exec(t);
2053
+ const o = Ft.exec(t);
2033
2054
  if (!o)
2034
2055
  return null;
2035
- const [, a, s, l, d, c, p = "00", , u] = o;
2036
- if (!je(a, s, l) || !N(d, 0, 23) || !N(c, 0, 59) || !N(p, 0, 59) || !En(u))
2056
+ const [, r, a, l, d, c, p = "00", , u] = o;
2057
+ if (!Ce(r, a, l) || !N(d, 0, 23) || !N(c, 0, 59) || !N(p, 0, 59) || !$n(u))
2037
2058
  return null;
2038
- const _ = new Date(t);
2039
- return Number.isFinite(_.getTime()) ? _ : null;
2059
+ const h = new Date(t);
2060
+ return Number.isFinite(h.getTime()) ? h : null;
2040
2061
  }
2041
- function ja(e) {
2042
- return typeof e != "string" || !At.test(e.trim()) ? null : oe(e);
2062
+ function Oa(e) {
2063
+ return typeof e != "string" || !Ft.test(e.trim()) ? null : re(e);
2043
2064
  }
2044
- function je(e, t, i) {
2045
- const o = Number(e), a = Number(t), s = Number(i);
2046
- if (!Number.isInteger(o) || !Number.isInteger(a) || !Number.isInteger(s) || a < 1 || a > 12)
2065
+ function Ce(e, t, i) {
2066
+ const o = Number(e), r = Number(t), a = Number(i);
2067
+ if (!Number.isInteger(o) || !Number.isInteger(r) || !Number.isInteger(a) || r < 1 || r > 12)
2047
2068
  return !1;
2048
- const l = new Date(Date.UTC(o, a - 1, s));
2049
- return l.getUTCFullYear() === o && l.getUTCMonth() === a - 1 && l.getUTCDate() === s;
2069
+ const l = new Date(Date.UTC(o, r - 1, a));
2070
+ return l.getUTCFullYear() === o && l.getUTCMonth() === r - 1 && l.getUTCDate() === a;
2050
2071
  }
2051
2072
  function N(e, t, i) {
2052
2073
  const o = Number(e);
2053
2074
  return Number.isInteger(o) && o >= t && o <= i;
2054
2075
  }
2055
- function En(e) {
2076
+ function $n(e) {
2056
2077
  if (e === "Z")
2057
2078
  return !0;
2058
2079
  const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
2059
2080
  return !!(t && N(t[2], 0, 23) && N(t[3], 0, 59));
2060
2081
  }
2061
- function Ce(e, t, i) {
2082
+ function Oe(e, t, i) {
2062
2083
  if (e !== void 0) {
2063
2084
  if (!f(e)) {
2064
2085
  i.push(
2065
- r(
2086
+ s(
2066
2087
  "invalid_pagination",
2067
2088
  "Pagination must be an object with positive integer page and pageSize.",
2068
2089
  t
@@ -2071,13 +2092,13 @@ function Ce(e, t, i) {
2071
2092
  return;
2072
2093
  }
2073
2094
  (!Number.isInteger(e.page) || typeof e.page != "number" || e.page < 1) && i.push(
2074
- r(
2095
+ s(
2075
2096
  "invalid_pagination_page",
2076
2097
  "Pagination page must be a positive integer.",
2077
2098
  `${t}.page`
2078
2099
  )
2079
2100
  ), (!Number.isInteger(e.pageSize) || typeof e.pageSize != "number" || e.pageSize < 1) && i.push(
2080
- r(
2101
+ s(
2081
2102
  "invalid_pagination_page_size",
2082
2103
  "Pagination pageSize must be a positive integer.",
2083
2104
  `${t}.pageSize`
@@ -2085,7 +2106,7 @@ function Ce(e, t, i) {
2085
2106
  );
2086
2107
  }
2087
2108
  }
2088
- function Oe(e) {
2109
+ function Ye(e) {
2089
2110
  const t = /* @__PURE__ */ new Set();
2090
2111
  for (const i of e) {
2091
2112
  if (t.has(i))
@@ -2094,10 +2115,10 @@ function Oe(e) {
2094
2115
  }
2095
2116
  return null;
2096
2117
  }
2097
- function Nn(e, t, i) {
2118
+ function jn(e, t, i) {
2098
2119
  if (!f(e)) {
2099
2120
  i.push(
2100
- r(
2121
+ s(
2101
2122
  "invalid_input_binding",
2102
2123
  "Input bindings must be structured objects.",
2103
2124
  t
@@ -2106,27 +2127,27 @@ function Nn(e, t, i) {
2106
2127
  return;
2107
2128
  }
2108
2129
  m(e.inputId) || i.push(
2109
- r(
2130
+ s(
2110
2131
  "invalid_input_binding",
2111
2132
  "Input bindings need a non-empty inputId.",
2112
2133
  `${t}.inputId`
2113
2134
  )
2114
2135
  ), e.kind !== void 0 && e.kind !== "filter" && e.kind !== "control" && i.push(
2115
- r(
2136
+ s(
2116
2137
  "invalid_input_binding",
2117
2138
  "Input binding kind must be filter or control.",
2118
2139
  `${t}.kind`
2119
2140
  )
2120
- ), e.field !== void 0 && b(e.field, `${t}.field`, i), e.relationshipHint !== void 0 && ve(
2141
+ ), e.field !== void 0 && b(e.field, `${t}.field`, i), e.relationshipHint !== void 0 && Ie(
2121
2142
  e.relationshipHint,
2122
2143
  `${t}.relationshipHint`,
2123
2144
  i
2124
2145
  );
2125
2146
  }
2126
- function ve(e, t, i) {
2147
+ function Ie(e, t, i) {
2127
2148
  if (!f(e)) {
2128
2149
  i.push(
2129
- r(
2150
+ s(
2130
2151
  "invalid_relationship_hint",
2131
2152
  "Relationship hints must be structured objects.",
2132
2153
  t
@@ -2135,39 +2156,39 @@ function ve(e, t, i) {
2135
2156
  return;
2136
2157
  }
2137
2158
  e.relationshipIds !== void 0 && (!Array.isArray(e.relationshipIds) || e.relationshipIds.some((o) => !m(o))) && i.push(
2138
- r(
2159
+ s(
2139
2160
  "invalid_relationship_hint",
2140
2161
  "Relationship hint relationshipIds must be non-empty strings.",
2141
2162
  `${t}.relationshipIds`
2142
2163
  )
2143
2164
  );
2144
2165
  }
2145
- function $n(e, t) {
2146
- var o, a;
2147
- if (((o = e.source) == null ? void 0 : o.kind) !== "semantic" && ((a = e.source) == null ? void 0 : a.kind) !== "physical" && t.push(
2148
- r(
2166
+ function Cn(e, t) {
2167
+ var o, r;
2168
+ if (((o = e.source) == null ? void 0 : o.kind) !== "semantic" && ((r = e.source) == null ? void 0 : r.kind) !== "physical" && t.push(
2169
+ s(
2149
2170
  "invalid_input_options_source",
2150
2171
  "Input options must use a semantic or physical source.",
2151
2172
  "source"
2152
2173
  )
2153
2174
  ), m(e.inputId) || t.push(
2154
- r(
2175
+ s(
2155
2176
  "missing_input_options_input_id",
2156
2177
  "Input options intent needs the inputId it populates.",
2157
2178
  "inputId"
2158
2179
  )
2159
2180
  ), e.search !== void 0 && typeof e.search != "string" && t.push(
2160
- r(
2181
+ s(
2161
2182
  "invalid_input_options_search",
2162
2183
  "Input options search must be a string.",
2163
2184
  "search"
2164
2185
  )
2165
2186
  ), e.matchValues !== void 0) {
2166
- const s = jt(e.matchValues);
2167
- s.ok || t.push(
2168
- r("invalid_input_options_match_values", s.error, "matchValues")
2187
+ const a = Ct(e.matchValues);
2188
+ a.ok || t.push(
2189
+ s("invalid_input_options_match_values", a.error, "matchValues")
2169
2190
  ), typeof e.search == "string" && e.search.trim() && t.push(
2170
- r(
2191
+ s(
2171
2192
  "invalid_input_options_match_values",
2172
2193
  "Input options matchValues cannot be combined with search.",
2173
2194
  "matchValues"
@@ -2175,13 +2196,13 @@ function $n(e, t) {
2175
2196
  );
2176
2197
  }
2177
2198
  if (e.limit !== void 0 && (typeof e.limit != "number" || !Number.isFinite(e.limit) || !Number.isInteger(e.limit) || e.limit <= 0) && t.push(
2178
- r(
2199
+ s(
2179
2200
  "invalid_input_options_limit",
2180
2201
  "Input options limit must be a positive finite number.",
2181
2202
  "limit"
2182
2203
  )
2183
2204
  ), (!e.labelField || !m(e.labelField.name)) && t.push(
2184
- r(
2205
+ s(
2185
2206
  "missing_input_options_label_field",
2186
2207
  "Input options intent needs a labelField.",
2187
2208
  "labelField"
@@ -2189,7 +2210,7 @@ function $n(e, t) {
2189
2210
  ), b(e.labelField, "labelField", t, {
2190
2211
  required: !0
2191
2212
  }), (!e.valueField || !m(e.valueField.name)) && t.push(
2192
- r(
2213
+ s(
2193
2214
  "missing_input_options_value_field",
2194
2215
  "Input options intent needs a valueField.",
2195
2216
  "valueField"
@@ -2198,12 +2219,12 @@ function $n(e, t) {
2198
2219
  required: !0
2199
2220
  }), e.searchField !== void 0 && b(e.searchField, "searchField", t, {
2200
2221
  required: !0
2201
- }), e.disambiguationFields !== void 0 && (Array.isArray(e.disambiguationFields) ? e.disambiguationFields.forEach((s, l) => {
2202
- b(s, `disambiguationFields.${l}`, t, {
2222
+ }), e.disambiguationFields !== void 0 && (Array.isArray(e.disambiguationFields) ? e.disambiguationFields.forEach((a, l) => {
2223
+ b(a, `disambiguationFields.${l}`, t, {
2203
2224
  required: !0
2204
2225
  });
2205
2226
  }) : t.push(
2206
- r(
2227
+ s(
2207
2228
  "invalid_input_options_disambiguation_fields",
2208
2229
  "Input options disambiguationFields must be an array of field refs.",
2209
2230
  "disambiguationFields"
@@ -2212,71 +2233,71 @@ function $n(e, t) {
2212
2233
  { field: e.labelField, path: "labelField" },
2213
2234
  { field: e.valueField, path: "valueField" },
2214
2235
  ...e.searchField ? [{ field: e.searchField, path: "searchField" }] : [],
2215
- ...Array.isArray(e.disambiguationFields) ? e.disambiguationFields.map((s, l) => ({
2216
- field: s,
2236
+ ...Array.isArray(e.disambiguationFields) ? e.disambiguationFields.map((a, l) => ({
2237
+ field: a,
2217
2238
  path: `disambiguationFields.${l}`
2218
2239
  })) : []
2219
- ].forEach(({ field: s, path: l }) => {
2220
- s != null && s.source && !ye(s.source, e.source) && t.push(
2221
- r(
2240
+ ].forEach(({ field: a, path: l }) => {
2241
+ a != null && a.source && !be(a.source, e.source) && t.push(
2242
+ s(
2222
2243
  "input_options_field_source_mismatch",
2223
2244
  "Input option fields must belong to the declared option source.",
2224
2245
  `${l}.source`
2225
2246
  )
2226
2247
  );
2227
2248
  }), e.dependencies !== void 0) {
2228
- const s = Cn(
2249
+ const a = Yn(
2229
2250
  e.dependencies
2230
2251
  );
2231
- t.push(...s.errors), s.ok && Yn(e, t);
2252
+ t.push(...a.errors), a.ok && Bn(e, t);
2232
2253
  }
2233
2254
  if (e.population !== void 0) {
2234
- const s = e.population;
2235
- if (!f(s))
2255
+ const a = e.population;
2256
+ if (!f(a))
2236
2257
  t.push(
2237
- r(
2258
+ s(
2238
2259
  "invalid_input_options_population",
2239
2260
  "Input options population must be a structured object.",
2240
2261
  "population"
2241
2262
  )
2242
2263
  );
2243
2264
  else {
2244
- const l = s.kind;
2265
+ const l = a.kind;
2245
2266
  l !== "option_source" && l !== "related_population" && t.push(
2246
- r(
2267
+ s(
2247
2268
  "invalid_input_options_population",
2248
2269
  "Input options population kind must be option_source or related_population.",
2249
2270
  "population.kind"
2250
2271
  )
2251
- ), l === "option_source" && s.baseSource !== void 0 && t.push(
2252
- r(
2272
+ ), l === "option_source" && a.baseSource !== void 0 && t.push(
2273
+ s(
2253
2274
  "invalid_input_options_population",
2254
2275
  "Input options population baseSource is only valid for related_population.",
2255
2276
  "population.baseSource"
2256
2277
  )
2257
- ), l === "option_source" && s.relationshipHint !== void 0 && t.push(
2258
- r(
2278
+ ), l === "option_source" && a.relationshipHint !== void 0 && t.push(
2279
+ s(
2259
2280
  "invalid_input_options_population",
2260
2281
  "Input options population relationshipHint is only valid for related_population.",
2261
2282
  "population.relationshipHint"
2262
2283
  )
2263
- ), l === "related_population" && (le(
2264
- s.baseSource,
2284
+ ), l === "related_population" && (ue(
2285
+ a.baseSource,
2265
2286
  "population.baseSource",
2266
2287
  t
2267
- ), s.relationshipHint !== void 0 && ve(
2268
- s.relationshipHint,
2288
+ ), a.relationshipHint !== void 0 && Ie(
2289
+ a.relationshipHint,
2269
2290
  "population.relationshipHint",
2270
2291
  t
2271
2292
  ));
2272
2293
  }
2273
2294
  }
2274
2295
  }
2275
- function jn(e, t) {
2296
+ function On(e, t) {
2276
2297
  if (!(!("inputs" in e) || e.inputs === void 0)) {
2277
2298
  if (!Array.isArray(e.inputs)) {
2278
2299
  t.push(
2279
- r(
2300
+ s(
2280
2301
  "invalid_input_binding",
2281
2302
  "Analytics intent inputs must be an array of input bindings.",
2282
2303
  "inputs"
@@ -2285,104 +2306,104 @@ function jn(e, t) {
2285
2306
  return;
2286
2307
  }
2287
2308
  e.inputs.forEach(
2288
- (i, o) => Nn(i, `inputs.${o}`, t)
2309
+ (i, o) => jn(i, `inputs.${o}`, t)
2289
2310
  );
2290
2311
  }
2291
2312
  }
2292
- function Cn(e, t = "protocol") {
2313
+ function Yn(e, t = "protocol") {
2293
2314
  const i = [];
2294
2315
  if (!f(e))
2295
2316
  return i.push(
2296
- r(
2317
+ s(
2297
2318
  "invalid_input_options_dependencies",
2298
2319
  "Input options dependencies must be a structured object.",
2299
2320
  "dependencies"
2300
2321
  )
2301
2322
  ), { ok: !1, errors: i, warnings: [] };
2302
- const o = e, a = o.mode;
2303
- if (a !== void 0 && a !== "independent" && a !== "explicit" && a !== "all_applicable" && i.push(
2304
- r(
2323
+ const o = e, r = o.mode;
2324
+ if (r !== void 0 && r !== "independent" && r !== "explicit" && r !== "all_applicable" && i.push(
2325
+ s(
2305
2326
  "invalid_input_options_dependencies",
2306
2327
  "Input options dependencies mode must be independent, explicit, or all_applicable.",
2307
2328
  "dependencies.mode"
2308
2329
  )
2309
- ), Z(
2330
+ ), W(
2310
2331
  o.includeInputIds,
2311
2332
  "dependencies.includeInputIds",
2312
2333
  i,
2313
2334
  "Input options includeInputIds must be non-empty strings."
2314
- ), Z(
2335
+ ), W(
2315
2336
  o.excludeInputIds,
2316
2337
  "dependencies.excludeInputIds",
2317
2338
  i,
2318
2339
  "Input options excludeInputIds must be non-empty strings."
2319
- ), a === "all_applicable" && o.includeInputIds !== void 0 && i.push(
2320
- r(
2340
+ ), r === "all_applicable" && o.includeInputIds !== void 0 && i.push(
2341
+ s(
2321
2342
  "invalid_input_options_dependencies",
2322
2343
  "All applicable dependencies cannot specify includeInputIds.",
2323
2344
  "dependencies.includeInputIds"
2324
2345
  )
2325
- ), Z(
2346
+ ), W(
2326
2347
  o.omitInputIds,
2327
2348
  "dependencies.omitInputIds",
2328
2349
  i,
2329
2350
  "Input options omitInputIds must be non-empty strings."
2330
2351
  ), Array.isArray(o.omitInputIds)) {
2331
- const s = new Set(
2352
+ const a = new Set(
2332
2353
  Array.isArray(o.includeInputIds) ? o.includeInputIds : []
2333
2354
  );
2334
- (a !== "explicit" || new Set(o.omitInputIds).size !== o.omitInputIds.length || o.omitInputIds.some((l) => !s.has(l))) && i.push(
2335
- r(
2355
+ (r !== "explicit" || new Set(o.omitInputIds).size !== o.omitInputIds.length || o.omitInputIds.some((l) => !a.has(l))) && i.push(
2356
+ s(
2336
2357
  "invalid_input_options_dependencies",
2337
2358
  "A browse override may only omit unique ids from an explicit includeInputIds list.",
2338
2359
  "dependencies.omitInputIds"
2339
2360
  )
2340
2361
  );
2341
2362
  }
2342
- return t === "dashboard" && On(o, i), { ok: i.length === 0, errors: i, warnings: [] };
2363
+ return t === "dashboard" && Pn(o, i), { ok: i.length === 0, errors: i, warnings: [] };
2343
2364
  }
2344
- function On(e, t) {
2345
- const { mode: i, includeInputIds: o, excludeInputIds: a } = e;
2365
+ function Pn(e, t) {
2366
+ const { mode: i, includeInputIds: o, excludeInputIds: r } = e;
2346
2367
  i === void 0 && t.push(
2347
- r(
2368
+ s(
2348
2369
  "invalid_input_options_dependencies",
2349
2370
  "Dashboard option dependencies must declare a mode.",
2350
2371
  "dependencies.mode"
2351
2372
  )
2352
2373
  );
2353
- for (const [s, l] of [
2374
+ for (const [a, l] of [
2354
2375
  ["dependencies.includeInputIds", o],
2355
- ["dependencies.excludeInputIds", a]
2376
+ ["dependencies.excludeInputIds", r]
2356
2377
  ])
2357
2378
  Array.isArray(l) && new Set(l).size !== l.length && t.push(
2358
- r(
2379
+ s(
2359
2380
  "invalid_input_options_dependencies",
2360
2381
  "Dashboard option dependency input IDs must be unique.",
2361
- s
2382
+ a
2362
2383
  )
2363
2384
  );
2364
- i === "independent" && (o !== void 0 || a !== void 0) && t.push(
2365
- r(
2385
+ i === "independent" && (o !== void 0 || r !== void 0) && t.push(
2386
+ s(
2366
2387
  "invalid_input_options_dependencies",
2367
2388
  "Independent dashboard dependencies cannot specify input IDs.",
2368
2389
  "dependencies"
2369
2390
  )
2370
- ), i === "explicit" && (!Array.isArray(o) || o.length === 0 || a !== void 0) && t.push(
2371
- r(
2391
+ ), i === "explicit" && (!Array.isArray(o) || o.length === 0 || r !== void 0) && t.push(
2392
+ s(
2372
2393
  "invalid_input_options_dependencies",
2373
2394
  "Explicit dashboard dependencies require included input IDs and cannot specify exclusions.",
2374
2395
  "dependencies"
2375
2396
  )
2376
2397
  );
2377
2398
  }
2378
- function Yn(e, t) {
2379
- var a, s, l;
2399
+ function Bn(e, t) {
2400
+ var r, a, l;
2380
2401
  const i = new Set(
2381
2402
  Array.isArray(e.inputs) ? e.inputs.map((d) => f(d) ? d.inputId : void 0).filter((d) => typeof d == "string") : []
2382
- ), o = new Set(((a = e.dependencies) == null ? void 0 : a.omitInputIds) || []);
2383
- for (const d of ((s = e.dependencies) == null ? void 0 : s.includeInputIds) || [])
2403
+ ), o = new Set(((r = e.dependencies) == null ? void 0 : r.omitInputIds) || []);
2404
+ for (const d of ((a = e.dependencies) == null ? void 0 : a.includeInputIds) || [])
2384
2405
  !i.has(d) && !o.has(d) && t.push(
2385
- r(
2406
+ s(
2386
2407
  "invalid_input_options_dependencies",
2387
2408
  `Input options dependency "${d}" is not declared in inputs.`,
2388
2409
  "dependencies.includeInputIds"
@@ -2390,21 +2411,21 @@ function Yn(e, t) {
2390
2411
  );
2391
2412
  for (const d of ((l = e.dependencies) == null ? void 0 : l.excludeInputIds) || [])
2392
2413
  d !== e.inputId && !i.has(d) && t.push(
2393
- r(
2414
+ s(
2394
2415
  "invalid_input_options_dependencies",
2395
2416
  `Input options dependency exclusion "${d}" is not the populated inputId and is not declared in inputs.`,
2396
2417
  "dependencies.excludeInputIds"
2397
2418
  )
2398
2419
  );
2399
2420
  }
2400
- function Z(e, t, i, o) {
2401
- e !== void 0 && (!Array.isArray(e) || e.some((a) => !m(a))) && i.push(r("invalid_input_options_dependencies", o, t));
2421
+ function W(e, t, i, o) {
2422
+ e !== void 0 && (!Array.isArray(e) || e.some((r) => !m(r))) && i.push(s("invalid_input_options_dependencies", o, t));
2402
2423
  }
2403
- const Pn = new Set(Ve);
2404
- function Bn(e, t, i) {
2424
+ const Ln = new Set(qe);
2425
+ function Vn(e, t, i) {
2405
2426
  if (f(e) && e.type === "temporal_bucket") {
2406
2427
  i.push(
2407
- r(
2428
+ s(
2408
2429
  "invalid_scalar_value_format",
2409
2430
  "Scalar and measure slots cannot own temporal bucket presentation; declare it with grain on a grouped field or axis.",
2410
2431
  t
@@ -2412,12 +2433,12 @@ function Bn(e, t, i) {
2412
2433
  );
2413
2434
  return;
2414
2435
  }
2415
- Ue(e, t, i);
2436
+ He(e, t, i);
2416
2437
  }
2417
- function Ye(e, t, i) {
2438
+ function Pe(e, t, i) {
2418
2439
  if (!f(e)) {
2419
2440
  i.push(
2420
- r(
2441
+ s(
2421
2442
  "invalid_result_column_ref",
2422
2443
  "Result calculation references must use columnKey or field.",
2423
2444
  t
@@ -2425,10 +2446,10 @@ function Ye(e, t, i) {
2425
2446
  );
2426
2447
  return;
2427
2448
  }
2428
- const o = m(e.columnKey), a = f(e.field);
2429
- if (o === a) {
2449
+ const o = m(e.columnKey), r = f(e.field);
2450
+ if (o === r) {
2430
2451
  i.push(
2431
- r(
2452
+ s(
2432
2453
  "invalid_result_column_ref",
2433
2454
  "Result calculation references must identify exactly one of columnKey or field.",
2434
2455
  t
@@ -2436,14 +2457,14 @@ function Ye(e, t, i) {
2436
2457
  );
2437
2458
  return;
2438
2459
  }
2439
- a && b(e.field, `${t}.field`, i, {
2460
+ r && b(e.field, `${t}.field`, i, {
2440
2461
  required: !0
2441
2462
  });
2442
2463
  }
2443
- function Ln(e, t, i) {
2464
+ function qn(e, t, i) {
2444
2465
  if (!f(e)) {
2445
2466
  i.push(
2446
- r(
2467
+ s(
2447
2468
  "invalid_result_calculation_output",
2448
2469
  "Result calculation output must be a structured object.",
2449
2470
  t
@@ -2452,25 +2473,25 @@ function Ln(e, t, i) {
2452
2473
  return;
2453
2474
  }
2454
2475
  m(e.key) || i.push(
2455
- r(
2476
+ s(
2456
2477
  "invalid_result_calculation_output",
2457
2478
  "Result calculation output needs a stable key.",
2458
2479
  `${t}.key`
2459
2480
  )
2460
- ), e.dataType !== void 0 && (typeof e.dataType != "string" || !qe.has(e.dataType)) && i.push(
2461
- r(
2481
+ ), e.dataType !== void 0 && (typeof e.dataType != "string" || !Ue.has(e.dataType)) && i.push(
2482
+ s(
2462
2483
  "invalid_result_calculation_output",
2463
2484
  "Result calculation output dataType must be string, number, boolean, date, datetime, or unknown.",
2464
2485
  `${t}.dataType`
2465
2486
  )
2466
- ), Bn(e.format, `${t}.format`, i);
2487
+ ), Vn(e.format, `${t}.format`, i);
2467
2488
  }
2468
- function Vn(e, t) {
2489
+ function Un(e, t) {
2469
2490
  if (e.analysis === void 0)
2470
2491
  return;
2471
2492
  if (!f(e.analysis)) {
2472
2493
  t.push(
2473
- r(
2494
+ s(
2474
2495
  "invalid_measure_analysis",
2475
2496
  "Metric analysis must be a structured object.",
2476
2497
  "analysis"
@@ -2480,7 +2501,7 @@ function Vn(e, t) {
2480
2501
  }
2481
2502
  if (e.analysis.kind !== "period_change") {
2482
2503
  t.push(
2483
- r(
2504
+ s(
2484
2505
  "invalid_measure_analysis",
2485
2506
  "Metric analysis kind is not supported.",
2486
2507
  "analysis.kind"
@@ -2489,65 +2510,65 @@ function Vn(e, t) {
2489
2510
  return;
2490
2511
  }
2491
2512
  e.dateField || t.push(
2492
- r(
2513
+ s(
2493
2514
  "missing_analysis_date_field",
2494
2515
  "Period-change analysis needs a dateField.",
2495
2516
  "dateField"
2496
2517
  )
2497
2518
  ), e.timeGrain || t.push(
2498
- r(
2519
+ s(
2499
2520
  "missing_analysis_time_grain",
2500
2521
  "Period-change analysis needs a timeGrain.",
2501
2522
  "timeGrain"
2502
2523
  )
2503
2524
  ), e.analysis.orderBy !== void 0 && e.analysis.orderBy !== "absolute_change" && e.analysis.orderBy !== "positive_change" && e.analysis.orderBy !== "negative_change" && e.analysis.orderBy !== "period" && t.push(
2504
- r(
2525
+ s(
2505
2526
  "invalid_measure_analysis",
2506
2527
  "Period-change analysis orderBy must be absolute_change, positive_change, negative_change, or period.",
2507
2528
  "analysis.orderBy"
2508
2529
  )
2509
2530
  );
2510
2531
  const { timeWindow: i } = e.analysis;
2511
- i !== void 0 && se(i, "analysis.timeWindow", t);
2532
+ i !== void 0 && le(i, "analysis.timeWindow", t);
2512
2533
  }
2513
- const qn = new Set(
2514
- Ct
2515
- ), Un = new Set(
2534
+ const Hn = new Set(
2516
2535
  Ot
2517
- ), Hn = new Set(
2536
+ ), Gn = new Set(
2518
2537
  Yt
2538
+ ), zn = new Set(
2539
+ Pt
2519
2540
  );
2520
- function Gn(e, t, i) {
2521
- qn.has(e.unit) || i.push(
2522
- r(
2541
+ function Qn(e, t, i) {
2542
+ Hn.has(e.unit) || i.push(
2543
+ s(
2523
2544
  "invalid_time_window",
2524
2545
  "Calendar time window unit must be one of: day, week, month, quarter, year.",
2525
2546
  `${t}.unit`
2526
2547
  )
2527
2548
  ), e.period !== "this" && e.period !== "previous" && i.push(
2528
- r(
2549
+ s(
2529
2550
  "invalid_time_window",
2530
2551
  "Calendar time window period must be this or previous.",
2531
2552
  `${t}.period`
2532
2553
  )
2533
2554
  ), e.toDate !== void 0 && typeof e.toDate != "boolean" ? i.push(
2534
- r(
2555
+ s(
2535
2556
  "invalid_time_window",
2536
2557
  "Calendar time window toDate must be a boolean.",
2537
2558
  `${t}.toDate`
2538
2559
  )
2539
2560
  ) : e.toDate === !0 && e.period !== "this" && i.push(
2540
- r(
2561
+ s(
2541
2562
  "invalid_time_window",
2542
2563
  "Calendar time window toDate is only allowed with period this.",
2543
2564
  `${t}.toDate`
2544
2565
  )
2545
2566
  );
2546
2567
  }
2547
- function se(e, t, i) {
2568
+ function le(e, t, i) {
2548
2569
  if (!f(e)) {
2549
2570
  i.push(
2550
- r(
2571
+ s(
2551
2572
  "invalid_time_window",
2552
2573
  "Time window must be a structured object.",
2553
2574
  t
@@ -2556,44 +2577,44 @@ function se(e, t, i) {
2556
2577
  return;
2557
2578
  }
2558
2579
  if (e.kind !== void 0 && e.kind !== "relative" && e.kind !== "calendar" && e.kind !== "absolute" && i.push(
2559
- r(
2580
+ s(
2560
2581
  "invalid_time_window",
2561
2582
  "Time window kind must be relative, calendar or absolute.",
2562
2583
  `${t}.kind`
2563
2584
  )
2564
2585
  ), e.kind === "calendar") {
2565
- Gn(e, t, i);
2586
+ Qn(e, t, i);
2566
2587
  return;
2567
2588
  }
2568
2589
  if (e.kind === "absolute") {
2569
2590
  if (m(e.start) || i.push(
2570
- r(
2591
+ s(
2571
2592
  "invalid_time_window",
2572
2593
  "Absolute time window start must be a non-empty ISO date or timestamp string.",
2573
2594
  `${t}.start`
2574
2595
  )
2575
2596
  ), m(e.end) || i.push(
2576
- r(
2597
+ s(
2577
2598
  "invalid_time_window",
2578
2599
  "Absolute time window end must be a non-empty ISO date or timestamp string.",
2579
2600
  `${t}.end`
2580
2601
  )
2581
2602
  ), m(e.start) && m(e.end)) {
2582
- const o = oe(e.start), a = oe(e.end);
2603
+ const o = re(e.start), r = re(e.end);
2583
2604
  o || i.push(
2584
- r(
2605
+ s(
2585
2606
  "invalid_time_window",
2586
2607
  "Absolute time window start must be a valid ISO date or timestamp.",
2587
2608
  `${t}.start`
2588
2609
  )
2589
- ), a || i.push(
2590
- r(
2610
+ ), r || i.push(
2611
+ s(
2591
2612
  "invalid_time_window",
2592
2613
  "Absolute time window end must be a valid ISO date or timestamp.",
2593
2614
  `${t}.end`
2594
2615
  )
2595
- ), o && a && o.getTime() > a.getTime() && i.push(
2596
- r(
2616
+ ), o && r && o.getTime() > r.getTime() && i.push(
2617
+ s(
2597
2618
  "invalid_time_window",
2598
2619
  "Absolute time window start must be before or equal to end.",
2599
2620
  t
@@ -2602,37 +2623,37 @@ function se(e, t, i) {
2602
2623
  }
2603
2624
  return;
2604
2625
  }
2605
- (typeof e.unit != "string" || !Pn.has(e.unit)) && i.push(
2606
- r(
2626
+ (typeof e.unit != "string" || !Ln.has(e.unit)) && i.push(
2627
+ s(
2607
2628
  "invalid_time_window",
2608
- `Time window unit must be one of: ${Ve.join(", ")}.`,
2629
+ `Time window unit must be one of: ${qe.join(", ")}.`,
2609
2630
  `${t}.unit`
2610
2631
  )
2611
2632
  ), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) && i.push(
2612
- r(
2633
+ s(
2613
2634
  "invalid_time_window",
2614
2635
  "Time window value must be a positive number.",
2615
2636
  `${t}.value`
2616
2637
  )
2617
- ), e.anchor !== void 0 && !Un.has(e.anchor) && i.push(
2618
- r(
2638
+ ), e.anchor !== void 0 && !Gn.has(e.anchor) && i.push(
2639
+ s(
2619
2640
  "invalid_time_window",
2620
2641
  "Time window anchor must be now or latest_available.",
2621
2642
  `${t}.anchor`
2622
2643
  )
2623
- ), e.completeness !== void 0 && !Hn.has(e.completeness) && i.push(
2624
- r(
2644
+ ), e.completeness !== void 0 && !zn.has(e.completeness) && i.push(
2645
+ s(
2625
2646
  "invalid_time_window",
2626
2647
  "Time window completeness must be include_partial or complete_periods.",
2627
2648
  `${t}.completeness`
2628
2649
  )
2629
2650
  );
2630
2651
  }
2631
- function re(e, t, i) {
2652
+ function de(e, t, i) {
2632
2653
  if (e !== void 0) {
2633
2654
  if (!Array.isArray(e)) {
2634
2655
  i.push(
2635
- r(
2656
+ s(
2636
2657
  "invalid_analytics_filters",
2637
2658
  "Analytics filters must be an array.",
2638
2659
  t
@@ -2640,64 +2661,64 @@ function re(e, t, i) {
2640
2661
  );
2641
2662
  return;
2642
2663
  }
2643
- e.forEach((o, a) => {
2664
+ e.forEach((o, r) => {
2644
2665
  var c;
2645
- const s = `${t}.${a}`;
2666
+ const a = `${t}.${r}`;
2646
2667
  if (!f(o)) {
2647
2668
  i.push(
2648
- r(
2669
+ s(
2649
2670
  "invalid_analytics_filter",
2650
2671
  "Analytics filter must be a structured object.",
2651
- s
2672
+ a
2652
2673
  )
2653
2674
  );
2654
2675
  return;
2655
2676
  }
2656
2677
  const l = o;
2657
- b(l.field, `${s}.field`, i, {
2678
+ b(l.field, `${a}.field`, i, {
2658
2679
  required: !0
2659
2680
  }), l.scope !== void 0 && l.scope !== "row" && l.scope !== "aggregate" && i.push(
2660
- r(
2681
+ s(
2661
2682
  "invalid_analytics_filter_scope",
2662
2683
  "Analytics filter scope must be row or aggregate.",
2663
- `${s}.scope`
2684
+ `${a}.scope`
2664
2685
  )
2665
2686
  ), l.scope === "aggregate" && ((c = l.field) == null ? void 0 : c.role) !== void 0 && l.field.role !== "measure" && i.push(
2666
- r(
2687
+ s(
2667
2688
  "invalid_analytics_filter_scope",
2668
2689
  "Aggregate-scope analytics filters must target a measure field.",
2669
- `${s}.scope`
2690
+ `${a}.scope`
2670
2691
  )
2671
2692
  );
2672
2693
  const d = l.operator === "is_null" || l.operator === "is_not_null";
2673
2694
  if (l.operator !== void 0 && l.operator !== "=" && l.operator !== "!=" && l.operator !== "in" && l.operator !== "not_in" && l.operator !== "contains" && l.operator !== "not_contains" && l.operator !== "between" && l.operator !== "not_between" && l.operator !== ">" && l.operator !== ">=" && l.operator !== "<" && l.operator !== "<=" && l.operator !== "is_null" && l.operator !== "is_not_null" && i.push(
2674
- r(
2695
+ s(
2675
2696
  "invalid_analytics_filter_operator",
2676
2697
  "Analytics filter operator is not supported.",
2677
- `${s}.operator`
2698
+ `${a}.operator`
2678
2699
  )
2679
2700
  ), l.values === void 0 && !d && i.push(
2680
- r(
2701
+ s(
2681
2702
  "missing_analytics_filter_value",
2682
2703
  "Analytics filter needs values unless it is a null check.",
2683
- s
2704
+ a
2684
2705
  )
2685
2706
  ), d && l.values !== void 0) {
2686
2707
  i.push(
2687
- r(
2708
+ s(
2688
2709
  "invalid_analytics_filter_values",
2689
2710
  "Null-check analytics filters must not include values.",
2690
- `${s}.values`
2711
+ `${a}.values`
2691
2712
  )
2692
2713
  );
2693
2714
  return;
2694
2715
  }
2695
2716
  if (l.values !== void 0 && !Array.isArray(l.values)) {
2696
2717
  i.push(
2697
- r(
2718
+ s(
2698
2719
  "invalid_analytics_filter_values",
2699
2720
  "Analytics filter values must be an array when provided.",
2700
- `${s}.values`
2721
+ `${a}.values`
2701
2722
  )
2702
2723
  );
2703
2724
  return;
@@ -2706,68 +2727,68 @@ function re(e, t, i) {
2706
2727
  const p = l.values.length;
2707
2728
  if (l.operator === "between" || l.operator === "not_between") {
2708
2729
  p !== 2 && i.push(
2709
- r(
2730
+ s(
2710
2731
  "invalid_analytics_filter_values",
2711
2732
  "Between analytics filters must include exactly two values.",
2712
- `${s}.values`
2733
+ `${a}.values`
2713
2734
  )
2714
2735
  );
2715
2736
  return;
2716
2737
  }
2717
2738
  (l.operator === "contains" || l.operator === "not_contains" || l.operator === "=" || l.operator === "!=" || l.operator === ">" || l.operator === ">=" || l.operator === "<" || l.operator === "<=" || l.operator === void 0) && p !== 1 && i.push(
2718
- r(
2739
+ s(
2719
2740
  "invalid_analytics_filter_values",
2720
2741
  "Scalar analytics filters must include exactly one value. Use in/not_in for multiple values.",
2721
- `${s}.values`
2742
+ `${a}.values`
2722
2743
  )
2723
2744
  );
2724
2745
  }
2725
2746
  });
2726
2747
  }
2727
2748
  }
2728
- function Ca(e) {
2749
+ function Ya(e) {
2729
2750
  const t = [];
2730
2751
  if (!f(e))
2731
2752
  return t.push(
2732
- r(
2753
+ s(
2733
2754
  "invalid_result_calculation",
2734
2755
  "Result calculation must be a structured object."
2735
2756
  )
2736
2757
  ), { ok: !1, errors: t, warnings: [] };
2737
2758
  if (m(e.id) || t.push(
2738
- r(
2759
+ s(
2739
2760
  "invalid_result_calculation_id",
2740
2761
  "Result calculation needs an id.",
2741
2762
  "id"
2742
2763
  )
2743
2764
  ), m(e.label) || t.push(
2744
- r(
2765
+ s(
2745
2766
  "invalid_result_calculation_label",
2746
2767
  "Result calculation needs a label.",
2747
2768
  "label"
2748
2769
  )
2749
2770
  ), e.kind !== "percent_of_total" && e.kind !== "rank" && e.kind !== "running_total" && e.kind !== "previous_row_delta" && t.push(
2750
- r(
2771
+ s(
2751
2772
  "invalid_result_calculation_kind",
2752
2773
  "Result calculation kind must be percent_of_total, rank, running_total, or previous_row_delta.",
2753
2774
  "kind"
2754
2775
  )
2755
- ), Ye(e.input, "input", t), Ln(e.output, "output", t), e.kind === "percent_of_total") {
2776
+ ), Pe(e.input, "input", t), qn(e.output, "output", t), e.kind === "percent_of_total") {
2756
2777
  const i = e.denominator;
2757
2778
  i !== void 0 && (f(i) ? i.scope === "population" ? (b(i.metric, "denominator.metric", t, {
2758
2779
  required: !0
2759
- }), re(
2780
+ }), de(
2760
2781
  i.filters,
2761
2782
  "denominator.filters",
2762
2783
  t
2763
2784
  )) : i.scope !== "returned_result" && t.push(
2764
- r(
2785
+ s(
2765
2786
  "invalid_result_calculation_denominator",
2766
2787
  "Percent-of-total denominator scope must be returned_result or population.",
2767
2788
  "denominator.scope"
2768
2789
  )
2769
2790
  ) : t.push(
2770
- r(
2791
+ s(
2771
2792
  "invalid_result_calculation_denominator",
2772
2793
  "Percent-of-total denominator must be a structured object.",
2773
2794
  "denominator"
@@ -2775,12 +2796,12 @@ function Ca(e) {
2775
2796
  ));
2776
2797
  }
2777
2798
  return e.kind === "rank" && e.order !== void 0 && e.order !== "asc" && e.order !== "desc" && t.push(
2778
- r(
2799
+ s(
2779
2800
  "invalid_result_calculation_order",
2780
2801
  "Rank result calculation order must be asc or desc.",
2781
2802
  "order"
2782
2803
  )
2783
- ), (e.kind === "running_total" || e.kind === "previous_row_delta") && e.orderBy !== void 0 && Ye(e.orderBy, "orderBy", t), { ok: t.length === 0, errors: t, warnings: [] };
2804
+ ), (e.kind === "running_total" || e.kind === "previous_row_delta") && e.orderBy !== void 0 && Pe(e.orderBy, "orderBy", t), { ok: t.length === 0, errors: t, warnings: [] };
2784
2805
  }
2785
2806
  function xt(e) {
2786
2807
  var o;
@@ -2789,7 +2810,7 @@ function xt(e) {
2789
2810
  return {
2790
2811
  ok: !1,
2791
2812
  errors: [
2792
- r(
2813
+ s(
2793
2814
  "invalid_analytics_intent",
2794
2815
  "Analytics intent must be a structured object."
2795
2816
  )
@@ -2803,101 +2824,101 @@ function xt(e) {
2803
2824
  ]
2804
2825
  };
2805
2826
  if (e.kind === "matrix") {
2806
- const a = sn.safeParse(e);
2807
- return a.success || t.push(...a.error.issues.map((s) => r("invalid_matrix_intent", s.message, s.path.join(".")))), { ok: t.length === 0, errors: t, warnings: i, repairHints: Pe(t) };
2827
+ const r = ln.safeParse(e);
2828
+ return r.success || t.push(...r.error.issues.map((a) => s("invalid_matrix_intent", a.message, a.path.join(".")))), { ok: t.length === 0, errors: t, warnings: i, repairHints: Be(t) };
2808
2829
  }
2809
2830
  if (e.version !== void 0 && e.version !== 1 && t.push(
2810
- r(
2831
+ s(
2811
2832
  "invalid_version",
2812
2833
  "Analytics intent version must be 1.",
2813
2834
  "version"
2814
2835
  )
2815
- ), le(e.source, "source", t), zn(e, t), jn(e, t), "relationshipHint" in e && e.relationshipHint !== void 0 && ve(
2836
+ ), ue(e.source, "source", t), Kn(e, t), On(e, t), "relationshipHint" in e && e.relationshipHint !== void 0 && Ie(
2816
2837
  e.relationshipHint,
2817
2838
  "relationshipHint",
2818
2839
  t
2819
2840
  ), e.kind === "metric") {
2820
- const a = Array.isArray(e.measures) ? e.measures.filter(
2821
- (s) => f(s) && m(s.name)
2841
+ const r = Array.isArray(e.measures) ? e.measures.filter(
2842
+ (a) => f(a) && m(a.name)
2822
2843
  ) : [];
2823
2844
  if (!Array.isArray(e.measures) || e.measures.length === 0 ? t.push(
2824
- r(
2845
+ s(
2825
2846
  "missing_measure",
2826
2847
  "Metric intent needs at least one measure.",
2827
2848
  "measures"
2828
2849
  )
2829
2850
  ) : e.measures.some(
2830
- (s) => !f(s) || !m(s.name)
2851
+ (a) => !f(a) || !m(a.name)
2831
2852
  ) && t.push(
2832
- r(
2853
+ s(
2833
2854
  "invalid_measure_list",
2834
2855
  "Metric intent measures must be an array of field references with names.",
2835
2856
  "measures"
2836
2857
  )
2837
- ), a.forEach((s, l) => {
2838
- b(s, `measures.${l}`, t, {
2858
+ ), r.forEach((a, l) => {
2859
+ b(a, `measures.${l}`, t, {
2839
2860
  required: !0
2840
2861
  });
2841
- }), a.length > 0 && !kn(a)) {
2842
- const s = a.find(
2843
- (l, d) => a.some(
2844
- (c, p) => p !== d && wt(c, l)
2862
+ }), r.length > 0 && !An(r)) {
2863
+ const a = r.find(
2864
+ (l, d) => r.some(
2865
+ (c, p) => p !== d && At(c, l)
2845
2866
  )
2846
2867
  );
2847
- s && t.push(
2848
- r(
2868
+ a && t.push(
2869
+ s(
2849
2870
  "duplicate_measure",
2850
- wn(s),
2871
+ Fn(a),
2851
2872
  "measures"
2852
2873
  )
2853
2874
  );
2854
2875
  }
2855
- if (f(e.primaryMeasure) && m(e.primaryMeasure.name) && be(
2876
+ if (f(e.primaryMeasure) && m(e.primaryMeasure.name) && ve(
2856
2877
  e.primaryMeasure,
2857
- a
2878
+ r
2858
2879
  ).length > 1 && t.push(
2859
- r(
2880
+ s(
2860
2881
  "ambiguous_primary_measure",
2861
2882
  "Metric intent primaryMeasure must identify exactly one selected measure.",
2862
2883
  "primaryMeasure"
2863
2884
  )
2864
2885
  ), e.primaryMeasure !== void 0 && (b(e.primaryMeasure, "primaryMeasure", t, {
2865
2886
  required: !0
2866
- }), f(e.primaryMeasure) && m(e.primaryMeasure.name) && a.length > 0 && !xn(
2887
+ }), f(e.primaryMeasure) && m(e.primaryMeasure.name) && r.length > 0 && !Dn(
2867
2888
  e.primaryMeasure,
2868
- a
2889
+ r
2869
2890
  ) && t.push(
2870
- r(
2891
+ s(
2871
2892
  "invalid_primary_measure",
2872
2893
  "Metric intent primaryMeasure must match one measure field reference.",
2873
2894
  "primaryMeasure"
2874
2895
  )
2875
2896
  )), e.dimensions !== void 0 && !Array.isArray(e.dimensions) ? t.push(
2876
- r(
2897
+ s(
2877
2898
  "invalid_measure_dimensions",
2878
2899
  "Metric intent dimensions must be an array of field references.",
2879
2900
  "dimensions"
2880
2901
  )
2881
2902
  ) : Array.isArray(e.dimensions) && e.dimensions.some(
2882
- (s) => !f(s) || !m(s.name)
2903
+ (a) => !f(a) || !m(a.name)
2883
2904
  ) && t.push(
2884
- r(
2905
+ s(
2885
2906
  "invalid_measure_dimensions",
2886
2907
  "Metric intent dimensions must be an array of field references with names.",
2887
2908
  "dimensions"
2888
2909
  )
2889
- ), e.dateField !== void 0 && b(e.dateField, "dateField", t), e.timeWindow !== void 0 && (se(e.timeWindow, "timeWindow", t), e.dateField || t.push(
2890
- r(
2910
+ ), e.dateField !== void 0 && b(e.dateField, "dateField", t), e.timeWindow !== void 0 && (le(e.timeWindow, "timeWindow", t), e.dateField || t.push(
2911
+ s(
2891
2912
  "missing_time_window_date_field",
2892
2913
  "Metric timeWindow needs a dateField.",
2893
2914
  "dateField"
2894
2915
  )
2895
- )), re(e.filters, "filters", t), Array.isArray(e.dimensions) && e.dimensions.forEach((s, l) => {
2896
- b(s, `dimensions.${l}`, t);
2916
+ )), de(e.filters, "filters", t), Array.isArray(e.dimensions) && e.dimensions.forEach((a, l) => {
2917
+ b(a, `dimensions.${l}`, t);
2897
2918
  }), e.orderBy !== void 0) {
2898
2919
  if (!f(e.orderBy))
2899
2920
  t.push(
2900
- r(
2921
+ s(
2901
2922
  "invalid_measure_order_by",
2902
2923
  "Metric intent orderBy must be a structured object.",
2903
2924
  "orderBy"
@@ -2906,24 +2927,24 @@ function xt(e) {
2906
2927
  else if (b(e.orderBy.field, "orderBy.field", t, {
2907
2928
  required: !0
2908
2929
  }), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && t.push(
2909
- r(
2930
+ s(
2910
2931
  "invalid_measure_order_direction",
2911
2932
  "Metric intent orderBy direction must be asc or desc.",
2912
2933
  "orderBy.direction"
2913
2934
  )
2914
2935
  ), f(e.orderBy.field) && m(e.orderBy.field.name)) {
2915
- const s = [
2916
- ...a,
2936
+ const a = [
2937
+ ...r,
2917
2938
  ...e.timeGrain && e.dateField && f(e.dateField) ? [e.dateField] : [],
2918
2939
  ...Array.isArray(e.dimensions) ? e.dimensions.filter(
2919
2940
  (l) => f(l) && m(l.name)
2920
2941
  ) : []
2921
2942
  ];
2922
- s.length > 0 && !Fn(
2943
+ a.length > 0 && !Mn(
2923
2944
  e.orderBy.field,
2924
- s
2945
+ a
2925
2946
  ) && t.push(
2926
- r(
2947
+ s(
2927
2948
  "invalid_measure_order_by",
2928
2949
  "Metric intent orderBy.field must match one selected measure, grouped dateField, or dimension.",
2929
2950
  "orderBy.field"
@@ -2931,48 +2952,48 @@ function xt(e) {
2931
2952
  );
2932
2953
  }
2933
2954
  }
2934
- Vn(e, t);
2955
+ Un(e, t);
2935
2956
  } else if (e.kind === "records") {
2936
2957
  if (!Array.isArray(e.fields) || e.fields.length === 0 ? t.push(
2937
- r(
2958
+ s(
2938
2959
  "missing_record_fields",
2939
2960
  "Records intent needs at least one field.",
2940
2961
  "fields"
2941
2962
  )
2942
2963
  ) : e.fields.some(
2943
- (a) => !f(a) || !m(a.name)
2964
+ (r) => !f(r) || !m(r.name)
2944
2965
  ) && t.push(
2945
- r(
2966
+ s(
2946
2967
  "invalid_record_fields",
2947
2968
  "Records intent fields must be field references with names.",
2948
2969
  "fields"
2949
2970
  )
2950
- ), Array.isArray(e.fields) && e.fields.forEach((a, s) => {
2951
- b(a, `fields.${s}`, t);
2952
- }), e.dateField !== void 0 && b(e.dateField, "dateField", t), Ce(e.pagination, "pagination", t), e.timeWindow !== void 0 && (se(e.timeWindow, "timeWindow", t), e.dateField || t.push(
2953
- r(
2971
+ ), Array.isArray(e.fields) && e.fields.forEach((r, a) => {
2972
+ b(r, `fields.${a}`, t);
2973
+ }), e.dateField !== void 0 && b(e.dateField, "dateField", t), Oe(e.pagination, "pagination", t), e.timeWindow !== void 0 && (le(e.timeWindow, "timeWindow", t), e.dateField || t.push(
2974
+ s(
2954
2975
  "missing_time_window_date_field",
2955
2976
  "Records timeWindow needs a dateField.",
2956
2977
  "dateField"
2957
2978
  )
2958
- )), re(e.filters, "filters", t), Array.isArray(e.filters) && e.filters.forEach((a, s) => {
2959
- f(a) && a.scope === "aggregate" && t.push(
2960
- r(
2979
+ )), de(e.filters, "filters", t), Array.isArray(e.filters) && e.filters.forEach((r, a) => {
2980
+ f(r) && r.scope === "aggregate" && t.push(
2981
+ s(
2961
2982
  "unsupported_record_filter_scope",
2962
2983
  "Records intents support row-scope filters only. Use a metric intent for aggregate-scope filters.",
2963
- `filters.${s}.scope`
2984
+ `filters.${a}.scope`
2964
2985
  )
2965
2986
  );
2966
2987
  }), e.orderBy !== void 0 && (f(e.orderBy) ? (b(e.orderBy.field, "orderBy.field", t, {
2967
2988
  required: !0
2968
2989
  }), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && t.push(
2969
- r(
2990
+ s(
2970
2991
  "invalid_record_order_direction",
2971
2992
  "Records intent orderBy direction must be asc or desc.",
2972
2993
  "orderBy.direction"
2973
2994
  )
2974
2995
  )) : t.push(
2975
- r(
2996
+ s(
2976
2997
  "invalid_record_order_by",
2977
2998
  "Records intent orderBy must be a structured object.",
2978
2999
  "orderBy"
@@ -2980,7 +3001,7 @@ function xt(e) {
2980
3001
  )), e.totals !== void 0)
2981
3002
  if (!f(e.totals))
2982
3003
  t.push(
2983
- r(
3004
+ s(
2984
3005
  "invalid_records_totals",
2985
3006
  "Records totals must be a structured server totals request.",
2986
3007
  "totals"
@@ -2988,24 +3009,24 @@ function xt(e) {
2988
3009
  );
2989
3010
  else {
2990
3011
  e.totals.mode !== "server" && t.push(
2991
- r(
3012
+ s(
2992
3013
  "invalid_records_totals",
2993
3014
  "Records totals mode must be server.",
2994
3015
  "totals.mode"
2995
3016
  )
2996
3017
  );
2997
- const a = e.totals.measures;
2998
- !Array.isArray(a) || a.length === 0 ? t.push(
2999
- r(
3018
+ const r = e.totals.measures;
3019
+ !Array.isArray(r) || r.length === 0 ? t.push(
3020
+ s(
3000
3021
  "missing_records_totals_measures",
3001
3022
  "Records server totals need at least one measure.",
3002
3023
  "totals.measures"
3003
3024
  )
3004
- ) : a.forEach((s, l) => {
3005
- b(s, `totals.measures.${l}`, t, {
3025
+ ) : r.forEach((a, l) => {
3026
+ b(a, `totals.measures.${l}`, t, {
3006
3027
  required: !0
3007
- }), (!f(s) || s.role !== "measure") && t.push(
3008
- r(
3028
+ }), (!f(a) || a.role !== "measure") && t.push(
3029
+ s(
3009
3030
  "invalid_records_totals_measure",
3010
3031
  "Records server totals measures must be measure field references.",
3011
3032
  `totals.measures.${l}.role`
@@ -3013,22 +3034,22 @@ function xt(e) {
3013
3034
  );
3014
3035
  });
3015
3036
  }
3016
- } else e.kind === "inputOptions" ? $n(e, t) : e.kind === "sql" ? (((o = e.source) == null ? void 0 : o.kind) !== "sql" && t.push(
3017
- r(
3037
+ } else e.kind === "inputOptions" ? Cn(e, t) : e.kind === "sql" ? (((o = e.source) == null ? void 0 : o.kind) !== "sql" && t.push(
3038
+ s(
3018
3039
  "invalid_sql_source",
3019
3040
  "SQL analytics intent must use a SQL execution source.",
3020
3041
  "source"
3021
3042
  )
3022
3043
  ), m(e.sql) || t.push(
3023
- r("missing_sql", "SQL analytics intent needs SQL text.", "sql")
3024
- ), An(
3044
+ s("missing_sql", "SQL analytics intent needs SQL text.", "sql")
3045
+ ), xn(
3025
3046
  e.defaultParameters,
3026
3047
  "defaultParameters",
3027
3048
  t
3028
- ), Array.isArray(e.fields) && e.fields.forEach((a, s) => {
3029
- b(a, `fields.${s}`, t);
3030
- }), Ce(e.pagination, "pagination", t)) : t.push(
3031
- r(
3049
+ ), Array.isArray(e.fields) && e.fields.forEach((r, a) => {
3050
+ b(r, `fields.${a}`, t);
3051
+ }), Oe(e.pagination, "pagination", t)) : t.push(
3052
+ s(
3032
3053
  "invalid_analytics_kind",
3033
3054
  "Analytics kind is not supported.",
3034
3055
  "kind"
@@ -3038,14 +3059,14 @@ function xt(e) {
3038
3059
  ok: t.length === 0,
3039
3060
  errors: t,
3040
3061
  warnings: i,
3041
- repairHints: Pe(t)
3062
+ repairHints: Be(t)
3042
3063
  };
3043
3064
  }
3044
- function zn(e, t) {
3065
+ function Kn(e, t) {
3045
3066
  if (!(!("derivedFields" in e) || e.derivedFields === void 0)) {
3046
3067
  if (!Array.isArray(e.derivedFields)) {
3047
3068
  t.push(
3048
- r(
3069
+ s(
3049
3070
  "invalid_derived_fields",
3050
3071
  "Analytics intent derivedFields must be an array of derived field definitions.",
3051
3072
  "derivedFields"
@@ -3054,24 +3075,24 @@ function zn(e, t) {
3054
3075
  return;
3055
3076
  }
3056
3077
  e.derivedFields.forEach((i, o) => {
3057
- ue(
3078
+ pe(
3058
3079
  i
3059
- ).errors.forEach((s) => {
3080
+ ).errors.forEach((a) => {
3060
3081
  t.push({
3061
- ...s,
3062
- path: s.path ? `derivedFields.${o}.${s.path}` : `derivedFields.${o}`
3082
+ ...a,
3083
+ path: a.path ? `derivedFields.${o}.${a.path}` : `derivedFields.${o}`
3063
3084
  });
3064
3085
  });
3065
3086
  });
3066
3087
  }
3067
3088
  }
3068
- function Qn(e) {
3089
+ function Xn(e) {
3069
3090
  const t = [], i = [];
3070
3091
  if (!e || typeof e != "object")
3071
3092
  return {
3072
3093
  ok: !1,
3073
3094
  errors: [
3074
- r(
3095
+ s(
3075
3096
  "invalid_operation_intent",
3076
3097
  "Operation intent must be a structured object."
3077
3098
  )
@@ -3085,36 +3106,36 @@ function Qn(e) {
3085
3106
  ]
3086
3107
  };
3087
3108
  if (e.version !== 1 && t.push(
3088
- r(
3109
+ s(
3089
3110
  "invalid_version",
3090
3111
  "Operation intent version must be 1.",
3091
3112
  "version"
3092
3113
  )
3093
3114
  ), e.kind === "answer_obligations")
3094
3115
  !Array.isArray(e.obligations) || e.obligations.length === 0 ? t.push(
3095
- r(
3116
+ s(
3096
3117
  "missing_obligations",
3097
3118
  "Answer-obligations operation intent needs at least one obligation.",
3098
3119
  "obligations"
3099
3120
  )
3100
- ) : e.obligations.forEach((o, a) => {
3121
+ ) : e.obligations.forEach((o, r) => {
3101
3122
  m(o.id) || t.push(
3102
- r(
3123
+ s(
3103
3124
  "missing_obligation_id",
3104
3125
  "Each analytics obligation needs an id.",
3105
- `obligations.${a}.id`
3126
+ `obligations.${r}.id`
3106
3127
  )
3107
3128
  ), m(o.prompt) || t.push(
3108
- r(
3129
+ s(
3109
3130
  "missing_obligation_prompt",
3110
3131
  "Each analytics obligation needs a prompt.",
3111
- `obligations.${a}.prompt`
3132
+ `obligations.${r}.prompt`
3112
3133
  )
3113
3134
  );
3114
3135
  });
3115
3136
  else if (e.kind === "dashboard_change") {
3116
3137
  if (m(e.instruction) || t.push(
3117
- r(
3138
+ s(
3118
3139
  "missing_instruction",
3119
3140
  "Change operation intent needs an instruction.",
3120
3141
  "instruction"
@@ -3127,7 +3148,7 @@ function Qn(e) {
3127
3148
  }
3128
3149
  } else
3129
3150
  t.push(
3130
- r(
3151
+ s(
3131
3152
  "invalid_operation_kind",
3132
3153
  "Operation intent kind is not supported.",
3133
3154
  "kind"
@@ -3137,16 +3158,16 @@ function Qn(e) {
3137
3158
  ok: t.length === 0,
3138
3159
  errors: t,
3139
3160
  warnings: i,
3140
- repairHints: Ft(t)
3161
+ repairHints: Dt(t)
3141
3162
  };
3142
3163
  }
3143
- function Oa(e) {
3164
+ function Pa(e) {
3144
3165
  const t = [], i = [];
3145
3166
  if (!e || typeof e != "object")
3146
3167
  return {
3147
3168
  ok: !1,
3148
3169
  errors: [
3149
- r(
3170
+ s(
3150
3171
  "invalid_recovery_plan",
3151
3172
  "Analytics recovery plan must be a structured object."
3152
3173
  )
@@ -3160,19 +3181,19 @@ function Oa(e) {
3160
3181
  ]
3161
3182
  };
3162
3183
  e.version !== 1 && t.push(
3163
- r("invalid_version", "Recovery plan version must be 1.", "version")
3184
+ s("invalid_version", "Recovery plan version must be 1.", "version")
3164
3185
  ), e.kind !== "analytics_recovery_plan" && t.push(
3165
- r(
3186
+ s(
3166
3187
  "invalid_recovery_plan_kind",
3167
3188
  "Recovery plan kind must be analytics_recovery_plan.",
3168
3189
  "kind"
3169
3190
  )
3170
3191
  );
3171
- const o = Qn(
3192
+ const o = Xn(
3172
3193
  e.operationIntent
3173
3194
  );
3174
3195
  return t.push(...o.errors), i.push(...o.warnings), Array.isArray(e.plannedToolCalls) || t.push(
3175
- r(
3196
+ s(
3176
3197
  "invalid_planned_tool_calls",
3177
3198
  "Recovery plan plannedToolCalls must be an array.",
3178
3199
  "plannedToolCalls"
@@ -3181,16 +3202,16 @@ function Oa(e) {
3181
3202
  ok: t.length === 0,
3182
3203
  errors: t,
3183
3204
  warnings: i,
3184
- repairHints: Ft(t)
3205
+ repairHints: Dt(t)
3185
3206
  };
3186
3207
  }
3187
- function Ft(e) {
3208
+ function Dt(e) {
3188
3209
  return e.map((t) => ({
3189
3210
  code: t.code,
3190
3211
  recommendedNextStep: t.code === "missing_obligations" ? "Normalize the user request into one or more typed analytics obligations before recovery planning." : "Correct the operation/recovery contract shape before planning execution."
3191
3212
  }));
3192
3213
  }
3193
- function Pe(e) {
3214
+ function Be(e) {
3194
3215
  return e.map((t) => {
3195
3216
  switch (t.code) {
3196
3217
  case "invalid_matrix_intent":
@@ -3278,18 +3299,18 @@ function Pe(e) {
3278
3299
  }
3279
3300
  }).filter((t) => !!t);
3280
3301
  }
3281
- function Kn(e, t, i, o) {
3302
+ function Zn(e, t, i, o) {
3282
3303
  if (!e || typeof e != "object") {
3283
3304
  i.push(
3284
- r("invalid_view", "Dashboard view must be an object.", t)
3305
+ s("invalid_view", "Dashboard view must be an object.", t)
3285
3306
  );
3286
3307
  return;
3287
3308
  }
3288
3309
  if (m(e.title) || i.push(
3289
- r("missing_view_title", "Dashboard view needs a title.", t)
3310
+ s("missing_view_title", "Dashboard view needs a title.", t)
3290
3311
  ), !e.presentation || typeof e.presentation != "object") {
3291
3312
  i.push(
3292
- r(
3313
+ s(
3293
3314
  "missing_presentation",
3294
3315
  "Dashboard view needs a presentation.",
3295
3316
  `${t}.presentation`
@@ -3299,7 +3320,7 @@ function Kn(e, t, i, o) {
3299
3320
  }
3300
3321
  if (e.presentation.kind === "text") {
3301
3322
  m(e.text) || o.push(
3302
- r(
3323
+ s(
3303
3324
  "missing_text_content",
3304
3325
  "Text views should include text content.",
3305
3326
  `${t}.text`
@@ -3309,7 +3330,7 @@ function Kn(e, t, i, o) {
3309
3330
  }
3310
3331
  if (!e.analytics) {
3311
3332
  i.push(
3312
- r(
3333
+ s(
3313
3334
  "missing_view_analytics",
3314
3335
  "Non-text dashboard views need analytics intent.",
3315
3336
  `${t}.analytics`
@@ -3318,37 +3339,37 @@ function Kn(e, t, i, o) {
3318
3339
  return;
3319
3340
  }
3320
3341
  e.presentation.kind === "matrixTable" && e.analytics.kind !== "matrix" && i.push(
3321
- r(
3342
+ s(
3322
3343
  "invalid_matrix_view_analytics",
3323
3344
  "Matrix table views need matrix analytics intent.",
3324
3345
  `${t}.analytics.kind`
3325
3346
  )
3326
3347
  );
3327
- const a = xt(e.analytics);
3328
- for (const s of a.errors)
3348
+ const r = xt(e.analytics);
3349
+ for (const a of r.errors)
3329
3350
  i.push(
3330
- r(
3331
- s.code,
3332
- s.message,
3333
- `${t}.analytics${s.path ? `.${s.path}` : ""}`
3351
+ s(
3352
+ a.code,
3353
+ a.message,
3354
+ `${t}.analytics${a.path ? `.${a.path}` : ""}`
3334
3355
  )
3335
3356
  );
3336
- for (const s of a.warnings)
3357
+ for (const a of r.warnings)
3337
3358
  o.push(
3338
- r(
3339
- s.code,
3340
- s.message,
3341
- `${t}.analytics${s.path ? `.${s.path}` : ""}`
3359
+ s(
3360
+ a.code,
3361
+ a.message,
3362
+ `${t}.analytics${a.path ? `.${a.path}` : ""}`
3342
3363
  )
3343
3364
  );
3344
3365
  }
3345
- function Ya(e) {
3366
+ function Ba(e) {
3346
3367
  const t = [], i = [];
3347
3368
  if (!e || typeof e != "object")
3348
3369
  return {
3349
3370
  ok: !1,
3350
3371
  errors: [
3351
- r(
3372
+ s(
3352
3373
  "invalid_dashboard_intent",
3353
3374
  "Dashboard intent must be a structured object."
3354
3375
  )
@@ -3356,19 +3377,19 @@ function Ya(e) {
3356
3377
  warnings: i
3357
3378
  };
3358
3379
  e.version !== 1 && t.push(
3359
- r("invalid_version", "Dashboard intent version must be 1.")
3380
+ s("invalid_version", "Dashboard intent version must be 1.")
3360
3381
  ), e.kind !== "dashboard" && t.push(
3361
- r("invalid_kind", "Experience intent kind must be dashboard.")
3382
+ s("invalid_kind", "Experience intent kind must be dashboard.")
3362
3383
  ), m(e.title) || t.push(
3363
- r("missing_title", "Dashboard intent needs a title.", "title")
3384
+ s("missing_title", "Dashboard intent needs a title.", "title")
3364
3385
  );
3365
- const o = Array.isArray(e.inputs) ? e.inputs : [], a = Oe(
3386
+ const o = Array.isArray(e.inputs) ? e.inputs : [], r = Ye(
3366
3387
  o.filter(f).map((c) => c.id).filter((c) => typeof c == "string")
3367
3388
  );
3368
- a && t.push(
3369
- r(
3389
+ r && t.push(
3390
+ s(
3370
3391
  "duplicate_input_id",
3371
- `Duplicate input id: ${a}.`,
3392
+ `Duplicate input id: ${r}.`,
3372
3393
  "inputs"
3373
3394
  )
3374
3395
  );
@@ -3376,41 +3397,41 @@ function Ya(e) {
3376
3397
  const u = `inputs.${c}`;
3377
3398
  if (!f(p)) {
3378
3399
  t.push(
3379
- r("invalid_input", "Dashboard input must be an object.", u)
3400
+ s("invalid_input", "Dashboard input must be an object.", u)
3380
3401
  );
3381
3402
  continue;
3382
3403
  }
3383
3404
  m(p.id) || t.push(
3384
- r("missing_input_id", "Input needs an id.", `${u}.id`)
3405
+ s("missing_input_id", "Input needs an id.", `${u}.id`)
3385
3406
  ), m(p.label) || t.push(
3386
- r("missing_input_label", "Input needs a label.", `${u}.label`)
3407
+ s("missing_input_label", "Input needs a label.", `${u}.label`)
3387
3408
  ), !p.field || !m(p.field.name) ? t.push(
3388
- r("missing_input_field", "Input needs a field.", `${u}.field`)
3409
+ s("missing_input_field", "Input needs a field.", `${u}.field`)
3389
3410
  ) : b(p.field, `${u}.field`, t);
3390
3411
  }
3391
- const s = Array.isArray(e.sections) ? e.sections : [];
3392
- s.length === 0 && t.push(
3393
- r(
3412
+ const a = Array.isArray(e.sections) ? e.sections : [];
3413
+ a.length === 0 && t.push(
3414
+ s(
3394
3415
  "missing_sections",
3395
3416
  "Dashboard intent needs at least one section.",
3396
3417
  "sections"
3397
3418
  )
3398
3419
  );
3399
- const l = s.flatMap(
3420
+ const l = a.flatMap(
3400
3421
  (c) => c && typeof c == "object" && Array.isArray(c.views) ? c.views.filter(f).map((p) => p.id).filter((p) => !!p) : []
3401
- ), d = Oe(l);
3422
+ ), d = Ye(l);
3402
3423
  d && t.push(
3403
- r(
3424
+ s(
3404
3425
  "duplicate_view_id",
3405
3426
  `Duplicate dashboard view id: ${d}.`,
3406
3427
  "sections"
3407
3428
  )
3408
3429
  );
3409
- for (const [c, p] of s.entries()) {
3430
+ for (const [c, p] of a.entries()) {
3410
3431
  const u = `sections.${c}`;
3411
3432
  if (!p || typeof p != "object") {
3412
3433
  t.push(
3413
- r(
3434
+ s(
3414
3435
  "invalid_section",
3415
3436
  "Dashboard section must be an object.",
3416
3437
  u
@@ -3419,14 +3440,14 @@ function Ya(e) {
3419
3440
  continue;
3420
3441
  }
3421
3442
  if (m(p.title) || t.push(
3422
- r(
3443
+ s(
3423
3444
  "missing_section_title",
3424
3445
  "Dashboard section needs a title.",
3425
3446
  u
3426
3447
  )
3427
3448
  ), !Array.isArray(p.views) || p.views.length === 0) {
3428
3449
  t.push(
3429
- r(
3450
+ s(
3430
3451
  "missing_section_views",
3431
3452
  "Dashboard section needs at least one view.",
3432
3453
  `${u}.views`
@@ -3434,10 +3455,10 @@ function Ya(e) {
3434
3455
  );
3435
3456
  continue;
3436
3457
  }
3437
- for (const [_, y] of p.views.entries())
3438
- Kn(
3458
+ for (const [h, y] of p.views.entries())
3459
+ Zn(
3439
3460
  y,
3440
- `${u}.views.${_}`,
3461
+ `${u}.views.${h}`,
3441
3462
  t,
3442
3463
  i
3443
3464
  );
@@ -3446,130 +3467,131 @@ function Ya(e) {
3446
3467
  }
3447
3468
  export {
3448
3469
  jt as $,
3449
- he as A,
3450
- Ki as B,
3451
- J as C,
3470
+ H as A,
3471
+ Xi as B,
3472
+ te as C,
3452
3473
  ki as D,
3453
- mt as E,
3454
- ne as F,
3455
- ft as G,
3456
- vi as H,
3457
- F as I,
3458
- sa as J,
3459
- Ji as K,
3460
- Ii as L,
3461
- gt as M,
3462
- tn as N,
3463
- _t as O,
3464
- Ai as P,
3465
- C as Q,
3466
- Me as R,
3467
- rn as S,
3468
- _e as T,
3469
- Ee as U,
3470
- G as V,
3471
- fn as W,
3472
- xa as X,
3474
+ ft as E,
3475
+ oe as F,
3476
+ gt as G,
3477
+ Ii as H,
3478
+ x as I,
3479
+ la as J,
3480
+ en as K,
3481
+ Si as L,
3482
+ ht as M,
3483
+ nn as N,
3484
+ an as O,
3485
+ Fi as P,
3486
+ yt as Q,
3487
+ C as R,
3488
+ Re as S,
3489
+ dn as T,
3490
+ ye as U,
3491
+ Ne as V,
3492
+ z as W,
3493
+ hn as X,
3473
3494
  Da as Y,
3474
- ce as Z,
3475
- $t as _,
3476
- St as a,
3477
- va as a$,
3478
- oe as a0,
3479
- Cn as a1,
3480
- Ca as a2,
3481
- xt as a3,
3482
- Qn as a4,
3483
- Oa as a5,
3484
- Ya as a6,
3485
- ue as a7,
3486
- me as a8,
3487
- ri as a9,
3488
- Bt as aA,
3489
- ea as aB,
3490
- Vt as aC,
3491
- ta as aD,
3492
- qt as aE,
3493
- et as aF,
3494
- B as aG,
3495
- yi as aH,
3496
- V as aI,
3497
- oa as aJ,
3498
- x as aK,
3499
- gi as aL,
3500
- an as aM,
3501
- $ as aN,
3502
- ke as aO,
3503
- aa as aP,
3504
- Je as aQ,
3505
- qi as aR,
3506
- pe as aS,
3507
- Ht as aT,
3508
- De as aU,
3509
- ln as aV,
3510
- ya as aW,
3511
- Yi as aX,
3512
- Aa as aY,
3513
- wa as aZ,
3514
- ba as a_,
3495
+ Ra as Z,
3496
+ me as _,
3497
+ wt as a,
3498
+ Ia as a$,
3499
+ Ct as a0,
3500
+ re as a1,
3501
+ Yn as a2,
3502
+ Ya as a3,
3503
+ xt as a4,
3504
+ Xn as a5,
3505
+ Pa as a6,
3506
+ Ba as a7,
3507
+ pe as a8,
3508
+ ge as a9,
3509
+ R as aA,
3510
+ Lt as aB,
3511
+ ia as aC,
3512
+ qt as aD,
3513
+ na as aE,
3514
+ Ut as aF,
3515
+ tt as aG,
3516
+ B as aH,
3517
+ bi as aI,
3518
+ V as aJ,
3519
+ ra as aK,
3520
+ F as aL,
3521
+ hi as aM,
3522
+ sn as aN,
3523
+ $ as aO,
3524
+ ke as aP,
3525
+ sa as aQ,
3526
+ et as aR,
3527
+ Ui as aS,
3528
+ fe as aT,
3529
+ Gt as aU,
3530
+ Me as aV,
3531
+ un as aW,
3532
+ va as aX,
3533
+ Pi as aY,
3534
+ xa as aZ,
3535
+ Fa as a_,
3515
3536
  li as aa,
3516
- fe as ab,
3517
- mi as ac,
3537
+ di as ab,
3538
+ he as ac,
3518
3539
  fi as ad,
3519
- Ke as ae,
3540
+ gi as ae,
3520
3541
  Xe as af,
3521
- Ae as ag,
3522
- We as ah,
3523
- ia as ai,
3524
- na as aj,
3525
- Ma as ak,
3526
- Ra as al,
3527
- D as am,
3528
- vt as an,
3529
- ye as ao,
3530
- It as ap,
3531
- Na as aq,
3532
- xi as ar,
3533
- Di as as,
3534
- Ct as at,
3535
- Wn as au,
3536
- Ot as av,
3542
+ Ze as ag,
3543
+ Fe as ah,
3544
+ We as ai,
3545
+ aa as aj,
3546
+ oa as ak,
3547
+ Ta as al,
3548
+ Ea as am,
3549
+ D as an,
3550
+ It as ao,
3551
+ be as ap,
3552
+ St as aq,
3553
+ ja as ar,
3554
+ xi as as,
3555
+ Mi as at,
3556
+ Ot as au,
3557
+ ea as av,
3537
3558
  Yt as aw,
3538
- Jn as ax,
3539
- Pt as ay,
3540
- R as az,
3541
- la as b,
3542
- Vi as b0,
3543
- Ui as b1,
3544
- Sa as b2,
3545
- Ia as b3,
3546
- ka as b4,
3547
- ha as b5,
3548
- ie as b6,
3549
- _a as b7,
3550
- dn as b8,
3551
- wi as c,
3552
- it as d,
3553
- ua as e,
3554
- ca as f,
3555
- Si as g,
3556
- pa as h,
3557
- ra as i,
3558
- ma as j,
3559
- ee as k,
3560
- Fa as l,
3561
- sn as m,
3562
- da as n,
3563
- _n as o,
3564
- $a as p,
3565
- Ea as q,
3566
- ja as r,
3567
- In as s,
3568
- tt as t,
3569
- fa as u,
3570
- ga as v,
3571
- Ta as w,
3572
- ae as x,
3573
- ut as y,
3574
- bi as z
3559
+ Pt as ax,
3560
+ ta as ay,
3561
+ Bt as az,
3562
+ ua as b,
3563
+ Sa as b0,
3564
+ qi as b1,
3565
+ Hi as b2,
3566
+ ka as b3,
3567
+ wa as b4,
3568
+ Aa as b5,
3569
+ ya as b6,
3570
+ ae as b7,
3571
+ ba as b8,
3572
+ cn as b9,
3573
+ Ai as c,
3574
+ nt as d,
3575
+ pa as e,
3576
+ ma as f,
3577
+ wi as g,
3578
+ fa as h,
3579
+ da as i,
3580
+ ga as j,
3581
+ ie as k,
3582
+ Ma as l,
3583
+ ln as m,
3584
+ ca as n,
3585
+ bn as o,
3586
+ Ca as p,
3587
+ $a as q,
3588
+ Oa as r,
3589
+ wn as s,
3590
+ it as t,
3591
+ ha as u,
3592
+ _a as v,
3593
+ Na as w,
3594
+ se as x,
3595
+ ct as y,
3596
+ vi as z
3575
3597
  };