react-semaphor 0.1.558 → 0.1.560

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/analytics-protocol/index.js +368 -358
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +9 -9
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/analytics-base-schemas-CHLxsPfX.js +630 -0
  7. package/dist/chunks/{assistant-chat-BCWoP6Rf.js → assistant-chat-Bu2fFm_I.js} +206 -207
  8. package/dist/chunks/{bookmark-state-PjQpxbG7.js → bookmark-state-BFY9oNmr.js} +3 -3
  9. package/dist/chunks/{braces-D5Ucy7q1.js → braces-Da41xfUd.js} +1 -1
  10. package/dist/chunks/{comparison-window-caption-Dc7BaCMz.js → comparison-window-caption-4FNkMrzE.js} +213 -213
  11. package/dist/chunks/{context-DVy4HOU0.js → context-BgPDzLHZ.js} +1 -1
  12. package/dist/chunks/{custom-visual-inputs-B-DLRGrV.js → custom-visual-inputs-Dz-enUNR.js} +1 -1
  13. package/dist/chunks/{dashboard-wK6Bai4V.js → dashboard-_MeBuy67.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-Coqghdn6.js → dashboard-briefing-launcher-CEi4Pr_v.js} +1152 -1166
  15. package/dist/chunks/{dashboard-controls-BYWSM2RM.js → dashboard-controls-Bi7fyG-4.js} +98 -98
  16. package/dist/chunks/{dashboard-json-pPTB5gj0.js → dashboard-json-B1mU_OMa.js} +5 -5
  17. package/dist/chunks/{document-dashboard-inputs-PY_7Xm55.js → document-dashboard-inputs-CkWfDB8c.js} +64 -64
  18. package/dist/chunks/{edit-dashboard-visual-BODxuUeq.js → edit-dashboard-visual-0CJN31Y3.js} +8274 -8514
  19. package/dist/chunks/filter-reach-copy-BF4w4kI2.js +3738 -0
  20. package/dist/chunks/{filter-value-text-CUBpotVN.js → filter-value-text-CRC-K_l_.js} +3 -3
  21. package/dist/chunks/{global-date-filter-utils-BsFqnnbA.js → global-date-filter-utils-D8365uPH.js} +4088 -3416
  22. package/dist/chunks/{index-DP_wQl0v.js → index-DtHidOPV.js} +579 -604
  23. package/dist/chunks/{layout-grid-CkoXmv0L.js → layout-grid-BvsH4RY2.js} +1 -1
  24. package/dist/chunks/{list-filter-B4i25kuc.js → list-filter-Dg0otx5E.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-4GTUDheD.js → matrix-analytical-definition-CM18W8w6.js} +41 -41
  26. package/dist/chunks/{matrix-card-fS_4O7zA.js → matrix-card-HPskLaPy.js} +3 -3
  27. package/dist/chunks/{matrix-member-presentation-Dj7HaAHC.js → matrix-member-presentation-Bbrfrke4.js} +1 -1
  28. package/dist/chunks/{matrix-operation-contract-CpgLZ7E5.js → matrix-operation-contract-WPv4R-H_.js} +130 -130
  29. package/dist/chunks/{metric-comparison-C8LY7GG5.js → metric-comparison-ljMKYZKa.js} +2 -2
  30. package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-Ccn1zaxl.js} +1 -1
  31. package/dist/chunks/{palette-stlpjVk4.js → palette-Bsh376zO.js} +1 -1
  32. package/dist/chunks/{pivot-result-contract-expectations-DMk-mKhG.js → pivot-result-contract-expectations-Bl5suy4-.js} +602 -696
  33. package/dist/chunks/{pivot-result-identity-CrQ54Xbj.js → pivot-result-identity-vS9TSh4f.js} +1 -1
  34. package/dist/chunks/{raw-temporal-presentation-BI2z2LlB.js → raw-temporal-presentation-BHm7s-hz.js} +230 -274
  35. package/dist/chunks/{report-preferences-dialog-Dc-YyVwf.js → report-preferences-dialog-BV8L0SeS.js} +55 -55
  36. package/dist/chunks/{report-runtime-context-CohdtiMg.js → report-runtime-context-BZQh9ywy.js} +2 -2
  37. package/dist/chunks/{resolve-dashboard-input-context-BZYI1hB0.js → resolve-dashboard-input-context-CAMiWvyR.js} +2021 -2239
  38. package/dist/chunks/{save-C1dgxgAu.js → save-B5EAsgQF.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-CIBoMq46.js → saved-dashboard-context-n2Wn11cV.js} +57 -57
  40. package/dist/chunks/{selection-reducer-_d6aKJnj.js → selection-reducer-D0YnaAD9.js} +1 -1
  41. package/dist/chunks/{semaphor-ready-indicator-ERTLU7B4.js → semaphor-ready-indicator-XLBLOJ2V.js} +38446 -39176
  42. package/dist/chunks/{shelf-drop-preview-context-fEnx6iL_.js → shelf-drop-preview-context-DHMa54a-.js} +570 -570
  43. package/dist/chunks/source-entity-resolution-dUG5VWRm.js +607 -0
  44. package/dist/chunks/{switch-BqUan2mN.js → switch-ByxH4M7t.js} +3 -3
  45. package/dist/chunks/{table-export-sheet-CTCTA_bd.js → table-export-sheet-C_GdeTYU.js} +1 -1
  46. package/dist/chunks/{table-settings-DF1gdVQR.js → table-settings-Imz0FgWi.js} +8 -8
  47. package/dist/chunks/{temporal-input-presentation-DoSniQj1.js → temporal-input-presentation-uvNK_tM0.js} +1109 -820
  48. package/dist/chunks/{token-types-DFyLflLY.js → token-types-CQtXUVMy.js} +1 -1
  49. package/dist/chunks/{upload-DcoyjkRV.js → upload-wbR-NVzq.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-xhb9YFg-.js → use-create-flow-overlay-state-CEBaLOKC.js} +6 -6
  51. package/dist/chunks/validators-CXTneCA4.js +3453 -0
  52. package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-B1n_WjW3.js} +1 -1
  53. package/dist/dashboard/index.js +2 -2
  54. package/dist/dashboard-authoring/index.js +2207 -1496
  55. package/dist/data-app-sdk/index.js +20 -20
  56. package/dist/data-app-sdk-adapters/index.js +3 -3
  57. package/dist/data-app-sdk-validation/index.js +6 -6
  58. package/dist/format-utils/index.js +181 -176
  59. package/dist/index.js +22 -22
  60. package/dist/report-runtime-context/index.js +2 -2
  61. package/dist/style.css +1 -1
  62. package/dist/surfboard/index.js +2 -2
  63. package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
  64. package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
  65. package/dist/types/index.js +6 -6
  66. package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
  67. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
  68. package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
  69. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
  70. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  71. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
  72. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  73. package/dist/types/lib/stores/editor-store.d.ts +39 -9
  74. package/dist/types/lib/stores/table-actions.d.ts +9 -3
  75. package/dist/types/lib/table-formatting/index.d.ts +0 -2
  76. package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
  77. package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
  78. package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
  79. package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
  80. package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
  81. package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
  82. package/dist/types/lib/types/common-types.d.ts +40 -47
  83. package/dist/types/lib/types/explorer-types.d.ts +13 -44
  84. package/dist/types/lib/utils/card-config-utils.d.ts +9 -1
  85. package/dist/types/lib/utils/card-definition.d.ts +9 -187
  86. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +159 -513
  87. package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
  88. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
  89. package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
  90. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
  91. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
  92. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
  93. package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
  94. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
  95. package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
  96. package/dist/types/shared/analytics-protocol/source-capabilities.d.ts +21 -0
  97. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
  98. package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
  99. package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
  100. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
  101. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
  102. package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
  103. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +24 -24
  104. package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
  105. package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
  106. package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
  107. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +14 -0
  108. package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
  109. package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
  110. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
  111. package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
  112. package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
  113. package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
  114. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
  115. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +2 -0
  116. package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
  117. package/dist/types/shared/dashboard-authoring/legacy-table-routing.d.ts +4 -2
  118. package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
  119. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
  120. package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
  121. package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
  122. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -1
  123. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
  124. package/dist/types/shared/format-utils/index.d.ts +2 -0
  125. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
  126. package/dist/types/shared/format-utils/raw-temporal.d.ts +15 -1
  127. package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
  128. package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
  129. package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
  130. package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
  131. package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
  132. package/package.json +1 -1
  133. package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
  134. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
  135. package/dist/chunks/filter-reach-copy-BvJH9JO-.js +0 -3411
  136. package/dist/chunks/source-entity-resolution-DXW1HpKf.js +0 -816
  137. package/dist/chunks/validators-hmfNNQz8.js +0 -3595
  138. package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
  139. package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
@@ -1,45 +1,45 @@
1
- var we = Object.defineProperty;
2
- var be = (e, t, n) => t in e ? we(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var U = (e, t, n) => be(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { aI as Me, t as B, ab as pe, S as xe } from "./validators-hmfNNQz8.js";
5
- import "./matrix-operation-contract-CpgLZ7E5.js";
6
- import { j as De } from "./analytics-base-schemas-BUFUoO6G.js";
1
+ var fe = Object.defineProperty;
2
+ var le = (e, t, n) => t in e ? fe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var z = (e, t, n) => le(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { aW as me, t as j, aj as de, _ as he } from "./validators-CXTneCA4.js";
5
+ import "./matrix-operation-contract-WPv4R-H_.js";
6
+ import "./analytics-base-schemas-CHLxsPfX.js";
7
7
  import "zod";
8
- import { ao as Oe, ap as oe, ak as $, al as C, aq as ue, ar as ce, as as Te, l as ve, i as q, a1 as Pe, a3 as le, p as Se, r as ke, H as We, k as Ce, n as Fe } from "./temporal-input-presentation-DoSniQj1.js";
9
- import { r as Ne } from "./metric-comparison-C8LY7GG5.js";
10
- function m(e) {
8
+ import { au as ge, av as ee, aq as H, ar as W, aw as te, ax as ne, ay as we, m as ye, d as be, a3 as Me, a5 as re, p as ve, r as Oe, s as Te, i as xe, J as De, l as Pe, o as pe } from "./temporal-input-presentation-uvNK_tM0.js";
9
+ import { r as ke } from "./metric-comparison-ljMKYZKa.js";
10
+ function d(e) {
11
11
  const t = Object.prototype.toString.call(e);
12
12
  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);
13
13
  }
14
- function p(e, t) {
14
+ function O(e, t) {
15
15
  return e instanceof Date ? new e.constructor(t) : new Date(t);
16
16
  }
17
- let Ye = {};
17
+ let Se = {};
18
18
  function P() {
19
- return Ye;
19
+ return Se;
20
20
  }
21
- function W(e, t) {
22
- var o, l, f, u;
23
- const n = P(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((l = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : l.weekStartsOn) ?? n.weekStartsOn ?? ((u = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : u.weekStartsOn) ?? 0, a = m(e), i = a.getDay(), s = (i < r ? 7 : 0) + i - r;
24
- return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
21
+ function S(e, t) {
22
+ var i, f, l, c;
23
+ const n = P(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((f = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : f.weekStartsOn) ?? n.weekStartsOn ?? ((c = (l = n.locale) == null ? void 0 : l.options) == null ? void 0 : c.weekStartsOn) ?? 0, a = d(e), s = a.getDay(), o = (s < r ? 7 : 0) + s - r;
24
+ return a.setDate(a.getDate() - o), a.setHours(0, 0, 0, 0), a;
25
25
  }
26
- function Y(e) {
27
- return W(e, { weekStartsOn: 1 });
26
+ function N(e) {
27
+ return S(e, { weekStartsOn: 1 });
28
28
  }
29
- function fe(e) {
30
- const t = m(e), n = t.getFullYear(), r = p(e, 0);
29
+ function ae(e) {
30
+ const t = d(e), n = t.getFullYear(), r = O(e, 0);
31
31
  r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
32
- const a = Y(r), i = p(e, 0);
33
- i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
34
- const s = Y(i);
35
- return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >= s.getTime() ? n : n - 1;
32
+ const a = N(r), s = O(e, 0);
33
+ s.setFullYear(n, 0, 4), s.setHours(0, 0, 0, 0);
34
+ const o = N(s);
35
+ return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >= o.getTime() ? n : n - 1;
36
36
  }
37
- function V(e) {
38
- const t = m(e);
37
+ function B(e) {
38
+ const t = d(e);
39
39
  return t.setHours(0, 0, 0, 0), t;
40
40
  }
41
- function E(e) {
42
- const t = m(e), n = new Date(
41
+ function Y(e) {
42
+ const t = d(e), n = new Date(
43
43
  Date.UTC(
44
44
  t.getFullYear(),
45
45
  t.getMonth(),
@@ -52,78 +52,78 @@ function E(e) {
52
52
  );
53
53
  return n.setUTCFullYear(t.getFullYear()), +e - +n;
54
54
  }
55
- function Ee(e, t) {
56
- const n = V(e), r = V(t), a = +n - E(n), i = +r - E(r);
57
- return Math.round((a - i) / Oe);
55
+ function We(e, t) {
56
+ const n = B(e), r = B(t), a = +n - Y(n), s = +r - Y(r);
57
+ return Math.round((a - s) / ge);
58
58
  }
59
- function Le(e) {
60
- const t = fe(e), n = p(e, 0);
61
- return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), Y(n);
59
+ function Ce(e) {
60
+ const t = ae(e), n = O(e, 0);
61
+ return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), N(n);
62
62
  }
63
- function F(e, t) {
64
- const n = m(e), r = m(t), a = n.getTime() - r.getTime();
63
+ function C(e, t) {
64
+ const n = d(e), r = d(t), a = n.getTime() - r.getTime();
65
65
  return a < 0 ? -1 : a > 0 ? 1 : a;
66
66
  }
67
- function _e(e) {
68
- return p(e, Date.now());
67
+ function Ne(e) {
68
+ return O(e, Date.now());
69
69
  }
70
- function ze(e) {
70
+ function Ye(e) {
71
71
  return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
72
72
  }
73
- function Xe(e) {
74
- if (!ze(e) && typeof e != "number")
73
+ function Ee(e) {
74
+ if (!Ye(e) && typeof e != "number")
75
75
  return !1;
76
- const t = m(e);
76
+ const t = d(e);
77
77
  return !isNaN(Number(t));
78
78
  }
79
- function Ie(e, t) {
80
- const n = m(e), r = m(t), a = n.getFullYear() - r.getFullYear(), i = n.getMonth() - r.getMonth();
81
- return a * 12 + i;
79
+ function Fe(e, t) {
80
+ const n = d(e), r = d(t), a = n.getFullYear() - r.getFullYear(), s = n.getMonth() - r.getMonth();
81
+ return a * 12 + s;
82
82
  }
83
- function qe(e) {
83
+ function Le(e) {
84
84
  return (t) => {
85
85
  const r = (e ? Math[e] : Math.trunc)(t);
86
86
  return r === 0 ? 0 : r;
87
87
  };
88
88
  }
89
- function He(e, t) {
90
- return +m(e) - +m(t);
89
+ function Xe(e, t) {
90
+ return +d(e) - +d(t);
91
91
  }
92
- function Re(e) {
93
- const t = m(e);
92
+ function Ie(e) {
93
+ const t = d(e);
94
94
  return t.setHours(23, 59, 59, 999), t;
95
95
  }
96
- function Ae(e) {
97
- const t = m(e), n = t.getMonth();
96
+ function _e(e) {
97
+ const t = d(e), n = t.getMonth();
98
98
  return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
99
99
  }
100
- function je(e) {
101
- const t = m(e);
102
- return +Re(t) == +Ae(t);
100
+ function qe(e) {
101
+ const t = d(e);
102
+ return +Ie(t) == +_e(t);
103
103
  }
104
- function Ue(e, t) {
105
- const n = m(e), r = m(t), a = F(n, r), i = Math.abs(
106
- Ie(n, r)
104
+ function Ae(e, t) {
105
+ const n = d(e), r = d(t), a = C(n, r), s = Math.abs(
106
+ Fe(n, r)
107
107
  );
108
- let s;
109
- if (i < 1)
110
- s = 0;
108
+ let o;
109
+ if (s < 1)
110
+ o = 0;
111
111
  else {
112
- n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a * i);
113
- let o = F(n, r) === -a;
114
- je(m(e)) && i === 1 && F(e, r) === 1 && (o = !1), s = a * (i - Number(o));
112
+ n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a * s);
113
+ let i = C(n, r) === -a;
114
+ qe(d(e)) && s === 1 && C(e, r) === 1 && (i = !1), o = a * (s - Number(i));
115
115
  }
116
- return s === 0 ? 0 : s;
116
+ return o === 0 ? 0 : o;
117
117
  }
118
- function Be(e, t, n) {
119
- const r = He(e, t) / 1e3;
120
- return qe(n == null ? void 0 : n.roundingMethod)(r);
118
+ function Re(e, t, n) {
119
+ const r = Xe(e, t) / 1e3;
120
+ return Le(n == null ? void 0 : n.roundingMethod)(r);
121
121
  }
122
- function $e(e) {
123
- const t = m(e), n = p(e, 0);
122
+ function ze(e) {
123
+ const t = d(e), n = O(e, 0);
124
124
  return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
125
125
  }
126
- const Ve = {
126
+ const je = {
127
127
  lessThanXSeconds: {
128
128
  one: "less than a second",
129
129
  other: "less than {{count}} seconds"
@@ -185,77 +185,77 @@ const Ve = {
185
185
  one: "almost 1 year",
186
186
  other: "almost {{count}} years"
187
187
  }
188
- }, Ze = (e, t, n) => {
188
+ }, He = (e, t, n) => {
189
189
  let r;
190
- const a = Ve[e];
190
+ const a = je[e];
191
191
  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;
192
192
  };
193
- function z(e) {
193
+ function L(e) {
194
194
  return (t = {}) => {
195
195
  const n = t.width ? String(t.width) : e.defaultWidth;
196
196
  return e.formats[n] || e.formats[e.defaultWidth];
197
197
  };
198
198
  }
199
- const Ge = {
199
+ const Be = {
200
200
  full: "EEEE, MMMM do, y",
201
201
  long: "MMMM do, y",
202
202
  medium: "MMM d, y",
203
203
  short: "MM/dd/yyyy"
204
- }, Qe = {
204
+ }, $e = {
205
205
  full: "h:mm:ss a zzzz",
206
206
  long: "h:mm:ss a z",
207
207
  medium: "h:mm:ss a",
208
208
  short: "h:mm a"
209
- }, Je = {
209
+ }, Ze = {
210
210
  full: "{{date}} 'at' {{time}}",
211
211
  long: "{{date}} 'at' {{time}}",
212
212
  medium: "{{date}}, {{time}}",
213
213
  short: "{{date}}, {{time}}"
214
- }, Ke = {
215
- date: z({
216
- formats: Ge,
214
+ }, Ve = {
215
+ date: L({
216
+ formats: Be,
217
217
  defaultWidth: "full"
218
218
  }),
219
- time: z({
220
- formats: Qe,
219
+ time: L({
220
+ formats: $e,
221
221
  defaultWidth: "full"
222
222
  }),
223
- dateTime: z({
224
- formats: Je,
223
+ dateTime: L({
224
+ formats: Ze,
225
225
  defaultWidth: "full"
226
226
  })
227
- }, et = {
227
+ }, Qe = {
228
228
  lastWeek: "'last' eeee 'at' p",
229
229
  yesterday: "'yesterday at' p",
230
230
  today: "'today at' p",
231
231
  tomorrow: "'tomorrow at' p",
232
232
  nextWeek: "eeee 'at' p",
233
233
  other: "P"
234
- }, tt = (e, t, n, r) => et[e];
235
- function S(e) {
234
+ }, Ge = (e, t, n, r) => Qe[e];
235
+ function p(e) {
236
236
  return (t, n) => {
237
237
  const r = n != null && n.context ? String(n.context) : "standalone";
238
238
  let a;
239
239
  if (r === "formatting" && e.formattingValues) {
240
- const s = e.defaultFormattingWidth || e.defaultWidth, o = n != null && n.width ? String(n.width) : s;
241
- a = e.formattingValues[o] || e.formattingValues[s];
240
+ const o = e.defaultFormattingWidth || e.defaultWidth, i = n != null && n.width ? String(n.width) : o;
241
+ a = e.formattingValues[i] || e.formattingValues[o];
242
242
  } else {
243
- const s = e.defaultWidth, o = n != null && n.width ? String(n.width) : e.defaultWidth;
244
- a = e.values[o] || e.values[s];
243
+ const o = e.defaultWidth, i = n != null && n.width ? String(n.width) : e.defaultWidth;
244
+ a = e.values[i] || e.values[o];
245
245
  }
246
- const i = e.argumentCallback ? e.argumentCallback(t) : t;
247
- return a[i];
246
+ const s = e.argumentCallback ? e.argumentCallback(t) : t;
247
+ return a[s];
248
248
  };
249
249
  }
250
- const nt = {
250
+ const Ue = {
251
251
  narrow: ["B", "A"],
252
252
  abbreviated: ["BC", "AD"],
253
253
  wide: ["Before Christ", "Anno Domini"]
254
- }, rt = {
254
+ }, Je = {
255
255
  narrow: ["1", "2", "3", "4"],
256
256
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
257
257
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
258
- }, at = {
258
+ }, Ke = {
259
259
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
260
260
  abbreviated: [
261
261
  "Jan",
@@ -285,7 +285,7 @@ const nt = {
285
285
  "November",
286
286
  "December"
287
287
  ]
288
- }, it = {
288
+ }, et = {
289
289
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
290
290
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
291
291
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -298,7 +298,7 @@ const nt = {
298
298
  "Friday",
299
299
  "Saturday"
300
300
  ]
301
- }, st = {
301
+ }, tt = {
302
302
  narrow: {
303
303
  am: "a",
304
304
  pm: "p",
@@ -329,7 +329,7 @@ const nt = {
329
329
  evening: "evening",
330
330
  night: "night"
331
331
  }
332
- }, ot = {
332
+ }, nt = {
333
333
  narrow: {
334
334
  am: "a",
335
335
  pm: "p",
@@ -360,7 +360,7 @@ const nt = {
360
360
  evening: "in the evening",
361
361
  night: "at night"
362
362
  }
363
- }, ut = (e, t) => {
363
+ }, rt = (e, t) => {
364
364
  const n = Number(e), r = n % 100;
365
365
  if (r > 20 || r < 10)
366
366
  switch (r % 10) {
@@ -372,89 +372,89 @@ const nt = {
372
372
  return n + "rd";
373
373
  }
374
374
  return n + "th";
375
- }, ct = {
376
- ordinalNumber: ut,
377
- era: S({
378
- values: nt,
375
+ }, at = {
376
+ ordinalNumber: rt,
377
+ era: p({
378
+ values: Ue,
379
379
  defaultWidth: "wide"
380
380
  }),
381
- quarter: S({
382
- values: rt,
381
+ quarter: p({
382
+ values: Je,
383
383
  defaultWidth: "wide",
384
384
  argumentCallback: (e) => e - 1
385
385
  }),
386
- month: S({
387
- values: at,
386
+ month: p({
387
+ values: Ke,
388
388
  defaultWidth: "wide"
389
389
  }),
390
- day: S({
391
- values: it,
390
+ day: p({
391
+ values: et,
392
392
  defaultWidth: "wide"
393
393
  }),
394
- dayPeriod: S({
395
- values: st,
394
+ dayPeriod: p({
395
+ values: tt,
396
396
  defaultWidth: "wide",
397
- formattingValues: ot,
397
+ formattingValues: nt,
398
398
  defaultFormattingWidth: "wide"
399
399
  })
400
400
  };
401
401
  function k(e) {
402
402
  return (t, n = {}) => {
403
- const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], i = t.match(a);
404
- if (!i)
403
+ const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], s = t.match(a);
404
+ if (!s)
405
405
  return null;
406
- const s = i[0], o = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], l = Array.isArray(o) ? ft(o, (g) => g.test(s)) : (
406
+ const o = s[0], i = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], f = Array.isArray(i) ? ot(i, (h) => h.test(o)) : (
407
407
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
408
- lt(o, (g) => g.test(s))
408
+ st(i, (h) => h.test(o))
409
409
  );
410
- let f;
411
- f = e.valueCallback ? e.valueCallback(l) : l, f = n.valueCallback ? (
410
+ let l;
411
+ l = e.valueCallback ? e.valueCallback(f) : f, l = n.valueCallback ? (
412
412
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
413
- n.valueCallback(f)
414
- ) : f;
415
- const u = t.slice(s.length);
416
- return { value: f, rest: u };
413
+ n.valueCallback(l)
414
+ ) : l;
415
+ const c = t.slice(o.length);
416
+ return { value: l, rest: c };
417
417
  };
418
418
  }
419
- function lt(e, t) {
419
+ function st(e, t) {
420
420
  for (const n in e)
421
421
  if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
422
422
  return n;
423
423
  }
424
- function ft(e, t) {
424
+ function ot(e, t) {
425
425
  for (let n = 0; n < e.length; n++)
426
426
  if (t(e[n]))
427
427
  return n;
428
428
  }
429
- function dt(e) {
429
+ function it(e) {
430
430
  return (t, n = {}) => {
431
431
  const r = t.match(e.matchPattern);
432
432
  if (!r) return null;
433
- const a = r[0], i = t.match(e.parsePattern);
434
- if (!i) return null;
435
- let s = e.valueCallback ? e.valueCallback(i[0]) : i[0];
436
- s = n.valueCallback ? n.valueCallback(s) : s;
437
- const o = t.slice(a.length);
438
- return { value: s, rest: o };
433
+ const a = r[0], s = t.match(e.parsePattern);
434
+ if (!s) return null;
435
+ let o = e.valueCallback ? e.valueCallback(s[0]) : s[0];
436
+ o = n.valueCallback ? n.valueCallback(o) : o;
437
+ const i = t.slice(a.length);
438
+ return { value: o, rest: i };
439
439
  };
440
440
  }
441
- const mt = /^(\d+)(th|st|nd|rd)?/i, ht = /\d+/i, gt = {
441
+ const ut = /^(\d+)(th|st|nd|rd)?/i, ct = /\d+/i, ft = {
442
442
  narrow: /^(b|a)/i,
443
443
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
444
444
  wide: /^(before christ|before common era|anno domini|common era)/i
445
- }, yt = {
445
+ }, lt = {
446
446
  any: [/^b/i, /^(a|c)/i]
447
- }, wt = {
447
+ }, mt = {
448
448
  narrow: /^[1234]/i,
449
449
  abbreviated: /^q[1234]/i,
450
450
  wide: /^[1234](th|st|nd|rd)? quarter/i
451
- }, bt = {
451
+ }, dt = {
452
452
  any: [/1/i, /2/i, /3/i, /4/i]
453
- }, Mt = {
453
+ }, ht = {
454
454
  narrow: /^[jfmasond]/i,
455
455
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
456
456
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
457
- }, pt = {
457
+ }, gt = {
458
458
  narrow: [
459
459
  /^j/i,
460
460
  /^f/i,
@@ -483,18 +483,18 @@ const mt = /^(\d+)(th|st|nd|rd)?/i, ht = /\d+/i, gt = {
483
483
  /^n/i,
484
484
  /^d/i
485
485
  ]
486
- }, xt = {
486
+ }, wt = {
487
487
  narrow: /^[smtwf]/i,
488
488
  short: /^(su|mo|tu|we|th|fr|sa)/i,
489
489
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
490
490
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
491
- }, Dt = {
491
+ }, yt = {
492
492
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
493
493
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
494
- }, Ot = {
494
+ }, bt = {
495
495
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
496
496
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
497
- }, Tt = {
497
+ }, Mt = {
498
498
  any: {
499
499
  am: /^a/i,
500
500
  pm: /^p/i,
@@ -506,98 +506,98 @@ const mt = /^(\d+)(th|st|nd|rd)?/i, ht = /\d+/i, gt = {
506
506
  night: /night/i
507
507
  }
508
508
  }, vt = {
509
- ordinalNumber: dt({
510
- matchPattern: mt,
511
- parsePattern: ht,
509
+ ordinalNumber: it({
510
+ matchPattern: ut,
511
+ parsePattern: ct,
512
512
  valueCallback: (e) => parseInt(e, 10)
513
513
  }),
514
514
  era: k({
515
- matchPatterns: gt,
515
+ matchPatterns: ft,
516
516
  defaultMatchWidth: "wide",
517
- parsePatterns: yt,
517
+ parsePatterns: lt,
518
518
  defaultParseWidth: "any"
519
519
  }),
520
520
  quarter: k({
521
- matchPatterns: wt,
521
+ matchPatterns: mt,
522
522
  defaultMatchWidth: "wide",
523
- parsePatterns: bt,
523
+ parsePatterns: dt,
524
524
  defaultParseWidth: "any",
525
525
  valueCallback: (e) => e + 1
526
526
  }),
527
527
  month: k({
528
- matchPatterns: Mt,
528
+ matchPatterns: ht,
529
529
  defaultMatchWidth: "wide",
530
- parsePatterns: pt,
530
+ parsePatterns: gt,
531
531
  defaultParseWidth: "any"
532
532
  }),
533
533
  day: k({
534
- matchPatterns: xt,
534
+ matchPatterns: wt,
535
535
  defaultMatchWidth: "wide",
536
- parsePatterns: Dt,
536
+ parsePatterns: yt,
537
537
  defaultParseWidth: "any"
538
538
  }),
539
539
  dayPeriod: k({
540
- matchPatterns: Ot,
540
+ matchPatterns: bt,
541
541
  defaultMatchWidth: "any",
542
- parsePatterns: Tt,
542
+ parsePatterns: Mt,
543
543
  defaultParseWidth: "any"
544
544
  })
545
- }, de = {
545
+ }, se = {
546
546
  code: "en-US",
547
- formatDistance: Ze,
548
- formatLong: Ke,
549
- formatRelative: tt,
550
- localize: ct,
547
+ formatDistance: He,
548
+ formatLong: Ve,
549
+ formatRelative: Ge,
550
+ localize: at,
551
551
  match: vt,
552
552
  options: {
553
553
  weekStartsOn: 0,
554
554
  firstWeekContainsDate: 1
555
555
  }
556
556
  };
557
- function Pt(e) {
558
- const t = m(e);
559
- return Ee(t, $e(t)) + 1;
560
- }
561
- function St(e) {
562
- const t = m(e), n = +Y(t) - +Le(t);
563
- return Math.round(n / oe) + 1;
564
- }
565
- function me(e, t) {
566
- var u, g, c, h;
567
- const n = m(e), r = n.getFullYear(), a = P(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((g = (u = t == null ? void 0 : t.locale) == null ? void 0 : u.options) == null ? void 0 : g.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((h = (c = a.locale) == null ? void 0 : c.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, s = p(e, 0);
568
- s.setFullYear(r + 1, 0, i), s.setHours(0, 0, 0, 0);
569
- const o = W(s, t), l = p(e, 0);
570
- l.setFullYear(r, 0, i), l.setHours(0, 0, 0, 0);
571
- const f = W(l, t);
572
- return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= f.getTime() ? r : r - 1;
573
- }
574
- function kt(e, t) {
575
- var o, l, f, u;
576
- const n = P(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((l = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : l.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((u = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : u.firstWeekContainsDate) ?? 1, a = me(e, t), i = p(e, 0);
577
- return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), W(i, t);
578
- }
579
- function Wt(e, t) {
580
- const n = m(e), r = +W(n, t) - +kt(n, t);
581
- return Math.round(r / oe) + 1;
582
- }
583
- function d(e, t) {
557
+ function Ot(e) {
558
+ const t = d(e);
559
+ return We(t, ze(t)) + 1;
560
+ }
561
+ function Tt(e) {
562
+ const t = d(e), n = +N(t) - +Ce(t);
563
+ return Math.round(n / ee) + 1;
564
+ }
565
+ function oe(e, t) {
566
+ var c, h, u, g;
567
+ const n = d(e), r = n.getFullYear(), a = P(), s = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((h = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : h.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((g = (u = a.locale) == null ? void 0 : u.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, o = O(e, 0);
568
+ o.setFullYear(r + 1, 0, s), o.setHours(0, 0, 0, 0);
569
+ const i = S(o, t), f = O(e, 0);
570
+ f.setFullYear(r, 0, s), f.setHours(0, 0, 0, 0);
571
+ const l = S(f, t);
572
+ return n.getTime() >= i.getTime() ? r + 1 : n.getTime() >= l.getTime() ? r : r - 1;
573
+ }
574
+ function xt(e, t) {
575
+ var i, f, l, c;
576
+ const n = P(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((f = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : f.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((c = (l = n.locale) == null ? void 0 : l.options) == null ? void 0 : c.firstWeekContainsDate) ?? 1, a = oe(e, t), s = O(e, 0);
577
+ return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), S(s, t);
578
+ }
579
+ function Dt(e, t) {
580
+ const n = d(e), r = +S(n, t) - +xt(n, t);
581
+ return Math.round(r / ee) + 1;
582
+ }
583
+ function m(e, t) {
584
584
  const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
585
585
  return n + r;
586
586
  }
587
- const M = {
587
+ const v = {
588
588
  // Year
589
589
  y(e, t) {
590
590
  const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
591
- return d(t === "yy" ? r % 100 : r, t.length);
591
+ return m(t === "yy" ? r % 100 : r, t.length);
592
592
  },
593
593
  // Month
594
594
  M(e, t) {
595
595
  const n = e.getMonth();
596
- return t === "M" ? String(n + 1) : d(n + 1, 2);
596
+ return t === "M" ? String(n + 1) : m(n + 1, 2);
597
597
  },
598
598
  // Day of the month
599
599
  d(e, t) {
600
- return d(e.getDate(), t.length);
600
+ return m(e.getDate(), t.length);
601
601
  },
602
602
  // AM or PM
603
603
  a(e, t) {
@@ -617,35 +617,35 @@ const M = {
617
617
  },
618
618
  // Hour [1-12]
619
619
  h(e, t) {
620
- return d(e.getHours() % 12 || 12, t.length);
620
+ return m(e.getHours() % 12 || 12, t.length);
621
621
  },
622
622
  // Hour [0-23]
623
623
  H(e, t) {
624
- return d(e.getHours(), t.length);
624
+ return m(e.getHours(), t.length);
625
625
  },
626
626
  // Minute
627
627
  m(e, t) {
628
- return d(e.getMinutes(), t.length);
628
+ return m(e.getMinutes(), t.length);
629
629
  },
630
630
  // Second
631
631
  s(e, t) {
632
- return d(e.getSeconds(), t.length);
632
+ return m(e.getSeconds(), t.length);
633
633
  },
634
634
  // Fraction of second
635
635
  S(e, t) {
636
636
  const n = t.length, r = e.getMilliseconds(), a = Math.trunc(
637
637
  r * Math.pow(10, n - 3)
638
638
  );
639
- return d(a, t.length);
639
+ return m(a, t.length);
640
640
  }
641
- }, T = {
641
+ }, x = {
642
642
  midnight: "midnight",
643
643
  noon: "noon",
644
644
  morning: "morning",
645
645
  afternoon: "afternoon",
646
646
  evening: "evening",
647
647
  night: "night"
648
- }, Z = {
648
+ }, $ = {
649
649
  // Era
650
650
  G: function(e, t, n) {
651
651
  const r = e.getFullYear() > 0 ? 1 : 0;
@@ -667,21 +667,21 @@ const M = {
667
667
  const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
668
668
  return n.ordinalNumber(a, { unit: "year" });
669
669
  }
670
- return M.y(e, t);
670
+ return v.y(e, t);
671
671
  },
672
672
  // Local week-numbering year
673
673
  Y: function(e, t, n, r) {
674
- const a = me(e, r), i = a > 0 ? a : 1 - a;
674
+ const a = oe(e, r), s = a > 0 ? a : 1 - a;
675
675
  if (t === "YY") {
676
- const s = i % 100;
677
- return d(s, 2);
676
+ const o = s % 100;
677
+ return m(o, 2);
678
678
  }
679
- return t === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : d(i, t.length);
679
+ return t === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : m(s, t.length);
680
680
  },
681
681
  // ISO week-numbering year
682
682
  R: function(e, t) {
683
- const n = fe(e);
684
- return d(n, t.length);
683
+ const n = ae(e);
684
+ return m(n, t.length);
685
685
  },
686
686
  // Extended year. This is a single number designating the year of this calendar system.
687
687
  // The main difference between `y` and `u` localizers are B.C. years:
@@ -694,7 +694,7 @@ const M = {
694
694
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
695
695
  u: function(e, t) {
696
696
  const n = e.getFullYear();
697
- return d(n, t.length);
697
+ return m(n, t.length);
698
698
  },
699
699
  // Quarter
700
700
  Q: function(e, t, n) {
@@ -703,7 +703,7 @@ const M = {
703
703
  case "Q":
704
704
  return String(r);
705
705
  case "QQ":
706
- return d(r, 2);
706
+ return m(r, 2);
707
707
  case "Qo":
708
708
  return n.ordinalNumber(r, { unit: "quarter" });
709
709
  case "QQQ":
@@ -731,7 +731,7 @@ const M = {
731
731
  case "q":
732
732
  return String(r);
733
733
  case "qq":
734
- return d(r, 2);
734
+ return m(r, 2);
735
735
  case "qo":
736
736
  return n.ordinalNumber(r, { unit: "quarter" });
737
737
  case "qqq":
@@ -758,7 +758,7 @@ const M = {
758
758
  switch (t) {
759
759
  case "M":
760
760
  case "MM":
761
- return M.M(e, t);
761
+ return v.M(e, t);
762
762
  case "Mo":
763
763
  return n.ordinalNumber(r + 1, { unit: "month" });
764
764
  case "MMM":
@@ -783,7 +783,7 @@ const M = {
783
783
  case "L":
784
784
  return String(r + 1);
785
785
  case "LL":
786
- return d(r + 1, 2);
786
+ return m(r + 1, 2);
787
787
  case "Lo":
788
788
  return n.ordinalNumber(r + 1, { unit: "month" });
789
789
  case "LLL":
@@ -803,22 +803,22 @@ const M = {
803
803
  },
804
804
  // Local week of year
805
805
  w: function(e, t, n, r) {
806
- const a = Wt(e, r);
807
- return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : d(a, t.length);
806
+ const a = Dt(e, r);
807
+ return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : m(a, t.length);
808
808
  },
809
809
  // ISO week of year
810
810
  I: function(e, t, n) {
811
- const r = St(e);
812
- return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : d(r, t.length);
811
+ const r = Tt(e);
812
+ return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : m(r, t.length);
813
813
  },
814
814
  // Day of the month
815
815
  d: function(e, t, n) {
816
- return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : M.d(e, t);
816
+ return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : v.d(e, t);
817
817
  },
818
818
  // Day of year
819
819
  D: function(e, t, n) {
820
- const r = Pt(e);
821
- return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : d(r, t.length);
820
+ const r = Ot(e);
821
+ return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : m(r, t.length);
822
822
  },
823
823
  // Day of week
824
824
  E: function(e, t, n) {
@@ -851,14 +851,14 @@ const M = {
851
851
  },
852
852
  // Local day of week
853
853
  e: function(e, t, n, r) {
854
- const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
854
+ const a = e.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
855
855
  switch (t) {
856
856
  case "e":
857
- return String(i);
857
+ return String(s);
858
858
  case "ee":
859
- return d(i, 2);
859
+ return m(s, 2);
860
860
  case "eo":
861
- return n.ordinalNumber(i, { unit: "day" });
861
+ return n.ordinalNumber(s, { unit: "day" });
862
862
  case "eee":
863
863
  return n.day(a, {
864
864
  width: "abbreviated",
@@ -884,14 +884,14 @@ const M = {
884
884
  },
885
885
  // Stand-alone local day of week
886
886
  c: function(e, t, n, r) {
887
- const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
887
+ const a = e.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
888
888
  switch (t) {
889
889
  case "c":
890
- return String(i);
890
+ return String(s);
891
891
  case "cc":
892
- return d(i, t.length);
892
+ return m(s, t.length);
893
893
  case "co":
894
- return n.ordinalNumber(i, { unit: "day" });
894
+ return n.ordinalNumber(s, { unit: "day" });
895
895
  case "ccc":
896
896
  return n.day(a, {
897
897
  width: "abbreviated",
@@ -922,7 +922,7 @@ const M = {
922
922
  case "i":
923
923
  return String(a);
924
924
  case "ii":
925
- return d(a, t.length);
925
+ return m(a, t.length);
926
926
  case "io":
927
927
  return n.ordinalNumber(a, { unit: "day" });
928
928
  case "iii":
@@ -980,7 +980,7 @@ const M = {
980
980
  b: function(e, t, n) {
981
981
  const r = e.getHours();
982
982
  let a;
983
- switch (r === 12 ? a = T.noon : r === 0 ? a = T.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
983
+ switch (r === 12 ? a = x.noon : r === 0 ? a = x.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
984
984
  case "b":
985
985
  case "bb":
986
986
  return n.dayPeriod(a, {
@@ -1009,7 +1009,7 @@ const M = {
1009
1009
  B: function(e, t, n) {
1010
1010
  const r = e.getHours();
1011
1011
  let a;
1012
- switch (r >= 17 ? a = T.evening : r >= 12 ? a = T.afternoon : r >= 4 ? a = T.morning : a = T.night, t) {
1012
+ switch (r >= 17 ? a = x.evening : r >= 12 ? a = x.afternoon : r >= 4 ? a = x.morning : a = x.night, t) {
1013
1013
  case "B":
1014
1014
  case "BB":
1015
1015
  case "BBB":
@@ -1036,33 +1036,33 @@ const M = {
1036
1036
  let r = e.getHours() % 12;
1037
1037
  return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
1038
1038
  }
1039
- return M.h(e, t);
1039
+ return v.h(e, t);
1040
1040
  },
1041
1041
  // Hour [0-23]
1042
1042
  H: function(e, t, n) {
1043
- return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : M.H(e, t);
1043
+ return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : v.H(e, t);
1044
1044
  },
1045
1045
  // Hour [0-11]
1046
1046
  K: function(e, t, n) {
1047
1047
  const r = e.getHours() % 12;
1048
- return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : d(r, t.length);
1048
+ return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : m(r, t.length);
1049
1049
  },
1050
1050
  // Hour [1-24]
1051
1051
  k: function(e, t, n) {
1052
1052
  let r = e.getHours();
1053
- return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : d(r, t.length);
1053
+ return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : m(r, t.length);
1054
1054
  },
1055
1055
  // Minute
1056
1056
  m: function(e, t, n) {
1057
- return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : M.m(e, t);
1057
+ return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : v.m(e, t);
1058
1058
  },
1059
1059
  // Second
1060
1060
  s: function(e, t, n) {
1061
- return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : M.s(e, t);
1061
+ return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : v.s(e, t);
1062
1062
  },
1063
1063
  // Fraction of second
1064
1064
  S: function(e, t) {
1065
- return M.S(e, t);
1065
+ return v.S(e, t);
1066
1066
  },
1067
1067
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1068
1068
  X: function(e, t, n) {
@@ -1071,14 +1071,14 @@ const M = {
1071
1071
  return "Z";
1072
1072
  switch (t) {
1073
1073
  case "X":
1074
- return Q(r);
1074
+ return V(r);
1075
1075
  case "XXXX":
1076
1076
  case "XX":
1077
- return D(r);
1077
+ return T(r);
1078
1078
  case "XXXXX":
1079
1079
  case "XXX":
1080
1080
  default:
1081
- return D(r, ":");
1081
+ return T(r, ":");
1082
1082
  }
1083
1083
  },
1084
1084
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
@@ -1086,14 +1086,14 @@ const M = {
1086
1086
  const r = e.getTimezoneOffset();
1087
1087
  switch (t) {
1088
1088
  case "x":
1089
- return Q(r);
1089
+ return V(r);
1090
1090
  case "xxxx":
1091
1091
  case "xx":
1092
- return D(r);
1092
+ return T(r);
1093
1093
  case "xxxxx":
1094
1094
  case "xxx":
1095
1095
  default:
1096
- return D(r, ":");
1096
+ return T(r, ":");
1097
1097
  }
1098
1098
  },
1099
1099
  // Timezone (GMT)
@@ -1103,10 +1103,10 @@ const M = {
1103
1103
  case "O":
1104
1104
  case "OO":
1105
1105
  case "OOO":
1106
- return "GMT" + G(r, ":");
1106
+ return "GMT" + Z(r, ":");
1107
1107
  case "OOOO":
1108
1108
  default:
1109
- return "GMT" + D(r, ":");
1109
+ return "GMT" + T(r, ":");
1110
1110
  }
1111
1111
  },
1112
1112
  // Timezone (specific non-location)
@@ -1116,35 +1116,35 @@ const M = {
1116
1116
  case "z":
1117
1117
  case "zz":
1118
1118
  case "zzz":
1119
- return "GMT" + G(r, ":");
1119
+ return "GMT" + Z(r, ":");
1120
1120
  case "zzzz":
1121
1121
  default:
1122
- return "GMT" + D(r, ":");
1122
+ return "GMT" + T(r, ":");
1123
1123
  }
1124
1124
  },
1125
1125
  // Seconds timestamp
1126
1126
  t: function(e, t, n) {
1127
1127
  const r = Math.trunc(e.getTime() / 1e3);
1128
- return d(r, t.length);
1128
+ return m(r, t.length);
1129
1129
  },
1130
1130
  // Milliseconds timestamp
1131
1131
  T: function(e, t, n) {
1132
1132
  const r = e.getTime();
1133
- return d(r, t.length);
1133
+ return m(r, t.length);
1134
1134
  }
1135
1135
  };
1136
- function G(e, t = "") {
1137
- const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), i = r % 60;
1138
- return i === 0 ? n + String(a) : n + String(a) + t + d(i, 2);
1136
+ function Z(e, t = "") {
1137
+ const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), s = r % 60;
1138
+ return s === 0 ? n + String(a) : n + String(a) + t + m(s, 2);
1139
1139
  }
1140
- function Q(e, t) {
1141
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + d(Math.abs(e) / 60, 2) : D(e, t);
1140
+ function V(e, t) {
1141
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + m(Math.abs(e) / 60, 2) : T(e, t);
1142
1142
  }
1143
- function D(e, t = "") {
1144
- const n = e > 0 ? "-" : "+", r = Math.abs(e), a = d(Math.trunc(r / 60), 2), i = d(r % 60, 2);
1145
- return n + a + t + i;
1143
+ function T(e, t = "") {
1144
+ const n = e > 0 ? "-" : "+", r = Math.abs(e), a = m(Math.trunc(r / 60), 2), s = m(r % 60, 2);
1145
+ return n + a + t + s;
1146
1146
  }
1147
- const J = (e, t) => {
1147
+ const Q = (e, t) => {
1148
1148
  switch (e) {
1149
1149
  case "P":
1150
1150
  return t.date({ width: "short" });
@@ -1156,7 +1156,7 @@ const J = (e, t) => {
1156
1156
  default:
1157
1157
  return t.date({ width: "full" });
1158
1158
  }
1159
- }, he = (e, t) => {
1159
+ }, ie = (e, t) => {
1160
1160
  switch (e) {
1161
1161
  case "p":
1162
1162
  return t.time({ width: "short" });
@@ -1168,155 +1168,155 @@ const J = (e, t) => {
1168
1168
  default:
1169
1169
  return t.time({ width: "full" });
1170
1170
  }
1171
- }, Ct = (e, t) => {
1171
+ }, Pt = (e, t) => {
1172
1172
  const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1173
1173
  if (!a)
1174
- return J(e, t);
1175
- let i;
1174
+ return Q(e, t);
1175
+ let s;
1176
1176
  switch (r) {
1177
1177
  case "P":
1178
- i = t.dateTime({ width: "short" });
1178
+ s = t.dateTime({ width: "short" });
1179
1179
  break;
1180
1180
  case "PP":
1181
- i = t.dateTime({ width: "medium" });
1181
+ s = t.dateTime({ width: "medium" });
1182
1182
  break;
1183
1183
  case "PPP":
1184
- i = t.dateTime({ width: "long" });
1184
+ s = t.dateTime({ width: "long" });
1185
1185
  break;
1186
1186
  case "PPPP":
1187
1187
  default:
1188
- i = t.dateTime({ width: "full" });
1188
+ s = t.dateTime({ width: "full" });
1189
1189
  break;
1190
1190
  }
1191
- return i.replace("{{date}}", J(r, t)).replace("{{time}}", he(a, t));
1192
- }, Ft = {
1193
- p: he,
1194
- P: Ct
1195
- }, Nt = /^D+$/, Yt = /^Y+$/, Et = ["D", "DD", "YY", "YYYY"];
1196
- function Lt(e) {
1197
- return Nt.test(e);
1198
- }
1199
- function _t(e) {
1200
- return Yt.test(e);
1201
- }
1202
- function zt(e, t, n) {
1203
- const r = Xt(e, t, n);
1204
- if (console.warn(r), Et.includes(e)) throw new RangeError(r);
1205
- }
1206
- function Xt(e, t, n) {
1191
+ return s.replace("{{date}}", Q(r, t)).replace("{{time}}", ie(a, t));
1192
+ }, pt = {
1193
+ p: ie,
1194
+ P: Pt
1195
+ }, kt = /^D+$/, St = /^Y+$/, Wt = ["D", "DD", "YY", "YYYY"];
1196
+ function Ct(e) {
1197
+ return kt.test(e);
1198
+ }
1199
+ function Nt(e) {
1200
+ return St.test(e);
1201
+ }
1202
+ function Yt(e, t, n) {
1203
+ const r = Et(e, t, n);
1204
+ if (console.warn(r), Wt.includes(e)) throw new RangeError(r);
1205
+ }
1206
+ function Et(e, t, n) {
1207
1207
  const r = e[0] === "Y" ? "years" : "days of the month";
1208
1208
  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`;
1209
1209
  }
1210
- const It = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, qt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ht = /^'([^]*?)'?$/, Rt = /''/g, At = /[a-zA-Z]/;
1211
- function H(e, t, n) {
1212
- var u, g, c, h, y, O, A, j;
1213
- const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? de, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((g = (u = n == null ? void 0 : n.locale) == null ? void 0 : u.options) == null ? void 0 : g.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((h = (c = r.locale) == null ? void 0 : c.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, s = (n == null ? void 0 : n.weekStartsOn) ?? ((O = (y = n == null ? void 0 : n.locale) == null ? void 0 : y.options) == null ? void 0 : O.weekStartsOn) ?? r.weekStartsOn ?? ((j = (A = r.locale) == null ? void 0 : A.options) == null ? void 0 : j.weekStartsOn) ?? 0, o = m(e);
1214
- if (!Xe(o))
1210
+ const Ft = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Lt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Xt = /^'([^]*?)'?$/, It = /''/g, _t = /[a-zA-Z]/;
1211
+ function I(e, t, n) {
1212
+ var c, h, u, g, w, M, A, R;
1213
+ const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? se, s = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((h = (c = n == null ? void 0 : n.locale) == null ? void 0 : c.options) == null ? void 0 : h.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((g = (u = r.locale) == null ? void 0 : u.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, o = (n == null ? void 0 : n.weekStartsOn) ?? ((M = (w = n == null ? void 0 : n.locale) == null ? void 0 : w.options) == null ? void 0 : M.weekStartsOn) ?? r.weekStartsOn ?? ((R = (A = r.locale) == null ? void 0 : A.options) == null ? void 0 : R.weekStartsOn) ?? 0, i = d(e);
1214
+ if (!Ee(i))
1215
1215
  throw new RangeError("Invalid time value");
1216
- let l = t.match(qt).map((b) => {
1217
- const w = b[0];
1218
- if (w === "p" || w === "P") {
1219
- const _ = Ft[w];
1220
- return _(b, a.formatLong);
1216
+ let f = t.match(Lt).map((b) => {
1217
+ const y = b[0];
1218
+ if (y === "p" || y === "P") {
1219
+ const F = pt[y];
1220
+ return F(b, a.formatLong);
1221
1221
  }
1222
1222
  return b;
1223
- }).join("").match(It).map((b) => {
1223
+ }).join("").match(Ft).map((b) => {
1224
1224
  if (b === "''")
1225
1225
  return { isToken: !1, value: "'" };
1226
- const w = b[0];
1227
- if (w === "'")
1228
- return { isToken: !1, value: jt(b) };
1229
- if (Z[w])
1226
+ const y = b[0];
1227
+ if (y === "'")
1228
+ return { isToken: !1, value: qt(b) };
1229
+ if ($[y])
1230
1230
  return { isToken: !0, value: b };
1231
- if (w.match(At))
1231
+ if (y.match(_t))
1232
1232
  throw new RangeError(
1233
- "Format string contains an unescaped latin alphabet character `" + w + "`"
1233
+ "Format string contains an unescaped latin alphabet character `" + y + "`"
1234
1234
  );
1235
1235
  return { isToken: !1, value: b };
1236
1236
  });
1237
- a.localize.preprocessor && (l = a.localize.preprocessor(o, l));
1238
- const f = {
1239
- firstWeekContainsDate: i,
1240
- weekStartsOn: s,
1237
+ a.localize.preprocessor && (f = a.localize.preprocessor(i, f));
1238
+ const l = {
1239
+ firstWeekContainsDate: s,
1240
+ weekStartsOn: o,
1241
1241
  locale: a
1242
1242
  };
1243
- return l.map((b) => {
1243
+ return f.map((b) => {
1244
1244
  if (!b.isToken) return b.value;
1245
- const w = b.value;
1246
- (!(n != null && n.useAdditionalWeekYearTokens) && _t(w) || !(n != null && n.useAdditionalDayOfYearTokens) && Lt(w)) && zt(w, t, String(e));
1247
- const _ = Z[w[0]];
1248
- return _(o, w, a.localize, f);
1245
+ const y = b.value;
1246
+ (!(n != null && n.useAdditionalWeekYearTokens) && Nt(y) || !(n != null && n.useAdditionalDayOfYearTokens) && Ct(y)) && Yt(y, t, String(e));
1247
+ const F = $[y[0]];
1248
+ return F(i, y, a.localize, l);
1249
1249
  }).join("");
1250
1250
  }
1251
- function jt(e) {
1252
- const t = e.match(Ht);
1253
- return t ? t[1].replace(Rt, "'") : e;
1251
+ function qt(e) {
1252
+ const t = e.match(Xt);
1253
+ return t ? t[1].replace(It, "'") : e;
1254
1254
  }
1255
- function Ut(e, t, n) {
1256
- const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? de, i = 2520, s = F(e, t);
1257
- if (isNaN(s))
1255
+ function At(e, t, n) {
1256
+ const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? se, s = 2520, o = C(e, t);
1257
+ if (isNaN(o))
1258
1258
  throw new RangeError("Invalid time value");
1259
- const o = Object.assign({}, n, {
1259
+ const i = Object.assign({}, n, {
1260
1260
  addSuffix: n == null ? void 0 : n.addSuffix,
1261
- comparison: s
1261
+ comparison: o
1262
1262
  });
1263
- let l, f;
1264
- s > 0 ? (l = m(t), f = m(e)) : (l = m(e), f = m(t));
1265
- const u = Be(f, l), g = (E(f) - E(l)) / 1e3, c = Math.round((u - g) / 60);
1266
- let h;
1267
- if (c < 2)
1268
- return n != null && n.includeSeconds ? u < 5 ? a.formatDistance("lessThanXSeconds", 5, o) : u < 10 ? a.formatDistance("lessThanXSeconds", 10, o) : u < 20 ? a.formatDistance("lessThanXSeconds", 20, o) : u < 40 ? a.formatDistance("halfAMinute", 0, o) : u < 60 ? a.formatDistance("lessThanXMinutes", 1, o) : a.formatDistance("xMinutes", 1, o) : c === 0 ? a.formatDistance("lessThanXMinutes", 1, o) : a.formatDistance("xMinutes", c, o);
1269
- if (c < 45)
1270
- return a.formatDistance("xMinutes", c, o);
1271
- if (c < 90)
1272
- return a.formatDistance("aboutXHours", 1, o);
1273
- if (c < $) {
1274
- const y = Math.round(c / 60);
1275
- return a.formatDistance("aboutXHours", y, o);
1263
+ let f, l;
1264
+ o > 0 ? (f = d(t), l = d(e)) : (f = d(e), l = d(t));
1265
+ const c = Re(l, f), h = (Y(l) - Y(f)) / 1e3, u = Math.round((c - h) / 60);
1266
+ let g;
1267
+ if (u < 2)
1268
+ return n != null && n.includeSeconds ? c < 5 ? a.formatDistance("lessThanXSeconds", 5, i) : c < 10 ? a.formatDistance("lessThanXSeconds", 10, i) : c < 20 ? a.formatDistance("lessThanXSeconds", 20, i) : c < 40 ? a.formatDistance("halfAMinute", 0, i) : c < 60 ? a.formatDistance("lessThanXMinutes", 1, i) : a.formatDistance("xMinutes", 1, i) : u === 0 ? a.formatDistance("lessThanXMinutes", 1, i) : a.formatDistance("xMinutes", u, i);
1269
+ if (u < 45)
1270
+ return a.formatDistance("xMinutes", u, i);
1271
+ if (u < 90)
1272
+ return a.formatDistance("aboutXHours", 1, i);
1273
+ if (u < H) {
1274
+ const w = Math.round(u / 60);
1275
+ return a.formatDistance("aboutXHours", w, i);
1276
1276
  } else {
1277
- if (c < i)
1278
- return a.formatDistance("xDays", 1, o);
1279
- if (c < C) {
1280
- const y = Math.round(c / $);
1281
- return a.formatDistance("xDays", y, o);
1282
- } else if (c < C * 2)
1283
- return h = Math.round(c / C), a.formatDistance("aboutXMonths", h, o);
1277
+ if (u < s)
1278
+ return a.formatDistance("xDays", 1, i);
1279
+ if (u < W) {
1280
+ const w = Math.round(u / H);
1281
+ return a.formatDistance("xDays", w, i);
1282
+ } else if (u < W * 2)
1283
+ return g = Math.round(u / W), a.formatDistance("aboutXMonths", g, i);
1284
1284
  }
1285
- if (h = Ue(f, l), h < 12) {
1286
- const y = Math.round(c / C);
1287
- return a.formatDistance("xMonths", y, o);
1285
+ if (g = Ae(l, f), g < 12) {
1286
+ const w = Math.round(u / W);
1287
+ return a.formatDistance("xMonths", w, i);
1288
1288
  } else {
1289
- const y = h % 12, O = Math.trunc(h / 12);
1290
- return y < 3 ? a.formatDistance("aboutXYears", O, o) : y < 9 ? a.formatDistance("overXYears", O, o) : a.formatDistance("almostXYears", O + 1, o);
1289
+ const w = g % 12, M = Math.trunc(g / 12);
1290
+ return w < 3 ? a.formatDistance("aboutXYears", M, i) : w < 9 ? a.formatDistance("overXYears", M, i) : a.formatDistance("almostXYears", M + 1, i);
1291
1291
  }
1292
1292
  }
1293
- function Bt(e, t) {
1294
- return Ut(e, _e(e), t);
1293
+ function Rt(e, t) {
1294
+ return At(e, Ne(e), t);
1295
1295
  }
1296
- function $t() {
1296
+ function zt() {
1297
1297
  return Object.assign({}, P());
1298
1298
  }
1299
- function K(e, t, n) {
1300
- const r = $t(), a = Gt(e, n.timeZone, n.locale ?? r.locale);
1301
- return "formatToParts" in a ? Vt(a, t) : Zt(a, t);
1299
+ function G(e, t, n) {
1300
+ const r = zt(), a = Bt(e, n.timeZone, n.locale ?? r.locale);
1301
+ return "formatToParts" in a ? jt(a, t) : Ht(a, t);
1302
1302
  }
1303
- function Vt(e, t) {
1303
+ function jt(e, t) {
1304
1304
  const n = e.formatToParts(t);
1305
1305
  for (let r = n.length - 1; r >= 0; --r)
1306
1306
  if (n[r].type === "timeZoneName")
1307
1307
  return n[r].value;
1308
1308
  }
1309
- function Zt(e, t) {
1309
+ function Ht(e, t) {
1310
1310
  const n = e.format(t).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
1311
1311
  return r ? r[0].substr(1) : "";
1312
1312
  }
1313
- function Gt(e, t, n) {
1313
+ function Bt(e, t, n) {
1314
1314
  return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
1315
1315
  timeZone: t,
1316
1316
  timeZoneName: e
1317
1317
  });
1318
1318
  }
1319
- const Qt = 60 * 1e3, Jt = {
1319
+ const $t = 60 * 1e3, Zt = {
1320
1320
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1321
1321
  X: function(e, t, n) {
1322
1322
  const r = X(n.timeZone, e);
@@ -1324,14 +1324,14 @@ const Qt = 60 * 1e3, Jt = {
1324
1324
  return "Z";
1325
1325
  switch (t) {
1326
1326
  case "X":
1327
- return ee(r);
1327
+ return U(r);
1328
1328
  case "XXXX":
1329
1329
  case "XX":
1330
- return v(r);
1330
+ return D(r);
1331
1331
  case "XXXXX":
1332
1332
  case "XXX":
1333
1333
  default:
1334
- return v(r, ":");
1334
+ return D(r, ":");
1335
1335
  }
1336
1336
  },
1337
1337
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
@@ -1339,14 +1339,14 @@ const Qt = 60 * 1e3, Jt = {
1339
1339
  const r = X(n.timeZone, e);
1340
1340
  switch (t) {
1341
1341
  case "x":
1342
- return ee(r);
1342
+ return U(r);
1343
1343
  case "xxxx":
1344
1344
  case "xx":
1345
- return v(r);
1345
+ return D(r);
1346
1346
  case "xxxxx":
1347
1347
  case "xxx":
1348
1348
  default:
1349
- return v(r, ":");
1349
+ return D(r, ":");
1350
1350
  }
1351
1351
  },
1352
1352
  // Timezone (GMT)
@@ -1356,10 +1356,10 @@ const Qt = 60 * 1e3, Jt = {
1356
1356
  case "O":
1357
1357
  case "OO":
1358
1358
  case "OOO":
1359
- return "GMT" + Kt(r, ":");
1359
+ return "GMT" + Vt(r, ":");
1360
1360
  case "OOOO":
1361
1361
  default:
1362
- return "GMT" + v(r, ":");
1362
+ return "GMT" + D(r, ":");
1363
1363
  }
1364
1364
  },
1365
1365
  // Timezone (specific non-location)
@@ -1368,79 +1368,79 @@ const Qt = 60 * 1e3, Jt = {
1368
1368
  case "z":
1369
1369
  case "zz":
1370
1370
  case "zzz":
1371
- return K("short", e, n);
1371
+ return G("short", e, n);
1372
1372
  case "zzzz":
1373
1373
  default:
1374
- return K("long", e, n);
1374
+ return G("long", e, n);
1375
1375
  }
1376
1376
  }
1377
1377
  };
1378
1378
  function X(e, t) {
1379
- const n = e ? ue(e, t, !0) / Qt : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
1379
+ const n = e ? te(e, t, !0) / $t : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
1380
1380
  if (Number.isNaN(n))
1381
1381
  throw new RangeError("Invalid time zone specified: " + e);
1382
1382
  return n;
1383
1383
  }
1384
- function L(e, t) {
1384
+ function E(e, t) {
1385
1385
  const n = e < 0 ? "-" : "";
1386
1386
  let r = Math.abs(e).toString();
1387
1387
  for (; r.length < t; )
1388
1388
  r = "0" + r;
1389
1389
  return n + r;
1390
1390
  }
1391
- function v(e, t = "") {
1392
- const n = e > 0 ? "-" : "+", r = Math.abs(e), a = L(Math.floor(r / 60), 2), i = L(Math.floor(r % 60), 2);
1393
- return n + a + t + i;
1391
+ function D(e, t = "") {
1392
+ const n = e > 0 ? "-" : "+", r = Math.abs(e), a = E(Math.floor(r / 60), 2), s = E(Math.floor(r % 60), 2);
1393
+ return n + a + t + s;
1394
1394
  }
1395
- function ee(e, t) {
1396
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + L(Math.abs(e) / 60, 2) : v(e, t);
1395
+ function U(e, t) {
1396
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + E(Math.abs(e) / 60, 2) : D(e, t);
1397
1397
  }
1398
- function Kt(e, t = "") {
1399
- const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60), i = r % 60;
1400
- return i === 0 ? n + String(a) : n + String(a) + t + L(i, 2);
1398
+ function Vt(e, t = "") {
1399
+ const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60), s = r % 60;
1400
+ return s === 0 ? n + String(a) : n + String(a) + t + E(s, 2);
1401
1401
  }
1402
- const en = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
1403
- function tn(e, t, n = {}) {
1402
+ const Qt = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
1403
+ function Gt(e, t, n = {}) {
1404
1404
  t = String(t);
1405
- const r = t.match(en);
1405
+ const r = t.match(Qt);
1406
1406
  if (r) {
1407
- const a = ce(n.originalDate || e, n);
1408
- t = r.reduce(function(i, s) {
1409
- if (s[0] === "'")
1410
- return i;
1411
- const o = i.indexOf(s), l = i[o - 1] === "'", f = i.replace(s, "'" + Jt[s[0]](a, s, n) + "'");
1412
- return l ? f.substring(0, o - 1) + f.substring(o + 1) : f;
1407
+ const a = ne(n.originalDate || e, n);
1408
+ t = r.reduce(function(s, o) {
1409
+ if (o[0] === "'")
1410
+ return s;
1411
+ const i = s.indexOf(o), f = s[i - 1] === "'", l = s.replace(o, "'" + Zt[o[0]](a, o, n) + "'");
1412
+ return f ? l.substring(0, i - 1) + l.substring(i + 1) : l;
1413
1413
  }, t);
1414
1414
  }
1415
- return H(e, t, n);
1415
+ return I(e, t, n);
1416
1416
  }
1417
- function nn(e, t, n) {
1418
- e = ce(e, n);
1419
- const r = ue(t, e, !0), a = new Date(e.getTime() - r), i = /* @__PURE__ */ new Date(0);
1420
- return i.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), i.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), i;
1417
+ function Ut(e, t, n) {
1418
+ e = ne(e, n);
1419
+ const r = te(t, e, !0), a = new Date(e.getTime() - r), s = /* @__PURE__ */ new Date(0);
1420
+ return s.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), s.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), s;
1421
1421
  }
1422
- function ge(e, t, n, r) {
1422
+ function ue(e, t, n, r) {
1423
1423
  return r = {
1424
1424
  ...r,
1425
1425
  timeZone: t,
1426
1426
  originalDate: e
1427
- }, tn(nn(e, t, { timeZone: r.timeZone }), n, r);
1427
+ }, Gt(Ut(e, t, { timeZone: r.timeZone }), n, r);
1428
1428
  }
1429
- function vn(e, t) {
1429
+ function xn(e, t) {
1430
1430
  return e && e !== "auto" ? e : t;
1431
1431
  }
1432
- function Pn(e, t = /* @__PURE__ */ new Date()) {
1432
+ function Dn(e, t = /* @__PURE__ */ new Date()) {
1433
1433
  try {
1434
1434
  const n = {
1435
1435
  timeZone: e,
1436
1436
  timeZoneName: "short"
1437
- }, a = new Intl.DateTimeFormat("en-US", n).formatToParts(t).find((i) => i.type === "timeZoneName");
1437
+ }, a = new Intl.DateTimeFormat("en-US", n).formatToParts(t).find((s) => s.type === "timeZoneName");
1438
1438
  return (a == null ? void 0 : a.value) || e;
1439
1439
  } catch {
1440
1440
  return e;
1441
1441
  }
1442
1442
  }
1443
- function Sn(e) {
1443
+ function Pn(e) {
1444
1444
  try {
1445
1445
  const t = {
1446
1446
  timeZone: e,
@@ -1453,7 +1453,7 @@ function Sn(e) {
1453
1453
  return e;
1454
1454
  }
1455
1455
  }
1456
- function R(e, t = "auto") {
1456
+ function _(e, t = "auto") {
1457
1457
  if (!e)
1458
1458
  return /* @__PURE__ */ new Date(NaN);
1459
1459
  const n = e.endsWith("Z"), r = /[+-]\d{2}:?\d{2}$/.test(e), a = /\([A-Z]{3,4}\)$/.test(e);
@@ -1461,77 +1461,77 @@ function R(e, t = "auto") {
1461
1461
  return n || r || a ? new Date(e) : /* @__PURE__ */ new Date(e + "Z");
1462
1462
  if (t === "local") {
1463
1463
  if (n || r) {
1464
- const i = e.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
1465
- return new Date(i);
1464
+ const s = e.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
1465
+ return new Date(s);
1466
1466
  }
1467
1467
  return new Date(e);
1468
- } 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);
1468
+ } else return t === "UTC" ? n ? new Date(e) : r ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || r || a ? new Date(e) : we(e, t);
1469
1469
  }
1470
- const rn = "MM/dd/yyyy", an = (e, t, n, r = "auto") => {
1470
+ const Jt = "MM/dd/yyyy", Kt = (e, t, n, r = "auto") => {
1471
1471
  if (!e)
1472
1472
  return "";
1473
1473
  try {
1474
- const a = R(e, r);
1474
+ const a = _(e, r);
1475
1475
  if (isNaN(a.getTime()))
1476
1476
  return e;
1477
- const s = (t && t.trim() ? t : rn).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
1478
- return n && n !== "auto" ? ge(a, n, s) : H(a, s);
1477
+ const o = (t && t.trim() ? t : Jt).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
1478
+ return n && n !== "auto" ? ue(a, n, o) : I(a, o);
1479
1479
  } catch (a) {
1480
1480
  return console.error("Date formatting error:", a), e;
1481
1481
  }
1482
1482
  };
1483
- function kn(e, t, n = "auto") {
1483
+ function pn(e, t, n = "auto") {
1484
1484
  if (e)
1485
1485
  try {
1486
- const r = R(e, n);
1486
+ const r = _(e, n);
1487
1487
  if (isNaN(r.getTime())) return;
1488
- const a = "yyyy M d H m s", i = t && t !== "auto" ? ge(r, t, a) : H(r, a), [s, o, l, f, u, g] = i.split(" ").map(Number);
1489
- return { year: s, month: o, day: l, hour: f, minute: u, second: g };
1488
+ const a = "yyyy M d H m s", s = t && t !== "auto" ? ue(r, t, a) : I(r, a), [o, i, f, l, c, h] = s.split(" ").map(Number);
1489
+ return { year: o, month: i, day: f, hour: l, minute: c, second: h };
1490
1490
  } catch {
1491
1491
  return;
1492
1492
  }
1493
1493
  }
1494
- const sn = (e, t = "auto") => {
1494
+ const en = (e, t = "auto") => {
1495
1495
  if (!e)
1496
1496
  return "";
1497
1497
  try {
1498
- const n = R(e, t);
1499
- return isNaN(n.getTime()) ? e : Bt(n, { addSuffix: !0 });
1498
+ const n = _(e, t);
1499
+ return isNaN(n.getTime()) ? e : Rt(n, { addSuffix: !0 });
1500
1500
  } catch (n) {
1501
1501
  return console.error("Relative time formatting error:", n), e;
1502
1502
  }
1503
1503
  };
1504
- function on(e, t, n, r) {
1505
- const a = e instanceof Date ? e.toISOString() : String(e), i = (r == null ? void 0 : r.browserTimezone) || n, s = (r == null ? void 0 : r.isSqlCard) ?? !1;
1504
+ function tn(e, t, n, r) {
1505
+ const a = e instanceof Date ? e.toISOString() : String(e), s = (r == null ? void 0 : r.browserTimezone) || n, o = (r == null ? void 0 : r.isSqlCard) ?? !1;
1506
1506
  if (t != null && t.useRelativeTime)
1507
- return sn(
1507
+ return en(
1508
1508
  a,
1509
1509
  (t == null ? void 0 : t.sourceTimezone) || "auto"
1510
1510
  );
1511
- const o = t != null && t.useCustomFormat && (t != null && t.customFormat) ? t.customFormat : (t == null ? void 0 : t.format) || "MM/dd/yyyy";
1512
- return an(
1511
+ const i = t != null && t.useCustomFormat && (t != null && t.customFormat) ? t.customFormat : (t == null ? void 0 : t.format) || "MM/dd/yyyy";
1512
+ return Kt(
1513
1513
  a,
1514
- o,
1515
- t != null && t.timezone && (t == null ? void 0 : t.timezone) !== "auto" ? t.timezone : s ? i : n,
1514
+ i,
1515
+ t != null && t.timezone && (t == null ? void 0 : t.timezone) !== "auto" ? t.timezone : o ? s : n,
1516
1516
  (t == null ? void 0 : t.sourceTimezone) || "auto"
1517
1517
  );
1518
1518
  }
1519
- function ye(e, t, n) {
1520
- var s, o;
1519
+ function ce(e, t, n) {
1520
+ var o, i;
1521
1521
  if (e == null)
1522
- return e === null ? ((s = n.absence) == null ? void 0 : s.nullText) ?? "" : ((o = n.absence) == null ? void 0 : o.emptyText) ?? "";
1523
- const r = Me(e) ? e : void 0, a = r ? r.value : e, i = r ?? (typeof e == "number" ? e : void 0);
1522
+ return e === null ? ((o = n.absence) == null ? void 0 : o.nullText) ?? "" : ((i = n.absence) == null ? void 0 : i.emptyText) ?? "";
1523
+ const r = me(e) ? e : void 0, a = r ? r.value : e, s = r ?? (typeof e == "number" ? e : void 0);
1524
1524
  if (!n.useFormattedValues || !t)
1525
1525
  return String(a);
1526
1526
  switch (t.type) {
1527
1527
  case "number":
1528
- return i !== void 0 ? ve(
1529
- i,
1528
+ return s !== void 0 ? ye(
1529
+ s,
1530
1530
  t.numberFormat,
1531
1531
  n.locale
1532
1532
  ) : String(a);
1533
1533
  case "date":
1534
- return on(
1534
+ return tn(
1535
1535
  a,
1536
1536
  t.dateFormat,
1537
1537
  n.timezone,
@@ -1541,7 +1541,7 @@ function ye(e, t, n) {
1541
1541
  }
1542
1542
  );
1543
1543
  case "progress":
1544
- return i !== void 0 ? `${a}%` : String(a);
1544
+ return s !== void 0 ? `${a}%` : String(a);
1545
1545
  case "badge":
1546
1546
  case "link":
1547
1547
  case "text":
@@ -1550,197 +1550,110 @@ function ye(e, t, n) {
1550
1550
  return String(a);
1551
1551
  }
1552
1552
  }
1553
- function Wn(e, t) {
1553
+ function kn(e, t) {
1554
1554
  return t.visibleColumns.map((n) => {
1555
1555
  const r = e[n], a = t.columnSettings[n];
1556
- return ye(r, a, {
1556
+ return ce(r, a, {
1557
1557
  useFormattedValues: t.useFormattedValues,
1558
1558
  timezone: t.timezone,
1559
1559
  locale: t.locale
1560
1560
  });
1561
1561
  });
1562
1562
  }
1563
- const un = "en-US", te = [
1564
- "compact",
1565
- "maximumFractionDigits",
1566
- "minimumFractionDigits",
1567
- "negativeStyle",
1568
- "type",
1569
- "useGrouping"
1570
- ];
1571
- function cn(e) {
1572
- if (e.type !== "currency" || Object.prototype.hasOwnProperty.call(e, "currency") || Object.prototype.hasOwnProperty.call(e, "locale"))
1573
- return !1;
1574
- const t = Object.keys(e).sort();
1575
- return t.length === te.length && te.every(
1576
- (n, r) => t[r] === n
1577
- ) && typeof e.minimumFractionDigits == "number" && typeof e.maximumFractionDigits == "number" && e.useGrouping === !0 && e.negativeStyle === "minus" && typeof e.compact == "boolean";
1578
- }
1579
- function ne(e) {
1580
- if (typeof e != "string")
1581
- return;
1582
- const t = e.trim();
1583
- if (!(!t || t.toLowerCase() === "none"))
1584
- return t;
1585
- }
1586
- function N(e) {
1587
- if (!(typeof e != "number" || !Number.isFinite(e)))
1588
- return Math.max(0, Math.min(10, Math.trunc(e)));
1589
- }
1590
- function ln(e) {
1591
- return e === "currency" ? 2 : e === "percent" ? 1 : e === "scientific" ? 2 : 0;
1592
- }
1593
- function fn(e, t, n) {
1594
- const r = N(t.minimumFractionDigits), a = N(t.maximumFractionDigits);
1595
- if (typeof r == "number" || typeof a == "number") {
1596
- const o = r ?? 0, l = a ?? Math.max(o, 2);
1597
- return {
1598
- minimumFractionDigits: Math.min(o, l),
1599
- maximumFractionDigits: Math.max(o, l)
1600
- };
1563
+ const nn = Object.freeze({ source: "automatic" });
1564
+ function rn(e, t) {
1565
+ var r, a;
1566
+ const n = e.preferences;
1567
+ switch (t) {
1568
+ case "tooltip":
1569
+ return (r = n == null ? void 0 : n.tooltipConfig) == null ? void 0 : r.valueFormat;
1570
+ case "dataLabel":
1571
+ case "pieLabel":
1572
+ return (a = n == null ? void 0 : n.dataLabelsConfig) == null ? void 0 : a.valueFormat;
1573
+ default:
1574
+ return;
1601
1575
  }
1602
- const i = N(t.decimals);
1603
- if (typeof i == "number")
1604
- return {
1605
- minimumFractionDigits: i,
1606
- maximumFractionDigits: i
1607
- };
1608
- if (n != null && n.preserveOmittedProperties)
1609
- return {};
1610
- const s = ln(e);
1611
- return {
1612
- minimumFractionDigits: s,
1613
- maximumFractionDigits: s
1614
- };
1615
- }
1616
- function dn(e, t) {
1617
- if (!(typeof t != "string" || e === "percent" && t === "%"))
1618
- return t;
1619
- }
1620
- function re(e) {
1621
- const t = ne(e.locale), n = ne(e.currency), r = dn(e.type, e.suffix);
1622
- return {
1623
- ...e,
1624
- ...t !== e.locale ? { locale: t } : {},
1625
- ...n !== e.currency ? { currency: n } : {},
1626
- ...r !== e.suffix ? { suffix: r } : {}
1627
- };
1628
- }
1629
- function x(e, t, n) {
1630
- const r = { ...t, type: e };
1631
- if ((n == null ? void 0 : n.numericInput) === "canonical" && q(r))
1632
- return re(r);
1633
- const a = fn(e, t, n), i = typeof t.prefix == "string" ? t.prefix : void 0, s = {
1634
- type: e,
1635
- locale: t.locale,
1636
- minimumFractionDigits: a.minimumFractionDigits,
1637
- maximumFractionDigits: a.maximumFractionDigits,
1638
- useGrouping: typeof t.useGrouping == "boolean" ? t.useGrouping : typeof t.thousandsSeparator == "boolean" ? t.thousandsSeparator : !0,
1639
- prefix: i,
1640
- suffix: t.suffix,
1641
- negativeStyle: t.negativeStyle || "minus",
1642
- compact: !!t.compact,
1643
- scale: typeof t.scale == "number" ? t.scale : void 0
1644
- };
1645
- return e === "currency" && t.currency && (s.currency = t.currency), e === "percent" && (s.percentValueMode = t.percentValueMode || "fraction"), re(s);
1646
1576
  }
1647
- function ae(e) {
1648
- return {
1649
- type: "date",
1650
- locale: e.locale || un,
1651
- pattern: e.pattern,
1652
- relative: !!e.relative,
1653
- timezone: e.timezone,
1654
- sourceTimezone: e.sourceTimezone,
1655
- prefix: e.prefix,
1656
- suffix: e.suffix
1657
- };
1658
- }
1659
- function I(e) {
1660
- return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
1661
- }
1662
- function ie(e) {
1663
- const t = N(e.maxUnits);
1664
- return {
1665
- type: "duration",
1666
- inputUnit: I(e.inputUnit) ? e.inputUnit : "second",
1667
- outputStyle: e.outputStyle === "digital" || e.outputStyle === "long" ? e.outputStyle : "compact",
1668
- largestUnit: I(e.largestUnit) ? e.largestUnit : void 0,
1669
- smallestUnit: I(e.smallestUnit) ? e.smallestUnit : "second",
1670
- maxUnits: t,
1671
- prefix: e.prefix,
1672
- suffix: e.suffix,
1673
- negativeStyle: e.negativeStyle || "minus"
1674
- };
1577
+ function J(e, t) {
1578
+ const n = e.config;
1579
+ if (n)
1580
+ return [
1581
+ ...n.metricColumns ?? [],
1582
+ ...n.groupByColumns ?? [],
1583
+ ...n.detailColumns ?? [],
1584
+ ...n.pivotByColumns ?? []
1585
+ ].find((r) => r.id === t);
1586
+ }
1587
+ function an(e, t) {
1588
+ if (t.kind === "field") return J(e, t.fieldId);
1589
+ if (t.kind === "pivot") return J(e, t.metricId);
1590
+ }
1591
+ function sn(e, t, n) {
1592
+ var r, a, s, o, i, f, l, c, h;
1593
+ switch (t.kind) {
1594
+ case "field":
1595
+ case "pivot":
1596
+ return n != null && n.format && n.formatOrigin === "override" ? n.format : void 0;
1597
+ case "result":
1598
+ return (s = (a = (r = e.preferences) == null ? void 0 : r.sqlColumns) == null ? void 0 : a[t.key]) == null ? void 0 : s.format;
1599
+ case "sqlKpiValue":
1600
+ return (i = (o = e.preferences) == null ? void 0 : o.sqlKpiValue) == null ? void 0 : i.format;
1601
+ case "matrixMeasure":
1602
+ return (l = (f = e.config) == null ? void 0 : f.matrix) == null ? void 0 : l.presentation.measureFormats[t.measureId];
1603
+ case "matrixLevel":
1604
+ return (h = (c = e.config) == null ? void 0 : c.matrix) == null ? void 0 : h.presentation.levelFormats[t.levelId];
1605
+ }
1675
1606
  }
1676
- function se(e) {
1677
- return {
1678
- type: "string",
1679
- prefix: e.prefix,
1680
- suffix: e.suffix
1681
- };
1607
+ function on(e) {
1608
+ if (!e) return;
1609
+ if (e.format && e.formatOrigin !== "override") return e.format;
1610
+ const t = e.semanticTemporalPresentation;
1611
+ return t && t.granularity === e.granularity ? t.format : void 0;
1612
+ }
1613
+ function q(e) {
1614
+ 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" } : nn;
1615
+ }
1616
+ function un(e) {
1617
+ var o;
1618
+ const { card: t, column: n, surface: r } = e, a = an(t, n), s = n.kind === "field" ? n.fieldId : n.kind === "pivot" ? n.metricId : void 0;
1619
+ return q({
1620
+ surface: r ? rn(t, r) : void 0,
1621
+ override: sn(t, n, a),
1622
+ model: (s !== void 0 ? (o = e.modelFormats) == null ? void 0 : o[s] : void 0) ?? e.catalogFormat,
1623
+ snapshot: on(a)
1624
+ });
1682
1625
  }
1683
- function mn(e, t) {
1684
- if (!e)
1685
- return;
1686
- if (typeof e == "string") {
1687
- const r = e.trim().toLowerCase();
1688
- return r === "currency" ? x(
1689
- "currency",
1690
- { type: "currency" },
1691
- t
1692
- ) : r === "percentage" || r === "percent" ? x(
1693
- "percent",
1694
- {
1695
- type: "percentage",
1696
- percentValueMode: "fraction"
1697
- },
1698
- t
1699
- ) : r === "scientific" ? x(
1700
- "scientific",
1701
- { type: "scientific" },
1702
- t
1703
- ) : r === "date" ? ae({}) : r === "duration" ? ie({}) : r === "string" ? se({}) : r === "number" ? x(
1704
- "number",
1705
- { type: "number" },
1706
- t
1707
- ) : void 0;
1708
- }
1709
- if ("type" in e && e.type === "temporal_bucket") {
1710
- const r = De.safeParse(e);
1711
- return r.success ? r.data : void 0;
1712
- }
1713
- const n = e;
1714
- if ((t == null ? void 0 : t.numericInput) === "canonical") {
1715
- const r = n.type === "percentage" ? { ...n, type: "percent" } : n;
1716
- if (q(r))
1717
- return x(r.type, r, t);
1718
- }
1719
- if (n.type === "percentage")
1720
- return x(
1721
- "percent",
1722
- {
1723
- ...n,
1724
- percentValueMode: n.percentValueMode || "fraction"
1725
- },
1726
- t
1727
- );
1728
- if (n.type === "number" || n.type === "currency" || n.type === "percent" || n.type === "scientific") {
1729
- const r = x(
1730
- n.type,
1731
- n,
1732
- t
1733
- );
1734
- return cn(n) ? { ...r, currency: "USD" } : r;
1626
+ function cn(e, t) {
1627
+ const n = (r) => r && typeof r == "object" && !Array.isArray(r) ? Object.fromEntries(
1628
+ Object.keys(r).sort().map((a) => [a, n(r[a])])
1629
+ ) : r;
1630
+ return JSON.stringify(n(e)) === JSON.stringify(n(t));
1631
+ }
1632
+ const fn = ["metricColumns", "groupByColumns", "detailColumns", "pivotByColumns"], K = /* @__PURE__ */ new WeakMap();
1633
+ function Sn(e, t) {
1634
+ const n = t == null ? void 0 : t.modelFormats;
1635
+ if (!e || !n || Object.keys(n).length === 0) return e;
1636
+ let r = K.get(e);
1637
+ if (r || K.set(e, r = /* @__PURE__ */ new WeakMap()), r.has(n)) return r.get(n);
1638
+ const a = ln(e, n);
1639
+ return r.set(n, a), a;
1640
+ }
1641
+ function ln(e, t) {
1642
+ const n = { config: e };
1643
+ let r;
1644
+ for (const a of fn) {
1645
+ const s = e[a];
1646
+ if (!(s != null && s.length)) continue;
1647
+ let o = !1;
1648
+ const i = s.map((f) => {
1649
+ const l = un({ card: n, column: { kind: "field", fieldId: f.id }, modelFormats: t });
1650
+ return l.source !== "model" || cn(l.format, f.format) ? f : (o = !0, { ...f, format: l.format });
1651
+ });
1652
+ o && ((r ?? (r = { ...e }))[a] = i);
1735
1653
  }
1736
- if (n.type === "date")
1737
- return ae(n);
1738
- if (n.type === "duration")
1739
- return ie(n);
1740
- if (n.type === "string")
1741
- return se(n);
1654
+ return r ?? e;
1742
1655
  }
1743
- function hn(e, t) {
1656
+ function mn(e, t) {
1744
1657
  var a;
1745
1658
  const n = e[e.length - 1];
1746
1659
  if (!n) return "";
@@ -1748,126 +1661,122 @@ function hn(e, t) {
1748
1661
  const r = n.member.value;
1749
1662
  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));
1750
1663
  }
1751
- function gn(e, t, n) {
1752
- return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(xe).join(t)) ?? `${t} Total` : t;
1664
+ function dn(e, t, n) {
1665
+ return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(he).join(t)) ?? `${t} Total` : t;
1753
1666
  }
1754
- function Cn(e, t, n, r) {
1755
- var s;
1756
- const a = e[e.length - 1], i = t === "grand_total" ? n.grand.label : a ? (s = n.levels[a.levelId]) == null ? void 0 : s.label : void 0;
1757
- return gn(t, hn(e, r), i);
1667
+ function Wn(e, t, n, r) {
1668
+ var o;
1669
+ const a = e[e.length - 1], s = t === "grand_total" ? n.grand.label : a ? (o = n.levels[a.levelId]) == null ? void 0 : o.label : void 0;
1670
+ return dn(t, mn(e, r), s);
1758
1671
  }
1759
- function Fn(e, t, n) {
1672
+ function Cn(e, t, n) {
1760
1673
  return e.kind === "value" ? (t == null ? void 0 : t(e.value)) ?? "" : e.kind === "null" ? n.nullText : n.emptyText;
1761
1674
  }
1762
1675
  function Nn(e) {
1763
- const { path: t, previousPath: n, role: r, repeatLabels: a, levelCount: i } = e;
1764
- return Array.from({ length: i }, (s, o) => {
1765
- const l = t.slice(0, o + 1), f = r === "grand_total" ? o === 0 : r === "subtotal" && o === t.length - 1, u = n && n.length > o && B(n.slice(0, o + 1)) === B(l);
1676
+ const { path: t, previousPath: n, role: r, repeatLabels: a, levelCount: s } = e;
1677
+ return Array.from({ length: s }, (o, i) => {
1678
+ const f = t.slice(0, i + 1), l = r === "grand_total" ? i === 0 : r === "subtotal" && i === t.length - 1, c = n && n.length > i && j(n.slice(0, i + 1)) === j(f);
1766
1679
  return {
1767
- path: l,
1768
- total: f,
1769
- visible: f || t.length > o && (a || !u || o === t.length - 1)
1680
+ path: f,
1681
+ total: l,
1682
+ visible: l || t.length > i && (a || !c || i === t.length - 1)
1770
1683
  };
1771
1684
  });
1772
1685
  }
1773
- function yn(e, t) {
1774
- return mn(e ?? t, {
1686
+ function hn(e, t) {
1687
+ return be(q({ override: e, model: t }).format, {
1775
1688
  preserveOmittedProperties: !0,
1776
1689
  numericInput: "canonical"
1777
1690
  });
1778
1691
  }
1779
1692
  function Yn(e, t, n) {
1780
- const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = (s, o) => {
1781
- const l = (o === "levels" ? t.levelFormats : t.measureFormats)[s.id], f = s.semanticFormat, u = yn(l, f);
1782
- o === "measures" && r.set(s.id, {
1783
- isNumeric: pe(s.column.dataType) === "number",
1693
+ const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), s = (o, i) => {
1694
+ const f = (i === "levels" ? t.levelFormats : t.measureFormats)[o.id], l = o.semanticFormat, c = hn(f, l);
1695
+ i === "measures" && r.set(o.id, {
1696
+ isNumeric: de(o.column.dataType) === "number",
1784
1697
  // Use normalized affixes: a redundant percent suffix is already removed.
1785
- hasTextAffixes: !!u && !!("prefix" in u && u.prefix || "suffix" in u && u.suffix)
1698
+ hasTextAffixes: !!c && !!("prefix" in c && c.prefix || "suffix" in c && c.suffix)
1786
1699
  });
1787
- const g = (c) => ye(c, void 0, {
1700
+ const h = (u) => ce(u, void 0, {
1788
1701
  useFormattedValues: !0,
1789
1702
  timezone: n.calendar.tz,
1790
1703
  locale: n.valueFormat.locale,
1791
1704
  absence: t.absence
1792
1705
  });
1793
- if (s.column.temporalBucket) {
1794
- const c = s.column.temporalBucket, h = Pe({
1795
- metadata: c,
1796
- cardFormat: (l == null ? void 0 : l.type) === "temporal_bucket" ? l : void 0,
1797
- semanticFormat: (f == null ? void 0 : f.type) === "temporal_bucket" ? { granularity: c.granularity, format: f } : void 0,
1706
+ if (o.column.temporalBucket) {
1707
+ const u = o.column.temporalBucket, g = Me({
1708
+ metadata: u,
1709
+ cardFormat: (f == null ? void 0 : f.type) === "temporal_bucket" ? f : void 0,
1710
+ semanticFormat: (l == null ? void 0 : l.type) === "temporal_bucket" ? { granularity: u.granularity, format: l } : void 0,
1798
1711
  locale: n.valueFormat.locale,
1799
1712
  styles: { dateStyle: n.valueFormat.dateStyle, dateTime: n.valueFormat.dateTime }
1800
1713
  });
1801
- return (y) => typeof y == "string" ? le({ value: y, metadata: c, format: h.format }) : g(y);
1714
+ return (w) => typeof w == "string" ? re({ value: w, metadata: u, format: g.format }) : h(w);
1802
1715
  }
1803
- if (s.column.rawTemporal) {
1804
- const c = Se({
1805
- metadata: s.column.rawTemporal,
1806
- format: ke({
1716
+ if (o.column.rawTemporal) {
1717
+ const u = q({ override: f, model: l }).format, g = ve({
1718
+ metadata: o.column.rawTemporal,
1719
+ format: Oe({
1807
1720
  format: (u == null ? void 0 : u.type) === "date" ? {
1808
1721
  type: "raw_temporal",
1809
1722
  timezone: u.timezone,
1810
1723
  sourceTimezone: u.sourceTimezone,
1811
- presentation: u.pattern ? {
1812
- mode: "pattern",
1813
- dialect: "semaphor_tokens",
1814
- pattern: u.pattern
1815
- } : { mode: "auto" }
1724
+ presentation: Te(u)
1816
1725
  } : void 0,
1817
1726
  preferences: n.valueFormat,
1818
1727
  calendar: n.calendar
1819
1728
  })
1820
1729
  });
1821
- return (h) => {
1822
- if (typeof h != "string") return g(h);
1823
- const y = c(h);
1824
- return y.ok ? y.text : g(h);
1730
+ return (w) => {
1731
+ if (typeof w != "string") return h(w);
1732
+ const M = g(w);
1733
+ return M.ok ? M.text : h(w);
1825
1734
  };
1826
1735
  }
1827
- if (q(u)) {
1828
- const c = We(u, n.valueFormat);
1829
- return o === "measures" && a.set(s.id, c), (h) => typeof h == "number" || typeof h == "object" && h !== null ? Ce(h, c) : g(h);
1736
+ if (xe(c)) {
1737
+ const u = De(c, n.valueFormat);
1738
+ return i === "measures" && a.set(o.id, u), (g) => typeof g == "number" || typeof g == "object" && g !== null ? Pe(g, u) : h(g);
1830
1739
  }
1831
- return (u == null ? void 0 : u.type) === "duration" && o === "measures" && a.set(s.id, u), (u == null ? void 0 : u.type) === "duration" ? (c) => typeof c == "number" || typeof c == "string" || typeof c == "object" && c !== null ? Fe(
1832
- typeof c == "object" ? c.value : c,
1833
- u
1834
- ) : g(c) : (u == null ? void 0 : u.type) === "string" ? (c) => c === null ? g(c) : `${u.prefix ?? ""}${g(c)}${u.suffix ?? ""}` : g;
1740
+ return (c == null ? void 0 : c.type) === "duration" && i === "measures" && a.set(o.id, c), (c == null ? void 0 : c.type) === "duration" ? (u) => typeof u == "number" || typeof u == "string" || typeof u == "object" && u !== null ? pe(
1741
+ typeof u == "object" ? u.value : u,
1742
+ c
1743
+ ) : h(u) : (c == null ? void 0 : c.type) === "string" ? (u) => u === null ? h(u) : `${c.prefix ?? ""}${h(u)}${c.suffix ?? ""}` : h;
1835
1744
  };
1836
1745
  return {
1837
1746
  levels: new Map(
1838
- e.levels.map((s) => [s.id, i(s, "levels")])
1747
+ e.levels.map((o) => [o.id, s(o, "levels")])
1839
1748
  ),
1840
1749
  measures: new Map(
1841
- e.measures.map((s) => [s.id, i(s, "measures")])
1750
+ e.measures.map((o) => [o.id, s(o, "measures")])
1842
1751
  ),
1843
1752
  measureSemantics: r,
1844
1753
  measureFormats: a,
1845
1754
  absence: t.absence
1846
1755
  };
1847
1756
  }
1848
- class wn extends Error {
1757
+ class gn extends Error {
1849
1758
  constructor(n, r) {
1850
1759
  super(`${n}: ${r}`);
1851
- U(this, "deliveryBlocking", !0);
1760
+ z(this, "deliveryBlocking", !0);
1852
1761
  this.code = n, this.name = "PivotHeaderPresentationError";
1853
1762
  }
1854
1763
  }
1855
1764
  function En(e) {
1856
1765
  var a;
1857
- const t = e.mode ?? "formatted", n = e.members.map((i) => {
1858
- var o;
1859
- if (t === "canonical" || !i.temporalBucket)
1860
- return i.value === null ? "" : String(i.value);
1861
- const s = (o = e.resolveTemporalFormat) == null ? void 0 : o.call(e, i.fieldId);
1862
- if (!s)
1863
- throw new wn(
1766
+ const t = e.mode ?? "formatted", n = e.members.map((s) => {
1767
+ var i;
1768
+ if (t === "canonical" || !s.temporalBucket)
1769
+ return s.value === null ? "" : String(s.value);
1770
+ const o = (i = e.resolveTemporalFormat) == null ? void 0 : i.call(e, s.fieldId);
1771
+ if (!o)
1772
+ throw new gn(
1864
1773
  "missing_resolved_temporal_format",
1865
- `Missing resolved temporal presentation for pivot field "${i.fieldId}"`
1774
+ `Missing resolved temporal presentation for pivot field "${s.fieldId}"`
1866
1775
  );
1867
- return le({
1868
- value: i.value,
1869
- metadata: i.temporalBucket,
1870
- format: s
1776
+ return re({
1777
+ value: s.value,
1778
+ metadata: s.temporalBucket,
1779
+ format: o
1871
1780
  });
1872
1781
  }), r = ((a = e.metricLabel) == null ? void 0 : a.trim()) || void 0;
1873
1782
  return {
@@ -1879,48 +1788,45 @@ function En(e) {
1879
1788
  ].join(" / ")
1880
1789
  };
1881
1790
  }
1882
- function Ln(e) {
1791
+ function Fn(e) {
1883
1792
  const t = /* @__PURE__ */ new Map();
1884
1793
  return e.forEach((n) => {
1885
1794
  n.id && t.set(n.id, (t.get(n.id) ?? 0) + 1);
1886
1795
  }), e.flatMap(
1887
- (n) => n.id && (t.get(n.id) ?? 0) > 1 ? [Ne(n)] : []
1796
+ (n) => n.id && (t.get(n.id) ?? 0) > 1 ? [ke(n)] : []
1888
1797
  );
1889
1798
  }
1890
1799
  export {
1891
- _e as A,
1892
- ae as B,
1893
- ie as C,
1894
- x as D,
1895
- un as E,
1896
- ne as F,
1897
- yn as G,
1898
- gn as H,
1899
- wn as P,
1900
- an as a,
1901
- sn as b,
1902
- Sn as c,
1903
- kn as d,
1904
- ye as e,
1905
- mn as f,
1906
- Pn as g,
1907
- Wn as h,
1908
- Yn as i,
1909
- En as j,
1910
- Ln as k,
1911
- Cn as l,
1912
- hn as m,
1913
- Nn as n,
1914
- Fn as o,
1915
- R as p,
1916
- ge as q,
1917
- vn as r,
1918
- H as s,
1919
- Ut as t,
1920
- P as u,
1921
- de as v,
1922
- F as w,
1923
- m as x,
1924
- qe as y,
1925
- E as z
1800
+ Le as A,
1801
+ Y as B,
1802
+ Ne as C,
1803
+ hn as D,
1804
+ dn as E,
1805
+ gn as P,
1806
+ en as a,
1807
+ xn as b,
1808
+ Pn as c,
1809
+ pn as d,
1810
+ _ as e,
1811
+ Kt as f,
1812
+ Dn as g,
1813
+ ce as h,
1814
+ kn as i,
1815
+ Yn as j,
1816
+ En as k,
1817
+ Fn as l,
1818
+ mn as m,
1819
+ Wn as n,
1820
+ Nn as o,
1821
+ q as p,
1822
+ Cn as q,
1823
+ un as r,
1824
+ ue as s,
1825
+ I as t,
1826
+ At as u,
1827
+ P as v,
1828
+ Sn as w,
1829
+ se as x,
1830
+ C as y,
1831
+ d as z
1926
1832
  };