@aiquants/period-slider 0.5.0 → 0.7.0

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.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsx as p, jsxs as ce, Fragment as Wr } from "react/jsx-runtime";
2
- import { addYears as Sa, addMonths as Ra, addDays as Cr, format as Xt, getDaysInMonth as Cn, parseISO as In } from "date-fns";
3
- import { memo as sr, useId as $a, useRef as G, useMemo as $, useCallback as X, useState as xe, useEffect as Lt } from "react";
4
- const Pa = {
1
+ import { jsx as v, jsxs as fe, Fragment as Wr } from "react/jsx-runtime";
2
+ import { addYears as Ra, addMonths as $a, addDays as Cr, format as qt, getDaysInMonth as Cn, parseISO as In } from "date-fns";
3
+ import { memo as ur, useId as Pa, useRef as Z, useMemo as $, useCallback as q, useState as Te, useEffect as Rt } from "react";
4
+ const Na = {
5
5
  "blue-rose": {
6
6
  macro: "#0284c7",
7
7
  macroLight: "#38bdf8",
@@ -44,17 +44,17 @@ const Pa = {
44
44
  microLight: "#71717a",
45
45
  accent: "#27272a"
46
46
  }
47
- }, st = (e) => e instanceof Date && !Number.isNaN(e.getTime()), pe = (e) => e instanceof Date ? Number.isNaN(e.getTime()) ? "Invalid Date" : e.toISOString() : String(e), et = (e, t) => {
48
- if (!st(t)) throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${pe(t)})`);
47
+ }, ut = (e) => e instanceof Date && !Number.isNaN(e.getTime()), Me = (e) => e instanceof Date ? Number.isNaN(e.getTime()) ? "Invalid Date" : e.toISOString() : String(e), nt = (e, t) => {
48
+ if (!ut(t)) throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${Me(t)})`);
49
49
  const r = new Date(t.getTime());
50
50
  return e === "year" ? (r.setMonth(0, 1), r.setHours(0, 0, 0, 0)) : (e === "month" && r.setDate(1), r.setHours(0, 0, 0, 0)), r;
51
- }, W = (e, t) => {
52
- const r = et(e, t), n = r.getFullYear(), a = r.getMonth() + 1, l = r.getDate();
51
+ }, J = (e, t) => {
52
+ const r = nt(e, t), n = r.getFullYear(), a = r.getMonth() + 1, l = r.getDate();
53
53
  if (e === "year") return n;
54
54
  if (e === "month") return n * 12 + (a - 1);
55
- const o = /* @__PURE__ */ new Date(0);
56
- return o.setUTCFullYear(n, a - 1, l), o.setUTCHours(0, 0, 0, 0), Math.floor(o.getTime() / (1440 * 60 * 1e3));
57
- }, le = (e, t) => {
55
+ const i = /* @__PURE__ */ new Date(0);
56
+ return i.setUTCFullYear(n, a - 1, l), i.setUTCHours(0, 0, 0, 0), Math.floor(i.getTime() / (1440 * 60 * 1e3));
57
+ }, me = (e, t) => {
58
58
  const r = /* @__PURE__ */ new Date(0);
59
59
  if (r.setHours(0, 0, 0, 0), e === "year")
60
60
  return r.setFullYear(t, 0, 1), r;
@@ -65,12 +65,12 @@ const Pa = {
65
65
  const n = new Date(t * 24 * 60 * 60 * 1e3);
66
66
  return r.setFullYear(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()), r;
67
67
  }, Ue = (e, t, r) => {
68
- if (!st(t)) throw new RangeError(`addUnit: d must be a valid Date (received: ${pe(t)})`);
69
- return e === "year" ? Sa(t, r) : e === "month" ? Ra(t, r) : Cr(t, r);
70
- }, pt = (e, t, r) => {
71
- if (!st(r)) throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${pe(r)})`);
68
+ if (!ut(t)) throw new RangeError(`addUnit: d must be a valid Date (received: ${Me(t)})`);
69
+ return e === "year" ? Ra(t, r) : e === "month" ? $a(t, r) : Cr(t, r);
70
+ }, Mt = (e, t, r) => {
71
+ if (!ut(r)) throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${Me(r)})`);
72
72
  if (e === t)
73
- return et(t, r);
73
+ return nt(t, r);
74
74
  const n = r.getFullYear(), a = r.getMonth();
75
75
  if (e === "year") {
76
76
  if (t === "month")
@@ -78,90 +78,90 @@ const Pa = {
78
78
  if (t === "day")
79
79
  return new Date(n, 11, 31);
80
80
  }
81
- return e === "month" && t === "day" ? new Date(n, a + 1, 0) : et(t, r);
82
- }, ka = {
81
+ return e === "month" && t === "day" ? new Date(n, a + 1, 0) : nt(t, r);
82
+ }, Ya = {
83
83
  year: { year: "numeric" },
84
84
  month: { year: "numeric", month: "2-digit" },
85
85
  day: { year: "numeric", month: "2-digit", day: "2-digit" }
86
- }, Hn = /* @__PURE__ */ new Map(), Na = (e, t) => {
86
+ }, Hn = /* @__PURE__ */ new Map(), ka = (e, t) => {
87
87
  const r = `${e}\0${t}`, n = Hn.get(r);
88
88
  if (n !== void 0) return n;
89
- const a = new Intl.DateTimeFormat(t, ka[e]);
89
+ const a = new Intl.DateTimeFormat(t, Ya[e]);
90
90
  return Hn.set(r, a), a;
91
- }, Ya = (e, t) => {
91
+ }, Aa = (e, t) => {
92
92
  const r = String(t.getFullYear()).padStart(4, "0");
93
93
  if (e === "year") return r;
94
94
  const n = String(t.getMonth() + 1).padStart(2, "0");
95
95
  if (e === "month") return `${r}-${n}`;
96
96
  const a = String(t.getDate()).padStart(2, "0");
97
97
  return `${r}-${n}-${a}`;
98
- }, _e = (e, t, r, n) => st(t) ? r ? r(t) : n === void 0 ? Ya(e, t) : Na(e, n).format(t) : "", Bt = (e, t, r, n) => _e(e, t, r, n), Pe = (e, t, r) => {
98
+ }, Ve = (e, t, r, n) => ut(t) ? r ? r(t) : n === void 0 ? Aa(e, t) : ka(e, n).format(t) : "", _t = (e, t, r, n) => Ve(e, t, r, n), Ne = (e, t, r) => {
99
99
  if (!e || e.length === 0 || e.length === 1) return 0;
100
- const n = W(r, t);
100
+ const n = J(r, t);
101
101
  let a = 0, l = e.length - 1;
102
- if (n <= W(r, e[a])) return 0;
103
- if (n >= W(r, e[l])) return l;
102
+ if (n <= J(r, e[a])) return 0;
103
+ if (n >= J(r, e[l])) return l;
104
104
  for (; a <= l; ) {
105
- const h = a + l >> 1, m = W(r, e[h]);
105
+ const h = a + l >> 1, m = J(r, e[h]);
106
106
  if (m === n) return h;
107
107
  m < n ? a = h + 1 : l = h - 1;
108
108
  }
109
- const o = Math.abs(W(r, e[a]) - n), c = Math.abs(W(r, e[l]) - n);
110
- return o < c ? a : l;
111
- }, ir = (e, t, r, n) => {
109
+ const i = Math.abs(J(r, e[a]) - n), c = Math.abs(J(r, e[l]) - n);
110
+ return i < c ? a : l;
111
+ }, sr = (e, t, r, n) => {
112
112
  if (!Array.isArray(e) || e.length === 0) return [];
113
- const a = W(t, r), l = W(t, n), o = /* @__PURE__ */ new Map();
113
+ const a = J(t, r), l = J(t, n), i = /* @__PURE__ */ new Map();
114
114
  for (const c of e) {
115
- const h = et(t, c), m = W(t, h);
116
- m < a || m > l || o.has(m) || o.set(m, h);
115
+ const h = nt(t, c), m = J(t, h);
116
+ m < a || m > l || i.has(m) || i.set(m, h);
117
117
  }
118
- if (o.size === 0)
119
- throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${pe(r)}, maxDate: ${pe(n)}, entries: ${e.length})`);
120
- return Array.from(o.keys()).sort((c, h) => c - h).map((c) => o.get(c));
121
- }, $r = (e, t, r, n) => {
118
+ if (i.size === 0)
119
+ throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${Me(r)}, maxDate: ${Me(n)}, entries: ${e.length})`);
120
+ return Array.from(i.keys()).sort((c, h) => c - h).map((c) => i.get(c));
121
+ }, Pr = (e, t, r, n) => {
122
122
  const a = e.length - 1;
123
123
  if (a <= 0) return 0;
124
- const l = Pe(e, n, t);
124
+ const l = Ne(e, n, t);
125
125
  if (r === "time") {
126
- const o = e[0].getTime(), c = e[a].getTime() - o;
127
- return c <= 0 ? 0 : Math.max(0, Math.min(1, (e[l].getTime() - o) / c));
126
+ const i = e[0].getTime(), c = e[a].getTime() - i;
127
+ return c <= 0 ? 0 : Math.max(0, Math.min(1, (e[l].getTime() - i) / c));
128
128
  }
129
129
  return l / a;
130
- }, Pr = (e, t, r, n) => {
130
+ }, Nr = (e, t, r, n) => {
131
131
  const a = e.length - 1;
132
132
  if (a <= 0) return 0;
133
133
  const l = Math.max(0, Math.min(1, n));
134
134
  if (r === "time") {
135
- const o = e[0].getTime(), c = e[a].getTime() - o;
136
- return c <= 0 ? 0 : Pe(e, new Date(o + l * c), t);
135
+ const i = e[0].getTime(), c = e[a].getTime() - i;
136
+ return c <= 0 ? 0 : Ne(e, new Date(i + l * c), t);
137
137
  }
138
138
  return Math.max(0, Math.min(a, Math.round(l * a)));
139
- }, On = (e, t, r, n, a, l, o) => {
139
+ }, On = (e, t, r, n, a, l, i) => {
140
140
  let c = r, h = n;
141
- return o ? (c = t, h = t) : e === "low" ? t > n ? (c = n, h = t) : c = t : t < r ? (h = r, c = t) : h = t, [Math.max(a, Math.min(l, c)), Math.max(a, Math.min(l, h))];
142
- }, Aa = (e, t, r, n, a) => a ? "low" : e === "low" ? t > n ? "high" : "low" : t < r ? "low" : "high", Ea = ({ posDiffPct: e, startLowVal: t, startHighVal: r, rangeMin: n, rangeMax: a, isDiscrete: l, sortedAllowedDates: o, snapMode: c, unit: h }) => {
141
+ return i ? (c = t, h = t) : e === "low" ? t > n ? (c = n, h = t) : c = t : t < r ? (h = r, c = t) : h = t, [Math.max(a, Math.min(l, c)), Math.max(a, Math.min(l, h))];
142
+ }, Ea = (e, t, r, n, a) => a ? "low" : e === "low" ? t > n ? "high" : "low" : t < r ? "low" : "high", Ca = ({ posDiffPct: e, startLowVal: t, startHighVal: r, rangeMin: n, rangeMax: a, isDiscrete: l, sortedAllowedDates: i, snapMode: c, unit: h }) => {
143
143
  if (l) {
144
- const U = o.length - 1;
145
- if (U <= 0) return [0, 0];
146
- const re = Math.max(0, Math.min(U, Math.round(t))), M = Math.max(re, Math.min(U, Math.round(r)));
144
+ const H = i.length - 1;
145
+ if (H <= 0) return [0, 0];
146
+ const ne = Math.max(0, Math.min(H, Math.round(t))), y = Math.max(ne, Math.min(H, Math.round(r)));
147
147
  if (c === "time") {
148
- const A = o[0].getTime(), B = o[U].getTime(), L = o[re].getTime(), K = o[M].getTime() - L;
149
- let H = L + e * (B - A), g = H + K;
150
- H < A && (H = A, g = A + K), g > B && (g = B, H = B - K);
151
- const R = Pe(o, new Date(H), h), Y = Pe(o, new Date(g), h);
152
- return [R, Math.max(R, Y)];
148
+ const A = i[0].getTime(), z = i[H].getTime(), Y = i[ne].getTime(), V = i[y].getTime() - Y;
149
+ let F = Y + e * (z - A), w = F + V;
150
+ F < A && (F = A, w = A + V), w > z && (w = z, F = z - V);
151
+ const N = Ne(i, new Date(F), h), p = Ne(i, new Date(w), h);
152
+ return [N, Math.max(N, p)];
153
153
  }
154
- const Q = Math.round(e * U);
155
- let I = re + Q, ne = M + Q;
156
- return I < 0 && (ne += -I, I = 0), ne > U && (I -= ne - U, ne = U), [Math.max(0, Math.min(U, I)), Math.max(0, Math.min(U, ne))];
154
+ const ae = Math.round(e * H);
155
+ let O = ne + ae, Q = y + ae;
156
+ return O < 0 && (Q += -O, O = 0), Q > H && (O -= Q - H, Q = H), [Math.max(0, Math.min(H, O)), Math.max(0, Math.min(H, Q))];
157
157
  }
158
- const m = (U) => Math.max(n, Math.min(a, U)), k = a - n;
159
- if (k <= 0) return [m(t), m(r)];
160
- const D = Math.round(e * k);
161
- let u = t + D, v = r + D;
162
- return u < n && (v += n - u, u = n), v > a && (u -= v - a, v = a), [m(u), m(v)];
163
- }, Ca = (e, t, r, n, a, l, o, c) => {
164
- let h = 0, m = !1, k = !1;
158
+ const m = (H) => Math.max(n, Math.min(a, H)), D = a - n;
159
+ if (D <= 0) return [m(t), m(r)];
160
+ const x = Math.round(e * D);
161
+ let u = t + x, L = r + x;
162
+ return u < n && (L += n - u, u = n), L > a && (u -= L - a, L = a), [m(u), m(L)];
163
+ }, Ia = (e, t, r, n, a, l, i, c) => {
164
+ let h = 0, m = !1, D = !1;
165
165
  switch (e) {
166
166
  case "ArrowRight":
167
167
  case "ArrowUp":
@@ -181,19 +181,19 @@ const Pa = {
181
181
  m = !0;
182
182
  break;
183
183
  case "End":
184
- k = !0;
184
+ D = !0;
185
185
  break;
186
186
  default:
187
187
  return null;
188
188
  }
189
- if (o) {
190
- let v = r;
191
- return m ? v = a : k ? v = l : v = Math.max(a, Math.min(l, r + h)), [v, v];
189
+ if (i) {
190
+ let L = r;
191
+ return m ? L = a : D ? L = l : L = Math.max(a, Math.min(l, r + h)), [L, L];
192
192
  }
193
- let D = r, u = n;
194
- return t === "low" ? m ? D = a : k ? D = n : D = Math.max(a, Math.min(n, r + h)) : m ? u = r : k ? u = l : u = Math.max(r, Math.min(l, n + h)), [D, u];
195
- }, jn = 8, Wn = 2, Gn = 16, Ia = 12, Ha = 90, on = (e, t) => {
196
- const r = t?.estimatedHeightPx ?? Gn, a = jn + (t?.anchorGapY ?? Wn) + r / 2, l = e === "top" ? -a : a;
193
+ let x = r, u = n;
194
+ return t === "low" ? m ? x = a : D ? x = n : x = Math.max(a, Math.min(n, r + h)) : m ? u = r : D ? u = l : u = Math.max(r, Math.min(l, n + h)), [x, u];
195
+ }, Wn = 8, Gn = 2, Jn = 16, Ha = 12, Oa = 90, on = (e, t) => {
196
+ const r = t?.estimatedHeightPx ?? Jn, a = Wn + (t?.anchorGapY ?? Gn) + r / 2, l = e === "top" ? -a : a;
197
197
  return {
198
198
  lowAngleDeg: 0,
199
199
  highAngleDeg: 0,
@@ -204,80 +204,80 @@ const Pa = {
204
204
  isSlanted: !1,
205
205
  proximity: 0
206
206
  };
207
- }, Jn = (e, t, r, n = "top", a) => {
208
- const l = a?.estimatedWidthPx, o = a?.estimatedHeightPx ?? Gn, c = a?.paddingPx ?? Ia, h = a?.maxAngleDeg ?? Ha, m = jn + (a?.anchorGapY ?? Wn), k = on(n, a);
209
- if (!(Number.isFinite(r) && r > 0) || l === void 0 || !Number.isFinite(l) || l <= 0) return k;
210
- const D = Math.max(0, t - e) / 100 * r, u = l + c;
211
- if (D >= u) return k;
212
- const v = Math.max(0, Math.min(1, (u - D) / u)), re = v * v * v * (v * (v * 6 - 15) + 10) * h, M = n === "top" ? -re : re, Q = re * Math.PI / 180, I = l / 2 * Math.abs(Math.sin(Q)) + o / 2 * Math.abs(Math.cos(Q)), ne = m + I, A = n === "top" ? -ne : +ne, B = l * Math.abs(Math.cos(Q)) + o * Math.abs(Math.sin(Q)), L = Math.max(0, (B + c - D) / 2);
207
+ }, Zn = (e, t, r, n = "top", a) => {
208
+ const l = a?.estimatedWidthPx, i = a?.estimatedHeightPx ?? Jn, c = a?.paddingPx ?? Ha, h = a?.maxAngleDeg ?? Oa, m = Wn + (a?.anchorGapY ?? Gn), D = on(n, a);
209
+ if (!(Number.isFinite(r) && r > 0) || l === void 0 || !Number.isFinite(l) || l <= 0) return D;
210
+ const x = Math.max(0, t - e) / 100 * r, u = l + c;
211
+ if (x >= u) return D;
212
+ const L = Math.max(0, Math.min(1, (u - x) / u)), ne = L * L * L * (L * (L * 6 - 15) + 10) * h, y = n === "top" ? -ne : ne, ae = ne * Math.PI / 180, O = l / 2 * Math.abs(Math.sin(ae)) + i / 2 * Math.abs(Math.cos(ae)), Q = m + O, A = n === "top" ? -Q : +Q, z = l * Math.abs(Math.cos(ae)) + i * Math.abs(Math.sin(ae)), Y = Math.max(0, (z + c - x) / 2);
213
213
  return {
214
- lowAngleDeg: M,
215
- highAngleDeg: M,
216
- lowOffsetX: -L,
217
- highOffsetX: L,
214
+ lowAngleDeg: y,
215
+ highAngleDeg: y,
216
+ lowOffsetX: -Y,
217
+ highOffsetX: Y,
218
218
  lowOffsetY: A,
219
219
  highOffsetY: A,
220
- isSlanted: v > 1e-3,
221
- proximity: v
220
+ isSlanted: L > 1e-3,
221
+ proximity: L
222
222
  };
223
- }, Zn = (e) => ({ ...e, lowOffsetX: 0, highOffsetX: 0 });
224
- function Oa(e, t, r, n, a, l, o = "macro-top", c = 0.05, h = !0) {
225
- const m = o === "macro-top" || o === "macro-left", k = t <= 0;
226
- if (m && k || !(m || k)) {
227
- const v = Math.abs(e - r), U = Math.abs(e - n);
228
- return v <= c && v <= U ? "macro-low" : U <= c && U < v ? "macro-high" : h && e >= r && e <= n ? "macro-connect" : v < U ? "macro-low" : "macro-high";
223
+ }, Qn = (e) => ({ ...e, lowOffsetX: 0, highOffsetX: 0 });
224
+ function Fa(e, t, r, n, a, l, i = "macro-top", c = 0.05, h = !0) {
225
+ const m = i === "macro-top" || i === "macro-left", D = t <= 0;
226
+ if (m && D || !(m || D)) {
227
+ const L = Math.abs(e - r), H = Math.abs(e - n);
228
+ return L <= c && L <= H ? "macro-low" : H <= c && H < L ? "macro-high" : h && e >= r && e <= n ? "macro-connect" : L < H ? "macro-low" : "macro-high";
229
229
  }
230
- const D = Math.abs(e - a), u = Math.abs(e - l);
231
- return D <= c && D <= u ? "micro-low" : u <= c && u < D ? "micro-high" : h && e >= a && e <= l ? "micro-connect" : D < u ? "micro-low" : "micro-high";
230
+ const x = Math.abs(e - a), u = Math.abs(e - l);
231
+ return x <= c && x <= u ? "micro-low" : u <= c && u < x ? "micro-high" : h && e >= a && e <= l ? "micro-connect" : x < u ? "micro-low" : "micro-high";
232
232
  }
233
- function Fa(e, t, r, n, a) {
233
+ function Va(e, t, r, n, a) {
234
234
  if (e === "macro-connect") {
235
- const o = t - r, c = a - n, h = Math.max(0, Math.min(1 - c, n + o)), m = h + c;
235
+ const i = t - r, c = a - n, h = Math.max(0, Math.min(1 - c, n + i)), m = h + c;
236
236
  return [h, m, "macro-connect"];
237
237
  }
238
238
  if (e === "macro-low") {
239
- const o = Math.max(0, Math.min(1, t));
240
- return o > a ? [a, o, "macro-high"] : [o, a, "macro-low"];
239
+ const i = Math.max(0, Math.min(1, t));
240
+ return i > a ? [a, i, "macro-high"] : [i, a, "macro-low"];
241
241
  }
242
242
  const l = Math.max(0, Math.min(1, t));
243
243
  return l < n ? [l, n, "macro-low"] : [n, l, "macro-high"];
244
244
  }
245
- function Va(e, t, r, n, a) {
245
+ function Ua(e, t, r, n, a) {
246
246
  if (e === "micro-connect") {
247
- const o = t - r, c = a - n, h = Math.max(0, Math.min(1 - c, n + o)), m = h + c;
247
+ const i = t - r, c = a - n, h = Math.max(0, Math.min(1 - c, n + i)), m = h + c;
248
248
  return [h, m, "micro-connect"];
249
249
  }
250
250
  if (e === "micro-low") {
251
- const o = Math.max(0, Math.min(1, t));
252
- return o > a ? [a, o, "micro-high"] : [o, a, "micro-low"];
251
+ const i = Math.max(0, Math.min(1, t));
252
+ return i > a ? [a, i, "micro-high"] : [i, a, "micro-low"];
253
253
  }
254
254
  const l = Math.max(0, Math.min(1, t));
255
255
  return l < n ? [l, n, "micro-low"] : [n, l, "micro-high"];
256
256
  }
257
- const ar = sr(({ type: e, isTop: t = !0, isVertical: r = !1, isLeft: n = !0 }) => {
257
+ const ir = ur(({ type: e, isTop: t = !0, isVertical: r = !1, isLeft: n = !0 }) => {
258
258
  let a, l;
259
- return r ? (a = n ? "M 7.375 0.625 A 7.375 7.375 0 0 0 7.375 15.375 Z" : "M 0.625 0.625 A 7.375 7.375 0 0 1 0.625 15.375 Z", l = `period-slider-knob period-slider-knob-svg is-vertical ${n ? "is-semicircle-left" : "is-semicircle-right"}`) : (a = t ? "M 0.625 7.375 A 7.375 7.375 0 0 1 15.375 7.375 Z" : "M 0.625 0.625 A 7.375 7.375 0 0 0 15.375 0.625 Z", l = `period-slider-knob period-slider-knob-svg ${t ? "is-semicircle-top" : "is-semicircle-bottom"}`), /* @__PURE__ */ p("svg", { className: l, width: r ? "8" : "16", height: r ? "16" : "8", viewBox: r ? "0 0 8 16" : "0 0 16 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ p("path", { d: a, className: e === "macro" ? "period-slider-knob-path-macro" : "period-slider-knob-path-micro", shapeRendering: "geometricPrecision", strokeWidth: "1.25" }) });
259
+ return r ? (a = n ? "M 7.375 0.625 A 7.375 7.375 0 0 0 7.375 15.375 Z" : "M 0.625 0.625 A 7.375 7.375 0 0 1 0.625 15.375 Z", l = `period-slider-knob period-slider-knob-svg is-vertical ${n ? "is-semicircle-left" : "is-semicircle-right"}`) : (a = t ? "M 0.625 7.375 A 7.375 7.375 0 0 1 15.375 7.375 Z" : "M 0.625 0.625 A 7.375 7.375 0 0 0 15.375 0.625 Z", l = `period-slider-knob period-slider-knob-svg ${t ? "is-semicircle-top" : "is-semicircle-bottom"}`), /* @__PURE__ */ v("svg", { className: l, width: r ? "8" : "16", height: r ? "16" : "8", viewBox: r ? "0 0 8 16" : "0 0 16 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ v("path", { d: a, className: e === "macro" ? "period-slider-knob-path-macro" : "period-slider-knob-path-micro", shapeRendering: "geometricPrecision", strokeWidth: "1.25" }) });
260
260
  });
261
- ar.displayName = "VernierKnobSvg";
262
- const Ua = (e, t) => {
263
- if (!st(e)) throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${pe(e)})`);
264
- if (!st(t)) throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${pe(t)})`);
261
+ ir.displayName = "VernierKnobSvg";
262
+ const Ba = (e, t) => {
263
+ if (!ut(e)) throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${Me(e)})`);
264
+ if (!ut(t)) throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${Me(t)})`);
265
265
  if (t.getTime() <= e.getTime())
266
- throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${pe(e)}, maxDate: ${pe(t)})`);
266
+ throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${Me(e)}, maxDate: ${Me(t)})`);
267
267
  }, Er = (e, t) => {
268
268
  if (!Array.isArray(t) || t.length !== 2)
269
- throw new RangeError(`PeriodSlider: ${e} is required and must be a [start, end] Date tuple (received: ${pe(t)})`);
269
+ throw new RangeError(`PeriodSlider: ${e} is required and must be a [start, end] Date tuple (received: ${Me(t)})`);
270
270
  const [r, n] = t;
271
- if (!st(r)) throw new RangeError(`PeriodSlider: ${e}[0] must be a valid Date (received: ${pe(r)})`);
272
- if (!st(n)) throw new RangeError(`PeriodSlider: ${e}[1] must be a valid Date (received: ${pe(n)})`);
271
+ if (!ut(r)) throw new RangeError(`PeriodSlider: ${e}[0] must be a valid Date (received: ${Me(r)})`);
272
+ if (!ut(n)) throw new RangeError(`PeriodSlider: ${e}[1] must be a valid Date (received: ${Me(n)})`);
273
273
  if (n.getTime() < r.getTime())
274
- throw new RangeError(`PeriodSlider: ${e} must not be inverted (start: ${pe(r)}, end: ${pe(n)})`);
275
- }, Ba = (e, t) => {
276
- if (!st(t)) throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${pe(t)})`);
274
+ throw new RangeError(`PeriodSlider: ${e} must not be inverted (start: ${Me(r)}, end: ${Me(n)})`);
275
+ }, za = (e, t) => {
276
+ if (!ut(t)) throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${Me(t)})`);
277
277
  }, Gr = (e, t, r, n) => {
278
278
  if (t.getTime() < r.getTime() || t.getTime() > n.getTime())
279
- throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${pe(t)}, minDate: ${pe(r)}, maxDate: ${pe(n)})`);
280
- }, za = (e, t, r) => {
279
+ throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${Me(t)}, minDate: ${Me(r)}, maxDate: ${Me(n)})`);
280
+ }, _a = (e, t, r) => {
281
281
  if (e.mode === "range") {
282
282
  for (const n of ["range", "defaultRange"]) {
283
283
  const a = e[n];
@@ -288,41 +288,41 @@ const Ua = (e, t) => {
288
288
  if (e.mode === "point")
289
289
  for (const n of ["value", "defaultValue"]) {
290
290
  const a = e[n];
291
- a !== void 0 && (Ba(n, a), Gr(n, a, t, r));
291
+ a !== void 0 && (za(n, a), Gr(n, a, t, r));
292
292
  }
293
- }, _a = (e, t, r) => {
293
+ }, Xa = (e, t, r) => {
294
294
  if (Er("macroRange", e), t !== void 0)
295
295
  return Er("microRange", t), t;
296
296
  if (r !== void 0)
297
297
  return Er("defaultMicroRange", r), r;
298
298
  throw new RangeError("PeriodSlider: vernier mode requires a micro selection; supply microRange (controlled) or defaultMicroRange (uncontrolled)");
299
- }, kr = (e, t, r, n, a, l, o, c) => {
300
- const h = Pe(e, n, t), m = Pe(e, a, t);
301
- return o ? h : c ? m : Math.max(h, Math.min(m, Pe(e, r, t) + l));
299
+ }, Yr = (e, t, r, n, a, l, i, c) => {
300
+ const h = Ne(e, n, t), m = Ne(e, a, t);
301
+ return i ? h : c ? m : Math.max(h, Math.min(m, Ne(e, r, t) + l));
302
302
  }, Jr = (e) => {
303
303
  e.timerId !== null && clearTimeout(e.timerId), e.timerId = null, e.emit = null;
304
- }, Xa = (e, t) => {
304
+ }, Ka = (e, t) => {
305
305
  try {
306
306
  Intl.DateTimeFormat.supportedLocalesOf([t]);
307
307
  } catch {
308
308
  throw new RangeError(`PeriodSlider: ${e} must be a valid BCP 47 language tag (received: ${JSON.stringify(t)})`);
309
309
  }
310
- }, zt = () => {
311
- const [e, t] = xe(null), r = G(null), n = X((a) => {
310
+ }, Xt = () => {
311
+ const [e, t] = Te(null), r = Z(null), n = q((a) => {
312
312
  if (r.current?.disconnect(), r.current = null, a === null) {
313
313
  t(null);
314
314
  return;
315
315
  }
316
316
  if (typeof ResizeObserver > "u") return;
317
- const l = new ResizeObserver((o) => {
318
- for (const c of o) {
317
+ const l = new ResizeObserver((i) => {
318
+ for (const c of i) {
319
319
  const h = c.borderBoxSize?.[0];
320
320
  h !== void 0 && t((m) => m !== null && Math.abs(m.widthPx - h.inlineSize) < 0.5 && Math.abs(m.heightPx - h.blockSize) < 0.5 ? m : { widthPx: h.inlineSize, heightPx: h.blockSize });
321
321
  }
322
322
  });
323
323
  l.observe(a), r.current = l;
324
324
  }, []);
325
- return Lt(
325
+ return Rt(
326
326
  () => () => {
327
327
  r.current?.disconnect(), r.current = null;
328
328
  },
@@ -335,446 +335,446 @@ const Ua = (e, t) => {
335
335
  "--ps-tooltip-tx": `calc(-50% + ${e}px)`,
336
336
  "--ps-tooltip-ty": `${t}px`,
337
337
  "--ps-tooltip-rot": `${r}deg`
338
- }), Vn = (e, t, r, n, a, l, o) => {
338
+ }), Vn = (e, t, r, n, a, l, i) => {
339
339
  const c = on(n, a);
340
- if (!o) return { slant: c, lowStyle: void 0, highStyle: void 0 };
341
- const h = Jn(e * 100, t * 100, r, n, a), m = l ? Zn(h) : h;
340
+ if (!i) return { slant: c, lowStyle: void 0, highStyle: void 0 };
341
+ const h = Zn(e * 100, t * 100, r, n, a), m = l ? Qn(h) : h;
342
342
  return {
343
343
  slant: m,
344
344
  lowStyle: Fn(m.lowOffsetX, m.lowOffsetY - c.lowOffsetY, m.lowAngleDeg),
345
345
  highStyle: Fn(m.highOffsetX, m.highOffsetY - c.highOffsetY, m.highAngleDeg)
346
346
  };
347
- }, Ka = {
347
+ }, qa = {
348
348
  horizontal: { decrease: "◀", increase: "▶" },
349
349
  vertical: { decrease: "▼", increase: "▲" }
350
- }, qa = {
350
+ }, ja = {
351
351
  horizontal: { decrease: "period-slider-stepper-prev", increase: "period-slider-stepper-next" },
352
352
  vertical: { decrease: "period-slider-stepper-prev period-slider-stepper-down", increase: "period-slider-stepper-next period-slider-stepper-up" }
353
- }, ja = (e) => {
353
+ }, Wa = (e) => {
354
354
  const {
355
355
  unit: t,
356
356
  minDate: r,
357
357
  maxDate: n,
358
358
  allowedDates: a,
359
359
  snapMode: l = "index",
360
- disabled: o = !1,
360
+ disabled: i = !1,
361
361
  className: c = "",
362
362
  showStepper: h = !0,
363
363
  tooltipStyle: m = "always",
364
- labelPosition: k = "top",
365
- autoSlantLabels: D = !0,
364
+ labelPosition: D = "top",
365
+ autoSlantLabels: x = !0,
366
366
  isVertical: u = !1,
367
- hideConnectBar: v = !1,
368
- showTicks: U = !1,
369
- colorScheme: re = "blue-rose",
370
- locale: M,
371
- decreaseAriaLabel: Q = "Decrease",
372
- increaseAriaLabel: I = "Increase"
367
+ hideConnectBar: L = !1,
368
+ showTicks: H = !1,
369
+ colorScheme: ne = "blue-rose",
370
+ locale: y,
371
+ decreaseAriaLabel: ae = "Decrease",
372
+ increaseAriaLabel: O = "Increase"
373
373
  } = e;
374
- Ua(r, n), za(e, r, n), M !== void 0 && Xa("locale", M);
375
- const ne = e.mode === "vernier" ? _a(e.macroRange, e.microRange, e.defaultMicroRange) : null, A = Pa[re], B = $a(), L = G(e);
376
- L.current = e;
377
- const K = r.getTime(), H = n.getTime(), g = $(() => ir(a, t, r, n), [a, t, K, H]), R = g.length > 0, { rangeMin: Y, rangeMax: F } = $(() => R ? { rangeMin: 0, rangeMax: g.length - 1 } : { rangeMin: W(t, r), rangeMax: W(t, n) }, [R, g, t, K, H]), P = e.mode === "point", ae = X(
378
- (i) => {
379
- if (R) {
380
- const s = Math.max(0, Math.min(g.length - 1, Math.round(i)));
381
- return g[s];
374
+ Ba(r, n), _a(e, r, n), y !== void 0 && Ka("locale", y);
375
+ const Q = e.mode === "vernier" ? Xa(e.macroRange, e.microRange, e.defaultMicroRange) : null, A = Na[ne], z = Pa(), Y = Z(e);
376
+ Y.current = e;
377
+ const V = r.getTime(), F = n.getTime(), w = $(() => sr(a, t, r, n), [a, t, V, F]), N = w.length > 0, { rangeMin: p, rangeMax: k } = $(() => N ? { rangeMin: 0, rangeMax: w.length - 1 } : { rangeMin: J(t, r), rangeMax: J(t, n) }, [N, w, t, V, F]), S = e.mode === "point", ue = q(
378
+ (o) => {
379
+ if (N) {
380
+ const s = Math.max(0, Math.min(w.length - 1, Math.round(o)));
381
+ return w[s];
382
382
  }
383
- return le(t, Math.round(i));
383
+ return me(t, Math.round(o));
384
384
  },
385
- [R, g, t]
386
- ), Le = X(
387
- (i) => {
388
- if (i === void 0) return Y;
389
- const s = et(t, i);
390
- return R ? Pe(g, s, t) : W(t, s);
385
+ [N, w, t]
386
+ ), oe = q(
387
+ (o) => {
388
+ if (o === void 0) return p;
389
+ const s = nt(t, o);
390
+ return N ? Ne(w, s, t) : J(t, s);
391
391
  },
392
- [R, g, t, Y]
393
- ), [ee, oe] = xe(() => ne), se = e.mode !== "vernier" ? null : e.microRange !== void 0 ? e.microRange : ee, ge = e.mode === "range" ? e.range?.[0] ?? e.defaultRange?.[0] : e.mode === "vernier" ? se?.[0] : void 0, J = e.mode === "range" ? e.range?.[1] ?? e.defaultRange?.[1] : e.mode === "vernier" ? se?.[1] : void 0, j = e.mode === "point" ? e.value ?? e.defaultValue : void 0, Ye = e.mode === "point" ? j?.getTime() : ge?.getTime(), vt = e.mode === "range" ? J?.getTime() : Ye, [Fe, ke] = $(() => {
392
+ [N, w, t, p]
393
+ ), [te, ie] = Te(() => Q), le = e.mode !== "vernier" ? null : e.microRange !== void 0 ? e.microRange : te, he = e.mode === "range" ? e.range?.[0] ?? e.defaultRange?.[0] : e.mode === "vernier" ? le?.[0] : void 0, W = e.mode === "range" ? e.range?.[1] ?? e.defaultRange?.[1] : e.mode === "vernier" ? le?.[1] : void 0, G = e.mode === "point" ? e.value ?? e.defaultValue : void 0, Re = e.mode === "point" ? G?.getTime() : he?.getTime(), Dt = e.mode === "range" ? W?.getTime() : Re, [Be, Ye] = $(() => {
394
394
  if (e.mode === "point") {
395
- const d = Le(j);
395
+ const d = oe(G);
396
396
  return [d, d];
397
397
  }
398
- const i = Le(ge), s = Le(J);
399
- return [Math.min(i, s), Math.max(i, s)];
400
- }, [e.mode, Ye, vt, Le, j, ge, J]), be = e.mode === "point" ? e.value !== void 0 : e.mode === "range" ? e.range !== void 0 : e.microRange !== void 0, [O, z] = xe(() => [Fe, ke]), [Z, we] = xe(null), [S, De] = xe(null), Be = G(null);
401
- Be.current = S;
402
- const [rt, ue] = xe("high"), [Se, nt] = xe(null), [Kt, cr] = xe(null), me = Z ? Z[0] : be ? Fe : O[0], fe = Z ? Z[1] : be ? ke : O[1], St = G([me, fe]);
403
- St.current = [me, fe];
404
- const te = e.mode === "vernier", Mt = e.mode === "vernier" ? e.vernierOrientation ?? (u ? "macro-left" : "macro-top") : "macro-top", x = Mt === "macro-top" || Mt === "macro-left", ur = e.mode === "vernier" ? e.showVernierProjection ?? !0 : !1, dr = e.mode === "vernier" ? e.showVernierTicks ?? !0 : !1, Rt = e.mode === "vernier" ? e.showHairline ?? !0 : !1, E = te ? e.macroUnit ?? t : t, w = te ? e.microUnit ?? t : t, Ir = te ? e.macroIsDiscrete ?? !1 : R, $t = te ? e.microIsDiscrete ?? !1 : R, Hr = te ? e.macroAllowedDates ?? a : a, Or = te ? e.microAllowedDates ?? a : a, f = te ? e.formatMacroLabel ?? e.formatLabel : e.formatLabel, N = te ? e.formatMicroLabel ?? e.formatLabel : e.formatLabel, Ae = e.mode === "vernier" ? e.macroRange[0].getTime() : void 0, Pt = e.mode === "vernier" ? e.macroRange[1].getTime() : void 0, xt = ge?.getTime(), at = J?.getTime(), [Ee, mr] = xe(null), ct = G(null);
405
- ct.current = Ee;
406
- const [Re, qt] = xe("micro-high"), Ve = $(() => W(E, r), [K, E]), kt = $(() => {
407
- const i = W(E, n);
408
- if (te && i <= Ve)
409
- throw new RangeError(`PeriodSlider: macroUnit "${E}" cannot distinguish minDate from maxDate (minDate: ${pe(r)}, maxDate: ${pe(n)})`);
410
- return i;
411
- }, [te, K, H, Ve, E]), ye = $(() => te ? ir(Hr, E, r, n) : [], [te, Hr, E, K, H]), Ce = $(() => e.mode !== "vernier" ? Ve : W(E, e.macroRange[0]), [e.mode, Ae, Ve, E]), Ie = $(() => e.mode !== "vernier" ? kt : W(E, e.macroRange[1]), [e.mode, Pt, kt, E]), fr = $(() => le(E, Ce), [E, Ce]), hr = $(() => le(E, Ie), [E, Ie]), $e = $(() => e.mode !== "vernier" ? W(w, r) : Math.max(W(w, e.macroRange[0]), W(w, r)), [e.mode, Ae, w, K]), Ke = $(() => e.mode !== "vernier" ? W(w, n) : Math.min(W(w, pt(E, w, e.macroRange[1])), W(w, n)), [e.mode, Pt, E, w, H]), ie = $(() => te ? ir(Or, w, r, n).filter((s) => {
412
- const d = W(w, s);
413
- return d >= $e && d <= Ke;
414
- }) : [], [te, Or, w, K, H, $e, Ke]), Nt = Ir && ye.length > 0, Je = $t && ie.length > 0, ve = $(() => se === null ? $e : W(w, se[0]), [xt, $e, w, se]), Me = $(() => se === null ? Ke : W(w, se[1]), [at, Ke, w, se]), ut = $(() => le(w, ve), [w, ve]), dt = $(() => le(w, Me), [w, Me]), jt = Math.max(1, kt - Ve), Te = Nt ? $r(ye, E, l, fr) : Math.max(0, Math.min(1, (Ce - Ve) / jt)), He = Math.max(Te, Nt ? $r(ye, E, l, hr) : Math.min(1, (Ie - Ve) / jt)), Wt = Math.max(1, Ke - $e), ze = Je ? $r(ie, w, l, ut) : Math.max(0, Math.min(1, (ve - $e) / Wt)), ot = Math.max(ze, Je ? $r(ie, w, l, dt) : Math.min(1, (Me - $e) / Wt)), Fr = G({ timerId: null, emit: null }), Vr = G({ timerId: null, emit: null }), Ur = G({ timerId: null, emit: null });
415
- Lt(() => {
416
- const i = [Fr, Vr, Ur];
398
+ const o = oe(he), s = oe(W);
399
+ return [Math.min(o, s), Math.max(o, s)];
400
+ }, [e.mode, Re, Dt, oe, G, he, W]), pe = e.mode === "point" ? e.value !== void 0 : e.mode === "range" ? e.range !== void 0 : e.microRange !== void 0, [I, _] = Te(() => [Be, Ye]), [re, we] = Te(null), [de, Je] = Te(null), Ze = Z(null);
401
+ Ze.current = de;
402
+ const [$t, ge] = Te("high"), [De, Ke] = Te(null), [xt, X] = Te(null), U = re ? re[0] : pe ? Be : I[0], se = re ? re[1] : pe ? Ye : I[1], ot = Z([U, se]);
403
+ ot.current = [U, se];
404
+ const ee = e.mode === "vernier", Qe = e.mode === "vernier" ? e.vernierOrientation ?? (u ? "macro-left" : "macro-top") : "macro-top", M = Qe === "macro-top" || Qe === "macro-left", dr = e.mode === "vernier" ? e.showVernierProjection ?? !0 : !1, mr = e.mode === "vernier" ? e.showVernierTicks ?? !0 : !1, Pt = e.mode === "vernier" ? e.showHairline ?? !0 : !1, E = ee ? e.macroUnit ?? t : t, b = ee ? e.microUnit ?? t : t, Ir = ee ? e.macroIsDiscrete ?? !1 : N, Nt = ee ? e.microIsDiscrete ?? !1 : N, Hr = ee ? e.macroAllowedDates ?? a : a, Or = ee ? e.microAllowedDates ?? a : a, f = ee ? e.formatMacroLabel ?? e.formatLabel : e.formatLabel, P = ee ? e.formatMicroLabel ?? e.formatLabel : e.formatLabel, Ae = e.mode === "vernier" ? e.macroRange[0].getTime() : void 0, Yt = e.mode === "vernier" ? e.macroRange[1].getTime() : void 0, yt = he?.getTime(), it = W?.getTime(), [Ee, fr] = Te(null), dt = Z(null);
405
+ dt.current = Ee;
406
+ const [$e, jt] = Te("micro-high"), Fe = $(() => J(E, r), [V, E]), kt = $(() => {
407
+ const o = J(E, n);
408
+ if (ee && o <= Fe)
409
+ throw new RangeError(`PeriodSlider: macroUnit "${E}" cannot distinguish minDate from maxDate (minDate: ${Me(r)}, maxDate: ${Me(n)})`);
410
+ return o;
411
+ }, [ee, V, F, Fe, E]), Le = $(() => ee ? sr(Hr, E, r, n) : [], [ee, Hr, E, V, F]), Ce = $(() => e.mode !== "vernier" ? Fe : J(E, e.macroRange[0]), [e.mode, Ae, Fe, E]), Ie = $(() => e.mode !== "vernier" ? kt : J(E, e.macroRange[1]), [e.mode, Yt, kt, E]), hr = $(() => me(E, Ce), [E, Ce]), gr = $(() => me(E, Ie), [E, Ie]), Pe = $(() => e.mode !== "vernier" ? J(b, r) : Math.max(J(b, e.macroRange[0]), J(b, r)), [e.mode, Ae, b, V]), qe = $(() => e.mode !== "vernier" ? J(b, n) : Math.min(J(b, Mt(E, b, e.macroRange[1])), J(b, n)), [e.mode, Yt, E, b, F]), ce = $(() => ee ? sr(Or, b, r, n).filter((s) => {
412
+ const d = J(b, s);
413
+ return d >= Pe && d <= qe;
414
+ }) : [], [ee, Or, b, V, F, Pe, qe]), At = Ir && Le.length > 0, et = Nt && ce.length > 0, xe = $(() => le === null ? Pe : J(b, le[0]), [yt, Pe, b, le]), ye = $(() => le === null ? qe : J(b, le[1]), [it, qe, b, le]), mt = $(() => me(b, xe), [b, xe]), ft = $(() => me(b, ye), [b, ye]), Wt = Math.max(1, kt - Fe), Se = At ? Pr(Le, E, l, hr) : Math.max(0, Math.min(1, (Ce - Fe) / Wt)), He = Math.max(Se, At ? Pr(Le, E, l, gr) : Math.min(1, (Ie - Fe) / Wt)), Gt = Math.max(1, qe - Pe), ze = et ? Pr(ce, b, l, mt) : Math.max(0, Math.min(1, (xe - Pe) / Gt)), lt = Math.max(ze, et ? Pr(ce, b, l, ft) : Math.min(1, (ye - Pe) / Gt)), Fr = Z({ timerId: null, emit: null }), Vr = Z({ timerId: null, emit: null }), Ur = Z({ timerId: null, emit: null });
415
+ Rt(() => {
416
+ const o = [Fr, Vr, Ur];
417
417
  return () => {
418
- for (const s of i)
418
+ for (const s of o)
419
419
  Jr(s.current);
420
420
  };
421
421
  }, []);
422
- const Yt = X((i, s, d) => {
423
- Jr(i);
424
- const { debounceMs: b } = L.current;
425
- if (d || !b || b <= 0) {
422
+ const Et = q((o, s, d) => {
423
+ Jr(o);
424
+ const { debounceMs: g } = Y.current;
425
+ if (d || !g || g <= 0) {
426
426
  s();
427
427
  return;
428
428
  }
429
- i.emit = s, i.timerId = setTimeout(() => {
430
- i.timerId = null, i.emit = null, s();
431
- }, b);
432
- }, []), Br = X((i) => {
433
- const s = i.emit;
434
- Jr(i), s?.();
435
- }, []), At = X((i) => new Date(Math.min(Math.max(i.getTime(), K), H)), [K, H]), Ze = X(
436
- (i, s, d = !1) => {
437
- const [b, T] = St.current;
438
- if ((L.current.mode === "point" ? i === b : i === b && s === T) && Fr.current.timerId === null)
429
+ o.emit = s, o.timerId = setTimeout(() => {
430
+ o.timerId = null, o.emit = null, s();
431
+ }, g);
432
+ }, []), Br = q((o) => {
433
+ const s = o.emit;
434
+ Jr(o), s?.();
435
+ }, []), Ct = q((o) => new Date(Math.min(Math.max(o.getTime(), V), F)), [V, F]), tt = q(
436
+ (o, s, d = !1) => {
437
+ const [g, R] = ot.current;
438
+ if ((Y.current.mode === "point" ? o === g : o === g && s === R) && Fr.current.timerId === null)
439
439
  return;
440
- const _ = ae(i), C = ae(s), q = () => {
441
- const y = L.current;
442
- y.mode === "point" ? y.onChangePoint?.(_) : y.mode === "range" && y.onChangeRange?.(_, C);
440
+ const K = ue(o), C = ue(s), j = () => {
441
+ const T = Y.current;
442
+ T.mode === "point" ? T.onChangePoint?.(K) : T.mode === "range" && T.onChangeRange?.(K, C);
443
443
  };
444
- Yt(Fr.current, q, d);
444
+ Et(Fr.current, j, d);
445
445
  },
446
- [ae, Yt]
447
- ), Et = X(
448
- (i, s, d = !1) => {
449
- if (L.current.mode !== "vernier") return;
450
- const b = At(i), T = At(s);
451
- Yt(
446
+ [ue, Et]
447
+ ), It = q(
448
+ (o, s, d = !1) => {
449
+ if (Y.current.mode !== "vernier") return;
450
+ const g = Ct(o), R = Ct(s);
451
+ Et(
452
452
  Vr.current,
453
453
  () => {
454
- const V = L.current;
455
- V.mode === "vernier" && V.onChangeMacroRange?.(b, T);
454
+ const B = Y.current;
455
+ B.mode === "vernier" && B.onChangeMacroRange?.(g, R);
456
456
  },
457
457
  d
458
458
  );
459
459
  },
460
- [At, Yt]
461
- ), qe = X(
462
- (i, s, d = !1) => {
463
- const b = L.current;
464
- if (b.mode !== "vernier") return;
465
- const T = At(i), V = At(s);
466
- b.microRange === void 0 && oe([T, V]), Yt(
460
+ [Ct, Et]
461
+ ), je = q(
462
+ (o, s, d = !1) => {
463
+ const g = Y.current;
464
+ if (g.mode !== "vernier") return;
465
+ const R = Ct(o), B = Ct(s);
466
+ g.microRange === void 0 && ie([R, B]), Et(
467
467
  Ur.current,
468
468
  () => {
469
- const _ = L.current;
470
- _.mode === "vernier" && _.onChangeMicroRange?.(T, V);
469
+ const K = Y.current;
470
+ K.mode === "vernier" && K.onChangeMicroRange?.(R, B);
471
471
  },
472
472
  d
473
473
  );
474
474
  },
475
- [At, Yt]
476
- ), gr = X(
477
- (i) => {
478
- if (R && l === "time" && g.length > 1) {
479
- const b = Math.max(0, Math.min(g.length - 1, Math.round(i))), T = g[0].getTime(), _ = g[g.length - 1].getTime() - T;
480
- if (_ <= 0) return 0;
481
- const C = g[b].getTime();
482
- return Math.max(0, Math.min(100, (C - T) / _ * 100));
475
+ [Ct, Et]
476
+ ), br = q(
477
+ (o) => {
478
+ if (N && l === "time" && w.length > 1) {
479
+ const g = Math.max(0, Math.min(w.length - 1, Math.round(o))), R = w[0].getTime(), K = w[w.length - 1].getTime() - R;
480
+ if (K <= 0) return 0;
481
+ const C = w[g].getTime();
482
+ return Math.max(0, Math.min(100, (C - R) / K * 100));
483
483
  }
484
- const s = F - Y;
484
+ const s = k - p;
485
485
  if (s <= 0) return 0;
486
- const d = (i - Y) / s * 100;
486
+ const d = (o - p) / s * 100;
487
487
  return Math.max(0, Math.min(100, d));
488
488
  },
489
- [R, l, g, Y, F]
490
- ), br = X(
491
- (i) => {
492
- const s = Math.max(0, Math.min(100, i));
493
- if (R) {
494
- if (l === "time" && g.length > 1) {
495
- const T = g[0].getTime(), _ = g[g.length - 1].getTime() - T, C = T + s / 100 * _;
496
- return Pe(g, new Date(C), t);
489
+ [N, l, w, p, k]
490
+ ), wr = q(
491
+ (o) => {
492
+ const s = Math.max(0, Math.min(100, o));
493
+ if (N) {
494
+ if (l === "time" && w.length > 1) {
495
+ const R = w[0].getTime(), K = w[w.length - 1].getTime() - R, C = R + s / 100 * K;
496
+ return Ne(w, new Date(C), t);
497
497
  }
498
- const b = Math.round(s / 100 * (g.length - 1));
499
- return Math.max(0, Math.min(g.length - 1, b));
498
+ const g = Math.round(s / 100 * (w.length - 1));
499
+ return Math.max(0, Math.min(w.length - 1, g));
500
500
  }
501
- const d = Y + s / 100 * (F - Y);
501
+ const d = p + s / 100 * (k - p);
502
502
  return Math.round(d);
503
503
  },
504
- [R, l, g, Y, F, t]
505
- ), it = G(null), [Ct, cn] = xe(0), [ea, Gt] = zt(), [ta, un] = zt(), [ra, dn] = zt(), [na, mn] = zt(), [aa, fn] = zt(), [oa, hn] = zt();
506
- Lt(() => {
507
- const i = it.current;
508
- if (!i) return;
504
+ [N, l, w, p, k, t]
505
+ ), st = Z(null), [Ht, cn] = Te(0), [ea, Jt] = Xt(), [ta, un] = Xt(), [ra, dn] = Xt(), [na, mn] = Xt(), [aa, fn] = Xt(), [oa, hn] = Xt();
506
+ Rt(() => {
507
+ const o = st.current;
508
+ if (!o) return;
509
509
  const s = () => {
510
- const d = i.getBoundingClientRect(), b = u ? d.height : d.width;
511
- b > 0 && cn((T) => Math.abs(T - b) < 0.5 ? T : b);
510
+ const d = o.getBoundingClientRect(), g = u ? d.height : d.width;
511
+ g > 0 && cn((R) => Math.abs(R - g) < 0.5 ? R : g);
512
512
  };
513
513
  if (s(), typeof ResizeObserver < "u") {
514
- const d = new ResizeObserver((b) => {
515
- for (const T of b) {
516
- const V = u ? T.contentRect.height : T.contentRect.width;
517
- V > 0 && cn((_) => Math.abs(_ - V) < 0.5 ? _ : V);
514
+ const d = new ResizeObserver((g) => {
515
+ for (const R of g) {
516
+ const B = u ? R.contentRect.height : R.contentRect.width;
517
+ B > 0 && cn((K) => Math.abs(K - B) < 0.5 ? K : B);
518
518
  }
519
519
  });
520
- return d.observe(i), () => d.disconnect();
520
+ return d.observe(o), () => d.disconnect();
521
521
  }
522
522
  return window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
523
523
  }, [u]);
524
- const Dt = X(
525
- (i, s, d) => {
526
- const b = u ? d.height : d.width;
527
- if (!(Number.isFinite(b) && b > 0)) return null;
528
- const T = u ? d.bottom - s : i - d.left;
529
- return Number.isFinite(T) ? Math.max(0, Math.min(1, T / b)) : null;
524
+ const Tt = q(
525
+ (o, s, d) => {
526
+ const g = u ? d.height : d.width;
527
+ if (!(Number.isFinite(g) && g > 0)) return null;
528
+ const R = u ? d.bottom - s : o - d.left;
529
+ return Number.isFinite(R) ? Math.max(0, Math.min(1, R / g)) : null;
530
530
  },
531
531
  [u]
532
- ), gn = X(
533
- (i, s) => {
534
- const d = it.current;
532
+ ), gn = q(
533
+ (o, s) => {
534
+ const d = st.current;
535
535
  if (!d) return null;
536
- const b = Dt(i, s, d.getBoundingClientRect());
537
- return b === null ? null : b * 100;
536
+ const g = Tt(o, s, d.getBoundingClientRect());
537
+ return g === null ? null : g * 100;
538
538
  },
539
- [Dt]
540
- ), wr = G(null), zr = G(null), Qe = G(null), _r = G(null), Jt = G(null), bn = X(
541
- (i) => {
542
- if (o) return;
543
- if (te) {
544
- const y = zr.current;
545
- if (!y || i.pointerId !== 0 && i.pointerId !== y.pointerId || !it.current) return;
546
- const de = Dt(i.clientX, i.clientY, it.current.getBoundingClientRect());
547
- if (de === null) return;
548
- if (y.handle === "macro-low" || y.handle === "macro-high" || y.handle === "macro-connect") {
549
- const [je, ft, Ne] = Fa(y.handle, de, y.startPointerRatio, y.startMacroLowRatio, y.startMacroHighRatio);
550
- Ne !== ct.current && (ct.current = Ne, mr(Ne), qt(Ne));
551
- let he, We;
552
- if (Nt) {
553
- const gt = Pr(ye, E, l, je), bt = Math.max(gt, Pr(ye, E, l, ft));
554
- he = ye[gt], We = ye[bt];
539
+ [Tt]
540
+ ), vr = Z(null), zr = Z(null), rt = Z(null), _r = Z(null), Zt = Z(null), bn = q(
541
+ (o) => {
542
+ if (i) return;
543
+ if (ee) {
544
+ const T = zr.current;
545
+ if (!T || o.pointerId !== 0 && o.pointerId !== T.pointerId || !st.current) return;
546
+ const be = Tt(o.clientX, o.clientY, st.current.getBoundingClientRect());
547
+ if (be === null) return;
548
+ if (T.handle === "macro-low" || T.handle === "macro-high" || T.handle === "macro-connect") {
549
+ const [We, gt, ke] = Va(T.handle, be, T.startPointerRatio, T.startMacroLowRatio, T.startMacroHighRatio);
550
+ ke !== dt.current && (dt.current = ke, fr(ke), jt(ke));
551
+ let ve, Ge;
552
+ if (At) {
553
+ const wt = Nr(Le, E, l, We), vt = Math.max(wt, Nr(Le, E, l, gt));
554
+ ve = Le[wt], Ge = Le[vt];
555
555
  } else {
556
- const gt = Math.round(Ve + je * jt), bt = Math.round(Ve + ft * jt);
557
- he = le(E, gt), We = le(E, bt);
556
+ const wt = Math.round(Fe + We * Wt), vt = Math.round(Fe + gt * Wt);
557
+ ve = me(E, wt), Ge = me(E, vt);
558
558
  }
559
- const er = `${he.getTime()}_${We.getTime()}`;
560
- er !== _r.current && (_r.current = er, Et(he, We));
561
- let lt, ht;
562
- if (y.handle === "macro-connect") {
563
- const gt = et(w, he), bt = pt(E, w, We);
564
- let Ft, Vt;
559
+ const tr = `${ve.getTime()}_${Ge.getTime()}`;
560
+ tr !== _r.current && (_r.current = tr, It(ve, Ge));
561
+ let ct, bt;
562
+ if (T.handle === "macro-connect") {
563
+ const wt = nt(b, ve), vt = Mt(E, b, Ge);
564
+ let Ut, Bt;
565
565
  if (E === "year") {
566
- const wt = he.getFullYear() - y.startMacroLowDate.getFullYear();
567
- Ft = Ue("year", y.initialMicroLowDate, wt), Vt = Ue("year", y.initialMicroHighDate, wt);
566
+ const pt = ve.getFullYear() - T.startMacroLowDate.getFullYear();
567
+ Ut = Ue("year", T.initialMicroLowDate, pt), Bt = Ue("year", T.initialMicroHighDate, pt);
568
568
  } else if (E === "month") {
569
- const wt = (he.getFullYear() - y.startMacroLowDate.getFullYear()) * 12 + (he.getMonth() - y.startMacroLowDate.getMonth());
570
- Ft = Ue("month", y.initialMicroLowDate, wt), Vt = Ue("month", y.initialMicroHighDate, wt);
569
+ const pt = (ve.getFullYear() - T.startMacroLowDate.getFullYear()) * 12 + (ve.getMonth() - T.startMacroLowDate.getMonth());
570
+ Ut = Ue("month", T.initialMicroLowDate, pt), Bt = Ue("month", T.initialMicroHighDate, pt);
571
571
  } else {
572
- const wt = Math.round((he.getTime() - y.startMacroLowDate.getTime()) / 864e5);
573
- Ft = Ue("day", y.initialMicroLowDate, wt), Vt = Ue("day", y.initialMicroHighDate, wt);
572
+ const pt = Math.round((ve.getTime() - T.startMacroLowDate.getTime()) / 864e5);
573
+ Ut = Ue("day", T.initialMicroLowDate, pt), Bt = Ue("day", T.initialMicroHighDate, pt);
574
574
  }
575
- const Ut = gt.getTime(), tr = bt.getTime(), En = y.initialMicroHighDate.getTime() - y.initialMicroLowDate.getTime();
576
- let rr = Ft.getTime(), nr = Vt.getTime();
577
- rr < Ut && (rr = Ut, nr = Math.min(tr, rr + En)), nr > tr && (nr = tr, rr = Math.max(Ut, nr - En)), lt = et(w, new Date(rr)), ht = et(w, new Date(nr));
575
+ const zt = wt.getTime(), rr = vt.getTime(), En = T.initialMicroHighDate.getTime() - T.initialMicroLowDate.getTime();
576
+ let nr = Ut.getTime(), ar = Bt.getTime();
577
+ nr < zt && (nr = zt, ar = Math.min(rr, nr + En)), ar > rr && (ar = rr, nr = Math.max(zt, ar - En)), ct = nt(b, new Date(nr)), bt = nt(b, new Date(ar));
578
578
  } else {
579
- const gt = he.getTime(), bt = pt(E, w, We).getTime(), Ft = y.initialMicroLowDate.getTime(), Vt = y.initialMicroHighDate.getTime(), Ut = Math.max(gt, Math.min(bt, Ft)), tr = Math.max(Ut, Math.min(bt, Vt));
580
- lt = et(w, new Date(Ut)), ht = et(w, new Date(tr));
579
+ const wt = ve.getTime(), vt = Mt(E, b, Ge).getTime(), Ut = T.initialMicroLowDate.getTime(), Bt = T.initialMicroHighDate.getTime(), zt = Math.max(wt, Math.min(vt, Ut)), rr = Math.max(zt, Math.min(vt, Bt));
580
+ ct = nt(b, new Date(zt)), bt = nt(b, new Date(rr));
581
581
  }
582
- const An = `${lt.getTime()}_${ht.getTime()}`;
583
- An !== Jt.current && (Jt.current = An, qe(lt, ht));
584
- } else if (y.handle === "micro-low" || y.handle === "micro-high" || y.handle === "micro-connect") {
585
- const [je, ft, Ne] = Va(y.handle, de, y.startPointerRatio, y.startMicroLowRatio, y.startMicroHighRatio);
586
- Ne !== ct.current && (ct.current = Ne, mr(Ne), qt(Ne));
587
- let he, We;
588
- if (Je) {
589
- const lt = Pr(ie, w, l, je), ht = Math.max(lt, Pr(ie, w, l, ft));
590
- he = ie[lt], We = ie[ht];
582
+ const An = `${ct.getTime()}_${bt.getTime()}`;
583
+ An !== Zt.current && (Zt.current = An, je(ct, bt));
584
+ } else if (T.handle === "micro-low" || T.handle === "micro-high" || T.handle === "micro-connect") {
585
+ const [We, gt, ke] = Ua(T.handle, be, T.startPointerRatio, T.startMicroLowRatio, T.startMicroHighRatio);
586
+ ke !== dt.current && (dt.current = ke, fr(ke), jt(ke));
587
+ let ve, Ge;
588
+ if (et) {
589
+ const ct = Nr(ce, b, l, We), bt = Math.max(ct, Nr(ce, b, l, gt));
590
+ ve = ce[ct], Ge = ce[bt];
591
591
  } else {
592
- const lt = Math.round($e + je * Wt), ht = Math.round($e + ft * Wt);
593
- he = le(w, lt), We = le(w, ht);
592
+ const ct = Math.round(Pe + We * Gt), bt = Math.round(Pe + gt * Gt);
593
+ ve = me(b, ct), Ge = me(b, bt);
594
594
  }
595
- const er = `${he.getTime()}_${We.getTime()}`;
596
- er !== Jt.current && (Jt.current = er, qe(he, We));
595
+ const tr = `${ve.getTime()}_${Ge.getTime()}`;
596
+ tr !== Zt.current && (Zt.current = tr, je(ve, Ge));
597
597
  }
598
598
  return;
599
599
  }
600
- const s = wr.current;
601
- if (!s || i.pointerId !== 0 && i.pointerId !== s.pointerId || !it.current) return;
602
- const d = it.current.getBoundingClientRect(), b = u ? i.clientY : i.clientX, T = u ? d.height : d.width;
603
- if (!(Number.isFinite(T) && T > 0)) return;
600
+ const s = vr.current;
601
+ if (!s || o.pointerId !== 0 && o.pointerId !== s.pointerId || !st.current) return;
602
+ const d = st.current.getBoundingClientRect(), g = u ? o.clientY : o.clientX, R = u ? d.height : d.width;
603
+ if (!(Number.isFinite(R) && R > 0)) return;
604
604
  if (s.handle === "connect") {
605
- const y = u ? (s.startPointerPos - b) / T : (b - s.startPointerPos) / T, de = Ea({
606
- posDiffPct: y,
605
+ const T = u ? (s.startPointerPos - g) / R : (g - s.startPointerPos) / R, be = Ca({
606
+ posDiffPct: T,
607
607
  startLowVal: s.startLowVal,
608
608
  startHighVal: s.startHighVal,
609
- rangeMin: Y,
610
- rangeMax: F,
611
- isDiscrete: R,
612
- sortedAllowedDates: g,
609
+ rangeMin: p,
610
+ rangeMax: k,
611
+ isDiscrete: N,
612
+ sortedAllowedDates: w,
613
613
  snapMode: l,
614
614
  unit: t
615
615
  });
616
- if (Qe.current && Qe.current[0] === de[0] && Qe.current[1] === de[1])
616
+ if (rt.current && rt.current[0] === be[0] && rt.current[1] === be[1])
617
617
  return;
618
- Qe.current = de, we(de), Ze(de[0], de[1], !1);
618
+ rt.current = be, we(be), tt(be[0], be[1], !1);
619
619
  return;
620
620
  }
621
- const V = Dt(i.clientX, i.clientY, d);
622
- if (V === null) return;
623
- const _ = br(V * 100), [C, q] = On(s.handle, _, s.startLowVal, s.startHighVal, Y, F, P);
624
- if ((!Qe.current || Qe.current[0] !== C || Qe.current[1] !== q) && (Qe.current = [C, q], we([C, q]), Ze(C, q, !1)), !P && (s.handle === "low" || s.handle === "high")) {
625
- const y = Aa(s.handle, _, s.startLowVal, s.startHighVal, P);
626
- Be.current !== y && (Be.current = y, De(y), ue(y));
621
+ const B = Tt(o.clientX, o.clientY, d);
622
+ if (B === null) return;
623
+ const K = wr(B * 100), [C, j] = On(s.handle, K, s.startLowVal, s.startHighVal, p, k, S);
624
+ if ((!rt.current || rt.current[0] !== C || rt.current[1] !== j) && (rt.current = [C, j], we([C, j]), tt(C, j, !1)), !S && (s.handle === "low" || s.handle === "high")) {
625
+ const T = Ea(s.handle, K, s.startLowVal, s.startHighVal, S);
626
+ Ze.current !== T && (Ze.current = T, Je(T), ge(T));
627
627
  }
628
628
  },
629
629
  [
630
- o,
631
- te,
630
+ i,
631
+ ee,
632
632
  u,
633
633
  E,
634
- w,
635
- Nt,
636
- Je,
637
- ye,
638
- ie,
639
- Ve,
640
- jt,
641
- $e,
634
+ b,
635
+ At,
636
+ et,
637
+ Le,
638
+ ce,
639
+ Fe,
642
640
  Wt,
643
- Y,
644
- F,
645
- R,
646
- g,
641
+ Pe,
642
+ Gt,
643
+ p,
644
+ k,
645
+ N,
646
+ w,
647
647
  l,
648
648
  t,
649
- Dt,
650
- br,
651
- Ze,
652
- Et,
653
- qe,
654
- P
649
+ Tt,
650
+ wr,
651
+ tt,
652
+ It,
653
+ je,
654
+ S
655
655
  ]
656
- ), wn = X(
657
- (i) => {
658
- if (te) {
659
- _r.current = null, Jt.current = null, zr.current = null, ct.current = null, mr(null), Br(Vr.current), Br(Ur.current);
656
+ ), wn = q(
657
+ (o) => {
658
+ if (ee) {
659
+ _r.current = null, Zt.current = null, zr.current = null, dt.current = null, fr(null), Br(Vr.current), Br(Ur.current);
660
660
  return;
661
661
  }
662
- const s = wr.current;
663
- if (!s || i.pointerId !== 0 && i.pointerId !== s.pointerId) return;
664
- const d = Qe.current ?? Z;
665
- d && (Ze(d[0], d[1], !0), z(d)), Qe.current = null, we(null), wr.current = null, Be.current = null, De(null);
662
+ const s = vr.current;
663
+ if (!s || o.pointerId !== 0 && o.pointerId !== s.pointerId) return;
664
+ const d = rt.current ?? re;
665
+ d && (tt(d[0], d[1], !0), _(d)), rt.current = null, we(null), vr.current = null, Ze.current = null, Je(null);
666
666
  },
667
- [te, Z, Ze, Br]
668
- ), pn = G(bn);
669
- pn.current = bn;
670
- const vn = G(wn);
671
- vn.current = wn;
672
- const Mn = S !== null || Ee !== null;
673
- Lt(() => {
667
+ [ee, re, tt, Br]
668
+ ), vn = Z(bn);
669
+ vn.current = bn;
670
+ const pn = Z(wn);
671
+ pn.current = wn;
672
+ const Mn = de !== null || Ee !== null;
673
+ Rt(() => {
674
674
  if (!Mn) return;
675
- const i = (d) => pn.current(d), s = (d) => vn.current(d);
676
- return window.addEventListener("pointermove", i), window.addEventListener("pointerup", s), window.addEventListener("pointercancel", s), () => {
677
- window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", s), window.removeEventListener("pointercancel", s);
675
+ const o = (d) => vn.current(d), s = (d) => pn.current(d);
676
+ return window.addEventListener("pointermove", o), window.addEventListener("pointerup", s), window.addEventListener("pointercancel", s), () => {
677
+ window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", s), window.removeEventListener("pointercancel", s);
678
678
  };
679
679
  }, [Mn]);
680
- const Xr = X(
681
- (i, s, d) => {
682
- wr.current = {
683
- pointerId: i,
680
+ const Xr = q(
681
+ (o, s, d) => {
682
+ vr.current = {
683
+ pointerId: o,
684
684
  handle: s,
685
685
  startPointerPos: d,
686
- startLowVal: me,
687
- startHighVal: fe
688
- }, Be.current = s, De(s), s !== "connect" && ue(s);
686
+ startLowVal: U,
687
+ startHighVal: se
688
+ }, Ze.current = s, Je(s), s !== "connect" && ge(s);
689
689
  },
690
- [me, fe]
691
- ), xn = X(
692
- (i, s, d) => {
693
- const b = L.current;
694
- b.mode === "vernier" && (zr.current = {
695
- pointerId: i,
690
+ [U, se]
691
+ ), Dn = q(
692
+ (o, s, d) => {
693
+ const g = Y.current;
694
+ g.mode === "vernier" && (zr.current = {
695
+ pointerId: o,
696
696
  handle: s,
697
697
  startPointerRatio: d,
698
- startMacroLowRatio: Te,
698
+ startMacroLowRatio: Se,
699
699
  startMacroHighRatio: He,
700
700
  startMicroLowRatio: ze,
701
- startMicroHighRatio: ot,
701
+ startMicroHighRatio: lt,
702
702
  startMacroLowEnc: Ce,
703
703
  startMacroHighEnc: Ie,
704
- startMicroLowEnc: ve,
705
- startMicroHighEnc: Me,
706
- startMacroLowDate: b.macroRange[0],
707
- startMacroHighDate: b.macroRange[1],
708
- initialMicroLowDate: ut,
709
- initialMicroHighDate: dt
710
- }, ct.current = s, mr(s), qt(s));
704
+ startMicroLowEnc: xe,
705
+ startMicroHighEnc: ye,
706
+ startMacroLowDate: g.macroRange[0],
707
+ startMacroHighDate: g.macroRange[1],
708
+ initialMicroLowDate: mt,
709
+ initialMicroHighDate: ft
710
+ }, dt.current = s, fr(s), jt(s));
711
711
  },
712
- [Te, He, ze, ot, Ce, Ie, ve, Me, ut, dt]
713
- ), Dn = (i) => (s) => {
714
- if (o) return;
715
- s.stopPropagation(), s.preventDefault(), ue(i);
712
+ [Se, He, ze, lt, Ce, Ie, xe, ye, mt, ft]
713
+ ), xn = (o) => (s) => {
714
+ if (i) return;
715
+ s.stopPropagation(), s.preventDefault(), ge(o);
716
716
  const d = u ? s.clientY : s.clientX;
717
- Xr(s.pointerId, i, d);
718
- }, yn = (i) => () => {
719
- o || Be.current !== null || ue(i);
720
- }, pr = (i) => () => {
721
- o || ct.current !== null || qt(i);
722
- }, It = (i) => (s) => {
723
- if (o) return;
717
+ Xr(s.pointerId, o, d);
718
+ }, yn = (o) => () => {
719
+ i || Ze.current !== null || ge(o);
720
+ }, pr = (o) => () => {
721
+ i || dt.current !== null || jt(o);
722
+ }, Ot = (o) => (s) => {
723
+ if (i) return;
724
724
  s.stopPropagation(), s.preventDefault();
725
- const d = it.current;
725
+ const d = st.current;
726
726
  if (!d) return;
727
- const b = Dt(s.clientX, s.clientY, d.getBoundingClientRect());
728
- b !== null && xn(s.pointerId, i, b);
729
- }, ia = (i) => {
730
- if (o || v) return;
731
- i.stopPropagation(), i.preventDefault();
732
- const s = u ? i.clientY : i.clientX;
733
- Xr(i.pointerId, "connect", s);
734
- }, la = (i) => {
735
- if (o) return;
736
- if (te) {
737
- const C = it.current;
727
+ const g = Tt(s.clientX, s.clientY, d.getBoundingClientRect());
728
+ g !== null && Dn(s.pointerId, o, g);
729
+ }, ia = (o) => {
730
+ if (i || L) return;
731
+ o.stopPropagation(), o.preventDefault();
732
+ const s = u ? o.clientY : o.clientX;
733
+ Xr(o.pointerId, "connect", s);
734
+ }, la = (o) => {
735
+ if (i) return;
736
+ if (ee) {
737
+ const C = st.current;
738
738
  if (!C) return;
739
- const q = C.getBoundingClientRect(), y = Dt(i.clientX, i.clientY, q);
740
- if (y === null) return;
741
- const de = u ? i.clientX - (q.left + q.width / 2) : i.clientY - (q.top + q.height / 2), je = Oa(y, de, Te, He, ze, ot, Mt, void 0, !v);
742
- xn(i.pointerId, je, y);
739
+ const j = C.getBoundingClientRect(), T = Tt(o.clientX, o.clientY, j);
740
+ if (T === null) return;
741
+ const be = u ? o.clientX - (j.left + j.width / 2) : o.clientY - (j.top + j.height / 2), We = Fa(T, be, Se, He, ze, lt, Qe, void 0, !L);
742
+ Dn(o.pointerId, We, T);
743
743
  return;
744
744
  }
745
- const s = gn(i.clientX, i.clientY);
745
+ const s = gn(o.clientX, o.clientY);
746
746
  if (s === null) return;
747
- const d = br(s);
748
- let b = "low";
749
- if (!P) {
750
- const C = Math.abs(d - me), q = Math.abs(d - fe);
751
- C < q ? b = "low" : q < C ? b = "high" : b = d > fe ? "high" : "low";
747
+ const d = wr(s);
748
+ let g = "low";
749
+ if (!S) {
750
+ const C = Math.abs(d - U), j = Math.abs(d - se);
751
+ C < j ? g = "low" : j < C ? g = "high" : g = d > se ? "high" : "low";
752
752
  }
753
- ue(b);
754
- const [T, V] = On(b, d, me, fe, Y, F, P);
755
- we([T, V]), Ze(T, V, !0);
756
- const _ = u ? i.clientY : i.clientX;
757
- Xr(i.pointerId, b, _);
758
- }, sa = (i) => {
759
- if (o || S !== null) return;
760
- const s = gn(i.clientX, i.clientY);
753
+ ge(g);
754
+ const [R, B] = On(g, d, U, se, p, k, S);
755
+ we([R, B]), tt(R, B, !0);
756
+ const K = u ? o.clientY : o.clientX;
757
+ Xr(o.pointerId, g, K);
758
+ }, sa = (o) => {
759
+ if (i || de !== null) return;
760
+ const s = gn(o.clientX, o.clientY);
761
761
  if (s === null) return;
762
- const d = br(s);
763
- nt(d), cr(gr(d));
762
+ const d = wr(s);
763
+ Ke(d), X(br(d));
764
764
  }, ca = () => {
765
- nt(null), cr(null);
766
- }, Tn = (i) => (s) => {
767
- if (o) return;
768
- ue(i);
769
- const d = Ca(s.key, i, me, fe, Y, F, P, 1);
770
- d && (s.preventDefault(), be || z(d), Ze(d[0], d[1], !0));
771
- }, vr = (i, s) => {
772
- const d = Math.max(W(w, i), W(w, r)), b = Math.min(W(w, pt(E, w, s)), W(w, n)), T = Math.max(d, Math.min(b, ve)), V = Math.max(T, Math.min(b, Me));
773
- T === ve && V === Me || qe(le(w, T), le(w, V), !0);
774
- }, Mr = (i) => (s) => {
775
- if (o || !te || e.mode !== "vernier") return;
776
- qt(i);
777
- let d = 0, b = !1, T = !1;
765
+ Ke(null), X(null);
766
+ }, Tn = (o) => (s) => {
767
+ if (i) return;
768
+ ge(o);
769
+ const d = Ia(s.key, o, U, se, p, k, S, 1);
770
+ d && (s.preventDefault(), pe || _(d), tt(d[0], d[1], !0));
771
+ }, Mr = (o, s) => {
772
+ const d = Math.max(J(b, o), J(b, r)), g = Math.min(J(b, Mt(E, b, s)), J(b, n)), R = Math.max(d, Math.min(g, xe)), B = Math.max(R, Math.min(g, ye));
773
+ R === xe && B === ye || je(me(b, R), me(b, B), !0);
774
+ }, Dr = (o) => (s) => {
775
+ if (i || !ee || e.mode !== "vernier") return;
776
+ jt(o);
777
+ let d = 0, g = !1, R = !1;
778
778
  switch (s.key) {
779
779
  case "ArrowRight":
780
780
  case "ArrowUp":
@@ -791,114 +791,114 @@ const Ua = (e, t) => {
791
791
  d = -5;
792
792
  break;
793
793
  case "Home":
794
- b = !0;
794
+ g = !0;
795
795
  break;
796
796
  case "End":
797
- T = !0;
797
+ R = !0;
798
798
  break;
799
799
  default:
800
800
  return;
801
801
  }
802
- if (s.preventDefault(), i === "macro-low") {
803
- const V = le(E, Ce), _ = le(E, Ie);
804
- if (Nt) {
805
- const y = kr(ye, E, V, ye[0], _, d, b, T);
806
- if (y === Pe(ye, V, E)) return;
807
- const de = ye[y];
808
- Et(de, _, !0), vr(de, _);
802
+ if (s.preventDefault(), o === "macro-low") {
803
+ const B = me(E, Ce), K = me(E, Ie);
804
+ if (At) {
805
+ const T = Yr(Le, E, B, Le[0], K, d, g, R);
806
+ if (T === Ne(Le, B, E)) return;
807
+ const be = Le[T];
808
+ It(be, K, !0), Mr(be, K);
809
809
  return;
810
810
  }
811
811
  let C;
812
- if (b ? C = Ve : T ? C = Ie : C = Math.max(Ve, Math.min(Ie, Ce + d)), C === Ce) return;
813
- const q = le(E, C);
814
- Et(q, _, !0), vr(q, _);
815
- } else if (i === "macro-high") {
816
- const V = le(E, Ce), _ = le(E, Ie);
817
- if (Nt) {
818
- const y = kr(ye, E, _, V, ye[ye.length - 1], d, b, T);
819
- if (y === Pe(ye, _, E)) return;
820
- const de = ye[y];
821
- Et(V, de, !0), vr(V, de);
812
+ if (g ? C = Fe : R ? C = Ie : C = Math.max(Fe, Math.min(Ie, Ce + d)), C === Ce) return;
813
+ const j = me(E, C);
814
+ It(j, K, !0), Mr(j, K);
815
+ } else if (o === "macro-high") {
816
+ const B = me(E, Ce), K = me(E, Ie);
817
+ if (At) {
818
+ const T = Yr(Le, E, K, B, Le[Le.length - 1], d, g, R);
819
+ if (T === Ne(Le, K, E)) return;
820
+ const be = Le[T];
821
+ It(B, be, !0), Mr(B, be);
822
822
  return;
823
823
  }
824
824
  let C;
825
- if (b ? C = Ce : T ? C = kt : C = Math.max(Ce, Math.min(kt, Ie + d)), C === Ie) return;
826
- const q = le(E, C);
827
- Et(V, q, !0), vr(V, q);
828
- } else if (i === "micro-low") {
829
- const V = le(w, ve), _ = le(w, Me);
830
- if (Je) {
831
- const q = kr(ie, w, V, ie[0], _, d, b, T);
832
- if (q === Pe(ie, V, w)) return;
833
- qe(ie[q], _, !0);
825
+ if (g ? C = Ce : R ? C = kt : C = Math.max(Ce, Math.min(kt, Ie + d)), C === Ie) return;
826
+ const j = me(E, C);
827
+ It(B, j, !0), Mr(B, j);
828
+ } else if (o === "micro-low") {
829
+ const B = me(b, xe), K = me(b, ye);
830
+ if (et) {
831
+ const j = Yr(ce, b, B, ce[0], K, d, g, R);
832
+ if (j === Ne(ce, B, b)) return;
833
+ je(ce[j], K, !0);
834
834
  return;
835
835
  }
836
836
  let C;
837
- if (b ? C = $e : T ? C = Me : C = Math.max($e, Math.min(Me, ve + d)), C === ve) return;
838
- qe(le(w, C), _, !0);
839
- } else if (i === "micro-high") {
840
- const V = le(w, ve), _ = le(w, Me);
841
- if (Je) {
842
- const q = kr(ie, w, _, V, ie[ie.length - 1], d, b, T);
843
- if (q === Pe(ie, _, w)) return;
844
- qe(V, ie[q], !0);
837
+ if (g ? C = Pe : R ? C = ye : C = Math.max(Pe, Math.min(ye, xe + d)), C === xe) return;
838
+ je(me(b, C), K, !0);
839
+ } else if (o === "micro-high") {
840
+ const B = me(b, xe), K = me(b, ye);
841
+ if (et) {
842
+ const j = Yr(ce, b, K, B, ce[ce.length - 1], d, g, R);
843
+ if (j === Ne(ce, K, b)) return;
844
+ je(B, ce[j], !0);
845
845
  return;
846
846
  }
847
847
  let C;
848
- if (b ? C = ve : T ? C = Ke : C = Math.max(ve, Math.min(Ke, Me + d)), C === Me) return;
849
- qe(V, le(w, C), !0);
848
+ if (g ? C = xe : R ? C = qe : C = Math.max(xe, Math.min(qe, ye + d)), C === ye) return;
849
+ je(B, me(b, C), !0);
850
850
  }
851
- }, ua = X(
852
- (i) => {
853
- const s = L.current;
851
+ }, ua = q(
852
+ (o) => {
853
+ const s = Y.current;
854
854
  if (!s.disabled)
855
855
  if (s.mode === "point") {
856
- const d = Math.max(Y, Math.min(F, me + i));
857
- be || z([d, d]), Ze(d, d, !0);
856
+ const d = Math.max(p, Math.min(k, U + o));
857
+ pe || _([d, d]), tt(d, d, !0);
858
858
  } else if (s.mode === "vernier") {
859
- if (Je) {
860
- const y = ie.length - 1, de = Pe(ie, ut, w), je = Pe(ie, dt, w), ft = je - de;
861
- let Ne = de + i, he = je + i;
862
- i < 0 && Ne < 0 ? (Ne = 0, he = Math.min(y, ft)) : i > 0 && he > y && (he = y, Ne = Math.max(0, y - ft)), (Ne !== de || he !== je) && qe(ie[Ne], ie[he], !0);
859
+ if (et) {
860
+ const T = ce.length - 1, be = Ne(ce, mt, b), We = Ne(ce, ft, b), gt = We - be;
861
+ let ke = be + o, ve = We + o;
862
+ o < 0 && ke < 0 ? (ke = 0, ve = Math.min(T, gt)) : o > 0 && ve > T && (ve = T, ke = Math.max(0, T - gt)), (ke !== be || ve !== We) && je(ce[ke], ce[ve], !0);
863
863
  return;
864
864
  }
865
- const d = ve, b = Me, T = $e, V = Ke, _ = b - d;
866
- let C = d + i, q = b + i;
867
- i < 0 && C < T ? (C = T, q = Math.min(V, C + _)) : i > 0 && q > V && (q = V, C = Math.max(T, q - _)), (C !== d || q !== b) && qe(le(w, C), le(w, q), !0);
865
+ const d = xe, g = ye, R = Pe, B = qe, K = g - d;
866
+ let C = d + o, j = g + o;
867
+ o < 0 && C < R ? (C = R, j = Math.min(B, C + K)) : o > 0 && j > B && (j = B, C = Math.max(R, j - K)), (C !== d || j !== g) && je(me(b, C), me(b, j), !0);
868
868
  } else {
869
- const d = fe - me;
870
- let b = me + i, T = fe + i;
871
- i < 0 && b < Y ? (b = Y, T = Math.min(F, b + d)) : i > 0 && T > F && (T = F, b = Math.max(Y, T - d)), b <= T && (be || z([b, T]), Ze(b, T, !0));
869
+ const d = se - U;
870
+ let g = U + o, R = se + o;
871
+ o < 0 && g < p ? (g = p, R = Math.min(k, g + d)) : o > 0 && R > k && (R = k, g = Math.max(p, R - d)), g <= R && (pe || _([g, R]), tt(g, R, !0));
872
872
  }
873
873
  },
874
874
  [
875
- me,
876
- fe,
877
- Y,
878
- F,
879
- be,
880
- Ze,
875
+ U,
876
+ se,
877
+ p,
878
+ k,
879
+ pe,
880
+ tt,
881
+ je,
882
+ xe,
883
+ ye,
884
+ Pe,
881
885
  qe,
882
- ve,
883
- Me,
884
- $e,
885
- Ke,
886
- w,
887
- Je,
888
- ie,
889
- ut,
890
- dt
886
+ b,
887
+ et,
888
+ ce,
889
+ mt,
890
+ ft
891
891
  ]
892
- ), Ht = gr(me), Ot = gr(fe), Kr = ae(me), qr = ae(fe), jr = $(() => P ? Gt === null ? void 0 : { estimatedWidthPx: Gt.widthPx, estimatedHeightPx: Gt.heightPx } : Zr(Gt, un), [P, Gt, un]), xr = !P && me === fe, Oe = $(() => {
893
- if (P || !D || u) return on(k, jr);
894
- const i = Jn(Ht, Ot, Ct, k, jr);
895
- return xr ? Zn(i) : i;
896
- }, [P, xr, D, u, Ht, Ot, Ct, k, jr]), Zt = S === "low" || S !== "high" && rt === "low", Qt = !P && (S === "high" || S !== "low" && rt === "high"), Dr = Ce === Ie, yr = ve === Me, da = Dr && Re !== "macro-low", ma = Dr && Re === "macro-low", fa = yr && Re !== "micro-low", ha = yr && Re === "micro-low", Ln = x ? "top" : "bottom", Sn = x ? "bottom" : "top", Rn = $(() => Zr(dn, mn), [dn, mn]), $n = $(() => Zr(fn, hn), [fn, hn]), Tr = D && !u, Lr = $(
897
- () => Vn(Te, He, Ct, Ln, Rn, Dr, Tr),
898
- [Te, He, Ct, Ln, Rn, Dr, Tr]
899
- ), Sr = $(
900
- () => Vn(ze, ot, Ct, Sn, $n, yr, Tr),
901
- [ze, ot, Ct, Sn, $n, yr, Tr]
892
+ ), Ft = br(U), Vt = br(se), Kr = ue(U), qr = ue(se), jr = $(() => S ? Jt === null ? void 0 : { estimatedWidthPx: Jt.widthPx, estimatedHeightPx: Jt.heightPx } : Zr(Jt, un), [S, Jt, un]), xr = !S && U === se, Oe = $(() => {
893
+ if (S || !x || u) return on(D, jr);
894
+ const o = Zn(Ft, Vt, Ht, D, jr);
895
+ return xr ? Qn(o) : o;
896
+ }, [S, xr, x, u, Ft, Vt, Ht, D, jr]), Qt = de === "low" || de !== "high" && $t === "low", er = !S && (de === "high" || de !== "low" && $t === "high"), yr = Ce === Ie, Tr = xe === ye, da = yr && $e !== "macro-low", ma = yr && $e === "macro-low", fa = Tr && $e !== "micro-low", ha = Tr && $e === "micro-low", Ln = M ? "top" : "bottom", Sn = M ? "bottom" : "top", Rn = $(() => Zr(dn, mn), [dn, mn]), $n = $(() => Zr(fn, hn), [fn, hn]), Lr = x && !u, Sr = $(
897
+ () => Vn(Se, He, Ht, Ln, Rn, yr, Lr),
898
+ [Se, He, Ht, Ln, Rn, yr, Lr]
899
+ ), Rr = $(
900
+ () => Vn(ze, lt, Ht, Sn, $n, Tr, Lr),
901
+ [ze, lt, Ht, Sn, $n, Tr, Lr]
902
902
  ), ga = $(() => u ? {
903
903
  "--ps-tooltip-origin": "100% 50%",
904
904
  "--ps-tooltip-tx": "0px",
@@ -919,408 +919,410 @@ const Ua = (e, t) => {
919
919
  "--ps-tooltip-tx": `calc(-50% + ${Oe.highOffsetX}px)`,
920
920
  "--ps-tooltip-ty": `calc(-50% + ${Oe.highOffsetY}px)`,
921
921
  "--ps-tooltip-rot": `${Oe.highAngleDeg}deg`
922
- }, [u, Oe.highOffsetX, Oe.highOffsetY, Oe.highAngleDeg]), Rr = Math.min(Ht, Ot), Pn = Math.max(Ht, Ot), wa = u ? {
923
- bottom: `${Rr}%`,
924
- height: `${Pn - Rr}%`,
922
+ }, [u, Oe.highOffsetX, Oe.highOffsetY, Oe.highAngleDeg]), $r = Math.min(Ft, Vt), Pn = Math.max(Ft, Vt), wa = u ? {
923
+ bottom: `${$r}%`,
924
+ height: `${Pn - $r}%`,
925
925
  top: "auto",
926
926
  left: "0",
927
927
  right: "0"
928
928
  } : {
929
- left: `${Rr}%`,
930
- width: `${Pn - Rr}%`,
929
+ left: `${$r}%`,
930
+ width: `${Pn - $r}%`,
931
931
  top: "0",
932
932
  bottom: "0"
933
- }, pa = Math.max(0.01, He - Te), kn = Math.max(0.06, Math.min(0.25, 0.28 * Math.sqrt(pa))), va = u ? { bottom: `${Ht}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: Zt ? 40 : 30 } : { left: `${Ht}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: Zt ? 40 : 30 }, Ma = u ? { bottom: `${Ot}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: Qt ? 40 : 30 } : { left: `${Ot}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: Qt ? 40 : 30 }, xa = u ? { bottom: `${Kt}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${Kt}%`, top: "50%", transform: "translate(-50%, -50%)" }, Nn = Se !== null ? ae(Se) : null, Da = Je ? W(w, ie[0]) : $e, ya = Je ? W(w, ie[ie.length - 1]) : Ke, Ta = o || (te ? ve <= Da : P ? me <= Y : me <= Y && fe <= Y), La = o || (te ? Me >= ya : (P || me >= F) && fe >= F), mt = o ? "cursor-not-allowed opacity-50" : "cursor-pointer", Yn = (i) => {
934
- const s = u ? "vertical" : "horizontal", d = i === "decrease", b = qa[s][i];
935
- return /* @__PURE__ */ p(
933
+ }, va = Math.max(0.01, He - Se), Nn = Math.max(0.06, Math.min(0.25, 0.28 * Math.sqrt(va))), pa = u ? { bottom: `${Ft}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: Qt ? 40 : 30 } : { left: `${Ft}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: Qt ? 40 : 30 }, Ma = u ? { bottom: `${Vt}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: er ? 40 : 30 } : { left: `${Vt}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: er ? 40 : 30 }, Da = u ? { bottom: `${xt}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${xt}%`, top: "50%", transform: "translate(-50%, -50%)" }, Yn = De !== null ? ue(De) : null, xa = m !== "hover" && De !== null && (De === U || !S && De === se), ya = et ? J(b, ce[0]) : Pe, Ta = et ? J(b, ce[ce.length - 1]) : qe, La = i || (ee ? xe <= ya : S ? U <= p : U <= p && se <= p), Sa = i || (ee ? ye >= Ta : (S || U >= k) && se >= k), ht = i ? "cursor-not-allowed opacity-50" : "cursor-pointer", kn = (o) => {
934
+ const s = u ? "vertical" : "horizontal", d = o === "decrease", g = ja[s][o];
935
+ return /* @__PURE__ */ v(
936
936
  "button",
937
937
  {
938
938
  type: "button",
939
- className: `period-slider-stepper-btn relative after:absolute after:inset-[-11px] after:content-[''] ${b} flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-slate-300 bg-white font-bold text-[10px] text-slate-700 leading-none shadow-2xs transition-all hover:bg-slate-100 hover:text-indigo-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 active:scale-95 disabled:cursor-not-allowed disabled:opacity-30 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 ${mt}`,
939
+ className: `period-slider-stepper-btn relative after:absolute after:inset-[-11px] after:content-[''] ${g} flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-slate-300 bg-white font-bold text-[10px] text-slate-700 leading-none shadow-2xs transition-all hover:bg-slate-100 hover:text-indigo-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 active:scale-95 disabled:cursor-not-allowed disabled:opacity-30 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 ${ht}`,
940
940
  onClick: () => ua(d ? -1 : 1),
941
- disabled: d ? Ta : La,
942
- "aria-label": d ? Q : I,
943
- children: Ka[s][i]
941
+ disabled: d ? La : Sa,
942
+ "aria-label": d ? ae : O,
943
+ children: qa[s][o]
944
944
  }
945
945
  );
946
946
  };
947
- return /* @__PURE__ */ ce(
947
+ return /* @__PURE__ */ fe(
948
948
  "div",
949
949
  {
950
950
  style: e.style,
951
951
  className: `period-slider flex select-none items-center gap-2 ${u ? "flex-col" : "flex-row"} ${c}`,
952
- "data-disabled": o ? "true" : void 0,
952
+ "data-disabled": i ? "true" : void 0,
953
953
  "data-unit": t,
954
954
  "data-mode": e.mode,
955
955
  "data-orientation": u ? "vertical" : "horizontal",
956
- "data-label-position": k,
957
- "data-color-scheme": re,
956
+ "data-label-position": D,
957
+ "data-color-scheme": ne,
958
958
  children: [
959
- h && Yn(u ? "increase" : "decrease"),
960
- /* @__PURE__ */ p(
959
+ h && kn(u ? "increase" : "decrease"),
960
+ /* @__PURE__ */ v(
961
961
  "div",
962
962
  {
963
- ref: it,
963
+ ref: st,
964
964
  "data-testid": "period-slider-track",
965
965
  "data-orientation": u ? "vertical" : "horizontal",
966
- "data-vernier-orientation": te ? Mt : void 0,
967
- className: `period-slider-track relative flex-1 touch-none rounded-full bg-slate-200 dark:bg-slate-700 ${u ? "h-48 w-2" : "h-2 w-full"} ${mt}`,
966
+ "data-vernier-orientation": ee ? Qe : void 0,
967
+ className: `period-slider-track relative flex-1 touch-none rounded-full bg-slate-200 dark:bg-slate-700 ${u ? "h-48 w-2" : "h-2 w-full"} ${ht}`,
968
968
  onPointerDown: la,
969
969
  onPointerMove: sa,
970
970
  onPointerLeave: ca,
971
- children: te ? /* @__PURE__ */ ce(Wr, { children: [
972
- ur && (u ? /* @__PURE__ */ ce("svg", { className: "period-slider-vernier-projection is-vertical", role: "presentation", "aria-hidden": "true", width: "32", height: "100%", viewBox: "0 0 32 100", preserveAspectRatio: "none", children: [
973
- /* @__PURE__ */ p("defs", { children: /* @__PURE__ */ ce("linearGradient", { id: B, x1: "0", y1: "0", x2: "1", y2: "0", children: [
974
- /* @__PURE__ */ p("stop", { offset: "0%", stopColor: x ? A.macro : A.micro, stopOpacity: "0.28" }),
975
- /* @__PURE__ */ p("stop", { offset: "100%", stopColor: x ? A.micro : A.macro, stopOpacity: kn })
971
+ children: ee ? /* @__PURE__ */ fe(Wr, { children: [
972
+ dr && (u ? /* @__PURE__ */ fe("svg", { className: "period-slider-vernier-projection is-vertical", role: "presentation", "aria-hidden": "true", width: "32", height: "100%", viewBox: "0 0 32 100", preserveAspectRatio: "none", children: [
973
+ /* @__PURE__ */ v("defs", { children: /* @__PURE__ */ fe("linearGradient", { id: z, x1: "0", y1: "0", x2: "1", y2: "0", children: [
974
+ /* @__PURE__ */ v("stop", { offset: "0%", stopColor: M ? A.macro : A.micro, stopOpacity: "0.28" }),
975
+ /* @__PURE__ */ v("stop", { offset: "100%", stopColor: M ? A.micro : A.macro, stopOpacity: Nn })
976
976
  ] }) }),
977
- /* @__PURE__ */ p("polygon", { points: x ? `12,${(1 - He) * 100} 12,${(1 - Te) * 100} 20,100 20,0` : `12,0 12,100 20,${(1 - Te) * 100} 20,${(1 - He) * 100}`, fill: `url(#${B})` })
978
- ] }) : /* @__PURE__ */ ce("svg", { className: "period-slider-vernier-projection", role: "presentation", "aria-hidden": "true", width: "100%", height: "32", viewBox: "0 0 100 32", preserveAspectRatio: "none", children: [
979
- /* @__PURE__ */ p("defs", { children: /* @__PURE__ */ ce("linearGradient", { id: B, x1: "0", y1: "0", x2: "0", y2: "1", children: [
980
- /* @__PURE__ */ p("stop", { offset: "0%", stopColor: x ? A.macro : A.micro, stopOpacity: "0.28" }),
981
- /* @__PURE__ */ p("stop", { offset: "100%", stopColor: x ? A.micro : A.macro, stopOpacity: kn })
977
+ /* @__PURE__ */ v("polygon", { points: M ? `12,${(1 - He) * 100} 12,${(1 - Se) * 100} 20,100 20,0` : `12,0 12,100 20,${(1 - Se) * 100} 20,${(1 - He) * 100}`, fill: `url(#${z})` })
978
+ ] }) : /* @__PURE__ */ fe("svg", { className: "period-slider-vernier-projection", role: "presentation", "aria-hidden": "true", width: "100%", height: "32", viewBox: "0 0 100 32", preserveAspectRatio: "none", children: [
979
+ /* @__PURE__ */ v("defs", { children: /* @__PURE__ */ fe("linearGradient", { id: z, x1: "0", y1: "0", x2: "0", y2: "1", children: [
980
+ /* @__PURE__ */ v("stop", { offset: "0%", stopColor: M ? A.macro : A.micro, stopOpacity: "0.28" }),
981
+ /* @__PURE__ */ v("stop", { offset: "100%", stopColor: M ? A.micro : A.macro, stopOpacity: Nn })
982
982
  ] }) }),
983
- /* @__PURE__ */ p("polygon", { points: x ? `${Te * 100},12 ${He * 100},12 100,20 0,20` : `0,12 100,12 ${He * 100},20 ${Te * 100},20`, fill: `url(#${B})` })
983
+ /* @__PURE__ */ v("polygon", { points: M ? `${Se * 100},12 ${He * 100},12 100,20 0,20` : `0,12 100,12 ${He * 100},20 ${Se * 100},20`, fill: `url(#${z})` })
984
984
  ] })),
985
- !v && /* @__PURE__ */ ce(Wr, { children: [
986
- /* @__PURE__ */ p(
985
+ !L && /* @__PURE__ */ fe(Wr, { children: [
986
+ /* @__PURE__ */ v(
987
987
  "div",
988
988
  {
989
989
  "data-testid": "period-slider-connect-macro",
990
990
  className: "period-slider-connect-macro",
991
991
  style: u ? {
992
- bottom: `calc(${Te * 100}% - 8px)`,
993
- height: `calc(${Math.max(0, (He - Te) * 100)}% + 16px)`
992
+ bottom: `calc(${Se * 100}% - 8px)`,
993
+ height: `calc(${Math.max(0, (He - Se) * 100)}% + 16px)`
994
994
  } : {
995
- left: `calc(${Te * 100}% - 8px)`,
996
- width: `calc(${Math.max(0, (He - Te) * 100)}% + 16px)`
995
+ left: `calc(${Se * 100}% - 8px)`,
996
+ width: `calc(${Math.max(0, (He - Se) * 100)}% + 16px)`
997
997
  },
998
- onPointerDown: It("macro-connect")
998
+ onPointerDown: Ot("macro-connect")
999
999
  }
1000
1000
  ),
1001
- /* @__PURE__ */ p(
1001
+ /* @__PURE__ */ v(
1002
1002
  "div",
1003
1003
  {
1004
1004
  "data-testid": "period-slider-connect-micro",
1005
1005
  className: "period-slider-connect-micro",
1006
1006
  style: u ? {
1007
1007
  bottom: `calc(${ze * 100}% - 8px)`,
1008
- height: `calc(${Math.max(0, (ot - ze) * 100)}% + 16px)`
1008
+ height: `calc(${Math.max(0, (lt - ze) * 100)}% + 16px)`
1009
1009
  } : {
1010
1010
  left: `calc(${ze * 100}% - 8px)`,
1011
- width: `calc(${Math.max(0, (ot - ze) * 100)}% + 16px)`
1011
+ width: `calc(${Math.max(0, (lt - ze) * 100)}% + 16px)`
1012
1012
  },
1013
- onPointerDown: It("micro-connect")
1013
+ onPointerDown: Ot("micro-connect")
1014
1014
  }
1015
1015
  )
1016
1016
  ] }),
1017
- dr && /* @__PURE__ */ ce("div", { className: "period-slider-vernier-ticks pointer-events-none absolute inset-0", children: [
1018
- [0.2, 0.4, 0.6, 0.8].map((i) => /* @__PURE__ */ p("div", { "data-testid": "period-slider-tick", "data-tick-scale": "macro", className: "period-slider-tick period-slider-tick-macro", style: u ? { bottom: `${i * 100}%` } : { left: `${i * 100}%` } }, `macro-tick-${i}`)),
1019
- [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9].map((i) => /* @__PURE__ */ p("div", { "data-testid": "period-slider-tick", "data-tick-scale": "micro", className: "period-slider-tick period-slider-tick-micro", style: u ? { bottom: `${i * 100}%` } : { left: `${i * 100}%` } }, `micro-tick-${i}`))
1017
+ mr && /* @__PURE__ */ fe("div", { className: "period-slider-vernier-ticks pointer-events-none absolute inset-0", children: [
1018
+ [0.2, 0.4, 0.6, 0.8].map((o) => /* @__PURE__ */ v("div", { "data-testid": "period-slider-tick", "data-tick-scale": "macro", className: "period-slider-tick period-slider-tick-macro", style: u ? { bottom: `${o * 100}%` } : { left: `${o * 100}%` } }, `macro-tick-${o}`)),
1019
+ [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9].map((o) => /* @__PURE__ */ v("div", { "data-testid": "period-slider-tick", "data-tick-scale": "micro", className: "period-slider-tick period-slider-tick-micro", style: u ? { bottom: `${o * 100}%` } : { left: `${o * 100}%` } }, `micro-tick-${o}`))
1020
1020
  ] }),
1021
- /* @__PURE__ */ ce(
1021
+ /* @__PURE__ */ fe(
1022
1022
  "div",
1023
1023
  {
1024
- tabIndex: o ? -1 : 0,
1024
+ tabIndex: i ? -1 : 0,
1025
1025
  role: "slider",
1026
1026
  "aria-label": e.macroLowerAriaLabel ?? "Macro range start",
1027
- "aria-disabled": o ? "true" : void 0,
1028
- "aria-valuemin": Ve,
1027
+ "aria-disabled": i ? "true" : void 0,
1028
+ "aria-valuemin": Fe,
1029
1029
  "aria-valuemax": Ie,
1030
1030
  "aria-valuenow": Ce,
1031
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(fr, E) : Bt(E, fr, f, M),
1031
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(hr, E) : _t(E, hr, f, y),
1032
1032
  "aria-orientation": u ? "vertical" : "horizontal",
1033
- className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? x ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : x ? "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0" : "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${mt}`,
1033
+ className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? M ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : M ? "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0" : "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ht}`,
1034
1034
  style: u ? {
1035
- bottom: `${Te * 100}%`,
1036
- left: x ? 0 : "auto",
1037
- right: x ? "auto" : 0,
1038
- transform: x ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1039
- zIndex: Ee === "macro-low" || Re === "macro-low" ? 30 : 15
1035
+ bottom: `${Se * 100}%`,
1036
+ left: M ? 0 : "auto",
1037
+ right: M ? "auto" : 0,
1038
+ transform: M ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1039
+ zIndex: Ee === "macro-low" || $e === "macro-low" ? 30 : 15
1040
1040
  } : {
1041
- left: `${Te * 100}%`,
1042
- top: x ? 0 : "auto",
1043
- bottom: x ? "auto" : 0,
1044
- transform: x ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1045
- zIndex: Ee === "macro-low" || Re === "macro-low" ? 30 : 15
1041
+ left: `${Se * 100}%`,
1042
+ top: M ? 0 : "auto",
1043
+ bottom: M ? "auto" : 0,
1044
+ transform: M ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1045
+ zIndex: Ee === "macro-low" || $e === "macro-low" ? 30 : 15
1046
1046
  },
1047
- onPointerDown: It("macro-low"),
1048
- onKeyDown: Mr("macro-low"),
1047
+ onPointerDown: Ot("macro-low"),
1048
+ onKeyDown: Dr("macro-low"),
1049
1049
  onFocus: pr("macro-low"),
1050
1050
  "data-active": Ee === "macro-low" ? "true" : void 0,
1051
- "data-front": Re === "macro-low" ? "true" : void 0,
1052
- "data-vernier-pos": u ? x ? "left" : "right" : x ? "top" : "bottom",
1051
+ "data-front": $e === "macro-low" ? "true" : void 0,
1052
+ "data-vernier-pos": u ? M ? "left" : "right" : M ? "top" : "bottom",
1053
1053
  "data-handle-type": "macro-low",
1054
1054
  children: [
1055
- /* @__PURE__ */ p(ar, { type: "macro", isTop: x, isVertical: u, isLeft: x }),
1056
- Rt && /* @__PURE__ */ p("div", { className: "period-slider-hairline" }),
1057
- m !== "hover" && /* @__PURE__ */ p(
1055
+ /* @__PURE__ */ v(ir, { type: "macro", isTop: M, isVertical: u, isLeft: M }),
1056
+ Pt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1057
+ m !== "hover" && /* @__PURE__ */ v(
1058
1058
  "div",
1059
1059
  {
1060
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1060
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1061
1061
  "data-tooltip-style": m,
1062
1062
  "data-duplicate": da ? "true" : void 0,
1063
- "data-slanted": Lr.slant.isSlanted ? "true" : void 0,
1063
+ "data-slanted": Sr.slant.isSlanted ? "true" : void 0,
1064
1064
  ref: ra,
1065
- style: Lr.lowStyle,
1066
- children: _e(E, fr, f, M)
1065
+ style: Sr.lowStyle,
1066
+ children: Ve(E, hr, f, y)
1067
1067
  }
1068
1068
  )
1069
1069
  ]
1070
1070
  }
1071
1071
  ),
1072
- /* @__PURE__ */ ce(
1072
+ /* @__PURE__ */ fe(
1073
1073
  "div",
1074
1074
  {
1075
- tabIndex: o ? -1 : 0,
1075
+ tabIndex: i ? -1 : 0,
1076
1076
  role: "slider",
1077
1077
  "aria-label": e.macroUpperAriaLabel ?? "Macro range end",
1078
- "aria-disabled": o ? "true" : void 0,
1078
+ "aria-disabled": i ? "true" : void 0,
1079
1079
  "aria-valuemin": Ce,
1080
1080
  "aria-valuemax": kt,
1081
1081
  "aria-valuenow": Ie,
1082
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(hr, E) : Bt(E, hr, f, M),
1082
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(gr, E) : _t(E, gr, f, y),
1083
1083
  "aria-orientation": u ? "vertical" : "horizontal",
1084
- className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? x ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : x ? "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0" : "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${mt}`,
1084
+ className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? M ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : M ? "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0" : "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ht}`,
1085
1085
  style: u ? {
1086
1086
  bottom: `${He * 100}%`,
1087
- left: x ? 0 : "auto",
1088
- right: x ? "auto" : 0,
1089
- transform: x ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1090
- zIndex: Ee === "macro-high" || Re === "macro-high" ? 30 : 15
1087
+ left: M ? 0 : "auto",
1088
+ right: M ? "auto" : 0,
1089
+ transform: M ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1090
+ zIndex: Ee === "macro-high" || $e === "macro-high" ? 30 : 15
1091
1091
  } : {
1092
1092
  left: `${He * 100}%`,
1093
- top: x ? 0 : "auto",
1094
- bottom: x ? "auto" : 0,
1095
- transform: x ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1096
- zIndex: Ee === "macro-high" || Re === "macro-high" ? 30 : 15
1093
+ top: M ? 0 : "auto",
1094
+ bottom: M ? "auto" : 0,
1095
+ transform: M ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1096
+ zIndex: Ee === "macro-high" || $e === "macro-high" ? 30 : 15
1097
1097
  },
1098
- onPointerDown: It("macro-high"),
1099
- onKeyDown: Mr("macro-high"),
1098
+ onPointerDown: Ot("macro-high"),
1099
+ onKeyDown: Dr("macro-high"),
1100
1100
  onFocus: pr("macro-high"),
1101
1101
  "data-active": Ee === "macro-high" ? "true" : void 0,
1102
- "data-front": Re === "macro-high" ? "true" : void 0,
1103
- "data-vernier-pos": u ? x ? "left" : "right" : x ? "top" : "bottom",
1102
+ "data-front": $e === "macro-high" ? "true" : void 0,
1103
+ "data-vernier-pos": u ? M ? "left" : "right" : M ? "top" : "bottom",
1104
1104
  "data-handle-type": "macro-high",
1105
1105
  children: [
1106
- /* @__PURE__ */ p(ar, { type: "macro", isTop: x, isVertical: u, isLeft: x }),
1107
- Rt && /* @__PURE__ */ p("div", { className: "period-slider-hairline" }),
1108
- m !== "hover" && /* @__PURE__ */ p(
1106
+ /* @__PURE__ */ v(ir, { type: "macro", isTop: M, isVertical: u, isLeft: M }),
1107
+ Pt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1108
+ m !== "hover" && /* @__PURE__ */ v(
1109
1109
  "div",
1110
1110
  {
1111
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1111
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1112
1112
  "data-tooltip-style": m,
1113
1113
  "data-duplicate": ma ? "true" : void 0,
1114
- "data-slanted": Lr.slant.isSlanted ? "true" : void 0,
1114
+ "data-slanted": Sr.slant.isSlanted ? "true" : void 0,
1115
1115
  ref: na,
1116
- style: Lr.highStyle,
1117
- children: _e(E, hr, f, M)
1116
+ style: Sr.highStyle,
1117
+ children: Ve(E, gr, f, y)
1118
1118
  }
1119
1119
  )
1120
1120
  ]
1121
1121
  }
1122
1122
  ),
1123
- /* @__PURE__ */ ce(
1123
+ /* @__PURE__ */ fe(
1124
1124
  "div",
1125
1125
  {
1126
- tabIndex: o ? -1 : 0,
1126
+ tabIndex: i ? -1 : 0,
1127
1127
  role: "slider",
1128
1128
  "aria-label": e.lowerAriaLabel ?? "Micro range start",
1129
- "aria-disabled": o ? "true" : void 0,
1130
- "aria-valuemin": $e,
1131
- "aria-valuemax": Me,
1132
- "aria-valuenow": ve,
1133
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(ut, w) : Bt(w, ut, N, M),
1129
+ "aria-disabled": i ? "true" : void 0,
1130
+ "aria-valuemin": Pe,
1131
+ "aria-valuemax": ye,
1132
+ "aria-valuenow": xe,
1133
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(mt, b) : _t(b, mt, P, y),
1134
1134
  "aria-orientation": u ? "vertical" : "horizontal",
1135
- className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? x ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : x ? "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4" : "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${mt}`,
1135
+ className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? M ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : M ? "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4" : "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ht}`,
1136
1136
  style: u ? {
1137
1137
  bottom: `${ze * 100}%`,
1138
- left: x ? "auto" : 0,
1139
- right: x ? 0 : "auto",
1140
- transform: x ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1141
- zIndex: Ee === "micro-low" || Re === "micro-low" ? 30 : 20
1138
+ left: M ? "auto" : 0,
1139
+ right: M ? 0 : "auto",
1140
+ transform: M ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1141
+ zIndex: Ee === "micro-low" || $e === "micro-low" ? 30 : 20
1142
1142
  } : {
1143
1143
  left: `${ze * 100}%`,
1144
- top: x ? "auto" : 0,
1145
- bottom: x ? 0 : "auto",
1146
- transform: x ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1147
- zIndex: Ee === "micro-low" || Re === "micro-low" ? 30 : 20
1144
+ top: M ? "auto" : 0,
1145
+ bottom: M ? 0 : "auto",
1146
+ transform: M ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1147
+ zIndex: Ee === "micro-low" || $e === "micro-low" ? 30 : 20
1148
1148
  },
1149
- onPointerDown: It("micro-low"),
1150
- onKeyDown: Mr("micro-low"),
1149
+ onPointerDown: Ot("micro-low"),
1150
+ onKeyDown: Dr("micro-low"),
1151
1151
  onFocus: pr("micro-low"),
1152
1152
  "data-active": Ee === "micro-low" ? "true" : void 0,
1153
- "data-front": Re === "micro-low" ? "true" : void 0,
1154
- "data-vernier-pos": u ? x ? "right" : "left" : x ? "bottom" : "top",
1153
+ "data-front": $e === "micro-low" ? "true" : void 0,
1154
+ "data-vernier-pos": u ? M ? "right" : "left" : M ? "bottom" : "top",
1155
1155
  "data-handle-type": "micro-low",
1156
1156
  children: [
1157
- /* @__PURE__ */ p(ar, { type: "micro", isTop: !x, isVertical: u, isLeft: !x }),
1158
- Rt && /* @__PURE__ */ p("div", { className: "period-slider-hairline" }),
1159
- m !== "hover" && /* @__PURE__ */ p(
1157
+ /* @__PURE__ */ v(ir, { type: "micro", isTop: !M, isVertical: u, isLeft: !M }),
1158
+ Pt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1159
+ m !== "hover" && /* @__PURE__ */ v(
1160
1160
  "div",
1161
1161
  {
1162
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1162
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1163
1163
  "data-tooltip-style": m,
1164
1164
  "data-duplicate": fa ? "true" : void 0,
1165
- "data-slanted": Sr.slant.isSlanted ? "true" : void 0,
1165
+ "data-slanted": Rr.slant.isSlanted ? "true" : void 0,
1166
1166
  ref: aa,
1167
- style: Sr.lowStyle,
1168
- children: _e(w, ut, N, M)
1167
+ style: Rr.lowStyle,
1168
+ children: Ve(b, mt, P, y)
1169
1169
  }
1170
1170
  )
1171
1171
  ]
1172
1172
  }
1173
1173
  ),
1174
- /* @__PURE__ */ ce(
1174
+ /* @__PURE__ */ fe(
1175
1175
  "div",
1176
1176
  {
1177
- tabIndex: o ? -1 : 0,
1177
+ tabIndex: i ? -1 : 0,
1178
1178
  role: "slider",
1179
1179
  "aria-label": e.upperAriaLabel ?? "Micro range end",
1180
- "aria-disabled": o ? "true" : void 0,
1181
- "aria-valuemin": ve,
1182
- "aria-valuemax": Ke,
1183
- "aria-valuenow": Me,
1184
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(dt, w) : Bt(w, dt, N, M),
1180
+ "aria-disabled": i ? "true" : void 0,
1181
+ "aria-valuemin": xe,
1182
+ "aria-valuemax": qe,
1183
+ "aria-valuenow": ye,
1184
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(ft, b) : _t(b, ft, P, y),
1185
1185
  "aria-orientation": u ? "vertical" : "horizontal",
1186
- className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? x ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : x ? "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4" : "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${mt}`,
1186
+ className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? M ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : M ? "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4" : "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ht}`,
1187
1187
  style: u ? {
1188
- bottom: `${ot * 100}%`,
1189
- left: x ? "auto" : 0,
1190
- right: x ? 0 : "auto",
1191
- transform: x ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1192
- zIndex: Ee === "micro-high" || Re === "micro-high" ? 30 : 20
1188
+ bottom: `${lt * 100}%`,
1189
+ left: M ? "auto" : 0,
1190
+ right: M ? 0 : "auto",
1191
+ transform: M ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1192
+ zIndex: Ee === "micro-high" || $e === "micro-high" ? 30 : 20
1193
1193
  } : {
1194
- left: `${ot * 100}%`,
1195
- top: x ? "auto" : 0,
1196
- bottom: x ? 0 : "auto",
1197
- transform: x ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1198
- zIndex: Ee === "micro-high" || Re === "micro-high" ? 30 : 20
1194
+ left: `${lt * 100}%`,
1195
+ top: M ? "auto" : 0,
1196
+ bottom: M ? 0 : "auto",
1197
+ transform: M ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1198
+ zIndex: Ee === "micro-high" || $e === "micro-high" ? 30 : 20
1199
1199
  },
1200
- onPointerDown: It("micro-high"),
1201
- onKeyDown: Mr("micro-high"),
1200
+ onPointerDown: Ot("micro-high"),
1201
+ onKeyDown: Dr("micro-high"),
1202
1202
  onFocus: pr("micro-high"),
1203
1203
  "data-active": Ee === "micro-high" ? "true" : void 0,
1204
- "data-front": Re === "micro-high" ? "true" : void 0,
1205
- "data-vernier-pos": u ? x ? "right" : "left" : x ? "bottom" : "top",
1204
+ "data-front": $e === "micro-high" ? "true" : void 0,
1205
+ "data-vernier-pos": u ? M ? "right" : "left" : M ? "bottom" : "top",
1206
1206
  "data-handle-type": "micro-high",
1207
1207
  children: [
1208
- /* @__PURE__ */ p(ar, { type: "micro", isTop: !x, isVertical: u, isLeft: !x }),
1209
- Rt && /* @__PURE__ */ p("div", { className: "period-slider-hairline" }),
1210
- m !== "hover" && /* @__PURE__ */ p(
1208
+ /* @__PURE__ */ v(ir, { type: "micro", isTop: !M, isVertical: u, isLeft: !M }),
1209
+ Pt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1210
+ m !== "hover" && /* @__PURE__ */ v(
1211
1211
  "div",
1212
1212
  {
1213
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1213
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1214
1214
  "data-tooltip-style": m,
1215
1215
  "data-duplicate": ha ? "true" : void 0,
1216
- "data-slanted": Sr.slant.isSlanted ? "true" : void 0,
1216
+ "data-slanted": Rr.slant.isSlanted ? "true" : void 0,
1217
1217
  ref: oa,
1218
- style: Sr.highStyle,
1219
- children: _e(w, dt, N, M)
1218
+ style: Rr.highStyle,
1219
+ children: Ve(b, ft, P, y)
1220
1220
  }
1221
1221
  )
1222
1222
  ]
1223
1223
  }
1224
1224
  )
1225
- ] }) : /* @__PURE__ */ ce(Wr, { children: [
1226
- !v && /* @__PURE__ */ p("div", { "data-testid": "period-slider-connect", className: "period-slider-connect absolute rounded-full", style: wa, onPointerDown: ia }),
1227
- U && R && g.length > 1 && /* @__PURE__ */ p("div", { className: "period-slider-ticks pointer-events-none absolute inset-0", children: g.map((i, s) => {
1228
- const d = W(t, i), b = gr(s), T = u ? { bottom: `${b}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${b}%`, top: "50%", transform: "translate(-50%, -50%)" };
1229
- return /* @__PURE__ */ p("div", { "data-testid": "period-slider-tick", className: "period-slider-tick absolute h-1.5 w-1.5 rounded-full bg-slate-400/60 dark:bg-slate-500/60", style: T }, `tick-${d}`);
1225
+ ] }) : /* @__PURE__ */ fe(Wr, { children: [
1226
+ !L && /* @__PURE__ */ v("div", { "data-testid": "period-slider-connect", className: "period-slider-connect absolute rounded-full", style: wa, onPointerDown: ia }),
1227
+ H && N && w.length > 1 && /* @__PURE__ */ v("div", { className: "period-slider-ticks pointer-events-none absolute inset-0", children: w.map((o, s) => {
1228
+ const d = J(t, o), g = br(s), R = u ? { bottom: `${g}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${g}%`, top: "50%", transform: "translate(-50%, -50%)" };
1229
+ return /* @__PURE__ */ v("div", { "data-testid": "period-slider-tick", className: "period-slider-tick absolute h-1.5 w-1.5 rounded-full bg-slate-400/60 dark:bg-slate-500/60", style: R }, `tick-${d}`);
1230
1230
  }) }),
1231
- !o && Se !== null && Kt !== null && S === null && Nn && /* @__PURE__ */ ce("div", { "data-testid": "period-slider-hover-guide", className: "period-slider-hover-guide pointer-events-none absolute z-20 h-2 w-2", style: xa, children: [
1232
- /* @__PURE__ */ p("div", { "data-testid": "period-slider-hover-dot", className: "period-slider-hover-dot h-full w-full rounded-full border border-white/80 bg-[var(--aqps-accent-light)] shadow-[0_0_6px_var(--aqps-accent-glow)] dark:border-slate-800" }),
1233
- /* @__PURE__ */ p(
1231
+ !i && De !== null && xt !== null && de === null && Yn && /* @__PURE__ */ fe("div", { "data-testid": "period-slider-hover-guide", className: "period-slider-hover-guide pointer-events-none absolute h-2 w-2", style: Da, children: [
1232
+ /* @__PURE__ */ v("div", { "data-testid": "period-slider-hover-dot", className: "period-slider-hover-dot h-full w-full rounded-full border border-white/80 bg-[var(--aqps-accent-light)] shadow-[0_0_6px_var(--aqps-accent-glow)] dark:border-slate-800" }),
1233
+ /* @__PURE__ */ v(
1234
1234
  "div",
1235
1235
  {
1236
- className: `period-slider-hover-tooltip ${k === "bottom" && !u ? "period-slider-hover-tooltip-bottom" : ""} rounded bg-slate-800/90 px-2 py-0.5 font-medium text-white text-xs shadow-lg backdrop-blur-xs dark:bg-slate-900/90`,
1237
- children: _e(t, Nn, e.formatLabel, M)
1236
+ "data-testid": "period-slider-hover-tooltip",
1237
+ "data-duplicate": xa ? "true" : void 0,
1238
+ className: `period-slider-hover-tooltip ${D === "bottom" && !u ? "period-slider-hover-tooltip-bottom" : ""} rounded bg-slate-800/90 px-2 py-0.5 font-medium text-white text-xs shadow-lg backdrop-blur-xs dark:bg-slate-900/90`,
1239
+ children: Ve(t, Yn, e.formatLabel, y)
1238
1240
  }
1239
1241
  )
1240
1242
  ] }),
1241
- /* @__PURE__ */ ce(
1243
+ /* @__PURE__ */ fe(
1242
1244
  "div",
1243
1245
  {
1244
- tabIndex: o ? -1 : 0,
1246
+ tabIndex: i ? -1 : 0,
1245
1247
  role: "slider",
1246
- "aria-label": P ? e.pointAriaLabel ?? "Selected date" : e.lowerAriaLabel ?? "Range start",
1247
- "aria-disabled": o ? "true" : void 0,
1248
- "aria-valuemin": Y,
1249
- "aria-valuemax": P ? F : fe,
1250
- "aria-valuenow": me,
1251
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Kr, t) : Bt(t, Kr, e.formatLabel, M),
1248
+ "aria-label": S ? e.pointAriaLabel ?? "Selected date" : e.lowerAriaLabel ?? "Range start",
1249
+ "aria-disabled": i ? "true" : void 0,
1250
+ "aria-valuemin": p,
1251
+ "aria-valuemax": S ? k : se,
1252
+ "aria-valuenow": U,
1253
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Kr, t) : _t(t, Kr, e.formatLabel, y),
1252
1254
  "aria-orientation": u ? "vertical" : "horizontal",
1253
- className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${mt}`,
1254
- style: va,
1255
- onPointerDown: Dn("low"),
1255
+ className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${ht}`,
1256
+ style: pa,
1257
+ onPointerDown: xn("low"),
1256
1258
  onKeyDown: Tn("low"),
1257
1259
  onFocus: yn("low"),
1258
- "data-active": S === "low" ? "true" : void 0,
1259
- "data-front": Zt ? "true" : void 0,
1260
+ "data-active": de === "low" ? "true" : void 0,
1261
+ "data-front": Qt ? "true" : void 0,
1260
1262
  children: [
1261
- /* @__PURE__ */ p(
1263
+ /* @__PURE__ */ v(
1262
1264
  "div",
1263
1265
  {
1264
1266
  "data-testid": "period-slider-knob",
1265
- className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${S === "low" ? "" : "shadow-md"}`
1267
+ className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${de === "low" ? "" : "shadow-md"}`
1266
1268
  }
1267
1269
  ),
1268
- m !== "hover" && /* @__PURE__ */ p(
1270
+ m !== "hover" && /* @__PURE__ */ v(
1269
1271
  "div",
1270
1272
  {
1271
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1273
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1272
1274
  "data-tooltip-style": m,
1273
- "data-label-position": k,
1275
+ "data-label-position": D,
1274
1276
  "data-slanted": Oe.isSlanted ? "true" : void 0,
1275
- "data-front": Zt ? "true" : void 0,
1276
- "data-duplicate": xr && !Zt ? "true" : void 0,
1277
+ "data-front": Qt ? "true" : void 0,
1278
+ "data-duplicate": xr && !Qt ? "true" : void 0,
1277
1279
  ref: ea,
1278
1280
  style: ga,
1279
- children: _e(t, Kr, e.formatLabel, M)
1281
+ children: Ve(t, Kr, e.formatLabel, y)
1280
1282
  }
1281
1283
  )
1282
1284
  ]
1283
1285
  }
1284
1286
  ),
1285
- !P && /* @__PURE__ */ ce(
1287
+ !S && /* @__PURE__ */ fe(
1286
1288
  "div",
1287
1289
  {
1288
- tabIndex: o ? -1 : 0,
1290
+ tabIndex: i ? -1 : 0,
1289
1291
  role: "slider",
1290
1292
  "aria-label": e.upperAriaLabel ?? "Range end",
1291
- "aria-disabled": o ? "true" : void 0,
1292
- "aria-valuemin": me,
1293
- "aria-valuemax": F,
1294
- "aria-valuenow": fe,
1295
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(qr, t) : Bt(t, qr, e.formatLabel, M),
1293
+ "aria-disabled": i ? "true" : void 0,
1294
+ "aria-valuemin": U,
1295
+ "aria-valuemax": k,
1296
+ "aria-valuenow": se,
1297
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(qr, t) : _t(t, qr, e.formatLabel, y),
1296
1298
  "aria-orientation": u ? "vertical" : "horizontal",
1297
- className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${mt}`,
1299
+ className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${ht}`,
1298
1300
  style: Ma,
1299
- onPointerDown: Dn("high"),
1301
+ onPointerDown: xn("high"),
1300
1302
  onKeyDown: Tn("high"),
1301
1303
  onFocus: yn("high"),
1302
- "data-active": S === "high" ? "true" : void 0,
1303
- "data-front": Qt ? "true" : void 0,
1304
+ "data-active": de === "high" ? "true" : void 0,
1305
+ "data-front": er ? "true" : void 0,
1304
1306
  children: [
1305
- /* @__PURE__ */ p(
1307
+ /* @__PURE__ */ v(
1306
1308
  "div",
1307
1309
  {
1308
1310
  "data-testid": "period-slider-knob",
1309
- className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${S === "high" ? "" : "shadow-md"}`
1311
+ className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${de === "high" ? "" : "shadow-md"}`
1310
1312
  }
1311
1313
  ),
1312
- m !== "hover" && /* @__PURE__ */ p(
1314
+ m !== "hover" && /* @__PURE__ */ v(
1313
1315
  "div",
1314
1316
  {
1315
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1317
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1316
1318
  "data-tooltip-style": m,
1317
- "data-label-position": k,
1319
+ "data-label-position": D,
1318
1320
  "data-slanted": Oe.isSlanted ? "true" : void 0,
1319
- "data-front": Qt ? "true" : void 0,
1320
- "data-duplicate": xr && !Qt ? "true" : void 0,
1321
+ "data-front": er ? "true" : void 0,
1322
+ "data-duplicate": xr && !er ? "true" : void 0,
1321
1323
  ref: ta,
1322
1324
  style: ba,
1323
- children: _e(t, qr, e.formatLabel, M)
1325
+ children: Ve(t, qr, e.formatLabel, y)
1324
1326
  }
1325
1327
  )
1326
1328
  ]
@@ -1329,7 +1331,7 @@ const Ua = (e, t) => {
1329
1331
  ] })
1330
1332
  }
1331
1333
  ),
1332
- h && Yn(u ? "decrease" : "increase")
1334
+ h && kn(u ? "decrease" : "increase")
1333
1335
  ]
1334
1336
  }
1335
1337
  );
@@ -1339,7 +1341,7 @@ const Ua = (e, t) => {
1339
1341
  for (let r = 0; r < e.length; r++)
1340
1342
  if (e[r].getTime() !== t[r].getTime()) return !1;
1341
1343
  return !0;
1342
- }, Wa = (e, t) => {
1344
+ }, Ga = (e, t) => {
1343
1345
  if (e === t) return !0;
1344
1346
  if (!(e && t)) return !1;
1345
1347
  const r = Object.keys(e), n = Object.keys(t);
@@ -1347,262 +1349,262 @@ const Ua = (e, t) => {
1347
1349
  for (const a of r)
1348
1350
  if (e[a] !== t[a]) return !1;
1349
1351
  return !0;
1350
- }, Ga = (e, t) => e === t ? !0 : e.mode !== t.mode || e.unit !== t.unit || e.minDate.getTime() !== t.minDate.getTime() || e.maxDate.getTime() !== t.maxDate.getTime() || e.labelPosition !== t.labelPosition || e.autoSlantLabels !== t.autoSlantLabels || e.isVertical !== t.isVertical || e.hideConnectBar !== t.hideConnectBar || e.showTicks !== t.showTicks || e.disabled !== t.disabled || e.showStepper !== t.showStepper || e.debounceMs !== t.debounceMs || e.tooltipStyle !== t.tooltipStyle || e.colorScheme !== t.colorScheme || e.className !== t.className || !Wa(e.style, t.style) || e.snapMode !== t.snapMode || e.formatLabel !== t.formatLabel || e.locale !== t.locale || e.lowerAriaLabel !== t.lowerAriaLabel || e.upperAriaLabel !== t.upperAriaLabel || e.pointAriaLabel !== t.pointAriaLabel || e.macroLowerAriaLabel !== t.macroLowerAriaLabel || e.macroUpperAriaLabel !== t.macroUpperAriaLabel || e.decreaseAriaLabel !== t.decreaseAriaLabel || e.increaseAriaLabel !== t.increaseAriaLabel || e.formatAriaValueText !== t.formatAriaValueText || !Qr(e.allowedDates, t.allowedDates) ? !1 : e.mode === "point" && t.mode === "point" ? !((e.value?.getTime() ?? null) !== (t.value?.getTime() ?? null) || (e.defaultValue?.getTime() ?? null) !== (t.defaultValue?.getTime() ?? null) || e.onChangePoint !== t.onChangePoint) : e.mode === "range" && t.mode === "range" ? !((e.range?.[0]?.getTime() ?? null) !== (t.range?.[0]?.getTime() ?? null) || (e.range?.[1]?.getTime() ?? null) !== (t.range?.[1]?.getTime() ?? null) || (e.defaultRange?.[0]?.getTime() ?? null) !== (t.defaultRange?.[0]?.getTime() ?? null) || (e.defaultRange?.[1]?.getTime() ?? null) !== (t.defaultRange?.[1]?.getTime() ?? null) || e.onChangeRange !== t.onChangeRange) : e.mode === "vernier" && t.mode === "vernier" ? !((e.microRange?.[0]?.getTime() ?? null) !== (t.microRange?.[0]?.getTime() ?? null) || (e.microRange?.[1]?.getTime() ?? null) !== (t.microRange?.[1]?.getTime() ?? null) || (e.defaultMicroRange?.[0]?.getTime() ?? null) !== (t.defaultMicroRange?.[0]?.getTime() ?? null) || (e.defaultMicroRange?.[1]?.getTime() ?? null) !== (t.defaultMicroRange?.[1]?.getTime() ?? null) || e.macroRange[0].getTime() !== t.macroRange[0].getTime() || e.macroRange[1].getTime() !== t.macroRange[1].getTime() || e.vernierOrientation !== t.vernierOrientation || e.showVernierProjection !== t.showVernierProjection || e.showVernierTicks !== t.showVernierTicks || e.showHairline !== t.showHairline || e.macroUnit !== t.macroUnit || e.microUnit !== t.microUnit || e.macroIsDiscrete !== t.macroIsDiscrete || e.microIsDiscrete !== t.microIsDiscrete || e.formatMacroLabel !== t.formatMacroLabel || e.formatMicroLabel !== t.formatMicroLabel || e.onChangeMicroRange !== t.onChangeMicroRange || e.onChangeMacroRange !== t.onChangeMacroRange || !Qr(e.macroAllowedDates, t.macroAllowedDates) || !Qr(e.microAllowedDates, t.microAllowedDates)) : !1, Ja = sr(ja, Ga);
1351
- Ja.displayName = "PeriodSlider";
1352
- const tt = (e) => {
1352
+ }, Ja = (e, t) => e === t ? !0 : e.mode !== t.mode || e.unit !== t.unit || e.minDate.getTime() !== t.minDate.getTime() || e.maxDate.getTime() !== t.maxDate.getTime() || e.labelPosition !== t.labelPosition || e.autoSlantLabels !== t.autoSlantLabels || e.isVertical !== t.isVertical || e.hideConnectBar !== t.hideConnectBar || e.showTicks !== t.showTicks || e.disabled !== t.disabled || e.showStepper !== t.showStepper || e.debounceMs !== t.debounceMs || e.tooltipStyle !== t.tooltipStyle || e.colorScheme !== t.colorScheme || e.className !== t.className || !Ga(e.style, t.style) || e.snapMode !== t.snapMode || e.formatLabel !== t.formatLabel || e.locale !== t.locale || e.lowerAriaLabel !== t.lowerAriaLabel || e.upperAriaLabel !== t.upperAriaLabel || e.pointAriaLabel !== t.pointAriaLabel || e.macroLowerAriaLabel !== t.macroLowerAriaLabel || e.macroUpperAriaLabel !== t.macroUpperAriaLabel || e.decreaseAriaLabel !== t.decreaseAriaLabel || e.increaseAriaLabel !== t.increaseAriaLabel || e.formatAriaValueText !== t.formatAriaValueText || !Qr(e.allowedDates, t.allowedDates) ? !1 : e.mode === "point" && t.mode === "point" ? !((e.value?.getTime() ?? null) !== (t.value?.getTime() ?? null) || (e.defaultValue?.getTime() ?? null) !== (t.defaultValue?.getTime() ?? null) || e.onChangePoint !== t.onChangePoint) : e.mode === "range" && t.mode === "range" ? !((e.range?.[0]?.getTime() ?? null) !== (t.range?.[0]?.getTime() ?? null) || (e.range?.[1]?.getTime() ?? null) !== (t.range?.[1]?.getTime() ?? null) || (e.defaultRange?.[0]?.getTime() ?? null) !== (t.defaultRange?.[0]?.getTime() ?? null) || (e.defaultRange?.[1]?.getTime() ?? null) !== (t.defaultRange?.[1]?.getTime() ?? null) || e.onChangeRange !== t.onChangeRange) : e.mode === "vernier" && t.mode === "vernier" ? !((e.microRange?.[0]?.getTime() ?? null) !== (t.microRange?.[0]?.getTime() ?? null) || (e.microRange?.[1]?.getTime() ?? null) !== (t.microRange?.[1]?.getTime() ?? null) || (e.defaultMicroRange?.[0]?.getTime() ?? null) !== (t.defaultMicroRange?.[0]?.getTime() ?? null) || (e.defaultMicroRange?.[1]?.getTime() ?? null) !== (t.defaultMicroRange?.[1]?.getTime() ?? null) || e.macroRange[0].getTime() !== t.macroRange[0].getTime() || e.macroRange[1].getTime() !== t.macroRange[1].getTime() || e.vernierOrientation !== t.vernierOrientation || e.showVernierProjection !== t.showVernierProjection || e.showVernierTicks !== t.showVernierTicks || e.showHairline !== t.showHairline || e.macroUnit !== t.macroUnit || e.microUnit !== t.microUnit || e.macroIsDiscrete !== t.macroIsDiscrete || e.microIsDiscrete !== t.microIsDiscrete || e.formatMacroLabel !== t.formatMacroLabel || e.formatMicroLabel !== t.formatMicroLabel || e.onChangeMicroRange !== t.onChangeMicroRange || e.onChangeMacroRange !== t.onChangeMacroRange || !Qr(e.macroAllowedDates, t.macroAllowedDates) || !Qr(e.microAllowedDates, t.microAllowedDates)) : !1, Za = ur(Wa, Ja);
1353
+ Za.displayName = "PeriodSlider";
1354
+ const at = (e) => {
1353
1355
  const t = new Date(e);
1354
1356
  return t.setHours(0, 0, 0, 0), t;
1355
- }, or = (e, t) => {
1357
+ }, lr = (e, t) => {
1356
1358
  if (Number.isNaN(t.getTime()))
1357
1359
  throw new RangeError(`DateSelector: "${e}" must be a valid Date (received ${String(t)})`);
1358
- }, Za = (e) => {
1360
+ }, Qa = (e) => {
1359
1361
  if (e !== void 0)
1360
1362
  try {
1361
1363
  Intl.DateTimeFormat.supportedLocalesOf([e]);
1362
1364
  } catch {
1363
1365
  throw new RangeError(`DateSelector: "locale" must be a valid BCP 47 language tag (received ${JSON.stringify(e)})`);
1364
1366
  }
1365
- }, Tt = (e, t, r) => {
1367
+ }, St = (e, t, r) => {
1366
1368
  const n = new Date(e, t - 1, r);
1367
1369
  return n.setFullYear(e), n.setHours(0, 0, 0, 0), n;
1368
- }, Un = (e) => Tt(e, 1, 1), Qa = (e) => Tt(e, 12, 31), eo = {
1370
+ }, Un = (e) => St(e, 1, 1), eo = (e) => St(e, 12, 31), to = {
1369
1371
  year: { year: "numeric" },
1370
1372
  month: { month: "2-digit" },
1371
1373
  day: { day: "2-digit" }
1372
- }, to = {
1374
+ }, ro = {
1373
1375
  year: 4,
1374
1376
  month: 2,
1375
1377
  day: 2
1376
- }, ro = {
1378
+ }, no = {
1377
1379
  year: (e) => e.getFullYear(),
1378
1380
  month: (e) => e.getMonth() + 1,
1379
1381
  day: (e) => e.getDate()
1380
- }, Bn = /* @__PURE__ */ new Map(), no = (e, t) => {
1382
+ }, Bn = /* @__PURE__ */ new Map(), ao = (e, t) => {
1381
1383
  const r = `${e}\0${t}`, n = Bn.get(r);
1382
1384
  if (n !== void 0) return n;
1383
- const a = new Intl.DateTimeFormat(t, eo[e]);
1385
+ const a = new Intl.DateTimeFormat(t, to[e]);
1384
1386
  return Bn.set(r, a), a;
1385
- }, en = (e, t, r) => r === void 0 ? String(ro[e](t)).padStart(to[e], "0") : no(e, r).format(t), ao = (e, t, r) => {
1387
+ }, en = (e, t, r) => r === void 0 ? String(no[e](t)).padStart(ro[e], "0") : ao(e, r).format(t), oo = (e, t, r) => {
1386
1388
  const n = t?.getTime() ?? null, a = r?.getTime() ?? null, l = /* @__PURE__ */ new Map();
1387
- return e.forEach((o, c) => {
1388
- or(`allowedDates[${c}]`, o);
1389
- const h = tt(o), m = h.getTime();
1389
+ return e.forEach((i, c) => {
1390
+ lr(`allowedDates[${c}]`, i);
1391
+ const h = at(i), m = h.getTime();
1390
1392
  n !== null && m < n || a !== null && m > a || l.has(m) || l.set(m, h);
1391
- }), Array.from(l.keys()).sort((o, c) => o - c).map((o) => l.get(o));
1392
- }, oo = (e, t) => {
1393
+ }), Array.from(l.keys()).sort((i, c) => i - c).map((i) => l.get(i));
1394
+ }, io = (e, t) => {
1393
1395
  const r = [];
1394
- let n = tt(e);
1395
- const a = tt(t).getTime();
1396
+ let n = at(e);
1397
+ const a = at(t).getTime();
1396
1398
  for (; n.getTime() <= a; )
1397
1399
  r.push(n), n = Cr(n, 1);
1398
1400
  return r;
1399
1401
  }, zn = (e, t) => {
1400
1402
  const r = [];
1401
1403
  for (let n = e.length - 1; n >= 0; n--)
1402
- r.push({ label: _e("day", e[n], void 0, t), value: Xt(e[n], "yyyy-MM-dd") });
1404
+ r.push({ label: Ve("day", e[n], void 0, t), value: qt(e[n], "yyyy-MM-dd") });
1403
1405
  return r;
1404
- }, io = (e) => {
1406
+ }, lo = (e) => {
1405
1407
  const {
1406
1408
  value: t,
1407
1409
  initialDate: r,
1408
1410
  onChange: n,
1409
1411
  children: a,
1410
1412
  minYear: l,
1411
- maxYear: o,
1413
+ maxYear: i,
1412
1414
  minDate: c,
1413
1415
  maxDate: h,
1414
1416
  allowedDates: m,
1415
- variant: k = "date",
1416
- className: D = "",
1417
+ variant: D = "date",
1418
+ className: x = "",
1417
1419
  style: u,
1418
- disabled: v = !1,
1419
- prevDateAriaLabel: U = "Previous day",
1420
- nextDateAriaLabel: re = "Next day",
1421
- selectAriaLabel: M = "Date",
1422
- yearAriaLabel: Q = "Year",
1423
- monthAriaLabel: I = "Month",
1424
- dayAriaLabel: ne = "Day",
1420
+ disabled: L = !1,
1421
+ prevDateAriaLabel: H = "Previous day",
1422
+ nextDateAriaLabel: ne = "Next day",
1423
+ selectAriaLabel: y = "Date",
1424
+ yearAriaLabel: ae = "Year",
1425
+ monthAriaLabel: O = "Month",
1426
+ dayAriaLabel: Q = "Day",
1425
1427
  locale: A,
1426
- formatYearOption: B,
1427
- formatMonthOption: L,
1428
- formatDayOption: K
1428
+ formatYearOption: z,
1429
+ formatMonthOption: Y,
1430
+ formatDayOption: V
1429
1431
  } = e;
1430
- if (Za(A), t !== void 0 && or("value", t), r !== void 0 && or("initialDate", r), c !== void 0 && or("minDate", c), h !== void 0 && or("maxDate", h), l !== void 0 && !Number.isInteger(l))
1432
+ if (Qa(A), t !== void 0 && lr("value", t), r !== void 0 && lr("initialDate", r), c !== void 0 && lr("minDate", c), h !== void 0 && lr("maxDate", h), l !== void 0 && !Number.isInteger(l))
1431
1433
  throw new RangeError(`DateSelector: "minYear" must be an integer year (received ${String(l)})`);
1432
- if (o !== void 0 && !Number.isInteger(o))
1433
- throw new RangeError(`DateSelector: "maxYear" must be an integer year (received ${String(o)})`);
1434
- if (k === "split-dropdown" && m !== void 0)
1434
+ if (i !== void 0 && !Number.isInteger(i))
1435
+ throw new RangeError(`DateSelector: "maxYear" must be an integer year (received ${String(i)})`);
1436
+ if (D === "split-dropdown" && m !== void 0)
1435
1437
  throw new RangeError('DateSelector: variant="split-dropdown" cannot honour "allowedDates"; use variant="dropdown" or variant="date" for a discrete date set');
1436
- const H = t ?? r;
1437
- if (H === void 0)
1438
+ const F = t ?? r;
1439
+ if (F === void 0)
1438
1440
  throw new RangeError("DateSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected date is never inferred from the wall clock.");
1439
- const [g, R] = xe(() => tt(H)), Y = t !== void 0, F = t?.getTime(), P = $(() => t !== void 0 ? tt(t) : g, [F, g]), ae = c?.getTime(), Le = h?.getTime(), ee = $(() => {
1440
- const f = c ? tt(c) : null, N = l !== void 0 ? Un(l) : null;
1441
- return f === null ? N : N === null || f.getTime() >= N.getTime() ? f : N;
1442
- }, [ae, l]), oe = $(() => {
1443
- const f = h ? tt(h) : null, N = o !== void 0 ? Qa(o) : null;
1444
- return f === null ? N : N === null || f.getTime() <= N.getTime() ? f : N;
1445
- }, [Le, o]), se = ee?.getTime() ?? null, ge = oe?.getTime() ?? null;
1446
- if (ee !== null && oe !== null && ee.getTime() > oe.getTime())
1447
- throw new RangeError(`DateSelector: the resolved range is empty (min ${Xt(ee, "yyyy-MM-dd")} is after max ${Xt(oe, "yyyy-MM-dd")})`);
1448
- if (k !== "date" && m === void 0 && (ee === null || oe === null))
1449
- throw new RangeError(`DateSelector: variant="${k}" needs a bounded range; supply minDate/minYear and maxDate/maxYear${k === "dropdown" ? ' or supply "allowedDates"' : ""}`);
1450
- const J = m === void 0 ? null : m.map((f) => f.getTime()).join(","), j = $(() => m === void 0 ? null : ao(m, ee, oe), [J, se, ge]), Ye = (f) => {
1451
- const N = f.getTime();
1452
- return j !== null ? j.some((Ae) => Ae.getTime() === N) : !(se !== null && N < se || ge !== null && N > ge);
1453
- }, vt = H.getTime();
1454
- Lt(() => {
1455
- Y || R(tt(H));
1456
- }, [Y, vt]);
1457
- const Fe = (f) => {
1458
- if (v) return;
1459
- const N = tt(f);
1460
- Ye(N) && (Y || R(N), n?.(N));
1461
- }, ke = P.getTime(), be = Ye(P), O = $(() => {
1462
- if (j !== null) {
1463
- for (let N = j.length - 1; N >= 0; N--)
1464
- if (j[N].getTime() < ke) return j[N];
1441
+ const [w, N] = Te(() => at(F)), p = t !== void 0, k = t?.getTime(), S = $(() => t !== void 0 ? at(t) : w, [k, w]), ue = c?.getTime(), oe = h?.getTime(), te = $(() => {
1442
+ const f = c ? at(c) : null, P = l !== void 0 ? Un(l) : null;
1443
+ return f === null ? P : P === null || f.getTime() >= P.getTime() ? f : P;
1444
+ }, [ue, l]), ie = $(() => {
1445
+ const f = h ? at(h) : null, P = i !== void 0 ? eo(i) : null;
1446
+ return f === null ? P : P === null || f.getTime() <= P.getTime() ? f : P;
1447
+ }, [oe, i]), le = te?.getTime() ?? null, he = ie?.getTime() ?? null;
1448
+ if (te !== null && ie !== null && te.getTime() > ie.getTime())
1449
+ throw new RangeError(`DateSelector: the resolved range is empty (min ${qt(te, "yyyy-MM-dd")} is after max ${qt(ie, "yyyy-MM-dd")})`);
1450
+ if (D !== "date" && m === void 0 && (te === null || ie === null))
1451
+ throw new RangeError(`DateSelector: variant="${D}" needs a bounded range; supply minDate/minYear and maxDate/maxYear${D === "dropdown" ? ' or supply "allowedDates"' : ""}`);
1452
+ const W = m === void 0 ? null : m.map((f) => f.getTime()).join(","), G = $(() => m === void 0 ? null : oo(m, te, ie), [W, le, he]), Re = (f) => {
1453
+ const P = f.getTime();
1454
+ return G !== null ? G.some((Ae) => Ae.getTime() === P) : !(le !== null && P < le || he !== null && P > he);
1455
+ }, Dt = F.getTime();
1456
+ Rt(() => {
1457
+ p || N(at(F));
1458
+ }, [p, Dt]);
1459
+ const Be = (f) => {
1460
+ if (L) return;
1461
+ const P = at(f);
1462
+ Re(P) && (p || N(P), n?.(P));
1463
+ }, Ye = S.getTime(), pe = Re(S), I = $(() => {
1464
+ if (G !== null) {
1465
+ for (let P = G.length - 1; P >= 0; P--)
1466
+ if (G[P].getTime() < Ye) return G[P];
1465
1467
  return null;
1466
1468
  }
1467
- const f = Cr(new Date(ke), -1);
1468
- return Ye(f) ? f : null;
1469
- }, [j, ke, se, ge]), z = $(() => {
1470
- if (j !== null) {
1471
- for (const N of j)
1472
- if (N.getTime() > ke) return N;
1469
+ const f = Cr(new Date(Ye), -1);
1470
+ return Re(f) ? f : null;
1471
+ }, [G, Ye, le, he]), _ = $(() => {
1472
+ if (G !== null) {
1473
+ for (const P of G)
1474
+ if (P.getTime() > Ye) return P;
1473
1475
  return null;
1474
1476
  }
1475
- const f = Cr(new Date(ke), 1);
1476
- return Ye(f) ? f : null;
1477
- }, [j, ke, se, ge]), Z = v || O === null, we = v || z === null, S = () => {
1478
- O !== null && Fe(O);
1479
- }, De = () => {
1480
- z !== null && Fe(z);
1481
- }, Be = (f) => {
1477
+ const f = Cr(new Date(Ye), 1);
1478
+ return Re(f) ? f : null;
1479
+ }, [G, Ye, le, he]), re = L || I === null, we = L || _ === null, de = () => {
1480
+ I !== null && Be(I);
1481
+ }, Je = () => {
1482
+ _ !== null && Be(_);
1483
+ }, Ze = (f) => {
1482
1484
  if (f.target.value) {
1483
- const N = In(f.target.value);
1484
- Number.isNaN(N.getTime()) || Fe(N);
1485
+ const P = In(f.target.value);
1486
+ Number.isNaN(P.getTime()) || Be(P);
1485
1487
  }
1486
- }, rt = (f) => {
1488
+ }, $t = (f) => {
1487
1489
  if (f.target.value) {
1488
- const N = In(f.target.value);
1489
- Number.isNaN(N.getTime()) || Fe(N);
1490
+ const P = In(f.target.value);
1491
+ Number.isNaN(P.getTime()) || Be(P);
1490
1492
  }
1491
- }, ue = P.getFullYear(), Se = P.getMonth() + 1, nt = P.getDate(), Kt = $(() => k !== "dropdown" ? [] : j !== null ? zn(j, A) : ee === null || oe === null ? [] : zn(oo(ee, oe), A), [k, j, se, ge, A]), cr = $(() => {
1492
- if (k !== "split-dropdown" || ee === null || oe === null) return [];
1493
+ }, ge = S.getFullYear(), De = S.getMonth() + 1, Ke = S.getDate(), xt = $(() => D !== "dropdown" ? [] : G !== null ? zn(G, A) : te === null || ie === null ? [] : zn(io(te, ie), A), [D, G, le, he, A]), X = $(() => {
1494
+ if (D !== "split-dropdown" || te === null || ie === null) return [];
1493
1495
  const f = [];
1494
- for (let N = oe.getFullYear(); N >= ee.getFullYear(); N--)
1495
- f.push(N);
1496
+ for (let P = ie.getFullYear(); P >= te.getFullYear(); P--)
1497
+ f.push(P);
1496
1498
  return f;
1497
- }, [k, se, ge]), me = $(() => {
1498
- if (k !== "split-dropdown" || ee === null || oe === null) return [];
1499
- const f = ee, N = oe, Ae = ue === f.getFullYear() ? f.getMonth() + 1 : 1, Pt = ue === N.getFullYear() ? N.getMonth() + 1 : 12, xt = [];
1500
- for (let at = Ae; at <= Pt; at++)
1501
- xt.push(at);
1502
- return xt;
1503
- }, [k, se, ge, ue]), fe = $(() => {
1504
- if (k !== "split-dropdown" || ee === null || oe === null) return [];
1505
- const f = ee, N = oe, Ae = ue === f.getFullYear() && Se === f.getMonth() + 1 ? f.getDate() : 1, Pt = ue === N.getFullYear() && Se === N.getMonth() + 1 ? N.getDate() : Cn(new Date(ke)), xt = [];
1506
- for (let at = Ae; at <= Pt; at++)
1507
- xt.push(at);
1508
- return xt;
1509
- }, [k, se, ge, ke, ue, Se]), St = (f, N, Ae) => Ae > Cn(Tt(f, N, 1)) ? !1 : Ye(Tt(f, N, Ae)), te = (f, N, Ae) => {
1510
- St(f, N, Ae) && Fe(Tt(f, N, Ae));
1511
- }, Mt = (f) => B ? B(f) : en("year", Un(f), A), x = (f) => L ? L(f) : en("month", Tt(ue, f, 1), A), ur = (f) => K ? K(f) : en("day", Tt(ue, Se, f), A), dr = Xt(P, "yyyy-MM-dd"), Rt = _e("day", P, void 0, A), E = ee ? Xt(ee, "yyyy-MM-dd") : void 0, w = oe ? Xt(oe, "yyyy-MM-dd") : void 0, Ir = be ? dr : "", $t = "text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400";
1512
- return /* @__PURE__ */ ce("div", { className: `inline-flex items-center ${k === "split-dropdown" ? "w-auto" : "w-38"} ${D}`, style: u, "data-variant": k, "data-out-of-range": be ? void 0 : "true", children: [
1513
- /* @__PURE__ */ p(
1499
+ }, [D, le, he]), U = $(() => {
1500
+ if (D !== "split-dropdown" || te === null || ie === null) return [];
1501
+ const f = te, P = ie, Ae = ge === f.getFullYear() ? f.getMonth() + 1 : 1, Yt = ge === P.getFullYear() ? P.getMonth() + 1 : 12, yt = [];
1502
+ for (let it = Ae; it <= Yt; it++)
1503
+ yt.push(it);
1504
+ return yt;
1505
+ }, [D, le, he, ge]), se = $(() => {
1506
+ if (D !== "split-dropdown" || te === null || ie === null) return [];
1507
+ const f = te, P = ie, Ae = ge === f.getFullYear() && De === f.getMonth() + 1 ? f.getDate() : 1, Yt = ge === P.getFullYear() && De === P.getMonth() + 1 ? P.getDate() : Cn(new Date(Ye)), yt = [];
1508
+ for (let it = Ae; it <= Yt; it++)
1509
+ yt.push(it);
1510
+ return yt;
1511
+ }, [D, le, he, Ye, ge, De]), ot = (f, P, Ae) => Ae > Cn(St(f, P, 1)) ? !1 : Re(St(f, P, Ae)), ee = (f, P, Ae) => {
1512
+ ot(f, P, Ae) && Be(St(f, P, Ae));
1513
+ }, Qe = (f) => z ? z(f) : en("year", Un(f), A), M = (f) => Y ? Y(f) : en("month", St(ge, f, 1), A), dr = (f) => V ? V(f) : en("day", St(ge, De, f), A), mr = qt(S, "yyyy-MM-dd"), Pt = Ve("day", S, void 0, A), E = te ? qt(te, "yyyy-MM-dd") : void 0, b = ie ? qt(ie, "yyyy-MM-dd") : void 0, Ir = pe ? mr : "", Nt = "text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400";
1514
+ return /* @__PURE__ */ fe("div", { className: `inline-flex items-center ${D === "split-dropdown" ? "w-auto" : "w-38"} ${x}`, style: u, "data-variant": D, "data-out-of-range": pe ? void 0 : "true", children: [
1515
+ /* @__PURE__ */ v(
1514
1516
  "button",
1515
1517
  {
1516
1518
  type: "button",
1517
- "aria-label": U,
1518
- disabled: Z,
1519
+ "aria-label": H,
1520
+ disabled: re,
1519
1521
  className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
1520
- onClick: S,
1521
- children: /* @__PURE__ */ p("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
1522
+ onClick: de,
1523
+ children: /* @__PURE__ */ v("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
1522
1524
  }
1523
1525
  ),
1524
- k === "dropdown" ? /* @__PURE__ */ ce("select", { "aria-label": M, disabled: v, className: "mx-1 my-auto w-28 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500", value: Ir, onChange: rt, children: [
1525
- be ? null : /* @__PURE__ */ p("option", { value: "", disabled: !0, className: $t, children: Rt }),
1526
- Kt.map((f) => /* @__PURE__ */ p("option", { value: f.value, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: f.label }, f.value))
1527
- ] }) : k === "split-dropdown" ? /* @__PURE__ */ ce("div", { className: "mx-1 my-auto inline-flex items-center gap-1", children: [
1528
- /* @__PURE__ */ ce(
1526
+ D === "dropdown" ? /* @__PURE__ */ fe("select", { "aria-label": y, disabled: L, className: "mx-1 my-auto w-28 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500", value: Ir, onChange: $t, children: [
1527
+ pe ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: Nt, children: Pt }),
1528
+ xt.map((f) => /* @__PURE__ */ v("option", { value: f.value, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: f.label }, f.value))
1529
+ ] }) : D === "split-dropdown" ? /* @__PURE__ */ fe("div", { className: "mx-1 my-auto inline-flex items-center gap-1", children: [
1530
+ /* @__PURE__ */ fe(
1529
1531
  "select",
1530
1532
  {
1531
- "aria-label": Q,
1532
- disabled: v,
1533
+ "aria-label": ae,
1534
+ disabled: L,
1533
1535
  className: "rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",
1534
- value: be ? ue : "",
1535
- onChange: (f) => te(Number(f.target.value), Se, nt),
1536
+ value: pe ? ge : "",
1537
+ onChange: (f) => ee(Number(f.target.value), De, Ke),
1536
1538
  children: [
1537
- be ? null : /* @__PURE__ */ p("option", { value: "", disabled: !0, className: $t, children: Mt(ue) }),
1538
- cr.map((f) => /* @__PURE__ */ p("option", { value: f, disabled: !St(f, Se, nt), className: "dark:bg-slate-700 dark:text-slate-100", children: Mt(f) }, f))
1539
+ pe ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: Nt, children: Qe(ge) }),
1540
+ X.map((f) => /* @__PURE__ */ v("option", { value: f, disabled: !ot(f, De, Ke), className: "dark:bg-slate-700 dark:text-slate-100", children: Qe(f) }, f))
1539
1541
  ]
1540
1542
  }
1541
1543
  ),
1542
- /* @__PURE__ */ ce(
1544
+ /* @__PURE__ */ fe(
1543
1545
  "select",
1544
1546
  {
1545
- "aria-label": I,
1546
- disabled: v,
1547
+ "aria-label": O,
1548
+ disabled: L,
1547
1549
  className: "rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",
1548
- value: be ? Se : "",
1549
- onChange: (f) => te(ue, Number(f.target.value), nt),
1550
+ value: pe ? De : "",
1551
+ onChange: (f) => ee(ge, Number(f.target.value), Ke),
1550
1552
  children: [
1551
- be ? null : /* @__PURE__ */ p("option", { value: "", disabled: !0, className: $t, children: x(Se) }),
1552
- me.map((f) => /* @__PURE__ */ p("option", { value: f, disabled: !St(ue, f, nt), className: "dark:bg-slate-700 dark:text-slate-100", children: x(f) }, f))
1553
+ pe ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: Nt, children: M(De) }),
1554
+ U.map((f) => /* @__PURE__ */ v("option", { value: f, disabled: !ot(ge, f, Ke), className: "dark:bg-slate-700 dark:text-slate-100", children: M(f) }, f))
1553
1555
  ]
1554
1556
  }
1555
1557
  ),
1556
- /* @__PURE__ */ ce(
1558
+ /* @__PURE__ */ fe(
1557
1559
  "select",
1558
1560
  {
1559
- "aria-label": ne,
1560
- disabled: v,
1561
+ "aria-label": Q,
1562
+ disabled: L,
1561
1563
  className: "rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",
1562
- value: be ? nt : "",
1563
- onChange: (f) => te(ue, Se, Number(f.target.value)),
1564
+ value: pe ? Ke : "",
1565
+ onChange: (f) => ee(ge, De, Number(f.target.value)),
1564
1566
  children: [
1565
- be ? null : /* @__PURE__ */ p("option", { value: "", disabled: !0, className: $t, children: ur(nt) }),
1566
- fe.map((f) => /* @__PURE__ */ p("option", { value: f, className: "dark:bg-slate-700 dark:text-slate-100", children: ur(f) }, f))
1567
+ pe ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: Nt, children: dr(Ke) }),
1568
+ se.map((f) => /* @__PURE__ */ v("option", { value: f, className: "dark:bg-slate-700 dark:text-slate-100", children: dr(f) }, f))
1567
1569
  ]
1568
1570
  }
1569
1571
  )
1570
- ] }) : /* @__PURE__ */ p(
1572
+ ] }) : /* @__PURE__ */ v(
1571
1573
  "input",
1572
1574
  {
1573
- "aria-label": M,
1574
- disabled: v,
1575
+ "aria-label": y,
1576
+ disabled: L,
1575
1577
  className: "mx-1 my-auto w-28 rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-gray-900 text-xs focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500 dark:placeholder:text-gray-400",
1576
- value: dr,
1578
+ value: mr,
1577
1579
  min: E,
1578
- max: w,
1579
- onChange: Be,
1580
+ max: b,
1581
+ onChange: Ze,
1580
1582
  type: "date"
1581
1583
  }
1582
1584
  ),
1583
- /* @__PURE__ */ p(
1585
+ /* @__PURE__ */ v(
1584
1586
  "button",
1585
1587
  {
1586
1588
  type: "button",
1587
- "aria-label": re,
1589
+ "aria-label": ne,
1588
1590
  disabled: we,
1589
1591
  className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
1590
- onClick: De,
1591
- children: /* @__PURE__ */ p("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200" })
1592
+ onClick: Je,
1593
+ children: /* @__PURE__ */ v("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200" })
1592
1594
  }
1593
1595
  ),
1594
1596
  a
1595
1597
  ] });
1596
- }, _t = (e) => e === void 0 ? null : tt(e).getTime(), lo = sr(io, (e, t) => !(_t(e.value ?? e.initialDate) !== _t(t.value ?? t.initialDate) || _t(e.minDate) !== _t(t.minDate) || _t(e.maxDate) !== _t(t.maxDate) || e.variant !== t.variant || e.disabled !== t.disabled || e.className !== t.className || e.style !== t.style || e.minYear !== t.minYear || e.maxYear !== t.maxYear || e.onChange !== t.onChange || e.allowedDates !== t.allowedDates || e.children !== t.children || e.prevDateAriaLabel !== t.prevDateAriaLabel || e.nextDateAriaLabel !== t.nextDateAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.yearAriaLabel !== t.yearAriaLabel || e.monthAriaLabel !== t.monthAriaLabel || e.dayAriaLabel !== t.dayAriaLabel || e.locale !== t.locale || e.formatYearOption !== t.formatYearOption || e.formatMonthOption !== t.formatMonthOption || e.formatDayOption !== t.formatDayOption));
1597
- lo.displayName = "DateSelector";
1598
- function Ge(e, t) {
1598
+ }, Kt = (e) => e === void 0 ? null : at(e).getTime(), so = ur(lo, (e, t) => !(Kt(e.value ?? e.initialDate) !== Kt(t.value ?? t.initialDate) || Kt(e.minDate) !== Kt(t.minDate) || Kt(e.maxDate) !== Kt(t.maxDate) || e.variant !== t.variant || e.disabled !== t.disabled || e.className !== t.className || e.style !== t.style || e.minYear !== t.minYear || e.maxYear !== t.maxYear || e.onChange !== t.onChange || e.allowedDates !== t.allowedDates || e.children !== t.children || e.prevDateAriaLabel !== t.prevDateAriaLabel || e.nextDateAriaLabel !== t.nextDateAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.yearAriaLabel !== t.yearAriaLabel || e.monthAriaLabel !== t.monthAriaLabel || e.dayAriaLabel !== t.dayAriaLabel || e.locale !== t.locale || e.formatYearOption !== t.formatYearOption || e.formatMonthOption !== t.formatMonthOption || e.formatDayOption !== t.formatDayOption));
1599
+ so.displayName = "DateSelector";
1600
+ function _e(e, t) {
1599
1601
  const r = e + Math.floor(t / 12), n = (t % 12 + 12) % 12, a = new Date(r, n, 1);
1600
1602
  return a.setFullYear(r), a;
1601
1603
  }
1602
- function yt(e) {
1604
+ function Lt(e) {
1603
1605
  return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`;
1604
1606
  }
1605
- function Nr(e, t) {
1607
+ function or(e, t) {
1606
1608
  if (e !== void 0 && (!(e instanceof Date) || Number.isNaN(e.getTime())))
1607
1609
  throw new RangeError(`MonthSelector: \`${t}\` must be a valid Date, received ${String(e)}.`);
1608
1610
  }
@@ -1610,7 +1612,7 @@ function _n(e, t) {
1610
1612
  if (e !== void 0 && !Number.isInteger(e))
1611
1613
  throw new RangeError(`MonthSelector: \`${t}\` must be an integer year, received ${String(e)}.`);
1612
1614
  }
1613
- function so(e) {
1615
+ function co(e) {
1614
1616
  if (e !== void 0)
1615
1617
  try {
1616
1618
  Intl.DateTimeFormat.supportedLocalesOf([e]);
@@ -1618,139 +1620,163 @@ function so(e) {
1618
1620
  throw new RangeError(`MonthSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`);
1619
1621
  }
1620
1622
  }
1621
- function co(e, t) {
1622
- const r = e === void 0 ? null : Ge(e, 0), n = t === void 0 ? null : Ge(t.getFullYear(), t.getMonth());
1623
+ function uo(e, t) {
1624
+ const r = e === void 0 ? null : _e(e, 0), n = t === void 0 ? null : _e(t.getFullYear(), t.getMonth());
1623
1625
  return r !== null && n !== null ? r >= n ? r : n : r !== null ? r : n;
1624
1626
  }
1625
- function uo(e, t) {
1626
- const r = e === void 0 ? null : Ge(e, 11), n = t === void 0 ? null : Ge(t.getFullYear(), t.getMonth());
1627
+ function mo(e, t) {
1628
+ const r = e === void 0 ? null : _e(e, 11), n = t === void 0 ? null : _e(t.getFullYear(), t.getMonth());
1627
1629
  return r !== null && n !== null ? r <= n ? r : n : r !== null ? r : n;
1628
1630
  }
1629
- function Qn(e, t) {
1630
- return { label: _e("month", e, void 0, t), value: yt(e) };
1631
+ function fo(e, t, r) {
1632
+ const n = /* @__PURE__ */ new Map();
1633
+ for (const a of e) {
1634
+ const l = _e(a.getFullYear(), a.getMonth());
1635
+ t !== null && l < t || r !== null && l > r || n.has(l.getTime()) || n.set(l.getTime(), l);
1636
+ }
1637
+ return Array.from(n.values()).sort((a, l) => a.getTime() - l.getTime());
1638
+ }
1639
+ function ho(e, t) {
1640
+ const r = e.getFullYear() * 12 + e.getMonth(), n = t.getFullYear() * 12 + t.getMonth(), a = [];
1641
+ for (let l = r; l <= n; l++)
1642
+ a.push(_e(Math.floor(l / 12), l % 12));
1643
+ return a;
1631
1644
  }
1632
- function mo(e, t, r) {
1633
- const n = e.getFullYear() * 12 + e.getMonth(), a = t.getFullYear() * 12 + t.getMonth(), l = [];
1634
- for (let o = a; o >= n; o--)
1635
- l.push(Qn(Ge(Math.floor(o / 12), o % 12), r));
1636
- return l;
1645
+ function Xn(e, t) {
1646
+ const r = [];
1647
+ for (let n = e.length - 1; n >= 0; n--)
1648
+ r.push({ label: Ve("month", e[n], void 0, t), value: Lt(e[n]) });
1649
+ return r;
1637
1650
  }
1638
- const fo = (e) => {
1651
+ const go = (e) => {
1639
1652
  const {
1640
1653
  value: t,
1641
1654
  initialDate: r,
1642
1655
  onChange: n,
1643
1656
  children: a,
1644
1657
  variant: l = "date",
1645
- minYear: o,
1658
+ minYear: i,
1646
1659
  maxYear: c,
1647
1660
  minDate: h,
1648
1661
  maxDate: m,
1649
- isWarning: k = !1,
1650
- className: D = "",
1651
- style: u,
1652
- disabled: v = !1,
1653
- prevMonthAriaLabel: U = "Previous month",
1654
- nextMonthAriaLabel: re = "Next month",
1655
- selectAriaLabel: M = "Month",
1656
- locale: Q
1662
+ allowedMonths: D,
1663
+ isWarning: x = !1,
1664
+ className: u = "",
1665
+ style: L,
1666
+ disabled: H = !1,
1667
+ prevMonthAriaLabel: ne = "Previous month",
1668
+ nextMonthAriaLabel: y = "Next month",
1669
+ selectAriaLabel: ae = "Month",
1670
+ locale: O
1657
1671
  } = e;
1658
- so(Q), Nr(t, "value"), Nr(r, "initialDate"), Nr(h, "minDate"), Nr(m, "maxDate"), _n(o, "minYear"), _n(c, "maxYear");
1659
- const I = t ?? r;
1660
- if (I === void 0)
1672
+ co(O), or(t, "value"), or(r, "initialDate"), or(h, "minDate"), or(m, "maxDate"), _n(i, "minYear"), _n(c, "maxYear"), D?.forEach((X, U) => {
1673
+ or(X, `allowedMonths[${U}]`);
1674
+ });
1675
+ const Q = t ?? r;
1676
+ if (Q === void 0)
1661
1677
  throw new RangeError("MonthSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected month is never inferred from the wall clock.");
1662
- const [ne, A] = xe(() => Ge(I.getFullYear(), I.getMonth())), B = t !== void 0, L = $(() => t !== void 0 ? Ge(t.getFullYear(), t.getMonth()) : ne, [t?.getTime(), ne]), K = h?.getTime(), H = m?.getTime(), g = $(() => co(o, h), [o, K]), R = $(() => uo(c, m), [c, H]);
1663
- if (g !== null && R !== null && g > R)
1664
- throw new RangeError(`MonthSelector: the resolved lower bound ${yt(g)} is after the resolved upper bound ${yt(R)}.`);
1665
- if (l === "dropdown" && (g === null || R === null))
1666
- throw new RangeError('MonthSelector: variant="dropdown" requires a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`); the option window is never invented.');
1667
- const Y = g !== null && L < g || R !== null && L > R, F = I.getTime();
1668
- Lt(() => {
1669
- if (B) return;
1670
- const S = Ge(I.getFullYear(), I.getMonth());
1671
- A((De) => De.getTime() === S.getTime() ? De : S);
1672
- }, [B, F]);
1673
- const P = (S) => (g === null || S >= g) && (R === null || S <= R), ae = (S) => {
1674
- if (v) return;
1675
- if (!P(S))
1676
- throw new RangeError(`MonthSelector: refusing to emit ${yt(S)}, which lies outside the declared bounds.`);
1677
- B || A(S);
1678
- const De = S.getFullYear() * 100 + (S.getMonth() + 1);
1679
- n?.(S, De);
1680
- }, Le = $(() => {
1681
- const S = Ge(L.getFullYear(), L.getMonth() - 1);
1682
- return P(S) ? S : null;
1683
- }, [L, g?.getTime(), R?.getTime()]), ee = $(() => {
1684
- const S = Ge(L.getFullYear(), L.getMonth() + 1);
1685
- return P(S) ? S : null;
1686
- }, [L, g?.getTime(), R?.getTime()]), oe = v || Le === null, se = v || ee === null, ge = () => {
1687
- Le !== null && ae(Le);
1688
- }, J = () => {
1689
- ee !== null && ae(ee);
1690
- }, j = (S) => {
1691
- if (!S) return;
1692
- const [De, Be] = S.split("-"), rt = Number(De), ue = Number(Be) - 1;
1693
- if (!(Number.isInteger(rt) && Number.isInteger(ue))) return;
1694
- const Se = Ge(rt, ue);
1695
- P(Se) && ae(Se);
1696
- }, Ye = (S) => {
1697
- j(S.target.value);
1698
- }, vt = (S) => {
1699
- j(S.target.value);
1700
- }, Fe = yt(L), ke = g ? yt(g) : void 0, be = R ? yt(R) : void 0, O = $(() => {
1701
- if (l !== "dropdown" || g === null || R === null) return [];
1702
- const S = mo(g, R, Q);
1703
- if (!Y) return S;
1704
- const De = Qn(L, Q);
1705
- return [...S, De].sort((Be, rt) => rt.value.localeCompare(Be.value));
1706
- }, [l, g?.getTime(), R?.getTime(), Y, L, Q]), z = k ? "border-amber-300 bg-amber-50 text-amber-900 focus:border-amber-500 focus:ring-amber-500 dark:border-amber-900/50 dark:bg-amber-950/20 dark:text-amber-200" : "border-gray-300 bg-gray-100 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500", Z = `mx-1 my-auto w-28 rounded-md border py-0.5 px-1 text-xs dark:placeholder:text-gray-400 disabled:opacity-50 ${z}`, we = `mx-1 my-auto w-28 appearance-none rounded-md border px-1 py-0.5 text-center font-mono text-xs tabular-nums [text-align-last:center] [text-align:center] disabled:opacity-50 ${z}`;
1707
- return /* @__PURE__ */ ce("div", { className: `inline-flex w-38 items-center ${D}`, style: u, children: [
1708
- /* @__PURE__ */ p(
1678
+ const [A, z] = Te(() => _e(Q.getFullYear(), Q.getMonth())), Y = t !== void 0, V = $(() => t !== void 0 ? _e(t.getFullYear(), t.getMonth()) : A, [t?.getTime(), A]), F = h?.getTime(), w = m?.getTime(), N = $(() => uo(i, h), [i, F]), p = $(() => mo(c, m), [c, w]), k = N?.getTime() ?? null, S = p?.getTime() ?? null;
1679
+ if (N !== null && p !== null && N > p)
1680
+ throw new RangeError(`MonthSelector: the resolved lower bound ${Lt(N)} is after the resolved upper bound ${Lt(p)}.`);
1681
+ if (l === "dropdown" && D === void 0 && (N === null || p === null))
1682
+ throw new RangeError('MonthSelector: variant="dropdown" requires a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`), or `allowedMonths`; the option window is never invented.');
1683
+ const ue = D === void 0 ? null : D.map((X) => X.getTime()).join(","), oe = $(() => D === void 0 ? null : fo(D, N, p), [ue, k, S]), te = (X) => {
1684
+ const U = X.getTime();
1685
+ return oe !== null ? oe.some((se) => se.getTime() === U) : !(k !== null && U < k || S !== null && U > S);
1686
+ }, ie = Q.getTime();
1687
+ Rt(() => {
1688
+ if (Y) return;
1689
+ const X = _e(Q.getFullYear(), Q.getMonth());
1690
+ z((U) => U.getTime() === X.getTime() ? U : X);
1691
+ }, [Y, ie]);
1692
+ const le = (X) => {
1693
+ if (H) return;
1694
+ if (!te(X))
1695
+ throw new RangeError(`MonthSelector: refusing to emit ${Lt(X)}, which lies outside the selectable months.`);
1696
+ Y || z(X);
1697
+ const U = X.getFullYear() * 100 + (X.getMonth() + 1);
1698
+ n?.(X, U);
1699
+ }, he = V.getTime(), W = te(V), G = $(() => {
1700
+ if (oe !== null) {
1701
+ for (let U = oe.length - 1; U >= 0; U--)
1702
+ if (oe[U].getTime() < he) return oe[U];
1703
+ return null;
1704
+ }
1705
+ const X = _e(V.getFullYear(), V.getMonth() - 1);
1706
+ return te(X) ? X : null;
1707
+ }, [oe, he, k, S]), Re = $(() => {
1708
+ if (oe !== null) {
1709
+ for (const U of oe)
1710
+ if (U.getTime() > he) return U;
1711
+ return null;
1712
+ }
1713
+ const X = _e(V.getFullYear(), V.getMonth() + 1);
1714
+ return te(X) ? X : null;
1715
+ }, [oe, he, k, S]), Dt = H || G === null, Be = H || Re === null, Ye = () => {
1716
+ G !== null && le(G);
1717
+ }, pe = () => {
1718
+ Re !== null && le(Re);
1719
+ }, I = (X) => {
1720
+ if (!X) return;
1721
+ const [U, se] = X.split("-"), ot = Number(U), ee = Number(se) - 1;
1722
+ if (!(Number.isInteger(ot) && Number.isInteger(ee))) return;
1723
+ const Qe = _e(ot, ee);
1724
+ te(Qe) && le(Qe);
1725
+ }, _ = (X) => {
1726
+ I(X.target.value);
1727
+ }, re = (X) => {
1728
+ I(X.target.value);
1729
+ }, we = Lt(V), de = Ve("month", V, void 0, O), Je = N ? Lt(N) : void 0, Ze = p ? Lt(p) : void 0, $t = $(() => l !== "dropdown" ? [] : oe !== null ? Xn(oe, O) : N === null || p === null ? [] : Xn(ho(N, p), O), [l, oe, k, S, O]), ge = W ? we : "", De = x ? "border-amber-300 bg-amber-50 text-amber-900 focus:border-amber-500 focus:ring-amber-500 dark:border-amber-900/50 dark:bg-amber-950/20 dark:text-amber-200" : "border-gray-300 bg-gray-100 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500", Ke = `mx-1 my-auto w-28 rounded-md border py-0.5 px-1 text-xs dark:placeholder:text-gray-400 disabled:opacity-50 ${De}`, xt = `mx-1 my-auto w-28 appearance-none rounded-md border px-1 py-0.5 text-center font-mono text-xs tabular-nums [text-align-last:center] [text-align:center] disabled:opacity-50 ${De}`;
1730
+ return /* @__PURE__ */ fe("div", { className: `inline-flex w-38 items-center ${u}`, style: L, "data-out-of-range": W ? void 0 : "true", children: [
1731
+ /* @__PURE__ */ v(
1709
1732
  "button",
1710
1733
  {
1711
1734
  type: "button",
1712
- "aria-label": U,
1713
- disabled: oe,
1735
+ "aria-label": ne,
1736
+ disabled: Dt,
1714
1737
  className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
1715
- onClick: ge,
1716
- children: /* @__PURE__ */ p("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
1738
+ onClick: Ye,
1739
+ children: /* @__PURE__ */ v("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
1717
1740
  }
1718
1741
  ),
1719
- l === "dropdown" ? /* @__PURE__ */ p("select", { "aria-label": M, disabled: v, className: we, value: Fe, onChange: vt, children: O.map((S) => /* @__PURE__ */ p("option", { value: S.value, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: S.label }, S.value)) }) : /* @__PURE__ */ p("input", { "aria-label": M, disabled: v, className: Z, value: Fe, min: ke, max: be, onChange: Ye, type: "month" }),
1720
- /* @__PURE__ */ p(
1742
+ l === "dropdown" ? /* @__PURE__ */ fe("select", { "aria-label": ae, disabled: H, className: xt, value: ge, onChange: re, children: [
1743
+ W ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: "text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400", children: de }),
1744
+ $t.map((X) => /* @__PURE__ */ v("option", { value: X.value, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: X.label }, X.value))
1745
+ ] }) : /* @__PURE__ */ v("input", { "aria-label": ae, disabled: H, className: Ke, value: we, min: Je, max: Ze, onChange: _, type: "month" }),
1746
+ /* @__PURE__ */ v(
1721
1747
  "button",
1722
1748
  {
1723
1749
  type: "button",
1724
- "aria-label": re,
1725
- disabled: se,
1750
+ "aria-label": y,
1751
+ disabled: Be,
1726
1752
  className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
1727
- onClick: J,
1728
- children: /* @__PURE__ */ p("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200" })
1753
+ onClick: pe,
1754
+ children: /* @__PURE__ */ v("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200" })
1729
1755
  }
1730
1756
  ),
1731
1757
  a
1732
1758
  ] });
1733
- }, ho = sr(fo, (e, t) => {
1759
+ }, bo = ur(go, (e, t) => {
1734
1760
  const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, a = r ? r.getFullYear() * 12 + r.getMonth() : null, l = n ? n.getFullYear() * 12 + n.getMonth() : null;
1735
1761
  if (a !== l || e.variant !== t.variant || e.disabled !== t.disabled || e.className !== t.className || e.style !== t.style || e.isWarning !== t.isWarning || e.minYear !== t.minYear || e.maxYear !== t.maxYear) return !1;
1736
- const o = e.minDate ? e.minDate.getFullYear() * 12 + e.minDate.getMonth() : null, c = t.minDate ? t.minDate.getFullYear() * 12 + t.minDate.getMonth() : null;
1737
- if (o !== c) return !1;
1762
+ const i = e.minDate ? e.minDate.getFullYear() * 12 + e.minDate.getMonth() : null, c = t.minDate ? t.minDate.getFullYear() * 12 + t.minDate.getMonth() : null;
1763
+ if (i !== c) return !1;
1738
1764
  const h = e.maxDate ? e.maxDate.getFullYear() * 12 + e.maxDate.getMonth() : null, m = t.maxDate ? t.maxDate.getFullYear() * 12 + t.maxDate.getMonth() : null;
1739
- return !(h !== m || e.onChange !== t.onChange || e.children !== t.children || e.prevMonthAriaLabel !== t.prevMonthAriaLabel || e.nextMonthAriaLabel !== t.nextMonthAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.locale !== t.locale);
1765
+ return !(h !== m || e.allowedMonths !== t.allowedMonths || e.onChange !== t.onChange || e.children !== t.children || e.prevMonthAriaLabel !== t.prevMonthAriaLabel || e.nextMonthAriaLabel !== t.nextMonthAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.locale !== t.locale);
1740
1766
  });
1741
- ho.displayName = "MonthSelector";
1742
- function lr(e, t, r) {
1767
+ bo.displayName = "MonthSelector";
1768
+ function cr(e, t, r) {
1743
1769
  if (!(r instanceof Date) || Number.isNaN(r.getTime()))
1744
1770
  throw new RangeError(`${e}: ${t} is required and must be a valid Date (received: ${String(r)})`);
1745
1771
  }
1746
1772
  function ln(e, t, r) {
1747
- if (lr(e, "minDate", t), lr(e, "maxDate", r), r.getTime() <= t.getTime())
1773
+ if (cr(e, "minDate", t), cr(e, "maxDate", r), r.getTime() <= t.getTime())
1748
1774
  throw new RangeError(`${e}: maxDate must be strictly later than minDate (minDate: ${t.toISOString()}, maxDate: ${r.toISOString()})`);
1749
1775
  }
1750
1776
  function tn(e, t, r) {
1751
1777
  if (!Array.isArray(r) || r.length !== 2)
1752
1778
  throw new RangeError(`${e}: ${t} is required and must be a [lower, upper] Date tuple (received: ${String(r)})`);
1753
- if (lr(e, `${t}[0]`, r[0]), lr(e, `${t}[1]`, r[1]), r[0].getTime() > r[1].getTime())
1779
+ if (cr(e, `${t}[0]`, r[0]), cr(e, `${t}[1]`, r[1]), r[0].getTime() > r[1].getTime())
1754
1780
  throw new RangeError(`${e}: ${t} upper must not be earlier than lower (lower: ${r[0].toISOString()}, upper: ${r[1].toISOString()})`);
1755
1781
  }
1756
1782
  function rn(e, t, r, n, a, l) {
@@ -1763,310 +1789,310 @@ function nn(e, t, r, n, a, l) {
1763
1789
  function Xe(e, t, r) {
1764
1790
  return e < t ? t : e > r ? r : e;
1765
1791
  }
1766
- function Yr(e, t, r, n) {
1767
- const a = pt(t, r, n[1]);
1792
+ function kr(e, t, r, n) {
1793
+ const a = Mt(t, r, n[1]);
1768
1794
  return [Xe(e[0], n[0], a), Xe(e[1], n[0], a)];
1769
1795
  }
1770
1796
  function an(e, t, r, n) {
1771
- const a = Pe(e, r, t) + n;
1797
+ const a = Ne(e, r, t) + n;
1772
1798
  return e[Math.max(0, Math.min(e.length - 1, a))];
1773
1799
  }
1774
1800
  function sn(e) {
1775
- const t = G(e), r = t.current, n = e, a = Object.keys(r), l = Object.keys(n);
1801
+ const t = Z(e), r = t.current, n = e, a = Object.keys(r), l = Object.keys(n);
1776
1802
  return a.length === l.length && l.every((c) => Object.is(r[c], n[c])) || (t.current = e), t.current;
1777
1803
  }
1778
- function xo(e) {
1779
- const { unit: t, minDate: r, maxDate: n, initialRange: a, onChangeRange: l, ...o } = e;
1804
+ function yo(e) {
1805
+ const { unit: t, minDate: r, maxDate: n, initialRange: a, onChangeRange: l, ...i } = e;
1780
1806
  ln("usePeriodSliderRange", r, n), tn("usePeriodSliderRange", "initialRange", a), nn("usePeriodSliderRange", "initialRange", a, r, n, "[minDate, maxDate]");
1781
- const c = sn(o), h = G(a), [m, k] = xe(a);
1782
- let D = m;
1807
+ const c = sn(i), h = Z(a), [m, D] = Te(a);
1808
+ let x = m;
1783
1809
  const u = [Xe(m[0], r, n), Xe(m[1], r, n)];
1784
- (u[0] !== m[0] || u[1] !== m[1]) && (D = u, k(u));
1785
- const v = G(D);
1786
- v.current = D;
1787
- const U = G({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
1788
- U.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
1789
- const re = G(l);
1790
- re.current = l;
1791
- const M = X((g) => {
1792
- const { minDate: R, maxDate: Y } = U.current, F = Xe(g[0], R, Y), P = Xe(g[1], R, Y), ae = v.current;
1793
- F.getTime() === ae[0].getTime() && P.getTime() === ae[1].getTime() || (v.current = [F, P], k([F, P]), re.current?.(F, P));
1794
- }, []), Q = X(
1795
- (g) => {
1796
- const R = v.current, Y = g.getTime() > R[1].getTime() ? g : R[1];
1797
- M([g, Y]);
1810
+ (u[0] !== m[0] || u[1] !== m[1]) && (x = u, D(u));
1811
+ const L = Z(x);
1812
+ L.current = x;
1813
+ const H = Z({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
1814
+ H.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
1815
+ const ne = Z(l);
1816
+ ne.current = l;
1817
+ const y = q((w) => {
1818
+ const { minDate: N, maxDate: p } = H.current, k = Xe(w[0], N, p), S = Xe(w[1], N, p), ue = L.current;
1819
+ k.getTime() === ue[0].getTime() && S.getTime() === ue[1].getTime() || (L.current = [k, S], D([k, S]), ne.current?.(k, S));
1820
+ }, []), ae = q(
1821
+ (w) => {
1822
+ const N = L.current, p = w.getTime() > N[1].getTime() ? w : N[1];
1823
+ y([w, p]);
1798
1824
  },
1799
- [M]
1800
- ), I = X(
1801
- (g) => {
1802
- const R = v.current, Y = g.getTime() < R[0].getTime() ? g : R[0];
1803
- M([Y, g]);
1825
+ [y]
1826
+ ), O = q(
1827
+ (w) => {
1828
+ const N = L.current, p = w.getTime() < N[0].getTime() ? w : N[0];
1829
+ y([p, w]);
1804
1830
  },
1805
- [M]
1806
- ), ne = X(
1807
- (g, R) => {
1808
- M([g, R]);
1831
+ [y]
1832
+ ), Q = q(
1833
+ (w, N) => {
1834
+ y([w, N]);
1809
1835
  },
1810
- [M]
1811
- ), A = X(
1812
- (g) => {
1813
- const { minDate: R, maxDate: Y, allowedDates: F } = U.current, P = v.current, ae = ir(F, t, R, Y);
1814
- if (ae.length > 0) {
1815
- M([an(ae, t, P[0], g), an(ae, t, P[1], g)]);
1836
+ [y]
1837
+ ), A = q(
1838
+ (w) => {
1839
+ const { minDate: N, maxDate: p, allowedDates: k } = H.current, S = L.current, ue = sr(k, t, N, p);
1840
+ if (ue.length > 0) {
1841
+ y([an(ue, t, S[0], w), an(ue, t, S[1], w)]);
1816
1842
  return;
1817
1843
  }
1818
- M([Ue(t, P[0], g), Ue(t, P[1], g)]);
1844
+ y([Ue(t, S[0], w), Ue(t, S[1], w)]);
1819
1845
  },
1820
- [t, M]
1821
- ), B = X(() => {
1822
- M(h.current);
1823
- }, [M]), L = $(
1846
+ [t, y]
1847
+ ), z = q(() => {
1848
+ y(h.current);
1849
+ }, [y]), Y = $(
1824
1850
  () => ({
1825
- value: D[0],
1826
- onChange: Q,
1851
+ value: x[0],
1852
+ onChange: ae,
1827
1853
  minDate: r,
1828
- maxDate: D[1],
1854
+ maxDate: x[1],
1829
1855
  unit: t
1830
1856
  }),
1831
- [D[0], D[1], Q, r, t]
1832
- ), K = $(
1857
+ [x[0], x[1], ae, r, t]
1858
+ ), V = $(
1833
1859
  () => ({
1834
- value: D[1],
1835
- onChange: I,
1836
- minDate: D[0],
1860
+ value: x[1],
1861
+ onChange: O,
1862
+ minDate: x[0],
1837
1863
  maxDate: n,
1838
1864
  unit: t
1839
1865
  }),
1840
- [D[0], D[1], I, n, t]
1841
- ), H = $(
1866
+ [x[0], x[1], O, n, t]
1867
+ ), F = $(
1842
1868
  () => ({
1843
1869
  ...c,
1844
1870
  mode: "range",
1845
1871
  unit: t,
1846
- range: D,
1872
+ range: x,
1847
1873
  minDate: r,
1848
1874
  maxDate: n,
1849
- onChangeRange: ne
1875
+ onChangeRange: Q
1850
1876
  }),
1851
- [c, t, D, r, n, ne]
1877
+ [c, t, x, r, n, Q]
1852
1878
  );
1853
1879
  return {
1854
- range: D,
1855
- lowerDate: D[0],
1856
- upperDate: D[1],
1857
- setRange: k,
1858
- setLowerDate: Q,
1859
- setUpperDate: I,
1880
+ range: x,
1881
+ lowerDate: x[0],
1882
+ upperDate: x[1],
1883
+ setRange: D,
1884
+ setLowerDate: ae,
1885
+ setUpperDate: O,
1860
1886
  shiftRange: A,
1861
- resetRange: B,
1862
- startSelectorProps: L,
1863
- endSelectorProps: K,
1864
- sliderProps: H
1887
+ resetRange: z,
1888
+ startSelectorProps: Y,
1889
+ endSelectorProps: V,
1890
+ sliderProps: F
1865
1891
  };
1866
1892
  }
1867
- function Do(e) {
1868
- const { unit: t, minDate: r, maxDate: n, initialValue: a, onChangePoint: l, ...o } = e;
1869
- ln("usePeriodSliderPoint", r, n), lr("usePeriodSliderPoint", "initialValue", a), rn("usePeriodSliderPoint", "initialValue", a, r, n, "[minDate, maxDate]");
1870
- const c = sn(o), h = G(a), [m, k] = xe(a);
1871
- let D = m;
1893
+ function To(e) {
1894
+ const { unit: t, minDate: r, maxDate: n, initialValue: a, onChangePoint: l, ...i } = e;
1895
+ ln("usePeriodSliderPoint", r, n), cr("usePeriodSliderPoint", "initialValue", a), rn("usePeriodSliderPoint", "initialValue", a, r, n, "[minDate, maxDate]");
1896
+ const c = sn(i), h = Z(a), [m, D] = Te(a);
1897
+ let x = m;
1872
1898
  const u = Xe(m, r, n);
1873
- u !== m && (D = u, k(u));
1874
- const v = G(D);
1875
- v.current = D;
1876
- const U = G({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
1877
- U.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
1878
- const re = G(l);
1879
- re.current = l;
1880
- const M = X((B) => {
1881
- const { minDate: L, maxDate: K } = U.current, H = Xe(B, L, K);
1882
- H.getTime() !== v.current.getTime() && (v.current = H, k(H), re.current?.(H));
1883
- }, []), Q = X(
1884
- (B) => {
1885
- const { minDate: L, maxDate: K, allowedDates: H } = U.current, g = ir(H, t, L, K);
1886
- if (g.length > 0) {
1887
- M(an(g, t, v.current, B));
1899
+ u !== m && (x = u, D(u));
1900
+ const L = Z(x);
1901
+ L.current = x;
1902
+ const H = Z({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
1903
+ H.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
1904
+ const ne = Z(l);
1905
+ ne.current = l;
1906
+ const y = q((z) => {
1907
+ const { minDate: Y, maxDate: V } = H.current, F = Xe(z, Y, V);
1908
+ F.getTime() !== L.current.getTime() && (L.current = F, D(F), ne.current?.(F));
1909
+ }, []), ae = q(
1910
+ (z) => {
1911
+ const { minDate: Y, maxDate: V, allowedDates: F } = H.current, w = sr(F, t, Y, V);
1912
+ if (w.length > 0) {
1913
+ y(an(w, t, L.current, z));
1888
1914
  return;
1889
1915
  }
1890
- M(Ue(t, v.current, B));
1916
+ y(Ue(t, L.current, z));
1891
1917
  },
1892
- [t, M]
1893
- ), I = X(() => {
1894
- M(h.current);
1895
- }, [M]), ne = $(
1918
+ [t, y]
1919
+ ), O = q(() => {
1920
+ y(h.current);
1921
+ }, [y]), Q = $(
1896
1922
  () => ({
1897
- value: D,
1898
- onChange: M,
1923
+ value: x,
1924
+ onChange: y,
1899
1925
  minDate: r,
1900
1926
  maxDate: n,
1901
1927
  unit: t
1902
1928
  }),
1903
- [D, M, r, n, t]
1929
+ [x, y, r, n, t]
1904
1930
  ), A = $(
1905
1931
  () => ({
1906
1932
  ...c,
1907
1933
  mode: "point",
1908
1934
  unit: t,
1909
- value: D,
1935
+ value: x,
1910
1936
  minDate: r,
1911
1937
  maxDate: n,
1912
- onChangePoint: M
1938
+ onChangePoint: y
1913
1939
  }),
1914
- [c, t, D, r, n, M]
1940
+ [c, t, x, r, n, y]
1915
1941
  );
1916
1942
  return {
1917
- value: D,
1918
- setValue: k,
1919
- shiftValue: Q,
1920
- resetValue: I,
1921
- selectorProps: ne,
1943
+ value: x,
1944
+ setValue: D,
1945
+ shiftValue: ae,
1946
+ resetValue: O,
1947
+ selectorProps: Q,
1922
1948
  sliderProps: A
1923
1949
  };
1924
1950
  }
1925
- function yo(e) {
1926
- const { unit: t, minDate: r, maxDate: n, initialMacroRange: a, initialMicroRange: l, macroUnit: o = t, microUnit: c = t, onChangeMacroRange: h, onChangeMicroRange: m, ...k } = e;
1927
- ln("useVernierSlider", r, n), tn("useVernierSlider", "initialMacroRange", a), tn("useVernierSlider", "initialMicroRange", l), nn("useVernierSlider", "initialMacroRange", a, r, n, "[minDate, maxDate]"), nn("useVernierSlider", "initialMicroRange", l, a[0], pt(o, c, a[1]), "the initial macro window");
1928
- const D = sn(k), u = G(a), v = G(l), [U, re] = xe(a), [M, Q] = xe(l);
1929
- let I = U;
1930
- const ne = [Xe(U[0], r, n), Xe(U[1], r, n)];
1931
- (ne[0] !== U[0] || ne[1] !== U[1]) && (I = ne, re(ne));
1932
- let A = M;
1933
- const B = Yr(M, o, c, I);
1934
- (B[0] !== M[0] || B[1] !== M[1]) && (A = B, Q(B));
1935
- const L = G(I);
1936
- L.current = I;
1937
- const K = G(A);
1938
- K.current = A;
1939
- const H = G({ minDate: r, maxDate: n });
1940
- H.current = { minDate: r, maxDate: n };
1941
- const g = G(h);
1942
- g.current = h;
1943
- const R = G(m);
1944
- R.current = m;
1945
- const Y = X((O, z) => {
1946
- const Z = L.current, we = K.current;
1947
- (O[0].getTime() !== Z[0].getTime() || O[1].getTime() !== Z[1].getTime()) && (L.current = O, re(O), g.current?.(O[0], O[1])), (z[0].getTime() !== we[0].getTime() || z[1].getTime() !== we[1].getTime()) && (K.current = z, Q(z), R.current?.(z[0], z[1]));
1948
- }, []), F = X(
1949
- (O, z) => {
1950
- const { minDate: Z, maxDate: we } = H.current, S = [Xe(O, Z, we), Xe(z, Z, we)];
1951
- Y(S, Yr(K.current, o, c, S));
1951
+ function Lo(e) {
1952
+ const { unit: t, minDate: r, maxDate: n, initialMacroRange: a, initialMicroRange: l, macroUnit: i = t, microUnit: c = t, onChangeMacroRange: h, onChangeMicroRange: m, ...D } = e;
1953
+ ln("useVernierSlider", r, n), tn("useVernierSlider", "initialMacroRange", a), tn("useVernierSlider", "initialMicroRange", l), nn("useVernierSlider", "initialMacroRange", a, r, n, "[minDate, maxDate]"), nn("useVernierSlider", "initialMicroRange", l, a[0], Mt(i, c, a[1]), "the initial macro window");
1954
+ const x = sn(D), u = Z(a), L = Z(l), [H, ne] = Te(a), [y, ae] = Te(l);
1955
+ let O = H;
1956
+ const Q = [Xe(H[0], r, n), Xe(H[1], r, n)];
1957
+ (Q[0] !== H[0] || Q[1] !== H[1]) && (O = Q, ne(Q));
1958
+ let A = y;
1959
+ const z = kr(y, i, c, O);
1960
+ (z[0] !== y[0] || z[1] !== y[1]) && (A = z, ae(z));
1961
+ const Y = Z(O);
1962
+ Y.current = O;
1963
+ const V = Z(A);
1964
+ V.current = A;
1965
+ const F = Z({ minDate: r, maxDate: n });
1966
+ F.current = { minDate: r, maxDate: n };
1967
+ const w = Z(h);
1968
+ w.current = h;
1969
+ const N = Z(m);
1970
+ N.current = m;
1971
+ const p = q((I, _) => {
1972
+ const re = Y.current, we = V.current;
1973
+ (I[0].getTime() !== re[0].getTime() || I[1].getTime() !== re[1].getTime()) && (Y.current = I, ne(I), w.current?.(I[0], I[1])), (_[0].getTime() !== we[0].getTime() || _[1].getTime() !== we[1].getTime()) && (V.current = _, ae(_), N.current?.(_[0], _[1]));
1974
+ }, []), k = q(
1975
+ (I, _) => {
1976
+ const { minDate: re, maxDate: we } = F.current, de = [Xe(I, re, we), Xe(_, re, we)];
1977
+ p(de, kr(V.current, i, c, de));
1952
1978
  },
1953
- [o, c, Y]
1954
- ), P = X(
1955
- (O, z) => {
1956
- Y(L.current, Yr([O, z], o, c, L.current));
1979
+ [i, c, p]
1980
+ ), S = q(
1981
+ (I, _) => {
1982
+ p(Y.current, kr([I, _], i, c, Y.current));
1957
1983
  },
1958
- [o, c, Y]
1959
- ), ae = X(
1960
- (O) => {
1961
- const z = L.current[1], Z = O > z ? O : z;
1962
- F(O, Z);
1984
+ [i, c, p]
1985
+ ), ue = q(
1986
+ (I) => {
1987
+ const _ = Y.current[1], re = I > _ ? I : _;
1988
+ k(I, re);
1963
1989
  },
1964
- [F]
1965
- ), Le = X(
1966
- (O) => {
1967
- const z = L.current[0], Z = O < z ? O : z;
1968
- F(Z, O);
1990
+ [k]
1991
+ ), oe = q(
1992
+ (I) => {
1993
+ const _ = Y.current[0], re = I < _ ? I : _;
1994
+ k(re, I);
1969
1995
  },
1970
- [F]
1971
- ), ee = X(
1972
- (O) => {
1973
- const z = K.current[1], Z = O > z ? O : z;
1974
- P(O, Z);
1996
+ [k]
1997
+ ), te = q(
1998
+ (I) => {
1999
+ const _ = V.current[1], re = I > _ ? I : _;
2000
+ S(I, re);
1975
2001
  },
1976
- [P]
1977
- ), oe = X(
1978
- (O) => {
1979
- const z = K.current[0], Z = O < z ? O : z;
1980
- P(Z, O);
2002
+ [S]
2003
+ ), ie = q(
2004
+ (I) => {
2005
+ const _ = V.current[0], re = I < _ ? I : _;
2006
+ S(re, I);
1981
2007
  },
1982
- [P]
1983
- ), se = X(
1984
- (O) => {
1985
- const { minDate: z, maxDate: Z } = H.current, we = L.current, S = Ue(o, we[0], O), De = Ue(o, we[1], O);
1986
- S < z || De > Z || F(S, De);
2008
+ [S]
2009
+ ), le = q(
2010
+ (I) => {
2011
+ const { minDate: _, maxDate: re } = F.current, we = Y.current, de = Ue(i, we[0], I), Je = Ue(i, we[1], I);
2012
+ de < _ || Je > re || k(de, Je);
1987
2013
  },
1988
- [o, F]
1989
- ), ge = X(
1990
- (O) => {
1991
- const z = L.current, Z = K.current, we = Ue(c, Z[0], O), S = Ue(c, Z[1], O);
1992
- we < z[0] || S > pt(o, c, z[1]) || P(we, S);
2014
+ [i, k]
2015
+ ), he = q(
2016
+ (I) => {
2017
+ const _ = Y.current, re = V.current, we = Ue(c, re[0], I), de = Ue(c, re[1], I);
2018
+ we < _[0] || de > Mt(i, c, _[1]) || S(we, de);
1993
2019
  },
1994
- [o, c, P]
1995
- ), J = X(() => {
1996
- const O = u.current;
1997
- Y(O, Yr(v.current, o, c, O));
1998
- }, [o, c, Y]), j = $(() => pt(o, c, I[1]), [o, c, I[1]]), Ye = $(
2020
+ [i, c, S]
2021
+ ), W = q(() => {
2022
+ const I = u.current;
2023
+ p(I, kr(L.current, i, c, I));
2024
+ }, [i, c, p]), G = $(() => Mt(i, c, O[1]), [i, c, O[1]]), Re = $(
1999
2025
  () => ({
2000
- value: I[0],
2001
- onChange: ae,
2026
+ value: O[0],
2027
+ onChange: ue,
2002
2028
  minDate: r,
2003
- maxDate: I[1],
2004
- unit: o
2029
+ maxDate: O[1],
2030
+ unit: i
2005
2031
  }),
2006
- [I, ae, r, o]
2007
- ), vt = $(
2032
+ [O, ue, r, i]
2033
+ ), Dt = $(
2008
2034
  () => ({
2009
- value: I[1],
2010
- onChange: Le,
2011
- minDate: I[0],
2035
+ value: O[1],
2036
+ onChange: oe,
2037
+ minDate: O[0],
2012
2038
  maxDate: n,
2013
- unit: o
2039
+ unit: i
2014
2040
  }),
2015
- [I, Le, n, o]
2016
- ), Fe = $(
2041
+ [O, oe, n, i]
2042
+ ), Be = $(
2017
2043
  () => ({
2018
2044
  value: A[0],
2019
- onChange: ee,
2020
- minDate: I[0],
2045
+ onChange: te,
2046
+ minDate: O[0],
2021
2047
  maxDate: A[1],
2022
2048
  unit: c
2023
2049
  }),
2024
- [A, ee, I, c]
2025
- ), ke = $(
2050
+ [A, te, O, c]
2051
+ ), Ye = $(
2026
2052
  () => ({
2027
2053
  value: A[1],
2028
- onChange: oe,
2054
+ onChange: ie,
2029
2055
  minDate: A[0],
2030
- maxDate: j,
2056
+ maxDate: G,
2031
2057
  unit: c
2032
2058
  }),
2033
- [A, oe, j, c]
2034
- ), be = $(
2059
+ [A, ie, G, c]
2060
+ ), pe = $(
2035
2061
  () => ({
2036
- ...D,
2062
+ ...x,
2037
2063
  mode: "vernier",
2038
2064
  unit: t,
2039
- macroUnit: o,
2065
+ macroUnit: i,
2040
2066
  microUnit: c,
2041
2067
  minDate: r,
2042
2068
  maxDate: n,
2043
- macroRange: I,
2069
+ macroRange: O,
2044
2070
  microRange: A,
2045
- onChangeMacroRange: F,
2046
- onChangeMicroRange: P
2071
+ onChangeMacroRange: k,
2072
+ onChangeMicroRange: S
2047
2073
  }),
2048
- [D, t, o, c, r, n, I, A, F, P]
2074
+ [x, t, i, c, r, n, O, A, k, S]
2049
2075
  );
2050
2076
  return {
2051
- macroRange: I,
2052
- setMacroRange: re,
2077
+ macroRange: O,
2078
+ setMacroRange: ne,
2053
2079
  microRange: A,
2054
- setMicroRange: Q,
2055
- setMacroLowerDate: ae,
2056
- setMacroUpperDate: Le,
2057
- setMicroLowerDate: ee,
2058
- setMicroUpperDate: oe,
2059
- shiftMacroRange: se,
2060
- shiftMicroRange: ge,
2061
- resetVernier: J,
2062
- macroStartSelectorProps: Ye,
2063
- macroEndSelectorProps: vt,
2064
- microStartSelectorProps: Fe,
2065
- microEndSelectorProps: ke,
2066
- sliderProps: be
2080
+ setMicroRange: ae,
2081
+ setMacroLowerDate: ue,
2082
+ setMacroUpperDate: oe,
2083
+ setMicroLowerDate: te,
2084
+ setMicroUpperDate: ie,
2085
+ shiftMacroRange: le,
2086
+ shiftMicroRange: he,
2087
+ resetVernier: W,
2088
+ macroStartSelectorProps: Re,
2089
+ macroEndSelectorProps: Dt,
2090
+ microStartSelectorProps: Be,
2091
+ microEndSelectorProps: Ye,
2092
+ sliderProps: pe
2067
2093
  };
2068
2094
  }
2069
- function Xn(e) {
2095
+ function Kn(e) {
2070
2096
  const t = new Date(e, 0, 1);
2071
2097
  return t.setFullYear(e), t;
2072
2098
  }
@@ -2074,11 +2100,11 @@ function Ar(e, t) {
2074
2100
  if (e !== void 0 && (!(e instanceof Date) || Number.isNaN(e.getTime())))
2075
2101
  throw new RangeError(`YearSelector: \`${t}\` must be a valid Date, received ${String(e)}.`);
2076
2102
  }
2077
- function Kn(e, t) {
2103
+ function qn(e, t) {
2078
2104
  if (e !== void 0 && !Number.isInteger(e))
2079
2105
  throw new RangeError(`YearSelector: \`${t}\` must be an integer year, received ${String(e)}.`);
2080
2106
  }
2081
- function go(e) {
2107
+ function wo(e) {
2082
2108
  if (e !== void 0)
2083
2109
  try {
2084
2110
  Intl.DateTimeFormat.supportedLocalesOf([e]);
@@ -2086,111 +2112,111 @@ function go(e) {
2086
2112
  throw new RangeError(`YearSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`);
2087
2113
  }
2088
2114
  }
2089
- function qn(e, t, r) {
2115
+ function jn(e, t, r) {
2090
2116
  const n = e === void 0 ? null : e, a = t === void 0 ? null : t.getFullYear();
2091
2117
  return n !== null && a !== null ? r(n, a) : n !== null ? n : a;
2092
2118
  }
2093
- const bo = (e) => {
2094
- const { value: t, initialDate: r, onChange: n, children: a, minYear: l, maxYear: o, minDate: c, maxDate: h, className: m = "", style: k, disabled: D = !1, prevYearAriaLabel: u = "Previous year", nextYearAriaLabel: v = "Next year", selectAriaLabel: U = "Year", locale: re } = e;
2095
- Ar(t, "value"), Ar(r, "initialDate"), Ar(c, "minDate"), Ar(h, "maxDate"), Kn(l, "minYear"), Kn(o, "maxYear"), go(re);
2096
- const M = t ?? r;
2097
- if (M === void 0)
2119
+ const vo = (e) => {
2120
+ const { value: t, initialDate: r, onChange: n, children: a, minYear: l, maxYear: i, minDate: c, maxDate: h, className: m = "", style: D, disabled: x = !1, prevYearAriaLabel: u = "Previous year", nextYearAriaLabel: L = "Next year", selectAriaLabel: H = "Year", locale: ne } = e;
2121
+ Ar(t, "value"), Ar(r, "initialDate"), Ar(c, "minDate"), Ar(h, "maxDate"), qn(l, "minYear"), qn(i, "maxYear"), wo(ne);
2122
+ const y = t ?? r;
2123
+ if (y === void 0)
2098
2124
  throw new RangeError("YearSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected year is never inferred from the wall clock.");
2099
- const [Q, I] = xe(() => M.getFullYear()), ne = c?.getTime(), A = h?.getTime(), B = $(() => qn(l, c, Math.max), [l, ne]), L = $(() => qn(o, h, Math.min), [o, A]);
2100
- if (B === null || L === null)
2125
+ const [ae, O] = Te(() => y.getFullYear()), Q = c?.getTime(), A = h?.getTime(), z = $(() => jn(l, c, Math.max), [l, Q]), Y = $(() => jn(i, h, Math.min), [i, A]);
2126
+ if (z === null || Y === null)
2101
2127
  throw new RangeError("YearSelector: a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`) are both required; the year option list is never invented.");
2102
- if (B > L)
2103
- throw new RangeError(`YearSelector: the resolved lower bound ${B} is after the resolved upper bound ${L}.`);
2104
- const K = t !== void 0, H = t !== void 0 ? t.getFullYear() : Q, g = H < B || H > L, R = M.getTime();
2105
- Lt(() => {
2106
- K || I(M.getFullYear());
2107
- }, [K, R]);
2108
- const Y = (J) => J >= B && J <= L, F = (J) => {
2109
- if (!D) {
2110
- if (!Y(J))
2111
- throw new RangeError(`YearSelector: refusing to emit ${J}, which lies outside the declared bounds ${B}-${L}.`);
2112
- K || I(J), n?.(Xn(J), J);
2128
+ if (z > Y)
2129
+ throw new RangeError(`YearSelector: the resolved lower bound ${z} is after the resolved upper bound ${Y}.`);
2130
+ const V = t !== void 0, F = t !== void 0 ? t.getFullYear() : ae, w = F < z || F > Y, N = y.getTime();
2131
+ Rt(() => {
2132
+ V || O(y.getFullYear());
2133
+ }, [V, N]);
2134
+ const p = (W) => W >= z && W <= Y, k = (W) => {
2135
+ if (!x) {
2136
+ if (!p(W))
2137
+ throw new RangeError(`YearSelector: refusing to emit ${W}, which lies outside the declared bounds ${z}-${Y}.`);
2138
+ V || O(W), n?.(Kn(W), W);
2113
2139
  }
2114
- }, P = Y(H - 1) ? H - 1 : null, ae = Y(H + 1) ? H + 1 : null, Le = D || P === null, ee = D || ae === null, oe = () => {
2115
- P !== null && F(P);
2116
- }, se = () => {
2117
- ae !== null && F(ae);
2118
- }, ge = $(() => {
2119
- const J = [];
2120
- for (let j = L; j >= B; j--)
2121
- J.push(j);
2122
- return g && (J.push(H), J.sort((j, Ye) => Ye - j)), J;
2123
- }, [B, L, g, H]);
2124
- return /* @__PURE__ */ ce("div", { className: `inline-flex w-32 items-center ${m}`, style: k, children: [
2125
- /* @__PURE__ */ p(
2140
+ }, S = p(F - 1) ? F - 1 : null, ue = p(F + 1) ? F + 1 : null, oe = x || S === null, te = x || ue === null, ie = () => {
2141
+ S !== null && k(S);
2142
+ }, le = () => {
2143
+ ue !== null && k(ue);
2144
+ }, he = $(() => {
2145
+ const W = [];
2146
+ for (let G = Y; G >= z; G--)
2147
+ W.push(G);
2148
+ return w && (W.push(F), W.sort((G, Re) => Re - G)), W;
2149
+ }, [z, Y, w, F]);
2150
+ return /* @__PURE__ */ fe("div", { className: `inline-flex w-32 items-center ${m}`, style: D, children: [
2151
+ /* @__PURE__ */ v(
2126
2152
  "button",
2127
2153
  {
2128
2154
  type: "button",
2129
2155
  "aria-label": u,
2130
- disabled: Le,
2156
+ disabled: oe,
2131
2157
  className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
2132
- onClick: oe,
2133
- children: /* @__PURE__ */ p("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
2158
+ onClick: ie,
2159
+ children: /* @__PURE__ */ v("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
2134
2160
  }
2135
2161
  ),
2136
- /* @__PURE__ */ p(
2162
+ /* @__PURE__ */ v(
2137
2163
  "select",
2138
2164
  {
2139
- "aria-label": U,
2140
- disabled: D,
2165
+ "aria-label": H,
2166
+ disabled: x,
2141
2167
  className: "mx-1 my-auto w-18 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",
2142
- value: H,
2143
- onChange: (J) => {
2144
- if (!J.target.value) return;
2145
- const j = Number(J.target.value);
2146
- Number.isInteger(j) && F(j);
2168
+ value: F,
2169
+ onChange: (W) => {
2170
+ if (!W.target.value) return;
2171
+ const G = Number(W.target.value);
2172
+ Number.isInteger(G) && k(G);
2147
2173
  },
2148
- children: ge.map((J) => /* @__PURE__ */ p("option", { value: J, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: _e("year", Xn(J), void 0, re) }, J))
2174
+ children: he.map((W) => /* @__PURE__ */ v("option", { value: W, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: Ve("year", Kn(W), void 0, ne) }, W))
2149
2175
  }
2150
2176
  ),
2151
- /* @__PURE__ */ p(
2177
+ /* @__PURE__ */ v(
2152
2178
  "button",
2153
2179
  {
2154
2180
  type: "button",
2155
- "aria-label": v,
2156
- disabled: ee,
2181
+ "aria-label": L,
2182
+ disabled: te,
2157
2183
  className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
2158
- onClick: se,
2159
- children: /* @__PURE__ */ p("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200" })
2184
+ onClick: le,
2185
+ children: /* @__PURE__ */ v("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200" })
2160
2186
  }
2161
2187
  ),
2162
2188
  a
2163
2189
  ] });
2164
- }, wo = sr(bo, (e, t) => {
2190
+ }, po = ur(vo, (e, t) => {
2165
2191
  const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, a = r ? r.getFullYear() : null, l = n ? n.getFullYear() : null;
2166
2192
  return !(a !== l || e.disabled !== t.disabled || e.className !== t.className || e.style !== t.style || e.minYear !== t.minYear || e.maxYear !== t.maxYear || e.minDate?.getFullYear() !== t.minDate?.getFullYear() || e.maxDate?.getFullYear() !== t.maxDate?.getFullYear() || e.onChange !== t.onChange || e.children !== t.children || e.prevYearAriaLabel !== t.prevYearAriaLabel || e.nextYearAriaLabel !== t.nextYearAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.locale !== t.locale);
2167
2193
  });
2168
- wo.displayName = "YearSelector";
2194
+ po.displayName = "YearSelector";
2169
2195
  export {
2170
- Pa as COLOR_SCHEME_PALETTES,
2171
- lo as DateSelector,
2172
- ho as MonthSelector,
2173
- Ja as PeriodSlider,
2174
- wo as YearSelector,
2196
+ Na as COLOR_SCHEME_PALETTES,
2197
+ so as DateSelector,
2198
+ bo as MonthSelector,
2199
+ Za as PeriodSlider,
2200
+ po as YearSelector,
2175
2201
  Ue as addUnit,
2176
- Wa as areStylesEqual,
2177
- Ea as calculateConnectDragValues,
2202
+ Ga as areStylesEqual,
2203
+ Ca as calculateConnectDragValues,
2178
2204
  On as calculateHandleDragValues,
2179
- Ca as calculateKeyboardActionValues,
2180
- Jn as calculateLabelSlant,
2181
- Fa as calculateVernierMacroDrag,
2182
- Va as calculateVernierMicroDrag,
2183
- le as decode,
2184
- W as encode,
2185
- Pe as findNearestDateIndex,
2186
- _e as formatLabel,
2187
- Bt as formatScreenReaderLabel,
2188
- Aa as getActiveDragHandle,
2189
- pt as getMacroWindowEndDate,
2190
- ir as getSortedAllowedDates,
2191
- et as normalizeDateByUnit,
2192
- Oa as resolveVernierTargetHandle,
2193
- Do as usePeriodSliderPoint,
2194
- xo as usePeriodSliderRange,
2195
- yo as useVernierSlider
2205
+ Ia as calculateKeyboardActionValues,
2206
+ Zn as calculateLabelSlant,
2207
+ Va as calculateVernierMacroDrag,
2208
+ Ua as calculateVernierMicroDrag,
2209
+ me as decode,
2210
+ J as encode,
2211
+ Ne as findNearestDateIndex,
2212
+ Ve as formatLabel,
2213
+ _t as formatScreenReaderLabel,
2214
+ Ea as getActiveDragHandle,
2215
+ Mt as getMacroWindowEndDate,
2216
+ sr as getSortedAllowedDates,
2217
+ nt as normalizeDateByUnit,
2218
+ Fa as resolveVernierTargetHandle,
2219
+ To as usePeriodSliderPoint,
2220
+ yo as usePeriodSliderRange,
2221
+ Lo as useVernierSlider
2196
2222
  };