react-semaphor 0.1.560 → 0.1.562

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 (168) hide show
  1. package/dist/analytics-protocol/index.js +450 -423
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +9 -9
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{analytics-base-schemas-CHLxsPfX.js → analytics-base-schemas-BaIQrEzX.js} +221 -188
  7. package/dist/chunks/{assistant-chat-Bu2fFm_I.js → assistant-chat-R_yT8xH4.js} +116 -117
  8. package/dist/chunks/bookmark-impact-D4Kl4amw.js +75 -0
  9. package/dist/chunks/bookmark-state-CWeoGbrx.js +743 -0
  10. package/dist/chunks/{braces-Da41xfUd.js → braces-DzgoQC64.js} +1 -1
  11. package/dist/chunks/{comparison-window-caption-4FNkMrzE.js → comparison-window-caption-D1EUXzaR.js} +550 -425
  12. package/dist/chunks/{context-BgPDzLHZ.js → context-R31TSL5V.js} +1 -1
  13. package/dist/chunks/{dashboard-_MeBuy67.js → dashboard-Bp1y5oun.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-CEi4Pr_v.js → dashboard-briefing-launcher-S5FB3aUW.js} +236 -236
  15. package/dist/chunks/dashboard-controls-CfC_6Ztn.js +2277 -0
  16. package/dist/chunks/{dashboard-json-B1mU_OMa.js → dashboard-json-gYZT7ZQY.js} +5 -5
  17. package/dist/chunks/dates-DFY7Gfss.js +91 -0
  18. package/dist/chunks/{edit-dashboard-visual-0CJN31Y3.js → edit-dashboard-visual-u7OI_g8Q.js} +7119 -7198
  19. package/dist/chunks/filter-reach-copy-CvV7W5dd.js +3965 -0
  20. package/dist/chunks/{filter-value-text-CRC-K_l_.js → filter-value-text-CPwFkrMz.js} +11 -10
  21. package/dist/chunks/global-date-filter-utils-N1kcsOFE.js +16722 -0
  22. package/dist/chunks/{index-DtHidOPV.js → index-CNGkfUp4.js} +269 -264
  23. package/dist/chunks/{layout-grid-BvsH4RY2.js → layout-grid-BM65viQh.js} +1 -1
  24. package/dist/chunks/{list-filter-Dg0otx5E.js → list-filter-BoeLBfL3.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-CM18W8w6.js → matrix-analytical-definition-hEucouWM.js} +4 -4
  26. package/dist/chunks/{matrix-card-HPskLaPy.js → matrix-card-CCh9JjP1.js} +3 -3
  27. package/dist/chunks/{matrix-member-presentation-Bbrfrke4.js → matrix-member-presentation-DsAUbuoL.js} +1 -1
  28. package/dist/chunks/{matrix-operation-contract-WPv4R-H_.js → matrix-operation-contract-DsLdFdSa.js} +365 -349
  29. package/dist/chunks/{metric-comparison-ljMKYZKa.js → metric-comparison-Bnso1cm1.js} +6 -6
  30. package/dist/chunks/{model-change-Ccn1zaxl.js → model-change-T1cRkh3m.js} +1 -1
  31. package/dist/chunks/{palette-Bsh376zO.js → palette-p1XSJFgB.js} +1 -1
  32. package/dist/chunks/pivot-result-contract-expectations-B53jqszr.js +56 -0
  33. package/dist/chunks/{pivot-result-identity-vS9TSh4f.js → pivot-result-identity-Dq5jm-EC.js} +1 -1
  34. package/dist/chunks/{zoned-wall-clock-B1n_WjW3.js → raw-temporal-value-Bqz8wc7L.js} +97 -46
  35. package/dist/chunks/{report-preferences-dialog-BV8L0SeS.js → report-preferences-dialog-C4RAR8u5.js} +68 -63
  36. package/dist/chunks/{report-runtime-context-BZQh9ywy.js → report-runtime-context-BITkNSDa.js} +2 -2
  37. package/dist/chunks/resolve-dashboard-input-context-DaDrZGuA.js +8214 -0
  38. package/dist/chunks/{save-B5EAsgQF.js → save-CHV1B1fL.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-n2Wn11cV.js → saved-dashboard-context-DFYBrE6O.js} +93 -94
  40. package/dist/chunks/{selection-filter-compiler-BKXmyLrS.js → selection-filter-compiler-CUDRnUxc.js} +19 -18
  41. package/dist/chunks/{selection-reducer-D0YnaAD9.js → selection-reducer-Bz5aywT4.js} +1 -1
  42. package/dist/chunks/{semaphor-ready-indicator-XLBLOJ2V.js → semaphor-ready-indicator-Cfuafnem.js} +38188 -40344
  43. package/dist/chunks/{shelf-drop-preview-context-DHMa54a-.js → shelf-drop-preview-context-BR2GEYog.js} +81 -82
  44. package/dist/chunks/{source-entity-resolution-dUG5VWRm.js → source-entity-resolution-DdDVXFB8.js} +6 -6
  45. package/dist/chunks/{switch-ByxH4M7t.js → switch-BW4yXSYs.js} +3 -3
  46. package/dist/chunks/{table-export-sheet-C_GdeTYU.js → table-export-sheet-bSXxGn-v.js} +1 -1
  47. package/dist/chunks/temporal-input-presentation-sk9gqLi6.js +4960 -0
  48. package/dist/chunks/{token-types-CQtXUVMy.js → token-types-BUK06hU2.js} +1 -1
  49. package/dist/chunks/{upload-wbR-NVzq.js → upload-BnmuyPqW.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-CEBaLOKC.js → use-create-flow-overlay-state-DyzhWvRJ.js} +6 -6
  51. package/dist/chunks/{validators-CXTneCA4.js → validators-BIM0FE31.js} +774 -895
  52. package/dist/dashboard/index.js +2 -2
  53. package/dist/dashboard-authoring/index.js +2477 -2685
  54. package/dist/data-app-sdk/index.js +30 -30
  55. package/dist/data-app-sdk-adapters/index.js +3 -3
  56. package/dist/data-app-sdk-validation/index.js +25 -25
  57. package/dist/format-utils/index.js +274 -267
  58. package/dist/index.js +59 -59
  59. package/dist/report-runtime-context/index.js +2 -2
  60. package/dist/style.css +1 -1
  61. package/dist/surfboard/index.js +2 -2
  62. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  63. package/dist/types/components/dashboard/dashboard-create-dialog.d.ts +23 -0
  64. package/dist/types/components/dashboard/summary-number-formatter.d.ts +6 -0
  65. package/dist/types/components/index.d.ts +1 -2
  66. package/dist/types/components/surfboard/filter/types.d.ts +3 -1
  67. package/dist/types/index.js +50 -51
  68. package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
  69. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +59 -2
  70. package/dist/types/lib/interactions/get-click-context-from-matrix.d.ts +5 -0
  71. package/dist/types/lib/interactions/get-click-context-from-table.d.ts +45 -0
  72. package/dist/types/lib/print/print-inputs.d.ts +2 -1
  73. package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -0
  74. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +5 -0
  75. package/dist/types/lib/selection/selection-from-click-context.d.ts +41 -0
  76. package/dist/types/lib/stores/editor-store.d.ts +9 -1
  77. package/dist/types/lib/stores/table-actions.d.ts +0 -2
  78. package/dist/types/lib/types/common-types.d.ts +6 -0
  79. package/dist/types/lib/types/explorer-types.d.ts +7 -1
  80. package/dist/types/lib/types/interaction-types.d.ts +3 -1
  81. package/dist/types/lib/types/token-types.d.ts +0 -1
  82. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +13 -1
  83. package/dist/types/shared/analytics-protocol/contracts.d.ts +9 -40
  84. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
  85. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +12 -2
  86. package/dist/types/shared/analytics-protocol/validators.d.ts +1 -2
  87. package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
  88. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +7 -1
  89. package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
  90. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +76 -0
  91. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
  92. package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
  93. package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
  94. package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
  95. package/dist/types/shared/dashboard-authoring/card-settings/column-polarity-write.d.ts +5 -0
  96. package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
  97. package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
  98. package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
  99. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +17 -0
  100. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +117 -0
  101. package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
  102. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
  103. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
  104. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +51 -0
  105. package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +30 -0
  106. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
  107. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
  108. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +3402 -4313
  109. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +49 -8
  110. package/dist/types/shared/dashboard-authoring/changes/field-ref.d.ts +91 -0
  111. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +7 -0
  112. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +52 -2
  113. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-create.d.ts +26 -0
  114. package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +2 -1
  115. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +1 -8
  116. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +20 -20
  117. package/dist/types/shared/dashboard-authoring/detail-date-presentation.d.ts +9 -0
  118. package/dist/types/shared/dashboard-authoring/index.d.ts +11 -6
  119. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
  120. package/dist/types/shared/dashboard-authoring/measure-calculations/apply.d.ts +8 -0
  121. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +16 -0
  122. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +41 -0
  123. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +17 -0
  124. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +63 -0
  125. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +16 -0
  126. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +79 -0
  127. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +934 -0
  128. package/dist/types/shared/dashboard-authoring/measure-calculations/sentences.d.ts +4 -0
  129. package/dist/types/shared/dashboard-authoring/measure-calculations/set.d.ts +11 -0
  130. package/dist/types/shared/dashboard-authoring/measure-calculations/transform.d.ts +63 -0
  131. package/dist/types/shared/dashboard-authoring/measure-calculations/window-transforms.d.ts +60 -0
  132. package/dist/types/shared/dashboard-authoring/new-card.d.ts +12 -1
  133. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +2 -1
  134. package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +46 -0
  135. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +73 -3
  136. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +21 -3
  137. package/dist/types/shared/dashboard-authoring/text-card-words/blocks.d.ts +58 -0
  138. package/dist/types/shared/dashboard-authoring/text-card-words/index.d.ts +55 -0
  139. package/dist/types/shared/dashboard-authoring/text-card-words/rich-content.d.ts +18 -0
  140. package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
  141. package/dist/types/shared/format-utils/document-print.d.ts +82 -0
  142. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +8 -1
  143. package/dist/types/shared/format-utils/index.d.ts +1 -0
  144. package/dist/types/shared/format-utils/raw-temporal.d.ts +18 -7
  145. package/dist/types/shared/temporal/index.d.ts +1 -0
  146. package/dist/types/shared/temporal/raw-temporal-equality.d.ts +19 -0
  147. package/dist/types/shared/temporal/raw-temporal-value.d.ts +29 -0
  148. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +6 -0
  149. package/package.json +2 -2
  150. package/dist/chunks/bookmark-state-BFY9oNmr.js +0 -111
  151. package/dist/chunks/custom-visual-inputs-Dz-enUNR.js +0 -292
  152. package/dist/chunks/dashboard-controls-Bi7fyG-4.js +0 -2339
  153. package/dist/chunks/document-dashboard-inputs-CkWfDB8c.js +0 -3010
  154. package/dist/chunks/filter-reach-copy-BF4w4kI2.js +0 -3738
  155. package/dist/chunks/global-date-filter-utils-D8365uPH.js +0 -12889
  156. package/dist/chunks/pivot-result-contract-expectations-Bl5suy4-.js +0 -1832
  157. package/dist/chunks/raw-temporal-presentation-BHm7s-hz.js +0 -540
  158. package/dist/chunks/resolve-dashboard-input-context-CAMiWvyR.js +0 -5280
  159. package/dist/chunks/table-settings-Imz0FgWi.js +0 -637
  160. package/dist/chunks/temporal-input-presentation-uvNK_tM0.js +0 -3228
  161. package/dist/types/components/dashboard/ai-dashboard-create-dialog.d.ts +0 -38
  162. package/dist/types/components/dashboard/dashboard-create-template.d.ts +0 -10
  163. package/dist/types/lib/hooks/use-dashboard-authoring.d.ts +0 -49
  164. package/dist/types/shared/dashboard-authoring/artifact-compiler.d.ts +0 -6
  165. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -106
  166. package/dist/types/shared/dashboard-authoring/protocol-adapter.d.ts +0 -7
  167. package/dist/types/shared/dashboard-authoring/source-matching.d.ts +0 -34
  168. package/dist/types/shared/dashboard-authoring/validators.d.ts +0 -2
@@ -1,16 +1,16 @@
1
1
  import { z as e } from "zod";
2
- const E = [
2
+ const Z = [
3
3
  "missing_dependency",
4
4
  "missing_relationship",
5
5
  "population_required",
6
6
  "ambiguous_relationship"
7
7
  ];
8
- function _e(t) {
9
- return E.includes(
8
+ function ve(t) {
9
+ return Z.includes(
10
10
  t
11
11
  );
12
12
  }
13
- const ve = 200, D = [
13
+ const Te = 200, D = [
14
14
  "second",
15
15
  "minute",
16
16
  "hour",
@@ -20,10 +20,10 @@ const ve = 200, D = [
20
20
  "quarter",
21
21
  "year"
22
22
  ];
23
- function Re(t) {
23
+ function ke(t) {
24
24
  return typeof t == "string" && D.includes(t);
25
25
  }
26
- const N = [
26
+ const B = [
27
27
  "week_of_short",
28
28
  "week_of_long",
29
29
  "quarter_short",
@@ -35,28 +35,28 @@ const N = [
35
35
  "long",
36
36
  "numeric",
37
37
  "iso"
38
- ], ke = {
38
+ ], Re = {
39
39
  invalidMetadata: "invalid_raw_temporal_metadata"
40
40
  };
41
- function U(t) {
41
+ function z(t) {
42
42
  return t === "second" || t === "minute" || t === "hour" ? "datetime" : "date";
43
43
  }
44
- const xe = {
44
+ const Ie = {
45
45
  missingMetadata: "missing_temporal_bucket_metadata",
46
46
  invalidMetadata: "invalid_temporal_bucket_metadata",
47
47
  invalidValue: "invalid_temporal_bucket_value"
48
- }, Ie = "__auto_count__";
49
- function V(t) {
48
+ }, xe = "__auto_count__";
49
+ function j(t) {
50
50
  try {
51
51
  return new Intl.DateTimeFormat("en-US", { timeZone: t }).format(), !0;
52
52
  } catch {
53
53
  return !1;
54
54
  }
55
55
  }
56
- const q = 20;
56
+ const G = 20;
57
57
  function d(t) {
58
58
  if (!(typeof t != "number" || !Number.isFinite(t)))
59
- return Math.max(0, Math.min(q, Math.trunc(t)));
59
+ return Math.max(0, Math.min(G, Math.trunc(t)));
60
60
  }
61
61
  function s(t) {
62
62
  return typeof t == "string" ? t : void 0;
@@ -67,12 +67,12 @@ function S(t) {
67
67
  function _(t) {
68
68
  return typeof t == "boolean" ? t : void 0;
69
69
  }
70
- function P(t) {
70
+ function L(t) {
71
71
  if (typeof t != "string") return;
72
72
  const a = t.trim().toUpperCase();
73
73
  return /^[A-Z]{3}$/.test(a) ? a : void 0;
74
74
  }
75
- function B(t) {
75
+ function $(t) {
76
76
  return typeof t == "number" && Number.isFinite(t) ? t : void 0;
77
77
  }
78
78
  function c(t) {
@@ -80,22 +80,22 @@ function c(t) {
80
80
  Object.entries(t).filter(([, a]) => a !== void 0)
81
81
  );
82
82
  }
83
- const Z = /* @__PURE__ */ new Set(["number", "currency", "percent", "percentage", "scientific"]), G = /* @__PURE__ */ new Set(["millisecond", "second", "minute", "hour", "day"]);
83
+ const H = /* @__PURE__ */ new Set(["number", "currency", "percent", "percentage", "scientific"]), K = /* @__PURE__ */ new Set(["millisecond", "second", "minute", "hour", "day"]);
84
84
  function v(t) {
85
- return typeof t == "string" && G.has(t) ? t : void 0;
85
+ return typeof t == "string" && K.has(t) ? t : void 0;
86
86
  }
87
- function z(t) {
87
+ function W(t) {
88
88
  const a = t.percentValueMode ?? "fraction";
89
89
  if (t.scale === 1 && a === "whole") {
90
- const { scale: n, ...f } = t;
91
- return { ...f, percentValueMode: "whole" };
90
+ const { scale: i, ...b } = t;
91
+ return { ...b, percentValueMode: "whole" };
92
92
  }
93
- const o = t.minimumFractionDigits ?? (t.maximumFractionDigits === void 0 ? 1 : 0), i = t.maximumFractionDigits ?? Math.max(o, 1);
93
+ const n = t.minimumFractionDigits ?? (t.maximumFractionDigits === void 0 ? 1 : 0), o = t.maximumFractionDigits ?? Math.max(n, 1);
94
94
  return c({
95
95
  type: "number",
96
96
  scale: a === "whole" ? t.scale : t.scale * 100,
97
- minimumFractionDigits: o,
98
- maximumFractionDigits: i,
97
+ minimumFractionDigits: n,
98
+ maximumFractionDigits: o,
99
99
  useGrouping: t.useGrouping,
100
100
  prefix: t.prefix,
101
101
  suffix: `%${t.suffix ?? ""}`,
@@ -103,44 +103,44 @@ function z(t) {
103
103
  signDisplay: t.signDisplay
104
104
  });
105
105
  }
106
- function L(t) {
106
+ function X(t) {
107
107
  const a = t.type === "percentage" ? "percent" : t.type;
108
- let o = d(t.minimumFractionDigits), i = d(t.maximumFractionDigits);
109
- const n = d(t.decimals);
110
- o === void 0 && i === void 0 && n !== void 0 && (o = n, i = n), o !== void 0 && i !== void 0 && o > i && ([o, i] = [i, o]);
111
- const f = t.negativeStyle === "parentheses" || t.negativeStyle === "minus" ? t.negativeStyle : void 0, O = t.signDisplay === "auto" || t.signDisplay === "always" || t.signDisplay === "exceptZero" || t.signDisplay === "never" ? t.signDisplay : void 0, m = c({
108
+ let n = d(t.minimumFractionDigits), o = d(t.maximumFractionDigits);
109
+ const i = d(t.decimals);
110
+ n === void 0 && o === void 0 && i !== void 0 && (n = i, o = i), n !== void 0 && o !== void 0 && n > o && ([n, o] = [o, n]);
111
+ const b = t.negativeStyle === "parentheses" || t.negativeStyle === "minus" ? t.negativeStyle : void 0, P = t.signDisplay === "auto" || t.signDisplay === "always" || t.signDisplay === "exceptZero" || t.signDisplay === "never" ? t.signDisplay : void 0, m = c({
112
112
  type: a,
113
- currency: a === "currency" ? P(t.currency) : void 0,
114
- minimumFractionDigits: o,
115
- maximumFractionDigits: i,
113
+ currency: a === "currency" ? L(t.currency) : void 0,
114
+ minimumFractionDigits: n,
115
+ maximumFractionDigits: o,
116
116
  useGrouping: _(t.useGrouping) ?? _(t.thousandsSeparator),
117
117
  prefix: s(t.prefix),
118
118
  // Intl adds the % of a percent; a stored '%' suffix on one is the same sign.
119
119
  suffix: a === "percent" && t.suffix === "%" ? void 0 : s(t.suffix),
120
- negativeStyle: f,
120
+ negativeStyle: b,
121
121
  compact: _(t.compact),
122
- scale: B(t.scale),
122
+ scale: $(t.scale),
123
123
  percentValueMode: a === "percent" ? t.percentValueMode === "whole" ? "whole" : "fraction" : void 0,
124
- signDisplay: O
124
+ signDisplay: P
125
125
  });
126
- return m.type === "percent" && m.scale !== void 0 ? z(m) : m;
126
+ return m.type === "percent" && m.scale !== void 0 ? W(m) : m;
127
127
  }
128
- function $(t) {
128
+ function Y(t) {
129
129
  if (!t || typeof t != "object" || Array.isArray(t)) return;
130
130
  const a = t;
131
131
  if (a.type === "temporal_bucket") {
132
- const o = a.presentation;
133
- return o && typeof o == "object" && !Array.isArray(o) ? { type: "temporal_bucket", presentation: o } : void 0;
132
+ const n = a.presentation;
133
+ return n && typeof n == "object" && !Array.isArray(n) ? { type: "temporal_bucket", presentation: n } : void 0;
134
134
  }
135
- if (typeof a.type == "string" && Z.has(a.type))
136
- return L(a);
135
+ if (typeof a.type == "string" && H.has(a.type))
136
+ return X(a);
137
137
  if (a.type === "date" || a.type === "datetime") {
138
- const o = S(a.pattern), i = a.preset === "short" || a.preset === "long" || a.preset === "numeric" || a.preset === "iso" ? a.preset : void 0, n = o && (a.dialect === "date_fns" || a.dialect === "semaphor_tokens") ? a.dialect : void 0;
138
+ const n = S(a.pattern), o = a.preset === "short" || a.preset === "long" || a.preset === "numeric" || a.preset === "iso" ? a.preset : void 0, i = n && (a.dialect === "date_fns" || a.dialect === "semaphor_tokens") ? a.dialect : void 0;
139
139
  return c({
140
140
  type: "date",
141
- pattern: o,
142
- dialect: n,
143
- preset: o ? void 0 : i,
141
+ pattern: n,
142
+ dialect: i,
143
+ preset: n ? void 0 : o,
144
144
  relative: a.relative === !0 ? !0 : void 0,
145
145
  timezone: S(a.timezone),
146
146
  sourceTimezone: S(a.sourceTimezone),
@@ -149,14 +149,14 @@ function $(t) {
149
149
  });
150
150
  }
151
151
  if (a.type === "duration") {
152
- const o = d(a.maxUnits);
152
+ const n = d(a.maxUnits);
153
153
  return c({
154
154
  type: "duration",
155
155
  inputUnit: v(a.inputUnit),
156
156
  outputStyle: a.outputStyle === "compact" || a.outputStyle === "digital" || a.outputStyle === "long" ? a.outputStyle : void 0,
157
157
  largestUnit: v(a.largestUnit),
158
158
  smallestUnit: v(a.smallestUnit),
159
- maxUnits: o === void 0 ? void 0 : Math.min(o, 10),
159
+ maxUnits: n === void 0 ? void 0 : Math.min(n, 10),
160
160
  prefix: s(a.prefix),
161
161
  suffix: s(a.suffix),
162
162
  negativeStyle: a.negativeStyle === "parentheses" || a.negativeStyle === "minus" ? a.negativeStyle : void 0
@@ -165,7 +165,7 @@ function $(t) {
165
165
  if (a.type === "string")
166
166
  return c({ type: "string", prefix: s(a.prefix), suffix: s(a.suffix) });
167
167
  }
168
- const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
168
+ const J = e.record(e.string(), e.unknown()), p = e.array(J), u = e.enum([
169
169
  "SUM",
170
170
  "COUNT",
171
171
  "AVG",
@@ -184,7 +184,7 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
184
184
  "duckdb",
185
185
  "sqlite",
186
186
  "unknown"
187
- ]), K = e.enum(D), h = e.enum([
187
+ ]), Q = e.enum(D), h = e.enum([
188
188
  "dimension",
189
189
  "measure",
190
190
  "date",
@@ -197,27 +197,27 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
197
197
  "date",
198
198
  "datetime",
199
199
  "unknown"
200
- ]), R = e.union([e.number(), e.string(), e.null()]), k = e.enum([
200
+ ]), T = e.union([e.number(), e.string(), e.null()]), k = e.enum([
201
201
  "millisecond",
202
202
  "second",
203
203
  "minute",
204
204
  "hour",
205
205
  "day"
206
- ]), W = e.enum(N), X = e.discriminatedUnion("mode", [
206
+ ]), ee = e.enum(B), te = e.discriminatedUnion("mode", [
207
207
  e.object({ mode: e.literal("auto") }).strict(),
208
208
  e.object({
209
209
  mode: e.literal("preset"),
210
- preset: W
210
+ preset: ee
211
211
  }).strict(),
212
212
  e.object({
213
213
  mode: e.literal("pattern"),
214
214
  pattern: e.string().min(1)
215
215
  }).strict()
216
- ]), Y = e.object({
216
+ ]), w = e.object({
217
217
  type: e.literal("temporal_bucket"),
218
- presentation: X
219
- }).strict(), J = e.object({
220
- tz: e.string().min(1).refine(V, {
218
+ presentation: te
219
+ }).strict(), ae = e.object({
220
+ tz: e.string().min(1).refine(j, {
221
221
  message: "tz must be a valid IANA timezone"
222
222
  }),
223
223
  weekStart: e.number().int().min(0).max(6),
@@ -225,14 +225,18 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
225
225
  kind: e.literal("month_aligned"),
226
226
  yearStartMonth: e.number().int().min(1).max(12)
227
227
  }).strict().optional()
228
- }).strict(), x = e.object({
228
+ }).strict(), R = e.object({
229
229
  kind: e.literal("temporal_bucket"),
230
- granularity: K,
231
- calendar: J
232
- }).strict(), Q = e.object({
230
+ granularity: Q,
231
+ calendar: ae
232
+ }).strict(), ne = e.object({
233
233
  kind: e.literal("raw_temporal"),
234
234
  valueKind: e.enum(["date", "wall_datetime", "instant"])
235
- }).strict(), r = e.string(), I = e.number().int().min(0).max(20), ee = e.object({
235
+ }).strict(), De = e.object({
236
+ kind: e.literal("raw_temporal"),
237
+ valueKind: e.enum(["date", "wall_datetime", "instant"]),
238
+ tz: e.string().min(1).refine(j, "tz must be an IANA timezone.")
239
+ }).strict(), r = e.string(), I = e.number().int().min(0).max(20), F = e.object({
236
240
  type: e.enum(["number", "currency", "percent", "scientific"]),
237
241
  currency: e.string().regex(/^[A-Z]{3}$/, "Expected an ISO 4217 currency code.").optional(),
238
242
  minimumFractionDigits: I.optional(),
@@ -246,8 +250,8 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
246
250
  percentValueMode: e.enum(["fraction", "whole"]).optional(),
247
251
  signDisplay: e.enum(["auto", "always", "exceptZero", "never"]).optional()
248
252
  }).strict().superRefine((t, a) => {
249
- const { minimumFractionDigits: o, maximumFractionDigits: i } = t;
250
- o !== void 0 && i !== void 0 && o > i && a.addIssue({
253
+ const { minimumFractionDigits: n, maximumFractionDigits: o } = t;
254
+ n !== void 0 && o !== void 0 && n > o && a.addIssue({
251
255
  code: e.ZodIssueCode.custom,
252
256
  path: ["minimumFractionDigits"],
253
257
  message: "minimumFractionDigits must not exceed maximumFractionDigits."
@@ -268,11 +272,11 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
268
272
  path: ["percentValueMode"],
269
273
  message: "Only a percent format has percentValueMode."
270
274
  });
271
- }), te = ["short", "long", "numeric", "iso"], ae = e.object({
275
+ }), oe = ["short", "long", "numeric", "iso"], A = e.object({
272
276
  type: e.literal("date"),
273
277
  pattern: e.string().min(1).optional(),
274
278
  dialect: e.enum(["semaphor_tokens", "date_fns"]).optional(),
275
- preset: e.enum(te).optional(),
279
+ preset: e.enum(oe).optional(),
276
280
  relative: e.boolean().optional(),
277
281
  timezone: e.string().min(1).optional(),
278
282
  sourceTimezone: e.string().min(1).optional(),
@@ -288,7 +292,7 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
288
292
  path: ["dialect"],
289
293
  message: "dialect names the token set of a pattern."
290
294
  });
291
- }), oe = e.object({
295
+ }), M = e.object({
292
296
  type: e.literal("duration"),
293
297
  inputUnit: k.optional(),
294
298
  outputStyle: e.enum(["compact", "digital", "long"]).optional(),
@@ -298,16 +302,16 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
298
302
  prefix: r.optional(),
299
303
  suffix: r.optional(),
300
304
  negativeStyle: e.enum(["minus", "parentheses"]).optional()
301
- }).strict(), ie = e.object({
305
+ }).strict(), C = e.object({
302
306
  type: e.literal("string"),
303
307
  prefix: r.optional(),
304
308
  suffix: r.optional()
305
- }).strict(), j = e.union([
306
- ee,
307
- ae,
308
- oe,
309
- ie
310
- ]), ne = e.unknown().superRefine((t, a) => {
309
+ }).strict(), O = e.union([
310
+ F,
311
+ A,
312
+ M,
313
+ C
314
+ ]), ie = e.unknown().superRefine((t, a) => {
311
315
  t && typeof t == "object" && "locale" in t && ["number", "currency", "percent", "percentage", "scientific"].includes(
312
316
  String(t.type)
313
317
  ) && a.addIssue({
@@ -315,28 +319,53 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
315
319
  path: ["locale"],
316
320
  message: "Numeric semantic formats inherit locale from viewer preferences."
317
321
  });
318
- }).transform((t) => $(t) ?? t).pipe(j), Te = e.union([
319
- j,
320
- Y
321
- ]);
322
- function se(t, a) {
323
- return e.object(t).passthrough().superRefine((o, i) => {
324
- for (const n of a)
325
- Object.prototype.hasOwnProperty.call(o, n) || i.addIssue({
322
+ }).transform((t) => Y(t) ?? t).pipe(O), je = e.union([
323
+ O,
324
+ w
325
+ ]), we = ["number", "currency", "percent", "scientific", "duration", "date", "string", "temporal_bucket"];
326
+ function se(t) {
327
+ switch (t) {
328
+ case "number":
329
+ case "currency":
330
+ case "percent":
331
+ case "scientific":
332
+ return F;
333
+ case "date":
334
+ return A;
335
+ case "duration":
336
+ return M;
337
+ case "string":
338
+ return C;
339
+ case "temporal_bucket":
340
+ return w;
341
+ default:
342
+ return;
343
+ }
344
+ }
345
+ function Fe(t) {
346
+ let a = se(t);
347
+ for (; a && !(a instanceof e.ZodObject); )
348
+ a = a instanceof e.ZodEffects ? a.innerType() : void 0;
349
+ return a ? Object.keys(a.shape) : void 0;
350
+ }
351
+ function re(t, a) {
352
+ return e.object(t).passthrough().superRefine((n, o) => {
353
+ for (const i of a)
354
+ Object.prototype.hasOwnProperty.call(n, i) || o.addIssue({
326
355
  code: "custom",
327
- path: [n],
328
- message: `Required field "${n}" is missing.`
356
+ path: [i],
357
+ message: `Required field "${i}" is missing.`
329
358
  });
330
359
  });
331
360
  }
332
- const w = e.object({
361
+ const E = e.object({
333
362
  kind: e.literal("semantic"),
334
363
  domainId: e.string(),
335
364
  datasetName: e.string(),
336
365
  datasetId: e.string().optional(),
337
366
  label: e.string().optional(),
338
367
  connectionId: e.string().optional()
339
- }).passthrough(), re = e.object({
368
+ }).passthrough(), ce = e.object({
340
369
  kind: e.literal("physical"),
341
370
  connectionId: e.string(),
342
371
  connectionType: e.string().optional(),
@@ -345,27 +374,27 @@ const w = e.object({
345
374
  schemaName: e.string().optional(),
346
375
  label: e.string().optional(),
347
376
  dialect: g.optional()
348
- }).passthrough(), ce = e.object({
377
+ }).passthrough(), le = e.object({
349
378
  kind: e.literal("sql"),
350
379
  connectionId: e.string(),
351
380
  dialect: g.optional(),
352
381
  label: e.string().optional()
353
- }).passthrough(), F = e.union([
354
- w,
355
- re,
356
- ce
357
- ]), le = e.object({
382
+ }).passthrough(), N = e.union([
383
+ E,
384
+ ce,
385
+ le
386
+ ]), pe = e.object({
358
387
  name: e.string(),
359
388
  label: e.string().optional(),
360
389
  role: h.optional(),
361
390
  dataType: y.optional(),
362
- source: F.optional(),
391
+ source: N.optional(),
363
392
  aggregate: u.optional()
364
- }).passthrough(), C = le, pe = e.object({
393
+ }).passthrough(), V = pe, ue = e.object({
365
394
  kind: e.literal("field"),
366
- field: C,
395
+ field: V,
367
396
  aggregate: u.optional()
368
- }).passthrough(), ue = e.object({
397
+ }).passthrough(), me = e.object({
369
398
  kind: e.literal("derived_field"),
370
399
  name: e.string(),
371
400
  label: e.string(),
@@ -375,7 +404,7 @@ const w = e.object({
375
404
  computeStage: e.enum(["row", "aggregate"]),
376
405
  expression: e.string(),
377
406
  expressionLanguage: e.literal("semaphor_sql_template").optional(),
378
- inputs: e.record(pe),
407
+ inputs: e.record(ue),
379
408
  defaultAggregate: u.optional(),
380
409
  aggregationBehavior: e.enum([
381
410
  "additive",
@@ -391,13 +420,13 @@ const w = e.object({
391
420
  "aggregate_then_join",
392
421
  "weighted"
393
422
  ]).optional(),
394
- format: ne.optional(),
423
+ format: ie.optional(),
395
424
  tags: e.array(e.string()).optional()
396
- }).passthrough(), M = ue, De = C.and(
425
+ }).passthrough(), U = me, Ae = V.and(
397
426
  e.object({
398
- derivedField: M.optional()
427
+ derivedField: U.optional()
399
428
  }).passthrough()
400
- ), me = w, de = e.object({
429
+ ), de = E, ge = e.object({
401
430
  kind: e.literal("physical"),
402
431
  connectionId: e.string().optional(),
403
432
  connectionType: e.string().optional(),
@@ -406,22 +435,22 @@ const w = e.object({
406
435
  schemaName: e.string().optional(),
407
436
  label: e.string().optional(),
408
437
  dialect: g.optional()
409
- }).passthrough(), ge = e.object({
438
+ }).passthrough(), he = e.object({
410
439
  kind: e.literal("sql"),
411
440
  connectionId: e.string().optional(),
412
441
  dialect: g.optional(),
413
442
  label: e.string().optional()
414
- }).passthrough(), he = e.union([
415
- me,
443
+ }).passthrough(), ye = e.union([
416
444
  de,
417
- ge
418
- ]), je = e.object({
445
+ ge,
446
+ he
447
+ ]), Me = e.object({
419
448
  key: e.string().optional(),
420
449
  name: e.string(),
421
450
  label: e.string().optional(),
422
451
  role: h.optional(),
423
452
  dataType: y.optional(),
424
- source: he.optional(),
453
+ source: ye.optional(),
425
454
  aggregate: u.optional(),
426
455
  derivedField: e.never().optional()
427
456
  }).passthrough(), l = e.object({
@@ -431,10 +460,10 @@ const w = e.object({
431
460
  role: h.optional(),
432
461
  dataType: y.optional(),
433
462
  aggregate: u.optional(),
434
- source: F.optional(),
435
- derivedField: M.optional(),
436
- temporalBucket: x.optional(),
437
- rawTemporal: Q.optional(),
463
+ source: N.optional(),
464
+ derivedField: U.optional(),
465
+ temporalBucket: R.optional(),
466
+ rawTemporal: ne.optional(),
438
467
  pivotIdentity: e.object({
439
468
  metricId: e.string().min(1),
440
469
  metricAlias: e.string().min(1),
@@ -442,7 +471,7 @@ const w = e.object({
442
471
  e.object({
443
472
  fieldId: e.string().min(1),
444
473
  value: e.string().nullable(),
445
- temporalBucket: x.optional()
474
+ temporalBucket: R.optional()
446
475
  }).strict()
447
476
  )
448
477
  }).strict().optional()
@@ -452,30 +481,30 @@ const w = e.object({
452
481
  path: ["rawTemporal"],
453
482
  message: "A result column cannot carry both temporalBucket and rawTemporal metadata."
454
483
  }), t.temporalBucket) {
455
- const o = U(
484
+ const n = z(
456
485
  t.temporalBucket.granularity
457
486
  );
458
- t.dataType !== o && a.addIssue({
487
+ t.dataType !== n && a.addIssue({
459
488
  code: e.ZodIssueCode.custom,
460
489
  path: ["dataType"],
461
- message: `${t.temporalBucket.granularity} temporal buckets require dataType ${o}.`
490
+ message: `${t.temporalBucket.granularity} temporal buckets require dataType ${n}.`
462
491
  });
463
492
  }
464
493
  if (t.rawTemporal) {
465
- const o = t.rawTemporal.valueKind === "date" ? "date" : "datetime";
466
- t.dataType !== o && a.addIssue({
494
+ const n = t.rawTemporal.valueKind === "date" ? "date" : "datetime";
495
+ t.dataType !== n && a.addIssue({
467
496
  code: e.ZodIssueCode.custom,
468
497
  path: ["dataType"],
469
- message: `${t.rawTemporal.valueKind} raw temporal values require dataType ${o}.`
498
+ message: `${t.rawTemporal.valueKind} raw temporal values require dataType ${n}.`
470
499
  });
471
500
  }
472
- }), we = e.object({
501
+ }), Ce = e.object({
473
502
  records: p,
474
503
  columns: e.array(l).optional()
475
- }).passthrough(), Fe = e.object({
504
+ }).passthrough(), Oe = e.object({
476
505
  records: p,
477
506
  columns: e.array(l)
478
- }).passthrough(), A = e.object({
507
+ }).passthrough(), q = e.object({
479
508
  code: e.string(),
480
509
  message: e.string().optional(),
481
510
  invalidField: e.string().optional(),
@@ -484,47 +513,47 @@ const w = e.object({
484
513
  validDateCandidates: e.array(e.string()).optional(),
485
514
  validDimensionCandidates: e.array(e.string()).optional(),
486
515
  recommendedNextStep: e.string()
487
- }).passthrough(), T = e.object({
516
+ }).passthrough(), x = e.object({
488
517
  code: e.string(),
489
518
  message: e.string(),
490
519
  path: e.string().optional(),
491
520
  fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
492
- repairHint: A.optional()
493
- }).passthrough(), Ce = e.object({
521
+ repairHint: q.optional()
522
+ }).passthrough(), Ee = e.object({
494
523
  ok: e.boolean(),
495
- errors: e.array(T),
496
- warnings: e.array(T),
497
- repairHints: e.array(A)
498
- }).passthrough(), ye = e.object({
524
+ errors: e.array(x),
525
+ warnings: e.array(x),
526
+ repairHints: e.array(q)
527
+ }).passthrough(), fe = e.object({
499
528
  page: e.number(),
500
529
  pageSize: e.number(),
501
530
  pageCount: e.number(),
502
531
  totalCount: e.number(),
503
532
  hasNextPage: e.boolean(),
504
533
  hasPrevPage: e.boolean()
505
- }).passthrough(), b = {
534
+ }).passthrough(), f = {
506
535
  intentId: e.string().optional(),
507
536
  queryPath: e.enum(["query_spec", "sql", "sql_python"]),
508
537
  warnings: e.array(e.string()).optional(),
509
538
  rowCount: e.number().optional(),
510
539
  rowLimitExceeded: e.boolean().optional(),
511
540
  limit: e.number().optional(),
512
- pagination: ye.optional()
513
- }, Me = e.object({
514
- ...b,
541
+ pagination: fe.optional()
542
+ }, Ne = e.object({
543
+ ...f,
515
544
  kind: e.literal("metric"),
516
- primaryValue: R,
517
- measures: e.record(R).optional(),
545
+ primaryValue: T,
546
+ measures: e.record(T).optional(),
518
547
  missingMeasures: e.array(e.string()).optional(),
519
548
  comparison: e.object({
520
549
  kind: e.enum(["previous_period", "previous_year", "target"]),
521
- value: R.optional(),
550
+ value: T.optional(),
522
551
  delta: e.union([e.number(), e.null()]).optional(),
523
552
  deltaPercent: e.union([e.number(), e.null()]).optional()
524
553
  }).passthrough().optional(),
525
554
  records: p.optional()
526
- }).passthrough(), Ae = e.object({
527
- ...b,
555
+ }).passthrough(), Ve = e.object({
556
+ ...f,
528
557
  kind: e.literal("records"),
529
558
  columns: e.array(l),
530
559
  records: p,
@@ -547,16 +576,16 @@ const w = e.object({
547
576
  "unsupported_dependency",
548
577
  "override_not_eligible"
549
578
  ]).optional()
550
- }), fe = e.object({
579
+ }), Se = e.object({
551
580
  complete: e.boolean(),
552
581
  reason: e.enum(["unsupported", "truncated"]).optional()
553
- }), Oe = e.object({
554
- ...b,
582
+ }), Ue = e.object({
583
+ ...f,
555
584
  kind: e.literal("inputOptions"),
556
585
  dependencyOutcomes: e.array(be).optional(),
557
- match: fe.optional(),
586
+ match: Se.optional(),
558
587
  options: e.array(
559
- se(
588
+ re(
560
589
  {
561
590
  label: e.string(),
562
591
  value: e.unknown(),
@@ -566,8 +595,8 @@ const w = e.object({
566
595
  ["value"]
567
596
  )
568
597
  )
569
- }).passthrough(), Ee = e.object({
570
- ...b,
598
+ }).passthrough(), qe = e.object({
599
+ ...f,
571
600
  kind: e.literal("sql"),
572
601
  columns: e.array(l),
573
602
  records: p,
@@ -578,53 +607,57 @@ const w = e.object({
578
607
  }).passthrough().optional()
579
608
  }).passthrough();
580
609
  export {
581
- ce as A,
582
- le as B,
583
- C,
584
- ue as D,
585
- M as E,
586
- De as F,
587
- je as G,
588
- l as H,
589
- we as I,
590
- Fe as J,
591
- T as K,
592
- Ce as L,
593
- ve as M,
594
- Me as N,
595
- E as O,
596
- Ae as P,
597
- be as Q,
598
- ke as R,
599
- Ie as S,
600
- xe as T,
601
- fe as U,
602
- Oe as V,
603
- Ee as W,
604
- U as a,
605
- x as b,
606
- _e as c,
610
+ se as A,
611
+ Fe as B,
612
+ E as C,
613
+ ce as D,
614
+ le as E,
615
+ pe as F,
616
+ V as G,
617
+ me as H,
618
+ U as I,
619
+ Ae as J,
620
+ Me as K,
621
+ l as L,
622
+ Te as M,
623
+ Ce as N,
624
+ Z as O,
625
+ Oe as P,
626
+ x as Q,
627
+ Re as R,
628
+ xe as S,
629
+ Ie as T,
630
+ Ee as U,
631
+ Ne as V,
632
+ Ve as W,
633
+ be as X,
634
+ Se as Y,
635
+ Ue as Z,
636
+ qe as _,
637
+ z as a,
638
+ R as b,
639
+ ve as c,
607
640
  D as d,
608
- Re as e,
609
- N as f,
641
+ ke as e,
642
+ B as f,
610
643
  p as g,
611
644
  u as h,
612
- V as i,
613
- K as j,
614
- Y as k,
615
- Q as l,
616
- ee as m,
617
- R as n,
618
- te as o,
619
- ae as p,
620
- oe as q,
621
- H as r,
622
- F as s,
623
- $ as t,
624
- ie as u,
625
- j as v,
626
- ne as w,
627
- Te as x,
628
- w as y,
629
- re as z
645
+ j as i,
646
+ Q as j,
647
+ w as k,
648
+ ne as l,
649
+ De as m,
650
+ T as n,
651
+ F as o,
652
+ oe as p,
653
+ A as q,
654
+ J as r,
655
+ N as s,
656
+ Y as t,
657
+ M as u,
658
+ C as v,
659
+ O as w,
660
+ ie as x,
661
+ je as y,
662
+ we as z
630
663
  };