react-semaphor 0.1.515 → 0.1.516

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 (210) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +226 -225
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +4 -4
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +8 -8
  7. package/dist/chunks/{calculated-field-identity-BiTGmnST.cjs → calculated-field-identity-5bg9oHTw.cjs} +1 -1
  8. package/dist/chunks/{calculated-field-identity-DnRd4YIY.js → calculated-field-identity-DzJBs2J8.js} +4 -4
  9. package/dist/chunks/{card-config-utils-B2cDWQqB.js → card-config-utils-Cxnq2R6z.js} +14 -14
  10. package/dist/chunks/{card-config-utils-CMO4_zVs.cjs → card-config-utils-z86y6tSq.cjs} +1 -1
  11. package/dist/chunks/column-bands-CU0byntA.cjs +1 -0
  12. package/dist/chunks/column-bands-RdM-kjDe.js +47 -0
  13. package/dist/chunks/{dashboard-briefing-launcher-BA_bl05p.js → dashboard-briefing-launcher-BCEHJ_eD.js} +15 -12
  14. package/dist/chunks/{dashboard-briefing-launcher-B7zqm8P1.cjs → dashboard-briefing-launcher-CjZ4aE34.cjs} +2 -2
  15. package/dist/chunks/{dashboard-controls-QMW17RKx.js → dashboard-controls-DFfit5KH.js} +12 -12
  16. package/dist/chunks/{dashboard-controls-x_v9wLOU.cjs → dashboard-controls-f9aJ70Zu.cjs} +1 -1
  17. package/dist/chunks/{dashboard-date-comparison-definition-D7Bl-YAl.js → dashboard-date-comparison-definition-BqNhECUr.js} +6 -6
  18. package/dist/chunks/{dashboard-date-comparison-definition-C_w-GO_5.cjs → dashboard-date-comparison-definition-Y6JZwpcr.cjs} +1 -1
  19. package/dist/chunks/{dashboard-json-DRnpkNwO.js → dashboard-json-DVtcA02f.js} +7 -7
  20. package/dist/chunks/{dashboard-json-0ZLLBlHj.cjs → dashboard-json-deqQC-UR.cjs} +1 -1
  21. package/dist/chunks/edit-dashboard-visual-DK6lSC_p.cjs +172 -0
  22. package/dist/chunks/{edit-dashboard-visual-1ISjhwry.js → edit-dashboard-visual-lJ6rDH3w.js} +4338 -4324
  23. package/dist/chunks/{editor-action-buttons-BTCKZERI.js → editor-action-buttons-Bnxxa439.js} +7 -7
  24. package/dist/chunks/{editor-action-buttons-Czq5SnA9.cjs → editor-action-buttons-CmDaQbPN.cjs} +1 -1
  25. package/dist/chunks/{field-aggregations-CzuQKtqx.js → field-aggregations-Dl2A3rbV.js} +461 -358
  26. package/dist/chunks/field-aggregations-pH_3kymD.cjs +1 -0
  27. package/dist/chunks/{field-dependencies-DIab72rQ.cjs → field-dependencies-EB485TdB.cjs} +1 -1
  28. package/dist/chunks/{field-dependencies-DXW4jtvJ.js → field-dependencies-v-lJNzC7.js} +1 -1
  29. package/dist/chunks/{index-Dlic9KZs.js → index-BVVl2JDK.js} +57730 -54586
  30. package/dist/chunks/index-DfqMtR9S.cjs +4 -0
  31. package/dist/chunks/index-UNKSfi7s.cjs +1434 -0
  32. package/dist/chunks/{index-v1OE4-eA.js → index-ylOpKRDu.js} +877 -849
  33. package/dist/chunks/{matrix-analytical-definition-Ct5Tu8np.cjs → matrix-analytical-definition-BWd159lN.cjs} +1 -1
  34. package/dist/chunks/{matrix-analytical-definition-BDAK2aEi.js → matrix-analytical-definition-BimC4XIV.js} +1 -1
  35. package/dist/chunks/{matrix-card-U4c72doZ.cjs → matrix-card-C2RjEYZ8.cjs} +1 -1
  36. package/dist/chunks/{matrix-card-DOIeTmjh.js → matrix-card-CIlz0Dnp.js} +2 -2
  37. package/dist/chunks/{matrix-control-sources-FjxGIbqk.cjs → matrix-control-sources-BvEJF7d3.cjs} +1 -1
  38. package/dist/chunks/{matrix-control-sources-BxKH2yu2.js → matrix-control-sources-KbZe1gj_.js} +51 -51
  39. package/dist/chunks/{matrix-definition-CBJW_4ii.cjs → matrix-definition-DanUT11P.cjs} +1 -1
  40. package/dist/chunks/{matrix-definition-I9rHB9zN.js → matrix-definition-E5gXXSTZ.js} +1 -1
  41. package/dist/chunks/matrix-formatter-BJTO8ky9.cjs +1 -0
  42. package/dist/chunks/{matrix-formatter-BdIsE7Qu.js → matrix-formatter-CCXNRt3s.js} +81 -81
  43. package/dist/chunks/{matrix-member-presentation-DO1VSqfh.js → matrix-member-presentation-Bw7-JCrr.js} +64 -64
  44. package/dist/chunks/matrix-member-presentation-DvXDEo0U.cjs +1 -0
  45. package/dist/chunks/{matrix-operation-contract-DoiWTUbT.cjs → matrix-operation-contract-0RxoU_M3.cjs} +1 -1
  46. package/dist/chunks/{matrix-operation-contract-D0HfzwZg.js → matrix-operation-contract-D32U2CSw.js} +19 -19
  47. package/dist/chunks/{metric-comparison-Dqc7_tnW.js → metric-comparison-BphoJ9bq.js} +1 -1
  48. package/dist/chunks/{metric-comparison-DBQ3EJTz.cjs → metric-comparison-CUmltzpz.cjs} +1 -1
  49. package/dist/chunks/pivot-header-presentation-BSZhB1g-.js +661 -0
  50. package/dist/chunks/pivot-header-presentation-EoUS5ze5.cjs +5 -0
  51. package/dist/chunks/{pivot-result-identity-8M-bZrw9.js → pivot-result-identity-BzUQiCEV.js} +4 -4
  52. package/dist/chunks/{pivot-result-identity-uTiylUNr.cjs → pivot-result-identity-gquWljbd.cjs} +1 -1
  53. package/dist/chunks/{pivot-result-lifecycle-vg_suUNb.cjs → pivot-result-lifecycle-gl9cBfB-.cjs} +1 -1
  54. package/dist/chunks/{pivot-result-lifecycle-CEmyU2At.js → pivot-result-lifecycle-kRhiJkzg.js} +8 -8
  55. package/dist/chunks/{raw-temporal-Bj6_w9cG.js → raw-temporal-BqOfk-xN.js} +16 -16
  56. package/dist/chunks/{raw-temporal-contract-CFLGwTiI.js → raw-temporal-contract-BQZIJ1fn.js} +1 -1
  57. package/dist/chunks/{raw-temporal-contract-DECbTuzA.cjs → raw-temporal-contract-CklMVG_1.cjs} +1 -1
  58. package/dist/chunks/{raw-temporal-CeblVJbu.cjs → raw-temporal-eJXecCyJ.cjs} +1 -1
  59. package/dist/chunks/{report-preferences-dialog-b8J6KjSy.js → report-preferences-dialog-CHXPEl7v.js} +6 -6
  60. package/dist/chunks/{report-preferences-dialog-Dr1BYwuf.cjs → report-preferences-dialog-Cto0vDwI.cjs} +1 -1
  61. package/dist/chunks/{report-runtime-context-Cs65Mrxj.js → report-runtime-context-CxIoGyNM.js} +1 -1
  62. package/dist/chunks/{report-runtime-context-DzvHBPxl.cjs → report-runtime-context-CzSrCBsu.cjs} +1 -1
  63. package/dist/chunks/{selection-reducer-BIiQXbGM.js → selection-reducer-CvCBQbl2.js} +1 -1
  64. package/dist/chunks/{selection-reducer-CGKKsaPa.cjs → selection-reducer-Kl22OzIk.cjs} +1 -1
  65. package/dist/chunks/{semantic-format-Dt-nUxFB.js → semantic-format-DwqGYx4V.js} +2 -2
  66. package/dist/chunks/{semantic-format-DFI1iszk.cjs → semantic-format-mVI32OJH.cjs} +1 -1
  67. package/dist/chunks/{source-entity-resolution-D7vnmDwm.js → source-entity-resolution-Bzefiive.js} +7 -7
  68. package/dist/chunks/{source-entity-resolution-CjbgnwyX.cjs → source-entity-resolution-R46X34SE.cjs} +1 -1
  69. package/dist/chunks/switch-DNbWXEOP.cjs +134 -0
  70. package/dist/chunks/{switch-D5_tjsIS.js → switch-DNv-hVmt.js} +8230 -7681
  71. package/dist/chunks/{temporal-bucket-B9hMwemw.js → temporal-bucket-DlFuhCnT.js} +6 -6
  72. package/dist/chunks/{temporal-bucket-contract-IWDgyTMw.js → temporal-bucket-contract-DTLDRzgV.js} +1 -1
  73. package/dist/chunks/{temporal-bucket-contract-ZctiyXYk.cjs → temporal-bucket-contract-nTv6gvX5.cjs} +1 -1
  74. package/dist/chunks/{token-types-Dl0hcKBX.js → token-types-BC6RcUY8.js} +1 -1
  75. package/dist/chunks/{token-types-Ahh5u4iT.cjs → token-types-aWrzwonf.cjs} +1 -1
  76. package/dist/chunks/{update-policy-COjFudhl.cjs → update-policy-DRDLWe7Y.cjs} +1 -1
  77. package/dist/chunks/{update-policy-BeQqjupC.js → update-policy-DhAUtiC8.js} +2 -2
  78. package/dist/chunks/{validators-CkHsAvwB.js → validators-CsdOtZI6.js} +411 -397
  79. package/dist/chunks/validators-DFeDcdpA.cjs +1 -0
  80. package/dist/dashboard/index.cjs +1 -1
  81. package/dist/dashboard/index.js +1 -1
  82. package/dist/dashboard-authoring/index.cjs +3 -3
  83. package/dist/dashboard-authoring/index.js +233 -227
  84. package/dist/data-app-builder/index.cjs +1 -1
  85. package/dist/data-app-builder/index.js +3 -3
  86. package/dist/data-app-codegen/index.cjs +1 -1
  87. package/dist/data-app-codegen/index.js +2 -2
  88. package/dist/data-app-codegen-node/index.cjs +1 -1
  89. package/dist/data-app-codegen-node/index.js +3 -3
  90. package/dist/data-app-sdk/index.cjs +1 -1
  91. package/dist/data-app-sdk/index.js +5 -5
  92. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  93. package/dist/data-app-sdk-adapters/index.js +2 -2
  94. package/dist/data-app-sdk-validation/index.cjs +1 -1
  95. package/dist/data-app-sdk-validation/index.js +5 -5
  96. package/dist/format-utils/index.cjs +3 -3
  97. package/dist/format-utils/index.js +291 -402
  98. package/dist/index.cjs +1 -1
  99. package/dist/index.js +15 -15
  100. package/dist/pdf-table-layout/index.cjs +1 -0
  101. package/dist/pdf-table-layout/index.js +993 -0
  102. package/dist/report-runtime-context/index.cjs +1 -1
  103. package/dist/report-runtime-context/index.js +2 -2
  104. package/dist/style.css +1 -1
  105. package/dist/surfboard/index.cjs +1 -1
  106. package/dist/surfboard/index.js +2 -2
  107. package/dist/types/briefings/index.d.ts +1 -1
  108. package/dist/types/components/document-sheet/document-input-bar.d.ts +1 -3
  109. package/dist/types/components/document-sheet/document-insert-picker.d.ts +37 -0
  110. package/dist/types/components/document-sheet/document-kpi-section.d.ts +17 -0
  111. package/dist/types/components/document-sheet/document-matrix-layout-context.d.ts +10 -0
  112. package/dist/types/components/document-sheet/document-matrix-section.d.ts +27 -0
  113. package/dist/types/components/document-sheet/document-measure-layer.d.ts +45 -0
  114. package/dist/types/components/document-sheet/document-outline.d.ts +7 -1
  115. package/dist/types/components/document-sheet/document-page-navigation.d.ts +22 -0
  116. package/dist/types/components/document-sheet/document-page.d.ts +9 -5
  117. package/dist/types/components/document-sheet/document-panel/document-side-panel.d.ts +36 -0
  118. package/dist/types/components/document-sheet/document-panel/inputs-panel.d.ts +9 -0
  119. package/dist/types/components/document-sheet/document-panel/page-panel.d.ts +5 -0
  120. package/dist/types/components/document-sheet/document-panel/panel-controls.d.ts +14 -0
  121. package/dist/types/components/document-sheet/document-panel/region-panels.d.ts +11 -0
  122. package/dist/types/components/document-sheet/document-panel/section-panel.d.ts +25 -0
  123. package/dist/types/components/document-sheet/document-section-print-boundary.d.ts +9 -0
  124. package/dist/types/components/document-sheet/document-table-chrome.d.ts +22 -0
  125. package/dist/types/components/document-sheet/document-table-section.d.ts +3 -7
  126. package/dist/types/components/document-sheet/document-text-preview-context.d.ts +8 -0
  127. package/dist/types/components/document-sheet/use-first-fitting-variant.d.ts +18 -0
  128. package/dist/types/components/editor/editor-main/dashboard-variable-node.d.ts +12 -2
  129. package/dist/types/components/explorer/chart-configuration/matrix-authoring-controls.d.ts +7 -2
  130. package/dist/types/components/text-variables/variable-chip-plugin.d.ts +23 -0
  131. package/dist/types/components/text-variables/variable-chip.d.ts +18 -0
  132. package/dist/types/components/text-variables/variable-picker.d.ts +27 -0
  133. package/dist/types/components/visual/settings/table-presentation-settings.d.ts +27 -1
  134. package/dist/types/index.cjs +1 -1
  135. package/dist/types/index.js +5 -5
  136. package/dist/types/lib/dashboard-inputs/text-variable-options.d.ts +15 -0
  137. package/dist/types/lib/document/document-canvas-actions.d.ts +22 -0
  138. package/dist/types/lib/document/document-edits.d.ts +119 -0
  139. package/dist/types/lib/document/document-kpi-figure.d.ts +27 -0
  140. package/dist/types/lib/document/document-kpi-layout.d.ts +29 -0
  141. package/dist/types/lib/document/document-kpi-section-edits.d.ts +15 -0
  142. package/dist/types/lib/document/document-matrix-bands.d.ts +66 -0
  143. package/dist/types/lib/document/document-matrix-print.d.ts +11 -0
  144. package/dist/types/lib/document/document-pagination.d.ts +56 -3
  145. package/dist/types/lib/document/document-panel-target.d.ts +19 -0
  146. package/dist/types/lib/document/document-section-editor.d.ts +8 -7
  147. package/dist/types/lib/document/document-section-kinds.d.ts +49 -0
  148. package/dist/types/lib/document/document-section-query-options.d.ts +25 -0
  149. package/dist/types/lib/document/document-section-render-state.d.ts +26 -0
  150. package/dist/types/lib/document/document-section-utils.d.ts +11 -4
  151. package/dist/types/lib/document/document-table-dom.d.ts +4 -6
  152. package/dist/types/lib/document/document-table-pagination-model.d.ts +0 -5
  153. package/dist/types/lib/document/document-table-print-model.d.ts +4 -3
  154. package/dist/types/lib/document/document-table-style.d.ts +15 -4
  155. package/dist/types/lib/document/document-table-surface.d.ts +15 -0
  156. package/dist/types/lib/document/document-variables.d.ts +40 -6
  157. package/dist/types/lib/document/use-document-section-data.d.ts +39 -0
  158. package/dist/types/lib/document/use-measured-document-table-layout.d.ts +50 -0
  159. package/dist/types/lib/formatters/kpi-result-values.d.ts +20 -0
  160. package/dist/types/lib/hooks/query-context/use-dashboard-card-execution-snapshot.d.ts +8 -2
  161. package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +6 -0
  162. package/dist/types/lib/hooks/use-dashboard-kpi-actions.d.ts +1 -1
  163. package/dist/types/lib/hooks/use-document-section-editor.d.ts +2 -2
  164. package/dist/types/lib/hooks/use-document-section-session.d.ts +36 -0
  165. package/dist/types/lib/hooks/use-editor-preview.d.ts +17 -0
  166. package/dist/types/lib/hooks/use-is-editing-card.d.ts +7 -0
  167. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +2 -0
  168. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +2 -0
  169. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
  170. package/dist/types/lib/matrix-table/matrix-layout-read.d.ts +68 -0
  171. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +8 -1
  172. package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +4 -2
  173. package/dist/types/lib/query-context/card-execution.d.ts +30 -0
  174. package/dist/types/lib/query-context/document-section-card-query.d.ts +37 -0
  175. package/dist/types/lib/stores/dashboard-store.d.ts +12 -8
  176. package/dist/types/lib/stores/editor-store.d.ts +2 -0
  177. package/dist/types/lib/text-variables/text-variable-types.d.ts +39 -0
  178. package/dist/types/lib/types/common-types.d.ts +34 -1
  179. package/dist/types/lib/utils/card-definition.d.ts +2 -0
  180. package/dist/types/lib/utils/card-utils.d.ts +13 -6
  181. package/dist/types/pdf-table-layout.d.ts +2 -0
  182. package/dist/types/shared/analytics-protocol/index.d.ts +1 -1
  183. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +45 -0
  184. package/dist/types/shared/analytics-protocol/matrix-member-presentation.d.ts +4 -0
  185. package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +56 -0
  186. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  187. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +36 -1
  188. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -0
  189. package/dist/types/shared/format-utils/index.d.ts +1 -0
  190. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +690 -1
  191. package/dist/types/shared/format-utils/matrix-print.d.ts +38 -0
  192. package/dist/types/shared/format-utils/pdf-table-layout/column-bands.d.ts +55 -0
  193. package/dist/types/shared/format-utils/pdf-table-layout/index.d.ts +6 -0
  194. package/dist/types/shared/format-utils/pdf-table-layout/page-size.d.ts +7 -0
  195. package/dist/types/shared/format-utils/pdf-table-layout/table-column-semantics.d.ts +106 -0
  196. package/dist/types/shared/format-utils/pdf-table-layout/table-column-widths.d.ts +13 -0
  197. package/dist/types/shared/format-utils/pdf-table-layout/table-page-geometry.d.ts +19 -0
  198. package/dist/types/shared/format-utils/pdf-table-layout/wide-table-layout.d.ts +46 -0
  199. package/dist/types/shared/format-utils/table-structure.d.ts +9 -0
  200. package/package.json +6 -1
  201. package/dist/chunks/edit-dashboard-visual-CI0EqzKj.cjs +0 -172
  202. package/dist/chunks/field-aggregations-jSi77h9Z.cjs +0 -1
  203. package/dist/chunks/index-BMMXKK3G.cjs +0 -4
  204. package/dist/chunks/index-C6_xef4P.cjs +0 -1424
  205. package/dist/chunks/matrix-formatter-Dajj91Ni.cjs +0 -1
  206. package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +0 -1
  207. package/dist/chunks/pivot-header-presentation-BIf4HW3L.js +0 -414
  208. package/dist/chunks/pivot-header-presentation-B_N11CgN.cjs +0 -5
  209. package/dist/chunks/switch-Ced9ZZwI.cjs +0 -134
  210. package/dist/chunks/validators-DVYAnnX0.cjs +0 -1
@@ -1,27 +1,27 @@
1
- var tt = Object.defineProperty;
2
- var rt = (e, r, t) => r in e ? tt(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var F = (e, r, t) => rt(e, typeof r != "symbol" ? r + "" : r, t);
4
- import { w as J, n as G, o as nt, R as ot, u as at, p as xe, h as it } from "./raw-temporal-Bj6_w9cG.js";
5
- import { ak as $e, a4 as ct, a6 as ie, _ as ke, t as lt } from "./validators-CkHsAvwB.js";
1
+ var rt = Object.defineProperty;
2
+ var nt = (e, r, t) => r in e ? rt(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var F = (e, r, t) => nt(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import { w as J, n as G, o as ot, R as at, u as it, k as ke, g as ct } from "./raw-temporal-BqOfk-xN.js";
5
+ import { al as Ee, a5 as lt, a7 as ce, $ as me, t as st } from "./validators-CsdOtZI6.js";
6
6
  import "./matrix-continuation-C4sRcjZU.js";
7
- import "./matrix-operation-contract-D0HfzwZg.js";
8
- import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as se } from "../value-format-preferences/index.js";
9
- import { k as dt, i as st, g as mt, j as ut, e as ft, M as pt, c as yt, b as ht, P as j } from "./pivot-result-lifecycle-CEmyU2At.js";
10
- import { z as E } from "zod";
11
- import { r as gt } from "./matrix-definition-I9rHB9zN.js";
12
- import { h as Ee, i as me, r as Se, a as _e, v as vt, b as bt } from "./card-config-utils-B2cDWQqB.js";
13
- import { r as It } from "./matrix-card-DOIeTmjh.js";
14
- import { r as V, c as wt, b as Ct, P as Tt } from "./pivot-result-identity-8M-bZrw9.js";
15
- import { v as xt, a as $t } from "./temporal-bucket-contract-IWDgyTMw.js";
16
- import { f as kt, b as Et, d as Fe, D as St } from "./temporal-bucket-B9hMwemw.js";
17
- import { a as Re, s as _t, i as Ft } from "./field-aggregations-CzuQKtqx.js";
18
- import { v as Ae } from "./raw-temporal-contract-CFLGwTiI.js";
19
- import { r as Rt, a as At, b as Pt } from "./canonical-result-keys-CEQefvdO.js";
20
- const Mt = `import pandas as pd
7
+ import { $ as dt, a1 as mt } from "./matrix-operation-contract-D32U2CSw.js";
8
+ import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as ue } from "../value-format-preferences/index.js";
9
+ import { k as ut, i as ft, g as pt, j as yt, e as ht, M as gt, c as vt, b as bt, P as j } from "./pivot-result-lifecycle-kRhiJkzg.js";
10
+ import { z as C } from "zod";
11
+ import { r as It } from "./matrix-definition-E5gXXSTZ.js";
12
+ import { h as Se, i as fe, r as _e, a as Fe, v as wt, b as Ct } from "./card-config-utils-Cxnq2R6z.js";
13
+ import { r as Tt } from "./matrix-card-CIlz0Dnp.js";
14
+ import { a as Re, s as xt, i as $t, o as kt } from "./field-aggregations-Dl2A3rbV.js";
15
+ import { r as L, b as Et, d as St, P as _t } from "./pivot-result-identity-BzUQiCEV.js";
16
+ import { v as Ft, a as Rt } from "./temporal-bucket-contract-DTLDRzgV.js";
17
+ import { f as At, a as Pt, c as Ae, D as Mt } from "./temporal-bucket-DlFuhCnT.js";
18
+ import { v as Pe } from "./raw-temporal-contract-BQZIJ1fn.js";
19
+ import { r as Bt, a as Dt, b as Ot } from "./canonical-result-keys-CEQefvdO.js";
20
+ const Kt = `import pandas as pd
21
21
  df = pd.DataFrame(data) # 'data' contains the query result
22
22
  result = df.to_dict('records') # must return 'result' as [dict] type
23
23
  `;
24
- function An(e) {
24
+ function Dn(e) {
25
25
  return {
26
26
  databaseName: (e == null ? void 0 : e.lastSelectedDatabase) || "",
27
27
  schemaName: (e == null ? void 0 : e.lastSelectedSchema) || "",
@@ -30,16 +30,16 @@ function An(e) {
30
30
  };
31
31
  }
32
32
  function W(e) {
33
- return e === Mt ? "" : e;
33
+ return e === Kt ? "" : e;
34
34
  }
35
35
  function X(e, r = e.config) {
36
36
  return Re({
37
- hasExecutableConfig: Ee(r, e.type),
37
+ hasExecutableConfig: Se(r, e.type),
38
38
  sql: e.sql,
39
39
  normalizedPython: W(e.python || "")
40
40
  });
41
41
  }
42
- class Bt extends Error {
42
+ class Nt extends Error {
43
43
  constructor(t) {
44
44
  super(
45
45
  `ambiguous_temporal_grain: Temporal field "${t}" has saved presentation but no valid grouping grain. Reconfigure and resave the field.`
@@ -49,17 +49,17 @@ class Bt extends Error {
49
49
  this.name = "AmbiguousGroupedTemporalGrainError", this.fieldId = t;
50
50
  }
51
51
  }
52
- function Dt(e) {
53
- return _e(e) || e.semanticTemporalPresentation != null;
52
+ function zt(e) {
53
+ return Fe(e) || e.semanticTemporalPresentation != null;
54
54
  }
55
- function Ot(e) {
55
+ function Lt(e) {
56
56
  if (!e.id || !["date", "datetime"].includes(
57
- $e(e.dataType)
57
+ Ee(e.dataType)
58
58
  ))
59
59
  return;
60
- if (ct(e.granularity)) return e;
61
- if (!Dt(e)) return;
62
- if (!Se({
60
+ if (lt(e.granularity)) return e;
61
+ if (!zt(e)) return;
62
+ if (!_e({
63
63
  fieldId: e.id,
64
64
  dataType: e.dataType,
65
65
  granularity: e.granularity,
@@ -67,13 +67,13 @@ function Ot(e) {
67
67
  dateFormat: e.dateFormat,
68
68
  customFormat: e.customFormat
69
69
  }).ok)
70
- throw new Bt(e.id);
70
+ throw new Nt(e.id);
71
71
  return { ...e, granularity: "day" };
72
72
  }
73
- function ue(e) {
73
+ function pe(e) {
74
74
  const r = e.cardConfig ?? e.card.config;
75
75
  if (!r || !e.supportsCardType(e.card.type) || Re({
76
- hasExecutableConfig: Ee(r),
76
+ hasExecutableConfig: Se(r),
77
77
  sql: e.card.sql,
78
78
  normalizedPython: W(e.card.python || "")
79
79
  }) !== "config")
@@ -92,51 +92,51 @@ function ue(e) {
92
92
  cardType: e.card.type,
93
93
  cardConfig: r,
94
94
  fields: t.flatMap((n) => {
95
- const o = Ot(n);
95
+ const o = Lt(n);
96
96
  return o ? [o] : [];
97
97
  })
98
98
  };
99
99
  }
100
- function Pn(e) {
101
- if (me(e.card))
102
- return ue({
100
+ function On(e) {
101
+ if (fe(e.card))
102
+ return pe({
103
103
  ...e,
104
104
  card: e.card,
105
105
  supportsCardType: (r) => r === "table"
106
106
  });
107
107
  }
108
- function Mn(e) {
109
- if (me(e.card))
110
- return ue({
108
+ function Kn(e) {
109
+ if (fe(e.card))
110
+ return pe({
111
111
  ...e,
112
112
  card: e.card,
113
- supportsCardType: Ft
113
+ supportsCardType: $t
114
114
  });
115
115
  }
116
- function Kt(e) {
117
- if (me(e.card))
118
- return ue({
116
+ function Vt(e) {
117
+ if (fe(e.card))
118
+ return pe({
119
119
  ...e,
120
120
  card: e.card,
121
121
  // Raw detail-table presentation has its own result/adapter contract.
122
122
  // This module remains grouped-only even though the shared producer
123
123
  // registry now recognizes detailTable.
124
- supportsCardType: (r) => r !== "detailTable" && _t(r)
124
+ supportsCardType: (r) => r !== "detailTable" && xt(r)
125
125
  });
126
126
  }
127
- const be = /* @__PURE__ */ new WeakMap();
128
- function Nt(e) {
129
- const r = be.get(e);
127
+ const we = /* @__PURE__ */ new WeakMap();
128
+ function qt(e) {
129
+ const r = we.get(e);
130
130
  if (r) return r;
131
- const t = dt(e);
132
- return be.set(e, t), t;
131
+ const t = ut(e);
132
+ return we.set(e, t), t;
133
133
  }
134
134
  function q(e, r) {
135
135
  const t = e ?? [], n = r ?? [];
136
136
  return t.length === n.length && t.every((o, a) => o === n[a]);
137
137
  }
138
- function zt(e, r) {
139
- const t = st({
138
+ function jt(e, r) {
139
+ const t = ft({
140
140
  groupByFields: r.groupByColumns,
141
141
  metricFields: r.metricColumns,
142
142
  pivotByFields: r.pivotByColumns,
@@ -159,7 +159,7 @@ function zt(e, r) {
159
159
  t.expectedMetricAliases
160
160
  );
161
161
  }
162
- class Vt extends Error {
162
+ class Ut extends Error {
163
163
  constructor(t) {
164
164
  super(
165
165
  `missing_resolved_temporal_format: Saved presentation is missing temporal field "${t.fieldId}" for card "${t.cardId}". Resave the report or Briefing to capture the current dashboard presentation.`
@@ -192,16 +192,16 @@ class N extends Error {
192
192
  this.code = t, this.context = o, this.name = "DashboardTemporalBoundaryError";
193
193
  }
194
194
  }
195
- function Pe(e, r) {
195
+ function Me(e, r) {
196
196
  return `${r}:${e}`;
197
197
  }
198
- function Lt(e) {
198
+ function Gt(e) {
199
199
  var r, t;
200
200
  return (t = (r = e.presentation) == null ? void 0 : r.byFieldRole) == null ? void 0 : t.get(
201
- Pe(e.fieldId, e.role)
201
+ Me(e.fieldId, e.role)
202
202
  );
203
203
  }
204
- function qt(e) {
204
+ function Ht(e) {
205
205
  var t;
206
206
  if ((((t = e.cardConfig.metricColumns) == null ? void 0 : t.length) || 0) > 0 || e.binding.role !== "metric")
207
207
  return !1;
@@ -209,23 +209,23 @@ function qt(e) {
209
209
  return e.columns.some(
210
210
  (n) => {
211
211
  var o;
212
- return n.role === "measure" && n.dataType === "number" && (n.key === r || ((o = n.pivotIdentity) == null ? void 0 : o.metricId) === ie);
212
+ return n.role === "measure" && n.dataType === "number" && (n.key === r || ((o = n.pivotIdentity) == null ? void 0 : o.metricId) === ce);
213
213
  }
214
214
  );
215
215
  }
216
- function Bn(e, r) {
216
+ function Nn(e, r) {
217
217
  return !r || r.byColumnKey.size === 0 ? e.map((t) => ({ ...t })) : e.map((t) => {
218
218
  const n = { ...t };
219
219
  return r.byColumnKey.forEach((o, a) => {
220
- Object.prototype.hasOwnProperty.call(t, a) && (n[a] = Me({
220
+ Object.prototype.hasOwnProperty.call(t, a) && (n[a] = Be({
221
221
  value: t[a],
222
222
  presentation: o
223
223
  }));
224
224
  }), n;
225
225
  });
226
226
  }
227
- function Dn(e) {
228
- var f;
227
+ function zn(e) {
228
+ var p;
229
229
  if (!e.result || typeof e.result != "object") return !1;
230
230
  const r = e.result;
231
231
  if (e.expectedResultOwner !== void 0 && r.resultOwner !== e.expectedResultOwner)
@@ -233,18 +233,18 @@ function Dn(e) {
233
233
  const t = e.activation;
234
234
  if (!t || t.cardType !== "pivotTable" && t.fields.length === 0)
235
235
  return !0;
236
- const n = Array.isArray(r.records) ? r.records.length : void 0, o = (t.cardConfig.pivotByColumns || []).map((d) => d.id);
236
+ const n = Array.isArray(r.records) ? r.records.length : void 0, o = (t.cardConfig.pivotByColumns || []).map((s) => s.id);
237
237
  if (t.cardType === "pivotTable")
238
238
  try {
239
- const d = Nt(r);
240
- if (!zt(
241
- d.pivotResultContract,
239
+ const s = qt(r);
240
+ if (!jt(
241
+ s.pivotResultContract,
242
242
  t.cardConfig
243
243
  ))
244
244
  return !1;
245
- if (d.pivotResultState === "loaded_empty") return !0;
246
- const v = d.columns.filter(
247
- (w) => d.pivotResultContract.columnKinds[w.key] === "pivot_metric"
245
+ if (s.pivotResultState === "loaded_empty") return !0;
246
+ const v = s.columns.filter(
247
+ (w) => s.pivotResultContract.columnKinds[w.key] === "pivot_metric"
248
248
  ), h = v.filter(
249
249
  (w) => {
250
250
  var g;
@@ -253,16 +253,16 @@ function Dn(e) {
253
253
  ), b = v.length > 0 && v.every(
254
254
  (w) => {
255
255
  var g;
256
- return ((g = w.pivotIdentity) == null ? void 0 : g.members.length) === 0 && wt({
256
+ return ((g = w.pivotIdentity) == null ? void 0 : g.members.length) === 0 && Et({
257
257
  expectedPivotFieldIds: o,
258
- classification: d.pivotResultContract.columnClassifications[w.key]
258
+ classification: s.pivotResultContract.columnClassifications[w.key]
259
259
  });
260
260
  }
261
261
  );
262
262
  return t.fields.every((w) => {
263
- var k;
264
- const g = V(
265
- d.columnKeyMap,
263
+ var E;
264
+ const g = L(
265
+ s.columnKeyMap,
266
266
  w.id,
267
267
  w.role
268
268
  );
@@ -270,27 +270,27 @@ function Dn(e) {
270
270
  if (g.role === "pivotby") {
271
271
  const _ = h.flatMap(
272
272
  (P) => {
273
- var L;
274
- return ((L = P.pivotIdentity) == null ? void 0 : L.members.filter(
275
- (et) => et.fieldId === w.id
273
+ var V;
274
+ return ((V = P.pivotIdentity) == null ? void 0 : V.members.filter(
275
+ (tt) => tt.fieldId === w.id
276
276
  )) ?? [];
277
277
  }
278
278
  );
279
279
  return _.length === 0 ? b : _.every(
280
280
  (P) => {
281
- var L;
282
- return ((L = P.temporalBucket) == null ? void 0 : L.granularity) === w.granularity;
281
+ var V;
282
+ return ((V = P.temporalBucket) == null ? void 0 : V.granularity) === w.granularity;
283
283
  }
284
284
  );
285
285
  }
286
- const C = d.columns.find(
286
+ const T = s.columns.find(
287
287
  (_) => _.key === (g.outputKey || g.rawKey)
288
288
  );
289
- return ((k = C == null ? void 0 : C.temporalBucket) == null ? void 0 : k.granularity) === w.granularity;
289
+ return ((E = T == null ? void 0 : T.temporalBucket) == null ? void 0 : E.granularity) === w.granularity;
290
290
  });
291
- } catch (d) {
292
- if (d instanceof ut) return !1;
293
- throw d;
291
+ } catch (s) {
292
+ if (s instanceof yt) return !1;
293
+ throw s;
294
294
  }
295
295
  if (n === 0)
296
296
  return !0;
@@ -298,90 +298,90 @@ function Dn(e) {
298
298
  if (!a || !a.byRole || typeof a.byRole != "object" || Array.isArray(a.byRole))
299
299
  return !1;
300
300
  const i = [
301
- ...(t.cardConfig.groupByColumns || []).map((d) => ({
302
- field: d,
301
+ ...(t.cardConfig.groupByColumns || []).map((s) => ({
302
+ field: s,
303
303
  role: "groupby"
304
304
  })),
305
- ...(t.cardConfig.metricColumns || []).map((d) => ({
306
- field: d,
305
+ ...(t.cardConfig.metricColumns || []).map((s) => ({
306
+ field: s,
307
307
  role: "metric"
308
308
  })),
309
- ...(t.cardConfig.pivotByColumns || []).map((d) => ({
310
- field: d,
309
+ ...(t.cardConfig.pivotByColumns || []).map((s) => ({
310
+ field: s,
311
311
  role: "pivotby"
312
312
  })),
313
- ...(t.cardConfig.detailColumns || []).map((d) => ({
314
- field: d,
313
+ ...(t.cardConfig.detailColumns || []).map((s) => ({
314
+ field: s,
315
315
  role: "detail"
316
316
  }))
317
317
  ], l = new Set(
318
- i.map(({ field: d, role: v }) => `${v}:${d.id}`)
318
+ i.map(({ field: s, role: v }) => `${v}:${s.id}`)
319
319
  ), m = new Map(
320
- (r.columns || []).map((d) => [d.key, d])
321
- ), c = V(
320
+ (r.columns || []).map((s) => [s.key, s])
321
+ ), c = L(
322
322
  a,
323
- ie,
323
+ ce,
324
324
  "metric"
325
325
  );
326
326
  if (c) {
327
- if (!qt({
327
+ if (!Ht({
328
328
  cardConfig: t.cardConfig,
329
329
  binding: c,
330
330
  columns: r.columns || []
331
331
  }))
332
332
  return !1;
333
- l.add(`metric:${ie}`);
333
+ l.add(`metric:${ce}`);
334
334
  }
335
- const s = Object.entries(a.byRole).flatMap(
336
- ([d, v]) => Object.keys(v || {}).map((h) => `${d}:${h}`)
335
+ const d = Object.entries(a.byRole).flatMap(
336
+ ([s, v]) => Object.keys(v || {}).map((h) => `${s}:${h}`)
337
337
  );
338
- if (s.length !== l.size || s.some((d) => !l.has(d)) || i.some(
339
- ({ field: d, role: v }) => !V(a, d.id, v)
338
+ if (d.length !== l.size || d.some((s) => !l.has(s)) || i.some(
339
+ ({ field: s, role: v }) => !L(a, s.id, v)
340
340
  ))
341
341
  return !1;
342
342
  try {
343
- Ct(
344
- (r.columns || []).map((d) => ({
345
- key: d.key,
346
- pivotIdentity: d.pivotIdentity
343
+ St(
344
+ (r.columns || []).map((s) => ({
345
+ key: s.key,
346
+ pivotIdentity: s.pivotIdentity
347
347
  })),
348
348
  {
349
349
  expectedPivotFieldIds: o,
350
350
  columnClassifications: r.columnMetadata
351
351
  }
352
352
  );
353
- } catch (d) {
354
- if (d instanceof Tt) return !1;
355
- throw d;
353
+ } catch (s) {
354
+ if (s instanceof _t) return !1;
355
+ throw s;
356
356
  }
357
- const u = (r.columns || []).filter((d) => {
358
- const v = d.pivotIdentity;
357
+ const u = (r.columns || []).filter((s) => {
358
+ const v = s.pivotIdentity;
359
359
  return !!(v && v.members.length > 0);
360
360
  });
361
- return n !== 0 && ((f = t.cardConfig.pivotByColumns) != null && f.length) && u.length === 0 ? !1 : t.fields.every((d) => {
361
+ return n !== 0 && ((p = t.cardConfig.pivotByColumns) != null && p.length) && u.length === 0 ? !1 : t.fields.every((s) => {
362
362
  var b;
363
- const v = V(
363
+ const v = L(
364
364
  a,
365
- d.id,
366
- d.role
365
+ s.id,
366
+ s.role
367
367
  );
368
368
  if (!v) return !1;
369
369
  if (v.role === "pivotby") {
370
370
  const g = u.flatMap(
371
- (C) => {
372
- var k;
373
- return ((k = C.pivotIdentity) == null ? void 0 : k.members) ?? [];
371
+ (T) => {
372
+ var E;
373
+ return ((E = T.pivotIdentity) == null ? void 0 : E.members) ?? [];
374
374
  }
375
- ).filter((C) => C.fieldId === d.id);
375
+ ).filter((T) => T.fieldId === s.id);
376
376
  return u.length === 0 ? n === 0 : g.length > 0 && g.every(
377
- (C) => {
378
- var k;
379
- return ((k = C.temporalBucket) == null ? void 0 : k.granularity) === d.granularity;
377
+ (T) => {
378
+ var E;
379
+ return ((E = T.temporalBucket) == null ? void 0 : E.granularity) === s.granularity;
380
380
  }
381
381
  );
382
382
  }
383
383
  const h = m.get(v.outputKey || v.rawKey);
384
- return ((b = h == null ? void 0 : h.temporalBucket) == null ? void 0 : b.granularity) === d.granularity;
384
+ return ((b = h == null ? void 0 : h.temporalBucket) == null ? void 0 : b.granularity) === s.granularity;
385
385
  });
386
386
  }
387
387
  function Q(e, r) {
@@ -389,9 +389,9 @@ function Q(e, r) {
389
389
  format: e.format,
390
390
  dateFormat: e.dateFormat
391
391
  } : { format: t == null ? void 0 : t.format };
392
- if (!_e(n))
392
+ if (!Fe(n))
393
393
  return;
394
- const o = Se({
394
+ const o = _e({
395
395
  fieldId: e.id,
396
396
  dataType: e.dataType,
397
397
  granularity: r === "semantic" ? t == null ? void 0 : t.granularity : e.granularity,
@@ -404,9 +404,9 @@ function Q(e, r) {
404
404
  if (!o.ok) throw new Error(o.error.code);
405
405
  return o.format;
406
406
  }
407
- function jt(e, r, t = se) {
407
+ function Wt(e, r, t = ue) {
408
408
  const n = Q(e, "card"), o = Q(e, "semantic"), a = e.semanticTemporalPresentation;
409
- return Fe({
409
+ return Ae({
410
410
  metadata: r,
411
411
  ...n ? { cardFormat: n } : {},
412
412
  ...o && a ? {
@@ -422,7 +422,7 @@ function jt(e, r, t = se) {
422
422
  }
423
423
  });
424
424
  }
425
- function Ut(e, r = St, t = "en-US") {
425
+ function Yt(e, r = Mt, t = "en-US") {
426
426
  var i;
427
427
  const n = Q(e, "card"), o = ((i = e.semanticTemporalPresentation) == null ? void 0 : i.granularity) === e.granularity ? Q(e, "semantic") : void 0, a = n && n.presentation.mode !== "auto" ? n : o && o.presentation.mode !== "auto" ? o : {
428
428
  presentation: { mode: "auto" }
@@ -437,7 +437,7 @@ function Ut(e, r = St, t = "en-US") {
437
437
  presentation: a.presentation
438
438
  };
439
439
  }
440
- function On(e) {
440
+ function Ln(e) {
441
441
  const r = e.activation;
442
442
  if (!r)
443
443
  return {
@@ -453,19 +453,19 @@ function On(e) {
453
453
  };
454
454
  const t = new Map(
455
455
  (e.columns || []).map((c) => [c.key, c])
456
- ), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = r.fields.reduce((c, s) => (c.set(s.id, (c.get(s.id) || 0) + 1), c), /* @__PURE__ */ new Map()), l = (c, s) => {
456
+ ), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = r.fields.reduce((c, d) => (c.set(d.id, (c.get(d.id) || 0) + 1), c), /* @__PURE__ */ new Map()), l = (c, d) => {
457
457
  a.set(
458
- Pe(c.id, c.role),
459
- s
460
- ), i.get(c.id) === 1 && o.set(c.id, s);
461
- }, m = (c, s, u) => {
462
- if (s.granularity !== c.granularity)
458
+ Me(c.id, c.role),
459
+ d
460
+ ), i.get(c.id) === 1 && o.set(c.id, d);
461
+ }, m = (c, d, u) => {
462
+ if (d.granularity !== c.granularity)
463
463
  throw new N(
464
464
  "invalid_temporal_bucket_metadata",
465
- `Result identity "${u}" declares ${s.granularity} buckets for active ${c.granularity} field "${c.id}".`,
465
+ `Result identity "${u}" declares ${d.granularity} buckets for active ${c.granularity} field "${c.id}".`,
466
466
  { cardId: e.card.id, fieldId: c.id, columnKey: u }
467
467
  );
468
- const f = e.executionSnapshot && e.dashboardId ? mt({
468
+ const p = e.executionSnapshot && e.dashboardId ? pt({
469
469
  snapshot: e.executionSnapshot,
470
470
  scope: {
471
471
  dashboardId: e.dashboardId,
@@ -478,8 +478,8 @@ function On(e) {
478
478
  role: c.role
479
479
  }
480
480
  }) : void 0;
481
- if (e.executionSnapshot && !f)
482
- throw new Vt({
481
+ if (e.executionSnapshot && !p)
482
+ throw new Ut({
483
483
  dashboardId: e.dashboardId,
484
484
  cardId: e.card.id,
485
485
  fieldId: c.id
@@ -488,28 +488,28 @@ function On(e) {
488
488
  columnKey: u,
489
489
  fieldId: c.id,
490
490
  role: c.role,
491
- metadata: s,
492
- resolved: f ? Fe({
493
- metadata: s,
494
- cardFormat: f,
495
- locale: f.locale,
496
- ...f.presentation.mode === "auto" ? {
497
- styles: f.presentation.styles
491
+ metadata: d,
492
+ resolved: p ? Ae({
493
+ metadata: d,
494
+ cardFormat: p,
495
+ locale: p.locale,
496
+ ...p.presentation.mode === "auto" ? {
497
+ styles: p.presentation.styles
498
498
  } : {}
499
- }) : jt(
499
+ }) : Wt(
500
500
  c,
501
- s,
502
- e.valueFormatPreferences ?? se
501
+ d,
502
+ e.valueFormatPreferences ?? ue
503
503
  )
504
504
  };
505
505
  };
506
506
  for (const c of r.fields) {
507
- const s = V(
507
+ const d = L(
508
508
  e.columnKeyMap,
509
509
  c.id,
510
510
  c.role
511
511
  );
512
- if (!s) {
512
+ if (!d) {
513
513
  if (e.columns === void 0 && e.columnKeyMap === void 0 && (e.resultRowCount === void 0 || e.resultRowCount === 0))
514
514
  continue;
515
515
  throw new N(
@@ -518,13 +518,13 @@ function On(e) {
518
518
  { cardId: e.card.id, fieldId: c.id, columnKey: c.name }
519
519
  );
520
520
  }
521
- if (s.role === "pivotby") {
521
+ if (d.role === "pivotby") {
522
522
  const h = (e.columns || []).filter(
523
- (k) => k.pivotIdentity !== void 0
523
+ (E) => E.pivotIdentity !== void 0
524
524
  ), b = h.flatMap(
525
- (k) => {
525
+ (E) => {
526
526
  var _;
527
- return (((_ = k.pivotIdentity) == null ? void 0 : _.members) || []).filter((P) => P.fieldId === c.id).map((P) => ({ column: k, member: P }));
527
+ return (((_ = E.pivotIdentity) == null ? void 0 : _.members) || []).filter((P) => P.fieldId === c.id).map((P) => ({ column: E, member: P }));
528
528
  }
529
529
  );
530
530
  if (b.length === 0) {
@@ -533,7 +533,7 @@ function On(e) {
533
533
  throw new te({
534
534
  cardId: e.card.id,
535
535
  fieldId: c.id,
536
- columnKey: s.outputKey || s.rawKey
536
+ columnKey: d.outputKey || d.rawKey
537
537
  });
538
538
  }
539
539
  const w = b[0];
@@ -543,7 +543,7 @@ function On(e) {
543
543
  fieldId: c.id,
544
544
  columnKey: w.column.key
545
545
  });
546
- const g = xt(
546
+ const g = Ft(
547
547
  w.member.temporalBucket
548
548
  );
549
549
  if (!g.ok || !g.value)
@@ -556,59 +556,59 @@ function On(e) {
556
556
  columnKey: w.column.key
557
557
  }
558
558
  );
559
- const C = m(
559
+ const T = m(
560
560
  c,
561
561
  g.value,
562
562
  w.column.key
563
563
  );
564
- for (const { column: k, member: _ } of b)
564
+ for (const { column: E, member: _ } of b)
565
565
  if (!_.temporalBucket || JSON.stringify(_.temporalBucket) !== JSON.stringify(w.member.temporalBucket))
566
566
  throw new N(
567
567
  "invalid_temporal_bucket_metadata",
568
- `Pivot result column "${k.key}" has contradictory bucket metadata for field "${c.id}".`,
569
- { cardId: e.card.id, fieldId: c.id, columnKey: k.key }
568
+ `Pivot result column "${E.key}" has contradictory bucket metadata for field "${c.id}".`,
569
+ { cardId: e.card.id, fieldId: c.id, columnKey: E.key }
570
570
  );
571
- l(c, C);
571
+ l(c, T);
572
572
  continue;
573
573
  }
574
- const u = s.outputKey || s.rawKey, f = t.get(u);
575
- if (!(f != null && f.temporalBucket))
574
+ const u = d.outputKey || d.rawKey, p = t.get(u);
575
+ if (!(p != null && p.temporalBucket))
576
576
  throw new te({
577
577
  cardId: e.card.id,
578
578
  fieldId: c.id,
579
579
  columnKey: u
580
580
  });
581
- const d = $t(f, {
581
+ const s = Rt(p, {
582
582
  metadataRequired: !0
583
583
  });
584
- if (!d.ok || !d.value)
584
+ if (!s.ok || !s.value)
585
585
  throw new N(
586
586
  "invalid_temporal_bucket_metadata",
587
- d.ok ? `Result column "${u}" has no validated temporal bucket metadata.` : d.error.message,
587
+ s.ok ? `Result column "${u}" has no validated temporal bucket metadata.` : s.error.message,
588
588
  { cardId: e.card.id, fieldId: c.id, columnKey: u }
589
589
  );
590
590
  const v = m(
591
591
  c,
592
- d.value,
592
+ s.value,
593
593
  u
594
594
  );
595
595
  n.set(u, v), l(c, v);
596
596
  }
597
597
  return { byColumnKey: n, byFieldId: o, byFieldRole: a };
598
598
  }
599
- function Kn(e) {
599
+ function Vn(e) {
600
600
  var t, n;
601
- const r = e.role ? Lt({
601
+ const r = e.role ? Gt({
602
602
  presentation: e.presentation,
603
603
  fieldId: e.fieldId,
604
604
  role: e.role
605
605
  }) : (n = (t = e.presentation) == null ? void 0 : t.byFieldId) == null ? void 0 : n.get(e.fieldId);
606
- return r ? Me({
606
+ return r ? Be({
607
607
  value: e.value,
608
608
  presentation: r
609
609
  }) : e.value === null || e.value === void 0 ? "" : String(e.value);
610
610
  }
611
- function Me(e) {
611
+ function Be(e) {
612
612
  if (e.value === null || e.value === void 0) return "(Blank)";
613
613
  if (typeof e.value != "string")
614
614
  throw new N(
@@ -620,13 +620,13 @@ function Me(e) {
620
620
  }
621
621
  );
622
622
  try {
623
- return kt({
623
+ return At({
624
624
  value: e.value,
625
625
  metadata: e.presentation.metadata,
626
626
  format: e.presentation.resolved.format
627
627
  });
628
628
  } catch (r) {
629
- throw r instanceof Et ? new N(
629
+ throw r instanceof Pt ? new N(
630
630
  r.code,
631
631
  r.message,
632
632
  {
@@ -641,19 +641,19 @@ class S extends Error {
641
641
  super(`${r}: ${t}`), this.code = r, this.context = n, Object.setPrototypeOf(this, S.prototype), this.name = "RawTemporalPresentationBoundaryError";
642
642
  }
643
643
  }
644
- function Be() {
644
+ function De() {
645
645
  return { type: "raw_temporal", presentation: { mode: "auto" } };
646
646
  }
647
- function Gt(e) {
647
+ function Zt(e) {
648
648
  if (e.locale || e.relative || e.timezone && e.timezone !== "auto" || e.sourceTimezone && e.sourceTimezone !== "auto" || e.prefix || e.suffix)
649
649
  throw new S(
650
650
  "invalid_raw_temporal_format",
651
651
  "Activated raw temporal presentation contains unsupported locale, relative-time, timezone, prefix, or suffix settings."
652
652
  );
653
653
  }
654
- function De(e) {
654
+ function Oe(e) {
655
655
  const r = e.format;
656
- if ((r == null ? void 0 : r.type) === "date" && (Gt(r), r.pattern))
656
+ if ((r == null ? void 0 : r.type) === "date" && (Zt(r), r.pattern))
657
657
  return {
658
658
  type: "raw_temporal",
659
659
  presentation: {
@@ -691,12 +691,12 @@ function De(e) {
691
691
  dialect: "semaphor_tokens",
692
692
  pattern: e.dateFormat
693
693
  }
694
- } : Be();
694
+ } : De();
695
695
  }
696
- function fe(e) {
696
+ function ye(e) {
697
697
  var i;
698
698
  if (e != null && e.useRelativeTime) return;
699
- if (!e) return Be();
699
+ if (!e) return De();
700
700
  if (e.useCustomFormat && !((i = e.customFormat) != null && i.trim()))
701
701
  throw new S(
702
702
  "invalid_raw_temporal_format",
@@ -722,18 +722,18 @@ function fe(e) {
722
722
  presentation: { mode: "auto" }
723
723
  };
724
724
  }
725
- function Nn(e) {
725
+ function qn(e) {
726
726
  return e === "instant" ? "yyyy-MM-dd'T'HH:mm:ssXXX" : e === "wall_datetime" ? "yyyy-MM-dd'T'HH:mm:ss" : "yyyy-MM-dd";
727
727
  }
728
- function zn(e) {
729
- at({
728
+ function jn(e) {
729
+ it({
730
730
  dialect: "date_fns",
731
731
  pattern: e.pattern,
732
732
  valueKind: e.valueKind
733
733
  });
734
734
  }
735
- function Ht(e) {
736
- const r = fe(e.settings);
735
+ function Qt(e) {
736
+ const r = ye(e.settings);
737
737
  if (!r)
738
738
  throw new S(
739
739
  "invalid_raw_temporal_format",
@@ -757,9 +757,9 @@ function Ht(e) {
757
757
  );
758
758
  return a.text;
759
759
  }
760
- function Vn(e) {
760
+ function Un(e) {
761
761
  try {
762
- return { ok: !0, text: Ht(e) };
762
+ return { ok: !0, text: Qt(e) };
763
763
  } catch (r) {
764
764
  return {
765
765
  ok: !1,
@@ -767,14 +767,14 @@ function Vn(e) {
767
767
  };
768
768
  }
769
769
  }
770
- function Oe(e) {
770
+ function Ke(e) {
771
771
  var t;
772
772
  const r = e.effectiveCardConfig ?? e.card.config;
773
773
  return X(e.card, r) === "freeform" && !!((t = e.card.sql) != null && t.trim()) && !W(e.card.python || "").trim();
774
774
  }
775
- function Wt(e) {
775
+ function Jt(e) {
776
776
  var r, t;
777
- return e.type !== "table" && e.type !== "detailTable" || !Oe({ card: e }) ? !1 : Object.values(
777
+ return e.type !== "table" && e.type !== "detailTable" || !Ke({ card: e }) ? !1 : Object.values(
778
778
  ((t = (r = e.preferences) == null ? void 0 : r.tablePrefs) == null ? void 0 : t.columnSettingsMap) || {}
779
779
  ).some(
780
780
  (n) => {
@@ -783,9 +783,9 @@ function Wt(e) {
783
783
  }
784
784
  );
785
785
  }
786
- function Ln(e) {
786
+ function Gn(e) {
787
787
  var t, n, o;
788
- if (!Wt(e)) return e;
788
+ if (!Jt(e)) return e;
789
789
  const r = ((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.columnSettingsMap) || {};
790
790
  return {
791
791
  ...e,
@@ -814,17 +814,17 @@ function Ln(e) {
814
814
  }
815
815
  };
816
816
  }
817
- function Yt() {
817
+ function Xt() {
818
818
  return {
819
819
  activatedColumnKeys: /* @__PURE__ */ new Set(),
820
820
  byColumnKey: /* @__PURE__ */ new Map(),
821
821
  byFieldId: /* @__PURE__ */ new Map()
822
822
  };
823
823
  }
824
- function ce(e, r) {
824
+ function le(e, r) {
825
825
  return e === void 0 ? { kind: "invalid", error: r } : {
826
826
  kind: "invalid",
827
- error: e instanceof S ? e : e instanceof ot ? new S(
827
+ error: e instanceof S ? e : e instanceof at ? new S(
828
828
  e.code,
829
829
  e.message,
830
830
  r.context
@@ -835,14 +835,14 @@ function ce(e, r) {
835
835
  )
836
836
  };
837
837
  }
838
- function Zt(e) {
838
+ function er(e) {
839
839
  var o;
840
840
  if (e.cardType !== "detailTable" || e.resultOwner !== "config")
841
841
  return { kind: "inactive" };
842
842
  if (!e.result) return { kind: "loading" };
843
843
  const { records: r, columns: t, columnKeyMap: n } = e.result;
844
844
  if (!Array.isArray(r) || !Array.isArray(t) || !n)
845
- return ce(
845
+ return le(
846
846
  void 0,
847
847
  new S(
848
848
  "missing_raw_temporal_result_contract",
@@ -850,59 +850,59 @@ function Zt(e) {
850
850
  )
851
851
  );
852
852
  try {
853
- const a = t.filter((s) => s.rawTemporal);
853
+ const a = t.filter((d) => d.rawTemporal);
854
854
  if (a.length === 0) return { kind: "inactive" };
855
855
  const i = new Map(
856
- (((o = e.effectiveCardConfig) == null ? void 0 : o.detailColumns) || []).map((s) => [
857
- s.id,
858
- s
856
+ (((o = e.effectiveCardConfig) == null ? void 0 : o.detailColumns) || []).map((d) => [
857
+ d.id,
858
+ d
859
859
  ])
860
860
  ), l = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
861
- for (const s of a) {
861
+ for (const d of a) {
862
862
  const u = Array.from(i).flatMap(
863
- ([C, k]) => {
864
- const _ = V(
863
+ ([T, E]) => {
864
+ const _ = L(
865
865
  n,
866
- C,
866
+ T,
867
867
  "detail"
868
868
  );
869
- return _ && _.role === "detail" && (_.outputKey ?? _.rawKey) === s.key ? [{ field: k, binding: _ }] : [];
869
+ return _ && _.role === "detail" && (_.outputKey ?? _.rawKey) === d.key ? [{ field: E, binding: _ }] : [];
870
870
  }
871
- ), f = u.length === 1 ? u[0] : null;
872
- if (!f || typeof f.binding.rawKey != "string" || f.binding.rawKey.trim().length === 0 || f.binding.outputKey !== void 0 && (typeof f.binding.outputKey != "string" || f.binding.outputKey.trim().length === 0))
871
+ ), p = u.length === 1 ? u[0] : null;
872
+ if (!p || typeof p.binding.rawKey != "string" || p.binding.rawKey.trim().length === 0 || p.binding.outputKey !== void 0 && (typeof p.binding.outputKey != "string" || p.binding.outputKey.trim().length === 0))
873
873
  throw new S(
874
874
  "missing_raw_temporal_column_binding",
875
- `Raw temporal result column "${s.key}" does not have one valid exact detail result binding.`,
876
- { columnKey: s.key }
875
+ `Raw temporal result column "${d.key}" does not have one valid exact detail result binding.`,
876
+ { columnKey: d.key }
877
877
  );
878
- const { field: d, binding: v } = f, h = v.outputKey ?? v.rawKey, b = Ae(s, {
878
+ const { field: s, binding: v } = p, h = v.outputKey ?? v.rawKey, b = Pe(d, {
879
879
  metadataRequired: !0
880
880
  });
881
881
  if (!b)
882
882
  throw new S(
883
883
  "invalid_raw_temporal_metadata",
884
884
  `Raw temporal result column "${h}" has no metadata.`,
885
- { fieldId: d.id, columnKey: h }
885
+ { fieldId: s.id, columnKey: h }
886
886
  );
887
887
  const w = G({
888
- format: De(d),
888
+ format: Oe(s),
889
889
  preferences: e.preferences,
890
890
  calendar: e.calendar
891
891
  }), g = {
892
- fieldId: d.id,
892
+ fieldId: s.id,
893
893
  columnKey: h,
894
894
  metadata: b,
895
895
  format: w,
896
896
  formatValue: J({ metadata: b, format: w })
897
897
  };
898
- for (let C = 0; C < r.length; C += 1)
899
- if (!Object.prototype.hasOwnProperty.call(r[C], h) || r[C][h] === void 0)
898
+ for (let T = 0; T < r.length; T += 1)
899
+ if (!Object.prototype.hasOwnProperty.call(r[T], h) || r[T][h] === void 0)
900
900
  throw new S(
901
901
  "missing_raw_temporal_result_contract",
902
- `Raw temporal result row ${C} is missing column "${h}".`,
903
- { fieldId: d.id, columnKey: h }
902
+ `Raw temporal result row ${T} is missing column "${h}".`,
903
+ { fieldId: s.id, columnKey: h }
904
904
  );
905
- l.set(h, g), m.set(d.id, g);
905
+ l.set(h, g), m.set(s.id, g);
906
906
  }
907
907
  const c = {
908
908
  activatedColumnKeys: new Set(l.keys()),
@@ -911,7 +911,7 @@ function Zt(e) {
911
911
  };
912
912
  return r.length === 0 ? { kind: "loaded_empty", presentation: c } : { kind: "loaded_valid", presentation: c };
913
913
  } catch (a) {
914
- return ce(
914
+ return le(
915
915
  a,
916
916
  new S(
917
917
  "invalid_raw_temporal_metadata",
@@ -920,7 +920,7 @@ function Zt(e) {
920
920
  );
921
921
  }
922
922
  }
923
- function Qt(e) {
923
+ function tr(e) {
924
924
  var n, o, a;
925
925
  const r = e.effectiveCardConfig ?? e.card.config, t = X(
926
926
  e.card,
@@ -934,8 +934,8 @@ function Qt(e) {
934
934
  "missing_raw_temporal_result_contract",
935
935
  "Activated raw temporal detail results require records, columns, and columnKeyMap atomically."
936
936
  )
937
- } : e.records !== void 0 && !i ? { kind: "inactive" } : Ie(
938
- Zt({
937
+ } : e.records !== void 0 && !i ? { kind: "inactive" } : Ce(
938
+ er({
939
939
  cardType: e.card.type,
940
940
  resultOwner: t,
941
941
  effectiveCardConfig: r,
@@ -950,8 +950,8 @@ function Qt(e) {
950
950
  e
951
951
  );
952
952
  }
953
- return Ie(
954
- Jt({
953
+ return Ce(
954
+ rr({
955
955
  resultOwner: t,
956
956
  sql: e.card.sql,
957
957
  normalizedPython: W(
@@ -966,13 +966,13 @@ function Qt(e) {
966
966
  e
967
967
  );
968
968
  }
969
- function qn(e) {
969
+ function Hn(e) {
970
970
  var n, o, a;
971
971
  const r = e.effectiveCardConfig ?? e.card.config, t = X(
972
972
  e.card,
973
973
  r
974
974
  );
975
- return e.card.type === "detailTable" && t === "config" ? !!((n = e.columns) != null && n.some((i) => i.rawTemporal)) : Oe(e) ? Object.values(
975
+ return e.card.type === "detailTable" && t === "config" ? !!((n = e.columns) != null && n.some((i) => i.rawTemporal)) : Ke(e) ? Object.values(
976
976
  ((a = (o = e.card.preferences) == null ? void 0 : o.tablePrefs) == null ? void 0 : a.columnSettingsMap) || {}
977
977
  ).some(
978
978
  (i) => {
@@ -981,7 +981,7 @@ function qn(e) {
981
981
  }
982
982
  ) : !1;
983
983
  }
984
- function Ie(e, r) {
984
+ function Ce(e, r) {
985
985
  if (!r.executionSnapshot || e.kind === "inactive" || e.kind === "loading" || e.kind === "invalid")
986
986
  return e;
987
987
  if (!r.dashboardId)
@@ -994,7 +994,7 @@ function Ie(e, r) {
994
994
  };
995
995
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
996
996
  for (const o of e.presentation.activatedColumnKeys) {
997
- const a = ft({
997
+ const a = ht({
998
998
  snapshot: r.executionSnapshot,
999
999
  scope: {
1000
1000
  dashboardId: r.dashboardId,
@@ -1006,7 +1006,7 @@ function Ie(e, r) {
1006
1006
  if (!a)
1007
1007
  return {
1008
1008
  kind: "invalid",
1009
- error: new pt(o)
1009
+ error: new gt(o)
1010
1010
  };
1011
1011
  const i = e.presentation.byColumnKey.get(o);
1012
1012
  if (!i) continue;
@@ -1029,7 +1029,7 @@ function Ie(e, r) {
1029
1029
  }
1030
1030
  };
1031
1031
  }
1032
- function Jt(e) {
1032
+ function rr(e) {
1033
1033
  var t, n;
1034
1034
  if (e.resultOwner !== "freeform" || !((t = e.sql) != null && t.trim()) || (n = e.normalizedPython) != null && n.trim())
1035
1035
  return { kind: "inactive" };
@@ -1047,12 +1047,12 @@ function Jt(e) {
1047
1047
  const o = /* @__PURE__ */ new Map(), a = new Set(
1048
1048
  r.map(([c]) => c)
1049
1049
  ), i = /* @__PURE__ */ new Map(), l = [...e.columns || []];
1050
- for (const [c, s] of r) {
1051
- const u = fe(
1052
- s.dateFormat
1050
+ for (const [c, d] of r) {
1051
+ const u = ye(
1052
+ d.dateFormat
1053
1053
  );
1054
1054
  if (!u) continue;
1055
- const f = nt({
1055
+ const p = ot({
1056
1056
  columnKey: c,
1057
1057
  values: e.records.map((b) => {
1058
1058
  if (!Object.prototype.hasOwnProperty.call(b, c))
@@ -1065,17 +1065,17 @@ function Jt(e) {
1065
1065
  return w === null || typeof w == "string" ? w : String(w);
1066
1066
  })
1067
1067
  });
1068
- if (i.set(c, f), f.status !== "classified") continue;
1069
- let d = l.findIndex(
1068
+ if (i.set(c, p), p.status !== "classified") continue;
1069
+ let s = l.findIndex(
1070
1070
  (b) => b.key === c
1071
1071
  );
1072
- if (e.columns && d < 0)
1072
+ if (e.columns && s < 0)
1073
1073
  throw new S(
1074
1074
  "missing_raw_temporal_result_contract",
1075
1075
  `Classified SQL temporal column "${c}" is absent from result columns.`,
1076
1076
  { columnKey: c }
1077
1077
  );
1078
- d < 0 && (d = l.length, l.push({
1078
+ s < 0 && (s = l.length, l.push({
1079
1079
  key: c,
1080
1080
  name: c,
1081
1081
  label: c,
@@ -1083,14 +1083,14 @@ function Jt(e) {
1083
1083
  dataType: "string"
1084
1084
  }));
1085
1085
  const v = {
1086
- ...l[d],
1086
+ ...l[s],
1087
1087
  role: "date",
1088
- dataType: f.metadata.valueKind === "date" ? "date" : "datetime",
1089
- rawTemporal: f.metadata
1088
+ dataType: p.metadata.valueKind === "date" ? "date" : "datetime",
1089
+ rawTemporal: p.metadata
1090
1090
  };
1091
- Ae(v, {
1091
+ Pe(v, {
1092
1092
  metadataRequired: !0
1093
- }), l[d] = v;
1093
+ }), l[s] = v;
1094
1094
  const h = G({
1095
1095
  format: u,
1096
1096
  preferences: e.preferences,
@@ -1098,16 +1098,16 @@ function Jt(e) {
1098
1098
  });
1099
1099
  o.set(c, {
1100
1100
  columnKey: c,
1101
- metadata: f.metadata,
1101
+ metadata: p.metadata,
1102
1102
  format: h,
1103
1103
  formatValue: J({
1104
- metadata: f.metadata,
1104
+ metadata: p.metadata,
1105
1105
  format: h
1106
1106
  })
1107
1107
  });
1108
1108
  }
1109
1109
  const m = {
1110
- ...Yt(),
1110
+ ...Xt(),
1111
1111
  activatedColumnKeys: a,
1112
1112
  byColumnKey: o
1113
1113
  };
@@ -1123,7 +1123,7 @@ function Jt(e) {
1123
1123
  sqlClassifications: i
1124
1124
  };
1125
1125
  } catch (o) {
1126
- return ce(
1126
+ return le(
1127
1127
  o,
1128
1128
  new S(
1129
1129
  "invalid_raw_temporal_format",
@@ -1132,7 +1132,7 @@ function Jt(e) {
1132
1132
  );
1133
1133
  }
1134
1134
  }
1135
- function jn(e) {
1135
+ function Wn(e) {
1136
1136
  if (e.value !== null && typeof e.value != "string")
1137
1137
  return {
1138
1138
  value: e.value,
@@ -1149,51 +1149,51 @@ function jn(e) {
1149
1149
  const r = e.presentation.formatValue(e.value);
1150
1150
  return { value: e.value, label: r.text, result: r };
1151
1151
  }
1152
- function Un(e) {
1152
+ function Yn(e) {
1153
1153
  if (!e.result || typeof e.result != "object") return !1;
1154
1154
  const r = e.result;
1155
1155
  if (e.expectedResultOwner !== void 0 && r.resultOwner !== e.expectedResultOwner || !Array.isArray(r.records)) return !1;
1156
- const t = Qt({
1156
+ const t = tr({
1157
1157
  card: e.card,
1158
1158
  effectiveCardConfig: e.effectiveCardConfig,
1159
1159
  records: r.records,
1160
1160
  columns: r.columns,
1161
1161
  columnKeyMap: r.columnKeyMap,
1162
- preferences: se,
1162
+ preferences: ue,
1163
1163
  calendar: { tz: "UTC" }
1164
1164
  });
1165
1165
  return t.kind === "inactive" || t.kind === "loaded_empty" || t.kind === "loaded_valid";
1166
1166
  }
1167
- function we(e) {
1167
+ function Te(e) {
1168
1168
  return !e || typeof e != "object" ? !1 : Array.isArray(e.cards);
1169
1169
  }
1170
- function Xt(e) {
1170
+ function nr(e) {
1171
1171
  if (!e)
1172
1172
  return null;
1173
1173
  if (typeof e == "string")
1174
1174
  try {
1175
1175
  const r = JSON.parse(e);
1176
- return we(r) ? r : null;
1176
+ return Te(r) ? r : null;
1177
1177
  } catch {
1178
1178
  return null;
1179
1179
  }
1180
- return we(e) ? e : null;
1180
+ return Te(e) ? e : null;
1181
1181
  }
1182
- function Ke(e) {
1182
+ function Ne(e) {
1183
1183
  var r;
1184
1184
  return (r = e == null ? void 0 : e.cards) != null && r.length ? e.activeCardId && e.cards.find((t) => t.id === e.activeCardId) || e.cards[0] : null;
1185
1185
  }
1186
- function Gn(e) {
1186
+ function Zn(e) {
1187
1187
  var t;
1188
1188
  const r = (e == null ? void 0 : e.frameObject) ?? ((t = e == null ? void 0 : e.visual) == null ? void 0 : t.frameObject);
1189
- return Ke(Xt(r));
1189
+ return Ne(nr(r));
1190
1190
  }
1191
- function pe(e) {
1191
+ function he(e) {
1192
1192
  if (!(e != null && e.expectedType)) return "table";
1193
1193
  const r = Array.isArray(e.expectedType) ? e.expectedType[0] : e.expectedType;
1194
- return tr(r) ? r : "table";
1194
+ return ar(r) ? r : "table";
1195
1195
  }
1196
- const er = [
1196
+ const or = [
1197
1197
  "bar",
1198
1198
  "horizontalBar",
1199
1199
  "line",
@@ -1225,8 +1225,8 @@ const er = [
1225
1225
  "treemap",
1226
1226
  "custom"
1227
1227
  ];
1228
- function tr(e) {
1229
- return er.includes(e);
1228
+ function ar(e) {
1229
+ return or.includes(e);
1230
1230
  }
1231
1231
  function H(e) {
1232
1232
  const r = e.position;
@@ -1260,63 +1260,63 @@ function U(e) {
1260
1260
  }
1261
1261
  return null;
1262
1262
  }
1263
- function Ne(e) {
1263
+ function ze(e) {
1264
1264
  return !e || e.length === 0 ? void 0 : [...e].sort(
1265
1265
  (t, n) => H(t) - H(n)
1266
1266
  )[0];
1267
1267
  }
1268
- function ze(e, r) {
1268
+ function Le(e, r) {
1269
1269
  if (!e || e.length === 0) return;
1270
1270
  const t = [], n = [], o = [];
1271
- e.forEach((s) => {
1272
- const u = U(s.position);
1273
- u && (u.kind === "number" ? t.push(s) : u.kind === "range" ? n.push(s) : u.kind === "dynamic" && o.push(s));
1271
+ e.forEach((d) => {
1272
+ const u = U(d.position);
1273
+ u && (u.kind === "number" ? t.push(d) : u.kind === "range" ? n.push(d) : u.kind === "dynamic" && o.push(d));
1274
1274
  });
1275
- const a = t.find((s) => {
1276
- const u = U(s.position);
1275
+ const a = t.find((d) => {
1276
+ const u = U(d.position);
1277
1277
  return (u == null ? void 0 : u.kind) === "number" && u.start === r;
1278
1278
  });
1279
1279
  if (a) return a;
1280
1280
  const l = n.sort(
1281
- (s, u) => H(s) - H(u)
1282
- ).find((s) => {
1283
- const u = U(s.position);
1281
+ (d, u) => H(d) - H(u)
1282
+ ).find((d) => {
1283
+ const u = U(d.position);
1284
1284
  return (u == null ? void 0 : u.kind) === "range" && r >= u.start && r <= u.end;
1285
1285
  });
1286
1286
  if (l) return l;
1287
- const c = o.map((s) => ({
1288
- slot: s,
1289
- parsed: U(s.position)
1290
- })).filter((s) => {
1287
+ const c = o.map((d) => ({
1288
+ slot: d,
1289
+ parsed: U(d.position)
1290
+ })).filter((d) => {
1291
1291
  var u;
1292
- return ((u = s.parsed) == null ? void 0 : u.kind) === "dynamic";
1292
+ return ((u = d.parsed) == null ? void 0 : u.kind) === "dynamic";
1293
1293
  }).sort(
1294
- (s, u) => {
1295
- var f, d;
1296
- return (((f = s.parsed) == null ? void 0 : f.start) ?? 0) - (((d = u.parsed) == null ? void 0 : d.start) ?? 0);
1294
+ (d, u) => {
1295
+ var p, s;
1296
+ return (((p = d.parsed) == null ? void 0 : p.start) ?? 0) - (((s = u.parsed) == null ? void 0 : s.start) ?? 0);
1297
1297
  }
1298
- ).filter((s) => {
1298
+ ).filter((d) => {
1299
1299
  var u;
1300
- return r >= (((u = s.parsed) == null ? void 0 : u.start) ?? 0);
1300
+ return r >= (((u = d.parsed) == null ? void 0 : u.start) ?? 0);
1301
1301
  }).sort(
1302
- (s, u) => {
1303
- var f, d;
1304
- return (((f = u.parsed) == null ? void 0 : f.start) ?? 0) - (((d = s.parsed) == null ? void 0 : d.start) ?? 0);
1302
+ (d, u) => {
1303
+ var p, s;
1304
+ return (((p = u.parsed) == null ? void 0 : p.start) ?? 0) - (((s = d.parsed) == null ? void 0 : s.start) ?? 0);
1305
1305
  }
1306
1306
  )[0];
1307
1307
  return c == null ? void 0 : c.slot;
1308
1308
  }
1309
- function rr(e, r) {
1310
- const t = ze(e, r);
1309
+ function ir(e, r) {
1310
+ const t = Le(e, r);
1311
1311
  if (t)
1312
- return pe(t);
1312
+ return he(t);
1313
1313
  }
1314
- function nr(e, r) {
1314
+ function cr(e, r) {
1315
1315
  var n;
1316
1316
  const t = (n = e == null ? void 0 : e.customCardPreferences) == null ? void 0 : n.slotIndex;
1317
1317
  return typeof t == "number" ? t : r;
1318
1318
  }
1319
- function Ce(e, r) {
1319
+ function xe(e, r) {
1320
1320
  var t;
1321
1321
  if (!((t = e == null ? void 0 : e.customCardPreferences) != null && t.url))
1322
1322
  return !1;
@@ -1334,18 +1334,18 @@ function Ce(e, r) {
1334
1334
  }
1335
1335
  return !1;
1336
1336
  }
1337
- function or(e) {
1337
+ function lr(e) {
1338
1338
  const r = [];
1339
1339
  let t = -1;
1340
1340
  e.forEach((n, o) => {
1341
- const a = nr(n, o);
1341
+ const a = cr(n, o);
1342
1342
  a > t && (t = a), r[a] = n ?? null;
1343
1343
  });
1344
1344
  for (let n = 0; n <= t; n += 1)
1345
1345
  n in r || (r[n] = null);
1346
1346
  return r;
1347
1347
  }
1348
- function Hn(e) {
1348
+ function Qn(e) {
1349
1349
  return e.map((r, t) => !r.customCardPreferences || r.customCardPreferences.slotIndex === t ? r : {
1350
1350
  ...r,
1351
1351
  customCardPreferences: {
@@ -1354,17 +1354,17 @@ function Hn(e) {
1354
1354
  }
1355
1355
  });
1356
1356
  }
1357
- function Wn(e) {
1358
- const r = Ne(e);
1357
+ function Jn(e) {
1358
+ const r = ze(e);
1359
1359
  if (r)
1360
- return pe(r);
1360
+ return he(r);
1361
1361
  }
1362
- function Yn(e, r, t) {
1362
+ function Xn(e, r, t) {
1363
1363
  if (!e) return;
1364
- const n = rr(t, r);
1364
+ const n = ir(t, r);
1365
1365
  return e.type === "custom" && n ? n : e.type;
1366
1366
  }
1367
- function Zn(e, r, t) {
1367
+ function eo(e, r, t) {
1368
1368
  var v;
1369
1369
  const n = {
1370
1370
  dataSource: t.dataSource,
@@ -1386,13 +1386,13 @@ function Zn(e, r, t) {
1386
1386
  }, a = r.minInputs || 1, l = e.map((h) => ({ slot: h, parsed: U(h.position) })).filter((h) => h.parsed !== null).reduce((h, b) => {
1387
1387
  const w = b.parsed.end;
1388
1388
  return Number.isFinite(w) ? Math.max(h, w) : h;
1389
- }, -1), m = Math.max(a, l + 1), c = Ne(e), s = c ? H(c) : 0;
1389
+ }, -1), m = Math.max(a, l + 1), c = ze(e), d = c ? H(c) : 0;
1390
1390
  let u = !1;
1391
- const f = [];
1391
+ const p = [];
1392
1392
  for (let h = 0; h < m; h += 1) {
1393
- const b = ze(e, h), w = pe(b), g = !u && h === s, C = h, k = {
1393
+ const b = Le(e, h), w = he(b), g = !u && h === d, T = h, E = {
1394
1394
  ...n,
1395
- id: vt(),
1395
+ id: wt(),
1396
1396
  title: (g ? c == null ? void 0 : c.label : b == null ? void 0 : b.label) || `Tab ${h + 1}`,
1397
1397
  tabTitle: (g ? c == null ? void 0 : c.label : b == null ? void 0 : b.label) || `Tab ${h + 1}`,
1398
1398
  description: (g ? c == null ? void 0 : c.description : b == null ? void 0 : b.description) || "",
@@ -1404,41 +1404,41 @@ function Zn(e, r, t) {
1404
1404
  ...g && {
1405
1405
  customCardPreferences: {
1406
1406
  ...o,
1407
- slotIndex: C
1407
+ slotIndex: T
1408
1408
  }
1409
1409
  },
1410
1410
  ...!g && {
1411
1411
  customCardPreferences: {
1412
- slotIndex: C
1412
+ slotIndex: T
1413
1413
  }
1414
1414
  }
1415
1415
  };
1416
- g && (u = !0), f.push(k);
1416
+ g && (u = !0), p.push(E);
1417
1417
  }
1418
- if (!u && f.length > 0) {
1419
- const h = ((v = f[0].customCardPreferences) == null ? void 0 : v.slotIndex) ?? 0;
1420
- f[0] = {
1421
- ...f[0],
1422
- type: f[0].type,
1418
+ if (!u && p.length > 0) {
1419
+ const h = ((v = p[0].customCardPreferences) == null ? void 0 : v.slotIndex) ?? 0;
1420
+ p[0] = {
1421
+ ...p[0],
1422
+ type: p[0].type,
1423
1423
  customCardPreferences: {
1424
1424
  ...o,
1425
1425
  slotIndex: h
1426
1426
  }
1427
1427
  };
1428
1428
  }
1429
- const d = f.findIndex(
1429
+ const s = p.findIndex(
1430
1430
  (h) => {
1431
1431
  var b;
1432
1432
  return !!((b = h.customCardPreferences) != null && b.url);
1433
1433
  }
1434
1434
  );
1435
- if (d > 0) {
1436
- const [h] = f.splice(d, 1);
1437
- f.unshift(h);
1435
+ if (s > 0) {
1436
+ const [h] = p.splice(s, 1);
1437
+ p.unshift(h);
1438
1438
  }
1439
- return f;
1439
+ return p;
1440
1440
  }
1441
- function ar({
1441
+ function sr({
1442
1442
  frame: e,
1443
1443
  configCard: r,
1444
1444
  isMultiInputVisual: t
@@ -1453,10 +1453,10 @@ function ar({
1453
1453
  return e.cards.find((m) => m.id === i) || null;
1454
1454
  }) : e.cards;
1455
1455
  }
1456
- function ir(e, r) {
1457
- return r && Ce(r, e.cards) ? r : e.cards.find((t) => Ce(t, e.cards)) || null;
1456
+ function dr(e, r) {
1457
+ return r && xe(r, e.cards) ? r : e.cards.find((t) => xe(t, e.cards)) || null;
1458
1458
  }
1459
- function cr(e, r) {
1459
+ function mr(e, r) {
1460
1460
  var o, a;
1461
1461
  if (!e) return null;
1462
1462
  const t = r == null ? void 0 : r.visualType;
@@ -1466,10 +1466,10 @@ function cr(e, r) {
1466
1466
  const n = (o = e.customCardPreferences) == null ? void 0 : o.visualType;
1467
1467
  return n || ((a = e.customCardPreferences) != null && a.dataInputCardIds ? "multiple" : null);
1468
1468
  }
1469
- function Qn(e) {
1469
+ function to(e) {
1470
1470
  return e.visualType === "multiple" || e.slots && e.slots.length > 0 || (e.minInputs || 0) > 1 || (e.maxInputs || 0) > 1 || (e.dataInputs || []).length > 1 ? "multiple" : "single";
1471
1471
  }
1472
- function Jn(e) {
1472
+ function ro(e) {
1473
1473
  return Array.isArray(e) ? { records: e } : e;
1474
1474
  }
1475
1475
  class Y extends Error {
@@ -1483,7 +1483,7 @@ class Y extends Error {
1483
1483
  this.name = "TemporalSnapshotSelectionError", this.selection = t;
1484
1484
  }
1485
1485
  }
1486
- function lr(e, r) {
1486
+ function ur(e, r) {
1487
1487
  var o;
1488
1488
  const t = [], n = /* @__PURE__ */ new Map();
1489
1489
  for (const a of r) {
@@ -1497,25 +1497,25 @@ function lr(e, r) {
1497
1497
  let l = !a.cardId;
1498
1498
  for (const m of i) {
1499
1499
  const c = (((o = m.document) == null ? void 0 : o.sections) || []).flatMap(
1500
- (f) => f.type === "table" || f.type === "chart" ? [f.card] : []
1501
- ), s = (m.frames || []).flatMap(
1502
- (f) => dr(f, a.cardId)
1500
+ (p) => kt(p)
1501
+ ), d = (m.frames || []).flatMap(
1502
+ (p) => fr(p, a.cardId)
1503
1503
  );
1504
- s.length > 0 && (l = !0);
1504
+ d.length > 0 && (l = !0);
1505
1505
  const u = [
1506
- ...s,
1506
+ ...d,
1507
1507
  ...(m.cards || []).filter(
1508
- (f) => !a.cardId || a.cardId === f.id
1508
+ (p) => !a.cardId || a.cardId === p.id
1509
1509
  ),
1510
1510
  ...c.filter(
1511
- (f) => !a.cardId || a.cardId === f.id
1511
+ (p) => !a.cardId || a.cardId === p.id
1512
1512
  )
1513
1513
  ];
1514
- for (const f of u) {
1514
+ for (const p of u) {
1515
1515
  l = !0;
1516
- const d = n.get(a.attachmentIndex) ?? /* @__PURE__ */ new Set();
1517
- d.has(f.id) || (d.add(f.id), n.set(a.attachmentIndex, d), t.push({
1518
- card: f,
1516
+ const s = n.get(a.attachmentIndex) ?? /* @__PURE__ */ new Set();
1517
+ s.has(p.id) || (s.add(p.id), n.set(a.attachmentIndex, s), t.push({
1518
+ card: p,
1519
1519
  ...a.attachmentIndex !== void 0 ? { attachmentIndex: a.attachmentIndex } : {}
1520
1520
  }));
1521
1521
  }
@@ -1525,29 +1525,29 @@ function lr(e, r) {
1525
1525
  }
1526
1526
  return t;
1527
1527
  }
1528
- function dr(e, r) {
1528
+ function fr(e, r) {
1529
1529
  var i;
1530
- const t = r ? (i = e.cards) == null ? void 0 : i.find((l) => l.id === r) : Ke(e);
1530
+ const t = r ? (i = e.cards) == null ? void 0 : i.find((l) => l.id === r) : Ne(e);
1531
1531
  if (!t) return [];
1532
- const n = ir(e, t), o = (e.cards || []).filter(
1532
+ const n = dr(e, t), o = (e.cards || []).filter(
1533
1533
  (l) => {
1534
1534
  var m;
1535
1535
  return typeof ((m = l.customCardPreferences) == null ? void 0 : m.slotIndex) == "number";
1536
1536
  }
1537
- ).length > 1, a = n != null && (cr(n) === "multiple" || o);
1538
- return !n || !a ? [t] : or(
1539
- ar({
1537
+ ).length > 1, a = n != null && (mr(n) === "multiple" || o);
1538
+ return !n || !a ? [t] : lr(
1539
+ sr({
1540
1540
  frame: e,
1541
1541
  configCard: n,
1542
1542
  isMultiInputVisual: !0
1543
1543
  })
1544
1544
  ).filter((l) => l !== null);
1545
1545
  }
1546
- function Xn(e) {
1547
- return lr(e.dashboard, e.selections).flatMap(
1546
+ function no(e) {
1547
+ return ur(e.dashboard, e.selections).flatMap(
1548
1548
  ({ card: r, attachmentIndex: t }) => {
1549
- var s, u, f, d;
1550
- const n = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, r)) ?? r.config, o = Kt({
1549
+ var d, u, p, s;
1550
+ const n = ((d = e.resolveCardConfig) == null ? void 0 : d.call(e, r)) ?? r.config, o = Vt({
1551
1551
  card: r,
1552
1552
  cardConfig: n
1553
1553
  }), a = {
@@ -1561,7 +1561,7 @@ function Xn(e) {
1561
1561
  fieldId: v.id,
1562
1562
  role: v.role
1563
1563
  },
1564
- format: Ut(
1564
+ format: Yt(
1565
1565
  v,
1566
1566
  {
1567
1567
  dateStyle: e.valueFormatPreferences.dateStyle,
@@ -1592,20 +1592,20 @@ function Xn(e) {
1592
1592
  }))
1593
1593
  ], b = /* @__PURE__ */ new Map(), w = new Set(
1594
1594
  h.map(
1595
- ({ field: g, role: C }) => Rt(g, C)
1595
+ ({ field: g, role: T }) => Bt(g, T)
1596
1596
  )
1597
1597
  );
1598
1598
  for (const { field: g } of h) {
1599
- const C = g.label;
1600
- C && b.set(C, (b.get(C) || 0) + 1);
1599
+ const T = g.label;
1600
+ T && b.set(T, (b.get(T) || 0) + 1);
1601
1601
  }
1602
1602
  for (const g of v) {
1603
- const C = $e(g.dataType);
1604
- if (C !== "date" && C !== "datetime") continue;
1605
- const k = At(g), _ = g.label, P = Pt({
1603
+ const T = Ee(g.dataType);
1604
+ if (T !== "date" && T !== "datetime") continue;
1605
+ const E = Dt(g), _ = g.label, P = Ot({
1606
1606
  label: _,
1607
1607
  labelCount: _ && b.get(_) || 0,
1608
- rawKey: k,
1608
+ rawKey: E,
1609
1609
  rawKeys: w
1610
1610
  });
1611
1611
  if (!P) throw new Y(a);
@@ -1613,7 +1613,7 @@ function Xn(e) {
1613
1613
  scope: a,
1614
1614
  target: { kind: "column", columnKey: P },
1615
1615
  format: G({
1616
- format: De(g),
1616
+ format: Oe(g),
1617
1617
  preferences: e.valueFormatPreferences,
1618
1618
  calendar: e.calendar
1619
1619
  })
@@ -1621,10 +1621,10 @@ function Xn(e) {
1621
1621
  }
1622
1622
  } else if (m === "freeform" && ((u = r.sql) != null && u.trim()) && !c.trim())
1623
1623
  for (const [v, h] of Object.entries(
1624
- ((d = (f = r.preferences) == null ? void 0 : f.tablePrefs) == null ? void 0 : d.columnSettingsMap) || {}
1624
+ ((s = (p = r.preferences) == null ? void 0 : p.tablePrefs) == null ? void 0 : s.columnSettingsMap) || {}
1625
1625
  )) {
1626
1626
  if (h.type !== "date") continue;
1627
- const b = fe(
1627
+ const b = ye(
1628
1628
  h.dateFormat
1629
1629
  );
1630
1630
  b && l.push({
@@ -1641,12 +1641,12 @@ function Xn(e) {
1641
1641
  }
1642
1642
  );
1643
1643
  }
1644
- const sr = /* @__PURE__ */ new Set([
1644
+ const pr = /* @__PURE__ */ new Set([
1645
1645
  "table",
1646
1646
  "aggregateTable",
1647
1647
  "pivotTable",
1648
1648
  "detailTable"
1649
- ]), mr = /* @__PURE__ */ new Set([
1649
+ ]), yr = /* @__PURE__ */ new Set([
1650
1650
  "bar",
1651
1651
  "horizontalBar",
1652
1652
  "line",
@@ -1677,40 +1677,40 @@ const sr = /* @__PURE__ */ new Set([
1677
1677
  "treemap",
1678
1678
  "custom"
1679
1679
  ]);
1680
- function eo(e) {
1680
+ function oo(e) {
1681
1681
  var o, a, i;
1682
- const r = mr.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
1682
+ const r = yr.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
1683
1683
  let t = !1;
1684
1684
  try {
1685
- t = !!It(e);
1685
+ t = !!Tt(e);
1686
1686
  } catch {
1687
1687
  return { formats: [], defaultFormat: null };
1688
1688
  }
1689
- return e.type === "text" || !r || !t && bt(e) ? { formats: [], defaultFormat: null } : {
1690
- formats: ur({
1689
+ return e.type === "text" || !r || !t && Ct(e) ? { formats: [], defaultFormat: null } : {
1690
+ formats: hr({
1691
1691
  cardType: e.type,
1692
1692
  allowDownload: (a = e.preferences) == null ? void 0 : a.allowDownload
1693
1693
  }),
1694
- defaultFormat: fr({
1694
+ defaultFormat: gr({
1695
1695
  cardType: e.type,
1696
1696
  allowDownload: (i = e.preferences) == null ? void 0 : i.allowDownload
1697
1697
  })
1698
1698
  };
1699
1699
  }
1700
- function ur(e) {
1700
+ function hr(e) {
1701
1701
  return e.allowDownload === !1 ? ["pdf"] : ["pdf", "csv"];
1702
1702
  }
1703
- function fr(e) {
1704
- return sr.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
1703
+ function gr(e) {
1704
+ return pr.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
1705
1705
  }
1706
- function to(e) {
1707
- const { config: r } = e, t = gt({
1706
+ function ao(e) {
1707
+ const { config: r } = e, t = It({
1708
1708
  spec: r.spec,
1709
1709
  presentation: r.presentation,
1710
1710
  defaults: r.defaultView,
1711
1711
  session: e.purpose === "manual" ? e.session : void 0
1712
1712
  });
1713
- return ke.parse({
1713
+ return me.parse({
1714
1714
  spec: t.spec,
1715
1715
  presentation: t.presentation,
1716
1716
  ...e.content === "flat" ? { mode: "flat", format: "csv" } : {
@@ -1724,37 +1724,37 @@ function to(e) {
1724
1724
  }
1725
1725
  });
1726
1726
  }
1727
- const pr = E.object({
1728
- connection_id: E.string().min(1),
1729
- cardType: E.literal("matrixTable"),
1730
- resultOwner: E.literal("config"),
1731
- sql: E.literal("").optional(),
1732
- python: E.literal("").optional(),
1733
- tableStructure: E.never().optional(),
1734
- cardDataSource: E.object({
1735
- connectionId: E.string().min(1),
1736
- connectionType: E.string().min(1),
1737
- mode: E.enum(["database", "semanticDomain"]),
1738
- selectedEntities: E.array(E.unknown()),
1739
- semanticDomainId: E.string().optional()
1727
+ const vr = C.object({
1728
+ connection_id: C.string().min(1),
1729
+ cardType: C.literal("matrixTable"),
1730
+ resultOwner: C.literal("config"),
1731
+ sql: C.literal("").optional(),
1732
+ python: C.literal("").optional(),
1733
+ tableStructure: C.never().optional(),
1734
+ cardDataSource: C.object({
1735
+ connectionId: C.string().min(1),
1736
+ connectionType: C.string().min(1),
1737
+ mode: C.enum(["database", "semanticDomain"]),
1738
+ selectedEntities: C.array(C.unknown()),
1739
+ semanticDomainId: C.string().optional()
1740
1740
  }).passthrough(),
1741
- active_filters: E.array(E.unknown()).default([])
1742
- }).passthrough(), ro = pr.extend({
1743
- dashboardId: E.string().min(1),
1744
- cardId: E.string().min(1),
1745
- formatOptions: E.object({
1746
- matrix: ke,
1747
- acquisition: E.literal("continuation").optional(),
1748
- presentationExecutionSnapshot: E.unknown()
1741
+ active_filters: C.array(C.unknown()).default([])
1742
+ }).passthrough(), io = vr.extend({
1743
+ dashboardId: C.string().min(1),
1744
+ cardId: C.string().min(1),
1745
+ formatOptions: C.object({
1746
+ matrix: me,
1747
+ acquisition: C.literal("continuation").optional(),
1748
+ presentationExecutionSnapshot: C.unknown()
1749
1749
  }).passthrough().superRefine((e, r) => {
1750
1750
  e.matrix.format === "csv" != (e.acquisition === "continuation") && r.addIssue({
1751
- code: E.ZodIssueCode.custom,
1751
+ code: C.ZodIssueCode.custom,
1752
1752
  path: ["acquisition"],
1753
1753
  message: "CSV requires continuation acquisition; PDF must not specify acquisition."
1754
1754
  });
1755
1755
  })
1756
1756
  });
1757
- function no(e) {
1757
+ function co(e) {
1758
1758
  return {
1759
1759
  ...e.controls,
1760
1760
  type: "card",
@@ -1779,18 +1779,45 @@ function no(e) {
1779
1779
  delimiter: e.delimiter,
1780
1780
  includeHeaders: e.includeHeaders,
1781
1781
  timezone: e.reportContext.calendar.tz,
1782
- presentationExecutionSnapshot: yt({
1782
+ presentationExecutionSnapshot: vt({
1783
1783
  reportContext: e.reportContext,
1784
1784
  resolvedFormats: []
1785
1785
  })
1786
1786
  }
1787
1787
  };
1788
1788
  }
1789
- function yr(e) {
1789
+ const re = C.number().int().nonnegative(), lo = C.discriminatedUnion("status", [
1790
+ C.object({
1791
+ status: C.literal("ok"),
1792
+ request: me,
1793
+ layout: dt,
1794
+ rows: C.array(mt).readonly(),
1795
+ usage: C.object({ rows: re, cells: re, bytes: re }).strict()
1796
+ }).strict(),
1797
+ C.object({
1798
+ status: C.literal("failed"),
1799
+ failure: C.object({
1800
+ code: C.enum([
1801
+ "invalid_request",
1802
+ "unsupported_capability",
1803
+ "stale_cursor",
1804
+ "forbidden",
1805
+ "budget_exceeded",
1806
+ "source_truncated",
1807
+ "execution_failed",
1808
+ "cancelled"
1809
+ ]),
1810
+ limit: C.enum(["rows", "bytes"]).optional(),
1811
+ message: C.string().min(1),
1812
+ retryable: C.boolean()
1813
+ }).strict()
1814
+ }).strict()
1815
+ ]);
1816
+ function br(e) {
1790
1817
  return !!e && typeof e == "object" && !Array.isArray(e);
1791
1818
  }
1792
1819
  function M(e, r, t) {
1793
- return yr(e) ? e : (t.push({ field: r, message: "Expected an object." }), {});
1820
+ return br(e) ? e : (t.push({ field: r, message: "Expected an object." }), {});
1794
1821
  }
1795
1822
  function B(e, r, t, n) {
1796
1823
  const o = new Set(t);
@@ -1822,7 +1849,7 @@ function K(e, r, t, n, o = {}) {
1822
1849
  }
1823
1850
  return a;
1824
1851
  }
1825
- function ye(e, r, t) {
1852
+ function ge(e, r, t) {
1826
1853
  const n = K(e, r, 2e3, t);
1827
1854
  if (n)
1828
1855
  try {
@@ -1832,7 +1859,7 @@ function ye(e, r, t) {
1832
1859
  return;
1833
1860
  }
1834
1861
  }
1835
- function Te(e, r, t) {
1862
+ function $e(e, r, t) {
1836
1863
  const n = M(e, r, t);
1837
1864
  B(n, r, ["tokens", "components"], t);
1838
1865
  const o = {};
@@ -1865,14 +1892,14 @@ function Te(e, r, t) {
1865
1892
  ];
1866
1893
  B(l, `${r}.tokens.color`, m, t);
1867
1894
  const c = {};
1868
- m.forEach((s) => {
1895
+ m.forEach((d) => {
1869
1896
  const u = K(
1870
- l[s],
1871
- `${r}.tokens.color.${s}`,
1897
+ l[d],
1898
+ `${r}.tokens.color.${d}`,
1872
1899
  120,
1873
1900
  t
1874
1901
  );
1875
- u !== void 0 && (c[s] = u);
1902
+ u !== void 0 && (c[d] = u);
1876
1903
  }), i.color = c;
1877
1904
  }
1878
1905
  if (a.typography !== void 0) {
@@ -1941,7 +1968,7 @@ function Te(e, r, t) {
1941
1968
  }
1942
1969
  return o;
1943
1970
  }
1944
- function hr(e, r) {
1971
+ function Ir(e, r) {
1945
1972
  const t = "presentation.appearance", n = M(e, t, r);
1946
1973
  B(n, t, ["version", "schemes"], r);
1947
1974
  const o = {};
@@ -1949,14 +1976,14 @@ function hr(e, r) {
1949
1976
  const a = M(n.schemes, `${t}.schemes`, r);
1950
1977
  B(a, `${t}.schemes`, ["light", "dark"], r), o.schemes = {
1951
1978
  ...a.light !== void 0 ? {
1952
- light: Te(
1979
+ light: $e(
1953
1980
  a.light,
1954
1981
  `${t}.schemes.light`,
1955
1982
  r
1956
1983
  )
1957
1984
  } : {},
1958
1985
  ...a.dark !== void 0 ? {
1959
- dark: Te(
1986
+ dark: $e(
1960
1987
  a.dark,
1961
1988
  `${t}.schemes.dark`,
1962
1989
  r
@@ -1966,7 +1993,7 @@ function hr(e, r) {
1966
1993
  }
1967
1994
  return o;
1968
1995
  }
1969
- function gr(e, r) {
1996
+ function wr(e, r) {
1970
1997
  const t = "presentation.brandOverrides", n = M(e, t, r);
1971
1998
  B(n, t, ["brandName", "logoUrl", "link"], r);
1972
1999
  const o = K(
@@ -1974,14 +2001,14 @@ function gr(e, r) {
1974
2001
  `${t}.brandName`,
1975
2002
  200,
1976
2003
  r
1977
- ), a = ye(n.logoUrl, `${t}.logoUrl`, r), i = K(n.link, `${t}.link`, 120, r);
2004
+ ), a = ge(n.logoUrl, `${t}.logoUrl`, r), i = K(n.link, `${t}.link`, 120, r);
1978
2005
  return {
1979
2006
  ...o !== void 0 ? { brandName: o } : {},
1980
2007
  ...a !== void 0 ? { logoUrl: a } : {},
1981
2008
  ...i !== void 0 ? { link: i } : {}
1982
2009
  };
1983
2010
  }
1984
- function vr(e, r) {
2011
+ function Cr(e, r) {
1985
2012
  const t = "presentation.fragments", n = M(e, t, r), o = [
1986
2013
  "preHeaderText",
1987
2014
  "headerBannerHtml",
@@ -1993,7 +2020,7 @@ function vr(e, r) {
1993
2020
  B(n, t, o, r);
1994
2021
  const a = {};
1995
2022
  return o.forEach((i) => {
1996
- const l = i === "unsubscribeUrl" ? ye(n[i], `${t}.${i}`, r) : K(
2023
+ const l = i === "unsubscribeUrl" ? ge(n[i], `${t}.${i}`, r) : K(
1997
2024
  n[i],
1998
2025
  `${t}.${i}`,
1999
2026
  i === "preHeaderText" ? 200 : 5e3,
@@ -2003,10 +2030,10 @@ function vr(e, r) {
2003
2030
  l !== void 0 && (a[i] = l);
2004
2031
  }), a;
2005
2032
  }
2006
- function br(e) {
2033
+ function Tr(e) {
2007
2034
  const r = [], t = {};
2008
- if (e.appearance !== void 0 && (t.appearance = hr(e.appearance, r)), e.brandOverrides !== void 0 && (t.brandOverrides = gr(e.brandOverrides, r)), e.fragments !== void 0 && (t.fragments = vr(e.fragments, r)), e.viewUrl !== void 0) {
2009
- const n = ye(e.viewUrl, "presentation.viewUrl", r);
2035
+ if (e.appearance !== void 0 && (t.appearance = Ir(e.appearance, r)), e.brandOverrides !== void 0 && (t.brandOverrides = wr(e.brandOverrides, r)), e.fragments !== void 0 && (t.fragments = Cr(e.fragments, r)), e.viewUrl !== void 0) {
2036
+ const n = ge(e.viewUrl, "presentation.viewUrl", r);
2010
2037
  n !== void 0 && (t.viewUrl = n);
2011
2038
  }
2012
2039
  return { value: t, issues: r };
@@ -2019,15 +2046,15 @@ const Ve = [
2019
2046
  "THU",
2020
2047
  "FRI",
2021
2048
  "SAT"
2022
- ], Ir = new Map(
2049
+ ], xr = new Map(
2023
2050
  Ve.map((e, r) => [e, r])
2024
- ), oo = {
2051
+ ), so = {
2025
2052
  cadence: "weekly",
2026
2053
  hour: 9,
2027
2054
  minute: 0,
2028
2055
  weekdays: [1]
2029
2056
  };
2030
- function ao(e) {
2057
+ function mo(e) {
2031
2058
  if (typeof e != "string" || e.length === 0 || e !== e.trim() || /^(?:(?:UTC|GMT)[+-]|[+-]\d{2}:\d{2}$)/.test(e))
2032
2059
  return !1;
2033
2060
  try {
@@ -2036,25 +2063,25 @@ function ao(e) {
2036
2063
  return !1;
2037
2064
  }
2038
2065
  }
2039
- function wr(e) {
2066
+ function $r(e) {
2040
2067
  return Number.isInteger(e.minute) && e.minute >= 0 && e.minute <= 59 && Number.isInteger(e.hour) && e.hour >= 0 && e.hour <= 23;
2041
2068
  }
2042
- function Le(e) {
2069
+ function qe(e) {
2043
2070
  if (e.length === 0) return null;
2044
2071
  const r = [...e].sort((t, n) => t - n);
2045
2072
  return r.some(
2046
2073
  (t, n) => !Number.isInteger(t) || t < 0 || t > 6 || n > 0 && t === r[n - 1]
2047
2074
  ) ? null : r;
2048
2075
  }
2049
- function io(e) {
2050
- if (!wr(e))
2076
+ function uo(e) {
2077
+ if (!$r(e))
2051
2078
  throw new Error("Choose a valid schedule time.");
2052
2079
  const r = `${e.minute} ${e.hour}`;
2053
2080
  switch (e.cadence) {
2054
2081
  case "daily":
2055
2082
  return `${r} * * *`;
2056
2083
  case "weekly": {
2057
- const t = Le(e.weekdays);
2084
+ const t = qe(e.weekdays);
2058
2085
  if (!t) throw new Error("Choose at least one weekday.");
2059
2086
  return `${r} * * ${t.map((n) => Ve[n]).join(",")}`;
2060
2087
  }
@@ -2064,7 +2091,7 @@ function io(e) {
2064
2091
  return `${r} 1 * *`;
2065
2092
  }
2066
2093
  }
2067
- function Cr(e) {
2094
+ function kr(e) {
2068
2095
  if (typeof e != "string" || e.length === 0)
2069
2096
  return { ok: !1, issue: "Choose a supported schedule." };
2070
2097
  if (e !== e.trim() || e.includes(" "))
@@ -2084,13 +2111,13 @@ function Cr(e) {
2084
2111
  value: { cadence: "daily", hour: m, minute: l, weekdays: [] }
2085
2112
  };
2086
2113
  if (o === "*" && i !== "*") {
2087
- const s = i.split(",").map((d) => Ir.get(d));
2088
- if (s.some((d) => d === void 0))
2114
+ const d = i.split(",").map((s) => xr.get(s));
2115
+ if (d.some((s) => s === void 0))
2089
2116
  return { ok: !1, issue: "Choose a supported schedule." };
2090
- const u = s, f = Le(u);
2091
- return !f || f.some((d, v) => d !== u[v]) ? { ok: !1, issue: "Choose a supported schedule." } : {
2117
+ const u = d, p = qe(u);
2118
+ return !p || p.some((s, v) => s !== u[v]) ? { ok: !1, issue: "Choose a supported schedule." } : {
2092
2119
  ok: !0,
2093
- value: { cadence: "weekly", hour: m, minute: l, weekdays: f }
2120
+ value: { cadence: "weekly", hour: m, minute: l, weekdays: p }
2094
2121
  };
2095
2122
  }
2096
2123
  return o === "1,15" && i === "*" ? {
@@ -2101,14 +2128,14 @@ function Cr(e) {
2101
2128
  value: { cadence: "monthly", hour: m, minute: l, weekdays: [] }
2102
2129
  } : { ok: !1, issue: "Choose a supported schedule." };
2103
2130
  }
2104
- function Tr(e, r, t) {
2131
+ function Er(e, r, t) {
2105
2132
  return new Intl.DateTimeFormat(t, {
2106
2133
  hour: "numeric",
2107
2134
  minute: "2-digit",
2108
2135
  timeZone: "UTC"
2109
2136
  }).format(new Date(Date.UTC(2020, 0, 1, e, r)));
2110
2137
  }
2111
- function xr(e, r) {
2138
+ function Sr(e, r) {
2112
2139
  var t;
2113
2140
  if (e === "UTC") return "UTC";
2114
2141
  try {
@@ -2120,11 +2147,11 @@ function xr(e, r) {
2120
2147
  return null;
2121
2148
  }
2122
2149
  }
2123
- function co(e, r, t = "en-US") {
2124
- const n = Cr(e);
2150
+ function fo(e, r, t = "en-US") {
2151
+ const n = kr(e);
2125
2152
  if (!n.ok) return null;
2126
2153
  try {
2127
- const o = Tr(n.value.hour, n.value.minute, t), a = xr(r, t);
2154
+ const o = Er(n.value.hour, n.value.minute, t), a = Sr(r, t);
2128
2155
  if (!a) return null;
2129
2156
  switch (n.value.cadence) {
2130
2157
  case "daily":
@@ -2147,31 +2174,31 @@ function co(e, r, t = "en-US") {
2147
2174
  return null;
2148
2175
  }
2149
2176
  }
2150
- function lo(e) {
2177
+ function po(e) {
2151
2178
  return e != null && e.role ? e.type === "tenant" ? e.role === "POWER_USER" : ["AUTHOR", "ADMIN", "SUPER_ADMIN"].includes(e.role) : !1;
2152
2179
  }
2153
- function so(e) {
2180
+ function yo(e) {
2154
2181
  return e.canCreate ? [
2155
2182
  ...e.scheduledReportAvailable ? ["scheduled_report"] : [],
2156
2183
  ...e.analyticalBriefingsEnabled ? ["analytical_briefing"] : []
2157
2184
  ] : [];
2158
2185
  }
2159
- function $r(e) {
2186
+ function _r(e) {
2160
2187
  const r = (e == null ? void 0 : e.channels) ?? [];
2161
2188
  return r.length === 1 && r[0] === "EMAIL";
2162
2189
  }
2163
- function kr(e) {
2164
- return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && $r(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
2190
+ function Fr(e) {
2191
+ return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && _r(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
2165
2192
  }
2166
- function mo(e) {
2167
- const r = kr(e), t = r === "Scheduled report" || r === "On-demand report" ? "report" : "briefing";
2193
+ function ho(e) {
2194
+ const r = Fr(e), t = r === "Scheduled report" || r === "On-demand report" ? "report" : "briefing";
2168
2195
  return {
2169
2196
  typeLabel: r,
2170
2197
  noun: t,
2171
2198
  pluralNoun: t === "report" ? "reports" : "briefings"
2172
2199
  };
2173
2200
  }
2174
- const le = "BRIEFING", Er = ["markdown", "html"], de = ["markdown"], re = 20, y = {
2201
+ const se = "BRIEFING", Rr = ["markdown", "html"], de = ["markdown"], ne = 20, y = {
2175
2202
  name: 500,
2176
2203
  description: 2e3,
2177
2204
  instruction: 5e4,
@@ -2200,7 +2227,7 @@ const le = "BRIEFING", Er = ["markdown", "html"], de = ["markdown"], re = 20, y
2200
2227
  // tiny tiles in narrow client panels; 2-up was the chosen layout).
2201
2228
  maxKpiTiles: 8
2202
2229
  };
2203
- function Sr(e) {
2230
+ function Ar(e) {
2204
2231
  if (e === null || typeof e != "object" || Array.isArray(e))
2205
2232
  return !1;
2206
2233
  const r = e;
@@ -2210,60 +2237,60 @@ function Sr(e) {
2210
2237
  if (t === null || typeof t != "object" || Array.isArray(t))
2211
2238
  return !1;
2212
2239
  const n = t;
2213
- return (n.kind === "metric" && typeof n.metricId == "string" && !!n.metricId.trim() || n.kind === "column" && typeof n.columnKey == "string" && !!n.columnKey.trim() || n.kind === "matrix_measure" && typeof n.measureId == "string" && !!n.measureId.trim()) && xe(r.format).ok;
2240
+ return (n.kind === "metric" && typeof n.metricId == "string" && !!n.metricId.trim() || n.kind === "column" && typeof n.columnKey == "string" && !!n.columnKey.trim() || n.kind === "matrix_measure" && typeof n.measureId == "string" && !!n.measureId.trim()) && ke(r.format).ok;
2214
2241
  }
2215
- function _r(e) {
2216
- return e == null ? "" : Sr(e) ? it(e.value, e.format) : String(e);
2242
+ function Pr(e) {
2243
+ return e == null ? "" : Ar(e) ? ct(e.value, e.format) : String(e);
2217
2244
  }
2218
- function uo(e) {
2245
+ function go(e) {
2219
2246
  return [e.delta, e.percentChange].filter(
2220
2247
  (r) => r != null
2221
- ).map(_r).filter(Boolean).join(" / ");
2248
+ ).map(Pr).filter(Boolean).join(" / ");
2222
2249
  }
2223
- const qe = new Set(Er), Fr = /* @__PURE__ */ new Set([
2250
+ const je = new Set(Rr), Mr = /* @__PURE__ */ new Set([
2224
2251
  "EMAIL",
2225
2252
  "WEBHOOK",
2226
2253
  "SLACK",
2227
2254
  "IN_APP",
2228
2255
  "TELEGRAM"
2229
- ]), ne = {
2256
+ ]), oe = {
2230
2257
  maxToolCalls: { min: 1, max: 100 },
2231
2258
  maxPlanningIterations: { min: 1, max: 10 },
2232
2259
  maxRows: { min: 1, max: 1e5 },
2233
2260
  timeoutMs: { min: 1e3, max: 30 * 6e4 }
2234
- }, Rr = /* @__PURE__ */ new Set([
2261
+ }, Br = /* @__PURE__ */ new Set([
2235
2262
  "letter",
2236
2263
  "legal",
2237
2264
  "a4",
2238
2265
  "a3",
2239
2266
  "tabloid"
2240
- ]), Ar = /* @__PURE__ */ new Set([
2267
+ ]), Dr = /* @__PURE__ */ new Set([
2241
2268
  "portrait",
2242
2269
  "landscape"
2243
- ]), Pr = /* @__PURE__ */ new Set([",", ";", " "]), Mr = /* @__PURE__ */ new Set([
2270
+ ]), Or = /* @__PURE__ */ new Set([",", ";", " "]), Kr = /* @__PURE__ */ new Set([
2244
2271
  "current",
2245
2272
  "all"
2246
- ]), Br = /* @__PURE__ */ new Set([
2273
+ ]), Nr = /* @__PURE__ */ new Set([
2247
2274
  "concise",
2248
2275
  "balanced",
2249
2276
  "detailed"
2250
- ]), Dr = /* @__PURE__ */ new Set([
2277
+ ]), zr = /* @__PURE__ */ new Set([
2251
2278
  "info",
2252
2279
  "positive",
2253
2280
  "warning",
2254
2281
  "critical"
2255
- ]), Or = /* @__PURE__ */ new Set([
2282
+ ]), Lr = /* @__PURE__ */ new Set([
2256
2283
  "text",
2257
2284
  "number",
2258
2285
  "currency",
2259
2286
  "percent",
2260
2287
  "date",
2261
2288
  "boolean"
2262
- ]), Kr = /* @__PURE__ */ new Set([
2289
+ ]), Vr = /* @__PURE__ */ new Set([
2263
2290
  "left",
2264
2291
  "center",
2265
2292
  "right"
2266
- ]), Nr = [
2293
+ ]), qr = [
2267
2294
  "matrix",
2268
2295
  "pageSize",
2269
2296
  "orientation",
@@ -2297,52 +2324,52 @@ class ee extends Error {
2297
2324
  this.name = "BriefingContractError", this.issues = t;
2298
2325
  }
2299
2326
  }
2300
- function je(e) {
2327
+ function Ue(e) {
2301
2328
  return typeof e == "object" && e !== null && !Array.isArray(e);
2302
2329
  }
2303
- function p(e, r, t) {
2330
+ function f(e, r, t) {
2304
2331
  e.push({ field: r, message: t });
2305
2332
  }
2306
- function $(e, r, t) {
2307
- return je(e) ? e : (p(t, r, "Expected an object."), {});
2333
+ function k(e, r, t) {
2334
+ return Ue(e) ? e : (f(t, r, "Expected an object."), {});
2308
2335
  }
2309
2336
  function I(e, r, t, n) {
2310
2337
  const o = new Set(t);
2311
2338
  Object.keys(e).forEach((a) => {
2312
- o.has(a) || p(
2339
+ o.has(a) || f(
2313
2340
  n,
2314
2341
  r ? `${r}.${a}` : a,
2315
2342
  `Unexpected field "${a}".`
2316
2343
  );
2317
2344
  });
2318
2345
  }
2319
- function T(e, r, t, n) {
2346
+ function x(e, r, t, n) {
2320
2347
  if (typeof e != "string")
2321
- return p(n, r, "Expected a string."), "";
2348
+ return f(n, r, "Expected a string."), "";
2322
2349
  const o = e.trim();
2323
- return o ? (o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o) : (p(n, r, "Required value cannot be empty."), "");
2350
+ return o ? (o.length > t && f(n, r, `Must be ${t} characters or fewer.`), o) : (f(n, r, "Required value cannot be empty."), "");
2324
2351
  }
2325
- function x(e, r, t, n) {
2352
+ function $(e, r, t, n) {
2326
2353
  if (e == null)
2327
2354
  return;
2328
2355
  if (typeof e != "string") {
2329
- p(n, r, "Expected a string.");
2356
+ f(n, r, "Expected a string.");
2330
2357
  return;
2331
2358
  }
2332
2359
  const o = e.trim();
2333
2360
  if (o)
2334
- return o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o;
2361
+ return o.length > t && f(n, r, `Must be ${t} characters or fewer.`), o;
2335
2362
  }
2336
- function zr(e, r, t, n) {
2363
+ function jr(e, r, t, n) {
2337
2364
  if (typeof e != "string")
2338
- return p(n, r, "Expected a string."), "";
2365
+ return f(n, r, "Expected a string."), "";
2339
2366
  const o = e.trim();
2340
- return o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o;
2367
+ return o.length > t && f(n, r, `Must be ${t} characters or fewer.`), o;
2341
2368
  }
2342
- function Vr(e, r, t) {
2369
+ function Ur(e, r, t) {
2343
2370
  if (e != null) {
2344
2371
  if (!Number.isInteger(e) || Number(e) < 0) {
2345
- p(t, r, "Expected a non-negative integer.");
2372
+ f(t, r, "Expected a non-negative integer.");
2346
2373
  return;
2347
2374
  }
2348
2375
  return Number(e);
@@ -2350,48 +2377,48 @@ function Vr(e, r, t) {
2350
2377
  }
2351
2378
  function A(e, r, t, n = {}) {
2352
2379
  if (e == null)
2353
- return n.required ? (p(t, r, "Expected at least one evidence id."), []) : void 0;
2380
+ return n.required ? (f(t, r, "Expected at least one evidence id."), []) : void 0;
2354
2381
  if (!Array.isArray(e))
2355
- return p(t, r, "Expected an array."), n.required ? [] : void 0;
2382
+ return f(t, r, "Expected an array."), n.required ? [] : void 0;
2356
2383
  const o = [];
2357
2384
  return e.forEach((a, i) => {
2358
- const l = T(
2385
+ const l = x(
2359
2386
  a,
2360
2387
  `${r}.${i}`,
2361
2388
  y.id,
2362
2389
  t
2363
2390
  );
2364
2391
  l && !o.includes(l) && o.push(l);
2365
- }), n.required && o.length === 0 && p(t, r, "Expected at least one evidence id."), o.length > 0 || n.required ? o : void 0;
2392
+ }), n.required && o.length === 0 && f(t, r, "Expected at least one evidence id."), o.length > 0 || n.required ? o : void 0;
2366
2393
  }
2367
2394
  function z(e, r, t, n) {
2368
- return e == null ? r : typeof e != "boolean" ? (p(n, t, "Expected a boolean."), r) : e;
2395
+ return e == null ? r : typeof e != "boolean" ? (f(n, t, "Expected a boolean."), r) : e;
2369
2396
  }
2370
- function Lr(e, r) {
2371
- return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (p(r, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
2397
+ function Gr(e, r) {
2398
+ return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (f(r, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
2372
2399
  }
2373
- function qr(e) {
2400
+ function Hr(e) {
2374
2401
  return e.includes("@") && e.includes(".") && !e.includes(" ");
2375
2402
  }
2376
- function Ue(e, r) {
2403
+ function Ge(e, r) {
2377
2404
  if (e == null)
2378
2405
  return { type: "project" };
2379
- const t = $(e, "source", r), n = t.type;
2406
+ const t = k(e, "source", r), n = t.type;
2380
2407
  return n === "project" ? (I(t, "source", ["type"], r), { type: "project" }) : n === "dashboard" ? (I(t, "source", ["type", "dashboardId"], r), {
2381
2408
  type: "dashboard",
2382
- dashboardId: T(
2409
+ dashboardId: x(
2383
2410
  t.dashboardId,
2384
2411
  "source.dashboardId",
2385
2412
  y.id,
2386
2413
  r
2387
2414
  )
2388
- }) : (p(r, "source.type", "Expected project or dashboard."), { type: "project" });
2415
+ }) : (f(r, "source.type", "Expected project or dashboard."), { type: "project" });
2389
2416
  }
2390
- function Ge(e, r) {
2391
- const t = $(e, "body", r), n = t.type;
2417
+ function He(e, r) {
2418
+ const t = k(e, "body", r), n = t.type;
2392
2419
  return n === "generated_analysis" ? (I(t, "body", ["type", "instruction"], r), {
2393
2420
  type: "generated_analysis",
2394
- instruction: T(
2421
+ instruction: x(
2395
2422
  t.instruction,
2396
2423
  "body.instruction",
2397
2424
  y.instruction,
@@ -2399,33 +2426,33 @@ function Ge(e, r) {
2399
2426
  )
2400
2427
  }) : n === "custom_message" ? (I(t, "body", ["type", "message"], r), {
2401
2428
  type: "custom_message",
2402
- message: zr(
2429
+ message: jr(
2403
2430
  t.message,
2404
2431
  "body.message",
2405
2432
  y.customMessage,
2406
2433
  r
2407
2434
  )
2408
- }) : n === "none" ? (I(t, "body", ["type"], r), { type: "none" }) : (p(
2435
+ }) : n === "none" ? (I(t, "body", ["type"], r), { type: "none" }) : (f(
2409
2436
  r,
2410
2437
  "body.type",
2411
2438
  "Expected generated_analysis, custom_message, or none."
2412
2439
  ), { type: "none" });
2413
2440
  }
2414
- function jr(e, r) {
2441
+ function Wr(e, r) {
2415
2442
  if (e == null)
2416
2443
  return [...de];
2417
2444
  if (!Array.isArray(e))
2418
- return p(r, "presentation.artifactFormats", "Expected an array."), [...de];
2445
+ return f(r, "presentation.artifactFormats", "Expected an array."), [...de];
2419
2446
  if (e.length === 0)
2420
- return p(
2447
+ return f(
2421
2448
  r,
2422
2449
  "presentation.artifactFormats",
2423
2450
  "Choose at least one artifact format."
2424
2451
  ), [];
2425
2452
  const t = [];
2426
2453
  return e.forEach((n, o) => {
2427
- if (typeof n != "string" || !qe.has(n)) {
2428
- p(
2454
+ if (typeof n != "string" || !je.has(n)) {
2455
+ f(
2429
2456
  r,
2430
2457
  `presentation.artifactFormats.${o}`,
2431
2458
  "Expected markdown or html."
@@ -2435,14 +2462,14 @@ function jr(e, r) {
2435
2462
  t.includes(n) || t.push(n);
2436
2463
  }), t;
2437
2464
  }
2438
- function He(e, r) {
2465
+ function We(e, r) {
2439
2466
  if (e == null)
2440
2467
  return {
2441
2468
  artifactFormats: [...de],
2442
2469
  includeEvidence: !0,
2443
2470
  includeSql: !0
2444
2471
  };
2445
- const t = $(e, "presentation", r);
2472
+ const t = k(e, "presentation", r);
2446
2473
  I(
2447
2474
  t,
2448
2475
  "presentation",
@@ -2461,7 +2488,7 @@ function He(e, r) {
2461
2488
  r
2462
2489
  );
2463
2490
  const n = {
2464
- artifactFormats: jr(t.artifactFormats, r),
2491
+ artifactFormats: Wr(t.artifactFormats, r),
2465
2492
  includeEvidence: z(
2466
2493
  t.includeEvidence,
2467
2494
  !0,
@@ -2474,46 +2501,46 @@ function He(e, r) {
2474
2501
  "presentation.includeSql",
2475
2502
  r
2476
2503
  )
2477
- }, o = x(
2504
+ }, o = $(
2478
2505
  t.audience,
2479
2506
  "presentation.audience",
2480
2507
  y.presentationAudience,
2481
2508
  r
2482
- ), a = x(
2509
+ ), a = $(
2483
2510
  t.tone,
2484
2511
  "presentation.tone",
2485
2512
  y.presentationTone,
2486
2513
  r
2487
- ), i = x(
2514
+ ), i = $(
2488
2515
  t.format,
2489
2516
  "presentation.format",
2490
2517
  y.presentationFormat,
2491
2518
  r
2492
2519
  );
2493
2520
  o && (n.audience = o), a && (n.tone = a), i && (n.format = i);
2494
- const l = br(t);
2495
- return l.issues.forEach((m) => p(r, m.field, m.message)), Object.assign(n, l.value), n;
2521
+ const l = Tr(t);
2522
+ return l.issues.forEach((m) => f(r, m.field, m.message)), Object.assign(n, l.value), n;
2496
2523
  }
2497
- function Ur(e, r, t) {
2498
- return Array.isArray(e) ? (e.length === 0 && p(t, r, "Expected at least one item."), e.length > R.maxListItems && p(
2524
+ function Yr(e, r, t) {
2525
+ return Array.isArray(e) ? (e.length === 0 && f(t, r, "Expected at least one item."), e.length > R.maxListItems && f(
2499
2526
  t,
2500
2527
  r,
2501
2528
  `Must have ${R.maxListItems} items or fewer.`
2502
2529
  ), e.slice(0, R.maxListItems).map(
2503
- (n, o) => T(
2530
+ (n, o) => x(
2504
2531
  n,
2505
2532
  `${r}.${o}`,
2506
2533
  y.contentItem,
2507
2534
  t
2508
2535
  )
2509
- ).filter(Boolean)) : (p(t, r, "Expected an array."), []);
2536
+ ).filter(Boolean)) : (f(t, r, "Expected an array."), []);
2510
2537
  }
2511
- function Gr(e, r, t) {
2512
- const n = $(e, r, t);
2538
+ function Zr(e, r, t) {
2539
+ const n = k(e, r, t);
2513
2540
  if (n.kind === "metric")
2514
2541
  return I(n, r, ["kind", "metricId"], t), {
2515
2542
  kind: "metric",
2516
- metricId: T(
2543
+ metricId: x(
2517
2544
  n.metricId,
2518
2545
  `${r}.metricId`,
2519
2546
  y.id,
@@ -2523,7 +2550,7 @@ function Gr(e, r, t) {
2523
2550
  if (n.kind === "column")
2524
2551
  return I(n, r, ["kind", "columnKey"], t), {
2525
2552
  kind: "column",
2526
- columnKey: T(
2553
+ columnKey: x(
2527
2554
  n.columnKey,
2528
2555
  `${r}.columnKey`,
2529
2556
  y.id,
@@ -2533,33 +2560,33 @@ function Gr(e, r, t) {
2533
2560
  if (n.kind === "matrix_measure")
2534
2561
  return I(n, r, ["kind", "measureId"], t), {
2535
2562
  kind: "matrix_measure",
2536
- measureId: T(
2563
+ measureId: x(
2537
2564
  n.measureId,
2538
2565
  `${r}.measureId`,
2539
2566
  y.id,
2540
2567
  t
2541
2568
  )
2542
2569
  };
2543
- p(
2570
+ f(
2544
2571
  t,
2545
2572
  `${r}.kind`,
2546
2573
  "Expected metric, column, or matrix_measure."
2547
2574
  );
2548
2575
  }
2549
- function We(e, r, t) {
2576
+ function Ye(e, r, t) {
2550
2577
  if (e === null || typeof e != "object" || Array.isArray(e))
2551
2578
  return;
2552
- const n = $(e, r, t);
2579
+ const n = k(e, r, t);
2553
2580
  if (!Object.prototype.hasOwnProperty.call(n, "target") && !Object.prototype.hasOwnProperty.call(n, "format"))
2554
2581
  return;
2555
- I(n, r, ["value", "target", "format"], t), (typeof n.value != "number" || !Number.isFinite(n.value)) && p(t, `${r}.value`, "Expected a finite number.");
2556
- const o = Gr(
2582
+ I(n, r, ["value", "target", "format"], t), (typeof n.value != "number" || !Number.isFinite(n.value)) && f(t, `${r}.value`, "Expected a finite number.");
2583
+ const o = Zr(
2557
2584
  n.target,
2558
2585
  `${r}.target`,
2559
2586
  t
2560
- ), a = xe(n.format);
2587
+ ), a = ke(n.format);
2561
2588
  if (a.ok || a.issues.forEach(
2562
- (i) => p(
2589
+ (i) => f(
2563
2590
  t,
2564
2591
  i.path === "$" ? `${r}.format` : `${r}.format.${i.path}`,
2565
2592
  i.message
@@ -2572,109 +2599,109 @@ function O(e, r, t) {
2572
2599
  return e;
2573
2600
  if (typeof e == "number") {
2574
2601
  if (!Number.isFinite(e)) {
2575
- p(t, r, "Expected a finite number.");
2602
+ f(t, r, "Expected a finite number.");
2576
2603
  return;
2577
2604
  }
2578
2605
  return e;
2579
2606
  }
2580
- const n = We(e, r, t);
2607
+ const n = Ye(e, r, t);
2581
2608
  if (n) return n;
2582
- p(
2609
+ f(
2583
2610
  t,
2584
2611
  r,
2585
2612
  "Expected a string, number, or structured numeric value."
2586
2613
  );
2587
2614
  }
2588
- function Hr(e, r, t) {
2615
+ function Qr(e, r, t) {
2589
2616
  if (e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean")
2590
- return typeof e == "string" && e.length > y.contentCell ? (p(
2617
+ return typeof e == "string" && e.length > y.contentCell ? (f(
2591
2618
  t,
2592
2619
  r,
2593
2620
  `Must be ${y.contentCell} characters or fewer.`
2594
- ), e.slice(0, y.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (p(t, r, "Expected a finite number."), null) : e;
2595
- const n = We(e, r, t);
2596
- return n || (p(
2621
+ ), e.slice(0, y.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (f(t, r, "Expected a finite number."), null) : e;
2622
+ const n = Ye(e, r, t);
2623
+ return n || (f(
2597
2624
  t,
2598
2625
  r,
2599
2626
  "Expected a string, number, boolean, structured numeric value, or null."
2600
2627
  ), null);
2601
2628
  }
2602
- function Wr(e, r, t) {
2629
+ function Jr(e, r, t) {
2603
2630
  if (!Array.isArray(e))
2604
- return p(t, r, "Expected an array."), [];
2605
- e.length === 0 && p(t, r, "Expected at least one column."), e.length > R.maxTableColumns && p(
2631
+ return f(t, r, "Expected an array."), [];
2632
+ e.length === 0 && f(t, r, "Expected at least one column."), e.length > R.maxTableColumns && f(
2606
2633
  t,
2607
2634
  r,
2608
2635
  `Must have ${R.maxTableColumns} columns or fewer.`
2609
2636
  );
2610
2637
  const n = /* @__PURE__ */ new Set();
2611
2638
  return e.slice(0, R.maxTableColumns).map((o, a) => {
2612
- const i = `${r}.${a}`, l = $(o, i, t);
2639
+ const i = `${r}.${a}`, l = k(o, i, t);
2613
2640
  I(l, i, ["key", "label", "kind", "align"], t);
2614
- const m = T(
2641
+ const m = x(
2615
2642
  l.key,
2616
2643
  `${i}.key`,
2617
2644
  y.id,
2618
2645
  t
2619
2646
  );
2620
- m && (n.has(m) && p(t, `${i}.key`, "Column key must be unique."), n.add(m));
2621
- const c = T(
2647
+ m && (n.has(m) && f(t, `${i}.key`, "Column key must be unique."), n.add(m));
2648
+ const c = x(
2622
2649
  l.label,
2623
2650
  `${i}.label`,
2624
2651
  y.contentTitle,
2625
2652
  t
2626
- ), s = D(
2653
+ ), d = D(
2627
2654
  l.kind,
2628
2655
  `${i}.kind`,
2629
- Or,
2656
+ Lr,
2630
2657
  "text, number, currency, percent, date, or boolean",
2631
2658
  t
2632
2659
  ), u = D(
2633
2660
  l.align,
2634
2661
  `${i}.align`,
2635
- Kr,
2662
+ Vr,
2636
2663
  "left, center, or right",
2637
2664
  t
2638
2665
  );
2639
2666
  return {
2640
2667
  key: m,
2641
2668
  label: c,
2642
- ...s ? { kind: s } : {},
2669
+ ...d ? { kind: d } : {},
2643
2670
  ...u ? { align: u } : {}
2644
2671
  };
2645
2672
  });
2646
2673
  }
2647
- function Yr(e, r, t, n) {
2674
+ function Xr(e, r, t, n) {
2648
2675
  if (!Array.isArray(e))
2649
- return p(n, r, "Expected an array."), [];
2650
- e.length > R.maxTableRows && p(
2676
+ return f(n, r, "Expected an array."), [];
2677
+ e.length > R.maxTableRows && f(
2651
2678
  n,
2652
2679
  r,
2653
2680
  `Must have ${R.maxTableRows} rows or fewer.`
2654
2681
  );
2655
2682
  const o = new Set(t.map((a) => a.key).filter(Boolean));
2656
2683
  return e.slice(0, R.maxTableRows).map((a, i) => {
2657
- const l = `${r}.${i}`, m = $(a, l, n);
2684
+ const l = `${r}.${i}`, m = k(a, l, n);
2658
2685
  return Object.keys(m).forEach((c) => {
2659
- o.has(c) || p(n, `${l}.${c}`, `Unexpected table cell "${c}".`);
2686
+ o.has(c) || f(n, `${l}.${c}`, `Unexpected table cell "${c}".`);
2660
2687
  }), Object.fromEntries(
2661
2688
  t.map((c) => [
2662
2689
  c.key,
2663
- Hr(m[c.key] ?? null, `${l}.${c.key}`, n)
2690
+ Qr(m[c.key] ?? null, `${l}.${c.key}`, n)
2664
2691
  ])
2665
2692
  );
2666
2693
  });
2667
2694
  }
2668
- function Zr(e, r, t) {
2669
- const n = `content.blocks.${r}`, o = $(e, n, t), a = o.type;
2695
+ function en(e, r, t) {
2696
+ const n = `content.blocks.${r}`, o = k(e, n, t), a = o.type;
2670
2697
  if (a === "heading") {
2671
2698
  I(o, n, ["type", "text", "level", "evidenceIds"], t);
2672
2699
  const i = o.level === void 0 || o.level === null ? void 0 : o.level === 2 || o.level === 3 ? o.level : void 0;
2673
- o.level !== void 0 && o.level !== null && i === void 0 && p(t, `${n}.level`, "Expected 2 or 3.");
2700
+ o.level !== void 0 && o.level !== null && i === void 0 && f(t, `${n}.level`, "Expected 2 or 3.");
2674
2701
  const l = A(o.evidenceIds, `${n}.evidenceIds`, t);
2675
2702
  return {
2676
2703
  type: "heading",
2677
- text: T(
2704
+ text: x(
2678
2705
  o.text,
2679
2706
  `${n}.text`,
2680
2707
  y.contentTitle,
@@ -2689,7 +2716,7 @@ function Zr(e, r, t) {
2689
2716
  const i = A(o.evidenceIds, `${n}.evidenceIds`, t);
2690
2717
  return {
2691
2718
  type: "paragraph",
2692
- text: T(
2719
+ text: x(
2693
2720
  o.text,
2694
2721
  `${n}.text`,
2695
2722
  y.contentText,
@@ -2700,7 +2727,7 @@ function Zr(e, r, t) {
2700
2727
  }
2701
2728
  if (a === "finding") {
2702
2729
  I(o, n, ["type", "title", "text", "severity", "evidenceIds"], t);
2703
- const i = x(
2730
+ const i = $(
2704
2731
  o.title,
2705
2732
  `${n}.title`,
2706
2733
  y.contentTitle,
@@ -2708,14 +2735,14 @@ function Zr(e, r, t) {
2708
2735
  ), l = D(
2709
2736
  o.severity,
2710
2737
  `${n}.severity`,
2711
- Dr,
2738
+ zr,
2712
2739
  "info, positive, warning, or critical",
2713
2740
  t
2714
2741
  );
2715
2742
  return {
2716
2743
  type: "finding",
2717
2744
  ...i ? { title: i } : {},
2718
- text: T(
2745
+ text: x(
2719
2746
  o.text,
2720
2747
  `${n}.text`,
2721
2748
  y.contentText,
@@ -2729,7 +2756,7 @@ function Zr(e, r, t) {
2729
2756
  }
2730
2757
  if (a === "bullets" || a === "actions" || a === "limitations") {
2731
2758
  I(o, n, ["type", "title", "items", "evidenceIds"], t);
2732
- const i = x(
2759
+ const i = $(
2733
2760
  o.title,
2734
2761
  `${n}.title`,
2735
2762
  y.contentTitle,
@@ -2738,7 +2765,7 @@ function Zr(e, r, t) {
2738
2765
  return {
2739
2766
  type: a,
2740
2767
  ...i ? { title: i } : {},
2741
- items: Ur(o.items, `${n}.items`, t),
2768
+ items: Yr(o.items, `${n}.items`, t),
2742
2769
  ...l ? { evidenceIds: l } : {}
2743
2770
  };
2744
2771
  }
@@ -2759,7 +2786,7 @@ function Zr(e, r, t) {
2759
2786
  t
2760
2787
  );
2761
2788
  const i = O(o.value, `${n}.value`, t) ?? "";
2762
- i === "" && p(
2789
+ i === "" && f(
2763
2790
  t,
2764
2791
  `${n}.value`,
2765
2792
  "Expected a non-empty string, number, or structured numeric value."
@@ -2776,7 +2803,7 @@ function Zr(e, r, t) {
2776
2803
  o.percentChange,
2777
2804
  `${n}.percentChange`,
2778
2805
  t
2779
- ), s = x(
2806
+ ), d = $(
2780
2807
  o.unit,
2781
2808
  `${n}.unit`,
2782
2809
  y.contentTitle,
@@ -2784,7 +2811,7 @@ function Zr(e, r, t) {
2784
2811
  ), u = A(o.evidenceIds, `${n}.evidenceIds`, t);
2785
2812
  return {
2786
2813
  type: "metric",
2787
- label: T(
2814
+ label: x(
2788
2815
  o.label,
2789
2816
  `${n}.label`,
2790
2817
  y.contentTitle,
@@ -2794,28 +2821,28 @@ function Zr(e, r, t) {
2794
2821
  ...l !== void 0 ? { previousValue: l } : {},
2795
2822
  ...m !== void 0 ? { delta: m } : {},
2796
2823
  ...c !== void 0 ? { percentChange: c } : {},
2797
- ...s ? { unit: s } : {},
2824
+ ...d ? { unit: d } : {},
2798
2825
  ...u ? { evidenceIds: u } : {}
2799
2826
  };
2800
2827
  }
2801
2828
  if (a === "kpi_grid") {
2802
2829
  I(o, n, ["type", "title", "tiles", "evidenceIds"], t);
2803
- const i = x(
2830
+ const i = $(
2804
2831
  o.title,
2805
2832
  `${n}.title`,
2806
2833
  y.contentTitle,
2807
2834
  t
2808
2835
  ), l = Array.isArray(o.tiles) ? o.tiles : [];
2809
- Array.isArray(o.tiles) || p(t, `${n}.tiles`, "Expected an array."), l.length === 0 && p(t, `${n}.tiles`, "Expected at least one tile."), l.length > R.maxKpiTiles && p(
2836
+ Array.isArray(o.tiles) || f(t, `${n}.tiles`, "Expected an array."), l.length === 0 && f(t, `${n}.tiles`, "Expected at least one tile."), l.length > R.maxKpiTiles && f(
2810
2837
  t,
2811
2838
  `${n}.tiles`,
2812
2839
  `Must have ${R.maxKpiTiles} tiles or fewer.`
2813
2840
  );
2814
- const m = l.slice(0, R.maxKpiTiles).map((s, u) => {
2815
- const f = `${n}.tiles.${u}`, d = $(s, f, t);
2841
+ const m = l.slice(0, R.maxKpiTiles).map((d, u) => {
2842
+ const p = `${n}.tiles.${u}`, s = k(d, p, t);
2816
2843
  I(
2817
- d,
2818
- f,
2844
+ s,
2845
+ p,
2819
2846
  [
2820
2847
  "label",
2821
2848
  "value",
@@ -2828,41 +2855,41 @@ function Zr(e, r, t) {
2828
2855
  t
2829
2856
  );
2830
2857
  const v = O(
2831
- d.value,
2832
- `${f}.value`,
2858
+ s.value,
2859
+ `${p}.value`,
2833
2860
  t
2834
2861
  ) ?? "";
2835
- v === "" && p(
2862
+ v === "" && f(
2836
2863
  t,
2837
- `${f}.value`,
2864
+ `${p}.value`,
2838
2865
  "Expected a non-empty string, number, or structured numeric value."
2839
2866
  );
2840
- const h = d.previousValue === void 0 || d.previousValue === null ? d.previousValue : O(
2841
- d.previousValue,
2842
- `${f}.previousValue`,
2867
+ const h = s.previousValue === void 0 || s.previousValue === null ? s.previousValue : O(
2868
+ s.previousValue,
2869
+ `${p}.previousValue`,
2843
2870
  t
2844
- ), b = d.delta === void 0 || d.delta === null ? d.delta : O(
2845
- d.delta,
2846
- `${f}.delta`,
2871
+ ), b = s.delta === void 0 || s.delta === null ? s.delta : O(
2872
+ s.delta,
2873
+ `${p}.delta`,
2847
2874
  t
2848
- ), w = d.percentChange === void 0 || d.percentChange === null ? d.percentChange : O(
2849
- d.percentChange,
2850
- `${f}.percentChange`,
2875
+ ), w = s.percentChange === void 0 || s.percentChange === null ? s.percentChange : O(
2876
+ s.percentChange,
2877
+ `${p}.percentChange`,
2851
2878
  t
2852
- ), g = x(
2853
- d.unit,
2854
- `${f}.unit`,
2879
+ ), g = $(
2880
+ s.unit,
2881
+ `${p}.unit`,
2855
2882
  y.contentTitle,
2856
2883
  t
2857
- ), C = A(
2858
- d.evidenceIds,
2859
- `${f}.evidenceIds`,
2884
+ ), T = A(
2885
+ s.evidenceIds,
2886
+ `${p}.evidenceIds`,
2860
2887
  t
2861
2888
  );
2862
2889
  return {
2863
- label: T(
2864
- d.label,
2865
- `${f}.label`,
2890
+ label: x(
2891
+ s.label,
2892
+ `${p}.label`,
2866
2893
  y.contentTitle,
2867
2894
  t
2868
2895
  ),
@@ -2871,7 +2898,7 @@ function Zr(e, r, t) {
2871
2898
  ...b !== void 0 ? { delta: b } : {},
2872
2899
  ...w !== void 0 ? { percentChange: w } : {},
2873
2900
  ...g ? { unit: g } : {},
2874
- ...C ? { evidenceIds: C } : {}
2901
+ ...T ? { evidenceIds: T } : {}
2875
2902
  };
2876
2903
  }), c = A(
2877
2904
  o.evidenceIds,
@@ -2888,8 +2915,8 @@ function Zr(e, r, t) {
2888
2915
  if (a === "progress") {
2889
2916
  I(o, n, ["type", "label", "value", "detail", "evidenceIds"], t);
2890
2917
  const i = typeof o.value == "number" && Number.isFinite(o.value) ? o.value : 0;
2891
- (typeof o.value != "number" || !Number.isFinite(o.value)) && p(t, `${n}.value`, "Expected a finite number.");
2892
- const l = x(
2918
+ (typeof o.value != "number" || !Number.isFinite(o.value)) && f(t, `${n}.value`, "Expected a finite number.");
2919
+ const l = $(
2893
2920
  o.detail,
2894
2921
  `${n}.detail`,
2895
2922
  y.contentText,
@@ -2897,7 +2924,7 @@ function Zr(e, r, t) {
2897
2924
  ), m = A(o.evidenceIds, `${n}.evidenceIds`, t);
2898
2925
  return {
2899
2926
  type: "progress",
2900
- label: T(
2927
+ label: x(
2901
2928
  o.label,
2902
2929
  `${n}.label`,
2903
2930
  y.contentTitle,
@@ -2915,22 +2942,22 @@ function Zr(e, r, t) {
2915
2942
  ["type", "id", "title", "columns", "rows", "caption", "totalRows", "evidenceIds"],
2916
2943
  t
2917
2944
  );
2918
- const i = Wr(o.columns, `${n}.columns`, t), l = x(
2945
+ const i = Jr(o.columns, `${n}.columns`, t), l = $(
2919
2946
  o.title,
2920
2947
  `${n}.title`,
2921
2948
  y.contentTitle,
2922
2949
  t
2923
- ), m = x(
2950
+ ), m = $(
2924
2951
  o.id,
2925
2952
  `${n}.id`,
2926
2953
  y.id,
2927
2954
  t
2928
- ), c = x(
2955
+ ), c = $(
2929
2956
  o.caption,
2930
2957
  `${n}.caption`,
2931
2958
  y.contentItem,
2932
2959
  t
2933
- ), s = Vr(
2960
+ ), d = Ur(
2934
2961
  o.totalRows,
2935
2962
  `${n}.totalRows`,
2936
2963
  t
@@ -2940,15 +2967,15 @@ function Zr(e, r, t) {
2940
2967
  ...m ? { id: m } : {},
2941
2968
  ...l ? { title: l } : {},
2942
2969
  columns: i,
2943
- rows: Yr(o.rows, `${n}.rows`, i, t),
2970
+ rows: Xr(o.rows, `${n}.rows`, i, t),
2944
2971
  ...c ? { caption: c } : {},
2945
- ...s !== void 0 ? { totalRows: s } : {},
2972
+ ...d !== void 0 ? { totalRows: d } : {},
2946
2973
  ...u ? { evidenceIds: u } : {}
2947
2974
  };
2948
2975
  }
2949
2976
  if (a === "evidence_appendix") {
2950
2977
  I(o, n, ["type", "title", "evidenceIds"], t);
2951
- const i = x(
2978
+ const i = $(
2952
2979
  o.title,
2953
2980
  `${n}.title`,
2954
2981
  y.contentTitle,
@@ -2964,12 +2991,12 @@ function Zr(e, r, t) {
2964
2991
  }
2965
2992
  if (a === "sql") {
2966
2993
  I(o, n, ["type", "title", "sql", "evidenceIds"], t);
2967
- const i = x(
2994
+ const i = $(
2968
2995
  o.title,
2969
2996
  `${n}.title`,
2970
2997
  y.contentTitle,
2971
2998
  t
2972
- ), l = T(
2999
+ ), l = x(
2973
3000
  o.sql,
2974
3001
  `${n}.sql`,
2975
3002
  y.contentSql,
@@ -2982,7 +3009,7 @@ function Zr(e, r, t) {
2982
3009
  ...m ? { evidenceIds: m } : {}
2983
3010
  };
2984
3011
  }
2985
- return p(
3012
+ return f(
2986
3013
  t,
2987
3014
  `${n}.type`,
2988
3015
  "Expected heading, paragraph, finding, bullets, metric, kpi_grid, progress, table, actions, limitations, sql, or evidence_appendix."
@@ -2991,40 +3018,40 @@ function Zr(e, r, t) {
2991
3018
  text: ""
2992
3019
  };
2993
3020
  }
2994
- function Qr(e) {
2995
- const r = [], t = $(e, "content", r);
2996
- I(t, "content", ["version", "title", "summary", "blocks"], r), t.version !== 1 && p(r, "content.version", "Expected version 1.");
2997
- const n = x(
3021
+ function tn(e) {
3022
+ const r = [], t = k(e, "content", r);
3023
+ I(t, "content", ["version", "title", "summary", "blocks"], r), t.version !== 1 && f(r, "content.version", "Expected version 1.");
3024
+ const n = $(
2998
3025
  t.title,
2999
3026
  "content.title",
3000
3027
  y.contentTitle,
3001
3028
  r
3002
- ), o = x(
3029
+ ), o = $(
3003
3030
  t.summary,
3004
3031
  "content.summary",
3005
3032
  y.contentSummary,
3006
3033
  r
3007
3034
  );
3008
- Array.isArray(t.blocks) || p(r, "content.blocks", "Expected an array.");
3035
+ Array.isArray(t.blocks) || f(r, "content.blocks", "Expected an array.");
3009
3036
  const a = Array.isArray(t.blocks) ? t.blocks : [];
3010
- a.length === 0 && p(r, "content.blocks", "Expected at least one block."), a.length > R.maxBlocks && p(
3037
+ a.length === 0 && f(r, "content.blocks", "Expected at least one block."), a.length > R.maxBlocks && f(
3011
3038
  r,
3012
3039
  "content.blocks",
3013
3040
  `Must have ${R.maxBlocks} blocks or fewer.`
3014
3041
  );
3015
- const i = a.slice(0, R.maxBlocks).map((l, m) => Zr(l, m, r));
3016
- return he(r), {
3042
+ const i = a.slice(0, R.maxBlocks).map((l, m) => en(l, m, r));
3043
+ return ve(r), {
3017
3044
  version: 1,
3018
3045
  ...n ? { title: n } : {},
3019
3046
  ...o ? { summary: o } : {},
3020
3047
  blocks: i
3021
3048
  };
3022
3049
  }
3023
- function fo(e) {
3050
+ function vo(e) {
3024
3051
  try {
3025
3052
  return {
3026
3053
  valid: !0,
3027
- value: Qr(e),
3054
+ value: tn(e),
3028
3055
  issues: []
3029
3056
  };
3030
3057
  } catch (r) {
@@ -3034,44 +3061,44 @@ function fo(e) {
3034
3061
  }
3035
3062
  }
3036
3063
  function Z(e, r, t, n) {
3037
- return typeof e == "string" && t.includes(e) ? e : (p(n, r, `Expected ${t.join(" or ")}.`), t[0]);
3064
+ return typeof e == "string" && t.includes(e) ? e : (f(n, r, `Expected ${t.join(" or ")}.`), t[0]);
3038
3065
  }
3039
3066
  function D(e, r, t, n, o) {
3040
3067
  if (e != null) {
3041
3068
  if (typeof e == "string" && t.has(e))
3042
3069
  return e;
3043
- p(o, r, `Expected ${n}.`);
3070
+ f(o, r, `Expected ${n}.`);
3044
3071
  }
3045
3072
  }
3046
- function Jr(e, r, t) {
3073
+ function rn(e, r, t) {
3047
3074
  if (e != null) {
3048
3075
  if (!Array.isArray(e)) {
3049
- p(t, r, "Expected an array.");
3076
+ f(t, r, "Expected an array.");
3050
3077
  return;
3051
3078
  }
3052
3079
  return e;
3053
3080
  }
3054
3081
  }
3055
- function Xr(e, r, t) {
3082
+ function nn(e, r, t) {
3056
3083
  if (e != null) {
3057
- if (!je(e)) {
3058
- p(t, r, "Expected an object.");
3084
+ if (!Ue(e)) {
3085
+ f(t, r, "Expected an object.");
3059
3086
  return;
3060
3087
  }
3061
3088
  return e;
3062
3089
  }
3063
3090
  }
3064
- function en(e, r, t) {
3091
+ function on(e, r, t) {
3065
3092
  if (e == null)
3066
3093
  return;
3067
- const n = $(e, r, t);
3068
- I(n, r, Nr, t);
3094
+ const n = k(e, r, t);
3095
+ I(n, r, qr, t);
3069
3096
  const o = {};
3070
3097
  if (n.matrix !== void 0) {
3071
- const c = $(n.matrix, `${r}.matrix`, t);
3098
+ const c = k(n.matrix, `${r}.matrix`, t);
3072
3099
  I(c, `${r}.matrix`, ["config", "content"], t);
3073
- const s = lt.safeParse(c.config);
3074
- s.success || p(t, `${r}.matrix.config`, "Expected a valid Matrix definition.");
3100
+ const d = st.safeParse(c.config);
3101
+ d.success || f(t, `${r}.matrix.config`, "Expected a valid Matrix definition.");
3075
3102
  const u = D(
3076
3103
  c.content,
3077
3104
  `${r}.matrix.content`,
@@ -3079,30 +3106,30 @@ function en(e, r, t) {
3079
3106
  "current, all, or flat",
3080
3107
  t
3081
3108
  );
3082
- u || p(t, `${r}.matrix.content`, "Choose Matrix export content."), s.success && u && (o.matrix = { config: s.data, content: u });
3109
+ u || f(t, `${r}.matrix.content`, "Choose Matrix export content."), d.success && u && (o.matrix = { config: d.data, content: u });
3083
3110
  }
3084
3111
  const a = D(
3085
3112
  n.pageSize,
3086
3113
  `${r}.pageSize`,
3087
- Rr,
3114
+ Br,
3088
3115
  "letter, legal, a4, a3, or tabloid",
3089
3116
  t
3090
3117
  ), i = D(
3091
3118
  n.orientation,
3092
3119
  `${r}.orientation`,
3093
- Ar,
3120
+ Dr,
3094
3121
  "portrait or landscape",
3095
3122
  t
3096
3123
  ), l = D(
3097
3124
  n.delimiter,
3098
3125
  `${r}.delimiter`,
3099
- Pr,
3126
+ Or,
3100
3127
  "comma, semicolon, or tab",
3101
3128
  t
3102
3129
  ), m = D(
3103
3130
  n.sheetSelection,
3104
3131
  `${r}.sheetSelection`,
3105
- Mr,
3132
+ Kr,
3106
3133
  "current or all",
3107
3134
  t
3108
3135
  );
@@ -3116,7 +3143,7 @@ function en(e, r, t) {
3116
3143
  ])
3117
3144
  if (!(n[c] === void 0 || n[c] === null)) {
3118
3145
  if (typeof n[c] != "boolean") {
3119
- p(t, `${r}.${c}`, "Expected a boolean.");
3146
+ f(t, `${r}.${c}`, "Expected a boolean.");
3120
3147
  continue;
3121
3148
  }
3122
3149
  o[c] = n[c];
@@ -3129,13 +3156,13 @@ function en(e, r, t) {
3129
3156
  "cardType",
3130
3157
  "theme"
3131
3158
  ]) {
3132
- const s = x(
3159
+ const d = $(
3133
3160
  n[c],
3134
3161
  `${r}.${c}`,
3135
3162
  y.id,
3136
3163
  t
3137
3164
  );
3138
- s && (o[c] = s);
3165
+ d && (o[c] = d);
3139
3166
  }
3140
3167
  for (const c of [
3141
3168
  "filterValues",
@@ -3145,21 +3172,21 @@ function en(e, r, t) {
3145
3172
  "cardControlDefinitions",
3146
3173
  "controlBindings"
3147
3174
  ]) {
3148
- const s = Jr(n[c], `${r}.${c}`, t);
3149
- s && (o[c] = s);
3175
+ const d = rn(n[c], `${r}.${c}`, t);
3176
+ d && (o[c] = d);
3150
3177
  }
3151
3178
  for (const c of [
3152
3179
  "controlValues",
3153
3180
  "tablePreferences",
3154
3181
  "dashboardInputExecutionSnapshot"
3155
3182
  ]) {
3156
- const s = Xr(n[c], `${r}.${c}`, t);
3157
- s && (o[c] = s);
3183
+ const d = nn(n[c], `${r}.${c}`, t);
3184
+ d && (o[c] = d);
3158
3185
  }
3159
3186
  return Object.keys(o).length > 0 ? o : void 0;
3160
3187
  }
3161
- function oe(e, r, t, n) {
3162
- const o = x(
3188
+ function ae(e, r, t, n) {
3189
+ const o = $(
3163
3190
  r,
3164
3191
  t,
3165
3192
  y.attachmentTitle,
@@ -3167,12 +3194,12 @@ function oe(e, r, t, n) {
3167
3194
  );
3168
3195
  return o && (e.title = o), e;
3169
3196
  }
3170
- function ae(e, r, t, n) {
3171
- const o = en(r, t, n);
3197
+ function ie(e, r, t, n) {
3198
+ const o = on(r, t, n);
3172
3199
  return o && (e.settings = o), e;
3173
3200
  }
3174
- function tn(e, r, t) {
3175
- const n = `attachments.${r}`, o = $(e, n, t), a = o.type;
3201
+ function an(e, r, t) {
3202
+ const n = `attachments.${r}`, o = k(e, n, t), a = o.type;
3176
3203
  if (a === "dashboard") {
3177
3204
  I(
3178
3205
  o,
@@ -3180,10 +3207,10 @@ function tn(e, r, t) {
3180
3207
  ["type", "dashboardId", "format", "title", "settings"],
3181
3208
  t
3182
3209
  );
3183
- const i = oe(
3210
+ const i = ae(
3184
3211
  {
3185
3212
  type: "dashboard",
3186
- dashboardId: T(
3213
+ dashboardId: x(
3187
3214
  o.dashboardId,
3188
3215
  `${n}.dashboardId`,
3189
3216
  y.id,
@@ -3195,7 +3222,7 @@ function tn(e, r, t) {
3195
3222
  `${n}.title`,
3196
3223
  t
3197
3224
  );
3198
- return ae(i, o.settings, `${n}.settings`, t);
3225
+ return ie(i, o.settings, `${n}.settings`, t);
3199
3226
  }
3200
3227
  if (a === "dashboard_sheet" || a === "document_sheet") {
3201
3228
  I(
@@ -3204,16 +3231,16 @@ function tn(e, r, t) {
3204
3231
  ["type", "dashboardId", "sheetId", "format", "title", "settings"],
3205
3232
  t
3206
3233
  );
3207
- const i = oe(
3234
+ const i = ae(
3208
3235
  {
3209
3236
  type: a,
3210
- dashboardId: T(
3237
+ dashboardId: x(
3211
3238
  o.dashboardId,
3212
3239
  `${n}.dashboardId`,
3213
3240
  y.id,
3214
3241
  t
3215
3242
  ),
3216
- sheetId: T(
3243
+ sheetId: x(
3217
3244
  o.sheetId,
3218
3245
  `${n}.sheetId`,
3219
3246
  y.id,
@@ -3225,7 +3252,7 @@ function tn(e, r, t) {
3225
3252
  `${n}.title`,
3226
3253
  t
3227
3254
  );
3228
- return ae(i, o.settings, `${n}.settings`, t);
3255
+ return ie(i, o.settings, `${n}.settings`, t);
3229
3256
  }
3230
3257
  if (a === "card") {
3231
3258
  I(
@@ -3234,16 +3261,16 @@ function tn(e, r, t) {
3234
3261
  ["type", "dashboardId", "cardId", "format", "title", "settings"],
3235
3262
  t
3236
3263
  );
3237
- const i = oe(
3264
+ const i = ae(
3238
3265
  {
3239
3266
  type: "card",
3240
- dashboardId: T(
3267
+ dashboardId: x(
3241
3268
  o.dashboardId,
3242
3269
  `${n}.dashboardId`,
3243
3270
  y.id,
3244
3271
  t
3245
3272
  ),
3246
- cardId: T(
3273
+ cardId: x(
3247
3274
  o.cardId,
3248
3275
  `${n}.cardId`,
3249
3276
  y.id,
@@ -3260,15 +3287,15 @@ function tn(e, r, t) {
3260
3287
  `${n}.title`,
3261
3288
  t
3262
3289
  );
3263
- return ae(i, o.settings, `${n}.settings`, t);
3290
+ return ie(i, o.settings, `${n}.settings`, t);
3264
3291
  }
3265
- return p(
3292
+ return f(
3266
3293
  t,
3267
3294
  `${n}.type`,
3268
3295
  "Expected dashboard, dashboard_sheet, document_sheet, or card."
3269
3296
  ), { type: "dashboard", dashboardId: "", format: "pdf" };
3270
3297
  }
3271
- function rn(e) {
3298
+ function cn(e) {
3272
3299
  switch (e.type) {
3273
3300
  case "dashboard":
3274
3301
  return `${e.type}:${e.dashboardId}:${e.format}`;
@@ -3279,37 +3306,37 @@ function rn(e) {
3279
3306
  return `${e.type}:${e.dashboardId}:${e.cardId}:${e.format}`;
3280
3307
  }
3281
3308
  }
3282
- function Ye(e, r) {
3309
+ function Ze(e, r) {
3283
3310
  if (e == null)
3284
3311
  return [];
3285
3312
  if (!Array.isArray(e))
3286
- return p(r, "attachments", "Expected an array."), [];
3287
- e.length > re && p(
3313
+ return f(r, "attachments", "Expected an array."), [];
3314
+ e.length > ne && f(
3288
3315
  r,
3289
3316
  "attachments",
3290
- `Choose ${re} attachments or fewer.`
3317
+ `Choose ${ne} attachments or fewer.`
3291
3318
  );
3292
- const t = e.slice(0, re).map((o, a) => tn(o, a, r)), n = /* @__PURE__ */ new Set();
3319
+ const t = e.slice(0, ne).map((o, a) => an(o, a, r)), n = /* @__PURE__ */ new Set();
3293
3320
  return t.forEach((o, a) => {
3294
3321
  var l;
3295
- (l = o.settings) != null && l.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format !== "csv") && p(r, `attachments.${a}.settings.matrix`, "Matrix settings require a matrixTable card attachment; flat content requires CSV.");
3296
- const i = rn(o);
3297
- n.has(i) && p(r, `attachments.${a}`, "Duplicate attachment."), n.add(i);
3322
+ (l = o.settings) != null && l.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format !== "csv") && f(r, `attachments.${a}.settings.matrix`, "Matrix settings require a matrixTable card attachment; flat content requires CSV.");
3323
+ const i = cn(o);
3324
+ n.has(i) && f(r, `attachments.${a}`, "Duplicate attachment."), n.add(i);
3298
3325
  }), t;
3299
3326
  }
3300
- function Ze(e, r) {
3327
+ function Qe(e, r) {
3301
3328
  if (e == null)
3302
3329
  return;
3303
- const t = $(e, "limits", r);
3304
- I(t, "limits", Object.keys(ne), r);
3330
+ const t = k(e, "limits", r);
3331
+ I(t, "limits", Object.keys(oe), r);
3305
3332
  const n = {};
3306
- return Object.keys(ne).forEach((o) => {
3333
+ return Object.keys(oe).forEach((o) => {
3307
3334
  const a = t[o];
3308
3335
  if (a == null)
3309
3336
  return;
3310
- const i = ne[o];
3337
+ const i = oe[o];
3311
3338
  if (typeof a != "number" || !Number.isInteger(a) || a < i.min || a > i.max) {
3312
- p(
3339
+ f(
3313
3340
  r,
3314
3341
  `limits.${o}`,
3315
3342
  `Expected an integer between ${i.min} and ${i.max}.`
@@ -3319,18 +3346,18 @@ function Ze(e, r) {
3319
3346
  n[o] = a;
3320
3347
  }), Object.keys(n).length > 0 ? n : void 0;
3321
3348
  }
3322
- function he(e) {
3349
+ function ve(e) {
3323
3350
  if (e.length > 0)
3324
3351
  throw new ee(e);
3325
3352
  }
3326
- function Qe(e, r, t) {
3327
- !(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && r.length === 0 && p(
3353
+ function Je(e, r, t) {
3354
+ !(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && r.length === 0 && f(
3328
3355
  t,
3329
3356
  "body",
3330
3357
  "Add briefing instructions, a custom message, or at least one attachment."
3331
3358
  );
3332
3359
  }
3333
- function nn(e, r, t) {
3360
+ function ln(e, r, t) {
3334
3361
  e == null || e.forEach((n, o) => {
3335
3362
  const a = `${t}.${o}.scope`, i = n.scope.attachmentIndex;
3336
3363
  if (i === void 0)
@@ -3352,8 +3379,8 @@ function nn(e, r, t) {
3352
3379
  );
3353
3380
  });
3354
3381
  }
3355
- function Je(e) {
3356
- const r = [], t = $(e, "jobConfig", r);
3382
+ function Xe(e) {
3383
+ const r = [], t = k(e, "jobConfig", r);
3357
3384
  I(
3358
3385
  t,
3359
3386
  "jobConfig",
@@ -3367,28 +3394,28 @@ function Je(e) {
3367
3394
  "limits"
3368
3395
  ],
3369
3396
  r
3370
- ), t.kind !== le && p(r, "kind", "Expected BRIEFING.");
3397
+ ), t.kind !== se && f(r, "kind", "Expected BRIEFING.");
3371
3398
  let n;
3372
3399
  try {
3373
- n = ht(
3400
+ n = bt(
3374
3401
  t.presentationExecutionSnapshot
3375
3402
  );
3376
3403
  } catch (c) {
3377
3404
  if (c instanceof j)
3378
3405
  throw c;
3379
- p(
3406
+ f(
3380
3407
  r,
3381
3408
  "jobConfig.presentationExecutionSnapshot",
3382
3409
  c instanceof Error ? c.message : "Invalid presentation snapshot."
3383
3410
  );
3384
3411
  }
3385
- const o = Ue(t.source, r), a = Ge(t.body, r), i = Ye(t.attachments, r), l = He(t.presentation, r), m = Ze(t.limits, r);
3386
- return Qe(a, i, r), nn(
3412
+ const o = Ge(t.source, r), a = He(t.body, r), i = Ze(t.attachments, r), l = We(t.presentation, r), m = Qe(t.limits, r);
3413
+ return Je(a, i, r), ln(
3387
3414
  n == null ? void 0 : n.resolvedFormats,
3388
3415
  i,
3389
3416
  "jobConfig.presentationExecutionSnapshot.resolvedFormats"
3390
- ), he(r), {
3391
- kind: le,
3417
+ ), ve(r), {
3418
+ kind: se,
3392
3419
  presentationExecutionSnapshot: n,
3393
3420
  source: o,
3394
3421
  body: a,
@@ -3397,28 +3424,28 @@ function Je(e) {
3397
3424
  ...m ? { limits: m } : {}
3398
3425
  };
3399
3426
  }
3400
- function po(e) {
3401
- return Je({
3427
+ function bo(e) {
3428
+ return Xe({
3402
3429
  ...e,
3403
- kind: le
3430
+ kind: se
3404
3431
  });
3405
3432
  }
3406
- function ge(e, r, t, n = "deliveryConfig.recipients") {
3407
- const o = `${n}.${r}`, a = $(e, o, t), i = a.type;
3433
+ function be(e, r, t, n = "deliveryConfig.recipients") {
3434
+ const o = `${n}.${r}`, a = k(e, o, t), i = a.type;
3408
3435
  if (i === "email") {
3409
3436
  I(a, o, ["type", "address", "name"], t);
3410
- const l = T(
3437
+ const l = x(
3411
3438
  a.address,
3412
3439
  `${o}.address`,
3413
3440
  y.id,
3414
3441
  t
3415
- ), m = x(
3442
+ ), m = $(
3416
3443
  a.name,
3417
3444
  `${o}.name`,
3418
3445
  y.attachmentTitle,
3419
3446
  t
3420
3447
  );
3421
- return l && !qr(l) && p(t, `${o}.address`, "Email address is invalid."), {
3448
+ return l && !Hr(l) && f(t, `${o}.address`, "Email address is invalid."), {
3422
3449
  type: "email",
3423
3450
  address: l,
3424
3451
  ...m ? { name: m } : {}
@@ -3426,7 +3453,7 @@ function ge(e, r, t, n = "deliveryConfig.recipients") {
3426
3453
  }
3427
3454
  return i === "user" ? (I(a, o, ["type", "userId"], t), {
3428
3455
  type: "user",
3429
- userId: T(
3456
+ userId: x(
3430
3457
  a.userId,
3431
3458
  `${o}.userId`,
3432
3459
  y.id,
@@ -3434,7 +3461,7 @@ function ge(e, r, t, n = "deliveryConfig.recipients") {
3434
3461
  )
3435
3462
  }) : i === "tenant_user" ? (I(a, o, ["type", "tenantUserId"], t), {
3436
3463
  type: "tenant_user",
3437
- tenantUserId: T(
3464
+ tenantUserId: x(
3438
3465
  a.tenantUserId,
3439
3466
  `${o}.tenantUserId`,
3440
3467
  y.id,
@@ -3442,30 +3469,30 @@ function ge(e, r, t, n = "deliveryConfig.recipients") {
3442
3469
  )
3443
3470
  }) : i === "group" ? (I(a, o, ["type", "groupId"], t), {
3444
3471
  type: "group",
3445
- groupId: T(
3472
+ groupId: x(
3446
3473
  a.groupId,
3447
3474
  `${o}.groupId`,
3448
3475
  y.id,
3449
3476
  t
3450
3477
  )
3451
- }) : (p(
3478
+ }) : (f(
3452
3479
  t,
3453
3480
  `${o}.type`,
3454
3481
  "Expected email, user, tenant_user, or group."
3455
3482
  ), { type: "email", address: "" });
3456
3483
  }
3457
- function on(e, r) {
3484
+ function sn(e, r) {
3458
3485
  return e == null ? [] : Array.isArray(e) ? e.map(
3459
- (t, n) => ge(t, n, r)
3460
- ) : (p(r, "deliveryConfig.recipients", "Expected an array."), []);
3486
+ (t, n) => be(t, n, r)
3487
+ ) : (f(r, "deliveryConfig.recipients", "Expected an array."), []);
3461
3488
  }
3462
- function an(e, r) {
3489
+ function dn(e, r) {
3463
3490
  if (!Array.isArray(e))
3464
- return p(r, "deliveryConfig.channels", "Expected an array."), [];
3491
+ return f(r, "deliveryConfig.channels", "Expected an array."), [];
3465
3492
  const t = [];
3466
3493
  return e.forEach((n, o) => {
3467
- if (!Xe(n)) {
3468
- p(
3494
+ if (!et(n)) {
3495
+ f(
3469
3496
  r,
3470
3497
  `deliveryConfig.channels.${o}`,
3471
3498
  "Expected EMAIL, WEBHOOK, SLACK, IN_APP, or TELEGRAM."
@@ -3475,43 +3502,43 @@ function an(e, r) {
3475
3502
  t.includes(n) || t.push(n);
3476
3503
  }), t;
3477
3504
  }
3478
- function cn(e, r, t) {
3505
+ function mn(e, r, t) {
3479
3506
  if (e == null)
3480
3507
  return;
3481
- const n = $(e, r, t), o = {};
3508
+ const n = k(e, r, t), o = {};
3482
3509
  return Object.entries(n).forEach(([a, i]) => {
3483
3510
  if (typeof i != "string") {
3484
- p(t, `${r}.${a}`, "Expected a string.");
3511
+ f(t, `${r}.${a}`, "Expected a string.");
3485
3512
  return;
3486
3513
  }
3487
3514
  o[a] = i.trim();
3488
3515
  }), Object.keys(o).length > 0 ? o : void 0;
3489
3516
  }
3490
- function ln(e, r, t) {
3517
+ function un(e, r, t) {
3491
3518
  if (e == null)
3492
3519
  return;
3493
- const n = $(e, r, t);
3520
+ const n = k(e, r, t);
3494
3521
  I(
3495
3522
  n,
3496
3523
  r,
3497
3524
  ["url", "method", "headers", "secretEncrypted"],
3498
3525
  t
3499
3526
  );
3500
- const o = n.method === void 0 || n.method === null ? void 0 : Z(n.method, `${r}.method`, ["POST", "PUT"], t), a = cn(n.headers, `${r}.headers`, t), i = x(
3527
+ const o = n.method === void 0 || n.method === null ? void 0 : Z(n.method, `${r}.method`, ["POST", "PUT"], t), a = mn(n.headers, `${r}.headers`, t), i = $(
3501
3528
  n.secretEncrypted,
3502
3529
  `${r}.secretEncrypted`,
3503
3530
  2e3,
3504
3531
  t
3505
3532
  );
3506
3533
  return {
3507
- url: T(n.url, `${r}.url`, 2e3, t),
3534
+ url: x(n.url, `${r}.url`, 2e3, t),
3508
3535
  ...o ? { method: o } : {},
3509
3536
  ...a ? { headers: a } : {},
3510
3537
  ...i ? { secretEncrypted: i } : {}
3511
3538
  };
3512
3539
  }
3513
- function dn(e, r, t) {
3514
- const n = $(e, r, t), o = n.type;
3540
+ function fn(e, r, t) {
3541
+ const n = k(e, r, t), o = n.type;
3515
3542
  if (o === "channel") {
3516
3543
  I(
3517
3544
  n,
@@ -3519,7 +3546,7 @@ function dn(e, r, t) {
3519
3546
  ["type", "channelId", "channelName", "isPrivate"],
3520
3547
  t
3521
3548
  );
3522
- const a = x(
3549
+ const a = $(
3523
3550
  n.channelName,
3524
3551
  `${r}.channelName`,
3525
3552
  y.attachmentTitle,
@@ -3532,7 +3559,7 @@ function dn(e, r, t) {
3532
3559
  );
3533
3560
  return {
3534
3561
  type: "channel",
3535
- channelId: T(
3562
+ channelId: x(
3536
3563
  n.channelId,
3537
3564
  `${r}.channelId`,
3538
3565
  y.id,
@@ -3542,31 +3569,31 @@ function dn(e, r, t) {
3542
3569
  ...i !== void 0 ? { isPrivate: i } : {}
3543
3570
  };
3544
3571
  }
3545
- return o === "dm" ? (I(n, r, ["type", "recipient"], t), p(
3572
+ return o === "dm" ? (I(n, r, ["type", "recipient"], t), f(
3546
3573
  t,
3547
3574
  `${r}.type`,
3548
3575
  "Slack DM delivery is not supported in V1."
3549
3576
  ), {
3550
3577
  type: "dm",
3551
- recipient: ge(n.recipient, 0, t, `${r}.recipient`)
3552
- }) : (p(t, `${r}.type`, "Expected channel."), { type: "channel", channelId: "" });
3578
+ recipient: be(n.recipient, 0, t, `${r}.recipient`)
3579
+ }) : (f(t, `${r}.type`, "Expected channel."), { type: "channel", channelId: "" });
3553
3580
  }
3554
- function sn(e, r, t) {
3581
+ function pn(e, r, t) {
3555
3582
  if (e == null)
3556
3583
  return;
3557
3584
  if (!Array.isArray(e)) {
3558
- p(t, r, "Expected an array.");
3585
+ f(t, r, "Expected an array.");
3559
3586
  return;
3560
3587
  }
3561
3588
  const n = e.map(
3562
- (o, a) => ge(o, a, t, r)
3589
+ (o, a) => be(o, a, t, r)
3563
3590
  );
3564
3591
  return n.length > 0 ? n : void 0;
3565
3592
  }
3566
- function mn(e, r, t) {
3593
+ function yn(e, r, t) {
3567
3594
  if (e == null)
3568
3595
  return;
3569
- const n = $(e, r, t);
3596
+ const n = k(e, r, t);
3570
3597
  I(
3571
3598
  n,
3572
3599
  r,
@@ -3579,7 +3606,7 @@ function mn(e, r, t) {
3579
3606
  ],
3580
3607
  t
3581
3608
  );
3582
- const o = sn(
3609
+ const o = pn(
3583
3610
  n.threadMentions,
3584
3611
  `${r}.threadMentions`,
3585
3612
  t
@@ -3600,7 +3627,7 @@ function mn(e, r, t) {
3600
3627
  t
3601
3628
  );
3602
3629
  return {
3603
- destination: dn(
3630
+ destination: fn(
3604
3631
  n.destination,
3605
3632
  `${r}.destination`,
3606
3633
  t
@@ -3611,8 +3638,8 @@ function mn(e, r, t) {
3611
3638
  ...n.includeBriefingLink !== void 0 ? { includeBriefingLink: l } : {}
3612
3639
  };
3613
3640
  }
3614
- function un(e, r, t) {
3615
- const n = $(e, r, t);
3641
+ function hn(e, r, t) {
3642
+ const n = k(e, r, t);
3616
3643
  I(
3617
3644
  n,
3618
3645
  r,
@@ -3630,20 +3657,20 @@ function un(e, r, t) {
3630
3657
  const o = D(
3631
3658
  n.formatProfile,
3632
3659
  `${r}.formatProfile`,
3633
- Br,
3660
+ Nr,
3634
3661
  "concise, balanced, or detailed",
3635
3662
  t
3636
- ), a = x(
3663
+ ), a = $(
3637
3664
  n.subjectOverride,
3638
3665
  `${r}.subjectOverride`,
3639
3666
  500,
3640
3667
  t
3641
- ), i = x(
3668
+ ), i = $(
3642
3669
  n.titleOverride,
3643
3670
  `${r}.titleOverride`,
3644
3671
  500,
3645
3672
  t
3646
- ), l = x(
3673
+ ), l = $(
3647
3674
  n.summaryOverride,
3648
3675
  `${r}.summaryOverride`,
3649
3676
  2e3,
@@ -3653,11 +3680,11 @@ function un(e, r, t) {
3653
3680
  !0,
3654
3681
  `${r}.actionBlockVisible`,
3655
3682
  t
3656
- ), c = ln(
3683
+ ), c = un(
3657
3684
  n.webhookConfig,
3658
3685
  `${r}.webhookConfig`,
3659
3686
  t
3660
- ), s = mn(
3687
+ ), d = yn(
3661
3688
  n.slackConfig,
3662
3689
  `${r}.slackConfig`,
3663
3690
  t
@@ -3668,57 +3695,57 @@ function un(e, r, t) {
3668
3695
  ...i ? { titleOverride: i } : {},
3669
3696
  ...l ? { summaryOverride: l } : {},
3670
3697
  ...n.actionBlockVisible !== void 0 ? { actionBlockVisible: m } : {},
3671
- ...s ? { slackConfig: s } : {},
3698
+ ...d ? { slackConfig: d } : {},
3672
3699
  ...c ? { webhookConfig: c } : {}
3673
3700
  };
3674
3701
  }
3675
- function fn(e, r) {
3702
+ function gn(e, r) {
3676
3703
  if (e == null)
3677
3704
  return;
3678
- const t = $(e, "deliveryConfig.channelConfigs", r), n = {};
3705
+ const t = k(e, "deliveryConfig.channelConfigs", r), n = {};
3679
3706
  return Object.entries(t).forEach(([o, a]) => {
3680
- if (!Xe(o)) {
3681
- p(
3707
+ if (!et(o)) {
3708
+ f(
3682
3709
  r,
3683
3710
  `deliveryConfig.channelConfigs.${o}`,
3684
3711
  "Expected a supported delivery channel."
3685
3712
  );
3686
3713
  return;
3687
3714
  }
3688
- n[o] = un(
3715
+ n[o] = hn(
3689
3716
  a,
3690
3717
  `deliveryConfig.channelConfigs.${o}`,
3691
3718
  r
3692
3719
  );
3693
3720
  }), Object.keys(n).length > 0 ? n : void 0;
3694
3721
  }
3695
- function pn(e, r) {
3696
- var m, c, s;
3722
+ function vn(e, r) {
3723
+ var m, c, d;
3697
3724
  if (e == null)
3698
3725
  return null;
3699
- const t = $(e, "deliveryConfig", r);
3726
+ const t = k(e, "deliveryConfig", r);
3700
3727
  I(
3701
3728
  t,
3702
3729
  "deliveryConfig",
3703
3730
  ["recipients", "channels", "channelConfigs"],
3704
3731
  r
3705
3732
  );
3706
- const n = fn(t.channelConfigs, r), o = on(t.recipients, r), a = an(t.channels, r), i = ((c = (m = n == null ? void 0 : n.SLACK) == null ? void 0 : m.slackConfig) == null ? void 0 : c.destination.type) === "channel" && !!n.SLACK.slackConfig.destination.channelId.trim();
3733
+ const n = gn(t.channelConfigs, r), o = sn(t.recipients, r), a = dn(t.channels, r), i = ((c = (m = n == null ? void 0 : n.SLACK) == null ? void 0 : m.slackConfig) == null ? void 0 : c.destination.type) === "channel" && !!n.SLACK.slackConfig.destination.channelId.trim();
3707
3734
  return a.some(
3708
3735
  (u) => u !== "SLACK"
3709
- ) && o.length === 0 && p(
3736
+ ) && o.length === 0 && f(
3710
3737
  r,
3711
3738
  "deliveryConfig.recipients",
3712
3739
  "Add at least one recipient or remove delivery config."
3713
- ), a.length === 0 && p(
3740
+ ), a.length === 0 && f(
3714
3741
  r,
3715
3742
  "deliveryConfig.channels",
3716
3743
  "Choose at least one delivery channel or remove delivery config."
3717
- ), a.includes("SLACK") && !i && p(
3744
+ ), a.includes("SLACK") && !i && f(
3718
3745
  r,
3719
3746
  "deliveryConfig.channelConfigs.SLACK.slackConfig.destination.channelId",
3720
3747
  "Choose a Slack channel destination."
3721
- ), !a.includes("SLACK") && ((s = n == null ? void 0 : n.SLACK) != null && s.slackConfig) && p(
3748
+ ), !a.includes("SLACK") && ((d = n == null ? void 0 : n.SLACK) != null && d.slackConfig) && f(
3722
3749
  r,
3723
3750
  "deliveryConfig.channelConfigs.SLACK",
3724
3751
  "Slack config requires SLACK in deliveryConfig.channels."
@@ -3728,8 +3755,8 @@ function pn(e, r) {
3728
3755
  ...n ? { channelConfigs: n } : {}
3729
3756
  };
3730
3757
  }
3731
- function ve(e) {
3732
- const r = [], t = $(e, "draft", r);
3758
+ function Ie(e) {
3759
+ const r = [], t = k(e, "draft", r);
3733
3760
  I(
3734
3761
  t,
3735
3762
  "draft",
@@ -3748,18 +3775,18 @@ function ve(e) {
3748
3775
  ],
3749
3776
  r
3750
3777
  );
3751
- const n = T(
3778
+ const n = x(
3752
3779
  t.name,
3753
3780
  "name",
3754
3781
  y.name,
3755
3782
  r
3756
- ), o = x(
3783
+ ), o = $(
3757
3784
  t.description,
3758
3785
  "description",
3759
3786
  y.description,
3760
3787
  r
3761
- ) ?? null, a = x(t.scheduleExpr, "scheduleExpr", 500, r) ?? null, i = x(t.timezone, "timezone", 200, r) ?? "UTC", l = Lr(t.status, r), m = Ue(t.source, r), c = Ge(t.body, r), s = Ye(t.attachments, r), u = He(t.presentation, r), f = Ze(t.limits, r), d = pn(t.deliveryConfig, r);
3762
- return Qe(c, s, r), he(r), {
3788
+ ) ?? null, a = $(t.scheduleExpr, "scheduleExpr", 500, r) ?? null, i = $(t.timezone, "timezone", 200, r) ?? "UTC", l = Gr(t.status, r), m = Ge(t.source, r), c = He(t.body, r), d = Ze(t.attachments, r), u = We(t.presentation, r), p = Qe(t.limits, r), s = vn(t.deliveryConfig, r);
3789
+ return Je(c, d, r), ve(r), {
3763
3790
  name: n,
3764
3791
  description: o,
3765
3792
  status: l,
@@ -3767,129 +3794,130 @@ function ve(e) {
3767
3794
  timezone: i,
3768
3795
  source: m,
3769
3796
  body: c,
3770
- attachments: s,
3797
+ attachments: d,
3771
3798
  presentation: u,
3772
- ...f ? { limits: f } : {},
3773
- deliveryConfig: d
3799
+ ...p ? { limits: p } : {},
3800
+ deliveryConfig: s
3774
3801
  };
3775
3802
  }
3776
- function yo(e) {
3777
- return ve(e);
3803
+ function Io(e) {
3804
+ return Ie(e);
3778
3805
  }
3779
- function ho(e) {
3780
- return ve(e);
3806
+ function wo(e) {
3807
+ return Ie(e);
3781
3808
  }
3782
- function go(e) {
3809
+ function Co(e) {
3783
3810
  try {
3784
- return { valid: !0, value: ve(e), issues: [] };
3811
+ return { valid: !0, value: Ie(e), issues: [] };
3785
3812
  } catch (r) {
3786
3813
  if (r instanceof ee)
3787
3814
  return { valid: !1, issues: r.issues };
3788
3815
  throw r;
3789
3816
  }
3790
3817
  }
3791
- function vo(e) {
3818
+ function To(e) {
3792
3819
  try {
3793
- return { valid: !0, value: Je(e), issues: [] };
3820
+ return { valid: !0, value: Xe(e), issues: [] };
3794
3821
  } catch (r) {
3795
3822
  if (r instanceof ee)
3796
3823
  return { valid: !1, issues: r.issues };
3797
3824
  throw r;
3798
3825
  }
3799
3826
  }
3800
- function bo(e) {
3801
- return typeof e == "string" && qe.has(e);
3827
+ function xo(e) {
3828
+ return typeof e == "string" && je.has(e);
3802
3829
  }
3803
- function Xe(e) {
3804
- return typeof e == "string" && Fr.has(e);
3830
+ function et(e) {
3831
+ return typeof e == "string" && Mr.has(e);
3805
3832
  }
3806
3833
  export {
3807
- Cr as $,
3808
- Ln as A,
3809
- Xn as B,
3810
- ur as C,
3811
- to as D,
3812
- no as E,
3834
+ kr as $,
3835
+ Gn as A,
3836
+ no as B,
3837
+ hr as C,
3838
+ ao as D,
3839
+ co as E,
3813
3840
  X as F,
3814
- Lt as G,
3815
- Pn as H,
3816
- jn as I,
3841
+ Gt as G,
3842
+ On as H,
3843
+ Wn as I,
3817
3844
  N as J,
3818
- Kn as K,
3819
- Bt as L,
3820
- Nt as M,
3821
- zt as N,
3822
- Qt as O,
3823
- Zt as P,
3824
- fe as Q,
3825
- Ut as R,
3826
- qn as S,
3827
- Bn as T,
3828
- Nn as U,
3829
- zn as V,
3830
- Vn as W,
3831
- Oe as X,
3845
+ Vn as K,
3846
+ Nt as L,
3847
+ qt as M,
3848
+ jt as N,
3849
+ tr as O,
3850
+ er as P,
3851
+ ye as Q,
3852
+ Yt as R,
3853
+ Hn as S,
3854
+ Nn as T,
3855
+ qn as U,
3856
+ jn as V,
3857
+ Un as W,
3858
+ Ke as X,
3832
3859
  S as Y,
3833
- eo as Z,
3834
- ao as _,
3835
- so as a,
3836
- io as a0,
3837
- oo as a1,
3838
- $r as a2,
3839
- lo as a3,
3840
- Wt as a4,
3841
- Xt as a5,
3842
- Ke as a6,
3843
- Gn as a7,
3844
- Mt as a8,
3845
- le as a9,
3846
- Er as aa,
3847
- de as ab,
3848
- re as ac,
3849
- y as ad,
3850
- R as ae,
3851
- Sr as af,
3852
- _r as ag,
3853
- uo as ah,
3854
- ee as ai,
3855
- Qr as aj,
3856
- fo as ak,
3857
- Je as al,
3858
- po as am,
3859
- ve as an,
3860
- yo as ao,
3861
- ho as ap,
3862
- go as aq,
3863
- vo as ar,
3864
- bo as as,
3865
- Xe as at,
3866
- ro as au,
3867
- pr as av,
3868
- fr as aw,
3869
- kr as ax,
3870
- ar as b,
3871
- nr as c,
3872
- co as d,
3873
- Yn as e,
3874
- ir as f,
3875
- mo as g,
3876
- Qn as h,
3877
- Ce as i,
3878
- Zn as j,
3879
- or as k,
3880
- Jn as l,
3881
- ze as m,
3860
+ oo as Z,
3861
+ mo as _,
3862
+ yo as a,
3863
+ uo as a0,
3864
+ so as a1,
3865
+ _r as a2,
3866
+ po as a3,
3867
+ Jt as a4,
3868
+ nr as a5,
3869
+ Ne as a6,
3870
+ Zn as a7,
3871
+ lo as a8,
3872
+ Kt as a9,
3873
+ se as aa,
3874
+ Rr as ab,
3875
+ de as ac,
3876
+ ne as ad,
3877
+ y as ae,
3878
+ R as af,
3879
+ Ar as ag,
3880
+ Pr as ah,
3881
+ go as ai,
3882
+ ee as aj,
3883
+ tn as ak,
3884
+ vo as al,
3885
+ Xe as am,
3886
+ bo as an,
3887
+ Ie as ao,
3888
+ Io as ap,
3889
+ wo as aq,
3890
+ Co as ar,
3891
+ To as as,
3892
+ xo as at,
3893
+ et as au,
3894
+ io as av,
3895
+ vr as aw,
3896
+ gr as ax,
3897
+ Fr as ay,
3898
+ sr as b,
3899
+ cr as c,
3900
+ fo as d,
3901
+ Xn as e,
3902
+ dr as f,
3903
+ ho as g,
3904
+ to as h,
3905
+ xe as i,
3906
+ eo as j,
3907
+ lr as k,
3908
+ ro as l,
3909
+ Le as m,
3882
3910
  W as n,
3883
- Hn as o,
3884
- pe as p,
3885
- Wn as q,
3886
- cr as r,
3887
- Ot as s,
3888
- An as t,
3889
- On as u,
3890
- Kt as v,
3891
- Dn as w,
3892
- Un as x,
3893
- Mn as y,
3894
- Me as z
3911
+ Qn as o,
3912
+ he as p,
3913
+ Jn as q,
3914
+ mr as r,
3915
+ Lt as s,
3916
+ Dn as t,
3917
+ Ln as u,
3918
+ Vt as v,
3919
+ zn as w,
3920
+ Yn as x,
3921
+ Kn as y,
3922
+ Be as z
3895
3923
  };