react-semaphor 0.1.601 → 0.1.602

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 (75) hide show
  1. package/dist/analytics-protocol/index.js +9 -9
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +7 -7
  4. package/dist/briefings/index.js +4 -4
  5. package/dist/chunks/{assistant-chat-BE0XXzZP.js → assistant-chat-BWF3GYip.js} +12 -12
  6. package/dist/chunks/{bookmark-impact-DXDAN5AY.js → bookmark-impact-BF3iRx5a.js} +3 -3
  7. package/dist/chunks/{bookmark-state-BMyB3Tb6.js → bookmark-state-CBSTdW6q.js} +4 -4
  8. package/dist/chunks/{card-filter-builder-CE0-YVN5.js → card-filter-builder-B8XHwMY6.js} +394 -394
  9. package/dist/chunks/{comparison-window-caption-Dxj2CHOa.js → comparison-window-caption-W83qB4V5.js} +4 -4
  10. package/dist/chunks/{dashboard-mJKPFRbb.js → dashboard-DG5EIYYB.js} +1 -1
  11. package/dist/chunks/{dashboard-briefing-launcher-CntwKyiZ.js → dashboard-briefing-launcher-CBSrhyWZ.js} +727 -718
  12. package/dist/chunks/{dashboard-controls-XO089DMg.js → dashboard-controls-D6ECO4N1.js} +15 -15
  13. package/dist/chunks/{dashboard-json-CQRiydUv.js → dashboard-json-DrJftBSL.js} +4 -4
  14. package/dist/chunks/{dates-B-Urp5OD.js → dates-Bz-qM5px.js} +10 -10
  15. package/dist/chunks/{edit-dashboard-visual-f-Dm-BLR.js → edit-dashboard-visual-BDYAJIbb.js} +1565 -1544
  16. package/dist/chunks/{filter-line-CKNMyNTQ.js → filter-line-BXT6y303.js} +6 -6
  17. package/dist/chunks/{filter-reach-copy-B8GGyVuR.js → filter-reach-copy-BukhZmzm.js} +1661 -1950
  18. package/dist/chunks/{filter-value-text-CRtKecI5.js → filter-value-text-D3-bf3_b.js} +4 -4
  19. package/dist/chunks/{index-DoPApnxg.js → index-BW0yozjs.js} +5 -5
  20. package/dist/chunks/{layout-grid-CiSCZdIr.js → layout-grid-Ds0diMeY.js} +1 -1
  21. package/dist/chunks/{matrix-analytical-definition-myf3D3Qx.js → matrix-analytical-definition-CgQgVeeI.js} +4 -4
  22. package/dist/chunks/{matrix-member-presentation-g0c_NpDW.js → matrix-member-presentation-DSBIIudt.js} +1 -1
  23. package/dist/chunks/{matrix-operation-contract-C1SuOHLZ.js → matrix-operation-contract--DkNCOzd.js} +517 -514
  24. package/dist/chunks/{metric-comparison-Cm0G893W.js → metric-comparison-zMylnIkc.js} +1 -1
  25. package/dist/chunks/{paintbrush-DQIwqlck.js → paintbrush-CX8pao1j.js} +1 -1
  26. package/dist/chunks/{palette-Cun747Rg.js → palette-CuA0HlzF.js} +1 -1
  27. package/dist/chunks/{pivot-result-contract-expectations-C1Dyx8du.js → pivot-result-contract-expectations-C8KL7hPx.js} +8 -8
  28. package/dist/chunks/{pivot-result-identity-CBS-ssEp.js → pivot-result-identity-C1AOH1PS.js} +1 -1
  29. package/dist/chunks/{raw-temporal-value-DN_l-Tss.js → raw-temporal-value-E416F-0L.js} +1 -1
  30. package/dist/chunks/{report-preferences-dialog-SDZEcG2x.js → report-preferences-dialog-CbuVNDGi.js} +13 -13
  31. package/dist/chunks/{report-runtime-context-BbedQdtc.js → report-runtime-context-E7USjN7E.js} +1 -1
  32. package/dist/chunks/{resolve-dashboard-input-context-DRBS0eRa.js → resolve-dashboard-input-context-CULCE_hM.js} +8417 -7052
  33. package/dist/chunks/{save-Dj5bjm7P.js → save-BKHlDONy.js} +1 -1
  34. package/dist/chunks/{saved-dashboard-context-DWVlJcsa.js → saved-dashboard-context-C1WlOx5z.js} +32 -32
  35. package/dist/chunks/{selection-filter-compiler-DmAr7yqC.js → selection-filter-compiler-ifT8JCXS.js} +1 -1
  36. package/dist/chunks/{semaphor-ready-indicator-OFOoAY-A.js → semaphor-ready-indicator-CBIRcDWs.js} +33414 -31523
  37. package/dist/chunks/{shelf-drop-preview-context-2swWypXu.js → shelf-drop-preview-context-xR69SMA8.js} +53 -53
  38. package/dist/chunks/{stored-dashboard-NtOuEX6a.js → stored-dashboard-BuM8vnWf.js} +739 -717
  39. package/dist/chunks/{style-sheet-parts-Qv4UcLAo.js → style-sheet-parts-Bt9ZNre8.js} +2 -2
  40. package/dist/chunks/{table-export-sheet-Do7ZB0_F.js → table-export-sheet-DVljtHkG.js} +1 -1
  41. package/dist/chunks/{token-types-Dy_aXO-U.js → token-types-D_xKgyVS.js} +1 -1
  42. package/dist/chunks/{upload-Bq-puSVy.js → upload-Dll_M7XQ.js} +1 -1
  43. package/dist/chunks/{validators-C7DFk3QK.js → validators-ClWHpYql.js} +2 -2
  44. package/dist/chunks/{variable-draft-Cy03qnEi.js → variable-draft-CDGGl53R.js} +27 -28
  45. package/dist/dashboard/index.js +2 -2
  46. package/dist/dashboard-authoring/index.js +3086 -2578
  47. package/dist/format-utils/index.js +14 -14
  48. package/dist/index.js +71 -73
  49. package/dist/report-runtime-context/index.js +1 -1
  50. package/dist/style.css +1 -1
  51. package/dist/surfboard/index.js +2 -2
  52. package/dist/types/components/dashboard/dashboard-web-component.d.ts +7 -0
  53. package/dist/types/index.js +5 -5
  54. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +1 -1
  55. package/dist/types/lib/query-context/assemble-card-query.d.ts +6 -1
  56. package/dist/types/lib/stores/dashboard-store.d.ts +30 -0
  57. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +15 -0
  58. package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +52 -0
  59. package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +129 -0
  60. package/dist/types/shared/dashboard-authoring/calculations/resolve-dashboard-field-copies.d.ts +46 -0
  61. package/dist/types/shared/dashboard-authoring/calculations/tokens.d.ts +36 -0
  62. package/dist/types/shared/dashboard-authoring/changes/calculation-change.d.ts +399 -0
  63. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +144 -2
  64. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +21 -2
  65. package/dist/types/shared/dashboard-authoring/changes/domain-change.d.ts +143 -266
  66. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +2 -0
  67. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +46 -0
  68. package/dist/types/shared/dashboard-authoring/index.d.ts +7 -1
  69. package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +133 -0
  70. package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +71 -0
  71. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +18 -5
  72. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +21 -0
  73. package/dist/types/shared/usage-events/details.d.ts +2 -2
  74. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  75. package/package.json +1 -1
@@ -1,21 +1,21 @@
1
- import { hn as Dn, dn as Sn, cw as Tn, b5 as Vn, bx as Mn, m as kn, co as xn, ho as Te, f8 as dt, fb as Pn, c4 as wn, hp as On, aF as _n, hq as ut, hr as An, bR as Ve, hs as ft, dU as de, U as Bn, ht as En, s as _, hu as ue, n as Me, hv as Rn, hw as qn, dM as pt, dO as mt, dx as Nn, dT as jn, dR as Ge, dS as zn, b as Ln, dz as Kn, dL as Gn, dJ as Hn, bU as gt, bs as Un, a5 as A, cA as Qn, a4 as $n, hx as fe, hy as yt, hz as Wn, o as Zn, hA as ke, hB as pe, hC as Jn, hD as xe, hE as Yn, hF as Xn, hG as er, hH as tr, hI as nr, q as Pe, hJ as rr, t as U, r as or, h as ir, hK as L, hL as ar, hM as te, hN as bt, he as we, O as sr, hO as lr, hP as cr, h7 as It, hQ as dr, hR as ur, j as fr, hS as pr, hT as ht, hU as mr, hV as gr, hW as yr, c5 as Ct, hX as br, hY as Ir, hZ as vt, p as Oe, d1 as hr, a6 as Cr, v as Ft, h_ as vr, h$ as Fr, i0 as Dr, d0 as Sr, i1 as Tr, x as Vr, y as He, H as Mr, i2 as kr, i3 as xr, d2 as Pr, i4 as wr } from "./resolve-dashboard-input-context-DRBS0eRa.js";
2
- import { am as Or, a6 as W, K as _r, w as Ar, ay as he, x as Br, a9 as ne, aA as Dt, V as Er, b as Rr, k as qr, aE as Nr, aF as jr } from "./validators-C7DFk3QK.js";
3
- import { q as St } from "./matrix-operation-contract-C1SuOHLZ.js";
1
+ import { jp as Tn, dA as Vn, cJ as Mn, be as kn, bL as xn, t as Pn, cB as wn, jq as Te, ft as dt, fw as On, ch as _n, jr as An, aJ as Bn, iq as ut, is as En, c2 as Ve, js as ft, e4 as de, Y as Rn, iu as qn, s as _, ii as ue, q as Me, jt as jn, iz as Nn, dY as pt, d_ as mt, dJ as zn, e3 as Ln, e1 as Ge, e2 as Kn, h as Gn, dL as Hn, dX as Un, dV as Qn, c5 as gt, bG as $n, a9 as A, ha as yt, cN as Jn, a8 as Wn, ju as fe, jv as bt, jw as Yn, u as Zn, jx as ke, jj as pe, jy as Xn, jz as xe, jA as er, jB as tr, jC as nr, jD as rr, jE as or, w as Pe, jF as ir, x as U, r as ar, m as sr, jG as L, jH as lr, jI as te, jJ as It, i8 as we, S as cr, jK as dr, jL as ur, i1 as Ct, jM as fr, jN as pr, o as mr, jO as gr, jP as ht, jQ as yr, jR as br, jS as Ir, ci as vt, jT as Cr, jU as hr, jV as Ft, v as Oe, de as vr, aa as Fr, z as Dt, h9 as Dr, jW as Sr, jX as Tr, jY as Vr, dd as Mr, jg as kr, B as xr, C as He, L as Pr, jZ as wr, j_ as Or, df as _r, j$ as Ar } from "./resolve-dashboard-input-context-CULCE_hM.js";
2
+ import { am as Br, a6 as J, K as Er, w as Rr, ay as Ce, x as qr, a9 as ne, aA as St, V as jr, b as Nr, k as zr, aE as Lr, aF as Kr } from "./validators-ClWHpYql.js";
3
+ import { q as Tt } from "./matrix-operation-contract--DkNCOzd.js";
4
4
  import "./analytics-base-schemas-DevrgqQb.js";
5
5
  import "./pickers-DkqmtnTL.js";
6
- import { canonicalizeSupportedCurrencyCode as Tt } from "../value-format-preferences/index.js";
7
- import { ZodError as zr } from "zod";
8
- import { b as re, r as Lr, b5 as Kr, i as Gr, aQ as Hr, aj as Ue, aN as Qe } from "./pivot-result-contract-expectations-C1Dyx8du.js";
9
- import { aE as Vt, aF as Mt, aG as be, a3 as Ur, aD as kt, C as Ce, aH as j, A as Z, i as xt, w as Qr, q as $r, v as Wr, B as _e, aI as Zr, al as Jr, G as Pt, F as Yr, K as $e, P as wt, Q as Ot, J as _t } from "./bookmark-state-BMyB3Tb6.js";
6
+ import { canonicalizeSupportedCurrencyCode as Vt } from "../value-format-preferences/index.js";
7
+ import { ZodError as Gr } from "zod";
8
+ import { b as re, r as Hr, b7 as Ur, i as Qr, aQ as $r, aj as Ue, aN as Qe } from "./pivot-result-contract-expectations-C8KL7hPx.js";
9
+ import { aE as Mt, aF as kt, aG as be, a3 as Jr, aD as xt, C as he, aH as N, A as W, i as Pt, w as Wr, q as Yr, v as Zr, B as _e, aI as Xr, al as eo, G as wt, F as to, K as $e, P as Ot, Q as _t, J as At } from "./bookmark-state-CBSTdW6q.js";
10
10
  import "./schema-C9NPiIru.js";
11
11
  import "./index-CV_Kzou0.js";
12
12
  import "./context-BJoEFgNl.js";
13
- import { a as Xr, i as eo } from "./matrix-analytical-definition-myf3D3Qx.js";
14
- import { D as to } from "./report-runtime-context-BbedQdtc.js";
15
- import { isPdfTableCardType as no, PDF_CAPACITY as ro } from "../pdf-export-policy/index.js";
16
- import { K as We } from "./raw-temporal-value-DN_l-Tss.js";
17
- import { t as oo, c as io, n as ao } from "./selection-filter-compiler-DmAr7yqC.js";
18
- const so = (e, t) => {
13
+ import { a as no, i as ro } from "./matrix-analytical-definition-CgQgVeeI.js";
14
+ import { D as oo } from "./report-runtime-context-E7USjN7E.js";
15
+ import { isPdfTableCardType as io, PDF_CAPACITY as ao } from "../pdf-export-policy/index.js";
16
+ import { K as Je } from "./raw-temporal-value-E416F-0L.js";
17
+ import { t as so, c as lo, n as co } from "./selection-filter-compiler-ifT8JCXS.js";
18
+ const uo = (e, t) => {
19
19
  const n = {};
20
20
  if (e === null || t === null)
21
21
  return t;
@@ -33,8 +33,8 @@ const so = (e, t) => {
33
33
  if (!ve(i, a))
34
34
  if (Array.isArray(i) && Array.isArray(a))
35
35
  n[o] = a;
36
- else if (Ze(i) && Ze(a)) {
37
- const s = so(i, a);
36
+ else if (We(i) && We(a)) {
37
+ const s = uo(i, a);
38
38
  Object.keys(s).length > 0 && (n[o] = s);
39
39
  } else
40
40
  n[o] = a;
@@ -49,7 +49,7 @@ const so = (e, t) => {
49
49
  return n.length !== r.length ? !1 : n.every((o) => ve(e[o], t[o]));
50
50
  }
51
51
  return !1;
52
- }, Ze = (e) => e !== null && typeof e == "object" && !Array.isArray(e), oe = (e) => {
52
+ }, We = (e) => e !== null && typeof e == "object" && !Array.isArray(e), oe = (e) => {
53
53
  if (e === null || typeof e != "object")
54
54
  return e;
55
55
  if (e instanceof Date)
@@ -62,29 +62,29 @@ const so = (e, t) => {
62
62
  for (const n in e)
63
63
  Object.prototype.hasOwnProperty.call(e, n) && (t[n] = oe(e[n]));
64
64
  return t;
65
- }, lo = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
66
- function co(e) {
67
- return typeof e == "string" && lo.test(e);
65
+ }, fo = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
66
+ function po(e) {
67
+ return typeof e == "string" && fo.test(e);
68
68
  }
69
- function uo(e) {
70
- if (!co(e))
69
+ function mo(e) {
70
+ if (!po(e))
71
71
  throw TypeError("Invalid UUID");
72
72
  let t;
73
73
  const n = new Uint8Array(16);
74
74
  return n[0] = (t = parseInt(e.slice(0, 8), 16)) >>> 24, n[1] = t >>> 16 & 255, n[2] = t >>> 8 & 255, n[3] = t & 255, n[4] = (t = parseInt(e.slice(9, 13), 16)) >>> 8, n[5] = t & 255, n[6] = (t = parseInt(e.slice(14, 18), 16)) >>> 8, n[7] = t & 255, n[8] = (t = parseInt(e.slice(19, 23), 16)) >>> 8, n[9] = t & 255, n[10] = (t = parseInt(e.slice(24, 36), 16)) / 1099511627776 & 255, n[11] = t / 4294967296 & 255, n[12] = t >>> 24 & 255, n[13] = t >>> 16 & 255, n[14] = t >>> 8 & 255, n[15] = t & 255, n;
75
75
  }
76
- function fo(e) {
76
+ function go(e) {
77
77
  e = unescape(encodeURIComponent(e));
78
78
  const t = [];
79
79
  for (let n = 0; n < e.length; ++n)
80
80
  t.push(e.charCodeAt(n));
81
81
  return t;
82
82
  }
83
- const po = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", mo = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
84
- function go(e, t, n) {
83
+ const yo = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", bo = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
84
+ function Io(e, t, n) {
85
85
  function r(o, i, a, s) {
86
86
  var l;
87
- if (typeof o == "string" && (o = fo(o)), typeof i == "string" && (i = uo(i)), ((l = i) === null || l === void 0 ? void 0 : l.length) !== 16)
87
+ if (typeof o == "string" && (o = go(o)), typeof i == "string" && (i = mo(i)), ((l = i) === null || l === void 0 ? void 0 : l.length) !== 16)
88
88
  throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
89
89
  let c = new Uint8Array(16 + o.length);
90
90
  if (c.set(i), c.set(o, i.length), c = n(c), c[6] = c[6] & 15 | t, c[8] = c[8] & 63 | 128, a) {
@@ -93,15 +93,15 @@ function go(e, t, n) {
93
93
  a[s + d] = c[d];
94
94
  return a;
95
95
  }
96
- return Dn(c);
96
+ return Tn(c);
97
97
  }
98
98
  try {
99
99
  r.name = e;
100
100
  } catch {
101
101
  }
102
- return r.DNS = po, r.URL = mo, r;
102
+ return r.DNS = yo, r.URL = bo, r;
103
103
  }
104
- function yo(e, t, n, r) {
104
+ function Co(e, t, n, r) {
105
105
  switch (e) {
106
106
  case 0:
107
107
  return t & n ^ ~t & r;
@@ -116,7 +116,7 @@ function yo(e, t, n, r) {
116
116
  function Ie(e, t) {
117
117
  return e << t | e >>> 32 - t;
118
118
  }
119
- function bo(e) {
119
+ function ho(e) {
120
120
  const t = [1518500249, 1859775393, 2400959708, 3395469782], n = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
121
121
  if (typeof e == "string") {
122
122
  const a = unescape(encodeURIComponent(e));
@@ -141,15 +141,15 @@ function bo(e) {
141
141
  s[m] = Ie(s[m - 3] ^ s[m - 8] ^ s[m - 14] ^ s[m - 16], 1);
142
142
  let l = n[0], c = n[1], d = n[2], u = n[3], f = n[4];
143
143
  for (let m = 0; m < 80; ++m) {
144
- const y = Math.floor(m / 20), p = Ie(l, 5) + yo(y, c, d, u) + f + t[y] + s[m] >>> 0;
144
+ const y = Math.floor(m / 20), p = Ie(l, 5) + Co(y, c, d, u) + f + t[y] + s[m] >>> 0;
145
145
  f = u, u = d, d = Ie(c, 30) >>> 0, c = l, l = p;
146
146
  }
147
147
  n[0] = n[0] + l >>> 0, n[1] = n[1] + c >>> 0, n[2] = n[2] + d >>> 0, n[3] = n[3] + u >>> 0, n[4] = n[4] + f >>> 0;
148
148
  }
149
149
  return [n[0] >> 24 & 255, n[0] >> 16 & 255, n[0] >> 8 & 255, n[0] & 255, n[1] >> 24 & 255, n[1] >> 16 & 255, n[1] >> 8 & 255, n[1] & 255, n[2] >> 24 & 255, n[2] >> 16 & 255, n[2] >> 8 & 255, n[2] & 255, n[3] >> 24 & 255, n[3] >> 16 & 255, n[3] >> 8 & 255, n[3] & 255, n[4] >> 24 & 255, n[4] >> 16 & 255, n[4] >> 8 & 255, n[4] & 255];
150
150
  }
151
- const Io = go("v5", 80, bo), Je = /\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g, Ye = /\bparam\s*\(\s*(['"])([^'"]+)\1/g;
152
- function ho(e) {
151
+ const vo = Io("v5", 80, ho), Ye = /\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g, Ze = /\bparam\s*\(\s*(['"])([^'"]+)\1/g;
152
+ function Fo(e) {
153
153
  const t = [];
154
154
  let n = 0;
155
155
  for (; n < e.length; ) {
@@ -166,18 +166,18 @@ function ho(e) {
166
166
  }
167
167
  return t;
168
168
  }
169
- function At(e) {
169
+ function Bt(e) {
170
170
  var r, o;
171
171
  if (!e)
172
172
  return [];
173
173
  const t = /* @__PURE__ */ new Set();
174
174
  let n;
175
- for (Je.lastIndex = 0; (n = Je.exec(e)) !== null; ) {
175
+ for (Ye.lastIndex = 0; (n = Ye.exec(e)) !== null; ) {
176
176
  const i = (r = n[1]) == null ? void 0 : r.trim();
177
177
  i && t.add(i);
178
178
  }
179
- for (const i of ho(e))
180
- for (Ye.lastIndex = 0; (n = Ye.exec(i)) !== null; ) {
179
+ for (const i of Fo(e))
180
+ for (Ze.lastIndex = 0; (n = Ze.exec(i)) !== null; ) {
181
181
  const a = (o = n[2]) == null ? void 0 : o.trim();
182
182
  a && t.add(a);
183
183
  }
@@ -187,27 +187,27 @@ function Ae(e) {
187
187
  const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
188
188
  for (const r of e.controlBindings || [])
189
189
  t.add(r.controlId), r.target === "sql_param" && n.set(r.paramId, r.controlId);
190
- for (const r of At(e.sql))
190
+ for (const r of Bt(e.sql))
191
191
  t.add(n.get(r) ?? r);
192
192
  return Array.from(t);
193
193
  }
194
- function Co(e) {
194
+ function Do(e) {
195
195
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
196
196
  for (const r of e.controlBindings || [])
197
197
  r.target === "sql_param" && n.set(r.paramId, r.controlId);
198
- for (const r of At(e.sql))
198
+ for (const r of Bt(e.sql))
199
199
  t.set(r, {
200
200
  paramId: r,
201
201
  controlId: n.get(r) ?? r
202
202
  });
203
203
  return Array.from(t.values());
204
204
  }
205
- function vo(e, t) {
205
+ function So(e, t) {
206
206
  var o;
207
207
  const n = (o = e.controlBindings) == null ? void 0 : o.map((i) => ({
208
208
  ...i,
209
209
  controlId: t.get(i.controlId) ?? i.controlId
210
- })), r = Co(e).flatMap(
210
+ })), r = Do(e).flatMap(
211
211
  ({ paramId: i, controlId: a }) => {
212
212
  var l;
213
213
  const s = t.get(a);
@@ -218,7 +218,7 @@ function vo(e, t) {
218
218
  );
219
219
  return r.length ? [...n ?? [], ...r] : n;
220
220
  }
221
- function Bt(e, t) {
221
+ function Et(e, t) {
222
222
  var a, s;
223
223
  const n = be(e) ?? e, r = n.source === "dashboardInputAlias" ? (a = t.inputAliases) == null ? void 0 : a[n.variableName] : void 0, o = n.source === "dashboardInputAlias" && r ? be(r) ?? be({ ...r, export: n.export ?? "label" }) ?? n : n, i = n.source === "dashboardInputAlias" && o !== n ? { ...o, export: n.export ?? "label" } : o;
224
224
  return i.source === "input" ? {
@@ -226,7 +226,7 @@ function Bt(e, t) {
226
226
  inputId: ((s = t.inputIds) == null ? void 0 : s[i.inputId]) ?? i.inputId
227
227
  } : i;
228
228
  }
229
- function Fo(e, t) {
229
+ function To(e, t) {
230
230
  var o;
231
231
  const n = {};
232
232
  for (const i of [
@@ -243,13 +243,13 @@ function Fo(e, t) {
243
243
  }
244
244
  const r = { ...t.inputAliases };
245
245
  for (const [i, a] of Object.entries((e == null ? void 0 : e.inputAliases) ?? {}))
246
- r[i] = Bt(a, t);
246
+ r[i] = Et(a, t);
247
247
  return Object.keys(r).length && (n.inputAliases = r), n;
248
248
  }
249
- function Za(e, t) {
249
+ function Xa(e, t) {
250
250
  var o, i, a, s;
251
- const n = oe(Vt(e));
252
- n.controlBindings = vo(
251
+ const n = oe(Mt(e));
252
+ n.controlBindings = So(
253
253
  e,
254
254
  new Map(Object.entries(t.controlIds ?? {}))
255
255
  );
@@ -267,9 +267,9 @@ function Za(e, t) {
267
267
  const c = l;
268
268
  if (Object.assign(
269
269
  c,
270
- Mt(
270
+ kt(
271
271
  c,
272
- (f) => f && typeof f == "object" ? Bt(f, t) : f
272
+ (f) => f && typeof f == "object" ? Et(f, t) : f
273
273
  )
274
274
  ), typeof c.entityId == "string") {
275
275
  const f = c.entityId;
@@ -278,72 +278,72 @@ function Za(e, t) {
278
278
  for (const [f, m] of Object.entries(c))
279
279
  f !== "linkedReferenceOverrides" && r(m);
280
280
  };
281
- r(n), n.clickToFilter && (n.clickToFilter = Sn(n.clickToFilter, t));
281
+ r(n), n.clickToFilter && (n.clickToFilter = Vn(n.clickToFilter, t));
282
282
  for (const l of Object.values(
283
283
  ((a = n.customCardPreferences) == null ? void 0 : a.dataInputCardIds) ?? {}
284
284
  ))
285
285
  l.cardId = ((s = t.cardIds) == null ? void 0 : s[l.cardId]) ?? l.cardId;
286
286
  return n;
287
287
  }
288
- const Do = "9677efdd-86ec-4afb-b9bb-5ead8b5442af";
289
- function So(e) {
288
+ const Vo = "9677efdd-86ec-4afb-b9bb-5ead8b5442af";
289
+ function Mo(e) {
290
290
  let t = 0;
291
- return () => Io(`${e}#${t++}`, Do);
291
+ return () => vo(`${e}#${t++}`, Vo);
292
292
  }
293
- const To = [
293
+ const ko = [
294
294
  { code: "matrix_definition_incomplete", label: "Matrix definition" }
295
- ], Vo = [
295
+ ], xo = [
296
296
  { code: "connection_type_unresolved", label: "Connection type" }
297
297
  ], G = (e) => !Array.isArray(e) || e.length === 0;
298
- function Mo(e) {
298
+ function Po(e) {
299
299
  var i;
300
300
  const t = e.config ?? {};
301
301
  if ((i = e.sql) != null && i.trim() || !G(t.pivotByColumns)) return "matrixTable";
302
302
  const n = !G(t.groupByColumns), r = !G(t.metricColumns), o = e.type === "pivotTable" && (n || r) && G(t.rowAggregates) && G(t.columnAggregates);
303
303
  return n && !r || o ? "table" : "matrixTable";
304
304
  }
305
- function ko(e) {
305
+ function wo(e) {
306
306
  var o;
307
307
  const t = e.dataSource;
308
308
  if (!t || (o = t.connectionType) != null && o.trim()) return e;
309
- const n = Or(xn(t.selectedEntities));
309
+ const n = Br(wn(t.selectedEntities));
310
310
  if (!n) return e;
311
311
  const r = Array.isArray(t.selectedEntities) ? t.selectedEntities.map((i) => i && typeof i == "object" && "connectionType" in i && !String(i.connectionType ?? "").trim() ? { ...i, connectionType: n } : i) : t.selectedEntities;
312
312
  return { ...e, dataSource: { ...t, connectionType: n, selectedEntities: r } };
313
313
  }
314
- function Et(e) {
314
+ function Rt(e) {
315
315
  var a, s;
316
316
  const t = e;
317
- if (!Tn(t)) return { status: "not_legacy", card: e };
318
- const n = ko(t), r = Mo(t) === "table" ? Vn(n, "table") : Mn(n, "matrixTable", { createId: So(t.id) });
317
+ if (!Mn(t)) return { status: "not_legacy", card: e };
318
+ const n = wo(t), r = Po(t) === "table" ? kn(n, "table") : xn(n, "matrixTable", { createId: Mo(t.id) });
319
319
  if (r.status !== "changed") throw new Error(`Card ${t.id} could not leave ${t.type}.`);
320
- const o = r.card.type === "matrixTable" && kn(r.card).status !== "ready", i = !!n.dataSource && !((s = (a = n.dataSource) == null ? void 0 : a.connectionType) != null && s.trim());
320
+ const o = r.card.type === "matrixTable" && Pn(r.card).status !== "ready", i = !!n.dataSource && !((s = (a = n.dataSource) == null ? void 0 : a.connectionType) != null && s.trim());
321
321
  return {
322
322
  status: "routed",
323
323
  card: r.card,
324
324
  gaps: [
325
325
  ...r.gaps,
326
- ...o ? To : [],
327
- ...i ? Vo : []
326
+ ...o ? ko : [],
327
+ ...i ? xo : []
328
328
  ]
329
329
  };
330
330
  }
331
- function Ja(e) {
331
+ function es(e) {
332
332
  if (!e.cards) return e;
333
- const t = e.cards.map((n) => Et(n).card);
333
+ const t = e.cards.map((n) => Rt(n).card);
334
334
  return t.every((n, r) => n === e.cards[r]) ? e : { ...e, cards: t };
335
335
  }
336
- function xo(e) {
336
+ function Oo(e) {
337
337
  const t = [];
338
- return { dashboard: Ur(e, (r, o) => {
339
- const i = Et(r);
338
+ return { dashboard: Jr(e, (r, o) => {
339
+ const i = Rt(r);
340
340
  return i.status === "routed" && i.gaps.length && t.push({ location: o, gaps: i.gaps }), i.card;
341
341
  }), routedWithGaps: t };
342
342
  }
343
- function Po(e, t) {
343
+ function _o(e, t) {
344
344
  return e.name === t.name && e.qualifiedEntityName === t.qualifiedEntityName;
345
345
  }
346
- function wo(e, t, n) {
346
+ function Ao(e, t, n) {
347
347
  var o, i;
348
348
  if (n.sortPolicy === "dropUnrelatedSorts") {
349
349
  const a = new Set(
@@ -362,7 +362,7 @@ function wo(e, t, n) {
362
362
  ...e,
363
363
  groupByColumns: [t],
364
364
  sortByColumns: (i = e.sortByColumns) == null ? void 0 : i.map(
365
- (a) => r && Po(a, r) ? {
365
+ (a) => r && _o(a, r) ? {
366
366
  ...t,
367
367
  role: "sortby",
368
368
  direction: a.direction
@@ -391,17 +391,17 @@ function ae(e) {
391
391
  } = e;
392
392
  return Q(o);
393
393
  }
394
- function Rt(e, t) {
394
+ function qt(e, t) {
395
395
  return e == null ? void 0 : e.map(
396
396
  (n) => dt(Q(ie([n])[0]), n.format, t)
397
397
  );
398
398
  }
399
- function Oo(e, t) {
399
+ function Bo(e, t) {
400
400
  return e == null ? void 0 : e.map(
401
- (n) => Pn(Q(ie([n])[0]), n.format, t)
401
+ (n) => On(Q(ie([n])[0]), n.format, t)
402
402
  );
403
403
  }
404
- function _o(e, t) {
404
+ function Eo(e, t) {
405
405
  const { dateFormat: n, customFormat: r, ...o } = ae(e.field);
406
406
  return {
407
407
  ...e,
@@ -412,7 +412,7 @@ function me(e, t = !1) {
412
412
  if (e)
413
413
  return {
414
414
  ...e,
415
- conditions: e.conditions.map((n) => _o(n, t)),
415
+ conditions: e.conditions.map((n) => Eo(n, t)),
416
416
  groups: e.groups.map((n) => me(n, t))
417
417
  };
418
418
  }
@@ -429,71 +429,71 @@ function Q(e) {
429
429
  filters: me(t.parameters.filters)
430
430
  }), t;
431
431
  }
432
- function Ao(e, t) {
433
- return t.cardType === "detailTable" || !wn(t.cardType) || t.temporalResultOwner !== "config" ? Rt(e, "grouped") : e == null ? void 0 : e.map((n) => {
434
- const r = On(n), o = ae(r ?? n);
432
+ function Ro(e, t) {
433
+ return t.cardType === "detailTable" || !_n(t.cardType) || t.temporalResultOwner !== "config" ? qt(e, "grouped") : e == null ? void 0 : e.map((n) => {
434
+ const r = An(n), o = ae(r ?? n);
435
435
  if (!r)
436
436
  return o;
437
437
  const { dateFormat: i, customFormat: a, ...s } = o;
438
438
  return s;
439
439
  });
440
440
  }
441
- function qt(e, t) {
441
+ function jt(e, t) {
442
442
  if (!e)
443
443
  return;
444
444
  const n = { type: t.cardType, config: e };
445
- return Te(n) ? Bo(n, t) : e.matrix === void 0 ? {} : { matrix: e.matrix };
445
+ return Te(n) ? qo(n, t) : e.matrix === void 0 ? {} : { matrix: e.matrix };
446
446
  }
447
- function Bo(e, t = {}) {
447
+ function qo(e, t = {}) {
448
448
  var i, a, s;
449
449
  const n = e.config;
450
450
  if (!n) return;
451
451
  const r = { ...t, cardType: e.type };
452
452
  return {
453
453
  ...n,
454
- groupByColumns: Ao(n.groupByColumns, r),
454
+ groupByColumns: Ro(n.groupByColumns, r),
455
455
  metricColumns: (i = ie(n.metricColumns)) == null ? void 0 : i.map(
456
456
  Q
457
457
  ),
458
- pivotByColumns: Rt(n.pivotByColumns, "grouped"),
458
+ pivotByColumns: qt(n.pivotByColumns, "grouped"),
459
459
  sortByColumns: (a = ie(n.sortByColumns)) == null ? void 0 : a.map(
460
460
  Q
461
461
  ),
462
- detailColumns: Oo(n.detailColumns, (s = r.dataSource) == null ? void 0 : s.connectionType),
462
+ detailColumns: Bo(n.detailColumns, (s = r.dataSource) == null ? void 0 : s.connectionType),
463
463
  filters: me(n.filters)
464
464
  };
465
465
  }
466
466
  function se(e) {
467
467
  return (e == null ? void 0 : e.type) === "number" || (e == null ? void 0 : e.type) === "currency";
468
468
  }
469
- function Eo(e) {
469
+ function jo(e) {
470
470
  return (e == null ? void 0 : e.type) === "number";
471
471
  }
472
- function Ro(e) {
472
+ function No(e) {
473
473
  var n;
474
- if (!Eo(e))
474
+ if (!jo(e))
475
475
  return !1;
476
476
  const t = (n = e == null ? void 0 : e.numberFormat) == null ? void 0 : n.style;
477
477
  return t === void 0 || t === "decimal" || t === "currency";
478
478
  }
479
- function qo(e, t) {
479
+ function zo(e, t) {
480
480
  const n = t == null ? void 0 : t.type;
481
481
  if (n && n !== "none" && n !== "number")
482
482
  return { currencyBindable: !1 };
483
- const r = n === "number" ? t != null && t.numberFormat ? An(t.numberFormat, {
483
+ const r = n === "number" ? t != null && t.numberFormat ? En(t.numberFormat, {
484
484
  preserveOmittedProperties: !0
485
485
  }) : { type: "number" } : void 0, o = re(e.format, {
486
486
  preserveOmittedProperties: !0
487
- }), i = W(e.dataType) === "number" ? { type: "number" } : void 0, s = (t == null ? void 0 : t.inheritMetricFormat) === !1 || !!(t != null && t.numberFormat) && (t == null ? void 0 : t.inheritMetricFormat) !== !0 ? r : o || i || r;
487
+ }), i = J(e.dataType) === "number" ? { type: "number" } : void 0, s = (t == null ? void 0 : t.inheritMetricFormat) === !1 || !!(t != null && t.numberFormat) && (t == null ? void 0 : t.inheritMetricFormat) !== !0 ? r : o || i || r;
488
488
  return {
489
489
  authoredFormat: s,
490
490
  currencyBindable: se(s)
491
491
  };
492
492
  }
493
- function No(e, t) {
493
+ function Lo(e, t) {
494
494
  const n = re(t.format, {
495
495
  preserveOmittedProperties: !0
496
- }), r = W(t.dataType) === "number" ? { type: "number" } : void 0, o = n || r;
496
+ }), r = J(t.dataType) === "number" ? { type: "number" } : void 0, o = n || r;
497
497
  return {
498
498
  authoredFormat: o,
499
499
  source: n ? "semantic" : r ? "inferred" : void 0,
@@ -502,13 +502,13 @@ function No(e, t) {
502
502
  }
503
503
  function Fe(e, t = {}) {
504
504
  var l, c, d;
505
- const n = t.column ?? ((l = _n(e)) == null ? void 0 : l.value);
505
+ const n = t.column ?? ((l = Bn(e)) == null ? void 0 : l.value);
506
506
  if ((n == null ? void 0 : n.kind) === "sqlKpiValue") {
507
507
  const u = t.resultColumnKey ? {
508
508
  kind: "column",
509
509
  columnKey: t.resultColumnKey
510
510
  } : void 0, f = re(
511
- Lr({ card: e, column: { kind: "sqlKpiValue" }, surface: "kpiValue" }).format,
511
+ Hr({ card: e, column: { kind: "sqlKpiValue" }, surface: "kpiValue" }).format,
512
512
  { preserveOmittedProperties: !0 }
513
513
  );
514
514
  return {
@@ -523,7 +523,7 @@ function Fe(e, t = {}) {
523
523
  metricId: r.id
524
524
  } : void 0, i = re(r == null ? void 0 : r.format, {
525
525
  preserveOmittedProperties: !0
526
- }), a = W(r == null ? void 0 : r.dataType) === "number" ? { type: "number" } : void 0, s = i || a;
526
+ }), a = J(r == null ? void 0 : r.dataType) === "number" ? { type: "number" } : void 0, s = i || a;
527
527
  return {
528
528
  target: o,
529
529
  authoredFormat: s,
@@ -536,41 +536,41 @@ function Nt(e, t, n) {
536
536
  const r = n(e, t);
537
537
  return ((o = e.derivedField) == null ? void 0 : o.format) ?? (r == null ? void 0 : r.format) ?? (r == null ? void 0 : r.resolvedField.format);
538
538
  }
539
- function jt(e, t, n) {
539
+ function zt(e, t, n) {
540
540
  return e.kind === "calculated" ? e.definition.format : Nt(e.field, t, n);
541
541
  }
542
- function Ya(e, t) {
542
+ function ts(e, t) {
543
543
  const n = ft(t), r = (o, i) => Object.fromEntries(o.flatMap((a) => {
544
544
  const s = i(a);
545
545
  return s ? [[a.id, s]] : [];
546
546
  }));
547
547
  return {
548
- measureFormats: r(e.measures, (o) => jt(o, e.source, n)),
548
+ measureFormats: r(e.measures, (o) => zt(o, e.source, n)),
549
549
  levelFormats: r([...e.rows, ...e.columns], (o) => Nt(o.field, e.source, n))
550
550
  };
551
551
  }
552
- function zt(e, t = []) {
552
+ function Lt(e, t = []) {
553
553
  const n = Ve(e);
554
554
  if (n.status !== "ready") return [];
555
555
  const { spec: r, presentation: o } = n.config, i = ft(t);
556
556
  return r.measures.map((a) => {
557
557
  var m;
558
- const s = a.kind === "aggregate" ? i(a.field, r.source) : void 0, l = Kr(o.measureFormats[a.id], jt(a, r.source, i)), c = a.kind === "calculated" ? a.definition.dataType : ["MIN", "MAX"].includes(a.aggregate) ? ((m = a.field.derivedField) == null ? void 0 : m.dataType) ?? (s == null ? void 0 : s.resolvedField.dataType) ?? a.field.dataType : "number", d = W(c) === "number", u = a.kind === "calculated" || !!(s || a.field.derivedField || a.field.name === "*"), f = l && Gr(l) ? l : !l && d && u ? { type: "number" } : void 0;
559
- return { measureId: a.id, label: Hr(a, o), canonical: f };
558
+ const s = a.kind === "aggregate" ? i(a.field, r.source) : void 0, l = Ur(o.measureFormats[a.id], zt(a, r.source, i)), c = a.kind === "calculated" ? a.definition.dataType : ["MIN", "MAX"].includes(a.aggregate) ? ((m = a.field.derivedField) == null ? void 0 : m.dataType) ?? (s == null ? void 0 : s.resolvedField.dataType) ?? a.field.dataType : "number", d = J(c) === "number", u = a.kind === "calculated" || !!(s || a.field.derivedField || a.field.name === "*"), f = l && Qr(l) ? l : !l && d && u ? { type: "number" } : void 0;
559
+ return { measureId: a.id, label: $r(a, o), canonical: f };
560
560
  });
561
561
  }
562
- function jo(e) {
562
+ function Ko(e) {
563
563
  var t, n;
564
564
  return e.type === "detailTable" ? ((t = e.config) == null ? void 0 : t.detailColumns) || [] : ((n = e.config) == null ? void 0 : n.metricColumns) || [];
565
565
  }
566
- function Lt(e) {
566
+ function Kt(e) {
567
567
  return new Set(
568
- kt(e).flatMap(
568
+ xt(e).flatMap(
569
569
  (t) => (t.controlBindings || []).filter(de).map((n) => n.controlId)
570
570
  )
571
571
  );
572
572
  }
573
- function zo(e, t) {
573
+ function Go(e, t) {
574
574
  const n = [
575
575
  t.id,
576
576
  t.alias,
@@ -598,13 +598,13 @@ function Xe(e) {
598
598
  ).values()
599
599
  ];
600
600
  }
601
- function Lo(e, t = [], n) {
601
+ function Ho(e, t = [], n) {
602
602
  var S;
603
- const r = !!((S = e.sql) != null && S.trim()), o = ut(e.type), i = r && o && e.type !== "kpi" && e.type !== "matrixTable", a = jo(e), s = Bn(e), l = !r && e.type === "kpi" ? a.map(
603
+ const r = !!((S = e.sql) != null && S.trim()), o = ut(e.type), i = r && o && e.type !== "kpi" && e.type !== "matrixTable", a = Ko(e), s = Rn(e), l = !r && e.type === "kpi" ? a.map(
604
604
  (g) => Fe(e, {
605
605
  column: { kind: "field", fieldId: g.id }
606
606
  })
607
- ) : [], c = !r && e.type === "matrixTable" ? zt(e, n) : [], d = (r ? [] : a).map(
607
+ ) : [], c = !r && e.type === "matrixTable" ? Lt(e, n) : [], d = (r ? [] : a).map(
608
608
  (g) => ({
609
609
  kind: "metric",
610
610
  metricId: g.id
@@ -625,10 +625,10 @@ function Lo(e, t = [], n) {
625
625
  ), m = e.type === "matrixTable" ? [] : e.type === "kpi" ? l.filter((g) => g.currencyBindable).flatMap(
626
626
  (g) => g.target ? [g.target] : []
627
627
  ) : (r || !o ? [] : a).filter(
628
- (g) => (En(e.type) ? qo(
628
+ (g) => (qn(e.type) ? zo(
629
629
  g,
630
- zo(s, g)
631
- ) : No(e, g)).currencyBindable
630
+ Go(s, g)
631
+ ) : Lo(e, g)).currencyBindable
632
632
  ).map(
633
633
  (g) => ({
634
634
  kind: "metric",
@@ -640,7 +640,7 @@ function Lo(e, t = [], n) {
640
640
  columnKey: g
641
641
  })
642
642
  ), b = (i ? y : []).filter(
643
- (g) => Ro(
643
+ (g) => No(
644
644
  s[g]
645
645
  )
646
646
  ).map(
@@ -653,9 +653,9 @@ function Lo(e, t = [], n) {
653
653
  kind: "column",
654
654
  columnKey: g
655
655
  })
656
- ), h = r && e.type === "kpi" ? Fe(e, {
656
+ ), C = r && e.type === "kpi" ? Fe(e, {
657
657
  resultColumnKey: y[0]
658
- }) : void 0, C = o && (h != null && h.currencyBindable) ? I : [];
658
+ }) : void 0, h = o && (C != null && C.currencyBindable) ? I : [];
659
659
  return {
660
660
  knownTargets: Xe([
661
661
  ...e.type === "matrixTable" ? u : d,
@@ -666,24 +666,24 @@ function Lo(e, t = [], n) {
666
666
  ...m,
667
667
  ...f,
668
668
  ...b,
669
- ...C
669
+ ...h
670
670
  ])
671
671
  };
672
672
  }
673
- function Xa(e, t) {
673
+ function ns(e, t) {
674
674
  const n = Fe(e, {
675
675
  resultColumnKey: t
676
676
  });
677
677
  return n.currencyBindable ? n.target : void 0;
678
678
  }
679
- function es(e) {
679
+ function rs(e) {
680
680
  var t;
681
681
  return (t = e.card.sql) != null && t.trim() ? { kind: "column", columnKey: e.columnKey } : e.metricId ? { kind: "metric", metricId: e.metricId } : void 0;
682
682
  }
683
683
  function z(e) {
684
684
  return e.kind === "metric" ? `metric:${e.metricId}` : e.kind === "column" ? `column:${e.columnKey}` : `matrix_measure:${e.measureId}`;
685
685
  }
686
- function Ko(e) {
686
+ function Uo(e) {
687
687
  if (!e || typeof e != "object" || Array.isArray(e))
688
688
  return;
689
689
  const t = e;
@@ -695,10 +695,10 @@ function Ko(e) {
695
695
  return { kind: "matrix_measure", measureId: t.measureId };
696
696
  }
697
697
  function et(e) {
698
- const t = Tt(e);
698
+ const t = Vt(e);
699
699
  return typeof e == "string" && e === t ? t : void 0;
700
700
  }
701
- function Kt(e) {
701
+ function Gt(e) {
702
702
  if (e.type !== "enum" || e.source.kind !== "manual")
703
703
  return { diagnostic: "invalid_control_type" };
704
704
  const t = e.source.options.map(
@@ -716,11 +716,11 @@ function Kt(e) {
716
716
  currencies: t
717
717
  };
718
718
  }
719
- function ts(e) {
720
- return "control" in Kt(e);
719
+ function os(e) {
720
+ return "control" in Gt(e);
721
721
  }
722
- function Gt(e) {
723
- const t = Lt(e.dashboard);
722
+ function Ht(e) {
723
+ const t = Kt(e.dashboard);
724
724
  if (t.size === 0)
725
725
  return {
726
726
  definitions: e.definitions || [],
@@ -742,8 +742,8 @@ function Gt(e) {
742
742
  )
743
743
  };
744
744
  }
745
- function ns(e) {
746
- return Gt({
745
+ function is(e) {
746
+ return Ht({
747
747
  ...e,
748
748
  referencedControlIds: new Set(
749
749
  Ae({
@@ -753,9 +753,9 @@ function ns(e) {
753
753
  )
754
754
  });
755
755
  }
756
- function rs(e) {
756
+ function as(e) {
757
757
  var t;
758
- return Gt({
758
+ return Ht({
759
759
  ...e,
760
760
  referencedControlIds: new Set(
761
761
  Ae({
@@ -765,7 +765,7 @@ function rs(e) {
765
765
  )
766
766
  });
767
767
  }
768
- function Ht(e) {
768
+ function Ut(e) {
769
769
  return {
770
770
  knownKeys: new Set(
771
771
  e.knownTargets.map(z)
@@ -778,13 +778,13 @@ function Ht(e) {
778
778
  )
779
779
  };
780
780
  }
781
- function Ut(e, t) {
781
+ function Qt(e, t) {
782
782
  if (!e || typeof e != "object" || e.target !== "presentation_currency")
783
783
  return {};
784
784
  const n = e, r = typeof n.controlId == "string" && n.controlId.trim() ? n.controlId : void 0;
785
785
  if (!r)
786
786
  return { diagnostic: { code: "invalid_binding_shape" } };
787
- const o = Ko(
787
+ const o = Uo(
788
788
  n.presentationTarget
789
789
  );
790
790
  if (!o)
@@ -805,7 +805,7 @@ function Ut(e, t) {
805
805
  return {
806
806
  diagnostic: { code: "missing_control", controlId: r }
807
807
  };
808
- const s = Kt(a);
808
+ const s = Gt(a);
809
809
  return "diagnostic" in s ? {
810
810
  diagnostic: { code: s.diagnostic, controlId: r }
811
811
  } : {
@@ -817,18 +817,18 @@ function Ut(e, t) {
817
817
  }
818
818
  };
819
819
  }
820
- function os(e) {
821
- const t = Ht(e);
820
+ function ss(e) {
821
+ const t = Ut(e);
822
822
  return (e.bindings || []).flatMap((n) => {
823
- const r = Ut(n, t);
823
+ const r = Qt(n, t);
824
824
  return "diagnostic" in r ? [r.diagnostic] : [];
825
825
  });
826
826
  }
827
- function Go(e) {
827
+ function Qo(e) {
828
828
  var o;
829
- const t = [], n = z(e.target), r = Ht(e);
829
+ const t = [], n = z(e.target), r = Ut(e);
830
830
  for (const i of e.bindings || []) {
831
- const a = Ut(i, r);
831
+ const a = Qt(i, r);
832
832
  if ("diagnostic" in a) {
833
833
  t.push(a.diagnostic);
834
834
  continue;
@@ -837,7 +837,7 @@ function Go(e) {
837
837
  if (!s || z(
838
838
  s.presentationTarget
839
839
  ) !== n) continue;
840
- const c = Tt(
840
+ const c = Vt(
841
841
  (o = e.values) == null ? void 0 : o[s.control.id]
842
842
  );
843
843
  if (!(!c || !s.currencies.includes(c)))
@@ -845,10 +845,10 @@ function Go(e) {
845
845
  }
846
846
  return { diagnostics: t };
847
847
  }
848
- function Ho(e, t, n, r) {
849
- const o = { ...e, config: { ...e.config, matrix: t } }, i = Lo(o, [], r), a = zt(o, r), s = { ...t.presentation.measureFormats };
848
+ function $o(e, t, n, r) {
849
+ const o = { ...e, config: { ...e.config, matrix: t } }, i = Ho(o, [], r), a = Lt(o, r), s = { ...t.presentation.measureFormats };
850
850
  for (const l of a) {
851
- const c = { kind: "matrix_measure", measureId: l.measureId }, { currency: d } = Go({
851
+ const c = { kind: "matrix_measure", measureId: l.measureId }, { currency: d } = Qo({
852
852
  ...n,
853
853
  ...i,
854
854
  bindings: e.controlBindings,
@@ -860,7 +860,7 @@ function Ho(e, t, n, r) {
860
860
  }
861
861
  return { ...t.presentation, measureFormats: s };
862
862
  }
863
- function Uo(e, t) {
863
+ function Jo(e, t) {
864
864
  if (!e || typeof e != "object" || !("kind" in e))
865
865
  return e;
866
866
  switch (e.kind) {
@@ -905,12 +905,12 @@ function Uo(e, t) {
905
905
  return e;
906
906
  }
907
907
  }
908
- function Qo(e, t) {
908
+ function Wo(e, t) {
909
909
  return {
910
910
  id: e.id,
911
911
  scope: e.scope,
912
912
  type: e.type,
913
- source: Uo(e.source, t),
913
+ source: Jo(e.source, t),
914
914
  initialValueStrategy: e.initialValueStrategy,
915
915
  defaultValue: e.defaultValue,
916
916
  requiredAtExecution: e.requiredAtExecution,
@@ -925,7 +925,7 @@ function Qo(e, t) {
925
925
  } : {}
926
926
  };
927
927
  }
928
- function $o(e, t) {
928
+ function Yo(e, t) {
929
929
  return e.target === "sql_param" || e.target === "presentation_currency" ? e : e.target === "config_field_selector" && !(t != null && t.includePresentation) ? {
930
930
  ...e,
931
931
  mapping: Object.fromEntries(
@@ -950,29 +950,29 @@ function $o(e, t) {
950
950
  };
951
951
  }
952
952
  function tt(e = [], t) {
953
- return [...e].map((n) => Qo(n, t)).sort(
953
+ return [...e].map((n) => Wo(n, t)).sort(
954
954
  (n, r) => n.id.localeCompare(r.id) || n.scope.localeCompare(r.scope) || n.type.localeCompare(r.type)
955
955
  );
956
956
  }
957
- function Wo(e = [], t) {
957
+ function Zo(e = [], t) {
958
958
  return e.filter(
959
959
  (n) => (t == null ? void 0 : t.includePresentation) || !de(n)
960
- ).map((n) => $o(n, t)).sort(
960
+ ).map((n) => Yo(n, t)).sort(
961
961
  (n, r) => _(n).localeCompare(_(r))
962
962
  );
963
963
  }
964
- function Zo(e, t) {
964
+ function Xo(e, t) {
965
965
  return e ? _({
966
966
  controlDefinitions: tt(e.controlDefinitions, t),
967
967
  cardControlDefinitions: tt(
968
968
  e.cardControlDefinitions,
969
969
  t
970
970
  ),
971
- controlBindings: Wo(e.controlBindings, t)
971
+ controlBindings: Zo(e.controlBindings, t)
972
972
  }) : "__none__";
973
973
  }
974
- const Jo = ["table", "detailTable"], nt = (e) => Jo.includes(e.type), Yo = "calendar-context";
975
- function Xo(e) {
974
+ const ei = ["table", "detailTable"], nt = (e) => ei.includes(e.type), ti = "calendar-context";
975
+ function ni(e) {
976
976
  const { id: t, label: n, field: r, ...o } = e;
977
977
  return {
978
978
  ...o,
@@ -987,7 +987,7 @@ function ge(e) {
987
987
  const { id: t, conditions: n, groups: r, ...o } = e;
988
988
  return {
989
989
  ...o,
990
- conditions: n.map(Xo),
990
+ conditions: n.map(ni),
991
991
  groups: r.map((i) => ge(i))
992
992
  };
993
993
  }
@@ -1014,7 +1014,7 @@ function Be(e) {
1014
1014
  } : {}
1015
1015
  };
1016
1016
  }
1017
- function ei(e) {
1017
+ function ri(e) {
1018
1018
  const t = (n) => n == null ? void 0 : n.map(Be);
1019
1019
  return {
1020
1020
  ...e,
@@ -1026,23 +1026,23 @@ function ei(e) {
1026
1026
  filters: e.filters ? ge(e.filters) : void 0
1027
1027
  };
1028
1028
  }
1029
- function ti(e, t, n) {
1029
+ function oi(e, t, n) {
1030
1030
  if (!e)
1031
1031
  return JSON.stringify(e);
1032
- if (n === "matrixTable" && e.matrix) return _(Xr(e.matrix.spec));
1033
- const { matrix: r, ...o } = e, i = t ? ei(o) : o;
1032
+ if (n === "matrixTable" && e.matrix) return _(no(e.matrix.spec));
1033
+ const { matrix: r, ...o } = e, i = t ? ri(o) : o;
1034
1034
  return JSON.stringify({
1035
1035
  ...i,
1036
1036
  filters: ge(i.filters)
1037
1037
  });
1038
1038
  }
1039
- function ni(e) {
1039
+ function ii(e) {
1040
1040
  if (!e)
1041
1041
  return null;
1042
1042
  const { format: t, ...n } = e;
1043
1043
  return n;
1044
1044
  }
1045
- function ri(e, t) {
1045
+ function ai(e, t) {
1046
1046
  const n = /* @__PURE__ */ new Map();
1047
1047
  for (const o of (t == null ? void 0 : t.controlDefinitions) || [])
1048
1048
  n.set(o.id, o.type);
@@ -1058,7 +1058,7 @@ function ri(e, t) {
1058
1058
  );
1059
1059
  return _(r);
1060
1060
  }
1061
- function oi(e, {
1061
+ function si(e, {
1062
1062
  finalFiltersKey: t,
1063
1063
  cardFilterValues: n,
1064
1064
  controlValues: r,
@@ -1071,13 +1071,13 @@ function oi(e, {
1071
1071
  calendarContext: d
1072
1072
  }) {
1073
1073
  const { filterColumns: u, ...f } = e.queryConfig || {}, m = u == null ? void 0 : u.filter(
1074
- (C) => {
1074
+ (h) => {
1075
1075
  var S, g;
1076
- return (g = (S = e.queryConfig) == null ? void 0 : S.filters) == null ? void 0 : g.some((V) => V.filterColumnName === C.name);
1076
+ return (g = (S = e.queryConfig) == null ? void 0 : S.filters) == null ? void 0 : g.some((V) => V.filterColumnName === h.name);
1077
1077
  }
1078
1078
  ), y = (e == null ? void 0 : e.sql) || "", p = Me((e == null ? void 0 : e.python) || ""), b = ["table", "detailTable", "matrixTable"].includes(
1079
1079
  e.type
1080
- ) ? "table" : e.type === "kpi" ? "kpi" : "chart", I = s || qt(e.config, { cardType: e.type, dataSource: e.dataSource }), h = Rn.includes(
1080
+ ) ? "table" : e.type === "kpi" ? "kpi" : "chart", I = s || jt(e.config, { cardType: e.type, dataSource: e.dataSource }), C = jn.includes(
1081
1081
  e.type
1082
1082
  );
1083
1083
  return [
@@ -1087,34 +1087,34 @@ function oi(e, {
1087
1087
  y,
1088
1088
  p,
1089
1089
  JSON.stringify(n),
1090
- ri(r, {
1090
+ ai(r, {
1091
1091
  controlDefinitions: o,
1092
1092
  cardControlDefinitions: i
1093
1093
  }),
1094
- Zo({
1094
+ Xo({
1095
1095
  controlDefinitions: o,
1096
1096
  cardControlDefinitions: i,
1097
1097
  controlBindings: a
1098
1098
  }),
1099
1099
  _(
1100
- ni(l)
1100
+ ii(l)
1101
1101
  ),
1102
1102
  _(c ?? null),
1103
- Yo,
1103
+ ti,
1104
1104
  _(d),
1105
1105
  JSON.stringify(f),
1106
1106
  JSON.stringify(m),
1107
- ti(
1107
+ oi(
1108
1108
  I,
1109
- h,
1109
+ C,
1110
1110
  e.type
1111
1111
  ),
1112
1112
  t
1113
1113
  ];
1114
1114
  }
1115
- function ii(e, t, n) {
1115
+ function li(e, t, n) {
1116
1116
  var s, l, c;
1117
- const r = oi(e, t), o = _(r), i = ((s = n == null ? void 0 : n.resolvePaginationConfig) == null ? void 0 : s.call(n, o)) ?? e.paginationConfig, a = nt(e) && ue(e.config) || nt(e) && e.sql && ((c = (l = e.preferences) == null ? void 0 : l.tablePrefs) == null ? void 0 : c.enableDevModePagination);
1117
+ const r = si(e, t), o = _(r), i = ((s = n == null ? void 0 : n.resolvePaginationConfig) == null ? void 0 : s.call(n, o)) ?? e.paginationConfig, a = nt(e) && ue(e.config) || nt(e) && e.sql && ((c = (l = e.preferences) == null ? void 0 : l.tablePrefs) == null ? void 0 : c.enableDevModePagination);
1118
1118
  return {
1119
1119
  queryKey: [
1120
1120
  ...r,
@@ -1124,8 +1124,8 @@ function ii(e, t, n) {
1124
1124
  paginationConfig: i
1125
1125
  };
1126
1126
  }
1127
- function ai(e, t, n, r) {
1128
- return ii(
1127
+ function ci(e, t, n, r) {
1128
+ return li(
1129
1129
  e,
1130
1130
  {
1131
1131
  finalFiltersKey: t.finalFiltersKey,
@@ -1142,32 +1142,32 @@ function ai(e, t, n, r) {
1142
1142
  r
1143
1143
  );
1144
1144
  }
1145
- const si = 500, li = 250;
1145
+ const di = 500, ui = 250;
1146
1146
  function De(e) {
1147
1147
  return e.type === "table" || e.type === "detailTable";
1148
1148
  }
1149
- function ci(e) {
1149
+ function fi(e) {
1150
1150
  var t, n, r;
1151
1151
  return !!((t = e.sql) != null && t.trim() && De(e) && ((r = (n = e.preferences) == null ? void 0 : n.tablePrefs) != null && r.enableDevModePagination));
1152
1152
  }
1153
- function is(e) {
1154
- return e === "export-full-with-cap" ? si : li;
1153
+ function ls(e) {
1154
+ return e === "export-full-with-cap" ? di : ui;
1155
1155
  }
1156
- function di({
1156
+ function pi({
1157
1157
  card: e,
1158
1158
  isTablePrintMode: t,
1159
1159
  isDocumentSectionRuntime: n,
1160
1160
  documentTableDataPolicy: r
1161
1161
  }) {
1162
1162
  var l, c;
1163
- const o = n && r !== void 0 && De(e), i = t && !o, a = ue(e.config) && De(e) && !e.sql, s = o ? ci(e) : !!(e.sql && ((c = (l = e.preferences) == null ? void 0 : l.tablePrefs) != null && c.enableDevModePagination));
1163
+ const o = n && r !== void 0 && De(e), i = t && !o, a = ue(e.config) && De(e) && !e.sql, s = o ? fi(e) : !!(e.sql && ((c = (l = e.preferences) == null ? void 0 : l.tablePrefs) != null && c.enableDevModePagination));
1164
1164
  return !i && (a || s);
1165
1165
  }
1166
- function ui(e) {
1166
+ function mi(e) {
1167
1167
  var t, n, r;
1168
1168
  return ((t = e.paginationConfig) == null ? void 0 : t.pageSize) || ((r = (n = e.preferences) == null ? void 0 : n.tablePrefs) == null ? void 0 : r.pageSize) || 50;
1169
1169
  }
1170
- function as({
1170
+ function cs({
1171
1171
  current: e,
1172
1172
  defaultPageSize: t,
1173
1173
  queryInputIdentity: n
@@ -1180,10 +1180,10 @@ function as({
1180
1180
  pageSize: (e == null ? void 0 : e.pageSize) ?? t
1181
1181
  };
1182
1182
  }
1183
- function ss(e, t, n) {
1183
+ function ds(e, t, n) {
1184
1184
  return (e == null ? void 0 : e.queryInputIdentity) === n && e.page === t.page && e.pageSize === t.pageSize;
1185
1185
  }
1186
- function ls(e, t) {
1186
+ function us(e, t) {
1187
1187
  return !e || !t || e.page === t.page && e.pageSize === t.pageSize ? e : {
1188
1188
  ...e,
1189
1189
  page: t.page,
@@ -1191,20 +1191,20 @@ function ls(e, t) {
1191
1191
  hasPrevPage: t.page > 1
1192
1192
  };
1193
1193
  }
1194
- function fi(e) {
1195
- return { page: 1, pageSize: ui(e) };
1194
+ function gi(e) {
1195
+ return { page: 1, pageSize: mi(e) };
1196
1196
  }
1197
- function pi(e) {
1197
+ function yi(e) {
1198
1198
  var a, s, l, c, d;
1199
- const { card: t } = e, n = di({
1199
+ const { card: t } = e, n = pi({
1200
1200
  card: t,
1201
1201
  isTablePrintMode: ((a = e.display) == null ? void 0 : a.isTablePrintMode) ?? !1,
1202
1202
  isDocumentSectionRuntime: !!e.documentSection,
1203
1203
  documentTableDataPolicy: (s = e.documentSection) == null ? void 0 : s.documentTableDataPolicy
1204
- }), { page: r } = e, o = e.documentSection && !e.documentSection.totalsRow ? void 0 : qn(t, e.finalConfig), i = !!((l = e.display) != null && l.deliveryStrict && e.display.isTablePrintMode && !e.documentSection && no(t.type));
1204
+ }), { page: r } = e, o = e.documentSection && !e.documentSection.totalsRow ? void 0 : Nn(t, e.finalConfig), i = !!((l = e.display) != null && l.deliveryStrict && e.display.isTablePrintMode && !e.documentSection && io(t.type));
1205
1205
  return {
1206
1206
  ...o ? { tableTotalsRequest: o } : {},
1207
- ...i ? { sourceRowProbe: { limit: ro.maxTableRows } } : {},
1207
+ ...i ? { sourceRowProbe: { limit: ao.maxTableRows } } : {},
1208
1208
  ...n ? {
1209
1209
  pagination: {
1210
1210
  page: (r == null ? void 0 : r.page) || 1,
@@ -1213,14 +1213,14 @@ function pi(e) {
1213
1213
  } : {}
1214
1214
  };
1215
1215
  }
1216
- function mi(e, t = {}) {
1216
+ function bi(e, t = {}) {
1217
1217
  var o, i, a;
1218
1218
  const n = ((o = e.connectionId) == null ? void 0 : o.trim()) || void 0;
1219
1219
  if (t.editorDevMode) return n;
1220
1220
  const r = ((a = (i = e.dataSource) == null ? void 0 : i.connectionId) == null ? void 0 : a.trim()) || void 0;
1221
1221
  return e.sql ? n || r : r || n;
1222
1222
  }
1223
- function gi(e, t) {
1223
+ function Ii(e, t) {
1224
1224
  var n;
1225
1225
  return {
1226
1226
  connectionId: t,
@@ -1229,8 +1229,8 @@ function gi(e, t) {
1229
1229
  selectedEntities: []
1230
1230
  };
1231
1231
  }
1232
- function cs(e, t, n = {}) {
1233
- const r = mi(e, n);
1232
+ function fs(e, t, n = {}) {
1233
+ const r = bi(e, n);
1234
1234
  if (!r)
1235
1235
  throw new Error("No connection ID found for card");
1236
1236
  const o = t.cardDataSource || e.dataSource;
@@ -1238,11 +1238,11 @@ function cs(e, t, n = {}) {
1238
1238
  connectionId: r,
1239
1239
  requestPayloadBase: {
1240
1240
  ...t,
1241
- cardDataSource: n.liveDataSource ? o : o || gi(e, r)
1241
+ cardDataSource: n.liveDataSource ? o : o || Ii(e, r)
1242
1242
  }
1243
1243
  };
1244
1244
  }
1245
- const yi = /* @__PURE__ */ new Set([
1245
+ const Ci = /* @__PURE__ */ new Set([
1246
1246
  "day",
1247
1247
  "week",
1248
1248
  "month",
@@ -1252,7 +1252,7 @@ const yi = /* @__PURE__ */ new Set([
1252
1252
  "minute",
1253
1253
  "second"
1254
1254
  ]);
1255
- function bi(e) {
1255
+ function hi(e) {
1256
1256
  let t = e.spec;
1257
1257
  const n = pt(
1258
1258
  e.controlDefinitions || [],
@@ -1269,25 +1269,25 @@ function bi(e) {
1269
1269
  if (l) return l;
1270
1270
  const p = e.catalog, b = /* @__PURE__ */ new Map();
1271
1271
  for (const I of p) {
1272
- const h = b.get(I.id) ?? [];
1273
- b.set(I.id, [...h, I]);
1272
+ const C = b.get(I.id) ?? [];
1273
+ b.set(I.id, [...C, I]);
1274
1274
  }
1275
1275
  return l = { refs: p, byId: b }, l;
1276
1276
  }, d = (p, b) => {
1277
- throw new Gn(p, {
1278
- code: Hn,
1277
+ throw new Un(p, {
1278
+ code: Qn,
1279
1279
  ...b ? { controlId: b } : {}
1280
1280
  });
1281
1281
  }, u = (p, b) => {
1282
- var h;
1282
+ var C;
1283
1283
  if (p.derivedField) return p.derivedField.dataType;
1284
- const I = c().refs.filter((C) => C.field.name === p.name && he(C.field.source ?? e.spec.source, p.source ?? e.spec.source));
1285
- return I.length > 1 ? d("The selected field is ambiguous in the authorized Matrix field catalog.", b) : W(((h = I[0]) == null ? void 0 : h.field.dataType) ?? p.dataType);
1286
- }, f = (p, b) => Nn(p, b.target, (I) => u(I, b.controlId)), m = _r.safeParse(t);
1284
+ const I = c().refs.filter((h) => h.field.name === p.name && Ce(h.field.source ?? e.spec.source, p.source ?? e.spec.source));
1285
+ return I.length > 1 ? d("The selected field is ambiguous in the authorized Matrix field catalog.", b) : J(((C = I[0]) == null ? void 0 : C.field.dataType) ?? p.dataType);
1286
+ }, f = (p, b) => zn(p, b.target, (I) => u(I, b.controlId)), m = Er.safeParse(t);
1287
1287
  if (!m.success) return d(m.error.message);
1288
1288
  t = m.data;
1289
1289
  const y = [...o, ...i].map((p) => {
1290
- const b = mt({ binding: p, definitions: n, controlValues: e.controlValues }), I = !p.matrixTargetId && b !== void 0 && b !== Ce ? f(m.data, p) : [];
1290
+ const b = mt({ binding: p, definitions: n, controlValues: e.controlValues }), I = !p.matrixTargetId && b !== void 0 && b !== he ? f(m.data, p) : [];
1291
1291
  return {
1292
1292
  binding: p,
1293
1293
  selectedValue: b,
@@ -1295,26 +1295,26 @@ function bi(e) {
1295
1295
  };
1296
1296
  });
1297
1297
  for (const { binding: p, targetId: b, selectedValue: I } of y) {
1298
- if (I === void 0 || I === Ce)
1298
+ if (I === void 0 || I === he)
1299
1299
  continue;
1300
- const h = (v) => d(v, p.controlId), C = p.target === "config_metric_selector" || p.target === "config_aggregation", S = f(t, p);
1301
- (!b || !S.some((v) => v.id === b)) && h("Choose a valid Matrix level or measure target for this control.");
1300
+ const C = (v) => d(v, p.controlId), h = p.target === "config_metric_selector" || p.target === "config_aggregation", S = f(t, p);
1301
+ (!b || !S.some((v) => v.id === b)) && C("Choose a valid Matrix level or measure target for this control.");
1302
1302
  const g = `${p.target}:${b}`;
1303
- a.has(g) && h("Multiple controls cannot replace the same Matrix target."), a.add(g);
1303
+ a.has(g) && C("Multiple controls cannot replace the same Matrix target."), a.add(g);
1304
1304
  const V = (v) => {
1305
- const T = (c().byId.get(v.id) ?? []).filter((k) => !v.source || he(v.source, k.field.source ?? e.spec.source));
1306
- if (T.length !== 1) return h(T.length ? "The selected field is ambiguous in the authorized Matrix field catalog." : "The selected field is not in the authorized Matrix field catalog.");
1307
- const M = Br.safeParse(T[0].field);
1308
- return M.success ? M.data : h(M.error.message);
1305
+ const T = (c().byId.get(v.id) ?? []).filter((k) => !v.source || Ce(v.source, k.field.source ?? e.spec.source));
1306
+ if (T.length !== 1) return C(T.length ? "The selected field is ambiguous in the authorized Matrix field catalog." : "The selected field is not in the authorized Matrix field catalog.");
1307
+ const M = qr.safeParse(T[0].field);
1308
+ return M.success ? M.data : C(M.error.message);
1309
1309
  }, P = p.target === "config_metric_selector" || p.target === "config_field_selector" ? p.mapping[I] : void 0, x = P && typeof P == "object" && "kind" in P && P.kind === "matrix_instance" ? P.id : void 0;
1310
- if (C) {
1310
+ if (h) {
1311
1311
  s.set(b, p.controlId);
1312
1312
  const v = x === void 0 ? void 0 : m.data.measures.find(
1313
1313
  (F) => F.id === x && F.kind === "aggregate"
1314
1314
  );
1315
- x !== void 0 && !v && h("The selected Matrix aggregate measure is no longer available.");
1316
- const T = p.target === "config_metric_selector" && !v ? jn({ binding: p, selectedValue: I }) : void 0, M = ((v == null ? void 0 : v.kind) === "aggregate" ? v.aggregate : T == null ? void 0 : T.aggregate) ?? (p.target === "config_aggregation" ? Ge({ binding: p, selectedValue: I }) : void 0), k = M === void 0 ? void 0 : Ar.safeParse(M);
1317
- k && !k.success && h("This aggregation is not supported by Matrix."), t = {
1315
+ x !== void 0 && !v && C("The selected Matrix aggregate measure is no longer available.");
1316
+ const T = p.target === "config_metric_selector" && !v ? Ln({ binding: p, selectedValue: I }) : void 0, M = ((v == null ? void 0 : v.kind) === "aggregate" ? v.aggregate : T == null ? void 0 : T.aggregate) ?? (p.target === "config_aggregation" ? Ge({ binding: p, selectedValue: I }) : void 0), k = M === void 0 ? void 0 : Rr.safeParse(M);
1317
+ k && !k.success && C("This aggregation is not supported by Matrix."), t = {
1318
1318
  ...t,
1319
1319
  measures: t.measures.map(
1320
1320
  (F) => F.id !== b || F.kind !== "aggregate" ? F : {
@@ -1329,13 +1329,13 @@ function bi(e) {
1329
1329
  const v = x === void 0 ? void 0 : [...m.data.rows, ...m.data.columns].find(
1330
1330
  (F) => F.id === x
1331
1331
  );
1332
- x !== void 0 && !v && h("The selected Matrix level is no longer available.");
1333
- const T = p.target === "config_field_selector" && !v ? zn({ binding: p, selectedValue: I }) : void 0, M = p.target === "config_grain" ? Ge({ binding: p, selectedValue: I }) : v ? v.grain : T == null ? void 0 : T.granularity;
1334
- M !== void 0 && !yi.has(M) && h("This time grain is not supported by Matrix.");
1332
+ x !== void 0 && !v && C("The selected Matrix level is no longer available.");
1333
+ const T = p.target === "config_field_selector" && !v ? Kn({ binding: p, selectedValue: I }) : void 0, M = p.target === "config_grain" ? Ge({ binding: p, selectedValue: I }) : v ? v.grain : T == null ? void 0 : T.granularity;
1334
+ M !== void 0 && !Ci.has(M) && C("This time grain is not supported by Matrix.");
1335
1335
  const k = (F) => F.map((D) => {
1336
1336
  if (D.id !== b) return D;
1337
1337
  const w = (v == null ? void 0 : v.field) ?? (T ? V(T) : D.field), E = u(w, p.controlId), R = M ?? (T && ne(E) ? D.grain : void 0);
1338
- return R && !ne(E) && h("A time grain requires a temporal Matrix level."), { ...D, field: w, grain: R };
1338
+ return R && !ne(E) && C("A time grain requires a temporal Matrix level."), { ...D, field: w, grain: R };
1339
1339
  });
1340
1340
  t = {
1341
1341
  ...t,
@@ -1345,22 +1345,22 @@ function bi(e) {
1345
1345
  }
1346
1346
  }
1347
1347
  for (const [p, b] of Array.from(s)) {
1348
- const I = t.measures.find((C) => C.id === p);
1348
+ const I = t.measures.find((h) => h.id === p);
1349
1349
  if (!I || I.kind !== "aggregate") continue;
1350
- const h = u(I.field, b);
1351
- Ln(h).some((C) => C.value === I.aggregate) || d(`Aggregation '${I.aggregate}' is not eligible for this Matrix field datatype.`, b);
1350
+ const C = u(I.field, b);
1351
+ Gn(C).some((h) => h.value === I.aggregate) || d(`Aggregation '${I.aggregate}' is not eligible for this Matrix field datatype.`, b);
1352
1352
  }
1353
1353
  try {
1354
- return Kn(m.data, t);
1354
+ return Hn(m.data, t);
1355
1355
  } catch (p) {
1356
- if (p instanceof zr) return d(p.message);
1356
+ if (p instanceof Gr) return d(p.message);
1357
1357
  throw p;
1358
1358
  }
1359
1359
  }
1360
- function Qt(e, t) {
1360
+ function $t(e, t) {
1361
1361
  const n = [], r = (o) => {
1362
1362
  if (o.source) {
1363
- const i = Er.safeParse(o.source);
1363
+ const i = jr.safeParse(o.source);
1364
1364
  if (i.success) n.push(i.data);
1365
1365
  else if (t) throw i.error;
1366
1366
  }
@@ -1368,33 +1368,33 @@ function Qt(e, t) {
1368
1368
  };
1369
1369
  for (const o of e) {
1370
1370
  if (o.target !== "config_field_selector" && o.target !== "config_metric_selector") continue;
1371
- const i = t == null ? void 0 : t.get(o), a = t ? i && i !== Ce ? [o.mapping[i]] : [] : Object.values(o.mapping);
1371
+ const i = t == null ? void 0 : t.get(o), a = t ? i && i !== he ? [o.mapping[i]] : [] : Object.values(o.mapping);
1372
1372
  for (const s of a)
1373
1373
  s && "role" in s && r(s);
1374
1374
  }
1375
1375
  return n;
1376
1376
  }
1377
- function Ii(e, t = [], n = []) {
1378
- return Dt([...gt(e), ...Qt(t), ...n]);
1377
+ function vi(e, t = [], n = []) {
1378
+ return St([...gt(e), ...$t(t), ...n]);
1379
1379
  }
1380
- function hi(e, t = {}) {
1380
+ function Fi(e, t = {}) {
1381
1381
  const n = t.controlBindings ?? [], r = pt(t.controlDefinitions ?? [], t.cardControlDefinitions ?? []), o = new Map(n.filter((i) => i.target === "config_field_selector" || i.target === "config_metric_selector").map((i) => [i, mt({ binding: i, definitions: r, controlValues: t.controlValues })]));
1382
- return Dt([...gt(e), ...Qt(n, o)]);
1382
+ return St([...gt(e), ...$t(n, o)]);
1383
1383
  }
1384
- function $t(e, t) {
1385
- return Te(e) ? vi(e, t) : e.config ?? {};
1384
+ function Jt(e, t) {
1385
+ return Te(e) ? Si(e, t) : e.config ?? {};
1386
1386
  }
1387
- function Ci(e, t) {
1388
- return t != null && t.steps.length ? { ...e, config: $t(e, t) } : e;
1387
+ function Di(e, t) {
1388
+ return t != null && t.steps.length ? { ...e, config: Jt(e, t) } : e;
1389
1389
  }
1390
- function vi(e, t) {
1390
+ function Si(e, t) {
1391
1391
  var r;
1392
1392
  const n = (r = t == null ? void 0 : t.steps[t.steps.length - 1]) == null ? void 0 : r.toField;
1393
- return n ? wo(e.config ?? {}, n, {
1393
+ return n ? Ao(e.config ?? {}, n, {
1394
1394
  sortPolicy: "retargetDimensionSort"
1395
1395
  }) : e.config ?? {};
1396
1396
  }
1397
- function Fi(e, t) {
1397
+ function Ti(e, t) {
1398
1398
  const n = (e == null ? void 0 : e.steps) ?? [];
1399
1399
  if (n.length !== 0)
1400
1400
  return {
@@ -1413,7 +1413,7 @@ function Fi(e, t) {
1413
1413
  logicalOperator: "AND",
1414
1414
  negate: !1,
1415
1415
  conditions: r.conditions.map(
1416
- (i) => oo(
1416
+ (i) => so(
1417
1417
  i,
1418
1418
  `${i.field.id}-${i.value}`
1419
1419
  )
@@ -1428,16 +1428,16 @@ const ye = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
1428
1428
  function H(e) {
1429
1429
  return e instanceof Date ? JSON.stringify(Number.isNaN(e.getTime()) ? null : e.toISOString()) : Array.isArray(e) ? `[${e.map(H).join(",")}]` : ye(e) ? `{${Object.keys(e).sort().filter((t) => e[t] !== void 0).map((t) => `${JSON.stringify(t)}:${H(e[t])}`).join(",")}}` : JSON.stringify(e) ?? "null";
1430
1430
  }
1431
- function Di(e) {
1431
+ function Vi(e) {
1432
1432
  const t = e;
1433
1433
  return t.valueType === "date" || t.relativeMeta !== void 0 || t.temporalBucket !== void 0 || ne(t.dataType);
1434
1434
  }
1435
- function Si(e) {
1435
+ function Mi(e) {
1436
1436
  const t = ye(e.field) ? e.field : void 0;
1437
1437
  return e.temporalBucket !== void 0 || e.rawTemporal !== void 0 || e.relativeMeta !== void 0 || ne(t == null ? void 0 : t.dataType);
1438
1438
  }
1439
1439
  function Wt(e) {
1440
- return e ? [...(e.conditions ?? []).filter(Si).map((n) => {
1440
+ return e ? [...(e.conditions ?? []).filter(Mi).map((n) => {
1441
1441
  const r = ye(n.field) ? n.field : {};
1442
1442
  return {
1443
1443
  field: r.qualifiedFieldName ?? r.name,
@@ -1450,7 +1450,7 @@ function Wt(e) {
1450
1450
  }), ...(e.groups ?? []).flatMap((n) => Wt(n))] : [];
1451
1451
  }
1452
1452
  function rt(e) {
1453
- const t = e.filterValues.filter(Di).map((r) => {
1453
+ const t = e.filterValues.filter(Vi).map((r) => {
1454
1454
  const o = r, i = ye(o.fieldMeta) ? o.fieldMeta : void 0;
1455
1455
  return {
1456
1456
  field: (i == null ? void 0 : i.qualifiedFieldName) ?? o.name,
@@ -1465,7 +1465,7 @@ function rt(e) {
1465
1465
  ...e.zoom ? { zoom: [e.zoom.from, e.zoom.to] } : {}
1466
1466
  });
1467
1467
  }
1468
- function Ti(e, t, n) {
1468
+ function ki(e, t, n) {
1469
1469
  if (!t || n.drillActive || t.madeUnder !== n.currentFingerprint) return e;
1470
1470
  const r = e.groupByColumns ?? [];
1471
1471
  return r.some((o) => o.id === t.fieldId && o.grainMode === "automatic") ? {
@@ -1477,14 +1477,14 @@ function Ti(e, t, n) {
1477
1477
  })
1478
1478
  } : e;
1479
1479
  }
1480
- function ds(e) {
1480
+ function ps(e) {
1481
1481
  var t;
1482
1482
  return (((t = e.config) == null ? void 0 : t.groupByColumns) ?? []).find(
1483
- (n) => n.grainMode === "automatic" && Un({ cardType: e.type, configBacked: !0, shelf: "groupBy", dataType: n.dataType }).ok
1483
+ (n) => n.grainMode === "automatic" && $n({ cardType: e.type, configBacked: !0, shelf: "groupBy", dataType: n.dataType }).ok
1484
1484
  );
1485
1485
  }
1486
- function Vi(e, t) {
1487
- if (!e || !t || t.id !== e.fieldId || Rr(t)) return;
1486
+ function xi(e, t) {
1487
+ if (!e || !t || t.id !== e.fieldId || Nr(t)) return;
1488
1488
  const {
1489
1489
  granularity: n,
1490
1490
  grainMode: r,
@@ -1508,18 +1508,18 @@ function Vi(e, t) {
1508
1508
  groups: []
1509
1509
  };
1510
1510
  }
1511
- function us(e, t, n) {
1511
+ function ms(e, t, n) {
1512
1512
  const r = Ue(e, n), o = Ue(t, n);
1513
1513
  if (!r || !o) return;
1514
1514
  const [i, a] = r.first <= o.first ? [r, o] : [o, r];
1515
1515
  return { from: i.first, to: a.last };
1516
1516
  }
1517
- function Mi(e, t, n) {
1517
+ function Pi(e, t, n) {
1518
1518
  if (!e || e.madeUnder !== n) return;
1519
- const r = t == null ? void 0 : t.find((i) => i.id === e.fieldId && i.grainMode === "automatic"), o = Vi(e, r);
1519
+ const r = t == null ? void 0 : t.find((i) => i.id === e.fieldId && i.grainMode === "automatic"), o = xi(e, r);
1520
1520
  return o ? { zoom: e, filterGroup: o } : void 0;
1521
1521
  }
1522
- function fs(e, t, n) {
1522
+ function gs(e, t, n) {
1523
1523
  if (!e) return;
1524
1524
  const [r, o] = t <= n ? [t, n] : [n, t];
1525
1525
  if (r < 0 || o >= e.length) return;
@@ -1530,12 +1530,12 @@ function fs(e, t, n) {
1530
1530
  (d, u) => (u < r || u > o) && typeof d == "string" && d > s && d < l
1531
1531
  ) ? void 0 : { first: s, last: l };
1532
1532
  }
1533
- function ps(e, t, n) {
1533
+ function ys(e, t, n) {
1534
1534
  if (!t || !n) return { from: e.from, to: e.to };
1535
- const r = We(new Date(t.startInclusive), n), o = We(new Date(Date.parse(t.endExclusive) - 1), n), i = e.from < r ? r : e.from, a = e.to > o ? o : e.to;
1535
+ const r = Je(new Date(t.startInclusive), n), o = Je(new Date(Date.parse(t.endExclusive) - 1), n), i = e.from < r ? r : e.from, a = e.to > o ? o : e.to;
1536
1536
  return i <= a ? { from: i, to: a } : { from: e.from, to: e.to };
1537
1537
  }
1538
- function ms(e, t, n) {
1538
+ function bs(e, t, n) {
1539
1539
  const r = (i) => /* @__PURE__ */ new Date(`${i}T00:00:00.000Z`), o = new Intl.DateTimeFormat(t, { dateStyle: n, timeZone: "UTC" });
1540
1540
  return e.from === e.to ? o.format(r(e.from)) : o.formatRange(r(e.from), r(e.to));
1541
1541
  }
@@ -1545,57 +1545,59 @@ function Ee(e) {
1545
1545
  function Re(e) {
1546
1546
  return e === "not in" ? "exclude" : "include";
1547
1547
  }
1548
- function ki(e) {
1548
+ function wi(e) {
1549
1549
  return e === "exclude" ? "not in" : "in";
1550
1550
  }
1551
- function gs(e) {
1551
+ function Is(e) {
1552
1552
  var n;
1553
1553
  const t = (n = e.liveValue) == null ? void 0 : n.operation;
1554
1554
  return Ee(t) ? Re(t) : e.pendingMode ?? e.authoredMode;
1555
1555
  }
1556
- function xi(e) {
1556
+ function Oi(e) {
1557
1557
  var r;
1558
1558
  let t = !1;
1559
1559
  const n = (r = e.inputs) == null ? void 0 : r.map((o) => {
1560
1560
  if (o.kind !== "filter" || !o.filter) return o;
1561
- const i = Pi(
1561
+ const i = _i(
1562
1562
  o.filter,
1563
- new Set(wi(e.defaultInputValues, o))
1563
+ new Set(Ai(e.defaultInputValues, o))
1564
1564
  );
1565
1565
  return i === o.filter ? o : (t = !0, { ...o, filter: i });
1566
1566
  });
1567
1567
  return t ? { ...e, inputs: n } : e;
1568
1568
  }
1569
- function Pi(e, t) {
1569
+ function _i(e, t) {
1570
1570
  if (t.size !== 1 || !Ee(e.operation))
1571
1571
  return e;
1572
1572
  const [n] = t;
1573
- return Re(e.operation) === n ? e : { ...e, operation: ki(n) };
1573
+ return Re(e.operation) === n ? e : { ...e, operation: wi(n) };
1574
1574
  }
1575
- function wi(e, t) {
1575
+ function Ai(e, t) {
1576
1576
  var o;
1577
1577
  const n = (i) => Object.values(i ?? {}).map((a) => a[t.id]);
1578
1578
  return (t.runtimeScope === "shared" ? [(o = e == null ? void 0 : e.shared) == null ? void 0 : o[t.id]] : t.runtimeScope === "perSheet" ? n(e == null ? void 0 : e.bySheetId) : t.runtimeScope === "perCard" ? n(e == null ? void 0 : e.byCardId) : t.runtimeScope === "perDocumentSection" ? n(e == null ? void 0 : e.byDocumentSectionId) : []).flatMap(
1579
- (i) => (i == null ? void 0 : i.status) === "set" && i.value.kind === "filter" ? Oi(i.value.filterValue) : []
1579
+ (i) => (i == null ? void 0 : i.status) === "set" && i.value.kind === "filter" ? Bi(i.value.filterValue) : []
1580
1580
  );
1581
1581
  }
1582
- function Oi(e) {
1582
+ function Bi(e) {
1583
1583
  return Ee(e.operation) ? [Re(e.operation)] : [];
1584
1584
  }
1585
- function ys(e) {
1586
- const t = Vt(e), r = A(t).issues.length ? t : Oa(t);
1587
- return xo(
1588
- Qn(xi(r))
1589
- ).dashboard;
1585
+ function Cs(e) {
1586
+ const t = Mt(e), r = A(t).issues.length ? t : Ba(t);
1587
+ return yt(
1588
+ Oo(
1589
+ Jn(Oi(r))
1590
+ ).dashboard
1591
+ );
1590
1592
  }
1591
1593
  function qe(e, t) {
1592
1594
  const n = {};
1593
- for (const r of kt(e)) {
1595
+ for (const r of xt(e)) {
1594
1596
  if (!r.inlineFilters || r.inlineFilters.length === 0)
1595
1597
  continue;
1596
1598
  const o = [];
1597
1599
  for (const i of r.inlineFilters) {
1598
- const a = $n(i, t);
1600
+ const a = Wn(i, t);
1599
1601
  a && o.push(a);
1600
1602
  }
1601
1603
  o.length > 0 && (n[r.id] = o);
@@ -1621,8 +1623,8 @@ function le(e, t, n) {
1621
1623
  const o = { ...r[t.scope] ?? {} };
1622
1624
  o[t.target] = { ...o[t.target], [t.inputId]: n }, r[t.scope] = o;
1623
1625
  }
1624
- function Zt(e, t, n) {
1625
- const r = yt(
1626
+ function Yt(e, t, n) {
1627
+ const r = bt(
1626
1628
  e,
1627
1629
  t.controlOverrides,
1628
1630
  { hasExplicitRuntimeOverrides: t.controlOverrides !== void 0 }
@@ -1635,18 +1637,18 @@ function Zt(e, t, n) {
1635
1637
  inlineFilterValuesMap: t.inlineFilterValuesMap ?? qe(e, n)
1636
1638
  };
1637
1639
  }
1638
- function Ne(e, t, n) {
1639
- return Jt(
1640
+ function je(e, t, n) {
1641
+ return Zt(
1640
1642
  e,
1641
- Zt(e, t, n),
1643
+ Yt(e, t, n),
1642
1644
  n
1643
1645
  );
1644
1646
  }
1645
- function bs(e, t, n) {
1646
- return Jt(e, t, n);
1647
+ function hs(e, t, n) {
1648
+ return Zt(e, t, n);
1647
1649
  }
1648
- function Jt(e, t, n) {
1649
- const r = e.sheets ?? [], o = r.filter((s) => (s.kind ?? "dashboard") === "dashboard").map((s) => s.id), i = r.filter((s) => s.kind === "document"), a = o.length ? Jn({
1650
+ function Zt(e, t, n) {
1651
+ const r = e.sheets ?? [], o = r.filter((s) => (s.kind ?? "dashboard") === "dashboard").map((s) => s.id), i = r.filter((s) => s.kind === "document"), a = o.length ? Xn({
1650
1652
  dashboard: e,
1651
1653
  sheetIds: o,
1652
1654
  mode: "dashboard",
@@ -1659,7 +1661,7 @@ function Jt(e, t, n) {
1659
1661
  var c;
1660
1662
  return xe(
1661
1663
  s,
1662
- Yn({
1664
+ er({
1663
1665
  dashboard: e,
1664
1666
  sheetId: l.id,
1665
1667
  sheetKind: "document",
@@ -1676,7 +1678,7 @@ function Jt(e, t, n) {
1676
1678
  a
1677
1679
  );
1678
1680
  }
1679
- function Yt(e, t) {
1681
+ function Xt(e, t) {
1680
1682
  const n = {}, r = {}, o = /* @__PURE__ */ new Map();
1681
1683
  for (const i of $(t)) {
1682
1684
  const a = e.get(i.inputId), { slot: s } = i, l = () => s.status === "set" && s.value.kind === "filter" ? s.value.filterValue : s.status === "cleared" ? null : void 0;
@@ -1702,40 +1704,40 @@ function Yt(e, t) {
1702
1704
  inlineFilterValues: o
1703
1705
  };
1704
1706
  }
1705
- function _i(e, t) {
1707
+ function Ei(e, t) {
1706
1708
  if (!t.size) return [...e];
1707
1709
  const n = e.filter((o) => !t.has(o.filterId)), r = [...t.values()].filter(
1708
1710
  (o) => o !== null
1709
1711
  );
1710
- return Xn(n, r);
1712
+ return tr(n, r);
1711
1713
  }
1712
- function Xt(e, t, n) {
1714
+ function en(e, t, n) {
1713
1715
  if (!Object.keys(n).length) return t;
1714
- const r = yt(
1716
+ const r = bt(
1715
1717
  e,
1716
1718
  t,
1717
1719
  { hasExplicitRuntimeOverrides: t !== void 0 }
1718
1720
  );
1719
1721
  return {
1720
- ...Wn({
1722
+ ...Yn({
1721
1723
  dashboardValues: r.dashboardControlValues,
1722
1724
  cardValuesMap: r.cardControlValuesMap
1723
1725
  }),
1724
1726
  ...n
1725
1727
  };
1726
1728
  }
1727
- function Ai(e, t) {
1729
+ function Ri(e, t) {
1728
1730
  if (!t.size) return;
1729
1731
  const n = Object.fromEntries(
1730
1732
  Object.entries(e).map(([r, o]) => [r, [...o]])
1731
1733
  );
1732
1734
  for (const [r, o] of t)
1733
- n[r] = _i(n[r] ?? [], o);
1735
+ n[r] = Ei(n[r] ?? [], o);
1734
1736
  return n;
1735
1737
  }
1736
- function Bi(e, t, n) {
1738
+ function qi(e, t, n) {
1737
1739
  const r = new Map(
1738
- j(e).map(({ card: a }) => [
1740
+ N(e).map(({ card: a }) => [
1739
1741
  a.id,
1740
1742
  // Column filters too (TCF-D4): a viewer's column filter survives a refetch.
1741
1743
  new Map(Zn(a).map((s) => [s.id, s]))
@@ -1754,11 +1756,11 @@ function Bi(e, t, n) {
1754
1756
  }
1755
1757
  return o ? i : void 0;
1756
1758
  }
1757
- function Is(e) {
1758
- const { dashboard: t, capture: n, calendar: r } = e, o = Fn(t, n.filterValues, {
1759
+ function vs(e) {
1760
+ const { dashboard: t, capture: n, calendar: r } = e, o = Sn(t, n.filterValues, {
1759
1761
  calendar: r
1760
1762
  }), i = n.dashboardInputExecutionSnapshot, a = n.controlValues, s = {
1761
- ...Zt(
1763
+ ...Yt(
1762
1764
  t,
1763
1765
  {
1764
1766
  adHocFilterValues: o.adHocFilterValues,
@@ -1766,7 +1768,7 @@ function Is(e) {
1766
1768
  // The snapshot replays exactly over the listed values.
1767
1769
  dashboardInputValues: i ? xe(
1768
1770
  o.slots,
1769
- tr({
1771
+ rr({
1770
1772
  dashboard: t,
1771
1773
  dashboardInputValues: i.dashboardInputValues,
1772
1774
  sheetId: i.sheetId,
@@ -1776,23 +1778,23 @@ function Is(e) {
1776
1778
  },
1777
1779
  r
1778
1780
  ),
1779
- cardViewState: i ? er(i.cardViewState) : {}
1780
- }, l = i ? nr(i.transientContexts) : void 0;
1781
+ cardViewState: i ? nr(i.cardViewState) : {}
1782
+ }, l = i ? or(i.transientContexts) : void 0;
1781
1783
  return {
1782
1784
  runtimeValues: s,
1783
1785
  controlOverrides: a,
1784
1786
  ...l != null && l.length ? { transientContexts: l } : {}
1785
1787
  };
1786
1788
  }
1787
- function hs(e, t) {
1789
+ function Fs(e, t) {
1788
1790
  const { controlContractOverrides: n, cardId: r } = t;
1789
1791
  if (!n || (n.controlDefinitions !== void 0 && (e.controls = n.controlDefinitions), typeof r != "string" || r.trim().length === 0))
1790
1792
  return e;
1791
- const o = Z(e, r);
1793
+ const o = W(e, r);
1792
1794
  return o && (n.cardControlDefinitions !== void 0 && (o.controls = n.cardControlDefinitions), n.controlBindings !== void 0 && (o.controlBindings = n.controlBindings)), e;
1793
1795
  }
1794
- const Ei = ["bySheetId", "byCardId", "byDocumentSectionId"];
1795
- function Ri(e, t) {
1796
+ const ji = ["bySheetId", "byCardId", "byDocumentSectionId"];
1797
+ function Ni(e, t) {
1796
1798
  const n = A(e);
1797
1799
  let r = !1;
1798
1800
  const o = (a) => {
@@ -1808,7 +1810,7 @@ function Ri(e, t) {
1808
1810
  ...t,
1809
1811
  ...t.shared ? { shared: o(t.shared) } : {}
1810
1812
  };
1811
- for (const a of Ei) {
1813
+ for (const a of ji) {
1812
1814
  const s = t[a];
1813
1815
  s && (i[a] = Object.fromEntries(
1814
1816
  Object.entries(s).map(([l, c]) => [l, o(c) ?? {}])
@@ -1816,24 +1818,24 @@ function Ri(e, t) {
1816
1818
  }
1817
1819
  return r ? i : t;
1818
1820
  }
1819
- function qi(e) {
1821
+ function zi(e) {
1820
1822
  var t, n;
1821
1823
  return ((n = (t = e.sheets) == null ? void 0 : t[0]) == null ? void 0 : n.id) ?? null;
1822
1824
  }
1823
- function J(e, t) {
1825
+ function Y(e, t) {
1824
1826
  var n;
1825
1827
  return !!t && !!((n = e.sheets) != null && n.some((r) => r.id === t));
1826
1828
  }
1827
- function Cs(e) {
1828
- const { dashboard: t, host: n, calendar: r } = e, o = Fn(t, n.filterValues, {
1829
+ function Ds(e) {
1830
+ const { dashboard: t, host: n, calendar: r } = e, o = Sn(t, n.filterValues, {
1829
1831
  calendar: r
1830
- }).slots, i = n.controlValues, a = J(t, n.selectedSheetId) ? n.selectedSheetId : qi(t);
1832
+ }).slots, i = n.controlValues, a = Y(t, n.selectedSheetId) ? n.selectedSheetId : zi(t);
1831
1833
  return {
1832
1834
  hostInputValues: o,
1833
1835
  controlOverrides: i,
1834
1836
  selectedSheetId: a,
1835
1837
  hostSelectedSheetId: n.selectedSheetId ?? null,
1836
- materializedInputs: e.materializeInputs === !1 ? {} : Ne(
1838
+ materializedInputs: e.materializeInputs === !1 ? {} : je(
1837
1839
  t,
1838
1840
  {
1839
1841
  adHocFilterValues: [],
@@ -1844,28 +1846,28 @@ function Cs(e) {
1844
1846
  )
1845
1847
  };
1846
1848
  }
1847
- function en(e) {
1849
+ function tn(e) {
1848
1850
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
1849
1851
  for (const o of Pe(e))
1850
1852
  o.kind === "filter" && o.filter ? t.set(o.id, o.filter) : o.kind === "control" && n.add(o.id), o.compatibility && r.set(o.id, o.compatibility);
1851
1853
  return { filterInputs: t, controlInputIds: n, compatibility: r };
1852
1854
  }
1853
- function tn(e, t) {
1854
- const n = St(t);
1855
+ function nn(e, t) {
1856
+ const n = Tt(t);
1855
1857
  if (!n) return;
1856
- const r = Z(e, n);
1857
- return r ? rr(r, e) ? "applies" : "not-eligible" : "removed";
1858
+ const r = W(e, n);
1859
+ return r ? ir(r, e) ? "applies" : "not-eligible" : "removed";
1858
1860
  }
1859
- function vs(e, t) {
1860
- const n = tn(e, t);
1861
+ function Ss(e, t) {
1862
+ const n = nn(e, t);
1861
1863
  return n ? n === "applies" : Pe(e).some(
1862
1864
  (r) => r.id === t
1863
1865
  );
1864
1866
  }
1865
- function nn(e, t, n, r) {
1867
+ function rn(e, t, n, r) {
1866
1868
  if (!n) return {};
1867
1869
  const o = new Set((e.sheets ?? []).map((c) => c.id)), i = new Set(
1868
- j(e).map(({ card: c }) => c.id)
1870
+ N(e).map(({ card: c }) => c.id)
1869
1871
  ), a = A(e), s = (c) => {
1870
1872
  var u;
1871
1873
  if (!c) return;
@@ -1873,7 +1875,7 @@ function nn(e, t, n, r) {
1873
1875
  for (const [f, m] of Object.entries(c)) {
1874
1876
  const y = t.filterInputs.has(f) || t.controlInputIds.has(f) ? f : ((u = a.findFilterInput({ inputId: f })) == null ? void 0 : u.input.id) ?? f;
1875
1877
  if (y !== f && c[y]) continue;
1876
- const p = tn(e, y);
1878
+ const p = nn(e, y);
1877
1879
  if (p) {
1878
1880
  if (p !== "applies") {
1879
1881
  r.push({
@@ -1937,15 +1939,15 @@ function nn(e, t, n, r) {
1937
1939
  }
1938
1940
  function O(e, t, n, r = {}) {
1939
1941
  const o = new Map(
1940
- j(e).map(({ card: a }) => [a.id, a])
1942
+ N(e).map(({ card: a }) => [a.id, a])
1941
1943
  ), i = {};
1942
1944
  for (const [a, s] of Object.entries(t ?? {})) {
1943
1945
  const l = o.get(a);
1944
- if (l && Qr(l)) {
1945
- $r(s) || (i[a] = s);
1946
+ if (l && Wr(l)) {
1947
+ Yr(s) || (i[a] = s);
1946
1948
  continue;
1947
1949
  }
1948
- if (l && r.sessionSorts && Wr(l)) {
1950
+ if (l && r.sessionSorts && Zr(l)) {
1949
1951
  s.sort && (i[a] = { sort: s.sort });
1950
1952
  continue;
1951
1953
  }
@@ -1953,14 +1955,14 @@ function O(e, t, n, r = {}) {
1953
1955
  kind: "setting-no-longer-applies",
1954
1956
  target: "card",
1955
1957
  id: a,
1956
- reason: Z(e, a) ? "not-eligible" : "removed"
1958
+ reason: W(e, a) ? "not-eligible" : "removed"
1957
1959
  });
1958
1960
  }
1959
1961
  return i;
1960
1962
  }
1961
- function Ni(e, t, n) {
1963
+ function Li(e, t, n) {
1962
1964
  if (t) {
1963
- if (J(e, t)) return t;
1965
+ if (Y(e, t)) return t;
1964
1966
  n.push({
1965
1967
  kind: "setting-no-longer-applies",
1966
1968
  target: "sheet",
@@ -1969,8 +1971,8 @@ function Ni(e, t, n) {
1969
1971
  });
1970
1972
  }
1971
1973
  }
1972
- const je = (e, t) => pe(e ?? null, t ?? null);
1973
- function rn(e) {
1974
+ const Ne = (e, t) => pe(e ?? null, t ?? null);
1975
+ function on(e) {
1974
1976
  return {
1975
1977
  adHocFilterValues: e.adHocFilterValues,
1976
1978
  controlOverrides: e.controlOverrides,
@@ -1989,34 +1991,34 @@ function X(e, t) {
1989
1991
  tableSettings: t
1990
1992
  };
1991
1993
  }
1992
- function on(e, t) {
1994
+ function an(e, t) {
1993
1995
  const n = t.dashboardInputValues === e.baseline.hostInputValues && !t.inlineFilterValuesMap && !t.adHocFilterValues.length && t.controlOverrides === e.baseline.controlOverrides;
1994
1996
  return {
1995
1997
  selectedSheetId: t.selectedSheetId,
1996
1998
  // Overlay: the bookmark's values on the baseline's runtime values.
1997
- inputs: n ? e.baseline.materializedInputs : Ne(e.dashboard, t, e.calendar),
1999
+ inputs: n ? e.baseline.materializedInputs : je(e.dashboard, t, e.calendar),
1998
2000
  tableSettings: t.tableSettings
1999
2001
  };
2000
2002
  }
2001
- function N(e, t) {
2002
- const n = rn(t), r = t.restore ?? n;
2003
+ function j(e, t) {
2004
+ const n = on(t), r = t.restore ?? n;
2003
2005
  return {
2004
2006
  ...n,
2005
2007
  appliedBookmarkId: t.appliedBookmarkId,
2006
2008
  rememberedWrites: t.rememberedWrites ?? [],
2007
2009
  notices: t.notices ?? [],
2008
- opened: on(e, r),
2010
+ opened: an(e, r),
2009
2011
  restore: r
2010
2012
  };
2011
2013
  }
2012
2014
  function ot(e, t, n, r) {
2013
- const { dashboard: o, baseline: i } = e, a = [], s = xt(t.state, _e), l = s.ok ? s.value : {};
2015
+ const { dashboard: o, baseline: i } = e, a = [], s = Pt(t.state, _e), l = s.ok ? s.value : {};
2014
2016
  for (const y of s.ok ? s.issues : [])
2015
- a.push(ji(y));
2016
- const c = en(o), d = Yt(
2017
+ a.push(Ki(y));
2018
+ const c = tn(o), d = Xt(
2017
2019
  c.compatibility,
2018
- nn(o, c, l.inputs, a)
2019
- ), u = Ni(o, l.selectedSheetId, a) ?? i.selectedSheetId, f = O(
2020
+ rn(o, c, l.inputs, a)
2021
+ ), u = Li(o, l.selectedSheetId, a) ?? i.selectedSheetId, f = O(
2020
2022
  o,
2021
2023
  l.tableSettings,
2022
2024
  a
@@ -2025,11 +2027,11 @@ function ot(e, t, n, r) {
2025
2027
  n,
2026
2028
  void 0
2027
2029
  );
2028
- return N(e, {
2030
+ return j(e, {
2029
2031
  appliedBookmarkId: t.id,
2030
2032
  // A bookmark opens without ad-hoc values, as today (P4a-02 f).
2031
2033
  adHocFilterValues: [],
2032
- controlOverrides: Xt(
2034
+ controlOverrides: en(
2033
2035
  o,
2034
2036
  i.controlOverrides,
2035
2037
  d.controlValues
@@ -2039,8 +2041,8 @@ function ot(e, t, n, r) {
2039
2041
  i.hostInputValues,
2040
2042
  d.runtime
2041
2043
  ),
2042
- ...an(
2043
- Ai(
2044
+ ...sn(
2045
+ Ri(
2044
2046
  qe(o, e.calendar),
2045
2047
  d.inlineFilterValues
2046
2048
  )
@@ -2051,7 +2053,7 @@ function ot(e, t, n, r) {
2051
2053
  { ...f, ...m }
2052
2054
  ),
2053
2055
  rememberedWrites: r.writeRemembered ? Object.entries(f).filter(
2054
- ([y, p]) => !je(m[y], p)
2056
+ ([y, p]) => !Ne(m[y], p)
2055
2057
  ).map(([y, p]) => ({
2056
2058
  kind: "set",
2057
2059
  cardId: y,
@@ -2060,7 +2062,7 @@ function ot(e, t, n, r) {
2060
2062
  notices: a
2061
2063
  });
2062
2064
  }
2063
- function ji(e) {
2065
+ function Ki(e) {
2064
2066
  return {
2065
2067
  kind: "setting-no-longer-applies",
2066
2068
  target: e.target,
@@ -2068,7 +2070,7 @@ function ji(e) {
2068
2070
  reason: "invalid"
2069
2071
  };
2070
2072
  }
2071
- function an(e) {
2073
+ function sn(e) {
2072
2074
  return e ? { inlineFilterValuesMap: e } : {};
2073
2075
  }
2074
2076
  function it(e, t, n) {
@@ -2084,18 +2086,18 @@ function it(e, t, n) {
2084
2086
  // Live slots stay, except a filter value this template no longer accepts:
2085
2087
  // that filter loads its new default, as the old list did. The resolver
2086
2088
  // ignores slots this template no longer has.
2087
- dashboardInputValues: Ri(
2089
+ dashboardInputValues: Ni(
2088
2090
  r,
2089
2091
  t.dashboardInputValues
2090
2092
  ),
2091
- ...an(
2092
- Bi(
2093
+ ...sn(
2094
+ qi(
2093
2095
  r,
2094
2096
  qe(r, e.calendar),
2095
2097
  t.inlineFilterValuesMap ?? {}
2096
2098
  )
2097
2099
  ),
2098
- selectedSheetId: !n.sheetChanged && J(r, t.selectedSheetId) ? t.selectedSheetId : o.selectedSheetId,
2100
+ selectedSheetId: !n.sheetChanged && Y(r, t.selectedSheetId) ? t.selectedSheetId : o.selectedSheetId,
2099
2101
  tableSettings: O(
2100
2102
  r,
2101
2103
  t.tableSettings,
@@ -2104,13 +2106,13 @@ function it(e, t, n) {
2104
2106
  )
2105
2107
  };
2106
2108
  }
2107
- function Fs(e) {
2109
+ function Ts(e) {
2108
2110
  const { dashboard: t, baseline: n, event: r } = e, o = e.rememberedTableSettings;
2109
2111
  switch (r.kind) {
2110
2112
  case "initial-load":
2111
2113
  return r.defaultBookmark ? ot(e, r.defaultBookmark, o, {
2112
2114
  writeRemembered: !1
2113
- }) : N(e, {
2115
+ }) : j(e, {
2114
2116
  appliedBookmarkId: null,
2115
2117
  ...X(
2116
2118
  n,
@@ -2141,7 +2143,7 @@ function Fs(e) {
2141
2143
  n,
2142
2144
  O(t, o, void 0)
2143
2145
  );
2144
- return N(e, {
2146
+ return j(e, {
2145
2147
  appliedBookmarkId: (a == null ? void 0 : a.appliedBookmarkId) ?? null,
2146
2148
  ...l,
2147
2149
  notices: (a == null ? void 0 : a.notices) ?? [],
@@ -2153,7 +2155,7 @@ function Fs(e) {
2153
2155
  writeRemembered: !0
2154
2156
  });
2155
2157
  case "open-default-view":
2156
- return N(e, {
2158
+ return j(e, {
2157
2159
  appliedBookmarkId: null,
2158
2160
  ...X(
2159
2161
  n,
@@ -2161,7 +2163,7 @@ function Fs(e) {
2161
2163
  )
2162
2164
  });
2163
2165
  case "reset-to-default-view":
2164
- return N(e, {
2166
+ return j(e, {
2165
2167
  appliedBookmarkId: null,
2166
2168
  ...X(n, {}),
2167
2169
  rememberedWrites: [{ kind: "clear-all" }]
@@ -2177,16 +2179,16 @@ function Fs(e) {
2177
2179
  ...Object.keys(l),
2178
2180
  ...Object.keys(s)
2179
2181
  ])) {
2180
- if (je(l[d], s[d])) continue;
2182
+ if (Ne(l[d], s[d])) continue;
2181
2183
  const u = s[d];
2182
2184
  c.push(
2183
2185
  u ? { kind: "set", cardId: d, settings: u } : { kind: "clear", cardId: d }
2184
2186
  );
2185
2187
  }
2186
- return N(e, {
2188
+ return j(e, {
2187
2189
  appliedBookmarkId: r.applied.appliedBookmarkId,
2188
2190
  ...i,
2189
- selectedSheetId: J(t, i.selectedSheetId) ? i.selectedSheetId : n.selectedSheetId,
2191
+ selectedSheetId: Y(t, i.selectedSheetId) ? i.selectedSheetId : n.selectedSheetId,
2190
2192
  tableSettings: a,
2191
2193
  rememberedWrites: c,
2192
2194
  notices: r.applied.notices,
@@ -2195,11 +2197,11 @@ function Fs(e) {
2195
2197
  }
2196
2198
  }
2197
2199
  }
2198
- function Ds(e) {
2200
+ function Vs(e) {
2199
2201
  const { dashboard: t, calendar: n } = e, r = e.hostControlValues, o = {
2200
2202
  ...e.baseline,
2201
2203
  controlOverrides: r,
2202
- materializedInputs: Ne(
2204
+ materializedInputs: je(
2203
2205
  t,
2204
2206
  {
2205
2207
  adHocFilterValues: [],
@@ -2211,19 +2213,19 @@ function Ds(e) {
2211
2213
  };
2212
2214
  let i = r;
2213
2215
  if (e.appliedBookmark) {
2214
- const l = xt(
2216
+ const l = Pt(
2215
2217
  e.appliedBookmark.state,
2216
2218
  _e
2217
- ), c = en(t), d = Yt(
2219
+ ), c = tn(t), d = Xt(
2218
2220
  c.compatibility,
2219
- nn(
2221
+ rn(
2220
2222
  t,
2221
2223
  c,
2222
2224
  l.ok ? l.value.inputs : void 0,
2223
2225
  []
2224
2226
  )
2225
2227
  ).controlValues;
2226
- i = Xt(t, r, d);
2228
+ i = en(t, r, d);
2227
2229
  }
2228
2230
  const a = e.applied;
2229
2231
  if (!a) return { baseline: o, controlOverrides: i, applied: null };
@@ -2235,12 +2237,12 @@ function Ds(e) {
2235
2237
  ...a,
2236
2238
  controlOverrides: i,
2237
2239
  restore: s,
2238
- opened: on({ dashboard: t, baseline: o, calendar: n }, s)
2240
+ opened: an({ dashboard: t, baseline: o, calendar: n }, s)
2239
2241
  }
2240
2242
  };
2241
2243
  }
2242
- function Ss(e, t, n) {
2243
- const r = rn(n.values);
2244
+ function Ms(e, t, n) {
2245
+ const r = on(n.values);
2244
2246
  return {
2245
2247
  ...r,
2246
2248
  appliedBookmarkId: t,
@@ -2254,7 +2256,7 @@ const at = (e) => JSON.stringify([e.scope, e.target, e.inputId]);
2254
2256
  function ee(e) {
2255
2257
  return !e || e.status === "cleared" && !e.comparisonSelection;
2256
2258
  }
2257
- function sn(e, t) {
2259
+ function ln(e, t) {
2258
2260
  const n = new Map(
2259
2261
  $(e).map((i) => [at(i), i])
2260
2262
  ), r = new Map(
@@ -2272,12 +2274,12 @@ function sn(e, t) {
2272
2274
  r.has(i) || ee(a.slot) || le(o, a, { status: "cleared" });
2273
2275
  return fe(o);
2274
2276
  }
2275
- function Ts(e) {
2276
- const { dashboard: t, baseline: n, current: r } = e, o = sn(n.materializedInputs, r.inputs), i = O(
2277
+ function ks(e) {
2278
+ const { dashboard: t, baseline: n, current: r } = e, o = ln(n.materializedInputs, r.inputs), i = O(
2277
2279
  t,
2278
2280
  r.tableSettings,
2279
2281
  void 0
2280
- ), a = r.selectedSheetId && r.selectedSheetId !== n.selectedSheetId && J(t, r.selectedSheetId) ? r.selectedSheetId : void 0;
2282
+ ), a = r.selectedSheetId && r.selectedSheetId !== n.selectedSheetId && Y(t, r.selectedSheetId) ? r.selectedSheetId : void 0;
2281
2283
  return {
2282
2284
  version: _e,
2283
2285
  ...a ? { selectedSheetId: a } : {},
@@ -2285,31 +2287,31 @@ function Ts(e) {
2285
2287
  ...Object.keys(i).length ? { tableSettings: i } : {}
2286
2288
  };
2287
2289
  }
2288
- function zi(e) {
2290
+ function Gi(e) {
2289
2291
  const t = /* @__PURE__ */ new Map();
2290
2292
  for (const n of Pe(e))
2291
2293
  n.label && t.set(n.id, n.label);
2292
2294
  return t;
2293
2295
  }
2294
- function Li(e, t, n) {
2296
+ function Hi(e, t, n) {
2295
2297
  var o, i;
2296
- const r = St(n);
2298
+ const r = Tt(n);
2297
2299
  if (r) {
2298
- const a = (i = (o = Z(e, r)) == null ? void 0 : o.title) == null ? void 0 : i.trim();
2300
+ const a = (i = (o = W(e, r)) == null ? void 0 : o.title) == null ? void 0 : i.trim();
2299
2301
  return a ? `Selection in ${a}` : "Selection";
2300
2302
  }
2301
2303
  return t.get(n) ?? n;
2302
2304
  }
2303
- function Vs(e) {
2305
+ function xs(e) {
2304
2306
  var c, d;
2305
- const { dashboard: t, opened: n, current: r } = e, o = [], i = zi(t), a = /* @__PURE__ */ new Set();
2307
+ const { dashboard: t, opened: n, current: r } = e, o = [], i = Gi(t), a = /* @__PURE__ */ new Set();
2306
2308
  for (const u of $(
2307
- sn(n.inputs, r.inputs)
2309
+ ln(n.inputs, r.inputs)
2308
2310
  ))
2309
2311
  a.has(u.inputId) || (a.add(u.inputId), o.push({
2310
2312
  target: "input",
2311
2313
  inputId: u.inputId,
2312
- label: Li(t, i, u.inputId)
2314
+ label: Hi(t, i, u.inputId)
2313
2315
  }));
2314
2316
  (n.selectedSheetId ?? null) !== (r.selectedSheetId ?? null) && o.push({ target: "sheet" });
2315
2317
  const s = O(
@@ -2325,10 +2327,10 @@ function Vs(e) {
2325
2327
  ...Object.keys(s),
2326
2328
  ...Object.keys(l)
2327
2329
  ]))
2328
- je(s[u], l[u]) || o.push({
2330
+ Ne(s[u], l[u]) || o.push({
2329
2331
  target: "table",
2330
2332
  cardId: u,
2331
- cardTitle: ((d = (c = Z(t, u)) == null ? void 0 : c.title) == null ? void 0 : d.trim()) || "Table"
2333
+ cardTitle: ((d = (c = W(t, u)) == null ? void 0 : c.title) == null ? void 0 : d.trim()) || "Table"
2332
2334
  });
2333
2335
  return o;
2334
2336
  }
@@ -2346,7 +2348,7 @@ function st(e) {
2346
2348
  }
2347
2349
  };
2348
2350
  }
2349
- function Ki(e) {
2351
+ function Ui(e) {
2350
2352
  var o, i;
2351
2353
  if ((o = e.card.sql) != null && o.trim())
2352
2354
  return {
@@ -2356,7 +2358,7 @@ function Ki(e) {
2356
2358
  };
2357
2359
  const t = e.inputs.filter((a) => !U(a.filter)).map((a) => ({
2358
2360
  input: a,
2359
- resolution: or({
2361
+ resolution: ar({
2360
2362
  filter: a.filter,
2361
2363
  filterValue: a.filterValue,
2362
2364
  effectiveFilterValue: a.effectiveFilterValue,
@@ -2370,7 +2372,7 @@ function Ki(e) {
2370
2372
  const n = e.inputs.find(
2371
2373
  (a) => U(a.filter)
2372
2374
  );
2373
- if (n && ((i = n.filterValue) == null ? void 0 : i.filterId) === n.filterId && n.effectiveFilterValue.filterId === n.filterId && ir(n.effectiveFilterValue))
2375
+ if (n && ((i = n.filterValue) == null ? void 0 : i.filterId) === n.filterId && n.effectiveFilterValue.filterId === n.filterId && sr(n.effectiveFilterValue))
2374
2376
  return {
2375
2377
  inputs: e.inputs,
2376
2378
  fieldCandidates: t,
@@ -2400,7 +2402,7 @@ function Ki(e) {
2400
2402
  }
2401
2403
  } : { inputs: e.inputs, fieldCandidates: t, resolution: { status: "none" } };
2402
2404
  }
2403
- function Ms(e) {
2405
+ function Ps(e) {
2404
2406
  const t = {
2405
2407
  ownerCardCount: 0,
2406
2408
  matchingCardCount: 0,
@@ -2418,7 +2420,7 @@ function Ms(e) {
2418
2420
  }
2419
2421
  return t;
2420
2422
  }
2421
- const Gi = /* @__PURE__ */ new Set([
2423
+ const Qi = /* @__PURE__ */ new Set([
2422
2424
  "between",
2423
2425
  "not between",
2424
2426
  "=",
@@ -2429,36 +2431,36 @@ const Gi = /* @__PURE__ */ new Set([
2429
2431
  "<=",
2430
2432
  "is null",
2431
2433
  "is not null"
2432
- ]), Hi = /^(\d{4}-\d{2}-\d{2})T/, Ui = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/;
2434
+ ]), $i = /^(\d{4}-\d{2}-\d{2})T/, Ji = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/;
2433
2435
  function ze(e) {
2434
- return Gi.has(e);
2436
+ return Qi.has(e);
2435
2437
  }
2436
- function Qi(e, t) {
2438
+ function Wi(e, t) {
2437
2439
  if (e instanceof Date)
2438
2440
  return Number.isNaN(e.getTime()) ? e : t ? Qe(e, t, "yyyy-MM-dd") : e.toISOString().slice(0, 10);
2439
2441
  if (typeof e != "string")
2440
2442
  return e;
2441
2443
  const n = e.trim();
2442
- if (t && Ui.test(n)) {
2444
+ if (t && Ji.test(n)) {
2443
2445
  const o = new Date(n);
2444
2446
  if (!Number.isNaN(o.getTime()))
2445
2447
  return Qe(o, t, "yyyy-MM-dd");
2446
2448
  }
2447
- const r = Hi.exec(n);
2449
+ const r = $i.exec(n);
2448
2450
  return r ? r[1] : e;
2449
2451
  }
2450
- function ln(e, t) {
2452
+ function cn(e, t) {
2451
2453
  return Array.isArray(e) ? e.map(
2452
- (n) => Qi(n, t)
2454
+ (n) => Wi(n, t)
2453
2455
  ) : e;
2454
2456
  }
2455
- function cn(e) {
2457
+ function dn(e) {
2456
2458
  return typeof e.allowMinutePrecision == "boolean" ? e.allowMinutePrecision : we(
2457
2459
  e.dashboard,
2458
2460
  e.semanticExecutionPayload
2459
2461
  ).allEligibleTargetsAreDateTime;
2460
2462
  }
2461
- function dn(e) {
2463
+ function un(e) {
2462
2464
  const {
2463
2465
  globalDateFilter: t,
2464
2466
  globalDateFilterValue: n,
@@ -2472,7 +2474,7 @@ function dn(e) {
2472
2474
  ...n,
2473
2475
  filterId: t.id
2474
2476
  };
2475
- const i = n, a = i.temporalPrecision === "minute" || te(i.relativeMeta) === "minute", s = !o && a, l = i.operation === "is null" || i.operation === "is not null" ? [] : s ? ln(i.values, r) : i.values, c = o || te(i.relativeMeta) !== "minute" ? i.relativeMeta : void 0, d = o && i.temporalPrecision === "minute" ? i.temporalPrecision : void 0, {
2477
+ const i = n, a = i.temporalPrecision === "minute" || te(i.relativeMeta) === "minute", s = !o && a, l = i.operation === "is null" || i.operation === "is not null" ? [] : s ? cn(i.values, r) : i.values, c = o || te(i.relativeMeta) !== "minute" ? i.relativeMeta : void 0, d = o && i.temporalPrecision === "minute" ? i.temporalPrecision : void 0, {
2476
2478
  relativeMeta: u,
2477
2479
  temporalPrecision: f,
2478
2480
  values: m,
@@ -2486,19 +2488,19 @@ function dn(e) {
2486
2488
  ...d ? { temporalPrecision: d } : {}
2487
2489
  };
2488
2490
  }
2489
- function $i(e) {
2491
+ function Yi(e) {
2490
2492
  const t = L(e.filters);
2491
2493
  if (!t)
2492
2494
  return e.filterValues;
2493
- const n = cn(e);
2494
- return e.filterValues.map((r) => r.filterId !== t.id ? r : dn({
2495
+ const n = dn(e);
2496
+ return e.filterValues.map((r) => r.filterId !== t.id ? r : un({
2495
2497
  globalDateFilter: t,
2496
2498
  globalDateFilterValue: r,
2497
2499
  timezone: e.timezone,
2498
2500
  allowMinutePrecision: n
2499
2501
  }) || r);
2500
2502
  }
2501
- function un(e) {
2503
+ function fn(e) {
2502
2504
  const {
2503
2505
  globalDateFilter: t,
2504
2506
  globalDateFilterValue: n,
@@ -2509,7 +2511,7 @@ function un(e) {
2509
2511
  } = e;
2510
2512
  if (!t || !n || !r || !ze(n.operation))
2511
2513
  return null;
2512
- const s = n, l = ar(
2514
+ const s = n, l = lr(
2513
2515
  r.dataType
2514
2516
  ), c = a && l, d = s.temporalPrecision === "minute" || te(s.relativeMeta) === "minute", u = c && s.temporalPrecision === "minute" ? s.temporalPrecision : void 0, f = c || te(s.relativeMeta) !== "minute" ? s.relativeMeta : void 0, m = !c && d;
2515
2517
  return {
@@ -2518,7 +2520,7 @@ function un(e) {
2518
2520
  name: r.qualifiedFieldName || r.name,
2519
2521
  operation: s.operation,
2520
2522
  valueType: "date",
2521
- values: s.operation === "is null" || s.operation === "is not null" ? [] : m ? ln(
2523
+ values: s.operation === "is null" || s.operation === "is not null" ? [] : m ? cn(
2522
2524
  s.values,
2523
2525
  i
2524
2526
  ) : s.values,
@@ -2546,7 +2548,7 @@ function un(e) {
2546
2548
  function B(e) {
2547
2549
  return typeof e == "string" ? e.trim() : "";
2548
2550
  }
2549
- function Wi(e) {
2551
+ function Zi(e) {
2550
2552
  var t;
2551
2553
  return (((t = e.semanticContext) == null ? void 0 : t.selectedEntities) || []).filter((n) => typeof n == "object" && n !== null).filter((n) => n.type === "dataset").map((n) => {
2552
2554
  var r;
@@ -2557,11 +2559,11 @@ function Wi(e) {
2557
2559
  };
2558
2560
  }).filter((n) => n.domainId && n.datasetName);
2559
2561
  }
2560
- function Zi(e) {
2562
+ function Xi(e) {
2561
2563
  var l, c, d, u, f;
2562
2564
  if (U(e) || (l = e.sql) != null && l.trim())
2563
2565
  return null;
2564
- const t = Wi(e), n = B((c = e.semanticContext) == null ? void 0 : c.semanticDomainId), r = B((d = e.fieldMeta) == null ? void 0 : d.entityId), o = B((u = e.fieldMeta) == null ? void 0 : u.entityName), i = B((f = e.fieldMeta) == null ? void 0 : f.entityType) === "dataset", a = t.find(
2566
+ const t = Zi(e), n = B((c = e.semanticContext) == null ? void 0 : c.semanticDomainId), r = B((d = e.fieldMeta) == null ? void 0 : d.entityId), o = B((u = e.fieldMeta) == null ? void 0 : u.entityName), i = B((f = e.fieldMeta) == null ? void 0 : f.entityType) === "dataset", a = t.find(
2565
2567
  (m) => r && m.selectedEntityId === r
2566
2568
  );
2567
2569
  if (a)
@@ -2574,22 +2576,22 @@ function Zi(e) {
2574
2576
  datasetName: o
2575
2577
  } : null);
2576
2578
  }
2577
- function Ji(e) {
2579
+ function ea(e) {
2578
2580
  var o, i;
2579
2581
  const { filter: t, semanticExecutionPayload: n } = e;
2580
2582
  if (!n)
2581
2583
  return null;
2582
- const r = Zi(t);
2584
+ const r = Xi(t);
2583
2585
  return r && ((i = (o = n.domainsById[r.domainId]) == null ? void 0 : o.datasetsByName[r.datasetName]) == null ? void 0 : i.primaryDateField) || null;
2584
2586
  }
2585
- function fn(e) {
2587
+ function pn(e) {
2586
2588
  const t = L(e.filters);
2587
2589
  return t ? e.filterValues.filter(
2588
2590
  (n) => n.filterId !== t.id
2589
2591
  ) : e.filterValues;
2590
2592
  }
2591
- function ks(e) {
2592
- const t = L(e.filters), n = fn({
2593
+ function ws(e) {
2594
+ const t = L(e.filters), n = pn({
2593
2595
  filters: e.filters,
2594
2596
  filterValues: e.filterValues
2595
2597
  });
@@ -2597,10 +2599,10 @@ function ks(e) {
2597
2599
  return n;
2598
2600
  const r = e.filterValues.find(
2599
2601
  (a) => a.filterId === t.id
2600
- ), o = Ji({
2602
+ ), o = ea({
2601
2603
  filter: e.filter,
2602
2604
  semanticExecutionPayload: e.semanticExecutionPayload
2603
- }), i = un({
2605
+ }), i = fn({
2604
2606
  globalDateFilter: t,
2605
2607
  globalDateFilterValue: r,
2606
2608
  resolvedPrimaryDateField: o || void 0,
@@ -2610,18 +2612,18 @@ function ks(e) {
2610
2612
  });
2611
2613
  return i ? [i, ...n] : n;
2612
2614
  }
2613
- function Yi(e) {
2615
+ function ta(e) {
2614
2616
  var d;
2615
2617
  const t = L(e.filters), n = t ? e.cardFilterValues.find(
2616
2618
  (u) => u.filterId === t.id
2617
2619
  ) : void 0, r = t ? e.cardFilterValues.filter(
2618
2620
  (u) => u.filterId !== t.id
2619
- ) : e.cardFilterValues, o = e.resolvedPrimaryDateField ?? bt({
2621
+ ) : e.cardFilterValues, o = e.resolvedPrimaryDateField ?? It({
2620
2622
  card: e.card,
2621
2623
  cardConfig: e.cardConfig,
2622
2624
  resolvedFields: e.resolvedFields,
2623
2625
  semanticExecutionPayload: e.semanticExecutionPayload
2624
- }), i = un({
2626
+ }), i = fn({
2625
2627
  globalDateFilter: t,
2626
2628
  globalDateFilterValue: n,
2627
2629
  resolvedPrimaryDateField: o || void 0,
@@ -2642,7 +2644,7 @@ function Yi(e) {
2642
2644
  effectiveFilterValue: f,
2643
2645
  mappedFilterValue: (m = e.mappedFilterValuesByInputId) == null ? void 0 : m.get(u.inputId)
2644
2646
  }] : [];
2645
- })) || [], c = Ki({
2647
+ })) || [], c = Ui({
2646
2648
  inputs: l,
2647
2649
  temporalBinding: o,
2648
2650
  card: e.card
@@ -2653,13 +2655,13 @@ function Yi(e) {
2653
2655
  dateComparisonPlan: c
2654
2656
  };
2655
2657
  }
2656
- function xs(e) {
2657
- const t = L(e.filters), n = cn(e), r = t ? e.filterValues.find(
2658
+ function Os(e) {
2659
+ const t = L(e.filters), n = dn(e), r = t ? e.filterValues.find(
2658
2660
  (a) => a.filterId === t.id
2659
- ) : void 0, o = fn(e);
2661
+ ) : void 0, o = pn(e);
2660
2662
  return !t || !r || !ze(r.operation) ? o : [
2661
2663
  {
2662
- ...dn({
2664
+ ...un({
2663
2665
  globalDateFilter: t,
2664
2666
  globalDateFilterValue: r,
2665
2667
  timezone: e.timezone,
@@ -2671,26 +2673,26 @@ function xs(e) {
2671
2673
  ...o
2672
2674
  ];
2673
2675
  }
2674
- class Xi extends Error {
2676
+ class na extends Error {
2675
2677
  }
2676
- function Ps(e, t) {
2677
- const n = new Map((e ? j(e) : []).map(({ card: r }) => [r.id, r]));
2678
+ function _s(e, t) {
2679
+ const n = new Map((e ? N(e) : []).map(({ card: r }) => [r.id, r]));
2678
2680
  return t && n.set(t.id, t), [...n.values()].flatMap((r) => {
2679
2681
  const o = Ve(r);
2680
- return o.status === "ready" ? Ii(o.config.spec, r.controlBindings) : [];
2682
+ return o.status === "ready" ? vi(o.config.spec, r.controlBindings) : [];
2681
2683
  });
2682
2684
  }
2683
- function ea(e, t, n) {
2684
- const r = sr(e);
2685
+ function ra(e, t, n) {
2686
+ const r = cr(e);
2685
2687
  if (!r) throw new Error("Matrix card definition is required.");
2686
- const o = n && bi({
2688
+ const o = n && hi({
2687
2689
  ...n,
2688
2690
  spec: r.spec,
2689
2691
  catalog: t.map((d) => ({ ...d, id: d.resolvedField.id }))
2690
- }), i = o ? { ...r, spec: o.spec } : r, a = lr(t), s = cr(t), l = (d) => {
2692
+ }), i = o ? { ...r, spec: o.spec } : r, a = dr(t), s = ur(t), l = (d) => {
2691
2693
  const u = s(d, i.spec.source);
2692
2694
  if (!(!u && d.derivedField)) {
2693
- if (!u) throw new Xi(`Matrix field metadata is unavailable: ${d.name}`);
2695
+ if (!u) throw new na(`Matrix field metadata is unavailable: ${d.name}`);
2694
2696
  return { ...u, ...d.derivedField ? { derivedField: d.derivedField } : {} };
2695
2697
  }
2696
2698
  }, c = {
@@ -2712,18 +2714,18 @@ function ea(e, t, n) {
2712
2714
  };
2713
2715
  return { config: i, fields: c, resolveField: a };
2714
2716
  }
2715
- function ta(e) {
2717
+ function oa(e) {
2716
2718
  const t = e.filter(Boolean);
2717
2719
  if (t.length !== 0)
2718
2720
  return t.length === 1 ? t[0] : {
2719
- id: It(),
2721
+ id: Ct(),
2720
2722
  logicalOperator: "AND",
2721
2723
  negate: !1,
2722
2724
  conditions: [],
2723
2725
  groups: t
2724
2726
  };
2725
2727
  }
2726
- function na(e) {
2728
+ function ia(e) {
2727
2729
  if (!e) return;
2728
2730
  const t = (n) => ({
2729
2731
  logicalOperator: n.logicalOperator,
@@ -2743,12 +2745,12 @@ function na(e) {
2743
2745
  });
2744
2746
  return JSON.stringify(t(e));
2745
2747
  }
2746
- function ra(e, t, n = {}) {
2748
+ function aa(e, t, n = {}) {
2747
2749
  const r = e.metricColumns || [];
2748
2750
  if (r.length === 0) return e;
2749
- const o = dr.includes(
2751
+ const o = fr.includes(
2750
2752
  t
2751
- ), i = ur.includes(
2753
+ ), i = pr.includes(
2752
2754
  t
2753
2755
  ), a = (c) => {
2754
2756
  var d;
@@ -2764,7 +2766,7 @@ function ra(e, t, n = {}) {
2764
2766
  const l = r.map(
2765
2767
  (c) => {
2766
2768
  var f;
2767
- const d = Zr(c);
2769
+ const d = Xr(c);
2768
2770
  if (d === "none")
2769
2771
  return c;
2770
2772
  let u = c;
@@ -2779,43 +2781,43 @@ function ra(e, t, n = {}) {
2779
2781
  metricColumns: l
2780
2782
  } : e;
2781
2783
  }
2782
- function ws(e, t = {}) {
2783
- return pn(mn(e, t));
2784
+ function As(e, t = {}) {
2785
+ return mn(gn(e, t));
2784
2786
  }
2785
- function pn(e) {
2787
+ function mn(e) {
2786
2788
  const t = [e.drill, e.selections, e.zoom, e.search];
2787
- return e.authored ? ao(e.authored, t, It()) : ta(t);
2789
+ return e.authored ? co(e.authored, t, Ct()) : oa(t);
2788
2790
  }
2789
- function mn(e, t = {}) {
2791
+ function gn(e, t = {}) {
2790
2792
  return {
2791
- authored: t.includeAuthoredFilters === !1 ? void 0 : fr(e),
2792
- drill: Fi(t.drill, e.id),
2793
- selections: io(t.selections ?? []),
2793
+ authored: t.includeAuthoredFilters === !1 ? void 0 : mr(e),
2794
+ drill: Ti(t.drill, e.id),
2795
+ selections: lo(t.selections ?? []),
2794
2796
  ...t.zoom ? { zoom: t.zoom } : {}
2795
2797
  };
2796
2798
  }
2797
- function oa(e, t, n) {
2798
- const r = $t(e, t);
2799
- return Te(e) ? ra(
2799
+ function sa(e, t, n) {
2800
+ const r = Jt(e, t);
2801
+ return Te(e) ? aa(
2800
2802
  { ...r, filters: n },
2801
2803
  e.type,
2802
2804
  // A data variable's card keeps its own period comparison (P3b-03).
2803
- { keepsPeriodComparison: Jr(e) }
2805
+ { keepsPeriodComparison: eo(e) }
2804
2806
  ) : r;
2805
2807
  }
2806
- function ia(e) {
2807
- const t = pr(e);
2808
+ function la(e) {
2809
+ const t = gr(e);
2808
2810
  return {
2809
2811
  contextMode: t,
2810
2812
  shouldApplyDashboardFilters: !t || t === "full"
2811
2813
  };
2812
2814
  }
2813
- function aa(e) {
2815
+ function ca(e) {
2814
2816
  const t = e.dashboardControls || [], n = e.card.controls || [], r = /* @__PURE__ */ new Set([
2815
2817
  ...t.map((o) => o.id),
2816
2818
  ...n.map((o) => o.id)
2817
2819
  ]);
2818
- return gn(
2820
+ return yn(
2819
2821
  e.card,
2820
2822
  {
2821
2823
  controlValues: ht({
@@ -2830,7 +2832,7 @@ function aa(e) {
2830
2832
  e.presentationControlIds
2831
2833
  );
2832
2834
  }
2833
- function gn(e, t, n) {
2835
+ function yn(e, t, n) {
2834
2836
  const o = t.controlBindings.filter(
2835
2837
  (f) => !de(f)
2836
2838
  ), i = new Set(
@@ -2862,15 +2864,15 @@ function gn(e, t, n) {
2862
2864
  controlBindings: d
2863
2865
  };
2864
2866
  }
2865
- function sa(e, t) {
2867
+ function da(e, t) {
2866
2868
  return !!t && e.endsWith(t);
2867
2869
  }
2868
- function yn(e, t) {
2870
+ function bn(e, t) {
2869
2871
  return (e ?? []).filter(
2870
- (n) => sa(n.filterId, t)
2872
+ (n) => da(n.filterId, t)
2871
2873
  );
2872
2874
  }
2873
- function bn(e, t, n) {
2875
+ function In(e, t, n) {
2874
2876
  var r;
2875
2877
  if (t)
2876
2878
  return {
@@ -2879,18 +2881,18 @@ function bn(e, t, n) {
2879
2881
  ...n ? { owner: n } : {}
2880
2882
  };
2881
2883
  }
2882
- function la(e) {
2884
+ function ua(e) {
2883
2885
  if (e.resolution.status === "resolved")
2884
- return bn(
2886
+ return In(
2885
2887
  e.card,
2886
2888
  e.resolution.resolvedOwner.selection,
2887
2889
  e.resolution.resolvedOwner.owner
2888
2890
  );
2889
2891
  }
2890
- function ca(e) {
2892
+ function fa(e) {
2891
2893
  return `Set ${e.join(", ")} to run this card.`;
2892
2894
  }
2893
- function da({
2895
+ function pa({
2894
2896
  dashboardInputContext: e,
2895
2897
  shouldApplyDashboardFilters: t
2896
2898
  }) {
@@ -2898,14 +2900,14 @@ function da({
2898
2900
  return e.activeFilters;
2899
2901
  const n = new Set(
2900
2902
  e.inputs.flatMap(
2901
- (r) => r.kind === "filter" && Pt(r) ? [r.filter.id] : []
2903
+ (r) => r.kind === "filter" && wt(r) ? [r.filter.id] : []
2902
2904
  )
2903
2905
  );
2904
2906
  return e.activeFilters.filter(
2905
2907
  (r) => n.has(r.filterId)
2906
2908
  );
2907
2909
  }
2908
- function ua({
2910
+ function ma({
2909
2911
  dashboardInputFilterValues: e,
2910
2912
  adHocFilterValues: t
2911
2913
  }) {
@@ -2917,7 +2919,7 @@ function ua({
2917
2919
  return n;
2918
2920
  }
2919
2921
  function ce(e, t) {
2920
- const n = t.shouldApplyDashboardFilters ? yn(t.adHocFilterValues, t.selectedSheetId) : [], r = t.selectionFilterValues ?? [];
2922
+ const n = t.shouldApplyDashboardFilters ? bn(t.adHocFilterValues, t.selectedSheetId) : [], r = t.selectionFilterValues ?? [];
2921
2923
  if (!t.dashboardInputContext)
2922
2924
  return {
2923
2925
  status: "ready",
@@ -2935,14 +2937,14 @@ function ce(e, t) {
2935
2937
  return u.kind === "filter" && ((f = u.compatibility) == null ? void 0 : f.source) === "cardInlineFilter" ? [u.filter.id] : [];
2936
2938
  }
2937
2939
  )
2938
- ), s = da({
2940
+ ), s = pa({
2939
2941
  dashboardInputContext: t.dashboardInputContext,
2940
2942
  shouldApplyDashboardFilters: t.shouldApplyDashboardFilters
2941
2943
  }).filter((u) => !i.has(u.filterId)), l = s.filter(
2942
2944
  (u) => !a.has(u.filterId)
2943
2945
  ), c = s.filter(
2944
2946
  (u) => a.has(u.filterId)
2945
- ), d = mr({
2947
+ ), d = yr({
2946
2948
  card: e,
2947
2949
  inputs: o,
2948
2950
  resolvedInputs: t.dashboardInputContext.resolvedInputs,
@@ -2955,7 +2957,7 @@ function ce(e, t) {
2955
2957
  } : {
2956
2958
  status: "ready",
2957
2959
  filterValues: [
2958
- ...ua({
2960
+ ...ma({
2959
2961
  dashboardInputFilterValues: [
2960
2962
  ...l,
2961
2963
  ...d.filterValues
@@ -2968,7 +2970,7 @@ function ce(e, t) {
2968
2970
  mappingDispositions: d.dispositions
2969
2971
  };
2970
2972
  }
2971
- function fa(e, t) {
2973
+ function ga(e, t) {
2972
2974
  const n = e.dashboardInputContext;
2973
2975
  if (!n) return [];
2974
2976
  const r = new Set(
@@ -2979,10 +2981,10 @@ function fa(e, t) {
2979
2981
  return n.resolvedInputs.flatMap((i) => {
2980
2982
  if (!i.missingRequiredValue) return [];
2981
2983
  const a = o.get(i.id);
2982
- return a ? a.kind === "filter" && (!e.shouldApplyDashboardFilters && !Pt(a) || r.has(a.id)) ? [] : [i.label] : [];
2984
+ return a ? a.kind === "filter" && (!e.shouldApplyDashboardFilters && !wt(a) || r.has(a.id)) ? [] : [i.label] : [];
2983
2985
  });
2984
2986
  }
2985
- function pa({
2987
+ function ya({
2986
2988
  card: e,
2987
2989
  cardConfig: t,
2988
2990
  input: n,
@@ -2995,7 +2997,7 @@ function pa({
2995
2997
  var p;
2996
2998
  const l = n.dashboardInputContext ? n.dashboardInputContext.inputs.flatMap(
2997
2999
  (b) => b.kind === "filter" ? [b.filter] : []
2998
- ) : [], c = ce(e, n), d = fa(
3000
+ ) : [], c = ce(e, n), d = ga(
2999
3001
  n,
3000
3002
  c.mappingDispositions
3001
3003
  );
@@ -3015,7 +3017,7 @@ function pa({
3015
3017
  mappingDispositions: c.mappingDispositions,
3016
3018
  missingRequiredLabels: []
3017
3019
  };
3018
- const u = Yi({
3020
+ const u = ta({
3019
3021
  card: e,
3020
3022
  cardConfig: t,
3021
3023
  filters: l,
@@ -3033,10 +3035,10 @@ function pa({
3033
3035
  )
3034
3036
  }), f = L(l), m = !!(f && u.cardFilterValues.some(
3035
3037
  (b) => b.filterId === f.id
3036
- )), y = u.resolvedPrimaryDateField && !((p = e.sql) != null && p.trim()) ? u.dateComparisonPlan.inputs.length ? la({
3038
+ )), y = u.resolvedPrimaryDateField && !((p = e.sql) != null && p.trim()) ? u.dateComparisonPlan.inputs.length ? ua({
3037
3039
  card: e,
3038
3040
  resolution: u.dateComparisonPlan.resolution
3039
- }) : m ? bn(
3041
+ }) : m ? In(
3040
3042
  e,
3041
3043
  n.globalDateComparisonSelection
3042
3044
  ) : void 0 : void 0;
@@ -3048,7 +3050,7 @@ function pa({
3048
3050
  mappingDispositions: c.mappingDispositions
3049
3051
  };
3050
3052
  }
3051
- function ma({
3053
+ function ba({
3052
3054
  card: e,
3053
3055
  dashboard: t,
3054
3056
  transientContexts: n,
@@ -3063,17 +3065,17 @@ function ma({
3063
3065
  dashboardInputContext: u,
3064
3066
  includeAuthoredFilters: f
3065
3067
  }) {
3066
- var K, Y, Le, Ke;
3067
- const m = Lt(t);
3068
+ var K, Z, Le, Ke;
3069
+ const m = Kt(t);
3068
3070
  for (const q of e.controlBindings || [])
3069
3071
  de(q) && m.add(q.controlId);
3070
- const { shouldApplyDashboardFilters: y } = ia(n), p = u != null && u.inputs.length ? u : void 0, b = ((u == null ? void 0 : u.selections) ?? []).filter(
3072
+ const { shouldApplyDashboardFilters: y } = la(n), p = u != null && u.inputs.length ? u : void 0, b = ((u == null ? void 0 : u.selections) ?? []).filter(
3071
3073
  (q) => q.status === "apply"
3072
- ), I = mn(e, {
3074
+ ), I = gn(e, {
3073
3075
  includeAuthoredFilters: f,
3074
3076
  selections: b,
3075
3077
  drill: r == null ? void 0 : r.drill
3076
- }), h = {
3078
+ }), C = {
3077
3079
  adHocFilterValues: i || [],
3078
3080
  selectedSheetId: a,
3079
3081
  inlineFilterValues: (s == null ? void 0 : s[e.id]) || [],
@@ -3094,33 +3096,33 @@ function ma({
3094
3096
  ...p != null && p.dateComparisonInputs ? {
3095
3097
  dateComparisonInputs: p.dateComparisonInputs
3096
3098
  } : {}
3097
- }, C = ce(e, h), S = {
3098
- filterValues: C.status === "ready" ? C.filterValues : [],
3099
+ }, h = ce(e, C), S = {
3100
+ filterValues: h.status === "ready" ? h.filterValues : [],
3099
3101
  selectionFilters: I.selections
3100
- }, g = rt(S), V = Mi(r == null ? void 0 : r.zoom, (K = e.config) == null ? void 0 : K.groupByColumns, g), P = gr(
3101
- Ci(e, r == null ? void 0 : r.drill),
3102
- (Y = r == null ? void 0 : r.search) == null ? void 0 : Y.text,
3102
+ }, g = rt(S), V = Pi(r == null ? void 0 : r.zoom, (K = e.config) == null ? void 0 : K.groupByColumns, g), P = br(
3103
+ Di(e, r == null ? void 0 : r.drill),
3104
+ (Z = r == null ? void 0 : r.search) == null ? void 0 : Z.text,
3103
3105
  o
3104
3106
  ), x = {
3105
3107
  ...I,
3106
3108
  ...V ? { zoom: V.filterGroup } : {},
3107
3109
  ...P ? { search: P } : {}
3108
- }, v = V ? rt({ ...S, zoom: V.zoom }) : g, T = pn(x), M = f === !1 ? me(T, !0) : T, k = oa(
3110
+ }, v = V ? rt({ ...S, zoom: V.zoom }) : g, T = mn(x), M = f === !1 ? me(T, !0) : T, k = sa(
3109
3111
  e,
3110
3112
  r == null ? void 0 : r.drill,
3111
3113
  M
3112
- ), F = Ti(k, r == null ? void 0 : r.grainPick, {
3114
+ ), F = ki(k, r == null ? void 0 : r.grainPick, {
3113
3115
  currentFingerprint: v,
3114
3116
  drillActive: (((Le = r == null ? void 0 : r.drill) == null ? void 0 : Le.steps.length) ?? 0) > 0
3115
- }), D = yr({ ...e, config: F }, o) ?? F, w = qt(D, {
3117
+ }), D = Ir({ ...e, config: F }, o) ?? F, w = jt(D, {
3116
3118
  cardType: e.type,
3117
3119
  dataSource: e.dataSource,
3118
- temporalResultOwner: Ct({
3120
+ temporalResultOwner: vt({
3119
3121
  hasExecutableConfig: ue(D, e.type),
3120
3122
  sql: e.sql,
3121
3123
  normalizedPython: Me(e.python || "")
3122
3124
  })
3123
- }) || D, E = na(M) || "", R = p ? gn(
3125
+ }) || D, E = ia(M) || "", R = p ? yn(
3124
3126
  e,
3125
3127
  {
3126
3128
  controlValues: p.controlValues,
@@ -3129,7 +3131,7 @@ function ma({
3129
3131
  controlBindings: p.controlBindings
3130
3132
  },
3131
3133
  m
3132
- ) : aa({
3134
+ ) : ca({
3133
3135
  card: e,
3134
3136
  presentationControlIds: m,
3135
3137
  dashboardControls: l,
@@ -3137,11 +3139,11 @@ function ma({
3137
3139
  cardControlValues: d == null ? void 0 : d[e.id]
3138
3140
  });
3139
3141
  return {
3140
- filterCompilationInput: h,
3142
+ filterCompilationInput: C,
3141
3143
  ...R,
3142
3144
  resolvedFilters: M,
3143
3145
  resolvedFilterParts: x,
3144
- drillSteps: ((Ke = r == null ? void 0 : r.drill) == null ? void 0 : Ke.steps) ?? br,
3146
+ drillSteps: ((Ke = r == null ? void 0 : r.drill) == null ? void 0 : Ke.steps) ?? Cr,
3145
3147
  dateContextKey: v,
3146
3148
  zoomContextKey: g,
3147
3149
  ...V ? { activeZoom: V.zoom } : {},
@@ -3150,8 +3152,8 @@ function ma({
3150
3152
  finalFiltersKey: E
3151
3153
  };
3152
3154
  }
3153
- function In(e, t, n) {
3154
- const r = pa({
3155
+ function Cn(e, t, n) {
3156
+ const r = ya({
3155
3157
  resolvedFields: t.resolvedDateFields,
3156
3158
  ...n,
3157
3159
  card: e,
@@ -3170,8 +3172,8 @@ function In(e, t, n) {
3170
3172
  dateComparisonInputs: o.dateComparisonInputs
3171
3173
  }, compiledFilters: r };
3172
3174
  }
3173
- function ga(e, t, n) {
3174
- const r = Ir(e), o = In(e, t, {
3175
+ function Ia(e, t, n) {
3176
+ const r = hr(e), o = Cn(e, t, {
3175
3177
  resolvedPrimaryDateField: n.resolvedPrimaryDateField,
3176
3178
  timezone: n.calendarContext.tz,
3177
3179
  allowMinutePrecision: n.allowGlobalDateMinutePrecision
@@ -3182,12 +3184,12 @@ function ga(e, t, n) {
3182
3184
  cardFilterValues: a,
3183
3185
  resolvedPrimaryDateField: s,
3184
3186
  globalDateComparison: l
3185
- } = i, { queryKey: c, queryInputIdentity: d, paginationConfig: u } = ai(
3187
+ } = i, { queryKey: c, queryInputIdentity: d, paginationConfig: u } = ci(
3186
3188
  e,
3187
3189
  o.queryContext,
3188
3190
  n.calendarContext,
3189
3191
  { resolvePaginationConfig: n.resolvePaginationConfig }
3190
- ), f = t.queryRelevantConfig, m = Me(e.python || ""), y = Ct({
3192
+ ), f = t.queryRelevantConfig, m = Me(e.python || ""), y = vt({
3191
3193
  hasExecutableConfig: ue(f, e.type),
3192
3194
  sql: e.sql,
3193
3195
  normalizedPython: m
@@ -3223,25 +3225,25 @@ function ga(e, t, n) {
3223
3225
  }
3224
3226
  };
3225
3227
  }
3226
- const lt = [], ya = [], ba = {};
3227
- function Os(e, t) {
3228
+ const lt = [], Ca = [], ha = {};
3229
+ function Bs(e, t) {
3228
3230
  return {
3229
3231
  sheetId: e.sheetId,
3230
3232
  sectionId: e.sectionId,
3231
3233
  documentFilterValues: e.documentFilterValues ?? lt,
3232
- documentControlDefinitions: e.documentControlDefinitions ?? ya,
3233
- documentControlValues: e.documentControlValues ?? ba,
3234
+ documentControlDefinitions: e.documentControlDefinitions ?? Ca,
3235
+ documentControlValues: e.documentControlValues ?? ha,
3234
3236
  editorFilterValues: t ?? lt
3235
3237
  };
3236
3238
  }
3237
- function Ia({
3239
+ function va({
3238
3240
  card: e,
3239
3241
  dashboard: t,
3240
3242
  runtime: n,
3241
3243
  dashboardRuntimeValues: r,
3242
3244
  calendar: o
3243
3245
  }) {
3244
- const i = vt({
3246
+ const i = Ft({
3245
3247
  dashboard: t,
3246
3248
  dashboardInputValues: r.dashboardInputValues,
3247
3249
  transientContexts: void 0
@@ -3262,7 +3264,7 @@ function Ia({
3262
3264
  ...n.documentFilterValues
3263
3265
  ];
3264
3266
  return {
3265
- card: s ? e : ha(
3267
+ card: s ? e : Fa(
3266
3268
  e,
3267
3269
  n.documentControlDefinitions
3268
3270
  ),
@@ -3280,7 +3282,7 @@ function Ia({
3280
3282
  dashboardInputContext: a
3281
3283
  };
3282
3284
  }
3283
- function ha(e, t) {
3285
+ function Fa(e, t) {
3284
3286
  if (t.length === 0)
3285
3287
  return e;
3286
3288
  const n = /* @__PURE__ */ new Map();
@@ -3293,11 +3295,12 @@ function ha(e, t) {
3293
3295
  controls: Array.from(n.values())
3294
3296
  };
3295
3297
  }
3296
- function _s({
3298
+ function Es({
3297
3299
  card: e,
3298
3300
  place: t,
3299
3301
  source: n
3300
3302
  }) {
3303
+ ({ card: e, place: t, source: n } = hn(e, t, n));
3301
3304
  const r = Se(e, t, n);
3302
3305
  return {
3303
3306
  card: r.card,
@@ -3305,9 +3308,9 @@ function _s({
3305
3308
  inputContext: r.inputContext
3306
3309
  };
3307
3310
  }
3308
- function Ca(e, t, n) {
3311
+ function Da(e, t, n) {
3309
3312
  return {
3310
- calendarContext: n ?? to,
3313
+ calendarContext: n ?? oo,
3311
3314
  allowGlobalDateMinutePrecision: we(
3312
3315
  e,
3313
3316
  t
@@ -3316,17 +3319,17 @@ function Ca(e, t, n) {
3316
3319
  globalCacheConfig: e.globalCacheConfig
3317
3320
  };
3318
3321
  }
3319
- function As(e, t) {
3320
- return vn(
3322
+ function Rs(e, t) {
3323
+ return Dn(
3321
3324
  e,
3322
3325
  t,
3323
3326
  t.allowGlobalDateMinutePrecision
3324
3327
  );
3325
3328
  }
3326
- function va(e, t, n = {}) {
3327
- const r = Cn(e, t);
3329
+ function Sa(e, t, n = {}) {
3330
+ const r = Fn(e, t);
3328
3331
  return {
3329
- ...ga(e.card, e.context, {
3332
+ ...Ia(e.card, e.context, {
3330
3333
  resolvedPrimaryDateField: r,
3331
3334
  calendarContext: t.calendarContext,
3332
3335
  allowGlobalDateMinutePrecision: t.allowGlobalDateMinutePrecision,
@@ -3336,7 +3339,7 @@ function va(e, t, n = {}) {
3336
3339
  resolvedPrimaryDateField: r
3337
3340
  };
3338
3341
  }
3339
- function Fa({
3342
+ function Ta({
3340
3343
  card: e,
3341
3344
  place: t,
3342
3345
  source: n,
@@ -3345,35 +3348,36 @@ function Fa({
3345
3348
  withRequest: i = !1
3346
3349
  }) {
3347
3350
  var p, b;
3348
- const { dashboard: a } = n, s = e.id, l = (I, h) => {
3351
+ ({ card: e, place: t, source: n } = hn(e, t, n));
3352
+ const { dashboard: a } = n, s = e.id, l = (I, C) => {
3349
3353
  var S;
3350
- let C;
3354
+ let h;
3351
3355
  try {
3352
3356
  const g = Ve(I);
3353
3357
  if (g.status === "invalid") throw g.error;
3354
3358
  const V = Se(
3355
3359
  I,
3356
- h,
3360
+ C,
3357
3361
  n,
3358
3362
  g.status === "absent"
3359
3363
  );
3360
- if (C = V.context, g.status === "absent")
3364
+ if (h = V.context, g.status === "absent")
3361
3365
  return { status: "ready", value: { assembled: V } };
3362
3366
  if (!o)
3363
3367
  return {
3364
3368
  status: "blocked",
3365
3369
  reason: "metadata",
3366
3370
  message: "Matrix field metadata is required.",
3367
- context: C
3371
+ context: h
3368
3372
  };
3369
- const P = hi(g.config.spec, C), x = o.filter(
3373
+ const P = Fi(g.config.spec, h), x = o.filter(
3370
3374
  (D) => D.field.source && P.some(
3371
- (w) => he(w, D.field.source)
3375
+ (w) => Ce(w, D.field.source)
3372
3376
  )
3373
- ), v = ea(I, x, C), { params: T } = V, M = T.dashboardInputContext;
3377
+ ), v = ra(I, x, h), { params: T } = V, M = T.dashboardInputContext;
3374
3378
  v.config = {
3375
3379
  ...v.config,
3376
- presentation: Ho(
3380
+ presentation: $o(
3377
3381
  I,
3378
3382
  v.config,
3379
3383
  {
@@ -3395,7 +3399,7 @@ function Fa({
3395
3399
  const k = {
3396
3400
  ...I,
3397
3401
  config: { matrix: v.config }
3398
- }, F = Se(k, h, n, !1);
3402
+ }, F = Se(k, C, n, !1);
3399
3403
  return {
3400
3404
  status: "ready",
3401
3405
  value: {
@@ -3412,7 +3416,7 @@ function Fa({
3412
3416
  status: "blocked",
3413
3417
  reason: "configuration",
3414
3418
  message: g instanceof Error ? g.message : "Card configuration is invalid.",
3415
- context: C
3419
+ context: h
3416
3420
  };
3417
3421
  }
3418
3422
  }, c = l(e, t);
@@ -3425,22 +3429,22 @@ function Fa({
3425
3429
  missingRequiredLabels: [],
3426
3430
  message: c.message
3427
3431
  };
3428
- const { assembled: d, matrix: u } = c.value, f = Ca(
3432
+ const { assembled: d, matrix: u } = c.value, f = Da(
3429
3433
  a,
3430
3434
  r,
3431
3435
  n.calendar
3432
- ), m = d.context.filterCompilationInput, y = hr(a);
3436
+ ), m = d.context.filterCompilationInput, y = vr(a);
3433
3437
  try {
3434
- const I = ce(d.card, m), h = u && y && I.status === "ready" && I.filterValues.some((V) => V.filterId === y.id);
3435
- let C = f.allowGlobalDateMinutePrecision;
3436
- if (h) {
3438
+ const I = ce(d.card, m), C = u && y && I.status === "ready" && I.filterValues.some((V) => V.filterId === y.id);
3439
+ let h = f.allowGlobalDateMinutePrecision;
3440
+ if (C) {
3437
3441
  const V = (p = m.dashboardInputContext) == null ? void 0 : p.inputs.find(
3438
3442
  (F) => F.kind === "filter" && F.filter.id === y.id
3439
- ), x = Cr(a, y).filter(
3440
- ({ card: F, sheet: D }) => !V || Yr(V, {
3443
+ ), x = Fr(a, y).filter(
3444
+ ({ card: F, sheet: D }) => !V || to(V, {
3441
3445
  cardId: F.id,
3442
3446
  sheetId: D.id,
3443
- sheetKind: Ft(D) ? "document" : "dashboard"
3447
+ sheetKind: Dt(D) ? "document" : "dashboard"
3444
3448
  })
3445
3449
  ).map(({ card: F, sheet: D }) => ({
3446
3450
  card: F,
@@ -3468,7 +3472,7 @@ function Fa({
3468
3472
  R,
3469
3473
  E.filterCompilationInput
3470
3474
  );
3471
- return K.status === "blocked" || K.filterValues.some((Y) => Y.filterId === y.id) ? [w] : [];
3475
+ return K.status === "blocked" || K.filterValues.some((Z) => Z.filterId === y.id) ? [w] : [];
3472
3476
  } catch {
3473
3477
  return v.set(w, null), [w];
3474
3478
  }
@@ -3490,9 +3494,9 @@ function Fa({
3490
3494
  missingRequiredLabels: [],
3491
3495
  message: `Date precision requires field metadata and valid inputs for: ${k.unresolvedCardIds.join(", ")}.`
3492
3496
  };
3493
- C = k.allEligibleTargetsAreDateTime;
3497
+ h = k.allEligibleTargetsAreDateTime;
3494
3498
  }
3495
- const S = vn(d, f, C);
3499
+ const S = Dn(d, f, h);
3496
3500
  if (S.status === "blocked")
3497
3501
  return {
3498
3502
  status: "blocked",
@@ -3500,10 +3504,10 @@ function Fa({
3500
3504
  mappingDispositions: S.mappingDispositions,
3501
3505
  reason: S.reason,
3502
3506
  missingRequiredLabels: S.missingRequiredLabels,
3503
- ...S.reason === "requiredInput" ? { message: ca(S.missingRequiredLabels) } : {},
3507
+ ...S.reason === "requiredInput" ? { message: fa(S.missingRequiredLabels) } : {},
3504
3508
  ...S.resolvedPrimaryDateField ? { resolvedPrimaryDateField: S.resolvedPrimaryDateField } : {}
3505
3509
  };
3506
- const g = i && !u ? va(d, f) : void 0;
3510
+ const g = i && !u ? Sa(d, f) : void 0;
3507
3511
  return {
3508
3512
  ...S,
3509
3513
  ...u ? { matrix: u } : {},
@@ -3513,11 +3517,11 @@ function Fa({
3513
3517
  ...(g == null ? void 0 : g.status) === "ready" ? {
3514
3518
  request: {
3515
3519
  ...g.requestPayloadBase,
3516
- ...pi({
3520
+ ...yi({
3517
3521
  card: d.card,
3518
3522
  finalConfig: d.context.finalConfig,
3519
3523
  documentSection: t.kind === "documentSection" ? {} : void 0,
3520
- page: fi(d.card)
3524
+ page: gi(d.card)
3521
3525
  })
3522
3526
  }
3523
3527
  } : {}
@@ -3533,7 +3537,25 @@ function Fa({
3533
3537
  };
3534
3538
  }
3535
3539
  }
3536
- function Da(e, t) {
3540
+ function hn(e, t, n) {
3541
+ var s, l, c;
3542
+ const r = ((s = n.editor) == null ? void 0 : s.calculatedFields) ?? n.dashboard.calculatedFields;
3543
+ if (!(r != null && r.length)) return { card: e, place: t, source: n };
3544
+ const o = (d) => Dr(d, r), i = {
3545
+ ...n,
3546
+ dashboard: yt(n.dashboard, r),
3547
+ adHocFilterValues: o(n.adHocFilterValues),
3548
+ inlineFilterValuesMap: o(n.inlineFilterValuesMap),
3549
+ dashboardInputValues: o(n.dashboardInputValues),
3550
+ ...n.editor ? { editor: { ...n.editor, inlineFilterValuesMap: o(n.editor.inlineFilterValuesMap) } } : {}
3551
+ }, a = i.dashboard === n.dashboard && i.adHocFilterValues === n.adHocFilterValues && i.inlineFilterValuesMap === n.inlineFilterValuesMap && i.dashboardInputValues === n.dashboardInputValues && ((l = i.editor) == null ? void 0 : l.inlineFilterValuesMap) === ((c = n.editor) == null ? void 0 : c.inlineFilterValuesMap);
3552
+ return {
3553
+ card: o(e),
3554
+ place: t.kind === "documentSection" ? { ...t, section: o(t.section) } : t,
3555
+ source: a ? n : i
3556
+ };
3557
+ }
3558
+ function Va(e, t) {
3537
3559
  const n = e.editor ? {
3538
3560
  ...e.inlineFilterValuesMap,
3539
3561
  ...Object.fromEntries(
@@ -3541,7 +3563,7 @@ function Da(e, t) {
3541
3563
  (a) => a[1] !== void 0
3542
3564
  )
3543
3565
  )
3544
- } : e.inlineFilterValuesMap, r = n == null ? void 0 : n[t.id], o = vr(t, r), i = o === r ? n : { ...n, [t.id]: o };
3566
+ } : e.inlineFilterValuesMap, r = n == null ? void 0 : n[t.id], o = Sr(t, r), i = o === r ? n : { ...n, [t.id]: o };
3545
3567
  return {
3546
3568
  dashboardInputValues: e.dashboardInputValues,
3547
3569
  adHocFilterValues: e.adHocFilterValues,
@@ -3552,8 +3574,8 @@ function Da(e, t) {
3552
3574
  }
3553
3575
  function Se(e, t, n, r) {
3554
3576
  var c, d;
3555
- const { dashboard: o } = n, i = Da(n, e), a = t.kind === "documentSection" ? {
3556
- ...Ia({
3577
+ const { dashboard: o } = n, i = Va(n, e), a = t.kind === "documentSection" ? {
3578
+ ...va({
3557
3579
  card: e,
3558
3580
  dashboard: o,
3559
3581
  runtime: t.section,
@@ -3562,20 +3584,20 @@ function Se(e, t, n, r) {
3562
3584
  }),
3563
3585
  selectedSheetId: t.section.sheetId,
3564
3586
  includeAuthoredFilters: r
3565
- } : Sa(e, t.sheetId, n, i, r), s = ma(a), l = (c = e.config) == null ? void 0 : c.rowLimit;
3566
- return (d = e.sql) != null && d.trim() && l && hn(o, e.id) && (s.sqlRowLimit = l), {
3587
+ } : Ma(e, t.sheetId, n, i, r), s = ba(a), l = (c = e.config) == null ? void 0 : c.rowLimit;
3588
+ return (d = e.sql) != null && d.trim() && l && vn(o, e.id) && (s.sqlRowLimit = l), {
3567
3589
  card: a.card,
3568
3590
  params: a,
3569
3591
  context: s,
3570
3592
  inputContext: a.dashboardInputContext
3571
3593
  };
3572
3594
  }
3573
- function hn(e, t) {
3595
+ function vn(e, t) {
3574
3596
  return (e.variables ?? []).some((n) => n.id === t);
3575
3597
  }
3576
- function Sa(e, t, n, r, o) {
3598
+ function Ma(e, t, n, r, o) {
3577
3599
  var c, d, u;
3578
- const { dashboard: i } = n, a = hn(i, e.id), s = a ? void 0 : n.transientContexts, l = vt({
3600
+ const { dashboard: i } = n, a = vn(i, e.id), s = a ? void 0 : n.transientContexts, l = Ft({
3579
3601
  dashboard: i,
3580
3602
  dashboardInputValues: r.dashboardInputValues,
3581
3603
  transientContexts: s
@@ -3594,8 +3616,8 @@ function Sa(e, t, n, r, o) {
3594
3616
  // The editor previews the card without a viewer's zoom (chart date zoom
3595
3617
  // DZ-D1) or search (table column filters TCF-D10): it shows the
3596
3618
  // dashboard's dates and every row, and its save never sees either.
3597
- cardViewState: a ? void 0 : n.editor ? Fr(
3598
- Dr((c = n.cardViewStates) == null ? void 0 : c[e.id], null),
3619
+ cardViewState: a ? void 0 : n.editor ? Tr(
3620
+ Vr((c = n.cardViewStates) == null ? void 0 : c[e.id], null),
3599
3621
  null
3600
3622
  ) : (d = n.cardViewStates) == null ? void 0 : d[e.id],
3601
3623
  viewerTableSettings: n.editor || a || (u = n.viewerTableSettings) == null ? void 0 : u[e.id],
@@ -3610,16 +3632,16 @@ function Sa(e, t, n, r, o) {
3610
3632
  includeAuthoredFilters: o
3611
3633
  };
3612
3634
  }
3613
- function Cn({ card: e, context: t }, n) {
3614
- return bt({
3635
+ function Fn({ card: e, context: t }, n) {
3636
+ return It({
3615
3637
  card: e,
3616
3638
  cardConfig: t.queryRelevantConfig,
3617
3639
  resolvedFields: t.resolvedDateFields,
3618
3640
  semanticExecutionPayload: n.semanticExecutionPayload
3619
3641
  });
3620
3642
  }
3621
- function vn(e, t, n) {
3622
- const { card: r } = e, o = Cn(e, t), i = In(r, e.context, {
3643
+ function Dn(e, t, n) {
3644
+ const { card: r } = e, o = Fn(e, t), i = Cn(r, e.context, {
3623
3645
  resolvedPrimaryDateField: o,
3624
3646
  timezone: t.calendarContext.tz,
3625
3647
  allowMinutePrecision: n
@@ -3632,7 +3654,7 @@ function vn(e, t, n) {
3632
3654
  resolvedPrimaryDateField: o
3633
3655
  };
3634
3656
  }
3635
- function Bs({
3657
+ function qs({
3636
3658
  dashboard: e,
3637
3659
  dashboardInputValues: t,
3638
3660
  adHocFilterValues: n,
@@ -3644,37 +3666,37 @@ function Bs({
3644
3666
  semanticExecutionPayload: l,
3645
3667
  timezone: c
3646
3668
  }) {
3647
- const d = e ? [...Sr(e)] : void 0, u = o ?? null, f = (h) => {
3648
- var C;
3649
- return e ? Ma({
3669
+ const d = e ? [...Mr(e)] : void 0, u = o ?? null, f = (C) => {
3670
+ var h;
3671
+ return e ? Pa({
3650
3672
  dashboard: e,
3651
3673
  runtimeValues: { dashboardInputValues: t },
3652
3674
  adHocFilterValues: n,
3653
- sheetId: h,
3654
- sheetKind: Ft(
3655
- (C = e.sheets) == null ? void 0 : C.find((S) => S.id === h)
3675
+ sheetId: C,
3676
+ sheetKind: Dt(
3677
+ (h = e.sheets) == null ? void 0 : h.find((S) => S.id === C)
3656
3678
  ) ? "document" : "dashboard",
3657
3679
  calendar: r
3658
3680
  }) : [];
3659
3681
  }, m = i === "all" ? Array.from(
3660
3682
  new Map(
3661
3683
  ((e == null ? void 0 : e.sheets) || []).flatMap(
3662
- (h) => f(h.id).map(
3663
- (C) => [C.filterId, C]
3684
+ (C) => f(C.id).map(
3685
+ (h) => [h.filterId, h]
3664
3686
  )
3665
3687
  )
3666
3688
  ).values()
3667
3689
  ) : f(u), y = {
3668
3690
  ...a || {}
3669
- }, p = i === "all" ? j({ sheets: (e == null ? void 0 : e.sheets) || [] }) : u ? j({ sheets: (e == null ? void 0 : e.sheets) || [] }).filter(
3670
- (h) => h.sheet.id === u
3691
+ }, p = i === "all" ? N({ sheets: (e == null ? void 0 : e.sheets) || [] }) : u ? N({ sheets: (e == null ? void 0 : e.sheets) || [] }).filter(
3692
+ (C) => C.sheet.id === u
3671
3693
  ) : [];
3672
- for (const h of p)
3673
- Object.assign(y, (s == null ? void 0 : s[h.card.id]) || {});
3674
- const b = Tr({
3694
+ for (const C of p)
3695
+ Object.assign(y, (s == null ? void 0 : s[C.card.id]) || {});
3696
+ const b = kr({
3675
3697
  filterDefinitions: d,
3676
3698
  filterValues: m
3677
- }), I = $i({
3699
+ }), I = Yi({
3678
3700
  filters: d,
3679
3701
  filterValues: b,
3680
3702
  dashboard: e,
@@ -3687,7 +3709,7 @@ function Bs({
3687
3709
  controlValues: y
3688
3710
  };
3689
3711
  }
3690
- function Es({
3712
+ function js({
3691
3713
  dashboard: e,
3692
3714
  cardId: t,
3693
3715
  transientContexts: n,
@@ -3711,12 +3733,12 @@ function Es({
3711
3733
  if (!e)
3712
3734
  return null;
3713
3735
  m && !$e(e, t) && y && (e = { ...e, sheets: (S = e.sheets) == null ? void 0 : S.map((g) => g.id === y ? { ...g, cards: [...g.cards ?? [], m] } : g) });
3714
- const h = $e(e, t);
3715
- if (!h)
3736
+ const C = $e(e, t);
3737
+ if (!C)
3716
3738
  return null;
3717
- const C = Fa({
3718
- card: m ?? h.card,
3719
- place: p ? { kind: "documentSection", section: p } : { kind: "sheet", sheetId: h.sheet.id },
3739
+ const h = Ta({
3740
+ card: m ?? C.card,
3741
+ place: p ? { kind: "documentSection", section: p } : { kind: "sheet", sheetId: C.sheet.id },
3720
3742
  source: {
3721
3743
  dashboard: e,
3722
3744
  adHocFilterValues: a,
@@ -3738,30 +3760,30 @@ function Es({
3738
3760
  matrixCatalog: f,
3739
3761
  withRequest: I
3740
3762
  });
3741
- return C.status === "blocked" ? C : {
3763
+ return h.status === "blocked" ? h : {
3742
3764
  status: "ready",
3743
- card: m ?? h.card,
3744
- sheetId: h.sheet.id,
3745
- queryContext: C.queryContext,
3746
- compiledFilters: C.compiledFilters,
3747
- resolvedPrimaryDateField: C.resolvedPrimaryDateField,
3748
- ...C.matrix ? { matrix: C.matrix } : {},
3749
- ...C.request ? { request: C.request } : {}
3765
+ card: m ?? C.card,
3766
+ sheetId: C.sheet.id,
3767
+ queryContext: h.queryContext,
3768
+ compiledFilters: h.compiledFilters,
3769
+ resolvedPrimaryDateField: h.resolvedPrimaryDateField,
3770
+ ...h.matrix ? { matrix: h.matrix } : {},
3771
+ ...h.request ? { request: h.request } : {}
3750
3772
  };
3751
3773
  }
3752
- function Ta(e, t, n) {
3753
- const r = t === "date" && "relativeMeta" in e ? qr(e.relativeMeta) : void 0;
3774
+ function ka(e, t, n) {
3775
+ const r = t === "date" && "relativeMeta" in e ? zr(e.relativeMeta) : void 0;
3754
3776
  if (!r) return { values: e.values };
3755
- const o = xr(r, n ?? void 0), i = Nr(String(e.operation), r);
3777
+ const o = Or(r, n ?? void 0), i = Lr(String(e.operation), r);
3756
3778
  return {
3757
- values: o && i ? jr(String(e.operation), o) : e.values,
3779
+ values: o && i ? Kr(String(e.operation), o) : e.values,
3758
3780
  relativeMeta: r,
3759
3781
  ..."temporalPrecision" in e && e.temporalPrecision === "minute" ? { temporalPrecision: "minute" } : {}
3760
3782
  };
3761
3783
  }
3762
- function Va(e, t, n) {
3763
- const r = t, o = Mr(e);
3764
- return kr({
3784
+ function xa(e, t, n) {
3785
+ const r = t, o = Pr(e);
3786
+ return wr({
3765
3787
  definition: e,
3766
3788
  sourceValue: r,
3767
3789
  value: {
@@ -3772,16 +3794,16 @@ function Va(e, t, n) {
3772
3794
  dataType: e.dataType,
3773
3795
  fieldMeta: e.fieldMeta,
3774
3796
  semanticContext: e.semanticContext,
3775
- ...Ta(r, o, n)
3797
+ ...ka(r, o, n)
3776
3798
  }
3777
3799
  });
3778
3800
  }
3779
- function Fn(e, t, n) {
3801
+ function Sn(e, t, n) {
3780
3802
  const r = A(e);
3781
3803
  let o = {};
3782
3804
  const i = [], a = [];
3783
3805
  for (const s of t ?? []) {
3784
- if (eo(s.filterId)) {
3806
+ if (ro(s.filterId)) {
3785
3807
  a.push(s.filterId);
3786
3808
  continue;
3787
3809
  }
@@ -3790,16 +3812,16 @@ function Fn(e, t, n) {
3790
3812
  a.push(s.filterId);
3791
3813
  continue;
3792
3814
  }
3793
- const d = Vr(
3794
- Va(c.filter, s, n.calendar)
3815
+ const d = xr(
3816
+ xa(c.filter, s, n.calendar)
3795
3817
  );
3796
3818
  if (d) {
3797
3819
  if (c.runtimeScope === "shared") {
3798
3820
  o = He(o, c, {}, d);
3799
3821
  continue;
3800
3822
  }
3801
- for (const u of wt(e).values())
3802
- Ot(c, u) && (o = He(
3823
+ for (const u of Ot(e).values())
3824
+ _t(c, u) && (o = He(
3803
3825
  o,
3804
3826
  c,
3805
3827
  { sheetId: u.sheetId },
@@ -3809,11 +3831,11 @@ function Fn(e, t, n) {
3809
3831
  }
3810
3832
  return { slots: o, adHocFilterValues: i, droppedFilterIds: a };
3811
3833
  }
3812
- function Ma(e) {
3834
+ function Pa(e) {
3813
3835
  const { dashboard: t, sheetId: n } = e, r = [];
3814
3836
  if (n)
3815
- for (const { input: o } of Pr(t, n, e.sheetKind)) {
3816
- const i = wr({
3837
+ for (const { input: o } of _r(t, n, e.sheetKind)) {
3838
+ const i = Ar({
3817
3839
  dashboard: t,
3818
3840
  input: o,
3819
3841
  runtimeValues: { dashboardInputValues: e.runtimeValues.dashboardInputValues },
@@ -3822,14 +3844,14 @@ function Ma(e) {
3822
3844
  });
3823
3845
  i.kind === "filter" && i.filterValue && r.push(i.filterValue);
3824
3846
  }
3825
- return [...r, ...yn(e.adHocFilterValues, n)];
3847
+ return [...r, ...bn(e.adHocFilterValues, n)];
3826
3848
  }
3827
- function Rs(e, t) {
3849
+ function Ns(e, t) {
3828
3850
  switch (t.runtimeScope) {
3829
3851
  case "shared":
3830
3852
  return [{}];
3831
3853
  case "perSheet":
3832
- return [...wt(e).values()].filter((n) => Ot(t, n)).map((n) => ({ sheetId: n.sheetId }));
3854
+ return [...Ot(e).values()].filter((n) => _t(t, n)).map((n) => ({ sheetId: n.sheetId }));
3833
3855
  case "perCard": {
3834
3856
  const n = A(e);
3835
3857
  return [
@@ -3856,22 +3878,22 @@ function ct(e) {
3856
3878
  ...e.cards ?? [],
3857
3879
  ...(e.frames ?? []).flatMap((n) => n.cards),
3858
3880
  ...(((t = e.document) == null ? void 0 : t.sections) ?? []).flatMap(
3859
- (n) => _t(n)
3881
+ (n) => At(n)
3860
3882
  )
3861
3883
  ];
3862
3884
  }
3863
- function ka(e, t) {
3885
+ function wa(e, t) {
3864
3886
  var n, r;
3865
3887
  return {
3866
3888
  sheetId: e.id,
3867
3889
  cardId: t.id,
3868
3890
  sheetKind: e.kind ?? "dashboard",
3869
3891
  sectionId: (r = (n = e.document) == null ? void 0 : n.sections.find(
3870
- (o) => _t(o).some(({ id: i }) => i === t.id)
3892
+ (o) => At(o).some(({ id: i }) => i === t.id)
3871
3893
  )) == null ? void 0 : r.id
3872
3894
  };
3873
3895
  }
3874
- function xa(e, t, n, r) {
3896
+ function Oa(e, t, n, r) {
3875
3897
  var c, d, u;
3876
3898
  const o = {}, i = (c = e.preferences) == null ? void 0 : c.textVisualOptions;
3877
3899
  if (!i) return o;
@@ -3879,7 +3901,7 @@ function xa(e, t, n, r) {
3879
3901
  // Authoring: carried drill context never applies to a dashboard being edited.
3880
3902
  transientContexts: void 0,
3881
3903
  dashboard: n,
3882
- ...ka(r, t),
3904
+ ...wa(r, t),
3883
3905
  card: t,
3884
3906
  runtimeValues: {},
3885
3907
  // Aliases only: no input value is read.
@@ -3893,7 +3915,7 @@ function xa(e, t, n, r) {
3893
3915
  } : f;
3894
3916
  return m && (o[f.variableName] = y), y;
3895
3917
  }, l = (f) => {
3896
- Object.assign(f, Mt(f, (m) => s(m))), f.type === "link" && [...f.children, ...Array.isArray(f.url) ? f.url : []].forEach((m) => l(m)), f.type === "when" && [...f.then ?? [], ...f.else ?? []].forEach(l);
3918
+ Object.assign(f, kt(f, (m) => s(m))), f.type === "link" && [...f.children, ...Array.isArray(f.url) ? f.url : []].forEach((m) => l(m)), f.type === "when" && [...f.then ?? [], ...f.else ?? []].forEach(l);
3897
3919
  };
3898
3920
  return (d = i.content) == null || d.forEach((f) => {
3899
3921
  f.type === "variable" && (f.ref = s(f.ref));
@@ -3901,7 +3923,7 @@ function xa(e, t, n, r) {
3901
3923
  f.type === "list" ? f.items.forEach((m) => m.forEach(l)) : f.children.forEach(l);
3902
3924
  }), o;
3903
3925
  }
3904
- function Pa(e, t) {
3926
+ function _a(e, t) {
3905
3927
  var i;
3906
3928
  const n = ct(e);
3907
3929
  if (!n.some((a) => {
@@ -3911,7 +3933,7 @@ function Pa(e, t) {
3911
3933
  return e;
3912
3934
  const r = oe(e), o = ct(r);
3913
3935
  for (let a = 0; a < o.length; a++) {
3914
- const s = xa(
3936
+ const s = Oa(
3915
3937
  o[a],
3916
3938
  n[a],
3917
3939
  t,
@@ -3919,130 +3941,130 @@ function Pa(e, t) {
3919
3941
  );
3920
3942
  (i = e.frames) != null && i.some(
3921
3943
  (l) => l.visualId && l.cards.some((c) => c.id === o[a].id)
3922
- ) && (o[a].linkedReferenceOverrides = Fo(
3944
+ ) && (o[a].linkedReferenceOverrides = To(
3923
3945
  o[a].linkedReferenceOverrides,
3924
3946
  { inputAliases: s }
3925
3947
  ));
3926
3948
  }
3927
3949
  return r;
3928
3950
  }
3929
- function wa(e) {
3951
+ function Aa(e) {
3930
3952
  var n;
3931
3953
  const t = (n = e.sheets) == null ? void 0 : n.map(
3932
- (r) => Pa(r, e)
3954
+ (r) => _a(r, e)
3933
3955
  );
3934
3956
  return t && t.some((r, o) => r !== e.sheets[o]) ? { ...e, sheets: t } : e;
3935
3957
  }
3936
- function Oa(e) {
3958
+ function Ba(e) {
3937
3959
  const t = A(e);
3938
3960
  return t.issues.length === 0 && !t.needsUpgrade ? e : t.issues.length ? t.toStoredDashboard() : A(
3939
- wa(e)
3961
+ Aa(e)
3940
3962
  ).toStoredDashboard();
3941
3963
  }
3942
3964
  export {
3943
- ka as $,
3944
- sa as A,
3945
- yn as B,
3946
- Fo as C,
3947
- Za as D,
3948
- wo as E,
3949
- bi as F,
3965
+ wa as $,
3966
+ da as A,
3967
+ bn as B,
3968
+ To as C,
3969
+ Xa as D,
3970
+ Ao as E,
3971
+ hi as F,
3950
3972
  nt as G,
3951
- No as H,
3952
- qo as I,
3953
- Eo as J,
3954
- es as K,
3955
- Do as L,
3956
- zt as M,
3973
+ Lo as H,
3974
+ zo as I,
3975
+ jo as J,
3976
+ rs as K,
3977
+ Vo as L,
3978
+ Lt as M,
3957
3979
  Fe as N,
3958
- Lo as O,
3980
+ Ho as O,
3959
3981
  z as P,
3960
- Go as Q,
3982
+ Qo as Q,
3961
3983
  Re as R,
3962
3984
  Ee as S,
3963
- so as T,
3964
- ts as U,
3965
- os as V,
3966
- jo as W,
3967
- Ya as X,
3968
- As as Y,
3969
- Ca as Z,
3985
+ uo as T,
3986
+ os as U,
3987
+ ss as V,
3988
+ Ko as W,
3989
+ ts as X,
3990
+ Rs as Y,
3991
+ Da as Z,
3970
3992
  ct as _,
3971
- Li as a,
3972
- xa as a0,
3973
- Pa as a1,
3974
- Ss as a2,
3975
- Fs as a3,
3976
- Zt as a4,
3977
- Ds as a5,
3978
- Zo as a6,
3979
- ca as a7,
3980
- Bs as a8,
3981
- oa as a9,
3993
+ Hi as a,
3994
+ Oa as a0,
3995
+ _a as a1,
3996
+ Ms as a2,
3997
+ Ts as a3,
3998
+ Yt as a4,
3999
+ Vs as a5,
4000
+ Xo as a6,
4001
+ fa as a7,
4002
+ qs as a8,
4003
+ sa as a9,
3982
4004
  ce as aA,
3983
- Fa as aB,
3984
- Ps as aC,
3985
- Xa as aD,
3986
- Xi as aE,
3987
- Ci as aF,
3988
- un as aG,
4005
+ Ta as aB,
4006
+ _s as aC,
4007
+ ns as aD,
4008
+ na as aE,
4009
+ Di as aF,
4010
+ fn as aG,
3989
4011
  Ae as aH,
3990
- rs as aI,
3991
- is as aJ,
3992
- li as aK,
4012
+ as as aI,
4013
+ ls as aJ,
4014
+ ui as aK,
3993
4015
  $ as aL,
3994
- bs as aM,
3995
- Vs as aN,
3996
- Ts as aO,
3997
- ws as aa,
3998
- _s as ab,
3999
- di as ac,
4000
- ui as ad,
4001
- va as ae,
4002
- as as af,
4003
- ss as ag,
4004
- pi as ah,
4016
+ hs as aM,
4017
+ xs as aN,
4018
+ ks as aO,
4019
+ As as aa,
4020
+ Es as ab,
4021
+ pi as ac,
4022
+ mi as ad,
4023
+ Sa as ae,
4024
+ cs as af,
4025
+ ds as ag,
4026
+ yi as ah,
4005
4027
  De as ai,
4006
- ci as aj,
4007
- mi as ak,
4008
- ls as al,
4009
- Os as am,
4010
- xs as an,
4011
- ds as ao,
4012
- fs as ap,
4013
- us as aq,
4014
- ps as ar,
4015
- ms as as,
4016
- At as at,
4017
- ns as au,
4018
- ks as av,
4019
- gs as aw,
4020
- ki as ax,
4021
- Ms as ay,
4022
- dn as az,
4023
- ia as b,
4024
- ai as c,
4025
- cs as d,
4026
- Co as e,
4027
- hs as f,
4028
+ fi as aj,
4029
+ bi as ak,
4030
+ us as al,
4031
+ Bs as am,
4032
+ Os as an,
4033
+ ps as ao,
4034
+ gs as ap,
4035
+ ms as aq,
4036
+ ys as ar,
4037
+ bs as as,
4038
+ Bt as at,
4039
+ is as au,
4040
+ ws as av,
4041
+ Is as aw,
4042
+ wi as ax,
4043
+ Ps as ay,
4044
+ un as az,
4045
+ la as b,
4046
+ ci as c,
4047
+ fs as d,
4048
+ Do as e,
4049
+ Fs as f,
4028
4050
  oe as g,
4029
- vs as h,
4030
- Es as i,
4031
- Cs as j,
4032
- Va as k,
4033
- zi as l,
4034
- Ne as m,
4035
- Ii as n,
4036
- hi as o,
4037
- ys as p,
4038
- So as q,
4039
- Is as r,
4040
- Mo as s,
4041
- Et as t,
4042
- Ja as u,
4043
- xo as v,
4044
- Oa as w,
4045
- Fn as x,
4046
- Ma as y,
4047
- Rs as z
4051
+ Ss as h,
4052
+ js as i,
4053
+ Ds as j,
4054
+ xa as k,
4055
+ Gi as l,
4056
+ je as m,
4057
+ vi as n,
4058
+ Fi as o,
4059
+ Cs as p,
4060
+ Mo as q,
4061
+ vs as r,
4062
+ Po as s,
4063
+ Rt as t,
4064
+ es as u,
4065
+ Oo as v,
4066
+ Ba as w,
4067
+ Sn as x,
4068
+ Pa as y,
4069
+ Ns as z
4048
4070
  };