react-semaphor 0.1.587 → 0.1.588

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 (93) hide show
  1. package/dist/analytics-protocol/index.js +341 -338
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +8 -8
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{add-to-dashboard-DhP8wVtM.js → add-to-dashboard-C86FsM8D.js} +1 -1
  7. package/dist/chunks/{aggregate-measure-field-DsFXETpI.js → aggregate-measure-field-BrkXsSJp.js} +2 -2
  8. package/dist/chunks/{analytics-base-schemas-BaIQrEzX.js → analytics-base-schemas-8wz9vqn_.js} +173 -165
  9. package/dist/chunks/{assistant-chat-pfJK-T0b.js → assistant-chat-BeM6joPc.js} +19 -18
  10. package/dist/chunks/{bookmark-impact-BSpGQL1M.js → bookmark-impact-B7pbMx2e.js} +2 -2
  11. package/dist/chunks/{bookmark-state-CL4WEpgB.js → bookmark-state-Bn7k3ttp.js} +5 -5
  12. package/dist/chunks/{card-filter-builder-C8PbhHjq.js → card-filter-builder-DmodrhyI.js} +81 -81
  13. package/dist/chunks/{comparison-window-caption-CoART8BC.js → comparison-window-caption-fqijZdVd.js} +451 -395
  14. package/dist/chunks/{context-BTLBjQNh.js → context-CVXTFljo.js} +1 -1
  15. package/dist/chunks/{dashboard-CVj1oMoW.js → dashboard-Tu5wT0Cw.js} +1 -1
  16. package/dist/chunks/{dashboard-briefing-launcher-TqA58rKz.js → dashboard-briefing-launcher-D8jMxIJo.js} +249 -265
  17. package/dist/chunks/{dashboard-controls-DQ8FsxAz.js → dashboard-controls-uzeAIEkM.js} +65 -65
  18. package/dist/chunks/{dashboard-json-DM88pmk2.js → dashboard-json-i5rpFNCg.js} +5 -5
  19. package/dist/chunks/dates-BunbHJH0.js +115 -0
  20. package/dist/chunks/{edit-dashboard-visual-BpRnU_6G.js → edit-dashboard-visual-BpEK_Sls.js} +2357 -2344
  21. package/dist/chunks/{filter-line-Cu2u1K36.js → filter-line-Dza3ee4w.js} +5 -5
  22. package/dist/chunks/{filter-reach-copy-0Xp97cLk.js → filter-reach-copy-D5AmDHda.js} +944 -942
  23. package/dist/chunks/{filter-value-text-xefXzZlf.js → filter-value-text-DQw4v3nC.js} +6 -6
  24. package/dist/chunks/{index-D_QSeVKy.js → index-dGxJTaP1.js} +39 -39
  25. package/dist/chunks/{layout-grid-9nSS2SL-.js → layout-grid-XCYphks2.js} +1 -1
  26. package/dist/chunks/{list-filter-CfMPI6v4.js → list-filter-DGV3fqqv.js} +1 -1
  27. package/dist/chunks/{matrix-analytical-definition-DOVSFFuf.js → matrix-analytical-definition-SN0JUJVk.js} +3 -3
  28. package/dist/chunks/{matrix-member-presentation-BKDyxJho.js → matrix-member-presentation-DVBJR0MA.js} +1 -1
  29. package/dist/chunks/{matrix-operation-contract-BM5TveR3.js → matrix-operation-contract-JSmproo9.js} +15 -15
  30. package/dist/chunks/{metric-comparison-ZmurmEIs.js → metric-comparison-xE_J6hkg.js} +2 -2
  31. package/dist/chunks/{paintbrush-LzAje2ff.js → paintbrush-DEEZXhDj.js} +1 -1
  32. package/dist/chunks/{palette-DicJG0TC.js → palette-Bgy0H-Nt.js} +1 -1
  33. package/dist/chunks/{pivot-header-presentation-CdeTU96P.js → pivot-header-presentation-D-DfPAjb.js} +1 -1
  34. package/dist/chunks/{pivot-result-contract-expectations-Bx_BCu-7.js → pivot-result-contract-expectations-DbBahmgc.js} +545 -536
  35. package/dist/chunks/{pivot-result-identity-Bvs6Uq3v.js → pivot-result-identity-CUsMt_4r.js} +1 -1
  36. package/dist/chunks/{raw-temporal-value-DH-feMc2.js → raw-temporal-value-BnGCWJAL.js} +1 -1
  37. package/dist/chunks/{report-preferences-dialog-CXKmWyLm.js → report-preferences-dialog-CTM0xfd0.js} +14 -14
  38. package/dist/chunks/{report-runtime-context-NlOXwyRB.js → report-runtime-context-CrOgmuxO.js} +2 -2
  39. package/dist/chunks/{resolve-dashboard-input-context-zEXuitoF.js → resolve-dashboard-input-context-DFBIngUZ.js} +5617 -5485
  40. package/dist/chunks/{save-0wu1Z1U7.js → save-xnRCvMeA.js} +1 -1
  41. package/dist/chunks/{saved-dashboard-context-Cll5LipJ.js → saved-dashboard-context-DKMTP9ib.js} +17 -17
  42. package/dist/chunks/selection-filter-compiler-DkIjp1yH.js +131 -0
  43. package/dist/chunks/{semaphor-ready-indicator-Bnj3H0Dm.js → semaphor-ready-indicator-zU9reNmX.js} +45952 -45617
  44. package/dist/chunks/{shelf-drop-preview-context-B8rmn6BD.js → shelf-drop-preview-context-R9sf4oDX.js} +6 -6
  45. package/dist/chunks/{stored-dashboard-CURqJgoa.js → stored-dashboard-CksluF2S.js} +1539 -1404
  46. package/dist/chunks/{style-sheet-parts-_dGSFzDi.js → style-sheet-parts-D7NbsFL0.js} +3 -3
  47. package/dist/chunks/{table-export-sheet-Dmtqi5NV.js → table-export-sheet-ClSgERQC.js} +1 -1
  48. package/dist/chunks/{token-types-DEe_FP4l.js → token-types-DTocOcwt.js} +1 -1
  49. package/dist/chunks/{upload-CtyOkU_B.js → upload-BXGgYS4g.js} +1 -1
  50. package/dist/chunks/{validators-CJ8Jh0E8.js → validators-CrYXNnNE.js} +51 -49
  51. package/dist/chunks/{variable-draft-DIv-9y6Q.js → variable-draft-rbtGPvmX.js} +16 -14
  52. package/dist/chunks/visual-choice-DDfHfHvY.js +172 -0
  53. package/dist/dashboard/index.js +2 -2
  54. package/dist/dashboard-authoring/index.js +821 -791
  55. package/dist/format-utils/index.js +162 -158
  56. package/dist/index.js +21 -21
  57. package/dist/report-runtime-context/index.js +2 -2
  58. package/dist/style.css +1 -1
  59. package/dist/surfboard/index.js +2 -2
  60. package/dist/types/index.js +5 -5
  61. package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +39 -2
  62. package/dist/types/lib/dashboard-view-state/date-zoom.d.ts +65 -0
  63. package/dist/types/lib/dashboard-view-state/grain-pick.d.ts +38 -0
  64. package/dist/types/lib/dashboard-view-state/index.d.ts +2 -0
  65. package/dist/types/lib/formatters/grouped-temporal-presentation.d.ts +6 -2
  66. package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
  67. package/dist/types/lib/interactions/get-click-context-from-table.d.ts +2 -2
  68. package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -1
  69. package/dist/types/lib/query-context/build-card-query-context.d.ts +15 -1
  70. package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +3 -0
  71. package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +14 -1
  72. package/dist/types/lib/stores/dashboard-store.d.ts +7 -1
  73. package/dist/types/lib/types/explorer-types.d.ts +13 -0
  74. package/dist/types/lib/utils/card-config-utils.d.ts +1 -1
  75. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +32 -0
  76. package/dist/types/shared/analytics-protocol/contracts.d.ts +30 -0
  77. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +13 -0
  78. package/dist/types/shared/dashboard-authoring/automatic-grain.d.ts +77 -0
  79. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  80. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +13 -8
  81. package/dist/types/shared/dashboard-authoring/control-value-resolution.d.ts +24 -0
  82. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  83. package/dist/types/shared/dashboard-authoring/kpi-trend-rule.d.ts +6 -29
  84. package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +1 -0
  85. package/dist/types/shared/format-utils/index.d.ts +1 -0
  86. package/dist/types/shared/format-utils/partial-period.d.ts +40 -0
  87. package/dist/types/shared/format-utils/temporal-bucket.d.ts +11 -0
  88. package/dist/types/shared/usage-events/details.d.ts +2 -2
  89. package/dist/usage-events/index.js +1 -1
  90. package/package.json +1 -1
  91. package/dist/chunks/dates-5z3b9Loo.js +0 -136
  92. package/dist/chunks/selection-filter-compiler-BReJy-uv.js +0 -92
  93. package/dist/chunks/visual-choice-BBPizkRo.js +0 -206
@@ -1,26 +1,26 @@
1
- import { J as Gr, K as Hr, M as Yr, N as xn, O as Qr, P as Xr, Q as Jr, R as Zr, S as ei, T as Tn, U as ti, V as Re, W as ni, X as ri, Y as ii, g as ai, k as we, Z as oi, _ as si } from "./stored-dashboard-CURqJgoa.js";
2
- import { gm as Dn, bv as xe, gn as ci, go as li, gp as di, gq as ui, P as J, gr as kn, bx as fi, gs as mi, gt as ct, aj as lt, gu as pi, gv as hi, gw as gi, L as dt, gx as yi, gy as bi, gz as vi, bK as Ii, Q as Ci, gA as Fi, M as Si, m as ut, gB as ft, gC as wi, gD as F, o as Me, gE as ne, gF as x, gG as xi, gH as Ti, gI as Vt, gJ as Di, gK as Bt, gL as ki, aS as T, gM as _n, b1 as Oe, gN as _i, gO as Mi, gP as Oi, gQ as Ai, gR as $i, gb as Mn, cr as On, gS as An, gT as $n, g6 as Te, gU as qt, a4 as Z, gV as mt, gW as Ut, gX as pt, t as zt, gY as jt, ce as ht, gZ as Pi, g_ as Ni, g$ as ce, h0 as Ei, h1 as Ri, h2 as Ki, a7 as Pn, cj as gt, aE as Li, h3 as Wt, h4 as Nn, h5 as Ge, K as Vi, aH as Bi, ei as qi, h6 as Ui, h7 as zi, h8 as ji, h9 as Wi, ha as Gi, hb as Hi, hc as Yi, hd as Qi, he as He, g5 as Xi, g0 as Ke, hf as Ji, hg as Zi, hh as En, a as Rn, hi as ea, hj as ta, df as Kn, hk as Gt, cP as na, di as Ht, dh as ra, eq as ia, eO as aa, N as oa, eG as sa, aW as ca, f7 as la, hl as da, hm as ua, cy as Yt } from "./resolve-dashboard-input-context-zEXuitoF.js";
3
- import { a5 as me, s as fa, d as ma, aE as pa, a2 as Ln, au as ha, r as Ye, n as ga, c as ya, j as Vn } from "./validators-CJ8Jh0E8.js";
4
- import { s as yt, P as ba, N as va, n as Le } from "./matrix-operation-contract-BM5TveR3.js";
5
- import { a as Ia, C as Ca } from "./metric-comparison-ZmurmEIs.js";
6
- import { t as Qt, e as Xt } from "./analytics-base-schemas-BaIQrEzX.js";
1
+ import { J as Hr, K as Yr, M as Qr, N as Tn, O as Xr, P as Jr, Q as Zr, R as ei, S as ti, T as Dn, U as ni, V as Re, W as ri, X as ii, Y as ai, g as oi, k as we, Z as si, _ as ci } from "./stored-dashboard-CksluF2S.js";
2
+ import { gA as kn, bx as xe, gB as li, gC as di, gD as ui, gE as fi, P as J, gF as _n, bz as mi, gG as pi, gH as ct, aj as lt, gI as hi, gJ as gi, gK as yi, L as dt, gL as bi, gM as vi, gN as Ii, bM as Ci, Q as Fi, gO as Si, M as wi, m as ut, gP as ft, gQ as xi, gR as F, o as Me, gS as ne, gT as x, gU as Ti, gV as Di, gW as Vt, gX as ki, gY as Bt, gZ as _i, aS as T, g_ as Mn, b1 as Oe, g$ as Mi, h0 as Oi, h1 as Ai, h2 as $i, h3 as Pi, gp as On, cD as An, h4 as $n, h5 as Pn, gk as Te, h6 as qt, a4 as Z, h7 as mt, h8 as Ut, h9 as pt, t as zt, ha as jt, cq as ht, hb as Ni, hc as Ei, hd as ce, he as Ri, hf as Ki, hg as Li, a7 as Nn, cv as gt, aE as Vi, hh as Wt, hi as En, hj as Ge, K as Bi, aH as qi, ew as Ui, hk as zi, hl as ji, hm as Wi, hn as Gi, ho as Hi, hp as Yi, hq as Qi, hr as Xi, hs as He, gj as Ji, ge as Ke, ht as Zi, hu as ea, hv as Rn, a as Kn, hw as ta, hx as na, du as Ln, hy as Gt, c$ as ra, dx as Ht, dw as ia, eE as aa, f0 as oa, N as sa, eU as ca, aW as la, fl as da, bU as Yt, hz as ua, hA as fa, cK as Qt } from "./resolve-dashboard-input-context-DFBIngUZ.js";
3
+ import { a5 as me, s as ma, d as pa, aE as ha, a2 as Vn, au as ga, r as Ye, n as ya, c as ba, j as Bn } from "./validators-CrYXNnNE.js";
4
+ import { s as yt, P as va, N as Ia, n as Le } from "./matrix-operation-contract-JSmproo9.js";
5
+ import { a as Ca, C as Fa } from "./metric-comparison-xE_J6hkg.js";
6
+ import { t as Xt, e as Jt } from "./analytics-base-schemas-8wz9vqn_.js";
7
7
  import "zod";
8
- import { c as te, i as N, b1 as Fa, b2 as Sa, n as wa, j as xa, e as Qe, g as Ta, Y as A, ao as Da, av as ka, d as _a, aq as Ma, a2 as Oa, w as Aa, ad as $a, aK as M, ag as Bn, f as Pa, ae as Na } from "./pivot-result-contract-expectations-Bx_BCu-7.js";
8
+ import { c as te, i as N, b2 as Sa, b3 as wa, n as xa, j as Ta, e as Qe, g as Da, Y as A, ap as ka, aw as _a, d as Ma, ar as Oa, a2 as Aa, w as $a, ad as Pa, aL as M, ag as qn, f as Na, ae as Ea } from "./pivot-result-contract-expectations-DbBahmgc.js";
9
9
  import "../value-format-preferences/index.js";
10
- import { z as Ea, T as Ra, L as Ka, ag as La, a2 as Jt, O as qn, A as Un, ar as Va, P as zn, D as Ba, a6 as qa, a7 as Ua, G as jn, Y as za, Z as Wn, I as bt, _ as Gn, as as ja } from "./bookmark-state-CL4WEpgB.js";
11
- import { g as Wa } from "./pickers-DkqmtnTL.js";
12
- import { n as Ga } from "./index-BVKzKl5d.js";
13
- import { f as Ha, D as Ya, g as Qa, C as ye, i as Zt } from "./edit-9df1zOWe.js";
14
- import { D as Xa } from "./resolver-DG_tfEpt.js";
10
+ import { z as Ra, T as Ka, L as La, ag as Va, a2 as Zt, O as Un, A as zn, ar as Ba, P as jn, D as qa, a6 as Ua, a7 as za, G as Wn, Y as ja, Z as Gn, I as bt, _ as Hn, as as Wa } from "./bookmark-state-Bn7k3ttp.js";
11
+ import { g as Ga } from "./pickers-DkqmtnTL.js";
12
+ import { n as Ha } from "./index-BVKzKl5d.js";
13
+ import { f as Ya, D as Qa, g as Xa, C as ye, i as en } from "./edit-9df1zOWe.js";
14
+ import { D as Ja } from "./resolver-DG_tfEpt.js";
15
15
  import "./schema-C9NPiIru.js";
16
16
  import "./index-CV_Kzou0.js";
17
- import "./context-BTLBjQNh.js";
18
- import { r as Ja, L as Za, x as eo } from "./matrix-analytical-definition-DOVSFFuf.js";
19
- import { f as to } from "./filter-line-Cu2u1K36.js";
20
- import { i as no } from "./aggregate-measure-field-DsFXETpI.js";
21
- import { r as Xe } from "./pivot-result-identity-Bvs6Uq3v.js";
22
- import { r as Hn } from "./applied-constraints-DU-wndZ7.js";
23
- function ro(e, t) {
17
+ import "./context-CVXTFljo.js";
18
+ import { r as Za, L as eo, x as to } from "./matrix-analytical-definition-SN0JUJVk.js";
19
+ import { f as no } from "./filter-line-Dza3ee4w.js";
20
+ import { i as ro } from "./aggregate-measure-field-BrkXsSJp.js";
21
+ import { r as Xe } from "./pivot-result-identity-CUsMt_4r.js";
22
+ import { r as Yn } from "./applied-constraints-DU-wndZ7.js";
23
+ function io(e, t) {
24
24
  if (!(typeof e != "number" || typeof t != "number"))
25
25
  return e === t ? t : void 0;
26
26
  }
@@ -57,7 +57,7 @@ function j(e, t) {
57
57
  type: n.type,
58
58
  locale: n.locale,
59
59
  currency: n.type === "currency" ? n.currency : void 0,
60
- decimalPlaces: t != null && t.preserveOmittedProperties ? void 0 : ro(
60
+ decimalPlaces: t != null && t.preserveOmittedProperties ? void 0 : io(
61
61
  n.minimumFractionDigits,
62
62
  n.maximumFractionDigits
63
63
  ),
@@ -74,7 +74,7 @@ function j(e, t) {
74
74
  };
75
75
  }
76
76
  }
77
- function Yn(e, t) {
77
+ function Qn(e, t) {
78
78
  const n = te(e, t);
79
79
  return (n == null ? void 0 : n.type) === "duration" ? {
80
80
  style: "duration",
@@ -91,7 +91,7 @@ function Yn(e, t) {
91
91
  } : !n || !N(n) ? void 0 : {
92
92
  style: n.type === "currency" ? "currency" : n.type === "percent" ? "percent" : n.type === "scientific" ? "scientific" : "decimal",
93
93
  currency: n.type === "currency" && n.currency || (t != null && t.preserveOmittedProperties ? void 0 : "USD"),
94
- locale: n.locale || (t != null && t.preserveOmittedProperties ? void 0 : Fa),
94
+ locale: n.locale || (t != null && t.preserveOmittedProperties ? void 0 : Sa),
95
95
  minimumFractionDigits: n.minimumFractionDigits ?? (t != null && t.preserveOmittedProperties ? void 0 : 0),
96
96
  maximumFractionDigits: n.maximumFractionDigits ?? (t != null && t.preserveOmittedProperties ? void 0 : 2),
97
97
  useGrouping: typeof n.useGrouping == "boolean" ? n.useGrouping : !0,
@@ -104,60 +104,60 @@ function Yn(e, t) {
104
104
  suffix: n.suffix
105
105
  };
106
106
  }
107
- const en = [10, 20, 50, 100, 500, 1e3], io = 50;
108
- function ao(e) {
109
- return e && e > 0 ? e : io;
107
+ const tn = [10, 20, 50, 100, 500, 1e3], ao = 50;
108
+ function oo(e) {
109
+ return e && e > 0 ? e : ao;
110
110
  }
111
- function Al(e) {
112
- const t = ao(e), n = [...en];
113
- return en.includes(
111
+ function $l(e) {
112
+ const t = oo(e), n = [...tn];
113
+ return tn.includes(
114
114
  t
115
115
  ) || (n.push(t), n.sort((r, i) => r - i)), n;
116
116
  }
117
- function $l(e) {
117
+ function Pl(e) {
118
118
  var t, n;
119
- return !!((e.type === "table" || e.type === "detailTable") && e.sql && !Dn(e.config) && !((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) != null && n.forceClientPagination));
119
+ return !!((e.type === "table" || e.type === "detailTable") && e.sql && !kn(e.config) && !((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) != null && n.forceClientPagination));
120
120
  }
121
- function oo(e, t) {
121
+ function so(e, t) {
122
122
  var r, i, o, a;
123
123
  if (t === "table-print")
124
124
  return "disabled";
125
125
  if ((i = (r = e.preferences) == null ? void 0 : r.tablePrefs) != null && i.forceClientPagination)
126
126
  return "client";
127
- const n = Dn(e.config);
128
- return e.sql && !n ? (a = (o = e.preferences) == null ? void 0 : o.tablePrefs) != null && a.enableDevModePagination ? "server" : "client" : n && Gr(e) ? "server" : "client";
127
+ const n = kn(e.config);
128
+ return e.sql && !n ? (a = (o = e.preferences) == null ? void 0 : o.tablePrefs) != null && a.enableDevModePagination ? "server" : "client" : n && Hr(e) ? "server" : "client";
129
129
  }
130
- const Qn = Object.freeze({}), Pl = {
130
+ const Xn = Object.freeze({}), Nl = {
131
131
  access: "session-only",
132
132
  printMode: !1,
133
133
  baseline: null,
134
134
  applied: null,
135
135
  appliedBookmark: null,
136
- tableSettings: Qn,
136
+ tableSettings: Xn,
137
137
  notices: [],
138
138
  isFavorite: !1,
139
139
  fetchedAt: 0
140
140
  };
141
- function Nl(e) {
141
+ function El(e) {
142
142
  return !e.viewer.printMode && e.viewer.access !== "session-only" && !!e.viewer.baseline && !!e.viewerStateClient && !e.isDashboardEditing;
143
143
  }
144
- function so(e) {
145
- return e.isDashboardEditing ? Qn : e.viewer.tableSettings;
144
+ function co(e) {
145
+ return e.isDashboardEditing ? Xn : e.viewer.tableSettings;
146
146
  }
147
- function co(e, t) {
148
- return so(e)[t];
147
+ function lo(e, t) {
148
+ return co(e)[t];
149
149
  }
150
- function El(e, t, n) {
151
- if (!(n.isEditorPreview || e.isDashboardEditing) && Ea(e.dashboard, t))
152
- return { settings: co(e, t) };
150
+ function Rl(e, t, n) {
151
+ if (!(n.isEditorPreview || e.isDashboardEditing) && Ra(e.dashboard, t))
152
+ return { settings: lo(e, t) };
153
153
  }
154
- function lo(e) {
154
+ function uo(e) {
155
155
  var t;
156
- return Hr({
156
+ return Yr({
157
157
  card: e.card,
158
- paginationMode: oo(e.card) === "server" ? "server" : "client",
158
+ paginationMode: so(e.card) === "server" ? "server" : "client",
159
159
  result: {
160
- keys: e.keys ?? Yr(e.records),
160
+ keys: e.keys ?? Qr(e.records),
161
161
  rows: e.records,
162
162
  columns: e.resultColumns,
163
163
  columnKeyMap: e.columnKeyMap,
@@ -167,26 +167,26 @@ function lo(e) {
167
167
  projection: "export"
168
168
  });
169
169
  }
170
- function uo(e) {
170
+ function fo(e) {
171
171
  if (e)
172
172
  return j(
173
173
  te(e, { preserveOmittedProperties: !0 }),
174
174
  { preserveOmittedProperties: !0 }
175
175
  );
176
176
  }
177
- function fo(e) {
177
+ function mo(e) {
178
178
  if (e.type === "percent") {
179
179
  const { multiplyBy: t, percentValueMode: n, ...r } = e, i = t === 100 ? "fraction" : t === 1 ? "whole" : t === void 0 ? n : void 0;
180
180
  if (i || t === void 0)
181
- return Qt(
181
+ return Xt(
182
182
  xe({ ...r, ...i ? { percentValueMode: i } : {} }, { preserveOmittedProperties: !0 })
183
183
  );
184
184
  }
185
- return Qt(
185
+ return Xt(
186
186
  xe(e, { preserveOmittedProperties: !0 })
187
187
  );
188
188
  }
189
- const Ae = uo, Rl = fo, mo = () => ({
189
+ const Ae = fo, Kl = mo, po = () => ({
190
190
  urlTemplate: "{value}",
191
191
  // Default: use cell value as-is
192
192
  labelType: "value",
@@ -200,9 +200,9 @@ const Ae = uo, Rl = fo, mo = () => ({
200
200
  inheritMetricFormat: !0,
201
201
  textAlign: "left",
202
202
  // The table's one width rule (card appearance P2-21).
203
- width: di,
204
- minWidth: li,
205
- maxWidth: ci,
203
+ width: ui,
204
+ minWidth: di,
205
+ maxWidth: li,
206
206
  textOverflow: "ellipsis",
207
207
  textWrap: "default",
208
208
  numberFormat: {
@@ -224,12 +224,12 @@ const Ae = uo, Rl = fo, mo = () => ({
224
224
  sourceTimezone: "auto"
225
225
  // Default to auto (use explicit timezone if present, otherwise assume UTC)
226
226
  },
227
- linkFormat: mo()
227
+ linkFormat: po()
228
228
  });
229
- function Kl(e, t, n, r) {
229
+ function Ll(e, t, n, r) {
230
230
  return t && t !== "auto" ? t : n;
231
231
  }
232
- const Ll = (e) => !e || e === "auto" ? "local time" : {
232
+ const Vl = (e) => !e || e === "auto" ? "local time" : {
233
233
  "America/New_York": "Eastern Time",
234
234
  "America/Chicago": "Central Time",
235
235
  "America/Denver": "Mountain Time",
@@ -240,7 +240,7 @@ const Ll = (e) => !e || e === "auto" ? "local time" : {
240
240
  "Asia/Shanghai": "China Time",
241
241
  UTC: "UTC"
242
242
  }[e] || e;
243
- function Xn(e, t) {
243
+ function Jn(e, t) {
244
244
  const n = typeof e.decimalPlaces == "number", r = typeof e.minimumFractionDigits == "number" ? e.minimumFractionDigits : n ? e.decimalPlaces : t.min, i = typeof e.maximumFractionDigits == "number" ? e.maximumFractionDigits : n ? e.decimalPlaces : t.max;
245
245
  return {
246
246
  minimumFractionDigits: r,
@@ -248,7 +248,7 @@ function Xn(e, t) {
248
248
  };
249
249
  }
250
250
  function De(e, t) {
251
- const n = Xn(e, t), r = typeof e.suffix == "string" && e.suffix.length > 0;
251
+ const n = Jn(e, t), r = typeof e.suffix == "string" && e.suffix.length > 0;
252
252
  return {
253
253
  style: "decimal",
254
254
  locale: e.locale,
@@ -266,30 +266,30 @@ function De(e, t) {
266
266
  };
267
267
  }
268
268
  function It(e, t = "auto", n = {}) {
269
- if (t === "auto" && (t = bo(e, n)), (t === "number" || t === "currency" || t === "percent" || t === "scientific") && n.signDisplay && n.signDisplay !== "auto" && Number.isFinite(Number(e))) {
270
- const i = typeof n.multiplyBy == "number" && Number.isFinite(n.multiplyBy) ? n.multiplyBy : 1, o = Number(e) * i, a = Sa(o, n.signDisplay), s = It(a.value === o ? e : -Number(e), t, { ...n, signDisplay: void 0 });
269
+ if (t === "auto" && (t = vo(e, n)), (t === "number" || t === "currency" || t === "percent" || t === "scientific") && n.signDisplay && n.signDisplay !== "auto" && Number.isFinite(Number(e))) {
270
+ const i = typeof n.multiplyBy == "number" && Number.isFinite(n.multiplyBy) ? n.multiplyBy : 1, o = Number(e) * i, a = wa(o, n.signDisplay), s = It(a.value === o ? e : -Number(e), t, { ...n, signDisplay: void 0 });
271
271
  if (!a.plus) return s;
272
272
  const c = n.prefix ?? "";
273
273
  return c && s.startsWith(c) ? `${c}+${s.slice(c.length)}` : `+${s}`;
274
274
  }
275
275
  switch (t) {
276
276
  case "number":
277
- return Jn(e, n);
278
- case "currency":
279
277
  return Zn(e, n);
278
+ case "currency":
279
+ return er(e, n);
280
280
  case "percent":
281
- return po(e, n);
282
- case "date":
283
281
  return ho(e, n);
284
- case "scientific":
282
+ case "date":
285
283
  return go(e, n);
286
- case "duration":
284
+ case "scientific":
287
285
  return yo(e, n);
286
+ case "duration":
287
+ return bo(e, n);
288
288
  default:
289
289
  return String(e);
290
290
  }
291
291
  }
292
- function Jn(e, t = {}) {
292
+ function Zn(e, t = {}) {
293
293
  return e < 0 && !!t.prefix && !t.negativeInParentheses ? `-${Qe(
294
294
  Math.abs(e),
295
295
  De(t, {
@@ -304,8 +304,8 @@ function Jn(e, t = {}) {
304
304
  })
305
305
  );
306
306
  }
307
- function Zn(e, t = {}) {
308
- return Ta(e, {
307
+ function er(e, t = {}) {
308
+ return Da(e, {
309
309
  ...De(t, {
310
310
  min: 2,
311
311
  max: 2
@@ -314,8 +314,8 @@ function Zn(e, t = {}) {
314
314
  currency: t.currency || "USD"
315
315
  });
316
316
  }
317
- function po(e, t = {}) {
318
- const n = Xn(t, { min: 1, max: 1 }), i = typeof t.multiplyBy == "number" && Number.isFinite(t.multiplyBy) ? t.multiplyBy : t.percentValueMode === "whole" ? 1 : 100, o = e * i;
317
+ function ho(e, t = {}) {
318
+ const n = Jn(t, { min: 1, max: 1 }), i = typeof t.multiplyBy == "number" && Number.isFinite(t.multiplyBy) ? t.multiplyBy : t.percentValueMode === "whole" ? 1 : 100, o = e * i;
319
319
  return Qe(o, {
320
320
  locale: t.locale,
321
321
  minimumFractionDigits: n.minimumFractionDigits,
@@ -327,7 +327,7 @@ function po(e, t = {}) {
327
327
  useSuffix: !1
328
328
  });
329
329
  }
330
- function ho(e, t = {}) {
330
+ function go(e, t = {}) {
331
331
  const { locale: n = "en-US" } = t;
332
332
  try {
333
333
  const r = new Date(e);
@@ -338,14 +338,14 @@ function ho(e, t = {}) {
338
338
  return String(e);
339
339
  }
340
340
  }
341
- function go(e, t = {}) {
342
- return xa(
341
+ function yo(e, t = {}) {
342
+ return Ta(
343
343
  e,
344
344
  De(t, { min: 2, max: 2 })
345
345
  );
346
346
  }
347
- function yo(e, t = {}) {
348
- return wa(e, {
347
+ function bo(e, t = {}) {
348
+ return xa(e, {
349
349
  inputUnit: t.durationInputUnit,
350
350
  outputStyle: t.durationDisplayStyle,
351
351
  largestUnit: t.durationLargestUnit,
@@ -356,13 +356,13 @@ function yo(e, t = {}) {
356
356
  negativeInParentheses: t.negativeInParentheses
357
357
  });
358
358
  }
359
- function bo(e, t) {
359
+ function vo(e, t) {
360
360
  return t.currency ? "currency" : typeof e == "string" && !isNaN(Date.parse(e)) ? "date" : "number";
361
361
  }
362
- function Vl(e, t = {}) {
362
+ function Bl(e, t = {}) {
363
363
  return (n) => It(n, e, t);
364
364
  }
365
- function vo({
365
+ function Io({
366
366
  number: e,
367
367
  decimalPlaces: t = 0,
368
368
  useSuffix: n = !1,
@@ -371,7 +371,7 @@ function vo({
371
371
  locale: o = "en-US"
372
372
  }) {
373
373
  if (i) {
374
- const a = Zn(e, {
374
+ const a = er(e, {
375
375
  currency: i,
376
376
  decimalPlaces: t,
377
377
  locale: o,
@@ -379,14 +379,14 @@ function vo({
379
379
  });
380
380
  return n && r ? `${a}${r}` : a;
381
381
  }
382
- return Jn(e, {
382
+ return Zn(e, {
383
383
  decimalPlaces: t,
384
384
  useSuffix: n && !r,
385
385
  suffix: r,
386
386
  locale: o
387
387
  });
388
388
  }
389
- var Io = function e(t, n) {
389
+ var Co = function e(t, n) {
390
390
  if (t === n) return !0;
391
391
  if (t && n && typeof t == "object" && typeof n == "object") {
392
392
  if (t.constructor !== n.constructor) return !1;
@@ -412,13 +412,13 @@ var Io = function e(t, n) {
412
412
  }
413
413
  return t !== t && n !== n;
414
414
  };
415
- const ke = /* @__PURE__ */ Wa(Io);
415
+ const ke = /* @__PURE__ */ Ga(Co);
416
416
  function Ct(e, t) {
417
417
  var n;
418
418
  if (t.id)
419
419
  return (n = e.sql) != null && n.trim() ? { kind: "column", columnKey: t.id } : { kind: "metric", metricId: t.id };
420
420
  }
421
- function er(e) {
421
+ function tr(e) {
422
422
  const t = e.context.preferences;
423
423
  if (!t)
424
424
  return e.authoredFormat;
@@ -429,11 +429,11 @@ function er(e) {
429
429
  n ? e.context.resolveBoundCurrency(n) : void 0
430
430
  );
431
431
  }
432
- function Co(e) {
433
- const t = J(e.card)[e.columnKey], n = (t == null ? void 0 : t.type) === "number" ? Qr(
432
+ function Fo(e) {
433
+ const t = J(e.card)[e.columnKey], n = (t == null ? void 0 : t.type) === "number" ? Xr(
434
434
  { dataType: "number", format: void 0 },
435
435
  t
436
- ) : void 0, r = n == null ? void 0 : n.authoredFormat, i = N(r) ? er({
436
+ ) : void 0, r = n == null ? void 0 : n.authoredFormat, i = N(r) ? tr({
437
437
  card: e.card,
438
438
  metric: {
439
439
  id: e.columnKey
@@ -451,9 +451,9 @@ function Co(e) {
451
451
  format: i
452
452
  };
453
453
  }
454
- function Bl(e) {
454
+ function ql(e) {
455
455
  const t = new Set(
456
- ui(e.records)
456
+ fi(e.records)
457
457
  ), n = new Set(
458
458
  e.renderedMetricKeys || e.resultKeys
459
459
  ), r = J(e.card);
@@ -464,19 +464,19 @@ function Bl(e) {
464
464
  }
465
465
  );
466
466
  }
467
- function ql(e) {
467
+ function Ul(e) {
468
468
  var o, a;
469
469
  const { card: t, context: n } = e;
470
- if (!(n != null && n.preferences) || !kn(t.type))
470
+ if (!(n != null && n.preferences) || !_n(t.type))
471
471
  return t;
472
472
  const r = n.preferences, i = (o = t.sql) != null && o.trim() ? e.resultMetricKeys.map(
473
- (s) => Co({
473
+ (s) => Fo({
474
474
  card: t,
475
475
  columnKey: s,
476
476
  context: n
477
477
  })
478
478
  ) : (((a = t.config) == null ? void 0 : a.metricColumns) || []).map((s) => {
479
- const c = xn(t, s), l = c.authoredFormat;
479
+ const c = Tn(t, s), l = c.authoredFormat;
480
480
  if (!N(l))
481
481
  return s;
482
482
  const d = Ct(t, s), u = d ? n.resolveBoundCurrency(d) : void 0;
@@ -486,7 +486,7 @@ function ql(e) {
486
486
  l,
487
487
  r,
488
488
  u
489
- ) : er({
489
+ ) : tr({
490
490
  card: t,
491
491
  metric: s,
492
492
  context: n,
@@ -505,7 +505,7 @@ function ql(e) {
505
505
  function $e(e) {
506
506
  var c;
507
507
  const { card: t, context: n, formatOptions: r } = e, i = n == null ? void 0 : n.preferences;
508
- if (!t || !i || !kn(t.type))
508
+ if (!t || !i || !_n(t.type))
509
509
  return r;
510
510
  if (!r) {
511
511
  const l = e.metrics.filter(
@@ -575,30 +575,30 @@ function $e(e) {
575
575
  function Je(e) {
576
576
  return e ? Object.entries(e).some(([t, n]) => n == null || n === "" ? !1 : t === "type" ? n !== "auto" : !0) : !1;
577
577
  }
578
- function tr(e) {
578
+ function nr(e) {
579
579
  if (e)
580
580
  return e.alias || e.label || e.name;
581
581
  }
582
582
  function Ze(e, t) {
583
583
  var r;
584
584
  return (((r = e == null ? void 0 : e.config) == null ? void 0 : r.metricColumns) || []).find((i) => {
585
- const o = tr(i);
585
+ const o = nr(i);
586
586
  return t.metricId && i.id === t.metricId || t.metricAlias && o === t.metricAlias || t.metricAlias && i.alias === t.metricAlias || t.columnId && o === t.columnId || t.columnId && i.alias === t.columnId || t.columnId && i.label === t.columnId || t.columnId && i.name === t.columnId;
587
587
  });
588
588
  }
589
589
  function pe(e, t) {
590
590
  var r, i;
591
- const n = fi(e, t);
592
- if (!(n && ((i = (r = e == null ? void 0 : e.config) == null ? void 0 : r.groupByColumns) != null && i.includes(n)) && !mi(n)))
591
+ const n = mi(e, t);
592
+ if (!(n && ((i = (r = e == null ? void 0 : e.config) == null ? void 0 : r.groupByColumns) != null && i.includes(n)) && !pi(n)))
593
593
  return n;
594
594
  }
595
- function Fo(e) {
595
+ function So(e) {
596
596
  return !!e && !(e != null && e.format) && me(e == null ? void 0 : e.dataType) === "number";
597
597
  }
598
- const So = {
598
+ const wo = {
599
599
  style: "decimal"
600
600
  };
601
- function nr(e) {
601
+ function rr(e) {
602
602
  if (!e)
603
603
  return;
604
604
  const t = vt();
@@ -607,7 +607,7 @@ function nr(e) {
607
607
  ...e,
608
608
  inheritMetricFormat: e.numberFormat ? e.inheritMetricFormat : e.inheritMetricFormat ?? t.inheritMetricFormat,
609
609
  numberFormat: {
610
- ...So,
610
+ ...wo,
611
611
  ...e.numberFormat
612
612
  },
613
613
  dateFormat: {
@@ -620,18 +620,18 @@ function nr(e) {
620
620
  }
621
621
  };
622
622
  }
623
- function Ul(e) {
623
+ function zl(e) {
624
624
  return Object.fromEntries(
625
625
  Object.entries(e || {}).map(([t, n]) => [
626
626
  t,
627
- nr(n)
627
+ rr(n)
628
628
  ])
629
629
  );
630
630
  }
631
631
  function be(e) {
632
632
  return !!(e && typeof e == "object" && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype);
633
633
  }
634
- function rr(e, t, n) {
634
+ function ir(e, t, n) {
635
635
  if (!be(n))
636
636
  return n;
637
637
  const r = be(e) ? e : {}, i = be(t) ? t : {}, o = {};
@@ -649,7 +649,7 @@ function rr(e, t, n) {
649
649
  }
650
650
  if (!c && ke(s, l))
651
651
  continue;
652
- const d = rr(
652
+ const d = ir(
653
653
  r[a],
654
654
  l,
655
655
  s
@@ -658,8 +658,8 @@ function rr(e, t, n) {
658
658
  }
659
659
  return o;
660
660
  }
661
- function zl(e) {
662
- let t = rr(
661
+ function jl(e) {
662
+ let t = ir(
663
663
  e.persisted,
664
664
  e.baseline,
665
665
  e.next
@@ -667,11 +667,11 @@ function zl(e) {
667
667
  if (e.enforceDeclaredSqlTemporalFormat && e.next.type === "date" && !e.next.dateFormat.useRelativeTime && e.next.dateFormat.useCustomFormat) {
668
668
  const n = e.next.dateFormat.customFormat;
669
669
  if (!(n != null && n.trim()))
670
- throw new Da(
670
+ throw new ka(
671
671
  "invalid_raw_temporal_format",
672
672
  "Custom table date formatting requires a non-empty pattern."
673
673
  );
674
- ka({
674
+ _a({
675
675
  dialect: "date_fns",
676
676
  pattern: n,
677
677
  valueKind: e.rawTemporalValueKind
@@ -697,7 +697,7 @@ function zl(e) {
697
697
  type: "date"
698
698
  } : t;
699
699
  }
700
- function wo(e, t) {
700
+ function xo(e, t) {
701
701
  const n = e || vt(), r = !t;
702
702
  return {
703
703
  ...n,
@@ -715,21 +715,21 @@ function Ve(e) {
715
715
  if (e)
716
716
  return e.trim().toLowerCase();
717
717
  }
718
- const ir = /\s*(?:\((?:previous|last year|start|target|comparison)\)|δ)\s*$/i;
719
- function xo(e) {
718
+ const ar = /\s*(?:\((?:previous|last year|start|target|comparison)\)|δ)\s*$/i;
719
+ function To(e) {
720
720
  const t = e == null ? void 0 : e.trim();
721
- return t ? t.replace(ir, "").trim() || t : void 0;
721
+ return t ? t.replace(ar, "").trim() || t : void 0;
722
722
  }
723
- function To(e) {
723
+ function Do(e) {
724
724
  const t = e == null ? void 0 : e.trim();
725
- return t ? ir.test(t) : !1;
725
+ return t ? ar.test(t) : !1;
726
726
  }
727
- function Do(e, t) {
727
+ function ko(e, t) {
728
728
  return t.metricAlias ? e.find(
729
- (n) => Ia(n) === t.metricAlias
729
+ (n) => Ca(n) === t.metricAlias
730
730
  ) : t.metricId ? e.find((n) => n.id === t.metricId) : void 0;
731
731
  }
732
- function ko(e) {
732
+ function _o(e) {
733
733
  var y;
734
734
  const {
735
735
  card: t,
@@ -740,12 +740,12 @@ function ko(e) {
740
740
  metricKey: a
741
741
  } = e, s = ((y = t == null ? void 0 : t.config) == null ? void 0 : y.metricColumns) || [];
742
742
  if (r || n)
743
- return Do(s, {
743
+ return ko(s, {
744
744
  metricAlias: r,
745
745
  metricId: n
746
746
  });
747
747
  const c = [a, o], l = c.some(
748
- (h) => To(h)
748
+ (h) => Do(h)
749
749
  ), d = c.filter(
750
750
  (h) => !!h
751
751
  );
@@ -757,7 +757,7 @@ function ko(e) {
757
757
  if (g)
758
758
  return g;
759
759
  }
760
- const u = d.map((h) => Ve(h)).filter((h) => !!h), f = d.map((h) => xo(h)).filter((h) => !!h);
760
+ const u = d.map((h) => Ve(h)).filter((h) => !!h), f = d.map((h) => To(h)).filter((h) => !!h);
761
761
  for (const h of f) {
762
762
  const g = Ze(t, {
763
763
  columnId: h,
@@ -780,38 +780,38 @@ function ko(e) {
780
780
  h.alias,
781
781
  h.label,
782
782
  h.name,
783
- tr(h)
784
- ].map((I) => Ve(I)).filter((I) => !!I);
783
+ nr(h)
784
+ ].map((C) => Ve(C)).filter((C) => !!C);
785
785
  return p.some(
786
- (I) => g.includes(I)
786
+ (C) => g.includes(C)
787
787
  );
788
788
  });
789
789
  }
790
- function _o(e) {
790
+ function Mo(e) {
791
791
  const t = te(e == null ? void 0 : e.format);
792
792
  return j(t);
793
793
  }
794
- function tn(e, t) {
794
+ function nn(e, t) {
795
795
  if (t)
796
796
  return Ze(e, {
797
797
  columnId: t,
798
798
  metricAlias: t
799
799
  });
800
800
  }
801
- function nn(e) {
801
+ function rn(e) {
802
802
  const t = xe(e);
803
803
  if (t)
804
804
  return JSON.stringify(t);
805
805
  }
806
- function Mo(e, t) {
807
- const n = nn(e), r = nn(t);
806
+ function Oo(e, t) {
807
+ const n = rn(e), r = rn(t);
808
808
  return !!(n && r && n === r);
809
809
  }
810
- function Oo(e) {
810
+ function Ao(e) {
811
811
  if (e.length === 0)
812
812
  return;
813
813
  const t = e.map(
814
- (a) => _o(a)
814
+ (a) => Mo(a)
815
815
  );
816
816
  if (!t.every(
817
817
  (a) => Je(a)
@@ -819,7 +819,7 @@ function Oo(e) {
819
819
  return;
820
820
  const r = t, [i] = r;
821
821
  return r.every(
822
- (a) => Mo(i, a)
822
+ (a) => Oo(i, a)
823
823
  ) ? i : void 0;
824
824
  }
825
825
  function Pe(e) {
@@ -828,7 +828,7 @@ function Pe(e) {
828
828
  formatOptions: e.overrideFormatOptions || void 0,
829
829
  source: "override"
830
830
  };
831
- const t = Oo(
831
+ const t = Ao(
832
832
  e.metrics || []
833
833
  );
834
834
  return Je(t) ? {
@@ -839,7 +839,7 @@ function Pe(e) {
839
839
  source: "auto"
840
840
  };
841
841
  }
842
- function ar(e) {
842
+ function or(e) {
843
843
  var c, l, d;
844
844
  const { card: t, chartType: n, axis: r, preferences: i } = e, o = ((c = t == null ? void 0 : t.config) == null ? void 0 : c.metricColumns) || [], a = (i == null ? void 0 : i.datasetOptions) || [];
845
845
  if (!o.length)
@@ -852,10 +852,10 @@ function ar(e) {
852
852
  if (n === "bubble" || n === "scatter") {
853
853
  if (r === "y2")
854
854
  return [];
855
- const u = tn(
855
+ const u = nn(
856
856
  t,
857
857
  (l = i == null ? void 0 : i.bubbleScatterConfig) == null ? void 0 : l.xMetricKey
858
- ) || o[0], f = tn(
858
+ ) || o[0], f = nn(
859
859
  t,
860
860
  (d = i == null ? void 0 : i.bubbleScatterConfig) == null ? void 0 : d.yMetricKey
861
861
  ) || o[1] || o[0];
@@ -865,7 +865,7 @@ function ar(e) {
865
865
  return n === "radar" ? r === "y" ? o : [] : r !== s ? [] : o;
866
866
  }
867
867
  function Ft(e) {
868
- const { card: t, chartType: n, axis: r, preferences: i, axisConfig: o } = e, a = ar({
868
+ const { card: t, chartType: n, axis: r, preferences: i, axisConfig: o } = e, a = or({
869
869
  card: t,
870
870
  chartType: n,
871
871
  axis: r,
@@ -884,7 +884,7 @@ function Ft(e) {
884
884
  })
885
885
  };
886
886
  }
887
- function Ao(e) {
887
+ function $o(e) {
888
888
  const { preferences: t, metric: n } = e, r = t == null ? void 0 : t.tooltipConfig, i = Pe({
889
889
  overrideFormatOptions: Ae(r == null ? void 0 : r.valueFormat),
890
890
  metrics: n ? [n] : []
@@ -900,13 +900,13 @@ function Ao(e) {
900
900
  };
901
901
  }
902
902
  function St(e, t, n) {
903
- return t === lt(n, e) ? pi(n, e) : t === "x" ? e == null ? void 0 : e.xAxisConfig : t === "y2" ? e == null ? void 0 : e.secondaryYAxisConfig : e == null ? void 0 : e.yAxisConfig;
903
+ return t === lt(n, e) ? hi(n, e) : t === "x" ? e == null ? void 0 : e.xAxisConfig : t === "y2" ? e == null ? void 0 : e.secondaryYAxisConfig : e == null ? void 0 : e.yAxisConfig;
904
904
  }
905
905
  function wt(e) {
906
906
  const { chartType: t, preferences: n } = e;
907
907
  return t === "bubble" || t === "scatter" ? "y" : lt(t, n);
908
908
  }
909
- function or(e) {
909
+ function sr(e) {
910
910
  switch (e) {
911
911
  case "pie":
912
912
  case "doughnut":
@@ -919,8 +919,8 @@ function or(e) {
919
919
  return !0;
920
920
  }
921
921
  }
922
- function jl(e) {
923
- const { card: t, chartType: n, preferences: r, metric: i } = e, o = Ao({
922
+ function Wl(e) {
923
+ const { card: t, chartType: n, preferences: r, metric: i } = e, o = $o({
924
924
  card: t,
925
925
  preferences: r,
926
926
  metric: i,
@@ -938,11 +938,11 @@ function jl(e) {
938
938
  });
939
939
  return s.source === "override" ? s : o;
940
940
  }
941
- function Wl(e) {
941
+ function Gl(e) {
942
942
  const { card: t, chartType: n, preferences: r, dataLabelsConfig: i } = e, o = n || (t == null ? void 0 : t.type), a = wt({
943
943
  chartType: o,
944
944
  preferences: r
945
- }), s = ar({
945
+ }), s = or({
946
946
  card: t,
947
947
  chartType: o,
948
948
  axis: a,
@@ -959,7 +959,7 @@ function Wl(e) {
959
959
  context: e.numericPresentation
960
960
  })
961
961
  };
962
- if (l.source === "override" || !or(o))
962
+ if (l.source === "override" || !sr(o))
963
963
  return l;
964
964
  const d = Ft({
965
965
  card: t,
@@ -975,7 +975,7 @@ function Wl(e) {
975
975
  });
976
976
  return d.source === "override" ? d : l;
977
977
  }
978
- function $o(e) {
978
+ function Po(e) {
979
979
  const { preferences: t, dataLabelsConfig: n, metric: r } = e, i = Pe({
980
980
  overrideFormatOptions: Ae(n == null ? void 0 : n.valueFormat),
981
981
  metrics: r ? [r] : []
@@ -990,16 +990,16 @@ function $o(e) {
990
990
  })
991
991
  };
992
992
  }
993
- function Gl(e) {
993
+ function Hl(e) {
994
994
  var a, s;
995
- const t = ko({
995
+ const t = _o({
996
996
  card: e.card,
997
997
  metricId: e.metricId,
998
998
  metricAlias: e.metricAlias,
999
999
  datasetIndex: e.datasetIndex,
1000
1000
  datasetLabel: e.datasetLabel,
1001
1001
  metricKey: e.metricKey
1002
- }), n = $o({
1002
+ }), n = Po({
1003
1003
  card: e.card,
1004
1004
  preferences: e.preferences,
1005
1005
  dataLabelsConfig: e.dataLabelsConfig,
@@ -1009,7 +1009,7 @@ function Gl(e) {
1009
1009
  if (n.source === "override")
1010
1010
  return n;
1011
1011
  const r = (a = e.card) == null ? void 0 : a.type;
1012
- if (!or(r))
1012
+ if (!sr(r))
1013
1013
  return n;
1014
1014
  let i = wt({
1015
1015
  chartType: r,
@@ -1035,10 +1035,10 @@ function Gl(e) {
1035
1035
  });
1036
1036
  return o.source === "override" ? o : n;
1037
1037
  }
1038
- function Hl(e) {
1038
+ function Yl(e) {
1039
1039
  return (e == null ? void 0 : e.rawValue) === !0;
1040
1040
  }
1041
- function Po(e) {
1041
+ function No(e) {
1042
1042
  const t = e == null ? void 0 : e.numberFormat;
1043
1043
  if (!t)
1044
1044
  return;
@@ -1063,8 +1063,8 @@ function Po(e) {
1063
1063
  suffix: t.suffix
1064
1064
  };
1065
1065
  }
1066
- function No(e, t, n = !1) {
1067
- const r = n ? { preserveOmittedProperties: !0 } : void 0, i = te(e == null ? void 0 : e.format, r), o = Yn(
1066
+ function Eo(e, t, n = !1) {
1067
+ const r = n ? { preserveOmittedProperties: !0 } : void 0, i = te(e == null ? void 0 : e.format, r), o = Qn(
1068
1068
  i,
1069
1069
  r
1070
1070
  );
@@ -1084,7 +1084,7 @@ function No(e, t, n = !1) {
1084
1084
  }
1085
1085
  };
1086
1086
  }
1087
- function sr(e) {
1087
+ function cr(e) {
1088
1088
  var k;
1089
1089
  const {
1090
1090
  card: t,
@@ -1100,10 +1100,10 @@ function sr(e) {
1100
1100
  valueFormatPreferences: u,
1101
1101
  boundCurrency: f,
1102
1102
  preserveOmittedProperties: m
1103
- } = e, p = r ?? J(t)[n], y = !((k = t == null ? void 0 : t.sql) != null && k.trim()) || Xr(p), h = y ? u : null, g = y ? f : void 0, I = i ?? nr(p);
1104
- if (I && I.inheritMetricFormat !== !0)
1105
- return rn(
1106
- I,
1103
+ } = e, p = r ?? J(t)[n], y = !((k = t == null ? void 0 : t.sql) != null && k.trim()) || Jr(p), h = y ? u : null, g = y ? f : void 0, C = i ?? rr(p);
1104
+ if (C && C.inheritMetricFormat !== !0)
1105
+ return an(
1106
+ C,
1107
1107
  h,
1108
1108
  g
1109
1109
  );
@@ -1114,21 +1114,21 @@ function sr(e) {
1114
1114
  columnKeyMap: d,
1115
1115
  fieldId: c,
1116
1116
  fieldRole: l
1117
- }), b = No(
1117
+ }), b = Eo(
1118
1118
  v,
1119
- I || o,
1119
+ C || o,
1120
1120
  m ?? !!u
1121
- ), S = !b && h && Fo(v) ? wo(
1122
- I || o,
1121
+ ), S = !b && h && So(v) ? xo(
1122
+ C || o,
1123
1123
  g
1124
1124
  ) : void 0;
1125
- return rn(
1126
- b || S || I || o,
1125
+ return an(
1126
+ b || S || C || o,
1127
1127
  h,
1128
1128
  g
1129
1129
  );
1130
1130
  }
1131
- function rn(e, t, n) {
1131
+ function an(e, t, n) {
1132
1132
  if (!e || e.type !== "number" || !t)
1133
1133
  return e;
1134
1134
  const r = e.numberFormat, i = r ? ct(r, {
@@ -1140,7 +1140,7 @@ function rn(e, t, n) {
1140
1140
  i,
1141
1141
  t,
1142
1142
  n
1143
- ), a = Yn(o, {
1143
+ ), a = Qn(o, {
1144
1144
  preserveOmittedProperties: !0
1145
1145
  });
1146
1146
  return a ? {
@@ -1154,16 +1154,16 @@ function rn(e, t, n) {
1154
1154
  function _e(e) {
1155
1155
  if (!e.valueFormatPreferences)
1156
1156
  return;
1157
- const t = sr(e);
1157
+ const t = cr(e);
1158
1158
  if (!t || t.type !== "number")
1159
1159
  return;
1160
1160
  const n = ct(t.numberFormat, {
1161
1161
  preserveOmittedProperties: !0
1162
1162
  });
1163
- if (!(!n || !_a(n)))
1163
+ if (!(!n || !Ma(n)))
1164
1164
  return n;
1165
1165
  }
1166
- function Eo(e) {
1166
+ function Ro(e) {
1167
1167
  var r, i;
1168
1168
  if (!e.presentation.preferences)
1169
1169
  return;
@@ -1184,7 +1184,7 @@ function Eo(e) {
1184
1184
  columnKeyMap: e.columnKeyMap,
1185
1185
  metricAlias: e.metricAlias ?? (t == null ? void 0 : t.alias),
1186
1186
  valueFormatPreferences: e.presentation.preferences
1187
- }), a = Ra(e.comparisonPrecision) ?? (N(o) ? o.maximumFractionDigits : void 0) ?? (e.comparisonValueKind === "percent_change" ? 1 : 2);
1187
+ }), a = Ka(e.comparisonPrecision) ?? (N(o) ? o.maximumFractionDigits : void 0) ?? (e.comparisonValueKind === "percent_change" ? 1 : 2);
1188
1188
  return e.comparisonValueKind === "percent_change" ? {
1189
1189
  type: "percent",
1190
1190
  locale: e.presentation.preferences.locale,
@@ -1199,7 +1199,7 @@ function Eo(e) {
1199
1199
  suffix: "×"
1200
1200
  };
1201
1201
  }
1202
- const n = Jr({
1202
+ const n = Zr({
1203
1203
  card: e.card,
1204
1204
  columnKey: e.columnId,
1205
1205
  metricId: e.metricId ?? (t && !((i = (r = e.card.config) == null ? void 0 : r.groupByColumns) != null && i.includes(t)) ? t.id : void 0)
@@ -1217,10 +1217,10 @@ function Eo(e) {
1217
1217
  boundCurrency: n ? e.presentation.resolveBoundCurrency(n) : void 0
1218
1218
  });
1219
1219
  }
1220
- function Ro(e) {
1220
+ function Ko(e) {
1221
1221
  var s, c, l, d, u;
1222
1222
  if (e.card.type === "matrixTable" && e.target.kind === "matrix_measure") {
1223
- const f = e.target, m = Zr(e.card, e.matrixCatalog).find(
1223
+ const f = e.target, m = ei(e.card, e.matrixCatalog).find(
1224
1224
  (y) => y.measureId === f.measureId
1225
1225
  ), p = m == null ? void 0 : m.canonical;
1226
1226
  return p && (p.type === "number" || p.type === "currency") ? A(
@@ -1237,7 +1237,7 @@ function Ro(e) {
1237
1237
  (y) => y.id === f
1238
1238
  )))
1239
1239
  return;
1240
- const m = ei(e.card, {
1240
+ const m = ti(e.card, {
1241
1241
  ...f ? { column: { kind: "field", fieldId: f } } : {},
1242
1242
  resultColumnKey: e.target.kind === "column" ? e.target.columnKey : void 0
1243
1243
  }), p = m.authoredFormat;
@@ -1247,13 +1247,13 @@ function Ro(e) {
1247
1247
  e.boundCurrency
1248
1248
  ) : void 0;
1249
1249
  }
1250
- if (!((l = e.card.sql) != null && l.trim()) && !hi(e.card.type) && e.target.kind === "metric") {
1250
+ if (!((l = e.card.sql) != null && l.trim()) && !gi(e.card.type) && e.target.kind === "metric") {
1251
1251
  const f = e.target.metricId, m = (u = (d = e.card.config) == null ? void 0 : d.metricColumns) == null ? void 0 : u.find(
1252
1252
  (h) => h.id === f
1253
1253
  );
1254
1254
  if (!m)
1255
1255
  return;
1256
- const p = xn(
1256
+ const p = Tn(
1257
1257
  e.card,
1258
1258
  m
1259
1259
  ), y = p.authoredFormat;
@@ -1284,7 +1284,7 @@ function Ro(e) {
1284
1284
  });
1285
1285
  return N(a) ? a : void 0;
1286
1286
  }
1287
- function Yl(e) {
1287
+ function Ql(e) {
1288
1288
  var n, r;
1289
1289
  const t = e.persistedSettings ?? J(e.card)[e.columnId];
1290
1290
  if (!t && !e.resolvedSettings || (t == null ? void 0 : t.inheritMetricFormat) === !0 || ((n = e.resolvedSettings) == null ? void 0 : n.inheritMetricFormat) === !0) {
@@ -1302,16 +1302,16 @@ function Yl(e) {
1302
1302
  preserveOmittedProperties: !0
1303
1303
  });
1304
1304
  }
1305
- return Po(
1306
- sr({
1305
+ return No(
1306
+ cr({
1307
1307
  ...e,
1308
1308
  persistedSettings: t
1309
1309
  })
1310
1310
  );
1311
1311
  }
1312
- function Ql(e) {
1312
+ function Xl(e) {
1313
1313
  const { value: t, formatOptions: n, preferences: r } = e;
1314
- return n != null && n.type && n.type !== "auto" ? It(t, n.type, n) : vo({
1314
+ return n != null && n.type && n.type !== "auto" ? It(t, n.type, n) : Io({
1315
1315
  number: t,
1316
1316
  decimalPlaces: 0,
1317
1317
  useSuffix: !1,
@@ -1320,8 +1320,8 @@ function Ql(e) {
1320
1320
  currency: ""
1321
1321
  });
1322
1322
  }
1323
- function Ko(e) {
1324
- return gi({
1323
+ function Lo(e) {
1324
+ return yi({
1325
1325
  ...e,
1326
1326
  activation: dt({
1327
1327
  card: e.card,
@@ -1329,8 +1329,8 @@ function Ko(e) {
1329
1329
  })
1330
1330
  });
1331
1331
  }
1332
- function Xl(e) {
1333
- return yi({
1332
+ function Jl(e) {
1333
+ return bi({
1334
1334
  activation: dt({
1335
1335
  card: e.card,
1336
1336
  cardConfig: e.cardConfig
@@ -1339,8 +1339,8 @@ function Xl(e) {
1339
1339
  expectedResultOwner: e.expectedResultOwner
1340
1340
  });
1341
1341
  }
1342
- function Lo(e) {
1343
- const t = Tn(e.card, e.effectiveCardConfig), n = lo({
1342
+ function Vo(e) {
1343
+ const t = Dn(e.card, e.effectiveCardConfig), n = uo({
1344
1344
  card: t,
1345
1345
  records: e.rows,
1346
1346
  keys: e.rows.length === 0 ? e.resultKeys : void 0,
@@ -1363,34 +1363,34 @@ function Lo(e) {
1363
1363
  }
1364
1364
  };
1365
1365
  }
1366
- function Vo(e) {
1366
+ function Bo(e) {
1367
1367
  var n;
1368
1368
  const t = (n = e.preferences) == null ? void 0 : n.comparisonPresentation;
1369
1369
  return {
1370
- ...Ca,
1370
+ ...Fa,
1371
1371
  ...t,
1372
1372
  ...t != null && t.conditionalLabels ? { conditionalLabels: { ...t.conditionalLabels } } : {},
1373
1373
  ...t != null && t.colors ? { colors: { ...t.colors } } : {}
1374
1374
  };
1375
1375
  }
1376
- function Bo(e) {
1377
- const t = Tn(e.card, e.effectiveCardConfig), { cardId: n, ...r } = e.requestPayloadBase, i = e.formatOptions.visibleColumns ?? [], o = [
1376
+ function qo(e) {
1377
+ const t = Dn(e.card, e.effectiveCardConfig), { cardId: n, ...r } = e.requestPayloadBase, i = e.formatOptions.visibleColumns ?? [], o = [
1378
1378
  ...i,
1379
1379
  ...Object.keys(e.formatOptions.columnSettings ?? {})
1380
- ], a = bi(
1380
+ ], a = vi(
1381
1381
  e.card,
1382
1382
  i,
1383
1383
  e.effectiveCardConfig
1384
- ), s = vi(
1384
+ ), s = Ii(
1385
1385
  e.card,
1386
1386
  e.effectiveCardConfig,
1387
1387
  a
1388
- ), c = ti(
1388
+ ), c = ni(
1389
1389
  t,
1390
1390
  o
1391
1391
  ), l = new Set(
1392
1392
  c.eligibleTargets.map(Re)
1393
- ), d = (v) => l.has(Re(v)) ? ri({
1393
+ ), d = (v) => l.has(Re(v)) ? ii({
1394
1394
  bindings: r.controlBindings,
1395
1395
  controls: [
1396
1396
  ...r.controlDefinitions ?? [],
@@ -1400,14 +1400,14 @@ function Bo(e) {
1400
1400
  target: v,
1401
1401
  knownTargets: c.knownTargets,
1402
1402
  eligibleTargets: c.eligibleTargets
1403
- }).currency : void 0, u = ni({
1403
+ }).currency : void 0, u = ri({
1404
1404
  card: e.card,
1405
1405
  comparisonMetadata: e.comparisonMetadata,
1406
1406
  columnKeyMap: e.columnKeyMap
1407
1407
  }), f = dt({
1408
1408
  card: e.card,
1409
1409
  cardConfig: e.effectiveCardConfig
1410
- }), m = Ko({
1410
+ }), m = Lo({
1411
1411
  card: e.card,
1412
1412
  cardConfig: e.effectiveCardConfig,
1413
1413
  columns: e.resultColumns,
@@ -1429,7 +1429,7 @@ function Bo(e) {
1429
1429
  throw new Error(
1430
1430
  "Canonical raw temporal export requires an authoritative columnKeyMap."
1431
1431
  );
1432
- const b = Ii({
1432
+ const b = Ci({
1433
1433
  cardType: e.card.type,
1434
1434
  resultOwner: r.resultOwner,
1435
1435
  effectiveCardConfig: e.effectiveCardConfig,
@@ -1447,14 +1447,14 @@ function Bo(e) {
1447
1447
  h.set(S, $.format);
1448
1448
  }
1449
1449
  } else if (r.resultOwner === "freeform" && r.sql.trim() && !r.python.trim())
1450
- for (const [v, C] of Object.entries(
1450
+ for (const [v, I] of Object.entries(
1451
1451
  J(e.card)
1452
1452
  )) {
1453
- if (C.type !== "date") continue;
1454
- const b = Ci(C.dateFormat);
1453
+ if (I.type !== "date") continue;
1454
+ const b = Fi(I.dateFormat);
1455
1455
  b && h.set(
1456
1456
  v,
1457
- Ma({
1457
+ Oa({
1458
1458
  format: b,
1459
1459
  preferences: e.reportContext.valueFormat,
1460
1460
  calendar: e.reportContext.calendar
@@ -1467,12 +1467,12 @@ function Bo(e) {
1467
1467
  var H, K, ge;
1468
1468
  if (m.byColumnKey.has(v) || h.has(v))
1469
1469
  return [];
1470
- const C = u.columnPresentationOwners.get(v), b = {
1471
- ...Fi(t, v, {
1470
+ const I = u.columnPresentationOwners.get(v), b = {
1471
+ ...Si(t, v, {
1472
1472
  columnKeyMap: e.columnKeyMap,
1473
1473
  resultColumns: e.resultColumns
1474
1474
  }),
1475
- ...C ? { metricId: C.metricId, metricAlias: C.metricAlias } : {}
1475
+ ...I ? { metricId: I.metricId, metricAlias: I.metricAlias } : {}
1476
1476
  }, S = (H = t.sql) != null && H.trim() ? void 0 : pe(t, b), $ = S ? { kind: "metric", metricId: S.id } : { kind: "column", columnKey: v }, k = l.has(
1477
1477
  Re($)
1478
1478
  ), q = d($), G = J(t)[v], E = {
@@ -1495,20 +1495,20 @@ function Bo(e) {
1495
1495
  }
1496
1496
  }
1497
1497
  ];
1498
- const U = (C ? Eo({
1498
+ const U = (I ? Ro({
1499
1499
  card: t,
1500
1500
  columnId: v,
1501
1501
  columnKeyMap: e.columnKeyMap,
1502
1502
  persistedSettings: G,
1503
- metricId: C.metricId,
1504
- metricAlias: C.metricAlias,
1505
- comparisonValueKind: C.kind,
1503
+ metricId: I.metricId,
1504
+ metricAlias: I.metricAlias,
1505
+ comparisonValueKind: I.kind,
1506
1506
  comparisonPrecision: (ge = (K = t.preferences) == null ? void 0 : K.comparisonPresentation) == null ? void 0 : ge.precision,
1507
1507
  presentation: {
1508
1508
  preferences: e.reportContext.valueFormat,
1509
1509
  resolveBoundCurrency: d
1510
1510
  }
1511
- }) : void 0) ?? (k ? Ro({
1511
+ }) : void 0) ?? (k ? Ko({
1512
1512
  card: t,
1513
1513
  target: $,
1514
1514
  resultColumnKeys: o,
@@ -1537,10 +1537,10 @@ function Bo(e) {
1537
1537
  });
1538
1538
  g.push(
1539
1539
  ...[...m.byColumnKey.values()].map((v) => {
1540
- const C = y.get(
1540
+ const I = y.get(
1541
1541
  `${v.role ?? "groupby"}:${v.fieldId}`
1542
1542
  );
1543
- if (!C)
1543
+ if (!I)
1544
1544
  throw new Error(
1545
1545
  `Unable to resolve temporal export field "${v.fieldId}".`
1546
1546
  );
@@ -1550,24 +1550,25 @@ function Bo(e) {
1550
1550
  cardId: e.card.id
1551
1551
  },
1552
1552
  target: { kind: "column", columnKey: v.columnKey },
1553
- format: Si(
1554
- C,
1553
+ format: wi(
1554
+ I,
1555
1555
  {
1556
1556
  dateStyle: e.reportContext.valueFormat.dateStyle,
1557
1557
  dateTime: { ...e.reportContext.valueFormat.dateTime }
1558
1558
  },
1559
- e.reportContext.valueFormat.locale
1559
+ e.reportContext.valueFormat.locale,
1560
+ v.metadata.granularity
1560
1561
  )
1561
1562
  };
1562
1563
  })
1563
1564
  ), g.push(
1564
- ...[...h].map(([v, C]) => ({
1565
+ ...[...h].map(([v, I]) => ({
1565
1566
  scope: { dashboardId: e.dashboardId, cardId: e.card.id },
1566
1567
  target: { kind: "column", columnKey: v },
1567
- format: C
1568
+ format: I
1568
1569
  }))
1569
1570
  );
1570
- const I = Oa({
1571
+ const C = Aa({
1571
1572
  reportContext: e.reportContext,
1572
1573
  resolvedFormats: g
1573
1574
  });
@@ -1575,17 +1576,17 @@ function Bo(e) {
1575
1576
  formatOptions: {
1576
1577
  ...e.formatOptions,
1577
1578
  ...a ? { tableTotalsLabelColumnKey: a } : {},
1578
- comparisonPresentation: Vo(e.card),
1579
- presentationExecutionSnapshot: I
1579
+ comparisonPresentation: Bo(e.card),
1580
+ presentationExecutionSnapshot: C
1580
1581
  },
1581
1582
  ...s ? { tableTotalsRequest: s } : {}
1582
1583
  };
1583
1584
  }
1584
- function qo(e) {
1585
- const t = ai(
1585
+ function Uo(e) {
1586
+ const t = oi(
1586
1587
  e.card,
1587
1588
  e.requestPayloadBase
1588
- ), { cardId: n, ...r } = t.requestPayloadBase, i = Bo(e);
1589
+ ), { cardId: n, ...r } = t.requestPayloadBase, i = qo(e);
1589
1590
  return {
1590
1591
  type: "card",
1591
1592
  dashboardId: e.dashboardId,
@@ -1599,14 +1600,14 @@ function qo(e) {
1599
1600
  formatOptions: i.formatOptions
1600
1601
  };
1601
1602
  }
1602
- function Jl(e) {
1603
+ function Zl(e) {
1603
1604
  const { card: t, result: n } = e;
1604
1605
  if (t.type !== "table" && t.type !== "detailTable")
1605
1606
  return { status: "refused", reason: "not_a_table" };
1606
- const r = n.modelFormats ? Aa(e.effectiveCardConfig ?? t.config, n) : e.effectiveCardConfig;
1607
- if (ii({ card: t, comparisonMetadata: n.comparisonMetadata }))
1607
+ const r = n.modelFormats ? $a(e.effectiveCardConfig ?? t.config, n) : e.effectiveCardConfig;
1608
+ if (ai({ card: t, comparisonMetadata: n.comparisonMetadata }))
1608
1609
  return { status: "refused", reason: "comparison_metadata_missing" };
1609
- const i = Lo({
1610
+ const i = Vo({
1610
1611
  card: t,
1611
1612
  effectiveCardConfig: r,
1612
1613
  rows: e.rows,
@@ -1617,7 +1618,7 @@ function Jl(e) {
1617
1618
  });
1618
1619
  return i ? {
1619
1620
  status: "ready",
1620
- request: qo({
1621
+ request: Uo({
1621
1622
  card: t,
1622
1623
  dashboardId: e.dashboardId,
1623
1624
  title: e.title,
@@ -1633,9 +1634,9 @@ function Jl(e) {
1633
1634
  })
1634
1635
  } : { status: "refused", reason: "columns_unresolved" };
1635
1636
  }
1636
- function cr(e, t, n) {
1637
- if (fa(
1638
- ma(t),
1637
+ function lr(e, t, n) {
1638
+ if (ma(
1639
+ pa(t),
1639
1640
  e.aggregateOrigin
1640
1641
  ))
1641
1642
  return { aggregate: void 0, aggregateOrigin: void 0 };
@@ -1645,7 +1646,7 @@ function cr(e, t, n) {
1645
1646
  aggregateOrigin: e.aggregate ? e.aggregateOrigin : r ? t.aggregateOrigin : void 0
1646
1647
  };
1647
1648
  }
1648
- function Uo(e, t, n) {
1649
+ function zo(e, t, n) {
1649
1650
  var r, i, o, a, s, c;
1650
1651
  if (n === "domain")
1651
1652
  return {
@@ -1658,7 +1659,7 @@ function Uo(e, t, n) {
1658
1659
  windowTransform: ((s = e.parameters) == null ? void 0 : s.windowTransform) ?? ((c = t.parameters) == null ? void 0 : c.windowTransform)
1659
1660
  };
1660
1661
  }
1661
- function Zl(e, t, n) {
1662
+ function ed(e, t, n) {
1662
1663
  const r = e;
1663
1664
  return {
1664
1665
  id: e.id,
@@ -1667,22 +1668,22 @@ function Zl(e, t, n) {
1667
1668
  // range bounds). They do not identify or redefine the catalog calculation.
1668
1669
  ...n === "selection" && e.alias ? { alias: e.alias } : {},
1669
1670
  granularity: e.granularity ?? t.granularity,
1670
- ...cr(e, t, n),
1671
+ ...lr(e, t, n),
1671
1672
  ...e.role === "metric" ? {
1672
1673
  aliasTemplate: r.aliasTemplate,
1673
1674
  valueAliases: r.valueAliases,
1674
1675
  comparison: r.comparison,
1675
1676
  comparisonPolarity: r.comparisonPolarity,
1676
- parameters: Uo(
1677
+ parameters: zo(
1677
1678
  r,
1678
1679
  t,
1679
1680
  "domain"
1680
1681
  )
1681
1682
  } : {},
1682
- ...zo(e)
1683
+ ...jo(e)
1683
1684
  };
1684
1685
  }
1685
- function zo(e) {
1686
+ function jo(e) {
1686
1687
  const t = {
1687
1688
  ...e.labelOrigin === "override" ? { label: e.label, labelOrigin: e.labelOrigin } : {},
1688
1689
  ...e.formatOrigin === "override" ? { format: e.format, formatOrigin: e.formatOrigin } : {}
@@ -1702,17 +1703,17 @@ function zo(e) {
1702
1703
  return t;
1703
1704
  }
1704
1705
  }
1705
- const jo = "table";
1706
- function ed({ preferences: e, ...t }) {
1706
+ const Wo = "table";
1707
+ function td({ preferences: e, ...t }) {
1707
1708
  return {
1708
1709
  ...t,
1709
- type: jo,
1710
+ type: Wo,
1710
1711
  preferences: e ?? { onClickFilter: [{ columnIndex: 0, expression: "" }] },
1711
1712
  sql: "",
1712
1713
  data: []
1713
1714
  };
1714
1715
  }
1715
- function td(e) {
1716
+ function nd(e) {
1716
1717
  return {
1717
1718
  id: e.id,
1718
1719
  title: e.title,
@@ -1722,51 +1723,51 @@ function td(e) {
1722
1723
  data: []
1723
1724
  };
1724
1725
  }
1725
- const Wo = ["light", "dark"], Go = ["none", "subtle", "raised"];
1726
- function Ho(e, t) {
1727
- const { style: n, issues: r } = Yo(e);
1726
+ const Go = ["light", "dark"], Ho = ["none", "subtle", "raised"];
1727
+ function Yo(e, t) {
1728
+ const { style: n, issues: r } = Qo(e);
1728
1729
  return t === "lenient" ? { style: n, dropped: r } : r.length > 0 ? { ok: !1, issues: r } : { ok: !0, style: n };
1729
1730
  }
1730
- function Yo(e) {
1731
+ function Qo(e) {
1731
1732
  if (e == null) return { style: void 0, issues: [] };
1732
- if (!lr(e))
1733
+ if (!dr(e))
1733
1734
  return { style: void 0, issues: [{ field: "dashboardStyle", code: "invalid_value", message: "The dashboard style must be an object." }] };
1734
1735
  const t = [], n = {};
1735
1736
  for (const [r, i] of Object.entries(e)) {
1736
- if (!Xa.includes(r)) {
1737
+ if (!Ja.includes(r)) {
1737
1738
  t.push({ field: r, code: "unknown_field", message: `${r} is not a dashboard style field.` });
1738
1739
  continue;
1739
1740
  }
1740
- const o = Qo(r, i, t);
1741
+ const o = Xo(r, i, t);
1741
1742
  o !== void 0 && (n[r] = o);
1742
1743
  }
1743
1744
  return { style: Object.keys(n).length > 0 ? n : void 0, issues: t };
1744
1745
  }
1745
- function Qo(e, t, n) {
1746
- if (Ha(e)) {
1747
- const { min: r, max: i, label: o } = Ya[e];
1748
- return typeof t != "number" || !Number.isFinite(t) ? R(n, e, "invalid_value", `${o} must be a number of px.`) : Number.isInteger(t) ? t < r || t > i ? R(n, e, "out_of_range", `${Qa(e)}.`) : t : R(n, e, "not_integer", `${o} must be a whole number of px.`);
1746
+ function Xo(e, t, n) {
1747
+ if (Ya(e)) {
1748
+ const { min: r, max: i, label: o } = Qa[e];
1749
+ return typeof t != "number" || !Number.isFinite(t) ? R(n, e, "invalid_value", `${o} must be a number of px.`) : Number.isInteger(t) ? t < r || t > i ? R(n, e, "out_of_range", `${Xa(e)}.`) : t : R(n, e, "not_integer", `${o} must be a whole number of px.`);
1749
1750
  }
1750
1751
  switch (e) {
1751
1752
  case "cardBorder":
1752
1753
  return t === "on" || t === "off" ? t : R(n, e, "invalid_value", "Card border is on or off.");
1753
1754
  case "cardShadow":
1754
- return typeof t == "string" && Go.includes(t) ? t : R(n, e, "invalid_value", "Card shadow is none, subtle or raised.");
1755
+ return typeof t == "string" && Ho.includes(t) ? t : R(n, e, "invalid_value", "Card shadow is none, subtle or raised.");
1755
1756
  case "canvas":
1756
- return an(e, t, n, (r, i) => r === "muted" || r === "background" ? r : Zt(r) ? r.toLowerCase() : R(n, i, "invalid_colour", "The canvas is muted, background or a hex colour."));
1757
+ return on(e, t, n, (r, i) => r === "muted" || r === "background" ? r : en(r) ? r.toLowerCase() : R(n, i, "invalid_colour", "The canvas is muted, background or a hex colour."));
1757
1758
  case "chartColors":
1758
- return an(e, t, n, (r, i) => Array.isArray(r) ? r.length < ye.min || r.length > ye.max ? R(n, i, "palette_size", `Chart colours hold ${ye.min} to ${ye.max} colours.`) : r.every(Zt) ? r.map((o) => o.toLowerCase()) : R(n, i, "invalid_colour", "Chart colours are hex colours, like #2563eb.") : R(n, i, "invalid_value", "Chart colours are a list of hex colours."));
1759
+ return on(e, t, n, (r, i) => Array.isArray(r) ? r.length < ye.min || r.length > ye.max ? R(n, i, "palette_size", `Chart colours hold ${ye.min} to ${ye.max} colours.`) : r.every(en) ? r.map((o) => o.toLowerCase()) : R(n, i, "invalid_colour", "Chart colours are hex colours, like #2563eb.") : R(n, i, "invalid_value", "Chart colours are a list of hex colours."));
1759
1760
  default:
1760
1761
  return;
1761
1762
  }
1762
1763
  }
1763
- function an(e, t, n, r) {
1764
- if (!lr(t)) return R(n, e, "invalid_value", `${e} holds a light and a dark value.`);
1764
+ function on(e, t, n, r) {
1765
+ if (!dr(t)) return R(n, e, "invalid_value", `${e} holds a light and a dark value.`);
1765
1766
  const i = {};
1766
1767
  for (const [o, a] of Object.entries(t)) {
1767
1768
  if (a === void 0) continue;
1768
1769
  const s = `${e}.${o}`;
1769
- if (!Wo.includes(o)) {
1770
+ if (!Go.includes(o)) {
1770
1771
  R(n, s, "unknown_field", `${e} holds light and dark values only.`);
1771
1772
  continue;
1772
1773
  }
@@ -1778,14 +1779,14 @@ function an(e, t, n, r) {
1778
1779
  function R(e, t, n, r) {
1779
1780
  e.push({ field: t, code: n, message: r });
1780
1781
  }
1781
- function lr(e) {
1782
+ function dr(e) {
1782
1783
  return typeof e == "object" && e !== null && !Array.isArray(e);
1783
1784
  }
1784
- function nd(e, t) {
1785
+ function rd(e, t) {
1785
1786
  const n = t ?? null;
1786
- return { style: e.dashboardStyle !== void 0 ? Ho(e.dashboardStyle, "lenient").style : void 0, organizationAppearance: n ? Ga(n).spec : null };
1787
+ return { style: e.dashboardStyle !== void 0 ? Yo(e.dashboardStyle, "lenient").style : void 0, organizationAppearance: n ? Ha(n).spec : null };
1787
1788
  }
1788
- const Xo = {
1789
+ const Jo = {
1789
1790
  SUM: "total",
1790
1791
  AVG: "average",
1791
1792
  MIN: "lowest",
@@ -1801,12 +1802,12 @@ function ve(e) {
1801
1802
  const t = e;
1802
1803
  return !e.aggregate || t.labelOrigin === "override" ? se(e) : ft(e.name);
1803
1804
  }
1804
- function on(e) {
1805
+ function sn(e) {
1805
1806
  return e.length <= 1 ? e[0] ?? "" : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
1806
1807
  }
1807
- function Jo(e) {
1808
+ function Zo(e) {
1808
1809
  var i, o, a;
1809
- const t = Ka({ variables: [e] })[0];
1810
+ const t = La({ variables: [e] })[0];
1810
1811
  if (!t) return;
1811
1812
  const n = ut(t.card), r = n.kind === "config" ? n.executableSources[0] : n.kind === "sql" ? (i = n.pinnedCatalogSources[0]) == null ? void 0 : i.source : void 0;
1812
1813
  if (!r) {
@@ -1816,55 +1817,55 @@ function Jo(e) {
1816
1817
  if (r.kind === "semantic") return r.label || r.datasetName;
1817
1818
  if (r.kind === "physical") return r.label || r.tableName;
1818
1819
  }
1819
- function Zo(e) {
1820
+ function es(e) {
1820
1821
  var r;
1821
- const t = (r = e.query.config) == null ? void 0 : r.filters, n = t ? dr(t) : 0;
1822
+ const t = (r = e.query.config) == null ? void 0 : r.filters, n = t ? ur(t) : 0;
1822
1823
  return n ? n === 1 ? " with one condition" : ` with ${n} conditions` : "";
1823
1824
  }
1824
- function dr(e) {
1825
+ function ur(e) {
1825
1826
  var t;
1826
- return (((t = e.conditions) == null ? void 0 : t.length) ?? 0) + (e.groups ?? []).reduce((n, r) => n + dr(r), 0);
1827
+ return (((t = e.conditions) == null ? void 0 : t.length) ?? 0) + (e.groups ?? []).reduce((n, r) => n + ur(r), 0);
1827
1828
  }
1828
- function sn(e) {
1829
+ function cn(e) {
1829
1830
  if (!e) return "";
1830
1831
  const t = me(e.dataType), n = t === "date" || t === "datetime" ? e.direction === "desc" ? "latest first" : "earliest first" : t === "number" ? e.direction === "desc" ? "highest first" : "lowest first" : e.direction === "desc" ? "Z to A" : "A to Z";
1831
1832
  return ` by ${e.aggregate ? ve(e) : se(e)}, ${n}`;
1832
1833
  }
1833
- function es(e) {
1834
+ function ts(e) {
1834
1835
  var s, c, l;
1835
- const t = Jo(e), n = t ? ` in ${t}` : "", r = Zo(e);
1836
+ const t = Zo(e), n = t ? ` in ${t}` : "", r = es(e);
1836
1837
  if ((s = e.query.sql) != null && s.trim()) {
1837
1838
  const d = e.get.kind === "first" ? "the first row" : "the only row";
1838
- return `${ts(d)} of a SQL query${t ? ` on ${t}` : ""}`;
1839
+ return `${ns(d)} of a SQL query${t ? ` on ${t}` : ""}`;
1839
1840
  }
1840
1841
  const i = e.query.config ?? {}, o = i.groupByColumns ?? [], a = i.metricColumns ?? [];
1841
1842
  switch (e.get.kind) {
1842
1843
  case "aggregate": {
1843
1844
  const d = a[0];
1844
- return d ? d.aggregate ? `The ${Xo[String(d.aggregate).toUpperCase()] ?? String(d.aggregate).toLowerCase()} ${ve(d)}${n}${r}${cn(e)}` : `The ${se(d)}${n}${r}${cn(e)}` : "An aggregate, with no measure chosen yet";
1845
+ return d ? d.aggregate ? `The ${Jo[String(d.aggregate).toUpperCase()] ?? String(d.aggregate).toLowerCase()} ${ve(d)}${n}${r}${ln(e)}` : `The ${se(d)}${n}${r}${ln(e)}` : "An aggregate, with no measure chosen yet";
1845
1846
  }
1846
1847
  case "list": {
1847
1848
  const d = o[0];
1848
- return d ? `The ${se(d)} values${n}${r}, as a list${sn((c = i.sortByColumns) == null ? void 0 : c[0])}` : "A list, with no field chosen yet";
1849
+ return d ? `The ${se(d)} values${n}${r}, as a list${cn((c = i.sortByColumns) == null ? void 0 : c[0])}` : "A list, with no field chosen yet";
1849
1850
  }
1850
1851
  case "first": {
1851
1852
  const d = [...o.map(se), ...a.map(ve)];
1852
- return d.length ? `The first ${on(d)}${n}${r}${sn((l = i.sortByColumns) == null ? void 0 : l[0])}` : "The first row, with no field chosen yet";
1853
+ return d.length ? `The first ${sn(d)}${n}${r}${cn((l = i.sortByColumns) == null ? void 0 : l[0])}` : "The first row, with no field chosen yet";
1853
1854
  }
1854
1855
  default: {
1855
1856
  const d = [...o.map(se), ...a.map(ve)];
1856
- return d.length ? `The ${on(d)}${n}${r}, the only value` : "The only value, with no field chosen yet";
1857
+ return d.length ? `The ${sn(d)}${n}${r}, the only value` : "The only value, with no field chosen yet";
1857
1858
  }
1858
1859
  }
1859
1860
  }
1860
- function cn(e) {
1861
- const t = La(e);
1862
- return t ? `, compared with ${wi({ mode: "explicit", spec: t })}` : "";
1861
+ function ln(e) {
1862
+ const t = Va(e);
1863
+ return t ? `, compared with ${xi({ mode: "explicit", spec: t })}` : "";
1863
1864
  }
1864
- function ts(e) {
1865
+ function ns(e) {
1865
1866
  return e.charAt(0).toUpperCase() + e.slice(1);
1866
1867
  }
1867
- function ns(e, t) {
1868
+ function rs(e, t) {
1868
1869
  const n = e.sheets ?? [], r = n.findIndex((a) => a.id === t.sheetId), i = n[r];
1869
1870
  if (!i)
1870
1871
  throw new F("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`);
@@ -1880,11 +1881,11 @@ function ns(e, t) {
1880
1881
  clauses: [x.arranged(i.title || "the dashboard", t.keepOrder === !0, !(i.frames ?? []).length)]
1881
1882
  };
1882
1883
  }
1883
- function rs(e) {
1884
+ function is(e) {
1884
1885
  return !!(e && Object.prototype.hasOwnProperty.call(e, "calculatedFields"));
1885
1886
  }
1886
1887
  function ee(...e) {
1887
- return xi(e.flatMap((t) => t || []));
1888
+ return Ti(e.flatMap((t) => t || []));
1888
1889
  }
1889
1890
  function le(e, t) {
1890
1891
  return {
@@ -1895,10 +1896,10 @@ function le(e, t) {
1895
1896
  function xt(e) {
1896
1897
  return ((e == null ? void 0 : e.calculatedFields) || []).filter((t) => t.fieldScope === "sheet").map((t) => le(t, "sheet"));
1897
1898
  }
1898
- function ur(e) {
1899
+ function fr(e) {
1899
1900
  return ((e == null ? void 0 : e.calculatedFields) || []).filter((t) => !t.fieldScope).map((t) => le(t, "sheet"));
1900
1901
  }
1901
- function is(e) {
1902
+ function as(e) {
1902
1903
  return e ? [
1903
1904
  ...(e.calculatedFields || []).filter(
1904
1905
  (t) => t.fieldScope === "dashboard"
@@ -1906,21 +1907,21 @@ function is(e) {
1906
1907
  ...(e.frames || []).flatMap((t) => t.calculatedFields || [])
1907
1908
  ].map((t) => le(t, "dashboard")) : [];
1908
1909
  }
1909
- function as(e) {
1910
+ function os(e) {
1910
1911
  if (e !== void 0)
1911
1912
  return ee(
1912
1913
  e.map((t) => le(t, "dashboard"))
1913
1914
  );
1914
1915
  }
1915
- function rd(e) {
1916
+ function id(e) {
1916
1917
  var r;
1917
1918
  const t = [], n = (e.sheets || []).map((i) => {
1918
1919
  var o;
1919
- return t.push(...is(i)), {
1920
+ return t.push(...as(i)), {
1920
1921
  ...i,
1921
1922
  calculatedFields: ee(
1922
1923
  xt(i),
1923
- ur(i)
1924
+ fr(i)
1924
1925
  ),
1925
1926
  frames: (o = i.frames) == null ? void 0 : o.map(
1926
1927
  (a) => a.calculatedFields === void 0 ? a : { ...a, calculatedFields: void 0 }
@@ -1929,7 +1930,7 @@ function rd(e) {
1929
1930
  });
1930
1931
  return {
1931
1932
  ...e,
1932
- calculatedFields: as(
1933
+ calculatedFields: os(
1933
1934
  ee(
1934
1935
  (r = e.calculatedFields) == null ? void 0 : r.map(
1935
1936
  (i) => le(i, "dashboard")
@@ -1940,7 +1941,7 @@ function rd(e) {
1940
1941
  sheets: n
1941
1942
  };
1942
1943
  }
1943
- function ln(e, t) {
1944
+ function dn(e, t) {
1944
1945
  var i;
1945
1946
  if (!((i = e == null ? void 0 : e.frames) != null && i.length))
1946
1947
  return [];
@@ -1952,30 +1953,30 @@ function ln(e, t) {
1952
1953
  ...r.map((o) => o.calculatedFields)
1953
1954
  );
1954
1955
  }
1955
- function os(e, t) {
1956
+ function ss(e, t) {
1956
1957
  return e ? xt(e) : [];
1957
1958
  }
1958
- function id(e, t) {
1959
+ function ad(e, t) {
1959
1960
  if (!e)
1960
1961
  return [];
1961
- const n = xt(e), r = ur(e), i = ee(
1962
+ const n = xt(e), r = fr(e), i = ee(
1962
1963
  n,
1963
1964
  r
1964
1965
  );
1965
- return rs(e) ? i.length === 0 ? [] : r.length === 0 ? i : ee(
1966
+ return is(e) ? i.length === 0 ? [] : r.length === 0 ? i : ee(
1966
1967
  i,
1967
- ln(e, t)
1968
- ) : ln(e, t);
1968
+ dn(e, t)
1969
+ ) : dn(e, t);
1969
1970
  }
1970
- function ss(e) {
1971
+ function cs(e) {
1971
1972
  if (e !== void 0)
1972
1973
  return ee(
1973
1974
  e.map((t) => le(t, "sheet"))
1974
1975
  );
1975
1976
  }
1976
- function ad(e) {
1977
+ function od(e) {
1977
1978
  const { field: t, sheetFields: n = [], dashboardFields: r = [] } = e, i = (s) => s.find(
1978
- (c) => Ti(c, t, {
1979
+ (c) => Di(c, t, {
1979
1980
  allowComparableFallback: !0
1980
1981
  })
1981
1982
  );
@@ -1989,9 +1990,9 @@ function ad(e) {
1989
1990
  const a = i(r);
1990
1991
  return a ? { scope: "dashboard", matchedField: a } : { scope: "card" };
1991
1992
  }
1992
- function cs(e, t) {
1993
- var I, v, C;
1994
- const n = (e.sheets ?? []).findIndex((b) => b.id === t.sheetId), r = (I = e.sheets) == null ? void 0 : I[n];
1993
+ function ls(e, t) {
1994
+ var C, v, I;
1995
+ const n = (e.sheets ?? []).findIndex((b) => b.id === t.sheetId), r = (C = e.sheets) == null ? void 0 : C[n];
1995
1996
  if (!(r != null && r.frames))
1996
1997
  throw new F("sheet_not_found", `No sheet ${t.sheetId} with frames on this dashboard.`);
1997
1998
  const { frame: i } = t, o = r.frames.findIndex((b) => b.id === i.id);
@@ -2002,31 +2003,31 @@ function cs(e, t) {
2002
2003
  return b.some((S) => S.id === i.id) ? b : [i, ...b];
2003
2004
  })() : [i], u = new Map(d.map((b) => [b.id, b])), f = ne(r, { kind: "frame_updated", frame: i, resizeForNewKind: t.resizeLayouts });
2004
2005
  let m = /* @__PURE__ */ new Set();
2005
- const p = Di.produce(e, (b) => {
2006
+ const p = ki.produce(e, (b) => {
2006
2007
  const S = b.sheets[n];
2007
- f.layouts !== r.layouts && (S.layouts = Bt(f.layouts)), f.customizedBreakpoints !== r.customizedBreakpoints && (S.customizedBreakpoints = f.customizedBreakpoints), t.sheetCalculatedFields !== void 0 && (S.calculatedFields = ss(t.sheetCalculatedFields)), S.frames = S.frames.map((k) => {
2008
+ f.layouts !== r.layouts && (S.layouts = Bt(f.layouts)), f.customizedBreakpoints !== r.customizedBreakpoints && (S.customizedBreakpoints = f.customizedBreakpoints), t.sheetCalculatedFields !== void 0 && (S.calculatedFields = cs(t.sheetCalculatedFields)), S.frames = S.frames.map((k) => {
2008
2009
  const q = u.get(k.id);
2009
2010
  return q ? Bt(c(q)) : k.calculatedFields === void 0 ? k : { ...k, calculatedFields: void 0 };
2010
2011
  });
2011
2012
  const $ = Vt(S);
2012
- m = new Set([...s].filter((k) => !$.has(k))), ki(b, m), t.dashboardCalculatedFields && (b.calculatedFields = t.dashboardCalculatedFields);
2013
+ m = new Set([...s].filter((k) => !$.has(k))), _i(b, m), t.dashboardCalculatedFields && (b.calculatedFields = t.dashboardCalculatedFields);
2013
2014
  }), y = p.sheets[n].frames.find((b) => b.id === i.id), h = [
2014
2015
  ...m.size ? [{ kind: "cards_removed", cardIds: [...m] }] : [],
2015
2016
  { kind: "frame_committed", sheetId: t.sheetId, before: a, after: y }
2016
- ], g = ((v = i.cards) == null ? void 0 : v.find((b) => b.id === i.activeCardId)) ?? ((C = i.cards) == null ? void 0 : C[0]);
2017
+ ], g = ((v = i.cards) == null ? void 0 : v.find((b) => b.id === i.activeCardId)) ?? ((I = i.cards) == null ? void 0 : I[0]);
2017
2018
  return { dashboard: p, runtimeEffects: h, clauses: [x.committed(g == null ? void 0 : g.title)] };
2018
2019
  }
2019
- function ls(e, t) {
2020
+ function ds(e, t) {
2020
2021
  const n = { ...e }, r = [];
2021
2022
  return t.title !== void 0 && t.title !== e.title && (n.title = t.title, r.push(x.plain("dashboard", `renames the dashboard to ${T(t.title)}`))), t.description === null && e.description ? (delete n.description, r.push(x.plain("dashboard", "removes the dashboard's description"))) : typeof t.description == "string" && t.description !== e.description && (n.description = t.description, r.push(x.plain("dashboard", "changes the dashboard's description"))), { dashboard: n, clauses: r.length ? r : [x.plain("dashboard", "changes nothing on the dashboard")] };
2022
2023
  }
2023
- function ds(e, t) {
2024
+ function us(e, t) {
2024
2025
  const n = { ...e };
2025
2026
  t.style ? n.dashboardStyle = t.style : delete n.dashboardStyle;
2026
2027
  const r = t.sentences.map((i) => x.plain("dashboard", `${i.charAt(0).toLowerCase()}${i.slice(1)}`));
2027
2028
  return { dashboard: n, clauses: r.length ? r : [x.plain("dashboard", "changes nothing in the dashboard's style")] };
2028
2029
  }
2029
- function us(e, t, n) {
2030
+ function fs(e, t, n) {
2030
2031
  const r = e.sheets ?? [], i = r.findIndex((s) => s.id === t), o = r[i];
2031
2032
  if (!o) throw new F("sheet_not_found", `No sheet ${t} on this dashboard.`);
2032
2033
  if (Me(o))
@@ -2034,7 +2035,7 @@ function us(e, t, n) {
2034
2035
  const a = n.map((s) => {
2035
2036
  const c = (o.frames ?? []).find((l) => l.cards.some((d) => d.id === s));
2036
2037
  if (!c)
2037
- throw new F("card_not_found", `No card ${s} on ${_i(o)}.`, "Read the outline again and use its card ids.");
2038
+ throw new F("card_not_found", `No card ${s} on ${Mi(o)}.`, "Read the outline again and use its card ids.");
2038
2039
  return c.cards.find((l) => l.id === s);
2039
2040
  });
2040
2041
  return { sheets: r, sheetIndex: i, sheet: o, cards: a };
@@ -2044,21 +2045,21 @@ function et(e) {
2044
2045
  const { visualId: t, ...n } = e;
2045
2046
  return n;
2046
2047
  }
2047
- const fr = (e) => e.cards.find((t) => t.id === e.activeCardId) ?? e.cards[0], Be = (e) => x.plain("detached", `makes ${e} local to this report; it no longer follows its library visual`);
2048
- function fs(e, t) {
2048
+ const mr = (e) => e.cards.find((t) => t.id === e.activeCardId) ?? e.cards[0], Be = (e) => x.plain("detached", `makes ${e} local to this report; it no longer follows its library visual`);
2049
+ function ms(e, t) {
2049
2050
  var p;
2050
- const { sheets: n, sheetIndex: r, sheet: i, cards: o } = us(e, t.sheetId, t.cardIds), a = Ie(i, t.cardIds[0]).id;
2051
+ const { sheets: n, sheetIndex: r, sheet: i, cards: o } = fs(e, t.sheetId, t.cardIds), a = Ie(i, t.cardIds[0]).id;
2051
2052
  let s = i;
2052
2053
  const c = [];
2053
2054
  for (const y of t.cardIds.slice(1)) {
2054
2055
  const h = Ie(s, y);
2055
2056
  if (h.id === a) continue;
2056
- const g = _n(h, y);
2057
+ const g = Mn(h, y);
2057
2058
  if (!g.cards.length) {
2058
2059
  h.visualId && c.push(Be(T(h.cards[0].title))), s = ne(s, { kind: "frame_removed", frameId: h.id });
2059
2060
  continue;
2060
2061
  }
2061
- h.visualId && c.push(Be(`the tile of ${T((p = fr(g)) == null ? void 0 : p.title)}`)), s = ne(s, { kind: "frame_updated", frame: h.visualId ? et(g) : g, resizeForNewKind: !0 });
2062
+ h.visualId && c.push(Be(`the tile of ${T((p = mr(g)) == null ? void 0 : p.title)}`)), s = ne(s, { kind: "frame_updated", frame: h.visualId ? et(g) : g, resizeForNewKind: !0 });
2062
2063
  }
2063
2064
  const l = Ie(s, t.cardIds[0]), d = new Set(t.cardIds), u = {
2064
2065
  ...l,
@@ -2073,7 +2074,7 @@ function fs(e, t) {
2073
2074
  detached: m.length > 0
2074
2075
  };
2075
2076
  }
2076
- function ms(e, t) {
2077
+ function ps(e, t) {
2077
2078
  var d;
2078
2079
  const n = e.sheets ?? [], r = n.findIndex((u) => !Me(u) && (u.frames ?? []).some((f) => f.cards.some((m) => m.id === t.cardId)));
2079
2080
  if (r < 0)
@@ -2083,7 +2084,7 @@ function ms(e, t) {
2083
2084
  const i = n[r], o = Ie(i, t.cardId), a = o.cards.find((u) => u.id === t.cardId);
2084
2085
  if (o.cards.length < 2)
2085
2086
  throw new F("frame_not_found", `${T(a.title)} already has its own spot.`);
2086
- const s = _n(o, t.cardId);
2087
+ const s = Mn(o, t.cardId);
2087
2088
  let c = ne(i, {
2088
2089
  kind: "frame_updated",
2089
2090
  frame: o.visualId ? et(s) : s,
@@ -2098,13 +2099,13 @@ function ms(e, t) {
2098
2099
  return {
2099
2100
  dashboard: { ...e, sheets: n.map((u, f) => f === r ? c : u) },
2100
2101
  clauses: [
2101
- x.plain("layout", `gives ${T(a.title)} its own spot beside ${T((d = fr(s)) == null ? void 0 : d.title)}`),
2102
+ x.plain("layout", `gives ${T(a.title)} its own spot beside ${T((d = mr(s)) == null ? void 0 : d.title)}`),
2102
2103
  ...l ? [x.plain("detached", "makes both spots local to this report; they no longer follow their library visual")] : []
2103
2104
  ],
2104
2105
  detached: l
2105
2106
  };
2106
2107
  }
2107
- function ps() {
2108
+ function hs() {
2108
2109
  return {
2109
2110
  version: 1,
2110
2111
  page: {
@@ -2119,13 +2120,13 @@ function ps() {
2119
2120
  }
2120
2121
  },
2121
2122
  runtime: {
2122
- generatedAtFormat: Mi
2123
+ generatedAtFormat: Oi
2123
2124
  },
2124
2125
  inputs: [],
2125
2126
  sections: []
2126
2127
  };
2127
2128
  }
2128
- function hs() {
2129
+ function gs() {
2129
2130
  return {
2130
2131
  region: "header",
2131
2132
  enabled: !0,
@@ -2134,7 +2135,7 @@ function hs() {
2134
2135
  blocks: []
2135
2136
  };
2136
2137
  }
2137
- function gs() {
2138
+ function ys() {
2138
2139
  return {
2139
2140
  region: "footer",
2140
2141
  enabled: !0,
@@ -2143,51 +2144,51 @@ function gs() {
2143
2144
  blocks: []
2144
2145
  };
2145
2146
  }
2146
- function mr(e) {
2147
+ function pr(e) {
2147
2148
  return [{ type: "text", value: e }];
2148
2149
  }
2149
- function od(e, t = []) {
2150
- return Oi(e, { by: "then" }).flatMap((n) => n.type === "link" ? n.children ?? [] : [n]).map((n) => n.type === "text" ? n.value : `{{${Ai(n.ref, $i({ kind: "document", inputs: t }))}}}`).join("") || "";
2150
+ function sd(e, t = []) {
2151
+ return Ai(e, { by: "then" }).flatMap((n) => n.type === "link" ? n.children ?? [] : [n]).map((n) => n.type === "text" ? n.value : `{{${$i(n.ref, Pi({ kind: "document", inputs: t }))}}}`).join("") || "";
2151
2152
  }
2152
- function ys(e, t) {
2153
+ function bs(e, t) {
2153
2154
  return e.find(
2154
2155
  (n) => n.type === "text" && n.role === t
2155
2156
  );
2156
2157
  }
2157
- function sd(e, t) {
2158
+ function cd(e, t) {
2158
2159
  return e.find(
2159
2160
  (n) => n.type === "image" && n.role === t
2160
2161
  );
2161
2162
  }
2162
- function dn(e, t) {
2163
+ function un(e, t) {
2163
2164
  const n = {
2164
2165
  ...t,
2165
2166
  type: "text",
2166
- content: typeof t.content == "string" ? mr(t.content) : t.content
2167
+ content: typeof t.content == "string" ? pr(t.content) : t.content
2167
2168
  };
2168
- return pr(e, n);
2169
+ return hr(e, n);
2169
2170
  }
2170
- function cd(e, t) {
2171
- return pr(e, t);
2171
+ function ld(e, t) {
2172
+ return hr(e, t);
2172
2173
  }
2173
- function pr(e, t) {
2174
+ function hr(e, t) {
2174
2175
  const n = e.findIndex((r) => r.id === t.id);
2175
2176
  return n === -1 ? [...e, t] : e.map(
2176
2177
  (r, i) => i === n ? t : r
2177
2178
  );
2178
2179
  }
2179
- function bs(e, t) {
2180
+ function vs(e, t) {
2180
2181
  const n = e.sheets ?? [], { id: r, title: i, kind: o } = t.sheet;
2181
2182
  if (n.some((s) => s.id === r))
2182
2183
  throw new F("sheet_id_taken", `A sheet with id ${r} is already on this dashboard.`);
2183
- const a = o === "document" ? { id: r, title: i, kind: o, document: ps() } : { id: r, title: i };
2184
+ const a = o === "document" ? { id: r, title: i, kind: o, document: hs() } : { id: r, title: i };
2184
2185
  return {
2185
2186
  dashboard: { ...e, sheets: [...n, a] },
2186
2187
  created: [{ kind: "sheet", id: r, title: i, ...t.changeIndex !== void 0 ? { changeIndex: t.changeIndex } : {} }],
2187
2188
  clauses: [x.plain("sheet", `adds the sheet ${T(i)}`)]
2188
2189
  };
2189
2190
  }
2190
- function vs(e, t) {
2191
+ function Is(e, t) {
2191
2192
  const n = e.sheets ?? [], r = n.findIndex((o) => o.id === t.sheetId);
2192
2193
  if (r < 0)
2193
2194
  throw new F("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`);
@@ -2197,21 +2198,21 @@ function vs(e, t) {
2197
2198
  clauses: [x.plain("sheet", `renames the sheet ${T(i.title)} to ${T(t.title)}`)]
2198
2199
  };
2199
2200
  }
2200
- function Is(e, t, n) {
2201
+ function Cs(e, t, n) {
2201
2202
  var o;
2202
2203
  if (!e || !t || t.customFilterPreferences) return;
2203
2204
  const r = t.defaultDateFilter;
2204
- return (t.dateSelectionMode === "day" ? Pi(r) : t.dateSelectionMode === "months" && Ni(r)) && ((o = ce(t, n)) == null ? void 0 : o.valueType) === "date" ? !0 : void 0;
2205
+ return (t.dateSelectionMode === "day" ? Ni(r) : t.dateSelectionMode === "months" && Ei(r)) && ((o = ce(t, n)) == null ? void 0 : o.valueType) === "date" ? !0 : void 0;
2205
2206
  }
2206
- function ld(e) {
2207
- const t = e.createId ?? Te, n = t(), r = Ri({
2207
+ function dd(e) {
2208
+ const t = e.createId ?? Te, n = t(), r = Ki({
2208
2209
  field: e.field,
2209
2210
  dataSource: e.dataSource,
2210
2211
  connectionId: e.connectionId,
2211
2212
  connectionType: e.connectionType,
2212
2213
  filterId: t()
2213
2214
  });
2214
- return Cs({
2215
+ return Fs({
2215
2216
  filter: e.label ? { ...r, title: e.label } : r,
2216
2217
  label: e.label || e.field.label || e.field.name,
2217
2218
  scope: e.scope,
@@ -2219,9 +2220,9 @@ function ld(e) {
2219
2220
  createId: () => n
2220
2221
  });
2221
2222
  }
2222
- function Cs(e) {
2223
- const t = e.createId ?? Te, n = e.label || e.filter.title || e.filter.column || e.filter.id, r = Mn(e.dashboard, { label: n }), i = {
2224
- ...On(e.filter),
2223
+ function Fs(e) {
2224
+ const t = e.createId ?? Te, n = e.label || e.filter.title || e.filter.column || e.filter.id, r = On(e.dashboard, { label: n }), i = {
2225
+ ...An(e.filter),
2225
2226
  variableName: r
2226
2227
  };
2227
2228
  return {
@@ -2232,12 +2233,12 @@ function Cs(e) {
2232
2233
  requiredAtExecution: !1,
2233
2234
  scope: e.scope,
2234
2235
  runtimeScope: "shared",
2235
- presentation: $n(i),
2236
+ presentation: Pn(i),
2236
2237
  filter: i,
2237
- exports: An(i)
2238
+ exports: $n(i)
2238
2239
  };
2239
2240
  }
2240
- function Fs(e, t, n, r = { calendar: null }) {
2241
+ function Ss(e, t, n, r = { calendar: null }) {
2241
2242
  var Mt, Ot, At, $t, Pt, Nt, Et, Rt;
2242
2243
  const o = Z(e).findFilterInput(t), a = (O, w) => ({
2243
2244
  ok: !1,
@@ -2271,39 +2272,39 @@ function Fs(e, t, n, r = { calendar: null }) {
2271
2272
  if (n.mapping.draft.inputId !== s.id)
2272
2273
  return a("The card mapping was prepared for another filter.");
2273
2274
  }
2274
- const l = n.definition ? On(n.definition) : c;
2275
- if (l.kind === "global-date" && n.scope && !Ss(n.scope))
2275
+ const l = n.definition ? An(n.definition) : c;
2276
+ if (l.kind === "global-date" && n.scope && !ws(n.scope))
2276
2277
  return a("The Global Date filter applies to regular tabs only.");
2277
- const d = (Ot = r.calendar) == null ? void 0 : Ot.tz, u = n.definition !== void 0, f = n.forceSelection !== void 0 || u ? Is(
2278
+ const d = (Ot = r.calendar) == null ? void 0 : Ot.tz, u = n.definition !== void 0, f = n.forceSelection !== void 0 || u ? Cs(
2278
2279
  n.forceSelection ?? s.forceSelection,
2279
2280
  l,
2280
2281
  d
2281
- ) : s.forceSelection ? !0 : void 0, m = n.variableName !== void 0 ? Mn(
2282
+ ) : s.forceSelection ? !0 : void 0, m = n.variableName !== void 0 ? On(
2282
2283
  e,
2283
2284
  { name: n.variableName },
2284
2285
  { exclude: { source: "input", inputId: s.id } }
2285
- ) : s.variableName, p = u && (c.title || c.column) !== (l.title || l.column), y = n.label ?? (p ? l.title || l.column || l.id : void 0), h = u && c.hide !== l.hide, g = u && c.toolbarWidth !== l.toolbarWidth, I = (O) => {
2286
+ ) : s.variableName, p = u && (c.title || c.column) !== (l.title || l.column), y = n.label ?? (p ? l.title || l.column || l.id : void 0), h = u && c.hide !== l.hide, g = u && c.toolbarWidth !== l.toolbarWidth, C = (O) => {
2286
2287
  var Kt, Lt;
2287
2288
  const w = { ...O };
2288
2289
  if (y !== void 0 && (w.label = y), n.variableName !== void 0 && (w.variableName = m), n.scope && (w.scope = n.scope), h || g) {
2289
- const Ee = $n(l);
2290
+ const Ee = Pn(l);
2290
2291
  w.presentation = { ...O.presentation }, h && (w.presentation.placement = Ee.placement), g && (Ee.widthPx === void 0 ? delete w.presentation.widthPx : w.presentation.widthPx = Ee.widthPx);
2291
2292
  }
2292
2293
  return (n.forceSelection !== void 0 || u) && (f ? w.forceSelection = f : delete w.forceSelection), n.requiredAtExecution !== void 0 && (n.requiredAtExecution ? w.requiredAtExecution = !0 : delete w.requiredAtExecution), qe(w, "optionSource", n.optionSource), qe(w, "optionDependencies", n.optionDependencies), qe(w, "optionPopulation", n.optionPopulation), ((Kt = n.mapping) == null ? void 0 : Kt.kind) === "save" && n.mapping.draft.acceptance.ok ? w.application = n.mapping.draft.acceptance.application : ((Lt = n.mapping) == null ? void 0 : Lt.kind) === "remove" && delete w.application, w;
2293
- }, v = n.label !== void 0 && n.label !== s.label && n.label !== l.title ? n.label : void 0, C = u || n.variableName !== void 0 || v !== void 0, b = (O) => ({
2294
+ }, v = n.label !== void 0 && n.label !== s.label && n.label !== l.title ? n.label : void 0, I = u || n.variableName !== void 0 || v !== void 0, b = (O) => ({
2294
2295
  ...O,
2295
2296
  ...n.variableName !== void 0 ? { variableName: m } : {},
2296
2297
  ...v !== void 0 ? { title: v } : {}
2297
2298
  }), S = Array.isArray(e.inputs) ? [...e.inputs] : [], $ = S.findIndex((O) => O.id === s.id), k = S[$];
2298
2299
  if ($ < 0 || (k == null ? void 0 : k.kind) !== "filter" || !k.filter)
2299
2300
  return a("This filter can not be edited here.");
2300
- const q = I(
2301
- C ? {
2301
+ const q = C(
2302
+ I ? {
2302
2303
  ...k,
2303
2304
  filter: b(l)
2304
2305
  } : k
2305
2306
  );
2306
- u && (q.exports = An(l)), S[$] = q;
2307
+ u && (q.exports = $n(l)), S[$] = q;
2307
2308
  const G = ht({
2308
2309
  inputs: [q],
2309
2310
  dashboardFilters: []
@@ -2319,7 +2320,7 @@ function Fs(e, t, n, r = { calendar: null }) {
2319
2320
  return a(
2320
2321
  (($t = ae.issues[0]) == null ? void 0 : $t.message) ?? "These settings could not be saved."
2321
2322
  );
2322
- const U = n.variableName !== void 0 || n.scope !== void 0 ? ws(E, _.input) : void 0;
2323
+ const U = n.variableName !== void 0 || n.scope !== void 0 ? xs(E, _.input) : void 0;
2323
2324
  if (U)
2324
2325
  return a(
2325
2326
  `Another filter on the same cards is already named "${U}". Choose another name.`
@@ -2332,7 +2333,7 @@ function Fs(e, t, n, r = { calendar: null }) {
2332
2333
  defaultInputValues: E.defaultInputValues,
2333
2334
  dashboardInputValues: {}
2334
2335
  };
2335
- const ge = ((Pt = n.values) == null ? void 0 : Pt.target) ?? {}, P = Ds(
2336
+ const ge = ((Pt = n.values) == null ? void 0 : Pt.target) ?? {}, P = ks(
2336
2337
  c,
2337
2338
  l,
2338
2339
  {
@@ -2347,7 +2348,7 @@ function Fs(e, t, n, r = { calendar: null }) {
2347
2348
  r.calendar ?? void 0
2348
2349
  );
2349
2350
  if (P.defaultValueChanged || P.selectionIdentityChanged || P.defaultComparisonChanged) {
2350
- const O = hr({
2351
+ const O = gr({
2351
2352
  state: { ...K, dashboardInputValues: {} },
2352
2353
  input: H,
2353
2354
  settings: P
@@ -2368,7 +2369,7 @@ function Fs(e, t, n, r = { calendar: null }) {
2368
2369
  });
2369
2370
  }
2370
2371
  if (n.scope && _.input.runtimeScope !== "shared") {
2371
- const O = xs(
2372
+ const O = Ts(
2372
2373
  E,
2373
2374
  s,
2374
2375
  _.input,
@@ -2385,14 +2386,14 @@ function Fs(e, t, n, r = { calendar: null }) {
2385
2386
  }))
2386
2387
  );
2387
2388
  }
2388
- return E = Ts(E, K), {
2389
+ return E = Ds(E, K), {
2389
2390
  ok: !0,
2390
2391
  dashboard: E,
2391
2392
  inputId: _.input.id,
2392
2393
  valueEffects: z
2393
2394
  };
2394
2395
  }
2395
- function dd(e) {
2396
+ function ud(e) {
2396
2397
  let t = qt({
2397
2398
  dashboard: e.before,
2398
2399
  runtimeValues: e.dashboardInputValues,
@@ -2409,7 +2410,7 @@ function dd(e) {
2409
2410
  case "setDefaultComparison": {
2410
2411
  const o = r(i.inputId);
2411
2412
  if (!o) break;
2412
- t = hr({
2413
+ t = gr({
2413
2414
  state: { dashboardInputValues: t },
2414
2415
  input: o,
2415
2416
  settings: {
@@ -2439,14 +2440,14 @@ function dd(e) {
2439
2440
  calendar: e.calendar
2440
2441
  });
2441
2442
  }
2442
- function Ss(e) {
2443
+ function ws(e) {
2443
2444
  var t;
2444
2445
  return e.kind !== "documentSections" && (e.kind !== "allSheets" || ((t = e.sheetKinds) == null ? void 0 : t.length) === 1 && e.sheetKinds[0] === "dashboard");
2445
2446
  }
2446
2447
  function qe(e, t, n) {
2447
2448
  n !== void 0 && (n === null ? delete e[t] : e[t] = n);
2448
2449
  }
2449
- function ws(e, t) {
2450
+ function xs(e, t) {
2450
2451
  const n = [
2451
2452
  ...Z(e).inputs.map((i) => i.input),
2452
2453
  ...(Array.isArray(e.inputs) ? e.inputs : []).filter(
@@ -2456,28 +2457,28 @@ function ws(e, t) {
2456
2457
  (i) => i.id !== t.id && i.variableName === t.variableName
2457
2458
  );
2458
2459
  if (!n.length) return;
2459
- const r = Jt(e, t);
2460
+ const r = Zt(e, t);
2460
2461
  return n.some(
2461
- (i) => [...Jt(e, i)].some(
2462
+ (i) => [...Zt(e, i)].some(
2462
2463
  (o) => r.has(o)
2463
2464
  )
2464
2465
  ) ? t.variableName : void 0;
2465
2466
  }
2466
- function xs(e, t, n, r) {
2467
+ function Ts(e, t, n, r) {
2467
2468
  var d, u;
2468
- const i = [], o = qn(e), a = (f) => un(t, f, o), s = (f) => un(n, f, o), c = [];
2469
+ const i = [], o = Un(e), a = (f) => fn(t, f, o), s = (f) => fn(n, f, o), c = [];
2469
2470
  if (n.runtimeScope === "perSheet")
2470
2471
  for (const f of o.values())
2471
2472
  c.push({ sheetId: f.sheetId, sheetKind: f.sheetKind });
2472
2473
  else if (n.runtimeScope === "perCard") {
2473
- for (const f of Un(e))
2474
+ for (const f of zn(e))
2474
2475
  c.push({
2475
2476
  sheetId: f.sheetId,
2476
2477
  cardId: f.cardId,
2477
2478
  sheetKind: (d = o.get(f.sheetId)) == null ? void 0 : d.sheetKind
2478
2479
  });
2479
2480
  for (const f of e.variables ?? [])
2480
- c.push(...Va(e, f.id));
2481
+ c.push(...Ba(e, f.id));
2481
2482
  } else if (n.runtimeScope === "perDocumentSection")
2482
2483
  for (const f of e.sheets ?? [])
2483
2484
  for (const m of ((u = f.document) == null ? void 0 : u.sections) ?? [])
@@ -2497,19 +2498,19 @@ function xs(e, t, n, r) {
2497
2498
  }
2498
2499
  return { defaultInputValues: l, dropped: i };
2499
2500
  }
2500
- function un(e, t, n) {
2501
+ function fn(e, t, n) {
2501
2502
  if (e.runtimeScope === "perSheet" && t.sheetId && !t.cardId && !t.sectionId) {
2502
2503
  const r = n.get(t.sheetId);
2503
- return r ? zn(e, r) : !1;
2504
+ return r ? jn(e, r) : !1;
2504
2505
  }
2505
- return Ba(e, t);
2506
+ return qa(e, t);
2506
2507
  }
2507
- function Ts(e, t) {
2508
+ function Ds(e, t) {
2508
2509
  const n = { ...e };
2509
2510
  return t.defaultInputValues && Object.keys(t.defaultInputValues).length ? n.defaultInputValues = t.defaultInputValues : e.defaultInputValues !== void 0 && delete n.defaultInputValues, n;
2510
2511
  }
2511
- function Ds(e, t, n, r, i) {
2512
- const o = !!(n != null && n.defaultValueChanged || n != null && n.selectionIdentityChanged) || Ei(e, t);
2512
+ function ks(e, t, n, r, i) {
2513
+ const o = !!(n != null && n.defaultValueChanged || n != null && n.selectionIdentityChanged) || Ri(e, t);
2513
2514
  return {
2514
2515
  ...n,
2515
2516
  target: (n == null ? void 0 : n.target) ?? r,
@@ -2517,7 +2518,7 @@ function Ds(e, t, n, r, i) {
2517
2518
  defaultFilterValue: o ? ce(t, i) : void 0
2518
2519
  };
2519
2520
  }
2520
- function hr(e) {
2521
+ function gr(e) {
2521
2522
  const { settings: t } = e;
2522
2523
  if (!t) return e.state;
2523
2524
  const n = e.input;
@@ -2591,46 +2592,46 @@ function Ne(e, t) {
2591
2592
  throw new F("filter_not_found", `No filter ${t} on this dashboard.`, "Read the outline again and use its filter ids.");
2592
2593
  return n;
2593
2594
  }
2594
- function gr(e, t) {
2595
- const n = jn(e, t);
2595
+ function yr(e, t) {
2596
+ const n = Wn(e, t);
2596
2597
  return (n == null ? void 0 : n.kind) === "variable" ? `the variable ${n.variable.name}` : T(n == null ? void 0 : n.card.title);
2597
2598
  }
2598
- function yr(e, t) {
2599
- if (!jn(e, t))
2599
+ function br(e, t) {
2600
+ if (!Wn(e, t))
2600
2601
  throw new F("card_not_found", `No card or variable ${t} on this dashboard.`, "Read the outline again and use its card ids and variable names.");
2601
2602
  }
2602
- function ks(e, t, n) {
2603
+ function _s(e, t, n) {
2603
2604
  const r = Z(e), i = r.findFilterInput({ inputId: t });
2604
2605
  return i ? r.reachedCards({ inputId: t }).filter(
2605
2606
  (o) => ["bound", "automatic", "sql", "relationshipApplied"].includes(
2606
- Pn(i.input, o.card, n).reach
2607
+ Nn(i.input, o.card, n).reach
2607
2608
  )
2608
2609
  ).length : 0;
2609
2610
  }
2610
- function _s(e, t, n) {
2611
- return br(e, t, "relationship", n);
2611
+ function Ms(e, t, n) {
2612
+ return vr(e, t, "relationship", n);
2612
2613
  }
2613
- function Ms(e, t) {
2614
- return br(e, t, "sqlTemplate");
2614
+ function Os(e, t) {
2615
+ return vr(e, t, "sqlTemplate");
2615
2616
  }
2616
- function br(e, t, n, r) {
2617
+ function vr(e, t, n, r) {
2617
2618
  const i = Z(e), o = i.findFilterInput({ inputId: t });
2618
- return o ? i.reachedCards({ inputId: t }).filter((a) => Pn(o.input, a.card, r).reach === n).length : 0;
2619
+ return o ? i.reachedCards({ inputId: t }).filter((a) => Nn(o.input, a.card, r).reach === n).length : 0;
2619
2620
  }
2620
- function vr(e, t) {
2621
+ function Ir(e, t) {
2621
2622
  if (t.scope.kind === "allSheets") return "every sheet";
2622
2623
  if (t.scope.kind !== "sheets") return "its cards";
2623
- const n = [...qn(e).values()].filter((r) => zn(t, r));
2624
+ const n = [...Un(e).values()].filter((r) => jn(t, r));
2624
2625
  return Oe(n.map((r) => {
2625
2626
  var i, o;
2626
2627
  return ((o = (i = e.sheets) == null ? void 0 : i.find((a) => a.id === r.sheetId)) == null ? void 0 : o.title) ?? r.sheetId;
2627
2628
  }));
2628
2629
  }
2629
- const Ir = (e) => {
2630
+ const Cr = (e) => {
2630
2631
  var t;
2631
2632
  return ((t = e.filter) == null ? void 0 : t.type) === "single" ? "single select" : "multi select";
2632
2633
  };
2633
- function Cr(e) {
2634
+ function Fr(e) {
2634
2635
  var t, n, r;
2635
2636
  if ((n = (t = e.filter) == null ? void 0 : t.defaultValues) != null && n.length) return `default ${e.filter.defaultValues.join(", ")}`;
2636
2637
  if ((r = e.filter) != null && r.defaultDateFilter) return "a default period";
@@ -2638,16 +2639,16 @@ function Cr(e) {
2638
2639
  function he(e) {
2639
2640
  return x.plain("filter", e);
2640
2641
  }
2641
- function Os(e, t, n) {
2642
+ function As(e, t, n) {
2642
2643
  const { input: r } = t, i = re(e);
2643
2644
  if (i.some((f) => f.id === r.id))
2644
2645
  throw new F("filter_id_taken", `A filter with id ${r.id} is already on this dashboard.`);
2645
2646
  if (Z(e).findFilterInput({ filterId: r.filter.id }))
2646
2647
  throw new F("filter_id_taken", `A filter definition with id ${r.filter.id} is already on this dashboard.`);
2647
- const o = { ...e, inputs: [...i, r] }, a = n.relationshipReach ? { relationshipReach: n.relationshipReach } : void 0, s = ks(o, r.id, a), c = _s(o, r.id, a), l = Ms(o, r.id), d = Oe([
2648
+ const o = { ...e, inputs: [...i, r] }, a = n.relationshipReach ? { relationshipReach: n.relationshipReach } : void 0, s = _s(o, r.id, a), c = Ms(o, r.id, a), l = Os(o, r.id), d = Oe([
2648
2649
  ...c ? [`may filter ${c} more through the domain's relationships`] : [],
2649
2650
  ...l ? [`may filter ${l} more through ${l === 1 ? "its" : "their"} SQL`] : []
2650
- ]), u = [Ir(r), Cr(r)].filter(Boolean).join(", ");
2651
+ ]), u = [Cr(r), Fr(r)].filter(Boolean).join(", ");
2651
2652
  return {
2652
2653
  dashboard: o,
2653
2654
  created: [
@@ -2660,13 +2661,13 @@ function Os(e, t, n) {
2660
2661
  ],
2661
2662
  clauses: [
2662
2663
  he(
2663
- `adds the filter ${T(r.label)} (${u}) to ${vr(o, r)}; it filters ${s} card${s === 1 ? "" : "s"}${d ? ` and ${d}` : ""}`
2664
+ `adds the filter ${T(r.label)} (${u}) to ${Ir(o, r)}; it filters ${s} card${s === 1 ? "" : "s"}${d ? ` and ${d}` : ""}`
2664
2665
  )
2665
2666
  ]
2666
2667
  };
2667
2668
  }
2668
- function As(e, t, n) {
2669
- const r = Fs(e, { inputId: t.filterId }, t.settings, {
2669
+ function $s(e, t, n) {
2670
+ const r = Ss(e, { inputId: t.filterId }, t.settings, {
2670
2671
  calendar: n.calendar
2671
2672
  });
2672
2673
  if (!r.ok) {
@@ -2682,35 +2683,35 @@ function As(e, t, n) {
2682
2683
  return {
2683
2684
  dashboard: r.dashboard,
2684
2685
  runtimeEffects: [{ kind: "filter_value", effects: r.valueEffects }],
2685
- clauses: [he(`changes the filter ${T((i == null ? void 0 : i.label) ?? o.label)}: ${$s(r.dashboard, i, o)}`)]
2686
+ clauses: [he(`changes the filter ${T((i == null ? void 0 : i.label) ?? o.label)}: ${Ps(r.dashboard, i, o)}`)]
2686
2687
  };
2687
2688
  }
2688
- function $s(e, t, n) {
2689
+ function Ps(e, t, n) {
2689
2690
  var o, a, s, c, l, d;
2690
2691
  if (!t) return "updates its settings";
2691
2692
  const r = [];
2692
- if (t.label !== n.label && r.push(`renames it ${T(n.label)}`), (((o = t.filter) == null ? void 0 : o.type) ?? "multiple") !== (((a = n.filter) == null ? void 0 : a.type) ?? "multiple") && r.push(`makes it ${Ir(n)}`), JSON.stringify(((s = t.filter) == null ? void 0 : s.defaultValues) ?? null) !== JSON.stringify(((c = n.filter) == null ? void 0 : c.defaultValues) ?? null) || !pa((l = t.filter) == null ? void 0 : l.defaultDateFilter, (d = n.filter) == null ? void 0 : d.defaultDateFilter)) {
2693
- const u = Cr(n);
2693
+ if (t.label !== n.label && r.push(`renames it ${T(n.label)}`), (((o = t.filter) == null ? void 0 : o.type) ?? "multiple") !== (((a = n.filter) == null ? void 0 : a.type) ?? "multiple") && r.push(`makes it ${Cr(n)}`), JSON.stringify(((s = t.filter) == null ? void 0 : s.defaultValues) ?? null) !== JSON.stringify(((c = n.filter) == null ? void 0 : c.defaultValues) ?? null) || !ha((l = t.filter) == null ? void 0 : l.defaultDateFilter, (d = n.filter) == null ? void 0 : d.defaultDateFilter)) {
2694
+ const u = Fr(n);
2694
2695
  r.push(u ? `sets its ${u.replace(/^default /, "default to ").replace(/^a default period$/, "default period")}` : "removes its default");
2695
2696
  }
2696
- return JSON.stringify(t.scope) !== JSON.stringify(n.scope) && r.push(`applies it to ${vr(e, n)}`), r.length ? Oe(r) : "keeps its settings";
2697
+ return JSON.stringify(t.scope) !== JSON.stringify(n.scope) && r.push(`applies it to ${Ir(e, n)}`), r.length ? Oe(r) : "keeps its settings";
2697
2698
  }
2698
- function Ps(e, t) {
2699
+ function Ns(e, t) {
2699
2700
  const n = Ne(e, t);
2700
2701
  return {
2701
2702
  dashboard: {
2702
2703
  ...e,
2703
2704
  inputs: re(e).filter((i) => i.id !== t),
2704
- defaultInputValues: Ki(e.defaultInputValues, t)
2705
+ defaultInputValues: Li(e.defaultInputValues, t)
2705
2706
  },
2706
2707
  runtimeEffects: [{ kind: "input_removed", inputId: t }],
2707
2708
  clauses: [he(`removes the filter ${T(n.label)}`)]
2708
2709
  };
2709
2710
  }
2710
- function Ns(e, t, n) {
2711
+ function Es(e, t, n) {
2711
2712
  var a;
2712
- yr(e, n);
2713
- const r = Ua(t.scope, n);
2713
+ br(e, n);
2714
+ const r = za(t.scope, n);
2714
2715
  if (!r)
2715
2716
  throw new F(
2716
2717
  "filter_invalid",
@@ -2725,10 +2726,10 @@ function Ns(e, t, n) {
2725
2726
  inputs: re(e).map((s) => s.id === t.id ? i : s)
2726
2727
  };
2727
2728
  }
2728
- function Fr(e, t, n, r, i) {
2729
+ function Sr(e, t, n, r, i) {
2729
2730
  var d, u;
2730
2731
  const o = Ne(e, t);
2731
- yr(e, n);
2732
+ br(e, n);
2732
2733
  const a = [...((d = o.application) == null ? void 0 : d.cards) ?? []], s = a.findIndex((f) => f.cardId === n);
2733
2734
  s >= 0 ? a[s] = r : a.push(r);
2734
2735
  const c = {
@@ -2747,7 +2748,7 @@ function Fr(e, t, n, r, i) {
2747
2748
  inputs: re(e).map((f) => f.id === t ? c : f)
2748
2749
  };
2749
2750
  }
2750
- function Es(e) {
2751
+ function Rs(e) {
2751
2752
  switch (e.kind) {
2752
2753
  case "field":
2753
2754
  return `by ${e.field.name}`;
@@ -2757,23 +2758,23 @@ function Es(e) {
2757
2758
  return String(e.kind);
2758
2759
  }
2759
2760
  }
2760
- function Rs(e, t) {
2761
- const n = Ne(e, t.filterId), r = { ...t.binding, kind: "bound", cardId: t.cardId }, i = qa(n.scope, t.cardId), o = i !== n.scope;
2761
+ function Ks(e, t) {
2762
+ const n = Ne(e, t.filterId), r = { ...t.binding, kind: "bound", cardId: t.cardId }, i = Ua(n.scope, t.cardId), o = i !== n.scope;
2762
2763
  return {
2763
- dashboard: Fr(e, t.filterId, t.cardId, r, o ? i : void 0),
2764
+ dashboard: Sr(e, t.filterId, t.cardId, r, o ? i : void 0),
2764
2765
  clauses: [
2765
2766
  he(
2766
- `makes ${T(n.label)} filter ${gr(e, t.cardId)} ${Es(r.target)}${o ? ", which it used to leave out" : ""}`
2767
+ `makes ${T(n.label)} filter ${yr(e, t.cardId)} ${Rs(r.target)}${o ? ", which it used to leave out" : ""}`
2767
2768
  )
2768
2769
  ]
2769
2770
  };
2770
2771
  }
2771
- function Ks(e, t) {
2772
+ function Ls(e, t) {
2772
2773
  var i;
2773
2774
  const n = Ne(e, t.filterId);
2774
2775
  return {
2775
- dashboard: ((i = n.filter) == null ? void 0 : i.kind) === "global-date" ? Ns(e, n, t.cardId) : Fr(e, t.filterId, t.cardId, { kind: "excluded", cardId: t.cardId }),
2776
- clauses: [he(`stops ${T(n.label)} from filtering ${gr(e, t.cardId)}`)]
2776
+ dashboard: ((i = n.filter) == null ? void 0 : i.kind) === "global-date" ? Es(e, n, t.cardId) : Sr(e, t.filterId, t.cardId, { kind: "excluded", cardId: t.cardId }),
2777
+ clauses: [he(`stops ${T(n.label)} from filtering ${yr(e, t.cardId)}`)]
2777
2778
  };
2778
2779
  }
2779
2780
  function Tt(e, t) {
@@ -2791,12 +2792,12 @@ function tt(e, t) {
2791
2792
  throw new F("variable_not_found", `No variable ${t} on this dashboard.`, "Read the outline again and use its variable names.");
2792
2793
  return n;
2793
2794
  }
2794
- function Sr(e) {
2795
+ function wr(e) {
2795
2796
  var r;
2796
- const t = es(e), n = t.charAt(0).toLowerCase() + t.slice(1);
2797
+ const t = ts(e), n = t.charAt(0).toLowerCase() + t.slice(1);
2797
2798
  return e.get.kind === "only" && !((r = e.query.sql) != null && r.trim()) ? `${n}. When more than one matches it shows nothing` : n;
2798
2799
  }
2799
- function Ls(e, t) {
2800
+ function Vs(e, t) {
2800
2801
  const n = gt(e, { kind: "add", variable: t.variable });
2801
2802
  n.ok || Tt(n.issues, "This variable could not be added.");
2802
2803
  const { variable: r } = t;
@@ -2804,22 +2805,22 @@ function Ls(e, t) {
2804
2805
  dashboard: n.dashboard,
2805
2806
  created: [{ kind: "variable", id: r.id, title: r.name, ...t.changeIndex !== void 0 ? { changeIndex: t.changeIndex } : {} }],
2806
2807
  queryFrames: n.queryFrames,
2807
- clauses: [x.plain("variable", `adds the variable ${r.name}: ${Sr(r)}`)]
2808
+ clauses: [x.plain("variable", `adds the variable ${r.name}: ${wr(r)}`)]
2808
2809
  };
2809
2810
  }
2810
- function Vs(e, t) {
2811
+ function Bs(e, t) {
2811
2812
  const n = tt(e, t.variableId), r = Object.fromEntries(Object.entries(t.patch).map(([m, p]) => [m, p === null ? void 0 : p])), i = gt(e, { kind: "update", id: t.variableId, patch: r });
2812
2813
  i.ok || Tt(i.issues, "This variable could not be changed.");
2813
2814
  const o = tt(i.dashboard, t.variableId), a = [];
2814
2815
  t.patch.name !== void 0 && t.patch.name !== n.name && a.push(x.plain("variable", `renames the variable ${n.name} to ${o.name}`));
2815
2816
  const { name: s, label: c, ...l } = n, { name: d, label: u, ...f } = o;
2816
- return JSON.stringify(l) !== JSON.stringify(f) ? a.push(x.plain("variable", `changes the variable ${o.name}: ${Sr(o)}`)) : n.label !== o.label && a.push(x.plain("variable", `labels the variable ${o.name} ${T(o.label ?? o.name)}`)), {
2817
+ return JSON.stringify(l) !== JSON.stringify(f) ? a.push(x.plain("variable", `changes the variable ${o.name}: ${wr(o)}`)) : n.label !== o.label && a.push(x.plain("variable", `labels the variable ${o.name} ${T(o.label ?? o.name)}`)), {
2817
2818
  dashboard: i.dashboard,
2818
2819
  queryFrames: i.queryFrames,
2819
2820
  clauses: a.length ? a : [x.plain("variable", `changes nothing on the variable ${o.name}`)]
2820
2821
  };
2821
2822
  }
2822
- function Bs(e, t) {
2823
+ function qs(e, t) {
2823
2824
  const n = tt(e, t.variableId), r = gt(e, { kind: "remove", id: t.variableId, confirmed: !1 });
2824
2825
  r.ok || Tt(r.issues, "This variable could not be removed.");
2825
2826
  const i = r.removedMappings ? ` and its ${r.removedMappings === 1 ? "filter mapping" : `${r.removedMappings} filter mappings`}` : "";
@@ -2828,33 +2829,33 @@ function Bs(e, t) {
2828
2829
  clauses: [x.plain("variable", `removes the variable ${n.name}${i}`)]
2829
2830
  };
2830
2831
  }
2831
- function wr(e) {
2832
- return e.cards.length < za;
2832
+ function xr(e) {
2833
+ return e.cards.length < ja;
2833
2834
  }
2834
- function qs(e) {
2835
- return e.kpi.layout === "tiles" && e.cards.length + 1 > Wn;
2835
+ function Us(e) {
2836
+ return e.kpi.layout === "tiles" && e.cards.length + 1 > Gn;
2836
2837
  }
2837
- function Us(e, t) {
2838
- return !wr(e) || t.type !== "kpi" || e.cards.some(({ id: n }) => n === t.id) ? e : {
2838
+ function zs(e, t) {
2839
+ return !xr(e) || t.type !== "kpi" || e.cards.some(({ id: n }) => n === t.id) ? e : {
2839
2840
  ...e,
2840
2841
  cards: [...e.cards, t],
2841
- kpi: qs(e) ? { ...e.kpi, layout: "lines" } : e.kpi
2842
+ kpi: Us(e) ? { ...e.kpi, layout: "lines" } : e.kpi
2842
2843
  };
2843
2844
  }
2844
- function zs(e, t) {
2845
+ function js(e, t) {
2845
2846
  if (e.cards.length <= 1) return e;
2846
2847
  const n = e.cards.filter(({ id: r }) => r !== t);
2847
2848
  return n.length === e.cards.length ? e : { ...e, cards: n };
2848
2849
  }
2849
- function xr(e) {
2850
- return e.cards.length <= Wn;
2850
+ function Tr(e) {
2851
+ return e.cards.length <= Gn;
2851
2852
  }
2852
- function js(e, t) {
2853
+ function Ws(e, t) {
2853
2854
  const n = { ...e.kpi, ...t };
2854
- return n.layout === "tiles" && !xr(e) ? e : { ...e, kpi: n };
2855
+ return n.layout === "tiles" && !Tr(e) ? e : { ...e, kpi: n };
2855
2856
  }
2856
- const Ws = ["table"], Gs = ["matrixTable"];
2857
- function fn(e, t, n) {
2857
+ const Gs = ["table"], Hs = ["matrixTable"];
2858
+ function mn(e, t, n) {
2858
2859
  return {
2859
2860
  id: e.section(),
2860
2861
  type: "table",
@@ -2885,7 +2886,7 @@ function fn(e, t, n) {
2885
2886
  }
2886
2887
  };
2887
2888
  }
2888
- function Tr(e) {
2889
+ function Dr(e) {
2889
2890
  return { id: e, title: "KPI", type: "kpi" };
2890
2891
  }
2891
2892
  const B = {
@@ -2899,7 +2900,7 @@ const B = {
2899
2900
  create: (e) => ({
2900
2901
  id: e.section(),
2901
2902
  type: "text",
2902
- content: mr("New text section")
2903
+ content: pr("New text section")
2903
2904
  })
2904
2905
  },
2905
2906
  table: {
@@ -2908,8 +2909,8 @@ const B = {
2908
2909
  description: "Rows and columns from one dataset.",
2909
2910
  group: "data",
2910
2911
  addable: !0,
2911
- cardTypes: Ws,
2912
- create: (e) => fn(e, "table", "Table")
2912
+ cardTypes: Gs,
2913
+ create: (e) => mn(e, "table", "Table")
2913
2914
  },
2914
2915
  matrix: {
2915
2916
  id: "matrix",
@@ -2917,8 +2918,8 @@ const B = {
2917
2918
  description: "Grouped rows with subtotals, and optional column levels.",
2918
2919
  group: "data",
2919
2920
  addable: !0,
2920
- cardTypes: Gs,
2921
- create: (e) => fn(e, "matrixTable", "Matrix")
2921
+ cardTypes: Hs,
2922
+ create: (e) => mn(e, "matrixTable", "Matrix")
2922
2923
  },
2923
2924
  kpi: {
2924
2925
  id: "kpi",
@@ -2930,7 +2931,7 @@ const B = {
2930
2931
  create: (e) => ({
2931
2932
  id: e.section(),
2932
2933
  type: "kpi",
2933
- cards: [Tr(e.card())],
2934
+ cards: [Dr(e.card())],
2934
2935
  kpi: { layout: "tiles" }
2935
2936
  })
2936
2937
  },
@@ -2967,7 +2968,7 @@ const B = {
2967
2968
  create: (e) => ({ id: e.section(), type: "page_break" })
2968
2969
  }
2969
2970
  };
2970
- function Dr(e) {
2971
+ function kr(e) {
2971
2972
  var t;
2972
2973
  switch (e.type) {
2973
2974
  case "table":
@@ -2984,42 +2985,42 @@ function Dr(e) {
2984
2985
  return B.page_break;
2985
2986
  }
2986
2987
  }
2987
- function Hs(e, t) {
2988
- return Dr(e).cardTypes.includes(t);
2988
+ function Ys(e, t) {
2989
+ return kr(e).cardTypes.includes(t);
2989
2990
  }
2990
- function kr(e, t) {
2991
- if (Hs(e, t)) return null;
2992
- const n = Dr(e);
2991
+ function _r(e, t) {
2992
+ if (Ys(e, t)) return null;
2993
+ const n = kr(e);
2993
2994
  return n.id === "table" ? "Table sections hold Table cards only" : n.id === "kpi" ? "KPI sections hold KPI cards only" : n.id === "matrix" ? "Matrix sections hold Matrix cards only" : `${n.label} sections do not accept this visual`;
2994
2995
  }
2995
- function Ys(e, t, n) {
2996
+ function Qs(e, t, n) {
2996
2997
  if (!bt(e).some(({ id: i }) => i === t))
2997
2998
  throw new Error(
2998
2999
  `Document section '${e.id}' has no card '${t}'.`
2999
3000
  );
3000
- const r = kr(e, n.type);
3001
+ const r = _r(e, n.type);
3001
3002
  if (r)
3002
3003
  throw new Error(r);
3003
- return Gn(
3004
+ return Hn(
3004
3005
  e,
3005
3006
  (i) => i.id === t ? n : i
3006
3007
  );
3007
3008
  }
3008
- const Qs = [
3009
+ const Xs = [
3009
3010
  { id: "data", label: "Data" },
3010
3011
  { id: "content", label: "Content" },
3011
3012
  { id: "layout", label: "Layout" }
3012
3013
  ];
3013
- function ud() {
3014
+ function fd() {
3014
3015
  const e = Object.values(B).filter(
3015
3016
  (t) => t.addable
3016
3017
  );
3017
- return Qs.map((t) => ({
3018
+ return Xs.map((t) => ({
3018
3019
  ...t,
3019
3020
  kinds: e.filter((n) => n.group === t.id)
3020
3021
  })).filter((t) => t.kinds.length > 0);
3021
3022
  }
3022
- const Xs = {
3023
+ const Js = {
3023
3024
  header: ["title", "metadata"],
3024
3025
  footer: ["note", "pageInfo"]
3025
3026
  };
@@ -3028,27 +3029,27 @@ class D extends Error {
3028
3029
  super(t), this.name = "DocumentEditError";
3029
3030
  }
3030
3031
  }
3031
- const mn = 8, Js = 240;
3032
- function fd() {
3032
+ const pn = 8, Zs = 240;
3033
+ function md() {
3033
3034
  return {
3034
3035
  section: () => `doc_section_${Te()}`,
3035
3036
  card: () => `doc_card_${Te()}`
3036
3037
  };
3037
3038
  }
3038
- function Zs(e) {
3039
+ function ec(e) {
3039
3040
  return Number.isFinite(e) ? Math.min(
3040
- Js,
3041
- Math.max(mn, Math.round(e))
3042
- ) : mn;
3041
+ Zs,
3042
+ Math.max(pn, Math.round(e))
3043
+ ) : pn;
3043
3044
  }
3044
- function md(e, t, n, r) {
3045
+ function pd(e, t, n, r) {
3045
3046
  const i = e.findIndex(({ id: s }) => s === t), o = e.findIndex(({ id: s }) => s === n);
3046
3047
  if (i === -1 || o === -1) return i;
3047
3048
  const a = r === "after" ? o + 1 : o;
3048
3049
  return i < a ? a - 1 : a;
3049
3050
  }
3050
- const ec = /* @__PURE__ */ new Set(["table", "matrixTable", "kpi"]);
3051
- function tc(e, t = {}) {
3051
+ const tc = /* @__PURE__ */ new Set(["table", "matrixTable", "kpi"]);
3052
+ function nc(e, t = {}) {
3052
3053
  const n = new Set(
3053
3054
  (e.sheets || []).flatMap(
3054
3055
  (r) => (r.frames || []).flatMap(
@@ -3056,14 +3057,14 @@ function tc(e, t = {}) {
3056
3057
  )
3057
3058
  )
3058
3059
  );
3059
- return Un(e).filter(
3060
- (r) => ec.has(r.card.type) && !r.card.linkedSourceCardId && !(r.kind === "frameCard" && n.has(r.frameId)) && !(r.kind === "documentSectionCard" && r.sectionId === t.excludeSectionId) && !Vi(r.card)
3060
+ return zn(e).filter(
3061
+ (r) => tc.has(r.card.type) && !r.card.linkedSourceCardId && !(r.kind === "frameCard" && n.has(r.frameId)) && !(r.kind === "documentSectionCard" && r.sectionId === t.excludeSectionId) && !Bi(r.card)
3061
3062
  );
3062
3063
  }
3063
- function nc(e) {
3064
+ function rc(e) {
3064
3065
  return e.type === "kpi" ? "kpi" : e.type === "matrixTable" ? "matrix" : "table";
3065
3066
  }
3066
- function rc(e, t, n) {
3067
+ function ic(e, t, n) {
3067
3068
  const r = e.sections, i = (a) => ({
3068
3069
  ...e,
3069
3070
  sections: a
@@ -3080,7 +3081,7 @@ function rc(e, t, n) {
3080
3081
  };
3081
3082
  }
3082
3083
  case "copyCard": {
3083
- const a = Ue(t.source, n), c = B[nc(a.card)].create({
3084
+ const a = Ue(t.source, n), c = B[rc(a.card)].create({
3084
3085
  section: n.ids.section,
3085
3086
  card: () => a.card.id
3086
3087
  }), l = c.type === "kpi" ? { ...c, title: void 0, cards: [a.card] } : c.type === "table" ? { ...c, title: a.card.title || c.title, card: a.card } : c;
@@ -3096,7 +3097,7 @@ function rc(e, t, n) {
3096
3097
  throw new D(
3097
3098
  "Only a table section can be replaced with a copied card."
3098
3099
  );
3099
- const s = Ue(t.source, n, t.sectionId), c = kr(a, s.card.type);
3100
+ const s = Ue(t.source, n, t.sectionId), c = _r(a, s.card.type);
3100
3101
  if (c) throw new D(c);
3101
3102
  const l = {
3102
3103
  ...a,
@@ -3124,7 +3125,7 @@ function rc(e, t, n) {
3124
3125
  case "duplicate": {
3125
3126
  const a = r.findIndex(({ id: c }) => c === t.sectionId);
3126
3127
  if (a === -1) throw Ce(t.sectionId);
3127
- const s = ic(r[a], n.ids);
3128
+ const s = ac(r[a], n.ids);
3128
3129
  return {
3129
3130
  document: i(ze(r, s, a + 1)),
3130
3131
  target: o(s.id)
@@ -3167,13 +3168,13 @@ function rc(e, t, n) {
3167
3168
  };
3168
3169
  }
3169
3170
  case "updateRegionText": {
3170
- if (!Xs[t.region].includes(t.role))
3171
+ if (!Js[t.region].includes(t.role))
3171
3172
  throw new D(
3172
3173
  `The ${t.region} has ${t.region === "header" ? "a title and a metadata line" : "a note and a page info line"}, not a ${t.role} line.`
3173
3174
  );
3174
- if (t.style !== void 0 && !Li(t.role))
3175
+ if (t.style !== void 0 && !Vi(t.role))
3175
3176
  throw new D(`The footer's ${t.role === "pageInfo" ? "page info" : t.role} line has no size or alignment; only the header's title and metadata lines do.`);
3176
- const a = e[t.region], s = a ? ys(a.blocks, t.role) : void 0, c = t.style !== void 0 ? Wt(s == null ? void 0 : s.style, t.style) : s == null ? void 0 : s.style, l = {
3177
+ const a = e[t.region], s = a ? bs(a.blocks, t.role) : void 0, c = t.style !== void 0 ? Wt(s == null ? void 0 : s.style, t.style) : s == null ? void 0 : s.style, l = {
3177
3178
  id: (s == null ? void 0 : s.id) ?? `${t.region}_${t.role}`,
3178
3179
  role: t.role,
3179
3180
  area: (s == null ? void 0 : s.area) ?? t.role,
@@ -3181,15 +3182,15 @@ function rc(e, t, n) {
3181
3182
  ...c ? { style: c } : {}
3182
3183
  };
3183
3184
  if (t.region === "header") {
3184
- const u = (a == null ? void 0 : a.region) === "header" ? a : hs();
3185
+ const u = (a == null ? void 0 : a.region) === "header" ? a : gs();
3185
3186
  return {
3186
- document: { ...e, header: { ...u, enabled: !0, blocks: dn(u.blocks, l) } },
3187
+ document: { ...e, header: { ...u, enabled: !0, blocks: un(u.blocks, l) } },
3187
3188
  target: { kind: "header" }
3188
3189
  };
3189
3190
  }
3190
- const d = (a == null ? void 0 : a.region) === "footer" ? a : gs();
3191
+ const d = (a == null ? void 0 : a.region) === "footer" ? a : ys();
3191
3192
  return {
3192
- document: { ...e, footer: { ...d, enabled: !0, blocks: dn(d.blocks, l) } },
3193
+ document: { ...e, footer: { ...d, enabled: !0, blocks: un(d.blocks, l) } },
3193
3194
  target: { kind: "footer" }
3194
3195
  };
3195
3196
  }
@@ -3209,11 +3210,11 @@ function rc(e, t, n) {
3209
3210
  case "updateKpiOptions": {
3210
3211
  const a = V(r, t.sectionId);
3211
3212
  if (a.type !== "kpi") throw Y(t.type, a);
3212
- if (t.options.layout === "tiles" && !xr(a))
3213
+ if (t.options.layout === "tiles" && !Tr(a))
3213
3214
  throw new D("Tiles hold up to 6 KPIs.");
3214
3215
  return {
3215
3216
  document: i(
3216
- L(r, js(a, t.options))
3217
+ L(r, Ws(a, t.options))
3217
3218
  ),
3218
3219
  target: o(a.id)
3219
3220
  };
@@ -3225,7 +3226,7 @@ function rc(e, t, n) {
3225
3226
  document: i(
3226
3227
  L(r, {
3227
3228
  ...a,
3228
- heightPx: Zs(t.heightPx)
3229
+ heightPx: ec(t.heightPx)
3229
3230
  })
3230
3231
  ),
3231
3232
  target: o(a.id)
@@ -3233,10 +3234,10 @@ function rc(e, t, n) {
3233
3234
  }
3234
3235
  case "replaceCard": {
3235
3236
  const a = V(r, t.sectionId);
3236
- t.card.id !== t.oldCardId && pn(n, t.card.id);
3237
+ t.card.id !== t.oldCardId && hn(n, t.card.id);
3237
3238
  let s;
3238
3239
  try {
3239
- s = Ys(a, t.oldCardId, t.card);
3240
+ s = Qs(a, t.oldCardId, t.card);
3240
3241
  } catch (c) {
3241
3242
  throw new D(c.message);
3242
3243
  }
@@ -3250,14 +3251,14 @@ function rc(e, t, n) {
3250
3251
  case "addKpi": {
3251
3252
  const a = V(r, t.sectionId);
3252
3253
  if (a.type !== "kpi") throw Y(t.type, a);
3253
- if (!wr(a))
3254
+ if (!xr(a))
3254
3255
  throw new D("A KPI section holds up to 8 KPIs.");
3255
3256
  const s = t.source ? Ue(t.source, n, a.id) : void 0;
3256
- t.card && !s && pn(n, t.card.id);
3257
- const c = (s == null ? void 0 : s.card) ?? t.card ?? Tr(n.ids.card());
3257
+ t.card && !s && hn(n, t.card.id);
3258
+ const c = (s == null ? void 0 : s.card) ?? t.card ?? Dr(n.ids.card());
3258
3259
  if (c.type !== "kpi")
3259
3260
  throw new D("KPI sections hold KPI cards only");
3260
- const l = Us(a, c);
3261
+ const l = zs(a, c);
3261
3262
  if (l === a)
3262
3263
  throw new D(`KPI section '${a.id}' already has card '${c.id}'.`);
3263
3264
  return {
@@ -3271,7 +3272,7 @@ function rc(e, t, n) {
3271
3272
  if (a.type !== "kpi") throw Y(t.type, a);
3272
3273
  if (!a.cards.some(({ id: c }) => c === t.cardId))
3273
3274
  throw new D(`KPI section '${a.id}' has no card '${t.cardId}'.`);
3274
- const s = zs(a, t.cardId);
3275
+ const s = js(a, t.cardId);
3275
3276
  if (s === a)
3276
3277
  throw new D("A KPI section keeps at least one KPI.");
3277
3278
  return {
@@ -3293,19 +3294,19 @@ function rc(e, t, n) {
3293
3294
  };
3294
3295
  }
3295
3296
  default:
3296
- return oc(t);
3297
+ return sc(t);
3297
3298
  }
3298
3299
  }
3299
3300
  function Ue(e, t, n) {
3300
- const r = tc(t.dashboard, {
3301
+ const r = nc(t.dashboard, {
3301
3302
  excludeSectionId: n
3302
- }).find((p) => ac(p, e));
3303
+ }).find((p) => oc(p, e));
3303
3304
  if (!r)
3304
3305
  throw new D(
3305
3306
  `Card '${e.cardId}' cannot be copied into this document.`
3306
3307
  );
3307
3308
  const i = t.dashboard.sheets || [], o = i.find(({ id: p }) => p === e.sheetId), a = i.find(({ id: p }) => p === t.sheetId), s = t.ids.card(), c = we({ ...r.card, id: s });
3308
- Nn(c, /* @__PURE__ */ new Map([[e.cardId, s]]));
3309
+ En(c, /* @__PURE__ */ new Map([[e.cardId, s]]));
3309
3310
  const l = /* @__PURE__ */ new Set();
3310
3311
  if (ue(c, {
3311
3312
  oldCardId: e.cardId,
@@ -3315,7 +3316,7 @@ function Ue(e, t, n) {
3315
3316
  onSheetField: (p) => l.add(p)
3316
3317
  }), e.sheetId === t.sheetId || l.size === 0)
3317
3318
  return { card: c };
3318
- const d = os(o), u = /* @__PURE__ */ new Map(), f = [...l];
3319
+ const d = ss(o), u = /* @__PURE__ */ new Map(), f = [...l];
3319
3320
  for (; f.length > 0; ) {
3320
3321
  const p = f.pop();
3321
3322
  if (u.has(p)) continue;
@@ -3352,13 +3353,13 @@ function ue(e, t) {
3352
3353
  const n = e;
3353
3354
  typeof n.entityId == "string" && (n.fieldScope === "card" && n.entityId === t.oldCardId ? n.entityId = t.newCardId : n.fieldScope === "sheet" && n.entityId === t.sourceSheetId && (typeof n.id == "string" && t.onSheetField(Ge(n.id) ?? n.id), n.entityId = t.targetSheetId)), Object.values(n).forEach((r) => ue(r, t));
3354
3355
  }
3355
- function ic(e, t) {
3356
+ function ac(e, t) {
3356
3357
  const n = { ...we(e), id: t.section() }, r = new Map(
3357
3358
  bt(n).map((i) => [i.id, t.card()])
3358
3359
  );
3359
- return Gn(n, (i) => {
3360
+ return Hn(n, (i) => {
3360
3361
  const o = r.get(i.id), a = we({ ...i, id: o });
3361
- return Nn(a, r), ue(a, {
3362
+ return En(a, r), ue(a, {
3362
3363
  oldCardId: i.id,
3363
3364
  newCardId: o,
3364
3365
  sourceSheetId: "",
@@ -3368,11 +3369,11 @@ function ic(e, t) {
3368
3369
  }), a;
3369
3370
  });
3370
3371
  }
3371
- function ac(e, t) {
3372
+ function oc(e, t) {
3372
3373
  return e.kind !== t.kind || e.sheetId !== t.sheetId || e.cardId !== t.cardId ? !1 : e.kind === "frameCard" && t.kind === "frameCard" ? e.frameId === t.frameId : e.kind === "documentSectionCard" && t.kind === "documentSectionCard" ? e.sectionId === t.sectionId : !0;
3373
3374
  }
3374
- function pn(e, t) {
3375
- if (ja(e.dashboard, t))
3375
+ function hn(e, t) {
3376
+ if (Wa(e.dashboard, t))
3376
3377
  throw new D(
3377
3378
  `Card id '${t}' is already used by another card in this dashboard.`
3378
3379
  );
@@ -3402,56 +3403,56 @@ function Y(e, t) {
3402
3403
  `'${e}' does not apply to a ${t.type} section.`
3403
3404
  );
3404
3405
  }
3405
- function oc(e) {
3406
+ function sc(e) {
3406
3407
  throw new D(
3407
3408
  `Unknown document edit '${e.type}'.`
3408
3409
  );
3409
3410
  }
3410
- const sc = {
3411
+ const cc = {
3411
3412
  section: () => {
3412
3413
  throw new F("document_invalid", "A text edit mints no section id.");
3413
3414
  },
3414
3415
  card: () => {
3415
3416
  throw new F("document_invalid", "A text edit mints no card id.");
3416
3417
  }
3417
- }, cc = { title: "title", metadata: "metadata", note: "note", pageInfo: "page info" };
3418
- function lc(e, t) {
3418
+ }, lc = { title: "title", metadata: "metadata", note: "note", pageInfo: "page info" };
3419
+ function dc(e, t) {
3419
3420
  const n = e.sheets ?? [], r = n.findIndex((d) => d.id === t.sheetId), i = n[r];
3420
3421
  if (!i) throw new F("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`, "Read the outline again and use its sheet ids.");
3421
3422
  if (!Me(i) || !i.document)
3422
3423
  throw new F("document_invalid", `"${i.title ?? i.id}" is not a Document sheet.`, "Name a Document sheet; a grid sheet's words are its text cards.");
3423
3424
  let o;
3424
3425
  try {
3425
- o = rc(i.document, t.edit, { dashboard: e, sheetId: i.id, ids: sc }).document;
3426
+ o = ic(i.document, t.edit, { dashboard: e, sheetId: i.id, ids: cc }).document;
3426
3427
  } catch (d) {
3427
3428
  throw d instanceof D ? new F("document_invalid", d.message, "Read the outline again and use its section ids and line roles.") : d;
3428
3429
  }
3429
- const a = { ...e, sheets: n.map((d, u) => u === r ? { ...d, document: o } : d) }, s = t.edit.type === "updateRegionText" ? `the ${cc[t.edit.role]} line of the ${T(i.title)} ${t.edit.region}` : `a text section of ${T(i.title)}`, c = [];
3430
+ const a = { ...e, sheets: n.map((d, u) => u === r ? { ...d, document: o } : d) }, s = t.edit.type === "updateRegionText" ? `the ${lc[t.edit.role]} line of the ${T(i.title)} ${t.edit.region}` : `a text section of ${T(i.title)}`, c = [];
3430
3431
  if (t.edit.content !== void 0) {
3431
- const d = Bi(t.edit.content, { inputs: a.inputs, variables: a.variables }), u = qi(d);
3432
- c.push(`sets ${s} to ${T(Ui(d))}${u ? `, ${u}` : ""}`);
3432
+ const d = qi(t.edit.content, { inputs: a.inputs, variables: a.variables }), u = Ui(d);
3433
+ c.push(`sets ${s} to ${T(zi(d))}${u ? `, ${u}` : ""}`);
3433
3434
  }
3434
- const l = uc(t.edit.style);
3435
+ const l = fc(t.edit.style);
3435
3436
  return l && c.push(c.length ? `makes it ${l}` : `makes ${s} ${l}`), {
3436
3437
  dashboard: a,
3437
3438
  clauses: [x.plain("document", c.join(" and "))]
3438
3439
  };
3439
3440
  }
3440
- const dc = { left: "left-aligned", center: "centered", right: "right-aligned" };
3441
- function uc(e) {
3441
+ const uc = { left: "left-aligned", center: "centered", right: "right-aligned" };
3442
+ function fc(e) {
3442
3443
  return [
3443
3444
  ...(e == null ? void 0 : e.fontSize) !== void 0 ? [`${e.fontSize}px`] : [],
3444
- ...(e == null ? void 0 : e.align) !== void 0 ? [dc[e.align]] : []
3445
+ ...(e == null ? void 0 : e.align) !== void 0 ? [uc[e.align]] : []
3445
3446
  ].join(" and ");
3446
3447
  }
3447
- function pd(e, t, n) {
3448
+ function hd(e, t, n) {
3448
3449
  let r = e;
3449
3450
  const i = [], o = [], a = [], s = [], c = [];
3450
3451
  let l = !1;
3451
3452
  for (const [u, f] of t.entries()) {
3452
3453
  let m;
3453
3454
  try {
3454
- m = mc(r, f, n);
3455
+ m = pc(r, f, n);
3455
3456
  } catch (p) {
3456
3457
  if (!(p instanceof F)) throw p;
3457
3458
  return {
@@ -3476,66 +3477,66 @@ function pd(e, t, n) {
3476
3477
  dashboard: r,
3477
3478
  created: i,
3478
3479
  touched: o.filter((u) => !d.has(u)),
3479
- queryFrames: [...fc(r, i, o), ...s],
3480
- descriptions: pc(c),
3480
+ queryFrames: [...mc(r, i, o), ...s],
3481
+ descriptions: hc(c),
3481
3482
  runtimeEffects: a,
3482
3483
  detaches: l
3483
3484
  };
3484
3485
  }
3485
- function fc(e, t, n) {
3486
+ function mc(e, t, n) {
3486
3487
  const r = /* @__PURE__ */ new Set([...t.filter((i) => i.kind === "card").map((i) => i.id), ...n]);
3487
3488
  return (e.sheets ?? []).flatMap(
3488
3489
  (i) => (i.frames ?? []).filter((o) => (o.cards ?? []).some((a) => r.has(a.id)))
3489
3490
  );
3490
3491
  }
3491
- function mc(e, t, n) {
3492
+ function pc(e, t, n) {
3492
3493
  switch (t.op) {
3493
3494
  case "card.add":
3494
- return Wi(e, t);
3495
+ return Gi(e, t);
3495
3496
  case "card.remove":
3496
- return ji(e, t.cardId);
3497
+ return Wi(e, t.cardId);
3497
3498
  case "card.update":
3498
- return oe(zi(e, t.cardId, t.update), [t.cardId]);
3499
+ return oe(ji(e, t.cardId, t.update), [t.cardId]);
3499
3500
  case "layout.arrange":
3500
- return ns(e, t);
3501
+ return rs(e, t);
3501
3502
  case "frame.commit":
3502
- return oe(cs(e, t.commit), [t.commit.frame.activeCardId]);
3503
+ return oe(ls(e, t.commit), [t.commit.frame.activeCardId]);
3503
3504
  case "filter.add":
3504
- return Os(e, t, n);
3505
- case "filter.update":
3506
3505
  return As(e, t, n);
3506
+ case "filter.update":
3507
+ return $s(e, t, n);
3507
3508
  case "filter.remove":
3508
- return Ps(e, t.filterId);
3509
+ return Ns(e, t.filterId);
3509
3510
  case "filter.bind":
3510
- return oe(Rs(e, t), [t.cardId]);
3511
- case "filter.exclude":
3512
3511
  return oe(Ks(e, t), [t.cardId]);
3512
+ case "filter.exclude":
3513
+ return oe(Ls(e, t), [t.cardId]);
3513
3514
  case "dashboard.update":
3514
- return ls(e, t);
3515
- case "dashboard.style":
3516
3515
  return ds(e, t);
3516
+ case "dashboard.style":
3517
+ return us(e, t);
3517
3518
  case "sheet.add":
3518
- return bs(e, t);
3519
- case "sheet.update":
3520
3519
  return vs(e, t);
3520
+ case "sheet.update":
3521
+ return Is(e, t);
3521
3522
  case "layout.tabs":
3522
- return oe(fs(e, t), t.cardIds.slice(0, 1));
3523
+ return oe(ms(e, t), t.cardIds.slice(0, 1));
3523
3524
  case "layout.untab":
3524
- return oe(ms(e, t), [t.cardId]);
3525
+ return oe(ps(e, t), [t.cardId]);
3525
3526
  case "variable.add":
3526
- return Ls(e, t);
3527
- case "variable.update":
3528
3527
  return Vs(e, t);
3529
- case "variable.remove":
3528
+ case "variable.update":
3530
3529
  return Bs(e, t);
3530
+ case "variable.remove":
3531
+ return qs(e, t);
3531
3532
  case "document.text":
3532
- return lc(e, t);
3533
+ return dc(e, t);
3533
3534
  }
3534
3535
  }
3535
3536
  function oe(e, t) {
3536
3537
  return { ...e, touched: t.filter(Boolean) };
3537
3538
  }
3538
- function pc(e) {
3539
+ function hc(e) {
3539
3540
  const t = [];
3540
3541
  for (const n of e) {
3541
3542
  const r = n.changeIndex === void 0 ? void 0 : t.find((i) => i.changeIndex === n.changeIndex);
@@ -3552,14 +3553,14 @@ function pc(e) {
3552
3553
  }
3553
3554
  return t.map(({ clauses: n, ...r }) => ({
3554
3555
  ...r,
3555
- sentence: Gi(hc(n))
3556
+ sentence: Hi(gc(n))
3556
3557
  }));
3557
3558
  }
3558
- function hc(e) {
3559
+ function gc(e) {
3559
3560
  let t = !1;
3560
3561
  return e.filter((n) => n.kind !== "detached" ? !0 : t ? !1 : (t = !0, !0));
3561
3562
  }
3562
- function hn(e) {
3563
+ function gn(e) {
3563
3564
  return Object.fromEntries(
3564
3565
  Object.entries(e).filter(
3565
3566
  (t) => typeof t[1] == "string" && t[1].length > 0
@@ -3581,18 +3582,18 @@ function fe(e) {
3581
3582
  e.tableName
3582
3583
  ].join(":");
3583
3584
  }
3584
- function gc(e, t) {
3585
+ function yc(e, t) {
3585
3586
  if (e.kind === "semantic")
3586
3587
  return {
3587
3588
  status: "ready",
3588
- request: hn({
3589
+ request: gn({
3589
3590
  connection_id: e.connectionId,
3590
3591
  domain_id: e.domainId,
3591
- dataset_id: ha(e),
3592
+ dataset_id: ga(e),
3592
3593
  dataset_name: e.datasetName
3593
3594
  })
3594
3595
  };
3595
- const n = Ja({
3596
+ const n = Za({
3596
3597
  source: e,
3597
3598
  capabilities: t
3598
3599
  });
@@ -3604,7 +3605,7 @@ function gc(e, t) {
3604
3605
  message: `Source is missing required field-metadata coordinates: ${n.missing.join(", ")}.`
3605
3606
  } : {
3606
3607
  status: "ready",
3607
- request: hn({
3608
+ request: gn({
3608
3609
  connection_id: e.connectionId,
3609
3610
  datamodel_id: "",
3610
3611
  database_name: n.coordinates.databaseName,
@@ -3613,14 +3614,14 @@ function gc(e, t) {
3613
3614
  })
3614
3615
  };
3615
3616
  }
3616
- function hd(e, t = /* @__PURE__ */ new Map()) {
3617
+ function gd(e, t = /* @__PURE__ */ new Map()) {
3617
3618
  const n = /* @__PURE__ */ new Map();
3618
3619
  for (const { card: r } of e) {
3619
3620
  const i = ut(r), o = i.kind === "config" ? i.executableSources : i.kind === "sql" ? i.pinnedCatalogSources.map((a) => a.source) : [];
3620
3621
  for (const a of o) {
3621
3622
  const s = fe(a);
3622
3623
  if (!n.has(s)) {
3623
- const c = gc(
3624
+ const c = yc(
3624
3625
  a,
3625
3626
  a.connectionId ? t.get(a.connectionId) : void 0
3626
3627
  );
@@ -3634,7 +3635,7 @@ function hd(e, t = /* @__PURE__ */ new Map()) {
3634
3635
  }
3635
3636
  return Array.from(n.values());
3636
3637
  }
3637
- function yc(e, t) {
3638
+ function bc(e, t) {
3638
3639
  if (e.kind !== "semantic" || !e.connectionId) return;
3639
3640
  const n = (t.qualifiedEntityName || "").split(".").map((i) => i.trim()).filter(Boolean), r = n.at(-1);
3640
3641
  if (r)
@@ -3650,36 +3651,36 @@ function Fe(e, t) {
3650
3651
  let n = e.get(t);
3651
3652
  return n || (n = { fields: /* @__PURE__ */ new Map(), fieldConflicts: /* @__PURE__ */ new Set() }, e.set(t, n)), n;
3652
3653
  }
3653
- function _r(e, t) {
3654
+ function Mr(e, t) {
3654
3655
  e.sourceLabel === void 0 ? e.sourceLabel = t : e.sourceLabel !== t && (e.sourceLabelConflict = !0);
3655
3656
  }
3656
3657
  function rt(e, t, n) {
3657
3658
  for (const r of t) {
3658
3659
  const i = r == null ? void 0 : r.trim();
3659
3660
  if (!i) continue;
3660
- const o = Ln(i), a = e.fields.get(o);
3661
+ const o = Vn(i), a = e.fields.get(o);
3661
3662
  a === void 0 ? e.fields.set(o, n) : a !== n && e.fieldConflicts.add(o);
3662
3663
  }
3663
3664
  }
3664
- function Mr(e, t) {
3665
- t.sourceLabel && _r(e, t.sourceLabel), t.sourceLabelConflict && (e.sourceLabelConflict = !0);
3665
+ function Or(e, t) {
3666
+ t.sourceLabel && Mr(e, t.sourceLabel), t.sourceLabelConflict && (e.sourceLabelConflict = !0);
3666
3667
  for (const [n, r] of t.fields)
3667
3668
  rt(e, [n], r);
3668
3669
  for (const n of t.fieldConflicts ?? [])
3669
3670
  e.fieldConflicts.add(n);
3670
3671
  }
3671
- function Or(e) {
3672
+ function Ar(e) {
3672
3673
  return e.kind === "semantic" && (e.label || e.datasetName || "").trim() || void 0;
3673
3674
  }
3674
- function gd(e, t) {
3675
+ function yd(e, t) {
3675
3676
  var r, i;
3676
3677
  const n = /* @__PURE__ */ new Map();
3677
3678
  for (const [o, a] of e) {
3678
3679
  if (a.status !== "ready") continue;
3679
- const s = t == null ? void 0 : t.get(o), c = s ? Or(s) : void 0;
3680
+ const s = t == null ? void 0 : t.get(o), c = s ? Ar(s) : void 0;
3680
3681
  for (const l of a.columns) {
3681
- const d = (r = l.column_name) == null ? void 0 : r.trim(), u = (i = l.label) == null ? void 0 : i.trim(), f = s ? yc(s, l) : void 0;
3682
- f && c && _r(
3682
+ const d = (r = l.column_name) == null ? void 0 : r.trim(), u = (i = l.label) == null ? void 0 : i.trim(), f = s ? bc(s, l) : void 0;
3683
+ f && c && Mr(
3683
3684
  Fe(n, fe(f)),
3684
3685
  c
3685
3686
  ), !(!d || !u || u === d) && (rt(
@@ -3695,20 +3696,20 @@ function gd(e, t) {
3695
3696
  }
3696
3697
  return n;
3697
3698
  }
3698
- function yd(...e) {
3699
+ function bd(...e) {
3699
3700
  const t = /* @__PURE__ */ new Map();
3700
3701
  for (const n of e)
3701
3702
  for (const [r, i] of n ?? [])
3702
- Mr(Fe(t, r), i);
3703
+ Or(Fe(t, r), i);
3703
3704
  return t;
3704
3705
  }
3705
3706
  function Dt(e) {
3706
3707
  return [e.databaseName, e.schemaName, e.tableName].filter(Boolean).join(".");
3707
3708
  }
3708
- function bc(e) {
3709
+ function vc(e) {
3709
3710
  return e.split(":").slice(2).filter(Boolean).join(".");
3710
3711
  }
3711
- function Ar(e, t) {
3712
+ function $r(e, t) {
3712
3713
  const n = fe(t), r = e.get(n);
3713
3714
  if (t.kind !== "physical") return r;
3714
3715
  const i = `physical:${t.connectionId}:`, o = Dt(t), a = {
@@ -3717,32 +3718,32 @@ function Ar(e, t) {
3717
3718
  };
3718
3719
  let s = !1;
3719
3720
  for (const [c, l] of e)
3720
- c.startsWith(i) && (c !== n && !Za(o, bc(c)) || (Mr(a, l), s = !0));
3721
+ c.startsWith(i) && (c !== n && !eo(o, vc(c)) || (Or(a, l), s = !0));
3721
3722
  return s ? a : void 0;
3722
3723
  }
3723
- function vc(e, t) {
3724
+ function Ic(e, t) {
3724
3725
  var i;
3725
3726
  if (!e) return;
3726
- const n = Ln(t.name), r = Ar(e, t.source);
3727
+ const n = Vn(t.name), r = $r(e, t.source);
3727
3728
  return r && !((i = r.fieldConflicts) != null && i.has(n)) ? r.fields.get(n) : void 0;
3728
3729
  }
3729
- function Ic(e, t) {
3730
+ function Cc(e, t) {
3730
3731
  if (t.kind === "semantic")
3731
- return Or(t) || t.datasetId || "Dataset";
3732
- const n = e ? Ar(e, t) : void 0;
3732
+ return Ar(t) || t.datasetId || "Dataset";
3733
+ const n = e ? $r(e, t) : void 0;
3733
3734
  return n != null && n.sourceLabel && !n.sourceLabelConflict ? n.sourceLabel : Dt(t);
3734
3735
  }
3735
- function bd(e, t) {
3736
- const n = vc(e, t);
3736
+ function vd(e, t) {
3737
+ const n = Ic(e, t);
3737
3738
  return {
3738
3739
  name: t.name,
3739
3740
  ...n ? { label: n } : {},
3740
- entityName: Ic(e, t.source),
3741
+ entityName: Cc(e, t.source),
3741
3742
  ...t.source.kind === "physical" ? { qualifiedEntityName: Dt(t.source) } : {},
3742
3743
  dataType: t.dataType
3743
3744
  };
3744
3745
  }
3745
- function Cc(e, t) {
3746
+ function Fc(e, t) {
3746
3747
  var i, o;
3747
3748
  const n = (i = t.column_name) == null ? void 0 : i.trim(), r = me(t.data_type);
3748
3749
  if (!(!n || r === "unknown"))
@@ -3756,7 +3757,7 @@ function Cc(e, t) {
3756
3757
  }
3757
3758
  };
3758
3759
  }
3759
- function vd(e) {
3760
+ function Id(e) {
3760
3761
  const t = {};
3761
3762
  for (const { card: n } of e.cards) {
3762
3763
  const r = ut(n), i = r.kind === "config" ? r.executableSources : r.kind === "sql" ? r.pinnedCatalogSources.map((s) => s.source) : [];
@@ -3772,7 +3773,7 @@ function vd(e) {
3772
3773
  break;
3773
3774
  }
3774
3775
  for (const l of c.columns) {
3775
- const d = Cc(s, l);
3776
+ const d = Fc(s, l);
3776
3777
  d && o.push(d);
3777
3778
  }
3778
3779
  }
@@ -3780,20 +3781,20 @@ function vd(e) {
3780
3781
  }
3781
3782
  return t;
3782
3783
  }
3783
- function Id(e) {
3784
- const { dashboard: t, target: n, calendar: r } = e, i = Pr(n), o = $r(t, n, r);
3784
+ function Cd(e) {
3785
+ const { dashboard: t, target: n, calendar: r } = e, i = Nr(n), o = Pr(t, n, r);
3785
3786
  return {
3786
3787
  value: o,
3787
- mode: oi(
3788
- si(o == null ? void 0 : o.operation) ? o.operation : i.operation
3788
+ mode: si(
3789
+ ci(o == null ? void 0 : o.operation) ? o.operation : i.operation
3789
3790
  )
3790
3791
  };
3791
3792
  }
3792
- function $r(e, t, n) {
3793
+ function Pr(e, t, n) {
3793
3794
  var r;
3794
3795
  switch (t.kind) {
3795
3796
  case "dashboardInput": {
3796
- const i = Yi({
3797
+ const i = Qi({
3797
3798
  dashboard: e,
3798
3799
  input: t.input,
3799
3800
  target: t.scope,
@@ -3805,7 +3806,7 @@ function $r(e, t, n) {
3805
3806
  const i = (r = e.defaultFilterValues) == null ? void 0 : r.find(
3806
3807
  (o) => o.filterId === t.filter.id
3807
3808
  );
3808
- return i ? Hi({
3809
+ return i ? Yi({
3809
3810
  filterDefinitions: [t.filter],
3810
3811
  filterValues: [i]
3811
3812
  })[0] : ce(t.filter, n);
@@ -3814,16 +3815,16 @@ function $r(e, t, n) {
3814
3815
  return ce(t.filter, n);
3815
3816
  }
3816
3817
  }
3817
- function Pr(e) {
3818
+ function Nr(e) {
3818
3819
  return e.kind === "dashboardInput" ? e.input.filter : e.filter;
3819
3820
  }
3820
- function Cd(e) {
3821
+ function Fd(e) {
3821
3822
  var o;
3822
3823
  const { dashboard: t, filter: n, input: r, scope: i } = e;
3823
3824
  return r && (t.inputs || []).some((a) => a.id === r.id) ? { kind: "dashboardInput", input: r, scope: i } : ((o = Z(t).findFilterInput({ filterId: n.id })) == null ? void 0 : o.origin) === "toolbarFilter" ? { kind: "dashboardFilter", filter: n } : { kind: "definition", filter: n };
3824
3825
  }
3825
- function Fd(e) {
3826
- const { dashboard: t, target: n, calendar: r } = e, i = Pr(n), o = Qi(i), a = Fc(t, n);
3826
+ function Sd(e) {
3827
+ const { dashboard: t, target: n, calendar: r } = e, i = Nr(n), o = Xi(i), a = Sc(t, n);
3827
3828
  if (!a) return o;
3828
3829
  if (a === "cleared")
3829
3830
  return {
@@ -3831,13 +3832,13 @@ function Fd(e) {
3831
3832
  defaultValues: void 0,
3832
3833
  defaultDateFilter: void 0
3833
3834
  };
3834
- const s = $r(t, n, r);
3835
- if (!s || Sc(s, ce(i, r)))
3835
+ const s = Pr(t, n, r);
3836
+ if (!s || wc(s, ce(i, r)))
3836
3837
  return o;
3837
3838
  if (s.valueType === "date") {
3838
3839
  const c = Ye(
3839
3840
  "relativeMeta" in s ? s.relativeMeta : void 0
3840
- ) ?? wc(i, s, r);
3841
+ ) ?? xc(i, s, r);
3841
3842
  return c ? {
3842
3843
  operation: s.operation,
3843
3844
  defaultValues: i.defaultValues,
@@ -3850,7 +3851,7 @@ function Fd(e) {
3850
3851
  defaultDateFilter: i.defaultDateFilter
3851
3852
  };
3852
3853
  }
3853
- function Fc(e, t) {
3854
+ function Sc(e, t) {
3854
3855
  var n;
3855
3856
  if (t.kind === "dashboardInput") {
3856
3857
  const r = pt(
@@ -3865,19 +3866,19 @@ function Fc(e, t) {
3865
3866
  (r) => r.filterId === t.filter.id
3866
3867
  ) ? "set" : void 0;
3867
3868
  }
3868
- function Sc(e, t) {
3869
- return !!(t && e.operation === t.operation && He(gn(e), gn(t)) && He(
3869
+ function wc(e, t) {
3870
+ return !!(t && e.operation === t.operation && He(yn(e), yn(t)) && He(
3870
3871
  "relativeMeta" in e ? e.relativeMeta : void 0,
3871
3872
  "relativeMeta" in t ? t.relativeMeta : void 0
3872
3873
  ));
3873
3874
  }
3874
- function gn(e) {
3875
+ function yn(e) {
3875
3876
  return e.values.map(
3876
3877
  (t) => t instanceof Date ? t.getTime() : t
3877
3878
  );
3878
3879
  }
3879
- function wc(e, t, n) {
3880
- const r = Xi(n == null ? void 0 : n.tz), i = Ke(t.values[0], r);
3880
+ function xc(e, t, n) {
3881
+ const r = Ji(n == null ? void 0 : n.tz), i = Ke(t.values[0], r);
3881
3882
  if (!i) return;
3882
3883
  const [o, a, s] = new Intl.DateTimeFormat("en-CA", {
3883
3884
  timeZone: r,
@@ -3913,18 +3914,18 @@ function wc(e, t, n) {
3913
3914
  );
3914
3915
  });
3915
3916
  }
3916
- function yn(e) {
3917
- return eo(void 0, e ?? "");
3917
+ function bn(e) {
3918
+ return to(void 0, e ?? "");
3918
3919
  }
3919
- const xc = {
3920
+ const Tc = {
3920
3921
  type: "temporal_bucket",
3921
3922
  presentation: { mode: "pattern", pattern: "YYYY-MM-DD" }
3922
3923
  };
3923
- function Tc(e) {
3924
+ function Dc(e) {
3924
3925
  const t = me(e.dataType);
3925
3926
  if (!["date", "datetime"].includes(t))
3926
3927
  return e;
3927
- const n = e.granularity !== void 0 || e.format !== void 0, r = Ji({
3928
+ const n = e.granularity !== void 0 || e.format !== void 0, r = Zi({
3928
3929
  fieldId: e.id,
3929
3930
  dataType: e.dataType,
3930
3931
  granularity: e.granularity,
@@ -3933,20 +3934,20 @@ function Tc(e) {
3933
3934
  });
3934
3935
  if (!r.ok)
3935
3936
  return e;
3936
- const i = n ? r.selection.format : xc;
3937
+ const i = n ? r.selection.format : Tc;
3937
3938
  return {
3938
3939
  ...e,
3939
3940
  granularity: r.granularity,
3940
3941
  format: i
3941
3942
  };
3942
3943
  }
3943
- function Sd(e, t) {
3944
+ function wd(e, t) {
3944
3945
  var r, i;
3945
3946
  const n = ((i = (r = globalThis.crypto) == null ? void 0 : r.randomUUID) == null ? void 0 : i.call(r).slice(0, 8)) ?? Math.random().toString(36).slice(2, 10);
3946
3947
  return `${e}-${t.qualifiedEntityName}-${t.name}-${Date.now()}-${n}`;
3947
3948
  }
3948
- function Dc(e, t) {
3949
- const n = En(e.replace(/_/g, " "));
3949
+ function kc(e, t) {
3950
+ const n = Rn(e.replace(/_/g, " "));
3950
3951
  switch (t) {
3951
3952
  case "SUM":
3952
3953
  return `Sum of ${n}`;
@@ -3964,15 +3965,15 @@ function Dc(e, t) {
3964
3965
  return n;
3965
3966
  }
3966
3967
  }
3967
- function wd(e, t, n) {
3968
+ function xd(e, t, n) {
3968
3969
  var i;
3969
- const r = Rn(e.dataType);
3970
+ const r = Kn(e.dataType);
3970
3971
  return n === "detailTable" ? "detailColumns" : n === "matrixTable" ? ((i = e.derivedField) == null ? void 0 : i.computeStage) === "aggregate" || me(e.dataType) === "number" ? "metrics" : "groupBy" : n === "kpi" ? r === "date" ? "groupBy" : "metrics" : t.length === 0 || r === "number" ? "metrics" : r === "date" || r === "string" || r === "boolean" ? "groupBy" : "metrics";
3971
3972
  }
3972
- function xd(e, t, n, r) {
3973
- const i = Rn(e.dataType), o = i === "date";
3974
- e = ga(e);
3975
- const a = ya(e), s = a.representation !== "physical", c = a.computeStage, l = s ? e.fieldScope === "domain" ? e.calculatedFieldOrigin : e.calculatedFieldOrigin || {
3973
+ function Td(e, t, n, r) {
3974
+ const i = Kn(e.dataType), o = i === "date";
3975
+ e = ya(e);
3976
+ const a = ba(e), s = a.representation !== "physical", c = a.computeStage, l = s ? e.fieldScope === "domain" ? e.calculatedFieldOrigin : e.calculatedFieldOrigin || {
3976
3977
  id: e.id,
3977
3978
  role: e.role
3978
3979
  } : void 0;
@@ -4019,10 +4020,10 @@ function xd(e, t, n, r) {
4019
4020
  };
4020
4021
  if (t === "metrics") {
4021
4022
  if (d || s && c === "aggregate") {
4022
- const g = e, I = {
4023
+ const g = e, C = {
4023
4024
  ...m,
4024
4025
  role: "metric",
4025
- ...cr(g, g, "selection"),
4026
+ ...lr(g, g, "selection"),
4026
4027
  parameters: g.parameters,
4027
4028
  aliasTemplate: g.aliasTemplate,
4028
4029
  valueAliases: g.valueAliases,
@@ -4032,9 +4033,9 @@ function xd(e, t, n, r) {
4032
4033
  semanticComparisonPolarity: g.semanticComparisonPolarity
4033
4034
  }, v = e.expression || "";
4034
4035
  if (!a.legacyManual && c !== "aggregate") {
4035
- const b = !I.aggregate && (c === "row" || yt(v).calls.length === 0), S = yn(i);
4036
+ const b = !C.aggregate && (c === "row" || yt(v).calls.length === 0), S = bn(i);
4036
4037
  return {
4037
- ...I,
4038
+ ...C,
4038
4039
  id: r,
4039
4040
  label: e.label || e.name,
4040
4041
  role: "metric",
@@ -4042,16 +4043,16 @@ function xd(e, t, n, r) {
4042
4043
  };
4043
4044
  }
4044
4045
  return {
4045
- ...I,
4046
+ ...C,
4046
4047
  id: r,
4047
4048
  label: e.label || e.name,
4048
4049
  role: "metric"
4049
4050
  };
4050
4051
  }
4051
- const p = e.aggregate || yn(i), y = Dc(
4052
+ const p = e.aggregate || bn(i), y = kc(
4052
4053
  e.label,
4053
4054
  p
4054
- ), h = ea(
4055
+ ), h = ta(
4055
4056
  { ...m, label: y },
4056
4057
  n,
4057
4058
  t
@@ -4067,7 +4068,7 @@ function xd(e, t, n, r) {
4067
4068
  if (t === "groupBy") {
4068
4069
  if (u) {
4069
4070
  const p = e;
4070
- return Tc({
4071
+ return Dc({
4071
4072
  ...m,
4072
4073
  label: e.label || e.name,
4073
4074
  role: "groupby",
@@ -4078,7 +4079,7 @@ function xd(e, t, n, r) {
4078
4079
  ...m,
4079
4080
  role: "groupby",
4080
4081
  ...o && {
4081
- granularity: Xt(e.granularity) ? e.granularity : "month",
4082
+ granularity: Jt(e.granularity) ? e.granularity : "month",
4082
4083
  // A new shelf placement does not author a presentation override.
4083
4084
  // Same-grain semantic presentation may therefore win; otherwise the
4084
4085
  // viewer's resolved automatic locale/style policy applies.
@@ -4092,13 +4093,13 @@ function xd(e, t, n, r) {
4092
4093
  ...m,
4093
4094
  role: "pivotby",
4094
4095
  ...o && {
4095
- granularity: Xt(e.granularity) ? e.granularity : "month",
4096
+ granularity: Jt(e.granularity) ? e.granularity : "month",
4096
4097
  format: void 0,
4097
4098
  formatOrigin: void 0
4098
4099
  }
4099
4100
  };
4100
4101
  if (t === "detailColumns") {
4101
- const p = ta(m, "detail");
4102
+ const p = na(m, "detail");
4102
4103
  if (d) {
4103
4104
  const y = e;
4104
4105
  return {
@@ -4127,14 +4128,14 @@ function xd(e, t, n, r) {
4127
4128
  direction: "asc"
4128
4129
  } : null;
4129
4130
  }
4130
- function Td(e) {
4131
- return Object.values(Zi(e)).some((t) => t.length > 0);
4131
+ function Dd(e) {
4132
+ return Object.values(ea(e)).some((t) => t.length > 0);
4132
4133
  }
4133
- function kc(e) {
4134
+ function _c(e) {
4134
4135
  const t = te(e.format);
4135
4136
  if ((t == null ? void 0 : t.type) === "temporal_bucket") {
4136
4137
  if (!e.granularity) return {};
4137
- const n = $a(
4138
+ const n = Pa(
4138
4139
  t,
4139
4140
  e.granularity
4140
4141
  );
@@ -4151,23 +4152,23 @@ function kc(e) {
4151
4152
  ...t ? { format: t } : {}
4152
4153
  };
4153
4154
  }
4154
- function _c(e, t) {
4155
+ function Mc(e, t) {
4155
4156
  var i, o;
4156
4157
  const n = ((i = e.nativeDataType) == null ? void 0 : i.trim()) || ((o = e.native_data_type) == null ? void 0 : o.trim());
4157
4158
  return n || ((e.dataTypeProvenance || t) === "physical" ? e.data_type : void 0);
4158
4159
  }
4159
- function Nr(e) {
4160
+ function Er(e) {
4160
4161
  const t = (e.label ?? "").trim();
4161
4162
  return t ? e.derivedLabel === void 0 ? !0 : t !== e.derivedLabel.trim() : !1;
4162
4163
  }
4163
4164
  function kt(e) {
4164
- return Nr(e) ? e.label.trim() : e.name || (e.label ?? "").trim();
4165
+ return Er(e) ? e.label.trim() : e.name || (e.label ?? "").trim();
4165
4166
  }
4166
- function bn(e) {
4167
+ function vn(e) {
4167
4168
  return kt(e).toLowerCase().trim();
4168
4169
  }
4169
- function Mc(e, t) {
4170
- return bn(e).localeCompare(bn(t), void 0, {
4170
+ function Oc(e, t) {
4171
+ return vn(e).localeCompare(vn(t), void 0, {
4171
4172
  numeric: !0,
4172
4173
  sensitivity: "base"
4173
4174
  });
@@ -4175,7 +4176,7 @@ function Mc(e, t) {
4175
4176
  function de(e) {
4176
4177
  return String(e ?? "").toLowerCase().replace(/[\s_\-.]+/g, "");
4177
4178
  }
4178
- function Dd(e, t) {
4179
+ function kd(e, t) {
4179
4180
  const n = de(t);
4180
4181
  return n ? [
4181
4182
  kt(e),
@@ -4190,16 +4191,16 @@ function Dd(e, t) {
4190
4191
  (i) => !!i && de(i).includes(n)
4191
4192
  ) : !0;
4192
4193
  }
4193
- function vn(e, t) {
4194
+ function In(e, t) {
4194
4195
  const n = de(t);
4195
4196
  if (!n) return 0;
4196
4197
  const r = de(kt(e));
4197
4198
  return r.startsWith(n) ? 0 : r.includes(n) ? 1 : [e.label, e.name].filter(Boolean).map(de).some((o) => o.includes(n)) ? 2 : 3;
4198
4199
  }
4199
- function kd(e, t, n) {
4200
- return vn(e, n) - vn(t, n) || Mc(e, t);
4200
+ function _d(e, t, n) {
4201
+ return In(e, n) - In(t, n) || Oc(e, t);
4201
4202
  }
4202
- function Oc(e, t) {
4203
+ function Ac(e, t) {
4203
4204
  var o;
4204
4205
  const n = e.type === "dataset" ? (o = t.find((a) => a.entityName)) == null ? void 0 : o.entityName : void 0, r = n || e.name, i = Gt(
4205
4206
  e.type === "dataset" && n ? { ...e, name: n } : e
@@ -4213,12 +4214,12 @@ function Oc(e, t) {
4213
4214
  qualifiedEntityName: i,
4214
4215
  columns: t.map((a) => {
4215
4216
  var m;
4216
- const s = e.type === "dataset" ? a.entityName || r : e.name, c = a.qualifiedEntityName || (e.type === "dataset" && s ? Gt({ ...e, name: s }) : i), l = _c(
4217
+ const s = e.type === "dataset" ? a.entityName || r : e.name, c = a.qualifiedEntityName || (e.type === "dataset" && s ? Gt({ ...e, name: s }) : i), l = Mc(
4217
4218
  a,
4218
4219
  e.type === "dataset" ? "semantic" : "physical"
4219
4220
  ), d = (m = a.label) != null && m.trim() ? a.label : void 0, u = d ? void 0 : ft(a.column_name);
4220
4221
  return {
4221
- id: na(s, a.column_name),
4222
+ id: ra(s, a.column_name),
4222
4223
  name: a.column_name,
4223
4224
  qualifiedFieldName: a.qualifiedFieldName || a.column_name,
4224
4225
  dataType: a.data_type,
@@ -4242,23 +4243,23 @@ function Oc(e, t) {
4242
4243
  aggregateOrigin: a.aggregateOrigin,
4243
4244
  labelOrigin: a.labelOrigin,
4244
4245
  formatOrigin: a.formatOrigin,
4245
- ...kc(a),
4246
+ ..._c(a),
4246
4247
  aggregate: a.aggregate
4247
4248
  };
4248
4249
  })
4249
4250
  };
4250
4251
  }
4251
- function Ac(e) {
4252
+ function $c(e) {
4252
4253
  return e.map((t) => ({
4253
4254
  ...t,
4254
- id: Kn({ ...t }),
4255
+ id: Ln({ ...t }),
4255
4256
  fieldScope: "domain"
4256
4257
  }));
4257
4258
  }
4258
- function $c(e) {
4259
+ function Pc(e) {
4259
4260
  return e.flatMap(
4260
4261
  (t) => t.columns.map((n) => {
4261
- const r = Nr(n) ? n.label : void 0, i = r ? void 0 : n.derivedLabel ?? En(n.name), o = r ?? i ?? n.name;
4262
+ const r = Er(n) ? n.label : void 0, i = r ? void 0 : n.derivedLabel ?? Rn(n.name), o = r ?? i ?? n.name;
4262
4263
  return {
4263
4264
  ...n,
4264
4265
  id: n.id || `${t.entityId}-${n.name}`,
@@ -4276,18 +4277,18 @@ function $c(e) {
4276
4277
  })
4277
4278
  );
4278
4279
  }
4279
- function _d(e) {
4280
- const t = e.map((r) => Oc(r.target, r.columns || [])).filter((r) => {
4280
+ function Md(e) {
4281
+ const t = e.map((r) => Ac(r.target, r.columns || [])).filter((r) => {
4281
4282
  var i;
4282
4283
  return ((i = r == null ? void 0 : r.columns) == null ? void 0 : i.length) > 0;
4283
- }), n = Ac(e.flatMap((r) => r.calculatedFields || []));
4284
+ }), n = $c(e.flatMap((r) => r.calculatedFields || []));
4284
4285
  if (n.length > 0) {
4285
4286
  const r = /* @__PURE__ */ new Map();
4286
4287
  n.forEach((i) => {
4287
- const o = Kn(i);
4288
+ const o = Ln(i);
4288
4289
  r.has(o) || r.set(o, i);
4289
4290
  }), t.unshift({
4290
- entityId: ra,
4291
+ entityId: ia,
4291
4292
  entityType: "dataset",
4292
4293
  entityName: Ht,
4293
4294
  label: "Calculated Fields",
@@ -4296,9 +4297,9 @@ function _d(e) {
4296
4297
  columns: Array.from(r.values())
4297
4298
  });
4298
4299
  }
4299
- return { columnGroups: t, columns: $c(t) };
4300
+ return { columnGroups: t, columns: Pc(t) };
4300
4301
  }
4301
- function Pc(e, t) {
4302
+ function Nc(e, t) {
4302
4303
  var i;
4303
4304
  const n = (i = t.columnKeyMap) == null ? void 0 : i.byRole;
4304
4305
  if (!n) return;
@@ -4309,7 +4310,7 @@ function Pc(e, t) {
4309
4310
  if (r.length === 1)
4310
4311
  return r[0].outputKey ?? r[0].rawKey;
4311
4312
  }
4312
- function Nc(e, t) {
4313
+ function Ec(e, t) {
4313
4314
  var r;
4314
4315
  const n = (r = t.resultColumns) == null ? void 0 : r.find((i) => {
4315
4316
  const o = i.pivotIdentity;
@@ -4319,13 +4320,13 @@ function Nc(e, t) {
4319
4320
  });
4320
4321
  return n == null ? void 0 : n.key;
4321
4322
  }
4322
- function In(e, t) {
4323
+ function Cn(e, t) {
4323
4324
  var n;
4324
4325
  switch (e.kind) {
4325
4326
  case "field":
4326
- return Pc(e.fieldId, t);
4327
+ return Nc(e.fieldId, t);
4327
4328
  case "pivot":
4328
- return Nc(e, t);
4329
+ return Ec(e, t);
4329
4330
  case "result":
4330
4331
  return !t.keys || t.keys.includes(e.key) ? e.key : void 0;
4331
4332
  case "sqlKpiValue":
@@ -4336,13 +4337,13 @@ function In(e, t) {
4336
4337
  return;
4337
4338
  }
4338
4339
  }
4339
- function Md(e, t) {
4340
+ function Od(e, t) {
4340
4341
  return e.flatMap((n) => {
4341
4342
  var s, c;
4342
- const r = In(n.condition.column, t);
4343
+ const r = Cn(n.condition.column, t);
4343
4344
  if (r === void 0) return [];
4344
4345
  const i = (s = n.target.columns) == null ? void 0 : s.flatMap((l) => {
4345
- const d = In(l, t);
4346
+ const d = Cn(l, t);
4346
4347
  return d === void 0 ? [] : [d];
4347
4348
  });
4348
4349
  if ((c = n.target.columns) != null && c.length && !(i != null && i.length)) return [];
@@ -4356,9 +4357,9 @@ function Md(e, t) {
4356
4357
  ];
4357
4358
  });
4358
4359
  }
4359
- function Od(e, t, n) {
4360
+ function Ad(e, t, n) {
4360
4361
  var a, s, c, l, d;
4361
- const r = ia(e);
4362
+ const r = aa(e);
4362
4363
  if (r.includes("matrixMeasure"))
4363
4364
  return (s = (a = e.config) == null ? void 0 : a.matrix) != null && s.spec.measures.some((u) => u.id === t) ? { kind: "matrixMeasure", measureId: t } : void 0;
4364
4365
  if (r.includes("sqlKpiValue")) return { kind: "sqlKpiValue" };
@@ -4379,7 +4380,7 @@ function Od(e, t, n) {
4379
4380
  );
4380
4381
  return o.length === 1 ? { kind: "field", fieldId: o[0] } : void 0;
4381
4382
  }
4382
- function Ad(e, t) {
4383
+ function $d(e, t) {
4383
4384
  var c;
4384
4385
  if (!e) return;
4385
4386
  const n = e.windows.map((l) => ({
@@ -4393,7 +4394,7 @@ function Ad(e, t) {
4393
4394
  // A window's name holds only when it alone is the period (not cut by
4394
4395
  // another window, nor truncated to date by the comparison).
4395
4396
  ...r.length === 1 && !((c = e.conditions) != null && c.length) && r[0].relative && r[0].window && it(r[0].window, e.counted.window) ? { relative: r[0].relative } : {}
4396
- } : { kind: "all_time" } : { kind: "no_date" }, o = Ec(r), a = t == null ? void 0 : t.output, s = t && t.type !== "target" ? t.type : void 0;
4397
+ } : { kind: "all_time" } : { kind: "no_date" }, o = Rc(r), a = t == null ? void 0 : t.output, s = t && t.type !== "target" ? t.type : void 0;
4397
4398
  return {
4398
4399
  ...e.field ? { field: e.field } : {},
4399
4400
  windows: n,
@@ -4405,7 +4406,7 @@ function Ad(e, t) {
4405
4406
  ...o ? { overlap: o } : {}
4406
4407
  };
4407
4408
  }
4408
- function Ec(e) {
4409
+ function Rc(e) {
4409
4410
  const t = e.filter((o) => o.source !== "card").flatMap((o) => o.window ? [o.window] : []), n = e.filter((o) => o.source === "card").flatMap((o) => o.window ? [o.window] : []);
4410
4411
  if (t.length && n.length) {
4411
4412
  const o = je(t), a = je([...t, ...n]);
@@ -4423,7 +4424,7 @@ function je(e) {
4423
4424
  function it(e, t) {
4424
4425
  return Date.parse(e.startInclusive) === Date.parse(t.startInclusive) && Date.parse(e.endExclusive) === Date.parse(t.endExclusive);
4425
4426
  }
4426
- const Rc = {
4427
+ const Kc = {
4427
4428
  trend_by: "From Trend By",
4428
4429
  comparison_date: "From the comparison's date",
4429
4430
  primary_date: "From the dataset's primary date",
@@ -4434,8 +4435,8 @@ function ie(e, t = /* @__PURE__ */ new Date()) {
4434
4435
  try {
4435
4436
  const r = new Date(e.startInclusive), i = new Date(e.endExclusive);
4436
4437
  if (M(r, n, "HH:mm:ss.SSS") !== "00:00:00.000") {
4437
- const I = M(r, n, "yyyy") !== M(t, n, "yyyy") || M(i, n, "yyyy") !== M(t, n, "yyyy") ? "MMM d, yyyy, h:mm a" : "MMM d, h:mm a";
4438
- return `${M(r, n, I)} – ${M(i, n, I)}`;
4438
+ const C = M(r, n, "yyyy") !== M(t, n, "yyyy") || M(i, n, "yyyy") !== M(t, n, "yyyy") ? "MMM d, yyyy, h:mm a" : "MMM d, h:mm a";
4439
+ return `${M(r, n, C)} – ${M(i, n, C)}`;
4439
4440
  }
4440
4441
  const o = M(i, n, "HH:mm:ss.SSS") === "00:00:00.000", a = o ? new Date(i.getTime() - 1) : i, s = M(t, n, "yyyy"), c = M(r, n, "yyyy"), l = M(a, n, "yyyy"), d = M(r, n, "yyyy-MM-dd"), u = M(a, n, "yyyy-MM-dd"), f = c !== l || l !== s, m = o ? "" : `, until ${M(i, n, "h:mm a")}`;
4441
4442
  if (d === u)
@@ -4446,36 +4447,36 @@ function ie(e, t = /* @__PURE__ */ new Date()) {
4446
4447
  return `${e.startInclusive} – before ${e.endExclusive}`;
4447
4448
  }
4448
4449
  }
4449
- const Cn = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
4450
- function Kc(e, t) {
4450
+ const Fn = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
4451
+ function Lc(e, t) {
4451
4452
  try {
4452
- return Pa({
4453
+ return Na({
4453
4454
  value: e,
4454
4455
  metadata: t,
4455
- format: { type: "temporal_bucket", locale: "en-US", presentation: { mode: "auto", styles: Na } }
4456
+ format: { type: "temporal_bucket", locale: "en-US", presentation: { mode: "auto", styles: Ea } }
4456
4457
  });
4457
4458
  } catch {
4458
4459
  return;
4459
4460
  }
4460
4461
  }
4461
- function Er(e, t, n) {
4462
+ function Rr(e, t, n) {
4462
4463
  if (!t || typeof e != "string") return;
4463
- const r = Bn(e, t);
4464
+ const r = qn(e, t);
4464
4465
  if (!(!r.ok || !r.value))
4465
4466
  return String(r.value.year) === M(n, t.calendar.tz || "UTC", "yyyy") ? void 0 : r.value.year;
4466
4467
  }
4467
- function Lc(e, t, n) {
4468
+ function Vc(e, t, n) {
4468
4469
  if (e === null) return "(Blank)";
4469
4470
  if (t && typeof e == "string") {
4470
- const r = Bn(e, t);
4471
+ const r = qn(e, t);
4471
4472
  if (r.ok && r.value) {
4472
- const { year: i, month: o, day: a, hour: s } = r.value, c = `${Cn[o - 1]} ${a}${Er(e, t, n) ? `, ${i}` : ""}`;
4473
+ const { year: i, month: o, day: a, hour: s } = r.value, c = `${Fn[o - 1]} ${a}${Rr(e, t, n) ? `, ${i}` : ""}`;
4473
4474
  switch (t.granularity) {
4474
4475
  case "year":
4475
4476
  case "quarter":
4476
- return Kc(e, t) ?? String(i);
4477
+ return Lc(e, t) ?? String(i);
4477
4478
  case "month":
4478
- return `${Cn[o - 1]} ${i}`;
4479
+ return `${Fn[o - 1]} ${i}`;
4479
4480
  case "week":
4480
4481
  return `Week of ${c}`;
4481
4482
  case "day":
@@ -4487,41 +4488,41 @@ function Lc(e, t, n) {
4487
4488
  }
4488
4489
  return String(e);
4489
4490
  }
4490
- function Rr(e, t, n) {
4491
- const r = e.label && !Er(e.value, t, n) ? e.label : Lc(e.value, t, n);
4491
+ function Kr(e, t, n) {
4492
+ const r = e.label && !Rr(e.value, t, n) ? e.label : Vc(e.value, t, n);
4492
4493
  return e.counted ? e.counted.status === "empty" ? `${r} (no days in the period)` : `${r} (${ie(e.counted.window, n)})` : r;
4493
4494
  }
4494
- function Kr(e, t) {
4495
- return e.values.map((n) => Rr(n, e.temporalBucket, t)).join(", ");
4495
+ function Lr(e, t) {
4496
+ return e.values.map((n) => Kr(n, e.temporalBucket, t)).join(", ");
4496
4497
  }
4497
- function Vc(e, t) {
4498
- return e.map((n) => Kr(n, t)).join(" and ");
4498
+ function Bc(e, t) {
4499
+ return e.map((n) => Lr(n, t)).join(" and ");
4499
4500
  }
4500
- function Lr(e, t) {
4501
+ function Vr(e, t) {
4501
4502
  if (!(!e.length || e.some((n) => {
4502
4503
  var r;
4503
4504
  return !((r = n.compared) != null && r.length);
4504
4505
  })))
4505
- return e.map((n) => n.compared.map((r) => Rr(r, n.temporalBucket, t)).join(", ")).join(" and ");
4506
+ return e.map((n) => n.compared.map((r) => Kr(r, n.temporalBucket, t)).join(", ")).join(" and ");
4506
4507
  }
4507
- function Bc(e, t) {
4508
- return e.relative ? Vn(e.relative).label : e.window ? ie(e.window, t) : "A date range";
4508
+ function qc(e, t) {
4509
+ return e.relative ? Bn(e.relative).label : e.window ? ie(e.window, t) : "A date range";
4509
4510
  }
4510
- const qc = {
4511
+ const Uc = {
4511
4512
  dashboard_filter: "Dashboard · Date filter",
4512
4513
  governing_date: "Dashboard · governing date, replaces the card",
4513
4514
  card: "This card"
4514
- }, Uc = {
4515
+ }, zc = {
4515
4516
  dashboard_filter: "Dashboard · Date filter",
4516
4517
  governing_date: "Dashboard · governing date",
4517
4518
  card: "This card"
4518
4519
  };
4519
- function zc(e) {
4520
+ function jc(e) {
4520
4521
  return e === "previous_year" ? "Previous year" : "Previous period";
4521
4522
  }
4522
- function Vr(e) {
4523
+ function Br(e) {
4523
4524
  if (!e.comparisonOff) return;
4524
- const t = zc(e.comparisonOff.kind), n = `No ${t.toLowerCase()}`;
4525
+ const t = jc(e.comparisonOff.kind), n = `No ${t.toLowerCase()}`;
4525
4526
  if (e.counted.kind === "no_date")
4526
4527
  return {
4527
4528
  note: "This dataset has no primary date. Drop a date on Trend By to count by date and compare periods.",
@@ -4547,15 +4548,15 @@ function Vr(e) {
4547
4548
  return;
4548
4549
  }
4549
4550
  }
4550
- const jc = {
4551
+ const Wc = {
4551
4552
  dashboard_and_card: "The dashboard's Date and the card's own window both apply. Remove the card's window to follow the dashboard.",
4552
4553
  dashboard: "Two dashboard date filters both apply: the number counts only where they overlap.",
4553
4554
  card: "This card's own date windows both apply: it counts only where they overlap."
4554
4555
  };
4555
- function Br(e, t) {
4556
+ function qr(e, t) {
4556
4557
  var r, i;
4557
4558
  const n = ((r = e.field) == null ? void 0 : r.name) ?? "";
4558
- return to(
4559
+ return no(
4559
4560
  {
4560
4561
  name: n,
4561
4562
  operation: t.operation,
@@ -4569,19 +4570,19 @@ function Br(e, t) {
4569
4570
  }
4570
4571
  );
4571
4572
  }
4572
- function Wc(e) {
4573
- return e.conditions.filter((t) => !t.conditional).map((t) => Br(e, t)).join(" and ");
4573
+ function Gc(e) {
4574
+ return e.conditions.filter((t) => !t.conditional).map((t) => qr(e, t)).join(" and ");
4574
4575
  }
4575
- const Gc = "narrowed by a condition group on this card";
4576
- function qr(e, t, n) {
4577
- const r = e.selections.length ? Vc(e.selections, t) : e.counted.kind === "window" ? n && e.overlap ? `${ie(e.counted.window, t)}, where they overlap` : ie(e.counted.window, t) : e.counted.kind === "empty" ? "No days: the windows share none" : e.counted.kind === "no_date" ? "All rows" : "", i = Wc(e), o = e.conditions.some((s) => s.conditional) ? Gc : "", a = [[r, i].filter(Boolean).join(", and "), o].filter(Boolean).join(", ");
4576
+ const Hc = "narrowed by a condition group on this card";
4577
+ function Ur(e, t, n) {
4578
+ const r = e.selections.length ? Bc(e.selections, t) : e.counted.kind === "window" ? n && e.overlap ? `${ie(e.counted.window, t)}, where they overlap` : ie(e.counted.window, t) : e.counted.kind === "empty" ? "No days: the windows share none" : e.counted.kind === "no_date" ? "All rows" : "", i = Gc(e), o = e.conditions.some((s) => s.conditional) ? Hc : "", a = [[r, i].filter(Boolean).join(", and "), o].filter(Boolean).join(", ");
4578
4579
  return a ? a.charAt(0).toUpperCase() + a.slice(1) : "All time";
4579
4580
  }
4580
- function $d(e, t = {}) {
4581
+ function Pd(e, t = {}) {
4581
4582
  var c, l, d;
4582
4583
  const n = t.now ?? /* @__PURE__ */ new Date(), r = e.windows.map((u) => ({
4583
- text: Bc(u, n),
4584
- from: u.applied ? qc[u.source] : `${Uc[u.source]} · not applied`,
4584
+ text: qc(u, n),
4585
+ from: u.applied ? Uc[u.source] : `${zc[u.source]} · not applied`,
4585
4586
  applied: u.applied
4586
4587
  }));
4587
4588
  for (const u of e.conditions)
@@ -4591,7 +4592,7 @@ function $d(e, t = {}) {
4591
4592
  from: "This card · see the card's filters",
4592
4593
  applied: !0
4593
4594
  } : {
4594
- text: Br(e, u),
4595
+ text: qr(e, u),
4595
4596
  from: u.source === "dashboard" ? "Dashboard · Date filter" : "This card",
4596
4597
  applied: !0
4597
4598
  }
@@ -4599,36 +4600,36 @@ function $d(e, t = {}) {
4599
4600
  for (const u of e.selections) {
4600
4601
  const f = (d = t.cardTitle) == null ? void 0 : d.call(t, u.sourceCardId);
4601
4602
  r.push({
4602
- text: Kr(u, n),
4603
+ text: Lr(u, n),
4603
4604
  from: f ? `Clicked on ${f}` : "Clicked on another card",
4604
4605
  applied: !0
4605
4606
  });
4606
4607
  }
4607
- const i = qr(e, n, !0), o = e.compared ? Lr(e.selections, n) ?? ie(e.compared.window, n) : void 0, a = Vr(e), s = e.overlap ? { tone: "warn", text: jc[e.overlap] } : a ? { tone: "muted", text: a.note } : void 0;
4608
+ const i = Ur(e, n, !0), o = e.compared ? Vr(e.selections, n) ?? ie(e.compared.window, n) : void 0, a = Br(e), s = e.overlap ? { tone: "warn", text: Wc[e.overlap] } : a ? { tone: "muted", text: a.note } : void 0;
4608
4609
  return {
4609
- ...e.field ? { field: { name: e.field.label || e.field.name, from: Rc[e.field.source] } } : {},
4610
+ ...e.field ? { field: { name: e.field.label || e.field.name, from: Kc[e.field.source] } } : {},
4610
4611
  windows: r,
4611
4612
  counts: i,
4612
4613
  ...o ? { compared: o } : {},
4613
4614
  ...s ? { note: s } : {}
4614
4615
  };
4615
4616
  }
4616
- function Pd(e, t = {}) {
4617
+ function Nd(e, t = {}) {
4617
4618
  var a;
4618
4619
  const n = t.now ?? /* @__PURE__ */ new Date(), r = e.counted.kind === "no_date" && !e.selections.length ? void 0 : {
4619
- text: !e.selections.length && e.counted.kind === "window" && e.counted.relative ? `${Vn(e.counted.relative).label} · ${ie(e.counted.window, n)}` : qr(e, n, !1),
4620
+ text: !e.selections.length && e.counted.kind === "window" && e.counted.relative ? `${Bn(e.counted.relative).label} · ${ie(e.counted.window, n)}` : Ur(e, n, !1),
4620
4621
  clicked: e.selections.length > 0
4621
- }, i = e.compared ? Lr(e.selections, n) ?? ie(e.compared.window, n) : void 0, o = (a = Vr(e)) == null ? void 0 : a.tile;
4622
+ }, i = e.compared ? Vr(e.selections, n) ?? ie(e.compared.window, n) : void 0, o = (a = Br(e)) == null ? void 0 : a.tile;
4622
4623
  return {
4623
4624
  ...r ? { period: r } : {},
4624
4625
  ...i ? { compared: i } : {},
4625
4626
  ...o ? { off: o } : {}
4626
4627
  };
4627
4628
  }
4628
- function Nd(e) {
4629
+ function Ed(e) {
4629
4630
  return e != null && e.field ? `Drop a date to trend by · counts on ${e.field.label || e.field.name} now` : void 0;
4630
4631
  }
4631
- const Hc = /* @__PURE__ */ new Set(["count", "sum", "avg", "min", "max", "median"]), Q = { kind: "unlistable", reason: "measure_not_listable" };
4632
+ const Yc = /* @__PURE__ */ new Set(["count", "sum", "avg", "min", "max", "median"]), Q = { kind: "unlistable", reason: "measure_not_listable" };
4632
4633
  function at(e) {
4633
4634
  const {
4634
4635
  aggregate: t,
@@ -4640,19 +4641,19 @@ function at(e) {
4640
4641
  } = e;
4641
4642
  return { ...a, role: "detail" };
4642
4643
  }
4643
- function Yc(e, t) {
4644
+ function Qc(e, t) {
4644
4645
  const n = t.trim();
4645
4646
  if (!n.startsWith("{") || !n.endsWith("}")) return;
4646
4647
  const r = n.slice(1, -1);
4647
4648
  return r.includes("{") || r.includes("}") ? void 0 : _t(e, r);
4648
4649
  }
4649
- function Qc(e, t, n) {
4650
+ function Xc(e, t, n) {
4650
4651
  if (!e.expression) return t.length === 1 ? at(t[0]) : void 0;
4651
4652
  if (!n) return;
4652
- const r = Yc(e, n);
4653
- return r ? at(r) : Xc(e, n);
4653
+ const r = Qc(e, n);
4654
+ return r ? at(r) : Jc(e, n);
4654
4655
  }
4655
- function Xc(e, t) {
4656
+ function Jc(e, t) {
4656
4657
  return {
4657
4658
  ...at(e),
4658
4659
  id: `${e.id}:row`,
@@ -4660,18 +4661,18 @@ function Xc(e, t) {
4660
4661
  calculatedFormula: { ...e.calculatedFormula, computeStage: "row" }
4661
4662
  };
4662
4663
  }
4663
- function Ur(e) {
4664
+ function zr(e) {
4664
4665
  return e.role === "metric" || !!e.aggregate;
4665
4666
  }
4666
- function zr(e) {
4667
+ function jr(e) {
4667
4668
  var t;
4668
4669
  return ((t = e.calculatedFormula) == null ? void 0 : t.inputFields) ?? [];
4669
4670
  }
4670
4671
  function _t(e, t) {
4671
4672
  if (t.startsWith("field_"))
4672
- return zr(e)[Number(t.slice(6))];
4673
+ return jr(e)[Number(t.slice(6))];
4673
4674
  }
4674
- function Fn(e, t) {
4675
+ function Sn(e, t) {
4675
4676
  const n = [];
4676
4677
  for (const r of new Set(t)) {
4677
4678
  const i = _t(e, r);
@@ -4680,28 +4681,28 @@ function Fn(e, t) {
4680
4681
  }
4681
4682
  return n;
4682
4683
  }
4683
- function Jc(e, t) {
4684
+ function Zc(e, t) {
4684
4685
  if (!e.expression)
4685
4686
  return { fields: e.name === "*" ? [] : [e] };
4686
4687
  const n = yt(e.expression);
4687
4688
  if (t === "row") {
4688
- const i = Fn(e, n.tokensOutsideAggregates);
4689
+ const i = Sn(e, n.tokensOutsideAggregates);
4689
4690
  return i === "unknown" ? i : { fields: i, rowExpression: e.expression };
4690
4691
  }
4691
4692
  if (n.calls.length === 1) {
4692
4693
  if (n.nestedAggregate || !n.aggregateInputsComplete) return "unknown";
4693
- const [i] = n.calls, o = va(e.expression, i);
4694
+ const [i] = n.calls, o = Ia(e.expression, i);
4694
4695
  if (o === void 0) return "unknown";
4695
- const a = Fn(e, i.tokens);
4696
+ const a = Sn(e, i.tokens);
4696
4697
  return a === "unknown" ? a : { fields: a, rowExpression: o };
4697
4698
  }
4698
- const r = n.tokensOutsideAggregates.map((i) => _t(e, i)).filter((i) => !!(i && Ur(i)));
4699
+ const r = n.tokensOutsideAggregates.map((i) => _t(e, i)).filter((i) => !!(i && zr(i)));
4699
4700
  return n.calls.length === 0 && r.length === 1 ? { delegate: r[0] } : "unknown";
4700
4701
  }
4701
- function Zc(e, t) {
4702
+ function el(e, t) {
4702
4703
  return !e.expression || t === "row" ? !0 : yt(e.expression).skeleton.trim() === "@0";
4703
4704
  }
4704
- function Sn(e) {
4705
+ function wn(e) {
4705
4706
  var n;
4706
4707
  const t = (r) => !!(r && ((r.conditions ?? []).length > 0 || (r.groups ?? []).some(t)));
4707
4708
  return t((n = e.parameters) == null ? void 0 : n.filters);
@@ -4710,28 +4711,28 @@ function ot(e) {
4710
4711
  var s;
4711
4712
  if ((s = e.parameters) != null && s.windowTransform)
4712
4713
  return { kind: "unlistable", reason: "table_calculation" };
4713
- const t = ba(e);
4714
+ const t = va(e);
4714
4715
  if (t.windowed || t.unresolved || t.calls.length === 0)
4715
4716
  return Q;
4716
4717
  if (t.calls.length > 1) {
4717
- if (Sn(e)) return Q;
4718
- const c = zr(e).filter(Ur);
4718
+ if (wn(e)) return Q;
4719
+ const c = jr(e).filter(zr);
4719
4720
  return c.length > 0 ? { kind: "calculation", inputs: c } : Q;
4720
4721
  }
4721
- const [n] = t.calls, r = Jc(e, t.stage);
4722
+ const [n] = t.calls, r = Zc(e, t.stage);
4722
4723
  if (r === "unknown") return Q;
4723
4724
  if ("delegate" in r) {
4724
- if (Sn(r.delegate)) return Q;
4725
+ if (wn(r.delegate)) return Q;
4725
4726
  const c = ot(r.delegate);
4726
4727
  return "valueIsTheAggregate" in c ? { ...c, valueIsTheAggregate: !1 } : c;
4727
4728
  }
4728
- const { fields: i } = r, o = Zc(e, t.stage);
4729
+ const { fields: i } = r, o = el(e, t.stage);
4729
4730
  if (n.kind === "count" && i.length === 0) return { kind: "rowCount", valueIsTheAggregate: o };
4730
4731
  if (i.length === 0) return Q;
4731
- const a = Qc(e, i, r.rowExpression);
4732
- return a ? n.kind === "count_distinct" ? { kind: "distinct", rowField: a, valueIsTheAggregate: o } : Hc.has(n.kind) ? { kind: "rows", aggregate: n.kind, rowField: a, valueIsTheAggregate: o } : Q : Q;
4732
+ const a = Xc(e, i, r.rowExpression);
4733
+ return a ? n.kind === "count_distinct" ? { kind: "distinct", rowField: a, valueIsTheAggregate: o } : Yc.has(n.kind) ? { kind: "rows", aggregate: n.kind, rowField: a, valueIsTheAggregate: o } : Q : Q;
4733
4734
  }
4734
- const el = {
4735
+ const tl = {
4735
4736
  switched_off: "This card doesn't show its records.",
4736
4737
  sql_card: "Not available on cards written in SQL.",
4737
4738
  unsupported_visual: "This visual doesn't show its records.",
@@ -4743,47 +4744,47 @@ const el = {
4743
4744
  records_repeat: "Each record appears more than once in this card's data, so its records can't be listed yet."
4744
4745
  }, st = { available: !0 };
4745
4746
  function X(e) {
4746
- return { available: !1, reason: e, message: el[e] };
4747
+ return { available: !1, reason: e, message: tl[e] };
4747
4748
  }
4748
- function jr(e) {
4749
+ function Wr(e) {
4749
4750
  return e ? (e.conditions ?? []).some(
4750
- (t) => no(t.field)
4751
- ) || (e.groups ?? []).some(jr) : !1;
4751
+ (t) => ro(t.field)
4752
+ ) || (e.groups ?? []).some(Wr) : !1;
4752
4753
  }
4753
- function tl(e, t) {
4754
+ function nl(e, t) {
4754
4755
  var r, i, o;
4755
4756
  return (((o = (i = (r = e.config) == null ? void 0 : r.matrix) == null ? void 0 : i.spec) == null ? void 0 : o.measureFilters) ?? []).some((a) => {
4756
4757
  var s;
4757
4758
  return !((s = t.matrixLevelIds) != null && s.includes(a.levelId));
4758
4759
  });
4759
4760
  }
4760
- function nl(e, t) {
4761
+ function rl(e, t) {
4761
4762
  var r;
4762
4763
  if (t.measure.kind !== "metric") return;
4763
4764
  const { resultId: n } = t.measure;
4764
4765
  return (((r = e.config) == null ? void 0 : r.metricColumns) ?? []).find(
4765
- (i) => i.id === n || sa(i) === n
4766
+ (i) => i.id === n || ca(i) === n
4766
4767
  );
4767
4768
  }
4768
- function rl(e, t) {
4769
- return e.seeRecords === !1 ? X("switched_off") : aa(e.type) ? oa(e) !== "config" ? X("sql_card") : t.isCurrentQueryResult ? st : X("card_updating") : X("unsupported_visual");
4769
+ function il(e, t) {
4770
+ return e.seeRecords === !1 ? X("switched_off") : oa(e.type) ? sa(e) !== "config" ? X("sql_card") : t.isCurrentQueryResult ? st : X("card_updating") : X("unsupported_visual");
4770
4771
  }
4771
- function Ed(e, t, n) {
4772
+ function Rd(e, t, n) {
4772
4773
  var a;
4773
- const r = rl(e, n);
4774
+ const r = il(e, n);
4774
4775
  if (!r.available) return r;
4775
4776
  if (t.comparison) return X("comparison_value");
4776
- if (e.type === "matrixTable" ? tl(e, t) : (t.kind === "subtotal" || t.kind === "grandTotal") && jr((a = e.config) == null ? void 0 : a.filters))
4777
+ if (e.type === "matrixTable" ? nl(e, t) : (t.kind === "subtotal" || t.kind === "grandTotal") && Wr((a = e.config) == null ? void 0 : a.filters))
4777
4778
  return X("total_under_measure_filter");
4778
- const i = nl(e, t);
4779
+ const i = rl(e, t);
4779
4780
  if (!i) return st;
4780
4781
  const o = ot(i);
4781
4782
  return o.kind === "unlistable" ? X(o.reason) : o.kind === "calculation" && o.inputs.every((s) => ot(s).kind === "unlistable") ? X("measure_not_listable") : st;
4782
4783
  }
4783
- function Rd(e) {
4784
+ function Kd(e) {
4784
4785
  return e === "switched_off" || e === "unsupported_visual";
4785
4786
  }
4786
- function Kd(e, t) {
4787
+ function Ld(e, t) {
4787
4788
  var i, o;
4788
4789
  const n = (i = t == null ? void 0 : t.find(
4789
4790
  (a) => a.filterId === e.id
@@ -4793,11 +4794,11 @@ function Kd(e, t) {
4793
4794
  ]);
4794
4795
  return n && r.has(n) ? n : e.column;
4795
4796
  }
4796
- function Ld(e, t, n) {
4797
- const r = ca({ card: e, stated: t, context: n });
4798
- return r.ok ? { ok: !0, card: r.update ? la(e, r.update).card : e, warnings: r.warnings } : r;
4797
+ function Vd(e, t, n) {
4798
+ const r = la({ card: e, stated: t, context: n });
4799
+ return r.ok ? { ok: !0, card: r.update ? da(e, r.update).card : e, warnings: r.warnings } : r;
4799
4800
  }
4800
- function Vd({
4801
+ function Bd({
4801
4802
  resolvedCardConfig: e,
4802
4803
  card: t,
4803
4804
  row: n,
@@ -4807,31 +4808,32 @@ function Vd({
4807
4808
  }) {
4808
4809
  const a = e || t.config, { groupByColumns: s = [], metricColumns: c = [], detailColumns: l = [] } = a || {}, d = t.type === "detailTable", u = d ? "detail" : "groupby", f = d ? l : s, m = d ? [] : c, p = [];
4809
4810
  for (const h of f) {
4810
- const g = r ? Xe(r, h.id, u) : void 0, I = (g == null ? void 0 : g.outputKey) || (g == null ? void 0 : g.rawKey) || h.label, v = n.getValue(I), C = i == null ? void 0 : i.byColumnKey.get(I);
4811
+ const g = r ? Xe(r, h.id, u) : void 0, C = (g == null ? void 0 : g.outputKey) || (g == null ? void 0 : g.rawKey) || h.label, v = n.getValue(C), I = i == null ? void 0 : i.byColumnKey.get(C);
4811
4812
  if (v == null)
4812
4813
  p.push({
4813
- field: h,
4814
+ field: Yt(h, I == null ? void 0 : I.metadata),
4814
4815
  operator: "isNull",
4815
4816
  value: null,
4816
4817
  label: "(Blank)",
4817
- ...C ? { temporalBucket: C.metadata } : {}
4818
+ ...I ? { temporalBucket: I.metadata } : {}
4818
4819
  });
4819
4820
  else {
4820
- const b = C || o == null ? void 0 : o.byColumnKey.get(I);
4821
+ const b = I || o == null ? void 0 : o.byColumnKey.get(C);
4821
4822
  p.push({
4822
- field: h,
4823
+ // DG-D6: a Group by date leaves the card as it ran, never with grainMode.
4824
+ field: Yt(h, I == null ? void 0 : I.metadata),
4823
4825
  operator: "=",
4824
4826
  value: String(v),
4825
4827
  // Convert to string for consistency
4826
- ...C ? {
4827
- label: ua({
4828
+ ...I ? {
4829
+ label: fa({
4828
4830
  value: String(v),
4829
- presentation: C
4831
+ presentation: I
4830
4832
  }),
4831
- temporalBucket: C.metadata
4833
+ temporalBucket: I.metadata
4832
4834
  } : {},
4833
4835
  ...b ? {
4834
- label: da({ value: String(v), presentation: b }).label,
4836
+ label: ua({ value: String(v), presentation: b }).label,
4835
4837
  rawTemporal: { ...b.metadata, tz: b.format.calendarTimezone }
4836
4838
  } : {}
4837
4839
  });
@@ -4841,12 +4843,12 @@ function Vd({
4841
4843
  return;
4842
4844
  const y = [];
4843
4845
  for (const h of m) {
4844
- const g = r ? Xe(r, h.id, "metric") : void 0, I = n.getValue(
4846
+ const g = r ? Xe(r, h.id, "metric") : void 0, C = n.getValue(
4845
4847
  (g == null ? void 0 : g.outputKey) || (g == null ? void 0 : g.rawKey) || h.label
4846
4848
  );
4847
- I != null && y.push({
4849
+ C != null && y.push({
4848
4850
  field: h,
4849
- value: Number(I)
4851
+ value: Number(C)
4850
4852
  // Convert to number for metrics
4851
4853
  });
4852
4854
  }
@@ -4856,7 +4858,7 @@ function Vd({
4856
4858
  metrics: y.length > 0 ? y : void 0
4857
4859
  };
4858
4860
  }
4859
- function Bd({
4861
+ function qd({
4860
4862
  resolvedCardConfig: e,
4861
4863
  card: t,
4862
4864
  columnId: n,
@@ -4868,7 +4870,7 @@ function Bd({
4868
4870
  return ((l == null ? void 0 : l.outputKey) || (l == null ? void 0 : l.rawKey) || c.label) === n;
4869
4871
  });
4870
4872
  }
4871
- const il = {
4873
+ const al = {
4872
4874
  noFields: "There is nothing to filter by here.",
4873
4875
  clickedColumnNotFilterable: "This column cannot filter other cards.",
4874
4876
  noChosenColumns: "This column is not set up to filter other cards.",
@@ -4876,9 +4878,9 @@ const il = {
4876
4878
  unsupportedCondition: "This value cannot filter other cards."
4877
4879
  };
4878
4880
  function We(e) {
4879
- return { status: "unavailable", code: e, reason: il[e] };
4881
+ return { status: "unavailable", code: e, reason: al[e] };
4880
4882
  }
4881
- function qd(e) {
4883
+ function Ud(e) {
4882
4884
  const t = e.conditions.filter(
4883
4885
  (s) => s.field.role !== "metric"
4884
4886
  );
@@ -4886,7 +4888,7 @@ function qd(e) {
4886
4888
  const n = (s) => {
4887
4889
  if (s.operator !== "=" && s.operator !== "isNull")
4888
4890
  return "unsupportedCondition";
4889
- const c = Yt(
4891
+ const c = Qt(
4890
4892
  s.field,
4891
4893
  e.sourceIndex
4892
4894
  );
@@ -4908,7 +4910,7 @@ function qd(e) {
4908
4910
  i.push(c);
4909
4911
  }
4910
4912
  else {
4911
- const s = r.kind === "clickedCell" && e.clickedField ? Yt(e.clickedField, e.sourceIndex) : void 0, c = r.kind === "chosenColumns" ? r.clickedFieldKeys : s ? [Le(s)] : [];
4913
+ const s = r.kind === "clickedCell" && e.clickedField ? Qt(e.clickedField, e.sourceIndex) : void 0, c = r.kind === "chosenColumns" ? r.clickedFieldKeys : s ? [Le(s)] : [];
4912
4914
  for (const l of t) {
4913
4915
  const d = n(l);
4914
4916
  typeof d != "string" && c.includes(Le(d.field)) && i.push(d);
@@ -4924,11 +4926,11 @@ function qd(e) {
4924
4926
  return o.has(c) ? !1 : (o.add(c), !0);
4925
4927
  }) } };
4926
4928
  }
4927
- function Ud(e, t) {
4929
+ function zd(e, t) {
4928
4930
  const n = e.answers.relationshipIds;
4929
4931
  return !n || !t ? !n && !t : n.length === t.length && n.every((r, i) => t[i] === r);
4930
4932
  }
4931
- const al = /* @__PURE__ */ new Set([
4933
+ const ol = /* @__PURE__ */ new Set([
4932
4934
  "dataset_not_reachable",
4933
4935
  "field_not_resolvable",
4934
4936
  "missing_metadata",
@@ -4940,15 +4942,15 @@ const al = /* @__PURE__ */ new Set([
4940
4942
  function W(e) {
4941
4943
  return !!e && typeof e == "object" && !Array.isArray(e);
4942
4944
  }
4943
- function ol(e) {
4945
+ function sl(e) {
4944
4946
  if (W(e))
4945
4947
  switch (e.status) {
4946
4948
  case "applied": {
4947
- const t = Hn(e.route);
4949
+ const t = Yn(e.route);
4948
4950
  return t ? { status: "applied", route: t } : void 0;
4949
4951
  }
4950
4952
  case "skipped":
4951
- return typeof e.reason == "string" && al.has(e.reason) ? { status: "skipped", reason: e.reason } : void 0;
4953
+ return typeof e.reason == "string" && ol.has(e.reason) ? { status: "skipped", reason: e.reason } : void 0;
4952
4954
  case "needsPath":
4953
4955
  return { status: "needsPath" };
4954
4956
  case "blocked":
@@ -4961,22 +4963,22 @@ function ol(e) {
4961
4963
  return;
4962
4964
  }
4963
4965
  }
4964
- function Wr(e) {
4966
+ function Gr(e) {
4965
4967
  if (e !== void 0)
4966
4968
  return Array.isArray(e) && e.length > 0 && e.every((t) => typeof t == "string" && t.length > 0) ? e : null;
4967
4969
  }
4968
- function sl(e) {
4970
+ function cl(e) {
4969
4971
  if (!W(e)) return;
4970
- const t = Hn(e.route), n = e.target;
4971
- if (!(!t || !W(n) || n.kind !== "relationship" || !W(n.field) || typeof n.field.name != "string" || !W(n.field.source) || n.field.source.kind !== "semantic" || !Wr(n.relationshipIds)))
4972
+ const t = Yn(e.route), n = e.target;
4973
+ if (!(!t || !W(n) || n.kind !== "relationship" || !W(n.field) || typeof n.field.name != "string" || !W(n.field.source) || n.field.source.kind !== "semantic" || !Gr(n.relationshipIds)))
4972
4974
  return { route: t, target: n };
4973
4975
  }
4974
- function zd(e) {
4976
+ function jd(e) {
4975
4977
  if (!W(e) || !Array.isArray(e.previews)) return { previews: [] };
4976
4978
  const t = [];
4977
4979
  for (const r of e.previews) {
4978
4980
  if (!W(r) || typeof r.cardId != "string" || !r.cardId || !W(r.answers)) continue;
4979
- const i = Wr(r.answers.relationshipIds), o = ol(r.outcome), a = Array.isArray(r.paths) ? r.paths.map(sl) : [];
4981
+ const i = Gr(r.answers.relationshipIds), o = sl(r.outcome), a = Array.isArray(r.paths) ? r.paths.map(cl) : [];
4980
4982
  i === null || !o || !a.every(Boolean) || o.status === "needsPath" && a.length < 2 || t.push({
4981
4983
  cardId: r.cardId,
4982
4984
  answers: i ? { relationshipIds: i } : {},
@@ -4988,18 +4990,18 @@ function zd(e) {
4988
4990
  return { previews: t, ...n ? { manageRelationships: n } : {} };
4989
4991
  }
4990
4992
  const Se = (e) => (e == null ? void 0 : e.label) || (e == null ? void 0 : e.name) || "";
4991
- function cl(e) {
4993
+ function ll(e) {
4992
4994
  return !e || /s$/i.test(e) ? e : /[^aeiou]y$/i.test(e) ? `${e.slice(0, -1)}ies` : `${e}s`;
4993
4995
  }
4994
- function wn(e) {
4996
+ function xn(e) {
4995
4997
  if (e.direction === "to_many") {
4996
4998
  const n = Se(e.matchingDataset ?? e.datasets[e.datasets.length - 1]);
4997
- return `${e.base ? cl(Se(e.base)) : "Rows"} with at least one matching ${n}`;
4999
+ return `${e.base ? ll(Se(e.base)) : "Rows"} with at least one matching ${n}`;
4998
5000
  }
4999
5001
  return `through ${(e.datasets.length > 1 ? e.datasets.slice(0, -1) : e.datasets).map(Se).join(", ")}`;
5000
5002
  }
5001
- const jd = "The relationship this card used changed; choose it again";
5002
- function ll(e, t) {
5003
+ const Wd = "The relationship this card used changed; choose it again";
5004
+ function dl(e, t) {
5003
5005
  switch (e) {
5004
5006
  case "relationship_missing":
5005
5007
  return t ? `Not related to ${Se(t)}` : "Not related to this card";
@@ -5016,16 +5018,16 @@ function ll(e, t) {
5016
5018
  return String(e);
5017
5019
  }
5018
5020
  }
5019
- function Wd(e) {
5021
+ function Gd(e) {
5020
5022
  if (e)
5021
5023
  switch (e.status) {
5022
5024
  case "applied":
5023
5025
  return e.through ? {
5024
5026
  tone: "muted",
5025
- text: e.through.direction === "to_one" ? `Filtered ${wn(e.through)}` : wn(e.through)
5027
+ text: e.through.direction === "to_one" ? `Filtered ${xn(e.through)}` : xn(e.through)
5026
5028
  } : void 0;
5027
5029
  case "skipped":
5028
- return { tone: "attention", text: ll(e.reason) };
5030
+ return { tone: "attention", text: dl(e.reason) };
5029
5031
  case "blocked":
5030
5032
  return { tone: "attention", text: e.message };
5031
5033
  default:
@@ -5033,158 +5035,158 @@ function Wd(e) {
5033
5035
  }
5034
5036
  }
5035
5037
  export {
5036
- jd as $,
5037
- zo as A,
5038
- Jo as B,
5039
- Oc as C,
5040
- Xs as D,
5041
- Ac as E,
5042
- $c as F,
5043
- _d as G,
5044
- In as H,
5045
- Md as I,
5046
- Od as J,
5047
- Ad as K,
5048
- $d as L,
5049
- Pd as M,
5050
- jo as N,
5051
- Nd as O,
5038
+ Wd as $,
5039
+ jo as A,
5040
+ Zo as B,
5041
+ Ac as C,
5042
+ Js as D,
5043
+ $c as E,
5044
+ Pc as F,
5045
+ Md as G,
5046
+ Cn as H,
5047
+ Od as I,
5048
+ Ad as J,
5049
+ $d as K,
5050
+ Pd as L,
5051
+ Nd as M,
5052
+ Wo as N,
5053
+ Ed as O,
5052
5054
  at as P,
5053
5055
  ot as Q,
5054
- jr as R,
5055
- el as S,
5056
- rl as T,
5057
- Ed as U,
5058
- Rd as V,
5059
- Ld as W,
5060
- Ud as X,
5061
- zd as Y,
5062
- cl as Z,
5063
- wn as _,
5064
- Sd as a,
5065
- Dd as a$,
5066
- ll as a0,
5067
- Wd as a1,
5068
- Ho as a2,
5056
+ Wr as R,
5057
+ tl as S,
5058
+ il as T,
5059
+ Rd as U,
5060
+ Kd as V,
5061
+ Vd as W,
5062
+ zd as X,
5063
+ jd as Y,
5064
+ ll as Z,
5065
+ xn as _,
5066
+ wd as a,
5067
+ kd as a$,
5068
+ dl as a0,
5069
+ Gd as a1,
5070
+ Yo as a2,
5069
5071
  kt as a3,
5070
- Ro as a4,
5071
- uo as a5,
5072
- fo as a6,
5072
+ Ko as a4,
5073
+ fo as a5,
5074
+ mo as a6,
5073
5075
  Ae as a7,
5074
- Rl as a8,
5075
- ad as a9,
5076
- Ql as aA,
5076
+ Kl as a8,
5077
+ od as a9,
5078
+ Xl as aA,
5077
5079
  j as aB,
5078
5080
  Ze as aC,
5079
- _o as aD,
5080
- Bl as aE,
5081
- ql as aF,
5082
- Td as aG,
5083
- Ul as aH,
5084
- sr as aI,
5085
- El as aJ,
5086
- Ko as aK,
5087
- ao as aL,
5088
- Al as aM,
5089
- Yn as aN,
5090
- mo as aO,
5081
+ Mo as aD,
5082
+ ql as aE,
5083
+ Ul as aF,
5084
+ Dd as aG,
5085
+ zl as aH,
5086
+ cr as aI,
5087
+ Rl as aJ,
5088
+ Lo as aK,
5089
+ oo as aL,
5090
+ $l as aM,
5091
+ Qn as aN,
5092
+ po as aO,
5091
5093
  vt as aP,
5092
- Kl as aQ,
5093
- Ll as aR,
5094
+ Ll as aQ,
5095
+ Vl as aR,
5094
5096
  _e as aS,
5095
5097
  pe as aT,
5096
- $l as aU,
5097
- Bd as aV,
5098
- zl as aW,
5099
- Is as aX,
5098
+ Pl as aU,
5099
+ qd as aV,
5100
+ jl as aW,
5101
+ Cs as aX,
5100
5102
  B as aY,
5101
- od as aZ,
5102
- Dr as a_,
5103
- Pl as aa,
5104
- as as ab,
5105
- ss as ac,
5103
+ sd as aZ,
5104
+ kr as a_,
5105
+ Nl as aa,
5106
+ os as ab,
5107
+ cs as ac,
5106
5108
  D as ad,
5107
- rc as ae,
5108
- ps as af,
5109
- rd as ag,
5110
- fd as ah,
5111
- dd as ai,
5112
- co as aj,
5113
- oo as ak,
5114
- so as al,
5109
+ ic as ae,
5110
+ hs as af,
5111
+ id as ag,
5112
+ md as ah,
5113
+ ud as ai,
5114
+ lo as aj,
5115
+ so as ak,
5116
+ co as al,
5115
5117
  ke as am,
5116
- Xl as an,
5118
+ Jl as an,
5117
5119
  Ft as ao,
5118
- Vl as ap,
5119
- Wl as aq,
5120
- Hl as ar,
5121
- Gl as as,
5120
+ Bl as ap,
5121
+ Gl as aq,
5122
+ Yl as ar,
5123
+ Hl as as,
5122
5124
  It as at,
5123
- ko as au,
5124
- jl as av,
5125
- Yl as aw,
5126
- vo as ax,
5127
- Ao as ay,
5128
- $o as az,
5129
- Dc as b,
5130
- Nr as b0,
5131
- bd as b1,
5132
- Ic as b2,
5125
+ _o as au,
5126
+ Wl as av,
5127
+ Ql as aw,
5128
+ Io as ax,
5129
+ $o as ay,
5130
+ Po as az,
5131
+ kc as b,
5132
+ Er as b0,
5133
+ vd as b1,
5134
+ Cc as b2,
5133
5135
  fe as b3,
5134
5136
  Dt as b4,
5135
- hd as b5,
5136
- vd as b6,
5137
- gd as b7,
5138
- gc as b8,
5139
- _c as b9,
5140
- Fd as ba,
5141
- Cd as bb,
5142
- yd as bc,
5143
- vc as bd,
5144
- id as be,
5145
- rs as bf,
5146
- Do as bg,
5147
- kd as bh,
5148
- vn as bi,
5149
- os as bj,
5150
- kc as bk,
5151
- ud as bl,
5152
- tc as bm,
5153
- wd as bn,
5154
- Tc as bo,
5137
+ gd as b5,
5138
+ Id as b6,
5139
+ yd as b7,
5140
+ yc as b8,
5141
+ Mc as b9,
5142
+ Sd as ba,
5143
+ Fd as bb,
5144
+ bd as bc,
5145
+ Ic as bd,
5146
+ ad as be,
5147
+ is as bf,
5148
+ ko as bg,
5149
+ _d as bh,
5150
+ In as bi,
5151
+ ss as bj,
5152
+ _c as bk,
5153
+ fd as bl,
5154
+ nc as bm,
5155
+ xd as bn,
5156
+ Dc as bo,
5155
5157
  de as bp,
5156
- sd as bq,
5157
- hs as br,
5158
- cd as bs,
5159
- dn as bt,
5160
- gs as bu,
5161
- xr as bv,
5162
- wr as bw,
5163
- qs as bx,
5164
- md as by,
5165
- Nl as bz,
5166
- yn as c,
5158
+ cd as bq,
5159
+ gs as br,
5160
+ ld as bs,
5161
+ un as bt,
5162
+ ys as bu,
5163
+ Tr as bv,
5164
+ xr as bw,
5165
+ Us as bx,
5166
+ pd as by,
5167
+ El as bz,
5168
+ bn as c,
5167
5169
  ie as d,
5168
- Kd as e,
5169
- pd as f,
5170
- xd as g,
5171
- ys as h,
5172
- nd as i,
5173
- ld as j,
5174
- td as k,
5175
- ed as l,
5176
- Cc as m,
5177
- Cs as n,
5178
- Fs as o,
5179
- Vd as p,
5180
- Lo as q,
5181
- Id as r,
5182
- qd as s,
5183
- Bo as t,
5184
- qo as u,
5185
- es as v,
5186
- Jl as w,
5187
- cr as x,
5188
- Uo as y,
5189
- Zl as z
5170
+ Ld as e,
5171
+ hd as f,
5172
+ Td as g,
5173
+ bs as h,
5174
+ rd as i,
5175
+ dd as j,
5176
+ nd as k,
5177
+ td as l,
5178
+ Fc as m,
5179
+ Fs as n,
5180
+ Ss as o,
5181
+ Bd as p,
5182
+ Vo as q,
5183
+ Cd as r,
5184
+ Ud as s,
5185
+ qo as t,
5186
+ Uo as u,
5187
+ ts as v,
5188
+ Zl as w,
5189
+ lr as x,
5190
+ zo as y,
5191
+ ed as z
5190
5192
  };