@innosolutions/inno-calendar 1.0.60 → 1.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/AGENT.md +31 -4
  2. package/dist/{agenda-widget-COpTIR70.js → agenda-widget-Couk7jMB.js} +1314 -1296
  3. package/dist/agenda-widget-Couk7jMB.js.map +1 -0
  4. package/dist/agenda-widget-DZkEXTh-.cjs +2 -0
  5. package/dist/agenda-widget-DZkEXTh-.cjs.map +1 -0
  6. package/dist/components/event/event-card.d.ts.map +1 -1
  7. package/dist/components/index.cjs +1 -1
  8. package/dist/components/index.mjs +2 -2
  9. package/dist/components/primitives/scroll-navigator.d.ts +3 -1
  10. package/dist/components/primitives/scroll-navigator.d.ts.map +1 -1
  11. package/dist/components/views/timeline-view.d.ts +1 -1
  12. package/dist/components/views/timeline-view.d.ts.map +1 -1
  13. package/dist/core/context/slot-selection-context.d.ts +2 -0
  14. package/dist/core/context/slot-selection-context.d.ts.map +1 -1
  15. package/dist/core/index.cjs +1 -1
  16. package/dist/core/index.mjs +1 -1
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.mjs +4 -4
  19. package/dist/presets/index.cjs +1 -1
  20. package/dist/presets/index.mjs +1 -1
  21. package/dist/slot-selection-context-CRstOosL.js +604 -0
  22. package/dist/{slot-selection-context-CKGT_45R.js.map → slot-selection-context-CRstOosL.js.map} +1 -1
  23. package/dist/slot-selection-context-DBCZI2Dn.cjs +2 -0
  24. package/dist/{slot-selection-context-CS1te8uo.cjs.map → slot-selection-context-DBCZI2Dn.cjs.map} +1 -1
  25. package/dist/styles/index.css +1 -1
  26. package/dist/{tailwind-calendar-C3DidCJ5.js → tailwind-calendar-CNhXkxzW.js} +2 -2
  27. package/dist/{tailwind-calendar-C3DidCJ5.js.map → tailwind-calendar-CNhXkxzW.js.map} +1 -1
  28. package/dist/{tailwind-calendar-iFeIx0Ci.cjs → tailwind-calendar-VRvPJQwa.cjs} +2 -2
  29. package/dist/{tailwind-calendar-iFeIx0Ci.cjs.map → tailwind-calendar-VRvPJQwa.cjs.map} +1 -1
  30. package/dist/week-view-C1Vu2ErD.cjs +11 -0
  31. package/dist/week-view-C1Vu2ErD.cjs.map +1 -0
  32. package/dist/{week-view-CNbtlkE_.js → week-view-DY167Wok.js} +700 -670
  33. package/dist/week-view-DY167Wok.js.map +1 -0
  34. package/package.json +1 -1
  35. package/dist/agenda-widget-BtjS59HE.cjs +0 -2
  36. package/dist/agenda-widget-BtjS59HE.cjs.map +0 -1
  37. package/dist/agenda-widget-COpTIR70.js.map +0 -1
  38. package/dist/slot-selection-context-CKGT_45R.js +0 -598
  39. package/dist/slot-selection-context-CS1te8uo.cjs +0 -2
  40. package/dist/week-view-B9_48WmF.cjs +0 -11
  41. package/dist/week-view-B9_48WmF.cjs.map +0 -1
  42. package/dist/week-view-CNbtlkE_.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { jsx as e, jsxs as r, Fragment as we } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as r, Fragment as be } from "react/jsx-runtime";
2
2
  import { g as it, u as pt, C as xt } from "./use-calendar-D8XaVe44.js";
3
- import { useCallback as F, useState as ie, useEffect as de, forwardRef as Ae, useRef as ae, useMemo as Q, useLayoutEffect as vt, useImperativeHandle as wt } from "react";
4
- import { c as g } from "./index-DtaLkIY8.js";
5
- import { P as lt, p as ct, o as dt, z as me, I as bt, J as yt, B as Ce, K as kt, L as Ue, x as fe, F as ge, y as pe, k as Nt, C as Ct, M as Ve, A as Dt, W as Mt, c as St, N as Et } from "./week-view-CNbtlkE_.js";
6
- import { j as Lt, D as Tt, I as Ht, e as zt, S as It } from "./slot-selection-context-CKGT_45R.js";
3
+ import { useCallback as O, useState as ie, useEffect as de, forwardRef as Ae, useRef as ae, useMemo as te, useLayoutEffect as vt, useImperativeHandle as wt } from "react";
4
+ import { c as p } from "./index-DtaLkIY8.js";
5
+ import { P as lt, p as ct, o as dt, z as fe, I as bt, J as yt, B as Ce, K as kt, L as Ue, x as ge, F as pe, y as xe, k as Nt, C as Ct, M as Ve, A as Dt, W as Mt, c as St, N as Et } from "./week-view-DY167Wok.js";
6
+ import { j as Lt, D as Tt, I as Ht, e as zt, S as It } from "./slot-selection-context-CRstOosL.js";
7
7
  import { az as ce, aQ as Pe, I as ut, an as jt, Z as At, a8 as Pt, n as ht, T as Wt } from "./position-utils-DMVQFywD.js";
8
8
  function Ft({ view: t, className: n = "" }) {
9
9
  return /* @__PURE__ */ e(
@@ -35,41 +35,41 @@ function Ye({ view: t, className: n }) {
35
35
  function kr(t) {
36
36
  const {
37
37
  events: n,
38
- resources: o,
39
- scheduleTypes: a,
38
+ resources: s,
39
+ scheduleTypes: o,
40
40
  initialView: i = "week",
41
- initialDate: l,
42
- initialFilters: p,
43
- preferences: h,
44
- locale: d,
41
+ initialDate: a,
42
+ initialFilters: f,
43
+ preferences: m,
44
+ locale: c,
45
45
  slots: v,
46
- renderEvent: b,
47
- onViewChange: w,
46
+ renderEvent: y,
47
+ onViewChange: b,
48
48
  onDateChange: A,
49
49
  onEventClick: $,
50
50
  onSlotSelect: P,
51
- onFiltersChange: W,
51
+ onFiltersChange: F,
52
52
  className: T,
53
- children: y
54
- } = t, z = it();
55
- if (z)
56
- return /* @__PURE__ */ e("div", { className: T, style: { position: "relative" }, children: y ?? /* @__PURE__ */ e(Ye, { view: z.view, className: T }) });
57
- const O = pt({
53
+ children: C
54
+ } = t, j = it();
55
+ if (j)
56
+ return /* @__PURE__ */ e("div", { className: T, style: { position: "relative" }, children: C ?? /* @__PURE__ */ e(Ye, { view: j.view, className: T }) });
57
+ const W = pt({
58
58
  events: n,
59
- resources: o,
60
- scheduleTypes: a,
59
+ resources: s,
60
+ scheduleTypes: o,
61
61
  initialView: i,
62
- initialDate: l,
63
- initialFilters: p,
64
- preferences: h,
65
- locale: d,
66
- onViewChange: w,
62
+ initialDate: a,
63
+ initialFilters: f,
64
+ preferences: m,
65
+ locale: c,
66
+ onViewChange: b,
67
67
  onDateChange: A,
68
68
  onEventClick: $,
69
69
  onSlotSelect: P,
70
- onFiltersChange: W
70
+ onFiltersChange: F
71
71
  });
72
- return /* @__PURE__ */ e(xt, { value: O, children: /* @__PURE__ */ e("div", { className: T, style: { position: "relative" }, children: y ?? /* @__PURE__ */ e(Ye, { view: O.view, className: T }) }) });
72
+ return /* @__PURE__ */ e(xt, { value: W, children: /* @__PURE__ */ e("div", { className: T, style: { position: "relative" }, children: C ?? /* @__PURE__ */ e(Ye, { view: W.view, className: T }) }) });
73
73
  }
74
74
  function $t({ className: t }) {
75
75
  return /* @__PURE__ */ r(
@@ -295,7 +295,7 @@ function Me({ className: t }) {
295
295
  strokeWidth: "2",
296
296
  strokeLinecap: "round",
297
297
  strokeLinejoin: "round",
298
- className: g("animate-spin", t),
298
+ className: p("animate-spin", t),
299
299
  children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
300
300
  }
301
301
  );
@@ -326,53 +326,53 @@ const Kt = {
326
326
  deleteConfirmTitle: "Delete Event",
327
327
  deleteConfirmDescription: "Are you sure you want to delete this event? This action cannot be undone."
328
328
  }, He = Ae(
329
- ({ onClick: t, label: n, children: o, className: a, variant: i = "ghost", ...l }, p) => /* @__PURE__ */ r(fe, { children: [
330
- /* @__PURE__ */ e(ge, { asChild: !0, children: /* @__PURE__ */ e(
329
+ ({ onClick: t, label: n, children: s, className: o, variant: i = "ghost", ...a }, f) => /* @__PURE__ */ r(ge, { children: [
330
+ /* @__PURE__ */ e(pe, { asChild: !0, children: /* @__PURE__ */ e(
331
331
  "button",
332
332
  {
333
333
  type: "button",
334
- ref: p,
334
+ ref: f,
335
335
  onClick: t,
336
- className: g(
336
+ className: p(
337
337
  "h-8 w-8 rounded-full flex items-center justify-center transition-colors",
338
338
  i === "ghost" && "hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",
339
339
  i === "destructive" && "hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",
340
- a
340
+ o
341
341
  ),
342
342
  "aria-label": n,
343
- ...l,
344
- children: o
343
+ ...a,
344
+ children: s
345
345
  }
346
346
  ) }),
347
- /* @__PURE__ */ e(pe, { side: "bottom", className: "text-xs", children: n })
347
+ /* @__PURE__ */ e(xe, { side: "bottom", className: "text-xs", children: n })
348
348
  ] })
349
349
  );
350
350
  He.displayName = "IconButton";
351
- function Gt({ src: t, alt: n, initials: o, className: a, isClient: i }) {
352
- const [l, p] = ie(!1);
351
+ function Gt({ src: t, alt: n, initials: s, className: o, isClient: i }) {
352
+ const [a, f] = ie(!1);
353
353
  return /* @__PURE__ */ e(
354
354
  "div",
355
355
  {
356
- className: g(
356
+ className: p(
357
357
  "relative h-7 w-7 rounded-full overflow-hidden shrink-0",
358
- a
358
+ o
359
359
  ),
360
- children: t && !l ? /* @__PURE__ */ e(
360
+ children: t && !a ? /* @__PURE__ */ e(
361
361
  "img",
362
362
  {
363
363
  src: t,
364
364
  alt: n,
365
365
  className: "h-full w-full object-cover",
366
- onError: () => p(!0)
366
+ onError: () => f(!0)
367
367
  }
368
368
  ) : /* @__PURE__ */ e(
369
369
  "div",
370
370
  {
371
- className: g(
371
+ className: p(
372
372
  "h-full w-full flex items-center justify-center text-[10px] font-medium",
373
373
  i ? "bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300" : "bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"
374
374
  ),
375
- children: o
375
+ children: s
376
376
  }
377
377
  )
378
378
  }
@@ -381,43 +381,43 @@ function Gt({ src: t, alt: n, initials: o, className: a, isClient: i }) {
381
381
  function Ke({
382
382
  participant: t,
383
383
  isEventCanceled: n = !1,
384
- labels: o
384
+ labels: s
385
385
  }) {
386
- const a = t.name || "Unknown", i = a.split(" ").map((A) => A[0]).join("").toUpperCase().slice(0, 2), l = t.isOrganizer ?? !1, p = t.isConfirmed, h = p === !0, d = p === !1, v = t.isClient ?? !1, b = t.profilePicture || t.avatar, w = n;
386
+ const o = t.name || "Unknown", i = o.split(" ").map((A) => A[0]).join("").toUpperCase().slice(0, 2), a = t.isOrganizer ?? !1, f = t.isConfirmed, m = f === !0, c = f === !1, v = t.isClient ?? !1, y = t.profilePicture || t.avatar, b = n;
387
387
  return /* @__PURE__ */ r(
388
388
  "div",
389
389
  {
390
- className: g(
390
+ className: p(
391
391
  "flex items-center gap-3 py-0",
392
- w && "opacity-60"
392
+ b && "opacity-60"
393
393
  ),
394
394
  children: [
395
395
  /* @__PURE__ */ r("div", { className: "relative", children: [
396
396
  /* @__PURE__ */ e(
397
397
  Gt,
398
398
  {
399
- src: b,
400
- alt: a,
399
+ src: y,
400
+ alt: o,
401
401
  initials: i,
402
402
  isClient: v,
403
- className: g(w && "grayscale")
403
+ className: p(b && "grayscale")
404
404
  }
405
405
  ),
406
- w || d ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(je, { className: "h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]" }) }) }) : h ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(Te, { className: "h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]" }) }) }) : null
406
+ b || c ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(je, { className: "h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]" }) }) }) : m ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(Te, { className: "h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]" }) }) }) : null
407
407
  ] }),
408
408
  /* @__PURE__ */ r("div", { className: "!h-fit min-w-0 gap-0", children: [
409
409
  /* @__PURE__ */ e("div", { className: "gap-0", children: /* @__PURE__ */ e(
410
410
  "span",
411
411
  {
412
- className: g(
412
+ className: p(
413
413
  "text-sm text-zinc-900 dark:text-zinc-100 truncate",
414
- w && "line-through text-zinc-500 dark:text-zinc-500"
414
+ b && "line-through text-zinc-500 dark:text-zinc-500"
415
415
  ),
416
- children: a
416
+ children: o
417
417
  }
418
418
  ) }),
419
- v && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children: o.client }),
420
- l && !w && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: o.organizer })
419
+ v && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children: s.client }),
420
+ a && !b && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: s.organizer })
421
421
  ] })
422
422
  ]
423
423
  }
@@ -426,13 +426,13 @@ function Ke({
426
426
  function Jt({
427
427
  open: t,
428
428
  onOpenChange: n,
429
- title: o,
430
- children: a
429
+ title: s,
430
+ children: o
431
431
  }) {
432
432
  return de(() => {
433
433
  if (!t) return;
434
- const i = (l) => {
435
- l.key === "Escape" && n(!1);
434
+ const i = (a) => {
435
+ a.key === "Escape" && n(!1);
436
436
  };
437
437
  return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
438
438
  }, [t, n]), de(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
@@ -449,20 +449,20 @@ function Jt({
449
449
  }
450
450
  ),
451
451
  /* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ r("div", { className: "bg-white dark:bg-zinc-900 rounded-2xl shadow-xl overflow-hidden", children: [
452
- o && /* @__PURE__ */ e("div", { className: "sr-only", children: o }),
453
- a
452
+ s && /* @__PURE__ */ e("div", { className: "sr-only", children: s }),
453
+ o
454
454
  ] }) })
455
455
  ] }) : null;
456
456
  }
457
457
  function qt({
458
458
  open: t,
459
459
  onOpenChange: n,
460
- title: o,
461
- description: a,
460
+ title: s,
461
+ description: o,
462
462
  cancelLabel: i,
463
- confirmLabel: l,
464
- onConfirm: p,
465
- isLoading: h
463
+ confirmLabel: a,
464
+ onConfirm: f,
465
+ isLoading: m
466
466
  }) {
467
467
  return t ? /* @__PURE__ */ r("div", { className: "fixed inset-0 z-[60]", children: [
468
468
  /* @__PURE__ */ e(
@@ -470,14 +470,14 @@ function qt({
470
470
  {
471
471
  className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
472
472
  onClick: () => n(!1),
473
- onKeyDown: (d) => {
474
- (d.key === "Enter" || d.key === " ") && n(!1);
473
+ onKeyDown: (c) => {
474
+ (c.key === "Enter" || c.key === " ") && n(!1);
475
475
  }
476
476
  }
477
477
  ),
478
478
  /* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ r("div", { className: "bg-white dark:bg-zinc-900 rounded-lg shadow-xl p-6", children: [
479
- /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: o }),
480
- /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: a }),
479
+ /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: s }),
480
+ /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: o }),
481
481
  /* @__PURE__ */ r("div", { className: "mt-4 flex justify-end gap-3", children: [
482
482
  /* @__PURE__ */ e(
483
483
  Ce,
@@ -493,12 +493,12 @@ function qt({
493
493
  {
494
494
  variant: "destructive",
495
495
  size: "sm",
496
- onClick: p,
497
- disabled: h,
496
+ onClick: f,
497
+ disabled: m,
498
498
  children: [
499
- h && /* @__PURE__ */ e(Me, { className: "h-4 w-4 mr-2" }),
499
+ m && /* @__PURE__ */ e(Me, { className: "h-4 w-4 mr-2" }),
500
500
  /* @__PURE__ */ e(mt, { className: "h-4 w-4 mr-2" }),
501
- l
501
+ a
502
502
  ]
503
503
  }
504
504
  )
@@ -514,12 +514,12 @@ function Xt(t, n) {
514
514
  });
515
515
  }
516
516
  function Qt(t, n) {
517
- const o = {
517
+ const s = {
518
518
  hour: "2-digit",
519
519
  minute: "2-digit",
520
520
  hour12: !1
521
521
  };
522
- return `${t.toLocaleTimeString(void 0, o)} – ${n.toLocaleTimeString(void 0, o)}`;
522
+ return `${t.toLocaleTimeString(void 0, s)} – ${n.toLocaleTimeString(void 0, s)}`;
523
523
  }
524
524
  function Zt(t) {
525
525
  return t.toLocaleDateString(void 0, {
@@ -531,72 +531,72 @@ function Zt(t) {
531
531
  });
532
532
  }
533
533
  function en(t) {
534
- const [n, o] = ie(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
534
+ const [n, s] = ie(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
535
535
  return de(() => {
536
536
  if (typeof window > "u") return;
537
- const a = window.matchMedia(t), i = (l) => o(l.matches);
538
- return a.addEventListener("change", i), () => a.removeEventListener("change", i);
537
+ const o = window.matchMedia(t), i = (a) => s(a.matches);
538
+ return o.addEventListener("change", i), () => o.removeEventListener("change", i);
539
539
  }, [t]), n;
540
540
  }
541
541
  function Ge({
542
542
  event: t,
543
543
  labels: n,
544
- isLoading: o,
545
- onClose: a,
544
+ isLoading: s,
545
+ onClose: o,
546
546
  onEdit: i,
547
- onDelete: l,
548
- onCancel: p,
549
- onAccept: h,
550
- onDecline: d,
547
+ onDelete: a,
548
+ onCancel: f,
549
+ onAccept: m,
550
+ onDecline: c,
551
551
  onConfirmMeeting: v,
552
- canEdit: b = !0,
553
- canDelete: w = !1,
552
+ canEdit: y = !0,
553
+ canDelete: b = !1,
554
554
  canCancel: A = !0,
555
555
  isCurrentUserParticipant: $ = !1,
556
556
  isCurrentUserClient: P = !1,
557
- currentUserAcceptStatus: W,
557
+ currentUserAcceptStatus: F,
558
558
  isAcceptLoading: T = !1,
559
- isDeclineLoading: y = !1,
560
- isConfirmLoading: z = !1,
561
- isDeleteLoading: O = !1,
559
+ isDeclineLoading: C = !1,
560
+ isConfirmLoading: j = !1,
561
+ isDeleteLoading: W = !1,
562
562
  renderParticipant: _,
563
- renderHeaderActions: D,
564
- renderCancelReason: K,
565
- renderDeleteConfirmation: E,
566
- formatDate: H = Xt,
563
+ renderHeaderActions: M,
564
+ renderCancelReason: G,
565
+ renderDeleteConfirmation: H,
566
+ formatDate: L = Xt,
567
567
  formatTimeRange: V = Qt
568
568
  }) {
569
- const [J, G] = ie(!1), B = !(t.isCanceled || t.meetingTookPlace), s = t.isRecurring ?? !1, m = t.participantDetails, N = t.participantsNames || [], L = m && m.length > 0, S = W === !0, Y = W === !1, R = $ && !P && B, se = L ? m.filter((M) => M.isConfirmed).length : t.isAccepted ? N.length : 0, ee = L ? m.length : N.length, Z = t.scheduleTypeColor || t.hexColor || "#039BE5", ve = F(() => t.startDate ? H(t.startDate) : n.noDateProvided, [t.startDate, H, n.noDateProvided]), ne = F(() => t.startDate && t.endDate ? V(t.startDate, t.endDate) : null, [t.startDate, t.endDate, V]), le = () => {
570
- a(), i?.(t);
571
- }, be = () => {
572
- a(), p?.(t);
573
- }, ue = () => {
574
- G(!0);
575
- }, f = () => {
576
- l?.(t), G(!1);
569
+ const [X, Q] = ie(!1), B = !(t.isCanceled || t.meetingTookPlace), d = t.isRecurring ?? !1, N = t.participantDetails, h = t.participantsNames || [], D = N && N.length > 0, w = F === !0, R = F === !1, K = $ && !P && B, Z = D ? N.filter((E) => E.isConfirmed).length : t.isAccepted ? h.length : 0, Y = D ? N.length : h.length, J = t.scheduleTypeColor || t.hexColor || "#039BE5", ue = O(() => t.startDate ? L(t.startDate) : n.noDateProvided, [t.startDate, L, n.noDateProvided]), se = O(() => t.startDate && t.endDate ? V(t.startDate, t.endDate) : null, [t.startDate, t.endDate, V]), le = () => {
570
+ o(), i?.(t);
571
+ }, we = () => {
572
+ o(), f?.(t);
573
+ }, he = () => {
574
+ Q(!0);
575
+ }, g = () => {
576
+ a?.(t), Q(!1);
577
577
  };
578
- return o ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(Me, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ r(me, { delayDuration: 300, children: [
578
+ return s ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(Me, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ r(fe, { delayDuration: 300, children: [
579
579
  /* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5 p-3", children: [
580
- /* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: D ? D({ onClose: a }) : /* @__PURE__ */ r(we, { children: [
581
- B && b && i && /* @__PURE__ */ e(He, { onClick: le, label: n.edit, children: /* @__PURE__ */ e($t, { className: "h-[18px] w-[18px]" }) }),
582
- B && A && p && /* @__PURE__ */ e(He, { onClick: be, label: n.cancel, children: /* @__PURE__ */ e(Ot, { className: "h-[18px] w-[18px]" }) }),
583
- w && l && /* @__PURE__ */ e(
580
+ /* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: M ? M({ onClose: o }) : /* @__PURE__ */ r(be, { children: [
581
+ B && y && i && /* @__PURE__ */ e(He, { onClick: le, label: n.edit, children: /* @__PURE__ */ e($t, { className: "h-[18px] w-[18px]" }) }),
582
+ B && A && f && /* @__PURE__ */ e(He, { onClick: we, label: n.cancel, children: /* @__PURE__ */ e(Ot, { className: "h-[18px] w-[18px]" }) }),
583
+ b && a && /* @__PURE__ */ e(
584
584
  He,
585
585
  {
586
- onClick: ue,
586
+ onClick: he,
587
587
  label: n.delete,
588
588
  variant: "destructive",
589
589
  children: /* @__PURE__ */ e(mt, { className: "h-[18px] w-[18px]" })
590
590
  }
591
591
  ),
592
- /* @__PURE__ */ e(He, { onClick: a, label: n.close, children: /* @__PURE__ */ e(je, { className: "h-[18px] w-[18px]" }) })
592
+ /* @__PURE__ */ e(He, { onClick: o, label: n.close, children: /* @__PURE__ */ e(je, { className: "h-[18px] w-[18px]" }) })
593
593
  ] }) }),
594
594
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
595
595
  /* @__PURE__ */ e(
596
596
  "div",
597
597
  {
598
598
  className: "w-4 h-4 rounded mt-1 shrink-0",
599
- style: { backgroundColor: Z }
599
+ style: { backgroundColor: J }
600
600
  }
601
601
  ),
602
602
  /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
@@ -604,7 +604,7 @@ function Ge({
604
604
  /* @__PURE__ */ e(
605
605
  "h2",
606
606
  {
607
- className: g(
607
+ className: p(
608
608
  "text-[22px] font-normal text-zinc-900 dark:text-zinc-100 leading-tight",
609
609
  t.isCanceled && "line-through opacity-60"
610
610
  ),
@@ -621,16 +621,16 @@ function Ge({
621
621
  ] })
622
622
  ] }),
623
623
  /* @__PURE__ */ r("div", { className: "mt-1 text-sm text-zinc-600 dark:text-zinc-400", children: [
624
- /* @__PURE__ */ e("span", { children: ve() }),
625
- ne() && /* @__PURE__ */ r(we, { children: [
624
+ /* @__PURE__ */ e("span", { children: ue() }),
625
+ se() && /* @__PURE__ */ r(be, { children: [
626
626
  /* @__PURE__ */ e("span", { className: "mx-1.5", children: "·" }),
627
- /* @__PURE__ */ e("span", { children: ne() })
627
+ /* @__PURE__ */ e("span", { children: se() })
628
628
  ] })
629
629
  ] }),
630
- s && t.recurrenceSummary && /* @__PURE__ */ e("div", { className: "text-sm text-zinc-500 dark:text-zinc-500", children: t.recurrenceSummary })
630
+ d && t.recurrenceSummary && /* @__PURE__ */ e("div", { className: "text-sm text-zinc-500 dark:text-zinc-500", children: t.recurrenceSummary })
631
631
  ] })
632
632
  ] }) }),
633
- t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children: K ? K(t) : /* @__PURE__ */ e("div", { className: "flex items-start gap-0", children: /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
633
+ t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children: G ? G(t) : /* @__PURE__ */ e("div", { className: "flex items-start gap-0", children: /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
634
634
  /* @__PURE__ */ e("div", { className: "text-sm font-medium text-red-700 dark:text-red-400", children: n.cancellationNote }),
635
635
  t.cancelReason && /* @__PURE__ */ r("div", { className: "mt-1 text-sm text-red-600/80 dark:text-red-400/80 italic", children: [
636
636
  '"',
@@ -648,38 +648,38 @@ function Ge({
648
648
  /* @__PURE__ */ e(Ut, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
649
649
  /* @__PURE__ */ e("span", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: t.address })
650
650
  ] }),
651
- (L || N.length > 0) && /* @__PURE__ */ r("div", { className: "flex items-start gap-2 py-0", children: [
651
+ (D || h.length > 0) && /* @__PURE__ */ r("div", { className: "flex items-start gap-2 py-0", children: [
652
652
  /* @__PURE__ */ e(Rt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
653
653
  /* @__PURE__ */ r("div", { className: "flex-1", children: [
654
654
  /* @__PURE__ */ r("div", { className: "flex items-center gap-0", children: [
655
655
  /* @__PURE__ */ r("span", { className: "text-sm text-zinc-900 dark:text-zinc-100 font-medium", children: [
656
- ee,
656
+ Y,
657
657
  " ",
658
- ee !== 1 ? n.guests : n.guest
658
+ Y !== 1 ? n.guests : n.guest
659
659
  ] }),
660
- ee > 0 && /* @__PURE__ */ r("span", { className: "text-xs text-zinc-500", children: [
660
+ Y > 0 && /* @__PURE__ */ r("span", { className: "text-xs text-zinc-500", children: [
661
661
  "(",
662
- se,
662
+ Z,
663
663
  " ",
664
664
  n.confirmed,
665
665
  ")"
666
666
  ] })
667
667
  ] }),
668
668
  /* @__PURE__ */ r("div", { className: "mt-2 space-y-2", children: [
669
- L ? m.slice(0, 6).map(
670
- (M, U) => _ ? _(M, U) : /* @__PURE__ */ e(
669
+ D ? N.slice(0, 6).map(
670
+ (E, U) => _ ? _(E, U) : /* @__PURE__ */ e(
671
671
  Ke,
672
672
  {
673
- participant: M,
673
+ participant: E,
674
674
  isEventCanceled: t.isCanceled,
675
675
  labels: n
676
676
  },
677
- M.id
677
+ E.id
678
678
  )
679
- ) : N.slice(0, 6).map((M, U) => {
679
+ ) : h.slice(0, 6).map((E, U) => {
680
680
  const re = {
681
681
  id: String(U),
682
- name: M,
682
+ name: E,
683
683
  email: "",
684
684
  isConfirmed: t.isAccepted,
685
685
  isOrganizer: U === 0,
@@ -692,12 +692,12 @@ function Ge({
692
692
  isEventCanceled: t.isCanceled,
693
693
  labels: n
694
694
  },
695
- M
695
+ E
696
696
  );
697
697
  }),
698
- ee > 6 && /* @__PURE__ */ r("div", { className: "text-xs text-zinc-500 py-1.5 pl-10", children: [
698
+ Y > 6 && /* @__PURE__ */ r("div", { className: "text-xs text-zinc-500 py-1.5 pl-10", children: [
699
699
  "+",
700
- ee - 6,
700
+ Y - 6,
701
701
  " ",
702
702
  n.more
703
703
  ] })
@@ -710,27 +710,27 @@ function Ge({
710
710
  ] }),
711
711
  /* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
712
712
  /* @__PURE__ */ e(Vt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
713
- /* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: L && m.find((M) => M.isOrganizer)?.name || N[0] || "Calendar" })
713
+ /* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: D && N.find((E) => E.isOrganizer)?.name || h[0] || "Calendar" })
714
714
  ] })
715
715
  ] }),
716
- R && h && d && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
717
- s ? /* @__PURE__ */ r(bt, { children: [
716
+ K && m && c && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
717
+ d ? /* @__PURE__ */ r(bt, { children: [
718
718
  /* @__PURE__ */ e(yt, { asChild: !0, children: /* @__PURE__ */ r("div", { className: "flex", children: [
719
719
  /* @__PURE__ */ e(
720
720
  Ce,
721
721
  {
722
722
  size: "sm",
723
723
  variant: "outline",
724
- className: g(
724
+ className: p(
725
725
  "rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
726
- S && "!bg-green-700 !text-white hover:!bg-green-700"
726
+ w && "!bg-green-700 !text-white hover:!bg-green-700"
727
727
  ),
728
- onClick: (M) => {
729
- M.stopPropagation(), S || h(t);
728
+ onClick: (E) => {
729
+ E.stopPropagation(), w || m(t);
730
730
  },
731
731
  disabled: T,
732
- children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(we, { children: [
733
- S && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
732
+ children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(be, { children: [
733
+ w && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
734
734
  n.going
735
735
  ] })
736
736
  }
@@ -740,9 +740,9 @@ function Ge({
740
740
  {
741
741
  size: "sm",
742
742
  variant: "outline",
743
- className: g(
743
+ className: p(
744
744
  "rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
745
- S && "!bg-green-700 !text-white hover:!bg-green-700"
745
+ w && "!bg-green-700 !text-white hover:!bg-green-700"
746
746
  ),
747
747
  children: /* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" })
748
748
  }
@@ -752,18 +752,18 @@ function Ge({
752
752
  /* @__PURE__ */ r(
753
753
  Ue,
754
754
  {
755
- className: g(
755
+ className: p(
756
756
  "gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",
757
- S && "!bg-green-700 !text-white hover:!bg-green-700"
757
+ w && "!bg-green-700 !text-white hover:!bg-green-700"
758
758
  ),
759
- onClick: () => h(t),
759
+ onClick: () => m(t),
760
760
  children: [
761
761
  /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
762
762
  n.acceptThisEvent
763
763
  ]
764
764
  }
765
765
  ),
766
- /* @__PURE__ */ r(Ue, { onClick: () => h(t), children: [
766
+ /* @__PURE__ */ r(Ue, { onClick: () => m(t), children: [
767
767
  /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
768
768
  n.acceptAllEvents
769
769
  ] })
@@ -773,16 +773,16 @@ function Ge({
773
773
  {
774
774
  size: "sm",
775
775
  variant: "outline",
776
- className: g(
776
+ className: p(
777
777
  "gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
778
- S && "!bg-green-700 !text-white hover:!bg-green-700"
778
+ w && "!bg-green-700 !text-white hover:!bg-green-700"
779
779
  ),
780
780
  onClick: () => {
781
- S || h(t);
781
+ w || m(t);
782
782
  },
783
783
  disabled: T,
784
- children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(we, { children: [
785
- S && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
784
+ children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(be, { children: [
785
+ w && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
786
786
  n.going
787
787
  ] })
788
788
  }
@@ -792,51 +792,51 @@ function Ge({
792
792
  {
793
793
  size: "sm",
794
794
  variant: "outline",
795
- className: g(
795
+ className: p(
796
796
  "gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",
797
- Y && "!bg-rose-700 !text-white hover:!bg-rose-700"
797
+ R && "!bg-rose-700 !text-white hover:!bg-rose-700"
798
798
  ),
799
799
  onClick: () => {
800
- Y || d(t);
800
+ R || c(t);
801
801
  },
802
- disabled: y,
803
- children: y ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(we, { children: [
804
- Y && /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" }),
802
+ disabled: C,
803
+ children: C ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(be, { children: [
804
+ R && /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" }),
805
805
  n.notGoing
806
806
  ] })
807
807
  }
808
808
  )
809
809
  ] }) }),
810
- $ && S && !t.meetingTookPlace && !t.isCanceled && v && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 py-3", children: /* @__PURE__ */ r(
810
+ $ && w && !t.meetingTookPlace && !t.isCanceled && v && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 py-3", children: /* @__PURE__ */ r(
811
811
  Ce,
812
812
  {
813
813
  size: "sm",
814
814
  variant: "outline",
815
815
  className: "w-full h-9 hover:!bg-green-100 hover:text-green-700 text-green-700 !bg-green-100 !border-none dark:text-green-400 dark:hover:bg-green-950/30",
816
816
  onClick: () => v(t),
817
- disabled: z,
817
+ disabled: j,
818
818
  children: [
819
- z && /* @__PURE__ */ e(Me, { className: "h-4 w-4 mr-2" }),
819
+ j && /* @__PURE__ */ e(Me, { className: "h-4 w-4 mr-2" }),
820
820
  n.confirmMeeting
821
821
  ]
822
822
  }
823
823
  ) })
824
824
  ] }),
825
- E ? J && E({
826
- onConfirm: f,
827
- onCancel: () => G(!1),
828
- isLoading: O
825
+ H ? X && H({
826
+ onConfirm: g,
827
+ onCancel: () => Q(!1),
828
+ isLoading: W
829
829
  }) : /* @__PURE__ */ e(
830
830
  qt,
831
831
  {
832
- open: J,
833
- onOpenChange: G,
832
+ open: X,
833
+ onOpenChange: Q,
834
834
  title: n.deleteConfirmTitle,
835
835
  description: n.deleteConfirmDescription,
836
836
  cancelLabel: n.cancel,
837
837
  confirmLabel: n.delete,
838
- onConfirm: f,
839
- isLoading: O
838
+ onConfirm: g,
839
+ isLoading: W
840
840
  }
841
841
  )
842
842
  ] });
@@ -844,92 +844,92 @@ function Ge({
844
844
  function Nr({
845
845
  event: t,
846
846
  children: n,
847
- open: o,
848
- onOpenChange: a,
847
+ open: s,
848
+ onOpenChange: o,
849
849
  isLoading: i,
850
- labels: l,
851
- onEdit: p,
852
- onDelete: h,
853
- onCancel: d,
850
+ labels: a,
851
+ onEdit: f,
852
+ onDelete: m,
853
+ onCancel: c,
854
854
  onAccept: v,
855
- onDecline: b,
856
- onConfirmMeeting: w,
855
+ onDecline: y,
856
+ onConfirmMeeting: b,
857
857
  canEdit: A = !0,
858
858
  canDelete: $ = !1,
859
859
  canCancel: P = !0,
860
- isCurrentUserParticipant: W,
860
+ isCurrentUserParticipant: F,
861
861
  isCurrentUserClient: T,
862
- currentUserAcceptStatus: y,
863
- isAcceptLoading: z,
864
- isDeclineLoading: O,
862
+ currentUserAcceptStatus: C,
863
+ isAcceptLoading: j,
864
+ isDeclineLoading: W,
865
865
  isConfirmLoading: _,
866
- isDeleteLoading: D,
867
- renderParticipant: K,
868
- renderHeaderActions: E,
869
- renderCancelReason: H,
866
+ isDeleteLoading: M,
867
+ renderParticipant: G,
868
+ renderHeaderActions: H,
869
+ renderCancelReason: L,
870
870
  renderDeleteConfirmation: V,
871
- formatDate: J,
872
- formatTimeRange: G,
871
+ formatDate: X,
872
+ formatTimeRange: Q,
873
873
  className: B,
874
- width: s = 360
874
+ width: d = 360
875
875
  }) {
876
- const m = en("(min-width: 768px)"), N = { ...Kt, ...l }, L = F(() => {
877
- a?.(!1);
878
- }, [a]), S = {
876
+ const N = en("(min-width: 768px)"), h = { ...Kt, ...a }, D = O(() => {
877
+ o?.(!1);
878
+ }, [o]), w = {
879
879
  event: t,
880
- labels: N,
880
+ labels: h,
881
881
  isLoading: i,
882
- onClose: L,
883
- onEdit: p,
884
- onDelete: h,
885
- onCancel: d,
882
+ onClose: D,
883
+ onEdit: f,
884
+ onDelete: m,
885
+ onCancel: c,
886
886
  onAccept: v,
887
- onDecline: b,
888
- onConfirmMeeting: w,
887
+ onDecline: y,
888
+ onConfirmMeeting: b,
889
889
  canEdit: A,
890
890
  canDelete: $,
891
891
  canCancel: P,
892
- isCurrentUserParticipant: W,
892
+ isCurrentUserParticipant: F,
893
893
  isCurrentUserClient: T,
894
- currentUserAcceptStatus: y,
895
- isAcceptLoading: z,
896
- isDeclineLoading: O,
894
+ currentUserAcceptStatus: C,
895
+ isAcceptLoading: j,
896
+ isDeclineLoading: W,
897
897
  isConfirmLoading: _,
898
- isDeleteLoading: D,
899
- renderParticipant: K,
900
- renderHeaderActions: E,
901
- renderCancelReason: H,
898
+ isDeleteLoading: M,
899
+ renderParticipant: G,
900
+ renderHeaderActions: H,
901
+ renderCancelReason: L,
902
902
  renderDeleteConfirmation: V,
903
- formatDate: J,
904
- formatTimeRange: G
903
+ formatDate: X,
904
+ formatTimeRange: Q
905
905
  };
906
- return m ? /* @__PURE__ */ r(lt, { open: o ?? !1, onOpenChange: a ?? (() => {
906
+ return N ? /* @__PURE__ */ r(lt, { open: s ?? !1, onOpenChange: o ?? (() => {
907
907
  }), children: [
908
908
  /* @__PURE__ */ e(ct, { asChild: !0, children: n }),
909
909
  /* @__PURE__ */ e(
910
910
  dt,
911
911
  {
912
- className: g(
912
+ className: p(
913
913
  "p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",
914
914
  B
915
915
  ),
916
- style: { width: s },
916
+ style: { width: d },
917
917
  align: "center",
918
918
  side: "bottom",
919
919
  sideOffset: 4,
920
- children: /* @__PURE__ */ e(Ge, { ...S })
920
+ children: /* @__PURE__ */ e(Ge, { ...w })
921
921
  }
922
922
  )
923
- ] }) : /* @__PURE__ */ r(we, { children: [
923
+ ] }) : /* @__PURE__ */ r(be, { children: [
924
924
  n,
925
925
  /* @__PURE__ */ e(
926
926
  Jt,
927
927
  {
928
- open: o ?? !1,
929
- onOpenChange: a ?? (() => {
928
+ open: s ?? !1,
929
+ onOpenChange: o ?? (() => {
930
930
  }),
931
931
  title: t.title,
932
- children: /* @__PURE__ */ e(Ge, { ...S })
932
+ children: /* @__PURE__ */ e(Ge, { ...w })
933
933
  }
934
934
  )
935
935
  ] });
@@ -939,19 +939,19 @@ function on(t) {
939
939
  return t.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2);
940
940
  }
941
941
  function sn(t, n) {
942
- const o = [];
943
- for (let a = 0; a < n; a++) {
942
+ const s = [];
943
+ for (let o = 0; o < n; o++) {
944
944
  const i = new Date(t);
945
- i.setDate(i.getDate() + a), o.push(i);
945
+ i.setDate(i.getDate() + o), s.push(i);
946
946
  }
947
- return o;
947
+ return s;
948
948
  }
949
- function an(t, n, o) {
950
- const a = [];
951
- return t.forEach((i, l) => {
952
- for (let p = n; p < o; p++)
953
- a.push({ hour: p, dayIndex: l, date: i });
954
- }), a;
949
+ function an(t, n, s) {
950
+ const o = [];
951
+ return t.forEach((i, a) => {
952
+ for (let f = n; f < s; f++)
953
+ o.push({ hour: f, dayIndex: a, date: i });
954
+ }), o;
955
955
  }
956
956
  function Fe(t) {
957
957
  return `${t.toString().padStart(2, "0")}:00`;
@@ -964,25 +964,25 @@ function ln(t) {
964
964
  });
965
965
  }
966
966
  function Ze(t) {
967
- const n = [...t].sort((i, l) => i.startCol !== l.startCol ? i.startCol - l.startCol : l.spanCols - i.spanCols), o = [], a = [];
967
+ const n = [...t].sort((i, a) => i.startCol !== a.startCol ? i.startCol - a.startCol : a.spanCols - i.spanCols), s = [], o = [];
968
968
  for (const i of n) {
969
- let l = 0;
970
- for (; a[l] !== void 0 && a[l] > i.startCol; )
971
- l++;
972
- a[l] = i.startCol + i.spanCols, o.push({
969
+ let a = 0;
970
+ for (; o[a] !== void 0 && o[a] > i.startCol; )
971
+ a++;
972
+ o[a] = i.startCol + i.spanCols, s.push({
973
973
  ...i,
974
- stackIndex: l
974
+ stackIndex: a
975
975
  });
976
976
  }
977
- return o;
977
+ return s;
978
978
  }
979
- function cn({ src: t, alt: n, fallback: o, className: a }) {
979
+ function cn({ src: t, alt: n, fallback: s, className: o }) {
980
980
  return /* @__PURE__ */ e(
981
981
  "div",
982
982
  {
983
- className: g(
983
+ className: p(
984
984
  "relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",
985
- a
985
+ o
986
986
  ),
987
987
  children: t ? /* @__PURE__ */ e(
988
988
  "img",
@@ -991,7 +991,7 @@ function cn({ src: t, alt: n, fallback: o, className: a }) {
991
991
  alt: n,
992
992
  className: "aspect-square h-full w-full object-cover"
993
993
  }
994
- ) : /* @__PURE__ */ e("div", { className: "flex h-full w-full items-center justify-center bg-muted text-muted-foreground", children: o })
994
+ ) : /* @__PURE__ */ e("div", { className: "flex h-full w-full items-center justify-center bg-muted text-muted-foreground", children: s })
995
995
  }
996
996
  );
997
997
  }
@@ -999,44 +999,44 @@ const dn = 7;
999
999
  function Le({
1000
1000
  daysToShow: t = dn,
1001
1001
  events: n,
1002
- users: o = [],
1003
- selectedDate: a,
1002
+ users: s = [],
1003
+ selectedDate: o,
1004
1004
  onDateChange: i,
1005
- onEventClick: l,
1006
- onSlotClick: p,
1007
- onSlotSelect: h,
1008
- visibleHours: d,
1005
+ onEventClick: a,
1006
+ onSlotClick: f,
1007
+ onSlotSelect: m,
1008
+ visibleHours: c,
1009
1009
  className: v,
1010
- getEventUserId: b,
1011
- renderPopover: w,
1010
+ getEventUserId: y,
1011
+ renderPopover: b,
1012
1012
  slots: A,
1013
1013
  classNames: $,
1014
1014
  enableDrag: P = !0
1015
1015
  }) {
1016
- const W = ae(null), T = Lt(), [y, z] = ie(null), O = ae(!1), [_, D] = ie(null), K = a ?? /* @__PURE__ */ new Date(), E = !0, H = d?.from ?? nn, V = d?.to ?? rn, J = V - H, G = Q(() => {
1017
- const c = new Date(K);
1016
+ const F = ae(null), T = Lt(), [C, j] = ie(null), W = ae(!1), [_, M] = ie(null), G = o ?? /* @__PURE__ */ new Date(), H = !0, L = c?.from ?? nn, V = c?.to ?? rn, X = V - L, Q = te(() => {
1017
+ const l = new Date(G);
1018
1018
  if (t === 1 || t === 3)
1019
- return c.setHours(0, 0, 0, 0), c;
1020
- const u = c.getDay(), x = u === 0 ? -6 : 1 - u;
1021
- return c.setDate(c.getDate() + x), c.setHours(0, 0, 0, 0), c;
1022
- }, [K, t]), B = Q(
1023
- () => sn(G, t),
1024
- [G, t]
1025
- ), s = Q(
1026
- () => an(B, H, V),
1027
- [E, B, H, V]
1028
- ), N = b ?? ((c) => {
1029
- if (c.resourceId) return c.resourceId;
1030
- const u = c.data;
1019
+ return l.setHours(0, 0, 0, 0), l;
1020
+ const u = l.getDay(), x = u === 0 ? -6 : 1 - u;
1021
+ return l.setDate(l.getDate() + x), l.setHours(0, 0, 0, 0), l;
1022
+ }, [G, t]), B = te(
1023
+ () => sn(Q, t),
1024
+ [Q, t]
1025
+ ), d = te(
1026
+ () => an(B, L, V),
1027
+ [H, B, L, V]
1028
+ ), h = y ?? ((l) => {
1029
+ if (l.resourceId) return l.resourceId;
1030
+ const u = l.data;
1031
1031
  if (u?.userId) return String(u.userId);
1032
1032
  if (u?.user && typeof u.user == "object" && u.user.id)
1033
1033
  return String(u.user.id);
1034
- if (c.user?.id) return c.user.id;
1035
- if (c.participants?.[0]?.id) return c.participants[0].id;
1036
- }), L = Q(() => {
1037
- const c = /* @__PURE__ */ new Map();
1038
- for (const u of o)
1039
- c.set(u.id, {
1034
+ if (l.user?.id) return l.user.id;
1035
+ if (l.participants?.[0]?.id) return l.participants[0].id;
1036
+ }), D = te(() => {
1037
+ const l = /* @__PURE__ */ new Map();
1038
+ for (const u of s)
1039
+ l.set(u.id, {
1040
1040
  id: u.id,
1041
1041
  name: u.name,
1042
1042
  avatar: u.avatar ?? void 0,
@@ -1044,53 +1044,53 @@ function Le({
1044
1044
  });
1045
1045
  for (const u of n) {
1046
1046
  const k = u.data?.user;
1047
- k?.id && !c.has(k.id) && c.set(k.id, {
1047
+ k?.id && !l.has(k.id) && l.set(k.id, {
1048
1048
  id: k.id,
1049
1049
  name: k.name ?? "",
1050
1050
  avatar: k.avatar ?? void 0,
1051
1051
  email: k.email
1052
- }), u.user?.id && !c.has(u.user.id) && c.set(u.user.id, {
1052
+ }), u.user?.id && !l.has(u.user.id) && l.set(u.user.id, {
1053
1053
  id: u.user.id,
1054
1054
  name: u.user.name,
1055
1055
  avatar: u.user.avatar ?? void 0,
1056
1056
  email: u.user.email
1057
1057
  });
1058
- for (const C of u.participants || [])
1059
- C.id && !c.has(C.id) && c.set(C.id, {
1060
- id: C.id,
1061
- name: C.name,
1062
- avatar: C.avatar ?? void 0,
1063
- email: C.email
1058
+ for (const S of u.participants || [])
1059
+ S.id && !l.has(S.id) && l.set(S.id, {
1060
+ id: S.id,
1061
+ name: S.name,
1062
+ avatar: S.avatar ?? void 0,
1063
+ email: S.email
1064
1064
  });
1065
1065
  }
1066
- return Array.from(c.values());
1067
- }, [o, n]), S = Q(() => {
1068
- const c = [], u = /* @__PURE__ */ new Map();
1069
- for (const C of L)
1070
- u.set(C.id, []);
1066
+ return Array.from(l.values());
1067
+ }, [s, n]), w = te(() => {
1068
+ const l = [], u = /* @__PURE__ */ new Map();
1069
+ for (const S of D)
1070
+ u.set(S.id, []);
1071
1071
  u.set("unassigned", []);
1072
- for (const C of n) {
1073
- const I = N(C) ?? "unassigned";
1074
- (u.get(I) ?? u.get("unassigned")).push(C);
1072
+ for (const S of n) {
1073
+ const z = h(S) ?? "unassigned";
1074
+ (u.get(z) ?? u.get("unassigned")).push(S);
1075
1075
  }
1076
- const x = (C) => {
1077
- const I = [];
1078
- for (const j of C) {
1079
- const q = j.startDate.getHours() + j.startDate.getMinutes() / 60, te = j.endDate.getHours() + j.endDate.getMinutes() / 60;
1080
- for (let X = 0; X < B.length; X++) {
1081
- const oe = B[X], ye = Pe(oe), ke = ut(oe);
1082
- if (j.startDate <= ke && j.endDate >= ye) {
1083
- let Ne = H, Se = V;
1084
- if (j.startDate >= ye && (Ne = Math.max(H, q)), j.endDate <= ke && (Se = Math.min(V, te)), Ne = Math.max(
1085
- H,
1076
+ const x = (S) => {
1077
+ const z = [];
1078
+ for (const I of S) {
1079
+ const ee = I.startDate.getHours() + I.startDate.getMinutes() / 60, ne = I.endDate.getHours() + I.endDate.getMinutes() / 60;
1080
+ for (let q = 0; q < B.length; q++) {
1081
+ const oe = B[q], ye = Pe(oe), ke = ut(oe);
1082
+ if (I.startDate <= ke && I.endDate >= ye) {
1083
+ let Ne = L, Se = V;
1084
+ if (I.startDate >= ye && (Ne = Math.max(L, ee)), I.endDate <= ke && (Se = Math.min(V, ne)), Ne = Math.max(
1085
+ L,
1086
1086
  Math.min(V, Ne)
1087
1087
  ), Se = Math.max(
1088
- H,
1088
+ L,
1089
1089
  Math.min(V, Se)
1090
1090
  ), Se > Ne) {
1091
- const Re = X * J + Math.floor(Ne - H), gt = X * J + Math.ceil(Se - H);
1092
- I.push({
1093
- event: j,
1091
+ const Re = q * X + Math.floor(Ne - L), gt = q * X + Math.ceil(Se - L);
1092
+ z.push({
1093
+ event: I,
1094
1094
  startCol: Re,
1095
1095
  spanCols: Math.max(1, gt - Re)
1096
1096
  });
@@ -1098,105 +1098,105 @@ function Le({
1098
1098
  }
1099
1099
  }
1100
1100
  }
1101
- return I;
1101
+ return z;
1102
1102
  };
1103
- for (const C of L) {
1104
- const I = u.get(C.id) ?? [], j = x(I), q = Ze(j), te = q.reduce(
1105
- (X, oe) => Math.max(X, oe.stackIndex + 1),
1103
+ for (const S of D) {
1104
+ const z = u.get(S.id) ?? [], I = x(z), ee = Ze(I), ne = ee.reduce(
1105
+ (q, oe) => Math.max(q, oe.stackIndex + 1),
1106
1106
  0
1107
1107
  );
1108
- c.push({
1109
- user: C,
1110
- events: q,
1111
- maxStack: Math.max(te, 1)
1108
+ l.push({
1109
+ user: S,
1110
+ events: ee,
1111
+ maxStack: Math.max(ne, 1)
1112
1112
  });
1113
1113
  }
1114
1114
  const k = u.get("unassigned") ?? [];
1115
1115
  if (k.length > 0) {
1116
- const C = x(k), I = Ze(C), j = I.reduce(
1117
- (q, te) => Math.max(q, te.stackIndex + 1),
1116
+ const S = x(k), z = Ze(S), I = z.reduce(
1117
+ (ee, ne) => Math.max(ee, ne.stackIndex + 1),
1118
1118
  0
1119
1119
  );
1120
- c.push({
1120
+ l.push({
1121
1121
  user: {
1122
1122
  id: "unassigned",
1123
1123
  name: "Unassigned",
1124
1124
  avatar: void 0,
1125
1125
  email: void 0
1126
1126
  },
1127
- events: I,
1128
- maxStack: Math.max(j, 1)
1127
+ events: z,
1128
+ maxStack: Math.max(I, 1)
1129
1129
  });
1130
1130
  }
1131
- return c.filter((C) => C.events.length > 0);
1131
+ return l;
1132
1132
  }, [
1133
- L,
1133
+ D,
1134
1134
  n,
1135
1135
  B,
1136
- E,
1137
- J,
1138
1136
  H,
1137
+ X,
1138
+ L,
1139
1139
  V,
1140
- N
1141
- ]), Y = Q(() => {
1142
- const c = /* @__PURE__ */ new Map();
1143
- for (const u of S)
1140
+ h
1141
+ ]), R = te(() => {
1142
+ const l = /* @__PURE__ */ new Map();
1143
+ for (const u of w)
1144
1144
  for (const x of u.events)
1145
1145
  if (x.spanCols === 1) {
1146
- const k = c.get(x.startCol) ?? 0;
1147
- c.set(x.startCol, k + 1);
1146
+ const k = l.get(x.startCol) ?? 0;
1147
+ l.set(x.startCol, k + 1);
1148
1148
  }
1149
- return c;
1150
- }, [S]), R = Q(() => {
1151
- const c = s.length, u = ze, x = [];
1152
- for (let k = 0; k < c; k++) {
1153
- const C = Y.get(k) ?? 0;
1154
- C > Qe ? x.push(
1155
- Xe + (C - Qe) * 20
1156
- ) : C > 0 ? x.push(Math.max(u, Xe)) : x.push(u);
1149
+ return l;
1150
+ }, [w]), K = te(() => {
1151
+ const l = d.length, u = ze, x = [];
1152
+ for (let k = 0; k < l; k++) {
1153
+ const S = R.get(k) ?? 0;
1154
+ S > Qe ? x.push(
1155
+ Xe + (S - Qe) * 20
1156
+ ) : S > 0 ? x.push(Math.max(u, Xe)) : x.push(u);
1157
1157
  }
1158
1158
  return x;
1159
1159
  }, [
1160
- E,
1161
- s.length,
1160
+ H,
1161
+ d.length,
1162
1162
  B.length,
1163
- Y
1164
- ]), se = (c) => Math.max(
1163
+ R
1164
+ ]), Z = (l) => Math.max(
1165
1165
  tn,
1166
- c * (We + Je) + qe * 2
1167
- ), ee = Ee + R.reduce((c, u) => c + u, 0), Z = Q(() => {
1168
- const c = [0];
1169
- for (let u = 0; u < R.length; u++)
1170
- c.push(c[u] + R[u]);
1171
- return c;
1172
- }, [R]);
1166
+ l * (We + Je) + qe * 2
1167
+ ), Y = Ee + K.reduce((l, u) => l + u, 0), J = te(() => {
1168
+ const l = [0];
1169
+ for (let u = 0; u < K.length; u++)
1170
+ l.push(l[u] + K[u]);
1171
+ return l;
1172
+ }, [K]);
1173
1173
  vt(() => {
1174
- const c = W.current;
1175
- if (!c) return;
1174
+ const l = F.current;
1175
+ if (!l) return;
1176
1176
  const u = () => {
1177
1177
  let x = -1;
1178
- const C = (/* @__PURE__ */ new Date()).getHours();
1178
+ const S = (/* @__PURE__ */ new Date()).getHours();
1179
1179
  {
1180
- for (let I = 0; I < s.length; I++) {
1181
- const j = s[I];
1182
- if (j && ce(j.date) && j.hour <= C && j.hour + 1 > C) {
1183
- x = I;
1180
+ for (let z = 0; z < d.length; z++) {
1181
+ const I = d[z];
1182
+ if (I && ce(I.date) && I.hour <= S && I.hour + 1 > S) {
1183
+ x = z;
1184
1184
  break;
1185
1185
  }
1186
1186
  }
1187
1187
  if (x === -1)
1188
- for (let I = 0; I < s.length; I++) {
1189
- const j = s[I];
1190
- if (j && ce(j.date)) {
1191
- x = I;
1188
+ for (let z = 0; z < d.length; z++) {
1189
+ const I = d[z];
1190
+ if (I && ce(I.date)) {
1191
+ x = z;
1192
1192
  break;
1193
1193
  }
1194
1194
  }
1195
1195
  }
1196
1196
  if (x !== -1) {
1197
- const I = (Z[x] ?? 0) + Ee, j = c.clientWidth, q = Math.max(0, I - j / 3);
1198
- c.scrollTo({
1199
- left: q,
1197
+ const z = (J[x] ?? 0) + Ee, I = l.clientWidth, ee = Math.max(0, z - I / 3);
1198
+ l.scrollTo({
1199
+ left: ee,
1200
1200
  behavior: "instant"
1201
1201
  });
1202
1202
  }
@@ -1204,104 +1204,104 @@ function Le({
1204
1204
  requestAnimationFrame(() => {
1205
1205
  requestAnimationFrame(u);
1206
1206
  });
1207
- }, [K, s, B, Z, E]);
1208
- const ve = F(
1209
- (c, u) => {
1210
- const x = u.getBoundingClientRect(), k = c - x.left + u.scrollLeft;
1211
- for (let C = 0; C < Z.length - 1; C++) {
1212
- const I = Z[C], j = Z[C + 1];
1213
- if (k >= I && k < j) {
1214
- const q = (k - I) / (j - I), te = Math.floor(q * 60), X = Math.round(te / 15) * 15;
1215
- return { colIndex: C, minute: Math.min(X, 45) };
1207
+ }, [G, d, B, J, H]);
1208
+ const ue = O(
1209
+ (l, u) => {
1210
+ const x = u.getBoundingClientRect(), k = l - x.left + u.scrollLeft;
1211
+ for (let S = 0; S < J.length - 1; S++) {
1212
+ const z = J[S], I = J[S + 1];
1213
+ if (k >= z && k < I) {
1214
+ const ee = (k - z) / (I - z), ne = Math.floor(ee * 60), q = Math.round(ne / 15) * 15;
1215
+ return { colIndex: S, minute: Math.min(q, 45) };
1216
1216
  }
1217
1217
  }
1218
1218
  return null;
1219
1219
  },
1220
- [Z]
1221
- ), ne = F(
1222
- (c, u) => {
1223
- if (s[c]) {
1224
- const x = s[c], k = new Date(x.date);
1220
+ [J]
1221
+ ), se = O(
1222
+ (l, u) => {
1223
+ if (d[l]) {
1224
+ const x = d[l], k = new Date(x.date);
1225
1225
  return k.setHours(x.hour, u ?? 0, 0, 0), { date: k, hour: x.hour };
1226
1226
  }
1227
1227
  return { date: /* @__PURE__ */ new Date() };
1228
1228
  },
1229
- [E, s, B]
1230
- ), le = F(
1231
- (c, u) => {
1232
- if (c.preventDefault(), c.dataTransfer.dropEffect = "move", !T?.isDragging || !T.dragState) return;
1233
- const x = c.currentTarget, k = ve(c.clientX, x);
1229
+ [H, d, B]
1230
+ ), le = O(
1231
+ (l, u) => {
1232
+ if (l.preventDefault(), l.dataTransfer.dropEffect = "move", !T?.isDragging || !T.dragState) return;
1233
+ const x = l.currentTarget, k = ue(l.clientX, x);
1234
1234
  if (!k) return;
1235
- const { colIndex: C, minute: I } = k, { date: j, hour: q } = ne(C, I);
1236
- T.updateDragPreview(j, q, I, u);
1237
- const { originalStartDate: te, originalEndDate: X } = T.dragState, oe = X.getTime() - te.getTime(), ye = s.length;
1235
+ const { colIndex: S, minute: z } = k, { date: I, hour: ee } = se(S, z);
1236
+ T.updateDragPreview(I, ee, z, u);
1237
+ const { originalStartDate: ne, originalEndDate: q } = T.dragState, oe = q.getTime() - ne.getTime(), ye = d.length;
1238
1238
  let ke;
1239
1239
  {
1240
1240
  const Ne = oe / 36e5;
1241
1241
  ke = Math.max(1, Math.ceil(Ne));
1242
1242
  }
1243
- ke = Math.min(ke, ye - C), D({ resourceId: u, colIndex: C, spanCols: ke });
1243
+ ke = Math.min(ke, ye - S), M({ resourceId: u, colIndex: S, spanCols: ke });
1244
1244
  },
1245
- [T, ve, ne, E, s.length, B.length]
1246
- ), be = F(
1247
- (c) => {
1248
- const u = c.relatedTarget;
1249
- c.currentTarget.contains(u) || D(null);
1245
+ [T, ue, se, H, d.length, B.length]
1246
+ ), we = O(
1247
+ (l) => {
1248
+ const u = l.relatedTarget;
1249
+ l.currentTarget.contains(u) || M(null);
1250
1250
  },
1251
1251
  []
1252
- ), ue = F(
1253
- (c, u) => {
1254
- c.preventDefault(), D(null), T?.isDragging && T.endDrag();
1252
+ ), he = O(
1253
+ (l, u) => {
1254
+ l.preventDefault(), M(null), T?.isDragging && T.endDrag();
1255
1255
  },
1256
1256
  [T]
1257
- ), f = F(
1258
- (c, u) => {
1259
- if (!y || y.resourceId !== c) return !1;
1260
- const x = Math.min(y.startCol, y.endCol), k = Math.max(y.startCol, y.endCol);
1257
+ ), g = O(
1258
+ (l, u) => {
1259
+ if (!C || C.resourceId !== l) return !1;
1260
+ const x = Math.min(C.startCol, C.endCol), k = Math.max(C.startCol, C.endCol);
1261
1261
  return u >= x && u <= k;
1262
1262
  },
1263
- [y]
1264
- ), M = F(
1265
- (c, u) => !_ || _.resourceId !== c ? !1 : u >= _.colIndex && u < _.colIndex + _.spanCols,
1263
+ [C]
1264
+ ), E = O(
1265
+ (l, u) => !_ || _.resourceId !== l ? !1 : u >= _.colIndex && u < _.colIndex + _.spanCols,
1266
1266
  [_]
1267
- ), U = F(
1268
- (c, u, x) => {
1269
- x.button !== 0 && x.pointerType === "mouse" || (h || p) && (x.preventDefault(), O.current = !0, z({ resourceId: c, startCol: u, endCol: u, isSelecting: !0 }));
1267
+ ), U = O(
1268
+ (l, u, x) => {
1269
+ x.button !== 0 && x.pointerType === "mouse" || (m || f) && (x.preventDefault(), W.current = !0, j({ resourceId: l, startCol: u, endCol: u, isSelecting: !0 }));
1270
1270
  },
1271
- [h, p]
1272
- ), re = F(
1273
- (c, u, x) => {
1274
- if (O.current && !(!y || y.resourceId !== c)) {
1271
+ [m, f]
1272
+ ), re = O(
1273
+ (l, u, x) => {
1274
+ if (W.current && !(!C || C.resourceId !== l)) {
1275
1275
  if (x.buttons === 0) {
1276
- O.current = !1;
1276
+ W.current = !1;
1277
1277
  return;
1278
1278
  }
1279
- z((k) => k ? { ...k, endCol: u } : null);
1279
+ j((k) => k ? { ...k, endCol: u } : null);
1280
1280
  }
1281
1281
  },
1282
- [y]
1283
- ), De = F(() => {
1284
- if (!O.current || !y) return;
1285
- O.current = !1;
1286
- const c = Math.min(y.startCol, y.endCol), u = Math.max(y.startCol, y.endCol), x = ne(c), k = ne(u), C = new Date(x.date), I = new Date(k.date);
1287
- k.hour !== void 0 && I.setHours(k.hour + 1, 0, 0, 0);
1288
- const j = {
1289
- startDate: C,
1290
- endDate: I,
1291
- resourceId: y.resourceId
1282
+ [C]
1283
+ ), De = O(() => {
1284
+ if (!W.current || !C) return;
1285
+ W.current = !1;
1286
+ const l = Math.min(C.startCol, C.endCol), u = Math.max(C.startCol, C.endCol), x = se(l), k = se(u), S = new Date(x.date), z = new Date(k.date);
1287
+ k.hour !== void 0 && z.setHours(k.hour + 1, 0, 0, 0);
1288
+ const I = {
1289
+ startDate: S,
1290
+ endDate: z,
1291
+ resourceId: C.resourceId
1292
1292
  };
1293
- c === u && p && p(x.date, x.hour, y.resourceId), h?.(j), z((q) => q ? { ...q, isSelecting: !1 } : null), setTimeout(() => z(null), 150);
1294
- }, [y, ne, E, p, h]);
1293
+ l === u && f && f(x.date, x.hour, C.resourceId), m?.(I), j((ee) => ee ? { ...ee, isSelecting: !1 } : null), setTimeout(() => j(null), 150);
1294
+ }, [C, se, H, f, m]);
1295
1295
  return de(() => {
1296
- const c = () => {
1297
- O.current && De();
1296
+ const l = () => {
1297
+ W.current && De();
1298
1298
  };
1299
- return window.addEventListener("pointerup", c), window.addEventListener("pointercancel", c), () => {
1300
- window.removeEventListener("pointerup", c), window.removeEventListener("pointercancel", c);
1299
+ return window.addEventListener("pointerup", l), window.addEventListener("pointercancel", l), () => {
1300
+ window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", l);
1301
1301
  };
1302
1302
  }, [De]), de(() => {
1303
- T?.isDragging || D(null);
1304
- }, [T?.isDragging]), /* @__PURE__ */ e("div", { className: g("flex h-full flex-col", v), children: /* @__PURE__ */ e("div", { className: "ic-timeline-scroll-container flex-1", ref: W, children: /* @__PURE__ */ r("div", { className: "relative", style: { minWidth: ee }, children: [
1303
+ T?.isDragging || M(null);
1304
+ }, [T?.isDragging]), /* @__PURE__ */ e("div", { className: p("flex h-full flex-col", v), children: /* @__PURE__ */ e("div", { className: "ic-timeline-scroll-container flex-1", ref: F, children: /* @__PURE__ */ r("div", { className: "relative", style: { minWidth: Y }, children: [
1305
1305
  // Hour mode: Day headers + Hour sub-headers - sticky wrapper with flex child (sticky + flex breaks sticky)
1306
1306
  /* @__PURE__ */ e("div", { className: "ic-timeline-header sticky top-0 z-20 border-b bg-background", children: t > 1 ? (
1307
1307
  // Multi-day: Resources cell spans both day-header + hour-header rows
@@ -1315,35 +1315,35 @@ function Le({
1315
1315
  }
1316
1316
  ),
1317
1317
  /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-col", children: [
1318
- /* @__PURE__ */ e("div", { className: "flex border-b", children: B.map((c, u) => {
1319
- const x = ce(c), k = u * J, C = R.slice(k, k + J).reduce((I, j) => I + j, 0);
1318
+ /* @__PURE__ */ e("div", { className: "flex border-b", children: B.map((l, u) => {
1319
+ const x = ce(l), k = u * X, S = K.slice(k, k + X).reduce((z, I) => z + I, 0);
1320
1320
  return /* @__PURE__ */ e(
1321
1321
  "div",
1322
1322
  {
1323
- className: g(
1323
+ className: p(
1324
1324
  "flex shrink-0 items-center justify-center border-r py-1.5 font-medium",
1325
1325
  x ? "bg-primary/10 text-primary" : "bg-muted/30"
1326
1326
  ),
1327
- style: { width: C },
1328
- children: /* @__PURE__ */ e("span", { className: "text-xs", children: ln(c) })
1327
+ style: { width: S },
1328
+ children: /* @__PURE__ */ e("span", { className: "text-xs", children: ln(l) })
1329
1329
  },
1330
- `day-${c.toISOString()}`
1330
+ `day-${l.toISOString()}`
1331
1331
  );
1332
1332
  }) }),
1333
- /* @__PURE__ */ e("div", { className: "flex", children: s.map((c, u) => {
1334
- const x = c.hour === H, k = ce(c.date), C = R[u] ?? ze;
1333
+ /* @__PURE__ */ e("div", { className: "flex", children: d.map((l, u) => {
1334
+ const x = l.hour === L, k = ce(l.date), S = K[u] ?? ze;
1335
1335
  return /* @__PURE__ */ e(
1336
1336
  "div",
1337
1337
  {
1338
- className: g(
1338
+ className: p(
1339
1339
  "flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
1340
1340
  x && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
1341
1341
  k && "bg-primary/5"
1342
1342
  ),
1343
- style: { width: C },
1344
- children: Fe(c.hour)
1343
+ style: { width: S },
1344
+ children: Fe(l.hour)
1345
1345
  },
1346
- `hour-${c.dayIndex}-${c.hour}`
1346
+ `hour-${l.dayIndex}-${l.hour}`
1347
1347
  );
1348
1348
  }) })
1349
1349
  ] })
@@ -1359,30 +1359,30 @@ function Le({
1359
1359
  children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
1360
1360
  }
1361
1361
  ),
1362
- s.map((c, u) => {
1363
- const x = c.hour === H, k = ce(c.date), C = R[u] ?? ze;
1362
+ d.map((l, u) => {
1363
+ const x = l.hour === L, k = ce(l.date), S = K[u] ?? ze;
1364
1364
  return /* @__PURE__ */ e(
1365
1365
  "div",
1366
1366
  {
1367
- className: g(
1367
+ className: p(
1368
1368
  "flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
1369
1369
  x && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
1370
1370
  k && "bg-primary/5"
1371
1371
  ),
1372
- style: { width: C },
1373
- children: Fe(c.hour)
1372
+ style: { width: S },
1373
+ children: Fe(l.hour)
1374
1374
  },
1375
- `hour-${c.dayIndex}-${c.hour}`
1375
+ `hour-${l.dayIndex}-${l.hour}`
1376
1376
  );
1377
1377
  })
1378
1378
  ] })
1379
1379
  ) }),
1380
- S.map((c) => {
1381
- const u = se(c.maxStack);
1380
+ w.map((l) => {
1381
+ const u = Z(l.maxStack);
1382
1382
  return /* @__PURE__ */ r(
1383
1383
  "div",
1384
1384
  {
1385
- className: g(
1385
+ className: p(
1386
1386
  "relative flex border-b",
1387
1387
  $?.resourceRow
1388
1388
  ),
@@ -1396,7 +1396,7 @@ function Le({
1396
1396
  children: /* @__PURE__ */ r(
1397
1397
  "div",
1398
1398
  {
1399
- className: g(
1399
+ className: p(
1400
1400
  "flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",
1401
1401
  $?.resourceHeader
1402
1402
  ),
@@ -1405,12 +1405,12 @@ function Le({
1405
1405
  cn,
1406
1406
  {
1407
1407
  className: "size-7",
1408
- src: c.user.avatar,
1409
- alt: c.user.name,
1410
- fallback: on(c.user.name)
1408
+ src: l.user.avatar,
1409
+ alt: l.user.name,
1410
+ fallback: on(l.user.name)
1411
1411
  }
1412
1412
  ),
1413
- /* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: c.user.name })
1413
+ /* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: l.user.name })
1414
1414
  ]
1415
1415
  }
1416
1416
  )
@@ -1420,75 +1420,83 @@ function Le({
1420
1420
  "div",
1421
1421
  {
1422
1422
  className: "ic-timeline-grid relative flex",
1423
- onDragOver: (x) => le(x, c.user.id),
1424
- onDragLeave: be,
1425
- onDrop: (x) => ue(x, c.user.id),
1423
+ onDragOver: (x) => le(x, l.user.id),
1424
+ onDragLeave: we,
1425
+ onDrop: (x) => he(x, l.user.id),
1426
1426
  children: [
1427
1427
  // Hour mode cells — interactive buttons for slot selection
1428
- s.map((x, k) => {
1429
- const C = x.hour === H && k > 0, I = R[k] ?? ze, j = f(c.user.id, k), q = M(c.user.id, k), te = !!(h || p);
1428
+ d.map((x, k) => {
1429
+ const S = x.hour === L && k > 0, z = K[k] ?? ze, I = g(l.user.id, k), ee = E(l.user.id, k), ne = !!(m || f);
1430
1430
  return /* @__PURE__ */ e(
1431
1431
  "div",
1432
1432
  {
1433
- role: te ? "button" : void 0,
1434
- tabIndex: te ? 0 : void 0,
1435
- "aria-label": te ? `Select ${Fe(x.hour)} on ${x.date.toLocaleDateString()} for ${c.user.name}` : void 0,
1436
- onPointerDown: (X) => U(c.user.id, k, X),
1437
- onPointerEnter: (X) => re(c.user.id, k, X),
1433
+ role: ne ? "button" : void 0,
1434
+ tabIndex: ne ? 0 : void 0,
1435
+ "aria-label": ne ? `Select ${Fe(x.hour)} on ${x.date.toLocaleDateString()} for ${l.user.name}` : void 0,
1436
+ onPointerDown: (q) => U(l.user.id, k, q),
1437
+ onPointerEnter: (q) => re(l.user.id, k, q),
1438
1438
  onPointerUp: De,
1439
- onKeyDown: (X) => {
1440
- if (te && (X.key === "Enter" || X.key === " ")) {
1441
- X.preventDefault();
1442
- const oe = ne(k);
1443
- p?.(oe.date, oe.hour, c.user.id), h?.({
1439
+ onKeyDown: (q) => {
1440
+ if (ne && (q.key === "Enter" || q.key === " ")) {
1441
+ q.preventDefault();
1442
+ const oe = se(k);
1443
+ f?.(oe.date, oe.hour, l.user.id), m?.({
1444
1444
  startDate: oe.date,
1445
1445
  endDate: (() => {
1446
1446
  const ye = new Date(oe.date);
1447
1447
  return oe.hour !== void 0 && ye.setHours(oe.hour + 1, 0, 0, 0), ye;
1448
1448
  })(),
1449
- resourceId: c.user.id
1449
+ resourceId: l.user.id
1450
1450
  });
1451
1451
  }
1452
1452
  },
1453
- className: g(
1453
+ className: p(
1454
1454
  "shrink-0 select-none touch-none transition-colors",
1455
- te && "cursor-pointer",
1456
- C ? "border-l-2 border-l-border" : "border-r border-r-border/50",
1455
+ ne && "cursor-pointer",
1456
+ S ? "border-l-2 border-l-border" : "border-r border-r-border/50",
1457
1457
  ce(x.date) && "bg-primary/5",
1458
1458
  // Hover — subtle feedback (only when not selecting or dragging)
1459
- te && !y?.isSelecting && !T?.isDragging && "hover:bg-blue-50/60",
1459
+ ne && !C?.isSelecting && !T?.isDragging && "hover:bg-blue-50/60",
1460
1460
  // Slot selection highlight
1461
- j && "bg-blue-100/70",
1461
+ I && "bg-blue-100/70",
1462
1462
  // Drop target highlight
1463
- q && "bg-primary/20 ring-2 ring-primary ring-inset"
1463
+ ee && "bg-primary/20 ring-2 ring-primary ring-inset"
1464
1464
  ),
1465
- style: { width: I }
1465
+ style: { width: z }
1466
1466
  },
1467
1467
  `cell-${x.dayIndex}-${x.hour}`
1468
1468
  );
1469
1469
  }),
1470
- c.events.map((x) => {
1471
- const k = (Z[x.startCol] ?? 0) + 2, C = Z[x.startCol + x.spanCols] ?? Z[Z.length - 1] ?? 0, I = Z[x.startCol] ?? 0, j = C - I - 4, q = qe + x.stackIndex * (We + Je);
1470
+ l.events.map((x) => {
1471
+ const k = (J[x.startCol] ?? 0) + 2, S = J[x.startCol + x.spanCols] ?? J[J.length - 1] ?? 0, z = J[x.startCol] ?? 0, I = S - z - 4, ee = qe + x.stackIndex * (We + Je), ne = t === 1 ? "timeline-day" : t === 3 ? "timeline-3day" : "timeline-week", q = A?.eventCard;
1472
1472
  return /* @__PURE__ */ e(
1473
1473
  "div",
1474
1474
  {
1475
1475
  className: "absolute",
1476
1476
  style: {
1477
1477
  left: k,
1478
- width: Math.max(j, 0),
1478
+ width: Math.max(I, 0),
1479
1479
  // No forced minimum - columns are guaranteed wide enough
1480
- top: q,
1480
+ top: ee,
1481
1481
  height: We
1482
1482
  },
1483
- children: /* @__PURE__ */ e(
1483
+ children: q ? /* @__PURE__ */ e(
1484
+ q,
1485
+ {
1486
+ event: x.event,
1487
+ view: ne,
1488
+ isCompact: !0,
1489
+ onClick: () => a?.(x.event)
1490
+ }
1491
+ ) : /* @__PURE__ */ e(
1484
1492
  Nt,
1485
1493
  {
1486
1494
  event: x.event,
1487
1495
  variant: "compact",
1488
1496
  enableDrag: P,
1489
- onClick: l,
1490
- renderPopover: w,
1491
- className: g(
1497
+ onClick: a,
1498
+ renderPopover: b,
1499
+ className: p(
1492
1500
  "h-full w-full",
1493
1501
  $?.eventCardCompact
1494
1502
  )
@@ -1503,10 +1511,10 @@ function Le({
1503
1511
  )
1504
1512
  ]
1505
1513
  },
1506
- c.user.id
1514
+ l.user.id
1507
1515
  );
1508
1516
  }),
1509
- S.length === 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-20 text-muted-foreground", children: "No users or events to display" })
1517
+ w.length === 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-20 text-muted-foreground", children: "No users or events to display" })
1510
1518
  ] }) }) });
1511
1519
  }
1512
1520
  const un = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], hn = [
@@ -1527,49 +1535,49 @@ function et(t) {
1527
1535
  const n = t.hexColor;
1528
1536
  return n ? { backgroundColor: n } : {};
1529
1537
  }
1530
- function mn({ day: t, date: n, events: o, isCurrentMonth: a, onDayClick: i }) {
1531
- const l = ce(n), p = 3, h = o.length;
1538
+ function mn({ day: t, date: n, events: s, isCurrentMonth: o, onDayClick: i }) {
1539
+ const a = ce(n), f = 3, m = s.length;
1532
1540
  return /* @__PURE__ */ r(
1533
1541
  "button",
1534
1542
  {
1535
1543
  type: "button",
1536
1544
  onClick: () => i?.(n),
1537
- className: g(
1545
+ className: p(
1538
1546
  "flex h-9 sm:h-11 flex-1 flex-col items-center justify-start gap-0.5 rounded-md pt-0.5 sm:pt-1",
1539
1547
  "hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
1540
1548
  "transition-colors",
1541
- !a && "opacity-40"
1549
+ !o && "opacity-40"
1542
1550
  ),
1543
1551
  children: [
1544
1552
  /* @__PURE__ */ e(
1545
1553
  "div",
1546
1554
  {
1547
- className: g(
1555
+ className: p(
1548
1556
  "flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",
1549
- l && "bg-primary font-semibold text-primary-foreground"
1557
+ a && "bg-primary font-semibold text-primary-foreground"
1550
1558
  ),
1551
1559
  children: t
1552
1560
  }
1553
1561
  ),
1554
- h > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: h <= p ? o.map((d) => /* @__PURE__ */ e(
1562
+ m > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: m <= f ? s.map((c) => /* @__PURE__ */ e(
1555
1563
  "div",
1556
1564
  {
1557
1565
  className: "size-1 sm:size-1.5 rounded-full bg-primary",
1558
- style: et(d)
1566
+ style: et(c)
1559
1567
  },
1560
- d.id
1561
- )) : /* @__PURE__ */ r(we, { children: [
1562
- o.slice(0, p).map((d) => /* @__PURE__ */ e(
1568
+ c.id
1569
+ )) : /* @__PURE__ */ r(be, { children: [
1570
+ s.slice(0, f).map((c) => /* @__PURE__ */ e(
1563
1571
  "div",
1564
1572
  {
1565
1573
  className: "size-1 sm:size-1.5 rounded-full bg-primary",
1566
- style: et(d)
1574
+ style: et(c)
1567
1575
  },
1568
- d.id
1576
+ c.id
1569
1577
  )),
1570
1578
  /* @__PURE__ */ r("span", { className: "text-[6px] sm:text-[7px] font-medium text-muted-foreground", children: [
1571
1579
  "+",
1572
- h - p
1580
+ m - f
1573
1581
  ] })
1574
1582
  ] }) })
1575
1583
  ]
@@ -1579,17 +1587,17 @@ function mn({ day: t, date: n, events: o, isCurrentMonth: a, onDayClick: i }) {
1579
1587
  function fn({
1580
1588
  date: t,
1581
1589
  events: n,
1582
- onMonthClick: o,
1583
- onDayClick: a
1590
+ onMonthClick: s,
1591
+ onDayClick: o
1584
1592
  }) {
1585
- const i = Q(() => At(t, 0), [t]);
1593
+ const i = te(() => At(t, 0), [t]);
1586
1594
  return /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
1587
1595
  /* @__PURE__ */ e(
1588
1596
  "button",
1589
1597
  {
1590
1598
  type: "button",
1591
- onClick: () => o?.(t),
1592
- className: g(
1599
+ onClick: () => s?.(t),
1600
+ className: p(
1593
1601
  "w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold",
1594
1602
  "hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
1595
1603
  "transition-colors"
@@ -1598,22 +1606,22 @@ function fn({
1598
1606
  }
1599
1607
  ),
1600
1608
  /* @__PURE__ */ r("div", { className: "flex-1 space-y-1.5 sm:space-y-2 rounded-b-lg border border-t-0 p-2 sm:p-3", children: [
1601
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: un.map((l, p) => /* @__PURE__ */ r("div", { className: "text-[9px] sm:text-xs font-medium text-muted-foreground", children: [
1602
- /* @__PURE__ */ e("span", { className: "sm:hidden", children: l[0] }),
1603
- /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: l })
1604
- ] }, p)) }),
1605
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: i.map((l, p) => {
1606
- const h = Pt(n, l.date);
1609
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: un.map((a, f) => /* @__PURE__ */ r("div", { className: "text-[9px] sm:text-xs font-medium text-muted-foreground", children: [
1610
+ /* @__PURE__ */ e("span", { className: "sm:hidden", children: a[0] }),
1611
+ /* @__PURE__ */ e("span", { className: "hidden sm:inline", children: a })
1612
+ ] }, f)) }),
1613
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: i.map((a, f) => {
1614
+ const m = Pt(n, a.date);
1607
1615
  return /* @__PURE__ */ e(
1608
1616
  mn,
1609
1617
  {
1610
- day: l.date.getDate(),
1611
- date: l.date,
1612
- events: h,
1613
- isCurrentMonth: l.isCurrentMonth,
1614
- onDayClick: a
1618
+ day: a.date.getDate(),
1619
+ date: a.date,
1620
+ events: m,
1621
+ isCurrentMonth: a.isCurrentMonth,
1622
+ onDayClick: o
1615
1623
  },
1616
- `${p + 1}-${l.date.toISOString()}`
1624
+ `${f + 1}-${a.date.toISOString()}`
1617
1625
  );
1618
1626
  }) })
1619
1627
  ] })
@@ -1622,24 +1630,24 @@ function fn({
1622
1630
  function gn({
1623
1631
  events: t,
1624
1632
  year: n,
1625
- onMonthClick: o,
1626
- onDayClick: a,
1633
+ onMonthClick: s,
1634
+ onDayClick: o,
1627
1635
  className: i,
1628
- slots: l,
1629
- classNames: p
1636
+ slots: a,
1637
+ classNames: f
1630
1638
  }) {
1631
- const h = Q(() => jt(n), [n]);
1632
- return /* @__PURE__ */ r("div", { className: g("flex flex-col h-full", i), children: [
1639
+ const m = te(() => jt(n), [n]);
1640
+ return /* @__PURE__ */ r("div", { className: p("flex flex-col h-full", i), children: [
1633
1641
  /* @__PURE__ */ e("div", { className: "flex items-center justify-center border-b px-4 py-3", children: /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: n }) }),
1634
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", children: h.map((d) => /* @__PURE__ */ e(
1642
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", children: m.map((c) => /* @__PURE__ */ e(
1635
1643
  fn,
1636
1644
  {
1637
- date: d,
1645
+ date: c,
1638
1646
  events: t,
1639
- onMonthClick: o,
1640
- onDayClick: a
1647
+ onMonthClick: s,
1648
+ onDayClick: o
1641
1649
  },
1642
- d.getMonth()
1650
+ c.getMonth()
1643
1651
  )) }) })
1644
1652
  ] });
1645
1653
  }
@@ -1714,246 +1722,256 @@ function Nn() {
1714
1722
  }
1715
1723
  function Cn({
1716
1724
  containerRef: t,
1717
- className: n
1725
+ currentDate: n,
1726
+ className: s
1718
1727
  }) {
1719
- const [o, a] = ie({
1728
+ const [o, i] = ie({
1720
1729
  canUp: !1,
1721
1730
  canDown: !1,
1722
1731
  canLeft: !1,
1723
1732
  canRight: !1
1724
- }), [i, l] = ie({ x: 0, y: 0 }), [p, h] = ie(!1), d = o.canUp || o.canDown || o.canLeft || o.canRight, v = ae(null), b = ae(null), w = ae(null), A = ae(!1), $ = ae({ x: 0, y: 0 }), P = ae({ x: 0, y: 0 }), W = ae(0), T = ae(null), y = F(() => {
1725
- const s = t.current;
1726
- if (!s) return;
1727
- const m = 4;
1728
- a({
1729
- canUp: s.scrollTop > m,
1730
- canDown: s.scrollTop + s.clientHeight < s.scrollHeight - m,
1731
- canLeft: s.scrollLeft > m,
1732
- canRight: s.scrollLeft + s.clientWidth < s.scrollWidth - m
1733
+ }), [a, f] = ie({ x: 0, y: 0 }), [m, c] = ie(!1), v = o.canUp || o.canDown || o.canLeft || o.canRight, y = ae(null), b = ae(null), A = ae(null), $ = ae(!1), P = ae({ x: 0, y: 0 }), F = ae({ x: 0, y: 0 }), T = ae(0), C = ae(null), j = O(() => {
1734
+ const h = t.current;
1735
+ if (!h) return;
1736
+ const D = 4;
1737
+ i({
1738
+ canUp: h.scrollTop > D,
1739
+ canDown: h.scrollTop + h.clientHeight < h.scrollHeight - D,
1740
+ canLeft: h.scrollLeft > D,
1741
+ canRight: h.scrollLeft + h.clientWidth < h.scrollWidth - D
1733
1742
  });
1734
1743
  }, [t]);
1735
1744
  de(() => {
1736
- const s = t.current;
1737
- if (!s) return;
1738
- y(), s.addEventListener("scroll", y, { passive: !0 });
1739
- const m = new ResizeObserver(y);
1740
- m.observe(s);
1741
- const N = new MutationObserver(y);
1742
- return N.observe(s, { childList: !0, subtree: !0 }), () => {
1743
- s.removeEventListener("scroll", y), m.disconnect(), N.disconnect();
1745
+ const h = t.current;
1746
+ if (!h) return;
1747
+ j(), h.addEventListener("scroll", j, { passive: !0 });
1748
+ const D = new ResizeObserver(j);
1749
+ D.observe(h);
1750
+ const w = new MutationObserver(j);
1751
+ return w.observe(h, { childList: !0, subtree: !0 }), () => {
1752
+ h.removeEventListener("scroll", j), D.disconnect(), w.disconnect();
1744
1753
  };
1745
- }, [t, y]);
1746
- const z = F(
1747
- (s, m) => {
1748
- t.current?.scrollBy({ left: s, top: m, behavior: "smooth" });
1754
+ }, [t, j]);
1755
+ const W = O(
1756
+ (h, D) => {
1757
+ t.current?.scrollBy({ left: h, top: D, behavior: "smooth" });
1749
1758
  },
1750
1759
  [t]
1751
- ), O = F(() => z(0, -Ie), [z]), _ = F(() => z(0, Ie), [z]), D = F(() => z(-Ie, 0), [z]), K = F(() => z(Ie, 0), [z]), E = F(() => {
1752
- v.current && (clearTimeout(v.current), v.current = null), b.current && (clearInterval(b.current), b.current = null);
1753
- }, []), H = F((s) => {
1754
- s(), v.current = setTimeout(() => {
1755
- b.current = setInterval(s, pn);
1760
+ ), _ = O(() => W(0, -Ie), [W]), M = O(() => W(0, Ie), [W]), G = O(() => W(-Ie, 0), [W]), H = O(() => W(Ie, 0), [W]), L = O(() => {
1761
+ y.current && (clearTimeout(y.current), y.current = null), b.current && (clearInterval(b.current), b.current = null);
1762
+ }, []), V = O((h) => {
1763
+ h(), y.current = setTimeout(() => {
1764
+ b.current = setInterval(h, pn);
1756
1765
  }, xn);
1757
1766
  }, []);
1758
- de(() => E, [E]), de(() => {
1759
- const s = t.current;
1760
- if (!s) return;
1761
- const m = (N) => {
1762
- if (N.ctrlKey || N.metaKey || N.altKey) return;
1763
- const L = N.target.tagName;
1764
- if (!(L === "INPUT" || L === "TEXTAREA" || N.target.isContentEditable))
1765
- switch (N.key) {
1767
+ de(() => L, [L]), de(() => {
1768
+ const h = t.current;
1769
+ if (!h) return;
1770
+ const D = (w) => {
1771
+ if (w.ctrlKey || w.metaKey || w.altKey) return;
1772
+ const R = w.target.tagName;
1773
+ if (!(R === "INPUT" || R === "TEXTAREA" || w.target.isContentEditable))
1774
+ switch (w.key) {
1766
1775
  case "ArrowUp":
1767
- N.preventDefault(), O();
1776
+ w.preventDefault(), _();
1768
1777
  break;
1769
1778
  case "ArrowDown":
1770
- N.preventDefault(), _();
1779
+ w.preventDefault(), M();
1771
1780
  break;
1772
1781
  case "ArrowLeft":
1773
- N.preventDefault(), D();
1782
+ w.preventDefault(), G();
1774
1783
  break;
1775
1784
  case "ArrowRight":
1776
- N.preventDefault(), K();
1785
+ w.preventDefault(), H();
1777
1786
  break;
1778
1787
  }
1779
1788
  };
1780
- return s.addEventListener("keydown", m), () => s.removeEventListener("keydown", m);
1781
- }, [t, O, _, D, K]), de(() => {
1782
- if (!d) return;
1783
- const s = T.current;
1784
- if (!s) return;
1785
- let m = 0;
1786
- const N = () => {
1787
- const R = s.offsetParent;
1788
- if (!R) return;
1789
- const se = R.getBoundingClientRect(), ee = window.innerHeight;
1790
- if (se.height <= ee) {
1791
- s.style.removeProperty("top"), s.style.removeProperty("bottom");
1789
+ return h.addEventListener("keydown", D), () => h.removeEventListener("keydown", D);
1790
+ }, [t, _, M, G, H]), de(() => {
1791
+ if (!v) return;
1792
+ const h = C.current;
1793
+ if (!h) return;
1794
+ let D = 0;
1795
+ const w = () => {
1796
+ const Y = h.offsetParent;
1797
+ if (!Y) return;
1798
+ const J = Y.getBoundingClientRect(), ue = window.innerHeight;
1799
+ if (J.height <= ue) {
1800
+ h.style.removeProperty("top"), h.style.removeProperty("bottom");
1792
1801
  return;
1793
1802
  }
1794
- const ve = Math.min(se.bottom, ee) - se.top, ne = s.offsetHeight, le = ve - ne - 12, be = 12, ue = R.clientHeight - ne - 12, f = Math.max(be, Math.min(le, ue));
1795
- s.style.top = `${f}px`, s.style.bottom = "auto";
1796
- }, L = () => {
1797
- cancelAnimationFrame(m), m = requestAnimationFrame(N);
1798
- }, S = [window];
1799
- let Y = s.parentElement;
1800
- for (; Y; ) {
1801
- const R = getComputedStyle(Y);
1802
- /(auto|scroll)/.test(R.overflow + R.overflowY) && S.push(Y), Y = Y.parentElement;
1803
+ const le = Math.min(J.bottom, ue) - J.top, we = h.offsetHeight, he = le - we - 12, g = 12, E = Y.clientHeight - we - 12, U = Math.max(g, Math.min(he, E));
1804
+ h.style.top = `${U}px`, h.style.bottom = "auto";
1805
+ }, R = () => {
1806
+ cancelAnimationFrame(D), D = requestAnimationFrame(w);
1807
+ }, K = [window];
1808
+ let Z = h.parentElement;
1809
+ for (; Z; ) {
1810
+ const Y = getComputedStyle(Z);
1811
+ /(auto|scroll)/.test(Y.overflow + Y.overflowY) && K.push(Z), Z = Z.parentElement;
1803
1812
  }
1804
- for (const R of S)
1805
- R.addEventListener("scroll", L, { passive: !0 });
1806
- return window.addEventListener("resize", L, { passive: !0 }), N(), () => {
1807
- cancelAnimationFrame(m);
1808
- for (const R of S)
1809
- R.removeEventListener("scroll", L);
1810
- window.removeEventListener("resize", L);
1813
+ for (const Y of K)
1814
+ Y.addEventListener("scroll", R, { passive: !0 });
1815
+ return window.addEventListener("resize", R, { passive: !0 }), w(), () => {
1816
+ cancelAnimationFrame(D);
1817
+ for (const Y of K)
1818
+ Y.removeEventListener("scroll", R);
1819
+ window.removeEventListener("resize", R);
1811
1820
  };
1812
- }, [d]);
1813
- const V = F(() => {
1814
- A.current = !1, h(!1), l({ x: 0, y: 0 }), P.current = { x: 0, y: 0 }, W.current && cancelAnimationFrame(W.current);
1815
- }, []), J = F(
1816
- (s) => {
1817
- s.preventDefault(), A.current = !0, h(!0), $.current = { x: s.clientX, y: s.clientY }, P.current = { x: 0, y: 0 }, s.target.setPointerCapture(s.pointerId);
1818
- const m = () => {
1819
- if (!A.current) return;
1820
- const N = t.current;
1821
- if (N) {
1822
- const { x: L, y: S } = P.current, Y = Math.sqrt(L * L + S * S);
1823
- if (Y > tt) {
1824
- const se = Math.min(Y / $e, 1) * wn;
1825
- N.scrollLeft += L / Y * se, N.scrollTop += S / Y * se;
1821
+ }, [v]);
1822
+ const X = O(() => {
1823
+ $.current = !1, c(!1), f({ x: 0, y: 0 }), F.current = { x: 0, y: 0 }, T.current && cancelAnimationFrame(T.current);
1824
+ }, []), Q = O(
1825
+ (h) => {
1826
+ h.preventDefault(), $.current = !0, c(!0), P.current = { x: h.clientX, y: h.clientY }, F.current = { x: 0, y: 0 }, h.target.setPointerCapture(h.pointerId);
1827
+ const D = () => {
1828
+ if (!$.current) return;
1829
+ const w = t.current;
1830
+ if (w) {
1831
+ const { x: R, y: K } = F.current, Z = Math.sqrt(R * R + K * K);
1832
+ if (Z > tt) {
1833
+ const J = Math.min(Z / $e, 1) * wn;
1834
+ w.scrollLeft += R / Z * J, w.scrollTop += K / Z * J;
1826
1835
  }
1827
1836
  }
1828
- W.current = requestAnimationFrame(m);
1837
+ T.current = requestAnimationFrame(D);
1829
1838
  };
1830
- W.current = requestAnimationFrame(m);
1839
+ T.current = requestAnimationFrame(D);
1831
1840
  },
1832
1841
  [t]
1833
- ), G = F((s) => {
1834
- if (!A.current) return;
1835
- const m = s.clientX - $.current.x, N = s.clientY - $.current.y;
1836
- P.current = { x: m, y: N };
1837
- const L = Math.sqrt(m * m + N * N);
1838
- if (L < tt)
1839
- l({ x: 0, y: 0 });
1842
+ ), B = O((h) => {
1843
+ if (!$.current) return;
1844
+ const D = h.clientX - P.current.x, w = h.clientY - P.current.y;
1845
+ F.current = { x: D, y: w };
1846
+ const R = Math.sqrt(D * D + w * w);
1847
+ if (R < tt)
1848
+ f({ x: 0, y: 0 });
1840
1849
  else {
1841
- const Y = Math.min(L, $e) / $e * vn;
1842
- l({
1843
- x: m / L * Y,
1844
- y: N / L * Y
1850
+ const Z = Math.min(R, $e) / $e * vn;
1851
+ f({
1852
+ x: D / R * Z,
1853
+ y: w / R * Z
1845
1854
  });
1846
1855
  }
1847
- }, []), B = F(
1848
- (s) => {
1849
- switch (s.key) {
1856
+ }, []), d = O(
1857
+ (h) => {
1858
+ switch (h.key) {
1850
1859
  case "ArrowUp":
1851
- s.preventDefault(), O();
1860
+ h.preventDefault(), _();
1852
1861
  break;
1853
1862
  case "ArrowDown":
1854
- s.preventDefault(), _();
1863
+ h.preventDefault(), M();
1855
1864
  break;
1856
1865
  case "ArrowLeft":
1857
- s.preventDefault(), D();
1866
+ h.preventDefault(), G();
1858
1867
  break;
1859
1868
  case "ArrowRight":
1860
- s.preventDefault(), K();
1869
+ h.preventDefault(), H();
1861
1870
  break;
1862
1871
  }
1863
1872
  },
1864
- [O, _, D, K]
1873
+ [_, M, G, H]
1865
1874
  );
1866
- return d ? /* @__PURE__ */ r(
1875
+ if (!v) return null;
1876
+ const N = n ? n.toLocaleDateString(void 0, {
1877
+ weekday: "short",
1878
+ month: "short",
1879
+ day: "numeric"
1880
+ }) : null;
1881
+ return /* @__PURE__ */ r(
1867
1882
  "div",
1868
1883
  {
1869
- ref: T,
1870
- className: `inno-scroll-nav ${n ?? ""}`,
1884
+ ref: C,
1885
+ className: `inno-scroll-nav-wrapper ${s ?? ""}`,
1871
1886
  role: "toolbar",
1872
1887
  "aria-label": "Scroll navigation",
1873
- onKeyDown: B,
1888
+ onKeyDown: d,
1874
1889
  children: [
1875
- /* @__PURE__ */ e(
1876
- "button",
1877
- {
1878
- type: "button",
1879
- className: `inno-scroll-nav-btn inno-scroll-nav-up ${o.canUp ? "" : "inno-scroll-nav-btn-disabled"}`,
1880
- "aria-label": "Scroll up",
1881
- disabled: !o.canUp,
1882
- onPointerDown: () => H(O),
1883
- onPointerUp: E,
1884
- onPointerLeave: E,
1885
- tabIndex: o.canUp ? 0 : -1,
1886
- children: /* @__PURE__ */ e(bn, {})
1887
- }
1888
- ),
1889
- /* @__PURE__ */ e(
1890
- "button",
1891
- {
1892
- type: "button",
1893
- className: `inno-scroll-nav-btn inno-scroll-nav-left ${o.canLeft ? "" : "inno-scroll-nav-btn-disabled"}`,
1894
- "aria-label": "Scroll left",
1895
- disabled: !o.canLeft,
1896
- onPointerDown: () => H(D),
1897
- onPointerUp: E,
1898
- onPointerLeave: E,
1899
- tabIndex: o.canLeft ? 0 : -1,
1900
- children: /* @__PURE__ */ e(kn, {})
1901
- }
1902
- ),
1903
- /* @__PURE__ */ e(
1904
- "button",
1905
- {
1906
- ref: w,
1907
- type: "button",
1908
- className: `inno-scroll-nav-joystick ${p ? "inno-scroll-nav-joystick-active" : ""}`,
1909
- "aria-label": "Drag to scroll freely",
1910
- onPointerDown: J,
1911
- onPointerMove: G,
1912
- onPointerUp: V,
1913
- onPointerCancel: V,
1914
- tabIndex: 0,
1915
- children: /* @__PURE__ */ e(
1916
- "span",
1917
- {
1918
- className: "inno-scroll-nav-joystick-dot",
1919
- style: {
1920
- transform: `translate(${i.x}px, ${i.y}px)`
1890
+ N && /* @__PURE__ */ e("div", { className: "inno-scroll-nav-date", "aria-live": "polite", children: N }),
1891
+ /* @__PURE__ */ r("div", { className: "inno-scroll-nav", children: [
1892
+ /* @__PURE__ */ e(
1893
+ "button",
1894
+ {
1895
+ type: "button",
1896
+ className: `inno-scroll-nav-btn inno-scroll-nav-up ${o.canUp ? "" : "inno-scroll-nav-btn-disabled"}`,
1897
+ "aria-label": "Scroll up",
1898
+ disabled: !o.canUp,
1899
+ onPointerDown: () => V(_),
1900
+ onPointerUp: L,
1901
+ onPointerLeave: L,
1902
+ tabIndex: o.canUp ? 0 : -1,
1903
+ children: /* @__PURE__ */ e(bn, {})
1904
+ }
1905
+ ),
1906
+ /* @__PURE__ */ e(
1907
+ "button",
1908
+ {
1909
+ type: "button",
1910
+ className: `inno-scroll-nav-btn inno-scroll-nav-left ${o.canLeft ? "" : "inno-scroll-nav-btn-disabled"}`,
1911
+ "aria-label": "Scroll left",
1912
+ disabled: !o.canLeft,
1913
+ onPointerDown: () => V(G),
1914
+ onPointerUp: L,
1915
+ onPointerLeave: L,
1916
+ tabIndex: o.canLeft ? 0 : -1,
1917
+ children: /* @__PURE__ */ e(kn, {})
1918
+ }
1919
+ ),
1920
+ /* @__PURE__ */ e(
1921
+ "button",
1922
+ {
1923
+ ref: A,
1924
+ type: "button",
1925
+ className: `inno-scroll-nav-joystick ${m ? "inno-scroll-nav-joystick-active" : ""}`,
1926
+ "aria-label": "Drag to scroll freely",
1927
+ onPointerDown: Q,
1928
+ onPointerMove: B,
1929
+ onPointerUp: X,
1930
+ onPointerCancel: X,
1931
+ tabIndex: 0,
1932
+ children: /* @__PURE__ */ e(
1933
+ "span",
1934
+ {
1935
+ className: "inno-scroll-nav-joystick-dot",
1936
+ style: {
1937
+ transform: `translate(${a.x}px, ${a.y}px)`
1938
+ }
1921
1939
  }
1922
- }
1923
- )
1924
- }
1925
- ),
1926
- /* @__PURE__ */ e(
1927
- "button",
1928
- {
1929
- type: "button",
1930
- className: `inno-scroll-nav-btn inno-scroll-nav-right ${o.canRight ? "" : "inno-scroll-nav-btn-disabled"}`,
1931
- "aria-label": "Scroll right",
1932
- disabled: !o.canRight,
1933
- onPointerDown: () => H(K),
1934
- onPointerUp: E,
1935
- onPointerLeave: E,
1936
- tabIndex: o.canRight ? 0 : -1,
1937
- children: /* @__PURE__ */ e(Nn, {})
1938
- }
1939
- ),
1940
- /* @__PURE__ */ e(
1941
- "button",
1942
- {
1943
- type: "button",
1944
- className: `inno-scroll-nav-btn inno-scroll-nav-down ${o.canDown ? "" : "inno-scroll-nav-btn-disabled"}`,
1945
- "aria-label": "Scroll down",
1946
- disabled: !o.canDown,
1947
- onPointerDown: () => H(_),
1948
- onPointerUp: E,
1949
- onPointerLeave: E,
1950
- tabIndex: o.canDown ? 0 : -1,
1951
- children: /* @__PURE__ */ e(yn, {})
1952
- }
1953
- )
1940
+ )
1941
+ }
1942
+ ),
1943
+ /* @__PURE__ */ e(
1944
+ "button",
1945
+ {
1946
+ type: "button",
1947
+ className: `inno-scroll-nav-btn inno-scroll-nav-right ${o.canRight ? "" : "inno-scroll-nav-btn-disabled"}`,
1948
+ "aria-label": "Scroll right",
1949
+ disabled: !o.canRight,
1950
+ onPointerDown: () => V(H),
1951
+ onPointerUp: L,
1952
+ onPointerLeave: L,
1953
+ tabIndex: o.canRight ? 0 : -1,
1954
+ children: /* @__PURE__ */ e(Nn, {})
1955
+ }
1956
+ ),
1957
+ /* @__PURE__ */ e(
1958
+ "button",
1959
+ {
1960
+ type: "button",
1961
+ className: `inno-scroll-nav-btn inno-scroll-nav-down ${o.canDown ? "" : "inno-scroll-nav-btn-disabled"}`,
1962
+ "aria-label": "Scroll down",
1963
+ disabled: !o.canDown,
1964
+ onPointerDown: () => V(M),
1965
+ onPointerUp: L,
1966
+ onPointerLeave: L,
1967
+ tabIndex: o.canDown ? 0 : -1,
1968
+ children: /* @__PURE__ */ e(yn, {})
1969
+ }
1970
+ )
1971
+ ] })
1954
1972
  ]
1955
1973
  }
1956
- ) : null;
1974
+ );
1957
1975
  }
1958
1976
  function Dn(t) {
1959
1977
  switch (t) {
@@ -1967,67 +1985,67 @@ function Dn(t) {
1967
1985
  function Mn({
1968
1986
  onEventClick: t,
1969
1987
  onSlotClick: n,
1970
- onSlotSelect: o,
1971
- onAddEvent: a,
1988
+ onSlotSelect: s,
1989
+ onAddEvent: o,
1972
1990
  className: i,
1973
- showHeader: l = !0,
1974
- minSelectionMinutes: p = 30,
1975
- showMoreMode: h,
1976
- showMoreEventsInPopover: d = !1,
1991
+ showHeader: a = !0,
1992
+ minSelectionMinutes: f = 30,
1993
+ showMoreMode: m,
1994
+ showMoreEventsInPopover: c = !1,
1977
1995
  isLoading: v = !1,
1978
- slots: b,
1979
- classNames: w,
1996
+ slots: y,
1997
+ classNames: b,
1980
1998
  settingsContent: A,
1981
1999
  filterContent: $,
1982
2000
  headerActions: P,
1983
- renderPopover: W,
2001
+ renderPopover: F,
1984
2002
  calendarRef: T,
1985
- headerConfig: y,
1986
- eventDetailMode: z,
1987
- renderEventDetail: O
2003
+ headerConfig: C,
2004
+ eventDetailMode: j,
2005
+ renderEventDetail: W
1988
2006
  }) {
1989
- const _ = h ?? (d ? "popover" : "expand"), {
1990
- view: D,
1991
- setView: K,
1992
- selectedDate: E,
1993
- setSelectedDate: H,
2007
+ const _ = m ?? (c ? "popover" : "expand"), {
2008
+ view: M,
2009
+ setView: G,
2010
+ selectedDate: H,
2011
+ setSelectedDate: L,
1994
2012
  slotDuration: V,
1995
- filteredEvents: J,
1996
- users: G,
2013
+ filteredEvents: X,
2014
+ users: Q,
1997
2015
  visibleHours: B,
1998
- workingHours: s,
1999
- badgeVariant: m,
2000
- showWorkingHoursOnly: N,
2001
- clearFocusEventId: L
2002
- } = zt(), S = Q(() => {
2003
- if (!N || !s)
2016
+ workingHours: d,
2017
+ badgeVariant: N,
2018
+ showWorkingHoursOnly: h,
2019
+ clearFocusEventId: D
2020
+ } = zt(), w = te(() => {
2021
+ if (!h || !d)
2004
2022
  return {
2005
2023
  startHour: B.start,
2006
2024
  endHour: B.end
2007
2025
  };
2008
- let f = 24, M = 0;
2009
- for (const U of Object.keys(s)) {
2010
- const re = s[Number(U)];
2011
- !re || re.enabled === !1 || (re.from < f && (f = re.from), re.to > M && (M = re.to));
2026
+ let g = 24, E = 0;
2027
+ for (const U of Object.keys(d)) {
2028
+ const re = d[Number(U)];
2029
+ !re || re.enabled === !1 || (re.from < g && (g = re.from), re.to > E && (E = re.to));
2012
2030
  }
2013
- return f >= M ? {
2031
+ return g >= E ? {
2014
2032
  startHour: B.start,
2015
2033
  endHour: B.end
2016
- } : { startHour: f, endHour: M };
2017
- }, [N, s, B]), Y = S, R = ae(null);
2034
+ } : { startHour: g, endHour: E };
2035
+ }, [h, d, B]), R = w, K = ae(null);
2018
2036
  wt(
2019
2037
  T,
2020
2038
  () => ({
2021
2039
  scrollToToday: () => {
2022
- const f = /* @__PURE__ */ new Date();
2023
- H(f, D), requestAnimationFrame(() => {
2040
+ const g = /* @__PURE__ */ new Date();
2041
+ L(g, M), requestAnimationFrame(() => {
2024
2042
  requestAnimationFrame(() => {
2025
- const M = R.current?.querySelector(
2043
+ const E = K.current?.querySelector(
2026
2044
  ".ic-timeline-scroll-container, [class*='overflow-auto']"
2027
2045
  );
2028
- if (!M) return;
2029
- const De = (f.getHours() - S.startHour) * 96;
2030
- De > 0 && M.scrollTo({
2046
+ if (!E) return;
2047
+ const De = (g.getHours() - w.startHour) * 96;
2048
+ De > 0 && E.scrollTo({
2031
2049
  top: Math.max(0, De - 100),
2032
2050
  // Offset to show some context
2033
2051
  behavior: "smooth"
@@ -2036,149 +2054,149 @@ function Mn({
2036
2054
  });
2037
2055
  },
2038
2056
  scrollToWorkingHours: () => {
2039
- let f = 8;
2040
- if (s)
2041
- for (const M of Object.keys(s)) {
2042
- const U = s[Number(M)];
2043
- U?.enabled && U.from < f && (f = Math.max(U.from - 1, 0));
2057
+ let g = 8;
2058
+ if (d)
2059
+ for (const E of Object.keys(d)) {
2060
+ const U = d[Number(E)];
2061
+ U?.enabled && U.from < g && (g = Math.max(U.from - 1, 0));
2044
2062
  }
2045
2063
  requestAnimationFrame(() => {
2046
2064
  requestAnimationFrame(() => {
2047
- const M = R.current?.querySelector(
2065
+ const E = K.current?.querySelector(
2048
2066
  ".ic-timeline-scroll-container, [class*='overflow-auto']"
2049
2067
  );
2050
- if (!M) return;
2051
- const re = (f - S.startHour) * 96;
2052
- M.scrollTo({
2068
+ if (!E) return;
2069
+ const re = (g - w.startHour) * 96;
2070
+ E.scrollTo({
2053
2071
  top: Math.max(0, re),
2054
2072
  behavior: "smooth"
2055
2073
  });
2056
2074
  });
2057
2075
  });
2058
2076
  },
2059
- getViewRect: () => R.current?.getBoundingClientRect() ?? null,
2060
- focusEvent: (f) => {
2061
- L(), requestAnimationFrame(() => {
2062
- L();
2077
+ getViewRect: () => K.current?.getBoundingClientRect() ?? null,
2078
+ focusEvent: (g) => {
2079
+ D(), requestAnimationFrame(() => {
2080
+ D();
2063
2081
  });
2064
- const M = R.current?.querySelector(
2065
- `[data-event-id="${f}"]`
2082
+ const E = K.current?.querySelector(
2083
+ `[data-event-id="${g}"]`
2066
2084
  );
2067
- M && setTimeout(() => M.click(), 150);
2085
+ E && setTimeout(() => E.click(), 150);
2068
2086
  }
2069
2087
  }),
2070
2088
  [
2071
- H,
2072
- D,
2073
- S,
2074
- s,
2075
- L
2089
+ L,
2090
+ M,
2091
+ w,
2092
+ d,
2093
+ D
2076
2094
  ]
2077
2095
  );
2078
- const se = Q(() => Dn(D), [D]), ee = F(
2079
- (f) => {
2080
- if (o) {
2081
- o(f);
2096
+ const Z = te(() => Dn(M), [M]), Y = O(
2097
+ (g) => {
2098
+ if (s) {
2099
+ s(g);
2082
2100
  return;
2083
2101
  }
2084
2102
  if (n) {
2085
- const M = f.startDate.getHours();
2086
- n(f.startDate, M);
2103
+ const E = g.startDate.getHours();
2104
+ n(g.startDate, E);
2087
2105
  }
2088
2106
  },
2089
- [o, n]
2090
- ), Z = F(
2091
- (f) => {
2092
- K("day"), H(f, "day");
2107
+ [s, n]
2108
+ ), J = O(
2109
+ (g) => {
2110
+ G("day"), L(g, "day");
2093
2111
  },
2094
- [H, K]
2095
- ), ve = F(
2096
- (f) => {
2097
- K("month"), H(f, "month");
2112
+ [L, G]
2113
+ ), ue = O(
2114
+ (g) => {
2115
+ G("month"), L(g, "month");
2098
2116
  },
2099
- [H, K]
2100
- ), ne = F(
2101
- (f) => {
2102
- t?.(f);
2117
+ [L, G]
2118
+ ), se = O(
2119
+ (g) => {
2120
+ t?.(g);
2103
2121
  },
2104
2122
  [t]
2105
- ), le = F(
2106
- (f, M, U) => {
2107
- n?.(f, M);
2123
+ ), le = O(
2124
+ (g, E, U) => {
2125
+ n?.(g, E);
2108
2126
  },
2109
2127
  [n]
2110
- ), be = () => {
2111
- const f = J, M = ne, U = W;
2112
- switch (D) {
2128
+ ), we = () => {
2129
+ const g = X, E = se, U = F;
2130
+ switch (M) {
2113
2131
  case "day":
2114
2132
  return /* @__PURE__ */ e(
2115
2133
  St,
2116
2134
  {
2117
- events: f,
2118
- date: E,
2119
- visibleHours: Y,
2120
- workingHours: s,
2135
+ events: g,
2136
+ date: H,
2137
+ visibleHours: R,
2138
+ workingHours: d,
2121
2139
  slotDuration: V,
2122
- badgeVariant: m,
2123
- onEventClick: M,
2140
+ badgeVariant: N,
2141
+ onEventClick: E,
2124
2142
  renderPopover: U,
2125
- ...b && { slots: b },
2126
- ...w && { classNames: w }
2143
+ ...y && { slots: y },
2144
+ ...b && { classNames: b }
2127
2145
  }
2128
2146
  );
2129
2147
  case "week":
2130
2148
  return /* @__PURE__ */ e(
2131
2149
  Mt,
2132
2150
  {
2133
- events: f,
2134
- date: E,
2135
- visibleHours: Y,
2136
- workingHours: s,
2151
+ events: g,
2152
+ date: H,
2153
+ visibleHours: R,
2154
+ workingHours: d,
2137
2155
  slotDuration: V,
2138
- badgeVariant: m,
2139
- onEventClick: M,
2156
+ badgeVariant: N,
2157
+ onEventClick: E,
2140
2158
  renderPopover: U,
2141
- ...b && { slots: b },
2142
- ...w && { classNames: w }
2159
+ ...y && { slots: y },
2160
+ ...b && { classNames: b }
2143
2161
  }
2144
2162
  );
2145
2163
  case "month":
2146
2164
  return /* @__PURE__ */ e(
2147
2165
  Ve,
2148
2166
  {
2149
- events: f,
2150
- date: E,
2151
- badgeVariant: m,
2152
- onEventClick: M,
2153
- onDayClick: Z,
2167
+ events: g,
2168
+ date: H,
2169
+ badgeVariant: N,
2170
+ onEventClick: E,
2171
+ onDayClick: J,
2154
2172
  renderPopover: U,
2155
2173
  showMoreMode: _,
2156
- ...b && { slots: b },
2157
- ...w && { classNames: w }
2174
+ ...y && { slots: y },
2175
+ ...b && { classNames: b }
2158
2176
  }
2159
2177
  );
2160
2178
  case "year":
2161
2179
  return /* @__PURE__ */ e(
2162
2180
  gn,
2163
2181
  {
2164
- events: f,
2165
- year: E.getFullYear(),
2166
- onMonthClick: ve,
2167
- onDayClick: Z,
2168
- ...b && { slots: b },
2169
- ...w && { classNames: w }
2182
+ events: g,
2183
+ year: H.getFullYear(),
2184
+ onMonthClick: ue,
2185
+ onDayClick: J,
2186
+ ...y && { slots: y },
2187
+ ...b && { classNames: b }
2170
2188
  }
2171
2189
  );
2172
2190
  case "agenda":
2173
2191
  return /* @__PURE__ */ e(
2174
2192
  Dt,
2175
2193
  {
2176
- events: f,
2177
- date: E,
2178
- onEventClick: M,
2194
+ events: g,
2195
+ date: H,
2196
+ onEventClick: E,
2179
2197
  renderPopover: U,
2180
- ...b && { slots: b },
2181
- ...w && { classNames: w }
2198
+ ...y && { slots: y },
2199
+ ...b && { classNames: b }
2182
2200
  }
2183
2201
  );
2184
2202
  // Resource views — delegate to TimelineView with matching day count
@@ -2187,19 +2205,19 @@ function Mn({
2187
2205
  Le,
2188
2206
  {
2189
2207
  daysToShow: 1,
2190
- events: f,
2191
- users: G,
2192
- selectedDate: E,
2208
+ events: g,
2209
+ users: Q,
2210
+ selectedDate: H,
2193
2211
  visibleHours: {
2194
- from: S.startHour,
2195
- to: S.endHour
2212
+ from: w.startHour,
2213
+ to: w.endHour
2196
2214
  },
2197
- onEventClick: M,
2198
- onSlotSelect: ee,
2215
+ onEventClick: E,
2216
+ onSlotSelect: Y,
2199
2217
  onSlotClick: le,
2200
2218
  renderPopover: U,
2201
- ...b && { slots: b },
2202
- ...w && { classNames: w }
2219
+ ...y && { slots: y },
2220
+ ...b && { classNames: b }
2203
2221
  }
2204
2222
  );
2205
2223
  case "resource-week":
@@ -2207,19 +2225,19 @@ function Mn({
2207
2225
  Le,
2208
2226
  {
2209
2227
  daysToShow: 7,
2210
- events: f,
2211
- users: G,
2212
- selectedDate: E,
2228
+ events: g,
2229
+ users: Q,
2230
+ selectedDate: H,
2213
2231
  visibleHours: {
2214
- from: S.startHour,
2215
- to: S.endHour
2232
+ from: w.startHour,
2233
+ to: w.endHour
2216
2234
  },
2217
- onEventClick: M,
2218
- onSlotSelect: ee,
2235
+ onEventClick: E,
2236
+ onSlotSelect: Y,
2219
2237
  onSlotClick: le,
2220
2238
  renderPopover: U,
2221
- ...b && { slots: b },
2222
- ...w && { classNames: w }
2239
+ ...y && { slots: y },
2240
+ ...b && { classNames: b }
2223
2241
  }
2224
2242
  );
2225
2243
  // Timeline views
@@ -2228,19 +2246,19 @@ function Mn({
2228
2246
  Le,
2229
2247
  {
2230
2248
  daysToShow: 1,
2231
- events: f,
2232
- users: G,
2233
- selectedDate: E,
2249
+ events: g,
2250
+ users: Q,
2251
+ selectedDate: H,
2234
2252
  visibleHours: {
2235
- from: S.startHour,
2236
- to: S.endHour
2253
+ from: w.startHour,
2254
+ to: w.endHour
2237
2255
  },
2238
- onEventClick: M,
2239
- onSlotSelect: ee,
2256
+ onEventClick: E,
2257
+ onSlotSelect: Y,
2240
2258
  onSlotClick: le,
2241
2259
  renderPopover: U,
2242
- ...b && { slots: b },
2243
- ...w && { classNames: w }
2260
+ ...y && { slots: y },
2261
+ ...b && { classNames: b }
2244
2262
  }
2245
2263
  );
2246
2264
  case "timeline-3day":
@@ -2248,19 +2266,19 @@ function Mn({
2248
2266
  Le,
2249
2267
  {
2250
2268
  daysToShow: 3,
2251
- events: f,
2252
- users: G,
2253
- selectedDate: E,
2269
+ events: g,
2270
+ users: Q,
2271
+ selectedDate: H,
2254
2272
  visibleHours: {
2255
- from: S.startHour,
2256
- to: S.endHour
2273
+ from: w.startHour,
2274
+ to: w.endHour
2257
2275
  },
2258
- onEventClick: M,
2259
- onSlotSelect: ee,
2276
+ onEventClick: E,
2277
+ onSlotSelect: Y,
2260
2278
  onSlotClick: le,
2261
2279
  renderPopover: U,
2262
- ...b && { slots: b },
2263
- ...w && { classNames: w }
2280
+ ...y && { slots: y },
2281
+ ...b && { classNames: b }
2264
2282
  }
2265
2283
  );
2266
2284
  case "timeline-week":
@@ -2268,70 +2286,70 @@ function Mn({
2268
2286
  Le,
2269
2287
  {
2270
2288
  daysToShow: 7,
2271
- events: f,
2272
- users: G,
2273
- selectedDate: E,
2289
+ events: g,
2290
+ users: Q,
2291
+ selectedDate: H,
2274
2292
  visibleHours: {
2275
- from: S.startHour,
2276
- to: S.endHour
2293
+ from: w.startHour,
2294
+ to: w.endHour
2277
2295
  },
2278
- onEventClick: M,
2279
- onSlotSelect: ee,
2296
+ onEventClick: E,
2297
+ onSlotSelect: Y,
2280
2298
  onSlotClick: le,
2281
2299
  renderPopover: U,
2282
- ...b && { slots: b },
2283
- ...w && { classNames: w }
2300
+ ...y && { slots: y },
2301
+ ...b && { classNames: b }
2284
2302
  }
2285
2303
  );
2286
2304
  default:
2287
2305
  return /* @__PURE__ */ e(
2288
2306
  Ve,
2289
2307
  {
2290
- events: f,
2291
- date: E,
2292
- badgeVariant: m,
2293
- onEventClick: M,
2294
- onDayClick: Z,
2295
- ...b && { slots: b },
2296
- ...w && { classNames: w }
2308
+ events: g,
2309
+ date: H,
2310
+ badgeVariant: N,
2311
+ onEventClick: E,
2312
+ onDayClick: J,
2313
+ ...y && { slots: y },
2314
+ ...b && { classNames: b }
2297
2315
  }
2298
2316
  );
2299
2317
  }
2300
- }, ue = ae(null);
2318
+ }, he = ae(null);
2301
2319
  return de(() => {
2302
- R.current = ue.current;
2320
+ K.current = he.current;
2303
2321
  }), /* @__PURE__ */ e(
2304
2322
  It,
2305
2323
  {
2306
- mode: se,
2307
- onSelect: ee,
2308
- minDurationMinutes: p,
2324
+ mode: Z,
2325
+ onSelect: Y,
2326
+ minDurationMinutes: f,
2309
2327
  slotDurationMinutes: V,
2310
- enabled: !!(o || n),
2328
+ enabled: !!(s || n),
2311
2329
  children: /* @__PURE__ */ r(
2312
2330
  "div",
2313
2331
  {
2314
- className: g(
2332
+ className: p(
2315
2333
  "inno-calendar-root flex flex-col h-full p-4",
2316
- w?.root,
2334
+ b?.root,
2317
2335
  i
2318
2336
  ),
2319
2337
  children: [
2320
- l && /* @__PURE__ */ e(
2338
+ a && /* @__PURE__ */ e(
2321
2339
  Ct,
2322
2340
  {
2323
- currentDate: E,
2324
- view: D,
2325
- events: J,
2326
- onViewChange: K,
2327
- onNavigateToday: () => H(/* @__PURE__ */ new Date(), D),
2341
+ currentDate: H,
2342
+ view: M,
2343
+ events: X,
2344
+ onViewChange: G,
2345
+ onNavigateToday: () => L(/* @__PURE__ */ new Date(), M),
2328
2346
  onNavigatePrev: () => {
2329
- const f = new Date(E);
2330
- D === "day" || D === "timeline-day" || D === "resource-day" ? f.setDate(f.getDate() - 1) : D === "timeline-3day" ? f.setDate(f.getDate() - 3) : D === "week" || D === "timeline-week" || D === "resource-week" ? f.setDate(f.getDate() - 7) : D === "month" ? f.setMonth(f.getMonth() - 1) : D === "year" ? f.setFullYear(f.getFullYear() - 1) : f.setDate(f.getDate() - 7), H(f, D);
2347
+ const g = new Date(H);
2348
+ M === "day" || M === "timeline-day" || M === "resource-day" ? g.setDate(g.getDate() - 1) : M === "timeline-3day" ? g.setDate(g.getDate() - 3) : M === "week" || M === "timeline-week" || M === "resource-week" ? g.setDate(g.getDate() - 7) : M === "month" ? g.setMonth(g.getMonth() - 1) : M === "year" ? g.setFullYear(g.getFullYear() - 1) : g.setDate(g.getDate() - 7), L(g, M);
2331
2349
  },
2332
2350
  onNavigateNext: () => {
2333
- const f = new Date(E);
2334
- D === "day" || D === "timeline-day" || D === "resource-day" ? f.setDate(f.getDate() + 1) : D === "timeline-3day" ? f.setDate(f.getDate() + 3) : D === "week" || D === "timeline-week" || D === "resource-week" ? f.setDate(f.getDate() + 7) : D === "month" ? f.setMonth(f.getMonth() + 1) : D === "year" ? f.setFullYear(f.getFullYear() + 1) : f.setDate(f.getDate() + 7), H(f, D);
2351
+ const g = new Date(H);
2352
+ M === "day" || M === "timeline-day" || M === "resource-day" ? g.setDate(g.getDate() + 1) : M === "timeline-3day" ? g.setDate(g.getDate() + 3) : M === "week" || M === "timeline-week" || M === "resource-week" ? g.setDate(g.getDate() + 7) : M === "month" ? g.setMonth(g.getMonth() + 1) : M === "year" ? g.setFullYear(g.getFullYear() + 1) : g.setDate(g.getDate() + 7), L(g, M);
2335
2353
  },
2336
2354
  availableViews: [
2337
2355
  "day",
@@ -2342,27 +2360,27 @@ function Mn({
2342
2360
  ],
2343
2361
  showTimelineViews: !0,
2344
2362
  showSettings: !!A,
2345
- ...!P && a && { onAddEvent: a },
2363
+ ...!P && o && { onAddEvent: o },
2346
2364
  actions: P,
2347
2365
  settingsContent: A,
2348
2366
  filterContent: $,
2349
- ...y && { headerConfig: y }
2367
+ ...C && { headerConfig: C }
2350
2368
  }
2351
2369
  ),
2352
2370
  /* @__PURE__ */ r("div", { className: "relative flex-1 min-h-0", children: [
2353
2371
  /* @__PURE__ */ e(
2354
2372
  "div",
2355
2373
  {
2356
- ref: ue,
2357
- className: g(
2374
+ ref: he,
2375
+ className: p(
2358
2376
  "h-full border rounded-lg bg-white overflow-x-auto",
2359
- w?.viewContainer
2377
+ b?.viewContainer
2360
2378
  ),
2361
- children: be()
2379
+ children: we()
2362
2380
  }
2363
2381
  ),
2364
2382
  v && /* @__PURE__ */ e("div", { className: "inno-calendar-loading-overlay", children: /* @__PURE__ */ e("div", { className: "inno-calendar-spinner" }) }),
2365
- /* @__PURE__ */ e(Cn, { containerRef: ue })
2383
+ /* @__PURE__ */ e(Cn, { containerRef: he, currentDate: H })
2366
2384
  ] })
2367
2385
  ]
2368
2386
  }
@@ -2373,90 +2391,90 @@ function Mn({
2373
2391
  function Sn({
2374
2392
  events: t,
2375
2393
  users: n = [],
2376
- scheduleTypes: o = [],
2377
- initialView: a = "week",
2394
+ scheduleTypes: s = [],
2395
+ initialView: o = "week",
2378
2396
  initialDate: i,
2379
- initialSelectedUserId: l,
2380
- initialScheduleTypeIds: p,
2381
- initialParticipantIds: h,
2382
- initialWorkingHoursView: d,
2397
+ initialSelectedUserId: a,
2398
+ initialScheduleTypeIds: f,
2399
+ initialParticipantIds: m,
2400
+ initialWorkingHoursView: c,
2383
2401
  initialSearchQuery: v,
2384
- preferencesConfig: b,
2385
- onEventClick: w,
2402
+ preferencesConfig: y,
2403
+ onEventClick: b,
2386
2404
  onSlotClick: A,
2387
2405
  onSlotSelect: $,
2388
2406
  onAddEvent: P,
2389
- onEventDrop: W,
2407
+ onEventDrop: F,
2390
2408
  onDateChange: T,
2391
- onViewChange: y,
2392
- className: z,
2393
- showHeader: O = !0,
2409
+ onViewChange: C,
2410
+ className: j,
2411
+ showHeader: W = !0,
2394
2412
  minSelectionMinutes: _ = 30,
2395
- showMoreMode: D,
2396
- showMoreEventsInPopover: K = !1,
2397
- isLoading: E = !1,
2398
- renderPopover: H,
2413
+ showMoreMode: M,
2414
+ showMoreEventsInPopover: G = !1,
2415
+ isLoading: H = !1,
2416
+ renderPopover: L,
2399
2417
  slots: V,
2400
- classNames: J,
2401
- settingsContent: G,
2418
+ classNames: X,
2419
+ settingsContent: Q,
2402
2420
  filterContent: B,
2403
- headerActions: s,
2404
- focusEventId: m,
2405
- headerConfig: N,
2406
- eventDetailMode: L,
2407
- renderEventDetail: S
2408
- }, Y) {
2409
- return /* @__PURE__ */ e(Tt, { ...W && { onEventDrop: W }, children: /* @__PURE__ */ e(
2421
+ headerActions: d,
2422
+ focusEventId: N,
2423
+ headerConfig: h,
2424
+ eventDetailMode: D,
2425
+ renderEventDetail: w
2426
+ }, R) {
2427
+ return /* @__PURE__ */ e(Tt, { ...F && { onEventDrop: F }, children: /* @__PURE__ */ e(
2410
2428
  Ht,
2411
2429
  {
2412
2430
  initialEvents: t,
2413
2431
  initialUsers: n,
2414
- initialScheduleTypes: o,
2415
- initialView: a,
2432
+ initialScheduleTypes: s,
2433
+ initialView: o,
2416
2434
  ...i && { initialDate: i },
2417
- ...l && { initialSelectedUserId: l },
2418
- ...p && { initialScheduleTypeIds: p },
2419
- ...h && { initialParticipantIds: h },
2420
- ...d && { initialWorkingHoursView: d },
2435
+ ...a && { initialSelectedUserId: a },
2436
+ ...f && { initialScheduleTypeIds: f },
2437
+ ...m && { initialParticipantIds: m },
2438
+ ...c && { initialWorkingHoursView: c },
2421
2439
  ...v && { initialSearchQuery: v },
2422
- ...b && { preferencesConfig: b },
2440
+ ...y && { preferencesConfig: y },
2423
2441
  ...T && { onDateChange: T },
2424
- ...y && { onViewChange: y },
2425
- ...m && { initialFocusEventId: m },
2442
+ ...C && { onViewChange: C },
2443
+ ...N && { initialFocusEventId: N },
2426
2444
  children: /* @__PURE__ */ e(
2427
2445
  Mn,
2428
2446
  {
2429
- ...w && { onEventClick: w },
2447
+ ...b && { onEventClick: b },
2430
2448
  ...A && { onSlotClick: A },
2431
2449
  ...$ && { onSlotSelect: $ },
2432
2450
  ...P && { onAddEvent: P },
2433
- ...H && { renderPopover: H },
2434
- className: z,
2435
- showHeader: O,
2451
+ ...L && { renderPopover: L },
2452
+ className: j,
2453
+ showHeader: W,
2436
2454
  minSelectionMinutes: _,
2437
- ...D && { showMoreMode: D },
2438
- showMoreEventsInPopover: K,
2439
- isLoading: E,
2455
+ ...M && { showMoreMode: M },
2456
+ showMoreEventsInPopover: G,
2457
+ isLoading: H,
2440
2458
  ...V && { slots: V },
2441
- ...J && { classNames: J },
2442
- settingsContent: G,
2459
+ ...X && { classNames: X },
2460
+ settingsContent: Q,
2443
2461
  filterContent: B,
2444
- headerActions: s,
2445
- calendarRef: Y,
2446
- ...N && { headerConfig: N },
2447
- ...L && { eventDetailMode: L },
2448
- ...S && { renderEventDetail: S }
2462
+ headerActions: d,
2463
+ calendarRef: R,
2464
+ ...h && { headerConfig: h },
2465
+ ...D && { eventDetailMode: D },
2466
+ ...w && { renderEventDetail: w }
2449
2467
  }
2450
2468
  )
2451
2469
  }
2452
2470
  ) });
2453
2471
  }
2454
- const Cr = Ae(Sn), xe = Ae(
2455
- ({ className: t, children: n, ...o }, a) => /* @__PURE__ */ e(
2472
+ const Cr = Ae(Sn), ve = Ae(
2473
+ ({ className: t, children: n, ...s }, o) => /* @__PURE__ */ e(
2456
2474
  "select",
2457
2475
  {
2458
- ref: a,
2459
- className: g(
2476
+ ref: o,
2477
+ className: p(
2460
2478
  "flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm",
2461
2479
  "ring-offset-background",
2462
2480
  "focus:outline-none focus:ring-1 focus:ring-ring",
@@ -2464,24 +2482,24 @@ const Cr = Ae(Sn), xe = Ae(
2464
2482
  "[&>option]:bg-background",
2465
2483
  t
2466
2484
  ),
2467
- ...o,
2485
+ ...s,
2468
2486
  children: n
2469
2487
  }
2470
2488
  )
2471
2489
  );
2472
- xe.displayName = "Select";
2473
- const he = Ae(({ className: t, ...n }, o) => /* @__PURE__ */ e(
2490
+ ve.displayName = "Select";
2491
+ const me = Ae(({ className: t, ...n }, s) => /* @__PURE__ */ e(
2474
2492
  "label",
2475
2493
  {
2476
- ref: o,
2477
- className: g(
2494
+ ref: s,
2495
+ className: p(
2478
2496
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
2479
2497
  t
2480
2498
  ),
2481
2499
  ...n
2482
2500
  }
2483
2501
  ));
2484
- he.displayName = "Label";
2502
+ me.displayName = "Label";
2485
2503
  function En({ className: t }) {
2486
2504
  return /* @__PURE__ */ r(
2487
2505
  "svg",
@@ -2533,37 +2551,37 @@ const Tn = [
2533
2551
  function Dr({
2534
2552
  value: t,
2535
2553
  onChange: n,
2536
- isLocked: o = !1,
2537
- className: a,
2554
+ isLocked: s = !1,
2555
+ className: o,
2538
2556
  labels: i = {}
2539
2557
  }) {
2540
- const l = {
2558
+ const a = {
2541
2559
  title: "Slot duration",
2542
2560
  lockedMessage: "This setting is locked by the administrator",
2543
2561
  infoMessage: "Set the time slot duration for day and week calendar views.",
2544
2562
  ...i
2545
- }, p = (h) => {
2546
- o || n(Number(h.target.value));
2563
+ }, f = (m) => {
2564
+ s || n(Number(m.target.value));
2547
2565
  };
2548
- return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
2566
+ return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-3", o), children: [
2549
2567
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2550
- /* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
2551
- o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2552
- /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Ln, { className: "size-3 text-muted-foreground" }) }),
2553
- /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
2554
- ] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2555
- /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(En, { className: "size-3 text-muted-foreground" }) }),
2556
- /* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
2568
+ /* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: a.title }),
2569
+ s ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
2570
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Ln, { className: "size-3 text-muted-foreground" }) }),
2571
+ /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
2572
+ ] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
2573
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(En, { className: "size-3 text-muted-foreground" }) }),
2574
+ /* @__PURE__ */ e(xe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
2557
2575
  ] }) })
2558
2576
  ] }),
2559
2577
  /* @__PURE__ */ e(
2560
- xe,
2578
+ ve,
2561
2579
  {
2562
2580
  value: t.toString(),
2563
- onChange: p,
2564
- disabled: o,
2581
+ onChange: f,
2582
+ disabled: s,
2565
2583
  className: "h-9 w-[128px] text-sm",
2566
- children: Tn.map((h) => /* @__PURE__ */ e("option", { value: h.value.toString(), children: h.label }, h.value))
2584
+ children: Tn.map((m) => /* @__PURE__ */ e("option", { value: m.value.toString(), children: m.label }, m.value))
2567
2585
  }
2568
2586
  )
2569
2587
  ] });
@@ -2619,11 +2637,11 @@ const In = [
2619
2637
  function Mr({
2620
2638
  value: t,
2621
2639
  onChange: n,
2622
- isLocked: o = !1,
2623
- className: a,
2640
+ isLocked: s = !1,
2641
+ className: o,
2624
2642
  labels: i = {}
2625
2643
  }) {
2626
- const l = {
2644
+ const a = {
2627
2645
  title: "Event display",
2628
2646
  lockedMessage: "This setting is locked by the administrator",
2629
2647
  infoMessage: "Choose how events are displayed. Dot shows a small indicator, colored fills the entire event, mixed uses both.",
@@ -2633,28 +2651,28 @@ function Mr({
2633
2651
  mixed: "Mixed"
2634
2652
  },
2635
2653
  ...i
2636
- }, p = (d) => l.options?.[d] ?? d, h = (d) => {
2637
- o || n(d.target.value);
2654
+ }, f = (c) => a.options?.[c] ?? c, m = (c) => {
2655
+ s || n(c.target.value);
2638
2656
  };
2639
- return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
2657
+ return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-3", o), children: [
2640
2658
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2641
- /* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
2642
- o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2643
- /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(zn, { className: "size-3 text-muted-foreground" }) }),
2644
- /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
2645
- ] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2646
- /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Hn, { className: "size-3 text-muted-foreground" }) }),
2647
- /* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
2659
+ /* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: a.title }),
2660
+ s ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
2661
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(zn, { className: "size-3 text-muted-foreground" }) }),
2662
+ /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
2663
+ ] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
2664
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Hn, { className: "size-3 text-muted-foreground" }) }),
2665
+ /* @__PURE__ */ e(xe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
2648
2666
  ] }) })
2649
2667
  ] }),
2650
2668
  /* @__PURE__ */ e(
2651
- xe,
2669
+ ve,
2652
2670
  {
2653
2671
  value: t,
2654
- onChange: h,
2655
- disabled: o,
2672
+ onChange: m,
2673
+ disabled: s,
2656
2674
  className: "h-9 w-[128px] text-sm",
2657
- children: In.map((d) => /* @__PURE__ */ e("option", { value: d.value, children: p(d.value) }, d.value))
2675
+ children: In.map((c) => /* @__PURE__ */ e("option", { value: c.value, children: f(c.value) }, c.value))
2658
2676
  }
2659
2677
  )
2660
2678
  ] });
@@ -2711,48 +2729,48 @@ function Pn() {
2711
2729
  function Sr({
2712
2730
  value: t,
2713
2731
  onChange: n,
2714
- isLocked: o = !1,
2715
- className: a,
2732
+ isLocked: s = !1,
2733
+ className: o,
2716
2734
  labels: i = {}
2717
2735
  }) {
2718
- const l = {
2736
+ const a = {
2719
2737
  title: "Visible hours",
2720
2738
  from: "From",
2721
2739
  to: "To",
2722
2740
  lockedMessage: "This setting is locked by the administrator",
2723
2741
  infoMessage: "Set the visible hour range for day and week views. Hours outside this range will be hidden.",
2724
2742
  ...i
2725
- }, p = Pn(), h = (v) => {
2726
- if (o) return;
2727
- const b = Number(v.target.value);
2728
- b < t.endHour && n({ ...t, startHour: b });
2729
- }, d = (v) => {
2730
- if (o) return;
2731
- const b = Number(v.target.value);
2732
- b > t.startHour && n({ ...t, endHour: b });
2743
+ }, f = Pn(), m = (v) => {
2744
+ if (s) return;
2745
+ const y = Number(v.target.value);
2746
+ y < t.endHour && n({ ...t, startHour: y });
2747
+ }, c = (v) => {
2748
+ if (s) return;
2749
+ const y = Number(v.target.value);
2750
+ y > t.startHour && n({ ...t, endHour: y });
2733
2751
  };
2734
- return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
2752
+ return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-3", o), children: [
2735
2753
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2736
- /* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
2737
- o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2738
- /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(An, { className: "size-3 text-muted-foreground" }) }),
2739
- /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
2740
- ] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2741
- /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(jn, { className: "size-3 text-muted-foreground" }) }),
2742
- /* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
2754
+ /* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: a.title }),
2755
+ s ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
2756
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(An, { className: "size-3 text-muted-foreground" }) }),
2757
+ /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
2758
+ ] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
2759
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(jn, { className: "size-3 text-muted-foreground" }) }),
2760
+ /* @__PURE__ */ e(xe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
2743
2761
  ] }) })
2744
2762
  ] }),
2745
2763
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2746
2764
  /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
2747
- /* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l.from }),
2765
+ /* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: a.from }),
2748
2766
  /* @__PURE__ */ e(
2749
- xe,
2767
+ ve,
2750
2768
  {
2751
2769
  value: t.startHour.toString(),
2752
- onChange: h,
2753
- disabled: o,
2770
+ onChange: m,
2771
+ disabled: s,
2754
2772
  className: "h-9 w-[88px] text-sm",
2755
- children: p.map((v) => /* @__PURE__ */ e(
2773
+ children: f.map((v) => /* @__PURE__ */ e(
2756
2774
  "option",
2757
2775
  {
2758
2776
  value: v.value.toString(),
@@ -2766,15 +2784,15 @@ function Sr({
2766
2784
  ] }),
2767
2785
  /* @__PURE__ */ e("span", { className: "mt-5 text-muted-foreground", children: "—" }),
2768
2786
  /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
2769
- /* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l.to }),
2787
+ /* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: a.to }),
2770
2788
  /* @__PURE__ */ e(
2771
- xe,
2789
+ ve,
2772
2790
  {
2773
2791
  value: t.endHour.toString(),
2774
- onChange: d,
2775
- disabled: o,
2792
+ onChange: c,
2793
+ disabled: s,
2776
2794
  className: "h-9 w-[88px] text-sm",
2777
- children: p.map((v) => /* @__PURE__ */ e(
2795
+ children: f.map((v) => /* @__PURE__ */ e(
2778
2796
  "option",
2779
2797
  {
2780
2798
  value: v.value.toString(),
@@ -2874,17 +2892,17 @@ const nt = {
2874
2892
  friday: "Fri",
2875
2893
  saturday: "Sat"
2876
2894
  };
2877
- function Bn({ dayLabel: t, config: n, onChange: o, disabled: a, hourOptions: i }) {
2878
- const l = () => {
2879
- a || o({ ...n, enabled: !n.enabled });
2880
- }, p = (d) => {
2881
- if (a) return;
2882
- const v = Number(d.target.value);
2883
- v < n.to && o({ ...n, from: v });
2884
- }, h = (d) => {
2885
- if (a) return;
2886
- const v = Number(d.target.value);
2887
- v > n.from && o({ ...n, to: v });
2895
+ function Bn({ dayLabel: t, config: n, onChange: s, disabled: o, hourOptions: i }) {
2896
+ const a = () => {
2897
+ o || s({ ...n, enabled: !n.enabled });
2898
+ }, f = (c) => {
2899
+ if (o) return;
2900
+ const v = Number(c.target.value);
2901
+ v < n.to && s({ ...n, from: v });
2902
+ }, m = (c) => {
2903
+ if (o) return;
2904
+ const v = Number(c.target.value);
2905
+ v > n.from && s({ ...n, to: v });
2888
2906
  };
2889
2907
  return /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2890
2908
  /* @__PURE__ */ e(
@@ -2894,36 +2912,36 @@ function Bn({ dayLabel: t, config: n, onChange: o, disabled: a, hourOptions: i }
2894
2912
  role: "checkbox",
2895
2913
  "aria-checked": n.enabled,
2896
2914
  "aria-label": `Enable ${t}`,
2897
- onClick: l,
2898
- disabled: a,
2899
- className: g(
2915
+ onClick: a,
2916
+ disabled: o,
2917
+ className: p(
2900
2918
  "flex size-5 shrink-0 items-center justify-center rounded border transition-colors",
2901
2919
  n.enabled ? "border-primary bg-primary text-primary-foreground" : "border-input bg-background",
2902
- a && "cursor-not-allowed opacity-50"
2920
+ o && "cursor-not-allowed opacity-50"
2903
2921
  ),
2904
2922
  children: n.enabled && /* @__PURE__ */ e($n, { className: "size-3" })
2905
2923
  }
2906
2924
  ),
2907
- /* @__PURE__ */ e("span", { className: g("w-10 text-sm", !n.enabled && "text-muted-foreground"), children: t }),
2925
+ /* @__PURE__ */ e("span", { className: p("w-10 text-sm", !n.enabled && "text-muted-foreground"), children: t }),
2908
2926
  /* @__PURE__ */ e(
2909
- xe,
2927
+ ve,
2910
2928
  {
2911
2929
  value: n.from.toString(),
2912
- onChange: p,
2913
- disabled: a || !n.enabled,
2930
+ onChange: f,
2931
+ disabled: o || !n.enabled,
2914
2932
  className: "h-8 w-[76px] text-xs",
2915
- children: i.map((d) => /* @__PURE__ */ e("option", { value: d.value.toString(), disabled: d.value >= n.to, children: d.label }, d.value))
2933
+ children: i.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value >= n.to, children: c.label }, c.value))
2916
2934
  }
2917
2935
  ),
2918
2936
  /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "—" }),
2919
2937
  /* @__PURE__ */ e(
2920
- xe,
2938
+ ve,
2921
2939
  {
2922
2940
  value: n.to.toString(),
2923
- onChange: h,
2924
- disabled: a || !n.enabled,
2941
+ onChange: m,
2942
+ disabled: o || !n.enabled,
2925
2943
  className: "h-8 w-[76px] text-xs",
2926
- children: i.map((d) => /* @__PURE__ */ e("option", { value: d.value.toString(), disabled: d.value <= n.from, children: d.label }, d.value))
2944
+ children: i.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value <= n.from, children: c.label }, c.value))
2927
2945
  }
2928
2946
  )
2929
2947
  ] });
@@ -2931,40 +2949,40 @@ function Bn({ dayLabel: t, config: n, onChange: o, disabled: a, hourOptions: i }
2931
2949
  function Er({
2932
2950
  value: t,
2933
2951
  onChange: n,
2934
- isLocked: o = !1,
2935
- className: a,
2952
+ isLocked: s = !1,
2953
+ className: o,
2936
2954
  labels: i = {}
2937
2955
  }) {
2938
- const l = {
2956
+ const a = {
2939
2957
  title: "Working hours",
2940
2958
  lockedMessage: "This setting is locked by the administrator",
2941
2959
  infoMessage: "Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",
2942
2960
  days: nt,
2943
2961
  ...i
2944
- }, p = _n(), h = (d, v) => {
2945
- o || n({ ...t, [d]: v });
2962
+ }, f = _n(), m = (c, v) => {
2963
+ s || n({ ...t, [c]: v });
2946
2964
  };
2947
- return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-3", a), children: [
2965
+ return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-3", o), children: [
2948
2966
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2949
- /* @__PURE__ */ e(he, { className: "text-sm font-semibold", children: l.title }),
2950
- o ? /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2951
- /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Fn, { className: "size-3 text-muted-foreground" }) }),
2952
- /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e("p", { children: l.lockedMessage }) })
2953
- ] }) }) : /* @__PURE__ */ e(me, { delayDuration: 100, children: /* @__PURE__ */ r(fe, { children: [
2954
- /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(Wn, { className: "size-3 text-muted-foreground" }) }),
2955
- /* @__PURE__ */ e(pe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: l.infoMessage }) })
2967
+ /* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: a.title }),
2968
+ s ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
2969
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Fn, { className: "size-3 text-muted-foreground" }) }),
2970
+ /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
2971
+ ] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
2972
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Wn, { className: "size-3 text-muted-foreground" }) }),
2973
+ /* @__PURE__ */ e(xe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
2956
2974
  ] }) })
2957
2975
  ] }),
2958
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: On.map((d) => /* @__PURE__ */ e(
2976
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: On.map((c) => /* @__PURE__ */ e(
2959
2977
  Bn,
2960
2978
  {
2961
- dayLabel: l.days?.[d] ?? nt[d],
2962
- config: t[d],
2963
- onChange: (v) => h(d, v),
2964
- disabled: o,
2965
- hourOptions: p
2979
+ dayLabel: a.days?.[c] ?? nt[c],
2980
+ config: t[c],
2981
+ onChange: (v) => m(c, v),
2982
+ disabled: s,
2983
+ hourOptions: f
2966
2984
  },
2967
- d
2985
+ c
2968
2986
  )) })
2969
2987
  ] });
2970
2988
  }
@@ -3031,7 +3049,7 @@ function Un({ className: t }) {
3031
3049
  }
3032
3050
  );
3033
3051
  }
3034
- function _e({ checked: t, onCheckedChange: n, className: o, children: a }) {
3052
+ function _e({ checked: t, onCheckedChange: n, className: s, children: o }) {
3035
3053
  return /* @__PURE__ */ e(
3036
3054
  "button",
3037
3055
  {
@@ -3039,34 +3057,34 @@ function _e({ checked: t, onCheckedChange: n, className: o, children: a }) {
3039
3057
  role: "checkbox",
3040
3058
  "aria-checked": t,
3041
3059
  onClick: () => n(!t),
3042
- className: o,
3043
- children: a
3060
+ className: s,
3061
+ children: o
3044
3062
  }
3045
3063
  );
3046
3064
  }
3047
- function Vn({ src: t, alt: n, fallback: o, className: a }) {
3048
- const [i, l] = ie(!1);
3065
+ function Vn({ src: t, alt: n, fallback: s, className: o }) {
3066
+ const [i, a] = ie(!1);
3049
3067
  return !t || i ? /* @__PURE__ */ e(
3050
3068
  "div",
3051
3069
  {
3052
- className: g(
3070
+ className: p(
3053
3071
  "flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
3054
- a
3072
+ o
3055
3073
  ),
3056
- children: o || "?"
3074
+ children: s || "?"
3057
3075
  }
3058
3076
  ) : /* @__PURE__ */ e(
3059
3077
  "img",
3060
3078
  {
3061
3079
  src: t,
3062
3080
  alt: n || "",
3063
- className: g("object-cover", a),
3064
- onError: () => l(!0)
3081
+ className: p("object-cover", o),
3082
+ onError: () => a(!0)
3065
3083
  }
3066
3084
  );
3067
3085
  }
3068
- function rt({ value: t, onChange: n, placeholder: o, className: a }) {
3069
- return /* @__PURE__ */ r("div", { className: g("relative", a), children: [
3086
+ function rt({ value: t, onChange: n, placeholder: s, className: o }) {
3087
+ return /* @__PURE__ */ r("div", { className: p("relative", o), children: [
3070
3088
  /* @__PURE__ */ e(Rn, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
3071
3089
  /* @__PURE__ */ e(
3072
3090
  "input",
@@ -3074,16 +3092,16 @@ function rt({ value: t, onChange: n, placeholder: o, className: a }) {
3074
3092
  type: "text",
3075
3093
  value: t,
3076
3094
  onChange: (i) => n(i.target.value),
3077
- placeholder: o,
3095
+ placeholder: s,
3078
3096
  className: "h-9 w-full rounded-lg border border-border bg-white pl-9 pr-3 text-sm placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"
3079
3097
  }
3080
3098
  )
3081
3099
  ] });
3082
3100
  }
3083
- function ot(t, n, o, a = 0.3) {
3101
+ function ot(t, n, s, o = 0.3) {
3084
3102
  if (!n.trim()) return t;
3085
3103
  const i = n.toLowerCase();
3086
- return t.filter((l) => o(l).some((h) => h ? h.toLowerCase().includes(i) : !1));
3104
+ return t.filter((a) => s(a).some((m) => m ? m.toLowerCase().includes(i) : !1));
3087
3105
  }
3088
3106
  const Yn = {
3089
3107
  title: "Filters",
@@ -3101,54 +3119,54 @@ const Yn = {
3101
3119
  function Tr({
3102
3120
  scheduleTypes: t,
3103
3121
  users: n,
3104
- selectedScheduleTypeIds: o,
3105
- onScheduleTypeChange: a,
3122
+ selectedScheduleTypeIds: s,
3123
+ onScheduleTypeChange: o,
3106
3124
  selectedUserIds: i,
3107
- onUserChange: l,
3108
- onClearAll: p,
3109
- className: h,
3110
- scheduleTypesLoading: d = !1,
3125
+ onUserChange: a,
3126
+ onClearAll: f,
3127
+ className: m,
3128
+ scheduleTypesLoading: c = !1,
3111
3129
  usersLoading: v = !1,
3112
- labels: b,
3113
- getScheduleTypeName: w
3130
+ labels: y,
3131
+ getScheduleTypeName: b
3114
3132
  }) {
3115
- const A = { ...Yn, ...b }, [$, P] = ie(""), [W, T] = ie(""), y = Q(() => $.trim() ? ot(t, $, (s) => [
3116
- s.name,
3117
- w?.(s) || s.name
3118
- ]) : t, [t, $, w]), z = Q(() => W.trim() ? ot(n, W, (s) => [s.name, s.email || ""]) : n, [n, W]), O = y.length > 0 && y.every((s) => o.includes(s.id)), _ = z.length > 0 && z.every((s) => i.includes(s.id)), D = o.length + i.length, K = (s, m) => {
3119
- const N = m ? [...o, s] : o.filter((L) => L !== s);
3120
- a(N);
3121
- }, E = () => {
3122
- if (O) {
3123
- const s = new Set(y.map((m) => m.id));
3124
- a(o.filter((m) => !s.has(m)));
3133
+ const A = { ...Yn, ...y }, [$, P] = ie(""), [F, T] = ie(""), C = te(() => $.trim() ? ot(t, $, (d) => [
3134
+ d.name,
3135
+ b?.(d) || d.name
3136
+ ]) : t, [t, $, b]), j = te(() => F.trim() ? ot(n, F, (d) => [d.name, d.email || ""]) : n, [n, F]), W = C.length > 0 && C.every((d) => s.includes(d.id)), _ = j.length > 0 && j.every((d) => i.includes(d.id)), M = s.length + i.length, G = (d, N) => {
3137
+ const h = N ? [...s, d] : s.filter((D) => D !== d);
3138
+ o(h);
3139
+ }, H = () => {
3140
+ if (W) {
3141
+ const d = new Set(C.map((N) => N.id));
3142
+ o(s.filter((N) => !d.has(N)));
3125
3143
  } else {
3126
- const s = /* @__PURE__ */ new Set([
3127
- ...o,
3128
- ...y.map((m) => m.id)
3144
+ const d = /* @__PURE__ */ new Set([
3145
+ ...s,
3146
+ ...C.map((N) => N.id)
3129
3147
  ]);
3130
- a(Array.from(s));
3148
+ o(Array.from(d));
3131
3149
  }
3132
- }, H = (s, m) => {
3133
- const N = m ? [...i, s] : i.filter((L) => L !== s);
3134
- l(N);
3150
+ }, L = (d, N) => {
3151
+ const h = N ? [...i, d] : i.filter((D) => D !== d);
3152
+ a(h);
3135
3153
  }, V = () => {
3136
3154
  if (_) {
3137
- const s = new Set(z.map((m) => m.id));
3138
- l(i.filter((m) => !s.has(m)));
3155
+ const d = new Set(j.map((N) => N.id));
3156
+ a(i.filter((N) => !d.has(N)));
3139
3157
  } else {
3140
- const s = /* @__PURE__ */ new Set([...i, ...z.map((m) => m.id)]);
3141
- l(Array.from(s));
3158
+ const d = /* @__PURE__ */ new Set([...i, ...j.map((N) => N.id)]);
3159
+ a(Array.from(d));
3142
3160
  }
3143
- }, J = () => {
3144
- a([]), l([]), p?.();
3145
- }, G = (s) => w ? w(s) : s.name, B = (s) => s.colorHex || s.color || "#069AD7";
3161
+ }, X = () => {
3162
+ o([]), a([]), f?.();
3163
+ }, Q = (d) => b ? b(d) : d.name, B = (d) => d.colorHex || d.color || "#069AD7";
3146
3164
  return /* @__PURE__ */ r(
3147
3165
  "div",
3148
3166
  {
3149
- className: g(
3167
+ className: p(
3150
3168
  "flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",
3151
- h
3169
+ m
3152
3170
  ),
3153
3171
  children: [
3154
3172
  /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-2 px-4 pb-2 pt-4", children: [
@@ -3156,11 +3174,11 @@ function Tr({
3156
3174
  /* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children: A.title }),
3157
3175
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: A.subtitle })
3158
3176
  ] }),
3159
- D > 0 && /* @__PURE__ */ r(
3177
+ M > 0 && /* @__PURE__ */ r(
3160
3178
  "button",
3161
3179
  {
3162
3180
  type: "button",
3163
- onClick: J,
3181
+ onClick: X,
3164
3182
  className: "flex h-auto items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10",
3165
3183
  children: [
3166
3184
  /* @__PURE__ */ e(Un, { className: "h-3.5 w-3.5" }),
@@ -3177,9 +3195,9 @@ function Tr({
3177
3195
  "button",
3178
3196
  {
3179
3197
  type: "button",
3180
- onClick: E,
3198
+ onClick: H,
3181
3199
  className: "text-xs font-medium text-primary transition-colors hover:text-primary/80",
3182
- children: O ? A.unselectAll : A.selectAll
3200
+ children: W ? A.unselectAll : A.selectAll
3183
3201
  }
3184
3202
  )
3185
3203
  ] }),
@@ -3192,9 +3210,9 @@ function Tr({
3192
3210
  }
3193
3211
  ) }),
3194
3212
  /* @__PURE__ */ r("div", { className: "flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin", children: [
3195
- d ? (
3213
+ c ? (
3196
3214
  // Loading skeletons
3197
- Array.from({ length: 4 }).map((s, m) => /* @__PURE__ */ r(
3215
+ Array.from({ length: 4 }).map((d, N) => /* @__PURE__ */ r(
3198
3216
  "div",
3199
3217
  {
3200
3218
  className: "flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",
@@ -3203,49 +3221,49 @@ function Tr({
3203
3221
  /* @__PURE__ */ e("div", { className: "h-3 w-24 rounded bg-muted-foreground/20" })
3204
3222
  ]
3205
3223
  },
3206
- `skeleton-${m}`
3224
+ `skeleton-${N}`
3207
3225
  ))
3208
- ) : y.map((s) => {
3209
- const m = o.includes(s.id), N = B(s);
3226
+ ) : C.map((d) => {
3227
+ const N = s.includes(d.id), h = B(d);
3210
3228
  return /* @__PURE__ */ r(
3211
3229
  _e,
3212
3230
  {
3213
- checked: m,
3214
- onCheckedChange: (L) => K(s.id, L),
3215
- className: g(
3231
+ checked: N,
3232
+ onCheckedChange: (D) => G(d.id, D),
3233
+ className: p(
3216
3234
  "relative flex w-full cursor-pointer items-center justify-between gap-3 rounded-md border border-border bg-white px-3 py-2 transition-colors hover:border-primary/50",
3217
- m && "border-primary bg-primary/5"
3235
+ N && "border-primary bg-primary/5"
3218
3236
  ),
3219
3237
  children: [
3220
3238
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
3221
3239
  /* @__PURE__ */ e(
3222
3240
  "span",
3223
3241
  {
3224
- className: g(
3242
+ className: p(
3225
3243
  "flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",
3226
- m && "border-primary bg-primary text-primary-foreground"
3244
+ N && "border-primary bg-primary text-primary-foreground"
3227
3245
  ),
3228
- children: m && /* @__PURE__ */ e(Oe, { className: "h-3 w-3" })
3246
+ children: N && /* @__PURE__ */ e(Oe, { className: "h-3 w-3" })
3229
3247
  }
3230
3248
  ),
3231
- /* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: G(s) })
3249
+ /* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: Q(d) })
3232
3250
  ] }),
3233
3251
  /* @__PURE__ */ e(
3234
3252
  "div",
3235
3253
  {
3236
3254
  className: "h-4 w-4 rounded-full border",
3237
3255
  style: {
3238
- backgroundColor: N,
3239
- borderColor: N
3256
+ backgroundColor: h,
3257
+ borderColor: h
3240
3258
  }
3241
3259
  }
3242
3260
  )
3243
3261
  ]
3244
3262
  },
3245
- s.id
3263
+ d.id
3246
3264
  );
3247
3265
  }),
3248
- !d && y.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children: A.noScheduleTypes })
3266
+ !c && C.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children: A.noScheduleTypes })
3249
3267
  ] })
3250
3268
  ] }),
3251
3269
  /* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
@@ -3257,7 +3275,7 @@ function Tr({
3257
3275
  {
3258
3276
  checked: _,
3259
3277
  onCheckedChange: () => V(),
3260
- className: g(
3278
+ className: p(
3261
3279
  "flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",
3262
3280
  _ && "border-primary bg-primary text-primary-foreground"
3263
3281
  ),
@@ -3268,7 +3286,7 @@ function Tr({
3268
3286
  /* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
3269
3287
  rt,
3270
3288
  {
3271
- value: W,
3289
+ value: F,
3272
3290
  onChange: T,
3273
3291
  placeholder: A.searchParticipants
3274
3292
  }
@@ -3276,7 +3294,7 @@ function Tr({
3276
3294
  /* @__PURE__ */ r("div", { className: "flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin", children: [
3277
3295
  v ? (
3278
3296
  // Loading skeletons
3279
- Array.from({ length: 4 }).map((s, m) => /* @__PURE__ */ r(
3297
+ Array.from({ length: 4 }).map((d, N) => /* @__PURE__ */ r(
3280
3298
  "div",
3281
3299
  {
3282
3300
  className: "flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",
@@ -3289,58 +3307,58 @@ function Tr({
3289
3307
  ] })
3290
3308
  ]
3291
3309
  },
3292
- `p-skeleton-${m}`
3310
+ `p-skeleton-${N}`
3293
3311
  ))
3294
- ) : z.map((s) => {
3295
- const m = i.includes(s.id);
3312
+ ) : j.map((d) => {
3313
+ const N = i.includes(d.id);
3296
3314
  return /* @__PURE__ */ r(
3297
3315
  _e,
3298
3316
  {
3299
- checked: m,
3300
- onCheckedChange: (N) => H(s.id, N),
3301
- className: g(
3317
+ checked: N,
3318
+ onCheckedChange: (h) => L(d.id, h),
3319
+ className: p(
3302
3320
  "relative flex w-full cursor-pointer items-start gap-2 rounded-lg border border-border bg-white p-2 transition-colors hover:border-primary/50",
3303
- m && "border-primary bg-zinc-50"
3321
+ N && "border-primary bg-zinc-50"
3304
3322
  ),
3305
3323
  children: [
3306
3324
  /* @__PURE__ */ e(
3307
3325
  "span",
3308
3326
  {
3309
- className: g(
3327
+ className: p(
3310
3328
  "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",
3311
- m && "border-primary bg-primary text-primary-foreground"
3329
+ N && "border-primary bg-primary text-primary-foreground"
3312
3330
  ),
3313
- children: m && /* @__PURE__ */ e(Oe, { className: "h-2.5 w-2.5" })
3331
+ children: N && /* @__PURE__ */ e(Oe, { className: "h-2.5 w-2.5" })
3314
3332
  }
3315
3333
  ),
3316
3334
  /* @__PURE__ */ r("div", { className: "flex flex-1 items-start gap-2", children: [
3317
3335
  /* @__PURE__ */ e(
3318
3336
  Vn,
3319
3337
  {
3320
- src: s.avatar ?? null,
3321
- alt: s.name,
3322
- fallback: s.name?.[0]?.toUpperCase() ?? "?",
3338
+ src: d.avatar ?? null,
3339
+ alt: d.name,
3340
+ fallback: d.name?.[0]?.toUpperCase() ?? "?",
3323
3341
  className: "h-10 w-10 rounded-lg"
3324
3342
  }
3325
3343
  ),
3326
3344
  /* @__PURE__ */ r("div", { className: "flex max-w-[140px] flex-col gap-0.5 overflow-hidden", children: [
3327
- /* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children: s.name }),
3345
+ /* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children: d.name }),
3328
3346
  /* @__PURE__ */ e(
3329
3347
  "span",
3330
3348
  {
3331
3349
  className: "truncate text-[11px] text-muted-foreground",
3332
- title: s.email,
3333
- children: s.email
3350
+ title: d.email,
3351
+ children: d.email
3334
3352
  }
3335
3353
  )
3336
3354
  ] })
3337
3355
  ] })
3338
3356
  ]
3339
3357
  },
3340
- s.id
3358
+ d.id
3341
3359
  );
3342
3360
  }),
3343
- !v && z.length === 0 && /* @__PURE__ */ e("p", { className: "px-4 text-xs text-muted-foreground", children: A.noParticipants })
3361
+ !v && j.length === 0 && /* @__PURE__ */ e("p", { className: "px-4 text-xs text-muted-foreground", children: A.noParticipants })
3344
3362
  ] })
3345
3363
  ] })
3346
3364
  ]
@@ -3371,33 +3389,33 @@ function Kn({ className: t }) {
3371
3389
  function Hr({
3372
3390
  scheduleTypes: t,
3373
3391
  value: n,
3374
- onChange: o,
3375
- allLabel: a = "All types",
3392
+ onChange: s,
3393
+ allLabel: o = "All types",
3376
3394
  className: i,
3377
- label: l
3395
+ label: a
3378
3396
  }) {
3379
- const p = (d) => {
3380
- o(d.target.value);
3381
- }, h = t.find((d) => String(d.id) === n);
3382
- return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-1", i), children: [
3383
- l && /* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l }),
3397
+ const f = (c) => {
3398
+ s(c.target.value);
3399
+ }, m = t.find((c) => String(c.id) === n);
3400
+ return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-1", i), children: [
3401
+ a && /* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: a }),
3384
3402
  /* @__PURE__ */ r("div", { className: "relative", children: [
3385
- h ? /* @__PURE__ */ e(
3403
+ m ? /* @__PURE__ */ e(
3386
3404
  "span",
3387
3405
  {
3388
3406
  className: "pointer-events-none absolute left-2.5 top-1/2 size-3 -translate-y-1/2 rounded-full",
3389
- style: { backgroundColor: h.color }
3407
+ style: { backgroundColor: m.color }
3390
3408
  }
3391
3409
  ) : /* @__PURE__ */ e(Kn, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
3392
3410
  /* @__PURE__ */ r(
3393
- xe,
3411
+ ve,
3394
3412
  {
3395
3413
  value: n,
3396
- onChange: p,
3414
+ onChange: f,
3397
3415
  className: "h-9 w-full min-w-[140px] pl-8 pr-8 text-sm",
3398
3416
  children: [
3399
- /* @__PURE__ */ e("option", { value: "all", children: a }),
3400
- t.map((d) => /* @__PURE__ */ e("option", { value: String(d.id), children: d.label }, d.id))
3417
+ /* @__PURE__ */ e("option", { value: "all", children: o }),
3418
+ t.map((c) => /* @__PURE__ */ e("option", { value: String(c.id), children: c.label }, c.id))
3401
3419
  ]
3402
3420
  }
3403
3421
  )
@@ -3430,27 +3448,27 @@ function Gn({ className: t }) {
3430
3448
  function zr({
3431
3449
  users: t,
3432
3450
  value: n,
3433
- onChange: o,
3434
- allLabel: a = "All users",
3451
+ onChange: s,
3452
+ allLabel: o = "All users",
3435
3453
  className: i,
3436
- label: l
3454
+ label: a
3437
3455
  }) {
3438
- const p = (h) => {
3439
- o(h.target.value);
3456
+ const f = (m) => {
3457
+ s(m.target.value);
3440
3458
  };
3441
- return /* @__PURE__ */ r("div", { className: g("flex flex-col gap-1", i), children: [
3442
- l && /* @__PURE__ */ e(he, { className: "text-xs text-muted-foreground", children: l }),
3459
+ return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-1", i), children: [
3460
+ a && /* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: a }),
3443
3461
  /* @__PURE__ */ r("div", { className: "relative", children: [
3444
3462
  /* @__PURE__ */ e(Gn, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
3445
3463
  /* @__PURE__ */ r(
3446
- xe,
3464
+ ve,
3447
3465
  {
3448
3466
  value: n,
3449
- onChange: p,
3467
+ onChange: f,
3450
3468
  className: "h-9 w-full min-w-[120px] pl-8 pr-8 text-sm",
3451
3469
  children: [
3452
- /* @__PURE__ */ e("option", { value: "all", children: a }),
3453
- t.map((h) => /* @__PURE__ */ e("option", { value: h.id, children: h.name }, h.id))
3470
+ /* @__PURE__ */ e("option", { value: "all", children: o }),
3471
+ t.map((m) => /* @__PURE__ */ e("option", { value: m.id, children: m.name }, m.id))
3454
3472
  ]
3455
3473
  }
3456
3474
  )
@@ -3544,16 +3562,16 @@ function Qn({ className: t }) {
3544
3562
  );
3545
3563
  }
3546
3564
  function Zn(t) {
3547
- const n = t.getFullYear(), o = String(t.getMonth() + 1).padStart(2, "0"), a = String(t.getDate()).padStart(2, "0");
3548
- return `${n}-${o}-${a}`;
3565
+ const n = t.getFullYear(), s = String(t.getMonth() + 1).padStart(2, "0"), o = String(t.getDate()).padStart(2, "0");
3566
+ return `${n}-${s}-${o}`;
3549
3567
  }
3550
3568
  function st(t) {
3551
- const n = t.getHours(), o = t.getMinutes(), a = n >= 12 ? "PM" : "AM", i = n % 12 || 12, l = String(o).padStart(2, "0");
3552
- return `${i}:${l} ${a}`;
3569
+ const n = t.getHours(), s = t.getMinutes(), o = n >= 12 ? "PM" : "AM", i = n % 12 || 12, a = String(s).padStart(2, "0");
3570
+ return `${i}:${a} ${o}`;
3553
3571
  }
3554
3572
  function er(t) {
3555
- const n = st(t.startDate), o = st(t.endDate);
3556
- return `${n} - ${o}`;
3573
+ const n = st(t.startDate), s = st(t.endDate);
3574
+ return `${n} - ${s}`;
3557
3575
  }
3558
3576
  function tr(t) {
3559
3577
  const n = ht(/* @__PURE__ */ new Date(), 1);
@@ -3562,7 +3580,7 @@ function tr(t) {
3562
3580
  function nr(t) {
3563
3581
  if (ce(t)) return "Today";
3564
3582
  if (tr(t)) return "Tomorrow";
3565
- const n = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], o = [
3583
+ const n = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], s = [
3566
3584
  "Jan",
3567
3585
  "Feb",
3568
3586
  "Mar",
@@ -3575,33 +3593,33 @@ function nr(t) {
3575
3593
  "Oct",
3576
3594
  "Nov",
3577
3595
  "Dec"
3578
- ], a = n[t.getDay()], i = o[t.getMonth()], l = t.getDate();
3579
- return `${a}, ${i} ${l}`;
3596
+ ], o = n[t.getDay()], i = s[t.getMonth()], a = t.getDate();
3597
+ return `${o}, ${i} ${a}`;
3580
3598
  }
3581
3599
  function rr(t, n) {
3582
- const o = /* @__PURE__ */ new Map();
3583
- for (const a of t) {
3584
- const i = Zn(a.startDate), l = o.get(i) ?? [];
3585
- l.push(a), o.set(i, l);
3600
+ const s = /* @__PURE__ */ new Map();
3601
+ for (const o of t) {
3602
+ const i = Zn(o.startDate), a = s.get(i) ?? [];
3603
+ a.push(o), s.set(i, a);
3586
3604
  }
3587
- return Array.from(o.entries()).map(([a, i]) => {
3588
- const l = [...i].sort(
3589
- (h, d) => h.startDate.getTime() - d.startDate.getTime()
3590
- ), p = n > 0 ? l.slice(0, n) : l;
3605
+ return Array.from(s.entries()).map(([o, i]) => {
3606
+ const a = [...i].sort(
3607
+ (m, c) => m.startDate.getTime() - c.startDate.getTime()
3608
+ ), f = n > 0 ? a.slice(0, n) : a;
3591
3609
  return {
3592
- date: new Date(a),
3593
- dateKey: a,
3594
- events: p,
3595
- hasMore: n > 0 && l.length > n
3610
+ date: new Date(o),
3611
+ dateKey: o,
3612
+ events: f,
3613
+ hasMore: n > 0 && a.length > n
3596
3614
  };
3597
- }).sort((a, i) => a.date.getTime() - i.date.getTime());
3615
+ }).sort((o, i) => o.date.getTime() - i.date.getTime());
3598
3616
  }
3599
3617
  function or(t) {
3600
- const n = Pe(/* @__PURE__ */ new Date()), o = ut(/* @__PURE__ */ new Date());
3601
- return t.filter((a) => a.startDate >= n && a.startDate <= o).length;
3618
+ const n = Pe(/* @__PURE__ */ new Date()), s = ut(/* @__PURE__ */ new Date());
3619
+ return t.filter((o) => o.startDate >= n && o.startDate <= s).length;
3602
3620
  }
3603
3621
  function Be({ className: t }) {
3604
- return /* @__PURE__ */ e("div", { className: g("animate-pulse rounded-md bg-muted", t) });
3622
+ return /* @__PURE__ */ e("div", { className: p("animate-pulse rounded-md bg-muted", t) });
3605
3623
  }
3606
3624
  function sr({ event: t, onClick: n }) {
3607
3625
  return /* @__PURE__ */ r(
@@ -3609,7 +3627,7 @@ function sr({ event: t, onClick: n }) {
3609
3627
  {
3610
3628
  type: "button",
3611
3629
  onClick: () => n?.(t),
3612
- className: g(
3630
+ className: p(
3613
3631
  "w-full text-left rounded-lg transition-colors",
3614
3632
  "hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3615
3633
  "flex items-start gap-3 p-2"
@@ -3634,52 +3652,52 @@ function sr({ event: t, onClick: n }) {
3634
3652
  function ar({ group: t, onEventClick: n }) {
3635
3653
  return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
3636
3654
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between px-2 py-1.5", children: [
3637
- /* @__PURE__ */ e("h3", { className: g("text-xs font-semibold", ce(t.date) && "text-primary"), children: nr(t.date) }),
3655
+ /* @__PURE__ */ e("h3", { className: p("text-xs font-semibold", ce(t.date) && "text-primary"), children: nr(t.date) }),
3638
3656
  t.hasMore && /* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground", children: [
3639
3657
  "+",
3640
3658
  t.events.length,
3641
3659
  " more"
3642
3660
  ] })
3643
3661
  ] }),
3644
- /* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((o) => /* @__PURE__ */ e(sr, { event: o, onClick: n }, o.id)) })
3662
+ /* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((s) => /* @__PURE__ */ e(sr, { event: s, onClick: n }, s.id)) })
3645
3663
  ] });
3646
3664
  }
3647
3665
  function Ir({
3648
3666
  events: t,
3649
3667
  isLoading: n = !1,
3650
- className: o,
3651
- daysAhead: a = 7,
3668
+ className: s,
3669
+ daysAhead: o = 7,
3652
3670
  maxEventsPerDay: i = 3,
3653
- onEventClick: l,
3654
- onNavigateToAgenda: p
3671
+ onEventClick: a,
3672
+ onNavigateToAgenda: f
3655
3673
  }) {
3656
- const [h, d] = ie(!1), v = Q(() => {
3657
- const P = Pe(/* @__PURE__ */ new Date()), W = ht(P, a);
3658
- return t.filter((T) => T.endDate >= P && T.startDate < W);
3659
- }, [t, a]), b = Q(
3674
+ const [m, c] = ie(!1), v = te(() => {
3675
+ const P = Pe(/* @__PURE__ */ new Date()), F = ht(P, o);
3676
+ return t.filter((T) => T.endDate >= P && T.startDate < F);
3677
+ }, [t, o]), y = te(
3660
3678
  () => rr(v, i),
3661
3679
  [v, i]
3662
- ), w = Q(() => or(t), [t]), A = (P) => {
3663
- d(!1), l?.(P);
3680
+ ), b = te(() => or(t), [t]), A = (P) => {
3681
+ c(!1), a?.(P);
3664
3682
  }, $ = () => {
3665
- d(!1), p?.();
3683
+ c(!1), f?.();
3666
3684
  };
3667
- return /* @__PURE__ */ r(lt, { open: h, onOpenChange: d, children: [
3685
+ return /* @__PURE__ */ r(lt, { open: m, onOpenChange: c, children: [
3668
3686
  /* @__PURE__ */ r(
3669
3687
  ct,
3670
3688
  {
3671
- className: g(
3689
+ className: p(
3672
3690
  "relative rounded-xl hover:text-zinc-700 hover:!bg-zinc-300 !bg-zinc-200 text-zinc-600 shadow-none !px-2.5 p-2 max-h-10",
3673
- o
3691
+ s
3674
3692
  ),
3675
3693
  children: [
3676
3694
  /* @__PURE__ */ e(Jn, { className: "h-4 w-4" }),
3677
- w > 0 && /* @__PURE__ */ e(
3695
+ b > 0 && /* @__PURE__ */ e(
3678
3696
  Et,
3679
3697
  {
3680
3698
  variant: "destructive",
3681
3699
  className: "absolute -right-4 -top-4 m-3 flex h-5 w-5 items-center justify-center rounded-full bg-primary p-0 text-[10px] font-medium hover:bg-primary",
3682
- children: w > 99 ? "99+" : w
3700
+ children: b > 99 ? "99+" : b
3683
3701
  }
3684
3702
  )
3685
3703
  ]
@@ -3689,9 +3707,9 @@ function Ir({
3689
3707
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b p-4", children: [
3690
3708
  /* @__PURE__ */ r("div", { children: [
3691
3709
  /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Upcoming" }),
3692
- /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: w > 0 ? `${w} event${w > 1 ? "s" : ""} today` : "No events today" })
3710
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: b > 0 ? `${b} event${b > 1 ? "s" : ""} today` : "No events today" })
3693
3711
  ] }),
3694
- p && /* @__PURE__ */ r(
3712
+ f && /* @__PURE__ */ r(
3695
3713
  "button",
3696
3714
  {
3697
3715
  type: "button",
@@ -3704,21 +3722,21 @@ function Ir({
3704
3722
  }
3705
3723
  )
3706
3724
  ] }),
3707
- /* @__PURE__ */ e("div", { className: "max-h-80 overflow-y-auto p-2", children: n ? /* @__PURE__ */ e("div", { className: "space-y-2 p-2", children: Array.from({ length: 3 }).map((P, W) => /* @__PURE__ */ r("div", { className: "flex space-x-3", children: [
3725
+ /* @__PURE__ */ e("div", { className: "max-h-80 overflow-y-auto p-2", children: n ? /* @__PURE__ */ e("div", { className: "space-y-2 p-2", children: Array.from({ length: 3 }).map((P, F) => /* @__PURE__ */ r("div", { className: "flex space-x-3", children: [
3708
3726
  /* @__PURE__ */ e(Be, { className: "h-2 w-2 rounded-full mt-2" }),
3709
3727
  /* @__PURE__ */ r("div", { className: "flex-1 space-y-2", children: [
3710
3728
  /* @__PURE__ */ e(Be, { className: "h-4 w-full" }),
3711
3729
  /* @__PURE__ */ e(Be, { className: "h-3 w-3/4" })
3712
3730
  ] })
3713
- ] }, W)) }) : b.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
3731
+ ] }, F)) }) : y.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
3714
3732
  /* @__PURE__ */ e(qn, { className: "mb-2 h-8 w-8 text-muted-foreground/50" }),
3715
3733
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No upcoming events" }),
3716
3734
  /* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground/70", children: [
3717
3735
  "Your schedule is clear for the next ",
3718
- a,
3736
+ o,
3719
3737
  " days"
3720
3738
  ] })
3721
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: b.map((P) => /* @__PURE__ */ e(
3739
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: y.map((P) => /* @__PURE__ */ e(
3722
3740
  ar,
3723
3741
  {
3724
3742
  group: P,
@@ -3777,8 +3795,8 @@ function lr(t) {
3777
3795
  return n.setDate(n.getDate() + 1), t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
3778
3796
  }
3779
3797
  function at(t) {
3780
- const n = t.getHours(), o = t.getMinutes(), a = n >= 12 ? "PM" : "AM";
3781
- return `${n % 12 || 12}:${o.toString().padStart(2, "0")} ${a}`;
3798
+ const n = t.getHours(), s = t.getMinutes(), o = n >= 12 ? "PM" : "AM";
3799
+ return `${n % 12 || 12}:${s.toString().padStart(2, "0")} ${o}`;
3782
3800
  }
3783
3801
  function cr(t) {
3784
3802
  return new Intl.DateTimeFormat("en-US", {
@@ -3788,58 +3806,58 @@ function cr(t) {
3788
3806
  }).format(t);
3789
3807
  }
3790
3808
  function dr(t) {
3791
- const n = at(t.startDate), o = at(t.endDate);
3792
- return `${n} - ${o}`;
3809
+ const n = at(t.startDate), s = at(t.endDate);
3810
+ return `${n} - ${s}`;
3793
3811
  }
3794
3812
  function ur(t) {
3795
3813
  return ce(t) ? "Today" : lr(t) ? "Tomorrow" : cr(t);
3796
3814
  }
3797
3815
  function hr(t, n) {
3798
- const o = /* @__PURE__ */ new Map();
3799
- for (const a of t) {
3800
- const i = Wt(a.startDate), l = o.get(i) ?? [];
3801
- l.push(a), o.set(i, l);
3816
+ const s = /* @__PURE__ */ new Map();
3817
+ for (const o of t) {
3818
+ const i = Wt(o.startDate), a = s.get(i) ?? [];
3819
+ a.push(o), s.set(i, a);
3802
3820
  }
3803
- return Array.from(o.entries()).map(([a, i]) => {
3804
- const l = [...i].sort(
3805
- (h, d) => h.startDate.getTime() - d.startDate.getTime()
3806
- ), p = n > 0 ? l.slice(0, n) : l;
3821
+ return Array.from(s.entries()).map(([o, i]) => {
3822
+ const a = [...i].sort(
3823
+ (m, c) => m.startDate.getTime() - c.startDate.getTime()
3824
+ ), f = n > 0 ? a.slice(0, n) : a;
3807
3825
  return {
3808
- date: new Date(a),
3809
- dateKey: a,
3810
- events: p,
3811
- hasMore: n > 0 && l.length > n
3826
+ date: new Date(o),
3827
+ dateKey: o,
3828
+ events: f,
3829
+ hasMore: n > 0 && a.length > n
3812
3830
  };
3813
- }).sort((a, i) => a.date.getTime() - i.date.getTime());
3831
+ }).sort((o, i) => o.date.getTime() - i.date.getTime());
3814
3832
  }
3815
- function mr({ event: t, onClick: n, compact: o }) {
3833
+ function mr({ event: t, onClick: n, compact: s }) {
3816
3834
  return /* @__PURE__ */ r(
3817
3835
  "button",
3818
3836
  {
3819
3837
  type: "button",
3820
3838
  onClick: () => n?.(t),
3821
- className: g(
3839
+ className: p(
3822
3840
  "w-full text-left rounded-lg transition-colors",
3823
3841
  "hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3824
3842
  "flex items-start gap-3",
3825
- o ? "p-2" : "p-3"
3843
+ s ? "p-2" : "p-3"
3826
3844
  ),
3827
3845
  children: [
3828
3846
  /* @__PURE__ */ e(
3829
3847
  "div",
3830
3848
  {
3831
- className: g("shrink-0 rounded-full mt-1", o ? "size-2" : "size-2.5"),
3849
+ className: p("shrink-0 rounded-full mt-1", s ? "size-2" : "size-2.5"),
3832
3850
  style: { backgroundColor: t.color ?? "#3b82f6" }
3833
3851
  }
3834
3852
  ),
3835
3853
  /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
3836
- /* @__PURE__ */ e("p", { className: g("font-medium truncate", o ? "text-xs" : "text-sm"), children: t.title }),
3837
- /* @__PURE__ */ e("p", { className: g("text-muted-foreground truncate", o ? "text-[10px]" : "text-xs"), children: dr(t) })
3854
+ /* @__PURE__ */ e("p", { className: p("font-medium truncate", s ? "text-xs" : "text-sm"), children: t.title }),
3855
+ /* @__PURE__ */ e("p", { className: p("text-muted-foreground truncate", s ? "text-[10px]" : "text-xs"), children: dr(t) })
3838
3856
  ] }),
3839
3857
  n && /* @__PURE__ */ e(
3840
3858
  ft,
3841
3859
  {
3842
- className: g("shrink-0 text-muted-foreground/50", o ? "size-3" : "size-4")
3860
+ className: p("shrink-0 text-muted-foreground/50", s ? "size-3" : "size-4")
3843
3861
  }
3844
3862
  )
3845
3863
  ]
@@ -3849,98 +3867,98 @@ function mr({ event: t, onClick: n, compact: o }) {
3849
3867
  function fr({
3850
3868
  group: t,
3851
3869
  onEventClick: n,
3852
- onViewMore: o,
3853
- compact: a
3870
+ onViewMore: s,
3871
+ compact: o
3854
3872
  }) {
3855
3873
  return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
3856
- /* @__PURE__ */ r("div", { className: g("flex items-center justify-between px-2", a ? "py-1" : "py-1.5"), children: [
3874
+ /* @__PURE__ */ r("div", { className: p("flex items-center justify-between px-2", o ? "py-1" : "py-1.5"), children: [
3857
3875
  /* @__PURE__ */ e(
3858
3876
  "h3",
3859
3877
  {
3860
- className: g(
3878
+ className: p(
3861
3879
  "font-semibold",
3862
- a ? "text-xs" : "text-sm",
3880
+ o ? "text-xs" : "text-sm",
3863
3881
  ce(t.date) && "text-primary"
3864
3882
  ),
3865
3883
  children: ur(t.date)
3866
3884
  }
3867
3885
  ),
3868
- t.hasMore && o && /* @__PURE__ */ e(
3886
+ t.hasMore && s && /* @__PURE__ */ e(
3869
3887
  "button",
3870
3888
  {
3871
3889
  type: "button",
3872
- onClick: () => o(t.date),
3873
- className: g("text-primary hover:underline", a ? "text-[10px]" : "text-xs"),
3890
+ onClick: () => s(t.date),
3891
+ className: p("text-primary hover:underline", o ? "text-[10px]" : "text-xs"),
3874
3892
  children: "+more"
3875
3893
  }
3876
3894
  )
3877
3895
  ] }),
3878
- /* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((i) => /* @__PURE__ */ e(mr, { event: i, onClick: n, compact: a }, i.id)) })
3896
+ /* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((i) => /* @__PURE__ */ e(mr, { event: i, onClick: n, compact: o }, i.id)) })
3879
3897
  ] });
3880
3898
  }
3881
3899
  function jr({
3882
3900
  events: t,
3883
3901
  daysAhead: n = 7,
3884
- maxEventsPerDay: o = 3,
3885
- onEventClick: a,
3902
+ maxEventsPerDay: s = 3,
3903
+ onEventClick: o,
3886
3904
  onViewAll: i,
3887
- className: l,
3888
- emptyState: p,
3889
- title: h = "Upcoming",
3890
- showHeader: d = !0,
3905
+ className: a,
3906
+ emptyState: f,
3907
+ title: m = "Upcoming",
3908
+ showHeader: c = !0,
3891
3909
  compact: v = !1
3892
3910
  }) {
3893
- const b = it(), w = b?.filteredEvents, A = b?.currentDate ?? /* @__PURE__ */ new Date(), $ = t ?? w ?? [], P = Q(() => {
3894
- const y = Pe(A), z = new Date(y);
3895
- return z.setDate(z.getDate() + n), $.filter((O) => O.endDate >= y && O.startDate < z);
3896
- }, [$, n, A]), W = Q(
3897
- () => hr(P, o),
3898
- [P, o]
3911
+ const y = it(), b = y?.filteredEvents, A = y?.currentDate ?? /* @__PURE__ */ new Date(), $ = t ?? b ?? [], P = te(() => {
3912
+ const C = Pe(A), j = new Date(C);
3913
+ return j.setDate(j.getDate() + n), $.filter((W) => W.endDate >= C && W.startDate < j);
3914
+ }, [$, n, A]), F = te(
3915
+ () => hr(P, s),
3916
+ [P, s]
3899
3917
  ), T = P.length;
3900
- return W.length === 0 ? /* @__PURE__ */ r("div", { className: g("rounded-lg border bg-card", l), children: [
3901
- d && /* @__PURE__ */ e(
3918
+ return F.length === 0 ? /* @__PURE__ */ r("div", { className: p("rounded-lg border bg-card", a), children: [
3919
+ c && /* @__PURE__ */ e(
3902
3920
  "div",
3903
3921
  {
3904
- className: g(
3922
+ className: p(
3905
3923
  "border-b px-4 flex items-center justify-between",
3906
3924
  v ? "py-2" : "py-3"
3907
3925
  ),
3908
- children: /* @__PURE__ */ e("h2", { className: g("font-semibold", v ? "text-sm" : "text-base"), children: h })
3926
+ children: /* @__PURE__ */ e("h2", { className: p("font-semibold", v ? "text-sm" : "text-base"), children: m })
3909
3927
  }
3910
3928
  ),
3911
3929
  /* @__PURE__ */ e(
3912
3930
  "div",
3913
3931
  {
3914
- className: g(
3932
+ className: p(
3915
3933
  "flex flex-col items-center justify-center text-center",
3916
3934
  v ? "py-6 px-4" : "py-10 px-6"
3917
3935
  ),
3918
- children: p ?? /* @__PURE__ */ r(we, { children: [
3936
+ children: f ?? /* @__PURE__ */ r(be, { children: [
3919
3937
  /* @__PURE__ */ e(
3920
3938
  ir,
3921
3939
  {
3922
- className: g("text-muted-foreground/50 mb-2", v ? "size-8" : "size-10")
3940
+ className: p("text-muted-foreground/50 mb-2", v ? "size-8" : "size-10")
3923
3941
  }
3924
3942
  ),
3925
- /* @__PURE__ */ e("p", { className: g("text-muted-foreground", v ? "text-xs" : "text-sm"), children: "No upcoming events" })
3943
+ /* @__PURE__ */ e("p", { className: p("text-muted-foreground", v ? "text-xs" : "text-sm"), children: "No upcoming events" })
3926
3944
  ] })
3927
3945
  }
3928
3946
  )
3929
- ] }) : /* @__PURE__ */ r("div", { className: g("rounded-lg border bg-card overflow-hidden", l), children: [
3930
- d && /* @__PURE__ */ r(
3947
+ ] }) : /* @__PURE__ */ r("div", { className: p("rounded-lg border bg-card overflow-hidden", a), children: [
3948
+ c && /* @__PURE__ */ r(
3931
3949
  "div",
3932
3950
  {
3933
- className: g(
3951
+ className: p(
3934
3952
  "border-b px-4 flex items-center justify-between",
3935
3953
  v ? "py-2" : "py-3"
3936
3954
  ),
3937
3955
  children: [
3938
3956
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
3939
- /* @__PURE__ */ e("h2", { className: g("font-semibold", v ? "text-sm" : "text-base"), children: h }),
3957
+ /* @__PURE__ */ e("h2", { className: p("font-semibold", v ? "text-sm" : "text-base"), children: m }),
3940
3958
  /* @__PURE__ */ e(
3941
3959
  "span",
3942
3960
  {
3943
- className: g(
3961
+ className: p(
3944
3962
  "text-muted-foreground bg-muted rounded-full px-2",
3945
3963
  v ? "text-[10px] py-0" : "text-xs py-0.5"
3946
3964
  ),
@@ -3953,7 +3971,7 @@ function jr({
3953
3971
  {
3954
3972
  type: "button",
3955
3973
  onClick: () => i(),
3956
- className: g(
3974
+ className: p(
3957
3975
  "text-primary hover:underline flex items-center gap-0.5",
3958
3976
  v ? "text-xs" : "text-sm"
3959
3977
  ),
@@ -3969,19 +3987,19 @@ function jr({
3969
3987
  /* @__PURE__ */ e(
3970
3988
  "div",
3971
3989
  {
3972
- className: g(
3990
+ className: p(
3973
3991
  "divide-y overflow-auto",
3974
3992
  v ? "p-2 max-h-[280px]" : "p-3 max-h-[400px]"
3975
3993
  ),
3976
- children: W.map((y) => /* @__PURE__ */ e(
3994
+ children: F.map((C) => /* @__PURE__ */ e(
3977
3995
  fr,
3978
3996
  {
3979
- group: y,
3980
- onEventClick: a,
3981
- onViewMore: i ? (z) => i(z) : void 0,
3997
+ group: C,
3998
+ onEventClick: o,
3999
+ onViewMore: i ? (j) => i(j) : void 0,
3982
4000
  compact: v
3983
4001
  },
3984
- y.dateKey
4002
+ C.dateKey
3985
4003
  ))
3986
4004
  }
3987
4005
  )
@@ -4004,4 +4022,4 @@ export {
4004
4022
  Tr as b,
4005
4023
  Dr as c
4006
4024
  };
4007
- //# sourceMappingURL=agenda-widget-COpTIR70.js.map
4025
+ //# sourceMappingURL=agenda-widget-Couk7jMB.js.map