react-semaphor 0.1.593 → 0.1.595

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 (37) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/briefings/index.js +2 -2
  3. package/dist/chunks/{assistant-chat-D05uNAeO.js → assistant-chat-C8VXUHvX.js} +6 -6
  4. package/dist/chunks/{bookmark-impact-B0k90wq8.js → bookmark-impact-Dh-wiTs3.js} +2 -2
  5. package/dist/chunks/{card-filter-builder-CiafWE26.js → card-filter-builder-Dmh9R278.js} +351 -362
  6. package/dist/chunks/{comparison-window-caption-h8w3ySL6.js → comparison-window-caption-DmMFtNP5.js} +1 -1
  7. package/dist/chunks/{dashboard-briefing-launcher-CPh2B3Rf.js → dashboard-briefing-launcher-BFlkwqSg.js} +224 -224
  8. package/dist/chunks/{dashboard-controls-Cijc9c3G.js → dashboard-controls-C-MFtXUc.js} +8 -8
  9. package/dist/chunks/{dashboard-json-D3m7h4VL.js → dashboard-json-H8rjI8MK.js} +1 -1
  10. package/dist/chunks/{dashboard-T-gYKGTF.js → dashboard-wzORuqkj.js} +1 -1
  11. package/dist/chunks/{dates-Bb0sn54j.js → dates-B-bKEsiu.js} +5 -5
  12. package/dist/chunks/{edit-dashboard-visual-C0iSuX9t.js → edit-dashboard-visual-g78CyvZZ.js} +5170 -5302
  13. package/dist/chunks/{filter-line-CYT7KIXb.js → filter-line-BpdPq1D2.js} +3 -2
  14. package/dist/chunks/{filter-reach-copy-CifrEFxj.js → filter-reach-copy-DoXmRmk-.js} +4 -4
  15. package/dist/chunks/{filter-value-text-CHBm4IU7.js → filter-value-text-CDQCIREQ.js} +10 -10
  16. package/dist/chunks/{index-CzM2w1kY.js → index-C0jX5wlM.js} +2 -2
  17. package/dist/chunks/{pivot-result-contract-expectations-CaS0y823.js → pivot-result-contract-expectations-Dt0E1Wou.js} +1309 -1312
  18. package/dist/chunks/{report-preferences-dialog-GHvai50w.js → report-preferences-dialog-B2CoGxJu.js} +8 -8
  19. package/dist/chunks/{resolve-dashboard-input-context-BcQHmMlw.js → resolve-dashboard-input-context-DfJshnw8.js} +3621 -3556
  20. package/dist/chunks/{saved-dashboard-context-BHHEzmwM.js → saved-dashboard-context-DdhPU2Kq.js} +3 -3
  21. package/dist/chunks/{semaphor-ready-indicator-AOUJrUAJ.js → semaphor-ready-indicator-CLJFaXjd.js} +22645 -22574
  22. package/dist/chunks/{shelf-drop-preview-context-Cs62lWI1.js → shelf-drop-preview-context-BMUmDkqr.js} +2 -2
  23. package/dist/chunks/{stored-dashboard-Cmtl_Obh.js → stored-dashboard-D6FtWx_3.js} +930 -928
  24. package/dist/chunks/{table-export-sheet-Cd6z7SsG.js → table-export-sheet-DBlFMvE8.js} +1 -1
  25. package/dist/chunks/{variable-draft-CSK9Ps1o.js → variable-draft-CxdgKDCx.js} +2 -2
  26. package/dist/dashboard/index.js +1 -1
  27. package/dist/dashboard-authoring/index.js +1025 -1012
  28. package/dist/format-utils/index.js +211 -210
  29. package/dist/index.js +11 -11
  30. package/dist/surfboard/index.js +1 -1
  31. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +3 -1
  32. package/dist/types/shared/dashboard-authoring/card-formats/detail-date-display.d.ts +43 -1
  33. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  34. package/dist/types/shared/dashboard-authoring/semantic-card-domain.d.ts +30 -0
  35. package/dist/types/shared/dashboard-authoring/temporal-bucket-authoring.d.ts +7 -1
  36. package/dist/types/shared/format-utils/temporal-bucket-format-policy.d.ts +27 -5
  37. package/package.json +1 -1
@@ -1,55 +1,55 @@
1
- import { hW as hn, cY as vn, cl as Fn, a$ as Dn, bn as Sn, k as Tn, cd as Vn, hX as Te, eG as lt, eJ as Mn, bW as kn, hY as xn, aB as Pn, gX as ct, gZ as wn, bH as Ve, hZ as dt, S as On, g$ as _n, dt as de, s as _, gQ as ue, n as Me, h_ as An, h4 as Bn, dk as ut, dm as ft, d5 as En, ds as Rn, dq as Le, dr as qn, b as Nn, d7 as jn, dj as zn, dh as Ln, bK as pt, bi as Kn, a7 as A, hy as Gn, h$ as fe, i0 as mt, i1 as Hn, i2 as ke, hN as pe, i3 as Un, i4 as xe, i5 as Qn, i6 as $n, i7 as Wn, i8 as Zn, i9 as Yn, o as Pe, ia as Jn, p as U, r as Xn, h as er, ib as L, gH as we, ic as te, id as gt, ie as tr, M as nr, ig as rr, ih as or, gA as yt, ii as ir, ij as ar, e as sr, ik as lr, il as bt, im as cr, io as dr, a3 as It, ip as ur, iq as fr, ir as Ct, m as Oe, is as pr, cM as mr, a8 as gr, t as ht, cL as yr, hK as br, v as Ir, w as Ke, F as Cr, it as hr, iu as vr, cN as Fr, iv as Dr } from "./resolve-dashboard-input-context-BcQHmMlw.js";
2
- import { am as Sr, a7 as W, M as Tr, x as Vr, ay as Ce, y as Mr, a9 as ne, aA as vt, W as kr, b as xr, r as Pr, k as wr, aE as Or } from "./validators-BlEWWX9O.js";
1
+ import { i4 as hn, d3 as vn, cn as Fn, b1 as Dn, bp as Sn, k as Tn, cf as Vn, i5 as Te, eN as lt, eQ as Mn, bY as kn, i6 as xn, aD as Pn, h5 as ct, h7 as wn, bJ as Ve, i7 as dt, S as On, h9 as _n, dA as de, s as _, g_ as ue, n as Me, i8 as An, he as Bn, ds as ut, du as ft, dc as En, dz as Rn, dx as Le, dy as qn, b as Nn, de as jn, dr as zn, dp as Ln, bM as pt, bk as Kn, a7 as A, cr as Gn, hI as Hn, i9 as fe, ia as mt, ib as Un, ic as ke, hX as pe, id as Qn, ie as xe, ig as $n, ih as Wn, ii as Zn, ij as Jn, ik as Yn, o as Pe, il as Xn, p as U, r as er, h as tr, im as L, gR as we, io as te, ip as gt, iq as nr, M as rr, ir, is as or, gK as yt, it as ar, iu as sr, e as lr, iv as cr, iw as bt, ix as dr, iy as ur, a3 as It, iz as fr, iA as pr, iB as Ct, m as Oe, iC as mr, cT as gr, a8 as yr, t as ht, cS as br, hU as Ir, v as Cr, w as Ke, F as hr, iD as vr, iE as Fr, cU as Dr, iF as Sr } from "./resolve-dashboard-input-context-DfJshnw8.js";
2
+ import { am as Tr, a7 as W, M as Vr, x as Mr, ay as Ce, y as kr, a9 as ne, aA as vt, W as xr, b as Pr, r as wr, k as Or, aE as _r } from "./validators-BlEWWX9O.js";
3
3
  import { r as Ft } from "./matrix-operation-contract-CAanJeCj.js";
4
4
  import "./analytics-base-schemas-8wz9vqn_.js";
5
5
  import "./pickers-DkqmtnTL.js";
6
6
  import { canonicalizeSupportedCurrencyCode as Dt } from "../value-format-preferences/index.js";
7
- import { ZodError as _r } from "zod";
8
- import { b as re, r as Ar, b6 as Br, i as Er, aP as Rr, ai as Ge, aN as He } from "./pivot-result-contract-expectations-CaS0y823.js";
9
- import { aE as St, aF as Tt, aG as be, a3 as qr, aD as Vt, C as he, aH as j, A as Z, i as Mt, w as Nr, q as jr, v as zr, B as _e, aI as Lr, al as Kr, G as kt, F as Gr, K as Ue, P as xt, Q as Pt, J as wt } from "./bookmark-state-Be2W3s6t.js";
7
+ import { ZodError as Ar } from "zod";
8
+ import { b as re, r as Br, b7 as Er, i as Rr, aQ as qr, aj as Ge, aO as He } from "./pivot-result-contract-expectations-Dt0E1Wou.js";
9
+ import { aE as St, aF as Tt, aG as be, a3 as Nr, aD as Vt, C as he, aH as j, A as Z, i as Mt, w as jr, q as zr, v as Lr, B as _e, aI as Kr, al as Gr, G as kt, F as Hr, K as Ue, P as xt, Q as Pt, J as wt } from "./bookmark-state-Be2W3s6t.js";
10
10
  import "./schema-C9NPiIru.js";
11
11
  import "./index-CV_Kzou0.js";
12
12
  import "./context-CVXTFljo.js";
13
- import { a as Hr, i as Ur } from "./matrix-analytical-definition-CyWOwLmE.js";
14
- import { D as Qr } from "./report-runtime-context-g4Zp_TU9.js";
15
- import { isPdfTableCardType as $r, PDF_CAPACITY as Wr } from "../pdf-export-policy/index.js";
13
+ import { a as Ur, i as Qr } from "./matrix-analytical-definition-CyWOwLmE.js";
14
+ import { D as $r } from "./report-runtime-context-g4Zp_TU9.js";
15
+ import { isPdfTableCardType as Wr, PDF_CAPACITY as Zr } from "../pdf-export-policy/index.js";
16
16
  import { K as Qe } from "./raw-temporal-value-BzdgeDa7.js";
17
- import { t as Zr, n as Yr, c as Jr } from "./selection-filter-compiler-BclSpK3P.js";
18
- const Xr = (e, t) => {
17
+ import { t as Jr, n as Yr, c as Xr } from "./selection-filter-compiler-BclSpK3P.js";
18
+ const ei = (e, t) => {
19
19
  const n = {};
20
20
  if (e === null || t === null)
21
21
  return t;
22
22
  const r = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
23
- for (const o of r) {
24
- if (!(o in e) && o in t) {
25
- n[o] = t[o];
23
+ for (const i of r) {
24
+ if (!(i in e) && i in t) {
25
+ n[i] = t[i];
26
26
  continue;
27
27
  }
28
- if (o in e && !(o in t)) {
29
- n[o] = void 0;
28
+ if (i in e && !(i in t)) {
29
+ n[i] = void 0;
30
30
  continue;
31
31
  }
32
- const i = e[o], a = t[o];
33
- if (!ve(i, a))
34
- if (Array.isArray(i) && Array.isArray(a))
35
- n[o] = a;
36
- else if ($e(i) && $e(a)) {
37
- const s = Xr(i, a);
38
- Object.keys(s).length > 0 && (n[o] = s);
32
+ const o = e[i], a = t[i];
33
+ if (!ve(o, a))
34
+ if (Array.isArray(o) && Array.isArray(a))
35
+ n[i] = a;
36
+ else if ($e(o) && $e(a)) {
37
+ const s = ei(o, a);
38
+ Object.keys(s).length > 0 && (n[i] = s);
39
39
  } else
40
- n[o] = a;
40
+ n[i] = a;
41
41
  }
42
42
  return n;
43
43
  }, ve = (e, t) => {
44
44
  if (e === t) return !0;
45
45
  if (e && t && typeof e == "object" && typeof t == "object") {
46
46
  if (Array.isArray(e) && Array.isArray(t))
47
- return e.length !== t.length ? !1 : e.every((o, i) => ve(o, t[i]));
47
+ return e.length !== t.length ? !1 : e.every((i, o) => ve(i, t[o]));
48
48
  const n = Object.keys(e), r = Object.keys(t);
49
- return n.length !== r.length ? !1 : n.every((o) => ve(e[o], t[o]));
49
+ return n.length !== r.length ? !1 : n.every((i) => ve(e[i], t[i]));
50
50
  }
51
51
  return !1;
52
- }, $e = (e) => e !== null && typeof e == "object" && !Array.isArray(e), oe = (e) => {
52
+ }, $e = (e) => e !== null && typeof e == "object" && !Array.isArray(e), ie = (e) => {
53
53
  if (e === null || typeof e != "object")
54
54
  return e;
55
55
  if (e instanceof Date)
@@ -57,37 +57,37 @@ const Xr = (e, t) => {
57
57
  if (e instanceof RegExp)
58
58
  return new RegExp(e);
59
59
  if (Array.isArray(e))
60
- return e.map((n) => oe(n));
60
+ return e.map((n) => ie(n));
61
61
  const t = {};
62
62
  for (const n in e)
63
- Object.prototype.hasOwnProperty.call(e, n) && (t[n] = oe(e[n]));
63
+ Object.prototype.hasOwnProperty.call(e, n) && (t[n] = ie(e[n]));
64
64
  return t;
65
- }, eo = /^(?:[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 to(e) {
67
- return typeof e == "string" && eo.test(e);
65
+ }, ti = /^(?:[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 ni(e) {
67
+ return typeof e == "string" && ti.test(e);
68
68
  }
69
- function no(e) {
70
- if (!to(e))
69
+ function ri(e) {
70
+ if (!ni(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 ro(e) {
76
+ function ii(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 oo = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", io = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
84
- function ao(e, t, n) {
85
- function r(o, i, a, s) {
83
+ const oi = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", ai = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
84
+ function si(e, t, n) {
85
+ function r(i, o, a, s) {
86
86
  var l;
87
- if (typeof o == "string" && (o = ro(o)), typeof i == "string" && (i = no(i)), ((l = i) === null || l === void 0 ? void 0 : l.length) !== 16)
87
+ if (typeof i == "string" && (i = ii(i)), typeof o == "string" && (o = ri(o)), ((l = o) === 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
- let c = new Uint8Array(16 + o.length);
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) {
89
+ let c = new Uint8Array(16 + i.length);
90
+ if (c.set(o), c.set(i, o.length), c = n(c), c[6] = c[6] & 15 | t, c[8] = c[8] & 63 | 128, a) {
91
91
  s = s || 0;
92
92
  for (let d = 0; d < 16; ++d)
93
93
  a[s + d] = c[d];
@@ -99,9 +99,9 @@ function ao(e, t, n) {
99
99
  r.name = e;
100
100
  } catch {
101
101
  }
102
- return r.DNS = oo, r.URL = io, r;
102
+ return r.DNS = oi, r.URL = ai, r;
103
103
  }
104
- function so(e, t, n, r) {
104
+ function li(e, t, n, r) {
105
105
  switch (e) {
106
106
  case 0:
107
107
  return t & n ^ ~t & r;
@@ -116,7 +116,7 @@ function so(e, t, n, r) {
116
116
  function Ie(e, t) {
117
117
  return e << t | e >>> 32 - t;
118
118
  }
119
- function lo(e) {
119
+ function ci(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));
@@ -125,60 +125,60 @@ function lo(e) {
125
125
  e.push(a.charCodeAt(s));
126
126
  } else Array.isArray(e) || (e = Array.prototype.slice.call(e));
127
127
  e.push(128);
128
- const r = e.length / 4 + 2, o = Math.ceil(r / 16), i = new Array(o);
129
- for (let a = 0; a < o; ++a) {
128
+ const r = e.length / 4 + 2, i = Math.ceil(r / 16), o = new Array(i);
129
+ for (let a = 0; a < i; ++a) {
130
130
  const s = new Uint32Array(16);
131
131
  for (let l = 0; l < 16; ++l)
132
132
  s[l] = e[a * 64 + l * 4] << 24 | e[a * 64 + l * 4 + 1] << 16 | e[a * 64 + l * 4 + 2] << 8 | e[a * 64 + l * 4 + 3];
133
- i[a] = s;
133
+ o[a] = s;
134
134
  }
135
- i[o - 1][14] = (e.length - 1) * 8 / Math.pow(2, 32), i[o - 1][14] = Math.floor(i[o - 1][14]), i[o - 1][15] = (e.length - 1) * 8 & 4294967295;
136
- for (let a = 0; a < o; ++a) {
135
+ o[i - 1][14] = (e.length - 1) * 8 / Math.pow(2, 32), o[i - 1][14] = Math.floor(o[i - 1][14]), o[i - 1][15] = (e.length - 1) * 8 & 4294967295;
136
+ for (let a = 0; a < i; ++a) {
137
137
  const s = new Uint32Array(80);
138
138
  for (let m = 0; m < 16; ++m)
139
- s[m] = i[a][m];
139
+ s[m] = o[a][m];
140
140
  for (let m = 16; m < 80; ++m)
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) + so(y, c, d, u) + f + t[y] + s[m] >>> 0;
144
+ const y = Math.floor(m / 20), p = Ie(l, 5) + li(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 co = ao("v5", 80, lo), We = /\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g, Ze = /\bparam\s*\(\s*(['"])([^'"]+)\1/g;
152
- function uo(e) {
151
+ const di = si("v5", 80, ci), We = /\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g, Ze = /\bparam\s*\(\s*(['"])([^'"]+)\1/g;
152
+ function ui(e) {
153
153
  const t = [];
154
154
  let n = 0;
155
155
  for (; n < e.length; ) {
156
- const r = e.indexOf("{{", n), o = e.indexOf("{%", n);
157
- let i = -1, a = "";
158
- if (r === -1 ? (i = o, a = "%}") : o === -1 || r < o ? (i = r, a = "}}") : (i = o, a = "%}"), i === -1)
156
+ const r = e.indexOf("{{", n), i = e.indexOf("{%", n);
157
+ let o = -1, a = "";
158
+ if (r === -1 ? (o = i, a = "%}") : i === -1 || r < i ? (o = r, a = "}}") : (o = i, a = "%}"), o === -1)
159
159
  break;
160
- const s = e.indexOf(a, i + 2);
160
+ const s = e.indexOf(a, o + 2);
161
161
  if (s === -1) {
162
- n = i + 2;
162
+ n = o + 2;
163
163
  continue;
164
164
  }
165
- t.push(e.slice(i + 2, s)), n = s + 2;
165
+ t.push(e.slice(o + 2, s)), n = s + 2;
166
166
  }
167
167
  return t;
168
168
  }
169
169
  function Ot(e) {
170
- var r, o;
170
+ var r, i;
171
171
  if (!e)
172
172
  return [];
173
173
  const t = /* @__PURE__ */ new Set();
174
174
  let n;
175
175
  for (We.lastIndex = 0; (n = We.exec(e)) !== null; ) {
176
- const i = (r = n[1]) == null ? void 0 : r.trim();
177
- i && t.add(i);
176
+ const o = (r = n[1]) == null ? void 0 : r.trim();
177
+ o && t.add(o);
178
178
  }
179
- for (const i of uo(e))
180
- for (Ze.lastIndex = 0; (n = Ze.exec(i)) !== null; ) {
181
- const a = (o = n[2]) == null ? void 0 : o.trim();
179
+ for (const o of ui(e))
180
+ for (Ze.lastIndex = 0; (n = Ze.exec(o)) !== null; ) {
181
+ const a = (i = n[2]) == null ? void 0 : i.trim();
182
182
  a && t.add(a);
183
183
  }
184
184
  return Array.from(t);
@@ -191,7 +191,7 @@ function Ae(e) {
191
191
  t.add(n.get(r) ?? r);
192
192
  return Array.from(t);
193
193
  }
194
- function fo(e) {
194
+ function fi(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);
@@ -202,61 +202,61 @@ function fo(e) {
202
202
  });
203
203
  return Array.from(t.values());
204
204
  }
205
- function po(e, t) {
206
- var o;
207
- const n = (o = e.controlBindings) == null ? void 0 : o.map((i) => ({
208
- ...i,
209
- controlId: t.get(i.controlId) ?? i.controlId
210
- })), r = fo(e).flatMap(
211
- ({ paramId: i, controlId: a }) => {
205
+ function pi(e, t) {
206
+ var i;
207
+ const n = (i = e.controlBindings) == null ? void 0 : i.map((o) => ({
208
+ ...o,
209
+ controlId: t.get(o.controlId) ?? o.controlId
210
+ })), r = fi(e).flatMap(
211
+ ({ paramId: o, controlId: a }) => {
212
212
  var l;
213
213
  const s = t.get(a);
214
214
  return !s || s === a || (l = e.controlBindings) != null && l.some(
215
- (c) => c.target === "sql_param" && c.paramId === i
216
- ) ? [] : [{ target: "sql_param", paramId: i, controlId: s }];
215
+ (c) => c.target === "sql_param" && c.paramId === o
216
+ ) ? [] : [{ target: "sql_param", paramId: o, controlId: s }];
217
217
  }
218
218
  );
219
219
  return r.length ? [...n ?? [], ...r] : n;
220
220
  }
221
221
  function _t(e, t) {
222
222
  var a, s;
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
- return i.source === "input" ? {
225
- ...i,
226
- inputId: ((s = t.inputIds) == null ? void 0 : s[i.inputId]) ?? i.inputId
227
- } : i;
223
+ const n = be(e) ?? e, r = n.source === "dashboardInputAlias" ? (a = t.inputAliases) == null ? void 0 : a[n.variableName] : void 0, i = n.source === "dashboardInputAlias" && r ? be(r) ?? be({ ...r, export: n.export ?? "label" }) ?? n : n, o = n.source === "dashboardInputAlias" && i !== n ? { ...i, export: n.export ?? "label" } : i;
224
+ return o.source === "input" ? {
225
+ ...o,
226
+ inputId: ((s = t.inputIds) == null ? void 0 : s[o.inputId]) ?? o.inputId
227
+ } : o;
228
228
  }
229
- function mo(e, t) {
230
- var o;
229
+ function mi(e, t) {
230
+ var i;
231
231
  const n = {};
232
- for (const i of [
232
+ for (const o of [
233
233
  "cardIds",
234
234
  "sheetIds",
235
235
  "inputIds",
236
236
  "controlIds",
237
237
  "filterIds"
238
238
  ]) {
239
- const a = { ...t[i] };
240
- for (const [s, l] of Object.entries((e == null ? void 0 : e[i]) ?? {}))
241
- a[s] = ((o = t[i]) == null ? void 0 : o[l]) ?? l;
242
- Object.keys(a).length && (n[i] = a);
239
+ const a = { ...t[o] };
240
+ for (const [s, l] of Object.entries((e == null ? void 0 : e[o]) ?? {}))
241
+ a[s] = ((i = t[o]) == null ? void 0 : i[l]) ?? l;
242
+ Object.keys(a).length && (n[o] = a);
243
243
  }
244
244
  const r = { ...t.inputAliases };
245
- for (const [i, a] of Object.entries((e == null ? void 0 : e.inputAliases) ?? {}))
246
- r[i] = _t(a, t);
245
+ for (const [o, a] of Object.entries((e == null ? void 0 : e.inputAliases) ?? {}))
246
+ r[o] = _t(a, t);
247
247
  return Object.keys(r).length && (n.inputAliases = r), n;
248
248
  }
249
- function La(e, t) {
250
- var o, i, a, s;
251
- const n = oe(St(e));
252
- n.controlBindings = po(
249
+ function Ka(e, t) {
250
+ var i, o, a, s;
251
+ const n = ie(St(e));
252
+ n.controlBindings = pi(
253
253
  e,
254
254
  new Map(Object.entries(t.controlIds ?? {}))
255
255
  );
256
256
  for (const l of n.controls ?? [])
257
- l.id = ((o = t.controlIds) == null ? void 0 : o[l.id]) ?? l.id;
257
+ l.id = ((i = t.controlIds) == null ? void 0 : i[l.id]) ?? l.id;
258
258
  for (const l of n.inlineFilters ?? [])
259
- l.id = ((i = t.filterIds) == null ? void 0 : i[l.id]) ?? l.id;
259
+ l.id = ((o = t.filterIds) == null ? void 0 : o[l.id]) ?? l.id;
260
260
  const r = (l) => {
261
261
  var d, u;
262
262
  if (!l || typeof l != "object") return;
@@ -285,66 +285,66 @@ function La(e, t) {
285
285
  l.cardId = ((s = t.cardIds) == null ? void 0 : s[l.cardId]) ?? l.cardId;
286
286
  return n;
287
287
  }
288
- const go = "9677efdd-86ec-4afb-b9bb-5ead8b5442af";
289
- function yo(e) {
288
+ const gi = "9677efdd-86ec-4afb-b9bb-5ead8b5442af";
289
+ function yi(e) {
290
290
  let t = 0;
291
- return () => co(`${e}#${t++}`, go);
291
+ return () => di(`${e}#${t++}`, gi);
292
292
  }
293
- const bo = [
293
+ const bi = [
294
294
  { code: "matrix_definition_incomplete", label: "Matrix definition" }
295
- ], Io = [
295
+ ], Ii = [
296
296
  { code: "connection_type_unresolved", label: "Connection type" }
297
297
  ], G = (e) => !Array.isArray(e) || e.length === 0;
298
- function Co(e) {
299
- var i;
298
+ function Ci(e) {
299
+ var o;
300
300
  const t = e.config ?? {};
301
- if ((i = e.sql) != null && i.trim() || !G(t.pivotByColumns)) return "matrixTable";
302
- const n = !G(t.groupByColumns), r = !G(t.metricColumns), o = e.type === "pivotTable" && (n || r) && G(t.rowAggregates) && G(t.columnAggregates);
303
- return n && !r || o ? "table" : "matrixTable";
301
+ if ((o = e.sql) != null && o.trim() || !G(t.pivotByColumns)) return "matrixTable";
302
+ const n = !G(t.groupByColumns), r = !G(t.metricColumns), i = e.type === "pivotTable" && (n || r) && G(t.rowAggregates) && G(t.columnAggregates);
303
+ return n && !r || i ? "table" : "matrixTable";
304
304
  }
305
- function ho(e) {
306
- var o;
305
+ function hi(e) {
306
+ var i;
307
307
  const t = e.dataSource;
308
- if (!t || (o = t.connectionType) != null && o.trim()) return e;
309
- const n = Sr(Vn(t.selectedEntities));
308
+ if (!t || (i = t.connectionType) != null && i.trim()) return e;
309
+ const n = Tr(Vn(t.selectedEntities));
310
310
  if (!n) return e;
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;
311
+ const r = Array.isArray(t.selectedEntities) ? t.selectedEntities.map((o) => o && typeof o == "object" && "connectionType" in o && !String(o.connectionType ?? "").trim() ? { ...o, connectionType: n } : o) : t.selectedEntities;
312
312
  return { ...e, dataSource: { ...t, connectionType: n, selectedEntities: r } };
313
313
  }
314
314
  function At(e) {
315
315
  var a, s;
316
316
  const t = e;
317
317
  if (!Fn(t)) return { status: "not_legacy", card: e };
318
- const n = ho(t), r = Co(t) === "table" ? Dn(n, "table") : Sn(n, "matrixTable", { createId: yo(t.id) });
318
+ const n = hi(t), r = Ci(t) === "table" ? Dn(n, "table") : Sn(n, "matrixTable", { createId: yi(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" && Tn(r.card).status !== "ready", i = !!n.dataSource && !((s = (a = n.dataSource) == null ? void 0 : a.connectionType) != null && s.trim());
320
+ const i = r.card.type === "matrixTable" && Tn(r.card).status !== "ready", o = !!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 ? bo : [],
327
- ...i ? Io : []
326
+ ...i ? bi : [],
327
+ ...o ? Ii : []
328
328
  ]
329
329
  };
330
330
  }
331
- function Ka(e) {
331
+ function Ga(e) {
332
332
  if (!e.cards) return e;
333
333
  const t = e.cards.map((n) => At(n).card);
334
334
  return t.every((n, r) => n === e.cards[r]) ? e : { ...e, cards: t };
335
335
  }
336
- function vo(e) {
336
+ function vi(e) {
337
337
  const t = [];
338
- return { dashboard: qr(e, (r, o) => {
339
- const i = At(r);
340
- return i.status === "routed" && i.gaps.length && t.push({ location: o, gaps: i.gaps }), i.card;
338
+ return { dashboard: Nr(e, (r, i) => {
339
+ const o = At(r);
340
+ return o.status === "routed" && o.gaps.length && t.push({ location: i, gaps: o.gaps }), o.card;
341
341
  }), routedWithGaps: t };
342
342
  }
343
- function Fo(e, t) {
343
+ function Fi(e, t) {
344
344
  return e.name === t.name && e.qualifiedEntityName === t.qualifiedEntityName;
345
345
  }
346
- function Do(e, t, n) {
347
- var o, i;
346
+ function Di(e, t, n) {
347
+ var i, o;
348
348
  if (n.sortPolicy === "dropUnrelatedSorts") {
349
349
  const a = new Set(
350
350
  (e.metricColumns || []).map((s) => s.id)
@@ -357,12 +357,12 @@ function Do(e, t, n) {
357
357
  )
358
358
  };
359
359
  }
360
- const r = (o = e.groupByColumns) == null ? void 0 : o[0];
360
+ const r = (i = e.groupByColumns) == null ? void 0 : i[0];
361
361
  return {
362
362
  ...e,
363
363
  groupByColumns: [t],
364
- sortByColumns: (i = e.sortByColumns) == null ? void 0 : i.map(
365
- (a) => r && Fo(a, r) ? {
364
+ sortByColumns: (o = e.sortByColumns) == null ? void 0 : o.map(
365
+ (a) => r && Fi(a, r) ? {
366
366
  ...t,
367
367
  role: "sortby",
368
368
  direction: a.direction
@@ -370,14 +370,14 @@ function Do(e, t, n) {
370
370
  )
371
371
  };
372
372
  }
373
- function ie(e) {
373
+ function oe(e) {
374
374
  return e == null ? void 0 : e.map(
375
375
  ({
376
376
  format: t,
377
377
  formatOrigin: n,
378
378
  semanticTemporalPresentation: r,
379
- ...o
380
- }) => o
379
+ ...i
380
+ }) => i
381
381
  );
382
382
  }
383
383
  function ae(e) {
@@ -387,32 +387,32 @@ function ae(e) {
387
387
  format: t,
388
388
  formatOrigin: n,
389
389
  semanticTemporalPresentation: r,
390
- ...o
390
+ ...i
391
391
  } = e;
392
- return Q(o);
392
+ return Q(i);
393
393
  }
394
394
  function Bt(e, t) {
395
395
  return e == null ? void 0 : e.map(
396
- (n) => lt(Q(ie([n])[0]), n.format, t)
396
+ (n) => lt(Q(oe([n])[0]), n.format, t)
397
397
  );
398
398
  }
399
- function So(e, t) {
399
+ function Si(e, t) {
400
400
  return e == null ? void 0 : e.map(
401
- (n) => Mn(Q(ie([n])[0]), n.format, t)
401
+ (n) => Mn(Q(oe([n])[0]), n.format, t)
402
402
  );
403
403
  }
404
- function To(e, t) {
405
- const { dateFormat: n, customFormat: r, ...o } = ae(e.field);
404
+ function Ti(e, t) {
405
+ const { dateFormat: n, customFormat: r, ...i } = ae(e.field);
406
406
  return {
407
407
  ...e,
408
- field: t ? o : lt(ae(e.field), e.field.format, "raw")
408
+ field: t ? i : lt(ae(e.field), e.field.format, "raw")
409
409
  };
410
410
  }
411
411
  function me(e, t = !1) {
412
412
  if (e)
413
413
  return {
414
414
  ...e,
415
- conditions: e.conditions.map((n) => To(n, t)),
415
+ conditions: e.conditions.map((n) => Ti(n, t)),
416
416
  groups: e.groups.map((n) => me(n, t))
417
417
  };
418
418
  }
@@ -422,19 +422,19 @@ function Q(e) {
422
422
  return (n = t.calculatedFormula) != null && n.inputFields && (t.calculatedFormula = {
423
423
  ...t.calculatedFormula,
424
424
  inputFields: t.calculatedFormula.inputFields.map(
425
- (o) => ae(o)
425
+ (i) => ae(i)
426
426
  )
427
427
  }), (r = t.parameters) != null && r.filters && (t.parameters = {
428
428
  ...t.parameters,
429
429
  filters: me(t.parameters.filters)
430
430
  }), t;
431
431
  }
432
- function Vo(e, t) {
432
+ function Vi(e, t) {
433
433
  return t.cardType === "detailTable" || !kn(t.cardType) || t.temporalResultOwner !== "config" ? Bt(e, "grouped") : e == null ? void 0 : e.map((n) => {
434
- const r = xn(n), o = ae(r ?? n);
434
+ const r = xn(n), i = ae(r ?? n);
435
435
  if (!r)
436
- return o;
437
- const { dateFormat: i, customFormat: a, ...s } = o;
436
+ return i;
437
+ const { dateFormat: o, customFormat: a, ...s } = i;
438
438
  return s;
439
439
  });
440
440
  }
@@ -442,62 +442,62 @@ function Et(e, t) {
442
442
  if (!e)
443
443
  return;
444
444
  const n = { type: t.cardType, config: e };
445
- return Te(n) ? Mo(n, t) : e.matrix === void 0 ? {} : { matrix: e.matrix };
445
+ return Te(n) ? Mi(n, t) : e.matrix === void 0 ? {} : { matrix: e.matrix };
446
446
  }
447
- function Mo(e, t = {}) {
448
- var i, a, s;
447
+ function Mi(e, t = {}) {
448
+ var o, 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: Vo(n.groupByColumns, r),
455
- metricColumns: (i = ie(n.metricColumns)) == null ? void 0 : i.map(
454
+ groupByColumns: Vi(n.groupByColumns, r),
455
+ metricColumns: (o = oe(n.metricColumns)) == null ? void 0 : o.map(
456
456
  Q
457
457
  ),
458
458
  pivotByColumns: Bt(n.pivotByColumns, "grouped"),
459
- sortByColumns: (a = ie(n.sortByColumns)) == null ? void 0 : a.map(
459
+ sortByColumns: (a = oe(n.sortByColumns)) == null ? void 0 : a.map(
460
460
  Q
461
461
  ),
462
- detailColumns: So(n.detailColumns, (s = r.dataSource) == null ? void 0 : s.connectionType),
462
+ detailColumns: Si(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 ko(e) {
469
+ function ki(e) {
470
470
  return (e == null ? void 0 : e.type) === "number";
471
471
  }
472
- function xo(e) {
472
+ function xi(e) {
473
473
  var n;
474
- if (!ko(e))
474
+ if (!ki(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 Po(e, t) {
479
+ function Pi(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
483
  const r = n === "number" ? t != null && t.numberFormat ? wn(t.numberFormat, {
484
484
  preserveOmittedProperties: !0
485
- }) : { type: "number" } : void 0, o = re(e.format, {
485
+ }) : { type: "number" } : void 0, i = 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
+ }), o = 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 : i || o || r;
488
488
  return {
489
489
  authoredFormat: s,
490
490
  currencyBindable: se(s)
491
491
  };
492
492
  }
493
- function wo(e, t) {
493
+ function wi(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 = W(t.dataType) === "number" ? { type: "number" } : void 0, i = n || r;
497
497
  return {
498
- authoredFormat: o,
498
+ authoredFormat: i,
499
499
  source: n ? "semantic" : r ? "inferred" : void 0,
500
- currencyBindable: se(o)
500
+ currencyBindable: se(i)
501
501
  };
502
502
  }
503
503
  function Fe(e, t = {}) {
@@ -508,7 +508,7 @@ function Fe(e, t = {}) {
508
508
  kind: "column",
509
509
  columnKey: t.resultColumnKey
510
510
  } : void 0, f = re(
511
- Ar({ card: e, column: { kind: "sqlKpiValue" }, surface: "kpiValue" }).format,
511
+ Br({ card: e, column: { kind: "sqlKpiValue" }, surface: "kpiValue" }).format,
512
512
  { preserveOmittedProperties: !0 }
513
513
  );
514
514
  return {
@@ -518,48 +518,48 @@ function Fe(e, t = {}) {
518
518
  currencyBindable: !!u && se(f)
519
519
  };
520
520
  }
521
- const r = n ? (d = (c = e.config) == null ? void 0 : c.metricColumns) == null ? void 0 : d.find((u) => u.id === n.fieldId) : void 0, o = r != null && r.id ? {
521
+ const r = n ? (d = (c = e.config) == null ? void 0 : c.metricColumns) == null ? void 0 : d.find((u) => u.id === n.fieldId) : void 0, i = r != null && r.id ? {
522
522
  kind: "metric",
523
523
  metricId: r.id
524
- } : void 0, i = re(r == null ? void 0 : r.format, {
524
+ } : void 0, o = 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 = W(r == null ? void 0 : r.dataType) === "number" ? { type: "number" } : void 0, s = o || a;
527
527
  return {
528
- target: o,
528
+ target: i,
529
529
  authoredFormat: s,
530
- ...i ? { source: "stored" } : a ? { source: "inferred" } : {},
531
- currencyBindable: ct(e.type) && !!o && se(s)
530
+ ...o ? { source: "stored" } : a ? { source: "inferred" } : {},
531
+ currencyBindable: ct(e.type) && !!i && se(s)
532
532
  };
533
533
  }
534
534
  function Rt(e, t, n) {
535
- var o;
535
+ var i;
536
536
  const r = n(e, t);
537
- return ((o = e.derivedField) == null ? void 0 : o.format) ?? (r == null ? void 0 : r.format) ?? (r == null ? void 0 : r.resolvedField.format);
537
+ return ((i = e.derivedField) == null ? void 0 : i.format) ?? (r == null ? void 0 : r.format) ?? (r == null ? void 0 : r.resolvedField.format);
538
538
  }
539
539
  function qt(e, t, n) {
540
540
  return e.kind === "calculated" ? e.definition.format : Rt(e.field, t, n);
541
541
  }
542
- function Ga(e, t) {
543
- const n = dt(t), r = (o, i) => Object.fromEntries(o.flatMap((a) => {
544
- const s = i(a);
542
+ function Ha(e, t) {
543
+ const n = dt(t), r = (i, o) => Object.fromEntries(i.flatMap((a) => {
544
+ const s = o(a);
545
545
  return s ? [[a.id, s]] : [];
546
546
  }));
547
547
  return {
548
- measureFormats: r(e.measures, (o) => qt(o, e.source, n)),
549
- levelFormats: r([...e.rows, ...e.columns], (o) => Rt(o.field, e.source, n))
548
+ measureFormats: r(e.measures, (i) => qt(i, e.source, n)),
549
+ levelFormats: r([...e.rows, ...e.columns], (i) => Rt(i.field, e.source, n))
550
550
  };
551
551
  }
552
552
  function Nt(e, t = []) {
553
553
  const n = Ve(e);
554
554
  if (n.status !== "ready") return [];
555
- const { spec: r, presentation: o } = n.config, i = dt(t);
555
+ const { spec: r, presentation: i } = n.config, o = dt(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 = Br(o.measureFormats[a.id], qt(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 && Er(l) ? l : !l && d && u ? { type: "number" } : void 0;
559
- return { measureId: a.id, label: Rr(a, o), canonical: f };
558
+ const s = a.kind === "aggregate" ? o(a.field, r.source) : void 0, l = Er(i.measureFormats[a.id], qt(a, r.source, o)), 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 && Rr(l) ? l : !l && d && u ? { type: "number" } : void 0;
559
+ return { measureId: a.id, label: qr(a, i), canonical: f };
560
560
  });
561
561
  }
562
- function Oo(e) {
562
+ function Oi(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
  }
@@ -570,25 +570,25 @@ function jt(e) {
570
570
  )
571
571
  );
572
572
  }
573
- function _o(e, t) {
573
+ function _i(e, t) {
574
574
  const n = [
575
575
  t.id,
576
576
  t.alias,
577
577
  t.label,
578
578
  t.name,
579
579
  t.qualifiedFieldName
580
- ].filter((i) => !!i);
581
- for (const i of n)
582
- if (e[i])
583
- return e[i];
580
+ ].filter((o) => !!o);
581
+ for (const o of n)
582
+ if (e[o])
583
+ return e[o];
584
584
  const r = new Set(
585
- n.map((i) => i.trim().toLowerCase())
586
- ), o = Object.entries(e).find(
587
- ([i]) => r.has(i.trim().toLowerCase())
585
+ n.map((o) => o.trim().toLowerCase())
586
+ ), i = Object.entries(e).find(
587
+ ([o]) => r.has(o.trim().toLowerCase())
588
588
  );
589
- return o == null ? void 0 : o[1];
589
+ return i == null ? void 0 : i[1];
590
590
  }
591
- function Ye(e) {
591
+ function Je(e) {
592
592
  return [
593
593
  ...new Map(
594
594
  e.map((t) => [
@@ -598,9 +598,9 @@ function Ye(e) {
598
598
  ).values()
599
599
  ];
600
600
  }
601
- function Ao(e, t = [], n) {
601
+ function Ai(e, t = [], n) {
602
602
  var D;
603
- const r = !!((D = e.sql) != null && D.trim()), o = ct(e.type), i = r && o && e.type !== "kpi" && e.type !== "matrixTable", a = Oo(e), s = On(e), l = !r && e.type === "kpi" ? a.map(
603
+ const r = !!((D = e.sql) != null && D.trim()), i = ct(e.type), o = r && i && e.type !== "kpi" && e.type !== "matrixTable", a = Oi(e), s = On(e), l = !r && e.type === "kpi" ? a.map(
604
604
  (g) => Fe(e, {
605
605
  column: { kind: "field", fieldId: g.id }
606
606
  })
@@ -624,23 +624,23 @@ function Ao(e, t = [], n) {
624
624
  })
625
625
  ), m = e.type === "matrixTable" ? [] : e.type === "kpi" ? l.filter((g) => g.currencyBindable).flatMap(
626
626
  (g) => g.target ? [g.target] : []
627
- ) : (r || !o ? [] : a).filter(
628
- (g) => (_n(e.type) ? Po(
627
+ ) : (r || !i ? [] : a).filter(
628
+ (g) => (_n(e.type) ? Pi(
629
629
  g,
630
- _o(s, g)
631
- ) : wo(e, g)).currencyBindable
630
+ _i(s, g)
631
+ ) : wi(e, g)).currencyBindable
632
632
  ).map(
633
633
  (g) => ({
634
634
  kind: "metric",
635
635
  metricId: g.id
636
636
  })
637
- ), y = [...new Set(t)], p = (i ? y : []).map(
637
+ ), y = [...new Set(t)], p = (o ? y : []).map(
638
638
  (g) => ({
639
639
  kind: "column",
640
640
  columnKey: g
641
641
  })
642
- ), b = (i ? y : []).filter(
643
- (g) => xo(
642
+ ), b = (o ? y : []).filter(
643
+ (g) => xi(
644
644
  s[g]
645
645
  )
646
646
  ).map(
@@ -655,14 +655,14 @@ function Ao(e, t = [], n) {
655
655
  })
656
656
  ), C = r && e.type === "kpi" ? Fe(e, {
657
657
  resultColumnKey: y[0]
658
- }) : void 0, h = o && (C != null && C.currencyBindable) ? I : [];
658
+ }) : void 0, h = i && (C != null && C.currencyBindable) ? I : [];
659
659
  return {
660
- knownTargets: Ye([
660
+ knownTargets: Je([
661
661
  ...e.type === "matrixTable" ? u : d,
662
662
  ...p,
663
663
  ...I
664
664
  ]),
665
- eligibleTargets: Ye([
665
+ eligibleTargets: Je([
666
666
  ...m,
667
667
  ...f,
668
668
  ...b,
@@ -670,20 +670,20 @@ function Ao(e, t = [], n) {
670
670
  ])
671
671
  };
672
672
  }
673
- function Ha(e, t) {
673
+ function Ua(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 Ua(e) {
679
+ function Qa(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 Bo(e) {
686
+ function Bi(e) {
687
687
  if (!e || typeof e != "object" || Array.isArray(e))
688
688
  return;
689
689
  const t = e;
@@ -694,7 +694,7 @@ function Bo(e) {
694
694
  if (t.kind === "matrix_measure" && typeof t.measureId == "string" && t.measureId.trim())
695
695
  return { kind: "matrix_measure", measureId: t.measureId };
696
696
  }
697
- function Je(e) {
697
+ function Ye(e) {
698
698
  const t = Dt(e);
699
699
  return typeof e == "string" && e === t ? t : void 0;
700
700
  }
@@ -702,12 +702,12 @@ function zt(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(
705
- (n) => Je(n.value)
705
+ (n) => Ye(n.value)
706
706
  );
707
707
  if (t.length === 0 || t.some((n) => !n))
708
708
  return { diagnostic: "invalid_currency_option" };
709
709
  if (e.requiredAtExecution) {
710
- const n = e.initialValueStrategy === "saved_default" ? Je(e.defaultValue) : void 0;
710
+ const n = e.initialValueStrategy === "saved_default" ? Ye(e.defaultValue) : void 0;
711
711
  if (!n || !t.includes(n))
712
712
  return { diagnostic: "invalid_control_default" };
713
713
  }
@@ -716,7 +716,7 @@ function zt(e) {
716
716
  currencies: t
717
717
  };
718
718
  }
719
- function Qa(e) {
719
+ function $a(e) {
720
720
  return "control" in zt(e);
721
721
  }
722
722
  function Lt(e) {
@@ -742,7 +742,7 @@ function Lt(e) {
742
742
  )
743
743
  };
744
744
  }
745
- function $a(e) {
745
+ function Wa(e) {
746
746
  return Lt({
747
747
  ...e,
748
748
  referencedControlIds: new Set(
@@ -753,7 +753,7 @@ function $a(e) {
753
753
  )
754
754
  });
755
755
  }
756
- function Wa(e) {
756
+ function Za(e) {
757
757
  var t;
758
758
  return Lt({
759
759
  ...e,
@@ -784,19 +784,19 @@ function Gt(e, t) {
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 = Bo(
787
+ const i = Bi(
788
788
  n.presentationTarget
789
789
  );
790
- if (!o)
790
+ if (!i)
791
791
  return {
792
792
  diagnostic: { code: "missing_target", controlId: r }
793
793
  };
794
- const i = z(o);
795
- if (!t.knownKeys.has(i))
794
+ const o = z(i);
795
+ if (!t.knownKeys.has(o))
796
796
  return {
797
797
  diagnostic: { code: "stale_target", controlId: r }
798
798
  };
799
- if (!t.eligibleKeys.has(i))
799
+ if (!t.eligibleKeys.has(o))
800
800
  return {
801
801
  diagnostic: { code: "inapplicable_target", controlId: r }
802
802
  };
@@ -811,24 +811,24 @@ function Gt(e, t) {
811
811
  } : {
812
812
  binding: {
813
813
  controlId: r,
814
- presentationTarget: o,
814
+ presentationTarget: i,
815
815
  control: s.control,
816
816
  currencies: s.currencies
817
817
  }
818
818
  };
819
819
  }
820
- function Za(e) {
820
+ function Ja(e) {
821
821
  const t = Kt(e);
822
822
  return (e.bindings || []).flatMap((n) => {
823
823
  const r = Gt(n, t);
824
824
  return "diagnostic" in r ? [r.diagnostic] : [];
825
825
  });
826
826
  }
827
- function Eo(e) {
828
- var o;
827
+ function Ei(e) {
828
+ var i;
829
829
  const t = [], n = z(e.target), r = Kt(e);
830
- for (const i of e.bindings || []) {
831
- const a = Gt(i, r);
830
+ for (const o of e.bindings || []) {
831
+ const a = Gt(o, r);
832
832
  if ("diagnostic" in a) {
833
833
  t.push(a.diagnostic);
834
834
  continue;
@@ -838,19 +838,19 @@ function Eo(e) {
838
838
  s.presentationTarget
839
839
  ) !== n) continue;
840
840
  const c = Dt(
841
- (o = e.values) == null ? void 0 : o[s.control.id]
841
+ (i = e.values) == null ? void 0 : i[s.control.id]
842
842
  );
843
843
  if (!(!c || !s.currencies.includes(c)))
844
844
  return { currency: c, diagnostics: t };
845
845
  }
846
846
  return { diagnostics: t };
847
847
  }
848
- function Ro(e, t, n, r) {
849
- const o = { ...e, config: { ...e.config, matrix: t } }, i = Ao(o, [], r), a = Nt(o, r), s = { ...t.presentation.measureFormats };
848
+ function Ri(e, t, n, r) {
849
+ const i = { ...e, config: { ...e.config, matrix: t } }, o = Ai(i, [], r), a = Nt(i, r), s = { ...t.presentation.measureFormats };
850
850
  for (const l of a) {
851
- const c = { kind: "matrix_measure", measureId: l.measureId }, { currency: d } = Eo({
851
+ const c = { kind: "matrix_measure", measureId: l.measureId }, { currency: d } = Ei({
852
852
  ...n,
853
- ...i,
853
+ ...o,
854
854
  bindings: e.controlBindings,
855
855
  target: c
856
856
  });
@@ -860,7 +860,7 @@ function Ro(e, t, n, r) {
860
860
  }
861
861
  return { ...t.presentation, measureFormats: s };
862
862
  }
863
- function qo(e, t) {
863
+ function qi(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 qo(e, t) {
905
905
  return e;
906
906
  }
907
907
  }
908
- function No(e, t) {
908
+ function Ni(e, t) {
909
909
  return {
910
910
  id: e.id,
911
911
  scope: e.scope,
912
912
  type: e.type,
913
- source: qo(e.source, t),
913
+ source: qi(e.source, t),
914
914
  initialValueStrategy: e.initialValueStrategy,
915
915
  defaultValue: e.defaultValue,
916
916
  requiredAtExecution: e.requiredAtExecution,
@@ -925,14 +925,14 @@ function No(e, t) {
925
925
  } : {}
926
926
  };
927
927
  }
928
- function jo(e, t) {
928
+ function ji(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(
932
932
  Object.entries(e.mapping).sort(([n], [r]) => n.localeCompare(r)).map(([n, r]) => {
933
933
  if ("kind" in r) return [n, r];
934
- const o = { ...r };
935
- return delete o.format, delete o.dateFormat, delete o.customFormat, delete o.semanticTemporalPresentation, [n, o];
934
+ const i = { ...r };
935
+ return delete i.format, delete i.dateFormat, delete i.customFormat, delete i.semanticTemporalPresentation, [n, i];
936
936
  })
937
937
  )
938
938
  } : {
@@ -942,7 +942,7 @@ function jo(e, t) {
942
942
  n,
943
943
  r && typeof r == "object" && !Array.isArray(r) ? Object.fromEntries(
944
944
  Object.entries(r).sort(
945
- ([o], [i]) => o.localeCompare(i)
945
+ ([i], [o]) => i.localeCompare(o)
946
946
  )
947
947
  ) : r
948
948
  ])
@@ -950,32 +950,32 @@ function jo(e, t) {
950
950
  };
951
951
  }
952
952
  function Xe(e = [], t) {
953
- return [...e].map((n) => No(n, t)).sort(
953
+ return [...e].map((n) => Ni(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 zo(e = [], t) {
957
+ function zi(e = [], t) {
958
958
  return e.filter(
959
959
  (n) => (t == null ? void 0 : t.includePresentation) || !de(n)
960
- ).map((n) => jo(n, t)).sort(
960
+ ).map((n) => ji(n, t)).sort(
961
961
  (n, r) => _(n).localeCompare(_(r))
962
962
  );
963
963
  }
964
- function Lo(e, t) {
964
+ function Li(e, t) {
965
965
  return e ? _({
966
966
  controlDefinitions: Xe(e.controlDefinitions, t),
967
967
  cardControlDefinitions: Xe(
968
968
  e.cardControlDefinitions,
969
969
  t
970
970
  ),
971
- controlBindings: zo(e.controlBindings, t)
971
+ controlBindings: zi(e.controlBindings, t)
972
972
  }) : "__none__";
973
973
  }
974
- const Ko = ["table", "detailTable"], et = (e) => Ko.includes(e.type), Go = "calendar-context";
975
- function Ho(e) {
976
- const { id: t, label: n, field: r, ...o } = e;
974
+ const Ki = ["table", "detailTable"], et = (e) => Ki.includes(e.type), Gi = "calendar-context";
975
+ function Hi(e) {
976
+ const { id: t, label: n, field: r, ...i } = e;
977
977
  return {
978
- ...o,
978
+ ...i,
979
979
  field: Be(
980
980
  r
981
981
  )
@@ -984,15 +984,15 @@ function Ho(e) {
984
984
  function ge(e) {
985
985
  if (!e)
986
986
  return;
987
- const { id: t, conditions: n, groups: r, ...o } = e;
987
+ const { id: t, conditions: n, groups: r, ...i } = e;
988
988
  return {
989
- ...o,
990
- conditions: n.map(Ho),
991
- groups: r.map((i) => ge(i))
989
+ ...i,
990
+ conditions: n.map(Hi),
991
+ groups: r.map((o) => ge(o))
992
992
  };
993
993
  }
994
994
  function Be(e) {
995
- var r, o;
995
+ var r, i;
996
996
  const { label: t, ...n } = e;
997
997
  return {
998
998
  ...n,
@@ -1004,7 +1004,7 @@ function Be(e) {
1004
1004
  )
1005
1005
  }
1006
1006
  } : {},
1007
- ...(o = e.parameters) != null && o.filters ? {
1007
+ ...(i = e.parameters) != null && i.filters ? {
1008
1008
  parameters: {
1009
1009
  ...e.parameters,
1010
1010
  filters: ge(
@@ -1014,7 +1014,7 @@ function Be(e) {
1014
1014
  } : {}
1015
1015
  };
1016
1016
  }
1017
- function Uo(e) {
1017
+ function Ui(e) {
1018
1018
  const t = (n) => n == null ? void 0 : n.map(Be);
1019
1019
  return {
1020
1020
  ...e,
@@ -1026,44 +1026,44 @@ function Uo(e) {
1026
1026
  filters: e.filters ? ge(e.filters) : void 0
1027
1027
  };
1028
1028
  }
1029
- function Qo(e, t, n) {
1029
+ function Qi(e, t, n) {
1030
1030
  if (!e)
1031
1031
  return JSON.stringify(e);
1032
- if (n === "matrixTable" && e.matrix) return _(Hr(e.matrix.spec));
1033
- const { matrix: r, ...o } = e, i = t ? Uo(o) : o;
1032
+ if (n === "matrixTable" && e.matrix) return _(Ur(e.matrix.spec));
1033
+ const { matrix: r, ...i } = e, o = t ? Ui(i) : i;
1034
1034
  return JSON.stringify({
1035
- ...i,
1036
- filters: ge(i.filters)
1035
+ ...o,
1036
+ filters: ge(o.filters)
1037
1037
  });
1038
1038
  }
1039
- function $o(e) {
1039
+ function $i(e) {
1040
1040
  if (!e)
1041
1041
  return null;
1042
1042
  const { format: t, ...n } = e;
1043
1043
  return n;
1044
1044
  }
1045
- function Wo(e, t) {
1045
+ function Wi(e, t) {
1046
1046
  const n = /* @__PURE__ */ new Map();
1047
- for (const o of (t == null ? void 0 : t.controlDefinitions) || [])
1048
- n.set(o.id, o.type);
1049
- for (const o of (t == null ? void 0 : t.cardControlDefinitions) || [])
1050
- n.set(o.id, o.type);
1047
+ for (const i of (t == null ? void 0 : t.controlDefinitions) || [])
1048
+ n.set(i.id, i.type);
1049
+ for (const i of (t == null ? void 0 : t.cardControlDefinitions) || [])
1050
+ n.set(i.id, i.type);
1051
1051
  const r = Object.fromEntries(
1052
- Object.entries(e || {}).map(([o, i]) => n.get(o) === "multi_enum" && Array.isArray(i) ? [
1053
- o,
1054
- [...i].sort(
1052
+ Object.entries(e || {}).map(([i, o]) => n.get(i) === "multi_enum" && Array.isArray(o) ? [
1053
+ i,
1054
+ [...o].sort(
1055
1055
  (a, s) => _(a).localeCompare(_(s))
1056
1056
  )
1057
- ] : [o, i])
1057
+ ] : [i, o])
1058
1058
  );
1059
1059
  return _(r);
1060
1060
  }
1061
- function Zo(e, {
1061
+ function Zi(e, {
1062
1062
  finalFiltersKey: t,
1063
1063
  cardFilterValues: n,
1064
1064
  controlValues: r,
1065
- controlDefinitions: o,
1066
- cardControlDefinitions: i,
1065
+ controlDefinitions: i,
1066
+ cardControlDefinitions: o,
1067
1067
  controlBindings: a,
1068
1068
  queryRelevantConfig: s,
1069
1069
  resolvedPrimaryDateField: l,
@@ -1087,24 +1087,24 @@ function Zo(e, {
1087
1087
  y,
1088
1088
  p,
1089
1089
  JSON.stringify(n),
1090
- Wo(r, {
1091
- controlDefinitions: o,
1092
- cardControlDefinitions: i
1090
+ Wi(r, {
1091
+ controlDefinitions: i,
1092
+ cardControlDefinitions: o
1093
1093
  }),
1094
- Lo({
1095
- controlDefinitions: o,
1096
- cardControlDefinitions: i,
1094
+ Li({
1095
+ controlDefinitions: i,
1096
+ cardControlDefinitions: o,
1097
1097
  controlBindings: a
1098
1098
  }),
1099
1099
  _(
1100
- $o(l)
1100
+ $i(l)
1101
1101
  ),
1102
1102
  _(c ?? null),
1103
- Go,
1103
+ Gi,
1104
1104
  _(d),
1105
1105
  JSON.stringify(f),
1106
1106
  JSON.stringify(m),
1107
- Qo(
1107
+ Qi(
1108
1108
  I,
1109
1109
  C,
1110
1110
  e.type
@@ -1112,20 +1112,20 @@ function Zo(e, {
1112
1112
  t
1113
1113
  ];
1114
1114
  }
1115
- function Yo(e, t, n) {
1115
+ function Ji(e, t, n) {
1116
1116
  var s, l, c;
1117
- const r = Zo(e, t), o = _(r), i = ((s = n == null ? void 0 : n.resolvePaginationConfig) == null ? void 0 : s.call(n, o)) ?? e.paginationConfig, a = et(e) && ue(e.config) || et(e) && e.sql && ((c = (l = e.preferences) == null ? void 0 : l.tablePrefs) == null ? void 0 : c.enableDevModePagination);
1117
+ const r = Zi(e, t), i = _(r), o = ((s = n == null ? void 0 : n.resolvePaginationConfig) == null ? void 0 : s.call(n, i)) ?? e.paginationConfig, a = et(e) && ue(e.config) || et(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,
1121
- a ? JSON.stringify(i) : ""
1121
+ a ? JSON.stringify(o) : ""
1122
1122
  ],
1123
- queryInputIdentity: o,
1124
- paginationConfig: i
1123
+ queryInputIdentity: i,
1124
+ paginationConfig: o
1125
1125
  };
1126
1126
  }
1127
- function Jo(e, t, n, r) {
1128
- return Yo(
1127
+ function Yi(e, t, n, r) {
1128
+ return Ji(
1129
1129
  e,
1130
1130
  {
1131
1131
  finalFiltersKey: t.finalFiltersKey,
@@ -1142,32 +1142,32 @@ function Jo(e, t, n, r) {
1142
1142
  r
1143
1143
  );
1144
1144
  }
1145
- const Xo = 500, ei = 250;
1145
+ const Xi = 500, eo = 250;
1146
1146
  function De(e) {
1147
1147
  return e.type === "table" || e.type === "detailTable";
1148
1148
  }
1149
- function ti(e) {
1149
+ function to(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
1153
  function Ya(e) {
1154
- return e === "export-full-with-cap" ? Xo : ei;
1154
+ return e === "export-full-with-cap" ? Xi : eo;
1155
1155
  }
1156
- function ni({
1156
+ function no({
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 ? ti(e) : !!(e.sql && ((c = (l = e.preferences) == null ? void 0 : l.tablePrefs) != null && c.enableDevModePagination));
1164
- return !i && (a || s);
1163
+ const i = n && r !== void 0 && De(e), o = t && !i, a = ue(e.config) && De(e) && !e.sql, s = i ? to(e) : !!(e.sql && ((c = (l = e.preferences) == null ? void 0 : l.tablePrefs) != null && c.enableDevModePagination));
1164
+ return !o && (a || s);
1165
1165
  }
1166
- function ri(e) {
1166
+ function ro(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 Ja({
1170
+ function Xa({
1171
1171
  current: e,
1172
1172
  defaultPageSize: t,
1173
1173
  queryInputIdentity: n
@@ -1180,10 +1180,10 @@ function Ja({
1180
1180
  pageSize: (e == null ? void 0 : e.pageSize) ?? t
1181
1181
  };
1182
1182
  }
1183
- function Xa(e, t, n) {
1183
+ function es(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 es(e, t) {
1186
+ function ts(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 es(e, t) {
1191
1191
  hasPrevPage: t.page > 1
1192
1192
  };
1193
1193
  }
1194
- function oi(e) {
1195
- return { page: 1, pageSize: ri(e) };
1194
+ function io(e) {
1195
+ return { page: 1, pageSize: ro(e) };
1196
1196
  }
1197
- function ii(e) {
1197
+ function oo(e) {
1198
1198
  var a, s, l, c, d;
1199
- const { card: t } = e, n = ni({
1199
+ const { card: t } = e, n = no({
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 : Bn(t, e.finalConfig), i = !!((l = e.display) != null && l.deliveryStrict && e.display.isTablePrintMode && !e.documentSection && $r(t.type));
1204
+ }), { page: r } = e, i = e.documentSection && !e.documentSection.totalsRow ? void 0 : Bn(t, e.finalConfig), o = !!((l = e.display) != null && l.deliveryStrict && e.display.isTablePrintMode && !e.documentSection && Wr(t.type));
1205
1205
  return {
1206
- ...o ? { tableTotalsRequest: o } : {},
1207
- ...i ? { sourceRowProbe: { limit: Wr.maxTableRows } } : {},
1206
+ ...i ? { tableTotalsRequest: i } : {},
1207
+ ...o ? { sourceRowProbe: { limit: Zr.maxTableRows } } : {},
1208
1208
  ...n ? {
1209
1209
  pagination: {
1210
1210
  page: (r == null ? void 0 : r.page) || 1,
@@ -1213,14 +1213,14 @@ function ii(e) {
1213
1213
  } : {}
1214
1214
  };
1215
1215
  }
1216
- function ai(e, t = {}) {
1217
- var o, i, a;
1218
- const n = ((o = e.connectionId) == null ? void 0 : o.trim()) || void 0;
1216
+ function ao(e, t = {}) {
1217
+ var i, o, a;
1218
+ const n = ((i = e.connectionId) == null ? void 0 : i.trim()) || void 0;
1219
1219
  if (t.editorDevMode) return n;
1220
- const r = ((a = (i = e.dataSource) == null ? void 0 : i.connectionId) == null ? void 0 : a.trim()) || void 0;
1220
+ const r = ((a = (o = e.dataSource) == null ? void 0 : o.connectionId) == null ? void 0 : a.trim()) || void 0;
1221
1221
  return e.sql ? n || r : r || n;
1222
1222
  }
1223
- function si(e, t) {
1223
+ function so(e, t) {
1224
1224
  var n;
1225
1225
  return {
1226
1226
  connectionId: t,
@@ -1229,20 +1229,20 @@ function si(e, t) {
1229
1229
  selectedEntities: []
1230
1230
  };
1231
1231
  }
1232
- function ts(e, t, n = {}) {
1233
- const r = ai(e, n);
1232
+ function ns(e, t, n = {}) {
1233
+ const r = ao(e, n);
1234
1234
  if (!r)
1235
1235
  throw new Error("No connection ID found for card");
1236
- const o = t.cardDataSource || e.dataSource;
1236
+ const i = t.cardDataSource || e.dataSource;
1237
1237
  return {
1238
1238
  connectionId: r,
1239
1239
  requestPayloadBase: {
1240
1240
  ...t,
1241
- cardDataSource: n.liveDataSource ? o : o || si(e, r)
1241
+ cardDataSource: n.liveDataSource ? i : i || so(e, r)
1242
1242
  }
1243
1243
  };
1244
1244
  }
1245
- const li = /* @__PURE__ */ new Set([
1245
+ const lo = /* @__PURE__ */ new Set([
1246
1246
  "day",
1247
1247
  "week",
1248
1248
  "month",
@@ -1252,16 +1252,16 @@ const li = /* @__PURE__ */ new Set([
1252
1252
  "minute",
1253
1253
  "second"
1254
1254
  ]);
1255
- function ci(e) {
1255
+ function co(e) {
1256
1256
  let t = e.spec;
1257
1257
  const n = ut(
1258
1258
  e.controlDefinitions || [],
1259
1259
  e.cardControlDefinitions || []
1260
1260
  ), r = (e.controlBindings || []).filter(
1261
1261
  (p) => p.target !== "sql_param"
1262
- ), o = r.filter(
1263
- (p) => p.target === "config_metric_selector" || p.target === "config_field_selector"
1264
1262
  ), i = r.filter(
1263
+ (p) => p.target === "config_metric_selector" || p.target === "config_field_selector"
1264
+ ), o = r.filter(
1265
1265
  (p) => p.target === "config_grain" || p.target === "config_aggregation"
1266
1266
  ), a = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map();
1267
1267
  let l;
@@ -1283,10 +1283,10 @@ function ci(e) {
1283
1283
  if (p.derivedField) return p.derivedField.dataType;
1284
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
1285
  return I.length > 1 ? d("The selected field is ambiguous in the authorized Matrix field catalog.", b) : W(((C = I[0]) == null ? void 0 : C.field.dataType) ?? p.dataType);
1286
- }, f = (p, b) => En(p, b.target, (I) => u(I, b.controlId)), m = Tr.safeParse(t);
1286
+ }, f = (p, b) => En(p, b.target, (I) => u(I, b.controlId)), m = Vr.safeParse(t);
1287
1287
  if (!m.success) return d(m.error.message);
1288
1288
  t = m.data;
1289
- const y = [...o, ...i].map((p) => {
1289
+ const y = [...i, ...o].map((p) => {
1290
1290
  const b = ft({ 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,
@@ -1304,7 +1304,7 @@ function ci(e) {
1304
1304
  const V = (v) => {
1305
1305
  const S = (c().byId.get(v.id) ?? []).filter((k) => !v.source || Ce(v.source, k.field.source ?? e.spec.source));
1306
1306
  if (S.length !== 1) return C(S.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 = Mr.safeParse(S[0].field);
1307
+ const M = kr.safeParse(S[0].field);
1308
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
1310
  if (h) {
@@ -1313,7 +1313,7 @@ function ci(e) {
1313
1313
  (F) => F.id === x && F.kind === "aggregate"
1314
1314
  );
1315
1315
  x !== void 0 && !v && C("The selected Matrix aggregate measure is no longer available.");
1316
- const S = p.target === "config_metric_selector" && !v ? Rn({ binding: p, selectedValue: I }) : void 0, M = ((v == null ? void 0 : v.kind) === "aggregate" ? v.aggregate : S == null ? void 0 : S.aggregate) ?? (p.target === "config_aggregation" ? Le({ binding: p, selectedValue: I }) : void 0), k = M === void 0 ? void 0 : Vr.safeParse(M);
1316
+ const S = p.target === "config_metric_selector" && !v ? Rn({ binding: p, selectedValue: I }) : void 0, M = ((v == null ? void 0 : v.kind) === "aggregate" ? v.aggregate : S == null ? void 0 : S.aggregate) ?? (p.target === "config_aggregation" ? Le({ binding: p, selectedValue: I }) : void 0), k = M === void 0 ? void 0 : Mr.safeParse(M);
1317
1317
  k && !k.success && C("This aggregation is not supported by Matrix."), t = {
1318
1318
  ...t,
1319
1319
  measures: t.measures.map(
@@ -1331,7 +1331,7 @@ function ci(e) {
1331
1331
  );
1332
1332
  x !== void 0 && !v && C("The selected Matrix level is no longer available.");
1333
1333
  const S = p.target === "config_field_selector" && !v ? qn({ binding: p, selectedValue: I }) : void 0, M = p.target === "config_grain" ? Le({ binding: p, selectedValue: I }) : v ? v.grain : S == null ? void 0 : S.granularity;
1334
- M !== void 0 && !li.has(M) && C("This time grain is not supported by Matrix.");
1334
+ M !== void 0 && !lo.has(M) && C("This time grain is not supported by Matrix.");
1335
1335
  const k = (F) => F.map((T) => {
1336
1336
  if (T.id !== b) return T;
1337
1337
  const w = (v == null ? void 0 : v.field) ?? (S ? V(S) : T.field), E = u(w, p.controlId), R = M ?? (S && ne(E) ? T.grain : void 0);
@@ -1353,45 +1353,45 @@ function ci(e) {
1353
1353
  try {
1354
1354
  return jn(m.data, t);
1355
1355
  } catch (p) {
1356
- if (p instanceof _r) return d(p.message);
1356
+ if (p instanceof Ar) return d(p.message);
1357
1357
  throw p;
1358
1358
  }
1359
1359
  }
1360
1360
  function Ht(e, t) {
1361
- const n = [], r = (o) => {
1362
- if (o.source) {
1363
- const i = kr.safeParse(o.source);
1364
- if (i.success) n.push(i.data);
1365
- else if (t) throw i.error;
1361
+ const n = [], r = (i) => {
1362
+ if (i.source) {
1363
+ const o = xr.safeParse(i.source);
1364
+ if (o.success) n.push(o.data);
1365
+ else if (t) throw o.error;
1366
1366
  }
1367
- o.derivedField && Object.values(o.derivedField.inputs).forEach((i) => r(i.field));
1367
+ i.derivedField && Object.values(i.derivedField.inputs).forEach((o) => r(o.field));
1368
1368
  };
1369
- for (const o of e) {
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 !== he ? [o.mapping[i]] : [] : Object.values(o.mapping);
1369
+ for (const i of e) {
1370
+ if (i.target !== "config_field_selector" && i.target !== "config_metric_selector") continue;
1371
+ const o = t == null ? void 0 : t.get(i), a = t ? o && o !== he ? [i.mapping[o]] : [] : Object.values(i.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 di(e, t = [], n = []) {
1377
+ function uo(e, t = [], n = []) {
1378
1378
  return vt([...pt(e), ...Ht(t), ...n]);
1379
1379
  }
1380
- function ui(e, t = {}) {
1381
- const n = t.controlBindings ?? [], r = ut(t.controlDefinitions ?? [], t.cardControlDefinitions ?? []), o = new Map(n.filter((i) => i.target === "config_field_selector" || i.target === "config_metric_selector").map((i) => [i, ft({ binding: i, definitions: r, controlValues: t.controlValues })]));
1382
- return vt([...pt(e), ...Ht(n, o)]);
1380
+ function fo(e, t = {}) {
1381
+ const n = t.controlBindings ?? [], r = ut(t.controlDefinitions ?? [], t.cardControlDefinitions ?? []), i = new Map(n.filter((o) => o.target === "config_field_selector" || o.target === "config_metric_selector").map((o) => [o, ft({ binding: o, definitions: r, controlValues: t.controlValues })]));
1382
+ return vt([...pt(e), ...Ht(n, i)]);
1383
1383
  }
1384
- function fi(e, t) {
1385
- return Te(e) ? pi(e, t) : e.config ?? {};
1384
+ function po(e, t) {
1385
+ return Te(e) ? mo(e, t) : e.config ?? {};
1386
1386
  }
1387
- function pi(e, t) {
1387
+ function mo(e, t) {
1388
1388
  var r;
1389
1389
  const n = (r = t == null ? void 0 : t.steps[t.steps.length - 1]) == null ? void 0 : r.toField;
1390
- return n ? Do(e.config ?? {}, n, {
1390
+ return n ? Di(e.config ?? {}, n, {
1391
1391
  sortPolicy: "retargetDimensionSort"
1392
1392
  }) : e.config ?? {};
1393
1393
  }
1394
- function mi(e, t) {
1394
+ function go(e, t) {
1395
1395
  const n = (e == null ? void 0 : e.steps) ?? [];
1396
1396
  if (n.length !== 0)
1397
1397
  return {
@@ -1399,20 +1399,20 @@ function mi(e, t) {
1399
1399
  logicalOperator: "AND",
1400
1400
  negate: !1,
1401
1401
  conditions: [],
1402
- groups: n.map((r, o) => ({
1403
- id: `breadcrumb-${o}`,
1402
+ groups: n.map((r, i) => ({
1403
+ id: `breadcrumb-${i}`,
1404
1404
  logicalOperator: "OR",
1405
1405
  negate: !1,
1406
1406
  conditions: [],
1407
1407
  groups: [
1408
1408
  {
1409
- id: `breadcrumb-${o}-group-0`,
1409
+ id: `breadcrumb-${i}-group-0`,
1410
1410
  logicalOperator: "AND",
1411
1411
  negate: !1,
1412
1412
  conditions: r.conditions.map(
1413
- (i) => Zr(
1414
- i,
1415
- `${i.field.id}-${i.value}`
1413
+ (o) => Jr(
1414
+ o,
1415
+ `${o.field.id}-${o.value}`
1416
1416
  )
1417
1417
  ),
1418
1418
  groups: []
@@ -1425,16 +1425,16 @@ const ye = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
1425
1425
  function H(e) {
1426
1426
  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";
1427
1427
  }
1428
- function gi(e) {
1428
+ function yo(e) {
1429
1429
  const t = e;
1430
1430
  return t.valueType === "date" || t.relativeMeta !== void 0 || t.temporalBucket !== void 0 || ne(t.dataType);
1431
1431
  }
1432
- function yi(e) {
1432
+ function bo(e) {
1433
1433
  const t = ye(e.field) ? e.field : void 0;
1434
1434
  return e.temporalBucket !== void 0 || e.rawTemporal !== void 0 || e.relativeMeta !== void 0 || ne(t == null ? void 0 : t.dataType);
1435
1435
  }
1436
1436
  function Ut(e) {
1437
- return e ? [...(e.conditions ?? []).filter(yi).map((n) => {
1437
+ return e ? [...(e.conditions ?? []).filter(bo).map((n) => {
1438
1438
  const r = ye(n.field) ? n.field : {};
1439
1439
  return {
1440
1440
  field: r.qualifiedFieldName ?? r.name,
@@ -1447,13 +1447,13 @@ function Ut(e) {
1447
1447
  }), ...(e.groups ?? []).flatMap((n) => Ut(n))] : [];
1448
1448
  }
1449
1449
  function tt(e) {
1450
- const t = e.filterValues.filter(gi).map((r) => {
1451
- const o = r, i = ye(o.fieldMeta) ? o.fieldMeta : void 0;
1450
+ const t = e.filterValues.filter(yo).map((r) => {
1451
+ const i = r, o = ye(i.fieldMeta) ? i.fieldMeta : void 0;
1452
1452
  return {
1453
- field: (i == null ? void 0 : i.qualifiedFieldName) ?? o.name,
1454
- operation: o.operation,
1455
- ...o.relativeMeta !== void 0 ? { relativeMeta: o.relativeMeta } : { values: o.values },
1456
- temporalBucket: o.temporalBucket
1453
+ field: (o == null ? void 0 : o.qualifiedFieldName) ?? i.name,
1454
+ operation: i.operation,
1455
+ ...i.relativeMeta !== void 0 ? { relativeMeta: i.relativeMeta } : { values: i.values },
1456
+ temporalBucket: i.temporalBucket
1457
1457
  };
1458
1458
  }), n = Ut(e.selectionFilters);
1459
1459
  return H({
@@ -1462,31 +1462,31 @@ function tt(e) {
1462
1462
  ...e.zoom ? { zoom: [e.zoom.from, e.zoom.to] } : {}
1463
1463
  });
1464
1464
  }
1465
- function bi(e, t, n) {
1465
+ function Io(e, t, n) {
1466
1466
  if (!t || n.drillActive || t.madeUnder !== n.currentFingerprint) return e;
1467
1467
  const r = e.groupByColumns ?? [];
1468
- return r.some((o) => o.id === t.fieldId && o.grainMode === "automatic") ? {
1468
+ return r.some((i) => i.id === t.fieldId && i.grainMode === "automatic") ? {
1469
1469
  ...e,
1470
- groupByColumns: r.map((o) => {
1471
- if (o.id !== t.fieldId || o.grainMode !== "automatic") return o;
1472
- const { grainMode: i, ...a } = o;
1470
+ groupByColumns: r.map((i) => {
1471
+ if (i.id !== t.fieldId || i.grainMode !== "automatic") return i;
1472
+ const { grainMode: o, ...a } = i;
1473
1473
  return { ...a, granularity: t.granularity };
1474
1474
  })
1475
1475
  } : e;
1476
1476
  }
1477
- function ns(e) {
1477
+ function rs(e) {
1478
1478
  var t;
1479
1479
  return (((t = e.config) == null ? void 0 : t.groupByColumns) ?? []).find(
1480
1480
  (n) => n.grainMode === "automatic" && Kn({ cardType: e.type, configBacked: !0, shelf: "groupBy", dataType: n.dataType }).ok
1481
1481
  );
1482
1482
  }
1483
- function Ii(e, t) {
1484
- if (!e || !t || t.id !== e.fieldId || xr(t)) return;
1483
+ function Co(e, t) {
1484
+ if (!e || !t || t.id !== e.fieldId || Pr(t)) return;
1485
1485
  const {
1486
1486
  granularity: n,
1487
1487
  grainMode: r,
1488
- dateFormat: o,
1489
- timeDrillPath: i,
1488
+ dateFormat: i,
1489
+ timeDrillPath: o,
1490
1490
  ...a
1491
1491
  } = t;
1492
1492
  return {
@@ -1505,36 +1505,36 @@ function Ii(e, t) {
1505
1505
  groups: []
1506
1506
  };
1507
1507
  }
1508
- function rs(e, t, n) {
1509
- const r = Ge(e, n), o = Ge(t, n);
1510
- if (!r || !o) return;
1511
- const [i, a] = r.first <= o.first ? [r, o] : [o, r];
1512
- return { from: i.first, to: a.last };
1508
+ function is(e, t, n) {
1509
+ const r = Ge(e, n), i = Ge(t, n);
1510
+ if (!r || !i) return;
1511
+ const [o, a] = r.first <= i.first ? [r, i] : [i, r];
1512
+ return { from: o.first, to: a.last };
1513
1513
  }
1514
- function Ci(e, t, n) {
1514
+ function ho(e, t, n) {
1515
1515
  if (!e || e.madeUnder !== n) return;
1516
- const r = t == null ? void 0 : t.find((i) => i.id === e.fieldId && i.grainMode === "automatic"), o = Ii(e, r);
1517
- return o ? { zoom: e, filterGroup: o } : void 0;
1516
+ const r = t == null ? void 0 : t.find((o) => o.id === e.fieldId && o.grainMode === "automatic"), i = Co(e, r);
1517
+ return i ? { zoom: e, filterGroup: i } : void 0;
1518
1518
  }
1519
1519
  function os(e, t, n) {
1520
1520
  if (!e) return;
1521
- const [r, o] = t <= n ? [t, n] : [n, t];
1522
- if (r < 0 || o >= e.length) return;
1523
- const i = e.slice(r, o + 1);
1524
- if (!i.every((d) => typeof d == "string" && d !== "")) return;
1525
- const a = [...i].sort(), s = a[0], l = a[a.length - 1];
1521
+ const [r, i] = t <= n ? [t, n] : [n, t];
1522
+ if (r < 0 || i >= e.length) return;
1523
+ const o = e.slice(r, i + 1);
1524
+ if (!o.every((d) => typeof d == "string" && d !== "")) return;
1525
+ const a = [...o].sort(), s = a[0], l = a[a.length - 1];
1526
1526
  return e.some(
1527
- (d, u) => (u < r || u > o) && typeof d == "string" && d > s && d < l
1527
+ (d, u) => (u < r || u > i) && typeof d == "string" && d > s && d < l
1528
1528
  ) ? void 0 : { first: s, last: l };
1529
1529
  }
1530
- function is(e, t, n) {
1530
+ function as(e, t, n) {
1531
1531
  if (!t || !n) return { from: e.from, to: e.to };
1532
- const r = Qe(new Date(t.startInclusive), n), o = Qe(new Date(Date.parse(t.endExclusive) - 1), n), i = e.from < r ? r : e.from, a = e.to > o ? o : e.to;
1533
- return i <= a ? { from: i, to: a } : { from: e.from, to: e.to };
1532
+ const r = Qe(new Date(t.startInclusive), n), i = Qe(new Date(Date.parse(t.endExclusive) - 1), n), o = e.from < r ? r : e.from, a = e.to > i ? i : e.to;
1533
+ return o <= a ? { from: o, to: a } : { from: e.from, to: e.to };
1534
1534
  }
1535
- function as(e, t, n) {
1536
- const r = (i) => /* @__PURE__ */ new Date(`${i}T00:00:00.000Z`), o = new Intl.DateTimeFormat(t, { dateStyle: n, timeZone: "UTC" });
1537
- return e.from === e.to ? o.format(r(e.from)) : o.formatRange(r(e.from), r(e.to));
1535
+ function ss(e, t, n) {
1536
+ const r = (o) => /* @__PURE__ */ new Date(`${o}T00:00:00.000Z`), i = new Intl.DateTimeFormat(t, { dateStyle: n, timeZone: "UTC" });
1537
+ return e.from === e.to ? i.format(r(e.from)) : i.formatRange(r(e.from), r(e.to));
1538
1538
  }
1539
1539
  function Ee(e) {
1540
1540
  return e === "in" || e === "not in";
@@ -1542,69 +1542,71 @@ function Ee(e) {
1542
1542
  function Re(e) {
1543
1543
  return e === "not in" ? "exclude" : "include";
1544
1544
  }
1545
- function hi(e) {
1545
+ function vo(e) {
1546
1546
  return e === "exclude" ? "not in" : "in";
1547
1547
  }
1548
- function ss(e) {
1548
+ function ls(e) {
1549
1549
  var n;
1550
1550
  const t = (n = e.liveValue) == null ? void 0 : n.operation;
1551
1551
  return Ee(t) ? Re(t) : e.pendingMode ?? e.authoredMode;
1552
1552
  }
1553
- function vi(e) {
1553
+ function Fo(e) {
1554
1554
  var r;
1555
1555
  let t = !1;
1556
- const n = (r = e.inputs) == null ? void 0 : r.map((o) => {
1557
- if (o.kind !== "filter" || !o.filter) return o;
1558
- const i = Fi(
1559
- o.filter,
1560
- new Set(Di(e.defaultInputValues, o))
1556
+ const n = (r = e.inputs) == null ? void 0 : r.map((i) => {
1557
+ if (i.kind !== "filter" || !i.filter) return i;
1558
+ const o = Do(
1559
+ i.filter,
1560
+ new Set(So(e.defaultInputValues, i))
1561
1561
  );
1562
- return i === o.filter ? o : (t = !0, { ...o, filter: i });
1562
+ return o === i.filter ? i : (t = !0, { ...i, filter: o });
1563
1563
  });
1564
1564
  return t ? { ...e, inputs: n } : e;
1565
1565
  }
1566
- function Fi(e, t) {
1566
+ function Do(e, t) {
1567
1567
  if (t.size !== 1 || !Ee(e.operation))
1568
1568
  return e;
1569
1569
  const [n] = t;
1570
- return Re(e.operation) === n ? e : { ...e, operation: hi(n) };
1570
+ return Re(e.operation) === n ? e : { ...e, operation: vo(n) };
1571
1571
  }
1572
- function Di(e, t) {
1573
- var o;
1574
- const n = (i) => Object.values(i ?? {}).map((a) => a[t.id]);
1575
- 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(
1576
- (i) => (i == null ? void 0 : i.status) === "set" && i.value.kind === "filter" ? Si(i.value.filterValue) : []
1572
+ function So(e, t) {
1573
+ var i;
1574
+ const n = (o) => Object.values(o ?? {}).map((a) => a[t.id]);
1575
+ return (t.runtimeScope === "shared" ? [(i = e == null ? void 0 : e.shared) == null ? void 0 : i[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(
1576
+ (o) => (o == null ? void 0 : o.status) === "set" && o.value.kind === "filter" ? To(o.value.filterValue) : []
1577
1577
  );
1578
1578
  }
1579
- function Si(e) {
1579
+ function To(e) {
1580
1580
  return Ee(e.operation) ? [Re(e.operation)] : [];
1581
1581
  }
1582
- function ls(e) {
1583
- const t = St(e), r = A(t).issues.length ? t : Sa(t);
1584
- return vo(vi(r)).dashboard;
1582
+ function cs(e) {
1583
+ const t = St(e), r = A(t).issues.length ? t : Ta(t);
1584
+ return vi(
1585
+ Gn(Fo(r))
1586
+ ).dashboard;
1585
1587
  }
1586
1588
  function qe(e, t) {
1587
1589
  const n = {};
1588
1590
  for (const r of Vt(e)) {
1589
1591
  if (!r.inlineFilters || r.inlineFilters.length === 0)
1590
1592
  continue;
1591
- const o = [];
1592
- for (const i of r.inlineFilters) {
1593
- const a = Gn(i, t);
1594
- a && o.push(a);
1593
+ const i = [];
1594
+ for (const o of r.inlineFilters) {
1595
+ const a = Hn(o, t);
1596
+ a && i.push(a);
1595
1597
  }
1596
- o.length > 0 && (n[r.id] = o);
1598
+ i.length > 0 && (n[r.id] = i);
1597
1599
  }
1598
1600
  return n;
1599
1601
  }
1600
1602
  function $(e) {
1601
1603
  const t = fe(e ?? {}), n = [];
1602
- for (const [r, o] of Object.entries(t.shared ?? {}))
1603
- n.push({ scope: "shared", target: null, inputId: r, slot: o });
1604
+ for (const [r, i] of Object.entries(t.shared ?? {}))
1605
+ n.push({ scope: "shared", target: null, inputId: r, slot: i });
1604
1606
  for (const r of ["bySheetId", "byCardId"])
1605
- for (const [o, i] of Object.entries(t[r] ?? {}))
1606
- for (const [a, s] of Object.entries(i))
1607
- n.push({ scope: r, target: o, inputId: a, slot: s });
1607
+ for (const [i, o] of Object.entries(t[r] ?? {}))
1608
+ for (const [a, s] of Object.entries(o))
1609
+ n.push({ scope: r, target: i, inputId: a, slot: s });
1608
1610
  return n;
1609
1611
  }
1610
1612
  function le(e, t, n) {
@@ -1613,8 +1615,8 @@ function le(e, t, n) {
1613
1615
  r.shared = { ...r.shared, [t.inputId]: n };
1614
1616
  return;
1615
1617
  }
1616
- const o = { ...r[t.scope] ?? {} };
1617
- o[t.target] = { ...o[t.target], [t.inputId]: n }, r[t.scope] = o;
1618
+ const i = { ...r[t.scope] ?? {} };
1619
+ i[t.target] = { ...i[t.target], [t.inputId]: n }, r[t.scope] = i;
1618
1620
  }
1619
1621
  function Qt(e, t, n) {
1620
1622
  const r = mt(
@@ -1637,24 +1639,24 @@ function Ne(e, t, n) {
1637
1639
  n
1638
1640
  );
1639
1641
  }
1640
- function cs(e, t, n) {
1642
+ function ds(e, t, n) {
1641
1643
  return $t(e, t, n);
1642
1644
  }
1643
1645
  function $t(e, t, n) {
1644
- 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 ? Un({
1646
+ const r = e.sheets ?? [], i = r.filter((s) => (s.kind ?? "dashboard") === "dashboard").map((s) => s.id), o = r.filter((s) => s.kind === "document"), a = i.length ? Qn({
1645
1647
  dashboard: e,
1646
- sheetIds: o,
1648
+ sheetIds: i,
1647
1649
  mode: "dashboard",
1648
1650
  runtimeValues: t,
1649
1651
  transientContexts: void 0,
1650
1652
  calendar: n ?? null
1651
1653
  }).snapshot.dashboardInputValues : {};
1652
- return i.reduce(
1654
+ return o.reduce(
1653
1655
  (s, l) => {
1654
1656
  var c;
1655
1657
  return xe(
1656
1658
  s,
1657
- Qn({
1659
+ $n({
1658
1660
  dashboard: e,
1659
1661
  sheetId: l.id,
1660
1662
  sheetKind: "document",
@@ -1672,37 +1674,37 @@ function $t(e, t, n) {
1672
1674
  );
1673
1675
  }
1674
1676
  function Wt(e, t) {
1675
- const n = {}, r = {}, o = /* @__PURE__ */ new Map();
1676
- for (const i of $(t)) {
1677
- 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;
1677
+ const n = {}, r = {}, i = /* @__PURE__ */ new Map();
1678
+ for (const o of $(t)) {
1679
+ const a = e.get(o.inputId), { slot: s } = o, l = () => s.status === "set" && s.value.kind === "filter" ? s.value.filterValue : s.status === "cleared" ? null : void 0;
1678
1680
  if ((a == null ? void 0 : a.source) === "cardInlineFilter") {
1679
1681
  const c = l();
1680
1682
  if (c !== void 0) {
1681
- const d = o.get(a.cardId) ?? /* @__PURE__ */ new Map();
1682
- d.set(a.filterId, c), o.set(a.cardId, d);
1683
+ const d = i.get(a.cardId) ?? /* @__PURE__ */ new Map();
1684
+ d.set(a.filterId, c), i.set(a.cardId, d);
1683
1685
  }
1684
1686
  } else if ((a == null ? void 0 : a.source) === "dashboardControl" || (a == null ? void 0 : a.source) === "cardControl")
1685
1687
  s.status === "set" && s.value.kind === "control" ? r[a.controlId] = s.value.value : s.status === "cleared" && (r[a.controlId] = void 0);
1686
1688
  else {
1687
- le(n, i, s);
1689
+ le(n, o, s);
1688
1690
  continue;
1689
1691
  }
1690
- s.comparisonSelection && le(n, i, {
1692
+ s.comparisonSelection && le(n, o, {
1691
1693
  comparisonSelection: s.comparisonSelection
1692
1694
  });
1693
1695
  }
1694
1696
  return {
1695
1697
  runtime: fe(n),
1696
1698
  controlValues: r,
1697
- inlineFilterValues: o
1699
+ inlineFilterValues: i
1698
1700
  };
1699
1701
  }
1700
- function Ti(e, t) {
1702
+ function Vo(e, t) {
1701
1703
  if (!t.size) return [...e];
1702
- const n = e.filter((o) => !t.has(o.filterId)), r = [...t.values()].filter(
1703
- (o) => o !== null
1704
+ const n = e.filter((i) => !t.has(i.filterId)), r = [...t.values()].filter(
1705
+ (i) => i !== null
1704
1706
  );
1705
- return $n(n, r);
1707
+ return Wn(n, r);
1706
1708
  }
1707
1709
  function Zt(e, t, n) {
1708
1710
  if (!Object.keys(n).length) return t;
@@ -1712,31 +1714,31 @@ function Zt(e, t, n) {
1712
1714
  { hasExplicitRuntimeOverrides: t !== void 0 }
1713
1715
  );
1714
1716
  return {
1715
- ...Hn({
1717
+ ...Un({
1716
1718
  dashboardValues: r.dashboardControlValues,
1717
1719
  cardValuesMap: r.cardControlValuesMap
1718
1720
  }),
1719
1721
  ...n
1720
1722
  };
1721
1723
  }
1722
- function Vi(e, t) {
1724
+ function Mo(e, t) {
1723
1725
  if (!t.size) return;
1724
1726
  const n = Object.fromEntries(
1725
- Object.entries(e).map(([r, o]) => [r, [...o]])
1727
+ Object.entries(e).map(([r, i]) => [r, [...i]])
1726
1728
  );
1727
- for (const [r, o] of t)
1728
- n[r] = Ti(n[r] ?? [], o);
1729
+ for (const [r, i] of t)
1730
+ n[r] = Vo(n[r] ?? [], i);
1729
1731
  return n;
1730
1732
  }
1731
- function Mi(e, t, n) {
1733
+ function ko(e, t, n) {
1732
1734
  const r = new Map(
1733
1735
  j(e).map(({ card: a }) => [
1734
1736
  a.id,
1735
1737
  new Map((a.inlineFilters ?? []).map((s) => [s.id, s]))
1736
1738
  ])
1737
1739
  );
1738
- let o = !1;
1739
- const i = Object.fromEntries(
1740
+ let i = !1;
1741
+ const o = Object.fromEntries(
1740
1742
  Object.entries(t).map(([a, s]) => [a, [...s]])
1741
1743
  );
1742
1744
  for (const [a, s] of Object.entries(n)) {
@@ -1744,52 +1746,52 @@ function Mi(e, t, n) {
1744
1746
  const u = l == null ? void 0 : l.get(d.filterId);
1745
1747
  return u ? ke(u, d) : !1;
1746
1748
  });
1747
- pe(c, i[a] ?? []) || (o = !0), i[a] = c;
1749
+ pe(c, o[a] ?? []) || (i = !0), o[a] = c;
1748
1750
  }
1749
- return o ? i : void 0;
1751
+ return i ? o : void 0;
1750
1752
  }
1751
- function ds(e) {
1752
- const { dashboard: t, capture: n, calendar: r } = e, o = Cn(t, n.filterValues, {
1753
+ function us(e) {
1754
+ const { dashboard: t, capture: n, calendar: r } = e, i = Cn(t, n.filterValues, {
1753
1755
  calendar: r
1754
- }), i = n.dashboardInputExecutionSnapshot, a = n.controlValues, s = {
1756
+ }), o = n.dashboardInputExecutionSnapshot, a = n.controlValues, s = {
1755
1757
  ...Qt(
1756
1758
  t,
1757
1759
  {
1758
- adHocFilterValues: o.adHocFilterValues,
1760
+ adHocFilterValues: i.adHocFilterValues,
1759
1761
  controlOverrides: a,
1760
1762
  // The snapshot replays exactly over the listed values.
1761
- dashboardInputValues: i ? xe(
1762
- o.slots,
1763
- Zn({
1763
+ dashboardInputValues: o ? xe(
1764
+ i.slots,
1765
+ Jn({
1764
1766
  dashboard: t,
1765
- dashboardInputValues: i.dashboardInputValues,
1766
- sheetId: i.sheetId,
1767
- cardId: i.cardId
1767
+ dashboardInputValues: o.dashboardInputValues,
1768
+ sheetId: o.sheetId,
1769
+ cardId: o.cardId
1768
1770
  })
1769
- ) : o.slots
1771
+ ) : i.slots
1770
1772
  },
1771
1773
  r
1772
1774
  ),
1773
- cardViewState: i ? Wn(i.cardViewState) : {}
1774
- }, l = i ? Yn(i.transientContexts) : void 0;
1775
+ cardViewState: o ? Zn(o.cardViewState) : {}
1776
+ }, l = o ? Yn(o.transientContexts) : void 0;
1775
1777
  return {
1776
1778
  runtimeValues: s,
1777
1779
  controlOverrides: a,
1778
1780
  ...l != null && l.length ? { transientContexts: l } : {}
1779
1781
  };
1780
1782
  }
1781
- function us(e, t) {
1783
+ function fs(e, t) {
1782
1784
  const { controlContractOverrides: n, cardId: r } = t;
1783
1785
  if (!n || (n.controlDefinitions !== void 0 && (e.controls = n.controlDefinitions), typeof r != "string" || r.trim().length === 0))
1784
1786
  return e;
1785
- const o = Z(e, r);
1786
- return o && (n.cardControlDefinitions !== void 0 && (o.controls = n.cardControlDefinitions), n.controlBindings !== void 0 && (o.controlBindings = n.controlBindings)), e;
1787
+ const i = Z(e, r);
1788
+ return i && (n.cardControlDefinitions !== void 0 && (i.controls = n.cardControlDefinitions), n.controlBindings !== void 0 && (i.controlBindings = n.controlBindings)), e;
1787
1789
  }
1788
- const ki = ["bySheetId", "byCardId", "byDocumentSectionId"];
1789
- function xi(e, t) {
1790
+ const xo = ["bySheetId", "byCardId", "byDocumentSectionId"];
1791
+ function Po(e, t) {
1790
1792
  const n = A(e);
1791
1793
  let r = !1;
1792
- const o = (a) => {
1794
+ const i = (a) => {
1793
1795
  if (!a) return a;
1794
1796
  const s = Object.entries(a).filter(([l, c]) => {
1795
1797
  var u;
@@ -1798,67 +1800,67 @@ function xi(e, t) {
1798
1800
  return !d || ke(d, c.value.filterValue) ? !0 : (r = !0, !1);
1799
1801
  });
1800
1802
  return Object.fromEntries(s);
1801
- }, i = {
1803
+ }, o = {
1802
1804
  ...t,
1803
- ...t.shared ? { shared: o(t.shared) } : {}
1805
+ ...t.shared ? { shared: i(t.shared) } : {}
1804
1806
  };
1805
- for (const a of ki) {
1807
+ for (const a of xo) {
1806
1808
  const s = t[a];
1807
- s && (i[a] = Object.fromEntries(
1808
- Object.entries(s).map(([l, c]) => [l, o(c) ?? {}])
1809
+ s && (o[a] = Object.fromEntries(
1810
+ Object.entries(s).map(([l, c]) => [l, i(c) ?? {}])
1809
1811
  ));
1810
1812
  }
1811
- return r ? i : t;
1813
+ return r ? o : t;
1812
1814
  }
1813
- function Pi(e) {
1815
+ function wo(e) {
1814
1816
  var t, n;
1815
1817
  return ((n = (t = e.sheets) == null ? void 0 : t[0]) == null ? void 0 : n.id) ?? null;
1816
1818
  }
1817
- function Y(e, t) {
1819
+ function J(e, t) {
1818
1820
  var n;
1819
1821
  return !!t && !!((n = e.sheets) != null && n.some((r) => r.id === t));
1820
1822
  }
1821
- function fs(e) {
1822
- const { dashboard: t, host: n, calendar: r } = e, o = Cn(t, n.filterValues, {
1823
+ function ps(e) {
1824
+ const { dashboard: t, host: n, calendar: r } = e, i = Cn(t, n.filterValues, {
1823
1825
  calendar: r
1824
- }).slots, i = n.controlValues, a = Y(t, n.selectedSheetId) ? n.selectedSheetId : Pi(t);
1826
+ }).slots, o = n.controlValues, a = J(t, n.selectedSheetId) ? n.selectedSheetId : wo(t);
1825
1827
  return {
1826
- hostInputValues: o,
1827
- controlOverrides: i,
1828
+ hostInputValues: i,
1829
+ controlOverrides: o,
1828
1830
  selectedSheetId: a,
1829
1831
  hostSelectedSheetId: n.selectedSheetId ?? null,
1830
1832
  materializedInputs: e.materializeInputs === !1 ? {} : Ne(
1831
1833
  t,
1832
1834
  {
1833
1835
  adHocFilterValues: [],
1834
- controlOverrides: i,
1835
- dashboardInputValues: o
1836
+ controlOverrides: o,
1837
+ dashboardInputValues: i
1836
1838
  },
1837
1839
  r
1838
1840
  )
1839
1841
  };
1840
1842
  }
1841
- function Yt(e) {
1843
+ function Jt(e) {
1842
1844
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
1843
- for (const o of Pe(e))
1844
- 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);
1845
+ for (const i of Pe(e))
1846
+ i.kind === "filter" && i.filter ? t.set(i.id, i.filter) : i.kind === "control" && n.add(i.id), i.compatibility && r.set(i.id, i.compatibility);
1845
1847
  return { filterInputs: t, controlInputIds: n, compatibility: r };
1846
1848
  }
1847
- function Jt(e, t) {
1849
+ function Yt(e, t) {
1848
1850
  const n = Ft(t);
1849
1851
  if (!n) return;
1850
1852
  const r = Z(e, n);
1851
- return r ? Jn(r, e) ? "applies" : "not-eligible" : "removed";
1853
+ return r ? Xn(r, e) ? "applies" : "not-eligible" : "removed";
1852
1854
  }
1853
- function ps(e, t) {
1854
- const n = Jt(e, t);
1855
+ function ms(e, t) {
1856
+ const n = Yt(e, t);
1855
1857
  return n ? n === "applies" : Pe(e).some(
1856
1858
  (r) => r.id === t
1857
1859
  );
1858
1860
  }
1859
1861
  function Xt(e, t, n, r) {
1860
1862
  if (!n) return {};
1861
- const o = new Set((e.sheets ?? []).map((c) => c.id)), i = new Set(
1863
+ const i = new Set((e.sheets ?? []).map((c) => c.id)), o = new Set(
1862
1864
  j(e).map(({ card: c }) => c.id)
1863
1865
  ), a = A(e), s = (c) => {
1864
1866
  var u;
@@ -1867,7 +1869,7 @@ function Xt(e, t, n, r) {
1867
1869
  for (const [f, m] of Object.entries(c)) {
1868
1870
  const y = t.filterInputs.has(f) || t.controlInputIds.has(f) ? f : ((u = a.findFilterInput({ inputId: f })) == null ? void 0 : u.input.id) ?? f;
1869
1871
  if (y !== f && c[y]) continue;
1870
- const p = Jt(e, y);
1872
+ const p = Yt(e, y);
1871
1873
  if (p) {
1872
1874
  if (p !== "applies") {
1873
1875
  r.push({
@@ -1924,23 +1926,23 @@ function Xt(e, t, n, r) {
1924
1926
  };
1925
1927
  return fe({
1926
1928
  shared: s(n.shared),
1927
- bySheetId: l(n.bySheetId, (c) => o.has(c)),
1928
- byCardId: l(n.byCardId, (c) => i.has(c))
1929
+ bySheetId: l(n.bySheetId, (c) => i.has(c)),
1930
+ byCardId: l(n.byCardId, (c) => o.has(c))
1929
1931
  // Document sections are not viewer state.
1930
1932
  });
1931
1933
  }
1932
1934
  function O(e, t, n, r = {}) {
1933
- const o = new Map(
1935
+ const i = new Map(
1934
1936
  j(e).map(({ card: a }) => [a.id, a])
1935
- ), i = {};
1937
+ ), o = {};
1936
1938
  for (const [a, s] of Object.entries(t ?? {})) {
1937
- const l = o.get(a);
1938
- if (l && Nr(l)) {
1939
- jr(s) || (i[a] = s);
1939
+ const l = i.get(a);
1940
+ if (l && jr(l)) {
1941
+ zr(s) || (o[a] = s);
1940
1942
  continue;
1941
1943
  }
1942
- if (l && r.sessionSorts && zr(l)) {
1943
- s.sort && (i[a] = { sort: s.sort });
1944
+ if (l && r.sessionSorts && Lr(l)) {
1945
+ s.sort && (o[a] = { sort: s.sort });
1944
1946
  continue;
1945
1947
  }
1946
1948
  n == null || n.push({
@@ -1950,11 +1952,11 @@ function O(e, t, n, r = {}) {
1950
1952
  reason: Z(e, a) ? "not-eligible" : "removed"
1951
1953
  });
1952
1954
  }
1953
- return i;
1955
+ return o;
1954
1956
  }
1955
- function wi(e, t, n) {
1957
+ function Oo(e, t, n) {
1956
1958
  if (t) {
1957
- if (Y(e, t)) return t;
1959
+ if (J(e, t)) return t;
1958
1960
  n.push({
1959
1961
  kind: "setting-no-longer-applies",
1960
1962
  target: "sheet",
@@ -2004,18 +2006,18 @@ function N(e, t) {
2004
2006
  };
2005
2007
  }
2006
2008
  function nt(e, t, n, r) {
2007
- const { dashboard: o, baseline: i } = e, a = [], s = Mt(t.state, _e), l = s.ok ? s.value : {};
2009
+ const { dashboard: i, baseline: o } = e, a = [], s = Mt(t.state, _e), l = s.ok ? s.value : {};
2008
2010
  for (const y of s.ok ? s.issues : [])
2009
- a.push(Oi(y));
2010
- const c = Yt(o), d = Wt(
2011
+ a.push(_o(y));
2012
+ const c = Jt(i), d = Wt(
2011
2013
  c.compatibility,
2012
- Xt(o, c, l.inputs, a)
2013
- ), u = wi(o, l.selectedSheetId, a) ?? i.selectedSheetId, f = O(
2014
- o,
2014
+ Xt(i, c, l.inputs, a)
2015
+ ), u = Oo(i, l.selectedSheetId, a) ?? o.selectedSheetId, f = O(
2016
+ i,
2015
2017
  l.tableSettings,
2016
2018
  a
2017
2019
  ), m = O(
2018
- o,
2020
+ i,
2019
2021
  n,
2020
2022
  void 0
2021
2023
  );
@@ -2024,18 +2026,18 @@ function nt(e, t, n, r) {
2024
2026
  // A bookmark opens without ad-hoc values, as today (P4a-02 f).
2025
2027
  adHocFilterValues: [],
2026
2028
  controlOverrides: Zt(
2027
- o,
2028
- i.controlOverrides,
2029
+ i,
2030
+ o.controlOverrides,
2029
2031
  d.controlValues
2030
2032
  ),
2031
2033
  // Overlay, never replacement: the bookmark's slots over the host's.
2032
2034
  dashboardInputValues: xe(
2033
- i.hostInputValues,
2035
+ o.hostInputValues,
2034
2036
  d.runtime
2035
2037
  ),
2036
2038
  ...nn(
2037
- Vi(
2038
- qe(o, e.calendar),
2039
+ Mo(
2040
+ qe(i, e.calendar),
2039
2041
  d.inlineFilterValues
2040
2042
  )
2041
2043
  ),
@@ -2054,7 +2056,7 @@ function nt(e, t, n, r) {
2054
2056
  notices: a
2055
2057
  });
2056
2058
  }
2057
- function Oi(e) {
2059
+ function _o(e) {
2058
2060
  return {
2059
2061
  kind: "setting-no-longer-applies",
2060
2062
  target: e.target,
@@ -2066,30 +2068,30 @@ function nn(e) {
2066
2068
  return e ? { inlineFilterValuesMap: e } : {};
2067
2069
  }
2068
2070
  function rt(e, t, n) {
2069
- const { dashboard: r, baseline: o } = e;
2071
+ const { dashboard: r, baseline: i } = e;
2070
2072
  return {
2071
2073
  // A reload in place keeps ad-hoc values, as today (P4a-02 f), unless the
2072
2074
  // template now defines a filter with that id.
2073
2075
  adHocFilterValues: t.adHocFilterValues.filter(
2074
- (i) => !A(r).findFilterInput({ filterId: i.filterId })
2076
+ (o) => !A(r).findFilterInput({ filterId: o.filterId })
2075
2077
  ),
2076
2078
  // A host's new control defaults are the baseline's, not the viewer's.
2077
- controlOverrides: n.controlsChanged ? o.controlOverrides : t.controlOverrides,
2079
+ controlOverrides: n.controlsChanged ? i.controlOverrides : t.controlOverrides,
2078
2080
  // Live slots stay, except a filter value this template no longer accepts:
2079
2081
  // that filter loads its new default, as the old list did. The resolver
2080
2082
  // ignores slots this template no longer has.
2081
- dashboardInputValues: xi(
2083
+ dashboardInputValues: Po(
2082
2084
  r,
2083
2085
  t.dashboardInputValues
2084
2086
  ),
2085
2087
  ...nn(
2086
- Mi(
2088
+ ko(
2087
2089
  r,
2088
2090
  qe(r, e.calendar),
2089
2091
  t.inlineFilterValuesMap ?? {}
2090
2092
  )
2091
2093
  ),
2092
- selectedSheetId: !n.sheetChanged && Y(r, t.selectedSheetId) ? t.selectedSheetId : o.selectedSheetId,
2094
+ selectedSheetId: !n.sheetChanged && J(r, t.selectedSheetId) ? t.selectedSheetId : i.selectedSheetId,
2093
2095
  tableSettings: O(
2094
2096
  r,
2095
2097
  t.tableSettings,
@@ -2098,42 +2100,42 @@ function rt(e, t, n) {
2098
2100
  )
2099
2101
  };
2100
2102
  }
2101
- function ms(e) {
2102
- const { dashboard: t, baseline: n, event: r } = e, o = e.rememberedTableSettings;
2103
+ function gs(e) {
2104
+ const { dashboard: t, baseline: n, event: r } = e, i = e.rememberedTableSettings;
2103
2105
  switch (r.kind) {
2104
2106
  case "initial-load":
2105
- return r.defaultBookmark ? nt(e, r.defaultBookmark, o, {
2107
+ return r.defaultBookmark ? nt(e, r.defaultBookmark, i, {
2106
2108
  writeRemembered: !1
2107
2109
  }) : N(e, {
2108
2110
  appliedBookmarkId: null,
2109
2111
  ...X(
2110
2112
  n,
2111
- O(t, o, void 0, {
2113
+ O(t, i, void 0, {
2112
2114
  sessionSorts: r.captured
2113
2115
  })
2114
2116
  )
2115
2117
  });
2116
2118
  case "refetch": {
2117
- const { live: i } = r, a = i.applied, s = {
2118
- sheetChanged: !!i.previousBaseline && i.previousBaseline.hostSelectedSheetId !== n.hostSelectedSheetId,
2119
- controlsChanged: !!i.previousBaseline && !pe(
2120
- i.previousBaseline.controlOverrides ?? null,
2119
+ const { live: o } = r, a = o.applied, s = {
2120
+ sheetChanged: !!o.previousBaseline && o.previousBaseline.hostSelectedSheetId !== n.hostSelectedSheetId,
2121
+ controlsChanged: !!o.previousBaseline && !pe(
2122
+ o.previousBaseline.controlOverrides ?? null,
2121
2123
  n.controlOverrides ?? null
2122
2124
  )
2123
2125
  }, l = rt(
2124
2126
  e,
2125
2127
  {
2126
- adHocFilterValues: i.adHocFilterValues,
2127
- controlOverrides: i.controlValues ?? n.controlOverrides,
2128
- dashboardInputValues: i.dashboardInputValues,
2129
- inlineFilterValuesMap: i.inlineFilterValuesMap,
2130
- selectedSheetId: i.selectedSheetId,
2131
- tableSettings: i.tableSettings
2128
+ adHocFilterValues: o.adHocFilterValues,
2129
+ controlOverrides: o.controlValues ?? n.controlOverrides,
2130
+ dashboardInputValues: o.dashboardInputValues,
2131
+ inlineFilterValuesMap: o.inlineFilterValuesMap,
2132
+ selectedSheetId: o.selectedSheetId,
2133
+ tableSettings: o.tableSettings
2132
2134
  },
2133
2135
  s
2134
2136
  ), c = a ? rt(e, a.restore, s) : X(
2135
2137
  n,
2136
- O(t, o, void 0)
2138
+ O(t, i, void 0)
2137
2139
  );
2138
2140
  return N(e, {
2139
2141
  appliedBookmarkId: (a == null ? void 0 : a.appliedBookmarkId) ?? null,
@@ -2143,7 +2145,7 @@ function ms(e) {
2143
2145
  });
2144
2146
  }
2145
2147
  case "open-bookmark":
2146
- return nt(e, r.bookmark, o, {
2148
+ return nt(e, r.bookmark, i, {
2147
2149
  writeRemembered: !0
2148
2150
  });
2149
2151
  case "open-default-view":
@@ -2151,7 +2153,7 @@ function ms(e) {
2151
2153
  appliedBookmarkId: null,
2152
2154
  ...X(
2153
2155
  n,
2154
- O(t, o, void 0)
2156
+ O(t, i, void 0)
2155
2157
  )
2156
2158
  });
2157
2159
  case "reset-to-default-view":
@@ -2161,12 +2163,12 @@ function ms(e) {
2161
2163
  rememberedWrites: [{ kind: "clear-all" }]
2162
2164
  });
2163
2165
  case "discard-changes": {
2164
- const { restore: i } = r.applied, a = O(
2166
+ const { restore: o } = r.applied, a = O(
2165
2167
  t,
2166
- i.tableSettings,
2168
+ o.tableSettings,
2167
2169
  void 0,
2168
2170
  { sessionSorts: !0 }
2169
- ), s = O(t, a, void 0), l = O(t, o, void 0), c = [];
2171
+ ), s = O(t, a, void 0), l = O(t, i, void 0), c = [];
2170
2172
  for (const d of /* @__PURE__ */ new Set([
2171
2173
  ...Object.keys(l),
2172
2174
  ...Object.keys(s)
@@ -2179,18 +2181,18 @@ function ms(e) {
2179
2181
  }
2180
2182
  return N(e, {
2181
2183
  appliedBookmarkId: r.applied.appliedBookmarkId,
2182
- ...i,
2183
- selectedSheetId: Y(t, i.selectedSheetId) ? i.selectedSheetId : n.selectedSheetId,
2184
+ ...o,
2185
+ selectedSheetId: J(t, o.selectedSheetId) ? o.selectedSheetId : n.selectedSheetId,
2184
2186
  tableSettings: a,
2185
2187
  rememberedWrites: c,
2186
2188
  notices: r.applied.notices,
2187
- restore: i
2189
+ restore: o
2188
2190
  });
2189
2191
  }
2190
2192
  }
2191
2193
  }
2192
- function gs(e) {
2193
- const { dashboard: t, calendar: n } = e, r = e.hostControlValues, o = {
2194
+ function ys(e) {
2195
+ const { dashboard: t, calendar: n } = e, r = e.hostControlValues, i = {
2194
2196
  ...e.baseline,
2195
2197
  controlOverrides: r,
2196
2198
  materializedInputs: Ne(
@@ -2203,12 +2205,12 @@ function gs(e) {
2203
2205
  n
2204
2206
  )
2205
2207
  };
2206
- let i = r;
2208
+ let o = r;
2207
2209
  if (e.appliedBookmark) {
2208
2210
  const l = Mt(
2209
2211
  e.appliedBookmark.state,
2210
2212
  _e
2211
- ), c = Yt(t), d = Wt(
2213
+ ), c = Jt(t), d = Wt(
2212
2214
  c.compatibility,
2213
2215
  Xt(
2214
2216
  t,
@@ -2217,23 +2219,23 @@ function gs(e) {
2217
2219
  []
2218
2220
  )
2219
2221
  ).controlValues;
2220
- i = Zt(t, r, d);
2222
+ o = Zt(t, r, d);
2221
2223
  }
2222
2224
  const a = e.applied;
2223
- if (!a) return { baseline: o, controlOverrides: i, applied: null };
2224
- const s = { ...a.restore, controlOverrides: i };
2225
+ if (!a) return { baseline: i, controlOverrides: o, applied: null };
2226
+ const s = { ...a.restore, controlOverrides: o };
2225
2227
  return {
2226
- baseline: o,
2227
- controlOverrides: i,
2228
+ baseline: i,
2229
+ controlOverrides: o,
2228
2230
  applied: {
2229
2231
  ...a,
2230
- controlOverrides: i,
2232
+ controlOverrides: o,
2231
2233
  restore: s,
2232
- opened: tn({ dashboard: t, baseline: o, calendar: n }, s)
2234
+ opened: tn({ dashboard: t, baseline: i, calendar: n }, s)
2233
2235
  }
2234
2236
  };
2235
2237
  }
2236
- function ys(e, t, n) {
2238
+ function bs(e, t, n) {
2237
2239
  const r = en(n.values);
2238
2240
  return {
2239
2241
  ...r,
@@ -2244,68 +2246,68 @@ function ys(e, t, n) {
2244
2246
  restore: r
2245
2247
  };
2246
2248
  }
2247
- const ot = (e) => JSON.stringify([e.scope, e.target, e.inputId]);
2249
+ const it = (e) => JSON.stringify([e.scope, e.target, e.inputId]);
2248
2250
  function ee(e) {
2249
2251
  return !e || e.status === "cleared" && !e.comparisonSelection;
2250
2252
  }
2251
2253
  function rn(e, t) {
2252
2254
  const n = new Map(
2253
- $(e).map((i) => [ot(i), i])
2255
+ $(e).map((o) => [it(o), o])
2254
2256
  ), r = new Map(
2255
- $(t).map((i) => [ot(i), i])
2256
- ), o = {};
2257
- for (const [i, a] of r) {
2258
- const s = n.get(i);
2257
+ $(t).map((o) => [it(o), o])
2258
+ ), i = {};
2259
+ for (const [o, a] of r) {
2260
+ const s = n.get(o);
2259
2261
  s && pe(s.slot, a.slot) || ee(a.slot) && ee(s == null ? void 0 : s.slot) || le(
2260
- o,
2262
+ i,
2261
2263
  a,
2262
2264
  ee(a.slot) ? { status: "cleared" } : a.slot
2263
2265
  );
2264
2266
  }
2265
- for (const [i, a] of n)
2266
- r.has(i) || ee(a.slot) || le(o, a, { status: "cleared" });
2267
- return fe(o);
2267
+ for (const [o, a] of n)
2268
+ r.has(o) || ee(a.slot) || le(i, a, { status: "cleared" });
2269
+ return fe(i);
2268
2270
  }
2269
- function bs(e) {
2270
- const { dashboard: t, baseline: n, current: r } = e, o = rn(n.materializedInputs, r.inputs), i = O(
2271
+ function Is(e) {
2272
+ const { dashboard: t, baseline: n, current: r } = e, i = rn(n.materializedInputs, r.inputs), o = O(
2271
2273
  t,
2272
2274
  r.tableSettings,
2273
2275
  void 0
2274
- ), a = r.selectedSheetId && r.selectedSheetId !== n.selectedSheetId && Y(t, r.selectedSheetId) ? r.selectedSheetId : void 0;
2276
+ ), a = r.selectedSheetId && r.selectedSheetId !== n.selectedSheetId && J(t, r.selectedSheetId) ? r.selectedSheetId : void 0;
2275
2277
  return {
2276
2278
  version: _e,
2277
2279
  ...a ? { selectedSheetId: a } : {},
2278
- ...$(o).length ? { inputs: o } : {},
2279
- ...Object.keys(i).length ? { tableSettings: i } : {}
2280
+ ...$(i).length ? { inputs: i } : {},
2281
+ ...Object.keys(o).length ? { tableSettings: o } : {}
2280
2282
  };
2281
2283
  }
2282
- function _i(e) {
2284
+ function Ao(e) {
2283
2285
  const t = /* @__PURE__ */ new Map();
2284
2286
  for (const n of Pe(e))
2285
2287
  n.label && t.set(n.id, n.label);
2286
2288
  return t;
2287
2289
  }
2288
- function Ai(e, t, n) {
2289
- var o, i;
2290
+ function Bo(e, t, n) {
2291
+ var i, o;
2290
2292
  const r = Ft(n);
2291
2293
  if (r) {
2292
- const a = (i = (o = Z(e, r)) == null ? void 0 : o.title) == null ? void 0 : i.trim();
2294
+ const a = (o = (i = Z(e, r)) == null ? void 0 : i.title) == null ? void 0 : o.trim();
2293
2295
  return a ? `Selection in ${a}` : "Selection";
2294
2296
  }
2295
2297
  return t.get(n) ?? n;
2296
2298
  }
2297
- function Is(e) {
2299
+ function Cs(e) {
2298
2300
  var c, d;
2299
- const { dashboard: t, opened: n, current: r } = e, o = [], i = _i(t), a = /* @__PURE__ */ new Set();
2301
+ const { dashboard: t, opened: n, current: r } = e, i = [], o = Ao(t), a = /* @__PURE__ */ new Set();
2300
2302
  for (const u of $(
2301
2303
  rn(n.inputs, r.inputs)
2302
2304
  ))
2303
- a.has(u.inputId) || (a.add(u.inputId), o.push({
2305
+ a.has(u.inputId) || (a.add(u.inputId), i.push({
2304
2306
  target: "input",
2305
2307
  inputId: u.inputId,
2306
- label: Ai(t, i, u.inputId)
2308
+ label: Bo(t, o, u.inputId)
2307
2309
  }));
2308
- (n.selectedSheetId ?? null) !== (r.selectedSheetId ?? null) && o.push({ target: "sheet" });
2310
+ (n.selectedSheetId ?? null) !== (r.selectedSheetId ?? null) && i.push({ target: "sheet" });
2309
2311
  const s = O(
2310
2312
  t,
2311
2313
  n.tableSettings,
@@ -2319,14 +2321,14 @@ function Is(e) {
2319
2321
  ...Object.keys(s),
2320
2322
  ...Object.keys(l)
2321
2323
  ]))
2322
- je(s[u], l[u]) || o.push({
2324
+ je(s[u], l[u]) || i.push({
2323
2325
  target: "table",
2324
2326
  cardId: u,
2325
2327
  cardTitle: ((d = (c = Z(t, u)) == null ? void 0 : c.title) == null ? void 0 : d.trim()) || "Table"
2326
2328
  });
2327
- return o;
2329
+ return i;
2328
2330
  }
2329
- function it(e) {
2331
+ function ot(e) {
2330
2332
  const t = U(e.filter);
2331
2333
  return {
2332
2334
  inputId: e.inputId,
@@ -2340,9 +2342,9 @@ function it(e) {
2340
2342
  }
2341
2343
  };
2342
2344
  }
2343
- function Bi(e) {
2344
- var o, i;
2345
- if ((o = e.card.sql) != null && o.trim())
2345
+ function Eo(e) {
2346
+ var i, o;
2347
+ if ((i = e.card.sql) != null && i.trim())
2346
2348
  return {
2347
2349
  inputs: e.inputs,
2348
2350
  fieldCandidates: [],
@@ -2350,7 +2352,7 @@ function Bi(e) {
2350
2352
  };
2351
2353
  const t = e.inputs.filter((a) => !U(a.filter)).map((a) => ({
2352
2354
  input: a,
2353
- resolution: Xn({
2355
+ resolution: er({
2354
2356
  filter: a.filter,
2355
2357
  filterValue: a.filterValue,
2356
2358
  effectiveFilterValue: a.effectiveFilterValue,
@@ -2364,13 +2366,13 @@ function Bi(e) {
2364
2366
  const n = e.inputs.find(
2365
2367
  (a) => U(a.filter)
2366
2368
  );
2367
- if (n && ((i = n.filterValue) == null ? void 0 : i.filterId) === n.filterId && n.effectiveFilterValue.filterId === n.filterId && er(n.effectiveFilterValue))
2369
+ if (n && ((o = n.filterValue) == null ? void 0 : o.filterId) === n.filterId && n.effectiveFilterValue.filterId === n.filterId && tr(n.effectiveFilterValue))
2368
2370
  return {
2369
2371
  inputs: e.inputs,
2370
2372
  fieldCandidates: t,
2371
2373
  resolution: {
2372
2374
  status: "resolved",
2373
- resolvedOwner: it(n)
2375
+ resolvedOwner: ot(n)
2374
2376
  }
2375
2377
  };
2376
2378
  const r = t.filter(
@@ -2381,7 +2383,7 @@ function Bi(e) {
2381
2383
  fieldCandidates: t,
2382
2384
  resolution: {
2383
2385
  status: "resolved",
2384
- resolvedOwner: it(r[0].input)
2386
+ resolvedOwner: ot(r[0].input)
2385
2387
  }
2386
2388
  } : r.length > 1 ? {
2387
2389
  inputs: e.inputs,
@@ -2394,7 +2396,7 @@ function Bi(e) {
2394
2396
  }
2395
2397
  } : { inputs: e.inputs, fieldCandidates: t, resolution: { status: "none" } };
2396
2398
  }
2397
- function Cs(e) {
2399
+ function hs(e) {
2398
2400
  const t = {
2399
2401
  ownerCardCount: 0,
2400
2402
  matchingCardCount: 0,
@@ -2403,16 +2405,16 @@ function Cs(e) {
2403
2405
  };
2404
2406
  for (const n of e.targets) {
2405
2407
  const r = n.plan.fieldCandidates.find(
2406
- (i) => i.input.inputId === e.inputId
2408
+ (o) => o.input.inputId === e.inputId
2407
2409
  );
2408
2410
  if (!r || r.resolution.status !== "eligible") continue;
2409
2411
  t.matchingCardCount += 1;
2410
- const { resolution: o } = n.plan;
2411
- o.status === "resolved" && o.resolvedOwner.inputId === e.inputId ? t.ownerCardCount += 1 : o.status === "resolved" && o.resolvedOwner.owner.kind === "global_date" ? t.globalPrecedenceCardCount += 1 : o.status === "ambiguous" && o.candidateInputIds.includes(e.inputId) && (t.ambiguousCardCount += 1);
2412
+ const { resolution: i } = n.plan;
2413
+ i.status === "resolved" && i.resolvedOwner.inputId === e.inputId ? t.ownerCardCount += 1 : i.status === "resolved" && i.resolvedOwner.owner.kind === "global_date" ? t.globalPrecedenceCardCount += 1 : i.status === "ambiguous" && i.candidateInputIds.includes(e.inputId) && (t.ambiguousCardCount += 1);
2412
2414
  }
2413
2415
  return t;
2414
2416
  }
2415
- const Ei = /* @__PURE__ */ new Set([
2417
+ const Ro = /* @__PURE__ */ new Set([
2416
2418
  "between",
2417
2419
  "not between",
2418
2420
  "=",
@@ -2423,27 +2425,27 @@ const Ei = /* @__PURE__ */ new Set([
2423
2425
  "<=",
2424
2426
  "is null",
2425
2427
  "is not null"
2426
- ]), Ri = /^(\d{4}-\d{2}-\d{2})T/, qi = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/;
2428
+ ]), qo = /^(\d{4}-\d{2}-\d{2})T/, No = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/;
2427
2429
  function ze(e) {
2428
- return Ei.has(e);
2430
+ return Ro.has(e);
2429
2431
  }
2430
- function Ni(e, t) {
2432
+ function jo(e, t) {
2431
2433
  if (e instanceof Date)
2432
2434
  return Number.isNaN(e.getTime()) ? e : t ? He(e, t, "yyyy-MM-dd") : e.toISOString().slice(0, 10);
2433
2435
  if (typeof e != "string")
2434
2436
  return e;
2435
2437
  const n = e.trim();
2436
- if (t && qi.test(n)) {
2437
- const o = new Date(n);
2438
- if (!Number.isNaN(o.getTime()))
2439
- return He(o, t, "yyyy-MM-dd");
2438
+ if (t && No.test(n)) {
2439
+ const i = new Date(n);
2440
+ if (!Number.isNaN(i.getTime()))
2441
+ return He(i, t, "yyyy-MM-dd");
2440
2442
  }
2441
- const r = Ri.exec(n);
2443
+ const r = qo.exec(n);
2442
2444
  return r ? r[1] : e;
2443
2445
  }
2444
2446
  function on(e, t) {
2445
2447
  return Array.isArray(e) ? e.map(
2446
- (n) => Ni(n, t)
2448
+ (n) => jo(n, t)
2447
2449
  ) : e;
2448
2450
  }
2449
2451
  function an(e) {
@@ -2457,7 +2459,7 @@ function sn(e) {
2457
2459
  globalDateFilter: t,
2458
2460
  globalDateFilterValue: n,
2459
2461
  timezone: r,
2460
- allowMinutePrecision: o = !1
2462
+ allowMinutePrecision: i = !1
2461
2463
  } = e;
2462
2464
  if (!t || !n)
2463
2465
  return;
@@ -2466,7 +2468,7 @@ function sn(e) {
2466
2468
  ...n,
2467
2469
  filterId: t.id
2468
2470
  };
2469
- 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 ? on(i.values, r) : i.values, c = o || te(i.relativeMeta) !== "minute" ? i.relativeMeta : void 0, d = o && i.temporalPrecision === "minute" ? i.temporalPrecision : void 0, {
2471
+ const o = n, a = o.temporalPrecision === "minute" || te(o.relativeMeta) === "minute", s = !i && a, l = o.operation === "is null" || o.operation === "is not null" ? [] : s ? on(o.values, r) : o.values, c = i || te(o.relativeMeta) !== "minute" ? o.relativeMeta : void 0, d = i && o.temporalPrecision === "minute" ? o.temporalPrecision : void 0, {
2470
2472
  relativeMeta: u,
2471
2473
  temporalPrecision: f,
2472
2474
  values: m,
@@ -2480,7 +2482,7 @@ function sn(e) {
2480
2482
  ...d ? { temporalPrecision: d } : {}
2481
2483
  };
2482
2484
  }
2483
- function ji(e) {
2485
+ function zo(e) {
2484
2486
  const t = L(e.filters);
2485
2487
  if (!t)
2486
2488
  return e.filterValues;
@@ -2497,13 +2499,13 @@ function ln(e) {
2497
2499
  globalDateFilter: t,
2498
2500
  globalDateFilterValue: n,
2499
2501
  resolvedPrimaryDateField: r,
2500
- semanticContext: o,
2501
- timezone: i,
2502
+ semanticContext: i,
2503
+ timezone: o,
2502
2504
  allowMinutePrecision: a = !1
2503
2505
  } = e;
2504
2506
  if (!t || !n || !r || !ze(n.operation))
2505
2507
  return null;
2506
- const s = n, l = tr(
2508
+ const s = n, l = nr(
2507
2509
  r.dataType
2508
2510
  ), 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;
2509
2511
  return {
@@ -2514,7 +2516,7 @@ function ln(e) {
2514
2516
  valueType: "date",
2515
2517
  values: s.operation === "is null" || s.operation === "is not null" ? [] : m ? on(
2516
2518
  s.values,
2517
- i
2519
+ o
2518
2520
  ) : s.values,
2519
2521
  dataType: r.dataType || "date",
2520
2522
  // The exact type travels with the filter, so the server formats the predicate for
@@ -2532,7 +2534,7 @@ function ln(e) {
2532
2534
  role: "groupby",
2533
2535
  ...t != null && t.title ? { label: t.title } : {}
2534
2536
  },
2535
- ...o ? { semanticContext: o } : {},
2537
+ ...i ? { semanticContext: i } : {},
2536
2538
  ...f ? { relativeMeta: f } : {},
2537
2539
  ...u ? { temporalPrecision: u } : {}
2538
2540
  };
@@ -2540,7 +2542,7 @@ function ln(e) {
2540
2542
  function B(e) {
2541
2543
  return typeof e == "string" ? e.trim() : "";
2542
2544
  }
2543
- function zi(e) {
2545
+ function Lo(e) {
2544
2546
  var t;
2545
2547
  return (((t = e.semanticContext) == null ? void 0 : t.selectedEntities) || []).filter((n) => typeof n == "object" && n !== null).filter((n) => n.type === "dataset").map((n) => {
2546
2548
  var r;
@@ -2551,30 +2553,30 @@ function zi(e) {
2551
2553
  };
2552
2554
  }).filter((n) => n.domainId && n.datasetName);
2553
2555
  }
2554
- function Li(e) {
2556
+ function Ko(e) {
2555
2557
  var l, c, d, u, f;
2556
2558
  if (U(e) || (l = e.sql) != null && l.trim())
2557
2559
  return null;
2558
- 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(
2560
+ const t = Lo(e), n = B((c = e.semanticContext) == null ? void 0 : c.semanticDomainId), r = B((d = e.fieldMeta) == null ? void 0 : d.entityId), i = B((u = e.fieldMeta) == null ? void 0 : u.entityName), o = B((f = e.fieldMeta) == null ? void 0 : f.entityType) === "dataset", a = t.find(
2559
2561
  (m) => r && m.selectedEntityId === r
2560
2562
  );
2561
2563
  if (a)
2562
2564
  return a;
2563
2565
  const s = t.find(
2564
- (m) => o && m.datasetName === o && (!n || m.domainId === n)
2566
+ (m) => i && m.datasetName === i && (!n || m.domainId === n)
2565
2567
  );
2566
- return s || (t.length === 1 ? t[0] : i && o && n ? {
2568
+ return s || (t.length === 1 ? t[0] : o && i && n ? {
2567
2569
  domainId: n,
2568
- datasetName: o
2570
+ datasetName: i
2569
2571
  } : null);
2570
2572
  }
2571
- function Ki(e) {
2572
- var o, i;
2573
+ function Go(e) {
2574
+ var i, o;
2573
2575
  const { filter: t, semanticExecutionPayload: n } = e;
2574
2576
  if (!n)
2575
2577
  return null;
2576
- const r = Li(t);
2577
- return r && ((i = (o = n.domainsById[r.domainId]) == null ? void 0 : o.datasetsByName[r.datasetName]) == null ? void 0 : i.primaryDateField) || null;
2578
+ const r = Ko(t);
2579
+ return r && ((o = (i = n.domainsById[r.domainId]) == null ? void 0 : i.datasetsByName[r.datasetName]) == null ? void 0 : o.primaryDateField) || null;
2578
2580
  }
2579
2581
  function cn(e) {
2580
2582
  const t = L(e.filters);
@@ -2582,7 +2584,7 @@ function cn(e) {
2582
2584
  (n) => n.filterId !== t.id
2583
2585
  ) : e.filterValues;
2584
2586
  }
2585
- function hs(e) {
2587
+ function vs(e) {
2586
2588
  const t = L(e.filters), n = cn({
2587
2589
  filters: e.filters,
2588
2590
  filterValues: e.filterValues
@@ -2591,37 +2593,37 @@ function hs(e) {
2591
2593
  return n;
2592
2594
  const r = e.filterValues.find(
2593
2595
  (a) => a.filterId === t.id
2594
- ), o = Ki({
2596
+ ), i = Go({
2595
2597
  filter: e.filter,
2596
2598
  semanticExecutionPayload: e.semanticExecutionPayload
2597
- }), i = ln({
2599
+ }), o = ln({
2598
2600
  globalDateFilter: t,
2599
2601
  globalDateFilterValue: r,
2600
- resolvedPrimaryDateField: o || void 0,
2602
+ resolvedPrimaryDateField: i || void 0,
2601
2603
  semanticContext: e.filter.semanticContext,
2602
2604
  timezone: e.timezone,
2603
2605
  allowMinutePrecision: e.allowMinutePrecision
2604
2606
  });
2605
- return i ? [i, ...n] : n;
2607
+ return o ? [o, ...n] : n;
2606
2608
  }
2607
- function Gi(e) {
2609
+ function Ho(e) {
2608
2610
  var d;
2609
2611
  const t = L(e.filters), n = t ? e.cardFilterValues.find(
2610
2612
  (u) => u.filterId === t.id
2611
2613
  ) : void 0, r = t ? e.cardFilterValues.filter(
2612
2614
  (u) => u.filterId !== t.id
2613
- ) : e.cardFilterValues, o = e.resolvedPrimaryDateField ?? gt({
2615
+ ) : e.cardFilterValues, i = e.resolvedPrimaryDateField ?? gt({
2614
2616
  card: e.card,
2615
2617
  cardConfig: e.cardConfig,
2616
2618
  resolvedFields: e.resolvedFields,
2617
2619
  semanticExecutionPayload: e.semanticExecutionPayload
2618
- }), i = ln({
2620
+ }), o = ln({
2619
2621
  globalDateFilter: t,
2620
2622
  globalDateFilterValue: n,
2621
- resolvedPrimaryDateField: o || void 0,
2623
+ resolvedPrimaryDateField: i || void 0,
2622
2624
  timezone: e.timezone,
2623
2625
  allowMinutePrecision: e.allowMinutePrecision
2624
- }), a = i ? [i, ...r] : r, s = new Map(
2626
+ }), a = o ? [o, ...r] : r, s = new Map(
2625
2627
  a.map((u) => [
2626
2628
  u.filterId,
2627
2629
  u
@@ -2636,22 +2638,22 @@ function Gi(e) {
2636
2638
  effectiveFilterValue: f,
2637
2639
  mappedFilterValue: (m = e.mappedFilterValuesByInputId) == null ? void 0 : m.get(u.inputId)
2638
2640
  }] : [];
2639
- })) || [], c = Bi({
2641
+ })) || [], c = Eo({
2640
2642
  inputs: l,
2641
- temporalBinding: o,
2643
+ temporalBinding: i,
2642
2644
  card: e.card
2643
2645
  });
2644
2646
  return {
2645
2647
  cardFilterValues: a,
2646
- resolvedPrimaryDateField: o,
2648
+ resolvedPrimaryDateField: i,
2647
2649
  dateComparisonPlan: c
2648
2650
  };
2649
2651
  }
2650
- function vs(e) {
2652
+ function Fs(e) {
2651
2653
  const t = L(e.filters), n = an(e), r = t ? e.filterValues.find(
2652
2654
  (a) => a.filterId === t.id
2653
- ) : void 0, o = cn(e);
2654
- return !t || !r || !ze(r.operation) ? o : [
2655
+ ) : void 0, i = cn(e);
2656
+ return !t || !r || !ze(r.operation) ? i : [
2655
2657
  {
2656
2658
  ...sn({
2657
2659
  globalDateFilter: t,
@@ -2662,51 +2664,51 @@ function vs(e) {
2662
2664
  filterId: t.id,
2663
2665
  name: t.title || t.column
2664
2666
  },
2665
- ...o
2667
+ ...i
2666
2668
  ];
2667
2669
  }
2668
- class Hi extends Error {
2670
+ class Uo extends Error {
2669
2671
  }
2670
- function Fs(e, t) {
2672
+ function Ds(e, t) {
2671
2673
  const n = new Map((e ? j(e) : []).map(({ card: r }) => [r.id, r]));
2672
2674
  return t && n.set(t.id, t), [...n.values()].flatMap((r) => {
2673
- const o = Ve(r);
2674
- return o.status === "ready" ? di(o.config.spec, r.controlBindings) : [];
2675
+ const i = Ve(r);
2676
+ return i.status === "ready" ? uo(i.config.spec, r.controlBindings) : [];
2675
2677
  });
2676
2678
  }
2677
- function Ui(e, t, n) {
2678
- const r = nr(e);
2679
+ function Qo(e, t, n) {
2680
+ const r = rr(e);
2679
2681
  if (!r) throw new Error("Matrix card definition is required.");
2680
- const o = n && ci({
2682
+ const i = n && co({
2681
2683
  ...n,
2682
2684
  spec: r.spec,
2683
2685
  catalog: t.map((d) => ({ ...d, id: d.resolvedField.id }))
2684
- }), i = o ? { ...r, spec: o.spec } : r, a = rr(t), s = or(t), l = (d) => {
2685
- const u = s(d, i.spec.source);
2686
+ }), o = i ? { ...r, spec: i.spec } : r, a = ir(t), s = or(t), l = (d) => {
2687
+ const u = s(d, o.spec.source);
2686
2688
  if (!(!u && d.derivedField)) {
2687
- if (!u) throw new Hi(`Matrix field metadata is unavailable: ${d.name}`);
2689
+ if (!u) throw new Uo(`Matrix field metadata is unavailable: ${d.name}`);
2688
2690
  return { ...u, ...d.derivedField ? { derivedField: d.derivedField } : {} };
2689
2691
  }
2690
2692
  }, c = {
2691
- rows: i.spec.rows.flatMap((d) => {
2693
+ rows: o.spec.rows.flatMap((d) => {
2692
2694
  const u = l(d.field);
2693
2695
  return u ? [{ ...u, id: d.id, granularity: d.grain, role: "groupby" }] : [];
2694
2696
  }),
2695
- columns: i.spec.columns.flatMap((d) => {
2697
+ columns: o.spec.columns.flatMap((d) => {
2696
2698
  const u = l(d.field);
2697
2699
  return u ? [{ ...u, id: d.id, granularity: d.grain, role: "pivotby" }] : [];
2698
2700
  }),
2699
2701
  // Aggregate-stage expressions have no source-column filter target. They stay
2700
2702
  // authoritative in matrix.spec, including all dependencies and controls.
2701
- metrics: i.spec.measures.flatMap((d) => {
2703
+ metrics: o.spec.measures.flatMap((d) => {
2702
2704
  if (d.kind !== "aggregate" || d.field.name === "*") return [];
2703
2705
  const u = l(d.field);
2704
2706
  return u ? [{ ...u, id: d.id, aggregate: d.aggregate, role: "metric" }] : [];
2705
2707
  })
2706
2708
  };
2707
- return { config: i, fields: c, resolveField: a };
2709
+ return { config: o, fields: c, resolveField: a };
2708
2710
  }
2709
- function Qi(e) {
2711
+ function $o(e) {
2710
2712
  const t = e.filter(Boolean);
2711
2713
  if (t.length !== 0)
2712
2714
  return t.length === 1 ? t[0] : {
@@ -2717,7 +2719,7 @@ function Qi(e) {
2717
2719
  groups: t
2718
2720
  };
2719
2721
  }
2720
- function $i(e) {
2722
+ function Wo(e) {
2721
2723
  if (!e) return;
2722
2724
  const t = (n) => ({
2723
2725
  logicalOperator: n.logicalOperator,
@@ -2737,12 +2739,12 @@ function $i(e) {
2737
2739
  });
2738
2740
  return JSON.stringify(t(e));
2739
2741
  }
2740
- function Wi(e, t, n = {}) {
2742
+ function Zo(e, t, n = {}) {
2741
2743
  const r = e.metricColumns || [];
2742
2744
  if (r.length === 0) return e;
2743
- const o = ir.includes(
2745
+ const i = ar.includes(
2744
2746
  t
2745
- ), i = ar.includes(
2747
+ ), o = sr.includes(
2746
2748
  t
2747
2749
  ), a = (c) => {
2748
2750
  var d;
@@ -2758,11 +2760,11 @@ function Wi(e, t, n = {}) {
2758
2760
  const l = r.map(
2759
2761
  (c) => {
2760
2762
  var f;
2761
- const d = Lr(c);
2763
+ const d = Kr(c);
2762
2764
  if (d === "none")
2763
2765
  return c;
2764
2766
  let u = c;
2765
- return (f = u.parameters) != null && f.windowTransform && (s = !0, u = a(u)), n.keepsPeriodComparison && d !== "target" ? u : o ? d === "target" && !i ? (s = !0, {
2767
+ return (f = u.parameters) != null && f.windowTransform && (s = !0, u = a(u)), n.keepsPeriodComparison && d !== "target" ? u : i ? d === "target" && !o ? (s = !0, {
2766
2768
  ...u,
2767
2769
  comparison: void 0
2768
2770
  }) : u : (s = !0, { ...u, comparison: void 0 });
@@ -2773,41 +2775,41 @@ function Wi(e, t, n = {}) {
2773
2775
  metricColumns: l
2774
2776
  } : e;
2775
2777
  }
2776
- function Ds(e, t = {}) {
2778
+ function Ss(e, t = {}) {
2777
2779
  return dn(un(e, t));
2778
2780
  }
2779
2781
  function dn(e) {
2780
2782
  const t = [e.drill, e.selections, e.zoom];
2781
- return e.authored ? Yr(e.authored, t, yt()) : Qi(t);
2783
+ return e.authored ? Yr(e.authored, t, yt()) : $o(t);
2782
2784
  }
2783
2785
  function un(e, t = {}) {
2784
2786
  return {
2785
- authored: t.includeAuthoredFilters === !1 ? void 0 : sr(e),
2786
- drill: mi(t.drill, e.id),
2787
- selections: Jr(t.selections ?? []),
2787
+ authored: t.includeAuthoredFilters === !1 ? void 0 : lr(e),
2788
+ drill: go(t.drill, e.id),
2789
+ selections: Xr(t.selections ?? []),
2788
2790
  ...t.zoom ? { zoom: t.zoom } : {}
2789
2791
  };
2790
2792
  }
2791
- function Zi(e, t, n) {
2792
- const r = fi(e, t);
2793
- return Te(e) ? Wi(
2793
+ function Jo(e, t, n) {
2794
+ const r = po(e, t);
2795
+ return Te(e) ? Zo(
2794
2796
  { ...r, filters: n },
2795
2797
  e.type,
2796
2798
  // A data variable's card keeps its own period comparison (P3b-03).
2797
- { keepsPeriodComparison: Kr(e) }
2799
+ { keepsPeriodComparison: Gr(e) }
2798
2800
  ) : r;
2799
2801
  }
2800
- function Yi(e) {
2801
- const t = lr(e);
2802
+ function Yo(e) {
2803
+ const t = cr(e);
2802
2804
  return {
2803
2805
  contextMode: t,
2804
2806
  shouldApplyDashboardFilters: !t || t === "full"
2805
2807
  };
2806
2808
  }
2807
- function Ji(e) {
2809
+ function Xo(e) {
2808
2810
  const t = e.dashboardControls || [], n = e.card.controls || [], r = /* @__PURE__ */ new Set([
2809
- ...t.map((o) => o.id),
2810
- ...n.map((o) => o.id)
2811
+ ...t.map((i) => i.id),
2812
+ ...n.map((i) => i.id)
2811
2813
  ]);
2812
2814
  return fn(
2813
2815
  e.card,
@@ -2825,16 +2827,16 @@ function Ji(e) {
2825
2827
  );
2826
2828
  }
2827
2829
  function fn(e, t, n) {
2828
- const o = t.controlBindings.filter(
2830
+ const i = t.controlBindings.filter(
2829
2831
  (f) => !de(f)
2830
- ), i = new Set(
2832
+ ), o = new Set(
2831
2833
  Ae({
2832
2834
  sql: e.sql,
2833
- controlBindings: o
2835
+ controlBindings: i
2834
2836
  })
2835
2837
  ), a = new Set(
2836
2838
  [...n].filter(
2837
- (f) => !i.has(f)
2839
+ (f) => !o.has(f)
2838
2840
  )
2839
2841
  ), s = t.controlDefinitions.filter(
2840
2842
  (f) => !a.has(f.id)
@@ -2843,7 +2845,7 @@ function fn(e, t, n) {
2843
2845
  ), c = /* @__PURE__ */ new Set([
2844
2846
  ...s.map((f) => f.id),
2845
2847
  ...l.map((f) => f.id)
2846
- ]), d = o.filter(
2848
+ ]), d = i.filter(
2847
2849
  (f) => c.has(f.controlId)
2848
2850
  );
2849
2851
  return {
@@ -2856,12 +2858,12 @@ function fn(e, t, n) {
2856
2858
  controlBindings: d
2857
2859
  };
2858
2860
  }
2859
- function Xi(e, t) {
2861
+ function ea(e, t) {
2860
2862
  return !!t && e.endsWith(t);
2861
2863
  }
2862
2864
  function pn(e, t) {
2863
2865
  return (e ?? []).filter(
2864
- (n) => Xi(n.filterId, t)
2866
+ (n) => ea(n.filterId, t)
2865
2867
  );
2866
2868
  }
2867
2869
  function mn(e, t, n) {
@@ -2873,7 +2875,7 @@ function mn(e, t, n) {
2873
2875
  ...n ? { owner: n } : {}
2874
2876
  };
2875
2877
  }
2876
- function ea(e) {
2878
+ function ta(e) {
2877
2879
  if (e.resolution.status === "resolved")
2878
2880
  return mn(
2879
2881
  e.card,
@@ -2881,10 +2883,10 @@ function ea(e) {
2881
2883
  e.resolution.resolvedOwner.owner
2882
2884
  );
2883
2885
  }
2884
- function ta(e) {
2886
+ function na(e) {
2885
2887
  return `Set ${e.join(", ")} to run this card.`;
2886
2888
  }
2887
- function na({
2889
+ function ra({
2888
2890
  dashboardInputContext: e,
2889
2891
  shouldApplyDashboardFilters: t
2890
2892
  }) {
@@ -2899,15 +2901,15 @@ function na({
2899
2901
  (r) => n.has(r.filterId)
2900
2902
  );
2901
2903
  }
2902
- function ra({
2904
+ function ia({
2903
2905
  dashboardInputFilterValues: e,
2904
2906
  adHocFilterValues: t
2905
2907
  }) {
2906
2908
  const n = [...e], r = new Set(
2907
- n.map((o) => o.filterId)
2909
+ n.map((i) => i.filterId)
2908
2910
  );
2909
- for (const o of t)
2910
- r.has(o.filterId) || (n.push(o), r.add(o.filterId));
2911
+ for (const i of t)
2912
+ r.has(i.filterId) || (n.push(i), r.add(i.filterId));
2911
2913
  return n;
2912
2914
  }
2913
2915
  function ce(e, t) {
@@ -2918,10 +2920,10 @@ function ce(e, t) {
2918
2920
  filterValues: [...n, ...t.inlineFilterValues, ...r],
2919
2921
  mappingDispositions: []
2920
2922
  };
2921
- const o = t.dashboardInputContext.inputs.filter(
2923
+ const i = t.dashboardInputContext.inputs.filter(
2922
2924
  (u) => u.kind === "filter" && !!u.application
2923
- ), i = new Set(
2924
- o.map((u) => u.filter.id)
2925
+ ), o = new Set(
2926
+ i.map((u) => u.filter.id)
2925
2927
  ), a = new Set(
2926
2928
  t.dashboardInputContext.inputs.flatMap(
2927
2929
  (u) => {
@@ -2929,16 +2931,16 @@ function ce(e, t) {
2929
2931
  return u.kind === "filter" && ((f = u.compatibility) == null ? void 0 : f.source) === "cardInlineFilter" ? [u.filter.id] : [];
2930
2932
  }
2931
2933
  )
2932
- ), s = na({
2934
+ ), s = ra({
2933
2935
  dashboardInputContext: t.dashboardInputContext,
2934
2936
  shouldApplyDashboardFilters: t.shouldApplyDashboardFilters
2935
- }).filter((u) => !i.has(u.filterId)), l = s.filter(
2937
+ }).filter((u) => !o.has(u.filterId)), l = s.filter(
2936
2938
  (u) => !a.has(u.filterId)
2937
2939
  ), c = s.filter(
2938
2940
  (u) => a.has(u.filterId)
2939
- ), d = cr({
2941
+ ), d = dr({
2940
2942
  card: e,
2941
- inputs: o,
2943
+ inputs: i,
2942
2944
  resolvedInputs: t.dashboardInputContext.resolvedInputs,
2943
2945
  activeFilterValues: t.dashboardInputContext.activeFilters,
2944
2946
  shouldApplyDashboardFilters: t.shouldApplyDashboardFilters
@@ -2949,7 +2951,7 @@ function ce(e, t) {
2949
2951
  } : {
2950
2952
  status: "ready",
2951
2953
  filterValues: [
2952
- ...ra({
2954
+ ...ia({
2953
2955
  dashboardInputFilterValues: [
2954
2956
  ...l,
2955
2957
  ...d.filterValues
@@ -2967,22 +2969,22 @@ function oa(e, t) {
2967
2969
  if (!n) return [];
2968
2970
  const r = new Set(
2969
2971
  t.flatMap(
2970
- (i) => i.status === "skip" && (i.reason === "explicitlyExcluded" || i.reason === "outsideScope") ? [i.inputId] : []
2972
+ (o) => o.status === "skip" && (o.reason === "explicitlyExcluded" || o.reason === "outsideScope") ? [o.inputId] : []
2971
2973
  )
2972
- ), o = new Map(n.inputs.map((i) => [i.id, i]));
2973
- return n.resolvedInputs.flatMap((i) => {
2974
- if (!i.missingRequiredValue) return [];
2975
- const a = o.get(i.id);
2976
- return a ? a.kind === "filter" && (!e.shouldApplyDashboardFilters && !kt(a) || r.has(a.id)) ? [] : [i.label] : [];
2974
+ ), i = new Map(n.inputs.map((o) => [o.id, o]));
2975
+ return n.resolvedInputs.flatMap((o) => {
2976
+ if (!o.missingRequiredValue) return [];
2977
+ const a = i.get(o.id);
2978
+ return a ? a.kind === "filter" && (!e.shouldApplyDashboardFilters && !kt(a) || r.has(a.id)) ? [] : [o.label] : [];
2977
2979
  });
2978
2980
  }
2979
- function ia({
2981
+ function aa({
2980
2982
  card: e,
2981
2983
  cardConfig: t,
2982
2984
  input: n,
2983
2985
  resolvedPrimaryDateField: r,
2984
- resolvedFields: o,
2985
- semanticExecutionPayload: i,
2986
+ resolvedFields: i,
2987
+ semanticExecutionPayload: o,
2986
2988
  timezone: a,
2987
2989
  allowMinutePrecision: s
2988
2990
  }) {
@@ -3009,14 +3011,14 @@ function ia({
3009
3011
  mappingDispositions: c.mappingDispositions,
3010
3012
  missingRequiredLabels: []
3011
3013
  };
3012
- const u = Gi({
3014
+ const u = Ho({
3013
3015
  card: e,
3014
3016
  cardConfig: t,
3015
3017
  filters: l,
3016
3018
  cardFilterValues: c.filterValues,
3017
3019
  resolvedPrimaryDateField: r,
3018
- resolvedFields: o,
3019
- semanticExecutionPayload: i,
3020
+ resolvedFields: i,
3021
+ semanticExecutionPayload: o,
3020
3022
  timezone: a,
3021
3023
  allowMinutePrecision: s,
3022
3024
  dateComparisonInputs: n.dateComparisonInputs,
@@ -3027,7 +3029,7 @@ function ia({
3027
3029
  )
3028
3030
  }), f = L(l), m = !!(f && u.cardFilterValues.some(
3029
3031
  (b) => b.filterId === f.id
3030
- )), y = u.resolvedPrimaryDateField && !((p = e.sql) != null && p.trim()) ? u.dateComparisonPlan.inputs.length ? ea({
3032
+ )), y = u.resolvedPrimaryDateField && !((p = e.sql) != null && p.trim()) ? u.dateComparisonPlan.inputs.length ? ta({
3031
3033
  card: e,
3032
3034
  resolution: u.dateComparisonPlan.resolution
3033
3035
  }) : m ? mn(
@@ -3042,13 +3044,13 @@ function ia({
3042
3044
  mappingDispositions: c.mappingDispositions
3043
3045
  };
3044
3046
  }
3045
- function aa({
3047
+ function sa({
3046
3048
  card: e,
3047
3049
  dashboard: t,
3048
3050
  transientContexts: n,
3049
3051
  cardViewState: r,
3050
- viewerTableSettings: o,
3051
- adHocFilterValues: i,
3052
+ viewerTableSettings: i,
3053
+ adHocFilterValues: o,
3052
3054
  selectedSheetId: a,
3053
3055
  inlineFilterValuesMap: s,
3054
3056
  dashboardControls: l,
@@ -3057,18 +3059,18 @@ function aa({
3057
3059
  dashboardInputContext: u,
3058
3060
  includeAuthoredFilters: f
3059
3061
  }) {
3060
- var R, K, J;
3062
+ var R, K, Y;
3061
3063
  const m = jt(t);
3062
3064
  for (const q of e.controlBindings || [])
3063
3065
  de(q) && m.add(q.controlId);
3064
- const { shouldApplyDashboardFilters: y } = Yi(n), p = u != null && u.inputs.length ? u : void 0, b = ((u == null ? void 0 : u.selections) ?? []).filter(
3066
+ const { shouldApplyDashboardFilters: y } = Yo(n), p = u != null && u.inputs.length ? u : void 0, b = ((u == null ? void 0 : u.selections) ?? []).filter(
3065
3067
  (q) => q.status === "apply"
3066
3068
  ), I = un(e, {
3067
3069
  includeAuthoredFilters: f,
3068
3070
  selections: b,
3069
3071
  drill: r == null ? void 0 : r.drill
3070
3072
  }), C = {
3071
- adHocFilterValues: i || [],
3073
+ adHocFilterValues: o || [],
3072
3074
  selectedSheetId: a,
3073
3075
  inlineFilterValues: (s == null ? void 0 : s[e.id]) || [],
3074
3076
  // Outside the input-context gate: a dashboard whose only input is a
@@ -3091,14 +3093,14 @@ function aa({
3091
3093
  }, h = ce(e, C), D = {
3092
3094
  filterValues: h.status === "ready" ? h.filterValues : [],
3093
3095
  selectionFilters: I.selections
3094
- }, g = tt(D), V = Ci(r == null ? void 0 : r.zoom, (R = e.config) == null ? void 0 : R.groupByColumns, g), P = V ? { ...I, zoom: V.filterGroup } : I, x = V ? tt({ ...D, zoom: V.zoom }) : g, v = dn(P), S = f === !1 ? me(v, !0) : v, M = Zi(
3096
+ }, g = tt(D), V = ho(r == null ? void 0 : r.zoom, (R = e.config) == null ? void 0 : R.groupByColumns, g), P = V ? { ...I, zoom: V.filterGroup } : I, x = V ? tt({ ...D, zoom: V.zoom }) : g, v = dn(P), S = f === !1 ? me(v, !0) : v, M = Jo(
3095
3097
  e,
3096
3098
  r == null ? void 0 : r.drill,
3097
3099
  S
3098
- ), k = bi(M, r == null ? void 0 : r.grainPick, {
3100
+ ), k = Io(M, r == null ? void 0 : r.grainPick, {
3099
3101
  currentFingerprint: x,
3100
3102
  drillActive: (((K = r == null ? void 0 : r.drill) == null ? void 0 : K.steps.length) ?? 0) > 0
3101
- }), F = dr({ ...e, config: k }, o) ?? k, T = Et(F, {
3103
+ }), F = ur({ ...e, config: k }, i) ?? k, T = Et(F, {
3102
3104
  cardType: e.type,
3103
3105
  dataSource: e.dataSource,
3104
3106
  temporalResultOwner: It({
@@ -3106,7 +3108,7 @@ function aa({
3106
3108
  sql: e.sql,
3107
3109
  normalizedPython: Me(e.python || "")
3108
3110
  })
3109
- }) || F, w = $i(S) || "", E = p ? fn(
3111
+ }) || F, w = Wo(S) || "", E = p ? fn(
3110
3112
  e,
3111
3113
  {
3112
3114
  controlValues: p.controlValues,
@@ -3115,7 +3117,7 @@ function aa({
3115
3117
  controlBindings: p.controlBindings
3116
3118
  },
3117
3119
  m
3118
- ) : Ji({
3120
+ ) : Xo({
3119
3121
  card: e,
3120
3122
  presentationControlIds: m,
3121
3123
  dashboardControls: l,
@@ -3127,7 +3129,7 @@ function aa({
3127
3129
  ...E,
3128
3130
  resolvedFilters: S,
3129
3131
  resolvedFilterParts: P,
3130
- drillSteps: ((J = r == null ? void 0 : r.drill) == null ? void 0 : J.steps) ?? ur,
3132
+ drillSteps: ((Y = r == null ? void 0 : r.drill) == null ? void 0 : Y.steps) ?? fr,
3131
3133
  dateContextKey: x,
3132
3134
  zoomContextKey: g,
3133
3135
  ...V ? { activeZoom: V.zoom } : {},
@@ -3137,7 +3139,7 @@ function aa({
3137
3139
  };
3138
3140
  }
3139
3141
  function gn(e, t, n) {
3140
- const r = ia({
3142
+ const r = aa({
3141
3143
  resolvedFields: t.resolvedDateFields,
3142
3144
  ...n,
3143
3145
  card: e,
@@ -3145,32 +3147,32 @@ function gn(e, t, n) {
3145
3147
  input: t.filterCompilationInput
3146
3148
  });
3147
3149
  if (r.status === "blocked") return r;
3148
- const { filterCompilationInput: o, ...i } = t;
3150
+ const { filterCompilationInput: i, ...o } = t;
3149
3151
  return { status: "ready", queryContext: {
3150
- ...i,
3152
+ ...o,
3151
3153
  cardFilterValues: r.cardFilterValues,
3152
3154
  queryFilterDefinitions: r.queryFilterDefinitions,
3153
3155
  resolvedPrimaryDateField: r.resolvedPrimaryDateField,
3154
3156
  globalDateComparison: r.globalDateComparison,
3155
- globalDateComparisonSelection: o.globalDateComparisonSelection,
3156
- dateComparisonInputs: o.dateComparisonInputs
3157
+ globalDateComparisonSelection: i.globalDateComparisonSelection,
3158
+ dateComparisonInputs: i.dateComparisonInputs
3157
3159
  }, compiledFilters: r };
3158
3160
  }
3159
- function sa(e, t, n) {
3160
- const r = fr(e), o = gn(e, t, {
3161
+ function la(e, t, n) {
3162
+ const r = pr(e), i = gn(e, t, {
3161
3163
  resolvedPrimaryDateField: n.resolvedPrimaryDateField,
3162
3164
  timezone: n.calendarContext.tz,
3163
3165
  allowMinutePrecision: n.allowGlobalDateMinutePrecision
3164
3166
  });
3165
- if (o.status === "blocked")
3166
- return { ...o, tableConfig: r };
3167
- const { compiledFilters: i } = o, {
3167
+ if (i.status === "blocked")
3168
+ return { ...i, tableConfig: r };
3169
+ const { compiledFilters: o } = i, {
3168
3170
  cardFilterValues: a,
3169
3171
  resolvedPrimaryDateField: s,
3170
3172
  globalDateComparison: l
3171
- } = i, { queryKey: c, queryInputIdentity: d, paginationConfig: u } = Jo(
3173
+ } = o, { queryKey: c, queryInputIdentity: d, paginationConfig: u } = Yi(
3172
3174
  e,
3173
- o.queryContext,
3175
+ i.queryContext,
3174
3176
  n.calendarContext,
3175
3177
  { resolvePaginationConfig: n.resolvePaginationConfig }
3176
3178
  ), f = t.queryRelevantConfig, m = Me(e.python || ""), y = It({
@@ -3184,7 +3186,7 @@ function sa(e, t, n) {
3184
3186
  queryInputIdentity: d,
3185
3187
  paginationConfig: u,
3186
3188
  tableConfig: r,
3187
- compiledFilters: i,
3189
+ compiledFilters: o,
3188
3190
  requestPayloadBase: {
3189
3191
  cardId: e.id,
3190
3192
  sql: (e == null ? void 0 : e.sql) || "",
@@ -3209,25 +3211,25 @@ function sa(e, t, n) {
3209
3211
  }
3210
3212
  };
3211
3213
  }
3212
- const at = [], la = [], ca = {};
3213
- function Ss(e, t) {
3214
+ const at = [], ca = [], da = {};
3215
+ function Ts(e, t) {
3214
3216
  return {
3215
3217
  sheetId: e.sheetId,
3216
3218
  sectionId: e.sectionId,
3217
3219
  documentFilterValues: e.documentFilterValues ?? at,
3218
- documentControlDefinitions: e.documentControlDefinitions ?? la,
3219
- documentControlValues: e.documentControlValues ?? ca,
3220
+ documentControlDefinitions: e.documentControlDefinitions ?? ca,
3221
+ documentControlValues: e.documentControlValues ?? da,
3220
3222
  editorFilterValues: t ?? at
3221
3223
  };
3222
3224
  }
3223
- function da({
3225
+ function ua({
3224
3226
  card: e,
3225
3227
  dashboard: t,
3226
3228
  runtime: n,
3227
3229
  dashboardRuntimeValues: r,
3228
- calendar: o
3230
+ calendar: i
3229
3231
  }) {
3230
- const i = Ct({
3232
+ const o = Ct({
3231
3233
  dashboard: t,
3232
3234
  dashboardInputValues: r.dashboardInputValues,
3233
3235
  transientContexts: void 0
@@ -3242,13 +3244,13 @@ function da({
3242
3244
  ...r,
3243
3245
  dashboardInputValues: n.documentDashboardInputValues || r.dashboardInputValues
3244
3246
  },
3245
- calendar: o
3246
- }) : void 0, a = i && (i.inputs.length > 0 || i.selections.length > 0) ? i : void 0, s = !!(i != null && i.inputs.length), l = [
3247
+ calendar: i
3248
+ }) : void 0, a = o && (o.inputs.length > 0 || o.selections.length > 0) ? o : void 0, s = !!(o != null && o.inputs.length), l = [
3247
3249
  ...n.editorFilterValues || [],
3248
3250
  ...n.documentFilterValues
3249
3251
  ];
3250
3252
  return {
3251
- card: s ? e : ua(
3253
+ card: s ? e : fa(
3252
3254
  e,
3253
3255
  n.documentControlDefinitions
3254
3256
  ),
@@ -3266,7 +3268,7 @@ function da({
3266
3268
  dashboardInputContext: a
3267
3269
  };
3268
3270
  }
3269
- function ua(e, t) {
3271
+ function fa(e, t) {
3270
3272
  if (t.length === 0)
3271
3273
  return e;
3272
3274
  const n = /* @__PURE__ */ new Map();
@@ -3279,7 +3281,7 @@ function ua(e, t) {
3279
3281
  controls: Array.from(n.values())
3280
3282
  };
3281
3283
  }
3282
- function Ts({
3284
+ function Vs({
3283
3285
  card: e,
3284
3286
  place: t,
3285
3287
  source: n
@@ -3291,9 +3293,9 @@ function Ts({
3291
3293
  inputContext: r.inputContext
3292
3294
  };
3293
3295
  }
3294
- function fa(e, t, n) {
3296
+ function pa(e, t, n) {
3295
3297
  return {
3296
- calendarContext: n ?? Qr,
3298
+ calendarContext: n ?? $r,
3297
3299
  allowGlobalDateMinutePrecision: we(
3298
3300
  e,
3299
3301
  t
@@ -3302,17 +3304,17 @@ function fa(e, t, n) {
3302
3304
  globalCacheConfig: e.globalCacheConfig
3303
3305
  };
3304
3306
  }
3305
- function Vs(e, t) {
3307
+ function Ms(e, t) {
3306
3308
  return In(
3307
3309
  e,
3308
3310
  t,
3309
3311
  t.allowGlobalDateMinutePrecision
3310
3312
  );
3311
3313
  }
3312
- function pa(e, t, n = {}) {
3314
+ function ma(e, t, n = {}) {
3313
3315
  const r = bn(e, t);
3314
3316
  return {
3315
- ...sa(e.card, e.context, {
3317
+ ...la(e.card, e.context, {
3316
3318
  resolvedPrimaryDateField: r,
3317
3319
  calendarContext: t.calendarContext,
3318
3320
  allowGlobalDateMinutePrecision: t.allowGlobalDateMinutePrecision,
@@ -3322,13 +3324,13 @@ function pa(e, t, n = {}) {
3322
3324
  resolvedPrimaryDateField: r
3323
3325
  };
3324
3326
  }
3325
- function ma({
3327
+ function ga({
3326
3328
  card: e,
3327
3329
  place: t,
3328
3330
  source: n,
3329
3331
  semanticExecutionPayload: r,
3330
- matrixCatalog: o,
3331
- withRequest: i = !1
3332
+ matrixCatalog: i,
3333
+ withRequest: o = !1
3332
3334
  }) {
3333
3335
  var p, b;
3334
3336
  const { dashboard: a } = n, s = e.id, l = (I, C) => {
@@ -3345,21 +3347,21 @@ function ma({
3345
3347
  );
3346
3348
  if (h = V.context, g.status === "absent")
3347
3349
  return { status: "ready", value: { assembled: V } };
3348
- if (!o)
3350
+ if (!i)
3349
3351
  return {
3350
3352
  status: "blocked",
3351
3353
  reason: "metadata",
3352
3354
  message: "Matrix field metadata is required.",
3353
3355
  context: h
3354
3356
  };
3355
- const P = ui(g.config.spec, h), x = o.filter(
3357
+ const P = fo(g.config.spec, h), x = i.filter(
3356
3358
  (T) => T.field.source && P.some(
3357
3359
  (w) => Ce(w, T.field.source)
3358
3360
  )
3359
- ), v = Ui(I, x, h), { params: S } = V, M = S.dashboardInputContext;
3361
+ ), v = Qo(I, x, h), { params: S } = V, M = S.dashboardInputContext;
3360
3362
  v.config = {
3361
3363
  ...v.config,
3362
- presentation: Ro(
3364
+ presentation: Ri(
3363
3365
  I,
3364
3366
  v.config,
3365
3367
  {
@@ -3411,19 +3413,19 @@ function ma({
3411
3413
  missingRequiredLabels: [],
3412
3414
  message: c.message
3413
3415
  };
3414
- const { assembled: d, matrix: u } = c.value, f = fa(
3416
+ const { assembled: d, matrix: u } = c.value, f = pa(
3415
3417
  a,
3416
3418
  r,
3417
3419
  n.calendar
3418
- ), m = d.context.filterCompilationInput, y = mr(a);
3420
+ ), m = d.context.filterCompilationInput, y = gr(a);
3419
3421
  try {
3420
3422
  const I = ce(d.card, m), C = u && y && I.status === "ready" && I.filterValues.some((V) => V.filterId === y.id);
3421
3423
  let h = f.allowGlobalDateMinutePrecision;
3422
3424
  if (C) {
3423
3425
  const V = (p = m.dashboardInputContext) == null ? void 0 : p.inputs.find(
3424
3426
  (F) => F.kind === "filter" && F.filter.id === y.id
3425
- ), x = gr(a, y).filter(
3426
- ({ card: F, sheet: T }) => !V || Gr(V, {
3427
+ ), x = yr(a, y).filter(
3428
+ ({ card: F, sheet: T }) => !V || Hr(V, {
3427
3429
  cardId: F.id,
3428
3430
  sheetId: T.id,
3429
3431
  sheetKind: ht(T) ? "document" : "dashboard"
@@ -3454,7 +3456,7 @@ function ma({
3454
3456
  R,
3455
3457
  E.filterCompilationInput
3456
3458
  );
3457
- return K.status === "blocked" || K.filterValues.some((J) => J.filterId === y.id) ? [w] : [];
3459
+ return K.status === "blocked" || K.filterValues.some((Y) => Y.filterId === y.id) ? [w] : [];
3458
3460
  } catch {
3459
3461
  return v.set(w, null), [w];
3460
3462
  }
@@ -3486,10 +3488,10 @@ function ma({
3486
3488
  mappingDispositions: D.mappingDispositions,
3487
3489
  reason: D.reason,
3488
3490
  missingRequiredLabels: D.missingRequiredLabels,
3489
- ...D.reason === "requiredInput" ? { message: ta(D.missingRequiredLabels) } : {},
3491
+ ...D.reason === "requiredInput" ? { message: na(D.missingRequiredLabels) } : {},
3490
3492
  ...D.resolvedPrimaryDateField ? { resolvedPrimaryDateField: D.resolvedPrimaryDateField } : {}
3491
3493
  };
3492
- const g = i && !u ? pa(d, f) : void 0;
3494
+ const g = o && !u ? ma(d, f) : void 0;
3493
3495
  return {
3494
3496
  ...D,
3495
3497
  ...u ? { matrix: u } : {},
@@ -3499,11 +3501,11 @@ function ma({
3499
3501
  ...(g == null ? void 0 : g.status) === "ready" ? {
3500
3502
  request: {
3501
3503
  ...g.requestPayloadBase,
3502
- ...ii({
3504
+ ...oo({
3503
3505
  card: d.card,
3504
3506
  finalConfig: d.context.finalConfig,
3505
3507
  documentSection: t.kind === "documentSection" ? {} : void 0,
3506
- page: oi(d.card)
3508
+ page: io(d.card)
3507
3509
  })
3508
3510
  }
3509
3511
  } : {}
@@ -3519,7 +3521,7 @@ function ma({
3519
3521
  };
3520
3522
  }
3521
3523
  }
3522
- function ga(e) {
3524
+ function ya(e) {
3523
3525
  const t = e.editor ? {
3524
3526
  ...e.inlineFilterValuesMap,
3525
3527
  ...Object.fromEntries(
@@ -3538,18 +3540,18 @@ function ga(e) {
3538
3540
  }
3539
3541
  function Se(e, t, n, r) {
3540
3542
  var c, d;
3541
- const { dashboard: o } = n, i = ga(n), a = t.kind === "documentSection" ? {
3542
- ...da({
3543
+ const { dashboard: i } = n, o = ya(n), a = t.kind === "documentSection" ? {
3544
+ ...ua({
3543
3545
  card: e,
3544
- dashboard: o,
3546
+ dashboard: i,
3545
3547
  runtime: t.section,
3546
- dashboardRuntimeValues: i,
3548
+ dashboardRuntimeValues: o,
3547
3549
  calendar: n.calendar
3548
3550
  }),
3549
3551
  selectedSheetId: t.section.sheetId,
3550
3552
  includeAuthoredFilters: r
3551
- } : ya(e, t.sheetId, n, i, r), s = aa(a), l = (c = e.config) == null ? void 0 : c.rowLimit;
3552
- return (d = e.sql) != null && d.trim() && l && yn(o, e.id) && (s.sqlRowLimit = l), {
3553
+ } : ba(e, t.sheetId, n, o, r), s = sa(a), l = (c = e.config) == null ? void 0 : c.rowLimit;
3554
+ return (d = e.sql) != null && d.trim() && l && yn(i, e.id) && (s.sqlRowLimit = l), {
3553
3555
  card: a.card,
3554
3556
  params: a,
3555
3557
  context: s,
@@ -3559,15 +3561,15 @@ function Se(e, t, n, r) {
3559
3561
  function yn(e, t) {
3560
3562
  return (e.variables ?? []).some((n) => n.id === t);
3561
3563
  }
3562
- function ya(e, t, n, r, o) {
3564
+ function ba(e, t, n, r, i) {
3563
3565
  var c, d, u;
3564
- const { dashboard: i } = n, a = yn(i, e.id), s = a ? void 0 : n.transientContexts, l = Ct({
3565
- dashboard: i,
3566
+ const { dashboard: o } = n, a = yn(o, e.id), s = a ? void 0 : n.transientContexts, l = Ct({
3567
+ dashboard: o,
3566
3568
  dashboardInputValues: r.dashboardInputValues,
3567
3569
  transientContexts: s
3568
3570
  }) ? Oe({
3569
3571
  transientContexts: s,
3570
- dashboard: i,
3572
+ dashboard: o,
3571
3573
  sheetId: t,
3572
3574
  card: e,
3573
3575
  runtimeValues: r,
@@ -3575,21 +3577,21 @@ function ya(e, t, n, r, o) {
3575
3577
  }) : void 0;
3576
3578
  return {
3577
3579
  card: e,
3578
- dashboard: i,
3580
+ dashboard: o,
3579
3581
  transientContexts: s,
3580
3582
  // The editor previews the card without a viewer's zoom (chart date zoom
3581
3583
  // DZ-D1): it shows the dashboard's dates, and its save never sees one.
3582
- cardViewState: a ? void 0 : n.editor ? pr((c = n.cardViewStates) == null ? void 0 : c[e.id], null) : (d = n.cardViewStates) == null ? void 0 : d[e.id],
3584
+ cardViewState: a ? void 0 : n.editor ? mr((c = n.cardViewStates) == null ? void 0 : c[e.id], null) : (d = n.cardViewStates) == null ? void 0 : d[e.id],
3583
3585
  viewerTableSettings: n.editor || a || (u = n.viewerTableSettings) == null ? void 0 : u[e.id],
3584
3586
  adHocFilterValues: a ? [] : r.adHocFilterValues,
3585
3587
  selectedSheetId: t,
3586
3588
  inlineFilterValuesMap: r.inlineFilterValuesMap,
3587
- dashboardControls: i.controls,
3589
+ dashboardControls: o.controls,
3588
3590
  dashboardControlValues: r.controlValues,
3589
3591
  cardControlValuesMap: r.cardControlValuesMap,
3590
3592
  // Keep a selection-only context so the query has one resolved-input contract.
3591
3593
  dashboardInputContext: l && (l.inputs.length > 0 || l.selections.length > 0) ? l : void 0,
3592
- includeAuthoredFilters: o
3594
+ includeAuthoredFilters: i
3593
3595
  };
3594
3596
  }
3595
3597
  function bn({ card: e, context: t }, n) {
@@ -3601,34 +3603,34 @@ function bn({ card: e, context: t }, n) {
3601
3603
  });
3602
3604
  }
3603
3605
  function In(e, t, n) {
3604
- const { card: r } = e, o = bn(e, t), i = gn(r, e.context, {
3605
- resolvedPrimaryDateField: o,
3606
+ const { card: r } = e, i = bn(e, t), o = gn(r, e.context, {
3607
+ resolvedPrimaryDateField: i,
3606
3608
  timezone: t.calendarContext.tz,
3607
3609
  allowMinutePrecision: n
3608
3610
  });
3609
- return i.status === "blocked" ? { ...i, card: r, resolvedPrimaryDateField: o } : {
3611
+ return o.status === "blocked" ? { ...o, card: r, resolvedPrimaryDateField: i } : {
3610
3612
  status: "ready",
3611
3613
  card: r,
3612
- queryContext: i.queryContext,
3613
- compiledFilters: i.compiledFilters,
3614
- resolvedPrimaryDateField: o
3614
+ queryContext: o.queryContext,
3615
+ compiledFilters: o.compiledFilters,
3616
+ resolvedPrimaryDateField: i
3615
3617
  };
3616
3618
  }
3617
- function Ms({
3619
+ function ks({
3618
3620
  dashboard: e,
3619
3621
  dashboardInputValues: t,
3620
3622
  adHocFilterValues: n,
3621
3623
  calendar: r,
3622
- selectedSheetId: o,
3623
- sheetSelection: i = "current",
3624
+ selectedSheetId: i,
3625
+ sheetSelection: o = "current",
3624
3626
  dashboardControlValues: a,
3625
3627
  cardControlValuesMap: s,
3626
3628
  semanticExecutionPayload: l,
3627
3629
  timezone: c
3628
3630
  }) {
3629
- const d = e ? [...yr(e)] : void 0, u = o ?? null, f = (C) => {
3631
+ const d = e ? [...br(e)] : void 0, u = i ?? null, f = (C) => {
3630
3632
  var h;
3631
- return e ? Ca({
3633
+ return e ? ha({
3632
3634
  dashboard: e,
3633
3635
  runtimeValues: { dashboardInputValues: t },
3634
3636
  adHocFilterValues: n,
@@ -3638,7 +3640,7 @@ function Ms({
3638
3640
  ) ? "document" : "dashboard",
3639
3641
  calendar: r
3640
3642
  }) : [];
3641
- }, m = i === "all" ? Array.from(
3643
+ }, m = o === "all" ? Array.from(
3642
3644
  new Map(
3643
3645
  ((e == null ? void 0 : e.sheets) || []).flatMap(
3644
3646
  (C) => f(C.id).map(
@@ -3648,15 +3650,15 @@ function Ms({
3648
3650
  ).values()
3649
3651
  ) : f(u), y = {
3650
3652
  ...a || {}
3651
- }, p = i === "all" ? j({ sheets: (e == null ? void 0 : e.sheets) || [] }) : u ? j({ sheets: (e == null ? void 0 : e.sheets) || [] }).filter(
3653
+ }, p = o === "all" ? j({ sheets: (e == null ? void 0 : e.sheets) || [] }) : u ? j({ sheets: (e == null ? void 0 : e.sheets) || [] }).filter(
3652
3654
  (C) => C.sheet.id === u
3653
3655
  ) : [];
3654
3656
  for (const C of p)
3655
3657
  Object.assign(y, (s == null ? void 0 : s[C.card.id]) || {});
3656
- const b = br({
3658
+ const b = Ir({
3657
3659
  filterDefinitions: d,
3658
3660
  filterValues: m
3659
- }), I = ji({
3661
+ }), I = zo({
3660
3662
  filters: d,
3661
3663
  filterValues: b,
3662
3664
  dashboard: e,
@@ -3669,13 +3671,13 @@ function Ms({
3669
3671
  controlValues: y
3670
3672
  };
3671
3673
  }
3672
- function ks({
3674
+ function xs({
3673
3675
  dashboard: e,
3674
3676
  cardId: t,
3675
3677
  transientContexts: n,
3676
3678
  cardViewStates: r,
3677
- viewerTableSettings: o,
3678
- semanticExecutionPayload: i,
3679
+ viewerTableSettings: i,
3680
+ semanticExecutionPayload: o,
3679
3681
  adHocFilterValues: a,
3680
3682
  inlineFilterValuesMap: s,
3681
3683
  dashboardControlValues: l,
@@ -3696,7 +3698,7 @@ function ks({
3696
3698
  const C = Ue(e, t);
3697
3699
  if (!C)
3698
3700
  return null;
3699
- const h = ma({
3701
+ const h = ga({
3700
3702
  card: m ?? C.card,
3701
3703
  place: p ? { kind: "documentSection", section: p } : { kind: "sheet", sheetId: C.sheet.id },
3702
3704
  source: {
@@ -3712,11 +3714,11 @@ function ks({
3712
3714
  dashboardInputValues: d,
3713
3715
  transientContexts: n,
3714
3716
  cardViewStates: r,
3715
- viewerTableSettings: o,
3717
+ viewerTableSettings: i,
3716
3718
  calendar: u,
3717
3719
  ...b ? { editor: b } : {}
3718
3720
  },
3719
- semanticExecutionPayload: i,
3721
+ semanticExecutionPayload: o,
3720
3722
  matrixCatalog: f,
3721
3723
  withRequest: I
3722
3724
  });
@@ -3731,82 +3733,82 @@ function ks({
3731
3733
  ...h.request ? { request: h.request } : {}
3732
3734
  };
3733
3735
  }
3734
- function ba(e, t, n) {
3735
- const r = t === "date" && "relativeMeta" in e ? Pr(e.relativeMeta) : void 0;
3736
+ function Ia(e, t, n) {
3737
+ const r = t === "date" && "relativeMeta" in e ? wr(e.relativeMeta) : void 0;
3736
3738
  if (!r) return { values: e.values };
3737
- const o = vr(r, n ?? void 0), i = wr(String(e.operation), r);
3739
+ const i = Fr(r, n ?? void 0), o = Or(String(e.operation), r);
3738
3740
  return {
3739
- values: o && i ? Or(String(e.operation), o) : e.values,
3741
+ values: i && o ? _r(String(e.operation), i) : e.values,
3740
3742
  relativeMeta: r,
3741
3743
  ..."temporalPrecision" in e && e.temporalPrecision === "minute" ? { temporalPrecision: "minute" } : {}
3742
3744
  };
3743
3745
  }
3744
- function Ia(e, t, n) {
3745
- const r = t, o = Cr(e);
3746
- return hr({
3746
+ function Ca(e, t, n) {
3747
+ const r = t, i = hr(e);
3748
+ return vr({
3747
3749
  definition: e,
3748
3750
  sourceValue: r,
3749
3751
  value: {
3750
3752
  filterId: r.filterId,
3751
3753
  name: e.column,
3752
3754
  operation: r.operation ?? e.operation,
3753
- valueType: o,
3755
+ valueType: i,
3754
3756
  dataType: e.dataType,
3755
3757
  fieldMeta: e.fieldMeta,
3756
3758
  semanticContext: e.semanticContext,
3757
- ...ba(r, o, n)
3759
+ ...Ia(r, i, n)
3758
3760
  }
3759
3761
  });
3760
3762
  }
3761
3763
  function Cn(e, t, n) {
3762
3764
  const r = A(e);
3763
- let o = {};
3764
- const i = [], a = [];
3765
+ let i = {};
3766
+ const o = [], a = [];
3765
3767
  for (const s of t ?? []) {
3766
- if (Ur(s.filterId)) {
3768
+ if (Qr(s.filterId)) {
3767
3769
  a.push(s.filterId);
3768
3770
  continue;
3769
3771
  }
3770
3772
  const l = r.findFilterInput({ filterId: s.filterId }), c = l == null ? void 0 : l.input;
3771
- if (c || i.push(s), !c || c.runtimeScope === "perCard" || c.runtimeScope === "perDocumentSection") {
3773
+ if (c || o.push(s), !c || c.runtimeScope === "perCard" || c.runtimeScope === "perDocumentSection") {
3772
3774
  a.push(s.filterId);
3773
3775
  continue;
3774
3776
  }
3775
- const d = Ir(
3776
- Ia(c.filter, s, n.calendar)
3777
+ const d = Cr(
3778
+ Ca(c.filter, s, n.calendar)
3777
3779
  );
3778
3780
  if (d) {
3779
3781
  if (c.runtimeScope === "shared") {
3780
- o = Ke(o, c, {}, d);
3782
+ i = Ke(i, c, {}, d);
3781
3783
  continue;
3782
3784
  }
3783
3785
  for (const u of xt(e).values())
3784
- Pt(c, u) && (o = Ke(
3785
- o,
3786
+ Pt(c, u) && (i = Ke(
3787
+ i,
3786
3788
  c,
3787
3789
  { sheetId: u.sheetId },
3788
3790
  d
3789
3791
  ));
3790
3792
  }
3791
3793
  }
3792
- return { slots: o, adHocFilterValues: i, droppedFilterIds: a };
3794
+ return { slots: i, adHocFilterValues: o, droppedFilterIds: a };
3793
3795
  }
3794
- function Ca(e) {
3796
+ function ha(e) {
3795
3797
  const { dashboard: t, sheetId: n } = e, r = [];
3796
3798
  if (n)
3797
- for (const { input: o } of Fr(t, n, e.sheetKind)) {
3798
- const i = Dr({
3799
+ for (const { input: i } of Dr(t, n, e.sheetKind)) {
3800
+ const o = Sr({
3799
3801
  dashboard: t,
3800
- input: o,
3802
+ input: i,
3801
3803
  runtimeValues: { dashboardInputValues: e.runtimeValues.dashboardInputValues },
3802
3804
  target: { sheetId: n },
3803
3805
  calendar: e.calendar
3804
3806
  });
3805
- i.kind === "filter" && i.filterValue && r.push(i.filterValue);
3807
+ o.kind === "filter" && o.filterValue && r.push(o.filterValue);
3806
3808
  }
3807
3809
  return [...r, ...pn(e.adHocFilterValues, n)];
3808
3810
  }
3809
- function xs(e, t) {
3811
+ function Ps(e, t) {
3810
3812
  switch (t.runtimeScope) {
3811
3813
  case "shared":
3812
3814
  return [{}];
@@ -3818,7 +3820,7 @@ function xs(e, t) {
3818
3820
  ...n.reachedCards({ inputId: t.id }).map((r) => ({ sheetId: r.sheetId, cardId: r.cardId })),
3819
3821
  // A variable holds a value at each place it is used (DV-D35).
3820
3822
  ...n.reachedVariables({ inputId: t.id }).flatMap(
3821
- (r) => r.places.map((o) => ({ sheetId: o.sheetId, cardId: r.variableId }))
3823
+ (r) => r.places.map((i) => ({ sheetId: i.sheetId, cardId: r.variableId }))
3822
3824
  )
3823
3825
  ];
3824
3826
  }
@@ -3842,26 +3844,26 @@ function st(e) {
3842
3844
  )
3843
3845
  ];
3844
3846
  }
3845
- function ha(e, t) {
3847
+ function va(e, t) {
3846
3848
  var n, r;
3847
3849
  return {
3848
3850
  sheetId: e.id,
3849
3851
  cardId: t.id,
3850
3852
  sheetKind: e.kind ?? "dashboard",
3851
3853
  sectionId: (r = (n = e.document) == null ? void 0 : n.sections.find(
3852
- (o) => wt(o).some(({ id: i }) => i === t.id)
3854
+ (i) => wt(i).some(({ id: o }) => o === t.id)
3853
3855
  )) == null ? void 0 : r.id
3854
3856
  };
3855
3857
  }
3856
- function va(e, t, n, r) {
3858
+ function Fa(e, t, n, r) {
3857
3859
  var c, d, u;
3858
- const o = {}, i = (c = e.preferences) == null ? void 0 : c.textVisualOptions;
3859
- if (!i) return o;
3860
+ const i = {}, o = (c = e.preferences) == null ? void 0 : c.textVisualOptions;
3861
+ if (!o) return i;
3860
3862
  const a = Oe({
3861
3863
  // Authoring: carried drill context never applies to a dashboard being edited.
3862
3864
  transientContexts: void 0,
3863
3865
  dashboard: n,
3864
- ...ha(r, t),
3866
+ ...va(r, t),
3865
3867
  card: t,
3866
3868
  runtimeValues: {},
3867
3869
  // Aliases only: no input value is read.
@@ -3873,157 +3875,157 @@ function va(e, t, n, r) {
3873
3875
  inputId: m.id,
3874
3876
  export: f.export ?? "label"
3875
3877
  } : f;
3876
- return m && (o[f.variableName] = y), y;
3878
+ return m && (i[f.variableName] = y), y;
3877
3879
  }, l = (f) => {
3878
3880
  Object.assign(f, Tt(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);
3879
3881
  };
3880
- return (d = i.content) == null || d.forEach((f) => {
3882
+ return (d = o.content) == null || d.forEach((f) => {
3881
3883
  f.type === "variable" && (f.ref = s(f.ref));
3882
- }), (u = i.richContent) == null || u.blocks.forEach((f) => {
3884
+ }), (u = o.richContent) == null || u.blocks.forEach((f) => {
3883
3885
  f.type === "list" ? f.items.forEach((m) => m.forEach(l)) : f.children.forEach(l);
3884
- }), o;
3886
+ }), i;
3885
3887
  }
3886
- function Fa(e, t) {
3887
- var i;
3888
+ function Da(e, t) {
3889
+ var o;
3888
3890
  const n = st(e);
3889
3891
  if (!n.some((a) => {
3890
3892
  var s;
3891
3893
  return (s = a.preferences) == null ? void 0 : s.textVisualOptions;
3892
3894
  }))
3893
3895
  return e;
3894
- const r = oe(e), o = st(r);
3895
- for (let a = 0; a < o.length; a++) {
3896
- const s = va(
3897
- o[a],
3896
+ const r = ie(e), i = st(r);
3897
+ for (let a = 0; a < i.length; a++) {
3898
+ const s = Fa(
3899
+ i[a],
3898
3900
  n[a],
3899
3901
  t,
3900
3902
  e
3901
3903
  );
3902
- (i = e.frames) != null && i.some(
3903
- (l) => l.visualId && l.cards.some((c) => c.id === o[a].id)
3904
- ) && (o[a].linkedReferenceOverrides = mo(
3905
- o[a].linkedReferenceOverrides,
3904
+ (o = e.frames) != null && o.some(
3905
+ (l) => l.visualId && l.cards.some((c) => c.id === i[a].id)
3906
+ ) && (i[a].linkedReferenceOverrides = mi(
3907
+ i[a].linkedReferenceOverrides,
3906
3908
  { inputAliases: s }
3907
3909
  ));
3908
3910
  }
3909
3911
  return r;
3910
3912
  }
3911
- function Da(e) {
3913
+ function Sa(e) {
3912
3914
  var n;
3913
3915
  const t = (n = e.sheets) == null ? void 0 : n.map(
3914
- (r) => Fa(r, e)
3916
+ (r) => Da(r, e)
3915
3917
  );
3916
- return t && t.some((r, o) => r !== e.sheets[o]) ? { ...e, sheets: t } : e;
3918
+ return t && t.some((r, i) => r !== e.sheets[i]) ? { ...e, sheets: t } : e;
3917
3919
  }
3918
- function Sa(e) {
3920
+ function Ta(e) {
3919
3921
  const t = A(e);
3920
3922
  return t.issues.length === 0 && !t.needsUpgrade ? e : t.issues.length ? t.toStoredDashboard() : A(
3921
- Da(e)
3923
+ Sa(e)
3922
3924
  ).toStoredDashboard();
3923
3925
  }
3924
3926
  export {
3925
- ha as $,
3926
- Xi as A,
3927
+ va as $,
3928
+ ea as A,
3927
3929
  pn as B,
3928
- mo as C,
3929
- La as D,
3930
- Do as E,
3931
- ci as F,
3930
+ mi as C,
3931
+ Ka as D,
3932
+ Di as E,
3933
+ co as F,
3932
3934
  et as G,
3933
- wo as H,
3934
- Po as I,
3935
- ko as J,
3936
- Ua as K,
3937
- go as L,
3935
+ wi as H,
3936
+ Pi as I,
3937
+ ki as J,
3938
+ Qa as K,
3939
+ gi as L,
3938
3940
  Nt as M,
3939
3941
  Fe as N,
3940
- Ao as O,
3942
+ Ai as O,
3941
3943
  z as P,
3942
- Eo as Q,
3944
+ Ei as Q,
3943
3945
  Re as R,
3944
3946
  Ee as S,
3945
- Xr as T,
3946
- Qa as U,
3947
- Za as V,
3948
- Oo as W,
3949
- Ga as X,
3950
- Vs as Y,
3951
- fa as Z,
3947
+ ei as T,
3948
+ $a as U,
3949
+ Ja as V,
3950
+ Oi as W,
3951
+ Ha as X,
3952
+ Ms as Y,
3953
+ pa as Z,
3952
3954
  st as _,
3953
- Ai as a,
3954
- va as a0,
3955
- Fa as a1,
3956
- ys as a2,
3957
- ms as a3,
3955
+ Bo as a,
3956
+ Fa as a0,
3957
+ Da as a1,
3958
+ bs as a2,
3959
+ gs as a3,
3958
3960
  Qt as a4,
3959
- gs as a5,
3960
- Lo as a6,
3961
- ta as a7,
3962
- Ms as a8,
3963
- Zi as a9,
3964
- Cs as aA,
3961
+ ys as a5,
3962
+ Li as a6,
3963
+ na as a7,
3964
+ ks as a8,
3965
+ Jo as a9,
3966
+ hs as aA,
3965
3967
  sn as aB,
3966
3968
  ce as aC,
3967
- Ha as aD,
3968
- Hi as aE,
3969
+ Ua as aD,
3970
+ Uo as aE,
3969
3971
  ln as aF,
3970
3972
  Ae as aG,
3971
- Wa as aH,
3973
+ Za as aH,
3972
3974
  Ya as aI,
3973
- ei as aJ,
3975
+ eo as aJ,
3974
3976
  $ as aK,
3975
- cs as aL,
3976
- Is as aM,
3977
- bs as aN,
3978
- Ds as aa,
3979
- Ts as ab,
3980
- ni as ac,
3981
- ri as ad,
3982
- pa as ae,
3983
- Ja as af,
3984
- Xa as ag,
3985
- ii as ah,
3977
+ ds as aL,
3978
+ Cs as aM,
3979
+ Is as aN,
3980
+ Ss as aa,
3981
+ Vs as ab,
3982
+ no as ac,
3983
+ ro as ad,
3984
+ ma as ae,
3985
+ Xa as af,
3986
+ es as ag,
3987
+ oo as ah,
3986
3988
  De as ai,
3987
- ti as aj,
3988
- ai as ak,
3989
- es as al,
3990
- Ss as am,
3991
- vs as an,
3992
- ns as ao,
3989
+ to as aj,
3990
+ ao as ak,
3991
+ ts as al,
3992
+ Ts as am,
3993
+ Fs as an,
3994
+ rs as ao,
3993
3995
  os as ap,
3994
- rs as aq,
3995
- is as ar,
3996
- as,
3997
- ma as at,
3998
- Fs as au,
3996
+ is as aq,
3997
+ as as ar,
3998
+ ss as as,
3999
+ ga as at,
4000
+ Ds as au,
3999
4001
  Ot as av,
4000
- $a as aw,
4001
- hs as ax,
4002
- ss as ay,
4003
- hi as az,
4004
- Yi as b,
4005
- Jo as c,
4006
- ts as d,
4007
- fo as e,
4008
- us as f,
4009
- oe as g,
4010
- ps as h,
4011
- ks as i,
4012
- fs as j,
4013
- Ia as k,
4014
- _i as l,
4002
+ Wa as aw,
4003
+ vs as ax,
4004
+ ls as ay,
4005
+ vo as az,
4006
+ Yo as b,
4007
+ Yi as c,
4008
+ ns as d,
4009
+ fi as e,
4010
+ fs as f,
4011
+ ie as g,
4012
+ ms as h,
4013
+ xs as i,
4014
+ ps as j,
4015
+ Ca as k,
4016
+ Ao as l,
4015
4017
  Ne as m,
4016
- di as n,
4017
- ui as o,
4018
- ls as p,
4019
- yo as q,
4020
- ds as r,
4021
- Co as s,
4018
+ uo as n,
4019
+ fo as o,
4020
+ cs as p,
4021
+ yi as q,
4022
+ us as r,
4023
+ Ci as s,
4022
4024
  At as t,
4023
- Ka as u,
4024
- vo as v,
4025
- Sa as w,
4025
+ Ga as u,
4026
+ vi as v,
4027
+ Ta as w,
4026
4028
  Cn as x,
4027
- Ca as y,
4028
- xs as z
4029
+ ha as y,
4030
+ Ps as z
4029
4031
  };