react-semaphor 0.1.349 → 0.1.351

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 (43) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +1 -1
  3. package/dist/chunks/{calendar-preferences-dialog-gMb9JPpz.js → calendar-preferences-dialog-BAEeX-ug.js} +1 -1
  4. package/dist/chunks/{calendar-preferences-dialog-C2vX2dga.js → calendar-preferences-dialog-C8flqOjZ.js} +1 -1
  5. package/dist/chunks/{dashboard-briefing-launcher-DjzTWk1f.js → dashboard-briefing-launcher--zBBsBWm.js} +1 -1
  6. package/dist/chunks/{dashboard-briefing-launcher-Cx4NkJil.js → dashboard-briefing-launcher-DU9x-97H.js} +3 -3
  7. package/dist/chunks/{dashboard-controls-Yo3L7krV.js → dashboard-controls-BwMjIqjP.js} +3 -3
  8. package/dist/chunks/{dashboard-controls-BTz9RgtD.js → dashboard-controls-CMShL7m9.js} +1 -1
  9. package/dist/chunks/{dashboard-json-3_OGzDQh.js → dashboard-json-CHKC0bf-.js} +1 -1
  10. package/dist/chunks/{dashboard-json-OLpSyYFR.js → dashboard-json-kD_jszqF.js} +1 -1
  11. package/dist/chunks/{edit-dashboard-visual-073yhfDG.js → edit-dashboard-visual-C1RUXsWi.js} +3 -3
  12. package/dist/chunks/{edit-dashboard-visual-DXzKEyXJ.js → edit-dashboard-visual-C1vIFm6H.js} +1 -1
  13. package/dist/chunks/{index-DTSZ23bE.js → index-BJLPtQeK.js} +5425 -5432
  14. package/dist/chunks/{index-Alj8oDV1.js → index-D2ai-cZQ.js} +48 -48
  15. package/dist/chunks/{resource-management-panel-BvTTEaef.js → resource-management-panel-UkMvz7Cp.js} +2 -2
  16. package/dist/chunks/{resource-management-panel-DLJ6uWYJ.js → resource-management-panel-f4Od7wCB.js} +1 -1
  17. package/dist/chunks/{use-create-flow-overlay-state-BMr_844V.js → use-create-flow-overlay-state-C49F2KdU.js} +1 -1
  18. package/dist/chunks/{use-create-flow-overlay-state-gRSXj8dj.js → use-create-flow-overlay-state-jpQ2BxKF.js} +2 -2
  19. package/dist/chunks/{use-visual-utils-7w01KGK7.js → use-visual-utils-CiN4zNkZ.js} +1 -1
  20. package/dist/chunks/{use-visual-utils-D5zrmYt8.js → use-visual-utils-D8Pe1PSH.js} +1 -1
  21. package/dist/chunks/{validators-B-NiYgGc.js → validators-BnLhuIhd.js} +189 -176
  22. package/dist/chunks/validators-Cu_w8ZEP.js +1 -0
  23. package/dist/dashboard/index.cjs +1 -1
  24. package/dist/dashboard/index.js +1 -1
  25. package/dist/dashboard-authoring/index.cjs +1 -1
  26. package/dist/dashboard-authoring/index.js +1 -1
  27. package/dist/data-app-builder/index.cjs +1 -1
  28. package/dist/data-app-builder/index.js +1 -1
  29. package/dist/data-app-sdk/index.cjs +1 -1
  30. package/dist/data-app-sdk/index.js +1 -1
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.js +5 -5
  33. package/dist/style.css +1 -1
  34. package/dist/surfboard/index.cjs +1 -1
  35. package/dist/surfboard/index.js +2 -2
  36. package/dist/types/analytics-protocol.d.ts +8 -0
  37. package/dist/types/dashboard-assistant.d.ts +8 -0
  38. package/dist/types/dashboard-authoring.d.ts +8 -0
  39. package/dist/types/data-app-builder.d.ts +8 -0
  40. package/dist/types/data-app-sdk.d.ts +8 -0
  41. package/dist/types/main.d.ts +8 -0
  42. package/package.json +1 -1
  43. package/dist/chunks/validators-DlEfynH8.js +0 -1
@@ -1,12 +1,12 @@
1
1
  import { s as R } from "./source-identity-qAmkNtEK.js";
2
- function n(e, i, t) {
3
- return t ? { code: e, message: i, path: t } : { code: e, message: i };
2
+ function t(e, i, s) {
3
+ return s ? { code: e, message: i, path: s } : { code: e, message: i };
4
4
  }
5
5
  function T(e) {
6
6
  for (let i = 0; i < e.length; i += 1) {
7
- const t = e[i];
7
+ const s = e[i];
8
8
  if (e.some(
9
- (r, o) => o !== i && S(r, t)
9
+ (r, o) => o !== i && S(r, s)
10
10
  ))
11
11
  return !1;
12
12
  }
@@ -48,9 +48,9 @@ const q = /^(\d{4})-(\d{2})-(\d{2})$/, U = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d
48
48
  function A(e) {
49
49
  if (typeof e != "string")
50
50
  return null;
51
- const i = e.trim(), t = q.exec(i);
52
- if (t) {
53
- const [, v, b, w] = t;
51
+ const i = e.trim(), s = q.exec(i);
52
+ if (s) {
53
+ const [, v, b, w] = s;
54
54
  return M(v, b, w) ? new Date(
55
55
  Date.UTC(Number(v), Number(b) - 1, Number(w))
56
56
  ) : null;
@@ -58,22 +58,22 @@ function A(e) {
58
58
  const r = U.exec(i);
59
59
  if (!r)
60
60
  return null;
61
- const [, o, a, s, p, c, l = "00", , f] = r;
62
- if (!M(o, a, s) || !_(p, 0, 23) || !_(c, 0, 59) || !_(l, 0, 59) || !P(f))
61
+ const [, o, a, n, p, c, l = "00", , f] = r;
62
+ if (!M(o, a, n) || !_(p, 0, 23) || !_(c, 0, 59) || !_(l, 0, 59) || !P(f))
63
63
  return null;
64
64
  const h = new Date(i);
65
65
  return Number.isFinite(h.getTime()) ? h : null;
66
66
  }
67
- function M(e, i, t) {
68
- const r = Number(e), o = Number(i), a = Number(t);
67
+ function M(e, i, s) {
68
+ const r = Number(e), o = Number(i), a = Number(s);
69
69
  if (!Number.isInteger(r) || !Number.isInteger(o) || !Number.isInteger(a) || o < 1 || o > 12)
70
70
  return !1;
71
- const s = new Date(Date.UTC(r, o - 1, a));
72
- return s.getUTCFullYear() === r && s.getUTCMonth() === o - 1 && s.getUTCDate() === a;
71
+ const n = new Date(Date.UTC(r, o - 1, a));
72
+ return n.getUTCFullYear() === r && n.getUTCMonth() === o - 1 && n.getUTCDate() === a;
73
73
  }
74
- function _(e, i, t) {
74
+ function _(e, i, s) {
75
75
  const r = Number(e);
76
- return Number.isInteger(r) && r >= i && r <= t;
76
+ return Number.isInteger(r) && r >= i && r <= s;
77
77
  }
78
78
  function P(e) {
79
79
  if (e === "Z")
@@ -89,10 +89,10 @@ function u(e) {
89
89
  }
90
90
  function $(e) {
91
91
  const i = /* @__PURE__ */ new Set();
92
- for (const t of e) {
93
- if (i.has(t))
94
- return t;
95
- i.add(t);
92
+ for (const s of e) {
93
+ if (i.has(s))
94
+ return s;
95
+ i.add(s);
96
96
  }
97
97
  return null;
98
98
  }
@@ -105,20 +105,20 @@ const G = /* @__PURE__ */ new Set([
105
105
  "MEDIAN",
106
106
  "DISTINCT"
107
107
  ]);
108
- function k(e, i, t) {
108
+ function k(e, i, s) {
109
109
  if (!e || typeof e != "object") {
110
- t.push(n("missing_source", "Analytics intent needs a source.", i));
110
+ s.push(t("missing_source", "Analytics intent needs a source.", i));
111
111
  return;
112
112
  }
113
113
  if (e.kind === "semantic") {
114
- d(e.domainId) || t.push(
115
- n(
114
+ d(e.domainId) || s.push(
115
+ t(
116
116
  "missing_semantic_domain",
117
117
  "Semantic source needs a domainId.",
118
118
  `${i}.domainId`
119
119
  )
120
- ), d(e.datasetName) || t.push(
121
- n(
120
+ ), d(e.datasetName) || s.push(
121
+ t(
122
122
  "missing_dataset_name",
123
123
  "Semantic source needs a datasetName.",
124
124
  `${i}.datasetName`
@@ -127,14 +127,14 @@ function k(e, i, t) {
127
127
  return;
128
128
  }
129
129
  if (e.kind === "physical") {
130
- d(e.connectionId) || t.push(
131
- n(
130
+ d(e.connectionId) || s.push(
131
+ t(
132
132
  "missing_connection_id",
133
133
  "Physical source needs a connectionId.",
134
134
  `${i}.connectionId`
135
135
  )
136
- ), d(e.tableName) || t.push(
137
- n(
136
+ ), d(e.tableName) || s.push(
137
+ t(
138
138
  "missing_table_name",
139
139
  "Physical source needs a tableName.",
140
140
  `${i}.tableName`
@@ -143,8 +143,8 @@ function k(e, i, t) {
143
143
  return;
144
144
  }
145
145
  if (e.kind === "sql") {
146
- d(e.connectionId) || t.push(
147
- n(
146
+ d(e.connectionId) || s.push(
147
+ t(
148
148
  "missing_connection_id",
149
149
  "SQL source needs a connectionId.",
150
150
  `${i}.connectionId`
@@ -152,22 +152,22 @@ function k(e, i, t) {
152
152
  );
153
153
  return;
154
154
  }
155
- t.push(n("invalid_source_kind", "Source kind is not supported.", i));
155
+ s.push(t("invalid_source_kind", "Source kind is not supported.", i));
156
156
  }
157
- function m(e, i, t, r = {}) {
157
+ function m(e, i, s, r = {}) {
158
158
  if (!e || !u(e)) {
159
- r.required && t.push(
160
- n("missing_field_ref", "Field reference needs a name.", i)
159
+ r.required && s.push(
160
+ t("missing_field_ref", "Field reference needs a name.", i)
161
161
  );
162
162
  return;
163
163
  }
164
- d(e.name) || t.push(
165
- n("missing_field_ref", "Field reference needs a name.", `${i}.name`)
166
- ), e.source !== void 0 && k(e.source, `${i}.source`, t), H(e.aggregate, `${i}.aggregate`, t);
164
+ d(e.name) || s.push(
165
+ t("missing_field_ref", "Field reference needs a name.", `${i}.name`)
166
+ ), e.source !== void 0 && k(e.source, `${i}.source`, s), H(e.aggregate, `${i}.aggregate`, s);
167
167
  }
168
- function H(e, i, t) {
169
- e !== void 0 && (typeof e != "string" || !G.has(e)) && t.push(
170
- n(
168
+ function H(e, i, s) {
169
+ e !== void 0 && (typeof e != "string" || !G.has(e)) && s.push(
170
+ t(
171
171
  "invalid_aggregate",
172
172
  "Field aggregate must be SUM, COUNT, AVG, MIN, MAX, MEDIAN, or DISTINCT.",
173
173
  i
@@ -179,7 +179,7 @@ function L(e, i) {
179
179
  return;
180
180
  if (!u(e.analysis)) {
181
181
  i.push(
182
- n(
182
+ t(
183
183
  "invalid_metric_analysis",
184
184
  "Metric analysis must be a structured object.",
185
185
  "analysis"
@@ -189,7 +189,7 @@ function L(e, i) {
189
189
  }
190
190
  if (e.analysis.kind !== "period_change") {
191
191
  i.push(
192
- n(
192
+ t(
193
193
  "invalid_metric_analysis",
194
194
  "Metric analysis kind is not supported.",
195
195
  "analysis.kind"
@@ -198,31 +198,31 @@ function L(e, i) {
198
198
  return;
199
199
  }
200
200
  e.dateField || i.push(
201
- n(
201
+ t(
202
202
  "missing_analysis_date_field",
203
203
  "Period-change analysis needs a dateField.",
204
204
  "dateField"
205
205
  )
206
206
  ), e.timeGrain || i.push(
207
- n(
207
+ t(
208
208
  "missing_analysis_time_grain",
209
209
  "Period-change analysis needs a timeGrain.",
210
210
  "timeGrain"
211
211
  )
212
212
  ), e.analysis.orderBy !== void 0 && e.analysis.orderBy !== "absolute_change" && e.analysis.orderBy !== "positive_change" && e.analysis.orderBy !== "negative_change" && e.analysis.orderBy !== "period" && i.push(
213
- n(
213
+ t(
214
214
  "invalid_metric_analysis",
215
215
  "Period-change analysis orderBy must be absolute_change, positive_change, negative_change, or period.",
216
216
  "analysis.orderBy"
217
217
  )
218
218
  );
219
- const { timeWindow: t } = e.analysis;
220
- t !== void 0 && N(t, "analysis.timeWindow", i);
219
+ const { timeWindow: s } = e.analysis;
220
+ s !== void 0 && N(s, "analysis.timeWindow", i);
221
221
  }
222
- function N(e, i, t) {
222
+ function N(e, i, s) {
223
223
  if (!u(e)) {
224
- t.push(
225
- n(
224
+ s.push(
225
+ t(
226
226
  "invalid_time_window",
227
227
  "Time window must be a structured object.",
228
228
  i
@@ -230,41 +230,41 @@ function N(e, i, t) {
230
230
  );
231
231
  return;
232
232
  }
233
- if (e.kind !== void 0 && e.kind !== "relative" && e.kind !== "absolute" && t.push(
234
- n(
233
+ if (e.kind !== void 0 && e.kind !== "relative" && e.kind !== "absolute" && s.push(
234
+ t(
235
235
  "invalid_time_window",
236
236
  "Time window kind must be relative or absolute.",
237
237
  `${i}.kind`
238
238
  )
239
239
  ), e.kind === "absolute") {
240
- if (d(e.start) || t.push(
241
- n(
240
+ if (d(e.start) || s.push(
241
+ t(
242
242
  "invalid_time_window",
243
243
  "Absolute time window start must be a non-empty ISO date or timestamp string.",
244
244
  `${i}.start`
245
245
  )
246
- ), d(e.end) || t.push(
247
- n(
246
+ ), d(e.end) || s.push(
247
+ t(
248
248
  "invalid_time_window",
249
249
  "Absolute time window end must be a non-empty ISO date or timestamp string.",
250
250
  `${i}.end`
251
251
  )
252
252
  ), d(e.start) && d(e.end)) {
253
253
  const r = A(e.start), o = A(e.end);
254
- r || t.push(
255
- n(
254
+ r || s.push(
255
+ t(
256
256
  "invalid_time_window",
257
257
  "Absolute time window start must be a valid ISO date or timestamp.",
258
258
  `${i}.start`
259
259
  )
260
- ), o || t.push(
261
- n(
260
+ ), o || s.push(
261
+ t(
262
262
  "invalid_time_window",
263
263
  "Absolute time window end must be a valid ISO date or timestamp.",
264
264
  `${i}.end`
265
265
  )
266
- ), r && o && r.getTime() > o.getTime() && t.push(
267
- n(
266
+ ), r && o && r.getTime() > o.getTime() && s.push(
267
+ t(
268
268
  "invalid_time_window",
269
269
  "Absolute time window start must be before or equal to end.",
270
270
  i
@@ -273,37 +273,37 @@ function N(e, i, t) {
273
273
  }
274
274
  return;
275
275
  }
276
- e.unit !== "second" && e.unit !== "minute" && e.unit !== "hour" && e.unit !== "day" && e.unit !== "week" && e.unit !== "month" && e.unit !== "quarter" && e.unit !== "year" && t.push(
277
- n(
276
+ e.unit !== "second" && e.unit !== "minute" && e.unit !== "hour" && e.unit !== "day" && e.unit !== "week" && e.unit !== "month" && e.unit !== "quarter" && e.unit !== "year" && s.push(
277
+ t(
278
278
  "invalid_time_window",
279
279
  "Time window unit must be second, minute, hour, day, week, month, quarter, or year.",
280
280
  `${i}.unit`
281
281
  )
282
- ), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) && t.push(
283
- n(
282
+ ), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) && s.push(
283
+ t(
284
284
  "invalid_time_window",
285
285
  "Time window value must be a positive number.",
286
286
  `${i}.value`
287
287
  )
288
- ), e.anchor !== void 0 && e.anchor !== "now" && e.anchor !== "latest_available" && t.push(
289
- n(
288
+ ), e.anchor !== void 0 && e.anchor !== "now" && e.anchor !== "latest_available" && s.push(
289
+ t(
290
290
  "invalid_time_window",
291
291
  "Time window anchor must be now or latest_available.",
292
292
  `${i}.anchor`
293
293
  )
294
- ), e.completeness !== void 0 && e.completeness !== "include_partial" && e.completeness !== "complete_periods" && t.push(
295
- n(
294
+ ), e.completeness !== void 0 && e.completeness !== "include_partial" && e.completeness !== "complete_periods" && s.push(
295
+ t(
296
296
  "invalid_time_window",
297
297
  "Time window completeness must be include_partial or complete_periods.",
298
298
  `${i}.completeness`
299
299
  )
300
300
  );
301
301
  }
302
- function V(e, i, t) {
302
+ function V(e, i, s) {
303
303
  if (e !== void 0) {
304
304
  if (!Array.isArray(e)) {
305
- t.push(
306
- n(
305
+ s.push(
306
+ t(
307
307
  "invalid_analytics_filters",
308
308
  "Analytics filters must be an array.",
309
309
  i
@@ -312,10 +312,11 @@ function V(e, i, t) {
312
312
  return;
313
313
  }
314
314
  e.forEach((r, o) => {
315
+ var c;
315
316
  const a = `${i}.${o}`;
316
317
  if (!u(r)) {
317
- t.push(
318
- n(
318
+ s.push(
319
+ t(
319
320
  "invalid_analytics_filter",
320
321
  "Analytics filter must be a structured object.",
321
322
  a
@@ -323,26 +324,38 @@ function V(e, i, t) {
323
324
  );
324
325
  return;
325
326
  }
326
- const s = r;
327
- m(s.field, `${a}.field`, t, {
327
+ const n = r;
328
+ m(n.field, `${a}.field`, s, {
328
329
  required: !0
329
- });
330
- const p = s.operator === "is_null" || s.operator === "is_not_null";
331
- if (s.operator !== void 0 && s.operator !== "=" && s.operator !== "!=" && s.operator !== "in" && s.operator !== "not_in" && s.operator !== "contains" && s.operator !== "not_contains" && s.operator !== "between" && s.operator !== "not_between" && s.operator !== ">" && s.operator !== ">=" && s.operator !== "<" && s.operator !== "<=" && s.operator !== "is_null" && s.operator !== "is_not_null" && t.push(
332
- n(
330
+ }), n.scope !== void 0 && n.scope !== "row" && n.scope !== "aggregate" && s.push(
331
+ t(
332
+ "invalid_analytics_filter_scope",
333
+ "Analytics filter scope must be row or aggregate.",
334
+ `${a}.scope`
335
+ )
336
+ ), n.scope === "aggregate" && ((c = n.field) == null ? void 0 : c.role) !== void 0 && n.field.role !== "measure" && s.push(
337
+ t(
338
+ "invalid_analytics_filter_scope",
339
+ "Aggregate-scope analytics filters must target a measure field.",
340
+ `${a}.scope`
341
+ )
342
+ );
343
+ const p = n.operator === "is_null" || n.operator === "is_not_null";
344
+ if (n.operator !== void 0 && n.operator !== "=" && n.operator !== "!=" && n.operator !== "in" && n.operator !== "not_in" && n.operator !== "contains" && n.operator !== "not_contains" && n.operator !== "between" && n.operator !== "not_between" && n.operator !== ">" && n.operator !== ">=" && n.operator !== "<" && n.operator !== "<=" && n.operator !== "is_null" && n.operator !== "is_not_null" && s.push(
345
+ t(
333
346
  "invalid_analytics_filter_operator",
334
347
  "Analytics filter operator is not supported.",
335
348
  `${a}.operator`
336
349
  )
337
- ), s.values === void 0 && !p && t.push(
338
- n(
350
+ ), n.values === void 0 && !p && s.push(
351
+ t(
339
352
  "missing_analytics_filter_value",
340
353
  "Analytics filter needs values unless it is a null check.",
341
354
  a
342
355
  )
343
- ), p && s.values !== void 0) {
344
- t.push(
345
- n(
356
+ ), p && n.values !== void 0) {
357
+ s.push(
358
+ t(
346
359
  "invalid_analytics_filter_values",
347
360
  "Null-check analytics filters must not include values.",
348
361
  `${a}.values`
@@ -350,9 +363,9 @@ function V(e, i, t) {
350
363
  );
351
364
  return;
352
365
  }
353
- if (s.values !== void 0 && !Array.isArray(s.values)) {
354
- t.push(
355
- n(
366
+ if (n.values !== void 0 && !Array.isArray(n.values)) {
367
+ s.push(
368
+ t(
356
369
  "invalid_analytics_filter_values",
357
370
  "Analytics filter values must be an array when provided.",
358
371
  `${a}.values`
@@ -360,11 +373,11 @@ function V(e, i, t) {
360
373
  );
361
374
  return;
362
375
  }
363
- if (s.values !== void 0) {
364
- const c = s.values.length;
365
- if (s.operator === "between" || s.operator === "not_between") {
366
- c !== 2 && t.push(
367
- n(
376
+ if (n.values !== void 0) {
377
+ const l = n.values.length;
378
+ if (n.operator === "between" || n.operator === "not_between") {
379
+ l !== 2 && s.push(
380
+ t(
368
381
  "invalid_analytics_filter_values",
369
382
  "Between analytics filters must include exactly two values.",
370
383
  `${a}.values`
@@ -372,8 +385,8 @@ function V(e, i, t) {
372
385
  );
373
386
  return;
374
387
  }
375
- (s.operator === "contains" || s.operator === "not_contains" || s.operator === "=" || s.operator === "!=" || s.operator === ">" || s.operator === ">=" || s.operator === "<" || s.operator === "<=" || s.operator === void 0) && c !== 1 && t.push(
376
- n(
388
+ (n.operator === "contains" || n.operator === "not_contains" || n.operator === "=" || n.operator === "!=" || n.operator === ">" || n.operator === ">=" || n.operator === "<" || n.operator === "<=" || n.operator === void 0) && l !== 1 && s.push(
389
+ t(
377
390
  "invalid_analytics_filter_values",
378
391
  "Scalar analytics filters must include exactly one value. Use in/not_in for multiple values.",
379
392
  `${a}.values`
@@ -385,17 +398,17 @@ function V(e, i, t) {
385
398
  }
386
399
  function B(e) {
387
400
  var r;
388
- const i = [], t = [];
401
+ const i = [], s = [];
389
402
  if (!e || typeof e != "object")
390
403
  return {
391
404
  ok: !1,
392
405
  errors: [
393
- n(
406
+ t(
394
407
  "invalid_analytics_intent",
395
408
  "Analytics intent must be a structured object."
396
409
  )
397
410
  ],
398
- warnings: t,
411
+ warnings: s,
399
412
  repairHints: [
400
413
  {
401
414
  code: "invalid_analytics_intent",
@@ -404,33 +417,33 @@ function B(e) {
404
417
  ]
405
418
  };
406
419
  if (e.version !== void 0 && e.version !== 1 && i.push(
407
- n("invalid_version", "Analytics intent version must be 1.", "version")
420
+ t("invalid_version", "Analytics intent version must be 1.", "version")
408
421
  ), k(e.source, "source", i), e.kind === "metric") {
409
422
  const o = Array.isArray(e.metrics) ? e.metrics.filter(
410
423
  (a) => u(a) && d(a.name)
411
424
  ) : [];
412
425
  if (!Array.isArray(e.metrics) || e.metrics.length === 0 ? i.push(
413
- n("missing_metric", "Metric intent needs at least one metric.", "metrics")
426
+ t("missing_metric", "Metric intent needs at least one metric.", "metrics")
414
427
  ) : e.metrics.some(
415
428
  (a) => !u(a) || !d(a.name)
416
429
  ) && i.push(
417
- n(
430
+ t(
418
431
  "invalid_metric_list",
419
432
  "Metric intent metrics must be an array of field references with names.",
420
433
  "metrics"
421
434
  )
422
- ), o.forEach((a, s) => {
423
- m(a, `metrics.${s}`, i, {
435
+ ), o.forEach((a, n) => {
436
+ m(a, `metrics.${n}`, i, {
424
437
  required: !0
425
438
  });
426
439
  }), o.length > 0 && !T(o)) {
427
440
  const a = o.find(
428
- (s, p) => o.some(
429
- (c, l) => l !== p && S(c, s)
441
+ (n, p) => o.some(
442
+ (c, l) => l !== p && S(c, n)
430
443
  )
431
444
  );
432
445
  a && i.push(
433
- n(
446
+ t(
434
447
  "duplicate_metric",
435
448
  F(a),
436
449
  "metrics"
@@ -441,7 +454,7 @@ function B(e) {
441
454
  e.primaryMetric,
442
455
  o
443
456
  ).length > 1 && i.push(
444
- n(
457
+ t(
445
458
  "ambiguous_primary_metric",
446
459
  "Metric intent primaryMetric must identify exactly one selected metric.",
447
460
  "primaryMetric"
@@ -452,13 +465,13 @@ function B(e) {
452
465
  e.primaryMetric,
453
466
  o
454
467
  ) && i.push(
455
- n(
468
+ t(
456
469
  "invalid_primary_metric",
457
470
  "Metric intent primaryMetric must match one metric field reference.",
458
471
  "primaryMetric"
459
472
  )
460
473
  )), e.dimensions !== void 0 && !Array.isArray(e.dimensions) ? i.push(
461
- n(
474
+ t(
462
475
  "invalid_metric_dimensions",
463
476
  "Metric intent dimensions must be an array of field references.",
464
477
  "dimensions"
@@ -466,23 +479,23 @@ function B(e) {
466
479
  ) : Array.isArray(e.dimensions) && e.dimensions.some(
467
480
  (a) => !u(a) || !d(a.name)
468
481
  ) && i.push(
469
- n(
482
+ t(
470
483
  "invalid_metric_dimensions",
471
484
  "Metric intent dimensions must be an array of field references with names.",
472
485
  "dimensions"
473
486
  )
474
487
  ), e.dateField !== void 0 && m(e.dateField, "dateField", i), e.timeWindow !== void 0 && (N(e.timeWindow, "timeWindow", i), e.dateField || i.push(
475
- n(
488
+ t(
476
489
  "missing_time_window_date_field",
477
490
  "Metric timeWindow needs a dateField.",
478
491
  "dateField"
479
492
  )
480
- )), V(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((a, s) => {
481
- m(a, `dimensions.${s}`, i);
493
+ )), V(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((a, n) => {
494
+ m(a, `dimensions.${n}`, i);
482
495
  }), e.orderBy !== void 0) {
483
496
  if (!u(e.orderBy))
484
497
  i.push(
485
- n(
498
+ t(
486
499
  "invalid_metric_order_by",
487
500
  "Metric intent orderBy must be a structured object.",
488
501
  "orderBy"
@@ -491,7 +504,7 @@ function B(e) {
491
504
  else if (m(e.orderBy.field, "orderBy.field", i, {
492
505
  required: !0
493
506
  }), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
494
- n(
507
+ t(
495
508
  "invalid_metric_order_direction",
496
509
  "Metric intent orderBy direction must be asc or desc.",
497
510
  "orderBy.direction"
@@ -501,14 +514,14 @@ function B(e) {
501
514
  ...o,
502
515
  ...e.timeGrain && e.dateField && u(e.dateField) ? [e.dateField] : [],
503
516
  ...Array.isArray(e.dimensions) ? e.dimensions.filter(
504
- (s) => u(s) && d(s.name)
517
+ (n) => u(n) && d(n.name)
505
518
  ) : []
506
519
  ];
507
520
  a.length > 0 && !j(
508
521
  e.orderBy.field,
509
522
  a
510
523
  ) && i.push(
511
- n(
524
+ t(
512
525
  "invalid_metric_order_by",
513
526
  "Metric intent orderBy.field must match one selected metric, grouped dateField, or dimension.",
514
527
  "orderBy.field"
@@ -518,7 +531,7 @@ function B(e) {
518
531
  }
519
532
  L(e, i);
520
533
  } else e.kind === "records" ? (!Array.isArray(e.fields) || e.fields.length === 0 ? i.push(
521
- n(
534
+ t(
522
535
  "missing_record_fields",
523
536
  "Records intent needs at least one field.",
524
537
  "fields"
@@ -526,7 +539,7 @@ function B(e) {
526
539
  ) : e.fields.some(
527
540
  (o) => !u(o) || !d(o.name)
528
541
  ) && i.push(
529
- n(
542
+ t(
530
543
  "invalid_record_fields",
531
544
  "Records intent fields must be field references with names.",
532
545
  "fields"
@@ -536,53 +549,53 @@ function B(e) {
536
549
  }), e.dateField !== void 0 && m(e.dateField, "dateField", i), e.orderBy !== void 0 && (u(e.orderBy) ? (m(e.orderBy.field, "orderBy.field", i, {
537
550
  required: !0
538
551
  }), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
539
- n(
552
+ t(
540
553
  "invalid_record_order_direction",
541
554
  "Records intent orderBy direction must be asc or desc.",
542
555
  "orderBy.direction"
543
556
  )
544
557
  )) : i.push(
545
- n(
558
+ t(
546
559
  "invalid_record_order_by",
547
560
  "Records intent orderBy must be a structured object.",
548
561
  "orderBy"
549
562
  )
550
563
  ))) : e.kind === "inputOptions" ? ((!e.field || !d(e.field.name)) && i.push(
551
- n(
564
+ t(
552
565
  "missing_input_options_field",
553
566
  "Input options intent needs a field.",
554
567
  "field"
555
568
  )
556
569
  ), m(e.field, "field", i, { required: !0 })) : e.kind === "sql" ? (((r = e.source) == null ? void 0 : r.kind) !== "sql" && i.push(
557
- n(
570
+ t(
558
571
  "invalid_sql_source",
559
572
  "SQL analytics intent must use a SQL execution source.",
560
573
  "source"
561
574
  )
562
- ), d(e.sql) || i.push(n("missing_sql", "SQL analytics intent needs SQL text.", "sql")), Array.isArray(e.fields) && e.fields.forEach((o, a) => {
575
+ ), d(e.sql) || i.push(t("missing_sql", "SQL analytics intent needs SQL text.", "sql")), Array.isArray(e.fields) && e.fields.forEach((o, a) => {
563
576
  m(o, `fields.${a}`, i);
564
577
  })) : i.push(
565
- n("invalid_analytics_kind", "Analytics kind is not supported.", "kind")
578
+ t("invalid_analytics_kind", "Analytics kind is not supported.", "kind")
566
579
  );
567
580
  return {
568
581
  ok: i.length === 0,
569
582
  errors: i,
570
- warnings: t,
583
+ warnings: s,
571
584
  repairHints: X(i)
572
585
  };
573
586
  }
574
587
  function Q(e) {
575
- const i = [], t = [];
588
+ const i = [], s = [];
576
589
  if (!e || typeof e != "object")
577
590
  return {
578
591
  ok: !1,
579
592
  errors: [
580
- n(
593
+ t(
581
594
  "invalid_operation_intent",
582
595
  "Operation intent must be a structured object."
583
596
  )
584
597
  ],
585
- warnings: t,
598
+ warnings: s,
586
599
  repairHints: [
587
600
  {
588
601
  code: "invalid_operation_intent",
@@ -591,23 +604,23 @@ function Q(e) {
591
604
  ]
592
605
  };
593
606
  if (e.version !== 1 && i.push(
594
- n("invalid_version", "Operation intent version must be 1.", "version")
607
+ t("invalid_version", "Operation intent version must be 1.", "version")
595
608
  ), e.kind === "answer_obligations")
596
609
  !Array.isArray(e.obligations) || e.obligations.length === 0 ? i.push(
597
- n(
610
+ t(
598
611
  "missing_obligations",
599
612
  "Answer-obligations operation intent needs at least one obligation.",
600
613
  "obligations"
601
614
  )
602
615
  ) : e.obligations.forEach((r, o) => {
603
616
  d(r.id) || i.push(
604
- n(
617
+ t(
605
618
  "missing_obligation_id",
606
619
  "Each analytics obligation needs an id.",
607
620
  `obligations.${o}.id`
608
621
  )
609
622
  ), d(r.prompt) || i.push(
610
- n(
623
+ t(
611
624
  "missing_obligation_prompt",
612
625
  "Each analytics obligation needs a prompt.",
613
626
  `obligations.${o}.prompt`
@@ -616,7 +629,7 @@ function Q(e) {
616
629
  });
617
630
  else if (e.kind === "dashboard_change" || e.kind === "data_app_change") {
618
631
  if (d(e.instruction) || i.push(
619
- n(
632
+ t(
620
633
  "missing_instruction",
621
634
  "Change operation intent needs an instruction.",
622
635
  "instruction"
@@ -625,11 +638,11 @@ function Q(e) {
625
638
  const r = B(
626
639
  e.analyticsIntent
627
640
  );
628
- i.push(...r.errors), t.push(...r.warnings);
641
+ i.push(...r.errors), s.push(...r.warnings);
629
642
  }
630
643
  } else
631
644
  i.push(
632
- n(
645
+ t(
633
646
  "invalid_operation_kind",
634
647
  "Operation intent kind is not supported.",
635
648
  "kind"
@@ -638,22 +651,22 @@ function Q(e) {
638
651
  return {
639
652
  ok: i.length === 0,
640
653
  errors: i,
641
- warnings: t,
654
+ warnings: s,
642
655
  repairHints: x(i)
643
656
  };
644
657
  }
645
658
  function z(e) {
646
- const i = [], t = [];
659
+ const i = [], s = [];
647
660
  if (!e || typeof e != "object")
648
661
  return {
649
662
  ok: !1,
650
663
  errors: [
651
- n(
664
+ t(
652
665
  "invalid_recovery_plan",
653
666
  "Analytics recovery plan must be a structured object."
654
667
  )
655
668
  ],
656
- warnings: t,
669
+ warnings: s,
657
670
  repairHints: [
658
671
  {
659
672
  code: "invalid_recovery_plan",
@@ -662,17 +675,17 @@ function z(e) {
662
675
  ]
663
676
  };
664
677
  e.version !== 1 && i.push(
665
- n("invalid_version", "Recovery plan version must be 1.", "version")
678
+ t("invalid_version", "Recovery plan version must be 1.", "version")
666
679
  ), e.kind !== "analytics_recovery_plan" && i.push(
667
- n(
680
+ t(
668
681
  "invalid_recovery_plan_kind",
669
682
  "Recovery plan kind must be analytics_recovery_plan.",
670
683
  "kind"
671
684
  )
672
685
  );
673
686
  const r = Q(e.operationIntent);
674
- return i.push(...r.errors), t.push(...r.warnings), Array.isArray(e.plannedToolCalls) || i.push(
675
- n(
687
+ return i.push(...r.errors), s.push(...r.warnings), Array.isArray(e.plannedToolCalls) || i.push(
688
+ t(
676
689
  "invalid_planned_tool_calls",
677
690
  "Recovery plan plannedToolCalls must be an array.",
678
691
  "plannedToolCalls"
@@ -680,7 +693,7 @@ function z(e) {
680
693
  ), {
681
694
  ok: i.length === 0,
682
695
  errors: i,
683
- warnings: t,
696
+ warnings: s,
684
697
  repairHints: x(i)
685
698
  };
686
699
  }
@@ -743,14 +756,14 @@ function X(e) {
743
756
  }
744
757
  }).filter((i) => !!i);
745
758
  }
746
- function Y(e, i, t, r) {
759
+ function Y(e, i, s, r) {
747
760
  if (!e || typeof e != "object") {
748
- t.push(n("invalid_view", "Dashboard view must be an object.", i));
761
+ s.push(t("invalid_view", "Dashboard view must be an object.", i));
749
762
  return;
750
763
  }
751
- if (d(e.title) || t.push(n("missing_view_title", "Dashboard view needs a title.", i)), !e.presentation || typeof e.presentation != "object") {
752
- t.push(
753
- n(
764
+ if (d(e.title) || s.push(t("missing_view_title", "Dashboard view needs a title.", i)), !e.presentation || typeof e.presentation != "object") {
765
+ s.push(
766
+ t(
754
767
  "missing_presentation",
755
768
  "Dashboard view needs a presentation.",
756
769
  `${i}.presentation`
@@ -760,7 +773,7 @@ function Y(e, i, t, r) {
760
773
  }
761
774
  if (e.presentation.kind === "text") {
762
775
  d(e.text) || r.push(
763
- n(
776
+ t(
764
777
  "missing_text_content",
765
778
  "Text views should include text content.",
766
779
  `${i}.text`
@@ -769,8 +782,8 @@ function Y(e, i, t, r) {
769
782
  return;
770
783
  }
771
784
  if (!e.analytics) {
772
- t.push(
773
- n(
785
+ s.push(
786
+ t(
774
787
  "missing_view_analytics",
775
788
  "Non-text dashboard views need analytics intent.",
776
789
  `${i}.analytics`
@@ -780,12 +793,12 @@ function Y(e, i, t, r) {
780
793
  }
781
794
  const o = B(e.analytics);
782
795
  for (const a of o.errors)
783
- t.push(
784
- n(a.code, a.message, `${i}.analytics${a.path ? `.${a.path}` : ""}`)
796
+ s.push(
797
+ t(a.code, a.message, `${i}.analytics${a.path ? `.${a.path}` : ""}`)
785
798
  );
786
799
  for (const a of o.warnings)
787
800
  r.push(
788
- n(
801
+ t(
789
802
  a.code,
790
803
  a.message,
791
804
  `${i}.analytics${a.path ? `.${a.path}` : ""}`
@@ -793,24 +806,24 @@ function Y(e, i, t, r) {
793
806
  );
794
807
  }
795
808
  function J(e) {
796
- const i = [], t = [];
809
+ const i = [], s = [];
797
810
  if (!e || typeof e != "object")
798
811
  return {
799
812
  ok: !1,
800
813
  errors: [
801
- n(
814
+ t(
802
815
  "invalid_dashboard_intent",
803
816
  "Dashboard intent must be a structured object."
804
817
  )
805
818
  ],
806
- warnings: t
819
+ warnings: s
807
820
  };
808
- e.version !== 1 && i.push(n("invalid_version", "Dashboard intent version must be 1.")), e.kind !== "dashboard" && i.push(n("invalid_kind", "Experience intent kind must be dashboard.")), d(e.title) || i.push(n("missing_title", "Dashboard intent needs a title.", "title"));
821
+ e.version !== 1 && i.push(t("invalid_version", "Dashboard intent version must be 1.")), e.kind !== "dashboard" && i.push(t("invalid_kind", "Experience intent kind must be dashboard.")), d(e.title) || i.push(t("missing_title", "Dashboard intent needs a title.", "title"));
809
822
  const r = Array.isArray(e.inputs) ? e.inputs : [], o = $(
810
823
  r.filter(u).map((c) => c.id).filter((c) => typeof c == "string")
811
824
  );
812
825
  o && i.push(
813
- n(
826
+ t(
814
827
  "duplicate_input_id",
815
828
  `Duplicate input id: ${o}.`,
816
829
  "inputs"
@@ -819,28 +832,28 @@ function J(e) {
819
832
  for (const [c, l] of r.entries()) {
820
833
  const f = `inputs.${c}`;
821
834
  if (!u(l)) {
822
- i.push(n("invalid_input", "Dashboard input must be an object.", f));
835
+ i.push(t("invalid_input", "Dashboard input must be an object.", f));
823
836
  continue;
824
837
  }
825
- d(l.id) || i.push(n("missing_input_id", "Input needs an id.", `${f}.id`)), d(l.label) || i.push(
826
- n("missing_input_label", "Input needs a label.", `${f}.label`)
838
+ d(l.id) || i.push(t("missing_input_id", "Input needs an id.", `${f}.id`)), d(l.label) || i.push(
839
+ t("missing_input_label", "Input needs a label.", `${f}.label`)
827
840
  ), !l.field || !d(l.field.name) ? i.push(
828
- n("missing_input_field", "Input needs a field.", `${f}.field`)
841
+ t("missing_input_field", "Input needs a field.", `${f}.field`)
829
842
  ) : m(l.field, `${f}.field`, i);
830
843
  }
831
844
  const a = Array.isArray(e.sections) ? e.sections : [];
832
845
  a.length === 0 && i.push(
833
- n(
846
+ t(
834
847
  "missing_sections",
835
848
  "Dashboard intent needs at least one section.",
836
849
  "sections"
837
850
  )
838
851
  );
839
- const s = a.flatMap(
852
+ const n = a.flatMap(
840
853
  (c) => c && typeof c == "object" && Array.isArray(c.views) ? c.views.filter(u).map((l) => l.id).filter((l) => !!l) : []
841
- ), p = $(s);
854
+ ), p = $(n);
842
855
  p && i.push(
843
- n(
856
+ t(
844
857
  "duplicate_view_id",
845
858
  `Duplicate dashboard view id: ${p}.`,
846
859
  "sections"
@@ -850,15 +863,15 @@ function J(e) {
850
863
  const f = `sections.${c}`;
851
864
  if (!l || typeof l != "object") {
852
865
  i.push(
853
- n("invalid_section", "Dashboard section must be an object.", f)
866
+ t("invalid_section", "Dashboard section must be an object.", f)
854
867
  );
855
868
  continue;
856
869
  }
857
870
  if (d(l.title) || i.push(
858
- n("missing_section_title", "Dashboard section needs a title.", f)
871
+ t("missing_section_title", "Dashboard section needs a title.", f)
859
872
  ), !Array.isArray(l.views) || l.views.length === 0) {
860
873
  i.push(
861
- n(
874
+ t(
862
875
  "missing_section_views",
863
876
  "Dashboard section needs at least one view.",
864
877
  `${f}.views`
@@ -871,10 +884,10 @@ function J(e) {
871
884
  v,
872
885
  `${f}.views.${h}`,
873
886
  i,
874
- t
887
+ s
875
888
  );
876
889
  }
877
- return { ok: i.length === 0, errors: i, warnings: t };
890
+ return { ok: i.length === 0, errors: i, warnings: s };
878
891
  }
879
892
  export {
880
893
  Q as a,