react-semaphor 0.1.494 → 0.1.496

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