react-semaphor 0.1.583 → 0.1.585

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 (95) hide show
  1. package/dist/analytics-protocol/index.js +470 -428
  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-DsFXETpI.js +22 -0
  6. package/dist/chunks/{assistant-chat-D3fm5qod.js → assistant-chat-BdbLmAnK.js} +12 -12
  7. package/dist/chunks/{bookmark-impact-Dpxl46Wd.js → bookmark-impact-BhT3k379.js} +2 -2
  8. package/dist/chunks/{bookmark-state-BEl_G9vr.js → bookmark-state-CL4WEpgB.js} +22 -22
  9. package/dist/chunks/{card-filter-builder-IxkFVxy2.js → card-filter-builder-CEcKF6Fw.js} +124 -124
  10. package/dist/chunks/comparison-window-caption-CoART8BC.js +1254 -0
  11. package/dist/chunks/{dashboard-BMqG98fc.js → dashboard-MPku_x1M.js} +1 -1
  12. package/dist/chunks/{dashboard-briefing-launcher-D45YfCkm.js → dashboard-briefing-launcher-CkFNlkr1.js} +13 -13
  13. package/dist/chunks/{dashboard-controls-DOvZRfof.js → dashboard-controls-Clt4ovXS.js} +84 -84
  14. package/dist/chunks/{dashboard-json-B_4TqF_o.js → dashboard-json-DSmXazIg.js} +4 -4
  15. package/dist/chunks/{dates-44_rcNj2.js → dates-CYZW9owO.js} +8 -8
  16. package/dist/chunks/{edit-dashboard-visual-BBPKJWSe.js → edit-dashboard-visual-Dn2ECRbX.js} +2752 -2687
  17. package/dist/chunks/filter-line-Cu2u1K36.js +131 -0
  18. package/dist/chunks/{filter-reach-copy-DWPq4Swi.js → filter-reach-copy-CmJpPa4G.js} +1745 -1326
  19. package/dist/chunks/{filter-value-text-DXGYypEd.js → filter-value-text-xefXzZlf.js} +6 -6
  20. package/dist/chunks/{index-DPRzcFp0.js → index-0WYn6RMz.js} +37 -37
  21. package/dist/chunks/{layout-grid-8rR-LPTk.js → layout-grid-9nSS2SL-.js} +1 -1
  22. package/dist/chunks/{list-filter-C1-uTgjR.js → list-filter-CfMPI6v4.js} +1 -1
  23. package/dist/chunks/{matrix-analytical-definition-D_HgptqZ.js → matrix-analytical-definition-QjBgUYhP.js} +382 -544
  24. package/dist/chunks/{matrix-member-presentation-DRa-9e6Q.js → matrix-member-presentation-BKDyxJho.js} +1 -1
  25. package/dist/chunks/{matrix-operation-contract-DCVinw1o.js → matrix-operation-contract-BM5TveR3.js} +153 -147
  26. package/dist/chunks/{metric-comparison-n9NsIa-2.js → metric-comparison-ZmurmEIs.js} +3 -3
  27. package/dist/chunks/{paintbrush-aR17Z3C9.js → paintbrush-LzAje2ff.js} +1 -1
  28. package/dist/chunks/{palette-a5FCZKFI.js → palette-DicJG0TC.js} +1 -1
  29. package/dist/chunks/{pivot-header-presentation-MvvlxtIB.js → pivot-header-presentation-CdeTU96P.js} +1 -1
  30. package/dist/chunks/{pivot-result-contract-expectations-8tuNjRvG.js → pivot-result-contract-expectations-Bx_BCu-7.js} +1029 -1010
  31. package/dist/chunks/{pivot-result-identity-B89X5xjb.js → pivot-result-identity-Bvs6Uq3v.js} +1 -1
  32. package/dist/chunks/raw-temporal-value-DH-feMc2.js +322 -0
  33. package/dist/chunks/{report-preferences-dialog-B8PhISua.js → report-preferences-dialog-BRaeufEi.js} +63 -62
  34. package/dist/chunks/{report-runtime-context-BhPzLTbS.js → report-runtime-context-NlOXwyRB.js} +1 -1
  35. package/dist/chunks/{resolve-dashboard-input-context-BfT8y5xL.js → resolve-dashboard-input-context-Cn9jumxl.js} +4924 -4823
  36. package/dist/chunks/{save-D985VvYp.js → save-0wu1Z1U7.js} +1 -1
  37. package/dist/chunks/{saved-dashboard-context-DH91-2B9.js → saved-dashboard-context-CfqkUMzR.js} +6 -6
  38. package/dist/chunks/selection-filter-compiler-BReJy-uv.js +92 -0
  39. package/dist/chunks/{semaphor-ready-indicator-Cg_Z2IDc.js → semaphor-ready-indicator-D6WjdTGl.js} +48377 -47074
  40. package/dist/chunks/{shelf-drop-preview-context-C7-BgcP4.js → shelf-drop-preview-context-Bbbrr9u4.js} +5 -5
  41. package/dist/chunks/{stored-dashboard-BpyCiE49.js → stored-dashboard-sPkTjxYf.js} +210 -221
  42. package/dist/chunks/{style-sheet-parts-C7qGZuH1.js → style-sheet-parts-_dGSFzDi.js} +2 -2
  43. package/dist/chunks/{table-export-sheet-wBkk17aa.js → table-export-sheet-Dmtqi5NV.js} +1 -1
  44. package/dist/chunks/{token-types-iKMplaBL.js → token-types-DEe_FP4l.js} +1 -1
  45. package/dist/chunks/{upload-CiGNKJ_0.js → upload-CtyOkU_B.js} +1 -1
  46. package/dist/chunks/{validators-B8fpdinG.js → validators-CJ8Jh0E8.js} +2 -2
  47. package/dist/chunks/{variable-draft-D8GFhAkm.js → variable-draft-D1RotIEG.js} +4 -4
  48. package/dist/dashboard/index.js +2 -2
  49. package/dist/dashboard-authoring/index.js +670 -647
  50. package/dist/format-utils/index.js +218 -215
  51. package/dist/index.js +234 -231
  52. package/dist/report-runtime-context/index.js +1 -1
  53. package/dist/style.css +1 -1
  54. package/dist/surfboard/index.js +2 -2
  55. package/dist/types/components/visual/data-table/types/data-table.d.ts +3 -0
  56. package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +24 -3
  57. package/dist/types/index.js +5 -5
  58. package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
  59. package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +9 -0
  60. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +8 -3
  61. package/dist/types/lib/query-context/compile-selection-filters.d.ts +1 -5
  62. package/dist/types/lib/see-records/click.d.ts +79 -0
  63. package/dist/types/lib/see-records/see-records-offer.d.ts +25 -0
  64. package/dist/types/lib/see-records/use-see-records-offer.d.ts +16 -0
  65. package/dist/types/lib/types/common-types.d.ts +6 -0
  66. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +7 -0
  67. package/dist/types/shared/analytics-protocol/aggregate-measure-field.d.ts +13 -0
  68. package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
  69. package/dist/types/shared/analytics-protocol/selection-filter-compiler.d.ts +3 -0
  70. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +6 -0
  71. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  72. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
  73. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -0
  74. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
  75. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  76. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  77. package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
  78. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +191 -0
  79. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +14 -0
  80. package/dist/types/shared/dashboard-authoring/see-records/availability.d.ts +30 -0
  81. package/dist/types/shared/dashboard-authoring/see-records/click.d.ts +37 -0
  82. package/dist/types/shared/dashboard-authoring/see-records/index.d.ts +12 -0
  83. package/dist/types/shared/dashboard-authoring/see-records/limits.d.ts +18 -0
  84. package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +49 -0
  85. package/dist/types/shared/dashboard-authoring/see-records/request.d.ts +28 -0
  86. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +94 -0
  87. package/dist/types/shared/format-utils/semantic-format.d.ts +0 -1
  88. package/dist/types/shared/format-utils/temporal-bucket.d.ts +20 -0
  89. package/dist/types/shared/temporal/calendar-periods.d.ts +15 -0
  90. package/dist/types/shared/temporal/raw-temporal-equality.d.ts +14 -0
  91. package/dist/types/shared/usage-events/envelope.d.ts +4 -4
  92. package/package.json +1 -1
  93. package/dist/chunks/comparison-window-caption-sRFtnX1q.js +0 -1371
  94. package/dist/chunks/raw-temporal-value-DdT0s47W.js +0 -159
  95. package/dist/chunks/selection-filter-compiler-CUDRnUxc.js +0 -80
@@ -1,84 +1,84 @@
1
- var En = Object.defineProperty;
2
- var Cn = (e, t, n) => t in e ? En(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var $ = (e, t, n) => Cn(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { z as w } from "zod";
5
- import { E as Rt, l as Lt } from "./export-file-format-C-tJsxsf.js";
6
- import { a$ as Wt, b0 as Pn, aU as Yn, m as nt, a5 as zn, M as Un, b1 as An, b2 as Rn, R as Ln, I as K, S as Wn } from "./validators-B8fpdinG.js";
7
- import "./matrix-operation-contract-DCVinw1o.js";
8
- import { k as jn, i as he } from "./analytics-base-schemas-BaIQrEzX.js";
9
- import { b as Hn } from "./report-runtime-context-BhPzLTbS.js";
10
- import { canonicalizeSupportedLocale as Q, canonicalizeSupportedCurrencyCode as Ue, DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as qn } from "../value-format-preferences/index.js";
11
- import { p as Zn, a as Kn, c as Vn, b as Bn } from "./raw-temporal-value-DdT0s47W.js";
12
- import { r as Xn } from "./metric-comparison-n9NsIa-2.js";
1
+ var Yn = Object.defineProperty;
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);
4
+ import { z as p } from "zod";
5
+ import { E as Wt, l as jt } from "./export-file-format-C-tJsxsf.js";
6
+ import { a$ as Ht, b0 as An, aU as Rn, m as rt, a5 as Un, M as Ln, b1 as Wn, b2 as jn, R as Hn, I as X, S as qn } from "./validators-CJ8Jh0E8.js";
7
+ import "./matrix-operation-contract-BM5TveR3.js";
8
+ import { k as Zn, i as he } from "./analytics-base-schemas-BaIQrEzX.js";
9
+ import { b as Xn } from "./report-runtime-context-NlOXwyRB.js";
10
+ import { canonicalizeSupportedLocale as Q, canonicalizeSupportedCurrencyCode as Re, DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as Vn } from "../value-format-preferences/index.js";
11
+ import { p as Bn, a as Kn, c as Gn, s as qt, h as Qn, i as at, b as Jn } from "./raw-temporal-value-DH-feMc2.js";
12
+ import { a as er } from "./metric-comparison-ZmurmEIs.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 bs(e) {
18
+ function ks(e) {
19
19
  return J(e) || !!e && typeof e == "object" && e.type === "duration";
20
20
  }
21
- const jt = [
21
+ const Zt = [
22
22
  "day",
23
23
  "hour",
24
24
  "minute",
25
25
  "second",
26
26
  "millisecond"
27
- ], Ae = {
27
+ ], Ue = {
28
28
  day: 864e5,
29
29
  hour: 36e5,
30
30
  minute: 6e4,
31
31
  second: 1e3,
32
32
  millisecond: 1
33
- }, Gn = {
33
+ }, tr = {
34
34
  day: "d",
35
35
  hour: "hr",
36
36
  minute: "min",
37
37
  second: "s",
38
38
  millisecond: "ms"
39
- }, Qn = {
39
+ }, nr = {
40
40
  day: ["day", "days"],
41
41
  hour: ["hour", "hours"],
42
42
  minute: ["minute", "minutes"],
43
43
  second: ["second", "seconds"],
44
44
  millisecond: ["millisecond", "milliseconds"]
45
45
  };
46
- function Jn(e) {
46
+ function rr(e) {
47
47
  return e === "day" || e === "hour" || e === "minute" || e === "second" || e === "millisecond";
48
48
  }
49
- function Ht(e, t) {
50
- return Jn(e) ? e : t;
49
+ function Xt(e, t) {
50
+ return rr(e) ? e : t;
51
51
  }
52
- function rt(e, t) {
53
- return jt.indexOf(Ht(e, t));
52
+ function it(e, t) {
53
+ return Zt.indexOf(Xt(e, t));
54
54
  }
55
- function er(e, t) {
56
- const n = rt(e, "day"), r = rt(t, "second"), a = Math.min(n, r), i = Math.max(n, r);
57
- return jt.slice(a, i + 1);
55
+ function ar(e, t) {
56
+ const n = it(e, "day"), r = it(t, "second"), a = Math.min(n, r), i = Math.max(n, r);
57
+ return Zt.slice(a, i + 1);
58
58
  }
59
- function tr(e, t) {
60
- return e * Ae[Ht(t, "second")];
59
+ function ir(e, t) {
60
+ return e * Ue[Xt(t, "second")];
61
61
  }
62
- function nr(e, t) {
63
- const n = er(t.largestUnit, t.smallestUnit), r = n[n.length - 1], a = Ae[r];
62
+ function or(e, t) {
63
+ const n = ar(t.largestUnit, t.smallestUnit), r = n[n.length - 1], a = Ue[r];
64
64
  let i = Math.round(e / a) * a;
65
65
  return n.map((o) => {
66
- const s = Ae[o], c = Math.floor(i / s);
66
+ const s = Ue[o], c = Math.floor(i / s);
67
67
  return i -= c * s, { unit: o, value: c };
68
68
  });
69
69
  }
70
- function rr(e, t) {
70
+ function sr(e, t) {
71
71
  const n = e.filter((i) => i.value !== 0), r = n.length > 0 ? n : [e[e.length - 1]], a = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : r.length;
72
- return r.slice(0, a).map((i) => `${i.value}${Gn[i.unit]}`).join(" ");
72
+ return r.slice(0, a).map((i) => `${i.value}${tr[i.unit]}`).join(" ");
73
73
  }
74
- function ar(e, t) {
74
+ function cr(e, t) {
75
75
  const n = e.filter((i) => i.value !== 0), r = n.length > 0 ? n : [e[e.length - 1]], a = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : r.length;
76
76
  return r.slice(0, a).map((i) => {
77
- const [o, s] = Qn[i.unit];
77
+ const [o, s] = nr[i.unit];
78
78
  return `${i.value} ${i.value === 1 ? o : s}`;
79
79
  }).join(" ");
80
80
  }
81
- function ir(e) {
81
+ function ur(e) {
82
82
  const t = e.some(
83
83
  (c) => c.unit === "day" && c.value !== 0
84
84
  ), n = e.some((c) => c.unit === "millisecond"), r = e.findIndex((c) => c.value !== 0), a = Math.max(0, e.length - 2), i = t ? 0 : r === -1 ? a : Math.min(r, a), o = r === -1 ? e.slice(a) : e.slice(i);
@@ -87,21 +87,21 @@ function ir(e) {
87
87
  const s = o.map((c, u) => c.unit === "millisecond" ? String(c.value).padStart(3, "0") : u === 0 ? String(c.value) : String(c.value).padStart(2, "0")).join(":");
88
88
  return n ? s.replace(/:(\d{3})$/, ".$1") : s;
89
89
  }
90
- function or(e, t, n) {
90
+ 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 qt(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;
98
98
  if (!Number.isFinite(n))
99
99
  return "";
100
- const r = t.inputUnit || "second", a = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", i = n < 0, o = Math.abs(tr(n, r)), s = nr(o, t), c = a === "digital" ? ir(s) : a === "long" ? ar(s, t.maxUnits) : rr(s, t.maxUnits);
101
- return or(c, i, t);
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
+ return lr(c, i, t);
102
102
  }
103
- function Zt(e, t) {
104
- return qt(
103
+ function Bt(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 Zt(e, t) {
115
115
  }
116
116
  );
117
117
  }
118
- let at;
119
- function it(e, t) {
118
+ let ot;
119
+ function st(e, t) {
120
120
  const n = e.format;
121
121
  return n(t);
122
122
  }
123
- function sr(e, t) {
124
- if (at ?? (at = it(
123
+ function mr(e, t) {
124
+ if (ot ?? (ot = st(
125
125
  new Intl.NumberFormat("en-US", { useGrouping: !1, maximumFractionDigits: 6 }),
126
126
  "9007199254740993.000009"
127
- ) === "9007199254740993.000009"), !at)
127
+ ) === "9007199254740993.000009"), !ot)
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 it(t, e);
132
+ return st(t, e);
133
133
  }
134
134
  function ee(e) {
135
135
  return typeof e == "number" ? e < 0 : e.value.startsWith("-");
@@ -137,50 +137,50 @@ function ee(e) {
137
137
  function V(e) {
138
138
  return typeof e == "number" ? Math.abs(e) : ee(e) ? { ...e, value: e.value.slice(1) } : e;
139
139
  }
140
- function cr(e) {
140
+ function fr(e) {
141
141
  return typeof e == "number" ? e === 0 : /^-?0*(\.0*)?$/.test(e.value);
142
142
  }
143
143
  function Kt(e, t) {
144
144
  return typeof e == "number" ? e * t : {
145
145
  kind: "exact_number",
146
146
  type: "decimal",
147
- value: Wt(e.value, t)
147
+ value: Ht(e.value, t)
148
148
  };
149
149
  }
150
150
  function ge(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: Wt(e.value, `1e-${t}`)
154
+ value: Ht(e.value, `1e-${t}`)
155
155
  };
156
156
  }
157
- function U(e, t) {
158
- return typeof e == "number" ? t.format(e) : sr(e.value, t);
157
+ function A(e, t) {
158
+ return typeof e == "number" ? t.format(e) : mr(e.value, t);
159
159
  }
160
- function ot(e) {
160
+ function ct(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 st(e, t) {
166
- const n = V(e), r = (a) => typeof n == "number" ? n >= a : Pn(n.value, String(a)) >= 0;
167
- return r(1e12) ? { power: 12, suffix: "T" } : r(1e9) ? { power: 9, suffix: "B" } : ot(t) && r(1e7) ? { power: 7, suffix: "Cr" } : r(1e6) ? { power: 6, suffix: "M" } : ot(t) && r(1e5) ? { power: 5, suffix: "L" } : r(1e3) ? { power: 3, suffix: "K" } : { power: 0, suffix: "" };
165
+ function ut(e, t) {
166
+ const n = V(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" } : ct(t) && r(1e7) ? { power: 7, suffix: "Cr" } : r(1e6) ? { power: 6, suffix: "M" } : ct(t) && r(1e5) ? { power: 5, suffix: "L" } : r(1e3) ? { power: 3, suffix: "K" } : { power: 0, suffix: "" };
168
168
  }
169
- function Re(e, t) {
169
+ function Le(e, t) {
170
170
  try {
171
171
  const n = W(t);
172
- return st(e, n);
172
+ return ut(e, n);
173
173
  } catch {
174
- return st(e, "en-US");
174
+ return ut(e, "en-US");
175
175
  }
176
176
  }
177
- const Vt = 500, re = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map();
177
+ const Gt = 500, re = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map();
178
178
  function _(e, t = {}) {
179
179
  const n = `${e}|${JSON.stringify(t)}`;
180
180
  let r = re.get(n);
181
- return r || (r = new Intl.NumberFormat(e, t), re.size >= Vt && re.clear(), re.set(n, r)), r;
181
+ return r || (r = new Intl.NumberFormat(e, t), re.size >= Gt && re.clear(), re.set(n, r)), r;
182
182
  }
183
- function ur(e) {
183
+ function dr(e) {
184
184
  let t = ae.get(e);
185
185
  if (t === void 0) {
186
186
  try {
@@ -188,29 +188,29 @@ function ur(e) {
188
188
  } catch {
189
189
  t = !1;
190
190
  }
191
- ae.size >= Vt && ae.clear(), ae.set(e, t);
191
+ ae.size >= Gt && ae.clear(), ae.set(e, t);
192
192
  }
193
193
  return t;
194
194
  }
195
195
  function W(e) {
196
- return e && ur(e) ? e : "en-US";
196
+ return e && dr(e) ? e : "en-US";
197
197
  }
198
- function qe(e, t) {
198
+ function Ze(e, t) {
199
199
  if (e == null || Number.isNaN(e))
200
200
  return "";
201
201
  const n = W(t == null ? void 0 : t.locale);
202
202
  let r = e;
203
203
  if (t != null && t.multiplyBy && (r = Kt(r, t.multiplyBy)), t != null && t.useSuffix) {
204
- const { power: i, suffix: o } = Re(r, n);
204
+ const { power: i, suffix: o } = Le(r, n);
205
205
  r = ge(r, i);
206
- const s = U(r, _(n, {
206
+ const s = A(r, _(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 = U(r, _(n, {
213
+ const a = A(r, _(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 qe(e, t) {
221
221
  }
222
222
  return `${(t == null ? void 0 : t.prefix) ?? ""}${a}${(t == null ? void 0 : t.suffix) ?? ""}`;
223
223
  }
224
- function Bt(e, t) {
224
+ function Qt(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 ? V(e) : e;
228
228
  try {
229
229
  if (t != null && t.useSuffix) {
230
- const { power: c, suffix: u } = Re(o, n), l = ge(o, c), m = `${U(l, _(n, {
230
+ const { power: c, suffix: u } = Le(o, n), l = ge(o, c), m = `${A(l, _(n, {
231
231
  style: "currency",
232
232
  currency: r,
233
233
  minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
@@ -236,7 +236,7 @@ function Bt(e, t) {
236
236
  }))}${u}`;
237
237
  return i ? `(${m})` : m;
238
238
  }
239
- const s = U(o, _(n, {
239
+ const s = A(o, _(n, {
240
240
  style: "currency",
241
241
  currency: r,
242
242
  minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
@@ -245,7 +245,7 @@ function Bt(e, t) {
245
245
  }));
246
246
  return i ? `(${s})` : s;
247
247
  } catch {
248
- const s = V(e), c = t != null && t.useSuffix ? Re(s, n) : { power: 0, suffix: "" }, u = qe(
248
+ const s = V(e), c = t != null && t.useSuffix ? Le(s, n) : { power: 0, suffix: "" }, u = Ze(
249
249
  ge(s, c.power),
250
250
  {
251
251
  locale: n,
@@ -257,40 +257,40 @@ function Bt(e, t) {
257
257
  return a ? t != null && t.negativeInParentheses ? `(${l})` : `-${l}` : l;
258
258
  }
259
259
  }
260
- function Xt(e, t) {
260
+ function Jt(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" ? ge(e, 2) : e;
264
- return U(a, _(n, {
264
+ return A(a, _(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 Gt(e, t) {
271
+ function en(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 U(e, _(n, {
275
+ return A(e, _(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
279
279
  }));
280
280
  }
281
- function lr(e, t) {
282
- const n = t ?? "auto", r = n === "never" ? V(e) : e, a = !ee(r) && (n === "always" || n === "exceptZero" && !cr(r));
281
+ function hr(e, t) {
282
+ const n = t ?? "auto", r = n === "never" ? V(e) : e, a = !ee(r) && (n === "always" || n === "exceptZero" && !fr(r));
283
283
  return { value: r, plus: a };
284
284
  }
285
- function vs(e) {
285
+ function _s(e) {
286
286
  if (!e || !("signDisplay" in e)) return e;
287
287
  const { signDisplay: t, ...n } = e;
288
288
  return n;
289
289
  }
290
- function Ze(e, t) {
290
+ function Xe(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 = lr(n, t.signDisplay), a = r.value, i = r.plus ? "+" : "", o = t.negativeStyle === "parentheses" && ee(a), s = o ? V(a) : a, c = {
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 ? V(a) : a, c = {
294
294
  style: t.type === "number" ? "decimal" : t.type,
295
295
  locale: t.locale,
296
296
  currency: t.currency,
@@ -303,29 +303,29 @@ function Ze(e, t) {
303
303
  let u;
304
304
  switch (t.type) {
305
305
  case "currency":
306
- u = Bt(s, c);
306
+ u = Qt(s, c);
307
307
  break;
308
308
  case "percent":
309
- u = Xt(s, c);
309
+ u = Jt(s, c);
310
310
  break;
311
311
  case "scientific":
312
- u = Gt(s, c);
312
+ u = en(s, c);
313
313
  break;
314
314
  default:
315
- u = qe(s, c);
315
+ u = Ze(s, c);
316
316
  break;
317
317
  }
318
318
  const l = `${t.prefix ?? ""}${i}${u}${t.suffix ?? ""}`;
319
319
  return o ? `(${l})` : l;
320
320
  }
321
- function Ss(e, t) {
322
- return t.type === "duration" ? e == null ? "" : Zt(e, t) : Ze(e, t);
321
+ function Ns(e, t) {
322
+ return t.type === "duration" ? e == null ? "" : Bt(e, t) : Xe(e, t);
323
323
  }
324
- function mr(e, t, n = "en-US") {
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 Zt(e, {
328
+ return Bt(e, {
329
329
  ...t.duration,
330
330
  prefix: t.prefix,
331
331
  suffix: t.suffix,
@@ -335,7 +335,7 @@ function mr(e, t, n = "en-US") {
335
335
  return i === "currency" && _(r, {
336
336
  style: "currency",
337
337
  currency: (t == null ? void 0 : t.currency) || "USD"
338
- }), Ze(e, {
338
+ }), Xe(e, {
339
339
  type: i,
340
340
  locale: r,
341
341
  currency: i === "currency" ? (t == null ? void 0 : t.currency) || "USD" : void 0,
@@ -350,7 +350,7 @@ function mr(e, t, n = "en-US") {
350
350
  suffix: t == null ? void 0 : t.suffix
351
351
  });
352
352
  }
353
- function Ms(e, t, n) {
353
+ function $s(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,49 +365,49 @@ function Ms(e, t, n) {
365
365
  };
366
366
  switch (t) {
367
367
  case "currency":
368
- return Bt(e, r);
368
+ return Qt(e, r);
369
369
  case "percent":
370
- return Xt(e, r);
370
+ return Jt(e, r);
371
371
  case "scientific":
372
- return Gt(e, r);
372
+ return en(e, r);
373
373
  default:
374
- return qe(e, r);
374
+ return Ze(e, r);
375
375
  }
376
376
  }
377
- function p(e) {
377
+ function w(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
381
  function N(e, t) {
382
382
  return e instanceof Date ? new e.constructor(t) : new Date(t);
383
383
  }
384
- const Qt = 6048e5, fr = 864e5, Jt = 6e4, en = 36e5, ks = 525600, ie = 43200, ct = 1440;
385
- let dr = {};
384
+ const tn = 6048e5, yr = 864e5, nn = 6e4, rn = 36e5, Es = 525600, ie = 43200, lt = 1440;
385
+ let wr = {};
386
386
  function j() {
387
- return dr;
387
+ return wr;
388
388
  }
389
389
  function B(e, t) {
390
390
  var s, c, u, l;
391
- const n = j(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = p(e), i = a.getDay(), o = (i < r ? 7 : 0) + i - r;
391
+ const n = j(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = w(e), i = a.getDay(), o = (i < r ? 7 : 0) + i - r;
392
392
  return a.setDate(a.getDate() - o), a.setHours(0, 0, 0, 0), a;
393
393
  }
394
394
  function ye(e) {
395
395
  return B(e, { weekStartsOn: 1 });
396
396
  }
397
- function tn(e) {
398
- const t = p(e), n = t.getFullYear(), r = N(e, 0);
397
+ function an(e) {
398
+ const t = w(e), n = t.getFullYear(), r = N(e, 0);
399
399
  r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
400
400
  const a = ye(r), i = N(e, 0);
401
401
  i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
402
402
  const o = ye(i);
403
403
  return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >= o.getTime() ? n : n - 1;
404
404
  }
405
- function ut(e) {
406
- const t = p(e);
405
+ function mt(e) {
406
+ const t = w(e);
407
407
  return t.setHours(0, 0, 0, 0), t;
408
408
  }
409
- function pe(e) {
410
- const t = p(e), n = new Date(
409
+ function we(e) {
410
+ const t = w(e), n = new Date(
411
411
  Date.UTC(
412
412
  t.getFullYear(),
413
413
  t.getMonth(),
@@ -420,58 +420,58 @@ function pe(e) {
420
420
  );
421
421
  return n.setUTCFullYear(t.getFullYear()), +e - +n;
422
422
  }
423
- function hr(e, t) {
424
- const n = ut(e), r = ut(t), a = +n - pe(n), i = +r - pe(r);
425
- return Math.round((a - i) / fr);
423
+ function pr(e, t) {
424
+ const n = mt(e), r = mt(t), a = +n - we(n), i = +r - we(r);
425
+ return Math.round((a - i) / yr);
426
426
  }
427
- function gr(e) {
428
- const t = tn(e), n = N(e, 0);
427
+ function Tr(e) {
428
+ const t = an(e), n = N(e, 0);
429
429
  return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), ye(n);
430
430
  }
431
431
  function ue(e, t) {
432
- const n = p(e), r = p(t), a = n.getTime() - r.getTime();
432
+ const n = w(e), r = w(t), a = n.getTime() - r.getTime();
433
433
  return a < 0 ? -1 : a > 0 ? 1 : a;
434
434
  }
435
- function yr(e) {
435
+ function xr(e) {
436
436
  return N(e, Date.now());
437
437
  }
438
- function pr(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 wr(e) {
442
- if (!pr(e) && typeof e != "number")
441
+ function br(e) {
442
+ if (!Dr(e) && typeof e != "number")
443
443
  return !1;
444
- const t = p(e);
444
+ const t = w(e);
445
445
  return !isNaN(Number(t));
446
446
  }
447
- function Tr(e, t) {
448
- const n = p(e), r = p(t), a = n.getFullYear() - r.getFullYear(), i = n.getMonth() - r.getMonth();
447
+ function vr(e, t) {
448
+ const n = w(e), r = w(t), a = n.getFullYear() - r.getFullYear(), i = n.getMonth() - r.getMonth();
449
449
  return a * 12 + i;
450
450
  }
451
- function Dr(e) {
451
+ function Sr(e) {
452
452
  return (t) => {
453
453
  const r = (e ? Math[e] : Math.trunc)(t);
454
454
  return r === 0 ? 0 : r;
455
455
  };
456
456
  }
457
- function xr(e, t) {
458
- return +p(e) - +p(t);
457
+ function Mr(e, t) {
458
+ return +w(e) - +w(t);
459
459
  }
460
- function br(e) {
461
- const t = p(e);
460
+ function kr(e) {
461
+ const t = w(e);
462
462
  return t.setHours(23, 59, 59, 999), t;
463
463
  }
464
- function vr(e) {
465
- const t = p(e), n = t.getMonth();
464
+ function _r(e) {
465
+ const t = w(e), n = t.getMonth();
466
466
  return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
467
467
  }
468
- function Sr(e) {
469
- const t = p(e);
470
- return +br(t) == +vr(t);
468
+ function Nr(e) {
469
+ const t = w(e);
470
+ return +kr(t) == +_r(t);
471
471
  }
472
- function Mr(e, t) {
473
- const n = p(e), r = p(t), a = ue(n, r), i = Math.abs(
474
- Tr(n, r)
472
+ function $r(e, t) {
473
+ const n = w(e), r = w(t), a = ue(n, r), i = Math.abs(
474
+ vr(n, r)
475
475
  );
476
476
  let o;
477
477
  if (i < 1)
@@ -479,19 +479,19 @@ function Mr(e, t) {
479
479
  else {
480
480
  n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a * i);
481
481
  let s = ue(n, r) === -a;
482
- Sr(p(e)) && i === 1 && ue(e, r) === 1 && (s = !1), o = a * (i - Number(s));
482
+ Nr(w(e)) && i === 1 && ue(e, r) === 1 && (s = !1), o = a * (i - Number(s));
483
483
  }
484
484
  return o === 0 ? 0 : o;
485
485
  }
486
- function kr(e, t, n) {
487
- const r = xr(e, t) / 1e3;
488
- return Dr(n == null ? void 0 : n.roundingMethod)(r);
486
+ function Er(e, t, n) {
487
+ const r = Mr(e, t) / 1e3;
488
+ return Sr(n == null ? void 0 : n.roundingMethod)(r);
489
489
  }
490
- function _r(e) {
491
- const t = p(e), n = N(e, 0);
490
+ function Ir(e) {
491
+ const t = w(e), n = N(e, 0);
492
492
  return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
493
493
  }
494
- const Nr = {
494
+ const Or = {
495
495
  lessThanXSeconds: {
496
496
  one: "less than a second",
497
497
  other: "less than {{count}} seconds"
@@ -553,53 +553,53 @@ const Nr = {
553
553
  one: "almost 1 year",
554
554
  other: "almost {{count}} years"
555
555
  }
556
- }, $r = (e, t, n) => {
556
+ }, Fr = (e, t, n) => {
557
557
  let r;
558
- const a = Nr[e];
558
+ const a = Or[e];
559
559
  return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
560
560
  };
561
- function ke(e) {
561
+ function _e(e) {
562
562
  return (t = {}) => {
563
563
  const n = t.width ? String(t.width) : e.defaultWidth;
564
564
  return e.formats[n] || e.formats[e.defaultWidth];
565
565
  };
566
566
  }
567
- const Fr = {
567
+ const Cr = {
568
568
  full: "EEEE, MMMM do, y",
569
569
  long: "MMMM do, y",
570
570
  medium: "MMM d, y",
571
571
  short: "MM/dd/yyyy"
572
- }, Or = {
572
+ }, Pr = {
573
573
  full: "h:mm:ss a zzzz",
574
574
  long: "h:mm:ss a z",
575
575
  medium: "h:mm:ss a",
576
576
  short: "h:mm a"
577
- }, Ir = {
577
+ }, Yr = {
578
578
  full: "{{date}} 'at' {{time}}",
579
579
  long: "{{date}} 'at' {{time}}",
580
580
  medium: "{{date}}, {{time}}",
581
581
  short: "{{date}}, {{time}}"
582
- }, Er = {
583
- date: ke({
584
- formats: Fr,
582
+ }, zr = {
583
+ date: _e({
584
+ formats: Cr,
585
585
  defaultWidth: "full"
586
586
  }),
587
- time: ke({
588
- formats: Or,
587
+ time: _e({
588
+ formats: Pr,
589
589
  defaultWidth: "full"
590
590
  }),
591
- dateTime: ke({
592
- formats: Ir,
591
+ dateTime: _e({
592
+ formats: Yr,
593
593
  defaultWidth: "full"
594
594
  })
595
- }, Cr = {
595
+ }, Ar = {
596
596
  lastWeek: "'last' eeee 'at' p",
597
597
  yesterday: "'yesterday at' p",
598
598
  today: "'today at' p",
599
599
  tomorrow: "'tomorrow at' p",
600
600
  nextWeek: "eeee 'at' p",
601
601
  other: "P"
602
- }, Pr = (e, t, n, r) => Cr[e];
602
+ }, Rr = (e, t, n, r) => Ar[e];
603
603
  function H(e) {
604
604
  return (t, n) => {
605
605
  const r = n != null && n.context ? String(n.context) : "standalone";
@@ -615,15 +615,15 @@ function H(e) {
615
615
  return a[i];
616
616
  };
617
617
  }
618
- const Yr = {
618
+ const Ur = {
619
619
  narrow: ["B", "A"],
620
620
  abbreviated: ["BC", "AD"],
621
621
  wide: ["Before Christ", "Anno Domini"]
622
- }, zr = {
622
+ }, Lr = {
623
623
  narrow: ["1", "2", "3", "4"],
624
624
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
625
625
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
626
- }, Ur = {
626
+ }, Wr = {
627
627
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
628
628
  abbreviated: [
629
629
  "Jan",
@@ -653,7 +653,7 @@ const Yr = {
653
653
  "November",
654
654
  "December"
655
655
  ]
656
- }, Ar = {
656
+ }, jr = {
657
657
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
658
658
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
659
659
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -666,7 +666,7 @@ const Yr = {
666
666
  "Friday",
667
667
  "Saturday"
668
668
  ]
669
- }, Rr = {
669
+ }, Hr = {
670
670
  narrow: {
671
671
  am: "a",
672
672
  pm: "p",
@@ -697,7 +697,7 @@ const Yr = {
697
697
  evening: "evening",
698
698
  night: "night"
699
699
  }
700
- }, Lr = {
700
+ }, qr = {
701
701
  narrow: {
702
702
  am: "a",
703
703
  pm: "p",
@@ -728,7 +728,7 @@ const Yr = {
728
728
  evening: "in the evening",
729
729
  night: "at night"
730
730
  }
731
- }, Wr = (e, t) => {
731
+ }, Zr = (e, t) => {
732
732
  const n = Number(e), r = n % 100;
733
733
  if (r > 20 || r < 10)
734
734
  switch (r % 10) {
@@ -740,29 +740,29 @@ const Yr = {
740
740
  return n + "rd";
741
741
  }
742
742
  return n + "th";
743
- }, jr = {
744
- ordinalNumber: Wr,
743
+ }, Xr = {
744
+ ordinalNumber: Zr,
745
745
  era: H({
746
- values: Yr,
746
+ values: Ur,
747
747
  defaultWidth: "wide"
748
748
  }),
749
749
  quarter: H({
750
- values: zr,
750
+ values: Lr,
751
751
  defaultWidth: "wide",
752
752
  argumentCallback: (e) => e - 1
753
753
  }),
754
754
  month: H({
755
- values: Ur,
755
+ values: Wr,
756
756
  defaultWidth: "wide"
757
757
  }),
758
758
  day: H({
759
- values: Ar,
759
+ values: jr,
760
760
  defaultWidth: "wide"
761
761
  }),
762
762
  dayPeriod: H({
763
- values: Rr,
763
+ values: Hr,
764
764
  defaultWidth: "wide",
765
- formattingValues: Lr,
765
+ formattingValues: qr,
766
766
  defaultFormattingWidth: "wide"
767
767
  })
768
768
  };
@@ -771,9 +771,9 @@ function q(e) {
771
771
  const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], i = t.match(a);
772
772
  if (!i)
773
773
  return null;
774
- const o = i[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? qr(s, (f) => f.test(o)) : (
774
+ const o = i[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? Br(s, (f) => f.test(o)) : (
775
775
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
776
- Hr(s, (f) => f.test(o))
776
+ Vr(s, (f) => f.test(o))
777
777
  );
778
778
  let u;
779
779
  u = e.valueCallback ? e.valueCallback(c) : c, u = n.valueCallback ? (
@@ -784,17 +784,17 @@ function q(e) {
784
784
  return { value: u, rest: l };
785
785
  };
786
786
  }
787
- function Hr(e, t) {
787
+ function Vr(e, t) {
788
788
  for (const n in e)
789
789
  if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
790
790
  return n;
791
791
  }
792
- function qr(e, t) {
792
+ function Br(e, t) {
793
793
  for (let n = 0; n < e.length; n++)
794
794
  if (t(e[n]))
795
795
  return n;
796
796
  }
797
- function Zr(e) {
797
+ function Kr(e) {
798
798
  return (t, n = {}) => {
799
799
  const r = t.match(e.matchPattern);
800
800
  if (!r) return null;
@@ -806,23 +806,23 @@ function Zr(e) {
806
806
  return { value: o, rest: s };
807
807
  };
808
808
  }
809
- const Kr = /^(\d+)(th|st|nd|rd)?/i, Vr = /\d+/i, Br = {
809
+ const Gr = /^(\d+)(th|st|nd|rd)?/i, Qr = /\d+/i, Jr = {
810
810
  narrow: /^(b|a)/i,
811
811
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
812
812
  wide: /^(before christ|before common era|anno domini|common era)/i
813
- }, Xr = {
813
+ }, ea = {
814
814
  any: [/^b/i, /^(a|c)/i]
815
- }, Gr = {
815
+ }, ta = {
816
816
  narrow: /^[1234]/i,
817
817
  abbreviated: /^q[1234]/i,
818
818
  wide: /^[1234](th|st|nd|rd)? quarter/i
819
- }, Qr = {
819
+ }, na = {
820
820
  any: [/1/i, /2/i, /3/i, /4/i]
821
- }, Jr = {
821
+ }, ra = {
822
822
  narrow: /^[jfmasond]/i,
823
823
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
824
824
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
825
- }, ea = {
825
+ }, aa = {
826
826
  narrow: [
827
827
  /^j/i,
828
828
  /^f/i,
@@ -851,18 +851,18 @@ const Kr = /^(\d+)(th|st|nd|rd)?/i, Vr = /\d+/i, Br = {
851
851
  /^n/i,
852
852
  /^d/i
853
853
  ]
854
- }, ta = {
854
+ }, ia = {
855
855
  narrow: /^[smtwf]/i,
856
856
  short: /^(su|mo|tu|we|th|fr|sa)/i,
857
857
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
858
858
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
859
- }, na = {
859
+ }, oa = {
860
860
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
861
861
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
862
- }, ra = {
862
+ }, sa = {
863
863
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
864
864
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
865
- }, aa = {
865
+ }, ca = {
866
866
  any: {
867
867
  am: /^a/i,
868
868
  pm: /^p/i,
@@ -873,80 +873,80 @@ const Kr = /^(\d+)(th|st|nd|rd)?/i, Vr = /\d+/i, Br = {
873
873
  evening: /evening/i,
874
874
  night: /night/i
875
875
  }
876
- }, ia = {
877
- ordinalNumber: Zr({
878
- matchPattern: Kr,
879
- parsePattern: Vr,
876
+ }, ua = {
877
+ ordinalNumber: Kr({
878
+ matchPattern: Gr,
879
+ parsePattern: Qr,
880
880
  valueCallback: (e) => parseInt(e, 10)
881
881
  }),
882
882
  era: q({
883
- matchPatterns: Br,
883
+ matchPatterns: Jr,
884
884
  defaultMatchWidth: "wide",
885
- parsePatterns: Xr,
885
+ parsePatterns: ea,
886
886
  defaultParseWidth: "any"
887
887
  }),
888
888
  quarter: q({
889
- matchPatterns: Gr,
889
+ matchPatterns: ta,
890
890
  defaultMatchWidth: "wide",
891
- parsePatterns: Qr,
891
+ parsePatterns: na,
892
892
  defaultParseWidth: "any",
893
893
  valueCallback: (e) => e + 1
894
894
  }),
895
895
  month: q({
896
- matchPatterns: Jr,
896
+ matchPatterns: ra,
897
897
  defaultMatchWidth: "wide",
898
- parsePatterns: ea,
898
+ parsePatterns: aa,
899
899
  defaultParseWidth: "any"
900
900
  }),
901
901
  day: q({
902
- matchPatterns: ta,
902
+ matchPatterns: ia,
903
903
  defaultMatchWidth: "wide",
904
- parsePatterns: na,
904
+ parsePatterns: oa,
905
905
  defaultParseWidth: "any"
906
906
  }),
907
907
  dayPeriod: q({
908
- matchPatterns: ra,
908
+ matchPatterns: sa,
909
909
  defaultMatchWidth: "any",
910
- parsePatterns: aa,
910
+ parsePatterns: ca,
911
911
  defaultParseWidth: "any"
912
912
  })
913
- }, nn = {
913
+ }, on = {
914
914
  code: "en-US",
915
- formatDistance: $r,
916
- formatLong: Er,
917
- formatRelative: Pr,
918
- localize: jr,
919
- match: ia,
915
+ formatDistance: Fr,
916
+ formatLong: zr,
917
+ formatRelative: Rr,
918
+ localize: Xr,
919
+ match: ua,
920
920
  options: {
921
921
  weekStartsOn: 0,
922
922
  firstWeekContainsDate: 1
923
923
  }
924
924
  };
925
- function oa(e) {
926
- const t = p(e);
927
- return hr(t, _r(t)) + 1;
925
+ function la(e) {
926
+ const t = w(e);
927
+ return pr(t, Ir(t)) + 1;
928
928
  }
929
- function sa(e) {
930
- const t = p(e), n = +ye(t) - +gr(t);
931
- return Math.round(n / Qt) + 1;
929
+ function ma(e) {
930
+ const t = w(e), n = +ye(t) - +Tr(t);
931
+ return Math.round(n / tn) + 1;
932
932
  }
933
- function rn(e, t) {
933
+ function sn(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 = w(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);
936
936
  o.setFullYear(r + 1, 0, i), o.setHours(0, 0, 0, 0);
937
937
  const s = B(o, t), c = N(e, 0);
938
938
  c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
939
939
  const u = B(c, t);
940
940
  return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= u.getTime() ? r : r - 1;
941
941
  }
942
- function ca(e, t) {
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 = rn(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 = sn(e, t), i = N(e, 0);
945
945
  return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), B(i, t);
946
946
  }
947
- function ua(e, t) {
948
- const n = p(e), r = +B(n, t) - +ca(n, t);
949
- return Math.round(r / Qt) + 1;
947
+ function da(e, t) {
948
+ const n = w(e), r = +B(n, t) - +fa(n, t);
949
+ return Math.round(r / tn) + 1;
950
950
  }
951
951
  function y(e, t) {
952
952
  const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
@@ -1006,14 +1006,14 @@ const k = {
1006
1006
  );
1007
1007
  return y(a, t.length);
1008
1008
  }
1009
- }, E = {
1009
+ }, F = {
1010
1010
  midnight: "midnight",
1011
1011
  noon: "noon",
1012
1012
  morning: "morning",
1013
1013
  afternoon: "afternoon",
1014
1014
  evening: "evening",
1015
1015
  night: "night"
1016
- }, lt = {
1016
+ }, ft = {
1017
1017
  // Era
1018
1018
  G: function(e, t, n) {
1019
1019
  const r = e.getFullYear() > 0 ? 1 : 0;
@@ -1039,7 +1039,7 @@ const k = {
1039
1039
  },
1040
1040
  // Local week-numbering year
1041
1041
  Y: function(e, t, n, r) {
1042
- const a = rn(e, r), i = a > 0 ? a : 1 - a;
1042
+ const a = sn(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 = tn(e);
1051
+ const n = an(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.
@@ -1171,12 +1171,12 @@ const k = {
1171
1171
  },
1172
1172
  // Local week of year
1173
1173
  w: function(e, t, n, r) {
1174
- const a = ua(e, r);
1174
+ const a = da(e, r);
1175
1175
  return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : y(a, t.length);
1176
1176
  },
1177
1177
  // ISO week of year
1178
1178
  I: function(e, t, n) {
1179
- const r = sa(e);
1179
+ const r = ma(e);
1180
1180
  return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : y(r, t.length);
1181
1181
  },
1182
1182
  // Day of the month
@@ -1185,7 +1185,7 @@ const k = {
1185
1185
  },
1186
1186
  // Day of year
1187
1187
  D: function(e, t, n) {
1188
- const r = oa(e);
1188
+ const r = la(e);
1189
1189
  return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : y(r, t.length);
1190
1190
  },
1191
1191
  // Day of week
@@ -1348,7 +1348,7 @@ const k = {
1348
1348
  b: function(e, t, n) {
1349
1349
  const r = e.getHours();
1350
1350
  let a;
1351
- switch (r === 12 ? a = E.noon : r === 0 ? a = E.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
1351
+ switch (r === 12 ? a = F.noon : r === 0 ? a = F.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
1352
1352
  case "b":
1353
1353
  case "bb":
1354
1354
  return n.dayPeriod(a, {
@@ -1377,7 +1377,7 @@ const k = {
1377
1377
  B: function(e, t, n) {
1378
1378
  const r = e.getHours();
1379
1379
  let a;
1380
- switch (r >= 17 ? a = E.evening : r >= 12 ? a = E.afternoon : r >= 4 ? a = E.morning : a = E.night, t) {
1380
+ switch (r >= 17 ? a = F.evening : r >= 12 ? a = F.afternoon : r >= 4 ? a = F.morning : a = F.night, t) {
1381
1381
  case "B":
1382
1382
  case "BB":
1383
1383
  case "BBB":
@@ -1439,14 +1439,14 @@ const k = {
1439
1439
  return "Z";
1440
1440
  switch (t) {
1441
1441
  case "X":
1442
- return ft(r);
1442
+ return ht(r);
1443
1443
  case "XXXX":
1444
1444
  case "XX":
1445
- return O(r);
1445
+ return I(r);
1446
1446
  case "XXXXX":
1447
1447
  case "XXX":
1448
1448
  default:
1449
- return O(r, ":");
1449
+ return I(r, ":");
1450
1450
  }
1451
1451
  },
1452
1452
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
@@ -1454,14 +1454,14 @@ const k = {
1454
1454
  const r = e.getTimezoneOffset();
1455
1455
  switch (t) {
1456
1456
  case "x":
1457
- return ft(r);
1457
+ return ht(r);
1458
1458
  case "xxxx":
1459
1459
  case "xx":
1460
- return O(r);
1460
+ return I(r);
1461
1461
  case "xxxxx":
1462
1462
  case "xxx":
1463
1463
  default:
1464
- return O(r, ":");
1464
+ return I(r, ":");
1465
1465
  }
1466
1466
  },
1467
1467
  // Timezone (GMT)
@@ -1471,10 +1471,10 @@ const k = {
1471
1471
  case "O":
1472
1472
  case "OO":
1473
1473
  case "OOO":
1474
- return "GMT" + mt(r, ":");
1474
+ return "GMT" + dt(r, ":");
1475
1475
  case "OOOO":
1476
1476
  default:
1477
- return "GMT" + O(r, ":");
1477
+ return "GMT" + I(r, ":");
1478
1478
  }
1479
1479
  },
1480
1480
  // Timezone (specific non-location)
@@ -1484,10 +1484,10 @@ const k = {
1484
1484
  case "z":
1485
1485
  case "zz":
1486
1486
  case "zzz":
1487
- return "GMT" + mt(r, ":");
1487
+ return "GMT" + dt(r, ":");
1488
1488
  case "zzzz":
1489
1489
  default:
1490
- return "GMT" + O(r, ":");
1490
+ return "GMT" + I(r, ":");
1491
1491
  }
1492
1492
  },
1493
1493
  // Seconds timestamp
@@ -1501,18 +1501,18 @@ const k = {
1501
1501
  return y(r, t.length);
1502
1502
  }
1503
1503
  };
1504
- function mt(e, t = "") {
1504
+ function dt(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 ft(e, t) {
1509
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + y(Math.abs(e) / 60, 2) : O(e, t);
1508
+ function ht(e, t) {
1509
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + y(Math.abs(e) / 60, 2) : I(e, t);
1510
1510
  }
1511
- function O(e, t = "") {
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 dt = (e, t) => {
1515
+ const gt = (e, t) => {
1516
1516
  switch (e) {
1517
1517
  case "P":
1518
1518
  return t.date({ width: "short" });
@@ -1524,7 +1524,7 @@ const dt = (e, t) => {
1524
1524
  default:
1525
1525
  return t.date({ width: "full" });
1526
1526
  }
1527
- }, an = (e, t) => {
1527
+ }, cn = (e, t) => {
1528
1528
  switch (e) {
1529
1529
  case "p":
1530
1530
  return t.time({ width: "short" });
@@ -1536,10 +1536,10 @@ const dt = (e, t) => {
1536
1536
  default:
1537
1537
  return t.time({ width: "full" });
1538
1538
  }
1539
- }, la = (e, t) => {
1539
+ }, ha = (e, t) => {
1540
1540
  const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1541
1541
  if (!a)
1542
- return dt(e, t);
1542
+ return gt(e, t);
1543
1543
  let i;
1544
1544
  switch (r) {
1545
1545
  case "P":
@@ -1556,47 +1556,47 @@ const dt = (e, t) => {
1556
1556
  i = t.dateTime({ width: "full" });
1557
1557
  break;
1558
1558
  }
1559
- return i.replace("{{date}}", dt(r, t)).replace("{{time}}", an(a, t));
1560
- }, ma = {
1561
- p: an,
1562
- P: la
1563
- }, fa = /^D+$/, da = /^Y+$/, ha = ["D", "DD", "YY", "YYYY"];
1564
- function ga(e) {
1565
- return fa.test(e);
1566
- }
1567
- function ya(e) {
1568
- return da.test(e);
1569
- }
1570
- function pa(e, t, n) {
1571
- const r = wa(e, t, n);
1572
- if (console.warn(r), ha.includes(e)) throw new RangeError(r);
1573
- }
1574
- function wa(e, t, n) {
1559
+ return i.replace("{{date}}", gt(r, t)).replace("{{time}}", cn(a, t));
1560
+ }, ga = {
1561
+ p: cn,
1562
+ P: ha
1563
+ }, ya = /^D+$/, wa = /^Y+$/, pa = ["D", "DD", "YY", "YYYY"];
1564
+ function Ta(e) {
1565
+ return ya.test(e);
1566
+ }
1567
+ function xa(e) {
1568
+ return wa.test(e);
1569
+ }
1570
+ function Da(e, t, n) {
1571
+ const r = ba(e, t, n);
1572
+ if (console.warn(r), pa.includes(e)) throw new RangeError(r);
1573
+ }
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 Ta = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Da = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, xa = /^'([^]*?)'?$/, ba = /''/g, va = /[a-zA-Z]/;
1579
- function Ke(e, t, n) {
1580
- var l, f, m, h, d, S, et, tt;
1581
- const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? nn, 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 ?? ((tt = (et = r.locale) == null ? void 0 : et.options) == null ? void 0 : tt.weekStartsOn) ?? 0, s = p(e);
1582
- if (!wr(s))
1578
+ const va = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Sa = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ma = /^'([^]*?)'?$/, ka = /''/g, _a = /[a-zA-Z]/;
1579
+ function Ve(e, t, n) {
1580
+ var l, f, m, h, d, S, tt, nt;
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 ?? ((nt = (tt = r.locale) == null ? void 0 : tt.options) == null ? void 0 : nt.weekStartsOn) ?? 0, s = w(e);
1582
+ if (!br(s))
1583
1583
  throw new RangeError("Invalid time value");
1584
- let c = t.match(Da).map((v) => {
1584
+ let c = t.match(Sa).map((v) => {
1585
1585
  const b = v[0];
1586
1586
  if (b === "p" || b === "P") {
1587
- const Me = ma[b];
1588
- return Me(v, a.formatLong);
1587
+ const ke = ga[b];
1588
+ return ke(v, a.formatLong);
1589
1589
  }
1590
1590
  return v;
1591
- }).join("").match(Ta).map((v) => {
1591
+ }).join("").match(va).map((v) => {
1592
1592
  if (v === "''")
1593
1593
  return { isToken: !1, value: "'" };
1594
1594
  const b = v[0];
1595
1595
  if (b === "'")
1596
- return { isToken: !1, value: Sa(v) };
1597
- if (lt[b])
1596
+ return { isToken: !1, value: Na(v) };
1597
+ if (ft[b])
1598
1598
  return { isToken: !0, value: v };
1599
- if (b.match(va))
1599
+ if (b.match(_a))
1600
1600
  throw new RangeError(
1601
1601
  "Format string contains an unescaped latin alphabet character `" + b + "`"
1602
1602
  );
@@ -1611,17 +1611,17 @@ function Ke(e, t, n) {
1611
1611
  return c.map((v) => {
1612
1612
  if (!v.isToken) return v.value;
1613
1613
  const b = v.value;
1614
- (!(n != null && n.useAdditionalWeekYearTokens) && ya(b) || !(n != null && n.useAdditionalDayOfYearTokens) && ga(b)) && pa(b, t, String(e));
1615
- const Me = lt[b[0]];
1616
- return Me(s, b, a.localize, u);
1614
+ (!(n != null && n.useAdditionalWeekYearTokens) && xa(b) || !(n != null && n.useAdditionalDayOfYearTokens) && Ta(b)) && Da(b, t, String(e));
1615
+ const ke = ft[b[0]];
1616
+ return ke(s, b, a.localize, u);
1617
1617
  }).join("");
1618
1618
  }
1619
- function Sa(e) {
1620
- const t = e.match(xa);
1621
- return t ? t[1].replace(ba, "'") : e;
1619
+ function Na(e) {
1620
+ const t = e.match(Ma);
1621
+ return t ? t[1].replace(ka, "'") : e;
1622
1622
  }
1623
- function Ma(e, t, n) {
1624
- const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? nn, i = 2520, o = ue(e, t);
1623
+ function $a(e, t, n) {
1624
+ const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? on, i = 2520, o = ue(e, t);
1625
1625
  if (isNaN(o))
1626
1626
  throw new RangeError("Invalid time value");
1627
1627
  const s = Object.assign({}, n, {
@@ -1629,8 +1629,8 @@ function Ma(e, t, n) {
1629
1629
  comparison: o
1630
1630
  });
1631
1631
  let c, u;
1632
- o > 0 ? (c = p(t), u = p(e)) : (c = p(e), u = p(t));
1633
- const l = kr(u, c), f = (pe(u) - pe(c)) / 1e3, m = Math.round((l - f) / 60);
1632
+ o > 0 ? (c = w(t), u = w(e)) : (c = w(e), u = w(t));
1633
+ const l = Er(u, c), f = (we(u) - we(c)) / 1e3, m = Math.round((l - f) / 60);
1634
1634
  let h;
1635
1635
  if (m < 2)
1636
1636
  return n != null && n.includeSeconds ? l < 5 ? a.formatDistance("lessThanXSeconds", 5, s) : l < 10 ? a.formatDistance("lessThanXSeconds", 10, s) : l < 20 ? a.formatDistance("lessThanXSeconds", 20, s) : l < 40 ? a.formatDistance("halfAMinute", 0, s) : l < 60 ? a.formatDistance("lessThanXMinutes", 1, s) : a.formatDistance("xMinutes", 1, s) : m === 0 ? a.formatDistance("lessThanXMinutes", 1, s) : a.formatDistance("xMinutes", m, s);
@@ -1638,19 +1638,19 @@ function Ma(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 < ct) {
1641
+ if (m < lt) {
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 < ie) {
1648
- const d = Math.round(m / ct);
1648
+ const d = Math.round(m / lt);
1649
1649
  return a.formatDistance("xDays", d, s);
1650
1650
  } else if (m < ie * 2)
1651
1651
  return h = Math.round(m / ie), a.formatDistance("aboutXMonths", h, s);
1652
1652
  }
1653
- if (h = Mr(u, c), h < 12) {
1653
+ if (h = $r(u, c), h < 12) {
1654
1654
  const d = Math.round(m / ie);
1655
1655
  return a.formatDistance("xMonths", d, s);
1656
1656
  } else {
@@ -1658,27 +1658,27 @@ function Ma(e, t, n) {
1658
1658
  return d < 3 ? a.formatDistance("aboutXYears", S, s) : d < 9 ? a.formatDistance("overXYears", S, s) : a.formatDistance("almostXYears", S + 1, s);
1659
1659
  }
1660
1660
  }
1661
- function ka(e, t) {
1662
- return Ma(e, yr(e), t);
1661
+ function Ea(e, t) {
1662
+ return $a(e, xr(e), t);
1663
1663
  }
1664
- function _a() {
1664
+ function Ia() {
1665
1665
  return Object.assign({}, j());
1666
1666
  }
1667
- function _s(e, t) {
1668
- const r = Oa(e);
1667
+ function Is(e, t) {
1668
+ const r = Pa(e);
1669
1669
  let a;
1670
1670
  if (r.date) {
1671
- const c = Ia(r.date, 2);
1672
- a = Ea(c.restDateString, c.year);
1671
+ const c = Ya(r.date, 2);
1672
+ a = za(c.restDateString, c.year);
1673
1673
  }
1674
1674
  if (!a || isNaN(a.getTime()))
1675
1675
  return /* @__PURE__ */ new Date(NaN);
1676
1676
  const i = a.getTime();
1677
1677
  let o = 0, s;
1678
- if (r.time && (o = Ca(r.time), isNaN(o)))
1678
+ if (r.time && (o = Aa(r.time), isNaN(o)))
1679
1679
  return /* @__PURE__ */ new Date(NaN);
1680
1680
  if (r.timezone) {
1681
- if (s = Pa(r.timezone), isNaN(s))
1681
+ if (s = Ra(r.timezone), isNaN(s))
1682
1682
  return /* @__PURE__ */ new Date(NaN);
1683
1683
  } else {
1684
1684
  const c = new Date(i + o), u = /* @__PURE__ */ new Date(0);
@@ -1699,8 +1699,8 @@ const oe = {
1699
1699
  dateTimeDelimiter: /[T ]/,
1700
1700
  timeZoneDelimiter: /[Z ]/i,
1701
1701
  timezone: /([Z+-].*)$/
1702
- }, Na = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, $a = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, Fa = /^([+-])(\d{2})(?::?(\d{2}))?$/;
1703
- function Oa(e) {
1702
+ }, Oa = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, Fa = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, Ca = /^([+-])(\d{2})(?::?(\d{2}))?$/;
1703
+ function Pa(e) {
1704
1704
  const t = {}, n = e.split(oe.dateTimeDelimiter);
1705
1705
  let r;
1706
1706
  if (n.length > 2)
@@ -1714,7 +1714,7 @@ function Oa(e) {
1714
1714
  }
1715
1715
  return t;
1716
1716
  }
1717
- function Ia(e, t) {
1717
+ function Ya(e, t) {
1718
1718
  const n = new RegExp(
1719
1719
  "^(?:(\\d{4}|[+-]\\d{" + (4 + t) + "})|(\\d{2}|[+-]\\d{" + (2 + t) + "})$)"
1720
1720
  ), r = e.match(n);
@@ -1725,87 +1725,87 @@ function Ia(e, t) {
1725
1725
  restDateString: e.slice((r[1] || r[2]).length)
1726
1726
  };
1727
1727
  }
1728
- function Ea(e, t) {
1728
+ function za(e, t) {
1729
1729
  if (t === null) return /* @__PURE__ */ new Date(NaN);
1730
- const n = e.match(Na);
1730
+ const n = e.match(Oa);
1731
1731
  if (!n) return /* @__PURE__ */ new Date(NaN);
1732
1732
  const r = !!n[4], a = Z(n[1]), i = Z(n[2]) - 1, o = Z(n[3]), s = Z(n[4]), c = Z(n[5]) - 1;
1733
1733
  if (r)
1734
- return Ra(t, s, c) ? Ya(t, s, c) : /* @__PURE__ */ new Date(NaN);
1734
+ return Ha(t, s, c) ? Ua(t, s, c) : /* @__PURE__ */ new Date(NaN);
1735
1735
  {
1736
1736
  const u = /* @__PURE__ */ new Date(0);
1737
- return !Ua(t, i, o) || !Aa(t, a) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(t, i, Math.max(a, o)), u);
1737
+ return !Wa(t, i, o) || !ja(t, a) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(t, i, Math.max(a, o)), u);
1738
1738
  }
1739
1739
  }
1740
1740
  function Z(e) {
1741
1741
  return e ? parseInt(e) : 1;
1742
1742
  }
1743
- function Ca(e) {
1744
- const t = e.match($a);
1743
+ function Aa(e) {
1744
+ const t = e.match(Fa);
1745
1745
  if (!t) return NaN;
1746
- const n = _e(t[1]), r = _e(t[2]), a = _e(t[3]);
1747
- return La(n, r, a) ? n * en + r * Jt + a * 1e3 : NaN;
1746
+ const n = Ne(t[1]), r = Ne(t[2]), a = Ne(t[3]);
1747
+ return qa(n, r, a) ? n * rn + r * nn + a * 1e3 : NaN;
1748
1748
  }
1749
- function _e(e) {
1749
+ function Ne(e) {
1750
1750
  return e && parseFloat(e.replace(",", ".")) || 0;
1751
1751
  }
1752
- function Pa(e) {
1752
+ function Ra(e) {
1753
1753
  if (e === "Z") return 0;
1754
- const t = e.match(Fa);
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 Wa(r, a) ? n * (r * en + a * Jt) : NaN;
1757
+ return Za(r, a) ? n * (r * rn + a * nn) : NaN;
1758
1758
  }
1759
- function Ya(e, t, n) {
1759
+ function Ua(e, t, n) {
1760
1760
  const r = /* @__PURE__ */ new Date(0);
1761
1761
  r.setUTCFullYear(e, 0, 4);
1762
1762
  const a = r.getUTCDay() || 7, i = (t - 1) * 7 + n + 1 - a;
1763
1763
  return r.setUTCDate(r.getUTCDate() + i), r;
1764
1764
  }
1765
- const za = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1766
- function on(e) {
1765
+ const La = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1766
+ function un(e) {
1767
1767
  return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
1768
1768
  }
1769
- function Ua(e, t, n) {
1770
- return t >= 0 && t <= 11 && n >= 1 && n <= (za[t] || (on(e) ? 29 : 28));
1769
+ function Wa(e, t, n) {
1770
+ return t >= 0 && t <= 11 && n >= 1 && n <= (La[t] || (un(e) ? 29 : 28));
1771
1771
  }
1772
- function Aa(e, t) {
1773
- return t >= 1 && t <= (on(e) ? 366 : 365);
1772
+ function ja(e, t) {
1773
+ return t >= 1 && t <= (un(e) ? 366 : 365);
1774
1774
  }
1775
- function Ra(e, t, n) {
1775
+ function Ha(e, t, n) {
1776
1776
  return t >= 1 && t <= 53 && n >= 0 && n <= 6;
1777
1777
  }
1778
- function La(e, t, n) {
1778
+ function qa(e, t, n) {
1779
1779
  return e === 24 ? t === 0 && n === 0 : n >= 0 && n < 60 && t >= 0 && t < 60 && e >= 0 && e < 25;
1780
1780
  }
1781
- function Wa(e, t) {
1781
+ function Za(e, t) {
1782
1782
  return t >= 0 && t <= 59;
1783
1783
  }
1784
- function ht(e, t, n) {
1785
- const r = _a(), a = qa(e, n.timeZone, n.locale ?? r.locale);
1786
- return "formatToParts" in a ? ja(a, t) : Ha(a, t);
1784
+ function yt(e, t, n) {
1785
+ const r = Ia(), a = Ba(e, n.timeZone, n.locale ?? r.locale);
1786
+ return "formatToParts" in a ? Xa(a, t) : Va(a, t);
1787
1787
  }
1788
- function ja(e, t) {
1788
+ function Xa(e, t) {
1789
1789
  const n = e.formatToParts(t);
1790
1790
  for (let r = n.length - 1; r >= 0; --r)
1791
1791
  if (n[r].type === "timeZoneName")
1792
1792
  return n[r].value;
1793
1793
  }
1794
- function Ha(e, t) {
1794
+ function Va(e, t) {
1795
1795
  const n = e.format(t).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
1796
1796
  return r ? r[0].substr(1) : "";
1797
1797
  }
1798
- function qa(e, t, n) {
1798
+ function Ba(e, t, n) {
1799
1799
  return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
1800
1800
  timeZone: t,
1801
1801
  timeZoneName: e
1802
1802
  });
1803
1803
  }
1804
- function Za(e, t) {
1805
- const n = Ga(t);
1806
- return "formatToParts" in n ? Va(n, e) : Ba(n, e);
1804
+ function Ka(e, t) {
1805
+ const n = ti(t);
1806
+ return "formatToParts" in n ? Qa(n, e) : Ja(n, e);
1807
1807
  }
1808
- const Ka = {
1808
+ const Ga = {
1809
1809
  year: 0,
1810
1810
  month: 1,
1811
1811
  day: 2,
@@ -1813,11 +1813,11 @@ const Ka = {
1813
1813
  minute: 4,
1814
1814
  second: 5
1815
1815
  };
1816
- function Va(e, t) {
1816
+ function Qa(e, t) {
1817
1817
  try {
1818
1818
  const n = e.formatToParts(t), r = [];
1819
1819
  for (let a = 0; a < n.length; a++) {
1820
- const i = Ka[n[a].type];
1820
+ const i = Ga[n[a].type];
1821
1821
  i !== void 0 && (r[i] = parseInt(n[a].value, 10));
1822
1822
  }
1823
1823
  return r;
@@ -1827,7 +1827,7 @@ function Va(e, t) {
1827
1827
  throw n;
1828
1828
  }
1829
1829
  }
1830
- function Ba(e, t) {
1830
+ function Ja(e, t) {
1831
1831
  const n = e.format(t), r = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);
1832
1832
  return [
1833
1833
  parseInt(r[3], 10),
@@ -1838,7 +1838,7 @@ function Ba(e, t) {
1838
1838
  parseInt(r[6], 10)
1839
1839
  ];
1840
1840
  }
1841
- const Ne = {}, gt = new Intl.DateTimeFormat("en-US", {
1841
+ const $e = {}, wt = new Intl.DateTimeFormat("en-US", {
1842
1842
  hourCycle: "h23",
1843
1843
  timeZone: "America/New_York",
1844
1844
  year: "numeric",
@@ -1847,9 +1847,9 @@ const Ne = {}, gt = 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")), Xa = gt === "06/25/2014, 00:00:00" || gt === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
1851
- function Ga(e) {
1852
- return Ne[e] || (Ne[e] = Xa ? new Intl.DateTimeFormat("en-US", {
1850
+ }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), ei = wt === "06/25/2014, 00:00:00" || wt === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
1851
+ function ti(e) {
1852
+ return $e[e] || ($e[e] = ei ? new Intl.DateTimeFormat("en-US", {
1853
1853
  hourCycle: "h23",
1854
1854
  timeZone: e,
1855
1855
  year: "numeric",
@@ -1867,13 +1867,13 @@ function Ga(e) {
1867
1867
  hour: "2-digit",
1868
1868
  minute: "2-digit",
1869
1869
  second: "2-digit"
1870
- })), Ne[e];
1870
+ })), $e[e];
1871
1871
  }
1872
- function Ve(e, t, n, r, a, i, o) {
1872
+ function Be(e, t, n, r, a, i, o) {
1873
1873
  const s = /* @__PURE__ */ new Date(0);
1874
1874
  return s.setUTCFullYear(e, t, n), s.setUTCHours(r, a, i, o), s;
1875
1875
  }
1876
- const yt = 36e5, Qa = 6e4, $e = {
1876
+ const pt = 36e5, ni = 6e4, Ee = {
1877
1877
  timezoneZ: /^(Z)$/,
1878
1878
  timezoneHH: /^([+-]\d{2})$/,
1879
1879
  timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
@@ -1881,64 +1881,64 @@ const yt = 36e5, Qa = 6e4, $e = {
1881
1881
  function ve(e, t, n) {
1882
1882
  if (!e)
1883
1883
  return 0;
1884
- let r = $e.timezoneZ.exec(e);
1884
+ let r = Ee.timezoneZ.exec(e);
1885
1885
  if (r)
1886
1886
  return 0;
1887
1887
  let a, i;
1888
- if (r = $e.timezoneHH.exec(e), r)
1889
- return a = parseInt(r[1], 10), pt(a) ? -(a * yt) : NaN;
1890
- if (r = $e.timezoneHHMM.exec(e), r) {
1888
+ if (r = Ee.timezoneHH.exec(e), r)
1889
+ return a = parseInt(r[1], 10), Tt(a) ? -(a * pt) : NaN;
1890
+ if (r = Ee.timezoneHHMM.exec(e), r) {
1891
1891
  a = parseInt(r[2], 10);
1892
1892
  const o = parseInt(r[3], 10);
1893
- return pt(a, o) ? (i = Math.abs(a) * yt + o * Qa, r[1] === "+" ? -i : i) : NaN;
1893
+ return Tt(a, o) ? (i = Math.abs(a) * pt + o * ni, r[1] === "+" ? -i : i) : NaN;
1894
1894
  }
1895
- if (ti(e)) {
1895
+ if (ii(e)) {
1896
1896
  t = new Date(t || Date.now());
1897
- const o = n ? t : Ja(t), s = Le(o, e);
1898
- return -(n ? s : ei(t, s, e));
1897
+ const o = n ? t : ri(t), s = We(o, e);
1898
+ return -(n ? s : ai(t, s, e));
1899
1899
  }
1900
1900
  return NaN;
1901
1901
  }
1902
- function Ja(e) {
1903
- return Ve(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
1902
+ function ri(e) {
1903
+ return Be(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
1904
1904
  }
1905
- function Le(e, t) {
1906
- const n = Za(e, t), r = Ve(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
1905
+ function We(e, t) {
1906
+ const n = Ka(e, t), r = Be(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
1907
1907
  let a = e.getTime();
1908
1908
  const i = a % 1e3;
1909
1909
  return a -= i >= 0 ? i : 1e3 + i, r - a;
1910
1910
  }
1911
- function ei(e, t, n) {
1911
+ function ai(e, t, n) {
1912
1912
  let a = e.getTime() - t;
1913
- const i = Le(new Date(a), n);
1913
+ const i = We(new Date(a), n);
1914
1914
  if (t === i)
1915
1915
  return t;
1916
1916
  a -= i - t;
1917
- const o = Le(new Date(a), n);
1917
+ const o = We(new Date(a), n);
1918
1918
  return i === o ? i : Math.max(i, o);
1919
1919
  }
1920
- function pt(e, t) {
1920
+ function Tt(e, t) {
1921
1921
  return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
1922
1922
  }
1923
- const wt = {};
1924
- function ti(e) {
1925
- if (wt[e])
1923
+ const xt = {};
1924
+ function ii(e) {
1925
+ if (xt[e])
1926
1926
  return !0;
1927
1927
  try {
1928
- return new Intl.DateTimeFormat(void 0, { timeZone: e }), wt[e] = !0, !0;
1928
+ return new Intl.DateTimeFormat(void 0, { timeZone: e }), xt[e] = !0, !0;
1929
1929
  } catch {
1930
1930
  return !1;
1931
1931
  }
1932
1932
  }
1933
- const ni = 60 * 1e3, ri = {
1933
+ const oi = 60 * 1e3, si = {
1934
1934
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1935
1935
  X: function(e, t, n) {
1936
- const r = Fe(n.timeZone, e);
1936
+ const r = Ie(n.timeZone, e);
1937
1937
  if (r === 0)
1938
1938
  return "Z";
1939
1939
  switch (t) {
1940
1940
  case "X":
1941
- return Tt(r);
1941
+ return Dt(r);
1942
1942
  case "XXXX":
1943
1943
  case "XX":
1944
1944
  return C(r);
@@ -1950,10 +1950,10 @@ const ni = 60 * 1e3, ri = {
1950
1950
  },
1951
1951
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1952
1952
  x: function(e, t, n) {
1953
- const r = Fe(n.timeZone, e);
1953
+ const r = Ie(n.timeZone, e);
1954
1954
  switch (t) {
1955
1955
  case "x":
1956
- return Tt(r);
1956
+ return Dt(r);
1957
1957
  case "xxxx":
1958
1958
  case "xx":
1959
1959
  return C(r);
@@ -1965,12 +1965,12 @@ const ni = 60 * 1e3, ri = {
1965
1965
  },
1966
1966
  // Timezone (GMT)
1967
1967
  O: function(e, t, n) {
1968
- const r = Fe(n.timeZone, e);
1968
+ const r = Ie(n.timeZone, e);
1969
1969
  switch (t) {
1970
1970
  case "O":
1971
1971
  case "OO":
1972
1972
  case "OOO":
1973
- return "GMT" + ai(r, ":");
1973
+ return "GMT" + ci(r, ":");
1974
1974
  case "OOOO":
1975
1975
  default:
1976
1976
  return "GMT" + C(r, ":");
@@ -1982,20 +1982,20 @@ const ni = 60 * 1e3, ri = {
1982
1982
  case "z":
1983
1983
  case "zz":
1984
1984
  case "zzz":
1985
- return ht("short", e, n);
1985
+ return yt("short", e, n);
1986
1986
  case "zzzz":
1987
1987
  default:
1988
- return ht("long", e, n);
1988
+ return yt("long", e, n);
1989
1989
  }
1990
1990
  }
1991
1991
  };
1992
- function Fe(e, t) {
1993
- const n = e ? ve(e, t, !0) / ni : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
1992
+ function Ie(e, t) {
1993
+ const n = e ? ve(e, t, !0) / oi : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
1994
1994
  if (Number.isNaN(n))
1995
1995
  throw new RangeError("Invalid time zone specified: " + e);
1996
1996
  return n;
1997
1997
  }
1998
- function we(e, t) {
1998
+ function pe(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 we(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 = we(Math.floor(r / 60), 2), i = we(Math.floor(r % 60), 2);
2006
+ const n = e > 0 ? "-" : "+", r = Math.abs(e), a = pe(Math.floor(r / 60), 2), i = pe(Math.floor(r % 60), 2);
2007
2007
  return n + a + t + i;
2008
2008
  }
2009
- function Tt(e, t) {
2010
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + we(Math.abs(e) / 60, 2) : C(e, t);
2009
+ function Dt(e, t) {
2010
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + pe(Math.abs(e) / 60, 2) : C(e, t);
2011
2011
  }
2012
- function ai(e, t = "") {
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 + we(i, 2);
2014
+ return i === 0 ? n + String(a) : n + String(a) + t + pe(i, 2);
2015
2015
  }
2016
- function Dt(e) {
2016
+ function bt(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 sn = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Oe = 36e5, xt = 6e4, ii = 2, x = {
2020
+ const ln = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Oe = 36e5, vt = 6e4, ui = 2, D = {
2021
2021
  dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
2022
2022
  datePattern: /^([0-9W+-]+)(.*)/,
2023
2023
  // year tokens
@@ -2049,14 +2049,14 @@ const sn = /(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: sn
2052
+ timeZone: ln
2053
2053
  };
2054
2054
  function Te(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)
2058
2058
  return /* @__PURE__ */ new Date(NaN);
2059
- const n = t.additionalDigits == null ? ii : Number(t.additionalDigits);
2059
+ const n = t.additionalDigits == null ? ui : Number(t.additionalDigits);
2060
2060
  if (n !== 2 && n !== 1 && n !== 0)
2061
2061
  throw new RangeError("additionalDigits must be 0, 1 or 2");
2062
2062
  if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
@@ -2065,36 +2065,36 @@ function Te(e, t = {}) {
2065
2065
  return new Date(e);
2066
2066
  if (Object.prototype.toString.call(e) !== "[object String]")
2067
2067
  return /* @__PURE__ */ new Date(NaN);
2068
- const r = oi(e), { year: a, restDateString: i } = si(r.date, n), o = ci(i, a);
2068
+ const r = li(e), { year: a, restDateString: i } = mi(r.date, n), o = fi(i, a);
2069
2069
  if (o === null || isNaN(o.getTime()))
2070
2070
  return /* @__PURE__ */ new Date(NaN);
2071
2071
  if (o) {
2072
2072
  const s = o.getTime();
2073
2073
  let c = 0, u;
2074
- if (r.time && (c = ui(r.time), c === null || isNaN(c)))
2074
+ if (r.time && (c = di(r.time), c === null || isNaN(c)))
2075
2075
  return /* @__PURE__ */ new Date(NaN);
2076
2076
  if (r.timeZone || t.timeZone) {
2077
2077
  if (u = ve(r.timeZone || t.timeZone, new Date(s + c)), isNaN(u))
2078
2078
  return /* @__PURE__ */ new Date(NaN);
2079
2079
  } else
2080
- u = Dt(new Date(s + c)), u = Dt(new Date(s + c + u));
2080
+ u = bt(new Date(s + c)), u = bt(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
- function oi(e) {
2085
+ function li(e) {
2086
2086
  const t = {};
2087
- let n = x.dateTimePattern.exec(e), r;
2088
- if (n ? (t.date = n[1], r = n[3]) : (n = x.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
2089
- const a = x.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
- function si(e, t) {
2094
+ function mi(e, t) {
2095
2095
  if (e) {
2096
- const n = x.YYY[t], r = x.YYYYY[t];
2097
- let a = x.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 si(e, t) {
2102
2102
  restDateString: e.slice(i.length)
2103
2103
  };
2104
2104
  }
2105
- if (a = x.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,
@@ -2114,120 +2114,120 @@ function si(e, t) {
2114
2114
  year: null
2115
2115
  };
2116
2116
  }
2117
- function ci(e, t) {
2117
+ function fi(e, t) {
2118
2118
  if (t === null)
2119
2119
  return null;
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 = x.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, vt(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
2126
- if (i = x.DDD.exec(e), i) {
2125
+ return n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1, Mt(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
- return fi(t, o) ? (n.setUTCFullYear(t, 0, o), n) : /* @__PURE__ */ new Date(NaN);
2129
+ return yi(t, o) ? (n.setUTCFullYear(t, 0, o), n) : /* @__PURE__ */ new Date(NaN);
2130
2130
  }
2131
- if (i = x.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 vt(t, r, o) ? (n.setUTCFullYear(t, r, o), n) : /* @__PURE__ */ new Date(NaN);
2134
+ return Mt(t, r, o) ? (n.setUTCFullYear(t, r, o), n) : /* @__PURE__ */ new Date(NaN);
2135
2135
  }
2136
- if (i = x.Www.exec(e), i)
2137
- return a = parseInt(i[1], 10) - 1, St(a) ? bt(t, a) : /* @__PURE__ */ new Date(NaN);
2138
- if (i = x.WwwD.exec(e), i) {
2136
+ if (i = D.Www.exec(e), i)
2137
+ return a = parseInt(i[1], 10) - 1, kt(a) ? St(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 St(a, o) ? bt(t, a, o) : /* @__PURE__ */ new Date(NaN);
2141
+ return kt(a, o) ? St(t, a, o) : /* @__PURE__ */ new Date(NaN);
2142
2142
  }
2143
2143
  return null;
2144
2144
  }
2145
- function ui(e) {
2146
- let t, n, r = x.HH.exec(e);
2145
+ function di(e) {
2146
+ let t, n, r = D.HH.exec(e);
2147
2147
  if (r)
2148
- return t = parseFloat(r[1].replace(",", ".")), Ie(t) ? t % 24 * Oe : NaN;
2149
- if (r = x.HHMM.exec(e), r)
2150
- return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), Ie(t, n) ? t % 24 * Oe + n * xt : NaN;
2151
- if (r = x.HHMMSS.exec(e), r) {
2148
+ return t = parseFloat(r[1].replace(",", ".")), Fe(t) ? t % 24 * Oe : NaN;
2149
+ if (r = D.HHMM.exec(e), r)
2150
+ return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), Fe(t, n) ? t % 24 * Oe + n * vt : 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 Ie(t, n, a) ? t % 24 * Oe + n * xt + a * 1e3 : NaN;
2154
+ return Fe(t, n, a) ? t % 24 * Oe + n * vt + a * 1e3 : NaN;
2155
2155
  }
2156
2156
  return null;
2157
2157
  }
2158
- function bt(e, t, n) {
2158
+ function St(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);
2162
2162
  const a = r.getUTCDay() || 7, i = t * 7 + n + 1 - a;
2163
2163
  return r.setUTCDate(r.getUTCDate() + i), r;
2164
2164
  }
2165
- const li = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], mi = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2166
- function cn(e) {
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) {
2167
2167
  return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
2168
2168
  }
2169
- function vt(e, t, n) {
2169
+ function Mt(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 = cn(e);
2176
- if (r && n > mi[t] || !r && n > li[t])
2175
+ const r = mn(e);
2176
+ if (r && n > gi[t] || !r && n > hi[t])
2177
2177
  return !1;
2178
2178
  }
2179
2179
  return !0;
2180
2180
  }
2181
- function fi(e, t) {
2181
+ function yi(e, t) {
2182
2182
  if (t < 1)
2183
2183
  return !1;
2184
- const n = cn(e);
2184
+ const n = mn(e);
2185
2185
  return !(n && t > 366 || !n && t > 365);
2186
2186
  }
2187
- function St(e, t) {
2187
+ function kt(e, t) {
2188
2188
  return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
2189
2189
  }
2190
- function Ie(e, t, n) {
2190
+ function Fe(e, t, n) {
2191
2191
  return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || n != null && (n < 0 || n >= 60));
2192
2192
  }
2193
- const di = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
2194
- function hi(e, t, n = {}) {
2193
+ const wi = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
2194
+ function pi(e, t, n = {}) {
2195
2195
  t = String(t);
2196
- const r = t.match(di);
2196
+ const r = t.match(wi);
2197
2197
  if (r) {
2198
2198
  const a = Te(n.originalDate || e, n);
2199
2199
  t = r.reduce(function(i, o) {
2200
2200
  if (o[0] === "'")
2201
2201
  return i;
2202
- const s = i.indexOf(o), c = i[s - 1] === "'", u = i.replace(o, "'" + ri[o[0]](a, o, n) + "'");
2202
+ const s = i.indexOf(o), c = i[s - 1] === "'", u = i.replace(o, "'" + si[o[0]](a, o, n) + "'");
2203
2203
  return c ? u.substring(0, s - 1) + u.substring(s + 1) : u;
2204
2204
  }, t);
2205
2205
  }
2206
- return Ke(e, t, n);
2206
+ return Ve(e, t, n);
2207
2207
  }
2208
- function gi(e, t, n) {
2208
+ function Ti(e, t, n) {
2209
2209
  e = Te(e, n);
2210
2210
  const r = ve(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 un(e, t, n, r) {
2213
+ function fn(e, t, n, r) {
2214
2214
  return r = {
2215
2215
  ...r,
2216
2216
  timeZone: t,
2217
2217
  originalDate: e
2218
- }, hi(gi(e, t, { timeZone: r.timeZone }), n, r);
2218
+ }, pi(Ti(e, t, { timeZone: r.timeZone }), n, r);
2219
2219
  }
2220
2220
  function te(e, t, n) {
2221
- if (typeof e == "string" && !e.match(sn))
2221
+ if (typeof e == "string" && !e.match(ln))
2222
2222
  return Te(e, { ...n, timeZone: t });
2223
2223
  e = Te(e, n);
2224
- const r = Ve(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), a = ve(t, new Date(r));
2224
+ const r = Be(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), a = ve(t, new Date(r));
2225
2225
  return new Date(r + a);
2226
2226
  }
2227
- function Ns(e, t) {
2227
+ function Os(e, t) {
2228
2228
  return e && e !== "auto" ? e : t;
2229
2229
  }
2230
- function $s(e, t = /* @__PURE__ */ new Date()) {
2230
+ function Fs(e, t = /* @__PURE__ */ new Date()) {
2231
2231
  try {
2232
2232
  const n = {
2233
2233
  timeZone: e,
@@ -2238,7 +2238,7 @@ function $s(e, t = /* @__PURE__ */ new Date()) {
2238
2238
  return e;
2239
2239
  }
2240
2240
  }
2241
- function Fs(e) {
2241
+ function Cs(e) {
2242
2242
  try {
2243
2243
  const t = {
2244
2244
  timeZone: e,
@@ -2251,7 +2251,7 @@ function Fs(e) {
2251
2251
  return e;
2252
2252
  }
2253
2253
  }
2254
- function Be(e, t = "auto") {
2254
+ function Ke(e, t = "auto") {
2255
2255
  if (!e)
2256
2256
  return /* @__PURE__ */ new Date(NaN);
2257
2257
  const n = e.endsWith("Z"), r = /[+-]\d{2}:?\d{2}$/.test(e), a = /\([A-Z]{3,4}\)$/.test(e);
@@ -2265,71 +2265,71 @@ function Be(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 yi = "MM/dd/yyyy", pi = (e, t, n, r = "auto") => {
2268
+ const xi = "MM/dd/yyyy", Di = (e, t, n, r = "auto") => {
2269
2269
  if (!e)
2270
2270
  return "";
2271
2271
  try {
2272
- const a = Be(e, r);
2272
+ const a = Ke(e, r);
2273
2273
  if (isNaN(a.getTime()))
2274
2274
  return e;
2275
- const o = (t && t.trim() ? t : yi).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
2276
- return n && n !== "auto" ? un(a, n, o) : Ke(a, o);
2275
+ const o = (t && t.trim() ? t : xi).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
2276
+ return n && n !== "auto" ? fn(a, n, o) : Ve(a, o);
2277
2277
  } catch (a) {
2278
2278
  return console.error("Date formatting error:", a), e;
2279
2279
  }
2280
2280
  };
2281
- function Os(e, t, n = "auto") {
2281
+ function Ps(e, t, n = "auto") {
2282
2282
  if (e)
2283
2283
  try {
2284
- const r = Be(e, n);
2284
+ const r = Ke(e, n);
2285
2285
  if (isNaN(r.getTime())) return;
2286
- const a = "yyyy M d H m s", i = t && t !== "auto" ? un(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" ? fn(r, t, a) : Ve(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 wi = (e, t = "auto") => {
2292
+ const bi = (e, t = "auto") => {
2293
2293
  if (!e)
2294
2294
  return "";
2295
2295
  try {
2296
- const n = Be(e, t);
2297
- return isNaN(n.getTime()) ? e : ka(n, { addSuffix: !0 });
2296
+ const n = Ke(e, t);
2297
+ return isNaN(n.getTime()) ? e : Ea(n, { addSuffix: !0 });
2298
2298
  } catch (n) {
2299
2299
  return console.error("Relative time formatting error:", n), e;
2300
2300
  }
2301
2301
  };
2302
- function Ti(e, t, n, r) {
2302
+ function vi(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 wi(
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 pi(
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 ln(e, t, n) {
2317
+ function dn(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) ?? "";
2321
- const r = Yn(e) ? e : void 0, a = r ? r.value : e, i = r ?? (typeof e == "number" ? e : void 0);
2321
+ const r = Rn(e) ? e : void 0, a = r ? r.value : e, i = r ?? (typeof e == "number" ? e : void 0);
2322
2322
  if (!n.useFormattedValues || !t)
2323
2323
  return String(a);
2324
2324
  switch (t.type) {
2325
2325
  case "number":
2326
- return i !== void 0 ? mr(
2326
+ return i !== void 0 ? gr(
2327
2327
  i,
2328
2328
  t.numberFormat,
2329
2329
  n.locale
2330
2330
  ) : String(a);
2331
2331
  case "date":
2332
- return Ti(
2332
+ return vi(
2333
2333
  a,
2334
2334
  t.dateFormat,
2335
2335
  n.timezone,
@@ -2348,53 +2348,60 @@ function ln(e, t, n) {
2348
2348
  return String(a);
2349
2349
  }
2350
2350
  }
2351
- function Is(e, t) {
2351
+ function Ys(e, t) {
2352
2352
  return t.visibleColumns.map((n) => {
2353
2353
  const r = e[n], a = t.columnSettings[n];
2354
- return ln(r, a, {
2354
+ return dn(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 Di = 5 * 1024 * 1024, Es = 64 * 1024 * 1024, De = w.number().int().positive().max(Number.MAX_SAFE_INTEGER), le = w.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER), xe = le.refine((e) => e > 0), xi = (e) => !!e && e !== "." && e !== ".." && !e.includes("/") && !e.includes("\\");
2361
+ const hn = 1e4, Si = 1e6, zs = 5e6, As = 1024 ** 3, Rs = 1024 ** 3;
2362
+ function Us(e) {
2363
+ return e > hn;
2364
+ }
2365
+ function Ls(e) {
2366
+ return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= hn ? "direct" : e.loadedRowCount <= Si ? "background" : "blocked";
2367
+ }
2368
+ const Mi = 5 * 1024 * 1024, Ws = 64 * 1024 * 1024, xe = p.number().int().positive().max(Number.MAX_SAFE_INTEGER), le = p.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER), De = le.refine((e) => e > 0), ki = (e) => !!e && e !== "." && e !== ".." && !e.includes("/") && !e.includes("\\");
2362
2369
  function P(e, t) {
2363
2370
  const n = t.split("/");
2364
- if (n.length !== 5 || n[0] !== "exports" || n[1] !== e || n[2] !== "attempts" || !n.every(xi))
2371
+ if (n.length !== 5 || n[0] !== "exports" || n[1] !== e || n[2] !== "attempts" || !n.every(ki))
2365
2372
  throw new Error("Invalid Matrix export artifact namespace.");
2366
2373
  return { attemptId: n[3], filename: n[4] };
2367
2374
  }
2368
- function Cs(e, t, n) {
2375
+ function js(e, t, n) {
2369
2376
  const r = `exports/${e}/attempts/${t}/${n}`;
2370
2377
  return P(e, r), r;
2371
2378
  }
2372
- const Ps = w.object({
2373
- acquisition: w.literal("continuation"),
2374
- jobId: w.string().min(1),
2375
- sequence: xe,
2376
- deadlineAt: De
2377
- }), bi = [
2379
+ const Hs = p.object({
2380
+ acquisition: p.literal("continuation"),
2381
+ jobId: p.string().min(1),
2382
+ sequence: De,
2383
+ deadlineAt: xe
2384
+ }), _i = [
2378
2385
  "application/json",
2379
- ...Rt.map((e) => Lt(e).partContentType)
2380
- ], vi = w.object({
2381
- key: w.string(),
2382
- content: w.string(),
2383
- contentType: w.enum(bi),
2384
- encoding: w.literal("gzip-base64").optional()
2386
+ ...Wt.map((e) => jt(e).partContentType)
2387
+ ], Ni = p.object({
2388
+ key: p.string(),
2389
+ content: p.string(),
2390
+ contentType: p.enum(_i),
2391
+ encoding: p.literal("gzip-base64").optional()
2385
2392
  // Transport-only compression: JSON (layout, sheet layout) and Excel rows. CSV travels as it always has.
2386
- }).refine((e) => !e.encoding || e.contentType === "application/json" || e.contentType === Lt("xlsx").partContentType, "Unsupported Matrix artifact encoding."), Si = w.discriminatedUnion("kind", [
2387
- w.object({ kind: w.literal("work"), sequence: xe, checkpointKey: w.string(), objects: w.array(vi).min(2).max(4), deadlineAt: De }),
2388
- w.object({ kind: w.literal("committed"), sequence: xe, done: w.boolean(), deadlineAt: De })
2393
+ }).refine((e) => !e.encoding || e.contentType === "application/json" || e.contentType === jt("xlsx").partContentType, "Unsupported Matrix artifact encoding."), $i = p.discriminatedUnion("kind", [
2394
+ p.object({ kind: p.literal("work"), sequence: De, checkpointKey: p.string(), objects: p.array(Ni).min(2).max(4), deadlineAt: xe }),
2395
+ p.object({ kind: p.literal("committed"), sequence: De, done: p.boolean(), deadlineAt: xe })
2389
2396
  ]);
2390
- function Mi(e) {
2397
+ function Ei(e) {
2391
2398
  const t = JSON.stringify(e);
2392
- if (t === void 0 || new TextEncoder().encode(t).byteLength > Di)
2399
+ if (t === void 0 || new TextEncoder().encode(t).byteLength > Mi)
2393
2400
  throw new RangeError("Matrix export batch exceeds its transport byte limit.");
2394
2401
  }
2395
- function Ys(e, t) {
2396
- const n = Si.parse(e);
2397
- if (Mi(e), n.deadlineAt !== t.deadlineAt) throw new Error("Matrix deadline does not match the job.");
2402
+ function qs(e, t) {
2403
+ const n = $i.parse(e);
2404
+ if (Ei(e), n.deadlineAt !== t.deadlineAt) throw new Error("Matrix deadline does not match the job.");
2398
2405
  if (n.sequence !== t.sequence + (n.kind === "committed" ? 1 : 0))
2399
2406
  throw new Error("Invalid Matrix batch sequence.");
2400
2407
  if (n.kind === "work") {
@@ -2404,44 +2411,29 @@ function Ys(e, t) {
2404
2411
  }
2405
2412
  return n;
2406
2413
  }
2407
- const ki = w.object({
2408
- acquisition: w.literal("continuation"),
2409
- deadlineAt: De,
2410
- chunks: w.array(w.object({ chunkNumber: xe, dataKey: w.string() })).min(1),
2414
+ const Ii = p.object({
2415
+ acquisition: p.literal("continuation"),
2416
+ deadlineAt: xe,
2417
+ chunks: p.array(p.object({ chunkNumber: De, dataKey: p.string() })).min(1),
2411
2418
  totalRows: le,
2412
2419
  totalBytes: le,
2413
- fileKey: w.string().min(1).optional(),
2420
+ fileKey: p.string().min(1).optional(),
2414
2421
  fileSize: le.optional(),
2415
2422
  /** The file the job writes; absent means CSV (manifests from before Excel). */
2416
- format: w.enum(Rt).optional(),
2423
+ format: p.enum(Wt).optional(),
2417
2424
  /** Excel only: the sheet layout the layout batch stored, which compaction wraps the rows in. */
2418
- sheetKey: w.string().min(1).optional()
2425
+ sheetKey: p.string().min(1).optional()
2419
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.");
2420
- function zs(e, t, n) {
2421
- const r = ki.parse(e);
2427
+ function Zs(e, t, n) {
2428
+ const r = Ii.parse(e);
2422
2429
  if (r.deadlineAt !== n) throw new Error("Matrix deadline does not match the job.");
2423
2430
  return r.chunks.forEach((a, i) => {
2424
2431
  if (a.chunkNumber !== i + 1) throw new Error("Invalid committed Matrix chunk order.");
2425
2432
  P(t, a.dataKey);
2426
2433
  }), r.fileKey !== void 0 && P(t, r.fileKey), r.sheetKey !== void 0 && P(t, r.sheetKey), r;
2427
2434
  }
2428
- const _i = "en-US", Mt = [
2429
- "compact",
2430
- "maximumFractionDigits",
2431
- "minimumFractionDigits",
2432
- "negativeStyle",
2433
- "type",
2434
- "useGrouping"
2435
- ];
2436
- function Ni(e) {
2437
- if (e.type !== "currency" || Object.prototype.hasOwnProperty.call(e, "currency") || Object.prototype.hasOwnProperty.call(e, "locale"))
2438
- return !1;
2439
- const t = Object.keys(e).sort();
2440
- return t.length === Mt.length && Mt.every(
2441
- (n, r) => t[r] === n
2442
- ) && typeof e.minimumFractionDigits == "number" && typeof e.maximumFractionDigits == "number" && e.useGrouping === !0 && e.negativeStyle === "minus" && typeof e.compact == "boolean";
2443
- }
2444
- function kt(e) {
2435
+ const Oi = "en-US";
2436
+ function _t(e) {
2445
2437
  if (typeof e != "string")
2446
2438
  return;
2447
2439
  const t = e.trim();
@@ -2452,10 +2444,10 @@ function me(e) {
2452
2444
  if (!(typeof e != "number" || !Number.isFinite(e)))
2453
2445
  return Math.max(0, Math.min(10, Math.trunc(e)));
2454
2446
  }
2455
- function $i(e) {
2447
+ function Fi(e) {
2456
2448
  return e === "currency" ? 2 : e === "percent" ? 1 : e === "scientific" ? 2 : 0;
2457
2449
  }
2458
- function Fi(e, t, n) {
2450
+ function Ci(e, t, n) {
2459
2451
  const r = me(t.minimumFractionDigits), a = me(t.maximumFractionDigits);
2460
2452
  if (typeof r == "number" || typeof a == "number") {
2461
2453
  const s = r ?? 0, c = a ?? Math.max(s, 2);
@@ -2472,18 +2464,18 @@ function Fi(e, t, n) {
2472
2464
  };
2473
2465
  if (n != null && n.preserveOmittedProperties)
2474
2466
  return {};
2475
- const o = $i(e);
2467
+ const o = Fi(e);
2476
2468
  return {
2477
2469
  minimumFractionDigits: o,
2478
2470
  maximumFractionDigits: o
2479
2471
  };
2480
2472
  }
2481
- function Oi(e, t) {
2473
+ function Pi(e, t) {
2482
2474
  if (!(typeof t != "string" || e === "percent" && t === "%"))
2483
2475
  return t;
2484
2476
  }
2485
- function _t(e) {
2486
- const t = kt(e.locale), n = kt(e.currency), r = Oi(e.type, e.suffix);
2477
+ function Nt(e) {
2478
+ const t = _t(e.locale), n = _t(e.currency), r = Pi(e.type, e.suffix);
2487
2479
  return {
2488
2480
  ...e,
2489
2481
  ...t !== e.locale ? { locale: t } : {},
@@ -2491,11 +2483,11 @@ function _t(e) {
2491
2483
  ...r !== e.suffix ? { suffix: r } : {}
2492
2484
  };
2493
2485
  }
2494
- function F(e, t, n) {
2486
+ function E(e, t, n) {
2495
2487
  const r = { ...t, type: e };
2496
2488
  if ((n == null ? void 0 : n.numericInput) === "canonical" && J(r))
2497
- return _t(r);
2498
- const a = Fi(e, t, n), i = typeof t.prefix == "string" ? t.prefix : void 0, o = {
2489
+ return Nt(r);
2490
+ const a = Ci(e, t, n), i = typeof t.prefix == "string" ? t.prefix : void 0, o = {
2499
2491
  type: e,
2500
2492
  locale: t.locale,
2501
2493
  minimumFractionDigits: a.minimumFractionDigits,
@@ -2508,12 +2500,12 @@ function F(e, t, n) {
2508
2500
  scale: typeof t.scale == "number" ? t.scale : void 0,
2509
2501
  ...t.signDisplay ? { signDisplay: t.signDisplay } : {}
2510
2502
  };
2511
- return e === "currency" && t.currency && (o.currency = t.currency), e === "percent" && (o.percentValueMode = t.percentValueMode || "fraction"), _t(o);
2503
+ return e === "currency" && t.currency && (o.currency = t.currency), e === "percent" && (o.percentValueMode = t.percentValueMode || "fraction"), Nt(o);
2512
2504
  }
2513
- function Nt(e) {
2505
+ function $t(e) {
2514
2506
  return {
2515
2507
  type: "date",
2516
- locale: e.locale || _i,
2508
+ locale: e.locale || Oi,
2517
2509
  pattern: e.pattern,
2518
2510
  // A stored pattern's token set and a preset carry to every reader (column formats ledger P5-45).
2519
2511
  ...e.dialect ? { dialect: e.dialect } : {},
@@ -2525,68 +2517,68 @@ function Nt(e) {
2525
2517
  suffix: e.suffix
2526
2518
  };
2527
2519
  }
2528
- function Ee(e) {
2520
+ function Ce(e) {
2529
2521
  return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
2530
2522
  }
2531
- function $t(e) {
2523
+ function Et(e) {
2532
2524
  const t = me(e.maxUnits);
2533
2525
  return {
2534
2526
  type: "duration",
2535
- inputUnit: Ee(e.inputUnit) ? e.inputUnit : "second",
2527
+ inputUnit: Ce(e.inputUnit) ? e.inputUnit : "second",
2536
2528
  outputStyle: e.outputStyle === "digital" || e.outputStyle === "long" ? e.outputStyle : "compact",
2537
- largestUnit: Ee(e.largestUnit) ? e.largestUnit : void 0,
2538
- smallestUnit: Ee(e.smallestUnit) ? e.smallestUnit : "second",
2529
+ largestUnit: Ce(e.largestUnit) ? e.largestUnit : void 0,
2530
+ smallestUnit: Ce(e.smallestUnit) ? e.smallestUnit : "second",
2539
2531
  maxUnits: t,
2540
2532
  prefix: e.prefix,
2541
2533
  suffix: e.suffix,
2542
2534
  negativeStyle: e.negativeStyle || "minus"
2543
2535
  };
2544
2536
  }
2545
- function Ft(e) {
2537
+ function It(e) {
2546
2538
  return {
2547
2539
  type: "string",
2548
2540
  prefix: e.prefix,
2549
2541
  suffix: e.suffix
2550
2542
  };
2551
2543
  }
2552
- function Ii(e, t) {
2544
+ function Yi(e, t) {
2553
2545
  if (!e)
2554
2546
  return;
2555
2547
  if (typeof e == "string") {
2556
2548
  const r = e.trim().toLowerCase();
2557
- return r === "currency" ? F(
2549
+ return r === "currency" ? E(
2558
2550
  "currency",
2559
2551
  { type: "currency" },
2560
2552
  t
2561
- ) : r === "percentage" || r === "percent" ? F(
2553
+ ) : r === "percentage" || r === "percent" ? E(
2562
2554
  "percent",
2563
2555
  {
2564
2556
  type: "percentage",
2565
2557
  percentValueMode: "fraction"
2566
2558
  },
2567
2559
  t
2568
- ) : r === "scientific" ? F(
2560
+ ) : r === "scientific" ? E(
2569
2561
  "scientific",
2570
2562
  { type: "scientific" },
2571
2563
  t
2572
- ) : r === "date" ? Nt({}) : r === "duration" ? $t({}) : r === "string" ? Ft({}) : r === "number" ? F(
2564
+ ) : r === "date" ? $t({}) : r === "duration" ? Et({}) : r === "string" ? It({}) : r === "number" ? E(
2573
2565
  "number",
2574
2566
  { type: "number" },
2575
2567
  t
2576
2568
  ) : void 0;
2577
2569
  }
2578
2570
  if ("type" in e && e.type === "temporal_bucket") {
2579
- const r = jn.safeParse(e);
2571
+ const r = Zn.safeParse(e);
2580
2572
  return r.success ? r.data : void 0;
2581
2573
  }
2582
2574
  const n = e;
2583
2575
  if ((t == null ? void 0 : t.numericInput) === "canonical") {
2584
2576
  const r = n.type === "percentage" ? { ...n, type: "percent" } : n;
2585
2577
  if (J(r))
2586
- return F(r.type, r, t);
2578
+ return E(r.type, r, t);
2587
2579
  }
2588
2580
  if (n.type === "percentage")
2589
- return F(
2581
+ return E(
2590
2582
  "percent",
2591
2583
  {
2592
2584
  ...n,
@@ -2594,23 +2586,17 @@ function Ii(e, t) {
2594
2586
  },
2595
2587
  t
2596
2588
  );
2597
- if (n.type === "number" || n.type === "currency" || n.type === "percent" || n.type === "scientific") {
2598
- const r = F(
2599
- n.type,
2600
- n,
2601
- t
2602
- );
2603
- return Ni(n) ? { ...r, currency: "USD" } : r;
2604
- }
2589
+ if (n.type === "number" || n.type === "currency" || n.type === "percent" || n.type === "scientific")
2590
+ return E(n.type, n, t);
2605
2591
  if (n.type === "date")
2606
- return Nt(n);
2607
- if (n.type === "duration")
2608
2592
  return $t(n);
2593
+ if (n.type === "duration")
2594
+ return Et(n);
2609
2595
  if (n.type === "string")
2610
- return Ft(n);
2596
+ return It(n);
2611
2597
  }
2612
- const Ei = Object.freeze({ source: "automatic" });
2613
- function Ci(e, t) {
2598
+ const zi = Object.freeze({ source: "automatic" });
2599
+ function Ai(e, t) {
2614
2600
  var r, a;
2615
2601
  const n = e.preferences;
2616
2602
  switch (t) {
@@ -2633,11 +2619,11 @@ function Ot(e, t) {
2633
2619
  ...n.pivotByColumns ?? []
2634
2620
  ].find((r) => r.id === t);
2635
2621
  }
2636
- function Pi(e, t) {
2622
+ function Ri(e, t) {
2637
2623
  if (t.kind === "field") return Ot(e, t.fieldId);
2638
2624
  if (t.kind === "pivot") return Ot(e, t.metricId);
2639
2625
  }
2640
- function Yi(e, t, n) {
2626
+ function Ui(e, t, n) {
2641
2627
  var r, a, i, o, s, c, u, l, f;
2642
2628
  switch (t.kind) {
2643
2629
  case "field":
@@ -2653,50 +2639,50 @@ function Yi(e, t, n) {
2653
2639
  return (f = (l = e.config) == null ? void 0 : l.matrix) == null ? void 0 : f.presentation.levelFormats[t.levelId];
2654
2640
  }
2655
2641
  }
2656
- function zi(e) {
2642
+ function Li(e) {
2657
2643
  if (!e) return;
2658
2644
  if (e.format && e.formatOrigin !== "override") return e.format;
2659
2645
  const t = e.semanticTemporalPresentation;
2660
2646
  return t && t.granularity === e.granularity ? t.format : void 0;
2661
2647
  }
2662
- function Xe(e) {
2663
- return e.surface ? { format: e.surface, source: "surface" } : e.override ? { format: e.override, source: "override" } : e.model ? { format: e.model, source: "model" } : e.snapshot ? { format: e.snapshot, source: "snapshot" } : Ei;
2648
+ function Ge(e) {
2649
+ return e.surface ? { format: e.surface, source: "surface" } : e.override ? { format: e.override, source: "override" } : e.model ? { format: e.model, source: "model" } : e.snapshot ? { format: e.snapshot, source: "snapshot" } : zi;
2664
2650
  }
2665
- function Ui(e) {
2651
+ function Wi(e) {
2666
2652
  var o;
2667
- const { card: t, column: n, surface: r } = e, a = Pi(t, n), i = n.kind === "field" ? n.fieldId : n.kind === "pivot" ? n.metricId : void 0;
2668
- return Xe({
2669
- surface: r ? Ci(t, r) : void 0,
2670
- override: Yi(t, n, a),
2653
+ const { card: t, column: n, surface: r } = e, a = Ri(t, n), i = n.kind === "field" ? n.fieldId : n.kind === "pivot" ? n.metricId : void 0;
2654
+ return Ge({
2655
+ surface: r ? Ai(t, r) : void 0,
2656
+ override: Ui(t, n, a),
2671
2657
  model: (i !== void 0 ? (o = e.modelFormats) == null ? void 0 : o[i] : void 0) ?? e.catalogFormat,
2672
- snapshot: zi(a)
2658
+ snapshot: Li(a)
2673
2659
  });
2674
2660
  }
2675
- function Ai(e, t) {
2661
+ function ji(e, t) {
2676
2662
  const n = (r) => r && typeof r == "object" && !Array.isArray(r) ? Object.fromEntries(
2677
2663
  Object.keys(r).sort().map((a) => [a, n(r[a])])
2678
2664
  ) : r;
2679
2665
  return JSON.stringify(n(e)) === JSON.stringify(n(t));
2680
2666
  }
2681
- const Ri = ["metricColumns", "groupByColumns", "detailColumns", "pivotByColumns"], It = /* @__PURE__ */ new WeakMap();
2682
- function Us(e, t) {
2667
+ const Hi = ["metricColumns", "groupByColumns", "detailColumns", "pivotByColumns"], Ft = /* @__PURE__ */ new WeakMap();
2668
+ function Xs(e, t) {
2683
2669
  const n = t == null ? void 0 : t.modelFormats;
2684
2670
  if (!e || !n || Object.keys(n).length === 0) return e;
2685
- let r = It.get(e);
2686
- if (r || It.set(e, r = /* @__PURE__ */ new WeakMap()), r.has(n)) return r.get(n);
2687
- const a = Li(e, n);
2671
+ let r = Ft.get(e);
2672
+ if (r || Ft.set(e, r = /* @__PURE__ */ new WeakMap()), r.has(n)) return r.get(n);
2673
+ const a = qi(e, n);
2688
2674
  return r.set(n, a), a;
2689
2675
  }
2690
- function Li(e, t) {
2676
+ function qi(e, t) {
2691
2677
  const n = { config: e };
2692
2678
  let r;
2693
- for (const a of Ri) {
2679
+ for (const a of Hi) {
2694
2680
  const i = e[a];
2695
2681
  if (!(i != null && i.length)) continue;
2696
2682
  let o = !1;
2697
2683
  const s = i.map((c) => {
2698
- const u = Ui({ card: n, column: { kind: "field", fieldId: c.id }, modelFormats: t });
2699
- return u.source !== "model" || Ai(u.format, c.format) ? c : (o = !0, { ...c, format: u.format });
2684
+ const u = Wi({ card: n, column: { kind: "field", fieldId: c.id }, modelFormats: t });
2685
+ return u.source !== "model" || ji(u.format, c.format) ? c : (o = !0, { ...c, format: u.format });
2700
2686
  });
2701
2687
  o && ((r ?? (r = { ...e }))[a] = s);
2702
2688
  }
@@ -2713,7 +2699,7 @@ function T(e) {
2713
2699
  ) ? t.constructor : void 0;
2714
2700
  return typeof n == "function" && Function.prototype.toString.call(n) === Function.prototype.toString.call(Object);
2715
2701
  }
2716
- const Wi = [
2702
+ const Zi = [
2717
2703
  "type",
2718
2704
  "locale",
2719
2705
  "minimumFractionDigits",
@@ -2728,13 +2714,13 @@ const Wi = [
2728
2714
  "percentValueMode",
2729
2715
  "signDisplay"
2730
2716
  ];
2731
- function ji(e) {
2717
+ function Xi(e) {
2732
2718
  if (!T(e))
2733
2719
  return {
2734
2720
  ok: !1,
2735
2721
  issues: [{ path: "$", message: "Numeric format must be an object." }]
2736
2722
  };
2737
- const t = [], n = new Set(Wi);
2723
+ const t = [], n = new Set(Zi);
2738
2724
  Object.keys(e).filter((i) => !n.has(i)).forEach(
2739
2725
  (i) => t.push({ path: i, message: `Unknown property "${i}".` })
2740
2726
  ), e.type !== "number" && e.type !== "currency" && e.type !== "percent" && e.type !== "scientific" && t.push({
@@ -2743,7 +2729,7 @@ function ji(e) {
2743
2729
  });
2744
2730
  const r = e.locale === void 0 ? void 0 : Q(e.locale);
2745
2731
  e.locale !== void 0 && !r && t.push({ path: "locale", message: "Expected a supported BCP 47 locale." });
2746
- const a = e.currency === void 0 ? void 0 : Ue(e.currency);
2732
+ const a = e.currency === void 0 ? void 0 : Re(e.currency);
2747
2733
  e.currency !== void 0 && !a && t.push({
2748
2734
  path: "currency",
2749
2735
  message: "Expected a supported ISO 4217 currency code."
@@ -2797,8 +2783,8 @@ function ji(e) {
2797
2783
  }
2798
2784
  };
2799
2785
  }
2800
- function Hi(e) {
2801
- const t = ji(e);
2786
+ function Vi(e) {
2787
+ const t = Xi(e);
2802
2788
  if (!t.ok)
2803
2789
  return t;
2804
2790
  const n = [];
@@ -2816,7 +2802,7 @@ function Hi(e) {
2816
2802
  message: "Resolved currency formats require an explicit currency."
2817
2803
  }), n.length > 0 ? { ok: !1, issues: n } : t;
2818
2804
  }
2819
- function As(e) {
2805
+ function Vs(e) {
2820
2806
  var r;
2821
2807
  const t = /* @__PURE__ */ new Set();
2822
2808
  if (e.snapshot.resolvedFormats.forEach((a, i) => {
@@ -2853,7 +2839,7 @@ function As(e) {
2853
2839
  `resolvedFormats is missing visible export column "${n}"`
2854
2840
  );
2855
2841
  }
2856
- function qi(e, t) {
2842
+ function Bi(e, t) {
2857
2843
  const n = new Intl.NumberFormat(e, {
2858
2844
  style: "currency",
2859
2845
  currency: t
@@ -2863,7 +2849,7 @@ function qi(e, t) {
2863
2849
  maximumFractionDigits: n.maximumFractionDigits
2864
2850
  };
2865
2851
  }
2866
- function Zi(e) {
2852
+ function Ki(e) {
2867
2853
  if (e.minimumFractionDigits !== void 0 || e.maximumFractionDigits !== void 0) {
2868
2854
  const n = e.minimumFractionDigits ?? 0;
2869
2855
  return {
@@ -2877,15 +2863,15 @@ function Zi(e) {
2877
2863
  maximumFractionDigits: t
2878
2864
  };
2879
2865
  }
2880
- function Ki(e, t, n) {
2881
- const r = Q(e.locale) ?? t.locale, a = e.type === "number" || e.type === "currency" ? Ue(n) : void 0;
2866
+ function Gi(e, t, n) {
2867
+ const r = Q(e.locale) ?? t.locale, a = e.type === "number" || e.type === "currency" ? Re(n) : void 0;
2882
2868
  if (!(e.type === "currency" || a !== void 0))
2883
2869
  return {
2884
2870
  ...e,
2885
2871
  locale: r,
2886
- ...Zi(e)
2872
+ ...Ki(e)
2887
2873
  };
2888
- const o = a ?? Ue(e.currency) ?? t.defaultCurrency, s = qi(
2874
+ const o = a ?? Re(e.currency) ?? t.defaultCurrency, s = Bi(
2889
2875
  r,
2890
2876
  o
2891
2877
  ), c = s.minimumFractionDigits ?? 0, u = s.maximumFractionDigits ?? c, l = e.minimumFractionDigits ?? Math.min(
@@ -2904,7 +2890,7 @@ function Ki(e, t, n) {
2904
2890
  maximumFractionDigits: f
2905
2891
  };
2906
2892
  }
2907
- const Vi = [
2893
+ const Qi = [
2908
2894
  "YYYY",
2909
2895
  "MMMM",
2910
2896
  "MMM",
@@ -2914,13 +2900,13 @@ const Vi = [
2914
2900
  "HH",
2915
2901
  "mm",
2916
2902
  "ss"
2917
- ], Bi = /* @__PURE__ */ new Set([" ", "-", "/", ":", ".", ",", "T"]), se = [
2903
+ ], Ji = /* @__PURE__ */ new Set([" ", "-", "/", ":", ".", ",", "T"]), se = [
2918
2904
  "day",
2919
2905
  "week",
2920
2906
  "month",
2921
2907
  "quarter",
2922
2908
  "year"
2923
- ], mn = {
2909
+ ], gn = {
2924
2910
  week_of_short: ["week"],
2925
2911
  week_of_long: ["week"],
2926
2912
  quarter_short: ["quarter"],
@@ -2932,11 +2918,11 @@ const Vi = [
2932
2918
  numeric: se,
2933
2919
  iso: se
2934
2920
  };
2935
- function Xi(e) {
2936
- return typeof e == "string" && Object.prototype.hasOwnProperty.call(mn, e);
2921
+ function eo(e) {
2922
+ return typeof e == "string" && Object.prototype.hasOwnProperty.call(gn, e);
2937
2923
  }
2938
- function Gi(e, t) {
2939
- return Vi.find(
2924
+ function to(e, t) {
2925
+ return Qi.find(
2940
2926
  (n) => e.startsWith(n, t)
2941
2927
  );
2942
2928
  }
@@ -2951,7 +2937,7 @@ function ne(e) {
2951
2937
  const t = [];
2952
2938
  let n = 0, r = !1;
2953
2939
  for (; n < e.length; ) {
2954
- const i = Gi(e, n);
2940
+ const i = to(e, n);
2955
2941
  if (i) {
2956
2942
  if (r)
2957
2943
  return {
@@ -2963,7 +2949,7 @@ function ne(e) {
2963
2949
  continue;
2964
2950
  }
2965
2951
  const o = e[n];
2966
- if (!Bi.has(o))
2952
+ if (!Ji.has(o))
2967
2953
  return {
2968
2954
  ok: !1,
2969
2955
  code: "invalid_temporal_bucket_pattern",
@@ -2984,23 +2970,23 @@ function ne(e) {
2984
2970
  message: "Temporal bucket patterns cannot end with a separator."
2985
2971
  } : { ok: !0, segments: t };
2986
2972
  }
2987
- function Qi(e) {
2973
+ function no(e) {
2988
2974
  return e.flatMap(
2989
2975
  (t) => t.kind === "token" ? [t.value] : []
2990
2976
  );
2991
2977
  }
2992
- function Et(e, t) {
2978
+ function Ct(e, t) {
2993
2979
  return e.filter((n) => t.includes(n)).length === 1;
2994
2980
  }
2995
2981
  function ce(e, t) {
2996
2982
  return e.some((n) => t.includes(n));
2997
2983
  }
2998
- function Ji(e) {
2984
+ function ro(e) {
2999
2985
  return new Set(e).size !== e.length;
3000
2986
  }
3001
- function eo(e, t) {
3002
- if (Ji(e)) return !1;
3003
- const n = ["YYYY", "YY"], r = ["MMMM", "MMM", "MM"], a = ["HH", "mm", "ss"], i = Et(e, n), o = Et(e, r), s = e.includes("DD"), c = ce(e, a);
2987
+ function ao(e, t) {
2988
+ if (ro(e)) return !1;
2989
+ const n = ["YYYY", "YY"], r = ["MMMM", "MMM", "MM"], a = ["HH", "mm", "ss"], i = Ct(e, n), o = Ct(e, r), s = e.includes("DD"), c = ce(e, a);
3004
2990
  switch (t) {
3005
2991
  case "second":
3006
2992
  return e.includes("HH") && e.includes("mm") && e.includes("ss") && (!ce(e, [...n, ...r, "DD"]) || i && o && s);
@@ -3019,11 +3005,11 @@ function eo(e, t) {
3019
3005
  return i && !o && !s && !c;
3020
3006
  }
3021
3007
  }
3022
- function fn(e, t) {
3008
+ function yn(e, t) {
3023
3009
  if (e.presentation.mode === "auto")
3024
3010
  return { ok: !0 };
3025
3011
  if (e.presentation.mode === "preset") {
3026
- const r = mn[e.presentation.preset];
3012
+ const r = gn[e.presentation.preset];
3027
3013
  return r.includes(t) ? { ok: !0 } : {
3028
3014
  ok: !1,
3029
3015
  code: "incompatible_temporal_bucket_preset",
@@ -3031,8 +3017,8 @@ function fn(e, t) {
3031
3017
  };
3032
3018
  }
3033
3019
  const n = ne(e.presentation.pattern);
3034
- return n.ok ? eo(
3035
- Qi(n.segments),
3020
+ return n.ok ? ao(
3021
+ no(n.segments),
3036
3022
  t
3037
3023
  ) ? { ok: !0, segments: n.segments } : {
3038
3024
  ok: !1,
@@ -3040,21 +3026,21 @@ function fn(e, t) {
3040
3026
  message: `Pattern ${e.presentation.pattern} is not compatible with ${t} granularity.`
3041
3027
  } : n;
3042
3028
  }
3043
- function Rs(e, t) {
3029
+ function Bs(e, t) {
3044
3030
  if (!(!e || !t))
3045
- return fn(e, t).ok ? e : void 0;
3031
+ return yn(e, t).ok ? e : void 0;
3046
3032
  }
3047
- function to(e) {
3033
+ function io(e) {
3048
3034
  return e.preset ? { mode: "preset", preset: e.preset } : e.pattern ? { mode: "pattern", dialect: e.dialect ?? "semaphor_tokens", pattern: e.pattern } : { mode: "auto" };
3049
3035
  }
3050
- class A extends Error {
3036
+ class R extends Error {
3051
3037
  constructor(n, r) {
3052
3038
  super(r);
3053
3039
  $(this, "code");
3054
3040
  this.name = "RawTemporalFormatContractError", this.code = n;
3055
3041
  }
3056
3042
  }
3057
- const no = [
3043
+ const oo = [
3058
3044
  "SSSSSSSSS",
3059
3045
  "SSSSSSSS",
3060
3046
  "SSSSSSS",
@@ -3064,7 +3050,7 @@ const no = [
3064
3050
  "SSS",
3065
3051
  "SS",
3066
3052
  "S"
3067
- ], ro = [
3053
+ ], so = [
3068
3054
  "yyyy",
3069
3055
  "MMMM",
3070
3056
  "LLLL",
@@ -3086,7 +3072,7 @@ const no = [
3086
3072
  "m",
3087
3073
  "s",
3088
3074
  "a"
3089
- ], ao = /* @__PURE__ */ new Set([
3075
+ ], co = /* @__PURE__ */ new Set([
3090
3076
  "HH",
3091
3077
  "H",
3092
3078
  "hh",
@@ -3096,18 +3082,18 @@ const no = [
3096
3082
  "ss",
3097
3083
  "s",
3098
3084
  "a",
3099
- ...no
3100
- ]), io = /* @__PURE__ */ new Set(["zzz", "XXX"]), Ce = /* @__PURE__ */ new Set(["short", "medium", "long"]);
3085
+ ...oo
3086
+ ]), uo = /* @__PURE__ */ new Set(["zzz", "XXX"]), Pe = /* @__PURE__ */ new Set(["short", "medium", "long"]);
3101
3087
  function M(e, t) {
3102
3088
  return Object.keys(e).length === t.length && t.every((r) => r in e);
3103
3089
  }
3104
3090
  function g(e) {
3105
- throw new A(
3091
+ throw new R(
3106
3092
  "invalid_raw_temporal_format",
3107
3093
  e
3108
3094
  );
3109
3095
  }
3110
- function dn(e) {
3096
+ function wn(e) {
3111
3097
  if (!e || e.trim() !== e || e.length > 256)
3112
3098
  return g(
3113
3099
  "date_fns patterns must be non-empty, trimmed, and at most 256 characters."
@@ -3154,7 +3140,7 @@ function dn(e) {
3154
3140
  }), r = o;
3155
3141
  continue;
3156
3142
  }
3157
- const a = ro.find(
3143
+ const a = so.find(
3158
3144
  (o) => e.startsWith(o, r)
3159
3145
  );
3160
3146
  if (a) {
@@ -3170,16 +3156,16 @@ function dn(e) {
3170
3156
  }
3171
3157
  return t.some((a) => a.kind === "token") ? t : g("date_fns patterns must contain at least one token.");
3172
3158
  }
3173
- function hn(e, t) {
3159
+ function pn(e, t) {
3174
3160
  if (e === "semaphor_tokens") {
3175
3161
  const n = ne(t);
3176
3162
  n.ok || g(n.message);
3177
3163
  return;
3178
3164
  }
3179
- dn(t);
3165
+ wn(t);
3180
3166
  }
3181
- function oo(e) {
3182
- return !T(e) || !M(e, ["dateStyle", "dateTime"]) ? g("Automatic raw temporal styles are incomplete.") : Ce.has(e.dateStyle) ? !T(e.dateTime) || !M(e.dateTime, ["dateStyle", "timeStyle"]) || !Ce.has(e.dateTime.dateStyle) || !Ce.has(e.dateTime.timeStyle) ? g(
3167
+ function lo(e) {
3168
+ return !T(e) || !M(e, ["dateStyle", "dateTime"]) ? g("Automatic raw temporal styles are incomplete.") : Pe.has(e.dateStyle) ? !T(e.dateTime) || !M(e.dateTime, ["dateStyle", "timeStyle"]) || !Pe.has(e.dateTime.dateStyle) || !Pe.has(e.dateTime.timeStyle) ? g(
3183
3169
  "Automatic dateTime styles are incomplete or invalid."
3184
3170
  ) : {
3185
3171
  dateStyle: e.dateStyle,
@@ -3189,7 +3175,7 @@ function oo(e) {
3189
3175
  }
3190
3176
  } : g("Automatic dateStyle is invalid.");
3191
3177
  }
3192
- function Ge(e) {
3178
+ function Qe(e) {
3193
3179
  const t = ["type", "locale", "calendarTimezone", "presentation"], n = [...t, "sourceTimezone"];
3194
3180
  if (!T(e) || !M(e, t) && !M(e, n) || e.type !== "raw_temporal")
3195
3181
  return g("Resolved raw temporal format has an invalid shape.");
@@ -3205,11 +3191,11 @@ function Ge(e) {
3205
3191
  ...e.sourceTimezone ? { sourceTimezone: e.sourceTimezone } : {},
3206
3192
  presentation: {
3207
3193
  mode: "auto",
3208
- styles: oo(e.presentation.styles)
3194
+ styles: lo(e.presentation.styles)
3209
3195
  }
3210
3196
  } : g(
3211
3197
  "Automatic raw temporal presentation has unknown fields."
3212
- ) : e.presentation.mode === "preset" ? !M(e.presentation, ["mode", "preset"]) || !Tn(e.presentation.preset) ? g("Preset raw temporal presentation has an invalid shape.") : {
3198
+ ) : e.presentation.mode === "preset" ? !M(e.presentation, ["mode", "preset"]) || !vn(e.presentation.preset) ? g("Preset raw temporal presentation has an invalid shape.") : {
3213
3199
  type: "raw_temporal",
3214
3200
  locale: r,
3215
3201
  calendarTimezone: e.calendarTimezone,
@@ -3217,7 +3203,7 @@ function Ge(e) {
3217
3203
  presentation: { mode: "preset", preset: e.presentation.preset }
3218
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(
3219
3205
  "Pattern raw temporal presentation has an invalid shape."
3220
- ) : (hn(e.presentation.dialect, e.presentation.pattern), {
3206
+ ) : (pn(e.presentation.dialect, e.presentation.pattern), {
3221
3207
  type: "raw_temporal",
3222
3208
  locale: r,
3223
3209
  calendarTimezone: e.calendarTimezone,
@@ -3229,7 +3215,7 @@ function Ge(e) {
3229
3215
  }
3230
3216
  }) : g("Raw temporal presentation must be an object.") : g("Raw temporal locale is invalid or unsupported.");
3231
3217
  }
3232
- function gn(e) {
3218
+ function Tn(e) {
3233
3219
  var s, c, u;
3234
3220
  if (e.format) {
3235
3221
  if (!T(e.format))
@@ -3250,14 +3236,14 @@ function gn(e) {
3250
3236
  "Automatic authored raw temporal format has unknown fields."
3251
3237
  );
3252
3238
  } else if (f.mode === "preset") {
3253
- if (!M(f, ["mode", "preset"]) || !Tn(f.preset))
3239
+ if (!M(f, ["mode", "preset"]) || !vn(f.preset))
3254
3240
  return g("Authored raw temporal preset has an invalid shape.");
3255
3241
  } else {
3256
3242
  if (f.mode !== "pattern" || !M(f, ["mode", "dialect", "pattern"]) || f.dialect !== "semaphor_tokens" && f.dialect !== "date_fns" || typeof f.pattern != "string")
3257
3243
  return g(
3258
3244
  "Authored raw temporal pattern has an invalid shape."
3259
3245
  );
3260
- hn(f.dialect, f.pattern);
3246
+ pn(f.dialect, f.pattern);
3261
3247
  }
3262
3248
  }
3263
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;
@@ -3276,21 +3262,21 @@ function gn(e) {
3276
3262
  }
3277
3263
  }
3278
3264
  };
3279
- return Ge(o);
3265
+ return Qe(o);
3280
3266
  }
3281
- function Ls(e) {
3267
+ function Ks(e) {
3282
3268
  const t = /* @__PURE__ */ new Set();
3283
3269
  let n = !1;
3284
3270
  for (const r of e.values) {
3285
3271
  if (r === null) continue;
3286
3272
  n = !0;
3287
- const a = Vn(r);
3273
+ const a = Gn(r);
3288
3274
  a && t.add(a);
3289
3275
  }
3290
3276
  if (!n) return { status: "empty" };
3291
3277
  if (t.size === 0) return { status: "invalid_only" };
3292
3278
  if (t.size > 1)
3293
- throw new A(
3279
+ throw new R(
3294
3280
  "mixed_sql_temporal_semantics",
3295
3281
  `Declared SQL temporal column "${e.columnKey}" mixes date, wall-datetime, or instant semantics. Normalize it to one kind.`
3296
3282
  );
@@ -3302,7 +3288,7 @@ function Ls(e) {
3302
3288
  }
3303
3289
  };
3304
3290
  }
3305
- function Ws(e) {
3291
+ function Gs(e) {
3306
3292
  return {
3307
3293
  version: 1,
3308
3294
  columns: Object.fromEntries(
@@ -3313,9 +3299,9 @@ function Ws(e) {
3313
3299
  )
3314
3300
  };
3315
3301
  }
3316
- function so(e) {
3302
+ function mo(e) {
3317
3303
  if (!T(e) || e.version !== 1 || !T(e.columns) || Object.keys(e).some((r) => r !== "version" && r !== "columns"))
3318
- throw new A(
3304
+ throw new R(
3319
3305
  "invalid_raw_temporal_format",
3320
3306
  "Raw temporal chunk classification evidence is malformed."
3321
3307
  );
@@ -3328,7 +3314,7 @@ function so(e) {
3328
3314
  ]);
3329
3315
  for (const [r, a] of Object.entries(e.columns)) {
3330
3316
  if (!r.trim() || !n.has(a))
3331
- throw new A(
3317
+ throw new R(
3332
3318
  "invalid_raw_temporal_format",
3333
3319
  "Raw temporal chunk classification evidence contains an invalid column or status."
3334
3320
  );
@@ -3336,13 +3322,13 @@ function so(e) {
3336
3322
  }
3337
3323
  return { version: 1, columns: t };
3338
3324
  }
3339
- function js(e) {
3325
+ function Qs(e) {
3340
3326
  if (e.length === 0) return;
3341
- const t = e.map(so), n = Object.keys(t[0].columns).sort();
3327
+ const t = e.map(mo), n = Object.keys(t[0].columns).sort();
3342
3328
  for (let r = 1; r < t.length; r += 1) {
3343
3329
  const a = Object.keys(t[r].columns).sort();
3344
3330
  if (a.length !== n.length || a.some((i, o) => i !== n[o]))
3345
- throw new A(
3331
+ throw new R(
3346
3332
  "invalid_raw_temporal_format",
3347
3333
  "Raw temporal chunk classification evidence has inconsistent columns."
3348
3334
  );
@@ -3353,23 +3339,23 @@ function js(e) {
3353
3339
  (i) => i !== "empty" && i !== "invalid_only"
3354
3340
  )
3355
3341
  ).size > 1)
3356
- throw new A(
3342
+ throw new R(
3357
3343
  "mixed_sql_temporal_semantics",
3358
3344
  `Declared SQL temporal column "${r}" has inconsistent semantics across export chunks. Normalize it to one kind.`
3359
3345
  );
3360
3346
  }
3361
- function We(e) {
3347
+ function je(e) {
3362
3348
  const t = /* @__PURE__ */ new Date(0);
3363
3349
  return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(e.hour, e.minute, e.second, 0), t;
3364
3350
  }
3365
- function Qe(e, t) {
3351
+ function Je(e, t) {
3366
3352
  const n = e.fraction ? `.${e.fraction.padEnd(3, "0").slice(0, 3)}` : "";
3367
3353
  return te(
3368
3354
  `${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}T${String(e.hour).padStart(2, "0")}:${String(e.minute).padStart(2, "0")}:${String(e.second).padStart(2, "0")}${n}`,
3369
3355
  t
3370
3356
  );
3371
3357
  }
3372
- function yn(e, t) {
3358
+ function xn(e, t) {
3373
3359
  const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
3374
3360
  let a, i, o, s;
3375
3361
  return {
@@ -3454,7 +3440,7 @@ function yn(e, t) {
3454
3440
  }
3455
3441
  };
3456
3442
  }
3457
- function co(e, t, n, r, a) {
3443
+ function fo(e, t, n, r, a) {
3458
3444
  if (/^S{1,9}$/.test(e)) {
3459
3445
  const i = t.fraction.padEnd(e.length, "0").slice(0, e.length);
3460
3446
  return r.number(Number(i), e.length);
@@ -3515,47 +3501,47 @@ function co(e, t, n, r, a) {
3515
3501
  );
3516
3502
  }
3517
3503
  }
3518
- function uo(e, t, n, r) {
3519
- const a = We(t);
3504
+ function ho(e, t, n, r) {
3505
+ const a = je(t);
3520
3506
  return e.map(
3521
- (i) => i.kind === "literal" ? i.value : co(i.value, t, a, n, r)
3507
+ (i) => i.kind === "literal" ? i.value : fo(i.value, t, a, n, r)
3522
3508
  ).join("");
3523
3509
  }
3524
- function pn(e, t, n) {
3525
- const r = t === "date_fns" ? dn(n) : (() => {
3510
+ function Dn(e, t, n) {
3511
+ const r = t === "date_fns" ? wn(n) : (() => {
3526
3512
  const i = ne(n);
3527
3513
  return i.ok ? i.segments : g(i.message);
3528
3514
  })(), a = r.filter((i) => i.kind === "token").map((i) => i.value);
3529
- return e === "date" && a.some((i) => ao.has(i)) ? g("Date patterns cannot contain time tokens.") : e !== "instant" && a.some((i) => io.has(i)) ? g("Timezone pattern tokens require an instant value.") : r;
3515
+ return e === "date" && a.some((i) => co.has(i)) ? g("Date patterns cannot contain time tokens.") : e !== "instant" && a.some((i) => uo.has(i)) ? g("Timezone pattern tokens require an instant value.") : r;
3530
3516
  }
3531
- function lo(e) {
3532
- pn(
3517
+ function go(e) {
3518
+ Dn(
3533
3519
  e.valueKind ?? "instant",
3534
3520
  e.dialect,
3535
3521
  e.pattern
3536
3522
  );
3537
3523
  }
3538
- function mo(e, t, n, r) {
3539
- const a = pn(
3524
+ function yo(e, t, n, r) {
3525
+ const a = Dn(
3540
3526
  e.valueKind,
3541
3527
  n,
3542
3528
  r
3543
- ), i = yn(t.locale, t.calendarTimezone);
3529
+ ), i = xn(t.locale, t.calendarTimezone);
3544
3530
  return (o) => {
3545
- const s = e.valueKind === "wall_datetime" && t.sourceTimezone ? Qe(o.fields, t.sourceTimezone) : void 0, c = e.valueKind === "instant" ? {
3531
+ const s = e.valueKind === "wall_datetime" && t.sourceTimezone ? Je(o.fields, t.sourceTimezone) : void 0, c = e.valueKind === "instant" ? {
3546
3532
  ...i.instantFields(o.instant),
3547
3533
  fraction: o.fields.fraction
3548
3534
  } : s ? {
3549
3535
  ...i.instantFields(s),
3550
3536
  fraction: o.fields.fraction
3551
3537
  } : o.fields;
3552
- return uo(a, c, i, o.instant ?? s);
3538
+ return ho(a, c, i, o.instant ?? s);
3553
3539
  };
3554
3540
  }
3555
- function wn(e, t) {
3556
- const n = yn(t.locale, t.calendarTimezone);
3541
+ function bn(e, t) {
3542
+ const n = xn(t.locale, t.calendarTimezone);
3557
3543
  return (r) => {
3558
- const a = e.valueKind === "instant" ? n.instantFields(r.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? n.instantFields(Qe(r.fields, t.sourceTimezone)) : r.fields;
3544
+ const a = e.valueKind === "instant" ? n.instantFields(r.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? n.instantFields(Je(r.fields, t.sourceTimezone)) : r.fields;
3559
3545
  return {
3560
3546
  year: a.year,
3561
3547
  month: a.month,
@@ -3566,12 +3552,12 @@ function wn(e, t) {
3566
3552
  };
3567
3553
  };
3568
3554
  }
3569
- const fo = /* @__PURE__ */ new Set(["short", "long", "numeric", "iso"]);
3570
- function Tn(e) {
3571
- return typeof e == "string" && fo.has(e);
3555
+ const wo = /* @__PURE__ */ new Set(["short", "long", "numeric", "iso"]);
3556
+ function vn(e) {
3557
+ return typeof e == "string" && wo.has(e);
3572
3558
  }
3573
- function ho(e, t, n) {
3574
- const r = wn(e, t), a = e.valueKind !== "date", i = (s, c = 2) => String(s).padStart(c, "0");
3559
+ function po(e, t, n) {
3560
+ const r = bn(e, t), a = e.valueKind !== "date", i = (s, c = 2) => String(s).padStart(c, "0");
3575
3561
  if (n === "iso")
3576
3562
  return (s) => {
3577
3563
  const c = r(s), u = `${i(c.year, 4)}-${i(c.month)}-${i(c.day)}`;
@@ -3590,7 +3576,7 @@ function ho(e, t, n) {
3590
3576
  return u.setUTCFullYear(c.year, c.month - 1, c.day), u.setUTCHours(c.hour, c.minute, c.second, 0), o.format(u);
3591
3577
  };
3592
3578
  }
3593
- function go(e, t) {
3579
+ function To(e, t) {
3594
3580
  const n = t.presentation.mode === "auto" ? t.presentation.styles : g("Automatic raw temporal formatting requires styles.");
3595
3581
  if (e.valueKind === "date") {
3596
3582
  const o = new Intl.DateTimeFormat(t.locale, {
@@ -3598,7 +3584,7 @@ function go(e, t) {
3598
3584
  timeZone: "UTC",
3599
3585
  dateStyle: n.dateStyle
3600
3586
  });
3601
- return (s) => o.format(We(s.fields));
3587
+ return (s) => o.format(je(s.fields));
3602
3588
  }
3603
3589
  const r = e.valueKind === "instant", a = !r && n.dateTime.timeStyle === "long" ? "medium" : n.dateTime.timeStyle, i = new Intl.DateTimeFormat(t.locale, {
3604
3590
  calendar: "gregory",
@@ -3606,9 +3592,9 @@ function go(e, t) {
3606
3592
  dateStyle: n.dateTime.dateStyle,
3607
3593
  timeStyle: a
3608
3594
  });
3609
- return (o) => r ? i.format(o.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? i.format(Qe(o.fields, t.sourceTimezone)) : i.format(We(o.fields));
3595
+ return (o) => r ? i.format(o.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? i.format(Je(o.fields, t.sourceTimezone)) : i.format(je(o.fields));
3610
3596
  }
3611
- function Ct(e, t, n) {
3597
+ function Pt(e, t, n) {
3612
3598
  return {
3613
3599
  ok: !1,
3614
3600
  text: e,
@@ -3618,18 +3604,18 @@ function Ct(e, t, n) {
3618
3604
  }
3619
3605
  };
3620
3606
  }
3621
- function Dn(e) {
3622
- const t = Zn(e.metadata), n = Ge(e.format), r = n.presentation.mode === "auto" ? go(t, n) : n.presentation.mode === "preset" ? ho(t, n, n.presentation.preset) : mo(
3607
+ function Sn(e) {
3608
+ const t = Bn(e.metadata), n = Qe(e.format), r = n.presentation.mode === "auto" ? To(t, n) : n.presentation.mode === "preset" ? po(t, n, n.presentation.preset) : yo(
3623
3609
  t,
3624
3610
  n,
3625
3611
  n.presentation.dialect,
3626
3612
  n.presentation.pattern
3627
- ), a = wn(t, n);
3613
+ ), a = bn(t, n);
3628
3614
  return (i) => {
3629
3615
  if (i === null)
3630
3616
  return { ok: !0, text: "", status: "empty" };
3631
3617
  const o = Kn(i, t.valueKind);
3632
- return o.status === "invalid_shape" ? Ct(i, t, "invalid_raw_temporal_value") : o.status === "out_of_range" ? Ct(i, t, "out_of_range_raw_temporal_value") : {
3618
+ return o.status === "invalid_shape" ? Pt(i, t, "invalid_raw_temporal_value") : o.status === "out_of_range" ? Pt(i, t, "out_of_range_raw_temporal_value") : {
3633
3619
  ok: !0,
3634
3620
  text: r(o),
3635
3621
  status: "formatted",
@@ -3637,17 +3623,17 @@ function Dn(e) {
3637
3623
  };
3638
3624
  };
3639
3625
  }
3640
- function yo(e) {
3641
- return Dn({
3626
+ function xo(e) {
3627
+ return Sn({
3642
3628
  metadata: e.metadata,
3643
3629
  format: e.format
3644
3630
  })(e.value);
3645
3631
  }
3646
- function po(e) {
3647
- const t = gn({ format: e.authored, preferences: e.preferences, calendar: e.calendar });
3648
- return { format: t, formatValue: Dn({ metadata: e.metadata, format: t }) };
3632
+ function Do(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 }) };
3649
3635
  }
3650
- const wo = {
3636
+ const bo = {
3651
3637
  dateStyle: "short",
3652
3638
  dateTime: { dateStyle: "short", timeStyle: "short" }
3653
3639
  };
@@ -3658,7 +3644,7 @@ class fe extends Error {
3658
3644
  this.name = "TemporalBucketContractError", this.code = n;
3659
3645
  }
3660
3646
  }
3661
- const To = [
3647
+ const vo = [
3662
3648
  "Jan",
3663
3649
  "Feb",
3664
3650
  "Mar",
@@ -3671,7 +3657,7 @@ const To = [
3671
3657
  "Oct",
3672
3658
  "Nov",
3673
3659
  "Dec"
3674
- ], Do = [
3660
+ ], So = [
3675
3661
  "January",
3676
3662
  "February",
3677
3663
  "March",
@@ -3685,19 +3671,19 @@ const To = [
3685
3671
  "November",
3686
3672
  "December"
3687
3673
  ];
3688
- function Pe(e) {
3674
+ function Ye(e) {
3689
3675
  return {
3690
3676
  ok: !1,
3691
3677
  error: { code: "invalid_temporal_bucket_value", message: e }
3692
3678
  };
3693
3679
  }
3694
- function xo(e) {
3680
+ function Mo(e) {
3695
3681
  return e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0);
3696
3682
  }
3697
- function bo(e, t) {
3698
- return t === 2 ? xo(e) ? 29 : 28 : [4, 6, 9, 11].includes(t) ? 30 : 31;
3683
+ function ko(e, t) {
3684
+ return t === 2 ? Mo(e) ? 29 : 28 : [4, 6, 9, 11].includes(t) ? 30 : 31;
3699
3685
  }
3700
- function vo(e, t, n) {
3686
+ function _o(e, t, n) {
3701
3687
  const r = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4], a = t < 3 ? e - 1 : e;
3702
3688
  return (a + Math.floor(a / 4) - Math.floor(a / 100) + Math.floor(a / 400) + r[t - 1] + n) % 7;
3703
3689
  }
@@ -3705,10 +3691,10 @@ function Se(e) {
3705
3691
  var t;
3706
3692
  return (t = e.calendar.fiscalCalendar) == null ? void 0 : t.yearStartMonth;
3707
3693
  }
3708
- function So(e, t) {
3694
+ function No(e, t) {
3709
3695
  return (e - t + 12) % 12 % 3 === 0;
3710
3696
  }
3711
- function Mo(e, t) {
3697
+ function $o(e, t) {
3712
3698
  const { granularity: n } = t, r = Se(t) ?? 1;
3713
3699
  switch (n) {
3714
3700
  case "second":
@@ -3720,20 +3706,20 @@ function Mo(e, t) {
3720
3706
  case "day":
3721
3707
  return !0;
3722
3708
  case "week":
3723
- return vo(e.year, e.month, e.day) === t.calendar.weekStart;
3709
+ return _o(e.year, e.month, e.day) === t.calendar.weekStart;
3724
3710
  case "month":
3725
3711
  return e.day === 1;
3726
3712
  case "quarter":
3727
- return e.day === 1 && So(e.month, r);
3713
+ return e.day === 1 && No(e.month, r);
3728
3714
  case "year":
3729
3715
  return e.day === 1 && e.month === r;
3730
3716
  }
3731
3717
  }
3732
- function xn(e, t) {
3718
+ function Me(e, t) {
3733
3719
  if (e === null) return { ok: !0, value: null };
3734
3720
  const n = t.granularity === "second" || t.granularity === "minute" || t.granularity === "hour", r = n ? /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/.exec(e) : /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
3735
3721
  if (!r)
3736
- return Pe(
3722
+ return Ye(
3737
3723
  `Expected ${n ? "YYYY-MM-DDTHH:mm:ss" : "YYYY-MM-DD"} for ${t.granularity} granularity.`
3738
3724
  );
3739
3725
  const a = {
@@ -3744,17 +3730,42 @@ function xn(e, t) {
3744
3730
  minute: n ? Number(r[5]) : 0,
3745
3731
  second: n ? Number(r[6]) : 0
3746
3732
  };
3747
- return a.year < 1 || a.month < 1 || a.month > 12 || a.day < 1 || a.day > bo(a.year, a.month) || a.hour > 23 || a.minute > 59 || a.second > 59 ? Pe(`Invalid canonical ${t.granularity} bucket value ${e}.`) : Mo(a, t) ? { ok: !0, value: a } : Pe(
3733
+ return a.year < 1 || a.month < 1 || a.month > 12 || a.day < 1 || a.day > ko(a.year, a.month) || a.hour > 23 || a.minute > 59 || a.second > 59 ? Ye(`Invalid canonical ${t.granularity} bucket value ${e}.`) : $o(a, t) ? { ok: !0, value: a } : Ye(
3748
3734
  `Canonical value ${e} is not aligned to ${t.granularity} granularity and its governed Calendar.`
3749
3735
  );
3750
3736
  }
3751
- function Hs(e) {
3737
+ const Yt = (e) => `${x(e.year, 4)}-${x(e.month)}-${x(e.day)}`;
3738
+ function Js(e, t, n) {
3739
+ const r = Me(e, t);
3740
+ if (!r.ok || !r.value) return;
3741
+ const a = qt({ ...r.value, millisecond: 0 }, n.amount, n.unit), { granularity: i } = t;
3742
+ if (i === "second" || i === "minute" || i === "hour") {
3743
+ const o = {
3744
+ ...a,
3745
+ second: i === "second" ? a.second : 0,
3746
+ minute: i === "hour" ? 0 : a.minute
3747
+ };
3748
+ return `${Yt(o)}T${x(o.hour)}:${x(o.minute)}:${x(o.second)}`;
3749
+ }
3750
+ return Yt(Qn(a, i, t.calendar));
3751
+ }
3752
+ function ec(e, t) {
3753
+ const n = Me(e, t);
3754
+ if (!n.ok || !n.value) return;
3755
+ const r = { ...n.value, millisecond: 0 }, a = t.calendar.tz;
3756
+ return {
3757
+ startInclusive: at(r, a).toISOString(),
3758
+ endExclusive: at(qt(r, 1, t.granularity), a).toISOString(),
3759
+ timezone: a
3760
+ };
3761
+ }
3762
+ function tc(e) {
3752
3763
  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`];
3753
3764
  t === "week" && a.push(`weeks starting on ${r({ weekday: "long" }, new Date(Date.UTC(2023, 0, 1 + n.weekStart)))}`);
3754
3765
  const i = Se(e);
3755
3766
  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`;
3756
3767
  }
3757
- function bn(e) {
3768
+ function Mn(e) {
3758
3769
  if (!T(e))
3759
3770
  return {
3760
3771
  ok: !1,
@@ -3775,7 +3786,7 @@ function bn(e) {
3775
3786
  message: `Unknown property "${c}".`
3776
3787
  });
3777
3788
  if (o === "preset")
3778
- Xi(r.preset) || t.push({ path: "presentation.preset", message: "Expected a supported preset." });
3789
+ eo(r.preset) || t.push({ path: "presentation.preset", message: "Expected a supported preset." });
3779
3790
  else if (o === "pattern")
3780
3791
  if (typeof r.pattern != "string" || !r.pattern)
3781
3792
  t.push({ path: "presentation.pattern", message: "Expected a non-empty pattern." });
@@ -3841,18 +3852,18 @@ function bn(e) {
3841
3852
  }
3842
3853
  };
3843
3854
  }
3844
- function ko(e, t) {
3855
+ function Eo(e, t) {
3845
3856
  const n = !!t.calendar.fiscalCalendar;
3846
- return e === "fiscal_quarter_short" || e === "fiscal_year" ? n : e === "quarter_short" || e === "quarter_long" || _n(e) && (t.granularity === "quarter" || t.granularity === "year") ? !n : !0;
3857
+ 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;
3847
3858
  }
3848
- function vn(e, t) {
3849
- return fn(e, t.granularity).ok ? e.presentation.mode === "preset" ? ko(e.presentation.preset, t) : !(e.presentation.mode === "pattern" && t.calendar.fiscalCalendar && (t.granularity === "quarter" || t.granularity === "year")) : !1;
3859
+ function kn(e, t) {
3860
+ 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;
3850
3861
  }
3851
- function Pt(e, t) {
3862
+ function zt(e, t) {
3852
3863
  if (!(!e || e.presentation.mode === "auto"))
3853
- return vn(e, t) ? { type: "temporal_bucket", presentation: e.presentation } : void 0;
3864
+ return kn(e, t) ? { type: "temporal_bucket", presentation: e.presentation } : void 0;
3854
3865
  }
3855
- function Sn(e) {
3866
+ function _n(e) {
3856
3867
  var a;
3857
3868
  const t = Q(e.locale);
3858
3869
  if (!t)
@@ -3860,28 +3871,28 @@ function Sn(e) {
3860
3871
  "invalid_temporal_bucket_format",
3861
3872
  "Temporal bucket locale must be a supported base BCP 47 locale."
3862
3873
  );
3863
- const n = Pt(e.cardFormat, e.metadata);
3874
+ const n = zt(e.cardFormat, e.metadata);
3864
3875
  if (n)
3865
3876
  return { format: { ...n, locale: t }, source: "card" };
3866
- const r = ((a = e.semanticFormat) == null ? void 0 : a.granularity) === e.metadata.granularity ? Pt(e.semanticFormat.format, e.metadata) : void 0;
3877
+ const r = ((a = e.semanticFormat) == null ? void 0 : a.granularity) === e.metadata.granularity ? zt(e.semanticFormat.format, e.metadata) : void 0;
3867
3878
  return r ? { format: { ...r, locale: t }, source: "semantic" } : {
3868
3879
  format: {
3869
3880
  type: "temporal_bucket",
3870
3881
  locale: t,
3871
3882
  presentation: {
3872
3883
  mode: "auto",
3873
- styles: e.styles ?? wo
3884
+ styles: e.styles ?? bo
3874
3885
  }
3875
3886
  },
3876
3887
  source: "automatic"
3877
3888
  };
3878
3889
  }
3879
- function D(e, t = 2) {
3890
+ function x(e, t = 2) {
3880
3891
  return String(e).padStart(t, "0");
3881
3892
  }
3882
- function X(e, t, n) {
3893
+ function K(e, t, n) {
3883
3894
  if (t === "en-US")
3884
- return (n === "short" ? To : Do)[e - 1];
3895
+ return (n === "short" ? vo : So)[e - 1];
3885
3896
  const r = new Date(Date.UTC(2e3, e - 1, 15));
3886
3897
  return new Intl.DateTimeFormat(t, {
3887
3898
  calendar: "gregory",
@@ -3889,50 +3900,50 @@ function X(e, t, n) {
3889
3900
  timeZone: "UTC"
3890
3901
  }).format(r);
3891
3902
  }
3892
- function _o(e, t, n) {
3903
+ function Io(e, t, n) {
3893
3904
  return t.map((r) => {
3894
3905
  if (r.kind === "literal") return r.value;
3895
3906
  switch (r.value) {
3896
3907
  case "YYYY":
3897
- return D(e.year, 4);
3908
+ return x(e.year, 4);
3898
3909
  case "YY":
3899
- return D(e.year % 100);
3910
+ return x(e.year % 100);
3900
3911
  case "MMMM":
3901
- return X(e.month, n, "long");
3912
+ return K(e.month, n, "long");
3902
3913
  case "MMM":
3903
- return X(e.month, n, "short");
3914
+ return K(e.month, n, "short");
3904
3915
  case "MM":
3905
- return D(e.month);
3916
+ return x(e.month);
3906
3917
  case "DD":
3907
- return D(e.day);
3918
+ return x(e.day);
3908
3919
  case "HH":
3909
- return D(e.hour);
3920
+ return x(e.hour);
3910
3921
  case "mm":
3911
- return D(e.minute);
3922
+ return x(e.minute);
3912
3923
  case "ss":
3913
- return D(e.second);
3924
+ return x(e.second);
3914
3925
  }
3915
3926
  }).join("");
3916
3927
  }
3917
- const Yt = /* @__PURE__ */ new Map();
3928
+ const At = /* @__PURE__ */ new Map();
3918
3929
  function Y(e, t) {
3919
- const n = `${e}:${JSON.stringify(t)}`, r = Yt.get(n);
3930
+ const n = `${e}:${JSON.stringify(t)}`, r = At.get(n);
3920
3931
  if (r) return r;
3921
3932
  const a = new Intl.DateTimeFormat(e, t);
3922
- return Yt.set(n, a), a;
3933
+ return At.set(n, a), a;
3923
3934
  }
3924
3935
  function G(e) {
3925
3936
  const t = /* @__PURE__ */ new Date(0);
3926
3937
  return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(e.hour, e.minute, e.second, 0), t;
3927
3938
  }
3928
- function zt(e, t, n) {
3939
+ function Rt(e, t, n) {
3929
3940
  return Y(t, {
3930
3941
  calendar: "gregory",
3931
3942
  dateStyle: n,
3932
3943
  timeZone: "UTC"
3933
3944
  }).format(G(e));
3934
3945
  }
3935
- function No(e, t, n) {
3946
+ function Oo(e, t, n) {
3936
3947
  return Y(t, {
3937
3948
  calendar: "gregory",
3938
3949
  dateStyle: n.dateStyle,
@@ -3942,7 +3953,7 @@ function No(e, t, n) {
3942
3953
  timeZone: "UTC"
3943
3954
  }).format(G(e));
3944
3955
  }
3945
- function $o(e, t, n) {
3956
+ function Fo(e, t, n) {
3946
3957
  var a;
3947
3958
  if (n === "short") {
3948
3959
  const i = G(e), o = Y(t, {
@@ -3967,20 +3978,20 @@ function $o(e, t, n) {
3967
3978
  year: "numeric"
3968
3979
  }).format(G(e));
3969
3980
  }
3970
- function Mn(e, t) {
3981
+ function Nn(e, t) {
3971
3982
  return Math.floor((e.month - t + 12) % 12 / 3) + 1;
3972
3983
  }
3973
3984
  function Ut(e, t) {
3974
3985
  return t === 1 || e.month < t ? e.year : e.year + 1;
3975
3986
  }
3976
- function kn(e) {
3987
+ function $n(e) {
3977
3988
  return e === 1 ? "1st" : e === 2 ? "2nd" : e === 3 ? "3rd" : `${e}th`;
3978
3989
  }
3979
- function _n(e) {
3990
+ function En(e) {
3980
3991
  return e === "short" || e === "long" || e === "numeric" || e === "iso";
3981
3992
  }
3982
- function Ye(e, t, n) {
3983
- return t === "iso" ? `${D(e.year, 4)}-${D(e.month)}-${D(e.day)}` : Y(n, {
3993
+ function ze(e, t, n) {
3994
+ return t === "iso" ? `${x(e.year, 4)}-${x(e.month)}-${x(e.day)}` : Y(n, {
3984
3995
  calendar: "gregory",
3985
3996
  month: t === "numeric" ? "numeric" : t === "long" ? "long" : "short",
3986
3997
  day: "numeric",
@@ -3988,80 +3999,80 @@ function Ye(e, t, n) {
3988
3999
  timeZone: "UTC"
3989
4000
  }).format(G(e));
3990
4001
  }
3991
- function Fo(e, t, n, r) {
3992
- const a = Mn(e, 1);
4002
+ function Co(e, t, n, r) {
4003
+ const a = Nn(e, 1);
3993
4004
  switch (r) {
3994
4005
  case "week":
3995
- return t === "numeric" || t === "iso" ? Ye(e, t, n) : `Week of ${Ye(e, t, n)}`;
4006
+ return t === "numeric" || t === "iso" ? ze(e, t, n) : `Week of ${ze(e, t, n)}`;
3996
4007
  case "month":
3997
- return t === "iso" ? `${D(e.year, 4)}-${D(e.month)}` : t === "numeric" ? `${D(e.month)}/${D(e.year, 4)}` : `${X(e.month, n, t === "long" ? "long" : "short")} ${e.year}`;
4008
+ return t === "iso" ? `${x(e.year, 4)}-${x(e.month)}` : t === "numeric" ? `${x(e.month)}/${x(e.year, 4)}` : `${K(e.month, n, t === "long" ? "long" : "short")} ${e.year}`;
3998
4009
  case "quarter":
3999
- return t === "iso" ? `${D(e.year, 4)}-Q${a}` : t === "long" ? `${kn(a)} Quarter ${e.year}` : `Q${a} ${e.year}`;
4010
+ return t === "iso" ? `${x(e.year, 4)}-Q${a}` : t === "long" ? `${$n(a)} Quarter ${e.year}` : `Q${a} ${e.year}`;
4000
4011
  case "year":
4001
4012
  return String(e.year);
4002
4013
  default:
4003
- return Ye(e, t, n);
4014
+ return ze(e, t, n);
4004
4015
  }
4005
4016
  }
4006
- function je(e, t, n, r) {
4007
- if (_n(t))
4008
- return Fo(e, t, n, r.granularity);
4009
- const a = Se(r) ?? 1, i = Mn(e, a);
4017
+ function He(e, t, n, r) {
4018
+ if (En(t))
4019
+ return Co(e, t, n, r.granularity);
4020
+ const a = Se(r) ?? 1, i = Nn(e, a);
4010
4021
  switch (t) {
4011
4022
  case "week_of_short":
4012
- return `Week of ${X(e.month, n, "short")} ${e.day}, ${e.year}`;
4023
+ return `Week of ${K(e.month, n, "short")} ${e.day}, ${e.year}`;
4013
4024
  case "week_of_long":
4014
- return `Week of ${X(e.month, n, "long")} ${e.day}, ${e.year}`;
4025
+ return `Week of ${K(e.month, n, "long")} ${e.day}, ${e.year}`;
4015
4026
  case "quarter_short":
4016
4027
  return `Q${i} ${e.year}`;
4017
4028
  case "quarter_long":
4018
- return `${kn(i)} Quarter ${e.year}`;
4029
+ return `${$n(i)} Quarter ${e.year}`;
4019
4030
  case "fiscal_quarter_short":
4020
4031
  return `Q${i} FY${Ut(e, a)}`;
4021
4032
  case "fiscal_year":
4022
4033
  return `FY${Ut(e, a)}`;
4023
4034
  }
4024
4035
  }
4025
- function Oo(e, t, n, r) {
4036
+ function Po(e, t, n, r) {
4026
4037
  const a = Se(t);
4027
4038
  switch (t.granularity) {
4028
4039
  case "second":
4029
4040
  case "minute":
4030
4041
  case "hour":
4031
- return No(e, n, r.dateTime);
4042
+ return Oo(e, n, r.dateTime);
4032
4043
  case "day":
4033
- return zt(e, n, r.dateStyle);
4044
+ return Rt(e, n, r.dateStyle);
4034
4045
  case "week":
4035
- return `Week of ${zt(e, n, r.dateStyle)}`;
4046
+ return `Week of ${Rt(e, n, r.dateStyle)}`;
4036
4047
  case "month":
4037
- return $o(e, n, r.dateStyle);
4048
+ return Fo(e, n, r.dateStyle);
4038
4049
  case "quarter":
4039
- return je(
4050
+ return He(
4040
4051
  e,
4041
4052
  a ? "fiscal_quarter_short" : "quarter_short",
4042
4053
  n,
4043
4054
  t
4044
4055
  );
4045
4056
  case "year":
4046
- return a ? je(e, "fiscal_year", n, t) : String(e.year);
4057
+ return a ? He(e, "fiscal_year", n, t) : String(e.year);
4047
4058
  }
4048
4059
  }
4049
- function qs(e, t) {
4060
+ function nc(e, t) {
4050
4061
  if (t.granularity !== "second" && t.granularity !== "minute" && t.granularity !== "hour" && t.granularity !== "day" && t.granularity !== "month")
4051
4062
  return;
4052
- const n = xn(e, t);
4063
+ const n = Me(e, t);
4053
4064
  if (!n.ok || n.value === null) return;
4054
4065
  const { year: r, month: a, day: i, hour: o, minute: s, second: c } = n.value;
4055
4066
  return { year: r, month: a, day: i, hour: o, minute: s, second: c };
4056
4067
  }
4057
- function Nn(e) {
4058
- const t = bn(e.format);
4059
- if (!t.ok || !vn(t.value, e.metadata))
4068
+ function In(e) {
4069
+ const t = Mn(e.format);
4070
+ if (!t.ok || !kn(t.value, e.metadata))
4060
4071
  throw new fe(
4061
4072
  "invalid_temporal_bucket_format",
4062
4073
  "Resolved temporal bucket format is invalid or inapplicable to its metadata."
4063
4074
  );
4064
- const n = xn(e.value, e.metadata);
4075
+ const n = Me(e.value, e.metadata);
4065
4076
  if (!n.ok)
4066
4077
  throw new fe(
4067
4078
  n.error.code,
@@ -4070,14 +4081,14 @@ function Nn(e) {
4070
4081
  if (n.value === null) return "(Blank)";
4071
4082
  const { presentation: r, locale: a } = t.value;
4072
4083
  if (r.mode === "auto")
4073
- return Oo(
4084
+ return Po(
4074
4085
  n.value,
4075
4086
  e.metadata,
4076
4087
  a,
4077
4088
  r.styles
4078
4089
  );
4079
4090
  if (r.mode === "preset")
4080
- return je(
4091
+ return He(
4081
4092
  n.value,
4082
4093
  r.preset,
4083
4094
  a,
@@ -4089,9 +4100,9 @@ function Nn(e) {
4089
4100
  "invalid_temporal_bucket_format",
4090
4101
  i.message
4091
4102
  );
4092
- return _o(n.value, i.segments, a);
4103
+ return Io(n.value, i.segments, a);
4093
4104
  }
4094
- function Io(e, t) {
4105
+ function Yo(e, t) {
4095
4106
  var a;
4096
4107
  const n = e[e.length - 1];
4097
4108
  if (!n) return "";
@@ -4099,21 +4110,21 @@ function Io(e, t) {
4099
4110
  const r = n.member.value;
4100
4111
  return r === null ? "(Blank)" : ((a = t == null ? void 0 : t.get(n.levelId)) == null ? void 0 : a(r)) ?? (typeof r == "object" ? r.value : String(r));
4101
4112
  }
4102
- function Eo(e, t, n) {
4103
- return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(Un).join(t)) ?? `${t} Total` : t;
4113
+ function zo(e, t, n) {
4114
+ return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(Ln).join(t)) ?? `${t} Total` : t;
4104
4115
  }
4105
- function Zs(e, t, n, r) {
4116
+ function rc(e, t, n, r) {
4106
4117
  var o;
4107
4118
  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;
4108
- return Eo(t, Io(e, r), i);
4119
+ return zo(t, Yo(e, r), i);
4109
4120
  }
4110
- function Ks(e, t, n) {
4121
+ function ac(e, t, n) {
4111
4122
  return e.kind === "value" ? (t == null ? void 0 : t(e.value)) ?? "" : e.kind === "null" ? n.nullText : n.emptyText;
4112
4123
  }
4113
- function Vs(e) {
4124
+ function ic(e) {
4114
4125
  const { path: t, previousPath: n, role: r, repeatLabels: a, levelCount: i } = e;
4115
4126
  return Array.from({ length: i }, (o, s) => {
4116
- const c = t.slice(0, s + 1), u = r === "grand_total" ? s === 0 : r === "subtotal" && s === t.length - 1, l = n && n.length > s && nt(n.slice(0, s + 1)) === nt(c);
4127
+ const c = t.slice(0, s + 1), u = r === "grand_total" ? s === 0 : r === "subtotal" && s === t.length - 1, l = n && n.length > s && rt(n.slice(0, s + 1)) === rt(c);
4117
4128
  return {
4118
4129
  path: c,
4119
4130
  total: u,
@@ -4121,42 +4132,42 @@ function Vs(e) {
4121
4132
  };
4122
4133
  });
4123
4134
  }
4124
- function Co(e) {
4125
- return (e == null ? void 0 : e.type) === "date" ? { type: "raw_temporal", timezone: e.timezone, sourceTimezone: e.sourceTimezone, presentation: to(e) } : void 0;
4135
+ function Ao(e) {
4136
+ return (e == null ? void 0 : e.type) === "date" ? { type: "raw_temporal", timezone: e.timezone, sourceTimezone: e.sourceTimezone, presentation: io(e) } : void 0;
4126
4137
  }
4127
- function Po(e, t) {
4128
- return Ii(Xe({ override: e, model: t }).format, {
4138
+ function Ro(e, t) {
4139
+ return Yi(Ge({ override: e, model: t }).format, {
4129
4140
  preserveOmittedProperties: !0,
4130
4141
  numericInput: "canonical"
4131
4142
  });
4132
4143
  }
4133
- function Bs(e, t, n) {
4144
+ function oc(e, t, n) {
4134
4145
  const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = (o, s) => {
4135
- const c = (s === "levels" ? t.levelFormats : t.measureFormats)[o.id], u = o.semanticFormat, l = Po(c, u);
4146
+ const c = (s === "levels" ? t.levelFormats : t.measureFormats)[o.id], u = o.semanticFormat, l = Ro(c, u);
4136
4147
  s === "measures" && r.set(o.id, {
4137
- isNumeric: zn(o.column.dataType) === "number",
4148
+ isNumeric: Un(o.column.dataType) === "number",
4138
4149
  // Use normalized affixes: a redundant percent suffix is already removed.
4139
4150
  hasTextAffixes: !!l && !!("prefix" in l && l.prefix || "suffix" in l && l.suffix)
4140
4151
  });
4141
- const f = (m) => ln(m, void 0, {
4152
+ const f = (m) => dn(m, void 0, {
4142
4153
  useFormattedValues: !0,
4143
4154
  timezone: n.calendar.tz,
4144
4155
  locale: n.valueFormat.locale,
4145
4156
  absence: t.absence
4146
4157
  });
4147
4158
  if (o.column.temporalBucket) {
4148
- const m = o.column.temporalBucket, h = Sn({
4159
+ const m = o.column.temporalBucket, h = _n({
4149
4160
  metadata: m,
4150
4161
  cardFormat: (c == null ? void 0 : c.type) === "temporal_bucket" ? c : void 0,
4151
4162
  semanticFormat: (u == null ? void 0 : u.type) === "temporal_bucket" ? { granularity: m.granularity, format: u } : void 0,
4152
4163
  locale: n.valueFormat.locale,
4153
4164
  styles: { dateStyle: n.valueFormat.dateStyle, dateTime: n.valueFormat.dateTime }
4154
4165
  });
4155
- return (d) => typeof d == "string" ? Nn({ value: d, metadata: m, format: h.format }) : f(d);
4166
+ return (d) => typeof d == "string" ? In({ value: d, metadata: m, format: h.format }) : f(d);
4156
4167
  }
4157
4168
  if (o.column.rawTemporal) {
4158
- const m = Xe({ override: c, model: u }).format, { formatValue: h } = po({
4159
- authored: Co(m),
4169
+ const m = Ge({ override: c, model: u }).format, { formatValue: h } = Do({
4170
+ authored: Ao(m),
4160
4171
  metadata: o.column.rawTemporal,
4161
4172
  preferences: n.valueFormat,
4162
4173
  calendar: n.calendar
@@ -4168,10 +4179,10 @@ function Bs(e, t, n) {
4168
4179
  };
4169
4180
  }
4170
4181
  if (J(l)) {
4171
- const m = Ki(l, n.valueFormat);
4172
- return s === "measures" && a.set(o.id, m), (h) => typeof h == "number" || typeof h == "object" && h !== null ? Ze(h, m) : f(h);
4182
+ const m = Gi(l, n.valueFormat);
4183
+ return s === "measures" && a.set(o.id, m), (h) => typeof h == "number" || typeof h == "object" && h !== null ? Xe(h, m) : f(h);
4173
4184
  }
4174
- 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 ? qt(
4185
+ 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(
4175
4186
  typeof m == "object" ? m.value : m,
4176
4187
  l
4177
4188
  ) : f(m) : (l == null ? void 0 : l.type) === "string" ? (m) => m === null ? f(m) : `${l.prefix ?? ""}${f(m)}${l.suffix ?? ""}` : f;
@@ -4188,17 +4199,17 @@ function Bs(e, t, n) {
4188
4199
  absence: t.absence
4189
4200
  };
4190
4201
  }
4191
- function Xs(e, t) {
4202
+ function sc(e, t) {
4192
4203
  return t.levelLabels[e.id] ?? e.field.label ?? e.field.name;
4193
4204
  }
4194
- function Gs(e, t) {
4205
+ function cc(e, t) {
4195
4206
  return t.measureLabels[e.id] ?? (e.kind === "aggregate" ? e.field.label ?? e.field.name : e.definition.label);
4196
4207
  }
4197
- function Qs(e) {
4198
- return Wn.parse(Yo(e));
4208
+ function uc(e) {
4209
+ return qn.parse(Uo(e));
4199
4210
  }
4200
- function Yo(e) {
4201
- const t = An.parse(e), n = (r) => ({
4211
+ function Uo(e) {
4212
+ const t = Wn.parse(e), n = (r) => ({
4202
4213
  grand: { visible: !0, position: "after" },
4203
4214
  levels: Object.fromEntries(
4204
4215
  r.map((a) => [
@@ -4207,7 +4218,7 @@ function Yo(e) {
4207
4218
  ])
4208
4219
  )
4209
4220
  });
4210
- return Rn.parse({
4221
+ return jn.parse({
4211
4222
  version: 1,
4212
4223
  spec: t,
4213
4224
  presentation: {
@@ -4225,14 +4236,14 @@ function Yo(e) {
4225
4236
  }
4226
4237
  });
4227
4238
  }
4228
- function zo(e, t) {
4229
- const n = new Map(e.map((r) => [K(r), r]));
4230
- for (const r of t ?? []) n.set(K(r), r);
4239
+ function Lo(e, t) {
4240
+ const n = new Map(e.map((r) => [X(r), r]));
4241
+ for (const r of t ?? []) n.set(X(r), r);
4231
4242
  return [...n.values()];
4232
4243
  }
4233
- function Js(e) {
4234
- const { spec: t, presentation: n, defaults: r, session: a } = Ln.parse(e), i = new Map(
4235
- zo(t.sorts, a == null ? void 0 : a.sorts).map((s) => [K(s), s])
4244
+ function lc(e) {
4245
+ const { spec: t, presentation: n, defaults: r, session: a } = Hn.parse(e), i = new Map(
4246
+ Lo(t.sorts, a == null ? void 0 : a.sorts).map((s) => [X(s), s])
4236
4247
  );
4237
4248
  for (const s of ["rows", "columns"])
4238
4249
  for (const c of t[s]) {
@@ -4244,7 +4255,7 @@ function Js(e) {
4244
4255
  direction: "asc",
4245
4256
  nulls: "last"
4246
4257
  };
4247
- i.has(K(u)) || i.set(K(u), u);
4258
+ i.has(X(u)) || i.set(X(u), u);
4248
4259
  }
4249
4260
  const o = (s, c) => ({
4250
4261
  depth: Math.min(s.depth, Math.max(0, c - 1)),
@@ -4266,7 +4277,7 @@ function Js(e) {
4266
4277
  }
4267
4278
  };
4268
4279
  }
4269
- class At extends Error {
4280
+ class Lt extends Error {
4270
4281
  constructor(n) {
4271
4282
  super(
4272
4283
  `invalid_presentation_execution_snapshot: ${n} Resave this report before running it again.`
@@ -4276,7 +4287,7 @@ class At extends Error {
4276
4287
  this.name = "PresentationExecutionSnapshotError";
4277
4288
  }
4278
4289
  }
4279
- class ec extends Error {
4290
+ class mc extends Error {
4280
4291
  constructor(n) {
4281
4292
  super(
4282
4293
  `missing_resolved_raw_temporal_format: Column "${n}" has no captured presentation. Resave this report before running it again.`
@@ -4286,15 +4297,15 @@ class ec extends Error {
4286
4297
  this.name = "MissingResolvedRawTemporalFormatError";
4287
4298
  }
4288
4299
  }
4289
- function I(e, t, n) {
4300
+ function O(e, t, n) {
4290
4301
  const r = new Set(t), a = Object.keys(e).find((i) => !r.has(i));
4291
4302
  if (a)
4292
4303
  throw new Error(`${n} contains unknown property "${a}"`);
4293
4304
  }
4294
- function Uo(e, t = "scope") {
4305
+ function Wo(e, t = "scope") {
4295
4306
  if (!T(e))
4296
4307
  throw new Error(`${t} must be an object`);
4297
- I(
4308
+ O(
4298
4309
  e,
4299
4310
  ["dashboardId", "cardId", "attachmentIndex"],
4300
4311
  t
@@ -4318,13 +4329,13 @@ function Uo(e, t = "scope") {
4318
4329
  }
4319
4330
  function z(e, t, n, r) {
4320
4331
  if (e.kind !== t) return;
4321
- I(e, ["kind", n], r);
4332
+ O(e, ["kind", n], r);
4322
4333
  const a = e[n];
4323
4334
  if (typeof a != "string" || !a.trim())
4324
4335
  throw new Error(`${r}.${n} is required`);
4325
4336
  return a;
4326
4337
  }
4327
- function ze(e, t) {
4338
+ function Ae(e, t) {
4328
4339
  if (!T(e))
4329
4340
  throw new Error(`${t} must be an object`);
4330
4341
  const n = z(e, "metric", "metricId", t);
@@ -4340,7 +4351,7 @@ function ze(e, t) {
4340
4351
  if (a) return { kind: "matrix_measure", measureId: a };
4341
4352
  throw new Error(`${t} is not a valid numeric presentation target`);
4342
4353
  }
4343
- const Ao = [
4354
+ const jo = [
4344
4355
  "type",
4345
4356
  "inputUnit",
4346
4357
  "outputStyle",
@@ -4351,12 +4362,12 @@ const Ao = [
4351
4362
  "suffix",
4352
4363
  "negativeStyle"
4353
4364
  ];
4354
- function Ro(e) {
4365
+ function Ho(e) {
4355
4366
  return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
4356
4367
  }
4357
- const Lo = ["type", "locale", "pattern", "timezone", "sourceTimezone"];
4358
- function Wo(e, t) {
4359
- if (I(e, Lo, t), typeof e.locale != "string" || !e.locale.trim())
4368
+ const qo = ["type", "locale", "pattern", "timezone", "sourceTimezone"];
4369
+ function Zo(e, t) {
4370
+ if (O(e, qo, t), typeof e.locale != "string" || !e.locale.trim())
4360
4371
  throw new Error(`${t}.locale must be a non-empty string`);
4361
4372
  for (const n of ["pattern", "timezone", "sourceTimezone"])
4362
4373
  if (e[n] !== void 0 && typeof e[n] != "string")
@@ -4369,10 +4380,10 @@ function Wo(e, t) {
4369
4380
  ...typeof e.sourceTimezone == "string" ? { sourceTimezone: e.sourceTimezone } : {}
4370
4381
  };
4371
4382
  }
4372
- function jo(e, t) {
4373
- I(e, Ao, t);
4383
+ function Xo(e, t) {
4384
+ O(e, jo, t);
4374
4385
  for (const i of ["inputUnit", "largestUnit", "smallestUnit"])
4375
- if (e[i] !== void 0 && !Ro(e[i]))
4386
+ if (e[i] !== void 0 && !Ho(e[i]))
4376
4387
  throw new Error(`${t}.${i} must be a duration unit`);
4377
4388
  const n = e.outputStyle;
4378
4389
  if (n !== void 0 && n !== "compact" && n !== "digital" && n !== "long")
@@ -4398,11 +4409,11 @@ function jo(e, t) {
4398
4409
  ...a !== void 0 ? { negativeStyle: a } : {}
4399
4410
  };
4400
4411
  }
4401
- function Ho(e, t) {
4412
+ function Vo(e, t) {
4402
4413
  if (!T(e))
4403
4414
  throw new Error(`${t} must be an object`);
4404
4415
  if (e.kind === "field") {
4405
- I(e, ["kind", "fieldId", "role"], t);
4416
+ O(e, ["kind", "fieldId", "role"], t);
4406
4417
  const a = typeof e.fieldId == "string" ? e.fieldId.trim() : "";
4407
4418
  if (!a)
4408
4419
  throw new Error(`${t}.fieldId is required`);
@@ -4426,7 +4437,7 @@ function Ho(e, t) {
4426
4437
  if (r) return { kind: "matrix_axis", axisInstanceId: r };
4427
4438
  throw new Error(`${t} is not a valid temporal bucket presentation target`);
4428
4439
  }
4429
- function qo(e, t) {
4440
+ function Bo(e, t) {
4430
4441
  if (!T(e))
4431
4442
  throw new Error(`${t} must be an object`);
4432
4443
  const n = z(e, "column", "columnKey", t);
@@ -4434,7 +4445,7 @@ function qo(e, t) {
4434
4445
  throw new Error(`${t} must identify a column`);
4435
4446
  return { kind: "column", columnKey: n };
4436
4447
  }
4437
- function Zo(e) {
4448
+ function Ko(e) {
4438
4449
  return [
4439
4450
  e.dashboardId,
4440
4451
  e.cardId ?? null,
@@ -4455,14 +4466,14 @@ function be(e) {
4455
4466
  return [e.kind, e.axisInstanceId];
4456
4467
  }
4457
4468
  }
4458
- function R(e, t) {
4469
+ function U(e, t) {
4459
4470
  return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === t.attachmentIndex;
4460
4471
  }
4461
4472
  function L(e, t) {
4462
4473
  const n = be(e), r = be(t);
4463
4474
  return n.length === r.length && n.every((a, i) => a === r[i]);
4464
4475
  }
4465
- function Ko(e) {
4476
+ function Go(e) {
4466
4477
  if (!Array.isArray(e))
4467
4478
  throw new Error("resolvedFormats must be an array");
4468
4479
  const t = /* @__PURE__ */ new Set();
@@ -4471,21 +4482,21 @@ function Ko(e) {
4471
4482
  const a = `resolvedFormats.${r}`;
4472
4483
  if (!T(n))
4473
4484
  throw new Error(`${a} must be an object`);
4474
- I(n, ["scope", "target", "format"], a);
4475
- const i = Uo(n.scope, `${a}.scope`);
4485
+ O(n, ["scope", "target", "format"], a);
4486
+ const i = Wo(n.scope, `${a}.scope`);
4476
4487
  if (!T(n.format))
4477
4488
  throw new Error(`${a}.format must be an object`);
4478
4489
  let o;
4479
4490
  switch (n.format.type) {
4480
4491
  case "temporal_bucket": {
4481
- const l = bn(n.format);
4492
+ const l = Mn(n.format);
4482
4493
  if (!l.ok)
4483
4494
  throw new Error(
4484
4495
  `${a}.format is invalid: ${((c = l.issues[0]) == null ? void 0 : c.message) ?? "invalid value"}`
4485
4496
  );
4486
4497
  o = {
4487
4498
  scope: i,
4488
- target: Ho(n.target, `${a}.target`),
4499
+ target: Vo(n.target, `${a}.target`),
4489
4500
  format: l.value
4490
4501
  };
4491
4502
  break;
@@ -4493,42 +4504,42 @@ function Ko(e) {
4493
4504
  case "raw_temporal":
4494
4505
  o = {
4495
4506
  scope: i,
4496
- target: qo(n.target, `${a}.target`),
4497
- format: Ge(n.format)
4507
+ target: Bo(n.target, `${a}.target`),
4508
+ format: Qe(n.format)
4498
4509
  };
4499
4510
  break;
4500
4511
  case "number":
4501
4512
  case "currency":
4502
4513
  case "percent":
4503
4514
  case "scientific": {
4504
- const l = Hi(n.format);
4515
+ const l = Vi(n.format);
4505
4516
  if (!l.ok)
4506
4517
  throw new Error(
4507
4518
  `${a}.format is invalid: ${((u = l.issues[0]) == null ? void 0 : u.message) ?? "invalid value"}`
4508
4519
  );
4509
4520
  o = {
4510
4521
  scope: i,
4511
- target: ze(n.target, `${a}.target`),
4522
+ target: Ae(n.target, `${a}.target`),
4512
4523
  format: l.value
4513
4524
  };
4514
4525
  break;
4515
4526
  }
4516
4527
  case "date": {
4517
- const l = ze(n.target, `${a}.target`);
4528
+ const l = Ae(n.target, `${a}.target`);
4518
4529
  if (l.kind !== "column")
4519
4530
  throw new Error(`${a}.target must identify a column for a date format`);
4520
4531
  o = {
4521
4532
  scope: i,
4522
4533
  target: l,
4523
- format: Wo(n.format, `${a}.format`)
4534
+ format: Zo(n.format, `${a}.format`)
4524
4535
  };
4525
4536
  break;
4526
4537
  }
4527
4538
  case "duration":
4528
4539
  o = {
4529
4540
  scope: i,
4530
- target: ze(n.target, `${a}.target`),
4531
- format: jo(
4541
+ target: Ae(n.target, `${a}.target`),
4542
+ format: Xo(
4532
4543
  n.format,
4533
4544
  `${a}.format`
4534
4545
  )
@@ -4538,7 +4549,7 @@ function Ko(e) {
4538
4549
  throw new Error(`${a}.format.type is unsupported`);
4539
4550
  }
4540
4551
  const s = JSON.stringify([
4541
- ...Zo(o.scope),
4552
+ ...Ko(o.scope),
4542
4553
  ...be(o.target)
4543
4554
  ]);
4544
4555
  if (t.has(s))
@@ -4548,17 +4559,17 @@ function Ko(e) {
4548
4559
  return t.add(s), o;
4549
4560
  });
4550
4561
  }
4551
- function Vo(e) {
4562
+ function Qo(e) {
4552
4563
  try {
4553
4564
  if (!T(e))
4554
4565
  throw new Error("presentation execution snapshot must be an object");
4555
- if (I(
4566
+ if (O(
4556
4567
  e,
4557
4568
  ["version", "reportContext", "resolvedFormats"],
4558
4569
  "presentation execution snapshot"
4559
4570
  ), e.version !== 1)
4560
4571
  throw new Error("presentation execution snapshot version must be 1");
4561
- const t = Hn(e.reportContext);
4572
+ const t = Xn(e.reportContext);
4562
4573
  if (!t.ok) {
4563
4574
  const n = t.issues[0];
4564
4575
  throw new Error(
@@ -4568,64 +4579,64 @@ function Vo(e) {
4568
4579
  return {
4569
4580
  version: 1,
4570
4581
  reportContext: t.value,
4571
- resolvedFormats: Ko(e.resolvedFormats)
4582
+ resolvedFormats: Go(e.resolvedFormats)
4572
4583
  };
4573
4584
  } catch (t) {
4574
- throw t instanceof At ? t : new At(
4585
+ throw t instanceof Lt ? t : new Lt(
4575
4586
  t instanceof Error ? t.message : "Snapshot is invalid."
4576
4587
  );
4577
4588
  }
4578
4589
  }
4579
- function Bo(e) {
4580
- return Vo({
4590
+ function Jo(e) {
4591
+ return Qo({
4581
4592
  version: 1,
4582
4593
  reportContext: e.reportContext,
4583
4594
  resolvedFormats: [...e.resolvedFormats]
4584
4595
  });
4585
4596
  }
4586
- function tc(e, t) {
4597
+ function fc(e, t) {
4587
4598
  const n = t.filter(
4588
4599
  (r, a) => !e.resolvedFormats.some(
4589
- (i) => R(i.scope, r.scope) && L(i.target, r.target)
4600
+ (i) => U(i.scope, r.scope) && L(i.target, r.target)
4590
4601
  ) && // One entry per target, as the snapshot's parser requires.
4591
4602
  t.findIndex(
4592
- (i) => R(i.scope, r.scope) && L(i.target, r.target)
4603
+ (i) => U(i.scope, r.scope) && L(i.target, r.target)
4593
4604
  ) === a
4594
4605
  );
4595
- return n.length === 0 ? e : Bo({
4606
+ return n.length === 0 ? e : Jo({
4596
4607
  reportContext: e.reportContext,
4597
4608
  resolvedFormats: [...e.resolvedFormats, ...n]
4598
4609
  });
4599
4610
  }
4600
- function nc(e) {
4601
- const t = Xo(e);
4611
+ function dc(e) {
4612
+ const t = es(e);
4602
4613
  return J(t) ? t : void 0;
4603
4614
  }
4604
- function Xo(e) {
4615
+ function es(e) {
4605
4616
  const t = e.snapshot.resolvedFormats.find(
4606
- (n) => n.format.type !== "temporal_bucket" && n.format.type !== "raw_temporal" && n.format.type !== "date" && R(n.scope, e.scope) && L(n.target, e.target)
4617
+ (n) => n.format.type !== "temporal_bucket" && n.format.type !== "raw_temporal" && n.format.type !== "date" && U(n.scope, e.scope) && L(n.target, e.target)
4607
4618
  );
4608
4619
  return t == null ? void 0 : t.format;
4609
4620
  }
4610
- function rc(e) {
4621
+ function hc(e) {
4611
4622
  const t = e.snapshot.resolvedFormats.find(
4612
- (n) => n.format.type === "date" && R(n.scope, e.scope) && L(n.target, e.target)
4623
+ (n) => n.format.type === "date" && U(n.scope, e.scope) && L(n.target, e.target)
4613
4624
  );
4614
4625
  return t == null ? void 0 : t.format;
4615
4626
  }
4616
- function ac(e) {
4627
+ function gc(e) {
4617
4628
  const t = e.snapshot.resolvedFormats.find(
4618
- (n) => n.format.type === "raw_temporal" && R(n.scope, e.scope) && L(n.target, e.target)
4629
+ (n) => n.format.type === "raw_temporal" && U(n.scope, e.scope) && L(n.target, e.target)
4619
4630
  );
4620
4631
  return t == null ? void 0 : t.format;
4621
4632
  }
4622
- function ic(e) {
4633
+ function yc(e) {
4623
4634
  const t = e.snapshot.resolvedFormats.find(
4624
- (n) => n.format.type === "temporal_bucket" && R(n.scope, e.scope) && L(n.target, e.target)
4635
+ (n) => n.format.type === "temporal_bucket" && U(n.scope, e.scope) && L(n.target, e.target)
4625
4636
  );
4626
4637
  return t == null ? void 0 : t.format;
4627
4638
  }
4628
- function oc(e) {
4639
+ function wc(e) {
4629
4640
  var a;
4630
4641
  const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
4631
4642
  if (e.snapshot.resolvedFormats.forEach((i, o) => {
@@ -4666,75 +4677,75 @@ function oc(e) {
4666
4677
  `resolvedFormats is missing visible export column "${r}"`
4667
4678
  );
4668
4679
  }
4669
- const Go = /* @__PURE__ */ new Set(["short", "medium", "long"]), Qo = /^(\d{4})-(\d{2})-(\d{2})$/, Jo = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, es = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, Je = " – ";
4670
- function sc(e) {
4680
+ 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})$/, et = " – ";
4681
+ function pc(e) {
4671
4682
  if (!T(e)) return;
4672
4683
  const t = Object.keys(e);
4673
4684
  if (e.mode === "period_label" && t.length === 1)
4674
4685
  return { mode: "period_label" };
4675
- if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && Go.has(e.dateStyle))
4686
+ if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && ts.has(e.dateStyle))
4676
4687
  return { mode: "style", dateStyle: e.dateStyle };
4677
- if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && ts(e.pattern) === null)
4688
+ if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && is(e.pattern) === null)
4678
4689
  return {
4679
4690
  mode: "pattern",
4680
4691
  dialect: "semaphor_tokens",
4681
4692
  pattern: e.pattern
4682
4693
  };
4683
4694
  }
4684
- function ts(e) {
4695
+ function is(e) {
4685
4696
  try {
4686
- return lo({ dialect: "semaphor_tokens", pattern: e }), null;
4697
+ return go({ dialect: "semaphor_tokens", pattern: e }), null;
4687
4698
  } catch (t) {
4688
4699
  return t instanceof Error ? t.message : "The pattern is invalid.";
4689
4700
  }
4690
4701
  }
4691
- function cc(e) {
4702
+ function Tc(e) {
4692
4703
  const { value: t, part: n, presentation: r, preferences: a, calendar: i } = e;
4693
4704
  if ((r == null ? void 0 : r.mode) === "period_label" && t.periodLabel && n === "range")
4694
4705
  return { ok: !0, text: t.periodLabel };
4695
4706
  const [o, s] = t.bounds, u = s === void 0 || n === "start" ? [{ raw: o, role: "start" }] : n === "end" ? [{ raw: s, role: "end" }] : [
4696
4707
  { raw: o, role: "start" },
4697
4708
  { raw: s, role: "end" }
4698
- ], l = u.map(({ raw: d }) => is(d, i.tz));
4709
+ ], l = u.map(({ raw: d }) => us(d, i.tz));
4699
4710
  if (l.some((d) => d === null))
4700
4711
  return {
4701
4712
  ok: !1,
4702
- text: u.map(({ raw: d }) => d).join(Je),
4713
+ text: u.map(({ raw: d }) => d).join(et),
4703
4714
  diagnostic: {
4704
4715
  code: "invalid_temporal_input_value",
4705
4716
  message: "A date input bound is not a date or an instant."
4706
4717
  }
4707
4718
  };
4708
4719
  const f = t.precision === "day" ? l.map(
4709
- (d, S) => ss(d, u[S].role, i.tz)
4720
+ (d, S) => ms(d, u[S].role, i.tz)
4710
4721
  ) : [], m = f.length > 0 && f.every((d) => d !== null) ? f : null;
4711
- return { ok: !0, text: m ? ns(m, r, a, i) : rs(
4712
- l.map((d) => os(d, i.tz)),
4722
+ return { ok: !0, text: m ? os(m, r, a, i) : ss(
4723
+ l.map((d) => ls(d, i.tz)),
4713
4724
  r,
4714
4725
  a,
4715
4726
  i
4716
4727
  ) };
4717
4728
  }
4718
- function ns(e, t, n, r) {
4729
+ function os(e, t, n, r) {
4719
4730
  const [a, i = a] = e;
4720
4731
  if ((t == null ? void 0 : t.mode) === "pattern")
4721
- return On(
4732
+ return Cn(
4722
4733
  e.map(
4723
- (c) => Fn(He(c), "date", t.pattern, n, r)
4734
+ (c) => Fn(qe(c), "date", t.pattern, n, r)
4724
4735
  )
4725
4736
  );
4726
4737
  const o = (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : n.dateStyle;
4727
4738
  if (!t || t.mode === "period_label") {
4728
- const c = cs(a, i, r);
4739
+ const c = fs(a, i, r);
4729
4740
  if (c)
4730
- return Nn({
4731
- value: He(a),
4741
+ return In({
4742
+ value: qe(a),
4732
4743
  metadata: {
4733
4744
  kind: "temporal_bucket",
4734
4745
  granularity: c,
4735
4746
  calendar: { tz: r.tz, weekStart: r.weekStart ?? 1 }
4736
4747
  },
4737
- format: Sn({
4748
+ format: _n({
4738
4749
  metadata: {
4739
4750
  kind: "temporal_bucket",
4740
4751
  granularity: c,
@@ -4750,11 +4761,11 @@ function ns(e, t, n, r) {
4750
4761
  timeZone: "UTC",
4751
4762
  dateStyle: o
4752
4763
  });
4753
- return ls(a, i) ? s.format(de(a)) : $n(s, de(a), de(i));
4764
+ return hs(a, i) ? s.format(de(a)) : On(s, de(a), de(i));
4754
4765
  }
4755
- function rs(e, t, n, r) {
4766
+ function ss(e, t, n, r) {
4756
4767
  if ((t == null ? void 0 : t.mode) === "pattern")
4757
- return On(
4768
+ return Cn(
4758
4769
  e.map(
4759
4770
  (s) => Fn(
4760
4771
  s.toISOString(),
@@ -4771,14 +4782,14 @@ function rs(e, t, n, r) {
4771
4782
  dateStyle: (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : n.dateTime.dateStyle,
4772
4783
  timeStyle: n.dateTime.timeStyle
4773
4784
  }), [i, o] = e;
4774
- return o && o.getTime() !== i.getTime() ? $n(a, i, o) : a.format(i);
4785
+ return o && o.getTime() !== i.getTime() ? On(a, i, o) : a.format(i);
4775
4786
  }
4776
- function $n(e, t, n) {
4787
+ function On(e, t, n) {
4777
4788
  const r = e;
4778
- return typeof r.formatRange == "function" ? r.formatRange(t, n) : `${e.format(t)}${Je}${e.format(n)}`;
4789
+ return typeof r.formatRange == "function" ? r.formatRange(t, n) : `${e.format(t)}${et}${e.format(n)}`;
4779
4790
  }
4780
4791
  function Fn(e, t, n, r, a) {
4781
- const i = gn({
4792
+ const i = Tn({
4782
4793
  format: {
4783
4794
  type: "raw_temporal",
4784
4795
  presentation: { mode: "pattern", dialect: "semaphor_tokens", pattern: n }
@@ -4786,56 +4797,56 @@ function Fn(e, t, n, r, a) {
4786
4797
  // Temporal formatting reads no currency.
4787
4798
  preferences: {
4788
4799
  ...r,
4789
- defaultCurrency: qn.defaultCurrency
4800
+ defaultCurrency: Vn.defaultCurrency
4790
4801
  },
4791
4802
  calendar: { tz: a.tz }
4792
- }), o = t === "date" && as(n) ? "instant" : t;
4793
- return yo({
4803
+ }), o = t === "date" && cs(n) ? "instant" : t;
4804
+ return xo({
4794
4805
  value: o === t ? e : te(`${e}T00:00:00`, a.tz).toISOString(),
4795
4806
  metadata: { kind: "raw_temporal", valueKind: o },
4796
4807
  format: i
4797
4808
  }).text;
4798
4809
  }
4799
- function as(e) {
4810
+ function cs(e) {
4800
4811
  return /HH|mm|ss/.test(e);
4801
4812
  }
4802
- function On(e) {
4803
- return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(Je);
4813
+ function Cn(e) {
4814
+ return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(et);
4804
4815
  }
4805
- function is(e, t) {
4806
- const n = Qo.exec(e);
4816
+ function us(e, t) {
4817
+ const n = ns.exec(e);
4807
4818
  if (n) {
4808
4819
  const a = {
4809
4820
  year: Number(n[1]),
4810
4821
  month: Number(n[2]),
4811
4822
  day: Number(n[3])
4812
4823
  };
4813
- return ms(a) ? { kind: "date", date: a } : null;
4824
+ return gs(a) ? { kind: "date", date: a } : null;
4814
4825
  }
4815
- const r = es.test(e) ? new Date(e.replace(" ", "T")) : Jo.test(e) ? te(e.replace(" ", "T"), t) : null;
4826
+ const r = as.test(e) ? new Date(e.replace(" ", "T")) : rs.test(e) ? te(e.replace(" ", "T"), t) : null;
4816
4827
  return r && !Number.isNaN(r.getTime()) ? { kind: "instant", instant: r } : null;
4817
4828
  }
4818
- function os(e, t) {
4819
- return e.kind === "instant" ? e.instant : te(`${He(e.date)}T00:00:00`, t);
4829
+ function ls(e, t) {
4830
+ return e.kind === "instant" ? e.instant : te(`${qe(e.date)}T00:00:00`, t);
4820
4831
  }
4821
- function ss(e, t, n) {
4832
+ function ms(e, t, n) {
4822
4833
  if (e.kind === "date") return e.date;
4823
- const r = Bn(e.instant, n), a = { year: r.year, month: r.month, day: r.day };
4824
- if (r.hour === 0 && r.minute === 0 && r.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? a : us(a, -1);
4834
+ const r = Jn(e.instant, n), a = { year: r.year, month: r.month, day: r.day };
4835
+ if (r.hour === 0 && r.minute === 0 && r.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? a : ds(a, -1);
4825
4836
  const o = r.hour === 23 && r.minute === 59 && r.second === 59;
4826
4837
  return t === "end" && o ? a : null;
4827
4838
  }
4828
- function cs(e, t, n) {
4829
- return n.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== In(t.year, t.month) ? null : e.month === t.month ? "month" : e.month % 3 === 1 && t.month === e.month + 2 ? "quarter" : e.month === 1 && t.month === 12 ? "year" : null;
4839
+ function fs(e, t, n) {
4840
+ return n.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== Pn(t.year, t.month) ? null : e.month === t.month ? "month" : e.month % 3 === 1 && t.month === e.month + 2 ? "quarter" : e.month === 1 && t.month === 12 ? "year" : null;
4830
4841
  }
4831
- function He(e) {
4842
+ function qe(e) {
4832
4843
  return `${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}`;
4833
4844
  }
4834
4845
  function de(e) {
4835
4846
  const t = /* @__PURE__ */ new Date(0);
4836
4847
  return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(0, 0, 0, 0), t;
4837
4848
  }
4838
- function us(e, t) {
4849
+ function ds(e, t) {
4839
4850
  const n = de(e);
4840
4851
  return n.setUTCDate(n.getUTCDate() + t), {
4841
4852
  year: n.getUTCFullYear(),
@@ -4843,143 +4854,151 @@ function us(e, t) {
4843
4854
  day: n.getUTCDate()
4844
4855
  };
4845
4856
  }
4846
- function ls(e, t) {
4857
+ function hs(e, t) {
4847
4858
  return e.year === t.year && e.month === t.month && e.day === t.day;
4848
4859
  }
4849
- function In(e, t) {
4860
+ function Pn(e, t) {
4850
4861
  return new Date(Date.UTC(e, t, 0)).getUTCDate();
4851
4862
  }
4852
- function ms(e) {
4853
- return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= In(e.year, e.month);
4863
+ function gs(e) {
4864
+ return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= Pn(e.year, e.month);
4854
4865
  }
4855
- function uc(e) {
4866
+ function xc(e) {
4856
4867
  const t = /* @__PURE__ */ new Map();
4857
4868
  return e.forEach((n) => {
4858
4869
  n.id && t.set(n.id, (t.get(n.id) ?? 0) + 1);
4859
4870
  }), e.flatMap(
4860
- (n) => n.id && (t.get(n.id) ?? 0) > 1 ? [Xn(n)] : []
4871
+ (n) => n.id && (t.get(n.id) ?? 0) > 1 ? [er(n)] : []
4861
4872
  );
4862
4873
  }
4863
4874
  export {
4864
- ac as $,
4865
- Is as A,
4866
- Es as B,
4867
- De as C,
4868
- P as D,
4869
- Cs as E,
4870
- Ps as F,
4871
- Si as G,
4875
+ Wo as $,
4876
+ Ys as A,
4877
+ As as B,
4878
+ Rs as C,
4879
+ hn as D,
4880
+ Us as E,
4881
+ Si as F,
4882
+ Ls as G,
4872
4883
  Mi as H,
4873
- Ys as I,
4874
- ki as J,
4875
- zs as K,
4876
- Bs as L,
4877
- Di as M,
4878
- ji as N,
4879
- Hi as O,
4880
- As as P,
4881
- qi as Q,
4882
- Ki as R,
4883
- At as S,
4884
- ec as T,
4885
- Uo as U,
4886
- Ko as V,
4887
- Vo as W,
4888
- Bo as X,
4889
- tc as Y,
4890
- nc as Z,
4891
- rc as _,
4892
- Xo as a,
4893
- kt as a$,
4894
- ic as a0,
4895
- oc as a1,
4896
- Vi as a2,
4897
- Xi as a3,
4898
- ne as a4,
4899
- fn as a5,
4900
- Rs as a6,
4901
- wo as a7,
4902
- fe as a8,
4903
- xn as a9,
4904
- Xs as aA,
4905
- un as aB,
4906
- _s as aC,
4907
- Ni as aD,
4908
- Gs as aE,
4909
- Qs as aF,
4910
- Yo as aG,
4911
- zo as aH,
4912
- Ke as aI,
4913
- j as aJ,
4914
- nn as aK,
4915
- ue as aL,
4916
- p as aM,
4917
- Dr as aN,
4918
- pe as aO,
4919
- ct as aP,
4920
- ie as aQ,
4921
- ks as aR,
4922
- Jt as aS,
4923
- yr as aT,
4924
- _i as aU,
4925
- lr as aV,
4926
- Ma as aW,
4927
- Po as aX,
4928
- $t as aY,
4929
- F as aZ,
4930
- Nt as a_,
4931
- Hs as aa,
4932
- bn as ab,
4933
- Sn as ac,
4934
- qs as ad,
4935
- to as ae,
4936
- A as af,
4937
- Ge as ag,
4938
- gn as ah,
4939
- Ls as ai,
4940
- Ws as aj,
4941
- so as ak,
4942
- js as al,
4943
- lo as am,
4944
- Dn as an,
4945
- yo as ao,
4946
- po as ap,
4947
- sc as aq,
4948
- ts as ar,
4949
- cc as as,
4950
- uc as at,
4951
- Js as au,
4952
- vs as av,
4953
- Io as aw,
4954
- Zs as ax,
4955
- Vs as ay,
4956
- Ks as az,
4957
- Ss as b,
4958
- Co as b0,
4959
- Eo as b1,
4960
- te as b2,
4961
- Ii as c,
4962
- bs as d,
4963
- qe as e,
4964
- Nn as f,
4965
- Bt as g,
4966
- Xt as h,
4884
+ Ws as I,
4885
+ xe as J,
4886
+ P as K,
4887
+ js as L,
4888
+ zs as M,
4889
+ Hs as N,
4890
+ $i as O,
4891
+ Ei as P,
4892
+ qs as Q,
4893
+ Ii as R,
4894
+ Zs as S,
4895
+ oc as T,
4896
+ Xi as U,
4897
+ Vi as V,
4898
+ Vs as W,
4899
+ Bi as X,
4900
+ Gi as Y,
4901
+ Lt as Z,
4902
+ mc as _,
4903
+ es as a,
4904
+ xr as a$,
4905
+ Go as a0,
4906
+ Qo as a1,
4907
+ Jo as a2,
4908
+ fc as a3,
4909
+ dc as a4,
4910
+ hc as a5,
4911
+ gc as a6,
4912
+ yc as a7,
4913
+ wc as a8,
4914
+ Qi as a9,
4915
+ is as aA,
4916
+ Tc as aB,
4917
+ xc as aC,
4918
+ lc as aD,
4919
+ _s as aE,
4920
+ Yo as aF,
4921
+ rc as aG,
4922
+ ic as aH,
4923
+ ac as aI,
4924
+ sc as aJ,
4925
+ fn as aK,
4926
+ Is as aL,
4927
+ cc as aM,
4928
+ uc as aN,
4929
+ Uo as aO,
4930
+ Lo as aP,
4931
+ Ve as aQ,
4932
+ j as aR,
4933
+ on as aS,
4934
+ ue as aT,
4935
+ w as aU,
4936
+ Sr as aV,
4937
+ we as aW,
4938
+ lt as aX,
4939
+ ie as aY,
4940
+ Es as aZ,
4941
+ nn as a_,
4942
+ eo as aa,
4943
+ ne as ab,
4944
+ yn as ac,
4945
+ Bs as ad,
4946
+ bo as ae,
4947
+ fe as af,
4948
+ Me as ag,
4949
+ Js as ah,
4950
+ ec as ai,
4951
+ tc as aj,
4952
+ Mn as ak,
4953
+ _n as al,
4954
+ nc as am,
4955
+ io as an,
4956
+ R as ao,
4957
+ Qe as ap,
4958
+ Tn as aq,
4959
+ Ks as ar,
4960
+ Gs as as,
4961
+ mo as at,
4962
+ Qs as au,
4963
+ go as av,
4964
+ Sn as aw,
4965
+ xo as ax,
4966
+ Do as ay,
4967
+ pc as az,
4968
+ Ns as b,
4969
+ $a as b0,
4970
+ Oi as b1,
4971
+ hr as b2,
4972
+ Ro as b3,
4973
+ Et as b4,
4974
+ E as b5,
4975
+ $t as b6,
4976
+ _t as b7,
4977
+ Ao as b8,
4978
+ zo as b9,
4979
+ te as ba,
4980
+ Yi as c,
4981
+ ks as d,
4982
+ Ze as e,
4983
+ In as f,
4984
+ Qt as g,
4985
+ Jt as h,
4967
4986
  J as i,
4968
- Gt as j,
4969
- Ze as k,
4970
- mr as l,
4971
- Ms as m,
4972
- qt as n,
4973
- Zt as o,
4974
- Xe as p,
4975
- pi as q,
4976
- Ui as r,
4977
- wi as s,
4978
- Os as t,
4979
- Ns as u,
4980
- $s as v,
4981
- Us as w,
4982
- Fs as x,
4983
- Be as y,
4984
- ln as z
4987
+ en as j,
4988
+ Xe as k,
4989
+ gr as l,
4990
+ $s as m,
4991
+ Vt as n,
4992
+ Bt as o,
4993
+ Ge as p,
4994
+ Di as q,
4995
+ Wi as r,
4996
+ bi as s,
4997
+ Ps as t,
4998
+ Os as u,
4999
+ Fs as v,
5000
+ Xs as w,
5001
+ Cs as x,
5002
+ Ke as y,
5003
+ dn as z
4985
5004
  };