@aiquants/period-slider 0.10.0 → 0.10.2

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,109 +1,112 @@
1
- import { jsx as I, jsxs as Me, Fragment as jn } from "react/jsx-runtime";
2
- import { addYears as Si, addMonths as yi, addDays as gn, format as gr, getDaysInMonth as ro, parseISO as no } from "date-fns";
3
- import { memo as zr, useId as Ti, useRef as O, useMemo as C, useCallback as U, useState as ye, useEffect as Dt, useLayoutEffect as Cr } from "react";
4
- const ao = 120, qn = "data-drag-snap", Zn = "--ps-drag-snap-duration", Hr = {
1
+ import { jsx as $, jsxs as we, Fragment as eo } from "react/jsx-runtime";
2
+ import { addYears as Yi, addMonths as Oi, addDays as vn, format as wr, getDaysInMonth as ba, parseISO as wa } from "date-fns";
3
+ import { memo as Ur, useId as Hi, useRef as V, useMemo as E, useCallback as z, useState as Pe, useEffect as it, useLayoutEffect as Nr } from "react";
4
+ const va = 120, to = "data-drag-snap", ro = "--ps-drag-snap-duration", _r = {
5
5
  flat: ["--ps-drag-low", "--ps-drag-high"],
6
6
  macro: ["--ps-drag-macro-low", "--ps-drag-macro-high"],
7
7
  micro: ["--ps-drag-micro-low", "--ps-drag-micro-high"]
8
- }, To = ["low", "high"], Po = ["tx", "ty", "rot"], xn = {
8
+ }, _a = ["low", "high"], za = ["tx", "ty", "rot"], yn = {
9
9
  flat: { low: "--ps-drag-label-low", high: "--ps-drag-label-high" },
10
10
  macro: { low: "--ps-drag-macro-label-low", high: "--ps-drag-macro-label-high" },
11
11
  micro: { low: "--ps-drag-micro-label-low", high: "--ps-drag-micro-label-high" }
12
- }, ca = (e, t) => `${e}-${t}`, Jn = (e, t, r) => `var(${ca(e, t)}, ${r})`, Pi = (e, t, r) => {
13
- const n = xn[t];
14
- for (const a of To)
15
- for (const i of Po) e.style.setProperty(ca(n[a], i), r[a][i]);
16
- }, Ao = (e) => Math.max(0, Math.min(1, e)), hn = (e, t, r, n) => {
17
- const a = Ao(t);
18
- if (e === "point") return [a, a];
12
+ }, ho = (e, t) => `${e}-${t}`, no = (e, t, r) => `var(${ho(e, t)}, ${r})`, Fi = (e, t, r) => {
13
+ const n = yn[t];
14
+ for (const o of _a)
15
+ for (const i of za) e.style.setProperty(ho(n[o], i), r[o][i]);
16
+ }, Ba = (e) => Math.max(0, Math.min(1, e)), pn = (e, t, r, n) => {
17
+ const o = Ba(t);
18
+ if (e === "point") return [o, o];
19
19
  const i = e === "low" ? n : r;
20
- return [Math.min(a, i), Math.max(a, i)];
21
- }, ua = (e, t, r) => {
22
- const n = r - t, a = Math.max(0, Math.min(1 - n, t + e));
23
- return [a, a + n];
24
- }, da = (e, t, r, n) => {
25
- const a = Ao(t);
26
- return e === "low" ? a > n ? "high" : "low" : a < r ? "low" : "high";
27
- }, Qn = (e, t, r, n) => {
20
+ return [Math.min(o, i), Math.max(o, i)];
21
+ }, bo = (e, t, r) => {
22
+ const n = r - t, o = Math.max(0, Math.min(1 - n, t + e));
23
+ return [o, o + n];
24
+ }, wo = (e, t, r, n) => {
25
+ const o = Ba(t);
26
+ return e === "low" ? o > n ? "high" : "low" : o < r ? "low" : "high";
27
+ }, oo = (e, t, r, n) => {
28
28
  if (r) {
29
- const l = (1 - e) * 100, c = (1 - t) * 100;
30
- return n ? `M 12 ${c} L 12 ${l} L 20 100 L 20 0 Z` : `M 12 0 L 12 100 L 20 ${l} L 20 ${c} Z`;
29
+ const l = (1 - e) * 100, s = (1 - t) * 100;
30
+ return n ? `M 12 ${s} L 12 ${l} L 20 100 L 20 0 Z` : `M 12 0 L 12 100 L 20 ${l} L 20 ${s} Z`;
31
31
  }
32
- const a = e * 100, i = t * 100;
33
- return n ? `M ${a} 12 L ${i} 12 L 100 20 L 0 20 Z` : `M 0 12 L 100 12 L ${i} 20 L ${a} 20 Z`;
34
- }, It = (e, t) => `var(${e}, ${t}%)`, Ai = (e, t, r, n) => {
35
- const [a, i] = Hr[t];
36
- e.style.setProperty(a, `${r * 100}%`), e.style.setProperty(i, `${n * 100}%`);
37
- }, $i = (e) => {
38
- for (const [t, r] of Object.values(Hr))
32
+ const o = e * 100, i = t * 100;
33
+ return n ? `M ${o} 12 L ${i} 12 L 100 20 L 0 20 Z` : `M 0 12 L 100 12 L ${i} 20 L ${o} 20 Z`;
34
+ }, Vt = (e, t) => `var(${e}, ${t}%)`, _i = (e, t, r, n) => {
35
+ const [o, i] = _r[t];
36
+ e.style.setProperty(o, `${r * 100}%`), e.style.setProperty(i, `${n * 100}%`);
37
+ }, zi = (e) => {
38
+ for (const [t, r] of Object.values(_r))
39
39
  e.style.removeProperty(t), e.style.removeProperty(r);
40
- for (const t of Object.values(xn))
41
- for (const r of To)
42
- for (const n of Po) e.style.removeProperty(ca(t[r], n));
43
- }, ea = (e, t) => e !== null && t !== null && "nodeType" in t && e.contains(t), oo = /* @__PURE__ */ new Set(["hidden", "clip", "scroll", "auto", "overlay"]), io = ["paint", "strict", "content"], Ei = ["layout", "paint", "strict", "content"], Ii = ["transform", "perspective", "filter"], Vr = (e) => e !== void 0 && e !== "" && e !== "none", Ci = (e) => e.position === "fixed" ? "fixed" : e.position === "absolute" ? "absolute" : null, Vi = (e, t) => t === "absolute" && Vr(e.position) && e.position !== "static" || Vr(e.transform) || Vr(e.perspective) || Vr(e.filter) || Vr(e.backdropFilter) || Ei.some((r) => e.contain.includes(r)) ? !0 : Ii.some((r) => e.willChange.includes(r)), Ni = (e, t, r, n, a, i) => {
40
+ for (const t of Object.values(yn))
41
+ for (const r of _a)
42
+ for (const n of za) e.style.removeProperty(ho(t[r], n));
43
+ }, ao = (e, t) => e !== null && t !== null && "nodeType" in t && e.contains(t), pa = /* @__PURE__ */ new Set(["hidden", "clip", "scroll", "auto", "overlay"]), Da = ["paint", "strict", "content"], Bi = ["layout", "paint", "strict", "content"], Ui = ["transform", "perspective", "filter"], kr = (e) => e !== void 0 && e !== "" && e !== "none", Wi = (e) => e !== void 0 && e !== "" && e !== "normal", dn = (e) => {
44
+ const t = Number.parseFloat(e ?? "");
45
+ return Number.isFinite(t) ? t : 0;
46
+ }, Gi = (e) => e.position === "fixed" ? "fixed" : e.position === "absolute" ? "absolute" : null, Xi = (e, t) => t === "absolute" && kr(e.position) && e.position !== "static" || kr(e.transform) || kr(e.perspective) || kr(e.filter) || kr(e.backdropFilter) || Wi(e.containerType) || Bi.some((r) => e.contain.includes(r)) ? !0 : Ui.some((r) => e.willChange.includes(r)), Ki = (e, t, r, n, o, i) => {
44
47
  const l = t.ownerDocument.defaultView;
45
48
  if (l === null) return !1;
46
- const c = e.getBoundingClientRect();
47
- if (c.width === 0 || c.height === 0) return !1;
48
- const f = n ? 0 : r, g = n ? r : 0;
49
- if (a < c.left - f || a >= c.right + f || i < c.top - g || i >= c.bottom + g) return !1;
49
+ const s = e.getBoundingClientRect();
50
+ if (s.width === 0 || s.height === 0) return !1;
51
+ const g = n ? 0 : r, h = n ? r : 0;
52
+ if (o < s.left - g || o >= s.right + g || i < s.top - h || i >= s.bottom + h) return !1;
50
53
  const D = l.getComputedStyle(t);
51
54
  if (D.visibility !== "visible") return !1;
52
55
  let R = null;
53
- for (let s = t; s !== null; s = s.parentElement) {
54
- const S = s === t ? D : l.getComputedStyle(s);
55
- if (R !== null && !Vi(S, R)) continue;
56
- const Z = oo.has(S.overflowX) || io.some((x) => S.contain.includes(x)), ee = oo.has(S.overflowY) || io.some((x) => S.contain.includes(x));
56
+ for (let c = t; c !== null; c = c.parentElement) {
57
+ const M = c === t ? D : l.getComputedStyle(c);
58
+ if (R !== null && !Xi(M, R)) continue;
59
+ const Z = pa.has(M.overflowX) || Da.some((x) => M.contain.includes(x)), ee = pa.has(M.overflowY) || Da.some((x) => M.contain.includes(x));
57
60
  if (Z || ee) {
58
- const x = s.getBoundingClientRect();
59
- if (Z && (a < x.left || a >= x.right) || ee && (i < x.top || i >= x.bottom)) return !1;
61
+ const x = c.getBoundingClientRect();
62
+ if (Z && (o < x.left + dn(M.borderLeftWidth) || o >= x.right - dn(M.borderRightWidth)) || ee && (i < x.top + dn(M.borderTopWidth) || i >= x.bottom - dn(M.borderBottomWidth))) return !1;
60
63
  }
61
- R = Ci(S);
64
+ R = Gi(M);
62
65
  }
63
66
  return !0;
64
- }, ta = /* @__PURE__ */ new Map(), ki = (e, t) => {
67
+ }, io = /* @__PURE__ */ new Map(), ji = (e, t) => {
65
68
  if (!(t.shiftKey && t.cancelable)) return;
66
- for (const a of e)
67
- if (a.ownsHit(t.target)) {
68
- a.step(t);
69
+ for (const o of e)
70
+ if (o.ownsHit(t.target)) {
71
+ o.step(t);
69
72
  return;
70
73
  }
71
74
  let r = null, n = Number.POSITIVE_INFINITY;
72
- for (const a of e) {
73
- const i = a.distanceToRailPx(t.clientX, t.clientY);
74
- i === null || i >= n || (r = a, n = i);
75
+ for (const o of e) {
76
+ const i = o.distanceToRailPx(t.clientX, t.clientY);
77
+ i === null || i >= n || (r = o, n = i);
75
78
  }
76
79
  r?.step(t);
77
- }, Yi = (e, t) => {
78
- let r = ta.get(e);
80
+ }, qi = (e, t) => {
81
+ let r = io.get(e);
79
82
  if (r === void 0) {
80
- const i = /* @__PURE__ */ new Set(), l = (c) => ki(i, c);
81
- r = { participants: i, listener: l }, ta.set(e, r), e.addEventListener("wheel", l, { passive: !1, capture: !0 });
83
+ const i = /* @__PURE__ */ new Set(), l = (s) => ji(i, s);
84
+ r = { participants: i, listener: l }, io.set(e, r), e.addEventListener("wheel", l, { passive: !1, capture: !0 });
82
85
  }
83
- const { participants: n, listener: a } = r;
86
+ const { participants: n, listener: o } = r;
84
87
  return n.add(t), () => {
85
- n.delete(t), !(n.size > 0) && (ta.delete(e), e.removeEventListener("wheel", a, { capture: !0 }));
88
+ n.delete(t), !(n.size > 0) && (io.delete(e), e.removeEventListener("wheel", o, { capture: !0 }));
86
89
  };
87
- }, Fr = "gap-[11px]", mt = 6, ft = mt * 2, Ct = mt * 4 / 3, Oi = {
90
+ }, Br = "gap-[11px]", mt = 6, ft = mt * 2, Nt = mt * 4 / 3, Zi = {
88
91
  left: `0,${ft / 2} ${mt},0 ${mt},${ft}`,
89
- right: `${Ct},${ft / 2} ${Ct - mt},0 ${Ct - mt},${ft}`,
92
+ right: `${Nt},${ft / 2} ${Nt - mt},0 ${Nt - mt},${ft}`,
90
93
  up: `${ft / 2},0 0,${mt} ${ft},${mt}`,
91
- down: `${ft / 2},${Ct} 0,${Ct - mt} ${ft},${Ct - mt}`
92
- }, ra = (e) => {
94
+ down: `${ft / 2},${Nt} 0,${Nt - mt} ${ft},${Nt - mt}`
95
+ }, lo = (e) => {
93
96
  e.preventDefault(), e.stopPropagation();
94
- }, Hi = {
95
- onMouseDownCapture: ra,
96
- onMouseUpCapture: ra,
97
- onClickCapture: ra
98
- }, _i = "period-slider-step", Fi = `${_i} relative inline-flex size-[22px] shrink-0 items-center justify-center rounded-md after:absolute after:content-['']`, zi = "transition-colors motion-reduce:transition-none not-aria-disabled:cursor-pointer aria-disabled:cursor-not-allowed focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 dark:focus-visible:ring-blue-400 forced-colors:not-aria-disabled:hover:text-[Highlight] forced-colors:aria-disabled:text-[GrayText]", Bi = {
97
+ }, Ji = {
98
+ onMouseDownCapture: lo,
99
+ onMouseUpCapture: lo,
100
+ onClickCapture: lo
101
+ }, Qi = "period-slider-step", el = `${Qi} relative inline-flex size-[22px] shrink-0 items-center justify-center rounded-md after:absolute after:content-['']`, tl = "transition-colors motion-reduce:transition-none not-aria-disabled:cursor-pointer aria-disabled:cursor-not-allowed focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 dark:focus-visible:ring-blue-400 forced-colors:not-aria-disabled:hover:text-[Highlight] forced-colors:aria-disabled:text-[GrayText]", rl = {
99
102
  control: "text-slate-500 not-aria-disabled:hover:bg-slate-500/15 not-aria-disabled:hover:text-slate-900 not-aria-disabled:active:bg-slate-500/25 aria-disabled:text-slate-500/40 dark:text-slate-400 dark:not-aria-disabled:hover:text-slate-50 dark:aria-disabled:text-slate-400/40",
100
103
  rail: "border border-slate-300 bg-white text-slate-700 shadow-2xs not-aria-disabled:hover:border-slate-400 not-aria-disabled:hover:bg-slate-100 not-aria-disabled:hover:text-slate-900 not-aria-disabled:active:bg-slate-200 aria-disabled:border-slate-300/40 aria-disabled:bg-white/40 aria-disabled:text-slate-700/40 aria-disabled:shadow-none dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:not-aria-disabled:hover:border-slate-500 dark:not-aria-disabled:hover:bg-slate-700 dark:not-aria-disabled:hover:text-white dark:not-aria-disabled:active:bg-slate-600 dark:aria-disabled:border-slate-700/40 dark:aria-disabled:bg-slate-800/40 dark:aria-disabled:text-slate-200/40"
101
- }, sn = "after:inset-[calc((100%-var(--ps-target-size))/2)]", lo = { horizontal: "px-[19px]", vertical: "py-[19px]" }, Ui = {
104
+ }, mn = "after:inset-[calc((100%-var(--ps-target-size))/2)]", Ma = { horizontal: "px-[19px]", vertical: "py-[19px]" }, nl = {
102
105
  control: {
103
- left: sn,
104
- right: sn,
105
- up: sn,
106
- down: sn
106
+ left: mn,
107
+ right: mn,
108
+ up: mn,
109
+ down: mn
107
110
  },
108
111
  rail: {
109
112
  left: "after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:left-[calc(100%-var(--ps-target-size)+4px)] after:-right-[4px]",
@@ -111,23 +114,23 @@ const ao = 120, qn = "data-drag-snap", Zn = "--ps-drag-snap-duration", Hr = {
111
114
  up: "after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-[calc(100%-var(--ps-target-size)+4px)] after:-bottom-[4px]",
112
115
  down: "after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-[4px] after:bottom-[calc(100%-var(--ps-target-size)+4px)]"
113
116
  }
114
- }, Ut = ({ direction: e, neighbour: t, disabled: r, canStep: n, onStep: a, ariaLabel: i, className: l, ref: c }) => {
115
- const f = e === "up" || e === "down", g = f ? ft : Ct, D = f ? Ct : ft, R = r || !n;
116
- return /* @__PURE__ */ I(
117
+ }, Xt = ({ direction: e, neighbour: t, disabled: r, canStep: n, onStep: o, ariaLabel: i, className: l, ref: s }) => {
118
+ const g = e === "up" || e === "down", h = g ? ft : Nt, D = g ? Nt : ft, R = r || !n;
119
+ return /* @__PURE__ */ $(
117
120
  "button",
118
121
  {
119
- ref: c,
122
+ ref: s,
120
123
  type: "button",
121
124
  "aria-label": i,
122
125
  disabled: r,
123
126
  "aria-disabled": R ? !0 : void 0,
124
- ...R ? Hi : null,
125
- onClick: R ? void 0 : a,
126
- className: `${l === void 0 ? "" : `${l} `}${Fi} ${zi} ${Bi[t]} ${Ui[t][e]}`,
127
- children: /* @__PURE__ */ I("svg", { "aria-hidden": "true", focusable: "false", "data-arrow": e, width: g, height: D, viewBox: `0 0 ${g} ${D}`, fill: "currentColor", className: "pointer-events-none block shrink-0", children: /* @__PURE__ */ I("polygon", { points: Oi[e] }) })
127
+ ...R ? Ji : null,
128
+ onClick: R ? void 0 : o,
129
+ className: `${l === void 0 ? "" : `${l} `}${el} ${tl} ${rl[t]} ${nl[t][e]}`,
130
+ children: /* @__PURE__ */ $("svg", { "aria-hidden": "true", focusable: "false", "data-arrow": e, width: h, height: D, viewBox: `0 0 ${h} ${D}`, fill: "currentColor", className: "pointer-events-none block shrink-0", children: /* @__PURE__ */ $("polygon", { points: Zi[e] }) })
128
131
  }
129
132
  );
130
- }, Wi = {
133
+ }, ol = {
131
134
  "blue-rose": {
132
135
  macro: "#0284c7",
133
136
  macroLight: "#38bdf8",
@@ -170,149 +173,149 @@ const ao = 120, qn = "data-drag-snap", Zn = "--ps-drag-snap-duration", Hr = {
170
173
  microLight: "#71717a",
171
174
  accent: "#27272a"
172
175
  }
173
- }, et = (e) => e instanceof Date && !Number.isNaN(e.getTime()), De = (e) => e instanceof Date ? Number.isNaN(e.getTime()) ? "Invalid Date" : e.toISOString() : String(e), je = (e, t) => {
174
- if (!et(t)) throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${De(t)})`);
176
+ }, tt = (e) => e instanceof Date && !Number.isNaN(e.getTime()), ve = (e) => e instanceof Date ? Number.isNaN(e.getTime()) ? "Invalid Date" : e.toISOString() : String(e), Ze = (e, t) => {
177
+ if (!tt(t)) throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${ve(t)})`);
175
178
  const r = new Date(t.getTime());
176
179
  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;
177
180
  }, Q = (e, t) => {
178
- const r = je(e, t), n = r.getFullYear(), a = r.getMonth() + 1, i = r.getDate();
181
+ const r = Ze(e, t), n = r.getFullYear(), o = r.getMonth() + 1, i = r.getDate();
179
182
  if (e === "year") return n;
180
- if (e === "month") return n * 12 + (a - 1);
183
+ if (e === "month") return n * 12 + (o - 1);
181
184
  const l = /* @__PURE__ */ new Date(0);
182
- return l.setUTCFullYear(n, a - 1, i), l.setUTCHours(0, 0, 0, 0), Math.floor(l.getTime() / (1440 * 60 * 1e3));
183
- }, ie = (e, t) => {
185
+ return l.setUTCFullYear(n, o - 1, i), l.setUTCHours(0, 0, 0, 0), Math.floor(l.getTime() / (1440 * 60 * 1e3));
186
+ }, le = (e, t) => {
184
187
  const r = /* @__PURE__ */ new Date(0);
185
188
  if (r.setHours(0, 0, 0, 0), e === "year")
186
189
  return r.setFullYear(t, 0, 1), r;
187
190
  if (e === "month") {
188
- const a = Math.floor(t / 12), i = t - a * 12;
189
- return r.setFullYear(a, i, 1), r;
191
+ const o = Math.floor(t / 12), i = t - o * 12;
192
+ return r.setFullYear(o, i, 1), r;
190
193
  }
191
194
  const n = new Date(t * 24 * 60 * 60 * 1e3);
192
195
  return r.setFullYear(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()), r;
193
196
  }, Oe = (e, t, r) => {
194
- if (!et(t)) throw new RangeError(`addUnit: d must be a valid Date (received: ${De(t)})`);
195
- return e === "year" ? Si(t, r) : e === "month" ? yi(t, r) : gn(t, r);
196
- }, Xi = (e, t, r) => {
197
- if (!et(r)) throw new RangeError(`getMacroWindowStartDate: d must be a valid Date (received: ${De(r)})`);
198
- return je(t, je(e, r));
199
- }, Gi = (e, t, r) => {
200
- if (!et(r)) throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${De(r)})`);
197
+ if (!tt(t)) throw new RangeError(`addUnit: d must be a valid Date (received: ${ve(t)})`);
198
+ return e === "year" ? Yi(t, r) : e === "month" ? Oi(t, r) : vn(t, r);
199
+ }, al = (e, t, r) => {
200
+ if (!tt(r)) throw new RangeError(`getMacroWindowStartDate: d must be a valid Date (received: ${ve(r)})`);
201
+ return Ze(t, Ze(e, r));
202
+ }, il = (e, t, r) => {
203
+ if (!tt(r)) throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${ve(r)})`);
201
204
  if (e === t)
202
- return je(t, r);
203
- const n = r.getFullYear(), a = r.getMonth();
205
+ return Ze(t, r);
206
+ const n = r.getFullYear(), o = r.getMonth();
204
207
  if (e === "year") {
205
208
  if (t === "month")
206
209
  return new Date(n, 11, 1);
207
210
  if (t === "day")
208
211
  return new Date(n, 11, 31);
209
212
  }
210
- return e === "month" && t === "day" ? new Date(n, a + 1, 0) : je(t, r);
211
- }, so = (e, t, r) => e < t ? t : e > r ? r : e, xt = (e, t, r, n, a) => {
212
- if (_r("macroRange", r, "resolveMacroWindow"), !et(n)) throw new RangeError(`resolveMacroWindow: minDate must be a valid Date (received: ${De(n)})`);
213
- if (!et(a)) throw new RangeError(`resolveMacroWindow: maxDate must be a valid Date (received: ${De(a)})`);
214
- if (a.getTime() < n.getTime()) throw new RangeError(`resolveMacroWindow: maxDate must not precede minDate (minDate: ${De(n)}, maxDate: ${De(a)})`);
215
- return [je(t, so(Xi(e, t, r[0]), n, a)), je(t, so(Gi(e, t, r[1]), n, a))];
216
- }, Ki = {
213
+ return e === "month" && t === "day" ? new Date(n, o + 1, 0) : Ze(t, r);
214
+ }, xa = (e, t, r) => e < t ? t : e > r ? r : e, xt = (e, t, r, n, o) => {
215
+ if (zr("macroRange", r, "resolveMacroWindow"), !tt(n)) throw new RangeError(`resolveMacroWindow: minDate must be a valid Date (received: ${ve(n)})`);
216
+ if (!tt(o)) throw new RangeError(`resolveMacroWindow: maxDate must be a valid Date (received: ${ve(o)})`);
217
+ if (o.getTime() < n.getTime()) throw new RangeError(`resolveMacroWindow: maxDate must not precede minDate (minDate: ${ve(n)}, maxDate: ${ve(o)})`);
218
+ return [Ze(t, xa(al(e, t, r[0]), n, o)), Ze(t, xa(il(e, t, r[1]), n, o))];
219
+ }, ll = {
217
220
  year: { year: "numeric" },
218
221
  month: { year: "numeric", month: "2-digit" },
219
222
  day: { year: "numeric", month: "2-digit", day: "2-digit" }
220
- }, co = /* @__PURE__ */ new Map(), ji = (e, t) => {
221
- const r = `${e}\0${t}`, n = co.get(r);
223
+ }, Ra = /* @__PURE__ */ new Map(), sl = (e, t) => {
224
+ const r = `${e}\0${t}`, n = Ra.get(r);
222
225
  if (n !== void 0) return n;
223
- const a = new Intl.DateTimeFormat(t, Ki[e]);
224
- return co.set(r, a), a;
225
- }, qi = (e, t) => {
226
+ const o = new Intl.DateTimeFormat(t, ll[e]);
227
+ return Ra.set(r, o), o;
228
+ }, cl = (e, t) => {
226
229
  const r = String(t.getFullYear()).padStart(4, "0");
227
230
  if (e === "year") return r;
228
231
  const n = String(t.getMonth() + 1).padStart(2, "0");
229
232
  if (e === "month") return `${r}-${n}`;
230
- const a = String(t.getDate()).padStart(2, "0");
231
- return `${r}-${n}-${a}`;
232
- }, Ke = (e, t, r, n) => et(t) ? r ? r(t) : n === void 0 ? qi(e, t) : ji(e, n).format(t) : "", dr = (e, t, r, n) => Ke(e, t, r, n), be = (e, t, r) => {
233
+ const o = String(t.getDate()).padStart(2, "0");
234
+ return `${r}-${n}-${o}`;
235
+ }, qe = (e, t, r, n) => tt(t) ? r ? r(t) : n === void 0 ? cl(e, t) : sl(e, n).format(t) : "", gr = (e, t, r, n) => qe(e, t, r, n), ge = (e, t, r) => {
233
236
  if (!e || e.length === 0 || e.length === 1) return 0;
234
237
  const n = Q(r, t);
235
- let a = 0, i = e.length - 1;
236
- if (n <= Q(r, e[a])) return 0;
238
+ let o = 0, i = e.length - 1;
239
+ if (n <= Q(r, e[o])) return 0;
237
240
  if (n >= Q(r, e[i])) return i;
238
- for (; a <= i; ) {
239
- const f = a + i >> 1, g = Q(r, e[f]);
240
- if (g === n) return f;
241
- g < n ? a = f + 1 : i = f - 1;
241
+ for (; o <= i; ) {
242
+ const g = o + i >> 1, h = Q(r, e[g]);
243
+ if (h === n) return g;
244
+ h < n ? o = g + 1 : i = g - 1;
242
245
  }
243
- const l = Math.abs(Q(r, e[a]) - n), c = Math.abs(Q(r, e[i]) - n);
244
- return l < c ? a : i;
245
- }, Vt = (e, t, r, n) => {
246
+ const l = Math.abs(Q(r, e[o]) - n), s = Math.abs(Q(r, e[i]) - n);
247
+ return l < s ? o : i;
248
+ }, kt = (e, t, r, n) => {
246
249
  if (!Array.isArray(e) || e.length === 0) return [];
247
- const a = Q(t, r), i = Q(t, n), l = /* @__PURE__ */ new Map();
248
- for (const c of e) {
249
- const f = je(t, c), g = Q(t, f);
250
- g < a || g > i || l.has(g) || l.set(g, f);
250
+ const o = Q(t, r), i = Q(t, n), l = /* @__PURE__ */ new Map();
251
+ for (const s of e) {
252
+ const g = Ze(t, s), h = Q(t, g);
253
+ h < o || h > i || l.has(h) || l.set(h, g);
251
254
  }
252
255
  if (l.size === 0)
253
- throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${De(r)}, maxDate: ${De(n)}, entries: ${e.length})`);
254
- return Array.from(l.keys()).sort((c, f) => c - f).map((c) => l.get(c));
255
- }, cn = (e, t, r, n) => {
256
- const a = e.length - 1;
257
- if (a <= 0) return 0;
258
- const i = be(e, n, t);
256
+ throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${ve(r)}, maxDate: ${ve(n)}, entries: ${e.length})`);
257
+ return Array.from(l.keys()).sort((s, g) => s - g).map((s) => l.get(s));
258
+ }, fn = (e, t, r, n) => {
259
+ const o = e.length - 1;
260
+ if (o <= 0) return 0;
261
+ const i = ge(e, n, t);
259
262
  if (r === "time") {
260
- const l = e[0].getTime(), c = e[a].getTime() - l;
261
- return c <= 0 ? 0 : Math.max(0, Math.min(1, (e[i].getTime() - l) / c));
263
+ const l = e[0].getTime(), s = e[o].getTime() - l;
264
+ return s <= 0 ? 0 : Math.max(0, Math.min(1, (e[i].getTime() - l) / s));
262
265
  }
263
- return i / a;
264
- }, un = (e, t, r, n) => {
265
- const a = e.length - 1;
266
- if (a <= 0) return 0;
266
+ return i / o;
267
+ }, gn = (e, t, r, n) => {
268
+ const o = e.length - 1;
269
+ if (o <= 0) return 0;
267
270
  const i = Math.max(0, Math.min(1, n));
268
271
  if (r === "time") {
269
- const l = e[0].getTime(), c = e[a].getTime() - l;
270
- return c <= 0 ? 0 : be(e, new Date(l + i * c), t);
272
+ const l = e[0].getTime(), s = e[o].getTime() - l;
273
+ return s <= 0 ? 0 : ge(e, new Date(l + i * s), t);
271
274
  }
272
- return Math.max(0, Math.min(a, Math.round(i * a)));
273
- }, uo = (e, t, r, n, a, i, l) => {
274
- let c = r, f = n;
275
- return l ? (c = t, f = t) : e === "low" ? t > n ? (c = n, f = t) : c = t : t < r ? (f = r, c = t) : f = t, [Math.max(a, Math.min(i, c)), Math.max(a, Math.min(i, f))];
276
- }, Zi = ({ posDiffPct: e, startLowVal: t, startHighVal: r, rangeMin: n, rangeMax: a, isDiscrete: i, sortedAllowedDates: l, snapMode: c, unit: f }) => {
275
+ return Math.max(0, Math.min(o, Math.round(i * o)));
276
+ }, La = (e, t, r, n, o, i, l) => {
277
+ let s = r, g = n;
278
+ return l ? (s = t, g = t) : e === "low" ? t > n ? (s = n, g = t) : s = t : t < r ? (g = r, s = t) : g = t, [Math.max(o, Math.min(i, s)), Math.max(o, Math.min(i, g))];
279
+ }, ul = ({ posDiffPct: e, startLowVal: t, startHighVal: r, rangeMin: n, rangeMax: o, isDiscrete: i, sortedAllowedDates: l, snapMode: s, unit: g }) => {
277
280
  if (i) {
278
281
  const Z = l.length - 1;
279
282
  if (Z <= 0) return [0, 0];
280
283
  const ee = Math.max(0, Math.min(Z, Math.round(t))), x = Math.max(ee, Math.min(Z, Math.round(r)));
281
- if (c === "time") {
282
- const H = l[0].getTime(), W = l[Z].getTime(), oe = l[ee].getTime(), q = l[x].getTime() - oe;
283
- let X = oe + e * (W - H), y = X + q;
284
- X < H && (X = H, y = H + q), y > W && (y = W, X = W - q);
285
- const L = be(l, new Date(X), f), T = be(l, new Date(y), f);
286
- return [L, Math.max(L, T)];
284
+ if (s === "time") {
285
+ const O = l[0].getTime(), G = l[Z].getTime(), ie = l[ee].getTime(), j = l[x].getTime() - ie;
286
+ let X = ie + e * (G - O), S = X + j;
287
+ X < O && (X = O, S = O + j), S > G && (S = G, X = G - j);
288
+ const L = ge(l, new Date(X), g), y = ge(l, new Date(S), g);
289
+ return [L, Math.max(L, y)];
287
290
  }
288
291
  const ue = Math.round(e * Z);
289
- let ae = ee + ue, $ = x + ue;
290
- return ae < 0 && ($ += -ae, ae = 0), $ > Z && (ae -= $ - Z, $ = Z), [Math.max(0, Math.min(Z, ae)), Math.max(0, Math.min(Z, $))];
292
+ let ne = ee + ue, P = x + ue;
293
+ return ne < 0 && (P += -ne, ne = 0), P > Z && (ne -= P - Z, P = Z), [Math.max(0, Math.min(Z, ne)), Math.max(0, Math.min(Z, P))];
291
294
  }
292
- const g = (Z) => Math.max(n, Math.min(a, Z)), D = a - n;
293
- if (D <= 0) return [g(t), g(r)];
295
+ const h = (Z) => Math.max(n, Math.min(o, Z)), D = o - n;
296
+ if (D <= 0) return [h(t), h(r)];
294
297
  const R = Math.round(e * D);
295
- let s = t + R, S = r + R;
296
- return s < n && (S += n - s, s = n), S > a && (s -= S - a, S = a), [g(s), g(S)];
297
- }, Ji = (e, t, r, n, a, i, l, c) => {
298
- let f = 0, g = !1, D = !1;
298
+ let c = t + R, M = r + R;
299
+ return c < n && (M += n - c, c = n), M > o && (c -= M - o, M = o), [h(c), h(M)];
300
+ }, dl = (e, t, r, n, o, i, l, s) => {
301
+ let g = 0, h = !1, D = !1;
299
302
  switch (e) {
300
303
  case "ArrowRight":
301
304
  case "ArrowUp":
302
- f = c;
305
+ g = s;
303
306
  break;
304
307
  case "ArrowLeft":
305
308
  case "ArrowDown":
306
- f = -c;
309
+ g = -s;
307
310
  break;
308
311
  case "PageUp":
309
- f = c * 5;
312
+ g = s * 5;
310
313
  break;
311
314
  case "PageDown":
312
- f = -c * 5;
315
+ g = -s * 5;
313
316
  break;
314
317
  case "Home":
315
- g = !0;
318
+ h = !0;
316
319
  break;
317
320
  case "End":
318
321
  D = !0;
@@ -321,16 +324,16 @@ const ao = 120, qn = "data-drag-snap", Zn = "--ps-drag-snap-duration", Hr = {
321
324
  return null;
322
325
  }
323
326
  if (l) {
324
- let S = r;
325
- return g ? S = a : D ? S = i : S = Math.max(a, Math.min(i, r + f)), [S, S];
327
+ let M = r;
328
+ return h ? M = o : D ? M = i : M = Math.max(o, Math.min(i, r + g)), [M, M];
326
329
  }
327
- let R = r, s = n;
328
- return t === "low" ? g ? R = a : D ? R = n : R = Math.max(a, Math.min(n, r + f)) : g ? s = r : D ? s = i : s = Math.max(r, Math.min(i, n + f)), [R, s];
329
- }, $o = 8, Eo = 2, Io = 16, Qi = 12, el = 90, Co = (e, t, r) => {
330
- const n = r * Math.PI / 180, a = Math.abs(Math.sin(n)), i = Math.abs(Math.cos(n));
331
- return { alongPx: (e * i + t * a) / 2, acrossPx: (e * a + t * i) / 2 };
332
- }, ma = (e, t) => {
333
- const r = t?.estimatedHeightPx ?? Io, a = $o + (t?.anchorGapY ?? Eo) + r / 2, i = e === "top" ? -a : a;
330
+ let R = r, c = n;
331
+ return t === "low" ? h ? R = o : D ? R = n : R = Math.max(o, Math.min(n, r + g)) : h ? c = r : D ? c = i : c = Math.max(r, Math.min(i, n + g)), [R, c];
332
+ }, Ua = 8, Wa = 2, Ga = 16, ml = 12, fl = 90, Xa = (e, t, r) => {
333
+ const n = r * Math.PI / 180, o = Math.abs(Math.sin(n)), i = Math.abs(Math.cos(n));
334
+ return { alongPx: (e * i + t * o) / 2, acrossPx: (e * o + t * i) / 2 };
335
+ }, vo = (e, t) => {
336
+ const r = t?.estimatedHeightPx ?? Ga, o = Ua + (t?.anchorGapY ?? Wa) + r / 2, i = e === "top" ? -o : o;
334
337
  return {
335
338
  lowAngleDeg: 0,
336
339
  highAngleDeg: 0,
@@ -341,1148 +344,1181 @@ const ao = 120, qn = "data-drag-snap", Zn = "--ps-drag-snap-duration", Hr = {
341
344
  isSlanted: !1,
342
345
  proximity: 0
343
346
  };
344
- }, Vo = (e, t, r, n = "top", a) => {
345
- const i = a?.estimatedWidthPx, l = a?.estimatedHeightPx ?? Io, c = a?.paddingPx ?? Qi, f = a?.maxAngleDeg ?? el, g = $o + (a?.anchorGapY ?? Eo), D = ma(n, a);
347
+ }, Ka = (e, t, r, n = "top", o) => {
348
+ const i = o?.estimatedWidthPx, l = o?.estimatedHeightPx ?? Ga, s = o?.paddingPx ?? ml, g = o?.maxAngleDeg ?? fl, h = Ua + (o?.anchorGapY ?? Wa), D = vo(n, o);
346
349
  if (!(Number.isFinite(r) && r > 0) || i === void 0 || !Number.isFinite(i) || i <= 0) return D;
347
- const R = Math.max(0, t - e) / 100 * r, s = i + c;
348
- if (R >= s) return D;
349
- const S = Math.max(0, Math.min(1, (s - R) / s)), ee = S * S * S * (S * (S * 6 - 15) + 10) * f, x = n === "top" ? -ee : ee, ue = Co(i, l, ee), ae = g + ue.acrossPx, $ = n === "top" ? -ae : +ae, H = 2 * ue.alongPx, W = Math.max(0, (H + c - R) / 2);
350
+ const R = Math.max(0, t - e) / 100 * r, c = i + s;
351
+ if (R >= c) return D;
352
+ const M = Math.max(0, Math.min(1, (c - R) / c)), ee = M * M * M * (M * (M * 6 - 15) + 10) * g, x = n === "top" ? -ee : ee, ue = Xa(i, l, ee), ne = h + ue.acrossPx, P = n === "top" ? -ne : +ne, O = 2 * ue.alongPx, G = Math.max(0, (O + s - R) / 2);
350
353
  return {
351
354
  lowAngleDeg: x,
352
355
  highAngleDeg: x,
353
- lowOffsetX: -W,
354
- highOffsetX: W,
355
- lowOffsetY: $,
356
- highOffsetY: $,
357
- isSlanted: S > 1e-3,
358
- proximity: S
356
+ lowOffsetX: -G,
357
+ highOffsetX: G,
358
+ lowOffsetY: P,
359
+ highOffsetY: P,
360
+ isSlanted: M > 1e-3,
361
+ proximity: M
359
362
  };
360
- }, No = (e) => ({ ...e, lowOffsetX: 0, highOffsetX: 0 }), ko = (e, t) => {
363
+ }, ja = (e) => ({ ...e, lowOffsetX: 0, highOffsetX: 0 }), qa = (e, t) => {
361
364
  const r = t === "macro-top" || t === "macro-left", n = e < 0;
362
365
  return r && n || !(r || n) ? "macro" : "micro";
363
- }, tl = (e, t, r) => {
366
+ }, gl = (e, t, r) => {
364
367
  const n = Math.abs(e) > Math.abs(t) ? e : t;
365
368
  return !Number.isFinite(n) || n === 0 ? 0 : (r ? n < 0 : n > 0) ? 1 : -1;
366
369
  };
367
- function rl(e, t, r, n, a, i, l = "macro-top", c = 0.05, f = !0, g = "range") {
368
- if (ko(t, l) === "macro") {
369
- const s = Math.abs(e - r), S = Math.abs(e - n);
370
- return s <= c && s <= S ? "macro-low" : S <= c && S < s ? "macro-high" : f && e >= r && e <= n ? "macro-connect" : s < S ? "macro-low" : "macro-high";
370
+ function hl(e, t, r, n, o, i, l = "macro-top", s = 0.05, g = !0, h = "range") {
371
+ if (qa(t, l) === "macro") {
372
+ const c = Math.abs(e - r), M = Math.abs(e - n);
373
+ return c <= s && c <= M ? "macro-low" : M <= s && M < c ? "macro-high" : g && e >= r && e <= n ? "macro-connect" : c < M ? "macro-low" : "macro-high";
371
374
  }
372
- if (g === "point")
375
+ if (h === "point")
373
376
  return "micro-point";
374
- const D = Math.abs(e - a), R = Math.abs(e - i);
375
- return D <= c && D <= R ? "micro-low" : R <= c && R < D ? "micro-high" : f && e >= a && e <= i ? "micro-connect" : D < R ? "micro-low" : "micro-high";
377
+ const D = Math.abs(e - o), R = Math.abs(e - i);
378
+ return D <= s && D <= R ? "micro-low" : R <= s && R < D ? "micro-high" : g && e >= o && e <= i ? "micro-connect" : D < R ? "micro-low" : "micro-high";
376
379
  }
377
- function nl(e, t, r, n, a) {
380
+ function bl(e, t, r, n, o) {
378
381
  if (e === "macro-connect") {
379
- const [g, D] = ua(t - r, n, a);
380
- return [g, D, "macro-connect"];
382
+ const [h, D] = bo(t - r, n, o);
383
+ return [h, D, "macro-connect"];
381
384
  }
382
- const i = e === "macro-low" ? "low" : "high", [l, c] = hn(i, t, n, a), f = da(i, t, n, a);
383
- return [l, c, f === "low" ? "macro-low" : "macro-high"];
385
+ const i = e === "macro-low" ? "low" : "high", [l, s] = pn(i, t, n, o), g = wo(i, t, n, o);
386
+ return [l, s, g === "low" ? "macro-low" : "macro-high"];
384
387
  }
385
- function al(e, t, r, n, a) {
388
+ function wl(e, t, r, n, o) {
386
389
  if (e === "micro-point") {
387
- const [g] = hn("point", t, n, a);
388
- return [g, g, "micro-point"];
390
+ const [h] = pn("point", t, n, o);
391
+ return [h, h, "micro-point"];
389
392
  }
390
393
  if (e === "micro-connect") {
391
- const [g, D] = ua(t - r, n, a);
392
- return [g, D, "micro-connect"];
394
+ const [h, D] = bo(t - r, n, o);
395
+ return [h, D, "micro-connect"];
393
396
  }
394
- const i = e === "micro-low" ? "low" : "high", [l, c] = hn(i, t, n, a), f = da(i, t, n, a);
395
- return [l, c, f === "low" ? "micro-low" : "micro-high"];
397
+ const i = e === "micro-low" ? "low" : "high", [l, s] = pn(i, t, n, o), g = wo(i, t, n, o);
398
+ return [l, s, g === "low" ? "micro-low" : "micro-high"];
396
399
  }
397
- const Yr = zr(({ type: e, isTop: t = !0, isVertical: r = !1, isLeft: n = !0 }) => {
398
- let a, i;
399
- 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", i = `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", i = `period-slider-knob period-slider-knob-svg ${t ? "is-semicircle-top" : "is-semicircle-bottom"}`), /* @__PURE__ */ I("svg", { className: i, 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__ */ I("path", { d: a, className: e === "macro" ? "period-slider-knob-path-macro" : "period-slider-knob-path-micro", shapeRendering: "geometricPrecision", strokeWidth: "1.25" }) });
400
+ const Hr = Ur(({ type: e, isTop: t = !0, isVertical: r = !1, isLeft: n = !0 }) => {
401
+ let o, i;
402
+ return r ? (o = 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", i = `period-slider-knob period-slider-knob-svg is-vertical ${n ? "is-semicircle-left" : "is-semicircle-right"}`) : (o = 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", i = `period-slider-knob period-slider-knob-svg ${t ? "is-semicircle-top" : "is-semicircle-bottom"}`), /* @__PURE__ */ $("svg", { className: i, 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__ */ $("path", { d: o, className: e === "macro" ? "period-slider-knob-path-macro" : "period-slider-knob-path-micro", shapeRendering: "geometricPrecision", strokeWidth: "1.25" }) });
400
403
  });
401
- Yr.displayName = "VernierKnobSvg";
402
- const ol = (e, t) => {
403
- if (!et(e)) throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${De(e)})`);
404
- if (!et(t)) throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${De(t)})`);
404
+ Hr.displayName = "VernierKnobSvg";
405
+ const vl = (e, t) => {
406
+ if (!tt(e)) throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${ve(e)})`);
407
+ if (!tt(t)) throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${ve(t)})`);
405
408
  if (t.getTime() <= e.getTime())
406
- throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${De(e)}, maxDate: ${De(t)})`);
407
- }, _r = (e, t, r = "PeriodSlider") => {
409
+ throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${ve(e)}, maxDate: ${ve(t)})`);
410
+ }, zr = (e, t, r = "PeriodSlider") => {
408
411
  if (!Array.isArray(t) || t.length !== 2)
409
- throw new RangeError(`${r}: ${e} is required and must be a [start, end] Date tuple (received: ${De(t)})`);
410
- const [n, a] = t;
411
- if (!et(n)) throw new RangeError(`${r}: ${e}[0] must be a valid Date (received: ${De(n)})`);
412
- if (!et(a)) throw new RangeError(`${r}: ${e}[1] must be a valid Date (received: ${De(a)})`);
413
- if (a.getTime() < n.getTime())
414
- throw new RangeError(`${r}: ${e} must not be inverted (start: ${De(n)}, end: ${De(a)})`);
415
- }, sa = (e, t) => {
416
- if (!et(t)) throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${De(t)})`);
417
- }, Mt = (e, t, r, n, a) => {
412
+ throw new RangeError(`${r}: ${e} is required and must be a [start, end] Date tuple (received: ${ve(t)})`);
413
+ const [n, o] = t;
414
+ if (!tt(n)) throw new RangeError(`${r}: ${e}[0] must be a valid Date (received: ${ve(n)})`);
415
+ if (!tt(o)) throw new RangeError(`${r}: ${e}[1] must be a valid Date (received: ${ve(o)})`);
416
+ if (o.getTime() < n.getTime())
417
+ throw new RangeError(`${r}: ${e} must not be inverted (start: ${ve(n)}, end: ${ve(o)})`);
418
+ }, go = (e, t) => {
419
+ if (!tt(t)) throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${ve(t)})`);
420
+ }, Mt = (e, t, r, n, o) => {
418
421
  const i = Q(r, t);
419
- if (i < Q(r, n) || i > Q(r, a))
420
- throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${De(t)}, minDate: ${De(n)}, maxDate: ${De(a)})`);
421
- }, il = (e, t, r) => {
422
+ if (i < Q(r, n) || i > Q(r, o))
423
+ throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${ve(t)}, minDate: ${ve(n)}, maxDate: ${ve(o)})`);
424
+ }, pl = (e, t, r) => {
422
425
  if (e.mode === "range") {
423
426
  for (const n of ["range", "defaultRange"]) {
424
- const a = e[n];
425
- a !== void 0 && (_r(n, a), Mt(`${n}[0]`, a[0], e.unit, t, r), Mt(`${n}[1]`, a[1], e.unit, t, r));
427
+ const o = e[n];
428
+ o !== void 0 && (zr(n, o), Mt(`${n}[0]`, o[0], e.unit, t, r), Mt(`${n}[1]`, o[1], e.unit, t, r));
426
429
  }
427
430
  return;
428
431
  }
429
432
  if (e.mode === "point")
430
433
  for (const n of ["value", "defaultValue"]) {
431
- const a = e[n];
432
- a !== void 0 && (sa(n, a), Mt(n, a, e.unit, t, r));
434
+ const o = e[n];
435
+ o !== void 0 && (go(n, o), Mt(n, o, e.unit, t, r));
433
436
  }
434
- }, ll = (e, t, r) => {
435
- _r("macroRange", e.macroRange);
436
- const n = e.microUnit ?? e.unit, a = e.microRange !== void 0 || e.defaultMicroRange !== void 0 || e.onChangeMicroRange !== void 0, i = e.microValue !== void 0 || e.defaultMicroValue !== void 0 || e.onChangeMicroPoint !== void 0;
437
- if (a && i)
437
+ }, Dl = (e, t, r) => {
438
+ zr("macroRange", e.macroRange);
439
+ const n = e.microUnit ?? e.unit, o = e.microRange !== void 0 || e.defaultMicroRange !== void 0 || e.onChangeMicroRange !== void 0, i = e.microValue !== void 0 || e.defaultMicroValue !== void 0 || e.onChangeMicroPoint !== void 0;
440
+ if (o && i)
438
441
  throw new RangeError("PeriodSlider: vernier mode takes either a micro range (microRange / defaultMicroRange / onChangeMicroRange) or a micro point (microValue / defaultMicroValue / onChangeMicroPoint), never both");
439
442
  if (i) {
440
443
  if (e.microValue !== void 0)
441
- return sa("microValue", e.microValue), Mt("microValue", e.microValue, n, t, r), { shape: "point", selection: [e.microValue, e.microValue] };
444
+ return go("microValue", e.microValue), Mt("microValue", e.microValue, n, t, r), { shape: "point", selection: [e.microValue, e.microValue] };
442
445
  if (e.defaultMicroValue !== void 0)
443
- return sa("defaultMicroValue", e.defaultMicroValue), Mt("defaultMicroValue", e.defaultMicroValue, n, t, r), { shape: "point", selection: [e.defaultMicroValue, e.defaultMicroValue] };
446
+ return go("defaultMicroValue", e.defaultMicroValue), Mt("defaultMicroValue", e.defaultMicroValue, n, t, r), { shape: "point", selection: [e.defaultMicroValue, e.defaultMicroValue] };
444
447
  throw new RangeError("PeriodSlider: vernier point mode requires a micro selection; supply microValue (controlled) or defaultMicroValue (uncontrolled)");
445
448
  }
446
449
  if (e.microRange !== void 0)
447
- return _r("microRange", e.microRange), Mt("microRange[0]", e.microRange[0], n, t, r), Mt("microRange[1]", e.microRange[1], n, t, r), { shape: "range", selection: e.microRange };
450
+ return zr("microRange", e.microRange), Mt("microRange[0]", e.microRange[0], n, t, r), Mt("microRange[1]", e.microRange[1], n, t, r), { shape: "range", selection: e.microRange };
448
451
  if (e.defaultMicroRange !== void 0)
449
- return _r("defaultMicroRange", e.defaultMicroRange), Mt("defaultMicroRange[0]", e.defaultMicroRange[0], n, t, r), Mt("defaultMicroRange[1]", e.defaultMicroRange[1], n, t, r), { shape: "range", selection: e.defaultMicroRange };
450
- throw a ? new RangeError("PeriodSlider: vernier range mode requires a micro selection; supply microRange (controlled) or defaultMicroRange (uncontrolled)") : new RangeError("PeriodSlider: vernier mode requires a micro selection; supply microRange / defaultMicroRange for a period, or microValue / defaultMicroValue for a point");
451
- }, Nr = (e, t, r, n, a, i, l, c) => {
452
- const f = be(e, n, t), g = be(e, a, t);
453
- return l ? f : c ? g : Math.max(f, Math.min(g, be(e, r, t) + i));
454
- }, na = (e) => {
452
+ return zr("defaultMicroRange", e.defaultMicroRange), Mt("defaultMicroRange[0]", e.defaultMicroRange[0], n, t, r), Mt("defaultMicroRange[1]", e.defaultMicroRange[1], n, t, r), { shape: "range", selection: e.defaultMicroRange };
453
+ throw o ? new RangeError("PeriodSlider: vernier range mode requires a micro selection; supply microRange (controlled) or defaultMicroRange (uncontrolled)") : new RangeError("PeriodSlider: vernier mode requires a micro selection; supply microRange / defaultMicroRange for a period, or microValue / defaultMicroValue for a point");
454
+ }, Yr = (e, t, r, n, o, i, l, s) => {
455
+ const g = ge(e, n, t), h = ge(e, o, t);
456
+ return l ? g : s ? h : Math.max(g, Math.min(h, ge(e, r, t) + i));
457
+ }, so = (e) => {
455
458
  e.timerId !== null && clearTimeout(e.timerId), e.timerId = null, e.emit = null;
456
- }, sl = (e, t) => {
459
+ }, Sa = () => {
460
+ const [e, t] = Pe(null), r = V(null), n = z((i, l) => {
461
+ const s = r.current;
462
+ if (s !== null && s[0].getTime() === i.getTime() && s[1].getTime() === l.getTime()) return;
463
+ const g = [i, l];
464
+ r.current = g, t(g);
465
+ }, []), o = z(() => {
466
+ r.current !== null && (r.current = null, t(null));
467
+ }, []);
468
+ return { shown: e, show: n, release: o };
469
+ }, Ml = (e, t) => {
457
470
  try {
458
471
  Intl.DateTimeFormat.supportedLocalesOf([t]);
459
472
  } catch {
460
473
  throw new RangeError(`PeriodSlider: ${e} must be a valid BCP 47 language tag (received: ${JSON.stringify(t)})`);
461
474
  }
462
- }, mr = () => {
463
- const [e, t] = ye(null), r = O(null), n = U((a) => {
464
- if (r.current?.disconnect(), r.current = null, a === null) {
475
+ }, hr = () => {
476
+ const [e, t] = Pe(null), r = V(null), n = z((o) => {
477
+ if (r.current?.disconnect(), r.current = null, o === null) {
465
478
  t(null);
466
479
  return;
467
480
  }
468
481
  if (typeof ResizeObserver > "u") return;
469
482
  const i = new ResizeObserver((l) => {
470
- for (const c of l) {
471
- const f = c.borderBoxSize?.[0];
472
- f !== void 0 && t((g) => g !== null && Math.abs(g.widthPx - f.inlineSize) < 0.5 && Math.abs(g.heightPx - f.blockSize) < 0.5 ? g : { widthPx: f.inlineSize, heightPx: f.blockSize });
483
+ for (const s of l) {
484
+ const g = s.borderBoxSize?.[0];
485
+ g !== void 0 && t((h) => h !== null && Math.abs(h.widthPx - g.inlineSize) < 0.5 && Math.abs(h.heightPx - g.blockSize) < 0.5 ? h : { widthPx: g.inlineSize, heightPx: g.blockSize });
473
486
  }
474
487
  });
475
- i.observe(a), r.current = i;
488
+ i.observe(o), r.current = i;
476
489
  }, []);
477
- return Dt(
490
+ return it(
478
491
  () => () => {
479
492
  r.current?.disconnect(), r.current = null;
480
493
  },
481
494
  []
482
495
  ), [n, e];
483
- }, aa = (e, t) => {
484
- const r = fn(e, t);
496
+ }, co = (e, t) => {
497
+ const r = wn(e, t);
485
498
  return r === null ? void 0 : { estimatedWidthPx: r.widthPx, estimatedHeightPx: r.heightPx };
486
- }, fn = (e, t) => e === null || t === null ? null : { widthPx: Math.max(e.widthPx, t.widthPx), heightPx: Math.max(e.heightPx, t.heightPx) }, cl = (e) => {
499
+ }, wn = (e, t) => e === null || t === null ? null : { widthPx: Math.max(e.widthPx, t.widthPx), heightPx: Math.max(e.heightPx, t.heightPx) }, xl = (e) => {
487
500
  const t = {};
488
501
  let r = 0;
489
- for (const a of e) {
490
- const { side: i, box: l } = a;
502
+ for (const o of e) {
503
+ const { side: i, box: l } = o;
491
504
  if (l === null) continue;
492
- let c;
493
- if (a.reach === "inline-size")
494
- c = l.widthPx, r = Math.max(r, l.heightPx / 2);
505
+ let s;
506
+ if (o.reach === "inline-size")
507
+ s = l.widthPx, r = Math.max(r, l.heightPx / 2);
495
508
  else {
496
- const f = Co(l.widthPx, l.heightPx, a.angleDeg);
497
- c = a.centreOffsetPx === null ? 2 * f.acrossPx : Math.abs(a.centreOffsetPx) + f.acrossPx, r = Math.max(r, f.alongPx + Math.abs(a.alongPushPx));
509
+ const g = Xa(l.widthPx, l.heightPx, o.angleDeg);
510
+ s = o.centreOffsetPx === null ? 2 * g.acrossPx : Math.abs(o.centreOffsetPx) + g.acrossPx, r = Math.max(r, g.alongPx + Math.abs(o.alongPushPx));
498
511
  }
499
- t[`--ps-label-reach-${i}`] = `${Math.ceil(c)}px`;
512
+ t[`--ps-label-reach-${i}`] = `${Math.ceil(s)}px`;
500
513
  }
501
514
  if (Object.keys(t).length === 0) return;
502
515
  const n = Math.ceil(r);
503
516
  return t["--ps-label-reach-main"] = `${n}px`, { style: t, mainPx: n };
504
- }, mo = (e, t, r) => ({
517
+ }, ya = (e, t, r) => ({
505
518
  tx: `calc(-50% + ${e}px)`,
506
519
  ty: `${t}px`,
507
520
  rot: `${r}deg`
508
- }), fo = (e, t, r) => ({
521
+ }), Ta = (e, t, r) => ({
509
522
  tx: `calc(-50% + ${e}px)`,
510
523
  ty: `calc(-50% + ${t}px)`,
511
524
  rot: `${r}deg`
512
- }), bn = (e, t) => ({
513
- "--ps-tooltip-tx": Jn(e, "tx", t.tx),
514
- "--ps-tooltip-ty": Jn(e, "ty", t.ty),
515
- "--ps-tooltip-rot": Jn(e, "rot", t.rot)
516
- }), oa = (e, t, r, n) => {
517
- const a = ma(n.labelPosition, n.config);
518
- if (!n.isSlantable) return { slant: a, lowStyle: void 0, highStyle: void 0, placements: null };
519
- const i = Vo(t * 100, r * 100, n.trackLengthPx, n.labelPosition, n.config), l = n.isMerged ? No(i) : i, c = xn[e], f = {
520
- low: mo(l.lowOffsetX, l.lowOffsetY - a.lowOffsetY, l.lowAngleDeg),
521
- high: mo(l.highOffsetX, l.highOffsetY - a.highOffsetY, l.highAngleDeg)
525
+ }), Dn = (e, t) => ({
526
+ "--ps-tooltip-tx": no(e, "tx", t.tx),
527
+ "--ps-tooltip-ty": no(e, "ty", t.ty),
528
+ "--ps-tooltip-rot": no(e, "rot", t.rot)
529
+ }), uo = (e, t, r, n) => {
530
+ const o = vo(n.labelPosition, n.config);
531
+ if (!n.isSlantable) return { slant: o, lowStyle: void 0, highStyle: void 0, placements: null };
532
+ const i = Ka(t * 100, r * 100, n.trackLengthPx, n.labelPosition, n.config), l = n.isMerged ? ja(i) : i, s = yn[e], g = {
533
+ low: ya(l.lowOffsetX, l.lowOffsetY - o.lowOffsetY, l.lowAngleDeg),
534
+ high: ya(l.highOffsetX, l.highOffsetY - o.highOffsetY, l.highAngleDeg)
522
535
  };
523
536
  return {
524
537
  slant: l,
525
- lowStyle: bn(c.low, f.low),
526
- highStyle: bn(c.high, f.high),
527
- placements: f
538
+ lowStyle: Dn(s.low, g.low),
539
+ highStyle: Dn(s.high, g.high),
540
+ placements: g
528
541
  };
529
- }, go = {
542
+ }, Pa = {
530
543
  "--ps-tooltip-origin": "100% 50%",
531
544
  "--ps-tooltip-tx": "0px",
532
545
  "--ps-tooltip-ty": "-50%",
533
546
  "--ps-tooltip-rot": "0deg"
534
- }, ho = (e, t, r) => {
535
- const n = ma(r.labelPosition, r.config);
536
- if (r.isVertical) return { slant: n, lowStyle: go, highStyle: go, placements: null };
537
- const a = r.autoSlantLabels && !r.isPointMode;
547
+ }, Aa = (e, t, r) => {
548
+ const n = vo(r.labelPosition, r.config);
549
+ if (r.isVertical) return { slant: n, lowStyle: Pa, highStyle: Pa, placements: null };
550
+ const o = r.autoSlantLabels && !r.isPointMode;
538
551
  let i = n;
539
- if (a) {
540
- const f = Vo(e, t, r.trackLengthPx, r.labelPosition, r.config);
541
- i = r.isMerged ? No(f) : f;
552
+ if (o) {
553
+ const g = Ka(e, t, r.trackLengthPx, r.labelPosition, r.config);
554
+ i = r.isMerged ? ja(g) : g;
542
555
  }
543
- const l = xn.flat, c = {
544
- low: fo(i.lowOffsetX, i.lowOffsetY, i.lowAngleDeg),
545
- high: fo(i.highOffsetX, i.highOffsetY, i.highAngleDeg)
556
+ const l = yn.flat, s = {
557
+ low: Ta(i.lowOffsetX, i.lowOffsetY, i.lowAngleDeg),
558
+ high: Ta(i.highOffsetX, i.highOffsetY, i.highAngleDeg)
546
559
  };
547
560
  return {
548
561
  slant: i,
549
- lowStyle: { "--ps-tooltip-origin": "50% 50%", ...bn(l.low, c.low) },
550
- highStyle: { "--ps-tooltip-origin": "50% 50%", ...bn(l.high, c.high) },
551
- placements: a ? c : null
562
+ lowStyle: { "--ps-tooltip-origin": "50% 50%", ...Dn(l.low, s.low) },
563
+ highStyle: { "--ps-tooltip-origin": "50% 50%", ...Dn(l.high, s.high) },
564
+ placements: o ? s : null
552
565
  };
553
- }, ul = {
566
+ }, Rl = {
554
567
  horizontal: { decrease: "left", increase: "right" },
555
568
  vertical: { decrease: "down", increase: "up" }
556
- }, dl = {
569
+ }, Ll = {
557
570
  horizontal: { decrease: "period-slider-stepper-prev", increase: "period-slider-stepper-next" },
558
571
  vertical: { decrease: "period-slider-stepper-prev period-slider-stepper-down", increase: "period-slider-stepper-next period-slider-stepper-up" }
559
- }, bo = { horizontal: "px-[calc(var(--ps-target-size)/2)]", vertical: "py-[calc(var(--ps-target-size)/2)]" }, ml = {
560
- horizontal: { withSteppers: `grid-cols-[auto_minmax(0,1fr)_auto] ${Fr} ${lo.horizontal}`, railOnly: `grid-cols-[minmax(0,1fr)] ${bo.horizontal}` },
561
- vertical: { withSteppers: `grid-rows-[auto_minmax(0,1fr)_auto] ${Fr} ${lo.vertical}`, railOnly: `grid-rows-[minmax(0,1fr)] ${bo.vertical}` }
562
- }, wo = {
572
+ }, $a = { horizontal: "px-[calc(var(--ps-target-size)/2)]", vertical: "py-[calc(var(--ps-target-size)/2)]" }, Sl = {
573
+ horizontal: { withSteppers: `grid-cols-[auto_minmax(0,1fr)_auto] ${Br} ${Ma.horizontal}`, railOnly: `grid-cols-[minmax(0,1fr)] ${$a.horizontal}` },
574
+ vertical: { withSteppers: `grid-rows-[auto_minmax(0,1fr)_auto] ${Br} ${Ma.vertical}`, railOnly: `grid-rows-[minmax(0,1fr)] ${$a.vertical}` }
575
+ }, Ea = {
563
576
  horizontal: { leading: "col-start-1 row-start-1", rail: "col-start-2 row-start-1", railOnly: "col-start-1 row-start-1", trailing: "col-start-3 row-start-1" },
564
577
  vertical: { leading: "col-start-1 row-start-1", rail: "col-start-1 row-start-2", railOnly: "col-start-1 row-start-1", trailing: "col-start-1 row-start-3" }
565
- }, vo = (e, t) => {
578
+ }, Ia = (e, t) => {
566
579
  e.setPointerCapture(t);
567
- }, fl = (e) => {
580
+ }, yl = (e) => {
568
581
  const {
569
582
  unit: t,
570
583
  minDate: r,
571
584
  maxDate: n,
572
- allowedDates: a,
585
+ allowedDates: o,
573
586
  snapMode: i = "index",
574
587
  disabled: l = !1,
575
- className: c = "",
576
- showStepper: f = !0,
577
- tooltipStyle: g = "always",
588
+ className: s = "",
589
+ showStepper: g = !0,
590
+ tooltipStyle: h = "always",
578
591
  labelPosition: D = "top",
579
592
  autoSlantLabels: R = !0,
580
- isVertical: s = !1,
581
- hideConnectBar: S = !1,
593
+ isVertical: c = !1,
594
+ hideConnectBar: M = !1,
582
595
  showTicks: Z = !1,
583
596
  colorScheme: ee = "blue-rose",
584
597
  locale: x,
585
598
  decreaseAriaLabel: ue = "Decrease",
586
- increaseAriaLabel: ae = "Increase"
599
+ increaseAriaLabel: ne = "Increase"
587
600
  } = e;
588
- ol(r, n), il(e, r, n), x !== void 0 && sl("locale", x);
589
- const $ = e.mode === "vernier" ? ll(e, r, n) : null, H = $ !== null && $.shape === "point", W = Wi[ee], oe = Ti(), q = O(e), X = r.getTime(), y = n.getTime(), L = C(() => Vt(a, t, r, n), [a, t, X, y]), T = L.length > 0, { rangeMin: k, rangeMax: V } = C(() => T ? { rangeMin: 0, rangeMax: L.length - 1 } : { rangeMin: Q(t, r), rangeMax: Q(t, n) }, [T, L, t, X, y]), ne = e.mode === "point", ce = U(
590
- (o) => {
591
- if (T) {
592
- const u = Math.max(0, Math.min(L.length - 1, Math.round(o)));
601
+ vl(r, n), pl(e, r, n), x !== void 0 && Ml("locale", x);
602
+ const P = e.mode === "vernier" ? Dl(e, r, n) : null, O = P !== null && P.shape === "point", G = ol[ee], ie = Hi(), j = V(e), X = r.getTime(), S = n.getTime(), L = E(() => kt(o, t, r, n), [o, t, X, S]), y = L.length > 0, { rangeMin: k, rangeMax: I } = E(() => y ? { rangeMin: 0, rangeMax: L.length - 1 } : { rangeMin: Q(t, r), rangeMax: Q(t, n) }, [y, L, t, X, S]), re = e.mode === "point", ce = z(
603
+ (a) => {
604
+ if (y) {
605
+ const u = Math.max(0, Math.min(L.length - 1, Math.round(a)));
593
606
  return L[u];
594
607
  }
595
- return ie(t, Math.round(o));
608
+ return le(t, Math.round(a));
596
609
  },
597
- [T, L, t]
598
- ), G = U(
599
- (o) => {
600
- if (o === void 0) return k;
601
- const u = je(t, o);
602
- return T ? be(L, u, t) : Q(t, u);
610
+ [y, L, t]
611
+ ), K = z(
612
+ (a) => {
613
+ if (a === void 0) return k;
614
+ const u = Ze(t, a);
615
+ return y ? ge(L, u, t) : Q(t, u);
603
616
  },
604
- [T, L, t, k]
605
- ), [J, z] = ye(() => $ === null ? null : $.selection);
606
- let _ = J ?? ($ === null ? null : $.selection);
607
- if (H && _ !== null && _[0].getTime() !== _[1].getTime()) {
608
- const o = [_[0], _[0]];
609
- _ = o, z(o);
617
+ [y, L, t, k]
618
+ ), [J, B] = Pe(() => P === null ? null : P.selection);
619
+ let H = J ?? (P === null ? null : P.selection);
620
+ if (O && H !== null && H[0].getTime() !== H[1].getTime()) {
621
+ const a = [H[0], H[0]];
622
+ H = a, B(a);
610
623
  }
611
- const me = e.mode === "vernier" ? e.microValue?.getTime() : void 0, ge = C(() => e.mode !== "vernier" || e.microValue === void 0 ? null : [e.microValue, e.microValue], [e.mode, me]), le = e.mode !== "vernier" ? null : H ? ge ?? _ : e.microRange !== void 0 ? e.microRange : _, ze = e.mode === "range" ? e.range?.[0] ?? e.defaultRange?.[0] : e.mode === "vernier" ? le?.[0] : void 0, Ee = e.mode === "range" ? e.range?.[1] ?? e.defaultRange?.[1] : e.mode === "vernier" ? le?.[1] : void 0, Te = e.mode === "point" ? e.value ?? e.defaultValue : void 0, Pe = e.mode === "point" ? Te?.getTime() : ze?.getTime(), qe = e.mode === "range" ? Ee?.getTime() : Pe, [Be, tt] = C(() => {
624
+ const de = e.mode === "vernier" ? e.microValue?.getTime() : void 0, me = E(() => e.mode !== "vernier" || e.microValue === void 0 ? null : [e.microValue, e.microValue], [e.mode, de]), De = Sa(), Ge = Sa(), Me = e.mode !== "vernier" ? null : O ? me ?? H : e.microRange !== void 0 ? e.microRange : H, pe = Me === null ? null : Ge.shown ?? Me, Le = e.mode === "range" ? e.range?.[0] ?? e.defaultRange?.[0] : e.mode === "vernier" ? pe?.[0] : void 0, He = e.mode === "range" ? e.range?.[1] ?? e.defaultRange?.[1] : e.mode === "vernier" ? pe?.[1] : void 0, Fe = e.mode === "point" ? e.value ?? e.defaultValue : void 0, rt = e.mode === "point" ? Fe?.getTime() : Le?.getTime(), ht = e.mode === "range" ? He?.getTime() : rt, [lt, q] = E(() => {
612
625
  if (e.mode === "point") {
613
- const d = G(Te);
614
- return [d, d];
626
+ const m = K(Fe);
627
+ return [m, m];
615
628
  }
616
- const o = G(ze), u = G(Ee);
617
- return [Math.min(o, u), Math.max(o, u)];
618
- }, [e.mode, Pe, qe, G, Te, ze, Ee]), Ue = e.mode === "point" ? e.value !== void 0 : e.mode === "range" ? e.range !== void 0 : H ? e.microValue !== void 0 : e.microRange !== void 0, [it, K] = ye(() => [Be, tt]), [B, te] = ye(null), [v, Y] = ye(null), p = O(null), [j, de] = ye("high"), [we, Ae] = ye(null), [He, rt] = ye(null), ve = B ? B[0] : Ue ? Be : it[0], pe = B ? B[1] : Ue ? tt : it[1], Br = O([ve, pe]), fe = e.mode === "vernier", Nt = e.mode === "vernier" ? e.vernierOrientation ?? (s ? "macro-left" : "macro-top") : "macro-top", A = Nt === "macro-top" || Nt === "macro-left", Wt = e.mode === "vernier" ? e.showVernierProjection ?? !0 : !1, fa = e.mode === "vernier" ? e.showVernierTicks ?? !0 : !1, w = e.mode === "vernier" ? e.showHairline ?? !0 : !1, h = fe ? e.macroUnit ?? t : t, b = fe ? e.microUnit ?? t : t, wr = fe ? e.macroIsDiscrete ?? !1 : T, ht = fe ? e.microIsDiscrete ?? !1 : T, lt = fe ? e.macroAllowedDates ?? a : a, ga = fe ? e.microAllowedDates ?? a : a, Ur = fe ? e.formatMacroLabel ?? e.formatLabel : e.formatLabel, Wr = fe ? e.formatMicroLabel ?? e.formatLabel : e.formatLabel, Yo = e.mode === "vernier" ? e.macroRange[0].getTime() : void 0, Oo = e.mode === "vernier" ? e.macroRange[1].getTime() : void 0, Ho = ze?.getTime(), _o = Ee?.getTime(), [We, Xr] = ye(null), Rt = O(null), [vr, Xt] = ye(() => H ? "micro-point" : "micro-high");
619
- let Ne = vr;
620
- const Sn = H ? vr === "micro-low" || vr === "micro-high" || vr === "micro-connect" ? "micro-point" : null : vr === "micro-point" ? "micro-high" : null;
621
- Sn !== null && (Ne = Sn, Xt(Sn));
622
- const Ie = C(() => Q(h, r), [X, h]), Ze = C(() => {
623
- const o = Q(h, n);
624
- if (fe && o <= Ie)
625
- throw new RangeError(`PeriodSlider: macroUnit "${h}" cannot distinguish minDate from maxDate (minDate: ${De(r)}, maxDate: ${De(n)})`);
626
- return o;
627
- }, [fe, X, y, Ie, h]), Le = C(() => fe ? Vt(lt, h, r, n) : [], [fe, lt, h, X, y]), ke = C(() => e.mode !== "vernier" ? Ie : Math.max(Ie, Math.min(Ze, Q(h, e.macroRange[0]))), [e.mode, Yo, Ie, Ze, h]), Ye = C(() => e.mode !== "vernier" ? Ze : Math.max(Ie, Math.min(Ze, Q(h, e.macroRange[1]))), [e.mode, Oo, Ie, Ze, h]), bt = C(() => ie(h, ke), [h, ke]), kt = C(() => ie(h, Ye), [h, Ye]), Gr = C(() => e.mode !== "vernier" ? [r, n] : xt(h, b, [bt, kt], r, n), [e.mode, bt, kt, h, b, X, y]), xe = C(() => Q(b, Gr[0]), [b, Gr]), $e = C(() => Q(b, Gr[1]), [b, Gr]), ha = C(() => fe ? Vt(ga, b, r, n) : [], [fe, ga, b, X, y]), yn = (o, u) => ha.filter((d) => {
628
- const m = Q(b, d);
629
- return m >= o && m <= u;
630
- }), se = C(() => yn(xe, $e), [ha, b, xe, $e]), Gt = wr && Le.length > 0, nt = ht && se.length > 0, Lt = (o, u, d, m) => u.length > 0 ? Q(b, u[be(u, o, b)]) : Math.max(d, Math.min(m, Q(b, o))), Kt = nt ? se : [], Ce = C(() => le === null ? xe : Lt(le[0], Kt, xe, $e), [Ho, xe, $e, b, le, Kt]), _e = C(() => le === null ? $e : Lt(le[1], Kt, xe, $e), [_o, xe, $e, b, le, Kt]), St = C(() => ie(b, Ce), [b, Ce]), yt = C(() => ie(b, _e), [b, _e]), ba = !fe || le === null ? null : { macroUnit: h, macroLowEnc: ke, macroHighEnc: Ye, microUnit: b, microLowEnc: Q(b, le[0]), microHighEnc: Q(b, le[1]) }, Tn = O(ba), Kr = Math.max(1, Ze - Ie), at = Gt ? cn(Le, h, i, bt) : Math.max(0, Math.min(1, (ke - Ie) / Kr)), st = Math.max(at, Gt ? cn(Le, h, i, kt) : Math.min(1, (Ye - Ie) / Kr)), jr = Math.max(1, $e - xe), jt = nt ? cn(se, b, i, St) : Math.max(0, Math.min(1, (Ce - xe) / jr)), pr = Math.max(jt, nt ? cn(se, b, i, yt) : Math.min(1, (_e - xe) / jr)), Pn = O({ timerId: null, emit: null }), qr = O({ timerId: null, emit: null }), Zr = O({ timerId: null, emit: null });
631
- Dt(() => {
632
- const o = [Pn, qr, Zr];
629
+ const a = K(Le), u = K(He);
630
+ return [Math.min(a, u), Math.max(a, u)];
631
+ }, [e.mode, rt, ht, K, Fe, Le, He]), U = e.mode === "point" ? e.value !== void 0 : e.mode === "range" ? e.range !== void 0 : O ? e.microValue !== void 0 : e.microRange !== void 0, [oe, p] = Pe(() => [lt, q]), [N, v] = Pe(null), [Y, he] = Pe(null), be = V(null), [$e, Ie] = Pe("high"), [_e, Rt] = Pe(null), [bt, Wr] = Pe(null), Se = N ? N[0] : U ? lt : oe[0], ye = N ? N[1] : U ? q : oe[1], Gr = V([Se, ye]), ae = e.mode === "vernier", Kt = e.mode === "vernier" ? e.vernierOrientation ?? (c ? "macro-left" : "macro-top") : "macro-top", d = Kt === "macro-top" || Kt === "macro-left", W = e.mode === "vernier" ? e.showVernierProjection ?? !0 : !1, je = e.mode === "vernier" ? e.showVernierTicks ?? !0 : !1, Lt = e.mode === "vernier" ? e.showHairline ?? !0 : !1, F = ae ? e.macroUnit ?? t : t, b = ae ? e.microUnit ?? t : t, An = ae ? e.macroIsDiscrete ?? !1 : y, Dr = ae ? e.microIsDiscrete ?? !1 : y, po = ae ? e.macroAllowedDates ?? o : o, Do = ae ? e.microAllowedDates ?? o : o, Xr = ae ? e.formatMacroLabel ?? e.formatLabel : e.formatLabel, Kr = ae ? e.formatMicroLabel ?? e.formatLabel : e.formatLabel, Za = Le?.getTime(), Ja = He?.getTime(), [Xe, jr] = Pe(null), St = V(null), [Mr, jt] = Pe(() => O ? "micro-point" : "micro-high");
632
+ let Ne = Mr;
633
+ const $n = O ? Mr === "micro-low" || Mr === "micro-high" || Mr === "micro-connect" ? "micro-point" : null : Mr === "micro-point" ? "micro-high" : null;
634
+ $n !== null && (Ne = $n, jt($n));
635
+ const ke = E(() => Q(F, r), [X, F]), st = E(() => {
636
+ const a = Q(F, n);
637
+ if (ae && a <= ke)
638
+ throw new RangeError(`PeriodSlider: macroUnit "${F}" cannot distinguish minDate from maxDate (minDate: ${ve(r)}, maxDate: ${ve(n)})`);
639
+ return a;
640
+ }, [ae, X, S, ke, F]), Te = E(() => ae && An ? kt(po, F, r, n) : [], [ae, An, po, F, X, S]), Mo = (a) => [Math.max(ke, Math.min(st, Q(F, a[0]))), Math.max(ke, Math.min(st, Q(F, a[1])))], [xo, Ro] = e.mode !== "vernier" ? [ke, st] : Mo(e.macroRange), [ze, Be] = De.shown === null ? [xo, Ro] : Mo(De.shown), wt = E(() => le(F, ze), [F, ze]), Yt = E(() => le(F, Be), [F, Be]), qr = E(() => e.mode !== "vernier" ? [r, n] : xt(F, b, [wt, Yt], r, n), [e.mode, wt, Yt, F, b, X, S]), xe = E(() => Q(b, qr[0]), [b, qr]), Ee = E(() => Q(b, qr[1]), [b, qr]), Lo = E(() => ae && Dr ? kt(Do, b, r, n) : [], [ae, Dr, Do, b, X, S]), En = (a, u) => Lo.filter((m) => {
641
+ const f = Q(b, m);
642
+ return f >= a && f <= u;
643
+ }), se = E(() => En(xe, Ee), [Lo, b, xe, Ee]), qt = An && Te.length > 0, nt = Dr && se.length > 0, yt = (a, u, m, f) => u.length > 0 ? Q(b, u[ge(u, a, b)]) : Math.max(m, Math.min(f, Q(b, a))), Zt = nt ? se : [], Ce = E(() => pe === null ? xe : yt(pe[0], Zt, xe, Ee), [Za, xe, Ee, b, pe, Zt]), Ue = E(() => pe === null ? Ee : yt(pe[1], Zt, xe, Ee), [Ja, xe, Ee, b, pe, Zt]), Tt = E(() => le(b, Ce), [b, Ce]), Pt = E(() => le(b, Ue), [b, Ue]), So = !ae || Me === null ? null : { macroUnit: F, macroLowEnc: xo, macroHighEnc: Ro, microUnit: b, microLowEnc: Q(b, Me[0]), microHighEnc: Q(b, Me[1]) }, In = V(So), Zr = Math.max(1, st - ke), ot = qt ? fn(Te, F, i, wt) : Math.max(0, Math.min(1, (ze - ke) / Zr)), ct = Math.max(ot, qt ? fn(Te, F, i, Yt) : Math.min(1, (Be - ke) / Zr)), Jr = Math.max(1, Ee - xe), Jt = nt ? fn(se, b, i, Tt) : Math.max(0, Math.min(1, (Ce - xe) / Jr)), xr = Math.max(Jt, nt ? fn(se, b, i, Pt) : Math.min(1, (Ue - xe) / Jr)), Cn = V({ timerId: null, emit: null }), Qr = V({ timerId: null, emit: null }), en = V({ timerId: null, emit: null });
644
+ it(() => {
645
+ const a = [Cn, Qr, en];
633
646
  return () => {
634
- for (const u of o)
635
- na(u.current);
647
+ for (const u of a)
648
+ so(u.current);
636
649
  };
637
650
  }, []);
638
- const qt = U((o, u, d) => {
639
- na(o);
640
- const { debounceMs: m } = q.current;
641
- if (d || !m || m <= 0) {
651
+ const Qt = z((a, u, m) => {
652
+ so(a);
653
+ const { debounceMs: f } = j.current;
654
+ if (m || !f || f <= 0) {
642
655
  u();
643
656
  return;
644
657
  }
645
- o.emit = u, o.timerId = setTimeout(() => {
646
- o.timerId = null, o.emit = null, u();
647
- }, m);
648
- }, []), wa = U((o) => {
649
- const u = o.emit;
650
- na(o), u?.();
651
- }, []), Zt = U((o) => new Date(Math.min(Math.max(o.getTime(), X), y)), [X, y]), Tt = U(
652
- (o, u, d = !1) => {
653
- const [m, M] = Br.current;
654
- if ((q.current.mode === "point" ? o === m : o === m && u === M) && Pn.current.timerId === null)
658
+ a.emit = u, a.timerId = setTimeout(() => {
659
+ a.timerId = null, a.emit = null, u();
660
+ }, f);
661
+ }, []), yo = z((a) => {
662
+ const u = a.emit;
663
+ so(a), u?.();
664
+ }, []), er = z((a) => new Date(Math.min(Math.max(a.getTime(), X), S)), [X, S]), At = z(
665
+ (a, u, m = !1) => {
666
+ const [f, w] = Gr.current;
667
+ if ((j.current.mode === "point" ? a === f : a === f && u === w) && Cn.current.timerId === null)
655
668
  return;
656
- const N = ce(o), E = ce(u), re = () => {
657
- const he = q.current;
658
- he.mode === "point" ? he.onChangePoint?.(N) : he.mode === "range" && he.onChangeRange?.(N, E);
669
+ const C = ce(a), A = ce(u), te = () => {
670
+ const fe = j.current;
671
+ fe.mode === "point" ? fe.onChangePoint?.(C) : fe.mode === "range" && fe.onChangeRange?.(C, A);
659
672
  };
660
- qt(Pn.current, re, d);
673
+ Qt(Cn.current, te, m);
661
674
  },
662
- [ce, qt]
663
- ), Yt = U(
664
- (o, u, d = !1) => {
665
- const m = Tn.current;
666
- if (q.current.mode !== "vernier" || m === null) return;
667
- const M = Zt(o), P = Zt(u);
668
- Q(m.macroUnit, M) === m.macroLowEnc && Q(m.macroUnit, P) === m.macroHighEnc && qr.current.timerId === null || qt(
669
- qr.current,
675
+ [ce, Qt]
676
+ ), Ot = z(
677
+ (a, u, m = !1) => {
678
+ const f = In.current;
679
+ if (j.current.mode !== "vernier" || f === null) return;
680
+ const w = er(a), T = er(u);
681
+ Q(f.macroUnit, w) === f.macroLowEnc && Q(f.macroUnit, T) === f.macroHighEnc && Qr.current.timerId === null || Qt(
682
+ Qr.current,
670
683
  () => {
671
- const N = q.current;
672
- N.mode === "vernier" && N.onChangeMacroRange?.(M, P);
684
+ const C = j.current;
685
+ C.mode === "vernier" && C.onChangeMacroRange?.(w, T);
673
686
  },
674
- d
687
+ m
675
688
  );
676
689
  },
677
- [Zt, qt]
678
- ), Je = U(
679
- (o, u, d = !1) => {
680
- const m = q.current, M = Tn.current;
681
- if (m.mode !== "vernier" || M === null) return;
682
- const P = Zt(o), N = Zt(u);
683
- Q(M.microUnit, P) === M.microLowEnc && Q(M.microUnit, N) === M.microHighEnc && Zr.current.timerId === null || ((H ? m.microValue === void 0 : m.microRange === void 0) && z([P, N]), qt(
684
- Zr.current,
690
+ [er, Qt]
691
+ ), Je = z(
692
+ (a, u, m = !1) => {
693
+ const f = j.current, w = In.current;
694
+ if (f.mode !== "vernier" || w === null) return;
695
+ const T = er(a), C = er(u);
696
+ Q(w.microUnit, T) === w.microLowEnc && Q(w.microUnit, C) === w.microHighEnc && en.current.timerId === null || ((O ? f.microValue === void 0 : f.microRange === void 0) && B([T, C]), Qt(
697
+ en.current,
685
698
  () => {
686
- const E = q.current;
687
- if (E.mode === "vernier") {
688
- if (H) {
689
- E.onChangeMicroPoint?.(P);
699
+ const A = j.current;
700
+ if (A.mode === "vernier") {
701
+ if (O) {
702
+ A.onChangeMicroPoint?.(T);
690
703
  return;
691
704
  }
692
- E.onChangeMicroRange?.(P, N);
705
+ A.onChangeMicroRange?.(T, C);
693
706
  }
694
707
  },
695
- d
708
+ m
696
709
  ));
697
710
  },
698
- [Zt, qt, H]
699
- ), va = U(
700
- (o, u = !1) => {
701
- Je(o, o, u);
711
+ [er, Qt, O]
712
+ ), To = z(
713
+ (a, u = !1) => {
714
+ Je(a, a, u);
702
715
  },
703
716
  [Je]
704
- ), Ot = U(
705
- (o) => {
706
- if (T && i === "time" && L.length > 1) {
707
- const m = Math.max(0, Math.min(L.length - 1, Math.round(o))), M = L[0].getTime(), N = L[L.length - 1].getTime() - M;
708
- if (N <= 0) return 0;
709
- const E = L[m].getTime();
710
- return Math.max(0, Math.min(100, (E - M) / N * 100));
717
+ ), Ht = z(
718
+ (a) => {
719
+ if (y && i === "time" && L.length > 1) {
720
+ const f = Math.max(0, Math.min(L.length - 1, Math.round(a))), w = L[0].getTime(), C = L[L.length - 1].getTime() - w;
721
+ if (C <= 0) return 0;
722
+ const A = L[f].getTime();
723
+ return Math.max(0, Math.min(100, (A - w) / C * 100));
711
724
  }
712
- const u = V - k;
725
+ const u = I - k;
713
726
  if (u <= 0) return 0;
714
- const d = (o - k) / u * 100;
715
- return Math.max(0, Math.min(100, d));
727
+ const m = (a - k) / u * 100;
728
+ return Math.max(0, Math.min(100, m));
716
729
  },
717
- [T, i, L, k, V]
718
- ), An = U(
719
- (o) => {
720
- const u = Math.max(0, Math.min(100, o));
721
- if (T) {
730
+ [y, i, L, k, I]
731
+ ), Vn = z(
732
+ (a) => {
733
+ const u = Math.max(0, Math.min(100, a));
734
+ if (y) {
722
735
  if (i === "time" && L.length > 1) {
723
- const M = L[0].getTime(), N = L[L.length - 1].getTime() - M, E = M + u / 100 * N;
724
- return be(L, new Date(E), t);
736
+ const w = L[0].getTime(), C = L[L.length - 1].getTime() - w, A = w + u / 100 * C;
737
+ return ge(L, new Date(A), t);
725
738
  }
726
- const m = Math.round(u / 100 * (L.length - 1));
727
- return Math.max(0, Math.min(L.length - 1, m));
739
+ const f = Math.round(u / 100 * (L.length - 1));
740
+ return Math.max(0, Math.min(L.length - 1, f));
728
741
  }
729
- const d = k + u / 100 * (V - k);
730
- return Math.round(d);
742
+ const m = k + u / 100 * (I - k);
743
+ return Math.round(m);
731
744
  },
732
- [T, i, L, k, V, t]
733
- ), Mr = O(null), pa = O(null), Ma = O(0), Xe = O(null), $n = O(null), Da = O(null), xa = O(null), [En, Ra] = ye(0), [Fo, Jt] = mr(), [zo, La] = mr(), [Bo, Sa] = mr(), [Uo, ya] = mr(), [Wo, In] = mr(), [Xo, Ta] = mr(), Go = ne ? Jt === null ? void 0 : { estimatedWidthPx: Jt.widthPx, estimatedHeightPx: Jt.heightPx } : aa(Jt, La), Cn = !ne && ve === pe, Vn = ke === Ye, Nn = !H && Ce === _e, Ko = A ? "top" : "bottom", jo = A ? "bottom" : "top", Pa = R && !s, qo = Pa && !H, kn = { isPointMode: ne, isVertical: s, autoSlantLabels: R, isMerged: Cn, trackLengthPx: En, labelPosition: D, config: Go }, Yn = { trackLengthPx: En, labelPosition: Ko, config: aa(Sa, ya), isMerged: Vn, isSlantable: Pa }, On = { trackLengthPx: En, labelPosition: jo, config: aa(In, Ta), isMerged: Nn, isSlantable: qo };
734
- Dt(() => {
735
- const o = Xe.current;
736
- if (!o) return;
745
+ [y, i, L, k, I, t]
746
+ ), Rr = V(null), Po = V(null), Ao = V(0), Ke = V(null), Nn = V(null), $o = V(null), Eo = V(null), [kn, Io] = Pe(0), [Qa, tr] = hr(), [ei, Co] = hr(), [ti, Vo] = hr(), [ri, No] = hr(), [ni, Yn] = hr(), [oi, ko] = hr(), ai = re ? tr === null ? void 0 : { estimatedWidthPx: tr.widthPx, estimatedHeightPx: tr.heightPx } : co(tr, Co), On = !re && Se === ye, Hn = ze === Be, Fn = !O && Ce === Ue, ii = d ? "top" : "bottom", li = d ? "bottom" : "top", Yo = R && !c, si = Yo && !O, _n = { isPointMode: re, isVertical: c, autoSlantLabels: R, isMerged: On, trackLengthPx: kn, labelPosition: D, config: ai }, zn = { trackLengthPx: kn, labelPosition: ii, config: co(Vo, No), isMerged: Hn, isSlantable: Yo }, Bn = { trackLengthPx: kn, labelPosition: li, config: co(Yn, ko), isMerged: Fn, isSlantable: si };
747
+ it(() => {
748
+ const a = Ke.current;
749
+ if (!a) return;
737
750
  const u = () => {
738
- const m = o.getBoundingClientRect(), M = s ? m.height : m.width;
739
- M > 0 && Ra((P) => Math.abs(P - M) < 0.5 ? P : M);
751
+ const f = a.getBoundingClientRect(), w = c ? f.height : f.width;
752
+ w > 0 && Io((T) => Math.abs(T - w) < 0.5 ? T : w);
740
753
  };
741
754
  if (u(), typeof ResizeObserver < "u") {
742
- const m = new ResizeObserver((M) => {
743
- for (const P of M) {
744
- const N = s ? P.contentRect.height : P.contentRect.width;
745
- N > 0 && Ra((E) => Math.abs(E - N) < 0.5 ? E : N);
755
+ const f = new ResizeObserver((w) => {
756
+ for (const T of w) {
757
+ const C = c ? T.contentRect.height : T.contentRect.width;
758
+ C > 0 && Io((A) => Math.abs(A - C) < 0.5 ? A : C);
746
759
  }
747
760
  });
748
- return m.observe(o), () => m.disconnect();
761
+ return f.observe(a), () => f.disconnect();
749
762
  }
750
- const d = o.ownerDocument.defaultView;
751
- if (d)
752
- return d.addEventListener("resize", u), () => d.removeEventListener("resize", u);
753
- }, [s]);
754
- const Qt = U(
755
- (o, u, d) => {
756
- const m = s ? d.height : d.width;
757
- if (!(Number.isFinite(m) && m > 0)) return null;
758
- const M = s ? d.bottom - u : o - d.left;
759
- return Number.isFinite(M) ? Math.max(0, Math.min(1, M / m)) : null;
763
+ const m = a.ownerDocument.defaultView;
764
+ if (m)
765
+ return m.addEventListener("resize", u), () => m.removeEventListener("resize", u);
766
+ }, [c]);
767
+ const rr = z(
768
+ (a, u, m) => {
769
+ const f = c ? m.height : m.width;
770
+ if (!(Number.isFinite(f) && f > 0)) return null;
771
+ const w = c ? m.bottom - u : a - m.left;
772
+ return Number.isFinite(w) ? Math.max(0, Math.min(1, w / f)) : null;
760
773
  },
761
- [s]
762
- ), Aa = U(
763
- (o, u) => {
764
- const d = Xe.current;
765
- if (!d) return null;
766
- const m = Qt(o, u, d.getBoundingClientRect());
767
- return m === null ? null : m * 100;
774
+ [c]
775
+ ), Oo = z(
776
+ (a, u) => {
777
+ const m = Ke.current;
778
+ if (!m) return null;
779
+ const f = rr(a, u, m.getBoundingClientRect());
780
+ return f === null ? null : f * 100;
768
781
  },
769
- [Qt]
770
- ), Dr = O(null), wt = O(null), Jr = O({ macroLowRatio: at, macroHighRatio: st, isVertical: s, isMacroFirstRail: A }), $a = O({ flat: kn, macro: Yn, micro: On });
771
- Cr(() => {
772
- Jr.current = { macroLowRatio: at, macroHighRatio: st, isVertical: s, isMacroFirstRail: A }, $a.current = { flat: kn, macro: Yn, micro: On }, q.current = e, Br.current = [ve, pe], Tn.current = ba, p.current = v, Rt.current = We;
782
+ [rr]
783
+ ), Lr = V(null), vt = V(null), tn = V({ macroLowRatio: ot, macroHighRatio: ct, isVertical: c, isMacroFirstRail: d }), Ho = V({ flat: _n, macro: zn, micro: Bn });
784
+ Nr(() => {
785
+ tn.current = { macroLowRatio: ot, macroHighRatio: ct, isVertical: c, isMacroFirstRail: d }, Ho.current = { flat: _n, macro: zn, micro: Bn }, j.current = e, Gr.current = [Se, ye], In.current = So, be.current = Y, St.current = Xe;
773
786
  });
774
- const Ea = (o, u) => {
775
- const d = Jr.current;
776
- $n.current?.setAttribute("d", Qn(o, u, d.isVertical, d.isMacroFirstRail));
777
- }, Zo = (o, u, d) => {
778
- const m = $a.current;
779
- return o === "flat" ? ho(u * 100, d * 100, m.flat).placements : oa(o, u, d, o === "macro" ? m.macro : m.micro).placements;
780
- }, xr = (o, u, d) => {
781
- const m = Xe.current;
782
- if (!m) return;
783
- Dr.current = { rail: o, lowRatio: u, highRatio: d }, Ai(m, o, u, d);
784
- const M = Zo(o, u, d);
785
- M !== null && Pi(m, o, M), o === "macro" && Ea(u, d);
786
- }, Ht = U(() => {
787
- wt.current !== null && (clearTimeout(wt.current), wt.current = null);
788
- const o = Xe.current;
789
- o && (o.removeAttribute(qn), o.style.removeProperty(Zn));
790
- }, []), Ia = () => {
791
- const o = Xe.current;
792
- if (Dr.current === null || !o) {
793
- Dr.current = null;
787
+ const Fo = (a, u) => {
788
+ const m = tn.current;
789
+ Nn.current?.setAttribute("d", oo(a, u, m.isVertical, m.isMacroFirstRail));
790
+ }, ci = (a, u, m) => {
791
+ const f = Ho.current;
792
+ return a === "flat" ? Aa(u * 100, m * 100, f.flat).placements : uo(a, u, m, a === "macro" ? f.macro : f.micro).placements;
793
+ }, Sr = (a, u, m) => {
794
+ const f = Ke.current;
795
+ if (!f) return;
796
+ Lr.current = { rail: a, lowRatio: u, highRatio: m }, _i(f, a, u, m);
797
+ const w = ci(a, u, m);
798
+ w !== null && Fi(f, a, w), a === "macro" && Fo(u, m);
799
+ }, Ft = z(() => {
800
+ vt.current !== null && (clearTimeout(vt.current), vt.current = null);
801
+ const a = Ke.current;
802
+ a && (a.removeAttribute(to), a.style.removeProperty(ro));
803
+ }, []), _o = () => {
804
+ const a = Ke.current;
805
+ if (Lr.current === null || !a) {
806
+ Lr.current = null;
794
807
  return;
795
808
  }
796
- Dr.current = null, wt.current !== null && clearTimeout(wt.current), o.style.setProperty(Zn, `${ao}ms`), o.setAttribute(qn, "true"), $i(o), Ea(Jr.current.macroLowRatio, Jr.current.macroHighRatio), wt.current = setTimeout(() => {
797
- wt.current = null, o.removeAttribute(qn), o.style.removeProperty(Zn);
798
- }, ao);
809
+ Lr.current = null, vt.current !== null && clearTimeout(vt.current), a.style.setProperty(ro, `${va}ms`), a.setAttribute(to, "true"), zi(a), Fo(tn.current.macroLowRatio, tn.current.macroHighRatio), vt.current = setTimeout(() => {
810
+ vt.current = null, a.removeAttribute(to), a.style.removeProperty(ro);
811
+ }, va);
799
812
  };
800
- Cr(() => {
801
- const o = Dr.current;
802
- o !== null && xr(o.rail, o.lowRatio, o.highRatio);
803
- }), Dt(
813
+ Nr(() => {
814
+ const a = Lr.current;
815
+ a !== null && Sr(a.rail, a.lowRatio, a.highRatio);
816
+ }), it(
804
817
  () => () => {
805
- wt.current !== null && clearTimeout(wt.current);
818
+ vt.current !== null && clearTimeout(vt.current);
806
819
  },
807
820
  []
808
821
  );
809
- const Rr = O(null), Lr = O(null), ct = O(null), Hn = O(null), Sr = O(null), Pt = U(() => Rr.current !== null || Lr.current !== null, []), Ca = (o) => {
822
+ const nr = V(null), or = V(null), ut = V(null), Un = V(null), yr = V(null), $t = z(() => nr.current !== null || or.current !== null, []), zo = (a) => {
810
823
  if (l) return;
811
- if (fe) {
812
- const F = Lr.current;
813
- if (!F || o.pointerId !== F.pointerId || !Xe.current) return;
814
- const ot = Qt(o.clientX, o.clientY, Xe.current.getBoundingClientRect());
815
- if (ot === null) return;
816
- if (F.handle === "macro-low" || F.handle === "macro-high" || F.handle === "macro-connect") {
817
- const [Ve, Se, vt] = nl(F.handle, ot, F.startPointerRatio, F.startMacroLowRatio, F.startMacroHighRatio);
818
- xr("macro", Ve, Se), vt !== Rt.current && (Rt.current = vt, Xr(vt), Xt(vt));
819
- let Ge, dt;
820
- if (Gt) {
821
- const At = un(Le, h, i, Ve), $t = Math.max(At, un(Le, h, i, Se));
822
- Ge = Le[At], dt = Le[$t];
824
+ if (ae) {
825
+ const _ = or.current;
826
+ if (!_ || a.pointerId !== _.pointerId || !Ke.current) return;
827
+ const at = rr(a.clientX, a.clientY, Ke.current.getBoundingClientRect());
828
+ if (at === null) return;
829
+ if (_.handle === "macro-low" || _.handle === "macro-high" || _.handle === "macro-connect") {
830
+ const [Ve, Ae, pt] = bl(_.handle, at, _.startPointerRatio, _.startMacroLowRatio, _.startMacroHighRatio);
831
+ Sr("macro", Ve, Ae), pt !== St.current && (St.current = pt, jr(pt), jt(pt));
832
+ let Ye, Qe;
833
+ if (qt) {
834
+ const Et = gn(Te, F, i, Ve), It = Math.max(Et, gn(Te, F, i, Ae));
835
+ Ye = Te[Et], Qe = Te[It];
823
836
  } else {
824
- const At = Math.round(Ie + Ve * Kr), $t = Math.round(Ie + Se * Kr);
825
- Ge = ie(h, At), dt = ie(h, $t);
837
+ const Et = Math.round(ke + Ve * Zr), It = Math.round(ke + Ae * Zr);
838
+ Ye = le(F, Et), Qe = le(F, It);
826
839
  }
827
- const Ar = `${Ge.getTime()}_${dt.getTime()}`;
828
- Ar !== Hn.current && (Hn.current = Ar, Yt(Ge, dt));
829
- const [pt, Ft] = xt(h, b, [Ge, dt], r, n), Gn = Q(b, pt), Kn = Q(b, Ft), Ja = ht ? yn(Gn, Kn) : [];
830
- let ir, lr;
831
- if (F.handle === "macro-connect") {
832
- const At = pt, $t = Ft;
833
- let sr, cr;
834
- if (h === "year") {
835
- const Et = Ge.getFullYear() - F.startMacroLowDate.getFullYear();
836
- sr = Oe("year", F.initialMicroLowDate, Et), cr = Oe("year", F.initialMicroHighDate, Et);
837
- } else if (h === "month") {
838
- const Et = (Ge.getFullYear() - F.startMacroLowDate.getFullYear()) * 12 + (Ge.getMonth() - F.startMacroLowDate.getMonth());
839
- sr = Oe("month", F.initialMicroLowDate, Et), cr = Oe("month", F.initialMicroHighDate, Et);
840
+ De.show(Ye, Qe);
841
+ const Er = `${Ye.getTime()}_${Qe.getTime()}`;
842
+ Er !== Un.current && (Un.current = Er, Ot(Ye, Qe));
843
+ const [Dt, zt] = xt(F, b, [Ye, Qe], r, n), Jn = Q(b, Dt), Qn = Q(b, zt), ma = Dr ? En(Jn, Qn) : [];
844
+ let Bt, Ut;
845
+ if (_.handle === "macro-connect") {
846
+ const Et = Dt, It = zt;
847
+ let dr, mr;
848
+ if (F === "year") {
849
+ const Ct = Ye.getFullYear() - _.startMacroLowDate.getFullYear();
850
+ dr = Oe("year", _.initialMicroLowDate, Ct), mr = Oe("year", _.initialMicroHighDate, Ct);
851
+ } else if (F === "month") {
852
+ const Ct = (Ye.getFullYear() - _.startMacroLowDate.getFullYear()) * 12 + (Ye.getMonth() - _.startMacroLowDate.getMonth());
853
+ dr = Oe("month", _.initialMicroLowDate, Ct), mr = Oe("month", _.initialMicroHighDate, Ct);
840
854
  } else {
841
- const Et = Math.round((Ge.getTime() - F.startMacroLowDate.getTime()) / 864e5);
842
- sr = Oe("day", F.initialMicroLowDate, Et), cr = Oe("day", F.initialMicroHighDate, Et);
855
+ const Ct = Math.round((Ye.getTime() - _.startMacroLowDate.getTime()) / 864e5);
856
+ dr = Oe("day", _.initialMicroLowDate, Ct), mr = Oe("day", _.initialMicroHighDate, Ct);
843
857
  }
844
- const ur = At.getTime(), $r = $t.getTime(), to = F.initialMicroHighDate.getTime() - F.initialMicroLowDate.getTime();
845
- let Er = sr.getTime(), Ir = cr.getTime();
846
- Er < ur && (Er = ur, Ir = Math.min($r, Er + to)), Ir > $r && (Ir = $r, Er = Math.max(ur, Ir - to)), ir = je(b, new Date(Er)), lr = je(b, new Date(Ir));
858
+ const fr = Et.getTime(), Ir = It.getTime(), ha = _.initialMicroHighDate.getTime() - _.initialMicroLowDate.getTime();
859
+ let Cr = dr.getTime(), Vr = mr.getTime();
860
+ Cr < fr && (Cr = fr, Vr = Math.min(Ir, Cr + ha)), Vr > Ir && (Vr = Ir, Cr = Math.max(fr, Vr - ha)), Bt = Ze(b, new Date(Cr)), Ut = Ze(b, new Date(Vr));
847
861
  } else {
848
- const At = pt.getTime(), $t = Ft.getTime(), sr = F.initialMicroLowDate.getTime(), cr = F.initialMicroHighDate.getTime(), ur = Math.max(At, Math.min($t, sr)), $r = Math.max(ur, Math.min($t, cr));
849
- ir = je(b, new Date(ur)), lr = je(b, new Date($r));
862
+ const Et = Dt.getTime(), It = zt.getTime(), dr = _.initialMicroLowDate.getTime(), mr = _.initialMicroHighDate.getTime(), fr = Math.max(Et, Math.min(It, dr)), Ir = Math.max(fr, Math.min(It, mr));
863
+ Bt = Ze(b, new Date(fr)), Ut = Ze(b, new Date(Ir));
850
864
  }
851
- const Qa = Lt(ir, Ja, Gn, Kn), Li = Math.max(Qa, Lt(lr, Ja, Gn, Kn));
852
- ir = ie(b, Qa), lr = ie(b, Li);
853
- const eo = `${ir.getTime()}_${lr.getTime()}`;
854
- eo !== Sr.current && (Sr.current = eo, Je(ir, lr));
855
- } else if (F.handle === "micro-low" || F.handle === "micro-high" || F.handle === "micro-connect" || F.handle === "micro-point") {
856
- const [Ve, Se, vt] = al(F.handle, ot, F.startPointerRatio, F.startMicroLowRatio, F.startMicroHighRatio);
857
- xr("micro", Ve, Se), vt !== Rt.current && (Rt.current = vt, Xr(vt), Xt(vt));
858
- let Ge, dt;
865
+ const fa = yt(Bt, ma, Jn, Qn), ki = Math.max(fa, yt(Ut, ma, Jn, Qn));
866
+ Bt = le(b, fa), Ut = le(b, ki), Ge.show(Bt, Ut);
867
+ const ga = `${Bt.getTime()}_${Ut.getTime()}`;
868
+ ga !== yr.current && (yr.current = ga, Je(Bt, Ut));
869
+ } else if (_.handle === "micro-low" || _.handle === "micro-high" || _.handle === "micro-connect" || _.handle === "micro-point") {
870
+ const [Ve, Ae, pt] = wl(_.handle, at, _.startPointerRatio, _.startMicroLowRatio, _.startMicroHighRatio);
871
+ Sr("micro", Ve, Ae), pt !== St.current && (St.current = pt, jr(pt), jt(pt));
872
+ let Ye, Qe;
859
873
  if (nt) {
860
- const pt = un(se, b, i, Ve), Ft = Math.max(pt, un(se, b, i, Se));
861
- Ge = se[pt], dt = se[Ft];
874
+ const Dt = gn(se, b, i, Ve), zt = Math.max(Dt, gn(se, b, i, Ae));
875
+ Ye = se[Dt], Qe = se[zt];
862
876
  } else {
863
- const pt = Lt(ie(b, Math.round(xe + Ve * jr)), Kt, xe, $e), Ft = Math.max(pt, Lt(ie(b, Math.round(xe + Se * jr)), Kt, xe, $e));
864
- Ge = ie(b, pt), dt = ie(b, Ft);
877
+ const Dt = yt(le(b, Math.round(xe + Ve * Jr)), Zt, xe, Ee), zt = Math.max(Dt, yt(le(b, Math.round(xe + Ae * Jr)), Zt, xe, Ee));
878
+ Ye = le(b, Dt), Qe = le(b, zt);
865
879
  }
866
- const Ar = `${Ge.getTime()}_${dt.getTime()}`;
867
- Ar !== Sr.current && (Sr.current = Ar, Je(Ge, dt));
880
+ Ge.show(Ye, Qe);
881
+ const Er = `${Ye.getTime()}_${Qe.getTime()}`;
882
+ Er !== yr.current && (yr.current = Er, Je(Ye, Qe));
868
883
  }
869
884
  return;
870
885
  }
871
- const u = Rr.current;
872
- if (!u || o.pointerId !== u.pointerId || !Xe.current) return;
873
- const d = Xe.current.getBoundingClientRect(), m = s ? o.clientY : o.clientX, M = s ? d.height : d.width;
874
- if (!(Number.isFinite(M) && M > 0)) return;
886
+ const u = nr.current;
887
+ if (!u || a.pointerId !== u.pointerId || !Ke.current) return;
888
+ const m = Ke.current.getBoundingClientRect(), f = c ? a.clientY : a.clientX, w = c ? m.height : m.width;
889
+ if (!(Number.isFinite(w) && w > 0)) return;
875
890
  if (u.handle === "connect") {
876
- const F = s ? (u.startPointerPos - m) / M : (m - u.startPointerPos) / M, [ot, Ve] = ua(F, u.startLowRatio, u.startHighRatio);
877
- xr("flat", ot, Ve);
878
- const Se = Zi({
879
- posDiffPct: F,
891
+ const _ = c ? (u.startPointerPos - f) / w : (f - u.startPointerPos) / w, [at, Ve] = bo(_, u.startLowRatio, u.startHighRatio);
892
+ Sr("flat", at, Ve);
893
+ const Ae = ul({
894
+ posDiffPct: _,
880
895
  startLowVal: u.startLowVal,
881
896
  startHighVal: u.startHighVal,
882
897
  rangeMin: k,
883
- rangeMax: V,
884
- isDiscrete: T,
898
+ rangeMax: I,
899
+ isDiscrete: y,
885
900
  sortedAllowedDates: L,
886
901
  snapMode: i,
887
902
  unit: t
888
903
  });
889
- if (ct.current && ct.current[0] === Se[0] && ct.current[1] === Se[1])
904
+ if (ut.current && ut.current[0] === Ae[0] && ut.current[1] === Ae[1])
890
905
  return;
891
- ct.current = Se, te(Se), Tt(Se[0], Se[1], !1);
906
+ ut.current = Ae, v(Ae), At(Ae[0], Ae[1], !1);
892
907
  return;
893
908
  }
894
- const P = Qt(o.clientX, o.clientY, d);
895
- if (P === null) return;
896
- const [N, E] = hn(ne ? "point" : u.handle, P, u.startLowRatio, u.startHighRatio);
897
- xr("flat", N, E);
898
- const re = An(P * 100), [he, Re] = uo(u.handle, re, u.startLowVal, u.startHighVal, k, V, ne);
899
- if ((!ct.current || ct.current[0] !== he || ct.current[1] !== Re) && (ct.current = [he, Re], te([he, Re]), Tt(he, Re, !1)), !ne && (u.handle === "low" || u.handle === "high")) {
900
- const F = da(u.handle, P, u.startLowRatio, u.startHighRatio);
901
- p.current !== F && (p.current = F, Y(F), de(F));
909
+ const T = rr(a.clientX, a.clientY, m);
910
+ if (T === null) return;
911
+ const [C, A] = pn(re ? "point" : u.handle, T, u.startLowRatio, u.startHighRatio);
912
+ Sr("flat", C, A);
913
+ const te = Vn(T * 100), [fe, Re] = La(u.handle, te, u.startLowVal, u.startHighVal, k, I, re);
914
+ if ((!ut.current || ut.current[0] !== fe || ut.current[1] !== Re) && (ut.current = [fe, Re], v([fe, Re]), At(fe, Re, !1)), !re && (u.handle === "low" || u.handle === "high")) {
915
+ const _ = wo(u.handle, T, u.startLowRatio, u.startHighRatio);
916
+ be.current !== _ && (be.current = _, he(_), Ie(_));
902
917
  }
903
- }, Va = (o) => {
904
- if (fe) {
905
- const m = Lr.current;
906
- if (!m || o.pointerId !== m.pointerId) return;
907
- Ia(), Hn.current = null, Sr.current = null, Lr.current = null, Rt.current = null, Xr(null), wa(qr.current), wa(Zr.current);
918
+ }, Bo = () => {
919
+ _o(), Un.current = null, yr.current = null, or.current = null, St.current = null, jr(null), De.release(), Ge.release(), yo(Qr.current), yo(en.current);
920
+ }, Uo = () => {
921
+ _o();
922
+ const a = ut.current ?? N;
923
+ a && (At(a[0], a[1], !0), p(a)), ut.current = null, v(null), nr.current = null, be.current = null, he(null);
924
+ }, Wo = (a) => {
925
+ if (ae) {
926
+ const m = or.current;
927
+ if (!m || a.pointerId !== m.pointerId) return;
928
+ Bo();
908
929
  return;
909
930
  }
910
- const u = Rr.current;
911
- if (!u || o.pointerId !== u.pointerId) return;
912
- Ia();
913
- const d = ct.current ?? B;
914
- d && (Tt(d[0], d[1], !0), K(d)), ct.current = null, te(null), Rr.current = null, p.current = null, Y(null);
915
- }, _n = O(Ca), Na = O(Va);
916
- Cr(() => {
917
- _n.current = Ca, Na.current = Va;
931
+ const u = nr.current;
932
+ !u || a.pointerId !== u.pointerId || Uo();
933
+ }, Go = () => {
934
+ or.current !== null && Bo(), nr.current !== null && Uo();
935
+ }, Wn = V(zo), Xo = V(Wo), Ko = V(Go);
936
+ Nr(() => {
937
+ Wn.current = zo, Xo.current = Wo, Ko.current = Go;
918
938
  });
919
- const ka = v !== null || We !== null;
920
- Dt(() => {
921
- if (!ka) return;
922
- const o = Mr.current?.ownerDocument.defaultView;
923
- if (!o) return;
924
- const u = (m) => _n.current(m), d = (m) => Na.current(m);
925
- return o.addEventListener("pointermove", u), o.addEventListener("pointerup", d), o.addEventListener("pointercancel", d), o.addEventListener("lostpointercapture", d), () => {
926
- o.removeEventListener("pointermove", u), o.removeEventListener("pointerup", d), o.removeEventListener("pointercancel", d), o.removeEventListener("lostpointercapture", d);
939
+ const jo = V(ae);
940
+ it(() => {
941
+ jo.current !== ae && (jo.current = ae, Ko.current());
942
+ }, [ae]);
943
+ const qo = Y !== null || Xe !== null;
944
+ it(() => {
945
+ if (!qo) return;
946
+ const a = Rr.current?.ownerDocument.defaultView;
947
+ if (!a) return;
948
+ const u = (f) => Wn.current(f), m = (f) => Xo.current(f);
949
+ return a.addEventListener("pointermove", u), a.addEventListener("pointerup", m), a.addEventListener("pointercancel", m), a.addEventListener("lostpointercapture", m), () => {
950
+ a.removeEventListener("pointermove", u), a.removeEventListener("pointerup", m), a.removeEventListener("pointercancel", m), a.removeEventListener("lostpointercapture", m);
927
951
  };
928
- }, [ka]);
929
- const Fn = U(
930
- (o, u, d, m) => {
931
- Ht(), vo(o, u), Rr.current = {
952
+ }, [qo]);
953
+ const Gn = z(
954
+ (a, u, m, f) => {
955
+ Ft(), Ia(a, u), nr.current = {
932
956
  pointerId: u,
933
- handle: d,
934
- startPointerPos: m,
935
- startLowVal: ve,
936
- startHighVal: pe,
957
+ handle: m,
958
+ startPointerPos: f,
959
+ startLowVal: Se,
960
+ startHighVal: ye,
937
961
  // 表示の出発点は「いま描かれている位置」。値を基準にすると、時間比例スナップのように
938
962
  // 値と位置が線形でないレールで、掴んでいない側の支点が実際の描画位置からずれる
939
- startLowRatio: Ot(ve) / 100,
940
- startHighRatio: Ot(pe) / 100
941
- }, p.current = d, Y(d), d !== "connect" && de(d);
963
+ startLowRatio: Ht(Se) / 100,
964
+ startHighRatio: Ht(ye) / 100
965
+ }, be.current = m, he(m), m !== "connect" && Ie(m);
942
966
  },
943
- [ve, pe, Ot]
944
- ), Ya = U(
945
- (o, u, d, m) => {
946
- q.current.mode === "vernier" && (Ht(), vo(o, u), Lr.current = {
967
+ [Se, ye, Ht]
968
+ ), Zo = z(
969
+ (a, u, m, f) => {
970
+ j.current.mode === "vernier" && (Ft(), Ia(a, u), or.current = {
947
971
  pointerId: u,
948
- handle: d,
949
- startPointerRatio: m,
950
- startMacroLowRatio: at,
951
- startMacroHighRatio: st,
952
- startMicroLowRatio: jt,
953
- startMicroHighRatio: pr,
972
+ handle: m,
973
+ startPointerRatio: f,
974
+ startMacroLowRatio: ot,
975
+ startMacroHighRatio: ct,
976
+ startMicroLowRatio: Jt,
977
+ startMicroHighRatio: xr,
954
978
  // 平行移動量は暦差分で求めるため、基準は表示しているマクロ値 (期間先頭・定義域内) でなければならない。
955
979
  // 生の Props を基準にすると、期間の途中や定義域の外を指す開始日で日差分が半端になり、
956
980
  // 動いていない押下でも丸めで 1 単位ずれる
957
- startMacroLowDate: bt,
958
- initialMicroLowDate: St,
959
- initialMicroHighDate: yt
960
- }, Rt.current = d, Xr(d), Xt(d));
981
+ startMacroLowDate: wt,
982
+ initialMicroLowDate: Tt,
983
+ initialMicroHighDate: Pt
984
+ }, St.current = m, jr(m), jt(m));
961
985
  },
962
- [at, st, jt, pr, bt, St, yt]
963
- ), Oa = (o) => (u) => {
964
- if (l || Pt()) return;
965
- u.stopPropagation(), u.preventDefault(), de(o);
966
- const d = s ? u.clientY : u.clientX;
967
- Fn(u.currentTarget, u.pointerId, o, d);
968
- }, Ha = (o) => () => {
969
- l || p.current !== null || de(o);
970
- }, Qr = (o) => () => {
971
- l || Rt.current !== null || Xt(o);
972
- }, er = (o) => (u) => {
973
- if (l || Pt()) return;
986
+ [ot, ct, Jt, xr, wt, Tt, Pt]
987
+ ), Jo = (a) => (u) => {
988
+ if (l || $t()) return;
989
+ u.stopPropagation(), u.preventDefault(), Ie(a);
990
+ const m = c ? u.clientY : u.clientX;
991
+ Gn(u.currentTarget, u.pointerId, a, m);
992
+ }, Qo = (a) => () => {
993
+ l || be.current !== null || Ie(a);
994
+ }, rn = (a) => () => {
995
+ l || St.current !== null || jt(a);
996
+ }, ar = (a) => (u) => {
997
+ if (l || $t()) return;
974
998
  u.stopPropagation(), u.preventDefault();
975
- const d = Xe.current;
976
- if (!d) return;
977
- const m = Qt(u.clientX, u.clientY, d.getBoundingClientRect());
978
- m !== null && Ya(u.currentTarget, u.pointerId, o, m);
979
- }, Jo = (o) => {
980
- if (l || S || Pt()) return;
981
- o.stopPropagation(), o.preventDefault();
982
- const u = s ? o.clientY : o.clientX;
983
- Fn(o.currentTarget, o.pointerId, "connect", u);
984
- }, Qo = (o) => {
985
- if (l || Pt()) return;
986
- if (fe) {
987
- const E = Xe.current;
988
- if (!E) return;
989
- const re = E.getBoundingClientRect(), he = Qt(o.clientX, o.clientY, re);
990
- if (he === null) return;
991
- const Re = s ? o.clientX - (re.left + re.width / 2) : o.clientY - (re.top + re.height / 2), F = rl(he, Re, at, st, jt, pr, Nt, void 0, !S, H ? "point" : "range");
992
- Ya(o.currentTarget, o.pointerId, F, he), _n.current(o.nativeEvent);
999
+ const m = Ke.current;
1000
+ if (!m) return;
1001
+ const f = rr(u.clientX, u.clientY, m.getBoundingClientRect());
1002
+ f !== null && Zo(u.currentTarget, u.pointerId, a, f);
1003
+ }, ui = (a) => {
1004
+ if (l || M || $t()) return;
1005
+ a.stopPropagation(), a.preventDefault();
1006
+ const u = c ? a.clientY : a.clientX;
1007
+ Gn(a.currentTarget, a.pointerId, "connect", u);
1008
+ }, di = (a) => {
1009
+ if (l || $t()) return;
1010
+ if (ae) {
1011
+ const A = Ke.current;
1012
+ if (!A) return;
1013
+ const te = A.getBoundingClientRect(), fe = rr(a.clientX, a.clientY, te);
1014
+ if (fe === null) return;
1015
+ const Re = c ? a.clientX - (te.left + te.width / 2) : a.clientY - (te.top + te.height / 2), _ = hl(fe, Re, ot, ct, Jt, xr, Kt, void 0, !M, O ? "point" : "range");
1016
+ Zo(a.currentTarget, a.pointerId, _, fe), Wn.current(a.nativeEvent);
993
1017
  return;
994
1018
  }
995
- const u = Aa(o.clientX, o.clientY);
1019
+ const u = Oo(a.clientX, a.clientY);
996
1020
  if (u === null) return;
997
- const d = An(u);
998
- let m = "low";
999
- if (!ne) {
1000
- const E = Math.abs(d - ve), re = Math.abs(d - pe);
1001
- E < re ? m = "low" : re < E ? m = "high" : m = d > pe ? "high" : "low";
1021
+ const m = Vn(u);
1022
+ let f = "low";
1023
+ if (!re) {
1024
+ const A = Math.abs(m - Se), te = Math.abs(m - ye);
1025
+ A < te ? f = "low" : te < A ? f = "high" : f = m > ye ? "high" : "low";
1002
1026
  }
1003
- de(m);
1004
- const [M, P] = uo(m, d, ve, pe, k, V, ne);
1005
- te([M, P]), Tt(M, P, !0);
1006
- const N = s ? o.clientY : o.clientX;
1007
- Fn(o.currentTarget, o.pointerId, m, N);
1008
- }, ei = (o) => {
1009
- if (l || fe || v !== null) return;
1010
- const u = Aa(o.clientX, o.clientY);
1027
+ Ie(f);
1028
+ const [w, T] = La(f, m, Se, ye, k, I, re);
1029
+ v([w, T]), At(w, T, !0);
1030
+ const C = c ? a.clientY : a.clientX;
1031
+ Gn(a.currentTarget, a.pointerId, f, C);
1032
+ }, mi = (a) => {
1033
+ if (l || ae || Y !== null) return;
1034
+ const u = Oo(a.clientX, a.clientY);
1011
1035
  if (u === null) return;
1012
- const d = An(u);
1013
- Ae(d), rt(Ot(d));
1014
- }, ti = () => {
1015
- Ae(null), rt(null);
1016
- }, _a = (o) => (u) => {
1017
- if (l || Pt()) return;
1018
- de(o);
1019
- const d = Ji(u.key, o, ve, pe, k, V, ne, 1);
1020
- d && (u.preventDefault(), Ht(), Ue || K(d), Tt(d[0], d[1], !0));
1021
- }, tr = (o, u) => {
1022
- if (le === null) return;
1023
- const [d, m] = xt(h, b, [o, u], r, n), M = Q(b, d), P = Q(b, m), N = ht ? yn(M, P) : [], E = Lt(le[0], N, M, P), re = Math.max(E, Lt(le[1], N, M, P));
1024
- Je(ie(b, E), ie(b, re), !0);
1025
- }, en = (o) => (u) => {
1026
- if (l || !fe || e.mode !== "vernier" || Pt()) return;
1027
- Xt(o);
1028
- let d = 0, m = !1, M = !1;
1036
+ const m = Vn(u);
1037
+ Rt(m), Wr(Ht(m));
1038
+ }, fi = () => {
1039
+ Rt(null), Wr(null);
1040
+ }, ea = (a) => (u) => {
1041
+ if (l || $t()) return;
1042
+ Ie(a);
1043
+ const m = dl(u.key, a, Se, ye, k, I, re, 1);
1044
+ m && (u.preventDefault(), Ft(), U || p(m), At(m[0], m[1], !0));
1045
+ }, ir = (a, u) => {
1046
+ if (Me === null) return;
1047
+ const [m, f] = xt(F, b, [a, u], r, n), w = Q(b, m), T = Q(b, f), C = Dr ? En(w, T) : [], A = yt(Me[0], C, w, T), te = Math.max(A, yt(Me[1], C, w, T));
1048
+ Je(le(b, A), le(b, te), !0);
1049
+ }, nn = (a) => (u) => {
1050
+ if (l || !ae || e.mode !== "vernier" || $t()) return;
1051
+ jt(a);
1052
+ let m = 0, f = !1, w = !1;
1029
1053
  switch (u.key) {
1030
1054
  case "ArrowRight":
1031
1055
  case "ArrowUp":
1032
- d = 1;
1056
+ m = 1;
1033
1057
  break;
1034
1058
  case "ArrowLeft":
1035
1059
  case "ArrowDown":
1036
- d = -1;
1060
+ m = -1;
1037
1061
  break;
1038
1062
  case "PageUp":
1039
- d = 5;
1063
+ m = 5;
1040
1064
  break;
1041
1065
  case "PageDown":
1042
- d = -5;
1066
+ m = -5;
1043
1067
  break;
1044
1068
  case "Home":
1045
- m = !0;
1069
+ f = !0;
1046
1070
  break;
1047
1071
  case "End":
1048
- M = !0;
1072
+ w = !0;
1049
1073
  break;
1050
1074
  default:
1051
1075
  return;
1052
1076
  }
1053
- if (u.preventDefault(), Ht(), o === "macro-low") {
1054
- const P = ie(h, ke), N = ie(h, Ye);
1055
- if (Gt) {
1056
- const he = Nr(Le, h, P, Le[0], N, d, m, M);
1057
- if (he === be(Le, P, h)) return;
1058
- const Re = Le[he];
1059
- Yt(Re, N, !0), tr(Re, N);
1077
+ if (u.preventDefault(), Ft(), a === "macro-low") {
1078
+ const T = le(F, ze), C = le(F, Be);
1079
+ if (qt) {
1080
+ const fe = Yr(Te, F, T, Te[0], C, m, f, w);
1081
+ if (fe === ge(Te, T, F)) return;
1082
+ const Re = Te[fe];
1083
+ Ot(Re, C, !0), ir(Re, C);
1060
1084
  return;
1061
1085
  }
1062
- let E;
1063
- if (m ? E = Ie : M ? E = Ye : E = Math.max(Ie, Math.min(Ye, ke + d)), E === ke) return;
1064
- const re = ie(h, E);
1065
- Yt(re, N, !0), tr(re, N);
1066
- } else if (o === "macro-high") {
1067
- const P = ie(h, ke), N = ie(h, Ye);
1068
- if (Gt) {
1069
- const he = Nr(Le, h, N, P, Le[Le.length - 1], d, m, M);
1070
- if (he === be(Le, N, h)) return;
1071
- const Re = Le[he];
1072
- Yt(P, Re, !0), tr(P, Re);
1086
+ let A;
1087
+ if (f ? A = ke : w ? A = Be : A = Math.max(ke, Math.min(Be, ze + m)), A === ze) return;
1088
+ const te = le(F, A);
1089
+ Ot(te, C, !0), ir(te, C);
1090
+ } else if (a === "macro-high") {
1091
+ const T = le(F, ze), C = le(F, Be);
1092
+ if (qt) {
1093
+ const fe = Yr(Te, F, C, T, Te[Te.length - 1], m, f, w);
1094
+ if (fe === ge(Te, C, F)) return;
1095
+ const Re = Te[fe];
1096
+ Ot(T, Re, !0), ir(T, Re);
1073
1097
  return;
1074
1098
  }
1075
- let E;
1076
- if (m ? E = ke : M ? E = Ze : E = Math.max(ke, Math.min(Ze, Ye + d)), E === Ye) return;
1077
- const re = ie(h, E);
1078
- Yt(P, re, !0), tr(P, re);
1079
- } else if (o === "micro-low") {
1080
- const P = ie(b, Ce), N = ie(b, _e);
1099
+ let A;
1100
+ if (f ? A = ze : w ? A = st : A = Math.max(ze, Math.min(st, Be + m)), A === Be) return;
1101
+ const te = le(F, A);
1102
+ Ot(T, te, !0), ir(T, te);
1103
+ } else if (a === "micro-low") {
1104
+ const T = le(b, Ce), C = le(b, Ue);
1081
1105
  if (nt) {
1082
- const re = Nr(se, b, P, se[0], N, d, m, M);
1083
- if (re === be(se, P, b)) return;
1084
- Je(se[re], N, !0);
1106
+ const te = Yr(se, b, T, se[0], C, m, f, w);
1107
+ if (te === ge(se, T, b)) return;
1108
+ Je(se[te], C, !0);
1085
1109
  return;
1086
1110
  }
1087
- let E;
1088
- if (m ? E = xe : M ? E = _e : E = Math.max(xe, Math.min(_e, Ce + d)), E === Ce) return;
1089
- Je(ie(b, E), N, !0);
1090
- } else if (o === "micro-high") {
1091
- const P = ie(b, Ce), N = ie(b, _e);
1111
+ let A;
1112
+ if (f ? A = xe : w ? A = Ue : A = Math.max(xe, Math.min(Ue, Ce + m)), A === Ce) return;
1113
+ Je(le(b, A), C, !0);
1114
+ } else if (a === "micro-high") {
1115
+ const T = le(b, Ce), C = le(b, Ue);
1092
1116
  if (nt) {
1093
- const re = Nr(se, b, N, P, se[se.length - 1], d, m, M);
1094
- if (re === be(se, N, b)) return;
1095
- Je(P, se[re], !0);
1117
+ const te = Yr(se, b, C, T, se[se.length - 1], m, f, w);
1118
+ if (te === ge(se, C, b)) return;
1119
+ Je(T, se[te], !0);
1096
1120
  return;
1097
1121
  }
1098
- let E;
1099
- if (m ? E = Ce : M ? E = $e : E = Math.max(Ce, Math.min($e, _e + d)), E === _e) return;
1100
- Je(P, ie(b, E), !0);
1101
- } else if (o === "micro-point") {
1102
- const P = ie(b, Ce);
1122
+ let A;
1123
+ if (f ? A = Ce : w ? A = Ee : A = Math.max(Ce, Math.min(Ee, Ue + m)), A === Ue) return;
1124
+ Je(T, le(b, A), !0);
1125
+ } else if (a === "micro-point") {
1126
+ const T = le(b, Ce);
1103
1127
  if (nt) {
1104
- const E = Nr(se, b, P, se[0], se[se.length - 1], d, m, M);
1105
- if (E === be(se, P, b)) return;
1106
- va(se[E], !0);
1128
+ const A = Yr(se, b, T, se[0], se[se.length - 1], m, f, w);
1129
+ if (A === ge(se, T, b)) return;
1130
+ To(se[A], !0);
1107
1131
  return;
1108
1132
  }
1109
- let N;
1110
- if (m ? N = xe : M ? N = $e : N = Math.max(xe, Math.min($e, Ce + d)), N === Ce) return;
1111
- va(ie(b, N), !0);
1133
+ let C;
1134
+ if (f ? C = xe : w ? C = Ee : C = Math.max(xe, Math.min(Ee, Ce + m)), C === Ce) return;
1135
+ To(le(b, C), !0);
1112
1136
  }
1113
- }, ri = (o) => {
1137
+ }, gi = (a) => {
1114
1138
  if (e.mode !== "vernier") return;
1115
- if (Ht(), Gt) {
1116
- const N = Le.length - 1, E = be(Le, bt, h), re = be(Le, kt, h), he = re - E;
1117
- let Re = E + o, F = re + o;
1118
- if (o < 0 && Re < 0 ? (Re = 0, F = Math.min(N, he)) : o > 0 && F > N && (F = N, Re = Math.max(0, N - he)), Re === E && F === re) return;
1119
- const ot = Le[Re], Ve = Le[F];
1120
- Yt(ot, Ve, !0), tr(ot, Ve);
1139
+ if (Ft(), qt) {
1140
+ const C = Te.length - 1, A = ge(Te, wt, F), te = ge(Te, Yt, F), fe = te - A;
1141
+ let Re = A + a, _ = te + a;
1142
+ if (a < 0 && Re < 0 ? (Re = 0, _ = Math.min(C, fe)) : a > 0 && _ > C && (_ = C, Re = Math.max(0, C - fe)), Re === A && _ === te) return;
1143
+ const at = Te[Re], Ve = Te[_];
1144
+ Ot(at, Ve, !0), ir(at, Ve);
1121
1145
  return;
1122
1146
  }
1123
- const u = Ye - ke;
1124
- let d = ke + o, m = Ye + o;
1125
- if (o < 0 && d < Ie ? (d = Ie, m = Math.min(Ze, d + u)) : o > 0 && m > Ze && (m = Ze, d = Math.max(Ie, m - u)), d === ke && m === Ye) return;
1126
- const M = ie(h, d), P = ie(h, m);
1127
- Yt(M, P, !0), tr(M, P);
1128
- }, zn = U(
1129
- (o) => {
1130
- const u = q.current;
1131
- if (!(u.disabled || Pt()))
1132
- if (Ht(), u.mode === "point") {
1133
- const d = Math.max(k, Math.min(V, ve + o));
1134
- Ue || K([d, d]), Tt(d, d, !0);
1147
+ const u = Be - ze;
1148
+ let m = ze + a, f = Be + a;
1149
+ if (a < 0 && m < ke ? (m = ke, f = Math.min(st, m + u)) : a > 0 && f > st && (f = st, m = Math.max(ke, f - u)), m === ze && f === Be) return;
1150
+ const w = le(F, m), T = le(F, f);
1151
+ Ot(w, T, !0), ir(w, T);
1152
+ }, Xn = z(
1153
+ (a) => {
1154
+ const u = j.current;
1155
+ if (!(u.disabled || $t()))
1156
+ if (Ft(), u.mode === "point") {
1157
+ const m = Math.max(k, Math.min(I, Se + a));
1158
+ U || p([m, m]), At(m, m, !0);
1135
1159
  } else if (u.mode === "vernier") {
1136
1160
  if (nt) {
1137
- const he = se.length - 1, Re = be(se, St, b), F = be(se, yt, b), ot = F - Re;
1138
- let Ve = Re + o, Se = F + o;
1139
- o < 0 && Ve < 0 ? (Ve = 0, Se = Math.min(he, ot)) : o > 0 && Se > he && (Se = he, Ve = Math.max(0, he - ot)), (Ve !== Re || Se !== F) && Je(se[Ve], se[Se], !0);
1161
+ const fe = se.length - 1, Re = ge(se, Tt, b), _ = ge(se, Pt, b), at = _ - Re;
1162
+ let Ve = Re + a, Ae = _ + a;
1163
+ a < 0 && Ve < 0 ? (Ve = 0, Ae = Math.min(fe, at)) : a > 0 && Ae > fe && (Ae = fe, Ve = Math.max(0, fe - at)), (Ve !== Re || Ae !== _) && Je(se[Ve], se[Ae], !0);
1140
1164
  return;
1141
1165
  }
1142
- const d = Ce, m = _e, M = xe, P = $e, N = m - d;
1143
- let E = d + o, re = m + o;
1144
- o < 0 && E < M ? (E = M, re = Math.min(P, E + N)) : o > 0 && re > P && (re = P, E = Math.max(M, re - N)), (E !== d || re !== m) && Je(ie(b, E), ie(b, re), !0);
1166
+ const m = Ce, f = Ue, w = xe, T = Ee, C = f - m;
1167
+ let A = m + a, te = f + a;
1168
+ a < 0 && A < w ? (A = w, te = Math.min(T, A + C)) : a > 0 && te > T && (te = T, A = Math.max(w, te - C)), (A !== m || te !== f) && Je(le(b, A), le(b, te), !0);
1145
1169
  } else {
1146
- const d = pe - ve;
1147
- let m = ve + o, M = pe + o;
1148
- o < 0 && m < k ? (m = k, M = Math.min(V, m + d)) : o > 0 && M > V && (M = V, m = Math.max(k, M - d)), m <= M && (Ue || K([m, M]), Tt(m, M, !0));
1170
+ const m = ye - Se;
1171
+ let f = Se + a, w = ye + a;
1172
+ a < 0 && f < k ? (f = k, w = Math.min(I, f + m)) : a > 0 && w > I && (w = I, f = Math.max(k, w - m)), f <= w && (U || p([f, w]), At(f, w, !0));
1149
1173
  }
1150
1174
  },
1151
1175
  [
1152
- ve,
1153
- pe,
1176
+ Se,
1177
+ ye,
1154
1178
  k,
1155
- V,
1156
- Ue,
1157
- Tt,
1179
+ I,
1180
+ U,
1181
+ At,
1158
1182
  Je,
1159
1183
  Ce,
1160
- _e,
1184
+ Ue,
1161
1185
  xe,
1162
- $e,
1186
+ Ee,
1163
1187
  b,
1164
1188
  nt,
1165
1189
  se,
1166
- St,
1167
- yt,
1168
- Ht
1190
+ Tt,
1191
+ Pt,
1192
+ Ft
1169
1193
  ]
1170
- ), Fa = (o) => !l && ea(Mr.current, o), za = (o, u) => {
1171
- const d = pa.current, m = Xe.current, M = Mr.current;
1172
- if (l || d === null || m === null || M === null || !Ni(d, M, Ma.current, s, o, u)) return null;
1173
- const P = m.getBoundingClientRect();
1174
- return Math.abs(s ? o - (P.left + P.width / 2) : u - (P.top + P.height / 2));
1175
- }, Ba = (o) => {
1176
- if (l || Pt()) return;
1177
- const u = tl(o.deltaX, o.deltaY, s);
1194
+ ), ta = (a) => !l && ao(Rr.current, a), ra = (a, u) => {
1195
+ const m = Po.current, f = Ke.current, w = Rr.current;
1196
+ if (l || m === null || f === null || w === null || !Ki(m, w, Ao.current, c, a, u)) return null;
1197
+ const T = f.getBoundingClientRect();
1198
+ return Math.abs(c ? a - (T.left + T.width / 2) : u - (T.top + T.height / 2));
1199
+ }, na = (a) => {
1200
+ if (l || $t()) return;
1201
+ const u = gl(a.deltaX, a.deltaY, c);
1178
1202
  if (u === 0) return;
1179
- o.preventDefault();
1180
- const d = o.target, m = ea(Da.current, d) || ea(xa.current, d);
1181
- if (!fe || m) {
1182
- zn(u);
1203
+ a.preventDefault();
1204
+ const m = a.target, f = ao($o.current, m) || ao(Eo.current, m);
1205
+ if (!ae || f) {
1206
+ Xn(u);
1183
1207
  return;
1184
1208
  }
1185
- const M = Xe.current;
1186
- if (!M) return;
1187
- const P = M.getBoundingClientRect(), N = s ? o.clientX - (P.left + P.width / 2) : o.clientY - (P.top + P.height / 2);
1188
- if (ko(N, Nt) === "macro") {
1189
- ri(u);
1209
+ const w = Ke.current;
1210
+ if (!w) return;
1211
+ const T = w.getBoundingClientRect(), C = c ? a.clientX - (T.left + T.width / 2) : a.clientY - (T.top + T.height / 2);
1212
+ if (qa(C, Kt) === "macro") {
1213
+ gi(u);
1190
1214
  return;
1191
1215
  }
1192
- zn(u);
1193
- }, tn = O({ ownsWheelHit: Fa, distanceToRailPx: za, stepFromRangeAreaWheel: Ba });
1194
- Cr(() => {
1195
- tn.current = { ownsWheelHit: Fa, distanceToRailPx: za, stepFromRangeAreaWheel: Ba };
1196
- }), Dt(() => {
1197
- const o = Mr.current?.ownerDocument.defaultView;
1198
- if (o)
1199
- return Yi(o, {
1200
- ownsHit: (u) => tn.current.ownsWheelHit(u),
1201
- distanceToRailPx: (u, d) => tn.current.distanceToRailPx(u, d),
1202
- step: (u) => tn.current.stepFromRangeAreaWheel(u)
1203
- });
1204
- }, []);
1205
- const rn = Ot(ve), nn = Ot(pe), Bn = ce(ve), Un = ce(pe), Wn = ho(rn, nn, kn), yr = Wn.slant, Tr = v === "low" || v !== "high" && j === "low", Pr = !ne && (v === "high" || v !== "low" && j === "high"), ni = Vn && Ne !== "macro-low", ai = Vn && Ne === "macro-low", oi = Nn && Ne !== "micro-low", ii = Nn && Ne === "micro-low", rr = oa("macro", at, st, Yn), nr = oa("micro", jt, pr, On), li = Math.min(rn, nn), si = Math.max(rn, nn), [Ua, Wa] = Hr.flat, [ci, ui] = Hr.macro, [di, mi] = Hr.micro, Xa = It(Ua, rn), Ga = It(Wa, nn), Xn = It(Ua, li), Ka = `calc(${It(Wa, si)} - ${Xn})`, ar = It(ci, at * 100), an = It(ui, st * 100), or = It(di, jt * 100), on = It(mi, pr * 100), fi = s ? {
1206
- bottom: Xn,
1207
- height: Ka,
1216
+ Xn(u);
1217
+ }, on = V({ ownsWheelHit: ta, distanceToRailPx: ra, stepFromRangeAreaWheel: na });
1218
+ Nr(() => {
1219
+ on.current = { ownsWheelHit: ta, distanceToRailPx: ra, stepFromRangeAreaWheel: na };
1220
+ });
1221
+ const Tr = V(null);
1222
+ it(() => {
1223
+ const a = Rr.current?.ownerDocument.defaultView ?? null, u = Tr.current;
1224
+ if (u !== null && u.view === a) return;
1225
+ if (u?.unregister(), a === null) {
1226
+ Tr.current = null;
1227
+ return;
1228
+ }
1229
+ const m = qi(a, {
1230
+ ownsHit: (f) => on.current.ownsWheelHit(f),
1231
+ distanceToRailPx: (f, w) => on.current.distanceToRailPx(f, w),
1232
+ step: (f) => on.current.stepFromRangeAreaWheel(f)
1233
+ });
1234
+ Tr.current = { view: a, unregister: m };
1235
+ }), it(
1236
+ () => () => {
1237
+ Tr.current?.unregister(), Tr.current = null;
1238
+ },
1239
+ []
1240
+ );
1241
+ const an = Ht(Se), ln = Ht(ye), Kn = ce(Se), jn = ce(ye), qn = Aa(an, ln, _n), Pr = qn.slant, Ar = Y === "low" || Y !== "high" && $e === "low", $r = !re && (Y === "high" || Y !== "low" && $e === "high"), hi = Hn && Ne !== "macro-low", bi = Hn && Ne === "macro-low", wi = Fn && Ne !== "micro-low", vi = Fn && Ne === "micro-low", lr = uo("macro", ot, ct, zn), sr = uo("micro", Jt, xr, Bn), pi = Math.min(an, ln), Di = Math.max(an, ln), [oa, aa] = _r.flat, [Mi, xi] = _r.macro, [Ri, Li] = _r.micro, ia = Vt(oa, an), la = Vt(aa, ln), Zn = Vt(oa, pi), sa = `calc(${Vt(aa, Di)} - ${Zn})`, cr = Vt(Mi, ot * 100), sn = Vt(xi, ct * 100), ur = Vt(Ri, Jt * 100), cn = Vt(Li, xr * 100), Si = c ? {
1242
+ bottom: Zn,
1243
+ height: sa,
1208
1244
  top: "auto",
1209
1245
  left: "0",
1210
1246
  right: "0"
1211
1247
  } : {
1212
- left: Xn,
1213
- width: Ka,
1248
+ left: Zn,
1249
+ width: sa,
1214
1250
  top: "0",
1215
1251
  bottom: "0"
1216
- }, gi = Math.max(0.01, st - at), ja = Math.max(0.06, Math.min(0.25, 0.28 * Math.sqrt(gi))), hi = s ? { bottom: Xa, left: "50%", transform: "translate(-50%, 50%)", zIndex: Tr ? 40 : 30 } : { left: Xa, top: "50%", transform: "translate(-50%, -50%)", zIndex: Tr ? 40 : 30 }, bi = s ? { bottom: Ga, left: "50%", transform: "translate(-50%, 50%)", zIndex: Pr ? 40 : 30 } : { left: Ga, top: "50%", transform: "translate(-50%, -50%)", zIndex: Pr ? 40 : 30 }, wi = s ? { bottom: `${He}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${He}%`, top: "50%", transform: "translate(-50%, -50%)" }, qa = we !== null ? ce(we) : null, vi = g !== "hover" && we !== null && (we === ve || !ne && we === pe), pi = nt ? Q(b, se[0]) : xe, Mi = nt ? Q(b, se[se.length - 1]) : $e, Di = fe ? Ce > pi : ve > k, xi = fe ? _e < Mi : pe < V, ln = cl(
1217
- fe ? [
1252
+ }, yi = Math.max(0.01, ct - ot), ca = Math.max(0.06, Math.min(0.25, 0.28 * Math.sqrt(yi))), Ti = c ? { bottom: ia, left: "50%", transform: "translate(-50%, 50%)", zIndex: Ar ? 40 : 30 } : { left: ia, top: "50%", transform: "translate(-50%, -50%)", zIndex: Ar ? 40 : 30 }, Pi = c ? { bottom: la, left: "50%", transform: "translate(-50%, 50%)", zIndex: $r ? 40 : 30 } : { left: la, top: "50%", transform: "translate(-50%, -50%)", zIndex: $r ? 40 : 30 }, Ai = c ? { bottom: `${bt}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${bt}%`, top: "50%", transform: "translate(-50%, -50%)" }, ua = _e !== null ? ce(_e) : null, $i = h !== "hover" && _e !== null && (_e === Se || !re && _e === ye), Ei = nt ? Q(b, se[0]) : xe, Ii = nt ? Q(b, se[se.length - 1]) : Ee, Ci = ae ? Ce > Ei : Se > k, Vi = ae ? Ue < Ii : ye < I, un = xl(
1253
+ ae ? [
1218
1254
  {
1219
- side: A ? "before" : "after",
1220
- box: fn(Sa, ya),
1221
- ...s ? { reach: "inline-size" } : { reach: "rotated", angleDeg: rr.slant.lowAngleDeg, centreOffsetPx: null, alongPushPx: rr.slant.lowOffsetX }
1255
+ side: d ? "before" : "after",
1256
+ box: wn(Vo, No),
1257
+ ...c ? { reach: "inline-size" } : { reach: "rotated", angleDeg: lr.slant.lowAngleDeg, centreOffsetPx: null, alongPushPx: lr.slant.lowOffsetX }
1222
1258
  },
1223
1259
  {
1224
- side: A ? "after" : "before",
1225
- box: H ? In : fn(In, Ta),
1226
- ...s ? { reach: "inline-size" } : { reach: "rotated", angleDeg: nr.slant.lowAngleDeg, centreOffsetPx: null, alongPushPx: nr.slant.lowOffsetX }
1260
+ side: d ? "after" : "before",
1261
+ box: O ? Yn : wn(Yn, ko),
1262
+ ...c ? { reach: "inline-size" } : { reach: "rotated", angleDeg: sr.slant.lowAngleDeg, centreOffsetPx: null, alongPushPx: sr.slant.lowOffsetX }
1227
1263
  }
1228
1264
  ] : [
1229
1265
  {
1230
1266
  // 縦向きのラベルは labelPosition に関わらずスタイルシートが左へ置く
1231
- side: s || D === "top" ? "before" : "after",
1232
- box: ne ? Jt : fn(Jt, La),
1233
- ...s ? { reach: "inline-size" } : { reach: "rotated", angleDeg: yr.lowAngleDeg, centreOffsetPx: yr.lowOffsetY, alongPushPx: yr.lowOffsetX }
1267
+ side: c || D === "top" ? "before" : "after",
1268
+ box: re ? tr : wn(tr, Co),
1269
+ ...c ? { reach: "inline-size" } : { reach: "rotated", angleDeg: Pr.lowAngleDeg, centreOffsetPx: Pr.lowOffsetY, alongPushPx: Pr.lowOffsetX }
1234
1270
  }
1235
1271
  ]
1236
- ), Ri = ln === void 0 ? e.style : { ...e.style, ...ln.style };
1237
- Cr(() => {
1238
- Ma.current = ln === void 0 ? 0 : ln.mainPx;
1272
+ ), Ni = un === void 0 ? e.style : { ...e.style, ...un.style };
1273
+ Nr(() => {
1274
+ Ao.current = un === void 0 ? 0 : un.mainPx;
1239
1275
  });
1240
- const ut = H ? "micro-point" : "micro-low", _t = l ? "cursor-not-allowed opacity-50" : "cursor-pointer", Za = (o) => {
1241
- const u = s ? "vertical" : "horizontal", d = o === "decrease", m = s ? !d : d;
1242
- return /* @__PURE__ */ I(
1243
- Ut,
1276
+ const dt = O ? "micro-point" : "micro-low", _t = l ? "cursor-not-allowed opacity-50" : "cursor-pointer", da = (a) => {
1277
+ const u = c ? "vertical" : "horizontal", m = a === "decrease", f = c ? !m : m;
1278
+ return /* @__PURE__ */ $(
1279
+ Xt,
1244
1280
  {
1245
- ref: d ? Da : xa,
1281
+ ref: m ? $o : Eo,
1246
1282
  neighbour: "rail",
1247
- direction: ul[u][o],
1283
+ direction: Rl[u][a],
1248
1284
  disabled: l,
1249
- canStep: d ? Di : xi,
1250
- onStep: () => zn(d ? -1 : 1),
1251
- ariaLabel: d ? ue : ae,
1252
- className: `period-slider-stepper-btn ${dl[u][o]} ${wo[u][m ? "leading" : "trailing"]}`
1285
+ canStep: m ? Ci : Vi,
1286
+ onStep: () => Xn(m ? -1 : 1),
1287
+ ariaLabel: m ? ue : ne,
1288
+ className: `period-slider-stepper-btn ${Ll[u][a]} ${Ea[u][f ? "leading" : "trailing"]}`
1253
1289
  }
1254
1290
  );
1255
1291
  };
1256
- return /* @__PURE__ */ Me(
1292
+ return /* @__PURE__ */ we(
1257
1293
  "div",
1258
1294
  {
1259
- ref: Mr,
1260
- style: Ri,
1261
- className: `period-slider grid select-none place-items-center ${ml[s ? "vertical" : "horizontal"][f ? "withSteppers" : "railOnly"]} ${c}`,
1295
+ ref: Rr,
1296
+ style: Ni,
1297
+ className: `period-slider grid select-none place-items-center ${Sl[c ? "vertical" : "horizontal"][g ? "withSteppers" : "railOnly"]} ${s}`,
1262
1298
  "data-disabled": l ? "true" : void 0,
1263
1299
  "data-unit": t,
1264
1300
  "data-mode": e.mode,
1265
- "data-orientation": s ? "vertical" : "horizontal",
1301
+ "data-orientation": c ? "vertical" : "horizontal",
1266
1302
  "data-label-position": D,
1267
1303
  "data-color-scheme": ee,
1268
1304
  children: [
1269
- /* @__PURE__ */ I("div", { ref: pa, "data-range-area": "true", "aria-hidden": "true", className: "period-slider-range-area" }),
1270
- f && Za(s ? "increase" : "decrease"),
1271
- /* @__PURE__ */ I(
1305
+ /* @__PURE__ */ $("div", { ref: Po, "data-range-area": "true", "aria-hidden": "true", className: "period-slider-range-area" }),
1306
+ g && da(c ? "increase" : "decrease"),
1307
+ /* @__PURE__ */ $(
1272
1308
  "div",
1273
1309
  {
1274
- ref: Xe,
1310
+ ref: Ke,
1275
1311
  "data-testid": "period-slider-track",
1276
- "data-orientation": s ? "vertical" : "horizontal",
1277
- "data-vernier-orientation": fe ? Nt : void 0,
1278
- className: `period-slider-track relative touch-none rounded-full ${wo[s ? "vertical" : "horizontal"][f ? "rail" : "railOnly"]} ${_t}`,
1279
- onPointerDown: Qo,
1280
- onPointerMove: ei,
1281
- onPointerLeave: ti,
1282
- children: fe ? /* @__PURE__ */ Me(jn, { children: [
1283
- Wt && (s ? /* @__PURE__ */ Me("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: [
1284
- /* @__PURE__ */ I("defs", { children: /* @__PURE__ */ Me("linearGradient", { id: oe, x1: "0", y1: "0", x2: "1", y2: "0", children: [
1285
- /* @__PURE__ */ I("stop", { offset: "0%", stopColor: A ? W.macro : W.micro, stopOpacity: "0.28" }),
1286
- /* @__PURE__ */ I("stop", { offset: "100%", stopColor: A ? W.micro : W.macro, stopOpacity: ja })
1312
+ "data-orientation": c ? "vertical" : "horizontal",
1313
+ "data-vernier-orientation": ae ? Kt : void 0,
1314
+ className: `period-slider-track relative touch-none rounded-full ${Ea[c ? "vertical" : "horizontal"][g ? "rail" : "railOnly"]} ${_t}`,
1315
+ onPointerDown: di,
1316
+ onPointerMove: mi,
1317
+ onPointerLeave: fi,
1318
+ children: ae ? /* @__PURE__ */ we(eo, { children: [
1319
+ W && (c ? /* @__PURE__ */ we("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: [
1320
+ /* @__PURE__ */ $("defs", { children: /* @__PURE__ */ we("linearGradient", { id: ie, x1: "0", y1: "0", x2: "1", y2: "0", children: [
1321
+ /* @__PURE__ */ $("stop", { offset: "0%", stopColor: d ? G.macro : G.micro, stopOpacity: "0.28" }),
1322
+ /* @__PURE__ */ $("stop", { offset: "100%", stopColor: d ? G.micro : G.macro, stopOpacity: ca })
1287
1323
  ] }) }),
1288
- /* @__PURE__ */ I("path", { ref: $n, "data-testid": "period-slider-vernier-projection", d: Qn(at, st, s, A), fill: `url(#${oe})` })
1289
- ] }) : /* @__PURE__ */ Me("svg", { className: "period-slider-vernier-projection", role: "presentation", "aria-hidden": "true", width: "100%", height: "32", viewBox: "0 0 100 32", preserveAspectRatio: "none", children: [
1290
- /* @__PURE__ */ I("defs", { children: /* @__PURE__ */ Me("linearGradient", { id: oe, x1: "0", y1: "0", x2: "0", y2: "1", children: [
1291
- /* @__PURE__ */ I("stop", { offset: "0%", stopColor: A ? W.macro : W.micro, stopOpacity: "0.28" }),
1292
- /* @__PURE__ */ I("stop", { offset: "100%", stopColor: A ? W.micro : W.macro, stopOpacity: ja })
1324
+ /* @__PURE__ */ $("path", { ref: Nn, "data-testid": "period-slider-vernier-projection", d: oo(ot, ct, c, d), fill: `url(#${ie})` })
1325
+ ] }) : /* @__PURE__ */ we("svg", { className: "period-slider-vernier-projection", role: "presentation", "aria-hidden": "true", width: "100%", height: "32", viewBox: "0 0 100 32", preserveAspectRatio: "none", children: [
1326
+ /* @__PURE__ */ $("defs", { children: /* @__PURE__ */ we("linearGradient", { id: ie, x1: "0", y1: "0", x2: "0", y2: "1", children: [
1327
+ /* @__PURE__ */ $("stop", { offset: "0%", stopColor: d ? G.macro : G.micro, stopOpacity: "0.28" }),
1328
+ /* @__PURE__ */ $("stop", { offset: "100%", stopColor: d ? G.micro : G.macro, stopOpacity: ca })
1293
1329
  ] }) }),
1294
- /* @__PURE__ */ I("path", { ref: $n, "data-testid": "period-slider-vernier-projection", d: Qn(at, st, s, A), fill: `url(#${oe})` })
1330
+ /* @__PURE__ */ $("path", { ref: Nn, "data-testid": "period-slider-vernier-projection", d: oo(ot, ct, c, d), fill: `url(#${ie})` })
1295
1331
  ] })),
1296
- !S && /* @__PURE__ */ Me(jn, { children: [
1297
- /* @__PURE__ */ I(
1332
+ !M && /* @__PURE__ */ we(eo, { children: [
1333
+ /* @__PURE__ */ $(
1298
1334
  "div",
1299
1335
  {
1300
1336
  "data-testid": "period-slider-connect-macro",
1301
1337
  className: "period-slider-connect-macro",
1302
- style: s ? {
1303
- bottom: `calc(${ar} - 8px)`,
1304
- height: `calc(${an} - ${ar} + 16px)`
1338
+ style: c ? {
1339
+ bottom: `calc(${cr} - 8px)`,
1340
+ height: `calc(${sn} - ${cr} + 16px)`
1305
1341
  } : {
1306
- left: `calc(${ar} - 8px)`,
1307
- width: `calc(${an} - ${ar} + 16px)`
1342
+ left: `calc(${cr} - 8px)`,
1343
+ width: `calc(${sn} - ${cr} + 16px)`
1308
1344
  },
1309
- onPointerDown: er("macro-connect")
1345
+ onPointerDown: ar("macro-connect")
1310
1346
  }
1311
1347
  ),
1312
- !H && /* @__PURE__ */ I(
1348
+ !O && /* @__PURE__ */ $(
1313
1349
  "div",
1314
1350
  {
1315
1351
  "data-testid": "period-slider-connect-micro",
1316
1352
  className: "period-slider-connect-micro",
1317
- style: s ? {
1318
- bottom: `calc(${or} - 8px)`,
1319
- height: `calc(${on} - ${or} + 16px)`
1353
+ style: c ? {
1354
+ bottom: `calc(${ur} - 8px)`,
1355
+ height: `calc(${cn} - ${ur} + 16px)`
1320
1356
  } : {
1321
- left: `calc(${or} - 8px)`,
1322
- width: `calc(${on} - ${or} + 16px)`
1357
+ left: `calc(${ur} - 8px)`,
1358
+ width: `calc(${cn} - ${ur} + 16px)`
1323
1359
  },
1324
- onPointerDown: er("micro-connect")
1360
+ onPointerDown: ar("micro-connect")
1325
1361
  }
1326
1362
  )
1327
1363
  ] }),
1328
- fa && /* @__PURE__ */ Me("div", { className: "period-slider-vernier-ticks pointer-events-none absolute inset-0", children: [
1329
- [0.2, 0.4, 0.6, 0.8].map((o) => /* @__PURE__ */ I("div", { "data-testid": "period-slider-tick", "data-tick-scale": "macro", className: "period-slider-tick period-slider-tick-macro", style: s ? { bottom: `${o * 100}%` } : { left: `${o * 100}%` } }, `macro-tick-${o}`)),
1330
- [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9].map((o) => /* @__PURE__ */ I("div", { "data-testid": "period-slider-tick", "data-tick-scale": "micro", className: "period-slider-tick period-slider-tick-micro", style: s ? { bottom: `${o * 100}%` } : { left: `${o * 100}%` } }, `micro-tick-${o}`))
1364
+ je && /* @__PURE__ */ we("div", { className: "period-slider-vernier-ticks pointer-events-none absolute inset-0", children: [
1365
+ [0.2, 0.4, 0.6, 0.8].map((a) => /* @__PURE__ */ $("div", { "data-testid": "period-slider-tick", "data-tick-scale": "macro", className: "period-slider-tick period-slider-tick-macro", style: c ? { bottom: `${a * 100}%` } : { left: `${a * 100}%` } }, `macro-tick-${a}`)),
1366
+ [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9].map((a) => /* @__PURE__ */ $("div", { "data-testid": "period-slider-tick", "data-tick-scale": "micro", className: "period-slider-tick period-slider-tick-micro", style: c ? { bottom: `${a * 100}%` } : { left: `${a * 100}%` } }, `micro-tick-${a}`))
1331
1367
  ] }),
1332
- /* @__PURE__ */ Me(
1368
+ /* @__PURE__ */ we(
1333
1369
  "div",
1334
1370
  {
1335
1371
  tabIndex: l ? -1 : 0,
1336
1372
  role: "slider",
1337
1373
  "aria-label": e.macroLowerAriaLabel ?? "Macro range start",
1338
1374
  "aria-disabled": l ? "true" : void 0,
1339
- "aria-valuemin": Ie,
1340
- "aria-valuemax": Ye,
1341
- "aria-valuenow": ke,
1342
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(bt, h) : dr(h, bt, Ur, x),
1343
- "aria-orientation": s ? "vertical" : "horizontal",
1344
- className: `period-slider-handle period-slider-handle-vernier ${s ? "is-vertical" : ""} group absolute touch-none ${s ? A ? "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4" : "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0" : A ? "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0" : "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${_t}`,
1345
- style: s ? {
1346
- bottom: ar,
1347
- left: A ? 0 : "auto",
1348
- right: A ? "auto" : 0,
1349
- transform: A ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1350
- zIndex: We === "macro-low" || Ne === "macro-low" ? 30 : 15
1375
+ "aria-valuemin": ke,
1376
+ "aria-valuemax": Be,
1377
+ "aria-valuenow": ze,
1378
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(wt, F) : gr(F, wt, Xr, x),
1379
+ "aria-orientation": c ? "vertical" : "horizontal",
1380
+ className: `period-slider-handle period-slider-handle-vernier ${c ? "is-vertical" : ""} group absolute touch-none ${c ? d ? "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4" : "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0" : d ? "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0" : "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${_t}`,
1381
+ style: c ? {
1382
+ bottom: cr,
1383
+ left: d ? 0 : "auto",
1384
+ right: d ? "auto" : 0,
1385
+ transform: d ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1386
+ zIndex: Xe === "macro-low" || Ne === "macro-low" ? 30 : 15
1351
1387
  } : {
1352
- left: ar,
1353
- top: A ? 0 : "auto",
1354
- bottom: A ? "auto" : 0,
1355
- transform: A ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1356
- zIndex: We === "macro-low" || Ne === "macro-low" ? 30 : 15
1388
+ left: cr,
1389
+ top: d ? 0 : "auto",
1390
+ bottom: d ? "auto" : 0,
1391
+ transform: d ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1392
+ zIndex: Xe === "macro-low" || Ne === "macro-low" ? 30 : 15
1357
1393
  },
1358
- onPointerDown: er("macro-low"),
1359
- onKeyDown: en("macro-low"),
1360
- onFocus: Qr("macro-low"),
1361
- "data-active": We === "macro-low" ? "true" : void 0,
1394
+ onPointerDown: ar("macro-low"),
1395
+ onKeyDown: nn("macro-low"),
1396
+ onFocus: rn("macro-low"),
1397
+ "data-active": Xe === "macro-low" ? "true" : void 0,
1362
1398
  "data-front": Ne === "macro-low" ? "true" : void 0,
1363
- "data-vernier-pos": s ? A ? "left" : "right" : A ? "top" : "bottom",
1399
+ "data-vernier-pos": c ? d ? "left" : "right" : d ? "top" : "bottom",
1364
1400
  "data-handle-type": "macro-low",
1365
1401
  children: [
1366
- /* @__PURE__ */ I(Yr, { type: "macro", isTop: A, isVertical: s, isLeft: A }),
1367
- w && /* @__PURE__ */ I("div", { "data-testid": "period-slider-hairline", className: "period-slider-hairline" }),
1368
- g !== "hover" && /* @__PURE__ */ I(
1402
+ /* @__PURE__ */ $(Hr, { type: "macro", isTop: d, isVertical: c, isLeft: d }),
1403
+ Lt && /* @__PURE__ */ $("div", { "data-testid": "period-slider-hairline", className: "period-slider-hairline" }),
1404
+ h !== "hover" && /* @__PURE__ */ $(
1369
1405
  "div",
1370
1406
  {
1371
- className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${g === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1372
- "data-tooltip-style": g,
1373
- "data-duplicate": ni ? "true" : void 0,
1374
- "data-slanted": rr.slant.isSlanted ? "true" : void 0,
1375
- ref: Bo,
1376
- style: rr.lowStyle,
1377
- children: Ke(h, bt, Ur, x)
1407
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1408
+ "data-tooltip-style": h,
1409
+ "data-duplicate": hi ? "true" : void 0,
1410
+ "data-slanted": lr.slant.isSlanted ? "true" : void 0,
1411
+ ref: ti,
1412
+ style: lr.lowStyle,
1413
+ children: qe(F, wt, Xr, x)
1378
1414
  }
1379
1415
  )
1380
1416
  ]
1381
1417
  }
1382
1418
  ),
1383
- /* @__PURE__ */ Me(
1419
+ /* @__PURE__ */ we(
1384
1420
  "div",
1385
1421
  {
1386
1422
  tabIndex: l ? -1 : 0,
1387
1423
  role: "slider",
1388
1424
  "aria-label": e.macroUpperAriaLabel ?? "Macro range end",
1389
1425
  "aria-disabled": l ? "true" : void 0,
1390
- "aria-valuemin": ke,
1391
- "aria-valuemax": Ze,
1392
- "aria-valuenow": Ye,
1393
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(kt, h) : dr(h, kt, Ur, x),
1394
- "aria-orientation": s ? "vertical" : "horizontal",
1395
- className: `period-slider-handle period-slider-handle-vernier ${s ? "is-vertical" : ""} group absolute touch-none ${s ? A ? "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4" : "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0" : A ? "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0" : "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${_t}`,
1396
- style: s ? {
1397
- bottom: an,
1398
- left: A ? 0 : "auto",
1399
- right: A ? "auto" : 0,
1400
- transform: A ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1401
- zIndex: We === "macro-high" || Ne === "macro-high" ? 30 : 15
1426
+ "aria-valuemin": ze,
1427
+ "aria-valuemax": st,
1428
+ "aria-valuenow": Be,
1429
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Yt, F) : gr(F, Yt, Xr, x),
1430
+ "aria-orientation": c ? "vertical" : "horizontal",
1431
+ className: `period-slider-handle period-slider-handle-vernier ${c ? "is-vertical" : ""} group absolute touch-none ${c ? d ? "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4" : "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0" : d ? "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0" : "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${_t}`,
1432
+ style: c ? {
1433
+ bottom: sn,
1434
+ left: d ? 0 : "auto",
1435
+ right: d ? "auto" : 0,
1436
+ transform: d ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1437
+ zIndex: Xe === "macro-high" || Ne === "macro-high" ? 30 : 15
1402
1438
  } : {
1403
- left: an,
1404
- top: A ? 0 : "auto",
1405
- bottom: A ? "auto" : 0,
1406
- transform: A ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1407
- zIndex: We === "macro-high" || Ne === "macro-high" ? 30 : 15
1439
+ left: sn,
1440
+ top: d ? 0 : "auto",
1441
+ bottom: d ? "auto" : 0,
1442
+ transform: d ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1443
+ zIndex: Xe === "macro-high" || Ne === "macro-high" ? 30 : 15
1408
1444
  },
1409
- onPointerDown: er("macro-high"),
1410
- onKeyDown: en("macro-high"),
1411
- onFocus: Qr("macro-high"),
1412
- "data-active": We === "macro-high" ? "true" : void 0,
1445
+ onPointerDown: ar("macro-high"),
1446
+ onKeyDown: nn("macro-high"),
1447
+ onFocus: rn("macro-high"),
1448
+ "data-active": Xe === "macro-high" ? "true" : void 0,
1413
1449
  "data-front": Ne === "macro-high" ? "true" : void 0,
1414
- "data-vernier-pos": s ? A ? "left" : "right" : A ? "top" : "bottom",
1450
+ "data-vernier-pos": c ? d ? "left" : "right" : d ? "top" : "bottom",
1415
1451
  "data-handle-type": "macro-high",
1416
1452
  children: [
1417
- /* @__PURE__ */ I(Yr, { type: "macro", isTop: A, isVertical: s, isLeft: A }),
1418
- w && /* @__PURE__ */ I("div", { "data-testid": "period-slider-hairline", className: "period-slider-hairline" }),
1419
- g !== "hover" && /* @__PURE__ */ I(
1453
+ /* @__PURE__ */ $(Hr, { type: "macro", isTop: d, isVertical: c, isLeft: d }),
1454
+ Lt && /* @__PURE__ */ $("div", { "data-testid": "period-slider-hairline", className: "period-slider-hairline" }),
1455
+ h !== "hover" && /* @__PURE__ */ $(
1420
1456
  "div",
1421
1457
  {
1422
- className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${g === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1423
- "data-tooltip-style": g,
1424
- "data-duplicate": ai ? "true" : void 0,
1425
- "data-slanted": rr.slant.isSlanted ? "true" : void 0,
1426
- ref: Uo,
1427
- style: rr.highStyle,
1428
- children: Ke(h, kt, Ur, x)
1458
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1459
+ "data-tooltip-style": h,
1460
+ "data-duplicate": bi ? "true" : void 0,
1461
+ "data-slanted": lr.slant.isSlanted ? "true" : void 0,
1462
+ ref: ri,
1463
+ style: lr.highStyle,
1464
+ children: qe(F, Yt, Xr, x)
1429
1465
  }
1430
1466
  )
1431
1467
  ]
1432
1468
  }
1433
1469
  ),
1434
- /* @__PURE__ */ Me(
1470
+ /* @__PURE__ */ we(
1435
1471
  "div",
1436
1472
  {
1437
1473
  tabIndex: l ? -1 : 0,
1438
1474
  role: "slider",
1439
- "aria-label": H ? e.pointAriaLabel ?? "Micro selected date" : e.lowerAriaLabel ?? "Micro range start",
1475
+ "aria-label": O ? e.pointAriaLabel ?? "Micro selected date" : e.lowerAriaLabel ?? "Micro range start",
1440
1476
  "aria-disabled": l ? "true" : void 0,
1441
1477
  "aria-valuemin": xe,
1442
- "aria-valuemax": H ? $e : _e,
1478
+ "aria-valuemax": O ? Ee : Ue,
1443
1479
  "aria-valuenow": Ce,
1444
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(St, b) : dr(b, St, Wr, x),
1445
- "aria-orientation": s ? "vertical" : "horizontal",
1446
- className: `period-slider-handle period-slider-handle-vernier ${s ? "is-vertical" : ""} group absolute touch-none ${s ? A ? "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0" : "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4" : A ? "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4" : "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${_t}`,
1447
- style: s ? {
1448
- bottom: or,
1449
- left: A ? "auto" : 0,
1450
- right: A ? 0 : "auto",
1451
- transform: A ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1452
- zIndex: We === ut || Ne === ut ? 30 : 20
1480
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Tt, b) : gr(b, Tt, Kr, x),
1481
+ "aria-orientation": c ? "vertical" : "horizontal",
1482
+ className: `period-slider-handle period-slider-handle-vernier ${c ? "is-vertical" : ""} group absolute touch-none ${c ? d ? "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0" : "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4" : d ? "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4" : "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${_t}`,
1483
+ style: c ? {
1484
+ bottom: ur,
1485
+ left: d ? "auto" : 0,
1486
+ right: d ? 0 : "auto",
1487
+ transform: d ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1488
+ zIndex: Xe === dt || Ne === dt ? 30 : 20
1453
1489
  } : {
1454
- left: or,
1455
- top: A ? "auto" : 0,
1456
- bottom: A ? 0 : "auto",
1457
- transform: A ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1458
- zIndex: We === ut || Ne === ut ? 30 : 20
1490
+ left: ur,
1491
+ top: d ? "auto" : 0,
1492
+ bottom: d ? 0 : "auto",
1493
+ transform: d ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1494
+ zIndex: Xe === dt || Ne === dt ? 30 : 20
1459
1495
  },
1460
- onPointerDown: er(ut),
1461
- onKeyDown: en(ut),
1462
- onFocus: Qr(ut),
1463
- "data-active": We === ut ? "true" : void 0,
1464
- "data-front": Ne === ut ? "true" : void 0,
1465
- "data-vernier-pos": s ? A ? "right" : "left" : A ? "bottom" : "top",
1466
- "data-handle-type": ut,
1496
+ onPointerDown: ar(dt),
1497
+ onKeyDown: nn(dt),
1498
+ onFocus: rn(dt),
1499
+ "data-active": Xe === dt ? "true" : void 0,
1500
+ "data-front": Ne === dt ? "true" : void 0,
1501
+ "data-vernier-pos": c ? d ? "right" : "left" : d ? "bottom" : "top",
1502
+ "data-handle-type": dt,
1467
1503
  children: [
1468
- /* @__PURE__ */ I(Yr, { type: "micro", isTop: !A, isVertical: s, isLeft: !A }),
1469
- w && /* @__PURE__ */ I("div", { "data-testid": "period-slider-hairline", className: "period-slider-hairline" }),
1470
- g !== "hover" && /* @__PURE__ */ I(
1504
+ /* @__PURE__ */ $(Hr, { type: "micro", isTop: !d, isVertical: c, isLeft: !d }),
1505
+ Lt && /* @__PURE__ */ $("div", { "data-testid": "period-slider-hairline", className: "period-slider-hairline" }),
1506
+ h !== "hover" && /* @__PURE__ */ $(
1471
1507
  "div",
1472
1508
  {
1473
- className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${g === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1474
- "data-tooltip-style": g,
1475
- "data-duplicate": oi ? "true" : void 0,
1476
- "data-slanted": nr.slant.isSlanted ? "true" : void 0,
1477
- ref: Wo,
1478
- style: nr.lowStyle,
1479
- children: Ke(b, St, Wr, x)
1509
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1510
+ "data-tooltip-style": h,
1511
+ "data-duplicate": wi ? "true" : void 0,
1512
+ "data-slanted": sr.slant.isSlanted ? "true" : void 0,
1513
+ ref: ni,
1514
+ style: sr.lowStyle,
1515
+ children: qe(b, Tt, Kr, x)
1480
1516
  }
1481
1517
  )
1482
1518
  ]
1483
1519
  }
1484
1520
  ),
1485
- !H && /* @__PURE__ */ Me(
1521
+ !O && /* @__PURE__ */ we(
1486
1522
  "div",
1487
1523
  {
1488
1524
  tabIndex: l ? -1 : 0,
@@ -1490,150 +1526,150 @@ const ol = (e, t) => {
1490
1526
  "aria-label": e.upperAriaLabel ?? "Micro range end",
1491
1527
  "aria-disabled": l ? "true" : void 0,
1492
1528
  "aria-valuemin": Ce,
1493
- "aria-valuemax": $e,
1494
- "aria-valuenow": _e,
1495
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(yt, b) : dr(b, yt, Wr, x),
1496
- "aria-orientation": s ? "vertical" : "horizontal",
1497
- className: `period-slider-handle period-slider-handle-vernier ${s ? "is-vertical" : ""} group absolute touch-none ${s ? A ? "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0" : "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4" : A ? "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4" : "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${_t}`,
1498
- style: s ? {
1499
- bottom: on,
1500
- left: A ? "auto" : 0,
1501
- right: A ? 0 : "auto",
1502
- transform: A ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1503
- zIndex: We === "micro-high" || Ne === "micro-high" ? 30 : 20
1529
+ "aria-valuemax": Ee,
1530
+ "aria-valuenow": Ue,
1531
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Pt, b) : gr(b, Pt, Kr, x),
1532
+ "aria-orientation": c ? "vertical" : "horizontal",
1533
+ className: `period-slider-handle period-slider-handle-vernier ${c ? "is-vertical" : ""} group absolute touch-none ${c ? d ? "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0" : "after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4" : d ? "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4" : "after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${_t}`,
1534
+ style: c ? {
1535
+ bottom: cn,
1536
+ left: d ? "auto" : 0,
1537
+ right: d ? 0 : "auto",
1538
+ transform: d ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1539
+ zIndex: Xe === "micro-high" || Ne === "micro-high" ? 30 : 20
1504
1540
  } : {
1505
- left: on,
1506
- top: A ? "auto" : 0,
1507
- bottom: A ? 0 : "auto",
1508
- transform: A ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1509
- zIndex: We === "micro-high" || Ne === "micro-high" ? 30 : 20
1541
+ left: cn,
1542
+ top: d ? "auto" : 0,
1543
+ bottom: d ? 0 : "auto",
1544
+ transform: d ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1545
+ zIndex: Xe === "micro-high" || Ne === "micro-high" ? 30 : 20
1510
1546
  },
1511
- onPointerDown: er("micro-high"),
1512
- onKeyDown: en("micro-high"),
1513
- onFocus: Qr("micro-high"),
1514
- "data-active": We === "micro-high" ? "true" : void 0,
1547
+ onPointerDown: ar("micro-high"),
1548
+ onKeyDown: nn("micro-high"),
1549
+ onFocus: rn("micro-high"),
1550
+ "data-active": Xe === "micro-high" ? "true" : void 0,
1515
1551
  "data-front": Ne === "micro-high" ? "true" : void 0,
1516
- "data-vernier-pos": s ? A ? "right" : "left" : A ? "bottom" : "top",
1552
+ "data-vernier-pos": c ? d ? "right" : "left" : d ? "bottom" : "top",
1517
1553
  "data-handle-type": "micro-high",
1518
1554
  children: [
1519
- /* @__PURE__ */ I(Yr, { type: "micro", isTop: !A, isVertical: s, isLeft: !A }),
1520
- w && /* @__PURE__ */ I("div", { "data-testid": "period-slider-hairline", className: "period-slider-hairline" }),
1521
- g !== "hover" && /* @__PURE__ */ I(
1555
+ /* @__PURE__ */ $(Hr, { type: "micro", isTop: !d, isVertical: c, isLeft: !d }),
1556
+ Lt && /* @__PURE__ */ $("div", { "data-testid": "period-slider-hairline", className: "period-slider-hairline" }),
1557
+ h !== "hover" && /* @__PURE__ */ $(
1522
1558
  "div",
1523
1559
  {
1524
- className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${g === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1525
- "data-tooltip-style": g,
1526
- "data-duplicate": ii ? "true" : void 0,
1527
- "data-slanted": nr.slant.isSlanted ? "true" : void 0,
1528
- ref: Xo,
1529
- style: nr.highStyle,
1530
- children: Ke(b, yt, Wr, x)
1560
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1561
+ "data-tooltip-style": h,
1562
+ "data-duplicate": vi ? "true" : void 0,
1563
+ "data-slanted": sr.slant.isSlanted ? "true" : void 0,
1564
+ ref: oi,
1565
+ style: sr.highStyle,
1566
+ children: qe(b, Pt, Kr, x)
1531
1567
  }
1532
1568
  )
1533
1569
  ]
1534
1570
  }
1535
1571
  )
1536
- ] }) : /* @__PURE__ */ Me(jn, { children: [
1537
- !S && /* @__PURE__ */ I("div", { "data-testid": "period-slider-connect", className: "period-slider-connect absolute rounded-full", style: fi, onPointerDown: Jo }),
1538
- Z && T && L.length > 1 && /* @__PURE__ */ I("div", { className: "period-slider-ticks pointer-events-none absolute inset-0", children: L.map((o, u) => {
1539
- const d = Q(t, o), m = Ot(u), M = s ? { bottom: `${m}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${m}%`, top: "50%", transform: "translate(-50%, -50%)" };
1540
- return /* @__PURE__ */ I("div", { "data-testid": "period-slider-tick", className: "period-slider-tick absolute h-1.5 w-1.5 rounded-full", style: M }, `tick-${d}`);
1572
+ ] }) : /* @__PURE__ */ we(eo, { children: [
1573
+ !M && /* @__PURE__ */ $("div", { "data-testid": "period-slider-connect", className: "period-slider-connect absolute rounded-full", style: Si, onPointerDown: ui }),
1574
+ Z && y && L.length > 1 && /* @__PURE__ */ $("div", { className: "period-slider-ticks pointer-events-none absolute inset-0", children: L.map((a, u) => {
1575
+ const m = Q(t, a), f = Ht(u), w = c ? { bottom: `${f}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${f}%`, top: "50%", transform: "translate(-50%, -50%)" };
1576
+ return /* @__PURE__ */ $("div", { "data-testid": "period-slider-tick", className: "period-slider-tick absolute h-1.5 w-1.5 rounded-full", style: w }, `tick-${m}`);
1541
1577
  }) }),
1542
- !l && we !== null && He !== null && v === null && qa && /* @__PURE__ */ Me("div", { "data-testid": "period-slider-hover-guide", className: "period-slider-hover-guide pointer-events-none absolute h-2 w-2", style: wi, children: [
1543
- /* @__PURE__ */ I("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" }),
1544
- /* @__PURE__ */ I(
1578
+ !l && _e !== null && bt !== null && Y === null && ua && /* @__PURE__ */ we("div", { "data-testid": "period-slider-hover-guide", className: "period-slider-hover-guide pointer-events-none absolute h-2 w-2", style: Ai, children: [
1579
+ /* @__PURE__ */ $("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" }),
1580
+ /* @__PURE__ */ $(
1545
1581
  "div",
1546
1582
  {
1547
1583
  "data-testid": "period-slider-hover-tooltip",
1548
- "data-duplicate": vi ? "true" : void 0,
1549
- className: `period-slider-hover-tooltip ${D === "bottom" && !s ? "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`,
1550
- children: Ke(t, qa, e.formatLabel, x)
1584
+ "data-duplicate": $i ? "true" : void 0,
1585
+ className: `period-slider-hover-tooltip ${D === "bottom" && !c ? "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`,
1586
+ children: qe(t, ua, e.formatLabel, x)
1551
1587
  }
1552
1588
  )
1553
1589
  ] }),
1554
- /* @__PURE__ */ Me(
1590
+ /* @__PURE__ */ we(
1555
1591
  "div",
1556
1592
  {
1557
1593
  tabIndex: l ? -1 : 0,
1558
1594
  role: "slider",
1559
- "aria-label": ne ? e.pointAriaLabel ?? "Selected date" : e.lowerAriaLabel ?? "Range start",
1595
+ "aria-label": re ? e.pointAriaLabel ?? "Selected date" : e.lowerAriaLabel ?? "Range start",
1560
1596
  "aria-disabled": l ? "true" : void 0,
1561
1597
  "aria-valuemin": k,
1562
- "aria-valuemax": ne ? V : pe,
1563
- "aria-valuenow": ve,
1564
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Bn, t) : dr(t, Bn, e.formatLabel, x),
1565
- "aria-orientation": s ? "vertical" : "horizontal",
1598
+ "aria-valuemax": re ? I : ye,
1599
+ "aria-valuenow": Se,
1600
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Kn, t) : gr(t, Kn, e.formatLabel, x),
1601
+ "aria-orientation": c ? "vertical" : "horizontal",
1566
1602
  className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[calc((100%-var(--ps-target-size))/2)] after:content-[''] focus-visible:outline-hidden ${_t}`,
1567
- style: hi,
1568
- onPointerDown: Oa("low"),
1569
- onKeyDown: _a("low"),
1570
- onFocus: Ha("low"),
1571
- "data-active": v === "low" ? "true" : void 0,
1572
- "data-front": Tr ? "true" : void 0,
1603
+ style: Ti,
1604
+ onPointerDown: Jo("low"),
1605
+ onKeyDown: ea("low"),
1606
+ onFocus: Qo("low"),
1607
+ "data-active": Y === "low" ? "true" : void 0,
1608
+ "data-front": Ar ? "true" : void 0,
1573
1609
  children: [
1574
- /* @__PURE__ */ I(
1610
+ /* @__PURE__ */ $(
1575
1611
  "div",
1576
1612
  {
1577
1613
  "data-testid": "period-slider-knob",
1578
- 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)] dark:group-focus-visible:ring-blue-400 ${v === "low" ? "" : "shadow-md"}`
1614
+ 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)] dark:group-focus-visible:ring-blue-400 ${Y === "low" ? "" : "shadow-md"}`
1579
1615
  }
1580
1616
  ),
1581
- g !== "hover" && /* @__PURE__ */ I(
1617
+ h !== "hover" && /* @__PURE__ */ $(
1582
1618
  "div",
1583
1619
  {
1584
- className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${g === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1585
- "data-tooltip-style": g,
1620
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1621
+ "data-tooltip-style": h,
1586
1622
  "data-label-position": D,
1587
- "data-slanted": yr.isSlanted ? "true" : void 0,
1588
- "data-front": Tr ? "true" : void 0,
1589
- "data-duplicate": Cn && !Tr ? "true" : void 0,
1590
- ref: Fo,
1591
- style: Wn.lowStyle,
1592
- children: Ke(t, Bn, e.formatLabel, x)
1623
+ "data-slanted": Pr.isSlanted ? "true" : void 0,
1624
+ "data-front": Ar ? "true" : void 0,
1625
+ "data-duplicate": On && !Ar ? "true" : void 0,
1626
+ ref: Qa,
1627
+ style: qn.lowStyle,
1628
+ children: qe(t, Kn, e.formatLabel, x)
1593
1629
  }
1594
1630
  )
1595
1631
  ]
1596
1632
  }
1597
1633
  ),
1598
- !ne && /* @__PURE__ */ Me(
1634
+ !re && /* @__PURE__ */ we(
1599
1635
  "div",
1600
1636
  {
1601
1637
  tabIndex: l ? -1 : 0,
1602
1638
  role: "slider",
1603
1639
  "aria-label": e.upperAriaLabel ?? "Range end",
1604
1640
  "aria-disabled": l ? "true" : void 0,
1605
- "aria-valuemin": ve,
1606
- "aria-valuemax": V,
1607
- "aria-valuenow": pe,
1608
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Un, t) : dr(t, Un, e.formatLabel, x),
1609
- "aria-orientation": s ? "vertical" : "horizontal",
1641
+ "aria-valuemin": Se,
1642
+ "aria-valuemax": I,
1643
+ "aria-valuenow": ye,
1644
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(jn, t) : gr(t, jn, e.formatLabel, x),
1645
+ "aria-orientation": c ? "vertical" : "horizontal",
1610
1646
  className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[calc((100%-var(--ps-target-size))/2)] after:content-[''] focus-visible:outline-hidden ${_t}`,
1611
- style: bi,
1612
- onPointerDown: Oa("high"),
1613
- onKeyDown: _a("high"),
1614
- onFocus: Ha("high"),
1615
- "data-active": v === "high" ? "true" : void 0,
1616
- "data-front": Pr ? "true" : void 0,
1647
+ style: Pi,
1648
+ onPointerDown: Jo("high"),
1649
+ onKeyDown: ea("high"),
1650
+ onFocus: Qo("high"),
1651
+ "data-active": Y === "high" ? "true" : void 0,
1652
+ "data-front": $r ? "true" : void 0,
1617
1653
  children: [
1618
- /* @__PURE__ */ I(
1654
+ /* @__PURE__ */ $(
1619
1655
  "div",
1620
1656
  {
1621
1657
  "data-testid": "period-slider-knob",
1622
- 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)] dark:group-focus-visible:ring-blue-400 ${v === "high" ? "" : "shadow-md"}`
1658
+ 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)] dark:group-focus-visible:ring-blue-400 ${Y === "high" ? "" : "shadow-md"}`
1623
1659
  }
1624
1660
  ),
1625
- g !== "hover" && /* @__PURE__ */ I(
1661
+ h !== "hover" && /* @__PURE__ */ $(
1626
1662
  "div",
1627
1663
  {
1628
- className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${g === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1629
- "data-tooltip-style": g,
1664
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1665
+ "data-tooltip-style": h,
1630
1666
  "data-label-position": D,
1631
- "data-slanted": yr.isSlanted ? "true" : void 0,
1632
- "data-front": Pr ? "true" : void 0,
1633
- "data-duplicate": Cn && !Pr ? "true" : void 0,
1634
- ref: zo,
1635
- style: Wn.highStyle,
1636
- children: Ke(t, Un, e.formatLabel, x)
1667
+ "data-slanted": Pr.isSlanted ? "true" : void 0,
1668
+ "data-front": $r ? "true" : void 0,
1669
+ "data-duplicate": On && !$r ? "true" : void 0,
1670
+ ref: ei,
1671
+ style: qn.highStyle,
1672
+ children: qe(t, jn, e.formatLabel, x)
1637
1673
  }
1638
1674
  )
1639
1675
  ]
@@ -1642,268 +1678,268 @@ const ol = (e, t) => {
1642
1678
  ] })
1643
1679
  }
1644
1680
  ),
1645
- f && Za(s ? "decrease" : "increase")
1681
+ g && da(c ? "decrease" : "increase")
1646
1682
  ]
1647
1683
  }
1648
1684
  );
1649
- }, ia = (e, t) => {
1685
+ }, mo = (e, t) => {
1650
1686
  if (e === t) return !0;
1651
1687
  if (!(e && t) || e.length !== t.length) return !1;
1652
1688
  for (let r = 0; r < e.length; r++)
1653
1689
  if (e[r].getTime() !== t[r].getTime()) return !1;
1654
1690
  return !0;
1655
- }, gl = (e, t) => {
1691
+ }, Tl = (e, t) => {
1656
1692
  if (e === t) return !0;
1657
1693
  if (!(e && t)) return !1;
1658
1694
  const r = Object.keys(e), n = Object.keys(t);
1659
1695
  if (r.length !== n.length) return !1;
1660
- for (const a of r)
1661
- if (e[a] !== t[a]) return !1;
1696
+ for (const o of r)
1697
+ if (e[o] !== t[o]) return !1;
1662
1698
  return !0;
1663
- }, hl = (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 || !gl(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 || !ia(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.microValue?.getTime() ?? null) !== (t.microValue?.getTime() ?? null) || (e.defaultMicroValue?.getTime() ?? null) !== (t.defaultMicroValue?.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.onChangeMicroPoint !== t.onChangeMicroPoint || e.onChangeMacroRange !== t.onChangeMacroRange || !ia(e.macroAllowedDates, t.macroAllowedDates) || !ia(e.microAllowedDates, t.microAllowedDates)) : !1, bl = zr(fl, hl);
1664
- bl.displayName = "PeriodSlider";
1699
+ }, Pl = (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 || !Tl(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 || !mo(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.microValue?.getTime() ?? null) !== (t.microValue?.getTime() ?? null) || (e.defaultMicroValue?.getTime() ?? null) !== (t.defaultMicroValue?.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.onChangeMicroPoint !== t.onChangeMicroPoint || e.onChangeMacroRange !== t.onChangeMacroRange || !mo(e.macroAllowedDates, t.macroAllowedDates) || !mo(e.microAllowedDates, t.microAllowedDates)) : !1, Al = Ur(yl, Pl);
1700
+ Al.displayName = "PeriodSlider";
1665
1701
  const gt = (e) => {
1666
1702
  const t = new Date(e);
1667
1703
  return t.setHours(0, 0, 0, 0), t;
1668
- }, Or = (e, t) => {
1704
+ }, Fr = (e, t) => {
1669
1705
  if (Number.isNaN(t.getTime()))
1670
1706
  throw new RangeError(`DateSelector: "${e}" must be a valid Date (received ${String(t)})`);
1671
- }, wl = (e) => {
1707
+ }, $l = (e) => {
1672
1708
  if (e !== void 0)
1673
1709
  try {
1674
1710
  Intl.DateTimeFormat.supportedLocalesOf([e]);
1675
1711
  } catch {
1676
1712
  throw new RangeError(`DateSelector: "locale" must be a valid BCP 47 language tag (received ${JSON.stringify(e)})`);
1677
1713
  }
1678
- }, Bt = (e, t, r) => {
1714
+ }, Gt = (e, t, r) => {
1679
1715
  const n = new Date(e, t - 1, r);
1680
1716
  return n.setFullYear(e), n.setHours(0, 0, 0, 0), n;
1681
- }, po = (e) => Bt(e, 1, 1), vl = (e) => Bt(e, 12, 31), pl = {
1717
+ }, Ca = (e) => Gt(e, 1, 1), El = (e) => Gt(e, 12, 31), Il = {
1682
1718
  year: { year: "numeric" },
1683
1719
  month: { month: "2-digit" },
1684
1720
  day: { day: "2-digit" }
1685
- }, Ml = {
1721
+ }, Cl = {
1686
1722
  year: 4,
1687
1723
  month: 2,
1688
1724
  day: 2
1689
- }, Dl = {
1725
+ }, Vl = {
1690
1726
  year: (e) => e.getFullYear(),
1691
1727
  month: (e) => e.getMonth() + 1,
1692
1728
  day: (e) => e.getDate()
1693
- }, Mo = /* @__PURE__ */ new Map(), xl = (e, t) => {
1694
- const r = `${e}\0${t}`, n = Mo.get(r);
1729
+ }, Va = /* @__PURE__ */ new Map(), Nl = (e, t) => {
1730
+ const r = `${e}\0${t}`, n = Va.get(r);
1695
1731
  if (n !== void 0) return n;
1696
- const a = new Intl.DateTimeFormat(t, pl[e]);
1697
- return Mo.set(r, a), a;
1698
- }, la = (e, t, r) => r === void 0 ? String(Dl[e](t)).padStart(Ml[e], "0") : xl(e, r).format(t), Rl = (e, t, r) => {
1699
- const n = t?.getTime() ?? null, a = r?.getTime() ?? null, i = /* @__PURE__ */ new Map();
1700
- return e.forEach((l, c) => {
1701
- Or(`allowedDates[${c}]`, l);
1702
- const f = gt(l), g = f.getTime();
1703
- n !== null && g < n || a !== null && g > a || i.has(g) || i.set(g, f);
1704
- }), Array.from(i.keys()).sort((l, c) => l - c).map((l) => i.get(l));
1705
- }, Ll = (e, t) => {
1732
+ const o = new Intl.DateTimeFormat(t, Il[e]);
1733
+ return Va.set(r, o), o;
1734
+ }, fo = (e, t, r) => r === void 0 ? String(Vl[e](t)).padStart(Cl[e], "0") : Nl(e, r).format(t), kl = (e, t, r) => {
1735
+ const n = t?.getTime() ?? null, o = r?.getTime() ?? null, i = /* @__PURE__ */ new Map();
1736
+ return e.forEach((l, s) => {
1737
+ Fr(`allowedDates[${s}]`, l);
1738
+ const g = gt(l), h = g.getTime();
1739
+ n !== null && h < n || o !== null && h > o || i.has(h) || i.set(h, g);
1740
+ }), Array.from(i.keys()).sort((l, s) => l - s).map((l) => i.get(l));
1741
+ }, Yl = (e, t) => {
1706
1742
  const r = [];
1707
1743
  let n = gt(e);
1708
- const a = gt(t).getTime();
1709
- for (; n.getTime() <= a; )
1710
- r.push(n), n = gn(n, 1);
1744
+ const o = gt(t).getTime();
1745
+ for (; n.getTime() <= o; )
1746
+ r.push(n), n = vn(n, 1);
1711
1747
  return r;
1712
- }, Do = (e, t) => {
1748
+ }, Na = (e, t) => {
1713
1749
  const r = [];
1714
1750
  for (let n = e.length - 1; n >= 0; n--)
1715
- r.push({ label: Ke("day", e[n], void 0, t), value: gr(e[n], "yyyy-MM-dd") });
1751
+ r.push({ label: qe("day", e[n], void 0, t), value: wr(e[n], "yyyy-MM-dd") });
1716
1752
  return r;
1717
- }, Sl = (e) => {
1753
+ }, Ol = (e) => {
1718
1754
  const {
1719
1755
  value: t,
1720
1756
  initialDate: r,
1721
1757
  onChange: n,
1722
- children: a,
1758
+ children: o,
1723
1759
  minYear: i,
1724
1760
  maxYear: l,
1725
- minDate: c,
1726
- maxDate: f,
1727
- allowedDates: g,
1761
+ minDate: s,
1762
+ maxDate: g,
1763
+ allowedDates: h,
1728
1764
  variant: D = "date",
1729
1765
  className: R = "",
1730
- style: s,
1731
- disabled: S = !1,
1766
+ style: c,
1767
+ disabled: M = !1,
1732
1768
  prevDateAriaLabel: Z = "Previous day",
1733
1769
  nextDateAriaLabel: ee = "Next day",
1734
1770
  selectAriaLabel: x = "Date",
1735
1771
  yearAriaLabel: ue = "Year",
1736
- monthAriaLabel: ae = "Month",
1737
- dayAriaLabel: $ = "Day",
1738
- locale: H,
1739
- formatYearOption: W,
1740
- formatMonthOption: oe,
1741
- formatDayOption: q
1772
+ monthAriaLabel: ne = "Month",
1773
+ dayAriaLabel: P = "Day",
1774
+ locale: O,
1775
+ formatYearOption: G,
1776
+ formatMonthOption: ie,
1777
+ formatDayOption: j
1742
1778
  } = e;
1743
- if (wl(H), t !== void 0 && Or("value", t), r !== void 0 && Or("initialDate", r), c !== void 0 && Or("minDate", c), f !== void 0 && Or("maxDate", f), i !== void 0 && !Number.isInteger(i))
1779
+ if ($l(O), t !== void 0 && Fr("value", t), r !== void 0 && Fr("initialDate", r), s !== void 0 && Fr("minDate", s), g !== void 0 && Fr("maxDate", g), i !== void 0 && !Number.isInteger(i))
1744
1780
  throw new RangeError(`DateSelector: "minYear" must be an integer year (received ${String(i)})`);
1745
1781
  if (l !== void 0 && !Number.isInteger(l))
1746
1782
  throw new RangeError(`DateSelector: "maxYear" must be an integer year (received ${String(l)})`);
1747
- if (D === "split-dropdown" && g !== void 0)
1783
+ if (D === "split-dropdown" && h !== void 0)
1748
1784
  throw new RangeError('DateSelector: variant="split-dropdown" cannot honour "allowedDates"; use variant="dropdown" or variant="date" for a discrete date set');
1749
1785
  const X = t ?? r;
1750
1786
  if (X === void 0)
1751
1787
  throw new RangeError("DateSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected date is never inferred from the wall clock.");
1752
- const [y, L] = ye(() => gt(X)), T = t !== void 0, k = t?.getTime(), V = C(() => t !== void 0 ? gt(t) : y, [k, y]), ne = c?.getTime(), ce = f?.getTime(), G = C(() => {
1753
- const w = c ? gt(c) : null, h = i !== void 0 ? po(i) : null;
1754
- return w === null ? h : h === null || w.getTime() >= h.getTime() ? w : h;
1755
- }, [ne, i]), J = C(() => {
1756
- const w = f ? gt(f) : null, h = l !== void 0 ? vl(l) : null;
1757
- return w === null ? h : h === null || w.getTime() <= h.getTime() ? w : h;
1758
- }, [ce, l]), z = G?.getTime() ?? null, _ = J?.getTime() ?? null;
1759
- if (G !== null && J !== null && G.getTime() > J.getTime())
1760
- throw new RangeError(`DateSelector: the resolved range is empty (min ${gr(G, "yyyy-MM-dd")} is after max ${gr(J, "yyyy-MM-dd")})`);
1761
- if (D !== "date" && g === void 0 && (G === null || J === null))
1788
+ const [S, L] = Pe(() => gt(X)), y = t !== void 0, k = t?.getTime(), I = E(() => t !== void 0 ? gt(t) : S, [k, S]), re = s?.getTime(), ce = g?.getTime(), K = E(() => {
1789
+ const d = s ? gt(s) : null, W = i !== void 0 ? Ca(i) : null;
1790
+ return d === null ? W : W === null || d.getTime() >= W.getTime() ? d : W;
1791
+ }, [re, i]), J = E(() => {
1792
+ const d = g ? gt(g) : null, W = l !== void 0 ? El(l) : null;
1793
+ return d === null ? W : W === null || d.getTime() <= W.getTime() ? d : W;
1794
+ }, [ce, l]), B = K?.getTime() ?? null, H = J?.getTime() ?? null;
1795
+ if (K !== null && J !== null && K.getTime() > J.getTime())
1796
+ throw new RangeError(`DateSelector: the resolved range is empty (min ${wr(K, "yyyy-MM-dd")} is after max ${wr(J, "yyyy-MM-dd")})`);
1797
+ if (D !== "date" && h === void 0 && (K === null || J === null))
1762
1798
  throw new RangeError(`DateSelector: variant="${D}" needs a bounded range; supply minDate/minYear and maxDate/maxYear${D === "dropdown" ? ' or supply "allowedDates"' : ""}`);
1763
- const me = g === void 0 ? null : g.map((w) => w.getTime()).join(","), ge = C(() => g === void 0 ? null : Rl(g, G, J), [me, z, _]), le = (w) => {
1764
- const h = w.getTime();
1765
- return ge !== null ? ge.some((b) => b.getTime() === h) : !(z !== null && h < z || _ !== null && h > _);
1766
- }, ze = X.getTime();
1767
- Dt(() => {
1768
- T || L(gt(X));
1769
- }, [T, ze]);
1770
- const Ee = (w) => {
1771
- if (S) return;
1772
- const h = gt(w);
1773
- le(h) && (T || L(h), n?.(h));
1774
- }, Te = V.getTime(), Pe = le(V), qe = C(() => {
1775
- if (ge !== null) {
1776
- for (let h = ge.length - 1; h >= 0; h--)
1777
- if (ge[h].getTime() < Te) return ge[h];
1799
+ const de = h === void 0 ? null : h.map((d) => d.getTime()).join(","), me = E(() => h === void 0 ? null : kl(h, K, J), [de, B, H]), De = (d) => {
1800
+ const W = d.getTime();
1801
+ return me !== null ? me.some((je) => je.getTime() === W) : !(B !== null && W < B || H !== null && W > H);
1802
+ }, Ge = X.getTime();
1803
+ it(() => {
1804
+ y || L(gt(X));
1805
+ }, [y, Ge]);
1806
+ const Me = (d) => {
1807
+ if (M) return;
1808
+ const W = gt(d);
1809
+ De(W) && (y || L(W), n?.(W));
1810
+ }, pe = I.getTime(), Le = De(I), He = E(() => {
1811
+ if (me !== null) {
1812
+ for (let W = me.length - 1; W >= 0; W--)
1813
+ if (me[W].getTime() < pe) return me[W];
1778
1814
  return null;
1779
1815
  }
1780
- const w = gn(new Date(Te), -1);
1781
- return le(w) ? w : null;
1782
- }, [ge, Te, z, _]), Be = C(() => {
1783
- if (ge !== null) {
1784
- for (const h of ge)
1785
- if (h.getTime() > Te) return h;
1816
+ const d = vn(new Date(pe), -1);
1817
+ return De(d) ? d : null;
1818
+ }, [me, pe, B, H]), Fe = E(() => {
1819
+ if (me !== null) {
1820
+ for (const W of me)
1821
+ if (W.getTime() > pe) return W;
1786
1822
  return null;
1787
1823
  }
1788
- const w = gn(new Date(Te), 1);
1789
- return le(w) ? w : null;
1790
- }, [ge, Te, z, _]), tt = () => {
1791
- qe !== null && Ee(qe);
1792
- }, Ue = () => {
1793
- Be !== null && Ee(Be);
1794
- }, it = (w) => {
1795
- if (w.target.value) {
1796
- const h = no(w.target.value);
1797
- Number.isNaN(h.getTime()) || Ee(h);
1824
+ const d = vn(new Date(pe), 1);
1825
+ return De(d) ? d : null;
1826
+ }, [me, pe, B, H]), rt = () => {
1827
+ He !== null && Me(He);
1828
+ }, ht = () => {
1829
+ Fe !== null && Me(Fe);
1830
+ }, lt = (d) => {
1831
+ if (d.target.value) {
1832
+ const W = wa(d.target.value);
1833
+ Number.isNaN(W.getTime()) || Me(W);
1798
1834
  }
1799
- }, K = (w) => {
1800
- if (w.target.value) {
1801
- const h = no(w.target.value);
1802
- Number.isNaN(h.getTime()) || Ee(h);
1835
+ }, q = (d) => {
1836
+ if (d.target.value) {
1837
+ const W = wa(d.target.value);
1838
+ Number.isNaN(W.getTime()) || Me(W);
1803
1839
  }
1804
- }, B = V.getFullYear(), te = V.getMonth() + 1, v = V.getDate(), Y = C(() => D !== "dropdown" ? [] : ge !== null ? Do(ge, H) : G === null || J === null ? [] : Do(Ll(G, J), H), [D, ge, z, _, H]), p = C(() => {
1805
- if (D !== "split-dropdown" || G === null || J === null) return [];
1806
- const w = [];
1807
- for (let h = J.getFullYear(); h >= G.getFullYear(); h--)
1808
- w.push(h);
1809
- return w;
1810
- }, [D, z, _]), j = C(() => {
1811
- if (D !== "split-dropdown" || G === null || J === null) return [];
1812
- const w = G, h = J, b = B === w.getFullYear() ? w.getMonth() + 1 : 1, wr = B === h.getFullYear() ? h.getMonth() + 1 : 12, ht = [];
1813
- for (let lt = b; lt <= wr; lt++)
1814
- ht.push(lt);
1815
- return ht;
1816
- }, [D, z, _, B]), de = C(() => {
1817
- if (D !== "split-dropdown" || G === null || J === null) return [];
1818
- const w = G, h = J, b = B === w.getFullYear() && te === w.getMonth() + 1 ? w.getDate() : 1, wr = B === h.getFullYear() && te === h.getMonth() + 1 ? h.getDate() : ro(new Date(Te)), ht = [];
1819
- for (let lt = b; lt <= wr; lt++)
1820
- ht.push(lt);
1821
- return ht;
1822
- }, [D, z, _, Te, B, te]), we = (w, h, b) => b > ro(Bt(w, h, 1)) ? !1 : le(Bt(w, h, b)), Ae = (w, h, b) => {
1823
- we(w, h, b) && Ee(Bt(w, h, b));
1824
- }, He = (w) => W ? W(w) : la("year", po(w), H), rt = (w) => oe ? oe(w) : la("month", Bt(B, w, 1), H), ve = (w) => q ? q(w) : la("day", Bt(B, te, w), H), pe = gr(V, "yyyy-MM-dd"), Br = Ke("day", V, void 0, H), fe = G ? gr(G, "yyyy-MM-dd") : void 0, Nt = J ? gr(J, "yyyy-MM-dd") : void 0, A = Pe ? pe : "", Wt = "text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400";
1825
- return /* @__PURE__ */ Me("div", { className: `inline-flex items-center ${Fr} ${R}`, style: s, "data-variant": D, "data-out-of-range": Pe ? void 0 : "true", children: [
1826
- /* @__PURE__ */ I(Ut, { neighbour: "control", direction: "left", disabled: S, canStep: qe !== null, onStep: tt, ariaLabel: Z }),
1827
- D === "dropdown" ? /* @__PURE__ */ Me("select", { "aria-label": x, disabled: S, className: "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: A, onChange: K, children: [
1828
- Pe ? null : /* @__PURE__ */ I("option", { value: "", disabled: !0, className: Wt, children: Br }),
1829
- Y.map((w) => /* @__PURE__ */ I("option", { value: w.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: w.label }, w.value))
1830
- ] }) : D === "split-dropdown" ? /* @__PURE__ */ Me("div", { className: "inline-flex items-center gap-1", children: [
1831
- /* @__PURE__ */ Me(
1840
+ }, U = I.getFullYear(), oe = I.getMonth() + 1, p = I.getDate(), N = E(() => D !== "dropdown" ? [] : me !== null ? Na(me, O) : K === null || J === null ? [] : Na(Yl(K, J), O), [D, me, B, H, O]), v = E(() => {
1841
+ if (D !== "split-dropdown" || K === null || J === null) return [];
1842
+ const d = [];
1843
+ for (let W = J.getFullYear(); W >= K.getFullYear(); W--)
1844
+ d.push(W);
1845
+ return d;
1846
+ }, [D, B, H]), Y = E(() => {
1847
+ if (D !== "split-dropdown" || K === null || J === null) return [];
1848
+ const d = K, W = J, je = U === d.getFullYear() ? d.getMonth() + 1 : 1, Lt = U === W.getFullYear() ? W.getMonth() + 1 : 12, F = [];
1849
+ for (let b = je; b <= Lt; b++)
1850
+ F.push(b);
1851
+ return F;
1852
+ }, [D, B, H, U]), he = E(() => {
1853
+ if (D !== "split-dropdown" || K === null || J === null) return [];
1854
+ const d = K, W = J, je = U === d.getFullYear() && oe === d.getMonth() + 1 ? d.getDate() : 1, Lt = U === W.getFullYear() && oe === W.getMonth() + 1 ? W.getDate() : ba(new Date(pe)), F = [];
1855
+ for (let b = je; b <= Lt; b++)
1856
+ F.push(b);
1857
+ return F;
1858
+ }, [D, B, H, pe, U, oe]), be = (d, W, je) => je > ba(Gt(d, W, 1)) ? !1 : De(Gt(d, W, je)), $e = (d, W, je) => {
1859
+ be(d, W, je) && Me(Gt(d, W, je));
1860
+ }, Ie = (d) => G ? G(d) : fo("year", Ca(d), O), _e = (d) => ie ? ie(d) : fo("month", Gt(U, d, 1), O), Rt = (d) => j ? j(d) : fo("day", Gt(U, oe, d), O), bt = wr(I, "yyyy-MM-dd"), Wr = qe("day", I, void 0, O), Se = K ? wr(K, "yyyy-MM-dd") : void 0, ye = J ? wr(J, "yyyy-MM-dd") : void 0, Gr = Le ? bt : "", ae = "text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400";
1861
+ return /* @__PURE__ */ we("div", { className: `inline-flex items-center ${Br} ${R}`, style: c, "data-variant": D, "data-out-of-range": Le ? void 0 : "true", children: [
1862
+ /* @__PURE__ */ $(Xt, { neighbour: "control", direction: "left", disabled: M, canStep: He !== null, onStep: rt, ariaLabel: Z }),
1863
+ D === "dropdown" ? /* @__PURE__ */ we("select", { "aria-label": x, disabled: M, className: "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: Gr, onChange: q, children: [
1864
+ Le ? null : /* @__PURE__ */ $("option", { value: "", disabled: !0, className: ae, children: Wr }),
1865
+ N.map((d) => /* @__PURE__ */ $("option", { value: d.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: d.label }, d.value))
1866
+ ] }) : D === "split-dropdown" ? /* @__PURE__ */ we("div", { className: "inline-flex items-center gap-1", children: [
1867
+ /* @__PURE__ */ we(
1832
1868
  "select",
1833
1869
  {
1834
1870
  "aria-label": ue,
1835
- disabled: S,
1871
+ disabled: M,
1836
1872
  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",
1837
- value: Pe ? B : "",
1838
- onChange: (w) => Ae(Number(w.target.value), te, v),
1873
+ value: Le ? U : "",
1874
+ onChange: (d) => $e(Number(d.target.value), oe, p),
1839
1875
  children: [
1840
- Pe ? null : /* @__PURE__ */ I("option", { value: "", disabled: !0, className: Wt, children: He(B) }),
1841
- p.map((w) => /* @__PURE__ */ I("option", { value: w, disabled: !we(w, te, v), className: "dark:bg-slate-700 dark:text-slate-100", children: He(w) }, w))
1876
+ Le ? null : /* @__PURE__ */ $("option", { value: "", disabled: !0, className: ae, children: Ie(U) }),
1877
+ v.map((d) => /* @__PURE__ */ $("option", { value: d, disabled: !be(d, oe, p), className: "dark:bg-slate-700 dark:text-slate-100", children: Ie(d) }, d))
1842
1878
  ]
1843
1879
  }
1844
1880
  ),
1845
- /* @__PURE__ */ Me(
1881
+ /* @__PURE__ */ we(
1846
1882
  "select",
1847
1883
  {
1848
- "aria-label": ae,
1849
- disabled: S,
1884
+ "aria-label": ne,
1885
+ disabled: M,
1850
1886
  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",
1851
- value: Pe ? te : "",
1852
- onChange: (w) => Ae(B, Number(w.target.value), v),
1887
+ value: Le ? oe : "",
1888
+ onChange: (d) => $e(U, Number(d.target.value), p),
1853
1889
  children: [
1854
- Pe ? null : /* @__PURE__ */ I("option", { value: "", disabled: !0, className: Wt, children: rt(te) }),
1855
- j.map((w) => /* @__PURE__ */ I("option", { value: w, disabled: !we(B, w, v), className: "dark:bg-slate-700 dark:text-slate-100", children: rt(w) }, w))
1890
+ Le ? null : /* @__PURE__ */ $("option", { value: "", disabled: !0, className: ae, children: _e(oe) }),
1891
+ Y.map((d) => /* @__PURE__ */ $("option", { value: d, disabled: !be(U, d, p), className: "dark:bg-slate-700 dark:text-slate-100", children: _e(d) }, d))
1856
1892
  ]
1857
1893
  }
1858
1894
  ),
1859
- /* @__PURE__ */ Me(
1895
+ /* @__PURE__ */ we(
1860
1896
  "select",
1861
1897
  {
1862
- "aria-label": $,
1863
- disabled: S,
1898
+ "aria-label": P,
1899
+ disabled: M,
1864
1900
  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",
1865
- value: Pe ? v : "",
1866
- onChange: (w) => Ae(B, te, Number(w.target.value)),
1901
+ value: Le ? p : "",
1902
+ onChange: (d) => $e(U, oe, Number(d.target.value)),
1867
1903
  children: [
1868
- Pe ? null : /* @__PURE__ */ I("option", { value: "", disabled: !0, className: Wt, children: ve(v) }),
1869
- de.map((w) => /* @__PURE__ */ I("option", { value: w, className: "dark:bg-slate-700 dark:text-slate-100", children: ve(w) }, w))
1904
+ Le ? null : /* @__PURE__ */ $("option", { value: "", disabled: !0, className: ae, children: Rt(p) }),
1905
+ he.map((d) => /* @__PURE__ */ $("option", { value: d, className: "dark:bg-slate-700 dark:text-slate-100", children: Rt(d) }, d))
1870
1906
  ]
1871
1907
  }
1872
1908
  )
1873
- ] }) : /* @__PURE__ */ I(
1909
+ ] }) : /* @__PURE__ */ $(
1874
1910
  "input",
1875
1911
  {
1876
1912
  "aria-label": x,
1877
- disabled: S,
1913
+ disabled: M,
1878
1914
  className: "period-slider-native-date-field w-28 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 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",
1879
- value: pe,
1880
- min: fe,
1881
- max: Nt,
1882
- onChange: it,
1915
+ value: bt,
1916
+ min: Se,
1917
+ max: ye,
1918
+ onChange: lt,
1883
1919
  type: "date"
1884
1920
  }
1885
1921
  ),
1886
- /* @__PURE__ */ I(Ut, { neighbour: "control", direction: "right", disabled: S, canStep: Be !== null, onStep: Ue, ariaLabel: ee }),
1887
- a
1922
+ /* @__PURE__ */ $(Xt, { neighbour: "control", direction: "right", disabled: M, canStep: Fe !== null, onStep: ht, ariaLabel: ee }),
1923
+ o
1888
1924
  ] });
1889
- }, fr = (e) => e === void 0 ? null : gt(e).getTime(), yl = zr(Sl, (e, t) => !(fr(e.value ?? e.initialDate) !== fr(t.value ?? t.initialDate) || fr(e.minDate) !== fr(t.minDate) || fr(e.maxDate) !== fr(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));
1890
- yl.displayName = "DateSelector";
1891
- function Qe(e, t) {
1892
- const r = e + Math.floor(t / 12), n = (t % 12 + 12) % 12, a = new Date(r, n, 1);
1893
- return a.setFullYear(r), a;
1925
+ }, br = (e) => e === void 0 ? null : gt(e).getTime(), Hl = Ur(Ol, (e, t) => !(br(e.value ?? e.initialDate) !== br(t.value ?? t.initialDate) || br(e.minDate) !== br(t.minDate) || br(e.maxDate) !== br(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));
1926
+ Hl.displayName = "DateSelector";
1927
+ function et(e, t) {
1928
+ const r = e + Math.floor(t / 12), n = (t % 12 + 12) % 12, o = new Date(r, n, 1);
1929
+ return o.setFullYear(r), o;
1894
1930
  }
1895
- function zt(e) {
1931
+ function Wt(e) {
1896
1932
  return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`;
1897
1933
  }
1898
- function kr(e, t) {
1934
+ function Or(e, t) {
1899
1935
  if (e !== void 0 && (!(e instanceof Date) || Number.isNaN(e.getTime())))
1900
1936
  throw new RangeError(`MonthSelector: \`${t}\` must be a valid Date, received ${String(e)}.`);
1901
1937
  }
1902
- function xo(e, t) {
1938
+ function ka(e, t) {
1903
1939
  if (e !== void 0 && !Number.isInteger(e))
1904
1940
  throw new RangeError(`MonthSelector: \`${t}\` must be an integer year, received ${String(e)}.`);
1905
1941
  }
1906
- function Tl(e) {
1942
+ function Fl(e) {
1907
1943
  if (e !== void 0)
1908
1944
  try {
1909
1945
  Intl.DateTimeFormat.supportedLocalesOf([e]);
@@ -1911,224 +1947,224 @@ function Tl(e) {
1911
1947
  throw new RangeError(`MonthSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`);
1912
1948
  }
1913
1949
  }
1914
- function Pl(e, t) {
1915
- const r = e === void 0 ? null : Qe(e, 0), n = t === void 0 ? null : Qe(t.getFullYear(), t.getMonth());
1950
+ function _l(e, t) {
1951
+ const r = e === void 0 ? null : et(e, 0), n = t === void 0 ? null : et(t.getFullYear(), t.getMonth());
1916
1952
  return r !== null && n !== null ? r >= n ? r : n : r !== null ? r : n;
1917
1953
  }
1918
- function Al(e, t) {
1919
- const r = e === void 0 ? null : Qe(e, 11), n = t === void 0 ? null : Qe(t.getFullYear(), t.getMonth());
1954
+ function zl(e, t) {
1955
+ const r = e === void 0 ? null : et(e, 11), n = t === void 0 ? null : et(t.getFullYear(), t.getMonth());
1920
1956
  return r !== null && n !== null ? r <= n ? r : n : r !== null ? r : n;
1921
1957
  }
1922
- function $l(e, t, r) {
1958
+ function Bl(e, t, r) {
1923
1959
  const n = /* @__PURE__ */ new Map();
1924
- for (const a of e) {
1925
- const i = Qe(a.getFullYear(), a.getMonth());
1960
+ for (const o of e) {
1961
+ const i = et(o.getFullYear(), o.getMonth());
1926
1962
  t !== null && i < t || r !== null && i > r || n.has(i.getTime()) || n.set(i.getTime(), i);
1927
1963
  }
1928
- return Array.from(n.values()).sort((a, i) => a.getTime() - i.getTime());
1964
+ return Array.from(n.values()).sort((o, i) => o.getTime() - i.getTime());
1929
1965
  }
1930
- function El(e, t) {
1931
- const r = e.getFullYear() * 12 + e.getMonth(), n = t.getFullYear() * 12 + t.getMonth(), a = [];
1966
+ function Ul(e, t) {
1967
+ const r = e.getFullYear() * 12 + e.getMonth(), n = t.getFullYear() * 12 + t.getMonth(), o = [];
1932
1968
  for (let i = r; i <= n; i++)
1933
- a.push(Qe(Math.floor(i / 12), i % 12));
1934
- return a;
1969
+ o.push(et(Math.floor(i / 12), i % 12));
1970
+ return o;
1935
1971
  }
1936
- function Ro(e, t) {
1972
+ function Ya(e, t) {
1937
1973
  const r = [];
1938
1974
  for (let n = e.length - 1; n >= 0; n--)
1939
- r.push({ label: Ke("month", e[n], void 0, t), value: zt(e[n]) });
1975
+ r.push({ label: qe("month", e[n], void 0, t), value: Wt(e[n]) });
1940
1976
  return r;
1941
1977
  }
1942
- const Il = (e) => {
1978
+ const Wl = (e) => {
1943
1979
  const {
1944
1980
  value: t,
1945
1981
  initialDate: r,
1946
1982
  onChange: n,
1947
- children: a,
1983
+ children: o,
1948
1984
  variant: i = "date",
1949
1985
  minYear: l,
1950
- maxYear: c,
1951
- minDate: f,
1952
- maxDate: g,
1986
+ maxYear: s,
1987
+ minDate: g,
1988
+ maxDate: h,
1953
1989
  allowedMonths: D,
1954
1990
  isWarning: R = !1,
1955
- className: s = "",
1956
- style: S,
1991
+ className: c = "",
1992
+ style: M,
1957
1993
  disabled: Z = !1,
1958
1994
  prevMonthAriaLabel: ee = "Previous month",
1959
1995
  nextMonthAriaLabel: x = "Next month",
1960
1996
  selectAriaLabel: ue = "Month",
1961
- locale: ae
1997
+ locale: ne
1962
1998
  } = e;
1963
- Tl(ae), kr(t, "value"), kr(r, "initialDate"), kr(f, "minDate"), kr(g, "maxDate"), xo(l, "minYear"), xo(c, "maxYear"), D?.forEach((p, j) => {
1964
- kr(p, `allowedMonths[${j}]`);
1999
+ Fl(ne), Or(t, "value"), Or(r, "initialDate"), Or(g, "minDate"), Or(h, "maxDate"), ka(l, "minYear"), ka(s, "maxYear"), D?.forEach((v, Y) => {
2000
+ Or(v, `allowedMonths[${Y}]`);
1965
2001
  });
1966
- const $ = t ?? r;
1967
- if ($ === void 0)
2002
+ const P = t ?? r;
2003
+ if (P === void 0)
1968
2004
  throw new RangeError("MonthSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected month is never inferred from the wall clock.");
1969
- const [H, W] = ye(() => Qe($.getFullYear(), $.getMonth())), oe = t !== void 0, q = C(() => t !== void 0 ? Qe(t.getFullYear(), t.getMonth()) : H, [t?.getTime(), H]), X = f?.getTime(), y = g?.getTime(), L = C(() => Pl(l, f), [l, X]), T = C(() => Al(c, g), [c, y]), k = L?.getTime() ?? null, V = T?.getTime() ?? null;
1970
- if (L !== null && T !== null && L > T)
1971
- throw new RangeError(`MonthSelector: the resolved lower bound ${zt(L)} is after the resolved upper bound ${zt(T)}.`);
1972
- if (i === "dropdown" && D === void 0 && (L === null || T === null))
2005
+ const [O, G] = Pe(() => et(P.getFullYear(), P.getMonth())), ie = t !== void 0, j = E(() => t !== void 0 ? et(t.getFullYear(), t.getMonth()) : O, [t?.getTime(), O]), X = g?.getTime(), S = h?.getTime(), L = E(() => _l(l, g), [l, X]), y = E(() => zl(s, h), [s, S]), k = L?.getTime() ?? null, I = y?.getTime() ?? null;
2006
+ if (L !== null && y !== null && L > y)
2007
+ throw new RangeError(`MonthSelector: the resolved lower bound ${Wt(L)} is after the resolved upper bound ${Wt(y)}.`);
2008
+ if (i === "dropdown" && D === void 0 && (L === null || y === null))
1973
2009
  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.');
1974
- const ne = D === void 0 ? null : D.map((p) => p.getTime()).join(","), ce = C(() => D === void 0 ? null : $l(D, L, T), [ne, k, V]), G = (p) => {
1975
- const j = p.getTime();
1976
- return ce !== null ? ce.some((de) => de.getTime() === j) : !(k !== null && j < k || V !== null && j > V);
1977
- }, J = $.getTime();
1978
- Dt(() => {
1979
- if (oe) return;
1980
- const p = Qe($.getFullYear(), $.getMonth());
1981
- W((j) => j.getTime() === p.getTime() ? j : p);
1982
- }, [oe, J]);
1983
- const z = (p) => {
2010
+ const re = D === void 0 ? null : D.map((v) => v.getTime()).join(","), ce = E(() => D === void 0 ? null : Bl(D, L, y), [re, k, I]), K = (v) => {
2011
+ const Y = v.getTime();
2012
+ return ce !== null ? ce.some((he) => he.getTime() === Y) : !(k !== null && Y < k || I !== null && Y > I);
2013
+ }, J = P.getTime();
2014
+ it(() => {
2015
+ if (ie) return;
2016
+ const v = et(P.getFullYear(), P.getMonth());
2017
+ G((Y) => Y.getTime() === v.getTime() ? Y : v);
2018
+ }, [ie, J]);
2019
+ const B = (v) => {
1984
2020
  if (Z) return;
1985
- if (!G(p))
1986
- throw new RangeError(`MonthSelector: refusing to emit ${zt(p)}, which lies outside the selectable months.`);
1987
- oe || W(p);
1988
- const j = p.getFullYear() * 100 + (p.getMonth() + 1);
1989
- n?.(p, j);
1990
- }, _ = q.getTime(), me = G(q), ge = C(() => {
2021
+ if (!K(v))
2022
+ throw new RangeError(`MonthSelector: refusing to emit ${Wt(v)}, which lies outside the selectable months.`);
2023
+ ie || G(v);
2024
+ const Y = v.getFullYear() * 100 + (v.getMonth() + 1);
2025
+ n?.(v, Y);
2026
+ }, H = j.getTime(), de = K(j), me = E(() => {
1991
2027
  if (ce !== null) {
1992
- for (let j = ce.length - 1; j >= 0; j--)
1993
- if (ce[j].getTime() < _) return ce[j];
2028
+ for (let Y = ce.length - 1; Y >= 0; Y--)
2029
+ if (ce[Y].getTime() < H) return ce[Y];
1994
2030
  return null;
1995
2031
  }
1996
- const p = Qe(q.getFullYear(), q.getMonth() - 1);
1997
- return G(p) ? p : null;
1998
- }, [ce, _, k, V]), le = C(() => {
2032
+ const v = et(j.getFullYear(), j.getMonth() - 1);
2033
+ return K(v) ? v : null;
2034
+ }, [ce, H, k, I]), De = E(() => {
1999
2035
  if (ce !== null) {
2000
- for (const j of ce)
2001
- if (j.getTime() > _) return j;
2036
+ for (const Y of ce)
2037
+ if (Y.getTime() > H) return Y;
2002
2038
  return null;
2003
2039
  }
2004
- const p = Qe(q.getFullYear(), q.getMonth() + 1);
2005
- return G(p) ? p : null;
2006
- }, [ce, _, k, V]), ze = () => {
2007
- ge !== null && z(ge);
2008
- }, Ee = () => {
2009
- le !== null && z(le);
2010
- }, Te = (p) => {
2011
- if (!p) return;
2012
- const [j, de] = p.split("-"), we = Number(j), Ae = Number(de) - 1;
2013
- if (!(Number.isInteger(we) && Number.isInteger(Ae))) return;
2014
- const He = Qe(we, Ae);
2015
- G(He) && z(He);
2016
- }, Pe = (p) => {
2017
- Te(p.target.value);
2018
- }, qe = (p) => {
2019
- Te(p.target.value);
2020
- }, Be = zt(q), tt = Ke("month", q, void 0, ae), Ue = L ? zt(L) : void 0, it = T ? zt(T) : void 0, K = C(() => i !== "dropdown" ? [] : ce !== null ? Ro(ce, ae) : L === null || T === null ? [] : Ro(El(L, T), ae), [i, ce, k, V, ae]), B = me ? Be : "", te = R ? "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", v = `period-slider-native-date-field w-28 rounded-md border py-0.5 px-1 text-center font-mono text-xs tabular-nums dark:placeholder:text-gray-400 disabled:opacity-50 ${te}`, Y = `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 ${te}`;
2021
- return /* @__PURE__ */ Me("div", { className: `inline-flex items-center ${Fr} ${s}`, style: S, "data-out-of-range": me ? void 0 : "true", children: [
2022
- /* @__PURE__ */ I(Ut, { neighbour: "control", direction: "left", disabled: Z, canStep: ge !== null, onStep: ze, ariaLabel: ee }),
2023
- i === "dropdown" ? /* @__PURE__ */ Me("select", { "aria-label": ue, disabled: Z, className: Y, value: B, onChange: qe, children: [
2024
- me ? null : /* @__PURE__ */ I("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: tt }),
2025
- K.map((p) => /* @__PURE__ */ I("option", { value: p.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: p.label }, p.value))
2026
- ] }) : /* @__PURE__ */ I("input", { "aria-label": ue, disabled: Z, className: v, value: Be, min: Ue, max: it, onChange: Pe, type: "month" }),
2027
- /* @__PURE__ */ I(Ut, { neighbour: "control", direction: "right", disabled: Z, canStep: le !== null, onStep: Ee, ariaLabel: x }),
2028
- a
2040
+ const v = et(j.getFullYear(), j.getMonth() + 1);
2041
+ return K(v) ? v : null;
2042
+ }, [ce, H, k, I]), Ge = () => {
2043
+ me !== null && B(me);
2044
+ }, Me = () => {
2045
+ De !== null && B(De);
2046
+ }, pe = (v) => {
2047
+ if (!v) return;
2048
+ const [Y, he] = v.split("-"), be = Number(Y), $e = Number(he) - 1;
2049
+ if (!(Number.isInteger(be) && Number.isInteger($e))) return;
2050
+ const Ie = et(be, $e);
2051
+ K(Ie) && B(Ie);
2052
+ }, Le = (v) => {
2053
+ pe(v.target.value);
2054
+ }, He = (v) => {
2055
+ pe(v.target.value);
2056
+ }, Fe = Wt(j), rt = qe("month", j, void 0, ne), ht = L ? Wt(L) : void 0, lt = y ? Wt(y) : void 0, q = E(() => i !== "dropdown" ? [] : ce !== null ? Ya(ce, ne) : L === null || y === null ? [] : Ya(Ul(L, y), ne), [i, ce, k, I, ne]), U = de ? Fe : "", oe = R ? "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", p = `period-slider-native-date-field w-28 rounded-md border py-0.5 px-1 text-center font-mono text-xs tabular-nums dark:placeholder:text-gray-400 disabled:opacity-50 ${oe}`, N = `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 ${oe}`;
2057
+ return /* @__PURE__ */ we("div", { className: `inline-flex items-center ${Br} ${c}`, style: M, "data-out-of-range": de ? void 0 : "true", children: [
2058
+ /* @__PURE__ */ $(Xt, { neighbour: "control", direction: "left", disabled: Z, canStep: me !== null, onStep: Ge, ariaLabel: ee }),
2059
+ i === "dropdown" ? /* @__PURE__ */ we("select", { "aria-label": ue, disabled: Z, className: N, value: U, onChange: He, children: [
2060
+ de ? null : /* @__PURE__ */ $("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: rt }),
2061
+ q.map((v) => /* @__PURE__ */ $("option", { value: v.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: v.label }, v.value))
2062
+ ] }) : /* @__PURE__ */ $("input", { "aria-label": ue, disabled: Z, className: p, value: Fe, min: ht, max: lt, onChange: Le, type: "month" }),
2063
+ /* @__PURE__ */ $(Xt, { neighbour: "control", direction: "right", disabled: Z, canStep: De !== null, onStep: Me, ariaLabel: x }),
2064
+ o
2029
2065
  ] });
2030
- }, Cl = zr(Il, (e, t) => {
2031
- const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, a = r ? r.getFullYear() * 12 + r.getMonth() : null, i = n ? n.getFullYear() * 12 + n.getMonth() : null;
2032
- if (a !== i || 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;
2033
- const l = e.minDate ? e.minDate.getFullYear() * 12 + e.minDate.getMonth() : null, c = t.minDate ? t.minDate.getFullYear() * 12 + t.minDate.getMonth() : null;
2034
- if (l !== c) return !1;
2035
- const f = e.maxDate ? e.maxDate.getFullYear() * 12 + e.maxDate.getMonth() : null, g = t.maxDate ? t.maxDate.getFullYear() * 12 + t.maxDate.getMonth() : null;
2036
- return !(f !== g || 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);
2066
+ }, Gl = Ur(Wl, (e, t) => {
2067
+ const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, o = r ? r.getFullYear() * 12 + r.getMonth() : null, i = n ? n.getFullYear() * 12 + n.getMonth() : null;
2068
+ if (o !== i || 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;
2069
+ const l = e.minDate ? e.minDate.getFullYear() * 12 + e.minDate.getMonth() : null, s = t.minDate ? t.minDate.getFullYear() * 12 + t.minDate.getMonth() : null;
2070
+ if (l !== s) return !1;
2071
+ const g = e.maxDate ? e.maxDate.getFullYear() * 12 + e.maxDate.getMonth() : null, h = t.maxDate ? t.maxDate.getFullYear() * 12 + t.maxDate.getMonth() : null;
2072
+ return !(g !== h || 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);
2037
2073
  });
2038
- Cl.displayName = "MonthSelector";
2039
- function br(e, t, r) {
2074
+ Gl.displayName = "MonthSelector";
2075
+ function pr(e, t, r) {
2040
2076
  if (!(r instanceof Date) || Number.isNaN(r.getTime()))
2041
2077
  throw new RangeError(`${e}: ${t} is required and must be a valid Date (received: ${String(r)})`);
2042
2078
  }
2043
- function Rn(e, t, r) {
2044
- if (br(e, "minDate", t), br(e, "maxDate", r), r.getTime() <= t.getTime())
2079
+ function Tn(e, t, r) {
2080
+ if (pr(e, "minDate", t), pr(e, "maxDate", r), r.getTime() <= t.getTime())
2045
2081
  throw new RangeError(`${e}: maxDate must be strictly later than minDate (minDate: ${t.toISOString()}, maxDate: ${r.toISOString()})`);
2046
2082
  }
2047
- function wn(e, t, r) {
2083
+ function Mn(e, t, r) {
2048
2084
  if (!Array.isArray(r) || r.length !== 2)
2049
2085
  throw new RangeError(`${e}: ${t} is required and must be a [lower, upper] Date tuple (received: ${String(r)})`);
2050
- if (br(e, `${t}[0]`, r[0]), br(e, `${t}[1]`, r[1]), r[0].getTime() > r[1].getTime())
2086
+ if (pr(e, `${t}[0]`, r[0]), pr(e, `${t}[1]`, r[1]), r[0].getTime() > r[1].getTime())
2051
2087
  throw new RangeError(`${e}: ${t} upper must not be earlier than lower (lower: ${r[0].toISOString()}, upper: ${r[1].toISOString()})`);
2052
2088
  }
2053
- function vn(e, t, r, n, a, i, l) {
2054
- const c = Q(r, n);
2055
- if (c < Q(r, a) || c > Q(r, i))
2056
- throw new RangeError(`${e}: ${t} must lie within ${l} (value: ${n.toISOString()}, lower: ${a.toISOString()}, upper: ${i.toISOString()})`);
2089
+ function xn(e, t, r, n, o, i, l) {
2090
+ const s = Q(r, n);
2091
+ if (s < Q(r, o) || s > Q(r, i))
2092
+ throw new RangeError(`${e}: ${t} must lie within ${l} (value: ${n.toISOString()}, lower: ${o.toISOString()}, upper: ${i.toISOString()})`);
2057
2093
  }
2058
- function pn(e, t, r, n, a, i, l) {
2059
- vn(e, `${t}[0]`, r, n[0], a, i, l), vn(e, `${t}[1]`, r, n[1], a, i, l);
2094
+ function Rn(e, t, r, n, o, i, l) {
2095
+ xn(e, `${t}[0]`, r, n[0], o, i, l), xn(e, `${t}[1]`, r, n[1], o, i, l);
2060
2096
  }
2061
- function Fe(e, t, r) {
2097
+ function We(e, t, r) {
2062
2098
  return e < t ? t : e > r ? r : e;
2063
2099
  }
2064
- function Mn(e, t, r, n, a, i) {
2100
+ function Ln(e, t, r, n, o, i) {
2065
2101
  if (r !== !0) return [];
2066
- const l = e[0].getTime(), c = e[1].getTime();
2067
- return Vt(n, t, a, i).filter((f) => f.getTime() >= l && f.getTime() <= c);
2102
+ const l = e[0].getTime(), s = e[1].getTime();
2103
+ return kt(n, t, o, i).filter((g) => g.getTime() >= l && g.getTime() <= s);
2068
2104
  }
2069
- function hr(e, t, r, n) {
2070
- if (n.length === 0) return Fe(e, r[0], r[1]);
2071
- const a = n[be(n, e, t)];
2072
- return a.getTime() === e.getTime() ? e : a;
2105
+ function vr(e, t, r, n) {
2106
+ if (n.length === 0) return We(e, r[0], r[1]);
2107
+ const o = n[ge(n, e, t)];
2108
+ return o.getTime() === e.getTime() ? e : o;
2073
2109
  }
2074
- function dn(e, t, r, n) {
2075
- const a = hr(e[0], t, r, n), i = hr(e[1], t, r, n);
2076
- return [a, i < a ? a : i];
2110
+ function hn(e, t, r, n) {
2111
+ const o = vr(e[0], t, r, n), i = vr(e[1], t, r, n);
2112
+ return [o, i < o ? o : i];
2077
2113
  }
2078
- function Dn(e, t, r, n) {
2079
- const a = be(e, r, t) + n;
2080
- return e[Math.max(0, Math.min(e.length - 1, a))];
2114
+ function Sn(e, t, r, n) {
2115
+ const o = ge(e, r, t) + n;
2116
+ return e[Math.max(0, Math.min(e.length - 1, o))];
2081
2117
  }
2082
- function Ln(e) {
2083
- const t = O(e), r = t.current, n = e, a = Object.keys(r), i = Object.keys(n);
2084
- return a.length === i.length && i.every((c) => Object.is(r[c], n[c])) || (t.current = e), t.current;
2118
+ function Pn(e) {
2119
+ const t = V(e), r = t.current, n = e, o = Object.keys(r), i = Object.keys(n);
2120
+ return o.length === i.length && i.every((s) => Object.is(r[s], n[s])) || (t.current = e), t.current;
2085
2121
  }
2086
- function Fl(e) {
2087
- const { unit: t, minDate: r, maxDate: n, initialRange: a, onChangeRange: i, ...l } = e;
2088
- Rn("usePeriodSliderRange", r, n), wn("usePeriodSliderRange", "initialRange", a), pn("usePeriodSliderRange", "initialRange", t, a, r, n, "[minDate, maxDate]");
2089
- const c = Ln(l), f = O(a), [g, D] = ye(a);
2090
- let R = g;
2091
- const s = [Fe(g[0], r, n), Fe(g[1], r, n)];
2092
- (s[0] !== g[0] || s[1] !== g[1]) && (R = s, D(s));
2093
- const S = O(R);
2094
- S.current = R;
2095
- const Z = O({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
2096
- Z.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
2097
- const ee = O(i);
2122
+ function es(e) {
2123
+ const { unit: t, minDate: r, maxDate: n, initialRange: o, onChangeRange: i, ...l } = e;
2124
+ Tn("usePeriodSliderRange", r, n), Mn("usePeriodSliderRange", "initialRange", o), Rn("usePeriodSliderRange", "initialRange", t, o, r, n, "[minDate, maxDate]");
2125
+ const s = Pn(l), g = V(o), [h, D] = Pe(o);
2126
+ let R = h;
2127
+ const c = [We(h[0], r, n), We(h[1], r, n)];
2128
+ (c[0] !== h[0] || c[1] !== h[1]) && (R = c, D(c));
2129
+ const M = V(R);
2130
+ M.current = R;
2131
+ const Z = V({ minDate: r, maxDate: n, allowedDates: s.allowedDates });
2132
+ Z.current = { minDate: r, maxDate: n, allowedDates: s.allowedDates };
2133
+ const ee = V(i);
2098
2134
  ee.current = i;
2099
- const x = U((y) => {
2100
- const { minDate: L, maxDate: T } = Z.current, k = Fe(y[0], L, T), V = Fe(y[1], L, T), ne = S.current;
2101
- k.getTime() === ne[0].getTime() && V.getTime() === ne[1].getTime() || (S.current = [k, V], D([k, V]), ee.current?.(k, V));
2102
- }, []), ue = U(
2103
- (y) => {
2104
- const L = S.current, T = y.getTime() > L[1].getTime() ? y : L[1];
2105
- x([y, T]);
2135
+ const x = z((S) => {
2136
+ const { minDate: L, maxDate: y } = Z.current, k = We(S[0], L, y), I = We(S[1], L, y), re = M.current;
2137
+ k.getTime() === re[0].getTime() && I.getTime() === re[1].getTime() || (M.current = [k, I], D([k, I]), ee.current?.(k, I));
2138
+ }, []), ue = z(
2139
+ (S) => {
2140
+ const L = M.current, y = S.getTime() > L[1].getTime() ? S : L[1];
2141
+ x([S, y]);
2106
2142
  },
2107
2143
  [x]
2108
- ), ae = U(
2109
- (y) => {
2110
- const L = S.current, T = y.getTime() < L[0].getTime() ? y : L[0];
2111
- x([T, y]);
2144
+ ), ne = z(
2145
+ (S) => {
2146
+ const L = M.current, y = S.getTime() < L[0].getTime() ? S : L[0];
2147
+ x([y, S]);
2112
2148
  },
2113
2149
  [x]
2114
- ), $ = U(
2115
- (y, L) => {
2116
- x([y, L]);
2150
+ ), P = z(
2151
+ (S, L) => {
2152
+ x([S, L]);
2117
2153
  },
2118
2154
  [x]
2119
- ), H = U(
2120
- (y) => {
2121
- const { minDate: L, maxDate: T, allowedDates: k } = Z.current, V = S.current, ne = Vt(k, t, L, T);
2122
- if (ne.length > 0) {
2123
- x([Dn(ne, t, V[0], y), Dn(ne, t, V[1], y)]);
2155
+ ), O = z(
2156
+ (S) => {
2157
+ const { minDate: L, maxDate: y, allowedDates: k } = Z.current, I = M.current, re = kt(k, t, L, y);
2158
+ if (re.length > 0) {
2159
+ x([Sn(re, t, I[0], S), Sn(re, t, I[1], S)]);
2124
2160
  return;
2125
2161
  }
2126
- x([Oe(t, V[0], y), Oe(t, V[1], y)]);
2162
+ x([Oe(t, I[0], S), Oe(t, I[1], S)]);
2127
2163
  },
2128
2164
  [t, x]
2129
- ), W = U(() => {
2130
- x(f.current);
2131
- }, [x]), oe = C(
2165
+ ), G = z(() => {
2166
+ x(g.current);
2167
+ }, [x]), ie = E(
2132
2168
  () => ({
2133
2169
  value: R[0],
2134
2170
  onChange: ue,
@@ -2137,26 +2173,26 @@ function Fl(e) {
2137
2173
  unit: t
2138
2174
  }),
2139
2175
  [R[0], R[1], ue, r, t]
2140
- ), q = C(
2176
+ ), j = E(
2141
2177
  () => ({
2142
2178
  value: R[1],
2143
- onChange: ae,
2179
+ onChange: ne,
2144
2180
  minDate: R[0],
2145
2181
  maxDate: n,
2146
2182
  unit: t
2147
2183
  }),
2148
- [R[0], R[1], ae, n, t]
2149
- ), X = C(
2184
+ [R[0], R[1], ne, n, t]
2185
+ ), X = E(
2150
2186
  () => ({
2151
- ...c,
2187
+ ...s,
2152
2188
  mode: "range",
2153
2189
  unit: t,
2154
2190
  range: R,
2155
2191
  minDate: r,
2156
2192
  maxDate: n,
2157
- onChangeRange: $
2193
+ onChangeRange: P
2158
2194
  }),
2159
- [c, t, R, r, n, $]
2195
+ [s, t, R, r, n, P]
2160
2196
  );
2161
2197
  return {
2162
2198
  range: R,
@@ -2164,43 +2200,43 @@ function Fl(e) {
2164
2200
  upperDate: R[1],
2165
2201
  setRange: D,
2166
2202
  setLowerDate: ue,
2167
- setUpperDate: ae,
2168
- shiftRange: H,
2169
- resetRange: W,
2170
- startSelectorProps: oe,
2171
- endSelectorProps: q,
2203
+ setUpperDate: ne,
2204
+ shiftRange: O,
2205
+ resetRange: G,
2206
+ startSelectorProps: ie,
2207
+ endSelectorProps: j,
2172
2208
  sliderProps: X
2173
2209
  };
2174
2210
  }
2175
- function zl(e) {
2176
- const { unit: t, minDate: r, maxDate: n, initialValue: a, onChangePoint: i, ...l } = e;
2177
- Rn("usePeriodSliderPoint", r, n), br("usePeriodSliderPoint", "initialValue", a), vn("usePeriodSliderPoint", "initialValue", t, a, r, n, "[minDate, maxDate]");
2178
- const c = Ln(l), f = O(a), [g, D] = ye(a);
2179
- let R = g;
2180
- const s = Fe(g, r, n);
2181
- s !== g && (R = s, D(s));
2182
- const S = O(R);
2183
- S.current = R;
2184
- const Z = O({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
2185
- Z.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
2186
- const ee = O(i);
2211
+ function ts(e) {
2212
+ const { unit: t, minDate: r, maxDate: n, initialValue: o, onChangePoint: i, ...l } = e;
2213
+ Tn("usePeriodSliderPoint", r, n), pr("usePeriodSliderPoint", "initialValue", o), xn("usePeriodSliderPoint", "initialValue", t, o, r, n, "[minDate, maxDate]");
2214
+ const s = Pn(l), g = V(o), [h, D] = Pe(o);
2215
+ let R = h;
2216
+ const c = We(h, r, n);
2217
+ c !== h && (R = c, D(c));
2218
+ const M = V(R);
2219
+ M.current = R;
2220
+ const Z = V({ minDate: r, maxDate: n, allowedDates: s.allowedDates });
2221
+ Z.current = { minDate: r, maxDate: n, allowedDates: s.allowedDates };
2222
+ const ee = V(i);
2187
2223
  ee.current = i;
2188
- const x = U((W) => {
2189
- const { minDate: oe, maxDate: q } = Z.current, X = Fe(W, oe, q);
2190
- X.getTime() !== S.current.getTime() && (S.current = X, D(X), ee.current?.(X));
2191
- }, []), ue = U(
2192
- (W) => {
2193
- const { minDate: oe, maxDate: q, allowedDates: X } = Z.current, y = Vt(X, t, oe, q);
2194
- if (y.length > 0) {
2195
- x(Dn(y, t, S.current, W));
2224
+ const x = z((G) => {
2225
+ const { minDate: ie, maxDate: j } = Z.current, X = We(G, ie, j);
2226
+ X.getTime() !== M.current.getTime() && (M.current = X, D(X), ee.current?.(X));
2227
+ }, []), ue = z(
2228
+ (G) => {
2229
+ const { minDate: ie, maxDate: j, allowedDates: X } = Z.current, S = kt(X, t, ie, j);
2230
+ if (S.length > 0) {
2231
+ x(Sn(S, t, M.current, G));
2196
2232
  return;
2197
2233
  }
2198
- x(Oe(t, S.current, W));
2234
+ x(Oe(t, M.current, G));
2199
2235
  },
2200
2236
  [t, x]
2201
- ), ae = U(() => {
2202
- x(f.current);
2203
- }, [x]), $ = C(
2237
+ ), ne = z(() => {
2238
+ x(g.current);
2239
+ }, [x]), P = E(
2204
2240
  () => ({
2205
2241
  value: R,
2206
2242
  onChange: x,
@@ -2209,9 +2245,9 @@ function zl(e) {
2209
2245
  unit: t
2210
2246
  }),
2211
2247
  [R, x, r, n, t]
2212
- ), H = C(
2248
+ ), O = E(
2213
2249
  () => ({
2214
- ...c,
2250
+ ...s,
2215
2251
  mode: "point",
2216
2252
  unit: t,
2217
2253
  value: R,
@@ -2219,366 +2255,366 @@ function zl(e) {
2219
2255
  maxDate: n,
2220
2256
  onChangePoint: x
2221
2257
  }),
2222
- [c, t, R, r, n, x]
2258
+ [s, t, R, r, n, x]
2223
2259
  );
2224
2260
  return {
2225
2261
  value: R,
2226
2262
  setValue: D,
2227
2263
  shiftValue: ue,
2228
- resetValue: ae,
2229
- selectorProps: $,
2230
- sliderProps: H
2264
+ resetValue: ne,
2265
+ selectorProps: P,
2266
+ sliderProps: O
2231
2267
  };
2232
2268
  }
2233
- function Bl(e) {
2234
- const { unit: t, minDate: r, maxDate: n, initialMacroRange: a, initialMicroRange: i, macroUnit: l = t, microUnit: c = t, onChangeMacroRange: f, onChangeMicroRange: g, ...D } = e;
2235
- Rn("useVernierSliderRange", r, n), wn("useVernierSliderRange", "initialMacroRange", a), wn("useVernierSliderRange", "initialMicroRange", i), pn("useVernierSliderRange", "initialMacroRange", l, a, r, n, "[minDate, maxDate]");
2236
- const R = xt(l, c, a, r, n);
2237
- pn("useVernierSliderRange", "initialMicroRange", c, i, R[0], R[1], "the initial macro window");
2238
- const s = Ln(D), S = O(a), Z = O(i), [ee, x] = ye(a), [ue, ae] = ye(i);
2239
- let $ = ee;
2240
- const H = [Fe(ee[0], r, n), Fe(ee[1], r, n)];
2241
- (H[0] !== ee[0] || H[1] !== ee[1]) && ($ = H, x(H));
2242
- const W = C(() => xt(l, c, $, r, n), [l, c, $, r, n]), oe = C(
2243
- () => Mn(W, c, s.microIsDiscrete, s.microAllowedDates ?? s.allowedDates, r, n),
2244
- [W, c, s.microIsDiscrete, s.microAllowedDates, s.allowedDates, r, n]
2245
- ), q = C(
2246
- () => s.macroIsDiscrete === !0 ? Vt(s.macroAllowedDates ?? s.allowedDates, l, r, n) : [],
2247
- [s.macroIsDiscrete, s.macroAllowedDates, s.allowedDates, l, r, n]
2248
- ), X = O(q);
2249
- X.current = q;
2250
- let y = ue;
2251
- const L = dn(ue, c, W, oe);
2252
- (L[0] !== ue[0] || L[1] !== ue[1]) && (y = L, ae(L));
2253
- const T = O($);
2254
- T.current = $;
2255
- const k = O(y);
2256
- k.current = y;
2257
- const V = O({ minDate: r, maxDate: n, macroIsDiscrete: s.macroIsDiscrete, macroAllowedDates: s.macroAllowedDates, microIsDiscrete: s.microIsDiscrete, microAllowedDates: s.microAllowedDates, allowedDates: s.allowedDates });
2258
- V.current = { minDate: r, maxDate: n, macroIsDiscrete: s.macroIsDiscrete, macroAllowedDates: s.macroAllowedDates, microIsDiscrete: s.microIsDiscrete, microAllowedDates: s.microAllowedDates, allowedDates: s.allowedDates };
2259
- const ne = O(f);
2260
- ne.current = f;
2261
- const ce = O(g);
2262
- ce.current = g;
2263
- const G = U(
2264
- (v) => {
2265
- const { minDate: Y, maxDate: p } = V.current;
2266
- return xt(l, c, v, Y, p);
2269
+ function rs(e) {
2270
+ const { unit: t, minDate: r, maxDate: n, initialMacroRange: o, initialMicroRange: i, macroUnit: l = t, microUnit: s = t, onChangeMacroRange: g, onChangeMicroRange: h, ...D } = e;
2271
+ Tn("useVernierSliderRange", r, n), Mn("useVernierSliderRange", "initialMacroRange", o), Mn("useVernierSliderRange", "initialMicroRange", i), Rn("useVernierSliderRange", "initialMacroRange", l, o, r, n, "[minDate, maxDate]");
2272
+ const R = xt(l, s, o, r, n);
2273
+ Rn("useVernierSliderRange", "initialMicroRange", s, i, R[0], R[1], "the initial macro window");
2274
+ const c = Pn(D), M = V(o), Z = V(i), [ee, x] = Pe(o), [ue, ne] = Pe(i);
2275
+ let P = ee;
2276
+ const O = [We(ee[0], r, n), We(ee[1], r, n)];
2277
+ (O[0] !== ee[0] || O[1] !== ee[1]) && (P = O, x(O));
2278
+ const G = E(() => xt(l, s, P, r, n), [l, s, P, r, n]), ie = E(
2279
+ () => Ln(G, s, c.microIsDiscrete, c.microAllowedDates ?? c.allowedDates, r, n),
2280
+ [G, s, c.microIsDiscrete, c.microAllowedDates, c.allowedDates, r, n]
2281
+ ), j = E(
2282
+ () => c.macroIsDiscrete === !0 ? kt(c.macroAllowedDates ?? c.allowedDates, l, r, n) : [],
2283
+ [c.macroIsDiscrete, c.macroAllowedDates, c.allowedDates, l, r, n]
2284
+ ), X = V(j);
2285
+ X.current = j;
2286
+ let S = ue;
2287
+ const L = hn(ue, s, G, ie);
2288
+ (L[0] !== ue[0] || L[1] !== ue[1]) && (S = L, ne(L));
2289
+ const y = V(P);
2290
+ y.current = P;
2291
+ const k = V(S);
2292
+ k.current = S;
2293
+ const I = V({ minDate: r, maxDate: n, macroIsDiscrete: c.macroIsDiscrete, macroAllowedDates: c.macroAllowedDates, microIsDiscrete: c.microIsDiscrete, microAllowedDates: c.microAllowedDates, allowedDates: c.allowedDates });
2294
+ I.current = { minDate: r, maxDate: n, macroIsDiscrete: c.macroIsDiscrete, macroAllowedDates: c.macroAllowedDates, microIsDiscrete: c.microIsDiscrete, microAllowedDates: c.microAllowedDates, allowedDates: c.allowedDates };
2295
+ const re = V(g);
2296
+ re.current = g;
2297
+ const ce = V(h);
2298
+ ce.current = h;
2299
+ const K = z(
2300
+ (p) => {
2301
+ const { minDate: N, maxDate: v } = I.current;
2302
+ return xt(l, s, p, N, v);
2267
2303
  },
2268
- [l, c]
2269
- ), J = U(
2270
- (v) => {
2271
- const { microIsDiscrete: Y, microAllowedDates: p, allowedDates: j, minDate: de, maxDate: we } = V.current;
2272
- return Mn(v, c, Y, p ?? j, de, we);
2304
+ [l, s]
2305
+ ), J = z(
2306
+ (p) => {
2307
+ const { microIsDiscrete: N, microAllowedDates: v, allowedDates: Y, minDate: he, maxDate: be } = I.current;
2308
+ return Ln(p, s, N, v ?? Y, he, be);
2273
2309
  },
2274
- [c]
2275
- ), z = U((v, Y) => {
2276
- const p = T.current, j = k.current;
2277
- (v[0].getTime() !== p[0].getTime() || v[1].getTime() !== p[1].getTime()) && (T.current = v, x(v), ne.current?.(v[0], v[1])), (Y[0].getTime() !== j[0].getTime() || Y[1].getTime() !== j[1].getTime()) && (k.current = Y, ae(Y), ce.current?.(Y[0], Y[1]));
2278
- }, []), _ = U(
2279
- (v, Y) => {
2280
- const { minDate: p, maxDate: j } = V.current, de = [Fe(v, p, j), Fe(Y, p, j)], we = G(de);
2281
- z(de, dn(k.current, c, we, J(we)));
2310
+ [s]
2311
+ ), B = z((p, N) => {
2312
+ const v = y.current, Y = k.current;
2313
+ (p[0].getTime() !== v[0].getTime() || p[1].getTime() !== v[1].getTime()) && (y.current = p, x(p), re.current?.(p[0], p[1])), (N[0].getTime() !== Y[0].getTime() || N[1].getTime() !== Y[1].getTime()) && (k.current = N, ne(N), ce.current?.(N[0], N[1]));
2314
+ }, []), H = z(
2315
+ (p, N) => {
2316
+ const { minDate: v, maxDate: Y } = I.current, he = [We(p, v, Y), We(N, v, Y)], be = K(he);
2317
+ B(he, hn(k.current, s, be, J(be)));
2282
2318
  },
2283
- [c, G, J, z]
2284
- ), me = U(
2285
- (v, Y) => {
2286
- const p = G(T.current);
2287
- z(T.current, dn([v, Y], c, p, J(p)));
2319
+ [s, K, J, B]
2320
+ ), de = z(
2321
+ (p, N) => {
2322
+ const v = K(y.current);
2323
+ B(y.current, hn([p, N], s, v, J(v)));
2288
2324
  },
2289
- [c, G, J, z]
2290
- ), ge = U(
2291
- (v) => {
2292
- const Y = T.current[1], p = v > Y ? v : Y;
2293
- _(v, p);
2325
+ [s, K, J, B]
2326
+ ), me = z(
2327
+ (p) => {
2328
+ const N = y.current[1], v = p > N ? p : N;
2329
+ H(p, v);
2294
2330
  },
2295
- [_]
2296
- ), le = U(
2297
- (v) => {
2298
- const Y = T.current[0], p = v < Y ? v : Y;
2299
- _(p, v);
2331
+ [H]
2332
+ ), De = z(
2333
+ (p) => {
2334
+ const N = y.current[0], v = p < N ? p : N;
2335
+ H(v, p);
2300
2336
  },
2301
- [_]
2302
- ), ze = U(
2303
- (v) => {
2304
- const Y = k.current[1], p = v > Y ? v : Y;
2305
- me(v, p);
2337
+ [H]
2338
+ ), Ge = z(
2339
+ (p) => {
2340
+ const N = k.current[1], v = p > N ? p : N;
2341
+ de(p, v);
2306
2342
  },
2307
- [me]
2308
- ), Ee = U(
2309
- (v) => {
2310
- const Y = k.current[0], p = v < Y ? v : Y;
2311
- me(p, v);
2343
+ [de]
2344
+ ), Me = z(
2345
+ (p) => {
2346
+ const N = k.current[0], v = p < N ? p : N;
2347
+ de(v, p);
2312
2348
  },
2313
- [me]
2314
- ), Te = U(
2315
- (v) => {
2316
- const { minDate: Y, maxDate: p } = V.current, j = T.current, de = X.current;
2317
- if (de.length > 0) {
2318
- const He = be(de, j[0], l) + v, rt = be(de, j[1], l) + v;
2319
- if (He < 0 || rt > de.length - 1) return;
2320
- _(de[He], de[rt]);
2349
+ [de]
2350
+ ), pe = z(
2351
+ (p) => {
2352
+ const { minDate: N, maxDate: v } = I.current, Y = y.current, he = X.current;
2353
+ if (he.length > 0) {
2354
+ const Ie = ge(he, Y[0], l) + p, _e = ge(he, Y[1], l) + p;
2355
+ if (Ie < 0 || _e > he.length - 1) return;
2356
+ H(he[Ie], he[_e]);
2321
2357
  return;
2322
2358
  }
2323
- const we = Oe(l, j[0], v), Ae = Oe(l, j[1], v);
2324
- we < Y || Ae > p || _(we, Ae);
2359
+ const be = Oe(l, Y[0], p), $e = Oe(l, Y[1], p);
2360
+ be < N || $e > v || H(be, $e);
2325
2361
  },
2326
- [l, _]
2327
- ), Pe = U(
2328
- (v) => {
2329
- const Y = T.current, p = k.current, j = G(Y), [de, we] = j, Ae = J(j);
2330
- if (Ae.length > 0) {
2331
- const ve = be(Ae, p[0], c) + v, pe = be(Ae, p[1], c) + v;
2332
- if (ve < 0 || pe > Ae.length - 1) return;
2333
- me(Ae[ve], Ae[pe]);
2362
+ [l, H]
2363
+ ), Le = z(
2364
+ (p) => {
2365
+ const N = y.current, v = k.current, Y = K(N), [he, be] = Y, $e = J(Y);
2366
+ if ($e.length > 0) {
2367
+ const Rt = ge($e, v[0], s) + p, bt = ge($e, v[1], s) + p;
2368
+ if (Rt < 0 || bt > $e.length - 1) return;
2369
+ de($e[Rt], $e[bt]);
2334
2370
  return;
2335
2371
  }
2336
- const He = Oe(c, p[0], v), rt = Oe(c, p[1], v);
2337
- He < de || rt > we || me(He, rt);
2372
+ const Ie = Oe(s, v[0], p), _e = Oe(s, v[1], p);
2373
+ Ie < he || _e > be || de(Ie, _e);
2338
2374
  },
2339
- [c, G, J, me]
2340
- ), qe = U(() => {
2341
- const v = S.current, Y = G(v);
2342
- z(v, dn(Z.current, c, Y, J(Y)));
2343
- }, [c, G, J, z]), [Be, tt] = W, Ue = C(
2375
+ [s, K, J, de]
2376
+ ), He = z(() => {
2377
+ const p = M.current, N = K(p);
2378
+ B(p, hn(Z.current, s, N, J(N)));
2379
+ }, [s, K, J, B]), [Fe, rt] = G, ht = E(
2344
2380
  () => ({
2345
- value: $[0],
2346
- onChange: ge,
2381
+ value: P[0],
2382
+ onChange: me,
2347
2383
  minDate: r,
2348
- maxDate: $[1],
2384
+ maxDate: P[1],
2349
2385
  unit: l
2350
2386
  }),
2351
- [$, ge, r, l]
2352
- ), it = C(
2387
+ [P, me, r, l]
2388
+ ), lt = E(
2353
2389
  () => ({
2354
- value: $[1],
2355
- onChange: le,
2356
- minDate: $[0],
2390
+ value: P[1],
2391
+ onChange: De,
2392
+ minDate: P[0],
2357
2393
  maxDate: n,
2358
2394
  unit: l
2359
2395
  }),
2360
- [$, le, n, l]
2361
- ), K = C(
2396
+ [P, De, n, l]
2397
+ ), q = E(
2362
2398
  () => ({
2363
- value: y[0],
2364
- onChange: ze,
2365
- minDate: Be,
2366
- maxDate: y[1],
2367
- unit: c
2399
+ value: S[0],
2400
+ onChange: Ge,
2401
+ minDate: Fe,
2402
+ maxDate: S[1],
2403
+ unit: s
2368
2404
  }),
2369
- [y, ze, Be, c]
2370
- ), B = C(
2405
+ [S, Ge, Fe, s]
2406
+ ), U = E(
2371
2407
  () => ({
2372
- value: y[1],
2373
- onChange: Ee,
2374
- minDate: y[0],
2375
- maxDate: tt,
2376
- unit: c
2408
+ value: S[1],
2409
+ onChange: Me,
2410
+ minDate: S[0],
2411
+ maxDate: rt,
2412
+ unit: s
2377
2413
  }),
2378
- [y, Ee, tt, c]
2379
- ), te = C(
2414
+ [S, Me, rt, s]
2415
+ ), oe = E(
2380
2416
  () => ({
2381
- ...s,
2417
+ ...c,
2382
2418
  mode: "vernier",
2383
2419
  unit: t,
2384
2420
  macroUnit: l,
2385
- microUnit: c,
2421
+ microUnit: s,
2386
2422
  minDate: r,
2387
2423
  maxDate: n,
2388
- macroRange: $,
2389
- microRange: y,
2390
- onChangeMacroRange: _,
2391
- onChangeMicroRange: me
2424
+ macroRange: P,
2425
+ microRange: S,
2426
+ onChangeMacroRange: H,
2427
+ onChangeMicroRange: de
2392
2428
  }),
2393
- [s, t, l, c, r, n, $, y, _, me]
2429
+ [c, t, l, s, r, n, P, S, H, de]
2394
2430
  );
2395
2431
  return {
2396
- macroRange: $,
2432
+ macroRange: P,
2397
2433
  setMacroRange: x,
2398
- microRange: y,
2399
- setMicroRange: ae,
2400
- setMacroLowerDate: ge,
2401
- setMacroUpperDate: le,
2402
- setMicroLowerDate: ze,
2403
- setMicroUpperDate: Ee,
2404
- shiftMacroRange: Te,
2405
- shiftMicroRange: Pe,
2406
- resetVernier: qe,
2407
- macroStartSelectorProps: Ue,
2408
- macroEndSelectorProps: it,
2409
- microStartSelectorProps: K,
2410
- microEndSelectorProps: B,
2411
- sliderProps: te
2434
+ microRange: S,
2435
+ setMicroRange: ne,
2436
+ setMacroLowerDate: me,
2437
+ setMacroUpperDate: De,
2438
+ setMicroLowerDate: Ge,
2439
+ setMicroUpperDate: Me,
2440
+ shiftMacroRange: pe,
2441
+ shiftMicroRange: Le,
2442
+ resetVernier: He,
2443
+ macroStartSelectorProps: ht,
2444
+ macroEndSelectorProps: lt,
2445
+ microStartSelectorProps: q,
2446
+ microEndSelectorProps: U,
2447
+ sliderProps: oe
2412
2448
  };
2413
2449
  }
2414
- function Ul(e) {
2415
- const { unit: t, minDate: r, maxDate: n, initialMacroRange: a, initialMicroValue: i, macroUnit: l = t, microUnit: c = t, onChangeMacroRange: f, onChangeMicroPoint: g, ...D } = e;
2416
- Rn("useVernierSliderPoint", r, n), wn("useVernierSliderPoint", "initialMacroRange", a), br("useVernierSliderPoint", "initialMicroValue", i), pn("useVernierSliderPoint", "initialMacroRange", l, a, r, n, "[minDate, maxDate]");
2417
- const R = xt(l, c, a, r, n);
2418
- vn("useVernierSliderPoint", "initialMicroValue", c, i, R[0], R[1], "the initial macro window");
2419
- const s = Ln(D), S = O(a), Z = O(i), [ee, x] = ye(a), [ue, ae] = ye(i);
2420
- let $ = ee;
2421
- const H = [Fe(ee[0], r, n), Fe(ee[1], r, n)];
2422
- (H[0] !== ee[0] || H[1] !== ee[1]) && ($ = H, x(H));
2423
- const W = C(() => xt(l, c, $, r, n), [l, c, $, r, n]), oe = C(
2424
- () => Mn(W, c, s.microIsDiscrete, s.microAllowedDates ?? s.allowedDates, r, n),
2425
- [W, c, s.microIsDiscrete, s.microAllowedDates, s.allowedDates, r, n]
2426
- ), q = C(
2427
- () => s.macroIsDiscrete === !0 ? Vt(s.macroAllowedDates ?? s.allowedDates, l, r, n) : [],
2428
- [s.macroIsDiscrete, s.macroAllowedDates, s.allowedDates, l, r, n]
2429
- ), X = O(q);
2430
- X.current = q;
2431
- let y = ue;
2432
- const L = hr(ue, c, W, oe);
2433
- L !== ue && (y = L, ae(L));
2434
- const T = O($);
2435
- T.current = $;
2436
- const k = O(y);
2437
- k.current = y;
2438
- const V = O({ minDate: r, maxDate: n, macroIsDiscrete: s.macroIsDiscrete, macroAllowedDates: s.macroAllowedDates, microIsDiscrete: s.microIsDiscrete, microAllowedDates: s.microAllowedDates, allowedDates: s.allowedDates });
2439
- V.current = { minDate: r, maxDate: n, macroIsDiscrete: s.macroIsDiscrete, macroAllowedDates: s.macroAllowedDates, microIsDiscrete: s.microIsDiscrete, microAllowedDates: s.microAllowedDates, allowedDates: s.allowedDates };
2440
- const ne = O(f);
2441
- ne.current = f;
2442
- const ce = O(g);
2443
- ce.current = g;
2444
- const G = U(
2445
- (K) => {
2446
- const { minDate: B, maxDate: te } = V.current;
2447
- return xt(l, c, K, B, te);
2450
+ function ns(e) {
2451
+ const { unit: t, minDate: r, maxDate: n, initialMacroRange: o, initialMicroValue: i, macroUnit: l = t, microUnit: s = t, onChangeMacroRange: g, onChangeMicroPoint: h, ...D } = e;
2452
+ Tn("useVernierSliderPoint", r, n), Mn("useVernierSliderPoint", "initialMacroRange", o), pr("useVernierSliderPoint", "initialMicroValue", i), Rn("useVernierSliderPoint", "initialMacroRange", l, o, r, n, "[minDate, maxDate]");
2453
+ const R = xt(l, s, o, r, n);
2454
+ xn("useVernierSliderPoint", "initialMicroValue", s, i, R[0], R[1], "the initial macro window");
2455
+ const c = Pn(D), M = V(o), Z = V(i), [ee, x] = Pe(o), [ue, ne] = Pe(i);
2456
+ let P = ee;
2457
+ const O = [We(ee[0], r, n), We(ee[1], r, n)];
2458
+ (O[0] !== ee[0] || O[1] !== ee[1]) && (P = O, x(O));
2459
+ const G = E(() => xt(l, s, P, r, n), [l, s, P, r, n]), ie = E(
2460
+ () => Ln(G, s, c.microIsDiscrete, c.microAllowedDates ?? c.allowedDates, r, n),
2461
+ [G, s, c.microIsDiscrete, c.microAllowedDates, c.allowedDates, r, n]
2462
+ ), j = E(
2463
+ () => c.macroIsDiscrete === !0 ? kt(c.macroAllowedDates ?? c.allowedDates, l, r, n) : [],
2464
+ [c.macroIsDiscrete, c.macroAllowedDates, c.allowedDates, l, r, n]
2465
+ ), X = V(j);
2466
+ X.current = j;
2467
+ let S = ue;
2468
+ const L = vr(ue, s, G, ie);
2469
+ L !== ue && (S = L, ne(L));
2470
+ const y = V(P);
2471
+ y.current = P;
2472
+ const k = V(S);
2473
+ k.current = S;
2474
+ const I = V({ minDate: r, maxDate: n, macroIsDiscrete: c.macroIsDiscrete, macroAllowedDates: c.macroAllowedDates, microIsDiscrete: c.microIsDiscrete, microAllowedDates: c.microAllowedDates, allowedDates: c.allowedDates });
2475
+ I.current = { minDate: r, maxDate: n, macroIsDiscrete: c.macroIsDiscrete, macroAllowedDates: c.macroAllowedDates, microIsDiscrete: c.microIsDiscrete, microAllowedDates: c.microAllowedDates, allowedDates: c.allowedDates };
2476
+ const re = V(g);
2477
+ re.current = g;
2478
+ const ce = V(h);
2479
+ ce.current = h;
2480
+ const K = z(
2481
+ (q) => {
2482
+ const { minDate: U, maxDate: oe } = I.current;
2483
+ return xt(l, s, q, U, oe);
2448
2484
  },
2449
- [l, c]
2450
- ), J = U(
2451
- (K) => {
2452
- const { microIsDiscrete: B, microAllowedDates: te, allowedDates: v, minDate: Y, maxDate: p } = V.current;
2453
- return Mn(K, c, B, te ?? v, Y, p);
2485
+ [l, s]
2486
+ ), J = z(
2487
+ (q) => {
2488
+ const { microIsDiscrete: U, microAllowedDates: oe, allowedDates: p, minDate: N, maxDate: v } = I.current;
2489
+ return Ln(q, s, U, oe ?? p, N, v);
2454
2490
  },
2455
- [c]
2456
- ), z = U((K, B) => {
2457
- const te = T.current, v = k.current;
2458
- (K[0].getTime() !== te[0].getTime() || K[1].getTime() !== te[1].getTime()) && (T.current = K, x(K), ne.current?.(K[0], K[1])), B.getTime() !== v.getTime() && (k.current = B, ae(B), ce.current?.(B));
2459
- }, []), _ = U(
2460
- (K, B) => {
2461
- const { minDate: te, maxDate: v } = V.current, Y = [Fe(K, te, v), Fe(B, te, v)], p = G(Y);
2462
- z(Y, hr(k.current, c, p, J(p)));
2491
+ [s]
2492
+ ), B = z((q, U) => {
2493
+ const oe = y.current, p = k.current;
2494
+ (q[0].getTime() !== oe[0].getTime() || q[1].getTime() !== oe[1].getTime()) && (y.current = q, x(q), re.current?.(q[0], q[1])), U.getTime() !== p.getTime() && (k.current = U, ne(U), ce.current?.(U));
2495
+ }, []), H = z(
2496
+ (q, U) => {
2497
+ const { minDate: oe, maxDate: p } = I.current, N = [We(q, oe, p), We(U, oe, p)], v = K(N);
2498
+ B(N, vr(k.current, s, v, J(v)));
2463
2499
  },
2464
- [c, G, J, z]
2465
- ), me = U(
2466
- (K) => {
2467
- const B = G(T.current);
2468
- z(T.current, hr(K, c, B, J(B)));
2500
+ [s, K, J, B]
2501
+ ), de = z(
2502
+ (q) => {
2503
+ const U = K(y.current);
2504
+ B(y.current, vr(q, s, U, J(U)));
2469
2505
  },
2470
- [c, G, J, z]
2471
- ), ge = U(
2472
- (K) => {
2473
- const B = T.current[1], te = K > B ? K : B;
2474
- _(K, te);
2506
+ [s, K, J, B]
2507
+ ), me = z(
2508
+ (q) => {
2509
+ const U = y.current[1], oe = q > U ? q : U;
2510
+ H(q, oe);
2475
2511
  },
2476
- [_]
2477
- ), le = U(
2478
- (K) => {
2479
- const B = T.current[0], te = K < B ? K : B;
2480
- _(te, K);
2512
+ [H]
2513
+ ), De = z(
2514
+ (q) => {
2515
+ const U = y.current[0], oe = q < U ? q : U;
2516
+ H(oe, q);
2481
2517
  },
2482
- [_]
2483
- ), ze = U(
2484
- (K) => {
2485
- const { minDate: B, maxDate: te } = V.current, v = T.current, Y = X.current;
2486
- if (Y.length > 0) {
2487
- const de = be(Y, v[0], l) + K, we = be(Y, v[1], l) + K;
2488
- if (de < 0 || we > Y.length - 1) return;
2489
- _(Y[de], Y[we]);
2518
+ [H]
2519
+ ), Ge = z(
2520
+ (q) => {
2521
+ const { minDate: U, maxDate: oe } = I.current, p = y.current, N = X.current;
2522
+ if (N.length > 0) {
2523
+ const he = ge(N, p[0], l) + q, be = ge(N, p[1], l) + q;
2524
+ if (he < 0 || be > N.length - 1) return;
2525
+ H(N[he], N[be]);
2490
2526
  return;
2491
2527
  }
2492
- const p = Oe(l, v[0], K), j = Oe(l, v[1], K);
2493
- p < B || j > te || _(p, j);
2528
+ const v = Oe(l, p[0], q), Y = Oe(l, p[1], q);
2529
+ v < U || Y > oe || H(v, Y);
2494
2530
  },
2495
- [l, _]
2496
- ), Ee = U(
2497
- (K) => {
2498
- const B = T.current, te = G(B), v = J(te);
2499
- if (v.length > 0) {
2500
- me(Dn(v, c, k.current, K));
2531
+ [l, H]
2532
+ ), Me = z(
2533
+ (q) => {
2534
+ const U = y.current, oe = K(U), p = J(oe);
2535
+ if (p.length > 0) {
2536
+ de(Sn(p, s, k.current, q));
2501
2537
  return;
2502
2538
  }
2503
- me(Oe(c, k.current, K));
2539
+ de(Oe(s, k.current, q));
2504
2540
  },
2505
- [c, G, J, me]
2506
- ), Te = U(() => {
2507
- const K = S.current, B = G(K);
2508
- z(K, hr(Z.current, c, B, J(B)));
2509
- }, [c, G, J, z]), [Pe, qe] = W, Be = C(
2541
+ [s, K, J, de]
2542
+ ), pe = z(() => {
2543
+ const q = M.current, U = K(q);
2544
+ B(q, vr(Z.current, s, U, J(U)));
2545
+ }, [s, K, J, B]), [Le, He] = G, Fe = E(
2510
2546
  () => ({
2511
- value: $[0],
2512
- onChange: ge,
2547
+ value: P[0],
2548
+ onChange: me,
2513
2549
  minDate: r,
2514
- maxDate: $[1],
2550
+ maxDate: P[1],
2515
2551
  unit: l
2516
2552
  }),
2517
- [$, ge, r, l]
2518
- ), tt = C(
2553
+ [P, me, r, l]
2554
+ ), rt = E(
2519
2555
  () => ({
2520
- value: $[1],
2521
- onChange: le,
2522
- minDate: $[0],
2556
+ value: P[1],
2557
+ onChange: De,
2558
+ minDate: P[0],
2523
2559
  maxDate: n,
2524
2560
  unit: l
2525
2561
  }),
2526
- [$, le, n, l]
2527
- ), Ue = C(
2562
+ [P, De, n, l]
2563
+ ), ht = E(
2528
2564
  () => ({
2529
- value: y,
2530
- onChange: me,
2531
- minDate: Pe,
2532
- maxDate: qe,
2533
- unit: c
2565
+ value: S,
2566
+ onChange: de,
2567
+ minDate: Le,
2568
+ maxDate: He,
2569
+ unit: s
2534
2570
  }),
2535
- [y, me, Pe, qe, c]
2536
- ), it = C(
2571
+ [S, de, Le, He, s]
2572
+ ), lt = E(
2537
2573
  () => ({
2538
- ...s,
2574
+ ...c,
2539
2575
  mode: "vernier",
2540
2576
  unit: t,
2541
2577
  macroUnit: l,
2542
- microUnit: c,
2578
+ microUnit: s,
2543
2579
  minDate: r,
2544
2580
  maxDate: n,
2545
- macroRange: $,
2546
- microValue: y,
2547
- onChangeMacroRange: _,
2548
- onChangeMicroPoint: me
2581
+ macroRange: P,
2582
+ microValue: S,
2583
+ onChangeMacroRange: H,
2584
+ onChangeMicroPoint: de
2549
2585
  }),
2550
- [s, t, l, c, r, n, $, y, _, me]
2586
+ [c, t, l, s, r, n, P, S, H, de]
2551
2587
  );
2552
2588
  return {
2553
- macroRange: $,
2589
+ macroRange: P,
2554
2590
  setMacroRange: x,
2555
- microValue: y,
2556
- setMicroValue: ae,
2557
- setMacroLowerDate: ge,
2558
- setMacroUpperDate: le,
2559
- setMicroDate: me,
2560
- shiftMacroRange: ze,
2561
- shiftMicroValue: Ee,
2562
- resetVernier: Te,
2563
- macroStartSelectorProps: Be,
2564
- macroEndSelectorProps: tt,
2565
- microSelectorProps: Ue,
2566
- sliderProps: it
2591
+ microValue: S,
2592
+ setMicroValue: ne,
2593
+ setMacroLowerDate: me,
2594
+ setMacroUpperDate: De,
2595
+ setMicroDate: de,
2596
+ shiftMacroRange: Ge,
2597
+ shiftMicroValue: Me,
2598
+ resetVernier: pe,
2599
+ macroStartSelectorProps: Fe,
2600
+ macroEndSelectorProps: rt,
2601
+ microSelectorProps: ht,
2602
+ sliderProps: lt
2567
2603
  };
2568
2604
  }
2569
- function Lo(e) {
2605
+ function Oa(e) {
2570
2606
  const t = new Date(e, 0, 1);
2571
2607
  return t.setFullYear(e), t;
2572
2608
  }
2573
- function mn(e, t) {
2609
+ function bn(e, t) {
2574
2610
  if (e !== void 0 && (!(e instanceof Date) || Number.isNaN(e.getTime())))
2575
2611
  throw new RangeError(`YearSelector: \`${t}\` must be a valid Date, received ${String(e)}.`);
2576
2612
  }
2577
- function So(e, t) {
2613
+ function Ha(e, t) {
2578
2614
  if (e !== void 0 && !Number.isInteger(e))
2579
2615
  throw new RangeError(`YearSelector: \`${t}\` must be an integer year, received ${String(e)}.`);
2580
2616
  }
2581
- function Vl(e) {
2617
+ function Xl(e) {
2582
2618
  if (e !== void 0)
2583
2619
  try {
2584
2620
  Intl.DateTimeFormat.supportedLocalesOf([e]);
@@ -2586,96 +2622,96 @@ function Vl(e) {
2586
2622
  throw new RangeError(`YearSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`);
2587
2623
  }
2588
2624
  }
2589
- function yo(e, t, r) {
2590
- const n = e === void 0 ? null : e, a = t === void 0 ? null : t.getFullYear();
2591
- return n !== null && a !== null ? r(n, a) : n !== null ? n : a;
2625
+ function Fa(e, t, r) {
2626
+ const n = e === void 0 ? null : e, o = t === void 0 ? null : t.getFullYear();
2627
+ return n !== null && o !== null ? r(n, o) : n !== null ? n : o;
2592
2628
  }
2593
- const Nl = (e) => {
2594
- const { value: t, initialDate: r, onChange: n, children: a, minYear: i, maxYear: l, minDate: c, maxDate: f, className: g = "", style: D, disabled: R = !1, prevYearAriaLabel: s = "Previous year", nextYearAriaLabel: S = "Next year", selectAriaLabel: Z = "Year", locale: ee } = e;
2595
- mn(t, "value"), mn(r, "initialDate"), mn(c, "minDate"), mn(f, "maxDate"), So(i, "minYear"), So(l, "maxYear"), Vl(ee);
2629
+ const Kl = (e) => {
2630
+ const { value: t, initialDate: r, onChange: n, children: o, minYear: i, maxYear: l, minDate: s, maxDate: g, className: h = "", style: D, disabled: R = !1, prevYearAriaLabel: c = "Previous year", nextYearAriaLabel: M = "Next year", selectAriaLabel: Z = "Year", locale: ee } = e;
2631
+ bn(t, "value"), bn(r, "initialDate"), bn(s, "minDate"), bn(g, "maxDate"), Ha(i, "minYear"), Ha(l, "maxYear"), Xl(ee);
2596
2632
  const x = t ?? r;
2597
2633
  if (x === void 0)
2598
2634
  throw new RangeError("YearSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected year is never inferred from the wall clock.");
2599
- const [ue, ae] = ye(() => x.getFullYear()), $ = c?.getTime(), H = f?.getTime(), W = C(() => yo(i, c, Math.max), [i, $]), oe = C(() => yo(l, f, Math.min), [l, H]);
2600
- if (W === null || oe === null)
2635
+ const [ue, ne] = Pe(() => x.getFullYear()), P = s?.getTime(), O = g?.getTime(), G = E(() => Fa(i, s, Math.max), [i, P]), ie = E(() => Fa(l, g, Math.min), [l, O]);
2636
+ if (G === null || ie === null)
2601
2637
  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.");
2602
- if (W > oe)
2603
- throw new RangeError(`YearSelector: the resolved lower bound ${W} is after the resolved upper bound ${oe}.`);
2604
- const q = t !== void 0, X = t !== void 0 ? t.getFullYear() : ue, y = X < W || X > oe, L = x.getTime();
2605
- Dt(() => {
2606
- q || ae(x.getFullYear());
2607
- }, [q, L]);
2608
- const T = (z) => z >= W && z <= oe, k = (z) => {
2638
+ if (G > ie)
2639
+ throw new RangeError(`YearSelector: the resolved lower bound ${G} is after the resolved upper bound ${ie}.`);
2640
+ const j = t !== void 0, X = t !== void 0 ? t.getFullYear() : ue, S = X < G || X > ie, L = x.getTime();
2641
+ it(() => {
2642
+ j || ne(x.getFullYear());
2643
+ }, [j, L]);
2644
+ const y = (B) => B >= G && B <= ie, k = (B) => {
2609
2645
  if (!R) {
2610
- if (!T(z))
2611
- throw new RangeError(`YearSelector: refusing to emit ${z}, which lies outside the declared bounds ${W}-${oe}.`);
2612
- q || ae(z), n?.(Lo(z), z);
2646
+ if (!y(B))
2647
+ throw new RangeError(`YearSelector: refusing to emit ${B}, which lies outside the declared bounds ${G}-${ie}.`);
2648
+ j || ne(B), n?.(Oa(B), B);
2613
2649
  }
2614
- }, V = T(X - 1) ? X - 1 : null, ne = T(X + 1) ? X + 1 : null, ce = () => {
2615
- V !== null && k(V);
2616
- }, G = () => {
2617
- ne !== null && k(ne);
2618
- }, J = C(() => {
2619
- const z = [];
2620
- for (let _ = oe; _ >= W; _--)
2621
- z.push(_);
2622
- return y && (z.push(X), z.sort((_, me) => me - _)), z;
2623
- }, [W, oe, y, X]);
2624
- return /* @__PURE__ */ Me("div", { className: `inline-flex items-center ${Fr} ${g}`, style: D, children: [
2625
- /* @__PURE__ */ I(Ut, { neighbour: "control", direction: "left", disabled: R, canStep: V !== null, onStep: ce, ariaLabel: s }),
2626
- /* @__PURE__ */ I(
2650
+ }, I = y(X - 1) ? X - 1 : null, re = y(X + 1) ? X + 1 : null, ce = () => {
2651
+ I !== null && k(I);
2652
+ }, K = () => {
2653
+ re !== null && k(re);
2654
+ }, J = E(() => {
2655
+ const B = [];
2656
+ for (let H = ie; H >= G; H--)
2657
+ B.push(H);
2658
+ return S && (B.push(X), B.sort((H, de) => de - H)), B;
2659
+ }, [G, ie, S, X]);
2660
+ return /* @__PURE__ */ we("div", { className: `inline-flex items-center ${Br} ${h}`, style: D, children: [
2661
+ /* @__PURE__ */ $(Xt, { neighbour: "control", direction: "left", disabled: R, canStep: I !== null, onStep: ce, ariaLabel: c }),
2662
+ /* @__PURE__ */ $(
2627
2663
  "select",
2628
2664
  {
2629
2665
  "aria-label": Z,
2630
2666
  disabled: R,
2631
2667
  className: "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",
2632
2668
  value: X,
2633
- onChange: (z) => {
2634
- if (!z.target.value) return;
2635
- const _ = Number(z.target.value);
2636
- Number.isInteger(_) && k(_);
2669
+ onChange: (B) => {
2670
+ if (!B.target.value) return;
2671
+ const H = Number(B.target.value);
2672
+ Number.isInteger(H) && k(H);
2637
2673
  },
2638
- children: J.map((z) => /* @__PURE__ */ I("option", { value: z, 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: Ke("year", Lo(z), void 0, ee) }, z))
2674
+ children: J.map((B) => /* @__PURE__ */ $("option", { value: B, 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: qe("year", Oa(B), void 0, ee) }, B))
2639
2675
  }
2640
2676
  ),
2641
- /* @__PURE__ */ I(Ut, { neighbour: "control", direction: "right", disabled: R, canStep: ne !== null, onStep: G, ariaLabel: S }),
2642
- a
2677
+ /* @__PURE__ */ $(Xt, { neighbour: "control", direction: "right", disabled: R, canStep: re !== null, onStep: K, ariaLabel: M }),
2678
+ o
2643
2679
  ] });
2644
- }, kl = zr(Nl, (e, t) => {
2645
- const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, a = r ? r.getFullYear() : null, i = n ? n.getFullYear() : null;
2646
- return !(a !== i || 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);
2680
+ }, jl = Ur(Kl, (e, t) => {
2681
+ const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, o = r ? r.getFullYear() : null, i = n ? n.getFullYear() : null;
2682
+ return !(o !== i || 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);
2647
2683
  });
2648
- kl.displayName = "YearSelector";
2684
+ jl.displayName = "YearSelector";
2649
2685
  export {
2650
- Wi as COLOR_SCHEME_PALETTES,
2651
- yl as DateSelector,
2652
- Cl as MonthSelector,
2653
- bl as PeriodSlider,
2654
- kl as YearSelector,
2686
+ ol as COLOR_SCHEME_PALETTES,
2687
+ Hl as DateSelector,
2688
+ Gl as MonthSelector,
2689
+ Al as PeriodSlider,
2690
+ jl as YearSelector,
2655
2691
  Oe as addUnit,
2656
- gl as areStylesEqual,
2657
- Zi as calculateConnectDragValues,
2658
- uo as calculateHandleDragValues,
2659
- Ji as calculateKeyboardActionValues,
2660
- Vo as calculateLabelSlant,
2661
- nl as calculateVernierMacroDrag,
2662
- al as calculateVernierMicroDrag,
2663
- ie as decode,
2692
+ Tl as areStylesEqual,
2693
+ ul as calculateConnectDragValues,
2694
+ La as calculateHandleDragValues,
2695
+ dl as calculateKeyboardActionValues,
2696
+ Ka as calculateLabelSlant,
2697
+ bl as calculateVernierMacroDrag,
2698
+ wl as calculateVernierMicroDrag,
2699
+ le as decode,
2664
2700
  Q as encode,
2665
- be as findNearestDateIndex,
2666
- Ke as formatLabel,
2667
- dr as formatScreenReaderLabel,
2668
- Gi as getMacroWindowEndDate,
2669
- Xi as getMacroWindowStartDate,
2670
- Vt as getSortedAllowedDates,
2671
- je as normalizeDateByUnit,
2672
- da as resolveDraggedEdge,
2701
+ ge as findNearestDateIndex,
2702
+ qe as formatLabel,
2703
+ gr as formatScreenReaderLabel,
2704
+ il as getMacroWindowEndDate,
2705
+ al as getMacroWindowStartDate,
2706
+ kt as getSortedAllowedDates,
2707
+ Ze as normalizeDateByUnit,
2708
+ wo as resolveDraggedEdge,
2673
2709
  xt as resolveMacroWindow,
2674
- ko as resolveVernierRailZone,
2675
- rl as resolveVernierTargetHandle,
2676
- tl as resolveWheelStep,
2677
- zl as usePeriodSliderPoint,
2678
- Fl as usePeriodSliderRange,
2679
- Ul as useVernierSliderPoint,
2680
- Bl as useVernierSliderRange
2710
+ qa as resolveVernierRailZone,
2711
+ hl as resolveVernierTargetHandle,
2712
+ gl as resolveWheelStep,
2713
+ ts as usePeriodSliderPoint,
2714
+ es as usePeriodSliderRange,
2715
+ ns as useVernierSliderPoint,
2716
+ rs as useVernierSliderRange
2681
2717
  };