react-semaphor 0.1.590 → 0.1.592

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 (87) hide show
  1. package/dist/analytics-protocol/index.js +254 -236
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +7 -7
  4. package/dist/briefings/index.js +4 -4
  5. package/dist/chunks/{aggregate-measure-field-BrkXsSJp.js → aggregate-measure-field-DHlDj0Pc.js} +2 -2
  6. package/dist/chunks/{assistant-chat-C_6dBLUk.js → assistant-chat-BusR-5uT.js} +13 -13
  7. package/dist/chunks/bookmark-impact-DozXJZDS.js +76 -0
  8. package/dist/chunks/{bookmark-state-Bn7k3ttp.js → bookmark-state-Be2W3s6t.js} +632 -592
  9. package/dist/chunks/{card-filter-builder-6vflbF9O.js → card-filter-builder-DBTJ74yy.js} +916 -897
  10. package/dist/chunks/{comparison-window-caption-fqijZdVd.js → comparison-window-caption-h8w3ySL6.js} +90 -91
  11. package/dist/chunks/{dashboard-DpgRl65K.js → dashboard-CmzJzmph.js} +1 -1
  12. package/dist/chunks/{dashboard-briefing-launcher-BLbhONJz.js → dashboard-briefing-launcher-BOQGpYr2.js} +160 -160
  13. package/dist/chunks/{dashboard-controls-kCTYEEsq.js → dashboard-controls-BxI3e2_o.js} +64 -64
  14. package/dist/chunks/{dashboard-json-CNIFresY.js → dashboard-json-BMqXV2Rx.js} +4 -4
  15. package/dist/chunks/{dates-BoeweqEo.js → dates-DBsscxL_.js} +8 -8
  16. package/dist/chunks/{edit-dashboard-visual-D0eWTlPL.js → edit-dashboard-visual-Dvc_Pkfg.js} +5443 -5417
  17. package/dist/chunks/filter-line-CYT7KIXb.js +133 -0
  18. package/dist/chunks/{filter-reach-copy-eMhDPTYH.js → filter-reach-copy-hEzlpBu7.js} +224 -224
  19. package/dist/chunks/filter-value-text-CHBm4IU7.js +153 -0
  20. package/dist/chunks/{index-D8LFjI8j.js → index-BoYJqc3F.js} +24 -24
  21. package/dist/chunks/{layout-grid-BG__sPkb.js → layout-grid-DoFIfQGd.js} +1 -1
  22. package/dist/chunks/{list-filter-Cb8i7N8f.js → list-filter-BeTQxjNy.js} +1 -1
  23. package/dist/chunks/{matrix-analytical-definition-D9Ll_9R-.js → matrix-analytical-definition-CyWOwLmE.js} +17 -17
  24. package/dist/chunks/{matrix-member-presentation-DVBJR0MA.js → matrix-member-presentation-Bj2YcHAP.js} +1 -1
  25. package/dist/chunks/{matrix-operation-contract-JSmproo9.js → matrix-operation-contract-CAanJeCj.js} +60 -60
  26. package/dist/chunks/{metric-comparison-xE_J6hkg.js → metric-comparison-BeKnUD08.js} +27 -31
  27. package/dist/chunks/{paintbrush-C310xSuR.js → paintbrush-KeaU1L1a.js} +1 -1
  28. package/dist/chunks/{palette-Ci5P91Zb.js → palette-BcFJLeXB.js} +1 -1
  29. package/dist/chunks/{pivot-result-contract-expectations-DbBahmgc.js → pivot-result-contract-expectations-CaS0y823.js} +522 -486
  30. package/dist/chunks/{pivot-result-identity-CUsMt_4r.js → pivot-result-identity-BKUjYO1u.js} +1 -1
  31. package/dist/chunks/raw-temporal-value-BzdgeDa7.js +454 -0
  32. package/dist/chunks/{report-preferences-dialog-dUlVLgEk.js → report-preferences-dialog-Cu_f-8Kw.js} +13 -13
  33. package/dist/chunks/{report-runtime-context-CrOgmuxO.js → report-runtime-context-g4Zp_TU9.js} +1 -1
  34. package/dist/chunks/{resolve-dashboard-input-context-NurwNg4I.js → resolve-dashboard-input-context-CkMk1RW6.js} +7600 -6398
  35. package/dist/chunks/{save-BhhXfp4s.js → save-C9CZAk6V.js} +1 -1
  36. package/dist/chunks/{saved-dashboard-context-CPp--vXU.js → saved-dashboard-context-RgBS_PIj.js} +19 -19
  37. package/dist/chunks/{selection-filter-compiler-CHG-8xnW.js → selection-filter-compiler-BclSpK3P.js} +1 -1
  38. package/dist/chunks/{semaphor-ready-indicator-CXojR95M.js → semaphor-ready-indicator-DXpTZJ7R.js} +31502 -31453
  39. package/dist/chunks/{shelf-drop-preview-context-BDScAUdq.js → shelf-drop-preview-context-qdlJKaH7.js} +5 -5
  40. package/dist/chunks/stored-dashboard-Baw6Bp2A.js +4029 -0
  41. package/dist/chunks/{style-sheet-parts-CmXmKqGw.js → style-sheet-parts-DM_Mw_sm.js} +45 -42
  42. package/dist/chunks/{table-export-sheet-ClSgERQC.js → table-export-sheet-Cd6z7SsG.js} +1 -1
  43. package/dist/chunks/{token-types-DTocOcwt.js → token-types-BB2ImFx6.js} +1 -1
  44. package/dist/chunks/{upload-DDYc1Qjj.js → upload-CMTCg47S.js} +1 -1
  45. package/dist/chunks/{validators-CrYXNnNE.js → validators-BlEWWX9O.js} +576 -562
  46. package/dist/chunks/{variable-draft-Bi3RlULA.js → variable-draft-BxtN6YcG.js} +4 -4
  47. package/dist/dashboard/index.js +2 -2
  48. package/dist/dashboard-authoring/index.js +1672 -1633
  49. package/dist/format-utils/index.js +217 -218
  50. package/dist/index.js +62 -62
  51. package/dist/report-runtime-context/index.js +1 -1
  52. package/dist/style.css +1 -1
  53. package/dist/surfboard/index.js +2 -2
  54. package/dist/types/components/surfboard/filter/types.d.ts +7 -5
  55. package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +3 -3
  56. package/dist/types/components/visual/data-table/types/data-table.d.ts +24 -2
  57. package/dist/types/index.js +30 -29
  58. package/dist/types/lib/dashboard-inputs/dashboard-date-comparison-plan.d.ts +0 -1
  59. package/dist/types/lib/dashboard-viewer/table-view-edit.d.ts +27 -0
  60. package/dist/types/lib/dashboard-viewer/table-view.d.ts +37 -1
  61. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
  62. package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +1 -1
  63. package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +2 -1
  64. package/dist/types/shared/analytics-protocol/relative-date/sentence.d.ts +81 -0
  65. package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +0 -9
  66. package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +23 -2
  67. package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +20 -0
  68. package/dist/types/shared/dashboard-authoring/card-formats/detail-date-display.d.ts +84 -0
  69. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  70. package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +2 -0
  71. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +6 -0
  72. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +11 -0
  73. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +36 -36
  74. package/dist/types/shared/dashboard-authoring/filter-model/date-filter-default.d.ts +37 -0
  75. package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +1 -0
  76. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  77. package/dist/types/shared/dashboard-viewer/table-column-move.d.ts +56 -0
  78. package/dist/types/shared/dashboard-viewer/table-settings.d.ts +7 -0
  79. package/dist/types/shared/format-utils/filter-line.d.ts +2 -0
  80. package/package.json +1 -1
  81. package/dist/chunks/bookmark-impact-DkZABEd3.js +0 -75
  82. package/dist/chunks/filter-line-Dza3ee4w.js +0 -131
  83. package/dist/chunks/filter-value-text-DQw4v3nC.js +0 -146
  84. package/dist/chunks/pivot-header-presentation-D-DfPAjb.js +0 -42
  85. package/dist/chunks/raw-temporal-value-BnGCWJAL.js +0 -322
  86. package/dist/chunks/stored-dashboard-KkH4zOhq.js +0 -4998
  87. package/dist/types/components/visual/shared/utils/table-column-order.d.ts +0 -53
@@ -1,24 +1,24 @@
1
1
  var Yn = Object.defineProperty;
2
2
  var zn = (e, t, n) => t in e ? Yn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var $ = (e, t, n) => zn(e, typeof t != "symbol" ? t + "" : t, n);
3
+ var k = (e, t, n) => zn(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { z as w } from "zod";
5
- import { E as jt, l as Ht } from "./export-file-format-C-tJsxsf.js";
6
- import { a$ as qt, b0 as An, aU as Rn, m as it, a5 as Un, M as Ln, b1 as Wn, b2 as jn, R as Hn, I as X, S as qn } from "./validators-CrYXNnNE.js";
7
- import "./matrix-operation-contract-JSmproo9.js";
5
+ import { E as Ht, l as qt } from "./export-file-format-C-tJsxsf.js";
6
+ import { b1 as Zt, b2 as An, aW as Rn, m as ot, a7 as Un, O as Ln, b3 as Wn, b4 as jn, T as Hn, K as X, U as qn } from "./validators-BlEWWX9O.js";
7
+ import "./matrix-operation-contract-CAanJeCj.js";
8
8
  import { k as Zn, i as ge } from "./analytics-base-schemas-8wz9vqn_.js";
9
- import { b as Xn } from "./report-runtime-context-CrOgmuxO.js";
9
+ import { b as Xn } from "./report-runtime-context-g4Zp_TU9.js";
10
10
  import { canonicalizeSupportedLocale as Q, canonicalizeSupportedCurrencyCode as Le, DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as Bn } from "../value-format-preferences/index.js";
11
- import { p as Vn, a as Kn, c as Gn, i as ot, s as ye, h as Qn, b as Jn } from "./raw-temporal-value-BnGCWJAL.js";
12
- import { a as er } from "./metric-comparison-xE_J6hkg.js";
11
+ import { p as Vn, a as Kn, c as Gn, i as st, s as ye, C as Qn, u as Jn } from "./raw-temporal-value-BzdgeDa7.js";
12
+ import { a as er } from "./metric-comparison-BeKnUD08.js";
13
13
  function J(e) {
14
14
  if (!e || typeof e != "object") return !1;
15
15
  const t = e.type;
16
16
  return t === "number" || t === "currency" || t === "percent" || t === "scientific";
17
17
  }
18
- function ks(e) {
18
+ function _s(e) {
19
19
  return J(e) || !!e && typeof e == "object" && e.type === "duration";
20
20
  }
21
- const Zt = [
21
+ const Xt = [
22
22
  "day",
23
23
  "hour",
24
24
  "minute",
@@ -46,18 +46,18 @@ const Zt = [
46
46
  function rr(e) {
47
47
  return e === "day" || e === "hour" || e === "minute" || e === "second" || e === "millisecond";
48
48
  }
49
- function Xt(e, t) {
49
+ function Bt(e, t) {
50
50
  return rr(e) ? e : t;
51
51
  }
52
- function st(e, t) {
53
- return Zt.indexOf(Xt(e, t));
52
+ function ct(e, t) {
53
+ return Xt.indexOf(Bt(e, t));
54
54
  }
55
55
  function ar(e, t) {
56
- const n = st(e, "day"), r = st(t, "second"), a = Math.min(n, r), i = Math.max(n, r);
57
- return Zt.slice(a, i + 1);
56
+ const n = ct(e, "day"), r = ct(t, "second"), a = Math.min(n, r), i = Math.max(n, r);
57
+ return Xt.slice(a, i + 1);
58
58
  }
59
59
  function ir(e, t) {
60
- return e * We[Xt(t, "second")];
60
+ return e * We[Bt(t, "second")];
61
61
  }
62
62
  function or(e, t) {
63
63
  const n = ar(t.largestUnit, t.smallestUnit), r = n[n.length - 1], a = We[r];
@@ -91,7 +91,7 @@ function lr(e, t, n) {
91
91
  const r = `${n.prefix || ""}${e}${n.suffix || ""}`;
92
92
  return t ? n.negativeInParentheses ? `(${r})` : `-${r}` : r;
93
93
  }
94
- function Bt(e, t = {}) {
94
+ function Vt(e, t = {}) {
95
95
  if (e == null)
96
96
  return "";
97
97
  const n = typeof e == "number" ? e : typeof e == "string" && e.trim() ? Number(e) : NaN;
@@ -100,8 +100,8 @@ function Bt(e, t = {}) {
100
100
  const r = t.inputUnit || "second", a = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", i = n < 0, o = Math.abs(ir(n, r)), s = or(o, t), c = a === "digital" ? ur(s) : a === "long" ? cr(s, t.maxUnits) : sr(s, t.maxUnits);
101
101
  return lr(c, i, t);
102
102
  }
103
- function Vt(e, t) {
104
- return Bt(
103
+ function Kt(e, t) {
104
+ return Vt(
105
105
  e !== null && typeof e == "object" ? e.value : e,
106
106
  {
107
107
  inputUnit: t.inputUnit,
@@ -115,21 +115,21 @@ function Vt(e, t) {
115
115
  }
116
116
  );
117
117
  }
118
- let ct;
119
- function ut(e, t) {
118
+ let ut;
119
+ function lt(e, t) {
120
120
  const n = e.format;
121
121
  return n(t);
122
122
  }
123
123
  function mr(e, t) {
124
- if (ct ?? (ct = ut(
124
+ if (ut ?? (ut = lt(
125
125
  new Intl.NumberFormat("en-US", { useGrouping: !1, maximumFractionDigits: 6 }),
126
126
  "9007199254740993.000009"
127
- ) === "9007199254740993.000009"), !ct)
127
+ ) === "9007199254740993.000009"), !ut)
128
128
  throw new RangeError("This runtime cannot format exact decimal strings.");
129
129
  const n = Number(e);
130
130
  if (!Number.isFinite(n) || n === 0 && e !== "0")
131
131
  throw new RangeError("Exact value is outside the Intl formatting range; use raw text.");
132
- return ut(t, e);
132
+ return lt(t, e);
133
133
  }
134
134
  function ee(e) {
135
135
  return typeof e == "number" ? e < 0 : e.value.startsWith("-");
@@ -140,55 +140,55 @@ function B(e) {
140
140
  function fr(e) {
141
141
  return typeof e == "number" ? e === 0 : /^-?0*(\.0*)?$/.test(e.value);
142
142
  }
143
- function Kt(e, t) {
143
+ function Gt(e, t) {
144
144
  return typeof e == "number" ? e * t : {
145
145
  kind: "exact_number",
146
146
  type: "decimal",
147
- value: qt(e.value, t)
147
+ value: Zt(e.value, t)
148
148
  };
149
149
  }
150
150
  function pe(e, t) {
151
151
  return t === 0 ? e : typeof e == "number" ? e / 10 ** t : {
152
152
  kind: "exact_number",
153
153
  type: "decimal",
154
- value: qt(e.value, `1e-${t}`)
154
+ value: Zt(e.value, `1e-${t}`)
155
155
  };
156
156
  }
157
157
  function A(e, t) {
158
158
  return typeof e == "number" ? t.format(e) : mr(e.value, t);
159
159
  }
160
- function lt(e) {
160
+ function mt(e) {
161
161
  if (!e) return !1;
162
162
  const t = e.toLowerCase().replace("_", "-");
163
163
  return t === "en-in" || t.startsWith("en-in-");
164
164
  }
165
- function mt(e, t) {
165
+ function ft(e, t) {
166
166
  const n = B(e), r = (a) => typeof n == "number" ? n >= a : An(n.value, String(a)) >= 0;
167
- return r(1e12) ? { power: 12, suffix: "T" } : r(1e9) ? { power: 9, suffix: "B" } : lt(t) && r(1e7) ? { power: 7, suffix: "Cr" } : r(1e6) ? { power: 6, suffix: "M" } : lt(t) && r(1e5) ? { power: 5, suffix: "L" } : r(1e3) ? { power: 3, suffix: "K" } : { power: 0, suffix: "" };
167
+ return r(1e12) ? { power: 12, suffix: "T" } : r(1e9) ? { power: 9, suffix: "B" } : mt(t) && r(1e7) ? { power: 7, suffix: "Cr" } : r(1e6) ? { power: 6, suffix: "M" } : mt(t) && r(1e5) ? { power: 5, suffix: "L" } : r(1e3) ? { power: 3, suffix: "K" } : { power: 0, suffix: "" };
168
168
  }
169
169
  function je(e, t) {
170
170
  try {
171
171
  const n = W(t);
172
- return mt(e, n);
172
+ return ft(e, n);
173
173
  } catch {
174
- return mt(e, "en-US");
174
+ return ft(e, "en-US");
175
175
  }
176
176
  }
177
- const Gt = 500, ae = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map();
178
- function _(e, t = {}) {
177
+ const Qt = 500, ae = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map();
178
+ function N(e, t = {}) {
179
179
  const n = `${e}|${JSON.stringify(t)}`;
180
180
  let r = ae.get(n);
181
- return r || (r = new Intl.NumberFormat(e, t), ae.size >= Gt && ae.clear(), ae.set(n, r)), r;
181
+ return r || (r = new Intl.NumberFormat(e, t), ae.size >= Qt && ae.clear(), ae.set(n, r)), r;
182
182
  }
183
183
  function dr(e) {
184
184
  let t = ie.get(e);
185
185
  if (t === void 0) {
186
186
  try {
187
- _(e), t = !0;
187
+ N(e), t = !0;
188
188
  } catch {
189
189
  t = !1;
190
190
  }
191
- ie.size >= Gt && ie.clear(), ie.set(e, t);
191
+ ie.size >= Qt && ie.clear(), ie.set(e, t);
192
192
  }
193
193
  return t;
194
194
  }
@@ -200,17 +200,17 @@ function Be(e, t) {
200
200
  return "";
201
201
  const n = W(t == null ? void 0 : t.locale);
202
202
  let r = e;
203
- if (t != null && t.multiplyBy && (r = Kt(r, t.multiplyBy)), t != null && t.useSuffix) {
203
+ if (t != null && t.multiplyBy && (r = Gt(r, t.multiplyBy)), t != null && t.useSuffix) {
204
204
  const { power: i, suffix: o } = je(r, n);
205
205
  r = pe(r, i);
206
- const s = A(r, _(n, {
206
+ const s = A(r, N(n, {
207
207
  minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
208
208
  maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2,
209
209
  useGrouping: (t == null ? void 0 : t.useGrouping) ?? !0
210
210
  }));
211
211
  return `${(t == null ? void 0 : t.prefix) ?? ""}${s}${o}${(t == null ? void 0 : t.suffix) ?? ""}`;
212
212
  }
213
- const a = A(r, _(n, {
213
+ const a = A(r, N(n, {
214
214
  minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
215
215
  maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2,
216
216
  useGrouping: (t == null ? void 0 : t.useGrouping) ?? !0
@@ -221,13 +221,13 @@ function Be(e, t) {
221
221
  }
222
222
  return `${(t == null ? void 0 : t.prefix) ?? ""}${a}${(t == null ? void 0 : t.suffix) ?? ""}`;
223
223
  }
224
- function Qt(e, t) {
224
+ function Jt(e, t) {
225
225
  if (e == null || Number.isNaN(e))
226
226
  return "";
227
227
  const n = W(t == null ? void 0 : t.locale), r = (t == null ? void 0 : t.currency) || "USD", a = ee(e), i = !!(t != null && t.negativeInParentheses && a), o = i ? B(e) : e;
228
228
  try {
229
229
  if (t != null && t.useSuffix) {
230
- const { power: c, suffix: u } = je(o, n), l = pe(o, c), m = `${A(l, _(n, {
230
+ const { power: c, suffix: u } = je(o, n), l = pe(o, c), m = `${A(l, N(n, {
231
231
  style: "currency",
232
232
  currency: r,
233
233
  minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
@@ -236,7 +236,7 @@ function Qt(e, t) {
236
236
  }))}${u}`;
237
237
  return i ? `(${m})` : m;
238
238
  }
239
- const s = A(o, _(n, {
239
+ const s = A(o, N(n, {
240
240
  style: "currency",
241
241
  currency: r,
242
242
  minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
@@ -257,22 +257,22 @@ function Qt(e, t) {
257
257
  return a ? t != null && t.negativeInParentheses ? `(${l})` : `-${l}` : l;
258
258
  }
259
259
  }
260
- function Jt(e, t) {
260
+ function en(e, t) {
261
261
  if (e == null || Number.isNaN(e))
262
262
  return "";
263
263
  const n = W(t == null ? void 0 : t.locale), a = (t == null ? void 0 : t.alreadyPercent) ?? (t == null ? void 0 : t.percentValueMode) === "whole" ? pe(e, 2) : e;
264
- return A(a, _(n, {
264
+ return A(a, N(n, {
265
265
  style: "percent",
266
266
  minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
267
267
  maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2,
268
268
  useGrouping: (t == null ? void 0 : t.useGrouping) ?? !0
269
269
  }));
270
270
  }
271
- function en(e, t) {
271
+ function tn(e, t) {
272
272
  if (e == null || Number.isNaN(e))
273
273
  return "";
274
274
  const n = W(t == null ? void 0 : t.locale);
275
- return A(e, _(n, {
275
+ return A(e, N(n, {
276
276
  notation: "scientific",
277
277
  minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
278
278
  maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2
@@ -282,7 +282,7 @@ function hr(e, t) {
282
282
  const n = t ?? "auto", r = n === "never" ? B(e) : e, a = !ee(r) && (n === "always" || n === "exceptZero" && !fr(r));
283
283
  return { value: r, plus: a };
284
284
  }
285
- function _s(e) {
285
+ function Ns(e) {
286
286
  if (!e || !("signDisplay" in e)) return e;
287
287
  const { signDisplay: t, ...n } = e;
288
288
  return n;
@@ -290,7 +290,7 @@ function _s(e) {
290
290
  function Ve(e, t) {
291
291
  if (e == null || Number.isNaN(e))
292
292
  return "";
293
- const n = t.scale === void 0 ? e : Kt(e, t.scale), r = hr(n, t.signDisplay), a = r.value, i = r.plus ? "+" : "", o = t.negativeStyle === "parentheses" && ee(a), s = o ? B(a) : a, c = {
293
+ const n = t.scale === void 0 ? e : Gt(e, t.scale), r = hr(n, t.signDisplay), a = r.value, i = r.plus ? "+" : "", o = t.negativeStyle === "parentheses" && ee(a), s = o ? B(a) : a, c = {
294
294
  style: t.type === "number" ? "decimal" : t.type,
295
295
  locale: t.locale,
296
296
  currency: t.currency,
@@ -303,13 +303,13 @@ function Ve(e, t) {
303
303
  let u;
304
304
  switch (t.type) {
305
305
  case "currency":
306
- u = Qt(s, c);
306
+ u = Jt(s, c);
307
307
  break;
308
308
  case "percent":
309
- u = Jt(s, c);
309
+ u = en(s, c);
310
310
  break;
311
311
  case "scientific":
312
- u = en(s, c);
312
+ u = tn(s, c);
313
313
  break;
314
314
  default:
315
315
  u = Be(s, c);
@@ -318,21 +318,21 @@ function Ve(e, t) {
318
318
  const l = `${t.prefix ?? ""}${i}${u}${t.suffix ?? ""}`;
319
319
  return o ? `(${l})` : l;
320
320
  }
321
- function Ns(e, t) {
322
- return t.type === "duration" ? e == null ? "" : Vt(e, t) : Ve(e, t);
321
+ function $s(e, t) {
322
+ return t.type === "duration" ? e == null ? "" : Kt(e, t) : Ve(e, t);
323
323
  }
324
324
  function gr(e, t, n = "en-US") {
325
325
  if (e == null || typeof e == "number" && isNaN(e))
326
326
  return "";
327
327
  if ((t == null ? void 0 : t.style) === "duration")
328
- return Vt(e, {
328
+ return Kt(e, {
329
329
  ...t.duration,
330
330
  prefix: t.prefix,
331
331
  suffix: t.suffix,
332
332
  negativeStyle: t.negativeStyle
333
333
  });
334
334
  const r = W((t == null ? void 0 : t.locale) || n), a = (t == null ? void 0 : t.style) || "decimal", i = a === "decimal" ? "number" : a;
335
- return i === "currency" && _(r, {
335
+ return i === "currency" && N(r, {
336
336
  style: "currency",
337
337
  currency: (t == null ? void 0 : t.currency) || "USD"
338
338
  }), Ve(e, {
@@ -350,7 +350,7 @@ function gr(e, t, n = "en-US") {
350
350
  suffix: t == null ? void 0 : t.suffix
351
351
  });
352
352
  }
353
- function $s(e, t, n) {
353
+ function Es(e, t, n) {
354
354
  const r = {
355
355
  style: t === "currency" ? "currency" : t === "percent" ? "percent" : "decimal",
356
356
  locale: n == null ? void 0 : n.locale,
@@ -365,11 +365,11 @@ function $s(e, t, n) {
365
365
  };
366
366
  switch (t) {
367
367
  case "currency":
368
- return Qt(e, r);
369
- case "percent":
370
368
  return Jt(e, r);
371
- case "scientific":
369
+ case "percent":
372
370
  return en(e, r);
371
+ case "scientific":
372
+ return tn(e, r);
373
373
  default:
374
374
  return Be(e, r);
375
375
  }
@@ -378,10 +378,10 @@ function p(e) {
378
378
  const t = Object.prototype.toString.call(e);
379
379
  return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
380
380
  }
381
- function N(e, t) {
381
+ function $(e, t) {
382
382
  return e instanceof Date ? new e.constructor(t) : new Date(t);
383
383
  }
384
- const tn = 6048e5, yr = 864e5, nn = 6e4, rn = 36e5, Es = 525600, oe = 43200, ft = 1440;
384
+ const nn = 6048e5, yr = 864e5, rn = 6e4, an = 36e5, Is = 525600, oe = 43200, dt = 1440;
385
385
  let pr = {};
386
386
  function j() {
387
387
  return pr;
@@ -394,15 +394,15 @@ function V(e, t) {
394
394
  function we(e) {
395
395
  return V(e, { weekStartsOn: 1 });
396
396
  }
397
- function an(e) {
398
- const t = p(e), n = t.getFullYear(), r = N(e, 0);
397
+ function on(e) {
398
+ const t = p(e), n = t.getFullYear(), r = $(e, 0);
399
399
  r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
400
- const a = we(r), i = N(e, 0);
400
+ const a = we(r), i = $(e, 0);
401
401
  i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
402
402
  const o = we(i);
403
403
  return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >= o.getTime() ? n : n - 1;
404
404
  }
405
- function dt(e) {
405
+ function ht(e) {
406
406
  const t = p(e);
407
407
  return t.setHours(0, 0, 0, 0), t;
408
408
  }
@@ -421,30 +421,30 @@ function Te(e) {
421
421
  return n.setUTCFullYear(t.getFullYear()), +e - +n;
422
422
  }
423
423
  function wr(e, t) {
424
- const n = dt(e), r = dt(t), a = +n - Te(n), i = +r - Te(r);
424
+ const n = ht(e), r = ht(t), a = +n - Te(n), i = +r - Te(r);
425
425
  return Math.round((a - i) / yr);
426
426
  }
427
427
  function Tr(e) {
428
- const t = an(e), n = N(e, 0);
428
+ const t = on(e), n = $(e, 0);
429
429
  return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), we(n);
430
430
  }
431
431
  function le(e, t) {
432
432
  const n = p(e), r = p(t), a = n.getTime() - r.getTime();
433
433
  return a < 0 ? -1 : a > 0 ? 1 : a;
434
434
  }
435
- function Dr(e) {
436
- return N(e, Date.now());
435
+ function vr(e) {
436
+ return $(e, Date.now());
437
437
  }
438
- function br(e) {
438
+ function Dr(e) {
439
439
  return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
440
440
  }
441
- function xr(e) {
442
- if (!br(e) && typeof e != "number")
441
+ function br(e) {
442
+ if (!Dr(e) && typeof e != "number")
443
443
  return !1;
444
444
  const t = p(e);
445
445
  return !isNaN(Number(t));
446
446
  }
447
- function vr(e, t) {
447
+ function xr(e, t) {
448
448
  const n = p(e), r = p(t), a = n.getFullYear() - r.getFullYear(), i = n.getMonth() - r.getMonth();
449
449
  return a * 12 + i;
450
450
  }
@@ -471,7 +471,7 @@ function Nr(e) {
471
471
  }
472
472
  function $r(e, t) {
473
473
  const n = p(e), r = p(t), a = le(n, r), i = Math.abs(
474
- vr(n, r)
474
+ xr(n, r)
475
475
  );
476
476
  let o;
477
477
  if (i < 1)
@@ -488,7 +488,7 @@ function Er(e, t, n) {
488
488
  return Sr(n == null ? void 0 : n.roundingMethod)(r);
489
489
  }
490
490
  function Ir(e) {
491
- const t = p(e), n = N(e, 0);
491
+ const t = p(e), n = $(e, 0);
492
492
  return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
493
493
  }
494
494
  const Or = {
@@ -910,7 +910,7 @@ const Gr = /^(\d+)(th|st|nd|rd)?/i, Qr = /\d+/i, Jr = {
910
910
  parsePatterns: ca,
911
911
  defaultParseWidth: "any"
912
912
  })
913
- }, on = {
913
+ }, sn = {
914
914
  code: "en-US",
915
915
  formatDistance: Fr,
916
916
  formatLong: zr,
@@ -928,31 +928,31 @@ function la(e) {
928
928
  }
929
929
  function ma(e) {
930
930
  const t = p(e), n = +we(t) - +Tr(t);
931
- return Math.round(n / tn) + 1;
931
+ return Math.round(n / nn) + 1;
932
932
  }
933
- function sn(e, t) {
933
+ function cn(e, t) {
934
934
  var l, f, m, h;
935
- const n = p(e), r = n.getFullYear(), a = j(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((f = (l = t == null ? void 0 : t.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((h = (m = a.locale) == null ? void 0 : m.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, o = N(e, 0);
935
+ const n = p(e), r = n.getFullYear(), a = j(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((f = (l = t == null ? void 0 : t.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((h = (m = a.locale) == null ? void 0 : m.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, o = $(e, 0);
936
936
  o.setFullYear(r + 1, 0, i), o.setHours(0, 0, 0, 0);
937
- const s = V(o, t), c = N(e, 0);
937
+ const s = V(o, t), c = $(e, 0);
938
938
  c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
939
939
  const u = V(c, t);
940
940
  return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= u.getTime() ? r : r - 1;
941
941
  }
942
942
  function fa(e, t) {
943
943
  var s, c, u, l;
944
- const n = j(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, a = sn(e, t), i = N(e, 0);
944
+ const n = j(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, a = cn(e, t), i = $(e, 0);
945
945
  return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), V(i, t);
946
946
  }
947
947
  function da(e, t) {
948
948
  const n = p(e), r = +V(n, t) - +fa(n, t);
949
- return Math.round(r / tn) + 1;
949
+ return Math.round(r / nn) + 1;
950
950
  }
951
951
  function y(e, t) {
952
952
  const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
953
953
  return n + r;
954
954
  }
955
- const k = {
955
+ const _ = {
956
956
  // Year
957
957
  y(e, t) {
958
958
  const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
@@ -1013,7 +1013,7 @@ const k = {
1013
1013
  afternoon: "afternoon",
1014
1014
  evening: "evening",
1015
1015
  night: "night"
1016
- }, ht = {
1016
+ }, gt = {
1017
1017
  // Era
1018
1018
  G: function(e, t, n) {
1019
1019
  const r = e.getFullYear() > 0 ? 1 : 0;
@@ -1035,11 +1035,11 @@ const k = {
1035
1035
  const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
1036
1036
  return n.ordinalNumber(a, { unit: "year" });
1037
1037
  }
1038
- return k.y(e, t);
1038
+ return _.y(e, t);
1039
1039
  },
1040
1040
  // Local week-numbering year
1041
1041
  Y: function(e, t, n, r) {
1042
- const a = sn(e, r), i = a > 0 ? a : 1 - a;
1042
+ const a = cn(e, r), i = a > 0 ? a : 1 - a;
1043
1043
  if (t === "YY") {
1044
1044
  const o = i % 100;
1045
1045
  return y(o, 2);
@@ -1048,7 +1048,7 @@ const k = {
1048
1048
  },
1049
1049
  // ISO week-numbering year
1050
1050
  R: function(e, t) {
1051
- const n = an(e);
1051
+ const n = on(e);
1052
1052
  return y(n, t.length);
1053
1053
  },
1054
1054
  // Extended year. This is a single number designating the year of this calendar system.
@@ -1126,7 +1126,7 @@ const k = {
1126
1126
  switch (t) {
1127
1127
  case "M":
1128
1128
  case "MM":
1129
- return k.M(e, t);
1129
+ return _.M(e, t);
1130
1130
  case "Mo":
1131
1131
  return n.ordinalNumber(r + 1, { unit: "month" });
1132
1132
  case "MMM":
@@ -1181,7 +1181,7 @@ const k = {
1181
1181
  },
1182
1182
  // Day of the month
1183
1183
  d: function(e, t, n) {
1184
- return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : k.d(e, t);
1184
+ return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : _.d(e, t);
1185
1185
  },
1186
1186
  // Day of year
1187
1187
  D: function(e, t, n) {
@@ -1404,11 +1404,11 @@ const k = {
1404
1404
  let r = e.getHours() % 12;
1405
1405
  return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
1406
1406
  }
1407
- return k.h(e, t);
1407
+ return _.h(e, t);
1408
1408
  },
1409
1409
  // Hour [0-23]
1410
1410
  H: function(e, t, n) {
1411
- return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : k.H(e, t);
1411
+ return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : _.H(e, t);
1412
1412
  },
1413
1413
  // Hour [0-11]
1414
1414
  K: function(e, t, n) {
@@ -1422,15 +1422,15 @@ const k = {
1422
1422
  },
1423
1423
  // Minute
1424
1424
  m: function(e, t, n) {
1425
- return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : k.m(e, t);
1425
+ return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : _.m(e, t);
1426
1426
  },
1427
1427
  // Second
1428
1428
  s: function(e, t, n) {
1429
- return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : k.s(e, t);
1429
+ return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : _.s(e, t);
1430
1430
  },
1431
1431
  // Fraction of second
1432
1432
  S: function(e, t) {
1433
- return k.S(e, t);
1433
+ return _.S(e, t);
1434
1434
  },
1435
1435
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1436
1436
  X: function(e, t, n) {
@@ -1439,7 +1439,7 @@ const k = {
1439
1439
  return "Z";
1440
1440
  switch (t) {
1441
1441
  case "X":
1442
- return yt(r);
1442
+ return pt(r);
1443
1443
  case "XXXX":
1444
1444
  case "XX":
1445
1445
  return I(r);
@@ -1454,7 +1454,7 @@ const k = {
1454
1454
  const r = e.getTimezoneOffset();
1455
1455
  switch (t) {
1456
1456
  case "x":
1457
- return yt(r);
1457
+ return pt(r);
1458
1458
  case "xxxx":
1459
1459
  case "xx":
1460
1460
  return I(r);
@@ -1471,7 +1471,7 @@ const k = {
1471
1471
  case "O":
1472
1472
  case "OO":
1473
1473
  case "OOO":
1474
- return "GMT" + gt(r, ":");
1474
+ return "GMT" + yt(r, ":");
1475
1475
  case "OOOO":
1476
1476
  default:
1477
1477
  return "GMT" + I(r, ":");
@@ -1484,7 +1484,7 @@ const k = {
1484
1484
  case "z":
1485
1485
  case "zz":
1486
1486
  case "zzz":
1487
- return "GMT" + gt(r, ":");
1487
+ return "GMT" + yt(r, ":");
1488
1488
  case "zzzz":
1489
1489
  default:
1490
1490
  return "GMT" + I(r, ":");
@@ -1501,18 +1501,18 @@ const k = {
1501
1501
  return y(r, t.length);
1502
1502
  }
1503
1503
  };
1504
- function gt(e, t = "") {
1504
+ function yt(e, t = "") {
1505
1505
  const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), i = r % 60;
1506
1506
  return i === 0 ? n + String(a) : n + String(a) + t + y(i, 2);
1507
1507
  }
1508
- function yt(e, t) {
1508
+ function pt(e, t) {
1509
1509
  return e % 60 === 0 ? (e > 0 ? "-" : "+") + y(Math.abs(e) / 60, 2) : I(e, t);
1510
1510
  }
1511
1511
  function I(e, t = "") {
1512
1512
  const n = e > 0 ? "-" : "+", r = Math.abs(e), a = y(Math.trunc(r / 60), 2), i = y(r % 60, 2);
1513
1513
  return n + a + t + i;
1514
1514
  }
1515
- const pt = (e, t) => {
1515
+ const wt = (e, t) => {
1516
1516
  switch (e) {
1517
1517
  case "P":
1518
1518
  return t.date({ width: "short" });
@@ -1524,7 +1524,7 @@ const pt = (e, t) => {
1524
1524
  default:
1525
1525
  return t.date({ width: "full" });
1526
1526
  }
1527
- }, cn = (e, t) => {
1527
+ }, un = (e, t) => {
1528
1528
  switch (e) {
1529
1529
  case "p":
1530
1530
  return t.time({ width: "short" });
@@ -1539,7 +1539,7 @@ const pt = (e, t) => {
1539
1539
  }, ha = (e, t) => {
1540
1540
  const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1541
1541
  if (!a)
1542
- return pt(e, t);
1542
+ return wt(e, t);
1543
1543
  let i;
1544
1544
  switch (r) {
1545
1545
  case "P":
@@ -1556,51 +1556,51 @@ const pt = (e, t) => {
1556
1556
  i = t.dateTime({ width: "full" });
1557
1557
  break;
1558
1558
  }
1559
- return i.replace("{{date}}", pt(r, t)).replace("{{time}}", cn(a, t));
1559
+ return i.replace("{{date}}", wt(r, t)).replace("{{time}}", un(a, t));
1560
1560
  }, ga = {
1561
- p: cn,
1561
+ p: un,
1562
1562
  P: ha
1563
1563
  }, ya = /^D+$/, pa = /^Y+$/, wa = ["D", "DD", "YY", "YYYY"];
1564
1564
  function Ta(e) {
1565
1565
  return ya.test(e);
1566
1566
  }
1567
- function Da(e) {
1567
+ function va(e) {
1568
1568
  return pa.test(e);
1569
1569
  }
1570
- function ba(e, t, n) {
1571
- const r = xa(e, t, n);
1570
+ function Da(e, t, n) {
1571
+ const r = ba(e, t, n);
1572
1572
  if (console.warn(r), wa.includes(e)) throw new RangeError(r);
1573
1573
  }
1574
- function xa(e, t, n) {
1574
+ function ba(e, t, n) {
1575
1575
  const r = e[0] === "Y" ? "years" : "days of the month";
1576
1576
  return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1577
1577
  }
1578
- const va = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Sa = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ma = /^'([^]*?)'?$/, ka = /''/g, _a = /[a-zA-Z]/;
1578
+ const xa = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Sa = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ma = /^'([^]*?)'?$/, ka = /''/g, _a = /[a-zA-Z]/;
1579
1579
  function Ke(e, t, n) {
1580
- var l, f, m, h, d, S, rt, at;
1581
- const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? on, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((f = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((h = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, o = (n == null ? void 0 : n.weekStartsOn) ?? ((S = (d = n == null ? void 0 : n.locale) == null ? void 0 : d.options) == null ? void 0 : S.weekStartsOn) ?? r.weekStartsOn ?? ((at = (rt = r.locale) == null ? void 0 : rt.options) == null ? void 0 : at.weekStartsOn) ?? 0, s = p(e);
1582
- if (!xr(s))
1580
+ var l, f, m, h, d, S, at, it;
1581
+ const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? sn, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((f = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((h = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, o = (n == null ? void 0 : n.weekStartsOn) ?? ((S = (d = n == null ? void 0 : n.locale) == null ? void 0 : d.options) == null ? void 0 : S.weekStartsOn) ?? r.weekStartsOn ?? ((it = (at = r.locale) == null ? void 0 : at.options) == null ? void 0 : it.weekStartsOn) ?? 0, s = p(e);
1582
+ if (!br(s))
1583
1583
  throw new RangeError("Invalid time value");
1584
- let c = t.match(Sa).map((v) => {
1585
- const x = v[0];
1586
- if (x === "p" || x === "P") {
1587
- const Ne = ga[x];
1588
- return Ne(v, a.formatLong);
1584
+ let c = t.match(Sa).map((x) => {
1585
+ const b = x[0];
1586
+ if (b === "p" || b === "P") {
1587
+ const Ne = ga[b];
1588
+ return Ne(x, a.formatLong);
1589
1589
  }
1590
- return v;
1591
- }).join("").match(va).map((v) => {
1592
- if (v === "''")
1590
+ return x;
1591
+ }).join("").match(xa).map((x) => {
1592
+ if (x === "''")
1593
1593
  return { isToken: !1, value: "'" };
1594
- const x = v[0];
1595
- if (x === "'")
1596
- return { isToken: !1, value: Na(v) };
1597
- if (ht[x])
1598
- return { isToken: !0, value: v };
1599
- if (x.match(_a))
1594
+ const b = x[0];
1595
+ if (b === "'")
1596
+ return { isToken: !1, value: Na(x) };
1597
+ if (gt[b])
1598
+ return { isToken: !0, value: x };
1599
+ if (b.match(_a))
1600
1600
  throw new RangeError(
1601
- "Format string contains an unescaped latin alphabet character `" + x + "`"
1601
+ "Format string contains an unescaped latin alphabet character `" + b + "`"
1602
1602
  );
1603
- return { isToken: !1, value: v };
1603
+ return { isToken: !1, value: x };
1604
1604
  });
1605
1605
  a.localize.preprocessor && (c = a.localize.preprocessor(s, c));
1606
1606
  const u = {
@@ -1608,12 +1608,12 @@ function Ke(e, t, n) {
1608
1608
  weekStartsOn: o,
1609
1609
  locale: a
1610
1610
  };
1611
- return c.map((v) => {
1612
- if (!v.isToken) return v.value;
1613
- const x = v.value;
1614
- (!(n != null && n.useAdditionalWeekYearTokens) && Da(x) || !(n != null && n.useAdditionalDayOfYearTokens) && Ta(x)) && ba(x, t, String(e));
1615
- const Ne = ht[x[0]];
1616
- return Ne(s, x, a.localize, u);
1611
+ return c.map((x) => {
1612
+ if (!x.isToken) return x.value;
1613
+ const b = x.value;
1614
+ (!(n != null && n.useAdditionalWeekYearTokens) && va(b) || !(n != null && n.useAdditionalDayOfYearTokens) && Ta(b)) && Da(b, t, String(e));
1615
+ const Ne = gt[b[0]];
1616
+ return Ne(s, b, a.localize, u);
1617
1617
  }).join("");
1618
1618
  }
1619
1619
  function Na(e) {
@@ -1621,7 +1621,7 @@ function Na(e) {
1621
1621
  return t ? t[1].replace(ka, "'") : e;
1622
1622
  }
1623
1623
  function $a(e, t, n) {
1624
- const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? on, i = 2520, o = le(e, t);
1624
+ const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? sn, i = 2520, o = le(e, t);
1625
1625
  if (isNaN(o))
1626
1626
  throw new RangeError("Invalid time value");
1627
1627
  const s = Object.assign({}, n, {
@@ -1638,14 +1638,14 @@ function $a(e, t, n) {
1638
1638
  return a.formatDistance("xMinutes", m, s);
1639
1639
  if (m < 90)
1640
1640
  return a.formatDistance("aboutXHours", 1, s);
1641
- if (m < ft) {
1641
+ if (m < dt) {
1642
1642
  const d = Math.round(m / 60);
1643
1643
  return a.formatDistance("aboutXHours", d, s);
1644
1644
  } else {
1645
1645
  if (m < i)
1646
1646
  return a.formatDistance("xDays", 1, s);
1647
1647
  if (m < oe) {
1648
- const d = Math.round(m / ft);
1648
+ const d = Math.round(m / dt);
1649
1649
  return a.formatDistance("xDays", d, s);
1650
1650
  } else if (m < oe * 2)
1651
1651
  return h = Math.round(m / oe), a.formatDistance("aboutXMonths", h, s);
@@ -1659,12 +1659,12 @@ function $a(e, t, n) {
1659
1659
  }
1660
1660
  }
1661
1661
  function Ea(e, t) {
1662
- return $a(e, Dr(e), t);
1662
+ return $a(e, vr(e), t);
1663
1663
  }
1664
1664
  function Ia() {
1665
1665
  return Object.assign({}, j());
1666
1666
  }
1667
- function Is(e, t) {
1667
+ function Os(e, t) {
1668
1668
  const r = Pa(e);
1669
1669
  let a;
1670
1670
  if (r.date) {
@@ -1744,7 +1744,7 @@ function Aa(e) {
1744
1744
  const t = e.match(Fa);
1745
1745
  if (!t) return NaN;
1746
1746
  const n = Ee(t[1]), r = Ee(t[2]), a = Ee(t[3]);
1747
- return qa(n, r, a) ? n * rn + r * nn + a * 1e3 : NaN;
1747
+ return qa(n, r, a) ? n * an + r * rn + a * 1e3 : NaN;
1748
1748
  }
1749
1749
  function Ee(e) {
1750
1750
  return e && parseFloat(e.replace(",", ".")) || 0;
@@ -1754,7 +1754,7 @@ function Ra(e) {
1754
1754
  const t = e.match(Ca);
1755
1755
  if (!t) return 0;
1756
1756
  const n = t[1] === "+" ? -1 : 1, r = parseInt(t[2]), a = t[3] && parseInt(t[3]) || 0;
1757
- return Za(r, a) ? n * (r * rn + a * nn) : NaN;
1757
+ return Za(r, a) ? n * (r * an + a * rn) : NaN;
1758
1758
  }
1759
1759
  function Ua(e, t, n) {
1760
1760
  const r = /* @__PURE__ */ new Date(0);
@@ -1763,14 +1763,14 @@ function Ua(e, t, n) {
1763
1763
  return r.setUTCDate(r.getUTCDate() + i), r;
1764
1764
  }
1765
1765
  const La = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1766
- function un(e) {
1766
+ function ln(e) {
1767
1767
  return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
1768
1768
  }
1769
1769
  function Wa(e, t, n) {
1770
- return t >= 0 && t <= 11 && n >= 1 && n <= (La[t] || (un(e) ? 29 : 28));
1770
+ return t >= 0 && t <= 11 && n >= 1 && n <= (La[t] || (ln(e) ? 29 : 28));
1771
1771
  }
1772
1772
  function ja(e, t) {
1773
- return t >= 1 && t <= (un(e) ? 366 : 365);
1773
+ return t >= 1 && t <= (ln(e) ? 366 : 365);
1774
1774
  }
1775
1775
  function Ha(e, t, n) {
1776
1776
  return t >= 1 && t <= 53 && n >= 0 && n <= 6;
@@ -1781,7 +1781,7 @@ function qa(e, t, n) {
1781
1781
  function Za(e, t) {
1782
1782
  return t >= 0 && t <= 59;
1783
1783
  }
1784
- function wt(e, t, n) {
1784
+ function Tt(e, t, n) {
1785
1785
  const r = Ia(), a = Va(e, n.timeZone, n.locale ?? r.locale);
1786
1786
  return "formatToParts" in a ? Xa(a, t) : Ba(a, t);
1787
1787
  }
@@ -1838,7 +1838,7 @@ function Ja(e, t) {
1838
1838
  parseInt(r[6], 10)
1839
1839
  ];
1840
1840
  }
1841
- const Ie = {}, Tt = new Intl.DateTimeFormat("en-US", {
1841
+ const Ie = {}, vt = new Intl.DateTimeFormat("en-US", {
1842
1842
  hourCycle: "h23",
1843
1843
  timeZone: "America/New_York",
1844
1844
  year: "numeric",
@@ -1847,7 +1847,7 @@ const Ie = {}, Tt = new Intl.DateTimeFormat("en-US", {
1847
1847
  hour: "2-digit",
1848
1848
  minute: "2-digit",
1849
1849
  second: "2-digit"
1850
- }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), ei = Tt === "06/25/2014, 00:00:00" || Tt === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
1850
+ }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), ei = vt === "06/25/2014, 00:00:00" || vt === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
1851
1851
  function ti(e) {
1852
1852
  return Ie[e] || (Ie[e] = ei ? new Intl.DateTimeFormat("en-US", {
1853
1853
  hourCycle: "h23",
@@ -1938,7 +1938,7 @@ const oi = 60 * 1e3, si = {
1938
1938
  return "Z";
1939
1939
  switch (t) {
1940
1940
  case "X":
1941
- return vt(r);
1941
+ return St(r);
1942
1942
  case "XXXX":
1943
1943
  case "XX":
1944
1944
  return C(r);
@@ -1953,7 +1953,7 @@ const oi = 60 * 1e3, si = {
1953
1953
  const r = Fe(n.timeZone, e);
1954
1954
  switch (t) {
1955
1955
  case "x":
1956
- return vt(r);
1956
+ return St(r);
1957
1957
  case "xxxx":
1958
1958
  case "xx":
1959
1959
  return C(r);
@@ -1982,10 +1982,10 @@ const oi = 60 * 1e3, si = {
1982
1982
  case "z":
1983
1983
  case "zz":
1984
1984
  case "zzz":
1985
- return wt("short", e, n);
1985
+ return Tt("short", e, n);
1986
1986
  case "zzzz":
1987
1987
  default:
1988
- return wt("long", e, n);
1988
+ return Tt("long", e, n);
1989
1989
  }
1990
1990
  }
1991
1991
  };
@@ -1995,7 +1995,7 @@ function Fe(e, t) {
1995
1995
  throw new RangeError("Invalid time zone specified: " + e);
1996
1996
  return n;
1997
1997
  }
1998
- function De(e, t) {
1998
+ function ve(e, t) {
1999
1999
  const n = e < 0 ? "-" : "";
2000
2000
  let r = Math.abs(e).toString();
2001
2001
  for (; r.length < t; )
@@ -2003,21 +2003,21 @@ function De(e, t) {
2003
2003
  return n + r;
2004
2004
  }
2005
2005
  function C(e, t = "") {
2006
- const n = e > 0 ? "-" : "+", r = Math.abs(e), a = De(Math.floor(r / 60), 2), i = De(Math.floor(r % 60), 2);
2006
+ const n = e > 0 ? "-" : "+", r = Math.abs(e), a = ve(Math.floor(r / 60), 2), i = ve(Math.floor(r % 60), 2);
2007
2007
  return n + a + t + i;
2008
2008
  }
2009
- function vt(e, t) {
2010
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + De(Math.abs(e) / 60, 2) : C(e, t);
2009
+ function St(e, t) {
2010
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + ve(Math.abs(e) / 60, 2) : C(e, t);
2011
2011
  }
2012
2012
  function ci(e, t = "") {
2013
2013
  const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60), i = r % 60;
2014
- return i === 0 ? n + String(a) : n + String(a) + t + De(i, 2);
2014
+ return i === 0 ? n + String(a) : n + String(a) + t + ve(i, 2);
2015
2015
  }
2016
- function St(e) {
2016
+ function Mt(e) {
2017
2017
  const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
2018
2018
  return t.setUTCFullYear(e.getFullYear()), +e - +t;
2019
2019
  }
2020
- const ln = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Ce = 36e5, Mt = 6e4, ui = 2, b = {
2020
+ const mn = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Ce = 36e5, kt = 6e4, ui = 2, D = {
2021
2021
  dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
2022
2022
  datePattern: /^([0-9W+-]+)(.*)/,
2023
2023
  // year tokens
@@ -2049,9 +2049,9 @@ const ln = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)
2049
2049
  HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
2050
2050
  HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
2051
2051
  // time zone tokens (to identify the presence of a tz)
2052
- timeZone: ln
2052
+ timeZone: mn
2053
2053
  };
2054
- function be(e, t = {}) {
2054
+ function De(e, t = {}) {
2055
2055
  if (arguments.length < 1)
2056
2056
  throw new TypeError("1 argument required, but only " + arguments.length + " present");
2057
2057
  if (e === null)
@@ -2077,24 +2077,24 @@ function be(e, t = {}) {
2077
2077
  if (u = ke(r.timeZone || t.timeZone, new Date(s + c)), isNaN(u))
2078
2078
  return /* @__PURE__ */ new Date(NaN);
2079
2079
  } else
2080
- u = St(new Date(s + c)), u = St(new Date(s + c + u));
2080
+ u = Mt(new Date(s + c)), u = Mt(new Date(s + c + u));
2081
2081
  return new Date(s + c + u);
2082
2082
  } else
2083
2083
  return /* @__PURE__ */ new Date(NaN);
2084
2084
  }
2085
2085
  function li(e) {
2086
2086
  const t = {};
2087
- let n = b.dateTimePattern.exec(e), r;
2088
- if (n ? (t.date = n[1], r = n[3]) : (n = b.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
2089
- const a = b.timeZone.exec(r);
2087
+ let n = D.dateTimePattern.exec(e), r;
2088
+ if (n ? (t.date = n[1], r = n[3]) : (n = D.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
2089
+ const a = D.timeZone.exec(r);
2090
2090
  a ? (t.time = r.replace(a[1], ""), t.timeZone = a[1].trim()) : t.time = r;
2091
2091
  }
2092
2092
  return t;
2093
2093
  }
2094
2094
  function mi(e, t) {
2095
2095
  if (e) {
2096
- const n = b.YYY[t], r = b.YYYYY[t];
2097
- let a = b.YYYY.exec(e) || r.exec(e);
2096
+ const n = D.YYY[t], r = D.YYYYY[t];
2097
+ let a = D.YYYY.exec(e) || r.exec(e);
2098
2098
  if (a) {
2099
2099
  const i = a[1];
2100
2100
  return {
@@ -2102,7 +2102,7 @@ function mi(e, t) {
2102
2102
  restDateString: e.slice(i.length)
2103
2103
  };
2104
2104
  }
2105
- if (a = b.YY.exec(e) || n.exec(e), a) {
2105
+ if (a = D.YY.exec(e) || n.exec(e), a) {
2106
2106
  const i = a[1];
2107
2107
  return {
2108
2108
  year: parseInt(i, 10) * 100,
@@ -2120,42 +2120,42 @@ function fi(e, t) {
2120
2120
  let n, r, a;
2121
2121
  if (!e || !e.length)
2122
2122
  return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(t), n;
2123
- let i = b.MM.exec(e);
2123
+ let i = D.MM.exec(e);
2124
2124
  if (i)
2125
- return n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1, _t(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
2126
- if (i = b.DDD.exec(e), i) {
2125
+ return n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1, Nt(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
2126
+ if (i = D.DDD.exec(e), i) {
2127
2127
  n = /* @__PURE__ */ new Date(0);
2128
2128
  const o = parseInt(i[1], 10);
2129
2129
  return yi(t, o) ? (n.setUTCFullYear(t, 0, o), n) : /* @__PURE__ */ new Date(NaN);
2130
2130
  }
2131
- if (i = b.MMDD.exec(e), i) {
2131
+ if (i = D.MMDD.exec(e), i) {
2132
2132
  n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1;
2133
2133
  const o = parseInt(i[2], 10);
2134
- return _t(t, r, o) ? (n.setUTCFullYear(t, r, o), n) : /* @__PURE__ */ new Date(NaN);
2134
+ return Nt(t, r, o) ? (n.setUTCFullYear(t, r, o), n) : /* @__PURE__ */ new Date(NaN);
2135
2135
  }
2136
- if (i = b.Www.exec(e), i)
2137
- return a = parseInt(i[1], 10) - 1, Nt(a) ? kt(t, a) : /* @__PURE__ */ new Date(NaN);
2138
- if (i = b.WwwD.exec(e), i) {
2136
+ if (i = D.Www.exec(e), i)
2137
+ return a = parseInt(i[1], 10) - 1, $t(a) ? _t(t, a) : /* @__PURE__ */ new Date(NaN);
2138
+ if (i = D.WwwD.exec(e), i) {
2139
2139
  a = parseInt(i[1], 10) - 1;
2140
2140
  const o = parseInt(i[2], 10) - 1;
2141
- return Nt(a, o) ? kt(t, a, o) : /* @__PURE__ */ new Date(NaN);
2141
+ return $t(a, o) ? _t(t, a, o) : /* @__PURE__ */ new Date(NaN);
2142
2142
  }
2143
2143
  return null;
2144
2144
  }
2145
2145
  function di(e) {
2146
- let t, n, r = b.HH.exec(e);
2146
+ let t, n, r = D.HH.exec(e);
2147
2147
  if (r)
2148
2148
  return t = parseFloat(r[1].replace(",", ".")), Pe(t) ? t % 24 * Ce : NaN;
2149
- if (r = b.HHMM.exec(e), r)
2150
- return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), Pe(t, n) ? t % 24 * Ce + n * Mt : NaN;
2151
- if (r = b.HHMMSS.exec(e), r) {
2149
+ if (r = D.HHMM.exec(e), r)
2150
+ return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), Pe(t, n) ? t % 24 * Ce + n * kt : NaN;
2151
+ if (r = D.HHMMSS.exec(e), r) {
2152
2152
  t = parseInt(r[1], 10), n = parseInt(r[2], 10);
2153
2153
  const a = parseFloat(r[3].replace(",", "."));
2154
- return Pe(t, n, a) ? t % 24 * Ce + n * Mt + a * 1e3 : NaN;
2154
+ return Pe(t, n, a) ? t % 24 * Ce + n * kt + a * 1e3 : NaN;
2155
2155
  }
2156
2156
  return null;
2157
2157
  }
2158
- function kt(e, t, n) {
2158
+ function _t(e, t, n) {
2159
2159
  t = t || 0, n = n || 0;
2160
2160
  const r = /* @__PURE__ */ new Date(0);
2161
2161
  r.setUTCFullYear(e, 0, 4);
@@ -2163,16 +2163,16 @@ function kt(e, t, n) {
2163
2163
  return r.setUTCDate(r.getUTCDate() + i), r;
2164
2164
  }
2165
2165
  const hi = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], gi = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2166
- function mn(e) {
2166
+ function fn(e) {
2167
2167
  return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
2168
2168
  }
2169
- function _t(e, t, n) {
2169
+ function Nt(e, t, n) {
2170
2170
  if (t < 0 || t > 11)
2171
2171
  return !1;
2172
2172
  if (n != null) {
2173
2173
  if (n < 1)
2174
2174
  return !1;
2175
- const r = mn(e);
2175
+ const r = fn(e);
2176
2176
  if (r && n > gi[t] || !r && n > hi[t])
2177
2177
  return !1;
2178
2178
  }
@@ -2181,10 +2181,10 @@ function _t(e, t, n) {
2181
2181
  function yi(e, t) {
2182
2182
  if (t < 1)
2183
2183
  return !1;
2184
- const n = mn(e);
2184
+ const n = fn(e);
2185
2185
  return !(n && t > 366 || !n && t > 365);
2186
2186
  }
2187
- function Nt(e, t) {
2187
+ function $t(e, t) {
2188
2188
  return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
2189
2189
  }
2190
2190
  function Pe(e, t, n) {
@@ -2195,7 +2195,7 @@ function wi(e, t, n = {}) {
2195
2195
  t = String(t);
2196
2196
  const r = t.match(pi);
2197
2197
  if (r) {
2198
- const a = be(n.originalDate || e, n);
2198
+ const a = De(n.originalDate || e, n);
2199
2199
  t = r.reduce(function(i, o) {
2200
2200
  if (o[0] === "'")
2201
2201
  return i;
@@ -2206,11 +2206,11 @@ function wi(e, t, n = {}) {
2206
2206
  return Ke(e, t, n);
2207
2207
  }
2208
2208
  function Ti(e, t, n) {
2209
- e = be(e, n);
2209
+ e = De(e, n);
2210
2210
  const r = ke(t, e, !0), a = new Date(e.getTime() - r), i = /* @__PURE__ */ new Date(0);
2211
2211
  return i.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), i.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), i;
2212
2212
  }
2213
- function fn(e, t, n, r) {
2213
+ function dn(e, t, n, r) {
2214
2214
  return r = {
2215
2215
  ...r,
2216
2216
  timeZone: t,
@@ -2218,16 +2218,16 @@ function fn(e, t, n, r) {
2218
2218
  }, wi(Ti(e, t, { timeZone: r.timeZone }), n, r);
2219
2219
  }
2220
2220
  function te(e, t, n) {
2221
- if (typeof e == "string" && !e.match(ln))
2222
- return be(e, { ...n, timeZone: t });
2223
- e = be(e, n);
2221
+ if (typeof e == "string" && !e.match(mn))
2222
+ return De(e, { ...n, timeZone: t });
2223
+ e = De(e, n);
2224
2224
  const r = Ge(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), a = ke(t, new Date(r));
2225
2225
  return new Date(r + a);
2226
2226
  }
2227
- function Os(e, t) {
2227
+ function Fs(e, t) {
2228
2228
  return e && e !== "auto" ? e : t;
2229
2229
  }
2230
- function Fs(e, t = /* @__PURE__ */ new Date()) {
2230
+ function Cs(e, t = /* @__PURE__ */ new Date()) {
2231
2231
  try {
2232
2232
  const n = {
2233
2233
  timeZone: e,
@@ -2238,7 +2238,7 @@ function Fs(e, t = /* @__PURE__ */ new Date()) {
2238
2238
  return e;
2239
2239
  }
2240
2240
  }
2241
- function Cs(e) {
2241
+ function Ps(e) {
2242
2242
  try {
2243
2243
  const t = {
2244
2244
  timeZone: e,
@@ -2265,31 +2265,31 @@ function Qe(e, t = "auto") {
2265
2265
  return new Date(e);
2266
2266
  } else return t === "UTC" ? n ? new Date(e) : r ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || r || a ? new Date(e) : te(e, t);
2267
2267
  }
2268
- const Di = "MM/dd/yyyy", bi = (e, t, n, r = "auto") => {
2268
+ const vi = "MM/dd/yyyy", Di = (e, t, n, r = "auto") => {
2269
2269
  if (!e)
2270
2270
  return "";
2271
2271
  try {
2272
2272
  const a = Qe(e, r);
2273
2273
  if (isNaN(a.getTime()))
2274
2274
  return e;
2275
- const o = (t && t.trim() ? t : Di).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
2276
- return n && n !== "auto" ? fn(a, n, o) : Ke(a, o);
2275
+ const o = (t && t.trim() ? t : vi).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
2276
+ return n && n !== "auto" ? dn(a, n, o) : Ke(a, o);
2277
2277
  } catch (a) {
2278
2278
  return console.error("Date formatting error:", a), e;
2279
2279
  }
2280
2280
  };
2281
- function Ps(e, t, n = "auto") {
2281
+ function Ys(e, t, n = "auto") {
2282
2282
  if (e)
2283
2283
  try {
2284
2284
  const r = Qe(e, n);
2285
2285
  if (isNaN(r.getTime())) return;
2286
- const a = "yyyy M d H m s", i = t && t !== "auto" ? fn(r, t, a) : Ke(r, a), [o, s, c, u, l, f] = i.split(" ").map(Number);
2286
+ const a = "yyyy M d H m s", i = t && t !== "auto" ? dn(r, t, a) : Ke(r, a), [o, s, c, u, l, f] = i.split(" ").map(Number);
2287
2287
  return { year: o, month: s, day: c, hour: u, minute: l, second: f };
2288
2288
  } catch {
2289
2289
  return;
2290
2290
  }
2291
2291
  }
2292
- const xi = (e, t = "auto") => {
2292
+ const bi = (e, t = "auto") => {
2293
2293
  if (!e)
2294
2294
  return "";
2295
2295
  try {
@@ -2299,22 +2299,22 @@ const xi = (e, t = "auto") => {
2299
2299
  return console.error("Relative time formatting error:", n), e;
2300
2300
  }
2301
2301
  };
2302
- function vi(e, t, n, r) {
2302
+ function xi(e, t, n, r) {
2303
2303
  const a = e instanceof Date ? e.toISOString() : String(e), i = (r == null ? void 0 : r.browserTimezone) || n, o = (r == null ? void 0 : r.isSqlCard) ?? !1;
2304
2304
  if (t != null && t.useRelativeTime)
2305
- return xi(
2305
+ return bi(
2306
2306
  a,
2307
2307
  (t == null ? void 0 : t.sourceTimezone) || "auto"
2308
2308
  );
2309
2309
  const s = t != null && t.useCustomFormat && (t != null && t.customFormat) ? t.customFormat : (t == null ? void 0 : t.format) || "MM/dd/yyyy";
2310
- return bi(
2310
+ return Di(
2311
2311
  a,
2312
2312
  s,
2313
2313
  t != null && t.timezone && (t == null ? void 0 : t.timezone) !== "auto" ? t.timezone : o ? i : n,
2314
2314
  (t == null ? void 0 : t.sourceTimezone) || "auto"
2315
2315
  );
2316
2316
  }
2317
- function dn(e, t, n) {
2317
+ function hn(e, t, n) {
2318
2318
  var o, s;
2319
2319
  if (e == null)
2320
2320
  return e === null ? ((o = n.absence) == null ? void 0 : o.nullText) ?? "" : ((s = n.absence) == null ? void 0 : s.emptyText) ?? "";
@@ -2329,7 +2329,7 @@ function dn(e, t, n) {
2329
2329
  n.locale
2330
2330
  ) : String(a);
2331
2331
  case "date":
2332
- return vi(
2332
+ return xi(
2333
2333
  a,
2334
2334
  t.dateFormat,
2335
2335
  n.timezone,
@@ -2348,58 +2348,58 @@ function dn(e, t, n) {
2348
2348
  return String(a);
2349
2349
  }
2350
2350
  }
2351
- function Ys(e, t) {
2351
+ function zs(e, t) {
2352
2352
  return t.visibleColumns.map((n) => {
2353
2353
  const r = e[n], a = t.columnSettings[n];
2354
- return dn(r, a, {
2354
+ return hn(r, a, {
2355
2355
  useFormattedValues: t.useFormattedValues,
2356
2356
  timezone: t.timezone,
2357
2357
  locale: t.locale
2358
2358
  });
2359
2359
  });
2360
2360
  }
2361
- const hn = 1e4, Si = 1e6, zs = 5e6, As = 1024 ** 3, Rs = 1024 ** 3;
2362
- function Us(e) {
2363
- return e > hn;
2364
- }
2361
+ const gn = 1e4, Si = 1e6, As = 5e6, Rs = 1024 ** 3, Us = 1024 ** 3;
2365
2362
  function Ls(e) {
2366
- return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= hn ? "direct" : e.loadedRowCount <= Si ? "background" : "blocked";
2363
+ return e > gn;
2364
+ }
2365
+ function Ws(e) {
2366
+ return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= gn ? "direct" : e.loadedRowCount <= Si ? "background" : "blocked";
2367
2367
  }
2368
- const Mi = 5 * 1024 * 1024, Ws = 64 * 1024 * 1024, xe = w.number().int().positive().max(Number.MAX_SAFE_INTEGER), me = w.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER), ve = me.refine((e) => e > 0), ki = (e) => !!e && e !== "." && e !== ".." && !e.includes("/") && !e.includes("\\");
2368
+ const Mi = 5 * 1024 * 1024, js = 64 * 1024 * 1024, be = w.number().int().positive().max(Number.MAX_SAFE_INTEGER), me = w.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER), xe = me.refine((e) => e > 0), ki = (e) => !!e && e !== "." && e !== ".." && !e.includes("/") && !e.includes("\\");
2369
2369
  function P(e, t) {
2370
2370
  const n = t.split("/");
2371
2371
  if (n.length !== 5 || n[0] !== "exports" || n[1] !== e || n[2] !== "attempts" || !n.every(ki))
2372
2372
  throw new Error("Invalid Matrix export artifact namespace.");
2373
2373
  return { attemptId: n[3], filename: n[4] };
2374
2374
  }
2375
- function js(e, t, n) {
2375
+ function Hs(e, t, n) {
2376
2376
  const r = `exports/${e}/attempts/${t}/${n}`;
2377
2377
  return P(e, r), r;
2378
2378
  }
2379
- const Hs = w.object({
2379
+ const qs = w.object({
2380
2380
  acquisition: w.literal("continuation"),
2381
2381
  jobId: w.string().min(1),
2382
- sequence: ve,
2383
- deadlineAt: xe
2382
+ sequence: xe,
2383
+ deadlineAt: be
2384
2384
  }), _i = [
2385
2385
  "application/json",
2386
- ...jt.map((e) => Ht(e).partContentType)
2386
+ ...Ht.map((e) => qt(e).partContentType)
2387
2387
  ], Ni = w.object({
2388
2388
  key: w.string(),
2389
2389
  content: w.string(),
2390
2390
  contentType: w.enum(_i),
2391
2391
  encoding: w.literal("gzip-base64").optional()
2392
2392
  // Transport-only compression: JSON (layout, sheet layout) and Excel rows. CSV travels as it always has.
2393
- }).refine((e) => !e.encoding || e.contentType === "application/json" || e.contentType === Ht("xlsx").partContentType, "Unsupported Matrix artifact encoding."), $i = w.discriminatedUnion("kind", [
2394
- w.object({ kind: w.literal("work"), sequence: ve, checkpointKey: w.string(), objects: w.array(Ni).min(2).max(4), deadlineAt: xe }),
2395
- w.object({ kind: w.literal("committed"), sequence: ve, done: w.boolean(), deadlineAt: xe })
2393
+ }).refine((e) => !e.encoding || e.contentType === "application/json" || e.contentType === qt("xlsx").partContentType, "Unsupported Matrix artifact encoding."), $i = w.discriminatedUnion("kind", [
2394
+ w.object({ kind: w.literal("work"), sequence: xe, checkpointKey: w.string(), objects: w.array(Ni).min(2).max(4), deadlineAt: be }),
2395
+ w.object({ kind: w.literal("committed"), sequence: xe, done: w.boolean(), deadlineAt: be })
2396
2396
  ]);
2397
2397
  function Ei(e) {
2398
2398
  const t = JSON.stringify(e);
2399
2399
  if (t === void 0 || new TextEncoder().encode(t).byteLength > Mi)
2400
2400
  throw new RangeError("Matrix export batch exceeds its transport byte limit.");
2401
2401
  }
2402
- function qs(e, t) {
2402
+ function Zs(e, t) {
2403
2403
  const n = $i.parse(e);
2404
2404
  if (Ei(e), n.deadlineAt !== t.deadlineAt) throw new Error("Matrix deadline does not match the job.");
2405
2405
  if (n.sequence !== t.sequence + (n.kind === "committed" ? 1 : 0))
@@ -2413,18 +2413,18 @@ function qs(e, t) {
2413
2413
  }
2414
2414
  const Ii = w.object({
2415
2415
  acquisition: w.literal("continuation"),
2416
- deadlineAt: xe,
2417
- chunks: w.array(w.object({ chunkNumber: ve, dataKey: w.string() })).min(1),
2416
+ deadlineAt: be,
2417
+ chunks: w.array(w.object({ chunkNumber: xe, dataKey: w.string() })).min(1),
2418
2418
  totalRows: me,
2419
2419
  totalBytes: me,
2420
2420
  fileKey: w.string().min(1).optional(),
2421
2421
  fileSize: me.optional(),
2422
2422
  /** The file the job writes; absent means CSV (manifests from before Excel). */
2423
- format: w.enum(jt).optional(),
2423
+ format: w.enum(Ht).optional(),
2424
2424
  /** Excel only: the sheet layout the layout batch stored, which compaction wraps the rows in. */
2425
2425
  sheetKey: w.string().min(1).optional()
2426
2426
  }).refine((e) => e.fileKey === void 0 == (e.fileSize === void 0), "Incomplete published Matrix artifact.").refine((e) => e.format === "xlsx" == (e.sheetKey !== void 0), "An Excel Matrix manifest names its sheet layout, and only it does.");
2427
- function Zs(e, t, n) {
2427
+ function Xs(e, t, n) {
2428
2428
  const r = Ii.parse(e);
2429
2429
  if (r.deadlineAt !== n) throw new Error("Matrix deadline does not match the job.");
2430
2430
  return r.chunks.forEach((a, i) => {
@@ -2433,7 +2433,7 @@ function Zs(e, t, n) {
2433
2433
  }), r.fileKey !== void 0 && P(t, r.fileKey), r.sheetKey !== void 0 && P(t, r.sheetKey), r;
2434
2434
  }
2435
2435
  const Oi = "en-US";
2436
- function $t(e) {
2436
+ function Et(e) {
2437
2437
  if (typeof e != "string")
2438
2438
  return;
2439
2439
  const t = e.trim();
@@ -2474,8 +2474,8 @@ function Pi(e, t) {
2474
2474
  if (!(typeof t != "string" || e === "percent" && t === "%"))
2475
2475
  return t;
2476
2476
  }
2477
- function Et(e) {
2478
- const t = $t(e.locale), n = $t(e.currency), r = Pi(e.type, e.suffix);
2477
+ function It(e) {
2478
+ const t = Et(e.locale), n = Et(e.currency), r = Pi(e.type, e.suffix);
2479
2479
  return {
2480
2480
  ...e,
2481
2481
  ...t !== e.locale ? { locale: t } : {},
@@ -2486,7 +2486,7 @@ function Et(e) {
2486
2486
  function E(e, t, n) {
2487
2487
  const r = { ...t, type: e };
2488
2488
  if ((n == null ? void 0 : n.numericInput) === "canonical" && J(r))
2489
- return Et(r);
2489
+ return It(r);
2490
2490
  const a = Ci(e, t, n), i = typeof t.prefix == "string" ? t.prefix : void 0, o = {
2491
2491
  type: e,
2492
2492
  locale: t.locale,
@@ -2500,9 +2500,9 @@ function E(e, t, n) {
2500
2500
  scale: typeof t.scale == "number" ? t.scale : void 0,
2501
2501
  ...t.signDisplay ? { signDisplay: t.signDisplay } : {}
2502
2502
  };
2503
- return e === "currency" && t.currency && (o.currency = t.currency), e === "percent" && (o.percentValueMode = t.percentValueMode || "fraction"), Et(o);
2503
+ return e === "currency" && t.currency && (o.currency = t.currency), e === "percent" && (o.percentValueMode = t.percentValueMode || "fraction"), It(o);
2504
2504
  }
2505
- function It(e) {
2505
+ function Ot(e) {
2506
2506
  return {
2507
2507
  type: "date",
2508
2508
  locale: e.locale || Oi,
@@ -2520,7 +2520,7 @@ function It(e) {
2520
2520
  function Ye(e) {
2521
2521
  return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
2522
2522
  }
2523
- function Ot(e) {
2523
+ function Ft(e) {
2524
2524
  const t = fe(e.maxUnits);
2525
2525
  return {
2526
2526
  type: "duration",
@@ -2534,7 +2534,7 @@ function Ot(e) {
2534
2534
  negativeStyle: e.negativeStyle || "minus"
2535
2535
  };
2536
2536
  }
2537
- function Ft(e) {
2537
+ function Ct(e) {
2538
2538
  return {
2539
2539
  type: "string",
2540
2540
  prefix: e.prefix,
@@ -2561,7 +2561,7 @@ function Yi(e, t) {
2561
2561
  "scientific",
2562
2562
  { type: "scientific" },
2563
2563
  t
2564
- ) : r === "date" ? It({}) : r === "duration" ? Ot({}) : r === "string" ? Ft({}) : r === "number" ? E(
2564
+ ) : r === "date" ? Ot({}) : r === "duration" ? Ft({}) : r === "string" ? Ct({}) : r === "number" ? E(
2565
2565
  "number",
2566
2566
  { type: "number" },
2567
2567
  t
@@ -2589,11 +2589,11 @@ function Yi(e, t) {
2589
2589
  if (n.type === "number" || n.type === "currency" || n.type === "percent" || n.type === "scientific")
2590
2590
  return E(n.type, n, t);
2591
2591
  if (n.type === "date")
2592
- return It(n);
2593
- if (n.type === "duration")
2594
2592
  return Ot(n);
2595
- if (n.type === "string")
2593
+ if (n.type === "duration")
2596
2594
  return Ft(n);
2595
+ if (n.type === "string")
2596
+ return Ct(n);
2597
2597
  }
2598
2598
  const zi = Object.freeze({ source: "automatic" });
2599
2599
  function Ai(e, t) {
@@ -2609,7 +2609,7 @@ function Ai(e, t) {
2609
2609
  return;
2610
2610
  }
2611
2611
  }
2612
- function Ct(e, t) {
2612
+ function Pt(e, t) {
2613
2613
  const n = e.config;
2614
2614
  if (n)
2615
2615
  return [
@@ -2620,8 +2620,8 @@ function Ct(e, t) {
2620
2620
  ].find((r) => r.id === t);
2621
2621
  }
2622
2622
  function Ri(e, t) {
2623
- if (t.kind === "field") return Ct(e, t.fieldId);
2624
- if (t.kind === "pivot") return Ct(e, t.metricId);
2623
+ if (t.kind === "field") return Pt(e, t.fieldId);
2624
+ if (t.kind === "pivot") return Pt(e, t.metricId);
2625
2625
  }
2626
2626
  function Ui(e, t, n) {
2627
2627
  var r, a, i, o, s, c, u, l, f;
@@ -2664,12 +2664,12 @@ function ji(e, t) {
2664
2664
  ) : r;
2665
2665
  return JSON.stringify(n(e)) === JSON.stringify(n(t));
2666
2666
  }
2667
- const Hi = ["metricColumns", "groupByColumns", "detailColumns", "pivotByColumns"], Pt = /* @__PURE__ */ new WeakMap();
2668
- function Xs(e, t) {
2667
+ const Hi = ["metricColumns", "groupByColumns", "detailColumns", "pivotByColumns"], Yt = /* @__PURE__ */ new WeakMap();
2668
+ function Bs(e, t) {
2669
2669
  const n = t == null ? void 0 : t.modelFormats;
2670
2670
  if (!e || !n || Object.keys(n).length === 0) return e;
2671
- let r = Pt.get(e);
2672
- if (r || Pt.set(e, r = /* @__PURE__ */ new WeakMap()), r.has(n)) return r.get(n);
2671
+ let r = Yt.get(e);
2672
+ if (r || Yt.set(e, r = /* @__PURE__ */ new WeakMap()), r.has(n)) return r.get(n);
2673
2673
  const a = qi(e, n);
2674
2674
  return r.set(n, a), a;
2675
2675
  }
@@ -2802,7 +2802,7 @@ function Bi(e) {
2802
2802
  message: "Resolved currency formats require an explicit currency."
2803
2803
  }), n.length > 0 ? { ok: !1, issues: n } : t;
2804
2804
  }
2805
- function Bs(e) {
2805
+ function Vs(e) {
2806
2806
  var r;
2807
2807
  const t = /* @__PURE__ */ new Set();
2808
2808
  if (e.snapshot.resolvedFormats.forEach((a, i) => {
@@ -2906,7 +2906,7 @@ const Qi = [
2906
2906
  "month",
2907
2907
  "quarter",
2908
2908
  "year"
2909
- ], gn = {
2909
+ ], yn = {
2910
2910
  week_of_short: ["week"],
2911
2911
  week_of_long: ["week"],
2912
2912
  quarter_short: ["quarter"],
@@ -2919,7 +2919,7 @@ const Qi = [
2919
2919
  iso: ce
2920
2920
  };
2921
2921
  function eo(e) {
2922
- return typeof e == "string" && Object.prototype.hasOwnProperty.call(gn, e);
2922
+ return typeof e == "string" && Object.prototype.hasOwnProperty.call(yn, e);
2923
2923
  }
2924
2924
  function to(e, t) {
2925
2925
  return Qi.find(
@@ -2975,7 +2975,7 @@ function no(e) {
2975
2975
  (t) => t.kind === "token" ? [t.value] : []
2976
2976
  );
2977
2977
  }
2978
- function Yt(e, t) {
2978
+ function zt(e, t) {
2979
2979
  return e.filter((n) => t.includes(n)).length === 1;
2980
2980
  }
2981
2981
  function ue(e, t) {
@@ -2986,7 +2986,7 @@ function ro(e) {
2986
2986
  }
2987
2987
  function ao(e, t) {
2988
2988
  if (ro(e)) return !1;
2989
- const n = ["YYYY", "YY"], r = ["MMMM", "MMM", "MM"], a = ["HH", "mm", "ss"], i = Yt(e, n), o = Yt(e, r), s = e.includes("DD"), c = ue(e, a);
2989
+ const n = ["YYYY", "YY"], r = ["MMMM", "MMM", "MM"], a = ["HH", "mm", "ss"], i = zt(e, n), o = zt(e, r), s = e.includes("DD"), c = ue(e, a);
2990
2990
  switch (t) {
2991
2991
  case "second":
2992
2992
  return e.includes("HH") && e.includes("mm") && e.includes("ss") && (!ue(e, [...n, ...r, "DD"]) || i && o && s);
@@ -3005,11 +3005,11 @@ function ao(e, t) {
3005
3005
  return i && !o && !s && !c;
3006
3006
  }
3007
3007
  }
3008
- function yn(e, t) {
3008
+ function pn(e, t) {
3009
3009
  if (e.presentation.mode === "auto")
3010
3010
  return { ok: !0 };
3011
3011
  if (e.presentation.mode === "preset") {
3012
- const r = gn[e.presentation.preset];
3012
+ const r = yn[e.presentation.preset];
3013
3013
  return r.includes(t) ? { ok: !0 } : {
3014
3014
  ok: !1,
3015
3015
  code: "incompatible_temporal_bucket_preset",
@@ -3026,9 +3026,9 @@ function yn(e, t) {
3026
3026
  message: `Pattern ${e.presentation.pattern} is not compatible with ${t} granularity.`
3027
3027
  } : n;
3028
3028
  }
3029
- function Vs(e, t) {
3029
+ function Ks(e, t) {
3030
3030
  if (!(!e || !t))
3031
- return yn(e, t).ok ? e : void 0;
3031
+ return pn(e, t).ok ? e : void 0;
3032
3032
  }
3033
3033
  function io(e) {
3034
3034
  return e.preset ? { mode: "preset", preset: e.preset } : e.pattern ? { mode: "pattern", dialect: e.dialect ?? "semaphor_tokens", pattern: e.pattern } : { mode: "auto" };
@@ -3036,7 +3036,7 @@ function io(e) {
3036
3036
  class R extends Error {
3037
3037
  constructor(n, r) {
3038
3038
  super(r);
3039
- $(this, "code");
3039
+ k(this, "code");
3040
3040
  this.name = "RawTemporalFormatContractError", this.code = n;
3041
3041
  }
3042
3042
  }
@@ -3093,7 +3093,7 @@ function g(e) {
3093
3093
  e
3094
3094
  );
3095
3095
  }
3096
- function pn(e) {
3096
+ function wn(e) {
3097
3097
  if (!e || e.trim() !== e || e.length > 256)
3098
3098
  return g(
3099
3099
  "date_fns patterns must be non-empty, trimmed, and at most 256 characters."
@@ -3156,13 +3156,13 @@ function pn(e) {
3156
3156
  }
3157
3157
  return t.some((a) => a.kind === "token") ? t : g("date_fns patterns must contain at least one token.");
3158
3158
  }
3159
- function wn(e, t) {
3159
+ function Tn(e, t) {
3160
3160
  if (e === "semaphor_tokens") {
3161
3161
  const n = ne(t);
3162
3162
  n.ok || g(n.message);
3163
3163
  return;
3164
3164
  }
3165
- pn(t);
3165
+ wn(t);
3166
3166
  }
3167
3167
  function lo(e) {
3168
3168
  return !T(e) || !M(e, ["dateStyle", "dateTime"]) ? g("Automatic raw temporal styles are incomplete.") : ze.has(e.dateStyle) ? !T(e.dateTime) || !M(e.dateTime, ["dateStyle", "timeStyle"]) || !ze.has(e.dateTime.dateStyle) || !ze.has(e.dateTime.timeStyle) ? g(
@@ -3195,7 +3195,7 @@ function et(e) {
3195
3195
  }
3196
3196
  } : g(
3197
3197
  "Automatic raw temporal presentation has unknown fields."
3198
- ) : e.presentation.mode === "preset" ? !M(e.presentation, ["mode", "preset"]) || !vn(e.presentation.preset) ? g("Preset raw temporal presentation has an invalid shape.") : {
3198
+ ) : e.presentation.mode === "preset" ? !M(e.presentation, ["mode", "preset"]) || !Sn(e.presentation.preset) ? g("Preset raw temporal presentation has an invalid shape.") : {
3199
3199
  type: "raw_temporal",
3200
3200
  locale: r,
3201
3201
  calendarTimezone: e.calendarTimezone,
@@ -3203,7 +3203,7 @@ function et(e) {
3203
3203
  presentation: { mode: "preset", preset: e.presentation.preset }
3204
3204
  } : e.presentation.mode !== "pattern" || !M(e.presentation, ["mode", "dialect", "pattern"]) || e.presentation.dialect !== "semaphor_tokens" && e.presentation.dialect !== "date_fns" || typeof e.presentation.pattern != "string" ? g(
3205
3205
  "Pattern raw temporal presentation has an invalid shape."
3206
- ) : (wn(e.presentation.dialect, e.presentation.pattern), {
3206
+ ) : (Tn(e.presentation.dialect, e.presentation.pattern), {
3207
3207
  type: "raw_temporal",
3208
3208
  locale: r,
3209
3209
  calendarTimezone: e.calendarTimezone,
@@ -3215,7 +3215,7 @@ function et(e) {
3215
3215
  }
3216
3216
  }) : g("Raw temporal presentation must be an object.") : g("Raw temporal locale is invalid or unsupported.");
3217
3217
  }
3218
- function Tn(e) {
3218
+ function vn(e) {
3219
3219
  var s, c, u;
3220
3220
  if (e.format) {
3221
3221
  if (!T(e.format))
@@ -3236,14 +3236,14 @@ function Tn(e) {
3236
3236
  "Automatic authored raw temporal format has unknown fields."
3237
3237
  );
3238
3238
  } else if (f.mode === "preset") {
3239
- if (!M(f, ["mode", "preset"]) || !vn(f.preset))
3239
+ if (!M(f, ["mode", "preset"]) || !Sn(f.preset))
3240
3240
  return g("Authored raw temporal preset has an invalid shape.");
3241
3241
  } else {
3242
3242
  if (f.mode !== "pattern" || !M(f, ["mode", "dialect", "pattern"]) || f.dialect !== "semaphor_tokens" && f.dialect !== "date_fns" || typeof f.pattern != "string")
3243
3243
  return g(
3244
3244
  "Authored raw temporal pattern has an invalid shape."
3245
3245
  );
3246
- wn(f.dialect, f.pattern);
3246
+ Tn(f.dialect, f.pattern);
3247
3247
  }
3248
3248
  }
3249
3249
  const t = (s = e.format) == null ? void 0 : s.timezone, n = (c = e.format) == null ? void 0 : c.sourceTimezone, r = t && t !== "auto" ? t : e.calendar.tz, a = n && n !== "auto" ? n === "local" ? Intl.DateTimeFormat().resolvedOptions().timeZone : n : void 0;
@@ -3264,7 +3264,7 @@ function Tn(e) {
3264
3264
  };
3265
3265
  return et(o);
3266
3266
  }
3267
- function Ks(e) {
3267
+ function Gs(e) {
3268
3268
  const t = /* @__PURE__ */ new Set();
3269
3269
  let n = !1;
3270
3270
  for (const r of e.values) {
@@ -3288,7 +3288,7 @@ function Ks(e) {
3288
3288
  }
3289
3289
  };
3290
3290
  }
3291
- function Gs(e) {
3291
+ function Qs(e) {
3292
3292
  return {
3293
3293
  version: 1,
3294
3294
  columns: Object.fromEntries(
@@ -3322,7 +3322,7 @@ function mo(e) {
3322
3322
  }
3323
3323
  return { version: 1, columns: t };
3324
3324
  }
3325
- function Qs(e) {
3325
+ function Js(e) {
3326
3326
  if (e.length === 0) return;
3327
3327
  const t = e.map(mo), n = Object.keys(t[0].columns).sort();
3328
3328
  for (let r = 1; r < t.length; r += 1) {
@@ -3508,7 +3508,7 @@ function ho(e, t, n, r) {
3508
3508
  ).join("");
3509
3509
  }
3510
3510
  function bn(e, t, n) {
3511
- const r = t === "date_fns" ? pn(n) : (() => {
3511
+ const r = t === "date_fns" ? wn(n) : (() => {
3512
3512
  const i = ne(n);
3513
3513
  return i.ok ? i.segments : g(i.message);
3514
3514
  })(), a = r.filter((i) => i.kind === "token").map((i) => i.value);
@@ -3553,7 +3553,7 @@ function xn(e, t) {
3553
3553
  };
3554
3554
  }
3555
3555
  const po = /* @__PURE__ */ new Set(["short", "long", "numeric", "iso"]);
3556
- function vn(e) {
3556
+ function Sn(e) {
3557
3557
  return typeof e == "string" && po.has(e);
3558
3558
  }
3559
3559
  function wo(e, t, n) {
@@ -3594,7 +3594,7 @@ function To(e, t) {
3594
3594
  });
3595
3595
  return (o) => r ? i.format(o.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? i.format(tt(o.fields, t.sourceTimezone)) : i.format(qe(o.fields));
3596
3596
  }
3597
- function zt(e, t, n) {
3597
+ function At(e, t, n) {
3598
3598
  return {
3599
3599
  ok: !1,
3600
3600
  text: e,
@@ -3604,7 +3604,7 @@ function zt(e, t, n) {
3604
3604
  }
3605
3605
  };
3606
3606
  }
3607
- function Sn(e) {
3607
+ function Mn(e) {
3608
3608
  const t = Vn(e.metadata), n = et(e.format), r = n.presentation.mode === "auto" ? To(t, n) : n.presentation.mode === "preset" ? wo(t, n, n.presentation.preset) : yo(
3609
3609
  t,
3610
3610
  n,
@@ -3615,7 +3615,7 @@ function Sn(e) {
3615
3615
  if (i === null)
3616
3616
  return { ok: !0, text: "", status: "empty" };
3617
3617
  const o = Kn(i, t.valueKind);
3618
- return o.status === "invalid_shape" ? zt(i, t, "invalid_raw_temporal_value") : o.status === "out_of_range" ? zt(i, t, "out_of_range_raw_temporal_value") : {
3618
+ return o.status === "invalid_shape" ? At(i, t, "invalid_raw_temporal_value") : o.status === "out_of_range" ? At(i, t, "out_of_range_raw_temporal_value") : {
3619
3619
  ok: !0,
3620
3620
  text: r(o),
3621
3621
  status: "formatted",
@@ -3623,28 +3623,28 @@ function Sn(e) {
3623
3623
  };
3624
3624
  };
3625
3625
  }
3626
- function Do(e) {
3627
- return Sn({
3626
+ function vo(e) {
3627
+ return Mn({
3628
3628
  metadata: e.metadata,
3629
3629
  format: e.format
3630
3630
  })(e.value);
3631
3631
  }
3632
- function bo(e) {
3633
- const t = Tn({ format: e.authored, preferences: e.preferences, calendar: e.calendar });
3634
- return { format: t, formatValue: Sn({ metadata: e.metadata, format: t }) };
3632
+ function Do(e) {
3633
+ const t = vn({ format: e.authored, preferences: e.preferences, calendar: e.calendar });
3634
+ return { format: t, formatValue: Mn({ metadata: e.metadata, format: t }) };
3635
3635
  }
3636
- const xo = {
3636
+ const bo = {
3637
3637
  dateStyle: "short",
3638
3638
  dateTime: { dateStyle: "short", timeStyle: "short" }
3639
3639
  };
3640
3640
  class de extends Error {
3641
3641
  constructor(n, r) {
3642
3642
  super(r);
3643
- $(this, "code");
3643
+ k(this, "code");
3644
3644
  this.name = "TemporalBucketContractError", this.code = n;
3645
3645
  }
3646
3646
  }
3647
- const vo = [
3647
+ const xo = [
3648
3648
  "Jan",
3649
3649
  "Feb",
3650
3650
  "Mar",
@@ -3734,8 +3734,8 @@ function re(e, t) {
3734
3734
  `Canonical value ${e} is not aligned to ${t.granularity} granularity and its governed Calendar.`
3735
3735
  );
3736
3736
  }
3737
- const Se = (e) => `${D(e.year, 4)}-${D(e.month)}-${D(e.day)}`;
3738
- function Js(e, t, n) {
3737
+ const Se = (e) => `${v(e.year, 4)}-${v(e.month)}-${v(e.day)}`;
3738
+ function ec(e, t, n) {
3739
3739
  const r = re(e, t);
3740
3740
  if (!r.ok || !r.value) return;
3741
3741
  const a = ye({ ...r.value, millisecond: 0 }, n.amount, n.unit), { granularity: i } = t;
@@ -3745,21 +3745,21 @@ function Js(e, t, n) {
3745
3745
  second: i === "second" ? a.second : 0,
3746
3746
  minute: i === "hour" ? 0 : a.minute
3747
3747
  };
3748
- return `${Se(o)}T${D(o.hour)}:${D(o.minute)}:${D(o.second)}`;
3748
+ return `${Se(o)}T${v(o.hour)}:${v(o.minute)}:${v(o.second)}`;
3749
3749
  }
3750
3750
  return Se(Qn(a, i, t.calendar));
3751
3751
  }
3752
- function ec(e, t) {
3752
+ function tc(e, t) {
3753
3753
  const n = re(e, t);
3754
3754
  if (!n.ok || !n.value) return;
3755
3755
  const r = { ...n.value, millisecond: 0 }, a = t.calendar.tz;
3756
3756
  return {
3757
- startInclusive: ot(r, a).toISOString(),
3758
- endExclusive: ot(ye(r, 1, t.granularity), a).toISOString(),
3757
+ startInclusive: st(r, a).toISOString(),
3758
+ endExclusive: st(ye(r, 1, t.granularity), a).toISOString(),
3759
3759
  timezone: a
3760
3760
  };
3761
3761
  }
3762
- function tc(e, t) {
3762
+ function nc(e, t) {
3763
3763
  const { granularity: n } = t;
3764
3764
  if (n === "second" || n === "minute" || n === "hour") return;
3765
3765
  const r = re(e, t);
@@ -3767,13 +3767,13 @@ function tc(e, t) {
3767
3767
  const a = { ...r.value, hour: 0, minute: 0, second: 0, millisecond: 0 }, i = ye(ye(a, 1, n), -1, "day");
3768
3768
  return { first: Se(a), last: Se(i) };
3769
3769
  }
3770
- function nc(e) {
3770
+ function rc(e) {
3771
3771
  const { granularity: t, calendar: n } = e, r = (o, s) => new Intl.DateTimeFormat("en-US", { ...o, timeZone: "UTC" }).format(s), a = [`by ${t} in the ${n.tz} calendar`];
3772
3772
  t === "week" && a.push(`weeks starting on ${r({ weekday: "long" }, new Date(Date.UTC(2023, 0, 1 + n.weekStart)))}`);
3773
3773
  const i = _e(e);
3774
3774
  return i && (t === "quarter" || t === "year") && a.push(`the fiscal year starting in ${r({ month: "long" }, new Date(Date.UTC(2e3, i - 1, 1)))}`), `${a.join(", ")}; each value is a bucket's start`;
3775
3775
  }
3776
- function Mn(e) {
3776
+ function kn(e) {
3777
3777
  if (!T(e))
3778
3778
  return {
3779
3779
  ok: !1,
@@ -3862,16 +3862,16 @@ function Mn(e) {
3862
3862
  }
3863
3863
  function Eo(e, t) {
3864
3864
  const n = !!t.calendar.fiscalCalendar;
3865
- return e === "fiscal_quarter_short" || e === "fiscal_year" ? n : e === "quarter_short" || e === "quarter_long" || En(e) && (t.granularity === "quarter" || t.granularity === "year") ? !n : !0;
3865
+ return e === "fiscal_quarter_short" || e === "fiscal_year" ? n : e === "quarter_short" || e === "quarter_long" || In(e) && (t.granularity === "quarter" || t.granularity === "year") ? !n : !0;
3866
3866
  }
3867
- function kn(e, t) {
3868
- return yn(e, t.granularity).ok ? e.presentation.mode === "preset" ? Eo(e.presentation.preset, t) : !(e.presentation.mode === "pattern" && t.calendar.fiscalCalendar && (t.granularity === "quarter" || t.granularity === "year")) : !1;
3867
+ function _n(e, t) {
3868
+ return pn(e, t.granularity).ok ? e.presentation.mode === "preset" ? Eo(e.presentation.preset, t) : !(e.presentation.mode === "pattern" && t.calendar.fiscalCalendar && (t.granularity === "quarter" || t.granularity === "year")) : !1;
3869
3869
  }
3870
- function At(e, t) {
3870
+ function Rt(e, t) {
3871
3871
  if (!(!e || e.presentation.mode === "auto"))
3872
- return kn(e, t) ? { type: "temporal_bucket", presentation: e.presentation } : void 0;
3872
+ return _n(e, t) ? { type: "temporal_bucket", presentation: e.presentation } : void 0;
3873
3873
  }
3874
- function _n(e) {
3874
+ function Nn(e) {
3875
3875
  var a;
3876
3876
  const t = Q(e.locale);
3877
3877
  if (!t)
@@ -3879,28 +3879,28 @@ function _n(e) {
3879
3879
  "invalid_temporal_bucket_format",
3880
3880
  "Temporal bucket locale must be a supported base BCP 47 locale."
3881
3881
  );
3882
- const n = At(e.cardFormat, e.metadata);
3882
+ const n = Rt(e.cardFormat, e.metadata);
3883
3883
  if (n)
3884
3884
  return { format: { ...n, locale: t }, source: "card" };
3885
- const r = ((a = e.semanticFormat) == null ? void 0 : a.granularity) === e.metadata.granularity ? At(e.semanticFormat.format, e.metadata) : void 0;
3885
+ const r = ((a = e.semanticFormat) == null ? void 0 : a.granularity) === e.metadata.granularity ? Rt(e.semanticFormat.format, e.metadata) : void 0;
3886
3886
  return r ? { format: { ...r, locale: t }, source: "semantic" } : {
3887
3887
  format: {
3888
3888
  type: "temporal_bucket",
3889
3889
  locale: t,
3890
3890
  presentation: {
3891
3891
  mode: "auto",
3892
- styles: e.styles ?? xo
3892
+ styles: e.styles ?? bo
3893
3893
  }
3894
3894
  },
3895
3895
  source: "automatic"
3896
3896
  };
3897
3897
  }
3898
- function D(e, t = 2) {
3898
+ function v(e, t = 2) {
3899
3899
  return String(e).padStart(t, "0");
3900
3900
  }
3901
3901
  function K(e, t, n) {
3902
3902
  if (t === "en-US")
3903
- return (n === "short" ? vo : So)[e - 1];
3903
+ return (n === "short" ? xo : So)[e - 1];
3904
3904
  const r = new Date(Date.UTC(2e3, e - 1, 15));
3905
3905
  return new Intl.DateTimeFormat(t, {
3906
3906
  calendar: "gregory",
@@ -3913,38 +3913,38 @@ function Io(e, t, n) {
3913
3913
  if (r.kind === "literal") return r.value;
3914
3914
  switch (r.value) {
3915
3915
  case "YYYY":
3916
- return D(e.year, 4);
3916
+ return v(e.year, 4);
3917
3917
  case "YY":
3918
- return D(e.year % 100);
3918
+ return v(e.year % 100);
3919
3919
  case "MMMM":
3920
3920
  return K(e.month, n, "long");
3921
3921
  case "MMM":
3922
3922
  return K(e.month, n, "short");
3923
3923
  case "MM":
3924
- return D(e.month);
3924
+ return v(e.month);
3925
3925
  case "DD":
3926
- return D(e.day);
3926
+ return v(e.day);
3927
3927
  case "HH":
3928
- return D(e.hour);
3928
+ return v(e.hour);
3929
3929
  case "mm":
3930
- return D(e.minute);
3930
+ return v(e.minute);
3931
3931
  case "ss":
3932
- return D(e.second);
3932
+ return v(e.second);
3933
3933
  }
3934
3934
  }).join("");
3935
3935
  }
3936
- const Rt = /* @__PURE__ */ new Map();
3936
+ const Ut = /* @__PURE__ */ new Map();
3937
3937
  function Y(e, t) {
3938
- const n = `${e}:${JSON.stringify(t)}`, r = Rt.get(n);
3938
+ const n = `${e}:${JSON.stringify(t)}`, r = Ut.get(n);
3939
3939
  if (r) return r;
3940
3940
  const a = new Intl.DateTimeFormat(e, t);
3941
- return Rt.set(n, a), a;
3941
+ return Ut.set(n, a), a;
3942
3942
  }
3943
3943
  function G(e) {
3944
3944
  const t = /* @__PURE__ */ new Date(0);
3945
3945
  return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(e.hour, e.minute, e.second, 0), t;
3946
3946
  }
3947
- function Ut(e, t, n) {
3947
+ function Lt(e, t, n) {
3948
3948
  return Y(t, {
3949
3949
  calendar: "gregory",
3950
3950
  dateStyle: n,
@@ -3986,20 +3986,20 @@ function Fo(e, t, n) {
3986
3986
  year: "numeric"
3987
3987
  }).format(G(e));
3988
3988
  }
3989
- function Nn(e, t) {
3989
+ function $n(e, t) {
3990
3990
  return Math.floor((e.month - t + 12) % 12 / 3) + 1;
3991
3991
  }
3992
- function Lt(e, t) {
3992
+ function Wt(e, t) {
3993
3993
  return t === 1 || e.month < t ? e.year : e.year + 1;
3994
3994
  }
3995
- function $n(e) {
3995
+ function En(e) {
3996
3996
  return e === 1 ? "1st" : e === 2 ? "2nd" : e === 3 ? "3rd" : `${e}th`;
3997
3997
  }
3998
- function En(e) {
3998
+ function In(e) {
3999
3999
  return e === "short" || e === "long" || e === "numeric" || e === "iso";
4000
4000
  }
4001
4001
  function Re(e, t, n) {
4002
- return t === "iso" ? `${D(e.year, 4)}-${D(e.month)}-${D(e.day)}` : Y(n, {
4002
+ return t === "iso" ? `${v(e.year, 4)}-${v(e.month)}-${v(e.day)}` : Y(n, {
4003
4003
  calendar: "gregory",
4004
4004
  month: t === "numeric" ? "numeric" : t === "long" ? "long" : "short",
4005
4005
  day: "numeric",
@@ -4008,14 +4008,14 @@ function Re(e, t, n) {
4008
4008
  }).format(G(e));
4009
4009
  }
4010
4010
  function Co(e, t, n, r) {
4011
- const a = Nn(e, 1);
4011
+ const a = $n(e, 1);
4012
4012
  switch (r) {
4013
4013
  case "week":
4014
4014
  return t === "numeric" || t === "iso" ? Re(e, t, n) : `Week of ${Re(e, t, n)}`;
4015
4015
  case "month":
4016
- return t === "iso" ? `${D(e.year, 4)}-${D(e.month)}` : t === "numeric" ? `${D(e.month)}/${D(e.year, 4)}` : `${K(e.month, n, t === "long" ? "long" : "short")} ${e.year}`;
4016
+ return t === "iso" ? `${v(e.year, 4)}-${v(e.month)}` : t === "numeric" ? `${v(e.month)}/${v(e.year, 4)}` : `${K(e.month, n, t === "long" ? "long" : "short")} ${e.year}`;
4017
4017
  case "quarter":
4018
- return t === "iso" ? `${D(e.year, 4)}-Q${a}` : t === "long" ? `${$n(a)} Quarter ${e.year}` : `Q${a} ${e.year}`;
4018
+ return t === "iso" ? `${v(e.year, 4)}-Q${a}` : t === "long" ? `${En(a)} Quarter ${e.year}` : `Q${a} ${e.year}`;
4019
4019
  case "year":
4020
4020
  return String(e.year);
4021
4021
  default:
@@ -4023,9 +4023,9 @@ function Co(e, t, n, r) {
4023
4023
  }
4024
4024
  }
4025
4025
  function Ze(e, t, n, r) {
4026
- if (En(t))
4026
+ if (In(t))
4027
4027
  return Co(e, t, n, r.granularity);
4028
- const a = _e(r) ?? 1, i = Nn(e, a);
4028
+ const a = _e(r) ?? 1, i = $n(e, a);
4029
4029
  switch (t) {
4030
4030
  case "week_of_short":
4031
4031
  return `Week of ${K(e.month, n, "short")} ${e.day}, ${e.year}`;
@@ -4034,11 +4034,11 @@ function Ze(e, t, n, r) {
4034
4034
  case "quarter_short":
4035
4035
  return `Q${i} ${e.year}`;
4036
4036
  case "quarter_long":
4037
- return `${$n(i)} Quarter ${e.year}`;
4037
+ return `${En(i)} Quarter ${e.year}`;
4038
4038
  case "fiscal_quarter_short":
4039
- return `Q${i} FY${Lt(e, a)}`;
4039
+ return `Q${i} FY${Wt(e, a)}`;
4040
4040
  case "fiscal_year":
4041
- return `FY${Lt(e, a)}`;
4041
+ return `FY${Wt(e, a)}`;
4042
4042
  }
4043
4043
  }
4044
4044
  function Po(e, t, n, r) {
@@ -4049,9 +4049,9 @@ function Po(e, t, n, r) {
4049
4049
  case "hour":
4050
4050
  return Oo(e, n, r.dateTime);
4051
4051
  case "day":
4052
- return Ut(e, n, r.dateStyle);
4052
+ return Lt(e, n, r.dateStyle);
4053
4053
  case "week":
4054
- return `Week of ${Ut(e, n, r.dateStyle)}`;
4054
+ return `Week of ${Lt(e, n, r.dateStyle)}`;
4055
4055
  case "month":
4056
4056
  return Fo(e, n, r.dateStyle);
4057
4057
  case "quarter":
@@ -4065,7 +4065,7 @@ function Po(e, t, n, r) {
4065
4065
  return a ? Ze(e, "fiscal_year", n, t) : String(e.year);
4066
4066
  }
4067
4067
  }
4068
- function rc(e, t) {
4068
+ function ac(e, t) {
4069
4069
  if (t.granularity !== "second" && t.granularity !== "minute" && t.granularity !== "hour" && t.granularity !== "day" && t.granularity !== "month")
4070
4070
  return;
4071
4071
  const n = re(e, t);
@@ -4073,9 +4073,9 @@ function rc(e, t) {
4073
4073
  const { year: r, month: a, day: i, hour: o, minute: s, second: c } = n.value;
4074
4074
  return { year: r, month: a, day: i, hour: o, minute: s, second: c };
4075
4075
  }
4076
- function In(e) {
4077
- const t = Mn(e.format);
4078
- if (!t.ok || !kn(t.value, e.metadata))
4076
+ function nt(e) {
4077
+ const t = kn(e.format);
4078
+ if (!t.ok || !_n(t.value, e.metadata))
4079
4079
  throw new de(
4080
4080
  "invalid_temporal_bucket_format",
4081
4081
  "Resolved temporal bucket format is invalid or inapplicable to its metadata."
@@ -4121,18 +4121,18 @@ function Yo(e, t) {
4121
4121
  function zo(e, t, n) {
4122
4122
  return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(Ln).join(t)) ?? `${t} Total` : t;
4123
4123
  }
4124
- function ac(e, t, n, r) {
4124
+ function ic(e, t, n, r) {
4125
4125
  var o;
4126
4126
  const a = e[e.length - 1], i = t === "grand_total" ? n.grand.label : a ? (o = n.levels[a.levelId]) == null ? void 0 : o.label : void 0;
4127
4127
  return zo(t, Yo(e, r), i);
4128
4128
  }
4129
- function ic(e, t, n) {
4129
+ function oc(e, t, n) {
4130
4130
  return e.kind === "value" ? (t == null ? void 0 : t(e.value)) ?? "" : e.kind === "null" ? n.nullText : n.emptyText;
4131
4131
  }
4132
- function oc(e) {
4132
+ function sc(e) {
4133
4133
  const { path: t, previousPath: n, role: r, repeatLabels: a, levelCount: i } = e;
4134
4134
  return Array.from({ length: i }, (o, s) => {
4135
- const c = t.slice(0, s + 1), u = r === "grand_total" ? s === 0 : r === "subtotal" && s === t.length - 1, l = n && n.length > s && it(n.slice(0, s + 1)) === it(c);
4135
+ const c = t.slice(0, s + 1), u = r === "grand_total" ? s === 0 : r === "subtotal" && s === t.length - 1, l = n && n.length > s && ot(n.slice(0, s + 1)) === ot(c);
4136
4136
  return {
4137
4137
  path: c,
4138
4138
  total: u,
@@ -4149,7 +4149,7 @@ function Ro(e, t) {
4149
4149
  numericInput: "canonical"
4150
4150
  });
4151
4151
  }
4152
- function sc(e, t, n) {
4152
+ function cc(e, t, n) {
4153
4153
  const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = (o, s) => {
4154
4154
  const c = (s === "levels" ? t.levelFormats : t.measureFormats)[o.id], u = o.semanticFormat, l = Ro(c, u);
4155
4155
  s === "measures" && r.set(o.id, {
@@ -4157,24 +4157,24 @@ function sc(e, t, n) {
4157
4157
  // Use normalized affixes: a redundant percent suffix is already removed.
4158
4158
  hasTextAffixes: !!l && !!("prefix" in l && l.prefix || "suffix" in l && l.suffix)
4159
4159
  });
4160
- const f = (m) => dn(m, void 0, {
4160
+ const f = (m) => hn(m, void 0, {
4161
4161
  useFormattedValues: !0,
4162
4162
  timezone: n.calendar.tz,
4163
4163
  locale: n.valueFormat.locale,
4164
4164
  absence: t.absence
4165
4165
  });
4166
4166
  if (o.column.temporalBucket) {
4167
- const m = o.column.temporalBucket, h = _n({
4167
+ const m = o.column.temporalBucket, h = Nn({
4168
4168
  metadata: m,
4169
4169
  cardFormat: (c == null ? void 0 : c.type) === "temporal_bucket" ? c : void 0,
4170
4170
  semanticFormat: (u == null ? void 0 : u.type) === "temporal_bucket" ? { granularity: m.granularity, format: u } : void 0,
4171
4171
  locale: n.valueFormat.locale,
4172
4172
  styles: { dateStyle: n.valueFormat.dateStyle, dateTime: n.valueFormat.dateTime }
4173
4173
  });
4174
- return (d) => typeof d == "string" ? In({ value: d, metadata: m, format: h.format }) : f(d);
4174
+ return (d) => typeof d == "string" ? nt({ value: d, metadata: m, format: h.format }) : f(d);
4175
4175
  }
4176
4176
  if (o.column.rawTemporal) {
4177
- const m = Je({ override: c, model: u }).format, { formatValue: h } = bo({
4177
+ const m = Je({ override: c, model: u }).format, { formatValue: h } = Do({
4178
4178
  authored: Ao(m),
4179
4179
  metadata: o.column.rawTemporal,
4180
4180
  preferences: n.valueFormat,
@@ -4190,7 +4190,7 @@ function sc(e, t, n) {
4190
4190
  const m = Gi(l, n.valueFormat);
4191
4191
  return s === "measures" && a.set(o.id, m), (h) => typeof h == "number" || typeof h == "object" && h !== null ? Ve(h, m) : f(h);
4192
4192
  }
4193
- return (l == null ? void 0 : l.type) === "duration" && s === "measures" && a.set(o.id, l), (l == null ? void 0 : l.type) === "duration" ? (m) => typeof m == "number" || typeof m == "string" || typeof m == "object" && m !== null ? Bt(
4193
+ return (l == null ? void 0 : l.type) === "duration" && s === "measures" && a.set(o.id, l), (l == null ? void 0 : l.type) === "duration" ? (m) => typeof m == "number" || typeof m == "string" || typeof m == "object" && m !== null ? Vt(
4194
4194
  typeof m == "object" ? m.value : m,
4195
4195
  l
4196
4196
  ) : f(m) : (l == null ? void 0 : l.type) === "string" ? (m) => m === null ? f(m) : `${l.prefix ?? ""}${f(m)}${l.suffix ?? ""}` : f;
@@ -4207,13 +4207,13 @@ function sc(e, t, n) {
4207
4207
  absence: t.absence
4208
4208
  };
4209
4209
  }
4210
- function cc(e, t) {
4210
+ function uc(e, t) {
4211
4211
  return t.levelLabels[e.id] ?? e.field.label ?? e.field.name;
4212
4212
  }
4213
- function uc(e, t) {
4213
+ function lc(e, t) {
4214
4214
  return t.measureLabels[e.id] ?? (e.kind === "aggregate" ? e.field.label ?? e.field.name : e.definition.label);
4215
4215
  }
4216
- function lc(e) {
4216
+ function mc(e) {
4217
4217
  return qn.parse(Uo(e));
4218
4218
  }
4219
4219
  function Uo(e) {
@@ -4249,7 +4249,7 @@ function Lo(e, t) {
4249
4249
  for (const r of t ?? []) n.set(X(r), r);
4250
4250
  return [...n.values()];
4251
4251
  }
4252
- function mc(e) {
4252
+ function fc(e) {
4253
4253
  const { spec: t, presentation: n, defaults: r, session: a } = Hn.parse(e), i = new Map(
4254
4254
  Lo(t.sorts, a == null ? void 0 : a.sorts).map((s) => [X(s), s])
4255
4255
  );
@@ -4285,23 +4285,23 @@ function mc(e) {
4285
4285
  }
4286
4286
  };
4287
4287
  }
4288
- class Wt extends Error {
4288
+ class jt extends Error {
4289
4289
  constructor(n) {
4290
4290
  super(
4291
4291
  `invalid_presentation_execution_snapshot: ${n} Resave this report before running it again.`
4292
4292
  );
4293
- $(this, "code", "invalid_presentation_execution_snapshot");
4294
- $(this, "deliveryBlocking", !0);
4293
+ k(this, "code", "invalid_presentation_execution_snapshot");
4294
+ k(this, "deliveryBlocking", !0);
4295
4295
  this.name = "PresentationExecutionSnapshotError";
4296
4296
  }
4297
4297
  }
4298
- class fc extends Error {
4298
+ class dc extends Error {
4299
4299
  constructor(n) {
4300
4300
  super(
4301
4301
  `missing_resolved_raw_temporal_format: Column "${n}" has no captured presentation. Resave this report before running it again.`
4302
4302
  );
4303
- $(this, "code", "missing_resolved_raw_temporal_format");
4304
- $(this, "deliveryBlocking", !0);
4303
+ k(this, "code", "missing_resolved_raw_temporal_format");
4304
+ k(this, "deliveryBlocking", !0);
4305
4305
  this.name = "MissingResolvedRawTemporalFormatError";
4306
4306
  }
4307
4307
  }
@@ -4497,7 +4497,7 @@ function Go(e) {
4497
4497
  let o;
4498
4498
  switch (n.format.type) {
4499
4499
  case "temporal_bucket": {
4500
- const l = Mn(n.format);
4500
+ const l = kn(n.format);
4501
4501
  if (!l.ok)
4502
4502
  throw new Error(
4503
4503
  `${a}.format is invalid: ${((c = l.issues[0]) == null ? void 0 : c.message) ?? "invalid value"}`
@@ -4590,7 +4590,7 @@ function Qo(e) {
4590
4590
  resolvedFormats: Go(e.resolvedFormats)
4591
4591
  };
4592
4592
  } catch (t) {
4593
- throw t instanceof Wt ? t : new Wt(
4593
+ throw t instanceof jt ? t : new jt(
4594
4594
  t instanceof Error ? t.message : "Snapshot is invalid."
4595
4595
  );
4596
4596
  }
@@ -4602,7 +4602,7 @@ function Jo(e) {
4602
4602
  resolvedFormats: [...e.resolvedFormats]
4603
4603
  });
4604
4604
  }
4605
- function dc(e, t) {
4605
+ function hc(e, t) {
4606
4606
  const n = t.filter(
4607
4607
  (r, a) => !e.resolvedFormats.some(
4608
4608
  (i) => U(i.scope, r.scope) && L(i.target, r.target)
@@ -4616,7 +4616,7 @@ function dc(e, t) {
4616
4616
  resolvedFormats: [...e.resolvedFormats, ...n]
4617
4617
  });
4618
4618
  }
4619
- function hc(e) {
4619
+ function gc(e) {
4620
4620
  const t = es(e);
4621
4621
  return J(t) ? t : void 0;
4622
4622
  }
@@ -4626,25 +4626,25 @@ function es(e) {
4626
4626
  );
4627
4627
  return t == null ? void 0 : t.format;
4628
4628
  }
4629
- function gc(e) {
4629
+ function yc(e) {
4630
4630
  const t = e.snapshot.resolvedFormats.find(
4631
4631
  (n) => n.format.type === "date" && U(n.scope, e.scope) && L(n.target, e.target)
4632
4632
  );
4633
4633
  return t == null ? void 0 : t.format;
4634
4634
  }
4635
- function yc(e) {
4635
+ function pc(e) {
4636
4636
  const t = e.snapshot.resolvedFormats.find(
4637
4637
  (n) => n.format.type === "raw_temporal" && U(n.scope, e.scope) && L(n.target, e.target)
4638
4638
  );
4639
4639
  return t == null ? void 0 : t.format;
4640
4640
  }
4641
- function pc(e) {
4641
+ function wc(e) {
4642
4642
  const t = e.snapshot.resolvedFormats.find(
4643
4643
  (n) => n.format.type === "temporal_bucket" && U(n.scope, e.scope) && L(n.target, e.target)
4644
4644
  );
4645
4645
  return t == null ? void 0 : t.format;
4646
4646
  }
4647
- function wc(e) {
4647
+ function Tc(e) {
4648
4648
  var a;
4649
4649
  const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
4650
4650
  if (e.snapshot.resolvedFormats.forEach((i, o) => {
@@ -4685,8 +4685,8 @@ function wc(e) {
4685
4685
  `resolvedFormats is missing visible export column "${r}"`
4686
4686
  );
4687
4687
  }
4688
- const ts = /* @__PURE__ */ new Set(["short", "medium", "long"]), ns = /^(\d{4})-(\d{2})-(\d{2})$/, rs = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, as = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, nt = " – ";
4689
- function Tc(e) {
4688
+ const ts = /* @__PURE__ */ new Set(["short", "medium", "long"]), ns = /^(\d{4})-(\d{2})-(\d{2})$/, rs = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, as = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, rt = " – ";
4689
+ function vc(e) {
4690
4690
  if (!T(e)) return;
4691
4691
  const t = Object.keys(e);
4692
4692
  if (e.mode === "period_label" && t.length === 1)
@@ -4718,7 +4718,7 @@ function Dc(e) {
4718
4718
  if (l.some((d) => d === null))
4719
4719
  return {
4720
4720
  ok: !1,
4721
- text: u.map(({ raw: d }) => d).join(nt),
4721
+ text: u.map(({ raw: d }) => d).join(rt),
4722
4722
  diagnostic: {
4723
4723
  code: "invalid_temporal_input_value",
4724
4724
  message: "A date input bound is not a date or an instant."
@@ -4746,14 +4746,14 @@ function os(e, t, n, r) {
4746
4746
  if (!t || t.mode === "period_label") {
4747
4747
  const c = fs(a, i, r);
4748
4748
  if (c)
4749
- return In({
4749
+ return nt({
4750
4750
  value: Xe(a),
4751
4751
  metadata: {
4752
4752
  kind: "temporal_bucket",
4753
4753
  granularity: c,
4754
4754
  calendar: { tz: r.tz, weekStart: r.weekStart ?? 1 }
4755
4755
  },
4756
- format: _n({
4756
+ format: Nn({
4757
4757
  metadata: {
4758
4758
  kind: "temporal_bucket",
4759
4759
  granularity: c,
@@ -4794,10 +4794,10 @@ function ss(e, t, n, r) {
4794
4794
  }
4795
4795
  function On(e, t, n) {
4796
4796
  const r = e;
4797
- return typeof r.formatRange == "function" ? r.formatRange(t, n) : `${e.format(t)}${nt}${e.format(n)}`;
4797
+ return typeof r.formatRange == "function" ? r.formatRange(t, n) : `${e.format(t)}${rt}${e.format(n)}`;
4798
4798
  }
4799
4799
  function Fn(e, t, n, r, a) {
4800
- const i = Tn({
4800
+ const i = vn({
4801
4801
  format: {
4802
4802
  type: "raw_temporal",
4803
4803
  presentation: { mode: "pattern", dialect: "semaphor_tokens", pattern: n }
@@ -4809,7 +4809,7 @@ function Fn(e, t, n, r, a) {
4809
4809
  },
4810
4810
  calendar: { tz: a.tz }
4811
4811
  }), o = t === "date" && cs(n) ? "instant" : t;
4812
- return Do({
4812
+ return vo({
4813
4813
  value: o === t ? e : te(`${e}T00:00:00`, a.tz).toISOString(),
4814
4814
  metadata: { kind: "raw_temporal", valueKind: o },
4815
4815
  format: i
@@ -4819,7 +4819,7 @@ function cs(e) {
4819
4819
  return /HH|mm|ss/.test(e);
4820
4820
  }
4821
4821
  function Cn(e) {
4822
- return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(nt);
4822
+ return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(rt);
4823
4823
  }
4824
4824
  function us(e, t) {
4825
4825
  const n = ns.exec(e);
@@ -4871,7 +4871,41 @@ function Pn(e, t) {
4871
4871
  function gs(e) {
4872
4872
  return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= Pn(e.year, e.month);
4873
4873
  }
4874
+ class ys extends Error {
4875
+ constructor(n, r) {
4876
+ super(`${n}: ${r}`);
4877
+ k(this, "deliveryBlocking", !0);
4878
+ this.code = n, this.name = "PivotHeaderPresentationError";
4879
+ }
4880
+ }
4874
4881
  function bc(e) {
4882
+ var a;
4883
+ const t = e.mode ?? "formatted", n = e.members.map((i) => {
4884
+ var s;
4885
+ if (t === "canonical" || !i.temporalBucket)
4886
+ return i.value === null ? "" : String(i.value);
4887
+ const o = (s = e.resolveTemporalFormat) == null ? void 0 : s.call(e, i.fieldId);
4888
+ if (!o)
4889
+ throw new ys(
4890
+ "missing_resolved_temporal_format",
4891
+ `Missing resolved temporal presentation for pivot field "${i.fieldId}"`
4892
+ );
4893
+ return nt({
4894
+ value: i.value,
4895
+ metadata: i.temporalBucket,
4896
+ format: o
4897
+ });
4898
+ }), r = ((a = e.metricLabel) == null ? void 0 : a.trim()) || void 0;
4899
+ return {
4900
+ memberLabels: n,
4901
+ ...r ? { metricLabel: r } : {},
4902
+ flattenedLabel: [
4903
+ ...n,
4904
+ ...r ? [r] : []
4905
+ ].join(" / ")
4906
+ };
4907
+ }
4908
+ function xc(e) {
4875
4909
  const t = /* @__PURE__ */ new Map();
4876
4910
  return e.forEach((n) => {
4877
4911
  n.id && t.set(n.id, (t.get(n.id) ?? 0) + 1);
@@ -4880,134 +4914,136 @@ function bc(e) {
4880
4914
  );
4881
4915
  }
4882
4916
  export {
4883
- Wo as $,
4884
- Ys as A,
4885
- As as B,
4886
- Rs as C,
4887
- hn as D,
4888
- Us as E,
4917
+ Go as $,
4918
+ Rs as A,
4919
+ Us as B,
4920
+ Ls as C,
4921
+ gn as D,
4922
+ Ws as E,
4889
4923
  Si as F,
4890
- Ls as G,
4891
- Mi as H,
4892
- Ws as I,
4893
- xe as J,
4894
- P as K,
4895
- js as L,
4896
- zs as M,
4897
- Hs as N,
4898
- $i as O,
4899
- Ei as P,
4900
- qs as Q,
4901
- Ii as R,
4902
- Zs as S,
4903
- sc as T,
4904
- Xi as U,
4905
- Bi as V,
4906
- Bs as W,
4907
- Vi as X,
4908
- Gi as Y,
4909
- Wt as Z,
4910
- fc as _,
4911
- es as a,
4912
- nn as a$,
4913
- Go as a0,
4914
- Qo as a1,
4915
- Jo as a2,
4916
- dc as a3,
4917
- hc as a4,
4918
- gc as a5,
4919
- yc as a6,
4920
- pc as a7,
4921
- wc as a8,
4922
- Qi as a9,
4923
- Tc as aA,
4924
+ Mi as G,
4925
+ js as H,
4926
+ be as I,
4927
+ P as J,
4928
+ Hs as K,
4929
+ qs as L,
4930
+ As as M,
4931
+ $i as N,
4932
+ Ei as O,
4933
+ Zs as P,
4934
+ Ii as Q,
4935
+ Xs as R,
4936
+ cc as S,
4937
+ Xi as T,
4938
+ Bi as U,
4939
+ Vs as V,
4940
+ Vi as W,
4941
+ Gi as X,
4942
+ jt as Y,
4943
+ dc as Z,
4944
+ Wo as _,
4945
+ $s as a,
4946
+ oe as a$,
4947
+ Qo as a0,
4948
+ Jo as a1,
4949
+ hc as a2,
4950
+ gc as a3,
4951
+ yc as a4,
4952
+ pc as a5,
4953
+ wc as a6,
4954
+ Tc as a7,
4955
+ Qi as a8,
4956
+ eo as a9,
4957
+ vc as aA,
4924
4958
  is as aB,
4925
4959
  Dc as aC,
4926
- bc as aD,
4927
- mc as aE,
4928
- _s as aF,
4929
- Yo as aG,
4930
- ac as aH,
4931
- oc as aI,
4960
+ ys as aD,
4961
+ bc as aE,
4962
+ xc as aF,
4963
+ fc as aG,
4964
+ Ns as aH,
4965
+ Yo as aI,
4932
4966
  ic as aJ,
4933
- cc as aK,
4934
- fn as aL,
4935
- Is as aM,
4936
- uc as aN,
4937
- lc as aO,
4938
- Uo as aP,
4939
- Lo as aQ,
4940
- Ke as aR,
4941
- j as aS,
4942
- on as aT,
4943
- le as aU,
4944
- p as aV,
4945
- Sr as aW,
4946
- Te as aX,
4947
- ft as aY,
4948
- oe as aZ,
4949
- Es as a_,
4950
- eo as aa,
4951
- ne as ab,
4952
- yn as ac,
4953
- Vs as ad,
4954
- xo as ae,
4955
- de as af,
4956
- re as ag,
4957
- Js as ah,
4958
- ec as ai,
4959
- tc as aj,
4960
- nc as ak,
4961
- Mn as al,
4962
- _n as am,
4963
- rc as an,
4967
+ sc as aK,
4968
+ oc as aL,
4969
+ uc as aM,
4970
+ dn as aN,
4971
+ Os as aO,
4972
+ lc as aP,
4973
+ mc as aQ,
4974
+ Uo as aR,
4975
+ Lo as aS,
4976
+ Ke as aT,
4977
+ j as aU,
4978
+ sn as aV,
4979
+ le as aW,
4980
+ p as aX,
4981
+ Sr as aY,
4982
+ Te as aZ,
4983
+ dt as a_,
4984
+ ne as aa,
4985
+ pn as ab,
4986
+ Ks as ac,
4987
+ bo as ad,
4988
+ de as ae,
4989
+ re as af,
4990
+ ec as ag,
4991
+ tc as ah,
4992
+ nc as ai,
4993
+ rc as aj,
4994
+ kn as ak,
4995
+ Nn as al,
4996
+ ac as am,
4997
+ nt as an,
4964
4998
  io as ao,
4965
4999
  R as ap,
4966
5000
  et as aq,
4967
- Tn as ar,
4968
- Ks as as,
4969
- Gs as at,
5001
+ vn as ar,
5002
+ Gs as as,
5003
+ Qs as at,
4970
5004
  mo as au,
4971
- Qs as av,
5005
+ Js as av,
4972
5006
  go as aw,
4973
- Sn as ax,
4974
- Do as ay,
4975
- bo as az,
4976
- Ns as b,
4977
- Dr as b0,
4978
- $a as b1,
4979
- Oi as b2,
4980
- hr as b3,
4981
- Ro as b4,
4982
- Ot as b5,
4983
- E as b6,
4984
- It as b7,
4985
- $t as b8,
4986
- Ao as b9,
4987
- zo as ba,
4988
- te as bb,
4989
- Yi as c,
4990
- ks as d,
4991
- Be as e,
4992
- In as f,
4993
- Qt as g,
4994
- Jt as h,
5007
+ Mn as ax,
5008
+ vo as ay,
5009
+ Do as az,
5010
+ Yi as b,
5011
+ Is as b0,
5012
+ rn as b1,
5013
+ vr as b2,
5014
+ $a as b3,
5015
+ Oi as b4,
5016
+ hr as b5,
5017
+ Ro as b6,
5018
+ Ft as b7,
5019
+ E as b8,
5020
+ Ot as b9,
5021
+ Et as ba,
5022
+ Ao as bb,
5023
+ zo as bc,
5024
+ te as bd,
5025
+ _s as c,
5026
+ Be as d,
5027
+ Jt as e,
5028
+ es as f,
5029
+ en as g,
5030
+ tn as h,
4995
5031
  J as i,
4996
- en as j,
4997
- Ve as k,
4998
- gr as l,
4999
- $s as m,
5000
- Bt as n,
5001
- Vt as o,
5032
+ Ve as j,
5033
+ gr as k,
5034
+ Es as l,
5035
+ Vt as m,
5036
+ Kt as n,
5037
+ Di as o,
5002
5038
  Je as p,
5003
5039
  bi as q,
5004
5040
  Wi as r,
5005
- xi as s,
5006
- Ps as t,
5007
- Os as u,
5008
- Fs as v,
5009
- Xs as w,
5010
- Cs as x,
5011
- Qe as y,
5012
- dn as z
5041
+ Ys as s,
5042
+ Fs as t,
5043
+ Cs as u,
5044
+ Ps as v,
5045
+ Bs as w,
5046
+ Qe as x,
5047
+ hn as y,
5048
+ zs as z
5013
5049
  };