react-semaphor 0.1.397 → 0.1.399

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 (51) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +2 -2
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +2 -2
  5. package/dist/chunks/analyze-result-contract-CUO5QmqV.js +1797 -0
  6. package/dist/chunks/analyze-result-contract-OqFtOCpZ.js +1 -0
  7. package/dist/chunks/{calendar-preferences-dialog-49fcEPXS.js → calendar-preferences-dialog-9SvYDLp6.js} +3 -3
  8. package/dist/chunks/{calendar-preferences-dialog-DwLeBLy2.js → calendar-preferences-dialog-B3fnFtJt.js} +1 -1
  9. package/dist/chunks/{dashboard-briefing-launcher-cgPKz1yX.js → dashboard-briefing-launcher-APVyc9al.js} +4 -4
  10. package/dist/chunks/{dashboard-briefing-launcher-CgkSKkZR.js → dashboard-briefing-launcher-D3R4R7ww.js} +1 -1
  11. package/dist/chunks/{dashboard-controls-VMFm3OP4.js → dashboard-controls-CHDQlMZ9.js} +5 -5
  12. package/dist/chunks/{dashboard-controls-D12ZSUP_.js → dashboard-controls-v7jslCXR.js} +1 -1
  13. package/dist/chunks/{dashboard-json-C-GG5yC7.js → dashboard-json-DF_syvRu.js} +3 -3
  14. package/dist/chunks/{dashboard-json-CvK0oI24.js → dashboard-json-L1Qo5xcX.js} +1 -1
  15. package/dist/chunks/{edit-dashboard-visual-B5KB7dx4.js → edit-dashboard-visual-DwfIWUe-.js} +4 -4
  16. package/dist/chunks/{edit-dashboard-visual-ql99faTz.js → edit-dashboard-visual-qdruQruO.js} +1 -1
  17. package/dist/chunks/{index-CQmKDEbe.js → index-BdVymLVq.js} +5 -5
  18. package/dist/chunks/{index-DXCBPLDu.js → index-DH7hOGQl.js} +2 -2
  19. package/dist/chunks/{switch-BXQAlSuW.js → switch-BiU6-YSY.js} +1 -1
  20. package/dist/chunks/{switch-B79Hn4Qh.js → switch-CYG3dY8r.js} +1 -1
  21. package/dist/chunks/{use-create-flow-overlay-state-Bw5LRkf9.js → use-create-flow-overlay-state-CwUkhLBL.js} +3 -3
  22. package/dist/chunks/{use-create-flow-overlay-state-7MFN3PWX.js → use-create-flow-overlay-state-qe7DHQKr.js} +1 -1
  23. package/dist/chunks/{validators-4EGCWWga.js → validators-B1Mgdr3T.js} +279 -242
  24. package/dist/chunks/{validators-CPtkrola.js → validators-DFOX0tYY.js} +1 -1
  25. package/dist/dashboard/index.cjs +1 -1
  26. package/dist/dashboard/index.js +1 -1
  27. package/dist/dashboard-authoring/index.cjs +1 -1
  28. package/dist/dashboard-authoring/index.js +2 -2
  29. package/dist/data-app-builder/index.cjs +1 -1
  30. package/dist/data-app-builder/index.js +2 -2
  31. package/dist/data-app-sdk/index.cjs +20 -5
  32. package/dist/data-app-sdk/index.js +1182 -1085
  33. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  34. package/dist/data-app-sdk-adapters/index.js +20 -12
  35. package/dist/data-app-sdk-validation/index.cjs +1 -1
  36. package/dist/data-app-sdk-validation/index.js +2 -2
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +7 -7
  39. package/dist/surfboard/index.cjs +1 -1
  40. package/dist/surfboard/index.js +2 -2
  41. package/dist/types/analytics-protocol.d.ts +101 -2
  42. package/dist/types/dashboard-assistant.d.ts +14 -0
  43. package/dist/types/dashboard-authoring.d.ts +6 -0
  44. package/dist/types/data-app-builder.d.ts +6 -0
  45. package/dist/types/data-app-sdk-adapters.d.ts +7 -0
  46. package/dist/types/data-app-sdk-validation.d.ts +15 -0
  47. package/dist/types/data-app-sdk.d.ts +18 -0
  48. package/dist/types/main.d.ts +6 -0
  49. package/package.json +1 -1
  50. package/dist/chunks/analyze-result-contract-C9Gv2_qW.js +0 -1585
  51. package/dist/chunks/analyze-result-contract-Zgg-Bbpj.js +0 -1
@@ -6,7 +6,7 @@ function X(e) {
6
6
  for (let i = 0; i < e.length; i += 1) {
7
7
  const t = e[i];
8
8
  if (e.some(
9
- (n, o) => o !== i && L(n, t)
9
+ (s, o) => o !== i && L(s, t)
10
10
  ))
11
11
  return !1;
12
12
  }
@@ -36,13 +36,13 @@ function J(e, i, t) {
36
36
  );
37
37
  return;
38
38
  }
39
- Object.entries(e).forEach(([n, o]) => {
40
- if (!n.trim()) {
39
+ Object.entries(e).forEach(([s, o]) => {
40
+ if (!s.trim()) {
41
41
  t.push(
42
42
  a(
43
43
  "invalid_sql_default_parameter_name",
44
44
  "SQL defaultParameters names must be non-empty strings.",
45
- `${i}.${n}`
45
+ `${i}.${s}`
46
46
  )
47
47
  );
48
48
  return;
@@ -51,7 +51,7 @@ function J(e, i, t) {
51
51
  a(
52
52
  "invalid_sql_default_parameter_value",
53
53
  "SQL defaultParameters values must be strings, numbers, booleans, nulls, or arrays of those scalar values.",
54
- `${i}.${n}`
54
+ `${i}.${s}`
55
55
  )
56
56
  );
57
57
  });
@@ -65,7 +65,7 @@ function ee(e, i) {
65
65
  }
66
66
  function M(e, i) {
67
67
  return i.filter(
68
- (n) => ie(e, n)
68
+ (s) => ie(e, s)
69
69
  );
70
70
  }
71
71
  function ie(e, i) {
@@ -80,34 +80,34 @@ function ae(e, i) {
80
80
  function g(e) {
81
81
  return (e.aggregate || "SUM").toUpperCase();
82
82
  }
83
- const ne = /^(\d{4})-(\d{2})-(\d{2})$/, se = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;
83
+ const se = /^(\d{4})-(\d{2})-(\d{2})$/, ne = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;
84
84
  function T(e) {
85
85
  if (typeof e != "string")
86
86
  return null;
87
- const i = e.trim(), t = ne.exec(i);
87
+ const i = e.trim(), t = se.exec(i);
88
88
  if (t) {
89
89
  const [, y, D, F] = t;
90
90
  return E(y, D, F) ? new Date(Date.UTC(Number(y), Number(D) - 1, Number(F))) : null;
91
91
  }
92
- const n = se.exec(i);
93
- if (!n)
92
+ const s = ne.exec(i);
93
+ if (!s)
94
94
  return null;
95
- const [, o, s, r, c, d, p = "00", , m] = n;
96
- if (!E(o, s, r) || !v(c, 0, 23) || !v(d, 0, 59) || !v(p, 0, 59) || !oe(m))
95
+ const [, o, n, r, c, d, p = "00", , m] = s;
96
+ if (!E(o, n, r) || !v(c, 0, 23) || !v(d, 0, 59) || !v(p, 0, 59) || !oe(m))
97
97
  return null;
98
98
  const b = new Date(i);
99
99
  return Number.isFinite(b.getTime()) ? b : null;
100
100
  }
101
101
  function E(e, i, t) {
102
- const n = Number(e), o = Number(i), s = Number(t);
103
- if (!Number.isInteger(n) || !Number.isInteger(o) || !Number.isInteger(s) || o < 1 || o > 12)
102
+ const s = Number(e), o = Number(i), n = Number(t);
103
+ if (!Number.isInteger(s) || !Number.isInteger(o) || !Number.isInteger(n) || o < 1 || o > 12)
104
104
  return !1;
105
- const r = new Date(Date.UTC(n, o - 1, s));
106
- return r.getUTCFullYear() === n && r.getUTCMonth() === o - 1 && r.getUTCDate() === s;
105
+ const r = new Date(Date.UTC(s, o - 1, n));
106
+ return r.getUTCFullYear() === s && r.getUTCMonth() === o - 1 && r.getUTCDate() === n;
107
107
  }
108
108
  function v(e, i, t) {
109
- const n = Number(e);
110
- return Number.isInteger(n) && n >= i && n <= t;
109
+ const s = Number(e);
110
+ return Number.isInteger(s) && s >= i && s <= t;
111
111
  }
112
112
  function oe(e) {
113
113
  if (e === "Z")
@@ -122,19 +122,19 @@ function re(e) {
122
122
  const i = /* @__PURE__ */ new Set();
123
123
  let t = 0;
124
124
  for (; t < e.length; ) {
125
- const n = e[t];
126
- if (n === "'" || n === '"') {
125
+ const s = e[t];
126
+ if (s === "'" || s === '"') {
127
127
  t = de(e, t);
128
128
  continue;
129
129
  }
130
- if (n === "{") {
130
+ if (s === "{") {
131
131
  const o = e.indexOf("}", t + 1);
132
132
  if (o === -1) {
133
133
  t += 1;
134
134
  continue;
135
135
  }
136
- const s = e.slice(t + 1, o);
137
- /^[A-Za-z_][A-Za-z0-9_]*$/.test(s) && i.add(s), t = o + 1;
136
+ const n = e.slice(t + 1, o);
137
+ /^[A-Za-z_][A-Za-z0-9_]*$/.test(n) && i.add(n), t = o + 1;
138
138
  continue;
139
139
  }
140
140
  t += 1;
@@ -143,16 +143,16 @@ function re(e) {
143
143
  }
144
144
  function de(e, i) {
145
145
  const t = e[i];
146
- let n = i + 1;
147
- for (; n < e.length; ) {
148
- if (e[n] === t) {
149
- if (e[n + 1] === t) {
150
- n += 2;
146
+ let s = i + 1;
147
+ for (; s < e.length; ) {
148
+ if (e[s] === t) {
149
+ if (e[s + 1] === t) {
150
+ s += 2;
151
151
  continue;
152
152
  }
153
- return n + 1;
153
+ return s + 1;
154
154
  }
155
- n += 1;
155
+ s += 1;
156
156
  }
157
157
  return e.length;
158
158
  }
@@ -186,7 +186,7 @@ function N(e, i, t) {
186
186
  );
187
187
  }
188
188
  }
189
- function $(e) {
189
+ function w(e) {
190
190
  const i = /* @__PURE__ */ new Set();
191
191
  for (const t of e) {
192
192
  if (i.has(t))
@@ -195,10 +195,10 @@ function $(e) {
195
195
  }
196
196
  return null;
197
197
  }
198
- function w(e, i, t, n) {
199
- $(
200
- e.filter((s) => l(s))
201
- ) && n.push(
198
+ function $(e, i, t, s) {
199
+ w(
200
+ e.filter((n) => l(n))
201
+ ) && s.push(
202
202
  a(
203
203
  "duplicate_matrix_public_id",
204
204
  `Matrix ${t} ids must be unique so sort and expansion references are unambiguous.`,
@@ -268,9 +268,9 @@ function S(e, i, t) {
268
268
  a("invalid_source_kind", "Source kind is not supported.", i)
269
269
  );
270
270
  }
271
- function f(e, i, t, n = {}) {
271
+ function f(e, i, t, s = {}) {
272
272
  if (!e || !u(e)) {
273
- n.required && t.push(
273
+ s.required && t.push(
274
274
  a("missing_field_ref", "Field reference needs a name.", i)
275
275
  );
276
276
  return;
@@ -323,7 +323,7 @@ function k(e, i, t) {
323
323
  );
324
324
  return;
325
325
  }
326
- e.relationshipIds !== void 0 && (!Array.isArray(e.relationshipIds) || e.relationshipIds.some((n) => !l(n))) && t.push(
326
+ e.relationshipIds !== void 0 && (!Array.isArray(e.relationshipIds) || e.relationshipIds.some((s) => !l(s))) && t.push(
327
327
  a(
328
328
  "invalid_relationship_hint",
329
329
  "Relationship hint relationshipIds must be non-empty strings.",
@@ -356,8 +356,8 @@ function ce(e, i) {
356
356
  required: !0
357
357
  }), e.searchField !== void 0 && f(e.searchField, "searchField", i, {
358
358
  required: !0
359
- }), e.disambiguationFields !== void 0 && (Array.isArray(e.disambiguationFields) ? e.disambiguationFields.forEach((t, n) => {
360
- f(t, `disambiguationFields.${n}`, i, {
359
+ }), e.disambiguationFields !== void 0 && (Array.isArray(e.disambiguationFields) ? e.disambiguationFields.forEach((t, s) => {
360
+ f(t, `disambiguationFields.${s}`, i, {
361
361
  required: !0
362
362
  });
363
363
  }) : i.push(
@@ -377,8 +377,8 @@ function ce(e, i) {
377
377
  )
378
378
  );
379
379
  else {
380
- const n = t.mode;
381
- n !== void 0 && n !== "auto" && n !== "independent" && n !== "explicit" && i.push(
380
+ const s = t.mode;
381
+ s !== void 0 && s !== "auto" && s !== "independent" && s !== "explicit" && i.push(
382
382
  a(
383
383
  "invalid_input_options_dependencies",
384
384
  "Input options dependencies mode must be auto, independent, or explicit.",
@@ -408,26 +408,26 @@ function ce(e, i) {
408
408
  )
409
409
  );
410
410
  else {
411
- const n = t.kind;
412
- n !== "option_source" && n !== "related_population" && i.push(
411
+ const s = t.kind;
412
+ s !== "option_source" && s !== "related_population" && i.push(
413
413
  a(
414
414
  "invalid_input_options_population",
415
415
  "Input options population kind must be option_source or related_population.",
416
416
  "population.kind"
417
417
  )
418
- ), n === "option_source" && t.baseSource !== void 0 && i.push(
418
+ ), s === "option_source" && t.baseSource !== void 0 && i.push(
419
419
  a(
420
420
  "invalid_input_options_population",
421
421
  "Input options population baseSource is only valid for related_population.",
422
422
  "population.baseSource"
423
423
  )
424
- ), n === "option_source" && t.relationshipHint !== void 0 && i.push(
424
+ ), s === "option_source" && t.relationshipHint !== void 0 && i.push(
425
425
  a(
426
426
  "invalid_input_options_population",
427
427
  "Input options population relationshipHint is only valid for related_population.",
428
428
  "population.relationshipHint"
429
429
  )
430
- ), n === "related_population" && (S(
430
+ ), s === "related_population" && (S(
431
431
  t.baseSource,
432
432
  "population.baseSource",
433
433
  i
@@ -452,34 +452,34 @@ function pe(e, i) {
452
452
  return;
453
453
  }
454
454
  e.inputs.forEach(
455
- (t, n) => ue(t, `inputs.${n}`, i)
455
+ (t, s) => ue(t, `inputs.${s}`, i)
456
456
  );
457
457
  }
458
458
  }
459
459
  function fe(e, i) {
460
- var n, o;
460
+ var s, o;
461
461
  const t = new Set(
462
- Array.isArray(e.inputs) ? e.inputs.map((s) => u(s) ? s.inputId : void 0).filter((s) => typeof s == "string") : []
462
+ Array.isArray(e.inputs) ? e.inputs.map((n) => u(n) ? n.inputId : void 0).filter((n) => typeof n == "string") : []
463
463
  );
464
- for (const s of ((n = e.dependencies) == null ? void 0 : n.includeInputIds) || [])
465
- t.has(s) || i.push(
464
+ for (const n of ((s = e.dependencies) == null ? void 0 : s.includeInputIds) || [])
465
+ t.has(n) || i.push(
466
466
  a(
467
467
  "invalid_input_options_dependencies",
468
- `Input options dependency "${s}" is not declared in inputs.`,
468
+ `Input options dependency "${n}" is not declared in inputs.`,
469
469
  "dependencies.includeInputIds"
470
470
  )
471
471
  );
472
- for (const s of ((o = e.dependencies) == null ? void 0 : o.excludeInputIds) || [])
473
- s !== e.inputId && !t.has(s) && i.push(
472
+ for (const n of ((o = e.dependencies) == null ? void 0 : o.excludeInputIds) || [])
473
+ n !== e.inputId && !t.has(n) && i.push(
474
474
  a(
475
475
  "invalid_input_options_dependencies",
476
- `Input options dependency exclusion "${s}" is not the populated inputId and is not declared in inputs.`,
476
+ `Input options dependency exclusion "${n}" is not the populated inputId and is not declared in inputs.`,
477
477
  "dependencies.excludeInputIds"
478
478
  )
479
479
  );
480
480
  }
481
- function O(e, i, t, n) {
482
- e !== void 0 && (!Array.isArray(e) || e.some((o) => !l(o))) && t.push(a("invalid_input_options_dependencies", n, i));
481
+ function O(e, i, t, s) {
482
+ e !== void 0 && (!Array.isArray(e) || e.some((o) => !l(o))) && t.push(a("invalid_input_options_dependencies", s, i));
483
483
  }
484
484
  function _(e, i, t) {
485
485
  e !== void 0 && (typeof e != "string" || !le.has(e)) && t.push(
@@ -537,8 +537,8 @@ function R(e, i, t) {
537
537
  );
538
538
  return;
539
539
  }
540
- const n = e;
541
- (typeof n.type != "string" || !ve.has(n.type)) && t.push(
540
+ const s = e;
541
+ (typeof s.type != "string" || !ve.has(s.type)) && t.push(
542
542
  a(
543
543
  "invalid_value_format_type",
544
544
  "Value format type must be number, currency, percent, scientific, date, datetime, duration, or string.",
@@ -572,8 +572,8 @@ function R(e, i, t) {
572
572
  )
573
573
  );
574
574
  for (const o of ["inputUnit", "largestUnit", "smallestUnit"]) {
575
- const s = e[o];
576
- s !== void 0 && (typeof s != "string" || !ge.has(s)) && t.push(
575
+ const n = e[o];
576
+ n !== void 0 && (typeof n != "string" || !ge.has(n)) && t.push(
577
577
  a(
578
578
  "invalid_value_format_duration_unit",
579
579
  "Duration format units must be millisecond, second, minute, hour, or day.",
@@ -645,8 +645,8 @@ function j(e, i, t) {
645
645
  );
646
646
  return;
647
647
  }
648
- const n = l(e.columnKey), o = u(e.field);
649
- if (n === o) {
648
+ const s = l(e.columnKey), o = u(e.field);
649
+ if (s === o) {
650
650
  t.push(
651
651
  a(
652
652
  "invalid_result_column_ref",
@@ -660,7 +660,7 @@ function j(e, i, t) {
660
660
  required: !0
661
661
  });
662
662
  }
663
- function we(e, i, t) {
663
+ function $e(e, i, t) {
664
664
  if (!u(e)) {
665
665
  t.push(
666
666
  a(
@@ -685,7 +685,7 @@ function we(e, i, t) {
685
685
  )
686
686
  ), R(e.format, `${i}.format`, t);
687
687
  }
688
- function $e(e, i, t) {
688
+ function we(e, i, t) {
689
689
  e !== void 0 && e !== "hour" && e !== "day" && e !== "week" && e !== "month" && e !== "quarter" && e !== "year" && t.push(
690
690
  a(
691
691
  "invalid_time_grain",
@@ -694,21 +694,21 @@ function $e(e, i, t) {
694
694
  )
695
695
  );
696
696
  }
697
- function V(e, i, t, n) {
698
- e !== "asc" && e !== "desc" && t.push(a(n, "Sort direction must be asc or desc.", i));
697
+ function V(e, i, t, s) {
698
+ e !== "asc" && e !== "desc" && t.push(a(s, "Sort direction must be asc or desc.", i));
699
699
  }
700
- function G(e, i, t, n) {
700
+ function G(e, i, t, s) {
701
701
  e !== void 0 && e !== "warehouseDefault" && e !== "first" && e !== "last" && t.push(
702
702
  a(
703
- n,
703
+ s,
704
704
  "Null ordering must be warehouseDefault, first, or last.",
705
705
  i
706
706
  )
707
707
  );
708
708
  }
709
- function z(e, i, t, n) {
709
+ function z(e, i, t, s) {
710
710
  e !== void 0 && e !== "global" && e !== "withinParent" && t.push(
711
- a(n, "Sort scope must be global or withinParent.", i)
711
+ a(s, "Sort scope must be global or withinParent.", i)
712
712
  );
713
713
  }
714
714
  function Ie(e, i, t) {
@@ -774,9 +774,9 @@ function Ae(e, i, t) {
774
774
  );
775
775
  }
776
776
  }
777
- function B(e, i, t, n) {
777
+ function B(e, i, t, s) {
778
778
  if (!Array.isArray(e))
779
- return n.required ? t.push(
779
+ return s.required ? t.push(
780
780
  a(
781
781
  "missing_matrix_rows",
782
782
  "Matrix intent needs at least one row axis level.",
@@ -789,7 +789,7 @@ function B(e, i, t, n) {
789
789
  i
790
790
  )
791
791
  ), [];
792
- n.required && e.length === 0 && t.push(
792
+ s.required && e.length === 0 && t.push(
793
793
  a(
794
794
  "missing_matrix_rows",
795
795
  "Matrix intent needs at least one row axis level.",
@@ -797,9 +797,9 @@ function B(e, i, t, n) {
797
797
  )
798
798
  );
799
799
  const o = [];
800
- return e.forEach((s, r) => {
800
+ return e.forEach((n, r) => {
801
801
  const c = `${i}.${r}`;
802
- if (!u(s)) {
802
+ if (!u(n)) {
803
803
  t.push(
804
804
  a(
805
805
  "invalid_matrix_axis_level",
@@ -809,7 +809,7 @@ function B(e, i, t, n) {
809
809
  );
810
810
  return;
811
811
  }
812
- const d = s;
812
+ const d = n;
813
813
  o.push(d), d.id !== void 0 && !l(d.id) && t.push(
814
814
  a(
815
815
  "invalid_matrix_axis_level_id",
@@ -818,7 +818,7 @@ function B(e, i, t, n) {
818
818
  )
819
819
  ), f(d.field, `${c}.field`, t, {
820
820
  required: !0
821
- }), $e(d.grain, `${c}.grain`, t), d.label !== void 0 && typeof d.label != "string" && t.push(
821
+ }), we(d.grain, `${c}.grain`, t), d.label !== void 0 && typeof d.label != "string" && t.push(
822
822
  a(
823
823
  "invalid_matrix_axis_label",
824
824
  "Matrix axis level label must be a string.",
@@ -897,9 +897,9 @@ function Se(e, i, t) {
897
897
  i
898
898
  )
899
899
  ), [];
900
- const n = [];
901
- return e.forEach((o, s) => {
902
- const r = `${i}.${s}`;
900
+ const s = [];
901
+ return e.forEach((o, n) => {
902
+ const r = `${i}.${n}`;
903
903
  if (!u(o)) {
904
904
  t.push(
905
905
  a(
@@ -911,7 +911,7 @@ function Se(e, i, t) {
911
911
  return;
912
912
  }
913
913
  const c = o;
914
- n.push(c), c.id !== void 0 && !l(c.id) && t.push(
914
+ s.push(c), c.id !== void 0 && !l(c.id) && t.push(
915
915
  a(
916
916
  "invalid_matrix_value_id",
917
917
  "Matrix value id must be a non-empty string.",
@@ -934,7 +934,7 @@ function Se(e, i, t) {
934
934
  `${r}.totalBehavior`,
935
935
  t
936
936
  );
937
- }), n;
937
+ }), s;
938
938
  }
939
939
  function ke(e, i, t) {
940
940
  if (!u(e)) {
@@ -947,13 +947,13 @@ function ke(e, i, t) {
947
947
  );
948
948
  return;
949
949
  }
950
- for (const n of ["rows", "columns"]) {
951
- const o = e[n];
950
+ for (const s of ["rows", "columns"]) {
951
+ const o = e[s];
952
952
  o !== void 0 && o !== !0 && o !== !1 && o !== "perLevel" && t.push(
953
953
  a(
954
954
  "invalid_matrix_totals",
955
955
  "Matrix total axis setting must be a boolean or perLevel.",
956
- `${i}.${n}`
956
+ `${i}.${s}`
957
957
  )
958
958
  );
959
959
  }
@@ -967,13 +967,13 @@ function ke(e, i, t) {
967
967
  )
968
968
  );
969
969
  else
970
- for (const n of ["rows", "columns"]) {
971
- const o = e.grandTotal[n];
970
+ for (const s of ["rows", "columns"]) {
971
+ const o = e.grandTotal[s];
972
972
  o !== void 0 && typeof o != "boolean" && t.push(
973
973
  a(
974
974
  "invalid_matrix_totals",
975
975
  "Matrix grandTotal rows/columns must be booleans.",
976
- `${i}.grandTotal.${n}`
976
+ `${i}.grandTotal.${s}`
977
977
  )
978
978
  );
979
979
  }
@@ -991,9 +991,9 @@ function ke(e, i, t) {
991
991
  )
992
992
  );
993
993
  }
994
- function I(e, i, t, n) {
994
+ function I(e, i, t, s) {
995
995
  if (!Array.isArray(e)) {
996
- n.push(
996
+ s.push(
997
997
  a(
998
998
  "invalid_matrix_path",
999
999
  "Matrix member path must be an array of path segments.",
@@ -1002,10 +1002,10 @@ function I(e, i, t, n) {
1002
1002
  );
1003
1003
  return;
1004
1004
  }
1005
- e.forEach((o, s) => {
1006
- const r = `${i}.${s}`;
1005
+ e.forEach((o, n) => {
1006
+ const r = `${i}.${n}`;
1007
1007
  if (!u(o)) {
1008
- n.push(
1008
+ s.push(
1009
1009
  a(
1010
1010
  "invalid_matrix_path",
1011
1011
  "Matrix path segment must be a structured object.",
@@ -1016,7 +1016,7 @@ function I(e, i, t, n) {
1016
1016
  }
1017
1017
  const c = o;
1018
1018
  if (!l(c.levelId)) {
1019
- n.push(
1019
+ s.push(
1020
1020
  a(
1021
1021
  "stable_id_required",
1022
1022
  "Matrix path segments must reference an explicit public axis level id.",
@@ -1025,13 +1025,13 @@ function I(e, i, t, n) {
1025
1025
  );
1026
1026
  return;
1027
1027
  }
1028
- Object.prototype.hasOwnProperty.call(o, "value") || n.push(
1028
+ Object.prototype.hasOwnProperty.call(o, "value") || s.push(
1029
1029
  a(
1030
1030
  "invalid_matrix_path",
1031
1031
  "Matrix path segments must include a value property; use explicit null for null members.",
1032
1032
  `${r}.value`
1033
1033
  )
1034
- ), t.has(c.levelId) || n.push(
1034
+ ), t.has(c.levelId) || s.push(
1035
1035
  a(
1036
1036
  "stable_id_required",
1037
1037
  "Matrix path segment levelId must match an explicit public axis level id.",
@@ -1040,9 +1040,9 @@ function I(e, i, t, n) {
1040
1040
  );
1041
1041
  });
1042
1042
  }
1043
- function q(e, i, t, n) {
1043
+ function q(e, i, t, s) {
1044
1044
  if (!u(e)) {
1045
- n.push(
1045
+ s.push(
1046
1046
  a(
1047
1047
  "invalid_matrix_expansion",
1048
1048
  "Matrix expansion axis options must be structured objects.",
@@ -1051,26 +1051,26 @@ function q(e, i, t, n) {
1051
1051
  );
1052
1052
  return;
1053
1053
  }
1054
- e.defaultDepth !== void 0 && (typeof e.defaultDepth != "number" || !Number.isInteger(e.defaultDepth) || e.defaultDepth < 0) && n.push(
1054
+ e.defaultDepth !== void 0 && (typeof e.defaultDepth != "number" || !Number.isInteger(e.defaultDepth) || e.defaultDepth < 0) && s.push(
1055
1055
  a(
1056
1056
  "invalid_matrix_expansion",
1057
1057
  "Matrix expansion defaultDepth must be a non-negative integer.",
1058
1058
  `${i}.defaultDepth`
1059
1059
  )
1060
- ), e.lazy !== void 0 && typeof e.lazy != "boolean" && n.push(
1060
+ ), e.lazy !== void 0 && typeof e.lazy != "boolean" && s.push(
1061
1061
  a(
1062
1062
  "invalid_matrix_expansion",
1063
1063
  "Matrix expansion lazy must be a boolean.",
1064
1064
  `${i}.lazy`
1065
1065
  )
1066
- ), e.expandedPaths !== void 0 && (Array.isArray(e.expandedPaths) ? e.expandedPaths.forEach((o, s) => {
1066
+ ), e.expandedPaths !== void 0 && (Array.isArray(e.expandedPaths) ? e.expandedPaths.forEach((o, n) => {
1067
1067
  I(
1068
1068
  o,
1069
- `${i}.expandedPaths.${s}`,
1069
+ `${i}.expandedPaths.${n}`,
1070
1070
  t,
1071
- n
1071
+ s
1072
1072
  );
1073
- }) : n.push(
1073
+ }) : s.push(
1074
1074
  a(
1075
1075
  "invalid_matrix_expansion",
1076
1076
  "Matrix expandedPaths must be an array of member paths.",
@@ -1078,10 +1078,10 @@ function q(e, i, t, n) {
1078
1078
  )
1079
1079
  ));
1080
1080
  }
1081
- function Re(e, i, t, n) {
1081
+ function Re(e, i, t, s) {
1082
1082
  if (e !== void 0) {
1083
1083
  if (!u(e)) {
1084
- n.push(
1084
+ s.push(
1085
1085
  a(
1086
1086
  "invalid_matrix_expansion",
1087
1087
  "Matrix expansion must be a structured object.",
@@ -1094,16 +1094,16 @@ function Re(e, i, t, n) {
1094
1094
  e.rows,
1095
1095
  "expansion.rows",
1096
1096
  i,
1097
- n
1097
+ s
1098
1098
  ), e.columns !== void 0 && q(
1099
1099
  e.columns,
1100
1100
  "expansion.columns",
1101
1101
  t,
1102
- n
1102
+ s
1103
1103
  );
1104
1104
  }
1105
1105
  }
1106
- function De(e, i, t, n, o) {
1106
+ function De(e, i, t, s, o) {
1107
1107
  if (e !== void 0) {
1108
1108
  if (!Array.isArray(e)) {
1109
1109
  o.push(
@@ -1115,9 +1115,9 @@ function De(e, i, t, n, o) {
1115
1115
  );
1116
1116
  return;
1117
1117
  }
1118
- e.forEach((s, r) => {
1118
+ e.forEach((n, r) => {
1119
1119
  const c = `sort.${r}`;
1120
- if (!u(s)) {
1120
+ if (!u(n)) {
1121
1121
  o.push(
1122
1122
  a(
1123
1123
  "invalid_matrix_sort",
@@ -1127,7 +1127,7 @@ function De(e, i, t, n, o) {
1127
1127
  );
1128
1128
  return;
1129
1129
  }
1130
- const d = s;
1130
+ const d = n;
1131
1131
  d.axis !== "row" && d.axis !== "column" && o.push(
1132
1132
  a(
1133
1133
  "invalid_matrix_sort",
@@ -1179,7 +1179,7 @@ function De(e, i, t, n, o) {
1179
1179
  return;
1180
1180
  }
1181
1181
  if (d.by.kind === "value") {
1182
- (!l(d.by.valueId) || !n.has(d.by.valueId)) && o.push(
1182
+ (!l(d.by.valueId) || !s.has(d.by.valueId)) && o.push(
1183
1183
  a(
1184
1184
  "stable_id_required",
1185
1185
  "Matrix value sort must reference an explicit public value id.",
@@ -1325,41 +1325,41 @@ function Te(e, i) {
1325
1325
  );
1326
1326
  const t = B(e.rows, "rows", i, {
1327
1327
  required: !0
1328
- }), n = B(e.columns, "columns", i, {
1328
+ }), s = B(e.columns, "columns", i, {
1329
1329
  required: !1
1330
1330
  }), o = Se(e.values, "values", i);
1331
- x(e.filters, "filters", i), e.totals !== void 0 && ke(e.totals, "totals", i), w(
1331
+ x(e.filters, "filters", i), e.totals !== void 0 && ke(e.totals, "totals", i), $(
1332
1332
  t.map((p) => p.id),
1333
1333
  "rows",
1334
1334
  "row axis level",
1335
1335
  i
1336
- ), w(
1337
- n.map((p) => p.id),
1336
+ ), $(
1337
+ s.map((p) => p.id),
1338
1338
  "columns",
1339
1339
  "column axis level",
1340
1340
  i
1341
- ), w(
1341
+ ), $(
1342
1342
  o.map((p) => p.id),
1343
1343
  "values",
1344
1344
  "value",
1345
1345
  i
1346
1346
  );
1347
- const s = new Set(
1347
+ const n = new Set(
1348
1348
  t.map((p) => p.id).filter((p) => l(p))
1349
1349
  ), r = new Set(
1350
- n.map((p) => p.id).filter((p) => l(p))
1350
+ s.map((p) => p.id).filter((p) => l(p))
1351
1351
  ), c = new Set(
1352
1352
  o.map((p) => p.id).filter((p) => l(p))
1353
1353
  );
1354
1354
  De(
1355
1355
  e.sort,
1356
- s,
1356
+ n,
1357
1357
  r,
1358
1358
  c,
1359
1359
  i
1360
1360
  ), Re(
1361
1361
  e.expansion,
1362
- s,
1362
+ n,
1363
1363
  r,
1364
1364
  i
1365
1365
  ), Fe(e.layout, i), Pe(e.displayLimits, i);
@@ -1440,8 +1440,8 @@ function A(e, i, t) {
1440
1440
  `${i}.end`
1441
1441
  )
1442
1442
  ), l(e.start) && l(e.end)) {
1443
- const n = T(e.start), o = T(e.end);
1444
- n || t.push(
1443
+ const s = T(e.start), o = T(e.end);
1444
+ s || t.push(
1445
1445
  a(
1446
1446
  "invalid_time_window",
1447
1447
  "Absolute time window start must be a valid ISO date or timestamp.",
@@ -1453,7 +1453,7 @@ function A(e, i, t) {
1453
1453
  "Absolute time window end must be a valid ISO date or timestamp.",
1454
1454
  `${i}.end`
1455
1455
  )
1456
- ), n && o && n.getTime() > o.getTime() && t.push(
1456
+ ), s && o && s.getTime() > o.getTime() && t.push(
1457
1457
  a(
1458
1458
  "invalid_time_window",
1459
1459
  "Absolute time window start must be before or equal to end.",
@@ -1501,33 +1501,33 @@ function x(e, i, t) {
1501
1501
  );
1502
1502
  return;
1503
1503
  }
1504
- e.forEach((n, o) => {
1504
+ e.forEach((s, o) => {
1505
1505
  var d;
1506
- const s = `${i}.${o}`;
1507
- if (!u(n)) {
1506
+ const n = `${i}.${o}`;
1507
+ if (!u(s)) {
1508
1508
  t.push(
1509
1509
  a(
1510
1510
  "invalid_analytics_filter",
1511
1511
  "Analytics filter must be a structured object.",
1512
- s
1512
+ n
1513
1513
  )
1514
1514
  );
1515
1515
  return;
1516
1516
  }
1517
- const r = n;
1518
- f(r.field, `${s}.field`, t, {
1517
+ const r = s;
1518
+ f(r.field, `${n}.field`, t, {
1519
1519
  required: !0
1520
1520
  }), r.scope !== void 0 && r.scope !== "row" && r.scope !== "aggregate" && t.push(
1521
1521
  a(
1522
1522
  "invalid_analytics_filter_scope",
1523
1523
  "Analytics filter scope must be row or aggregate.",
1524
- `${s}.scope`
1524
+ `${n}.scope`
1525
1525
  )
1526
1526
  ), r.scope === "aggregate" && ((d = r.field) == null ? void 0 : d.role) !== void 0 && r.field.role !== "measure" && t.push(
1527
1527
  a(
1528
1528
  "invalid_analytics_filter_scope",
1529
1529
  "Aggregate-scope analytics filters must target a measure field.",
1530
- `${s}.scope`
1530
+ `${n}.scope`
1531
1531
  )
1532
1532
  );
1533
1533
  const c = r.operator === "is_null" || r.operator === "is_not_null";
@@ -1535,20 +1535,20 @@ function x(e, i, t) {
1535
1535
  a(
1536
1536
  "invalid_analytics_filter_operator",
1537
1537
  "Analytics filter operator is not supported.",
1538
- `${s}.operator`
1538
+ `${n}.operator`
1539
1539
  )
1540
1540
  ), r.values === void 0 && !c && t.push(
1541
1541
  a(
1542
1542
  "missing_analytics_filter_value",
1543
1543
  "Analytics filter needs values unless it is a null check.",
1544
- s
1544
+ n
1545
1545
  )
1546
1546
  ), c && r.values !== void 0) {
1547
1547
  t.push(
1548
1548
  a(
1549
1549
  "invalid_analytics_filter_values",
1550
1550
  "Null-check analytics filters must not include values.",
1551
- `${s}.values`
1551
+ `${n}.values`
1552
1552
  )
1553
1553
  );
1554
1554
  return;
@@ -1558,7 +1558,7 @@ function x(e, i, t) {
1558
1558
  a(
1559
1559
  "invalid_analytics_filter_values",
1560
1560
  "Analytics filter values must be an array when provided.",
1561
- `${s}.values`
1561
+ `${n}.values`
1562
1562
  )
1563
1563
  );
1564
1564
  return;
@@ -1570,7 +1570,7 @@ function x(e, i, t) {
1570
1570
  a(
1571
1571
  "invalid_analytics_filter_values",
1572
1572
  "Between analytics filters must include exactly two values.",
1573
- `${s}.values`
1573
+ `${n}.values`
1574
1574
  )
1575
1575
  );
1576
1576
  return;
@@ -1579,7 +1579,7 @@ function x(e, i, t) {
1579
1579
  a(
1580
1580
  "invalid_analytics_filter_values",
1581
1581
  "Scalar analytics filters must include exactly one value. Use in/not_in for multiple values.",
1582
- `${s}.values`
1582
+ `${n}.values`
1583
1583
  )
1584
1584
  );
1585
1585
  }
@@ -1683,7 +1683,7 @@ function Ne(e) {
1683
1683
  "Derived field needs at least one typed input.",
1684
1684
  "inputs"
1685
1685
  )
1686
- ) : Object.entries(e.inputs).forEach(([t, n]) => {
1686
+ ) : Object.entries(e.inputs).forEach(([t, s]) => {
1687
1687
  if (!l(t)) {
1688
1688
  i.push(
1689
1689
  a(
@@ -1695,28 +1695,28 @@ function Ne(e) {
1695
1695
  return;
1696
1696
  }
1697
1697
  xe(
1698
- n,
1698
+ s,
1699
1699
  `inputs.${t}`,
1700
1700
  i
1701
1701
  );
1702
1702
  }), l(e.expression) && u(e.inputs)) {
1703
- const t = re(e.expression), n = new Set(t), o = Object.keys(e.inputs).filter(
1704
- (s) => l(s)
1703
+ const t = re(e.expression), s = new Set(t), o = Object.keys(e.inputs).filter(
1704
+ (n) => l(n)
1705
1705
  );
1706
- t.forEach((s) => {
1707
- Object.prototype.hasOwnProperty.call(e.inputs, s) || i.push(
1706
+ t.forEach((n) => {
1707
+ Object.prototype.hasOwnProperty.call(e.inputs, n) || i.push(
1708
1708
  a(
1709
1709
  "invalid_derived_field_expression_token",
1710
- `Derived field expression token "{${s}}" needs a matching inputs.${s} entry.`,
1710
+ `Derived field expression token "{${n}}" needs a matching inputs.${n} entry.`,
1711
1711
  "expression"
1712
1712
  )
1713
1713
  );
1714
- }), o.forEach((s) => {
1715
- n.has(s) || i.push(
1714
+ }), o.forEach((n) => {
1715
+ s.has(n) || i.push(
1716
1716
  a(
1717
1717
  "unused_derived_field_input",
1718
- `Derived field input "${s}" is not referenced by expression.`,
1719
- `inputs.${s}`
1718
+ `Derived field input "${n}" is not referenced by expression.`,
1719
+ `inputs.${n}`
1720
1720
  )
1721
1721
  );
1722
1722
  });
@@ -1752,7 +1752,7 @@ function Ce(e) {
1752
1752
  "Result calculation kind must be percent_of_total, rank, running_total, or previous_row_delta.",
1753
1753
  "kind"
1754
1754
  )
1755
- ), j(e.input, "input", i), we(e.output, "output", i), e.kind === "percent_of_total") {
1755
+ ), j(e.input, "input", i), $e(e.output, "output", i), e.kind === "percent_of_total") {
1756
1756
  const t = e.denominator;
1757
1757
  t !== void 0 && (u(t) ? t.scope === "population" ? (f(t.metric, "denominator.metric", i, {
1758
1758
  required: !0
@@ -1783,7 +1783,7 @@ function Ce(e) {
1783
1783
  ), (e.kind === "running_total" || e.kind === "previous_row_delta") && e.orderBy !== void 0 && j(e.orderBy, "orderBy", i), { ok: i.length === 0, errors: i, warnings: [] };
1784
1784
  }
1785
1785
  function Q(e) {
1786
- var n;
1786
+ var s;
1787
1787
  const i = [], t = [];
1788
1788
  if (!e || typeof e != "object")
1789
1789
  return {
@@ -1814,7 +1814,7 @@ function Q(e) {
1814
1814
  i
1815
1815
  ), e.kind === "metric") {
1816
1816
  const o = Array.isArray(e.measures) ? e.measures.filter(
1817
- (s) => u(s) && l(s.name)
1817
+ (n) => u(n) && l(n.name)
1818
1818
  ) : [];
1819
1819
  if (!Array.isArray(e.measures) || e.measures.length === 0 ? i.push(
1820
1820
  a(
@@ -1823,27 +1823,27 @@ function Q(e) {
1823
1823
  "measures"
1824
1824
  )
1825
1825
  ) : e.measures.some(
1826
- (s) => !u(s) || !l(s.name)
1826
+ (n) => !u(n) || !l(n.name)
1827
1827
  ) && i.push(
1828
1828
  a(
1829
1829
  "invalid_measure_list",
1830
1830
  "Metric intent measures must be an array of field references with names.",
1831
1831
  "measures"
1832
1832
  )
1833
- ), o.forEach((s, r) => {
1834
- f(s, `measures.${r}`, i, {
1833
+ ), o.forEach((n, r) => {
1834
+ f(n, `measures.${r}`, i, {
1835
1835
  required: !0
1836
1836
  });
1837
1837
  }), o.length > 0 && !X(o)) {
1838
- const s = o.find(
1838
+ const n = o.find(
1839
1839
  (r, c) => o.some(
1840
1840
  (d, p) => p !== c && L(d, r)
1841
1841
  )
1842
1842
  );
1843
- s && i.push(
1843
+ n && i.push(
1844
1844
  a(
1845
1845
  "duplicate_measure",
1846
- Z(s),
1846
+ Z(n),
1847
1847
  "measures"
1848
1848
  )
1849
1849
  );
@@ -1875,7 +1875,7 @@ function Q(e) {
1875
1875
  "dimensions"
1876
1876
  )
1877
1877
  ) : Array.isArray(e.dimensions) && e.dimensions.some(
1878
- (s) => !u(s) || !l(s.name)
1878
+ (n) => !u(n) || !l(n.name)
1879
1879
  ) && i.push(
1880
1880
  a(
1881
1881
  "invalid_measure_dimensions",
@@ -1888,8 +1888,8 @@ function Q(e) {
1888
1888
  "Metric timeWindow needs a dateField.",
1889
1889
  "dateField"
1890
1890
  )
1891
- )), x(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((s, r) => {
1892
- f(s, `dimensions.${r}`, i);
1891
+ )), x(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((n, r) => {
1892
+ f(n, `dimensions.${r}`, i);
1893
1893
  }), e.orderBy !== void 0) {
1894
1894
  if (!u(e.orderBy))
1895
1895
  i.push(
@@ -1908,16 +1908,16 @@ function Q(e) {
1908
1908
  "orderBy.direction"
1909
1909
  )
1910
1910
  ), u(e.orderBy.field) && l(e.orderBy.field.name)) {
1911
- const s = [
1911
+ const n = [
1912
1912
  ...o,
1913
1913
  ...e.timeGrain && e.dateField && u(e.dateField) ? [e.dateField] : [],
1914
1914
  ...Array.isArray(e.dimensions) ? e.dimensions.filter(
1915
1915
  (r) => u(r) && l(r.name)
1916
1916
  ) : []
1917
1917
  ];
1918
- s.length > 0 && !ee(
1918
+ n.length > 0 && !ee(
1919
1919
  e.orderBy.field,
1920
- s
1920
+ n
1921
1921
  ) && i.push(
1922
1922
  a(
1923
1923
  "invalid_measure_order_by",
@@ -1928,51 +1928,88 @@ function Q(e) {
1928
1928
  }
1929
1929
  }
1930
1930
  Ee(e, i);
1931
- } else e.kind === "records" ? (!Array.isArray(e.fields) || e.fields.length === 0 ? i.push(
1932
- a(
1933
- "missing_record_fields",
1934
- "Records intent needs at least one field.",
1935
- "fields"
1936
- )
1937
- ) : e.fields.some(
1938
- (o) => !u(o) || !l(o.name)
1939
- ) && i.push(
1940
- a(
1941
- "invalid_record_fields",
1942
- "Records intent fields must be field references with names.",
1943
- "fields"
1944
- )
1945
- ), Array.isArray(e.fields) && e.fields.forEach((o, s) => {
1946
- f(o, `fields.${s}`, i);
1947
- }), e.dateField !== void 0 && f(e.dateField, "dateField", i), N(e.pagination, "pagination", i), e.timeWindow !== void 0 && (A(e.timeWindow, "timeWindow", i), e.dateField || i.push(
1948
- a(
1949
- "missing_time_window_date_field",
1950
- "Records timeWindow needs a dateField.",
1951
- "dateField"
1952
- )
1953
- )), x(e.filters, "filters", i), Array.isArray(e.filters) && e.filters.forEach((o, s) => {
1954
- u(o) && o.scope === "aggregate" && i.push(
1931
+ } else if (e.kind === "records") {
1932
+ if (!Array.isArray(e.fields) || e.fields.length === 0 ? i.push(
1955
1933
  a(
1956
- "unsupported_record_filter_scope",
1957
- "Records intents support row-scope filters only. Use a metric intent for aggregate-scope filters.",
1958
- `filters.${s}.scope`
1934
+ "missing_record_fields",
1935
+ "Records intent needs at least one field.",
1936
+ "fields"
1959
1937
  )
1960
- );
1961
- }), e.orderBy !== void 0 && (u(e.orderBy) ? (f(e.orderBy.field, "orderBy.field", i, {
1962
- required: !0
1963
- }), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
1964
- a(
1965
- "invalid_record_order_direction",
1966
- "Records intent orderBy direction must be asc or desc.",
1967
- "orderBy.direction"
1968
- )
1969
- )) : i.push(
1970
- a(
1971
- "invalid_record_order_by",
1972
- "Records intent orderBy must be a structured object.",
1973
- "orderBy"
1974
- )
1975
- ))) : e.kind === "inputOptions" ? ce(e, i) : e.kind === "matrix" ? Te(e, i) : e.kind === "sql" ? (((n = e.source) == null ? void 0 : n.kind) !== "sql" && i.push(
1938
+ ) : e.fields.some(
1939
+ (o) => !u(o) || !l(o.name)
1940
+ ) && i.push(
1941
+ a(
1942
+ "invalid_record_fields",
1943
+ "Records intent fields must be field references with names.",
1944
+ "fields"
1945
+ )
1946
+ ), Array.isArray(e.fields) && e.fields.forEach((o, n) => {
1947
+ f(o, `fields.${n}`, i);
1948
+ }), e.dateField !== void 0 && f(e.dateField, "dateField", i), N(e.pagination, "pagination", i), e.timeWindow !== void 0 && (A(e.timeWindow, "timeWindow", i), e.dateField || i.push(
1949
+ a(
1950
+ "missing_time_window_date_field",
1951
+ "Records timeWindow needs a dateField.",
1952
+ "dateField"
1953
+ )
1954
+ )), x(e.filters, "filters", i), Array.isArray(e.filters) && e.filters.forEach((o, n) => {
1955
+ u(o) && o.scope === "aggregate" && i.push(
1956
+ a(
1957
+ "unsupported_record_filter_scope",
1958
+ "Records intents support row-scope filters only. Use a metric intent for aggregate-scope filters.",
1959
+ `filters.${n}.scope`
1960
+ )
1961
+ );
1962
+ }), e.orderBy !== void 0 && (u(e.orderBy) ? (f(e.orderBy.field, "orderBy.field", i, {
1963
+ required: !0
1964
+ }), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
1965
+ a(
1966
+ "invalid_record_order_direction",
1967
+ "Records intent orderBy direction must be asc or desc.",
1968
+ "orderBy.direction"
1969
+ )
1970
+ )) : i.push(
1971
+ a(
1972
+ "invalid_record_order_by",
1973
+ "Records intent orderBy must be a structured object.",
1974
+ "orderBy"
1975
+ )
1976
+ )), e.totals !== void 0)
1977
+ if (!u(e.totals))
1978
+ i.push(
1979
+ a(
1980
+ "invalid_records_totals",
1981
+ "Records totals must be a structured server totals request.",
1982
+ "totals"
1983
+ )
1984
+ );
1985
+ else {
1986
+ e.totals.mode !== "server" && i.push(
1987
+ a(
1988
+ "invalid_records_totals",
1989
+ "Records totals mode must be server.",
1990
+ "totals.mode"
1991
+ )
1992
+ );
1993
+ const o = e.totals.measures;
1994
+ !Array.isArray(o) || o.length === 0 ? i.push(
1995
+ a(
1996
+ "missing_records_totals_measures",
1997
+ "Records server totals need at least one measure.",
1998
+ "totals.measures"
1999
+ )
2000
+ ) : o.forEach((n, r) => {
2001
+ f(n, `totals.measures.${r}`, i, {
2002
+ required: !0
2003
+ }), (!u(n) || n.role !== "measure") && i.push(
2004
+ a(
2005
+ "invalid_records_totals_measure",
2006
+ "Records server totals measures must be measure field references.",
2007
+ `totals.measures.${r}.role`
2008
+ )
2009
+ );
2010
+ });
2011
+ }
2012
+ } else e.kind === "inputOptions" ? ce(e, i) : e.kind === "matrix" ? Te(e, i) : e.kind === "sql" ? (((s = e.source) == null ? void 0 : s.kind) !== "sql" && i.push(
1976
2013
  a(
1977
2014
  "invalid_sql_source",
1978
2015
  "SQL analytics intent must use a SQL execution source.",
@@ -1984,8 +2021,8 @@ function Q(e) {
1984
2021
  e.defaultParameters,
1985
2022
  "defaultParameters",
1986
2023
  i
1987
- ), Array.isArray(e.fields) && e.fields.forEach((o, s) => {
1988
- f(o, `fields.${s}`, i);
2024
+ ), Array.isArray(e.fields) && e.fields.forEach((o, n) => {
2025
+ f(o, `fields.${n}`, i);
1989
2026
  }), N(e.pagination, "pagination", i)) : i.push(
1990
2027
  a(
1991
2028
  "invalid_analytics_kind",
@@ -2012,13 +2049,13 @@ function Oe(e, i) {
2012
2049
  );
2013
2050
  return;
2014
2051
  }
2015
- e.derivedFields.forEach((t, n) => {
2052
+ e.derivedFields.forEach((t, s) => {
2016
2053
  Ne(
2017
2054
  t
2018
- ).errors.forEach((s) => {
2055
+ ).errors.forEach((n) => {
2019
2056
  i.push({
2020
- ...s,
2021
- path: s.path ? `derivedFields.${n}.${s.path}` : `derivedFields.${n}`
2057
+ ...n,
2058
+ path: n.path ? `derivedFields.${s}.${n.path}` : `derivedFields.${s}`
2022
2059
  });
2023
2060
  });
2024
2061
  });
@@ -2056,14 +2093,14 @@ function je(e) {
2056
2093
  "Answer-obligations operation intent needs at least one obligation.",
2057
2094
  "obligations"
2058
2095
  )
2059
- ) : e.obligations.forEach((n, o) => {
2060
- l(n.id) || i.push(
2096
+ ) : e.obligations.forEach((s, o) => {
2097
+ l(s.id) || i.push(
2061
2098
  a(
2062
2099
  "missing_obligation_id",
2063
2100
  "Each analytics obligation needs an id.",
2064
2101
  `obligations.${o}.id`
2065
2102
  )
2066
- ), l(n.prompt) || i.push(
2103
+ ), l(s.prompt) || i.push(
2067
2104
  a(
2068
2105
  "missing_obligation_prompt",
2069
2106
  "Each analytics obligation needs a prompt.",
@@ -2079,10 +2116,10 @@ function je(e) {
2079
2116
  "instruction"
2080
2117
  )
2081
2118
  ), e.analyticsIntent) {
2082
- const n = Q(
2119
+ const s = Q(
2083
2120
  e.analyticsIntent
2084
2121
  );
2085
- i.push(...n.errors), t.push(...n.warnings);
2122
+ i.push(...s.errors), t.push(...s.warnings);
2086
2123
  }
2087
2124
  } else
2088
2125
  i.push(
@@ -2127,10 +2164,10 @@ function Le(e) {
2127
2164
  "kind"
2128
2165
  )
2129
2166
  );
2130
- const n = je(
2167
+ const s = je(
2131
2168
  e.operationIntent
2132
2169
  );
2133
- return i.push(...n.errors), t.push(...n.warnings), Array.isArray(e.plannedToolCalls) || i.push(
2170
+ return i.push(...s.errors), t.push(...s.warnings), Array.isArray(e.plannedToolCalls) || i.push(
2134
2171
  a(
2135
2172
  "invalid_planned_tool_calls",
2136
2173
  "Recovery plan plannedToolCalls must be an array.",
@@ -2232,7 +2269,7 @@ function Be(e) {
2232
2269
  }
2233
2270
  }).filter((i) => !!i);
2234
2271
  }
2235
- function qe(e, i, t, n) {
2272
+ function qe(e, i, t, s) {
2236
2273
  if (!e || typeof e != "object") {
2237
2274
  t.push(
2238
2275
  a("invalid_view", "Dashboard view must be an object.", i)
@@ -2252,7 +2289,7 @@ function qe(e, i, t, n) {
2252
2289
  return;
2253
2290
  }
2254
2291
  if (e.presentation.kind === "text") {
2255
- l(e.text) || n.push(
2292
+ l(e.text) || s.push(
2256
2293
  a(
2257
2294
  "missing_text_content",
2258
2295
  "Text views should include text content.",
@@ -2279,20 +2316,20 @@ function qe(e, i, t, n) {
2279
2316
  )
2280
2317
  );
2281
2318
  const o = Q(e.analytics);
2282
- for (const s of o.errors)
2319
+ for (const n of o.errors)
2283
2320
  t.push(
2284
2321
  a(
2285
- s.code,
2286
- s.message,
2287
- `${i}.analytics${s.path ? `.${s.path}` : ""}`
2322
+ n.code,
2323
+ n.message,
2324
+ `${i}.analytics${n.path ? `.${n.path}` : ""}`
2288
2325
  )
2289
2326
  );
2290
- for (const s of o.warnings)
2291
- n.push(
2327
+ for (const n of o.warnings)
2328
+ s.push(
2292
2329
  a(
2293
- s.code,
2294
- s.message,
2295
- `${i}.analytics${s.path ? `.${s.path}` : ""}`
2330
+ n.code,
2331
+ n.message,
2332
+ `${i}.analytics${n.path ? `.${n.path}` : ""}`
2296
2333
  )
2297
2334
  );
2298
2335
  }
@@ -2316,8 +2353,8 @@ function Ue(e) {
2316
2353
  ), l(e.title) || i.push(
2317
2354
  a("missing_title", "Dashboard intent needs a title.", "title")
2318
2355
  );
2319
- const n = Array.isArray(e.inputs) ? e.inputs : [], o = $(
2320
- n.filter(u).map((d) => d.id).filter((d) => typeof d == "string")
2356
+ const s = Array.isArray(e.inputs) ? e.inputs : [], o = w(
2357
+ s.filter(u).map((d) => d.id).filter((d) => typeof d == "string")
2321
2358
  );
2322
2359
  o && i.push(
2323
2360
  a(
@@ -2326,7 +2363,7 @@ function Ue(e) {
2326
2363
  "inputs"
2327
2364
  )
2328
2365
  );
2329
- for (const [d, p] of n.entries()) {
2366
+ for (const [d, p] of s.entries()) {
2330
2367
  const m = `inputs.${d}`;
2331
2368
  if (!u(p)) {
2332
2369
  i.push(
@@ -2342,17 +2379,17 @@ function Ue(e) {
2342
2379
  a("missing_input_field", "Input needs a field.", `${m}.field`)
2343
2380
  ) : f(p.field, `${m}.field`, i);
2344
2381
  }
2345
- const s = Array.isArray(e.sections) ? e.sections : [];
2346
- s.length === 0 && i.push(
2382
+ const n = Array.isArray(e.sections) ? e.sections : [];
2383
+ n.length === 0 && i.push(
2347
2384
  a(
2348
2385
  "missing_sections",
2349
2386
  "Dashboard intent needs at least one section.",
2350
2387
  "sections"
2351
2388
  )
2352
2389
  );
2353
- const r = s.flatMap(
2390
+ const r = n.flatMap(
2354
2391
  (d) => d && typeof d == "object" && Array.isArray(d.views) ? d.views.filter(u).map((p) => p.id).filter((p) => !!p) : []
2355
- ), c = $(r);
2392
+ ), c = w(r);
2356
2393
  c && i.push(
2357
2394
  a(
2358
2395
  "duplicate_view_id",
@@ -2360,7 +2397,7 @@ function Ue(e) {
2360
2397
  "sections"
2361
2398
  )
2362
2399
  );
2363
- for (const [d, p] of s.entries()) {
2400
+ for (const [d, p] of n.entries()) {
2364
2401
  const m = `sections.${d}`;
2365
2402
  if (!p || typeof p != "object") {
2366
2403
  i.push(