ezux 1.1.19 → 1.1.21

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 (75) hide show
  1. package/README.md +7 -1
  2. package/dist/{DeleteConfirmationModal-CukNDgtX.cjs → DeleteConfirmationModal-BM1PoL6P.cjs} +1 -1
  3. package/dist/{DeleteConfirmationModal-p8XGDGIw.js → DeleteConfirmationModal-B_tXm0N0.js} +4 -4
  4. package/dist/{EzEventModal-BrCBSXBM.cjs → EzEventModal-D1EzXBsQ.cjs} +1 -1
  5. package/dist/{EzEventModal-BDSHG11m.js → EzEventModal-D5lX9XuW.js} +2 -2
  6. package/dist/{EzFlow-CQFeY7DL.cjs → EzFlow-B4qRm5KH.cjs} +3 -3
  7. package/dist/{EzFlow-C74NbZA9.js → EzFlow-CEfPykao.js} +278 -278
  8. package/dist/EzKanban-2b9skOep.cjs +2 -0
  9. package/dist/{EzKanban-COcGidzh.js → EzKanban-CpYH8b8g.js} +86 -80
  10. package/dist/{EzLayout-CiaPLniV.js → EzLayout-DFxegglu.js} +30 -24
  11. package/dist/EzLayout-EYOfpFXs.cjs +1 -0
  12. package/dist/{EzScheduler-CjQbi1Na.js → EzScheduler-D7aH4KCY.js} +60 -55
  13. package/dist/EzScheduler-hC9PsLrI.cjs +1 -0
  14. package/dist/{EzSchedulerQuickAdd-BeNfGdWs.cjs → EzSchedulerQuickAdd-BYrV9PQ-.cjs} +1 -1
  15. package/dist/{EzSchedulerQuickAdd-BIC8xbSn.js → EzSchedulerQuickAdd-D0kGTzE3.js} +2 -2
  16. package/dist/{EzSchedulerToolbar-jMw8KB8k.js → EzSchedulerToolbar-BhlCMeOT.js} +2 -2
  17. package/dist/{EzSchedulerToolbar-ihfe-5Yd.cjs → EzSchedulerToolbar-Dy62PVnH.cjs} +1 -1
  18. package/dist/{EzSignature-7UHO5lSP.js → EzSignature-B-CPcf7e.js} +5 -2
  19. package/dist/{EzSignature-Df7UZ-IS.cjs → EzSignature-DcmWBPIL.cjs} +1 -1
  20. package/dist/EzTable-Bcq7TByw.cjs +3 -0
  21. package/dist/{EzTable-D2p1IWHc.js → EzTable-DLbb3nl7.js} +1296 -1161
  22. package/dist/EzTableEditDialog--8pD39Rp.cjs +1 -0
  23. package/dist/EzTableEditDialog-m0zW6r6z.js +100 -0
  24. package/dist/{EzTableFooter-DrLoWelo.js → EzTableFooter-BuTS3wDK.js} +1 -1
  25. package/dist/{EzTableToolbar-DwuumvWP.cjs → EzTableToolbar-BWjqKfwx.cjs} +1 -1
  26. package/dist/{EzTableToolbar-BH5z9fSJ.js → EzTableToolbar-BiRfKm9d.js} +2 -2
  27. package/dist/{EzTreeView-D1G0Aomc.js → EzTreeView-B2B_Ruwm.js} +37 -37
  28. package/dist/EzTreeView-DLoPKe2i.cjs +1 -0
  29. package/dist/{KanbanBoard-BsZP_PJi.js → KanbanBoard-CRF0-mYa.js} +119 -119
  30. package/dist/{KanbanBoard-C9bjU_gk.cjs → KanbanBoard-DdXD-Zjt.cjs} +1 -1
  31. package/dist/advanced.cjs +2 -2
  32. package/dist/advanced.es.js +30 -29
  33. package/dist/card-NlCLCGFb.cjs +1 -0
  34. package/dist/{card-ZUNxcdIM.js → card-urNaa5h-.js} +1 -1
  35. package/dist/{checkbox-BrCh_Iid.cjs → checkbox-B9yPkCYi.cjs} +1 -1
  36. package/dist/{checkbox-DRkQuB4W.js → checkbox-BTuckDEm.js} +1 -1
  37. package/dist/components/EzTable/EzTableEditDialog.d.ts +1 -1
  38. package/dist/components/EzTable/hooks/useTableFiltering.d.ts +6 -6
  39. package/dist/components/EzTable/hooks/useTableHistory.d.ts +3 -3
  40. package/dist/components/EzTable/hooks/useTableImperative.d.ts +9 -6
  41. package/dist/components/EzTable/hooks/useTableState.d.ts +12 -12
  42. package/dist/components/EzTable/types/EzTableProps.d.ts +9 -1
  43. package/dist/ezux.css +1 -1
  44. package/dist/flow.cjs +1 -1
  45. package/dist/flow.es.js +1 -1
  46. package/dist/index.cjs +2 -2
  47. package/dist/index.es.js +20 -20
  48. package/dist/input-CcRi0LeO.js +14 -0
  49. package/dist/input-DOh8O0iX.cjs +1 -0
  50. package/dist/kanban.cjs +1 -1
  51. package/dist/kanban.es.js +2 -2
  52. package/dist/layout.cjs +1 -1
  53. package/dist/layout.es.js +1 -1
  54. package/dist/mock-services.cjs +1 -1
  55. package/dist/mock-services.es.js +1 -1
  56. package/dist/scheduler.cjs +1 -1
  57. package/dist/scheduler.es.js +1 -1
  58. package/dist/signature.cjs +1 -1
  59. package/dist/signature.es.js +1 -1
  60. package/dist/table.cjs +1 -1
  61. package/dist/table.es.js +1 -1
  62. package/dist/theme-vars.css +25 -5
  63. package/dist/treeview.cjs +1 -1
  64. package/dist/treeview.es.js +1 -1
  65. package/package.json +39 -36
  66. package/dist/EzKanban-DokdXGqQ.cjs +0 -2
  67. package/dist/EzLayout-BGnqFtvO.cjs +0 -1
  68. package/dist/EzScheduler-B8nV1VWY.cjs +0 -1
  69. package/dist/EzTable-CEXvJR1t.cjs +0 -3
  70. package/dist/EzTableEditDialog-BXnnYSSy.cjs +0 -1
  71. package/dist/EzTableEditDialog-Ccd5XoHm.js +0 -84
  72. package/dist/EzTreeView-KMGlU4ax.cjs +0 -1
  73. package/dist/card-CPlRZxbq.cjs +0 -1
  74. package/dist/input-CYlvlbF7.cjs +0 -1
  75. package/dist/input-Cj3sQK3M.js +0 -14
@@ -3,9 +3,9 @@ import { t as r } from "./button-CYyNwV8S.js";
3
3
  import { n as i, r as a, t as o } from "./avatar-BvCUJ-_r.js";
4
4
  import { i as s, n as c, t as l } from "./EzErrorBoundary-C7a6VisX.js";
5
5
  import { n as u, t as d } from "./useInitCoreServices-CuBrviDM.js";
6
- import { t as f } from "./useServiceState-CkrJZm1D.js";
7
- import { i as p, n as m, r as h, t as g } from "./tooltip-B1wC9m05.js";
8
- import { _, t as v } from "./EzContextMenu-srLxujt8.js";
6
+ import { _ as f, t as p } from "./EzContextMenu-srLxujt8.js";
7
+ import { t as m } from "./useServiceState-CkrJZm1D.js";
8
+ import { i as h, n as g, r as _, t as v } from "./tooltip-B1wC9m05.js";
9
9
  import { a as y, i as b, n as x, r as S, s as C, t as w } from "./TooltipWrapper-BSAmUx9H.js";
10
10
  import { t as T } from "./Modal-CrzpKyjK.js";
11
11
  import E, { useCallback as D, useEffect as O, useMemo as k, useRef as A, useState as j } from "react";
@@ -21,7 +21,7 @@ import { CSS as Te } from "@dnd-kit/utilities";
21
21
  import Ee from "dompurify";
22
22
  //#region src/shared/hooks/useMediaQuery.ts
23
23
  function De(e) {
24
- let [t, n] = j(() => typeof window < "u" ? window.matchMedia(e).matches : !1);
24
+ let [t, n] = j(() => typeof window < "u" && window.matchMedia(e).matches);
25
25
  return O(() => {
26
26
  if (typeof window > "u") return;
27
27
  let t = window.matchMedia(e), r = () => n(t.matches);
@@ -427,7 +427,7 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
427
427
  isUpdating: S.isPending || C.isPending || w.isPending
428
428
  };
429
429
  }, Fe = (e) => {
430
- let { overscanCount: t = 2, startHour: n = "00:00", endHour: r = "24:00" } = e, i = parseInt(n.split(":")[0], 10), a = parseInt(r.split(":")[0], 10), o = 60 / (e.slotDuration || 30), s = Math.max(1, (a - i) * o), { rowVirtualizer: c, columnVirtualizer: l, parentRef: u } = _({
430
+ let { overscanCount: t = 2, startHour: n = "00:00", endHour: r = "24:00" } = e, i = parseInt(n.split(":")[0], 10), a = parseInt(r.split(":")[0], 10), o = 60 / (e.slotDuration || 30), s = Math.max(1, (a - i) * o), { rowVirtualizer: c, columnVirtualizer: l, parentRef: u } = f({
431
431
  rowCount: s,
432
432
  rowHeight: 64,
433
433
  overscanCount: t,
@@ -586,7 +586,7 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
586
586
  this.stop();
587
587
  }
588
588
  }, He = (e) => {
589
- let { serviceRegistry: t, state: n, api: r } = u(e), i = f("I18nService")?.dir || "ltr", a = e.dir === "auto" || !e.dir ? i : e.dir, o = k(() => Ae({
589
+ let { serviceRegistry: t, state: n, api: r } = u(e), i = m("I18nService")?.dir || "ltr", a = e.dir === "auto" || !e.dir ? i : e.dir, o = k(() => Ae({
590
590
  events: e.events || [],
591
591
  resources: e.resources || [],
592
592
  view: e.view ? e.view.toLowerCase() : "week",
@@ -622,10 +622,10 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
622
622
  }, [e.slotDuration]), O(() => {
623
623
  e.is24Hour !== void 0 && c.setIs24Hour(e.is24Hour);
624
624
  }, [e.is24Hour]);
625
- let { view: d, currentDate: p, events: m } = l, { schedulerService: h, recurrenceEngine: g, daysInView: _, visibleEvents: v, allEvents: y, addEvent: b, updateEvent: x, deleteEvent: S, isUpdating: C } = Pe({
625
+ let { view: d, currentDate: f, events: p } = l, { schedulerService: h, recurrenceEngine: g, daysInView: _, visibleEvents: v, allEvents: y, addEvent: b, updateEvent: x, deleteEvent: S, isUpdating: C } = Pe({
626
626
  ...e,
627
- events: m
628
- }, d, p), { parentRef: w, rowVirtualizer: T, columnVirtualizer: E } = Fe(e), { next: D, prev: A, today: M } = Ie(p, c.setCurrentDate, d, e.onDateChange), [N, P] = j(null), { selectedIndex: ee, setSelectedIndex: te } = ke({
627
+ events: p
628
+ }, d, f), { parentRef: w, rowVirtualizer: T, columnVirtualizer: E } = Fe(e), { next: D, prev: A, today: M } = Ie(f, c.setCurrentDate, d, e.onDateChange), [N, P] = j(null), { selectedIndex: ee, setSelectedIndex: te } = ke({
629
629
  totalItems: v.length,
630
630
  enabled: !0,
631
631
  onSelect: (e) => {
@@ -658,7 +658,7 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
658
658
  state: {
659
659
  currentView: l.view,
660
660
  selectedDate: l.selectedDate,
661
- currentDate: p,
661
+ currentDate: f,
662
662
  events: l.events,
663
663
  resources: l.resources,
664
664
  viewEvents: v,
@@ -971,9 +971,9 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
971
971
  children: n
972
972
  })]
973
973
  })
974
- }), Je = () => /* @__PURE__ */ F(qe, { text: "Synchronizing" }), Ye = ({ event: t, style: n, onClick: r, onDoubleClick: i, onDelete: a, orientation: o = "vertical", resizable: s = !1, className: c, showTime: l = !0, isBlocked: u = !1, isPast: d = !1, isHighlighted: f = !1, slotDuration: p = 30, pixelsPerSlot: m, dragOverlay: h = !1, isSourceDragging: g = !1 }) => {
975
- let _ = u || t.isBlock, y = _ || d, b = m || (o === "vertical" ? 64 : 80), { attributes: x, listeners: S, setNodeRef: C, transform: T, isDragging: E } = W({
976
- id: h ? `overlay-${t.id}` : t.id,
974
+ }), Je = () => /* @__PURE__ */ F(qe, { text: "Synchronizing" }), Ye = ({ event: t, style: n, onClick: r, onDoubleClick: i, onDelete: a, orientation: o = "vertical", resizable: s = !1, className: c, showTime: l = !0, isBlocked: u = !1, isPast: d = !1, isHighlighted: f = !1, slotDuration: m = 30, pixelsPerSlot: h, dragOverlay: g = !1, isSourceDragging: _ = !1 }) => {
975
+ let v = u || t.isBlock, y = v || d, b = h || (o === "vertical" ? 64 : 80), { attributes: x, listeners: S, setNodeRef: C, transform: T, isDragging: E } = W({
976
+ id: g ? `overlay-${t.id}` : t.id,
977
977
  data: {
978
978
  type: "event",
979
979
  eventId: t.id,
@@ -981,7 +981,7 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
981
981
  orientation: o,
982
982
  pixelsPerSlot: b
983
983
  },
984
- disabled: h || y
984
+ disabled: g || y
985
985
  }), { attributes: D, listeners: O, setNodeRef: k, transform: A, isDragging: j } = W({
986
986
  id: `resize-bottom-${t.id}`,
987
987
  data: {
@@ -1000,18 +1000,18 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
1000
1000
  pixelsPerSlot: b
1001
1001
  },
1002
1002
  disabled: !s || y
1003
- }), z = j || R, B = b / p, V = new Date(t.start), H = new Date(t.end);
1003
+ }), z = j || R, B = b / m, V = new Date(t.start), H = new Date(t.end);
1004
1004
  if (E && T) {
1005
- let e = o === "vertical" ? T.y : T.x, t = Math.round(e / B / p) * p;
1005
+ let e = o === "vertical" ? T.y : T.x, t = Math.round(e / B / m) * m;
1006
1006
  V = oe(V, t), H = oe(H, t);
1007
1007
  } else if (R && L) {
1008
- let e = o === "vertical" ? L.y : L.x, t = Math.round(e / B / p) * p;
1008
+ let e = o === "vertical" ? L.y : L.x, t = Math.round(e / B / m) * m;
1009
1009
  V = oe(V, t);
1010
1010
  } else if (j && A) {
1011
- let e = o === "vertical" ? A.y : A.x, t = Math.round(e / B / p) * p;
1011
+ let e = o === "vertical" ? A.y : A.x, t = Math.round(e / B / m) * m;
1012
1012
  H = oe(H, t);
1013
1013
  }
1014
- let U = n?.borderColor || t.color || "hsl(var(--primary))", G = _ ? {
1014
+ let U = n?.borderColor || t.color || "hsl(var(--primary))", G = v ? {
1015
1015
  backgroundImage: "repeating - linear - gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.05) 10px, rgba(0, 0, 0, 0.05) 20px)",
1016
1016
  backgroundColor: "rgba(0,0,0,0.02)",
1017
1017
  color: "gray",
@@ -1023,17 +1023,17 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
1023
1023
  ref: C,
1024
1024
  style: {
1025
1025
  ...n,
1026
- transform: h ? void 0 : Te.Translate.toString(T),
1027
- opacity: g ? .35 : E ? .6 : d ? .7 : 1,
1026
+ transform: g ? void 0 : Te.Translate.toString(T),
1027
+ opacity: _ ? .35 : E ? .6 : d ? .7 : 1,
1028
1028
  zIndex: E || z ? 100 : y ? 10 : 20,
1029
1029
  touchAction: "none",
1030
- pointerEvents: h || E || z ? "none" : "auto",
1031
- position: h ? "relative" : "absolute",
1030
+ pointerEvents: g || E || z ? "none" : "auto",
1031
+ position: g ? "relative" : "absolute",
1032
1032
  backgroundColor: `color-mix(in srgb, ${U} 12%, transparent)`,
1033
1033
  color: `color-mix(in srgb, ${U} 90%, black)`,
1034
1034
  borderLeftWidth: "4px",
1035
1035
  borderColor: U,
1036
- ..._ ? G : {},
1036
+ ...v ? G : {},
1037
1037
  ...j && o === "vertical" && A ? { height: `${Math.max((parseInt(n?.height) || 0) + A.y, 24)}px` } : {},
1038
1038
  ...R && o === "vertical" && L ? {
1039
1039
  top: `${(parseInt(n?.top) || 0) + L.y}px`,
@@ -1047,7 +1047,7 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
1047
1047
  },
1048
1048
  ...x,
1049
1049
  ...S,
1050
- className: e("absolute rounded-md text-xs border overflow-hidden group select-none flex flex-col", "bg-primary/10 border-primary/20 text-foreground shadow-sm hover:shadow-md transition-shadow", h && "shadow-xl ring-2 ring-primary/40 cursor-grabbing scale-[1.01]", E && "opacity-50 z-50 shadow-xl scale-105 cursor-grabbing ring-2 ring-primary ring-offset-2", f && "ring-2 ring-primary ring-offset-1 bg-primary/20 shadow-md transition-all duration-300", _ && "bg-muted/50 border-muted opacity-80", !_ && "pointer-events-auto", _ && "pointer-events-auto select-none grayscale", c),
1050
+ className: e("absolute rounded-md text-xs border overflow-hidden group select-none flex flex-col", "bg-primary/10 border-primary/20 text-foreground shadow-sm hover:shadow-md transition-shadow", g && "shadow-xl ring-2 ring-primary/40 cursor-grabbing scale-[1.01]", E && "opacity-50 z-50 shadow-xl scale-105 cursor-grabbing ring-2 ring-primary ring-offset-2", f && "ring-2 ring-primary ring-offset-1 bg-primary/20 shadow-md transition-all duration-300", v && "bg-muted/50 border-muted opacity-80", !v && "pointer-events-auto", v && "pointer-events-auto select-none grayscale", c),
1051
1051
  onClick: (e) => {
1052
1052
  !E && !z && (e.stopPropagation(), r?.(t));
1053
1053
  },
@@ -1064,7 +1064,7 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
1064
1064
  children: [/* @__PURE__ */ F("div", {
1065
1065
  className: "font-semibold truncate pr-4 leading-tight",
1066
1066
  children: t.title
1067
- }), !_ && /* @__PURE__ */ F("button", {
1067
+ }), !v && /* @__PURE__ */ F("button", {
1068
1068
  className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 hover:bg-destructive/10 rounded absolute top-0 right-0 z-10",
1069
1069
  onClick: (e) => {
1070
1070
  e.stopPropagation(), a?.(t.id);
@@ -1073,7 +1073,7 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
1073
1073
  children: /* @__PURE__ */ F(ee, { className: "h-3 w-3 text-muted-foreground hover:text-destructive" })
1074
1074
  })]
1075
1075
  }),
1076
- l && !_ && /* @__PURE__ */ I("div", {
1076
+ l && !v && /* @__PURE__ */ I("div", {
1077
1077
  className: "text-[10px] text-muted-foreground truncate leading-tight",
1078
1078
  children: [
1079
1079
  Q(V, "h:mm a"),
@@ -1085,7 +1085,7 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
1085
1085
  className: "text-[10px] text-muted-foreground line-clamp-2 leading-tight mt-0.5",
1086
1086
  children: t.description
1087
1087
  }),
1088
- _ && /* @__PURE__ */ F("div", {
1088
+ v && /* @__PURE__ */ F("div", {
1089
1089
  className: "flex items-center justify-center h-full",
1090
1090
  children: /* @__PURE__ */ F("span", {
1091
1091
  className: "text-xs font-medium text-muted-foreground opacity-70 -rotate-45 select-none",
@@ -1093,7 +1093,7 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
1093
1093
  })
1094
1094
  })
1095
1095
  ]
1096
- }), s && !_ && /* @__PURE__ */ I(te, { children: [/* @__PURE__ */ F("div", {
1096
+ }), s && !v && /* @__PURE__ */ I(te, { children: [/* @__PURE__ */ F("div", {
1097
1097
  ref: k,
1098
1098
  ...D,
1099
1099
  ...O,
@@ -1112,7 +1112,7 @@ var ke = ({ totalItems: e, columns: t = 1, onSelect: n, onAction: r, onCancel: i
1112
1112
  return /* @__PURE__ */ F(w, {
1113
1113
  content: t.description,
1114
1114
  enabled: !!t.description && !E,
1115
- children: /* @__PURE__ */ F(v, {
1115
+ children: /* @__PURE__ */ F(p, {
1116
1116
  contextId: "scheduler-event",
1117
1117
  data: t,
1118
1118
  children: K
@@ -1452,7 +1452,8 @@ var et = (e, t, n, r, i, a, o, s, c, l = !0, u = !1) => {
1452
1452
  onMouseDown: () => K(h, l.id),
1453
1453
  onMouseEnter: () => q(h),
1454
1454
  onDoubleClick: () => {
1455
- G(h, oe(h, T), l.id) || v?.(h, l.id);
1455
+ let e = oe(h, T);
1456
+ G(h, e, l.id) || v?.(h, l.id);
1456
1457
  },
1457
1458
  onContextMenu: (e) => {
1458
1459
  e.preventDefault(), P?.({
@@ -1564,7 +1565,7 @@ var et = (e, t, n, r, i, a, o, s, c, l = !0, u = !1) => {
1564
1565
  });
1565
1566
  }, rt = ({ currentDate: t, daysInView: n, visibleEvents: r, onSlotClick: i, onSlotDoubleClick: a, onEventClick: o, moreEventsClick: s, dir: c }) => {
1566
1567
  let l = c === "rtl", u = (e) => r.filter((t) => $(t.start, e));
1567
- return /* @__PURE__ */ F(h, { children: /* @__PURE__ */ I("div", {
1568
+ return /* @__PURE__ */ F(_, { children: /* @__PURE__ */ I("div", {
1568
1569
  className: "flex flex-col h-full w-full bg-background rounded-xl border border-border overflow-hidden shadow-sm",
1569
1570
  children: [/* @__PURE__ */ F("div", {
1570
1571
  className: "grid grid-cols-7 border-b border-border bg-muted/30",
@@ -1583,7 +1584,7 @@ var et = (e, t, n, r, i, a, o, s, c, l = !0, u = !1) => {
1583
1584
  }), /* @__PURE__ */ F("div", {
1584
1585
  className: "grid grid-cols-7 grid-rows-6 flex-1 min-h-0 bg-muted/20 gap-px",
1585
1586
  children: n.map((n) => {
1586
- let r = u(n).filter((e) => !e.isBlock), c = ge(n, t), d = $(n, /* @__PURE__ */ new Date()), f = r.slice(0, 4), h = r.length - 4, _ = r.length;
1587
+ let r = u(n).filter((e) => !e.isBlock), c = ge(n, t), d = $(n, /* @__PURE__ */ new Date()), f = r.slice(0, 4), p = r.length - 4, m = r.length;
1587
1588
  return /* @__PURE__ */ I("div", {
1588
1589
  onClick: () => i?.(n),
1589
1590
  onDoubleClick: () => a?.(n),
@@ -1593,15 +1594,15 @@ var et = (e, t, n, r, i, a, o, s, c, l = !0, u = !1) => {
1593
1594
  children: [/* @__PURE__ */ F("span", {
1594
1595
  className: e("text-sm font-medium w-7 h-7 flex items-center justify-center rounded-full transition-all", d ? "bg-primary text-primary-foreground shadow-sm font-bold scale-110" : "text-foreground group-hover:bg-muted/50", !c && "text-muted-foreground opacity-50"),
1595
1596
  children: Q(n, "d")
1596
- }), _ > 0 && /* @__PURE__ */ F("span", {
1597
+ }), m > 0 && /* @__PURE__ */ F("span", {
1597
1598
  className: "text-[10px] text-muted-foreground font-medium px-1.5 py-0.5 rounded-full bg-muted/50",
1598
- children: _
1599
+ children: m
1599
1600
  })]
1600
1601
  }), /* @__PURE__ */ I("div", {
1601
1602
  className: "flex-1 flex flex-col gap-1.5 min-w-0",
1602
- children: [f.map((t) => /* @__PURE__ */ I(g, {
1603
+ children: [f.map((t) => /* @__PURE__ */ I(v, {
1603
1604
  delayDuration: 300,
1604
- children: [/* @__PURE__ */ F(p, {
1605
+ children: [/* @__PURE__ */ F(h, {
1605
1606
  asChild: !0,
1606
1607
  children: /* @__PURE__ */ I("div", {
1607
1608
  onClick: (e) => {
@@ -1617,7 +1618,7 @@ var et = (e, t, n, r, i, a, o, s, c, l = !0, u = !1) => {
1617
1618
  children: Q(t.start, "h:mm a")
1618
1619
  })]
1619
1620
  })
1620
- }), /* @__PURE__ */ F(m, {
1621
+ }), /* @__PURE__ */ F(g, {
1621
1622
  className: "p-3 max-w-xs bg-popover/95 backdrop-blur-sm border-border/50 shadow-xl",
1622
1623
  sideOffset: 5,
1623
1624
  children: /* @__PURE__ */ I("div", {
@@ -1660,14 +1661,14 @@ var et = (e, t, n, r, i, a, o, s, c, l = !0, u = !1) => {
1660
1661
  })]
1661
1662
  })
1662
1663
  })]
1663
- }, t.id)), h > 0 && /* @__PURE__ */ I("button", {
1664
+ }, t.id)), p > 0 && /* @__PURE__ */ I("button", {
1664
1665
  onClick: (e) => {
1665
1666
  e.stopPropagation(), s?.({ date: n });
1666
1667
  },
1667
1668
  className: "mt-auto self-start text-[10px] bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground font-medium px-2 py-1 rounded-md transition-colors w-full text-left",
1668
1669
  children: [
1669
1670
  "+",
1670
- h,
1671
+ p,
1671
1672
  " more"
1672
1673
  ]
1673
1674
  })]
@@ -2088,7 +2089,7 @@ var et = (e, t, n, r, i, a, o, s, c, l = !0, u = !1) => {
2088
2089
  children: i.length === 0 ? /* @__PURE__ */ F("div", {
2089
2090
  className: "text-sm text-muted-foreground px-4 py-2 italic opacity-50",
2090
2091
  children: "No events"
2091
- }) : i.map((t) => /* @__PURE__ */ F(v, {
2092
+ }) : i.map((t) => /* @__PURE__ */ F(p, {
2092
2093
  contextId: "scheduler-event",
2093
2094
  data: t,
2094
2095
  children: /* @__PURE__ */ I("div", {
@@ -2216,7 +2217,7 @@ function ct({ view: e, daysInView: t, visibleEvents: n, rowVirtualizer: r, resou
2216
2217
  }
2217
2218
  //#endregion
2218
2219
  //#region src/components/EzScheduler/index.tsx
2219
- var lt = E.lazy(() => import("./EzEventModal-BDSHG11m.js").then((e) => e.n).then((e) => ({ default: e.EzEventModal }))), ut = E.lazy(() => import("./EzSchedulerQuickAdd-BIC8xbSn.js").then((e) => e.n).then((e) => ({ default: e.EzSchedulerQuickAdd }))), dt = E.lazy(() => import("./EzSchedulerToolbar-jMw8KB8k.js").then((e) => e.n).then((e) => ({ default: e.EzSchedulerToolbar }))), ft = new J();
2220
+ var lt = E.lazy(() => import("./EzEventModal-D5lX9XuW.js").then((e) => e.n).then((e) => ({ default: e.EzEventModal }))), ut = E.lazy(() => import("./EzSchedulerQuickAdd-D0kGTzE3.js").then((e) => e.n).then((e) => ({ default: e.EzSchedulerQuickAdd }))), dt = E.lazy(() => import("./EzSchedulerToolbar-BhlCMeOT.js").then((e) => e.n).then((e) => ({ default: e.EzSchedulerToolbar }))), ft = new J();
2220
2221
  function pt({ ref: e, ...t }) {
2221
2222
  return d(), /* @__PURE__ */ F(re, {
2222
2223
  client: ft,
@@ -2289,8 +2290,8 @@ function mt({ ref: t, ...n }) {
2289
2290
  o.updateEvent(e);
2290
2291
  }
2291
2292
  }), te = D((e) => {
2292
- let t = e.active.data.current, n = t?.eventId || t?.id || e.active.id;
2293
- O((t?.event || m.find((e) => e.id === n)) ?? null);
2293
+ let t = e.active.data.current, n = t?.eventId || t?.id || e.active.id, r = t?.event || m.find((e) => e.id === n);
2294
+ O(r ?? null);
2294
2295
  }, [m]), L = D((e) => {
2295
2296
  ee(e), O(null);
2296
2297
  }, [ee]), B = D(() => {
@@ -2347,11 +2348,15 @@ function mt({ ref: t, ...n }) {
2347
2348
  }
2348
2349
  });
2349
2350
  }, ae = (e) => {
2350
- n.onEventDoubleClick ? n.onEventDoubleClick(e) : W({
2351
- isOpen: !0,
2352
- mode: e.end < /* @__PURE__ */ new Date() ? "view" : "edit",
2353
- event: e
2354
- });
2351
+ if (n.onEventDoubleClick) n.onEventDoubleClick(e);
2352
+ else {
2353
+ let t = e.end < /* @__PURE__ */ new Date();
2354
+ W({
2355
+ isOpen: !0,
2356
+ mode: t ? "view" : "edit",
2357
+ event: e
2358
+ });
2359
+ }
2355
2360
  }, X = (e, t) => e === !1 || t.cancel, se = async (e) => {
2356
2361
  if (!n.allowPastEvents && e.start && e.start < /* @__PURE__ */ new Date()) {
2357
2362
  N("past");
@@ -2456,8 +2461,7 @@ function mt({ ref: t, ...n }) {
2456
2461
  onToday: o.today,
2457
2462
  currentView: f,
2458
2463
  onViewChange: (e) => {
2459
- let t = e.toLowerCase().replace(/[^a-z]/g, "");
2460
- v({
2464
+ let t = e.toLowerCase().replace(/[^a-z]/g, ""), n = {
2461
2465
  day: "day",
2462
2466
  week: "week",
2463
2467
  workweek: "workweek",
@@ -2468,7 +2472,8 @@ function mt({ ref: t, ...n }) {
2468
2472
  timelinemonth: "timeline-month",
2469
2473
  agenda: "agenda",
2470
2474
  timeline: "timeline-day"
2471
- }[t] || t);
2475
+ }[t] || t;
2476
+ v(n);
2472
2477
  },
2473
2478
  views: n.views || [
2474
2479
  "Day",
@@ -2501,8 +2506,7 @@ function mt({ ref: t, ...n }) {
2501
2506
  onToday: o.today,
2502
2507
  currentView: f,
2503
2508
  onViewChange: (e) => {
2504
- let t = e.toLowerCase().replace(/[^a-z]/g, "");
2505
- v({
2509
+ let t = e.toLowerCase().replace(/[^a-z]/g, ""), n = {
2506
2510
  day: "day",
2507
2511
  week: "week",
2508
2512
  workweek: "workweek",
@@ -2513,7 +2517,8 @@ function mt({ ref: t, ...n }) {
2513
2517
  timelinemonth: "timeline-month",
2514
2518
  agenda: "agenda",
2515
2519
  timeline: "timeline-day"
2516
- }[t] || t);
2520
+ }[t] || t;
2521
+ v(n);
2517
2522
  },
2518
2523
  views: n.views || [
2519
2524
  "Day",
@@ -0,0 +1 @@
1
+ const e=require("./EzProvider-L2qQMq-v.cjs"),t=require("./button-BBMwzUtG.cjs"),n=require("./avatar-BSdRHETK.cjs"),r=require("./EzErrorBoundary-d_2g-_EK.cjs"),i=require("./useInitCoreServices-DlALVDNx.cjs"),a=require("./EzContextMenu-BCUoEQp5.cjs"),o=require("./useServiceState-PyYQWxHi.cjs"),s=require("./tooltip-Qmzrg5u5.cjs"),c=require("./TooltipWrapper-DfbFAZ1U.cjs"),l=require("./Modal-BmX1C448.cjs");let u=require("react");u=e.y(u,1);let d=require("lucide-react"),f=require("react/jsx-runtime"),p=require("@tanstack/store"),m=require("@dnd-kit/core"),h=require("@tanstack/react-store"),g=require("@tanstack/react-query"),_=require("date-fns"),v=require("rrule"),y=require("@dnd-kit/utilities"),b=require("dompurify");b=e.y(b,1);function x(e){let[t,n]=(0,u.useState)(()=>typeof window<`u`&&window.matchMedia(e).matches);return(0,u.useEffect)(()=>{if(typeof window>`u`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return t.addEventListener?t.addEventListener(`change`,r):t.addListener(r),()=>{t.removeEventListener?t.removeEventListener(`change`,r):t.removeListener(r)}},[e]),t}function S(e=6e4){let[t,n]=(0,u.useState)(()=>new Date);return(0,u.useEffect)(()=>{let t=setInterval(()=>{n(new Date)},e);return()=>clearInterval(t)},[e]),t}var C=({totalItems:e,columns:t=1,onSelect:n,onAction:r,onCancel:i,wrap:a=!0,enabled:o=!0})=>{let[s,c]=(0,u.useState)(-1),l=(0,u.useCallback)(l=>{if(!o||e===0)return;let u=s;switch(l.key){case`ArrowDown`:s===-1?u=0:(u=s+t,u>=e&&(u=a?u%t:s)),l.preventDefault();break;case`ArrowUp`:if(s===-1)u=e-1;else if(u=s-t,u<0)if(a){let n=s%t;u=(Math.ceil(e/t)-1)*t+n,u>=e&&(u-=t)}else u=s;l.preventDefault();break;case`ArrowRight`:s===-1?u=0:(u=s+1,u>=e&&(u=a?0:s)),l.preventDefault();break;case`ArrowLeft`:s===-1?u=e-1:(u=s-1,u<0&&(u=a?e-1:s)),l.preventDefault();break;case`Enter`:s!==-1&&r&&(r(s),l.preventDefault());break;case`Escape`:i&&(i(),l.preventDefault()),c(-1);break;default:return}u!==s&&(c(u),n?.(u))},[s,e,t,n,r,i,a,o]);return(0,u.useEffect)(()=>{if(o)return window.addEventListener(`keydown`,l),()=>window.removeEventListener(`keydown`,l)},[o,l]),{selectedIndex:s,setSelectedIndex:c}},w=e=>new p.Store({events:[],resources:[],view:`week`,currentDate:new Date,selectedDate:new Date,selectedEventId:null,slotDuration:30,is24Hour:!0,...e}),T=e=>({setEvents:t=>{e.setState(e=>({...e,events:t}))},addEvent:t=>{e.setState(e=>({...e,events:[...e.events,t]}))},updateEvent:t=>{e.setState(e=>({...e,events:e.events.map(e=>e.id===t.id?t:e)}))},deleteEvent:t=>{e.setState(e=>({...e,events:e.events.filter(e=>e.id!==t)}))},setResources:t=>{e.setState(e=>({...e,resources:t}))},setView:t=>{e.setState(e=>({...e,view:t}))},setCurrentDate:t=>{e.setState(e=>({...e,currentDate:t}))},setSelectedDate:t=>{e.setState(e=>({...e,selectedDate:t}))},setSelectedEventId:t=>{e.setState(e=>({...e,selectedEventId:t}))},setSlotDuration:t=>{e.setState(e=>({...e,slotDuration:t}))},setIs24Hour:t=>{e.setState(e=>({...e,is24Hour:t}))}}),E=class{name=`SchedulerService`;events=new Map;resources=new Map;constructor(e=[]){this.initializeWithData(e)}async init(){}async cleanup(){}initializeWithData(e,t=[]){this.events.clear(),this.resources.clear(),e.forEach(e=>{this.events.set(String(e.id),JSON.parse(JSON.stringify(e)))}),t.forEach(e=>{this.resources.set(String(e.id),JSON.parse(JSON.stringify(e)))})}async getEvents(e,t){return await this.simulateLatency(),!e||!t?Array.from(this.events.values()):Array.from(this.events.values()).filter(n=>{let r=new Date(n.start),i=new Date(n.end);return r>=e&&r<t||i>e&&i<=t||r<=e&&i>=t}).map(e=>({...e,start:new Date(e.start),end:new Date(e.end)}))}async addEvent(e){await this.simulateLatency();let t={id:e.id||Math.random().toString(36).substring(2,9),title:e.title||`Untitled Event`,start:e.start||new Date,end:e.end||new Date(new Date().getTime()+3600*1e3),description:e.description,resourceId:e.resourceId,resourceIds:e.resourceIds,allDay:e.allDay||!1,...e};return this.events.set(String(t.id),t),t}async updateEvent(e){await this.simulateLatency();let t=String(e.id);if(this.events.has(t)){let n={...this.events.get(t),...e,id:t};return this.events.set(t,n),n}else if(this.events.has(e.id)){let t={...this.events.get(e.id),...e};return this.events.set(e.id,t),t}throw Error(`Event with ID ${e.id} not found`)}async deleteEvent(e){await this.simulateLatency();let t=String(e);this.events.has(t)?this.events.delete(t):this.events.has(e)&&this.events.delete(e)}async getResources(){return await this.simulateLatency(),Array.from(this.resources.values())}async addResource(e){return await this.simulateLatency(),e.id||=Math.random().toString(36).substring(2,9),this.resources.set(String(e.id),e),e}simulateLatency(){return new Promise(e=>setTimeout(e,300))}},D=class{name=`RecurrenceEngine`;expandEvents(e,t,n){let r=[];return e.forEach(e=>{if(e.recurrenceRule||e.rrule)try{let i=e.recurrenceRule||e.rrule||``;if(!i)return;let a=new Date(e.start),o=new Date(e.end),s=v.RRule.parseString(i);s.dtstart=a;let c=new v.RRule(s).between(t,n,!0),l=new Set;e.exdate&&Array.isArray(e.exdate)?e.exdate.forEach(e=>{let t=new Date(e).getTime();isNaN(t)||l.add(t)}):typeof e.recurrenceException==`string`&&e.recurrenceException.split(`,`).forEach(e=>{let t=new Date(e).getTime();isNaN(t)||l.add(t)}),c.forEach(t=>{if(l.has(t.getTime()))return;let n=o.getTime()-a.getTime();if(isNaN(n))return;let i=new Date(t.getTime()+n);r.push({...e,id:`${e.id}-${t.getTime()}`,recurrenceId:String(e.id),start:t,end:i,originalStart:a})})}catch(t){console.error(`Error processing recurrence rule for event ${e.id}:`,t),r.push(e)}else r.push(e)}),r}cleanup(){}},O=(t,n,i)=>{let a=e.n(),{events:o,serviceRegistry:s=a,showWeekend:c=!0,recurrenceEngine:l,onEventCreate:d,onEventChange:f,onEventDelete:p}=t,m=(0,g.useQueryClient)(),h=r.i(s,`SchedulerService`,()=>new E(o||[])),v=l||r.i(s,`RecurrenceEngine`,()=>new D);(0,u.useEffect)(()=>{o&&o.length>0&&(h.initializeWithData(o),m.invalidateQueries({queryKey:[`scheduler-events`]}))},[o,h,m]);let y=(0,u.useMemo)(()=>{let e,t;if(n===`day`||n===`timeline-day`)e=(0,_.startOfDay)(i),t=(0,_.endOfDay)(i);else if(n===`month`||n===`timeline-month`)e=n===`month`?(0,_.startOfWeek)((0,_.startOfMonth)(i),{weekStartsOn:0}):(0,_.startOfMonth)(i),t=n===`month`?(0,_.endOfWeek)((0,_.endOfMonth)(i),{weekStartsOn:0}):(0,_.endOfMonth)(i);else if(n===`week`||n===`workweek`||n===`timeline-week`){let r=(0,_.startOfWeek)(i,{weekStartsOn:0});e=n===`workweek`?(0,_.addDays)(r,1):r,t=n===`workweek`?(0,_.addDays)(r,5):(0,_.endOfWeek)(i,{weekStartsOn:0})}else e=(0,_.startOfDay)(i),t=(0,_.endOfDay)(i);try{let n=(0,_.eachDayOfInterval)({start:e,end:t});return c?n:n.filter(e=>{let t=e.getDay();return t!==0&&t!==6})}catch{return[i]}},[n,i,c]),b=y.length>0?(0,_.startOfDay)(y[0]):new Date,x=y.length>0?(0,_.endOfDay)(y[y.length-1]):new Date,{data:S=[]}=(0,g.useQuery)({queryKey:[`scheduler-events`,b.toISOString(),x.toISOString()],queryFn:()=>h.getEvents(b,x),placeholderData:o||[]}),C=(0,u.useMemo)(()=>y.length===0?[]:v.expandEvents(S,b,x),[S,y,v,b,x]),w=(0,u.useMemo)(()=>y.length?C.filter(e=>(0,_.isWithinInterval)(e.start,{start:b,end:x})||(0,_.isWithinInterval)(e.end,{start:b,end:x})||e.start<b&&e.end>x):[],[C,y,b,x]),T=(0,g.useMutation)({mutationFn:async e=>{let t=await h.addEvent(e);return d&&await d(t),t},onMutate:async e=>{let t=[`scheduler-events`,b.toISOString(),x.toISOString()];await m.cancelQueries({queryKey:t});let n=m.getQueryData(t);return m.setQueryData(t,(t=[])=>{let n={...e,id:e.id||Date.now().toString(),start:e.start||new Date,end:e.end||new Date};return[...t,n]}),{previousEvents:n,queryKey:t}},onError:(e,t,n)=>{n?.previousEvents&&m.setQueryData(n.queryKey,n.previousEvents)},onSettled:()=>{m.invalidateQueries({queryKey:[`scheduler-events`]})}}),O=(0,g.useMutation)({mutationFn:async e=>{let t=await h.updateEvent(e);return f&&await f(t),t},onMutate:async e=>{let t=[`scheduler-events`,b.toISOString(),x.toISOString()];await m.cancelQueries({queryKey:t});let n=m.getQueryData(t);return m.setQueryData(t,(t=[])=>t.map(t=>t.id===e.id?e:t)),{previousEvents:n,queryKey:t}},onError:(e,t,n)=>{n?.previousEvents&&m.setQueryData(n.queryKey,n.previousEvents)},onSettled:()=>{m.invalidateQueries({queryKey:[`scheduler-events`]})}}),k=(0,g.useMutation)({mutationFn:async e=>(await h.deleteEvent(e),p&&await p(e.toString()),e),onMutate:async e=>{let t=[`scheduler-events`,b.toISOString(),x.toISOString()];await m.cancelQueries({queryKey:t});let n=m.getQueryData(t);return m.setQueryData(t,(t=[])=>t.filter(t=>t.id!==e)),{previousEvents:n,queryKey:t}},onError:(e,t,n)=>{n?.previousEvents&&m.setQueryData(n.queryKey,n.previousEvents)},onSettled:()=>{m.invalidateQueries({queryKey:[`scheduler-events`]})}});return{schedulerService:h,recurrenceEngine:v,daysInView:y,visibleEvents:w,allEvents:S,addEvent:T.mutateAsync,updateEvent:O.mutateAsync,deleteEvent:k.mutateAsync,isUpdating:T.isPending||O.isPending||k.isPending}},k=e=>{let{overscanCount:t=2,startHour:n=`00:00`,endHour:r=`24:00`}=e,i=parseInt(n.split(`:`)[0],10),o=parseInt(r.split(`:`)[0],10),s=60/(e.slotDuration||30),c=Math.max(1,(o-i)*s),{rowVirtualizer:l,columnVirtualizer:u,parentRef:d}=a._({rowCount:c,rowHeight:64,overscanCount:t,progressiveRendering:e.progressiveRendering,prefetchDistance:e.prefetchDistance,enableColumnVirtualization:e.view?.startsWith(`timeline`),columnCount:e.view?.startsWith(`timeline`)?c:0,columnWidth:100,id:e.id,debug:e.debugVirtualization,onScrollStart:()=>{e.virtualScrollStart&&e.virtualScrollStart({virtualizer:{}})},onScrollStop:()=>{e.virtualScrollStop&&e.virtualScrollStop({virtualizer:{}})}});return{parentRef:d,rowVirtualizer:l,columnVirtualizer:u}},A=(e,t,n,r)=>{let i=e=>{t(e),r?.(e)};return{next:()=>{let t=e;n===`day`||n===`timeline-day`?t=(0,_.addDays)(e,1):n===`week`||n===`workweek`||n===`timeline-week`?t=(0,_.addWeeks)(e,1):(n===`month`||n===`timeline-month`)&&(t=(0,_.addMonths)(e,1)),i(t)},prev:()=>{let t=e;n===`day`||n===`timeline-day`?t=(0,_.subDays)(e,1):n===`week`||n===`workweek`||n===`timeline-week`?t=(0,_.subWeeks)(e,1):(n===`month`||n===`timeline-month`)&&(t=(0,_.subMonths)(e,1)),i(t)},today:()=>{i(new Date)}}},j=class extends e.g{name=`HistoryService`;undoStack=[];redoStack=[];maxHistorySize=50;constructor(){super({canUndo:!1,canRedo:!1})}record(e){let t={...e,timestamp:Date.now()};this.undoStack.push(t),this.undoStack.length>this.maxHistorySize&&this.undoStack.shift(),this.redoStack=[],this.updateState()}undo(){if(this.undoStack.length===0)return null;let e=this.undoStack.pop();return this.redoStack.push(e),this.updateState(),e}redo(){if(this.redoStack.length===0)return null;let e=this.redoStack.pop();return this.undoStack.push(e),this.updateState(),e}clear(){this.undoStack=[],this.redoStack=[],this.updateState()}updateState(){this.setState({canUndo:this.undoStack.length>0,canRedo:this.redoStack.length>0})}cleanup(){this.clear(),super.cleanup()}},M=class{name=`SearchService`;search(e,t,n={}){if(!t||!t.trim())return e;let r=n.matchCase?t:t.toLowerCase(),i=n.fields||[`title`,`description`,`location`];return e.filter(e=>i.some(t=>{let i=e[t];return typeof i==`string`?n.matchCase?i.includes(r):i.toLowerCase().includes(r):!1}))}cleanup(){}},N=class{name=`TimezoneService`;constructor(){}toTimezone(e,t){if(!t||t===`UTC`||t===`Local`)return new Date(e);try{let n=new Date(e).toLocaleString(`en-US`,{timeZone:t});return new Date(n)}catch(n){return console.warn(`TimezoneService: Invalid timezone ${t}`,n),new Date(e)}}formatInTimezone(e,t,n){try{return new Intl.DateTimeFormat(`en-US`,{...n,timeZone:t}).format(new Date(e))}catch(e){return console.error(`TimezoneService formatting error:`,e),``}}getLocalTimezone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}cleanup(){}},P=class{name=`AttendeeService`;constructor(){}isValidEmail(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}getStatusLabel(e){switch(e){case`accepted`:return`Accepted`;case`declined`:return`Declined`;case`tentative`:return`Tentative`;case`needs-action`:return`Needs Action`;default:return`Unknown`}}cleanup(){}},F=class{name=`ReminderService`;timer=null;checkInterval=6e4;onReminderTriggered;constructor(){}start(e){this.onReminderTriggered=e,this.timer&&clearInterval(this.timer),this.timer=setInterval(()=>this.checkReminders(),this.checkInterval)}stop(){this.timer&&=(clearInterval(this.timer),null)}checkReminders(){console.log(`[ReminderService] Checking for due reminders...`,this.onReminderTriggered)}getTriggerTime(e,t){return new Date(e.getTime()-t*6e4)}cleanup(){this.stop()}},I=e=>{let{serviceRegistry:t,state:n,api:a}=i.n(e),s=o.t(`I18nService`)?.dir||`ltr`,c=e.dir===`auto`||!e.dir?s:e.dir,l=(0,u.useMemo)(()=>w({events:e.events||[],resources:e.resources||[],view:e.view?e.view.toLowerCase():`week`,currentDate:e.selectedDate||new Date,selectedDate:e.selectedDate||new Date,slotDuration:e.slotDuration||30,is24Hour:e.is24Hour??!0}),[]),d=(0,u.useMemo)(()=>T(l),[l]),f=(0,h.useStore)(l,e=>e);(0,u.useEffect)(()=>{e.events&&d.setEvents(e.events)},[e.events]),(0,u.useEffect)(()=>{e.resources&&d.setResources(e.resources)},[e.resources]),(0,u.useEffect)(()=>{if(e.view){let t=e.view.toLowerCase().replace(/[^a-z]/g,``);d.setView({day:`day`,week:`week`,workweek:`workweek`,month:`month`,timelineday:`timeline-day`,timelineweek:`timeline-week`,timelineworkweek:`timeline-week`,timelinemonth:`timeline-month`,agenda:`agenda`,timeline:`timeline-day`}[t]||t)}},[e.view,d]),(0,u.useEffect)(()=>{e.selectedDate&&(d.setCurrentDate(e.selectedDate),d.setSelectedDate(e.selectedDate))},[e.selectedDate]),(0,u.useEffect)(()=>{e.slotDuration!==void 0&&d.setSlotDuration(e.slotDuration)},[e.slotDuration]),(0,u.useEffect)(()=>{e.is24Hour!==void 0&&d.setIs24Hour(e.is24Hour)},[e.is24Hour]);let{view:p,currentDate:m,events:g}=f,{schedulerService:_,recurrenceEngine:v,daysInView:y,visibleEvents:b,allEvents:x,addEvent:S,updateEvent:E,deleteEvent:D,isUpdating:I}=O({...e,events:g},p,m),{parentRef:L,rowVirtualizer:R,columnVirtualizer:z}=k(e),{next:B,prev:V,today:H}=A(m,d.setCurrentDate,p,e.onDateChange),[U,W]=(0,u.useState)(null),{selectedIndex:G,setSelectedIndex:K}=C({totalItems:b.length,enabled:!0,onSelect:e=>{let t=b[e];t&&(W(t.id),(document.getElementById(`event-${t.id}`)||document.querySelector(`[data-event-id="${t.id}"]`))?.scrollIntoView({behavior:`smooth`,block:`nearest`}))},onAction:t=>{let n=b[t];n&&e.onEventClick&&e.onEventClick(n)}}),q=(0,u.useMemo)(()=>({showWeekend:e.showWeekend??!0,timeFormat:e.timeFormat,weekRule:e.weekRule||`FirstDay`,monthsCount:e.monthsCount||1,eventDragArea:e.eventDragArea,dir:c||`ltr`}),[e.showWeekend,e.timeFormat,e.weekRule,e.monthsCount,e.eventDragArea,c]),J=r.i(t,`HistoryService`,()=>new j),ee=r.i(t,`SearchService`,()=>new M),Y=r.i(t,`TimezoneService`,()=>new N),X=r.i(t,`AttendeeService`,()=>new P),te=r.i(t,`ReminderService`,()=>new F);return{state:{currentView:f.view,selectedDate:f.selectedDate,currentDate:m,events:f.events,resources:f.resources,viewEvents:b,daysInView:y,allEvents:x,slotDuration:f.slotDuration,is24Hour:f.is24Hour,isUpdating:I,selectedIndex:G,highlightedEventId:U},actions:{nextPeriod:B,prevPeriod:V,today:H,setView:d.setView,setDate:d.setSelectedDate,setCurrentDate:d.setCurrentDate,addEvent:S,updateEvent:E,deleteEvent:D,setSlotDuration:d.setSlotDuration,setIs24Hour:d.setIs24Hour,setSelectedIndex:K,setHighlightedEventId:W},services:{schedulerService:_,recurrenceEngine:v,historyService:J,searchService:ee,timezoneService:Y,attendeeService:X,reminderService:te,serviceRegistry:t},config:q,refs:{parentRef:L,rowVirtualizer:R,columnVirtualizer:z},baseState:n,baseApi:a,dir:c}},L=(e,t,n,i,a,o,s={},l=30)=>{r.n(o,(0,u.useMemo)(()=>{let r=c.i(a.scrollToIndex),o=c.n(()=>n.getEvents(),e=>n.addEvent(e),e=>n.updateEvent(e),e=>n.deleteEvent(e)),u=c.s(a.showSpinner,a.hideSpinner),d=c.a(()=>{},a.forceUpdate),f=c.r(()=>s.onExportExcel?.(i),()=>s.onExportICS?.(i),()=>{window.print()});return{changeView:a.changeView,changeCurrentView:a.changeView,next:a.next,prev:a.prev,today:a.today,...r,scrollTo:(e,t=0)=>{let n=parseInt(e.split(`:`)[0])*60+t,r=Math.floor(n/l);a.scrollToIndex(r)},scrollToTime:(e,t)=>{let n=e*60+t,r=Math.floor(n/l);a.scrollToIndex(r)},...o,getCurrentDate:()=>t,setCurrentDate:e=>{let n=e.getTime()-t.getTime();n>0&&a.next(),n<0&&a.prev()},getEvents:async()=>n.getEvents(),getEventsInDateRange:async(e,t)=>n.getEvents(e,t),addEvent:async e=>{await n.addEvent(e)},saveEvent:async e=>{await n.updateEvent(e)},deleteEvent:async e=>{await n.deleteEvent(e)},getCurrentViewEvents:()=>i,scrollToEvent:e=>{let t=i.find(t=>t.id===e);if(!t)return;let n=t.start.getHours()*60+t.start.getMinutes();a.scrollToIndex(Math.floor(n/l))},selectEvent:()=>{},clearSelection:()=>{},addResource:async e=>{a.setResources(t=>[...t,e])},getResources:async()=>n.getResources(),updateResource:async(e,t)=>{a.setResources(n=>n.map(n=>String(n.id)===String(e)?{...n,...t}:n))},removeResource:async e=>{a.setResources(t=>t.filter(t=>t.id!==e))},openEditor:(e,t=`Add`)=>{a.setEditorState({isOpen:!0,mode:t===`Edit`?`edit`:t===`view`?`view`:`create`,event:e})},closeEditor:()=>a.setEditorState({isOpen:!1,mode:`create`,event:void 0}),closeQuickInfoPopup:a.closeQuickInfoPopup,...u,...d,...f,currentView:e,...s}},[e,t,i,a,n,s,l]))},R=({resources:e})=>{let t=(0,u.useMemo)(()=>!e||e.length===0?[]:`dataSource`in e[0]?e.flatMap(e=>e.dataSource):e,[e]),[n,r]=(0,u.useState)(t);return(0,u.useEffect)(()=>{r(t)},[t]),{resources:t,internalResources:n,setInternalResources:r}},z=({events:e,resources:t=[],onEventChange:n,onBeforeEventDrop:r,onBeforeEventResize:i,slotDuration:a=30})=>{let o=(0,u.useCallback)(e=>{if(e)return t.find(t=>String(t.id)===String(e))},[t]),s=(e,t)=>e===!1||t.cancel,c=(0,u.useCallback)(t=>{let{active:c,over:l,delta:u}=t,d=e.find(e=>e.id===c.id||e.id===(c.data?.current?.eventId||c.data?.current?.id));if(!d)return;if(c.data?.current?.type?.startsWith(`resize-`)){let e=c.data.current.type,t=c.data.current,r=t?.orientation||`vertical`,l=t?.pixelsPerSlot||64,f=r===`vertical`?u.y:u.x,p=Math.round(f/l)*a;if(p===0)return;let m,h;if(e===`resize-bottom`){let e=new Date(d.end.getTime()+p*60*1e3),t=new Date(d.start.getTime()+a*60*1e3),n=e<t?t:e;h=`end`,m={...d,end:n}}else if(e===`resize-top`){let e=new Date(d.start.getTime()+p*60*1e3),t=new Date(d.end.getTime()-a*60*1e3),n=e>t?t:e;h=`start`,m={...d,start:n}}if(!m)return;let g={data:d,event:m,originalEvent:d,proposedEvent:m,sourceResourceId:d.resourceId,targetResourceId:m.resourceId,sourceResource:o(d.resourceId),targetResource:o(m.resourceId),sourceTime:d.start,targetTime:m.start,resizeEdge:h,cancel:!1};if(s(i?.(g),g))return;n?.(m);return}if(!l)return;let f=l.data?.current;if(f?.kind===`time-slot`||typeof l.id==`string`&&l.id.startsWith(`slot-`)){let e=f?.date,t=f?.resourceId;if(e){let i=d.end.getTime()-d.start.getTime(),a=new Date(e),c=new Date(a.getTime()+i),l={...d,start:a,end:c,resourceId:t===`none`?void 0:t,resourceIds:t&&t!==`none`?[t]:d.resourceIds},u={data:d,event:l,originalEvent:d,proposedEvent:l,sourceResourceId:d.resourceId,targetResourceId:l.resourceId,sourceResource:o(d.resourceId),targetResource:o(l.resourceId),sourceTime:d.start,targetTime:a,cancel:!1};if(s(r?.(u),u))return;n?.(l)}return}if(f?.kind===`timeline-row`){let e=f.slotWidth||80,t=f.resourceId,i=f.isRtl?-1:1,c=Math.round(u.x*i/e)*a,l=d.end.getTime()-d.start.getTime(),p=new Date(d.start.getTime()+c*60*1e3),m=new Date(p.getTime()+l),h={...d,start:p,end:m,resourceId:t===`none`?void 0:t,resourceIds:t&&t!==`none`?[t]:d.resourceIds},g={data:d,event:h,originalEvent:d,proposedEvent:h,sourceResourceId:d.resourceId,targetResourceId:h.resourceId,sourceResource:o(d.resourceId),targetResource:o(h.resourceId),sourceTime:d.start,targetTime:p,cancel:!1};if(s(r?.(g),g))return;n?.(h);return}let p=typeof l.id==`string`&&l.id.startsWith(`header-`)?l.id.replace(`header-`,``):null;if(p){let e={...d,resourceId:p},t={data:d,event:e,originalEvent:d,proposedEvent:e,sourceResourceId:d.resourceId,targetResourceId:e.resourceId,sourceResource:o(d.resourceId),targetResource:o(e.resourceId),sourceTime:d.start,targetTime:e.start,cancel:!1};if(s(r?.(t),t))return;n?.(e)}},[e,o,r,i,n,a]);return{sensors:(0,m.useSensors)((0,m.useSensor)(m.PointerSensor,{activationConstraint:{distance:8}})),handleDragEnd:c}},B=()=>(0,f.jsx)(`div`,{className:`flex flex-col items-center justify-center min-h-screen p-4`,children:(0,f.jsxs)(`div`,{className:`flex flex-col items-center gap-4 max-w-md w-full`,children:[(0,f.jsx)(`div`,{className:`flex items-center justify-center w-16 h-16 rounded-full bg-destructive/10`,children:(0,f.jsx)(d.AlertTriangle,{className:`w-8 h-8 text-destructive`})}),(0,f.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,f.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Scheduler Error`}),(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Something went wrong with the scheduler. Please refresh the page or try again.`})]}),(0,f.jsxs)(`button`,{onClick:()=>window.location.reload(),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium text-primary hover:bg-primary/10 rounded-md transition-colors`,children:[(0,f.jsx)(d.RefreshCw,{className:`w-4 h-4`}),`Refresh Page`]})]})}),V=({variant:t=`primary`,text:n=`Loading`,className:r})=>(0,f.jsx)(`div`,{className:e._(`absolute inset-0 bg-background/40 backdrop-blur-[2px] z-[100] flex items-center justify-center transition-all duration-300`,r),children:(0,f.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,f.jsx)(`div`,{className:e._({sm:`w-8 h-8`,md:`w-10 h-10`,lg:`w-12 h-12`}.md,{primary:`border-primary/20 border-t-primary`,secondary:`border-muted-foreground/20 border-t-muted-foreground`}[t],`rounded-full animate-spin`)}),(0,f.jsx)(`span`,{className:`text-[10px] font-black uppercase tracking-widest text-primary animate-pulse`,children:n})]})}),H=()=>(0,f.jsx)(V,{text:`Synchronizing`}),U=({event:t,style:n,onClick:r,onDoubleClick:i,onDelete:o,orientation:s=`vertical`,resizable:l=!1,className:u,showTime:p=!0,isBlocked:h=!1,isPast:g=!1,isHighlighted:v=!1,slotDuration:b=30,pixelsPerSlot:x,dragOverlay:S=!1,isSourceDragging:C=!1})=>{let w=h||t.isBlock,T=w||g,E=x||(s===`vertical`?64:80),{attributes:D,listeners:O,setNodeRef:k,transform:A,isDragging:j}=(0,m.useDraggable)({id:S?`overlay-${t.id}`:t.id,data:{type:`event`,eventId:t.id,event:t,orientation:s,pixelsPerSlot:E},disabled:S||T}),{attributes:M,listeners:N,setNodeRef:P,transform:F,isDragging:I}=(0,m.useDraggable)({id:`resize-bottom-${t.id}`,data:{type:`resize-bottom`,eventId:t.id,orientation:s,pixelsPerSlot:E},disabled:!l||T}),{attributes:L,listeners:R,setNodeRef:z,transform:B,isDragging:V}=(0,m.useDraggable)({id:`resize-top-${t.id}`,data:{type:`resize-top`,eventId:t.id,orientation:s,pixelsPerSlot:E},disabled:!l||T}),H=I||V,U=E/b,W=new Date(t.start),G=new Date(t.end);if(j&&A){let e=s===`vertical`?A.y:A.x,t=Math.round(e/U/b)*b;W=(0,_.addMinutes)(W,t),G=(0,_.addMinutes)(G,t)}else if(V&&B){let e=s===`vertical`?B.y:B.x,t=Math.round(e/U/b)*b;W=(0,_.addMinutes)(W,t)}else if(I&&F){let e=s===`vertical`?F.y:F.x,t=Math.round(e/U/b)*b;G=(0,_.addMinutes)(G,t)}let K=n?.borderColor||t.color||`hsl(var(--primary))`,q=w?{backgroundImage:`repeating - linear - gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.05) 10px, rgba(0, 0, 0, 0.05) 20px)`,backgroundColor:`rgba(0,0,0,0.02)`,color:`gray`,borderLeftWidth:`4px`,borderColor:`#d1d5db`,borderStyle:`solid`,opacity:1}:{},J=(0,f.jsxs)(`div`,{ref:k,style:{...n,transform:S?void 0:y.CSS.Translate.toString(A),opacity:C?.35:j?.6:g?.7:1,zIndex:j||H?100:T?10:20,touchAction:`none`,pointerEvents:S||j||H?`none`:`auto`,position:S?`relative`:`absolute`,backgroundColor:`color-mix(in srgb, ${K} 12%, transparent)`,color:`color-mix(in srgb, ${K} 90%, black)`,borderLeftWidth:`4px`,borderColor:K,...w?q:{},...I&&s===`vertical`&&F?{height:`${Math.max((parseInt(n?.height)||0)+F.y,24)}px`}:{},...V&&s===`vertical`&&B?{top:`${(parseInt(n?.top)||0)+B.y}px`,height:`${Math.max((parseInt(n?.height)||0)-B.y,24)}px`}:{},...I&&s===`horizontal`&&F?{width:`${Math.max((parseInt(n?.width)||0)+F.x,24)}px`}:{},...V&&s===`horizontal`&&B?{left:`${(parseInt(n?.left)||0)+B.x}px`,width:`${Math.max((parseInt(n?.width)||0)-B.x,24)}px`}:{}},...D,...O,className:e._(`absolute rounded-md text-xs border overflow-hidden group select-none flex flex-col`,`bg-primary/10 border-primary/20 text-foreground shadow-sm hover:shadow-md transition-shadow`,S&&`shadow-xl ring-2 ring-primary/40 cursor-grabbing scale-[1.01]`,j&&`opacity-50 z-50 shadow-xl scale-105 cursor-grabbing ring-2 ring-primary ring-offset-2`,v&&`ring-2 ring-primary ring-offset-1 bg-primary/20 shadow-md transition-all duration-300`,w&&`bg-muted/50 border-muted opacity-80`,!w&&`pointer-events-auto`,w&&`pointer-events-auto select-none grayscale`,u),onClick:e=>{!j&&!H&&(e.stopPropagation(),r?.(t))},onDoubleClick:e=>{e.stopPropagation(),i?.(t)},role:`button`,"aria-label":`Event: ${t.title}`,children:[(0,f.jsxs)(`div`,{className:`flex-1 min-h-0 relative px-2 py-1`,children:[(0,f.jsxs)(`div`,{className:`flex items-start justify-between gap-1`,children:[(0,f.jsx)(`div`,{className:`font-semibold truncate pr-4 leading-tight`,children:t.title}),!w&&(0,f.jsx)(`button`,{className:`opacity-0 group-hover:opacity-100 transition-opacity p-0.5 hover:bg-destructive/10 rounded absolute top-0 right-0 z-10`,onClick:e=>{e.stopPropagation(),o?.(t.id)},onPointerDown:e=>e.stopPropagation(),children:(0,f.jsx)(d.X,{className:`h-3 w-3 text-muted-foreground hover:text-destructive`})})]}),p&&!w&&(0,f.jsxs)(`div`,{className:`text-[10px] text-muted-foreground truncate leading-tight`,children:[(0,_.format)(W,`h:mm a`),` - `,(0,_.format)(G,`h:mm a`)]}),t.description&&(0,f.jsx)(`div`,{className:`text-[10px] text-muted-foreground line-clamp-2 leading-tight mt-0.5`,children:t.description}),w&&(0,f.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,f.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground opacity-70 -rotate-45 select-none`,children:`BLOCKED`})})]}),l&&!w&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{ref:P,...M,...N,className:e._(`absolute z-20 hover:bg-primary/20 transition-colors flex items-center justify-center opacity-0 group-hover:opacity-100`,s===`vertical`?`bottom-0 left-0 right-0 h-3 cursor-ns-resize`:`right-0 top-0 bottom-0 w-3 cursor-ew-resize`),style:{touchAction:`none`},children:(0,f.jsx)(`div`,{className:e._(`bg-primary/40 rounded-full`,s===`vertical`?`w-10 h-1`:`h-10 w-1`)})}),(0,f.jsx)(`div`,{ref:z,...L,...R,className:e._(`absolute z-20 hover:bg-primary/20 transition-colors flex items-center justify-center opacity-0 group-hover:opacity-100`,s===`vertical`?`top-0 left-0 right-0 h-3 cursor-ns-resize`:`left-0 top-0 bottom-0 w-3 cursor-ew-resize`),style:{touchAction:`none`},children:(0,f.jsx)(`div`,{className:e._(`bg-primary/40 rounded-full`,s===`vertical`?`w-10 h-1 shadow-[0_-1px_0_rgba(0,0,0,0.1)]`:`h-10 w-1 shadow-[-1px_0_0_rgba(0,0,0,0.1)]`)})})]})]});return(0,f.jsx)(c.t,{content:t.description,enabled:!!t.description&&!j,children:(0,f.jsx)(a.t,{contextId:`scheduler-event`,data:t,children:J})})},W=({date:t,resourceId:n,children:r,className:i,style:a,onClick:o,onDoubleClick:s,onMouseDown:c,onMouseEnter:l,onContextMenu:u,data:d,isSelected:p,isWorkHour:h})=>{let{active:g}=(0,m.useDndContext)(),{setNodeRef:_,isOver:v}=(0,m.useDroppable)({id:`slot-${t.toISOString()}-${n||`none`}`,data:{date:t,resourceId:n,...d||{}}});return(0,f.jsx)(`div`,{ref:_,"data-testid":`scheduler-slot`,"data-shaded":h===!1,className:e._(`relative transition-all duration-200`,p&&`bg-primary/15`,!p&&h===!1&&`bg-background`,!!g&&`before:absolute before:inset-0 before:border before:border-dashed before:border-primary/10 before:pointer-events-none before:z-0`,v&&`bg-primary/20 ring-2 ring-primary ring-inset z-10 before:opacity-0`,i),style:a,onClick:o,onDoubleClick:s,onMouseDown:c,onMouseEnter:l,onContextMenu:u,children:r})};function G(e,t=!0){return t?b.default.sanitize(e,{ALLOWED_TAGS:`b.i.em.strong.u.span.div.p.br.h1.h2.h3.h4.h5.h6.ul.ol.li.a.img.table.thead.tbody.tr.th.td`.split(`.`),ALLOWED_ATTR:[`class`,`href`,`src`,`alt`,`title`],ALLOW_DATA_ATTR:!1}):e}function K(e,t,n=!0){if(!e)return null;if(typeof e==`function`){let n=e(t);return typeof n==`string`?{__html:G(n,!0)}:n}return typeof e==`string`?{__html:G(e,!0)}:null}function q(e,t=`FirstDay`){switch(t){case`FirstDay`:return(0,_.getWeek)(e,{weekStartsOn:0});case`FirstFourDayWeek`:return(0,_.getISOWeek)(e);case`FirstFullWeek`:return(0,_.getWeek)(e,{weekStartsOn:0,firstWeekContainsDate:1});default:return(0,_.getWeek)(e)}}var J=(e,t,n,r,i,a,o,s,c,l=!0,u=!1)=>{let d=0,f=0;if(l){let e=i/r,s=e/o;d=t*i+n*e+a*s,f=s*.98}else{let e=i/r,s=e/o;d=n*i+t*e+a*s,f=s*.98}let p=((e.start.getHours()-s)*60+e.start.getMinutes())/c*64,m=(e.end.getTime()-e.start.getTime())/(1e3*60)/c*64;return{top:`${p}px`,height:`${Math.max(m,24)}px`,[u?`right`:`left`]:`${d}%`,width:`${f}%`,[u?`borderRightWidth`:`borderLeftWidth`]:`4px`,borderColor:e.color||`hsl(var(--primary))`}},ee=({startHour:t,slotDuration:n,isRtl:r})=>{let i=S(),a=((i.getHours()-t)*60+i.getMinutes())/n*64;return a<0?null:(0,f.jsxs)(`div`,{className:e._(`absolute inset-x-0 z-50 pointer-events-none flex items-center`),style:{top:`${a}px`},children:[(0,f.jsx)(`div`,{className:`w-full border-t-2 border-primary`}),(0,f.jsx)(`div`,{className:e._(`absolute w-3 h-3 bg-primary rounded-full shadow-sm ring-2 ring-background`,r?`-right-1.5`:`-left-1.5`)})]})},Y=({daysInView:t,visibleEvents:r,rowVirtualizer:i,resources:a=[],showResourcesInDayView:o=!1,onEventClick:s,onEventDoubleClick:c,onEventDelete:l,scrollRef:p,onViewChange:m,onDateChange:h,locale:g,onRangeSelect:v,onSlotClick:y,onSlotDoubleClick:b,dateHeaderTemplate:C,showWeekNumber:w=!1,weekRule:T=`FirstDay`,cellTemplate:E,showUnassignedLane:D=!1,startHour:O=`00:00`,slotDuration:k=30,is24Hour:A=!0,setIs24Hour:j,group:M,onCellContextMenu:N,dir:P})=>{let F=P===`rtl`,I=S(),L=parseInt(O.split(`:`)[0],10),[R,z]=(0,u.useState)(null),[B,V]=(0,u.useState)(!1),H=(0,u.useRef)(null),G=(e,t,n)=>r.some(t=>(t.isHoliday||t.isFullyBooked)&&(0,_.isSameDay)(t.start,e))?!0:r.some(r=>r.isBlock&&(r.resourceId===n||!r.resourceId&&!n)&&(0,_.areIntervalsOverlapping)({start:r.start,end:r.end},{start:e,end:t})),Y=(e,t)=>{let n=(0,_.addMinutes)(e,k);if(G(e,n,t))return;V(!0);let r={start:e,end:n,resourceId:t};z(r),H.current=r},X=e=>{if(!B||!H.current)return;let t=new Date(e.getTime()+k*60*1e3),n={...H.current,end:t};z(n),H.current=n};(0,u.useEffect)(()=>{let e=e=>{if(B&&H.current){let{start:t,end:n,resourceId:r}=H.current,i=t<n?t:n,a=t<n?n:t;G(i,a,r)||(v?.(i,a,r,{x:e.clientX,y:e.clientY}),y?.(i,r))}V(!1),z(null),H.current=null};return window.addEventListener(`mouseup`,e),()=>window.removeEventListener(`mouseup`,e)},[B,v,y]);let te=x(`(max-width: 768px)`),Z=(0,u.useMemo)(()=>{let e=o&&a.length>0?[...a]:[];return(D||o&&e.length===0)&&(e.find(e=>e.id===``||e.id===`unassigned`)||e.unshift({id:`unassigned`,name:`Unassigned`,type:`Global Inbox`,color:`hsl(var(--muted-foreground))`})),e.length>0?e:[{id:``,name:``}]},[a,o,D]),ne=te&&o&&Z.length>1,re=!te&&(Z.length>3||t.length>3&&Z.length>1),Q=ne||re,ie=t.length*Z.length*150,ae={width:Q&&ie>0?`${ie}px`:`100%`,minWidth:`100%`},oe=new Intl.DateTimeFormat(g,{day:`numeric`}),$=M?.byDate??!0,se=$?t:Z,ce=$?Z:t,le=se,ue=ce,de=100/le.length,fe=100/ue.length;return(0,f.jsxs)(`div`,{ref:p,"data-testid":`scheduler-scroll-container`,"data-view":`day-week`,style:{scrollbarGutter:`stable`},className:e._(`flex-1 flex flex-col min-h-0 relative overflow-auto bg-background select-none border border-border rounded-lg`,Q&&`snap-x snap-mandatory`),children:[(0,f.jsxs)(`div`,{className:`sticky top-0 z-50 bg-background/95 backdrop-blur-md border-b border-border flex shrink-0`,style:ae,children:[w&&(0,f.jsx)(`div`,{className:e._(`w-12 shrink-0 sticky z-50 bg-background border-e border-border flex items-center justify-center`,F?`right-0`:`left-0`),children:(0,f.jsx)(`span`,{className:`text-[9px] font-bold text-muted-foreground uppercase tracking-wider`,children:`WK`})}),(0,f.jsxs)(`div`,{className:e._(`w-24 shrink-0 sticky bg-background border-e border-border z-50 cursor-pointer hover:bg-muted/50 transition-colors flex flex-col items-center justify-center gap-1 group`,w?F?`right-12`:`left-12`:F?`right-0`:`left-0`),onClick:()=>j?.(!A),title:`Toggle 24h / AM-PM format`,children:[(0,f.jsx)(d.Clock,{className:`w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors`}),(0,f.jsx)(`span`,{className:`text-[9px] font-bold uppercase text-muted-foreground/60 group-hover:text-primary/70`,children:A?`24 Hours`:`AM / PM`})]}),(0,f.jsx)(`div`,{className:`flex flex-1`,style:Q?{width:`100%`}:void 0,children:le.map(i=>{let a=$,o=a?i:null,s=a?null:i,c=a&&(0,_.isSameDay)(o,new Date);return(0,f.jsxs)(`div`,{style:{width:`${de}%`},className:`flex flex-col border-e border-border last:border-e-0`,children:[(0,f.jsx)(`div`,{className:e._(`flex flex-col items-center justify-center py-3 transition-colors shrink-0 border-e-2 border-foreground/20`,c&&`bg-background`),children:a?(()=>{let n=r.find(e=>(e.isHoliday||e.isFullyBooked)&&(0,_.isSameDay)(e.start,o));return(0,f.jsxs)(`div`,{className:`flex flex-col items-center relative w-full`,children:[n?.isHoliday&&(0,f.jsx)(`span`,{className:`absolute -top-1 px-1.5 py-0.5 bg-destructive/10 text-destructive text-[9px] font-black uppercase tracking-tighter rounded-full border border-destructive/20 mb-1 leading-none shadow-sm`,children:`Holiday`}),n?.isFullyBooked&&(0,f.jsx)(`span`,{className:`absolute -top-1 px-1.5 py-0.5 bg-warning/10 text-warning-foreground text-[9px] font-black uppercase tracking-tighter rounded-full border border-warning/20 mb-1 leading-none shadow-sm`,children:`Fully Booked`}),C?(0,f.jsx)(`div`,{className:`h-full w-full flex items-center justify-center pt-2`,children:typeof C==`function`?C({date:o,type:`Day`,text:oe.format(o)}):C}):(0,f.jsx)(`div`,{className:`flex flex-col items-center cursor-pointer hover:bg-muted/50 transition-colors pt-2`,onClick:()=>{m&&h&&(h(o),m(`day`))},children:t.length>1&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{className:e._(`text-base font-medium mt-0.5`,c?`text-primary font-bold`:`text-foreground`),children:(0,_.format)(o,`dd MMM yyyy`)}),(0,f.jsx)(`span`,{className:e._(`text-sm font-medium uppercase tracking-wider`,c?`text-primary`:`text-muted-foreground/80`),children:(0,_.format)(o,`EEE`)})]})})]})})():(0,f.jsxs)(`div`,{className:`flex items-center gap-2 px-2`,children:[(0,f.jsxs)(n.t,{className:`h-8 w-8 shadow-sm border border-background`,children:[s.avatar&&(0,f.jsx)(n.r,{src:s.avatar}),(0,f.jsx)(n.n,{className:`text-xs font-bold`,children:s.name?.charAt(0)})]}),(0,f.jsxs)(`div`,{className:`flex flex-col`,children:[(0,f.jsx)(`span`,{className:`text-sm font-bold truncate`,children:s.name}),(0,f.jsx)(`span`,{className:`text-[10px] text-muted-foreground truncate`,children:s.type||`Resource`})]})]})}),ue.length>0&&(0,f.jsx)(`div`,{className:`flex w-full border-t border-border bg-background h-10 shrink-0`,children:ue.map((t,i)=>{let o=a?null:t,s=a?t:null,c=o?r.find(e=>e.isHoliday&&(0,_.isSameDay)(e.start,o)):null,l=o?r.find(e=>e.isFullyBooked&&(0,_.isSameDay)(e.start,o)):null;return(0,f.jsx)(`div`,{style:{width:`${fe}%`},className:e._(`flex items-center justify-center px-1 border-e border-border/30 last:border-e-0 group`,Q&&`snap-center`,(i%2,`bg-background`)),children:a?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(n.t,{className:`h-4 w-4 me-1 shadow-sm border border-background`,children:[s.avatar&&(0,f.jsx)(n.r,{src:s.avatar}),(0,f.jsx)(n.n,{className:`text-[7px] font-bold`,children:s.name?.charAt(0)})]}),(0,f.jsx)(`span`,{className:`text-[9px] font-bold text-muted-foreground truncate group-hover:text-foreground transition-colors`,children:s.name})]}):(0,f.jsxs)(`div`,{className:`flex flex-col items-center justify-center`,children:[c&&(0,f.jsx)(`span`,{className:`text-xs font-black uppercase tracking-wider text-destructive bg-destructive/10 px-2 py-0.5 rounded-sm mb-0.5`,children:`Holiday`}),l&&(0,f.jsx)(`span`,{className:`text-xs font-black uppercase tracking-wider text-warning-foreground bg-warning/10 px-2 py-0.5 rounded-sm mb-0.5`,children:`Fully Booked`}),(0,f.jsx)(`span`,{className:e._(`text-[10px] font-bold text-muted-foreground uppercase`,c&&`text-destructive`,l&&`text-amber-600`),children:(0,_.format)(o,`EEE d`)})]})},o?o.toISOString():s.id)})})]},a?o.toISOString():s.id)})})]}),(0,f.jsxs)(`div`,{"data-testid":`scheduler-virtual-body`,className:`relative shrink-0`,style:{height:`${i.getTotalSize()}px`,...ae},children:[i.getVirtualItems().map(n=>{let i=n.index*k,a=L+Math.floor(i/60),o=i%60,s=``;if(A)s=`${a<10?`0`+a:a}:${o<10?`0`+o:o}`;else{let e=a>=12?`PM`:`AM`,t=a%12||12;s=`${t<10?`0`+t:t}:${o<10?`0`+o:o} ${e}`}return(0,f.jsxs)(`div`,{className:`absolute left-0 w-full flex`,style:{height:`64px`,top:`${n.start}px`},children:[(0,f.jsxs)(`div`,{className:e._(`w-24 shrink-0 flex flex-col items-end justify-center pe-3 border-e border-border bg-background z-50 sticky backdrop-blur-md`,F?`right-0`:`left-0`),children:[s&&(0,f.jsx)(`span`,{className:`text-sm text-foreground font-black bg-background px-1 relative z-50 uppercase tracking-tighter tabular-nums`,children:s}),w&&a===0&&(0,f.jsxs)(`span`,{className:`text-[9px] text-muted-foreground/60 font-semibold mt-1`,children:[`W`,q(t[0],T)]})]}),(0,f.jsxs)(`div`,{className:`flex flex-1 relative`,style:{height:`64px`},children:[(0,f.jsx)(`div`,{className:`absolute bottom-0 left-0 w-full border-b border-border/40`}),(0,f.jsx)(`div`,{className:`absolute top-1/2 left-0 w-full border-b border-dashed border-border/20 h-px`}),le.map(t=>(0,f.jsx)(`div`,{style:{width:`${de}%`},className:`h-full flex relative border-e-2 border-foreground/20 last:border-e-0`,children:ue.map((i,s)=>{let c=$?t:i,l=$?i:t,u=n.index+L,d=c.getDay(),p=r.find(e=>e.isHoliday&&(0,_.isSameDay)(e.start,c)),m=r.find(e=>e.isFullyBooked&&(0,_.isSameDay)(e.start,c)),h=!0;h=l.workingHours?l.workingHours.days.includes(d)&&u>=l.workingHours.start&&u<l.workingHours.end:d!==0&&d!==6&&u>=9&&u<17;let g=new Date(new Date(c).setHours(a,o,0,0)),v=(0,_.isSameDay)(c,new Date),y=!!R&&R.resourceId===l.id&&g>=R.start&&g<R.end;return(0,f.jsx)(W,{date:g,resourceId:l.id,isWorkHour:h,isSelected:y,data:{kind:`time-slot`,date:g,resourceId:l.id,orientation:`vertical`,slotDuration:k},onMouseDown:()=>Y(g,l.id),onMouseEnter:()=>X(g),onDoubleClick:()=>{let e=(0,_.addMinutes)(g,k);G(g,e,l.id)||b?.(g,l.id)},onContextMenu:e=>{e.preventDefault(),N?.({date:g,x:e.clientX,y:e.clientY})},style:{width:`${fe}%`,minWidth:`auto`,height:`100%`},className:e._(`border-e border-border/30 relative cursor-pointer hover:bg-primary/5 transition-colors pointer-events-auto`,s===ue.length-1&&`border-e-0`,Q&&`snap-center`,p&&`bg-[repeating-linear-gradient(-45deg,hsl(var(--destructive)/0.05)_0px,hsl(var(--destructive)/0.05)_10px,transparent_10px,transparent_20px)] bg-destructive/[0.02]`,m&&`bg-[repeating-linear-gradient(-45deg,theme(colors.warning/0.05)_0px,theme(colors.warning/0.05)_10px,transparent_10px,transparent_20px)] bg-warning/[0.02]`,!p&&!m&&`bg-background`),children:E?(()=>{let e=K(E,{date:g,resourceId:l.id,isWorkHour:h,isToday:v});return e&&typeof e==`object`&&`__html`in e?(0,f.jsx)(`div`,{className:`w-full h-full`,dangerouslySetInnerHTML:e}):(0,f.jsx)(`div`,{className:`w-full h-full`,children:e})})():null},$?l.id||s:c.toISOString()||s)})},$?t.toISOString():t.id))]})]},n.index)}),(0,f.jsxs)(`div`,{className:`absolute top-0 h-full z-10`,style:{width:`calc(100% - 6rem)`,[F?`right`:`left`]:`6rem`,pointerEvents:`none`},children:[(0,f.jsx)(ee,{startHour:L,slotDuration:k,isRtl:F}),t.map((e,n)=>{let i=r.filter(t=>(0,_.isSameDay)(e,t.start));i.sort((e,t)=>e.start.getTime()-t.start.getTime());let a=new Map;return i.forEach(e=>{let t=e.resourceId;!t&&D&&(t=`unassigned`);let n=Z.findIndex(e=>e.id===t);if(n===-1)if(Z.length===1&&(Z[0].id===``||!o))n=0;else return;a.has(n)||a.set(n,[]),a.get(n).push(e)}),[...a.entries()].map(([e,r])=>{let i=[];return r.forEach(e=>{let t=!1;for(let n of i)if(n.some(t=>(0,_.areIntervalsOverlapping)({start:t.start,end:t.end},{start:e.start,end:e.end}))){n.push(e),t=!0;break}t||i.push([e])}),i.map(r=>{let i=[];return r.forEach(e=>{let t=!1;for(let n=0;n<i.length;n++)if(!i[n].some(t=>(0,_.areIntervalsOverlapping)({start:t.start,end:t.end},{start:e.start,end:e.end}))){i[n].push(e),t=!0;break}t||i.push([e])}),r.map(r=>{let a=i.findIndex(e=>e.includes(r));return(0,f.jsx)(U,{event:r,style:J(r,n,e,$?Z.length:t.length,de,a,i.length,L,k,$,F),onClick:s,onDoubleClick:c,onDelete:l,orientation:`vertical`,resizable:!0,isBlocked:r.isBlock,isPast:r.end<I,slotDuration:k,pixelsPerSlot:64},r.id)})})})})]})]})]})},X=({currentDate:t,daysInView:n,visibleEvents:r,onSlotClick:i,onSlotDoubleClick:a,onEventClick:o,moreEventsClick:c,dir:l})=>{let u=l===`rtl`,d=e=>r.filter(t=>(0,_.isSameDay)(t.start,e));return(0,f.jsx)(s.r,{children:(0,f.jsxs)(`div`,{className:`flex flex-col h-full w-full bg-background rounded-xl border border-border overflow-hidden shadow-sm`,children:[(0,f.jsx)(`div`,{className:`grid grid-cols-7 border-b border-border bg-muted/30`,children:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`].map((e,t)=>(0,f.jsx)(`div`,{className:`py-3 text-center text-xs font-semibold uppercase text-muted-foreground tracking-widest`,children:e},t))}),(0,f.jsx)(`div`,{className:`grid grid-cols-7 grid-rows-6 flex-1 min-h-0 bg-muted/20 gap-px`,children:n.map(n=>{let r=d(n).filter(e=>!e.isBlock),l=(0,_.isSameMonth)(n,t),p=(0,_.isSameDay)(n,new Date),m=r.slice(0,4),h=r.length-4,g=r.length;return(0,f.jsxs)(`div`,{onClick:()=>i?.(n),onDoubleClick:()=>a?.(n),className:e._(`relative flex flex-col p-2 transition-colors group bg-background focus-visible:z-10`,!l&&`bg-muted/5 text-muted-foreground/50`,l&&`hover:bg-muted/30`,`min-h-[100px]`),children:[(0,f.jsxs)(`div`,{className:e._(`flex items-center justify-between mb-1`),children:[(0,f.jsx)(`span`,{className:e._(`text-sm font-medium w-7 h-7 flex items-center justify-center rounded-full transition-all`,p?`bg-primary text-primary-foreground shadow-sm font-bold scale-110`:`text-foreground group-hover:bg-muted/50`,!l&&`text-muted-foreground opacity-50`),children:(0,_.format)(n,`d`)}),g>0&&(0,f.jsx)(`span`,{className:`text-[10px] text-muted-foreground font-medium px-1.5 py-0.5 rounded-full bg-muted/50`,children:g})]}),(0,f.jsxs)(`div`,{className:`flex-1 flex flex-col gap-1.5 min-w-0`,children:[m.map(t=>(0,f.jsxs)(s.t,{delayDuration:300,children:[(0,f.jsx)(s.i,{asChild:!0,children:(0,f.jsxs)(`div`,{onClick:e=>{e.stopPropagation(),o?.(t)},className:e._(`group/event relative`,`flex items-center gap-2 px-2 py-1 rounded-md text-xs font-medium cursor-pointer transition-all shadow-sm hover:shadow-md border border-transparent hover:border-border/50 overflow-hidden bg-card hover:bg-accent/50`,!l&&`opacity-60 grayscale`),style:{[u?`borderRight`:`borderLeft`]:`3px solid ${t.color||`oklch(var(--primary))`}`},children:[(0,f.jsx)(`div`,{className:`flex-1 truncate leading-tight`,children:t.title}),t.start&&(0,f.jsx)(`span`,{className:`text-[10px] text-muted-foreground/70 tabular-nums shrink-0`,children:(0,_.format)(t.start,`h:mm a`)})]})}),(0,f.jsx)(s.n,{className:`p-3 max-w-xs bg-popover/95 backdrop-blur-sm border-border/50 shadow-xl`,sideOffset:5,children:(0,f.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/50 pb-1.5`,children:[(0,f.jsx)(`div`,{className:`w-2 h-2 rounded-full shrink-0`,style:{backgroundColor:t.color||`oklch(var(--primary))`}}),(0,f.jsx)(`span`,{className:`font-semibold text-sm truncate`,children:t.title})]}),(0,f.jsxs)(`div`,{className:`text-xs text-muted-foreground space-y-0.5`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,f.jsx)(`span`,{className:`font-medium text-foreground/80`,children:`Time:`}),(0,f.jsxs)(`span`,{children:[(0,_.format)(t.start,`MMM d, h:mm a`),` - `,(0,_.format)(t.end,`h:mm a`)]})]}),t.location&&(0,f.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,f.jsx)(`span`,{className:`font-medium text-foreground/80`,children:`Location:`}),(0,f.jsx)(`span`,{children:t.location})]}),t.description&&(0,f.jsx)(`div`,{className:`pt-1 mt-1 border-t border-border/30 text-muted-foreground/80 line-clamp-3`,children:t.description})]})]})})]},t.id)),h>0&&(0,f.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),c?.({date:n})},className:`mt-auto self-start text-[10px] bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground font-medium px-2 py-1 rounded-md transition-colors w-full text-left`,children:[`+`,h,` more`]})]})]},n.toISOString())})})]})})},te=({view:t,daysInView:r,visibleEvents:i,resources:a=[],onSlotClick:o,onSlotDoubleClick:s,onEventClick:c,onEventDelete:l,onRangeSelect:d,currentTimeIndicator:p,showResourceHeaders:m=!0,group:h,showUnassignedLane:g=!1,startHour:v=`00:00`,endHour:y=`24:00`,slotDuration:b=60,is24Hour:x=!1,scrollRef:C,dir:w})=>{let T=w===`rtl`,E=S(),D=v?parseInt(v.split(`:`)[0],10):0,O=y?parseInt(y.split(`:`)[0],10):24,k=O-D,[A,j]=(0,u.useState)(null),[M,N]=(0,u.useState)(!1),P=(0,u.useRef)(null),F=(0,u.useRef)(null),I=t===`timeline-month`,L=I?1440:b,R=60/L,z=I?1:k*R,B=r.length*z,V=I?120:80,H=B*V,U=(0,u.useMemo)(()=>{let e=a.length>0?[...a]:[];return(g||e.length===0)&&(e.find(e=>e.id===`unassigned`)||e.unshift({id:`unassigned`,name:`Unassigned`,type:`Global Inbox`,color:`hsl(var(--muted-foreground))`})),e},[a,g]),W=(0,u.useMemo)(()=>{if(!h||!h.resources||h.resources.length===0)return{isGrouped:!1,groups:[{name:`All`,resources:U}]};let e=h.resources[0],t=new Map;U.forEach(n=>{let r=n[e]||`Unassigned`;t.has(r)||t.set(r,[]),t.get(r)?.push(n)});let n=[];return t.forEach((e,t)=>{n.push({name:t,resources:e})}),{isGrouped:!0,groups:n}},[U,h]),G=(0,u.useMemo)(()=>W.groups.flatMap(e=>e.resources),[W]),K=e=>{if(I)return(0,_.startOfDay)(r[e]);let t=Math.floor(e/z),n=e%z;return(0,_.addMinutes)((0,_.startOfDay)(r[t]),D*60+n*L)},q=e=>{if(I){let t=r.findIndex(t=>(0,_.isSameDay)(t,(0,_.startOfDay)(e)));return t===-1?-1:t*V}let t=(0,_.startOfDay)(e),n=r.findIndex(e=>(0,_.isSameDay)(e,t));if(n===-1)return-1;let i=(0,_.differenceInMinutes)(e,t)-D*60;return(n*k*60+i)/L*V},J=(()=>{if(I){let e=(0,_.startOfDay)(r[0]),t=(0,_.startOfDay)(r[r.length-1]);return E<e||E>t?null:q(E)}let e=q(E),t=E.getHours();return e===-1||t<D||t>=O?null:e})(),ee=(0,u.useRef)(!1);(0,u.useEffect)(()=>{C?.current&&J!==null&&!ee.current&&setTimeout(()=>{C.current&&(T?C.current.scrollLeft=-J:C.current.scrollLeft=J,ee.current=!0)},50)},[C,J,t]);let Y=(e,t)=>{let n=K(e);if(i.some(e=>(e.isHoliday||e.isFullyBooked)&&(0,_.isSameDay)(e.start,n)))return;N(!0);let r={startSlot:e,endSlot:e,resourceId:t};j(r),P.current=r},X=e=>{if(!M||!P.current)return;let t={...P.current,endSlot:e};j(t),P.current=t};(0,u.useEffect)(()=>{let e=e=>{if(M&&P.current){let{startSlot:t,endSlot:n,resourceId:r}=P.current,a=Math.min(t,n),s=Math.max(t,n),c=K(a),l=K(s+1);i.some(e=>(e.isHoliday||e.isFullyBooked)&&(0,_.isSameDay)(e.start,c))||(d?.(c,l,r,{x:e.clientX,y:e.clientY}),o?.(c,r))}N(!1),j(null),P.current=null};return window.addEventListener(`mouseup`,e),()=>window.removeEventListener(`mouseup`,e)},[M,d,o,r]);let te=(e,t)=>{if(!A||A.resourceId!==t)return!1;let n=Math.min(A.startSlot,A.endSlot),r=Math.max(A.startSlot,A.endSlot);return e>=n&&e<=r},{resourceMap:ne,maxLevels:re}=(0,u.useMemo)(()=>{let e=new Map,t=new Map;return G.forEach(n=>{e.set(n.id,[]),t.set(n.id,1)}),i.forEach(t=>{let n=t.resourceId||`unassigned`,r=String(n);e.has(r)?e.get(r)?.push(t):e.has(`unassigned`)&&!n&&e.get(`unassigned`)?.push(t)}),e.forEach((n,r)=>{let i=[...n].sort((e,t)=>e.start.getTime()-t.start.getTime()),a=[],o=i.map(e=>{let t=0;for(;a[t]!==void 0&&a[t]>e.start.getTime()+3e5;)t++;return a[t]=e.end.getTime(),{...e,level:t}});e.set(r,o),t.set(r,a.length||1)}),{resourceMap:e,maxLevels:t}},[i,G]),Q=e=>{let t=q(e.start),n=q(e.end);if(t===-1&&n===-1)return{display:`none`};let r=Math.max(0,t),i=Math.max(0,(n===-1?H:Math.min(H,n))-r);if(i<=4)return{display:`none`};let a=20+e.level*46,o=e.color||`hsl(var(--primary))`;return{[T?`right`:`left`]:`${r}px`,width:`${Math.max(i,4)}px`,top:`${a}px`,height:`36px`,background:`linear-gradient(135deg, color-mix(in srgb, ${o} 20%, transparent), color-mix(in srgb, ${o} 10%, transparent))`,backdropFilter:`blur(4px)`,[T?`borderRight`:`borderLeft`]:`4px solid ${o}`,borderTop:`1px solid color-mix(in srgb, ${o} 30%, transparent)`,[T?`borderLeft`:`borderRight`]:`1px solid color-mix(in srgb, ${o} 30%, transparent)`,borderBottom:`1px solid color-mix(in srgb, ${o} 30%, transparent)`,color:`hsl(var(--foreground))`,borderRadius:`6px`,boxShadow:`0 2px 8px -2px rgba(0,0,0,0.1)`,display:`flex`,alignItems:`center`,fontSize:`12px`,fontWeight:`600`,paddingInlineStart:`12px`,paddingInlineEnd:`8px`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,transition:`all 0.2s cubic-bezier(0.4, 0, 0.2, 1)`,zIndex:20+e.level,cursor:`pointer`}},ie=m?W.isGrouped?280:240:0;return(0,f.jsxs)(`div`,{className:`flex flex-col h-full w-full overflow-hidden border border-border/40 rounded-xl bg-background shadow-sm`,children:[(0,f.jsxs)(`div`,{className:`flex bg-background z-40 sticky top-0 border-b border-border/40 shadow-[0_1px_2px_rgba(0,0,0,0.03)] items-center`,children:[m&&W.isGrouped&&(0,f.jsx)(`div`,{className:e._(`w-[40px] shrink-0 border-e border-border/40 p-1 flex items-center justify-center bg-background select-none sticky z-50`,T?`right-0`:`left-0`),children:(0,f.jsx)(`div`,{className:`writing-mode-vertical rotate-180 font-bold text-[10px] uppercase tracking-widest text-muted-foreground/70`,children:`Group`})}),m&&(0,f.jsx)(`div`,{className:e._(`w-[240px] shrink-0 border-e border-border/40 px-6 py-4 font-bold text-[11px] uppercase tracking-widest flex items-center bg-background text-muted-foreground select-none sticky z-50`,W.isGrouped?T?`right-[40px]`:`left-[40px]`:T?`right-0`:`left-0`),children:`RESOURCES`}),(0,f.jsx)(`div`,{ref:F,className:`overflow-hidden flex-1 relative`,children:(0,f.jsx)(`div`,{className:`flex`,style:{width:H},children:r.map(t=>{let n=r.length===1,i=t.getDay()===0||t.getDay()===6;return I?(0,f.jsxs)(`div`,{className:e._(`flex shrink-0 border-e border-border/30 h-14 flex-col justify-center items-center transition-colors select-none`,i?`bg-muted/10`:`bg-transparent hover:bg-muted/5`),style:{width:V},children:[(0,f.jsx)(`span`,{className:e._(`text-[10px] font-bold uppercase mb-0.5 tracking-wider`,i?`text-muted-foreground`:`text-primary`),children:(0,_.format)(t,`EEE`)}),(0,f.jsx)(`span`,{className:e._(`text-xs font-semibold`,i?`text-muted-foreground/70`:`text-foreground/80`),children:(0,_.format)(t,`d`)})]},t.toISOString()):(0,f.jsx)(`div`,{className:`flex shrink-0 border-e border-border/40`,style:{width:H/r.length},children:Array.from({length:z}).map((r,i)=>{let a=i*L,o=D+Math.floor(a/60),s=a%60,c=new Date(new Date().setHours(o,s,0,0)),l=``;return l=x?(0,_.format)(c,`HH:mm`):L<60||s!==0?(0,_.format)(c,`h:mm a`):(0,_.format)(c,`ha`),(0,f.jsxs)(`div`,{className:`flex flex-col justify-end pb-2 border-e border-border/10 last:border-e-0 relative h-14`,style:{width:V},children:[!n&&i===0&&(0,f.jsx)(`div`,{className:e._(`absolute top-2 px-2 py-0.5 rounded text-[10px] font-bold text-foreground/80 bg-muted/50 border border-border/20 whitespace-nowrap`,T?`right-2`:`left-2`),children:(0,_.format)(t,`EEE, MMM d`)}),(0,f.jsx)(`span`,{className:`text-[11px] font-black text-foreground text-center px-1 select-none tabular-nums truncate`,children:l})]},i)})},t.toISOString())})})})]}),(0,f.jsx)(`div`,{ref:C,"data-testid":`scheduler-scroll-container`,className:`flex-1 overflow-auto relative custom-scrollbar bg-background`,onScroll:e=>{F.current&&(F.current.scrollLeft=e.currentTarget.scrollLeft)},children:(0,f.jsxs)(`div`,{className:`relative min-w-max`,style:{width:H+ie,minHeight:`100%`},children:[J!==null&&p!==!1&&(0,f.jsxs)(`div`,{className:`current-time-indicator z-50 pointer-events-none`,style:{[T?`right`:`left`]:`${J+ie}px`,height:`100%`},children:[(0,f.jsx)(`div`,{className:`absolute top-0 -translate-x-1/2 w-[2px] h-full bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.6)]`}),(0,f.jsx)(`div`,{className:`absolute top-0 -translate-x-1/2 -mt-1 w-2.5 h-2.5 rounded-full bg-red-500 shadow-md border-2 border-background`})]}),W.groups.map(t=>(0,f.jsxs)(`div`,{className:`flex border-b border-border/30 relative`,children:[m&&W.isGrouped&&(0,f.jsxs)(`div`,{className:e._(`w-[40px] shrink-0 sticky z-30 bg-background border-e border-border/40 flex items-center justify-center p-1`,T?`right-0`:`left-0`),style:{height:`auto`},children:[(0,f.jsx)(`div`,{className:`absolute inset-0 bg-background/80`}),(0,f.jsx)(`div`,{className:`relative writing-mode-vertical transform rotate-180 text-[10px] font-bold uppercase tracking-wide text-foreground/70 whitespace-nowrap py-2 overflow-hidden text-ellipsis max-h-full`,children:t.name})]}),(0,f.jsx)(`div`,{className:`flex flex-col w-full`,children:t.resources.map((t,a)=>{let o=(re.get(t.id)||1)*46+40;return(0,f.jsxs)(`div`,{className:e._(`flex border-b border-border/30 last:border-b-0 group/row hover:bg-muted/5 transition-colors`,(a%2,`bg-background`)),style:{height:`${o}px`},children:[(0,f.jsx)(`div`,{className:e._(`w-[240px] shrink-0 sticky z-30 bg-background/95 backdrop-blur border-e border-border/40 px-6 py-4 flex items-center gap-4 transition-all shadow-[1px_0_4px_rgba(0,0,0,0.02)]`,W.isGrouped?T?`right-[40px]`:`left-[40px]`:T?`right-0`:`left-0`,!m&&`hidden`),children:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(n.t,{className:`h-9 w-9 border border-border/60 shadow-sm`,children:[t.avatar&&(0,f.jsx)(n.r,{src:t.avatar,alt:t.name,className:`object-cover`}),(0,f.jsx)(n.n,{className:`text-xs font-bold bg-primary/5 text-primary`,children:t.name.charAt(0)})]}),(0,f.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,f.jsx)(`span`,{className:`text-[13px] font-semibold truncate text-foreground/90 tracking-tight leading-none mb-1.5`,children:t.name}),(0,f.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,f.jsx)(`span`,{className:e._(`w-1.5 h-1.5 rounded-full`,t.type===`Internal`?`bg-primary shadow-[0_0_6px_var(--primary)]/50`:`bg-success shadow-[0_0_6px_var(--success)]/50`)}),(0,f.jsx)(`span`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:t.type||`Available`})]})]})]})}),(0,f.jsx)(Z,{resource:t,totalSlots:B,slotWidth:V,totalWidth:H,slotToDate:K,onSlotMouseDown:Y,onSlotMouseEnter:X,onSlotDoubleClick:s,isSlotSelected:te,resourceMap:ne,getEventStyle:Q,onEventClick:c,onEventDelete:l,slotDuration:L,now:E,visibleEvents:i,slotsPerDay:z,daysInView:r,dir:w})]},t.id)})})]},t.name))]})})]})},Z=({resource:t,totalSlots:n,slotWidth:r,totalWidth:i,slotToDate:a,onSlotMouseDown:o,onSlotMouseEnter:s,onSlotDoubleClick:c,isSlotSelected:l,resourceMap:u,getEventStyle:d,onEventClick:p,onEventDelete:h,slotDuration:g,now:v,visibleEvents:y,slotsPerDay:b,daysInView:x,dir:S})=>{let C=S===`rtl`,{setNodeRef:w,isOver:T}=(0,m.useDroppable)({id:`row-${t.id}`,data:{kind:`timeline-row`,resourceId:t.id,slotWidth:r,totalSlots:n,slotDuration:g,isRtl:C}});return(0,f.jsxs)(`div`,{ref:w,className:e._(`relative flex-1 group/interactive`,T&&`bg-primary/5 shadow-inner`),style:{width:i},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),i=e.clientX-t.left,a=Math.floor(C?(t.width-i)/r:i/r);a>=0&&a<n&&s(a)},onMouseDown:e=>{let i=e.currentTarget.getBoundingClientRect(),a=e.clientX-i.left,s=Math.floor(C?(i.width-a)/r:a/r);s>=0&&s<n&&o(s,t.id)},onDoubleClick:e=>{let i=e.currentTarget.getBoundingClientRect(),o=e.clientX-i.left,s=Math.floor(C?(i.width-o)/r:o/r);if(s>=0&&s<n){let e=a(s);y.some(t=>(t.isHoliday||t.isFullyBooked)&&(0,_.isSameDay)(t.start,e))||c?.(e,t.id)}},children:[(0,f.jsx)(`div`,{className:`absolute inset-0 pointer-events-none`,style:{backgroundImage:`repeating-linear-gradient(${C?`to left`:`to right`}, transparent, transparent ${r-1}px, hsl(var(--border) / 0.1) ${r-1}px, hsl(var(--border) / 0.1) ${r}px)`,backgroundSize:`${r}px 100%`}}),(0,f.jsx)(`div`,{className:`absolute inset-0 pointer-events-none flex`,children:x.map((t,n)=>{let i=y.find(e=>e.isHoliday&&(0,_.isSameDay)(e.start,t)),a=y.find(e=>e.isFullyBooked&&(0,_.isSameDay)(e.start,t));return!i&&!a?(0,f.jsx)(`div`,{style:{width:b*r}},n):(0,f.jsx)(`div`,{style:{width:b*r},className:e._(`h-full border-e border-border/10`,i&&`bg-[repeating-linear-gradient(-45deg,hsl(var(--destructive)/0.05)_0px,hsl(var(--destructive)/0.05)_10px,transparent_10px,transparent_20px)] bg-destructive/[0.02]`,a&&`bg-[repeating-linear-gradient(-45deg,theme(colors.amber.500/0.05)_0px,theme(colors.amber.500/0.05)_10px,transparent_10px,transparent_20px)] bg-amber-500/[0.02]`)},n)})}),(0,f.jsx)(ne,{totalSlots:n,resourceId:t.id,slotWidth:r,isSlotSelected:l,isRtl:C}),u.get(t.id)?.map(e=>(0,f.jsx)(U,{event:e,style:d(e),onClick:p,onDelete:h,orientation:`horizontal`,resizable:!0,isBlocked:e.isBlock,isPast:e.end<v,slotDuration:g,pixelsPerSlot:r},e.id))]})},ne=u.default.memo(({totalSlots:e,resourceId:t,slotWidth:n,isSlotSelected:r,isRtl:i})=>{let a=[],o=null;for(let n=0;n<e;n++)r(n,t)?o?o.length++:(o={start:n,length:1},a.push(o)):o=null;return(0,f.jsx)(f.Fragment,{children:a.map((e,t)=>(0,f.jsx)(`div`,{className:`absolute top-0 bottom-0 bg-primary/20 border-x border-primary/30 z-10 pointer-events-none`,style:{[i?`right`:`left`]:`${e.start*n}px`,width:`${e.length*n}px`}},t))})}),re=({daysInView:t,visibleEvents:n,onEventClick:r})=>(0,f.jsx)(`div`,{"data-testid":`scheduler-scroll-container`,className:`flex flex-col h-full w-full bg-background overflow-y-auto border border-border rounded-lg`,children:t.map(t=>{let i=n.filter(e=>(0,_.isSameDay)(e.start,t)).sort((e,t)=>e.start.getTime()-t.start.getTime());return(0,f.jsxs)(`div`,{className:`flex flex-col border-b border-border pb-2 last:border-b-0`,children:[(0,f.jsxs)(`div`,{className:e._(`flex items-center px-4 py-2 sticky top-0 bg-background/95 backdrop-blur z-10 border-b border-border`,(0,_.isSameDay)(t,new Date)&&`text-primary font-semibold`),children:[(0,f.jsxs)(`div`,{className:`flex flex-col items-center mr-4 w-12 shrink-0`,children:[(0,f.jsx)(`span`,{className:`text-[10px] uppercase font-bold text-muted-foreground`,children:(0,_.format)(t,`EEE`)}),(0,f.jsx)(`span`,{className:`text-xl font-bold leading-none`,children:(0,_.format)(t,`d`)})]}),(0,f.jsx)(`div`,{className:`text-sm font-medium text-muted-foreground`,children:(0,_.format)(t,`MMMM yyyy`)})]}),(0,f.jsx)(`div`,{className:`flex flex-col px-2 py-1 gap-2`,children:i.length===0?(0,f.jsx)(`div`,{className:`text-sm text-muted-foreground px-4 py-2 italic opacity-50`,children:`No events`}):i.map(t=>(0,f.jsx)(a.t,{contextId:`scheduler-event`,data:t,children:(0,f.jsxs)(`div`,{"data-testid":`scheduler-event-${t.id}`,className:e._(`flex items-center p-3 rounded-lg border bg-card text-card-foreground shadow-sm cursor-pointer hover:bg-muted/50 transition-colors`,t.color&&`border-l-4 border-l-[${t.color}]`),style:{borderLeftColor:t.color},onClick:()=>r?.(t),children:[(0,f.jsxs)(`div`,{className:`flex flex-col mr-4 min-w-[80px] shrink-0`,children:[(0,f.jsx)(`span`,{className:`text-sm font-bold`,children:(0,_.format)(t.start,`h:mm a`)}),(0,f.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,_.format)(t.end,`h:mm a`)})]}),(0,f.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,f.jsx)(`div`,{className:`font-semibold truncate`,children:t.title}),t.description&&(0,f.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:t.description})]}),t.resourceId&&(0,f.jsx)(`div`,{className:`hidden sm:block ml-2 px-2 py-0.5 rounded-full bg-muted text-[10px] text-muted-foreground`,children:t.resourceId})]})},t.id))})]},t.toISOString())})});function Q({view:e,daysInView:t,visibleEvents:n,rowVirtualizer:r,resources:i,handleSlotDoubleClick:a,handleEventDoubleClick:o,handleEventDelete:s,parentRef:c,setView:l,setCurrentDate:u,props:d,handleRangeSelect:p,currentDate:m,showUnassignedLane:h,slotDuration:g,is24Hour:_,setIs24Hour:v,dir:y}){let b=x(`(max-width: 768px)`),S=typeof d.cell==`function`?d.cell:void 0;switch(b&&(e===`week`||e===`workweek`)?`agenda`:e){case`day`:case`week`:case`workweek`:return(0,f.jsx)(Y,{daysInView:t,visibleEvents:n,rowVirtualizer:r,resources:i,onSlotDoubleClick:a,onEventDoubleClick:o,onEventDelete:s,scrollRef:c,onViewChange:l,onDateChange:u,onRangeSelect:p,onSlotClick:(e,t)=>d.onCellClick?.(e,t),onEventClick:e=>d.onEventClick?.(e),showResourcesInDayView:d.showResourcesInDayView,showWeekNumber:d.showWeekNumber,weekRule:d.weekRule,cellTemplate:S,enableHtmlSanitizer:d.enableHtmlSanitizer,showUnassignedLane:h,startHour:d.startHour,endHour:d.endHour,slotDuration:g,is24Hour:_,setIs24Hour:v,group:d.group,onCellContextMenu:d.onCellContextMenu,dir:y});case`month`:return(0,f.jsx)(X,{currentDate:m,daysInView:t,visibleEvents:n,onSlotClick:e=>d.onCellClick?.(e),onSlotDoubleClick:e=>a(e),onEventClick:e=>d.onEventClick?.(e)||o(e),monthsCount:d.monthsCount,dir:y});case`timeline`:case`timeline-day`:case`timelineday`:case`timeline-week`:case`timelineweek`:case`timeline-month`:case`timelinemonth`:return(0,f.jsx)(te,{view:e,currentDate:m,daysInView:t,visibleEvents:n,resources:i,onSlotClick:(e,t)=>d.onCellClick?.(e,t),onSlotDoubleClick:a,onEventClick:e=>d.onEventClick?.(e)||o(e),onEventDelete:s,onRangeSelect:p,currentTimeIndicator:d.currentTimeIndicator,showResourceHeaders:d.showResourceHeaders,group:d.group,showUnassignedLane:d.showUnassignedLane,startHour:d.startHour,endHour:d.endHour,slotDuration:g,is24Hour:_,scrollRef:c,dir:y});case`agenda`:return(0,f.jsx)(re,{daysInView:t,visibleEvents:n,onEventClick:e=>d.onEventClick?.(e)||o(e)});default:return(0,f.jsxs)(`div`,{children:[`View `,e,` not implemented`]})}}var ie=u.default.lazy(()=>Promise.resolve().then(()=>require("./EzEventModal-D1EzXBsQ.cjs")).then(e=>e.n).then(e=>({default:e.EzEventModal}))),ae=u.default.lazy(()=>Promise.resolve().then(()=>require("./EzSchedulerQuickAdd-BYrV9PQ-.cjs")).then(e=>e.n).then(e=>({default:e.EzSchedulerQuickAdd}))),oe=u.default.lazy(()=>Promise.resolve().then(()=>require("./EzSchedulerToolbar-Dy62PVnH.cjs")).then(e=>e.n).then(e=>({default:e.EzSchedulerToolbar}))),$=new g.QueryClient;function se({ref:e,...t}){return i.t(),(0,f.jsx)(g.QueryClientProvider,{client:$,children:(0,f.jsx)(ce,{...t,ref:e})})}function ce({ref:n,...i}){let a=I({...i,view:i.view||i.defaultView||`Week`,selectedDate:i.selectedDate??i.defaultSelectedDate}),{state:o,actions:s,services:c,refs:d,baseApi:p,dir:h}=a,{currentView:g,currentDate:v,viewEvents:y,daysInView:b,slotDuration:x,is24Hour:S}=o,{setView:C,setCurrentDate:w}=s,{rowVirtualizer:T,parentRef:E}=d,{schedulerService:D,serviceRegistry:O}=c,[k,A]=(0,u.useState)(null),{internalResources:j,setInternalResources:M}=R({resources:i.resources}),N=e=>{if(!e.start||!e.end)return{hasBlockOverlap:!1,hasRegularOverlap:!1,overlappingEvents:[]};let t=y.filter(t=>t.id===e.id||!(t.resourceId===e.resourceId||t.resourceIds?.some(t=>e.resourceId===t)||!t.resourceId&&!e.resourceId)?!1:(0,_.areIntervalsOverlapping)({start:t.start,end:t.end},{start:e.start,end:e.end}));return{hasBlockOverlap:t.some(e=>e.isBlock),hasRegularOverlap:t.length>0,overlappingEvents:t}},P=(e=`regular`)=>{let t=O.get(`NotificationService`);if(t){let n=``,r=`warning`;e===`block`?(n=`Cannot place event here: This time is blocked (e.g. Lunch Break).`,r=`error`):e===`past`?(n=`Cannot move or create events in the past.`,r=`error`):(n=`Warning: This event overlaps with an existing event.`,r=`warning`),t.add({type:r,message:n,duration:5e3})}},{sensors:F,handleDragEnd:V}=z({events:y,resources:j,slotDuration:x,onBeforeEventDrop:i.onBeforeEventDrop,onBeforeEventResize:i.onBeforeEventResize,onEventChange:e=>{if(!i.allowPastEvents&&e.start<new Date){P(`past`);return}let{hasBlockOverlap:t,hasRegularOverlap:n,overlappingEvents:r}=N(e);if(t){P(`block`);return}if(n){if(i.onEventOverlap){let t={event:e,existingEvents:r,cancel:!1};if(i.onEventOverlap(t),t.cancel)return}P(`regular`)}s.updateEvent(e)}}),W=(0,u.useCallback)(e=>{let t=e.active.data.current,n=t?.eventId||t?.id||e.active.id,r=t?.event||y.find(e=>e.id===n);A(r??null)},[y]),G=(0,u.useCallback)(e=>{V(e),A(null)},[V]),K=(0,u.useCallback)(()=>{A(null)},[]),[q,J]=(0,u.useState)({isOpen:!1,mode:`create`}),[ee,Y]=(0,u.useState)(!1),[X,te]=(0,u.useState)(null),[Z,ne]=(0,u.useState)({x:0,y:0}),re=u.default.useMemo(()=>({...a.baseApi,onExportExcel:i.onExportExcel,onExportCSV:i.onExportCSV,onExportICS:i.onExportICS,get currentView(){return g},destroy:()=>{i.destroyed&&i.destroyed({})}}),[a.baseApi,g,i.destroyed,i.onExportExcel,i.onExportCSV,i.onExportICS]);L(g,v,D,y,{setEditorState:J,setResources:M,scrollToIndex:e=>{E.current&&(E.current.scrollTop=e*64)},forceUpdate:()=>{},showSpinner:p.showSpinner,hideSpinner:p.hideSpinner,closeQuickInfoPopup:()=>Y(!1),changeView:e=>C(e.toLowerCase()),next:s.nextPeriod,prev:s.prevPeriod,today:s.today},n,re,x);let $=(e,t)=>{i.onCellDoubleClick?i.onCellDoubleClick(e,t):J({isOpen:!0,mode:`create`,event:{start:e,end:(0,_.addMinutes)(e,x),resourceId:t,resourceIds:t?[t]:[]}})},se=e=>{if(i.onEventDoubleClick)i.onEventDoubleClick(e);else{let t=e.end<new Date;J({isOpen:!0,mode:t?`view`:`edit`,event:e})}},ce=(e,t)=>e===!1||t.cancel,le=async e=>{if(!i.allowPastEvents&&e.start&&e.start<new Date){P(`past`);return}let{hasBlockOverlap:t,hasRegularOverlap:n}=N(e);if(t){P(`block`);return}if(n&&P(`regular`),q.mode===`create`){let t={event:e,cancel:!1};if(ce(i.onBeforeEventCreate?.(t),t))return;await i.onEventCreate?.(e),s.addEvent(e)}else{let t=e.id?y.find(t=>t.id===e.id):void 0,n=e,r={event:n,originalEvent:t,proposedEvent:n,sourceResourceId:t?.resourceId,targetResourceId:n.resourceId,sourceTime:t?.start,targetTime:n.start,cancel:!1};if(ce(i.onBeforeEventChange?.(r),r))return;await i.onEventChange?.(n),s.updateEvent(n)}J(e=>({...e,isOpen:!1}))},[ue,de]=(0,u.useState)({isOpen:!1}),fe=async e=>{de({isOpen:!0,eventId:e})},pe=async()=>{let e=ue.eventId;if(!e)return;let t=y.find(t=>t.id===e);if(t){let n={eventId:e,event:t,cancel:!1};if(ce(i.onBeforeEventDelete?.(n),n))return;await i.onEventDelete?.(e),s.deleteEvent(e);let r=O.get(`NotificationService`);if(r){let e=(0,_.format)(t.start,`MMM d, yyyy h:mm a`);r.add({type:`success`,message:`Event "${t.title}" on ${e} has been cancelled.`,duration:5e3})}}de({isOpen:!1})},me=e=>{if(!i.allowPastEvents&&e.start&&e.start<new Date){P(`past`);return}let t={event:e,cancel:!1};ce(i.onBeforeEventCreate?.(t),t)||(s.addEvent(e),i.onEventCreate?.(e),Y(!1))};return(0,f.jsx)(r.t,{fallback:(0,f.jsx)(B,{}),children:(0,f.jsxs)(`div`,{className:e._(`ez-scheduler flex flex-col w-full h-full bg-background select-none overflow-hidden`,i.className),dir:h,children:[i.showHeaderBar!==!1&&(0,f.jsx)(u.default.Suspense,{fallback:(0,f.jsx)(`div`,{className:`h-12 w-full animate-pulse bg-muted/20 rounded-md mb-4`}),children:(()=>{let e=i.slots?.toolbar;return e?(0,f.jsx)(e,{view:g,setView:C,currentDate:v,next:s.nextPeriod,prev:s.prevPeriod,today:s.today,onAddClick:(0,u.useCallback)(()=>J({isOpen:!0,mode:`create`,event:{}}),[]),slotDuration:x,slotDurationOptions:i.slotDurationOptions,setSlotDuration:s.setSlotDuration,setCurrentDate:w,onPrev:s.prevPeriod,onNext:s.nextPeriod,onToday:s.today,currentView:g,onViewChange:e=>{let t=e.toLowerCase().replace(/[^a-z]/g,``),n={day:`day`,week:`week`,workweek:`workweek`,month:`month`,timelineday:`timeline-day`,timelineweek:`timeline-week`,timelineworkweek:`timeline-week`,timelinemonth:`timeline-month`,agenda:`agenda`,timeline:`timeline-day`}[t]||t;C(n)},views:i.views||[`Day`,`Week`,`Month`],onExportExcel:(0,u.useCallback)(()=>i.onExportExcel?.(y),[i.onExportExcel,y]),onExportCSV:(0,u.useCallback)(()=>i.onExportCSV?.(y),[i.onExportCSV,y]),onExportICS:(0,u.useCallback)(()=>i.onExportICS?.(y),[i.onExportICS,y]),dir:h,...i.slotProps?.toolbar}):(0,f.jsx)(oe,{view:g,setView:C,currentDate:v,next:s.nextPeriod,prev:s.prevPeriod,today:s.today,onAddClick:(0,u.useCallback)(()=>J({isOpen:!0,mode:`create`,event:{}}),[]),slotDuration:x,slotDurationOptions:i.slotDurationOptions,setSlotDuration:s.setSlotDuration,setCurrentDate:w,onPrev:s.prevPeriod,onNext:s.nextPeriod,onToday:s.today,currentView:g,onViewChange:e=>{let t=e.toLowerCase().replace(/[^a-z]/g,``),n={day:`day`,week:`week`,workweek:`workweek`,month:`month`,timelineday:`timeline-day`,timelineweek:`timeline-week`,timelineworkweek:`timeline-week`,timelinemonth:`timeline-month`,agenda:`agenda`,timeline:`timeline-day`}[t]||t;C(n)},views:i.views||[`Day`,`Week`,`Month`],onExportExcel:(0,u.useCallback)(()=>i.onExportExcel?.(y),[i.onExportExcel,y]),onExportCSV:(0,u.useCallback)(()=>i.onExportCSV?.(y),[i.onExportCSV,y]),onExportICS:(0,u.useCallback)(()=>i.onExportICS?.(y),[i.onExportICS,y]),dir:h})})()}),(0,f.jsxs)(m.DndContext,{sensors:F,onDragStart:W,onDragEnd:G,onDragCancel:K,collisionDetection:e=>{let t=(0,m.pointerWithin)(e);return t.length>0?t:(0,m.rectIntersection)(e)},autoScroll:{enabled:!0},children:[(0,f.jsxs)(`div`,{className:`flex-1 overflow-hidden relative flex flex-col`,children:[(0,f.jsx)(Q,{view:g,daysInView:b,visibleEvents:y,rowVirtualizer:T,resources:j,handleSlotDoubleClick:$,handleEventDoubleClick:se,handleEventDelete:fe,parentRef:E,setView:C,setCurrentDate:w,props:i,handleRangeSelect:(e,t,n,r)=>{i.showQuickInfoPopup&&(te({start:e,end:t,resourceId:n}),ne({x:r?.x||0,y:r?.y||0}),Y(!0))},currentDate:v,showUnassignedLane:i.showUnassignedLane,slotDuration:x,is24Hour:S,setIs24Hour:s.setIs24Hour,dir:h}),i.isLoading&&(0,f.jsx)(H,{})]}),(0,f.jsx)(m.DragOverlay,{dropAnimation:null,children:k?(0,f.jsx)(U,{event:k,dragOverlay:!0,orientation:g.toLowerCase().startsWith(`timeline`)?`horizontal`:`vertical`,showTime:!0,resizable:!1,style:{width:g.toLowerCase().startsWith(`timeline`)?180:220,minHeight:56}}):null}),(()=>{if(ee&&X){let e=i.slots?.quickAdd;return e?(0,f.jsx)(u.default.Suspense,{fallback:null,children:(0,f.jsx)(e,{start:X.start,end:X.end,resourceId:X.resourceId,resources:j,onSave:me,onCancel:()=>Y(!1),onMoreOptions:e=>{Y(!1),J({isOpen:!0,mode:`create`,event:e})},position:Z,...i.slotProps?.quickAdd})}):(0,f.jsx)(u.default.Suspense,{fallback:null,children:(0,f.jsx)(ae,{start:X.start,end:X.end,resourceId:X.resourceId,resources:j,onSave:me,onCancel:()=>Y(!1),onMoreOptions:e=>{Y(!1),J({isOpen:!0,mode:`create`,event:e})},position:Z})})}return null})(),(()=>{let e=i.slots?.eventModal;return e?(0,f.jsx)(u.default.Suspense,{fallback:null,children:(0,f.jsx)(e,{isOpen:q.isOpen,onClose:()=>J(e=>({...e,isOpen:!1})),mode:q.mode,event:q.event,onSave:le,onDelete:fe,resources:j,locale:i.locale,slotDuration:x,timeOptions:i.timeOptions,editorTemplate:typeof i.editorTemplate==`function`?i.editorTemplate:void 0,headerTemplate:typeof i.editorHeaderTemplate==`function`?i.editorHeaderTemplate:void 0,footerTemplate:typeof i.editorFooterTemplate==`function`?i.editorFooterTemplate:void 0,headerFieldsTemplate:typeof i.editorHeaderFieldsTemplate==`function`?i.editorHeaderFieldsTemplate:void 0,hiddenFields:i.editorHiddenFields,...i.slotProps?.eventModal})}):(0,f.jsx)(u.default.Suspense,{fallback:null,children:(0,f.jsx)(ie,{isOpen:q.isOpen,onClose:()=>J(e=>({...e,isOpen:!1})),mode:q.mode,event:q.event,onSave:le,onDelete:fe,resources:j,locale:i.locale,slotDuration:x,timeOptions:i.timeOptions,editorTemplate:typeof i.editorTemplate==`function`?i.editorTemplate:void 0,headerTemplate:typeof i.editorHeaderTemplate==`function`?i.editorHeaderTemplate:void 0,footerTemplate:typeof i.editorFooterTemplate==`function`?i.editorFooterTemplate:void 0,headerFieldsTemplate:typeof i.editorHeaderFieldsTemplate==`function`?i.editorHeaderFieldsTemplate:void 0,hiddenFields:i.editorHiddenFields})})})(),(0,f.jsx)(l.t,{isOpen:ue.isOpen,onClose:()=>de({isOpen:!1}),title:`Delete Event`,footer:(0,f.jsxs)(`div`,{className:`flex gap-2`,children:[(0,f.jsx)(t.t,{variant:`ghost`,onClick:()=>de({isOpen:!1}),children:`Cancel`}),(0,f.jsx)(t.t,{variant:`destructive`,onClick:pe,children:`Delete`})]}),children:(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Are you sure you want to delete this event? This action cannot be undone.`})})]})]})})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return se}});
@@ -1 +1 @@
1
- const e=require("./EzProvider-L2qQMq-v.cjs"),t=require("./button-BBMwzUtG.cjs"),n=require("./input-CYlvlbF7.cjs");let r=require("react");r=e.y(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime"),o=require("date-fns");var s=e.v({EzSchedulerQuickAdd:()=>c}),c=({start:s,end:c,resourceId:l,resources:u,onSave:d,onCancel:f,onMoreOptions:p,position:m})=>{let[h,g]=(0,r.useState)(``),_=(0,r.useRef)(null),v=(0,r.useRef)(null);(0,r.useEffect)(()=>{_.current?.focus()},[]),(0,r.useEffect)(()=>{let e=e=>{v.current&&!v.current.contains(e.target)&&f()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[f]);let y=()=>{h.trim()&&d({title:h,start:s,end:c,resourceId:l})},b=e=>{e.key===`Enter`&&y(),e.key===`Escape`&&f()},x=u?.find(e=>e.id===l),S=(0,o.isBefore)(s,new Date);return(0,a.jsxs)(`div`,{ref:v,className:e._(`fixed z-[100] w-[320px] p-4 rounded-xl shadow-2xl animate-in fade-in zoom-in duration-200`,`bg-background/80 backdrop-blur-xl border border-white/20 dark:border-white/10`,`shadow-[0_8px_32px_rgba(0,0,0,0.12)]`),style:{left:Math.min(m.x,window.innerWidth-340),top:Math.min(m.y,window.innerHeight-200)},children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,a.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-primary animate-pulse`}),(0,a.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Quick Add`})]}),(0,a.jsx)(t.t,{variant:`ghost`,size:`icon`,className:`h-6 w-6 rounded-full`,onClick:f,children:(0,a.jsx)(i.X,{className:`h-3 w-3`})})]}),(0,a.jsx)(n.t,{ref:_,placeholder:`What's the plan?`,value:h,onChange:e=>g(e.target.value),onKeyDown:b,className:`mb-4 bg-transparent border-none text-lg font-bold p-0 focus-visible:ring-0 placeholder:text-muted-foreground/50 h-auto`}),(0,a.jsxs)(`div`,{className:`space-y-2 mb-6`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,a.jsx)(i.Calendar,{className:`h-3.5 w-3.5`}),(0,a.jsx)(`span`,{children:(0,o.format)(s,`EEE, MMM d`)})]}),(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,a.jsx)(i.Clock,{className:`h-3.5 w-3.5`}),(0,a.jsxs)(`span`,{children:[(0,o.format)(s,`h:mm a`),` - `,(0,o.format)(c,`h:mm a`)]})]}),x&&(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,a.jsx)(`div`,{className:`w-3.5 h-3.5 rounded-full`,style:{backgroundColor:x.color||`hsl(var(--primary))`}}),(0,a.jsx)(`span`,{children:x.name})]}),S&&(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-warning-foreground font-medium`,children:[(0,a.jsx)(i.AlertCircle,{className:`h-3 w-3`}),(0,a.jsx)(`span`,{children:`This event is in the past`})]})]}),(0,a.jsxs)(`div`,{className:`flex items-center justify-between pt-2 border-t border-border/50`,children:[(0,a.jsxs)(t.t,{variant:`ghost`,size:`sm`,className:`h-8 gap-2 text-muted-foreground hover:text-foreground`,onClick:()=>p({title:h,start:s,end:c,resourceId:l}),children:[(0,a.jsx)(i.MoreHorizontal,{className:`h-4 w-4`}),`More`]}),(0,a.jsxs)(`div`,{className:`flex gap-2`,children:[(0,a.jsx)(t.t,{variant:`ghost`,size:`sm`,onClick:f,className:`h-8`,children:`Cancel`}),(0,a.jsx)(t.t,{size:`sm`,onClick:y,className:`h-8 px-4`,disabled:!h.trim(),children:`Save`})]})]})]})};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
1
+ const e=require("./EzProvider-L2qQMq-v.cjs"),t=require("./button-BBMwzUtG.cjs"),n=require("./input-DOh8O0iX.cjs");let r=require("react");r=e.y(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime"),o=require("date-fns");var s=e.v({EzSchedulerQuickAdd:()=>c}),c=({start:s,end:c,resourceId:l,resources:u,onSave:d,onCancel:f,onMoreOptions:p,position:m})=>{let[h,g]=(0,r.useState)(``),_=(0,r.useRef)(null),v=(0,r.useRef)(null);(0,r.useEffect)(()=>{_.current?.focus()},[]),(0,r.useEffect)(()=>{let e=e=>{v.current&&!v.current.contains(e.target)&&f()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[f]);let y=()=>{h.trim()&&d({title:h,start:s,end:c,resourceId:l})},b=e=>{e.key===`Enter`&&y(),e.key===`Escape`&&f()},x=u?.find(e=>e.id===l),S=(0,o.isBefore)(s,new Date);return(0,a.jsxs)(`div`,{ref:v,className:e._(`fixed z-[100] w-[320px] p-4 rounded-xl shadow-2xl animate-in fade-in zoom-in duration-200`,`bg-background/80 backdrop-blur-xl border border-white/20 dark:border-white/10`,`shadow-[0_8px_32px_rgba(0,0,0,0.12)]`),style:{left:Math.min(m.x,window.innerWidth-340),top:Math.min(m.y,window.innerHeight-200)},children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,a.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-primary animate-pulse`}),(0,a.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Quick Add`})]}),(0,a.jsx)(t.t,{variant:`ghost`,size:`icon`,className:`h-6 w-6 rounded-full`,onClick:f,children:(0,a.jsx)(i.X,{className:`h-3 w-3`})})]}),(0,a.jsx)(n.t,{ref:_,placeholder:`What's the plan?`,value:h,onChange:e=>g(e.target.value),onKeyDown:b,className:`mb-4 bg-transparent border-none text-lg font-bold p-0 focus-visible:ring-0 placeholder:text-muted-foreground/50 h-auto`}),(0,a.jsxs)(`div`,{className:`space-y-2 mb-6`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,a.jsx)(i.Calendar,{className:`h-3.5 w-3.5`}),(0,a.jsx)(`span`,{children:(0,o.format)(s,`EEE, MMM d`)})]}),(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,a.jsx)(i.Clock,{className:`h-3.5 w-3.5`}),(0,a.jsxs)(`span`,{children:[(0,o.format)(s,`h:mm a`),` - `,(0,o.format)(c,`h:mm a`)]})]}),x&&(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,a.jsx)(`div`,{className:`w-3.5 h-3.5 rounded-full`,style:{backgroundColor:x.color||`hsl(var(--primary))`}}),(0,a.jsx)(`span`,{children:x.name})]}),S&&(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-warning-foreground font-medium`,children:[(0,a.jsx)(i.AlertCircle,{className:`h-3 w-3`}),(0,a.jsx)(`span`,{children:`This event is in the past`})]})]}),(0,a.jsxs)(`div`,{className:`flex items-center justify-between pt-2 border-t border-border/50`,children:[(0,a.jsxs)(t.t,{variant:`ghost`,size:`sm`,className:`h-8 gap-2 text-muted-foreground hover:text-foreground`,onClick:()=>p({title:h,start:s,end:c,resourceId:l}),children:[(0,a.jsx)(i.MoreHorizontal,{className:`h-4 w-4`}),`More`]}),(0,a.jsxs)(`div`,{className:`flex gap-2`,children:[(0,a.jsx)(t.t,{variant:`ghost`,size:`sm`,onClick:f,className:`h-8`,children:`Cancel`}),(0,a.jsx)(t.t,{size:`sm`,onClick:y,className:`h-8 px-4`,disabled:!h.trim(),children:`Save`})]})]})]})};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
@@ -1,7 +1,7 @@
1
- import { p as e } from "./EzLayout-CiaPLniV.js";
1
+ import { p as e } from "./EzLayout-DFxegglu.js";
2
2
  import { _ as t } from "./EzProvider-AlmsYIDk.js";
3
3
  import { t as n } from "./button-CYyNwV8S.js";
4
- import { t as r } from "./input-Cj3sQK3M.js";
4
+ import { t as r } from "./input-CcRi0LeO.js";
5
5
  import { useEffect as i, useRef as a, useState as o } from "react";
6
6
  import { AlertCircle as s, Calendar as c, Clock as l, MoreHorizontal as u, X as d } from "lucide-react";
7
7
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
- import { p as e } from "./EzLayout-CiaPLniV.js";
1
+ import { p as e } from "./EzLayout-DFxegglu.js";
2
2
  import { _ as t, n } from "./EzProvider-AlmsYIDk.js";
3
3
  import { t as r } from "./button-CYyNwV8S.js";
4
- import { t as i } from "./input-Cj3sQK3M.js";
4
+ import { t as i } from "./input-CcRi0LeO.js";
5
5
  import { n as a, r as o, t as s } from "./popover-D1akYj0W.js";
6
6
  import { a as c, i as l, n as u, r as d, t as f } from "./select-D4tFaSai.js";
7
7
  import { t as p } from "./scroll-area-BJs87d45.js";
@@ -1 +1 @@
1
- const e=require("./EzProvider-L2qQMq-v.cjs"),t=require("./button-BBMwzUtG.cjs"),n=require("./input-CYlvlbF7.cjs"),r=require("./popover-wZKNvYM5.cjs"),i=require("./select-sVieKbLu.cjs"),a=require("./scroll-area-DSkE2KB_.cjs"),o=require("./calendar-DEHX32Cp.cjs");let s=require("react");s=e.y(s,1);let c=require("lucide-react"),l=require("react/jsx-runtime"),u=require("date-fns");var d=()=>{let n=e.n(),[i,o]=(0,s.useState)([]),[u,d]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e,t=()=>{let t=n.get(`NotificationService`);t&&!e&&(e=t.subscribe(e=>o(e)))};t();let r=n.subscribe(()=>{t()});return()=>{e&&e(),r()}},[]);let f=()=>{n.get(`NotificationService`)?.clearAll()},p=(e,t)=>{t.stopPropagation(),n.get(`NotificationService`)?.remove(e)},m=e=>{switch(e){case`success`:return(0,l.jsx)(c.CheckCircle,{className:`h-4 w-4 text-green-600`});case`error`:return(0,l.jsx)(c.AlertCircle,{className:`h-4 w-4 text-red-600`});case`warning`:return(0,l.jsx)(c.AlertTriangle,{className:`h-4 w-4 text-amber-600`});default:return(0,l.jsx)(c.Info,{className:`h-4 w-4 text-blue-600`})}};return(0,l.jsxs)(r.t,{open:u,onOpenChange:d,children:[(0,l.jsx)(r.r,{asChild:!0,children:(0,l.jsxs)(t.t,{variant:`ghost`,size:`icon`,className:`h-9 w-9 text-muted-foreground hover:text-foreground relative`,children:[(0,l.jsx)(c.Bell,{className:`w-5 h-5`}),i.length>0&&(0,l.jsx)(`span`,{className:`absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] font-bold text-white ring-2 ring-background animate-in zoom-in duration-300`,children:i.length>9?`9+`:i.length})]})}),(0,l.jsxs)(r.n,{className:`w-80 p-0 mr-4`,align:`end`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between p-4 border-b`,children:[(0,l.jsx)(`h4`,{className:`font-semibold text-sm`,children:`Notifications`}),i.length>0&&(0,l.jsxs)(t.t,{variant:`ghost`,size:`sm`,className:`h-auto px-2 py-1 text-xs text-muted-foreground hover:text-destructive`,onClick:f,children:[(0,l.jsx)(c.Trash2,{className:`w-3 h-3 mr-1`}),`Clear all`]})]}),(0,l.jsx)(a.t,{className:`h-[300px]`,children:i.length===0?(0,l.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-[200px] text-muted-foreground`,children:[(0,l.jsx)(c.Bell,{className:`w-8 h-8 mb-2 opacity-20`}),(0,l.jsx)(`p`,{className:`text-xs`,children:`No notifications`})]}):(0,l.jsx)(`div`,{className:`flex flex-col divide-y`,children:i.map(e=>(0,l.jsx)(`div`,{className:`p-4 hover:bg-muted/50 transition-colors relative group`,children:(0,l.jsxs)(`div`,{className:`flex gap-3`,children:[(0,l.jsx)(`div`,{className:`shrink-0 mt-0.5`,children:m(e.type)}),(0,l.jsxs)(`div`,{className:`space-y-1 flex-1 min-w-0`,children:[(0,l.jsx)(`p`,{className:`text-xs leading-relaxed text-foreground/90 break-words`,children:e.message}),(0,l.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Just now`})]}),(0,l.jsx)(`button`,{onClick:t=>p(e.id,t),className:`opacity-0 group-hover:opacity-100 transition-opacity absolute top-2 right-2 p-1 hover:bg-background rounded-md text-muted-foreground hover:text-foreground`,children:(0,l.jsx)(c.X,{className:`w-3 h-3`})})]})},e.id))})})]})]})},f=e.v({EzSchedulerToolbar:()=>h}),p=e=>e.replace(/([A-Z])/g,` $1`).trim(),m=(e,t)=>(0,u.format)(e,`MMMM yyyy`),h=(0,s.memo)(({currentDate:a,next:s,prev:f,today:h,slotDuration:g,slotDurationOptions:_,setSlotDuration:v,setCurrentDate:y,onPrev:b,onNext:x,onToday:S,currentView:C,onViewChange:w,views:T=[],onExportExcel:E,onExportCSV:D,onExportICS:O,dir:k})=>{let A=k===`rtl`,j=Array.from(new Set([..._||[5,10,15,30,45,60],g])).sort((e,t)=>e-t),M=(r,o)=>{if(typeof r==`string`)switch(r){case`Previous`:return(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:b,children:(0,l.jsx)(c.ChevronLeft,{className:`h-4 w-4`})},o);case`Next`:return(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:x,children:(0,l.jsx)(c.ChevronRight,{className:`h-4 w-4`})},o);case`Today`:return(0,l.jsx)(t.t,{variant:`outline`,onClick:S,children:`Today`},o);case`DateRange`:return(0,l.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,l.jsx)(`span`,{className:`text-lg font-semibold min-w-[200px] text-center`,children:m(a,C)})},o);case`Search`:return(0,l.jsxs)(`div`,{className:`relative w-48 hidden md:block`,children:[(0,l.jsx)(c.Search,{className:e._(`absolute top-2.5 h-4 w-4 text-muted-foreground`,A?`right-2`:`left-2`)}),(0,l.jsx)(n.t,{placeholder:`Search...`,className:`ps-8 h-9`})]},o);case`Timezone`:return(0,l.jsxs)(t.t,{variant:`ghost`,size:`sm`,className:`hidden lg:flex gap-1 text-xs text-muted-foreground`,children:[(0,l.jsx)(c.Globe,{className:`h-3.5 w-3.5`}),(0,l.jsx)(`span`,{children:`UTC`})]},o);case`ActiveView`:return(0,l.jsxs)(i.t,{value:C,onValueChange:e=>w(e),children:[(0,l.jsx)(i.i,{className:`w-[140px]`,children:(0,l.jsx)(i.a,{placeholder:`Select view`})}),(0,l.jsx)(i.n,{children:T.map(e=>{let t=typeof e==`string`?e:e.option;return(0,l.jsx)(i.r,{value:t,children:p(t)},t)})})]});default:return null}return(0,l.jsx)(`div`,{className:r.cssClass,children:r.text},o)};return(0,l.jsxs)(`div`,{"data-testid":`scheduler-toolbar`,className:`flex items-center justify-between p-4 border-b border-border shrink-0 bg-background h-16`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5 `,children:[(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:f,className:`h-8 w-8 text-muted-foreground hover:text-foreground hover:bg-muted`,children:A?(0,l.jsx)(c.ChevronRight,{className:`w-5 h-5`}):(0,l.jsx)(c.ChevronLeft,{className:`w-5 h-5`})}),(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:s,className:`h-8 w-8 text-muted-foreground hover:text-foreground hover:bg-muted`,children:A?(0,l.jsx)(c.ChevronLeft,{className:`w-5 h-5`}):(0,l.jsx)(c.ChevronRight,{className:`w-5 h-5`})}),(0,l.jsxs)(r.t,{children:[(0,l.jsx)(r.r,{asChild:!0,children:(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-muted-foreground hover:text-foreground hover:bg-muted`,children:(0,l.jsx)(c.Calendar,{className:`h-4 w-4`})})}),(0,l.jsx)(r.n,{className:`w-auto p-0`,align:`start`,children:(0,l.jsx)(o.t,{selected:a,onSelect:e=>e&&y(e)})})]})]}),(0,l.jsx)(`div`,{className:`text-xl font-bold tracking-tight text-foreground cursor-pointer hover:text-primary transition-colors ms-4`,onClick:()=>{},children:(0,u.format)(a,`EEEE, MMM d yyyy`)})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-4`,children:[M(`Search`,0),` `,M(`Timezone`,1),` `,M(`ActiveView`,2),(0,l.jsx)(t.t,{variant:`outline`,onClick:h,className:`h-9 px-4 text-xs font-bold uppercase tracking-wider border-border hover:bg-muted transition-colors rounded-md`,children:`TODAY`}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2 bg-muted/30 px-2 py-1 rounded-lg border border-border/50`,children:[(0,l.jsx)(c.Clock,{className:`w-3.5 h-3.5 text-muted-foreground`}),(0,l.jsxs)(i.t,{value:String(g),onValueChange:e=>v(Number(e)),children:[(0,l.jsx)(i.i,{className:`h-7 w-[90px] text-[10px] font-bold uppercase tracking-tight bg-transparent border-none shadow-none focus:ring-0`,children:(0,l.jsx)(i.a,{placeholder:`Interval`})}),(0,l.jsx)(i.n,{children:j.map(e=>(0,l.jsx)(i.r,{value:String(e),children:e===60?`1 hour`:`${e} minutes`},e))})]})]}),(0,l.jsx)(d,{}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1 border-s border-border ps-2`,children:[E&&(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:E,title:`Export to Excel`,children:(0,l.jsx)(c.Download,{className:`w-4 h-4`})}),D&&(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:D,title:`Export to CSV`,children:(0,l.jsx)(c.Download,{className:`w-4 h-4 text-primary`})}),O&&(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:O,title:`Export to ICS`,children:(0,l.jsx)(c.Calendar,{className:`w-4 h-4`})})]}),(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,className:`h-9 w-9 text-muted-foreground hover:text-foreground rounded-full`,children:(0,l.jsx)(c.Settings,{className:`w-5 h-5`})})]})]})});h.displayName=`EzSchedulerToolbar`,Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
1
+ const e=require("./EzProvider-L2qQMq-v.cjs"),t=require("./button-BBMwzUtG.cjs"),n=require("./input-DOh8O0iX.cjs"),r=require("./popover-wZKNvYM5.cjs"),i=require("./select-sVieKbLu.cjs"),a=require("./scroll-area-DSkE2KB_.cjs"),o=require("./calendar-DEHX32Cp.cjs");let s=require("react");s=e.y(s,1);let c=require("lucide-react"),l=require("react/jsx-runtime"),u=require("date-fns");var d=()=>{let n=e.n(),[i,o]=(0,s.useState)([]),[u,d]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e,t=()=>{let t=n.get(`NotificationService`);t&&!e&&(e=t.subscribe(e=>o(e)))};t();let r=n.subscribe(()=>{t()});return()=>{e&&e(),r()}},[]);let f=()=>{n.get(`NotificationService`)?.clearAll()},p=(e,t)=>{t.stopPropagation(),n.get(`NotificationService`)?.remove(e)},m=e=>{switch(e){case`success`:return(0,l.jsx)(c.CheckCircle,{className:`h-4 w-4 text-green-600`});case`error`:return(0,l.jsx)(c.AlertCircle,{className:`h-4 w-4 text-red-600`});case`warning`:return(0,l.jsx)(c.AlertTriangle,{className:`h-4 w-4 text-amber-600`});default:return(0,l.jsx)(c.Info,{className:`h-4 w-4 text-blue-600`})}};return(0,l.jsxs)(r.t,{open:u,onOpenChange:d,children:[(0,l.jsx)(r.r,{asChild:!0,children:(0,l.jsxs)(t.t,{variant:`ghost`,size:`icon`,className:`h-9 w-9 text-muted-foreground hover:text-foreground relative`,children:[(0,l.jsx)(c.Bell,{className:`w-5 h-5`}),i.length>0&&(0,l.jsx)(`span`,{className:`absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] font-bold text-white ring-2 ring-background animate-in zoom-in duration-300`,children:i.length>9?`9+`:i.length})]})}),(0,l.jsxs)(r.n,{className:`w-80 p-0 mr-4`,align:`end`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between p-4 border-b`,children:[(0,l.jsx)(`h4`,{className:`font-semibold text-sm`,children:`Notifications`}),i.length>0&&(0,l.jsxs)(t.t,{variant:`ghost`,size:`sm`,className:`h-auto px-2 py-1 text-xs text-muted-foreground hover:text-destructive`,onClick:f,children:[(0,l.jsx)(c.Trash2,{className:`w-3 h-3 mr-1`}),`Clear all`]})]}),(0,l.jsx)(a.t,{className:`h-[300px]`,children:i.length===0?(0,l.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-[200px] text-muted-foreground`,children:[(0,l.jsx)(c.Bell,{className:`w-8 h-8 mb-2 opacity-20`}),(0,l.jsx)(`p`,{className:`text-xs`,children:`No notifications`})]}):(0,l.jsx)(`div`,{className:`flex flex-col divide-y`,children:i.map(e=>(0,l.jsx)(`div`,{className:`p-4 hover:bg-muted/50 transition-colors relative group`,children:(0,l.jsxs)(`div`,{className:`flex gap-3`,children:[(0,l.jsx)(`div`,{className:`shrink-0 mt-0.5`,children:m(e.type)}),(0,l.jsxs)(`div`,{className:`space-y-1 flex-1 min-w-0`,children:[(0,l.jsx)(`p`,{className:`text-xs leading-relaxed text-foreground/90 break-words`,children:e.message}),(0,l.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Just now`})]}),(0,l.jsx)(`button`,{onClick:t=>p(e.id,t),className:`opacity-0 group-hover:opacity-100 transition-opacity absolute top-2 right-2 p-1 hover:bg-background rounded-md text-muted-foreground hover:text-foreground`,children:(0,l.jsx)(c.X,{className:`w-3 h-3`})})]})},e.id))})})]})]})},f=e.v({EzSchedulerToolbar:()=>h}),p=e=>e.replace(/([A-Z])/g,` $1`).trim(),m=(e,t)=>(0,u.format)(e,`MMMM yyyy`),h=(0,s.memo)(({currentDate:a,next:s,prev:f,today:h,slotDuration:g,slotDurationOptions:_,setSlotDuration:v,setCurrentDate:y,onPrev:b,onNext:x,onToday:S,currentView:C,onViewChange:w,views:T=[],onExportExcel:E,onExportCSV:D,onExportICS:O,dir:k})=>{let A=k===`rtl`,j=Array.from(new Set([..._||[5,10,15,30,45,60],g])).sort((e,t)=>e-t),M=(r,o)=>{if(typeof r==`string`)switch(r){case`Previous`:return(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:b,children:(0,l.jsx)(c.ChevronLeft,{className:`h-4 w-4`})},o);case`Next`:return(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:x,children:(0,l.jsx)(c.ChevronRight,{className:`h-4 w-4`})},o);case`Today`:return(0,l.jsx)(t.t,{variant:`outline`,onClick:S,children:`Today`},o);case`DateRange`:return(0,l.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,l.jsx)(`span`,{className:`text-lg font-semibold min-w-[200px] text-center`,children:m(a,C)})},o);case`Search`:return(0,l.jsxs)(`div`,{className:`relative w-48 hidden md:block`,children:[(0,l.jsx)(c.Search,{className:e._(`absolute top-2.5 h-4 w-4 text-muted-foreground`,A?`right-2`:`left-2`)}),(0,l.jsx)(n.t,{placeholder:`Search...`,className:`ps-8 h-9`})]},o);case`Timezone`:return(0,l.jsxs)(t.t,{variant:`ghost`,size:`sm`,className:`hidden lg:flex gap-1 text-xs text-muted-foreground`,children:[(0,l.jsx)(c.Globe,{className:`h-3.5 w-3.5`}),(0,l.jsx)(`span`,{children:`UTC`})]},o);case`ActiveView`:return(0,l.jsxs)(i.t,{value:C,onValueChange:e=>w(e),children:[(0,l.jsx)(i.i,{className:`w-[140px]`,children:(0,l.jsx)(i.a,{placeholder:`Select view`})}),(0,l.jsx)(i.n,{children:T.map(e=>{let t=typeof e==`string`?e:e.option;return(0,l.jsx)(i.r,{value:t,children:p(t)},t)})})]});default:return null}return(0,l.jsx)(`div`,{className:r.cssClass,children:r.text},o)};return(0,l.jsxs)(`div`,{"data-testid":`scheduler-toolbar`,className:`flex items-center justify-between p-4 border-b border-border shrink-0 bg-background h-16`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5 `,children:[(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:f,className:`h-8 w-8 text-muted-foreground hover:text-foreground hover:bg-muted`,children:A?(0,l.jsx)(c.ChevronRight,{className:`w-5 h-5`}):(0,l.jsx)(c.ChevronLeft,{className:`w-5 h-5`})}),(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:s,className:`h-8 w-8 text-muted-foreground hover:text-foreground hover:bg-muted`,children:A?(0,l.jsx)(c.ChevronLeft,{className:`w-5 h-5`}):(0,l.jsx)(c.ChevronRight,{className:`w-5 h-5`})}),(0,l.jsxs)(r.t,{children:[(0,l.jsx)(r.r,{asChild:!0,children:(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-muted-foreground hover:text-foreground hover:bg-muted`,children:(0,l.jsx)(c.Calendar,{className:`h-4 w-4`})})}),(0,l.jsx)(r.n,{className:`w-auto p-0`,align:`start`,children:(0,l.jsx)(o.t,{selected:a,onSelect:e=>e&&y(e)})})]})]}),(0,l.jsx)(`div`,{className:`text-xl font-bold tracking-tight text-foreground cursor-pointer hover:text-primary transition-colors ms-4`,onClick:()=>{},children:(0,u.format)(a,`EEEE, MMM d yyyy`)})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-4`,children:[M(`Search`,0),` `,M(`Timezone`,1),` `,M(`ActiveView`,2),(0,l.jsx)(t.t,{variant:`outline`,onClick:h,className:`h-9 px-4 text-xs font-bold uppercase tracking-wider border-border hover:bg-muted transition-colors rounded-md`,children:`TODAY`}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2 bg-muted/30 px-2 py-1 rounded-lg border border-border/50`,children:[(0,l.jsx)(c.Clock,{className:`w-3.5 h-3.5 text-muted-foreground`}),(0,l.jsxs)(i.t,{value:String(g),onValueChange:e=>v(Number(e)),children:[(0,l.jsx)(i.i,{className:`h-7 w-[90px] text-[10px] font-bold uppercase tracking-tight bg-transparent border-none shadow-none focus:ring-0`,children:(0,l.jsx)(i.a,{placeholder:`Interval`})}),(0,l.jsx)(i.n,{children:j.map(e=>(0,l.jsx)(i.r,{value:String(e),children:e===60?`1 hour`:`${e} minutes`},e))})]})]}),(0,l.jsx)(d,{}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1 border-s border-border ps-2`,children:[E&&(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:E,title:`Export to Excel`,children:(0,l.jsx)(c.Download,{className:`w-4 h-4`})}),D&&(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:D,title:`Export to CSV`,children:(0,l.jsx)(c.Download,{className:`w-4 h-4 text-primary`})}),O&&(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,onClick:O,title:`Export to ICS`,children:(0,l.jsx)(c.Calendar,{className:`w-4 h-4`})})]}),(0,l.jsx)(t.t,{variant:`ghost`,size:`icon`,className:`h-9 w-9 text-muted-foreground hover:text-foreground rounded-full`,children:(0,l.jsx)(c.Settings,{className:`w-5 h-5`})})]})]})});h.displayName=`EzSchedulerToolbar`,Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
@@ -232,11 +232,14 @@ var R = o.memo(({ stroke: e, options: t, color: n }) => /* @__PURE__ */ d("path"
232
232
  S,
233
233
  x
234
234
  ]), Y = (e) => {
235
- C || w || (e.currentTarget.setPointerCapture(e.pointerId), P.current = [[
235
+ if (C || w) return;
236
+ e.currentTarget.setPointerCapture(e.pointerId);
237
+ let t = [
236
238
  e.nativeEvent.offsetX,
237
239
  e.nativeEvent.offsetY,
238
240
  e.pressure
239
- ]], J());
241
+ ];
242
+ P.current = [t], J();
240
243
  }, X = (e) => {
241
244
  if (C || w || e.buttons !== 1) return;
242
245
  let t = [