schedulant 2.0.7-fixed.5.1 → 2.0.8

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,27 +1,27 @@
1
- import { jsx as a, Fragment as ft, jsxs as O } from "react/jsx-runtime";
2
- import * as te from "react";
3
- import { createContext as pt, useReducer as vt, useEffect as N, useContext as yt, useRef as k, useCallback as T, useMemo as B, memo as ie, useState as st, useLayoutEffect as At } from "react";
1
+ import { jsx as a, Fragment as bt, jsxs as I } from "react/jsx-runtime";
2
+ import * as ie from "react";
3
+ import { createContext as wt, useReducer as Et, useEffect as N, useContext as Ct, useRef as k, useCallback as C, useState as re, useMemo as F, memo as ae, useLayoutEffect as Tt } from "react";
4
4
  import E from "dayjs";
5
- import St from "dayjs/plugin/weekYear";
6
- import bt from "dayjs/plugin/weekOfYear";
7
- import Mt from "dayjs/plugin/quarterOfYear";
8
- import wt from "dayjs/plugin/isSameOrBefore";
9
- import { Dropdown as G, Space as Et } from "antd";
10
- import { PlusSquareOutlined as Ct, MinusSquareOutlined as Tt } from "@ant-design/icons";
11
- import { useSortable as Dt, SortableContext as Rt, verticalListSortingStrategy as kt } from "@dnd-kit/sortable";
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 Z, Space as It } from "antd";
12
10
  import X from "@ant-design/icons/lib/components/Icon";
13
- import { useSensors as xt, useSensor as xe, PointerSensor as Ot, KeyboardSensor as It, DndContext as Pt, closestCenter as Nt, DragOverlay as Lt } from "@dnd-kit/core";
14
- import { restrictToVerticalAxis as Yt } from "@dnd-kit/modifiers";
15
- import { flushSync as _t } from "react-dom";
16
- const re = {
11
+ import { PlusSquareOutlined as Ot, MinusSquareOutlined as Pt } from "@ant-design/icons";
12
+ import { useSortable as Lt, SortableContext as Nt, verticalListSortingStrategy as Yt } from "@dnd-kit/sortable";
13
+ import { useSensors as _t, useSensor as We, 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";
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
- }, it = "schedulant.state", Wt = () => {
20
+ }, ut = "schedulant.state", Ut = () => {
21
21
  try {
22
- const s = localStorage.getItem(it);
23
- if (s)
24
- return JSON.parse(s);
22
+ const t = localStorage.getItem(ut);
23
+ if (t)
24
+ return JSON.parse(t);
25
25
  } catch {
26
26
  console.warn("Error parsing schedulant local storage");
27
27
  }
@@ -29,93 +29,93 @@ const re = {
29
29
  collapseIds: [],
30
30
  resourceAreaWidth: "20%"
31
31
  };
32
- }, Ht = (s, e) => {
32
+ }, jt = (t, e) => {
33
33
  switch (e.type) {
34
- case re.EXPAND_RESOURCE:
34
+ case de.EXPAND_RESOURCE:
35
35
  return {
36
- ...s,
37
- collapseIds: s.collapseIds.filter((t) => t !== e.id)
36
+ ...t,
37
+ collapseIds: t.collapseIds.filter((n) => n !== e.id)
38
38
  };
39
- case re.COLLAPSE_RESOURCE:
39
+ case de.COLLAPSE_RESOURCE:
40
40
  return {
41
- ...s,
42
- collapseIds: [...s.collapseIds, e.id]
41
+ ...t,
42
+ collapseIds: [...t.collapseIds, e.id]
43
43
  };
44
- case re.SET_RESOURCE_AREA_WIDTH:
44
+ case de.SET_RESOURCE_AREA_WIDTH:
45
45
  return {
46
- ...s,
46
+ ...t,
47
47
  resourceAreaWidth: e.width
48
48
  };
49
49
  default:
50
- return s;
50
+ return t;
51
51
  }
52
- }, rt = pt(void 0), zt = ({ children: s }) => {
53
- const [e, t] = vt(Ht, void 0, Wt);
52
+ }, ht = wt(void 0), $t = ({ children: t }) => {
53
+ const [e, n] = Et(jt, void 0, Ut);
54
54
  return N(() => {
55
- localStorage.setItem(it, JSON.stringify(e));
56
- }, [e]), /* @__PURE__ */ a(rt.Provider, { value: { state: e, dispatch: t }, children: s });
57
- }, be = () => {
58
- const s = yt(rt);
59
- if (s === void 0)
55
+ localStorage.setItem(ut, JSON.stringify(e));
56
+ }, [e]), /* @__PURE__ */ a(ht.Provider, { value: { state: e, dispatch: n }, children: t });
57
+ }, De = () => {
58
+ const t = Ct(ht);
59
+ if (t === void 0)
60
60
  throw new Error("useSchedulantContext must be used within a SchedulantProvider");
61
- return s;
62
- }, w = (s) => `${s}px`, ne = (s) => Number(s.replace(/px$/, "")), Oe = (s) => document.querySelector(`.${s}`), ot = 1.5, Vt = 0.7, _ = 10, lt = 16, Ie = 13, Ft = 0.1, Pe = 0.5, Bt = 0.25, qt = 0.75, Ut = 100, jt = (s) => {
61
+ return t;
62
+ }, w = (t) => `${t}px`, oe = (t) => Number(t.replace(/px$/, "")), He = (t) => document.querySelector(`.${t}`), mt = 1.5, Gt = 0.7, W = 10, gt = 16, ze = 13, Xt = 0.1, Ve = 0.5, Qt = 0.25, Kt = 0.75, Zt = 100, Jt = (t) => {
63
63
  N(() => {
64
- const e = document.getElementById("schedulant-view-harness"), t = document.getElementById("schedulant-datagrid-body"), n = document.getElementById("schedulant-timeline-head"), i = t ? t.getBoundingClientRect().height : 0, r = n ? n.getBoundingClientRect().height : 0, o = i + r + Ie, l = s - o > 0 ? o : s;
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 + ze, l = t - o > 0 ? o : t;
65
65
  e && (e.style.height = w(l));
66
66
  const c = () => {
67
- const m = t ? t.getBoundingClientRect().height : 0, f = n ? n.getBoundingClientRect().height : 0, h = m + f + Ie, d = s - h > 0 ? h : s;
68
- e && (e.style.height = w(d));
69
- }, u = new ResizeObserver(() => {
67
+ const m = n ? n.getBoundingClientRect().height : 0, f = s ? s.getBoundingClientRect().height : 0, u = m + f + ze, h = t - u > 0 ? u : t;
68
+ e && (e.style.height = w(h));
69
+ }, d = new ResizeObserver(() => {
70
70
  c();
71
71
  });
72
- return t && u.observe(t), n && u.observe(n), () => {
73
- u.disconnect();
72
+ return n && d.observe(n), s && d.observe(s), () => {
73
+ d.disconnect();
74
74
  };
75
- }, [s]);
76
- }, $t = (s, e, t, n) => {
75
+ }, [t]);
76
+ }, en = (t, e, n, s) => {
77
77
  N(() => {
78
- const i = s.current, r = e.current, o = t.current, l = n.current;
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 = [], u = (m, f, h, d) => {
81
- m.addEventListener(f, h, d), c.push(() => m.removeEventListener(f, h));
80
+ const c = [], d = (m, f, u, h) => {
81
+ m.addEventListener(f, u, h), c.push(() => m.removeEventListener(f, u));
82
82
  };
83
- return u(r, "scroll", () => {
83
+ return d(r, "scroll", () => {
84
84
  i.scrollTop = r.scrollTop, l.scrollLeft = r.scrollLeft;
85
- }), u(i, "scroll", () => {
85
+ }), d(i, "scroll", () => {
86
86
  o.scrollLeft = i.scrollLeft;
87
- }), u(i, "wheel", ((m) => {
87
+ }), d(i, "wheel", ((m) => {
88
88
  let f = !1;
89
89
  if (m.deltaY !== 0) {
90
- const h = r.scrollHeight - r.clientHeight, d = Math.max(0, Math.min(h, r.scrollTop + m.deltaY));
91
- r.scrollTop = d, i.scrollTop = d, f = !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;
92
92
  }
93
93
  if (f && m.deltaX !== 0) {
94
- const h = i.scrollWidth - i.clientWidth, d = Math.max(0, Math.min(h, i.scrollLeft + m.deltaX));
95
- i.scrollLeft = d, o.scrollLeft = d;
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;
96
96
  } else if (m.deltaX !== 0) {
97
- const h = i.scrollWidth - i.clientWidth;
98
- o.scrollLeft = Math.max(0, Math.min(h, i.scrollLeft + m.deltaX));
97
+ const u = i.scrollWidth - i.clientWidth;
98
+ o.scrollLeft = Math.max(0, Math.min(u, i.scrollLeft + m.deltaX));
99
99
  }
100
100
  f && m.preventDefault();
101
- }), { passive: !1 }), u(r, "wheel", ((m) => {
101
+ }), { passive: !1 }), d(r, "wheel", ((m) => {
102
102
  let f = !1;
103
103
  if (m.deltaY !== 0) {
104
- const h = r.scrollHeight - r.clientHeight, d = Math.max(0, Math.min(h, r.scrollTop + m.deltaY));
105
- r.scrollTop = d, i.scrollTop = d, f = !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;
106
106
  }
107
107
  if (m.deltaX !== 0) {
108
- const h = r.scrollWidth - r.clientWidth, d = Math.max(0, Math.min(h, r.scrollLeft + m.deltaX));
109
- r.scrollLeft = d, l.scrollLeft = d, f = !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;
110
110
  }
111
111
  f && m.preventDefault();
112
112
  }), { passive: !1 }), () => c.forEach((m) => m());
113
- }, [s, e, t, n]);
114
- }, Gt = (s, e) => {
113
+ }, [t, e, n, s]);
114
+ }, tn = (t, e) => {
115
115
  N(() => {
116
- const t = s.current;
117
- t && e && (t.style.width = e);
118
- }, [s, e]);
116
+ const n = t.current;
117
+ n && e && (n.style.width = e);
118
+ }, [t, e]);
119
119
  };
120
120
  class x {
121
121
  value;
@@ -143,7 +143,7 @@ class x {
143
143
  return this.isDefined() ? this.value : e;
144
144
  }
145
145
  }
146
- class Xt {
146
+ class nn {
147
147
  event;
148
148
  resourceApi;
149
149
  constructor(e) {
@@ -194,14 +194,14 @@ class Xt {
194
194
  return x.fromNullable(this.event.extendedProps);
195
195
  }
196
196
  }
197
- const q = (s, e) => {
198
- const t = {};
199
- return s.forEach((n) => {
200
- const i = e(n);
201
- t[i] ? t[i].push(n) : t[i] = [n];
202
- }), t;
197
+ const j = (t, e) => {
198
+ const n = {};
199
+ return t.forEach((s) => {
200
+ const i = e(s);
201
+ n[i] ? n[i].push(s) : n[i] = [s];
202
+ }), n;
203
203
  };
204
- class Qt {
204
+ class sn {
205
205
  depth;
206
206
  resource;
207
207
  parent;
@@ -285,45 +285,45 @@ class Qt {
285
285
  return x.fromNullable(this.resource.extendedProps);
286
286
  }
287
287
  }
288
- class se {
289
- static compare(e, t) {
290
- const n = e.getExtendedProps().getOrElse({ order: 0 }).order, i = t.getExtendedProps().getOrElse({ order: 0 }).order;
291
- return (typeof n == "number" ? n : 0) - (typeof i == "number" ? i : 0);
288
+ class le {
289
+ static compare(e, n) {
290
+ const s = e.getExtendedProps().getOrElse({ order: 0 }).order, i = n.getExtendedProps().getOrElse({ order: 0 }).order;
291
+ return (typeof s == "number" ? s : 0) - (typeof i == "number" ? i : 0);
292
292
  }
293
- static createTree(e, t, n, i) {
294
- const r = "undefined", o = e.map((d) => new Qt(d)), l = new Map(Object.entries(q(t, (d) => d.getResourceId()))), c = o.reduce((d, v) => d.set(v.getId(), v), /* @__PURE__ */ new Map()), u = new Map(Object.entries(q(n, (d) => d.getResourceId()))), m = new Map(Object.entries(q(i, (d) => d.getResourceId()))), f = [{ parentId: r, depth: 0 }], h = new Map(Object.entries(q(o, (d) => d.getParentId().getOrElse(r))));
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))));
295
295
  for (; f.length > 0; ) {
296
- const d = f.pop();
297
- if (d) {
298
- const { parentId: v, depth: p } = d, y = h.get(v);
299
- y && y.sort(se.compare).forEach((b) => {
300
- const g = b.getId();
301
- b.setDepth(p), b.setParent(c.get(v)), b.setChildren(h.get(g) || []);
302
- const A = l.get(g) || [];
303
- A.forEach((C) => C.setResourceApi(b)), b.setEventApis(A);
304
- const S = u.get(g) || [];
305
- S.forEach((C) => C.setResourceApi(b)), b.setMilestoneApis(S);
306
- const M = m.get(g) || [];
307
- M.forEach((C) => C.setResourceApi(b)), b.setCheckpointApis(M), f.push({ parentId: g, depth: p + 1 });
296
+ const h = f.pop();
297
+ if (h) {
298
+ const { parentId: A, depth: p } = h, S = u.get(A);
299
+ S && S.sort(le.compare).forEach((M) => {
300
+ const g = M.getId();
301
+ M.setDepth(p), M.setParent(c.get(A)), M.setChildren(u.get(g) || []);
302
+ const y = l.get(g) || [];
303
+ y.forEach((T) => T.setResourceApi(M)), M.setEventApis(y);
304
+ const v = d.get(g) || [];
305
+ v.forEach((T) => T.setResourceApi(M)), M.setMilestoneApis(v);
306
+ const b = m.get(g) || [];
307
+ b.forEach((T) => T.setResourceApi(M)), M.setCheckpointApis(b), f.push({ parentId: g, depth: p + 1 });
308
308
  });
309
309
  }
310
310
  }
311
- return h.get(r) || [];
311
+ return u.get(r) || [];
312
312
  }
313
313
  static flatMapTree(e) {
314
- const t = [], n = [...e];
315
- for (; n.length > 0; ) {
316
- const i = n.pop();
314
+ const n = [], s = [...e];
315
+ for (; s.length > 0; ) {
316
+ const i = s.pop();
317
317
  if (i) {
318
- t.push(i);
318
+ n.push(i);
319
319
  for (let r = i.getChildren().length - 1; r >= 0; r--)
320
- n.push(i.getChildren()[r]);
320
+ s.push(i.getChildren()[r]);
321
321
  }
322
322
  }
323
- return t;
323
+ return n;
324
324
  }
325
325
  }
326
- class Kt {
326
+ class rn {
327
327
  milestone;
328
328
  resourceApi;
329
329
  constructor(e) {
@@ -362,7 +362,7 @@ class Kt {
362
362
  return x.fromNullable(this.milestone.extendedProps);
363
363
  }
364
364
  }
365
- class Zt {
365
+ class on {
366
366
  checkpoint;
367
367
  resourceApi;
368
368
  constructor(e) {
@@ -398,11 +398,11 @@ class Zt {
398
398
  return x.fromNullable(this.checkpoint.extendedProps);
399
399
  }
400
400
  }
401
- E.extend(wt);
402
- E.extend(Mt);
403
- E.extend(bt);
404
- E.extend(St);
405
- class $ {
401
+ E.extend(xt);
402
+ E.extend(kt);
403
+ E.extend(Rt);
404
+ E.extend(Dt);
405
+ class K {
406
406
  start;
407
407
  end;
408
408
  timelineData;
@@ -415,8 +415,8 @@ class $ {
415
415
  monthPositionCache = /* @__PURE__ */ new Map();
416
416
  quarterPositionCache = /* @__PURE__ */ new Map();
417
417
  yearPositionCache = /* @__PURE__ */ new Map();
418
- generateTimelineData(e, t) {
419
- let n = e.clone();
418
+ generateTimelineData(e, n) {
419
+ let s = e.clone();
420
420
  const i = {
421
421
  years: {},
422
422
  months: {},
@@ -426,16 +426,16 @@ class $ {
426
426
  };
427
427
  this.dayPositionCache.clear(), this.weekPositionCache.clear(), this.monthPositionCache.clear(), this.quarterPositionCache.clear(), this.yearPositionCache.clear();
428
428
  let r = 0;
429
- const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
430
- for (; n.isSameOrBefore(t, "day"); ) {
431
- const m = n.startOf("year").format("YYYY-MM-DD");
432
- i.years[m] = i.years[m] || [], i.years[m].push(n.clone()), u.has(m) || u.set(m, u.size);
433
- const f = n.startOf("quarter").format("YYYY-MM-DD");
434
- i.quarters[f] = i.quarters[f] || [], i.quarters[f].push(n.clone()), c.has(f) || c.set(f, c.size);
435
- const h = n.startOf("month").format("YYYY-MM-DD");
436
- i.months[h] = i.months[h] || [], i.months[h].push(n.clone()), l.has(h) || l.set(h, l.size);
437
- const d = n.startOf("week").format("YYYY-MM-DD");
438
- i.weeks[d] = i.weeks[d] || [], i.weeks[d].push(n.clone()), o.has(d) || o.set(d, o.size), i.days.push(n.clone()), this.dayPositionCache.set(n.format("YYYY-MM-DD"), r), r++, n = n.add(1, "day");
429
+ const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
430
+ for (; s.isSameOrBefore(n, "day"); ) {
431
+ const m = s.startOf("year").format("YYYY-MM-DD");
432
+ i.years[m] = i.years[m] || [], i.years[m].push(s.clone()), d.has(m) || d.set(m, d.size);
433
+ const f = s.startOf("quarter").format("YYYY-MM-DD");
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");
439
439
  }
440
440
  return o.forEach((m, f) => {
441
441
  this.weekPositionCache.set(f, m);
@@ -443,12 +443,12 @@ class $ {
443
443
  this.monthPositionCache.set(f, m);
444
444
  }), c.forEach((m, f) => {
445
445
  this.quarterPositionCache.set(f, m);
446
- }), u.forEach((m, f) => {
446
+ }), d.forEach((m, f) => {
447
447
  this.yearPositionCache.set(f, m);
448
448
  }), i;
449
449
  }
450
- constructor(e, t) {
451
- this.start = e, this.end = t, this.timelineData = this.generateTimelineData(e, t);
450
+ constructor(e, n) {
451
+ this.start = e, this.end = n, this.timelineData = this.generateTimelineData(e, n);
452
452
  }
453
453
  setStart(e) {
454
454
  this.start = e, this.timelineData = this.generateTimelineData(e, this.getEnd());
@@ -499,79 +499,79 @@ class $ {
499
499
  return e.day() === 0 || e.day() === 6;
500
500
  }
501
501
  isHoliday(e) {
502
- return (this.getCompanyHolidays().some((t) => t.isSame(e, "day")) || this.getNationalHolidays().some((t) => t.isSame(e, "day")) || this.isWeekend(e)) && !this.getSpecialWorkdays().some((t) => t.isSame(e, "day"));
502
+ return (this.getCompanyHolidays().some((n) => n.isSame(e, "day")) || this.getNationalHolidays().some((n) => n.isSame(e, "day")) || this.isWeekend(e)) && !this.getSpecialWorkdays().some((n) => n.isSame(e, "day"));
503
503
  }
504
504
  isSpecialWorkday(e) {
505
- return this.getSpecialWorkdays().some((t) => t.isSame(e, "day"));
505
+ return this.getSpecialWorkdays().some((n) => n.isSame(e, "day"));
506
506
  }
507
507
  isCompanyHoliday(e) {
508
- return this.getCompanyHolidays().some((t) => t.isSame(e, "day"));
508
+ return this.getCompanyHolidays().some((n) => n.isSame(e, "day"));
509
509
  }
510
510
  isNationalHoliday(e) {
511
- return this.getNationalHolidays().some((t) => t.isSame(e, "day"));
511
+ return this.getNationalHolidays().some((n) => n.isSame(e, "day"));
512
512
  }
513
513
  getDayPosition(e) {
514
- const t = e.format("YYYY-MM-DD"), n = this.dayPositionCache.get(t);
515
- return n !== void 0 ? n : this.getDays().findIndex((i) => i.isSame(e, "day"));
514
+ const n = e.format("YYYY-MM-DD"), s = this.dayPositionCache.get(n);
515
+ return s !== void 0 ? s : this.getDays().findIndex((i) => i.isSame(e, "day"));
516
516
  }
517
517
  getWeekPosition(e) {
518
- const t = e.startOf("week").format("YYYY-MM-DD"), n = this.weekPositionCache.get(t);
519
- return n !== void 0 ? n : this.getWeeks().findIndex((i) => i.isSame(e, "week"));
518
+ const n = e.startOf("week").format("YYYY-MM-DD"), s = this.weekPositionCache.get(n);
519
+ return s !== void 0 ? s : this.getWeeks().findIndex((i) => i.isSame(e, "week"));
520
520
  }
521
521
  getMonthPosition(e) {
522
- const t = e.startOf("month").format("YYYY-MM-DD"), n = this.monthPositionCache.get(t);
523
- return n !== void 0 ? n : this.getMonths().findIndex((i) => i.isSame(e, "month"));
522
+ const n = e.startOf("month").format("YYYY-MM-DD"), s = this.monthPositionCache.get(n);
523
+ return s !== void 0 ? s : this.getMonths().findIndex((i) => i.isSame(e, "month"));
524
524
  }
525
525
  getQuarterPosition(e) {
526
- const t = e.startOf("quarter").format("YYYY-MM-DD"), n = this.quarterPositionCache.get(t);
527
- return n !== void 0 ? n : this.getQuarters().findIndex((i) => i.isSame(e, "quarter"));
526
+ const n = e.startOf("quarter").format("YYYY-MM-DD"), s = this.quarterPositionCache.get(n);
527
+ return s !== void 0 ? s : this.getQuarters().findIndex((i) => i.isSame(e, "quarter"));
528
528
  }
529
529
  getYearPosition(e) {
530
- const t = e.startOf("year").format("YYYY-MM-DD"), n = this.yearPositionCache.get(t);
531
- return n !== void 0 ? n : this.getYears().findIndex((i) => i.isSame(e, "year"));
530
+ const n = e.startOf("year").format("YYYY-MM-DD"), s = this.yearPositionCache.get(n);
531
+ return s !== void 0 ? s : this.getYears().findIndex((i) => i.isSame(e, "year"));
532
532
  }
533
533
  populateMonthsWithDays() {
534
- const e = [], t = this.timelineData.months;
535
- for (const n in t) {
534
+ const e = [], n = this.timelineData.months;
535
+ for (const s in n) {
536
536
  const i = { month: E(), days: [] };
537
- i.month = E(n), i.days = t[n], e.push(i);
537
+ i.month = E(s), i.days = n[s], e.push(i);
538
538
  }
539
539
  return e;
540
540
  }
541
541
  populateYearsWithDays() {
542
- const e = [], t = this.timelineData.years;
543
- for (const n in t) {
542
+ const e = [], n = this.timelineData.years;
543
+ for (const s in n) {
544
544
  const i = { year: E(), days: [] };
545
- i.year = E(n), i.days = t[n], e.push(i);
545
+ i.year = E(s), i.days = n[s], e.push(i);
546
546
  }
547
547
  return e;
548
548
  }
549
549
  populateYearsWithWeeks() {
550
- const e = this.getWeeks(), t = q(e, (i) => i.format("YYYY")), n = [];
551
- for (const i in t) {
550
+ const e = this.getWeeks(), n = j(e, (i) => i.format("YYYY")), s = [];
551
+ for (const i in n) {
552
552
  const r = { year: E(), weeks: [] };
553
- r.year = E(i), r.weeks = t[i], n.push(r);
553
+ r.year = E(i), r.weeks = n[i], s.push(r);
554
554
  }
555
- return n;
555
+ return s;
556
556
  }
557
557
  populateYearsWithMonths() {
558
- const e = this.getDays(), t = Array.from(new Set(e.map((r) => r.format("YYYY-MM")))).map((r) => E(r)), n = q(t, (r) => r.format("YYYY")), i = [];
559
- for (const r in n) {
558
+ const e = this.getDays(), n = Array.from(new Set(e.map((r) => r.format("YYYY-MM")))).map((r) => E(r)), s = j(n, (r) => r.format("YYYY")), i = [];
559
+ for (const r in s) {
560
560
  const o = { year: E(), months: [] };
561
- o.year = E(r), o.months = n[r], i.push(o);
561
+ o.year = E(r), o.months = s[r], i.push(o);
562
562
  }
563
563
  return i;
564
564
  }
565
565
  populateYearsWithQuarters() {
566
- const e = this.getDays(), t = Array.from(new Set(e.map((r) => r.startOf("quarter").format("YYYY-MM-DD")))).map((r) => E(r)), n = q(t, (r) => r.format("YYYY")), i = [];
567
- for (const r in n) {
566
+ const e = this.getDays(), n = Array.from(new Set(e.map((r) => r.startOf("quarter").format("YYYY-MM-DD")))).map((r) => E(r)), s = j(n, (r) => r.format("YYYY")), i = [];
567
+ for (const r in s) {
568
568
  const o = { year: E(), quarters: [] };
569
- o.year = E(r), o.quarters = n[r], i.push(o);
569
+ o.year = E(r), o.quarters = s[r], i.push(o);
570
570
  }
571
571
  return i;
572
572
  }
573
573
  }
574
- class Jt {
574
+ class ln {
575
575
  schedulantProps;
576
576
  schedulantView;
577
577
  timelineApi;
@@ -581,36 +581,36 @@ class Jt {
581
581
  milestoneApis;
582
582
  checkpointApis;
583
583
  generateTimelineApi(e) {
584
- let t;
584
+ let n;
585
585
  switch (e.schedulantViewType) {
586
586
  case "Week": {
587
- const n = e.start.startOf("week"), i = e.end.endOf("week");
588
- t = new $(n, i);
587
+ const s = e.start.startOf("week"), i = e.end.endOf("week");
588
+ n = new K(s, i);
589
589
  break;
590
590
  }
591
591
  case "Month": {
592
- const n = e.start.startOf("month"), i = e.end.endOf("month");
593
- t = new $(n, i);
592
+ const s = e.start.startOf("month"), i = e.end.endOf("month");
593
+ n = new K(s, i);
594
594
  break;
595
595
  }
596
596
  case "Quarter": {
597
- const n = e.start.startOf("quarter"), i = e.end.endOf("quarter");
598
- t = new $(n, i);
597
+ const s = e.start.startOf("quarter"), i = e.end.endOf("quarter");
598
+ n = new K(s, i);
599
599
  break;
600
600
  }
601
601
  case "Year": {
602
- const n = e.start.startOf("year"), i = e.end.endOf("year");
603
- t = new $(n, i);
602
+ const s = e.start.startOf("year"), i = e.end.endOf("year");
603
+ n = new K(s, i);
604
604
  break;
605
605
  }
606
606
  default:
607
- t = new $(e.start, e.end);
607
+ n = new K(e.start, e.end);
608
608
  break;
609
609
  }
610
- return t.setSpecialWorkdays(e.specialWorkdays || []), t.setCompanyHolidays(e.companyHolidays || []), t.setNationalHolidays(e.nationalHolidays || []), t;
610
+ return n.setSpecialWorkdays(e.specialWorkdays || []), n.setCompanyHolidays(e.companyHolidays || []), n.setNationalHolidays(e.nationalHolidays || []), n;
611
611
  }
612
- constructor(e, t) {
613
- this.eventApis = t.events.map((n) => new Xt(n)), this.milestoneApis = t.milestones?.map((n) => new Kt(n)) || [], this.checkpointApis = t.checkpoints?.map((n) => new Zt(n)) || [], this.schedulantProps = t, this.schedulantView = e, this.timelineApi = this.generateTimelineApi(t), this.resourceApis = se.createTree(t.resources, this.eventApis, this.milestoneApis, this.checkpointApis), this.flatMapResourceApis = se.flatMapTree(this.resourceApis);
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);
614
614
  }
615
615
  updateProps(e) {
616
616
  this.schedulantProps = e;
@@ -652,13 +652,13 @@ class Jt {
652
652
  return this.eventApis;
653
653
  }
654
654
  getEventApiById(e) {
655
- return x.fromNullable(this.eventApis.find((t) => t.getId() === e));
655
+ return x.fromNullable(this.eventApis.find((n) => n.getId() === e));
656
656
  }
657
657
  getResourceApis() {
658
658
  return this.resourceApis;
659
659
  }
660
660
  getResourceApiById(e) {
661
- return x.fromNullable(this.resourceApis.find((t) => t.getId() === e));
661
+ return x.fromNullable(this.resourceApis.find((n) => n.getId() === e));
662
662
  }
663
663
  getFlatMapResourceApis() {
664
664
  return this.flatMapResourceApis;
@@ -674,13 +674,13 @@ class Jt {
674
674
  return this.milestoneApis;
675
675
  }
676
676
  getMilestoneApiById(e) {
677
- return x.fromNullable(this.milestoneApis.find((t) => t.getId() === e));
677
+ return x.fromNullable(this.milestoneApis.find((n) => n.getId() === e));
678
678
  }
679
679
  getCheckpointApis() {
680
680
  return this.checkpointApis;
681
681
  }
682
682
  getCheckpointApiById(e) {
683
- return x.fromNullable(this.checkpointApis.find((t) => t.getId() === e));
683
+ return x.fromNullable(this.checkpointApis.find((n) => n.getId() === e));
684
684
  }
685
685
  getSchedulantElRef() {
686
686
  return this.schedulantView.getScheduleElRef();
@@ -727,6 +727,12 @@ class Jt {
727
727
  onResourceLaneContextMenuClick(e) {
728
728
  this.schedulantProps.resourceLaneContextMenuClick?.(e);
729
729
  }
730
+ getResourceLaneMultiSelectContextMenuItems() {
731
+ return this.schedulantProps.resourceLaneMultiSelectContextMenuItems;
732
+ }
733
+ onResourceLaneMultiSelectContextMenuClick(e) {
734
+ this.schedulantProps.resourceLaneMultiSelectContextMenuClick?.(e);
735
+ }
730
736
  resourceLabelDidMount(e) {
731
737
  this.schedulantProps.resourceLabelDidMount?.(e);
732
738
  }
@@ -802,230 +808,297 @@ class Jt {
802
808
  getSelectionColor() {
803
809
  return this.schedulantProps.selectionColor || "rgba(66, 133, 244, 0.08)";
804
810
  }
811
+ onResourceSelect() {
812
+ return this.schedulantProps.onResourceSelect;
813
+ }
805
814
  }
806
- const en = (s, e, t) => {
815
+ const an = (t, e, n) => {
807
816
  N(() => {
808
- const n = s.current;
809
- if (n)
810
- return t.resourceLabelDidMount({
811
- el: n,
817
+ const s = t.current;
818
+ if (s)
819
+ return n.resourceLabelDidMount({
820
+ el: s,
812
821
  label: e
813
822
  }), () => {
814
- t.resourceLabelWillUnmount({
815
- el: n,
823
+ n.resourceLabelWillUnmount({
824
+ el: s,
816
825
  label: e
817
826
  });
818
827
  };
819
- }, [s, e, t]);
820
- }, W = ({ condition: s, children: e, fallback: t }) => /* @__PURE__ */ a(ft, { children: s ? e : t }), tn = (s, e, t) => {
821
- const n = k(-1), i = T(() => Oe("schedulant-datagrid-head"), []), r = T(() => Oe("schedulant-datagrid-body"), []), o = T((h) => {
822
- h.preventDefault();
823
- const d = t.current;
824
- if (d) {
825
- const v = d.getBoundingClientRect(), p = h.clientX - v.left;
826
- d.style.width = w(p), s({ type: "SET_RESOURCE_AREA_WIDTH", width: d.style.width });
828
+ }, [t, e, n]);
829
+ }, H = ({ condition: t, children: e, fallback: n }) => /* @__PURE__ */ a(bt, { children: t ? e : n }), cn = (t, e, n) => {
830
+ const s = k(-1), i = C(() => He("schedulant-datagrid-head"), []), r = C(() => He("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 });
827
836
  }
828
- }, [s, t]), l = T((h) => {
829
- h.preventDefault();
830
- const d = e.current;
831
- d ? d.removeEventListener("mousemove", o) : console.error("scheduleEl", d);
832
- }, [o, e]), c = T((h) => {
833
- h.preventDefault();
834
- const d = e.current;
835
- d ? d.addEventListener("mousemove", o) : console.error("scheduleEl", d);
836
- }, [o, e]), u = T((h) => {
837
- h.preventDefault();
838
- const d = n.current, v = i(), p = r(), y = v.firstElementChild, b = p.firstElementChild, g = y?.children, A = b?.children;
839
- if (g && A) {
840
- const S = g[d], M = A[d], C = h.clientX - S.getBoundingClientRect().left, D = h.clientX - M.getBoundingClientRect().left;
841
- S.style.width = w(C), M.style.width = w(D);
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, M = p.firstElementChild, g = S?.children, y = M?.children;
848
+ if (g && y) {
849
+ const v = g[h], b = y[h], T = u.clientX - v.getBoundingClientRect().left, D = u.clientX - b.getBoundingClientRect().left;
850
+ v.style.width = w(T), b.style.width = w(D);
842
851
  }
843
- }, [r, i, n]), m = T((h) => {
844
- h.preventDefault(), n.current = -1;
845
- const d = i(), v = r();
846
- d.removeEventListener("mousemove", u), v.removeEventListener("mousemove", u);
847
- }, [n, i, r, u]), f = T((h) => (d) => {
848
- d.preventDefault();
849
- const v = h.current?.parentElement, p = h.current?.parentElement?.parentElement;
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;
850
859
  if (p) {
851
- let y = p.getElementsByTagName("td");
852
- y.length === 0 && (y = p.getElementsByTagName("th"));
853
- for (let A = 0; A < y.length; A++)
854
- y[A] === v && (n.current = A);
855
- const b = i(), g = r();
856
- b.addEventListener("mousemove", u), g.addEventListener("mousemove", u);
860
+ let S = p.getElementsByTagName("td");
861
+ S.length === 0 && (S = p.getElementsByTagName("th"));
862
+ for (let y = 0; y < S.length; y++)
863
+ S[y] === A && (s.current = y);
864
+ const M = i(), g = r();
865
+ M.addEventListener("mousemove", d), g.addEventListener("mousemove", d);
857
866
  } else
858
867
  console.error("trElement", p);
859
- }, [i, r, u, n]);
868
+ }, [i, r, d, s]);
860
869
  return {
861
870
  datagridResizerMouseUp: l,
862
871
  datagridResizerMouseDown: c,
863
872
  datagridCellResizerMouseUp: m,
864
873
  datagridCellResizerMouseDownFunc: f
865
874
  };
866
- }, nn = (s) => {
875
+ }, dn = (t) => {
867
876
  const e = k(null);
868
- return en(e, s.resourceAreaColumn, s.schedulantApi), /* @__PURE__ */ a("th", { role: "columnheader", className: "schedulant-datagrid-cell", children: /* @__PURE__ */ a(
869
- G,
877
+ return an(e, t.resourceAreaColumn, t.schedulantApi), /* @__PURE__ */ a("th", { role: "columnheader", className: "schedulant-datagrid-cell", children: /* @__PURE__ */ a(
878
+ Z,
870
879
  {
871
- disabled: !s.schedulantApi.isEnableResourceLabelContextMenu(),
880
+ disabled: !t.schedulantApi.isEnableResourceLabelContextMenu(),
872
881
  destroyOnHidden: !0,
873
882
  trigger: ["contextMenu"],
874
883
  menu: {
875
- items: s.schedulantApi.getResourceLabelContextMenuItems(),
876
- onClick: (t) => {
877
- const { key: n, keyPath: i, domEvent: r } = t;
878
- s.schedulantApi.onResourceLabelContextMenuClick({
879
- key: n,
884
+ items: t.schedulantApi.getResourceLabelContextMenuItems(),
885
+ onClick: (n) => {
886
+ const { key: s, keyPath: i, domEvent: r } = n;
887
+ t.schedulantApi.onResourceLabelContextMenuClick({
888
+ key: s,
880
889
  keyPath: i,
881
890
  domEvent: r,
882
- label: s.resourceAreaColumn
891
+ label: t.resourceAreaColumn
883
892
  });
884
893
  }
885
894
  },
886
- children: /* @__PURE__ */ O("div", { className: "schedulant-datagrid-cell-frame", ref: e, children: [
895
+ children: /* @__PURE__ */ I("div", { className: "schedulant-datagrid-cell-frame", ref: e, children: [
887
896
  /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-cushion schedulant-scrollgrid-sync-inner", children: /* @__PURE__ */ a(
888
897
  "span",
889
898
  {
890
899
  className: "schedulant-datagrid-cell-main",
891
- children: s.resourceAreaColumn.headerContent
900
+ children: t.resourceAreaColumn.headerContent
892
901
  }
893
902
  ) }),
894
- /* @__PURE__ */ a(W, { condition: s.isResizable, children: /* @__PURE__ */ a(
903
+ /* @__PURE__ */ a(H, { condition: t.isResizable, children: /* @__PURE__ */ a(
895
904
  "div",
896
905
  {
897
906
  className: "schedulant-datagrid-cell-resizer",
898
- onMouseUp: s.cellResizerMouseUp,
899
- onMouseDown: s.cellResizerMouseDownFunc(e)
907
+ onMouseUp: t.cellResizerMouseUp,
908
+ onMouseDown: t.cellResizerMouseDownFunc(e)
900
909
  }
901
910
  ) })
902
911
  ] })
903
912
  }
904
913
  ) });
905
- }, sn = (s, e, t, n) => {
914
+ }, un = (t, e, n, s) => {
906
915
  N(() => {
907
- const i = s.current;
916
+ const i = t.current;
908
917
  if (i)
909
- return t.resourceLaneDidMount({
918
+ return n.resourceLaneDidMount({
910
919
  el: i,
911
- schedulantApi: t,
912
- resourceApi: n,
920
+ schedulantApi: n,
921
+ resourceApi: s,
913
922
  label: e
914
923
  }), () => {
915
- t.resourceLaneWillUnmount({
924
+ n.resourceLaneWillUnmount({
916
925
  el: i,
917
- schedulantApi: t,
918
- resourceApi: n,
926
+ schedulantApi: n,
927
+ resourceApi: s,
919
928
  label: e
920
929
  });
921
930
  };
922
- }, [s, e, t, n]);
923
- };
924
- let Me = null;
925
- function rn(s) {
926
- Me = s, document.querySelectorAll(".schedulant-resource-selected").forEach((n) => n.classList.remove("schedulant-resource-selected")), document.querySelectorAll(`[data-resource-id="${s}"].schedulant-resource`).forEach((n) => n.classList.add("schedulant-resource-selected"));
931
+ }, [t, e, n, s]);
932
+ }, hn = (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() {
952
+ document.querySelectorAll(".schedulant-resource-selected").forEach((t) => t.classList.remove("schedulant-resource-selected"));
953
+ for (const t of L)
954
+ document.querySelectorAll(`[data-resource-id="${t}"].schedulant-resource`).forEach((e) => e.classList.add("schedulant-resource-selected"));
955
+ }
956
+ function ke(t) {
957
+ t?.(Array.from(L));
927
958
  }
928
- function on() {
929
- return Me;
959
+ function ft() {
960
+ return L;
930
961
  }
931
- function at() {
932
- Me = null, document.querySelectorAll(".schedulant-resource-selected").forEach((e) => e.classList.remove("schedulant-resource-selected"));
962
+ function Te(t) {
963
+ L.size !== 0 && (L.clear(), G = null, Re(), ke(t));
933
964
  }
934
- function ln(s) {
935
- const t = s.target.closest("[data-resource-id]");
936
- if (t) {
937
- const n = t.getAttribute("data-resource-id");
938
- n && rn(n);
939
- } else
940
- at();
965
+ function mn(t, e) {
966
+ L.clear(), L.add(t), G = t, Re(), ke(e);
941
967
  }
942
- const an = (s) => {
943
- const { dispatch: e } = be(), t = k(null), i = s.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(s.resourceApi), r = T((v, p) => {
944
- const y = p.getResource();
945
- if (Object.keys(y).includes(v)) {
946
- const A = y[v];
947
- if (typeof A == "string")
948
- return A;
968
+ function gn(t, e, n) {
969
+ const i = t.target.closest("[data-resource-id]");
970
+ if (!i) {
971
+ Te(n);
972
+ return;
973
+ }
974
+ const r = i.getAttribute("data-resource-id");
975
+ if (!r) {
976
+ Te(n);
977
+ return;
978
+ }
979
+ if (t.button === 2 && L.has(r))
980
+ return;
981
+ const o = t.ctrlKey || t.metaKey;
982
+ if (t.shiftKey && G) {
983
+ const c = e.indexOf(G), d = e.indexOf(r);
984
+ if (c !== -1 && d !== -1) {
985
+ const m = Math.min(c, d), f = Math.max(c, d);
986
+ o || L.clear();
987
+ for (let u = m; u <= f; u++)
988
+ L.add(e[u]);
989
+ }
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);
992
+ }
993
+ function fn(t, e, n) {
994
+ const s = ft();
995
+ return s.size > 1 && s.has(e.getId()) ? {
996
+ items: t.getResourceLaneMultiSelectContextMenuItems(),
997
+ onClick: (r) => {
998
+ t.onResourceLaneMultiSelectContextMenuClick({
999
+ key: r.key,
1000
+ keyPath: r.keyPath,
1001
+ domEvent: r.domEvent,
1002
+ selectedResourceIds: Array.from(s),
1003
+ schedulantApi: t,
1004
+ label: n
1005
+ });
1006
+ }
1007
+ } : {
1008
+ items: t.getResourceLaneContextMenuItems(),
1009
+ onClick: (r) => {
1010
+ t.onResourceLaneContextMenuClick({
1011
+ key: r.key,
1012
+ keyPath: r.keyPath,
1013
+ domEvent: r.domEvent,
1014
+ schedulantApi: t,
1015
+ resourceApi: e,
1016
+ label: n
1017
+ });
1018
+ }
1019
+ };
1020
+ }
1021
+ const pn = (t) => {
1022
+ const { dispatch: e } = De(), n = k(null), i = t.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(t.resourceApi), r = C((y, v) => {
1023
+ const b = v.getResource();
1024
+ if (Object.keys(b).includes(y)) {
1025
+ const O = b[y];
1026
+ if (typeof O == "string")
1027
+ return O;
949
1028
  } else {
950
- const A = y.extendedProps?.[v];
951
- if (typeof A == "string" || typeof A == "number")
952
- return A;
1029
+ const O = b.extendedProps?.[y];
1030
+ if (typeof O == "string" || typeof O == "number")
1031
+ return O;
953
1032
  }
954
1033
  return "";
955
1034
  }, []);
956
- sn(t, s.resourceAreaColumn, s.schedulantApi, s.resourceApi);
957
- const o = s.resourceApi.getId(), l = !s.isDraggable || !s.showPlusSquare, { attributes: c, listeners: u, setNodeRef: m, isDragging: f } = Dt({
1035
+ un(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 } = Lt({
958
1037
  id: o,
959
1038
  disabled: l,
960
1039
  transition: null
961
- }), h = s.overId === o && s.activeId !== o, d = () => {
962
- const v = ["schedulant-datagrid-cell", "schedulant-resource"];
963
- return on() === o && v.push("schedulant-resource-selected"), s.isDraggable && f && v.push("schedulant-resource-dragging"), s.isDraggable && h && s.dropPosition && v.push(`schedulant-resource-drop-${s.dropPosition}`), v.join(" ");
964
- };
1040
+ }), u = t.overId === o && t.activeId !== o, h = () => {
1041
+ const y = ["schedulant-datagrid-cell", "schedulant-resource"];
1042
+ 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(" ");
1043
+ }, [A, p] = re(!1), [S, M] = re({}), g = C((y) => {
1044
+ y && M(fn(t.schedulantApi, t.resourceApi, t.resourceAreaColumn)), p(y);
1045
+ }, [t.schedulantApi, t.resourceApi, t.resourceAreaColumn]);
965
1046
  return /* @__PURE__ */ a(
966
1047
  "td",
967
1048
  {
968
1049
  ref: m,
969
- "data-resource-id": s.resourceApi.getId(),
970
- className: d(),
971
- ...l ? {} : { ...c, ...u },
1050
+ "data-resource-id": t.resourceApi.getId(),
1051
+ className: h(),
1052
+ ...l ? {} : { ...c, ...d },
972
1053
  children: /* @__PURE__ */ a(
973
- G,
1054
+ Z,
974
1055
  {
975
- disabled: !s.schedulantApi.isEnableResourceLaneContextMenu(),
1056
+ disabled: !t.schedulantApi.isEnableResourceLaneContextMenu(),
976
1057
  destroyOnHidden: !0,
977
1058
  trigger: ["contextMenu"],
978
- menu: {
979
- items: s.schedulantApi.getResourceLaneContextMenuItems(),
980
- onClick: (v) => {
981
- const { key: p, keyPath: y, domEvent: b } = v;
982
- s.schedulantApi.onResourceLaneContextMenuClick({
983
- key: p,
984
- keyPath: y,
985
- domEvent: b,
986
- schedulantApi: s.schedulantApi,
987
- resourceApi: s.resourceApi,
988
- label: s.resourceAreaColumn
989
- });
990
- }
991
- },
992
- children: /* @__PURE__ */ O(
1059
+ open: A,
1060
+ onOpenChange: g,
1061
+ menu: S,
1062
+ children: /* @__PURE__ */ I(
993
1063
  "div",
994
1064
  {
995
1065
  className: "schedulant-datagrid-cell-frame",
996
1066
  style: { height: w(i) },
997
- ref: t,
1067
+ ref: n,
998
1068
  children: [
999
- /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-cushion schedulant-scrollgrid-sync-inner", children: /* @__PURE__ */ O(Et, { size: "small", children: [
1000
- s.showPlusSquare && /* @__PURE__ */ O(
1069
+ /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-cushion schedulant-scrollgrid-sync-inner", children: /* @__PURE__ */ I(It, { size: "small", children: [
1070
+ t.showPlusSquare && /* @__PURE__ */ I(
1001
1071
  "span",
1002
1072
  {
1003
1073
  className: "schedulant-datagrid-expander schedulant-datagrid-expander-placeholder",
1004
1074
  children: [
1005
- s.showIndentation && Array.from({ length: s.resourceApi.getDepth() }, (v, p) => /* @__PURE__ */ a("span", { className: "schedulant-icon" }, p + 1)),
1006
- /* @__PURE__ */ a("span", { className: "schedulant-icon", children: s.collapseIds.some((v) => v === s.resourceApi.getId()) ? /* @__PURE__ */ a(
1007
- Ct,
1075
+ t.showIndentation && Array.from({ length: t.resourceApi.getDepth() }, (y, v) => /* @__PURE__ */ a("span", { className: "schedulant-icon" }, v + 1)),
1076
+ /* @__PURE__ */ a("span", { className: "schedulant-icon", children: t.collapseIds.some((y) => y === t.resourceApi.getId()) ? /* @__PURE__ */ a(
1077
+ Ot,
1008
1078
  {
1009
1079
  onClick: () => e({
1010
1080
  type: "EXPAND_RESOURCE",
1011
- id: s.resourceApi.getId()
1081
+ id: t.resourceApi.getId()
1012
1082
  })
1013
1083
  }
1014
- ) : s.resourceApi.getChildren().length > 0 ? /* @__PURE__ */ a(
1015
- Tt,
1084
+ ) : t.resourceApi.getChildren().length > 0 ? /* @__PURE__ */ a(
1085
+ Pt,
1016
1086
  {
1017
1087
  onClick: () => e({
1018
1088
  type: "COLLAPSE_RESOURCE",
1019
- id: s.resourceApi.getId()
1089
+ id: t.resourceApi.getId()
1020
1090
  })
1021
1091
  }
1022
1092
  ) : null })
1023
1093
  ]
1024
1094
  }
1025
1095
  ),
1026
- /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-main", children: r(s.resourceAreaColumn.field, s.resourceApi) })
1096
+ /* @__PURE__ */ I("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(hn, { width: 14, height: 14, color: "#91003c" }) })
1099
+ ] })
1027
1100
  ] }) }),
1028
- /* @__PURE__ */ a(W, { condition: s.isResizable, children: /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-resizer", onMouseUp: s.cellResizerMouseUp, onMouseDown: s.cellResizerMouseDownFunc(t) }) })
1101
+ /* @__PURE__ */ a(H, { condition: t.isResizable, children: /* @__PURE__ */ a("div", { className: "schedulant-datagrid-cell-resizer", onMouseUp: t.cellResizerMouseUp, onMouseDown: t.cellResizerMouseDownFunc(n) }) })
1029
1102
  ]
1030
1103
  }
1031
1104
  )
@@ -1033,17 +1106,17 @@ const an = (s) => {
1033
1106
  )
1034
1107
  }
1035
1108
  );
1036
- }, cn = (s) => /* @__PURE__ */ a("colgroup", { children: s.resourceAreaColumns.map((e) => /* @__PURE__ */ a("col", { style: { minWidth: Ut } }, e.field)) }), dn = () => /* @__PURE__ */ a("div", { className: "schedulant-timeline-lane" }), un = (s, e, t) => {
1037
- const n = t.getStart(), i = t.getEnd(), r = i.isBefore(E(), "day"), o = n.isAfter(E(), "day"), l = n.isSameOrBefore(E(), "day") && (i.isAfter(E(), "day") || i.isSame(E(), "day"));
1109
+ }, yn = (t) => /* @__PURE__ */ a("colgroup", { children: t.resourceAreaColumns.map((e) => /* @__PURE__ */ a("col", { style: { minWidth: Zt } }, e.field)) }), vn = () => /* @__PURE__ */ a("div", { className: "schedulant-timeline-lane" }), Sn = (t, e, n) => {
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"));
1038
1111
  return N(() => {
1039
- const c = s.current;
1112
+ const c = t.current;
1040
1113
  if (c)
1041
1114
  return e.eventDidMount({
1042
1115
  el: c,
1043
1116
  isPast: r,
1044
1117
  isFuture: o,
1045
1118
  isProcess: l,
1046
- eventApi: t,
1119
+ eventApi: n,
1047
1120
  schedulantApi: e
1048
1121
  }), () => {
1049
1122
  e.eventWillUnmount({
@@ -1051,434 +1124,434 @@ const an = (s) => {
1051
1124
  isPast: r,
1052
1125
  isFuture: o,
1053
1126
  isProcess: l,
1054
- eventApi: t,
1127
+ eventApi: n,
1055
1128
  schedulantApi: e
1056
1129
  });
1057
1130
  };
1058
- }, [s, e, t, r, o, l]), { isPast: r, isFuture: o, isProcess: l };
1131
+ }, [t, e, n, r, o, l]), { isPast: r, isFuture: o, isProcess: l };
1059
1132
  };
1060
- var ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1061
- function hn(s) {
1062
- return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
1133
+ var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1134
+ function An(t) {
1135
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1063
1136
  }
1064
- var oe, Ne;
1065
- function we() {
1066
- if (Ne) return oe;
1067
- Ne = 1;
1068
- function s(e) {
1069
- var t = typeof e;
1070
- return e != null && (t == "object" || t == "function");
1071
- }
1072
- return oe = s, oe;
1137
+ var ue, Fe;
1138
+ function xe() {
1139
+ if (Fe) return ue;
1140
+ Fe = 1;
1141
+ function t(e) {
1142
+ var n = typeof e;
1143
+ return e != null && (n == "object" || n == "function");
1144
+ }
1145
+ return ue = t, ue;
1073
1146
  }
1074
- var le, Le;
1075
- function mn() {
1076
- if (Le) return le;
1077
- Le = 1;
1078
- var s = typeof ee == "object" && ee && ee.Object === Object && ee;
1079
- return le = s, le;
1147
+ var he, Be;
1148
+ function Mn() {
1149
+ if (Be) return he;
1150
+ Be = 1;
1151
+ var t = typeof se == "object" && se && se.Object === Object && se;
1152
+ return he = t, he;
1080
1153
  }
1081
- var ae, Ye;
1082
- function ct() {
1083
- if (Ye) return ae;
1084
- Ye = 1;
1085
- var s = mn(), e = typeof self == "object" && self && self.Object === Object && self, t = s || e || Function("return this")();
1086
- return ae = t, ae;
1154
+ var me, qe;
1155
+ function pt() {
1156
+ if (qe) return me;
1157
+ qe = 1;
1158
+ var t = Mn(), e = typeof self == "object" && self && self.Object === Object && self, n = t || e || Function("return this")();
1159
+ return me = n, me;
1087
1160
  }
1088
- var ce, _e;
1089
- function gn() {
1090
- if (_e) return ce;
1091
- _e = 1;
1092
- var s = ct(), e = function() {
1093
- return s.Date.now();
1161
+ var ge, Ue;
1162
+ function bn() {
1163
+ if (Ue) return ge;
1164
+ Ue = 1;
1165
+ var t = pt(), e = function() {
1166
+ return t.Date.now();
1094
1167
  };
1095
- return ce = e, ce;
1168
+ return ge = e, ge;
1096
1169
  }
1097
- var de, We;
1098
- function fn() {
1099
- if (We) return de;
1100
- We = 1;
1101
- var s = /\s/;
1102
- function e(t) {
1103
- for (var n = t.length; n-- && s.test(t.charAt(n)); )
1170
+ var fe, je;
1171
+ function wn() {
1172
+ if (je) return fe;
1173
+ je = 1;
1174
+ var t = /\s/;
1175
+ function e(n) {
1176
+ for (var s = n.length; s-- && t.test(n.charAt(s)); )
1104
1177
  ;
1105
- return n;
1178
+ return s;
1106
1179
  }
1107
- return de = e, de;
1180
+ return fe = e, fe;
1108
1181
  }
1109
- var ue, He;
1110
- function pn() {
1111
- if (He) return ue;
1112
- He = 1;
1113
- var s = fn(), e = /^\s+/;
1114
- function t(n) {
1115
- return n && n.slice(0, s(n) + 1).replace(e, "");
1182
+ var pe, $e;
1183
+ function En() {
1184
+ if ($e) return pe;
1185
+ $e = 1;
1186
+ var t = wn(), e = /^\s+/;
1187
+ function n(s) {
1188
+ return s && s.slice(0, t(s) + 1).replace(e, "");
1116
1189
  }
1117
- return ue = t, ue;
1190
+ return pe = n, pe;
1118
1191
  }
1119
- var he, ze;
1120
- function dt() {
1121
- if (ze) return he;
1122
- ze = 1;
1123
- var s = ct(), e = s.Symbol;
1124
- return he = e, he;
1192
+ var ye, Ge;
1193
+ function yt() {
1194
+ if (Ge) return ye;
1195
+ Ge = 1;
1196
+ var t = pt(), e = t.Symbol;
1197
+ return ye = e, ye;
1125
1198
  }
1126
- var me, Ve;
1127
- function vn() {
1128
- if (Ve) return me;
1129
- Ve = 1;
1130
- var s = dt(), e = Object.prototype, t = e.hasOwnProperty, n = e.toString, i = s ? s.toStringTag : void 0;
1199
+ var ve, Xe;
1200
+ function Cn() {
1201
+ if (Xe) return ve;
1202
+ Xe = 1;
1203
+ var t = yt(), e = Object.prototype, n = e.hasOwnProperty, s = e.toString, i = t ? t.toStringTag : void 0;
1131
1204
  function r(o) {
1132
- var l = t.call(o, i), c = o[i];
1205
+ var l = n.call(o, i), c = o[i];
1133
1206
  try {
1134
1207
  o[i] = void 0;
1135
- var u = !0;
1208
+ var d = !0;
1136
1209
  } catch {
1137
1210
  }
1138
- var m = n.call(o);
1139
- return u && (l ? o[i] = c : delete o[i]), m;
1211
+ var m = s.call(o);
1212
+ return d && (l ? o[i] = c : delete o[i]), m;
1140
1213
  }
1141
- return me = r, me;
1214
+ return ve = r, ve;
1142
1215
  }
1143
- var ge, Fe;
1144
- function yn() {
1145
- if (Fe) return ge;
1146
- Fe = 1;
1147
- var s = Object.prototype, e = s.toString;
1148
- function t(n) {
1149
- return e.call(n);
1216
+ var Se, Qe;
1217
+ function Tn() {
1218
+ if (Qe) return Se;
1219
+ Qe = 1;
1220
+ var t = Object.prototype, e = t.toString;
1221
+ function n(s) {
1222
+ return e.call(s);
1150
1223
  }
1151
- return ge = t, ge;
1224
+ return Se = n, Se;
1152
1225
  }
1153
- var fe, Be;
1154
- function An() {
1155
- if (Be) return fe;
1156
- Be = 1;
1157
- var s = dt(), e = vn(), t = yn(), n = "[object Null]", i = "[object Undefined]", r = s ? s.toStringTag : void 0;
1226
+ var Ae, Ke;
1227
+ function Dn() {
1228
+ if (Ke) return Ae;
1229
+ Ke = 1;
1230
+ var t = yt(), e = Cn(), n = Tn(), s = "[object Null]", i = "[object Undefined]", r = t ? t.toStringTag : void 0;
1158
1231
  function o(l) {
1159
- return l == null ? l === void 0 ? i : n : r && r in Object(l) ? e(l) : t(l);
1232
+ return l == null ? l === void 0 ? i : s : r && r in Object(l) ? e(l) : n(l);
1160
1233
  }
1161
- return fe = o, fe;
1234
+ return Ae = o, Ae;
1162
1235
  }
1163
- var pe, qe;
1164
- function Sn() {
1165
- if (qe) return pe;
1166
- qe = 1;
1167
- function s(e) {
1236
+ var Me, Ze;
1237
+ function Rn() {
1238
+ if (Ze) return Me;
1239
+ Ze = 1;
1240
+ function t(e) {
1168
1241
  return e != null && typeof e == "object";
1169
1242
  }
1170
- return pe = s, pe;
1243
+ return Me = t, Me;
1171
1244
  }
1172
- var ve, Ue;
1173
- function bn() {
1174
- if (Ue) return ve;
1175
- Ue = 1;
1176
- var s = An(), e = Sn(), t = "[object Symbol]";
1177
- function n(i) {
1178
- return typeof i == "symbol" || e(i) && s(i) == t;
1179
- }
1180
- return ve = n, ve;
1245
+ var be, Je;
1246
+ function kn() {
1247
+ if (Je) return be;
1248
+ Je = 1;
1249
+ var t = Dn(), e = Rn(), n = "[object Symbol]";
1250
+ function s(i) {
1251
+ return typeof i == "symbol" || e(i) && t(i) == n;
1252
+ }
1253
+ return be = s, be;
1181
1254
  }
1182
- var ye, je;
1183
- function Mn() {
1184
- if (je) return ye;
1185
- je = 1;
1186
- var s = pn(), e = we(), t = bn(), n = NaN, i = /^[-+]0x[0-9a-f]+$/i, r = /^0b[01]+$/i, o = /^0o[0-7]+$/i, l = parseInt;
1187
- function c(u) {
1188
- if (typeof u == "number")
1189
- return u;
1190
- if (t(u))
1191
- return n;
1192
- if (e(u)) {
1193
- var m = typeof u.valueOf == "function" ? u.valueOf() : u;
1194
- u = e(m) ? m + "" : m;
1255
+ var we, et;
1256
+ function xn() {
1257
+ if (et) return we;
1258
+ et = 1;
1259
+ var t = En(), e = xe(), n = kn(), s = NaN, i = /^[-+]0x[0-9a-f]+$/i, r = /^0b[01]+$/i, o = /^0o[0-7]+$/i, l = parseInt;
1260
+ function c(d) {
1261
+ if (typeof d == "number")
1262
+ return d;
1263
+ if (n(d))
1264
+ return s;
1265
+ if (e(d)) {
1266
+ var m = typeof d.valueOf == "function" ? d.valueOf() : d;
1267
+ d = e(m) ? m + "" : m;
1195
1268
  }
1196
- if (typeof u != "string")
1197
- return u === 0 ? u : +u;
1198
- u = s(u);
1199
- var f = r.test(u);
1200
- return f || o.test(u) ? l(u.slice(2), f ? 2 : 8) : i.test(u) ? n : +u;
1269
+ if (typeof d != "string")
1270
+ return d === 0 ? d : +d;
1271
+ d = t(d);
1272
+ var f = r.test(d);
1273
+ return f || o.test(d) ? l(d.slice(2), f ? 2 : 8) : i.test(d) ? s : +d;
1201
1274
  }
1202
- return ye = c, ye;
1275
+ return we = c, we;
1203
1276
  }
1204
- var Ae, $e;
1205
- function wn() {
1206
- if ($e) return Ae;
1207
- $e = 1;
1208
- var s = we(), e = gn(), t = Mn(), n = "Expected a function", i = Math.max, r = Math.min;
1209
- function o(l, c, u) {
1210
- var m, f, h, d, v, p, y = 0, b = !1, g = !1, A = !0;
1277
+ var Ee, tt;
1278
+ function In() {
1279
+ if (tt) return Ee;
1280
+ tt = 1;
1281
+ var t = xe(), e = bn(), n = xn(), s = "Expected a function", i = Math.max, r = Math.min;
1282
+ function o(l, c, d) {
1283
+ var m, f, u, h, A, p, S = 0, M = !1, g = !1, y = !0;
1211
1284
  if (typeof l != "function")
1212
- throw new TypeError(n);
1213
- c = t(c) || 0, s(u) && (b = !!u.leading, g = "maxWait" in u, h = g ? i(t(u.maxWait) || 0, c) : h, A = "trailing" in u ? !!u.trailing : A);
1214
- function S(R) {
1215
- var z = m, F = f;
1216
- return m = f = void 0, y = R, d = l.apply(F, z), d;
1285
+ throw new TypeError(s);
1286
+ c = n(c) || 0, t(d) && (M = !!d.leading, g = "maxWait" in d, u = g ? i(n(d.maxWait) || 0, c) : u, y = "trailing" in d ? !!d.trailing : y);
1287
+ function v(R) {
1288
+ var V = m, q = f;
1289
+ return m = f = void 0, S = R, h = l.apply(q, V), h;
1217
1290
  }
1218
- function M(R) {
1219
- return y = R, v = setTimeout(P, c), b ? S(R) : d;
1291
+ function b(R) {
1292
+ return S = R, A = setTimeout(O, c), M ? v(R) : h;
1220
1293
  }
1221
- function C(R) {
1222
- var z = R - p, F = R - y, j = c - z;
1223
- return g ? r(j, h - F) : j;
1294
+ function T(R) {
1295
+ var V = R - p, q = R - S, Q = c - V;
1296
+ return g ? r(Q, u - q) : Q;
1224
1297
  }
1225
1298
  function D(R) {
1226
- var z = R - p, F = R - y;
1227
- return p === void 0 || z >= c || z < 0 || g && F >= h;
1299
+ var V = R - p, q = R - S;
1300
+ return p === void 0 || V >= c || V < 0 || g && q >= u;
1228
1301
  }
1229
- function P() {
1302
+ function O() {
1230
1303
  var R = e();
1231
1304
  if (D(R))
1232
- return I(R);
1233
- v = setTimeout(P, C(R));
1305
+ return P(R);
1306
+ A = setTimeout(O, T(R));
1234
1307
  }
1235
- function I(R) {
1236
- return v = void 0, A && m ? S(R) : (m = f = void 0, d);
1308
+ function P(R) {
1309
+ return A = void 0, y && m ? v(R) : (m = f = void 0, h);
1237
1310
  }
1238
- function L() {
1239
- v !== void 0 && clearTimeout(v), y = 0, m = p = f = v = void 0;
1311
+ function Y() {
1312
+ A !== void 0 && clearTimeout(A), S = 0, m = p = f = A = void 0;
1240
1313
  }
1241
- function H() {
1242
- return v === void 0 ? d : I(e());
1314
+ function z() {
1315
+ return A === void 0 ? h : P(e());
1243
1316
  }
1244
- function Y() {
1245
- var R = e(), z = D(R);
1246
- if (m = arguments, f = this, p = R, z) {
1247
- if (v === void 0)
1248
- return M(p);
1317
+ function _() {
1318
+ var R = e(), V = D(R);
1319
+ if (m = arguments, f = this, p = R, V) {
1320
+ if (A === void 0)
1321
+ return b(p);
1249
1322
  if (g)
1250
- return clearTimeout(v), v = setTimeout(P, c), S(p);
1323
+ return clearTimeout(A), A = setTimeout(O, c), v(p);
1251
1324
  }
1252
- return v === void 0 && (v = setTimeout(P, c)), d;
1325
+ return A === void 0 && (A = setTimeout(O, c)), h;
1253
1326
  }
1254
- return Y.cancel = L, Y.flush = H, Y;
1327
+ return _.cancel = Y, _.flush = z, _;
1255
1328
  }
1256
- return Ae = o, Ae;
1329
+ return Ee = o, Ee;
1257
1330
  }
1258
- var Se, Ge;
1259
- function En() {
1260
- if (Ge) return Se;
1261
- Ge = 1;
1262
- var s = wn(), e = we(), t = "Expected a function";
1263
- function n(i, r, o) {
1331
+ var Ce, nt;
1332
+ function On() {
1333
+ if (nt) return Ce;
1334
+ nt = 1;
1335
+ var t = In(), e = xe(), n = "Expected a function";
1336
+ function s(i, r, o) {
1264
1337
  var l = !0, c = !0;
1265
1338
  if (typeof i != "function")
1266
- throw new TypeError(t);
1267
- return e(o) && (l = "leading" in o ? !!o.leading : l, c = "trailing" in o ? !!o.trailing : c), s(i, r, {
1339
+ throw new TypeError(n);
1340
+ return e(o) && (l = "leading" in o ? !!o.leading : l, c = "trailing" in o ? !!o.trailing : c), t(i, r, {
1268
1341
  leading: l,
1269
1342
  maxWait: r,
1270
1343
  trailing: c
1271
1344
  });
1272
1345
  }
1273
- return Se = n, Se;
1346
+ return Ce = s, Ce;
1274
1347
  }
1275
- var Cn = En();
1276
- const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
1277
- const e = B(() => "schedulant-timeline-event-position-guide", []), t = k(0), n = k(0), i = k(0), r = k(!1), o = k("none"), l = T((g) => {
1278
- const M = s.schedulantApi.getScheduleView().getTimelineView(), C = g - t.current, D = s.timelineWidth, P = M.getTotalSlots(), I = Math.round(C / D * P), L = I / P * D;
1279
- return { moveSlots: I, distance: L, deltaX: C };
1280
- }, [s]), c = T((g) => {
1281
- const A = s.schedulantApi.getScheduleView().getTimelineView(), S = g.style.left, M = g.style.right, C = A.calculateLaneHeight(s.resourceApi), D = document.createElement("div");
1348
+ var Pn = On();
1349
+ const vt = /* @__PURE__ */ An(Pn), Ln = (t) => {
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) => {
1351
+ const b = t.schedulantApi.getScheduleView().getTimelineView(), T = g - n.current, D = t.timelineWidth, O = b.getTotalSlots(), P = Math.round(T / D * O), Y = P / O * D;
1352
+ return { moveSlots: P, distance: Y, deltaX: T };
1353
+ }, [t]), c = C((g) => {
1354
+ const y = t.schedulantApi.getScheduleView().getTimelineView(), v = g.style.left, b = g.style.right, T = y.calculateLaneHeight(t.resourceApi), D = document.createElement("div");
1282
1355
  D.className = e, Object.assign(D.style, {
1283
1356
  position: "absolute",
1284
1357
  zIndex: 1,
1285
- left: S,
1286
- right: M,
1287
- height: w(C),
1288
- backgroundColor: s.schedulantApi.getDragHintColor()
1358
+ left: v,
1359
+ right: b,
1360
+ height: w(T),
1361
+ backgroundColor: t.schedulantApi.getDragHintColor()
1289
1362
  }), g.parentNode?.insertBefore(D, g);
1290
- }, [s, e]), u = T((g) => {
1291
- const A = g.previousElementSibling;
1292
- A?.className === e && g.parentElement?.removeChild(A);
1293
- }, [e]), m = T((g, A) => {
1294
- const S = g.previousElementSibling;
1295
- if (S && S.className === e) {
1296
- const M = o.current, { distance: C } = l(A);
1297
- switch (M) {
1363
+ }, [t, e]), d = C((g) => {
1364
+ const y = g.previousElementSibling;
1365
+ y?.className === e && g.parentElement?.removeChild(y);
1366
+ }, [e]), m = C((g, y) => {
1367
+ const v = g.previousElementSibling;
1368
+ if (v && v.className === e) {
1369
+ const b = o.current, { distance: T } = l(y);
1370
+ switch (b) {
1298
1371
  case "press_event": {
1299
- S.style.left = w(Math.max(n.current + C, 0)), S.style.right = w(i.current - C);
1372
+ v.style.left = w(Math.max(s.current + T, 0)), v.style.right = w(i.current - T);
1300
1373
  break;
1301
1374
  }
1302
1375
  case "press_event_left": {
1303
- const D = Math.max(n.current + C, 0);
1304
- S.style.left = w(D);
1376
+ const D = Math.max(s.current + T, 0);
1377
+ v.style.left = w(D);
1305
1378
  break;
1306
1379
  }
1307
1380
  case "press_event_right": {
1308
- const D = i.current - C;
1309
- S.style.right = w(D);
1381
+ const D = i.current - T;
1382
+ v.style.right = w(D);
1310
1383
  break;
1311
1384
  }
1312
1385
  }
1313
1386
  }
1314
- }, [l, e]), f = T((g, A) => {
1315
- const S = s.eventApi, M = s.schedulantApi, C = o.current, { moveSlots: D, distance: P } = l(A);
1316
- switch (C) {
1387
+ }, [l, e]), f = C((g, y) => {
1388
+ const v = t.eventApi, b = t.schedulantApi, T = o.current, { moveSlots: D, distance: O } = l(y);
1389
+ switch (T) {
1317
1390
  case "press_event": {
1318
- g.style.left = w(Math.max(n.current + P, 0)), g.style.right = w(i.current - P);
1319
- const I = S.getStart().add(D, "day"), L = S.getEnd().add(D, "day");
1320
- M.eventMove({
1391
+ g.style.left = w(Math.max(s.current + O, 0)), g.style.right = w(i.current - O);
1392
+ const P = v.getStart().add(D, "day"), Y = v.getEnd().add(D, "day");
1393
+ b.eventMove({
1321
1394
  el: g,
1322
- startDate: I,
1323
- endDate: L,
1324
- eventApi: S,
1325
- schedulantApi: M
1395
+ startDate: P,
1396
+ endDate: Y,
1397
+ eventApi: v,
1398
+ schedulantApi: b
1326
1399
  });
1327
1400
  break;
1328
1401
  }
1329
1402
  case "press_event_left": {
1330
- const I = Math.max(n.current + P, 0);
1331
- g.style.left = w(I);
1332
- const L = S.getStart().add(D, "day");
1333
- M.eventResizeStart({
1403
+ const P = Math.max(s.current + O, 0);
1404
+ g.style.left = w(P);
1405
+ const Y = v.getStart().add(D, "day");
1406
+ b.eventResizeStart({
1334
1407
  el: g,
1335
- date: L,
1336
- eventApi: S,
1337
- schedulantApi: M
1408
+ date: Y,
1409
+ eventApi: v,
1410
+ schedulantApi: b
1338
1411
  });
1339
1412
  break;
1340
1413
  }
1341
1414
  case "press_event_right": {
1342
- const I = i.current - P;
1343
- g.style.right = w(I);
1344
- const L = S.getEnd().add(D, "day");
1345
- M.eventResizeEnd({
1415
+ const P = i.current - O;
1416
+ g.style.right = w(P);
1417
+ const Y = v.getEnd().add(D, "day");
1418
+ b.eventResizeEnd({
1346
1419
  el: g,
1347
- date: L,
1348
- eventApi: S,
1349
- schedulantApi: M
1420
+ date: Y,
1421
+ eventApi: v,
1422
+ schedulantApi: b
1350
1423
  });
1351
1424
  break;
1352
1425
  }
1353
1426
  }
1354
- }, [s, l]), h = T((g) => {
1427
+ }, [t, l]), u = C((g) => {
1355
1428
  g.preventDefault();
1356
- const A = r.current, S = s.timelineEventHarnessRef.current;
1357
- if (A && S) {
1358
- const { deltaX: M } = l(g.clientX), C = n.current + M, D = i.current - M;
1429
+ const y = r.current, v = t.timelineEventHarnessRef.current;
1430
+ if (y && v) {
1431
+ const { deltaX: b } = l(g.clientX), T = s.current + b, D = i.current - b;
1359
1432
  switch (o.current) {
1360
1433
  case "press_event":
1361
- S.style.left = w(C), S.style.right = w(D);
1434
+ v.style.left = w(T), v.style.right = w(D);
1362
1435
  break;
1363
1436
  case "press_event_left":
1364
- S.style.left = w(C);
1437
+ v.style.left = w(T);
1365
1438
  break;
1366
1439
  case "press_event_right":
1367
- S.style.right = w(D);
1440
+ v.style.right = w(D);
1368
1441
  break;
1369
1442
  }
1370
- m(S, g.clientX);
1443
+ m(v, g.clientX);
1371
1444
  }
1372
- }, [s.timelineEventHarnessRef, m, l]), d = B(
1373
- () => ut(h, lt),
1374
- [h]
1375
- ), v = T((g, A) => {
1445
+ }, [t.timelineEventHarnessRef, m, l]), h = F(
1446
+ () => vt(u, gt),
1447
+ [u]
1448
+ ), A = C((g, y) => {
1376
1449
  g.preventDefault();
1377
- const S = s.schedulantApi.getSchedulantElRef().current, M = s.timelineEventHarnessRef.current;
1378
- M && S ? (r.current = !0, o.current = A, t.current = g.clientX, n.current = ne(M.style.left), i.current = ne(M.style.right), c(M), S.addEventListener("mousemove", d)) : (console.error("scheduleEl", S), console.error("timelineEventHarness", M));
1379
- }, [s.schedulantApi, s.timelineEventHarnessRef, c, d]), p = T((g) => {
1380
- v(g, "press_event");
1381
- }, [v]), y = T((g) => {
1382
- v(g, "press_event_left");
1383
- }, [v]), b = T((g) => {
1384
- v(g, "press_event_right");
1385
- }, [v]);
1450
+ const v = t.schedulantApi.getSchedulantElRef().current, b = t.timelineEventHarnessRef.current;
1451
+ b && v ? (r.current = !0, o.current = y, n.current = g.clientX, s.current = oe(b.style.left), i.current = oe(b.style.right), c(b), v.addEventListener("mousemove", h)) : (console.error("scheduleEl", v), console.error("timelineEventHarness", b));
1452
+ }, [t.schedulantApi, t.timelineEventHarnessRef, c, h]), p = C((g) => {
1453
+ A(g, "press_event");
1454
+ }, [A]), S = C((g) => {
1455
+ A(g, "press_event_left");
1456
+ }, [A]), M = C((g) => {
1457
+ A(g, "press_event_right");
1458
+ }, [A]);
1386
1459
  return N(() => {
1387
- const g = s.timelineEventHarnessRef.current, A = s.schedulantApi.getSchedulantElRef().current;
1388
- if (A && g) {
1389
- const S = g.parentElement?.parentElement;
1390
- if (S) {
1391
- const M = (C) => {
1392
- C.preventDefault(), r.current && !S.contains(C.relatedTarget) && (u(g), f(g, C.clientX), A.removeEventListener("mousemove", d), r.current = !1, o.current = "none");
1460
+ const g = t.timelineEventHarnessRef.current, y = t.schedulantApi.getSchedulantElRef().current;
1461
+ if (y && g) {
1462
+ const v = g.parentElement?.parentElement;
1463
+ if (v) {
1464
+ const b = (T) => {
1465
+ T.preventDefault(), r.current && !v.contains(T.relatedTarget) && (d(g), f(g, T.clientX), y.removeEventListener("mousemove", h), r.current = !1, o.current = "none");
1393
1466
  };
1394
- return S.addEventListener("mouseup", M), S.addEventListener("mouseout", M), () => {
1395
- S.removeEventListener("mouseup", M), S.removeEventListener("mouseout", M), A.removeEventListener("mousemove", d), d.cancel();
1467
+ return v.addEventListener("mouseup", b), v.addEventListener("mouseout", b), () => {
1468
+ v.removeEventListener("mouseup", b), v.removeEventListener("mouseout", b), y.removeEventListener("mousemove", h), h.cancel();
1396
1469
  };
1397
1470
  }
1398
1471
  }
1399
- }, [d, s, u, f]), { handleMouseDown: p, leftHandleMouseDown: y, rightHandleMouseDown: b };
1400
- }, Xe = (s) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
1472
+ }, [h, t, d, f]), { handleMouseDown: p, leftHandleMouseDown: S, rightHandleMouseDown: M };
1473
+ }, st = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
1401
1474
  "svg",
1402
1475
  {
1403
1476
  className: "triangle-left-icon",
1404
1477
  viewBox: "0 0 1024 1024",
1405
1478
  version: "1.1",
1406
1479
  xmlns: "http://www.w3.org/2000/svg",
1407
- width: `${w(s.width)}`,
1408
- height: `${w(s.height)}`,
1480
+ width: `${w(t.width)}`,
1481
+ height: `${w(t.height)}`,
1409
1482
  children: /* @__PURE__ */ a(
1410
1483
  "path",
1411
1484
  {
1412
1485
  d: "M765.533 115.367c0-46.168-61.65-75.692-97.005-40.324L271.127 472.426c-22.791 22.791-22.791 56.687 0 79.477l397.4 397.396c34.469 34.481 97.006 7.598 97.006-39.74V115.367z",
1413
- fill: s.color
1486
+ fill: t.color
1414
1487
  }
1415
1488
  )
1416
1489
  }
1417
- ), ...s }), Qe = (s) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
1490
+ ), ...t }), it = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
1418
1491
  "svg",
1419
1492
  {
1420
1493
  className: "drag-icon",
1421
1494
  viewBox: "0 0 1024 1024",
1422
1495
  version: "1.1",
1423
1496
  xmlns: "http://www.w3.org/2000/svg",
1424
- width: `${w(s.width)}`,
1425
- height: `${w(s.height)}`,
1426
- children: /* @__PURE__ */ a("path", { d: "M368 0h32v1024h-32zM496 0h32v1024h-32zM624 0h32v1024h-32z", fill: s.color })
1497
+ width: `${w(t.width)}`,
1498
+ height: `${w(t.height)}`,
1499
+ children: /* @__PURE__ */ a("path", { d: "M368 0h32v1024h-32zM496 0h32v1024h-32zM624 0h32v1024h-32z", fill: t.color })
1427
1500
  }
1428
- ), ...s }), Ke = (s) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
1501
+ ), ...t }), rt = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ a(
1429
1502
  "svg",
1430
1503
  {
1431
1504
  className: "triangle-left-icon",
1432
1505
  viewBox: "0 0 1024 1024",
1433
1506
  version: "1.1",
1434
1507
  xmlns: "http://www.w3.org/2000/svg",
1435
- width: `${w(s.width)}`,
1436
- height: `${w(s.height)}`,
1508
+ width: `${w(t.width)}`,
1509
+ height: `${w(t.height)}`,
1437
1510
  children: /* @__PURE__ */ a(
1438
1511
  "path",
1439
1512
  {
1440
1513
  d: "M258.467 115.367c0-46.168 61.65-75.692 97.005-40.324l397.396 397.396c22.791 22.791 22.791 56.687 0 79.477L355.472 989.779c-34.469 34.481-97.006 7.598-97.006-39.74V115.367z",
1441
- fill: s.color
1514
+ fill: t.color
1442
1515
  }
1443
1516
  )
1444
1517
  }
1445
- ), ...s }), Dn = ie((s) => {
1446
- const e = k(null), t = k(null), n = s.schedulantApi.getTimelineApi(), i = s.schedulantApi.getScheduleView().getTimelineView(), r = s.eventApi.getTextColor().getOrElse("white"), o = s.eventApi.getBorderColor().getOrElse(s.eventApi.getColor()), l = s.eventApi.getBackgroundColor().getOrElse(s.eventApi.getColor()), c = i.calculateLaneHeight(s.resourceApi), u = i.calculateEventHeight(), m = (c - u) / 2 - 1, { isPast: f, isFuture: h, isProcess: d } = un(e, s.schedulantApi, s.eventApi), { handleMouseDown: v, leftHandleMouseDown: p, rightHandleMouseDown: y } = Tn({
1447
- timelineEventHarnessRef: t,
1448
- timelineWidth: s.timelineWidth,
1449
- eventApi: s.eventApi,
1450
- resourceApi: s.resourceApi,
1451
- schedulantApi: s.schedulantApi
1518
+ ), ...t }), Nn = ae((t) => {
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: u, isProcess: h } = Sn(e, t.schedulantApi, t.eventApi), { handleMouseDown: A, leftHandleMouseDown: p, rightHandleMouseDown: S } = Ln({
1520
+ timelineEventHarnessRef: n,
1521
+ timelineWidth: t.timelineWidth,
1522
+ eventApi: t.eventApi,
1523
+ resourceApi: t.resourceApi,
1524
+ schedulantApi: t.schedulantApi
1452
1525
  });
1453
- return /* @__PURE__ */ a("div", { className: "schedulant-timeline-event-harness", ref: t, style: {
1526
+ return /* @__PURE__ */ a("div", { className: "schedulant-timeline-event-harness", ref: n, style: {
1454
1527
  top: w(m),
1455
- height: w(u),
1456
- lineHeight: w(u),
1457
- left: w(s.position.left),
1458
- right: w(s.position.right)
1528
+ height: w(d),
1529
+ lineHeight: w(d),
1530
+ left: w(t.position.left),
1531
+ right: w(t.position.right)
1459
1532
  }, children: /* @__PURE__ */ a(
1460
- G,
1533
+ Z,
1461
1534
  {
1462
- disabled: !s.schedulantApi.isEnableEventContextMenu(),
1535
+ disabled: !t.schedulantApi.isEnableEventContextMenu(),
1463
1536
  destroyOnHidden: !0,
1464
1537
  trigger: ["contextMenu"],
1465
1538
  menu: {
1466
- items: s.schedulantApi.getEventContextMenuItems(),
1467
- onClick: (b) => {
1468
- const { key: g, keyPath: A, domEvent: S } = b;
1469
- s.schedulantApi.onEventContextMenuClick({
1539
+ items: t.schedulantApi.getEventContextMenuItems(),
1540
+ onClick: (M) => {
1541
+ const { key: g, keyPath: y, domEvent: v } = M;
1542
+ t.schedulantApi.onEventContextMenuClick({
1470
1543
  key: g,
1471
- keyPath: A,
1472
- domEvent: S,
1544
+ keyPath: y,
1545
+ domEvent: v,
1473
1546
  isPast: f,
1474
- isFuture: h,
1475
- isProcess: d,
1476
- eventApi: s.eventApi,
1477
- schedulantApi: s.schedulantApi
1547
+ isFuture: u,
1548
+ isProcess: h,
1549
+ eventApi: t.eventApi,
1550
+ schedulantApi: t.schedulantApi
1478
1551
  });
1479
1552
  }
1480
1553
  },
1481
- children: /* @__PURE__ */ O(
1554
+ children: /* @__PURE__ */ I(
1482
1555
  "div",
1483
1556
  {
1484
1557
  className: "schedulant-timeline-event",
@@ -1486,29 +1559,29 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
1486
1559
  ref: e,
1487
1560
  children: [
1488
1561
  /* @__PURE__ */ a(
1489
- W,
1562
+ H,
1490
1563
  {
1491
- condition: s.schedulantApi.isEditable(),
1564
+ condition: t.schedulantApi.isEditable(),
1492
1565
  fallback: /* @__PURE__ */ a(
1493
- W,
1566
+ H,
1494
1567
  {
1495
- condition: s.eventApi.getStart().isBefore(n.getStart()),
1496
- fallback: /* @__PURE__ */ a("div", { style: { width: _, height: u } }),
1497
- children: /* @__PURE__ */ a(Xe, { width: _, height: u, color: "#FFFFFF" })
1568
+ condition: t.eventApi.getStart().isBefore(s.getStart()),
1569
+ fallback: /* @__PURE__ */ a("div", { style: { width: W, height: d } }),
1570
+ children: /* @__PURE__ */ a(st, { width: W, height: d, color: "#FFFFFF" })
1498
1571
  }
1499
1572
  ),
1500
1573
  children: /* @__PURE__ */ a(
1501
- W,
1574
+ H,
1502
1575
  {
1503
- condition: !s.eventApi.getStart().isBefore(n.getStart()),
1504
- fallback: /* @__PURE__ */ a(Xe, { width: _, height: u, color: "#FFFFFF" }),
1576
+ condition: !t.eventApi.getStart().isBefore(s.getStart()),
1577
+ fallback: /* @__PURE__ */ a(st, { width: W, height: d, color: "#FFFFFF" }),
1505
1578
  children: /* @__PURE__ */ a(
1506
1579
  "div",
1507
1580
  {
1508
1581
  className: "schedulant-event-resize-handle",
1509
1582
  onMouseDown: p,
1510
- style: { width: _, height: u, cursor: "ew-resize" },
1511
- children: /* @__PURE__ */ a(Qe, { width: _, height: u, color: "#FFFFFF" })
1583
+ style: { width: W, height: d, cursor: "ew-resize" },
1584
+ children: /* @__PURE__ */ a(it, { width: W, height: d, color: "#FFFFFF" })
1512
1585
  }
1513
1586
  )
1514
1587
  }
@@ -1516,25 +1589,25 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
1516
1589
  }
1517
1590
  ),
1518
1591
  /* @__PURE__ */ a(
1519
- W,
1592
+ H,
1520
1593
  {
1521
- condition: s.schedulantApi.isEditable() && !s.eventApi.getStart().isBefore(n.getStart()) && s.eventApi.getEnd().isSameOrBefore(n.getEnd()),
1594
+ condition: t.schedulantApi.isEditable() && !t.eventApi.getStart().isBefore(s.getStart()) && t.eventApi.getEnd().isSameOrBefore(s.getEnd()),
1522
1595
  fallback: /* @__PURE__ */ a(
1523
1596
  "div",
1524
1597
  {
1525
1598
  className: "schedulant-event-main",
1526
- style: { color: r, width: `calc(100% - ${_ * 2}px)` },
1599
+ style: { color: r, width: `calc(100% - ${W * 2}px)` },
1527
1600
  children: /* @__PURE__ */ a(
1528
- W,
1601
+ H,
1529
1602
  {
1530
- condition: s.eventApi.getUrl().isDefined(),
1531
- fallback: /* @__PURE__ */ a("span", { children: s.eventApi.getTitle() }),
1532
- children: s.eventApi.getUrl().isDefined() && /* @__PURE__ */ a(
1603
+ condition: t.eventApi.getUrl().isDefined(),
1604
+ fallback: /* @__PURE__ */ a("span", { children: t.eventApi.getTitle() }),
1605
+ children: t.eventApi.getUrl().isDefined() && /* @__PURE__ */ a(
1533
1606
  "a",
1534
1607
  {
1535
- href: s.eventApi.getUrl().get(),
1608
+ href: t.eventApi.getUrl().get(),
1536
1609
  style: { color: "inherit" },
1537
- children: s.eventApi.getTitle()
1610
+ children: t.eventApi.getTitle()
1538
1611
  }
1539
1612
  )
1540
1613
  }
@@ -1545,19 +1618,19 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
1545
1618
  "div",
1546
1619
  {
1547
1620
  className: "schedulant-event-main",
1548
- style: { color: r, width: `calc(100% - ${_ * 2}px)`, cursor: "grab" },
1549
- onMouseDown: v,
1621
+ style: { color: r, width: `calc(100% - ${W * 2}px)`, cursor: "grab" },
1622
+ onMouseDown: A,
1550
1623
  children: /* @__PURE__ */ a(
1551
- W,
1624
+ H,
1552
1625
  {
1553
- condition: s.eventApi.getUrl().isDefined(),
1554
- fallback: /* @__PURE__ */ a("span", { children: s.eventApi.getTitle() }),
1555
- children: s.eventApi.getUrl().isDefined() && /* @__PURE__ */ a(
1626
+ condition: t.eventApi.getUrl().isDefined(),
1627
+ fallback: /* @__PURE__ */ a("span", { children: t.eventApi.getTitle() }),
1628
+ children: t.eventApi.getUrl().isDefined() && /* @__PURE__ */ a(
1556
1629
  "a",
1557
1630
  {
1558
- href: s.eventApi.getUrl().get(),
1631
+ href: t.eventApi.getUrl().get(),
1559
1632
  style: { color: "inherit" },
1560
- children: s.eventApi.getTitle()
1633
+ children: t.eventApi.getTitle()
1561
1634
  }
1562
1635
  )
1563
1636
  }
@@ -1567,29 +1640,29 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
1567
1640
  }
1568
1641
  ),
1569
1642
  /* @__PURE__ */ a(
1570
- W,
1643
+ H,
1571
1644
  {
1572
- condition: s.schedulantApi.isEditable(),
1645
+ condition: t.schedulantApi.isEditable(),
1573
1646
  fallback: /* @__PURE__ */ a(
1574
- W,
1647
+ H,
1575
1648
  {
1576
- condition: s.eventApi.getEnd().isAfter(n.getEnd()),
1577
- fallback: /* @__PURE__ */ a("div", { style: { width: _, height: u } }),
1578
- children: /* @__PURE__ */ a(Ke, { width: _, height: u, color: "#FFFFFF" })
1649
+ condition: t.eventApi.getEnd().isAfter(s.getEnd()),
1650
+ fallback: /* @__PURE__ */ a("div", { style: { width: W, height: d } }),
1651
+ children: /* @__PURE__ */ a(rt, { width: W, height: d, color: "#FFFFFF" })
1579
1652
  }
1580
1653
  ),
1581
1654
  children: /* @__PURE__ */ a(
1582
- W,
1655
+ H,
1583
1656
  {
1584
- condition: s.eventApi.getEnd().isSameOrBefore(n.getEnd()),
1585
- fallback: /* @__PURE__ */ a(Ke, { width: _, height: u, color: "#FFFFFF" }),
1657
+ condition: t.eventApi.getEnd().isSameOrBefore(s.getEnd()),
1658
+ fallback: /* @__PURE__ */ a(rt, { width: W, height: d, color: "#FFFFFF" }),
1586
1659
  children: /* @__PURE__ */ a(
1587
1660
  "div",
1588
1661
  {
1589
1662
  className: "schedulant-event-resize-handle",
1590
- onMouseDown: y,
1591
- style: { width: _, height: u, cursor: "ew-resize" },
1592
- children: /* @__PURE__ */ a(Qe, { width: _, height: u, color: "#FFFFFF" })
1663
+ onMouseDown: S,
1664
+ style: { width: W, height: d, cursor: "ew-resize" },
1665
+ children: /* @__PURE__ */ a(it, { width: W, height: d, color: "#FFFFFF" })
1593
1666
  }
1594
1667
  )
1595
1668
  }
@@ -1601,17 +1674,17 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
1601
1674
  )
1602
1675
  }
1603
1676
  ) });
1604
- }), Rn = (s, e, t) => {
1605
- const n = t.getTime(), i = n.isBefore(E(), "day"), r = n.isAfter(E(), "day"), o = n.isSame(E(), "day");
1677
+ }), Yn = (t, e, n) => {
1678
+ const s = n.getTime(), i = s.isBefore(E(), "day"), r = s.isAfter(E(), "day"), o = s.isSame(E(), "day");
1606
1679
  return N(() => {
1607
- const l = s.current;
1680
+ const l = t.current;
1608
1681
  if (l)
1609
1682
  return e.milestoneDidMount({
1610
1683
  el: l,
1611
1684
  isPast: i,
1612
1685
  isFuture: r,
1613
1686
  isProcess: o,
1614
- milestoneApi: t,
1687
+ milestoneApi: n,
1615
1688
  schedulantApi: e
1616
1689
  }), () => {
1617
1690
  e.milestoneWillUnmount({
@@ -1619,102 +1692,102 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
1619
1692
  isPast: i,
1620
1693
  isFuture: r,
1621
1694
  isProcess: o,
1622
- milestoneApi: t,
1695
+ milestoneApi: n,
1623
1696
  schedulantApi: e
1624
1697
  });
1625
1698
  };
1626
- }, [e, t, s, i, r, o]), { isPast: i, isFuture: r, isProcess: o };
1627
- }, ht = (s) => {
1628
- const e = B(() => "schedulant-timeline-marker-position-guide", []), t = k(0), n = k(0), i = k(0), r = k(!1), o = T((p) => {
1629
- const y = p.style.left, b = p.style.right, g = s.schedulantApi.getScheduleView().getTimelineView(), A = s.milestoneApi?.getResourceApi() ?? s.checkpointApi?.getResourceApi(), S = g.calculateLaneHeight(A), M = document.createElement("div");
1630
- M.className = e, Object.assign(M.style, {
1699
+ }, [e, n, t, i, r, o]), { isPast: i, isFuture: r, isProcess: o };
1700
+ }, St = (t) => {
1701
+ const e = F(() => "schedulant-timeline-marker-position-guide", []), n = k(0), s = k(0), i = k(0), r = k(!1), o = C((p) => {
1702
+ const S = p.style.left, M = p.style.right, g = t.schedulantApi.getScheduleView().getTimelineView(), y = t.milestoneApi?.getResourceApi() ?? t.checkpointApi?.getResourceApi(), v = g.calculateLaneHeight(y), b = document.createElement("div");
1703
+ b.className = e, Object.assign(b.style, {
1631
1704
  position: "absolute",
1632
1705
  zIndex: 1,
1633
- left: y,
1634
- right: b,
1635
- height: w(S),
1636
- backgroundColor: s.schedulantApi.getDragHintColor()
1637
- }), p.parentNode?.insertBefore(M, p);
1638
- }, [s, e]), l = T((p) => {
1639
- const y = p.previousElementSibling;
1640
- y?.className === e && p.parentElement?.removeChild(y);
1641
- }, [e]), c = T((p) => {
1642
- const g = s.schedulantApi.getScheduleView().getTimelineView(), A = p - t.current, S = s.timelineWidth, M = g.getTotalSlots(), C = Math.round(A / S * M), D = C / M * s.timelineWidth;
1706
+ left: S,
1707
+ right: M,
1708
+ height: w(v),
1709
+ backgroundColor: t.schedulantApi.getDragHintColor()
1710
+ }), p.parentNode?.insertBefore(b, p);
1711
+ }, [t, e]), l = C((p) => {
1712
+ const S = p.previousElementSibling;
1713
+ S?.className === e && p.parentElement?.removeChild(S);
1714
+ }, [e]), c = C((p) => {
1715
+ const g = t.schedulantApi.getScheduleView().getTimelineView(), y = p - n.current, v = t.timelineWidth, b = g.getTotalSlots(), T = Math.round(y / v * b), D = T / b * t.timelineWidth;
1643
1716
  return {
1644
- moveSlots: C,
1717
+ moveSlots: T,
1645
1718
  distance: D,
1646
- deltaX: A,
1647
- totalWidth: S,
1648
- totalSlots: M
1719
+ deltaX: y,
1720
+ totalWidth: v,
1721
+ totalSlots: b
1649
1722
  };
1650
- }, [s]), u = T((p, y) => {
1651
- const b = p.previousElementSibling;
1652
- if (b && b.className === e) {
1653
- const { distance: g } = c(y);
1654
- b.style.left = w(Math.max(n.current + g, 0)), b.style.right = w(i.current - g);
1723
+ }, [t]), d = C((p, S) => {
1724
+ const M = p.previousElementSibling;
1725
+ if (M && M.className === e) {
1726
+ const { distance: g } = c(S);
1727
+ M.style.left = w(Math.max(s.current + g, 0)), M.style.right = w(i.current - g);
1655
1728
  }
1656
- }, [e, c]), m = T((p, y) => {
1657
- const { moveSlots: b, distance: g } = c(y);
1658
- if (p.style.left = w(Math.max(n.current + g, 0)), p.style.right = w(i.current - g), s.milestoneApi) {
1659
- const A = s.milestoneApi.getTime().add(b, "day");
1660
- s.schedulantApi.milestoneMove({
1729
+ }, [e, c]), m = C((p, S) => {
1730
+ const { moveSlots: M, distance: g } = c(S);
1731
+ if (p.style.left = w(Math.max(s.current + g, 0)), p.style.right = w(i.current - g), t.milestoneApi) {
1732
+ const y = t.milestoneApi.getTime().add(M, "day");
1733
+ t.schedulantApi.milestoneMove({
1661
1734
  el: p,
1662
- date: A,
1663
- schedulantApi: s.schedulantApi,
1664
- milestoneApi: s.milestoneApi
1735
+ date: y,
1736
+ schedulantApi: t.schedulantApi,
1737
+ milestoneApi: t.milestoneApi
1665
1738
  });
1666
- } else if (s.checkpointApi) {
1667
- const A = s.checkpointApi.getTime().add(b, "day");
1668
- s.schedulantApi.checkpointMove({
1739
+ } else if (t.checkpointApi) {
1740
+ const y = t.checkpointApi.getTime().add(M, "day");
1741
+ t.schedulantApi.checkpointMove({
1669
1742
  el: p,
1670
- date: A,
1671
- schedulantApi: s.schedulantApi,
1672
- checkpointApi: s.checkpointApi
1743
+ date: y,
1744
+ schedulantApi: t.schedulantApi,
1745
+ checkpointApi: t.checkpointApi
1673
1746
  });
1674
1747
  }
1675
- t.current = 0;
1676
- }, [s, c]), f = T((p) => {
1748
+ n.current = 0;
1749
+ }, [t, c]), f = C((p) => {
1677
1750
  p.preventDefault();
1678
- const y = s.markerRef.current, b = r.current;
1679
- if (y && b) {
1680
- const g = p.clientX - t.current, A = n.current + g, S = i.current - g;
1681
- y.style.left = w(A), y.style.right = w(S), u(y, p.clientX);
1751
+ const S = t.markerRef.current, M = r.current;
1752
+ if (S && M) {
1753
+ const g = p.clientX - n.current, y = s.current + g, v = i.current - g;
1754
+ S.style.left = w(y), S.style.right = w(v), d(S, p.clientX);
1682
1755
  }
1683
- }, [s.markerRef, u]), h = B(
1684
- () => ut(f, lt),
1756
+ }, [t.markerRef, d]), u = F(
1757
+ () => vt(f, gt),
1685
1758
  [f]
1686
- ), d = T((p) => {
1759
+ ), h = C((p) => {
1687
1760
  p.preventDefault();
1688
- const y = s.markerRef.current, b = r.current, g = s.schedulantApi.getSchedulantElRef().current;
1689
- b && g && y && (l(y), m(y, p.clientX), g.removeEventListener("mousemove", h), r.current = !1);
1690
- }, [h, s.markerRef, s.schedulantApi, l, m]), v = T((p) => {
1761
+ const S = t.markerRef.current, M = r.current, g = t.schedulantApi.getSchedulantElRef().current;
1762
+ M && g && S && (l(S), m(S, p.clientX), g.removeEventListener("mousemove", u), r.current = !1);
1763
+ }, [u, t.markerRef, t.schedulantApi, l, m]), A = C((p) => {
1691
1764
  p.preventDefault();
1692
- const y = s.schedulantApi.getSchedulantElRef().current, b = s.markerRef.current;
1693
- y && b && (r.current = !0, t.current = p.clientX, n.current = ne(b.style.left), i.current = ne(b.style.right), o(b), y.addEventListener("mousemove", h));
1694
- }, [o, h, s.markerRef, s.schedulantApi]);
1765
+ const S = t.schedulantApi.getSchedulantElRef().current, M = t.markerRef.current;
1766
+ S && M && (r.current = !0, n.current = p.clientX, s.current = oe(M.style.left), i.current = oe(M.style.right), o(M), S.addEventListener("mousemove", u));
1767
+ }, [o, u, t.markerRef, t.schedulantApi]);
1695
1768
  return N(() => {
1696
- const p = s.schedulantApi.getSchedulantElRef().current, y = s.markerRef.current;
1697
- if (p && y) {
1698
- const b = y.parentElement?.parentElement;
1699
- if (b) {
1700
- const g = (A) => {
1701
- A.preventDefault(), r.current && !b.contains(A.relatedTarget) && (l(y), m(y, A.clientX), p.removeEventListener("mousemove", h), r.current = !1);
1769
+ const p = t.schedulantApi.getSchedulantElRef().current, S = t.markerRef.current;
1770
+ if (p && S) {
1771
+ const M = S.parentElement?.parentElement;
1772
+ if (M) {
1773
+ const g = (y) => {
1774
+ y.preventDefault(), r.current && !M.contains(y.relatedTarget) && (l(S), m(S, y.clientX), p.removeEventListener("mousemove", u), r.current = !1);
1702
1775
  };
1703
- return b.addEventListener("mouseup", g), b.addEventListener("mouseout", g), () => {
1704
- b.removeEventListener("mouseup", g), b.removeEventListener("mouseout", g), p.removeEventListener("mousemove", h), h.cancel();
1776
+ return M.addEventListener("mouseup", g), M.addEventListener("mouseout", g), () => {
1777
+ M.removeEventListener("mouseup", g), M.removeEventListener("mouseout", g), p.removeEventListener("mousemove", u), u.cancel();
1705
1778
  };
1706
1779
  }
1707
1780
  }
1708
- }, [h, s, l, m]), { handleMouseUp: d, handleMouseDown: v };
1709
- }, kn = (s) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ O(
1781
+ }, [u, t, l, m]), { handleMouseUp: h, handleMouseDown: A };
1782
+ }, _n = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ I(
1710
1783
  "svg",
1711
1784
  {
1712
1785
  className: "flag-icon",
1713
1786
  viewBox: "0 0 1024 1024",
1714
1787
  version: "1.1",
1715
1788
  xmlns: "http://www.w3.org/2000/svg",
1716
- width: `${w(s.width)}`,
1717
- height: `${w(s.height)}`,
1789
+ width: `${w(t.width)}`,
1790
+ height: `${w(t.height)}`,
1718
1791
  children: [
1719
1792
  /* @__PURE__ */ a(
1720
1793
  "path",
@@ -1727,60 +1800,60 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
1727
1800
  "path",
1728
1801
  {
1729
1802
  d: "M199.36 829.983s4.357 17.054-28.283 22.814c-29.64 5.228-34.954-12.974-34.954-12.974L90.217 544.696l54.62-44.933 54.523 330.22z m599.465-788.87l-68.562 408.275-8.54 5.693c-3.24 2.191-80.363 53.56-171.305 35.773-34.002-6.656-65.438-17.274-95.713-27.683-40.192-13.655-78.085-26.548-113.603-26.548-124.979 0-195.563 62.516-196.265 63.145l-54.62 44.933L18.036 80.973c0-9.84 9.666-21.366 17.546-29.384C68.739 17.853 220.414 0.563 335.383 0.563c71.563 0 120.694 36.603 160.185 65.966 23.357 17.331 45.373 33.69 65.31 37.74 59.91 11.965 155.792-24.346 187.659-39.424l50.288-23.731z",
1730
- fill: s.color
1803
+ fill: t.color
1731
1804
  }
1732
1805
  )
1733
1806
  ]
1734
1807
  }
1735
- ), ...s }), xn = ie((s) => {
1736
- const e = k(null), t = k(null), n = s.schedulantApi.isEditable(), i = s.milestoneApi.getStatus(), r = s.milestoneApi.getColor().getOrElse(i === "Success" ? "green" : i === "Failure" ? "red" : "yellow"), l = s.schedulantApi.getScheduleView().getTimelineView().calculateLaneHeight(s.milestoneApi.getResourceApi()), c = l * Ft * -1, { isPast: u, isFuture: m, isProcess: f } = Rn(e, s.schedulantApi, s.milestoneApi), { handleMouseUp: h, handleMouseDown: d } = ht({
1737
- markerRef: t,
1738
- timelineWidth: s.timelineWidth,
1739
- schedulantApi: s.schedulantApi,
1740
- milestoneApi: s.milestoneApi
1808
+ ), ...t }), Wn = ae((t) => {
1809
+ 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 } = Yn(e, t.schedulantApi, t.milestoneApi), { handleMouseUp: u, handleMouseDown: h } = St({
1810
+ markerRef: n,
1811
+ timelineWidth: t.timelineWidth,
1812
+ schedulantApi: t.schedulantApi,
1813
+ milestoneApi: t.milestoneApi
1741
1814
  });
1742
1815
  return /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestone-harness", style: {
1743
1816
  top: w(c),
1744
1817
  height: w(l),
1745
1818
  lineHeight: w(l),
1746
- left: w(s.position.left),
1747
- right: w(s.position.right)
1748
- }, onMouseUp: n ? h : void 0, onMouseDown: n ? d : void 0, ref: t, children: /* @__PURE__ */ a(
1749
- G,
1819
+ left: w(t.position.left),
1820
+ right: w(t.position.right)
1821
+ }, onMouseUp: s ? u : void 0, onMouseDown: s ? h : void 0, ref: n, children: /* @__PURE__ */ a(
1822
+ Z,
1750
1823
  {
1751
- disabled: !s.schedulantApi.isEnableMilestoneContextMenu(),
1824
+ disabled: !t.schedulantApi.isEnableMilestoneContextMenu(),
1752
1825
  destroyOnHidden: !0,
1753
1826
  trigger: ["contextMenu"],
1754
1827
  menu: {
1755
- items: s.schedulantApi.getMilestoneContextMenuItems(),
1756
- onClick: (v) => {
1757
- const { key: p, keyPath: y, domEvent: b } = v;
1758
- s.schedulantApi.onMilestoneContextMenuClick({
1828
+ items: t.schedulantApi.getMilestoneContextMenuItems(),
1829
+ onClick: (A) => {
1830
+ const { key: p, keyPath: S, domEvent: M } = A;
1831
+ t.schedulantApi.onMilestoneContextMenuClick({
1759
1832
  key: p,
1760
- keyPath: y,
1761
- domEvent: b,
1762
- isPast: u,
1833
+ keyPath: S,
1834
+ domEvent: M,
1835
+ isPast: d,
1763
1836
  isFuture: m,
1764
1837
  isProcess: f,
1765
- milestoneApi: s.milestoneApi,
1766
- schedulantApi: s.schedulantApi
1838
+ milestoneApi: t.milestoneApi,
1839
+ schedulantApi: t.schedulantApi
1767
1840
  });
1768
1841
  }
1769
1842
  },
1770
- children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestone", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-milestone-main", children: /* @__PURE__ */ a(kn, { width: l * Pe, height: l * Pe, color: r }) }) })
1843
+ children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestone", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-milestone-main", children: /* @__PURE__ */ a(_n, { width: l * Ve, height: l * Ve, color: r }) }) })
1771
1844
  }
1772
1845
  ) });
1773
- }), On = (s, e, t) => {
1774
- const n = t.getTime(), i = n.isBefore(E(), "day"), r = n.isAfter(E(), "day"), o = n.isSame(E(), "day");
1846
+ }), Hn = (t, e, n) => {
1847
+ const s = n.getTime(), i = s.isBefore(E(), "day"), r = s.isAfter(E(), "day"), o = s.isSame(E(), "day");
1775
1848
  return N(() => {
1776
- const l = s.current;
1849
+ const l = t.current;
1777
1850
  if (l)
1778
1851
  return e.checkpointDidMount({
1779
1852
  el: l,
1780
1853
  isPast: i,
1781
1854
  isFuture: r,
1782
1855
  isProcess: o,
1783
- checkpointApi: t,
1856
+ checkpointApi: n,
1784
1857
  schedulantApi: e
1785
1858
  }), () => {
1786
1859
  e.checkpointWillUnmount({
@@ -1788,20 +1861,20 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
1788
1861
  isPast: i,
1789
1862
  isFuture: r,
1790
1863
  isProcess: o,
1791
- checkpointApi: t,
1864
+ checkpointApi: n,
1792
1865
  schedulantApi: e
1793
1866
  });
1794
1867
  };
1795
- }, [e, t, s, i, r, o]), { isPast: i, isFuture: r, isProcess: o };
1796
- }, In = (s) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ O(
1868
+ }, [e, n, t, i, r, o]), { isPast: i, isFuture: r, isProcess: o };
1869
+ }, zn = (t) => /* @__PURE__ */ a(X, { component: () => /* @__PURE__ */ I(
1797
1870
  "svg",
1798
1871
  {
1799
1872
  className: "droplet-icon",
1800
1873
  viewBox: "0 0 1024 1024",
1801
1874
  version: "1.1",
1802
1875
  xmlns: "http://www.w3.org/2000/svg",
1803
- width: `${w(s.width)}`,
1804
- height: `${w(s.height)}`,
1876
+ width: `${w(t.width)}`,
1877
+ height: `${w(t.height)}`,
1805
1878
  children: [
1806
1879
  /* @__PURE__ */ a(
1807
1880
  "path",
@@ -1814,22 +1887,22 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
1814
1887
  "path",
1815
1888
  {
1816
1889
  d: "m519.91456,697.78863l-177.9252,-204.81251a337.99847,337.99847 0 0 1 -97.70097,-204.53112a252.67817,252.67817 0 0 1 71.47021,-204.65619a288.19443,288.19443 0 0 1 408.31192,0a252.7407,252.7407 0 0 1 71.43895,204.68745a338.09227,338.09227 0 0 1 -97.70098,204.68745l-177.89393,204.59366l0,0.03126zm-4.34574,-636.10369a207.62629,207.62629 0 1 0 207.6263,207.6263a207.87641,207.87641 0 0 0 -207.6263,-207.6263z",
1817
- fill: s.color
1890
+ fill: t.color
1818
1891
  }
1819
1892
  ),
1820
- /* @__PURE__ */ a("path", { d: "M 517,116 A 154,154 0 1 1 517,424 A 154,154 0 1 1 517,116 Z", fill: s.color })
1893
+ /* @__PURE__ */ a("path", { d: "M 517,116 A 154,154 0 1 1 517,424 A 154,154 0 1 1 517,116 Z", fill: t.color })
1821
1894
  ]
1822
1895
  }
1823
- ), ...s }), Pn = ie((s) => {
1824
- const e = k(null), t = k(null), n = s.schedulantApi.isEditable(), i = s.checkpointApi.getColor().getOrElse("black"), r = s.schedulantApi.getScheduleView().getTimelineView(), o = r.calculateLaneHeight(s.checkpointApi.getResourceApi()), l = r.calculateEventHeight(), c = (o - l) / 2 + 2, {
1825
- isPast: u,
1896
+ ), ...t }), Vn = ae((t) => {
1897
+ const e = k(null), n = k(null), s = t.schedulantApi.isEditable(), i = t.checkpointApi.getColor().getOrElse("black"), r = t.schedulantApi.getScheduleView().getTimelineView(), o = r.calculateLaneHeight(t.checkpointApi.getResourceApi()), l = r.calculateEventHeight(), c = (o - l) / 2 + 2, {
1898
+ isPast: d,
1826
1899
  isFuture: m,
1827
1900
  isProcess: f
1828
- } = On(e, s.schedulantApi, s.checkpointApi), { handleMouseUp: h, handleMouseDown: d } = ht({
1829
- markerRef: t,
1830
- timelineWidth: s.timelineWidth,
1831
- schedulantApi: s.schedulantApi,
1832
- checkpointApi: s.checkpointApi
1901
+ } = Hn(e, t.schedulantApi, t.checkpointApi), { handleMouseUp: u, handleMouseDown: h } = St({
1902
+ markerRef: n,
1903
+ timelineWidth: t.timelineWidth,
1904
+ schedulantApi: t.schedulantApi,
1905
+ checkpointApi: t.checkpointApi
1833
1906
  });
1834
1907
  return /* @__PURE__ */ a(
1835
1908
  "div",
@@ -1839,41 +1912,41 @@ const ut = /* @__PURE__ */ hn(Cn), Tn = (s) => {
1839
1912
  top: w(c),
1840
1913
  height: w(l),
1841
1914
  lineHeight: w(l),
1842
- left: w(s.position.left),
1843
- right: w(s.position.right)
1915
+ left: w(t.position.left),
1916
+ right: w(t.position.right)
1844
1917
  },
1845
- onMouseUp: n ? h : void 0,
1846
- onMouseDown: n ? d : void 0,
1847
- ref: t,
1918
+ onMouseUp: s ? u : void 0,
1919
+ onMouseDown: s ? h : void 0,
1920
+ ref: n,
1848
1921
  children: /* @__PURE__ */ a(
1849
- G,
1922
+ Z,
1850
1923
  {
1851
- disabled: !s.schedulantApi.isEnableCheckpointContextMenu(),
1924
+ disabled: !t.schedulantApi.isEnableCheckpointContextMenu(),
1852
1925
  destroyOnHidden: !0,
1853
1926
  trigger: ["contextMenu"],
1854
1927
  menu: {
1855
- items: s.schedulantApi.getCheckpointContextMenuItems(),
1856
- onClick: (v) => {
1857
- const { key: p, keyPath: y, domEvent: b } = v;
1858
- s.schedulantApi.onCheckpointContextMenuClick({
1928
+ items: t.schedulantApi.getCheckpointContextMenuItems(),
1929
+ onClick: (A) => {
1930
+ const { key: p, keyPath: S, domEvent: M } = A;
1931
+ t.schedulantApi.onCheckpointContextMenuClick({
1859
1932
  key: p,
1860
- keyPath: y,
1861
- domEvent: b,
1862
- isPast: u,
1933
+ keyPath: S,
1934
+ domEvent: M,
1935
+ isPast: d,
1863
1936
  isFuture: m,
1864
1937
  isProcess: f,
1865
- checkpointApi: s.checkpointApi,
1866
- schedulantApi: s.schedulantApi
1938
+ checkpointApi: t.checkpointApi,
1939
+ schedulantApi: t.schedulantApi
1867
1940
  });
1868
1941
  }
1869
1942
  },
1870
- children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-checkpoint", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-checkpoint-main", children: /* @__PURE__ */ a(In, { width: l, height: l, color: i }) }) })
1943
+ children: /* @__PURE__ */ a("div", { className: "schedulant-timeline-checkpoint", ref: e, children: /* @__PURE__ */ a("div", { className: "schedulant-checkpoint-main", children: /* @__PURE__ */ a(zn, { width: l, height: l, color: i }) }) })
1871
1944
  }
1872
1945
  )
1873
1946
  }
1874
1947
  );
1875
1948
  });
1876
- class Q {
1949
+ class J {
1877
1950
  schedulantApi;
1878
1951
  constructor(e) {
1879
1952
  this.schedulantApi = e;
@@ -1885,50 +1958,50 @@ class Q {
1885
1958
  return this.schedulantApi.getTimelineApi();
1886
1959
  }
1887
1960
  renderLane() {
1888
- return /* @__PURE__ */ a(dn, {});
1961
+ return /* @__PURE__ */ a(vn, {});
1889
1962
  }
1890
- renderEvents(e, t) {
1891
- const n = this.schedulantApi.getTimelineApi(), i = e.getEventApis();
1892
- return /* @__PURE__ */ a("div", { className: "schedulant-timeline-events schedulant-scrollgrid-sync-inner", children: i.filter((r) => !r.getStart().isAfter(n.getEnd()) && !r.getEnd().isBefore(n.getStart())).map((r) => {
1893
- const o = this.calculatePosition(t, r.getStart(), r.getEnd());
1963
+ renderEvents(e, n) {
1964
+ const s = this.schedulantApi.getTimelineApi(), i = e.getEventApis();
1965
+ return /* @__PURE__ */ a("div", { className: "schedulant-timeline-events schedulant-scrollgrid-sync-inner", children: i.filter((r) => !r.getStart().isAfter(s.getEnd()) && !r.getEnd().isBefore(s.getStart())).map((r) => {
1966
+ const o = this.calculatePosition(n, r.getStart(), r.getEnd());
1894
1967
  return /* @__PURE__ */ a(
1895
- Dn,
1968
+ Nn,
1896
1969
  {
1897
1970
  eventApi: r,
1898
1971
  position: o,
1899
1972
  resourceApi: e,
1900
1973
  schedulantApi: this.schedulantApi,
1901
- timelineWidth: t
1974
+ timelineWidth: n
1902
1975
  },
1903
1976
  r.getId()
1904
1977
  );
1905
1978
  }) });
1906
1979
  }
1907
- renderMilestones(e, t) {
1908
- const n = this.schedulantApi.getTimelineApi(), i = e.getMilestoneApis();
1909
- return /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestones schedulant-scrollgrid-sync-inner", children: i.filter((r) => (r.getTime().isAfter(n.getStart(), "day") || r.getTime().isSame(n.getStart(), "day")) && r.getTime().isSameOrBefore(n.getEnd(), "day")).map((r) => {
1910
- const o = this.calculatePosition(t, r.getTime(), r.getTime());
1980
+ renderMilestones(e, n) {
1981
+ const s = this.schedulantApi.getTimelineApi(), i = e.getMilestoneApis();
1982
+ return /* @__PURE__ */ a("div", { className: "schedulant-timeline-milestones schedulant-scrollgrid-sync-inner", children: i.filter((r) => (r.getTime().isAfter(s.getStart(), "day") || r.getTime().isSame(s.getStart(), "day")) && r.getTime().isSameOrBefore(s.getEnd(), "day")).map((r) => {
1983
+ const o = this.calculatePosition(n, r.getTime(), r.getTime());
1911
1984
  return /* @__PURE__ */ a(
1912
- xn,
1985
+ Wn,
1913
1986
  {
1914
1987
  position: o,
1915
1988
  milestoneApi: r,
1916
- timelineWidth: t,
1989
+ timelineWidth: n,
1917
1990
  schedulantApi: this.schedulantApi
1918
1991
  },
1919
1992
  r.getId()
1920
1993
  );
1921
1994
  }) });
1922
1995
  }
1923
- renderCheckpoints(e, t) {
1924
- const n = this.schedulantApi.getTimelineApi(), i = e.getCheckpointApis();
1925
- return /* @__PURE__ */ a("div", { className: "schedulant-timeline-checkpoints schedulant-scrollgrid-sync-inner", children: i.filter((r) => (r.getTime().isAfter(n.getStart(), "day") || r.getTime().isSame(n.getStart(), "day")) && r.getTime().isSameOrBefore(n.getEnd(), "day")).map((r) => {
1926
- const o = this.calculatePosition(t, r.getTime(), r.getTime());
1996
+ renderCheckpoints(e, n) {
1997
+ const s = this.schedulantApi.getTimelineApi(), i = e.getCheckpointApis();
1998
+ return /* @__PURE__ */ a("div", { className: "schedulant-timeline-checkpoints schedulant-scrollgrid-sync-inner", children: i.filter((r) => (r.getTime().isAfter(s.getStart(), "day") || r.getTime().isSame(s.getStart(), "day")) && r.getTime().isSameOrBefore(s.getEnd(), "day")).map((r) => {
1999
+ const o = this.calculatePosition(n, r.getTime(), r.getTime());
1927
2000
  return /* @__PURE__ */ a(
1928
- Pn,
2001
+ Vn,
1929
2002
  {
1930
2003
  position: o,
1931
- timelineWidth: t,
2004
+ timelineWidth: n,
1932
2005
  checkpointApi: r,
1933
2006
  schedulantApi: this.schedulantApi
1934
2007
  },
@@ -1937,65 +2010,65 @@ class Q {
1937
2010
  }) });
1938
2011
  }
1939
2012
  calculateLaneHeight(e) {
1940
- const t = this.schedulantApi.getTimelineApi().getStart(), n = this.schedulantApi.getTimelineApi().getEnd();
1941
- return e.getMilestoneApis().filter((r) => !r.getTime().isBefore(t) && !r.getTime().isAfter(n)).length === 0 ? this.schedulantApi.getLineHeight() : this.schedulantApi.getLineHeight() * ot;
2013
+ const n = this.schedulantApi.getTimelineApi().getStart(), s = this.schedulantApi.getTimelineApi().getEnd();
2014
+ return e.getMilestoneApis().filter((r) => !r.getTime().isBefore(n) && !r.getTime().isAfter(s)).length === 0 ? this.schedulantApi.getLineHeight() : this.schedulantApi.getLineHeight() * mt;
1942
2015
  }
1943
2016
  calculateEventHeight() {
1944
- return this.schedulantApi.getLineHeight() * Vt;
2017
+ return this.schedulantApi.getLineHeight() * Gt;
1945
2018
  }
1946
2019
  }
1947
- const K = (s) => {
1948
- const { dates: e, minWidth: t } = s;
1949
- return /* @__PURE__ */ a("colgroup", { children: e.map((n) => /* @__PURE__ */ a("col", { style: { minWidth: t } }, n.format("YYYY-MM-DD"))) });
1950
- }, Nn = (s, e, t) => {
1951
- const n = t.isBefore(E(), "day"), i = t.isAfter(E(), "day"), r = t.isSame(E(), "day");
2020
+ const ee = (t) => {
2021
+ const { dates: e, minWidth: n } = t;
2022
+ return /* @__PURE__ */ a("colgroup", { children: e.map((s) => /* @__PURE__ */ a("col", { style: { minWidth: n } }, s.format("YYYY-MM-DD"))) });
2023
+ }, Fn = (t, e, n) => {
2024
+ const s = n.isBefore(E(), "day"), i = n.isAfter(E(), "day"), r = n.isSame(E(), "day");
1952
2025
  N(() => {
1953
- const o = s.current;
2026
+ const o = t.current;
1954
2027
  if (o)
1955
2028
  return e.timelineSlotLaneDidMount({
1956
2029
  el: o,
1957
- isPast: n,
2030
+ isPast: s,
1958
2031
  isFuture: i,
1959
2032
  isProcess: r,
1960
- date: t,
2033
+ date: n,
1961
2034
  slotType: e.getSchedulantViewType(),
1962
2035
  schedulantApi: e
1963
2036
  }), () => {
1964
2037
  e.timelineSlotLaneWillUnmount({
1965
2038
  el: o,
1966
- isPast: n,
2039
+ isPast: s,
1967
2040
  isFuture: i,
1968
2041
  isProcess: r,
1969
- date: t,
2042
+ date: n,
1970
2043
  slotType: e.getSchedulantViewType(),
1971
2044
  schedulantApi: e
1972
2045
  });
1973
2046
  };
1974
- }, [t, i, n, r, e, s]);
1975
- }, Z = ie((s) => {
2047
+ }, [n, i, s, r, e, t]);
2048
+ }, te = ae((t) => {
1976
2049
  const e = k(null);
1977
- return Nn(e, s.schedulantApi, s.date), /* @__PURE__ */ a(
2050
+ return Fn(e, t.schedulantApi, t.date), /* @__PURE__ */ a(
1978
2051
  "td",
1979
2052
  {
1980
2053
  ref: e,
1981
- "data-date": s.dataDate,
2054
+ "data-date": t.dataDate,
1982
2055
  className: "schedulant-timeline-slot schedulant-timeline-slot-lane",
1983
- children: /* @__PURE__ */ a("div", { className: `schedulant-timeline-slot-frame ${s.classNames?.join(" ")}` })
2056
+ children: /* @__PURE__ */ a("div", { className: `schedulant-timeline-slot-frame ${t.classNames?.join(" ")}` })
1984
2057
  },
1985
- s.date.format("YYYY-MM-DD")
2058
+ t.date.format("YYYY-MM-DD")
1986
2059
  );
1987
- }), Ln = (s, e, t, n, i) => {
1988
- const r = t.isBefore(E(), "day"), o = t.isAfter(E(), "day"), l = t.isSame(E(), "day");
2060
+ }), Bn = (t, e, n, s, i) => {
2061
+ const r = n.isBefore(E(), "day"), o = n.isAfter(E(), "day"), l = n.isSame(E(), "day");
1989
2062
  N(() => {
1990
- const c = s.current;
2063
+ const c = t.current;
1991
2064
  if (c)
1992
2065
  return e.timelineSlotLabelDidMount({
1993
2066
  el: c,
1994
2067
  isPast: r,
1995
2068
  isFuture: o,
1996
2069
  isProcess: l,
1997
- date: t,
1998
- level: n,
2070
+ date: n,
2071
+ level: s,
1999
2072
  timeText: i,
2000
2073
  slotType: e.getSchedulantViewType(),
2001
2074
  schedulantApi: e
@@ -2005,58 +2078,58 @@ const K = (s) => {
2005
2078
  isPast: r,
2006
2079
  isFuture: o,
2007
2080
  isProcess: l,
2008
- date: t,
2009
- level: n,
2081
+ date: n,
2082
+ level: s,
2010
2083
  timeText: i,
2011
2084
  slotType: e.getSchedulantViewType(),
2012
2085
  schedulantApi: e
2013
2086
  });
2014
2087
  };
2015
- }, [t, o, r, l, n, e, i, s]);
2016
- }, V = (s) => {
2088
+ }, [n, o, r, l, s, e, i, t]);
2089
+ }, B = (t) => {
2017
2090
  const e = k(null);
2018
- return Ln(e, s.schedulantApi, s.date, s.level, s.timeText), /* @__PURE__ */ a(
2091
+ return Bn(e, t.schedulantApi, t.date, t.level, t.timeText), /* @__PURE__ */ a(
2019
2092
  "th",
2020
2093
  {
2021
2094
  ref: e,
2022
- colSpan: s.colSpan,
2023
- "data-date": s.dataDate,
2095
+ colSpan: t.colSpan,
2096
+ "data-date": t.dataDate,
2024
2097
  className: "schedulant-timeline-slot schedulant-timeline-slot-label",
2025
- children: /* @__PURE__ */ a("div", { className: `schedulant-timeline-slot-frame ${s.classNames.join(" ")}`, children: /* @__PURE__ */ a(
2098
+ children: /* @__PURE__ */ a("div", { className: `schedulant-timeline-slot-frame ${t.classNames.join(" ")}`, children: /* @__PURE__ */ a(
2026
2099
  "span",
2027
2100
  {
2028
- title: s.dataDate,
2101
+ title: t.dataDate,
2029
2102
  className: "schedulant-timeline-slot-cushion schedulant-scrollgrid-sync-inner",
2030
- children: s.timeText
2103
+ children: t.timeText
2031
2104
  }
2032
2105
  ) })
2033
2106
  },
2034
- s.date.format("YYYY-MM-DD")
2107
+ t.date.format("YYYY-MM-DD")
2035
2108
  );
2036
2109
  };
2037
- class Yn extends Q {
2110
+ class qn extends J {
2038
2111
  renderColgroup() {
2039
- const e = this.getSchedulantApi(), n = this.getTimelineApi().getDays(), i = e.getSlotMinWidth();
2040
- return /* @__PURE__ */ a(K, { dates: n, minWidth: i });
2112
+ const e = this.getSchedulantApi(), s = this.getTimelineApi().getDays(), i = e.getSlotMinWidth();
2113
+ return /* @__PURE__ */ a(ee, { dates: s, minWidth: i });
2041
2114
  }
2042
2115
  renderBodySlots() {
2043
- const e = this.getTimelineApi(), t = e.getDays();
2044
- return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: t.map((n) => /* @__PURE__ */ a(
2045
- Z,
2116
+ const e = this.getTimelineApi(), n = e.getDays();
2117
+ return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: n.map((s) => /* @__PURE__ */ a(
2118
+ te,
2046
2119
  {
2047
- date: n,
2048
- dataDate: n.format("YYYY-MM-DD"),
2049
- classNames: ["schedulant-day", n.isSame(E(), "day") ? "schedulant-today-body" : "", e.isHoliday(n) ? "schedulant-holiday" : ""],
2120
+ date: s,
2121
+ dataDate: s.format("YYYY-MM-DD"),
2122
+ classNames: ["schedulant-day", s.isSame(E(), "day") ? "schedulant-today-body" : "", e.isHoliday(s) ? "schedulant-holiday" : ""],
2050
2123
  schedulantApi: this.getSchedulantApi()
2051
2124
  },
2052
- n.format("YYYY-MM-DD")
2125
+ s.format("YYYY-MM-DD")
2053
2126
  )) }) });
2054
2127
  }
2055
2128
  renderHeaderSlots() {
2056
- const e = this.getTimelineApi(), t = e.getDays(), n = e.populateMonthsWithDays(), i = e.populateYearsWithDays();
2057
- return /* @__PURE__ */ O("tbody", { children: [
2129
+ const e = this.getTimelineApi(), n = e.getDays(), s = e.populateMonthsWithDays(), i = e.populateYearsWithDays();
2130
+ return /* @__PURE__ */ I("tbody", { children: [
2058
2131
  /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: i.map((r) => /* @__PURE__ */ a(
2059
- V,
2132
+ B,
2060
2133
  {
2061
2134
  level: 1,
2062
2135
  date: r.year,
@@ -2068,8 +2141,8 @@ class Yn extends Q {
2068
2141
  },
2069
2142
  r.year.year()
2070
2143
  )) }),
2071
- /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((r) => /* @__PURE__ */ a(
2072
- V,
2144
+ /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: s.map((r) => /* @__PURE__ */ a(
2145
+ B,
2073
2146
  {
2074
2147
  level: 2,
2075
2148
  date: r.month,
@@ -2081,8 +2154,8 @@ class Yn extends Q {
2081
2154
  },
2082
2155
  `${r.month.format("YYYY-MM")}`
2083
2156
  )) }),
2084
- /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: t.map((r) => /* @__PURE__ */ a(
2085
- V,
2157
+ /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((r) => /* @__PURE__ */ a(
2158
+ B,
2086
2159
  {
2087
2160
  level: 3,
2088
2161
  date: r,
@@ -2094,8 +2167,8 @@ class Yn extends Q {
2094
2167
  },
2095
2168
  r.format("YYYY-MM-DD")
2096
2169
  )) }),
2097
- /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: t.map((r) => /* @__PURE__ */ a(
2098
- V,
2170
+ /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((r) => /* @__PURE__ */ a(
2171
+ B,
2099
2172
  {
2100
2173
  level: 4,
2101
2174
  date: r,
@@ -2112,37 +2185,37 @@ class Yn extends Q {
2112
2185
  getTotalSlots() {
2113
2186
  return this.getTimelineApi().getDays().length;
2114
2187
  }
2115
- calculatePosition(e, t, n) {
2116
- const i = this.getTimelineApi(), r = e / i.getDays().length, o = i.getDayPosition(t.isBefore(i.getStart()) ? i.getStart() : t) * r, l = (i.getDayPosition(n.isAfter(i.getEnd()) ? i.getEnd() : n) + 1) * r * -1;
2188
+ calculatePosition(e, n, s) {
2189
+ const i = this.getTimelineApi(), r = e / i.getDays().length, o = i.getDayPosition(n.isBefore(i.getStart()) ? i.getStart() : n) * r, l = (i.getDayPosition(s.isAfter(i.getEnd()) ? i.getEnd() : s) + 1) * r * -1;
2117
2190
  return { left: o, right: l };
2118
2191
  }
2119
2192
  }
2120
- class _n extends Q {
2193
+ class Un extends J {
2121
2194
  getTotalSlots() {
2122
2195
  return this.getTimelineApi().getMonths().length;
2123
2196
  }
2124
2197
  renderColgroup() {
2125
- const e = this.getSchedulantApi(), n = this.getTimelineApi().getMonths(), i = e.getSlotMinWidth();
2126
- return /* @__PURE__ */ a(K, { dates: n, minWidth: i });
2198
+ const e = this.getSchedulantApi(), s = this.getTimelineApi().getMonths(), i = e.getSlotMinWidth();
2199
+ return /* @__PURE__ */ a(ee, { dates: s, minWidth: i });
2127
2200
  }
2128
2201
  renderBodySlots() {
2129
- const t = this.getTimelineApi().getMonths();
2130
- return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: t.map((n) => /* @__PURE__ */ a(
2131
- Z,
2202
+ const n = this.getTimelineApi().getMonths();
2203
+ return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: n.map((s) => /* @__PURE__ */ a(
2204
+ te,
2132
2205
  {
2133
- date: n,
2134
- dataDate: n.format("YYYY-MM"),
2135
- classNames: ["schedulant-month", n.isSame(E(), "month") ? "schedulant-this-month-body" : ""],
2206
+ date: s,
2207
+ dataDate: s.format("YYYY-MM"),
2208
+ classNames: ["schedulant-month", s.isSame(E(), "month") ? "schedulant-this-month-body" : ""],
2136
2209
  schedulantApi: this.getSchedulantApi()
2137
2210
  },
2138
- n.format("YYYY-MM")
2211
+ s.format("YYYY-MM")
2139
2212
  )) }) });
2140
2213
  }
2141
2214
  renderHeaderSlots() {
2142
- const e = this.getTimelineApi(), t = e.getMonths(), n = e.populateYearsWithMonths();
2143
- return /* @__PURE__ */ O("tbody", { children: [
2144
- /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((i) => /* @__PURE__ */ a(
2145
- V,
2215
+ const e = this.getTimelineApi(), n = e.getMonths(), s = e.populateYearsWithMonths();
2216
+ return /* @__PURE__ */ I("tbody", { children: [
2217
+ /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: s.map((i) => /* @__PURE__ */ a(
2218
+ B,
2146
2219
  {
2147
2220
  level: 1,
2148
2221
  date: i.year,
@@ -2154,8 +2227,8 @@ class _n extends Q {
2154
2227
  },
2155
2228
  i.year.year()
2156
2229
  )) }),
2157
- /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: t.map((i) => /* @__PURE__ */ a(
2158
- V,
2230
+ /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((i) => /* @__PURE__ */ a(
2231
+ B,
2159
2232
  {
2160
2233
  level: 2,
2161
2234
  date: i,
@@ -2169,37 +2242,37 @@ class _n extends Q {
2169
2242
  )) })
2170
2243
  ] });
2171
2244
  }
2172
- calculatePosition(e, t, n) {
2173
- const i = this.getTimelineApi(), r = i.getMonths(), o = e / r.length, l = t.isBefore(i.getStart()) ? i.getStart() : t, c = n.isAfter(i.getEnd()) ? i.getEnd() : n, u = l.date() - 1, m = o / l.daysInMonth(), f = i.getMonthPosition(l) * o, h = t.isSameOrBefore(i.getStart(), "day") ? f : f + u * m, d = c.daysInMonth() - c.date(), v = o / c.daysInMonth(), p = (i.getMonthPosition(c) + 1) * o * -1, y = n.isBefore(i.getEnd(), "day") ? p + d * v : p;
2174
- return { left: h, right: y };
2245
+ calculatePosition(e, n, s) {
2246
+ 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;
2247
+ return { left: u, right: S };
2175
2248
  }
2176
2249
  }
2177
- class Wn extends Q {
2250
+ class jn extends J {
2178
2251
  getTotalSlots() {
2179
2252
  return this.getTimelineApi().getQuarters().length;
2180
2253
  }
2181
2254
  renderColgroup() {
2182
- const e = this.getSchedulantApi(), n = this.getTimelineApi().getQuarters(), i = e.getSlotMinWidth();
2183
- return /* @__PURE__ */ a(K, { dates: n, minWidth: i });
2255
+ const e = this.getSchedulantApi(), s = this.getTimelineApi().getQuarters(), i = e.getSlotMinWidth();
2256
+ return /* @__PURE__ */ a(ee, { dates: s, minWidth: i });
2184
2257
  }
2185
2258
  renderBodySlots() {
2186
- const t = this.getTimelineApi().getQuarters();
2187
- return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: t.map((n) => /* @__PURE__ */ a(
2188
- Z,
2259
+ const n = this.getTimelineApi().getQuarters();
2260
+ return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: n.map((s) => /* @__PURE__ */ a(
2261
+ te,
2189
2262
  {
2190
- date: n,
2191
- dataDate: `${n.year()}-Q${n.quarter()}`,
2192
- classNames: ["schedulant-quarter", n.isSame(E(), "quarter") ? "schedulant-this-quarter-body" : ""],
2263
+ date: s,
2264
+ dataDate: `${s.year()}-Q${s.quarter()}`,
2265
+ classNames: ["schedulant-quarter", s.isSame(E(), "quarter") ? "schedulant-this-quarter-body" : ""],
2193
2266
  schedulantApi: this.getSchedulantApi()
2194
2267
  },
2195
- `${n.year()}-Q${n.quarter()}`
2268
+ `${s.year()}-Q${s.quarter()}`
2196
2269
  )) }) });
2197
2270
  }
2198
2271
  renderHeaderSlots() {
2199
- const e = this.getTimelineApi(), t = e.getQuarters(), n = e.populateYearsWithQuarters();
2200
- return /* @__PURE__ */ O("tbody", { children: [
2201
- /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((i) => /* @__PURE__ */ a(
2202
- V,
2272
+ const e = this.getTimelineApi(), n = e.getQuarters(), s = e.populateYearsWithQuarters();
2273
+ return /* @__PURE__ */ I("tbody", { children: [
2274
+ /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: s.map((i) => /* @__PURE__ */ a(
2275
+ B,
2203
2276
  {
2204
2277
  level: 1,
2205
2278
  date: i.year,
@@ -2211,8 +2284,8 @@ class Wn extends Q {
2211
2284
  },
2212
2285
  i.year.year()
2213
2286
  )) }),
2214
- /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: t.map((i) => /* @__PURE__ */ a(
2215
- V,
2287
+ /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((i) => /* @__PURE__ */ a(
2288
+ B,
2216
2289
  {
2217
2290
  level: 2,
2218
2291
  date: i,
@@ -2226,115 +2299,115 @@ class Wn extends Q {
2226
2299
  )) })
2227
2300
  ] });
2228
2301
  }
2229
- calculatePosition(e, t, n) {
2230
- const i = this.getTimelineApi(), r = i.getQuarters(), o = e / r.length, l = t.isBefore(i.getStart()) ? i.getStart() : t, c = n.isAfter(i.getEnd()) ? i.getEnd() : n, u = l.endOf("quarter").diff(l.startOf("quarter"), "day") + 1, m = t.diff(l.startOf("quarter"), "day"), f = o / u, h = m * f, d = i.getQuarterPosition(l) * o, v = t.isSameOrBefore(i.getStart(), "day") ? d : d + h, p = c.endOf("quarter").diff(c.startOf("quarter"), "day") + 1, y = c.endOf("quarter").diff(c, "day"), b = o / p, g = y * b, A = (i.getQuarterPosition(c) + 1) * o * -1, S = n.isBefore(i.getEnd(), "day") ? A + g : A;
2231
- return { left: v, right: S };
2302
+ calculatePosition(e, n, s) {
2303
+ 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"), M = o / p, g = S * M, y = (i.getQuarterPosition(c) + 1) * o * -1, v = s.isBefore(i.getEnd(), "day") ? y + g : y;
2304
+ return { left: A, right: v };
2232
2305
  }
2233
2306
  }
2234
- class Hn extends Q {
2307
+ class $n extends J {
2235
2308
  getTotalSlots() {
2236
2309
  return this.getTimelineApi().getWeeks().length;
2237
2310
  }
2238
2311
  renderColgroup() {
2239
- const e = this.getSchedulantApi(), n = this.getTimelineApi().getWeeks(), i = e.getSlotMinWidth();
2240
- return /* @__PURE__ */ a(K, { dates: n, minWidth: i });
2312
+ const e = this.getSchedulantApi(), s = this.getTimelineApi().getWeeks(), i = e.getSlotMinWidth();
2313
+ return /* @__PURE__ */ a(ee, { dates: s, minWidth: i });
2241
2314
  }
2242
2315
  renderBodySlots() {
2243
- const t = this.getTimelineApi().getWeeks();
2244
- return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: t.map((n) => /* @__PURE__ */ a(
2245
- Z,
2316
+ const n = this.getTimelineApi().getWeeks();
2317
+ return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: n.map((s) => /* @__PURE__ */ a(
2318
+ te,
2246
2319
  {
2247
- date: n,
2248
- dataDate: `${n.format("YYYY-MM-DD")}`,
2249
- classNames: ["schedulant-week", n.isSame(E(), "week") ? "schedulant-this-week-body" : ""],
2320
+ date: s,
2321
+ dataDate: `${s.format("YYYY-MM-DD")}`,
2322
+ classNames: ["schedulant-week", s.isSame(E(), "week") ? "schedulant-this-week-body" : ""],
2250
2323
  schedulantApi: this.getSchedulantApi()
2251
2324
  },
2252
- `${n.format("YYYY-MM-DD")}`
2325
+ `${s.format("YYYY-MM-DD")}`
2253
2326
  )) }) });
2254
2327
  }
2255
2328
  renderHeaderSlots() {
2256
- const t = this.getTimelineApi().getWeeks();
2257
- return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: t.map((n) => /* @__PURE__ */ a(
2258
- V,
2329
+ const n = this.getTimelineApi().getWeeks();
2330
+ return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((s) => /* @__PURE__ */ a(
2331
+ B,
2259
2332
  {
2260
2333
  level: 2,
2261
- date: n,
2262
- dataDate: `${n.format("YYYY-MM-DD")}`,
2334
+ date: s,
2335
+ dataDate: `${s.format("YYYY-MM-DD")}`,
2263
2336
  colSpan: 1,
2264
- timeText: `W${n.week().toString().padStart(2, "0")}`,
2265
- classNames: ["schedulant-week", n.isSame(E(), "week") ? "schedulant-this-week-head" : ""],
2337
+ timeText: `W${s.week().toString().padStart(2, "0")}`,
2338
+ classNames: ["schedulant-week", s.isSame(E(), "week") ? "schedulant-this-week-head" : ""],
2266
2339
  schedulantApi: this.getSchedulantApi()
2267
2340
  },
2268
- `${n.format("YYYY-MM-DD")}`
2341
+ `${s.format("YYYY-MM-DD")}`
2269
2342
  )) }) });
2270
2343
  }
2271
- calculatePosition(e, t, n) {
2272
- const i = this.getTimelineApi(), r = i.getWeeks(), o = e / r.length, l = t.isBefore(i.getStart()) ? i.getStart() : t, c = n.isAfter(i.getEnd()) ? i.getEnd() : n, u = o / 7, m = l.day(), f = i.getWeekPosition(l) * o, h = t.isSameOrBefore(i.getStart(), "day") ? f : f + m * u, d = 6 - c.day(), v = (i.getWeekPosition(c) + 1) * o * -1, p = n.isBefore(i.getEnd(), "day") ? v + d * u : v;
2273
- return { left: h, right: p };
2344
+ calculatePosition(e, n, s) {
2345
+ 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;
2346
+ return { left: u, right: p };
2274
2347
  }
2275
2348
  }
2276
- class zn extends Q {
2349
+ class Gn extends J {
2277
2350
  getTotalSlots() {
2278
2351
  return this.getTimelineApi().getYears().length;
2279
2352
  }
2280
2353
  renderColgroup() {
2281
- const e = this.getSchedulantApi(), n = this.getTimelineApi().getYears(), i = e.getSlotMinWidth();
2282
- return /* @__PURE__ */ a(K, { dates: n, minWidth: i });
2354
+ const e = this.getSchedulantApi(), s = this.getTimelineApi().getYears(), i = e.getSlotMinWidth();
2355
+ return /* @__PURE__ */ a(ee, { dates: s, minWidth: i });
2283
2356
  }
2284
2357
  renderBodySlots() {
2285
- const t = this.getTimelineApi().getYears();
2286
- return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: t.map((n) => /* @__PURE__ */ a(
2287
- Z,
2358
+ const n = this.getTimelineApi().getYears();
2359
+ return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", children: n.map((s) => /* @__PURE__ */ a(
2360
+ te,
2288
2361
  {
2289
- date: n,
2290
- dataDate: n.year().toString(),
2291
- classNames: ["schedulant-year", n.isSame(E(), "year") ? "schedulant-this-year-body" : ""],
2362
+ date: s,
2363
+ dataDate: s.year().toString(),
2364
+ classNames: ["schedulant-year", s.isSame(E(), "year") ? "schedulant-this-year-body" : ""],
2292
2365
  schedulantApi: this.getSchedulantApi()
2293
2366
  },
2294
- n.year()
2367
+ s.year()
2295
2368
  )) }) });
2296
2369
  }
2297
2370
  renderHeaderSlots() {
2298
- const t = this.getTimelineApi().getYears();
2299
- return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: t.map((n) => /* @__PURE__ */ a(
2300
- V,
2371
+ const n = this.getTimelineApi().getYears();
2372
+ return /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { role: "row", className: "schedulant-timeline-head-row", children: n.map((s) => /* @__PURE__ */ a(
2373
+ B,
2301
2374
  {
2302
2375
  level: 1,
2303
- date: n,
2304
- dataDate: n.year().toString(),
2376
+ date: s,
2377
+ dataDate: s.year().toString(),
2305
2378
  colSpan: 1,
2306
- timeText: n.year().toString(),
2307
- classNames: ["schedulant-year", n.isSame(E(), "year") ? "schedulant-this-year-head" : ""],
2379
+ timeText: s.year().toString(),
2380
+ classNames: ["schedulant-year", s.isSame(E(), "year") ? "schedulant-this-year-head" : ""],
2308
2381
  schedulantApi: this.getSchedulantApi()
2309
2382
  },
2310
- n.year()
2383
+ s.year()
2311
2384
  )) }) });
2312
2385
  }
2313
- calculatePosition(e, t, n) {
2314
- const i = this.getTimelineApi(), r = i.getYears(), o = e / r.length, l = t.isBefore(i.getStart()) ? i.getStart() : t, c = n.isAfter(i.getEnd()) ? i.getEnd() : n, u = l.endOf("year").diff(l.startOf("year"), "day") + 1, m = l.diff(l.startOf("year"), "day"), f = o / u, h = m * f, d = i.getYearPosition(l) * o, v = t.isSameOrBefore(i.getStart(), "day") ? d : d + h, p = c.endOf("year").diff(c.startOf("year"), "day") + 1, y = c.endOf("year").diff(c, "day"), b = o / p, g = y * b, A = (i.getYearPosition(c) + 1) * o * -1, S = n.isBefore(i.getEnd(), "day") ? A + g : A;
2315
- return { left: v, right: S };
2386
+ calculatePosition(e, n, s) {
2387
+ 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"), M = o / p, g = S * M, y = (i.getYearPosition(c) + 1) * o * -1, v = s.isBefore(i.getEnd(), "day") ? y + g : y;
2388
+ return { left: A, right: v };
2316
2389
  }
2317
2390
  }
2318
- class Vn {
2391
+ class Xn {
2319
2392
  schedulantApi;
2320
2393
  timelineView;
2321
2394
  schedulantElRef;
2322
- constructor(e, t) {
2323
- switch (this.schedulantElRef = t, this.schedulantApi = new Jt(this, e), this.schedulantApi.getSchedulantViewType()) {
2395
+ constructor(e, n) {
2396
+ switch (this.schedulantElRef = n, this.schedulantApi = new ln(this, e), this.schedulantApi.getSchedulantViewType()) {
2324
2397
  case "Day":
2325
- this.timelineView = new Yn(this.schedulantApi);
2398
+ this.timelineView = new qn(this.schedulantApi);
2326
2399
  break;
2327
2400
  case "Week":
2328
- this.timelineView = new Hn(this.schedulantApi);
2401
+ this.timelineView = new $n(this.schedulantApi);
2329
2402
  break;
2330
2403
  case "Month":
2331
- this.timelineView = new _n(this.schedulantApi);
2404
+ this.timelineView = new Un(this.schedulantApi);
2332
2405
  break;
2333
2406
  case "Quarter":
2334
- this.timelineView = new Wn(this.schedulantApi);
2407
+ this.timelineView = new jn(this.schedulantApi);
2335
2408
  break;
2336
2409
  case "Year":
2337
- this.timelineView = new zn(this.schedulantApi);
2410
+ this.timelineView = new Gn(this.schedulantApi);
2338
2411
  break;
2339
2412
  }
2340
2413
  }
@@ -2347,15 +2420,15 @@ class Vn {
2347
2420
  renderTimelineHeaderTableSlots() {
2348
2421
  return this.timelineView.renderHeaderSlots();
2349
2422
  }
2350
- renderTimelineDrawingBoardTable(e, t, n, i) {
2423
+ renderTimelineDrawingBoardTable(e, n, s, i) {
2351
2424
  const r = (c) => {
2352
- const u = this.timelineView.calculateLaneHeight(c);
2425
+ const d = this.timelineView.calculateLaneHeight(c);
2353
2426
  return /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
2354
2427
  "td",
2355
2428
  {
2356
2429
  "data-resource-id": c.getId(),
2357
2430
  className: "schedulant-timeline-lane schedulant-resource",
2358
- children: /* @__PURE__ */ O("div", { className: "schedulant-timeline-lane-frame", style: { height: u }, children: [
2431
+ children: /* @__PURE__ */ I("div", { className: "schedulant-timeline-lane-frame", style: { height: d }, children: [
2359
2432
  this.timelineView.renderLane(),
2360
2433
  /* @__PURE__ */ a("div", { className: "schedulant-timeline-lane-bg" }),
2361
2434
  this.timelineView.renderEvents(c, i),
@@ -2364,36 +2437,36 @@ class Vn {
2364
2437
  ] })
2365
2438
  }
2366
2439
  ) }, c.getId());
2367
- }, o = t.length > 0 ? t[0].start : 0, l = t.length > 0 ? n - t[t.length - 1].end : 0;
2368
- return /* @__PURE__ */ O("tbody", { children: [
2440
+ }, o = n.length > 0 ? n[0].start : 0, l = n.length > 0 ? s - n[n.length - 1].end : 0;
2441
+ return /* @__PURE__ */ I("tbody", { children: [
2369
2442
  o > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { style: { height: o, padding: 0, border: "none" } }) }),
2370
- t.map((c) => {
2371
- const u = e[c.index];
2372
- return r(u);
2443
+ n.map((c) => {
2444
+ const d = e[c.index];
2445
+ return r(d);
2373
2446
  }),
2374
2447
  l > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { style: { height: l, padding: 0, border: "none" } }) })
2375
2448
  ] });
2376
2449
  }
2377
2450
  renderResourceTableColgroup() {
2378
2451
  const e = this.schedulantApi.getResourceAreaColumns();
2379
- return /* @__PURE__ */ a(cn, { resourceAreaColumns: e });
2452
+ return /* @__PURE__ */ a(yn, { resourceAreaColumns: e });
2380
2453
  }
2381
- renderResourceLabel(e, t) {
2382
- const n = this.schedulantApi.getResourceAreaColumns();
2383
- return /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { role: "row", children: n.map((i, r) => /* @__PURE__ */ a(
2384
- nn,
2454
+ renderResourceLabel(e, n) {
2455
+ const s = this.schedulantApi.getResourceAreaColumns();
2456
+ return /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { role: "row", children: s.map((i, r) => /* @__PURE__ */ a(
2457
+ dn,
2385
2458
  {
2386
2459
  schedulantApi: this.schedulantApi,
2387
2460
  cellResizerMouseUp: e,
2388
2461
  resourceAreaColumn: i,
2389
- cellResizerMouseDownFunc: t,
2390
- isResizable: r != n.length - 1
2462
+ cellResizerMouseDownFunc: n,
2463
+ isResizable: r != s.length - 1
2391
2464
  },
2392
2465
  i.field
2393
2466
  )) }) });
2394
2467
  }
2395
- renderResourceLane(e, t, n, i, r, o, l) {
2396
- const c = this.schedulantApi.getResourceAreaColumns(), u = (h) => c.map((d, v) => {
2468
+ renderResourceLane(e, n, s, i, r, o, l) {
2469
+ const c = this.schedulantApi.getResourceAreaColumns(), d = (u) => c.map((h, A) => {
2397
2470
  const p = l ? {
2398
2471
  isDraggable: l.isDraggable,
2399
2472
  activeId: l.dragState.activeId,
@@ -2401,27 +2474,27 @@ class Vn {
2401
2474
  dropPosition: l.dragState.dropPosition
2402
2475
  } : {};
2403
2476
  return /* @__PURE__ */ a(
2404
- an,
2477
+ pn,
2405
2478
  {
2406
2479
  schedulantApi: this.schedulantApi,
2407
- resourceApi: h,
2480
+ resourceApi: u,
2408
2481
  collapseIds: i,
2409
- showPlusSquare: v === 0,
2482
+ showPlusSquare: A === 0,
2410
2483
  showIndentation: !0,
2411
2484
  cellResizerMouseUp: r,
2412
- resourceAreaColumn: d,
2485
+ resourceAreaColumn: h,
2413
2486
  cellResizerMouseDownFunc: o,
2414
- isResizable: v != c.length - 1,
2487
+ isResizable: A != c.length - 1,
2415
2488
  ...p
2416
2489
  },
2417
- d.field
2490
+ h.field
2418
2491
  );
2419
- }), m = t.length > 0 ? t[0].start : 0, f = t.length > 0 ? n - t[t.length - 1].end : 0;
2420
- return /* @__PURE__ */ O("tbody", { children: [
2492
+ }), m = n.length > 0 ? n[0].start : 0, f = n.length > 0 ? s - n[n.length - 1].end : 0;
2493
+ return /* @__PURE__ */ I("tbody", { children: [
2421
2494
  m > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: c.length, style: { height: m, padding: 0, border: "none" } }) }),
2422
- t.map((h) => {
2423
- const d = e[h.index];
2424
- return /* @__PURE__ */ a("tr", { role: "row", children: u(d) }, d.getId());
2495
+ n.map((u) => {
2496
+ const h = e[u.index];
2497
+ return /* @__PURE__ */ a("tr", { role: "row", children: d(h) }, h.getId());
2425
2498
  }),
2426
2499
  f > 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: c.length, style: { height: f, padding: 0, border: "none" } }) })
2427
2500
  ] });
@@ -2436,122 +2509,122 @@ class Vn {
2436
2509
  return this.schedulantElRef;
2437
2510
  }
2438
2511
  }
2439
- const Fn = (s) => {
2440
- const { schedulantView: e, cellResizerMouseUp: t, cellResizerMouseDownFunc: n } = s;
2441
- return /* @__PURE__ */ O("table", { role: "presentation", className: "schedulant-datagrid-head schedulant-scrollgrid-sync-table", children: [
2512
+ const Qn = (t) => {
2513
+ const { schedulantView: e, cellResizerMouseUp: n, cellResizerMouseDownFunc: s } = t;
2514
+ return /* @__PURE__ */ I("table", { role: "presentation", className: "schedulant-datagrid-head schedulant-scrollgrid-sync-table", children: [
2442
2515
  e.renderResourceTableColgroup(),
2443
- e.renderResourceLabel(t, n)
2516
+ e.renderResourceLabel(n, s)
2444
2517
  ] });
2445
- }, Bn = (s) => /* @__PURE__ */ O("table", { "aria-hidden": !0, className: "schedulant-scrollgrid-sync-table", children: [
2446
- s.schedulantView.renderTimelineTableColgroup(),
2447
- s.schedulantView.renderTimelineHeaderTableSlots()
2518
+ }, Kn = (t) => /* @__PURE__ */ I("table", { "aria-hidden": !0, className: "schedulant-scrollgrid-sync-table", children: [
2519
+ t.schedulantView.renderTimelineTableColgroup(),
2520
+ t.schedulantView.renderTimelineHeaderTableSlots()
2448
2521
  ] });
2449
- function qn(s, e) {
2450
- const t = s - e.top, n = e.height;
2451
- return t < n * Bt ? "before" : t > n * qt ? "after" : "child";
2522
+ function Zn(t, e) {
2523
+ const n = t - e.top, s = e.height;
2524
+ return n < s * Qt ? "before" : n > s * Kt ? "after" : "child";
2452
2525
  }
2453
- function Un(s, e) {
2454
- let t = e;
2455
- for (; t; ) {
2456
- if (t.getId() === s) return !0;
2457
- const n = t.getParent();
2458
- t = n.isDefined() ? n.get() : void 0;
2526
+ function Jn(t, e) {
2527
+ let n = e;
2528
+ for (; n; ) {
2529
+ if (n.getId() === t) return !0;
2530
+ const s = n.getParent();
2531
+ n = s.isDefined() ? s.get() : void 0;
2459
2532
  }
2460
2533
  return !1;
2461
2534
  }
2462
- const jn = (s, e) => {
2463
- const [t, n] = st({
2535
+ const es = (t, e) => {
2536
+ const [n, s] = re({
2464
2537
  activeId: null,
2465
2538
  overId: null,
2466
2539
  dropPosition: null
2467
2540
  }), i = k(null), r = k(null), o = k(
2468
- new Map(s.map((f) => [f.getId(), f]))
2541
+ new Map(t.map((f) => [f.getId(), f]))
2469
2542
  );
2470
- o.current = new Map(s.map((f) => [f.getId(), f]));
2471
- const l = T((f) => {
2472
- i.current = null, r.current = null, n({
2543
+ o.current = new Map(t.map((f) => [f.getId(), f]));
2544
+ const l = C((f) => {
2545
+ i.current = null, r.current = null, mn(String(f.active.id)), s({
2473
2546
  activeId: f.active.id,
2474
2547
  overId: null,
2475
2548
  dropPosition: null
2476
2549
  });
2477
- }, []), c = T((f) => {
2478
- const { active: h, over: d, activatorEvent: v, delta: p } = f;
2479
- if (!d || h.id === d.id) {
2480
- r.current !== null && (r.current = null, i.current = null, n((A) => ({ ...A, overId: null, dropPosition: null })));
2550
+ }, []), c = C((f) => {
2551
+ const { active: u, over: h, activatorEvent: A, delta: p } = f;
2552
+ if (!h || u.id === h.id) {
2553
+ r.current !== null && (r.current = null, i.current = null, s((y) => ({ ...y, overId: null, dropPosition: null })));
2481
2554
  return;
2482
2555
  }
2483
- const y = o.current.get(String(d.id));
2484
- if (!y || Un(String(h.id), y)) {
2485
- r.current !== null && (r.current = null, i.current = null, n((A) => ({ ...A, overId: null, dropPosition: null })));
2556
+ const S = o.current.get(String(h.id));
2557
+ if (!S || Jn(String(u.id), S)) {
2558
+ r.current !== null && (r.current = null, i.current = null, s((y) => ({ ...y, overId: null, dropPosition: null })));
2486
2559
  return;
2487
2560
  }
2488
- const b = v.clientY + p.y, g = qn(b, {
2489
- top: d.rect.top,
2490
- height: d.rect.height
2561
+ const M = A.clientY + p.y, g = Zn(M, {
2562
+ top: h.rect.top,
2563
+ height: h.rect.height
2491
2564
  });
2492
- (r.current !== d.id || i.current !== g) && (r.current = d.id, i.current = g, n((A) => ({
2493
- ...A,
2494
- overId: d.id,
2565
+ (r.current !== h.id || i.current !== g) && (r.current = h.id, i.current = g, s((y) => ({
2566
+ ...y,
2567
+ overId: h.id,
2495
2568
  dropPosition: g
2496
2569
  })));
2497
- }, []), u = T((f) => {
2498
- const { active: h, over: d } = f, v = i.current, p = r.current;
2499
- if (d && h.id !== d.id && v && p) {
2500
- const y = document.querySelector(
2570
+ }, []), d = C((f) => {
2571
+ const { active: u, over: h } = f, A = i.current, p = r.current;
2572
+ if (h && u.id !== h.id && A && p) {
2573
+ const S = document.querySelector(
2501
2574
  `[data-resource-id="${String(p)}"]`
2502
2575
  );
2503
2576
  e(
2504
- y || document.body,
2505
- String(h.id),
2577
+ S || document.body,
2578
+ String(u.id),
2506
2579
  String(p),
2507
- v
2580
+ A
2508
2581
  );
2509
2582
  }
2510
- i.current = null, r.current = null, n({ activeId: null, overId: null, dropPosition: null });
2511
- }, [e]), m = T(() => {
2512
- i.current = null, r.current = null, n({ activeId: null, overId: null, dropPosition: null });
2583
+ i.current = null, r.current = null, s({ activeId: null, overId: null, dropPosition: null });
2584
+ }, [e]), m = C(() => {
2585
+ i.current = null, r.current = null, s({ activeId: null, overId: null, dropPosition: null });
2513
2586
  }, []);
2514
2587
  return {
2515
- dragState: t,
2588
+ dragState: n,
2516
2589
  handleDragStart: l,
2517
2590
  handleDragMove: c,
2518
- handleDragEnd: u,
2591
+ handleDragEnd: d,
2519
2592
  handleDragCancel: m
2520
2593
  };
2521
- }, $n = ({ transform: s, activatorEvent: e }) => e ? {
2522
- ...s,
2523
- x: s.x + 20,
2524
- y: s.y + 20
2525
- } : s, Gn = (s) => {
2526
- const { schedulantView: e, virtualizer: t, visibleResources: n, collapseIds: i, cellResizerMouseUp: r, cellResizerMouseDownFunc: o } = s, l = e.getScheduleApi(), c = l.getFlatMapResourceApis(), u = T(async (M, C, D, P) => {
2527
- const I = c.find((H) => H.getId() === C), L = c.find((H) => H.getId() === D);
2528
- if (I && L) {
2529
- const H = I.getParent();
2594
+ }, ts = ({ transform: t, activatorEvent: e }) => e ? {
2595
+ ...t,
2596
+ x: t.x + 20,
2597
+ y: t.y + 20
2598
+ } : t, ns = (t) => {
2599
+ const { schedulantView: e, virtualizer: n, visibleResources: s, collapseIds: i, cellResizerMouseUp: r, cellResizerMouseDownFunc: o } = t, l = e.getScheduleApi(), c = l.getFlatMapResourceApis(), d = C(async (b, T, D, O) => {
2600
+ const P = c.find((z) => z.getId() === T), Y = c.find((z) => z.getId() === D);
2601
+ if (P && Y) {
2602
+ const z = P.getParent();
2530
2603
  l.resourceLaneMove({
2531
- el: M,
2604
+ el: b,
2532
2605
  schedulantApi: l,
2533
- draggedResourceApi: I,
2534
- targetResourceApi: L,
2535
- position: P,
2536
- oldParentResourceApi: H.isDefined() ? H.get() : void 0
2606
+ draggedResourceApi: P,
2607
+ targetResourceApi: Y,
2608
+ position: O,
2609
+ oldParentResourceApi: z.isDefined() ? z.get() : void 0
2537
2610
  });
2538
2611
  }
2539
- }, [l, c]), { dragState: m, handleDragStart: f, handleDragMove: h, handleDragEnd: d, handleDragCancel: v } = jn(c, u), p = xt(
2540
- xe(Ot, { activationConstraint: { distance: 5 } }),
2541
- xe(It)
2542
- ), y = n.map((M) => M.getId()), b = l.isEditable(), g = t.getVirtualItems(), A = t.getTotalSize(), S = B(() => m.activeId ? c.find((M) => M.getId() === String(m.activeId)) ?? null : null, [m.activeId, c]);
2543
- return /* @__PURE__ */ O(
2544
- Pt,
2612
+ }, [l, c]), { dragState: m, handleDragStart: f, handleDragMove: u, handleDragEnd: h, handleDragCancel: A } = es(c, d), p = _t(
2613
+ We(Wt, { activationConstraint: { delay: 300, tolerance: 5 } }),
2614
+ We(Ht)
2615
+ ), S = s.map((b) => b.getId()), M = l.isEditable(), g = n.getVirtualItems(), y = n.getTotalSize(), v = F(() => m.activeId ? c.find((b) => b.getId() === String(m.activeId)) ?? null : null, [m.activeId, c]);
2616
+ return /* @__PURE__ */ I(
2617
+ zt,
2545
2618
  {
2546
2619
  sensors: p,
2547
- collisionDetection: Nt,
2548
- modifiers: [Yt],
2620
+ collisionDetection: Vt,
2621
+ modifiers: [Bt],
2549
2622
  onDragStart: f,
2550
- onDragMove: h,
2551
- onDragEnd: d,
2552
- onDragCancel: v,
2623
+ onDragMove: u,
2624
+ onDragEnd: h,
2625
+ onDragCancel: A,
2553
2626
  children: [
2554
- /* @__PURE__ */ a(Rt, { items: y, strategy: kt, children: /* @__PURE__ */ O(
2627
+ /* @__PURE__ */ a(Nt, { items: S, strategy: Yt, children: /* @__PURE__ */ I(
2555
2628
  "table",
2556
2629
  {
2557
2630
  role: "presentation",
@@ -2559,29 +2632,29 @@ const jn = (s, e) => {
2559
2632
  className: "schedulant-datagrid-body schedulant-scrollgrid-sync-table",
2560
2633
  children: [
2561
2634
  e.renderResourceTableColgroup(),
2562
- e.renderResourceLane(n, g, A, i, r, o, {
2563
- isDraggable: b,
2635
+ e.renderResourceLane(s, g, y, i, r, o, {
2636
+ isDraggable: M,
2564
2637
  dragState: m
2565
2638
  })
2566
2639
  ]
2567
2640
  }
2568
2641
  ) }),
2569
- /* @__PURE__ */ a(Lt, { dropAnimation: null, modifiers: [$n], children: S ? /* @__PURE__ */ a("div", { className: "schedulant-drag-overlay", children: S.getTitle() }) : null })
2642
+ /* @__PURE__ */ a(Ft, { dropAnimation: null, modifiers: [ts], children: v ? /* @__PURE__ */ a("div", { className: "schedulant-drag-overlay", children: v.getTitle() }) : null })
2570
2643
  ]
2571
2644
  }
2572
2645
  );
2573
- }, Xn = (s) => /* @__PURE__ */ a("div", { id: "schedulant-timeline-slots", className: "schedulant-timeline-slots", children: /* @__PURE__ */ O("table", { "aria-hidden": !0, children: [
2574
- s.schedulantView.renderTimelineTableColgroup(),
2575
- s.schedulantView.renderTimelineBodyTableSlots()
2576
- ] }) }), Qn = () => {
2577
- const s = T(() => {
2646
+ }, ss = (t) => /* @__PURE__ */ a("div", { id: "schedulant-timeline-slots", className: "schedulant-timeline-slots", children: /* @__PURE__ */ I("table", { "aria-hidden": !0, children: [
2647
+ t.schedulantView.renderTimelineTableColgroup(),
2648
+ t.schedulantView.renderTimelineBodyTableSlots()
2649
+ ] }) }), is = () => {
2650
+ const t = C(() => {
2578
2651
  const l = document.getElementsByClassName("schedulant-timeline-head").item(0).getElementsByTagName("table").item(0)?.offsetWidth;
2579
2652
  return l || 0;
2580
- }, []), [e, t] = st(0), { state: n } = be();
2581
- return At(() => {
2653
+ }, []), [e, n] = re(0), { state: s } = De();
2654
+ return Tt(() => {
2582
2655
  const i = () => {
2583
- const u = s();
2584
- t(u);
2656
+ const d = t();
2657
+ n(d);
2585
2658
  };
2586
2659
  i();
2587
2660
  const r = () => i();
@@ -2598,171 +2671,171 @@ const jn = (s, e) => {
2598
2671
  })), () => {
2599
2672
  window.removeEventListener("resize", r), c?.disconnect();
2600
2673
  };
2601
- }, [s, n.resourceAreaWidth]), e;
2602
- }, Kn = (s) => {
2603
- const e = Qn(), t = s.virtualizer.getVirtualItems(), n = s.virtualizer.getTotalSize();
2674
+ }, [t, s.resourceAreaWidth]), e;
2675
+ }, rs = (t) => {
2676
+ const e = is(), n = t.virtualizer.getVirtualItems(), s = t.virtualizer.getTotalSize();
2604
2677
  return /* @__PURE__ */ a(
2605
2678
  "table",
2606
2679
  {
2607
2680
  "aria-hidden": !0,
2608
2681
  className: "schedulant-timeline-drawing-board schedulant-scrollgrid-sync-table",
2609
2682
  style: { width: w(e) },
2610
- children: s.schedulantView.renderTimelineDrawingBoardTable(s.visibleResources, t, n, e)
2683
+ children: t.schedulantView.renderTimelineDrawingBoardTable(t.visibleResources, n, s, e)
2611
2684
  }
2612
2685
  );
2613
- }, Zn = (s, e) => {
2686
+ }, os = (t, e) => {
2614
2687
  N(() => {
2615
- const t = s.current, n = e.getScheduleApi();
2616
- if (t)
2617
- return n.schedulantDidMount({
2618
- el: t,
2619
- schedulantApi: n
2688
+ const n = t.current, s = e.getScheduleApi();
2689
+ if (n)
2690
+ return s.schedulantDidMount({
2691
+ el: n,
2692
+ schedulantApi: s
2620
2693
  }), () => {
2621
- n.schedulantWillUnmount({
2622
- el: t,
2623
- schedulantApi: n
2694
+ s.schedulantWillUnmount({
2695
+ el: n,
2696
+ schedulantApi: s
2624
2697
  });
2625
2698
  };
2626
- }, [s, e]);
2699
+ }, [t, e]);
2627
2700
  };
2628
- function U(s, e, t) {
2629
- let n = t.initialDeps ?? [], i, r = !0;
2701
+ function $(t, e, n) {
2702
+ let s = n.initialDeps ?? [], i, r = !0;
2630
2703
  function o() {
2631
- var l, c, u;
2704
+ var l, c, d;
2632
2705
  let m;
2633
- t.key && ((l = t.debug) != null && l.call(t)) && (m = Date.now());
2634
- const f = s();
2635
- if (!(f.length !== n.length || f.some((v, p) => n[p] !== v)))
2706
+ n.key && ((l = n.debug) != null && l.call(n)) && (m = Date.now());
2707
+ const f = t();
2708
+ if (!(f.length !== s.length || f.some((A, p) => s[p] !== A)))
2636
2709
  return i;
2637
- n = f;
2638
- let d;
2639
- if (t.key && ((c = t.debug) != null && c.call(t)) && (d = Date.now()), i = e(...f), t.key && ((u = t.debug) != null && u.call(t))) {
2640
- const v = Math.round((Date.now() - m) * 100) / 100, p = Math.round((Date.now() - d) * 100) / 100, y = p / 16, b = (g, A) => {
2641
- for (g = String(g); g.length < A; )
2710
+ s = f;
2711
+ let h;
2712
+ 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))) {
2713
+ const A = Math.round((Date.now() - m) * 100) / 100, p = Math.round((Date.now() - h) * 100) / 100, S = p / 16, M = (g, y) => {
2714
+ for (g = String(g); g.length < y; )
2642
2715
  g = " " + g;
2643
2716
  return g;
2644
2717
  };
2645
2718
  console.info(
2646
- `%c⏱ ${b(p, 5)} /${b(v, 5)} ms`,
2719
+ `%c⏱ ${M(p, 5)} /${M(A, 5)} ms`,
2647
2720
  `
2648
2721
  font-size: .6rem;
2649
2722
  font-weight: bold;
2650
2723
  color: hsl(${Math.max(
2651
2724
  0,
2652
- Math.min(120 - 120 * y, 120)
2725
+ Math.min(120 - 120 * S, 120)
2653
2726
  )}deg 100% 31%);`,
2654
- t?.key
2727
+ n?.key
2655
2728
  );
2656
2729
  }
2657
- return t?.onChange && !(r && t.skipInitialOnChange) && t.onChange(i), r = !1, i;
2730
+ return n?.onChange && !(r && n.skipInitialOnChange) && n.onChange(i), r = !1, i;
2658
2731
  }
2659
2732
  return o.updateDeps = (l) => {
2660
- n = l;
2733
+ s = l;
2661
2734
  }, o;
2662
2735
  }
2663
- function Ze(s, e) {
2664
- if (s === void 0)
2736
+ function ot(t, e) {
2737
+ if (t === void 0)
2665
2738
  throw new Error("Unexpected undefined");
2666
- return s;
2739
+ return t;
2667
2740
  }
2668
- const Jn = (s, e) => Math.abs(s - e) < 1.01, es = (s, e, t) => {
2669
- let n;
2741
+ const ls = (t, e) => Math.abs(t - e) < 1.01, as = (t, e, n) => {
2742
+ let s;
2670
2743
  return function(...i) {
2671
- s.clearTimeout(n), n = s.setTimeout(() => e.apply(this, i), t);
2744
+ t.clearTimeout(s), s = t.setTimeout(() => e.apply(this, i), n);
2672
2745
  };
2673
- }, Je = (s) => {
2674
- const { offsetWidth: e, offsetHeight: t } = s;
2675
- return { width: e, height: t };
2676
- }, ts = (s) => s, ns = (s) => {
2677
- const e = Math.max(s.startIndex - s.overscan, 0), t = Math.min(s.endIndex + s.overscan, s.count - 1), n = [];
2678
- for (let i = e; i <= t; i++)
2679
- n.push(i);
2680
- return n;
2681
- }, ss = (s, e) => {
2682
- const t = s.scrollElement;
2683
- if (!t)
2684
- return;
2685
- const n = s.targetWindow;
2746
+ }, lt = (t) => {
2747
+ const { offsetWidth: e, offsetHeight: n } = t;
2748
+ return { width: e, height: n };
2749
+ }, cs = (t) => t, ds = (t) => {
2750
+ const e = Math.max(t.startIndex - t.overscan, 0), n = Math.min(t.endIndex + t.overscan, t.count - 1), s = [];
2751
+ for (let i = e; i <= n; i++)
2752
+ s.push(i);
2753
+ return s;
2754
+ }, us = (t, e) => {
2755
+ const n = t.scrollElement;
2686
2756
  if (!n)
2687
2757
  return;
2758
+ const s = t.targetWindow;
2759
+ if (!s)
2760
+ return;
2688
2761
  const i = (o) => {
2689
2762
  const { width: l, height: c } = o;
2690
2763
  e({ width: Math.round(l), height: Math.round(c) });
2691
2764
  };
2692
- if (i(Je(t)), !n.ResizeObserver)
2765
+ if (i(lt(n)), !s.ResizeObserver)
2693
2766
  return () => {
2694
2767
  };
2695
- const r = new n.ResizeObserver((o) => {
2768
+ const r = new s.ResizeObserver((o) => {
2696
2769
  const l = () => {
2697
2770
  const c = o[0];
2698
2771
  if (c?.borderBoxSize) {
2699
- const u = c.borderBoxSize[0];
2700
- if (u) {
2701
- i({ width: u.inlineSize, height: u.blockSize });
2772
+ const d = c.borderBoxSize[0];
2773
+ if (d) {
2774
+ i({ width: d.inlineSize, height: d.blockSize });
2702
2775
  return;
2703
2776
  }
2704
2777
  }
2705
- i(Je(t));
2778
+ i(lt(n));
2706
2779
  };
2707
- s.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
2780
+ t.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
2708
2781
  });
2709
- return r.observe(t, { box: "border-box" }), () => {
2710
- r.unobserve(t);
2782
+ return r.observe(n, { box: "border-box" }), () => {
2783
+ r.unobserve(n);
2711
2784
  };
2712
- }, et = {
2785
+ }, at = {
2713
2786
  passive: !0
2714
- }, tt = typeof window > "u" ? !0 : "onscrollend" in window, is = (s, e) => {
2715
- const t = s.scrollElement;
2716
- if (!t)
2717
- return;
2718
- const n = s.targetWindow;
2787
+ }, ct = typeof window > "u" ? !0 : "onscrollend" in window, hs = (t, e) => {
2788
+ const n = t.scrollElement;
2719
2789
  if (!n)
2720
2790
  return;
2791
+ const s = t.targetWindow;
2792
+ if (!s)
2793
+ return;
2721
2794
  let i = 0;
2722
- const r = s.options.useScrollendEvent && tt ? () => {
2723
- } : es(
2724
- n,
2795
+ const r = t.options.useScrollendEvent && ct ? () => {
2796
+ } : as(
2797
+ s,
2725
2798
  () => {
2726
2799
  e(i, !1);
2727
2800
  },
2728
- s.options.isScrollingResetDelay
2801
+ t.options.isScrollingResetDelay
2729
2802
  ), o = (m) => () => {
2730
- const { horizontal: f, isRtl: h } = s.options;
2731
- i = f ? t.scrollLeft * (h && -1 || 1) : t.scrollTop, r(), e(i, m);
2803
+ const { horizontal: f, isRtl: u } = t.options;
2804
+ i = f ? n.scrollLeft * (u && -1 || 1) : n.scrollTop, r(), e(i, m);
2732
2805
  }, l = o(!0), c = o(!1);
2733
- t.addEventListener("scroll", l, et);
2734
- const u = s.options.useScrollendEvent && tt;
2735
- return u && t.addEventListener("scrollend", c, et), () => {
2736
- t.removeEventListener("scroll", l), u && t.removeEventListener("scrollend", c);
2806
+ n.addEventListener("scroll", l, at);
2807
+ const d = t.options.useScrollendEvent && ct;
2808
+ return d && n.addEventListener("scrollend", c, at), () => {
2809
+ n.removeEventListener("scroll", l), d && n.removeEventListener("scrollend", c);
2737
2810
  };
2738
- }, rs = (s, e, t) => {
2811
+ }, ms = (t, e, n) => {
2739
2812
  if (e?.borderBoxSize) {
2740
- const n = e.borderBoxSize[0];
2741
- if (n)
2813
+ const s = e.borderBoxSize[0];
2814
+ if (s)
2742
2815
  return Math.round(
2743
- n[t.options.horizontal ? "inlineSize" : "blockSize"]
2816
+ s[n.options.horizontal ? "inlineSize" : "blockSize"]
2744
2817
  );
2745
2818
  }
2746
- return s[t.options.horizontal ? "offsetWidth" : "offsetHeight"];
2747
- }, os = (s, {
2819
+ return t[n.options.horizontal ? "offsetWidth" : "offsetHeight"];
2820
+ }, gs = (t, {
2748
2821
  adjustments: e = 0,
2749
- behavior: t
2750
- }, n) => {
2822
+ behavior: n
2823
+ }, s) => {
2751
2824
  var i, r;
2752
- const o = s + e;
2753
- (r = (i = n.scrollElement) == null ? void 0 : i.scrollTo) == null || r.call(i, {
2754
- [n.options.horizontal ? "left" : "top"]: o,
2755
- behavior: t
2825
+ const o = t + e;
2826
+ (r = (i = s.scrollElement) == null ? void 0 : i.scrollTo) == null || r.call(i, {
2827
+ [s.options.horizontal ? "left" : "top"]: o,
2828
+ behavior: n
2756
2829
  });
2757
2830
  };
2758
- class ls {
2831
+ class fs {
2759
2832
  constructor(e) {
2760
2833
  this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
2761
- var t, n, i;
2762
- return ((i = (n = (t = this.targetWindow) == null ? void 0 : t.performance) == null ? void 0 : n.now) == null ? void 0 : i.call(n)) ?? Date.now();
2834
+ var n, s, i;
2835
+ return ((i = (s = (n = this.targetWindow) == null ? void 0 : n.performance) == null ? void 0 : s.now) == null ? void 0 : i.call(s)) ?? Date.now();
2763
2836
  }, this.observer = /* @__PURE__ */ (() => {
2764
- let t = null;
2765
- const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((i) => {
2837
+ let n = null;
2838
+ const s = () => n || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : n = new this.targetWindow.ResizeObserver((i) => {
2766
2839
  i.forEach((r) => {
2767
2840
  const o = () => {
2768
2841
  this._measureElement(r.target, r);
@@ -2773,20 +2846,20 @@ class ls {
2773
2846
  return {
2774
2847
  disconnect: () => {
2775
2848
  var i;
2776
- (i = n()) == null || i.disconnect(), t = null;
2849
+ (i = s()) == null || i.disconnect(), n = null;
2777
2850
  },
2778
2851
  observe: (i) => {
2779
2852
  var r;
2780
- return (r = n()) == null ? void 0 : r.observe(i, { box: "border-box" });
2853
+ return (r = s()) == null ? void 0 : r.observe(i, { box: "border-box" });
2781
2854
  },
2782
2855
  unobserve: (i) => {
2783
2856
  var r;
2784
- return (r = n()) == null ? void 0 : r.unobserve(i);
2857
+ return (r = s()) == null ? void 0 : r.unobserve(i);
2785
2858
  }
2786
2859
  };
2787
- })(), this.range = null, this.setOptions = (t) => {
2788
- Object.entries(t).forEach(([n, i]) => {
2789
- typeof i > "u" && delete t[n];
2860
+ })(), this.range = null, this.setOptions = (n) => {
2861
+ Object.entries(n).forEach(([s, i]) => {
2862
+ typeof i > "u" && delete n[s];
2790
2863
  }), this.options = {
2791
2864
  debug: !1,
2792
2865
  initialOffset: 0,
@@ -2796,11 +2869,11 @@ class ls {
2796
2869
  scrollPaddingStart: 0,
2797
2870
  scrollPaddingEnd: 0,
2798
2871
  horizontal: !1,
2799
- getItemKey: ts,
2800
- rangeExtractor: ns,
2872
+ getItemKey: cs,
2873
+ rangeExtractor: ds,
2801
2874
  onChange: () => {
2802
2875
  },
2803
- measureElement: rs,
2876
+ measureElement: ms,
2804
2877
  initialRect: { width: 0, height: 0 },
2805
2878
  scrollMargin: 0,
2806
2879
  gap: 0,
@@ -2812,19 +2885,19 @@ class ls {
2812
2885
  isRtl: !1,
2813
2886
  useScrollendEvent: !1,
2814
2887
  useAnimationFrameWithResizeObserver: !1,
2815
- ...t
2888
+ ...n
2816
2889
  };
2817
- }, this.notify = (t) => {
2818
- var n, i;
2819
- (i = (n = this.options).onChange) == null || i.call(n, this, t);
2820
- }, this.maybeNotify = U(
2890
+ }, this.notify = (n) => {
2891
+ var s, i;
2892
+ (i = (s = this.options).onChange) == null || i.call(s, this, n);
2893
+ }, this.maybeNotify = $(
2821
2894
  () => (this.calculateRange(), [
2822
2895
  this.isScrolling,
2823
2896
  this.range ? this.range.startIndex : null,
2824
2897
  this.range ? this.range.endIndex : null
2825
2898
  ]),
2826
- (t) => {
2827
- this.notify(t);
2899
+ (n) => {
2900
+ this.notify(n);
2828
2901
  },
2829
2902
  {
2830
2903
  key: process.env.NODE_ENV !== "production" && "maybeNotify",
@@ -2836,18 +2909,18 @@ class ls {
2836
2909
  ]
2837
2910
  }
2838
2911
  ), this.cleanup = () => {
2839
- this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
2912
+ this.unsubs.filter(Boolean).forEach((n) => n()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
2840
2913
  }, this._didMount = () => () => {
2841
2914
  this.cleanup();
2842
2915
  }, this._willUpdate = () => {
2843
- var t;
2844
- const n = this.options.enabled ? this.options.getScrollElement() : null;
2845
- if (this.scrollElement !== n) {
2846
- if (this.cleanup(), !n) {
2916
+ var n;
2917
+ const s = this.options.enabled ? this.options.getScrollElement() : null;
2918
+ if (this.scrollElement !== s) {
2919
+ if (this.cleanup(), !s) {
2847
2920
  this.maybeNotify();
2848
2921
  return;
2849
2922
  }
2850
- this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((i) => {
2923
+ this.scrollElement = s, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((n = this.scrollElement) == null ? void 0 : n.window) ?? null, this.elementsCache.forEach((i) => {
2851
2924
  this.observer.observe(i);
2852
2925
  }), this.unsubs.push(
2853
2926
  this.options.observeElementRect(this, (i) => {
@@ -2862,10 +2935,10 @@ class ls {
2862
2935
  behavior: void 0
2863
2936
  });
2864
2937
  }
2865
- }, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, n) => {
2938
+ }, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (n, s) => {
2866
2939
  const i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
2867
- for (let o = n - 1; o >= 0; o--) {
2868
- const l = t[o];
2940
+ for (let o = s - 1; o >= 0; o--) {
2941
+ const l = n[o];
2869
2942
  if (i.has(l.lane))
2870
2943
  continue;
2871
2944
  const c = r.get(
@@ -2875,7 +2948,7 @@ class ls {
2875
2948
  break;
2876
2949
  }
2877
2950
  return r.size === this.options.lanes ? Array.from(r.values()).sort((o, l) => o.end === l.end ? o.index - l.index : o.end - l.end)[0] : void 0;
2878
- }, this.getMeasurementOptions = U(
2951
+ }, this.getMeasurementOptions = $(
2879
2952
  () => [
2880
2953
  this.options.count,
2881
2954
  this.options.paddingStart,
@@ -2884,9 +2957,9 @@ class ls {
2884
2957
  this.options.enabled,
2885
2958
  this.options.lanes
2886
2959
  ],
2887
- (t, n, i, r, o, l) => (this.prevLanes !== void 0 && this.prevLanes !== l && (this.lanesChangedFlag = !0), this.prevLanes = l, this.pendingMeasuredCacheIndexes = [], {
2888
- count: t,
2889
- paddingStart: n,
2960
+ (n, s, i, r, o, l) => (this.prevLanes !== void 0 && this.prevLanes !== l && (this.lanesChangedFlag = !0), this.prevLanes = l, this.pendingMeasuredCacheIndexes = [], {
2961
+ count: n,
2962
+ paddingStart: s,
2890
2963
  scrollMargin: i,
2891
2964
  getItemKey: r,
2892
2965
  enabled: o,
@@ -2895,46 +2968,46 @@ class ls {
2895
2968
  {
2896
2969
  key: !1
2897
2970
  }
2898
- ), this.getMeasurements = U(
2971
+ ), this.getMeasurements = $(
2899
2972
  () => [this.getMeasurementOptions(), this.itemSizeCache],
2900
- ({ count: t, paddingStart: n, scrollMargin: i, getItemKey: r, enabled: o, lanes: l }, c) => {
2973
+ ({ count: n, paddingStart: s, scrollMargin: i, getItemKey: r, enabled: o, lanes: l }, c) => {
2901
2974
  if (!o)
2902
2975
  return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
2903
- if (this.laneAssignments.size > t)
2904
- for (const h of this.laneAssignments.keys())
2905
- h >= t && this.laneAssignments.delete(h);
2906
- 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) => {
2907
- this.itemSizeCache.set(h.key, h.size);
2976
+ if (this.laneAssignments.size > n)
2977
+ for (const u of this.laneAssignments.keys())
2978
+ u >= n && this.laneAssignments.delete(u);
2979
+ 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) => {
2980
+ this.itemSizeCache.set(u.key, u.size);
2908
2981
  }));
2909
- const u = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
2910
- this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === t && (this.lanesSettling = !1);
2911
- const m = this.measurementsCache.slice(0, u), f = new Array(l).fill(
2982
+ const d = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
2983
+ this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === n && (this.lanesSettling = !1);
2984
+ const m = this.measurementsCache.slice(0, d), f = new Array(l).fill(
2912
2985
  void 0
2913
2986
  );
2914
- for (let h = 0; h < u; h++) {
2915
- const d = m[h];
2916
- d && (f[d.lane] = h);
2987
+ for (let u = 0; u < d; u++) {
2988
+ const h = m[u];
2989
+ h && (f[h.lane] = u);
2917
2990
  }
2918
- for (let h = u; h < t; h++) {
2919
- const d = r(h), v = this.laneAssignments.get(h);
2920
- let p, y;
2921
- if (v !== void 0 && this.options.lanes > 1) {
2922
- p = v;
2923
- const S = f[p], M = S !== void 0 ? m[S] : void 0;
2924
- y = M ? M.end + this.options.gap : n + i;
2991
+ for (let u = d; u < n; u++) {
2992
+ const h = r(u), A = this.laneAssignments.get(u);
2993
+ let p, S;
2994
+ if (A !== void 0 && this.options.lanes > 1) {
2995
+ p = A;
2996
+ const v = f[p], b = v !== void 0 ? m[v] : void 0;
2997
+ S = b ? b.end + this.options.gap : s + i;
2925
2998
  } else {
2926
- const S = this.options.lanes === 1 ? m[h - 1] : this.getFurthestMeasurement(m, h);
2927
- y = S ? S.end + this.options.gap : n + i, p = S ? S.lane : h % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(h, p);
2999
+ const v = this.options.lanes === 1 ? m[u - 1] : this.getFurthestMeasurement(m, u);
3000
+ 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);
2928
3001
  }
2929
- const b = c.get(d), g = typeof b == "number" ? b : this.options.estimateSize(h), A = y + g;
2930
- m[h] = {
2931
- index: h,
2932
- start: y,
3002
+ const M = c.get(h), g = typeof M == "number" ? M : this.options.estimateSize(u), y = S + g;
3003
+ m[u] = {
3004
+ index: u,
3005
+ start: S,
2933
3006
  size: g,
2934
- end: A,
2935
- key: d,
3007
+ end: y,
3008
+ key: h,
2936
3009
  lane: p
2937
- }, f[p] = h;
3010
+ }, f[p] = u;
2938
3011
  }
2939
3012
  return this.measurementsCache = m, m;
2940
3013
  },
@@ -2942,16 +3015,16 @@ class ls {
2942
3015
  key: process.env.NODE_ENV !== "production" && "getMeasurements",
2943
3016
  debug: () => this.options.debug
2944
3017
  }
2945
- ), this.calculateRange = U(
3018
+ ), this.calculateRange = $(
2946
3019
  () => [
2947
3020
  this.getMeasurements(),
2948
3021
  this.getSize(),
2949
3022
  this.getScrollOffset(),
2950
3023
  this.options.lanes
2951
3024
  ],
2952
- (t, n, i, r) => this.range = t.length > 0 && n > 0 ? as({
2953
- measurements: t,
2954
- outerSize: n,
3025
+ (n, s, i, r) => this.range = n.length > 0 && s > 0 ? ps({
3026
+ measurements: n,
3027
+ outerSize: s,
2955
3028
  scrollOffset: i,
2956
3029
  lanes: r
2957
3030
  }) : null,
@@ -2959,38 +3032,38 @@ class ls {
2959
3032
  key: process.env.NODE_ENV !== "production" && "calculateRange",
2960
3033
  debug: () => this.options.debug
2961
3034
  }
2962
- ), this.getVirtualIndexes = U(
3035
+ ), this.getVirtualIndexes = $(
2963
3036
  () => {
2964
- let t = null, n = null;
3037
+ let n = null, s = null;
2965
3038
  const i = this.calculateRange();
2966
- return i && (t = i.startIndex, n = i.endIndex), this.maybeNotify.updateDeps([this.isScrolling, t, n]), [
3039
+ return i && (n = i.startIndex, s = i.endIndex), this.maybeNotify.updateDeps([this.isScrolling, n, s]), [
2967
3040
  this.options.rangeExtractor,
2968
3041
  this.options.overscan,
2969
3042
  this.options.count,
2970
- t,
2971
- n
3043
+ n,
3044
+ s
2972
3045
  ];
2973
3046
  },
2974
- (t, n, i, r, o) => r === null || o === null ? [] : t({
3047
+ (n, s, i, r, o) => r === null || o === null ? [] : n({
2975
3048
  startIndex: r,
2976
3049
  endIndex: o,
2977
- overscan: n,
3050
+ overscan: s,
2978
3051
  count: i
2979
3052
  }),
2980
3053
  {
2981
3054
  key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
2982
3055
  debug: () => this.options.debug
2983
3056
  }
2984
- ), this.indexFromElement = (t) => {
2985
- const n = this.options.indexAttribute, i = t.getAttribute(n);
3057
+ ), this.indexFromElement = (n) => {
3058
+ const s = this.options.indexAttribute, i = n.getAttribute(s);
2986
3059
  return i ? parseInt(i, 10) : (console.warn(
2987
- `Missing attribute name '${n}={index}' on measured element.`
3060
+ `Missing attribute name '${s}={index}' on measured element.`
2988
3061
  ), -1);
2989
- }, this.shouldMeasureDuringScroll = (t) => {
2990
- var n;
3062
+ }, this.shouldMeasureDuringScroll = (n) => {
3063
+ var s;
2991
3064
  if (!this.scrollState || this.scrollState.behavior !== "smooth")
2992
3065
  return !0;
2993
- const i = this.scrollState.index ?? ((n = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : n.index);
3066
+ const i = this.scrollState.index ?? ((s = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : s.index);
2994
3067
  if (i !== void 0 && this.range) {
2995
3068
  const r = Math.max(
2996
3069
  this.options.overscan,
@@ -2999,43 +3072,43 @@ class ls {
2999
3072
  this.options.count - 1,
3000
3073
  i + r
3001
3074
  );
3002
- return t >= o && t <= l;
3075
+ return n >= o && n <= l;
3003
3076
  }
3004
3077
  return !0;
3005
- }, this._measureElement = (t, n) => {
3006
- if (!t.isConnected) {
3007
- this.observer.unobserve(t);
3078
+ }, this._measureElement = (n, s) => {
3079
+ if (!n.isConnected) {
3080
+ this.observer.unobserve(n);
3008
3081
  return;
3009
3082
  }
3010
- const i = this.indexFromElement(t), r = this.measurementsCache[i];
3083
+ const i = this.indexFromElement(n), r = this.measurementsCache[i];
3011
3084
  if (!r)
3012
3085
  return;
3013
3086
  const o = r.key, l = this.elementsCache.get(o);
3014
- l !== t && (l && this.observer.unobserve(l), this.observer.observe(t), this.elementsCache.set(o, t)), this.shouldMeasureDuringScroll(i) && this.resizeItem(i, this.options.measureElement(t, n, this));
3015
- }, this.resizeItem = (t, n) => {
3087
+ l !== n && (l && this.observer.unobserve(l), this.observer.observe(n), this.elementsCache.set(o, n)), this.shouldMeasureDuringScroll(i) && this.resizeItem(i, this.options.measureElement(n, s, this));
3088
+ }, this.resizeItem = (n, s) => {
3016
3089
  var i;
3017
- const r = this.measurementsCache[t];
3090
+ const r = this.measurementsCache[n];
3018
3091
  if (!r)
3019
3092
  return;
3020
- const o = this.itemSizeCache.get(r.key) ?? r.size, l = n - o;
3093
+ const o = this.itemSizeCache.get(r.key) ?? r.size, l = s - o;
3021
3094
  l !== 0 && (((i = this.scrollState) == null ? void 0 : i.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(r, l, this) : r.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", l), this._scrollToOffset(this.getScrollOffset(), {
3022
3095
  adjustments: this.scrollAdjustments += l,
3023
3096
  behavior: void 0
3024
- })), this.pendingMeasuredCacheIndexes.push(r.index), this.itemSizeCache = new Map(this.itemSizeCache.set(r.key, n)), this.notify(!1));
3025
- }, this.measureElement = (t) => {
3026
- if (!t) {
3027
- this.elementsCache.forEach((n, i) => {
3028
- n.isConnected || (this.observer.unobserve(n), this.elementsCache.delete(i));
3097
+ })), this.pendingMeasuredCacheIndexes.push(r.index), this.itemSizeCache = new Map(this.itemSizeCache.set(r.key, s)), this.notify(!1));
3098
+ }, this.measureElement = (n) => {
3099
+ if (!n) {
3100
+ this.elementsCache.forEach((s, i) => {
3101
+ s.isConnected || (this.observer.unobserve(s), this.elementsCache.delete(i));
3029
3102
  });
3030
3103
  return;
3031
3104
  }
3032
- this._measureElement(t, void 0);
3033
- }, this.getVirtualItems = U(
3105
+ this._measureElement(n, void 0);
3106
+ }, this.getVirtualItems = $(
3034
3107
  () => [this.getVirtualIndexes(), this.getMeasurements()],
3035
- (t, n) => {
3108
+ (n, s) => {
3036
3109
  const i = [];
3037
- for (let r = 0, o = t.length; r < o; r++) {
3038
- const l = t[r], c = n[l];
3110
+ for (let r = 0, o = n.length; r < o; r++) {
3111
+ const l = n[r], c = s[l];
3039
3112
  i.push(c);
3040
3113
  }
3041
3114
  return i;
@@ -3044,15 +3117,15 @@ class ls {
3044
3117
  key: process.env.NODE_ENV !== "production" && "getVirtualItems",
3045
3118
  debug: () => this.options.debug
3046
3119
  }
3047
- ), this.getVirtualItemForOffset = (t) => {
3048
- const n = this.getMeasurements();
3049
- if (n.length !== 0)
3050
- return Ze(
3051
- n[mt(
3120
+ ), this.getVirtualItemForOffset = (n) => {
3121
+ const s = this.getMeasurements();
3122
+ if (s.length !== 0)
3123
+ return ot(
3124
+ s[At(
3052
3125
  0,
3053
- n.length - 1,
3054
- (i) => Ze(n[i]).start,
3055
- t
3126
+ s.length - 1,
3127
+ (i) => ot(s[i]).start,
3128
+ n
3056
3129
  )]
3057
3130
  );
3058
3131
  }, this.getMaxScrollOffset = () => {
@@ -3060,83 +3133,83 @@ class ls {
3060
3133
  if ("scrollHeight" in this.scrollElement)
3061
3134
  return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
3062
3135
  {
3063
- const t = this.scrollElement.document.documentElement;
3064
- return this.options.horizontal ? t.scrollWidth - this.scrollElement.innerWidth : t.scrollHeight - this.scrollElement.innerHeight;
3136
+ const n = this.scrollElement.document.documentElement;
3137
+ return this.options.horizontal ? n.scrollWidth - this.scrollElement.innerWidth : n.scrollHeight - this.scrollElement.innerHeight;
3065
3138
  }
3066
- }, this.getOffsetForAlignment = (t, n, i = 0) => {
3139
+ }, this.getOffsetForAlignment = (n, s, i = 0) => {
3067
3140
  if (!this.scrollElement) return 0;
3068
3141
  const r = this.getSize(), o = this.getScrollOffset();
3069
- n === "auto" && (n = t >= o + r ? "end" : "start"), n === "center" ? t += (i - r) / 2 : n === "end" && (t -= r);
3142
+ s === "auto" && (s = n >= o + r ? "end" : "start"), s === "center" ? n += (i - r) / 2 : s === "end" && (n -= r);
3070
3143
  const l = this.getMaxScrollOffset();
3071
- return Math.max(Math.min(l, t), 0);
3072
- }, this.getOffsetForIndex = (t, n = "auto") => {
3073
- t = Math.max(0, Math.min(t, this.options.count - 1));
3074
- const i = this.getSize(), r = this.getScrollOffset(), o = this.measurementsCache[t];
3144
+ return Math.max(Math.min(l, n), 0);
3145
+ }, this.getOffsetForIndex = (n, s = "auto") => {
3146
+ n = Math.max(0, Math.min(n, this.options.count - 1));
3147
+ const i = this.getSize(), r = this.getScrollOffset(), o = this.measurementsCache[n];
3075
3148
  if (!o) return;
3076
- if (n === "auto")
3149
+ if (s === "auto")
3077
3150
  if (o.end >= r + i - this.options.scrollPaddingEnd)
3078
- n = "end";
3151
+ s = "end";
3079
3152
  else if (o.start <= r + this.options.scrollPaddingStart)
3080
- n = "start";
3153
+ s = "start";
3081
3154
  else
3082
- return [r, n];
3083
- if (n === "end" && t === this.options.count - 1)
3084
- return [this.getMaxScrollOffset(), n];
3085
- const l = n === "end" ? o.end + this.options.scrollPaddingEnd : o.start - this.options.scrollPaddingStart;
3155
+ return [r, s];
3156
+ if (s === "end" && n === this.options.count - 1)
3157
+ return [this.getMaxScrollOffset(), s];
3158
+ const l = s === "end" ? o.end + this.options.scrollPaddingEnd : o.start - this.options.scrollPaddingStart;
3086
3159
  return [
3087
- this.getOffsetForAlignment(l, n, o.size),
3088
- n
3160
+ this.getOffsetForAlignment(l, s, o.size),
3161
+ s
3089
3162
  ];
3090
- }, this.scrollToOffset = (t, { align: n = "start", behavior: i = "auto" } = {}) => {
3091
- const r = this.getOffsetForAlignment(t, n), o = this.now();
3163
+ }, this.scrollToOffset = (n, { align: s = "start", behavior: i = "auto" } = {}) => {
3164
+ const r = this.getOffsetForAlignment(n, s), o = this.now();
3092
3165
  this.scrollState = {
3093
3166
  index: null,
3094
- align: n,
3167
+ align: s,
3095
3168
  behavior: i,
3096
3169
  startedAt: o,
3097
3170
  lastTargetOffset: r,
3098
3171
  stableFrames: 0
3099
3172
  }, this._scrollToOffset(r, { adjustments: void 0, behavior: i }), this.scheduleScrollReconcile();
3100
- }, this.scrollToIndex = (t, {
3101
- align: n = "auto",
3173
+ }, this.scrollToIndex = (n, {
3174
+ align: s = "auto",
3102
3175
  behavior: i = "auto"
3103
3176
  } = {}) => {
3104
- t = Math.max(0, Math.min(t, this.options.count - 1));
3105
- const r = this.getOffsetForIndex(t, n);
3177
+ n = Math.max(0, Math.min(n, this.options.count - 1));
3178
+ const r = this.getOffsetForIndex(n, s);
3106
3179
  if (!r)
3107
3180
  return;
3108
3181
  const [o, l] = r, c = this.now();
3109
3182
  this.scrollState = {
3110
- index: t,
3183
+ index: n,
3111
3184
  align: l,
3112
3185
  behavior: i,
3113
3186
  startedAt: c,
3114
3187
  lastTargetOffset: o,
3115
3188
  stableFrames: 0
3116
3189
  }, this._scrollToOffset(o, { adjustments: void 0, behavior: i }), this.scheduleScrollReconcile();
3117
- }, this.scrollBy = (t, { behavior: n = "auto" } = {}) => {
3118
- const i = this.getScrollOffset() + t, r = this.now();
3190
+ }, this.scrollBy = (n, { behavior: s = "auto" } = {}) => {
3191
+ const i = this.getScrollOffset() + n, r = this.now();
3119
3192
  this.scrollState = {
3120
3193
  index: null,
3121
3194
  align: "start",
3122
- behavior: n,
3195
+ behavior: s,
3123
3196
  startedAt: r,
3124
3197
  lastTargetOffset: i,
3125
3198
  stableFrames: 0
3126
- }, this._scrollToOffset(i, { adjustments: void 0, behavior: n }), this.scheduleScrollReconcile();
3199
+ }, this._scrollToOffset(i, { adjustments: void 0, behavior: s }), this.scheduleScrollReconcile();
3127
3200
  }, this.getTotalSize = () => {
3128
- var t;
3129
- const n = this.getMeasurements();
3201
+ var n;
3202
+ const s = this.getMeasurements();
3130
3203
  let i;
3131
- if (n.length === 0)
3204
+ if (s.length === 0)
3132
3205
  i = this.options.paddingStart;
3133
3206
  else if (this.options.lanes === 1)
3134
- i = ((t = n[n.length - 1]) == null ? void 0 : t.end) ?? 0;
3207
+ i = ((n = s[s.length - 1]) == null ? void 0 : n.end) ?? 0;
3135
3208
  else {
3136
3209
  const r = Array(this.options.lanes).fill(null);
3137
- let o = n.length - 1;
3210
+ let o = s.length - 1;
3138
3211
  for (; o >= 0 && r.some((l) => l === null); ) {
3139
- const l = n[o];
3212
+ const l = s[o];
3140
3213
  r[l.lane] === null && (r[l.lane] = l.end), o--;
3141
3214
  }
3142
3215
  i = Math.max(...r.filter((l) => l !== null));
@@ -3145,11 +3218,11 @@ class ls {
3145
3218
  i - this.options.scrollMargin + this.options.paddingEnd,
3146
3219
  0
3147
3220
  );
3148
- }, this._scrollToOffset = (t, {
3149
- adjustments: n,
3221
+ }, this._scrollToOffset = (n, {
3222
+ adjustments: s,
3150
3223
  behavior: i
3151
3224
  }) => {
3152
- this.options.scrollToFn(t, { behavior: i, adjustments: n }, this);
3225
+ this.options.scrollToFn(n, { behavior: i, adjustments: s }, this);
3153
3226
  }, this.measure = () => {
3154
3227
  this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
3155
3228
  }, this.setOptions(e);
@@ -3169,8 +3242,8 @@ class ls {
3169
3242
  this.scrollState = null;
3170
3243
  return;
3171
3244
  }
3172
- const n = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, i = n ? n[0] : this.scrollState.lastTargetOffset, r = 1, o = i !== this.scrollState.lastTargetOffset;
3173
- if (!o && Jn(i, this.getScrollOffset())) {
3245
+ const s = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, i = s ? s[0] : this.scrollState.lastTargetOffset, r = 1, o = i !== this.scrollState.lastTargetOffset;
3246
+ if (!o && ls(i, this.getScrollOffset())) {
3174
3247
  if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= r) {
3175
3248
  this.scrollState = null;
3176
3249
  return;
@@ -3183,190 +3256,197 @@ class ls {
3183
3256
  this.scheduleScrollReconcile();
3184
3257
  }
3185
3258
  }
3186
- const mt = (s, e, t, n) => {
3187
- for (; s <= e; ) {
3188
- const i = (s + e) / 2 | 0, r = t(i);
3189
- if (r < n)
3190
- s = i + 1;
3191
- else if (r > n)
3259
+ const At = (t, e, n, s) => {
3260
+ for (; t <= e; ) {
3261
+ const i = (t + e) / 2 | 0, r = n(i);
3262
+ if (r < s)
3263
+ t = i + 1;
3264
+ else if (r > s)
3192
3265
  e = i - 1;
3193
3266
  else
3194
3267
  return i;
3195
3268
  }
3196
- return s > 0 ? s - 1 : 0;
3269
+ return t > 0 ? t - 1 : 0;
3197
3270
  };
3198
- function as({
3199
- measurements: s,
3271
+ function ps({
3272
+ measurements: t,
3200
3273
  outerSize: e,
3201
- scrollOffset: t,
3202
- lanes: n
3274
+ scrollOffset: n,
3275
+ lanes: s
3203
3276
  }) {
3204
- const i = s.length - 1, r = (c) => s[c].start;
3205
- if (s.length <= n)
3277
+ const i = t.length - 1, r = (c) => t[c].start;
3278
+ if (t.length <= s)
3206
3279
  return {
3207
3280
  startIndex: 0,
3208
3281
  endIndex: i
3209
3282
  };
3210
- let o = mt(
3283
+ let o = At(
3211
3284
  0,
3212
3285
  i,
3213
3286
  r,
3214
- t
3287
+ n
3215
3288
  ), l = o;
3216
- if (n === 1)
3217
- for (; l < i && s[l].end < t + e; )
3289
+ if (s === 1)
3290
+ for (; l < i && t[l].end < n + e; )
3218
3291
  l++;
3219
- else if (n > 1) {
3220
- const c = Array(n).fill(0);
3221
- for (; l < i && c.some((m) => m < t + e); ) {
3222
- const m = s[l];
3292
+ else if (s > 1) {
3293
+ const c = Array(s).fill(0);
3294
+ for (; l < i && c.some((m) => m < n + e); ) {
3295
+ const m = t[l];
3223
3296
  c[m.lane] = m.end, l++;
3224
3297
  }
3225
- const u = Array(n).fill(t + e);
3226
- for (; o >= 0 && u.some((m) => m >= t); ) {
3227
- const m = s[o];
3228
- u[m.lane] = m.start, o--;
3298
+ const d = Array(s).fill(n + e);
3299
+ for (; o >= 0 && d.some((m) => m >= n); ) {
3300
+ const m = t[o];
3301
+ d[m.lane] = m.start, o--;
3229
3302
  }
3230
- o = Math.max(0, o - o % n), l = Math.min(i, l + (n - 1 - l % n));
3303
+ o = Math.max(0, o - o % s), l = Math.min(i, l + (s - 1 - l % s));
3231
3304
  }
3232
3305
  return { startIndex: o, endIndex: l };
3233
3306
  }
3234
- const nt = typeof document < "u" ? te.useLayoutEffect : te.useEffect;
3235
- function cs({
3236
- useFlushSync: s = !0,
3307
+ const dt = typeof document < "u" ? ie.useLayoutEffect : ie.useEffect;
3308
+ function ys({
3309
+ useFlushSync: t = !0,
3237
3310
  ...e
3238
3311
  }) {
3239
- const t = te.useReducer(() => ({}), {})[1], n = {
3312
+ const n = ie.useReducer(() => ({}), {})[1], s = {
3240
3313
  ...e,
3241
3314
  onChange: (r, o) => {
3242
3315
  var l;
3243
- s && o ? _t(t) : t(), (l = e.onChange) == null || l.call(e, r, o);
3316
+ t && o ? qt(n) : n(), (l = e.onChange) == null || l.call(e, r, o);
3244
3317
  }
3245
- }, [i] = te.useState(
3246
- () => new ls(n)
3318
+ }, [i] = ie.useState(
3319
+ () => new fs(s)
3247
3320
  );
3248
- return i.setOptions(n), nt(() => i._didMount(), []), nt(() => i._willUpdate()), i;
3321
+ return i.setOptions(s), dt(() => i._didMount(), []), dt(() => i._willUpdate()), i;
3249
3322
  }
3250
- function ds(s) {
3251
- return cs({
3252
- observeElementRect: ss,
3253
- observeElementOffset: is,
3254
- scrollToFn: os,
3255
- ...s
3323
+ function vs(t) {
3324
+ return ys({
3325
+ observeElementRect: us,
3326
+ observeElementOffset: hs,
3327
+ scrollToFn: gs,
3328
+ ...t
3256
3329
  });
3257
3330
  }
3258
- function us(s, e) {
3259
- const t = [], n = (i) => {
3260
- t.push(i), !e.some((o) => o === i.getId()) && i.getChildren().length > 0 && i.getChildren().forEach((o) => n(o));
3331
+ function Ss(t, e) {
3332
+ const n = [], s = (i) => {
3333
+ n.push(i), !e.some((o) => o === i.getId()) && i.getChildren().length > 0 && i.getChildren().forEach((o) => s(o));
3261
3334
  };
3262
- return s.forEach((i) => n(i)), t;
3335
+ return t.forEach((i) => s(i)), n;
3263
3336
  }
3264
- const hs = (s, e, t, n, i, r) => {
3265
- const o = B(
3266
- () => us(e, t),
3267
- [e, t]
3268
- ), l = T((u) => {
3269
- const m = o[u];
3337
+ const As = (t, e, n, s, i, r) => {
3338
+ const o = F(
3339
+ () => Ss(e, n),
3340
+ [e, n]
3341
+ ), l = C((d) => {
3342
+ const m = o[d];
3270
3343
  return m && m.getMilestoneApis().some(
3271
- (h) => !h.getTime().isBefore(i) && !h.getTime().isAfter(r)
3272
- ) ? n * ot : n;
3273
- }, [o, n, i, r]);
3274
- return { virtualizer: ds({
3344
+ (u) => !u.getTime().isBefore(i) && !u.getTime().isAfter(r)
3345
+ ) ? s * mt : s;
3346
+ }, [o, s, i, r]);
3347
+ return { virtualizer: vs({
3275
3348
  count: o.length,
3276
- getScrollElement: () => s.current,
3349
+ getScrollElement: () => t.current,
3277
3350
  estimateSize: l,
3278
3351
  overscan: 5
3279
3352
  }), visibleResources: o };
3280
- }, Rs = (s) => /* @__PURE__ */ a(zt, { children: /* @__PURE__ */ a(ms, { ...s }) }), ms = (s) => {
3281
- const { state: e, dispatch: t } = be(), n = k(null), i = k(null), r = k(null), o = k(null), l = k(null), c = k(null), {
3282
- start: u,
3353
+ }, Ys = (t) => /* @__PURE__ */ a($t, { children: /* @__PURE__ */ a(Ms, { ...t }) }), Ms = (t) => {
3354
+ const { state: e, dispatch: n } = De(), s = k(null), i = k(null), r = k(null), o = k(null), l = k(null), c = k(null), {
3355
+ start: d,
3283
3356
  end: m,
3284
3357
  editable: f,
3285
- selectable: h,
3286
- lineHeight: d,
3287
- slotMinWidth: v,
3358
+ selectable: u,
3359
+ lineHeight: h,
3360
+ slotMinWidth: A,
3288
3361
  schedulantMaxHeight: p,
3289
- schedulantViewType: y,
3290
- events: b,
3362
+ schedulantViewType: S,
3363
+ events: M,
3291
3364
  resources: g,
3292
- milestones: A,
3293
- checkpoints: S,
3294
- resourceAreaColumns: M,
3295
- resourceAreaWidth: C,
3365
+ milestones: y,
3366
+ checkpoints: v,
3367
+ resourceAreaColumns: b,
3368
+ resourceAreaWidth: T,
3296
3369
  companyHolidays: D,
3297
- specialWorkdays: P,
3298
- nationalHolidays: I,
3299
- dragHintColor: L,
3300
- selectionColor: H
3301
- } = s, Y = B(
3302
- () => new Vn(s, n),
3370
+ specialWorkdays: O,
3371
+ nationalHolidays: P,
3372
+ dragHintColor: Y,
3373
+ selectionColor: z
3374
+ } = t, _ = F(
3375
+ () => new Xn(t, s),
3303
3376
  // eslint-disable-next-line react-hooks/exhaustive-deps
3304
3377
  [
3305
- u,
3378
+ d,
3306
3379
  m,
3307
3380
  f,
3381
+ u,
3308
3382
  h,
3309
- d,
3310
- v,
3311
- p,
3312
- y,
3313
- b,
3314
- g,
3315
3383
  A,
3384
+ p,
3316
3385
  S,
3317
3386
  M,
3318
- C,
3387
+ g,
3388
+ y,
3389
+ v,
3390
+ b,
3391
+ T,
3319
3392
  D,
3393
+ O,
3320
3394
  P,
3321
- I,
3322
- L,
3323
- H
3395
+ Y,
3396
+ z
3324
3397
  ]
3325
- ), R = B(() => Y.getScheduleApi(), [Y]);
3326
- R.updateProps(s);
3327
- const z = B(() => ({
3398
+ ), R = F(() => _.getScheduleApi(), [_]);
3399
+ R.updateProps(t);
3400
+ const V = F(() => ({
3328
3401
  "--schedulant-drag-hint-color": R.getDragHintColor(),
3329
3402
  "--schedulant-selection-color": R.getSelectionColor()
3330
3403
  }), [R]), {
3331
- datagridResizerMouseUp: F,
3332
- datagridResizerMouseDown: j,
3333
- datagridCellResizerMouseUp: Ee,
3334
- datagridCellResizerMouseDownFunc: Ce
3335
- } = tn(t, n, c), Te = R.getTimelineApi(), { virtualizer: De, visibleResources: Re } = hs(
3404
+ datagridResizerMouseUp: q,
3405
+ datagridResizerMouseDown: Q,
3406
+ datagridCellResizerMouseUp: Ie,
3407
+ datagridCellResizerMouseDownFunc: Oe
3408
+ } = cn(n, s, c), Pe = R.getTimelineApi(), { virtualizer: Le, visibleResources: ne } = As(
3336
3409
  o,
3337
3410
  R.getResourceApis(),
3338
3411
  e.collapseIds,
3339
3412
  R.getLineHeight(),
3340
- Te.getStart(),
3341
- Te.getEnd()
3413
+ Pe.getStart(),
3414
+ Pe.getEnd()
3342
3415
  );
3343
- jt(s.schedulantMaxHeight), Zn(n, Y), Gt(c, s.resourceAreaWidth), $t(l, o, i, r);
3344
- const ke = T((J) => {
3345
- R.isSelectable() && ln(J.nativeEvent);
3346
- }, [R]);
3416
+ Jt(t.schedulantMaxHeight), os(s, _), tn(c, t.resourceAreaWidth), en(l, o, i, r);
3417
+ const ce = k(R.onResourceSelect());
3418
+ ce.current = R.onResourceSelect();
3419
+ const Ne = C((U) => {
3420
+ ce.current?.(U);
3421
+ }, []), Ye = F(
3422
+ () => ne.map((U) => U.getId()),
3423
+ [ne]
3424
+ ), _e = C((U) => {
3425
+ R.isSelectable() && gn(U.nativeEvent, Ye, Ne);
3426
+ }, [R, Ye, Ne]);
3347
3427
  return N(() => {
3348
- const J = (gt) => {
3349
- n.current && !n.current.contains(gt.target) && at();
3428
+ const U = (Mt) => {
3429
+ s.current && !s.current.contains(Mt.target) && Te(ce.current);
3350
3430
  };
3351
- return document.addEventListener("click", J), () => document.removeEventListener("click", J);
3352
- }, []), /* @__PURE__ */ a("div", { className: "schedulant", ref: n, onMouseUp: F, onClick: ke, onContextMenu: ke, style: z, 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: [
3353
- /* @__PURE__ */ O("colgroup", { children: [
3431
+ return document.addEventListener("click", U), () => document.removeEventListener("click", U);
3432
+ }, []), /* @__PURE__ */ a("div", { className: "schedulant", ref: s, onMouseUp: q, onClick: _e, onContextMenu: _e, style: V, children: /* @__PURE__ */ a("div", { id: "schedulant-view-harness", className: "schedulant-view-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-view", children: /* @__PURE__ */ I("table", { role: "grid", className: "schedulant-scrollgrid", children: [
3433
+ /* @__PURE__ */ I("colgroup", { children: [
3354
3434
  /* @__PURE__ */ a("col", { style: { width: e.resourceAreaWidth }, ref: c }),
3355
3435
  /* @__PURE__ */ a("col", {}),
3356
3436
  /* @__PURE__ */ a("col", {})
3357
3437
  ] }),
3358
- /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ O(
3438
+ /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ I(
3359
3439
  "tr",
3360
3440
  {
3361
3441
  role: "presentation",
3362
3442
  className: "schedulant-scrollgrid-section schedulant-scrollgrid-section-head",
3363
3443
  children: [
3364
3444
  /* @__PURE__ */ a("th", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-head-left", ref: i, children: /* @__PURE__ */ a(
3365
- Fn,
3445
+ Qn,
3366
3446
  {
3367
- schedulantView: Y,
3368
- cellResizerMouseUp: Ee,
3369
- cellResizerMouseDownFunc: Ce
3447
+ schedulantView: _,
3448
+ cellResizerMouseUp: Ie,
3449
+ cellResizerMouseDownFunc: Oe
3370
3450
  }
3371
3451
  ) }) }) }),
3372
3452
  /* @__PURE__ */ a(
@@ -3374,8 +3454,8 @@ const hs = (s, e, t, n, i, r) => {
3374
3454
  {
3375
3455
  role: "presentation",
3376
3456
  className: "schedulant-resource-timeline-divider",
3377
- onMouseUp: F,
3378
- onMouseDown: j
3457
+ onMouseUp: q,
3458
+ onMouseDown: Q
3379
3459
  }
3380
3460
  ),
3381
3461
  /* @__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(
@@ -3383,27 +3463,27 @@ const hs = (s, e, t, n, i, r) => {
3383
3463
  {
3384
3464
  id: "schedulant-timeline-head",
3385
3465
  className: "schedulant-timeline-head",
3386
- children: /* @__PURE__ */ a(Bn, { schedulantView: Y })
3466
+ children: /* @__PURE__ */ a(Kn, { schedulantView: _ })
3387
3467
  }
3388
3468
  ) }) }) })
3389
3469
  ]
3390
3470
  }
3391
3471
  ) }),
3392
- /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ O(
3472
+ /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ I(
3393
3473
  "tr",
3394
3474
  {
3395
3475
  role: "presentation",
3396
3476
  className: "schedulant-scrollgrid-section schedulant-scrollgrid-section-body",
3397
3477
  children: [
3398
3478
  /* @__PURE__ */ a("td", { role: "presentation", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-harness", children: /* @__PURE__ */ a("div", { className: "schedulant-scroller-body-left", ref: l, children: /* @__PURE__ */ a(
3399
- Gn,
3479
+ ns,
3400
3480
  {
3401
- schedulantView: Y,
3402
- virtualizer: De,
3403
- visibleResources: Re,
3481
+ schedulantView: _,
3482
+ virtualizer: Le,
3483
+ visibleResources: ne,
3404
3484
  collapseIds: e.collapseIds,
3405
- cellResizerMouseUp: Ee,
3406
- cellResizerMouseDownFunc: Ce
3485
+ cellResizerMouseUp: Ie,
3486
+ cellResizerMouseDownFunc: Oe
3407
3487
  }
3408
3488
  ) }) }) }),
3409
3489
  /* @__PURE__ */ a(
@@ -3411,18 +3491,18 @@ const hs = (s, e, t, n, i, r) => {
3411
3491
  {
3412
3492
  role: "presentation",
3413
3493
  className: "schedulant-resource-timeline-divider",
3414
- onMouseUp: F,
3415
- onMouseDown: j
3494
+ onMouseUp: q,
3495
+ onMouseDown: Q
3416
3496
  }
3417
3497
  ),
3418
- /* @__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: [
3419
- /* @__PURE__ */ a(Xn, { schedulantView: Y }),
3498
+ /* @__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__ */ I("div", { className: "schedulant-timeline-body", children: [
3499
+ /* @__PURE__ */ a(ss, { schedulantView: _ }),
3420
3500
  /* @__PURE__ */ a(
3421
- Kn,
3501
+ rs,
3422
3502
  {
3423
- schedulantView: Y,
3424
- virtualizer: De,
3425
- visibleResources: Re
3503
+ schedulantView: _,
3504
+ virtualizer: Le,
3505
+ visibleResources: ne
3426
3506
  }
3427
3507
  )
3428
3508
  ] }) }) }) })
@@ -3432,5 +3512,5 @@ const hs = (s, e, t, n, i, r) => {
3432
3512
  ] }) }) }) });
3433
3513
  };
3434
3514
  export {
3435
- Rs as Schedulant
3515
+ Ys as Schedulant
3436
3516
  };