react-semaphor 0.1.345 → 0.1.347

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.
@@ -40,14 +40,14 @@ function L(e, i) {
40
40
  source: e.source && i.source ? N(e.source, i.source) : e.source || i.source
41
41
  };
42
42
  }
43
- function a(e, i, s) {
44
- return s ? { code: e, message: i, path: s } : { code: e, message: i };
43
+ function a(e, i, n) {
44
+ return n ? { code: e, message: i, path: n } : { code: e, message: i };
45
45
  }
46
46
  function R(e) {
47
47
  for (let i = 0; i < e.length; i += 1) {
48
- const s = e[i];
48
+ const n = e[i];
49
49
  if (e.some(
50
- (o, r) => r !== i && b(o, s)
50
+ (o, r) => r !== i && b(o, n)
51
51
  ))
52
52
  return !1;
53
53
  }
@@ -93,10 +93,10 @@ function c(e) {
93
93
  }
94
94
  function v(e) {
95
95
  const i = /* @__PURE__ */ new Set();
96
- for (const s of e) {
97
- if (i.has(s))
98
- return s;
99
- i.add(s);
96
+ for (const n of e) {
97
+ if (i.has(n))
98
+ return n;
99
+ i.add(n);
100
100
  }
101
101
  return null;
102
102
  }
@@ -109,19 +109,19 @@ const C = /* @__PURE__ */ new Set([
109
109
  "MEDIAN",
110
110
  "DISTINCT"
111
111
  ]);
112
- function A(e, i, s) {
112
+ function A(e, i, n) {
113
113
  if (!e || typeof e != "object") {
114
- s.push(a("missing_source", "Analytics intent needs a source.", i));
114
+ n.push(a("missing_source", "Analytics intent needs a source.", i));
115
115
  return;
116
116
  }
117
117
  if (e.kind === "semantic") {
118
- d(e.domainId) || s.push(
118
+ d(e.domainId) || n.push(
119
119
  a(
120
120
  "missing_semantic_domain",
121
121
  "Semantic source needs a domainId.",
122
122
  `${i}.domainId`
123
123
  )
124
- ), d(e.datasetName) || s.push(
124
+ ), d(e.datasetName) || n.push(
125
125
  a(
126
126
  "missing_dataset_name",
127
127
  "Semantic source needs a datasetName.",
@@ -131,13 +131,13 @@ function A(e, i, s) {
131
131
  return;
132
132
  }
133
133
  if (e.kind === "physical") {
134
- d(e.connectionId) || s.push(
134
+ d(e.connectionId) || n.push(
135
135
  a(
136
136
  "missing_connection_id",
137
137
  "Physical source needs a connectionId.",
138
138
  `${i}.connectionId`
139
139
  )
140
- ), d(e.tableName) || s.push(
140
+ ), d(e.tableName) || n.push(
141
141
  a(
142
142
  "missing_table_name",
143
143
  "Physical source needs a tableName.",
@@ -147,7 +147,7 @@ function A(e, i, s) {
147
147
  return;
148
148
  }
149
149
  if (e.kind === "sql") {
150
- d(e.connectionId) || s.push(
150
+ d(e.connectionId) || n.push(
151
151
  a(
152
152
  "missing_connection_id",
153
153
  "SQL source needs a connectionId.",
@@ -156,21 +156,21 @@ function A(e, i, s) {
156
156
  );
157
157
  return;
158
158
  }
159
- s.push(a("invalid_source_kind", "Source kind is not supported.", i));
159
+ n.push(a("invalid_source_kind", "Source kind is not supported.", i));
160
160
  }
161
- function f(e, i, s, o = {}) {
161
+ function f(e, i, n, o = {}) {
162
162
  if (!e || !c(e)) {
163
- o.required && s.push(
163
+ o.required && n.push(
164
164
  a("missing_field_ref", "Field reference needs a name.", i)
165
165
  );
166
166
  return;
167
167
  }
168
- d(e.name) || s.push(
168
+ d(e.name) || n.push(
169
169
  a("missing_field_ref", "Field reference needs a name.", `${i}.name`)
170
- ), e.source !== void 0 && A(e.source, `${i}.source`, s), E(e.aggregate, `${i}.aggregate`, s);
170
+ ), e.source !== void 0 && A(e.source, `${i}.source`, n), E(e.aggregate, `${i}.aggregate`, n);
171
171
  }
172
- function E(e, i, s) {
173
- e !== void 0 && (typeof e != "string" || !C.has(e)) && s.push(
172
+ function E(e, i, n) {
173
+ e !== void 0 && (typeof e != "string" || !C.has(e)) && n.push(
174
174
  a(
175
175
  "invalid_aggregate",
176
176
  "Field aggregate must be SUM, COUNT, AVG, MIN, MAX, MEDIAN, or DISTINCT.",
@@ -220,12 +220,12 @@ function P(e, i) {
220
220
  "analysis.orderBy"
221
221
  )
222
222
  );
223
- const { timeWindow: s } = e.analysis;
224
- s !== void 0 && k(s, "analysis.timeWindow", i);
223
+ const { timeWindow: n } = e.analysis;
224
+ n !== void 0 && w(n, "analysis.timeWindow", i);
225
225
  }
226
- function k(e, i, s) {
226
+ function w(e, i, n) {
227
227
  if (!c(e)) {
228
- s.push(
228
+ n.push(
229
229
  a(
230
230
  "invalid_time_window",
231
231
  "Time window must be a structured object.",
@@ -234,25 +234,25 @@ function k(e, i, s) {
234
234
  );
235
235
  return;
236
236
  }
237
- 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(
237
+ e.unit !== "second" && e.unit !== "minute" && e.unit !== "hour" && e.unit !== "day" && e.unit !== "week" && e.unit !== "month" && e.unit !== "quarter" && e.unit !== "year" && n.push(
238
238
  a(
239
239
  "invalid_time_window",
240
240
  "Time window unit must be second, minute, hour, day, week, month, quarter, or year.",
241
241
  `${i}.unit`
242
242
  )
243
- ), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) && s.push(
243
+ ), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) && n.push(
244
244
  a(
245
245
  "invalid_time_window",
246
246
  "Time window value must be a positive number.",
247
247
  `${i}.value`
248
248
  )
249
- ), e.anchor !== void 0 && e.anchor !== "now" && e.anchor !== "latest_available" && s.push(
249
+ ), e.anchor !== void 0 && e.anchor !== "now" && e.anchor !== "latest_available" && n.push(
250
250
  a(
251
251
  "invalid_time_window",
252
252
  "Time window anchor must be now or latest_available.",
253
253
  `${i}.anchor`
254
254
  )
255
- ), e.completeness !== void 0 && e.completeness !== "include_partial" && e.completeness !== "complete_periods" && s.push(
255
+ ), e.completeness !== void 0 && e.completeness !== "include_partial" && e.completeness !== "complete_periods" && n.push(
256
256
  a(
257
257
  "invalid_time_window",
258
258
  "Time window completeness must be include_partial or complete_periods.",
@@ -260,10 +260,10 @@ function k(e, i, s) {
260
260
  )
261
261
  );
262
262
  }
263
- function O(e, i, s) {
263
+ function O(e, i, n) {
264
264
  if (e !== void 0) {
265
265
  if (!Array.isArray(e)) {
266
- s.push(
266
+ n.push(
267
267
  a(
268
268
  "invalid_analytics_filters",
269
269
  "Analytics filters must be an array.",
@@ -273,57 +273,80 @@ function O(e, i, s) {
273
273
  return;
274
274
  }
275
275
  e.forEach((o, r) => {
276
- const n = `${i}.${r}`;
276
+ const t = `${i}.${r}`;
277
277
  if (!c(o)) {
278
- s.push(
278
+ n.push(
279
279
  a(
280
280
  "invalid_analytics_filter",
281
281
  "Analytics filter must be a structured object.",
282
- n
282
+ t
283
283
  )
284
284
  );
285
285
  return;
286
286
  }
287
- const t = o;
288
- f(t.field, `${n}.field`, s, {
287
+ const s = o;
288
+ f(s.field, `${t}.field`, n, {
289
289
  required: !0
290
290
  });
291
- const p = t.operator === "is_null" || t.operator === "is_not_null";
292
- if (t.operator !== void 0 && t.operator !== "=" && t.operator !== "!=" && t.operator !== "in" && t.operator !== "not_in" && t.operator !== "contains" && t.operator !== "not_contains" && t.operator !== "between" && t.operator !== "not_between" && t.operator !== ">" && t.operator !== ">=" && t.operator !== "<" && t.operator !== "<=" && t.operator !== "is_null" && t.operator !== "is_not_null" && s.push(
291
+ const m = s.operator === "is_null" || s.operator === "is_not_null";
292
+ 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" && n.push(
293
293
  a(
294
294
  "invalid_analytics_filter_operator",
295
295
  "Analytics filter operator is not supported.",
296
- `${n}.operator`
296
+ `${t}.operator`
297
297
  )
298
- ), t.values === void 0 && !p && s.push(
298
+ ), s.values === void 0 && !m && n.push(
299
299
  a(
300
300
  "missing_analytics_filter_value",
301
301
  "Analytics filter needs values unless it is a null check.",
302
- n
302
+ t
303
303
  )
304
- ), p && t.values !== void 0) {
305
- s.push(
304
+ ), m && s.values !== void 0) {
305
+ n.push(
306
306
  a(
307
307
  "invalid_analytics_filter_values",
308
308
  "Null-check analytics filters must not include values.",
309
- `${n}.values`
309
+ `${t}.values`
310
310
  )
311
311
  );
312
312
  return;
313
313
  }
314
- t.values !== void 0 && !Array.isArray(t.values) && s.push(
315
- a(
316
- "invalid_analytics_filter_values",
317
- "Analytics filter values must be an array when provided.",
318
- `${n}.values`
319
- )
320
- );
314
+ if (s.values !== void 0 && !Array.isArray(s.values)) {
315
+ n.push(
316
+ a(
317
+ "invalid_analytics_filter_values",
318
+ "Analytics filter values must be an array when provided.",
319
+ `${t}.values`
320
+ )
321
+ );
322
+ return;
323
+ }
324
+ if (s.values !== void 0) {
325
+ const u = s.values.length;
326
+ if (s.operator === "between" || s.operator === "not_between") {
327
+ u !== 2 && n.push(
328
+ a(
329
+ "invalid_analytics_filter_values",
330
+ "Between analytics filters must include exactly two values.",
331
+ `${t}.values`
332
+ )
333
+ );
334
+ return;
335
+ }
336
+ (s.operator === "contains" || s.operator === "not_contains" || s.operator === "=" || s.operator === "!=" || s.operator === ">" || s.operator === ">=" || s.operator === "<" || s.operator === "<=" || s.operator === void 0) && u !== 1 && n.push(
337
+ a(
338
+ "invalid_analytics_filter_values",
339
+ "Scalar analytics filters must include exactly one value. Use in/not_in for multiple values.",
340
+ `${t}.values`
341
+ )
342
+ );
343
+ }
321
344
  });
322
345
  }
323
346
  }
324
- function w(e) {
347
+ function k(e) {
325
348
  var o;
326
- const i = [], s = [];
349
+ const i = [], n = [];
327
350
  if (!e || typeof e != "object")
328
351
  return {
329
352
  ok: !1,
@@ -333,7 +356,7 @@ function w(e) {
333
356
  "Analytics intent must be a structured object."
334
357
  )
335
358
  ],
336
- warnings: s,
359
+ warnings: n,
337
360
  repairHints: [
338
361
  {
339
362
  code: "invalid_analytics_intent",
@@ -345,32 +368,32 @@ function w(e) {
345
368
  a("invalid_version", "Analytics intent version must be 1.", "version")
346
369
  ), A(e.source, "source", i), e.kind === "metric") {
347
370
  const r = Array.isArray(e.metrics) ? e.metrics.filter(
348
- (n) => c(n) && d(n.name)
371
+ (t) => c(t) && d(t.name)
349
372
  ) : [];
350
373
  if (!Array.isArray(e.metrics) || e.metrics.length === 0 ? i.push(
351
374
  a("missing_metric", "Metric intent needs at least one metric.", "metrics")
352
375
  ) : e.metrics.some(
353
- (n) => !c(n) || !d(n.name)
376
+ (t) => !c(t) || !d(t.name)
354
377
  ) && i.push(
355
378
  a(
356
379
  "invalid_metric_list",
357
380
  "Metric intent metrics must be an array of field references with names.",
358
381
  "metrics"
359
382
  )
360
- ), r.forEach((n, t) => {
361
- f(n, `metrics.${t}`, i, {
383
+ ), r.forEach((t, s) => {
384
+ f(t, `metrics.${s}`, i, {
362
385
  required: !0
363
386
  });
364
387
  }), r.length > 0 && !R(r)) {
365
- const n = r.find(
366
- (t, p) => r.some(
367
- (u, l) => l !== p && b(u, t)
388
+ const t = r.find(
389
+ (s, m) => r.some(
390
+ (u, l) => l !== m && b(u, s)
368
391
  )
369
392
  );
370
- n && i.push(
393
+ t && i.push(
371
394
  a(
372
395
  "duplicate_metric",
373
- F(n),
396
+ F(t),
374
397
  "metrics"
375
398
  )
376
399
  );
@@ -402,21 +425,21 @@ function w(e) {
402
425
  "dimensions"
403
426
  )
404
427
  ) : Array.isArray(e.dimensions) && e.dimensions.some(
405
- (n) => !c(n) || !d(n.name)
428
+ (t) => !c(t) || !d(t.name)
406
429
  ) && i.push(
407
430
  a(
408
431
  "invalid_metric_dimensions",
409
432
  "Metric intent dimensions must be an array of field references with names.",
410
433
  "dimensions"
411
434
  )
412
- ), e.dateField !== void 0 && f(e.dateField, "dateField", i), e.timeWindow !== void 0 && (k(e.timeWindow, "timeWindow", i), e.dateField || i.push(
435
+ ), e.dateField !== void 0 && f(e.dateField, "dateField", i), e.timeWindow !== void 0 && (w(e.timeWindow, "timeWindow", i), e.dateField || i.push(
413
436
  a(
414
437
  "missing_time_window_date_field",
415
438
  "Metric timeWindow needs a dateField.",
416
439
  "dateField"
417
440
  )
418
- )), O(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((n, t) => {
419
- f(n, `dimensions.${t}`, i);
441
+ )), O(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((t, s) => {
442
+ f(t, `dimensions.${s}`, i);
420
443
  }), e.orderBy !== void 0) {
421
444
  if (!c(e.orderBy))
422
445
  i.push(
@@ -435,16 +458,16 @@ function w(e) {
435
458
  "orderBy.direction"
436
459
  )
437
460
  ), c(e.orderBy.field) && d(e.orderBy.field.name)) {
438
- const n = [
461
+ const t = [
439
462
  ...r,
440
463
  ...e.timeGrain && e.dateField && c(e.dateField) ? [e.dateField] : [],
441
464
  ...Array.isArray(e.dimensions) ? e.dimensions.filter(
442
- (t) => c(t) && d(t.name)
465
+ (s) => c(s) && d(s.name)
443
466
  ) : []
444
467
  ];
445
- n.length > 0 && !x(
468
+ t.length > 0 && !x(
446
469
  e.orderBy.field,
447
- n
470
+ t
448
471
  ) && i.push(
449
472
  a(
450
473
  "invalid_metric_order_by",
@@ -469,8 +492,8 @@ function w(e) {
469
492
  "Records intent fields must be field references with names.",
470
493
  "fields"
471
494
  )
472
- ), Array.isArray(e.fields) && e.fields.forEach((r, n) => {
473
- f(r, `fields.${n}`, i);
495
+ ), Array.isArray(e.fields) && e.fields.forEach((r, t) => {
496
+ f(r, `fields.${t}`, i);
474
497
  }), e.dateField !== void 0 && f(e.dateField, "dateField", i), e.orderBy !== void 0 && (c(e.orderBy) ? (f(e.orderBy.field, "orderBy.field", i, {
475
498
  required: !0
476
499
  }), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
@@ -497,20 +520,20 @@ function w(e) {
497
520
  "SQL analytics intent must use a SQL execution source.",
498
521
  "source"
499
522
  )
500
- ), d(e.sql) || i.push(a("missing_sql", "SQL analytics intent needs SQL text.", "sql")), Array.isArray(e.fields) && e.fields.forEach((r, n) => {
501
- f(r, `fields.${n}`, i);
523
+ ), d(e.sql) || i.push(a("missing_sql", "SQL analytics intent needs SQL text.", "sql")), Array.isArray(e.fields) && e.fields.forEach((r, t) => {
524
+ f(r, `fields.${t}`, i);
502
525
  })) : i.push(
503
526
  a("invalid_analytics_kind", "Analytics kind is not supported.", "kind")
504
527
  );
505
528
  return {
506
529
  ok: i.length === 0,
507
530
  errors: i,
508
- warnings: s,
509
- repairHints: U(i)
531
+ warnings: n,
532
+ repairHints: H(i)
510
533
  };
511
534
  }
512
- function H(e) {
513
- const i = [], s = [];
535
+ function U(e) {
536
+ const i = [], n = [];
514
537
  if (!e || typeof e != "object")
515
538
  return {
516
539
  ok: !1,
@@ -520,7 +543,7 @@ function H(e) {
520
543
  "Operation intent must be a structured object."
521
544
  )
522
545
  ],
523
- warnings: s,
546
+ warnings: n,
524
547
  repairHints: [
525
548
  {
526
549
  code: "invalid_operation_intent",
@@ -560,10 +583,10 @@ function H(e) {
560
583
  "instruction"
561
584
  )
562
585
  ), e.analyticsIntent) {
563
- const o = w(
586
+ const o = k(
564
587
  e.analyticsIntent
565
588
  );
566
- i.push(...o.errors), s.push(...o.warnings);
589
+ i.push(...o.errors), n.push(...o.warnings);
567
590
  }
568
591
  } else
569
592
  i.push(
@@ -576,12 +599,12 @@ function H(e) {
576
599
  return {
577
600
  ok: i.length === 0,
578
601
  errors: i,
579
- warnings: s,
602
+ warnings: n,
580
603
  repairHints: I(i)
581
604
  };
582
605
  }
583
606
  function Q(e) {
584
- const i = [], s = [];
607
+ const i = [], n = [];
585
608
  if (!e || typeof e != "object")
586
609
  return {
587
610
  ok: !1,
@@ -591,7 +614,7 @@ function Q(e) {
591
614
  "Analytics recovery plan must be a structured object."
592
615
  )
593
616
  ],
594
- warnings: s,
617
+ warnings: n,
595
618
  repairHints: [
596
619
  {
597
620
  code: "invalid_recovery_plan",
@@ -608,8 +631,8 @@ function Q(e) {
608
631
  "kind"
609
632
  )
610
633
  );
611
- const o = H(e.operationIntent);
612
- return i.push(...o.errors), s.push(...o.warnings), Array.isArray(e.plannedToolCalls) || i.push(
634
+ const o = U(e.operationIntent);
635
+ return i.push(...o.errors), n.push(...o.warnings), Array.isArray(e.plannedToolCalls) || i.push(
613
636
  a(
614
637
  "invalid_planned_tool_calls",
615
638
  "Recovery plan plannedToolCalls must be an array.",
@@ -618,7 +641,7 @@ function Q(e) {
618
641
  ), {
619
642
  ok: i.length === 0,
620
643
  errors: i,
621
- warnings: s,
644
+ warnings: n,
622
645
  repairHints: I(i)
623
646
  };
624
647
  }
@@ -628,7 +651,7 @@ function I(e) {
628
651
  recommendedNextStep: i.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."
629
652
  }));
630
653
  }
631
- function U(e) {
654
+ function H(e) {
632
655
  return e.map((i) => {
633
656
  switch (i.code) {
634
657
  case "missing_source":
@@ -681,13 +704,13 @@ function U(e) {
681
704
  }
682
705
  }).filter((i) => !!i);
683
706
  }
684
- function G(e, i, s, o) {
707
+ function G(e, i, n, o) {
685
708
  if (!e || typeof e != "object") {
686
- s.push(a("invalid_view", "Dashboard view must be an object.", i));
709
+ n.push(a("invalid_view", "Dashboard view must be an object.", i));
687
710
  return;
688
711
  }
689
- if (d(e.title) || s.push(a("missing_view_title", "Dashboard view needs a title.", i)), !e.presentation || typeof e.presentation != "object") {
690
- s.push(
712
+ if (d(e.title) || n.push(a("missing_view_title", "Dashboard view needs a title.", i)), !e.presentation || typeof e.presentation != "object") {
713
+ n.push(
691
714
  a(
692
715
  "missing_presentation",
693
716
  "Dashboard view needs a presentation.",
@@ -707,7 +730,7 @@ function G(e, i, s, o) {
707
730
  return;
708
731
  }
709
732
  if (!e.analytics) {
710
- s.push(
733
+ n.push(
711
734
  a(
712
735
  "missing_view_analytics",
713
736
  "Non-text dashboard views need analytics intent.",
@@ -716,22 +739,22 @@ function G(e, i, s, o) {
716
739
  );
717
740
  return;
718
741
  }
719
- const r = w(e.analytics);
720
- for (const n of r.errors)
721
- s.push(
722
- a(n.code, n.message, `${i}.analytics${n.path ? `.${n.path}` : ""}`)
742
+ const r = k(e.analytics);
743
+ for (const t of r.errors)
744
+ n.push(
745
+ a(t.code, t.message, `${i}.analytics${t.path ? `.${t.path}` : ""}`)
723
746
  );
724
- for (const n of r.warnings)
747
+ for (const t of r.warnings)
725
748
  o.push(
726
749
  a(
727
- n.code,
728
- n.message,
729
- `${i}.analytics${n.path ? `.${n.path}` : ""}`
750
+ t.code,
751
+ t.message,
752
+ `${i}.analytics${t.path ? `.${t.path}` : ""}`
730
753
  )
731
754
  );
732
755
  }
733
756
  function V(e) {
734
- const i = [], s = [];
757
+ const i = [], n = [];
735
758
  if (!e || typeof e != "object")
736
759
  return {
737
760
  ok: !1,
@@ -741,7 +764,7 @@ function V(e) {
741
764
  "Dashboard intent must be a structured object."
742
765
  )
743
766
  ],
744
- warnings: s
767
+ warnings: n
745
768
  };
746
769
  e.version !== 1 && i.push(a("invalid_version", "Dashboard intent version must be 1.")), e.kind !== "dashboard" && i.push(a("invalid_kind", "Experience intent kind must be dashboard.")), d(e.title) || i.push(a("missing_title", "Dashboard intent needs a title.", "title"));
747
770
  const o = Array.isArray(e.inputs) ? e.inputs : [], r = v(
@@ -755,51 +778,51 @@ function V(e) {
755
778
  )
756
779
  );
757
780
  for (const [u, l] of o.entries()) {
758
- const m = `inputs.${u}`;
781
+ const p = `inputs.${u}`;
759
782
  if (!c(l)) {
760
- i.push(a("invalid_input", "Dashboard input must be an object.", m));
783
+ i.push(a("invalid_input", "Dashboard input must be an object.", p));
761
784
  continue;
762
785
  }
763
- d(l.id) || i.push(a("missing_input_id", "Input needs an id.", `${m}.id`)), d(l.label) || i.push(
764
- a("missing_input_label", "Input needs a label.", `${m}.label`)
786
+ d(l.id) || i.push(a("missing_input_id", "Input needs an id.", `${p}.id`)), d(l.label) || i.push(
787
+ a("missing_input_label", "Input needs a label.", `${p}.label`)
765
788
  ), !l.field || !d(l.field.name) ? i.push(
766
- a("missing_input_field", "Input needs a field.", `${m}.field`)
767
- ) : f(l.field, `${m}.field`, i);
789
+ a("missing_input_field", "Input needs a field.", `${p}.field`)
790
+ ) : f(l.field, `${p}.field`, i);
768
791
  }
769
- const n = Array.isArray(e.sections) ? e.sections : [];
770
- n.length === 0 && i.push(
792
+ const t = Array.isArray(e.sections) ? e.sections : [];
793
+ t.length === 0 && i.push(
771
794
  a(
772
795
  "missing_sections",
773
796
  "Dashboard intent needs at least one section.",
774
797
  "sections"
775
798
  )
776
799
  );
777
- const t = n.flatMap(
800
+ const s = t.flatMap(
778
801
  (u) => u && typeof u == "object" && Array.isArray(u.views) ? u.views.filter(c).map((l) => l.id).filter((l) => !!l) : []
779
- ), p = v(t);
780
- p && i.push(
802
+ ), m = v(s);
803
+ m && i.push(
781
804
  a(
782
805
  "duplicate_view_id",
783
- `Duplicate dashboard view id: ${p}.`,
806
+ `Duplicate dashboard view id: ${m}.`,
784
807
  "sections"
785
808
  )
786
809
  );
787
- for (const [u, l] of n.entries()) {
788
- const m = `sections.${u}`;
810
+ for (const [u, l] of t.entries()) {
811
+ const p = `sections.${u}`;
789
812
  if (!l || typeof l != "object") {
790
813
  i.push(
791
- a("invalid_section", "Dashboard section must be an object.", m)
814
+ a("invalid_section", "Dashboard section must be an object.", p)
792
815
  );
793
816
  continue;
794
817
  }
795
818
  if (d(l.title) || i.push(
796
- a("missing_section_title", "Dashboard section needs a title.", m)
819
+ a("missing_section_title", "Dashboard section needs a title.", p)
797
820
  ), !Array.isArray(l.views) || l.views.length === 0) {
798
821
  i.push(
799
822
  a(
800
823
  "missing_section_views",
801
824
  "Dashboard section needs at least one view.",
802
- `${m}.views`
825
+ `${p}.views`
803
826
  )
804
827
  );
805
828
  continue;
@@ -807,15 +830,15 @@ function V(e) {
807
830
  for (const [M, S] of l.views.entries())
808
831
  G(
809
832
  S,
810
- `${m}.views.${M}`,
833
+ `${p}.views.${M}`,
811
834
  i,
812
- s
835
+ n
813
836
  );
814
837
  }
815
- return { ok: i.length === 0, errors: i, warnings: s };
838
+ return { ok: i.length === 0, errors: i, warnings: n };
816
839
  }
817
840
  export {
818
- H as a,
841
+ U as a,
819
842
  Q as b,
820
843
  V as c,
821
844
  $ as d,
@@ -823,5 +846,5 @@ export {
823
846
  L as f,
824
847
  N as p,
825
848
  h as s,
826
- w as v
849
+ k as v
827
850
  };