react-semaphor 0.1.602 → 0.1.603

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 (107) hide show
  1. package/dist/analytics-protocol/index.js +415 -375
  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 +8 -8
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{add-to-dashboard-ClhEIFst.js → add-to-dashboard-CFF-wFU-.js} +1 -1
  7. package/dist/chunks/{analytics-base-schemas-DevrgqQb.js → analytics-base-schemas-DsUh5Q3C.js} +14 -12
  8. package/dist/chunks/{assistant-chat-BWF3GYip.js → assistant-chat-B6hNQI1t.js} +146 -146
  9. package/dist/chunks/{bookmark-impact-BF3iRx5a.js → bookmark-impact-Ba2PLcGp.js} +3 -3
  10. package/dist/chunks/{bookmark-state-CBSTdW6q.js → bookmark-state-n7AaNzR_.js} +517 -516
  11. package/dist/chunks/{card-filter-builder-B8XHwMY6.js → card-filter-builder-Y22HizVx.js} +104 -104
  12. package/dist/chunks/{comparison-window-caption-W83qB4V5.js → comparison-window-caption-Ck2TIbnR.js} +69 -69
  13. package/dist/chunks/{context-BJoEFgNl.js → context-UCQ7sere.js} +1 -1
  14. package/dist/chunks/{dashboard-DG5EIYYB.js → dashboard-BghI99oY.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CBSrhyWZ.js → dashboard-briefing-launcher-DtBAnGiH.js} +103 -103
  16. package/dist/chunks/{dashboard-controls-D6ECO4N1.js → dashboard-controls-CtFXlyjV.js} +53 -53
  17. package/dist/chunks/{dashboard-json-DrJftBSL.js → dashboard-json-DfGBUtCd.js} +5 -5
  18. package/dist/chunks/dates-BnrXF4bb.js +185 -0
  19. package/dist/chunks/{edit-dashboard-visual-BDYAJIbb.js → edit-dashboard-visual-oxt3x1wb.js} +7976 -8184
  20. package/dist/chunks/{filter-line-BXT6y303.js → filter-line-Cy5YYqRL.js} +27 -27
  21. package/dist/chunks/{filter-reach-copy-BukhZmzm.js → filter-reach-copy-CE_ZX147.js} +1590 -1729
  22. package/dist/chunks/{filter-value-text-D3-bf3_b.js → filter-value-text-fWvSDwkl.js} +11 -11
  23. package/dist/chunks/{index-BW0yozjs.js → index-D5rxbtS4.js} +24 -24
  24. package/dist/chunks/{layout-grid-Ds0diMeY.js → layout-grid-9LndRoLa.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-CgQgVeeI.js → matrix-analytical-definition-CCp48UCw.js} +496 -425
  26. package/dist/chunks/matrix-member-presentation-zNehruXR.js +391 -0
  27. package/dist/chunks/{matrix-operation-contract--DkNCOzd.js → matrix-operation-contract-DPBj69D8.js} +3 -2
  28. package/dist/chunks/{metric-comparison-zMylnIkc.js → metric-comparison-B0FR-Q8I.js} +184 -125
  29. package/dist/chunks/{paintbrush-CX8pao1j.js → paintbrush-58FQYY-y.js} +1 -1
  30. package/dist/chunks/{palette-CuA0HlzF.js → palette-Be62Tkoa.js} +1 -1
  31. package/dist/chunks/{pivot-result-contract-expectations-C8KL7hPx.js → pivot-result-contract-expectations-BYqAmG9n.js} +1236 -1190
  32. package/dist/chunks/{pivot-result-identity-C1AOH1PS.js → pivot-result-identity-CAP4--iq.js} +1 -1
  33. package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +3778 -0
  34. package/dist/chunks/{report-preferences-dialog-CbuVNDGi.js → report-preferences-dialog-uJp9GBTM.js} +219 -205
  35. package/dist/chunks/{report-runtime-context-E7USjN7E.js → report-runtime-context-c77_KF9v.js} +2 -2
  36. package/dist/chunks/{resolve-dashboard-input-context-CULCE_hM.js → resolve-dashboard-input-context-Rtl1ffmE.js} +7115 -6963
  37. package/dist/chunks/{save-BKHlDONy.js → save-C5A0JnEV.js} +1 -1
  38. package/dist/chunks/{saved-dashboard-context-C1WlOx5z.js → saved-dashboard-context-tcyTU8jm.js} +193 -207
  39. package/dist/chunks/selection-filter-compiler-DNijjI5y.js +150 -0
  40. package/dist/chunks/{semaphor-ready-indicator-CBIRcDWs.js → semaphor-ready-indicator-FBvunj6S.js} +35550 -35273
  41. package/dist/chunks/{shelf-drop-preview-context-xR69SMA8.js → shelf-drop-preview-context-QKStrcK9.js} +6 -6
  42. package/dist/chunks/{stored-dashboard-BuM8vnWf.js → stored-dashboard-CHozcAY9.js} +621 -616
  43. package/dist/chunks/{style-sheet-parts-Bt9ZNre8.js → style-sheet-parts-CDCG-8Ej.js} +258 -251
  44. package/dist/chunks/{table-export-sheet-DVljtHkG.js → table-export-sheet-ZFIvs6Sj.js} +1 -1
  45. package/dist/chunks/{token-types-D_xKgyVS.js → token-types-XbM6QByy.js} +1 -1
  46. package/dist/chunks/{upload-Dll_M7XQ.js → upload-H15d7uHK.js} +1 -1
  47. package/dist/chunks/{validators-ClWHpYql.js → validators-Baf3VIf5.js} +3 -3
  48. package/dist/chunks/{variable-draft-CDGGl53R.js → variable-draft-C2y8Jp6Z.js} +3 -3
  49. package/dist/dashboard/index.js +2 -2
  50. package/dist/dashboard-authoring/index.js +2466 -2343
  51. package/dist/format-utils/index.js +205 -204
  52. package/dist/index.js +20 -20
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +2 -2
  56. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
  57. package/dist/types/index.js +5 -5
  58. package/dist/types/lib/document/document-edits.d.ts +0 -4
  59. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  60. package/dist/types/lib/types/common-types.d.ts +0 -2
  61. package/dist/types/lib/types/explorer-types.d.ts +1 -1
  62. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
  63. package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
  64. package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
  65. package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
  66. package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
  67. package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
  68. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
  69. package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
  70. package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
  71. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
  72. package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
  73. package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
  74. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
  75. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  76. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
  77. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
  78. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
  79. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
  80. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  81. package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
  82. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
  83. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
  84. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
  85. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
  86. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
  87. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
  88. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
  89. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
  90. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
  91. package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
  92. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
  93. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +3 -0
  94. package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
  95. package/dist/types/shared/format-utils/index.d.ts +1 -0
  96. package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
  97. package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
  98. package/dist/types/shared/temporal/index.d.ts +2 -0
  99. package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
  100. package/dist/types/shared/temporal/temporal.d.ts +27 -0
  101. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
  102. package/dist/usage-events/index.js +1 -1
  103. package/package.json +3 -2
  104. package/dist/chunks/dates-Bz-qM5px.js +0 -164
  105. package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
  106. package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
  107. package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
@@ -1,6 +1,6 @@
1
- import { T as p, a as g, b as k } from "./analytics-base-schemas-DevrgqQb.js";
2
- import { p as C } from "./validators-ClWHpYql.js";
3
- function N(e) {
1
+ import { T as f, a as h, b as y } from "./analytics-base-schemas-DsUh5Q3C.js";
2
+ import { p as C } from "./validators-Baf3VIf5.js";
3
+ function P(e) {
4
4
  switch (e.kind) {
5
5
  case "monthDay":
6
6
  return {
@@ -26,7 +26,7 @@ function N(e) {
26
26
  };
27
27
  }
28
28
  case "periods": {
29
- const { unit: r, from: o, to: n, toDate: t } = e, a = e.anchor === "latest_data", s = e.anchor === "now", l = !!t && s, m = o === n;
29
+ const { unit: r, from: o, to: n, toDate: i } = e, a = e.anchor === "latest_data", s = e.anchor === "now", l = !!i && s, d = o === n;
30
30
  return {
31
31
  subDay: !1,
32
32
  dataAnchored: a,
@@ -35,93 +35,93 @@ function N(e) {
35
35
  bounds: { start: "day", end: l ? "instant" : "day" },
36
36
  comparesBySpan: typeof e.anchor == "object",
37
37
  printsByName: a || r === "quarter" || r === "year",
38
- dayPickerDefault: r === "day" && m && s,
39
- monthPickerDefault: r === "month" && m && (o === 0 || o === -1) && s && !t,
38
+ dayPickerDefault: r === "day" && d && s,
39
+ monthPickerDefault: r === "month" && d && (o === 0 || o === -1) && s && !i,
40
40
  span: { unit: r, n: n - o + 1, complete: n < 0 }
41
41
  };
42
42
  }
43
43
  }
44
44
  }
45
- function h(e) {
46
- const r = k.safeParse(e);
45
+ function $(e) {
46
+ const r = y.safeParse(e);
47
47
  return r.success ? { ok: !0, value: r.data } : {
48
48
  ok: !1,
49
49
  error: {
50
- code: p.invalidMetadata,
50
+ code: f.invalidMetadata,
51
51
  message: "Temporal bucket metadata is invalid.",
52
52
  path: "temporalBucket"
53
53
  }
54
54
  };
55
55
  }
56
- function f(e, r) {
56
+ function b(e, r) {
57
57
  if (!e.temporalBucket)
58
58
  return r.metadataRequired ? {
59
59
  ok: !1,
60
60
  error: {
61
- code: p.missingMetadata,
61
+ code: f.missingMetadata,
62
62
  message: "Activated temporal bucket result is missing metadata.",
63
63
  path: "temporalBucket"
64
64
  }
65
65
  } : { ok: !0 };
66
- const o = h(
66
+ const o = $(
67
67
  e.temporalBucket
68
68
  );
69
69
  if (!o.ok || !o.value)
70
70
  return o;
71
- const n = g(
71
+ const n = h(
72
72
  o.value.granularity
73
73
  );
74
74
  return e.dataType !== n ? {
75
75
  ok: !1,
76
76
  error: {
77
- code: p.invalidMetadata,
77
+ code: f.invalidMetadata,
78
78
  message: `${o.value.granularity} temporal buckets require dataType ${n}.`,
79
79
  path: "dataType"
80
80
  }
81
81
  } : o;
82
82
  }
83
- function y(e, r) {
84
- var o, n, t, a;
85
- return e.granularity === r.granularity && e.calendar.tz === r.calendar.tz && e.calendar.weekStart === r.calendar.weekStart && ((o = e.calendar.fiscalCalendar) == null ? void 0 : o.kind) === ((n = r.calendar.fiscalCalendar) == null ? void 0 : n.kind) && ((t = e.calendar.fiscalCalendar) == null ? void 0 : t.yearStartMonth) === ((a = r.calendar.fiscalCalendar) == null ? void 0 : a.yearStartMonth);
83
+ function w(e, r) {
84
+ var o, n, i, a;
85
+ return e.granularity === r.granularity && e.calendar.tz === r.calendar.tz && e.calendar.weekStart === r.calendar.weekStart && ((o = e.calendar.fiscalCalendar) == null ? void 0 : o.kind) === ((n = r.calendar.fiscalCalendar) == null ? void 0 : n.kind) && ((i = e.calendar.fiscalCalendar) == null ? void 0 : i.yearStartMonth) === ((a = r.calendar.fiscalCalendar) == null ? void 0 : a.yearStartMonth);
86
86
  }
87
- function A(e, r) {
87
+ function O(e, r) {
88
88
  const o = /* @__PURE__ */ new Map();
89
89
  for (const n of e) {
90
90
  if (o.has(n.key))
91
91
  return {
92
92
  ok: !1,
93
93
  error: {
94
- code: p.invalidMetadata,
94
+ code: f.invalidMetadata,
95
95
  message: `Canonical result contains duplicate column key "${n.key}".`,
96
96
  path: "columns"
97
97
  }
98
98
  };
99
99
  if (o.set(n.key, n), n.temporalBucket) {
100
- const t = f(n, {
100
+ const i = b(n, {
101
101
  metadataRequired: !1
102
102
  });
103
- if (!t.ok)
103
+ if (!i.ok)
104
104
  return {
105
105
  ok: !1,
106
106
  error: {
107
- ...t.error,
108
- path: `columns.${n.key}.${t.error.path || "temporalBucket"}`
107
+ ...i.error,
108
+ path: `columns.${n.key}.${i.error.path || "temporalBucket"}`
109
109
  }
110
110
  };
111
111
  }
112
112
  }
113
113
  for (const n of r) {
114
- const t = o.get(n.key);
115
- if (!t)
114
+ const i = o.get(n.key);
115
+ if (!i)
116
116
  return {
117
117
  ok: !1,
118
118
  error: {
119
- code: p.missingMetadata,
119
+ code: f.missingMetadata,
120
120
  message: `Activated temporal bucket result is missing column "${n.key}".`,
121
121
  path: `columns.${n.key}`
122
122
  }
123
123
  };
124
- const a = f(t, {
124
+ const a = b(i, {
125
125
  metadataRequired: !0
126
126
  });
127
127
  if (!a.ok)
@@ -132,11 +132,11 @@ function A(e, r) {
132
132
  path: `columns.${n.key}.${a.error.path || "temporalBucket"}`
133
133
  }
134
134
  };
135
- if (!a.value || !y(a.value, n.metadata))
135
+ if (!a.value || !w(a.value, n.metadata))
136
136
  return {
137
137
  ok: !1,
138
138
  error: {
139
- code: p.invalidMetadata,
139
+ code: f.invalidMetadata,
140
140
  message: `Temporal bucket metadata for column "${n.key}" contradicts the governed query context.`,
141
141
  path: `columns.${n.key}.temporalBucket`
142
142
  }
@@ -144,112 +144,165 @@ function A(e, r) {
144
144
  }
145
145
  return { ok: !0, value: e };
146
146
  }
147
- const $ = "higher_is_better", I = {
147
+ const _ = ["period", "day", "week", "month", "quarter", "year"];
148
+ function u(e) {
149
+ const r = (o) => o !== void 0 && o !== 1 ? { offset: o } : {};
150
+ switch (e.kind) {
151
+ case "target":
152
+ return { kind: "target", targetValue: e.targetValue };
153
+ case "shift":
154
+ return {
155
+ kind: "shift",
156
+ unit: e.unit,
157
+ ...r(e.offset),
158
+ ...e.matchWeekdays && e.unit === "year" ? { matchWeekdays: !0 } : {}
159
+ };
160
+ case "previous_period":
161
+ return { kind: "shift", unit: "period", ...r(e.offsetPeriods) };
162
+ case "previous_year":
163
+ return {
164
+ kind: "shift",
165
+ unit: "year",
166
+ ...r(e.offsetYears),
167
+ ...e.alignment === "weekday" ? { matchWeekdays: !0 } : {}
168
+ };
169
+ }
170
+ }
171
+ function R(e) {
172
+ const r = u(e);
173
+ return r.kind === "target" ? "target" : r.unit === "year" ? "previous_year" : "previous_period";
174
+ }
175
+ function B(e) {
176
+ return e.offset ?? 1;
177
+ }
178
+ const D = "higher_is_better", E = {
148
179
  displayMode: "difference",
149
180
  showComparison: !0,
150
181
  indicatorStyle: "arrow_badge",
151
182
  showColor: !0,
152
183
  conditionalLabel: !1
153
184
  };
154
- function w(e) {
185
+ function T(e) {
155
186
  return C(e) !== null;
156
187
  }
157
- function B(e) {
158
- var r, o, n, t;
159
- if (((r = e.metricComparison) == null ? void 0 : r.mode) !== "off") {
160
- if (((o = e.metricComparison) == null ? void 0 : o.mode) === "explicit")
161
- return { source: "explicit", spec: e.metricComparison.spec };
162
- if (!((e.inheritGlobalComparison ?? ((n = e.globalDateComparison) == null ? void 0 : n.inheritGlobalComparison)) === !1 || ((t = e.globalDateComparison) == null ? void 0 : t.selection.mode) !== "period"))
188
+ function M(e) {
189
+ var r, o;
190
+ return e.hidden || ((r = e.metricComparison) == null ? void 0 : r.mode) === "off" ? { state: "off" } : ((o = e.metricComparison) == null ? void 0 : o.mode) === "explicit" ? { state: "pinned", spec: u(e.metricComparison.spec) } : e.inheritGlobalComparison === !1 ? { state: "off" } : { state: "follow" };
191
+ }
192
+ function G(e) {
193
+ return (e == null ? void 0 : e.showComparison) === !1;
194
+ }
195
+ function j(e) {
196
+ var o, n;
197
+ const r = M({
198
+ metricComparison: e.metricComparison,
199
+ inheritGlobalComparison: e.inheritGlobalComparison ?? ((o = e.globalDateComparison) == null ? void 0 : o.inheritGlobalComparison)
200
+ });
201
+ if (r.state !== "off") {
202
+ if (r.state === "pinned") return { source: "explicit", spec: r.spec };
203
+ if (((n = e.globalDateComparison) == null ? void 0 : n.selection.mode) === "period")
163
204
  return {
164
205
  source: "inherited",
165
- spec: e.globalDateComparison.selection.spec,
206
+ spec: u(e.globalDateComparison.selection.spec),
166
207
  ...e.globalDateComparison.owner ? { owner: e.globalDateComparison.owner } : {}
167
208
  };
168
209
  }
169
210
  }
170
- function P(e) {
211
+ function L(e) {
171
212
  if (e.alias) return e.alias;
172
213
  const r = e.entityName && e.entityName !== "SEMAPHOR_CALCULATED_FIELD" ? e.entityName : void 0, o = r && r !== e.name ? `${r}_` : "";
173
214
  if (e.role !== "metric") return `${o}${e.name}`;
174
215
  let n = e.aggregate || "metric";
175
216
  if (e.expression) {
176
- const t = e.expression.match(
217
+ const i = e.expression.match(
177
218
  /^(COUNT|SUM|AVG|MIN|MAX|MEDIAN|DISTINCT)\s*\(/i
178
219
  );
179
- n = t ? t[1].toLowerCase() : "expr";
220
+ n = i ? i[1].toLowerCase() : "expr";
180
221
  } else
181
222
  n = n.toLowerCase();
182
223
  return `${o}${e.name}_${n}`;
183
224
  }
184
- function i(e, r, o) {
225
+ function t(e, r, o) {
185
226
  return o ? { code: e, message: r, path: o } : { code: e, message: r };
186
227
  }
187
- function d(e) {
228
+ function m(e) {
188
229
  return !!e && typeof e == "object" && !Array.isArray(e);
189
230
  }
190
231
  function c(e, r, o, n) {
191
- Object.keys(e).forEach((t) => {
192
- r.includes(t) || n.push(
193
- i(
232
+ Object.keys(e).forEach((i) => {
233
+ r.includes(i) || n.push(
234
+ t(
194
235
  "invalid_comparison_spec",
195
- `Comparison kind does not accept field "${t}".`,
196
- `${o}.${t}`
236
+ `Comparison kind does not accept field "${i}".`,
237
+ `${o}.${i}`
197
238
  )
198
239
  );
199
240
  });
200
241
  }
201
- function u(e, r, o) {
242
+ function g(e, r, o) {
202
243
  e.alignment !== void 0 && e.alignment !== "calendar" && e.alignment !== "weekday" && o.push(
203
- i(
244
+ t(
204
245
  "invalid_comparison_spec",
205
246
  'Comparison alignment must be "calendar" or "weekday".',
206
247
  `${r}.alignment`
207
248
  )
208
249
  ), e.toDate !== void 0 && typeof e.toDate != "boolean" && o.push(
209
- i(
250
+ t(
210
251
  "invalid_comparison_spec",
211
252
  "Comparison toDate must be a boolean.",
212
253
  `${r}.toDate`
213
254
  )
214
255
  );
215
256
  }
216
- function b(e, r, o) {
257
+ function p(e, r, o) {
217
258
  e !== void 0 && (typeof e != "number" || !Number.isSafeInteger(e) || e <= 0) && o.push(
218
- i(
259
+ t(
219
260
  "invalid_comparison_spec",
220
261
  "Comparison offset must be a positive safe integer.",
221
262
  r
222
263
  )
223
264
  );
224
265
  }
225
- function _(e, r = "comparison") {
266
+ function k(e, r = "comparison") {
226
267
  const o = [];
227
- return d(e) ? (e.kind === "previous_period" ? (c(
268
+ return m(e) ? (e.kind === "shift" ? (c(e, ["kind", "unit", "offset", "matchWeekdays"], r, o), _.includes(e.unit) || o.push(
269
+ t(
270
+ "invalid_comparison_spec",
271
+ `Comparison unit must be one of ${_.join(", ")}.`,
272
+ `${r}.unit`
273
+ )
274
+ ), p(e.offset, `${r}.offset`, o), e.matchWeekdays !== void 0 && (e.matchWeekdays !== !0 || e.unit !== "year") && o.push(
275
+ t(
276
+ "invalid_comparison_spec",
277
+ "matchWeekdays is true only on a step by years (52 weeks a year back).",
278
+ `${r}.matchWeekdays`
279
+ )
280
+ )) : e.kind === "previous_period" ? (c(
228
281
  e,
229
282
  ["kind", "offsetPeriods", "alignment", "toDate"],
230
283
  r,
231
284
  o
232
- ), b(e.offsetPeriods, `${r}.offsetPeriods`, o), u(e, r, o)) : e.kind === "previous_year" ? (c(
285
+ ), p(e.offsetPeriods, `${r}.offsetPeriods`, o), g(e, r, o)) : e.kind === "previous_year" ? (c(
233
286
  e,
234
287
  ["kind", "offsetYears", "alignment", "toDate"],
235
288
  r,
236
289
  o
237
- ), b(e.offsetYears, `${r}.offsetYears`, o), u(e, r, o)) : e.kind === "target" ? (c(e, ["kind", "targetValue"], r, o), (typeof e.targetValue != "number" || !Number.isFinite(e.targetValue)) && o.push(
238
- i(
290
+ ), p(e.offsetYears, `${r}.offsetYears`, o), g(e, r, o)) : e.kind === "target" ? (c(e, ["kind", "targetValue"], r, o), (typeof e.targetValue != "number" || !Number.isFinite(e.targetValue)) && o.push(
291
+ t(
239
292
  "invalid_comparison_spec",
240
293
  "Target comparison requires a finite targetValue.",
241
294
  `${r}.targetValue`
242
295
  )
243
296
  )) : o.push(
244
- i(
297
+ t(
245
298
  "invalid_comparison_spec",
246
- "Comparison kind must be previous_period, previous_year, or target.",
299
+ "Comparison kind must be shift or target.",
247
300
  `${r}.kind`
248
301
  )
249
302
  ), { ok: o.length === 0, errors: o, warnings: [] }) : {
250
303
  ok: !1,
251
304
  errors: [
252
- i(
305
+ t(
253
306
  "invalid_comparison_spec",
254
307
  "Comparison spec must be an object.",
255
308
  r
@@ -258,12 +311,12 @@ function _(e, r = "comparison") {
258
311
  warnings: []
259
312
  };
260
313
  }
261
- function R(e, r = "comparison") {
262
- if (!d(e))
314
+ function V(e, r = "comparison") {
315
+ if (!m(e))
263
316
  return {
264
317
  ok: !1,
265
318
  errors: [
266
- i(
319
+ t(
267
320
  "invalid_comparison_config",
268
321
  "Comparison config must be an object.",
269
322
  r
@@ -272,20 +325,20 @@ function R(e, r = "comparison") {
272
325
  warnings: []
273
326
  };
274
327
  const o = [];
275
- return e.mode === "off" ? c(e, ["mode"], r, o) : e.mode === "explicit" ? (c(e, ["mode", "spec"], r, o), o.push(..._(e.spec, `${r}.spec`).errors)) : o.push(
276
- i(
328
+ return e.mode === "off" ? c(e, ["mode"], r, o) : e.mode === "explicit" ? (c(e, ["mode", "spec"], r, o), o.push(...k(e.spec, `${r}.spec`).errors)) : o.push(
329
+ t(
277
330
  "invalid_comparison_config",
278
331
  "Comparison mode must be off or explicit.",
279
332
  `${r}.mode`
280
333
  )
281
334
  ), { ok: o.length === 0, errors: o, warnings: [] };
282
335
  }
283
- function D(e, r = "comparisonSelection") {
284
- if (!d(e))
336
+ function S(e, r = "comparisonSelection") {
337
+ if (!m(e))
285
338
  return {
286
339
  ok: !1,
287
340
  errors: [
288
- i(
341
+ t(
289
342
  "invalid_global_date_comparison",
290
343
  "Global Date comparison selection must be an object.",
291
344
  r
@@ -298,17 +351,17 @@ function D(e, r = "comparisonSelection") {
298
351
  c(e, ["mode"], r, o);
299
352
  else if (e.mode === "period") {
300
353
  c(e, ["mode", "spec"], r, o);
301
- const n = _(e.spec, `${r}.spec`);
302
- o.push(...n.errors), d(e.spec) && e.spec.kind === "target" && o.push(
303
- i(
354
+ const n = k(e.spec, `${r}.spec`);
355
+ o.push(...n.errors), m(e.spec) && e.spec.kind === "target" && o.push(
356
+ t(
304
357
  "invalid_global_date_comparison",
305
- "Global Date comparison supports previous_period or previous_year, not target.",
358
+ "A dashboard date comparison is a step back (shift), not a target.",
306
359
  `${r}.spec.kind`
307
360
  )
308
361
  );
309
362
  } else
310
363
  o.push(
311
- i(
364
+ t(
312
365
  "invalid_global_date_comparison",
313
366
  "Global Date comparison mode must be off or period.",
314
367
  `${r}.mode`
@@ -316,12 +369,12 @@ function D(e, r = "comparisonSelection") {
316
369
  );
317
370
  return { ok: o.length === 0, errors: o, warnings: [] };
318
371
  }
319
- function E(e, r = "globalDateComparison") {
320
- if (!d(e))
372
+ function q(e, r = "globalDateComparison") {
373
+ if (!m(e))
321
374
  return {
322
375
  ok: !1,
323
376
  errors: [
324
- i(
377
+ t(
325
378
  "invalid_global_date_comparison",
326
379
  "Global Date comparison context must be an object.",
327
380
  r
@@ -336,62 +389,62 @@ function E(e, r = "globalDateComparison") {
336
389
  r,
337
390
  o
338
391
  ), o.push(
339
- ...D(
392
+ ...S(
340
393
  e.selection,
341
394
  `${r}.selection`
342
395
  ).errors
343
396
  ), e.inheritGlobalComparison !== void 0 && e.inheritGlobalComparison !== !1 && o.push(
344
- i(
397
+ t(
345
398
  "invalid_global_date_comparison",
346
399
  "inheritGlobalComparison may only be false when present.",
347
400
  `${r}.inheritGlobalComparison`
348
401
  )
349
- ), e.owner !== void 0 && (d(e.owner) ? e.owner.kind === "global_date" ? c(e.owner, ["kind"], `${r}.owner`, o) : e.owner.kind === "field_date" ? (c(
402
+ ), e.owner !== void 0 && (m(e.owner) ? e.owner.kind === "global_date" ? c(e.owner, ["kind"], `${r}.owner`, o) : e.owner.kind === "field_date" ? (c(
350
403
  e.owner,
351
404
  ["kind", "filterId", "label"],
352
405
  `${r}.owner`,
353
406
  o
354
407
  ), (typeof e.owner.filterId != "string" || !e.owner.filterId.trim()) && o.push(
355
- i(
408
+ t(
356
409
  "invalid_global_date_comparison",
357
410
  "Field Date comparison owner requires a non-empty filterId.",
358
411
  `${r}.owner.filterId`
359
412
  )
360
413
  ), (typeof e.owner.label != "string" || !e.owner.label.trim()) && o.push(
361
- i(
414
+ t(
362
415
  "invalid_global_date_comparison",
363
416
  "Field Date comparison owner requires a non-empty label.",
364
417
  `${r}.owner.label`
365
418
  )
366
419
  )) : o.push(
367
- i(
420
+ t(
368
421
  "invalid_global_date_comparison",
369
422
  "Comparison owner kind must be global_date or field_date.",
370
423
  `${r}.owner.kind`
371
424
  )
372
425
  ) : o.push(
373
- i(
426
+ t(
374
427
  "invalid_global_date_comparison",
375
428
  "Comparison owner must be an object.",
376
429
  `${r}.owner`
377
430
  )
378
- )), e.referenceTime !== void 0 && (typeof e.referenceTime != "string" || !w(e.referenceTime)) && o.push(
379
- i(
431
+ )), e.referenceTime !== void 0 && (typeof e.referenceTime != "string" || !T(e.referenceTime)) && o.push(
432
+ t(
380
433
  "invalid_global_date_comparison",
381
434
  "referenceTime must be a valid ISO date-time string when present.",
382
435
  `${r}.referenceTime`
383
436
  )
384
437
  ), { ok: o.length === 0, errors: o, warnings: [] };
385
438
  }
386
- function O(e) {
439
+ function x(e) {
387
440
  const { referenceTime: r, ...o } = e;
388
441
  return o;
389
442
  }
390
- function G(e, r = "comparisonPolarity") {
443
+ function F(e, r = "comparisonPolarity") {
391
444
  return e === "higher_is_better" || e === "lower_is_better" || e === "neutral" ? { ok: !0, errors: [], warnings: [] } : {
392
445
  ok: !1,
393
446
  errors: [
394
- i(
447
+ t(
395
448
  "invalid_comparison_polarity",
396
449
  "Comparison polarity must be higher_is_better, lower_is_better, or neutral.",
397
450
  r
@@ -400,12 +453,12 @@ function G(e, r = "comparisonPolarity") {
400
453
  warnings: []
401
454
  };
402
455
  }
403
- function L(e, r = "comparisonPresentation") {
404
- if (!d(e))
456
+ function W(e, r = "comparisonPresentation") {
457
+ if (!m(e))
405
458
  return {
406
459
  ok: !1,
407
460
  errors: [
408
- i(
461
+ t(
409
462
  "invalid_comparison_presentation",
410
463
  "Comparison presentation must be an object.",
411
464
  r
@@ -427,7 +480,7 @@ function L(e, r = "comparisonPresentation") {
427
480
  ];
428
481
  return Object.keys(e).forEach((a) => {
429
482
  n.includes(a) || o.push(
430
- i(
483
+ t(
431
484
  "invalid_comparison_presentation",
432
485
  `Comparison presentation does not accept field "${a}".`,
433
486
  `${r}.${a}`
@@ -439,7 +492,7 @@ function L(e, r = "comparisonPresentation") {
439
492
  ["position", ["left", "right", "top"]]
440
493
  ].forEach(([a, s]) => {
441
494
  e[a] !== void 0 && !s.includes(e[a]) && o.push(
442
- i(
495
+ t(
443
496
  "invalid_comparison_presentation",
444
497
  `Comparison presentation ${a} is invalid.`,
445
498
  `${r}.${a}`
@@ -447,20 +500,20 @@ function L(e, r = "comparisonPresentation") {
447
500
  );
448
501
  }), ["showComparison", "showColor", "conditionalLabel"].forEach((a) => {
449
502
  e[a] !== void 0 && typeof e[a] != "boolean" && o.push(
450
- i(
503
+ t(
451
504
  "invalid_comparison_presentation",
452
505
  `Comparison presentation ${a} must be a boolean.`,
453
506
  `${r}.${a}`
454
507
  )
455
508
  );
456
509
  }), e.precision !== void 0 && (typeof e.precision != "number" || !Number.isInteger(e.precision) || e.precision < 0 || e.precision > 6) && o.push(
457
- i(
510
+ t(
458
511
  "invalid_comparison_presentation",
459
512
  "Comparison presentation precision must be an integer from 0 through 6.",
460
513
  `${r}.precision`
461
514
  )
462
515
  ), e.labelName !== void 0 && typeof e.labelName != "string" && o.push(
463
- i(
516
+ t(
464
517
  "invalid_comparison_presentation",
465
518
  "Comparison presentation labelName must be a string.",
466
519
  `${r}.labelName`
@@ -468,9 +521,9 @@ function L(e, r = "comparisonPresentation") {
468
521
  ), ["conditionalLabels", "colors"].forEach((a) => {
469
522
  const s = e[a];
470
523
  if (s !== void 0) {
471
- if (!d(s)) {
524
+ if (!m(s)) {
472
525
  o.push(
473
- i(
526
+ t(
474
527
  "invalid_comparison_presentation",
475
528
  `Comparison presentation ${a} must be an object.`,
476
529
  `${r}.${a}`
@@ -480,15 +533,15 @@ function L(e, r = "comparisonPresentation") {
480
533
  }
481
534
  Object.keys(s).forEach((l) => {
482
535
  ["increase", "decrease", "neutral"].includes(l) || o.push(
483
- i(
536
+ t(
484
537
  "invalid_comparison_presentation",
485
538
  `Comparison presentation ${a} does not accept field "${l}".`,
486
539
  `${r}.${a}.${l}`
487
540
  )
488
541
  );
489
- }), Object.entries(s).forEach(([l, m]) => {
490
- m !== void 0 && typeof m != "string" && o.push(
491
- i(
542
+ }), Object.entries(s).forEach(([l, d]) => {
543
+ d !== void 0 && typeof d != "string" && o.push(
544
+ t(
492
545
  "invalid_comparison_presentation",
493
546
  `Comparison presentation ${a}.${l} must be a string.`,
494
547
  `${r}.${a}.${l}`
@@ -498,18 +551,18 @@ function L(e, r = "comparisonPresentation") {
498
551
  }
499
552
  }), { ok: o.length === 0, errors: o, warnings: [] };
500
553
  }
501
- function T(e) {
554
+ function v(e) {
502
555
  return e === null ? "unknown" : e > 0 ? "increase" : e < 0 ? "decrease" : "no_change";
503
556
  }
504
- function v(e, r) {
557
+ function N(e, r) {
505
558
  return e === "unknown" || e === "no_change" || r === "neutral" ? "neutral" : r === "higher_is_better" && e === "increase" || r === "lower_is_better" && e === "decrease" ? "favorable" : "unfavorable";
506
559
  }
507
- function j(e) {
560
+ function U(e) {
508
561
  const {
509
562
  currentValue: r,
510
563
  comparisonValue: o,
511
- polarity: n = $
512
- } = e, a = r !== null && o !== null ? r - o : null, s = a !== null && o !== null && o !== 0 ? a / Math.abs(o) : null, l = r !== null && o !== null && o !== 0 ? r / o : null, m = T(a);
564
+ polarity: n = D
565
+ } = e, a = r !== null && o !== null ? r - o : null, s = a !== null && o !== null && o !== 0 ? a / Math.abs(o) : null, l = r !== null && o !== null && o !== 0 ? r / o : null, d = v(a);
513
566
  return {
514
567
  status: o === null ? "insufficient_history" : "available",
515
568
  currentValue: r,
@@ -517,25 +570,31 @@ function j(e) {
517
570
  delta: a,
518
571
  percentChange: s,
519
572
  ratio: l,
520
- direction: m,
521
- sentiment: v(m, n)
573
+ direction: d,
574
+ sentiment: N(d, n)
522
575
  };
523
576
  }
524
577
  export {
525
- I as C,
526
- $ as D,
527
- N as a,
528
- B as b,
529
- _ as c,
530
- R as d,
531
- D as e,
532
- E as f,
578
+ _ as C,
579
+ D,
580
+ P as a,
581
+ u as b,
582
+ R as c,
583
+ B as d,
584
+ E as e,
585
+ M as f,
533
586
  G as g,
534
- L as h,
535
- j as i,
536
- f as j,
537
- A as k,
538
- P as r,
539
- h as v,
540
- O as w
587
+ j as h,
588
+ k as i,
589
+ V as j,
590
+ S as k,
591
+ q as l,
592
+ F as m,
593
+ W as n,
594
+ U as o,
595
+ b as p,
596
+ O as q,
597
+ L as r,
598
+ $ as v,
599
+ x as w
541
600
  };
@@ -1,4 +1,4 @@
1
- import { c as a } from "./style-sheet-parts-Bt9ZNre8.js";
1
+ import { c as a } from "./style-sheet-parts-CDCG-8Ej.js";
2
2
  /**
3
3
  * @license lucide-react v0.453.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import { c } from "./style-sheet-parts-Bt9ZNre8.js";
1
+ import { c } from "./style-sheet-parts-CDCG-8Ej.js";
2
2
  /**
3
3
  * @license lucide-react v0.453.0 - ISC
4
4
  *