react-semaphor 0.1.524 → 0.1.526

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 (82) hide show
  1. package/dist/brand-studio/index.js +37 -37
  2. package/dist/briefings/index.js +38 -33
  3. package/dist/chunks/{calculated-field-identity-Dy_WpDdo.js → calculated-field-identity-D1ofR4KJ.js} +28 -28
  4. package/dist/chunks/{card-config-utils-CAyjC5Tp.js → card-config-utils-9sv4e-Vb.js} +15 -15
  5. package/dist/chunks/{switch-CWPcwAZ4.js → code-highlight-994tgM9v.js} +6309 -8642
  6. package/dist/chunks/dashboard-CsHvEtjN.js +15 -0
  7. package/dist/chunks/{dashboard-briefing-launcher-CTEyh3FQ.js → dashboard-briefing-launcher-DXz1GhFZ.js} +364 -370
  8. package/dist/chunks/{dashboard-controls-C3KbYzz-.js → dashboard-controls-Df8qOSrs.js} +163 -168
  9. package/dist/chunks/dashboard-json-Xldp0qww.js +65 -0
  10. package/dist/chunks/{edit-dashboard-visual-DqRmfRqN.js → edit-dashboard-visual-COHBqyic.js} +2836 -2829
  11. package/dist/chunks/editor-action-buttons-DahlP57T.js +2071 -0
  12. package/dist/chunks/{index-D9HDUSye.js → index-CbjuruKe.js} +1187 -1018
  13. package/dist/chunks/{matrix-control-sources-B1K7x0SL.js → matrix-control-sources-2VAzGlt8.js} +29 -29
  14. package/dist/chunks/pre-block-Cq1RqhZX.js +3987 -0
  15. package/dist/chunks/report-preferences-dialog-BcH-0lR-.js +1232 -0
  16. package/dist/chunks/search-CJz-QQ0Q.js +24 -0
  17. package/dist/chunks/{selection-reducer-CvCBQbl2.js → selection-reducer-NF5C07yM.js} +25 -46
  18. package/dist/chunks/{index-D7GVxl4a.js → semaphor-ready-indicator-BLRDuLr4.js} +55200 -59783
  19. package/dist/chunks/slider-BYIH4icg.js +877 -0
  20. package/dist/chunks/switch-XaAACBrJ.js +2234 -0
  21. package/dist/dashboard/index.js +1 -1
  22. package/dist/dashboard-authoring/index.js +4 -4
  23. package/dist/data-app-builder/index.js +67 -67
  24. package/dist/data-app-sdk/index.js +33 -32
  25. package/dist/index.js +435 -243
  26. package/dist/style.css +1 -1
  27. package/dist/surfboard/index.js +4 -5
  28. package/dist/types/briefings/index.d.ts +1 -1
  29. package/dist/types/briefings/schedule.d.ts +49 -2
  30. package/dist/types/components/briefings/briefing-author/form-primitives.d.ts +1 -1
  31. package/dist/types/components/briefings/briefing-author/schedule-model.d.ts +12 -2
  32. package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
  33. package/dist/types/components/dashboard/sheet/layout-change-guard.d.ts +1 -1
  34. package/dist/types/components/dashboard/sheet/sheet-layout.d.ts +1 -1
  35. package/dist/types/components/editor/editor-main/text-card.d.ts +1 -1
  36. package/dist/types/components/editor/editor.d.ts +1 -1
  37. package/dist/types/components/providers/semaphor-context-provider.d.ts +1 -1
  38. package/dist/types/components/providers/theme-provider-context.d.ts +1 -1
  39. package/dist/types/components/providers/theme-provider.d.ts +1 -1
  40. package/dist/types/components/shared/unsaved-changes/use-pristine-snapshot-initializer.d.ts +1 -1
  41. package/dist/types/components/sharing-and-management/hooks/use-groups.d.ts +5 -1
  42. package/dist/types/components/sharing-and-management/hooks/use-unified-users.d.ts +9 -1
  43. package/dist/types/components/sharing-and-management/resource-share-dialog/index.d.ts +1 -1
  44. package/dist/types/components/sharing-and-management/resource-share-dialog/unified/adapter.d.ts +21 -1
  45. package/dist/types/components/sharing-and-management/resource-share-dialog/unified/configs.d.ts +12 -0
  46. package/dist/types/components/sharing-and-management/resource-share-dialog/unified/invite-combobox.d.ts +5 -0
  47. package/dist/types/components/sharing-and-management/resource-share-dialog/unified/share-shape.d.ts +7 -0
  48. package/dist/types/components/sharing-and-management/resource-share-dialog/unified/types.d.ts +2 -0
  49. package/dist/types/components/sharing-and-management/utils/shares-types.d.ts +8 -0
  50. package/dist/types/components/sharing-and-management/utils/types.d.ts +2 -0
  51. package/dist/types/components/surfboard/dashboard-plus.d.ts +1 -1
  52. package/dist/types/components/ui/resizable.d.ts +1 -1
  53. package/dist/types/components/visual/column-display-utils.d.ts +1 -1
  54. package/dist/types/components/visual/kpi-visual/kpi-utils.d.ts +1 -1
  55. package/dist/types/components/visual/settings/color-format.d.ts +1 -1
  56. package/dist/types/components/visual/visual-utils.d.ts +1 -1
  57. package/dist/types/lib/actions/data-point-click-action.d.ts +2 -1
  58. package/dist/types/lib/charts/area-chart.d.ts +1 -1
  59. package/dist/types/lib/charts/bar-chart.d.ts +1 -1
  60. package/dist/types/lib/charts/cartesian-data.d.ts +72 -0
  61. package/dist/types/lib/charts/cartesian-fields.d.ts +60 -0
  62. package/dist/types/lib/charts/chart-utils.d.ts +3 -0
  63. package/dist/types/lib/charts/combo-chart.d.ts +1 -1
  64. package/dist/types/lib/charts/create-chart.d.ts +1 -1
  65. package/dist/types/lib/charts/line-chart.d.ts +1 -1
  66. package/dist/types/lib/charts/shared/category-group-axis-plugin.d.ts +23 -0
  67. package/dist/types/lib/charts/stacked-line-chart.d.ts +2 -0
  68. package/dist/types/lib/charts/types.d.ts +1 -7
  69. package/dist/types/lib/dashboard/normalize-dashboard-for-dirty-check.d.ts +1 -1
  70. package/dist/types/lib/formatters/cartesian-temporal-presentation.d.ts +6 -1
  71. package/dist/types/lib/hooks/explorer/use-schemas.d.ts +1 -1
  72. package/dist/types/lib/hooks/use-dashboard.d.ts +2 -2
  73. package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +1 -2
  74. package/dist/types/lib/stores/editor-store.d.ts +1 -2
  75. package/dist/types/lib/stores/table-actions.d.ts +2 -1
  76. package/dist/types/lib/types/token-types.d.ts +0 -12
  77. package/dist/types/lib/utils.d.ts +0 -2
  78. package/package.json +2 -1
  79. package/dist/chunks/dashboard-json-Kc_M7nLP.js +0 -75
  80. package/dist/chunks/editor-action-buttons-s-ByVR9x.js +0 -2019
  81. package/dist/chunks/report-preferences-dialog-RAp0DAuw.js +0 -723
  82. package/dist/types/lib/encrypt-utils.d.ts +0 -9
@@ -1,28 +1,28 @@
1
- var rt = Object.defineProperty;
2
- var nt = (e, r, t) => r in e ? rt(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var F = (e, r, t) => nt(e, typeof r != "symbol" ? r + "" : r, t);
4
- import { k as ke, g as ot } from "./numeric-presentation-VhMUHfrJ.js";
5
- import { al as Ee, a5 as at, a7 as ce, $ as me, t as it } from "./validators-CsdOtZI6.js";
1
+ var ft = Object.defineProperty;
2
+ var pt = (e, r, t) => r in e ? ft(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var F = (e, r, t) => pt(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import { k as Re, g as yt } from "./numeric-presentation-VhMUHfrJ.js";
5
+ import { al as Ae, a5 as ht, a7 as me, $ as ye, t as gt } from "./validators-CsdOtZI6.js";
6
6
  import "./matrix-continuation-C4sRcjZU.js";
7
- import { $ as ct, a1 as lt } from "./matrix-operation-contract-D32U2CSw.js";
8
- import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as ue } from "../value-format-preferences/index.js";
9
- import { k as dt, i as st, g as mt, j as ut, e as ft, M as pt, c as yt, b as ht, P as j } from "./pivot-result-lifecycle-BFO354lk.js";
10
- import { z as C } from "zod";
11
- import { r as gt } from "./matrix-definition-E5gXXSTZ.js";
12
- import { h as Se, i as fe, r as _e, a as Fe, v as vt, b as bt } from "./card-config-utils-CAyjC5Tp.js";
13
- import { r as It } from "./matrix-card-CIlz0Dnp.js";
14
- import { a as Re, s as wt, i as Ct, o as Tt } from "./field-aggregations-BQjogiI1.js";
15
- import { h as J, r as G, c as xt, R as $t, v as kt } from "./raw-temporal-7bFbXd2a.js";
16
- import { r as L, b as Et, d as St, P as _t } from "./pivot-result-identity-BzUQiCEV.js";
17
- import { v as Ft, a as Rt } from "./temporal-bucket-contract-DTLDRzgV.js";
18
- import { f as At, c as Pt, r as Ae, D as Mt } from "./temporal-bucket-PcLFSYWX.js";
19
- import { v as Pe } from "./raw-temporal-contract-BQZIJ1fn.js";
20
- import { r as Bt, a as Dt, b as Ot } from "./canonical-result-keys-CEQefvdO.js";
21
- const Kt = `import pandas as pd
7
+ import { $ as vt, a1 as bt } from "./matrix-operation-contract-D32U2CSw.js";
8
+ import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as he } from "../value-format-preferences/index.js";
9
+ import { k as It, i as Ct, g as Tt, j as wt, e as $t, M as xt, c as kt, b as Et, P as G } from "./pivot-result-lifecycle-BFO354lk.js";
10
+ import { z as T } from "zod";
11
+ import { r as St } from "./matrix-definition-E5gXXSTZ.js";
12
+ import { h as De, i as ge, r as Me, a as Pe, v as _t, b as Ft } from "./card-config-utils-9sv4e-Vb.js";
13
+ import { r as Rt } from "./matrix-card-CIlz0Dnp.js";
14
+ import { a as Be, s as At, i as Dt, o as Mt } from "./field-aggregations-BQjogiI1.js";
15
+ import { h as re, r as W, c as Pt, R as Bt, v as Ot } from "./raw-temporal-7bFbXd2a.js";
16
+ import { r as V, b as Kt, d as Nt, P as Lt } from "./pivot-result-identity-BzUQiCEV.js";
17
+ import { v as zt, a as qt } from "./temporal-bucket-contract-DTLDRzgV.js";
18
+ import { f as Vt, c as Ut, r as Oe, D as jt } from "./temporal-bucket-PcLFSYWX.js";
19
+ import { v as Ke } from "./raw-temporal-contract-BQZIJ1fn.js";
20
+ import { r as Gt, a as Ht, b as Wt } from "./canonical-result-keys-CEQefvdO.js";
21
+ const Yt = `import pandas as pd
22
22
  df = pd.DataFrame(data) # 'data' contains the query result
23
23
  result = df.to_dict('records') # must return 'result' as [dict] type
24
24
  `;
25
- function On(e) {
25
+ function ro(e) {
26
26
  return {
27
27
  databaseName: (e == null ? void 0 : e.lastSelectedDatabase) || "",
28
28
  schemaName: (e == null ? void 0 : e.lastSelectedSchema) || "",
@@ -30,17 +30,17 @@ function On(e) {
30
30
  datamodelId: (e == null ? void 0 : e.datamodelId) || ""
31
31
  };
32
32
  }
33
- function W(e) {
34
- return e === Kt ? "" : e;
33
+ function Z(e) {
34
+ return e === Yt ? "" : e;
35
35
  }
36
- function X(e, r = e.config) {
37
- return Re({
38
- hasExecutableConfig: Se(r, e.type),
36
+ function ne(e, r = e.config) {
37
+ return Be({
38
+ hasExecutableConfig: De(r, e.type),
39
39
  sql: e.sql,
40
- normalizedPython: W(e.python || "")
40
+ normalizedPython: Z(e.python || "")
41
41
  });
42
42
  }
43
- class Nt extends Error {
43
+ class Zt extends Error {
44
44
  constructor(t) {
45
45
  super(
46
46
  `ambiguous_temporal_grain: Temporal field "${t}" has saved presentation but no valid grouping grain. Reconfigure and resave the field.`
@@ -50,17 +50,17 @@ class Nt extends Error {
50
50
  this.name = "AmbiguousGroupedTemporalGrainError", this.fieldId = t;
51
51
  }
52
52
  }
53
- function zt(e) {
54
- return Fe(e) || e.semanticTemporalPresentation != null;
53
+ function Qt(e) {
54
+ return Pe(e) || e.semanticTemporalPresentation != null;
55
55
  }
56
- function Lt(e) {
56
+ function Xt(e) {
57
57
  if (!e.id || !["date", "datetime"].includes(
58
- Ee(e.dataType)
58
+ Ae(e.dataType)
59
59
  ))
60
60
  return;
61
- if (at(e.granularity)) return e;
62
- if (!zt(e)) return;
63
- if (!_e({
61
+ if (ht(e.granularity)) return e;
62
+ if (!Qt(e)) return;
63
+ if (!Me({
64
64
  fieldId: e.id,
65
65
  dataType: e.dataType,
66
66
  granularity: e.granularity,
@@ -68,15 +68,15 @@ function Lt(e) {
68
68
  dateFormat: e.dateFormat,
69
69
  customFormat: e.customFormat
70
70
  }).ok)
71
- throw new Nt(e.id);
71
+ throw new Zt(e.id);
72
72
  return { ...e, granularity: "day" };
73
73
  }
74
- function pe(e) {
74
+ function ve(e) {
75
75
  const r = e.cardConfig ?? e.card.config;
76
- if (!r || !e.supportsCardType(e.card.type) || Re({
77
- hasExecutableConfig: Se(r),
76
+ if (!r || !e.supportsCardType(e.card.type) || Be({
77
+ hasExecutableConfig: De(r),
78
78
  sql: e.card.sql,
79
- normalizedPython: W(e.card.python || "")
79
+ normalizedPython: Z(e.card.python || "")
80
80
  }) !== "config")
81
81
  return;
82
82
  const t = [
@@ -93,74 +93,74 @@ function pe(e) {
93
93
  cardType: e.card.type,
94
94
  cardConfig: r,
95
95
  fields: t.flatMap((n) => {
96
- const o = Lt(n);
96
+ const o = Xt(n);
97
97
  return o ? [o] : [];
98
98
  })
99
99
  };
100
100
  }
101
- function Kn(e) {
102
- if (fe(e.card))
103
- return pe({
101
+ function no(e) {
102
+ if (ge(e.card))
103
+ return ve({
104
104
  ...e,
105
105
  card: e.card,
106
106
  supportsCardType: (r) => r === "table"
107
107
  });
108
108
  }
109
- function Nn(e) {
110
- if (fe(e.card))
111
- return pe({
109
+ function oo(e) {
110
+ if (ge(e.card))
111
+ return ve({
112
112
  ...e,
113
113
  card: e.card,
114
- supportsCardType: Ct
114
+ supportsCardType: Dt
115
115
  });
116
116
  }
117
- function Vt(e) {
118
- if (fe(e.card))
119
- return pe({
117
+ function Jt(e) {
118
+ if (ge(e.card))
119
+ return ve({
120
120
  ...e,
121
121
  card: e.card,
122
122
  // Raw detail-table presentation has its own result/adapter contract.
123
123
  // This module remains grouped-only even though the shared producer
124
124
  // registry now recognizes detailTable.
125
- supportsCardType: (r) => r !== "detailTable" && wt(r)
125
+ supportsCardType: (r) => r !== "detailTable" && At(r)
126
126
  });
127
127
  }
128
- const we = /* @__PURE__ */ new WeakMap();
129
- function qt(e) {
130
- const r = we.get(e);
128
+ const xe = /* @__PURE__ */ new WeakMap();
129
+ function er(e) {
130
+ const r = xe.get(e);
131
131
  if (r) return r;
132
- const t = dt(e);
133
- return we.set(e, t), t;
132
+ const t = It(e);
133
+ return xe.set(e, t), t;
134
134
  }
135
- function q(e, r) {
135
+ function j(e, r) {
136
136
  const t = e ?? [], n = r ?? [];
137
137
  return t.length === n.length && t.every((o, a) => o === n[a]);
138
138
  }
139
- function jt(e, r) {
140
- const t = st({
139
+ function tr(e, r) {
140
+ const t = Ct({
141
141
  groupByFields: r.groupByColumns,
142
142
  metricFields: r.metricColumns,
143
143
  pivotByFields: r.pivotByColumns,
144
144
  detailFields: r.detailColumns
145
145
  });
146
- return q(
146
+ return j(
147
147
  e.expectedRoleFieldIds.groupby,
148
148
  t.expectedRoleFieldIds.groupby
149
- ) && q(
149
+ ) && j(
150
150
  e.expectedRoleFieldIds.metric,
151
151
  t.expectedRoleFieldIds.metric
152
- ) && q(
152
+ ) && j(
153
153
  e.expectedRoleFieldIds.pivotby,
154
154
  t.expectedRoleFieldIds.pivotby
155
- ) && q(
155
+ ) && j(
156
156
  e.expectedRoleFieldIds.detail,
157
157
  t.expectedRoleFieldIds.detail
158
- ) && q(
158
+ ) && j(
159
159
  e.expectedMetricAliases,
160
160
  t.expectedMetricAliases
161
161
  );
162
162
  }
163
- class Ut extends Error {
163
+ class rr extends Error {
164
164
  constructor(t) {
165
165
  super(
166
166
  `missing_resolved_temporal_format: Saved presentation is missing temporal field "${t.fieldId}" for card "${t.cardId}". Resave the report or Briefing to capture the current dashboard presentation.`
@@ -173,7 +173,7 @@ class Ut extends Error {
173
173
  this.name = "MissingResolvedTemporalPresentationError", this.dashboardId = t.dashboardId, this.cardId = t.cardId, this.fieldId = t.fieldId;
174
174
  }
175
175
  }
176
- class te extends Error {
176
+ class ae extends Error {
177
177
  constructor(t) {
178
178
  super(
179
179
  `missing_temporal_bucket_metadata: Result column "${t.columnKey}" is missing temporal bucket metadata for field "${t.fieldId}" on card "${t.cardId}". Refresh the report and resave the delivery if the problem persists.`
@@ -186,23 +186,23 @@ class te extends Error {
186
186
  this.name = "MissingTemporalResultMetadataError", this.cardId = t.cardId, this.fieldId = t.fieldId, this.columnKey = t.columnKey;
187
187
  }
188
188
  }
189
- class N extends Error {
189
+ class L extends Error {
190
190
  constructor(t, n, o) {
191
191
  super(`${t}: ${n}`);
192
192
  F(this, "deliveryBlocking", !0);
193
193
  this.code = t, this.context = o, this.name = "DashboardTemporalBoundaryError";
194
194
  }
195
195
  }
196
- function Me(e, r) {
196
+ function Ne(e, r) {
197
197
  return `${r}:${e}`;
198
198
  }
199
- function Gt(e) {
199
+ function nr(e) {
200
200
  var r, t;
201
201
  return (t = (r = e.presentation) == null ? void 0 : r.byFieldRole) == null ? void 0 : t.get(
202
- Me(e.fieldId, e.role)
202
+ Ne(e.fieldId, e.role)
203
203
  );
204
204
  }
205
- function Ht(e) {
205
+ function or(e) {
206
206
  var t;
207
207
  if ((((t = e.cardConfig.metricColumns) == null ? void 0 : t.length) || 0) > 0 || e.binding.role !== "metric")
208
208
  return !1;
@@ -210,22 +210,22 @@ function Ht(e) {
210
210
  return e.columns.some(
211
211
  (n) => {
212
212
  var o;
213
- return n.role === "measure" && n.dataType === "number" && (n.key === r || ((o = n.pivotIdentity) == null ? void 0 : o.metricId) === ce);
213
+ return n.role === "measure" && n.dataType === "number" && (n.key === r || ((o = n.pivotIdentity) == null ? void 0 : o.metricId) === me);
214
214
  }
215
215
  );
216
216
  }
217
- function zn(e, r) {
217
+ function ao(e, r) {
218
218
  return !r || r.byColumnKey.size === 0 ? e.map((t) => ({ ...t })) : e.map((t) => {
219
219
  const n = { ...t };
220
220
  return r.byColumnKey.forEach((o, a) => {
221
- Object.prototype.hasOwnProperty.call(t, a) && (n[a] = Be({
221
+ Object.prototype.hasOwnProperty.call(t, a) && (n[a] = Le({
222
222
  value: t[a],
223
223
  presentation: o
224
224
  }));
225
225
  }), n;
226
226
  });
227
227
  }
228
- function Ln(e) {
228
+ function io(e) {
229
229
  var p;
230
230
  if (!e.result || typeof e.result != "object") return !1;
231
231
  const r = e.result;
@@ -234,64 +234,64 @@ function Ln(e) {
234
234
  const t = e.activation;
235
235
  if (!t || t.cardType !== "pivotTable" && t.fields.length === 0)
236
236
  return !0;
237
- const n = Array.isArray(r.records) ? r.records.length : void 0, o = (t.cardConfig.pivotByColumns || []).map((d) => d.id);
237
+ const n = Array.isArray(r.records) ? r.records.length : void 0, o = (t.cardConfig.pivotByColumns || []).map((m) => m.id);
238
238
  if (t.cardType === "pivotTable")
239
239
  try {
240
- const d = qt(r);
241
- if (!jt(
242
- d.pivotResultContract,
240
+ const m = er(r);
241
+ if (!tr(
242
+ m.pivotResultContract,
243
243
  t.cardConfig
244
244
  ))
245
245
  return !1;
246
- if (d.pivotResultState === "loaded_empty") return !0;
247
- const v = d.columns.filter(
248
- (w) => d.pivotResultContract.columnKinds[w.key] === "pivot_metric"
249
- ), h = v.filter(
250
- (w) => {
251
- var g;
252
- return (((g = w.pivotIdentity) == null ? void 0 : g.members.length) ?? 0) > 0;
246
+ if (m.pivotResultState === "loaded_empty") return !0;
247
+ const g = m.columns.filter(
248
+ (C) => m.pivotResultContract.columnKinds[C.key] === "pivot_metric"
249
+ ), y = g.filter(
250
+ (C) => {
251
+ var v;
252
+ return (((v = C.pivotIdentity) == null ? void 0 : v.members.length) ?? 0) > 0;
253
253
  }
254
- ), b = v.length > 0 && v.every(
255
- (w) => {
256
- var g;
257
- return ((g = w.pivotIdentity) == null ? void 0 : g.members.length) === 0 && Et({
254
+ ), b = g.length > 0 && g.every(
255
+ (C) => {
256
+ var v;
257
+ return ((v = C.pivotIdentity) == null ? void 0 : v.members.length) === 0 && Kt({
258
258
  expectedPivotFieldIds: o,
259
- classification: d.pivotResultContract.columnClassifications[w.key]
259
+ classification: m.pivotResultContract.columnClassifications[C.key]
260
260
  });
261
261
  }
262
262
  );
263
- return t.fields.every((w) => {
263
+ return t.fields.every((C) => {
264
264
  var E;
265
- const g = L(
266
- d.columnKeyMap,
267
- w.id,
268
- w.role
265
+ const v = V(
266
+ m.columnKeyMap,
267
+ C.id,
268
+ C.role
269
269
  );
270
- if (!g) return !1;
271
- if (g.role === "pivotby") {
272
- const _ = h.flatMap(
273
- (P) => {
274
- var V;
275
- return ((V = P.pivotIdentity) == null ? void 0 : V.members.filter(
276
- (tt) => tt.fieldId === w.id
270
+ if (!v) return !1;
271
+ if (v.role === "pivotby") {
272
+ const _ = y.flatMap(
273
+ (M) => {
274
+ var U;
275
+ return ((U = M.pivotIdentity) == null ? void 0 : U.members.filter(
276
+ (ut) => ut.fieldId === C.id
277
277
  )) ?? [];
278
278
  }
279
279
  );
280
280
  return _.length === 0 ? b : _.every(
281
- (P) => {
282
- var V;
283
- return ((V = P.temporalBucket) == null ? void 0 : V.granularity) === w.granularity;
281
+ (M) => {
282
+ var U;
283
+ return ((U = M.temporalBucket) == null ? void 0 : U.granularity) === C.granularity;
284
284
  }
285
285
  );
286
286
  }
287
- const T = d.columns.find(
288
- (_) => _.key === (g.outputKey || g.rawKey)
287
+ const w = m.columns.find(
288
+ (_) => _.key === (v.outputKey || v.rawKey)
289
289
  );
290
- return ((E = T == null ? void 0 : T.temporalBucket) == null ? void 0 : E.granularity) === w.granularity;
290
+ return ((E = w == null ? void 0 : w.temporalBucket) == null ? void 0 : E.granularity) === C.granularity;
291
291
  });
292
- } catch (d) {
293
- if (d instanceof ut) return !1;
294
- throw d;
292
+ } catch (m) {
293
+ if (m instanceof wt) return !1;
294
+ throw m;
295
295
  }
296
296
  if (n === 0)
297
297
  return !0;
@@ -299,100 +299,100 @@ function Ln(e) {
299
299
  if (!a || !a.byRole || typeof a.byRole != "object" || Array.isArray(a.byRole))
300
300
  return !1;
301
301
  const i = [
302
- ...(t.cardConfig.groupByColumns || []).map((d) => ({
303
- field: d,
302
+ ...(t.cardConfig.groupByColumns || []).map((m) => ({
303
+ field: m,
304
304
  role: "groupby"
305
305
  })),
306
- ...(t.cardConfig.metricColumns || []).map((d) => ({
307
- field: d,
306
+ ...(t.cardConfig.metricColumns || []).map((m) => ({
307
+ field: m,
308
308
  role: "metric"
309
309
  })),
310
- ...(t.cardConfig.pivotByColumns || []).map((d) => ({
311
- field: d,
310
+ ...(t.cardConfig.pivotByColumns || []).map((m) => ({
311
+ field: m,
312
312
  role: "pivotby"
313
313
  })),
314
- ...(t.cardConfig.detailColumns || []).map((d) => ({
315
- field: d,
314
+ ...(t.cardConfig.detailColumns || []).map((m) => ({
315
+ field: m,
316
316
  role: "detail"
317
317
  }))
318
318
  ], l = new Set(
319
- i.map(({ field: d, role: v }) => `${v}:${d.id}`)
320
- ), m = new Map(
321
- (r.columns || []).map((d) => [d.key, d])
322
- ), c = L(
319
+ i.map(({ field: m, role: g }) => `${g}:${m.id}`)
320
+ ), d = new Map(
321
+ (r.columns || []).map((m) => [m.key, m])
322
+ ), c = V(
323
323
  a,
324
- ce,
324
+ me,
325
325
  "metric"
326
326
  );
327
327
  if (c) {
328
- if (!Ht({
328
+ if (!or({
329
329
  cardConfig: t.cardConfig,
330
330
  binding: c,
331
331
  columns: r.columns || []
332
332
  }))
333
333
  return !1;
334
- l.add(`metric:${ce}`);
334
+ l.add(`metric:${me}`);
335
335
  }
336
336
  const s = Object.entries(a.byRole).flatMap(
337
- ([d, v]) => Object.keys(v || {}).map((h) => `${d}:${h}`)
337
+ ([m, g]) => Object.keys(g || {}).map((y) => `${m}:${y}`)
338
338
  );
339
- if (s.length !== l.size || s.some((d) => !l.has(d)) || i.some(
340
- ({ field: d, role: v }) => !L(a, d.id, v)
339
+ if (s.length !== l.size || s.some((m) => !l.has(m)) || i.some(
340
+ ({ field: m, role: g }) => !V(a, m.id, g)
341
341
  ))
342
342
  return !1;
343
343
  try {
344
- St(
345
- (r.columns || []).map((d) => ({
346
- key: d.key,
347
- pivotIdentity: d.pivotIdentity
344
+ Nt(
345
+ (r.columns || []).map((m) => ({
346
+ key: m.key,
347
+ pivotIdentity: m.pivotIdentity
348
348
  })),
349
349
  {
350
350
  expectedPivotFieldIds: o,
351
351
  columnClassifications: r.columnMetadata
352
352
  }
353
353
  );
354
- } catch (d) {
355
- if (d instanceof _t) return !1;
356
- throw d;
354
+ } catch (m) {
355
+ if (m instanceof Lt) return !1;
356
+ throw m;
357
357
  }
358
- const u = (r.columns || []).filter((d) => {
359
- const v = d.pivotIdentity;
360
- return !!(v && v.members.length > 0);
358
+ const u = (r.columns || []).filter((m) => {
359
+ const g = m.pivotIdentity;
360
+ return !!(g && g.members.length > 0);
361
361
  });
362
- return n !== 0 && ((p = t.cardConfig.pivotByColumns) != null && p.length) && u.length === 0 ? !1 : t.fields.every((d) => {
362
+ return n !== 0 && ((p = t.cardConfig.pivotByColumns) != null && p.length) && u.length === 0 ? !1 : t.fields.every((m) => {
363
363
  var b;
364
- const v = L(
364
+ const g = V(
365
365
  a,
366
- d.id,
367
- d.role
366
+ m.id,
367
+ m.role
368
368
  );
369
- if (!v) return !1;
370
- if (v.role === "pivotby") {
371
- const g = u.flatMap(
372
- (T) => {
369
+ if (!g) return !1;
370
+ if (g.role === "pivotby") {
371
+ const v = u.flatMap(
372
+ (w) => {
373
373
  var E;
374
- return ((E = T.pivotIdentity) == null ? void 0 : E.members) ?? [];
374
+ return ((E = w.pivotIdentity) == null ? void 0 : E.members) ?? [];
375
375
  }
376
- ).filter((T) => T.fieldId === d.id);
377
- return u.length === 0 ? n === 0 : g.length > 0 && g.every(
378
- (T) => {
376
+ ).filter((w) => w.fieldId === m.id);
377
+ return u.length === 0 ? n === 0 : v.length > 0 && v.every(
378
+ (w) => {
379
379
  var E;
380
- return ((E = T.temporalBucket) == null ? void 0 : E.granularity) === d.granularity;
380
+ return ((E = w.temporalBucket) == null ? void 0 : E.granularity) === m.granularity;
381
381
  }
382
382
  );
383
383
  }
384
- const h = m.get(v.outputKey || v.rawKey);
385
- return ((b = h == null ? void 0 : h.temporalBucket) == null ? void 0 : b.granularity) === d.granularity;
384
+ const y = d.get(g.outputKey || g.rawKey);
385
+ return ((b = y == null ? void 0 : y.temporalBucket) == null ? void 0 : b.granularity) === m.granularity;
386
386
  });
387
387
  }
388
- function Q(e, r) {
388
+ function ee(e, r) {
389
389
  const t = e.semanticTemporalPresentation, n = r === "card" ? {
390
390
  format: e.format,
391
391
  dateFormat: e.dateFormat
392
392
  } : { format: t == null ? void 0 : t.format };
393
- if (!Fe(n))
393
+ if (!Pe(n))
394
394
  return;
395
- const o = _e({
395
+ const o = Me({
396
396
  fieldId: e.id,
397
397
  dataType: e.dataType,
398
398
  granularity: r === "semantic" ? t == null ? void 0 : t.granularity : e.granularity,
@@ -405,9 +405,9 @@ function Q(e, r) {
405
405
  if (!o.ok) throw new Error(o.error.code);
406
406
  return o.format;
407
407
  }
408
- function Wt(e, r, t = ue) {
409
- const n = Q(e, "card"), o = Q(e, "semantic"), a = e.semanticTemporalPresentation;
410
- return Ae({
408
+ function ar(e, r, t = he) {
409
+ const n = ee(e, "card"), o = ee(e, "semantic"), a = e.semanticTemporalPresentation;
410
+ return Oe({
411
411
  metadata: r,
412
412
  ...n ? { cardFormat: n } : {},
413
413
  ...o && a ? {
@@ -423,9 +423,9 @@ function Wt(e, r, t = ue) {
423
423
  }
424
424
  });
425
425
  }
426
- function Yt(e, r = Mt, t = "en-US") {
426
+ function ir(e, r = jt, t = "en-US") {
427
427
  var i;
428
- const n = Q(e, "card"), o = ((i = e.semanticTemporalPresentation) == null ? void 0 : i.granularity) === e.granularity ? Q(e, "semantic") : void 0, a = n && n.presentation.mode !== "auto" ? n : o && o.presentation.mode !== "auto" ? o : {
428
+ const n = ee(e, "card"), o = ((i = e.semanticTemporalPresentation) == null ? void 0 : i.granularity) === e.granularity ? ee(e, "semantic") : void 0, a = n && n.presentation.mode !== "auto" ? n : o && o.presentation.mode !== "auto" ? o : {
429
429
  presentation: { mode: "auto" }
430
430
  };
431
431
  return a.presentation.mode === "auto" ? {
@@ -438,7 +438,7 @@ function Yt(e, r = Mt, t = "en-US") {
438
438
  presentation: a.presentation
439
439
  };
440
440
  }
441
- function Vn(e) {
441
+ function co(e) {
442
442
  const r = e.activation;
443
443
  if (!r)
444
444
  return {
@@ -456,17 +456,17 @@ function Vn(e) {
456
456
  (e.columns || []).map((c) => [c.key, c])
457
457
  ), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = r.fields.reduce((c, s) => (c.set(s.id, (c.get(s.id) || 0) + 1), c), /* @__PURE__ */ new Map()), l = (c, s) => {
458
458
  a.set(
459
- Me(c.id, c.role),
459
+ Ne(c.id, c.role),
460
460
  s
461
461
  ), i.get(c.id) === 1 && o.set(c.id, s);
462
- }, m = (c, s, u) => {
462
+ }, d = (c, s, u) => {
463
463
  if (s.granularity !== c.granularity)
464
- throw new N(
464
+ throw new L(
465
465
  "invalid_temporal_bucket_metadata",
466
466
  `Result identity "${u}" declares ${s.granularity} buckets for active ${c.granularity} field "${c.id}".`,
467
467
  { cardId: e.card.id, fieldId: c.id, columnKey: u }
468
468
  );
469
- const p = e.executionSnapshot && e.dashboardId ? mt({
469
+ const p = e.executionSnapshot && e.dashboardId ? Tt({
470
470
  snapshot: e.executionSnapshot,
471
471
  scope: {
472
472
  dashboardId: e.dashboardId,
@@ -480,7 +480,7 @@ function Vn(e) {
480
480
  }
481
481
  }) : void 0;
482
482
  if (e.executionSnapshot && !p)
483
- throw new Ut({
483
+ throw new rr({
484
484
  dashboardId: e.dashboardId,
485
485
  cardId: e.card.id,
486
486
  fieldId: c.id
@@ -490,22 +490,22 @@ function Vn(e) {
490
490
  fieldId: c.id,
491
491
  role: c.role,
492
492
  metadata: s,
493
- resolved: p ? Ae({
493
+ resolved: p ? Oe({
494
494
  metadata: s,
495
495
  cardFormat: p,
496
496
  locale: p.locale,
497
497
  ...p.presentation.mode === "auto" ? {
498
498
  styles: p.presentation.styles
499
499
  } : {}
500
- }) : Wt(
500
+ }) : ar(
501
501
  c,
502
502
  s,
503
- e.valueFormatPreferences ?? ue
503
+ e.valueFormatPreferences ?? he
504
504
  )
505
505
  };
506
506
  };
507
507
  for (const c of r.fields) {
508
- const s = L(
508
+ const s = V(
509
509
  e.columnKeyMap,
510
510
  c.id,
511
511
  c.role
@@ -513,106 +513,106 @@ function Vn(e) {
513
513
  if (!s) {
514
514
  if (e.columns === void 0 && e.columnKeyMap === void 0 && (e.resultRowCount === void 0 || e.resultRowCount === 0))
515
515
  continue;
516
- throw new N(
516
+ throw new L(
517
517
  "missing_temporal_column_binding",
518
518
  `Activated temporal field "${c.id}" has no authoritative result-column binding.`,
519
519
  { cardId: e.card.id, fieldId: c.id, columnKey: c.name }
520
520
  );
521
521
  }
522
522
  if (s.role === "pivotby") {
523
- const h = (e.columns || []).filter(
523
+ const y = (e.columns || []).filter(
524
524
  (E) => E.pivotIdentity !== void 0
525
- ), b = h.flatMap(
525
+ ), b = y.flatMap(
526
526
  (E) => {
527
527
  var _;
528
- return (((_ = E.pivotIdentity) == null ? void 0 : _.members) || []).filter((P) => P.fieldId === c.id).map((P) => ({ column: E, member: P }));
528
+ return (((_ = E.pivotIdentity) == null ? void 0 : _.members) || []).filter((M) => M.fieldId === c.id).map((M) => ({ column: E, member: M }));
529
529
  }
530
530
  );
531
531
  if (b.length === 0) {
532
- if (h.length === 0 && (e.card.type !== "pivotTable" || e.resultRowCount === 0))
532
+ if (y.length === 0 && (e.card.type !== "pivotTable" || e.resultRowCount === 0))
533
533
  continue;
534
- throw new te({
534
+ throw new ae({
535
535
  cardId: e.card.id,
536
536
  fieldId: c.id,
537
537
  columnKey: s.outputKey || s.rawKey
538
538
  });
539
539
  }
540
- const w = b[0];
541
- if (!w.member.temporalBucket)
542
- throw new te({
540
+ const C = b[0];
541
+ if (!C.member.temporalBucket)
542
+ throw new ae({
543
543
  cardId: e.card.id,
544
544
  fieldId: c.id,
545
- columnKey: w.column.key
545
+ columnKey: C.column.key
546
546
  });
547
- const g = Ft(
548
- w.member.temporalBucket
547
+ const v = zt(
548
+ C.member.temporalBucket
549
549
  );
550
- if (!g.ok || !g.value)
551
- throw new N(
550
+ if (!v.ok || !v.value)
551
+ throw new L(
552
552
  "invalid_temporal_bucket_metadata",
553
- g.ok ? `Pivot result column "${w.column.key}" has no validated temporal bucket metadata.` : g.error.message,
553
+ v.ok ? `Pivot result column "${C.column.key}" has no validated temporal bucket metadata.` : v.error.message,
554
554
  {
555
555
  cardId: e.card.id,
556
556
  fieldId: c.id,
557
- columnKey: w.column.key
557
+ columnKey: C.column.key
558
558
  }
559
559
  );
560
- const T = m(
560
+ const w = d(
561
561
  c,
562
- g.value,
563
- w.column.key
562
+ v.value,
563
+ C.column.key
564
564
  );
565
565
  for (const { column: E, member: _ } of b)
566
- if (!_.temporalBucket || JSON.stringify(_.temporalBucket) !== JSON.stringify(w.member.temporalBucket))
567
- throw new N(
566
+ if (!_.temporalBucket || JSON.stringify(_.temporalBucket) !== JSON.stringify(C.member.temporalBucket))
567
+ throw new L(
568
568
  "invalid_temporal_bucket_metadata",
569
569
  `Pivot result column "${E.key}" has contradictory bucket metadata for field "${c.id}".`,
570
570
  { cardId: e.card.id, fieldId: c.id, columnKey: E.key }
571
571
  );
572
- l(c, T);
572
+ l(c, w);
573
573
  continue;
574
574
  }
575
575
  const u = s.outputKey || s.rawKey, p = t.get(u);
576
576
  if (!(p != null && p.temporalBucket))
577
- throw new te({
577
+ throw new ae({
578
578
  cardId: e.card.id,
579
579
  fieldId: c.id,
580
580
  columnKey: u
581
581
  });
582
- const d = Rt(p, {
582
+ const m = qt(p, {
583
583
  metadataRequired: !0
584
584
  });
585
- if (!d.ok || !d.value)
586
- throw new N(
585
+ if (!m.ok || !m.value)
586
+ throw new L(
587
587
  "invalid_temporal_bucket_metadata",
588
- d.ok ? `Result column "${u}" has no validated temporal bucket metadata.` : d.error.message,
588
+ m.ok ? `Result column "${u}" has no validated temporal bucket metadata.` : m.error.message,
589
589
  { cardId: e.card.id, fieldId: c.id, columnKey: u }
590
590
  );
591
- const v = m(
591
+ const g = d(
592
592
  c,
593
- d.value,
593
+ m.value,
594
594
  u
595
595
  );
596
- n.set(u, v), l(c, v);
596
+ n.set(u, g), l(c, g);
597
597
  }
598
598
  return { byColumnKey: n, byFieldId: o, byFieldRole: a };
599
599
  }
600
- function qn(e) {
600
+ function lo(e) {
601
601
  var t, n;
602
- const r = e.role ? Gt({
602
+ const r = e.role ? nr({
603
603
  presentation: e.presentation,
604
604
  fieldId: e.fieldId,
605
605
  role: e.role
606
606
  }) : (n = (t = e.presentation) == null ? void 0 : t.byFieldId) == null ? void 0 : n.get(e.fieldId);
607
- return r ? Be({
607
+ return r ? Le({
608
608
  value: e.value,
609
609
  presentation: r
610
610
  }) : e.value === null || e.value === void 0 ? "" : String(e.value);
611
611
  }
612
- function Be(e) {
612
+ function Le(e) {
613
613
  if (e.value === null || e.value === void 0) return "(Blank)";
614
614
  if (typeof e.value != "string")
615
- throw new N(
615
+ throw new L(
616
616
  "invalid_temporal_bucket_value",
617
617
  `Canonical temporal column "${e.presentation.columnKey}" must contain a string or null.`,
618
618
  {
@@ -621,13 +621,13 @@ function Be(e) {
621
621
  }
622
622
  );
623
623
  try {
624
- return At({
624
+ return Vt({
625
625
  value: e.value,
626
626
  metadata: e.presentation.metadata,
627
627
  format: e.presentation.resolved.format
628
628
  });
629
629
  } catch (r) {
630
- throw r instanceof Pt ? new N(
630
+ throw r instanceof Ut ? new L(
631
631
  r.code,
632
632
  r.message,
633
633
  {
@@ -642,19 +642,19 @@ class S extends Error {
642
642
  super(`${r}: ${t}`), this.code = r, this.context = n, Object.setPrototypeOf(this, S.prototype), this.name = "RawTemporalPresentationBoundaryError";
643
643
  }
644
644
  }
645
- function De() {
645
+ function ze() {
646
646
  return { type: "raw_temporal", presentation: { mode: "auto" } };
647
647
  }
648
- function Zt(e) {
648
+ function cr(e) {
649
649
  if (e.locale || e.relative || e.timezone && e.timezone !== "auto" || e.sourceTimezone && e.sourceTimezone !== "auto" || e.prefix || e.suffix)
650
650
  throw new S(
651
651
  "invalid_raw_temporal_format",
652
652
  "Activated raw temporal presentation contains unsupported locale, relative-time, timezone, prefix, or suffix settings."
653
653
  );
654
654
  }
655
- function Oe(e) {
655
+ function qe(e) {
656
656
  const r = e.format;
657
- if ((r == null ? void 0 : r.type) === "date" && (Zt(r), r.pattern))
657
+ if ((r == null ? void 0 : r.type) === "date" && (cr(r), r.pattern))
658
658
  return {
659
659
  type: "raw_temporal",
660
660
  presentation: {
@@ -692,12 +692,12 @@ function Oe(e) {
692
692
  dialect: "semaphor_tokens",
693
693
  pattern: e.dateFormat
694
694
  }
695
- } : De();
695
+ } : ze();
696
696
  }
697
- function ye(e) {
697
+ function be(e) {
698
698
  var i;
699
699
  if (e != null && e.useRelativeTime) return;
700
- if (!e) return De();
700
+ if (!e) return ze();
701
701
  if (e.useCustomFormat && !((i = e.customFormat) != null && i.trim()))
702
702
  throw new S(
703
703
  "invalid_raw_temporal_format",
@@ -723,18 +723,18 @@ function ye(e) {
723
723
  presentation: { mode: "auto" }
724
724
  };
725
725
  }
726
- function jn(e) {
726
+ function so(e) {
727
727
  return e === "instant" ? "yyyy-MM-dd'T'HH:mm:ssXXX" : e === "wall_datetime" ? "yyyy-MM-dd'T'HH:mm:ss" : "yyyy-MM-dd";
728
728
  }
729
- function Un(e) {
730
- kt({
729
+ function mo(e) {
730
+ Ot({
731
731
  dialect: "date_fns",
732
732
  pattern: e.pattern,
733
733
  valueKind: e.valueKind
734
734
  });
735
735
  }
736
- function Qt(e) {
737
- const r = ye(e.settings);
736
+ function lr(e) {
737
+ const r = be(e.settings);
738
738
  if (!r)
739
739
  throw new S(
740
740
  "invalid_raw_temporal_format",
@@ -743,9 +743,9 @@ function Qt(e) {
743
743
  const t = e.valueKind ?? (r.presentation.mode === "pattern" ? "instant" : "date"), n = {
744
744
  kind: "raw_temporal",
745
745
  valueKind: t
746
- }, o = e.value ?? (t === "date" ? "2023-05-15" : t === "wall_datetime" ? "2023-05-15T14:30:45" : "2023-05-15T14:30:45Z"), a = J({
746
+ }, o = e.value ?? (t === "date" ? "2023-05-15" : t === "wall_datetime" ? "2023-05-15T14:30:45" : "2023-05-15T14:30:45Z"), a = re({
747
747
  metadata: n,
748
- format: G({
748
+ format: W({
749
749
  format: r,
750
750
  preferences: e.preferences,
751
751
  calendar: { tz: e.calendarTimezone }
@@ -758,9 +758,9 @@ function Qt(e) {
758
758
  );
759
759
  return a.text;
760
760
  }
761
- function Gn(e) {
761
+ function uo(e) {
762
762
  try {
763
- return { ok: !0, text: Qt(e) };
763
+ return { ok: !0, text: lr(e) };
764
764
  } catch (r) {
765
765
  return {
766
766
  ok: !1,
@@ -768,14 +768,14 @@ function Gn(e) {
768
768
  };
769
769
  }
770
770
  }
771
- function Ke(e) {
771
+ function Ve(e) {
772
772
  var t;
773
773
  const r = e.effectiveCardConfig ?? e.card.config;
774
- return X(e.card, r) === "freeform" && !!((t = e.card.sql) != null && t.trim()) && !W(e.card.python || "").trim();
774
+ return ne(e.card, r) === "freeform" && !!((t = e.card.sql) != null && t.trim()) && !Z(e.card.python || "").trim();
775
775
  }
776
- function Jt(e) {
776
+ function sr(e) {
777
777
  var r, t;
778
- return e.type !== "table" && e.type !== "detailTable" || !Ke({ card: e }) ? !1 : Object.values(
778
+ return e.type !== "table" && e.type !== "detailTable" || !Ve({ card: e }) ? !1 : Object.values(
779
779
  ((t = (r = e.preferences) == null ? void 0 : r.tablePrefs) == null ? void 0 : t.columnSettingsMap) || {}
780
780
  ).some(
781
781
  (n) => {
@@ -784,9 +784,9 @@ function Jt(e) {
784
784
  }
785
785
  );
786
786
  }
787
- function Hn(e) {
787
+ function fo(e) {
788
788
  var t, n, o;
789
- if (!Jt(e)) return e;
789
+ if (!sr(e)) return e;
790
790
  const r = ((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.columnSettingsMap) || {};
791
791
  return {
792
792
  ...e,
@@ -796,10 +796,10 @@ function Hn(e) {
796
796
  ...(o = e.preferences) == null ? void 0 : o.tablePrefs,
797
797
  columnSettingsMap: Object.fromEntries(
798
798
  Object.entries(r).map(([a, i]) => {
799
- var l, m, c;
799
+ var l, d, c;
800
800
  return [
801
801
  a,
802
- i.type === "date" && ((l = i.dateFormat) == null ? void 0 : l.useRelativeTime) !== !0 && ((m = i.dateFormat) == null ? void 0 : m.useCustomFormat) === !0 && !((c = i.dateFormat.customFormat) != null && c.trim()) ? {
802
+ i.type === "date" && ((l = i.dateFormat) == null ? void 0 : l.useRelativeTime) !== !0 && ((d = i.dateFormat) == null ? void 0 : d.useCustomFormat) === !0 && !((c = i.dateFormat.customFormat) != null && c.trim()) ? {
803
803
  ...i,
804
804
  dateFormat: {
805
805
  ...i.dateFormat,
@@ -815,17 +815,17 @@ function Hn(e) {
815
815
  }
816
816
  };
817
817
  }
818
- function Xt() {
818
+ function dr() {
819
819
  return {
820
820
  activatedColumnKeys: /* @__PURE__ */ new Set(),
821
821
  byColumnKey: /* @__PURE__ */ new Map(),
822
822
  byFieldId: /* @__PURE__ */ new Map()
823
823
  };
824
824
  }
825
- function le(e, r) {
825
+ function ue(e, r) {
826
826
  return e === void 0 ? { kind: "invalid", error: r } : {
827
827
  kind: "invalid",
828
- error: e instanceof S ? e : e instanceof $t ? new S(
828
+ error: e instanceof S ? e : e instanceof Bt ? new S(
829
829
  e.code,
830
830
  e.message,
831
831
  r.context
@@ -836,14 +836,14 @@ function le(e, r) {
836
836
  )
837
837
  };
838
838
  }
839
- function er(e) {
839
+ function mr(e) {
840
840
  var o;
841
841
  if (e.cardType !== "detailTable" || e.resultOwner !== "config")
842
842
  return { kind: "inactive" };
843
843
  if (!e.result) return { kind: "loading" };
844
844
  const { records: r, columns: t, columnKeyMap: n } = e.result;
845
845
  if (!Array.isArray(r) || !Array.isArray(t) || !n)
846
- return le(
846
+ return ue(
847
847
  void 0,
848
848
  new S(
849
849
  "missing_raw_temporal_result_contract",
@@ -858,13 +858,13 @@ function er(e) {
858
858
  s.id,
859
859
  s
860
860
  ])
861
- ), l = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
861
+ ), l = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
862
862
  for (const s of a) {
863
863
  const u = Array.from(i).flatMap(
864
- ([T, E]) => {
865
- const _ = L(
864
+ ([w, E]) => {
865
+ const _ = V(
866
866
  n,
867
- T,
867
+ w,
868
868
  "detail"
869
869
  );
870
870
  return _ && _.role === "detail" && (_.outputKey ?? _.rawKey) === s.key ? [{ field: E, binding: _ }] : [];
@@ -876,43 +876,43 @@ function er(e) {
876
876
  `Raw temporal result column "${s.key}" does not have one valid exact detail result binding.`,
877
877
  { columnKey: s.key }
878
878
  );
879
- const { field: d, binding: v } = p, h = v.outputKey ?? v.rawKey, b = Pe(s, {
879
+ const { field: m, binding: g } = p, y = g.outputKey ?? g.rawKey, b = Ke(s, {
880
880
  metadataRequired: !0
881
881
  });
882
882
  if (!b)
883
883
  throw new S(
884
884
  "invalid_raw_temporal_metadata",
885
- `Raw temporal result column "${h}" has no metadata.`,
886
- { fieldId: d.id, columnKey: h }
885
+ `Raw temporal result column "${y}" has no metadata.`,
886
+ { fieldId: m.id, columnKey: y }
887
887
  );
888
- const w = G({
889
- format: Oe(d),
888
+ const C = W({
889
+ format: qe(m),
890
890
  preferences: e.preferences,
891
891
  calendar: e.calendar
892
- }), g = {
893
- fieldId: d.id,
894
- columnKey: h,
892
+ }), v = {
893
+ fieldId: m.id,
894
+ columnKey: y,
895
895
  metadata: b,
896
- format: w,
897
- formatValue: J({ metadata: b, format: w })
896
+ format: C,
897
+ formatValue: re({ metadata: b, format: C })
898
898
  };
899
- for (let T = 0; T < r.length; T += 1)
900
- if (!Object.prototype.hasOwnProperty.call(r[T], h) || r[T][h] === void 0)
899
+ for (let w = 0; w < r.length; w += 1)
900
+ if (!Object.prototype.hasOwnProperty.call(r[w], y) || r[w][y] === void 0)
901
901
  throw new S(
902
902
  "missing_raw_temporal_result_contract",
903
- `Raw temporal result row ${T} is missing column "${h}".`,
904
- { fieldId: d.id, columnKey: h }
903
+ `Raw temporal result row ${w} is missing column "${y}".`,
904
+ { fieldId: m.id, columnKey: y }
905
905
  );
906
- l.set(h, g), m.set(d.id, g);
906
+ l.set(y, v), d.set(m.id, v);
907
907
  }
908
908
  const c = {
909
909
  activatedColumnKeys: new Set(l.keys()),
910
910
  byColumnKey: l,
911
- byFieldId: m
911
+ byFieldId: d
912
912
  };
913
913
  return r.length === 0 ? { kind: "loaded_empty", presentation: c } : { kind: "loaded_valid", presentation: c };
914
914
  } catch (a) {
915
- return le(
915
+ return ue(
916
916
  a,
917
917
  new S(
918
918
  "invalid_raw_temporal_metadata",
@@ -921,9 +921,9 @@ function er(e) {
921
921
  );
922
922
  }
923
923
  }
924
- function tr(e) {
924
+ function ur(e) {
925
925
  var n, o, a;
926
- const r = e.effectiveCardConfig ?? e.card.config, t = X(
926
+ const r = e.effectiveCardConfig ?? e.card.config, t = ne(
927
927
  e.card,
928
928
  r
929
929
  );
@@ -935,8 +935,8 @@ function tr(e) {
935
935
  "missing_raw_temporal_result_contract",
936
936
  "Activated raw temporal detail results require records, columns, and columnKeyMap atomically."
937
937
  )
938
- } : e.records !== void 0 && !i ? { kind: "inactive" } : Ce(
939
- er({
938
+ } : e.records !== void 0 && !i ? { kind: "inactive" } : ke(
939
+ mr({
940
940
  cardType: e.card.type,
941
941
  resultOwner: t,
942
942
  effectiveCardConfig: r,
@@ -951,11 +951,11 @@ function tr(e) {
951
951
  e
952
952
  );
953
953
  }
954
- return Ce(
955
- rr({
954
+ return ke(
955
+ fr({
956
956
  resultOwner: t,
957
957
  sql: e.card.sql,
958
- normalizedPython: W(
958
+ normalizedPython: Z(
959
959
  e.card.python || ""
960
960
  ),
961
961
  records: e.records,
@@ -967,13 +967,13 @@ function tr(e) {
967
967
  e
968
968
  );
969
969
  }
970
- function Wn(e) {
970
+ function po(e) {
971
971
  var n, o, a;
972
- const r = e.effectiveCardConfig ?? e.card.config, t = X(
972
+ const r = e.effectiveCardConfig ?? e.card.config, t = ne(
973
973
  e.card,
974
974
  r
975
975
  );
976
- return e.card.type === "detailTable" && t === "config" ? !!((n = e.columns) != null && n.some((i) => i.rawTemporal)) : Ke(e) ? Object.values(
976
+ return e.card.type === "detailTable" && t === "config" ? !!((n = e.columns) != null && n.some((i) => i.rawTemporal)) : Ve(e) ? Object.values(
977
977
  ((a = (o = e.card.preferences) == null ? void 0 : o.tablePrefs) == null ? void 0 : a.columnSettingsMap) || {}
978
978
  ).some(
979
979
  (i) => {
@@ -982,7 +982,7 @@ function Wn(e) {
982
982
  }
983
983
  ) : !1;
984
984
  }
985
- function Ce(e, r) {
985
+ function ke(e, r) {
986
986
  if (!r.executionSnapshot || e.kind === "inactive" || e.kind === "loading" || e.kind === "invalid")
987
987
  return e;
988
988
  if (!r.dashboardId)
@@ -995,7 +995,7 @@ function Ce(e, r) {
995
995
  };
996
996
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
997
997
  for (const o of e.presentation.activatedColumnKeys) {
998
- const a = ft({
998
+ const a = $t({
999
999
  snapshot: r.executionSnapshot,
1000
1000
  scope: {
1001
1001
  dashboardId: r.dashboardId,
@@ -1007,14 +1007,14 @@ function Ce(e, r) {
1007
1007
  if (!a)
1008
1008
  return {
1009
1009
  kind: "invalid",
1010
- error: new pt(o)
1010
+ error: new xt(o)
1011
1011
  };
1012
1012
  const i = e.presentation.byColumnKey.get(o);
1013
1013
  if (!i) continue;
1014
1014
  const l = {
1015
1015
  ...i,
1016
1016
  format: a,
1017
- formatValue: J({
1017
+ formatValue: re({
1018
1018
  metadata: i.metadata,
1019
1019
  format: a
1020
1020
  })
@@ -1030,7 +1030,7 @@ function Ce(e, r) {
1030
1030
  }
1031
1031
  };
1032
1032
  }
1033
- function rr(e) {
1033
+ function fr(e) {
1034
1034
  var t, n;
1035
1035
  if (e.resultOwner !== "freeform" || !((t = e.sql) != null && t.trim()) || (n = e.normalizedPython) != null && n.trim())
1036
1036
  return { kind: "inactive" };
@@ -1049,11 +1049,11 @@ function rr(e) {
1049
1049
  r.map(([c]) => c)
1050
1050
  ), i = /* @__PURE__ */ new Map(), l = [...e.columns || []];
1051
1051
  for (const [c, s] of r) {
1052
- const u = ye(
1052
+ const u = be(
1053
1053
  s.dateFormat
1054
1054
  );
1055
1055
  if (!u) continue;
1056
- const p = xt({
1056
+ const p = Pt({
1057
1057
  columnKey: c,
1058
1058
  values: e.records.map((b) => {
1059
1059
  if (!Object.prototype.hasOwnProperty.call(b, c))
@@ -1062,37 +1062,37 @@ function rr(e) {
1062
1062
  `Declared SQL temporal column "${c}" is absent from a physical result row.`,
1063
1063
  { columnKey: c }
1064
1064
  );
1065
- const w = b[c];
1066
- return w === null || typeof w == "string" ? w : String(w);
1065
+ const C = b[c];
1066
+ return C === null || typeof C == "string" ? C : String(C);
1067
1067
  })
1068
1068
  });
1069
1069
  if (i.set(c, p), p.status !== "classified") continue;
1070
- let d = l.findIndex(
1070
+ let m = l.findIndex(
1071
1071
  (b) => b.key === c
1072
1072
  );
1073
- if (e.columns && d < 0)
1073
+ if (e.columns && m < 0)
1074
1074
  throw new S(
1075
1075
  "missing_raw_temporal_result_contract",
1076
1076
  `Classified SQL temporal column "${c}" is absent from result columns.`,
1077
1077
  { columnKey: c }
1078
1078
  );
1079
- d < 0 && (d = l.length, l.push({
1079
+ m < 0 && (m = l.length, l.push({
1080
1080
  key: c,
1081
1081
  name: c,
1082
1082
  label: c,
1083
1083
  role: "dimension",
1084
1084
  dataType: "string"
1085
1085
  }));
1086
- const v = {
1087
- ...l[d],
1086
+ const g = {
1087
+ ...l[m],
1088
1088
  role: "date",
1089
1089
  dataType: p.metadata.valueKind === "date" ? "date" : "datetime",
1090
1090
  rawTemporal: p.metadata
1091
1091
  };
1092
- Pe(v, {
1092
+ Ke(g, {
1093
1093
  metadataRequired: !0
1094
- }), l[d] = v;
1095
- const h = G({
1094
+ }), l[m] = g;
1095
+ const y = W({
1096
1096
  format: u,
1097
1097
  preferences: e.preferences,
1098
1098
  calendar: e.calendar
@@ -1100,31 +1100,31 @@ function rr(e) {
1100
1100
  o.set(c, {
1101
1101
  columnKey: c,
1102
1102
  metadata: p.metadata,
1103
- format: h,
1104
- formatValue: J({
1103
+ format: y,
1104
+ formatValue: re({
1105
1105
  metadata: p.metadata,
1106
- format: h
1106
+ format: y
1107
1107
  })
1108
1108
  });
1109
1109
  }
1110
- const m = {
1111
- ...Xt(),
1110
+ const d = {
1111
+ ...dr(),
1112
1112
  activatedColumnKeys: a,
1113
1113
  byColumnKey: o
1114
1114
  };
1115
1115
  return e.records.length === 0 ? {
1116
1116
  kind: "loaded_empty",
1117
- presentation: m,
1117
+ presentation: d,
1118
1118
  adaptedColumns: l,
1119
1119
  sqlClassifications: i
1120
1120
  } : {
1121
1121
  kind: "loaded_valid",
1122
- presentation: m,
1122
+ presentation: d,
1123
1123
  adaptedColumns: l,
1124
1124
  sqlClassifications: i
1125
1125
  };
1126
1126
  } catch (o) {
1127
- return le(
1127
+ return ue(
1128
1128
  o,
1129
1129
  new S(
1130
1130
  "invalid_raw_temporal_format",
@@ -1133,7 +1133,7 @@ function rr(e) {
1133
1133
  );
1134
1134
  }
1135
1135
  }
1136
- function Yn(e) {
1136
+ function yo(e) {
1137
1137
  if (e.value !== null && typeof e.value != "string")
1138
1138
  return {
1139
1139
  value: e.value,
@@ -1150,51 +1150,51 @@ function Yn(e) {
1150
1150
  const r = e.presentation.formatValue(e.value);
1151
1151
  return { value: e.value, label: r.text, result: r };
1152
1152
  }
1153
- function Zn(e) {
1153
+ function ho(e) {
1154
1154
  if (!e.result || typeof e.result != "object") return !1;
1155
1155
  const r = e.result;
1156
1156
  if (e.expectedResultOwner !== void 0 && r.resultOwner !== e.expectedResultOwner || !Array.isArray(r.records)) return !1;
1157
- const t = tr({
1157
+ const t = ur({
1158
1158
  card: e.card,
1159
1159
  effectiveCardConfig: e.effectiveCardConfig,
1160
1160
  records: r.records,
1161
1161
  columns: r.columns,
1162
1162
  columnKeyMap: r.columnKeyMap,
1163
- preferences: ue,
1163
+ preferences: he,
1164
1164
  calendar: { tz: "UTC" }
1165
1165
  });
1166
1166
  return t.kind === "inactive" || t.kind === "loaded_empty" || t.kind === "loaded_valid";
1167
1167
  }
1168
- function Te(e) {
1168
+ function Ee(e) {
1169
1169
  return !e || typeof e != "object" ? !1 : Array.isArray(e.cards);
1170
1170
  }
1171
- function nr(e) {
1171
+ function pr(e) {
1172
1172
  if (!e)
1173
1173
  return null;
1174
1174
  if (typeof e == "string")
1175
1175
  try {
1176
1176
  const r = JSON.parse(e);
1177
- return Te(r) ? r : null;
1177
+ return Ee(r) ? r : null;
1178
1178
  } catch {
1179
1179
  return null;
1180
1180
  }
1181
- return Te(e) ? e : null;
1181
+ return Ee(e) ? e : null;
1182
1182
  }
1183
- function Ne(e) {
1183
+ function Ue(e) {
1184
1184
  var r;
1185
1185
  return (r = e == null ? void 0 : e.cards) != null && r.length ? e.activeCardId && e.cards.find((t) => t.id === e.activeCardId) || e.cards[0] : null;
1186
1186
  }
1187
- function Qn(e) {
1187
+ function go(e) {
1188
1188
  var t;
1189
1189
  const r = (e == null ? void 0 : e.frameObject) ?? ((t = e == null ? void 0 : e.visual) == null ? void 0 : t.frameObject);
1190
- return Ne(nr(r));
1190
+ return Ue(pr(r));
1191
1191
  }
1192
- function he(e) {
1192
+ function Ie(e) {
1193
1193
  if (!(e != null && e.expectedType)) return "table";
1194
1194
  const r = Array.isArray(e.expectedType) ? e.expectedType[0] : e.expectedType;
1195
- return ar(r) ? r : "table";
1195
+ return hr(r) ? r : "table";
1196
1196
  }
1197
- const or = [
1197
+ const yr = [
1198
1198
  "bar",
1199
1199
  "horizontalBar",
1200
1200
  "line",
@@ -1225,10 +1225,10 @@ const or = [
1225
1225
  "treemap",
1226
1226
  "custom"
1227
1227
  ];
1228
- function ar(e) {
1229
- return or.includes(e);
1228
+ function hr(e) {
1229
+ return yr.includes(e);
1230
1230
  }
1231
- function H(e) {
1231
+ function Y(e) {
1232
1232
  const r = e.position;
1233
1233
  if (typeof r == "number") return r;
1234
1234
  if (typeof r == "string") {
@@ -1240,7 +1240,7 @@ function H(e) {
1240
1240
  }
1241
1241
  return Number.POSITIVE_INFINITY;
1242
1242
  }
1243
- function U(e) {
1243
+ function H(e) {
1244
1244
  if (typeof e == "number")
1245
1245
  return { kind: "number", start: e, end: e };
1246
1246
  if (typeof e == "string") {
@@ -1260,63 +1260,63 @@ function U(e) {
1260
1260
  }
1261
1261
  return null;
1262
1262
  }
1263
- function ze(e) {
1263
+ function je(e) {
1264
1264
  return !e || e.length === 0 ? void 0 : [...e].sort(
1265
- (t, n) => H(t) - H(n)
1265
+ (t, n) => Y(t) - Y(n)
1266
1266
  )[0];
1267
1267
  }
1268
- function Le(e, r) {
1268
+ function Ge(e, r) {
1269
1269
  if (!e || e.length === 0) return;
1270
1270
  const t = [], n = [], o = [];
1271
1271
  e.forEach((s) => {
1272
- const u = U(s.position);
1272
+ const u = H(s.position);
1273
1273
  u && (u.kind === "number" ? t.push(s) : u.kind === "range" ? n.push(s) : u.kind === "dynamic" && o.push(s));
1274
1274
  });
1275
1275
  const a = t.find((s) => {
1276
- const u = U(s.position);
1276
+ const u = H(s.position);
1277
1277
  return (u == null ? void 0 : u.kind) === "number" && u.start === r;
1278
1278
  });
1279
1279
  if (a) return a;
1280
1280
  const l = n.sort(
1281
- (s, u) => H(s) - H(u)
1281
+ (s, u) => Y(s) - Y(u)
1282
1282
  ).find((s) => {
1283
- const u = U(s.position);
1283
+ const u = H(s.position);
1284
1284
  return (u == null ? void 0 : u.kind) === "range" && r >= u.start && r <= u.end;
1285
1285
  });
1286
1286
  if (l) return l;
1287
1287
  const c = o.map((s) => ({
1288
1288
  slot: s,
1289
- parsed: U(s.position)
1289
+ parsed: H(s.position)
1290
1290
  })).filter((s) => {
1291
1291
  var u;
1292
1292
  return ((u = s.parsed) == null ? void 0 : u.kind) === "dynamic";
1293
1293
  }).sort(
1294
1294
  (s, u) => {
1295
- var p, d;
1296
- return (((p = s.parsed) == null ? void 0 : p.start) ?? 0) - (((d = u.parsed) == null ? void 0 : d.start) ?? 0);
1295
+ var p, m;
1296
+ return (((p = s.parsed) == null ? void 0 : p.start) ?? 0) - (((m = u.parsed) == null ? void 0 : m.start) ?? 0);
1297
1297
  }
1298
1298
  ).filter((s) => {
1299
1299
  var u;
1300
1300
  return r >= (((u = s.parsed) == null ? void 0 : u.start) ?? 0);
1301
1301
  }).sort(
1302
1302
  (s, u) => {
1303
- var p, d;
1304
- return (((p = u.parsed) == null ? void 0 : p.start) ?? 0) - (((d = s.parsed) == null ? void 0 : d.start) ?? 0);
1303
+ var p, m;
1304
+ return (((p = u.parsed) == null ? void 0 : p.start) ?? 0) - (((m = s.parsed) == null ? void 0 : m.start) ?? 0);
1305
1305
  }
1306
1306
  )[0];
1307
1307
  return c == null ? void 0 : c.slot;
1308
1308
  }
1309
- function ir(e, r) {
1310
- const t = Le(e, r);
1309
+ function gr(e, r) {
1310
+ const t = Ge(e, r);
1311
1311
  if (t)
1312
- return he(t);
1312
+ return Ie(t);
1313
1313
  }
1314
- function cr(e, r) {
1314
+ function vr(e, r) {
1315
1315
  var n;
1316
1316
  const t = (n = e == null ? void 0 : e.customCardPreferences) == null ? void 0 : n.slotIndex;
1317
1317
  return typeof t == "number" ? t : r;
1318
1318
  }
1319
- function xe(e, r) {
1319
+ function Se(e, r) {
1320
1320
  var t;
1321
1321
  if (!((t = e == null ? void 0 : e.customCardPreferences) != null && t.url))
1322
1322
  return !1;
@@ -1334,18 +1334,18 @@ function xe(e, r) {
1334
1334
  }
1335
1335
  return !1;
1336
1336
  }
1337
- function lr(e) {
1337
+ function br(e) {
1338
1338
  const r = [];
1339
1339
  let t = -1;
1340
1340
  e.forEach((n, o) => {
1341
- const a = cr(n, o);
1341
+ const a = vr(n, o);
1342
1342
  a > t && (t = a), r[a] = n ?? null;
1343
1343
  });
1344
1344
  for (let n = 0; n <= t; n += 1)
1345
1345
  n in r || (r[n] = null);
1346
1346
  return r;
1347
1347
  }
1348
- function Jn(e) {
1348
+ function vo(e) {
1349
1349
  return e.map((r, t) => !r.customCardPreferences || r.customCardPreferences.slotIndex === t ? r : {
1350
1350
  ...r,
1351
1351
  customCardPreferences: {
@@ -1354,18 +1354,18 @@ function Jn(e) {
1354
1354
  }
1355
1355
  });
1356
1356
  }
1357
- function Xn(e) {
1358
- const r = ze(e);
1357
+ function bo(e) {
1358
+ const r = je(e);
1359
1359
  if (r)
1360
- return he(r);
1360
+ return Ie(r);
1361
1361
  }
1362
- function eo(e, r, t) {
1362
+ function Io(e, r, t) {
1363
1363
  if (!e) return;
1364
- const n = ir(t, r);
1364
+ const n = gr(t, r);
1365
1365
  return e.type === "custom" && n ? n : e.type;
1366
1366
  }
1367
- function to(e, r, t) {
1368
- var v;
1367
+ function Co(e, r, t) {
1368
+ var g;
1369
1369
  const n = {
1370
1370
  dataSource: t.dataSource,
1371
1371
  connectionId: t.connectionId,
@@ -1383,62 +1383,62 @@ function to(e, r, t) {
1383
1383
  pluginChartType: r.chartType,
1384
1384
  minInputs: r.minInputs,
1385
1385
  maxInputs: r.maxInputs
1386
- }, a = r.minInputs || 1, l = e.map((h) => ({ slot: h, parsed: U(h.position) })).filter((h) => h.parsed !== null).reduce((h, b) => {
1387
- const w = b.parsed.end;
1388
- return Number.isFinite(w) ? Math.max(h, w) : h;
1389
- }, -1), m = Math.max(a, l + 1), c = ze(e), s = c ? H(c) : 0;
1386
+ }, a = r.minInputs || 1, l = e.map((y) => ({ slot: y, parsed: H(y.position) })).filter((y) => y.parsed !== null).reduce((y, b) => {
1387
+ const C = b.parsed.end;
1388
+ return Number.isFinite(C) ? Math.max(y, C) : y;
1389
+ }, -1), d = Math.max(a, l + 1), c = je(e), s = c ? Y(c) : 0;
1390
1390
  let u = !1;
1391
1391
  const p = [];
1392
- for (let h = 0; h < m; h += 1) {
1393
- const b = Le(e, h), w = he(b), g = !u && h === s, T = h, E = {
1392
+ for (let y = 0; y < d; y += 1) {
1393
+ const b = Ge(e, y), C = Ie(b), v = !u && y === s, w = y, E = {
1394
1394
  ...n,
1395
- id: vt(),
1396
- title: (g ? c == null ? void 0 : c.label : b == null ? void 0 : b.label) || `Tab ${h + 1}`,
1397
- tabTitle: (g ? c == null ? void 0 : c.label : b == null ? void 0 : b.label) || `Tab ${h + 1}`,
1398
- description: (g ? c == null ? void 0 : c.description : b == null ? void 0 : b.description) || "",
1399
- type: w,
1395
+ id: _t(),
1396
+ title: (v ? c == null ? void 0 : c.label : b == null ? void 0 : b.label) || `Tab ${y + 1}`,
1397
+ tabTitle: (v ? c == null ? void 0 : c.label : b == null ? void 0 : b.label) || `Tab ${y + 1}`,
1398
+ description: (v ? c == null ? void 0 : c.description : b == null ? void 0 : b.description) || "",
1399
+ type: C,
1400
1400
  sql: "",
1401
1401
  preferences: {
1402
1402
  onClickFilter: [{ columnIndex: 0, expression: "" }]
1403
1403
  },
1404
- ...g && {
1404
+ ...v && {
1405
1405
  customCardPreferences: {
1406
1406
  ...o,
1407
- slotIndex: T
1407
+ slotIndex: w
1408
1408
  }
1409
1409
  },
1410
- ...!g && {
1410
+ ...!v && {
1411
1411
  customCardPreferences: {
1412
- slotIndex: T
1412
+ slotIndex: w
1413
1413
  }
1414
1414
  }
1415
1415
  };
1416
- g && (u = !0), p.push(E);
1416
+ v && (u = !0), p.push(E);
1417
1417
  }
1418
1418
  if (!u && p.length > 0) {
1419
- const h = ((v = p[0].customCardPreferences) == null ? void 0 : v.slotIndex) ?? 0;
1419
+ const y = ((g = p[0].customCardPreferences) == null ? void 0 : g.slotIndex) ?? 0;
1420
1420
  p[0] = {
1421
1421
  ...p[0],
1422
1422
  type: p[0].type,
1423
1423
  customCardPreferences: {
1424
1424
  ...o,
1425
- slotIndex: h
1425
+ slotIndex: y
1426
1426
  }
1427
1427
  };
1428
1428
  }
1429
- const d = p.findIndex(
1430
- (h) => {
1429
+ const m = p.findIndex(
1430
+ (y) => {
1431
1431
  var b;
1432
- return !!((b = h.customCardPreferences) != null && b.url);
1432
+ return !!((b = y.customCardPreferences) != null && b.url);
1433
1433
  }
1434
1434
  );
1435
- if (d > 0) {
1436
- const [h] = p.splice(d, 1);
1437
- p.unshift(h);
1435
+ if (m > 0) {
1436
+ const [y] = p.splice(m, 1);
1437
+ p.unshift(y);
1438
1438
  }
1439
1439
  return p;
1440
1440
  }
1441
- function dr({
1441
+ function Ir({
1442
1442
  frame: e,
1443
1443
  configCard: r,
1444
1444
  isMultiInputVisual: t
@@ -1450,13 +1450,13 @@ function dr({
1450
1450
  return n ? Object.keys(n).sort((a, i) => Number(a) - Number(i)).map((a) => {
1451
1451
  var l;
1452
1452
  const i = (l = n[a]) == null ? void 0 : l.cardId;
1453
- return e.cards.find((m) => m.id === i) || null;
1453
+ return e.cards.find((d) => d.id === i) || null;
1454
1454
  }) : e.cards;
1455
1455
  }
1456
- function sr(e, r) {
1457
- return r && xe(r, e.cards) ? r : e.cards.find((t) => xe(t, e.cards)) || null;
1456
+ function Cr(e, r) {
1457
+ return r && Se(r, e.cards) ? r : e.cards.find((t) => Se(t, e.cards)) || null;
1458
1458
  }
1459
- function mr(e, r) {
1459
+ function Tr(e, r) {
1460
1460
  var o, a;
1461
1461
  if (!e) return null;
1462
1462
  const t = r == null ? void 0 : r.visualType;
@@ -1466,13 +1466,13 @@ function mr(e, r) {
1466
1466
  const n = (o = e.customCardPreferences) == null ? void 0 : o.visualType;
1467
1467
  return n || ((a = e.customCardPreferences) != null && a.dataInputCardIds ? "multiple" : null);
1468
1468
  }
1469
- function ro(e) {
1469
+ function To(e) {
1470
1470
  return e.visualType === "multiple" || e.slots && e.slots.length > 0 || (e.minInputs || 0) > 1 || (e.maxInputs || 0) > 1 || (e.dataInputs || []).length > 1 ? "multiple" : "single";
1471
1471
  }
1472
- function no(e) {
1472
+ function wo(e) {
1473
1473
  return Array.isArray(e) ? { records: e } : e;
1474
1474
  }
1475
- class Y extends Error {
1475
+ class Q extends Error {
1476
1476
  constructor(t) {
1477
1477
  const n = t.cardId ? `card "${t.cardId}"` : t.sheetId ? `sheet "${t.sheetId}"` : `dashboard "${t.dashboardId}"`;
1478
1478
  super(
@@ -1483,28 +1483,28 @@ class Y extends Error {
1483
1483
  this.name = "TemporalSnapshotSelectionError", this.selection = t;
1484
1484
  }
1485
1485
  }
1486
- function ur(e, r) {
1486
+ function wr(e, r) {
1487
1487
  var o;
1488
1488
  const t = [], n = /* @__PURE__ */ new Map();
1489
1489
  for (const a of r) {
1490
1490
  if (a.dashboardId !== e.id)
1491
- throw new Y(a);
1491
+ throw new Q(a);
1492
1492
  const i = (e.sheets || []).filter(
1493
- (m) => !a.sheetId || a.sheetId === m.id
1493
+ (d) => !a.sheetId || a.sheetId === d.id
1494
1494
  );
1495
1495
  if (a.sheetId && i.length === 0)
1496
- throw new Y(a);
1496
+ throw new Q(a);
1497
1497
  let l = !a.cardId;
1498
- for (const m of i) {
1499
- const c = (((o = m.document) == null ? void 0 : o.sections) || []).flatMap(
1500
- (p) => Tt(p)
1501
- ), s = (m.frames || []).flatMap(
1502
- (p) => fr(p, a.cardId)
1498
+ for (const d of i) {
1499
+ const c = (((o = d.document) == null ? void 0 : o.sections) || []).flatMap(
1500
+ (p) => Mt(p)
1501
+ ), s = (d.frames || []).flatMap(
1502
+ (p) => $r(p, a.cardId)
1503
1503
  );
1504
1504
  s.length > 0 && (l = !0);
1505
1505
  const u = [
1506
1506
  ...s,
1507
- ...(m.cards || []).filter(
1507
+ ...(d.cards || []).filter(
1508
1508
  (p) => !a.cardId || a.cardId === p.id
1509
1509
  ),
1510
1510
  ...c.filter(
@@ -1513,124 +1513,124 @@ function ur(e, r) {
1513
1513
  ];
1514
1514
  for (const p of u) {
1515
1515
  l = !0;
1516
- const d = n.get(a.attachmentIndex) ?? /* @__PURE__ */ new Set();
1517
- d.has(p.id) || (d.add(p.id), n.set(a.attachmentIndex, d), t.push({
1516
+ const m = n.get(a.attachmentIndex) ?? /* @__PURE__ */ new Set();
1517
+ m.has(p.id) || (m.add(p.id), n.set(a.attachmentIndex, m), t.push({
1518
1518
  card: p,
1519
1519
  ...a.attachmentIndex !== void 0 ? { attachmentIndex: a.attachmentIndex } : {}
1520
1520
  }));
1521
1521
  }
1522
1522
  }
1523
1523
  if (!l)
1524
- throw new Y(a);
1524
+ throw new Q(a);
1525
1525
  }
1526
1526
  return t;
1527
1527
  }
1528
- function fr(e, r) {
1528
+ function $r(e, r) {
1529
1529
  var i;
1530
- const t = r ? (i = e.cards) == null ? void 0 : i.find((l) => l.id === r) : Ne(e);
1530
+ const t = r ? (i = e.cards) == null ? void 0 : i.find((l) => l.id === r) : Ue(e);
1531
1531
  if (!t) return [];
1532
- const n = sr(e, t), o = (e.cards || []).filter(
1532
+ const n = Cr(e, t), o = (e.cards || []).filter(
1533
1533
  (l) => {
1534
- var m;
1535
- return typeof ((m = l.customCardPreferences) == null ? void 0 : m.slotIndex) == "number";
1534
+ var d;
1535
+ return typeof ((d = l.customCardPreferences) == null ? void 0 : d.slotIndex) == "number";
1536
1536
  }
1537
- ).length > 1, a = n != null && (mr(n) === "multiple" || o);
1538
- return !n || !a ? [t] : lr(
1539
- dr({
1537
+ ).length > 1, a = n != null && (Tr(n) === "multiple" || o);
1538
+ return !n || !a ? [t] : br(
1539
+ Ir({
1540
1540
  frame: e,
1541
1541
  configCard: n,
1542
1542
  isMultiInputVisual: !0
1543
1543
  })
1544
1544
  ).filter((l) => l !== null);
1545
1545
  }
1546
- function oo(e) {
1547
- return ur(e.dashboard, e.selections).flatMap(
1546
+ function $o(e) {
1547
+ return wr(e.dashboard, e.selections).flatMap(
1548
1548
  ({ card: r, attachmentIndex: t }) => {
1549
- var s, u, p, d;
1550
- const n = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, r)) ?? r.config, o = Vt({
1549
+ var s, u, p, m;
1550
+ const n = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, r)) ?? r.config, o = Jt({
1551
1551
  card: r,
1552
1552
  cardConfig: n
1553
1553
  }), a = {
1554
1554
  dashboardId: e.dashboard.id,
1555
1555
  cardId: r.id,
1556
1556
  ...t !== void 0 ? { attachmentIndex: t } : {}
1557
- }, i = o ? o.fields.map((v) => ({
1557
+ }, i = o ? o.fields.map((g) => ({
1558
1558
  scope: a,
1559
1559
  target: {
1560
1560
  kind: "field",
1561
- fieldId: v.id,
1562
- role: v.role
1561
+ fieldId: g.id,
1562
+ role: g.role
1563
1563
  },
1564
- format: Yt(
1565
- v,
1564
+ format: ir(
1565
+ g,
1566
1566
  {
1567
1567
  dateStyle: e.valueFormatPreferences.dateStyle,
1568
1568
  dateTime: { ...e.valueFormatPreferences.dateTime }
1569
1569
  },
1570
1570
  e.valueFormatPreferences.locale
1571
1571
  )
1572
- })) : [], l = [], m = X(r, n), c = W(
1572
+ })) : [], l = [], d = ne(r, n), c = Z(
1573
1573
  r.python || ""
1574
1574
  );
1575
- if (r.type === "detailTable" && m === "config") {
1576
- const v = (n == null ? void 0 : n.detailColumns) || [], h = [
1577
- ...((n == null ? void 0 : n.groupByColumns) || []).map((g) => ({
1578
- field: g,
1575
+ if (r.type === "detailTable" && d === "config") {
1576
+ const g = (n == null ? void 0 : n.detailColumns) || [], y = [
1577
+ ...((n == null ? void 0 : n.groupByColumns) || []).map((v) => ({
1578
+ field: v,
1579
1579
  role: "groupby"
1580
1580
  })),
1581
- ...((n == null ? void 0 : n.metricColumns) || []).map((g) => ({
1582
- field: g,
1581
+ ...((n == null ? void 0 : n.metricColumns) || []).map((v) => ({
1582
+ field: v,
1583
1583
  role: "metric"
1584
1584
  })),
1585
- ...((n == null ? void 0 : n.pivotByColumns) || []).map((g) => ({
1586
- field: g,
1585
+ ...((n == null ? void 0 : n.pivotByColumns) || []).map((v) => ({
1586
+ field: v,
1587
1587
  role: "pivotby"
1588
1588
  })),
1589
- ...v.map((g) => ({
1590
- field: g,
1589
+ ...g.map((v) => ({
1590
+ field: v,
1591
1591
  role: "detail"
1592
1592
  }))
1593
- ], b = /* @__PURE__ */ new Map(), w = new Set(
1594
- h.map(
1595
- ({ field: g, role: T }) => Bt(g, T)
1593
+ ], b = /* @__PURE__ */ new Map(), C = new Set(
1594
+ y.map(
1595
+ ({ field: v, role: w }) => Gt(v, w)
1596
1596
  )
1597
1597
  );
1598
- for (const { field: g } of h) {
1599
- const T = g.label;
1600
- T && b.set(T, (b.get(T) || 0) + 1);
1598
+ for (const { field: v } of y) {
1599
+ const w = v.label;
1600
+ w && b.set(w, (b.get(w) || 0) + 1);
1601
1601
  }
1602
- for (const g of v) {
1603
- const T = Ee(g.dataType);
1604
- if (T !== "date" && T !== "datetime") continue;
1605
- const E = Dt(g), _ = g.label, P = Ot({
1602
+ for (const v of g) {
1603
+ const w = Ae(v.dataType);
1604
+ if (w !== "date" && w !== "datetime") continue;
1605
+ const E = Ht(v), _ = v.label, M = Wt({
1606
1606
  label: _,
1607
1607
  labelCount: _ && b.get(_) || 0,
1608
1608
  rawKey: E,
1609
- rawKeys: w
1609
+ rawKeys: C
1610
1610
  });
1611
- if (!P) throw new Y(a);
1611
+ if (!M) throw new Q(a);
1612
1612
  l.push({
1613
1613
  scope: a,
1614
- target: { kind: "column", columnKey: P },
1615
- format: G({
1616
- format: Oe(g),
1614
+ target: { kind: "column", columnKey: M },
1615
+ format: W({
1616
+ format: qe(v),
1617
1617
  preferences: e.valueFormatPreferences,
1618
1618
  calendar: e.calendar
1619
1619
  })
1620
1620
  });
1621
1621
  }
1622
- } else if (m === "freeform" && ((u = r.sql) != null && u.trim()) && !c.trim())
1623
- for (const [v, h] of Object.entries(
1624
- ((d = (p = r.preferences) == null ? void 0 : p.tablePrefs) == null ? void 0 : d.columnSettingsMap) || {}
1622
+ } else if (d === "freeform" && ((u = r.sql) != null && u.trim()) && !c.trim())
1623
+ for (const [g, y] of Object.entries(
1624
+ ((m = (p = r.preferences) == null ? void 0 : p.tablePrefs) == null ? void 0 : m.columnSettingsMap) || {}
1625
1625
  )) {
1626
- if (h.type !== "date") continue;
1627
- const b = ye(
1628
- h.dateFormat
1626
+ if (y.type !== "date") continue;
1627
+ const b = be(
1628
+ y.dateFormat
1629
1629
  );
1630
1630
  b && l.push({
1631
1631
  scope: a,
1632
- target: { kind: "column", columnKey: v },
1633
- format: G({
1632
+ target: { kind: "column", columnKey: g },
1633
+ format: W({
1634
1634
  format: b,
1635
1635
  preferences: e.valueFormatPreferences,
1636
1636
  calendar: e.calendar
@@ -1641,12 +1641,12 @@ function oo(e) {
1641
1641
  }
1642
1642
  );
1643
1643
  }
1644
- const pr = /* @__PURE__ */ new Set([
1644
+ const xr = /* @__PURE__ */ new Set([
1645
1645
  "table",
1646
1646
  "aggregateTable",
1647
1647
  "pivotTable",
1648
1648
  "detailTable"
1649
- ]), yr = /* @__PURE__ */ new Set([
1649
+ ]), kr = /* @__PURE__ */ new Set([
1650
1650
  "bar",
1651
1651
  "horizontalBar",
1652
1652
  "line",
@@ -1677,40 +1677,40 @@ const pr = /* @__PURE__ */ new Set([
1677
1677
  "treemap",
1678
1678
  "custom"
1679
1679
  ]);
1680
- function ao(e) {
1680
+ function xo(e) {
1681
1681
  var o, a, i;
1682
- const r = yr.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
1682
+ const r = kr.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
1683
1683
  let t = !1;
1684
1684
  try {
1685
- t = !!It(e);
1685
+ t = !!Rt(e);
1686
1686
  } catch {
1687
1687
  return { formats: [], defaultFormat: null };
1688
1688
  }
1689
- return e.type === "text" || !r || !t && bt(e) ? { formats: [], defaultFormat: null } : {
1690
- formats: hr({
1689
+ return e.type === "text" || !r || !t && Ft(e) ? { formats: [], defaultFormat: null } : {
1690
+ formats: Er({
1691
1691
  cardType: e.type,
1692
1692
  allowDownload: (a = e.preferences) == null ? void 0 : a.allowDownload
1693
1693
  }),
1694
- defaultFormat: gr({
1694
+ defaultFormat: Sr({
1695
1695
  cardType: e.type,
1696
1696
  allowDownload: (i = e.preferences) == null ? void 0 : i.allowDownload
1697
1697
  })
1698
1698
  };
1699
1699
  }
1700
- function hr(e) {
1700
+ function Er(e) {
1701
1701
  return e.allowDownload === !1 ? ["pdf"] : ["pdf", "csv"];
1702
1702
  }
1703
- function gr(e) {
1704
- return pr.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
1703
+ function Sr(e) {
1704
+ return xr.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
1705
1705
  }
1706
- function io(e) {
1707
- const { config: r } = e, t = gt({
1706
+ function ko(e) {
1707
+ const { config: r } = e, t = St({
1708
1708
  spec: r.spec,
1709
1709
  presentation: r.presentation,
1710
1710
  defaults: r.defaultView,
1711
1711
  session: e.purpose === "manual" ? e.session : void 0
1712
1712
  });
1713
- return me.parse({
1713
+ return ye.parse({
1714
1714
  spec: t.spec,
1715
1715
  presentation: t.presentation,
1716
1716
  ...e.content === "flat" ? { mode: "flat", format: "csv" } : {
@@ -1724,37 +1724,37 @@ function io(e) {
1724
1724
  }
1725
1725
  });
1726
1726
  }
1727
- const vr = C.object({
1728
- connection_id: C.string().min(1),
1729
- cardType: C.literal("matrixTable"),
1730
- resultOwner: C.literal("config"),
1731
- sql: C.literal("").optional(),
1732
- python: C.literal("").optional(),
1733
- tableStructure: C.never().optional(),
1734
- cardDataSource: C.object({
1735
- connectionId: C.string().min(1),
1736
- connectionType: C.string().min(1),
1737
- mode: C.enum(["database", "semanticDomain"]),
1738
- selectedEntities: C.array(C.unknown()),
1739
- semanticDomainId: C.string().optional()
1727
+ const _r = T.object({
1728
+ connection_id: T.string().min(1),
1729
+ cardType: T.literal("matrixTable"),
1730
+ resultOwner: T.literal("config"),
1731
+ sql: T.literal("").optional(),
1732
+ python: T.literal("").optional(),
1733
+ tableStructure: T.never().optional(),
1734
+ cardDataSource: T.object({
1735
+ connectionId: T.string().min(1),
1736
+ connectionType: T.string().min(1),
1737
+ mode: T.enum(["database", "semanticDomain"]),
1738
+ selectedEntities: T.array(T.unknown()),
1739
+ semanticDomainId: T.string().optional()
1740
1740
  }).passthrough(),
1741
- active_filters: C.array(C.unknown()).default([])
1742
- }).passthrough(), co = vr.extend({
1743
- dashboardId: C.string().min(1),
1744
- cardId: C.string().min(1),
1745
- formatOptions: C.object({
1746
- matrix: me,
1747
- acquisition: C.literal("continuation").optional(),
1748
- presentationExecutionSnapshot: C.unknown()
1741
+ active_filters: T.array(T.unknown()).default([])
1742
+ }).passthrough(), Eo = _r.extend({
1743
+ dashboardId: T.string().min(1),
1744
+ cardId: T.string().min(1),
1745
+ formatOptions: T.object({
1746
+ matrix: ye,
1747
+ acquisition: T.literal("continuation").optional(),
1748
+ presentationExecutionSnapshot: T.unknown()
1749
1749
  }).passthrough().superRefine((e, r) => {
1750
1750
  e.matrix.format === "csv" != (e.acquisition === "continuation") && r.addIssue({
1751
- code: C.ZodIssueCode.custom,
1751
+ code: T.ZodIssueCode.custom,
1752
1752
  path: ["acquisition"],
1753
1753
  message: "CSV requires continuation acquisition; PDF must not specify acquisition."
1754
1754
  });
1755
1755
  })
1756
1756
  });
1757
- function lo(e) {
1757
+ function So(e) {
1758
1758
  return {
1759
1759
  ...e.controls,
1760
1760
  type: "card",
@@ -1779,25 +1779,25 @@ function lo(e) {
1779
1779
  delimiter: e.delimiter,
1780
1780
  includeHeaders: e.includeHeaders,
1781
1781
  timezone: e.reportContext.calendar.tz,
1782
- presentationExecutionSnapshot: yt({
1782
+ presentationExecutionSnapshot: kt({
1783
1783
  reportContext: e.reportContext,
1784
1784
  resolvedFormats: []
1785
1785
  })
1786
1786
  }
1787
1787
  };
1788
1788
  }
1789
- const re = C.number().int().nonnegative(), so = C.discriminatedUnion("status", [
1790
- C.object({
1791
- status: C.literal("ok"),
1792
- request: me,
1793
- layout: ct,
1794
- rows: C.array(lt).readonly(),
1795
- usage: C.object({ rows: re, cells: re, bytes: re }).strict()
1789
+ const ie = T.number().int().nonnegative(), _o = T.discriminatedUnion("status", [
1790
+ T.object({
1791
+ status: T.literal("ok"),
1792
+ request: ye,
1793
+ layout: vt,
1794
+ rows: T.array(bt).readonly(),
1795
+ usage: T.object({ rows: ie, cells: ie, bytes: ie }).strict()
1796
1796
  }).strict(),
1797
- C.object({
1798
- status: C.literal("failed"),
1799
- failure: C.object({
1800
- code: C.enum([
1797
+ T.object({
1798
+ status: T.literal("failed"),
1799
+ failure: T.object({
1800
+ code: T.enum([
1801
1801
  "invalid_request",
1802
1802
  "unsupported_capability",
1803
1803
  "stale_cursor",
@@ -1807,17 +1807,17 @@ const re = C.number().int().nonnegative(), so = C.discriminatedUnion("status", [
1807
1807
  "execution_failed",
1808
1808
  "cancelled"
1809
1809
  ]),
1810
- limit: C.enum(["rows", "bytes"]).optional(),
1811
- message: C.string().min(1),
1812
- retryable: C.boolean()
1810
+ limit: T.enum(["rows", "bytes"]).optional(),
1811
+ message: T.string().min(1),
1812
+ retryable: T.boolean()
1813
1813
  }).strict()
1814
1814
  }).strict()
1815
1815
  ]);
1816
- function br(e) {
1816
+ function Fr(e) {
1817
1817
  return !!e && typeof e == "object" && !Array.isArray(e);
1818
1818
  }
1819
- function M(e, r, t) {
1820
- return br(e) ? e : (t.push({ field: r, message: "Expected an object." }), {});
1819
+ function P(e, r, t) {
1820
+ return Fr(e) ? e : (t.push({ field: r, message: "Expected an object." }), {});
1821
1821
  }
1822
1822
  function B(e, r, t, n) {
1823
1823
  const o = new Set(t);
@@ -1828,7 +1828,7 @@ function B(e, r, t, n) {
1828
1828
  });
1829
1829
  });
1830
1830
  }
1831
- function K(e, r, t, n, o = {}) {
1831
+ function N(e, r, t, n, o = {}) {
1832
1832
  if (e == null)
1833
1833
  return;
1834
1834
  if (typeof e != "string") {
@@ -1849,8 +1849,8 @@ function K(e, r, t, n, o = {}) {
1849
1849
  }
1850
1850
  return a;
1851
1851
  }
1852
- function ge(e, r, t) {
1853
- const n = K(e, r, 2e3, t);
1852
+ function Ce(e, r, t) {
1853
+ const n = N(e, r, 2e3, t);
1854
1854
  if (n)
1855
1855
  try {
1856
1856
  return new URL(n), n;
@@ -1859,12 +1859,12 @@ function ge(e, r, t) {
1859
1859
  return;
1860
1860
  }
1861
1861
  }
1862
- function $e(e, r, t) {
1863
- const n = M(e, r, t);
1862
+ function _e(e, r, t) {
1863
+ const n = P(e, r, t);
1864
1864
  B(n, r, ["tokens", "components"], t);
1865
1865
  const o = {};
1866
1866
  if (n.tokens !== void 0) {
1867
- const a = M(n.tokens, `${r}.tokens`, t);
1867
+ const a = P(n.tokens, `${r}.tokens`, t);
1868
1868
  B(
1869
1869
  a,
1870
1870
  `${r}.tokens`,
@@ -1873,11 +1873,11 @@ function $e(e, r, t) {
1873
1873
  );
1874
1874
  const i = {};
1875
1875
  if (a.color !== void 0) {
1876
- const l = M(
1876
+ const l = P(
1877
1877
  a.color,
1878
1878
  `${r}.tokens.color`,
1879
1879
  t
1880
- ), m = [
1880
+ ), d = [
1881
1881
  "background",
1882
1882
  "foreground",
1883
1883
  "muted",
@@ -1890,10 +1890,10 @@ function $e(e, r, t) {
1890
1890
  "warning",
1891
1891
  "info"
1892
1892
  ];
1893
- B(l, `${r}.tokens.color`, m, t);
1893
+ B(l, `${r}.tokens.color`, d, t);
1894
1894
  const c = {};
1895
- m.forEach((s) => {
1896
- const u = K(
1895
+ d.forEach((s) => {
1896
+ const u = N(
1897
1897
  l[s],
1898
1898
  `${r}.tokens.color.${s}`,
1899
1899
  120,
@@ -1903,7 +1903,7 @@ function $e(e, r, t) {
1903
1903
  }), i.color = c;
1904
1904
  }
1905
1905
  if (a.typography !== void 0) {
1906
- const l = M(
1906
+ const l = P(
1907
1907
  a.typography,
1908
1908
  `${r}.tokens.typography`,
1909
1909
  t
@@ -1914,13 +1914,13 @@ function $e(e, r, t) {
1914
1914
  ["fontFamily", "monoFontFamily"],
1915
1915
  t
1916
1916
  );
1917
- const m = K(
1917
+ const d = N(
1918
1918
  l.fontFamily,
1919
1919
  `${r}.tokens.typography.fontFamily`,
1920
1920
  500,
1921
1921
  t,
1922
1922
  { allowEmpty: !0 }
1923
- ), c = K(
1923
+ ), c = N(
1924
1924
  l.monoFontFamily,
1925
1925
  `${r}.tokens.typography.monoFontFamily`,
1926
1926
  500,
@@ -1928,20 +1928,20 @@ function $e(e, r, t) {
1928
1928
  { allowEmpty: !0 }
1929
1929
  );
1930
1930
  i.typography = {
1931
- ...m !== void 0 ? { fontFamily: m } : {},
1931
+ ...d !== void 0 ? { fontFamily: d } : {},
1932
1932
  ...c !== void 0 ? { monoFontFamily: c } : {}
1933
1933
  };
1934
1934
  }
1935
1935
  o.tokens = i;
1936
1936
  }
1937
1937
  if (n.components !== void 0) {
1938
- const a = M(
1938
+ const a = P(
1939
1939
  n.components,
1940
1940
  `${r}.components`,
1941
1941
  t
1942
1942
  );
1943
1943
  if (B(a, `${r}.components`, ["chart"], t), a.chart !== void 0) {
1944
- const i = M(
1944
+ const i = P(
1945
1945
  a.chart,
1946
1946
  `${r}.components.chart`,
1947
1947
  t
@@ -1952,13 +1952,13 @@ function $e(e, r, t) {
1952
1952
  field: `${r}.components.chart.palette`,
1953
1953
  message: "Expected 20 colors or fewer."
1954
1954
  }) : l = i.palette.map(
1955
- (m, c) => K(
1956
- m,
1955
+ (d, c) => N(
1956
+ d,
1957
1957
  `${r}.components.chart.palette.${c}`,
1958
1958
  120,
1959
1959
  t
1960
1960
  )
1961
- ).filter((m) => m !== void 0) : t.push({
1961
+ ).filter((d) => d !== void 0) : t.push({
1962
1962
  field: `${r}.components.chart.palette`,
1963
1963
  message: "Expected an array."
1964
1964
  })), o.components = {
@@ -1968,22 +1968,22 @@ function $e(e, r, t) {
1968
1968
  }
1969
1969
  return o;
1970
1970
  }
1971
- function Ir(e, r) {
1972
- const t = "presentation.appearance", n = M(e, t, r);
1971
+ function Rr(e, r) {
1972
+ const t = "presentation.appearance", n = P(e, t, r);
1973
1973
  B(n, t, ["version", "schemes"], r);
1974
1974
  const o = {};
1975
1975
  if (n.version !== void 0 && (typeof n.version != "number" || !Number.isFinite(n.version) ? r.push({ field: `${t}.version`, message: "Expected a number." }) : o.version = n.version), n.schemes !== void 0) {
1976
- const a = M(n.schemes, `${t}.schemes`, r);
1976
+ const a = P(n.schemes, `${t}.schemes`, r);
1977
1977
  B(a, `${t}.schemes`, ["light", "dark"], r), o.schemes = {
1978
1978
  ...a.light !== void 0 ? {
1979
- light: $e(
1979
+ light: _e(
1980
1980
  a.light,
1981
1981
  `${t}.schemes.light`,
1982
1982
  r
1983
1983
  )
1984
1984
  } : {},
1985
1985
  ...a.dark !== void 0 ? {
1986
- dark: $e(
1986
+ dark: _e(
1987
1987
  a.dark,
1988
1988
  `${t}.schemes.dark`,
1989
1989
  r
@@ -1993,23 +1993,23 @@ function Ir(e, r) {
1993
1993
  }
1994
1994
  return o;
1995
1995
  }
1996
- function wr(e, r) {
1997
- const t = "presentation.brandOverrides", n = M(e, t, r);
1996
+ function Ar(e, r) {
1997
+ const t = "presentation.brandOverrides", n = P(e, t, r);
1998
1998
  B(n, t, ["brandName", "logoUrl", "link"], r);
1999
- const o = K(
1999
+ const o = N(
2000
2000
  n.brandName,
2001
2001
  `${t}.brandName`,
2002
2002
  200,
2003
2003
  r
2004
- ), a = ge(n.logoUrl, `${t}.logoUrl`, r), i = K(n.link, `${t}.link`, 120, r);
2004
+ ), a = Ce(n.logoUrl, `${t}.logoUrl`, r), i = N(n.link, `${t}.link`, 120, r);
2005
2005
  return {
2006
2006
  ...o !== void 0 ? { brandName: o } : {},
2007
2007
  ...a !== void 0 ? { logoUrl: a } : {},
2008
2008
  ...i !== void 0 ? { link: i } : {}
2009
2009
  };
2010
2010
  }
2011
- function Cr(e, r) {
2012
- const t = "presentation.fragments", n = M(e, t, r), o = [
2011
+ function Dr(e, r) {
2012
+ const t = "presentation.fragments", n = P(e, t, r), o = [
2013
2013
  "preHeaderText",
2014
2014
  "headerBannerHtml",
2015
2015
  "signatureHtml",
@@ -2020,7 +2020,7 @@ function Cr(e, r) {
2020
2020
  B(n, t, o, r);
2021
2021
  const a = {};
2022
2022
  return o.forEach((i) => {
2023
- const l = i === "unsubscribeUrl" ? ge(n[i], `${t}.${i}`, r) : K(
2023
+ const l = i === "unsubscribeUrl" ? Ce(n[i], `${t}.${i}`, r) : N(
2024
2024
  n[i],
2025
2025
  `${t}.${i}`,
2026
2026
  i === "preHeaderText" ? 200 : 5e3,
@@ -2030,15 +2030,15 @@ function Cr(e, r) {
2030
2030
  l !== void 0 && (a[i] = l);
2031
2031
  }), a;
2032
2032
  }
2033
- function Tr(e) {
2033
+ function Mr(e) {
2034
2034
  const r = [], t = {};
2035
- if (e.appearance !== void 0 && (t.appearance = Ir(e.appearance, r)), e.brandOverrides !== void 0 && (t.brandOverrides = wr(e.brandOverrides, r)), e.fragments !== void 0 && (t.fragments = Cr(e.fragments, r)), e.viewUrl !== void 0) {
2036
- const n = ge(e.viewUrl, "presentation.viewUrl", r);
2035
+ if (e.appearance !== void 0 && (t.appearance = Rr(e.appearance, r)), e.brandOverrides !== void 0 && (t.brandOverrides = Ar(e.brandOverrides, r)), e.fragments !== void 0 && (t.fragments = Dr(e.fragments, r)), e.viewUrl !== void 0) {
2036
+ const n = Ce(e.viewUrl, "presentation.viewUrl", r);
2037
2037
  n !== void 0 && (t.viewUrl = n);
2038
2038
  }
2039
2039
  return { value: t, issues: r };
2040
2040
  }
2041
- const Ve = [
2041
+ const X = [
2042
2042
  "SUN",
2043
2043
  "MON",
2044
2044
  "TUE",
@@ -2046,15 +2046,21 @@ const Ve = [
2046
2046
  "THU",
2047
2047
  "FRI",
2048
2048
  "SAT"
2049
- ], xr = new Map(
2050
- Ve.map((e, r) => [e, r])
2051
- ), mo = {
2052
- cadence: "weekly",
2049
+ ], He = new Map(
2050
+ X.map((e, r) => [e, r])
2051
+ ), te = [1, 2, 3, 4, 5], We = [1, 2, 3, 6, 12], Ye = {
2052
+ 1: "first",
2053
+ 2: "second",
2054
+ 3: "third",
2055
+ 4: "fourth",
2056
+ [-1]: "last"
2057
+ }, Fo = {
2058
+ frequency: "weekly",
2053
2059
  hour: 9,
2054
2060
  minute: 0,
2055
2061
  weekdays: [1]
2056
- };
2057
- function uo(e) {
2062
+ }, A = { ok: !1, issue: "Choose a supported schedule." };
2063
+ function Pr(e) {
2058
2064
  if (typeof e != "string" || e.length === 0 || e !== e.trim() || /^(?:(?:UTC|GMT)[+-]|[+-]\d{2}:\d{2}$)/.test(e))
2059
2065
  return !1;
2060
2066
  try {
@@ -2063,79 +2069,165 @@ function uo(e) {
2063
2069
  return !1;
2064
2070
  }
2065
2071
  }
2066
- function $r(e) {
2072
+ function Br(e) {
2067
2073
  return Number.isInteger(e.minute) && e.minute >= 0 && e.minute <= 59 && Number.isInteger(e.hour) && e.hour >= 0 && e.hour <= 23;
2068
2074
  }
2069
- function qe(e) {
2075
+ function Ze(e) {
2070
2076
  if (e.length === 0) return null;
2071
2077
  const r = [...e].sort((t, n) => t - n);
2072
2078
  return r.some(
2073
2079
  (t, n) => !Number.isInteger(t) || t < 0 || t > 6 || n > 0 && t === r[n - 1]
2074
2080
  ) ? null : r;
2075
2081
  }
2076
- function fo(e) {
2077
- if (!$r(e))
2082
+ function Qe(e) {
2083
+ const t = [...e.filter((o) => o !== "last")].sort((o, a) => o - a);
2084
+ if (t.some(
2085
+ (o, a) => !Number.isInteger(o) || o < 1 || o > 31 || a > 0 && o === t[a - 1]
2086
+ ) || e.filter((o) => o === "last").length > 1)
2087
+ return null;
2088
+ const n = e.includes("last") ? [...t, "last"] : t;
2089
+ return n.length > 0 ? n : null;
2090
+ }
2091
+ function q(e, r) {
2092
+ const t = [];
2093
+ for (let n = 0; n < 12 / e; n += 1)
2094
+ t.push((r + n * e) % 12);
2095
+ return t.sort((n, o) => n - o);
2096
+ }
2097
+ function Or(e, r) {
2098
+ return e === 1 ? "*" : q(e, r).map((t) => t + 1).join(",");
2099
+ }
2100
+ function Xe(e, r) {
2101
+ return e.every((t) => jr(t, r));
2102
+ }
2103
+ function Ro(e) {
2104
+ if (!Br(e))
2078
2105
  throw new Error("Choose a valid schedule time.");
2079
2106
  const r = `${e.minute} ${e.hour}`;
2080
- switch (e.cadence) {
2107
+ switch (e.frequency) {
2081
2108
  case "daily":
2082
- return `${r} * * *`;
2109
+ return e.weekdaysOnly ? `${r} * * ${te.map((t) => X[t]).join(",")}` : `${r} * * *`;
2083
2110
  case "weekly": {
2084
- const t = qe(e.weekdays);
2111
+ const t = Ze(e.weekdays);
2085
2112
  if (!t) throw new Error("Choose at least one weekday.");
2086
- return `${r} * * ${t.map((n) => Ve[n]).join(",")}`;
2113
+ return `${r} * * ${t.map((n) => X[n]).join(",")}`;
2114
+ }
2115
+ case "monthly": {
2116
+ if (!We.includes(e.interval) || !Number.isInteger(e.startMonth) || e.startMonth < 0 || e.startMonth >= e.interval)
2117
+ throw new Error("Choose a valid month cycle.");
2118
+ const t = Or(e.interval, e.startMonth);
2119
+ if (e.on.type === "days") {
2120
+ const i = Qe(e.on.days);
2121
+ if (!i) throw new Error("Choose at least one day of the month.");
2122
+ const l = q(e.interval, e.startMonth);
2123
+ if (!Xe(i, l))
2124
+ throw new Error("Choose a day that occurs in the chosen months.");
2125
+ const d = i.map((c) => c === "last" ? "L" : String(c)).join(",");
2126
+ return `${r} ${d} ${t} *`;
2127
+ }
2128
+ const { ordinal: n, weekday: o } = e.on;
2129
+ if (!Number.isInteger(o) || o < 0 || o > 6 || !(n in Ye))
2130
+ throw new Error("Choose a valid weekday.");
2131
+ const a = X[o];
2132
+ return `${r} * ${t} ${n === -1 ? `${a}L` : `${a}#${n}`}`;
2087
2133
  }
2088
- case "twice_monthly":
2089
- return `${r} 1,15 * *`;
2090
- case "monthly":
2091
- return `${r} 1 * *`;
2092
2134
  }
2093
2135
  }
2094
- function kr(e) {
2095
- if (typeof e != "string" || e.length === 0)
2096
- return { ok: !1, issue: "Choose a supported schedule." };
2097
- if (e !== e.trim() || e.includes(" "))
2098
- return { ok: !1, issue: "Choose a supported schedule." };
2136
+ function Kr(e) {
2137
+ if (e === "*") return { interval: 1, startMonth: 0 };
2138
+ const r = e.split(",");
2139
+ if (r.some((i) => !/^([1-9]|1[0-2])$/.test(i))) return null;
2140
+ const t = r.map((i) => Number(i) - 1), n = 12 / t.length;
2141
+ if (!We.includes(n))
2142
+ return null;
2143
+ const o = t[0], a = q(
2144
+ n,
2145
+ o
2146
+ );
2147
+ return o >= n || a.length !== t.length || a.some((i, l) => i !== t[l]) ? null : { interval: n, startMonth: o };
2148
+ }
2149
+ function Nr(e) {
2150
+ const r = e.split(",");
2151
+ if (r.some((o) => !/^(L|[1-9]|[12]\d|3[01])$/.test(o))) return null;
2152
+ const t = r.map(
2153
+ (o) => o === "L" ? "last" : Number(o)
2154
+ ), n = Qe(t);
2155
+ return !n || n.some((o, a) => o !== t[a]) ? null : n;
2156
+ }
2157
+ function Lr(e) {
2158
+ const r = /^([A-Z]{3})(?:#([1-4])|(L))$/.exec(e);
2159
+ if (!r) return null;
2160
+ const t = He.get(r[1]);
2161
+ return t === void 0 ? null : {
2162
+ weekday: t,
2163
+ ordinal: r[3] ? -1 : Number(r[2])
2164
+ };
2165
+ }
2166
+ function Je(e) {
2167
+ if (typeof e != "string" || e.length === 0 || e !== e.trim() || e.includes(" "))
2168
+ return A;
2099
2169
  const r = e.split(" ");
2100
- if (r.length !== 5)
2101
- return { ok: !1, issue: "Choose a supported schedule." };
2170
+ if (r.length !== 5) return A;
2102
2171
  const [t, n, o, a, i] = r;
2103
2172
  if (!/^(0|[1-9]\d?)$/.test(t) || !/^(0|[1-9]\d?)$/.test(n))
2104
- return { ok: !1, issue: "Choose a supported schedule." };
2105
- const l = Number(t), m = Number(n);
2106
- if (l > 59 || m > 23 || a !== "*")
2107
- return { ok: !1, issue: "Choose a supported schedule." };
2108
- if (o === "*" && i === "*")
2173
+ return A;
2174
+ const l = Number(t), d = Number(n);
2175
+ if (l > 59 || d > 23) return A;
2176
+ if (a === "*" && o === "*" && i === "*")
2109
2177
  return {
2110
2178
  ok: !0,
2111
- value: { cadence: "daily", hour: m, minute: l, weekdays: [] }
2179
+ value: { frequency: "daily", hour: d, minute: l, weekdaysOnly: !1 }
2112
2180
  };
2113
- if (o === "*" && i !== "*") {
2114
- const s = i.split(",").map((d) => xr.get(d));
2115
- if (s.some((d) => d === void 0))
2116
- return { ok: !1, issue: "Choose a supported schedule." };
2117
- const u = s, p = qe(u);
2118
- return !p || p.some((d, v) => d !== u[v]) ? { ok: !1, issue: "Choose a supported schedule." } : {
2181
+ if (a === "*" && o === "*" && !i.includes("#") && !i.endsWith("L")) {
2182
+ const u = i.split(",").map((g) => He.get(g));
2183
+ if (u.some((g) => g === void 0)) return A;
2184
+ const p = u, m = Ze(p);
2185
+ return !m || m.some((g, y) => g !== p[y]) ? A : m.length === te.length && m.every((g, y) => g === te[y]) ? {
2186
+ ok: !0,
2187
+ value: { frequency: "daily", hour: d, minute: l, weekdaysOnly: !0 }
2188
+ } : {
2119
2189
  ok: !0,
2120
- value: { cadence: "weekly", hour: m, minute: l, weekdays: p }
2190
+ value: { frequency: "weekly", hour: d, minute: l, weekdays: m }
2191
+ };
2192
+ }
2193
+ const c = Kr(a);
2194
+ if (!c) return A;
2195
+ if (o !== "*" && i === "*") {
2196
+ const s = Nr(o), u = q(c.interval, c.startMonth);
2197
+ return !s || !Xe(s, u) ? A : {
2198
+ ok: !0,
2199
+ value: {
2200
+ frequency: "monthly",
2201
+ hour: d,
2202
+ minute: l,
2203
+ ...c,
2204
+ on: { type: "days", days: s }
2205
+ }
2121
2206
  };
2122
2207
  }
2123
- return o === "1,15" && i === "*" ? {
2124
- ok: !0,
2125
- value: { cadence: "twice_monthly", hour: m, minute: l, weekdays: [] }
2126
- } : o === "1" && i === "*" ? {
2127
- ok: !0,
2128
- value: { cadence: "monthly", hour: m, minute: l, weekdays: [] }
2129
- } : { ok: !1, issue: "Choose a supported schedule." };
2208
+ if (o === "*" && i !== "*") {
2209
+ const s = Lr(i);
2210
+ return s ? {
2211
+ ok: !0,
2212
+ value: {
2213
+ frequency: "monthly",
2214
+ hour: d,
2215
+ minute: l,
2216
+ ...c,
2217
+ on: { type: "weekday", ...s }
2218
+ }
2219
+ } : A;
2220
+ }
2221
+ return A;
2130
2222
  }
2131
- function Er(e, r, t) {
2223
+ function zr(e, r, t) {
2132
2224
  return new Intl.DateTimeFormat(t, {
2133
2225
  hour: "numeric",
2134
2226
  minute: "2-digit",
2135
2227
  timeZone: "UTC"
2136
2228
  }).format(new Date(Date.UTC(2020, 0, 1, e, r)));
2137
2229
  }
2138
- function Sr(e, r) {
2230
+ function qr(e, r) {
2139
2231
  var t;
2140
2232
  if (e === "UTC") return "UTC";
2141
2233
  try {
@@ -2147,58 +2239,130 @@ function Sr(e, r) {
2147
2239
  return null;
2148
2240
  }
2149
2241
  }
2150
- function po(e, r, t = "en-US") {
2151
- const n = kr(e);
2242
+ function Fe(e) {
2243
+ return e.length <= 1 ? e.join("") : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
2244
+ }
2245
+ function Vr(e) {
2246
+ const r = e % 100;
2247
+ return r >= 11 && r <= 13 ? `${e}th` : `${e}${["th", "st", "nd", "rd"][e % 10] ?? "th"}`;
2248
+ }
2249
+ function Ur(e, r, t) {
2250
+ const n = (a, i) => new Intl.DateTimeFormat(t, { month: i, timeZone: "UTC" }).format(
2251
+ new Date(Date.UTC(2020, a, 1))
2252
+ );
2253
+ if (e === 1) return "every month";
2254
+ if (e === 12) return `${n(r, "long")} each year`;
2255
+ const o = q(e, r).map((a) => n(a, "short")).join(", ");
2256
+ return e === 3 ? `each quarter (${o})` : `every ${e} months (${o})`;
2257
+ }
2258
+ function Ao(e, r, t = "en-US") {
2259
+ const n = Je(e);
2152
2260
  if (!n.ok) return null;
2153
2261
  try {
2154
- const o = Er(n.value.hour, n.value.minute, t), a = Sr(r, t);
2262
+ const o = n.value, a = qr(r, t);
2155
2263
  if (!a) return null;
2156
- switch (n.value.cadence) {
2264
+ const i = `at ${zr(o.hour, o.minute, t)} ${a}`, l = (d) => new Intl.DateTimeFormat(t, {
2265
+ weekday: "long",
2266
+ timeZone: "UTC"
2267
+ }).format(new Date(Date.UTC(2023, 0, 1 + d)));
2268
+ switch (o.frequency) {
2157
2269
  case "daily":
2158
- return `Daily at ${o} ${a}`;
2159
- case "weekly": {
2160
- const i = new Intl.DateTimeFormat(t, {
2161
- weekday: "long",
2162
- timeZone: "UTC"
2163
- });
2164
- return `${n.value.weekdays.map(
2165
- (m) => i.format(new Date(Date.UTC(2023, 0, 1 + m)))
2166
- ).join(" and ")} at ${o} ${a}`;
2270
+ return o.weekdaysOnly ? `Every weekday, Monday to Friday, ${i}` : `Every day ${i}`;
2271
+ case "weekly":
2272
+ return `Every ${Fe(o.weekdays.map(l))} ${i}`;
2273
+ case "monthly": {
2274
+ const d = Ur(o.interval, o.startMonth, t);
2275
+ if (o.on.type === "weekday")
2276
+ return `On the ${Ye[o.on.ordinal]} ${l(o.on.weekday)} of ${d} ${i}`;
2277
+ const c = o.on.days.map(
2278
+ (s) => s === "last" ? "last day" : Vr(s)
2279
+ );
2280
+ return `On the ${Fe(c)} of ${d} ${i}`;
2167
2281
  }
2168
- case "twice_monthly":
2169
- return `On the 1st and 15th at ${o} ${a}`;
2170
- case "monthly":
2171
- return `Monthly on the 1st at ${o} ${a}`;
2172
2282
  }
2173
2283
  } catch {
2174
2284
  return null;
2175
2285
  }
2176
2286
  }
2177
- function yo(e) {
2287
+ const et = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2288
+ function jr(e, r) {
2289
+ return e === "last" || r.some((t) => e <= et[t]);
2290
+ }
2291
+ function Do(e) {
2292
+ if (e.frequency !== "monthly" || e.on.type !== "days") return null;
2293
+ const r = e.on.days.filter((o) => o !== "last");
2294
+ if (r.length === 0) return null;
2295
+ const t = Math.max(...r), n = q(e.interval, e.startMonth).filter(
2296
+ (o) => t > (o === 1 ? 28 : et[o])
2297
+ );
2298
+ return n.length > 0 ? { day: t, months: n } : null;
2299
+ }
2300
+ function Gr(e, r) {
2301
+ return new Date(Date.UTC(e, r + 1, 0)).getUTCDate();
2302
+ }
2303
+ function Hr(e, r, t, n) {
2304
+ const o = new Date(Date.UTC(r, t, n)).getUTCDay();
2305
+ switch (e.frequency) {
2306
+ case "daily":
2307
+ return !e.weekdaysOnly || te.includes(o);
2308
+ case "weekly":
2309
+ return e.weekdays.includes(o);
2310
+ case "monthly": {
2311
+ if (!q(e.interval, e.startMonth).includes(t))
2312
+ return !1;
2313
+ const a = Gr(r, t);
2314
+ return e.on.type === "days" ? e.on.days.some(
2315
+ (i) => i === "last" ? n === a : i === n
2316
+ ) : o !== e.on.weekday ? !1 : e.on.ordinal === -1 ? n + 7 > a : Math.ceil(n / 7) === e.on.ordinal;
2317
+ }
2318
+ }
2319
+ }
2320
+ function Mo(e, r, t, n) {
2321
+ const o = Je(e);
2322
+ if (!o.ok || !Pr(r)) return [];
2323
+ const a = o.value, i = new Intl.DateTimeFormat("en-US", {
2324
+ timeZone: r,
2325
+ hourCycle: "h23",
2326
+ year: "numeric",
2327
+ month: "numeric",
2328
+ day: "numeric",
2329
+ hour: "numeric",
2330
+ minute: "numeric"
2331
+ }).formatToParts(t), l = (s) => {
2332
+ var u;
2333
+ return Number((u = i.find((p) => p.type === s)) == null ? void 0 : u.value);
2334
+ }, d = new Date(Date.UTC(l("year"), l("month") - 1, l("day")));
2335
+ l("hour") * 60 + l("minute") >= a.hour * 60 + a.minute && d.setUTCDate(d.getUTCDate() + 1);
2336
+ const c = [];
2337
+ for (let s = 0; s < 366 * 4 * (n + 1) && c.length < n; s += 1)
2338
+ Hr(a, d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()) && c.push(d.toISOString().slice(0, 10)), d.setUTCDate(d.getUTCDate() + 1);
2339
+ return c;
2340
+ }
2341
+ function Po(e) {
2178
2342
  return e != null && e.role ? e.type === "tenant" ? e.role === "POWER_USER" : ["AUTHOR", "ADMIN", "SUPER_ADMIN"].includes(e.role) : !1;
2179
2343
  }
2180
- function ho(e) {
2344
+ function Bo(e) {
2181
2345
  return e.canCreate ? [
2182
2346
  ...e.scheduledReportAvailable ? ["scheduled_report"] : [],
2183
2347
  ...e.analyticalBriefingsEnabled ? ["analytical_briefing"] : []
2184
2348
  ] : [];
2185
2349
  }
2186
- function _r(e) {
2350
+ function Wr(e) {
2187
2351
  const r = (e == null ? void 0 : e.channels) ?? [];
2188
2352
  return r.length === 1 && r[0] === "EMAIL";
2189
2353
  }
2190
- function Fr(e) {
2191
- return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && _r(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
2354
+ function Yr(e) {
2355
+ return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && Wr(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
2192
2356
  }
2193
- function go(e) {
2194
- const r = Fr(e), t = r === "Scheduled report" || r === "On-demand report" ? "report" : "briefing";
2357
+ function Oo(e) {
2358
+ const r = Yr(e), t = r === "Scheduled report" || r === "On-demand report" ? "report" : "briefing";
2195
2359
  return {
2196
2360
  typeLabel: r,
2197
2361
  noun: t,
2198
2362
  pluralNoun: t === "report" ? "reports" : "briefings"
2199
2363
  };
2200
2364
  }
2201
- const de = "BRIEFING", Rr = ["markdown", "html"], se = ["markdown"], ne = 20, y = {
2365
+ const fe = "BRIEFING", Zr = ["markdown", "html"], pe = ["markdown"], ce = 20, h = {
2202
2366
  name: 500,
2203
2367
  description: 2e3,
2204
2368
  instruction: 5e4,
@@ -2218,16 +2382,16 @@ const de = "BRIEFING", Rr = ["markdown", "html"], se = ["markdown"], ne = 20, y
2218
2382
  maxBlocks: 50,
2219
2383
  maxTableRows: 100,
2220
2384
  maxTableColumns: 20,
2221
- maxTableCellCharacters: y.contentCell,
2222
- maxParagraphCharacters: y.contentText,
2223
- maxFindingCharacters: y.contentText,
2385
+ maxTableCellCharacters: h.contentCell,
2386
+ maxParagraphCharacters: h.contentText,
2387
+ maxFindingCharacters: h.contentText,
2224
2388
  maxListItems: 100,
2225
2389
  // A kpi_grid is rendered as a 2-up tile arrangement in emails. Cap at 8 so
2226
2390
  // the visual stays at most 4 rows (4 columns wide on desktop would force
2227
2391
  // tiny tiles in narrow client panels; 2-up was the chosen layout).
2228
2392
  maxKpiTiles: 8
2229
2393
  };
2230
- function Ar(e) {
2394
+ function Qr(e) {
2231
2395
  if (e === null || typeof e != "object" || Array.isArray(e))
2232
2396
  return !1;
2233
2397
  const r = e;
@@ -2237,60 +2401,60 @@ function Ar(e) {
2237
2401
  if (t === null || typeof t != "object" || Array.isArray(t))
2238
2402
  return !1;
2239
2403
  const n = t;
2240
- return (n.kind === "metric" && typeof n.metricId == "string" && !!n.metricId.trim() || n.kind === "column" && typeof n.columnKey == "string" && !!n.columnKey.trim() || n.kind === "matrix_measure" && typeof n.measureId == "string" && !!n.measureId.trim()) && ke(r.format).ok;
2404
+ return (n.kind === "metric" && typeof n.metricId == "string" && !!n.metricId.trim() || n.kind === "column" && typeof n.columnKey == "string" && !!n.columnKey.trim() || n.kind === "matrix_measure" && typeof n.measureId == "string" && !!n.measureId.trim()) && Re(r.format).ok;
2241
2405
  }
2242
- function Pr(e) {
2243
- return e == null ? "" : Ar(e) ? ot(e.value, e.format) : String(e);
2406
+ function Xr(e) {
2407
+ return e == null ? "" : Qr(e) ? yt(e.value, e.format) : String(e);
2244
2408
  }
2245
- function vo(e) {
2409
+ function Ko(e) {
2246
2410
  return [e.delta, e.percentChange].filter(
2247
2411
  (r) => r != null
2248
- ).map(Pr).filter(Boolean).join(" / ");
2412
+ ).map(Xr).filter(Boolean).join(" / ");
2249
2413
  }
2250
- const je = new Set(Rr), Mr = /* @__PURE__ */ new Set([
2414
+ const tt = new Set(Zr), Jr = /* @__PURE__ */ new Set([
2251
2415
  "EMAIL",
2252
2416
  "WEBHOOK",
2253
2417
  "SLACK",
2254
2418
  "IN_APP",
2255
2419
  "TELEGRAM"
2256
- ]), oe = {
2420
+ ]), le = {
2257
2421
  maxToolCalls: { min: 1, max: 100 },
2258
2422
  maxPlanningIterations: { min: 1, max: 10 },
2259
2423
  maxRows: { min: 1, max: 1e5 },
2260
2424
  timeoutMs: { min: 1e3, max: 30 * 6e4 }
2261
- }, Br = /* @__PURE__ */ new Set([
2425
+ }, en = /* @__PURE__ */ new Set([
2262
2426
  "letter",
2263
2427
  "legal",
2264
2428
  "a4",
2265
2429
  "a3",
2266
2430
  "tabloid"
2267
- ]), Dr = /* @__PURE__ */ new Set([
2431
+ ]), tn = /* @__PURE__ */ new Set([
2268
2432
  "portrait",
2269
2433
  "landscape"
2270
- ]), Or = /* @__PURE__ */ new Set([",", ";", " "]), Kr = /* @__PURE__ */ new Set([
2434
+ ]), rn = /* @__PURE__ */ new Set([",", ";", " "]), nn = /* @__PURE__ */ new Set([
2271
2435
  "current",
2272
2436
  "all"
2273
- ]), Nr = /* @__PURE__ */ new Set([
2437
+ ]), on = /* @__PURE__ */ new Set([
2274
2438
  "concise",
2275
2439
  "balanced",
2276
2440
  "detailed"
2277
- ]), zr = /* @__PURE__ */ new Set([
2441
+ ]), an = /* @__PURE__ */ new Set([
2278
2442
  "info",
2279
2443
  "positive",
2280
2444
  "warning",
2281
2445
  "critical"
2282
- ]), Lr = /* @__PURE__ */ new Set([
2446
+ ]), cn = /* @__PURE__ */ new Set([
2283
2447
  "text",
2284
2448
  "number",
2285
2449
  "currency",
2286
2450
  "percent",
2287
2451
  "date",
2288
2452
  "boolean"
2289
- ]), Vr = /* @__PURE__ */ new Set([
2453
+ ]), ln = /* @__PURE__ */ new Set([
2290
2454
  "left",
2291
2455
  "center",
2292
2456
  "right"
2293
- ]), qr = [
2457
+ ]), sn = [
2294
2458
  "matrix",
2295
2459
  "pageSize",
2296
2460
  "orientation",
@@ -2318,21 +2482,21 @@ const je = new Set(Rr), Mr = /* @__PURE__ */ new Set([
2318
2482
  "allowDownload",
2319
2483
  "theme"
2320
2484
  ];
2321
- class ee extends Error {
2485
+ class oe extends Error {
2322
2486
  constructor(t) {
2323
2487
  super(t.map((n) => `${n.field}: ${n.message}`).join("; "));
2324
2488
  F(this, "issues");
2325
2489
  this.name = "BriefingContractError", this.issues = t;
2326
2490
  }
2327
2491
  }
2328
- function Ue(e) {
2492
+ function rt(e) {
2329
2493
  return typeof e == "object" && e !== null && !Array.isArray(e);
2330
2494
  }
2331
2495
  function f(e, r, t) {
2332
2496
  e.push({ field: r, message: t });
2333
2497
  }
2334
2498
  function k(e, r, t) {
2335
- return Ue(e) ? e : (f(t, r, "Expected an object."), {});
2499
+ return rt(e) ? e : (f(t, r, "Expected an object."), {});
2336
2500
  }
2337
2501
  function I(e, r, t, n) {
2338
2502
  const o = new Set(t);
@@ -2344,13 +2508,13 @@ function I(e, r, t, n) {
2344
2508
  );
2345
2509
  });
2346
2510
  }
2347
- function x(e, r, t, n) {
2511
+ function $(e, r, t, n) {
2348
2512
  if (typeof e != "string")
2349
2513
  return f(n, r, "Expected a string."), "";
2350
2514
  const o = e.trim();
2351
2515
  return o ? (o.length > t && f(n, r, `Must be ${t} characters or fewer.`), o) : (f(n, r, "Required value cannot be empty."), "");
2352
2516
  }
2353
- function $(e, r, t, n) {
2517
+ function x(e, r, t, n) {
2354
2518
  if (e == null)
2355
2519
  return;
2356
2520
  if (typeof e != "string") {
@@ -2361,13 +2525,13 @@ function $(e, r, t, n) {
2361
2525
  if (o)
2362
2526
  return o.length > t && f(n, r, `Must be ${t} characters or fewer.`), o;
2363
2527
  }
2364
- function jr(e, r, t, n) {
2528
+ function dn(e, r, t, n) {
2365
2529
  if (typeof e != "string")
2366
2530
  return f(n, r, "Expected a string."), "";
2367
2531
  const o = e.trim();
2368
2532
  return o.length > t && f(n, r, `Must be ${t} characters or fewer.`), o;
2369
2533
  }
2370
- function Ur(e, r, t) {
2534
+ function mn(e, r, t) {
2371
2535
  if (e != null) {
2372
2536
  if (!Number.isInteger(e) || Number(e) < 0) {
2373
2537
  f(t, r, "Expected a non-negative integer.");
@@ -2376,17 +2540,17 @@ function Ur(e, r, t) {
2376
2540
  return Number(e);
2377
2541
  }
2378
2542
  }
2379
- function A(e, r, t, n = {}) {
2543
+ function D(e, r, t, n = {}) {
2380
2544
  if (e == null)
2381
2545
  return n.required ? (f(t, r, "Expected at least one evidence id."), []) : void 0;
2382
2546
  if (!Array.isArray(e))
2383
2547
  return f(t, r, "Expected an array."), n.required ? [] : void 0;
2384
2548
  const o = [];
2385
2549
  return e.forEach((a, i) => {
2386
- const l = x(
2550
+ const l = $(
2387
2551
  a,
2388
2552
  `${r}.${i}`,
2389
- y.id,
2553
+ h.id,
2390
2554
  t
2391
2555
  );
2392
2556
  l && !o.includes(l) && o.push(l);
@@ -2395,42 +2559,42 @@ function A(e, r, t, n = {}) {
2395
2559
  function z(e, r, t, n) {
2396
2560
  return e == null ? r : typeof e != "boolean" ? (f(n, t, "Expected a boolean."), r) : e;
2397
2561
  }
2398
- function Gr(e, r) {
2562
+ function un(e, r) {
2399
2563
  return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (f(r, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
2400
2564
  }
2401
- function Hr(e) {
2565
+ function fn(e) {
2402
2566
  return e.includes("@") && e.includes(".") && !e.includes(" ");
2403
2567
  }
2404
- function Ge(e, r) {
2568
+ function nt(e, r) {
2405
2569
  if (e == null)
2406
2570
  return { type: "project" };
2407
2571
  const t = k(e, "source", r), n = t.type;
2408
2572
  return n === "project" ? (I(t, "source", ["type"], r), { type: "project" }) : n === "dashboard" ? (I(t, "source", ["type", "dashboardId"], r), {
2409
2573
  type: "dashboard",
2410
- dashboardId: x(
2574
+ dashboardId: $(
2411
2575
  t.dashboardId,
2412
2576
  "source.dashboardId",
2413
- y.id,
2577
+ h.id,
2414
2578
  r
2415
2579
  )
2416
2580
  }) : (f(r, "source.type", "Expected project or dashboard."), { type: "project" });
2417
2581
  }
2418
- function He(e, r) {
2582
+ function ot(e, r) {
2419
2583
  const t = k(e, "body", r), n = t.type;
2420
2584
  return n === "generated_analysis" ? (I(t, "body", ["type", "instruction"], r), {
2421
2585
  type: "generated_analysis",
2422
- instruction: x(
2586
+ instruction: $(
2423
2587
  t.instruction,
2424
2588
  "body.instruction",
2425
- y.instruction,
2589
+ h.instruction,
2426
2590
  r
2427
2591
  )
2428
2592
  }) : n === "custom_message" ? (I(t, "body", ["type", "message"], r), {
2429
2593
  type: "custom_message",
2430
- message: jr(
2594
+ message: dn(
2431
2595
  t.message,
2432
2596
  "body.message",
2433
- y.customMessage,
2597
+ h.customMessage,
2434
2598
  r
2435
2599
  )
2436
2600
  }) : n === "none" ? (I(t, "body", ["type"], r), { type: "none" }) : (f(
@@ -2439,11 +2603,11 @@ function He(e, r) {
2439
2603
  "Expected generated_analysis, custom_message, or none."
2440
2604
  ), { type: "none" });
2441
2605
  }
2442
- function Wr(e, r) {
2606
+ function pn(e, r) {
2443
2607
  if (e == null)
2444
- return [...se];
2608
+ return [...pe];
2445
2609
  if (!Array.isArray(e))
2446
- return f(r, "presentation.artifactFormats", "Expected an array."), [...se];
2610
+ return f(r, "presentation.artifactFormats", "Expected an array."), [...pe];
2447
2611
  if (e.length === 0)
2448
2612
  return f(
2449
2613
  r,
@@ -2452,7 +2616,7 @@ function Wr(e, r) {
2452
2616
  ), [];
2453
2617
  const t = [];
2454
2618
  return e.forEach((n, o) => {
2455
- if (typeof n != "string" || !je.has(n)) {
2619
+ if (typeof n != "string" || !tt.has(n)) {
2456
2620
  f(
2457
2621
  r,
2458
2622
  `presentation.artifactFormats.${o}`,
@@ -2463,10 +2627,10 @@ function Wr(e, r) {
2463
2627
  t.includes(n) || t.push(n);
2464
2628
  }), t;
2465
2629
  }
2466
- function We(e, r) {
2630
+ function at(e, r) {
2467
2631
  if (e == null)
2468
2632
  return {
2469
- artifactFormats: [...se],
2633
+ artifactFormats: [...pe],
2470
2634
  includeEvidence: !0,
2471
2635
  includeSql: !0
2472
2636
  };
@@ -2489,7 +2653,7 @@ function We(e, r) {
2489
2653
  r
2490
2654
  );
2491
2655
  const n = {
2492
- artifactFormats: Wr(t.artifactFormats, r),
2656
+ artifactFormats: pn(t.artifactFormats, r),
2493
2657
  includeEvidence: z(
2494
2658
  t.includeEvidence,
2495
2659
  !0,
@@ -2502,69 +2666,69 @@ function We(e, r) {
2502
2666
  "presentation.includeSql",
2503
2667
  r
2504
2668
  )
2505
- }, o = $(
2669
+ }, o = x(
2506
2670
  t.audience,
2507
2671
  "presentation.audience",
2508
- y.presentationAudience,
2672
+ h.presentationAudience,
2509
2673
  r
2510
- ), a = $(
2674
+ ), a = x(
2511
2675
  t.tone,
2512
2676
  "presentation.tone",
2513
- y.presentationTone,
2677
+ h.presentationTone,
2514
2678
  r
2515
- ), i = $(
2679
+ ), i = x(
2516
2680
  t.format,
2517
2681
  "presentation.format",
2518
- y.presentationFormat,
2682
+ h.presentationFormat,
2519
2683
  r
2520
2684
  );
2521
2685
  o && (n.audience = o), a && (n.tone = a), i && (n.format = i);
2522
- const l = Tr(t);
2523
- return l.issues.forEach((m) => f(r, m.field, m.message)), Object.assign(n, l.value), n;
2686
+ const l = Mr(t);
2687
+ return l.issues.forEach((d) => f(r, d.field, d.message)), Object.assign(n, l.value), n;
2524
2688
  }
2525
- function Yr(e, r, t) {
2689
+ function yn(e, r, t) {
2526
2690
  return Array.isArray(e) ? (e.length === 0 && f(t, r, "Expected at least one item."), e.length > R.maxListItems && f(
2527
2691
  t,
2528
2692
  r,
2529
2693
  `Must have ${R.maxListItems} items or fewer.`
2530
2694
  ), e.slice(0, R.maxListItems).map(
2531
- (n, o) => x(
2695
+ (n, o) => $(
2532
2696
  n,
2533
2697
  `${r}.${o}`,
2534
- y.contentItem,
2698
+ h.contentItem,
2535
2699
  t
2536
2700
  )
2537
2701
  ).filter(Boolean)) : (f(t, r, "Expected an array."), []);
2538
2702
  }
2539
- function Zr(e, r, t) {
2703
+ function hn(e, r, t) {
2540
2704
  const n = k(e, r, t);
2541
2705
  if (n.kind === "metric")
2542
2706
  return I(n, r, ["kind", "metricId"], t), {
2543
2707
  kind: "metric",
2544
- metricId: x(
2708
+ metricId: $(
2545
2709
  n.metricId,
2546
2710
  `${r}.metricId`,
2547
- y.id,
2711
+ h.id,
2548
2712
  t
2549
2713
  )
2550
2714
  };
2551
2715
  if (n.kind === "column")
2552
2716
  return I(n, r, ["kind", "columnKey"], t), {
2553
2717
  kind: "column",
2554
- columnKey: x(
2718
+ columnKey: $(
2555
2719
  n.columnKey,
2556
2720
  `${r}.columnKey`,
2557
- y.id,
2721
+ h.id,
2558
2722
  t
2559
2723
  )
2560
2724
  };
2561
2725
  if (n.kind === "matrix_measure")
2562
2726
  return I(n, r, ["kind", "measureId"], t), {
2563
2727
  kind: "matrix_measure",
2564
- measureId: x(
2728
+ measureId: $(
2565
2729
  n.measureId,
2566
2730
  `${r}.measureId`,
2567
- y.id,
2731
+ h.id,
2568
2732
  t
2569
2733
  )
2570
2734
  };
@@ -2574,18 +2738,18 @@ function Zr(e, r, t) {
2574
2738
  "Expected metric, column, or matrix_measure."
2575
2739
  );
2576
2740
  }
2577
- function Ye(e, r, t) {
2741
+ function it(e, r, t) {
2578
2742
  if (e === null || typeof e != "object" || Array.isArray(e))
2579
2743
  return;
2580
2744
  const n = k(e, r, t);
2581
2745
  if (!Object.prototype.hasOwnProperty.call(n, "target") && !Object.prototype.hasOwnProperty.call(n, "format"))
2582
2746
  return;
2583
2747
  I(n, r, ["value", "target", "format"], t), (typeof n.value != "number" || !Number.isFinite(n.value)) && f(t, `${r}.value`, "Expected a finite number.");
2584
- const o = Zr(
2748
+ const o = hn(
2585
2749
  n.target,
2586
2750
  `${r}.target`,
2587
2751
  t
2588
- ), a = ke(n.format);
2752
+ ), a = Re(n.format);
2589
2753
  if (a.ok || a.issues.forEach(
2590
2754
  (i) => f(
2591
2755
  t,
@@ -2595,7 +2759,7 @@ function Ye(e, r, t) {
2595
2759
  ), !(typeof n.value != "number" || !Number.isFinite(n.value) || !o || !a.ok))
2596
2760
  return { value: n.value, target: o, format: a.value };
2597
2761
  }
2598
- function O(e, r, t) {
2762
+ function K(e, r, t) {
2599
2763
  if (typeof e == "string")
2600
2764
  return e;
2601
2765
  if (typeof e == "number") {
@@ -2605,7 +2769,7 @@ function O(e, r, t) {
2605
2769
  }
2606
2770
  return e;
2607
2771
  }
2608
- const n = Ye(e, r, t);
2772
+ const n = it(e, r, t);
2609
2773
  if (n) return n;
2610
2774
  f(
2611
2775
  t,
@@ -2613,21 +2777,21 @@ function O(e, r, t) {
2613
2777
  "Expected a string, number, or structured numeric value."
2614
2778
  );
2615
2779
  }
2616
- function Qr(e, r, t) {
2780
+ function gn(e, r, t) {
2617
2781
  if (e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean")
2618
- return typeof e == "string" && e.length > y.contentCell ? (f(
2782
+ return typeof e == "string" && e.length > h.contentCell ? (f(
2619
2783
  t,
2620
2784
  r,
2621
- `Must be ${y.contentCell} characters or fewer.`
2622
- ), e.slice(0, y.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (f(t, r, "Expected a finite number."), null) : e;
2623
- const n = Ye(e, r, t);
2785
+ `Must be ${h.contentCell} characters or fewer.`
2786
+ ), e.slice(0, h.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (f(t, r, "Expected a finite number."), null) : e;
2787
+ const n = it(e, r, t);
2624
2788
  return n || (f(
2625
2789
  t,
2626
2790
  r,
2627
2791
  "Expected a string, number, boolean, structured numeric value, or null."
2628
2792
  ), null);
2629
2793
  }
2630
- function Jr(e, r, t) {
2794
+ function vn(e, r, t) {
2631
2795
  if (!Array.isArray(e))
2632
2796
  return f(t, r, "Expected an array."), [];
2633
2797
  e.length === 0 && f(t, r, "Expected at least one column."), e.length > R.maxTableColumns && f(
@@ -2639,40 +2803,40 @@ function Jr(e, r, t) {
2639
2803
  return e.slice(0, R.maxTableColumns).map((o, a) => {
2640
2804
  const i = `${r}.${a}`, l = k(o, i, t);
2641
2805
  I(l, i, ["key", "label", "kind", "align"], t);
2642
- const m = x(
2806
+ const d = $(
2643
2807
  l.key,
2644
2808
  `${i}.key`,
2645
- y.id,
2809
+ h.id,
2646
2810
  t
2647
2811
  );
2648
- m && (n.has(m) && f(t, `${i}.key`, "Column key must be unique."), n.add(m));
2649
- const c = x(
2812
+ d && (n.has(d) && f(t, `${i}.key`, "Column key must be unique."), n.add(d));
2813
+ const c = $(
2650
2814
  l.label,
2651
2815
  `${i}.label`,
2652
- y.contentTitle,
2816
+ h.contentTitle,
2653
2817
  t
2654
- ), s = D(
2818
+ ), s = O(
2655
2819
  l.kind,
2656
2820
  `${i}.kind`,
2657
- Lr,
2821
+ cn,
2658
2822
  "text, number, currency, percent, date, or boolean",
2659
2823
  t
2660
- ), u = D(
2824
+ ), u = O(
2661
2825
  l.align,
2662
2826
  `${i}.align`,
2663
- Vr,
2827
+ ln,
2664
2828
  "left, center, or right",
2665
2829
  t
2666
2830
  );
2667
2831
  return {
2668
- key: m,
2832
+ key: d,
2669
2833
  label: c,
2670
2834
  ...s ? { kind: s } : {},
2671
2835
  ...u ? { align: u } : {}
2672
2836
  };
2673
2837
  });
2674
2838
  }
2675
- function Xr(e, r, t, n) {
2839
+ function bn(e, r, t, n) {
2676
2840
  if (!Array.isArray(e))
2677
2841
  return f(n, r, "Expected an array."), [];
2678
2842
  e.length > R.maxTableRows && f(
@@ -2682,30 +2846,30 @@ function Xr(e, r, t, n) {
2682
2846
  );
2683
2847
  const o = new Set(t.map((a) => a.key).filter(Boolean));
2684
2848
  return e.slice(0, R.maxTableRows).map((a, i) => {
2685
- const l = `${r}.${i}`, m = k(a, l, n);
2686
- return Object.keys(m).forEach((c) => {
2849
+ const l = `${r}.${i}`, d = k(a, l, n);
2850
+ return Object.keys(d).forEach((c) => {
2687
2851
  o.has(c) || f(n, `${l}.${c}`, `Unexpected table cell "${c}".`);
2688
2852
  }), Object.fromEntries(
2689
2853
  t.map((c) => [
2690
2854
  c.key,
2691
- Qr(m[c.key] ?? null, `${l}.${c.key}`, n)
2855
+ gn(d[c.key] ?? null, `${l}.${c.key}`, n)
2692
2856
  ])
2693
2857
  );
2694
2858
  });
2695
2859
  }
2696
- function en(e, r, t) {
2860
+ function In(e, r, t) {
2697
2861
  const n = `content.blocks.${r}`, o = k(e, n, t), a = o.type;
2698
2862
  if (a === "heading") {
2699
2863
  I(o, n, ["type", "text", "level", "evidenceIds"], t);
2700
2864
  const i = o.level === void 0 || o.level === null ? void 0 : o.level === 2 || o.level === 3 ? o.level : void 0;
2701
2865
  o.level !== void 0 && o.level !== null && i === void 0 && f(t, `${n}.level`, "Expected 2 or 3.");
2702
- const l = A(o.evidenceIds, `${n}.evidenceIds`, t);
2866
+ const l = D(o.evidenceIds, `${n}.evidenceIds`, t);
2703
2867
  return {
2704
2868
  type: "heading",
2705
- text: x(
2869
+ text: $(
2706
2870
  o.text,
2707
2871
  `${n}.text`,
2708
- y.contentTitle,
2872
+ h.contentTitle,
2709
2873
  t
2710
2874
  ),
2711
2875
  ...i ? { level: i } : {},
@@ -2714,13 +2878,13 @@ function en(e, r, t) {
2714
2878
  }
2715
2879
  if (a === "paragraph") {
2716
2880
  I(o, n, ["type", "text", "evidenceIds"], t);
2717
- const i = A(o.evidenceIds, `${n}.evidenceIds`, t);
2881
+ const i = D(o.evidenceIds, `${n}.evidenceIds`, t);
2718
2882
  return {
2719
2883
  type: "paragraph",
2720
- text: x(
2884
+ text: $(
2721
2885
  o.text,
2722
2886
  `${n}.text`,
2723
- y.contentText,
2887
+ h.contentText,
2724
2888
  t
2725
2889
  ),
2726
2890
  ...i ? { evidenceIds: i } : {}
@@ -2728,45 +2892,45 @@ function en(e, r, t) {
2728
2892
  }
2729
2893
  if (a === "finding") {
2730
2894
  I(o, n, ["type", "title", "text", "severity", "evidenceIds"], t);
2731
- const i = $(
2895
+ const i = x(
2732
2896
  o.title,
2733
2897
  `${n}.title`,
2734
- y.contentTitle,
2898
+ h.contentTitle,
2735
2899
  t
2736
- ), l = D(
2900
+ ), l = O(
2737
2901
  o.severity,
2738
2902
  `${n}.severity`,
2739
- zr,
2903
+ an,
2740
2904
  "info, positive, warning, or critical",
2741
2905
  t
2742
2906
  );
2743
2907
  return {
2744
2908
  type: "finding",
2745
2909
  ...i ? { title: i } : {},
2746
- text: x(
2910
+ text: $(
2747
2911
  o.text,
2748
2912
  `${n}.text`,
2749
- y.contentText,
2913
+ h.contentText,
2750
2914
  t
2751
2915
  ),
2752
2916
  ...l ? { severity: l } : {},
2753
- evidenceIds: A(o.evidenceIds, `${n}.evidenceIds`, t, {
2917
+ evidenceIds: D(o.evidenceIds, `${n}.evidenceIds`, t, {
2754
2918
  required: !0
2755
2919
  }) ?? []
2756
2920
  };
2757
2921
  }
2758
2922
  if (a === "bullets" || a === "actions" || a === "limitations") {
2759
2923
  I(o, n, ["type", "title", "items", "evidenceIds"], t);
2760
- const i = $(
2924
+ const i = x(
2761
2925
  o.title,
2762
2926
  `${n}.title`,
2763
- y.contentTitle,
2927
+ h.contentTitle,
2764
2928
  t
2765
- ), l = A(o.evidenceIds, `${n}.evidenceIds`, t);
2929
+ ), l = D(o.evidenceIds, `${n}.evidenceIds`, t);
2766
2930
  return {
2767
2931
  type: a,
2768
2932
  ...i ? { title: i } : {},
2769
- items: Yr(o.items, `${n}.items`, t),
2933
+ items: yn(o.items, `${n}.items`, t),
2770
2934
  ...l ? { evidenceIds: l } : {}
2771
2935
  };
2772
2936
  }
@@ -2786,41 +2950,41 @@ function en(e, r, t) {
2786
2950
  ],
2787
2951
  t
2788
2952
  );
2789
- const i = O(o.value, `${n}.value`, t) ?? "";
2953
+ const i = K(o.value, `${n}.value`, t) ?? "";
2790
2954
  i === "" && f(
2791
2955
  t,
2792
2956
  `${n}.value`,
2793
2957
  "Expected a non-empty string, number, or structured numeric value."
2794
2958
  );
2795
- const l = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : O(
2959
+ const l = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : K(
2796
2960
  o.previousValue,
2797
2961
  `${n}.previousValue`,
2798
2962
  t
2799
- ), m = o.delta === void 0 || o.delta === null ? o.delta : O(
2963
+ ), d = o.delta === void 0 || o.delta === null ? o.delta : K(
2800
2964
  o.delta,
2801
2965
  `${n}.delta`,
2802
2966
  t
2803
- ), c = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : O(
2967
+ ), c = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : K(
2804
2968
  o.percentChange,
2805
2969
  `${n}.percentChange`,
2806
2970
  t
2807
- ), s = $(
2971
+ ), s = x(
2808
2972
  o.unit,
2809
2973
  `${n}.unit`,
2810
- y.contentTitle,
2974
+ h.contentTitle,
2811
2975
  t
2812
- ), u = A(o.evidenceIds, `${n}.evidenceIds`, t);
2976
+ ), u = D(o.evidenceIds, `${n}.evidenceIds`, t);
2813
2977
  return {
2814
2978
  type: "metric",
2815
- label: x(
2979
+ label: $(
2816
2980
  o.label,
2817
2981
  `${n}.label`,
2818
- y.contentTitle,
2982
+ h.contentTitle,
2819
2983
  t
2820
2984
  ),
2821
2985
  value: i,
2822
2986
  ...l !== void 0 ? { previousValue: l } : {},
2823
- ...m !== void 0 ? { delta: m } : {},
2987
+ ...d !== void 0 ? { delta: d } : {},
2824
2988
  ...c !== void 0 ? { percentChange: c } : {},
2825
2989
  ...s ? { unit: s } : {},
2826
2990
  ...u ? { evidenceIds: u } : {}
@@ -2828,10 +2992,10 @@ function en(e, r, t) {
2828
2992
  }
2829
2993
  if (a === "kpi_grid") {
2830
2994
  I(o, n, ["type", "title", "tiles", "evidenceIds"], t);
2831
- const i = $(
2995
+ const i = x(
2832
2996
  o.title,
2833
2997
  `${n}.title`,
2834
- y.contentTitle,
2998
+ h.contentTitle,
2835
2999
  t
2836
3000
  ), l = Array.isArray(o.tiles) ? o.tiles : [];
2837
3001
  Array.isArray(o.tiles) || f(t, `${n}.tiles`, "Expected an array."), l.length === 0 && f(t, `${n}.tiles`, "Expected at least one tile."), l.length > R.maxKpiTiles && f(
@@ -2839,10 +3003,10 @@ function en(e, r, t) {
2839
3003
  `${n}.tiles`,
2840
3004
  `Must have ${R.maxKpiTiles} tiles or fewer.`
2841
3005
  );
2842
- const m = l.slice(0, R.maxKpiTiles).map((s, u) => {
2843
- const p = `${n}.tiles.${u}`, d = k(s, p, t);
3006
+ const d = l.slice(0, R.maxKpiTiles).map((s, u) => {
3007
+ const p = `${n}.tiles.${u}`, m = k(s, p, t);
2844
3008
  I(
2845
- d,
3009
+ m,
2846
3010
  p,
2847
3011
  [
2848
3012
  "label",
@@ -2855,53 +3019,53 @@ function en(e, r, t) {
2855
3019
  ],
2856
3020
  t
2857
3021
  );
2858
- const v = O(
2859
- d.value,
3022
+ const g = K(
3023
+ m.value,
2860
3024
  `${p}.value`,
2861
3025
  t
2862
3026
  ) ?? "";
2863
- v === "" && f(
3027
+ g === "" && f(
2864
3028
  t,
2865
3029
  `${p}.value`,
2866
3030
  "Expected a non-empty string, number, or structured numeric value."
2867
3031
  );
2868
- const h = d.previousValue === void 0 || d.previousValue === null ? d.previousValue : O(
2869
- d.previousValue,
3032
+ const y = m.previousValue === void 0 || m.previousValue === null ? m.previousValue : K(
3033
+ m.previousValue,
2870
3034
  `${p}.previousValue`,
2871
3035
  t
2872
- ), b = d.delta === void 0 || d.delta === null ? d.delta : O(
2873
- d.delta,
3036
+ ), b = m.delta === void 0 || m.delta === null ? m.delta : K(
3037
+ m.delta,
2874
3038
  `${p}.delta`,
2875
3039
  t
2876
- ), w = d.percentChange === void 0 || d.percentChange === null ? d.percentChange : O(
2877
- d.percentChange,
3040
+ ), C = m.percentChange === void 0 || m.percentChange === null ? m.percentChange : K(
3041
+ m.percentChange,
2878
3042
  `${p}.percentChange`,
2879
3043
  t
2880
- ), g = $(
2881
- d.unit,
3044
+ ), v = x(
3045
+ m.unit,
2882
3046
  `${p}.unit`,
2883
- y.contentTitle,
3047
+ h.contentTitle,
2884
3048
  t
2885
- ), T = A(
2886
- d.evidenceIds,
3049
+ ), w = D(
3050
+ m.evidenceIds,
2887
3051
  `${p}.evidenceIds`,
2888
3052
  t
2889
3053
  );
2890
3054
  return {
2891
- label: x(
2892
- d.label,
3055
+ label: $(
3056
+ m.label,
2893
3057
  `${p}.label`,
2894
- y.contentTitle,
3058
+ h.contentTitle,
2895
3059
  t
2896
3060
  ),
2897
- value: v,
2898
- ...h !== void 0 ? { previousValue: h } : {},
3061
+ value: g,
3062
+ ...y !== void 0 ? { previousValue: y } : {},
2899
3063
  ...b !== void 0 ? { delta: b } : {},
2900
- ...w !== void 0 ? { percentChange: w } : {},
2901
- ...g ? { unit: g } : {},
2902
- ...T ? { evidenceIds: T } : {}
3064
+ ...C !== void 0 ? { percentChange: C } : {},
3065
+ ...v ? { unit: v } : {},
3066
+ ...w ? { evidenceIds: w } : {}
2903
3067
  };
2904
- }), c = A(
3068
+ }), c = D(
2905
3069
  o.evidenceIds,
2906
3070
  `${n}.evidenceIds`,
2907
3071
  t
@@ -2909,7 +3073,7 @@ function en(e, r, t) {
2909
3073
  return {
2910
3074
  type: "kpi_grid",
2911
3075
  ...i ? { title: i } : {},
2912
- tiles: m,
3076
+ tiles: d,
2913
3077
  ...c ? { evidenceIds: c } : {}
2914
3078
  };
2915
3079
  }
@@ -2917,23 +3081,23 @@ function en(e, r, t) {
2917
3081
  I(o, n, ["type", "label", "value", "detail", "evidenceIds"], t);
2918
3082
  const i = typeof o.value == "number" && Number.isFinite(o.value) ? o.value : 0;
2919
3083
  (typeof o.value != "number" || !Number.isFinite(o.value)) && f(t, `${n}.value`, "Expected a finite number.");
2920
- const l = $(
3084
+ const l = x(
2921
3085
  o.detail,
2922
3086
  `${n}.detail`,
2923
- y.contentText,
3087
+ h.contentText,
2924
3088
  t
2925
- ), m = A(o.evidenceIds, `${n}.evidenceIds`, t);
3089
+ ), d = D(o.evidenceIds, `${n}.evidenceIds`, t);
2926
3090
  return {
2927
3091
  type: "progress",
2928
- label: x(
3092
+ label: $(
2929
3093
  o.label,
2930
3094
  `${n}.label`,
2931
- y.contentTitle,
3095
+ h.contentTitle,
2932
3096
  t
2933
3097
  ),
2934
3098
  value: i,
2935
3099
  ...l ? { detail: l } : {},
2936
- ...m ? { evidenceIds: m } : {}
3100
+ ...d ? { evidenceIds: d } : {}
2937
3101
  };
2938
3102
  }
2939
3103
  if (a === "table") {
@@ -2943,32 +3107,32 @@ function en(e, r, t) {
2943
3107
  ["type", "id", "title", "columns", "rows", "caption", "totalRows", "evidenceIds"],
2944
3108
  t
2945
3109
  );
2946
- const i = Jr(o.columns, `${n}.columns`, t), l = $(
3110
+ const i = vn(o.columns, `${n}.columns`, t), l = x(
2947
3111
  o.title,
2948
3112
  `${n}.title`,
2949
- y.contentTitle,
3113
+ h.contentTitle,
2950
3114
  t
2951
- ), m = $(
3115
+ ), d = x(
2952
3116
  o.id,
2953
3117
  `${n}.id`,
2954
- y.id,
3118
+ h.id,
2955
3119
  t
2956
- ), c = $(
3120
+ ), c = x(
2957
3121
  o.caption,
2958
3122
  `${n}.caption`,
2959
- y.contentItem,
3123
+ h.contentItem,
2960
3124
  t
2961
- ), s = Ur(
3125
+ ), s = mn(
2962
3126
  o.totalRows,
2963
3127
  `${n}.totalRows`,
2964
3128
  t
2965
- ), u = A(o.evidenceIds, `${n}.evidenceIds`, t);
3129
+ ), u = D(o.evidenceIds, `${n}.evidenceIds`, t);
2966
3130
  return {
2967
3131
  type: "table",
2968
- ...m ? { id: m } : {},
3132
+ ...d ? { id: d } : {},
2969
3133
  ...l ? { title: l } : {},
2970
3134
  columns: i,
2971
- rows: Xr(o.rows, `${n}.rows`, i, t),
3135
+ rows: bn(o.rows, `${n}.rows`, i, t),
2972
3136
  ...c ? { caption: c } : {},
2973
3137
  ...s !== void 0 ? { totalRows: s } : {},
2974
3138
  ...u ? { evidenceIds: u } : {}
@@ -2976,38 +3140,38 @@ function en(e, r, t) {
2976
3140
  }
2977
3141
  if (a === "evidence_appendix") {
2978
3142
  I(o, n, ["type", "title", "evidenceIds"], t);
2979
- const i = $(
3143
+ const i = x(
2980
3144
  o.title,
2981
3145
  `${n}.title`,
2982
- y.contentTitle,
3146
+ h.contentTitle,
2983
3147
  t
2984
3148
  );
2985
3149
  return {
2986
3150
  type: "evidence_appendix",
2987
3151
  ...i ? { title: i } : {},
2988
- evidenceIds: A(o.evidenceIds, `${n}.evidenceIds`, t, {
3152
+ evidenceIds: D(o.evidenceIds, `${n}.evidenceIds`, t, {
2989
3153
  required: !0
2990
3154
  }) ?? []
2991
3155
  };
2992
3156
  }
2993
3157
  if (a === "sql") {
2994
3158
  I(o, n, ["type", "title", "sql", "evidenceIds"], t);
2995
- const i = $(
3159
+ const i = x(
2996
3160
  o.title,
2997
3161
  `${n}.title`,
2998
- y.contentTitle,
3162
+ h.contentTitle,
2999
3163
  t
3000
- ), l = x(
3164
+ ), l = $(
3001
3165
  o.sql,
3002
3166
  `${n}.sql`,
3003
- y.contentSql,
3167
+ h.contentSql,
3004
3168
  t
3005
- ), m = A(o.evidenceIds, `${n}.evidenceIds`, t);
3169
+ ), d = D(o.evidenceIds, `${n}.evidenceIds`, t);
3006
3170
  return {
3007
3171
  type: "sql",
3008
3172
  ...i ? { title: i } : {},
3009
3173
  sql: l,
3010
- ...m ? { evidenceIds: m } : {}
3174
+ ...d ? { evidenceIds: d } : {}
3011
3175
  };
3012
3176
  }
3013
3177
  return f(
@@ -3019,18 +3183,18 @@ function en(e, r, t) {
3019
3183
  text: ""
3020
3184
  };
3021
3185
  }
3022
- function tn(e) {
3186
+ function Cn(e) {
3023
3187
  const r = [], t = k(e, "content", r);
3024
3188
  I(t, "content", ["version", "title", "summary", "blocks"], r), t.version !== 1 && f(r, "content.version", "Expected version 1.");
3025
- const n = $(
3189
+ const n = x(
3026
3190
  t.title,
3027
3191
  "content.title",
3028
- y.contentTitle,
3192
+ h.contentTitle,
3029
3193
  r
3030
- ), o = $(
3194
+ ), o = x(
3031
3195
  t.summary,
3032
3196
  "content.summary",
3033
- y.contentSummary,
3197
+ h.contentSummary,
3034
3198
  r
3035
3199
  );
3036
3200
  Array.isArray(t.blocks) || f(r, "content.blocks", "Expected an array.");
@@ -3040,38 +3204,38 @@ function tn(e) {
3040
3204
  "content.blocks",
3041
3205
  `Must have ${R.maxBlocks} blocks or fewer.`
3042
3206
  );
3043
- const i = a.slice(0, R.maxBlocks).map((l, m) => en(l, m, r));
3044
- return ve(r), {
3207
+ const i = a.slice(0, R.maxBlocks).map((l, d) => In(l, d, r));
3208
+ return Te(r), {
3045
3209
  version: 1,
3046
3210
  ...n ? { title: n } : {},
3047
3211
  ...o ? { summary: o } : {},
3048
3212
  blocks: i
3049
3213
  };
3050
3214
  }
3051
- function bo(e) {
3215
+ function No(e) {
3052
3216
  try {
3053
3217
  return {
3054
3218
  valid: !0,
3055
- value: tn(e),
3219
+ value: Cn(e),
3056
3220
  issues: []
3057
3221
  };
3058
3222
  } catch (r) {
3059
- if (r instanceof ee)
3223
+ if (r instanceof oe)
3060
3224
  return { valid: !1, issues: r.issues };
3061
3225
  throw r;
3062
3226
  }
3063
3227
  }
3064
- function Z(e, r, t, n) {
3228
+ function J(e, r, t, n) {
3065
3229
  return typeof e == "string" && t.includes(e) ? e : (f(n, r, `Expected ${t.join(" or ")}.`), t[0]);
3066
3230
  }
3067
- function D(e, r, t, n, o) {
3231
+ function O(e, r, t, n, o) {
3068
3232
  if (e != null) {
3069
3233
  if (typeof e == "string" && t.has(e))
3070
3234
  return e;
3071
3235
  f(o, r, `Expected ${n}.`);
3072
3236
  }
3073
3237
  }
3074
- function rn(e, r, t) {
3238
+ function Tn(e, r, t) {
3075
3239
  if (e != null) {
3076
3240
  if (!Array.isArray(e)) {
3077
3241
  f(t, r, "Expected an array.");
@@ -3080,27 +3244,27 @@ function rn(e, r, t) {
3080
3244
  return e;
3081
3245
  }
3082
3246
  }
3083
- function nn(e, r, t) {
3247
+ function wn(e, r, t) {
3084
3248
  if (e != null) {
3085
- if (!Ue(e)) {
3249
+ if (!rt(e)) {
3086
3250
  f(t, r, "Expected an object.");
3087
3251
  return;
3088
3252
  }
3089
3253
  return e;
3090
3254
  }
3091
3255
  }
3092
- function on(e, r, t) {
3256
+ function $n(e, r, t) {
3093
3257
  if (e == null)
3094
3258
  return;
3095
3259
  const n = k(e, r, t);
3096
- I(n, r, qr, t);
3260
+ I(n, r, sn, t);
3097
3261
  const o = {};
3098
3262
  if (n.matrix !== void 0) {
3099
3263
  const c = k(n.matrix, `${r}.matrix`, t);
3100
3264
  I(c, `${r}.matrix`, ["config", "content"], t);
3101
- const s = it.safeParse(c.config);
3265
+ const s = gt.safeParse(c.config);
3102
3266
  s.success || f(t, `${r}.matrix.config`, "Expected a valid Matrix definition.");
3103
- const u = D(
3267
+ const u = O(
3104
3268
  c.content,
3105
3269
  `${r}.matrix.content`,
3106
3270
  /* @__PURE__ */ new Set(["current", "all", "flat"]),
@@ -3109,32 +3273,32 @@ function on(e, r, t) {
3109
3273
  );
3110
3274
  u || f(t, `${r}.matrix.content`, "Choose Matrix export content."), s.success && u && (o.matrix = { config: s.data, content: u });
3111
3275
  }
3112
- const a = D(
3276
+ const a = O(
3113
3277
  n.pageSize,
3114
3278
  `${r}.pageSize`,
3115
- Br,
3279
+ en,
3116
3280
  "letter, legal, a4, a3, or tabloid",
3117
3281
  t
3118
- ), i = D(
3282
+ ), i = O(
3119
3283
  n.orientation,
3120
3284
  `${r}.orientation`,
3121
- Dr,
3285
+ tn,
3122
3286
  "portrait or landscape",
3123
3287
  t
3124
- ), l = D(
3288
+ ), l = O(
3125
3289
  n.delimiter,
3126
3290
  `${r}.delimiter`,
3127
- Or,
3291
+ rn,
3128
3292
  "comma, semicolon, or tab",
3129
3293
  t
3130
- ), m = D(
3294
+ ), d = O(
3131
3295
  n.sheetSelection,
3132
3296
  `${r}.sheetSelection`,
3133
- Kr,
3297
+ nn,
3134
3298
  "current or all",
3135
3299
  t
3136
3300
  );
3137
- a && (o.pageSize = a), i && (o.orientation = i), l && (o.delimiter = l), m && (o.sheetSelection = m);
3301
+ a && (o.pageSize = a), i && (o.orientation = i), l && (o.delimiter = l), d && (o.sheetSelection = d);
3138
3302
  for (const c of [
3139
3303
  "includeFilters",
3140
3304
  "includeTimestamp",
@@ -3157,10 +3321,10 @@ function on(e, r, t) {
3157
3321
  "cardType",
3158
3322
  "theme"
3159
3323
  ]) {
3160
- const s = $(
3324
+ const s = x(
3161
3325
  n[c],
3162
3326
  `${r}.${c}`,
3163
- y.id,
3327
+ h.id,
3164
3328
  t
3165
3329
  );
3166
3330
  s && (o[c] = s);
@@ -3173,7 +3337,7 @@ function on(e, r, t) {
3173
3337
  "cardControlDefinitions",
3174
3338
  "controlBindings"
3175
3339
  ]) {
3176
- const s = rn(n[c], `${r}.${c}`, t);
3340
+ const s = Tn(n[c], `${r}.${c}`, t);
3177
3341
  s && (o[c] = s);
3178
3342
  }
3179
3343
  for (const c of [
@@ -3182,29 +3346,29 @@ function on(e, r, t) {
3182
3346
  "dashboardInputExecutionSnapshot",
3183
3347
  "printInputCapture"
3184
3348
  ]) {
3185
- const s = nn(n[c], `${r}.${c}`, t);
3349
+ const s = wn(n[c], `${r}.${c}`, t);
3186
3350
  s && (o[c] = s);
3187
3351
  }
3188
3352
  return Object.keys(o).length > 0 ? o : void 0;
3189
3353
  }
3190
- function ae(e, r, t, n) {
3191
- const o = $(
3354
+ function se(e, r, t, n) {
3355
+ const o = x(
3192
3356
  r,
3193
3357
  t,
3194
- y.attachmentTitle,
3358
+ h.attachmentTitle,
3195
3359
  n
3196
3360
  );
3197
3361
  return o && (e.title = o), e;
3198
3362
  }
3199
- function ie(e, r, t, n) {
3200
- const o = on(r, t, n);
3363
+ function de(e, r, t, n) {
3364
+ const o = $n(r, t, n);
3201
3365
  return o != null && o.printInputCapture && e.type !== "dashboard" && f(
3202
3366
  n,
3203
3367
  `${t}.printInputCapture`,
3204
3368
  "Only a full dashboard attachment can carry printInputCapture."
3205
3369
  ), o && (e.settings = o), e;
3206
3370
  }
3207
- function an(e, r, t) {
3371
+ function xn(e, r, t) {
3208
3372
  const n = `attachments.${r}`, o = k(e, n, t), a = o.type;
3209
3373
  if (a === "dashboard") {
3210
3374
  I(
@@ -3213,22 +3377,22 @@ function an(e, r, t) {
3213
3377
  ["type", "dashboardId", "format", "title", "settings"],
3214
3378
  t
3215
3379
  );
3216
- const i = ae(
3380
+ const i = se(
3217
3381
  {
3218
3382
  type: "dashboard",
3219
- dashboardId: x(
3383
+ dashboardId: $(
3220
3384
  o.dashboardId,
3221
3385
  `${n}.dashboardId`,
3222
- y.id,
3386
+ h.id,
3223
3387
  t
3224
3388
  ),
3225
- format: Z(o.format, `${n}.format`, ["pdf"], t)
3389
+ format: J(o.format, `${n}.format`, ["pdf"], t)
3226
3390
  },
3227
3391
  o.title,
3228
3392
  `${n}.title`,
3229
3393
  t
3230
3394
  );
3231
- return ie(i, o.settings, `${n}.settings`, t);
3395
+ return de(i, o.settings, `${n}.settings`, t);
3232
3396
  }
3233
3397
  if (a === "dashboard_sheet" || a === "document_sheet") {
3234
3398
  I(
@@ -3237,28 +3401,28 @@ function an(e, r, t) {
3237
3401
  ["type", "dashboardId", "sheetId", "format", "title", "settings"],
3238
3402
  t
3239
3403
  );
3240
- const i = ae(
3404
+ const i = se(
3241
3405
  {
3242
3406
  type: a,
3243
- dashboardId: x(
3407
+ dashboardId: $(
3244
3408
  o.dashboardId,
3245
3409
  `${n}.dashboardId`,
3246
- y.id,
3410
+ h.id,
3247
3411
  t
3248
3412
  ),
3249
- sheetId: x(
3413
+ sheetId: $(
3250
3414
  o.sheetId,
3251
3415
  `${n}.sheetId`,
3252
- y.id,
3416
+ h.id,
3253
3417
  t
3254
3418
  ),
3255
- format: Z(o.format, `${n}.format`, ["pdf"], t)
3419
+ format: J(o.format, `${n}.format`, ["pdf"], t)
3256
3420
  },
3257
3421
  o.title,
3258
3422
  `${n}.title`,
3259
3423
  t
3260
3424
  );
3261
- return ie(i, o.settings, `${n}.settings`, t);
3425
+ return de(i, o.settings, `${n}.settings`, t);
3262
3426
  }
3263
3427
  if (a === "card") {
3264
3428
  I(
@@ -3267,22 +3431,22 @@ function an(e, r, t) {
3267
3431
  ["type", "dashboardId", "cardId", "format", "title", "settings"],
3268
3432
  t
3269
3433
  );
3270
- const i = ae(
3434
+ const i = se(
3271
3435
  {
3272
3436
  type: "card",
3273
- dashboardId: x(
3437
+ dashboardId: $(
3274
3438
  o.dashboardId,
3275
3439
  `${n}.dashboardId`,
3276
- y.id,
3440
+ h.id,
3277
3441
  t
3278
3442
  ),
3279
- cardId: x(
3443
+ cardId: $(
3280
3444
  o.cardId,
3281
3445
  `${n}.cardId`,
3282
- y.id,
3446
+ h.id,
3283
3447
  t
3284
3448
  ),
3285
- format: Z(
3449
+ format: J(
3286
3450
  o.format,
3287
3451
  `${n}.format`,
3288
3452
  ["csv", "pdf"],
@@ -3293,7 +3457,7 @@ function an(e, r, t) {
3293
3457
  `${n}.title`,
3294
3458
  t
3295
3459
  );
3296
- return ie(i, o.settings, `${n}.settings`, t);
3460
+ return de(i, o.settings, `${n}.settings`, t);
3297
3461
  }
3298
3462
  return f(
3299
3463
  t,
@@ -3301,7 +3465,7 @@ function an(e, r, t) {
3301
3465
  "Expected dashboard, dashboard_sheet, document_sheet, or card."
3302
3466
  ), { type: "dashboard", dashboardId: "", format: "pdf" };
3303
3467
  }
3304
- function cn(e) {
3468
+ function kn(e) {
3305
3469
  switch (e.type) {
3306
3470
  case "dashboard":
3307
3471
  return `${e.type}:${e.dashboardId}:${e.format}`;
@@ -3312,35 +3476,35 @@ function cn(e) {
3312
3476
  return `${e.type}:${e.dashboardId}:${e.cardId}:${e.format}`;
3313
3477
  }
3314
3478
  }
3315
- function Ze(e, r) {
3479
+ function ct(e, r) {
3316
3480
  if (e == null)
3317
3481
  return [];
3318
3482
  if (!Array.isArray(e))
3319
3483
  return f(r, "attachments", "Expected an array."), [];
3320
- e.length > ne && f(
3484
+ e.length > ce && f(
3321
3485
  r,
3322
3486
  "attachments",
3323
- `Choose ${ne} attachments or fewer.`
3487
+ `Choose ${ce} attachments or fewer.`
3324
3488
  );
3325
- const t = e.slice(0, ne).map((o, a) => an(o, a, r)), n = /* @__PURE__ */ new Set();
3489
+ const t = e.slice(0, ce).map((o, a) => xn(o, a, r)), n = /* @__PURE__ */ new Set();
3326
3490
  return t.forEach((o, a) => {
3327
3491
  var l;
3328
3492
  (l = o.settings) != null && l.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format !== "csv") && f(r, `attachments.${a}.settings.matrix`, "Matrix settings require a matrixTable card attachment; flat content requires CSV.");
3329
- const i = cn(o);
3493
+ const i = kn(o);
3330
3494
  n.has(i) && f(r, `attachments.${a}`, "Duplicate attachment."), n.add(i);
3331
3495
  }), t;
3332
3496
  }
3333
- function Qe(e, r) {
3497
+ function lt(e, r) {
3334
3498
  if (e == null)
3335
3499
  return;
3336
3500
  const t = k(e, "limits", r);
3337
- I(t, "limits", Object.keys(oe), r);
3501
+ I(t, "limits", Object.keys(le), r);
3338
3502
  const n = {};
3339
- return Object.keys(oe).forEach((o) => {
3503
+ return Object.keys(le).forEach((o) => {
3340
3504
  const a = t[o];
3341
3505
  if (a == null)
3342
3506
  return;
3343
- const i = oe[o];
3507
+ const i = le[o];
3344
3508
  if (typeof a != "number" || !Number.isInteger(a) || a < i.min || a > i.max) {
3345
3509
  f(
3346
3510
  r,
@@ -3352,40 +3516,40 @@ function Qe(e, r) {
3352
3516
  n[o] = a;
3353
3517
  }), Object.keys(n).length > 0 ? n : void 0;
3354
3518
  }
3355
- function ve(e) {
3519
+ function Te(e) {
3356
3520
  if (e.length > 0)
3357
- throw new ee(e);
3521
+ throw new oe(e);
3358
3522
  }
3359
- function Je(e, r, t) {
3523
+ function st(e, r, t) {
3360
3524
  !(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && r.length === 0 && f(
3361
3525
  t,
3362
3526
  "body",
3363
3527
  "Add briefing instructions, a custom message, or at least one attachment."
3364
3528
  );
3365
3529
  }
3366
- function ln(e, r, t) {
3530
+ function En(e, r, t) {
3367
3531
  e == null || e.forEach((n, o) => {
3368
3532
  const a = `${t}.${o}.scope`, i = n.scope.attachmentIndex;
3369
3533
  if (i === void 0)
3370
- throw new j(
3534
+ throw new G(
3371
3535
  `${a}.attachmentIndex must identify the attachment that owns this presentation entry.`
3372
3536
  );
3373
3537
  const l = r[i];
3374
3538
  if (!l)
3375
- throw new j(
3539
+ throw new G(
3376
3540
  `${a}.attachmentIndex must identify an existing attachment.`
3377
3541
  );
3378
3542
  if (n.scope.dashboardId !== l.dashboardId)
3379
- throw new j(
3543
+ throw new G(
3380
3544
  `${a}.dashboardId must match the dashboard selected by the referenced attachment.`
3381
3545
  );
3382
3546
  if (l.type === "card" && n.scope.cardId !== l.cardId)
3383
- throw new j(
3547
+ throw new G(
3384
3548
  `${a}.cardId must match the card selected by the referenced attachment.`
3385
3549
  );
3386
3550
  });
3387
3551
  }
3388
- function Xe(e) {
3552
+ function dt(e) {
3389
3553
  const r = [], t = k(e, "jobConfig", r);
3390
3554
  I(
3391
3555
  t,
@@ -3400,14 +3564,14 @@ function Xe(e) {
3400
3564
  "limits"
3401
3565
  ],
3402
3566
  r
3403
- ), t.kind !== de && f(r, "kind", "Expected BRIEFING.");
3567
+ ), t.kind !== fe && f(r, "kind", "Expected BRIEFING.");
3404
3568
  let n;
3405
3569
  try {
3406
- n = ht(
3570
+ n = Et(
3407
3571
  t.presentationExecutionSnapshot
3408
3572
  );
3409
3573
  } catch (c) {
3410
- if (c instanceof j)
3574
+ if (c instanceof G)
3411
3575
  throw c;
3412
3576
  f(
3413
3577
  r,
@@ -3415,70 +3579,70 @@ function Xe(e) {
3415
3579
  c instanceof Error ? c.message : "Invalid presentation snapshot."
3416
3580
  );
3417
3581
  }
3418
- const o = Ge(t.source, r), a = He(t.body, r), i = Ze(t.attachments, r), l = We(t.presentation, r), m = Qe(t.limits, r);
3419
- return Je(a, i, r), ln(
3582
+ const o = nt(t.source, r), a = ot(t.body, r), i = ct(t.attachments, r), l = at(t.presentation, r), d = lt(t.limits, r);
3583
+ return st(a, i, r), En(
3420
3584
  n == null ? void 0 : n.resolvedFormats,
3421
3585
  i,
3422
3586
  "jobConfig.presentationExecutionSnapshot.resolvedFormats"
3423
- ), ve(r), {
3424
- kind: de,
3587
+ ), Te(r), {
3588
+ kind: fe,
3425
3589
  presentationExecutionSnapshot: n,
3426
3590
  source: o,
3427
3591
  body: a,
3428
3592
  attachments: i,
3429
3593
  presentation: l,
3430
- ...m ? { limits: m } : {}
3594
+ ...d ? { limits: d } : {}
3431
3595
  };
3432
3596
  }
3433
- function Io(e) {
3434
- return Xe({
3597
+ function Lo(e) {
3598
+ return dt({
3435
3599
  ...e,
3436
- kind: de
3600
+ kind: fe
3437
3601
  });
3438
3602
  }
3439
- function be(e, r, t, n = "deliveryConfig.recipients") {
3603
+ function we(e, r, t, n = "deliveryConfig.recipients") {
3440
3604
  const o = `${n}.${r}`, a = k(e, o, t), i = a.type;
3441
3605
  if (i === "email") {
3442
3606
  I(a, o, ["type", "address", "name"], t);
3443
- const l = x(
3607
+ const l = $(
3444
3608
  a.address,
3445
3609
  `${o}.address`,
3446
- y.id,
3610
+ h.id,
3447
3611
  t
3448
- ), m = $(
3612
+ ), d = x(
3449
3613
  a.name,
3450
3614
  `${o}.name`,
3451
- y.attachmentTitle,
3615
+ h.attachmentTitle,
3452
3616
  t
3453
3617
  );
3454
- return l && !Hr(l) && f(t, `${o}.address`, "Email address is invalid."), {
3618
+ return l && !fn(l) && f(t, `${o}.address`, "Email address is invalid."), {
3455
3619
  type: "email",
3456
3620
  address: l,
3457
- ...m ? { name: m } : {}
3621
+ ...d ? { name: d } : {}
3458
3622
  };
3459
3623
  }
3460
3624
  return i === "user" ? (I(a, o, ["type", "userId"], t), {
3461
3625
  type: "user",
3462
- userId: x(
3626
+ userId: $(
3463
3627
  a.userId,
3464
3628
  `${o}.userId`,
3465
- y.id,
3629
+ h.id,
3466
3630
  t
3467
3631
  )
3468
3632
  }) : i === "tenant_user" ? (I(a, o, ["type", "tenantUserId"], t), {
3469
3633
  type: "tenant_user",
3470
- tenantUserId: x(
3634
+ tenantUserId: $(
3471
3635
  a.tenantUserId,
3472
3636
  `${o}.tenantUserId`,
3473
- y.id,
3637
+ h.id,
3474
3638
  t
3475
3639
  )
3476
3640
  }) : i === "group" ? (I(a, o, ["type", "groupId"], t), {
3477
3641
  type: "group",
3478
- groupId: x(
3642
+ groupId: $(
3479
3643
  a.groupId,
3480
3644
  `${o}.groupId`,
3481
- y.id,
3645
+ h.id,
3482
3646
  t
3483
3647
  )
3484
3648
  }) : (f(
@@ -3487,17 +3651,17 @@ function be(e, r, t, n = "deliveryConfig.recipients") {
3487
3651
  "Expected email, user, tenant_user, or group."
3488
3652
  ), { type: "email", address: "" });
3489
3653
  }
3490
- function dn(e, r) {
3654
+ function Sn(e, r) {
3491
3655
  return e == null ? [] : Array.isArray(e) ? e.map(
3492
- (t, n) => be(t, n, r)
3656
+ (t, n) => we(t, n, r)
3493
3657
  ) : (f(r, "deliveryConfig.recipients", "Expected an array."), []);
3494
3658
  }
3495
- function sn(e, r) {
3659
+ function _n(e, r) {
3496
3660
  if (!Array.isArray(e))
3497
3661
  return f(r, "deliveryConfig.channels", "Expected an array."), [];
3498
3662
  const t = [];
3499
3663
  return e.forEach((n, o) => {
3500
- if (!et(n)) {
3664
+ if (!mt(n)) {
3501
3665
  f(
3502
3666
  r,
3503
3667
  `deliveryConfig.channels.${o}`,
@@ -3508,7 +3672,7 @@ function sn(e, r) {
3508
3672
  t.includes(n) || t.push(n);
3509
3673
  }), t;
3510
3674
  }
3511
- function mn(e, r, t) {
3675
+ function Fn(e, r, t) {
3512
3676
  if (e == null)
3513
3677
  return;
3514
3678
  const n = k(e, r, t), o = {};
@@ -3520,7 +3684,7 @@ function mn(e, r, t) {
3520
3684
  o[a] = i.trim();
3521
3685
  }), Object.keys(o).length > 0 ? o : void 0;
3522
3686
  }
3523
- function un(e, r, t) {
3687
+ function Rn(e, r, t) {
3524
3688
  if (e == null)
3525
3689
  return;
3526
3690
  const n = k(e, r, t);
@@ -3530,20 +3694,20 @@ function un(e, r, t) {
3530
3694
  ["url", "method", "headers", "secretEncrypted"],
3531
3695
  t
3532
3696
  );
3533
- const o = n.method === void 0 || n.method === null ? void 0 : Z(n.method, `${r}.method`, ["POST", "PUT"], t), a = mn(n.headers, `${r}.headers`, t), i = $(
3697
+ const o = n.method === void 0 || n.method === null ? void 0 : J(n.method, `${r}.method`, ["POST", "PUT"], t), a = Fn(n.headers, `${r}.headers`, t), i = x(
3534
3698
  n.secretEncrypted,
3535
3699
  `${r}.secretEncrypted`,
3536
3700
  2e3,
3537
3701
  t
3538
3702
  );
3539
3703
  return {
3540
- url: x(n.url, `${r}.url`, 2e3, t),
3704
+ url: $(n.url, `${r}.url`, 2e3, t),
3541
3705
  ...o ? { method: o } : {},
3542
3706
  ...a ? { headers: a } : {},
3543
3707
  ...i ? { secretEncrypted: i } : {}
3544
3708
  };
3545
3709
  }
3546
- function fn(e, r, t) {
3710
+ function An(e, r, t) {
3547
3711
  const n = k(e, r, t), o = n.type;
3548
3712
  if (o === "channel") {
3549
3713
  I(
@@ -3552,10 +3716,10 @@ function fn(e, r, t) {
3552
3716
  ["type", "channelId", "channelName", "isPrivate"],
3553
3717
  t
3554
3718
  );
3555
- const a = $(
3719
+ const a = x(
3556
3720
  n.channelName,
3557
3721
  `${r}.channelName`,
3558
- y.attachmentTitle,
3722
+ h.attachmentTitle,
3559
3723
  t
3560
3724
  ), i = n.isPrivate === void 0 || n.isPrivate === null ? void 0 : z(
3561
3725
  n.isPrivate,
@@ -3565,10 +3729,10 @@ function fn(e, r, t) {
3565
3729
  );
3566
3730
  return {
3567
3731
  type: "channel",
3568
- channelId: x(
3732
+ channelId: $(
3569
3733
  n.channelId,
3570
3734
  `${r}.channelId`,
3571
- y.id,
3735
+ h.id,
3572
3736
  t
3573
3737
  ),
3574
3738
  ...a ? { channelName: a } : {},
@@ -3581,10 +3745,10 @@ function fn(e, r, t) {
3581
3745
  "Slack DM delivery is not supported in V1."
3582
3746
  ), {
3583
3747
  type: "dm",
3584
- recipient: be(n.recipient, 0, t, `${r}.recipient`)
3748
+ recipient: we(n.recipient, 0, t, `${r}.recipient`)
3585
3749
  }) : (f(t, `${r}.type`, "Expected channel."), { type: "channel", channelId: "" });
3586
3750
  }
3587
- function pn(e, r, t) {
3751
+ function Dn(e, r, t) {
3588
3752
  if (e == null)
3589
3753
  return;
3590
3754
  if (!Array.isArray(e)) {
@@ -3592,11 +3756,11 @@ function pn(e, r, t) {
3592
3756
  return;
3593
3757
  }
3594
3758
  const n = e.map(
3595
- (o, a) => be(o, a, t, r)
3759
+ (o, a) => we(o, a, t, r)
3596
3760
  );
3597
3761
  return n.length > 0 ? n : void 0;
3598
3762
  }
3599
- function yn(e, r, t) {
3763
+ function Mn(e, r, t) {
3600
3764
  if (e == null)
3601
3765
  return;
3602
3766
  const n = k(e, r, t);
@@ -3612,7 +3776,7 @@ function yn(e, r, t) {
3612
3776
  ],
3613
3777
  t
3614
3778
  );
3615
- const o = pn(
3779
+ const o = Dn(
3616
3780
  n.threadMentions,
3617
3781
  `${r}.threadMentions`,
3618
3782
  t
@@ -3633,7 +3797,7 @@ function yn(e, r, t) {
3633
3797
  t
3634
3798
  );
3635
3799
  return {
3636
- destination: fn(
3800
+ destination: An(
3637
3801
  n.destination,
3638
3802
  `${r}.destination`,
3639
3803
  t
@@ -3644,7 +3808,7 @@ function yn(e, r, t) {
3644
3808
  ...n.includeBriefingLink !== void 0 ? { includeBriefingLink: l } : {}
3645
3809
  };
3646
3810
  }
3647
- function hn(e, r, t) {
3811
+ function Pn(e, r, t) {
3648
3812
  const n = k(e, r, t);
3649
3813
  I(
3650
3814
  n,
@@ -3660,37 +3824,37 @@ function hn(e, r, t) {
3660
3824
  ],
3661
3825
  t
3662
3826
  );
3663
- const o = D(
3827
+ const o = O(
3664
3828
  n.formatProfile,
3665
3829
  `${r}.formatProfile`,
3666
- Nr,
3830
+ on,
3667
3831
  "concise, balanced, or detailed",
3668
3832
  t
3669
- ), a = $(
3833
+ ), a = x(
3670
3834
  n.subjectOverride,
3671
3835
  `${r}.subjectOverride`,
3672
3836
  500,
3673
3837
  t
3674
- ), i = $(
3838
+ ), i = x(
3675
3839
  n.titleOverride,
3676
3840
  `${r}.titleOverride`,
3677
3841
  500,
3678
3842
  t
3679
- ), l = $(
3843
+ ), l = x(
3680
3844
  n.summaryOverride,
3681
3845
  `${r}.summaryOverride`,
3682
3846
  2e3,
3683
3847
  t
3684
- ), m = z(
3848
+ ), d = z(
3685
3849
  n.actionBlockVisible,
3686
3850
  !0,
3687
3851
  `${r}.actionBlockVisible`,
3688
3852
  t
3689
- ), c = un(
3853
+ ), c = Rn(
3690
3854
  n.webhookConfig,
3691
3855
  `${r}.webhookConfig`,
3692
3856
  t
3693
- ), s = yn(
3857
+ ), s = Mn(
3694
3858
  n.slackConfig,
3695
3859
  `${r}.slackConfig`,
3696
3860
  t
@@ -3700,17 +3864,17 @@ function hn(e, r, t) {
3700
3864
  ...a ? { subjectOverride: a } : {},
3701
3865
  ...i ? { titleOverride: i } : {},
3702
3866
  ...l ? { summaryOverride: l } : {},
3703
- ...n.actionBlockVisible !== void 0 ? { actionBlockVisible: m } : {},
3867
+ ...n.actionBlockVisible !== void 0 ? { actionBlockVisible: d } : {},
3704
3868
  ...s ? { slackConfig: s } : {},
3705
3869
  ...c ? { webhookConfig: c } : {}
3706
3870
  };
3707
3871
  }
3708
- function gn(e, r) {
3872
+ function Bn(e, r) {
3709
3873
  if (e == null)
3710
3874
  return;
3711
3875
  const t = k(e, "deliveryConfig.channelConfigs", r), n = {};
3712
3876
  return Object.entries(t).forEach(([o, a]) => {
3713
- if (!et(o)) {
3877
+ if (!mt(o)) {
3714
3878
  f(
3715
3879
  r,
3716
3880
  `deliveryConfig.channelConfigs.${o}`,
@@ -3718,15 +3882,15 @@ function gn(e, r) {
3718
3882
  );
3719
3883
  return;
3720
3884
  }
3721
- n[o] = hn(
3885
+ n[o] = Pn(
3722
3886
  a,
3723
3887
  `deliveryConfig.channelConfigs.${o}`,
3724
3888
  r
3725
3889
  );
3726
3890
  }), Object.keys(n).length > 0 ? n : void 0;
3727
3891
  }
3728
- function vn(e, r) {
3729
- var m, c, s;
3892
+ function On(e, r) {
3893
+ var d, c, s;
3730
3894
  if (e == null)
3731
3895
  return null;
3732
3896
  const t = k(e, "deliveryConfig", r);
@@ -3736,7 +3900,7 @@ function vn(e, r) {
3736
3900
  ["recipients", "channels", "channelConfigs"],
3737
3901
  r
3738
3902
  );
3739
- const n = gn(t.channelConfigs, r), o = dn(t.recipients, r), a = sn(t.channels, r), i = ((c = (m = n == null ? void 0 : n.SLACK) == null ? void 0 : m.slackConfig) == null ? void 0 : c.destination.type) === "channel" && !!n.SLACK.slackConfig.destination.channelId.trim();
3903
+ const n = Bn(t.channelConfigs, r), o = Sn(t.recipients, r), a = _n(t.channels, r), i = ((c = (d = n == null ? void 0 : n.SLACK) == null ? void 0 : d.slackConfig) == null ? void 0 : c.destination.type) === "channel" && !!n.SLACK.slackConfig.destination.channelId.trim();
3740
3904
  return a.some(
3741
3905
  (u) => u !== "SLACK"
3742
3906
  ) && o.length === 0 && f(
@@ -3761,7 +3925,7 @@ function vn(e, r) {
3761
3925
  ...n ? { channelConfigs: n } : {}
3762
3926
  };
3763
3927
  }
3764
- function Ie(e) {
3928
+ function $e(e) {
3765
3929
  const r = [], t = k(e, "draft", r);
3766
3930
  I(
3767
3931
  t,
@@ -3781,149 +3945,154 @@ function Ie(e) {
3781
3945
  ],
3782
3946
  r
3783
3947
  );
3784
- const n = x(
3948
+ const n = $(
3785
3949
  t.name,
3786
3950
  "name",
3787
- y.name,
3951
+ h.name,
3788
3952
  r
3789
- ), o = $(
3953
+ ), o = x(
3790
3954
  t.description,
3791
3955
  "description",
3792
- y.description,
3956
+ h.description,
3793
3957
  r
3794
- ) ?? null, a = $(t.scheduleExpr, "scheduleExpr", 500, r) ?? null, i = $(t.timezone, "timezone", 200, r) ?? "UTC", l = Gr(t.status, r), m = Ge(t.source, r), c = He(t.body, r), s = Ze(t.attachments, r), u = We(t.presentation, r), p = Qe(t.limits, r), d = vn(t.deliveryConfig, r);
3795
- return Je(c, s, r), ve(r), {
3958
+ ) ?? null, a = x(t.scheduleExpr, "scheduleExpr", 500, r) ?? null, i = x(t.timezone, "timezone", 200, r) ?? "UTC", l = un(t.status, r), d = nt(t.source, r), c = ot(t.body, r), s = ct(t.attachments, r), u = at(t.presentation, r), p = lt(t.limits, r), m = On(t.deliveryConfig, r);
3959
+ return st(c, s, r), Te(r), {
3796
3960
  name: n,
3797
3961
  description: o,
3798
3962
  status: l,
3799
3963
  scheduleExpr: a,
3800
3964
  timezone: i,
3801
- source: m,
3965
+ source: d,
3802
3966
  body: c,
3803
3967
  attachments: s,
3804
3968
  presentation: u,
3805
3969
  ...p ? { limits: p } : {},
3806
- deliveryConfig: d
3970
+ deliveryConfig: m
3807
3971
  };
3808
3972
  }
3809
- function wo(e) {
3810
- return Ie(e);
3973
+ function zo(e) {
3974
+ return $e(e);
3811
3975
  }
3812
- function Co(e) {
3813
- return Ie(e);
3976
+ function qo(e) {
3977
+ return $e(e);
3814
3978
  }
3815
- function To(e) {
3979
+ function Vo(e) {
3816
3980
  try {
3817
- return { valid: !0, value: Ie(e), issues: [] };
3981
+ return { valid: !0, value: $e(e), issues: [] };
3818
3982
  } catch (r) {
3819
- if (r instanceof ee)
3983
+ if (r instanceof oe)
3820
3984
  return { valid: !1, issues: r.issues };
3821
3985
  throw r;
3822
3986
  }
3823
3987
  }
3824
- function xo(e) {
3988
+ function Uo(e) {
3825
3989
  try {
3826
- return { valid: !0, value: Xe(e), issues: [] };
3990
+ return { valid: !0, value: dt(e), issues: [] };
3827
3991
  } catch (r) {
3828
- if (r instanceof ee)
3992
+ if (r instanceof oe)
3829
3993
  return { valid: !1, issues: r.issues };
3830
3994
  throw r;
3831
3995
  }
3832
3996
  }
3833
- function $o(e) {
3834
- return typeof e == "string" && je.has(e);
3997
+ function jo(e) {
3998
+ return typeof e == "string" && tt.has(e);
3835
3999
  }
3836
- function et(e) {
3837
- return typeof e == "string" && Mr.has(e);
4000
+ function mt(e) {
4001
+ return typeof e == "string" && Jr.has(e);
3838
4002
  }
3839
4003
  export {
3840
- kr as $,
3841
- Hn as A,
3842
- oo as B,
3843
- hr as C,
3844
- io as D,
3845
- lo as E,
3846
- X as F,
3847
- Gt as G,
3848
- Kn as H,
3849
- Yn as I,
3850
- N as J,
3851
- qn as K,
3852
- Nt as L,
3853
- qt as M,
3854
- jt as N,
3855
- tr as O,
3856
- er as P,
3857
- ye as Q,
3858
- Yt as R,
3859
- Wn as S,
3860
- zn as T,
3861
- jn as U,
3862
- Un as V,
3863
- Gn as W,
3864
- Ke as X,
3865
- S as Y,
3866
- ao as Z,
3867
- uo as _,
3868
- ho as a,
3869
- fo as a0,
3870
- mo as a1,
3871
- _r as a2,
3872
- yo as a3,
3873
- Jt as a4,
3874
- nr as a5,
3875
- Ne as a6,
3876
- Qn as a7,
3877
- so as a8,
3878
- Kt as a9,
3879
- de as aa,
3880
- Rr as ab,
3881
- se as ac,
3882
- ne as ad,
3883
- y as ae,
3884
- R as af,
3885
- Ar as ag,
3886
- Pr as ah,
3887
- vo as ai,
3888
- ee as aj,
3889
- tn as ak,
3890
- bo as al,
3891
- Xe as am,
3892
- Io as an,
3893
- Ie as ao,
3894
- wo as ap,
3895
- Co as aq,
3896
- To as ar,
3897
- xo as as,
3898
- $o as at,
3899
- et as au,
3900
- co as av,
3901
- vr as aw,
3902
- gr as ax,
3903
- Fr as ay,
3904
- dr as b,
3905
- cr as c,
3906
- po as d,
3907
- eo as e,
3908
- sr as f,
3909
- go as g,
3910
- ro as h,
3911
- xe as i,
3912
- to as j,
3913
- lr as k,
3914
- no as l,
3915
- Le as m,
3916
- W as n,
3917
- Jn as o,
3918
- he as p,
3919
- Xn as q,
3920
- mr as r,
3921
- Lt as s,
3922
- On as t,
3923
- Vn as u,
3924
- Vt as v,
3925
- Ln as w,
3926
- Zn as x,
3927
- Nn as y,
3928
- Be as z
4004
+ Pr as $,
4005
+ fo as A,
4006
+ $o as B,
4007
+ Er as C,
4008
+ ko as D,
4009
+ So as E,
4010
+ ne as F,
4011
+ nr as G,
4012
+ no as H,
4013
+ yo as I,
4014
+ L as J,
4015
+ lo as K,
4016
+ Zt as L,
4017
+ er as M,
4018
+ tr as N,
4019
+ ur as O,
4020
+ Yt as P,
4021
+ mr as Q,
4022
+ be as R,
4023
+ ir as S,
4024
+ po as T,
4025
+ ao as U,
4026
+ so as V,
4027
+ mo as W,
4028
+ uo as X,
4029
+ Ve as Y,
4030
+ S as Z,
4031
+ xo as _,
4032
+ vr as a,
4033
+ Je as a0,
4034
+ Ro as a1,
4035
+ q as a2,
4036
+ Do as a3,
4037
+ jr as a4,
4038
+ Mo as a5,
4039
+ Qe as a6,
4040
+ Fo as a7,
4041
+ Wr as a8,
4042
+ Po as a9,
4043
+ Eo as aA,
4044
+ _r as aB,
4045
+ Sr as aC,
4046
+ Yr as aD,
4047
+ sr as aa,
4048
+ pr as ab,
4049
+ Ue as ac,
4050
+ go as ad,
4051
+ _o as ae,
4052
+ fe as af,
4053
+ Zr as ag,
4054
+ pe as ah,
4055
+ ce as ai,
4056
+ h as aj,
4057
+ R as ak,
4058
+ Qr as al,
4059
+ Xr as am,
4060
+ Ko as an,
4061
+ oe as ao,
4062
+ Cn as ap,
4063
+ No as aq,
4064
+ dt as ar,
4065
+ Lo as as,
4066
+ $e as at,
4067
+ zo as au,
4068
+ qo as av,
4069
+ Vo as aw,
4070
+ Uo as ax,
4071
+ jo as ay,
4072
+ mt as az,
4073
+ Io as b,
4074
+ br as c,
4075
+ Oo as d,
4076
+ Ao as e,
4077
+ Cr as f,
4078
+ Ir as g,
4079
+ Bo as h,
4080
+ Se as i,
4081
+ Z as j,
4082
+ To as k,
4083
+ Co as l,
4084
+ Ge as m,
4085
+ wo as n,
4086
+ vo as o,
4087
+ Ie as p,
4088
+ bo as q,
4089
+ Tr as r,
4090
+ Xt as s,
4091
+ ro as t,
4092
+ co as u,
4093
+ Jt as v,
4094
+ io as w,
4095
+ ho as x,
4096
+ Le as y,
4097
+ oo as z
3929
4098
  };