@weekwise/react 0.1.0 → 0.1.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,45 +1,45 @@
1
1
  "use client";
2
2
  import { createContext as e, startTransition as t, useCallback as n, useContext as r, useEffect as i, useId as a, useInsertionEffect as o, useLayoutEffect as s, useMemo as c, useReducer as l, useRef as u, useState as d, useSyncExternalStore as f } from "react";
3
- import { MONTH_WEEK_GEOMETRY as p, ROW_HEIGHTS as m, Rect as h, THEME_PROPERTIES as g, add as _, adjustScrollRect as v, applyMoveTransformModifiers as y, arrangeEventsByDay as b, arrangeMonthWeek as x, boundingDraggableContainerModifier as S, boundingResizableContainerModifier as C, buildEventMap as w, buildTimeRows as T, builtInMessages as E, cx as D, defaultCoordinates as O, emptyArray as k, formatMonthYear as A, formatNowOffset as j, formatTimelineRange as M, fromDayMinutes as N, getCalendarSize as P, getClientRect as F, getEventTimeFrameFromInfo as I, getHiddenEvents as L, getMonthGrid as R, getMonthLaneCount as ee, getNavigationTarget as z, getNowOffset as B, getRevealScrollTop as te, getScrollCoordinates as ne, getScrollDirectionAndSpeed as re, getScrollOffsets as ie, getScrollableAncestors as ae, getScrollableElement as oe, getTimeFrame as se, getTimeStepEqualizerModifier as ce, getTimelineRange as le, getViewChangeTarget as ue, getViewHeading as de, getVisibleDays as fe, getWeekdayNames as pe, getWindow as me, isDevEnvironment as V, isHTMLElement as he, isInViewPeriod as ge, isNotNull as _e, isPastDay as ve, match as ye, mergeCallbacks as be, normalizeViewValue as xe, omit as Se, resizeEventDays as Ce, resizeEventRange as we, resolveMessages as Te, resolveMessages as Ee, round as De, shallowEqual as Oe, splitIntoDays as ke, subtract as Ae, toDayMinutes as je, transferDay as Me } from "@weekwise/core";
4
- import { createDragAndDropApi as Ne } from "@weekwise/dnd";
5
- import { DragAndDropContext as Pe, useDragAndDrop as Fe } from "@weekwise/dnd/react";
6
- import { autoUpdate as Ie, flip as Le, offset as Re, shift as ze, useFloating as Be } from "@floating-ui/react-dom";
7
- import { Fragment as Ve, jsx as H, jsxs as U } from "react/jsx-runtime";
8
- import { createPortal as He } from "react-dom";
3
+ import { MONTH_WEEK_GEOMETRY as p, ROW_HEIGHTS as m, Rect as h, THEME_PROPERTIES as g, add as _, adjustScrollRect as v, applyMoveTransformModifiers as y, arrangeEventsByDay as b, arrangeMonthWeek as x, boundingDraggableContainerModifier as S, boundingResizableContainerModifier as C, buildEventMap as w, buildTimeRows as T, builtInMessages as E, cx as D, defaultCoordinates as O, emptyArray as k, formatMonthYear as ee, formatNowOffset as A, formatTimelineRange as j, fromDayMinutes as M, getCalendarSize as N, getClientRect as P, getEventTimeFrameFromInfo as F, getHiddenEvents as I, getMonthGrid as L, getMonthLaneCount as R, getNavigationTarget as z, getNowOffset as B, getRevealScrollTop as te, getScrollCoordinates as V, getScrollDirectionAndSpeed as ne, getScrollOffsets as H, getScrollableAncestors as re, getScrollableElement as ie, getTimeFrame as ae, getTimeStepEqualizerModifier as oe, getTimelineRange as se, getViewChangeTarget as ce, getViewHeading as le, getVisibleDays as ue, getWeekdayNames as de, getWindow as fe, isDevEnvironment as U, isHTMLElement as pe, isInViewPeriod as me, isNotNull as he, isPastDay as ge, match as _e, mergeCallbacks as ve, normalizeViewValue as ye, omit as be, resizeEventDays as xe, resizeEventRange as Se, resolveMessages as Ce, resolveMessages as we, round as Te, shallowEqual as Ee, splitIntoDays as De, subtract as Oe, toDayMinutes as ke, transferDay as Ae } from "@weekwise/core";
4
+ import { createDragAndDropApi as je } from "@weekwise/dnd";
5
+ import { DragAndDropContext as Me, useDragAndDrop as Ne } from "@weekwise/dnd/react";
6
+ import { autoUpdate as Pe, flip as Fe, offset as Ie, shift as Le, useFloating as Re } from "@floating-ui/react-dom";
7
+ import { Fragment as ze, jsx as W, jsxs as G } from "react/jsx-runtime";
8
+ import { createPortal as Be } from "react-dom";
9
9
  // src/date-localization/DateLocalizationContext.ts
10
- var Ue = e(void 0);
11
- V && (Ue.displayName = "DateLocalizationContext");
10
+ var Ve = e(void 0);
11
+ U && (Ve.displayName = "DateLocalizationContext");
12
12
  // src/date-localization/useDateUtils.ts
13
- function We() {
14
- let e = r(Ue);
13
+ function He() {
14
+ let e = r(Ve);
15
15
  if (!e) throw Error("DateLocalizationContext is required");
16
16
  return e;
17
17
  }
18
- function W() {
19
- return We();
18
+ function K() {
19
+ return He();
20
20
  }
21
21
  // src/date-localization/MessagesContext.ts
22
- var Ge = e(void 0);
23
- V && (Ge.displayName = "MessagesContext");
22
+ var Ue = e(void 0);
23
+ U && (Ue.displayName = "MessagesContext");
24
24
  // src/date-localization/DateLocalizationProvider.tsx
25
- function Ke(e) {
26
- let { adapter: t, messages: n, children: r } = e, i = c(() => typeof t == "function" ? new t() : t, [t]), a = c(() => Ee(i.locale, n), [i.locale, n]);
27
- return /* @__PURE__ */ H(Ue.Provider, {
25
+ function We(e) {
26
+ let { adapter: t, messages: n, children: r } = e, i = c(() => typeof t == "function" ? new t() : t, [t]), a = c(() => we(i.locale, n), [i.locale, n]);
27
+ return /* @__PURE__ */ W(Ve.Provider, {
28
28
  value: i,
29
- children: /* @__PURE__ */ H(Ge.Provider, {
29
+ children: /* @__PURE__ */ W(Ue.Provider, {
30
30
  value: a,
31
31
  children: r
32
32
  })
33
33
  });
34
34
  }
35
35
  // src/date-localization/useMessages.ts
36
- function qe() {
37
- let e = r(Ge), t = We();
38
- return e ?? Ee(t.locale);
36
+ function Ge() {
37
+ let e = r(Ue), t = He();
38
+ return e ?? we(t.locale);
39
39
  }
40
- var G = typeof window < "u" ? s : i;
40
+ var Ke = typeof window < "u" ? s : i;
41
41
  // src/hooks/useResizeObserver.ts
42
- function Je(e, t = !1) {
42
+ function qe(e, t = !1) {
43
43
  let n = u(e);
44
44
  n.current = e;
45
45
  let r = c(() => {
@@ -50,36 +50,36 @@ function Je(e, t = !1) {
50
50
  return i(() => () => r?.disconnect(), [r]), r;
51
51
  }
52
52
  // src/hooks/useCalendarSize.ts
53
- function Ye(e) {
54
- let [t, n] = d("regular"), r = Je(([e]) => {
53
+ function Je(e) {
54
+ let [t, n] = d("regular"), r = qe(([e]) => {
55
55
  if (!e) return;
56
56
  let t = e.borderBoxSize?.[0]?.inlineSize ?? e.contentRect.width;
57
- n(P(t));
57
+ n(N(t));
58
58
  });
59
- return G(() => {
59
+ return Ke(() => {
60
60
  let t = e.current;
61
- if (t) return n(P(t.getBoundingClientRect().width)), r?.observe(t), () => r?.unobserve(t);
61
+ if (t) return n(N(t.getBoundingClientRect().width)), r?.observe(t), () => r?.unobserve(t);
62
62
  }, [r, e]), t;
63
63
  }
64
64
  // src/hooks/useCurrentRef.ts
65
- function Xe(e) {
65
+ function Ye(e) {
66
66
  let t = u(e);
67
67
  return t.current = e, t;
68
68
  }
69
69
  // src/hooks/useComputed.ts
70
- function Ze(e, t) {
71
- let n = u(void 0), r = Xe(e);
70
+ function Xe(e, t) {
71
+ let n = u(void 0), r = Ye(e);
72
72
  return c(() => {
73
73
  let e = r.current(n.current);
74
74
  return n.current = e, e;
75
75
  }, t);
76
76
  }
77
77
  // src/hooks/useControlled.utils.ts
78
- function Qe(e) {
78
+ function Ze(e) {
79
79
  let [t] = d(() => e !== void 0);
80
80
  return t;
81
81
  }
82
- function $e(e, t, n, r) {
82
+ function Qe(e, t, n, r) {
83
83
  let a = u(/* @__PURE__ */ Error());
84
84
  i(() => {
85
85
  if (e !== (t !== void 0)) throw Error(`
@@ -103,9 +103,9 @@ function $e(e, t, n, r) {
103
103
  ]);
104
104
  }
105
105
  // src/hooks/useControlled.ts
106
- function et(e) {
107
- let { controlled: t, default: r } = e, [i, a] = d(() => r === void 0 && "initialState" in e && e.initialState !== void 0 ? e.initialState : r), [o] = d(r), s = Qe(t);
108
- V && $e(s, t, o, r);
106
+ function $e(e) {
107
+ let { controlled: t, default: r } = e, [i, a] = d(() => r === void 0 && "initialState" in e && e.initialState !== void 0 ? e.initialState : r), [o] = d(r), s = Ze(t);
108
+ U && Qe(s, t, o, r);
109
109
  let c = n((e) => {
110
110
  s || a(e);
111
111
  }, [s]);
@@ -116,19 +116,19 @@ function et(e) {
116
116
  ];
117
117
  }
118
118
  // src/hooks/useRefWithInit.ts
119
- var tt = {};
120
- function nt(e, t) {
121
- let n = u(tt);
122
- return n.current === tt && (n.current = e(t)), n;
119
+ var et = {};
120
+ function tt(e, t) {
121
+ let n = u(et);
122
+ return n.current === et && (n.current = e(t)), n;
123
123
  }
124
124
  // src/hooks/useEventCallback.utils.ts
125
- function rt() {
126
- if (V) throw Error("useEventCallback: Cannot call an event handler while rendering.");
125
+ function nt() {
126
+ if (U) throw Error("useEventCallback: Cannot call an event handler while rendering.");
127
127
  }
128
- function it() {
128
+ function rt() {
129
129
  let e = {
130
130
  next: void 0,
131
- callback: rt,
131
+ callback: nt,
132
132
  trampoline: (...t) => e.callback?.(...t),
133
133
  effect: () => {
134
134
  e.callback = e.next;
@@ -137,12 +137,12 @@ function it() {
137
137
  return e;
138
138
  }
139
139
  // src/hooks/useEventCallback.ts
140
- function K(e) {
141
- let t = nt(it).current;
140
+ function q(e) {
141
+ let t = tt(rt).current;
142
142
  return t.next = e, o(t.effect), t.trampoline;
143
143
  }
144
144
  // src/hooks/useGlobalListeners.ts
145
- function at() {
145
+ function it() {
146
146
  let [e] = d(() => ({ current: /* @__PURE__ */ new Map() })), { addGlobalListener: t, removeGlobalListener: n, removeAllGlobalListeners: r } = c(() => {
147
147
  function t(t, n, r, i) {
148
148
  let a = typeof i != "boolean" && i?.once ? (n) => {
@@ -177,22 +177,22 @@ function at() {
177
177
  };
178
178
  }
179
179
  // src/utils/mergeRefs.ts
180
- var ot = (e) => !e || typeof e == "function" ? e : (t) => {
180
+ var at = (e) => !e || typeof e == "function" ? e : (t) => {
181
181
  e.current = t;
182
182
  };
183
- function st(...e) {
183
+ function ot(...e) {
184
184
  return (t) => {
185
185
  e.forEach((e) => {
186
- ot(e)?.(t);
186
+ at(e)?.(t);
187
187
  });
188
188
  };
189
189
  }
190
190
  // src/hooks/useMergedRefs.ts
191
- function ct(...e) {
192
- return c(() => st(...e), e);
191
+ function st(...e) {
192
+ return c(() => ot(...e), e);
193
193
  }
194
194
  // src/hooks/useMove.ts
195
- function lt(e) {
195
+ function ct(e) {
196
196
  let [{ state: t }] = d(() => ({ state: {
197
197
  activePointId: null,
198
198
  clientX: 0,
@@ -202,7 +202,7 @@ function lt(e) {
202
202
  isDistanceReached: !1
203
203
  } })), n = u(e);
204
204
  n.current = e;
205
- let { addGlobalListener: r, removeGlobalListener: i } = at();
205
+ let { addGlobalListener: r, removeGlobalListener: i } = it();
206
206
  return { listeners: c(() => {
207
207
  let e = {}, a = (e) => {
208
208
  "stopPropagation" in e && "preventDefault" in e && (e.stopPropagation(), e.preventDefault());
@@ -324,14 +324,14 @@ function lt(e) {
324
324
  ]) };
325
325
  }
326
326
  // src/hooks/usePrevious.ts
327
- function ut(e) {
327
+ function lt(e) {
328
328
  let t = u(void 0);
329
329
  return i(() => {
330
330
  t.current = e;
331
331
  }, [e]), t.current;
332
332
  }
333
333
  // src/hooks/useScrollBarSize.ts
334
- function dt() {
334
+ function ut() {
335
335
  let e = null, n = 0, r = (t) => (n += 1, e === null && (e = document.createElement("div"), e.style.width = "99px", e.style.height = "99px", e.style.overflow = "scroll", e.style.position = "absolute", e.style.top = "-9999px", e.setAttribute("aria-hidden", "true"), e.setAttribute("role", "presentation"), document.body.appendChild(e), window.addEventListener("resize", t)), {
336
336
  element: e,
337
337
  cleanup: () => {
@@ -343,7 +343,7 @@ function dt() {
343
343
  height: 0,
344
344
  width: 0
345
345
  });
346
- return G(() => {
346
+ return Ke(() => {
347
347
  let e = () => {
348
348
  let e = i.offsetHeight - i.clientHeight, r = i.offsetWidth - i.clientWidth;
349
349
  t(() => {
@@ -360,9 +360,9 @@ function dt() {
360
360
  }, []), e;
361
361
  };
362
362
  }
363
- var ft = dt();
363
+ var dt = ut();
364
364
  // src/hooks/useStateRef.ts
365
- function pt(e) {
365
+ function ft(e) {
366
366
  let [t, r] = d(e), i = u(e);
367
367
  return [
368
368
  t,
@@ -373,8 +373,8 @@ function pt(e) {
373
373
  ];
374
374
  }
375
375
  // src/hooks/useTimeInterval.ts
376
- function mt(e, t, n = !0) {
377
- let r = u(null), a = Xe(e);
376
+ function pt(e, t, n = !0) {
377
+ let r = u(null), a = Ye(e);
378
378
  i(() => {
379
379
  if (n) {
380
380
  let e = /* @__PURE__ */ new Date(), n = t - (e.getMinutes() * 60 + e.getSeconds()) * 1e3 % t;
@@ -392,49 +392,55 @@ function mt(e, t, n = !0) {
392
392
  ]);
393
393
  }
394
394
  // src/hooks/useToday.ts
395
+ var mt = (e) => e.toMillis(e.getToday());
395
396
  function ht() {
396
- let { getToday: e, addDays: t, toMillis: n, fromMillis: r } = W(), [a, o] = d(() => n(e()));
397
+ let e = K(), [t, n] = d(() => ({
398
+ dateUtils: e,
399
+ today: mt(e)
400
+ })), r = t;
401
+ t.dateUtils !== e && (r = {
402
+ dateUtils: e,
403
+ today: mt(e)
404
+ }, n(r));
405
+ let { today: a } = r;
397
406
  return i(() => {
398
- let i = n(t(r(a), 1)), s = Math.max(i - Date.now(), 0) + 1e3, c = setTimeout(() => o(n(e())), s);
399
- return () => clearTimeout(c);
400
- }, [
401
- t,
402
- r,
403
- e,
404
- n,
405
- a
406
- ]), a;
407
+ let t = e.toMillis(e.addDays(e.fromMillis(a), 1)), r = Math.max(t - Date.now(), 0) + 1e3, i = setTimeout(() => n({
408
+ dateUtils: e,
409
+ today: mt(e)
410
+ }), r);
411
+ return () => clearTimeout(i);
412
+ }, [e, a]), a;
407
413
  }
408
414
  // src/contexts/CalendarContext.ts
409
415
  var gt = e(void 0);
410
- V && (gt.displayName = "CalendarContext");
411
- function q() {
416
+ U && (gt.displayName = "CalendarContext");
417
+ function J() {
412
418
  let e = r(gt);
413
419
  if (!e) throw Error("CalendarContext is required");
414
420
  return e;
415
421
  }
416
422
  // src/contexts/ThemeSourceContext.ts
417
423
  var _t = e(null);
418
- V && (_t.displayName = "ThemeSourceContext");
424
+ U && (_t.displayName = "ThemeSourceContext");
419
425
  // src/hooks/useCalendarValue.ts
420
426
  function vt(e) {
421
- let { view: t, defaultView: r, startWeek: a, viewValue: o, defaultViewValue: s, dateUtils: c, onChangeView: l, onChangeViewValue: d } = e, [f, p] = et({
427
+ let { view: t, defaultView: r, startWeek: a, viewValue: o, defaultViewValue: s, dateUtils: c, onChangeView: l, onChangeViewValue: d } = e, [f, p] = $e({
422
428
  controlled: t,
423
429
  default: r,
424
430
  initialState: "week"
425
- }), m = n((e, t) => xe(c, e, t, a), [c, a]), [h, g] = et({
431
+ }), m = n((e, t) => ye(c, e, t, a), [c, a]), [h, g] = $e({
426
432
  controlled: o,
427
433
  default: s,
428
434
  initialState: m(f)
429
- }), _ = K((e, t) => {
435
+ }), _ = q((e, t) => {
430
436
  g(e), d?.(e, t);
431
- }), v = K(be((e) => {
437
+ }), v = q(ve((e) => {
432
438
  p(e);
433
- }, l)), y = Xe(h), b = u(f), x = u(a), S = u(c);
439
+ }, l)), y = Ye(h), b = u(f), x = u(a), S = u(c);
434
440
  return i(() => {
435
- let e = b.current, t = x.current !== a, n = S.current, r = n === c ? y.current : Me(n, c, y.current);
441
+ let e = b.current, t = x.current !== a, n = S.current, r = n === c ? y.current : Ae(n, c, y.current);
436
442
  b.current = f, x.current = a, S.current = c;
437
- let i = e === f && !t ? m(f, r) : ue(c, e, f, r, a);
443
+ let i = e === f && !t ? m(f, r) : ce(c, e, f, r, a);
438
444
  _(i, f);
439
445
  }, [
440
446
  m,
@@ -454,21 +460,21 @@ function vt(e) {
454
460
  function yt(e) {
455
461
  let { dateUtils: t, view: n, viewValue: r, changeViewValue: i, startWeek: a } = e, o = (e, r) => () => i(z(t, n, e, r, a), n);
456
462
  return {
457
- goForward: K(o(r, 1)),
458
- goBackward: K(o(r, -1)),
459
- goToday: K(o(t.getToday(), 0))
463
+ goForward: q(o(r, 1)),
464
+ goBackward: q(o(r, -1)),
465
+ goToday: q(o(t.getToday(), 0))
460
466
  };
461
467
  }
462
468
  // src/icons/chevron.tsx
463
469
  function bt(e) {
464
- return /* @__PURE__ */ H("svg", {
470
+ return /* @__PURE__ */ W("svg", {
465
471
  xmlns: "http://www.w3.org/2000/svg",
466
472
  fill: "none",
467
473
  height: "12",
468
474
  viewBox: "0 0 13 12",
469
475
  width: "13",
470
476
  ...e,
471
- children: /* @__PURE__ */ H("path", {
477
+ children: /* @__PURE__ */ W("path", {
472
478
  d: "M1.77498 2.29504L6.35498 6.87504L10.945 2.29504L12.355 3.70504L6.35498 9.70504L0.35498 3.70504L1.77498 2.29504Z",
473
479
  fill: "currentColor"
474
480
  })
@@ -491,12 +497,12 @@ function Tt(e) {
491
497
  }
492
498
  function Et({ children: e, container: t }) {
493
499
  let n = wt(), i = r(_t);
494
- return n ? t ? He(e, t) : He(/* @__PURE__ */ H("div", {
500
+ return n ? t ? Be(e, t) : Be(/* @__PURE__ */ W("div", {
495
501
  style: Tt(i?.current),
496
502
  children: e
497
503
  }), document.body) : null;
498
504
  }
499
- var J = {
505
+ var Y = {
500
506
  root: "_root_1aojr_1",
501
507
  root__toggle: "_root__toggle_1aojr_6",
502
508
  root__toggleLabel: "_root__toggleLabel_1aojr_30",
@@ -518,14 +524,14 @@ var J = {
518
524
  };
519
525
  // src/components/date-navigator/DateNavigator.tsx
520
526
  function Dt({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, className: a, ...o }) {
521
- let { view: s, viewValue: l, changeViewValue: f, startWeek: p } = q(), m = W(), h = qe(), { getStartOfWeek: g, getStartOfMonth: _, addMonths: v } = m, [y, b] = d(!1), [x, S] = d(() => _(l)), C = u(null), { refs: w, floatingStyles: T } = Be({
527
+ let { view: s, viewValue: l, changeViewValue: f, startWeek: p } = J(), m = K(), h = Ge(), { getStartOfWeek: g, getStartOfMonth: _, addMonths: v } = m, [y, b] = d(!1), [x, S] = d(() => _(l)), C = u(null), { refs: w, floatingStyles: T } = Re({
522
528
  placement: "bottom",
523
529
  middleware: [
524
- Re(6),
525
- Le({ padding: 8 }),
526
- ze({ padding: 8 })
530
+ Ie(6),
531
+ Fe({ padding: 8 }),
532
+ Le({ padding: 8 })
527
533
  ],
528
- whileElementsMounted: Ie
534
+ whileElementsMounted: Pe
529
535
  });
530
536
  i(() => {
531
537
  y && S(_(l));
@@ -541,82 +547,82 @@ function Dt({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, cl
541
547
  };
542
548
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
543
549
  }, [y, w.floating]);
544
- let E = c(() => e ? e(l, s) : de(m, s, l, p), [
550
+ let E = c(() => e ? e(l, s) : le(m, s, l, p), [
545
551
  m,
546
552
  e,
547
553
  p,
548
554
  s,
549
555
  l
550
- ]), O = c(() => R(m, x, p), [
556
+ ]), O = c(() => L(m, x, p), [
551
557
  m,
552
558
  x,
553
559
  p
554
560
  ]), k = (e) => {
555
561
  n?.(e), b((e) => !e);
556
- }, j = (e) => {
562
+ }, A = (e) => {
557
563
  r?.(e), e.key === "Escape" && b(!1);
558
- }, M = (e) => {
564
+ }, j = (e) => {
559
565
  f(s === "week" ? g(e, p) : e, s), b(!1);
560
566
  };
561
- return /* @__PURE__ */ U("div", {
567
+ return /* @__PURE__ */ G("div", {
562
568
  ref: C,
563
- className: J.root,
564
- children: [/* @__PURE__ */ U("button", {
569
+ className: Y.root,
570
+ children: [/* @__PURE__ */ G("button", {
565
571
  type: t,
566
572
  "aria-label": h.chooseDate,
567
573
  "aria-expanded": y,
568
574
  "aria-haspopup": "dialog",
569
575
  ...o,
570
576
  onClick: k,
571
- onKeyDown: j,
577
+ onKeyDown: A,
572
578
  ref: w.setReference,
573
- className: D(a, J.root__toggle),
574
- children: [/* @__PURE__ */ H("span", {
575
- className: J.root__toggleLabel,
579
+ className: D(a, Y.root__toggle),
580
+ children: [/* @__PURE__ */ W("span", {
581
+ className: Y.root__toggleLabel,
576
582
  children: E
577
- }), /* @__PURE__ */ H(bt, { className: D(J.root__toggleIcon, { [J.root__toggleIcon_open]: y }) })]
578
- }), y && /* @__PURE__ */ H(Et, { children: /* @__PURE__ */ U("div", {
583
+ }), /* @__PURE__ */ W(bt, { className: D(Y.root__toggleIcon, { [Y.root__toggleIcon_open]: y }) })]
584
+ }), y && /* @__PURE__ */ W(Et, { children: /* @__PURE__ */ G("div", {
579
585
  ref: w.setFloating,
580
586
  style: T,
581
587
  role: "dialog",
582
588
  "aria-label": h.chooseDate,
583
- className: J.popover,
584
- children: [/* @__PURE__ */ U("div", {
585
- className: J.popover__header,
589
+ className: Y.popover,
590
+ children: [/* @__PURE__ */ G("div", {
591
+ className: Y.popover__header,
586
592
  children: [
587
- /* @__PURE__ */ H("button", {
593
+ /* @__PURE__ */ W("button", {
588
594
  type: "button",
589
595
  "aria-label": h.previousMonth,
590
596
  onClick: () => S((e) => v(e, -1)),
591
- children: /* @__PURE__ */ H(bt, { className: J.popover__navBackward })
597
+ children: /* @__PURE__ */ W(bt, { className: Y.popover__navBackward })
592
598
  }),
593
- /* @__PURE__ */ H("div", {
594
- className: J.popover__title,
595
- children: A(m, x)
599
+ /* @__PURE__ */ W("div", {
600
+ className: Y.popover__title,
601
+ children: ee(m, x)
596
602
  }),
597
- /* @__PURE__ */ H("button", {
603
+ /* @__PURE__ */ W("button", {
598
604
  type: "button",
599
605
  "aria-label": h.nextMonth,
600
606
  onClick: () => S((e) => v(e, 1)),
601
- children: /* @__PURE__ */ H(bt, { className: J.popover__navForward })
607
+ children: /* @__PURE__ */ W(bt, { className: Y.popover__navForward })
602
608
  })
603
609
  ]
604
- }), /* @__PURE__ */ U("div", {
605
- className: J.popover__grid,
606
- children: [O.slice(0, 7).map((e) => /* @__PURE__ */ H("div", {
607
- className: J.popover__weekday,
610
+ }), /* @__PURE__ */ G("div", {
611
+ className: Y.popover__grid,
612
+ children: [O.slice(0, 7).map((e) => /* @__PURE__ */ W("div", {
613
+ className: Y.popover__weekday,
608
614
  children: m.weekDayShortName(m.getWeekDay(e))
609
615
  }, m.getWeekDay(e))), O.map((e, t) => {
610
- let n = m.getMonths(e) !== m.getMonths(x), r = m.isToday(e), i = s !== "month" && ge(m, s, l, e), a = i && (s === "day" || t % 7 == 0), o = i && (s === "day" || t % 7 == 6);
611
- return /* @__PURE__ */ H("button", {
616
+ let n = m.getMonths(e) !== m.getMonths(x), r = m.isToday(e), i = s !== "month" && me(m, s, l, e), a = i && (s === "day" || t % 7 == 0), o = i && (s === "day" || t % 7 == 6);
617
+ return /* @__PURE__ */ W("button", {
612
618
  type: "button",
613
- onClick: () => M(e),
614
- className: D(J.popover__day, {
615
- [J.popover__day_outside]: n,
616
- [J.popover__day_today]: r,
617
- [J.popover__day_selected]: i,
618
- [J.popover__day_rangeStart]: a,
619
- [J.popover__day_rangeEnd]: o
619
+ onClick: () => j(e),
620
+ className: D(Y.popover__day, {
621
+ [Y.popover__day_outside]: n,
622
+ [Y.popover__day_today]: r,
623
+ [Y.popover__day_selected]: i,
624
+ [Y.popover__day_rangeStart]: a,
625
+ [Y.popover__day_rangeEnd]: o
620
626
  }),
621
627
  children: m.getMonthDay(e)
622
628
  }, m.toMillis(e));
@@ -633,16 +639,16 @@ var Ot = {
633
639
  };
634
640
  // src/components/nav-btn/NavBtn.tsx
635
641
  function kt({ direction: e = "forward", type: t = "button", onClick: n, className: r, children: i, ...a }) {
636
- let { goForward: o, goBackward: s } = q(), c = qe(), l = K(be(n, () => {
642
+ let { goForward: o, goBackward: s } = J(), c = Ge(), l = q(ve(n, () => {
637
643
  e === "forward" ? o() : e === "backward" && s();
638
644
  }));
639
- return /* @__PURE__ */ H("button", {
645
+ return /* @__PURE__ */ W("button", {
640
646
  type: t,
641
647
  "aria-label": e === "forward" ? c.next : c.previous,
642
648
  ...a,
643
649
  onClick: l,
644
650
  className: D(r, Ot.root),
645
- children: i ?? /* @__PURE__ */ H(bt, { className: D(Ot.root__icon, {
651
+ children: i ?? /* @__PURE__ */ W(bt, { className: D(Ot.root__icon, {
646
652
  [Ot.root__icon_backward]: e === "backward",
647
653
  [Ot.root__icon_forward]: e === "forward"
648
654
  }) })
@@ -662,14 +668,14 @@ var At = {
662
668
  "month"
663
669
  ];
664
670
  function Mt({ className: e }) {
665
- let { view: t, changeView: n } = q(), r = qe(), { addGlobalListener: o, removeGlobalListener: s } = at(), c = a(), [l, f] = d(!1), [p, m] = d(t), h = u(/* @__PURE__ */ new Map()), { refs: g, floatingStyles: _ } = Be({
671
+ let { view: t, changeView: n } = J(), r = Ge(), { addGlobalListener: o, removeGlobalListener: s } = it(), c = a(), [l, f] = d(!1), [p, m] = d(t), h = u(/* @__PURE__ */ new Map()), { refs: g, floatingStyles: _ } = Re({
666
672
  placement: "bottom-end",
667
673
  middleware: [
668
- Re(6),
669
- Le({ padding: 8 }),
670
- ze({ padding: 8 })
674
+ Ie(6),
675
+ Fe({ padding: 8 }),
676
+ Le({ padding: 8 })
671
677
  ],
672
- whileElementsMounted: Ie
678
+ whileElementsMounted: Pe
673
679
  }), v = (e) => {
674
680
  f(!1);
675
681
  let t = g.reference.current;
@@ -712,7 +718,7 @@ function Mt({ className: e }) {
712
718
  case "Tab": return v(!1);
713
719
  }
714
720
  }, C = `${c}-list`;
715
- return /* @__PURE__ */ U(Ve, { children: [/* @__PURE__ */ U("button", {
721
+ return /* @__PURE__ */ G(ze, { children: [/* @__PURE__ */ G("button", {
716
722
  ref: g.setReference,
717
723
  type: "button",
718
724
  "aria-haspopup": "listbox",
@@ -722,11 +728,11 @@ function Mt({ className: e }) {
722
728
  className: D(e, At.root),
723
729
  onClick: () => l ? v(!1) : y(),
724
730
  onKeyDown: x,
725
- children: [r[t], /* @__PURE__ */ H(bt, {
731
+ children: [r[t], /* @__PURE__ */ W(bt, {
726
732
  "aria-hidden": "true",
727
733
  className: D(At.root__icon, { [At.root__icon_open]: l })
728
734
  })]
729
- }), l && /* @__PURE__ */ H(Et, { children: /* @__PURE__ */ H("div", {
735
+ }), l && /* @__PURE__ */ W(Et, { children: /* @__PURE__ */ W("div", {
730
736
  ref: g.setFloating,
731
737
  id: C,
732
738
  role: "listbox",
@@ -734,7 +740,7 @@ function Mt({ className: e }) {
734
740
  style: _,
735
741
  className: At.list,
736
742
  onKeyDown: S,
737
- children: jt.map((e) => /* @__PURE__ */ U("div", {
743
+ children: jt.map((e) => /* @__PURE__ */ G("div", {
738
744
  ref: (t) => {
739
745
  t ? h.current.set(e, t) : h.current.delete(e);
740
746
  },
@@ -745,13 +751,13 @@ function Mt({ className: e }) {
745
751
  className: D(At.list__option, { [At.list__option_active]: e === p }),
746
752
  onClick: () => b(e),
747
753
  onPointerMove: () => m(e),
748
- children: [r[e], e === t && /* @__PURE__ */ H("svg", {
754
+ children: [r[e], e === t && /* @__PURE__ */ W("svg", {
749
755
  "aria-hidden": "true",
750
756
  className: At.list__check,
751
757
  viewBox: "0 0 16 16",
752
758
  width: "14",
753
759
  height: "14",
754
- children: /* @__PURE__ */ H("path", {
760
+ children: /* @__PURE__ */ W("path", {
755
761
  d: "M3 8.5 6.5 12 13 4.5",
756
762
  fill: "none",
757
763
  stroke: "currentColor",
@@ -763,7 +769,7 @@ function Mt({ className: e }) {
763
769
  }, e))
764
770
  }) })] });
765
771
  }
766
- var Y = {
772
+ var X = {
767
773
  root: "_root_1lvdm_1",
768
774
  root__navigationPane: "_root__navigationPane_1lvdm_12",
769
775
  root__viewList: "_root__viewList_1lvdm_13",
@@ -775,66 +781,66 @@ var Y = {
775
781
  };
776
782
  // src/components/calendar-toolbar/CalendarToolbar.tsx
777
783
  function Nt(e) {
778
- let { goToday: t, changeView: n, view: r } = q(), i = qe(), a = e, o = {
784
+ let { goToday: t, changeView: n, view: r } = J(), i = Ge(), a = e, o = {
779
785
  day: {
780
786
  type: "button",
781
787
  "aria-selected": r === "day",
782
- onClick: be(void 0, () => n("day")),
783
- className: D(Y.root__viewTab, { [Y.root__viewTab_isActive]: r === "day" }),
788
+ onClick: ve(void 0, () => n("day")),
789
+ className: D(X.root__viewTab, { [X.root__viewTab_isActive]: r === "day" }),
784
790
  children: i.day
785
791
  },
786
792
  week: {
787
793
  type: "button",
788
794
  "aria-selected": r === "week",
789
- onClick: be(void 0, () => n("week")),
790
- className: D(Y.root__viewTab, { [Y.root__viewTab_isActive]: r === "week" }),
795
+ onClick: ve(void 0, () => n("week")),
796
+ className: D(X.root__viewTab, { [X.root__viewTab_isActive]: r === "week" }),
791
797
  children: i.week
792
798
  },
793
799
  month: {
794
800
  type: "button",
795
801
  "aria-selected": r === "month",
796
- onClick: be(void 0, () => n("month")),
797
- className: D(Y.root__viewTab, { [Y.root__viewTab_isActive]: r === "month" }),
802
+ onClick: ve(void 0, () => n("month")),
803
+ className: D(X.root__viewTab, { [X.root__viewTab_isActive]: r === "month" }),
798
804
  children: i.month
799
805
  }
800
806
  }, s = {
801
807
  type: "button",
802
- onClick: K(t),
803
- className: Y.root__today,
808
+ onClick: q(t),
809
+ className: X.root__today,
804
810
  children: i.today
805
811
  };
806
- return /* @__PURE__ */ U("div", {
812
+ return /* @__PURE__ */ G("div", {
807
813
  ...a,
808
- className: D(a.className, Y.root),
814
+ className: D(a.className, X.root),
809
815
  children: [
810
- /* @__PURE__ */ H(Dt, {}),
811
- /* @__PURE__ */ U("div", {
812
- className: Y.root__navigationPane,
816
+ /* @__PURE__ */ W(Dt, {}),
817
+ /* @__PURE__ */ G("div", {
818
+ className: X.root__navigationPane,
813
819
  role: "group",
814
820
  children: [
815
- /* @__PURE__ */ H(kt, { direction: "backward" }),
816
- /* @__PURE__ */ H("button", { ...s }),
817
- /* @__PURE__ */ H(kt, { direction: "forward" })
821
+ /* @__PURE__ */ W(kt, { direction: "backward" }),
822
+ /* @__PURE__ */ W("button", { ...s }),
823
+ /* @__PURE__ */ W(kt, { direction: "forward" })
818
824
  ]
819
825
  }),
820
- /* @__PURE__ */ U("div", {
821
- className: Y.root__viewList,
826
+ /* @__PURE__ */ G("div", {
827
+ className: X.root__viewList,
822
828
  children: [
823
- /* @__PURE__ */ H("button", { ...o.day }),
824
- /* @__PURE__ */ H("button", { ...o.week }),
825
- /* @__PURE__ */ H("button", { ...o.month })
829
+ /* @__PURE__ */ W("button", { ...o.day }),
830
+ /* @__PURE__ */ W("button", { ...o.week }),
831
+ /* @__PURE__ */ W("button", { ...o.month })
826
832
  ]
827
833
  }),
828
- /* @__PURE__ */ H("div", {
829
- className: Y.root__viewSelect,
830
- children: /* @__PURE__ */ H(Mt, {})
834
+ /* @__PURE__ */ W("div", {
835
+ className: X.root__viewSelect,
836
+ children: /* @__PURE__ */ W(Mt, {})
831
837
  })
832
838
  ]
833
839
  });
834
840
  }
835
841
  // src/contexts/CalendarViewportContext.ts
836
842
  var Pt = e(void 0);
837
- V && (Pt.displayName = "CalendarViewportContext");
843
+ U && (Pt.displayName = "CalendarViewportContext");
838
844
  function Ft() {
839
845
  let e = r(Pt);
840
846
  if (!e) throw Error("CalendarViewportContext is required");
@@ -843,7 +849,7 @@ function Ft() {
843
849
  var It = { root: "_root_i43d6_1" };
844
850
  // src/components/pointer-popover/PointerPopover.tsx
845
851
  function Lt({ coordinates: e, className: t, style: n, ...r }) {
846
- return /* @__PURE__ */ H("span", {
852
+ return /* @__PURE__ */ W("span", {
847
853
  tabIndex: -1,
848
854
  ...r,
849
855
  className: D(t, It.root),
@@ -866,8 +872,8 @@ var Rt = {
866
872
  isStart: !0,
867
873
  isEnd: !0
868
874
  };
869
- function Bt({ showPreview: e = !0, ...t }) {
870
- let { eventMap: n, eventRenderer: r, pointerPreviewRenderer: i, view: a } = q(), { viewportRef: o } = Ft(), { isDragging: s, canDrop: l, dropData: f, eventItem: p, source: m, x: h, y: g, ..._ } = Fe(({ draggable: e, overlay: t, droppable: n, canDrop: r }) => {
875
+ function Bt({ showPreview: e = !0, pxPerMinute: t = 1, ...n }) {
876
+ let { eventMap: r, eventRenderer: i, pointerPreviewRenderer: a, view: o } = J(), { viewportRef: s } = Ft(), { isDragging: l, canDrop: f, dropData: p, eventItem: m, source: h, x: g, y: _, ...v } = Ne(({ draggable: e, overlay: t, droppable: n, canDrop: r }) => {
871
877
  let i = [...n.dropTargets.values()].shift(), a = [...e.dragTargets.values()].shift();
872
878
  return {
873
879
  ...t.transform,
@@ -879,20 +885,20 @@ function Bt({ showPreview: e = !0, ...t }) {
879
885
  x: e.x,
880
886
  y: e.y
881
887
  };
882
- }), v = c(() => {
883
- if (!p) return null;
884
- let { key: e } = JSON.parse(p.event);
885
- return n.get(e)?.value ?? null;
886
- }, [p, n]), y = u(null), [b, x] = d(null);
887
- if (G(() => {
888
- if (!s || f) {
889
- y.current = s ? _ : null, x(null);
888
+ }), y = c(() => {
889
+ if (!m) return null;
890
+ let { key: e } = JSON.parse(m.event);
891
+ return r.get(e)?.value ?? null;
892
+ }, [m, r]), b = u(null), [x, S] = d(null);
893
+ if (Ke(() => {
894
+ if (!l || p) {
895
+ b.current = l ? v : null, S(null);
890
896
  return;
891
897
  }
892
- let e = y.current, t = o.current;
893
- if (b || !e || !m || !t) return;
894
- let n = m.getBoundingClientRect(), r = t.getBoundingClientRect();
895
- x({
898
+ let e = b.current, t = s.current;
899
+ if (x || !e || !h || !t) return;
900
+ let n = h.getBoundingClientRect(), r = t.getBoundingClientRect();
901
+ S({
896
902
  container: t,
897
903
  style: {
898
904
  left: n.left - r.left,
@@ -905,33 +911,33 @@ function Bt({ showPreview: e = !0, ...t }) {
905
911
  "--ww-return-height": `${e.height}px`
906
912
  }
907
913
  });
908
- }), !s) return null;
909
- if (!f) return b ? /* @__PURE__ */ H(Et, {
910
- container: b.container,
911
- children: /* @__PURE__ */ H("div", {
912
- ...t,
913
- className: D(t.className, Rt.root, Rt.root_isReturning),
914
- style: b.style,
915
- children: v == null ? null : r.current?.(v, a, zt)
914
+ }), !l) return null;
915
+ if (!p) return x ? /* @__PURE__ */ W(Et, {
916
+ container: x.container,
917
+ children: /* @__PURE__ */ W("div", {
918
+ ...n,
919
+ className: D(n.className, Rt.root, Rt.root_isReturning),
920
+ style: x.style,
921
+ children: y == null ? null : i.current?.(y, o, zt)
916
922
  })
917
923
  }) : null;
918
- let S = !l;
919
- return /* @__PURE__ */ U(Et, {
920
- container: o.current,
921
- children: [/* @__PURE__ */ H("div", {
922
- ...t,
923
- className: D(t.className, Rt.root, {
924
- [Rt.root_isDragging]: s,
925
- [Rt.root_isBlocked]: S
924
+ let C = !f;
925
+ return /* @__PURE__ */ G(Et, {
926
+ container: s.current,
927
+ children: [/* @__PURE__ */ W("div", {
928
+ ...n,
929
+ className: D(n.className, Rt.root, {
930
+ [Rt.root_isDragging]: l,
931
+ [Rt.root_isBlocked]: C
926
932
  }),
927
- style: { ..._ },
928
- children: v == null ? null : r.current?.(v, a, zt)
929
- }), e && !S && /* @__PURE__ */ H(Lt, {
933
+ style: { ...v },
934
+ children: y == null ? null : i.current?.(y, o, zt)
935
+ }), e && !C && /* @__PURE__ */ W(Lt, {
930
936
  coordinates: {
931
- x: h,
932
- y: g
937
+ x: g,
938
+ y: _
933
939
  },
934
- children: f ? i.current?.(f.date, _.top, _.height) : null
940
+ children: p ? a.current?.(p.date, Math.round(v.top / t), Math.round(v.height / t)) : null
935
941
  })]
936
942
  });
937
943
  }
@@ -953,7 +959,7 @@ function Ut(e, t, n) {
953
959
  }
954
960
  return i;
955
961
  }
956
- var X = {
962
+ var Z = {
957
963
  root: "_root_diwsf_1",
958
964
  root__head: "_root__head_diwsf_10",
959
965
  root__weekday: "_root__weekday_diwsf_20",
@@ -979,7 +985,7 @@ var X = {
979
985
  };
980
986
  // src/components/month-view/MonthViewDay.tsx
981
987
  function Wt(e) {
982
- let { ref: t, targetDate: n, children: r, onDoubleClick: a, ...o } = e, { onEventChange: s, onEventCreate: c, getIsDayDisabled: l, disabled: d, eventMap: f } = q(), p = W(), { getHours: m, getMinutes: h, getNow: g } = p, _ = u(null), { register: v, isOver: y } = Fe(({ registerDropTarget: e, isOver: t }) => ({
988
+ let { ref: t, targetDate: n, children: r, onDoubleClick: a, ...o } = e, { onEventChange: s, onEventCreate: c, getIsDayDisabled: l, disabled: d, eventMap: f } = J(), p = K(), { getHours: m, getMinutes: h, getNow: g } = p, _ = u(null), { register: v, isOver: y } = Ne(({ registerDropTarget: e, isOver: t }) => ({
983
989
  register: e,
984
990
  isOver: t(_.current)
985
991
  }));
@@ -993,7 +999,7 @@ function Wt(e) {
993
999
  return JSON.parse(t);
994
1000
  })), r = t && f.get(t.key);
995
1001
  if (!r) return;
996
- let i = p.fromMillis(t.day ?? t.date), a = je(p, i, n) / 1440;
1002
+ let i = p.fromMillis(t.day ?? t.date), a = ke(p, i, n) / 1440;
997
1003
  a !== 0 && s(r.key, p.addDays(p.getStartOfDay(r.date), a), {
998
1004
  from: m(r.date) * 60 + h(r.date),
999
1005
  duration: r.duration
@@ -1012,19 +1018,19 @@ function Wt(e) {
1012
1018
  v,
1013
1019
  n
1014
1020
  ]);
1015
- let b = K((e) => {
1021
+ let b = q((e) => {
1016
1022
  if (a?.(e), e.defaultPrevented || d || l && l(n)) return;
1017
1023
  let t = g();
1018
1024
  c(n, {
1019
1025
  from: m(t) * 60 + h(t),
1020
1026
  duration: 60
1021
1027
  });
1022
- }), x = ct(_, t);
1023
- return /* @__PURE__ */ H("div", {
1028
+ }), x = st(_, t);
1029
+ return /* @__PURE__ */ W("div", {
1024
1030
  ...o,
1025
1031
  ref: x,
1026
1032
  onDoubleClick: b,
1027
- className: D(o.className, X.root__day, { [X.root__day_isOver]: y }),
1033
+ className: D(o.className, Z.root__day, { [Z.root__day_isOver]: y }),
1028
1034
  children: r
1029
1035
  });
1030
1036
  }
@@ -1049,8 +1055,8 @@ var Kt = {
1049
1055
  }
1050
1056
  };
1051
1057
  function qt({ delta: e, disabled: t }) {
1052
- let n = ut(e);
1053
- return Ze((r) => {
1058
+ let n = lt(e);
1059
+ return Xe((r) => {
1054
1060
  if (t || !n || !r) return Kt;
1055
1061
  let i = {
1056
1062
  x: Math.sign(e.x - n.x),
@@ -1115,7 +1121,7 @@ function Jt(e) {
1115
1121
  if (!i || a?.(i) === !1) continue;
1116
1122
  let e = n[r];
1117
1123
  if (!e) continue;
1118
- let { direction: o, speed: c } = re(i, e, w, t, p);
1124
+ let { direction: o, speed: c } = ne(i, e, w, t, p);
1119
1125
  for (let e of ["x", "y"]) y[e][o[e]] || (c[e] = 0, o[e] = 0);
1120
1126
  if (c.x > 0 || c.y > 0) {
1121
1127
  v(), _(T, s), S.current = i, b.current = c, x.current = o;
@@ -1159,17 +1165,17 @@ function Yt(e, t = !1) {
1159
1165
  return i(() => () => r?.disconnect(), [r]), r;
1160
1166
  }
1161
1167
  // src/hooks/useRect.ts
1162
- function Xt(e, t = F, n) {
1168
+ function Xt(e, t = P, n) {
1163
1169
  let [r, i] = l(s, null), a = Yt((t) => {
1164
1170
  if (e) for (let n of t) {
1165
1171
  let { type: t, target: r } = n;
1166
- if (t === "childList" && he(r) && r.contains(e)) {
1172
+ if (t === "childList" && pe(r) && r.contains(e)) {
1167
1173
  i();
1168
1174
  break;
1169
1175
  }
1170
1176
  }
1171
- }), o = Je(i);
1172
- return G(() => {
1177
+ }), o = qe(i);
1178
+ return Ke(() => {
1173
1179
  i(), e ? (o?.observe(e), a?.observe(document.body, {
1174
1180
  childList: !0,
1175
1181
  subtree: !0
@@ -1183,28 +1189,28 @@ function Xt(e, t = F, n) {
1183
1189
  if (!e) return null;
1184
1190
  if (e.isConnected === !1) return r ?? n ?? null;
1185
1191
  let i = t(e);
1186
- return Oe(i, r) ? r : i;
1192
+ return Ee(i, r) ? r : i;
1187
1193
  }
1188
1194
  }
1189
1195
  // src/hooks/useScrollableAncestors.ts
1190
1196
  var Zt = [];
1191
1197
  function Qt(e, t) {
1192
- let n = u(e), r = c(() => e ? ae(e, t) : Zt, [e, t]);
1198
+ let n = u(e), r = c(() => e ? re(e, t) : Zt, [e, t]);
1193
1199
  return i(() => {
1194
1200
  n.current = e;
1195
1201
  }, [e]), r;
1196
1202
  }
1197
1203
  // src/hooks/useScrollableAncestorsRects.ts
1198
1204
  var $t = [];
1199
- function en(e, t = F) {
1200
- let [n, r] = l(a, $t), i = Je(r);
1201
- return e.length > 0 && n === $t && r(), G(() => {
1205
+ function en(e, t = P) {
1206
+ let [n, r] = l(a, $t), i = qe(r);
1207
+ return e.length > 0 && n === $t && r(), Ke(() => {
1202
1208
  e.length ? e.forEach((e) => i?.observe(e)) : (i?.disconnect(), r());
1203
1209
  }, [e, i]), n;
1204
1210
  function a() {
1205
1211
  return e.length ? e.map((e) => {
1206
1212
  if (e === document.scrollingElement) {
1207
- let t = me(e), n = t.innerWidth, r = t.innerHeight;
1213
+ let t = fe(e), n = t.innerWidth, r = t.innerHeight;
1208
1214
  return {
1209
1215
  top: 0,
1210
1216
  left: 0,
@@ -1221,17 +1227,17 @@ function en(e, t = F) {
1221
1227
  // src/hooks/useScrollOffsets.ts
1222
1228
  function tn(e) {
1223
1229
  let [t, r] = d(null), a = u(e), o = n((e) => {
1224
- let t = oe(e.target);
1225
- t && r((e) => e ? (e.set(t, ne(t)), new Map(e)) : null);
1230
+ let t = ie(e.target);
1231
+ t && r((e) => e ? (e.set(t, V(t)), new Map(e)) : null);
1226
1232
  }, []);
1227
1233
  return i(() => {
1228
1234
  let t = a.current;
1229
1235
  if (e !== t) {
1230
1236
  n(t);
1231
1237
  let i = e.map((e) => {
1232
- let t = oe(e);
1233
- return t ? (t.addEventListener("scroll", o, { passive: !0 }), [t, ne(t)]) : null;
1234
- }).filter((e) => _e(e));
1238
+ let t = ie(e);
1239
+ return t ? (t.addEventListener("scroll", o, { passive: !0 }), [t, V(t)]) : null;
1240
+ }).filter((e) => he(e));
1235
1241
  r(i.length ? new Map(i) : null), a.current = e;
1236
1242
  }
1237
1243
  return () => {
@@ -1239,11 +1245,11 @@ function tn(e) {
1239
1245
  };
1240
1246
  function n(e) {
1241
1247
  e.forEach((e) => {
1242
- let t = oe(e);
1248
+ let t = ie(e);
1243
1249
  t && t.removeEventListener("scroll", o);
1244
1250
  });
1245
1251
  }
1246
- }, [o, e]), c(() => e.length ? t ? Array.from(t.values()).reduce((e, t) => _(e, t), O) : ie(e) : O, [e, t]);
1252
+ }, [o, e]), c(() => e.length ? t ? Array.from(t.values()).reduce((e, t) => _(e, t), O) : H(e) : O, [e, t]);
1247
1253
  }
1248
1254
  // src/hooks/useScrollOffsetsDelta.ts
1249
1255
  function nn(e, t = k) {
@@ -1253,14 +1259,14 @@ function nn(e, t = k) {
1253
1259
  }, t), i(() => {
1254
1260
  let t = e !== O;
1255
1261
  t && !n.current && (n.current = e), !t && n.current && (n.current = null);
1256
- }, [e]), n.current ? Ae(e, n.current) : O;
1262
+ }, [e]), n.current ? Oe(e, n.current) : O;
1257
1263
  }
1258
1264
  // src/hooks/useMoveTransform.ts
1259
- var Z = {
1265
+ var rn = {
1260
1266
  Start: "start",
1261
1267
  Move: "move",
1262
1268
  Stop: "stop"
1263
- }, rn = {
1269
+ }, an = {
1264
1270
  isActive: !1,
1265
1271
  initialTranslate: {
1266
1272
  x: 0,
@@ -1276,8 +1282,8 @@ var Z = {
1276
1282
  },
1277
1283
  context: null
1278
1284
  };
1279
- function an({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null, containerNode: r = null }) {
1280
- let [i, a] = l(on, rn), o = typeof n == "function" ? n(i.context) : n, s = typeof r == "function" ? r(i.context) : r, u = Xt(i.isActive ? o : null), d = Xt(i.isActive ? s : null), f = Qt(i.isActive ? o : null), p = en(f), m = nn(tn(f)), h = c(() => {
1285
+ function on({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null, containerNode: r = null }) {
1286
+ let [i, a] = l(sn, an), o = typeof n == "function" ? n(i.context) : n, s = typeof r == "function" ? r(i.context) : r, u = Xt(i.isActive ? o : null), d = Xt(i.isActive ? s : null), f = Qt(i.isActive ? o : null), p = en(f), m = nn(tn(f)), h = c(() => {
1281
1287
  let e = (e) => (t, n) => {
1282
1288
  a({
1283
1289
  type: e,
@@ -1286,9 +1292,9 @@ function an({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null
1286
1292
  });
1287
1293
  };
1288
1294
  return {
1289
- start: e(Z.Start),
1290
- move: e(Z.Move),
1291
- stop: e(Z.Stop)
1295
+ start: e(rn.Start),
1296
+ move: e(rn.Move),
1297
+ stop: e(rn.Stop)
1292
1298
  };
1293
1299
  }, []), g = _(i.initialTranslate, i.translate);
1294
1300
  Jt({
@@ -1333,18 +1339,18 @@ function an({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null
1333
1339
  }
1334
1340
  ];
1335
1341
  }
1336
- function on(e, t) {
1342
+ function sn(e, t) {
1337
1343
  let n = {
1338
- [Z.Start]: (e, { coordinates: t, context: n }) => ({
1344
+ [rn.Start]: (e, { coordinates: t, context: n }) => ({
1339
1345
  ...e,
1340
1346
  isActive: !0,
1341
- currentAction: Z.Start,
1347
+ currentAction: rn.Start,
1342
1348
  initialTranslate: { ...t },
1343
1349
  context: n
1344
1350
  }),
1345
- [Z.Move]: (e, { coordinates: t }) => ({
1351
+ [rn.Move]: (e, { coordinates: t }) => ({
1346
1352
  ...e,
1347
- currentAction: Z.Move,
1353
+ currentAction: rn.Move,
1348
1354
  translate: {
1349
1355
  x: t.x - e.initialTranslate.x,
1350
1356
  y: t.y - e.initialTranslate.y
@@ -1354,17 +1360,17 @@ function on(e, t) {
1354
1360
  y: t.y - (e.translate.y + e.initialTranslate.y)
1355
1361
  }
1356
1362
  }),
1357
- [Z.Stop]: () => ({
1358
- ...rn,
1359
- currentAction: Z.Stop
1363
+ [rn.Stop]: () => ({
1364
+ ...an,
1365
+ currentAction: rn.Stop
1360
1366
  })
1361
1367
  };
1362
- return ye(t.type, n, e, t);
1368
+ return _e(t.type, n, e, t);
1363
1369
  }
1364
1370
  // src/components/month-view/MonthViewEvent.tsx
1365
- var sn = 6;
1366
- function cn(e) {
1367
- let { ref: t, eventData: n, weekDays: r, resizable: a = !1, resize: o, isResizeSource: s = !1, isAnyResizing: c = !1, children: l, ...d } = e, { disabled: f } = q(), m = W(), { viewportRef: h } = Ft(), g = u(null), _ = u(null), { attributes: v, isDragging: y, overElement: b, register: x, setOverlayTransform: S } = Fe(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
1371
+ var cn = 6;
1372
+ function ln(e) {
1373
+ let { ref: t, eventData: n, weekDays: r, resizable: a = !1, resize: o, isResizeSource: s = !1, isAnyResizing: c = !1, children: l, ...d } = e, { disabled: f } = J(), m = K(), { viewportRef: h } = Ft(), g = u(null), _ = u(null), { attributes: v, isDragging: y, overElement: b, register: x, setOverlayTransform: S } = Ne(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
1368
1374
  let a = i(g.current), [o] = a ? [...n.dropTargets].pop() ?? [null] : [null];
1369
1375
  return {
1370
1376
  attributes: t.attributes,
@@ -1373,23 +1379,23 @@ function cn(e) {
1373
1379
  register: e,
1374
1380
  setOverlayTransform: r
1375
1381
  };
1376
- }), C = Xt(y ? b : null), [{ transform: w, context: T }, E] = an({
1382
+ }), C = Xt(y ? b : null), [{ transform: w, context: T }, E] = on({
1377
1383
  autoScrollEnabled: !1,
1378
1384
  activeNode: () => g.current,
1379
1385
  containerNode: () => h.current,
1380
1386
  modifiers: [function({ activeNodeRect: e, containerNodeRect: t, transform: n, translate: r, initialTranslate: i }) {
1381
1387
  if (!t || !e || !C) return n;
1382
- n.x = r.x + i.x - t.left, n.y = r.y + i.y - t.top, n.left = C.left - t.left + sn, n.width = C.width - 12, n.height = e.height;
1388
+ n.x = r.x + i.x - t.left, n.y = r.y + i.y - t.top, n.left = C.left - t.left + cn, n.width = C.width - 12, n.height = e.height;
1383
1389
  let a = e.top + r.y, o = C.top + p.header, s = C.top + C.height - e.height;
1384
1390
  return n.top = Math.max(o, Math.min(a, s)) - t.top, n;
1385
1391
  }]
1386
- }), O = K((e) => {
1392
+ }), O = q((e) => {
1387
1393
  T === "overlay" && S(e);
1388
1394
  });
1389
1395
  i(() => {
1390
1396
  O(w);
1391
1397
  }, [O, ...Object.values(w)]);
1392
- let k = K(() => {
1398
+ let k = q(() => {
1393
1399
  let e = _.current ?? r[n.column], t = {
1394
1400
  ...n,
1395
1401
  date: m.toMillis(n.date),
@@ -1428,64 +1434,64 @@ function cn(e) {
1428
1434
  k,
1429
1435
  x
1430
1436
  ]);
1431
- let A = (e) => {
1437
+ let ee = (e) => {
1432
1438
  e.stopPropagation();
1433
1439
  let t = e.currentTarget.parentElement;
1434
1440
  if (!t) return;
1435
1441
  let i = t.getBoundingClientRect(), a = Math.floor((e.clientX - i.left) / i.width * r.length), o = Math.min(Math.max(a, n.column), n.column + n.span - 1);
1436
1442
  _.current = r[o] ?? null;
1437
- }, j = (e) => ({
1443
+ }, A = (e) => ({
1438
1444
  onMoveStart: () => (o?.start(n.key, e), !0),
1439
1445
  onMove: (e) => o?.move(e.clientX, e.clientY),
1440
1446
  onMoveEnd: () => o?.end()
1441
- }), { listeners: M } = lt(j("start")), { listeners: N } = lt(j("end")), P = ct(g, t), F = n.span > 1 || !n.isStart || !n.isEnd, I = Vt({
1447
+ }), { listeners: j } = ct(A("start")), { listeners: M } = ct(A("end")), N = st(g, t), P = n.span > 1 || !n.isStart || !n.isEnd, F = Vt({
1442
1448
  "--ww-column": n.column + 1,
1443
1449
  "--ww-span": n.span,
1444
1450
  "--ww-row": n.lane + 2
1445
1451
  }, d.style);
1446
- return /* @__PURE__ */ U("div", {
1452
+ return /* @__PURE__ */ G("div", {
1447
1453
  ...d,
1448
1454
  ...c ? null : v,
1449
- ref: P,
1450
- style: I,
1455
+ ref: N,
1456
+ style: F,
1451
1457
  "data-key": String(n.key),
1452
1458
  "data-continues-before": n.isStart ? void 0 : "",
1453
1459
  "data-continues-after": n.isEnd ? void 0 : "",
1454
- onPointerDown: A,
1460
+ onPointerDown: ee,
1455
1461
  onDoubleClick: (e) => e.stopPropagation(),
1456
- className: D(d.className, X.root__event, {
1457
- [X.root__event_span]: F,
1458
- [X.root__event_continuesBefore]: !n.isStart,
1459
- [X.root__event_continuesAfter]: !n.isEnd,
1460
- [X.root__event_isDragging]: y,
1461
- [X.root__event_isResizeSource]: s
1462
+ className: D(d.className, Z.root__event, {
1463
+ [Z.root__event_span]: P,
1464
+ [Z.root__event_continuesBefore]: !n.isStart,
1465
+ [Z.root__event_continuesAfter]: !n.isEnd,
1466
+ [Z.root__event_isDragging]: y,
1467
+ [Z.root__event_isResizeSource]: s
1462
1468
  }),
1463
1469
  children: [
1464
1470
  l,
1465
- a && n.isStart && /* @__PURE__ */ H("div", {
1466
- ...M,
1471
+ a && n.isStart && /* @__PURE__ */ W("div", {
1472
+ ...j,
1467
1473
  "data-edge": "start",
1468
- className: D(X.root__resize, X.root__resizeStart)
1474
+ className: D(Z.root__resize, Z.root__resizeStart)
1469
1475
  }),
1470
- a && n.isEnd && /* @__PURE__ */ H("div", {
1471
- ...N,
1476
+ a && n.isEnd && /* @__PURE__ */ W("div", {
1477
+ ...M,
1472
1478
  "data-edge": "end",
1473
- className: D(X.root__resize, X.root__resizeEnd)
1479
+ className: D(Z.root__resize, Z.root__resizeEnd)
1474
1480
  })
1475
1481
  ]
1476
1482
  });
1477
1483
  }
1478
1484
  // src/components/month-view/MonthViewEventPreview.tsx
1479
- function ln({ bar: e, children: t }) {
1480
- return /* @__PURE__ */ H("div", {
1485
+ function un({ bar: e, children: t }) {
1486
+ return /* @__PURE__ */ W("div", {
1481
1487
  "aria-hidden": "true",
1482
1488
  "data-key": String(e.key),
1483
1489
  "data-continues-before": e.isStart ? void 0 : "",
1484
1490
  "data-continues-after": e.isEnd ? void 0 : "",
1485
- className: D(X.root__event, X.root__event_isResizing, {
1486
- [X.root__event_span]: e.span > 1 || !e.isStart || !e.isEnd,
1487
- [X.root__event_continuesBefore]: !e.isStart,
1488
- [X.root__event_continuesAfter]: !e.isEnd
1491
+ className: D(Z.root__event, Z.root__event_isResizing, {
1492
+ [Z.root__event_span]: e.span > 1 || !e.isStart || !e.isEnd,
1493
+ [Z.root__event_continuesBefore]: !e.isStart,
1494
+ [Z.root__event_continuesAfter]: !e.isEnd
1489
1495
  }),
1490
1496
  style: Vt({
1491
1497
  "--ww-column": e.column + 1,
@@ -1496,11 +1502,11 @@ function ln({ bar: e, children: t }) {
1496
1502
  });
1497
1503
  }
1498
1504
  // src/components/month-view/MonthViewWeek.tsx
1499
- function un(e) {
1500
- let { days: t, firstDayIndex: n, layout: r, sourceBars: i, lanes: a, resizingKey: o, resize: s } = e, { viewValue: c, eventRenderer: l, view: u, disabled: d } = q(), { getMonthDay: f, isSameMonth: p, isToday: m, toMillis: h } = W(), g = qe(), _ = o !== void 0, v = (e) => l.current?.(e.value, u, {
1505
+ function dn(e) {
1506
+ let { days: t, firstDayIndex: n, layout: r, sourceBars: i, lanes: a, resizingKey: o, resize: s } = e, { viewValue: c, eventRenderer: l, view: u, disabled: d } = J(), { getMonthDay: f, isSameMonth: p, isToday: m, toMillis: h } = K(), g = Ge(), _ = o !== void 0, v = (e) => l.current?.(e.value, u, {
1501
1507
  isStart: e.isStart,
1502
1508
  isEnd: e.isEnd
1503
- }), y = (e, n = !1) => /* @__PURE__ */ H(cn, {
1509
+ }), y = (e, n = !1) => /* @__PURE__ */ W(ln, {
1504
1510
  eventData: e,
1505
1511
  weekDays: t,
1506
1512
  resizable: !d,
@@ -1509,26 +1515,26 @@ function un(e) {
1509
1515
  isAnyResizing: _,
1510
1516
  children: v(e)
1511
1517
  }, e.key);
1512
- return /* @__PURE__ */ U("div", {
1513
- className: X.root__week,
1518
+ return /* @__PURE__ */ G("div", {
1519
+ className: Z.root__week,
1514
1520
  children: [
1515
- t.map((e, t) => /* @__PURE__ */ H(Wt, {
1521
+ t.map((e, t) => /* @__PURE__ */ W(Wt, {
1516
1522
  targetDate: e,
1517
1523
  "data-day-index": n + t,
1518
1524
  "data-is-outside": !p(e, c) || void 0,
1519
1525
  "data-is-today": m(e) ? !0 : void 0,
1520
1526
  style: Vt({ "--ww-column": t + 1 }),
1521
- children: /* @__PURE__ */ H("span", {
1522
- className: X.root__dayNumber,
1527
+ children: /* @__PURE__ */ W("span", {
1528
+ className: Z.root__dayNumber,
1523
1529
  children: f(e)
1524
1530
  })
1525
1531
  }, h(e))),
1526
- [...r.bars.map((e) => e.key === o ? /* @__PURE__ */ H(ln, {
1532
+ [...r.bars.map((e) => e.key === o ? /* @__PURE__ */ W(un, {
1527
1533
  bar: e,
1528
1534
  children: v(e)
1529
1535
  }, `preview-${e.key}`) : y(e)), ...i.map((e) => y(e, !0))],
1530
- t.map((e, t) => r.hidden[t] > 0 && /* @__PURE__ */ H("span", {
1531
- className: X.root__more,
1536
+ t.map((e, t) => r.hidden[t] > 0 && /* @__PURE__ */ W("span", {
1537
+ className: Z.root__more,
1532
1538
  style: Vt({
1533
1539
  "--ww-column": t + 1,
1534
1540
  "--ww-row": a + 2
@@ -1539,12 +1545,12 @@ function un(e) {
1539
1545
  });
1540
1546
  }
1541
1547
  // src/components/month-view/useMonthLanes.ts
1542
- function dn(e, t) {
1548
+ function fn(e, t) {
1543
1549
  let [n, r] = d(t), i = () => {
1544
1550
  let n = e.current?.firstElementChild;
1545
- n?.clientHeight && r(ee(n.clientHeight, t));
1546
- }, a = Je(i);
1547
- return G(() => {
1551
+ n?.clientHeight && r(R(n.clientHeight, t));
1552
+ }, a = qe(i);
1553
+ return Ke(() => {
1548
1554
  i();
1549
1555
  let t = e.current?.firstElementChild;
1550
1556
  return t && a?.observe(t), () => {
@@ -1553,23 +1559,23 @@ function dn(e, t) {
1553
1559
  }, [a, t]), n;
1554
1560
  }
1555
1561
  // src/components/month-view/useMonthResize.ts
1556
- function fn(e) {
1557
- let { days: t, viewportRef: n, dateUtils: r, eventMap: i, disabled: a, getIsDayDisabled: o, onEventChange: s } = e, [l, u, d] = pt(null), { addGlobalListener: f, removeAllGlobalListeners: p } = at(), m = K((e = !0) => {
1562
+ function pn(e) {
1563
+ let { days: t, viewportRef: n, dateUtils: r, eventMap: i, disabled: a, getIsDayDisabled: o, onEventChange: s } = e, [l, u, d] = ft(null), { addGlobalListener: f, removeAllGlobalListeners: p } = it(), m = q((e = !0) => {
1558
1564
  let t = d.current;
1559
1565
  t && (p(), u(null), e && t.result && s(t.key, t.result.date, t.result.info));
1560
- }), h = K((e) => {
1566
+ }), h = q((e) => {
1561
1567
  e.key === "Escape" && m(!1);
1562
- }), g = K((e, t) => {
1568
+ }), g = q((e, t) => {
1563
1569
  a || d.current || (u({
1564
1570
  key: e,
1565
1571
  edge: t,
1566
1572
  result: null
1567
1573
  }), f(document, "keydown", h, !0));
1568
- }), _ = K((e, a) => {
1574
+ }), _ = q((e, a) => {
1569
1575
  let s = d.current, c = s && i.get(s.key), l = t[Ut(n.current, e, a)];
1570
1576
  s && c && l && !o?.(l) && u({
1571
1577
  ...s,
1572
- result: Ce(r, c, s.edge, l)
1578
+ result: xe(r, c, s.edge, l)
1573
1579
  });
1574
1580
  }), v = c(() => ({
1575
1581
  start: g,
@@ -1582,7 +1588,7 @@ function fn(e) {
1582
1588
  ]), y = c(() => {
1583
1589
  let e = l?.result && i.get(l.key);
1584
1590
  if (!l?.result || !e) return i;
1585
- let [t] = I(r, l.result.date, l.result.info);
1591
+ let [t] = F(r, l.result.date, l.result.info);
1586
1592
  return new Map(i).set(l.key, {
1587
1593
  ...e,
1588
1594
  date: t,
@@ -1600,15 +1606,15 @@ function fn(e) {
1600
1606
  };
1601
1607
  }
1602
1608
  // src/components/month-view/MonthView.tsx
1603
- var pn = [];
1604
- function mn(e) {
1605
- let { className: t, style: n, ...r } = e, { viewValue: i, eventMap: a, startWeek: o, disabled: s, getIsDayDisabled: l, onEventChange: d } = q(), f = W();
1609
+ var mn = [];
1610
+ function hn(e) {
1611
+ let { className: t, style: n, ...r } = e, { viewValue: i, eventMap: a, startWeek: o, disabled: s, getIsDayDisabled: l, onEventChange: d } = J(), f = K();
1606
1612
  ht();
1607
- let p = u(null), m = c(() => R(f, i, o), [
1613
+ let p = u(null), m = c(() => L(f, i, o), [
1608
1614
  f,
1609
1615
  o,
1610
1616
  i
1611
- ]), h = c(() => Ht(m), [m]), g = c(() => pe(f, o), [f, o]), _ = fn({
1617
+ ]), h = c(() => Ht(m), [m]), g = c(() => de(f, o), [f, o]), _ = pn({
1612
1618
  days: m,
1613
1619
  viewportRef: p,
1614
1620
  dateUtils: f,
@@ -1616,7 +1622,7 @@ function mn(e) {
1616
1622
  disabled: s,
1617
1623
  getIsDayDisabled: l,
1618
1624
  onEventChange: d
1619
- }), v = dn(p, 3), y = c(() => h.map((e) => x(a, f, e, v)), [
1625
+ }), v = fn(p, 3), y = c(() => h.map((e) => x(a, f, e, v)), [
1620
1626
  f,
1621
1627
  a,
1622
1628
  v,
@@ -1629,46 +1635,46 @@ function mn(e) {
1629
1635
  _.eventMap,
1630
1636
  h
1631
1637
  ]), S = c(() => ({ viewportRef: p }), []);
1632
- return /* @__PURE__ */ U(Pt.Provider, {
1638
+ return /* @__PURE__ */ G(Pt.Provider, {
1633
1639
  value: S,
1634
- children: [/* @__PURE__ */ U("div", {
1640
+ children: [/* @__PURE__ */ G("div", {
1635
1641
  ...r,
1636
- className: D(t, X.root, { [X.root_isResizing]: _.resizingKey !== void 0 }),
1642
+ className: D(t, Z.root, { [Z.root_isResizing]: _.resizingKey !== void 0 }),
1637
1643
  style: Vt({ "--ww-month-lanes": v }, n),
1638
- children: [/* @__PURE__ */ H("div", {
1639
- className: X.root__head,
1640
- children: g.map((e) => /* @__PURE__ */ H("div", {
1641
- className: X.root__weekday,
1644
+ children: [/* @__PURE__ */ W("div", {
1645
+ className: Z.root__head,
1646
+ children: g.map((e) => /* @__PURE__ */ W("div", {
1647
+ className: Z.root__weekday,
1642
1648
  children: e
1643
1649
  }, e))
1644
- }), /* @__PURE__ */ H("div", {
1645
- className: X.root__body,
1646
- children: /* @__PURE__ */ H("div", {
1650
+ }), /* @__PURE__ */ W("div", {
1651
+ className: Z.root__body,
1652
+ children: /* @__PURE__ */ W("div", {
1647
1653
  ref: p,
1648
- className: X.root__viewport,
1649
- children: h.map((e, t) => /* @__PURE__ */ H(un, {
1654
+ className: Z.root__viewport,
1655
+ children: h.map((e, t) => /* @__PURE__ */ W(dn, {
1650
1656
  days: e,
1651
1657
  firstDayIndex: t * 7,
1652
1658
  layout: b[t],
1653
- sourceBars: _.resizingKey === void 0 ? pn : y[t].bars.filter((e) => e.key === _.resizingKey),
1659
+ sourceBars: _.resizingKey === void 0 ? mn : y[t].bars.filter((e) => e.key === _.resizingKey),
1654
1660
  lanes: v,
1655
1661
  resizingKey: _.resizingKey,
1656
1662
  resize: _.actions
1657
1663
  }, f.toMillis(e[0])))
1658
1664
  })
1659
1665
  })]
1660
- }), /* @__PURE__ */ H(Bt, {
1661
- className: X.root__dragOverlay,
1666
+ }), /* @__PURE__ */ W(Bt, {
1667
+ className: Z.root__dragOverlay,
1662
1668
  showPreview: !1
1663
1669
  })]
1664
1670
  });
1665
1671
  }
1666
1672
  // src/hooks/useEventResize.ts
1667
- var hn = 1440;
1668
- function gn(e) {
1673
+ var gn = 1440;
1674
+ function _n(e) {
1669
1675
  let { days: t, viewportRef: r, dateUtils: a, bounds: o, timeStep: s, preventOutBoundsChanges: l } = e, [f, p] = d(null), m = u(null), h = u(e);
1670
1676
  h.current = e;
1671
- let g = o.hideMinMaxTime ? o.hourMin * 60 : 0, _ = o.hideMinMaxTime ? (o.hourMax - o.hourMin) * 60 : hn, v = n((e, n) => {
1677
+ let g = o.hideMinMaxTime ? o.hourMin * 60 : 0, _ = o.hideMinMaxTime ? (o.hourMax - o.hourMin) * 60 : gn, v = n((e, n) => {
1672
1678
  let i = m.current, c = r.current;
1673
1679
  if (!i || !c) return;
1674
1680
  i.x = e, i.y = n;
@@ -1677,7 +1683,7 @@ function gn(e) {
1677
1683
  let n = t.getBoundingClientRect(), r = e < n.left ? n.left - e : e > n.right ? e - n.right : 0;
1678
1684
  r < b && (b = r, y = Number(t.dataset.dayIndex));
1679
1685
  });
1680
- let x = we({
1686
+ let x = Se({
1681
1687
  start: i.original[0],
1682
1688
  end: i.original[1]
1683
1689
  }, i.edge, y, v, {
@@ -1687,10 +1693,10 @@ function gn(e) {
1687
1693
  crossDays: !l || o.hourMin <= 0 && o.hourMax >= 24,
1688
1694
  getFrame: (e) => {
1689
1695
  if (!l) return [0, _];
1690
- let [n, r] = se(a, t[e], o);
1696
+ let [n, r] = ae(a, t[e], o);
1691
1697
  return [Math.ceil(n / s) * s, Math.min(Math.ceil(r / s) * s, _)];
1692
1698
  },
1693
- canEditDay: (e) => !u && !d?.(t[e]) && !(l && ve(a, t[e]))
1699
+ canEditDay: (e) => !u && !d?.(t[e]) && !(l && ge(a, t[e]))
1694
1700
  });
1695
1701
  x && (i.range = x), p({
1696
1702
  key: i.key,
@@ -1711,7 +1717,7 @@ function gn(e) {
1711
1717
  start(e, n, r, i) {
1712
1718
  let o = h.current.eventMap.get(e);
1713
1719
  if (!o || !t[0]) return;
1714
- let s = je(a, t[0], o.date), c = [s, s + o.duration];
1720
+ let s = ke(a, t[0], o.date), c = [s, s + o.duration];
1715
1721
  m.current = {
1716
1722
  key: e,
1717
1723
  edge: n,
@@ -1733,9 +1739,9 @@ function gn(e) {
1733
1739
  if (m.current = null, p(null), !e) return;
1734
1740
  let [n, r] = e.range;
1735
1741
  if (n === e.original[0] && r === e.original[1]) return;
1736
- let i = Math.floor(n / hn);
1737
- h.current.onEventChange(e.key, N(a, t[0], i * hn), {
1738
- from: n - i * hn,
1742
+ let i = Math.floor(n / gn);
1743
+ h.current.onEventChange(e.key, M(a, t[0], i * gn), {
1744
+ from: n - i * gn,
1739
1745
  duration: r - n
1740
1746
  });
1741
1747
  }
@@ -1756,242 +1762,253 @@ function gn(e) {
1756
1762
  state: f,
1757
1763
  actions: y,
1758
1764
  previewOf: (e) => {
1759
- let n = Math.floor(e[0] / hn);
1765
+ let n = Math.floor(e[0] / gn);
1760
1766
  return {
1761
- date: N(a, t[0], n * hn),
1762
- top: e[0] - n * hn - g,
1767
+ date: M(a, t[0], n * gn),
1768
+ top: e[0] - n * gn - g,
1763
1769
  duration: e[1] - e[0]
1764
1770
  };
1765
1771
  }
1766
1772
  };
1767
1773
  }
1768
1774
  // src/contexts/DayWeekViewContext.ts
1769
- var _n = e(void 0);
1770
- V && (_n.displayName = "DayWeekViewContext");
1771
- function vn() {
1772
- let e = r(_n);
1775
+ var vn = e(void 0);
1776
+ U && (vn.displayName = "DayWeekViewContext");
1777
+ function yn() {
1778
+ let e = r(vn);
1773
1779
  if (!e) throw Error("DayWeekViewContext is required");
1774
1780
  return e;
1775
1781
  }
1776
1782
  // src/hooks/useTimeOffset.ts
1777
- function yn(e = !0, t = 6e4) {
1778
- let { hideMinMaxTime: n, hourMin: r, hourMax: i } = q(), a = W(), o = () => B(a, {
1783
+ function bn(e = !0, t = 6e4) {
1784
+ let { hideMinMaxTime: n, hourMin: r, hourMax: i } = J(), a = K(), [o, s] = d(null);
1785
+ return pt(() => s(Date.now()), t, e), c(() => o === null ? [0, !0] : B(a, {
1779
1786
  hourMin: r,
1780
1787
  hourMax: i,
1781
1788
  hideMinMaxTime: n
1782
- }), [s, c] = d([0, !0]);
1783
- return mt(() => c(o()), t, e), s;
1784
- }
1785
- var bn = {
1786
- root: "_root_6z2c5_1",
1787
- root_timeLimit: "_root_timeLimit_6z2c5_8",
1788
- root_isToday: "_root_isToday_6z2c5_8",
1789
- root_isPast: "_root_isPast_6z2c5_18",
1790
- root__container: "_root__container_6z2c5_36",
1791
- root__spotlight: "_root__spotlight_6z2c5_57",
1792
- root__timeLine: "_root__timeLine_6z2c5_67",
1793
- root_offLimits: "_root_offLimits_6z2c5_119"
1789
+ }), [
1790
+ o,
1791
+ a,
1792
+ r,
1793
+ i,
1794
+ n
1795
+ ]);
1796
+ }
1797
+ var xn = {
1798
+ root: "_root_1l2ji_1",
1799
+ root_timeLimit: "_root_timeLimit_1l2ji_8",
1800
+ root_isToday: "_root_isToday_1l2ji_8",
1801
+ root_isPast: "_root_isPast_1l2ji_18",
1802
+ root__container: "_root__container_1l2ji_36",
1803
+ root__spotlight: "_root__spotlight_1l2ji_57",
1804
+ root__timeLine: "_root__timeLine_1l2ji_67",
1805
+ root_offLimits: "_root_offLimits_1l2ji_121"
1794
1806
  };
1795
1807
  // src/components/day-week-drawer/DayWeekDrawer.tsx
1796
- function xn(e) {
1797
- let { ref: t, targetDate: n, children: r, ...a } = e, { onEventChange: o, onEventCreate: s, getIsDayDisabled: l, pointerPreviewRenderer: d, eventMap: f, ...p } = q(), { viewportRef: m, getTimeFrame: h } = vn(), { hideMinMaxTime: g, preventOutBoundsChanges: _, timeStep: v, hourMin: y, hourMax: b, disabled: x } = p, S = W(), { isBefore: w, isToday: T } = S, E = u(null), O = u(null), { register: k, getTransform: A } = Fe(({ registerDropTarget: e, getTransform: t }) => ({
1808
+ function Sn(e) {
1809
+ let { ref: t, targetDate: n, children: r, ...a } = e, { onEventChange: o, onEventCreate: s, getIsDayDisabled: l, pointerPreviewRenderer: d, eventMap: f, ...p } = J(), { viewportRef: m, getTimeFrame: h, pxPerMinute: g } = yn(), { hideMinMaxTime: _, preventOutBoundsChanges: v, timeStep: y, hourMin: b, hourMax: x, disabled: S } = p, w = K(), { isBefore: T, isToday: E } = w, O = y * g, k = (e) => Cn(e, g, y), ee = (e) => h(e).map((e) => e * g), j = u(null), M = u(null), { register: N, getTransform: P } = Ne(({ registerDropTarget: e, getTransform: t }) => ({
1798
1810
  register: e,
1799
1811
  getTransform: t
1800
- })), M = ht(), N = c(() => {
1801
- let e = T(n);
1812
+ })), F = ht(), I = c(() => {
1813
+ let e = E(n);
1802
1814
  return {
1803
1815
  isToday: e,
1804
- isPast: w(n) && !e
1816
+ isPast: T(n) && !e
1805
1817
  };
1806
1818
  }, [
1807
- w,
1808
1819
  T,
1820
+ E,
1809
1821
  n,
1810
- M
1811
- ]), [{ isActive: P, transform: F }, I, { scrollAdjustmentActiveNodeRect: L }] = an({
1812
- activeNode: E.current,
1813
- containerNode: E.current?.parentElement,
1822
+ F
1823
+ ]), [{ isActive: L, transform: R }, z, { scrollAdjustmentActiveNodeRect: B }] = on({
1824
+ activeNode: j.current,
1825
+ containerNode: j.current?.parentElement,
1814
1826
  modifiers: [
1815
1827
  function({ activeNodeRect: e, initialTranslate: t, translate: n, transform: r }) {
1816
1828
  if (!e) return r;
1817
1829
  let i = t.y - e.top;
1818
- r.x = r.left + t.x, r.y = r.top + t.y, r.top = Math.floor(i / v) * v, r.height = v, r.left = 0, r.width = e.width;
1830
+ r.x = r.left + t.x, r.y = r.top + t.y, r.top = Math.floor(i / O) * O, r.height = O, r.left = 0, r.width = e.width;
1819
1831
  let a;
1820
- return n.y > 0 ? (a = v - i % v, r.height = Math.ceil((r.height + n.y - a) / v) * v) : (a = i % v, r.height = Math.ceil((r.height - n.y - a) / v) * v, r.top -= r.height - v), r.height = Math.max(r.height, v), r;
1832
+ return n.y > 0 ? (a = O - i % O, r.height = Math.ceil((r.height + n.y - a) / O) * O) : (a = i % O, r.height = Math.ceil((r.height - n.y - a) / O) * O, r.top -= r.height - O), r.height = Math.max(r.height, O), r;
1821
1833
  },
1822
1834
  function({ transform: e }) {
1823
- if (!_) return e;
1824
- let [t, r] = h(n).map((e) => Math.ceil(e / v) * v);
1825
- return e.top < t && (e.height = Math.max(e.height - (t - e.top), v), e.top = t), e.height + e.top >= r && (e.height = Math.max(r - e.top, v)), e;
1835
+ if (!v) return e;
1836
+ let [t, r] = h(n).map((e) => Math.ceil(e / y) * O);
1837
+ return e.top < t && (e.height = Math.max(e.height - (t - e.top), O), e.top = t), e.height + e.top >= r && (e.height = Math.max(r - e.top, O)), e;
1826
1838
  },
1827
1839
  C,
1828
- ce(v)
1840
+ oe(O)
1829
1841
  ]
1830
- }), [R, ee] = yn(N.isToday);
1842
+ }), [te, V] = bn(I.isToday);
1831
1843
  i(() => {
1832
- let e = E.current;
1833
- if (e) return k(e, {
1844
+ let e = j.current;
1845
+ if (e) return N(e, {
1834
1846
  data: { date: n },
1835
1847
  onDrop: async (e) => {
1836
1848
  let [t] = await Promise.all(e.items.filter((e) => e.kind === "text" && e.types.has("event") && "getText" in e).map(async (e) => {
1837
1849
  let t = await e.getText("event");
1838
1850
  return JSON.parse(t);
1839
- })), r = A(), i = g ? y * 60 : 0, a = f.get(t.key), s = a ? je(S, a.date, a.date) : 0;
1840
- if (a && s + a.duration > 1440) {
1841
- if (_ && (y > 0 || b < 24)) {
1842
- I.stop({
1851
+ })), r = P(), i = Cn(r.top, g, y), a = Cn(r.height, g, y), s = _ ? b * 60 : 0, c = f.get(t.key), l = c ? ke(w, c.date, c.date) : 0;
1852
+ if (c && l + c.duration > 1440) {
1853
+ if (v && (b > 0 || x < 24)) {
1854
+ z.stop({
1843
1855
  x: e.x,
1844
1856
  y: e.y
1845
1857
  });
1846
1858
  return;
1847
1859
  }
1848
- let c = S.getStartOfDay(S.fromMillis(t.date)), l = je(S, a.date, c) + i + t.start - s, u = i + r.top - l, d = Math.floor(u / 1440);
1849
- o(t.key, S.addDays(n, d), {
1860
+ let r = w.getStartOfDay(w.fromMillis(t.date)), a = ke(w, c.date, r) + s + t.start - l, u = s + i - a, d = Math.floor(u / 1440);
1861
+ o(t.key, w.addDays(n, d), {
1850
1862
  from: u - d * 24 * 60,
1851
- duration: a.duration
1863
+ duration: c.duration
1852
1864
  });
1853
- } else g ? o(t.key, n, {
1854
- from: r.top + y * 60,
1855
- duration: r.height
1865
+ } else _ ? o(t.key, n, {
1866
+ from: i + b * 60,
1867
+ duration: a
1856
1868
  }) : o(t.key, n, {
1857
- from: r.top,
1858
- duration: r.height
1869
+ from: i,
1870
+ duration: a
1859
1871
  });
1860
- I.stop({
1872
+ z.stop({
1861
1873
  x: e.x,
1862
1874
  y: e.y
1863
1875
  });
1864
1876
  },
1865
1877
  getDropOperationForPoint: (e, t) => {
1866
- if (x || !e.has("event") || l && l(n)) return "cancel";
1867
- let { isPast: r, isToday: i } = N;
1868
- if (_) {
1878
+ if (S || !e.has("event") || l && l(n)) return "cancel";
1879
+ let { isPast: r, isToday: i } = I;
1880
+ if (v) {
1869
1881
  if (!i && r) return "cancel";
1870
- let [e, t] = h(n), a = A();
1882
+ let [e, t] = h(n).map((e) => e * g), a = P();
1871
1883
  if (a.y < e || a.y > t || i && a.height > t - e) return "cancel";
1872
1884
  }
1873
1885
  return t[0];
1874
1886
  }
1875
1887
  });
1876
1888
  }, [
1877
- I,
1889
+ z,
1890
+ w,
1878
1891
  S,
1879
- x,
1880
1892
  f,
1881
1893
  l,
1882
1894
  h,
1883
- A,
1884
- g,
1895
+ P,
1896
+ _,
1897
+ x,
1885
1898
  b,
1886
- y,
1887
1899
  o,
1888
- _,
1889
- k,
1900
+ v,
1901
+ g,
1902
+ N,
1890
1903
  n,
1891
- N
1904
+ y,
1905
+ I
1892
1906
  ]);
1893
- let { listeners: z } = lt({
1894
- distance: Math.max(Math.min(5, v), 1),
1907
+ let { listeners: ne } = ct({
1908
+ distance: Math.max(Math.min(5, y), 1),
1895
1909
  onMoveStart: (e) => {
1896
- if (!x) {
1897
- if (_) {
1898
- let { isToday: e, isPast: t } = N;
1910
+ if (!S) {
1911
+ if (v) {
1912
+ let { isToday: e, isPast: t } = I;
1899
1913
  if (t && !e) return !1;
1900
1914
  }
1901
- I.start({
1915
+ z.start({
1902
1916
  x: e.clientX,
1903
1917
  y: e.clientY
1904
1918
  });
1905
1919
  }
1906
1920
  },
1907
1921
  onMove: (e) => {
1908
- if (P) I.move({
1922
+ if (L) z.move({
1909
1923
  x: e.clientX,
1910
1924
  y: e.clientY
1911
1925
  });
1912
- else if (L) {
1913
- if (_) {
1914
- let [t, r] = h(n), i = e.clientY - L.top;
1926
+ else if (B) {
1927
+ if (v) {
1928
+ let [t, r] = ee(n), i = e.clientY - B.top;
1915
1929
  if (i < t || i > r) {
1916
- I.stop({
1930
+ z.stop({
1917
1931
  x: e.clientX,
1918
1932
  y: e.clientY
1919
1933
  });
1920
1934
  return;
1921
1935
  }
1922
1936
  }
1923
- P || I.move({
1937
+ L || z.move({
1924
1938
  x: e.clientX,
1925
1939
  y: e.clientY
1926
1940
  });
1927
1941
  }
1928
1942
  },
1929
1943
  onMoveEnd: (e) => {
1930
- I.stop({
1944
+ z.stop({
1931
1945
  x: e.clientX,
1932
1946
  y: e.clientY
1933
- }), P && (g ? s(n, {
1934
- from: F.top + y * 60,
1935
- duration: F.height
1947
+ }), L && (_ ? s(n, {
1948
+ from: k(R.top) + b * 60,
1949
+ duration: k(R.height)
1936
1950
  }) : s(n, {
1937
- from: F.top,
1938
- duration: F.height
1951
+ from: k(R.top),
1952
+ duration: k(R.height)
1939
1953
  }));
1940
1954
  }
1941
- }), B = ct(E, t), te = j(S, R, {
1942
- hourMin: y,
1943
- hideMinMaxTime: g
1944
- }), ne = () => d.current?.(n, F.top, F.height);
1945
- return /* @__PURE__ */ U("div", {
1955
+ }), H = st(j, t), re = A(w, te, {
1956
+ hourMin: b,
1957
+ hideMinMaxTime: _
1958
+ }), ie = () => d.current?.(n, k(R.top), k(R.height));
1959
+ return /* @__PURE__ */ G("div", {
1946
1960
  ...a,
1947
- ...z,
1948
- ref: B,
1949
- className: D(a.className, bn.root, {
1950
- [bn.root_timeLimit]: _,
1951
- [bn.root_isToday]: N.isToday,
1952
- [bn.root_isPast]: N.isPast,
1953
- [bn.root_offLimits]: ee
1961
+ ...ne,
1962
+ ref: H,
1963
+ className: D(a.className, xn.root, {
1964
+ [xn.root_timeLimit]: v,
1965
+ [xn.root_isToday]: I.isToday,
1966
+ [xn.root_isPast]: I.isPast,
1967
+ [xn.root_offLimits]: V
1954
1968
  }),
1955
1969
  style: {
1956
1970
  ...a.style,
1957
- "--offset": R
1971
+ "--offset": te * g
1958
1972
  },
1959
1973
  children: [
1960
- N.isToday && !ee && /* @__PURE__ */ H(Et, {
1974
+ I.isToday && !V && /* @__PURE__ */ W(Et, {
1961
1975
  container: m.current,
1962
- children: /* @__PURE__ */ H("span", {
1976
+ children: /* @__PURE__ */ W("span", {
1963
1977
  tabIndex: -1,
1964
- className: bn.root__timeLine,
1965
- "data-now": te,
1966
- style: { "--offset": R }
1978
+ className: xn.root__timeLine,
1979
+ "data-now": re,
1980
+ style: { "--offset": te * g }
1967
1981
  })
1968
1982
  }),
1969
- /* @__PURE__ */ H("div", {
1970
- ref: O,
1971
- className: bn.root__container,
1983
+ /* @__PURE__ */ W("div", {
1984
+ ref: M,
1985
+ className: xn.root__container,
1972
1986
  children: r
1973
1987
  }),
1974
- P && /* @__PURE__ */ U(Ve, { children: [/* @__PURE__ */ H("div", {
1975
- className: bn.root__spotlight,
1976
- style: F ? { ...F } : void 0
1977
- }), /* @__PURE__ */ H(Lt, {
1988
+ L && /* @__PURE__ */ G(ze, { children: [/* @__PURE__ */ W("div", {
1989
+ className: xn.root__spotlight,
1990
+ style: R ? { ...R } : void 0
1991
+ }), /* @__PURE__ */ W(Lt, {
1978
1992
  coordinates: {
1979
- x: F.x,
1980
- y: F.y
1993
+ x: R.x,
1994
+ y: R.y
1981
1995
  },
1982
- children: ne()
1996
+ children: ie()
1983
1997
  })] })
1984
1998
  ]
1985
1999
  });
1986
2000
  }
2001
+ function Cn(e, t, n) {
2002
+ return Math.round(e / t / n) * n;
2003
+ }
1987
2004
  // src/hooks/useAbsEventRect.ts
1988
- function Sn(e, t) {
2005
+ function wn(e, t) {
1989
2006
  let [n, r] = d(null);
1990
- return G(() => {
2007
+ return Ke(() => {
1991
2008
  let n = e.current, i = e.current?.parentElement;
1992
2009
  if (n && i) {
1993
- let { height: e, width: a, ...o } = F(n), { left: s, top: c } = Ae(o, F(i));
1994
- r(De(t, {
2010
+ let { height: e, width: a, ...o } = P(n), { left: s, top: c } = Oe(o, P(i));
2011
+ r(Te(t, {
1995
2012
  height: e,
1996
2013
  width: a,
1997
2014
  x: s,
@@ -2001,9 +2018,9 @@ function Sn(e, t) {
2001
2018
  }, [e, ...Object.values(t)]), n;
2002
2019
  }
2003
2020
  // src/hooks/useCanResizeEvent.ts
2004
- function Cn(e, t) {
2005
- let [n, r] = d(!0), { preventOutBoundsChanges: i } = q(), { isBefore: a, isToday: o } = W(), { getTimeFrame: s } = vn();
2006
- return G(() => {
2021
+ function Tn(e, t) {
2022
+ let [n, r] = d(!0), { preventOutBoundsChanges: i } = J(), { isBefore: a, isToday: o } = K(), { getTimeFrame: s } = yn();
2023
+ return Ke(() => {
2007
2024
  if (t && i) {
2008
2025
  if (a(e) && !o(e)) r(!1);
2009
2026
  else if (o(e)) {
@@ -2033,8 +2050,8 @@ var Q = {
2033
2050
  root_isResizeSource: "_root_isResizeSource_1qnpq_108"
2034
2051
  };
2035
2052
  // src/components/day-week-event/DayWeekEvent.tsx
2036
- function wn(e) {
2037
- let { ref: t, eventData: n, children: r, ...a } = e, { eventMap: o, ...s } = q(), c = W(), { timeStep: l, preventOutBoundsChanges: d, disabled: f } = s, p = u(null), m = u(null), h = u(null), { viewportRef: g, getTimeFrame: _, resize: v, resizing: y } = vn(), b = Sn(p, n.rect), x = Cn(o.get(n.key)?.date ?? n.date, b), { attributes: S, isDragging: C, overElement: w, overData: T, register: E, setOverlayTransform: O } = Fe(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
2053
+ function En(e) {
2054
+ let { ref: t, eventData: n, children: r, ...a } = e, { eventMap: o, ...s } = J(), c = K(), { timeStep: l, preventOutBoundsChanges: d, disabled: f } = s, p = u(null), m = u(null), h = u(null), { viewportRef: g, getTimeFrame: _, pxPerMinute: v, resize: y, resizing: b } = yn(), x = l * v, S = wn(p, n.rect), C = Tn(o.get(n.key)?.date ?? n.date, S), { attributes: w, isDragging: T, overElement: E, overData: O, register: k, setOverlayTransform: ee } = Ne(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
2038
2055
  let a = i(p.current), [o, s] = a ? [...n.dropTargets].pop() ?? [null, null] : [null, null];
2039
2056
  return {
2040
2057
  attributes: t.attributes,
@@ -2044,70 +2061,70 @@ function wn(e) {
2044
2061
  register: e,
2045
2062
  setOverlayTransform: r
2046
2063
  };
2047
- }), k = Xt(C ? w : null), [{ isActive: A, transform: j, context: M }, N] = an({
2048
- autoScrollEnabled: !C,
2064
+ }), A = Xt(T ? E : null), [{ isActive: j, transform: M, context: N }, P] = on({
2065
+ autoScrollEnabled: !T,
2049
2066
  activeNode: (e) => e === "overlay" ? p.current : e === "top" ? m.current : h.current,
2050
2067
  containerNode: (e) => e === "overlay" ? g.current : p.current?.parentElement?.parentElement ?? null,
2051
2068
  modifiers: [
2052
2069
  function({ activeNodeRect: e, containerNodeRect: t, context: n, transform: r, translate: i, initialTranslate: a }) {
2053
- if (n !== "overlay" || !t || !e || !k) return r;
2054
- r.x = i.x + a.x - t.left, r.y = i.y + a.y - t.top, r.left = k.left - t.left, r.width = k.width, r.top = e.top - t.top, r.height = e.height;
2070
+ if (n !== "overlay" || !t || !e || !A) return r;
2071
+ r.x = i.x + a.x - t.left, r.y = i.y + a.y - t.top, r.left = A.left - t.left, r.width = A.width, r.top = e.top - t.top, r.height = e.height;
2055
2072
  let o;
2056
- return i.y > 0 ? (o = l - (a.y - e.top) % l, r.top += Math.ceil((i.y - o) / l) * l) : (o = (a.y - e.top) % l, r.top += Math.floor((i.y + o) / l) * l), r;
2073
+ return i.y > 0 ? (o = x - (a.y - e.top) % x, r.top += Math.ceil((i.y - o) / x) * x) : (o = (a.y - e.top) % x, r.top += Math.floor((i.y + o) / x) * x), r;
2057
2074
  },
2058
2075
  function({ transform: e, context: t }) {
2059
- if (!d || t !== "overlay" || !T) return e;
2060
- let [n, r] = _(T.date).map((e) => Math.ceil(e / l) * l);
2076
+ if (!d || t !== "overlay" || !O) return e;
2077
+ let [n, r] = _(O.date).map((e) => Math.ceil(e / l) * x);
2061
2078
  return e.top < n && (e.top = n), e.top + e.height > r && (e.top = r - e.height), e;
2062
2079
  },
2063
- Tn(l)
2080
+ Dn(x)
2064
2081
  ]
2065
- }), P = be(() => v.end(), (e) => {
2066
- N.stop({
2082
+ }), F = ve(() => y.end(), (e) => {
2083
+ P.stop({
2067
2084
  x: e.clientX,
2068
2085
  y: e.clientY
2069
2086
  });
2070
- }), F = (e) => ({
2071
- onMoveStart: (t) => (N.start({
2087
+ }), I = (e) => ({
2088
+ onMoveStart: (t) => (P.start({
2072
2089
  x: t.clientX,
2073
2090
  y: t.clientY
2074
- }, e), v.start(n.key, e, t.clientX, t.clientY), !0),
2091
+ }, e), y.start(n.key, e, t.clientX, t.clientY), !0),
2075
2092
  onMove: (e) => {
2076
- N.move({
2093
+ P.move({
2077
2094
  x: e.clientX,
2078
2095
  y: e.clientY
2079
- }), v.move(e.clientX, e.clientY);
2096
+ }), y.move(e.clientX, e.clientY);
2080
2097
  },
2081
- onMoveEnd: P
2082
- }), { listeners: I } = lt(F("bottom")), { listeners: L } = lt(F("top")), R = ct(p, t), ee = A && C && M === "overlay", z = y?.key === n.key, B = K((e) => {
2083
- M === "overlay" && O(e);
2098
+ onMoveEnd: F
2099
+ }), { listeners: L } = ct(I("bottom")), { listeners: R } = ct(I("top")), z = st(p, t), B = j && T && N === "overlay", te = b?.key === n.key, V = q((e) => {
2100
+ N === "overlay" && ee(e);
2084
2101
  });
2085
2102
  i(() => {
2086
- B(j);
2087
- }, [B, ...Object.values(j)]), i(() => {
2103
+ V(M);
2104
+ }, [V, ...Object.values(M)]), i(() => {
2088
2105
  if (!p.current) return;
2089
2106
  let e = {
2090
- ...Se(n, "rect"),
2107
+ ...be(n, "rect"),
2091
2108
  date: c.toMillis(n.date)
2092
2109
  }, t = [{ event: JSON.stringify(e) }];
2093
- return E(p.current, {
2110
+ return k(p.current, {
2094
2111
  getItems() {
2095
2112
  return t;
2096
2113
  },
2097
2114
  onDragStart(e) {
2098
- N.start({
2115
+ P.start({
2099
2116
  x: e.x,
2100
2117
  y: e.y
2101
2118
  }, "overlay");
2102
2119
  },
2103
2120
  onDragMove(e) {
2104
- N.move({
2121
+ P.move({
2105
2122
  x: e.x,
2106
2123
  y: e.y
2107
2124
  });
2108
2125
  },
2109
2126
  onDragEnd(e) {
2110
- N.stop({
2127
+ P.stop({
2111
2128
  x: e.x,
2112
2129
  y: e.y
2113
2130
  });
@@ -2117,60 +2134,60 @@ function wn(e) {
2117
2134
  }
2118
2135
  });
2119
2136
  }, [
2120
- N,
2137
+ P,
2121
2138
  n,
2122
- E
2139
+ k
2123
2140
  ]);
2124
- let te = D(a.className, Q.root, {
2125
- [Q.root_isDragging]: ee,
2126
- [Q.root_isResizeSource]: z,
2141
+ let ne = D(a.className, Q.root, {
2142
+ [Q.root_isDragging]: B,
2143
+ [Q.root_isResizeSource]: te,
2127
2144
  [Q.root_isDisabled]: f
2128
- }), ne = {
2145
+ }), H = {
2129
2146
  ...a.style,
2130
2147
  top: `${n.rect.y}%`,
2131
2148
  left: `${n.rect.x}%`,
2132
2149
  width: `${n.rect.width}%`,
2133
2150
  height: `${n.rect.height}%`
2134
- }, re = K(be(a.onPointerDown, (e) => e.stopPropagation()));
2135
- return /* @__PURE__ */ H(Ve, { children: /* @__PURE__ */ U("div", {
2151
+ }, re = q(ve(a.onPointerDown, (e) => e.stopPropagation()));
2152
+ return /* @__PURE__ */ W(ze, { children: /* @__PURE__ */ G("div", {
2136
2153
  ...a,
2137
- ...S,
2138
- ref: R,
2139
- className: te,
2140
- style: ne,
2154
+ ...w,
2155
+ ref: z,
2156
+ className: ne,
2157
+ style: H,
2141
2158
  onPointerDown: re,
2142
2159
  "data-continues-before": n.isStart ? void 0 : "",
2143
2160
  "data-continues-after": n.isEnd ? void 0 : "",
2144
2161
  children: [
2145
- x && n.isStart && /* @__PURE__ */ H("div", {
2146
- ...L,
2162
+ C && n.isStart && /* @__PURE__ */ W("div", {
2163
+ ...R,
2147
2164
  ref: m,
2148
2165
  className: Q.root__resizeTop
2149
2166
  }),
2150
- /* @__PURE__ */ H("div", {
2167
+ /* @__PURE__ */ W("div", {
2151
2168
  role: "button",
2152
2169
  tabIndex: 0,
2153
2170
  className: Q.root__container,
2154
2171
  children: r
2155
2172
  }),
2156
- x && n.isEnd && /* @__PURE__ */ H("div", {
2157
- ...I,
2173
+ C && n.isEnd && /* @__PURE__ */ W("div", {
2174
+ ...L,
2158
2175
  ref: h,
2159
2176
  className: Q.root__resizeBottom
2160
2177
  })
2161
2178
  ]
2162
2179
  }) });
2163
2180
  }
2164
- function Tn(e) {
2181
+ function Dn(e) {
2165
2182
  return (t) => {
2166
- let n = [ce(e)];
2183
+ let n = [oe(e)];
2167
2184
  return t.context === "overlay" && n.push(S), y(n, t);
2168
2185
  };
2169
2186
  }
2170
2187
  // src/components/day-week-event/DayWeekEventPreview.tsx
2171
- function En({ part: e, timelineMinutes: t, children: n }) {
2188
+ function On({ part: e, timelineMinutes: t, children: n }) {
2172
2189
  let r = (e) => `${e / t * 100}%`;
2173
- return /* @__PURE__ */ H("div", {
2190
+ return /* @__PURE__ */ W("div", {
2174
2191
  "aria-hidden": "true",
2175
2192
  className: `${Q.root} ${Q.root_isResizing} ${Q.root_isPreview}`,
2176
2193
  "data-continues-before": e.isStart ? void 0 : "",
@@ -2181,37 +2198,37 @@ function En({ part: e, timelineMinutes: t, children: n }) {
2181
2198
  left: 0,
2182
2199
  width: "100%"
2183
2200
  },
2184
- children: /* @__PURE__ */ H("div", {
2201
+ children: /* @__PURE__ */ W("div", {
2185
2202
  className: Q.root__container,
2186
2203
  children: n
2187
2204
  })
2188
2205
  });
2189
2206
  }
2190
2207
  var $ = {
2191
- root: "_root_1140w_1",
2192
- root_scrollable: "_root_scrollable_1140w_10",
2193
- root__body: "_root__body_1140w_10",
2194
- root__head: "_root__head_1140w_14",
2195
- root__main: "_root__main_1140w_29",
2196
- root__viewport: "_root__viewport_1140w_43",
2197
- root__column: "_root__column_1140w_51",
2198
- root__headerCell: "_root__headerCell_1140w_76",
2199
- root__headerCellDay: "_root__headerCellDay_1140w_103",
2200
- root__headerCellLabel: "_root__headerCellLabel_1140w_110",
2201
- root__headerCellName: "_root__headerCellName_1140w_117",
2202
- root__headerCellToday: "_root__headerCellToday_1140w_124",
2203
- root__row: "_root__row_1140w_139",
2204
- root__timeStep: "_root__timeStep_1140w_161",
2205
- root__timeStep_overTime: "_root__timeStep_overTime_1140w_173",
2206
- root__rowHeadTime: "_root__rowHeadTime_1140w_177",
2207
- root__hiddenEventsLayer: "_root__hiddenEventsLayer_1140w_191",
2208
- root__hiddenEventsColumn: "_root__hiddenEventsColumn_1140w_204",
2209
- root__hiddenEvents: "_root__hiddenEvents_1140w_191",
2210
- root__hiddenEventsIcon: "_root__hiddenEventsIcon_1140w_251"
2208
+ root: "_root_1cr8n_1",
2209
+ root_scrollable: "_root_scrollable_1cr8n_10",
2210
+ root__body: "_root__body_1cr8n_10",
2211
+ root__head: "_root__head_1cr8n_14",
2212
+ root__main: "_root__main_1cr8n_29",
2213
+ root__viewport: "_root__viewport_1cr8n_43",
2214
+ root__column: "_root__column_1cr8n_51",
2215
+ root__headerCell: "_root__headerCell_1cr8n_76",
2216
+ root__headerCellDay: "_root__headerCellDay_1cr8n_103",
2217
+ root__headerCellLabel: "_root__headerCellLabel_1cr8n_110",
2218
+ root__headerCellName: "_root__headerCellName_1cr8n_117",
2219
+ root__headerCellToday: "_root__headerCellToday_1cr8n_124",
2220
+ root__row: "_root__row_1cr8n_139",
2221
+ root__timeStep: "_root__timeStep_1cr8n_161",
2222
+ root__timeStep_overTime: "_root__timeStep_overTime_1cr8n_173",
2223
+ root__rowHeadTime: "_root__rowHeadTime_1cr8n_177",
2224
+ root__hiddenEventsLayer: "_root__hiddenEventsLayer_1cr8n_192",
2225
+ root__hiddenEventsColumn: "_root__hiddenEventsColumn_1cr8n_205",
2226
+ root__hiddenEvents: "_root__hiddenEvents_1cr8n_192",
2227
+ root__hiddenEventsIcon: "_root__hiddenEventsIcon_1cr8n_252"
2211
2228
  };
2212
2229
  // src/components/day-week-view/HiddenEvents.tsx
2213
- function Dn({ scrollerRef: e, columns: t, rowHeight: n }) {
2214
- let { hourMin: r, hideMinMaxTime: a, size: o } = q(), s = W(), l = qe(), { addGlobalListener: u, removeGlobalListener: f } = at(), [p, m] = d(null), h = n / 60, g = K(() => {
2230
+ function kn({ scrollerRef: e, columns: t, rowHeight: n }) {
2231
+ let { hourMin: r, hideMinMaxTime: a, size: o } = J(), s = K(), l = Ge(), { addGlobalListener: u, removeGlobalListener: f } = it(), [p, m] = d(null), h = n / 60, g = q(() => {
2215
2232
  let t = e.current;
2216
2233
  if (!t) return;
2217
2234
  let n = {
@@ -2219,7 +2236,7 @@ function Dn({ scrollerRef: e, columns: t, rowHeight: n }) {
2219
2236
  height: t.clientHeight
2220
2237
  };
2221
2238
  m((e) => e?.top === n.top && e.height === n.height ? e : n);
2222
- }), _ = Je(g);
2239
+ }), _ = qe(g);
2223
2240
  i(() => {
2224
2241
  let t = e.current;
2225
2242
  if (t) return g(), u(t, "scroll", g, { passive: !0 }), _?.observe(t), () => {
@@ -2236,7 +2253,7 @@ function Dn({ scrollerRef: e, columns: t, rowHeight: n }) {
2236
2253
  n,
2237
2254
  t
2238
2255
  ]);
2239
- let v = c(() => p && p.height > 0 ? t.map((e) => L(e, h, p.top, p.height)) : null, [
2256
+ let v = c(() => p && p.height > 0 ? t.map((e) => I(e, h, p.top, p.height)) : null, [
2240
2257
  t,
2241
2258
  h,
2242
2259
  p
@@ -2248,34 +2265,34 @@ function Dn({ scrollerRef: e, columns: t, rowHeight: n }) {
2248
2265
  }), b = (e, t) => {
2249
2266
  let [n] = e;
2250
2267
  if (!n) return null;
2251
- let i = e.length === 1 && o !== "narrow" ? j(s, n.start, {
2268
+ let i = e.length === 1 && o !== "narrow" ? A(s, n.start, {
2252
2269
  hourMin: r,
2253
2270
  hideMinMaxTime: a
2254
2271
  }) : e.length;
2255
- return /* @__PURE__ */ U("button", {
2272
+ return /* @__PURE__ */ G("button", {
2256
2273
  type: "button",
2257
2274
  className: $.root__hiddenEvents,
2258
2275
  "data-direction": t,
2259
2276
  "aria-label": t === "above" ? l.earlier(e.length) : l.later(e.length),
2260
2277
  onClick: () => y(n),
2261
- children: [/* @__PURE__ */ H(bt, {
2278
+ children: [/* @__PURE__ */ W(bt, {
2262
2279
  "aria-hidden": "true",
2263
2280
  className: $.root__hiddenEventsIcon
2264
2281
  }), i]
2265
2282
  });
2266
2283
  };
2267
- return /* @__PURE__ */ U("div", {
2284
+ return /* @__PURE__ */ G("div", {
2268
2285
  className: $.root__hiddenEventsLayer,
2269
- children: [/* @__PURE__ */ H("div", {}), v.map(({ above: e, below: t }, n) => /* @__PURE__ */ U("div", {
2286
+ children: [/* @__PURE__ */ W("div", {}), v.map(({ above: e, below: t }, n) => /* @__PURE__ */ G("div", {
2270
2287
  className: $.root__hiddenEventsColumn,
2271
2288
  children: [b(e, "above"), b(t, "below")]
2272
2289
  }, n))]
2273
2290
  });
2274
2291
  }
2275
2292
  // src/components/day-week-view/useTimeColumnWidth.ts
2276
- function On(e, t, n) {
2293
+ function An(e, t, n) {
2277
2294
  let [r, i] = d();
2278
- return G(() => {
2295
+ return Ke(() => {
2279
2296
  let t = !1, r = () => {
2280
2297
  let r = e.current;
2281
2298
  if (t || !r) return;
@@ -2299,13 +2316,13 @@ function On(e, t, n) {
2299
2316
  ]), r;
2300
2317
  }
2301
2318
  // src/components/day-week-view/DayWeekView.tsx
2302
- var kn = {
2319
+ var jn = {
2303
2320
  regular: 64,
2304
2321
  compact: 44,
2305
2322
  narrow: 40
2306
2323
  };
2307
- function An({ rowHeight: e, ...t }) {
2308
- let { viewValue: r, hourMin: i, hourMax: a, view: o, eventMap: s, preventOutBoundsChanges: l, eventRenderer: d, timeStep: f, scrollable: p, size: h, hideMinMaxTime: g, disabled: _, getIsDayDisabled: v, onEventChange: y, pointerPreviewRenderer: x } = q(), S = W(), C = qe(), { getMonthDay: w, getWeekDay: E, isToday: O, weekDayShortName: k } = S, A = ht(), j = e ?? m[h], M = u(null), N = u(null), P = c(() => T(S, f, {
2324
+ function Mn({ rowHeight: e, ...t }) {
2325
+ let { viewValue: r, hourMin: i, hourMax: a, view: o, eventMap: s, preventOutBoundsChanges: l, eventRenderer: d, timeStep: f, scrollable: p, size: h, hideMinMaxTime: g, disabled: _, getIsDayDisabled: v, onEventChange: y, pointerPreviewRenderer: x } = J(), S = K(), C = Ge(), { getMonthDay: w, getWeekDay: E, isToday: O, weekDayShortName: k } = S, ee = ht(), A = e ?? m[h], j = u(null), M = u(null), N = c(() => T(S, f, {
2309
2326
  hourMin: i,
2310
2327
  hourMax: a,
2311
2328
  hideMinMaxTime: g
@@ -2316,11 +2333,11 @@ function An({ rowHeight: e, ...t }) {
2316
2333
  a,
2317
2334
  g,
2318
2335
  l
2319
- ]), F = On(M, c(() => P.map(({ time: e }) => e), [P]), kn[h]), I = c(() => fe(S, o, r), [
2336
+ ]), P = An(j, c(() => N.map(({ time: e }) => e), [N]), jn[h]), F = c(() => ue(S, o, r), [
2320
2337
  S,
2321
2338
  o,
2322
2339
  r
2323
- ]), L = c(() => ({
2340
+ ]), I = c(() => ({
2324
2341
  hourMin: i,
2325
2342
  hourMax: a,
2326
2343
  hideMinMaxTime: g
@@ -2328,28 +2345,28 @@ function An({ rowHeight: e, ...t }) {
2328
2345
  i,
2329
2346
  a,
2330
2347
  g
2331
- ]), R = c(() => b(s, S, P.length * 60, I, L), [
2348
+ ]), L = c(() => b(s, S, N.length * 60, F, I), [
2332
2349
  s,
2333
2350
  S,
2334
- P.length,
2335
- I,
2336
- L
2337
- ]), ee = c(() => R.map(({ events: e }) => e), [R]), { state: z, actions: B, previewOf: te } = gn({
2338
- days: I,
2339
- viewportRef: M,
2351
+ N.length,
2352
+ F,
2353
+ I
2354
+ ]), R = c(() => L.map(({ events: e }) => e), [L]), { state: z, actions: B, previewOf: te } = _n({
2355
+ days: F,
2356
+ viewportRef: j,
2340
2357
  dateUtils: S,
2341
- bounds: L,
2358
+ bounds: I,
2342
2359
  timeStep: f,
2343
2360
  preventOutBoundsChanges: l,
2344
2361
  disabled: _,
2345
2362
  getIsDayDisabled: v,
2346
2363
  eventMap: s,
2347
2364
  onEventChange: y
2348
- }), ne = c(() => z ? ke(z.range[0], z.range[1], I.length, L) : [], [
2365
+ }), V = c(() => z ? De(z.range[0], z.range[1], F.length, I) : [], [
2349
2366
  z,
2350
- I.length,
2351
- L
2352
- ]), re = z ? s.get(z.key)?.value : void 0, ie = n((e) => se(S, e, {
2367
+ F.length,
2368
+ I
2369
+ ]), ne = z ? s.get(z.key)?.value : void 0, H = n((e) => ae(S, e, {
2353
2370
  hourMin: i,
2354
2371
  hourMax: a,
2355
2372
  hideMinMaxTime: g
@@ -2358,8 +2375,8 @@ function An({ rowHeight: e, ...t }) {
2358
2375
  g,
2359
2376
  a,
2360
2377
  i
2361
- ]), ae = c(() => I.map((e, t) => {
2362
- let n = E(e), r = O(e), i = R[t]?.events ?? [];
2378
+ ]), re = c(() => F.map((e, t) => {
2379
+ let n = E(e), r = O(e), i = L[t]?.events ?? [];
2363
2380
  return {
2364
2381
  attributes: r ? { "data-is-today": !0 } : void 0,
2365
2382
  events: i,
@@ -2370,25 +2387,27 @@ function An({ rowHeight: e, ...t }) {
2370
2387
  weekDayNumber: n
2371
2388
  };
2372
2389
  }), [
2373
- A,
2390
+ ee,
2374
2391
  S,
2375
- I,
2376
- R,
2392
+ F,
2393
+ L,
2377
2394
  w,
2378
2395
  E,
2379
2396
  O,
2380
2397
  k
2381
- ]), oe = ft(), ce = t, le = $.root__head, ue = $.root__body, de = $.root__viewport, pe = $.root__column, me = $.root__headerCell, V = $.root__headerCellDay, he = $.root__row, ge = $.root__rowHeadTime, _e = $.root__timeStep, ve = ct(M), ye = c(() => ({
2382
- viewportRef: M,
2383
- getTimeFrame: ie,
2398
+ ]), ie = dt(), oe = t, se = $.root__head, ce = $.root__body, le = $.root__viewport, de = $.root__column, fe = $.root__headerCell, U = $.root__headerCellDay, pe = $.root__row, me = $.root__rowHeadTime, he = $.root__timeStep, ge = st(j), _e = c(() => ({
2399
+ viewportRef: j,
2400
+ getTimeFrame: H,
2401
+ pxPerMinute: A / 60,
2384
2402
  resize: B,
2385
2403
  resizing: z
2386
2404
  }), [
2387
- M,
2388
- ie,
2405
+ j,
2406
+ H,
2407
+ A,
2389
2408
  B,
2390
2409
  z
2391
- ]), be = c(() => ({ viewportRef: M }), [M]), xe = (e, t) => /* @__PURE__ */ H(wn, {
2410
+ ]), ve = c(() => ({ viewportRef: j }), [j]), ye = (e, t) => /* @__PURE__ */ W(En, {
2392
2411
  "data-idx": t,
2393
2412
  eventData: e,
2394
2413
  children: d.current?.(e.value, o, {
@@ -2396,74 +2415,74 @@ function An({ rowHeight: e, ...t }) {
2396
2415
  isEnd: e.isEnd
2397
2416
  })
2398
2417
  }, e.key);
2399
- return /* @__PURE__ */ H(_n.Provider, {
2400
- value: ye,
2401
- children: /* @__PURE__ */ H(Pt.Provider, {
2402
- value: be,
2403
- children: /* @__PURE__ */ U(Ve, { children: [
2404
- /* @__PURE__ */ U("div", {
2405
- ...ce,
2406
- className: D(ce.className, $.root, { [$.root_scrollable]: p }),
2418
+ return /* @__PURE__ */ W(vn.Provider, {
2419
+ value: _e,
2420
+ children: /* @__PURE__ */ W(Pt.Provider, {
2421
+ value: ve,
2422
+ children: /* @__PURE__ */ G(ze, { children: [
2423
+ /* @__PURE__ */ G("div", {
2424
+ ...oe,
2425
+ className: D(oe.className, $.root, { [$.root_scrollable]: p }),
2407
2426
  style: {
2408
- ...ce.style,
2409
- "--calendar-column-count": ae.length,
2410
- "--scrollbar-width": oe.width,
2411
- "--scrollbar-height": oe.height,
2412
- ...F !== void 0 && { "--ww-time-column": `${F}px` }
2427
+ ...oe.style,
2428
+ "--calendar-column-count": re.length,
2429
+ "--scrollbar-width": ie.width,
2430
+ "--scrollbar-height": ie.height,
2431
+ ...P !== void 0 && { "--ww-time-column": `${P}px` }
2413
2432
  },
2414
- children: [/* @__PURE__ */ U("div", {
2415
- className: le,
2416
- children: [/* @__PURE__ */ H("div", { className: me }), ae.map((e) => /* @__PURE__ */ U("div", {
2417
- className: me,
2433
+ children: [/* @__PURE__ */ G("div", {
2434
+ className: se,
2435
+ children: [/* @__PURE__ */ W("div", { className: fe }), re.map((e) => /* @__PURE__ */ G("div", {
2436
+ className: fe,
2418
2437
  ...e.attributes,
2419
- children: [/* @__PURE__ */ H("span", {
2420
- className: V,
2438
+ children: [/* @__PURE__ */ W("span", {
2439
+ className: U,
2421
2440
  children: e.day
2422
- }), /* @__PURE__ */ U("span", {
2441
+ }), /* @__PURE__ */ G("span", {
2423
2442
  className: $.root__headerCellLabel,
2424
- children: [/* @__PURE__ */ H("span", {
2443
+ children: [/* @__PURE__ */ W("span", {
2425
2444
  className: $.root__headerCellName,
2426
2445
  children: e.weekDayName
2427
- }), e.isToday && /* @__PURE__ */ H("span", {
2446
+ }), e.isToday && /* @__PURE__ */ W("span", {
2428
2447
  className: $.root__headerCellToday,
2429
2448
  children: C.today
2430
2449
  })]
2431
2450
  })]
2432
2451
  }, e.weekDayNumber))]
2433
- }), /* @__PURE__ */ U("div", {
2452
+ }), /* @__PURE__ */ G("div", {
2434
2453
  className: $.root__main,
2435
- children: [/* @__PURE__ */ H("div", {
2436
- ref: N,
2437
- className: ue,
2438
- children: /* @__PURE__ */ U("div", {
2439
- ref: ve,
2440
- className: de,
2441
- style: { height: P.length * j },
2442
- children: [/* @__PURE__ */ H("div", {
2443
- className: pe,
2444
- children: P.map(({ time: e, value: t, steps: n }, r) => /* @__PURE__ */ U("div", {
2445
- className: he,
2454
+ children: [/* @__PURE__ */ W("div", {
2455
+ ref: M,
2456
+ className: ce,
2457
+ children: /* @__PURE__ */ G("div", {
2458
+ ref: ge,
2459
+ className: le,
2460
+ style: { height: N.length * A },
2461
+ children: [/* @__PURE__ */ W("div", {
2462
+ className: de,
2463
+ children: N.map(({ time: e, value: t, steps: n }, r) => /* @__PURE__ */ G("div", {
2464
+ className: pe,
2446
2465
  style: {
2447
- height: j,
2448
- "--translateY": r * j,
2466
+ height: A,
2467
+ "--translateY": r * A,
2449
2468
  "--calendar-rows-count": n.length
2450
2469
  },
2451
- children: [/* @__PURE__ */ H("time", {
2452
- className: ge,
2470
+ children: [/* @__PURE__ */ W("time", {
2471
+ className: me,
2453
2472
  children: e
2454
- }), n.map(([e, , t]) => /* @__PURE__ */ H("div", { className: D(_e, { [$.root__timeStep_overTime]: t }) }, e))]
2473
+ }), n.map(([e, , t]) => /* @__PURE__ */ W("div", { className: D(he, { [$.root__timeStep_overTime]: t }) }, e))]
2455
2474
  }, t))
2456
- }), ae.map((e, t) => /* @__PURE__ */ H("div", {
2457
- className: pe,
2475
+ }), re.map((e, t) => /* @__PURE__ */ W("div", {
2476
+ className: de,
2458
2477
  "data-day-index": t,
2459
2478
  ...e.attributes,
2460
- children: /* @__PURE__ */ U(xn, {
2479
+ children: /* @__PURE__ */ G(Sn, {
2461
2480
  id: `${e.weekDayNumber}`,
2462
2481
  targetDate: e.targetDate,
2463
- children: [e.events.map((e, t) => xe(e, t)), ne.filter((e) => e.dayIndex === t).map((e) => /* @__PURE__ */ H(En, {
2482
+ children: [e.events.map((e, t) => ye(e, t)), V.filter((e) => e.dayIndex === t).map((e) => /* @__PURE__ */ W(On, {
2464
2483
  part: e,
2465
- timelineMinutes: P.length * 60,
2466
- children: re === void 0 ? null : d.current?.(re, o, {
2484
+ timelineMinutes: N.length * 60,
2485
+ children: ne === void 0 ? null : d.current?.(ne, o, {
2467
2486
  isStart: e.isStart,
2468
2487
  isEnd: e.isEnd
2469
2488
  })
@@ -2471,15 +2490,15 @@ function An({ rowHeight: e, ...t }) {
2471
2490
  })
2472
2491
  }, e.weekDayNumber))]
2473
2492
  })
2474
- }), p && /* @__PURE__ */ H(Dn, {
2475
- scrollerRef: N,
2476
- columns: ee,
2477
- rowHeight: j
2493
+ }), p && /* @__PURE__ */ W(kn, {
2494
+ scrollerRef: M,
2495
+ columns: R,
2496
+ rowHeight: A
2478
2497
  })]
2479
2498
  })]
2480
2499
  }),
2481
- /* @__PURE__ */ H(Bt, {}),
2482
- z && !z.blocked && /* @__PURE__ */ H(Lt, {
2500
+ /* @__PURE__ */ W(Bt, { pxPerMinute: A / 60 }),
2501
+ z && !z.blocked && /* @__PURE__ */ W(Lt, {
2483
2502
  coordinates: {
2484
2503
  x: z.x,
2485
2504
  y: z.y
@@ -2493,141 +2512,141 @@ function An({ rowHeight: e, ...t }) {
2493
2512
  })
2494
2513
  });
2495
2514
  }
2496
- var jn = {
2515
+ var Nn = {
2497
2516
  root: "_root_1jr3p_2",
2498
2517
  root__head: "_root__head_1jr3p_22",
2499
2518
  root__body: "_root__body_1jr3p_26",
2500
2519
  root__body_readonly: "_root__body_readonly_1jr3p_35"
2501
2520
  };
2502
2521
  // src/Calendar.tsx
2503
- function Mn(e) {
2504
- let { ref: t, disabled: n = !1, children: r, hideMinMaxTime: a = !1, timeFrame: o, startWeek: s, timeStep: l = 15, items: d, onEventCreate: f, onEventChange: p, onEventDelete: m, onEventEdit: h, eventTimeFrameResolver: g, eventKeyResolver: _, getIsDayDisabled: v, pointerPreviewFormat: y, scrollable: b = !1, view: x, defaultView: S, viewValue: C, defaultViewValue: T, onChangeView: E, onChangeViewValue: O, ...k } = e, { hourMax: A, hourMin: j } = {
2522
+ function Pn(e) {
2523
+ let { ref: t, disabled: n = !1, children: r, hideMinMaxTime: a = !1, timeFrame: o, startWeek: s, timeStep: l = 15, items: d, onEventCreate: f, onEventChange: p, onEventDelete: m, onEventEdit: h, eventTimeFrameResolver: g, eventKeyResolver: _, getIsDayDisabled: v, pointerPreviewFormat: y, scrollable: b = !1, view: x, defaultView: S, viewValue: C, defaultViewValue: T, onChangeView: E, onChangeViewValue: O, ...k } = e, { hourMax: ee, hourMin: A } = {
2505
2524
  hourMin: 0,
2506
2525
  hourMax: 24,
2507
2526
  ...o
2508
- }, N = Xe({
2527
+ }, M = Ye({
2509
2528
  eventTimeFrameResolver: g,
2510
2529
  eventKeyResolver: _
2511
- }), P = W(), F = s ?? P.weekStartsOn, L = u(null), R = ct(L, t), { viewValue: ee, changeViewValue: z, view: B, changeView: te } = vt({
2530
+ }), N = K(), P = s ?? N.weekStartsOn, I = u(null), L = st(I, t), { viewValue: R, changeViewValue: z, view: B, changeView: te } = vt({
2512
2531
  view: x,
2513
2532
  defaultView: S,
2514
2533
  viewValue: C,
2515
2534
  defaultViewValue: T,
2516
2535
  onChangeView: E,
2517
2536
  onChangeViewValue: O,
2518
- dateUtils: P,
2519
- startWeek: F
2520
- }), ne = Ye(L), re = nt(Ne).current, ie = c(() => w(d, N.current, P, {
2521
- hourMin: j,
2537
+ dateUtils: N,
2538
+ startWeek: P
2539
+ }), V = Je(I), ne = tt(je).current, H = c(() => w(d, M.current, N, {
2540
+ hourMin: A,
2522
2541
  hideMinMaxTime: a
2523
2542
  }), [
2524
- P,
2543
+ N,
2525
2544
  a,
2526
- j,
2545
+ A,
2527
2546
  d,
2528
- N
2529
- ]), { goBackward: ae, goForward: oe, goToday: se } = yt({
2547
+ M
2548
+ ]), { goBackward: re, goForward: ie, goToday: ae } = yt({
2530
2549
  changeViewValue: z,
2531
- dateUtils: P,
2532
- startWeek: F,
2550
+ dateUtils: N,
2551
+ startWeek: P,
2533
2552
  view: B,
2534
- viewValue: ee
2535
- }), ce = K((e, t, n) => {
2536
- let r = ie.get(e);
2537
- r && p?.(r.value, ...I(P, t, n));
2538
- }), ue = K((e, t) => {
2539
- f?.(...I(P, e, t));
2540
- }), de = K((e) => {
2541
- let t = ie.get(e);
2553
+ viewValue: R
2554
+ }), oe = q((e, t, n) => {
2555
+ let r = H.get(e);
2556
+ r && p?.(r.value, ...F(N, t, n));
2557
+ }), ce = q((e, t) => {
2558
+ f?.(...F(N, e, t));
2559
+ }), le = q((e) => {
2560
+ let t = H.get(e);
2542
2561
  t && h?.(t.value);
2543
- }), fe = K((e) => {
2544
- let t = ie.get(e);
2562
+ }), ue = q((e) => {
2563
+ let t = H.get(e);
2545
2564
  t && m?.(t.value);
2546
- }), pe = Xe((e, t, n) => {
2547
- let [r, i] = le(P, e, t, n, {
2548
- hourMin: j,
2565
+ }), de = Ye((e, t, n) => {
2566
+ let [r, i] = se(N, e, t, n, {
2567
+ hourMin: A,
2549
2568
  hideMinMaxTime: a
2550
2569
  });
2551
- return y ? y(r, i) : M(P, r, i);
2552
- }), me = Xe(r);
2570
+ return y ? y(r, i) : j(N, r, i);
2571
+ }), fe = Ye(r);
2553
2572
  i(() => {
2554
- if (L.current) return re.getState().registerRootElement(L.current);
2555
- }, [re]);
2556
- let V = {
2573
+ if (I.current) return ne.getState().registerRootElement(I.current);
2574
+ }, [ne]);
2575
+ let U = {
2557
2576
  ...k,
2558
- ref: R
2559
- }, he = c(() => ({
2577
+ ref: L
2578
+ }, pe = c(() => ({
2560
2579
  disabled: n,
2561
2580
  getIsDayDisabled: v,
2562
2581
  preventOutBoundsChanges: !!o,
2563
2582
  changeView: te,
2564
2583
  changeViewValue: z,
2565
- eventMap: ie,
2566
- goBackward: ae,
2567
- goForward: oe,
2568
- goToday: se,
2584
+ eventMap: H,
2585
+ goBackward: re,
2586
+ goForward: ie,
2587
+ goToday: ae,
2569
2588
  hideMinMaxTime: a,
2570
- hourMax: A,
2571
- hourMin: j,
2589
+ hourMax: ee,
2590
+ hourMin: A,
2572
2591
  timeStep: l,
2573
2592
  scrollable: b,
2574
- size: ne,
2575
- startWeek: F,
2593
+ size: V,
2594
+ startWeek: P,
2576
2595
  view: B,
2577
- viewValue: ee,
2578
- onEventCreate: ue,
2579
- onEventChange: ce,
2580
- onEventDelete: fe,
2581
- onEventEdit: de,
2582
- eventRenderer: me,
2583
- pointerPreviewRenderer: pe
2596
+ viewValue: R,
2597
+ onEventCreate: ce,
2598
+ onEventChange: oe,
2599
+ onEventDelete: ue,
2600
+ onEventEdit: le,
2601
+ eventRenderer: fe,
2602
+ pointerPreviewRenderer: de
2584
2603
  }), [
2585
2604
  n,
2586
- pe,
2605
+ de,
2587
2606
  v,
2588
2607
  te,
2589
2608
  z,
2609
+ H,
2610
+ re,
2590
2611
  ie,
2591
2612
  ae,
2592
- oe,
2593
- se,
2594
2613
  a,
2614
+ ee,
2595
2615
  A,
2596
- j,
2597
2616
  b,
2598
- ne,
2599
- F,
2617
+ V,
2618
+ P,
2600
2619
  l,
2601
2620
  B,
2602
- ee,
2603
- ue,
2621
+ R,
2604
2622
  ce,
2605
- fe,
2606
- de,
2607
- me
2623
+ oe,
2624
+ ue,
2625
+ le,
2626
+ fe
2608
2627
  ]);
2609
- return /* @__PURE__ */ H("div", {
2610
- ...V,
2611
- className: D(V.className, jn.root),
2612
- "data-ww-size": ne === "regular" ? void 0 : ne,
2613
- children: /* @__PURE__ */ H(gt.Provider, {
2614
- value: he,
2615
- children: /* @__PURE__ */ H(Pe.Provider, {
2616
- value: re,
2617
- children: /* @__PURE__ */ U(_t.Provider, {
2618
- value: L,
2619
- children: [/* @__PURE__ */ H("div", {
2620
- className: jn.root__head,
2621
- children: /* @__PURE__ */ H(Nt, {})
2622
- }), /* @__PURE__ */ H("div", {
2623
- className: jn.root__body,
2624
- children: H(B === "month" ? mn : An, {})
2628
+ return /* @__PURE__ */ W("div", {
2629
+ ...U,
2630
+ className: D(U.className, Nn.root),
2631
+ "data-ww-size": V === "regular" ? void 0 : V,
2632
+ children: /* @__PURE__ */ W(gt.Provider, {
2633
+ value: pe,
2634
+ children: /* @__PURE__ */ W(Me.Provider, {
2635
+ value: ne,
2636
+ children: /* @__PURE__ */ G(_t.Provider, {
2637
+ value: I,
2638
+ children: [/* @__PURE__ */ W("div", {
2639
+ className: Nn.root__head,
2640
+ children: /* @__PURE__ */ W(Nt, {})
2641
+ }), /* @__PURE__ */ W("div", {
2642
+ className: Nn.root__body,
2643
+ children: W(B === "month" ? hn : Mn, {})
2625
2644
  })]
2626
2645
  })
2627
2646
  })
2628
2647
  })
2629
2648
  });
2630
2649
  }
2631
- export { Mn as Calendar, Mn as default, Ue as DateLocalizationContext, Ke as DateLocalizationProvider, Ge as MessagesContext, E as builtInMessages, Te as resolveMessages, We as useDateUtils, qe as useMessages };
2650
+ export { Pn as Calendar, Pn as default, Ve as DateLocalizationContext, We as DateLocalizationProvider, Ue as MessagesContext, E as builtInMessages, Ce as resolveMessages, He as useDateUtils, Ge as useMessages };
2632
2651
 
2633
2652
  //# sourceMappingURL=index.js.map