react-semaphor 0.1.585 → 0.1.586

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 (40) hide show
  1. package/dist/analytics-protocol/index.js +102 -100
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/briefings/index.js +1 -1
  4. package/dist/chunks/{assistant-chat-BdbLmAnK.js → assistant-chat-BU5gchFy.js} +6 -6
  5. package/dist/chunks/{bookmark-impact-BhT3k379.js → bookmark-impact-ZPSGncK6.js} +1 -1
  6. package/dist/chunks/{card-filter-builder-CEcKF6Fw.js → card-filter-builder-HELJWA4D.js} +165 -165
  7. package/dist/chunks/{dashboard-MPku_x1M.js → dashboard-BXP-ZxSY.js} +1 -1
  8. package/dist/chunks/{dashboard-briefing-launcher-CkFNlkr1.js → dashboard-briefing-launcher-BGj42whr.js} +7 -7
  9. package/dist/chunks/{dashboard-controls-Clt4ovXS.js → dashboard-controls-zvbRp6D2.js} +7 -7
  10. package/dist/chunks/{dashboard-json-DSmXazIg.js → dashboard-json-CykexgqL.js} +1 -1
  11. package/dist/chunks/{dates-CYZW9owO.js → dates-CaqZtq01.js} +4 -4
  12. package/dist/chunks/{edit-dashboard-visual-Dn2ECRbX.js → edit-dashboard-visual-C82JNxbt.js} +501 -501
  13. package/dist/chunks/{filter-reach-copy-CmJpPa4G.js → filter-reach-copy-ZERaFKsN.js} +880 -863
  14. package/dist/chunks/{index-0WYn6RMz.js → index-otMIColV.js} +1 -1
  15. package/dist/chunks/{matrix-analytical-definition-QjBgUYhP.js → matrix-analytical-definition-DOVSFFuf.js} +179 -169
  16. package/dist/chunks/{report-preferences-dialog-BRaeufEi.js → report-preferences-dialog-B-CoyS1x.js} +7 -7
  17. package/dist/chunks/{resolve-dashboard-input-context-Cn9jumxl.js → resolve-dashboard-input-context-BTTdKXH0.js} +10325 -10247
  18. package/dist/chunks/{saved-dashboard-context-CfqkUMzR.js → saved-dashboard-context-B-rosN4W.js} +75 -72
  19. package/dist/chunks/{semaphor-ready-indicator-D6WjdTGl.js → semaphor-ready-indicator-Cy1n_04D.js} +22649 -22461
  20. package/dist/chunks/{shelf-drop-preview-context-Bbbrr9u4.js → shelf-drop-preview-context-Bmz54WYm.js} +2 -2
  21. package/dist/chunks/{stored-dashboard-sPkTjxYf.js → stored-dashboard-rDJ8sw6J.js} +600 -595
  22. package/dist/chunks/{variable-draft-D1RotIEG.js → variable-draft-DvngkRMl.js} +3 -3
  23. package/dist/chunks/{visual-choice-JiJ-_3bi.js → visual-choice-BBPizkRo.js} +74 -72
  24. package/dist/dashboard/index.js +1 -1
  25. package/dist/dashboard-authoring/index.js +328 -320
  26. package/dist/index.js +11 -11
  27. package/dist/style.css +1 -1
  28. package/dist/surfboard/index.js +1 -1
  29. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +86 -3
  30. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +49 -27
  31. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
  32. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +30 -2
  33. package/dist/types/shared/analytics-protocol/click-reach-filter-id.d.ts +9 -0
  34. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +3 -1
  35. package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
  36. package/dist/types/shared/dashboard-authoring/click-to-filter-card-decision.d.ts +102 -0
  37. package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +13 -1
  38. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  39. package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +13 -0
  40. package/package.json +2 -2
@@ -2,17 +2,18 @@ var Z = Object.defineProperty;
2
2
  var Q = (e, t, a) => t in e ? Z(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
3
3
  var F = (e, t, a) => Q(e, typeof t != "symbol" ? t + "" : t, a);
4
4
  import { A as S, D as U, F as K, G as W } from "./bookmark-state-CL4WEpgB.js";
5
- import { s as X, i as Y, n as ee, f as te, j as ae, l as re, k as ne, m as se, o as oe, p as j, q as ie, t as de, u as le } from "./resolve-dashboard-input-context-Cn9jumxl.js";
6
- import { c as ce, e as L, d as ue, g as me, p as q, j as fe, k as he, r as _, m as O, n as pe, o as be, q as ge } from "./stored-dashboard-sPkTjxYf.js";
5
+ import { s as X, i as Y, n as ee, f as te, j as ae, l as re, k as ne, m as se, o as oe, p as j, q as ie, t as de, u as le } from "./resolve-dashboard-input-context-BTTdKXH0.js";
6
+ import { c as ce, e as L, d as ue, g as me, p as q, j as fe, k as he, r as _, m as O, n as pe, o as be, q as ge } from "./stored-dashboard-rDJ8sw6J.js";
7
7
  import { f as g, A as P, c as Ce, d as Ie, e as A } from "./context-BTLBjQNh.js";
8
8
  import { a as ye, T as ve, P as xe, o as I, d as B, b as D } from "./filter-value-text-xefXzZlf.js";
9
9
  import { r as Ve, a7 as Se } from "./validators-CJ8Jh0E8.js";
10
10
  import { b as $e } from "./metric-comparison-ZmurmEIs.js";
11
- function ke(e) {
11
+ import { i as ke } from "./matrix-analytical-definition-DOVSFFuf.js";
12
+ function qe(e) {
12
13
  const t = e.qualifiedFieldName || e.name;
13
14
  return e.label && e.label !== t ? `${e.label} (field ${t})` : t;
14
15
  }
15
- function qe(e, t = {}) {
16
+ function _e(e, t = {}) {
16
17
  if (!e) return [];
17
18
  const a = N(e, t);
18
19
  return a.length === 0 ? [] : e.logicalOperator === "AND" && !e.negate ? a : [z(e, a)];
@@ -24,7 +25,7 @@ function N(e, t) {
24
25
  const s = z(r, n);
25
26
  return [n.length > 1 && !r.negate ? { ...s, text: `(${s.text})` } : s];
26
27
  });
27
- return [...e.conditions.map((r) => _e(r, t)), ...a];
28
+ return [...e.conditions.map((r) => De(r, t)), ...a];
28
29
  }
29
30
  function z(e, t) {
30
31
  const a = t.map((r) => r.text).join(e.logicalOperator === "OR" ? " or " : " and ");
@@ -33,19 +34,19 @@ function z(e, t) {
33
34
  omittedValues: t.reduce((r, n) => r + n.omittedValues, 0)
34
35
  };
35
36
  }
36
- function _e(e, t) {
37
+ function De(e, t) {
37
38
  const a = Array.isArray(e.value) ? e.value : [e.value];
38
39
  return ye({
39
- subject: ke(e.field),
40
+ subject: qe(e.field),
40
41
  operator: e.operator,
41
42
  values: a,
42
- reading: De(e),
43
+ reading: we(e),
43
44
  relative: Ve(e.relativeMeta),
44
45
  latestValue: e.latestValue,
45
46
  shownAs: e.label
46
47
  }, t);
47
48
  }
48
- function De(e) {
49
+ function we(e) {
49
50
  return e.temporalBucket ? { kind: "bucket", bucket: e.temporalBucket } : Se(e.field.dataType) ? ve : xe;
50
51
  }
51
52
  function H(e) {
@@ -56,11 +57,11 @@ function H(e) {
56
57
  ].filter(Boolean);
57
58
  return r.length ? `${a}, ${r.join(", ")}` : a;
58
59
  }
59
- function we(e) {
60
+ function Fe(e) {
60
61
  return (e == null ? void 0 : e.kind) === "field_date" ? `the ${JSON.stringify(e.label)} filter` : "the dashboard date";
61
62
  }
62
- function Fe(e, t) {
63
- const a = t.source === "explicit" ? "set on the measure" : `from the dashboard date comparison on ${we(t.owner)}`;
63
+ function Ae(e, t) {
64
+ const a = t.source === "explicit" ? "set on the measure" : `from the dashboard date comparison on ${Fe(t.owner)}`;
64
65
  return `${e} is compared with ${H(t.spec)} (${a})`;
65
66
  }
66
67
  function k(e) {
@@ -76,21 +77,21 @@ function M(e, t) {
76
77
  return a = Math.imul(a ^ a >>> 16, 2246822507) ^ Math.imul(r ^ r >>> 13, 3266489909), r = Math.imul(r ^ r >>> 16, 2246822507) ^ Math.imul(a ^ a >>> 13, 3266489909), 4294967296 * (2097151 & r) + (a >>> 0);
77
78
  }
78
79
  const h = P;
79
- function Ae(e, t, a) {
80
+ function Me(e, t, a) {
80
81
  var y;
81
- const r = t !== "pending" && (t == null ? void 0 : t.status) === "ready" ? t : void 0, n = Me(e, t);
82
+ const r = t !== "pending" && (t == null ? void 0 : t.status) === "ready" ? t : void 0, n = Te(e, t);
82
83
  if (n) {
83
- const v = t !== "pending" && (t == null ? void 0 : t.status) === "blocked" ? Te(t) : void 0, $ = v ? g(v, h.textChars) : void 0;
84
+ const v = t !== "pending" && (t == null ? void 0 : t.status) === "blocked" ? Re(t) : void 0, $ = v ? g(v, h.textChars) : void 0;
84
85
  return {
85
86
  // A card that runs but is not described still changes when it runs differently.
86
87
  fingerprint: k(r ? T(r, a.calendar) : { reason: n, message: $ }),
87
88
  description: { status: "not_described", reason: n, ...$ ? { message: $ } : {} }
88
89
  };
89
90
  }
90
- const s = r, l = s.queryContext, m = Re(s), o = Oe(s, a), c = Be(s), i = je(s), u = l.drillSteps.map((v) => g(
91
+ const s = r, l = s.queryContext, m = je(s), o = Pe(s, a), c = Ne(s), i = Le(s), u = l.drillSteps.map((v) => g(
91
92
  `${JSON.stringify(v.label)} (then by ${v.toField.label || v.toField.name})`,
92
93
  h.textChars
93
- )), d = (y = s.card.sql) == null ? void 0 : y.trim(), b = d ? Ne(s) : [], f = {
94
+ )), d = (y = s.card.sql) == null ? void 0 : y.trim(), b = d ? ze(s) : [], f = {
94
95
  fields: I(m.length, h.cardFields),
95
96
  filters: I(o.length, h.cardFilters),
96
97
  controls: I(c.length, h.cardControls),
@@ -117,14 +118,14 @@ function Ae(e, t, a) {
117
118
  }
118
119
  };
119
120
  }
120
- function Me(e, t) {
121
+ function Te(e, t) {
121
122
  if (e.type === "matrixTable") return "matrix";
122
123
  if (e.type === "custom" || Y(e)) return "custom_visual";
123
124
  if (ee(e.python ?? "").trim()) return "python";
124
125
  if (t === "pending") return "snapshot_pending";
125
126
  if ((t == null ? void 0 : t.status) !== "ready") return "snapshot_blocked";
126
127
  }
127
- function Te(e) {
128
+ function Re(e) {
128
129
  if (e.message) return e.message;
129
130
  const t = e.mappingDispositions.flatMap((a) => a.status === "block" ? [`${a.inputId} (${a.reason})`] : []);
130
131
  return t.length ? `dashboard inputs that cannot apply to this card: ${t.join(", ")}` : void 0;
@@ -138,7 +139,7 @@ const Ee = [
138
139
  ["measure", "metrics"],
139
140
  ["detail", "details"]
140
141
  ];
141
- function Re(e) {
142
+ function je(e) {
142
143
  const { fields: t } = te({
143
144
  type: e.card.type,
144
145
  config: e.queryContext.finalConfig
@@ -154,37 +155,39 @@ function Re(e) {
154
155
  };
155
156
  }));
156
157
  }
157
- function je(e) {
158
+ function Le(e) {
158
159
  const t = e.queryContext;
159
160
  return (t.finalConfig.metricColumns ?? []).flatMap((a) => {
160
161
  const r = $e({
161
162
  metricComparison: a.comparison,
162
163
  globalDateComparison: t.globalDateComparison
163
164
  });
164
- return r ? [g(Fe(Le(a.label || a.name), r), h.textChars)] : [];
165
+ return r ? [g(Ae(Oe(a.label || a.name), r), h.textChars)] : [];
165
166
  });
166
167
  }
167
- function Le(e) {
168
+ function Oe(e) {
168
169
  return JSON.stringify(e);
169
170
  }
170
- function Oe(e, { calendar: t }) {
171
+ function Pe(e, { calendar: t }) {
171
172
  const a = e.queryContext, r = { maxListedValues: h.inputValues, timeZone: t.tz }, n = e.card.inlineFilters ?? [], s = new Set(n.map((i) => i.id)), l = new Map(
172
173
  [...a.queryFilterDefinitions, ...n].map((i) => [i.id, i.title])
173
174
  ), m = a.cardFilterValues.map((i) => {
174
175
  const u = l.get(i.filterId) || i.name, d = i.dateOwner === "global_date" ? `${u} (the dashboard date, on this card's field ${i.name})` : `${u} (field ${i.name})`, b = B(i, d, r);
175
176
  return {
176
- origin: s.has(i.filterId) ? "card_input" : "dashboard_input",
177
+ // A click that reaches the card through relationships is the click it
178
+ // is, not an input (click relationship reach CR-D15).
179
+ origin: ke(i.filterId) ? "selection" : s.has(i.filterId) ? "card_input" : "dashboard_input",
177
180
  text: g(b.text, h.textChars),
178
181
  ...b.omittedValues ? { omittedValues: b.omittedValues } : {}
179
182
  };
180
- }), o = a.resolvedFilterParts, c = [["card", o.authored], ["drill", o.drill], ["selection", o.selections]].flatMap(([i, u]) => qe(u, r).map((d) => ({
183
+ }), o = a.resolvedFilterParts, c = [["card", o.authored], ["drill", o.drill], ["selection", o.selections]].flatMap(([i, u]) => _e(u, r).map((d) => ({
181
184
  origin: i,
182
185
  text: g(d.text, h.textChars),
183
186
  ...d.omittedValues ? { omittedValues: d.omittedValues } : {}
184
187
  })));
185
188
  return [...m, ...c];
186
189
  }
187
- function Pe(e) {
190
+ function Be(e) {
188
191
  const t = e.queryContext, a = L({
189
192
  sql: e.card.sql,
190
193
  controlBindings: t.controlBindings
@@ -198,14 +201,14 @@ function Pe(e) {
198
201
  sqlParameterIds: a.filter((s) => s.controlId === n).map((s) => s.paramId)
199
202
  }));
200
203
  }
201
- function Be(e) {
204
+ function Ne(e) {
202
205
  const t = e.queryContext, a = new Map(
203
206
  [...t.controlDefinitions, ...t.cardControlDefinitions].map((r) => [r.id, r])
204
207
  );
205
- return Pe(e).map(({ id: r, bindings: n, sqlParameterIds: s }) => {
208
+ return Be(e).map(({ id: r, bindings: n, sqlParameterIds: s }) => {
206
209
  var o;
207
210
  const l = t.controlValues[r], m = /* @__PURE__ */ new Set([
208
- ...n.filter((c) => c.target !== "sql_param").map((c) => ze(c, l)),
211
+ ...n.filter((c) => c.target !== "sql_param").map((c) => He(c, l)),
209
212
  ...s.map((c) => `SQL parameter ${c}`)
210
213
  ]);
211
214
  return {
@@ -217,7 +220,7 @@ function Be(e) {
217
220
  };
218
221
  });
219
222
  }
220
- function Ne(e) {
223
+ function ze(e) {
221
224
  const t = e.queryContext;
222
225
  return L({ sql: e.card.sql, controlBindings: t.controlBindings }).map((a) => ({
223
226
  name: g(a.paramId, h.labelChars),
@@ -227,7 +230,7 @@ function Ne(e) {
227
230
  )
228
231
  }));
229
232
  }
230
- function ze(e, t) {
233
+ function He(e, t) {
231
234
  const a = typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : void 0;
232
235
  switch (e.target) {
233
236
  case "sql_param":
@@ -254,11 +257,11 @@ class V extends Error {
254
257
  this.name = "AssistantContextSourceError", this.code = a;
255
258
  }
256
259
  }
257
- const C = P, He = "Untitled";
258
- function Je(e) {
260
+ const C = P, Je = "Untitled";
261
+ function Ge(e) {
259
262
  var f;
260
263
  if (e.surface === "none")
261
- return E({
264
+ return R({
262
265
  version: A,
263
266
  surface: "none",
264
267
  otherSheets: [],
@@ -275,12 +278,12 @@ function Je(e) {
275
278
  "card_not_on_sheet",
276
279
  `card ${e.selectedCard.cardId} is not on sheet ${a}`
277
280
  );
278
- const u = s ? Qe(e, s, m) : [], d = {
281
+ const u = s ? Ue(e, s, m) : [], d = {
279
282
  otherSheets: I(l.length, C.otherSheets),
280
283
  activeInputs: I(u.length, C.activeInputs),
281
284
  cards: I(m.length, C.summaryCards)
282
285
  }, b = Object.fromEntries(Object.entries(d).filter(([, p]) => p > 0));
283
- return E({
286
+ return R({
284
287
  version: A,
285
288
  surface: e.editing ? "editor" : "dashboard",
286
289
  dashboard: {
@@ -292,25 +295,25 @@ function Je(e) {
292
295
  otherSheets: l.slice(0, C.otherSheets).map((p) => ({ id: p.id, title: x(p.title) })),
293
296
  activeInputs: u.slice(0, C.activeInputs),
294
297
  cards: o.map((p) => J(p.card)),
295
- ...i && e.selectedCard ? { selectedCard: Ge(i, e.selectedCard.snapshot, r) } : {},
298
+ ...i && e.selectedCard ? { selectedCard: Ze(i, e.selectedCard.snapshot, r) } : {},
296
299
  ...e.editing ? { editing: e.editing } : {},
297
300
  ...Object.keys(b).length ? { omitted: b } : {},
298
301
  timeZone: r.tz
299
302
  });
300
303
  }
301
- function Ge(e, t, a) {
302
- return { ...J(e), ...Ae(e, t, { calendar: a }) };
304
+ function Ze(e, t, a) {
305
+ return { ...J(e), ...Me(e, t, { calendar: a }) };
303
306
  }
304
- function E(e) {
307
+ function R(e) {
305
308
  const t = Ce(e);
306
309
  if (t > C.contextBytes) throw new Ie(t);
307
310
  return e;
308
311
  }
309
312
  function x(e) {
310
- return g((e == null ? void 0 : e.trim()) || He, C.labelChars);
313
+ return g((e == null ? void 0 : e.trim()) || Je, C.labelChars);
311
314
  }
312
315
  function J(e) {
313
- const t = Ze(e);
316
+ const t = Qe(e);
314
317
  return {
315
318
  id: e.id,
316
319
  title: x(e.title),
@@ -318,7 +321,7 @@ function J(e) {
318
321
  ...t ? { source: t } : {}
319
322
  };
320
323
  }
321
- function Ze(e) {
324
+ function Qe(e) {
322
325
  var a;
323
326
  const t = se(e);
324
327
  if (t.kind === "config")
@@ -328,7 +331,7 @@ function Ze(e) {
328
331
  return r ? { kind: "sql", connectionId: r } : void 0;
329
332
  }
330
333
  }
331
- function Qe(e, t, a) {
334
+ function Ue(e, t, a) {
332
335
  const { dashboard: r } = e, n = t.kind === "document" ? "document" : "dashboard", s = n === "document" ? void 0 : e.transientContexts, { shouldApplyDashboardFilters: l } = ue(s), m = (u, d) => ae({
333
336
  dashboard: r,
334
337
  sheetId: t.id,
@@ -339,15 +342,15 @@ function Qe(e, t, a) {
339
342
  calendar: e.calendar
340
343
  }), o = /* @__PURE__ */ new Map(), c = (u) => {
341
344
  u.inputs.forEach((d, b) => {
342
- if (R(d)) return;
345
+ if (E(d)) return;
343
346
  const f = u.resolvedInputs[b], p = o.get(d.id) ?? { input: d };
344
- !p.resolved && f && Ue(f) && (p.resolved = f), o.set(d.id, p);
347
+ !p.resolved && f && Ke(f) && (p.resolved = f), o.set(d.id, p);
345
348
  });
346
349
  };
347
350
  c(m(null));
348
351
  let i = re(r).filter((u) => {
349
352
  var d;
350
- return !R(u) && !((d = o.get(u.id)) != null && d.resolved);
353
+ return !E(u) && !((d = o.get(u.id)) != null && d.resolved);
351
354
  });
352
355
  for (const u of a) {
353
356
  if (i.length === 0) break;
@@ -366,21 +369,21 @@ function Qe(e, t, a) {
366
369
  }
367
370
  return [...o.values()].flatMap((u) => {
368
371
  if (!u.resolved) return [];
369
- const d = u.input.kind === "filter" && !l && !K(u.input), b = Ke(u, e.calendar.tz, d);
372
+ const d = u.input.kind === "filter" && !l && !K(u.input), b = We(u, e.calendar.tz, d);
370
373
  return b ? [b] : [];
371
374
  });
372
375
  }
373
- function R(e) {
376
+ function E(e) {
374
377
  var a;
375
378
  const t = (a = e.compatibility) == null ? void 0 : a.source;
376
379
  return t === "cardInlineFilter" || t === "cardControl";
377
380
  }
378
- function Ue(e) {
381
+ function Ke(e) {
379
382
  if (e.kind === "filter") return !!e.filterValue;
380
383
  const t = e.controlValue;
381
384
  return t == null ? !1 : typeof t == "string" ? t.trim().length > 0 : Array.isArray(t) ? t.length > 0 : !0;
382
385
  }
383
- function Ke(e, t, a) {
386
+ function We(e, t, a) {
384
387
  const { input: r, resolved: n } = e, s = x(r.label), l = {
385
388
  inputId: r.id,
386
389
  label: s,
@@ -413,21 +416,21 @@ function Ke(e, t, a) {
413
416
  }
414
417
  };
415
418
  }
416
- function ct(e) {
417
- return We(e).context;
419
+ function mt(e) {
420
+ return Xe(e).context;
418
421
  }
419
- function We(e) {
422
+ function Xe(e) {
420
423
  const { place: t, calendar: a } = e, r = q(e.dashboard), n = pe({ dashboard: r, host: {}, calendar: a, materializeInputs: !1 }), s = {
421
424
  ..._({ dashboard: r, capture: {}, calendar: a }).runtimeValues,
422
425
  cardViewState: t.cardViewState ?? {}
423
- }, l = t.cardId ? Ye(r, t.cardId) : void 0, m = l ? G({
426
+ }, l = t.cardId ? et(r, t.cardId) : void 0, m = l ? G({
424
427
  dashboard: r,
425
428
  location: l,
426
429
  runtimeValues: s,
427
430
  semanticExecutionPayload: e.semanticExecutionPayload,
428
431
  calendar: a,
429
432
  withRequest: !0
430
- }) : void 0, o = Je({
433
+ }) : void 0, o = Ge({
431
434
  surface: "dashboard",
432
435
  dashboard: r,
433
436
  // A sheet that does not hold the card is refused by the projection.
@@ -441,10 +444,10 @@ function We(e) {
441
444
  return {
442
445
  context: o,
443
446
  openDashboard: r,
444
- ...o.selectedCard && m !== void 0 ? { cardReplay: Xe({ dashboard: r, cardId: o.selectedCard.id, snapshot: m }) } : {}
447
+ ...o.selectedCard && m !== void 0 ? { cardReplay: Ye({ dashboard: r, cardId: o.selectedCard.id, snapshot: m }) } : {}
445
448
  };
446
449
  }
447
- function Xe(e) {
450
+ function Ye(e) {
448
451
  const t = e.dashboard ? S(e.dashboard).find((r) => r.cardId === e.cardId) : void 0, a = w({
449
452
  card: e.card ?? (t == null ? void 0 : t.card),
450
453
  snapshot: e.snapshot,
@@ -458,14 +461,14 @@ function Xe(e) {
458
461
  }
459
462
  };
460
463
  }
461
- function Ye(e, t) {
464
+ function et(e, t) {
462
465
  const a = S(e).find((r) => r.cardId === t);
463
466
  if (!a)
464
467
  throw new V("card_not_found", `card ${t} is not on dashboard ${e.id}`);
465
468
  return a;
466
469
  }
467
470
  function G(e) {
468
- const { dashboard: t, location: a, runtimeValues: r } = e, n = a.kind === "documentSectionCard" ? et(t, a) : void 0;
471
+ const { dashboard: t, location: a, runtimeValues: r } = e, n = a.kind === "documentSectionCard" ? tt(t, a) : void 0;
469
472
  return O({
470
473
  dashboard: t,
471
474
  cardId: a.cardId,
@@ -506,7 +509,7 @@ function w(e) {
506
509
  return { status: "unavailable", reason: "no_query" };
507
510
  }
508
511
  }
509
- function ut(e) {
512
+ function ft(e) {
510
513
  const { calendar: t } = e, a = e.host ?? {}, r = q(
511
514
  a.controlContract ? fe(he(e.dashboard), {
512
515
  controlContractOverrides: a.controlContract,
@@ -536,7 +539,7 @@ function ut(e) {
536
539
  ...o.message ? { message: o.message } : {}
537
540
  };
538
541
  }
539
- function et(e, t) {
542
+ function tt(e, t) {
540
543
  var r, n, s;
541
544
  const a = (r = e.sheets) == null ? void 0 : r.find((l) => l.id === t.sheetId);
542
545
  if ((s = (n = a == null ? void 0 : a.document) == null ? void 0 : n.inputs) != null && s.length && j(e, t.sheetId).length === 0)
@@ -552,7 +555,7 @@ function et(e, t) {
552
555
  documentControlValues: {}
553
556
  };
554
557
  }
555
- function mt(e) {
558
+ function ht(e) {
556
559
  const { calendar: t } = e, a = q(e.dashboard), r = a.variables ?? [], n = r.find((f) => f.name === e.name) ?? r.find((f) => f.id === e.name);
557
560
  if (!n)
558
561
  return { status: "refused", reason: "variable_unknown", message: `No variable named ${e.name} on this dashboard.`, available: r.map((f) => f.name) };
@@ -566,7 +569,7 @@ function mt(e) {
566
569
  };
567
570
  const l = W(a, n.id);
568
571
  if ((l == null ? void 0 : l.kind) !== "variable") return { status: "refused", reason: "broken", message: `${n.name} has no card to run.` };
569
- const m = oe(s) && s.document ? s.document : void 0, o = tt(a, s.id, !!m, e.inputs ?? {}, t);
572
+ const m = oe(s) && s.document ? s.document : void 0, o = at(a, s.id, !!m, e.inputs ?? {}, t);
570
573
  if (!o.ok) return { status: "refused", reason: "broken", message: o.message };
571
574
  const { runtimeValues: c, transientContexts: i } = _({ dashboard: a, capture: o.capture, calendar: t }), u = m ? { sheetId: s.id, sectionId: void 0, documentFilterValues: [], documentControlDefinitions: [], documentControlValues: {} } : void 0, d = O({
572
575
  dashboard: a,
@@ -591,7 +594,7 @@ function mt(e) {
591
594
  const b = w({ card: l.card, snapshot: d, documentSection: !1 });
592
595
  return b.status !== "ready" ? { status: "refused", reason: "broken", message: b.message ?? `${n.name} has no query to run.` } : { status: "ready", variable: n, place: m ? "document" : "sheet", request: b.request };
593
596
  }
594
- function tt(e, t, a, r, n) {
597
+ function at(e, t, a, r, n) {
595
598
  const s = Object.keys(r);
596
599
  if (!s.length) return { ok: !0, capture: {} };
597
600
  if (!a) return { ok: !1, message: "Values are given for a Document's inputs; at a tab the variable runs with the saved defaults." };
@@ -618,12 +621,12 @@ function tt(e, t, a, r, n) {
618
621
  }
619
622
  export {
620
623
  V as A,
621
- Xe as a,
622
- ut as b,
623
- mt as c,
624
+ Ye as a,
625
+ ft as b,
626
+ ht as c,
624
627
  w as d,
625
- ct as e,
626
- We as f,
628
+ mt as e,
629
+ Xe as f,
627
630
  G as g,
628
- Je as p
631
+ Ge as p
629
632
  };