react-semaphor 0.1.568 → 0.1.569

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 (126) hide show
  1. package/README.md +0 -7
  2. package/dist/analytics-protocol/index.js +434 -454
  3. package/dist/assistant-context/index.js +1 -1
  4. package/dist/brand-studio/index.js +10 -12
  5. package/dist/briefings/index.js +4 -4
  6. package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → _commonjsHelpers-Bid1ZNYj.js} +271 -222
  7. package/dist/chunks/{assistant-chat-BN5I8KuN.js → assistant-chat-Dzf2Mbph.js} +107 -109
  8. package/dist/chunks/{bookmark-impact-CJ-65omV.js → bookmark-impact-Czg6FGt5.js} +2 -2
  9. package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
  10. package/dist/chunks/{card-filter-builder-BBuB99GZ.js → card-filter-builder-BS982X7x.js} +986 -985
  11. package/dist/chunks/{code-editor-DJNOsgJH.js → code-editor-BsxHzm9u.js} +43 -45
  12. package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-lLTgzOkM.js} +252 -253
  13. package/dist/chunks/{dashboard-YnWZC4dK.js → dashboard-BiYSbxZv.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-BF89TU2h.js → dashboard-briefing-launcher-Bdj7luOr.js} +158 -159
  15. package/dist/chunks/{dashboard-controls-atHc1EjP.js → dashboard-controls-TViDsnb8.js} +17 -19
  16. package/dist/chunks/dashboard-json-Dg9dQd9U.js +66 -0
  17. package/dist/chunks/{dates-CKO05ino.js → dates-BsPrWZIP.js} +8 -8
  18. package/dist/chunks/{edit-dashboard-visual-DdmTfn-J.js → edit-dashboard-visual-C6hoIeEJ.js} +20 -21
  19. package/dist/chunks/{filter-reach-copy-jZGzK_IH.js → filter-reach-copy-hcQ4os0u.js} +695 -699
  20. package/dist/chunks/filter-value-text-CVxEEDVl.js +146 -0
  21. package/dist/chunks/{index-CPNZW0mu.js → index-G4q89J6O.js} +74 -76
  22. package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-BIcoFfdS.js} +1 -1
  23. package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C6tYkHyv.js} +1 -1
  24. package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
  25. package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
  26. package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
  27. package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
  28. package/dist/chunks/{palette-4vf2BEEg.js → palette-NjHOE_6B.js} +1 -1
  29. package/dist/chunks/pivot-result-contract-expectations-DkmueDTW.js +55 -0
  30. package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
  31. package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
  32. package/dist/chunks/{report-preferences-dialog-Mbd-I0wV.js → report-preferences-dialog-Xc8_GFju.js} +26 -28
  33. package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
  34. package/dist/chunks/{resolve-dashboard-input-context-Du0fjN3h.js → resolve-dashboard-input-context-KqvcLcTM.js} +4784 -4764
  35. package/dist/chunks/{save-D6pHmSSP.js → save-C6VmEJTA.js} +1 -1
  36. package/dist/chunks/{saved-dashboard-context-y8N6RvjS.js → saved-dashboard-context-BeXXyoD4.js} +6 -6
  37. package/dist/chunks/{semaphor-ready-indicator-BSEdUq40.js → semaphor-ready-indicator-BNkaANsG.js} +28395 -28384
  38. package/dist/chunks/{shelf-drop-preview-context-D7QqPl36.js → shelf-drop-preview-context-C_issPBA.js} +18 -20
  39. package/dist/chunks/{stored-dashboard-d3xQYxBD.js → stored-dashboard-B6_StAty.js} +263 -265
  40. package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-BWP2joD1.js} +1 -1
  41. package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-scSWQXAB.js} +4 -4
  42. package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
  43. package/dist/chunks/{upload-Cf3wXZT8.js → upload-BRW4Mwrd.js} +1 -1
  44. package/dist/chunks/validators-B8fpdinG.js +3651 -0
  45. package/dist/chunks/{variable-draft-DOX03R4A.js → variable-draft-BQ3OMjvy.js} +4 -4
  46. package/dist/dashboard/index.js +2 -2
  47. package/dist/dashboard-authoring/index.js +1527 -1517
  48. package/dist/format-utils/index.js +230 -231
  49. package/dist/index.js +236 -237
  50. package/dist/report-runtime-context/index.js +1 -1
  51. package/dist/style.css +1 -1
  52. package/dist/surfboard/index.js +2 -2
  53. package/dist/types/components/surfboard/filter/types.d.ts +5 -4
  54. package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
  55. package/dist/types/index.js +9 -9
  56. package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
  57. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  58. package/dist/types/lib/types/explorer-types.d.ts +2 -2
  59. package/dist/types/lib/types/index.d.ts +1 -1
  60. package/dist/types/lib/utils/card-definition.d.ts +7 -7
  61. package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
  62. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
  63. package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
  64. package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
  65. package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
  66. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +4 -4
  67. package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
  68. package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
  69. package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
  70. package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
  71. package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
  72. package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
  73. package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
  74. package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
  75. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
  76. package/dist/types/shared/assistant-protocol/context.d.ts +12 -12
  77. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
  78. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +155 -1753
  79. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
  80. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +74 -74
  81. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
  82. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +3 -0
  83. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
  84. package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
  85. package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
  86. package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
  87. package/dist/types/shared/temporal/index.d.ts +0 -2
  88. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
  89. package/package.json +2 -24
  90. package/DATA_APP_SDK.md +0 -339
  91. package/dist/chunks/dashboard-json-Cxp3inxd.js +0 -68
  92. package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
  93. package/dist/chunks/index-CuHybtft.js +0 -51
  94. package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
  95. package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
  96. package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
  97. package/dist/chunks/operators-B3zZoskU.js +0 -66
  98. package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
  99. package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
  100. package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
  101. package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
  102. package/dist/chunks/validators-wtjw0aw6.js +0 -3332
  103. package/dist/data-app-sdk/index.js +0 -1412
  104. package/dist/data-app-sdk-adapters/index.js +0 -361
  105. package/dist/data-app-sdk-validation/index.js +0 -1031
  106. package/dist/types/data-app-sdk/adapters.d.ts +0 -35
  107. package/dist/types/data-app-sdk/builders.d.ts +0 -62
  108. package/dist/types/data-app-sdk/contracts.d.ts +0 -419
  109. package/dist/types/data-app-sdk/executor.d.ts +0 -5
  110. package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
  111. package/dist/types/data-app-sdk/hooks.d.ts +0 -11
  112. package/dist/types/data-app-sdk/index.d.ts +0 -9
  113. package/dist/types/data-app-sdk/provider.d.ts +0 -8
  114. package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
  115. package/dist/types/data-app-sdk/selection.d.ts +0 -2
  116. package/dist/types/data-app-sdk/validation.d.ts +0 -58
  117. package/dist/types/data-app-sdk-adapters.d.ts +0 -2
  118. package/dist/types/data-app-sdk-validation.d.ts +0 -2
  119. package/dist/types/data-app-sdk.d.ts +0 -2
  120. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
  121. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
  122. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
  123. package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
  124. package/dist/types/shared/temporal/relative-date.d.ts +0 -21
  125. package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
  126. package/src/data-app-sdk/README.md +0 -402
@@ -1,27 +1,25 @@
1
- import { J as mr, K as pr, M as gr, N as an, O as hr, P as yr, Q as br, R as vr, S as Ir, T as on, U as Cr, V as Fr, W as Sr, X as _e, Y as xr, Z as wr, _ as Tr, g as Dr, k as be, $ as kr, a0 as Mr } from "./stored-dashboard-d3xQYxBD.js";
2
- import { fC as sn, br as ve, fD as Or, fE as _r, fF as Pr, fG as Ar, O as H, fH as cn, bt as Nr, fI as Er, fJ as Ye, ah as Qe, fK as $r, fL as Rr, fM as Kr, K as Je, fN as Vr, bC as Lr, P as qr, fO as Br, L as Ur, m as Ze, fP as et, fQ as zr, fR as F, o as xe, fS as J, fT as T, fU as jr, fV as Gr, fW as Tt, fX as Wr, fY as Dt, fZ as Hr, aP as w, f_ as ln, a_ as we, f$ as Xr, g0 as Yr, g1 as Qr, g2 as Jr, g3 as Zr, g4 as dn, cj as un, g5 as fn, g6 as mn, g7 as Ie, g8 as kt, a2 as X, g9 as tt, ga as Mt, gb as nt, t as Ot, gc as _t, c6 as rt, gd as ei, ge as ti, gf as ni, gg as re, gh as ri, gi as ii, gj as ai, a5 as oi, bw as si, cb as it, aB as ci, gk as Pt, gl as pn, gm as Le, J as li, aE as di, e0 as ui, gn as fi, go as mi, gp as pi, gq as gi, gr as hi, gs as yi, gt as bi, gu as vi, gv as qe, gw as Ii, fx as Pe, gx as Ci, gy as Fi, gz as gn, a as hn, gA as Si, gB as xi, d4 as yn, gC as At, cE as wi, d7 as Nt, d6 as Ti, e8 as Di, aT as ki, eJ as Mi, gD as Oi, gE as _i, cq as Et } from "./resolve-dashboard-input-context-Du0fjN3h.js";
3
- import { H as ce, f as Pi, e as Ai, G as bn, aA as Ni, v as Ei, n as $i, d as Ri } from "./validators-wtjw0aw6.js";
4
- import { N as Ki, r as Ae } from "./matrix-operation-contract-Eb6elidS.js";
5
- import { r as Vi, C as Li } from "./metric-comparison-ChXUFaZu.js";
6
- import { t as $t, e as Rt } from "./analytics-base-schemas-BaIQrEzX.js";
1
+ import { J as pr, K as gr, M as hr, N as an, O as yr, P as br, Q as vr, R as Ir, S as Cr, T as on, U as Fr, V as Sr, W as xr, X as _e, Y as wr, Z as Tr, _ as Dr, g as kr, k as be, $ as Mr, a0 as Or } from "./stored-dashboard-B6_StAty.js";
2
+ import { fG as sn, bt as ve, fH as _r, fI as Pr, fJ as Ar, fK as Nr, P as H, fL as cn, bv as $r, fM as Er, fN as Xe, ai as Ye, fO as Rr, fP as Kr, fQ as Vr, L as Je, fR as Lr, bI as qr, Q as Br, fS as Ur, M as zr, m as Ze, fT as et, fU as jr, fV as F, o as xe, fW as J, fX as T, fY as Gr, fZ as Wr, f_ as Tt, f$ as Hr, g0 as Dt, g1 as Qr, aQ as w, g2 as ln, a$ as we, g3 as Xr, g4 as Yr, g5 as Jr, g6 as Zr, g7 as ei, g8 as dn, cp as un, g9 as fn, ga as mn, gb as Ie, gc as kt, a4 as Q, gd as tt, ge as Mt, gf as nt, t as Ot, gg as _t, cc as rt, gh as ti, gi as ni, gj as re, gk as ri, gl as ii, gm as ai, a7 as oi, bC as si, ch as it, aC as ci, gn as Pt, go as pn, gp as Le, K as li, aF as di, e4 as ui, gq as fi, gr as mi, gs as pi, gt as gi, gu as hi, gv as yi, gw as bi, gx as vi, gy as qe, gz as Ii, fB as Pe, gA as Ci, gB as Fi, gC as gn, a as hn, gD as Si, gE as xi, da as yn, gF as At, cK as wi, dd as Nt, dc as Ti, ec as Di, aU as ki, eN as Mi, gG as Oi, gH as _i, cw as $t } from "./resolve-dashboard-input-context-KqvcLcTM.js";
3
+ import { a5 as ce, s as Pi, d as Ai, r as bn, aE as Ni, a2 as vn, au as $i, n as Ei, c as Ri } from "./validators-B8fpdinG.js";
4
+ import { M as Ki, l as Ae } from "./matrix-operation-contract-DCVinw1o.js";
5
+ import { r as Vi, C as Li, a as qi } from "./metric-comparison-n9NsIa-2.js";
6
+ import { t as Et, e as Rt } from "./analytics-base-schemas-BaIQrEzX.js";
7
7
  import "zod";
8
- import { b as Q, i as N, aI as qi, aJ as Bi, m as Ui, h as zi, d as Be, e as ji, Q as _, af as Gi, am as Wi, c as Hi, ah as Xi, W as Yi, w as Qi, a5 as Ji } from "./temporal-input-presentation--2r9BLr0.js";
8
+ import { b as Y, i as N, aI as Bi, aJ as Ui, m as zi, h as ji, d as Be, e as Gi, Q as _, af as Wi, am as Hi, c as Qi, ah as Xi, W as Yi, w as Ji, a5 as Zi } from "./temporal-input-presentation-scSWQXAB.js";
9
9
  import "../value-format-preferences/index.js";
10
- import { z as Zi, S as ea, K as ta, af as na, a1 as Kt, N as vn, A as In, aq as ra, O as Cn, D as ia, a5 as aa, a6 as oa, G as Fn, X as sa, Y as Sn, I as at, Z as xn, ar as ca } from "./bookmark-state-Du3s13_V.js";
11
- import { g as la } from "./_commonjsHelpers-DimLPMtv.js";
12
- import "./index-CuHybtft.js";
10
+ import { z as ea, S as ta, K as na, af as ra, a1 as Kt, N as In, A as Cn, aq as ia, O as Fn, D as aa, a5 as oa, a6 as sa, G as Sn, X as ca, Y as xn, I as at, Z as wn, ar as la } from "./bookmark-state-CflS88gq.js";
11
+ import { g as da } from "./_commonjsHelpers-Bid1ZNYj.js";
13
12
  import "./index-RNaTnE3m.js";
14
13
  import "./context-R31TSL5V.js";
15
- import { a as da } from "./source-entity-resolution-DF6GulDn.js";
16
- import { R as ua, l as fa } from "./matrix-analytical-definition-C9xB_T84.js";
17
- import { r as Ue } from "./pivot-result-identity-BlbLrqaC.js";
18
- import { r as wn } from "./applied-constraints-DU-wndZ7.js";
19
- function ma(e, t) {
14
+ import { r as ua, Z as fa, v as ma } from "./matrix-analytical-definition-dkS8szLM.js";
15
+ import { r as Ue } from "./pivot-result-identity-B89X5xjb.js";
16
+ import { r as Tn } from "./applied-constraints-DU-wndZ7.js";
17
+ function pa(e, t) {
20
18
  if (!(typeof e != "number" || typeof t != "number"))
21
19
  return e === t ? t : void 0;
22
20
  }
23
21
  function U(e, t) {
24
- const n = Q(e, t);
22
+ const n = Y(e, t);
25
23
  if (n) {
26
24
  if (n.type === "date")
27
25
  return {
@@ -53,7 +51,7 @@ function U(e, t) {
53
51
  type: n.type,
54
52
  locale: n.locale,
55
53
  currency: n.type === "currency" ? n.currency : void 0,
56
- decimalPlaces: t != null && t.preserveOmittedProperties ? void 0 : ma(
54
+ decimalPlaces: t != null && t.preserveOmittedProperties ? void 0 : pa(
57
55
  n.minimumFractionDigits,
58
56
  n.maximumFractionDigits
59
57
  ),
@@ -70,8 +68,8 @@ function U(e, t) {
70
68
  };
71
69
  }
72
70
  }
73
- function Tn(e, t) {
74
- const n = Q(e, t);
71
+ function Dn(e, t) {
72
+ const n = Y(e, t);
75
73
  return (n == null ? void 0 : n.type) === "duration" ? {
76
74
  style: "duration",
77
75
  duration: {
@@ -87,7 +85,7 @@ function Tn(e, t) {
87
85
  } : !n || !N(n) ? void 0 : {
88
86
  style: n.type === "currency" ? "currency" : n.type === "percent" ? "percent" : n.type === "scientific" ? "scientific" : "decimal",
89
87
  currency: n.type === "currency" && n.currency || (t != null && t.preserveOmittedProperties ? void 0 : "USD"),
90
- locale: n.locale || (t != null && t.preserveOmittedProperties ? void 0 : qi),
88
+ locale: n.locale || (t != null && t.preserveOmittedProperties ? void 0 : Bi),
91
89
  minimumFractionDigits: n.minimumFractionDigits ?? (t != null && t.preserveOmittedProperties ? void 0 : 0),
92
90
  maximumFractionDigits: n.maximumFractionDigits ?? (t != null && t.preserveOmittedProperties ? void 0 : 2),
93
91
  useGrouping: typeof n.useGrouping == "boolean" ? n.useGrouping : !0,
@@ -100,60 +98,60 @@ function Tn(e, t) {
100
98
  suffix: n.suffix
101
99
  };
102
100
  }
103
- const Vt = [10, 20, 50, 100, 500, 1e3], pa = 50;
104
- function ga(e) {
105
- return e && e > 0 ? e : pa;
101
+ const Vt = [10, 20, 50, 100, 500, 1e3], ga = 50;
102
+ function ha(e) {
103
+ return e && e > 0 ? e : ga;
106
104
  }
107
- function lc(e) {
108
- const t = ga(e), n = [...Vt];
105
+ function cc(e) {
106
+ const t = ha(e), n = [...Vt];
109
107
  return Vt.includes(
110
108
  t
111
109
  ) || (n.push(t), n.sort((r, i) => r - i)), n;
112
110
  }
113
- function dc(e) {
111
+ function lc(e) {
114
112
  var t, n;
115
113
  return !!((e.type === "table" || e.type === "detailTable") && e.sql && !sn(e.config) && !((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) != null && n.forceClientPagination));
116
114
  }
117
- function ha(e, t) {
115
+ function ya(e, t) {
118
116
  var r, i, o, a;
119
117
  if (t === "table-print")
120
118
  return "disabled";
121
119
  if ((i = (r = e.preferences) == null ? void 0 : r.tablePrefs) != null && i.forceClientPagination)
122
120
  return "client";
123
121
  const n = sn(e.config);
124
- return e.sql && !n ? (a = (o = e.preferences) == null ? void 0 : o.tablePrefs) != null && a.enableDevModePagination ? "server" : "client" : n && mr(e) ? "server" : "client";
122
+ return e.sql && !n ? (a = (o = e.preferences) == null ? void 0 : o.tablePrefs) != null && a.enableDevModePagination ? "server" : "client" : n && pr(e) ? "server" : "client";
125
123
  }
126
- const Dn = Object.freeze({}), uc = {
124
+ const kn = Object.freeze({}), dc = {
127
125
  access: "session-only",
128
126
  printMode: !1,
129
127
  baseline: null,
130
128
  applied: null,
131
129
  appliedBookmark: null,
132
- tableSettings: Dn,
130
+ tableSettings: kn,
133
131
  notices: [],
134
132
  isFavorite: !1,
135
133
  fetchedAt: 0
136
134
  };
137
- function fc(e) {
135
+ function uc(e) {
138
136
  return !e.viewer.printMode && e.viewer.access !== "session-only" && !!e.viewer.baseline && !!e.viewerStateClient && !e.isDashboardEditing;
139
137
  }
140
- function ya(e) {
141
- return e.isDashboardEditing ? Dn : e.viewer.tableSettings;
138
+ function ba(e) {
139
+ return e.isDashboardEditing ? kn : e.viewer.tableSettings;
142
140
  }
143
- function ba(e, t) {
144
- return ya(e)[t];
141
+ function va(e, t) {
142
+ return ba(e)[t];
145
143
  }
146
- function mc(e, t, n) {
147
- if (!(n.isEditorPreview || e.isDashboardEditing) && Zi(e.dashboard, t))
148
- return { settings: ba(e, t) };
144
+ function fc(e, t, n) {
145
+ if (!(n.isEditorPreview || e.isDashboardEditing) && ea(e.dashboard, t))
146
+ return { settings: va(e, t) };
149
147
  }
150
- function va(e) {
148
+ function Ia(e) {
151
149
  var t;
152
- return pr({
150
+ return gr({
153
151
  card: e.card,
154
- paginationMode: ha(e.card) === "server" ? "server" : "client",
152
+ paginationMode: ya(e.card) === "server" ? "server" : "client",
155
153
  result: {
156
- keys: e.keys ?? gr(e.records),
154
+ keys: e.keys ?? hr(e.records),
157
155
  rows: e.records,
158
156
  columns: e.resultColumns,
159
157
  columnKeyMap: e.columnKeyMap,
@@ -163,26 +161,26 @@ function va(e) {
163
161
  projection: "export"
164
162
  });
165
163
  }
166
- function Ia(e) {
164
+ function Ca(e) {
167
165
  if (e)
168
166
  return U(
169
- Q(e, { preserveOmittedProperties: !0 }),
167
+ Y(e, { preserveOmittedProperties: !0 }),
170
168
  { preserveOmittedProperties: !0 }
171
169
  );
172
170
  }
173
- function Ca(e) {
171
+ function Fa(e) {
174
172
  if (e.type === "percent") {
175
173
  const { multiplyBy: t, percentValueMode: n, ...r } = e, i = t === 100 ? "fraction" : t === 1 ? "whole" : t === void 0 ? n : void 0;
176
174
  if (i || t === void 0)
177
- return $t(
175
+ return Et(
178
176
  ve({ ...r, ...i ? { percentValueMode: i } : {} }, { preserveOmittedProperties: !0 })
179
177
  );
180
178
  }
181
- return $t(
179
+ return Et(
182
180
  ve(e, { preserveOmittedProperties: !0 })
183
181
  );
184
182
  }
185
- const Te = Ia, pc = Ca, Fa = () => ({
183
+ const Te = Ca, mc = Fa, Sa = () => ({
186
184
  urlTemplate: "{value}",
187
185
  // Default: use cell value as-is
188
186
  labelType: "value",
@@ -196,9 +194,9 @@ const Te = Ia, pc = Ca, Fa = () => ({
196
194
  inheritMetricFormat: !0,
197
195
  textAlign: "left",
198
196
  // The table's one width rule (card appearance P2-21).
199
- width: Pr,
200
- minWidth: _r,
201
- maxWidth: Or,
197
+ width: Ar,
198
+ minWidth: Pr,
199
+ maxWidth: _r,
202
200
  textOverflow: "ellipsis",
203
201
  textWrap: "default",
204
202
  numberFormat: {
@@ -220,12 +218,12 @@ const Te = Ia, pc = Ca, Fa = () => ({
220
218
  sourceTimezone: "auto"
221
219
  // Default to auto (use explicit timezone if present, otherwise assume UTC)
222
220
  },
223
- linkFormat: Fa()
221
+ linkFormat: Sa()
224
222
  });
225
- function gc(e, t, n, r) {
223
+ function pc(e, t, n, r) {
226
224
  return t && t !== "auto" ? t : n;
227
225
  }
228
- const hc = (e) => !e || e === "auto" ? "local time" : {
226
+ const gc = (e) => !e || e === "auto" ? "local time" : {
229
227
  "America/New_York": "Eastern Time",
230
228
  "America/Chicago": "Central Time",
231
229
  "America/Denver": "Mountain Time",
@@ -236,7 +234,7 @@ const hc = (e) => !e || e === "auto" ? "local time" : {
236
234
  "Asia/Shanghai": "China Time",
237
235
  UTC: "UTC"
238
236
  }[e] || e;
239
- function kn(e, t) {
237
+ function Mn(e, t) {
240
238
  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;
241
239
  return {
242
240
  minimumFractionDigits: r,
@@ -244,7 +242,7 @@ function kn(e, t) {
244
242
  };
245
243
  }
246
244
  function Ce(e, t) {
247
- const n = kn(e, t), r = typeof e.suffix == "string" && e.suffix.length > 0;
245
+ const n = Mn(e, t), r = typeof e.suffix == "string" && e.suffix.length > 0;
248
246
  return {
249
247
  style: "decimal",
250
248
  locale: e.locale,
@@ -262,30 +260,30 @@ function Ce(e, t) {
262
260
  };
263
261
  }
264
262
  function st(e, t = "auto", n = {}) {
265
- if (t === "auto" && (t = Da(e, n)), (t === "number" || t === "currency" || t === "percent" || t === "scientific") && n.signDisplay && n.signDisplay !== "auto" && Number.isFinite(Number(e))) {
266
- const i = typeof n.multiplyBy == "number" && Number.isFinite(n.multiplyBy) ? n.multiplyBy : 1, o = Number(e) * i, a = Bi(o, n.signDisplay), s = st(a.value === o ? e : -Number(e), t, { ...n, signDisplay: void 0 });
263
+ if (t === "auto" && (t = ka(e, n)), (t === "number" || t === "currency" || t === "percent" || t === "scientific") && n.signDisplay && n.signDisplay !== "auto" && Number.isFinite(Number(e))) {
264
+ const i = typeof n.multiplyBy == "number" && Number.isFinite(n.multiplyBy) ? n.multiplyBy : 1, o = Number(e) * i, a = Ui(o, n.signDisplay), s = st(a.value === o ? e : -Number(e), t, { ...n, signDisplay: void 0 });
267
265
  if (!a.plus) return s;
268
266
  const c = n.prefix ?? "";
269
267
  return c && s.startsWith(c) ? `${c}+${s.slice(c.length)}` : `+${s}`;
270
268
  }
271
269
  switch (t) {
272
270
  case "number":
273
- return Mn(e, n);
274
- case "currency":
275
271
  return On(e, n);
272
+ case "currency":
273
+ return _n(e, n);
276
274
  case "percent":
277
- return Sa(e, n);
278
- case "date":
279
275
  return xa(e, n);
280
- case "scientific":
276
+ case "date":
281
277
  return wa(e, n);
282
- case "duration":
278
+ case "scientific":
283
279
  return Ta(e, n);
280
+ case "duration":
281
+ return Da(e, n);
284
282
  default:
285
283
  return String(e);
286
284
  }
287
285
  }
288
- function Mn(e, t = {}) {
286
+ function On(e, t = {}) {
289
287
  return e < 0 && !!t.prefix && !t.negativeInParentheses ? `-${Be(
290
288
  Math.abs(e),
291
289
  Ce(t, {
@@ -300,8 +298,8 @@ function Mn(e, t = {}) {
300
298
  })
301
299
  );
302
300
  }
303
- function On(e, t = {}) {
304
- return ji(e, {
301
+ function _n(e, t = {}) {
302
+ return Gi(e, {
305
303
  ...Ce(t, {
306
304
  min: 2,
307
305
  max: 2
@@ -310,8 +308,8 @@ function On(e, t = {}) {
310
308
  currency: t.currency || "USD"
311
309
  });
312
310
  }
313
- function Sa(e, t = {}) {
314
- const n = kn(t, { min: 1, max: 1 }), i = typeof t.multiplyBy == "number" && Number.isFinite(t.multiplyBy) ? t.multiplyBy : t.percentValueMode === "whole" ? 1 : 100, o = e * i;
311
+ function xa(e, t = {}) {
312
+ const n = Mn(t, { min: 1, max: 1 }), i = typeof t.multiplyBy == "number" && Number.isFinite(t.multiplyBy) ? t.multiplyBy : t.percentValueMode === "whole" ? 1 : 100, o = e * i;
315
313
  return Be(o, {
316
314
  locale: t.locale,
317
315
  minimumFractionDigits: n.minimumFractionDigits,
@@ -323,7 +321,7 @@ function Sa(e, t = {}) {
323
321
  useSuffix: !1
324
322
  });
325
323
  }
326
- function xa(e, t = {}) {
324
+ function wa(e, t = {}) {
327
325
  const { locale: n = "en-US" } = t;
328
326
  try {
329
327
  const r = new Date(e);
@@ -334,14 +332,14 @@ function xa(e, t = {}) {
334
332
  return String(e);
335
333
  }
336
334
  }
337
- function wa(e, t = {}) {
338
- return zi(
335
+ function Ta(e, t = {}) {
336
+ return ji(
339
337
  e,
340
338
  Ce(t, { min: 2, max: 2 })
341
339
  );
342
340
  }
343
- function Ta(e, t = {}) {
344
- return Ui(e, {
341
+ function Da(e, t = {}) {
342
+ return zi(e, {
345
343
  inputUnit: t.durationInputUnit,
346
344
  outputStyle: t.durationDisplayStyle,
347
345
  largestUnit: t.durationLargestUnit,
@@ -352,13 +350,13 @@ function Ta(e, t = {}) {
352
350
  negativeInParentheses: t.negativeInParentheses
353
351
  });
354
352
  }
355
- function Da(e, t) {
353
+ function ka(e, t) {
356
354
  return t.currency ? "currency" : typeof e == "string" && !isNaN(Date.parse(e)) ? "date" : "number";
357
355
  }
358
- function yc(e, t = {}) {
356
+ function hc(e, t = {}) {
359
357
  return (n) => st(n, e, t);
360
358
  }
361
- function ka({
359
+ function Ma({
362
360
  number: e,
363
361
  decimalPlaces: t = 0,
364
362
  useSuffix: n = !1,
@@ -367,7 +365,7 @@ function ka({
367
365
  locale: o = "en-US"
368
366
  }) {
369
367
  if (i) {
370
- const a = On(e, {
368
+ const a = _n(e, {
371
369
  currency: i,
372
370
  decimalPlaces: t,
373
371
  locale: o,
@@ -375,14 +373,14 @@ function ka({
375
373
  });
376
374
  return n && r ? `${a}${r}` : a;
377
375
  }
378
- return Mn(e, {
376
+ return On(e, {
379
377
  decimalPlaces: t,
380
378
  useSuffix: n && !r,
381
379
  suffix: r,
382
380
  locale: o
383
381
  });
384
382
  }
385
- var Ma = function e(t, n) {
383
+ var Oa = function e(t, n) {
386
384
  if (t === n) return !0;
387
385
  if (t && n && typeof t == "object" && typeof n == "object") {
388
386
  if (t.constructor !== n.constructor) return !1;
@@ -408,13 +406,13 @@ var Ma = function e(t, n) {
408
406
  }
409
407
  return t !== t && n !== n;
410
408
  };
411
- const Fe = /* @__PURE__ */ la(Ma);
409
+ const Fe = /* @__PURE__ */ da(Oa);
412
410
  function ct(e, t) {
413
411
  var n;
414
412
  if (t.id)
415
413
  return (n = e.sql) != null && n.trim() ? { kind: "column", columnKey: t.id } : { kind: "metric", metricId: t.id };
416
414
  }
417
- function _n(e) {
415
+ function Pn(e) {
418
416
  const t = e.context.preferences;
419
417
  if (!t)
420
418
  return e.authoredFormat;
@@ -425,11 +423,11 @@ function _n(e) {
425
423
  n ? e.context.resolveBoundCurrency(n) : void 0
426
424
  );
427
425
  }
428
- function Oa(e) {
429
- const t = H(e.card)[e.columnKey], n = (t == null ? void 0 : t.type) === "number" ? hr(
426
+ function _a(e) {
427
+ const t = H(e.card)[e.columnKey], n = (t == null ? void 0 : t.type) === "number" ? yr(
430
428
  { dataType: "number", format: void 0 },
431
429
  t
432
- ) : void 0, r = n == null ? void 0 : n.authoredFormat, i = N(r) ? _n({
430
+ ) : void 0, r = n == null ? void 0 : n.authoredFormat, i = N(r) ? Pn({
433
431
  card: e.card,
434
432
  metric: {
435
433
  id: e.columnKey
@@ -447,9 +445,9 @@ function Oa(e) {
447
445
  format: i
448
446
  };
449
447
  }
450
- function bc(e) {
448
+ function yc(e) {
451
449
  const t = new Set(
452
- Ar(e.records)
450
+ Nr(e.records)
453
451
  ), n = new Set(
454
452
  e.renderedMetricKeys || e.resultKeys
455
453
  ), r = H(e.card);
@@ -460,13 +458,13 @@ function bc(e) {
460
458
  }
461
459
  );
462
460
  }
463
- function vc(e) {
461
+ function bc(e) {
464
462
  var o, a;
465
463
  const { card: t, context: n } = e;
466
464
  if (!(n != null && n.preferences) || !cn(t.type))
467
465
  return t;
468
466
  const r = n.preferences, i = (o = t.sql) != null && o.trim() ? e.resultMetricKeys.map(
469
- (s) => Oa({
467
+ (s) => _a({
470
468
  card: t,
471
469
  columnKey: s,
472
470
  context: n
@@ -482,7 +480,7 @@ function vc(e) {
482
480
  l,
483
481
  r,
484
482
  u
485
- ) : _n({
483
+ ) : Pn({
486
484
  card: t,
487
485
  metric: s,
488
486
  context: n,
@@ -571,30 +569,30 @@ function De(e) {
571
569
  function ze(e) {
572
570
  return e ? Object.entries(e).some(([t, n]) => n == null || n === "" ? !1 : t === "type" ? n !== "auto" : !0) : !1;
573
571
  }
574
- function Pn(e) {
572
+ function An(e) {
575
573
  if (e)
576
574
  return e.alias || e.label || e.name;
577
575
  }
578
576
  function je(e, t) {
579
577
  var r;
580
578
  return (((r = e == null ? void 0 : e.config) == null ? void 0 : r.metricColumns) || []).find((i) => {
581
- const o = Pn(i);
579
+ const o = An(i);
582
580
  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;
583
581
  });
584
582
  }
585
583
  function le(e, t) {
586
584
  var r, i;
587
- const n = Nr(e, t);
585
+ const n = $r(e, t);
588
586
  if (!(n && ((i = (r = e == null ? void 0 : e.config) == null ? void 0 : r.groupByColumns) != null && i.includes(n)) && !Er(n)))
589
587
  return n;
590
588
  }
591
- function _a(e) {
589
+ function Pa(e) {
592
590
  return !!e && !(e != null && e.format) && ce(e == null ? void 0 : e.dataType) === "number";
593
591
  }
594
- const Pa = {
592
+ const Aa = {
595
593
  style: "decimal"
596
594
  };
597
- function An(e) {
595
+ function Nn(e) {
598
596
  if (!e)
599
597
  return;
600
598
  const t = ot();
@@ -603,7 +601,7 @@ function An(e) {
603
601
  ...e,
604
602
  inheritMetricFormat: e.numberFormat ? e.inheritMetricFormat : e.inheritMetricFormat ?? t.inheritMetricFormat,
605
603
  numberFormat: {
606
- ...Pa,
604
+ ...Aa,
607
605
  ...e.numberFormat
608
606
  },
609
607
  dateFormat: {
@@ -616,18 +614,18 @@ function An(e) {
616
614
  }
617
615
  };
618
616
  }
619
- function Ic(e) {
617
+ function vc(e) {
620
618
  return Object.fromEntries(
621
619
  Object.entries(e || {}).map(([t, n]) => [
622
620
  t,
623
- An(n)
621
+ Nn(n)
624
622
  ])
625
623
  );
626
624
  }
627
625
  function fe(e) {
628
626
  return !!(e && typeof e == "object" && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype);
629
627
  }
630
- function Nn(e, t, n) {
628
+ function $n(e, t, n) {
631
629
  if (!fe(n))
632
630
  return n;
633
631
  const r = fe(e) ? e : {}, i = fe(t) ? t : {}, o = {};
@@ -645,7 +643,7 @@ function Nn(e, t, n) {
645
643
  }
646
644
  if (!c && Fe(s, l))
647
645
  continue;
648
- const d = Nn(
646
+ const d = $n(
649
647
  r[a],
650
648
  l,
651
649
  s
@@ -654,8 +652,8 @@ function Nn(e, t, n) {
654
652
  }
655
653
  return o;
656
654
  }
657
- function Cc(e) {
658
- let t = Nn(
655
+ function Ic(e) {
656
+ let t = $n(
659
657
  e.persisted,
660
658
  e.baseline,
661
659
  e.next
@@ -663,11 +661,11 @@ function Cc(e) {
663
661
  if (e.enforceDeclaredSqlTemporalFormat && e.next.type === "date" && !e.next.dateFormat.useRelativeTime && e.next.dateFormat.useCustomFormat) {
664
662
  const n = e.next.dateFormat.customFormat;
665
663
  if (!(n != null && n.trim()))
666
- throw new Gi(
664
+ throw new Wi(
667
665
  "invalid_raw_temporal_format",
668
666
  "Custom table date formatting requires a non-empty pattern."
669
667
  );
670
- Wi({
668
+ Hi({
671
669
  dialect: "date_fns",
672
670
  pattern: n,
673
671
  valueKind: e.rawTemporalValueKind
@@ -693,7 +691,7 @@ function Cc(e) {
693
691
  type: "date"
694
692
  } : t;
695
693
  }
696
- function Aa(e, t) {
694
+ function Na(e, t) {
697
695
  const n = e || ot(), r = !t;
698
696
  return {
699
697
  ...n,
@@ -712,7 +710,7 @@ function Ne(e) {
712
710
  return e.trim().toLowerCase();
713
711
  }
714
712
  const En = /\s*(?:\((?:previous|last year|start|target|comparison)\)|δ)\s*$/i;
715
- function Na(e) {
713
+ function $a(e) {
716
714
  const t = e == null ? void 0 : e.trim();
717
715
  return t ? t.replace(En, "").trim() || t : void 0;
718
716
  }
@@ -720,12 +718,12 @@ function Ea(e) {
720
718
  const t = e == null ? void 0 : e.trim();
721
719
  return t ? En.test(t) : !1;
722
720
  }
723
- function $a(e, t) {
721
+ function Ra(e, t) {
724
722
  return t.metricAlias ? e.find(
725
723
  (n) => Vi(n) === t.metricAlias
726
724
  ) : t.metricId ? e.find((n) => n.id === t.metricId) : void 0;
727
725
  }
728
- function Ra(e) {
726
+ function Ka(e) {
729
727
  var y;
730
728
  const {
731
729
  card: t,
@@ -736,7 +734,7 @@ function Ra(e) {
736
734
  metricKey: a
737
735
  } = e, s = ((y = t == null ? void 0 : t.config) == null ? void 0 : y.metricColumns) || [];
738
736
  if (r || n)
739
- return $a(s, {
737
+ return Ra(s, {
740
738
  metricAlias: r,
741
739
  metricId: n
742
740
  });
@@ -753,7 +751,7 @@ function Ra(e) {
753
751
  if (h)
754
752
  return h;
755
753
  }
756
- const u = d.map((g) => Ne(g)).filter((g) => !!g), f = d.map((g) => Na(g)).filter((g) => !!g);
754
+ const u = d.map((g) => Ne(g)).filter((g) => !!g), f = d.map((g) => $a(g)).filter((g) => !!g);
757
755
  for (const g of f) {
758
756
  const h = je(t, {
759
757
  columnId: g,
@@ -776,15 +774,15 @@ function Ra(e) {
776
774
  g.alias,
777
775
  g.label,
778
776
  g.name,
779
- Pn(g)
777
+ An(g)
780
778
  ].map((C) => Ne(C)).filter((C) => !!C);
781
779
  return p.some(
782
780
  (C) => h.includes(C)
783
781
  );
784
782
  });
785
783
  }
786
- function Ka(e) {
787
- const t = Q(e == null ? void 0 : e.format);
784
+ function Va(e) {
785
+ const t = Y(e == null ? void 0 : e.format);
788
786
  return U(t);
789
787
  }
790
788
  function Lt(e, t) {
@@ -799,15 +797,15 @@ function qt(e) {
799
797
  if (t)
800
798
  return JSON.stringify(t);
801
799
  }
802
- function Va(e, t) {
800
+ function La(e, t) {
803
801
  const n = qt(e), r = qt(t);
804
802
  return !!(n && r && n === r);
805
803
  }
806
- function La(e) {
804
+ function qa(e) {
807
805
  if (e.length === 0)
808
806
  return;
809
807
  const t = e.map(
810
- (a) => Ka(a)
808
+ (a) => Va(a)
811
809
  );
812
810
  if (!t.every(
813
811
  (a) => ze(a)
@@ -815,7 +813,7 @@ function La(e) {
815
813
  return;
816
814
  const r = t, [i] = r;
817
815
  return r.every(
818
- (a) => Va(i, a)
816
+ (a) => La(i, a)
819
817
  ) ? i : void 0;
820
818
  }
821
819
  function ke(e) {
@@ -824,7 +822,7 @@ function ke(e) {
824
822
  formatOptions: e.overrideFormatOptions || void 0,
825
823
  source: "override"
826
824
  };
827
- const t = La(
825
+ const t = qa(
828
826
  e.metrics || []
829
827
  );
830
828
  return ze(t) ? {
@@ -835,7 +833,7 @@ function ke(e) {
835
833
  source: "auto"
836
834
  };
837
835
  }
838
- function $n(e) {
836
+ function Rn(e) {
839
837
  var c, l, d;
840
838
  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) || [];
841
839
  if (!o.length)
@@ -857,11 +855,11 @@ function $n(e) {
857
855
  ) || o[1] || o[0];
858
856
  return r === "x" ? u ? [u] : [] : f ? [f] : [];
859
857
  }
860
- const s = Qe(n, i);
858
+ const s = Ye(n, i);
861
859
  return n === "radar" ? r === "y" ? o : [] : r !== s ? [] : o;
862
860
  }
863
861
  function lt(e) {
864
- const { card: t, chartType: n, axis: r, preferences: i, axisConfig: o } = e, a = $n({
862
+ const { card: t, chartType: n, axis: r, preferences: i, axisConfig: o } = e, a = Rn({
865
863
  card: t,
866
864
  chartType: n,
867
865
  axis: r,
@@ -880,7 +878,7 @@ function lt(e) {
880
878
  })
881
879
  };
882
880
  }
883
- function qa(e) {
881
+ function Ba(e) {
884
882
  const { preferences: t, metric: n } = e, r = t == null ? void 0 : t.tooltipConfig, i = ke({
885
883
  overrideFormatOptions: Te(r == null ? void 0 : r.valueFormat),
886
884
  metrics: n ? [n] : []
@@ -896,13 +894,13 @@ function qa(e) {
896
894
  };
897
895
  }
898
896
  function dt(e, t, n) {
899
- return t === Qe(n, e) ? $r(n, e) : t === "x" ? e == null ? void 0 : e.xAxisConfig : t === "y2" ? e == null ? void 0 : e.secondaryYAxisConfig : e == null ? void 0 : e.yAxisConfig;
897
+ return t === Ye(n, e) ? Rr(n, e) : t === "x" ? e == null ? void 0 : e.xAxisConfig : t === "y2" ? e == null ? void 0 : e.secondaryYAxisConfig : e == null ? void 0 : e.yAxisConfig;
900
898
  }
901
899
  function ut(e) {
902
900
  const { chartType: t, preferences: n } = e;
903
- return t === "bubble" || t === "scatter" ? "y" : Qe(t, n);
901
+ return t === "bubble" || t === "scatter" ? "y" : Ye(t, n);
904
902
  }
905
- function Rn(e) {
903
+ function Kn(e) {
906
904
  switch (e) {
907
905
  case "pie":
908
906
  case "doughnut":
@@ -915,8 +913,8 @@ function Rn(e) {
915
913
  return !0;
916
914
  }
917
915
  }
918
- function Fc(e) {
919
- const { card: t, chartType: n, preferences: r, metric: i } = e, o = qa({
916
+ function Cc(e) {
917
+ const { card: t, chartType: n, preferences: r, metric: i } = e, o = Ba({
920
918
  card: t,
921
919
  preferences: r,
922
920
  metric: i,
@@ -934,11 +932,11 @@ function Fc(e) {
934
932
  });
935
933
  return s.source === "override" ? s : o;
936
934
  }
937
- function Sc(e) {
935
+ function Fc(e) {
938
936
  const { card: t, chartType: n, preferences: r, dataLabelsConfig: i } = e, o = n || (t == null ? void 0 : t.type), a = ut({
939
937
  chartType: o,
940
938
  preferences: r
941
- }), s = $n({
939
+ }), s = Rn({
942
940
  card: t,
943
941
  chartType: o,
944
942
  axis: a,
@@ -955,7 +953,7 @@ function Sc(e) {
955
953
  context: e.numericPresentation
956
954
  })
957
955
  };
958
- if (l.source === "override" || !Rn(o))
956
+ if (l.source === "override" || !Kn(o))
959
957
  return l;
960
958
  const d = lt({
961
959
  card: t,
@@ -971,7 +969,7 @@ function Sc(e) {
971
969
  });
972
970
  return d.source === "override" ? d : l;
973
971
  }
974
- function Ba(e) {
972
+ function Ua(e) {
975
973
  const { preferences: t, dataLabelsConfig: n, metric: r } = e, i = ke({
976
974
  overrideFormatOptions: Te(n == null ? void 0 : n.valueFormat),
977
975
  metrics: r ? [r] : []
@@ -986,16 +984,16 @@ function Ba(e) {
986
984
  })
987
985
  };
988
986
  }
989
- function xc(e) {
987
+ function Sc(e) {
990
988
  var a, s;
991
- const t = Ra({
989
+ const t = Ka({
992
990
  card: e.card,
993
991
  metricId: e.metricId,
994
992
  metricAlias: e.metricAlias,
995
993
  datasetIndex: e.datasetIndex,
996
994
  datasetLabel: e.datasetLabel,
997
995
  metricKey: e.metricKey
998
- }), n = Ba({
996
+ }), n = Ua({
999
997
  card: e.card,
1000
998
  preferences: e.preferences,
1001
999
  dataLabelsConfig: e.dataLabelsConfig,
@@ -1005,7 +1003,7 @@ function xc(e) {
1005
1003
  if (n.source === "override")
1006
1004
  return n;
1007
1005
  const r = (a = e.card) == null ? void 0 : a.type;
1008
- if (!Rn(r))
1006
+ if (!Kn(r))
1009
1007
  return n;
1010
1008
  let i = ut({
1011
1009
  chartType: r,
@@ -1031,15 +1029,15 @@ function xc(e) {
1031
1029
  });
1032
1030
  return o.source === "override" ? o : n;
1033
1031
  }
1034
- function wc(e) {
1032
+ function xc(e) {
1035
1033
  return (e == null ? void 0 : e.rawValue) === !0;
1036
1034
  }
1037
- function Ua(e) {
1035
+ function za(e) {
1038
1036
  const t = e == null ? void 0 : e.numberFormat;
1039
1037
  if (!t)
1040
1038
  return;
1041
1039
  if (t.style === "duration")
1042
- return U(Ye(t), {
1040
+ return U(Xe(t), {
1043
1041
  preserveOmittedProperties: !0
1044
1042
  });
1045
1043
  const n = t.style === "currency" ? "currency" : t.style === "percent" ? "percent" : t.style === "scientific" ? "scientific" : "number", r = t.minimumFractionDigits, i = t.maximumFractionDigits;
@@ -1059,8 +1057,8 @@ function Ua(e) {
1059
1057
  suffix: t.suffix
1060
1058
  };
1061
1059
  }
1062
- function za(e, t, n = !1) {
1063
- const r = n ? { preserveOmittedProperties: !0 } : void 0, i = Q(e == null ? void 0 : e.format, r), o = Tn(
1060
+ function ja(e, t, n = !1) {
1061
+ const r = n ? { preserveOmittedProperties: !0 } : void 0, i = Y(e == null ? void 0 : e.format, r), o = Dn(
1064
1062
  i,
1065
1063
  r
1066
1064
  );
@@ -1080,7 +1078,7 @@ function za(e, t, n = !1) {
1080
1078
  }
1081
1079
  };
1082
1080
  }
1083
- function Kn(e) {
1081
+ function Vn(e) {
1084
1082
  var k;
1085
1083
  const {
1086
1084
  card: t,
@@ -1096,7 +1094,7 @@ function Kn(e) {
1096
1094
  valueFormatPreferences: u,
1097
1095
  boundCurrency: f,
1098
1096
  preserveOmittedProperties: m
1099
- } = e, p = r ?? H(t)[n], y = !((k = t == null ? void 0 : t.sql) != null && k.trim()) || yr(p), g = y ? u : null, h = y ? f : void 0, C = i ?? An(p);
1097
+ } = e, p = r ?? H(t)[n], y = !((k = t == null ? void 0 : t.sql) != null && k.trim()) || br(p), g = y ? u : null, h = y ? f : void 0, C = i ?? Nn(p);
1100
1098
  if (C && C.inheritMetricFormat !== !0)
1101
1099
  return Bt(
1102
1100
  C,
@@ -1110,11 +1108,11 @@ function Kn(e) {
1110
1108
  columnKeyMap: d,
1111
1109
  fieldId: c,
1112
1110
  fieldRole: l
1113
- }), b = za(
1111
+ }), b = ja(
1114
1112
  v,
1115
1113
  C || o,
1116
1114
  m ?? !!u
1117
- ), S = !b && g && _a(v) ? Aa(
1115
+ ), S = !b && g && Pa(v) ? Na(
1118
1116
  C || o,
1119
1117
  h
1120
1118
  ) : void 0;
@@ -1127,7 +1125,7 @@ function Kn(e) {
1127
1125
  function Bt(e, t, n) {
1128
1126
  if (!e || e.type !== "number" || !t)
1129
1127
  return e;
1130
- const r = e.numberFormat, i = r ? Ye(r, {
1128
+ const r = e.numberFormat, i = r ? Xe(r, {
1131
1129
  preserveOmittedProperties: !0
1132
1130
  }) : { type: "number" };
1133
1131
  if (!i || !N(i))
@@ -1136,7 +1134,7 @@ function Bt(e, t, n) {
1136
1134
  i,
1137
1135
  t,
1138
1136
  n
1139
- ), a = Tn(o, {
1137
+ ), a = Dn(o, {
1140
1138
  preserveOmittedProperties: !0
1141
1139
  });
1142
1140
  return a ? {
@@ -1150,16 +1148,16 @@ function Bt(e, t, n) {
1150
1148
  function Se(e) {
1151
1149
  if (!e.valueFormatPreferences)
1152
1150
  return;
1153
- const t = Kn(e);
1151
+ const t = Vn(e);
1154
1152
  if (!t || t.type !== "number")
1155
1153
  return;
1156
- const n = Ye(t.numberFormat, {
1154
+ const n = Xe(t.numberFormat, {
1157
1155
  preserveOmittedProperties: !0
1158
1156
  });
1159
- if (!(!n || !Hi(n)))
1157
+ if (!(!n || !Qi(n)))
1160
1158
  return n;
1161
1159
  }
1162
- function ja(e) {
1160
+ function Ga(e) {
1163
1161
  var r, i;
1164
1162
  if (!e.presentation.preferences)
1165
1163
  return;
@@ -1180,7 +1178,7 @@ function ja(e) {
1180
1178
  columnKeyMap: e.columnKeyMap,
1181
1179
  metricAlias: e.metricAlias ?? (t == null ? void 0 : t.alias),
1182
1180
  valueFormatPreferences: e.presentation.preferences
1183
- }), a = ea(e.comparisonPrecision) ?? (N(o) ? o.maximumFractionDigits : void 0) ?? (e.comparisonValueKind === "percent_change" ? 1 : 2);
1181
+ }), a = ta(e.comparisonPrecision) ?? (N(o) ? o.maximumFractionDigits : void 0) ?? (e.comparisonValueKind === "percent_change" ? 1 : 2);
1184
1182
  return e.comparisonValueKind === "percent_change" ? {
1185
1183
  type: "percent",
1186
1184
  locale: e.presentation.preferences.locale,
@@ -1195,7 +1193,7 @@ function ja(e) {
1195
1193
  suffix: "×"
1196
1194
  };
1197
1195
  }
1198
- const n = br({
1196
+ const n = vr({
1199
1197
  card: e.card,
1200
1198
  columnKey: e.columnId,
1201
1199
  metricId: e.metricId ?? (t && !((i = (r = e.card.config) == null ? void 0 : r.groupByColumns) != null && i.includes(t)) ? t.id : void 0)
@@ -1213,10 +1211,10 @@ function ja(e) {
1213
1211
  boundCurrency: n ? e.presentation.resolveBoundCurrency(n) : void 0
1214
1212
  });
1215
1213
  }
1216
- function Ga(e) {
1214
+ function Wa(e) {
1217
1215
  var s, c, l, d, u;
1218
1216
  if (e.card.type === "matrixTable" && e.target.kind === "matrix_measure") {
1219
- const f = e.target, m = vr(e.card, e.matrixCatalog).find(
1217
+ const f = e.target, m = Ir(e.card, e.matrixCatalog).find(
1220
1218
  (y) => y.measureId === f.measureId
1221
1219
  ), p = m == null ? void 0 : m.canonical;
1222
1220
  return p && (p.type === "number" || p.type === "currency") ? _(
@@ -1233,7 +1231,7 @@ function Ga(e) {
1233
1231
  (y) => y.id === f
1234
1232
  )))
1235
1233
  return;
1236
- const m = Ir(e.card, {
1234
+ const m = Cr(e.card, {
1237
1235
  ...f ? { column: { kind: "field", fieldId: f } } : {},
1238
1236
  resultColumnKey: e.target.kind === "column" ? e.target.columnKey : void 0
1239
1237
  }), p = m.authoredFormat;
@@ -1243,7 +1241,7 @@ function Ga(e) {
1243
1241
  e.boundCurrency
1244
1242
  ) : void 0;
1245
1243
  }
1246
- if (!((l = e.card.sql) != null && l.trim()) && !Rr(e.card.type) && e.target.kind === "metric") {
1244
+ if (!((l = e.card.sql) != null && l.trim()) && !Kr(e.card.type) && e.target.kind === "metric") {
1247
1245
  const f = e.target.metricId, m = (u = (d = e.card.config) == null ? void 0 : d.metricColumns) == null ? void 0 : u.find(
1248
1246
  (g) => g.id === f
1249
1247
  );
@@ -1280,11 +1278,11 @@ function Ga(e) {
1280
1278
  });
1281
1279
  return N(a) ? a : void 0;
1282
1280
  }
1283
- function Tc(e) {
1281
+ function wc(e) {
1284
1282
  var n, r;
1285
1283
  const t = e.persistedSettings ?? H(e.card)[e.columnId];
1286
1284
  if (!t && !e.resolvedSettings || (t == null ? void 0 : t.inheritMetricFormat) === !0 || ((n = e.resolvedSettings) == null ? void 0 : n.inheritMetricFormat) === !0) {
1287
- const i = Q(
1285
+ const i = Y(
1288
1286
  (r = le(e.card, {
1289
1287
  columnId: e.columnId,
1290
1288
  metricId: e.metricId,
@@ -1298,16 +1296,16 @@ function Tc(e) {
1298
1296
  preserveOmittedProperties: !0
1299
1297
  });
1300
1298
  }
1301
- return Ua(
1302
- Kn({
1299
+ return za(
1300
+ Vn({
1303
1301
  ...e,
1304
1302
  persistedSettings: t
1305
1303
  })
1306
1304
  );
1307
1305
  }
1308
- function Dc(e) {
1306
+ function Tc(e) {
1309
1307
  const { value: t, formatOptions: n, preferences: r } = e;
1310
- return n != null && n.type && n.type !== "auto" ? st(t, n.type, n) : ka({
1308
+ return n != null && n.type && n.type !== "auto" ? st(t, n.type, n) : Ma({
1311
1309
  number: t,
1312
1310
  decimalPlaces: 0,
1313
1311
  useSuffix: !1,
@@ -1316,8 +1314,8 @@ function Dc(e) {
1316
1314
  currency: ""
1317
1315
  });
1318
1316
  }
1319
- function Wa(e) {
1320
- return Kr({
1317
+ function Ha(e) {
1318
+ return Vr({
1321
1319
  ...e,
1322
1320
  activation: Je({
1323
1321
  card: e.card,
@@ -1325,8 +1323,8 @@ function Wa(e) {
1325
1323
  })
1326
1324
  });
1327
1325
  }
1328
- function kc(e) {
1329
- return Vr({
1326
+ function Dc(e) {
1327
+ return Lr({
1330
1328
  activation: Je({
1331
1329
  card: e.card,
1332
1330
  cardConfig: e.cardConfig
@@ -1335,8 +1333,8 @@ function kc(e) {
1335
1333
  expectedResultOwner: e.expectedResultOwner
1336
1334
  });
1337
1335
  }
1338
- function Ha(e) {
1339
- const t = on(e.card, e.effectiveCardConfig), n = va({
1336
+ function Qa(e) {
1337
+ const t = on(e.card, e.effectiveCardConfig), n = Ia({
1340
1338
  card: t,
1341
1339
  records: e.rows,
1342
1340
  keys: e.rows.length === 0 ? e.resultKeys : void 0,
@@ -1373,20 +1371,20 @@ function Ya(e) {
1373
1371
  const t = on(e.card, e.effectiveCardConfig), { cardId: n, ...r } = e.requestPayloadBase, i = e.formatOptions.visibleColumns ?? [], o = [
1374
1372
  ...i,
1375
1373
  ...Object.keys(e.formatOptions.columnSettings ?? {})
1376
- ], a = Cr(
1374
+ ], a = Fr(
1377
1375
  e.card,
1378
1376
  i,
1379
1377
  e.effectiveCardConfig
1380
- ), s = Fr(
1378
+ ), s = Sr(
1381
1379
  e.card,
1382
1380
  e.effectiveCardConfig,
1383
1381
  a
1384
- ), c = Sr(
1382
+ ), c = xr(
1385
1383
  t,
1386
1384
  o
1387
1385
  ), l = new Set(
1388
1386
  c.eligibleTargets.map(_e)
1389
- ), d = (v) => l.has(_e(v)) ? wr({
1387
+ ), d = (v) => l.has(_e(v)) ? Tr({
1390
1388
  bindings: r.controlBindings,
1391
1389
  controls: [
1392
1390
  ...r.controlDefinitions ?? [],
@@ -1396,14 +1394,14 @@ function Ya(e) {
1396
1394
  target: v,
1397
1395
  knownTargets: c.knownTargets,
1398
1396
  eligibleTargets: c.eligibleTargets
1399
- }).currency : void 0, u = xr({
1397
+ }).currency : void 0, u = wr({
1400
1398
  card: e.card,
1401
1399
  comparisonMetadata: e.comparisonMetadata,
1402
1400
  columnKeyMap: e.columnKeyMap
1403
1401
  }), f = Je({
1404
1402
  card: e.card,
1405
1403
  cardConfig: e.effectiveCardConfig
1406
- }), m = Wa({
1404
+ }), m = Ha({
1407
1405
  card: e.card,
1408
1406
  cardConfig: e.effectiveCardConfig,
1409
1407
  columns: e.resultColumns,
@@ -1425,7 +1423,7 @@ function Ya(e) {
1425
1423
  throw new Error(
1426
1424
  "Canonical raw temporal export requires an authoritative columnKeyMap."
1427
1425
  );
1428
- const b = Lr({
1426
+ const b = qr({
1429
1427
  cardType: e.card.type,
1430
1428
  resultOwner: r.resultOwner,
1431
1429
  effectiveCardConfig: e.effectiveCardConfig,
@@ -1447,7 +1445,7 @@ function Ya(e) {
1447
1445
  H(e.card)
1448
1446
  )) {
1449
1447
  if (I.type !== "date") continue;
1450
- const b = qr(I.dateFormat);
1448
+ const b = Br(I.dateFormat);
1451
1449
  b && g.set(
1452
1450
  v,
1453
1451
  Xi({
@@ -1460,27 +1458,27 @@ function Ya(e) {
1460
1458
  const h = [
1461
1459
  ...new Set(o)
1462
1460
  ].flatMap((v) => {
1463
- var G, $, ue;
1461
+ var G, E, ue;
1464
1462
  if (m.byColumnKey.has(v) || g.has(v))
1465
1463
  return [];
1466
1464
  const I = u.columnPresentationOwners.get(v), b = {
1467
- ...Br(t, v, {
1465
+ ...Ur(t, v, {
1468
1466
  columnKeyMap: e.columnKeyMap,
1469
1467
  resultColumns: e.resultColumns
1470
1468
  }),
1471
1469
  ...I ? { metricId: I.metricId, metricAlias: I.metricAlias } : {}
1472
1470
  }, S = (G = t.sql) != null && G.trim() ? void 0 : le(t, b), P = S ? { kind: "metric", metricId: S.id } : { kind: "column", columnKey: v }, k = l.has(
1473
1471
  _e(P)
1474
- ), L = d(P), j = H(t)[v], E = {
1472
+ ), L = d(P), j = H(t)[v], $ = {
1475
1473
  dashboardId: e.dashboardId,
1476
1474
  cardId: t.id
1477
- }, ee = { kind: "column", columnKey: v }, M = S && (!j || j.inheritMetricFormat === !0) ? Q(S.format, {
1475
+ }, ee = { kind: "column", columnKey: v }, M = S && (!j || j.inheritMetricFormat === !0) ? Y(S.format, {
1478
1476
  preserveOmittedProperties: !0
1479
1477
  }) : void 0;
1480
1478
  if ((M == null ? void 0 : M.type) === "date")
1481
1479
  return [
1482
1480
  {
1483
- scope: E,
1481
+ scope: $,
1484
1482
  target: ee,
1485
1483
  format: {
1486
1484
  type: "date",
@@ -1491,7 +1489,7 @@ function Ya(e) {
1491
1489
  }
1492
1490
  }
1493
1491
  ];
1494
- const q = (I ? ja({
1492
+ const q = (I ? Ga({
1495
1493
  card: t,
1496
1494
  columnId: v,
1497
1495
  columnKeyMap: e.columnKeyMap,
@@ -1499,12 +1497,12 @@ function Ya(e) {
1499
1497
  metricId: I.metricId,
1500
1498
  metricAlias: I.metricAlias,
1501
1499
  comparisonValueKind: I.kind,
1502
- comparisonPrecision: (ue = ($ = t.preferences) == null ? void 0 : $.comparisonPresentation) == null ? void 0 : ue.precision,
1500
+ comparisonPrecision: (ue = (E = t.preferences) == null ? void 0 : E.comparisonPresentation) == null ? void 0 : ue.precision,
1503
1501
  presentation: {
1504
1502
  preferences: e.reportContext.valueFormat,
1505
1503
  resolveBoundCurrency: d
1506
1504
  }
1507
- }) : void 0) ?? (k ? Ga({
1505
+ }) : void 0) ?? (k ? Wa({
1508
1506
  card: t,
1509
1507
  target: P,
1510
1508
  resultColumnKeys: o,
@@ -1528,7 +1526,7 @@ function Ya(e) {
1528
1526
  e.reportContext.valueFormat
1529
1527
  );
1530
1528
  return [
1531
- B.type === "duration" ? { scope: E, target: ee, format: B } : { scope: E, target: ee, format: B }
1529
+ B.type === "duration" ? { scope: $, target: ee, format: B } : { scope: $, target: ee, format: B }
1532
1530
  ];
1533
1531
  });
1534
1532
  h.push(
@@ -1546,7 +1544,7 @@ function Ya(e) {
1546
1544
  cardId: e.card.id
1547
1545
  },
1548
1546
  target: { kind: "column", columnKey: v.columnKey },
1549
- format: Ur(
1547
+ format: zr(
1550
1548
  I,
1551
1549
  {
1552
1550
  dateStyle: e.reportContext.valueFormat.dateStyle,
@@ -1577,8 +1575,8 @@ function Ya(e) {
1577
1575
  ...s ? { tableTotalsRequest: s } : {}
1578
1576
  };
1579
1577
  }
1580
- function Qa(e) {
1581
- const t = Dr(
1578
+ function Ja(e) {
1579
+ const t = kr(
1582
1580
  e.card,
1583
1581
  e.requestPayloadBase
1584
1582
  ), { cardId: n, ...r } = t.requestPayloadBase, i = Ya(e);
@@ -1595,14 +1593,14 @@ function Qa(e) {
1595
1593
  formatOptions: i.formatOptions
1596
1594
  };
1597
1595
  }
1598
- function Mc(e) {
1596
+ function kc(e) {
1599
1597
  const { card: t, result: n } = e;
1600
1598
  if (t.type !== "table" && t.type !== "detailTable")
1601
1599
  return { status: "refused", reason: "not_a_table" };
1602
- const r = n.modelFormats ? Qi(e.effectiveCardConfig ?? t.config, n) : e.effectiveCardConfig;
1603
- if (Tr({ card: t, comparisonMetadata: n.comparisonMetadata }))
1600
+ const r = n.modelFormats ? Ji(e.effectiveCardConfig ?? t.config, n) : e.effectiveCardConfig;
1601
+ if (Dr({ card: t, comparisonMetadata: n.comparisonMetadata }))
1604
1602
  return { status: "refused", reason: "comparison_metadata_missing" };
1605
- const i = Ha({
1603
+ const i = Qa({
1606
1604
  card: t,
1607
1605
  effectiveCardConfig: r,
1608
1606
  rows: e.rows,
@@ -1613,7 +1611,7 @@ function Mc(e) {
1613
1611
  });
1614
1612
  return i ? {
1615
1613
  status: "ready",
1616
- request: Qa({
1614
+ request: Ja({
1617
1615
  card: t,
1618
1616
  dashboardId: e.dashboardId,
1619
1617
  title: e.title,
@@ -1629,7 +1627,7 @@ function Mc(e) {
1629
1627
  })
1630
1628
  } : { status: "refused", reason: "columns_unresolved" };
1631
1629
  }
1632
- function Vn(e, t, n) {
1630
+ function Ln(e, t, n) {
1633
1631
  if (Pi(
1634
1632
  Ai(t),
1635
1633
  e.aggregateOrigin
@@ -1641,7 +1639,7 @@ function Vn(e, t, n) {
1641
1639
  aggregateOrigin: e.aggregate ? e.aggregateOrigin : r ? t.aggregateOrigin : void 0
1642
1640
  };
1643
1641
  }
1644
- function Ja(e, t, n) {
1642
+ function Za(e, t, n) {
1645
1643
  var r, i, o, a, s, c;
1646
1644
  if (n === "domain")
1647
1645
  return {
@@ -1654,7 +1652,7 @@ function Ja(e, t, n) {
1654
1652
  windowTransform: ((s = e.parameters) == null ? void 0 : s.windowTransform) ?? ((c = t.parameters) == null ? void 0 : c.windowTransform)
1655
1653
  };
1656
1654
  }
1657
- function Oc(e, t, n) {
1655
+ function Mc(e, t, n) {
1658
1656
  const r = e;
1659
1657
  return {
1660
1658
  id: e.id,
@@ -1663,22 +1661,22 @@ function Oc(e, t, n) {
1663
1661
  // range bounds). They do not identify or redefine the catalog calculation.
1664
1662
  ...n === "selection" && e.alias ? { alias: e.alias } : {},
1665
1663
  granularity: e.granularity ?? t.granularity,
1666
- ...Vn(e, t, n),
1664
+ ...Ln(e, t, n),
1667
1665
  ...e.role === "metric" ? {
1668
1666
  aliasTemplate: r.aliasTemplate,
1669
1667
  valueAliases: r.valueAliases,
1670
1668
  comparison: r.comparison,
1671
1669
  comparisonPolarity: r.comparisonPolarity,
1672
- parameters: Ja(
1670
+ parameters: Za(
1673
1671
  r,
1674
1672
  t,
1675
1673
  "domain"
1676
1674
  )
1677
1675
  } : {},
1678
- ...Za(e)
1676
+ ...eo(e)
1679
1677
  };
1680
1678
  }
1681
- function Za(e) {
1679
+ function eo(e) {
1682
1680
  const t = {
1683
1681
  ...e.labelOrigin === "override" ? { label: e.label, labelOrigin: e.labelOrigin } : {},
1684
1682
  ...e.formatOrigin === "override" ? { format: e.format, formatOrigin: e.formatOrigin } : {}
@@ -1698,17 +1696,17 @@ function Za(e) {
1698
1696
  return t;
1699
1697
  }
1700
1698
  }
1701
- const eo = "table";
1702
- function _c({ preferences: e, ...t }) {
1699
+ const to = "table";
1700
+ function Oc({ preferences: e, ...t }) {
1703
1701
  return {
1704
1702
  ...t,
1705
- type: eo,
1703
+ type: to,
1706
1704
  preferences: e ?? { onClickFilter: [{ columnIndex: 0, expression: "" }] },
1707
1705
  sql: "",
1708
1706
  data: []
1709
1707
  };
1710
1708
  }
1711
- function Pc(e) {
1709
+ function _c(e) {
1712
1710
  return {
1713
1711
  id: e.id,
1714
1712
  title: e.title,
@@ -1718,7 +1716,7 @@ function Pc(e) {
1718
1716
  data: []
1719
1717
  };
1720
1718
  }
1721
- const to = {
1719
+ const no = {
1722
1720
  SUM: "total",
1723
1721
  AVG: "average",
1724
1722
  MIN: "lowest",
@@ -1737,9 +1735,9 @@ function me(e) {
1737
1735
  function Ut(e) {
1738
1736
  return e.length <= 1 ? e[0] ?? "" : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
1739
1737
  }
1740
- function no(e) {
1738
+ function ro(e) {
1741
1739
  var i, o, a;
1742
- const t = ta({ variables: [e] })[0];
1740
+ const t = na({ variables: [e] })[0];
1743
1741
  if (!t) return;
1744
1742
  const n = Ze(t.card), r = n.kind === "config" ? n.executableSources[0] : n.kind === "sql" ? (i = n.pinnedCatalogSources[0]) == null ? void 0 : i.source : void 0;
1745
1743
  if (!r) {
@@ -1749,32 +1747,32 @@ function no(e) {
1749
1747
  if (r.kind === "semantic") return r.label || r.datasetName;
1750
1748
  if (r.kind === "physical") return r.label || r.tableName;
1751
1749
  }
1752
- function ro(e) {
1750
+ function io(e) {
1753
1751
  var r;
1754
- const t = (r = e.query.config) == null ? void 0 : r.filters, n = t ? Ln(t) : 0;
1752
+ const t = (r = e.query.config) == null ? void 0 : r.filters, n = t ? qn(t) : 0;
1755
1753
  return n ? n === 1 ? " with one condition" : ` with ${n} conditions` : "";
1756
1754
  }
1757
- function Ln(e) {
1755
+ function qn(e) {
1758
1756
  var t;
1759
- return (((t = e.conditions) == null ? void 0 : t.length) ?? 0) + (e.groups ?? []).reduce((n, r) => n + Ln(r), 0);
1757
+ return (((t = e.conditions) == null ? void 0 : t.length) ?? 0) + (e.groups ?? []).reduce((n, r) => n + qn(r), 0);
1760
1758
  }
1761
1759
  function zt(e) {
1762
1760
  if (!e) return "";
1763
1761
  const t = ce(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";
1764
1762
  return ` by ${e.aggregate ? me(e) : ne(e)}, ${n}`;
1765
1763
  }
1766
- function io(e) {
1764
+ function ao(e) {
1767
1765
  var s, c, l;
1768
- const t = no(e), n = t ? ` in ${t}` : "", r = ro(e);
1766
+ const t = ro(e), n = t ? ` in ${t}` : "", r = io(e);
1769
1767
  if ((s = e.query.sql) != null && s.trim()) {
1770
1768
  const d = e.get.kind === "first" ? "the first row" : "the only row";
1771
- return `${ao(d)} of a SQL query${t ? ` on ${t}` : ""}`;
1769
+ return `${oo(d)} of a SQL query${t ? ` on ${t}` : ""}`;
1772
1770
  }
1773
1771
  const i = e.query.config ?? {}, o = i.groupByColumns ?? [], a = i.metricColumns ?? [];
1774
1772
  switch (e.get.kind) {
1775
1773
  case "aggregate": {
1776
1774
  const d = a[0];
1777
- return d ? d.aggregate ? `The ${to[String(d.aggregate).toUpperCase()] ?? String(d.aggregate).toLowerCase()} ${me(d)}${n}${r}${jt(e)}` : `The ${ne(d)}${n}${r}${jt(e)}` : "An aggregate, with no measure chosen yet";
1775
+ return d ? d.aggregate ? `The ${no[String(d.aggregate).toUpperCase()] ?? String(d.aggregate).toLowerCase()} ${me(d)}${n}${r}${jt(e)}` : `The ${ne(d)}${n}${r}${jt(e)}` : "An aggregate, with no measure chosen yet";
1778
1776
  }
1779
1777
  case "list": {
1780
1778
  const d = o[0];
@@ -1791,13 +1789,13 @@ function io(e) {
1791
1789
  }
1792
1790
  }
1793
1791
  function jt(e) {
1794
- const t = na(e);
1795
- return t ? `, compared with ${zr({ mode: "explicit", spec: t })}` : "";
1792
+ const t = ra(e);
1793
+ return t ? `, compared with ${jr({ mode: "explicit", spec: t })}` : "";
1796
1794
  }
1797
- function ao(e) {
1795
+ function oo(e) {
1798
1796
  return e.charAt(0).toUpperCase() + e.slice(1);
1799
1797
  }
1800
- function oo(e, t) {
1798
+ function so(e, t) {
1801
1799
  const n = e.sheets ?? [], r = n.findIndex((a) => a.id === t.sheetId), i = n[r];
1802
1800
  if (!i)
1803
1801
  throw new F("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`);
@@ -1813,11 +1811,11 @@ function oo(e, t) {
1813
1811
  clauses: [T.arranged(i.title || "the dashboard", t.keepOrder === !0, !(i.frames ?? []).length)]
1814
1812
  };
1815
1813
  }
1816
- function so(e) {
1814
+ function co(e) {
1817
1815
  return !!(e && Object.prototype.hasOwnProperty.call(e, "calculatedFields"));
1818
1816
  }
1819
- function Y(...e) {
1820
- return jr(e.flatMap((t) => t || []));
1817
+ function X(...e) {
1818
+ return Gr(e.flatMap((t) => t || []));
1821
1819
  }
1822
1820
  function ie(e, t) {
1823
1821
  return {
@@ -1828,10 +1826,10 @@ function ie(e, t) {
1828
1826
  function ft(e) {
1829
1827
  return ((e == null ? void 0 : e.calculatedFields) || []).filter((t) => t.fieldScope === "sheet").map((t) => ie(t, "sheet"));
1830
1828
  }
1831
- function qn(e) {
1829
+ function Bn(e) {
1832
1830
  return ((e == null ? void 0 : e.calculatedFields) || []).filter((t) => !t.fieldScope).map((t) => ie(t, "sheet"));
1833
1831
  }
1834
- function co(e) {
1832
+ function lo(e) {
1835
1833
  return e ? [
1836
1834
  ...(e.calculatedFields || []).filter(
1837
1835
  (t) => t.fieldScope === "dashboard"
@@ -1839,21 +1837,21 @@ function co(e) {
1839
1837
  ...(e.frames || []).flatMap((t) => t.calculatedFields || [])
1840
1838
  ].map((t) => ie(t, "dashboard")) : [];
1841
1839
  }
1842
- function lo(e) {
1840
+ function uo(e) {
1843
1841
  if (e !== void 0)
1844
- return Y(
1842
+ return X(
1845
1843
  e.map((t) => ie(t, "dashboard"))
1846
1844
  );
1847
1845
  }
1848
- function Ac(e) {
1846
+ function Pc(e) {
1849
1847
  var r;
1850
1848
  const t = [], n = (e.sheets || []).map((i) => {
1851
1849
  var o;
1852
- return t.push(...co(i)), {
1850
+ return t.push(...lo(i)), {
1853
1851
  ...i,
1854
- calculatedFields: Y(
1852
+ calculatedFields: X(
1855
1853
  ft(i),
1856
- qn(i)
1854
+ Bn(i)
1857
1855
  ),
1858
1856
  frames: (o = i.frames) == null ? void 0 : o.map(
1859
1857
  (a) => a.calculatedFields === void 0 ? a : { ...a, calculatedFields: void 0 }
@@ -1862,8 +1860,8 @@ function Ac(e) {
1862
1860
  });
1863
1861
  return {
1864
1862
  ...e,
1865
- calculatedFields: lo(
1866
- Y(
1863
+ calculatedFields: uo(
1864
+ X(
1867
1865
  (r = e.calculatedFields) == null ? void 0 : r.map(
1868
1866
  (i) => ie(i, "dashboard")
1869
1867
  ),
@@ -1880,35 +1878,35 @@ function Gt(e, t) {
1880
1878
  const n = t ? e.frames.find((o) => o.id === t) : void 0, r = e.frames.filter(
1881
1879
  (o) => !t || o.id !== t
1882
1880
  );
1883
- return Y(
1881
+ return X(
1884
1882
  n == null ? void 0 : n.calculatedFields,
1885
1883
  ...r.map((o) => o.calculatedFields)
1886
1884
  );
1887
1885
  }
1888
- function uo(e, t) {
1886
+ function fo(e, t) {
1889
1887
  return e ? ft(e) : [];
1890
1888
  }
1891
- function Nc(e, t) {
1889
+ function Ac(e, t) {
1892
1890
  if (!e)
1893
1891
  return [];
1894
- const n = ft(e), r = qn(e), i = Y(
1892
+ const n = ft(e), r = Bn(e), i = X(
1895
1893
  n,
1896
1894
  r
1897
1895
  );
1898
- return so(e) ? i.length === 0 ? [] : r.length === 0 ? i : Y(
1896
+ return co(e) ? i.length === 0 ? [] : r.length === 0 ? i : X(
1899
1897
  i,
1900
1898
  Gt(e, t)
1901
1899
  ) : Gt(e, t);
1902
1900
  }
1903
- function fo(e) {
1901
+ function mo(e) {
1904
1902
  if (e !== void 0)
1905
- return Y(
1903
+ return X(
1906
1904
  e.map((t) => ie(t, "sheet"))
1907
1905
  );
1908
1906
  }
1909
- function Ec(e) {
1907
+ function Nc(e) {
1910
1908
  const { field: t, sheetFields: n = [], dashboardFields: r = [] } = e, i = (s) => s.find(
1911
- (c) => Gr(c, t, {
1909
+ (c) => Wr(c, t, {
1912
1910
  allowComparableFallback: !0
1913
1911
  })
1914
1912
  );
@@ -1922,7 +1920,7 @@ function Ec(e) {
1922
1920
  const a = i(r);
1923
1921
  return a ? { scope: "dashboard", matchedField: a } : { scope: "card" };
1924
1922
  }
1925
- function mo(e, t) {
1923
+ function po(e, t) {
1926
1924
  var C, v, I;
1927
1925
  const n = (e.sheets ?? []).findIndex((b) => b.id === t.sheetId), r = (C = e.sheets) == null ? void 0 : C[n];
1928
1926
  if (!(r != null && r.frames))
@@ -1935,25 +1933,25 @@ function mo(e, t) {
1935
1933
  return b.some((S) => S.id === i.id) ? b : [i, ...b];
1936
1934
  })() : [i], u = new Map(d.map((b) => [b.id, b])), f = J(r, { kind: "frame_updated", frame: i, resizeForNewKind: t.resizeLayouts });
1937
1935
  let m = /* @__PURE__ */ new Set();
1938
- const p = Wr.produce(e, (b) => {
1936
+ const p = Hr.produce(e, (b) => {
1939
1937
  const S = b.sheets[n];
1940
- f.layouts !== r.layouts && (S.layouts = Dt(f.layouts)), f.customizedBreakpoints !== r.customizedBreakpoints && (S.customizedBreakpoints = f.customizedBreakpoints), t.sheetCalculatedFields !== void 0 && (S.calculatedFields = fo(t.sheetCalculatedFields)), S.frames = S.frames.map((k) => {
1938
+ f.layouts !== r.layouts && (S.layouts = Dt(f.layouts)), f.customizedBreakpoints !== r.customizedBreakpoints && (S.customizedBreakpoints = f.customizedBreakpoints), t.sheetCalculatedFields !== void 0 && (S.calculatedFields = mo(t.sheetCalculatedFields)), S.frames = S.frames.map((k) => {
1941
1939
  const L = u.get(k.id);
1942
1940
  return L ? Dt(c(L)) : k.calculatedFields === void 0 ? k : { ...k, calculatedFields: void 0 };
1943
1941
  });
1944
1942
  const P = Tt(S);
1945
- m = new Set([...s].filter((k) => !P.has(k))), Hr(b, m), t.dashboardCalculatedFields && (b.calculatedFields = t.dashboardCalculatedFields);
1943
+ m = new Set([...s].filter((k) => !P.has(k))), Qr(b, m), t.dashboardCalculatedFields && (b.calculatedFields = t.dashboardCalculatedFields);
1946
1944
  }), y = p.sheets[n].frames.find((b) => b.id === i.id), g = [
1947
1945
  ...m.size ? [{ kind: "cards_removed", cardIds: [...m] }] : [],
1948
1946
  { kind: "frame_committed", sheetId: t.sheetId, before: a, after: y }
1949
1947
  ], h = ((v = i.cards) == null ? void 0 : v.find((b) => b.id === i.activeCardId)) ?? ((I = i.cards) == null ? void 0 : I[0]);
1950
1948
  return { dashboard: p, runtimeEffects: g, clauses: [T.committed(h == null ? void 0 : h.title)] };
1951
1949
  }
1952
- function po(e, t) {
1950
+ function go(e, t) {
1953
1951
  const n = { ...e }, r = [];
1954
1952
  return t.title !== void 0 && t.title !== e.title && (n.title = t.title, r.push(T.plain("dashboard", `renames the dashboard to ${w(t.title)}`))), t.description === null && e.description ? (delete n.description, r.push(T.plain("dashboard", "removes the dashboard's description"))) : typeof t.description == "string" && t.description !== e.description && (n.description = t.description, r.push(T.plain("dashboard", "changes the dashboard's description"))), { dashboard: n, clauses: r.length ? r : [T.plain("dashboard", "changes nothing on the dashboard")] };
1955
1953
  }
1956
- function go(e, t, n) {
1954
+ function ho(e, t, n) {
1957
1955
  const r = e.sheets ?? [], i = r.findIndex((s) => s.id === t), o = r[i];
1958
1956
  if (!o) throw new F("sheet_not_found", `No sheet ${t} on this dashboard.`);
1959
1957
  if (xe(o))
@@ -1971,10 +1969,10 @@ function Ge(e) {
1971
1969
  const { visualId: t, ...n } = e;
1972
1970
  return n;
1973
1971
  }
1974
- const Bn = (e) => e.cards.find((t) => t.id === e.activeCardId) ?? e.cards[0], Ee = (e) => T.plain("detached", `makes ${e} local to this report; it no longer follows its library visual`);
1975
- function ho(e, t) {
1972
+ const Un = (e) => e.cards.find((t) => t.id === e.activeCardId) ?? e.cards[0], $e = (e) => T.plain("detached", `makes ${e} local to this report; it no longer follows its library visual`);
1973
+ function yo(e, t) {
1976
1974
  var p;
1977
- const { sheets: n, sheetIndex: r, sheet: i, cards: o } = go(e, t.sheetId, t.cardIds), a = pe(i, t.cardIds[0]).id;
1975
+ const { sheets: n, sheetIndex: r, sheet: i, cards: o } = ho(e, t.sheetId, t.cardIds), a = pe(i, t.cardIds[0]).id;
1978
1976
  let s = i;
1979
1977
  const c = [];
1980
1978
  for (const y of t.cardIds.slice(1)) {
@@ -1982,17 +1980,17 @@ function ho(e, t) {
1982
1980
  if (g.id === a) continue;
1983
1981
  const h = ln(g, y);
1984
1982
  if (!h.cards.length) {
1985
- g.visualId && c.push(Ee(w(g.cards[0].title))), s = J(s, { kind: "frame_removed", frameId: g.id });
1983
+ g.visualId && c.push($e(w(g.cards[0].title))), s = J(s, { kind: "frame_removed", frameId: g.id });
1986
1984
  continue;
1987
1985
  }
1988
- g.visualId && c.push(Ee(`the tile of ${w((p = Bn(h)) == null ? void 0 : p.title)}`)), s = J(s, { kind: "frame_updated", frame: g.visualId ? Ge(h) : h, resizeForNewKind: !0 });
1986
+ g.visualId && c.push($e(`the tile of ${w((p = Un(h)) == null ? void 0 : p.title)}`)), s = J(s, { kind: "frame_updated", frame: g.visualId ? Ge(h) : h, resizeForNewKind: !0 });
1989
1987
  }
1990
1988
  const l = pe(s, t.cardIds[0]), d = new Set(t.cardIds), u = {
1991
1989
  ...l,
1992
1990
  cards: [...o, ...l.cards.filter((y) => !d.has(y.id))],
1993
1991
  activeCardId: t.cardIds[0]
1994
1992
  };
1995
- l.visualId && c.push(Ee("the tabs")), s = J(s, { kind: "frame_updated", frame: l.visualId ? Ge(u) : u, resizeForNewKind: !0 });
1993
+ l.visualId && c.push($e("the tabs")), s = J(s, { kind: "frame_updated", frame: l.visualId ? Ge(u) : u, resizeForNewKind: !0 });
1996
1994
  const f = o.map((y) => w(y.title)), m = [...new Map(c.map((y) => [y.lead, y])).values()];
1997
1995
  return {
1998
1996
  dashboard: { ...e, sheets: n.map((y, g) => g === r ? s : y) },
@@ -2000,7 +1998,7 @@ function ho(e, t) {
2000
1998
  detached: m.length > 0
2001
1999
  };
2002
2000
  }
2003
- function yo(e, t) {
2001
+ function bo(e, t) {
2004
2002
  var d;
2005
2003
  const n = e.sheets ?? [], r = n.findIndex((u) => !xe(u) && (u.frames ?? []).some((f) => f.cards.some((m) => m.id === t.cardId)));
2006
2004
  if (r < 0)
@@ -2025,13 +2023,13 @@ function yo(e, t) {
2025
2023
  return {
2026
2024
  dashboard: { ...e, sheets: n.map((u, f) => f === r ? c : u) },
2027
2025
  clauses: [
2028
- T.plain("layout", `gives ${w(a.title)} its own spot beside ${w((d = Bn(s)) == null ? void 0 : d.title)}`),
2026
+ T.plain("layout", `gives ${w(a.title)} its own spot beside ${w((d = Un(s)) == null ? void 0 : d.title)}`),
2029
2027
  ...l ? [T.plain("detached", "makes both spots local to this report; they no longer follow their library visual")] : []
2030
2028
  ],
2031
2029
  detached: l
2032
2030
  };
2033
2031
  }
2034
- function bo() {
2032
+ function vo() {
2035
2033
  return {
2036
2034
  version: 1,
2037
2035
  page: {
@@ -2052,7 +2050,7 @@ function bo() {
2052
2050
  sections: []
2053
2051
  };
2054
2052
  }
2055
- function vo() {
2053
+ function Io() {
2056
2054
  return {
2057
2055
  region: "header",
2058
2056
  enabled: !0,
@@ -2061,7 +2059,7 @@ function vo() {
2061
2059
  blocks: []
2062
2060
  };
2063
2061
  }
2064
- function Io() {
2062
+ function Co() {
2065
2063
  return {
2066
2064
  region: "footer",
2067
2065
  enabled: !0,
@@ -2070,18 +2068,18 @@ function Io() {
2070
2068
  blocks: []
2071
2069
  };
2072
2070
  }
2073
- function Un(e) {
2071
+ function zn(e) {
2074
2072
  return [{ type: "text", value: e }];
2075
2073
  }
2076
2074
  function $c(e, t = []) {
2077
- return Qr(e, { by: "then" }).flatMap((n) => n.type === "link" ? n.children ?? [] : [n]).map((n) => n.type === "text" ? n.value : `{{${Jr(n.ref, Zr({ kind: "document", inputs: t }))}}}`).join("") || "";
2075
+ return Jr(e, { by: "then" }).flatMap((n) => n.type === "link" ? n.children ?? [] : [n]).map((n) => n.type === "text" ? n.value : `{{${Zr(n.ref, ei({ kind: "document", inputs: t }))}}}`).join("") || "";
2078
2076
  }
2079
- function Co(e, t) {
2077
+ function Fo(e, t) {
2080
2078
  return e.find(
2081
2079
  (n) => n.type === "text" && n.role === t
2082
2080
  );
2083
2081
  }
2084
- function Rc(e, t) {
2082
+ function Ec(e, t) {
2085
2083
  return e.find(
2086
2084
  (n) => n.type === "image" && n.role === t
2087
2085
  );
@@ -2090,31 +2088,31 @@ function Wt(e, t) {
2090
2088
  const n = {
2091
2089
  ...t,
2092
2090
  type: "text",
2093
- content: typeof t.content == "string" ? Un(t.content) : t.content
2091
+ content: typeof t.content == "string" ? zn(t.content) : t.content
2094
2092
  };
2095
- return zn(e, n);
2093
+ return jn(e, n);
2096
2094
  }
2097
- function Kc(e, t) {
2098
- return zn(e, t);
2095
+ function Rc(e, t) {
2096
+ return jn(e, t);
2099
2097
  }
2100
- function zn(e, t) {
2098
+ function jn(e, t) {
2101
2099
  const n = e.findIndex((r) => r.id === t.id);
2102
2100
  return n === -1 ? [...e, t] : e.map(
2103
2101
  (r, i) => i === n ? t : r
2104
2102
  );
2105
2103
  }
2106
- function Fo(e, t) {
2104
+ function So(e, t) {
2107
2105
  const n = e.sheets ?? [], { id: r, title: i, kind: o } = t.sheet;
2108
2106
  if (n.some((s) => s.id === r))
2109
2107
  throw new F("sheet_id_taken", `A sheet with id ${r} is already on this dashboard.`);
2110
- const a = o === "document" ? { id: r, title: i, kind: o, document: bo() } : { id: r, title: i };
2108
+ const a = o === "document" ? { id: r, title: i, kind: o, document: vo() } : { id: r, title: i };
2111
2109
  return {
2112
2110
  dashboard: { ...e, sheets: [...n, a] },
2113
2111
  created: [{ kind: "sheet", id: r, title: i, ...t.changeIndex !== void 0 ? { changeIndex: t.changeIndex } : {} }],
2114
2112
  clauses: [T.plain("sheet", `adds the sheet ${w(i)}`)]
2115
2113
  };
2116
2114
  }
2117
- function So(e, t) {
2115
+ function xo(e, t) {
2118
2116
  const n = e.sheets ?? [], r = n.findIndex((o) => o.id === t.sheetId);
2119
2117
  if (r < 0)
2120
2118
  throw new F("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`);
@@ -2124,13 +2122,13 @@ function So(e, t) {
2124
2122
  clauses: [T.plain("sheet", `renames the sheet ${w(i.title)} to ${w(t.title)}`)]
2125
2123
  };
2126
2124
  }
2127
- function xo(e, t, n) {
2128
- var o;
2125
+ function wo(e, t, n) {
2126
+ var a;
2129
2127
  if (!e || !t || t.customFilterPreferences) return;
2130
- const r = t.defaultDateFilter;
2131
- return (t.dateSelectionMode === "day" ? ei(r) : t.dateSelectionMode === "months" && (ti(r) || ni(r) && r.unit === "month" && (r.mode === "previous" || r.mode === "this" && !r.toDate && !r.boundary))) && ((o = re(t, n)) == null ? void 0 : o.valueType) === "date" ? !0 : void 0;
2128
+ const r = t.defaultDateFilter, i = bn(r);
2129
+ return (t.dateSelectionMode === "day" ? ti(r) : t.dateSelectionMode === "months" && (ni(r) || !!(i && qi(i).monthPickerDefault))) && ((a = re(t, n)) == null ? void 0 : a.valueType) === "date" ? !0 : void 0;
2132
2130
  }
2133
- function Vc(e) {
2131
+ function Kc(e) {
2134
2132
  const t = e.createId ?? Ie, n = t(), r = ii({
2135
2133
  field: e.field,
2136
2134
  dataSource: e.dataSource,
@@ -2138,7 +2136,7 @@ function Vc(e) {
2138
2136
  connectionType: e.connectionType,
2139
2137
  filterId: t()
2140
2138
  });
2141
- return wo({
2139
+ return To({
2142
2140
  filter: e.label ? { ...r, title: e.label } : r,
2143
2141
  label: e.label || e.field.label || e.field.name,
2144
2142
  scope: e.scope,
@@ -2146,7 +2144,7 @@ function Vc(e) {
2146
2144
  createId: () => n
2147
2145
  });
2148
2146
  }
2149
- function wo(e) {
2147
+ function To(e) {
2150
2148
  const t = e.createId ?? Ie, n = e.label || e.filter.title || e.filter.column || e.filter.id, r = dn(e.dashboard, { label: n }), i = {
2151
2149
  ...un(e.filter),
2152
2150
  variableName: r
@@ -2164,9 +2162,9 @@ function wo(e) {
2164
2162
  exports: fn(i)
2165
2163
  };
2166
2164
  }
2167
- function To(e, t, n, r = { calendar: null }) {
2165
+ function Do(e, t, n, r = { calendar: null }) {
2168
2166
  var ht, yt, bt, vt, It, Ct, Ft, St;
2169
- const o = X(e).findFilterInput(t), a = (O, x) => ({
2167
+ const o = Q(e).findFilterInput(t), a = (O, x) => ({
2170
2168
  ok: !1,
2171
2169
  issues: [
2172
2170
  {
@@ -2199,9 +2197,9 @@ function To(e, t, n, r = { calendar: null }) {
2199
2197
  return a("The card mapping was prepared for another filter.");
2200
2198
  }
2201
2199
  const l = n.definition ? un(n.definition) : c;
2202
- if (l.kind === "global-date" && n.scope && !Do(n.scope))
2200
+ if (l.kind === "global-date" && n.scope && !ko(n.scope))
2203
2201
  return a("The Global Date filter applies to regular tabs only.");
2204
- const d = (yt = r.calendar) == null ? void 0 : yt.tz, u = n.definition !== void 0, f = n.forceSelection !== void 0 || u ? xo(
2202
+ const d = (yt = r.calendar) == null ? void 0 : yt.tz, u = n.definition !== void 0, f = n.forceSelection !== void 0 || u ? wo(
2205
2203
  n.forceSelection ?? s.forceSelection,
2206
2204
  l,
2207
2205
  d
@@ -2216,7 +2214,7 @@ function To(e, t, n, r = { calendar: null }) {
2216
2214
  const Oe = mn(l);
2217
2215
  x.presentation = { ...O.presentation }, g && (x.presentation.placement = Oe.placement), h && (Oe.widthPx === void 0 ? delete x.presentation.widthPx : x.presentation.widthPx = Oe.widthPx);
2218
2216
  }
2219
- return (n.forceSelection !== void 0 || u) && (f ? x.forceSelection = f : delete x.forceSelection), n.requiredAtExecution !== void 0 && (n.requiredAtExecution ? x.requiredAtExecution = !0 : delete x.requiredAtExecution), $e(x, "optionSource", n.optionSource), $e(x, "optionDependencies", n.optionDependencies), $e(x, "optionPopulation", n.optionPopulation), ((xt = n.mapping) == null ? void 0 : xt.kind) === "save" && n.mapping.draft.acceptance.ok ? x.application = n.mapping.draft.acceptance.application : ((wt = n.mapping) == null ? void 0 : wt.kind) === "remove" && delete x.application, x;
2217
+ return (n.forceSelection !== void 0 || u) && (f ? x.forceSelection = f : delete x.forceSelection), n.requiredAtExecution !== void 0 && (n.requiredAtExecution ? x.requiredAtExecution = !0 : delete x.requiredAtExecution), Ee(x, "optionSource", n.optionSource), Ee(x, "optionDependencies", n.optionDependencies), Ee(x, "optionPopulation", n.optionPopulation), ((xt = n.mapping) == null ? void 0 : xt.kind) === "save" && n.mapping.draft.acceptance.ok ? x.application = n.mapping.draft.acceptance.application : ((wt = n.mapping) == null ? void 0 : wt.kind) === "remove" && delete x.application, x;
2220
2218
  }, 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) => ({
2221
2219
  ...O,
2222
2220
  ...n.variableName !== void 0 ? { variableName: m } : {},
@@ -2240,13 +2238,13 @@ function To(e, t, n, r = { calendar: null }) {
2240
2238
  ((bt = j.issues[0]) == null ? void 0 : bt.message) ?? "These settings could not be saved.",
2241
2239
  j.issues[0]
2242
2240
  );
2243
- let E = { ...e, inputs: S };
2244
- const ee = X(E), M = ee.findFilterInput({ filterId: l.id });
2241
+ let $ = { ...e, inputs: S };
2242
+ const ee = Q($), M = ee.findFilterInput({ filterId: l.id });
2245
2243
  if (!M)
2246
2244
  return a(
2247
2245
  ((vt = ee.issues[0]) == null ? void 0 : vt.message) ?? "These settings could not be saved."
2248
2246
  );
2249
- const q = n.variableName !== void 0 || n.scope !== void 0 ? ko(E, M.input) : void 0;
2247
+ const q = n.variableName !== void 0 || n.scope !== void 0 ? Mo($, M.input) : void 0;
2250
2248
  if (q)
2251
2249
  return a(
2252
2250
  `Another filter on the same cards is already named "${q}". Choose another name.`
@@ -2255,11 +2253,11 @@ function To(e, t, n, r = { calendar: null }) {
2255
2253
  id: M.input.id,
2256
2254
  runtimeScope: M.input.runtimeScope
2257
2255
  };
2258
- let $ = {
2259
- defaultInputValues: E.defaultInputValues,
2256
+ let E = {
2257
+ defaultInputValues: $.defaultInputValues,
2260
2258
  dashboardInputValues: {}
2261
2259
  };
2262
- const ue = ((It = n.values) == null ? void 0 : It.target) ?? {}, A = _o(
2260
+ const ue = ((It = n.values) == null ? void 0 : It.target) ?? {}, A = Po(
2263
2261
  c,
2264
2262
  l,
2265
2263
  {
@@ -2274,12 +2272,12 @@ function To(e, t, n, r = { calendar: null }) {
2274
2272
  r.calendar ?? void 0
2275
2273
  );
2276
2274
  if (A.defaultValueChanged || A.selectionIdentityChanged || A.defaultComparisonChanged) {
2277
- const O = jn({
2278
- state: { ...$, dashboardInputValues: {} },
2275
+ const O = Gn({
2276
+ state: { ...E, dashboardInputValues: {} },
2279
2277
  input: G,
2280
2278
  settings: A
2281
2279
  });
2282
- $ = { ...$, defaultInputValues: O.defaultInputValues }, A.selectionIdentityChanged && B.push({
2280
+ E = { ...E, defaultInputValues: O.defaultInputValues }, A.selectionIdentityChanged && B.push({
2283
2281
  kind: "clear",
2284
2282
  inputId: G.id,
2285
2283
  target: A.target
@@ -2295,14 +2293,14 @@ function To(e, t, n, r = { calendar: null }) {
2295
2293
  });
2296
2294
  }
2297
2295
  if (n.scope && M.input.runtimeScope !== "shared") {
2298
- const O = Mo(
2299
- E,
2296
+ const O = Oo(
2297
+ $,
2300
2298
  s,
2301
2299
  M.input,
2302
- $.defaultInputValues
2300
+ E.defaultInputValues
2303
2301
  );
2304
- $ = {
2305
- ...$,
2302
+ E = {
2303
+ ...E,
2306
2304
  defaultInputValues: O.defaultInputValues
2307
2305
  }, B.push(
2308
2306
  ...O.dropped.map((x) => ({
@@ -2312,20 +2310,20 @@ function To(e, t, n, r = { calendar: null }) {
2312
2310
  }))
2313
2311
  );
2314
2312
  }
2315
- return E = Oo(E, $), {
2313
+ return $ = _o($, E), {
2316
2314
  ok: !0,
2317
- dashboard: E,
2315
+ dashboard: $,
2318
2316
  inputId: M.input.id,
2319
2317
  valueEffects: B
2320
2318
  };
2321
2319
  }
2322
- function Lc(e) {
2320
+ function Vc(e) {
2323
2321
  let t = kt({
2324
2322
  dashboard: e.before,
2325
2323
  runtimeValues: e.dashboardInputValues,
2326
2324
  calendar: e.calendar
2327
2325
  });
2328
- const n = X(e.after), r = (i) => {
2326
+ const n = Q(e.after), r = (i) => {
2329
2327
  var o;
2330
2328
  return (o = n.findFilterInput({ inputId: i })) == null ? void 0 : o.input;
2331
2329
  };
@@ -2336,7 +2334,7 @@ function Lc(e) {
2336
2334
  case "setDefaultComparison": {
2337
2335
  const o = r(i.inputId);
2338
2336
  if (!o) break;
2339
- t = jn({
2337
+ t = Gn({
2340
2338
  state: { dashboardInputValues: t },
2341
2339
  input: o,
2342
2340
  settings: {
@@ -2366,16 +2364,16 @@ function Lc(e) {
2366
2364
  calendar: e.calendar
2367
2365
  });
2368
2366
  }
2369
- function Do(e) {
2367
+ function ko(e) {
2370
2368
  var t;
2371
2369
  return e.kind !== "documentSections" && (e.kind !== "allSheets" || ((t = e.sheetKinds) == null ? void 0 : t.length) === 1 && e.sheetKinds[0] === "dashboard");
2372
2370
  }
2373
- function $e(e, t, n) {
2371
+ function Ee(e, t, n) {
2374
2372
  n !== void 0 && (n === null ? delete e[t] : e[t] = n);
2375
2373
  }
2376
- function ko(e, t) {
2374
+ function Mo(e, t) {
2377
2375
  const n = [
2378
- ...X(e).inputs.map((i) => i.input),
2376
+ ...Q(e).inputs.map((i) => i.input),
2379
2377
  ...(Array.isArray(e.inputs) ? e.inputs : []).filter(
2380
2378
  (i) => i.kind === "control"
2381
2379
  )
@@ -2390,21 +2388,21 @@ function ko(e, t) {
2390
2388
  )
2391
2389
  ) ? t.variableName : void 0;
2392
2390
  }
2393
- function Mo(e, t, n, r) {
2391
+ function Oo(e, t, n, r) {
2394
2392
  var d, u;
2395
- const i = [], o = vn(e), a = (f) => Ht(t, f, o), s = (f) => Ht(n, f, o), c = [];
2393
+ const i = [], o = In(e), a = (f) => Ht(t, f, o), s = (f) => Ht(n, f, o), c = [];
2396
2394
  if (n.runtimeScope === "perSheet")
2397
2395
  for (const f of o.values())
2398
2396
  c.push({ sheetId: f.sheetId, sheetKind: f.sheetKind });
2399
2397
  else if (n.runtimeScope === "perCard") {
2400
- for (const f of In(e))
2398
+ for (const f of Cn(e))
2401
2399
  c.push({
2402
2400
  sheetId: f.sheetId,
2403
2401
  cardId: f.cardId,
2404
2402
  sheetKind: (d = o.get(f.sheetId)) == null ? void 0 : d.sheetKind
2405
2403
  });
2406
2404
  for (const f of e.variables ?? [])
2407
- c.push(...ra(e, f.id));
2405
+ c.push(...ia(e, f.id));
2408
2406
  } else if (n.runtimeScope === "perDocumentSection")
2409
2407
  for (const f of e.sheets ?? [])
2410
2408
  for (const m of ((u = f.document) == null ? void 0 : u.sections) ?? [])
@@ -2427,15 +2425,15 @@ function Mo(e, t, n, r) {
2427
2425
  function Ht(e, t, n) {
2428
2426
  if (e.runtimeScope === "perSheet" && t.sheetId && !t.cardId && !t.sectionId) {
2429
2427
  const r = n.get(t.sheetId);
2430
- return r ? Cn(e, r) : !1;
2428
+ return r ? Fn(e, r) : !1;
2431
2429
  }
2432
- return ia(e, t);
2430
+ return aa(e, t);
2433
2431
  }
2434
- function Oo(e, t) {
2432
+ function _o(e, t) {
2435
2433
  const n = { ...e };
2436
2434
  return t.defaultInputValues && Object.keys(t.defaultInputValues).length ? n.defaultInputValues = t.defaultInputValues : e.defaultInputValues !== void 0 && delete n.defaultInputValues, n;
2437
2435
  }
2438
- function _o(e, t, n, r, i) {
2436
+ function Po(e, t, n, r, i) {
2439
2437
  const o = !!(n != null && n.defaultValueChanged || n != null && n.selectionIdentityChanged) || ri(e, t);
2440
2438
  return {
2441
2439
  ...n,
@@ -2444,7 +2442,7 @@ function _o(e, t, n, r, i) {
2444
2442
  defaultFilterValue: o ? re(t, i) : void 0
2445
2443
  };
2446
2444
  }
2447
- function jn(e) {
2445
+ function Gn(e) {
2448
2446
  const { settings: t } = e;
2449
2447
  if (!t) return e.state;
2450
2448
  const n = e.input;
@@ -2518,36 +2516,36 @@ function Me(e, t) {
2518
2516
  throw new F("filter_not_found", `No filter ${t} on this dashboard.`, "Read the outline again and use its filter ids.");
2519
2517
  return n;
2520
2518
  }
2521
- function Gn(e, t) {
2522
- const n = Fn(e, t);
2519
+ function Wn(e, t) {
2520
+ const n = Sn(e, t);
2523
2521
  return (n == null ? void 0 : n.kind) === "variable" ? `the variable ${n.variable.name}` : w(n == null ? void 0 : n.card.title);
2524
2522
  }
2525
- function Wn(e, t) {
2526
- if (!Fn(e, t))
2523
+ function Hn(e, t) {
2524
+ if (!Sn(e, t))
2527
2525
  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.");
2528
2526
  }
2529
- function Po(e, t, n) {
2530
- const r = X(e), i = r.findFilterInput({ inputId: t });
2527
+ function Ao(e, t, n) {
2528
+ const r = Q(e), i = r.findFilterInput({ inputId: t });
2531
2529
  return i ? r.reachedCards({ inputId: t }).filter(
2532
2530
  (o) => ["bound", "automatic", "sql", "relationshipApplied"].includes(
2533
2531
  oi(i.input, o.card, n).reach
2534
2532
  )
2535
2533
  ).length : 0;
2536
2534
  }
2537
- function Ao(e, t) {
2538
- return Hn(e, t, "relationship");
2539
- }
2540
2535
  function No(e, t) {
2541
- return Hn(e, t, "sqlTemplate");
2536
+ return Qn(e, t, "relationship");
2537
+ }
2538
+ function $o(e, t) {
2539
+ return Qn(e, t, "sqlTemplate");
2542
2540
  }
2543
- function Hn(e, t, n) {
2544
- const r = X(e), i = r.findFilterInput({ inputId: t });
2541
+ function Qn(e, t, n) {
2542
+ const r = Q(e), i = r.findFilterInput({ inputId: t });
2545
2543
  return i ? r.reachedCards({ inputId: t }).filter((o) => si(i.input, o.card) === n).length : 0;
2546
2544
  }
2547
2545
  function Xn(e, t) {
2548
2546
  if (t.scope.kind === "allSheets") return "every sheet";
2549
2547
  if (t.scope.kind !== "sheets") return "its cards";
2550
- const n = [...vn(e).values()].filter((r) => Cn(t, r));
2548
+ const n = [...In(e).values()].filter((r) => Fn(t, r));
2551
2549
  return we(n.map((r) => {
2552
2550
  var i, o;
2553
2551
  return ((o = (i = e.sheets) == null ? void 0 : i.find((a) => a.id === r.sheetId)) == null ? void 0 : o.title) ?? r.sheetId;
@@ -2557,7 +2555,7 @@ const Yn = (e) => {
2557
2555
  var t;
2558
2556
  return ((t = e.filter) == null ? void 0 : t.type) === "single" ? "single select" : "multi select";
2559
2557
  };
2560
- function Qn(e) {
2558
+ function Jn(e) {
2561
2559
  var t, n, r;
2562
2560
  if ((n = (t = e.filter) == null ? void 0 : t.defaultValues) != null && n.length) return `default ${e.filter.defaultValues.join(", ")}`;
2563
2561
  if ((r = e.filter) != null && r.defaultDateFilter) return "a default period";
@@ -2569,12 +2567,12 @@ function Eo(e, t) {
2569
2567
  const { input: n } = t, r = Z(e);
2570
2568
  if (r.some((d) => d.id === n.id))
2571
2569
  throw new F("filter_id_taken", `A filter with id ${n.id} is already on this dashboard.`);
2572
- if (X(e).findFilterInput({ filterId: n.filter.id }))
2570
+ if (Q(e).findFilterInput({ filterId: n.filter.id }))
2573
2571
  throw new F("filter_id_taken", `A filter definition with id ${n.filter.id} is already on this dashboard.`);
2574
- const i = { ...e, inputs: [...r, n] }, o = Po(i, n.id), a = Ao(i, n.id), s = No(i, n.id), c = we([
2572
+ const i = { ...e, inputs: [...r, n] }, o = Ao(i, n.id), a = No(i, n.id), s = $o(i, n.id), c = we([
2575
2573
  ...a ? [`may filter ${a} more through the domain's relationships`] : [],
2576
2574
  ...s ? [`may filter ${s} more through ${s === 1 ? "its" : "their"} SQL`] : []
2577
- ]), l = [Yn(n), Qn(n)].filter(Boolean).join(", ");
2575
+ ]), l = [Yn(n), Jn(n)].filter(Boolean).join(", ");
2578
2576
  return {
2579
2577
  dashboard: i,
2580
2578
  created: [
@@ -2592,8 +2590,8 @@ function Eo(e, t) {
2592
2590
  ]
2593
2591
  };
2594
2592
  }
2595
- function $o(e, t, n) {
2596
- const r = To(e, { inputId: t.filterId }, t.settings, {
2593
+ function Ro(e, t, n) {
2594
+ const r = Do(e, { inputId: t.filterId }, t.settings, {
2597
2595
  calendar: n.calendar
2598
2596
  });
2599
2597
  if (!r.ok) {
@@ -2609,22 +2607,20 @@ function $o(e, t, n) {
2609
2607
  return {
2610
2608
  dashboard: r.dashboard,
2611
2609
  runtimeEffects: [{ kind: "filter_value", effects: r.valueEffects }],
2612
- clauses: [de(`changes the filter ${w((i == null ? void 0 : i.label) ?? o.label)}: ${Ro(r.dashboard, i, o)}`)]
2610
+ clauses: [de(`changes the filter ${w((i == null ? void 0 : i.label) ?? o.label)}: ${Ko(r.dashboard, i, o)}`)]
2613
2611
  };
2614
2612
  }
2615
- function Ro(e, t, n) {
2616
- var a, s, c, l, d, u;
2613
+ function Ko(e, t, n) {
2614
+ var o, a, s, c, l, d;
2617
2615
  if (!t) return "updates its settings";
2618
2616
  const r = [];
2619
- t.label !== n.label && r.push(`renames it ${w(n.label)}`), (((a = t.filter) == null ? void 0 : a.type) ?? "multiple") !== (((s = n.filter) == null ? void 0 : s.type) ?? "multiple") && r.push(`makes it ${Yn(n)}`);
2620
- const i = JSON.stringify([((c = t.filter) == null ? void 0 : c.defaultValues) ?? null, ((l = t.filter) == null ? void 0 : l.defaultDateFilter) ?? null]), o = JSON.stringify([((d = n.filter) == null ? void 0 : d.defaultValues) ?? null, ((u = n.filter) == null ? void 0 : u.defaultDateFilter) ?? null]);
2621
- if (i !== o) {
2622
- const f = Qn(n);
2623
- r.push(f ? `sets its ${f.replace(/^default /, "default to ").replace(/^a default period$/, "default period")}` : "removes its default");
2617
+ if (t.label !== n.label && r.push(`renames it ${w(n.label)}`), (((o = t.filter) == null ? void 0 : o.type) ?? "multiple") !== (((a = n.filter) == null ? void 0 : a.type) ?? "multiple") && r.push(`makes it ${Yn(n)}`), JSON.stringify(((s = t.filter) == null ? void 0 : s.defaultValues) ?? null) !== JSON.stringify(((c = n.filter) == null ? void 0 : c.defaultValues) ?? null) || !Ni((l = t.filter) == null ? void 0 : l.defaultDateFilter, (d = n.filter) == null ? void 0 : d.defaultDateFilter)) {
2618
+ const u = Jn(n);
2619
+ r.push(u ? `sets its ${u.replace(/^default /, "default to ").replace(/^a default period$/, "default period")}` : "removes its default");
2624
2620
  }
2625
2621
  return JSON.stringify(t.scope) !== JSON.stringify(n.scope) && r.push(`applies it to ${Xn(e, n)}`), r.length ? we(r) : "keeps its settings";
2626
2622
  }
2627
- function Ko(e, t) {
2623
+ function Vo(e, t) {
2628
2624
  const n = Me(e, t);
2629
2625
  return {
2630
2626
  dashboard: {
@@ -2636,10 +2632,10 @@ function Ko(e, t) {
2636
2632
  clauses: [de(`removes the filter ${w(n.label)}`)]
2637
2633
  };
2638
2634
  }
2639
- function Vo(e, t, n) {
2635
+ function Lo(e, t, n) {
2640
2636
  var a;
2641
- Wn(e, n);
2642
- const r = oa(t.scope, n);
2637
+ Hn(e, n);
2638
+ const r = sa(t.scope, n);
2643
2639
  if (!r)
2644
2640
  throw new F(
2645
2641
  "filter_invalid",
@@ -2654,10 +2650,10 @@ function Vo(e, t, n) {
2654
2650
  inputs: Z(e).map((s) => s.id === t.id ? i : s)
2655
2651
  };
2656
2652
  }
2657
- function Jn(e, t, n, r, i) {
2653
+ function Zn(e, t, n, r, i) {
2658
2654
  var d, u;
2659
2655
  const o = Me(e, t);
2660
- Wn(e, n);
2656
+ Hn(e, n);
2661
2657
  const a = [...((d = o.application) == null ? void 0 : d.cards) ?? []], s = a.findIndex((f) => f.cardId === n);
2662
2658
  s >= 0 ? a[s] = r : a.push(r);
2663
2659
  const c = {
@@ -2676,7 +2672,7 @@ function Jn(e, t, n, r, i) {
2676
2672
  inputs: Z(e).map((f) => f.id === t ? c : f)
2677
2673
  };
2678
2674
  }
2679
- function Lo(e) {
2675
+ function qo(e) {
2680
2676
  switch (e.kind) {
2681
2677
  case "field":
2682
2678
  return `by ${e.field.name}`;
@@ -2686,23 +2682,23 @@ function Lo(e) {
2686
2682
  return String(e.kind);
2687
2683
  }
2688
2684
  }
2689
- function qo(e, t) {
2690
- const n = Me(e, t.filterId), r = { ...t.binding, kind: "bound", cardId: t.cardId }, i = aa(n.scope, t.cardId), o = i !== n.scope;
2685
+ function Bo(e, t) {
2686
+ const n = Me(e, t.filterId), r = { ...t.binding, kind: "bound", cardId: t.cardId }, i = oa(n.scope, t.cardId), o = i !== n.scope;
2691
2687
  return {
2692
- dashboard: Jn(e, t.filterId, t.cardId, r, o ? i : void 0),
2688
+ dashboard: Zn(e, t.filterId, t.cardId, r, o ? i : void 0),
2693
2689
  clauses: [
2694
2690
  de(
2695
- `makes ${w(n.label)} filter ${Gn(e, t.cardId)} ${Lo(r.target)}${o ? ", which it used to leave out" : ""}`
2691
+ `makes ${w(n.label)} filter ${Wn(e, t.cardId)} ${qo(r.target)}${o ? ", which it used to leave out" : ""}`
2696
2692
  )
2697
2693
  ]
2698
2694
  };
2699
2695
  }
2700
- function Bo(e, t) {
2696
+ function Uo(e, t) {
2701
2697
  var i;
2702
2698
  const n = Me(e, t.filterId);
2703
2699
  return {
2704
- dashboard: ((i = n.filter) == null ? void 0 : i.kind) === "global-date" ? Vo(e, n, t.cardId) : Jn(e, t.filterId, t.cardId, { kind: "excluded", cardId: t.cardId }),
2705
- clauses: [de(`stops ${w(n.label)} from filtering ${Gn(e, t.cardId)}`)]
2700
+ dashboard: ((i = n.filter) == null ? void 0 : i.kind) === "global-date" ? Lo(e, n, t.cardId) : Zn(e, t.filterId, t.cardId, { kind: "excluded", cardId: t.cardId }),
2701
+ clauses: [de(`stops ${w(n.label)} from filtering ${Wn(e, t.cardId)}`)]
2706
2702
  };
2707
2703
  }
2708
2704
  function mt(e, t) {
@@ -2720,12 +2716,12 @@ function We(e, t) {
2720
2716
  throw new F("variable_not_found", `No variable ${t} on this dashboard.`, "Read the outline again and use its variable names.");
2721
2717
  return n;
2722
2718
  }
2723
- function Zn(e) {
2719
+ function er(e) {
2724
2720
  var r;
2725
- const t = io(e), n = t.charAt(0).toLowerCase() + t.slice(1);
2721
+ const t = ao(e), n = t.charAt(0).toLowerCase() + t.slice(1);
2726
2722
  return e.get.kind === "only" && !((r = e.query.sql) != null && r.trim()) ? `${n}. When more than one matches it shows nothing` : n;
2727
2723
  }
2728
- function Uo(e, t) {
2724
+ function zo(e, t) {
2729
2725
  const n = it(e, { kind: "add", variable: t.variable });
2730
2726
  n.ok || mt(n.issues, "This variable could not be added.");
2731
2727
  const { variable: r } = t;
@@ -2733,22 +2729,22 @@ function Uo(e, t) {
2733
2729
  dashboard: n.dashboard,
2734
2730
  created: [{ kind: "variable", id: r.id, title: r.name, ...t.changeIndex !== void 0 ? { changeIndex: t.changeIndex } : {} }],
2735
2731
  queryFrames: n.queryFrames,
2736
- clauses: [T.plain("variable", `adds the variable ${r.name}: ${Zn(r)}`)]
2732
+ clauses: [T.plain("variable", `adds the variable ${r.name}: ${er(r)}`)]
2737
2733
  };
2738
2734
  }
2739
- function zo(e, t) {
2735
+ function jo(e, t) {
2740
2736
  const n = We(e, t.variableId), r = Object.fromEntries(Object.entries(t.patch).map(([m, p]) => [m, p === null ? void 0 : p])), i = it(e, { kind: "update", id: t.variableId, patch: r });
2741
2737
  i.ok || mt(i.issues, "This variable could not be changed.");
2742
2738
  const o = We(i.dashboard, t.variableId), a = [];
2743
2739
  t.patch.name !== void 0 && t.patch.name !== n.name && a.push(T.plain("variable", `renames the variable ${n.name} to ${o.name}`));
2744
2740
  const { name: s, label: c, ...l } = n, { name: d, label: u, ...f } = o;
2745
- return JSON.stringify(l) !== JSON.stringify(f) ? a.push(T.plain("variable", `changes the variable ${o.name}: ${Zn(o)}`)) : n.label !== o.label && a.push(T.plain("variable", `labels the variable ${o.name} ${w(o.label ?? o.name)}`)), {
2741
+ return JSON.stringify(l) !== JSON.stringify(f) ? a.push(T.plain("variable", `changes the variable ${o.name}: ${er(o)}`)) : n.label !== o.label && a.push(T.plain("variable", `labels the variable ${o.name} ${w(o.label ?? o.name)}`)), {
2746
2742
  dashboard: i.dashboard,
2747
2743
  queryFrames: i.queryFrames,
2748
2744
  clauses: a.length ? a : [T.plain("variable", `changes nothing on the variable ${o.name}`)]
2749
2745
  };
2750
2746
  }
2751
- function jo(e, t) {
2747
+ function Go(e, t) {
2752
2748
  const n = We(e, t.variableId), r = it(e, { kind: "remove", id: t.variableId, confirmed: !1 });
2753
2749
  r.ok || mt(r.issues, "This variable could not be removed.");
2754
2750
  const i = r.removedMappings ? ` and its ${r.removedMappings === 1 ? "filter mapping" : `${r.removedMappings} filter mappings`}` : "";
@@ -2757,33 +2753,33 @@ function jo(e, t) {
2757
2753
  clauses: [T.plain("variable", `removes the variable ${n.name}${i}`)]
2758
2754
  };
2759
2755
  }
2760
- function er(e) {
2761
- return e.cards.length < sa;
2756
+ function tr(e) {
2757
+ return e.cards.length < ca;
2762
2758
  }
2763
- function Go(e) {
2764
- return e.kpi.layout === "tiles" && e.cards.length + 1 > Sn;
2759
+ function Wo(e) {
2760
+ return e.kpi.layout === "tiles" && e.cards.length + 1 > xn;
2765
2761
  }
2766
- function Wo(e, t) {
2767
- return !er(e) || t.type !== "kpi" || e.cards.some(({ id: n }) => n === t.id) ? e : {
2762
+ function Ho(e, t) {
2763
+ return !tr(e) || t.type !== "kpi" || e.cards.some(({ id: n }) => n === t.id) ? e : {
2768
2764
  ...e,
2769
2765
  cards: [...e.cards, t],
2770
- kpi: Go(e) ? { ...e.kpi, layout: "lines" } : e.kpi
2766
+ kpi: Wo(e) ? { ...e.kpi, layout: "lines" } : e.kpi
2771
2767
  };
2772
2768
  }
2773
- function Ho(e, t) {
2769
+ function Qo(e, t) {
2774
2770
  if (e.cards.length <= 1) return e;
2775
2771
  const n = e.cards.filter(({ id: r }) => r !== t);
2776
2772
  return n.length === e.cards.length ? e : { ...e, cards: n };
2777
2773
  }
2778
- function tr(e) {
2779
- return e.cards.length <= Sn;
2774
+ function nr(e) {
2775
+ return e.cards.length <= xn;
2780
2776
  }
2781
2777
  function Xo(e, t) {
2782
2778
  const n = { ...e.kpi, ...t };
2783
- return n.layout === "tiles" && !tr(e) ? e : { ...e, kpi: n };
2779
+ return n.layout === "tiles" && !nr(e) ? e : { ...e, kpi: n };
2784
2780
  }
2785
- const Yo = ["table"], Qo = ["matrixTable"];
2786
- function Xt(e, t, n) {
2781
+ const Yo = ["table"], Jo = ["matrixTable"];
2782
+ function Qt(e, t, n) {
2787
2783
  return {
2788
2784
  id: e.section(),
2789
2785
  type: "table",
@@ -2814,7 +2810,7 @@ function Xt(e, t, n) {
2814
2810
  }
2815
2811
  };
2816
2812
  }
2817
- function nr(e) {
2813
+ function rr(e) {
2818
2814
  return { id: e, title: "KPI", type: "kpi" };
2819
2815
  }
2820
2816
  const V = {
@@ -2828,7 +2824,7 @@ const V = {
2828
2824
  create: (e) => ({
2829
2825
  id: e.section(),
2830
2826
  type: "text",
2831
- content: Un("New text section")
2827
+ content: zn("New text section")
2832
2828
  })
2833
2829
  },
2834
2830
  table: {
@@ -2838,7 +2834,7 @@ const V = {
2838
2834
  group: "data",
2839
2835
  addable: !0,
2840
2836
  cardTypes: Yo,
2841
- create: (e) => Xt(e, "table", "Table")
2837
+ create: (e) => Qt(e, "table", "Table")
2842
2838
  },
2843
2839
  matrix: {
2844
2840
  id: "matrix",
@@ -2846,8 +2842,8 @@ const V = {
2846
2842
  description: "Grouped rows with subtotals, and optional column levels.",
2847
2843
  group: "data",
2848
2844
  addable: !0,
2849
- cardTypes: Qo,
2850
- create: (e) => Xt(e, "matrixTable", "Matrix")
2845
+ cardTypes: Jo,
2846
+ create: (e) => Qt(e, "matrixTable", "Matrix")
2851
2847
  },
2852
2848
  kpi: {
2853
2849
  id: "kpi",
@@ -2859,7 +2855,7 @@ const V = {
2859
2855
  create: (e) => ({
2860
2856
  id: e.section(),
2861
2857
  type: "kpi",
2862
- cards: [nr(e.card())],
2858
+ cards: [rr(e.card())],
2863
2859
  kpi: { layout: "tiles" }
2864
2860
  })
2865
2861
  },
@@ -2896,7 +2892,7 @@ const V = {
2896
2892
  create: (e) => ({ id: e.section(), type: "page_break" })
2897
2893
  }
2898
2894
  };
2899
- function rr(e) {
2895
+ function ir(e) {
2900
2896
  var t;
2901
2897
  switch (e.type) {
2902
2898
  case "table":
@@ -2913,42 +2909,42 @@ function rr(e) {
2913
2909
  return V.page_break;
2914
2910
  }
2915
2911
  }
2916
- function Jo(e, t) {
2917
- return rr(e).cardTypes.includes(t);
2912
+ function Zo(e, t) {
2913
+ return ir(e).cardTypes.includes(t);
2918
2914
  }
2919
- function ir(e, t) {
2920
- if (Jo(e, t)) return null;
2921
- const n = rr(e);
2915
+ function ar(e, t) {
2916
+ if (Zo(e, t)) return null;
2917
+ const n = ir(e);
2922
2918
  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`;
2923
2919
  }
2924
- function Zo(e, t, n) {
2920
+ function es(e, t, n) {
2925
2921
  if (!at(e).some(({ id: i }) => i === t))
2926
2922
  throw new Error(
2927
2923
  `Document section '${e.id}' has no card '${t}'.`
2928
2924
  );
2929
- const r = ir(e, n.type);
2925
+ const r = ar(e, n.type);
2930
2926
  if (r)
2931
2927
  throw new Error(r);
2932
- return xn(
2928
+ return wn(
2933
2929
  e,
2934
2930
  (i) => i.id === t ? n : i
2935
2931
  );
2936
2932
  }
2937
- const es = [
2933
+ const ts = [
2938
2934
  { id: "data", label: "Data" },
2939
2935
  { id: "content", label: "Content" },
2940
2936
  { id: "layout", label: "Layout" }
2941
2937
  ];
2942
- function qc() {
2938
+ function Lc() {
2943
2939
  const e = Object.values(V).filter(
2944
2940
  (t) => t.addable
2945
2941
  );
2946
- return es.map((t) => ({
2942
+ return ts.map((t) => ({
2947
2943
  ...t,
2948
2944
  kinds: e.filter((n) => n.group === t.id)
2949
2945
  })).filter((t) => t.kinds.length > 0);
2950
2946
  }
2951
- const ts = {
2947
+ const ns = {
2952
2948
  header: ["title", "metadata"],
2953
2949
  footer: ["note", "pageInfo"]
2954
2950
  };
@@ -2957,27 +2953,27 @@ class D extends Error {
2957
2953
  super(t), this.name = "DocumentEditError";
2958
2954
  }
2959
2955
  }
2960
- const Yt = 8, ns = 240;
2961
- function Bc() {
2956
+ const Xt = 8, rs = 240;
2957
+ function qc() {
2962
2958
  return {
2963
2959
  section: () => `doc_section_${Ie()}`,
2964
2960
  card: () => `doc_card_${Ie()}`
2965
2961
  };
2966
2962
  }
2967
- function rs(e) {
2963
+ function is(e) {
2968
2964
  return Number.isFinite(e) ? Math.min(
2969
- ns,
2970
- Math.max(Yt, Math.round(e))
2971
- ) : Yt;
2965
+ rs,
2966
+ Math.max(Xt, Math.round(e))
2967
+ ) : Xt;
2972
2968
  }
2973
- function Uc(e, t, n, r) {
2969
+ function Bc(e, t, n, r) {
2974
2970
  const i = e.findIndex(({ id: s }) => s === t), o = e.findIndex(({ id: s }) => s === n);
2975
2971
  if (i === -1 || o === -1) return i;
2976
2972
  const a = r === "after" ? o + 1 : o;
2977
2973
  return i < a ? a - 1 : a;
2978
2974
  }
2979
- const is = /* @__PURE__ */ new Set(["table", "matrixTable", "kpi"]);
2980
- function as(e, t = {}) {
2975
+ const as = /* @__PURE__ */ new Set(["table", "matrixTable", "kpi"]);
2976
+ function os(e, t = {}) {
2981
2977
  const n = new Set(
2982
2978
  (e.sheets || []).flatMap(
2983
2979
  (r) => (r.frames || []).flatMap(
@@ -2985,14 +2981,14 @@ function as(e, t = {}) {
2985
2981
  )
2986
2982
  )
2987
2983
  );
2988
- return In(e).filter(
2989
- (r) => is.has(r.card.type) && !r.card.linkedSourceCardId && !(r.kind === "frameCard" && n.has(r.frameId)) && !(r.kind === "documentSectionCard" && r.sectionId === t.excludeSectionId) && !li(r.card)
2984
+ return Cn(e).filter(
2985
+ (r) => as.has(r.card.type) && !r.card.linkedSourceCardId && !(r.kind === "frameCard" && n.has(r.frameId)) && !(r.kind === "documentSectionCard" && r.sectionId === t.excludeSectionId) && !li(r.card)
2990
2986
  );
2991
2987
  }
2992
- function os(e) {
2988
+ function ss(e) {
2993
2989
  return e.type === "kpi" ? "kpi" : e.type === "matrixTable" ? "matrix" : "table";
2994
2990
  }
2995
- function ss(e, t, n) {
2991
+ function cs(e, t, n) {
2996
2992
  const r = e.sections, i = (a) => ({
2997
2993
  ...e,
2998
2994
  sections: a
@@ -3009,7 +3005,7 @@ function ss(e, t, n) {
3009
3005
  };
3010
3006
  }
3011
3007
  case "copyCard": {
3012
- const a = Re(t.source, n), c = V[os(a.card)].create({
3008
+ const a = Re(t.source, n), c = V[ss(a.card)].create({
3013
3009
  section: n.ids.section,
3014
3010
  card: () => a.card.id
3015
3011
  }), 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;
@@ -3025,7 +3021,7 @@ function ss(e, t, n) {
3025
3021
  throw new D(
3026
3022
  "Only a table section can be replaced with a copied card."
3027
3023
  );
3028
- const s = Re(t.source, n, t.sectionId), c = ir(a, s.card.type);
3024
+ const s = Re(t.source, n, t.sectionId), c = ar(a, s.card.type);
3029
3025
  if (c) throw new D(c);
3030
3026
  const l = {
3031
3027
  ...a,
@@ -3053,7 +3049,7 @@ function ss(e, t, n) {
3053
3049
  case "duplicate": {
3054
3050
  const a = r.findIndex(({ id: c }) => c === t.sectionId);
3055
3051
  if (a === -1) throw ge(t.sectionId);
3056
- const s = cs(r[a], n.ids);
3052
+ const s = ls(r[a], n.ids);
3057
3053
  return {
3058
3054
  document: i(Ke(r, s, a + 1)),
3059
3055
  target: o(s.id)
@@ -3096,13 +3092,13 @@ function ss(e, t, n) {
3096
3092
  };
3097
3093
  }
3098
3094
  case "updateRegionText": {
3099
- if (!ts[t.region].includes(t.role))
3095
+ if (!ns[t.region].includes(t.role))
3100
3096
  throw new D(
3101
3097
  `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.`
3102
3098
  );
3103
3099
  if (t.style !== void 0 && !ci(t.role))
3104
3100
  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.`);
3105
- const a = e[t.region], s = a ? Co(a.blocks, t.role) : void 0, c = t.style !== void 0 ? Pt(s == null ? void 0 : s.style, t.style) : s == null ? void 0 : s.style, l = {
3101
+ const a = e[t.region], s = a ? Fo(a.blocks, t.role) : void 0, c = t.style !== void 0 ? Pt(s == null ? void 0 : s.style, t.style) : s == null ? void 0 : s.style, l = {
3106
3102
  id: (s == null ? void 0 : s.id) ?? `${t.region}_${t.role}`,
3107
3103
  role: t.role,
3108
3104
  area: (s == null ? void 0 : s.area) ?? t.role,
@@ -3110,13 +3106,13 @@ function ss(e, t, n) {
3110
3106
  ...c ? { style: c } : {}
3111
3107
  };
3112
3108
  if (t.region === "header") {
3113
- const u = (a == null ? void 0 : a.region) === "header" ? a : vo();
3109
+ const u = (a == null ? void 0 : a.region) === "header" ? a : Io();
3114
3110
  return {
3115
3111
  document: { ...e, header: { ...u, enabled: !0, blocks: Wt(u.blocks, l) } },
3116
3112
  target: { kind: "header" }
3117
3113
  };
3118
3114
  }
3119
- const d = (a == null ? void 0 : a.region) === "footer" ? a : Io();
3115
+ const d = (a == null ? void 0 : a.region) === "footer" ? a : Co();
3120
3116
  return {
3121
3117
  document: { ...e, footer: { ...d, enabled: !0, blocks: Wt(d.blocks, l) } },
3122
3118
  target: { kind: "footer" }
@@ -3138,7 +3134,7 @@ function ss(e, t, n) {
3138
3134
  case "updateKpiOptions": {
3139
3135
  const a = K(r, t.sectionId);
3140
3136
  if (a.type !== "kpi") throw W(t.type, a);
3141
- if (t.options.layout === "tiles" && !tr(a))
3137
+ if (t.options.layout === "tiles" && !nr(a))
3142
3138
  throw new D("Tiles hold up to 6 KPIs.");
3143
3139
  return {
3144
3140
  document: i(
@@ -3154,7 +3150,7 @@ function ss(e, t, n) {
3154
3150
  document: i(
3155
3151
  R(r, {
3156
3152
  ...a,
3157
- heightPx: rs(t.heightPx)
3153
+ heightPx: is(t.heightPx)
3158
3154
  })
3159
3155
  ),
3160
3156
  target: o(a.id)
@@ -3162,10 +3158,10 @@ function ss(e, t, n) {
3162
3158
  }
3163
3159
  case "replaceCard": {
3164
3160
  const a = K(r, t.sectionId);
3165
- t.card.id !== t.oldCardId && Qt(n, t.card.id);
3161
+ t.card.id !== t.oldCardId && Yt(n, t.card.id);
3166
3162
  let s;
3167
3163
  try {
3168
- s = Zo(a, t.oldCardId, t.card);
3164
+ s = es(a, t.oldCardId, t.card);
3169
3165
  } catch (c) {
3170
3166
  throw new D(c.message);
3171
3167
  }
@@ -3179,14 +3175,14 @@ function ss(e, t, n) {
3179
3175
  case "addKpi": {
3180
3176
  const a = K(r, t.sectionId);
3181
3177
  if (a.type !== "kpi") throw W(t.type, a);
3182
- if (!er(a))
3178
+ if (!tr(a))
3183
3179
  throw new D("A KPI section holds up to 8 KPIs.");
3184
3180
  const s = t.source ? Re(t.source, n, a.id) : void 0;
3185
- t.card && !s && Qt(n, t.card.id);
3186
- const c = (s == null ? void 0 : s.card) ?? t.card ?? nr(n.ids.card());
3181
+ t.card && !s && Yt(n, t.card.id);
3182
+ const c = (s == null ? void 0 : s.card) ?? t.card ?? rr(n.ids.card());
3187
3183
  if (c.type !== "kpi")
3188
3184
  throw new D("KPI sections hold KPI cards only");
3189
- const l = Wo(a, c);
3185
+ const l = Ho(a, c);
3190
3186
  if (l === a)
3191
3187
  throw new D(`KPI section '${a.id}' already has card '${c.id}'.`);
3192
3188
  return {
@@ -3200,7 +3196,7 @@ function ss(e, t, n) {
3200
3196
  if (a.type !== "kpi") throw W(t.type, a);
3201
3197
  if (!a.cards.some(({ id: c }) => c === t.cardId))
3202
3198
  throw new D(`KPI section '${a.id}' has no card '${t.cardId}'.`);
3203
- const s = Ho(a, t.cardId);
3199
+ const s = Qo(a, t.cardId);
3204
3200
  if (s === a)
3205
3201
  throw new D("A KPI section keeps at least one KPI.");
3206
3202
  return {
@@ -3222,13 +3218,13 @@ function ss(e, t, n) {
3222
3218
  };
3223
3219
  }
3224
3220
  default:
3225
- return ds(t);
3221
+ return us(t);
3226
3222
  }
3227
3223
  }
3228
3224
  function Re(e, t, n) {
3229
- const r = as(t.dashboard, {
3225
+ const r = os(t.dashboard, {
3230
3226
  excludeSectionId: n
3231
- }).find((p) => ls(p, e));
3227
+ }).find((p) => ds(p, e));
3232
3228
  if (!r)
3233
3229
  throw new D(
3234
3230
  `Card '${e.cardId}' cannot be copied into this document.`
@@ -3244,7 +3240,7 @@ function Re(e, t, n) {
3244
3240
  onSheetField: (p) => l.add(p)
3245
3241
  }), e.sheetId === t.sheetId || l.size === 0)
3246
3242
  return { card: c };
3247
- const d = uo(o), u = /* @__PURE__ */ new Map(), f = [...l];
3243
+ const d = fo(o), u = /* @__PURE__ */ new Map(), f = [...l];
3248
3244
  for (; f.length > 0; ) {
3249
3245
  const p = f.pop();
3250
3246
  if (u.has(p)) continue;
@@ -3269,7 +3265,7 @@ function Re(e, t, n) {
3269
3265
  });
3270
3266
  return m.length === 0 ? { card: c } : {
3271
3267
  card: c,
3272
- calculatedFields: Y(a == null ? void 0 : a.calculatedFields, m)
3268
+ calculatedFields: X(a == null ? void 0 : a.calculatedFields, m)
3273
3269
  };
3274
3270
  }
3275
3271
  function oe(e, t) {
@@ -3281,11 +3277,11 @@ function oe(e, t) {
3281
3277
  const n = e;
3282
3278
  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(Le(n.id) ?? n.id), n.entityId = t.targetSheetId)), Object.values(n).forEach((r) => oe(r, t));
3283
3279
  }
3284
- function cs(e, t) {
3280
+ function ls(e, t) {
3285
3281
  const n = { ...be(e), id: t.section() }, r = new Map(
3286
3282
  at(n).map((i) => [i.id, t.card()])
3287
3283
  );
3288
- return xn(n, (i) => {
3284
+ return wn(n, (i) => {
3289
3285
  const o = r.get(i.id), a = be({ ...i, id: o });
3290
3286
  return pn(a, r), oe(a, {
3291
3287
  oldCardId: i.id,
@@ -3297,11 +3293,11 @@ function cs(e, t) {
3297
3293
  }), a;
3298
3294
  });
3299
3295
  }
3300
- function ls(e, t) {
3296
+ function ds(e, t) {
3301
3297
  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;
3302
3298
  }
3303
- function Qt(e, t) {
3304
- if (ca(e.dashboard, t))
3299
+ function Yt(e, t) {
3300
+ if (la(e.dashboard, t))
3305
3301
  throw new D(
3306
3302
  `Card id '${t}' is already used by another card in this dashboard.`
3307
3303
  );
@@ -3331,56 +3327,56 @@ function W(e, t) {
3331
3327
  `'${e}' does not apply to a ${t.type} section.`
3332
3328
  );
3333
3329
  }
3334
- function ds(e) {
3330
+ function us(e) {
3335
3331
  throw new D(
3336
3332
  `Unknown document edit '${e.type}'.`
3337
3333
  );
3338
3334
  }
3339
- const us = {
3335
+ const fs = {
3340
3336
  section: () => {
3341
3337
  throw new F("document_invalid", "A text edit mints no section id.");
3342
3338
  },
3343
3339
  card: () => {
3344
3340
  throw new F("document_invalid", "A text edit mints no card id.");
3345
3341
  }
3346
- }, fs = { title: "title", metadata: "metadata", note: "note", pageInfo: "page info" };
3347
- function ms(e, t) {
3342
+ }, ms = { title: "title", metadata: "metadata", note: "note", pageInfo: "page info" };
3343
+ function ps(e, t) {
3348
3344
  const n = e.sheets ?? [], r = n.findIndex((d) => d.id === t.sheetId), i = n[r];
3349
3345
  if (!i) throw new F("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`, "Read the outline again and use its sheet ids.");
3350
3346
  if (!xe(i) || !i.document)
3351
3347
  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.");
3352
3348
  let o;
3353
3349
  try {
3354
- o = ss(i.document, t.edit, { dashboard: e, sheetId: i.id, ids: us }).document;
3350
+ o = cs(i.document, t.edit, { dashboard: e, sheetId: i.id, ids: fs }).document;
3355
3351
  } catch (d) {
3356
3352
  throw d instanceof D ? new F("document_invalid", d.message, "Read the outline again and use its section ids and line roles.") : d;
3357
3353
  }
3358
- const a = { ...e, sheets: n.map((d, u) => u === r ? { ...d, document: o } : d) }, s = t.edit.type === "updateRegionText" ? `the ${fs[t.edit.role]} line of the ${w(i.title)} ${t.edit.region}` : `a text section of ${w(i.title)}`, c = [];
3354
+ const a = { ...e, sheets: n.map((d, u) => u === r ? { ...d, document: o } : d) }, s = t.edit.type === "updateRegionText" ? `the ${ms[t.edit.role]} line of the ${w(i.title)} ${t.edit.region}` : `a text section of ${w(i.title)}`, c = [];
3359
3355
  if (t.edit.content !== void 0) {
3360
3356
  const d = di(t.edit.content, { inputs: a.inputs, variables: a.variables }), u = ui(d);
3361
3357
  c.push(`sets ${s} to ${w(fi(d))}${u ? `, ${u}` : ""}`);
3362
3358
  }
3363
- const l = gs(t.edit.style);
3359
+ const l = hs(t.edit.style);
3364
3360
  return l && c.push(c.length ? `makes it ${l}` : `makes ${s} ${l}`), {
3365
3361
  dashboard: a,
3366
3362
  clauses: [T.plain("document", c.join(" and "))]
3367
3363
  };
3368
3364
  }
3369
- const ps = { left: "left-aligned", center: "centered", right: "right-aligned" };
3370
- function gs(e) {
3365
+ const gs = { left: "left-aligned", center: "centered", right: "right-aligned" };
3366
+ function hs(e) {
3371
3367
  return [
3372
3368
  ...(e == null ? void 0 : e.fontSize) !== void 0 ? [`${e.fontSize}px`] : [],
3373
- ...(e == null ? void 0 : e.align) !== void 0 ? [ps[e.align]] : []
3369
+ ...(e == null ? void 0 : e.align) !== void 0 ? [gs[e.align]] : []
3374
3370
  ].join(" and ");
3375
3371
  }
3376
- function zc(e, t, n) {
3372
+ function Uc(e, t, n) {
3377
3373
  let r = e;
3378
3374
  const i = [], o = [], a = [], s = [], c = [];
3379
3375
  let l = !1;
3380
3376
  for (const [u, f] of t.entries()) {
3381
3377
  let m;
3382
3378
  try {
3383
- m = ys(r, f, n);
3379
+ m = bs(r, f, n);
3384
3380
  } catch (p) {
3385
3381
  if (!(p instanceof F)) throw p;
3386
3382
  return {
@@ -3405,19 +3401,19 @@ function zc(e, t, n) {
3405
3401
  dashboard: r,
3406
3402
  created: i,
3407
3403
  touched: o.filter((u) => !d.has(u)),
3408
- queryFrames: [...hs(r, i, o), ...s],
3409
- descriptions: bs(c),
3404
+ queryFrames: [...ys(r, i, o), ...s],
3405
+ descriptions: vs(c),
3410
3406
  runtimeEffects: a,
3411
3407
  detaches: l
3412
3408
  };
3413
3409
  }
3414
- function hs(e, t, n) {
3410
+ function ys(e, t, n) {
3415
3411
  const r = /* @__PURE__ */ new Set([...t.filter((i) => i.kind === "card").map((i) => i.id), ...n]);
3416
3412
  return (e.sheets ?? []).flatMap(
3417
3413
  (i) => (i.frames ?? []).filter((o) => (o.cards ?? []).some((a) => r.has(a.id)))
3418
3414
  );
3419
3415
  }
3420
- function ys(e, t, n) {
3416
+ function bs(e, t, n) {
3421
3417
  switch (t.op) {
3422
3418
  case "card.add":
3423
3419
  return gi(e, t);
@@ -3426,43 +3422,43 @@ function ys(e, t, n) {
3426
3422
  case "card.update":
3427
3423
  return te(mi(e, t.cardId, t.update), [t.cardId]);
3428
3424
  case "layout.arrange":
3429
- return oo(e, t);
3425
+ return so(e, t);
3430
3426
  case "frame.commit":
3431
- return te(mo(e, t.commit), [t.commit.frame.activeCardId]);
3427
+ return te(po(e, t.commit), [t.commit.frame.activeCardId]);
3432
3428
  case "filter.add":
3433
3429
  return Eo(e, t);
3434
3430
  case "filter.update":
3435
- return $o(e, t, n);
3431
+ return Ro(e, t, n);
3436
3432
  case "filter.remove":
3437
- return Ko(e, t.filterId);
3433
+ return Vo(e, t.filterId);
3438
3434
  case "filter.bind":
3439
- return te(qo(e, t), [t.cardId]);
3440
- case "filter.exclude":
3441
3435
  return te(Bo(e, t), [t.cardId]);
3436
+ case "filter.exclude":
3437
+ return te(Uo(e, t), [t.cardId]);
3442
3438
  case "dashboard.update":
3443
- return po(e, t);
3439
+ return go(e, t);
3444
3440
  case "sheet.add":
3445
- return Fo(e, t);
3446
- case "sheet.update":
3447
3441
  return So(e, t);
3442
+ case "sheet.update":
3443
+ return xo(e, t);
3448
3444
  case "layout.tabs":
3449
- return te(ho(e, t), t.cardIds.slice(0, 1));
3445
+ return te(yo(e, t), t.cardIds.slice(0, 1));
3450
3446
  case "layout.untab":
3451
- return te(yo(e, t), [t.cardId]);
3447
+ return te(bo(e, t), [t.cardId]);
3452
3448
  case "variable.add":
3453
- return Uo(e, t);
3454
- case "variable.update":
3455
3449
  return zo(e, t);
3456
- case "variable.remove":
3450
+ case "variable.update":
3457
3451
  return jo(e, t);
3452
+ case "variable.remove":
3453
+ return Go(e, t);
3458
3454
  case "document.text":
3459
- return ms(e, t);
3455
+ return ps(e, t);
3460
3456
  }
3461
3457
  }
3462
3458
  function te(e, t) {
3463
3459
  return { ...e, touched: t.filter(Boolean) };
3464
3460
  }
3465
- function bs(e) {
3461
+ function vs(e) {
3466
3462
  const t = [];
3467
3463
  for (const n of e) {
3468
3464
  const r = n.changeIndex === void 0 ? void 0 : t.find((i) => i.changeIndex === n.changeIndex);
@@ -3479,10 +3475,10 @@ function bs(e) {
3479
3475
  }
3480
3476
  return t.map(({ clauses: n, ...r }) => ({
3481
3477
  ...r,
3482
- sentence: hi(vs(n))
3478
+ sentence: hi(Is(n))
3483
3479
  }));
3484
3480
  }
3485
- function vs(e) {
3481
+ function Is(e) {
3486
3482
  let t = !1;
3487
3483
  return e.filter((n) => n.kind !== "detached" ? !0 : t ? !1 : (t = !0, !0));
3488
3484
  }
@@ -3508,18 +3504,18 @@ function se(e) {
3508
3504
  e.tableName
3509
3505
  ].join(":");
3510
3506
  }
3511
- function Is(e, t) {
3507
+ function Cs(e, t) {
3512
3508
  if (e.kind === "semantic")
3513
3509
  return {
3514
3510
  status: "ready",
3515
3511
  request: Jt({
3516
3512
  connection_id: e.connectionId,
3517
3513
  domain_id: e.domainId,
3518
- dataset_id: Ni(e),
3514
+ dataset_id: $i(e),
3519
3515
  dataset_name: e.datasetName
3520
3516
  })
3521
3517
  };
3522
- const n = da({
3518
+ const n = ua({
3523
3519
  source: e,
3524
3520
  capabilities: t
3525
3521
  });
@@ -3540,14 +3536,14 @@ function Is(e, t) {
3540
3536
  })
3541
3537
  };
3542
3538
  }
3543
- function jc(e, t = /* @__PURE__ */ new Map()) {
3539
+ function zc(e, t = /* @__PURE__ */ new Map()) {
3544
3540
  const n = /* @__PURE__ */ new Map();
3545
3541
  for (const { card: r } of e) {
3546
3542
  const i = Ze(r), o = i.kind === "config" ? i.executableSources : i.kind === "sql" ? i.pinnedCatalogSources.map((a) => a.source) : [];
3547
3543
  for (const a of o) {
3548
3544
  const s = se(a);
3549
3545
  if (!n.has(s)) {
3550
- const c = Is(
3546
+ const c = Cs(
3551
3547
  a,
3552
3548
  a.connectionId ? t.get(a.connectionId) : void 0
3553
3549
  );
@@ -3561,7 +3557,7 @@ function jc(e, t = /* @__PURE__ */ new Map()) {
3561
3557
  }
3562
3558
  return Array.from(n.values());
3563
3559
  }
3564
- function Cs(e, t) {
3560
+ function Fs(e, t) {
3565
3561
  if (e.kind !== "semantic" || !e.connectionId) return;
3566
3562
  const n = (t.qualifiedEntityName || "").split(".").map((i) => i.trim()).filter(Boolean), r = n.at(-1);
3567
3563
  if (r)
@@ -3577,43 +3573,43 @@ function he(e, t) {
3577
3573
  let n = e.get(t);
3578
3574
  return n || (n = { fields: /* @__PURE__ */ new Map(), fieldConflicts: /* @__PURE__ */ new Set() }, e.set(t, n)), n;
3579
3575
  }
3580
- function ar(e, t) {
3576
+ function or(e, t) {
3581
3577
  e.sourceLabel === void 0 ? e.sourceLabel = t : e.sourceLabel !== t && (e.sourceLabelConflict = !0);
3582
3578
  }
3583
- function Xe(e, t, n) {
3579
+ function Qe(e, t, n) {
3584
3580
  for (const r of t) {
3585
3581
  const i = r == null ? void 0 : r.trim();
3586
3582
  if (!i) continue;
3587
- const o = bn(i), a = e.fields.get(o);
3583
+ const o = vn(i), a = e.fields.get(o);
3588
3584
  a === void 0 ? e.fields.set(o, n) : a !== n && e.fieldConflicts.add(o);
3589
3585
  }
3590
3586
  }
3591
- function or(e, t) {
3592
- t.sourceLabel && ar(e, t.sourceLabel), t.sourceLabelConflict && (e.sourceLabelConflict = !0);
3587
+ function sr(e, t) {
3588
+ t.sourceLabel && or(e, t.sourceLabel), t.sourceLabelConflict && (e.sourceLabelConflict = !0);
3593
3589
  for (const [n, r] of t.fields)
3594
- Xe(e, [n], r);
3590
+ Qe(e, [n], r);
3595
3591
  for (const n of t.fieldConflicts ?? [])
3596
3592
  e.fieldConflicts.add(n);
3597
3593
  }
3598
- function sr(e) {
3594
+ function cr(e) {
3599
3595
  return e.kind === "semantic" && (e.label || e.datasetName || "").trim() || void 0;
3600
3596
  }
3601
- function Gc(e, t) {
3597
+ function jc(e, t) {
3602
3598
  var r, i;
3603
3599
  const n = /* @__PURE__ */ new Map();
3604
3600
  for (const [o, a] of e) {
3605
3601
  if (a.status !== "ready") continue;
3606
- const s = t == null ? void 0 : t.get(o), c = s ? sr(s) : void 0;
3602
+ const s = t == null ? void 0 : t.get(o), c = s ? cr(s) : void 0;
3607
3603
  for (const l of a.columns) {
3608
- const d = (r = l.column_name) == null ? void 0 : r.trim(), u = (i = l.label) == null ? void 0 : i.trim(), f = s ? Cs(s, l) : void 0;
3609
- f && c && ar(
3604
+ const d = (r = l.column_name) == null ? void 0 : r.trim(), u = (i = l.label) == null ? void 0 : i.trim(), f = s ? Fs(s, l) : void 0;
3605
+ f && c && or(
3610
3606
  he(n, se(f)),
3611
3607
  c
3612
- ), !(!d || !u || u === d) && (Xe(
3608
+ ), !(!d || !u || u === d) && (Qe(
3613
3609
  he(n, o),
3614
3610
  [d, l.sourceField],
3615
3611
  u
3616
- ), f && Xe(
3612
+ ), f && Qe(
3617
3613
  he(n, se(f)),
3618
3614
  [l.sourceField, d],
3619
3615
  u
@@ -3622,20 +3618,20 @@ function Gc(e, t) {
3622
3618
  }
3623
3619
  return n;
3624
3620
  }
3625
- function Wc(...e) {
3621
+ function Gc(...e) {
3626
3622
  const t = /* @__PURE__ */ new Map();
3627
3623
  for (const n of e)
3628
3624
  for (const [r, i] of n ?? [])
3629
- or(he(t, r), i);
3625
+ sr(he(t, r), i);
3630
3626
  return t;
3631
3627
  }
3632
3628
  function pt(e) {
3633
3629
  return [e.databaseName, e.schemaName, e.tableName].filter(Boolean).join(".");
3634
3630
  }
3635
- function Fs(e) {
3631
+ function Ss(e) {
3636
3632
  return e.split(":").slice(2).filter(Boolean).join(".");
3637
3633
  }
3638
- function cr(e, t) {
3634
+ function lr(e, t) {
3639
3635
  const n = se(t), r = e.get(n);
3640
3636
  if (t.kind !== "physical") return r;
3641
3637
  const i = `physical:${t.connectionId}:`, o = pt(t), a = {
@@ -3644,32 +3640,32 @@ function cr(e, t) {
3644
3640
  };
3645
3641
  let s = !1;
3646
3642
  for (const [c, l] of e)
3647
- c.startsWith(i) && (c !== n && !ua(o, Fs(c)) || (or(a, l), s = !0));
3643
+ c.startsWith(i) && (c !== n && !fa(o, Ss(c)) || (sr(a, l), s = !0));
3648
3644
  return s ? a : void 0;
3649
3645
  }
3650
- function Ss(e, t) {
3646
+ function xs(e, t) {
3651
3647
  var i;
3652
3648
  if (!e) return;
3653
- const n = bn(t.name), r = cr(e, t.source);
3649
+ const n = vn(t.name), r = lr(e, t.source);
3654
3650
  return r && !((i = r.fieldConflicts) != null && i.has(n)) ? r.fields.get(n) : void 0;
3655
3651
  }
3656
- function xs(e, t) {
3652
+ function ws(e, t) {
3657
3653
  if (t.kind === "semantic")
3658
- return sr(t) || t.datasetId || "Dataset";
3659
- const n = e ? cr(e, t) : void 0;
3654
+ return cr(t) || t.datasetId || "Dataset";
3655
+ const n = e ? lr(e, t) : void 0;
3660
3656
  return n != null && n.sourceLabel && !n.sourceLabelConflict ? n.sourceLabel : pt(t);
3661
3657
  }
3662
- function Hc(e, t) {
3663
- const n = Ss(e, t);
3658
+ function Wc(e, t) {
3659
+ const n = xs(e, t);
3664
3660
  return {
3665
3661
  name: t.name,
3666
3662
  ...n ? { label: n } : {},
3667
- entityName: xs(e, t.source),
3663
+ entityName: ws(e, t.source),
3668
3664
  ...t.source.kind === "physical" ? { qualifiedEntityName: pt(t.source) } : {},
3669
3665
  dataType: t.dataType
3670
3666
  };
3671
3667
  }
3672
- function ws(e, t) {
3668
+ function Ts(e, t) {
3673
3669
  var i, o;
3674
3670
  const n = (i = t.column_name) == null ? void 0 : i.trim(), r = ce(t.data_type);
3675
3671
  if (!(!n || r === "unknown"))
@@ -3683,7 +3679,7 @@ function ws(e, t) {
3683
3679
  }
3684
3680
  };
3685
3681
  }
3686
- function Xc(e) {
3682
+ function Hc(e) {
3687
3683
  const t = {};
3688
3684
  for (const { card: n } of e.cards) {
3689
3685
  const r = Ze(n), i = r.kind === "config" ? r.executableSources : r.kind === "sql" ? r.pinnedCatalogSources.map((s) => s.source) : [];
@@ -3699,7 +3695,7 @@ function Xc(e) {
3699
3695
  break;
3700
3696
  }
3701
3697
  for (const l of c.columns) {
3702
- const d = ws(s, l);
3698
+ const d = Ts(s, l);
3703
3699
  d && o.push(d);
3704
3700
  }
3705
3701
  }
@@ -3707,16 +3703,16 @@ function Xc(e) {
3707
3703
  }
3708
3704
  return t;
3709
3705
  }
3710
- function Yc(e) {
3711
- const { dashboard: t, target: n, calendar: r } = e, i = dr(n), o = lr(t, n, r);
3706
+ function Qc(e) {
3707
+ const { dashboard: t, target: n, calendar: r } = e, i = ur(n), o = dr(t, n, r);
3712
3708
  return {
3713
3709
  value: o,
3714
- mode: kr(
3715
- Mr(o == null ? void 0 : o.operation) ? o.operation : i.operation
3710
+ mode: Mr(
3711
+ Or(o == null ? void 0 : o.operation) ? o.operation : i.operation
3716
3712
  )
3717
3713
  };
3718
3714
  }
3719
- function lr(e, t, n) {
3715
+ function dr(e, t, n) {
3720
3716
  var r;
3721
3717
  switch (t.kind) {
3722
3718
  case "dashboardInput": {
@@ -3741,16 +3737,16 @@ function lr(e, t, n) {
3741
3737
  return re(t.filter, n);
3742
3738
  }
3743
3739
  }
3744
- function dr(e) {
3740
+ function ur(e) {
3745
3741
  return e.kind === "dashboardInput" ? e.input.filter : e.filter;
3746
3742
  }
3747
- function Qc(e) {
3743
+ function Xc(e) {
3748
3744
  var o;
3749
3745
  const { dashboard: t, filter: n, input: r, scope: i } = e;
3750
- return r && (t.inputs || []).some((a) => a.id === r.id) ? { kind: "dashboardInput", input: r, scope: i } : ((o = X(t).findFilterInput({ filterId: n.id })) == null ? void 0 : o.origin) === "toolbarFilter" ? { kind: "dashboardFilter", filter: n } : { kind: "definition", filter: n };
3746
+ return r && (t.inputs || []).some((a) => a.id === r.id) ? { kind: "dashboardInput", input: r, scope: i } : ((o = Q(t).findFilterInput({ filterId: n.id })) == null ? void 0 : o.origin) === "toolbarFilter" ? { kind: "dashboardFilter", filter: n } : { kind: "definition", filter: n };
3751
3747
  }
3752
- function Jc(e) {
3753
- const { dashboard: t, target: n, calendar: r } = e, i = dr(n), o = vi(i), a = Ts(t, n);
3748
+ function Yc(e) {
3749
+ const { dashboard: t, target: n, calendar: r } = e, i = ur(n), o = vi(i), a = Ds(t, n);
3754
3750
  if (!a) return o;
3755
3751
  if (a === "cleared")
3756
3752
  return {
@@ -3758,13 +3754,13 @@ function Jc(e) {
3758
3754
  defaultValues: void 0,
3759
3755
  defaultDateFilter: void 0
3760
3756
  };
3761
- const s = lr(t, n, r);
3762
- if (!s || Ds(s, re(i, r)))
3757
+ const s = dr(t, n, r);
3758
+ if (!s || ks(s, re(i, r)))
3763
3759
  return o;
3764
3760
  if (s.valueType === "date") {
3765
- const c = Ei(
3761
+ const c = bn(
3766
3762
  "relativeMeta" in s ? s.relativeMeta : void 0
3767
- ) ?? ks(i, s, r);
3763
+ ) ?? Ms(i, s, r);
3768
3764
  return c ? {
3769
3765
  operation: s.operation,
3770
3766
  defaultValues: i.defaultValues,
@@ -3777,7 +3773,7 @@ function Jc(e) {
3777
3773
  defaultDateFilter: i.defaultDateFilter
3778
3774
  };
3779
3775
  }
3780
- function Ts(e, t) {
3776
+ function Ds(e, t) {
3781
3777
  var n;
3782
3778
  if (t.kind === "dashboardInput") {
3783
3779
  const r = nt(
@@ -3792,7 +3788,7 @@ function Ts(e, t) {
3792
3788
  (r) => r.filterId === t.filter.id
3793
3789
  ) ? "set" : void 0;
3794
3790
  }
3795
- function Ds(e, t) {
3791
+ function ks(e, t) {
3796
3792
  return !!(t && e.operation === t.operation && qe(Zt(e), Zt(t)) && qe(
3797
3793
  "relativeMeta" in e ? e.relativeMeta : void 0,
3798
3794
  "relativeMeta" in t ? t.relativeMeta : void 0
@@ -3803,7 +3799,7 @@ function Zt(e) {
3803
3799
  (t) => t instanceof Date ? t.getTime() : t
3804
3800
  );
3805
3801
  }
3806
- function ks(e, t, n) {
3802
+ function Ms(e, t, n) {
3807
3803
  const r = Ii(n == null ? void 0 : n.tz), i = Pe(t.values[0], r);
3808
3804
  if (!i) return;
3809
3805
  const [o, a, s] = new Intl.DateTimeFormat("en-CA", {
@@ -3841,13 +3837,13 @@ function ks(e, t, n) {
3841
3837
  });
3842
3838
  }
3843
3839
  function en(e) {
3844
- return fa(void 0, e ?? "");
3840
+ return ma(void 0, e ?? "");
3845
3841
  }
3846
- const Ms = {
3842
+ const Os = {
3847
3843
  type: "temporal_bucket",
3848
3844
  presentation: { mode: "pattern", pattern: "YYYY-MM-DD" }
3849
3845
  };
3850
- function Os(e) {
3846
+ function _s(e) {
3851
3847
  const t = ce(e.dataType);
3852
3848
  if (!["date", "datetime"].includes(t))
3853
3849
  return e;
@@ -3860,19 +3856,19 @@ function Os(e) {
3860
3856
  });
3861
3857
  if (!r.ok)
3862
3858
  return e;
3863
- const i = n ? r.selection.format : Ms;
3859
+ const i = n ? r.selection.format : Os;
3864
3860
  return {
3865
3861
  ...e,
3866
3862
  granularity: r.granularity,
3867
3863
  format: i
3868
3864
  };
3869
3865
  }
3870
- function Zc(e, t) {
3866
+ function Jc(e, t) {
3871
3867
  var r, i;
3872
3868
  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);
3873
3869
  return `${e}-${t.qualifiedEntityName}-${t.name}-${Date.now()}-${n}`;
3874
3870
  }
3875
- function _s(e, t) {
3871
+ function Ps(e, t) {
3876
3872
  const n = gn(e.replace(/_/g, " "));
3877
3873
  switch (t) {
3878
3874
  case "SUM":
@@ -3891,14 +3887,14 @@ function _s(e, t) {
3891
3887
  return n;
3892
3888
  }
3893
3889
  }
3894
- function el(e, t, n) {
3890
+ function Zc(e, t, n) {
3895
3891
  var i;
3896
3892
  const r = hn(e.dataType);
3897
3893
  return n === "detailTable" ? "detailColumns" : n === "matrixTable" ? ((i = e.derivedField) == null ? void 0 : i.computeStage) === "aggregate" || ce(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";
3898
3894
  }
3899
- function tl(e, t, n, r) {
3895
+ function el(e, t, n, r) {
3900
3896
  const i = hn(e.dataType), o = i === "date";
3901
- e = $i(e);
3897
+ e = Ei(e);
3902
3898
  const a = Ri(e), s = a.representation !== "physical", c = a.computeStage, l = s ? e.fieldScope === "domain" ? e.calculatedFieldOrigin : e.calculatedFieldOrigin || {
3903
3899
  id: e.id,
3904
3900
  role: e.role
@@ -3949,7 +3945,7 @@ function tl(e, t, n, r) {
3949
3945
  const h = e, C = {
3950
3946
  ...m,
3951
3947
  role: "metric",
3952
- ...Vn(h, h, "selection"),
3948
+ ...Ln(h, h, "selection"),
3953
3949
  parameters: h.parameters,
3954
3950
  aliasTemplate: h.aliasTemplate,
3955
3951
  valueAliases: h.valueAliases,
@@ -3975,7 +3971,7 @@ function tl(e, t, n, r) {
3975
3971
  role: "metric"
3976
3972
  };
3977
3973
  }
3978
- const p = e.aggregate || en(i), y = _s(
3974
+ const p = e.aggregate || en(i), y = Ps(
3979
3975
  e.label,
3980
3976
  p
3981
3977
  ), g = Si(
@@ -3994,7 +3990,7 @@ function tl(e, t, n, r) {
3994
3990
  if (t === "groupBy") {
3995
3991
  if (u) {
3996
3992
  const p = e;
3997
- return Os({
3993
+ return _s({
3998
3994
  ...m,
3999
3995
  label: e.label || e.name,
4000
3996
  role: "groupby",
@@ -4054,14 +4050,14 @@ function tl(e, t, n, r) {
4054
4050
  direction: "asc"
4055
4051
  } : null;
4056
4052
  }
4057
- function nl(e) {
4053
+ function tl(e) {
4058
4054
  return Object.values(Fi(e)).some((t) => t.length > 0);
4059
4055
  }
4060
- function Ps(e) {
4061
- const t = Q(e.format);
4056
+ function As(e) {
4057
+ const t = Y(e.format);
4062
4058
  if ((t == null ? void 0 : t.type) === "temporal_bucket") {
4063
4059
  if (!e.granularity) return {};
4064
- const n = Ji(
4060
+ const n = Zi(
4065
4061
  t,
4066
4062
  e.granularity
4067
4063
  );
@@ -4078,22 +4074,22 @@ function Ps(e) {
4078
4074
  ...t ? { format: t } : {}
4079
4075
  };
4080
4076
  }
4081
- function As(e, t) {
4077
+ function Ns(e, t) {
4082
4078
  var i, o;
4083
4079
  const n = ((i = e.nativeDataType) == null ? void 0 : i.trim()) || ((o = e.native_data_type) == null ? void 0 : o.trim());
4084
4080
  return n || ((e.dataTypeProvenance || t) === "physical" ? e.data_type : void 0);
4085
4081
  }
4086
- function ur(e) {
4082
+ function fr(e) {
4087
4083
  const t = (e.label ?? "").trim();
4088
4084
  return t ? e.derivedLabel === void 0 ? !0 : t !== e.derivedLabel.trim() : !1;
4089
4085
  }
4090
4086
  function gt(e) {
4091
- return ur(e) ? e.label.trim() : e.name || (e.label ?? "").trim();
4087
+ return fr(e) ? e.label.trim() : e.name || (e.label ?? "").trim();
4092
4088
  }
4093
4089
  function tn(e) {
4094
4090
  return gt(e).toLowerCase().trim();
4095
4091
  }
4096
- function Ns(e, t) {
4092
+ function $s(e, t) {
4097
4093
  return tn(e).localeCompare(tn(t), void 0, {
4098
4094
  numeric: !0,
4099
4095
  sensitivity: "base"
@@ -4102,7 +4098,7 @@ function Ns(e, t) {
4102
4098
  function ae(e) {
4103
4099
  return String(e ?? "").toLowerCase().replace(/[\s_\-.]+/g, "");
4104
4100
  }
4105
- function rl(e, t) {
4101
+ function nl(e, t) {
4106
4102
  const n = ae(t);
4107
4103
  return n ? [
4108
4104
  gt(e),
@@ -4123,8 +4119,8 @@ function nn(e, t) {
4123
4119
  const r = ae(gt(e));
4124
4120
  return r.startsWith(n) ? 0 : r.includes(n) ? 1 : [e.label, e.name].filter(Boolean).map(ae).some((o) => o.includes(n)) ? 2 : 3;
4125
4121
  }
4126
- function il(e, t, n) {
4127
- return nn(e, n) - nn(t, n) || Ns(e, t);
4122
+ function rl(e, t, n) {
4123
+ return nn(e, n) - nn(t, n) || $s(e, t);
4128
4124
  }
4129
4125
  function Es(e, t) {
4130
4126
  var o;
@@ -4140,7 +4136,7 @@ function Es(e, t) {
4140
4136
  qualifiedEntityName: i,
4141
4137
  columns: t.map((a) => {
4142
4138
  var m;
4143
- const s = e.type === "dataset" ? a.entityName || r : e.name, c = a.qualifiedEntityName || (e.type === "dataset" && s ? At({ ...e, name: s }) : i), l = As(
4139
+ const s = e.type === "dataset" ? a.entityName || r : e.name, c = a.qualifiedEntityName || (e.type === "dataset" && s ? At({ ...e, name: s }) : i), l = Ns(
4144
4140
  a,
4145
4141
  e.type === "dataset" ? "semantic" : "physical"
4146
4142
  ), d = (m = a.label) != null && m.trim() ? a.label : void 0, u = d ? void 0 : et(a.column_name);
@@ -4169,23 +4165,23 @@ function Es(e, t) {
4169
4165
  aggregateOrigin: a.aggregateOrigin,
4170
4166
  labelOrigin: a.labelOrigin,
4171
4167
  formatOrigin: a.formatOrigin,
4172
- ...Ps(a),
4168
+ ...As(a),
4173
4169
  aggregate: a.aggregate
4174
4170
  };
4175
4171
  })
4176
4172
  };
4177
4173
  }
4178
- function $s(e) {
4174
+ function Rs(e) {
4179
4175
  return e.map((t) => ({
4180
4176
  ...t,
4181
4177
  id: yn({ ...t }),
4182
4178
  fieldScope: "domain"
4183
4179
  }));
4184
4180
  }
4185
- function Rs(e) {
4181
+ function Ks(e) {
4186
4182
  return e.flatMap(
4187
4183
  (t) => t.columns.map((n) => {
4188
- const r = ur(n) ? n.label : void 0, i = r ? void 0 : n.derivedLabel ?? gn(n.name), o = r ?? i ?? n.name;
4184
+ const r = fr(n) ? n.label : void 0, i = r ? void 0 : n.derivedLabel ?? gn(n.name), o = r ?? i ?? n.name;
4189
4185
  return {
4190
4186
  ...n,
4191
4187
  id: n.id || `${t.entityId}-${n.name}`,
@@ -4203,11 +4199,11 @@ function Rs(e) {
4203
4199
  })
4204
4200
  );
4205
4201
  }
4206
- function al(e) {
4202
+ function il(e) {
4207
4203
  const t = e.map((r) => Es(r.target, r.columns || [])).filter((r) => {
4208
4204
  var i;
4209
4205
  return ((i = r == null ? void 0 : r.columns) == null ? void 0 : i.length) > 0;
4210
- }), n = $s(e.flatMap((r) => r.calculatedFields || []));
4206
+ }), n = Rs(e.flatMap((r) => r.calculatedFields || []));
4211
4207
  if (n.length > 0) {
4212
4208
  const r = /* @__PURE__ */ new Map();
4213
4209
  n.forEach((i) => {
@@ -4223,9 +4219,9 @@ function al(e) {
4223
4219
  columns: Array.from(r.values())
4224
4220
  });
4225
4221
  }
4226
- return { columnGroups: t, columns: Rs(t) };
4222
+ return { columnGroups: t, columns: Ks(t) };
4227
4223
  }
4228
- function Ks(e, t) {
4224
+ function Vs(e, t) {
4229
4225
  var i;
4230
4226
  const n = (i = t.columnKeyMap) == null ? void 0 : i.byRole;
4231
4227
  if (!n) return;
@@ -4236,7 +4232,7 @@ function Ks(e, t) {
4236
4232
  if (r.length === 1)
4237
4233
  return r[0].outputKey ?? r[0].rawKey;
4238
4234
  }
4239
- function Vs(e, t) {
4235
+ function Ls(e, t) {
4240
4236
  var r;
4241
4237
  const n = (r = t.resultColumns) == null ? void 0 : r.find((i) => {
4242
4238
  const o = i.pivotIdentity;
@@ -4250,9 +4246,9 @@ function rn(e, t) {
4250
4246
  var n;
4251
4247
  switch (e.kind) {
4252
4248
  case "field":
4253
- return Ks(e.fieldId, t);
4249
+ return Vs(e.fieldId, t);
4254
4250
  case "pivot":
4255
- return Vs(e, t);
4251
+ return Ls(e, t);
4256
4252
  case "result":
4257
4253
  return !t.keys || t.keys.includes(e.key) ? e.key : void 0;
4258
4254
  case "sqlKpiValue":
@@ -4263,7 +4259,7 @@ function rn(e, t) {
4263
4259
  return;
4264
4260
  }
4265
4261
  }
4266
- function ol(e, t) {
4262
+ function al(e, t) {
4267
4263
  return e.flatMap((n) => {
4268
4264
  var s, c;
4269
4265
  const r = rn(n.condition.column, t);
@@ -4283,7 +4279,7 @@ function ol(e, t) {
4283
4279
  ];
4284
4280
  });
4285
4281
  }
4286
- function sl(e, t, n) {
4282
+ function ol(e, t, n) {
4287
4283
  var a, s, c, l, d;
4288
4284
  const r = Di(e);
4289
4285
  if (r.includes("matrixMeasure"))
@@ -4306,7 +4302,7 @@ function sl(e, t, n) {
4306
4302
  );
4307
4303
  return o.length === 1 ? { kind: "field", fieldId: o[0] } : void 0;
4308
4304
  }
4309
- function cl(e, t) {
4305
+ function sl(e, t) {
4310
4306
  var i, o;
4311
4307
  const n = (i = t == null ? void 0 : t.find(
4312
4308
  (a) => a.filterId === e.id
@@ -4316,11 +4312,11 @@ function cl(e, t) {
4316
4312
  ]);
4317
4313
  return n && r.has(n) ? n : e.column;
4318
4314
  }
4319
- function ll(e, t, n) {
4315
+ function cl(e, t, n) {
4320
4316
  const r = ki({ card: e, stated: t, context: n });
4321
4317
  return r.ok ? { ok: !0, card: r.update ? Mi(e, r.update).card : e, warnings: r.warnings } : r;
4322
4318
  }
4323
- function dl({
4319
+ function ll({
4324
4320
  resolvedCardConfig: e,
4325
4321
  card: t,
4326
4322
  row: n,
@@ -4378,7 +4374,7 @@ function dl({
4378
4374
  metrics: y.length > 0 ? y : void 0
4379
4375
  };
4380
4376
  }
4381
- function ul({
4377
+ function dl({
4382
4378
  resolvedCardConfig: e,
4383
4379
  card: t,
4384
4380
  columnId: n,
@@ -4390,7 +4386,7 @@ function ul({
4390
4386
  return ((l == null ? void 0 : l.outputKey) || (l == null ? void 0 : l.rawKey) || c.label) === n;
4391
4387
  });
4392
4388
  }
4393
- const Ls = {
4389
+ const qs = {
4394
4390
  noFields: "There is nothing to filter by here.",
4395
4391
  clickedColumnNotFilterable: "This column cannot filter other cards.",
4396
4392
  noChosenColumns: "This column is not set up to filter other cards.",
@@ -4398,9 +4394,9 @@ const Ls = {
4398
4394
  unsupportedCondition: "This value cannot filter other cards."
4399
4395
  };
4400
4396
  function Ve(e) {
4401
- return { status: "unavailable", code: e, reason: Ls[e] };
4397
+ return { status: "unavailable", code: e, reason: qs[e] };
4402
4398
  }
4403
- function fl(e) {
4399
+ function ul(e) {
4404
4400
  const t = e.conditions.filter(
4405
4401
  (s) => s.field.role !== "metric"
4406
4402
  );
@@ -4408,7 +4404,7 @@ function fl(e) {
4408
4404
  const n = (s) => {
4409
4405
  if (s.operator !== "=" && s.operator !== "isNull")
4410
4406
  return "unsupportedCondition";
4411
- const c = Et(
4407
+ const c = $t(
4412
4408
  s.field,
4413
4409
  e.sourceIndex
4414
4410
  );
@@ -4430,7 +4426,7 @@ function fl(e) {
4430
4426
  i.push(c);
4431
4427
  }
4432
4428
  else {
4433
- const s = r.kind === "clickedCell" && e.clickedField ? Et(e.clickedField, e.sourceIndex) : void 0, c = r.kind === "chosenColumns" ? r.clickedFieldKeys : s ? [Ae(s)] : [];
4429
+ const s = r.kind === "clickedCell" && e.clickedField ? $t(e.clickedField, e.sourceIndex) : void 0, c = r.kind === "chosenColumns" ? r.clickedFieldKeys : s ? [Ae(s)] : [];
4434
4430
  for (const l of t) {
4435
4431
  const d = n(l);
4436
4432
  typeof d != "string" && c.includes(Ae(d.field)) && i.push(d);
@@ -4446,11 +4442,11 @@ function fl(e) {
4446
4442
  return o.has(c) ? !1 : (o.add(c), !0);
4447
4443
  }) } };
4448
4444
  }
4449
- function ml(e, t) {
4445
+ function fl(e, t) {
4450
4446
  const n = e.answers.relationshipIds;
4451
4447
  return !n || !t ? !n && !t : n.length === t.length && n.every((r, i) => t[i] === r);
4452
4448
  }
4453
- const qs = /* @__PURE__ */ new Set([
4449
+ const Bs = /* @__PURE__ */ new Set([
4454
4450
  "dataset_not_reachable",
4455
4451
  "field_not_resolvable",
4456
4452
  "missing_metadata",
@@ -4462,15 +4458,15 @@ const qs = /* @__PURE__ */ new Set([
4462
4458
  function z(e) {
4463
4459
  return !!e && typeof e == "object" && !Array.isArray(e);
4464
4460
  }
4465
- function Bs(e) {
4461
+ function Us(e) {
4466
4462
  if (z(e))
4467
4463
  switch (e.status) {
4468
4464
  case "applied": {
4469
- const t = wn(e.route);
4465
+ const t = Tn(e.route);
4470
4466
  return t ? { status: "applied", route: t } : void 0;
4471
4467
  }
4472
4468
  case "skipped":
4473
- return typeof e.reason == "string" && qs.has(e.reason) ? { status: "skipped", reason: e.reason } : void 0;
4469
+ return typeof e.reason == "string" && Bs.has(e.reason) ? { status: "skipped", reason: e.reason } : void 0;
4474
4470
  case "needsPath":
4475
4471
  return { status: "needsPath" };
4476
4472
  case "blocked":
@@ -4483,22 +4479,22 @@ function Bs(e) {
4483
4479
  return;
4484
4480
  }
4485
4481
  }
4486
- function fr(e) {
4482
+ function mr(e) {
4487
4483
  if (e !== void 0)
4488
4484
  return Array.isArray(e) && e.length > 0 && e.every((t) => typeof t == "string" && t.length > 0) ? e : null;
4489
4485
  }
4490
- function Us(e) {
4486
+ function zs(e) {
4491
4487
  if (!z(e)) return;
4492
- const t = wn(e.route), n = e.target;
4493
- if (!(!t || !z(n) || n.kind !== "relationship" || !z(n.field) || typeof n.field.name != "string" || !z(n.field.source) || n.field.source.kind !== "semantic" || !fr(n.relationshipIds)))
4488
+ const t = Tn(e.route), n = e.target;
4489
+ if (!(!t || !z(n) || n.kind !== "relationship" || !z(n.field) || typeof n.field.name != "string" || !z(n.field.source) || n.field.source.kind !== "semantic" || !mr(n.relationshipIds)))
4494
4490
  return { route: t, target: n };
4495
4491
  }
4496
- function pl(e) {
4492
+ function ml(e) {
4497
4493
  if (!z(e) || !Array.isArray(e.previews)) return { previews: [] };
4498
4494
  const t = [];
4499
4495
  for (const r of e.previews) {
4500
4496
  if (!z(r) || typeof r.cardId != "string" || !r.cardId || !z(r.answers)) continue;
4501
- const i = fr(r.answers.relationshipIds), o = Bs(r.outcome), a = Array.isArray(r.paths) ? r.paths.map(Us) : [];
4497
+ const i = mr(r.answers.relationshipIds), o = Us(r.outcome), a = Array.isArray(r.paths) ? r.paths.map(zs) : [];
4502
4498
  i === null || !o || !a.every(Boolean) || o.status === "needsPath" && a.length < 2 || t.push({
4503
4499
  cardId: r.cardId,
4504
4500
  answers: i ? { relationshipIds: i } : {},
@@ -4510,18 +4506,18 @@ function pl(e) {
4510
4506
  return { previews: t, ...n ? { manageRelationships: n } : {} };
4511
4507
  }
4512
4508
  const ye = (e) => (e == null ? void 0 : e.label) || (e == null ? void 0 : e.name) || "";
4513
- function zs(e) {
4509
+ function js(e) {
4514
4510
  return !e || /s$/i.test(e) ? e : /[^aeiou]y$/i.test(e) ? `${e.slice(0, -1)}ies` : `${e}s`;
4515
4511
  }
4516
- function gl(e) {
4512
+ function pl(e) {
4517
4513
  if (e.direction === "to_many") {
4518
4514
  const n = ye(e.matchingDataset ?? e.datasets[e.datasets.length - 1]);
4519
- return `${e.base ? zs(ye(e.base)) : "Rows"} with at least one matching ${n}`;
4515
+ return `${e.base ? js(ye(e.base)) : "Rows"} with at least one matching ${n}`;
4520
4516
  }
4521
4517
  return `through ${(e.datasets.length > 1 ? e.datasets.slice(0, -1) : e.datasets).map(ye).join(", ")}`;
4522
4518
  }
4523
- const hl = "The relationship this card used changed; choose it again";
4524
- function yl(e, t) {
4519
+ const gl = "The relationship this card used changed; choose it again";
4520
+ function hl(e, t) {
4525
4521
  switch (e) {
4526
4522
  case "relationship_missing":
4527
4523
  return t ? `Not related to ${ye(t)}` : "Not related to this card";
@@ -4541,141 +4537,141 @@ function yl(e, t) {
4541
4537
  export {
4542
4538
  D as $,
4543
4539
  Es as A,
4544
- $s as B,
4545
- Rs as C,
4546
- ts as D,
4547
- al as E,
4540
+ Rs as B,
4541
+ Ks as C,
4542
+ ns as D,
4543
+ il as E,
4548
4544
  rn as F,
4549
- ol as G,
4550
- sl as H,
4551
- ll as I,
4552
- ml as J,
4553
- pl as K,
4554
- zs as L,
4555
- gl as M,
4556
- eo as N,
4557
- yl as O,
4545
+ al as G,
4546
+ ol as H,
4547
+ cl as I,
4548
+ fl as J,
4549
+ ml as K,
4550
+ js as L,
4551
+ pl as M,
4552
+ to as N,
4553
+ hl as O,
4558
4554
  gt as P,
4559
- Ga as Q,
4560
- hl as R,
4561
- Ia as S,
4562
- Ca as T,
4555
+ Wa as Q,
4556
+ gl as R,
4557
+ Ca as S,
4558
+ Fa as T,
4563
4559
  Te as U,
4564
- pc as V,
4565
- Ec as W,
4566
- uc as X,
4560
+ mc as V,
4561
+ Nc as W,
4562
+ dc as X,
4567
4563
  Fe as Y,
4568
- lo as Z,
4569
- fo as _,
4570
- Zc as a,
4571
- Nc as a$,
4572
- ss as a0,
4573
- bo as a1,
4574
- Ac as a2,
4575
- Bc as a3,
4576
- Lc as a4,
4577
- ba as a5,
4578
- ha as a6,
4579
- ya as a7,
4580
- kc as a8,
4564
+ uo as Z,
4565
+ mo as _,
4566
+ Jc as a,
4567
+ Ac as a$,
4568
+ cs as a0,
4569
+ vo as a1,
4570
+ Pc as a2,
4571
+ qc as a3,
4572
+ Vc as a4,
4573
+ va as a5,
4574
+ ya as a6,
4575
+ ba as a7,
4576
+ Dc as a8,
4581
4577
  lt as a9,
4582
4578
  ot as aA,
4583
- gc as aB,
4584
- hc as aC,
4579
+ pc as aB,
4580
+ gc as aC,
4585
4581
  Se as aD,
4586
4582
  le as aE,
4587
- dc as aF,
4588
- ul as aG,
4589
- Cc as aH,
4590
- xo as aI,
4583
+ lc as aF,
4584
+ dl as aG,
4585
+ Ic as aH,
4586
+ wo as aI,
4591
4587
  V as aJ,
4592
4588
  $c as aK,
4593
- rr as aL,
4594
- rl as aM,
4595
- ur as aN,
4596
- Hc as aO,
4597
- xs as aP,
4589
+ ir as aL,
4590
+ nl as aM,
4591
+ fr as aN,
4592
+ Wc as aO,
4593
+ ws as aP,
4598
4594
  se as aQ,
4599
4595
  pt as aR,
4600
- jc as aS,
4601
- Xc as aT,
4602
- Gc as aU,
4603
- Is as aV,
4604
- As as aW,
4605
- Jc as aX,
4606
- Qc as aY,
4607
- Wc as aZ,
4608
- Ss as a_,
4609
- yc as aa,
4610
- Sc as ab,
4611
- wc as ac,
4612
- xc as ad,
4596
+ zc as aS,
4597
+ Hc as aT,
4598
+ jc as aU,
4599
+ Cs as aV,
4600
+ Ns as aW,
4601
+ Yc as aX,
4602
+ Xc as aY,
4603
+ Gc as aZ,
4604
+ xs as a_,
4605
+ hc as aa,
4606
+ Fc as ab,
4607
+ xc as ac,
4608
+ Sc as ad,
4613
4609
  st as ae,
4614
- Ra as af,
4615
- Fc as ag,
4616
- Tc as ah,
4617
- ka as ai,
4618
- qa as aj,
4619
- Ba as ak,
4620
- Dc as al,
4610
+ Ka as af,
4611
+ Cc as ag,
4612
+ wc as ah,
4613
+ Ma as ai,
4614
+ Ba as aj,
4615
+ Ua as ak,
4616
+ Tc as al,
4621
4617
  U as am,
4622
4618
  je as an,
4623
- Ka as ao,
4624
- bc as ap,
4625
- vc as aq,
4626
- nl as ar,
4627
- Ic as as,
4628
- Kn as at,
4629
- mc as au,
4630
- Wa as av,
4631
- ga as aw,
4632
- lc as ax,
4633
- Tn as ay,
4634
- Fa as az,
4635
- _s as b,
4636
- so as b0,
4637
- $a as b1,
4638
- il as b2,
4619
+ Va as ao,
4620
+ yc as ap,
4621
+ bc as aq,
4622
+ tl as ar,
4623
+ vc as as,
4624
+ Vn as at,
4625
+ fc as au,
4626
+ Ha as av,
4627
+ ha as aw,
4628
+ cc as ax,
4629
+ Dn as ay,
4630
+ Sa as az,
4631
+ Ps as b,
4632
+ co as b0,
4633
+ Ra as b1,
4634
+ rl as b2,
4639
4635
  nn as b3,
4640
- uo as b4,
4641
- Ps as b5,
4642
- qc as b6,
4643
- as as b7,
4644
- el as b8,
4645
- Os as b9,
4636
+ fo as b4,
4637
+ As as b5,
4638
+ Lc as b6,
4639
+ os as b7,
4640
+ Zc as b8,
4641
+ _s as b9,
4646
4642
  ae as ba,
4647
- Rc as bb,
4648
- vo as bc,
4649
- Kc as bd,
4643
+ Ec as bb,
4644
+ Io as bc,
4645
+ Rc as bd,
4650
4646
  Wt as be,
4651
- Io as bf,
4652
- tr as bg,
4653
- er as bh,
4654
- Go as bi,
4655
- Uc as bj,
4656
- fc as bk,
4647
+ Co as bf,
4648
+ nr as bg,
4649
+ tr as bh,
4650
+ Wo as bi,
4651
+ Bc as bj,
4652
+ uc as bk,
4657
4653
  en as c,
4658
- cl as d,
4659
- Co as e,
4660
- Vc as f,
4661
- tl as g,
4662
- Pc as h,
4663
- _c as i,
4664
- zc as j,
4665
- ws as k,
4666
- wo as l,
4667
- To as m,
4668
- dl as n,
4669
- Ha as o,
4654
+ sl as d,
4655
+ Fo as e,
4656
+ Kc as f,
4657
+ el as g,
4658
+ _c as h,
4659
+ Oc as i,
4660
+ Uc as j,
4661
+ Ts as k,
4662
+ To as l,
4663
+ Do as m,
4664
+ ll as n,
4665
+ Qa as o,
4670
4666
  Ya as p,
4671
- Qa as q,
4672
- Yc as r,
4673
- fl as s,
4674
- Mc as t,
4675
- Vn as u,
4676
- io as v,
4677
- Ja as w,
4678
- Oc as x,
4679
- Za as y,
4680
- no as z
4667
+ Ja as q,
4668
+ Qc as r,
4669
+ ul as s,
4670
+ kc as t,
4671
+ Ln as u,
4672
+ ao as v,
4673
+ Za as w,
4674
+ Mc as x,
4675
+ eo as y,
4676
+ ro as z
4681
4677
  };