react-semaphor 0.1.365 → 0.1.367

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 (36) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +26 -24
  3. package/dist/chunks/{calendar-preferences-dialog-CgBwWqfY.js → calendar-preferences-dialog-BOFlzOJg.js} +1 -1
  4. package/dist/chunks/{dashboard-briefing-launcher-CK_6KGFV.js → dashboard-briefing-launcher-D2lBFqAd.js} +3 -3
  5. package/dist/chunks/{dashboard-controls-CsIEj0Vm.js → dashboard-controls-BIk094Ah.js} +3 -3
  6. package/dist/chunks/{dashboard-json-OhYs9GOx.js → dashboard-json-DImOf512.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-q_XG4oWg.js → edit-dashboard-visual-DTxkV6Fl.js} +3 -3
  8. package/dist/chunks/{index-Ds3_EAla.js → index-BVEIk-rB.js} +5 -5
  9. package/dist/chunks/{resource-management-panel-CYXyE2js.js → resource-management-panel-BOfbSf48.js} +2 -2
  10. package/dist/chunks/{source-identity-qAmkNtEK.js → source-identity-Dj3dryN9.js} +3 -3
  11. package/dist/chunks/{use-create-flow-overlay-state-CRQcqLs3.js → use-create-flow-overlay-state-B5FygfQL.js} +2 -2
  12. package/dist/chunks/{use-visual-utils-CpZplRpR.js → use-visual-utils-CszWnFBW.js} +1 -1
  13. package/dist/chunks/{validation-B4_hBuYu.js → validation-CrUjNWby.js} +115 -94
  14. package/dist/chunks/validation-DGl8wnTt.js +1 -0
  15. package/dist/chunks/validators-Dq5X4mp0.js +1 -0
  16. package/dist/chunks/{validators-BnLhuIhd.js → validators-L0xEXtjf.js} +279 -212
  17. package/dist/dashboard/index.js +1 -1
  18. package/dist/dashboard-authoring/index.cjs +3 -3
  19. package/dist/dashboard-authoring/index.js +288 -280
  20. package/dist/data-app-builder/index.js +1 -1
  21. package/dist/data-app-sdk/index.cjs +1 -1
  22. package/dist/data-app-sdk/index.js +400 -271
  23. package/dist/data-app-sdk-validation/index.cjs +1 -1
  24. package/dist/data-app-sdk-validation/index.js +3 -3
  25. package/dist/index.js +5 -5
  26. package/dist/surfboard/index.js +2 -2
  27. package/dist/types/analytics-protocol.d.ts +12 -2
  28. package/dist/types/dashboard-assistant.d.ts +3 -1
  29. package/dist/types/dashboard-authoring.d.ts +8 -2
  30. package/dist/types/data-app-builder.d.ts +3 -1
  31. package/dist/types/data-app-sdk-validation.d.ts +5 -1
  32. package/dist/types/data-app-sdk.d.ts +25 -6
  33. package/dist/types/main.d.ts +3 -1
  34. package/package.json +1 -1
  35. package/dist/chunks/validation-CsK42Vbq.js +0 -1
  36. package/dist/chunks/validators-Cu_w8ZEP.js +0 -1
@@ -1,50 +1,50 @@
1
- import { D as B, a as ge } from "../chunks/contracts-CoCOpd_i.js";
2
- import { a as be, b as E, p as Ie } from "../chunks/source-identity-qAmkNtEK.js";
3
- import { v as re, c as ye } from "../chunks/validators-BnLhuIhd.js";
4
- import { b as _e } from "../chunks/catalog-field-grounding-DoEBOXQd.js";
1
+ import { D as B, a as be } from "../chunks/contracts-CoCOpd_i.js";
2
+ import { s as Ie, a as E, p as ye } from "../chunks/source-identity-Dj3dryN9.js";
3
+ import { v as ae, d as _e, n as we } from "../chunks/validators-L0xEXtjf.js";
4
+ import { b as ve } from "../chunks/catalog-field-grounding-DoEBOXQd.js";
5
5
  function _(e) {
6
6
  return e && typeof e == "object" ? e : null;
7
7
  }
8
8
  function C(e) {
9
9
  return typeof e == "string" ? e : null;
10
10
  }
11
- function we(e) {
11
+ function Se(e) {
12
12
  var t, n, r;
13
13
  return !!(e && typeof e == "object") && (((t = _(e)) == null ? void 0 : t.kind) === "semantic" || ((n = _(e)) == null ? void 0 : n.kind) === "physical" || ((r = _(e)) == null ? void 0 : r.kind) === "sql");
14
14
  }
15
- function V(e) {
16
- return we(e) ? e.kind === "semantic" ? !!(e.domainId && e.datasetName) : e.kind === "physical" ? !!(e.connectionId && e.tableName) : !1 : !1;
15
+ function z(e) {
16
+ return Se(e) ? e.kind === "semantic" ? !!(e.domainId && e.datasetName) : e.kind === "physical" ? !!(e.connectionId && e.tableName) : !1 : !1;
17
17
  }
18
- function _t(e) {
19
- return be(e);
18
+ function wt(e) {
19
+ return Ie(e);
20
20
  }
21
- function ae(e, t) {
21
+ function ie(e, t) {
22
22
  return E(e, t);
23
23
  }
24
- function ve(e, t) {
25
- return Ie(e, t);
24
+ function Ce(e, t) {
25
+ return ye(e, t);
26
26
  }
27
27
  function P(e) {
28
28
  const t = [];
29
29
  for (const n of e) {
30
30
  const r = t.findIndex(
31
- (i) => ae(i, n)
31
+ (o) => ie(o, n)
32
32
  );
33
- r === -1 ? t.push(n) : t[r] = ve(
33
+ r === -1 ? t.push(n) : t[r] = Ce(
34
34
  t[r],
35
35
  n
36
36
  );
37
37
  }
38
38
  return t;
39
39
  }
40
- function wt(e) {
40
+ function vt(e) {
41
41
  return P(e)[0];
42
42
  }
43
- function O(e, t) {
43
+ function L(e, t) {
44
44
  return e.kind !== "semantic" || e.connectionId || (t == null ? void 0 : t.kind) !== "semantic" || !E(e, t) || !t.connectionId ? e : { ...e, connectionId: t.connectionId };
45
45
  }
46
46
  function j(e) {
47
- return V(e) ? e : void 0;
47
+ return z(e) ? e : void 0;
48
48
  }
49
49
  function ne(e, t) {
50
50
  if (!(e.kind !== "semantic" || e.connectionId))
@@ -54,74 +54,74 @@ function ne(e, t) {
54
54
  }
55
55
  function S(e, t) {
56
56
  const n = j(e == null ? void 0 : e.source);
57
- return n ? O(n, t) : void 0;
57
+ return n ? L(n, t) : void 0;
58
58
  }
59
- function Se({
59
+ function ke({
60
60
  explicitSource: e,
61
61
  field: t,
62
62
  defaultSource: n,
63
63
  fallbackSources: r
64
64
  }) {
65
- const i = [n, ...r || []], a = j(e), o = a ? O(
65
+ const o = [n, ...r || []], a = j(e), i = a ? L(
66
66
  a,
67
- ne(a, i)
67
+ ne(a, o)
68
68
  ) : void 0;
69
- if (o)
70
- return o;
69
+ if (i)
70
+ return i;
71
71
  if (e !== void 0)
72
72
  return;
73
- const d = S(t, n), s = d ? O(
73
+ const d = S(t, n), s = d ? L(
74
74
  d,
75
- ne(d, i)
75
+ ne(d, o)
76
76
  ) : void 0;
77
77
  if (s)
78
78
  return s;
79
79
  if ((t == null ? void 0 : t.source) === void 0)
80
80
  return j(n);
81
81
  }
82
- function vt(e, t) {
82
+ function St(e, t) {
83
83
  if (!(e != null && e.name) || !(t != null && t.name) || e.name !== t.name)
84
84
  return !1;
85
85
  const n = S(e), r = S(t);
86
- return !n || !r ? !0 : ae(n, r);
86
+ return !n || !r ? !0 : ie(n, r);
87
87
  }
88
88
  function k(e) {
89
89
  var t;
90
90
  return C((t = _(e)) == null ? void 0 : t.kind);
91
91
  }
92
- function ie(e) {
92
+ function oe(e) {
93
93
  var t, n;
94
94
  return k(e) !== "semantic" ? null : ((n = C((t = _(e)) == null ? void 0 : t.domainId)) == null ? void 0 : n.trim()) || null;
95
95
  }
96
- function Ce(e) {
96
+ function xe(e) {
97
97
  var t;
98
98
  return k(e) !== "semantic" ? null : C((t = _(e)) == null ? void 0 : t.datasetName);
99
99
  }
100
- function ke(e) {
100
+ function De(e) {
101
101
  var t;
102
102
  return k(e) !== "semantic" ? null : C((t = _(e)) == null ? void 0 : t.datasetId);
103
103
  }
104
- function xe(e) {
104
+ function Ae(e) {
105
105
  var t;
106
106
  return k(e) !== "physical" ? null : C((t = _(e)) == null ? void 0 : t.connectionId);
107
107
  }
108
- function De(e) {
108
+ function Fe(e) {
109
109
  var t;
110
110
  return k(e) !== "physical" ? null : C((t = _(e)) == null ? void 0 : t.tableName);
111
111
  }
112
- function Ae(e) {
112
+ function Te(e) {
113
113
  var t;
114
114
  return k(e) !== "physical" ? "" : C((t = _(e)) == null ? void 0 : t.databaseName) || "";
115
115
  }
116
- function Fe(e) {
116
+ function $e(e) {
117
117
  var t;
118
118
  return k(e) !== "physical" ? "" : C((t = _(e)) == null ? void 0 : t.schemaName) || "";
119
119
  }
120
- function Te(e) {
120
+ function Me(e) {
121
121
  if (e.analyticsIntent && typeof e.analyticsIntent == "object" && "source" in e.analyticsIntent)
122
122
  return e.analyticsIntent.source;
123
123
  }
124
- function $e({
124
+ function Ne({
125
125
  datasets: e,
126
126
  requireAtLeastOne: t
127
127
  }) {
@@ -129,19 +129,19 @@ function $e({
129
129
  return { ok: !1, issue: "invalid_dataset_count" };
130
130
  if (e.length <= 1)
131
131
  return { ok: !0 };
132
- const n = e.map(ie), r = new Set(n.filter(Boolean));
133
- return n.some((i) => !i) || r.size !== 1 ? { ok: !1, issue: "invalid_multi_dataset_scope" } : { ok: !0 };
132
+ const n = e.map(oe), r = new Set(n.filter(Boolean));
133
+ return n.some((o) => !o) || r.size !== 1 ? { ok: !1, issue: "invalid_multi_dataset_scope" } : { ok: !0 };
134
134
  }
135
135
  function H(e, t) {
136
136
  if (!t)
137
137
  return !1;
138
138
  if (t.kind === "semantic") {
139
- const n = ke(e);
140
- return ie(e) === t.domainId ? n && t.datasetId ? n === t.datasetId : Ce(e) === t.datasetName : !1;
139
+ const n = De(e);
140
+ return oe(e) === t.domainId ? n && t.datasetId ? n === t.datasetId : xe(e) === t.datasetName : !1;
141
141
  }
142
- return t.kind === "physical" ? xe(e) === t.connectionId && De(e) === t.tableName && Ae(e) === (t.databaseName || "") && Fe(e) === (t.schemaName || "") : !1;
142
+ return t.kind === "physical" ? Ae(e) === t.connectionId && Fe(e) === t.tableName && Te(e) === (t.databaseName || "") && $e(e) === (t.schemaName || "") : !1;
143
143
  }
144
- function St(e, t) {
144
+ function Ct(e, t) {
145
145
  return e.find(
146
146
  (n) => H(n, t)
147
147
  );
@@ -158,14 +158,14 @@ function M(e) {
158
158
  }
159
159
  return null;
160
160
  }
161
- function oe({
161
+ function se({
162
162
  card: e,
163
163
  datasets: t,
164
164
  errors: n
165
165
  }) {
166
166
  if (e.type === "text")
167
167
  return;
168
- const r = Te(e);
168
+ const r = Me(e);
169
169
  if (!r) {
170
170
  if (t.length <= 1)
171
171
  return;
@@ -178,7 +178,7 @@ function oe({
178
178
  );
179
179
  return;
180
180
  }
181
- t.some((i) => H(i, r)) || n.push(
181
+ t.some((o) => H(o, r)) || n.push(
182
182
  p(
183
183
  "invalid_card_analytics_source",
184
184
  "Dashboard cards with an explicit analytics source must use one of the selected datasets.",
@@ -194,12 +194,12 @@ function q(e) {
194
194
  (t) => !!(t && typeof t == "object")
195
195
  ) : [];
196
196
  }
197
- function Me(e) {
197
+ function re(e) {
198
198
  return Array.isArray(e) ? e.filter(
199
199
  (t) => !!(t && typeof t == "object")
200
200
  ) : [];
201
201
  }
202
- function Ne(e) {
202
+ function Be(e) {
203
203
  var n;
204
204
  if (!e)
205
205
  return [];
@@ -210,25 +210,26 @@ function Ne(e) {
210
210
  e.primaryMetric,
211
211
  e.dateField,
212
212
  ...q(e.dimensions),
213
- ...Me(e.filters).map((r) => r.field)
213
+ ...re(e.filters).map((r) => r.field)
214
214
  ])
215
215
  ) : e.kind === "records" ? t.push(
216
216
  ...N([
217
217
  ...q(e.fields),
218
218
  e.dateField,
219
- (n = e.orderBy) == null ? void 0 : n.field
219
+ (n = e.orderBy) == null ? void 0 : n.field,
220
+ ...re(e.filters).map((r) => r.field)
220
221
  ])
221
222
  ) : e.kind === "inputOptions" ? t.push(...N([e.field])) : e.kind === "sql" && t.push(...N(e.fields || [])), t;
222
223
  }
223
- function se({
224
+ function de({
224
225
  card: e,
225
226
  datasets: t,
226
227
  errors: n
227
228
  }) {
228
229
  if (e.type !== "text") {
229
- for (const r of Ne(e.analyticsIntent))
230
+ for (const r of Be(e.analyticsIntent))
230
231
  if (r && !t.some(
231
- (i) => H(i, r)
232
+ (o) => H(o, r)
232
233
  )) {
233
234
  n.push(
234
235
  p(
@@ -241,13 +242,13 @@ function se({
241
242
  }
242
243
  }
243
244
  }
244
- function de({
245
+ function ce({
245
246
  card: e,
246
247
  errors: t
247
248
  }) {
248
249
  if (e.type === "text" || !e.analyticsIntent)
249
250
  return;
250
- const n = re(e.analyticsIntent);
251
+ const n = ae(e.analyticsIntent);
251
252
  if (!n.ok)
252
253
  for (const r of n.errors)
253
254
  t.push(
@@ -258,12 +259,12 @@ function de({
258
259
  )
259
260
  );
260
261
  }
261
- function ce({
262
+ function le({
262
263
  datasets: e,
263
264
  errors: t,
264
265
  requireAtLeastOne: n
265
266
  }) {
266
- const r = $e({
267
+ const r = Ne({
267
268
  datasets: e,
268
269
  requireAtLeastOne: n
269
270
  });
@@ -285,7 +286,7 @@ function ce({
285
286
  );
286
287
  }
287
288
  }
288
- function Be(e) {
289
+ function Pe(e) {
289
290
  var f, g;
290
291
  const t = [];
291
292
  if (!e || typeof e != "object")
@@ -301,18 +302,18 @@ function Be(e) {
301
302
  };
302
303
  const n = e, r = [...n.warnings || []];
303
304
  n.version !== 1 && t.push(p("invalid_version", "Dashboard plan version must be 1.")), (f = n.title) != null && f.trim() || t.push(p("missing_title", "Dashboard plan needs a title."));
304
- const i = Array.isArray(n.datasets) ? n.datasets : [], a = Array.isArray(n.sheets) ? n.sheets : [];
305
- ce({ datasets: i, errors: t, requireAtLeastOne: !0 }), a.length !== 1 && t.push(
305
+ const o = Array.isArray(n.datasets) ? n.datasets : [], a = Array.isArray(n.sheets) ? n.sheets : [];
306
+ le({ datasets: o, errors: t, requireAtLeastOne: !0 }), a.length !== 1 && t.push(
306
307
  p(
307
308
  "invalid_sheet_count",
308
309
  "MVP dashboard authoring creates exactly one dashboard sheet."
309
310
  )
310
311
  );
311
- const o = a[0];
312
- o && o.kind !== "dashboard" && t.push(
312
+ const i = a[0];
313
+ i && i.kind !== "dashboard" && t.push(
313
314
  p("invalid_sheet_kind", 'Generated sheet must use kind "dashboard".')
314
315
  );
315
- const d = (o == null ? void 0 : o.cards) || [];
316
+ const d = (i == null ? void 0 : i.cards) || [];
316
317
  d.length > B && t.push(
317
318
  p(
318
319
  "too_many_cards",
@@ -343,7 +344,7 @@ function Be(e) {
343
344
  "Non-text card has no analytics intent and may be skipped by the app layer.",
344
345
  l.id
345
346
  )
346
- ), oe({ card: l, datasets: i, errors: t }), de({ card: l, errors: t }), se({ card: l, datasets: i, errors: t });
347
+ ), se({ card: l, datasets: o, errors: t }), ce({ card: l, errors: t }), de({ card: l, datasets: o, errors: t });
347
348
  const h = Array.isArray(n.filterInputs) ? n.filterInputs : [], I = h.map((l) => l.id), w = M(I);
348
349
  w && t.push(
349
350
  p(
@@ -368,8 +369,8 @@ function Be(e) {
368
369
  );
369
370
  return { ok: t.length === 0, errors: t, warnings: r };
370
371
  }
371
- function Pe(e) {
372
- var o;
372
+ function ze(e) {
373
+ var i;
373
374
  const t = [];
374
375
  if (!e || typeof e != "object")
375
376
  return {
@@ -385,11 +386,11 @@ function Pe(e) {
385
386
  const n = e, r = [...n.warnings || []];
386
387
  n.version !== 1 && t.push(
387
388
  p("invalid_version", "Dashboard change plan version must be 1.")
388
- ), (o = n.dashboardId) != null && o.trim() || t.push(
389
+ ), (i = n.dashboardId) != null && i.trim() || t.push(
389
390
  p("missing_dashboard_id", "Dashboard change plan needs a dashboard id.")
390
391
  );
391
- const i = Array.isArray(n.datasets) ? n.datasets : [], a = Array.isArray(n.operations) ? n.operations : [];
392
- ce({ datasets: i, errors: t, requireAtLeastOne: !1 });
392
+ const o = Array.isArray(n.datasets) ? n.datasets : [], a = Array.isArray(n.operations) ? n.operations : [];
393
+ le({ datasets: o, errors: t, requireAtLeastOne: !1 });
393
394
  for (const d of a) {
394
395
  if (d.kind === "unsupported") {
395
396
  r.push(
@@ -403,16 +404,16 @@ function Pe(e) {
403
404
  "Whole-dashboard authoring supports built-in visual types only.",
404
405
  d.card.id
405
406
  )
406
- ), d.kind === "addCard" && (oe({
407
+ ), d.kind === "addCard" && (se({
407
408
  card: d.card,
408
- datasets: i,
409
+ datasets: o,
409
410
  errors: t
410
- }), de({
411
+ }), ce({
411
412
  card: d.card,
412
413
  errors: t
413
- }), se({
414
+ }), de({
414
415
  card: d.card,
415
- datasets: i,
416
+ datasets: o,
416
417
  errors: t
417
418
  })), d.kind === "addCalculatedField" && d.field.scope === "domain" && d.field.reuseOnly !== !0 && t.push(
418
419
  p(
@@ -430,77 +431,77 @@ const Ve = {
430
431
  xs: 12,
431
432
  xxs: 6
432
433
  };
433
- function ze(e, t) {
434
- let n = 0, r = 0, i = 0;
434
+ function qe(e, t) {
435
+ let n = 0, r = 0, o = 0;
435
436
  return e.map((a) => {
436
- const o = Math.min(a.w, t);
437
- n > 0 && n + o > t && (n = 0, r += i, i = 0);
437
+ const i = Math.min(a.w, t);
438
+ n > 0 && n + i > t && (n = 0, r += o, o = 0);
438
439
  const d = {
439
440
  i: a.frameId,
440
441
  x: n,
441
442
  y: r,
442
- w: o,
443
+ w: i,
443
444
  h: a.h,
444
445
  minW: Math.min(a.minW, t),
445
446
  minH: a.minH,
446
447
  static: !1
447
448
  };
448
- return n += o, i = Math.max(i, a.h), d;
449
+ return n += i, o = Math.max(o, a.h), d;
449
450
  });
450
451
  }
451
- function qe(e) {
452
- const t = [...e].sort((s, u) => s.priority - u.priority), n = t.filter((s) => s.role === "kpi"), r = t.filter((s) => s.role === "chart"), i = t.filter((s) => s.role === "table"), a = t.filter((s) => s.role === "text"), o = a.slice(0, 1), d = a.slice(o.length);
453
- return { kpis: n, introText: o, charts: r, tables: i, supportingText: d };
452
+ function Re(e) {
453
+ const t = [...e].sort((s, u) => s.priority - u.priority), n = t.filter((s) => s.role === "kpi"), r = t.filter((s) => s.role === "chart"), o = t.filter((s) => s.role === "table"), a = t.filter((s) => s.role === "text"), i = a.slice(0, 1), d = a.slice(i.length);
454
+ return { kpis: n, introText: i, charts: r, tables: o, supportingText: d };
454
455
  }
455
- function Re(e, t, n) {
456
+ function Oe(e, t, n) {
456
457
  return t === "xxs" || t === "xs" ? n : t === "sm" ? Math.min(12, n) : t === "md" ? e <= 1 || e === 2 ? 18 : 12 : e <= 1 || e === 2 ? 24 : e === 3 ? 16 : 12;
457
458
  }
458
459
  function Le(e, t, n, r) {
459
460
  return n === "xxs" || n === "xs" || n === "sm" || n === "md" || t === 1 || t % 2 === 1 && e === 0 ? r : r / 2;
460
461
  }
461
- function Oe(e) {
462
- const { item: t, band: n, index: r, bandCount: i, breakpoint: a, columns: o } = e;
462
+ function je(e) {
463
+ const { item: t, band: n, index: r, bandCount: o, breakpoint: a, columns: i } = e;
463
464
  return n === "kpi" ? {
464
465
  ...t,
465
466
  band: n,
466
- w: Re(i, a, o),
467
+ w: Oe(o, a, i),
467
468
  h: 15,
468
- minW: Math.min(6, o),
469
+ minW: Math.min(6, i),
469
470
  minH: 12
470
471
  } : n === "table" ? {
471
472
  ...t,
472
473
  band: n,
473
- w: o,
474
+ w: i,
474
475
  h: a === "xxs" || a === "xs" ? 34 : 38,
475
- minW: Math.min(12, o),
476
+ minW: Math.min(12, i),
476
477
  minH: 18
477
478
  } : n === "introText" ? {
478
479
  ...t,
479
480
  band: n,
480
- w: o,
481
+ w: i,
481
482
  h: a === "xxs" || a === "xs" ? 12 : 10,
482
- minW: Math.min(12, o),
483
+ minW: Math.min(12, i),
483
484
  minH: 8
484
485
  } : n === "supportingText" ? {
485
486
  ...t,
486
487
  band: n,
487
- w: a === "lg" ? o / 2 : o,
488
+ w: a === "lg" ? i / 2 : i,
488
489
  h: a === "xxs" || a === "xs" ? 12 : 10,
489
- minW: Math.min(12, o),
490
+ minW: Math.min(12, i),
490
491
  minH: 8
491
492
  } : {
492
493
  ...t,
493
494
  band: n,
494
- w: Le(r, i, a, o),
495
+ w: Le(r, o, a, i),
495
496
  h: a === "xxs" || a === "xs" ? 28 : 30,
496
- minW: Math.min(12, o),
497
+ minW: Math.min(12, i),
497
498
  minH: 16
498
499
  };
499
500
  }
500
- function D(e, t, n, r) {
501
+ function A(e, t, n, r) {
501
502
  return e.map(
502
- (i, a) => Oe({
503
- item: i,
503
+ (o, a) => je({
504
+ item: o,
504
505
  band: t,
505
506
  index: a,
506
507
  bandCount: e.length,
@@ -510,36 +511,36 @@ function D(e, t, n, r) {
510
511
  );
511
512
  }
512
513
  function K(e) {
513
- const t = qe(e);
514
+ const t = Re(e);
514
515
  return Object.fromEntries(
515
- ge.map((n) => {
516
- const r = Ve[n], i = [
517
- ...D(t.introText, "introText", n, r),
518
- ...D(t.kpis, "kpi", n, r),
519
- ...D(t.charts, "chart", n, r),
520
- ...D(t.tables, "table", n, r),
521
- ...D(t.supportingText, "supportingText", n, r)
516
+ be.map((n) => {
517
+ const r = Ve[n], o = [
518
+ ...A(t.introText, "introText", n, r),
519
+ ...A(t.kpis, "kpi", n, r),
520
+ ...A(t.charts, "chart", n, r),
521
+ ...A(t.tables, "table", n, r),
522
+ ...A(t.supportingText, "supportingText", n, r)
522
523
  ];
523
- return [n, ze(i, r)];
524
+ return [n, qe(o, r)];
524
525
  })
525
526
  );
526
527
  }
527
- function je(e) {
528
- const t = _e(e);
529
- return t === "datetime" ? "date" : t === "unknown" ? "string" : t;
530
- }
531
528
  function We(e) {
532
- return !!(e && typeof e == "object" && !Array.isArray(e));
529
+ const t = ve(e);
530
+ return t === "datetime" ? "date" : t === "unknown" ? "string" : t;
533
531
  }
534
532
  function Ee(e) {
535
- return We(e) && typeof e.filterId == "string" && typeof e.operation == "string" && Array.isArray(e.values);
533
+ return !!(e && typeof e == "object" && !Array.isArray(e));
536
534
  }
537
535
  function He(e) {
536
+ return Ee(e) && typeof e.filterId == "string" && typeof e.operation == "string" && Array.isArray(e.values);
537
+ }
538
+ function Ke(e) {
538
539
  return e.filter(
539
540
  (t) => typeof t == "string" || typeof t == "number"
540
541
  );
541
542
  }
542
- function Ke(e) {
543
+ function Ge(e) {
543
544
  return e.filter(
544
545
  (t) => t instanceof Date || typeof t == "string"
545
546
  );
@@ -547,8 +548,8 @@ function Ke(e) {
547
548
  function G(e, t) {
548
549
  if (t === void 0)
549
550
  return;
550
- const n = je(e.dataType), r = e.operation || "in";
551
- if (Ee(t))
551
+ const n = We(e.dataType), r = e.operation || "in";
552
+ if (He(t))
552
553
  return {
553
554
  ...t,
554
555
  filterId: e.id,
@@ -569,7 +570,7 @@ function G(e, t) {
569
570
  fieldMeta: e.fieldMeta,
570
571
  semanticContext: e.semanticContext
571
572
  };
572
- const i = Array.isArray(t) ? t : [t], a = n === "date" ? Ke(i) : He(i);
573
+ const o = Array.isArray(t) ? t : [t], a = n === "date" ? Ge(o) : Ke(o);
573
574
  if (a.length !== 0 && !((r === "between" || r === "not between") && a.length < 2))
574
575
  return {
575
576
  filterId: e.id,
@@ -582,13 +583,13 @@ function G(e, t) {
582
583
  semanticContext: e.semanticContext
583
584
  };
584
585
  }
585
- function le(e, t, n) {
586
+ function ue(e, t, n) {
586
587
  return n ? { code: e, message: t, cardId: n } : { code: e, message: t };
587
588
  }
588
- function Ge(e, t, n) {
589
+ function Ue(e, t, n) {
589
590
  const r = (t || []).filter(
590
- (i) => i.scope === "card" && i.targetCardId === n
591
- ).map((i) => i.field).filter(Boolean);
591
+ (o) => o.scope === "card" && o.targetCardId === n
592
+ ).map((o) => o.field).filter(Boolean);
592
593
  return r.length === 0 ? e : {
593
594
  ...e,
594
595
  calculatedFields: [
@@ -604,13 +605,13 @@ function W(e, t) {
604
605
  )
605
606
  );
606
607
  }
607
- function Ue(e, t) {
608
+ function Je(e, t) {
608
609
  if ((e == null ? void 0 : e.kind) !== "cards")
609
610
  return e;
610
611
  const n = W(e.cardIds, t);
611
612
  return n.length > 0 ? { ...e, cardIds: n } : null;
612
613
  }
613
- function Je(e, t) {
614
+ function Qe(e, t) {
614
615
  return !e.applyToCardIds && !e.excludeCardIds ? e : {
615
616
  ...e,
616
617
  ...e.applyToCardIds ? {
@@ -627,15 +628,15 @@ function Je(e, t) {
627
628
  } : {}
628
629
  };
629
630
  }
630
- function Qe(e, t) {
631
+ function Xe(e, t) {
631
632
  const n = {}, r = [];
632
633
  return {
633
634
  inputs: (e.filterInputs || []).flatMap(
634
- (a, o) => {
635
- const d = Ue(a.scope, t);
635
+ (a, i) => {
636
+ const d = Je(a.scope, t);
636
637
  if (d === null)
637
638
  return r.push(
638
- le(
639
+ ue(
639
640
  "filter_input_scope_empty",
640
641
  `Filter input "${a.label}" was skipped because all scoped cards were skipped during query validation.`
641
642
  )
@@ -660,10 +661,10 @@ function Qe(e, t) {
660
661
  runtimeScope: "shared",
661
662
  presentation: {
662
663
  placement: "toolbar",
663
- order: o
664
+ order: i
664
665
  },
665
666
  exports: ["label", "value", "start", "end", "range"],
666
- filter: Je(a.filter, t)
667
+ filter: Qe(a.filter, t)
667
668
  }
668
669
  ];
669
670
  }
@@ -672,17 +673,17 @@ function Qe(e, t) {
672
673
  defaultInputValues: n.shared && Object.keys(n.shared).length > 0 ? n : void 0
673
674
  };
674
675
  }
675
- function Ct(e) {
676
+ function kt(e) {
676
677
  var v, y;
677
- const t = Be(e.plan);
678
+ const t = Pe(e.plan);
678
679
  if (!t.ok)
679
680
  throw new Error(
680
681
  t.errors.map((c) => c.message).join(`
681
682
  `) || "Dashboard plan is invalid."
682
683
  );
683
- const n = e.plan.sheets[0], r = [...t.warnings], i = [], a = new Map(
684
+ const n = e.plan.sheets[0], r = [...t.warnings], o = [], a = new Map(
684
685
  e.cardArtifacts.map((c) => [c.planCardId, c])
685
- ), o = new Map(
686
+ ), i = new Map(
686
687
  e.cardArtifacts.map((c) => [
687
688
  c.planCardId,
688
689
  c.card.id
@@ -691,16 +692,16 @@ function Ct(e) {
691
692
  for (const c of n.cards) {
692
693
  const f = a.get(c.id);
693
694
  if (!f) {
694
- const l = le(
695
+ const l = ue(
695
696
  "missing_card_artifact",
696
697
  `Card "${c.title}" was skipped because no generated artifact was supplied.`,
697
698
  c.id
698
699
  );
699
- i.push(l);
700
+ o.push(l);
700
701
  continue;
701
702
  }
702
703
  r.push(...f.warnings || []);
703
- const g = Ge(
704
+ const g = Ue(
704
705
  f.card,
705
706
  e.plan.calculatedFields,
706
707
  c.id
@@ -713,7 +714,7 @@ function Ct(e) {
713
714
  }
714
715
  if (d.length === 0)
715
716
  throw new Error("Dashboard plan did not produce any persistable cards.");
716
- const { inputs: s, defaultInputValues: u, warnings: h } = Qe(e.plan, o);
717
+ const { inputs: s, defaultInputValues: u, warnings: h } = Xe(e.plan, i);
717
718
  r.push(...h);
718
719
  const I = K(
719
720
  n.cards.filter((c) => d.some((f) => f.id === c.frameId)).map((c) => ({
@@ -740,15 +741,15 @@ function Ct(e) {
740
741
  calculatedFields: (y = e.plan.calculatedFields) == null ? void 0 : y.filter((c) => c.scope === "dashboard" && c.field).map((c) => c.field),
741
742
  inputs: s,
742
743
  ...u ? { defaultInputValues: u } : {}
743
- }, warnings: r, skippedOperations: i };
744
+ }, warnings: r, skippedOperations: o };
744
745
  }
745
746
  function x(e, t, n) {
746
747
  return n ? { code: e, message: t, cardId: n } : { code: e, message: t };
747
748
  }
748
- function Xe(e) {
749
+ function Ye(e) {
749
750
  return JSON.parse(JSON.stringify(e));
750
751
  }
751
- function Ye(e) {
752
+ function Ze(e) {
752
753
  var t;
753
754
  return (t = e.sheets) == null ? void 0 : t.find(
754
755
  (n) => (n.kind || "dashboard") === "dashboard"
@@ -757,55 +758,55 @@ function Ye(e) {
757
758
  function R(e, t) {
758
759
  var n;
759
760
  for (const r of e.sheets || [])
760
- for (const i of r.frames || []) {
761
- const a = (n = i.cards) == null ? void 0 : n.find((o) => o.id === t);
761
+ for (const o of r.frames || []) {
762
+ const a = (n = o.cards) == null ? void 0 : n.find((i) => i.id === t);
762
763
  if (a)
763
- return { sheet: r, frame: i, card: a };
764
+ return { sheet: r, frame: o, card: a };
764
765
  }
765
766
  return null;
766
767
  }
767
- function ue(e) {
768
+ function fe(e) {
768
769
  var n, r;
769
770
  const t = (r = (n = e.cards) == null ? void 0 : n[0]) == null ? void 0 : r.type;
770
771
  return t === "kpi" ? "kpi" : t === "table" || t === "detailTable" || t === "pivotTable" ? "table" : t === "text" ? "text" : "chart";
771
772
  }
772
- function Ze(e) {
773
+ function et(e) {
773
774
  var t;
774
775
  return new Map(
775
776
  (((t = e.layouts) == null ? void 0 : t.lg) || []).map((n, r) => [n.i, r])
776
777
  );
777
778
  }
778
- function fe(e, t = /* @__PURE__ */ new Map()) {
779
- const n = Ze(e), r = Math.max(
779
+ function pe(e, t = /* @__PURE__ */ new Map()) {
780
+ const n = et(e), r = Math.max(
780
781
  n.size,
781
782
  t.size
782
- ), i = (e.frames || []).map(
783
- (a, o) => ({
783
+ ), o = (e.frames || []).map(
784
+ (a, i) => ({
784
785
  frameId: a.id,
785
- role: ue(a),
786
- priority: t.get(a.id) ?? n.get(a.id) ?? r + o
786
+ role: fe(a),
787
+ priority: t.get(a.id) ?? n.get(a.id) ?? r + i
787
788
  })
788
789
  );
789
- e.layouts = K(i);
790
+ e.layouts = K(o);
790
791
  }
791
- function et(e) {
792
+ function tt(e) {
792
793
  return Object.values(e.layouts || {}).some((t) => t.length > 0);
793
794
  }
794
- function tt(e, t) {
795
- if (!et(e)) {
796
- fe(e);
795
+ function nt(e, t) {
796
+ if (!tt(e)) {
797
+ pe(e);
797
798
  return;
798
799
  }
799
800
  const n = K([
800
- { frameId: t.id, role: ue(t), priority: 0 }
801
+ { frameId: t.id, role: fe(t), priority: 0 }
801
802
  ]);
802
803
  e.layouts ?? (e.layouts = {});
803
- for (const [r, i] of Object.entries(n)) {
804
+ for (const [r, o] of Object.entries(n)) {
804
805
  const a = e.layouts[r] || [];
805
806
  if (a.some((s) => s.i === t.id))
806
807
  continue;
807
- const o = i[0];
808
- if (!o)
808
+ const i = o[0];
809
+ if (!i)
809
810
  continue;
810
811
  const d = a.reduce(
811
812
  (s, u) => Math.max(s, u.y + u.h),
@@ -813,11 +814,11 @@ function tt(e, t) {
813
814
  );
814
815
  e.layouts[r] = [
815
816
  ...a,
816
- { ...o, y: d }
817
+ { ...i, y: d }
817
818
  ];
818
819
  }
819
820
  }
820
- function nt(e, t) {
821
+ function rt(e, t) {
821
822
  var r;
822
823
  const n = G(
823
824
  t.filter,
@@ -831,31 +832,31 @@ function nt(e, t) {
831
832
  }
832
833
  });
833
834
  }
834
- function kt(e) {
835
+ function xt(e) {
835
836
  var d;
836
- const t = Pe(e.changePlan);
837
+ const t = ze(e.changePlan);
837
838
  if (!t.ok)
838
839
  throw new Error(
839
840
  t.errors.map((s) => s.message).join(`
840
841
  `) || "Dashboard change plan is invalid."
841
842
  );
842
- const n = Xe(e.dashboard), r = [...t.warnings], i = [], a = new Map(
843
+ const n = Ye(e.dashboard), r = [...t.warnings], o = [], a = new Map(
843
844
  e.cardArtifacts.map((s) => [s.planCardId, s])
844
- ), o = Ye(n);
845
- if (!o)
845
+ ), i = Ze(n);
846
+ if (!i)
846
847
  throw new Error("Dashboard has no editable dashboard sheet.");
847
- o.frames ?? (o.frames = []);
848
+ i.frames ?? (i.frames = []);
848
849
  for (const s of e.changePlan.operations)
849
850
  switch (s.kind) {
850
851
  case "addCard": {
851
- if ((o.frames || []).reduce(
852
+ if ((i.frames || []).reduce(
852
853
  (w, v) => {
853
854
  var y;
854
855
  return w + (((y = v.cards) == null ? void 0 : y.length) || 0);
855
856
  },
856
857
  0
857
858
  ) >= B) {
858
- i.push(
859
+ o.push(
859
860
  x(
860
861
  "generated_card_limit_reached",
861
862
  `AI refinement is capped at ${B} cards.`,
@@ -866,7 +867,7 @@ function kt(e) {
866
867
  }
867
868
  const h = a.get(s.card.id);
868
869
  if (!h) {
869
- i.push(
870
+ o.push(
870
871
  x(
871
872
  "missing_card_artifact",
872
873
  `Card "${s.card.title}" was skipped because no generated artifact was supplied.`,
@@ -880,7 +881,7 @@ function kt(e) {
880
881
  cards: [h.card],
881
882
  activeCardId: h.card.id
882
883
  };
883
- o.frames.push(I), tt(o, I);
884
+ i.frames.push(I), nt(i, I);
884
885
  break;
885
886
  }
886
887
  case "addFilterInput": {
@@ -902,17 +903,17 @@ function kt(e) {
902
903
  exports: ["label", "value", "start", "end", "range"],
903
904
  filter: s.input.filter
904
905
  };
905
- n.inputs.push(u), nt(n, s.input);
906
+ n.inputs.push(u), rt(n, s.input);
906
907
  break;
907
908
  }
908
909
  case "addCalculatedField": {
909
910
  if (s.field.scope === "dashboard" && s.field.field)
910
911
  n.calculatedFields ?? (n.calculatedFields = []), n.calculatedFields.push(s.field.field);
911
912
  else if (s.field.scope === "sheet" && s.field.field)
912
- o.calculatedFields ?? (o.calculatedFields = []), o.calculatedFields.push(s.field.field);
913
+ i.calculatedFields ?? (i.calculatedFields = []), i.calculatedFields.push(s.field.field);
913
914
  else if (s.field.scope === "card" && s.field.field) {
914
915
  const u = s.field.targetCardId ? R(n, s.field.targetCardId) : null;
915
- u ? ((d = u.card).calculatedFields ?? (d.calculatedFields = []), u.card.calculatedFields.push(s.field.field)) : i.push(
916
+ u ? ((d = u.card).calculatedFields ?? (d.calculatedFields = []), u.card.calculatedFields.push(s.field.field)) : o.push(
916
917
  x(
917
918
  "missing_calculated_field_target",
918
919
  `Calculated field "${s.field.name}" needs a valid target card.`
@@ -924,7 +925,7 @@ function kt(e) {
924
925
  case "renameCard": {
925
926
  const u = R(n, s.cardId);
926
927
  if (!u) {
927
- i.push(
928
+ o.push(
928
929
  x(
929
930
  "card_not_found",
930
931
  `Card "${s.cardId}" could not be renamed because it was not found.`,
@@ -942,7 +943,7 @@ function kt(e) {
942
943
  const I = s.cardIds[h], w = R(n, I);
943
944
  w && u.set(w.frame.id, h);
944
945
  }
945
- fe(o, u);
946
+ pe(i, u);
946
947
  break;
947
948
  }
948
949
  case "reuseCalculatedField":
@@ -954,12 +955,12 @@ function kt(e) {
954
955
  );
955
956
  break;
956
957
  case "unsupported":
957
- i.push(
958
+ o.push(
958
959
  x("unsupported_operation", s.reason || s.requestedAction)
959
960
  );
960
961
  break;
961
962
  }
962
- return { dashboard: n, warnings: r, skippedOperations: i };
963
+ return { dashboard: n, warnings: r, skippedOperations: o };
963
964
  }
964
965
  function b(e, t, n) {
965
966
  return n ? { code: e, message: t, cardId: n } : { code: e, message: t };
@@ -967,7 +968,7 @@ function b(e, t, n) {
967
968
  function F(e, t) {
968
969
  return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || t;
969
970
  }
970
- function pe(e, t) {
971
+ function he(e, t) {
971
972
  if (!t.has(e))
972
973
  return t.add(e), e;
973
974
  let n = 2, r = `${e}-${n}`;
@@ -978,7 +979,7 @@ function pe(e, t) {
978
979
  function T(e) {
979
980
  return !!(e && typeof e == "object");
980
981
  }
981
- function he(e) {
982
+ function me(e) {
982
983
  return Array.isArray(e.inputs) ? e.inputs.filter(
983
984
  (t) => T(t) && typeof t.id == "string"
984
985
  ) : [];
@@ -993,7 +994,7 @@ function J(e) {
993
994
  (t) => T(t)
994
995
  ) : [];
995
996
  }
996
- function A(e) {
997
+ function D(e) {
997
998
  if (!Array.isArray(e))
998
999
  return [];
999
1000
  const t = [];
@@ -1003,54 +1004,58 @@ function A(e) {
1003
1004
  }
1004
1005
  return t;
1005
1006
  }
1006
- function rt(e) {
1007
- var r;
1007
+ function at(e) {
1008
+ var r, o;
1008
1009
  if (!e)
1009
1010
  return [];
1010
1011
  const t = [];
1011
- if (V(e.source) && t.push(e.source), e.kind === "metric") {
1012
- t.push(...A(e.metrics));
1013
- const i = S(e.dateField);
1014
- i && t.push(i), t.push(...A(e.dimensions)), t.push(
1015
- ...A(
1016
- (r = e.filters) == null ? void 0 : r.map((a) => a.field)
1012
+ if (z(e.source) && t.push(e.source), e.kind === "metric") {
1013
+ t.push(...D(e.metrics));
1014
+ const a = S(e.dateField);
1015
+ a && t.push(a), t.push(...D(e.dimensions)), t.push(
1016
+ ...D(
1017
+ (r = e.filters) == null ? void 0 : r.map((i) => i.field)
1017
1018
  )
1018
1019
  );
1019
1020
  } else if (e.kind === "records") {
1020
- const i = S(e.dateField);
1021
- i && t.push(i), t.push(...A(e.fields));
1021
+ const a = S(e.dateField);
1022
+ a && t.push(a), t.push(...D(e.fields)), t.push(
1023
+ ...D(
1024
+ (o = e.filters) == null ? void 0 : o.map((i) => i.field)
1025
+ )
1026
+ );
1022
1027
  } else if (e.kind === "inputOptions") {
1023
- const i = S(e.field);
1024
- i && t.push(i);
1025
- } else e.kind === "sql" && t.push(...A(e.fields));
1026
- const n = "inputs" in e && Array.isArray(e.inputs) ? e.inputs : [];
1027
- for (const i of n) {
1028
- const a = S(i.field);
1028
+ const a = S(e.field);
1029
1029
  a && t.push(a);
1030
+ } else e.kind === "sql" && t.push(...D(e.fields));
1031
+ const n = "inputs" in e && Array.isArray(e.inputs) ? e.inputs : [];
1032
+ for (const a of n) {
1033
+ const i = S(a.field);
1034
+ i && t.push(i);
1030
1035
  }
1031
1036
  return t;
1032
1037
  }
1033
- function at(e) {
1038
+ function it(e) {
1034
1039
  const t = [];
1035
- for (const n of he(e)) {
1040
+ for (const n of me(e)) {
1036
1041
  const r = S(n.field);
1037
1042
  r && t.push(r);
1038
1043
  }
1039
1044
  for (const n of U(e))
1040
1045
  for (const r of J(n))
1041
- t.push(...rt(r.analytics));
1046
+ t.push(...at(r.analytics));
1042
1047
  return t;
1043
1048
  }
1044
- function it(e) {
1049
+ function ot(e) {
1045
1050
  var n;
1046
1051
  const t = [];
1047
1052
  for (const r of U(e))
1048
- for (const i of J(r))
1049
- V((n = i.analytics) == null ? void 0 : n.source) && t.push(i.analytics.source);
1053
+ for (const o of J(r))
1054
+ z((n = o.analytics) == null ? void 0 : n.source) && t.push(o.analytics.source);
1050
1055
  return t;
1051
1056
  }
1052
- function ot(e, t) {
1053
- const n = P(e).filter(V);
1057
+ function st(e, t) {
1058
+ const n = P(e).filter(z);
1054
1059
  if (n.length === 0)
1055
1060
  return t.push(
1056
1061
  b(
@@ -1058,35 +1063,35 @@ function ot(e, t) {
1058
1063
  "No semantic or physical source could be converted into the current dashboard authoring dataset reference."
1059
1064
  )
1060
1065
  ), [];
1061
- const r = n.every((a) => a.kind === "semantic"), i = Array.from(
1066
+ const r = n.every((a) => a.kind === "semantic"), o = Array.from(
1062
1067
  new Set(
1063
1068
  n.filter((a) => a.kind === "semantic").map((a) => a.domainId)
1064
1069
  )
1065
1070
  );
1066
- return n.length > 1 && (!r || i.length !== 1) ? (t.push(
1071
+ return n.length > 1 && (!r || o.length !== 1) ? (t.push(
1067
1072
  b(
1068
1073
  "multiple_datasets_out_of_scope",
1069
1074
  "The dashboard authoring compiler supports multiple datasets only within one semantic domain; using the first source and deferring the rest."
1070
1075
  )
1071
1076
  ), [n[0]]) : n;
1072
1077
  }
1073
- function st(e, t) {
1074
- const n = U(e), r = he(e), i = P(at(e)), a = P(
1075
- it(e)
1078
+ function dt(e, t) {
1079
+ const n = U(e), r = me(e), o = P(it(e)), a = P(
1080
+ ot(e)
1076
1081
  );
1077
1082
  return {
1078
1083
  sections: n,
1079
1084
  inputs: r,
1080
- sources: i,
1085
+ sources: o,
1081
1086
  primarySources: a,
1082
1087
  defaultSource: a.length === 1 ? a[0] : void 0,
1083
- datasets: ot(i, t)
1088
+ datasets: st(o, t)
1084
1089
  };
1085
1090
  }
1086
- function dt(e) {
1087
- return e && re(e).ok ? e : void 0;
1088
- }
1089
1091
  function ct(e) {
1092
+ return e && ae(e).ok ? e : void 0;
1093
+ }
1094
+ function lt(e) {
1090
1095
  var t;
1091
1096
  switch ((t = e.presentation) == null ? void 0 : t.kind) {
1092
1097
  case "kpi":
@@ -1105,30 +1110,33 @@ function ct(e) {
1105
1110
  return null;
1106
1111
  }
1107
1112
  }
1108
- function lt(e) {
1113
+ function ut(e) {
1109
1114
  var t, n, r;
1110
1115
  return ((t = e.presentation) == null ? void 0 : t.kind) === "kpi" ? "kpi" : ((n = e.presentation) == null ? void 0 : n.kind) === "table" ? "table" : ((r = e.presentation) == null ? void 0 : r.kind) === "text" ? "text" : "chart";
1111
1116
  }
1112
- function ut(e) {
1113
- switch (e) {
1117
+ function ft(e) {
1118
+ const t = we(e);
1119
+ switch (t) {
1114
1120
  case "not_in":
1115
1121
  return "not in";
1116
1122
  case "not_between":
1117
1123
  return "not between";
1118
1124
  case "contains":
1119
1125
  return "like";
1126
+ case "not_contains":
1127
+ return "not like";
1120
1128
  default:
1121
- return e || "in";
1129
+ return t || "in";
1122
1130
  }
1123
1131
  }
1124
- function ft(e) {
1132
+ function pt(e) {
1125
1133
  return T(e.field) ? e.field.dataType === "datetime" ? "date" : e.field.dataType || "string" : "string";
1126
1134
  }
1127
- function pt(e) {
1135
+ function ht(e) {
1128
1136
  if (!(!e || e.kind !== "physical"))
1129
1137
  return [e.databaseName, e.schemaName, e.tableName].filter(Boolean).join(".");
1130
1138
  }
1131
- function ht(e, t, n, r, i, a) {
1139
+ function mt(e, t, n, r, o, a) {
1132
1140
  if (e.kind !== "filter")
1133
1141
  return a.push(
1134
1142
  b(
@@ -1143,12 +1151,12 @@ function ht(e, t, n, r, i, a) {
1143
1151
  `Filter "${e.label || e.id}" needs a field before the dashboard compiler can materialize it.`
1144
1152
  )
1145
1153
  ), null;
1146
- const o = Se({
1154
+ const i = ke({
1147
1155
  explicitSource: void 0,
1148
1156
  field: e.field,
1149
1157
  defaultSource: t,
1150
1158
  fallbackSources: n
1151
- }), d = (o == null ? void 0 : o.kind) === "semantic" || (o == null ? void 0 : o.kind) === "physical" ? o.connectionId : void 0;
1159
+ }), d = (i == null ? void 0 : i.kind) === "semantic" || (i == null ? void 0 : i.kind) === "physical" ? i.connectionId : void 0;
1152
1160
  if (!d)
1153
1161
  return a.push(
1154
1162
  b(
@@ -1157,30 +1165,30 @@ function ht(e, t, n, r, i, a) {
1157
1165
  )
1158
1166
  ), null;
1159
1167
  const h = {
1160
- id: `filter-${pe(
1168
+ id: `filter-${he(
1161
1169
  F(e.id, e.field.name),
1162
- i
1170
+ o
1163
1171
  )}`,
1164
1172
  variableName: e.id,
1165
1173
  connectionId: d,
1166
1174
  title: e.label,
1167
1175
  column: e.field.name,
1168
- dataType: ft(e),
1169
- qualifiedTableName: pt(o),
1176
+ dataType: pt(e),
1177
+ qualifiedTableName: ht(i),
1170
1178
  sql: "",
1171
- operation: ut(e.operator),
1179
+ operation: ft(e.operator),
1172
1180
  type: e.multi === !1 ? "single" : "multiple",
1173
1181
  location: "dashboard",
1174
1182
  displayMode: "toolbar",
1175
- fieldMeta: (o == null ? void 0 : o.kind) === "semantic" ? {
1183
+ fieldMeta: (i == null ? void 0 : i.kind) === "semantic" ? {
1176
1184
  name: e.field.name,
1177
1185
  qualifiedFieldName: e.field.name,
1178
1186
  dataType: e.field.dataType,
1179
1187
  role: e.field.role === "measure" ? "metric" : "groupby"
1180
1188
  } : void 0,
1181
- semanticContext: (o == null ? void 0 : o.kind) === "semantic" ? {
1182
- semanticDomainId: o.domainId,
1183
- connectionId: o.connectionId
1189
+ semanticContext: (i == null ? void 0 : i.kind) === "semantic" ? {
1190
+ semanticDomainId: i.domainId,
1191
+ connectionId: i.connectionId
1184
1192
  } : void 0
1185
1193
  };
1186
1194
  return {
@@ -1195,11 +1203,11 @@ function ht(e, t, n, r, i, a) {
1195
1203
  )
1196
1204
  };
1197
1205
  }
1198
- function L(e) {
1206
+ function O(e) {
1199
1207
  const t = [], n = [];
1200
1208
  for (const r of e.viewIds) {
1201
- const i = e.viewIdToCardId.get(r);
1202
- i ? t.push(i) : n.push(r);
1209
+ const o = e.viewIdToCardId.get(r);
1210
+ o ? t.push(o) : n.push(r);
1203
1211
  }
1204
1212
  return n.length > 0 && e.warnings.push(
1205
1213
  b(
@@ -1208,8 +1216,8 @@ function L(e) {
1208
1216
  )
1209
1217
  ), Array.from(new Set(t));
1210
1218
  }
1211
- function mt(e) {
1212
- var r, i;
1219
+ function gt(e) {
1220
+ var r, o;
1213
1221
  if (!e.protocolScope) {
1214
1222
  const a = Array.from(new Set(e.boundCardIds));
1215
1223
  return a.length > 0 && a.length < e.allCardIds.length ? { kind: "cards", cardIds: a } : void 0;
@@ -1218,7 +1226,7 @@ function mt(e) {
1218
1226
  if (!((r = e.protocolScope.excludeViewIds) != null && r.length))
1219
1227
  return;
1220
1228
  const a = new Set(
1221
- L({
1229
+ O({
1222
1230
  inputLabel: e.inputLabel,
1223
1231
  viewIds: e.protocolScope.excludeViewIds,
1224
1232
  viewIdToCardId: e.viewIdToCardId,
@@ -1227,11 +1235,11 @@ function mt(e) {
1227
1235
  );
1228
1236
  return {
1229
1237
  kind: "cards",
1230
- cardIds: e.allCardIds.filter((o) => !a.has(o))
1238
+ cardIds: e.allCardIds.filter((i) => !a.has(i))
1231
1239
  };
1232
1240
  }
1233
1241
  if (e.protocolScope.level === "view") {
1234
- const a = L({
1242
+ const a = O({
1235
1243
  inputLabel: e.inputLabel,
1236
1244
  viewIds: e.protocolScope.viewIds,
1237
1245
  viewIdToCardId: e.viewIdToCardId,
@@ -1252,10 +1260,10 @@ function mt(e) {
1252
1260
  `Filter "${e.inputLabel}" was deferred because section "${e.protocolScope.sectionId}" does not match any materialized cards.`
1253
1261
  )
1254
1262
  ), null;
1255
- if (!((i = e.protocolScope.excludeViewIds) != null && i.length))
1263
+ if (!((o = e.protocolScope.excludeViewIds) != null && o.length))
1256
1264
  return { kind: "cards", cardIds: t };
1257
1265
  const n = new Set(
1258
- L({
1266
+ O({
1259
1267
  inputLabel: e.inputLabel,
1260
1268
  viewIds: e.protocolScope.excludeViewIds,
1261
1269
  viewIdToCardId: e.viewIdToCardId,
@@ -1267,20 +1275,20 @@ function mt(e) {
1267
1275
  cardIds: t.filter((a) => !n.has(a))
1268
1276
  };
1269
1277
  }
1270
- function xt(e) {
1278
+ function Dt(e) {
1271
1279
  var v, y, c;
1272
- const t = [], n = ye(e);
1280
+ const t = [], n = _e(e);
1273
1281
  for (const f of n.warnings)
1274
1282
  t.push(b(f.code, f.message));
1275
1283
  for (const f of n.errors)
1276
1284
  t.push(b(f.code, f.message));
1277
- const r = st(e, t), i = [], a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
1285
+ const r = dt(e, t), o = [], a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
1278
1286
  let h = 0;
1279
1287
  for (const [f, g] of r.sections.entries()) {
1280
1288
  const l = typeof g.title == "string" ? g.title : `Section ${f + 1}`, Q = g.id || F(l, `section-${f + 1}`);
1281
- o.set(Q, []);
1289
+ i.set(Q, []);
1282
1290
  for (const [X, m] of J(g).entries()) {
1283
- const Y = ct(m), z = F(
1291
+ const Y = lt(m), V = F(
1284
1292
  m.id || `${l}-${m.title || `View ${X + 1}`}`,
1285
1293
  `card-${f + 1}-${X + 1}`
1286
1294
  );
@@ -1289,7 +1297,7 @@ function xt(e) {
1289
1297
  b(
1290
1298
  "unsupported_presentation",
1291
1299
  `Dashboard presentation "${((v = m.presentation) == null ? void 0 : v.kind) || "unknown"}" is not supported by the dashboard authoring adapter.`,
1292
- `card-${z}`
1300
+ `card-${V}`
1293
1301
  )
1294
1302
  );
1295
1303
  continue;
@@ -1299,43 +1307,43 @@ function xt(e) {
1299
1307
  b(
1300
1308
  "sql_intent_deferred",
1301
1309
  "SQL analytics intent is valid protocol, but the current dashboard authoring adapter only materializes semantic and physical config-card intents.",
1302
- `card-${z}`
1310
+ `card-${V}`
1303
1311
  )
1304
1312
  );
1305
1313
  continue;
1306
1314
  }
1307
- const Z = pe(z, s), $ = `card-${Z}`;
1308
- m.id && a.set(m.id, $), (c = o.get(Q)) == null || c.push($);
1309
- const me = m.analytics && "inputs" in m.analytics ? m.analytics.inputs : void 0;
1310
- for (const ee of me || []) {
1315
+ const Z = he(V, s), $ = `card-${Z}`;
1316
+ m.id && a.set(m.id, $), (c = i.get(Q)) == null || c.push($);
1317
+ const ge = m.analytics && "inputs" in m.analytics ? m.analytics.inputs : void 0;
1318
+ for (const ee of ge || []) {
1311
1319
  const te = d.get(ee.inputId) || [];
1312
1320
  te.push($), d.set(ee.inputId, te);
1313
1321
  }
1314
- i.push({
1322
+ o.push({
1315
1323
  id: $,
1316
1324
  frameId: `frame-${Z}`,
1317
1325
  title: m.title,
1318
1326
  description: m.description,
1319
1327
  type: Y,
1320
- role: lt(m),
1328
+ role: ut(m),
1321
1329
  priority: h,
1322
1330
  section: l,
1323
- analyticsIntent: dt(m.analytics),
1331
+ analyticsIntent: ct(m.analytics),
1324
1332
  text: m.text
1325
1333
  }), h += 1;
1326
1334
  }
1327
1335
  }
1328
1336
  const I = r.inputs.map((f) => {
1329
- const g = mt({
1337
+ const g = gt({
1330
1338
  protocolScope: f.scope,
1331
1339
  inputLabel: f.label,
1332
- allCardIds: i.map((l) => l.id),
1340
+ allCardIds: o.map((l) => l.id),
1333
1341
  boundCardIds: d.get(f.id) || [],
1334
1342
  viewIdToCardId: a,
1335
- sectionIdToCardIds: o,
1343
+ sectionIdToCardIds: i,
1336
1344
  warnings: t
1337
1345
  });
1338
- return g === null ? null : ht(
1346
+ return g === null ? null : mt(
1339
1347
  f,
1340
1348
  r.defaultSource,
1341
1349
  r.sources,
@@ -1356,7 +1364,7 @@ function xt(e) {
1356
1364
  title: e.title,
1357
1365
  description: e.description,
1358
1366
  kind: "dashboard",
1359
- cards: i
1367
+ cards: o
1360
1368
  }
1361
1369
  ],
1362
1370
  filterInputs: I.length ? I : void 0,
@@ -1365,26 +1373,26 @@ function xt(e) {
1365
1373
  }, warnings: t };
1366
1374
  }
1367
1375
  export {
1368
- ge as DASHBOARD_AUTHORING_BREAKPOINTS,
1376
+ be as DASHBOARD_AUTHORING_BREAKPOINTS,
1369
1377
  B as DASHBOARD_AUTHORING_MAX_GENERATED_CARDS,
1370
- kt as applyDashboardChangePlan,
1371
- Ct as compileDashboardFromPlan,
1378
+ xt as applyDashboardChangePlan,
1379
+ kt as compileDashboardFromPlan,
1372
1380
  K as compileResponsiveDashboardLayouts,
1373
1381
  H as dashboardAuthoringDatasetMatchesSource,
1374
- vt as dashboardAuthoringFieldsReferToSameTarget,
1382
+ St as dashboardAuthoringFieldsReferToSameTarget,
1375
1383
  S as dashboardAuthoringSourceFromField,
1376
- _t as dashboardAuthoringSourceKey,
1377
- ae as dashboardAuthoringSourcesReferToSameDataset,
1378
- xt as dashboardPlanFromSemaphorDashboardIntent,
1379
- St as findDashboardAuthoringDatasetForSource,
1380
- Te as getDashboardAuthoringCardSource,
1381
- V as isMaterializableDashboardAuthoringSource,
1382
- we as isSemaphorSourceRef,
1384
+ wt as dashboardAuthoringSourceKey,
1385
+ ie as dashboardAuthoringSourcesReferToSameDataset,
1386
+ Dt as dashboardPlanFromSemaphorDashboardIntent,
1387
+ Ct as findDashboardAuthoringDatasetForSource,
1388
+ Me as getDashboardAuthoringCardSource,
1389
+ z as isMaterializableDashboardAuthoringSource,
1390
+ Se as isSemaphorSourceRef,
1383
1391
  P as mergeDashboardAuthoringSources,
1384
- ve as preferDashboardAuthoringSourceMetadata,
1385
- wt as preferredDashboardAuthoringSource,
1386
- Se as resolveDashboardAuthoringSource,
1387
- $e as validateDashboardAuthoringDatasetScope,
1388
- Pe as validateDashboardChangePlan,
1389
- Be as validateDashboardPlan
1392
+ Ce as preferDashboardAuthoringSourceMetadata,
1393
+ vt as preferredDashboardAuthoringSource,
1394
+ ke as resolveDashboardAuthoringSource,
1395
+ Ne as validateDashboardAuthoringDatasetScope,
1396
+ ze as validateDashboardChangePlan,
1397
+ Pe as validateDashboardPlan
1390
1398
  };