react-semaphor 0.1.564 → 0.1.566

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 (138) hide show
  1. package/DATA_APP_SDK.md +3 -3
  2. package/README.md +2 -2
  3. package/dist/analytics-protocol/index.js +8 -8
  4. package/dist/assistant-context/index.js +3 -2
  5. package/dist/brand-studio/index.js +28 -29
  6. package/dist/briefings/index.js +53 -49
  7. package/dist/chunks/{assistant-chat-D1BEEHUF.js → assistant-chat-DNKAYSQL.js} +204 -204
  8. package/dist/chunks/{bookmark-impact-XOsVUAqW.js → bookmark-impact-BeUbq0jc.js} +2 -2
  9. package/dist/chunks/bookmark-state-ByODVqee.js +1613 -0
  10. package/dist/chunks/card-filter-builder-SXaRWbKr.js +4100 -0
  11. package/dist/chunks/{switch-BW4yXSYs.js → code-editor-DJNOsgJH.js} +463 -442
  12. package/dist/chunks/{comparison-window-caption-D1EUXzaR.js → comparison-window-caption-CMLb3mut.js} +451 -419
  13. package/dist/chunks/{dashboard-DfYsASNd.js → dashboard-Cni7nGhg.js} +1 -1
  14. package/dist/chunks/dashboard-briefing-launcher-CXeXRTem.js +4910 -0
  15. package/dist/chunks/{dashboard-controls-CJ8Dz50D.js → dashboard-controls-CsqKybrf.js} +685 -675
  16. package/dist/chunks/{dashboard-json-D3uZxGO-.js → dashboard-json-WWmw3Piu.js} +4 -4
  17. package/dist/chunks/{dates-EvDtT25n.js → dates-DJRUS-he.js} +12 -12
  18. package/dist/chunks/{edit-dashboard-visual-CgHJXBQv.js → edit-dashboard-visual-BrIEaBhc.js} +7724 -10341
  19. package/dist/chunks/filter-reach-copy-D5LqgrUf.js +4667 -0
  20. package/dist/chunks/{filter-value-text-CPwFkrMz.js → filter-value-text-7zhmth1S.js} +2 -2
  21. package/dist/chunks/{index-CAgf2x4E.js → index-Bq9UbCGk.js} +653 -574
  22. package/dist/chunks/{layout-grid-BM65viQh.js → layout-grid-0hIlqEtk.js} +1 -1
  23. package/dist/chunks/{list-filter-BoeLBfL3.js → list-filter-DkgoCeBm.js} +1 -1
  24. package/dist/chunks/{matrix-analytical-definition-hEucouWM.js → matrix-analytical-definition-C9xB_T84.js} +18 -18
  25. package/dist/chunks/{matrix-card-CCh9JjP1.js → matrix-card-BSUeSXpD.js} +2 -2
  26. package/dist/chunks/{matrix-member-presentation-DsAUbuoL.js → matrix-member-presentation-DZNgQpUq.js} +1 -1
  27. package/dist/chunks/{matrix-operation-contract-DsLdFdSa.js → matrix-operation-contract-Eb6elidS.js} +1 -1
  28. package/dist/chunks/{metric-comparison-Bnso1cm1.js → metric-comparison-ChXUFaZu.js} +1 -1
  29. package/dist/chunks/{palette-p1XSJFgB.js → palette-4vf2BEEg.js} +1 -1
  30. package/dist/chunks/{pivot-result-contract-expectations-B53jqszr.js → pivot-result-contract-expectations-Ddh1rNz5.js} +4 -4
  31. package/dist/chunks/{pivot-result-identity-Dq5jm-EC.js → pivot-result-identity-BlbLrqaC.js} +1 -1
  32. package/dist/chunks/{report-preferences-dialog-DMqxSU4X.js → report-preferences-dialog-CeHioJwL.js} +122 -131
  33. package/dist/chunks/{report-runtime-context-BITkNSDa.js → report-runtime-context-DnA_PiKo.js} +1 -1
  34. package/dist/chunks/resolve-dashboard-input-context-CwS-2r-b.js +21419 -0
  35. package/dist/chunks/{save-CHV1B1fL.js → save-D6pHmSSP.js} +1 -1
  36. package/dist/chunks/saved-dashboard-context-c-MZZTx2.js +629 -0
  37. package/dist/chunks/{selection-reducer-Bz5aywT4.js → selection-reducer-OaJ-N5uN.js} +1 -1
  38. package/dist/chunks/{semaphor-ready-indicator-CFeCIuaw.js → semaphor-ready-indicator-B2NpYRE-.js} +81034 -80950
  39. package/dist/chunks/{shelf-drop-preview-context-cEyVkKTF.js → shelf-drop-preview-context-DM7yypwC.js} +407 -407
  40. package/dist/chunks/{source-entity-resolution-DdDVXFB8.js → source-entity-resolution-DF6GulDn.js} +1 -1
  41. package/dist/chunks/stored-dashboard-DTWc2pzt.js +5026 -0
  42. package/dist/chunks/{table-export-sheet-bSXxGn-v.js → table-export-sheet--DUKWk6o.js} +1 -1
  43. package/dist/chunks/{temporal-input-presentation-sk9gqLi6.js → temporal-input-presentation--2r9BLr0.js} +392 -377
  44. package/dist/chunks/{token-types-BUK06hU2.js → token-types-C8JymO8s.js} +1 -1
  45. package/dist/chunks/{upload-BnmuyPqW.js → upload-Cf3wXZT8.js} +1 -1
  46. package/dist/chunks/{validators-BIM0FE31.js → validators-wtjw0aw6.js} +7 -7
  47. package/dist/chunks/variable-draft-DFizFCJu.js +241 -0
  48. package/dist/dashboard/index.js +2 -2
  49. package/dist/dashboard-authoring/index.js +2324 -1796
  50. package/dist/data-app-sdk/index.js +4 -4
  51. package/dist/data-app-sdk-adapters/index.js +2 -2
  52. package/dist/data-app-sdk-validation/index.js +5 -5
  53. package/dist/format-utils/index.js +174 -167
  54. package/dist/index.js +189 -187
  55. package/dist/pdf-export-policy/index.js +80 -28
  56. package/dist/pdf-table-layout/index.js +65 -65
  57. package/dist/report-runtime-context/index.js +1 -1
  58. package/dist/style.css +1 -1
  59. package/dist/surfboard/index.js +2 -2
  60. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  61. package/dist/types/briefings/delivery-outcome.d.ts +37 -0
  62. package/dist/types/briefings/index.d.ts +2 -0
  63. package/dist/types/briefings/run-outcomes.d.ts +6 -0
  64. package/dist/types/components/briefings/briefing-author/run-model.d.ts +9 -0
  65. package/dist/types/components/dashboard-variables/data-variables-menu.d.ts +8 -0
  66. package/dist/types/components/dashboard-variables/variable-editor-host.d.ts +1 -0
  67. package/dist/types/components/index.d.ts +2 -0
  68. package/dist/types/index.js +5 -5
  69. package/dist/types/lib/dashboard-inputs/build-normalized-dashboard-inputs.d.ts +62 -0
  70. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +33 -2
  71. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +7 -2
  72. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +4 -2
  73. package/dist/types/lib/dashboard-variables/data-text.d.ts +33 -0
  74. package/dist/types/lib/dashboard-variables/types.d.ts +207 -0
  75. package/dist/types/lib/document/document-edits.d.ts +16 -1
  76. package/dist/types/lib/document/document-panel-target.d.ts +1 -1
  77. package/dist/types/lib/document/document-section-query-options.d.ts +29 -0
  78. package/dist/types/lib/document/document-table-data-policy.d.ts +0 -1
  79. package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +92 -0
  80. package/dist/types/lib/query-context/build-card-query-context.d.ts +6 -0
  81. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +15 -3
  82. package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +1 -0
  83. package/dist/types/lib/query-context/use-semantic-execution-payload-for-cards.d.ts +24 -0
  84. package/dist/types/lib/stores/dashboard-store.d.ts +36 -0
  85. package/dist/types/lib/text-variables/temporal-input-text.d.ts +28 -0
  86. package/dist/types/lib/text-variables/text-variable-types.d.ts +72 -0
  87. package/dist/types/lib/types/common-types.d.ts +155 -51
  88. package/dist/types/lib/utils/card-definition.d.ts +2 -2
  89. package/dist/types/shared/assistant-context/index.d.ts +1 -1
  90. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +51 -1
  91. package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +7 -1
  92. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +10 -0
  93. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  94. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +1087 -430
  95. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +20 -1
  96. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +1 -1
  97. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +10 -0
  98. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +40 -40
  99. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -16
  100. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +1 -0
  101. package/dist/types/shared/dashboard-authoring/dashboard-filter-sql-subscription.d.ts +24 -0
  102. package/dist/types/shared/dashboard-authoring/dashboard-filter-targets.d.ts +29 -0
  103. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +7 -4
  104. package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +159 -0
  105. package/dist/types/shared/dashboard-authoring/dashboard-variable-changes.d.ts +61 -0
  106. package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +7 -0
  107. package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +2 -0
  108. package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +10 -0
  109. package/dist/types/shared/dashboard-authoring/index.d.ts +6 -0
  110. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +2 -0
  111. package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +1 -1
  112. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +50 -3
  113. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +48 -1
  114. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +22 -6
  115. package/dist/types/shared/dashboard-authoring/text-card-words/blocks.d.ts +87 -13
  116. package/dist/types/shared/dashboard-authoring/text-card-words/chip-colors.d.ts +23 -0
  117. package/dist/types/shared/dashboard-authoring/text-card-words/index.d.ts +90 -8
  118. package/dist/types/shared/dashboard-authoring/text-card-words/rich-content.d.ts +31 -3
  119. package/dist/types/shared/dashboard-authoring/text-card-words/variable-words.d.ts +8 -0
  120. package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +125 -0
  121. package/dist/types/shared/dashboard-authoring/variable-editability.d.ts +24 -0
  122. package/dist/types/shared/dashboard-authoring/variable-references.d.ts +39 -0
  123. package/dist/types/shared/format-utils/document-print.d.ts +4 -2
  124. package/dist/types/shared/format-utils/index.d.ts +1 -0
  125. package/dist/types/shared/format-utils/pdf-capacity-lines.d.ts +17 -0
  126. package/dist/types/shared/format-utils/pdf-delivery.d.ts +8 -1
  127. package/dist/types/shared/format-utils/pdf-export-policy.d.ts +74 -6
  128. package/dist/types/shared/format-utils/presentation-execution.d.ts +9 -0
  129. package/package.json +2 -2
  130. package/src/data-app-sdk/README.md +3 -3
  131. package/dist/chunks/bookmark-state-CWeoGbrx.js +0 -743
  132. package/dist/chunks/braces-DzgoQC64.js +0 -23
  133. package/dist/chunks/dashboard-briefing-launcher-lvYfJoUQ.js +0 -3878
  134. package/dist/chunks/filter-reach-copy-Cmb05jlE.js +0 -3965
  135. package/dist/chunks/global-date-filter-utils-ruJYwjgZ.js +0 -16733
  136. package/dist/chunks/resolve-dashboard-input-context-i_jCSYae.js +0 -8214
  137. package/dist/chunks/saved-dashboard-context-Dg3oDmH_.js +0 -564
  138. package/dist/chunks/use-create-flow-overlay-state-Dl6DCxh8.js +0 -1436
@@ -1,22 +1,22 @@
1
1
  var De = Object.defineProperty;
2
- var _e = (e, n, t) => n in e ? De(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
- var R = (e, n, t) => _e(e, typeof n != "symbol" ? n + "" : n, t);
4
- import { as as Oe, W as Fe, ag as re, N as le, j as Ne, V as Re, R as N } from "./temporal-input-presentation-sk9gqLi6.js";
5
- import { a9 as W, H as Me, o as Be } from "./validators-BIM0FE31.js";
6
- import { l as Le, C as Ue } from "./export-file-format-C-tJsxsf.js";
2
+ var Oe = (e, n, t) => n in e ? De(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
+ var M = (e, n, t) => Oe(e, typeof n != "symbol" ? n + "" : n, t);
4
+ import { at as Ne, W as Fe, ah as oe, N as se, j as Re, V as Me, R as F } from "./temporal-input-presentation--2r9BLr0.js";
5
+ import { a9 as X, H as Le, o as Be } from "./validators-wtjw0aw6.js";
6
+ import { l as Ue, C as Pe } from "./export-file-format-C-tJsxsf.js";
7
7
  import { z as y } from "zod";
8
- import { ah as Pe, aj as Ve, X as ze } from "./matrix-operation-contract-DsLdFdSa.js";
8
+ import { ah as Ve, aj as ze, X as je } from "./matrix-operation-contract-Eb6elidS.js";
9
9
  import "./analytics-base-schemas-BaIQrEzX.js";
10
10
  import "../value-format-preferences/index.js";
11
- import { r as je } from "./rendered-file-D8xEuVVx.js";
12
- import { Q as qe, R as Ke, S as He, T as Ge, n as We, U as Xe, V as Ze, W as Ye, X as Je, Y as Qe, Z as et, _ as tt, $ as nt } from "./global-date-filter-utils-ruJYwjgZ.js";
13
- import { r as rt } from "./matrix-card-CCh9JjP1.js";
14
- import { A as ot } from "./bookmark-state-CWeoGbrx.js";
11
+ import { r as qe } from "./rendered-file-D8xEuVVx.js";
12
+ import { J as Ke, K as Ge, L as He, M as We, n as Xe, N as Ze, O as Ye, P as Je, Q as Qe, R as et, S as tt, T as nt } from "./resolve-dashboard-input-context-CwS-2r-b.js";
13
+ import { r as rt } from "./matrix-card-BSUeSXpD.js";
14
+ import { G as ot, H as at } from "./bookmark-state-ByODVqee.js";
15
15
  import "./index-CuHybtft.js";
16
16
  import "./_commonjsHelpers-DimLPMtv.js";
17
17
  import "./index-RNaTnE3m.js";
18
18
  import "./context-R31TSL5V.js";
19
- const at = /* @__PURE__ */ new Set(["table", "detailTable"]), it = /* @__PURE__ */ new Set([
19
+ const it = /* @__PURE__ */ new Set(["table", "detailTable"]), ct = /* @__PURE__ */ new Set([
20
20
  "bar",
21
21
  "horizontalBar",
22
22
  "line",
@@ -44,30 +44,30 @@ const at = /* @__PURE__ */ new Set(["table", "detailTable"]), it = /* @__PURE__
44
44
  "treemap",
45
45
  "custom"
46
46
  ]);
47
- function qn(e) {
47
+ function Zn(e) {
48
48
  var o, a, i;
49
- const n = it.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
49
+ const n = ct.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
50
50
  let t = !1;
51
51
  try {
52
52
  t = !!rt(e);
53
53
  } catch {
54
54
  return { formats: [], defaultFormat: null };
55
55
  }
56
- return e.type === "text" || !n || !t && qe(e) ? { formats: [], defaultFormat: null } : {
56
+ return e.type === "text" || !n || !t && Ke(e) ? { formats: [], defaultFormat: null } : {
57
57
  formats: dt({
58
58
  cardType: e.type,
59
59
  allowDownload: (a = e.preferences) == null ? void 0 : a.allowDownload
60
60
  }).filter((c) => c !== "xlsx" || e.type !== "matrixTable" || t),
61
- defaultFormat: st({
61
+ defaultFormat: mt({
62
62
  cardType: e.type,
63
63
  allowDownload: (i = e.preferences) == null ? void 0 : i.allowDownload
64
64
  })
65
65
  };
66
66
  }
67
- function X(e) {
67
+ function Z(e) {
68
68
  return e === "table" || e === "detailTable";
69
69
  }
70
- function ct(e) {
70
+ function lt(e) {
71
71
  var t, r;
72
72
  if (e.type !== "card")
73
73
  return { kind: "rendered", format: e.format };
@@ -79,33 +79,33 @@ function ct(e) {
79
79
  return n ? { kind: "matrix_pdf" } : { kind: "rendered", format: "pdf" };
80
80
  case "csv":
81
81
  case "xlsx":
82
- return n || X((r = e.settings) == null ? void 0 : r.cardType) ? { kind: "export_job", format: e.format } : { kind: "rendered", format: "csv" };
82
+ return n || Z((r = e.settings) == null ? void 0 : r.cardType) ? { kind: "export_job", format: e.format } : { kind: "rendered", format: "csv" };
83
83
  }
84
84
  }
85
- function Kn(e) {
86
- return ct(e).kind === "export_job";
85
+ function Yn(e) {
86
+ return lt(e).kind === "export_job";
87
87
  }
88
- function lt(e) {
89
- const { label: n, extension: t, contentType: r } = e === "pdf" || e === "png" ? je(e) : Le(e);
88
+ function st(e) {
89
+ const { label: n, extension: t, contentType: r } = e === "pdf" || e === "png" ? qe(e) : Ue(e);
90
90
  return { label: n, extension: t, contentType: r };
91
91
  }
92
92
  function dt(e) {
93
- return e.allowDownload === !1 ? ["pdf", "png"] : e.cardType === "matrixTable" || X(e.cardType) ? ["pdf", "png", "csv", "xlsx"] : ["pdf", "png", "csv"];
93
+ return e.allowDownload === !1 ? ["pdf", "png"] : e.cardType === "matrixTable" || Z(e.cardType) ? ["pdf", "png", "csv", "xlsx"] : ["pdf", "png", "csv"];
94
94
  }
95
- function Hn(e) {
96
- return lt(e).label;
95
+ function Jn(e) {
96
+ return st(e).label;
97
97
  }
98
- function st(e) {
99
- return at.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
98
+ function mt(e) {
99
+ return it.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
100
100
  }
101
- function Gn(e) {
102
- const { config: n } = e, t = Oe({
101
+ function Qn(e) {
102
+ const { config: n } = e, t = Ne({
103
103
  spec: n.spec,
104
104
  presentation: n.presentation,
105
105
  defaults: n.defaultView,
106
106
  session: e.purpose === "manual" ? e.session : void 0
107
107
  });
108
- return W.parse({
108
+ return X.parse({
109
109
  spec: t.spec,
110
110
  presentation: t.presentation,
111
111
  ...e.content === "flat" ? { mode: "flat", format: e.format === "xlsx" ? "xlsx" : "csv" } : {
@@ -119,7 +119,7 @@ function Gn(e) {
119
119
  }
120
120
  });
121
121
  }
122
- const mt = y.object({
122
+ const ut = y.object({
123
123
  connection_id: y.string().min(1),
124
124
  cardType: y.literal("matrixTable"),
125
125
  resultOwner: y.literal("config"),
@@ -134,11 +134,11 @@ const mt = y.object({
134
134
  semanticDomainId: y.string().optional()
135
135
  }).passthrough(),
136
136
  active_filters: y.array(y.unknown()).default([])
137
- }).passthrough(), Wn = mt.extend({
137
+ }).passthrough(), er = ut.extend({
138
138
  dashboardId: y.string().min(1),
139
139
  cardId: y.string().min(1),
140
140
  formatOptions: y.object({
141
- matrix: W,
141
+ matrix: X,
142
142
  acquisition: y.literal("continuation").optional(),
143
143
  presentationExecutionSnapshot: y.unknown()
144
144
  }).passthrough().superRefine((e, n) => {
@@ -149,7 +149,7 @@ const mt = y.object({
149
149
  });
150
150
  })
151
151
  });
152
- function Xn(e) {
152
+ function tr(e) {
153
153
  return {
154
154
  ...e.controls,
155
155
  type: "card",
@@ -184,80 +184,80 @@ function Xn(e) {
184
184
  }
185
185
  };
186
186
  }
187
- const V = y.number().int().nonnegative(), Zn = y.discriminatedUnion("status", [
187
+ const z = y.number().int().nonnegative(), nr = y.discriminatedUnion("status", [
188
188
  y.object({
189
189
  status: y.literal("ok"),
190
- request: W,
191
- layout: Pe,
192
- rows: y.array(Ve).readonly(),
193
- usage: y.object({ rows: V, cells: V, bytes: V }).strict()
190
+ request: X,
191
+ layout: Ve,
192
+ rows: y.array(ze).readonly(),
193
+ usage: y.object({ rows: z, cells: z, bytes: z }).strict()
194
194
  }).strict(),
195
195
  y.object({
196
196
  status: y.literal("failed"),
197
197
  failure: y.object({
198
- code: y.enum(ze),
198
+ code: y.enum(je),
199
199
  limit: y.enum(["rows", "bytes"]).optional(),
200
200
  message: y.string().min(1),
201
201
  retryable: y.boolean()
202
202
  }).strict()
203
203
  }).strict()
204
204
  ]);
205
- function oe(e) {
205
+ function ae(e) {
206
206
  return !e || typeof e != "object" ? !1 : Array.isArray(e.cards);
207
207
  }
208
- function ut(e) {
208
+ function ft(e) {
209
209
  if (!e)
210
210
  return null;
211
211
  if (typeof e == "string")
212
212
  try {
213
213
  const n = JSON.parse(e);
214
- return oe(n) ? n : null;
214
+ return ae(n) ? n : null;
215
215
  } catch {
216
216
  return null;
217
217
  }
218
- return oe(e) ? e : null;
218
+ return ae(e) ? e : null;
219
219
  }
220
220
  function de(e) {
221
221
  var n;
222
222
  return (n = e == null ? void 0 : e.cards) != null && n.length ? e.activeCardId && e.cards.find((t) => t.id === e.activeCardId) || e.cards[0] : null;
223
223
  }
224
- function Yn(e) {
224
+ function rr(e) {
225
225
  var t;
226
226
  const n = (e == null ? void 0 : e.frameObject) ?? ((t = e == null ? void 0 : e.visual) == null ? void 0 : t.frameObject);
227
- return de(ut(n));
227
+ return de(ft(n));
228
228
  }
229
- class M extends Error {
229
+ class L extends Error {
230
230
  constructor(t) {
231
231
  const r = t.cardId ? `card "${t.cardId}"` : t.sheetId ? `sheet "${t.sheetId}"` : `dashboard "${t.dashboardId}"`;
232
232
  super(
233
233
  `Unable to resolve ${r} while capturing report presentation. Refresh the authoring page and select the attachment again.`
234
234
  );
235
- R(this, "code", "temporal_snapshot_target_not_found");
236
- R(this, "selection");
235
+ M(this, "code", "temporal_snapshot_target_not_found");
236
+ M(this, "selection");
237
237
  this.name = "TemporalSnapshotSelectionError", this.selection = t;
238
238
  }
239
239
  }
240
- function ft(e, n) {
240
+ function pt(e, n) {
241
241
  var o;
242
242
  const t = [], r = /* @__PURE__ */ new Map();
243
243
  for (const a of n) {
244
244
  if (a.dashboardId !== e.id)
245
- throw new M(a);
245
+ throw new L(a);
246
246
  const i = (e.sheets || []).filter(
247
247
  (l) => !a.sheetId || a.sheetId === l.id
248
248
  );
249
249
  if (a.sheetId && i.length === 0)
250
- throw new M(a);
250
+ throw new L(a);
251
251
  let c = !a.cardId;
252
252
  for (const l of i) {
253
253
  const m = (((o = l.document) == null ? void 0 : o.sections) || []).flatMap(
254
- (p) => ot(p)
255
- ), s = (l.frames || []).flatMap(
256
- (p) => pt(p, a.cardId)
254
+ (p) => at(p)
255
+ ), d = (l.frames || []).flatMap(
256
+ (p) => ht(p, a.cardId)
257
257
  );
258
- s.length > 0 && (c = !0);
258
+ d.length > 0 && (c = !0);
259
259
  const f = [
260
- ...s,
260
+ ...d,
261
261
  ...(l.cards || []).filter(
262
262
  (p) => !a.cardId || a.cardId === p.id
263
263
  ),
@@ -275,11 +275,11 @@ function ft(e, n) {
275
275
  }
276
276
  }
277
277
  if (!c)
278
- throw new M(a);
278
+ throw new L(a);
279
279
  }
280
280
  return t;
281
281
  }
282
- function pt(e, n) {
282
+ function ht(e, n) {
283
283
  var i;
284
284
  const t = n ? (i = e.cards) == null ? void 0 : i.find((c) => c.id === n) : de(e);
285
285
  if (!t) return [];
@@ -297,11 +297,11 @@ function pt(e, n) {
297
297
  })
298
298
  ).filter((c) => c !== null);
299
299
  }
300
- function Jn(e) {
301
- return ft(e.dashboard, e.selections).flatMap(
300
+ function or(e) {
301
+ return pt(e.dashboard, e.selections).flatMap(
302
302
  ({ card: n, attachmentIndex: t }) => {
303
- var s, f;
304
- const r = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, n)) ?? n.config, o = Ke({
303
+ var d, f;
304
+ const r = ((d = e.resolveCardConfig) == null ? void 0 : d.call(e, n)) ?? n.config, o = Ge({
305
305
  card: n,
306
306
  cardConfig: r
307
307
  }), a = {
@@ -323,25 +323,25 @@ function Jn(e) {
323
323
  },
324
324
  e.valueFormatPreferences.locale
325
325
  )
326
- })) : [], c = [], l = Ge(n, r), m = We(
326
+ })) : [], c = [], l = We(n, r), m = Xe(
327
327
  n.python || ""
328
328
  );
329
329
  if (n.type === "detailTable" && l === "config") {
330
- const p = (r == null ? void 0 : r.detailColumns) || [], g = Xe({
330
+ const p = (r == null ? void 0 : r.detailColumns) || [], g = ot({
331
331
  groupByColumns: r == null ? void 0 : r.groupByColumns,
332
332
  metricColumns: r == null ? void 0 : r.metricColumns,
333
333
  pivotByColumns: r == null ? void 0 : r.pivotByColumns,
334
334
  detailColumns: p
335
335
  });
336
336
  for (const v of p) {
337
- const A = Me(v.dataType);
338
- if (A !== "date" && A !== "datetime") continue;
339
- const F = g.get(v);
340
- if (!F) throw new M(a);
337
+ const k = Le(v.dataType);
338
+ if (k !== "date" && k !== "datetime") continue;
339
+ const N = g.get(v);
340
+ if (!N) throw new L(a);
341
341
  c.push({
342
342
  scope: a,
343
- target: { kind: "column", columnKey: F },
344
- format: re({
343
+ target: { kind: "column", columnKey: N },
344
+ format: oe({
345
345
  // What the table draws: the stored format, or Automatic (ledger P7-07).
346
346
  format: Ze(v),
347
347
  preferences: e.valueFormatPreferences,
@@ -360,7 +360,7 @@ function Jn(e) {
360
360
  v && c.push({
361
361
  scope: a,
362
362
  target: { kind: "column", columnKey: p },
363
- format: re({
363
+ format: oe({
364
364
  format: v,
365
365
  preferences: e.valueFormatPreferences,
366
366
  calendar: e.calendar
@@ -371,11 +371,11 @@ function Jn(e) {
371
371
  }
372
372
  );
373
373
  }
374
- function ht(e) {
374
+ function yt(e) {
375
375
  return !!e && typeof e == "object" && !Array.isArray(e);
376
376
  }
377
- function T(e, n, t) {
378
- return ht(e) ? e : (t.push({ field: n, message: "Expected an object." }), {});
377
+ function x(e, n, t) {
378
+ return yt(e) ? e : (t.push({ field: n, message: "Expected an object." }), {});
379
379
  }
380
380
  function S(e, n, t, r) {
381
381
  const o = new Set(t);
@@ -386,7 +386,7 @@ function S(e, n, t, r) {
386
386
  });
387
387
  });
388
388
  }
389
- function D(e, n, t, r, o = {}) {
389
+ function w(e, n, t, r, o = {}) {
390
390
  if (e == null)
391
391
  return;
392
392
  if (typeof e != "string") {
@@ -407,8 +407,8 @@ function D(e, n, t, r, o = {}) {
407
407
  }
408
408
  return a;
409
409
  }
410
- function Z(e, n, t) {
411
- const r = D(e, n, 2e3, t);
410
+ function Y(e, n, t) {
411
+ const r = w(e, n, 2e3, t);
412
412
  if (r)
413
413
  try {
414
414
  return new URL(r), r;
@@ -417,12 +417,12 @@ function Z(e, n, t) {
417
417
  return;
418
418
  }
419
419
  }
420
- function ae(e, n, t) {
421
- const r = T(e, n, t);
420
+ function ie(e, n, t) {
421
+ const r = x(e, n, t);
422
422
  S(r, n, ["tokens", "components"], t);
423
423
  const o = {};
424
424
  if (r.tokens !== void 0) {
425
- const a = T(r.tokens, `${n}.tokens`, t);
425
+ const a = x(r.tokens, `${n}.tokens`, t);
426
426
  S(
427
427
  a,
428
428
  `${n}.tokens`,
@@ -431,7 +431,7 @@ function ae(e, n, t) {
431
431
  );
432
432
  const i = {};
433
433
  if (a.color !== void 0) {
434
- const c = T(
434
+ const c = x(
435
435
  a.color,
436
436
  `${n}.tokens.color`,
437
437
  t
@@ -450,18 +450,18 @@ function ae(e, n, t) {
450
450
  ];
451
451
  S(c, `${n}.tokens.color`, l, t);
452
452
  const m = {};
453
- l.forEach((s) => {
454
- const f = D(
455
- c[s],
456
- `${n}.tokens.color.${s}`,
453
+ l.forEach((d) => {
454
+ const f = w(
455
+ c[d],
456
+ `${n}.tokens.color.${d}`,
457
457
  120,
458
458
  t
459
459
  );
460
- f !== void 0 && (m[s] = f);
460
+ f !== void 0 && (m[d] = f);
461
461
  }), i.color = m;
462
462
  }
463
463
  if (a.typography !== void 0) {
464
- const c = T(
464
+ const c = x(
465
465
  a.typography,
466
466
  `${n}.tokens.typography`,
467
467
  t
@@ -472,13 +472,13 @@ function ae(e, n, t) {
472
472
  ["fontFamily", "monoFontFamily"],
473
473
  t
474
474
  );
475
- const l = D(
475
+ const l = w(
476
476
  c.fontFamily,
477
477
  `${n}.tokens.typography.fontFamily`,
478
478
  500,
479
479
  t,
480
480
  { allowEmpty: !0 }
481
- ), m = D(
481
+ ), m = w(
482
482
  c.monoFontFamily,
483
483
  `${n}.tokens.typography.monoFontFamily`,
484
484
  500,
@@ -493,13 +493,13 @@ function ae(e, n, t) {
493
493
  o.tokens = i;
494
494
  }
495
495
  if (r.components !== void 0) {
496
- const a = T(
496
+ const a = x(
497
497
  r.components,
498
498
  `${n}.components`,
499
499
  t
500
500
  );
501
501
  if (S(a, `${n}.components`, ["chart"], t), a.chart !== void 0) {
502
- const i = T(
502
+ const i = x(
503
503
  a.chart,
504
504
  `${n}.components.chart`,
505
505
  t
@@ -510,7 +510,7 @@ function ae(e, n, t) {
510
510
  field: `${n}.components.chart.palette`,
511
511
  message: "Expected 20 colors or fewer."
512
512
  }) : c = i.palette.map(
513
- (l, m) => D(
513
+ (l, m) => w(
514
514
  l,
515
515
  `${n}.components.chart.palette.${m}`,
516
516
  120,
@@ -526,22 +526,22 @@ function ae(e, n, t) {
526
526
  }
527
527
  return o;
528
528
  }
529
- function yt(e, n) {
530
- const t = "presentation.appearance", r = T(e, t, n);
529
+ function gt(e, n) {
530
+ const t = "presentation.appearance", r = x(e, t, n);
531
531
  S(r, t, ["version", "schemes"], n);
532
532
  const o = {};
533
533
  if (r.version !== void 0 && (typeof r.version != "number" || !Number.isFinite(r.version) ? n.push({ field: `${t}.version`, message: "Expected a number." }) : o.version = r.version), r.schemes !== void 0) {
534
- const a = T(r.schemes, `${t}.schemes`, n);
534
+ const a = x(r.schemes, `${t}.schemes`, n);
535
535
  S(a, `${t}.schemes`, ["light", "dark"], n), o.schemes = {
536
536
  ...a.light !== void 0 ? {
537
- light: ae(
537
+ light: ie(
538
538
  a.light,
539
539
  `${t}.schemes.light`,
540
540
  n
541
541
  )
542
542
  } : {},
543
543
  ...a.dark !== void 0 ? {
544
- dark: ae(
544
+ dark: ie(
545
545
  a.dark,
546
546
  `${t}.schemes.dark`,
547
547
  n
@@ -551,23 +551,23 @@ function yt(e, n) {
551
551
  }
552
552
  return o;
553
553
  }
554
- function gt(e, n) {
555
- const t = "presentation.brandOverrides", r = T(e, t, n);
554
+ function bt(e, n) {
555
+ const t = "presentation.brandOverrides", r = x(e, t, n);
556
556
  S(r, t, ["brandName", "logoUrl", "link"], n);
557
- const o = D(
557
+ const o = w(
558
558
  r.brandName,
559
559
  `${t}.brandName`,
560
560
  200,
561
561
  n
562
- ), a = Z(r.logoUrl, `${t}.logoUrl`, n), i = D(r.link, `${t}.link`, 120, n);
562
+ ), a = Y(r.logoUrl, `${t}.logoUrl`, n), i = w(r.link, `${t}.link`, 120, n);
563
563
  return {
564
564
  ...o !== void 0 ? { brandName: o } : {},
565
565
  ...a !== void 0 ? { logoUrl: a } : {},
566
566
  ...i !== void 0 ? { link: i } : {}
567
567
  };
568
568
  }
569
- function bt(e, n) {
570
- const t = "presentation.fragments", r = T(e, t, n), o = [
569
+ function Et(e, n) {
570
+ const t = "presentation.fragments", r = x(e, t, n), o = [
571
571
  "preHeaderText",
572
572
  "headerBannerHtml",
573
573
  "signatureHtml",
@@ -578,7 +578,7 @@ function bt(e, n) {
578
578
  S(r, t, o, n);
579
579
  const a = {};
580
580
  return o.forEach((i) => {
581
- const c = i === "unsubscribeUrl" ? Z(r[i], `${t}.${i}`, n) : D(
581
+ const c = i === "unsubscribeUrl" ? Y(r[i], `${t}.${i}`, n) : w(
582
582
  r[i],
583
583
  `${t}.${i}`,
584
584
  i === "preHeaderText" ? 200 : 5e3,
@@ -590,8 +590,8 @@ function bt(e, n) {
590
590
  }
591
591
  function It(e) {
592
592
  const n = [], t = {};
593
- if (e.appearance !== void 0 && (t.appearance = yt(e.appearance, n)), e.brandOverrides !== void 0 && (t.brandOverrides = gt(e.brandOverrides, n)), e.fragments !== void 0 && (t.fragments = bt(e.fragments, n)), e.viewUrl !== void 0) {
594
- const r = Z(e.viewUrl, "presentation.viewUrl", n);
593
+ if (e.appearance !== void 0 && (t.appearance = gt(e.appearance, n)), e.brandOverrides !== void 0 && (t.brandOverrides = bt(e.brandOverrides, n)), e.fragments !== void 0 && (t.fragments = Et(e.fragments, n)), e.viewUrl !== void 0) {
594
+ const r = Y(e.viewUrl, "presentation.viewUrl", n);
595
595
  r !== void 0 && (t.viewUrl = r);
596
596
  }
597
597
  return { value: t, issues: n };
@@ -604,21 +604,21 @@ const B = [
604
604
  "THU",
605
605
  "FRI",
606
606
  "SAT"
607
- ], se = new Map(
607
+ ], me = new Map(
608
608
  B.map((e, n) => [e, n])
609
- ), U = [1, 2, 3, 4, 5], me = [1, 2, 3, 6, 12], ue = {
609
+ ), P = [1, 2, 3, 4, 5], ue = [1, 2, 3, 6, 12], fe = {
610
610
  1: "first",
611
611
  2: "second",
612
612
  3: "third",
613
613
  4: "fourth",
614
614
  [-1]: "last"
615
- }, Qn = {
615
+ }, ar = {
616
616
  frequency: "weekly",
617
617
  hour: 9,
618
618
  minute: 0,
619
619
  weekdays: [1]
620
620
  }, C = { ok: !1, issue: "Choose a supported schedule." };
621
- function Et(e) {
621
+ function vt(e) {
622
622
  if (typeof e != "string" || e.length === 0 || e !== e.trim() || /^(?:(?:UTC|GMT)[+-]|[+-]\d{2}:\d{2}$)/.test(e))
623
623
  return !1;
624
624
  try {
@@ -627,17 +627,17 @@ function Et(e) {
627
627
  return !1;
628
628
  }
629
629
  }
630
- function vt(e) {
630
+ function $t(e) {
631
631
  return Number.isInteger(e.minute) && e.minute >= 0 && e.minute <= 59 && Number.isInteger(e.hour) && e.hour >= 0 && e.hour <= 23;
632
632
  }
633
- function fe(e) {
633
+ function pe(e) {
634
634
  if (e.length === 0) return null;
635
635
  const n = [...e].sort((t, r) => t - r);
636
636
  return n.some(
637
637
  (t, r) => !Number.isInteger(t) || t < 0 || t > 6 || r > 0 && t === n[r - 1]
638
638
  ) ? null : n;
639
639
  }
640
- function pe(e) {
640
+ function he(e) {
641
641
  const t = [...e.filter((o) => o !== "last")].sort((o, a) => o - a);
642
642
  if (t.some(
643
643
  (o, a) => !Number.isInteger(o) || o < 1 || o > 31 || a > 0 && o === t[a - 1]
@@ -652,51 +652,51 @@ function O(e, n) {
652
652
  t.push((n + r * e) % 12);
653
653
  return t.sort((r, o) => r - o);
654
654
  }
655
- function $t(e, n) {
655
+ function Ct(e, n) {
656
656
  return e === 1 ? "*" : O(e, n).map((t) => t + 1).join(",");
657
657
  }
658
- function he(e, n) {
658
+ function ye(e, n) {
659
659
  return e.every((t) => Dt(t, n));
660
660
  }
661
- function er(e) {
662
- if (!vt(e))
661
+ function ir(e) {
662
+ if (!$t(e))
663
663
  throw new Error("Choose a valid schedule time.");
664
664
  const n = `${e.minute} ${e.hour}`;
665
665
  switch (e.frequency) {
666
666
  case "daily":
667
- return e.weekdaysOnly ? `${n} * * ${U.map((t) => B[t]).join(",")}` : `${n} * * *`;
667
+ return e.weekdaysOnly ? `${n} * * ${P.map((t) => B[t]).join(",")}` : `${n} * * *`;
668
668
  case "weekly": {
669
- const t = fe(e.weekdays);
669
+ const t = pe(e.weekdays);
670
670
  if (!t) throw new Error("Choose at least one weekday.");
671
671
  return `${n} * * ${t.map((r) => B[r]).join(",")}`;
672
672
  }
673
673
  case "monthly": {
674
- if (!me.includes(e.interval) || !Number.isInteger(e.startMonth) || e.startMonth < 0 || e.startMonth >= e.interval)
674
+ if (!ue.includes(e.interval) || !Number.isInteger(e.startMonth) || e.startMonth < 0 || e.startMonth >= e.interval)
675
675
  throw new Error("Choose a valid month cycle.");
676
- const t = $t(e.interval, e.startMonth);
676
+ const t = Ct(e.interval, e.startMonth);
677
677
  if (e.on.type === "days") {
678
- const i = pe(e.on.days);
678
+ const i = he(e.on.days);
679
679
  if (!i) throw new Error("Choose at least one day of the month.");
680
680
  const c = O(e.interval, e.startMonth);
681
- if (!he(i, c))
681
+ if (!ye(i, c))
682
682
  throw new Error("Choose a day that occurs in the chosen months.");
683
683
  const l = i.map((m) => m === "last" ? "L" : String(m)).join(",");
684
684
  return `${n} ${l} ${t} *`;
685
685
  }
686
686
  const { ordinal: r, weekday: o } = e.on;
687
- if (!Number.isInteger(o) || o < 0 || o > 6 || !(r in ue))
687
+ if (!Number.isInteger(o) || o < 0 || o > 6 || !(r in fe))
688
688
  throw new Error("Choose a valid weekday.");
689
689
  const a = B[o];
690
690
  return `${n} * ${t} ${r === -1 ? `${a}L` : `${a}#${r}`}`;
691
691
  }
692
692
  }
693
693
  }
694
- function Ct(e) {
694
+ function Tt(e) {
695
695
  if (e === "*") return { interval: 1, startMonth: 0 };
696
696
  const n = e.split(",");
697
697
  if (n.some((i) => !/^([1-9]|1[0-2])$/.test(i))) return null;
698
698
  const t = n.map((i) => Number(i) - 1), r = 12 / t.length;
699
- if (!me.includes(r))
699
+ if (!ue.includes(r))
700
700
  return null;
701
701
  const o = t[0], a = O(
702
702
  r,
@@ -709,19 +709,19 @@ function xt(e) {
709
709
  if (n.some((o) => !/^(L|[1-9]|[12]\d|3[01])$/.test(o))) return null;
710
710
  const t = n.map(
711
711
  (o) => o === "L" ? "last" : Number(o)
712
- ), r = pe(t);
712
+ ), r = he(t);
713
713
  return !r || r.some((o, a) => o !== t[a]) ? null : r;
714
714
  }
715
- function Tt(e) {
715
+ function St(e) {
716
716
  const n = /^([A-Z]{3})(?:#([1-4])|(L))$/.exec(e);
717
717
  if (!n) return null;
718
- const t = se.get(n[1]);
718
+ const t = me.get(n[1]);
719
719
  return t === void 0 ? null : {
720
720
  weekday: t,
721
721
  ordinal: n[3] ? -1 : Number(n[2])
722
722
  };
723
723
  }
724
- function ye(e) {
724
+ function ge(e) {
725
725
  if (typeof e != "string" || e.length === 0 || e !== e.trim() || e.includes(" "))
726
726
  return C;
727
727
  const n = e.split(" ");
@@ -737,10 +737,10 @@ function ye(e) {
737
737
  value: { frequency: "daily", hour: l, minute: c, weekdaysOnly: !1 }
738
738
  };
739
739
  if (a === "*" && o === "*" && !i.includes("#") && !i.endsWith("L")) {
740
- const f = i.split(",").map((v) => se.get(v));
740
+ const f = i.split(",").map((v) => me.get(v));
741
741
  if (f.some((v) => v === void 0)) return C;
742
- const p = f, g = fe(p);
743
- return !g || g.some((v, A) => v !== p[A]) ? C : g.length === U.length && g.every((v, A) => v === U[A]) ? {
742
+ const p = f, g = pe(p);
743
+ return !g || g.some((v, k) => v !== p[k]) ? C : g.length === P.length && g.every((v, k) => v === P[k]) ? {
744
744
  ok: !0,
745
745
  value: { frequency: "daily", hour: l, minute: c, weekdaysOnly: !0 }
746
746
  } : {
@@ -748,37 +748,37 @@ function ye(e) {
748
748
  value: { frequency: "weekly", hour: l, minute: c, weekdays: g }
749
749
  };
750
750
  }
751
- const m = Ct(a);
751
+ const m = Tt(a);
752
752
  if (!m) return C;
753
753
  if (o !== "*" && i === "*") {
754
- const s = xt(o), f = O(m.interval, m.startMonth);
755
- return !s || !he(s, f) ? C : {
754
+ const d = xt(o), f = O(m.interval, m.startMonth);
755
+ return !d || !ye(d, f) ? C : {
756
756
  ok: !0,
757
757
  value: {
758
758
  frequency: "monthly",
759
759
  hour: l,
760
760
  minute: c,
761
761
  ...m,
762
- on: { type: "days", days: s }
762
+ on: { type: "days", days: d }
763
763
  }
764
764
  };
765
765
  }
766
766
  if (o === "*" && i !== "*") {
767
- const s = Tt(i);
768
- return s ? {
767
+ const d = St(i);
768
+ return d ? {
769
769
  ok: !0,
770
770
  value: {
771
771
  frequency: "monthly",
772
772
  hour: l,
773
773
  minute: c,
774
774
  ...m,
775
- on: { type: "weekday", ...s }
775
+ on: { type: "weekday", ...d }
776
776
  }
777
777
  } : C;
778
778
  }
779
779
  return C;
780
780
  }
781
- function St(e, n, t) {
781
+ function At(e, n, t) {
782
782
  return new Intl.DateTimeFormat(t, {
783
783
  hour: "numeric",
784
784
  minute: "2-digit",
@@ -797,10 +797,10 @@ function kt(e, n) {
797
797
  return null;
798
798
  }
799
799
  }
800
- function ie(e) {
800
+ function ce(e) {
801
801
  return e.length <= 1 ? e.join("") : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
802
802
  }
803
- function At(e) {
803
+ function _t(e) {
804
804
  const n = e % 100;
805
805
  return n >= 11 && n <= 13 ? `${e}th` : `${e}${["th", "st", "nd", "rd"][e % 10] ?? "th"}`;
806
806
  }
@@ -813,13 +813,13 @@ function wt(e, n, t) {
813
813
  const o = O(e, n).map((a) => r(a, "short")).join(", ");
814
814
  return e === 3 ? `each quarter (${o})` : `every ${e} months (${o})`;
815
815
  }
816
- function tr(e, n, t = "en-US") {
817
- const r = ye(e);
816
+ function cr(e, n, t = "en-US") {
817
+ const r = ge(e);
818
818
  if (!r.ok) return null;
819
819
  try {
820
820
  const o = r.value, a = kt(n, t);
821
821
  if (!a) return null;
822
- const i = `at ${St(o.hour, o.minute, t)} ${a}`, c = (l) => new Intl.DateTimeFormat(t, {
822
+ const i = `at ${At(o.hour, o.minute, t)} ${a}`, c = (l) => new Intl.DateTimeFormat(t, {
823
823
  weekday: "long",
824
824
  timeZone: "UTC"
825
825
  }).format(new Date(Date.UTC(2023, 0, 1 + l)));
@@ -827,57 +827,57 @@ function tr(e, n, t = "en-US") {
827
827
  case "daily":
828
828
  return o.weekdaysOnly ? `Every weekday, Monday to Friday, ${i}` : `Every day ${i}`;
829
829
  case "weekly":
830
- return `Every ${ie(o.weekdays.map(c))} ${i}`;
830
+ return `Every ${ce(o.weekdays.map(c))} ${i}`;
831
831
  case "monthly": {
832
832
  const l = wt(o.interval, o.startMonth, t);
833
833
  if (o.on.type === "weekday")
834
- return `On the ${ue[o.on.ordinal]} ${c(o.on.weekday)} of ${l} ${i}`;
834
+ return `On the ${fe[o.on.ordinal]} ${c(o.on.weekday)} of ${l} ${i}`;
835
835
  const m = o.on.days.map(
836
- (s) => s === "last" ? "last day" : At(s)
836
+ (d) => d === "last" ? "last day" : _t(d)
837
837
  );
838
- return `On the ${ie(m)} of ${l} ${i}`;
838
+ return `On the ${ce(m)} of ${l} ${i}`;
839
839
  }
840
840
  }
841
841
  } catch {
842
842
  return null;
843
843
  }
844
844
  }
845
- const ge = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
845
+ const be = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
846
846
  function Dt(e, n) {
847
- return e === "last" || n.some((t) => e <= ge[t]);
847
+ return e === "last" || n.some((t) => e <= be[t]);
848
848
  }
849
- function nr(e) {
849
+ function lr(e) {
850
850
  if (e.frequency !== "monthly" || e.on.type !== "days") return null;
851
851
  const n = e.on.days.filter((o) => o !== "last");
852
852
  if (n.length === 0) return null;
853
853
  const t = Math.max(...n), r = O(e.interval, e.startMonth).filter(
854
- (o) => t > (o === 1 ? 28 : ge[o])
854
+ (o) => t > (o === 1 ? 28 : be[o])
855
855
  );
856
856
  return r.length > 0 ? { day: t, months: r } : null;
857
857
  }
858
- function _t(e, n) {
858
+ function Ot(e, n) {
859
859
  return new Date(Date.UTC(e, n + 1, 0)).getUTCDate();
860
860
  }
861
- function Ot(e, n, t, r) {
861
+ function Nt(e, n, t, r) {
862
862
  const o = new Date(Date.UTC(n, t, r)).getUTCDay();
863
863
  switch (e.frequency) {
864
864
  case "daily":
865
- return !e.weekdaysOnly || U.includes(o);
865
+ return !e.weekdaysOnly || P.includes(o);
866
866
  case "weekly":
867
867
  return e.weekdays.includes(o);
868
868
  case "monthly": {
869
869
  if (!O(e.interval, e.startMonth).includes(t))
870
870
  return !1;
871
- const a = _t(n, t);
871
+ const a = Ot(n, t);
872
872
  return e.on.type === "days" ? e.on.days.some(
873
873
  (i) => i === "last" ? r === a : i === r
874
874
  ) : o !== e.on.weekday ? !1 : e.on.ordinal === -1 ? r + 7 > a : Math.ceil(r / 7) === e.on.ordinal;
875
875
  }
876
876
  }
877
877
  }
878
- function rr(e, n, t, r) {
879
- const o = ye(e);
880
- if (!o.ok || !Et(n)) return [];
878
+ function sr(e, n, t, r) {
879
+ const o = ge(e);
880
+ if (!o.ok || !vt(n)) return [];
881
881
  const a = o.value, i = new Intl.DateTimeFormat("en-US", {
882
882
  timeZone: n,
883
883
  hourCycle: "h23",
@@ -886,19 +886,21 @@ function rr(e, n, t, r) {
886
886
  day: "numeric",
887
887
  hour: "numeric",
888
888
  minute: "numeric"
889
- }).formatToParts(t), c = (s) => {
889
+ }).formatToParts(t), c = (d) => {
890
890
  var f;
891
- return Number((f = i.find((p) => p.type === s)) == null ? void 0 : f.value);
891
+ return Number((f = i.find((p) => p.type === d)) == null ? void 0 : f.value);
892
892
  }, l = new Date(Date.UTC(c("year"), c("month") - 1, c("day")));
893
893
  c("hour") * 60 + c("minute") >= a.hour * 60 + a.minute && l.setUTCDate(l.getUTCDate() + 1);
894
894
  const m = [];
895
- for (let s = 0; s < 366 * 4 * (r + 1) && m.length < r; s += 1)
896
- Ot(a, l.getUTCFullYear(), l.getUTCMonth(), l.getUTCDate()) && m.push(l.toISOString().slice(0, 10)), l.setUTCDate(l.getUTCDate() + 1);
895
+ for (let d = 0; d < 366 * 4 * (r + 1) && m.length < r; d += 1)
896
+ Nt(a, l.getUTCFullYear(), l.getUTCMonth(), l.getUTCDate()) && m.push(l.toISOString().slice(0, 10)), l.setUTCDate(l.getUTCDate() + 1);
897
897
  return m;
898
898
  }
899
899
  const Ft = Object.freeze([
900
900
  "PDF_ROW_LIMIT_EXCEEDED",
901
901
  "PDF_SIZE_LIMIT_EXCEEDED",
902
+ // More pages than one PDF holds (PDF capacity contract PC-D3).
903
+ "PDF_PAGE_LIMIT_EXCEEDED",
902
904
  "TABLE_COMPLETENESS_UNVERIFIED",
903
905
  "CARD_QUERY_FAILED",
904
906
  "RENDER_NOT_READY",
@@ -916,15 +918,18 @@ const Ft = Object.freeze([
916
918
  "DOCUMENT_PAGE_OVERFLOW",
917
919
  "DOCUMENT_ROW_LIMIT_EXCEEDED",
918
920
  "DOCUMENT_SECTION_SETUP",
919
- "REPORT_INPUTS_MISSING"
920
- ]), Nt = new Set(Ft);
921
- function Rt(e) {
922
- return typeof e == "string" && Nt.has(e);
923
- }
921
+ "REPORT_INPUTS_MISSING",
922
+ // The report's saved presentation can't format what it prints; saving the
923
+ // report again captures it (value formatting Plan 05).
924
+ "REPORT_NEEDS_RESAVE"
925
+ ]), Rt = new Set(Ft);
924
926
  function Mt(e) {
927
+ return typeof e == "string" && Rt.has(e);
928
+ }
929
+ function Lt(e) {
925
930
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
926
931
  const n = e;
927
- return typeof n.index != "number" || !Number.isInteger(n.index) || n.index < 0 || typeof n.title != "string" || !be.includes(n.format) || !Rt(n.code) || typeof n.reason != "string" || typeof n.diagnostic != "string" ? null : {
932
+ return typeof n.index != "number" || !Number.isInteger(n.index) || n.index < 0 || typeof n.title != "string" || !Ee.includes(n.format) || !Mt(n.code) || typeof n.reason != "string" || typeof n.diagnostic != "string" ? null : {
928
933
  index: n.index,
929
934
  title: n.title,
930
935
  format: n.format,
@@ -933,39 +938,109 @@ function Mt(e) {
933
938
  diagnostic: n.diagnostic
934
939
  };
935
940
  }
936
- function or(e) {
941
+ function dr(e) {
937
942
  if (!e || typeof e != "object" || Array.isArray(e)) return [];
938
943
  const n = e.omittedAttachments;
939
944
  return Array.isArray(n) ? n.flatMap((t) => {
940
- const r = Mt(t);
945
+ const r = Lt(t);
941
946
  return r ? [r] : [];
942
947
  }) : [];
943
948
  }
944
- function ar(e) {
949
+ const mr = "Briefing run cancelled by user", Bt = [
950
+ "sent",
951
+ "partly_sent",
952
+ "failed",
953
+ "not_set_up"
954
+ ];
955
+ function Ut(e, n) {
956
+ var i;
957
+ const t = n.sentCount ?? 0, r = n.failedCount ?? 0, o = e === "SLACK" && n.channelName || null, a = ((i = n.message) == null ? void 0 : i.trim()) || null;
958
+ switch (n.status) {
959
+ case "SENT":
960
+ return { channel: e, status: "sent", sent: t, failed: 0, destination: o, reason: null };
961
+ case "FAILED":
962
+ return {
963
+ channel: e,
964
+ status: t > 0 ? "partly_sent" : "failed",
965
+ sent: t,
966
+ failed: t > 0 ? r : Math.max(r, 1),
967
+ destination: o,
968
+ reason: a
969
+ };
970
+ case "NOT_CONFIGURED":
971
+ return { channel: e, status: "not_set_up", sent: 0, failed: 0, destination: o, reason: a };
972
+ default:
973
+ return null;
974
+ }
975
+ }
976
+ function R(e) {
977
+ return !!e && typeof e == "object" && !Array.isArray(e);
978
+ }
979
+ function Pt(e) {
980
+ if (!R(e)) return null;
981
+ const { channel: n, status: t, sent: r, failed: o, destination: a, reason: i } = e;
982
+ return n !== "EMAIL" && n !== "SLACK" || !Bt.includes(t) ? null : {
983
+ channel: n,
984
+ status: t,
985
+ sent: typeof r == "number" ? r : 0,
986
+ failed: typeof o == "number" ? o : 0,
987
+ destination: typeof a == "string" && a ? a : null,
988
+ reason: typeof i == "string" && i ? i : null
989
+ };
990
+ }
991
+ function Vt(e) {
992
+ return !R(e) || typeof e.status != "string" ? null : {
993
+ status: e.status,
994
+ sentCount: typeof e.sentCount == "number" ? e.sentCount : 0,
995
+ failedCount: typeof e.failedCount == "number" ? e.failedCount : 0,
996
+ message: typeof e.message == "string" ? e.message : "",
997
+ channelName: typeof e.channelName == "string" ? e.channelName : null
998
+ };
999
+ }
1000
+ function zt(e) {
1001
+ return R(e) ? {
1002
+ channels: ("email" in e || "slack" in e ? [
1003
+ ["EMAIL", e.email],
1004
+ ["SLACK", e.slack]
1005
+ ] : [[e.channel === "SLACK" ? "SLACK" : "EMAIL", e]]).flatMap(([t, r]) => {
1006
+ const o = Vt(r), a = o ? Ut(t, o) : null;
1007
+ return a ? [a] : [];
1008
+ })
1009
+ } : null;
1010
+ }
1011
+ function ur(e) {
1012
+ return R(e) ? R(e.deliveryOutcome) && Array.isArray(e.deliveryOutcome.channels) ? {
1013
+ channels: e.deliveryOutcome.channels.flatMap((n) => {
1014
+ const t = Pt(n);
1015
+ return t ? [t] : [];
1016
+ })
1017
+ } : zt(e.deliveryResult) : null;
1018
+ }
1019
+ function fr(e) {
945
1020
  return e != null && e.role ? e.type === "tenant" ? e.role === "POWER_USER" : ["AUTHOR", "ADMIN", "SUPER_ADMIN"].includes(e.role) : !1;
946
1021
  }
947
- function ir(e) {
1022
+ function pr(e) {
948
1023
  return e.canCreate ? [
949
1024
  ...e.scheduledReportAvailable ? ["scheduled_report"] : [],
950
1025
  ...e.analyticalBriefingsEnabled ? ["analytical_briefing"] : []
951
1026
  ] : [];
952
1027
  }
953
- function Bt(e) {
1028
+ function jt(e) {
954
1029
  const n = (e == null ? void 0 : e.channels) ?? [];
955
1030
  return n.length === 1 && n[0] === "EMAIL";
956
1031
  }
957
- function Lt(e) {
958
- return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && Bt(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
1032
+ function qt(e) {
1033
+ return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && jt(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
959
1034
  }
960
- function cr(e) {
961
- const n = Lt(e), t = n === "Scheduled report" || n === "On-demand report" ? "report" : "briefing";
1035
+ function hr(e) {
1036
+ const n = qt(e), t = n === "Scheduled report" || n === "On-demand report" ? "report" : "briefing";
962
1037
  return {
963
1038
  typeLabel: n,
964
1039
  noun: t,
965
1040
  pluralNoun: t === "report" ? "reports" : "briefings"
966
1041
  };
967
1042
  }
968
- const H = "BRIEFING", Ut = ["markdown", "html"], G = ["markdown"], z = 20, u = {
1043
+ const H = "BRIEFING", Kt = ["markdown", "html"], W = ["markdown"], j = 20, u = {
969
1044
  name: 500,
970
1045
  description: 2e3,
971
1046
  instruction: 5e4,
@@ -994,7 +1069,7 @@ const H = "BRIEFING", Ut = ["markdown", "html"], G = ["markdown"], z = 20, u = {
994
1069
  // tiny tiles in narrow client panels; 2-up was the chosen layout).
995
1070
  maxKpiTiles: 8
996
1071
  };
997
- function Pt(e) {
1072
+ function Gt(e) {
998
1073
  if (e === null || typeof e != "object" || Array.isArray(e))
999
1074
  return !1;
1000
1075
  const n = e;
@@ -1004,60 +1079,60 @@ function Pt(e) {
1004
1079
  if (t === null || typeof t != "object" || Array.isArray(t))
1005
1080
  return !1;
1006
1081
  const r = t;
1007
- return (r.kind === "metric" && typeof r.metricId == "string" && !!r.metricId.trim() || r.kind === "column" && typeof r.columnKey == "string" && !!r.columnKey.trim() || r.kind === "matrix_measure" && typeof r.measureId == "string" && !!r.measureId.trim()) && le(n.format).ok;
1082
+ return (r.kind === "metric" && typeof r.metricId == "string" && !!r.metricId.trim() || r.kind === "column" && typeof r.columnKey == "string" && !!r.columnKey.trim() || r.kind === "matrix_measure" && typeof r.measureId == "string" && !!r.measureId.trim()) && se(n.format).ok;
1008
1083
  }
1009
- function Vt(e) {
1010
- return e == null ? "" : Pt(e) ? Ne(e.value, e.format) : String(e);
1084
+ function Ht(e) {
1085
+ return e == null ? "" : Gt(e) ? Re(e.value, e.format) : String(e);
1011
1086
  }
1012
- function lr(e) {
1087
+ function yr(e) {
1013
1088
  return [e.delta, e.percentChange].filter(
1014
1089
  (n) => n != null
1015
- ).map(Vt).filter(Boolean).join(" / ");
1090
+ ).map(Ht).filter(Boolean).join(" / ");
1016
1091
  }
1017
- const be = ["pdf", "png", "csv", "xlsx"], Ie = new Set(Ut), zt = /* @__PURE__ */ new Set([
1092
+ const Ee = ["pdf", "png", "csv", "xlsx"], Ie = new Set(Kt), Wt = /* @__PURE__ */ new Set([
1018
1093
  "EMAIL",
1019
1094
  "WEBHOOK",
1020
1095
  "SLACK",
1021
1096
  "IN_APP",
1022
1097
  "TELEGRAM"
1023
- ]), j = {
1098
+ ]), q = {
1024
1099
  maxToolCalls: { min: 1, max: 100 },
1025
1100
  maxPlanningIterations: { min: 1, max: 10 },
1026
1101
  maxRows: { min: 1, max: 1e5 },
1027
1102
  timeoutMs: { min: 1e3, max: 30 * 6e4 }
1028
- }, jt = /* @__PURE__ */ new Set([
1103
+ }, Xt = /* @__PURE__ */ new Set([
1029
1104
  "letter",
1030
1105
  "legal",
1031
1106
  "a4",
1032
1107
  "a3",
1033
1108
  "tabloid"
1034
- ]), qt = /* @__PURE__ */ new Set([
1109
+ ]), Zt = /* @__PURE__ */ new Set([
1035
1110
  "portrait",
1036
1111
  "landscape"
1037
- ]), Kt = /* @__PURE__ */ new Set([",", ";", " "]), Ht = new Set(Ue), Gt = /* @__PURE__ */ new Set([
1112
+ ]), Yt = /* @__PURE__ */ new Set([",", ";", " "]), Jt = new Set(Pe), Qt = /* @__PURE__ */ new Set([
1038
1113
  "current",
1039
1114
  "all"
1040
- ]), Wt = /* @__PURE__ */ new Set([
1115
+ ]), en = /* @__PURE__ */ new Set([
1041
1116
  "concise",
1042
1117
  "balanced",
1043
1118
  "detailed"
1044
- ]), Xt = /* @__PURE__ */ new Set([
1119
+ ]), tn = /* @__PURE__ */ new Set([
1045
1120
  "info",
1046
1121
  "positive",
1047
1122
  "warning",
1048
1123
  "critical"
1049
- ]), Zt = /* @__PURE__ */ new Set([
1124
+ ]), nn = /* @__PURE__ */ new Set([
1050
1125
  "text",
1051
1126
  "number",
1052
1127
  "currency",
1053
1128
  "percent",
1054
1129
  "date",
1055
1130
  "boolean"
1056
- ]), Yt = /* @__PURE__ */ new Set([
1131
+ ]), rn = /* @__PURE__ */ new Set([
1057
1132
  "left",
1058
1133
  "center",
1059
1134
  "right"
1060
- ]), Jt = [
1135
+ ]), on = [
1061
1136
  "matrix",
1062
1137
  "pageSize",
1063
1138
  "orientation",
@@ -1088,26 +1163,26 @@ const be = ["pdf", "png", "csv", "xlsx"], Ie = new Set(Ut), zt = /* @__PURE__ */
1088
1163
  "allowDownload",
1089
1164
  "theme"
1090
1165
  ];
1091
- class P extends Error {
1166
+ class V extends Error {
1092
1167
  constructor(t) {
1093
1168
  super(t.map((r) => `${r.field}: ${r.message}`).join("; "));
1094
- R(this, "issues");
1169
+ M(this, "issues");
1095
1170
  this.name = "BriefingContractError", this.issues = t;
1096
1171
  }
1097
1172
  }
1098
- function Ee(e) {
1173
+ function ve(e) {
1099
1174
  return typeof e == "object" && e !== null && !Array.isArray(e);
1100
1175
  }
1101
- function d(e, n, t) {
1176
+ function s(e, n, t) {
1102
1177
  e.push({ field: n, message: t });
1103
1178
  }
1104
- function E(e, n, t) {
1105
- return Ee(e) ? e : (d(t, n, "Expected an object."), {});
1179
+ function I(e, n, t) {
1180
+ return ve(e) ? e : (s(t, n, "Expected an object."), {});
1106
1181
  }
1107
1182
  function h(e, n, t, r) {
1108
1183
  const o = new Set(t);
1109
1184
  Object.keys(e).forEach((a) => {
1110
- o.has(a) || d(
1185
+ o.has(a) || s(
1111
1186
  r,
1112
1187
  n ? `${n}.${a}` : a,
1113
1188
  `Unexpected field "${a}".`
@@ -1116,41 +1191,41 @@ function h(e, n, t, r) {
1116
1191
  }
1117
1192
  function b(e, n, t, r) {
1118
1193
  if (typeof e != "string")
1119
- return d(r, n, "Expected a string."), "";
1194
+ return s(r, n, "Expected a string."), "";
1120
1195
  const o = e.trim();
1121
- return o ? (o.length > t && d(r, n, `Must be ${t} characters or fewer.`), o) : (d(r, n, "Required value cannot be empty."), "");
1196
+ return o ? (o.length > t && s(r, n, `Must be ${t} characters or fewer.`), o) : (s(r, n, "Required value cannot be empty."), "");
1122
1197
  }
1123
- function I(e, n, t, r) {
1198
+ function E(e, n, t, r) {
1124
1199
  if (e == null)
1125
1200
  return;
1126
1201
  if (typeof e != "string") {
1127
- d(r, n, "Expected a string.");
1202
+ s(r, n, "Expected a string.");
1128
1203
  return;
1129
1204
  }
1130
1205
  const o = e.trim();
1131
1206
  if (o)
1132
- return o.length > t && d(r, n, `Must be ${t} characters or fewer.`), o;
1207
+ return o.length > t && s(r, n, `Must be ${t} characters or fewer.`), o;
1133
1208
  }
1134
- function Qt(e, n, t, r) {
1209
+ function an(e, n, t, r) {
1135
1210
  if (typeof e != "string")
1136
- return d(r, n, "Expected a string."), "";
1211
+ return s(r, n, "Expected a string."), "";
1137
1212
  const o = e.trim();
1138
- return o.length > t && d(r, n, `Must be ${t} characters or fewer.`), o;
1213
+ return o.length > t && s(r, n, `Must be ${t} characters or fewer.`), o;
1139
1214
  }
1140
- function en(e, n, t) {
1215
+ function cn(e, n, t) {
1141
1216
  if (e != null) {
1142
1217
  if (!Number.isInteger(e) || Number(e) < 0) {
1143
- d(t, n, "Expected a non-negative integer.");
1218
+ s(t, n, "Expected a non-negative integer.");
1144
1219
  return;
1145
1220
  }
1146
1221
  return Number(e);
1147
1222
  }
1148
1223
  }
1149
- function x(e, n, t, r = {}) {
1224
+ function T(e, n, t, r = {}) {
1150
1225
  if (e == null)
1151
- return r.required ? (d(t, n, "Expected at least one evidence id."), []) : void 0;
1226
+ return r.required ? (s(t, n, "Expected at least one evidence id."), []) : void 0;
1152
1227
  if (!Array.isArray(e))
1153
- return d(t, n, "Expected an array."), r.required ? [] : void 0;
1228
+ return s(t, n, "Expected an array."), r.required ? [] : void 0;
1154
1229
  const o = [];
1155
1230
  return e.forEach((a, i) => {
1156
1231
  const c = b(
@@ -1160,21 +1235,21 @@ function x(e, n, t, r = {}) {
1160
1235
  t
1161
1236
  );
1162
1237
  c && !o.includes(c) && o.push(c);
1163
- }), r.required && o.length === 0 && d(t, n, "Expected at least one evidence id."), o.length > 0 || r.required ? o : void 0;
1238
+ }), r.required && o.length === 0 && s(t, n, "Expected at least one evidence id."), o.length > 0 || r.required ? o : void 0;
1164
1239
  }
1165
- function _(e, n, t, r) {
1166
- return e == null ? n : typeof e != "boolean" ? (d(r, t, "Expected a boolean."), n) : e;
1240
+ function D(e, n, t, r) {
1241
+ return e == null ? n : typeof e != "boolean" ? (s(r, t, "Expected a boolean."), n) : e;
1167
1242
  }
1168
- function tn(e, n) {
1169
- return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (d(n, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
1243
+ function ln(e, n) {
1244
+ return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (s(n, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
1170
1245
  }
1171
- function nn(e) {
1246
+ function sn(e) {
1172
1247
  return e.includes("@") && e.includes(".") && !e.includes(" ");
1173
1248
  }
1174
- function ve(e, n) {
1249
+ function $e(e, n) {
1175
1250
  if (e == null)
1176
1251
  return { type: "project" };
1177
- const t = E(e, "source", n), r = t.type;
1252
+ const t = I(e, "source", n), r = t.type;
1178
1253
  return r === "project" ? (h(t, "source", ["type"], n), { type: "project" }) : r === "dashboard" ? (h(t, "source", ["type", "dashboardId"], n), {
1179
1254
  type: "dashboard",
1180
1255
  dashboardId: b(
@@ -1183,10 +1258,10 @@ function ve(e, n) {
1183
1258
  u.id,
1184
1259
  n
1185
1260
  )
1186
- }) : (d(n, "source.type", "Expected project or dashboard."), { type: "project" });
1261
+ }) : (s(n, "source.type", "Expected project or dashboard."), { type: "project" });
1187
1262
  }
1188
- function $e(e, n) {
1189
- const t = E(e, "body", n), r = t.type;
1263
+ function Ce(e, n) {
1264
+ const t = I(e, "body", n), r = t.type;
1190
1265
  return r === "generated_analysis" ? (h(t, "body", ["type", "instruction"], n), {
1191
1266
  type: "generated_analysis",
1192
1267
  instruction: b(
@@ -1197,25 +1272,25 @@ function $e(e, n) {
1197
1272
  )
1198
1273
  }) : r === "custom_message" ? (h(t, "body", ["type", "message"], n), {
1199
1274
  type: "custom_message",
1200
- message: Qt(
1275
+ message: an(
1201
1276
  t.message,
1202
1277
  "body.message",
1203
1278
  u.customMessage,
1204
1279
  n
1205
1280
  )
1206
- }) : r === "none" ? (h(t, "body", ["type"], n), { type: "none" }) : (d(
1281
+ }) : r === "none" ? (h(t, "body", ["type"], n), { type: "none" }) : (s(
1207
1282
  n,
1208
1283
  "body.type",
1209
1284
  "Expected generated_analysis, custom_message, or none."
1210
1285
  ), { type: "none" });
1211
1286
  }
1212
- function rn(e, n) {
1287
+ function dn(e, n) {
1213
1288
  if (e == null)
1214
- return [...G];
1289
+ return [...W];
1215
1290
  if (!Array.isArray(e))
1216
- return d(n, "presentation.artifactFormats", "Expected an array."), [...G];
1291
+ return s(n, "presentation.artifactFormats", "Expected an array."), [...W];
1217
1292
  if (e.length === 0)
1218
- return d(
1293
+ return s(
1219
1294
  n,
1220
1295
  "presentation.artifactFormats",
1221
1296
  "Choose at least one artifact format."
@@ -1223,7 +1298,7 @@ function rn(e, n) {
1223
1298
  const t = [];
1224
1299
  return e.forEach((r, o) => {
1225
1300
  if (typeof r != "string" || !Ie.has(r)) {
1226
- d(
1301
+ s(
1227
1302
  n,
1228
1303
  `presentation.artifactFormats.${o}`,
1229
1304
  "Expected markdown or html."
@@ -1233,14 +1308,14 @@ function rn(e, n) {
1233
1308
  t.includes(r) || t.push(r);
1234
1309
  }), t;
1235
1310
  }
1236
- function Ce(e, n) {
1311
+ function Te(e, n) {
1237
1312
  if (e == null)
1238
1313
  return {
1239
- artifactFormats: [...G],
1314
+ artifactFormats: [...W],
1240
1315
  includeEvidence: !0,
1241
1316
  includeSql: !0
1242
1317
  };
1243
- const t = E(e, "presentation", n);
1318
+ const t = I(e, "presentation", n);
1244
1319
  h(
1245
1320
  t,
1246
1321
  "presentation",
@@ -1259,30 +1334,30 @@ function Ce(e, n) {
1259
1334
  n
1260
1335
  );
1261
1336
  const r = {
1262
- artifactFormats: rn(t.artifactFormats, n),
1263
- includeEvidence: _(
1337
+ artifactFormats: dn(t.artifactFormats, n),
1338
+ includeEvidence: D(
1264
1339
  t.includeEvidence,
1265
1340
  !0,
1266
1341
  "presentation.includeEvidence",
1267
1342
  n
1268
1343
  ),
1269
- includeSql: _(
1344
+ includeSql: D(
1270
1345
  t.includeSql,
1271
1346
  !0,
1272
1347
  "presentation.includeSql",
1273
1348
  n
1274
1349
  )
1275
- }, o = I(
1350
+ }, o = E(
1276
1351
  t.audience,
1277
1352
  "presentation.audience",
1278
1353
  u.presentationAudience,
1279
1354
  n
1280
- ), a = I(
1355
+ ), a = E(
1281
1356
  t.tone,
1282
1357
  "presentation.tone",
1283
1358
  u.presentationTone,
1284
1359
  n
1285
- ), i = I(
1360
+ ), i = E(
1286
1361
  t.format,
1287
1362
  "presentation.format",
1288
1363
  u.presentationFormat,
@@ -1290,10 +1365,10 @@ function Ce(e, n) {
1290
1365
  );
1291
1366
  o && (r.audience = o), a && (r.tone = a), i && (r.format = i);
1292
1367
  const c = It(t);
1293
- return c.issues.forEach((l) => d(n, l.field, l.message)), Object.assign(r, c.value), r;
1368
+ return c.issues.forEach((l) => s(n, l.field, l.message)), Object.assign(r, c.value), r;
1294
1369
  }
1295
- function on(e, n, t) {
1296
- return Array.isArray(e) ? (e.length === 0 && d(t, n, "Expected at least one item."), e.length > $.maxListItems && d(
1370
+ function mn(e, n, t) {
1371
+ return Array.isArray(e) ? (e.length === 0 && s(t, n, "Expected at least one item."), e.length > $.maxListItems && s(
1297
1372
  t,
1298
1373
  n,
1299
1374
  `Must have ${$.maxListItems} items or fewer.`
@@ -1304,10 +1379,10 @@ function on(e, n, t) {
1304
1379
  u.contentItem,
1305
1380
  t
1306
1381
  )
1307
- ).filter(Boolean)) : (d(t, n, "Expected an array."), []);
1382
+ ).filter(Boolean)) : (s(t, n, "Expected an array."), []);
1308
1383
  }
1309
- function an(e, n, t) {
1310
- const r = E(e, n, t);
1384
+ function un(e, n, t) {
1385
+ const r = I(e, n, t);
1311
1386
  if (r.kind === "metric")
1312
1387
  return h(r, n, ["kind", "metricId"], t), {
1313
1388
  kind: "metric",
@@ -1338,7 +1413,7 @@ function an(e, n, t) {
1338
1413
  t
1339
1414
  )
1340
1415
  };
1341
- d(
1416
+ s(
1342
1417
  t,
1343
1418
  `${n}.kind`,
1344
1419
  "Expected metric, column, or matrix_measure."
@@ -1347,17 +1422,17 @@ function an(e, n, t) {
1347
1422
  function xe(e, n, t) {
1348
1423
  if (e === null || typeof e != "object" || Array.isArray(e))
1349
1424
  return;
1350
- const r = E(e, n, t);
1425
+ const r = I(e, n, t);
1351
1426
  if (!Object.prototype.hasOwnProperty.call(r, "target") && !Object.prototype.hasOwnProperty.call(r, "format"))
1352
1427
  return;
1353
- h(r, n, ["value", "target", "format"], t), (typeof r.value != "number" || !Number.isFinite(r.value)) && d(t, `${n}.value`, "Expected a finite number.");
1354
- const o = an(
1428
+ h(r, n, ["value", "target", "format"], t), (typeof r.value != "number" || !Number.isFinite(r.value)) && s(t, `${n}.value`, "Expected a finite number.");
1429
+ const o = un(
1355
1430
  r.target,
1356
1431
  `${n}.target`,
1357
1432
  t
1358
- ), a = le(r.format);
1433
+ ), a = se(r.format);
1359
1434
  if (a.ok || a.issues.forEach(
1360
- (i) => d(
1435
+ (i) => s(
1361
1436
  t,
1362
1437
  i.path === "$" ? `${n}.format` : `${n}.format.${i.path}`,
1363
1438
  i.message
@@ -1365,49 +1440,49 @@ function xe(e, n, t) {
1365
1440
  ), !(typeof r.value != "number" || !Number.isFinite(r.value) || !o || !a.ok))
1366
1441
  return { value: r.value, target: o, format: a.value };
1367
1442
  }
1368
- function w(e, n, t) {
1443
+ function _(e, n, t) {
1369
1444
  if (typeof e == "string")
1370
1445
  return e;
1371
1446
  if (typeof e == "number") {
1372
1447
  if (!Number.isFinite(e)) {
1373
- d(t, n, "Expected a finite number.");
1448
+ s(t, n, "Expected a finite number.");
1374
1449
  return;
1375
1450
  }
1376
1451
  return e;
1377
1452
  }
1378
1453
  const r = xe(e, n, t);
1379
1454
  if (r) return r;
1380
- d(
1455
+ s(
1381
1456
  t,
1382
1457
  n,
1383
1458
  "Expected a string, number, or structured numeric value."
1384
1459
  );
1385
1460
  }
1386
- function cn(e, n, t) {
1461
+ function fn(e, n, t) {
1387
1462
  if (e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean")
1388
- return typeof e == "string" && e.length > u.contentCell ? (d(
1463
+ return typeof e == "string" && e.length > u.contentCell ? (s(
1389
1464
  t,
1390
1465
  n,
1391
1466
  `Must be ${u.contentCell} characters or fewer.`
1392
- ), e.slice(0, u.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (d(t, n, "Expected a finite number."), null) : e;
1467
+ ), e.slice(0, u.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (s(t, n, "Expected a finite number."), null) : e;
1393
1468
  const r = xe(e, n, t);
1394
- return r || (d(
1469
+ return r || (s(
1395
1470
  t,
1396
1471
  n,
1397
1472
  "Expected a string, number, boolean, structured numeric value, or null."
1398
1473
  ), null);
1399
1474
  }
1400
- function ln(e, n, t) {
1475
+ function pn(e, n, t) {
1401
1476
  if (!Array.isArray(e))
1402
- return d(t, n, "Expected an array."), [];
1403
- e.length === 0 && d(t, n, "Expected at least one column."), e.length > $.maxTableColumns && d(
1477
+ return s(t, n, "Expected an array."), [];
1478
+ e.length === 0 && s(t, n, "Expected at least one column."), e.length > $.maxTableColumns && s(
1404
1479
  t,
1405
1480
  n,
1406
1481
  `Must have ${$.maxTableColumns} columns or fewer.`
1407
1482
  );
1408
1483
  const r = /* @__PURE__ */ new Set();
1409
1484
  return e.slice(0, $.maxTableColumns).map((o, a) => {
1410
- const i = `${n}.${a}`, c = E(o, i, t);
1485
+ const i = `${n}.${a}`, c = I(o, i, t);
1411
1486
  h(c, i, ["key", "label", "kind", "align"], t);
1412
1487
  const l = b(
1413
1488
  c.key,
@@ -1415,61 +1490,61 @@ function ln(e, n, t) {
1415
1490
  u.id,
1416
1491
  t
1417
1492
  );
1418
- l && (r.has(l) && d(t, `${i}.key`, "Column key must be unique."), r.add(l));
1493
+ l && (r.has(l) && s(t, `${i}.key`, "Column key must be unique."), r.add(l));
1419
1494
  const m = b(
1420
1495
  c.label,
1421
1496
  `${i}.label`,
1422
1497
  u.contentTitle,
1423
1498
  t
1424
- ), s = k(
1499
+ ), d = A(
1425
1500
  c.kind,
1426
1501
  `${i}.kind`,
1427
- Zt,
1502
+ nn,
1428
1503
  "text, number, currency, percent, date, or boolean",
1429
1504
  t
1430
- ), f = k(
1505
+ ), f = A(
1431
1506
  c.align,
1432
1507
  `${i}.align`,
1433
- Yt,
1508
+ rn,
1434
1509
  "left, center, or right",
1435
1510
  t
1436
1511
  );
1437
1512
  return {
1438
1513
  key: l,
1439
1514
  label: m,
1440
- ...s ? { kind: s } : {},
1515
+ ...d ? { kind: d } : {},
1441
1516
  ...f ? { align: f } : {}
1442
1517
  };
1443
1518
  });
1444
1519
  }
1445
- function dn(e, n, t, r) {
1520
+ function hn(e, n, t, r) {
1446
1521
  if (!Array.isArray(e))
1447
- return d(r, n, "Expected an array."), [];
1448
- e.length > $.maxTableRows && d(
1522
+ return s(r, n, "Expected an array."), [];
1523
+ e.length > $.maxTableRows && s(
1449
1524
  r,
1450
1525
  n,
1451
1526
  `Must have ${$.maxTableRows} rows or fewer.`
1452
1527
  );
1453
1528
  const o = new Set(t.map((a) => a.key).filter(Boolean));
1454
1529
  return e.slice(0, $.maxTableRows).map((a, i) => {
1455
- const c = `${n}.${i}`, l = E(a, c, r);
1530
+ const c = `${n}.${i}`, l = I(a, c, r);
1456
1531
  return Object.keys(l).forEach((m) => {
1457
- o.has(m) || d(r, `${c}.${m}`, `Unexpected table cell "${m}".`);
1532
+ o.has(m) || s(r, `${c}.${m}`, `Unexpected table cell "${m}".`);
1458
1533
  }), Object.fromEntries(
1459
1534
  t.map((m) => [
1460
1535
  m.key,
1461
- cn(l[m.key] ?? null, `${c}.${m.key}`, r)
1536
+ fn(l[m.key] ?? null, `${c}.${m.key}`, r)
1462
1537
  ])
1463
1538
  );
1464
1539
  });
1465
1540
  }
1466
- function sn(e, n, t) {
1467
- const r = `content.blocks.${n}`, o = E(e, r, t), a = o.type;
1541
+ function yn(e, n, t) {
1542
+ const r = `content.blocks.${n}`, o = I(e, r, t), a = o.type;
1468
1543
  if (a === "heading") {
1469
1544
  h(o, r, ["type", "text", "level", "evidenceIds"], t);
1470
1545
  const i = o.level === void 0 || o.level === null ? void 0 : o.level === 2 || o.level === 3 ? o.level : void 0;
1471
- o.level !== void 0 && o.level !== null && i === void 0 && d(t, `${r}.level`, "Expected 2 or 3.");
1472
- const c = x(o.evidenceIds, `${r}.evidenceIds`, t);
1546
+ o.level !== void 0 && o.level !== null && i === void 0 && s(t, `${r}.level`, "Expected 2 or 3.");
1547
+ const c = T(o.evidenceIds, `${r}.evidenceIds`, t);
1473
1548
  return {
1474
1549
  type: "heading",
1475
1550
  text: b(
@@ -1484,7 +1559,7 @@ function sn(e, n, t) {
1484
1559
  }
1485
1560
  if (a === "paragraph") {
1486
1561
  h(o, r, ["type", "text", "evidenceIds"], t);
1487
- const i = x(o.evidenceIds, `${r}.evidenceIds`, t);
1562
+ const i = T(o.evidenceIds, `${r}.evidenceIds`, t);
1488
1563
  return {
1489
1564
  type: "paragraph",
1490
1565
  text: b(
@@ -1498,15 +1573,15 @@ function sn(e, n, t) {
1498
1573
  }
1499
1574
  if (a === "finding") {
1500
1575
  h(o, r, ["type", "title", "text", "severity", "evidenceIds"], t);
1501
- const i = I(
1576
+ const i = E(
1502
1577
  o.title,
1503
1578
  `${r}.title`,
1504
1579
  u.contentTitle,
1505
1580
  t
1506
- ), c = k(
1581
+ ), c = A(
1507
1582
  o.severity,
1508
1583
  `${r}.severity`,
1509
- Xt,
1584
+ tn,
1510
1585
  "info, positive, warning, or critical",
1511
1586
  t
1512
1587
  );
@@ -1520,23 +1595,23 @@ function sn(e, n, t) {
1520
1595
  t
1521
1596
  ),
1522
1597
  ...c ? { severity: c } : {},
1523
- evidenceIds: x(o.evidenceIds, `${r}.evidenceIds`, t, {
1598
+ evidenceIds: T(o.evidenceIds, `${r}.evidenceIds`, t, {
1524
1599
  required: !0
1525
1600
  }) ?? []
1526
1601
  };
1527
1602
  }
1528
1603
  if (a === "bullets" || a === "actions" || a === "limitations") {
1529
1604
  h(o, r, ["type", "title", "items", "evidenceIds"], t);
1530
- const i = I(
1605
+ const i = E(
1531
1606
  o.title,
1532
1607
  `${r}.title`,
1533
1608
  u.contentTitle,
1534
1609
  t
1535
- ), c = x(o.evidenceIds, `${r}.evidenceIds`, t);
1610
+ ), c = T(o.evidenceIds, `${r}.evidenceIds`, t);
1536
1611
  return {
1537
1612
  type: a,
1538
1613
  ...i ? { title: i } : {},
1539
- items: on(o.items, `${r}.items`, t),
1614
+ items: mn(o.items, `${r}.items`, t),
1540
1615
  ...c ? { evidenceIds: c } : {}
1541
1616
  };
1542
1617
  }
@@ -1556,30 +1631,30 @@ function sn(e, n, t) {
1556
1631
  ],
1557
1632
  t
1558
1633
  );
1559
- const i = w(o.value, `${r}.value`, t) ?? "";
1560
- i === "" && d(
1634
+ const i = _(o.value, `${r}.value`, t) ?? "";
1635
+ i === "" && s(
1561
1636
  t,
1562
1637
  `${r}.value`,
1563
1638
  "Expected a non-empty string, number, or structured numeric value."
1564
1639
  );
1565
- const c = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : w(
1640
+ const c = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : _(
1566
1641
  o.previousValue,
1567
1642
  `${r}.previousValue`,
1568
1643
  t
1569
- ), l = o.delta === void 0 || o.delta === null ? o.delta : w(
1644
+ ), l = o.delta === void 0 || o.delta === null ? o.delta : _(
1570
1645
  o.delta,
1571
1646
  `${r}.delta`,
1572
1647
  t
1573
- ), m = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : w(
1648
+ ), m = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : _(
1574
1649
  o.percentChange,
1575
1650
  `${r}.percentChange`,
1576
1651
  t
1577
- ), s = I(
1652
+ ), d = E(
1578
1653
  o.unit,
1579
1654
  `${r}.unit`,
1580
1655
  u.contentTitle,
1581
1656
  t
1582
- ), f = x(o.evidenceIds, `${r}.evidenceIds`, t);
1657
+ ), f = T(o.evidenceIds, `${r}.evidenceIds`, t);
1583
1658
  return {
1584
1659
  type: "metric",
1585
1660
  label: b(
@@ -1592,25 +1667,25 @@ function sn(e, n, t) {
1592
1667
  ...c !== void 0 ? { previousValue: c } : {},
1593
1668
  ...l !== void 0 ? { delta: l } : {},
1594
1669
  ...m !== void 0 ? { percentChange: m } : {},
1595
- ...s ? { unit: s } : {},
1670
+ ...d ? { unit: d } : {},
1596
1671
  ...f ? { evidenceIds: f } : {}
1597
1672
  };
1598
1673
  }
1599
1674
  if (a === "kpi_grid") {
1600
1675
  h(o, r, ["type", "title", "tiles", "evidenceIds"], t);
1601
- const i = I(
1676
+ const i = E(
1602
1677
  o.title,
1603
1678
  `${r}.title`,
1604
1679
  u.contentTitle,
1605
1680
  t
1606
1681
  ), c = Array.isArray(o.tiles) ? o.tiles : [];
1607
- Array.isArray(o.tiles) || d(t, `${r}.tiles`, "Expected an array."), c.length === 0 && d(t, `${r}.tiles`, "Expected at least one tile."), c.length > $.maxKpiTiles && d(
1682
+ Array.isArray(o.tiles) || s(t, `${r}.tiles`, "Expected an array."), c.length === 0 && s(t, `${r}.tiles`, "Expected at least one tile."), c.length > $.maxKpiTiles && s(
1608
1683
  t,
1609
1684
  `${r}.tiles`,
1610
1685
  `Must have ${$.maxKpiTiles} tiles or fewer.`
1611
1686
  );
1612
- const l = c.slice(0, $.maxKpiTiles).map((s, f) => {
1613
- const p = `${r}.tiles.${f}`, g = E(s, p, t);
1687
+ const l = c.slice(0, $.maxKpiTiles).map((d, f) => {
1688
+ const p = `${r}.tiles.${f}`, g = I(d, p, t);
1614
1689
  h(
1615
1690
  g,
1616
1691
  p,
@@ -1625,34 +1700,34 @@ function sn(e, n, t) {
1625
1700
  ],
1626
1701
  t
1627
1702
  );
1628
- const v = w(
1703
+ const v = _(
1629
1704
  g.value,
1630
1705
  `${p}.value`,
1631
1706
  t
1632
1707
  ) ?? "";
1633
- v === "" && d(
1708
+ v === "" && s(
1634
1709
  t,
1635
1710
  `${p}.value`,
1636
1711
  "Expected a non-empty string, number, or structured numeric value."
1637
1712
  );
1638
- const A = g.previousValue === void 0 || g.previousValue === null ? g.previousValue : w(
1713
+ const k = g.previousValue === void 0 || g.previousValue === null ? g.previousValue : _(
1639
1714
  g.previousValue,
1640
1715
  `${p}.previousValue`,
1641
1716
  t
1642
- ), F = g.delta === void 0 || g.delta === null ? g.delta : w(
1717
+ ), N = g.delta === void 0 || g.delta === null ? g.delta : _(
1643
1718
  g.delta,
1644
1719
  `${p}.delta`,
1645
1720
  t
1646
- ), ee = g.percentChange === void 0 || g.percentChange === null ? g.percentChange : w(
1721
+ ), te = g.percentChange === void 0 || g.percentChange === null ? g.percentChange : _(
1647
1722
  g.percentChange,
1648
1723
  `${p}.percentChange`,
1649
1724
  t
1650
- ), te = I(
1725
+ ), ne = E(
1651
1726
  g.unit,
1652
1727
  `${p}.unit`,
1653
1728
  u.contentTitle,
1654
1729
  t
1655
- ), ne = x(
1730
+ ), re = T(
1656
1731
  g.evidenceIds,
1657
1732
  `${p}.evidenceIds`,
1658
1733
  t
@@ -1665,13 +1740,13 @@ function sn(e, n, t) {
1665
1740
  t
1666
1741
  ),
1667
1742
  value: v,
1668
- ...A !== void 0 ? { previousValue: A } : {},
1669
- ...F !== void 0 ? { delta: F } : {},
1670
- ...ee !== void 0 ? { percentChange: ee } : {},
1671
- ...te ? { unit: te } : {},
1672
- ...ne ? { evidenceIds: ne } : {}
1743
+ ...k !== void 0 ? { previousValue: k } : {},
1744
+ ...N !== void 0 ? { delta: N } : {},
1745
+ ...te !== void 0 ? { percentChange: te } : {},
1746
+ ...ne ? { unit: ne } : {},
1747
+ ...re ? { evidenceIds: re } : {}
1673
1748
  };
1674
- }), m = x(
1749
+ }), m = T(
1675
1750
  o.evidenceIds,
1676
1751
  `${r}.evidenceIds`,
1677
1752
  t
@@ -1686,13 +1761,13 @@ function sn(e, n, t) {
1686
1761
  if (a === "progress") {
1687
1762
  h(o, r, ["type", "label", "value", "detail", "evidenceIds"], t);
1688
1763
  const i = typeof o.value == "number" && Number.isFinite(o.value) ? o.value : 0;
1689
- (typeof o.value != "number" || !Number.isFinite(o.value)) && d(t, `${r}.value`, "Expected a finite number.");
1690
- const c = I(
1764
+ (typeof o.value != "number" || !Number.isFinite(o.value)) && s(t, `${r}.value`, "Expected a finite number.");
1765
+ const c = E(
1691
1766
  o.detail,
1692
1767
  `${r}.detail`,
1693
1768
  u.contentText,
1694
1769
  t
1695
- ), l = x(o.evidenceIds, `${r}.evidenceIds`, t);
1770
+ ), l = T(o.evidenceIds, `${r}.evidenceIds`, t);
1696
1771
  return {
1697
1772
  type: "progress",
1698
1773
  label: b(
@@ -1713,40 +1788,40 @@ function sn(e, n, t) {
1713
1788
  ["type", "id", "title", "columns", "rows", "caption", "totalRows", "evidenceIds"],
1714
1789
  t
1715
1790
  );
1716
- const i = ln(o.columns, `${r}.columns`, t), c = I(
1791
+ const i = pn(o.columns, `${r}.columns`, t), c = E(
1717
1792
  o.title,
1718
1793
  `${r}.title`,
1719
1794
  u.contentTitle,
1720
1795
  t
1721
- ), l = I(
1796
+ ), l = E(
1722
1797
  o.id,
1723
1798
  `${r}.id`,
1724
1799
  u.id,
1725
1800
  t
1726
- ), m = I(
1801
+ ), m = E(
1727
1802
  o.caption,
1728
1803
  `${r}.caption`,
1729
1804
  u.contentItem,
1730
1805
  t
1731
- ), s = en(
1806
+ ), d = cn(
1732
1807
  o.totalRows,
1733
1808
  `${r}.totalRows`,
1734
1809
  t
1735
- ), f = x(o.evidenceIds, `${r}.evidenceIds`, t);
1810
+ ), f = T(o.evidenceIds, `${r}.evidenceIds`, t);
1736
1811
  return {
1737
1812
  type: "table",
1738
1813
  ...l ? { id: l } : {},
1739
1814
  ...c ? { title: c } : {},
1740
1815
  columns: i,
1741
- rows: dn(o.rows, `${r}.rows`, i, t),
1816
+ rows: hn(o.rows, `${r}.rows`, i, t),
1742
1817
  ...m ? { caption: m } : {},
1743
- ...s !== void 0 ? { totalRows: s } : {},
1818
+ ...d !== void 0 ? { totalRows: d } : {},
1744
1819
  ...f ? { evidenceIds: f } : {}
1745
1820
  };
1746
1821
  }
1747
1822
  if (a === "evidence_appendix") {
1748
1823
  h(o, r, ["type", "title", "evidenceIds"], t);
1749
- const i = I(
1824
+ const i = E(
1750
1825
  o.title,
1751
1826
  `${r}.title`,
1752
1827
  u.contentTitle,
@@ -1755,14 +1830,14 @@ function sn(e, n, t) {
1755
1830
  return {
1756
1831
  type: "evidence_appendix",
1757
1832
  ...i ? { title: i } : {},
1758
- evidenceIds: x(o.evidenceIds, `${r}.evidenceIds`, t, {
1833
+ evidenceIds: T(o.evidenceIds, `${r}.evidenceIds`, t, {
1759
1834
  required: !0
1760
1835
  }) ?? []
1761
1836
  };
1762
1837
  }
1763
1838
  if (a === "sql") {
1764
1839
  h(o, r, ["type", "title", "sql", "evidenceIds"], t);
1765
- const i = I(
1840
+ const i = E(
1766
1841
  o.title,
1767
1842
  `${r}.title`,
1768
1843
  u.contentTitle,
@@ -1772,7 +1847,7 @@ function sn(e, n, t) {
1772
1847
  `${r}.sql`,
1773
1848
  u.contentSql,
1774
1849
  t
1775
- ), l = x(o.evidenceIds, `${r}.evidenceIds`, t);
1850
+ ), l = T(o.evidenceIds, `${r}.evidenceIds`, t);
1776
1851
  return {
1777
1852
  type: "sql",
1778
1853
  ...i ? { title: i } : {},
@@ -1780,7 +1855,7 @@ function sn(e, n, t) {
1780
1855
  ...l ? { evidenceIds: l } : {}
1781
1856
  };
1782
1857
  }
1783
- return d(
1858
+ return s(
1784
1859
  t,
1785
1860
  `${r}.type`,
1786
1861
  "Expected heading, paragraph, finding, bullets, metric, kpi_grid, progress, table, actions, limitations, sql, or evidence_appendix."
@@ -1789,158 +1864,158 @@ function sn(e, n, t) {
1789
1864
  text: ""
1790
1865
  };
1791
1866
  }
1792
- function mn(e) {
1793
- const n = [], t = E(e, "content", n);
1794
- h(t, "content", ["version", "title", "summary", "blocks"], n), t.version !== 1 && d(n, "content.version", "Expected version 1.");
1795
- const r = I(
1867
+ function gn(e) {
1868
+ const n = [], t = I(e, "content", n);
1869
+ h(t, "content", ["version", "title", "summary", "blocks"], n), t.version !== 1 && s(n, "content.version", "Expected version 1.");
1870
+ const r = E(
1796
1871
  t.title,
1797
1872
  "content.title",
1798
1873
  u.contentTitle,
1799
1874
  n
1800
- ), o = I(
1875
+ ), o = E(
1801
1876
  t.summary,
1802
1877
  "content.summary",
1803
1878
  u.contentSummary,
1804
1879
  n
1805
1880
  );
1806
- Array.isArray(t.blocks) || d(n, "content.blocks", "Expected an array.");
1881
+ Array.isArray(t.blocks) || s(n, "content.blocks", "Expected an array.");
1807
1882
  const a = Array.isArray(t.blocks) ? t.blocks : [];
1808
- a.length === 0 && d(n, "content.blocks", "Expected at least one block."), a.length > $.maxBlocks && d(
1883
+ a.length === 0 && s(n, "content.blocks", "Expected at least one block."), a.length > $.maxBlocks && s(
1809
1884
  n,
1810
1885
  "content.blocks",
1811
1886
  `Must have ${$.maxBlocks} blocks or fewer.`
1812
1887
  );
1813
- const i = a.slice(0, $.maxBlocks).map((c, l) => sn(c, l, n));
1814
- return Y(n), {
1888
+ const i = a.slice(0, $.maxBlocks).map((c, l) => yn(c, l, n));
1889
+ return J(n), {
1815
1890
  version: 1,
1816
1891
  ...r ? { title: r } : {},
1817
1892
  ...o ? { summary: o } : {},
1818
1893
  blocks: i
1819
1894
  };
1820
1895
  }
1821
- function dr(e) {
1896
+ function gr(e) {
1822
1897
  try {
1823
1898
  return {
1824
1899
  valid: !0,
1825
- value: mn(e),
1900
+ value: gn(e),
1826
1901
  issues: []
1827
1902
  };
1828
1903
  } catch (n) {
1829
- if (n instanceof P)
1904
+ if (n instanceof V)
1830
1905
  return { valid: !1, issues: n.issues };
1831
1906
  throw n;
1832
1907
  }
1833
1908
  }
1834
- function L(e, n, t, r) {
1835
- return typeof e == "string" && t.includes(e) ? e : (d(r, n, `Expected ${t.join(" or ")}.`), t[0]);
1909
+ function U(e, n, t, r) {
1910
+ return typeof e == "string" && t.includes(e) ? e : (s(r, n, `Expected ${t.join(" or ")}.`), t[0]);
1836
1911
  }
1837
- function k(e, n, t, r, o) {
1912
+ function A(e, n, t, r, o) {
1838
1913
  if (e != null) {
1839
1914
  if (typeof e == "string" && t.has(e))
1840
1915
  return e;
1841
- d(o, n, `Expected ${r}.`);
1916
+ s(o, n, `Expected ${r}.`);
1842
1917
  }
1843
1918
  }
1844
- function un(e, n, t) {
1919
+ function bn(e, n, t) {
1845
1920
  if (e != null) {
1846
1921
  if (!Array.isArray(e)) {
1847
- d(t, n, "Expected an array.");
1922
+ s(t, n, "Expected an array.");
1848
1923
  return;
1849
1924
  }
1850
1925
  return e;
1851
1926
  }
1852
1927
  }
1853
- function fn(e, n, t) {
1928
+ function En(e, n, t) {
1854
1929
  if (e != null) {
1855
- if (!Ee(e)) {
1856
- d(t, n, "Expected an object.");
1930
+ if (!ve(e)) {
1931
+ s(t, n, "Expected an object.");
1857
1932
  return;
1858
1933
  }
1859
1934
  return e;
1860
1935
  }
1861
1936
  }
1862
- function pn(e, n, t) {
1937
+ function In(e, n, t) {
1863
1938
  if (e == null)
1864
1939
  return;
1865
- const r = E(e, n, t);
1866
- h(r, n, Jt, t);
1940
+ const r = I(e, n, t);
1941
+ h(r, n, on, t);
1867
1942
  const o = {};
1868
1943
  if (r.matrix !== void 0) {
1869
- const s = E(r.matrix, `${n}.matrix`, t);
1870
- h(s, `${n}.matrix`, ["config", "content"], t);
1871
- const f = Be.safeParse(s.config);
1872
- f.success || d(t, `${n}.matrix.config`, "Expected a valid Matrix definition.");
1873
- const p = k(
1874
- s.content,
1944
+ const d = I(r.matrix, `${n}.matrix`, t);
1945
+ h(d, `${n}.matrix`, ["config", "content"], t);
1946
+ const f = Be.safeParse(d.config);
1947
+ f.success || s(t, `${n}.matrix.config`, "Expected a valid Matrix definition.");
1948
+ const p = A(
1949
+ d.content,
1875
1950
  `${n}.matrix.content`,
1876
1951
  /* @__PURE__ */ new Set(["current", "all", "flat"]),
1877
1952
  "current, all, or flat",
1878
1953
  t
1879
1954
  );
1880
- p || d(t, `${n}.matrix.content`, "Choose Matrix export content."), f.success && p && (o.matrix = { config: f.data, content: p });
1955
+ p || s(t, `${n}.matrix.content`, "Choose Matrix export content."), f.success && p && (o.matrix = { config: f.data, content: p });
1881
1956
  }
1882
- const a = k(
1957
+ const a = A(
1883
1958
  r.pageSize,
1884
1959
  `${n}.pageSize`,
1885
- jt,
1960
+ Xt,
1886
1961
  "letter, legal, a4, a3, or tabloid",
1887
1962
  t
1888
- ), i = k(
1963
+ ), i = A(
1889
1964
  r.orientation,
1890
1965
  `${n}.orientation`,
1891
- qt,
1966
+ Zt,
1892
1967
  "portrait or landscape",
1893
1968
  t
1894
- ), c = k(
1969
+ ), c = A(
1895
1970
  r.delimiter,
1896
1971
  `${n}.delimiter`,
1897
- Kt,
1972
+ Yt,
1898
1973
  "comma, semicolon, or tab",
1899
1974
  t
1900
- ), l = k(
1975
+ ), l = A(
1901
1976
  r.csvEncoding,
1902
1977
  `${n}.csvEncoding`,
1903
- Ht,
1978
+ Jt,
1904
1979
  "utf-8-bom or utf-8",
1905
1980
  t
1906
- ), m = k(
1981
+ ), m = A(
1907
1982
  r.sheetSelection,
1908
1983
  `${n}.sheetSelection`,
1909
- Gt,
1984
+ Qt,
1910
1985
  "current or all",
1911
1986
  t
1912
1987
  );
1913
1988
  a && (o.pageSize = a), i && (o.orientation = i), c && (o.delimiter = c), l && (o.csvEncoding = l), m && (o.sheetSelection = m);
1914
- for (const s of [
1989
+ for (const d of [
1915
1990
  "includeFilters",
1916
1991
  "includeTimestamp",
1917
1992
  "includeHeaders",
1918
1993
  "useFormattedValues",
1919
1994
  "allowDownload"
1920
1995
  ])
1921
- if (!(r[s] === void 0 || r[s] === null)) {
1922
- if (typeof r[s] != "boolean") {
1923
- d(t, `${n}.${s}`, "Expected a boolean.");
1996
+ if (!(r[d] === void 0 || r[d] === null)) {
1997
+ if (typeof r[d] != "boolean") {
1998
+ s(t, `${n}.${d}`, "Expected a boolean.");
1924
1999
  continue;
1925
2000
  }
1926
- o[s] = r[s];
2001
+ o[d] = r[d];
1927
2002
  }
1928
- for (const s of [
2003
+ for (const d of [
1929
2004
  "currentSheetId",
1930
2005
  "currentSheetName",
1931
2006
  "selectedSheetId",
1932
2007
  "cardType",
1933
2008
  "theme"
1934
2009
  ]) {
1935
- const f = I(
1936
- r[s],
1937
- `${n}.${s}`,
2010
+ const f = E(
2011
+ r[d],
2012
+ `${n}.${d}`,
1938
2013
  u.id,
1939
2014
  t
1940
2015
  );
1941
- f && (o[s] = f);
2016
+ f && (o[d] = f);
1942
2017
  }
1943
- for (const s of [
2018
+ for (const d of [
1944
2019
  "filterValues",
1945
2020
  "inlineFilterValues",
1946
2021
  "sheetFilterValues",
@@ -1948,22 +2023,22 @@ function pn(e, n, t) {
1948
2023
  "cardControlDefinitions",
1949
2024
  "controlBindings"
1950
2025
  ]) {
1951
- const f = un(r[s], `${n}.${s}`, t);
1952
- f && (o[s] = f);
2026
+ const f = bn(r[d], `${n}.${d}`, t);
2027
+ f && (o[d] = f);
1953
2028
  }
1954
- for (const s of [
2029
+ for (const d of [
1955
2030
  "controlValues",
1956
2031
  "tablePreferences",
1957
2032
  "dashboardInputExecutionSnapshot",
1958
2033
  "printInputCapture"
1959
2034
  ]) {
1960
- const f = fn(r[s], `${n}.${s}`, t);
1961
- f && (o[s] = f);
2035
+ const f = En(r[d], `${n}.${d}`, t);
2036
+ f && (o[d] = f);
1962
2037
  }
1963
2038
  return Object.keys(o).length > 0 ? o : void 0;
1964
2039
  }
1965
- function q(e, n, t, r) {
1966
- const o = I(
2040
+ function K(e, n, t, r) {
2041
+ const o = E(
1967
2042
  n,
1968
2043
  t,
1969
2044
  u.attachmentTitle,
@@ -1971,16 +2046,16 @@ function q(e, n, t, r) {
1971
2046
  );
1972
2047
  return o && (e.title = o), e;
1973
2048
  }
1974
- function K(e, n, t, r) {
1975
- const o = pn(n, t, r);
1976
- return o != null && o.printInputCapture && e.type !== "dashboard" && d(
2049
+ function G(e, n, t, r) {
2050
+ const o = In(n, t, r);
2051
+ return o != null && o.printInputCapture && e.type !== "dashboard" && s(
1977
2052
  r,
1978
2053
  `${t}.printInputCapture`,
1979
2054
  "Only a full dashboard attachment can carry printInputCapture."
1980
2055
  ), o && (e.settings = o), e;
1981
2056
  }
1982
- function hn(e, n, t) {
1983
- const r = `attachments.${n}`, o = E(e, r, t), a = o.type;
2057
+ function vn(e, n, t) {
2058
+ const r = `attachments.${n}`, o = I(e, r, t), a = o.type;
1984
2059
  if (a === "dashboard") {
1985
2060
  h(
1986
2061
  o,
@@ -1988,7 +2063,7 @@ function hn(e, n, t) {
1988
2063
  ["type", "dashboardId", "format", "title", "settings"],
1989
2064
  t
1990
2065
  );
1991
- const i = q(
2066
+ const i = K(
1992
2067
  {
1993
2068
  type: "dashboard",
1994
2069
  dashboardId: b(
@@ -1997,13 +2072,13 @@ function hn(e, n, t) {
1997
2072
  u.id,
1998
2073
  t
1999
2074
  ),
2000
- format: L(o.format, `${r}.format`, ["pdf"], t)
2075
+ format: U(o.format, `${r}.format`, ["pdf"], t)
2001
2076
  },
2002
2077
  o.title,
2003
2078
  `${r}.title`,
2004
2079
  t
2005
2080
  );
2006
- return K(i, o.settings, `${r}.settings`, t);
2081
+ return G(i, o.settings, `${r}.settings`, t);
2007
2082
  }
2008
2083
  if (a === "dashboard_sheet" || a === "document_sheet") {
2009
2084
  h(
@@ -2012,7 +2087,7 @@ function hn(e, n, t) {
2012
2087
  ["type", "dashboardId", "sheetId", "format", "title", "settings"],
2013
2088
  t
2014
2089
  );
2015
- const i = q(
2090
+ const i = K(
2016
2091
  {
2017
2092
  type: a,
2018
2093
  dashboardId: b(
@@ -2027,7 +2102,7 @@ function hn(e, n, t) {
2027
2102
  u.id,
2028
2103
  t
2029
2104
  ),
2030
- format: L(
2105
+ format: U(
2031
2106
  o.format,
2032
2107
  `${r}.format`,
2033
2108
  a === "dashboard_sheet" ? ["pdf", "png"] : ["pdf"],
@@ -2038,8 +2113,8 @@ function hn(e, n, t) {
2038
2113
  `${r}.title`,
2039
2114
  t
2040
2115
  );
2041
- return ce(
2042
- K(i, o.settings, `${r}.settings`, t)
2116
+ return le(
2117
+ G(i, o.settings, `${r}.settings`, t)
2043
2118
  );
2044
2119
  }
2045
2120
  if (a === "card") {
@@ -2049,7 +2124,7 @@ function hn(e, n, t) {
2049
2124
  ["type", "dashboardId", "cardId", "format", "title", "settings"],
2050
2125
  t
2051
2126
  );
2052
- const i = q(
2127
+ const i = K(
2053
2128
  {
2054
2129
  type: "card",
2055
2130
  dashboardId: b(
@@ -2064,10 +2139,10 @@ function hn(e, n, t) {
2064
2139
  u.id,
2065
2140
  t
2066
2141
  ),
2067
- format: L(
2142
+ format: U(
2068
2143
  o.format,
2069
2144
  `${r}.format`,
2070
- be,
2145
+ Ee,
2071
2146
  t
2072
2147
  )
2073
2148
  },
@@ -2075,17 +2150,17 @@ function hn(e, n, t) {
2075
2150
  `${r}.title`,
2076
2151
  t
2077
2152
  );
2078
- return ce(
2079
- K(i, o.settings, `${r}.settings`, t)
2153
+ return le(
2154
+ G(i, o.settings, `${r}.settings`, t)
2080
2155
  );
2081
2156
  }
2082
- return d(
2157
+ return s(
2083
2158
  t,
2084
2159
  `${r}.type`,
2085
2160
  "Expected dashboard, dashboard_sheet, document_sheet, or card."
2086
2161
  ), { type: "dashboard", dashboardId: "", format: "pdf" };
2087
2162
  }
2088
- function ce(e) {
2163
+ function le(e) {
2089
2164
  if (e.format !== "png" || !e.settings) return e;
2090
2165
  const {
2091
2166
  pageSize: n,
@@ -2095,7 +2170,7 @@ function ce(e) {
2095
2170
  } = e.settings, { settings: a, ...i } = e;
2096
2171
  return Object.keys(o).length > 0 ? { ...i, settings: o } : i;
2097
2172
  }
2098
- function yn(e) {
2173
+ function $n(e) {
2099
2174
  switch (e.type) {
2100
2175
  case "dashboard":
2101
2176
  return `${e.type}:${e.dashboardId}:${e.format}`;
@@ -2106,37 +2181,37 @@ function yn(e) {
2106
2181
  return `${e.type}:${e.dashboardId}:${e.cardId}:${e.format}`;
2107
2182
  }
2108
2183
  }
2109
- function Te(e, n) {
2184
+ function Se(e, n) {
2110
2185
  if (e == null)
2111
2186
  return [];
2112
2187
  if (!Array.isArray(e))
2113
- return d(n, "attachments", "Expected an array."), [];
2114
- e.length > z && d(
2188
+ return s(n, "attachments", "Expected an array."), [];
2189
+ e.length > j && s(
2115
2190
  n,
2116
2191
  "attachments",
2117
- `Choose ${z} attachments or fewer.`
2192
+ `Choose ${j} attachments or fewer.`
2118
2193
  );
2119
- const t = e.slice(0, z).map((o, a) => hn(o, a, n)), r = /* @__PURE__ */ new Set();
2194
+ const t = e.slice(0, j).map((o, a) => vn(o, a, n)), r = /* @__PURE__ */ new Set();
2120
2195
  return t.forEach((o, a) => {
2121
- var c, l, m, s;
2122
- (c = o.settings) != null && c.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format === "pdf") && d(n, `attachments.${a}.settings.matrix`, "Matrix settings require a matrixTable card attachment; flat content requires CSV or Excel."), o.format === "png" && ((l = o.settings) != null && l.matrix) && o.settings.matrix.content !== "current" && d(n, `attachments.${a}.settings.matrix.content`, "A Matrix PNG image shows the current layout."), o.format === "xlsx" && !((m = o.settings) != null && m.matrix) && !X((s = o.settings) == null ? void 0 : s.cardType) && d(n, `attachments.${a}.format`, "Excel attachments require a Table, Detail Table or Matrix card.");
2123
- const i = yn(o);
2124
- r.has(i) && d(n, `attachments.${a}`, "Duplicate attachment."), r.add(i);
2196
+ var c, l, m, d;
2197
+ (c = o.settings) != null && c.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format === "pdf") && s(n, `attachments.${a}.settings.matrix`, "Matrix settings require a matrixTable card attachment; flat content requires CSV or Excel."), o.format === "png" && ((l = o.settings) != null && l.matrix) && o.settings.matrix.content !== "current" && s(n, `attachments.${a}.settings.matrix.content`, "A Matrix PNG image shows the current layout."), o.format === "xlsx" && !((m = o.settings) != null && m.matrix) && !Z((d = o.settings) == null ? void 0 : d.cardType) && s(n, `attachments.${a}.format`, "Excel attachments require a Table, Detail Table or Matrix card.");
2198
+ const i = $n(o);
2199
+ r.has(i) && s(n, `attachments.${a}`, "Duplicate attachment."), r.add(i);
2125
2200
  }), t;
2126
2201
  }
2127
- function Se(e, n) {
2202
+ function Ae(e, n) {
2128
2203
  if (e == null)
2129
2204
  return;
2130
- const t = E(e, "limits", n);
2131
- h(t, "limits", Object.keys(j), n);
2205
+ const t = I(e, "limits", n);
2206
+ h(t, "limits", Object.keys(q), n);
2132
2207
  const r = {};
2133
- return Object.keys(j).forEach((o) => {
2208
+ return Object.keys(q).forEach((o) => {
2134
2209
  const a = t[o];
2135
2210
  if (a == null)
2136
2211
  return;
2137
- const i = j[o];
2212
+ const i = q[o];
2138
2213
  if (typeof a != "number" || !Number.isInteger(a) || a < i.min || a > i.max) {
2139
- d(
2214
+ s(
2140
2215
  n,
2141
2216
  `limits.${o}`,
2142
2217
  `Expected an integer between ${i.min} and ${i.max}.`
@@ -2146,41 +2221,41 @@ function Se(e, n) {
2146
2221
  r[o] = a;
2147
2222
  }), Object.keys(r).length > 0 ? r : void 0;
2148
2223
  }
2149
- function Y(e) {
2224
+ function J(e) {
2150
2225
  if (e.length > 0)
2151
- throw new P(e);
2226
+ throw new V(e);
2152
2227
  }
2153
2228
  function ke(e, n, t) {
2154
- !(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && n.length === 0 && d(
2229
+ !(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && n.length === 0 && s(
2155
2230
  t,
2156
2231
  "body",
2157
2232
  "Add briefing instructions, a custom message, or at least one attachment."
2158
2233
  );
2159
2234
  }
2160
- function gn(e, n, t) {
2235
+ function Cn(e, n, t) {
2161
2236
  e == null || e.forEach((r, o) => {
2162
2237
  const a = `${t}.${o}.scope`, i = r.scope.attachmentIndex;
2163
2238
  if (i === void 0)
2164
- throw new N(
2239
+ throw new F(
2165
2240
  `${a}.attachmentIndex must identify the attachment that owns this presentation entry.`
2166
2241
  );
2167
2242
  const c = n[i];
2168
2243
  if (!c)
2169
- throw new N(
2244
+ throw new F(
2170
2245
  `${a}.attachmentIndex must identify an existing attachment.`
2171
2246
  );
2172
2247
  if (r.scope.dashboardId !== c.dashboardId)
2173
- throw new N(
2248
+ throw new F(
2174
2249
  `${a}.dashboardId must match the dashboard selected by the referenced attachment.`
2175
2250
  );
2176
2251
  if (c.type === "card" && r.scope.cardId !== c.cardId)
2177
- throw new N(
2252
+ throw new F(
2178
2253
  `${a}.cardId must match the card selected by the referenced attachment.`
2179
2254
  );
2180
2255
  });
2181
2256
  }
2182
- function Ae(e) {
2183
- const n = [], t = E(e, "jobConfig", n);
2257
+ function _e(e) {
2258
+ const n = [], t = I(e, "jobConfig", n);
2184
2259
  h(
2185
2260
  t,
2186
2261
  "jobConfig",
@@ -2194,27 +2269,27 @@ function Ae(e) {
2194
2269
  "limits"
2195
2270
  ],
2196
2271
  n
2197
- ), t.kind !== H && d(n, "kind", "Expected BRIEFING.");
2272
+ ), t.kind !== H && s(n, "kind", "Expected BRIEFING.");
2198
2273
  let r;
2199
2274
  try {
2200
- r = Re(
2275
+ r = Me(
2201
2276
  t.presentationExecutionSnapshot
2202
2277
  );
2203
2278
  } catch (m) {
2204
- if (m instanceof N)
2279
+ if (m instanceof F)
2205
2280
  throw m;
2206
- d(
2281
+ s(
2207
2282
  n,
2208
2283
  "jobConfig.presentationExecutionSnapshot",
2209
2284
  m instanceof Error ? m.message : "Invalid presentation snapshot."
2210
2285
  );
2211
2286
  }
2212
- const o = ve(t.source, n), a = $e(t.body, n), i = Te(t.attachments, n), c = Ce(t.presentation, n), l = Se(t.limits, n);
2213
- return ke(a, i, n), gn(
2287
+ const o = $e(t.source, n), a = Ce(t.body, n), i = Se(t.attachments, n), c = Te(t.presentation, n), l = Ae(t.limits, n);
2288
+ return ke(a, i, n), Cn(
2214
2289
  r == null ? void 0 : r.resolvedFormats,
2215
2290
  i,
2216
2291
  "jobConfig.presentationExecutionSnapshot.resolvedFormats"
2217
- ), Y(n), {
2292
+ ), J(n), {
2218
2293
  kind: H,
2219
2294
  presentationExecutionSnapshot: r,
2220
2295
  source: o,
@@ -2224,14 +2299,14 @@ function Ae(e) {
2224
2299
  ...l ? { limits: l } : {}
2225
2300
  };
2226
2301
  }
2227
- function sr(e) {
2228
- return Ae({
2302
+ function br(e) {
2303
+ return _e({
2229
2304
  ...e,
2230
2305
  kind: H
2231
2306
  });
2232
2307
  }
2233
- function J(e, n, t, r = "deliveryConfig.recipients") {
2234
- const o = `${r}.${n}`, a = E(e, o, t), i = a.type;
2308
+ function Q(e, n, t, r = "deliveryConfig.recipients") {
2309
+ const o = `${r}.${n}`, a = I(e, o, t), i = a.type;
2235
2310
  if (i === "email") {
2236
2311
  h(a, o, ["type", "address", "name"], t);
2237
2312
  const c = b(
@@ -2239,13 +2314,13 @@ function J(e, n, t, r = "deliveryConfig.recipients") {
2239
2314
  `${o}.address`,
2240
2315
  u.id,
2241
2316
  t
2242
- ), l = I(
2317
+ ), l = E(
2243
2318
  a.name,
2244
2319
  `${o}.name`,
2245
2320
  u.attachmentTitle,
2246
2321
  t
2247
2322
  );
2248
- return c && !nn(c) && d(t, `${o}.address`, "Email address is invalid."), {
2323
+ return c && !sn(c) && s(t, `${o}.address`, "Email address is invalid."), {
2249
2324
  type: "email",
2250
2325
  address: c,
2251
2326
  ...l ? { name: l } : {}
@@ -2275,24 +2350,24 @@ function J(e, n, t, r = "deliveryConfig.recipients") {
2275
2350
  u.id,
2276
2351
  t
2277
2352
  )
2278
- }) : (d(
2353
+ }) : (s(
2279
2354
  t,
2280
2355
  `${o}.type`,
2281
2356
  "Expected email, user, tenant_user, or group."
2282
2357
  ), { type: "email", address: "" });
2283
2358
  }
2284
- function bn(e, n) {
2359
+ function Tn(e, n) {
2285
2360
  return e == null ? [] : Array.isArray(e) ? e.map(
2286
- (t, r) => J(t, r, n)
2287
- ) : (d(n, "deliveryConfig.recipients", "Expected an array."), []);
2361
+ (t, r) => Q(t, r, n)
2362
+ ) : (s(n, "deliveryConfig.recipients", "Expected an array."), []);
2288
2363
  }
2289
- function In(e, n) {
2364
+ function xn(e, n) {
2290
2365
  if (!Array.isArray(e))
2291
- return d(n, "deliveryConfig.channels", "Expected an array."), [];
2366
+ return s(n, "deliveryConfig.channels", "Expected an array."), [];
2292
2367
  const t = [];
2293
2368
  return e.forEach((r, o) => {
2294
2369
  if (!we(r)) {
2295
- d(
2370
+ s(
2296
2371
  n,
2297
2372
  `deliveryConfig.channels.${o}`,
2298
2373
  "Expected EMAIL, WEBHOOK, SLACK, IN_APP, or TELEGRAM."
@@ -2302,29 +2377,29 @@ function In(e, n) {
2302
2377
  t.includes(r) || t.push(r);
2303
2378
  }), t;
2304
2379
  }
2305
- function En(e, n, t) {
2380
+ function Sn(e, n, t) {
2306
2381
  if (e == null)
2307
2382
  return;
2308
- const r = E(e, n, t), o = {};
2383
+ const r = I(e, n, t), o = {};
2309
2384
  return Object.entries(r).forEach(([a, i]) => {
2310
2385
  if (typeof i != "string") {
2311
- d(t, `${n}.${a}`, "Expected a string.");
2386
+ s(t, `${n}.${a}`, "Expected a string.");
2312
2387
  return;
2313
2388
  }
2314
2389
  o[a] = i.trim();
2315
2390
  }), Object.keys(o).length > 0 ? o : void 0;
2316
2391
  }
2317
- function vn(e, n, t) {
2392
+ function An(e, n, t) {
2318
2393
  if (e == null)
2319
2394
  return;
2320
- const r = E(e, n, t);
2395
+ const r = I(e, n, t);
2321
2396
  h(
2322
2397
  r,
2323
2398
  n,
2324
2399
  ["url", "method", "headers", "secretEncrypted"],
2325
2400
  t
2326
2401
  );
2327
- const o = r.method === void 0 || r.method === null ? void 0 : L(r.method, `${n}.method`, ["POST", "PUT"], t), a = En(r.headers, `${n}.headers`, t), i = I(
2402
+ const o = r.method === void 0 || r.method === null ? void 0 : U(r.method, `${n}.method`, ["POST", "PUT"], t), a = Sn(r.headers, `${n}.headers`, t), i = E(
2328
2403
  r.secretEncrypted,
2329
2404
  `${n}.secretEncrypted`,
2330
2405
  2e3,
@@ -2337,8 +2412,8 @@ function vn(e, n, t) {
2337
2412
  ...i ? { secretEncrypted: i } : {}
2338
2413
  };
2339
2414
  }
2340
- function $n(e, n, t) {
2341
- const r = E(e, n, t), o = r.type;
2415
+ function kn(e, n, t) {
2416
+ const r = I(e, n, t), o = r.type;
2342
2417
  if (o === "channel") {
2343
2418
  h(
2344
2419
  r,
@@ -2346,12 +2421,12 @@ function $n(e, n, t) {
2346
2421
  ["type", "channelId", "channelName", "isPrivate"],
2347
2422
  t
2348
2423
  );
2349
- const a = I(
2424
+ const a = E(
2350
2425
  r.channelName,
2351
2426
  `${n}.channelName`,
2352
2427
  u.attachmentTitle,
2353
2428
  t
2354
- ), i = r.isPrivate === void 0 || r.isPrivate === null ? void 0 : _(
2429
+ ), i = r.isPrivate === void 0 || r.isPrivate === null ? void 0 : D(
2355
2430
  r.isPrivate,
2356
2431
  !1,
2357
2432
  `${n}.isPrivate`,
@@ -2369,31 +2444,31 @@ function $n(e, n, t) {
2369
2444
  ...i !== void 0 ? { isPrivate: i } : {}
2370
2445
  };
2371
2446
  }
2372
- return o === "dm" ? (h(r, n, ["type", "recipient"], t), d(
2447
+ return o === "dm" ? (h(r, n, ["type", "recipient"], t), s(
2373
2448
  t,
2374
2449
  `${n}.type`,
2375
2450
  "Slack DM delivery is not supported in V1."
2376
2451
  ), {
2377
2452
  type: "dm",
2378
- recipient: J(r.recipient, 0, t, `${n}.recipient`)
2379
- }) : (d(t, `${n}.type`, "Expected channel."), { type: "channel", channelId: "" });
2453
+ recipient: Q(r.recipient, 0, t, `${n}.recipient`)
2454
+ }) : (s(t, `${n}.type`, "Expected channel."), { type: "channel", channelId: "" });
2380
2455
  }
2381
- function Cn(e, n, t) {
2456
+ function _n(e, n, t) {
2382
2457
  if (e == null)
2383
2458
  return;
2384
2459
  if (!Array.isArray(e)) {
2385
- d(t, n, "Expected an array.");
2460
+ s(t, n, "Expected an array.");
2386
2461
  return;
2387
2462
  }
2388
2463
  const r = e.map(
2389
- (o, a) => J(o, a, t, n)
2464
+ (o, a) => Q(o, a, t, n)
2390
2465
  );
2391
2466
  return r.length > 0 ? r : void 0;
2392
2467
  }
2393
- function xn(e, n, t) {
2468
+ function wn(e, n, t) {
2394
2469
  if (e == null)
2395
2470
  return;
2396
- const r = E(e, n, t);
2471
+ const r = I(e, n, t);
2397
2472
  h(
2398
2473
  r,
2399
2474
  n,
@@ -2406,28 +2481,28 @@ function xn(e, n, t) {
2406
2481
  ],
2407
2482
  t
2408
2483
  );
2409
- const o = Cn(
2484
+ const o = _n(
2410
2485
  r.threadMentions,
2411
2486
  `${n}.threadMentions`,
2412
2487
  t
2413
- ), a = _(
2488
+ ), a = D(
2414
2489
  r.postThreadDetail,
2415
2490
  !0,
2416
2491
  `${n}.postThreadDetail`,
2417
2492
  t
2418
- ), i = _(
2493
+ ), i = D(
2419
2494
  r.includeDashboardLink,
2420
2495
  !0,
2421
2496
  `${n}.includeDashboardLink`,
2422
2497
  t
2423
- ), c = _(
2498
+ ), c = D(
2424
2499
  r.includeBriefingLink,
2425
2500
  !0,
2426
2501
  `${n}.includeBriefingLink`,
2427
2502
  t
2428
2503
  );
2429
2504
  return {
2430
- destination: $n(
2505
+ destination: kn(
2431
2506
  r.destination,
2432
2507
  `${n}.destination`,
2433
2508
  t
@@ -2438,8 +2513,8 @@ function xn(e, n, t) {
2438
2513
  ...r.includeBriefingLink !== void 0 ? { includeBriefingLink: c } : {}
2439
2514
  };
2440
2515
  }
2441
- function Tn(e, n, t) {
2442
- const r = E(e, n, t);
2516
+ function Dn(e, n, t) {
2517
+ const r = I(e, n, t);
2443
2518
  h(
2444
2519
  r,
2445
2520
  n,
@@ -2454,37 +2529,37 @@ function Tn(e, n, t) {
2454
2529
  ],
2455
2530
  t
2456
2531
  );
2457
- const o = k(
2532
+ const o = A(
2458
2533
  r.formatProfile,
2459
2534
  `${n}.formatProfile`,
2460
- Wt,
2535
+ en,
2461
2536
  "concise, balanced, or detailed",
2462
2537
  t
2463
- ), a = I(
2538
+ ), a = E(
2464
2539
  r.subjectOverride,
2465
2540
  `${n}.subjectOverride`,
2466
2541
  500,
2467
2542
  t
2468
- ), i = I(
2543
+ ), i = E(
2469
2544
  r.titleOverride,
2470
2545
  `${n}.titleOverride`,
2471
2546
  500,
2472
2547
  t
2473
- ), c = I(
2548
+ ), c = E(
2474
2549
  r.summaryOverride,
2475
2550
  `${n}.summaryOverride`,
2476
2551
  2e3,
2477
2552
  t
2478
- ), l = _(
2553
+ ), l = D(
2479
2554
  r.actionBlockVisible,
2480
2555
  !0,
2481
2556
  `${n}.actionBlockVisible`,
2482
2557
  t
2483
- ), m = vn(
2558
+ ), m = An(
2484
2559
  r.webhookConfig,
2485
2560
  `${n}.webhookConfig`,
2486
2561
  t
2487
- ), s = xn(
2562
+ ), d = wn(
2488
2563
  r.slackConfig,
2489
2564
  `${n}.slackConfig`,
2490
2565
  t
@@ -2495,57 +2570,57 @@ function Tn(e, n, t) {
2495
2570
  ...i ? { titleOverride: i } : {},
2496
2571
  ...c ? { summaryOverride: c } : {},
2497
2572
  ...r.actionBlockVisible !== void 0 ? { actionBlockVisible: l } : {},
2498
- ...s ? { slackConfig: s } : {},
2573
+ ...d ? { slackConfig: d } : {},
2499
2574
  ...m ? { webhookConfig: m } : {}
2500
2575
  };
2501
2576
  }
2502
- function Sn(e, n) {
2577
+ function On(e, n) {
2503
2578
  if (e == null)
2504
2579
  return;
2505
- const t = E(e, "deliveryConfig.channelConfigs", n), r = {};
2580
+ const t = I(e, "deliveryConfig.channelConfigs", n), r = {};
2506
2581
  return Object.entries(t).forEach(([o, a]) => {
2507
2582
  if (!we(o)) {
2508
- d(
2583
+ s(
2509
2584
  n,
2510
2585
  `deliveryConfig.channelConfigs.${o}`,
2511
2586
  "Expected a supported delivery channel."
2512
2587
  );
2513
2588
  return;
2514
2589
  }
2515
- r[o] = Tn(
2590
+ r[o] = Dn(
2516
2591
  a,
2517
2592
  `deliveryConfig.channelConfigs.${o}`,
2518
2593
  n
2519
2594
  );
2520
2595
  }), Object.keys(r).length > 0 ? r : void 0;
2521
2596
  }
2522
- function kn(e, n) {
2523
- var l, m, s;
2597
+ function Nn(e, n) {
2598
+ var l, m, d;
2524
2599
  if (e == null)
2525
2600
  return null;
2526
- const t = E(e, "deliveryConfig", n);
2601
+ const t = I(e, "deliveryConfig", n);
2527
2602
  h(
2528
2603
  t,
2529
2604
  "deliveryConfig",
2530
2605
  ["recipients", "channels", "channelConfigs"],
2531
2606
  n
2532
2607
  );
2533
- const r = Sn(t.channelConfigs, n), o = bn(t.recipients, n), a = In(t.channels, n), i = ((m = (l = r == null ? void 0 : r.SLACK) == null ? void 0 : l.slackConfig) == null ? void 0 : m.destination.type) === "channel" && !!r.SLACK.slackConfig.destination.channelId.trim();
2608
+ const r = On(t.channelConfigs, n), o = Tn(t.recipients, n), a = xn(t.channels, n), i = ((m = (l = r == null ? void 0 : r.SLACK) == null ? void 0 : l.slackConfig) == null ? void 0 : m.destination.type) === "channel" && !!r.SLACK.slackConfig.destination.channelId.trim();
2534
2609
  return a.some(
2535
2610
  (f) => f !== "SLACK"
2536
- ) && o.length === 0 && d(
2611
+ ) && o.length === 0 && s(
2537
2612
  n,
2538
2613
  "deliveryConfig.recipients",
2539
2614
  "Add at least one recipient or remove delivery config."
2540
- ), a.length === 0 && d(
2615
+ ), a.length === 0 && s(
2541
2616
  n,
2542
2617
  "deliveryConfig.channels",
2543
2618
  "Choose at least one delivery channel or remove delivery config."
2544
- ), a.includes("SLACK") && !i && d(
2619
+ ), a.includes("SLACK") && !i && s(
2545
2620
  n,
2546
2621
  "deliveryConfig.channelConfigs.SLACK.slackConfig.destination.channelId",
2547
2622
  "Choose a Slack channel destination."
2548
- ), !a.includes("SLACK") && ((s = r == null ? void 0 : r.SLACK) != null && s.slackConfig) && d(
2623
+ ), !a.includes("SLACK") && ((d = r == null ? void 0 : r.SLACK) != null && d.slackConfig) && s(
2549
2624
  n,
2550
2625
  "deliveryConfig.channelConfigs.SLACK",
2551
2626
  "Slack config requires SLACK in deliveryConfig.channels."
@@ -2555,8 +2630,8 @@ function kn(e, n) {
2555
2630
  ...r ? { channelConfigs: r } : {}
2556
2631
  };
2557
2632
  }
2558
- function Q(e) {
2559
- const n = [], t = E(e, "draft", n);
2633
+ function ee(e) {
2634
+ const n = [], t = I(e, "draft", n);
2560
2635
  h(
2561
2636
  t,
2562
2637
  "draft",
@@ -2580,13 +2655,13 @@ function Q(e) {
2580
2655
  "name",
2581
2656
  u.name,
2582
2657
  n
2583
- ), o = I(
2658
+ ), o = E(
2584
2659
  t.description,
2585
2660
  "description",
2586
2661
  u.description,
2587
2662
  n
2588
- ) ?? null, a = I(t.scheduleExpr, "scheduleExpr", 500, n) ?? null, i = I(t.timezone, "timezone", 200, n) ?? "UTC", c = tn(t.status, n), l = ve(t.source, n), m = $e(t.body, n), s = Te(t.attachments, n), f = Ce(t.presentation, n), p = Se(t.limits, n), g = kn(t.deliveryConfig, n);
2589
- return ke(m, s, n), Y(n), {
2663
+ ) ?? null, a = E(t.scheduleExpr, "scheduleExpr", 500, n) ?? null, i = E(t.timezone, "timezone", 200, n) ?? "UTC", c = ln(t.status, n), l = $e(t.source, n), m = Ce(t.body, n), d = Se(t.attachments, n), f = Te(t.presentation, n), p = Ae(t.limits, n), g = Nn(t.deliveryConfig, n);
2664
+ return ke(m, d, n), J(n), {
2590
2665
  name: r,
2591
2666
  description: o,
2592
2667
  status: c,
@@ -2594,98 +2669,102 @@ function Q(e) {
2594
2669
  timezone: i,
2595
2670
  source: l,
2596
2671
  body: m,
2597
- attachments: s,
2672
+ attachments: d,
2598
2673
  presentation: f,
2599
2674
  ...p ? { limits: p } : {},
2600
2675
  deliveryConfig: g
2601
2676
  };
2602
2677
  }
2603
- function mr(e) {
2604
- return Q(e);
2678
+ function Er(e) {
2679
+ return ee(e);
2605
2680
  }
2606
- function ur(e) {
2607
- return Q(e);
2681
+ function Ir(e) {
2682
+ return ee(e);
2608
2683
  }
2609
- function fr(e) {
2684
+ function vr(e) {
2610
2685
  try {
2611
- return { valid: !0, value: Q(e), issues: [] };
2686
+ return { valid: !0, value: ee(e), issues: [] };
2612
2687
  } catch (n) {
2613
- if (n instanceof P)
2688
+ if (n instanceof V)
2614
2689
  return { valid: !1, issues: n.issues };
2615
2690
  throw n;
2616
2691
  }
2617
2692
  }
2618
- function pr(e) {
2693
+ function $r(e) {
2619
2694
  try {
2620
- return { valid: !0, value: Ae(e), issues: [] };
2695
+ return { valid: !0, value: _e(e), issues: [] };
2621
2696
  } catch (n) {
2622
- if (n instanceof P)
2697
+ if (n instanceof V)
2623
2698
  return { valid: !1, issues: n.issues };
2624
2699
  throw n;
2625
2700
  }
2626
2701
  }
2627
- function hr(e) {
2702
+ function Cr(e) {
2628
2703
  return typeof e == "string" && Ie.has(e);
2629
2704
  }
2630
2705
  function we(e) {
2631
- return typeof e == "string" && zt.has(e);
2706
+ return typeof e == "string" && Wt.has(e);
2632
2707
  }
2633
2708
  export {
2634
- X as $,
2635
- u as A,
2636
- H as B,
2637
- $ as C,
2638
- Qn as D,
2639
- Pt as E,
2640
- Vt as F,
2641
- lr as G,
2642
- be as H,
2643
- P as I,
2644
- mn as J,
2645
- dr as K,
2646
- Ae as L,
2647
- z as M,
2648
- sr as N,
2649
- Q as O,
2650
- mr as P,
2651
- ur as Q,
2652
- fr as R,
2653
- pr as S,
2654
- hr as T,
2655
- we as U,
2656
- Wn as V,
2657
- mt as W,
2658
- lt as X,
2659
- Kn as Y,
2660
- ct as Z,
2661
- st as _,
2662
- ir as a,
2663
- Ft as a0,
2664
- Rt as a1,
2665
- Lt as a2,
2709
+ lt as $,
2710
+ Kt as A,
2711
+ mr as B,
2712
+ W as C,
2713
+ ar as D,
2714
+ u as E,
2715
+ $ as F,
2716
+ Gt as G,
2717
+ Ht as H,
2718
+ yr as I,
2719
+ Ee as J,
2720
+ V as K,
2721
+ gn as L,
2722
+ j as M,
2723
+ gr as N,
2724
+ _e as O,
2725
+ br as P,
2726
+ ee as Q,
2727
+ Er as R,
2728
+ Ir as S,
2729
+ vr as T,
2730
+ $r as U,
2731
+ Cr as V,
2732
+ we as W,
2733
+ er as X,
2734
+ ut as Y,
2735
+ st as Z,
2736
+ Yn as _,
2737
+ pr as a,
2738
+ mt as a0,
2739
+ Z as a1,
2740
+ Ft as a2,
2741
+ Mt as a3,
2742
+ Bt as a4,
2743
+ Ut as a5,
2744
+ qt as a6,
2666
2745
  dt as b,
2667
- Gn as c,
2668
- tr as d,
2669
- Xn as e,
2670
- Jn as f,
2671
- cr as g,
2672
- qn as h,
2673
- Hn as i,
2674
- Et as j,
2675
- er as k,
2746
+ Qn as c,
2747
+ cr as d,
2748
+ tr as e,
2749
+ or as f,
2750
+ hr as g,
2751
+ Zn as h,
2752
+ Jn as i,
2753
+ vt as j,
2754
+ ir as k,
2676
2755
  O as l,
2677
- nr as m,
2756
+ lr as m,
2678
2757
  Dt as n,
2679
- rr as o,
2680
- ye as p,
2681
- pe as q,
2682
- Bt as r,
2683
- or as s,
2684
- ar as t,
2685
- ut as u,
2686
- de as v,
2687
- Yn as w,
2688
- Zn as x,
2689
- Ut as y,
2690
- G as z
2758
+ sr as o,
2759
+ ge as p,
2760
+ he as q,
2761
+ jt as r,
2762
+ ur as s,
2763
+ dr as t,
2764
+ fr as u,
2765
+ ft as v,
2766
+ de as w,
2767
+ rr as x,
2768
+ nr as y,
2769
+ H as z
2691
2770
  };