react-semaphor 0.1.558 → 0.1.560

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 (139) hide show
  1. package/dist/analytics-protocol/index.js +368 -358
  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 +630 -0
  7. package/dist/chunks/{assistant-chat-BCWoP6Rf.js → assistant-chat-Bu2fFm_I.js} +206 -207
  8. package/dist/chunks/{bookmark-state-PjQpxbG7.js → bookmark-state-BFY9oNmr.js} +3 -3
  9. package/dist/chunks/{braces-D5Ucy7q1.js → braces-Da41xfUd.js} +1 -1
  10. package/dist/chunks/{comparison-window-caption-Dc7BaCMz.js → comparison-window-caption-4FNkMrzE.js} +213 -213
  11. package/dist/chunks/{context-DVy4HOU0.js → context-BgPDzLHZ.js} +1 -1
  12. package/dist/chunks/{custom-visual-inputs-B-DLRGrV.js → custom-visual-inputs-Dz-enUNR.js} +1 -1
  13. package/dist/chunks/{dashboard-wK6Bai4V.js → dashboard-_MeBuy67.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-Coqghdn6.js → dashboard-briefing-launcher-CEi4Pr_v.js} +1152 -1166
  15. package/dist/chunks/{dashboard-controls-BYWSM2RM.js → dashboard-controls-Bi7fyG-4.js} +98 -98
  16. package/dist/chunks/{dashboard-json-pPTB5gj0.js → dashboard-json-B1mU_OMa.js} +5 -5
  17. package/dist/chunks/{document-dashboard-inputs-PY_7Xm55.js → document-dashboard-inputs-CkWfDB8c.js} +64 -64
  18. package/dist/chunks/{edit-dashboard-visual-BODxuUeq.js → edit-dashboard-visual-0CJN31Y3.js} +8274 -8514
  19. package/dist/chunks/filter-reach-copy-BF4w4kI2.js +3738 -0
  20. package/dist/chunks/{filter-value-text-CUBpotVN.js → filter-value-text-CRC-K_l_.js} +3 -3
  21. package/dist/chunks/{global-date-filter-utils-BsFqnnbA.js → global-date-filter-utils-D8365uPH.js} +4088 -3416
  22. package/dist/chunks/{index-DP_wQl0v.js → index-DtHidOPV.js} +579 -604
  23. package/dist/chunks/{layout-grid-CkoXmv0L.js → layout-grid-BvsH4RY2.js} +1 -1
  24. package/dist/chunks/{list-filter-B4i25kuc.js → list-filter-Dg0otx5E.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-4GTUDheD.js → matrix-analytical-definition-CM18W8w6.js} +41 -41
  26. package/dist/chunks/{matrix-card-fS_4O7zA.js → matrix-card-HPskLaPy.js} +3 -3
  27. package/dist/chunks/{matrix-member-presentation-Dj7HaAHC.js → matrix-member-presentation-Bbrfrke4.js} +1 -1
  28. package/dist/chunks/{matrix-operation-contract-CpgLZ7E5.js → matrix-operation-contract-WPv4R-H_.js} +130 -130
  29. package/dist/chunks/{metric-comparison-C8LY7GG5.js → metric-comparison-ljMKYZKa.js} +2 -2
  30. package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-Ccn1zaxl.js} +1 -1
  31. package/dist/chunks/{palette-stlpjVk4.js → palette-Bsh376zO.js} +1 -1
  32. package/dist/chunks/{pivot-result-contract-expectations-DMk-mKhG.js → pivot-result-contract-expectations-Bl5suy4-.js} +602 -696
  33. package/dist/chunks/{pivot-result-identity-CrQ54Xbj.js → pivot-result-identity-vS9TSh4f.js} +1 -1
  34. package/dist/chunks/{raw-temporal-presentation-BI2z2LlB.js → raw-temporal-presentation-BHm7s-hz.js} +230 -274
  35. package/dist/chunks/{report-preferences-dialog-Dc-YyVwf.js → report-preferences-dialog-BV8L0SeS.js} +55 -55
  36. package/dist/chunks/{report-runtime-context-CohdtiMg.js → report-runtime-context-BZQh9ywy.js} +2 -2
  37. package/dist/chunks/{resolve-dashboard-input-context-BZYI1hB0.js → resolve-dashboard-input-context-CAMiWvyR.js} +2021 -2239
  38. package/dist/chunks/{save-C1dgxgAu.js → save-B5EAsgQF.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-CIBoMq46.js → saved-dashboard-context-n2Wn11cV.js} +57 -57
  40. package/dist/chunks/{selection-reducer-_d6aKJnj.js → selection-reducer-D0YnaAD9.js} +1 -1
  41. package/dist/chunks/{semaphor-ready-indicator-ERTLU7B4.js → semaphor-ready-indicator-XLBLOJ2V.js} +38446 -39176
  42. package/dist/chunks/{shelf-drop-preview-context-fEnx6iL_.js → shelf-drop-preview-context-DHMa54a-.js} +570 -570
  43. package/dist/chunks/source-entity-resolution-dUG5VWRm.js +607 -0
  44. package/dist/chunks/{switch-BqUan2mN.js → switch-ByxH4M7t.js} +3 -3
  45. package/dist/chunks/{table-export-sheet-CTCTA_bd.js → table-export-sheet-C_GdeTYU.js} +1 -1
  46. package/dist/chunks/{table-settings-DF1gdVQR.js → table-settings-Imz0FgWi.js} +8 -8
  47. package/dist/chunks/{temporal-input-presentation-DoSniQj1.js → temporal-input-presentation-uvNK_tM0.js} +1109 -820
  48. package/dist/chunks/{token-types-DFyLflLY.js → token-types-CQtXUVMy.js} +1 -1
  49. package/dist/chunks/{upload-DcoyjkRV.js → upload-wbR-NVzq.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-xhb9YFg-.js → use-create-flow-overlay-state-CEBaLOKC.js} +6 -6
  51. package/dist/chunks/validators-CXTneCA4.js +3453 -0
  52. package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-B1n_WjW3.js} +1 -1
  53. package/dist/dashboard/index.js +2 -2
  54. package/dist/dashboard-authoring/index.js +2207 -1496
  55. package/dist/data-app-sdk/index.js +20 -20
  56. package/dist/data-app-sdk-adapters/index.js +3 -3
  57. package/dist/data-app-sdk-validation/index.js +6 -6
  58. package/dist/format-utils/index.js +181 -176
  59. package/dist/index.js +22 -22
  60. package/dist/report-runtime-context/index.js +2 -2
  61. package/dist/style.css +1 -1
  62. package/dist/surfboard/index.js +2 -2
  63. package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
  64. package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
  65. package/dist/types/index.js +6 -6
  66. package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
  67. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
  68. package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
  69. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
  70. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  71. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
  72. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  73. package/dist/types/lib/stores/editor-store.d.ts +39 -9
  74. package/dist/types/lib/stores/table-actions.d.ts +9 -3
  75. package/dist/types/lib/table-formatting/index.d.ts +0 -2
  76. package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
  77. package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
  78. package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
  79. package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
  80. package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
  81. package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
  82. package/dist/types/lib/types/common-types.d.ts +40 -47
  83. package/dist/types/lib/types/explorer-types.d.ts +13 -44
  84. package/dist/types/lib/utils/card-config-utils.d.ts +9 -1
  85. package/dist/types/lib/utils/card-definition.d.ts +9 -187
  86. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +159 -513
  87. package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
  88. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
  89. package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
  90. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
  91. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
  92. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
  93. package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
  94. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
  95. package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
  96. package/dist/types/shared/analytics-protocol/source-capabilities.d.ts +21 -0
  97. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
  98. package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
  99. package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
  100. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
  101. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
  102. package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
  103. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +24 -24
  104. package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
  105. package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
  106. package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
  107. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +14 -0
  108. package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
  109. package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
  110. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
  111. package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
  112. package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
  113. package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
  114. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
  115. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +2 -0
  116. package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
  117. package/dist/types/shared/dashboard-authoring/legacy-table-routing.d.ts +4 -2
  118. package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
  119. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
  120. package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
  121. package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
  122. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -1
  123. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
  124. package/dist/types/shared/format-utils/index.d.ts +2 -0
  125. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
  126. package/dist/types/shared/format-utils/raw-temporal.d.ts +15 -1
  127. package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
  128. package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
  129. package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
  130. package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
  131. package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
  132. package/package.json +1 -1
  133. package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
  134. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
  135. package/dist/chunks/filter-reach-copy-BvJH9JO-.js +0 -3411
  136. package/dist/chunks/source-entity-resolution-DXW1HpKf.js +0 -816
  137. package/dist/chunks/validators-hmfNNQz8.js +0 -3595
  138. package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
  139. package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
@@ -1,4 +1,4 @@
1
- import { A as e, a as t, b as r, c as o, p as d, d as n, e as p } from "../chunks/saved-dashboard-context-CIBoMq46.js";
1
+ import { A as e, a as t, b as r, c as o, p as d, d as n, e as p } from "../chunks/saved-dashboard-context-n2Wn11cV.js";
2
2
  export {
3
3
  e as AssistantContextSourceError,
4
4
  t as assistantCardReplayFields,
@@ -1,9 +1,9 @@
1
1
  import { z as e } from "zod";
2
- import { s as x } from "../chunks/analytics-base-schemas-BUFUoO6G.js";
3
- import { a as g, A as s, b as T, c } from "../chunks/context-DVy4HOU0.js";
4
- import { e as q, j as O, m as F, d as L, l as $, g as M, k as U, h as j, i as w, f as P, r as V } from "../chunks/context-DVy4HOU0.js";
5
- import { t as y } from "../chunks/model-change-CJEj3ZD6.js";
6
- import { A as J, m as K, C as X, e as z, k as G, j as H, f as W, n as Q, q as Z, s as ee, h as se, l as ae, i as te, d as oe, a as re, c as ne, b as de, g as ie, v as ce, w as le } from "../chunks/model-change-CJEj3ZD6.js";
2
+ import { s as x } from "../chunks/analytics-base-schemas-CHLxsPfX.js";
3
+ import { a as g, A as s, b as T, c } from "../chunks/context-BgPDzLHZ.js";
4
+ import { e as q, j as O, m as F, d as L, l as $, g as M, k as U, h as j, i as w, f as P, r as V } from "../chunks/context-BgPDzLHZ.js";
5
+ import { t as y } from "../chunks/model-change-Ccn1zaxl.js";
6
+ import { A as J, m as K, C as X, e as z, k as G, j as H, f as W, n as Q, q as Z, s as ee, h as se, l as ae, i as te, d as oe, a as re, c as ne, b as de, g as ie, v as ce, w as le } from "../chunks/model-change-Ccn1zaxl.js";
7
7
  import { p as Se, a as be, r as me } from "../chunks/availability-Bp5Gfu1I.js";
8
8
  import { A as Ae, a as fe, D as pe, i as xe } from "../chunks/conversation-sQiWYUOb.js";
9
9
  const C = [
@@ -1,20 +1,20 @@
1
1
  import { jsxs as d, jsx as r, Fragment as de } from "react/jsx-runtime";
2
2
  import b from "react";
3
- import { c as ee, P as ue, a as pe, B as C, b as be, C as ze, R as ge, L as ce, X as De, S as ie, d as je, T as Ie, e as Je, f as L, g as Le, h as $, i as $e, j as _e, k as Ue, l as Ve, m as T, n as X, o as Y, p as q, I as fe, q as Z, r as K, s as me, t as he, u as ke, v as xe, w as ye, x as Me } from "../chunks/switch-BqUan2mN.js";
3
+ import { c as ee, P as ue, a as pe, B as C, b as be, C as ze, R as ge, L as ce, X as De, S as ie, d as je, T as Ie, e as Je, f as L, g as Le, h as $, i as $e, j as _e, k as Ue, l as Ve, m as T, n as X, o as Y, p as q, I as fe, q as Z, r as K, s as me, t as he, u as ke, v as xe, w as ye, x as Me } from "../chunks/switch-ByxH4M7t.js";
4
4
  import { A as Ge, p as We } from "../chunks/color-CJvdlFM_.js";
5
5
  import "../chunks/index-CuHybtft.js";
6
- import "../chunks/validators-hmfNNQz8.js";
7
- import "../chunks/matrix-operation-contract-CpgLZ7E5.js";
8
- import "../chunks/analytics-base-schemas-BUFUoO6G.js";
6
+ import "../chunks/validators-CXTneCA4.js";
7
+ import "../chunks/matrix-operation-contract-WPv4R-H_.js";
8
+ import "../chunks/analytics-base-schemas-CHLxsPfX.js";
9
9
  import "zod";
10
10
  import "../value-format-preferences/index.js";
11
11
  import { c as Q } from "../chunks/_commonjsHelpers-DimLPMtv.js";
12
12
  import { r as He, v as Xe, A as Ye } from "../chunks/index-CLIro-EG.js";
13
- import { P as _ } from "../chunks/palette-stlpjVk4.js";
14
- import { B as qe } from "../chunks/braces-D5Ucy7q1.js";
15
- import { U as Ze } from "../chunks/upload-DcoyjkRV.js";
16
- import { S as Ke } from "../chunks/save-C1dgxgAu.js";
17
- import { L as Qe } from "../chunks/layout-grid-CkoXmv0L.js";
13
+ import { P as _ } from "../chunks/palette-Bsh376zO.js";
14
+ import { B as qe } from "../chunks/braces-Da41xfUd.js";
15
+ import { U as Ze } from "../chunks/upload-wbR-NVzq.js";
16
+ import { S as Ke } from "../chunks/save-B5EAsgQF.js";
17
+ import { L as Qe } from "../chunks/layout-grid-BvsH4RY2.js";
18
18
  /**
19
19
  * @license lucide-react v0.453.0 - ISC
20
20
  *
@@ -1,11 +1,11 @@
1
- import "../chunks/temporal-input-presentation-DoSniQj1.js";
2
- import "../chunks/validators-hmfNNQz8.js";
1
+ import "../chunks/temporal-input-presentation-uvNK_tM0.js";
2
+ import "../chunks/validators-CXTneCA4.js";
3
3
  import "../chunks/export-file-format-C-tJsxsf.js";
4
4
  import "zod";
5
- import "../chunks/matrix-operation-contract-CpgLZ7E5.js";
6
- import "../chunks/analytics-base-schemas-BUFUoO6G.js";
5
+ import "../chunks/matrix-operation-contract-WPv4R-H_.js";
6
+ import "../chunks/analytics-base-schemas-CHLxsPfX.js";
7
7
  import "../value-format-preferences/index.js";
8
- import { y as g, H as l, a0 as B, C as m, B as c, A as d, I as T, z as E, D as I, M as A, X as h, i as p, Y as u, Z as C, n as b, l as F, m as D, N as S, k as _, P as N, f as R, e as y, Q as M, t as O, q as x, c as G, d as v, G as L, F as U, h as z, b as H, a as J, a2 as V, g as P, _ as q, T as X, a1 as K, U as Q, E as j, $ as k, r as W, j as Y, V as Z, W as $, o as w, J as ii, O as ei, L as ai, p as ri, s as ti, K as si, R as ni, S as oi } from "../chunks/index-DP_wQl0v.js";
8
+ import { y as g, H as l, a0 as B, C as m, B as c, A as d, I as T, z as E, D as I, M as A, X as h, i as p, Y as u, Z as C, n as b, l as F, m as D, N as S, k as _, P as N, f as R, e as y, Q as M, t as O, q as x, c as G, d as v, G as L, F as U, h as z, b as H, a as J, a2 as V, g as P, _ as q, T as X, a1 as K, U as Q, E as j, $ as k, r as W, j as Y, V as Z, W as $, o as w, J as ii, O as ei, L as ai, p as ri, s as ti, K as si, R as ni, S as oi } from "../chunks/index-DtHidOPV.js";
9
9
  export {
10
10
  g as BRIEFING_ARTIFACT_FORMATS,
11
11
  l as BRIEFING_ATTACHMENT_FORMATS,
@@ -0,0 +1,630 @@
1
+ import { z as e } from "zod";
2
+ const E = [
3
+ "missing_dependency",
4
+ "missing_relationship",
5
+ "population_required",
6
+ "ambiguous_relationship"
7
+ ];
8
+ function _e(t) {
9
+ return E.includes(
10
+ t
11
+ );
12
+ }
13
+ const ve = 200, D = [
14
+ "second",
15
+ "minute",
16
+ "hour",
17
+ "day",
18
+ "week",
19
+ "month",
20
+ "quarter",
21
+ "year"
22
+ ];
23
+ function Re(t) {
24
+ return typeof t == "string" && D.includes(t);
25
+ }
26
+ const N = [
27
+ "week_of_short",
28
+ "week_of_long",
29
+ "quarter_short",
30
+ "quarter_long",
31
+ "fiscal_quarter_short",
32
+ "fiscal_year",
33
+ // Named presets per grain (column formats CF-D16).
34
+ "short",
35
+ "long",
36
+ "numeric",
37
+ "iso"
38
+ ], ke = {
39
+ invalidMetadata: "invalid_raw_temporal_metadata"
40
+ };
41
+ function U(t) {
42
+ return t === "second" || t === "minute" || t === "hour" ? "datetime" : "date";
43
+ }
44
+ const xe = {
45
+ missingMetadata: "missing_temporal_bucket_metadata",
46
+ invalidMetadata: "invalid_temporal_bucket_metadata",
47
+ invalidValue: "invalid_temporal_bucket_value"
48
+ }, Ie = "__auto_count__";
49
+ function V(t) {
50
+ try {
51
+ return new Intl.DateTimeFormat("en-US", { timeZone: t }).format(), !0;
52
+ } catch {
53
+ return !1;
54
+ }
55
+ }
56
+ const q = 20;
57
+ function d(t) {
58
+ if (!(typeof t != "number" || !Number.isFinite(t)))
59
+ return Math.max(0, Math.min(q, Math.trunc(t)));
60
+ }
61
+ function s(t) {
62
+ return typeof t == "string" ? t : void 0;
63
+ }
64
+ function S(t) {
65
+ return typeof t == "string" && t.trim() ? t : void 0;
66
+ }
67
+ function _(t) {
68
+ return typeof t == "boolean" ? t : void 0;
69
+ }
70
+ function P(t) {
71
+ if (typeof t != "string") return;
72
+ const a = t.trim().toUpperCase();
73
+ return /^[A-Z]{3}$/.test(a) ? a : void 0;
74
+ }
75
+ function B(t) {
76
+ return typeof t == "number" && Number.isFinite(t) ? t : void 0;
77
+ }
78
+ function c(t) {
79
+ return Object.fromEntries(
80
+ Object.entries(t).filter(([, a]) => a !== void 0)
81
+ );
82
+ }
83
+ const Z = /* @__PURE__ */ new Set(["number", "currency", "percent", "percentage", "scientific"]), G = /* @__PURE__ */ new Set(["millisecond", "second", "minute", "hour", "day"]);
84
+ function v(t) {
85
+ return typeof t == "string" && G.has(t) ? t : void 0;
86
+ }
87
+ function z(t) {
88
+ const a = t.percentValueMode ?? "fraction";
89
+ if (t.scale === 1 && a === "whole") {
90
+ const { scale: n, ...f } = t;
91
+ return { ...f, percentValueMode: "whole" };
92
+ }
93
+ const o = t.minimumFractionDigits ?? (t.maximumFractionDigits === void 0 ? 1 : 0), i = t.maximumFractionDigits ?? Math.max(o, 1);
94
+ return c({
95
+ type: "number",
96
+ scale: a === "whole" ? t.scale : t.scale * 100,
97
+ minimumFractionDigits: o,
98
+ maximumFractionDigits: i,
99
+ useGrouping: t.useGrouping,
100
+ prefix: t.prefix,
101
+ suffix: `%${t.suffix ?? ""}`,
102
+ negativeStyle: t.negativeStyle,
103
+ signDisplay: t.signDisplay
104
+ });
105
+ }
106
+ function L(t) {
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({
112
+ type: a,
113
+ currency: a === "currency" ? P(t.currency) : void 0,
114
+ minimumFractionDigits: o,
115
+ maximumFractionDigits: i,
116
+ useGrouping: _(t.useGrouping) ?? _(t.thousandsSeparator),
117
+ prefix: s(t.prefix),
118
+ // Intl adds the % of a percent; a stored '%' suffix on one is the same sign.
119
+ suffix: a === "percent" && t.suffix === "%" ? void 0 : s(t.suffix),
120
+ negativeStyle: f,
121
+ compact: _(t.compact),
122
+ scale: B(t.scale),
123
+ percentValueMode: a === "percent" ? t.percentValueMode === "whole" ? "whole" : "fraction" : void 0,
124
+ signDisplay: O
125
+ });
126
+ return m.type === "percent" && m.scale !== void 0 ? z(m) : m;
127
+ }
128
+ function $(t) {
129
+ if (!t || typeof t != "object" || Array.isArray(t)) return;
130
+ const a = t;
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;
134
+ }
135
+ if (typeof a.type == "string" && Z.has(a.type))
136
+ return L(a);
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;
139
+ return c({
140
+ type: "date",
141
+ pattern: o,
142
+ dialect: n,
143
+ preset: o ? void 0 : i,
144
+ relative: a.relative === !0 ? !0 : void 0,
145
+ timezone: S(a.timezone),
146
+ sourceTimezone: S(a.sourceTimezone),
147
+ prefix: s(a.prefix),
148
+ suffix: s(a.suffix)
149
+ });
150
+ }
151
+ if (a.type === "duration") {
152
+ const o = d(a.maxUnits);
153
+ return c({
154
+ type: "duration",
155
+ inputUnit: v(a.inputUnit),
156
+ outputStyle: a.outputStyle === "compact" || a.outputStyle === "digital" || a.outputStyle === "long" ? a.outputStyle : void 0,
157
+ largestUnit: v(a.largestUnit),
158
+ smallestUnit: v(a.smallestUnit),
159
+ maxUnits: o === void 0 ? void 0 : Math.min(o, 10),
160
+ prefix: s(a.prefix),
161
+ suffix: s(a.suffix),
162
+ negativeStyle: a.negativeStyle === "parentheses" || a.negativeStyle === "minus" ? a.negativeStyle : void 0
163
+ });
164
+ }
165
+ if (a.type === "string")
166
+ return c({ type: "string", prefix: s(a.prefix), suffix: s(a.suffix) });
167
+ }
168
+ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
169
+ "SUM",
170
+ "COUNT",
171
+ "AVG",
172
+ "MIN",
173
+ "MAX",
174
+ "MEDIAN",
175
+ "DISTINCT"
176
+ ]), g = e.enum([
177
+ "postgres",
178
+ "mysql",
179
+ "mssql",
180
+ "snowflake",
181
+ "clickhouse",
182
+ "bigquery",
183
+ "redshift",
184
+ "duckdb",
185
+ "sqlite",
186
+ "unknown"
187
+ ]), K = e.enum(D), h = e.enum([
188
+ "dimension",
189
+ "measure",
190
+ "date",
191
+ "id",
192
+ "unknown"
193
+ ]), y = e.enum([
194
+ "string",
195
+ "number",
196
+ "boolean",
197
+ "date",
198
+ "datetime",
199
+ "unknown"
200
+ ]), R = e.union([e.number(), e.string(), e.null()]), k = e.enum([
201
+ "millisecond",
202
+ "second",
203
+ "minute",
204
+ "hour",
205
+ "day"
206
+ ]), W = e.enum(N), X = e.discriminatedUnion("mode", [
207
+ e.object({ mode: e.literal("auto") }).strict(),
208
+ e.object({
209
+ mode: e.literal("preset"),
210
+ preset: W
211
+ }).strict(),
212
+ e.object({
213
+ mode: e.literal("pattern"),
214
+ pattern: e.string().min(1)
215
+ }).strict()
216
+ ]), Y = e.object({
217
+ type: e.literal("temporal_bucket"),
218
+ presentation: X
219
+ }).strict(), J = e.object({
220
+ tz: e.string().min(1).refine(V, {
221
+ message: "tz must be a valid IANA timezone"
222
+ }),
223
+ weekStart: e.number().int().min(0).max(6),
224
+ fiscalCalendar: e.object({
225
+ kind: e.literal("month_aligned"),
226
+ yearStartMonth: e.number().int().min(1).max(12)
227
+ }).strict().optional()
228
+ }).strict(), x = e.object({
229
+ kind: e.literal("temporal_bucket"),
230
+ granularity: K,
231
+ calendar: J
232
+ }).strict(), Q = e.object({
233
+ kind: e.literal("raw_temporal"),
234
+ valueKind: e.enum(["date", "wall_datetime", "instant"])
235
+ }).strict(), r = e.string(), I = e.number().int().min(0).max(20), ee = e.object({
236
+ type: e.enum(["number", "currency", "percent", "scientific"]),
237
+ currency: e.string().regex(/^[A-Z]{3}$/, "Expected an ISO 4217 currency code.").optional(),
238
+ minimumFractionDigits: I.optional(),
239
+ maximumFractionDigits: I.optional(),
240
+ useGrouping: e.boolean().optional(),
241
+ prefix: r.optional(),
242
+ suffix: r.optional(),
243
+ negativeStyle: e.enum(["minus", "parentheses"]).optional(),
244
+ compact: e.boolean().optional(),
245
+ scale: e.number().finite().optional(),
246
+ percentValueMode: e.enum(["fraction", "whole"]).optional(),
247
+ signDisplay: e.enum(["auto", "always", "exceptZero", "never"]).optional()
248
+ }).strict().superRefine((t, a) => {
249
+ const { minimumFractionDigits: o, maximumFractionDigits: i } = t;
250
+ o !== void 0 && i !== void 0 && o > i && a.addIssue({
251
+ code: e.ZodIssueCode.custom,
252
+ path: ["minimumFractionDigits"],
253
+ message: "minimumFractionDigits must not exceed maximumFractionDigits."
254
+ }), t.currency !== void 0 && t.type !== "currency" && a.addIssue({
255
+ code: e.ZodIssueCode.custom,
256
+ path: ["currency"],
257
+ message: "Only a currency format names a currency."
258
+ }), t.type === "percent" ? (t.percentValueMode === void 0 && a.addIssue({
259
+ code: e.ZodIssueCode.custom,
260
+ path: ["percentValueMode"],
261
+ message: "A percent format states percentValueMode: fraction (0.25 is 25%) or whole (25 is 25%)."
262
+ }), t.scale !== void 0 && a.addIssue({
263
+ code: e.ZodIssueCode.custom,
264
+ path: ["scale"],
265
+ message: "A percent format has no scale; percentValueMode says how the value is read."
266
+ })) : t.percentValueMode !== void 0 && a.addIssue({
267
+ code: e.ZodIssueCode.custom,
268
+ path: ["percentValueMode"],
269
+ message: "Only a percent format has percentValueMode."
270
+ });
271
+ }), te = ["short", "long", "numeric", "iso"], ae = e.object({
272
+ type: e.literal("date"),
273
+ pattern: e.string().min(1).optional(),
274
+ dialect: e.enum(["semaphor_tokens", "date_fns"]).optional(),
275
+ preset: e.enum(te).optional(),
276
+ relative: e.boolean().optional(),
277
+ timezone: e.string().min(1).optional(),
278
+ sourceTimezone: e.string().min(1).optional(),
279
+ prefix: r.optional(),
280
+ suffix: r.optional()
281
+ }).strict().superRefine((t, a) => {
282
+ t.pattern !== void 0 && t.preset !== void 0 && a.addIssue({
283
+ code: e.ZodIssueCode.custom,
284
+ path: ["preset"],
285
+ message: "A date format has a pattern or a preset, not both."
286
+ }), t.dialect !== void 0 && t.pattern === void 0 && a.addIssue({
287
+ code: e.ZodIssueCode.custom,
288
+ path: ["dialect"],
289
+ message: "dialect names the token set of a pattern."
290
+ });
291
+ }), oe = e.object({
292
+ type: e.literal("duration"),
293
+ inputUnit: k.optional(),
294
+ outputStyle: e.enum(["compact", "digital", "long"]).optional(),
295
+ largestUnit: k.optional(),
296
+ smallestUnit: k.optional(),
297
+ maxUnits: e.number().int().min(0).max(10).optional(),
298
+ prefix: r.optional(),
299
+ suffix: r.optional(),
300
+ negativeStyle: e.enum(["minus", "parentheses"]).optional()
301
+ }).strict(), ie = e.object({
302
+ type: e.literal("string"),
303
+ prefix: r.optional(),
304
+ suffix: r.optional()
305
+ }).strict(), j = e.union([
306
+ ee,
307
+ ae,
308
+ oe,
309
+ ie
310
+ ]), ne = e.unknown().superRefine((t, a) => {
311
+ t && typeof t == "object" && "locale" in t && ["number", "currency", "percent", "percentage", "scientific"].includes(
312
+ String(t.type)
313
+ ) && a.addIssue({
314
+ code: e.ZodIssueCode.custom,
315
+ path: ["locale"],
316
+ message: "Numeric semantic formats inherit locale from viewer preferences."
317
+ });
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({
326
+ code: "custom",
327
+ path: [n],
328
+ message: `Required field "${n}" is missing.`
329
+ });
330
+ });
331
+ }
332
+ const w = e.object({
333
+ kind: e.literal("semantic"),
334
+ domainId: e.string(),
335
+ datasetName: e.string(),
336
+ datasetId: e.string().optional(),
337
+ label: e.string().optional(),
338
+ connectionId: e.string().optional()
339
+ }).passthrough(), re = e.object({
340
+ kind: e.literal("physical"),
341
+ connectionId: e.string(),
342
+ connectionType: e.string().optional(),
343
+ tableName: e.string(),
344
+ databaseName: e.string().optional(),
345
+ schemaName: e.string().optional(),
346
+ label: e.string().optional(),
347
+ dialect: g.optional()
348
+ }).passthrough(), ce = e.object({
349
+ kind: e.literal("sql"),
350
+ connectionId: e.string(),
351
+ dialect: g.optional(),
352
+ label: e.string().optional()
353
+ }).passthrough(), F = e.union([
354
+ w,
355
+ re,
356
+ ce
357
+ ]), le = e.object({
358
+ name: e.string(),
359
+ label: e.string().optional(),
360
+ role: h.optional(),
361
+ dataType: y.optional(),
362
+ source: F.optional(),
363
+ aggregate: u.optional()
364
+ }).passthrough(), C = le, pe = e.object({
365
+ kind: e.literal("field"),
366
+ field: C,
367
+ aggregate: u.optional()
368
+ }).passthrough(), ue = e.object({
369
+ kind: e.literal("derived_field"),
370
+ name: e.string(),
371
+ label: e.string(),
372
+ description: e.string().optional(),
373
+ resultRole: h,
374
+ dataType: y,
375
+ computeStage: e.enum(["row", "aggregate"]),
376
+ expression: e.string(),
377
+ expressionLanguage: e.literal("semaphor_sql_template").optional(),
378
+ inputs: e.record(pe),
379
+ defaultAggregate: u.optional(),
380
+ aggregationBehavior: e.enum([
381
+ "additive",
382
+ "non_additive",
383
+ "ratio_of_sums",
384
+ "weighted",
385
+ "pre_aggregated",
386
+ "snapshot"
387
+ ]).optional(),
388
+ aggregationStrategy: e.enum([
389
+ "default",
390
+ "symmetric_aggregate",
391
+ "aggregate_then_join",
392
+ "weighted"
393
+ ]).optional(),
394
+ format: ne.optional(),
395
+ tags: e.array(e.string()).optional()
396
+ }).passthrough(), M = ue, De = C.and(
397
+ e.object({
398
+ derivedField: M.optional()
399
+ }).passthrough()
400
+ ), me = w, de = e.object({
401
+ kind: e.literal("physical"),
402
+ connectionId: e.string().optional(),
403
+ connectionType: e.string().optional(),
404
+ tableName: e.string(),
405
+ databaseName: e.string().optional(),
406
+ schemaName: e.string().optional(),
407
+ label: e.string().optional(),
408
+ dialect: g.optional()
409
+ }).passthrough(), ge = e.object({
410
+ kind: e.literal("sql"),
411
+ connectionId: e.string().optional(),
412
+ dialect: g.optional(),
413
+ label: e.string().optional()
414
+ }).passthrough(), he = e.union([
415
+ me,
416
+ de,
417
+ ge
418
+ ]), je = e.object({
419
+ key: e.string().optional(),
420
+ name: e.string(),
421
+ label: e.string().optional(),
422
+ role: h.optional(),
423
+ dataType: y.optional(),
424
+ source: he.optional(),
425
+ aggregate: u.optional(),
426
+ derivedField: e.never().optional()
427
+ }).passthrough(), l = e.object({
428
+ key: e.string(),
429
+ name: e.string(),
430
+ label: e.string(),
431
+ role: h.optional(),
432
+ dataType: y.optional(),
433
+ aggregate: u.optional(),
434
+ source: F.optional(),
435
+ derivedField: M.optional(),
436
+ temporalBucket: x.optional(),
437
+ rawTemporal: Q.optional(),
438
+ pivotIdentity: e.object({
439
+ metricId: e.string().min(1),
440
+ metricAlias: e.string().min(1),
441
+ members: e.array(
442
+ e.object({
443
+ fieldId: e.string().min(1),
444
+ value: e.string().nullable(),
445
+ temporalBucket: x.optional()
446
+ }).strict()
447
+ )
448
+ }).strict().optional()
449
+ }).passthrough().superRefine((t, a) => {
450
+ if (t.temporalBucket && t.rawTemporal && a.addIssue({
451
+ code: e.ZodIssueCode.custom,
452
+ path: ["rawTemporal"],
453
+ message: "A result column cannot carry both temporalBucket and rawTemporal metadata."
454
+ }), t.temporalBucket) {
455
+ const o = U(
456
+ t.temporalBucket.granularity
457
+ );
458
+ t.dataType !== o && a.addIssue({
459
+ code: e.ZodIssueCode.custom,
460
+ path: ["dataType"],
461
+ message: `${t.temporalBucket.granularity} temporal buckets require dataType ${o}.`
462
+ });
463
+ }
464
+ if (t.rawTemporal) {
465
+ const o = t.rawTemporal.valueKind === "date" ? "date" : "datetime";
466
+ t.dataType !== o && a.addIssue({
467
+ code: e.ZodIssueCode.custom,
468
+ path: ["dataType"],
469
+ message: `${t.rawTemporal.valueKind} raw temporal values require dataType ${o}.`
470
+ });
471
+ }
472
+ }), we = e.object({
473
+ records: p,
474
+ columns: e.array(l).optional()
475
+ }).passthrough(), Fe = e.object({
476
+ records: p,
477
+ columns: e.array(l)
478
+ }).passthrough(), A = e.object({
479
+ code: e.string(),
480
+ message: e.string().optional(),
481
+ invalidField: e.string().optional(),
482
+ fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
483
+ validMeasureCandidates: e.array(e.string()).optional(),
484
+ validDateCandidates: e.array(e.string()).optional(),
485
+ validDimensionCandidates: e.array(e.string()).optional(),
486
+ recommendedNextStep: e.string()
487
+ }).passthrough(), T = e.object({
488
+ code: e.string(),
489
+ message: e.string(),
490
+ path: e.string().optional(),
491
+ fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
492
+ repairHint: A.optional()
493
+ }).passthrough(), Ce = e.object({
494
+ ok: e.boolean(),
495
+ errors: e.array(T),
496
+ warnings: e.array(T),
497
+ repairHints: e.array(A)
498
+ }).passthrough(), ye = e.object({
499
+ page: e.number(),
500
+ pageSize: e.number(),
501
+ pageCount: e.number(),
502
+ totalCount: e.number(),
503
+ hasNextPage: e.boolean(),
504
+ hasPrevPage: e.boolean()
505
+ }).passthrough(), b = {
506
+ intentId: e.string().optional(),
507
+ queryPath: e.enum(["query_spec", "sql", "sql_python"]),
508
+ warnings: e.array(e.string()).optional(),
509
+ rowCount: e.number().optional(),
510
+ rowLimitExceeded: e.boolean().optional(),
511
+ limit: e.number().optional(),
512
+ pagination: ye.optional()
513
+ }, Me = e.object({
514
+ ...b,
515
+ kind: e.literal("metric"),
516
+ primaryValue: R,
517
+ measures: e.record(R).optional(),
518
+ missingMeasures: e.array(e.string()).optional(),
519
+ comparison: e.object({
520
+ kind: e.enum(["previous_period", "previous_year", "target"]),
521
+ value: R.optional(),
522
+ delta: e.union([e.number(), e.null()]).optional(),
523
+ deltaPercent: e.union([e.number(), e.null()]).optional()
524
+ }).passthrough().optional(),
525
+ records: p.optional()
526
+ }).passthrough(), Ae = e.object({
527
+ ...b,
528
+ kind: e.literal("records"),
529
+ columns: e.array(l),
530
+ records: p,
531
+ totals: e.object({
532
+ mode: e.literal("server"),
533
+ scope: e.literal("filtered_result"),
534
+ row: e.record(e.string(), e.unknown()),
535
+ columns: e.array(l).optional()
536
+ }).passthrough().optional()
537
+ }).passthrough(), be = e.object({
538
+ inputId: e.string().min(1),
539
+ status: e.enum(["applied", "inactive", "skipped", "overridden", "error"]),
540
+ reason: e.enum([
541
+ "unrelated",
542
+ "population_required",
543
+ "missing_dependency",
544
+ "missing_relationship",
545
+ "ambiguous_relationship",
546
+ "invalid_metadata",
547
+ "unsupported_dependency",
548
+ "override_not_eligible"
549
+ ]).optional()
550
+ }), fe = e.object({
551
+ complete: e.boolean(),
552
+ reason: e.enum(["unsupported", "truncated"]).optional()
553
+ }), Oe = e.object({
554
+ ...b,
555
+ kind: e.literal("inputOptions"),
556
+ dependencyOutcomes: e.array(be).optional(),
557
+ match: fe.optional(),
558
+ options: e.array(
559
+ se(
560
+ {
561
+ label: e.string(),
562
+ value: e.unknown(),
563
+ count: e.number().optional(),
564
+ disambiguation: e.array(e.string()).optional()
565
+ },
566
+ ["value"]
567
+ )
568
+ )
569
+ }).passthrough(), Ee = e.object({
570
+ ...b,
571
+ kind: e.literal("sql"),
572
+ columns: e.array(l),
573
+ records: p,
574
+ sqlShape: e.object({
575
+ statementType: e.string().optional(),
576
+ explicitLimit: e.number().optional(),
577
+ hasPythonCode: e.boolean().optional()
578
+ }).passthrough().optional()
579
+ }).passthrough();
580
+ 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,
607
+ D as d,
608
+ Re as e,
609
+ N as f,
610
+ p as g,
611
+ 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
630
+ };