schedulant 2.0.7-fixed.6 → 2.0.9

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.
@@ -1,25 +1,25 @@
1
- import { jsx as a, Fragment as Mt, jsxs as O } from "react/jsx-runtime";
1
+ import { jsx as a, Fragment as At, jsxs as O } from "react/jsx-runtime";
2
2
  import * as ie from "react";
3
- import { createContext as wt, useReducer as Et, useEffect as L, useContext as Ct, useRef as k, useCallback as C, useState as re, useMemo as F, memo as ae, useLayoutEffect as Tt } from "react";
3
+ import { createContext as bt, useReducer as Mt, useEffect as N, useContext as wt, useRef as k, useCallback as C, useState as re, useMemo as F, memo as ae, useLayoutEffect as Et } from "react";
4
4
  import E from "dayjs";
5
- import Dt from "dayjs/plugin/weekYear";
6
- import Rt from "dayjs/plugin/weekOfYear";
7
- import kt from "dayjs/plugin/quarterOfYear";
8
- import xt from "dayjs/plugin/isSameOrBefore";
9
- import { Dropdown as K, Space as It } from "antd";
10
- import { PlusSquareOutlined as Ot, MinusSquareOutlined as Pt } from "@ant-design/icons";
11
- import { useSortable as Lt, SortableContext as Nt, verticalListSortingStrategy as Yt } from "@dnd-kit/sortable";
12
- import Z from "@ant-design/icons/lib/components/Icon";
13
- import { useSensors as _t, useSensor as Ye, PointerSensor as Wt, KeyboardSensor as Ht, DndContext as zt, closestCenter as Vt, DragOverlay as Ft } from "@dnd-kit/core";
14
- import { restrictToVerticalAxis as Bt } from "@dnd-kit/modifiers";
15
- import { flushSync as qt } from "react-dom";
5
+ import Ct from "dayjs/plugin/weekYear";
6
+ import Dt from "dayjs/plugin/weekOfYear";
7
+ import Tt from "dayjs/plugin/quarterOfYear";
8
+ import Rt from "dayjs/plugin/isSameOrBefore";
9
+ import { Dropdown as Z, Space as kt } from "antd";
10
+ import X from "@ant-design/icons/lib/components/Icon";
11
+ import { PlusSquareOutlined as xt, MinusSquareOutlined as Ot } from "@ant-design/icons";
12
+ import { useSortable as It, SortableContext as Pt, verticalListSortingStrategy as Lt } from "@dnd-kit/sortable";
13
+ import { useSensors as Nt, useSensor as _e, PointerSensor as Yt, KeyboardSensor as _t, DndContext as Wt, closestCenter as Ht, DragOverlay as zt } from "@dnd-kit/core";
14
+ import { restrictToVerticalAxis as Vt } from "@dnd-kit/modifiers";
15
+ import { flushSync as Ft } from "react-dom";
16
16
  const de = {
17
17
  EXPAND_RESOURCE: "EXPAND_RESOURCE",
18
18
  COLLAPSE_RESOURCE: "COLLAPSE_RESOURCE",
19
19
  SET_RESOURCE_AREA_WIDTH: "SET_RESOURCE_AREA_WIDTH"
20
- }, ct = "schedulant.state", Ut = () => {
20
+ }, dt = "schedulant.state", Bt = () => {
21
21
  try {
22
- const t = localStorage.getItem(ct);
22
+ const t = localStorage.getItem(dt);
23
23
  if (t)
24
24
  return JSON.parse(t);
25
25
  } catch {
@@ -29,7 +29,7 @@ const de = {
29
29
  collapseIds: [],
30
30
  resourceAreaWidth: "20%"
31
31
  };
32
- }, jt = (t, e) => {
32
+ }, qt = (t, e) => {
33
33
  switch (e.type) {
34
34
  case de.EXPAND_RESOURCE:
35
35
  return {
@@ -49,23 +49,23 @@ const de = {
49
49
  default:
50
50
  return t;
51
51
  }
52
- }, dt = wt(void 0), $t = ({ children: t }) => {
53
- const [e, n] = Et(jt, void 0, Ut);
54
- return L(() => {
55
- localStorage.setItem(ct, JSON.stringify(e));
56
- }, [e]), /* @__PURE__ */ a(dt.Provider, { value: { state: e, dispatch: n }, children: t });
57
- }, De = () => {
58
- const t = Ct(dt);
52
+ }, ut = bt(void 0), Ut = ({ children: t }) => {
53
+ const [e, n] = Mt(qt, void 0, Bt);
54
+ return N(() => {
55
+ localStorage.setItem(dt, JSON.stringify(e));
56
+ }, [e]), /* @__PURE__ */ a(ut.Provider, { value: { state: e, dispatch: n }, children: t });
57
+ }, Te = () => {
58
+ const t = wt(ut);
59
59
  if (t === void 0)
60
60
  throw new Error("useSchedulantContext must be used within a SchedulantProvider");
61
61
  return t;
62
- }, w = (t) => `${t}px`, oe = (t) => Number(t.replace(/px$/, "")), _e = (t) => document.querySelector(`.${t}`), ut = 1.5, Gt = 0.7, W = 10, ht = 16, We = 13, Xt = 0.1, He = 0.5, Qt = 0.25, Kt = 0.75, Zt = 100, Jt = (t) => {
63
- L(() => {
64
- const e = document.getElementById("schedulant-view-harness"), n = document.getElementById("schedulant-datagrid-body"), s = document.getElementById("schedulant-timeline-head"), i = n ? n.getBoundingClientRect().height : 0, r = s ? s.getBoundingClientRect().height : 0, o = i + r + We, l = t - o > 0 ? o : t;
62
+ }, w = (t) => `${t}px`, oe = (t) => Number(t.replace(/px$/, "")), We = (t) => document.querySelector(`.${t}`), jt = 0.7, W = 10, ht = 16, He = 13, $t = 0.3, ze = 0.8, Gt = 0.25, Xt = 0.75, Qt = 100, Kt = (t) => {
63
+ N(() => {
64
+ const e = document.getElementById("schedulant-view-harness"), n = document.getElementById("schedulant-datagrid-body"), s = document.getElementById("schedulant-timeline-head"), i = n ? n.getBoundingClientRect().height : 0, r = s ? s.getBoundingClientRect().height : 0, o = i + r + He, l = t - o > 0 ? o : t;
65
65
  e && (e.style.height = w(l));
66
66
  const c = () => {
67
- const m = n ? n.getBoundingClientRect().height : 0, f = s ? s.getBoundingClientRect().height : 0, u = m + f + We, h = t - u > 0 ? u : t;
68
- e && (e.style.height = w(h));
67
+ const m = n ? n.getBoundingClientRect().height : 0, f = s ? s.getBoundingClientRect().height : 0, h = m + f + He, u = t - h > 0 ? h : t;
68
+ e && (e.style.height = w(u));
69
69
  }, d = new ResizeObserver(() => {
70
70
  c();
71
71
  });
@@ -73,12 +73,12 @@ const de = {
73
73
  d.disconnect();
74
74
  };
75
75
  }, [t]);
76
- }, en = (t, e, n, s) => {
77
- L(() => {
76
+ }, Zt = (t, e, n, s) => {
77
+ N(() => {
78
78
  const i = t.current, r = e.current, o = n.current, l = s.current;
79
79
  if (!i || !r || !o || !l) return;
80
- const c = [], d = (m, f, u, h) => {
81
- m.addEventListener(f, u, h), c.push(() => m.removeEventListener(f, u));
80
+ const c = [], d = (m, f, h, u) => {
81
+ m.addEventListener(f, h, u), c.push(() => m.removeEventListener(f, h));
82
82
  };
83
83
  return d(r, "scroll", () => {
84
84
  i.scrollTop = r.scrollTop, l.scrollLeft = r.scrollLeft;
@@ -87,32 +87,32 @@ const de = {
87
87
  }), d(i, "wheel", ((m) => {
88
88
  let f = !1;
89
89
  if (m.deltaY !== 0) {
90
- const u = r.scrollHeight - r.clientHeight, h = Math.max(0, Math.min(u, r.scrollTop + m.deltaY));
91
- r.scrollTop = h, i.scrollTop = h, f = !0;
90
+ const h = r.scrollHeight - r.clientHeight, u = Math.max(0, Math.min(h, r.scrollTop + m.deltaY));
91
+ r.scrollTop = u, i.scrollTop = u, f = !0;
92
92
  }
93
93
  if (f && m.deltaX !== 0) {
94
- const u = i.scrollWidth - i.clientWidth, h = Math.max(0, Math.min(u, i.scrollLeft + m.deltaX));
95
- i.scrollLeft = h, o.scrollLeft = h;
94
+ const h = i.scrollWidth - i.clientWidth, u = Math.max(0, Math.min(h, i.scrollLeft + m.deltaX));
95
+ i.scrollLeft = u, o.scrollLeft = u;
96
96
  } else if (m.deltaX !== 0) {
97
- const u = i.scrollWidth - i.clientWidth;
98
- o.scrollLeft = Math.max(0, Math.min(u, i.scrollLeft + m.deltaX));
97
+ const h = i.scrollWidth - i.clientWidth;
98
+ o.scrollLeft = Math.max(0, Math.min(h, i.scrollLeft + m.deltaX));
99
99
  }
100
100
  f && m.preventDefault();
101
101
  }), { passive: !1 }), d(r, "wheel", ((m) => {
102
102
  let f = !1;
103
103
  if (m.deltaY !== 0) {
104
- const u = r.scrollHeight - r.clientHeight, h = Math.max(0, Math.min(u, r.scrollTop + m.deltaY));
105
- r.scrollTop = h, i.scrollTop = h, f = !0;
104
+ const h = r.scrollHeight - r.clientHeight, u = Math.max(0, Math.min(h, r.scrollTop + m.deltaY));
105
+ r.scrollTop = u, i.scrollTop = u, f = !0;
106
106
  }
107
107
  if (m.deltaX !== 0) {
108
- const u = r.scrollWidth - r.clientWidth, h = Math.max(0, Math.min(u, r.scrollLeft + m.deltaX));
109
- r.scrollLeft = h, l.scrollLeft = h, f = !0;
108
+ const h = r.scrollWidth - r.clientWidth, u = Math.max(0, Math.min(h, r.scrollLeft + m.deltaX));
109
+ r.scrollLeft = u, l.scrollLeft = u, f = !0;
110
110
  }
111
111
  f && m.preventDefault();
112
112
  }), { passive: !1 }), () => c.forEach((m) => m());
113
113
  }, [t, e, n, s]);
114
- }, tn = (t, e) => {
115
- L(() => {
114
+ }, Jt = (t, e) => {
115
+ N(() => {
116
116
  const n = t.current;
117
117
  n && e && (n.style.width = e);
118
118
  }, [t, e]);
@@ -143,7 +143,7 @@ class x {
143
143
  return this.isDefined() ? this.value : e;
144
144
  }
145
145
  }
146
- class nn {
146
+ class en {
147
147
  event;
148
148
  resourceApi;
149
149
  constructor(e) {
@@ -201,7 +201,7 @@ const j = (t, e) => {
201
201
  n[i] ? n[i].push(s) : n[i] = [s];
202
202
  }), n;
203
203
  };
204
- class sn {
204
+ class tn {
205
205
  depth;
206
206
  resource;
207
207
  parent;
@@ -291,24 +291,24 @@ class le {
291
291
  return (typeof s == "number" ? s : 0) - (typeof i == "number" ? i : 0);
292
292
  }
293
293
  static createTree(e, n, s, i) {
294
- const r = "undefined", o = e.map((h) => new sn(h)), l = new Map(Object.entries(j(n, (h) => h.getResourceId()))), c = o.reduce((h, A) => h.set(A.getId(), A), /* @__PURE__ */ new Map()), d = new Map(Object.entries(j(s, (h) => h.getResourceId()))), m = new Map(Object.entries(j(i, (h) => h.getResourceId()))), f = [{ parentId: r, depth: 0 }], u = new Map(Object.entries(j(o, (h) => h.getParentId().getOrElse(r))));
294
+ const r = "undefined", o = e.map((u) => new tn(u)), l = new Map(Object.entries(j(n, (u) => u.getResourceId()))), c = o.reduce((u, A) => u.set(A.getId(), A), /* @__PURE__ */ new Map()), d = new Map(Object.entries(j(s, (u) => u.getResourceId()))), m = new Map(Object.entries(j(i, (u) => u.getResourceId()))), f = [{ parentId: r, depth: 0 }], h = new Map(Object.entries(j(o, (u) => u.getParentId().getOrElse(r))));
295
295
  for (; f.length > 0; ) {
296
- const h = f.pop();
297
- if (h) {
298
- const { parentId: A, depth: p } = h, S = u.get(A);
296
+ const u = f.pop();
297
+ if (u) {
298
+ const { parentId: A, depth: p } = u, S = h.get(A);
299
299
  S && S.sort(le.compare).forEach((b) => {
300
300
  const g = b.getId();
301
- b.setDepth(p), b.setParent(c.get(A)), b.setChildren(u.get(g) || []);
301
+ b.setDepth(p), b.setParent(c.get(A)), b.setChildren(h.get(g) || []);
302
302
  const y = l.get(g) || [];
303
- y.forEach((T) => T.setResourceApi(b)), b.setEventApis(y);
303
+ y.forEach((D) => D.setResourceApi(b)), b.setEventApis(y);
304
304
  const v = d.get(g) || [];
305
- v.forEach((T) => T.setResourceApi(b)), b.setMilestoneApis(v);
305
+ v.forEach((D) => D.setResourceApi(b)), b.setMilestoneApis(v);
306
306
  const M = m.get(g) || [];
307
- M.forEach((T) => T.setResourceApi(b)), b.setCheckpointApis(M), f.push({ parentId: g, depth: p + 1 });
307
+ M.forEach((D) => D.setResourceApi(b)), b.setCheckpointApis(M), f.push({ parentId: g, depth: p + 1 });
308
308
  });
309
309
  }
310
310
  }
311
- return u.get(r) || [];
311
+ return h.get(r) || [];
312
312
  }
313
313
  static flatMapTree(e) {
314
314
  const n = [], s = [...e];
@@ -323,7 +323,7 @@ class le {
323
323
  return n;
324
324
  }
325
325
  }
326
- class rn {
326
+ class nn {
327
327
  milestone;
328
328
  resourceApi;
329
329
  constructor(e) {
@@ -362,7 +362,7 @@ class rn {
362
362
  return x.fromNullable(this.milestone.extendedProps);
363
363
  }
364
364
  }
365
- class on {
365
+ class sn {
366
366
  checkpoint;
367
367
  resourceApi;
368
368
  constructor(e) {
@@ -398,11 +398,11 @@ class on {
398
398
  return x.fromNullable(this.checkpoint.extendedProps);
399
399
  }
400
400
  }
401
- E.extend(xt);
402
- E.extend(kt);
403
401
  E.extend(Rt);
402
+ E.extend(Tt);
404
403
  E.extend(Dt);
405
- class X {
404
+ E.extend(Ct);
405
+ class K {
406
406
  start;
407
407
  end;
408
408
  timelineData;
@@ -432,10 +432,10 @@ class X {
432
432
  i.years[m] = i.years[m] || [], i.years[m].push(s.clone()), d.has(m) || d.set(m, d.size);
433
433
  const f = s.startOf("quarter").format("YYYY-MM-DD");
434
434
  i.quarters[f] = i.quarters[f] || [], i.quarters[f].push(s.clone()), c.has(f) || c.set(f, c.size);
435
- const u = s.startOf("month").format("YYYY-MM-DD");
436
- i.months[u] = i.months[u] || [], i.months[u].push(s.clone()), l.has(u) || l.set(u, l.size);
437
- const h = s.startOf("week").format("YYYY-MM-DD");
438
- i.weeks[h] = i.weeks[h] || [], i.weeks[h].push(s.clone()), o.has(h) || o.set(h, o.size), i.days.push(s.clone()), this.dayPositionCache.set(s.format("YYYY-MM-DD"), r), r++, s = s.add(1, "day");
435
+ const h = s.startOf("month").format("YYYY-MM-DD");
436
+ i.months[h] = i.months[h] || [], i.months[h].push(s.clone()), l.has(h) || l.set(h, l.size);
437
+ const u = s.startOf("week").format("YYYY-MM-DD");
438
+ i.weeks[u] = i.weeks[u] || [], i.weeks[u].push(s.clone()), o.has(u) || o.set(u, o.size), i.days.push(s.clone()), this.dayPositionCache.set(s.format("YYYY-MM-DD"), r), r++, s = s.add(1, "day");
439
439
  }
440
440
  return o.forEach((m, f) => {
441
441
  this.weekPositionCache.set(f, m);
@@ -571,7 +571,7 @@ class X {
571
571
  return i;
572
572
  }
573
573
  }
574
- class ln {
574
+ class rn {
575
575
  schedulantProps;
576
576
  schedulantView;
577
577
  timelineApi;
@@ -585,32 +585,32 @@ class ln {
585
585
  switch (e.schedulantViewType) {
586
586
  case "Week": {
587
587
  const s = e.start.startOf("week"), i = e.end.endOf("week");
588
- n = new X(s, i);
588
+ n = new K(s, i);
589
589
  break;
590
590
  }
591
591
  case "Month": {
592
592
  const s = e.start.startOf("month"), i = e.end.endOf("month");
593
- n = new X(s, i);
593
+ n = new K(s, i);
594
594
  break;
595
595
  }
596
596
  case "Quarter": {
597
597
  const s = e.start.startOf("quarter"), i = e.end.endOf("quarter");
598
- n = new X(s, i);
598
+ n = new K(s, i);
599
599
  break;
600
600
  }
601
601
  case "Year": {
602
602
  const s = e.start.startOf("year"), i = e.end.endOf("year");
603
- n = new X(s, i);
603
+ n = new K(s, i);
604
604
  break;
605
605
  }
606
606
  default:
607
- n = new X(e.start, e.end);
607
+ n = new K(e.start, e.end);
608
608
  break;
609
609
  }
610
610
  return n.setSpecialWorkdays(e.specialWorkdays || []), n.setCompanyHolidays(e.companyHolidays || []), n.setNationalHolidays(e.nationalHolidays || []), n;
611
611
  }
612
612
  constructor(e, n) {
613
- this.eventApis = n.events.map((s) => new nn(s)), this.milestoneApis = n.milestones?.map((s) => new rn(s)) || [], this.checkpointApis = n.checkpoints?.map((s) => new on(s)) || [], this.schedulantProps = n, this.schedulantView = e, this.timelineApi = this.generateTimelineApi(n), this.resourceApis = le.createTree(n.resources, this.eventApis, this.milestoneApis, this.checkpointApis), this.flatMapResourceApis = le.flatMapTree(this.resourceApis);
613
+ this.eventApis = n.events.map((s) => new en(s)), this.milestoneApis = n.milestones?.map((s) => new nn(s)) || [], this.checkpointApis = n.checkpoints?.map((s) => new sn(s)) || [], this.schedulantProps = n, this.schedulantView = e, this.timelineApi = this.generateTimelineApi(n), this.resourceApis = le.createTree(n.resources, this.eventApis, this.milestoneApis, this.checkpointApis), this.flatMapResourceApis = le.flatMapTree(this.resourceApis);
614
614
  }
615
615
  updateProps(e) {
616
616
  this.schedulantProps = e;
@@ -812,8 +812,8 @@ class ln {
812
812
  return this.schedulantProps.onResourceSelect;
813
813
  }
814
814
  }
815
- const an = (t, e, n) => {
816
- L(() => {
815
+ const on = (t, e, n) => {
816
+ N(() => {
817
817
  const s = t.current;
818
818
  if (s)
819
819
  return n.resourceLabelDidMount({
@@ -826,36 +826,36 @@ const an = (t, e, n) => {
826
826
  });
827
827
  };
828
828
  }, [t, e, n]);
829
- }, H = ({ condition: t, children: e, fallback: n }) => /* @__PURE__ */ a(Mt, { children: t ? e : n }), cn = (t, e, n) => {
830
- const s = k(-1), i = C(() => _e("schedulant-datagrid-head"), []), r = C(() => _e("schedulant-datagrid-body"), []), o = C((u) => {
831
- u.preventDefault();
832
- const h = n.current;
833
- if (h) {
834
- const A = h.getBoundingClientRect(), p = u.clientX - A.left;
835
- h.style.width = w(p), t({ type: "SET_RESOURCE_AREA_WIDTH", width: h.style.width });
829
+ }, H = ({ condition: t, children: e, fallback: n }) => /* @__PURE__ */ a(At, { children: t ? e : n }), ln = (t, e, n) => {
830
+ const s = k(-1), i = C(() => We("schedulant-datagrid-head"), []), r = C(() => We("schedulant-datagrid-body"), []), o = C((h) => {
831
+ h.preventDefault();
832
+ const u = n.current;
833
+ if (u) {
834
+ const A = u.getBoundingClientRect(), p = h.clientX - A.left;
835
+ u.style.width = w(p), t({ type: "SET_RESOURCE_AREA_WIDTH", width: u.style.width });
836
836
  }
837
- }, [t, n]), l = C((u) => {
838
- u.preventDefault();
839
- const h = e.current;
840
- h ? h.removeEventListener("mousemove", o) : console.error("scheduleEl", h);
841
- }, [o, e]), c = C((u) => {
842
- u.preventDefault();
843
- const h = e.current;
844
- h ? h.addEventListener("mousemove", o) : console.error("scheduleEl", h);
845
- }, [o, e]), d = C((u) => {
846
- u.preventDefault();
847
- const h = s.current, A = i(), p = r(), S = A.firstElementChild, b = p.firstElementChild, g = S?.children, y = b?.children;
837
+ }, [t, n]), l = C((h) => {
838
+ h.preventDefault();
839
+ const u = e.current;
840
+ u ? u.removeEventListener("mousemove", o) : console.error("scheduleEl", u);
841
+ }, [o, e]), c = C((h) => {
842
+ h.preventDefault();
843
+ const u = e.current;
844
+ u ? u.addEventListener("mousemove", o) : console.error("scheduleEl", u);
845
+ }, [o, e]), d = C((h) => {
846
+ h.preventDefault();
847
+ const u = s.current, A = i(), p = r(), S = A.firstElementChild, b = p.firstElementChild, g = S?.children, y = b?.children;
848
848
  if (g && y) {
849
- const v = g[h], M = y[h], T = u.clientX - v.getBoundingClientRect().left, D = u.clientX - M.getBoundingClientRect().left;
850
- v.style.width = w(T), M.style.width = w(D);
849
+ const v = g[u], M = y[u], D = h.clientX - v.getBoundingClientRect().left, T = h.clientX - M.getBoundingClientRect().left;
850
+ v.style.width = w(D), M.style.width = w(T);
851
851
  }
852
- }, [r, i, s]), m = C((u) => {
853
- u.preventDefault(), s.current = -1;
854
- const h = i(), A = r();
855
- h.removeEventListener("mousemove", d), A.removeEventListener("mousemove", d);
856
- }, [s, i, r, d]), f = C((u) => (h) => {
857
- h.preventDefault();
858
- const A = u.current?.parentElement, p = u.current?.parentElement?.parentElement;
852
+ }, [r, i, s]), m = C((h) => {
853
+ h.preventDefault(), s.current = -1;
854
+ const u = i(), A = r();
855
+ u.removeEventListener("mousemove", d), A.removeEventListener("mousemove", d);
856
+ }, [s, i, r, d]), f = C((h) => (u) => {
857
+ u.preventDefault();
858
+ const A = h.current?.parentElement, p = h.current?.parentElement?.parentElement;
859
859
  if (p) {
860
860
  let S = p.getElementsByTagName("td");
861
861
  S.length === 0 && (S = p.getElementsByTagName("th"));
@@ -872,10 +872,10 @@ const an = (t, e, n) => {
872
872
  datagridCellResizerMouseUp: m,
873
873
  datagridCellResizerMouseDownFunc: f
874
874
  };
875
- }, dn = (t) => {
875
+ }, an = (t) => {
876
876
  const e = k(null);
877
- return an(e, t.resourceAreaColumn, t.schedulantApi), /* @__PURE__ */ a("th", { role: "columnheader", className: "schedulant-datagrid-cell", children: /* @__PURE__ */ a(
878
- K,
877
+ return on(e, t.resourceAreaColumn, t.schedulantApi), /* @__PURE__ */ a("th", { role: "columnheader", className: "schedulant-datagrid-cell", children: /* @__PURE__ */ a(
878
+ Z,
879
879
  {
880
880
  disabled: !t.schedulantApi.isEnableResourceLabelContextMenu(),
881
881
  destroyOnHidden: !0,
@@ -911,8 +911,8 @@ const an = (t, e, n) => {
911
911
  ] })
912
912
  }
913
913
  ) });
914
- }, un = (t, e, n, s) => {
915
- L(() => {
914
+ }, cn = (t, e, n, s) => {
915
+ N(() => {
916
916
  const i = t.current;
917
917
  if (i)
918
918
  return n.resourceLaneDidMount({
@@ -929,49 +929,69 @@ const an = (t, e, n) => {
929
929
  });
930
930
  };
931
931
  }, [t, e, n, s]);
932
- }, Y = /* @__PURE__ */ new Set();
933
- let Q = null;
934
- function mt() {
932
+ }, dn = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
933
+ "svg",
934
+ {
935
+ className: "milestone-icon",
936
+ viewBox: "0 0 1024 1024",
937
+ version: "1.1",
938
+ xmlns: "http://www.w3.org/2000/svg",
939
+ width: `${w(t.width)}`,
940
+ height: `${w(t.height)}`,
941
+ children: /* @__PURE__ */ a(
942
+ "path",
943
+ {
944
+ d: "M156 64v896l356-280 356 280V64H156z m511.8 556.4L512 538.5l-155.7 81.9L386 447 260 324.2l174.1-25.3L512 141.1l77.9 157.8L764 324.2 638 447l29.8 173.4z",
945
+ fill: t.color
946
+ }
947
+ )
948
+ }
949
+ ), ...t }), L = /* @__PURE__ */ new Set();
950
+ let G = null;
951
+ function Re() {
935
952
  document.querySelectorAll(".schedulant-resource-selected").forEach((t) => t.classList.remove("schedulant-resource-selected"));
936
- for (const t of Y)
953
+ for (const t of L)
937
954
  document.querySelectorAll(`[data-resource-id="${t}"].schedulant-resource`).forEach((e) => e.classList.add("schedulant-resource-selected"));
938
955
  }
939
- function gt(t) {
940
- t?.(Array.from(Y));
956
+ function ke(t) {
957
+ t?.(Array.from(L));
941
958
  }
942
- function ft() {
943
- return Y;
959
+ function mt() {
960
+ return L;
944
961
  }
945
- function Te(t) {
946
- Y.size !== 0 && (Y.clear(), Q = null, mt(), gt(t));
962
+ function De(t) {
963
+ L.size !== 0 && (L.clear(), G = null, Re(), ke(t));
964
+ }
965
+ function un(t, e) {
966
+ L.clear(), L.add(t), G = t, Re(), ke(e);
947
967
  }
948
968
  function hn(t, e, n) {
949
969
  const i = t.target.closest("[data-resource-id]");
950
970
  if (!i) {
951
- Te(n);
971
+ De(n);
952
972
  return;
953
973
  }
954
974
  const r = i.getAttribute("data-resource-id");
955
975
  if (!r) {
956
- Te(n);
976
+ De(n);
957
977
  return;
958
978
  }
959
- if (t.button === 2 && Y.has(r))
979
+ if (t.button === 2 && L.has(r))
960
980
  return;
961
981
  const o = t.ctrlKey || t.metaKey;
962
- if (t.shiftKey && Q) {
963
- const c = e.indexOf(Q), d = e.indexOf(r);
982
+ if (t.shiftKey && G) {
983
+ const c = e.indexOf(G), d = e.indexOf(r);
964
984
  if (c !== -1 && d !== -1) {
965
985
  const m = Math.min(c, d), f = Math.max(c, d);
966
- o || Y.clear();
967
- for (let u = m; u <= f; u++)
968
- Y.add(e[u]);
986
+ o || L.clear();
987
+ for (let h = m; h <= f; h++)
988
+ L.add(e[h]);
969
989
  }
970
- } else o ? (Y.has(r) ? Y.delete(r) : Y.add(r), Q = r) : (Y.clear(), Y.add(r), Q = r);
971
- mt(), gt(n);
990
+ } else o ? (L.has(r) ? L.delete(r) : L.add(r), G = r) : (L.clear(), L.add(r), G = r);
991
+ Re(), ke(n);
972
992
  }
973
993
  function mn(t, e, n) {
974
- const s = ft();
994
+ const s = mt();
975
995
  return s.size > 1 && s.has(e.getId()) ? {
976
996
  items: t.getResourceLaneMultiSelectContextMenuItems(),
977
997
  onClick: (r) => {
@@ -999,7 +1019,7 @@ function mn(t, e, n) {
999
1019
  };
1000
1020
  }
1001
1021
  const gn = (t) => {
1002
- const { dispatch: e } = De(), n = k(null), i = t.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(t.resourceApi), r = C((y, v) => {
1022
+ const { dispatch: e } = Te(), n = k(null), i = t.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(t.resourceApi), r = C((y, v) => {
1003
1023
  const M = v.getResource();
1004
1024
  if (Object.keys(M).includes(y)) {
1005
1025
  const I = M[y];
@@ -1012,14 +1032,14 @@ const gn = (t) => {
1012
1032
  }
1013
1033
  return "";
1014
1034
  }, []);
1015
- un(n, t.resourceAreaColumn, t.schedulantApi, t.resourceApi);
1016
- const o = t.resourceApi.getId(), l = !t.isDraggable || !t.showPlusSquare, { attributes: c, listeners: d, setNodeRef: m, isDragging: f } = Lt({
1035
+ cn(n, t.resourceAreaColumn, t.schedulantApi, t.resourceApi);
1036
+ const o = t.resourceApi.getId(), l = !t.isDraggable || !t.showPlusSquare, { attributes: c, listeners: d, setNodeRef: m, isDragging: f } = It({
1017
1037
  id: o,
1018
1038
  disabled: l,
1019
1039
  transition: null
1020
- }), u = t.overId === o && t.activeId !== o, h = () => {
1040
+ }), h = t.overId === o && t.activeId !== o, u = () => {
1021
1041
  const y = ["schedulant-datagrid-cell", "schedulant-resource"];
1022
- return ft().has(o) && y.push("schedulant-resource-selected"), t.isDraggable && f && y.push("schedulant-resource-dragging"), t.isDraggable && u && t.dropPosition && y.push(`schedulant-resource-drop-${t.dropPosition}`), y.join(" ");
1042
+ return mt().has(o) && y.push("schedulant-resource-selected"), t.isDraggable && f && y.push("schedulant-resource-dragging"), t.isDraggable && h && t.dropPosition && y.push(`schedulant-resource-drop-${t.dropPosition}`), y.join(" ");
1023
1043
  }, [A, p] = re(!1), [S, b] = re({}), g = C((y) => {
1024
1044
  y && b(mn(t.schedulantApi, t.resourceApi, t.resourceAreaColumn)), p(y);
1025
1045
  }, [t.schedulantApi, t.resourceApi, t.resourceAreaColumn]);
@@ -1028,10 +1048,10 @@ const gn = (t) => {
1028
1048
  {
1029
1049
  ref: m,
1030
1050
  "data-resource-id": t.resourceApi.getId(),
1031
- className: h(),
1051
+ className: u(),
1032
1052
  ...l ? {} : { ...c, ...d },
1033
1053
  children: /* @__PURE__ */ a(
1034
- K,
1054
+ Z,
1035
1055
  {
1036
1056
  disabled: !t.schedulantApi.isEnableResourceLaneContextMenu(),
1037
1057
  destroyOnHidden: !0,
@@ -1046,7 +1066,7 @@ const gn = (t) => {
1046
1066
  style: { height: w(i) },
1047
1067
  ref: n,
1048
1068
  children: [
1049
- /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-cushion schedulant-scrollgrid-sync-inner", children: /* @__PURE__ */ O(It, { size: "small", children: [
1069
+ /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-cushion schedulant-scrollgrid-sync-inner", children: /* @__PURE__ */ O(kt, { size: "small", children: [
1050
1070
  t.showPlusSquare && /* @__PURE__ */ O(
1051
1071
  "span",
1052
1072
  {
@@ -1054,7 +1074,7 @@ const gn = (t) => {
1054
1074
  children: [
1055
1075
  t.showIndentation && Array.from({ length: t.resourceApi.getDepth() }, (y, v) => /* @__PURE__ */ a("span", { className: "schedulant-icon" }, v + 1)),
1056
1076
  /* @__PURE__ */ a("span", { className: "schedulant-icon", children: t.collapseIds.some((y) => y === t.resourceApi.getId()) ? /* @__PURE__ */ a(
1057
- Ot,
1077
+ xt,
1058
1078
  {
1059
1079
  onClick: () => e({
1060
1080
  type: "EXPAND_RESOURCE",
@@ -1062,7 +1082,7 @@ const gn = (t) => {
1062
1082
  })
1063
1083
  }
1064
1084
  ) : t.resourceApi.getChildren().length > 0 ? /* @__PURE__ */ a(
1065
- Pt,
1085
+ Ot,
1066
1086
  {
1067
1087
  onClick: () => e({
1068
1088
  type: "COLLAPSE_RESOURCE",
@@ -1073,7 +1093,10 @@ const gn = (t) => {
1073
1093
  ]
1074
1094
  }
1075
1095
  ),
1076
- /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-main", children: r(t.resourceAreaColumn.field, t.resourceApi) })
1096
+ /* @__PURE__ */ O("div", { className: "schedulant-datagrid-cell-main", children: [
1097
+ r(t.resourceAreaColumn.field, t.resourceApi),
1098
+ t.showPlusSquare && t.resourceApi.getMilestoneApis().length > 0 && /* @__PURE__ */ a("span", { className: "schedulant-milestone-indicator", children: /* @__PURE__ */ a(dn, { width: 14, height: 14, color: "#91003c" }) })
1099
+ ] })
1077
1100
  ] }) }),
1078
1101
  /* @__PURE__ */ a(H, { condition: t.isResizable, children: /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-resizer", onMouseUp: t.cellResizerMouseUp, onMouseDown: t.cellResizerMouseDownFunc(n) }) })
1079
1102
  ]
@@ -1083,9 +1106,9 @@ const gn = (t) => {
1083
1106
  )
1084
1107
  }
1085
1108
  );
1086
- }, fn = (t) => /* @__PURE__ */ a("colgroup", { children: t.resourceAreaColumns.map((e) => /* @__PURE__ */ a("col", { style: { minWidth: Zt } }, e.field)) }), pn = () => /* @__PURE__ */ a("div", { className: "schedulant-timeline-lane" }), yn = (t, e, n) => {
1109
+ }, fn = (t) => /* @__PURE__ */ a("colgroup", { children: t.resourceAreaColumns.map((e) => /* @__PURE__ */ a("col", { style: { minWidth: Qt } }, e.field)) }), pn = () => /* @__PURE__ */ a("div", { className: "schedulant-timeline-lane" }), yn = (t, e, n) => {
1087
1110
  const s = n.getStart(), i = n.getEnd(), r = i.isBefore(E(), "day"), o = s.isAfter(E(), "day"), l = s.isSameOrBefore(E(), "day") && (i.isAfter(E(), "day") || i.isSame(E(), "day"));
1088
- return L(() => {
1111
+ return N(() => {
1089
1112
  const c = t.current;
1090
1113
  if (c)
1091
1114
  return e.eventDidMount({
@@ -1111,43 +1134,43 @@ var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1111
1134
  function vn(t) {
1112
1135
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1113
1136
  }
1114
- var ue, ze;
1115
- function Re() {
1116
- if (ze) return ue;
1117
- ze = 1;
1137
+ var ue, Ve;
1138
+ function xe() {
1139
+ if (Ve) return ue;
1140
+ Ve = 1;
1118
1141
  function t(e) {
1119
1142
  var n = typeof e;
1120
1143
  return e != null && (n == "object" || n == "function");
1121
1144
  }
1122
1145
  return ue = t, ue;
1123
1146
  }
1124
- var he, Ve;
1147
+ var he, Fe;
1125
1148
  function Sn() {
1126
- if (Ve) return he;
1127
- Ve = 1;
1149
+ if (Fe) return he;
1150
+ Fe = 1;
1128
1151
  var t = typeof se == "object" && se && se.Object === Object && se;
1129
1152
  return he = t, he;
1130
1153
  }
1131
- var me, Fe;
1132
- function pt() {
1133
- if (Fe) return me;
1134
- Fe = 1;
1154
+ var me, Be;
1155
+ function gt() {
1156
+ if (Be) return me;
1157
+ Be = 1;
1135
1158
  var t = Sn(), e = typeof self == "object" && self && self.Object === Object && self, n = t || e || Function("return this")();
1136
1159
  return me = n, me;
1137
1160
  }
1138
- var ge, Be;
1161
+ var ge, qe;
1139
1162
  function An() {
1140
- if (Be) return ge;
1141
- Be = 1;
1142
- var t = pt(), e = function() {
1163
+ if (qe) return ge;
1164
+ qe = 1;
1165
+ var t = gt(), e = function() {
1143
1166
  return t.Date.now();
1144
1167
  };
1145
1168
  return ge = e, ge;
1146
1169
  }
1147
- var fe, qe;
1170
+ var fe, Ue;
1148
1171
  function bn() {
1149
- if (qe) return fe;
1150
- qe = 1;
1172
+ if (Ue) return fe;
1173
+ Ue = 1;
1151
1174
  var t = /\s/;
1152
1175
  function e(n) {
1153
1176
  for (var s = n.length; s-- && t.test(n.charAt(s)); )
@@ -1156,28 +1179,28 @@ function bn() {
1156
1179
  }
1157
1180
  return fe = e, fe;
1158
1181
  }
1159
- var pe, Ue;
1182
+ var pe, je;
1160
1183
  function Mn() {
1161
- if (Ue) return pe;
1162
- Ue = 1;
1184
+ if (je) return pe;
1185
+ je = 1;
1163
1186
  var t = bn(), e = /^\s+/;
1164
1187
  function n(s) {
1165
1188
  return s && s.slice(0, t(s) + 1).replace(e, "");
1166
1189
  }
1167
1190
  return pe = n, pe;
1168
1191
  }
1169
- var ye, je;
1170
- function yt() {
1171
- if (je) return ye;
1172
- je = 1;
1173
- var t = pt(), e = t.Symbol;
1192
+ var ye, $e;
1193
+ function ft() {
1194
+ if ($e) return ye;
1195
+ $e = 1;
1196
+ var t = gt(), e = t.Symbol;
1174
1197
  return ye = e, ye;
1175
1198
  }
1176
- var ve, $e;
1199
+ var ve, Ge;
1177
1200
  function wn() {
1178
- if ($e) return ve;
1179
- $e = 1;
1180
- var t = yt(), e = Object.prototype, n = e.hasOwnProperty, s = e.toString, i = t ? t.toStringTag : void 0;
1201
+ if (Ge) return ve;
1202
+ Ge = 1;
1203
+ var t = ft(), e = Object.prototype, n = e.hasOwnProperty, s = e.toString, i = t ? t.toStringTag : void 0;
1181
1204
  function r(o) {
1182
1205
  var l = n.call(o, i), c = o[i];
1183
1206
  try {
@@ -1190,50 +1213,50 @@ function wn() {
1190
1213
  }
1191
1214
  return ve = r, ve;
1192
1215
  }
1193
- var Se, Ge;
1216
+ var Se, Xe;
1194
1217
  function En() {
1195
- if (Ge) return Se;
1196
- Ge = 1;
1218
+ if (Xe) return Se;
1219
+ Xe = 1;
1197
1220
  var t = Object.prototype, e = t.toString;
1198
1221
  function n(s) {
1199
1222
  return e.call(s);
1200
1223
  }
1201
1224
  return Se = n, Se;
1202
1225
  }
1203
- var Ae, Xe;
1226
+ var Ae, Qe;
1204
1227
  function Cn() {
1205
- if (Xe) return Ae;
1206
- Xe = 1;
1207
- var t = yt(), e = wn(), n = En(), s = "[object Null]", i = "[object Undefined]", r = t ? t.toStringTag : void 0;
1228
+ if (Qe) return Ae;
1229
+ Qe = 1;
1230
+ var t = ft(), e = wn(), n = En(), s = "[object Null]", i = "[object Undefined]", r = t ? t.toStringTag : void 0;
1208
1231
  function o(l) {
1209
1232
  return l == null ? l === void 0 ? i : s : r && r in Object(l) ? e(l) : n(l);
1210
1233
  }
1211
1234
  return Ae = o, Ae;
1212
1235
  }
1213
- var be, Qe;
1214
- function Tn() {
1215
- if (Qe) return be;
1216
- Qe = 1;
1236
+ var be, Ke;
1237
+ function Dn() {
1238
+ if (Ke) return be;
1239
+ Ke = 1;
1217
1240
  function t(e) {
1218
1241
  return e != null && typeof e == "object";
1219
1242
  }
1220
1243
  return be = t, be;
1221
1244
  }
1222
- var Me, Ke;
1223
- function Dn() {
1224
- if (Ke) return Me;
1225
- Ke = 1;
1226
- var t = Cn(), e = Tn(), n = "[object Symbol]";
1245
+ var Me, Ze;
1246
+ function Tn() {
1247
+ if (Ze) return Me;
1248
+ Ze = 1;
1249
+ var t = Cn(), e = Dn(), n = "[object Symbol]";
1227
1250
  function s(i) {
1228
1251
  return typeof i == "symbol" || e(i) && t(i) == n;
1229
1252
  }
1230
1253
  return Me = s, Me;
1231
1254
  }
1232
- var we, Ze;
1255
+ var we, Je;
1233
1256
  function Rn() {
1234
- if (Ze) return we;
1235
- Ze = 1;
1236
- var t = Mn(), e = Re(), n = Dn(), s = NaN, i = /^[-+]0x[0-9a-f]+$/i, r = /^0b[01]+$/i, o = /^0o[0-7]+$/i, l = parseInt;
1257
+ if (Je) return we;
1258
+ Je = 1;
1259
+ var t = Mn(), e = xe(), n = Tn(), s = NaN, i = /^[-+]0x[0-9a-f]+$/i, r = /^0b[01]+$/i, o = /^0o[0-7]+$/i, l = parseInt;
1237
1260
  function c(d) {
1238
1261
  if (typeof d == "number")
1239
1262
  return d;
@@ -1251,65 +1274,65 @@ function Rn() {
1251
1274
  }
1252
1275
  return we = c, we;
1253
1276
  }
1254
- var Ee, Je;
1277
+ var Ee, et;
1255
1278
  function kn() {
1256
- if (Je) return Ee;
1257
- Je = 1;
1258
- var t = Re(), e = An(), n = Rn(), s = "Expected a function", i = Math.max, r = Math.min;
1279
+ if (et) return Ee;
1280
+ et = 1;
1281
+ var t = xe(), e = An(), n = Rn(), s = "Expected a function", i = Math.max, r = Math.min;
1259
1282
  function o(l, c, d) {
1260
- var m, f, u, h, A, p, S = 0, b = !1, g = !1, y = !0;
1283
+ var m, f, h, u, A, p, S = 0, b = !1, g = !1, y = !0;
1261
1284
  if (typeof l != "function")
1262
1285
  throw new TypeError(s);
1263
- c = n(c) || 0, t(d) && (b = !!d.leading, g = "maxWait" in d, u = g ? i(n(d.maxWait) || 0, c) : u, y = "trailing" in d ? !!d.trailing : y);
1286
+ c = n(c) || 0, t(d) && (b = !!d.leading, g = "maxWait" in d, h = g ? i(n(d.maxWait) || 0, c) : h, y = "trailing" in d ? !!d.trailing : y);
1264
1287
  function v(R) {
1265
1288
  var V = m, q = f;
1266
- return m = f = void 0, S = R, h = l.apply(q, V), h;
1289
+ return m = f = void 0, S = R, u = l.apply(q, V), u;
1267
1290
  }
1268
1291
  function M(R) {
1269
- return S = R, A = setTimeout(I, c), b ? v(R) : h;
1270
- }
1271
- function T(R) {
1272
- var V = R - p, q = R - S, G = c - V;
1273
- return g ? r(G, u - q) : G;
1292
+ return S = R, A = setTimeout(I, c), b ? v(R) : u;
1274
1293
  }
1275
1294
  function D(R) {
1295
+ var V = R - p, q = R - S, Q = c - V;
1296
+ return g ? r(Q, h - q) : Q;
1297
+ }
1298
+ function T(R) {
1276
1299
  var V = R - p, q = R - S;
1277
- return p === void 0 || V >= c || V < 0 || g && q >= u;
1300
+ return p === void 0 || V >= c || V < 0 || g && q >= h;
1278
1301
  }
1279
1302
  function I() {
1280
1303
  var R = e();
1281
- if (D(R))
1304
+ if (T(R))
1282
1305
  return P(R);
1283
- A = setTimeout(I, T(R));
1306
+ A = setTimeout(I, D(R));
1284
1307
  }
1285
1308
  function P(R) {
1286
- return A = void 0, y && m ? v(R) : (m = f = void 0, h);
1309
+ return A = void 0, y && m ? v(R) : (m = f = void 0, u);
1287
1310
  }
1288
- function N() {
1311
+ function Y() {
1289
1312
  A !== void 0 && clearTimeout(A), S = 0, m = p = f = A = void 0;
1290
1313
  }
1291
1314
  function z() {
1292
- return A === void 0 ? h : P(e());
1315
+ return A === void 0 ? u : P(e());
1293
1316
  }
1294
1317
  function _() {
1295
- var R = e(), V = D(R);
1318
+ var R = e(), V = T(R);
1296
1319
  if (m = arguments, f = this, p = R, V) {
1297
1320
  if (A === void 0)
1298
1321
  return M(p);
1299
1322
  if (g)
1300
1323
  return clearTimeout(A), A = setTimeout(I, c), v(p);
1301
1324
  }
1302
- return A === void 0 && (A = setTimeout(I, c)), h;
1325
+ return A === void 0 && (A = setTimeout(I, c)), u;
1303
1326
  }
1304
- return _.cancel = N, _.flush = z, _;
1327
+ return _.cancel = Y, _.flush = z, _;
1305
1328
  }
1306
1329
  return Ee = o, Ee;
1307
1330
  }
1308
- var Ce, et;
1331
+ var Ce, tt;
1309
1332
  function xn() {
1310
- if (et) return Ce;
1311
- et = 1;
1312
- var t = kn(), e = Re(), n = "Expected a function";
1333
+ if (tt) return Ce;
1334
+ tt = 1;
1335
+ var t = kn(), e = xe(), n = "Expected a function";
1313
1336
  function s(i, r, o) {
1314
1337
  var l = !0, c = !0;
1315
1338
  if (typeof i != "function")
@@ -1322,55 +1345,55 @@ function xn() {
1322
1345
  }
1323
1346
  return Ce = s, Ce;
1324
1347
  }
1325
- var In = xn();
1326
- const vt = /* @__PURE__ */ vn(In), On = (t) => {
1348
+ var On = xn();
1349
+ const pt = /* @__PURE__ */ vn(On), In = (t) => {
1327
1350
  const e = F(() => "schedulant-timeline-event-position-guide", []), n = k(0), s = k(0), i = k(0), r = k(!1), o = k("none"), l = C((g) => {
1328
- const M = t.schedulantApi.getScheduleView().getTimelineView(), T = g - n.current, D = t.timelineWidth, I = M.getTotalSlots(), P = Math.round(T / D * I), N = P / I * D;
1329
- return { moveSlots: P, distance: N, deltaX: T };
1351
+ const M = t.schedulantApi.getScheduleView().getTimelineView(), D = g - n.current, T = t.timelineWidth, I = M.getTotalSlots(), P = Math.round(D / T * I), Y = P / I * T;
1352
+ return { moveSlots: P, distance: Y, deltaX: D };
1330
1353
  }, [t]), c = C((g) => {
1331
- const y = t.schedulantApi.getScheduleView().getTimelineView(), v = g.style.left, M = g.style.right, T = y.calculateLaneHeight(t.resourceApi), D = document.createElement("div");
1332
- D.className = e, Object.assign(D.style, {
1354
+ const y = t.schedulantApi.getScheduleView().getTimelineView(), v = g.style.left, M = g.style.right, D = y.calculateLaneHeight(t.resourceApi), T = document.createElement("div");
1355
+ T.className = e, Object.assign(T.style, {
1333
1356
  position: "absolute",
1334
1357
  zIndex: 1,
1335
1358
  left: v,
1336
1359
  right: M,
1337
- height: w(T),
1360
+ height: w(D),
1338
1361
  backgroundColor: t.schedulantApi.getDragHintColor()
1339
- }), g.parentNode?.insertBefore(D, g);
1362
+ }), g.parentNode?.insertBefore(T, g);
1340
1363
  }, [t, e]), d = C((g) => {
1341
1364
  const y = g.previousElementSibling;
1342
1365
  y?.className === e && g.parentElement?.removeChild(y);
1343
1366
  }, [e]), m = C((g, y) => {
1344
1367
  const v = g.previousElementSibling;
1345
1368
  if (v && v.className === e) {
1346
- const M = o.current, { distance: T } = l(y);
1369
+ const M = o.current, { distance: D } = l(y);
1347
1370
  switch (M) {
1348
1371
  case "press_event": {
1349
- v.style.left = w(Math.max(s.current + T, 0)), v.style.right = w(i.current - T);
1372
+ v.style.left = w(Math.max(s.current + D, 0)), v.style.right = w(i.current - D);
1350
1373
  break;
1351
1374
  }
1352
1375
  case "press_event_left": {
1353
- const D = Math.max(s.current + T, 0);
1354
- v.style.left = w(D);
1376
+ const T = Math.max(s.current + D, 0);
1377
+ v.style.left = w(T);
1355
1378
  break;
1356
1379
  }
1357
1380
  case "press_event_right": {
1358
- const D = i.current - T;
1359
- v.style.right = w(D);
1381
+ const T = i.current - D;
1382
+ v.style.right = w(T);
1360
1383
  break;
1361
1384
  }
1362
1385
  }
1363
1386
  }
1364
1387
  }, [l, e]), f = C((g, y) => {
1365
- const v = t.eventApi, M = t.schedulantApi, T = o.current, { moveSlots: D, distance: I } = l(y);
1366
- switch (T) {
1388
+ const v = t.eventApi, M = t.schedulantApi, D = o.current, { moveSlots: T, distance: I } = l(y);
1389
+ switch (D) {
1367
1390
  case "press_event": {
1368
1391
  g.style.left = w(Math.max(s.current + I, 0)), g.style.right = w(i.current - I);
1369
- const P = v.getStart().add(D, "day"), N = v.getEnd().add(D, "day");
1392
+ const P = v.getStart().add(T, "day"), Y = v.getEnd().add(T, "day");
1370
1393
  M.eventMove({
1371
1394
  el: g,
1372
1395
  startDate: P,
1373
- endDate: N,
1396
+ endDate: Y,
1374
1397
  eventApi: v,
1375
1398
  schedulantApi: M
1376
1399
  });
@@ -1379,10 +1402,10 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1379
1402
  case "press_event_left": {
1380
1403
  const P = Math.max(s.current + I, 0);
1381
1404
  g.style.left = w(P);
1382
- const N = v.getStart().add(D, "day");
1405
+ const Y = v.getStart().add(T, "day");
1383
1406
  M.eventResizeStart({
1384
1407
  el: g,
1385
- date: N,
1408
+ date: Y,
1386
1409
  eventApi: v,
1387
1410
  schedulantApi: M
1388
1411
  });
@@ -1391,63 +1414,63 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1391
1414
  case "press_event_right": {
1392
1415
  const P = i.current - I;
1393
1416
  g.style.right = w(P);
1394
- const N = v.getEnd().add(D, "day");
1417
+ const Y = v.getEnd().add(T, "day");
1395
1418
  M.eventResizeEnd({
1396
1419
  el: g,
1397
- date: N,
1420
+ date: Y,
1398
1421
  eventApi: v,
1399
1422
  schedulantApi: M
1400
1423
  });
1401
1424
  break;
1402
1425
  }
1403
1426
  }
1404
- }, [t, l]), u = C((g) => {
1427
+ }, [t, l]), h = C((g) => {
1405
1428
  g.preventDefault();
1406
1429
  const y = r.current, v = t.timelineEventHarnessRef.current;
1407
1430
  if (y && v) {
1408
- const { deltaX: M } = l(g.clientX), T = s.current + M, D = i.current - M;
1431
+ const { deltaX: M } = l(g.clientX), D = s.current + M, T = i.current - M;
1409
1432
  switch (o.current) {
1410
1433
  case "press_event":
1411
- v.style.left = w(T), v.style.right = w(D);
1434
+ v.style.left = w(D), v.style.right = w(T);
1412
1435
  break;
1413
1436
  case "press_event_left":
1414
- v.style.left = w(T);
1437
+ v.style.left = w(D);
1415
1438
  break;
1416
1439
  case "press_event_right":
1417
- v.style.right = w(D);
1440
+ v.style.right = w(T);
1418
1441
  break;
1419
1442
  }
1420
1443
  m(v, g.clientX);
1421
1444
  }
1422
- }, [t.timelineEventHarnessRef, m, l]), h = F(
1423
- () => vt(u, ht),
1424
- [u]
1445
+ }, [t.timelineEventHarnessRef, m, l]), u = F(
1446
+ () => pt(h, ht),
1447
+ [h]
1425
1448
  ), A = C((g, y) => {
1426
1449
  g.preventDefault();
1427
1450
  const v = t.schedulantApi.getSchedulantElRef().current, M = t.timelineEventHarnessRef.current;
1428
- M && v ? (r.current = !0, o.current = y, n.current = g.clientX, s.current = oe(M.style.left), i.current = oe(M.style.right), c(M), v.addEventListener("mousemove", h)) : (console.error("scheduleEl", v), console.error("timelineEventHarness", M));
1429
- }, [t.schedulantApi, t.timelineEventHarnessRef, c, h]), p = C((g) => {
1451
+ M && v ? (r.current = !0, o.current = y, n.current = g.clientX, s.current = oe(M.style.left), i.current = oe(M.style.right), c(M), v.addEventListener("mousemove", u)) : (console.error("scheduleEl", v), console.error("timelineEventHarness", M));
1452
+ }, [t.schedulantApi, t.timelineEventHarnessRef, c, u]), p = C((g) => {
1430
1453
  A(g, "press_event");
1431
1454
  }, [A]), S = C((g) => {
1432
1455
  A(g, "press_event_left");
1433
1456
  }, [A]), b = C((g) => {
1434
1457
  A(g, "press_event_right");
1435
1458
  }, [A]);
1436
- return L(() => {
1459
+ return N(() => {
1437
1460
  const g = t.timelineEventHarnessRef.current, y = t.schedulantApi.getSchedulantElRef().current;
1438
1461
  if (y && g) {
1439
1462
  const v = g.parentElement?.parentElement;
1440
1463
  if (v) {
1441
- const M = (T) => {
1442
- T.preventDefault(), r.current && !v.contains(T.relatedTarget) && (d(g), f(g, T.clientX), y.removeEventListener("mousemove", h), r.current = !1, o.current = "none");
1464
+ const M = (D) => {
1465
+ D.preventDefault(), r.current && !v.contains(D.relatedTarget) && (d(g), f(g, D.clientX), y.removeEventListener("mousemove", u), r.current = !1, o.current = "none");
1443
1466
  };
1444
1467
  return v.addEventListener("mouseup", M), v.addEventListener("mouseout", M), () => {
1445
- v.removeEventListener("mouseup", M), v.removeEventListener("mouseout", M), y.removeEventListener("mousemove", h), h.cancel();
1468
+ v.removeEventListener("mouseup", M), v.removeEventListener("mouseout", M), y.removeEventListener("mousemove", u), u.cancel();
1446
1469
  };
1447
1470
  }
1448
1471
  }
1449
- }, [h, t, d, f]), { handleMouseDown: p, leftHandleMouseDown: S, rightHandleMouseDown: b };
1450
- }, tt = (t) => /* @__PURE__ */ a(Z, { component: () => /* @__PURE__ */ a(
1472
+ }, [u, t, d, f]), { handleMouseDown: p, leftHandleMouseDown: S, rightHandleMouseDown: b };
1473
+ }, nt = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
1451
1474
  "svg",
1452
1475
  {
1453
1476
  className: "triangle-left-icon",
@@ -1464,7 +1487,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1464
1487
  }
1465
1488
  )
1466
1489
  }
1467
- ), ...t }), nt = (t) => /* @__PURE__ */ a(Z, { component: () => /* @__PURE__ */ a(
1490
+ ), ...t }), st = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
1468
1491
  "svg",
1469
1492
  {
1470
1493
  className: "drag-icon",
@@ -1475,7 +1498,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1475
1498
  height: `${w(t.height)}`,
1476
1499
  children: /* @__PURE__ */ a("path", { d: "M368 0h32v1024h-32zM496 0h32v1024h-32zM624 0h32v1024h-32z", fill: t.color })
1477
1500
  }
1478
- ), ...t }), st = (t) => /* @__PURE__ */ a(Z, { component: () => /* @__PURE__ */ a(
1501
+ ), ...t }), it = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
1479
1502
  "svg",
1480
1503
  {
1481
1504
  className: "triangle-left-icon",
@@ -1493,7 +1516,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1493
1516
  )
1494
1517
  }
1495
1518
  ), ...t }), Pn = ae((t) => {
1496
- const e = k(null), n = k(null), s = t.schedulantApi.getTimelineApi(), i = t.schedulantApi.getScheduleView().getTimelineView(), r = t.eventApi.getTextColor().getOrElse("white"), o = t.eventApi.getBorderColor().getOrElse(t.eventApi.getColor()), l = t.eventApi.getBackgroundColor().getOrElse(t.eventApi.getColor()), c = i.calculateLaneHeight(t.resourceApi), d = i.calculateEventHeight(), m = (c - d) / 2 - 1, { isPast: f, isFuture: u, isProcess: h } = yn(e, t.schedulantApi, t.eventApi), { handleMouseDown: A, leftHandleMouseDown: p, rightHandleMouseDown: S } = On({
1519
+ const e = k(null), n = k(null), s = t.schedulantApi.getTimelineApi(), i = t.schedulantApi.getScheduleView().getTimelineView(), r = t.eventApi.getTextColor().getOrElse("white"), o = t.eventApi.getBorderColor().getOrElse(t.eventApi.getColor()), l = t.eventApi.getBackgroundColor().getOrElse(t.eventApi.getColor()), c = i.calculateLaneHeight(t.resourceApi), d = i.calculateEventHeight(), m = (c - d) / 2 - 1, { isPast: f, isFuture: h, isProcess: u } = yn(e, t.schedulantApi, t.eventApi), { handleMouseDown: A, leftHandleMouseDown: p, rightHandleMouseDown: S } = In({
1497
1520
  timelineEventHarnessRef: n,
1498
1521
  timelineWidth: t.timelineWidth,
1499
1522
  eventApi: t.eventApi,
@@ -1507,7 +1530,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1507
1530
  left: w(t.position.left),
1508
1531
  right: w(t.position.right)
1509
1532
  }, children: /* @__PURE__ */ a(
1510
- K,
1533
+ Z,
1511
1534
  {
1512
1535
  disabled: !t.schedulantApi.isEnableEventContextMenu(),
1513
1536
  destroyOnHidden: !0,
@@ -1521,8 +1544,8 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1521
1544
  keyPath: y,
1522
1545
  domEvent: v,
1523
1546
  isPast: f,
1524
- isFuture: u,
1525
- isProcess: h,
1547
+ isFuture: h,
1548
+ isProcess: u,
1526
1549
  eventApi: t.eventApi,
1527
1550
  schedulantApi: t.schedulantApi
1528
1551
  });
@@ -1544,21 +1567,21 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1544
1567
  {
1545
1568
  condition: t.eventApi.getStart().isBefore(s.getStart()),
1546
1569
  fallback: /* @__PURE__ */ a("div", { style: { width: W, height: d } }),
1547
- children: /* @__PURE__ */ a(tt, { width: W, height: d, color: "#FFFFFF" })
1570
+ children: /* @__PURE__ */ a(nt, { width: W, height: d, color: "#FFFFFF" })
1548
1571
  }
1549
1572
  ),
1550
1573
  children: /* @__PURE__ */ a(
1551
1574
  H,
1552
1575
  {
1553
1576
  condition: !t.eventApi.getStart().isBefore(s.getStart()),
1554
- fallback: /* @__PURE__ */ a(tt, { width: W, height: d, color: "#FFFFFF" }),
1577
+ fallback: /* @__PURE__ */ a(nt, { width: W, height: d, color: "#FFFFFF" }),
1555
1578
  children: /* @__PURE__ */ a(
1556
1579
  "div",
1557
1580
  {
1558
1581
  className: "schedulant-event-resize-handle",
1559
1582
  onMouseDown: p,
1560
1583
  style: { width: W, height: d, cursor: "ew-resize" },
1561
- children: /* @__PURE__ */ a(nt, { width: W, height: d, color: "#FFFFFF" })
1584
+ children: /* @__PURE__ */ a(st, { width: W, height: d, color: "#FFFFFF" })
1562
1585
  }
1563
1586
  )
1564
1587
  }
@@ -1625,21 +1648,21 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1625
1648
  {
1626
1649
  condition: t.eventApi.getEnd().isAfter(s.getEnd()),
1627
1650
  fallback: /* @__PURE__ */ a("div", { style: { width: W, height: d } }),
1628
- children: /* @__PURE__ */ a(st, { width: W, height: d, color: "#FFFFFF" })
1651
+ children: /* @__PURE__ */ a(it, { width: W, height: d, color: "#FFFFFF" })
1629
1652
  }
1630
1653
  ),
1631
1654
  children: /* @__PURE__ */ a(
1632
1655
  H,
1633
1656
  {
1634
1657
  condition: t.eventApi.getEnd().isSameOrBefore(s.getEnd()),
1635
- fallback: /* @__PURE__ */ a(st, { width: W, height: d, color: "#FFFFFF" }),
1658
+ fallback: /* @__PURE__ */ a(it, { width: W, height: d, color: "#FFFFFF" }),
1636
1659
  children: /* @__PURE__ */ a(
1637
1660
  "div",
1638
1661
  {
1639
1662
  className: "schedulant-event-resize-handle",
1640
1663
  onMouseDown: S,
1641
1664
  style: { width: W, height: d, cursor: "ew-resize" },
1642
- children: /* @__PURE__ */ a(nt, { width: W, height: d, color: "#FFFFFF" })
1665
+ children: /* @__PURE__ */ a(st, { width: W, height: d, color: "#FFFFFF" })
1643
1666
  }
1644
1667
  )
1645
1668
  }
@@ -1653,7 +1676,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1653
1676
  ) });
1654
1677
  }), Ln = (t, e, n) => {
1655
1678
  const s = n.getTime(), i = s.isBefore(E(), "day"), r = s.isAfter(E(), "day"), o = s.isSame(E(), "day");
1656
- return L(() => {
1679
+ return N(() => {
1657
1680
  const l = t.current;
1658
1681
  if (l)
1659
1682
  return e.milestoneDidMount({
@@ -1674,7 +1697,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1674
1697
  });
1675
1698
  };
1676
1699
  }, [e, n, t, i, r, o]), { isPast: i, isFuture: r, isProcess: o };
1677
- }, St = (t) => {
1700
+ }, yt = (t) => {
1678
1701
  const e = F(() => "schedulant-timeline-marker-position-guide", []), n = k(0), s = k(0), i = k(0), r = k(!1), o = C((p) => {
1679
1702
  const S = p.style.left, b = p.style.right, g = t.schedulantApi.getScheduleView().getTimelineView(), y = t.milestoneApi?.getResourceApi() ?? t.checkpointApi?.getResourceApi(), v = g.calculateLaneHeight(y), M = document.createElement("div");
1680
1703
  M.className = e, Object.assign(M.style, {
@@ -1689,10 +1712,10 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1689
1712
  const S = p.previousElementSibling;
1690
1713
  S?.className === e && p.parentElement?.removeChild(S);
1691
1714
  }, [e]), c = C((p) => {
1692
- const g = t.schedulantApi.getScheduleView().getTimelineView(), y = p - n.current, v = t.timelineWidth, M = g.getTotalSlots(), T = Math.round(y / v * M), D = T / M * t.timelineWidth;
1715
+ const g = t.schedulantApi.getScheduleView().getTimelineView(), y = p - n.current, v = t.timelineWidth, M = g.getTotalSlots(), D = Math.round(y / v * M), T = D / M * t.timelineWidth;
1693
1716
  return {
1694
- moveSlots: T,
1695
- distance: D,
1717
+ moveSlots: D,
1718
+ distance: T,
1696
1719
  deltaX: y,
1697
1720
  totalWidth: v,
1698
1721
  totalSlots: M
@@ -1730,33 +1753,33 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1730
1753
  const g = p.clientX - n.current, y = s.current + g, v = i.current - g;
1731
1754
  S.style.left = w(y), S.style.right = w(v), d(S, p.clientX);
1732
1755
  }
1733
- }, [t.markerRef, d]), u = F(
1734
- () => vt(f, ht),
1756
+ }, [t.markerRef, d]), h = F(
1757
+ () => pt(f, ht),
1735
1758
  [f]
1736
- ), h = C((p) => {
1759
+ ), u = C((p) => {
1737
1760
  p.preventDefault();
1738
1761
  const S = t.markerRef.current, b = r.current, g = t.schedulantApi.getSchedulantElRef().current;
1739
- b && g && S && (l(S), m(S, p.clientX), g.removeEventListener("mousemove", u), r.current = !1);
1740
- }, [u, t.markerRef, t.schedulantApi, l, m]), A = C((p) => {
1762
+ b && g && S && (l(S), m(S, p.clientX), g.removeEventListener("mousemove", h), r.current = !1);
1763
+ }, [h, t.markerRef, t.schedulantApi, l, m]), A = C((p) => {
1741
1764
  p.preventDefault();
1742
1765
  const S = t.schedulantApi.getSchedulantElRef().current, b = t.markerRef.current;
1743
- S && b && (r.current = !0, n.current = p.clientX, s.current = oe(b.style.left), i.current = oe(b.style.right), o(b), S.addEventListener("mousemove", u));
1744
- }, [o, u, t.markerRef, t.schedulantApi]);
1745
- return L(() => {
1766
+ S && b && (r.current = !0, n.current = p.clientX, s.current = oe(b.style.left), i.current = oe(b.style.right), o(b), S.addEventListener("mousemove", h));
1767
+ }, [o, h, t.markerRef, t.schedulantApi]);
1768
+ return N(() => {
1746
1769
  const p = t.schedulantApi.getSchedulantElRef().current, S = t.markerRef.current;
1747
1770
  if (p && S) {
1748
1771
  const b = S.parentElement?.parentElement;
1749
1772
  if (b) {
1750
1773
  const g = (y) => {
1751
- y.preventDefault(), r.current && !b.contains(y.relatedTarget) && (l(S), m(S, y.clientX), p.removeEventListener("mousemove", u), r.current = !1);
1774
+ y.preventDefault(), r.current && !b.contains(y.relatedTarget) && (l(S), m(S, y.clientX), p.removeEventListener("mousemove", h), r.current = !1);
1752
1775
  };
1753
1776
  return b.addEventListener("mouseup", g), b.addEventListener("mouseout", g), () => {
1754
- b.removeEventListener("mouseup", g), b.removeEventListener("mouseout", g), p.removeEventListener("mousemove", u), u.cancel();
1777
+ b.removeEventListener("mouseup", g), b.removeEventListener("mouseout", g), p.removeEventListener("mousemove", h), h.cancel();
1755
1778
  };
1756
1779
  }
1757
1780
  }
1758
- }, [u, t, l, m]), { handleMouseUp: h, handleMouseDown: A };
1759
- }, Nn = (t) => /* @__PURE__ */ a(Z, { component: () => /* @__PURE__ */ O(
1781
+ }, [h, t, l, m]), { handleMouseUp: u, handleMouseDown: A };
1782
+ }, Nn = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ O(
1760
1783
  "svg",
1761
1784
  {
1762
1785
  className: "flag-icon",
@@ -1783,20 +1806,22 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1783
1806
  ]
1784
1807
  }
1785
1808
  ), ...t }), Yn = ae((t) => {
1786
- const e = k(null), n = k(null), s = t.schedulantApi.isEditable(), i = t.milestoneApi.getStatus(), r = t.milestoneApi.getColor().getOrElse(i === "Success" ? "green" : i === "Failure" ? "red" : "yellow"), l = t.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(t.milestoneApi.getResourceApi()), c = l * Xt * -1, { isPast: d, isFuture: m, isProcess: f } = Ln(e, t.schedulantApi, t.milestoneApi), { handleMouseUp: u, handleMouseDown: h } = St({
1809
+ const e = k(null), n = k(null), s = t.schedulantApi.isEditable(), i = t.milestoneApi.getStatus(), o = t.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(t.milestoneApi.getResourceApi()), l = o * $t * -1, { isPast: c, isFuture: d, isProcess: m } = Ln(e, t.schedulantApi, t.milestoneApi), f = t.milestoneApi.getColor().getOrElse(
1810
+ d ? "#1677ff" : m ? i === "Success" ? "#1677ff" : i === "Failure" ? "#f5222d" : "#faad14" : i === "Success" ? "#52c41a" : i === "Failure" ? "#f5222d" : "#faad14"
1811
+ ), { handleMouseUp: h, handleMouseDown: u } = yt({
1787
1812
  markerRef: n,
1788
1813
  timelineWidth: t.timelineWidth,
1789
1814
  schedulantApi: t.schedulantApi,
1790
1815
  milestoneApi: t.milestoneApi
1791
1816
  });
1792
1817
  return /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestone-harness", style: {
1793
- top: w(c),
1794
- height: w(l),
1795
- lineHeight: w(l),
1818
+ top: w(l),
1819
+ height: w(o),
1820
+ lineHeight: w(o),
1796
1821
  left: w(t.position.left),
1797
1822
  right: w(t.position.right)
1798
- }, onMouseUp: s ? u : void 0, onMouseDown: s ? h : void 0, ref: n, children: /* @__PURE__ */ a(
1799
- K,
1823
+ }, onMouseUp: s ? h : void 0, onMouseDown: s ? u : void 0, ref: n, children: /* @__PURE__ */ a(
1824
+ Z,
1800
1825
  {
1801
1826
  disabled: !t.schedulantApi.isEnableMilestoneContextMenu(),
1802
1827
  destroyOnHidden: !0,
@@ -1809,20 +1834,28 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1809
1834
  key: p,
1810
1835
  keyPath: S,
1811
1836
  domEvent: b,
1812
- isPast: d,
1813
- isFuture: m,
1814
- isProcess: f,
1837
+ isPast: c,
1838
+ isFuture: d,
1839
+ isProcess: m,
1815
1840
  milestoneApi: t.milestoneApi,
1816
1841
  schedulantApi: t.schedulantApi
1817
1842
  });
1818
1843
  }
1819
1844
  },
1820
- children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestone", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-milestone-main", children: /* @__PURE__ */ a(Nn, { width: l * He, height: l * He, color: r }) }) })
1845
+ children: /* @__PURE__ */ a(
1846
+ "div",
1847
+ {
1848
+ className: `schedulant-timeline-milestone${m ? " schedulant-milestone-today" : ""}`,
1849
+ style: m ? { "--milestone-glow-color": f } : void 0,
1850
+ ref: e,
1851
+ children: /* @__PURE__ */ a("div", { className: "schedulant-milestone-main", children: /* @__PURE__ */ a(Nn, { width: o * ze, height: o * ze, color: f }) })
1852
+ }
1853
+ )
1821
1854
  }
1822
1855
  ) });
1823
1856
  }), _n = (t, e, n) => {
1824
1857
  const s = n.getTime(), i = s.isBefore(E(), "day"), r = s.isAfter(E(), "day"), o = s.isSame(E(), "day");
1825
- return L(() => {
1858
+ return N(() => {
1826
1859
  const l = t.current;
1827
1860
  if (l)
1828
1861
  return e.checkpointDidMount({
@@ -1843,7 +1876,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1843
1876
  });
1844
1877
  };
1845
1878
  }, [e, n, t, i, r, o]), { isPast: i, isFuture: r, isProcess: o };
1846
- }, Wn = (t) => /* @__PURE__ */ a(Z, { component: () => /* @__PURE__ */ O(
1879
+ }, Wn = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ O(
1847
1880
  "svg",
1848
1881
  {
1849
1882
  className: "droplet-icon",
@@ -1875,7 +1908,7 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1875
1908
  isPast: d,
1876
1909
  isFuture: m,
1877
1910
  isProcess: f
1878
- } = _n(e, t.schedulantApi, t.checkpointApi), { handleMouseUp: u, handleMouseDown: h } = St({
1911
+ } = _n(e, t.schedulantApi, t.checkpointApi), { handleMouseUp: h, handleMouseDown: u } = yt({
1879
1912
  markerRef: n,
1880
1913
  timelineWidth: t.timelineWidth,
1881
1914
  schedulantApi: t.schedulantApi,
@@ -1892,11 +1925,11 @@ const vt = /* @__PURE__ */ vn(In), On = (t) => {
1892
1925
  left: w(t.position.left),
1893
1926
  right: w(t.position.right)
1894
1927
  },
1895
- onMouseUp: s ? u : void 0,
1896
- onMouseDown: s ? h : void 0,
1928
+ onMouseUp: s ? h : void 0,
1929
+ onMouseDown: s ? u : void 0,
1897
1930
  ref: n,
1898
1931
  children: /* @__PURE__ */ a(
1899
- K,
1932
+ Z,
1900
1933
  {
1901
1934
  disabled: !t.schedulantApi.isEnableCheckpointContextMenu(),
1902
1935
  destroyOnHidden: !0,
@@ -1987,11 +2020,10 @@ class J {
1987
2020
  }) });
1988
2021
  }
1989
2022
  calculateLaneHeight(e) {
1990
- const n = this.schedulantApi.getTimelineApi().getStart(), s = this.schedulantApi.getTimelineApi().getEnd();
1991
- return e.getMilestoneApis().filter((r) => !r.getTime().isBefore(n) && !r.getTime().isAfter(s)).length === 0 ? this.schedulantApi.getLineHeight() : this.schedulantApi.getLineHeight() * ut;
2023
+ return this.schedulantApi.getLineHeight();
1992
2024
  }
1993
2025
  calculateEventHeight() {
1994
- return this.schedulantApi.getLineHeight() * Gt;
2026
+ return this.schedulantApi.getLineHeight() * jt;
1995
2027
  }
1996
2028
  }
1997
2029
  const ee = (t) => {
@@ -1999,7 +2031,7 @@ const ee = (t) => {
1999
2031
  return /* @__PURE__ */ a("colgroup", { children: e.map((s) => /* @__PURE__ */ a("col", { style: { minWidth: n } }, s.format("YYYY-MM-DD"))) });
2000
2032
  }, zn = (t, e, n) => {
2001
2033
  const s = n.isBefore(E(), "day"), i = n.isAfter(E(), "day"), r = n.isSame(E(), "day");
2002
- L(() => {
2034
+ N(() => {
2003
2035
  const o = t.current;
2004
2036
  if (o)
2005
2037
  return e.timelineSlotLaneDidMount({
@@ -2036,7 +2068,7 @@ const ee = (t) => {
2036
2068
  );
2037
2069
  }), Vn = (t, e, n, s, i) => {
2038
2070
  const r = n.isBefore(E(), "day"), o = n.isAfter(E(), "day"), l = n.isSame(E(), "day");
2039
- L(() => {
2071
+ N(() => {
2040
2072
  const c = t.current;
2041
2073
  if (c)
2042
2074
  return e.timelineSlotLabelDidMount({
@@ -2220,8 +2252,8 @@ class Bn extends J {
2220
2252
  ] });
2221
2253
  }
2222
2254
  calculatePosition(e, n, s) {
2223
- const i = this.getTimelineApi(), r = i.getMonths(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.date() - 1, m = o / l.daysInMonth(), f = i.getMonthPosition(l) * o, u = n.isSameOrBefore(i.getStart(), "day") ? f : f + d * m, h = c.daysInMonth() - c.date(), A = o / c.daysInMonth(), p = (i.getMonthPosition(c) + 1) * o * -1, S = s.isBefore(i.getEnd(), "day") ? p + h * A : p;
2224
- return { left: u, right: S };
2255
+ const i = this.getTimelineApi(), r = i.getMonths(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.date() - 1, m = o / l.daysInMonth(), f = i.getMonthPosition(l) * o, h = n.isSameOrBefore(i.getStart(), "day") ? f : f + d * m, u = c.daysInMonth() - c.date(), A = o / c.daysInMonth(), p = (i.getMonthPosition(c) + 1) * o * -1, S = s.isBefore(i.getEnd(), "day") ? p + u * A : p;
2256
+ return { left: h, right: S };
2225
2257
  }
2226
2258
  }
2227
2259
  class qn extends J {
@@ -2277,7 +2309,7 @@ class qn extends J {
2277
2309
  ] });
2278
2310
  }
2279
2311
  calculatePosition(e, n, s) {
2280
- const i = this.getTimelineApi(), r = i.getQuarters(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.endOf("quarter").diff(l.startOf("quarter"), "day") + 1, m = n.diff(l.startOf("quarter"), "day"), f = o / d, u = m * f, h = i.getQuarterPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? h : h + u, p = c.endOf("quarter").diff(c.startOf("quarter"), "day") + 1, S = c.endOf("quarter").diff(c, "day"), b = o / p, g = S * b, y = (i.getQuarterPosition(c) + 1) * o * -1, v = s.isBefore(i.getEnd(), "day") ? y + g : y;
2312
+ const i = this.getTimelineApi(), r = i.getQuarters(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.endOf("quarter").diff(l.startOf("quarter"), "day") + 1, m = n.diff(l.startOf("quarter"), "day"), f = o / d, h = m * f, u = i.getQuarterPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? u : u + h, p = c.endOf("quarter").diff(c.startOf("quarter"), "day") + 1, S = c.endOf("quarter").diff(c, "day"), b = o / p, g = S * b, y = (i.getQuarterPosition(c) + 1) * o * -1, v = s.isBefore(i.getEnd(), "day") ? y + g : y;
2281
2313
  return { left: A, right: v };
2282
2314
  }
2283
2315
  }
@@ -2319,8 +2351,8 @@ class Un extends J {
2319
2351
  )) }) });
2320
2352
  }
2321
2353
  calculatePosition(e, n, s) {
2322
- const i = this.getTimelineApi(), r = i.getWeeks(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = o / 7, m = l.day(), f = i.getWeekPosition(l) * o, u = n.isSameOrBefore(i.getStart(), "day") ? f : f + m * d, h = 6 - c.day(), A = (i.getWeekPosition(c) + 1) * o * -1, p = s.isBefore(i.getEnd(), "day") ? A + h * d : A;
2323
- return { left: u, right: p };
2354
+ const i = this.getTimelineApi(), r = i.getWeeks(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = o / 7, m = l.day(), f = i.getWeekPosition(l) * o, h = n.isSameOrBefore(i.getStart(), "day") ? f : f + m * d, u = 6 - c.day(), A = (i.getWeekPosition(c) + 1) * o * -1, p = s.isBefore(i.getEnd(), "day") ? A + u * d : A;
2355
+ return { left: h, right: p };
2324
2356
  }
2325
2357
  }
2326
2358
  class jn extends J {
@@ -2361,7 +2393,7 @@ class jn extends J {
2361
2393
  )) }) });
2362
2394
  }
2363
2395
  calculatePosition(e, n, s) {
2364
- const i = this.getTimelineApi(), r = i.getYears(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.endOf("year").diff(l.startOf("year"), "day") + 1, m = l.diff(l.startOf("year"), "day"), f = o / d, u = m * f, h = i.getYearPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? h : h + u, p = c.endOf("year").diff(c.startOf("year"), "day") + 1, S = c.endOf("year").diff(c, "day"), b = o / p, g = S * b, y = (i.getYearPosition(c) + 1) * o * -1, v = s.isBefore(i.getEnd(), "day") ? y + g : y;
2396
+ const i = this.getTimelineApi(), r = i.getYears(), o = e / r.length, l = n.isBefore(i.getStart()) ? i.getStart() : n, c = s.isAfter(i.getEnd()) ? i.getEnd() : s, d = l.endOf("year").diff(l.startOf("year"), "day") + 1, m = l.diff(l.startOf("year"), "day"), f = o / d, h = m * f, u = i.getYearPosition(l) * o, A = n.isSameOrBefore(i.getStart(), "day") ? u : u + h, p = c.endOf("year").diff(c.startOf("year"), "day") + 1, S = c.endOf("year").diff(c, "day"), b = o / p, g = S * b, y = (i.getYearPosition(c) + 1) * o * -1, v = s.isBefore(i.getEnd(), "day") ? y + g : y;
2365
2397
  return { left: A, right: v };
2366
2398
  }
2367
2399
  }
@@ -2370,7 +2402,7 @@ class $n {
2370
2402
  timelineView;
2371
2403
  schedulantElRef;
2372
2404
  constructor(e, n) {
2373
- switch (this.schedulantElRef = n, this.schedulantApi = new ln(this, e), this.schedulantApi.getSchedulantViewType()) {
2405
+ switch (this.schedulantElRef = n, this.schedulantApi = new rn(this, e), this.schedulantApi.getSchedulantViewType()) {
2374
2406
  case "Day":
2375
2407
  this.timelineView = new Fn(this.schedulantApi);
2376
2408
  break;
@@ -2431,7 +2463,7 @@ class $n {
2431
2463
  renderResourceLabel(e, n) {
2432
2464
  const s = this.schedulantApi.getResourceAreaColumns();
2433
2465
  return /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { role: "row", children: s.map((i, r) => /* @__PURE__ */ a(
2434
- dn,
2466
+ an,
2435
2467
  {
2436
2468
  schedulantApi: this.schedulantApi,
2437
2469
  cellResizerMouseUp: e,
@@ -2443,7 +2475,7 @@ class $n {
2443
2475
  )) }) });
2444
2476
  }
2445
2477
  renderResourceLane(e, n, s, i, r, o, l) {
2446
- const c = this.schedulantApi.getResourceAreaColumns(), d = (u) => c.map((h, A) => {
2478
+ const c = this.schedulantApi.getResourceAreaColumns(), d = (h) => c.map((u, A) => {
2447
2479
  const p = l ? {
2448
2480
  isDraggable: l.isDraggable,
2449
2481
  activeId: l.dragState.activeId,
@@ -2454,24 +2486,24 @@ class $n {
2454
2486
  gn,
2455
2487
  {
2456
2488
  schedulantApi: this.schedulantApi,
2457
- resourceApi: u,
2489
+ resourceApi: h,
2458
2490
  collapseIds: i,
2459
2491
  showPlusSquare: A === 0,
2460
2492
  showIndentation: !0,
2461
2493
  cellResizerMouseUp: r,
2462
- resourceAreaColumn: h,
2494
+ resourceAreaColumn: u,
2463
2495
  cellResizerMouseDownFunc: o,
2464
2496
  isResizable: A != c.length - 1,
2465
2497
  ...p
2466
2498
  },
2467
- h.field
2499
+ u.field
2468
2500
  );
2469
2501
  }), m = n.length > 0 ? n[0].start : 0, f = n.length > 0 ? s - n[n.length - 1].end : 0;
2470
2502
  return /* @__PURE__ */ O("tbody", { children: [
2471
2503
  m > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: c.length, style: { height: m, padding: 0, border: "none" } }) }),
2472
- n.map((u) => {
2473
- const h = e[u.index];
2474
- return /* @__PURE__ */ a("tr", { role: "row", children: d(h) }, h.getId());
2504
+ n.map((h) => {
2505
+ const u = e[h.index];
2506
+ return /* @__PURE__ */ a("tr", { role: "row", children: d(u) }, u.getId());
2475
2507
  }),
2476
2508
  f > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: c.length, style: { height: f, padding: 0, border: "none" } }) })
2477
2509
  ] });
@@ -2498,7 +2530,7 @@ const Gn = (t) => {
2498
2530
  ] });
2499
2531
  function Qn(t, e) {
2500
2532
  const n = t - e.top, s = e.height;
2501
- return n < s * Qt ? "before" : n > s * Kt ? "after" : "child";
2533
+ return n < s * Gt ? "before" : n > s * Xt ? "after" : "child";
2502
2534
  }
2503
2535
  function Kn(t, e) {
2504
2536
  let n = e;
@@ -2519,40 +2551,40 @@ const Zn = (t, e) => {
2519
2551
  );
2520
2552
  o.current = new Map(t.map((f) => [f.getId(), f]));
2521
2553
  const l = C((f) => {
2522
- i.current = null, r.current = null, s({
2554
+ i.current = null, r.current = null, un(String(f.active.id)), s({
2523
2555
  activeId: f.active.id,
2524
2556
  overId: null,
2525
2557
  dropPosition: null
2526
2558
  });
2527
2559
  }, []), c = C((f) => {
2528
- const { active: u, over: h, activatorEvent: A, delta: p } = f;
2529
- if (!h || u.id === h.id) {
2560
+ const { active: h, over: u, activatorEvent: A, delta: p } = f;
2561
+ if (!u || h.id === u.id) {
2530
2562
  r.current !== null && (r.current = null, i.current = null, s((y) => ({ ...y, overId: null, dropPosition: null })));
2531
2563
  return;
2532
2564
  }
2533
- const S = o.current.get(String(h.id));
2534
- if (!S || Kn(String(u.id), S)) {
2565
+ const S = o.current.get(String(u.id));
2566
+ if (!S || Kn(String(h.id), S)) {
2535
2567
  r.current !== null && (r.current = null, i.current = null, s((y) => ({ ...y, overId: null, dropPosition: null })));
2536
2568
  return;
2537
2569
  }
2538
2570
  const b = A.clientY + p.y, g = Qn(b, {
2539
- top: h.rect.top,
2540
- height: h.rect.height
2571
+ top: u.rect.top,
2572
+ height: u.rect.height
2541
2573
  });
2542
- (r.current !== h.id || i.current !== g) && (r.current = h.id, i.current = g, s((y) => ({
2574
+ (r.current !== u.id || i.current !== g) && (r.current = u.id, i.current = g, s((y) => ({
2543
2575
  ...y,
2544
- overId: h.id,
2576
+ overId: u.id,
2545
2577
  dropPosition: g
2546
2578
  })));
2547
2579
  }, []), d = C((f) => {
2548
- const { active: u, over: h } = f, A = i.current, p = r.current;
2549
- if (h && u.id !== h.id && A && p) {
2580
+ const { active: h, over: u } = f, A = i.current, p = r.current;
2581
+ if (u && h.id !== u.id && A && p) {
2550
2582
  const S = document.querySelector(
2551
2583
  `[data-resource-id="${String(p)}"]`
2552
2584
  );
2553
2585
  e(
2554
2586
  S || document.body,
2555
- String(u.id),
2587
+ String(h.id),
2556
2588
  String(p),
2557
2589
  A
2558
2590
  );
@@ -2573,35 +2605,35 @@ const Zn = (t, e) => {
2573
2605
  x: t.x + 20,
2574
2606
  y: t.y + 20
2575
2607
  } : t, es = (t) => {
2576
- const { schedulantView: e, virtualizer: n, visibleResources: s, collapseIds: i, cellResizerMouseUp: r, cellResizerMouseDownFunc: o } = t, l = e.getScheduleApi(), c = l.getFlatMapResourceApis(), d = C(async (M, T, D, I) => {
2577
- const P = c.find((z) => z.getId() === T), N = c.find((z) => z.getId() === D);
2578
- if (P && N) {
2608
+ const { schedulantView: e, virtualizer: n, visibleResources: s, collapseIds: i, cellResizerMouseUp: r, cellResizerMouseDownFunc: o } = t, l = e.getScheduleApi(), c = l.getFlatMapResourceApis(), d = C(async (M, D, T, I) => {
2609
+ const P = c.find((z) => z.getId() === D), Y = c.find((z) => z.getId() === T);
2610
+ if (P && Y) {
2579
2611
  const z = P.getParent();
2580
2612
  l.resourceLaneMove({
2581
2613
  el: M,
2582
2614
  schedulantApi: l,
2583
2615
  draggedResourceApi: P,
2584
- targetResourceApi: N,
2616
+ targetResourceApi: Y,
2585
2617
  position: I,
2586
2618
  oldParentResourceApi: z.isDefined() ? z.get() : void 0
2587
2619
  });
2588
2620
  }
2589
- }, [l, c]), { dragState: m, handleDragStart: f, handleDragMove: u, handleDragEnd: h, handleDragCancel: A } = Zn(c, d), p = _t(
2590
- Ye(Wt, { activationConstraint: { distance: 5 } }),
2591
- Ye(Ht)
2621
+ }, [l, c]), { dragState: m, handleDragStart: f, handleDragMove: h, handleDragEnd: u, handleDragCancel: A } = Zn(c, d), p = Nt(
2622
+ _e(Yt, { activationConstraint: { delay: 300, tolerance: 5 } }),
2623
+ _e(_t)
2592
2624
  ), S = s.map((M) => M.getId()), b = l.isEditable(), g = n.getVirtualItems(), y = n.getTotalSize(), v = F(() => m.activeId ? c.find((M) => M.getId() === String(m.activeId)) ?? null : null, [m.activeId, c]);
2593
2625
  return /* @__PURE__ */ O(
2594
- zt,
2626
+ Wt,
2595
2627
  {
2596
2628
  sensors: p,
2597
- collisionDetection: Vt,
2598
- modifiers: [Bt],
2629
+ collisionDetection: Ht,
2630
+ modifiers: [Vt],
2599
2631
  onDragStart: f,
2600
- onDragMove: u,
2601
- onDragEnd: h,
2632
+ onDragMove: h,
2633
+ onDragEnd: u,
2602
2634
  onDragCancel: A,
2603
2635
  children: [
2604
- /* @__PURE__ */ a(Nt, { items: S, strategy: Yt, children: /* @__PURE__ */ O(
2636
+ /* @__PURE__ */ a(Pt, { items: S, strategy: Lt, children: /* @__PURE__ */ O(
2605
2637
  "table",
2606
2638
  {
2607
2639
  role: "presentation",
@@ -2616,7 +2648,7 @@ const Zn = (t, e) => {
2616
2648
  ]
2617
2649
  }
2618
2650
  ) }),
2619
- /* @__PURE__ */ a(Ft, { dropAnimation: null, modifiers: [Jn], children: v ? /* @__PURE__ */ a("div", { className: "schedulant-drag-overlay", children: v.getTitle() }) : null })
2651
+ /* @__PURE__ */ a(zt, { dropAnimation: null, modifiers: [Jn], children: v ? /* @__PURE__ */ a("div", { className: "schedulant-drag-overlay", children: v.getTitle() }) : null })
2620
2652
  ]
2621
2653
  }
2622
2654
  );
@@ -2627,8 +2659,8 @@ const Zn = (t, e) => {
2627
2659
  const t = C(() => {
2628
2660
  const l = document.getElementsByClassName("schedulant-timeline-head").item(0).getElementsByTagName("table").item(0)?.offsetWidth;
2629
2661
  return l || 0;
2630
- }, []), [e, n] = re(0), { state: s } = De();
2631
- return Tt(() => {
2662
+ }, []), [e, n] = re(0), { state: s } = Te();
2663
+ return Et(() => {
2632
2664
  const i = () => {
2633
2665
  const d = t();
2634
2666
  n(d);
@@ -2661,7 +2693,7 @@ const Zn = (t, e) => {
2661
2693
  }
2662
2694
  );
2663
2695
  }, is = (t, e) => {
2664
- L(() => {
2696
+ N(() => {
2665
2697
  const n = t.current, s = e.getScheduleApi();
2666
2698
  if (n)
2667
2699
  return s.schedulantDidMount({
@@ -2685,9 +2717,9 @@ function $(t, e, n) {
2685
2717
  if (!(f.length !== s.length || f.some((A, p) => s[p] !== A)))
2686
2718
  return i;
2687
2719
  s = f;
2688
- let h;
2689
- if (n.key && ((c = n.debug) != null && c.call(n)) && (h = Date.now()), i = e(...f), n.key && ((d = n.debug) != null && d.call(n))) {
2690
- const A = Math.round((Date.now() - m) * 100) / 100, p = Math.round((Date.now() - h) * 100) / 100, S = p / 16, b = (g, y) => {
2720
+ let u;
2721
+ if (n.key && ((c = n.debug) != null && c.call(n)) && (u = Date.now()), i = e(...f), n.key && ((d = n.debug) != null && d.call(n))) {
2722
+ const A = Math.round((Date.now() - m) * 100) / 100, p = Math.round((Date.now() - u) * 100) / 100, S = p / 16, b = (g, y) => {
2691
2723
  for (g = String(g); g.length < y; )
2692
2724
  g = " " + g;
2693
2725
  return g;
@@ -2710,7 +2742,7 @@ function $(t, e, n) {
2710
2742
  s = l;
2711
2743
  }, o;
2712
2744
  }
2713
- function it(t, e) {
2745
+ function rt(t, e) {
2714
2746
  if (t === void 0)
2715
2747
  throw new Error("Unexpected undefined");
2716
2748
  return t;
@@ -2720,7 +2752,7 @@ const rs = (t, e) => Math.abs(t - e) < 1.01, os = (t, e, n) => {
2720
2752
  return function(...i) {
2721
2753
  t.clearTimeout(s), s = t.setTimeout(() => e.apply(this, i), n);
2722
2754
  };
2723
- }, rt = (t) => {
2755
+ }, ot = (t) => {
2724
2756
  const { offsetWidth: e, offsetHeight: n } = t;
2725
2757
  return { width: e, height: n };
2726
2758
  }, ls = (t) => t, as = (t) => {
@@ -2739,7 +2771,7 @@ const rs = (t, e) => Math.abs(t - e) < 1.01, os = (t, e, n) => {
2739
2771
  const { width: l, height: c } = o;
2740
2772
  e({ width: Math.round(l), height: Math.round(c) });
2741
2773
  };
2742
- if (i(rt(n)), !s.ResizeObserver)
2774
+ if (i(ot(n)), !s.ResizeObserver)
2743
2775
  return () => {
2744
2776
  };
2745
2777
  const r = new s.ResizeObserver((o) => {
@@ -2752,16 +2784,16 @@ const rs = (t, e) => Math.abs(t - e) < 1.01, os = (t, e, n) => {
2752
2784
  return;
2753
2785
  }
2754
2786
  }
2755
- i(rt(n));
2787
+ i(ot(n));
2756
2788
  };
2757
2789
  t.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
2758
2790
  });
2759
2791
  return r.observe(n, { box: "border-box" }), () => {
2760
2792
  r.unobserve(n);
2761
2793
  };
2762
- }, ot = {
2794
+ }, lt = {
2763
2795
  passive: !0
2764
- }, lt = typeof window > "u" ? !0 : "onscrollend" in window, ds = (t, e) => {
2796
+ }, at = typeof window > "u" ? !0 : "onscrollend" in window, ds = (t, e) => {
2765
2797
  const n = t.scrollElement;
2766
2798
  if (!n)
2767
2799
  return;
@@ -2769,7 +2801,7 @@ const rs = (t, e) => Math.abs(t - e) < 1.01, os = (t, e, n) => {
2769
2801
  if (!s)
2770
2802
  return;
2771
2803
  let i = 0;
2772
- const r = t.options.useScrollendEvent && lt ? () => {
2804
+ const r = t.options.useScrollendEvent && at ? () => {
2773
2805
  } : os(
2774
2806
  s,
2775
2807
  () => {
@@ -2777,12 +2809,12 @@ const rs = (t, e) => Math.abs(t - e) < 1.01, os = (t, e, n) => {
2777
2809
  },
2778
2810
  t.options.isScrollingResetDelay
2779
2811
  ), o = (m) => () => {
2780
- const { horizontal: f, isRtl: u } = t.options;
2781
- i = f ? n.scrollLeft * (u && -1 || 1) : n.scrollTop, r(), e(i, m);
2812
+ const { horizontal: f, isRtl: h } = t.options;
2813
+ i = f ? n.scrollLeft * (h && -1 || 1) : n.scrollTop, r(), e(i, m);
2782
2814
  }, l = o(!0), c = o(!1);
2783
- n.addEventListener("scroll", l, ot);
2784
- const d = t.options.useScrollendEvent && lt;
2785
- return d && n.addEventListener("scrollend", c, ot), () => {
2815
+ n.addEventListener("scroll", l, lt);
2816
+ const d = t.options.useScrollendEvent && at;
2817
+ return d && n.addEventListener("scrollend", c, lt), () => {
2786
2818
  n.removeEventListener("scroll", l), d && n.removeEventListener("scrollend", c);
2787
2819
  };
2788
2820
  }, us = (t, e, n) => {
@@ -2951,40 +2983,40 @@ class ms {
2951
2983
  if (!o)
2952
2984
  return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
2953
2985
  if (this.laneAssignments.size > n)
2954
- for (const u of this.laneAssignments.keys())
2955
- u >= n && this.laneAssignments.delete(u);
2956
- this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((u) => {
2957
- this.itemSizeCache.set(u.key, u.size);
2986
+ for (const h of this.laneAssignments.keys())
2987
+ h >= n && this.laneAssignments.delete(h);
2988
+ this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((h) => {
2989
+ this.itemSizeCache.set(h.key, h.size);
2958
2990
  }));
2959
2991
  const d = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
2960
2992
  this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === n && (this.lanesSettling = !1);
2961
2993
  const m = this.measurementsCache.slice(0, d), f = new Array(l).fill(
2962
2994
  void 0
2963
2995
  );
2964
- for (let u = 0; u < d; u++) {
2965
- const h = m[u];
2966
- h && (f[h.lane] = u);
2996
+ for (let h = 0; h < d; h++) {
2997
+ const u = m[h];
2998
+ u && (f[u.lane] = h);
2967
2999
  }
2968
- for (let u = d; u < n; u++) {
2969
- const h = r(u), A = this.laneAssignments.get(u);
3000
+ for (let h = d; h < n; h++) {
3001
+ const u = r(h), A = this.laneAssignments.get(h);
2970
3002
  let p, S;
2971
3003
  if (A !== void 0 && this.options.lanes > 1) {
2972
3004
  p = A;
2973
3005
  const v = f[p], M = v !== void 0 ? m[v] : void 0;
2974
3006
  S = M ? M.end + this.options.gap : s + i;
2975
3007
  } else {
2976
- const v = this.options.lanes === 1 ? m[u - 1] : this.getFurthestMeasurement(m, u);
2977
- S = v ? v.end + this.options.gap : s + i, p = v ? v.lane : u % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(u, p);
3008
+ const v = this.options.lanes === 1 ? m[h - 1] : this.getFurthestMeasurement(m, h);
3009
+ S = v ? v.end + this.options.gap : s + i, p = v ? v.lane : h % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(h, p);
2978
3010
  }
2979
- const b = c.get(h), g = typeof b == "number" ? b : this.options.estimateSize(u), y = S + g;
2980
- m[u] = {
2981
- index: u,
3011
+ const b = c.get(u), g = typeof b == "number" ? b : this.options.estimateSize(h), y = S + g;
3012
+ m[h] = {
3013
+ index: h,
2982
3014
  start: S,
2983
3015
  size: g,
2984
3016
  end: y,
2985
- key: h,
3017
+ key: u,
2986
3018
  lane: p
2987
- }, f[p] = u;
3019
+ }, f[p] = h;
2988
3020
  }
2989
3021
  return this.measurementsCache = m, m;
2990
3022
  },
@@ -3097,11 +3129,11 @@ class ms {
3097
3129
  ), this.getVirtualItemForOffset = (n) => {
3098
3130
  const s = this.getMeasurements();
3099
3131
  if (s.length !== 0)
3100
- return it(
3101
- s[At(
3132
+ return rt(
3133
+ s[vt(
3102
3134
  0,
3103
3135
  s.length - 1,
3104
- (i) => it(s[i]).start,
3136
+ (i) => rt(s[i]).start,
3105
3137
  n
3106
3138
  )]
3107
3139
  );
@@ -3233,7 +3265,7 @@ class ms {
3233
3265
  this.scheduleScrollReconcile();
3234
3266
  }
3235
3267
  }
3236
- const At = (t, e, n, s) => {
3268
+ const vt = (t, e, n, s) => {
3237
3269
  for (; t <= e; ) {
3238
3270
  const i = (t + e) / 2 | 0, r = n(i);
3239
3271
  if (r < s)
@@ -3257,7 +3289,7 @@ function gs({
3257
3289
  startIndex: 0,
3258
3290
  endIndex: i
3259
3291
  };
3260
- let o = At(
3292
+ let o = vt(
3261
3293
  0,
3262
3294
  i,
3263
3295
  r,
@@ -3281,7 +3313,7 @@ function gs({
3281
3313
  }
3282
3314
  return { startIndex: o, endIndex: l };
3283
3315
  }
3284
- const at = typeof document < "u" ? ie.useLayoutEffect : ie.useEffect;
3316
+ const ct = typeof document < "u" ? ie.useLayoutEffect : ie.useEffect;
3285
3317
  function fs({
3286
3318
  useFlushSync: t = !0,
3287
3319
  ...e
@@ -3290,12 +3322,12 @@ function fs({
3290
3322
  ...e,
3291
3323
  onChange: (r, o) => {
3292
3324
  var l;
3293
- t && o ? qt(n) : n(), (l = e.onChange) == null || l.call(e, r, o);
3325
+ t && o ? Ft(n) : n(), (l = e.onChange) == null || l.call(e, r, o);
3294
3326
  }
3295
3327
  }, [i] = ie.useState(
3296
3328
  () => new ms(s)
3297
3329
  );
3298
- return i.setOptions(s), at(() => i._didMount(), []), at(() => i._willUpdate()), i;
3330
+ return i.setOptions(s), ct(() => i._didMount(), []), ct(() => i._willUpdate()), i;
3299
3331
  }
3300
3332
  function ps(t) {
3301
3333
  return fs({
@@ -3311,29 +3343,24 @@ function ys(t, e) {
3311
3343
  };
3312
3344
  return t.forEach((i) => s(i)), n;
3313
3345
  }
3314
- const vs = (t, e, n, s, i, r) => {
3315
- const o = F(
3346
+ const vs = (t, e, n, s) => {
3347
+ const i = F(
3316
3348
  () => ys(e, n),
3317
3349
  [e, n]
3318
- ), l = C((d) => {
3319
- const m = o[d];
3320
- return m && m.getMilestoneApis().some(
3321
- (u) => !u.getTime().isBefore(i) && !u.getTime().isAfter(r)
3322
- ) ? s * ut : s;
3323
- }, [o, s, i, r]);
3350
+ ), r = C(() => s, [s]);
3324
3351
  return { virtualizer: ps({
3325
- count: o.length,
3352
+ count: i.length,
3326
3353
  getScrollElement: () => t.current,
3327
- estimateSize: l,
3354
+ estimateSize: r,
3328
3355
  overscan: 5
3329
- }), visibleResources: o };
3330
- }, Ls = (t) => /* @__PURE__ */ a($t, { children: /* @__PURE__ */ a(Ss, { ...t }) }), Ss = (t) => {
3331
- const { state: e, dispatch: n } = De(), s = k(null), i = k(null), r = k(null), o = k(null), l = k(null), c = k(null), {
3356
+ }), visibleResources: i };
3357
+ }, Ls = (t) => /* @__PURE__ */ a(Ut, { children: /* @__PURE__ */ a(Ss, { ...t }) }), Ss = (t) => {
3358
+ const { state: e, dispatch: n } = Te(), s = k(null), i = k(null), r = k(null), o = k(null), l = k(null), c = k(null), {
3332
3359
  start: d,
3333
3360
  end: m,
3334
3361
  editable: f,
3335
- selectable: u,
3336
- lineHeight: h,
3362
+ selectable: h,
3363
+ lineHeight: u,
3337
3364
  slotMinWidth: A,
3338
3365
  schedulantMaxHeight: p,
3339
3366
  schedulantViewType: S,
@@ -3342,11 +3369,11 @@ const vs = (t, e, n, s, i, r) => {
3342
3369
  milestones: y,
3343
3370
  checkpoints: v,
3344
3371
  resourceAreaColumns: M,
3345
- resourceAreaWidth: T,
3346
- companyHolidays: D,
3372
+ resourceAreaWidth: D,
3373
+ companyHolidays: T,
3347
3374
  specialWorkdays: I,
3348
3375
  nationalHolidays: P,
3349
- dragHintColor: N,
3376
+ dragHintColor: Y,
3350
3377
  selectionColor: z
3351
3378
  } = t, _ = F(
3352
3379
  () => new $n(t, s),
@@ -3355,8 +3382,8 @@ const vs = (t, e, n, s, i, r) => {
3355
3382
  d,
3356
3383
  m,
3357
3384
  f,
3358
- u,
3359
3385
  h,
3386
+ u,
3360
3387
  A,
3361
3388
  p,
3362
3389
  S,
@@ -3365,11 +3392,11 @@ const vs = (t, e, n, s, i, r) => {
3365
3392
  y,
3366
3393
  v,
3367
3394
  M,
3368
- T,
3369
3395
  D,
3396
+ T,
3370
3397
  I,
3371
3398
  P,
3372
- N,
3399
+ Y,
3373
3400
  z
3374
3401
  ]
3375
3402
  ), R = F(() => _.getScheduleApi(), [_]);
@@ -3379,34 +3406,32 @@ const vs = (t, e, n, s, i, r) => {
3379
3406
  "--schedulant-selection-color": R.getSelectionColor()
3380
3407
  }), [R]), {
3381
3408
  datagridResizerMouseUp: q,
3382
- datagridResizerMouseDown: G,
3383
- datagridCellResizerMouseUp: ke,
3384
- datagridCellResizerMouseDownFunc: xe
3385
- } = cn(n, s, c), Ie = R.getTimelineApi(), { virtualizer: Oe, visibleResources: ne } = vs(
3409
+ datagridResizerMouseDown: Q,
3410
+ datagridCellResizerMouseUp: Oe,
3411
+ datagridCellResizerMouseDownFunc: Ie
3412
+ } = ln(n, s, c), { virtualizer: Pe, visibleResources: ne } = vs(
3386
3413
  o,
3387
3414
  R.getResourceApis(),
3388
3415
  e.collapseIds,
3389
- R.getLineHeight(),
3390
- Ie.getStart(),
3391
- Ie.getEnd()
3416
+ R.getLineHeight()
3392
3417
  );
3393
- Jt(t.schedulantMaxHeight), is(s, _), tn(c, t.resourceAreaWidth), en(l, o, i, r);
3418
+ Kt(t.schedulantMaxHeight), is(s, _), Jt(c, t.resourceAreaWidth), Zt(l, o, i, r);
3394
3419
  const ce = k(R.onResourceSelect());
3395
3420
  ce.current = R.onResourceSelect();
3396
- const Pe = C((U) => {
3421
+ const Le = C((U) => {
3397
3422
  ce.current?.(U);
3398
- }, []), Le = F(
3423
+ }, []), Ne = F(
3399
3424
  () => ne.map((U) => U.getId()),
3400
3425
  [ne]
3401
- ), Ne = C((U) => {
3402
- R.isSelectable() && hn(U.nativeEvent, Le, Pe);
3403
- }, [R, Le, Pe]);
3404
- return L(() => {
3405
- const U = (bt) => {
3406
- s.current && !s.current.contains(bt.target) && Te(ce.current);
3426
+ ), Ye = C((U) => {
3427
+ R.isSelectable() && hn(U.nativeEvent, Ne, Le);
3428
+ }, [R, Ne, Le]);
3429
+ return N(() => {
3430
+ const U = (St) => {
3431
+ s.current && !s.current.contains(St.target) && De(ce.current);
3407
3432
  };
3408
3433
  return document.addEventListener("click", U), () => document.removeEventListener("click", U);
3409
- }, []), /* @__PURE__ */ a("div", { className: "schedulant", ref: s, onMouseUp: q, onClick: Ne, onContextMenu: Ne, style: V, children: /* @__PURE__ */ a("div", { id: "schedulant-view-harness", className: "schedulant-view-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-view", children: /* @__PURE__ */ O("table", { role: "grid", className: "schedulant-scrollgrid", children: [
3434
+ }, []), /* @__PURE__ */ a("div", { className: "schedulant", ref: s, onMouseUp: q, onClick: Ye, onContextMenu: Ye, style: V, children: /* @__PURE__ */ a("div", { id: "schedulant-view-harness", className: "schedulant-view-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-view", children: /* @__PURE__ */ O("table", { role: "grid", className: "schedulant-scrollgrid", children: [
3410
3435
  /* @__PURE__ */ O("colgroup", { children: [
3411
3436
  /* @__PURE__ */ a("col", { style: { width: e.resourceAreaWidth }, ref: c }),
3412
3437
  /* @__PURE__ */ a("col", {}),
@@ -3422,8 +3447,8 @@ const vs = (t, e, n, s, i, r) => {
3422
3447
  Gn,
3423
3448
  {
3424
3449
  schedulantView: _,
3425
- cellResizerMouseUp: ke,
3426
- cellResizerMouseDownFunc: xe
3450
+ cellResizerMouseUp: Oe,
3451
+ cellResizerMouseDownFunc: Ie
3427
3452
  }
3428
3453
  ) }) }) }),
3429
3454
  /* @__PURE__ */ a(
@@ -3432,7 +3457,7 @@ const vs = (t, e, n, s, i, r) => {
3432
3457
  role: "presentation",
3433
3458
  className: "schedulant-resource-timeline-divider",
3434
3459
  onMouseUp: q,
3435
- onMouseDown: G
3460
+ onMouseDown: Q
3436
3461
  }
3437
3462
  ),
3438
3463
  /* @__PURE__ */ a("th", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-head-right", ref: r, children: /* @__PURE__ */ a(
@@ -3456,11 +3481,11 @@ const vs = (t, e, n, s, i, r) => {
3456
3481
  es,
3457
3482
  {
3458
3483
  schedulantView: _,
3459
- virtualizer: Oe,
3484
+ virtualizer: Pe,
3460
3485
  visibleResources: ne,
3461
3486
  collapseIds: e.collapseIds,
3462
- cellResizerMouseUp: ke,
3463
- cellResizerMouseDownFunc: xe
3487
+ cellResizerMouseUp: Oe,
3488
+ cellResizerMouseDownFunc: Ie
3464
3489
  }
3465
3490
  ) }) }) }),
3466
3491
  /* @__PURE__ */ a(
@@ -3469,7 +3494,7 @@ const vs = (t, e, n, s, i, r) => {
3469
3494
  role: "presentation",
3470
3495
  className: "schedulant-resource-timeline-divider",
3471
3496
  onMouseUp: q,
3472
- onMouseDown: G
3497
+ onMouseDown: Q
3473
3498
  }
3474
3499
  ),
3475
3500
  /* @__PURE__ */ a("td", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-body-right", ref: o, children: /* @__PURE__ */ O("div", { className: "schedulant-timeline-body", children: [
@@ -3478,7 +3503,7 @@ const vs = (t, e, n, s, i, r) => {
3478
3503
  ss,
3479
3504
  {
3480
3505
  schedulantView: _,
3481
- virtualizer: Oe,
3506
+ virtualizer: Pe,
3482
3507
  visibleResources: ne
3483
3508
  }
3484
3509
  )