@xpyjs/gantt-core 0.0.1-beta.3 → 0.0.1-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/x-gantt.js CHANGED
@@ -1,11 +1,11 @@
1
1
  var Pt = Object.defineProperty;
2
2
  var Yt = (f, t, e) => t in f ? Pt(f, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[t] = e;
3
3
  var a = (f, t, e) => Yt(f, typeof t != "symbol" ? t + "" : t, e);
4
- import I from "dayjs";
4
+ import G from "dayjs";
5
5
  import { default as ai } from "dayjs";
6
6
  import { merge as rt, isArray as X, isString as V, isFunction as j, cloneDeep as Z, isObject as Ct, isNumber as Ut, omit as yt, throttle as wt, isBoolean as ht, debounce as Xt } from "lodash-es";
7
7
  import S from "konva";
8
- const Lt = "0.0.1-beta.3";
8
+ const Lt = "0.0.1-beta.4";
9
9
  function Vt() {
10
10
  const f = "#eca710", t = "#ffffff", e = "#e7209e", i = "#ffffff", s = "#1c42e8";
11
11
  [
@@ -114,7 +114,7 @@ const N = class N {
114
114
  */
115
115
  static formatArgs(...t) {
116
116
  const e = [N.Prefix];
117
- return N.options.showTimestamp && e.unshift(`[${I().format("YYYY-MM-DD HH:mm:ss.SSS")}]`), [e.join(""), ...t];
117
+ return N.options.showTimestamp && e.unshift(`[${G().format("YYYY-MM-DD HH:mm:ss.SSS")}]`), [e.join(""), ...t];
118
118
  }
119
119
  };
120
120
  a(N, "Prefix", "[XGantt]"), a(N, "options", {
@@ -329,7 +329,7 @@ class Kt {
329
329
  const s = [];
330
330
  t.holiday.holidays.forEach((n) => {
331
331
  if (X(n.date)) {
332
- const o = n.date.map((r) => I(r)).sort((r, h) => r.diff(h));
332
+ const o = n.date.map((r) => G(r)).sort((r, h) => r.diff(h));
333
333
  for (let r = 1; r < o.length; r++)
334
334
  if (o[r].diff(o[r - 1], "day") > 1) {
335
335
  s.push({
@@ -448,10 +448,10 @@ function bt(f, t = 16, e = 16) {
448
448
  const s = new Promise((n, o) => {
449
449
  let r = f;
450
450
  if (!/viewBox\s*=\s*["'][^"']*["']/.test(r)) {
451
- const l = r.match(/width\s*=\s*["']([^"']*)["']/), p = r.match(/height\s*=\s*["']([^"']*)["']/), m = l ? parseFloat(l[1]) : t, u = p ? parseFloat(p[1]) : e;
451
+ const l = r.match(/width\s*=\s*["']([^"']*)["']/), m = r.match(/height\s*=\s*["']([^"']*)["']/), p = l ? parseFloat(l[1]) : t, u = m ? parseFloat(m[1]) : e;
452
452
  r = r.replace(
453
453
  /<svg([^>]*)>/,
454
- `<svg$1 viewBox="0 0 ${m} ${u}">`
454
+ `<svg$1 viewBox="0 0 ${p} ${u}">`
455
455
  );
456
456
  }
457
457
  r = r.replace(/width\s*=\s*["'][^"']*["']/, `width="${t}"`), r = r.replace(/height\s*=\s*["'][^"']*["']/, `height="${e}"`), /width\s*=/.test(r) || (r = r.replace(/<svg/, `<svg width="${t}"`)), /height\s*=/.test(r) || (r = r.replace(/<svg/, `<svg height="${e}"`)), /preserveAspectRatio\s*=/.test(r) || (r = r.replace(
@@ -549,7 +549,7 @@ class mt {
549
549
  /** 切换展示模式时,需要调整时间 */
550
550
  updateMode() {
551
551
  let t = !1;
552
- return this.data[this.fields.startTime] && (!this.startTime || !this.startTime.isSame(I(this.data[this.fields.startTime]))) && (this.startTime = I(this.data[this.fields.startTime]), t = !0), this.data[this.fields.endTime] && (!this.endTime || !this.endTime.isSame(I(this.data[this.fields.endTime]))) && (this.endTime = I(this.data[this.fields.endTime]), t = !0), this.startTime && this.endTime && this.duration === 0 && (this.duration = this.endTime.diff(this.startTime)), this.isMilestone() && (!this.endTime || !this.endTime.isSame(this.startTime)) && (this.endTime = this.startTime, t = !0), t;
552
+ return this.data[this.fields.startTime] && (!this.startTime || !this.startTime.isSame(G(this.data[this.fields.startTime]))) && (this.startTime = G(this.data[this.fields.startTime]), t = !0), this.data[this.fields.endTime] && (!this.endTime || !this.endTime.isSame(G(this.data[this.fields.endTime]))) && (this.endTime = G(this.data[this.fields.endTime]), t = !0), this.startTime && this.endTime && this.duration === 0 && (this.duration = this.endTime.diff(this.startTime)), this.isMilestone() && (!this.endTime || !this.endTime.isSame(this.startTime)) && (this.endTime = this.startTime, t = !0), t;
553
553
  }
554
554
  updateData(t) {
555
555
  this.data = t;
@@ -615,9 +615,9 @@ class Qt {
615
615
  const s = this.store.getOptionManager().getOptions().fields, n = this.store.getOptionManager().getOptions().baselines.fields;
616
616
  this.taskId = i[t.getOptionManager().getOptions().baselines.taskKey], this.id = i[s.id] || i[n.id] || Q(), this.name = i[s.name] || i[n.name] || "", this.highlight = i[n.highlight] !== !1, this.target = i[n.target] === !0;
617
617
  const o = i[s.startTime] || i[n.startTime];
618
- o && (this.startTime = I(o));
618
+ o && (this.startTime = G(o));
619
619
  const r = i[s.endTime] || i[n.endTime];
620
- r && (this.endTime = I(r)), this.data = i;
620
+ r && (this.endTime = G(r)), this.data = i;
621
621
  }
622
622
  getField(t) {
623
623
  return this.data[t];
@@ -927,20 +927,20 @@ class Jt {
927
927
  let d = t.parent;
928
928
  for (; c !== "none" && d; ) {
929
929
  if (c === "expand") {
930
- let p = d.startTime || o, m = d.endTime || r;
931
- (!d.startTime || o.isBefore(d.startTime)) && (p = o), (!d.endTime || r.isAfter(d.endTime)) && (m = r), (d.startTime === void 0 || d.endTime === void 0 || !p.isSame(d.startTime) || !m.isSame(d.endTime)) && (n.findIndex((u) => u.id === d.id) === -1 && n.push(d.clone()), d.updateTime(p, m));
930
+ let m = d.startTime || o, p = d.endTime || r;
931
+ (!d.startTime || o.isBefore(d.startTime)) && (m = o), (!d.endTime || r.isAfter(d.endTime)) && (p = r), (d.startTime === void 0 || d.endTime === void 0 || !m.isSame(d.startTime) || !p.isSame(d.endTime)) && (n.findIndex((u) => u.id === d.id) === -1 && n.push(d.clone()), d.updateTime(m, p));
932
932
  } else c === "strict" && (d.startTime && o.isBefore(d.startTime) && (o = d.startTime, r.isSameOrBefore(o) && (r = o.add(1, g))), d.endTime && r.isAfter(d.endTime) && (r = d.endTime, o.isAfter(r) && (o = r.subtract(1, g))));
933
933
  d = d.parent;
934
934
  }
935
935
  let l = t.children || [];
936
936
  for (; h !== "none" && l.length > 0; ) {
937
- const p = [];
938
- l.forEach((m) => {
939
- let u = m.startTime || o, x = m.endTime || r, w = o.diff(t.startTime), T = r.diff(t.endTime);
940
- h === "scale" ? s === "both" ? (n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u.add(w), x.add(T))) : s === "left" ? (u = u.add(w), u.isSameOrAfter(x.subtract(1, g)) && (x.isBefore(t.endTime) ? x = u.add(1, g) : u = x.subtract(1, g), u.isSameOrBefore(o) && (o = u)), n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u, x)) : s === "right" && (x = x.add(T), x.isSameOrBefore(u.add(1, g)) && (u.isAfter(t.startTime) ? u = x.subtract(1, g) : x = u.add(1, g)), x.isSameOrAfter(r) && (r = x), n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u, x)) : h === "fixed" && (s === "both" ? (n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u.add(w), x.add(T))) : s === "left" ? u.isSameOrBefore(o) && (u = o, u.isSameOrAfter(x.subtract(1, g)) && (x.isBefore(t.endTime) ? x = u.add(1, g) : u = x.subtract(1, g), u.isSameOrBefore(o) && (o = u)), n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u, x)) : s === "right" && x.isSameOrAfter(r) && (x = r, x.isSameOrBefore(u.add(1, g)) && (u.isAfter(t.startTime) ? u = x.subtract(1, g) : x = u.add(1, g)), x.isSameOrAfter(r) && (r = x), n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u, x))), m.children && m.children.length > 0 && p.push(...m.children);
941
- }), l = p;
937
+ const m = [];
938
+ l.forEach((p) => {
939
+ let u = p.startTime || o, y = p.endTime || r, x = o.diff(t.startTime), T = r.diff(t.endTime);
940
+ h === "scale" ? s === "both" ? (n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u.add(x), y.add(T))) : s === "left" ? (u = u.add(x), u.isSameOrAfter(y.subtract(1, g)) && (y.isBefore(t.endTime) ? y = u.add(1, g) : u = y.subtract(1, g), u.isSameOrBefore(o) && (o = u)), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y)) : s === "right" && (y = y.add(T), y.isSameOrBefore(u.add(1, g)) && (u.isAfter(t.startTime) ? u = y.subtract(1, g) : y = u.add(1, g)), y.isSameOrAfter(r) && (r = y), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y)) : h === "fixed" && (s === "both" ? (n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u.add(x), y.add(T))) : s === "left" ? u.isSameOrBefore(o) && (u = o, u.isSameOrAfter(y.subtract(1, g)) && (y.isBefore(t.endTime) ? y = u.add(1, g) : u = y.subtract(1, g), u.isSameOrBefore(o) && (o = u)), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y)) : s === "right" && y.isSameOrAfter(r) && (y = r, y.isSameOrBefore(u.add(1, g)) && (u.isAfter(t.startTime) ? u = y.subtract(1, g) : y = u.add(1, g)), y.isSameOrAfter(r) && (r = y), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y))), p.children && p.children.length > 0 && m.push(...p.children);
941
+ }), l = m;
942
942
  }
943
- n.findIndex((p) => p.id === t.id) === -1 && n.push(t.clone()), t.updateTime(o, r);
943
+ n.findIndex((m) => m.id === t.id) === -1 && n.push(t.clone()), t.updateTime(o, r);
944
944
  }
945
945
  //** 基线数据操作 */
946
946
  setBaselines(t) {
@@ -1009,8 +1009,8 @@ function Zt(f) {
1009
1009
  }
1010
1010
  function te(f, t, e, i, s = !1, n = !1) {
1011
1011
  const o = (l) => {
1012
- const p = Math.round($(l, 0, 255)).toString(16);
1013
- return p.length === 1 ? "0" + p : p;
1012
+ const m = Math.round($(l, 0, 255)).toString(16);
1013
+ return m.length === 1 ? "0" + m : m;
1014
1014
  }, r = o(f), h = o(t), c = o(e), g = o(i * 255);
1015
1015
  if (s && r[0] === r[1] && h[0] === h[1] && c[0] === c[1] && i === 1 && // Alpha 必须为 1 才能缩写
1016
1016
  !n)
@@ -1377,13 +1377,13 @@ class ee {
1377
1377
  */
1378
1378
  processColumns(t, e = [], i, s = 1) {
1379
1379
  t.forEach((n, o) => {
1380
- var m;
1380
+ var p;
1381
1381
  const r = "children" in n && Array.isArray(n.children) && n.children.length > 0, h = !r;
1382
1382
  let c = "";
1383
1383
  r ? c = `group-${o}` : c = `field-${n.field}`;
1384
1384
  const g = [...(i == null ? void 0 : i.path) || [], c];
1385
1385
  c = "column-" + o + "-" + g.join("-");
1386
- const d = n.label || (h ? n.field : ""), l = h ? ((m = this.temporaryLeafColumns.find((u) => u.key === c)) == null ? void 0 : m.width) || n.width || 100 : "auto", p = {
1386
+ const d = n.label || (h ? n.field : ""), l = h ? ((p = this.temporaryLeafColumns.find((u) => u.key === c)) == null ? void 0 : p.width) || n.width || 100 : "auto", m = {
1387
1387
  label: d,
1388
1388
  level: s,
1389
1389
  maxLevel: s,
@@ -1394,18 +1394,18 @@ class ee {
1394
1394
  isLeaf: h,
1395
1395
  width: l
1396
1396
  };
1397
- if (e.push(p), h)
1398
- this.leafColumns.push(p);
1397
+ if (e.push(m), h)
1398
+ this.leafColumns.push(m);
1399
1399
  else if (r) {
1400
1400
  const u = n.children;
1401
1401
  this.processColumns(
1402
1402
  u,
1403
- p.children,
1404
- p,
1403
+ m.children,
1404
+ m,
1405
1405
  s + 1
1406
- ), p.maxLevel = Math.max(
1407
- p.maxLevel,
1408
- p.children.reduce((x, w) => Math.max(x, w.maxLevel), 0)
1406
+ ), m.maxLevel = Math.max(
1407
+ m.maxLevel,
1408
+ m.children.reduce((y, x) => Math.max(y, x.maxLevel), 0)
1409
1409
  );
1410
1410
  }
1411
1411
  }), this.temporaryLeafColumns = Z(this.leafColumns);
@@ -1551,7 +1551,7 @@ const tt = class tt {
1551
1551
  }
1552
1552
  /** 更新各种缓存配置 */
1553
1553
  update() {
1554
- this.setLinks(this.links);
1554
+ this.setLinks(this.links, !0);
1555
1555
  }
1556
1556
  /** 检查连线是否存在 */
1557
1557
  isLinkExist(t, e, i) {
@@ -1596,12 +1596,18 @@ const tt = class tt {
1596
1596
  /** 校验新增连线是否会产生环 */
1597
1597
  validateChain(t, e, i) {
1598
1598
  const s = { from: t, to: e, type: i }, n = this.validateLink(s);
1599
- return n.ok ? this.enableCycleDetection && this.willCreateCycle(t, e) ? {
1600
- ok: !1,
1601
- reason: Y.LINK_CYCLE,
1602
- message: O.getMessage("Adding this link would create a cycle"),
1603
- cycleInfo: this.buildSimpleCycleInfo(t, e)
1604
- } : { ok: !0 } : n;
1599
+ if (!n.ok) return n;
1600
+ if (this.enableCycleDetection) {
1601
+ const o = this.willCreateCycle(t, e);
1602
+ if (o)
1603
+ return {
1604
+ ok: !1,
1605
+ reason: Y.LINK_CYCLE,
1606
+ message: O.getMessage("Adding this link would create a cycle"),
1607
+ cycleInfo: o
1608
+ };
1609
+ }
1610
+ return { ok: !0 };
1605
1611
  }
1606
1612
  /** 批量校验连线 */
1607
1613
  validateLinks(t) {
@@ -1684,81 +1690,81 @@ const tt = class tt {
1684
1690
  };
1685
1691
  const i = this.forwardMemo.get(t), s = this.backwardMemo.get(t);
1686
1692
  this.recordCacheAccess(t, !!(i && s));
1687
- const n = (w) => (this.fromLinksMap.get(w) || []).map((b) => this.getTask(b.to)).filter((b) => !!b), o = (w) => (this.toLinksMap.get(w) || []).map((b) => this.getTask(b.from)).filter((b) => !!b), r = (w, T, b = /* @__PURE__ */ new Set()) => {
1688
- const y = w.id;
1689
- if (this.forwardMemo.has(y))
1690
- return this.recordCacheAccess(y, !0), this.forwardMemo.get(y);
1691
- if (T.has(w.id) || b.has(w.id))
1693
+ const n = (x) => (this.fromLinksMap.get(x) || []).map((b) => this.getTask(b.to)).filter((b) => !!b), o = (x) => (this.toLinksMap.get(x) || []).map((b) => this.getTask(b.from)).filter((b) => !!b), r = (x, T, b = /* @__PURE__ */ new Set()) => {
1694
+ const w = x.id;
1695
+ if (this.forwardMemo.has(w))
1696
+ return this.recordCacheAccess(w, !0), this.forwardMemo.get(w);
1697
+ if (T.has(x.id) || b.has(x.id))
1692
1698
  return [];
1693
- T.add(w.id), b.add(w.id);
1694
- const k = n(w.id);
1699
+ T.add(x.id), b.add(x.id);
1700
+ const C = n(x.id);
1695
1701
  let E = [];
1696
- if (k.length === 0)
1697
- E = [[w]];
1702
+ if (C.length === 0)
1703
+ E = [[x]];
1698
1704
  else {
1699
- for (const C of k) {
1700
- const v = r(C, T, b);
1705
+ for (const k of C) {
1706
+ const v = r(k, T, b);
1701
1707
  for (const M of v)
1702
- E.push([w, ...M]);
1708
+ E.push([x, ...M]);
1703
1709
  }
1704
- E.length === 0 && (E = [[w]]);
1710
+ E.length === 0 && (E = [[x]]);
1705
1711
  }
1706
- return T.delete(w.id), E.length < 100 && (this.forwardMemo.set(y, E), this.recordCacheAccess(y, !1)), E;
1707
- }, h = (w, T, b = /* @__PURE__ */ new Set()) => {
1708
- const y = w.id;
1709
- if (this.backwardMemo.has(y))
1710
- return this.recordCacheAccess(y, !0), this.backwardMemo.get(y);
1711
- if (T.has(w.id) || b.has(w.id))
1712
+ return T.delete(x.id), E.length < 100 && (this.forwardMemo.set(w, E), this.recordCacheAccess(w, !1)), E;
1713
+ }, h = (x, T, b = /* @__PURE__ */ new Set()) => {
1714
+ const w = x.id;
1715
+ if (this.backwardMemo.has(w))
1716
+ return this.recordCacheAccess(w, !0), this.backwardMemo.get(w);
1717
+ if (T.has(x.id) || b.has(x.id))
1712
1718
  return [];
1713
- T.add(w.id), b.add(w.id);
1714
- const k = o(w.id);
1719
+ T.add(x.id), b.add(x.id);
1720
+ const C = o(x.id);
1715
1721
  let E = [];
1716
- if (k.length === 0)
1717
- E = [[w]];
1722
+ if (C.length === 0)
1723
+ E = [[x]];
1718
1724
  else {
1719
- for (const C of k) {
1720
- const v = h(C, T, b);
1725
+ for (const k of C) {
1726
+ const v = h(k, T, b);
1721
1727
  for (const M of v)
1722
- E.push([...M, w]);
1728
+ E.push([...M, x]);
1723
1729
  }
1724
- E.length === 0 && (E = [[w]]);
1730
+ E.length === 0 && (E = [[x]]);
1725
1731
  }
1726
- return T.delete(w.id), E.length < 100 && (this.backwardMemo.set(y, E), this.recordCacheAccess(y, !1)), E;
1732
+ return T.delete(x.id), E.length < 100 && (this.backwardMemo.set(w, E), this.recordCacheAccess(w, !1)), E;
1727
1733
  }, c = h(e, /* @__PURE__ */ new Set()), g = r(e, /* @__PURE__ */ new Set());
1728
- this.getDirectlyConnectedTasks(t).forEach((w) => {
1729
- this.establishCacheDependency(t, w.id), this.establishCacheDependency(w.id, t);
1734
+ this.getDirectlyConnectedTasks(t).forEach((x) => {
1735
+ this.establishCacheDependency(t, x.id), this.establishCacheDependency(x.id, t);
1730
1736
  });
1731
- const l = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = (w, T) => {
1737
+ const l = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), p = (x, T) => {
1732
1738
  const b = [];
1733
- for (const y of w) {
1734
- y.forEach((k) => l.set(k.id, k));
1735
- for (let k = 0; k < y.length - 1; k++) {
1736
- const E = y[k].id, C = y[k + 1].id, v = this.findLinkFast(E, C);
1739
+ for (const w of x) {
1740
+ w.forEach((C) => l.set(C.id, C));
1741
+ for (let C = 0; C < w.length - 1; C++) {
1742
+ const E = w[C].id, k = w[C + 1].id, v = this.findLinkFast(E, k);
1737
1743
  if (v) {
1738
1744
  const M = `${v.from}-${v.to}-${v.type || "default"}`;
1739
- p.has(M) || (b.push(v), p.set(M, v));
1745
+ m.has(M) || (b.push(v), m.set(M, v));
1740
1746
  }
1741
1747
  }
1742
1748
  }
1743
1749
  return b;
1744
- }, u = m(c), x = m(g);
1750
+ }, u = p(c), y = p(g);
1745
1751
  return {
1746
1752
  prev: {
1747
- chain: c.map((w) => w.map((T) => T.getEmitData().data)),
1753
+ chain: c.map((x) => x.map((T) => T.getEmitData().data)),
1748
1754
  nodes: c.flat().filter(
1749
- (w, T, b) => b.findIndex((y) => y.id === w.id) === T
1750
- ).map((w) => w.getEmitData().data),
1755
+ (x, T, b) => b.findIndex((w) => w.id === x.id) === T
1756
+ ).map((x) => x.getEmitData().data),
1751
1757
  links: u
1752
1758
  },
1753
1759
  next: {
1754
- chain: g.map((w) => w.map((T) => T.getEmitData().data)),
1760
+ chain: g.map((x) => x.map((T) => T.getEmitData().data)),
1755
1761
  nodes: g.flat().filter(
1756
- (w, T, b) => b.findIndex((y) => y.id === w.id) === T
1757
- ).map((w) => w.getEmitData().data),
1758
- links: x
1762
+ (x, T, b) => b.findIndex((w) => w.id === x.id) === T
1763
+ ).map((x) => x.getEmitData().data),
1764
+ links: y
1759
1765
  },
1760
- allNodes: Array.from(l.values()).map((w) => w.getEmitData().data),
1761
- allLinks: Array.from(p.values()),
1766
+ allNodes: Array.from(l.values()).map((x) => x.getEmitData().data),
1767
+ allLinks: Array.from(m.values()),
1762
1768
  current: e.getEmitData().data
1763
1769
  };
1764
1770
  }
@@ -1773,16 +1779,16 @@ const tt = class tt {
1773
1779
  let o = 0;
1774
1780
  const r = [], h = (l) => {
1775
1781
  e.set(l, o), i.set(l, o), o++, n.push(l), s.add(l);
1776
- const p = this.fromLinksMap.get(l) || [];
1777
- for (const m of p)
1778
- e.has(m.to) ? s.has(m.to) && i.set(l, Math.min(i.get(l), e.get(m.to))) : (h(m.to), i.set(l, Math.min(i.get(l), i.get(m.to))));
1782
+ const m = this.fromLinksMap.get(l) || [];
1783
+ for (const p of m)
1784
+ e.has(p.to) ? s.has(p.to) && i.set(l, Math.min(i.get(l), e.get(p.to))) : (h(p.to), i.set(l, Math.min(i.get(l), i.get(p.to))));
1779
1785
  if (i.get(l) === e.get(l)) {
1780
- const m = [];
1786
+ const p = [];
1781
1787
  for (; ; ) {
1782
1788
  const u = n.pop();
1783
- if (s.delete(u), m.push(u), u === l) break;
1789
+ if (s.delete(u), p.push(u), u === l) break;
1784
1790
  }
1785
- r.push(m);
1791
+ r.push(p);
1786
1792
  }
1787
1793
  };
1788
1794
  this.store.getDataManager().getTasks(!1).forEach((l) => {
@@ -1845,19 +1851,34 @@ const tt = class tt {
1845
1851
  /** 增量环检测(基于拓扑序 + DFS) */
1846
1852
  willCreateCycle(t, e) {
1847
1853
  if (this.computeTopo()) {
1848
- const o = this.topoIndex.get(t), r = this.topoIndex.get(e);
1849
- if (o != null && r != null && o < r) return !1;
1854
+ const r = this.topoIndex.get(t), h = this.topoIndex.get(e);
1855
+ if (r != null && h != null && r < h) return null;
1850
1856
  }
1851
- const s = [e], n = /* @__PURE__ */ new Set();
1857
+ const s = [e], n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
1852
1858
  for (; s.length; ) {
1853
- const o = s.pop();
1854
- if (o === t) return !0;
1855
- if (n.has(o)) continue;
1856
- n.add(o);
1857
- const r = this.fromLinksMap.get(o) || [];
1858
- for (const h of r) s.push(h.to);
1859
+ const r = s.pop();
1860
+ if (n.has(r)) continue;
1861
+ n.add(r);
1862
+ const h = this.fromLinksMap.get(r) || [];
1863
+ for (const c of h) {
1864
+ const g = c.to;
1865
+ if (!n.has(g) && !o.has(g) && o.set(g, r), g === t) {
1866
+ o.has(g) || o.set(g, r);
1867
+ const d = [];
1868
+ let l = t;
1869
+ for (; l !== void 0; )
1870
+ d.push(l), l = o.get(l);
1871
+ const m = d.slice().reverse(), p = [t, ...m];
1872
+ return {
1873
+ cycles: [p],
1874
+ nodes: Array.from(new Set(p)),
1875
+ sccs: []
1876
+ };
1877
+ }
1878
+ s.push(g);
1879
+ }
1859
1880
  }
1860
- return !1;
1881
+ return null;
1861
1882
  }
1862
1883
  /** 构建/重建邻接表 */
1863
1884
  rebuildAdjacency() {
@@ -1897,7 +1918,6 @@ const tt = class tt {
1897
1918
  sccs: []
1898
1919
  };
1899
1920
  }
1900
- // 优化后的缓存失效策略
1901
1921
  /**
1902
1922
  * 精细化缓存失效策略
1903
1923
  * 根据操作类型和影响范围进行精确的缓存失效
@@ -2091,24 +2111,24 @@ var Mt = { exports: {} };
2091
2111
  (function(e, i) {
2092
2112
  f.exports = i();
2093
2113
  })(P, function() {
2094
- var e, i, s = 1e3, n = 6e4, o = 36e5, r = 864e5, h = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, c = 31536e6, g = 2628e6, d = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, l = { years: c, months: g, days: r, hours: o, minutes: n, seconds: s, milliseconds: 1, weeks: 6048e5 }, p = function(E) {
2095
- return E instanceof y;
2096
- }, m = function(E, C, v) {
2097
- return new y(E, v, C.$l);
2114
+ var e, i, s = 1e3, n = 6e4, o = 36e5, r = 864e5, h = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, c = 31536e6, g = 2628e6, d = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, l = { years: c, months: g, days: r, hours: o, minutes: n, seconds: s, milliseconds: 1, weeks: 6048e5 }, m = function(E) {
2115
+ return E instanceof w;
2116
+ }, p = function(E, k, v) {
2117
+ return new w(E, v, k.$l);
2098
2118
  }, u = function(E) {
2099
2119
  return i.p(E) + "s";
2100
- }, x = function(E) {
2120
+ }, y = function(E) {
2101
2121
  return E < 0;
2102
- }, w = function(E) {
2103
- return x(E) ? Math.ceil(E) : Math.floor(E);
2122
+ }, x = function(E) {
2123
+ return y(E) ? Math.ceil(E) : Math.floor(E);
2104
2124
  }, T = function(E) {
2105
2125
  return Math.abs(E);
2106
- }, b = function(E, C) {
2107
- return E ? x(E) ? { negative: !0, format: "" + T(E) + C } : { negative: !1, format: "" + E + C } : { negative: !1, format: "" };
2108
- }, y = function() {
2126
+ }, b = function(E, k) {
2127
+ return E ? y(E) ? { negative: !0, format: "" + T(E) + k } : { negative: !1, format: "" + E + k } : { negative: !1, format: "" };
2128
+ }, w = function() {
2109
2129
  function E(v, M, A) {
2110
2130
  var _ = this;
2111
- if (this.$d = {}, this.$l = A, v === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), M) return m(v * l[u(M)], this);
2131
+ if (this.$d = {}, this.$l = A, v === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), M) return p(v * l[u(M)], this);
2112
2132
  if (typeof v == "number") return this.$ms = v, this.parseFromMilliseconds(), this;
2113
2133
  if (typeof v == "object") return Object.keys(v).forEach(function(W) {
2114
2134
  _.$d[u(W)] = v[W];
@@ -2116,102 +2136,102 @@ var Mt = { exports: {} };
2116
2136
  if (typeof v == "string") {
2117
2137
  var D = v.match(d);
2118
2138
  if (D) {
2119
- var H = D.slice(2).map(function(W) {
2139
+ var I = D.slice(2).map(function(W) {
2120
2140
  return W != null ? Number(W) : 0;
2121
2141
  });
2122
- return this.$d.years = H[0], this.$d.months = H[1], this.$d.weeks = H[2], this.$d.days = H[3], this.$d.hours = H[4], this.$d.minutes = H[5], this.$d.seconds = H[6], this.calMilliseconds(), this;
2142
+ return this.$d.years = I[0], this.$d.months = I[1], this.$d.weeks = I[2], this.$d.days = I[3], this.$d.hours = I[4], this.$d.minutes = I[5], this.$d.seconds = I[6], this.calMilliseconds(), this;
2123
2143
  }
2124
2144
  }
2125
2145
  return this;
2126
2146
  }
2127
- var C = E.prototype;
2128
- return C.calMilliseconds = function() {
2147
+ var k = E.prototype;
2148
+ return k.calMilliseconds = function() {
2129
2149
  var v = this;
2130
2150
  this.$ms = Object.keys(this.$d).reduce(function(M, A) {
2131
2151
  return M + (v.$d[A] || 0) * l[A];
2132
2152
  }, 0);
2133
- }, C.parseFromMilliseconds = function() {
2153
+ }, k.parseFromMilliseconds = function() {
2134
2154
  var v = this.$ms;
2135
- this.$d.years = w(v / c), v %= c, this.$d.months = w(v / g), v %= g, this.$d.days = w(v / r), v %= r, this.$d.hours = w(v / o), v %= o, this.$d.minutes = w(v / n), v %= n, this.$d.seconds = w(v / s), v %= s, this.$d.milliseconds = v;
2136
- }, C.toISOString = function() {
2155
+ this.$d.years = x(v / c), v %= c, this.$d.months = x(v / g), v %= g, this.$d.days = x(v / r), v %= r, this.$d.hours = x(v / o), v %= o, this.$d.minutes = x(v / n), v %= n, this.$d.seconds = x(v / s), v %= s, this.$d.milliseconds = v;
2156
+ }, k.toISOString = function() {
2137
2157
  var v = b(this.$d.years, "Y"), M = b(this.$d.months, "M"), A = +this.$d.days || 0;
2138
2158
  this.$d.weeks && (A += 7 * this.$d.weeks);
2139
- var _ = b(A, "D"), D = b(this.$d.hours, "H"), H = b(this.$d.minutes, "M"), W = this.$d.seconds || 0;
2159
+ var _ = b(A, "D"), D = b(this.$d.hours, "H"), I = b(this.$d.minutes, "M"), W = this.$d.seconds || 0;
2140
2160
  this.$d.milliseconds && (W += this.$d.milliseconds / 1e3, W = Math.round(1e3 * W) / 1e3);
2141
- var G = b(W, "S"), R = v.negative || M.negative || _.negative || D.negative || H.negative || G.negative, F = D.format || H.format || G.format ? "T" : "", z = (R ? "-" : "") + "P" + v.format + M.format + _.format + F + D.format + H.format + G.format;
2161
+ var H = b(W, "S"), R = v.negative || M.negative || _.negative || D.negative || I.negative || H.negative, F = D.format || I.format || H.format ? "T" : "", z = (R ? "-" : "") + "P" + v.format + M.format + _.format + F + D.format + I.format + H.format;
2142
2162
  return z === "P" || z === "-P" ? "P0D" : z;
2143
- }, C.toJSON = function() {
2163
+ }, k.toJSON = function() {
2144
2164
  return this.toISOString();
2145
- }, C.format = function(v) {
2165
+ }, k.format = function(v) {
2146
2166
  var M = v || "YYYY-MM-DDTHH:mm:ss", A = { Y: this.$d.years, YY: i.s(this.$d.years, 2, "0"), YYYY: i.s(this.$d.years, 4, "0"), M: this.$d.months, MM: i.s(this.$d.months, 2, "0"), D: this.$d.days, DD: i.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: i.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: i.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: i.s(this.$d.seconds, 2, "0"), SSS: i.s(this.$d.milliseconds, 3, "0") };
2147
2167
  return M.replace(h, function(_, D) {
2148
2168
  return D || String(A[_]);
2149
2169
  });
2150
- }, C.as = function(v) {
2170
+ }, k.as = function(v) {
2151
2171
  return this.$ms / l[u(v)];
2152
- }, C.get = function(v) {
2172
+ }, k.get = function(v) {
2153
2173
  var M = this.$ms, A = u(v);
2154
- return A === "milliseconds" ? M %= 1e3 : M = A === "weeks" ? w(M / l[A]) : this.$d[A], M || 0;
2155
- }, C.add = function(v, M, A) {
2174
+ return A === "milliseconds" ? M %= 1e3 : M = A === "weeks" ? x(M / l[A]) : this.$d[A], M || 0;
2175
+ }, k.add = function(v, M, A) {
2156
2176
  var _;
2157
- return _ = M ? v * l[u(M)] : p(v) ? v.$ms : m(v, this).$ms, m(this.$ms + _ * (A ? -1 : 1), this);
2158
- }, C.subtract = function(v, M) {
2177
+ return _ = M ? v * l[u(M)] : m(v) ? v.$ms : p(v, this).$ms, p(this.$ms + _ * (A ? -1 : 1), this);
2178
+ }, k.subtract = function(v, M) {
2159
2179
  return this.add(v, M, !0);
2160
- }, C.locale = function(v) {
2180
+ }, k.locale = function(v) {
2161
2181
  var M = this.clone();
2162
2182
  return M.$l = v, M;
2163
- }, C.clone = function() {
2164
- return m(this.$ms, this);
2165
- }, C.humanize = function(v) {
2183
+ }, k.clone = function() {
2184
+ return p(this.$ms, this);
2185
+ }, k.humanize = function(v) {
2166
2186
  return e().add(this.$ms, "ms").locale(this.$l).fromNow(!v);
2167
- }, C.valueOf = function() {
2187
+ }, k.valueOf = function() {
2168
2188
  return this.asMilliseconds();
2169
- }, C.milliseconds = function() {
2189
+ }, k.milliseconds = function() {
2170
2190
  return this.get("milliseconds");
2171
- }, C.asMilliseconds = function() {
2191
+ }, k.asMilliseconds = function() {
2172
2192
  return this.as("milliseconds");
2173
- }, C.seconds = function() {
2193
+ }, k.seconds = function() {
2174
2194
  return this.get("seconds");
2175
- }, C.asSeconds = function() {
2195
+ }, k.asSeconds = function() {
2176
2196
  return this.as("seconds");
2177
- }, C.minutes = function() {
2197
+ }, k.minutes = function() {
2178
2198
  return this.get("minutes");
2179
- }, C.asMinutes = function() {
2199
+ }, k.asMinutes = function() {
2180
2200
  return this.as("minutes");
2181
- }, C.hours = function() {
2201
+ }, k.hours = function() {
2182
2202
  return this.get("hours");
2183
- }, C.asHours = function() {
2203
+ }, k.asHours = function() {
2184
2204
  return this.as("hours");
2185
- }, C.days = function() {
2205
+ }, k.days = function() {
2186
2206
  return this.get("days");
2187
- }, C.asDays = function() {
2207
+ }, k.asDays = function() {
2188
2208
  return this.as("days");
2189
- }, C.weeks = function() {
2209
+ }, k.weeks = function() {
2190
2210
  return this.get("weeks");
2191
- }, C.asWeeks = function() {
2211
+ }, k.asWeeks = function() {
2192
2212
  return this.as("weeks");
2193
- }, C.months = function() {
2213
+ }, k.months = function() {
2194
2214
  return this.get("months");
2195
- }, C.asMonths = function() {
2215
+ }, k.asMonths = function() {
2196
2216
  return this.as("months");
2197
- }, C.years = function() {
2217
+ }, k.years = function() {
2198
2218
  return this.get("years");
2199
- }, C.asYears = function() {
2219
+ }, k.asYears = function() {
2200
2220
  return this.as("years");
2201
2221
  }, E;
2202
- }(), k = function(E, C, v) {
2203
- return E.add(C.years() * v, "y").add(C.months() * v, "M").add(C.days() * v, "d").add(C.hours() * v, "h").add(C.minutes() * v, "m").add(C.seconds() * v, "s").add(C.milliseconds() * v, "ms");
2222
+ }(), C = function(E, k, v) {
2223
+ return E.add(k.years() * v, "y").add(k.months() * v, "M").add(k.days() * v, "d").add(k.hours() * v, "h").add(k.minutes() * v, "m").add(k.seconds() * v, "s").add(k.milliseconds() * v, "ms");
2204
2224
  };
2205
- return function(E, C, v) {
2225
+ return function(E, k, v) {
2206
2226
  e = v, i = v().$utils(), v.duration = function(_, D) {
2207
- var H = v.locale();
2208
- return m(_, { $l: H }, D);
2209
- }, v.isDuration = p;
2210
- var M = C.prototype.add, A = C.prototype.subtract;
2211
- C.prototype.add = function(_, D) {
2212
- return p(_) ? k(this, _, 1) : M.bind(this)(_, D);
2213
- }, C.prototype.subtract = function(_, D) {
2214
- return p(_) ? k(this, _, -1) : A.bind(this)(_, D);
2227
+ var I = v.locale();
2228
+ return p(_, { $l: I }, D);
2229
+ }, v.isDuration = m;
2230
+ var M = k.prototype.add, A = k.prototype.subtract;
2231
+ k.prototype.add = function(_, D) {
2232
+ return m(_) ? C(this, _, 1) : M.bind(this)(_, D);
2233
+ }, k.prototype.subtract = function(_, D) {
2234
+ return m(_) ? C(this, _, -1) : A.bind(this)(_, D);
2215
2235
  };
2216
2236
  };
2217
2237
  });
@@ -2269,21 +2289,21 @@ var At = { exports: {} };
2269
2289
  return function(e, i, s) {
2270
2290
  var n = i.prototype, o = function(d) {
2271
2291
  return d && (d.indexOf ? d : d.s);
2272
- }, r = function(d, l, p, m, u) {
2273
- var x = d.name ? d : d.$locale(), w = o(x[l]), T = o(x[p]), b = w || T.map(function(k) {
2274
- return k.slice(0, m);
2292
+ }, r = function(d, l, m, p, u) {
2293
+ var y = d.name ? d : d.$locale(), x = o(y[l]), T = o(y[m]), b = x || T.map(function(C) {
2294
+ return C.slice(0, p);
2275
2295
  });
2276
2296
  if (!u) return b;
2277
- var y = x.weekStart;
2278
- return b.map(function(k, E) {
2279
- return b[(E + (y || 0)) % 7];
2297
+ var w = y.weekStart;
2298
+ return b.map(function(C, E) {
2299
+ return b[(E + (w || 0)) % 7];
2280
2300
  });
2281
2301
  }, h = function() {
2282
2302
  return s.Ls[s.locale()];
2283
2303
  }, c = function(d, l) {
2284
- return d.formats[l] || function(p) {
2285
- return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(m, u, x) {
2286
- return u || x.slice(1);
2304
+ return d.formats[l] || function(m) {
2305
+ return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(p, u, y) {
2306
+ return u || y.slice(1);
2287
2307
  });
2288
2308
  }(d.formats[l.toUpperCase()]);
2289
2309
  }, g = function() {
@@ -2354,8 +2374,8 @@ var Ht = { exports: {} };
2354
2374
  var g = o(this).startOf(i).add(1, i).date(c), d = o(this).endOf(e);
2355
2375
  if (g.isBefore(d)) return 1;
2356
2376
  }
2357
- var l = o(this).startOf(i).date(c).startOf(e).subtract(1, "millisecond"), p = this.diff(l, e, !0);
2358
- return p < 0 ? o(this).startOf("week").week() : Math.ceil(p);
2377
+ var l = o(this).startOf(i).date(c).startOf(e).subtract(1, "millisecond"), m = this.diff(l, e, !0);
2378
+ return m < 0 ? o(this).startOf("week").week() : Math.ceil(m);
2359
2379
  }, r.weeks = function(h) {
2360
2380
  return h === void 0 && (h = null), this.week(h);
2361
2381
  };
@@ -2460,8 +2480,8 @@ var Wt = { exports: {} };
2460
2480
  return o(this).year();
2461
2481
  }, r.isoWeek = function(c) {
2462
2482
  if (!this.$utils().u(c)) return this.add(7 * (c - this.isoWeek()), e);
2463
- var g, d, l, p, m = o(this), u = (g = this.isoWeekYear(), d = this.$u, l = (d ? n.utc : n)().year(g).startOf("year"), p = 4 - l.isoWeekday(), l.isoWeekday() > 4 && (p += 7), l.add(p, e));
2464
- return m.diff(u, "week") + 1;
2483
+ var g, d, l, m, p = o(this), u = (g = this.isoWeekYear(), d = this.$u, l = (d ? n.utc : n)().year(g).startOf("year"), m = 4 - l.isoWeekday(), l.isoWeekday() > 4 && (m += 7), l.add(m, e));
2484
+ return p.diff(u, "week") + 1;
2465
2485
  }, r.isoWeekday = function(c) {
2466
2486
  return this.$utils().u(c) ? this.day() || 7 : this.day(this.day() % 7 ? c : c - 7);
2467
2487
  };
@@ -2482,52 +2502,52 @@ var $t = { exports: {} };
2482
2502
  })(P, function() {
2483
2503
  var e = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, i = {};
2484
2504
  return function(s, n, o) {
2485
- var r, h = function(l, p, m) {
2486
- m === void 0 && (m = {});
2487
- var u = new Date(l), x = function(w, T) {
2505
+ var r, h = function(l, m, p) {
2506
+ p === void 0 && (p = {});
2507
+ var u = new Date(l), y = function(x, T) {
2488
2508
  T === void 0 && (T = {});
2489
- var b = T.timeZoneName || "short", y = w + "|" + b, k = i[y];
2490
- return k || (k = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: w, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: b }), i[y] = k), k;
2491
- }(p, m);
2492
- return x.formatToParts(u);
2493
- }, c = function(l, p) {
2494
- for (var m = h(l, p), u = [], x = 0; x < m.length; x += 1) {
2495
- var w = m[x], T = w.type, b = w.value, y = e[T];
2496
- y >= 0 && (u[y] = parseInt(b, 10));
2509
+ var b = T.timeZoneName || "short", w = x + "|" + b, C = i[w];
2510
+ return C || (C = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: x, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: b }), i[w] = C), C;
2511
+ }(m, p);
2512
+ return y.formatToParts(u);
2513
+ }, c = function(l, m) {
2514
+ for (var p = h(l, m), u = [], y = 0; y < p.length; y += 1) {
2515
+ var x = p[y], T = x.type, b = x.value, w = e[T];
2516
+ w >= 0 && (u[w] = parseInt(b, 10));
2497
2517
  }
2498
- var k = u[3], E = k === 24 ? 0 : k, C = u[0] + "-" + u[1] + "-" + u[2] + " " + E + ":" + u[4] + ":" + u[5] + ":000", v = +l;
2499
- return (o.utc(C).valueOf() - (v -= v % 1e3)) / 6e4;
2518
+ var C = u[3], E = C === 24 ? 0 : C, k = u[0] + "-" + u[1] + "-" + u[2] + " " + E + ":" + u[4] + ":" + u[5] + ":000", v = +l;
2519
+ return (o.utc(k).valueOf() - (v -= v % 1e3)) / 6e4;
2500
2520
  }, g = n.prototype;
2501
- g.tz = function(l, p) {
2521
+ g.tz = function(l, m) {
2502
2522
  l === void 0 && (l = r);
2503
- var m, u = this.utcOffset(), x = this.toDate(), w = x.toLocaleString("en-US", { timeZone: l }), T = Math.round((x - new Date(w)) / 1e3 / 60), b = 15 * -Math.round(x.getTimezoneOffset() / 15) - T;
2504
- if (!Number(b)) m = this.utcOffset(0, p);
2505
- else if (m = o(w, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(b, !0), p) {
2506
- var y = m.utcOffset();
2507
- m = m.add(u - y, "minute");
2523
+ var p, u = this.utcOffset(), y = this.toDate(), x = y.toLocaleString("en-US", { timeZone: l }), T = Math.round((y - new Date(x)) / 1e3 / 60), b = 15 * -Math.round(y.getTimezoneOffset() / 15) - T;
2524
+ if (!Number(b)) p = this.utcOffset(0, m);
2525
+ else if (p = o(x, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(b, !0), m) {
2526
+ var w = p.utcOffset();
2527
+ p = p.add(u - w, "minute");
2508
2528
  }
2509
- return m.$x.$timezone = l, m;
2529
+ return p.$x.$timezone = l, p;
2510
2530
  }, g.offsetName = function(l) {
2511
- var p = this.$x.$timezone || o.tz.guess(), m = h(this.valueOf(), p, { timeZoneName: l }).find(function(u) {
2531
+ var m = this.$x.$timezone || o.tz.guess(), p = h(this.valueOf(), m, { timeZoneName: l }).find(function(u) {
2512
2532
  return u.type.toLowerCase() === "timezonename";
2513
2533
  });
2514
- return m && m.value;
2534
+ return p && p.value;
2515
2535
  };
2516
2536
  var d = g.startOf;
2517
- g.startOf = function(l, p) {
2518
- if (!this.$x || !this.$x.$timezone) return d.call(this, l, p);
2519
- var m = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
2520
- return d.call(m, l, p).tz(this.$x.$timezone, !0);
2521
- }, o.tz = function(l, p, m) {
2522
- var u = m && p, x = m || p || r, w = c(+o(), x);
2523
- if (typeof l != "string") return o(l).tz(x);
2524
- var T = function(E, C, v) {
2525
- var M = E - 60 * C * 1e3, A = c(M, v);
2526
- if (C === A) return [M, C];
2527
- var _ = c(M -= 60 * (A - C) * 1e3, v);
2537
+ g.startOf = function(l, m) {
2538
+ if (!this.$x || !this.$x.$timezone) return d.call(this, l, m);
2539
+ var p = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
2540
+ return d.call(p, l, m).tz(this.$x.$timezone, !0);
2541
+ }, o.tz = function(l, m, p) {
2542
+ var u = p && m, y = p || m || r, x = c(+o(), y);
2543
+ if (typeof l != "string") return o(l).tz(y);
2544
+ var T = function(E, k, v) {
2545
+ var M = E - 60 * k * 1e3, A = c(M, v);
2546
+ if (k === A) return [M, k];
2547
+ var _ = c(M -= 60 * (A - k) * 1e3, v);
2528
2548
  return A === _ ? [M, A] : [E - 60 * Math.min(A, _) * 1e3, Math.max(A, _)];
2529
- }(o.utc(l, u).valueOf(), w, x), b = T[0], y = T[1], k = o(b).utcOffset(y);
2530
- return k.$x.$timezone = x, k;
2549
+ }(o.utc(l, u).valueOf(), x, y), b = T[0], w = T[1], C = o(b).utcOffset(w);
2550
+ return C.$x.$timezone = y, C;
2531
2551
  }, o.tz.guess = function() {
2532
2552
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
2533
2553
  }, o.tz.setDefault = function(l) {
@@ -2547,11 +2567,11 @@ var Ft = { exports: {} };
2547
2567
  return function(n, o, r) {
2548
2568
  var h = o.prototype;
2549
2569
  r.utc = function(u) {
2550
- var x = { date: u, utc: !0, args: arguments };
2551
- return new o(x);
2570
+ var y = { date: u, utc: !0, args: arguments };
2571
+ return new o(y);
2552
2572
  }, h.utc = function(u) {
2553
- var x = r(this.toDate(), { locale: this.$L, utc: !0 });
2554
- return u ? x.add(this.utcOffset(), e) : x;
2573
+ var y = r(this.toDate(), { locale: this.$L, utc: !0 });
2574
+ return u ? y.add(this.utcOffset(), e) : y;
2555
2575
  }, h.local = function() {
2556
2576
  return r(this.toDate(), { locale: this.$L, utc: !1 });
2557
2577
  };
@@ -2567,28 +2587,28 @@ var Ft = { exports: {} };
2567
2587
  } else g.call(this);
2568
2588
  };
2569
2589
  var d = h.utcOffset;
2570
- h.utcOffset = function(u, x) {
2571
- var w = this.$utils().u;
2572
- if (w(u)) return this.$u ? 0 : w(this.$offset) ? d.call(this) : this.$offset;
2573
- if (typeof u == "string" && (u = function(k) {
2574
- k === void 0 && (k = "");
2575
- var E = k.match(i);
2590
+ h.utcOffset = function(u, y) {
2591
+ var x = this.$utils().u;
2592
+ if (x(u)) return this.$u ? 0 : x(this.$offset) ? d.call(this) : this.$offset;
2593
+ if (typeof u == "string" && (u = function(C) {
2594
+ C === void 0 && (C = "");
2595
+ var E = C.match(i);
2576
2596
  if (!E) return null;
2577
- var C = ("" + E[0]).match(s) || ["-", 0, 0], v = C[0], M = 60 * +C[1] + +C[2];
2597
+ var k = ("" + E[0]).match(s) || ["-", 0, 0], v = k[0], M = 60 * +k[1] + +k[2];
2578
2598
  return M === 0 ? 0 : v === "+" ? M : -M;
2579
2599
  }(u), u === null)) return this;
2580
2600
  var T = Math.abs(u) <= 16 ? 60 * u : u, b = this;
2581
- if (x) return b.$offset = T, b.$u = u === 0, b;
2601
+ if (y) return b.$offset = T, b.$u = u === 0, b;
2582
2602
  if (u !== 0) {
2583
- var y = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
2584
- (b = this.local().add(T + y, e)).$offset = T, b.$x.$localOffset = y;
2603
+ var w = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
2604
+ (b = this.local().add(T + w, e)).$offset = T, b.$x.$localOffset = w;
2585
2605
  } else b = this.utc();
2586
2606
  return b;
2587
2607
  };
2588
2608
  var l = h.format;
2589
2609
  h.format = function(u) {
2590
- var x = u || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
2591
- return l.call(this, x);
2610
+ var y = u || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
2611
+ return l.call(this, y);
2592
2612
  }, h.valueOf = function() {
2593
2613
  var u = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
2594
2614
  return this.$d.valueOf() - 6e4 * u;
@@ -2599,15 +2619,15 @@ var Ft = { exports: {} };
2599
2619
  }, h.toString = function() {
2600
2620
  return this.toDate().toUTCString();
2601
2621
  };
2602
- var p = h.toDate;
2622
+ var m = h.toDate;
2603
2623
  h.toDate = function(u) {
2604
- return u === "s" && this.$offset ? r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : p.call(this);
2624
+ return u === "s" && this.$offset ? r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : m.call(this);
2605
2625
  };
2606
- var m = h.diff;
2607
- h.diff = function(u, x, w) {
2608
- if (u && this.$u === u.$u) return m.call(this, u, x, w);
2626
+ var p = h.diff;
2627
+ h.diff = function(u, y, x) {
2628
+ if (u && this.$u === u.$u) return p.call(this, u, y, x);
2609
2629
  var T = this.local(), b = r(u).local();
2610
- return m.call(T, b, x, w);
2630
+ return p.call(T, b, y, x);
2611
2631
  };
2612
2632
  };
2613
2633
  });
@@ -2628,7 +2648,7 @@ var Le = { exports: {} };
2628
2648
  var Ee = { exports: {} };
2629
2649
  (function(f, t) {
2630
2650
  (function(e, i) {
2631
- f.exports = i(I);
2651
+ f.exports = i(G);
2632
2652
  })(P, function(e) {
2633
2653
  function i(o) {
2634
2654
  return o && typeof o == "object" && "default" in o ? o : { default: o };
@@ -2645,33 +2665,33 @@ var Ee = { exports: {} };
2645
2665
  const Me = (f, t) => {
2646
2666
  const e = t.prototype;
2647
2667
  e.setLocale = function(s) {
2648
- return this.$locale = s || I().locale(), this.$L = this.$locale, this;
2668
+ return this.$locale = s || G().locale(), this.$L = this.$locale, this;
2649
2669
  };
2650
2670
  const i = e.format;
2651
2671
  e.format = function(s) {
2652
- return this.$L = I().locale(), i.bind(this)(s);
2672
+ return this.$L = G().locale(), i.bind(this)(s);
2653
2673
  };
2654
2674
  };
2655
- I.extend(se);
2656
- I.extend(oe);
2657
- I.extend(ae);
2658
- I.extend(le);
2659
- I.extend(ge);
2660
- I.extend(de);
2661
- I.extend(pe);
2662
- I.extend(xe);
2663
- I.extend(we);
2664
- I.extend(Te);
2665
- I.extend(Se);
2666
- I.extend(Ce);
2667
- I.extend(Me);
2675
+ G.extend(se);
2676
+ G.extend(oe);
2677
+ G.extend(ae);
2678
+ G.extend(le);
2679
+ G.extend(ge);
2680
+ G.extend(de);
2681
+ G.extend(pe);
2682
+ G.extend(xe);
2683
+ G.extend(we);
2684
+ G.extend(Te);
2685
+ G.extend(Se);
2686
+ G.extend(Ce);
2687
+ G.extend(Me);
2668
2688
  function vt(f) {
2669
2689
  try {
2670
- if (I.locale() === f) return;
2671
- if (I.locale(f) !== f) throw Error();
2690
+ if (G.locale() === f) return;
2691
+ if (G.locale(f) !== f) throw Error();
2672
2692
  O.info(`Locale set to ${f}`);
2673
2693
  } catch {
2674
- O.warn(`Failed to set locale ${f}, fallback to en`), I.locale("en");
2694
+ O.warn(`Failed to set locale ${f}, fallback to en`), G.locale("en");
2675
2695
  }
2676
2696
  }
2677
2697
  const ut = () => ({
@@ -2699,10 +2719,10 @@ const ut = () => ({
2699
2719
  });
2700
2720
  class Oe {
2701
2721
  constructor() {
2702
- a(this, "startTime", I().startOf("day"));
2703
- a(this, "endTime", I().endOf("day"));
2722
+ a(this, "startTime", G().startOf("day"));
2723
+ a(this, "endTime", G().endOf("day"));
2704
2724
  /** 结束的标准时间。切换单位会影响结尾的扩展,需要单独记录一个标准时间 */
2705
- a(this, "targetEnd", I().endOf("day"));
2725
+ a(this, "targetEnd", G().endOf("day"));
2706
2726
  /** 固定起始日期 */
2707
2727
  a(this, "strictStart", !1);
2708
2728
  /** 固定截止日期 */
@@ -2781,7 +2801,7 @@ class Oe {
2781
2801
  month: "month",
2782
2802
  quarter: "quarter"
2783
2803
  }[i];
2784
- n || O.warn(`Unknown unit: [${i}]. Falling back to "day".`), this.unit = n || "day", s.startTime && (this.startTime = I(s.startTime).startOf(this.getFinelyUnit()), this.strictStart = !0), s.endTime && (this.endTime = I(s.endTime).endOf(this.getFinelyUnit()), this.strictEnd = !0), s.cellWidth && (Ut(s.cellWidth) ? this.cellWidth = {
2804
+ n || O.warn(`Unknown unit: [${i}]. Falling back to "day".`), this.unit = n || "day", s.startTime && (this.startTime = G(s.startTime).startOf(this.getFinelyUnit()), this.strictStart = !0), s.endTime && (this.endTime = G(s.endTime).endOf(this.getFinelyUnit()), this.strictEnd = !0), s.cellWidth && (Ut(s.cellWidth) ? this.cellWidth = {
2785
2805
  hour: s.cellWidth,
2786
2806
  day: s.cellWidth,
2787
2807
  week: s.cellWidth,
@@ -3225,8 +3245,8 @@ class _e {
3225
3245
  this.isAnimating = !0, this.animationStartTime = performance.now(), this.animationStartScrollLeft = this.scrollLeft, this.animationStartScrollTop = this.scrollTop, this.animationTargetScrollLeft = i.x, this.animationTargetScrollTop = i.y, this.animationSource = "wheel";
3226
3246
  const s = 150, n = (o) => {
3227
3247
  if (!this.isAnimating) return;
3228
- const r = o - this.animationStartTime, h = Math.min(1, r / s), c = h * (2 - h), g = this.animationStartScrollLeft + (this.animationTargetScrollLeft - this.animationStartScrollLeft) * c, d = this.animationStartScrollTop + (this.animationTargetScrollTop - this.animationStartScrollTop) * c, l = this.scrollLeft !== g, p = this.scrollTop !== d;
3229
- (l || p) && this.emit("wheel", g, d), h < 1 ? this.animationFrameId = requestAnimationFrame(n) : (this.isAnimating = !1, this.animationFrameId = null, (this.scrollLeft !== this.animationTargetScrollLeft || this.scrollTop !== this.animationTargetScrollTop) && this.emit("wheel", this.animationTargetScrollLeft, this.animationTargetScrollTop), this.scheduleHide());
3248
+ const r = o - this.animationStartTime, h = Math.min(1, r / s), c = h * (2 - h), g = this.animationStartScrollLeft + (this.animationTargetScrollLeft - this.animationStartScrollLeft) * c, d = this.animationStartScrollTop + (this.animationTargetScrollTop - this.animationStartScrollTop) * c, l = this.scrollLeft !== g, m = this.scrollTop !== d;
3249
+ (l || m) && this.emit("wheel", g, d), h < 1 ? this.animationFrameId = requestAnimationFrame(n) : (this.isAnimating = !1, this.animationFrameId = null, (this.scrollLeft !== this.animationTargetScrollLeft || this.scrollTop !== this.animationTargetScrollTop) && this.emit("wheel", this.animationTargetScrollLeft, this.animationTargetScrollTop), this.scheduleHide());
3230
3250
  };
3231
3251
  this.animationFrameId = requestAnimationFrame(n);
3232
3252
  }
@@ -3509,7 +3529,7 @@ class St {
3509
3529
  }), this.element.addEventListener("dblclick", (t) => {
3510
3530
  this.context.event.emit(L.ROW_DBL_CLICK, t, this.task);
3511
3531
  }), this.element.addEventListener("contextmenu", (t) => {
3512
- t.preventDefault(), this.context.store.getDataManager().selectTask(this.task.id), this.context.event.emit(L.ROW_CONTEXTMENU, t, this.task.id);
3532
+ t.preventDefault(), this.context.store.getDataManager().selectTask(this.task.id), this.context.event.emit(L.ROW_CONTEXTMENU, t, this.task);
3513
3533
  });
3514
3534
  }
3515
3535
  /**
@@ -3608,10 +3628,10 @@ class St {
3608
3628
  );
3609
3629
  if (g && (typeof g.col != "number" ? O.error("colspan function must returned a number") : h = g.col, typeof g.row != "number" ? O.error("rowspan function must returned a number") : c = g.row), h > 1 || c > 1) {
3610
3630
  if (c > 1)
3611
- for (let m = 1; m < c; m++) {
3612
- const u = this.context.store.getDataManager().getVisibleTasks()[this.task.flatIndex + m];
3631
+ for (let p = 1; p < c; p++) {
3632
+ const u = this.context.store.getDataManager().getVisibleTasks()[this.task.flatIndex + p];
3613
3633
  if (u && this.task.level !== u.level) {
3614
- c = m;
3634
+ c = p;
3615
3635
  break;
3616
3636
  }
3617
3637
  }
@@ -3621,15 +3641,15 @@ class St {
3621
3641
  colspan: h,
3622
3642
  rowspan: c
3623
3643
  };
3624
- let p = this.task;
3625
- for (let m = c; m > 0; m--)
3626
- if (p) {
3644
+ let m = this.task;
3645
+ for (let p = c; p > 0; p--)
3646
+ if (m) {
3627
3647
  for (let u = 0; u < h; u++)
3628
- this.context.store.getColumnManager().addMergeInfo(p.id, u + n, l);
3629
- p = this.context.store.getDataManager().getVisibleTasks().at(p.flatIndex + 1);
3648
+ this.context.store.getColumnManager().addMergeInfo(m.id, u + n, l);
3649
+ m = this.context.store.getDataManager().getVisibleTasks().at(m.flatIndex + 1);
3630
3650
  }
3631
- for (let m = 0; m < h; m++)
3632
- this.context.store.getColumnManager().addMergeInfo(this.task.id, m + n, l);
3651
+ for (let p = 0; p < h; p++)
3652
+ this.context.store.getColumnManager().addMergeInfo(this.task.id, p + n, l);
3633
3653
  }
3634
3654
  const d = new st(
3635
3655
  this.context,
@@ -3796,13 +3816,13 @@ class pt {
3796
3816
  document.addEventListener("mousemove", g), document.addEventListener("mouseup", d), n = e - s.left, this.context.event.emit(L.SHOW_GUIDELINE, n);
3797
3817
  }, r = (c) => {
3798
3818
  if (c.preventDefault(), !s) return;
3799
- const g = c.clientX - e, d = i + g, l = Math.max(50, d), p = e - s.left - i, u = this.root.clientWidth - 20;
3800
- let x = p + l;
3801
- x = Math.min(u, x), this.context.event.emit(L.MOVE_GUIDELINE, x);
3819
+ const g = c.clientX - e, d = i + g, l = Math.max(50, d), m = e - s.left - i, u = this.root.clientWidth - 20;
3820
+ let y = m + l;
3821
+ y = Math.min(u, y), this.context.event.emit(L.MOVE_GUIDELINE, y);
3802
3822
  }, h = (c, g, d) => {
3803
3823
  document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", d), this.context.event.emit(L.HIDE_GUIDELINE);
3804
- const l = c.clientX - e, p = Math.max(50, i + l);
3805
- this.setWidth(p);
3824
+ const l = c.clientX - e, m = Math.max(50, i + l);
3825
+ this.setWidth(m);
3806
3826
  };
3807
3827
  t.addEventListener("mousedown", o);
3808
3828
  }
@@ -4017,7 +4037,7 @@ class Ge {
4017
4037
  }
4018
4038
  if (h > s)
4019
4039
  break;
4020
- const m = this.createCell(
4040
+ const p = this.createCell(
4021
4041
  `group-${d.date.format("YYYY-MM-DD")}`,
4022
4042
  h,
4023
4043
  0,
@@ -4026,16 +4046,16 @@ class Ge {
4026
4046
  o,
4027
4047
  d.label
4028
4048
  );
4029
- if (this.groupHeader.add(m), X(d.children) && d.children.length > 0) {
4049
+ if (this.groupHeader.add(p), X(d.children) && d.children.length > 0) {
4030
4050
  let u = h;
4031
- for (let x = 0; x < d.children.length; ) {
4032
- const w = d.children[x];
4051
+ for (let y = 0; y < d.children.length; ) {
4052
+ const x = d.children[y];
4033
4053
  let T = 1;
4034
- for (; d.children[x + T] && w.label === d.children[x + T].label; )
4054
+ for (; d.children[y + T] && x.label === d.children[y + T].label; )
4035
4055
  T++;
4036
- if (x += T, x >= d.children.length && r[g + 1] && r[g + 1].children) {
4056
+ if (y += T, y >= d.children.length && r[g + 1] && r[g + 1].children) {
4037
4057
  let E = 0;
4038
- for (; r[g + 1].children[E] && w.label === r[g + 1].children[E].label; )
4058
+ for (; r[g + 1].children[E] && x.label === r[g + 1].children[E].label; )
4039
4059
  r[g + 1].children[E].hide = !0, E++;
4040
4060
  E > 0 && (T += E);
4041
4061
  }
@@ -4046,16 +4066,16 @@ class Ge {
4046
4066
  }
4047
4067
  if (u > s)
4048
4068
  break;
4049
- const k = this.createCell(
4050
- `cell-${w.date.format("YYYY-MM-DD")}`,
4069
+ const C = this.createCell(
4070
+ `cell-${x.date.format("YYYY-MM-DD")}`,
4051
4071
  u,
4052
4072
  n,
4053
4073
  b,
4054
4074
  n,
4055
- w.hide ? "transparent" : o,
4056
- w.hide ? "" : w.label
4075
+ x.hide ? "transparent" : o,
4076
+ x.hide ? "" : x.label
4057
4077
  );
4058
- this.cellHeader.add(k), w.hide && k.visible(!1), u += b;
4078
+ this.cellHeader.add(C), x.hide && C.visible(!1), u += b;
4059
4079
  }
4060
4080
  }
4061
4081
  h += l;
@@ -4210,22 +4230,22 @@ class Re {
4210
4230
  );
4211
4231
  if (this.context.getOptions().border.show && ["day", "hour"].includes(this.context.getOptions().unit))
4212
4232
  for (let d = r; d <= h; d++) {
4213
- const l = d * i, p = new S.Line({
4233
+ const l = d * i, m = new S.Line({
4214
4234
  points: [l, t, l, o + t],
4215
4235
  stroke: this.context.getOptions().border.color,
4216
4236
  strokeWidth: 0.5,
4217
4237
  name: "vertical-grid-line"
4218
4238
  });
4219
- this.verticalLines.add(p);
4239
+ this.verticalLines.add(m);
4220
4240
  }
4221
4241
  for (let d = c; d <= g; d++) {
4222
- const l = d * s + t, p = new S.Line({
4242
+ const l = d * s + t, m = new S.Line({
4223
4243
  points: [0, l, Math.max(this.width, e), l],
4224
4244
  stroke: this.context.getOptions().border.color,
4225
4245
  strokeWidth: 0.5,
4226
4246
  name: "horizontal-grid-line"
4227
4247
  });
4228
- this.horizontalLines.add(p);
4248
+ this.horizontalLines.add(m);
4229
4249
  }
4230
4250
  }
4231
4251
  /**
@@ -4288,7 +4308,7 @@ class We {
4288
4308
  });
4289
4309
  }
4290
4310
  render() {
4291
- var m, u, x, w, T, b, y, k, E, C, v, M, A;
4311
+ var p, u, y, x, T, b, w, C, E, k, v, M, A;
4292
4312
  if (!this.task.startTime || !this.task.endTime) return;
4293
4313
  if (this.task.endTime.isBefore(this.task.startTime)) {
4294
4314
  O.error("The endTime of the current task is earlier than the startTime.", this.task);
@@ -4303,8 +4323,8 @@ class We {
4303
4323
  this.slider || (this.slider = new S.Group({
4304
4324
  dragBoundFunc: (_) => {
4305
4325
  let D = Math.min(0, -(-this.offsetX - this.slider.x()));
4306
- const H = this.context.store.getTimeAxis().getTimeLeft(this.task.endTime);
4307
- let W = this.rowWidth - this.slider.width() + Math.abs(H - (-this.offsetX + this.rowWidth));
4326
+ const I = this.context.store.getTimeAxis().getTimeLeft(this.task.endTime);
4327
+ let W = this.sliderGroup.getStage().width() - this.slider.width() + Math.abs(I - (-this.offsetX + this.sliderGroup.getStage().width()));
4308
4328
  if (this.context.getOptions().bar.move.link.parent === "strict" && this.task.parent) {
4309
4329
  if (this.task.parent.startTime) {
4310
4330
  const R = this.task.parent.startTime;
@@ -4321,16 +4341,16 @@ class We {
4321
4341
  };
4322
4342
  }
4323
4343
  })), this.slider.position({ x: s, y: i }), this.slider.size({ width: o, height: e });
4324
- const p = !!this.unpackFunc(this.context.getOptions().bar.move.enabled) && (this.task.isSummary() ? this.context.getOptions().summary.move.enabled : !0);
4325
- if (this.slider.draggable(p), this.slider.on("mouseover", (_) => {
4326
- p && !this.isDragging && (_.target.getStage().container().style.cursor = "grab"), this.handleBarHighlight({
4344
+ const m = !!this.unpackFunc(this.context.getOptions().bar.move.enabled) && (this.task.isSummary() ? this.context.getOptions().summary.move.enabled : !0);
4345
+ if (this.slider.draggable(m), this.slider.on("mouseover", (_) => {
4346
+ m && !this.isDragging && (_.target.getStage().container().style.cursor = "grab"), this.handleBarHighlight({
4327
4347
  shadowColor: B(c).alpha(B(c).alpha() + 0.1).toHex(),
4328
4348
  shadowBlur: Math.max((g || 1) * 2, 4),
4329
4349
  shadowOffsetX: Math.max(d || 1, 2),
4330
4350
  shadowOffsetY: Math.max((l || 1) * 1.5, 4)
4331
4351
  }), this.context.event.emit(L.SLIDER_HOVER, _.evt, this.task);
4332
4352
  }), this.slider.on("mouseout", (_) => {
4333
- p && !this.isDragging && (_.target.getStage().container().style.cursor = "default"), this.isDragging || this.handleBarHighlight({
4353
+ m && !this.isDragging && (_.target.getStage().container().style.cursor = "default"), this.isDragging || this.handleBarHighlight({
4334
4354
  shadowColor: c,
4335
4355
  shadowBlur: g,
4336
4356
  shadowOffsetX: d,
@@ -4338,7 +4358,7 @@ class We {
4338
4358
  }), this.context.event.emit(L.SLIDER_LEAVE, _.evt, this.task);
4339
4359
  }), this.task.isMilestone()) {
4340
4360
  this.sliderBar && !this.sliderType.startsWith("milestone") && (this.slider.destroyChildren(), this.sliderBar = null, this.progressGroup = null, this.leftHandleGroup = null, this.rightHandleGroup = null);
4341
- const _ = this.unpackFunc(this.context.getOptions().milestone.size), D = Math.min(_ || e, t / 2), H = this.unpackFunc(this.context.getOptions().milestone.color) || r, W = this.unpackFunc(this.context.getOptions().milestone.border.color), G = this.unpackFunc(this.context.getOptions().milestone.border.width), R = this.unpackFunc(this.context.getOptions().milestone.shape);
4361
+ const _ = this.unpackFunc(this.context.getOptions().milestone.size), D = Math.min(_ || e, t / 2), I = this.unpackFunc(this.context.getOptions().milestone.color) || r, W = this.unpackFunc(this.context.getOptions().milestone.border.color), H = this.unpackFunc(this.context.getOptions().milestone.border.width), R = this.unpackFunc(this.context.getOptions().milestone.shape);
4342
4362
  if (!this.sliderBar) {
4343
4363
  switch (R) {
4344
4364
  case "triangle":
@@ -4346,9 +4366,9 @@ class We {
4346
4366
  sides: 3,
4347
4367
  radius: D,
4348
4368
  rotation: 0,
4349
- fill: H,
4369
+ fill: I,
4350
4370
  stroke: W,
4351
- strokeWidth: G,
4371
+ strokeWidth: H,
4352
4372
  y: D / 3 * 2
4353
4373
  // 居中
4354
4374
  });
@@ -4356,9 +4376,9 @@ class We {
4356
4376
  case "circle":
4357
4377
  this.sliderBar = new S.Circle({
4358
4378
  radius: D,
4359
- fill: H,
4379
+ fill: I,
4360
4380
  stroke: W,
4361
- strokeWidth: G,
4381
+ strokeWidth: H,
4362
4382
  y: D / 2
4363
4383
  // 居中
4364
4384
  });
@@ -4368,9 +4388,9 @@ class We {
4368
4388
  numPoints: 5,
4369
4389
  innerRadius: D / 2,
4370
4390
  outerRadius: D,
4371
- fill: H,
4391
+ fill: I,
4372
4392
  stroke: W,
4373
- strokeWidth: G,
4393
+ strokeWidth: H,
4374
4394
  y: D / 2
4375
4395
  // 居中
4376
4396
  });
@@ -4381,9 +4401,9 @@ class We {
4381
4401
  sides: 4,
4382
4402
  radius: D,
4383
4403
  rotation: 0,
4384
- fill: H,
4404
+ fill: I,
4385
4405
  stroke: W,
4386
- strokeWidth: G,
4406
+ strokeWidth: H,
4387
4407
  y: D / 2
4388
4408
  // 居中
4389
4409
  });
@@ -4392,7 +4412,7 @@ class We {
4392
4412
  const F = this.unpackFunc(this.context.getOptions().milestone.label.text), z = this.unpackFunc(this.context.getOptions().milestone.label.position), q = this.unpackFunc(this.context.getOptions().milestone.label.fontSize), zt = this.unpackFunc(this.context.getOptions().milestone.label.fontFamily), Nt = this.unpackFunc(this.context.getOptions().milestone.label.color), it = new S.Text({
4393
4413
  height: e,
4394
4414
  text: F,
4395
- fill: Nt || H,
4415
+ fill: Nt || I,
4396
4416
  fontSize: q,
4397
4417
  fontFamily: zt
4398
4418
  }), at = it.measureSize(F);
@@ -4419,18 +4439,18 @@ class We {
4419
4439
  this.sliderType = "milestone";
4420
4440
  } else if (this.task.isSummary() && (this.context.getOptions().summary.mode === "always" || this.task.expanded)) {
4421
4441
  this.sliderBar && this.sliderType !== "summary" && (this.slider.destroyChildren(), this.sliderBar = null, this.progressGroup = null, this.leftHandleGroup = null, this.rightHandleGroup = null);
4422
- const _ = this.unpackFunc(this.context.getOptions().summary.color) || r, D = t * 0.2, H = t * 0.3, W = (G) => new S.Shape({
4442
+ const _ = this.unpackFunc(this.context.getOptions().summary.color) || r, D = t * 0.2, I = t * 0.3, W = (H) => new S.Shape({
4423
4443
  sceneFunc: (R, F) => {
4424
- const z = H * 0.5;
4425
- R.beginPath(), R.moveTo(0, (t - D) / 2), R.lineTo(z, (t - D) / 2), R.lineTo(z, (t - D) / 2 + D), R.lineTo(0, (t - D) / 2 + D + H), R.lineTo(0, (t - D) / 2), R.rect(z, (t - D) / 2, G - 2 * z, D), R.moveTo(G - z, (t - D) / 2), R.lineTo(G, (t - D) / 2), R.lineTo(G, (t - D) / 2 + D + H), R.lineTo(G - z, (t - D) / 2 + D), R.lineTo(G - z, (t - D) / 2), R.fillStrokeShape(F);
4444
+ const z = I * 0.5;
4445
+ R.beginPath(), R.moveTo(0, (t - D) / 2), R.lineTo(z, (t - D) / 2), R.lineTo(z, (t - D) / 2 + D), R.lineTo(0, (t - D) / 2 + D + I), R.lineTo(0, (t - D) / 2), R.rect(z, (t - D) / 2, H - 2 * z, D), R.moveTo(H - z, (t - D) / 2), R.lineTo(H, (t - D) / 2), R.lineTo(H, (t - D) / 2 + D + I), R.lineTo(H - z, (t - D) / 2 + D), R.lineTo(H - z, (t - D) / 2), R.fillStrokeShape(F);
4426
4446
  },
4427
- width: G,
4447
+ width: H,
4428
4448
  fill: _,
4429
4449
  shadowColor: c,
4430
4450
  shadowBlur: g,
4431
4451
  shadowOffsetX: d,
4432
4452
  shadowOffsetY: l,
4433
- y: -(H + D) / 2 - i / 2
4453
+ y: -(I + D) / 2 - i / 2
4434
4454
  });
4435
4455
  !this.sliderBar || this.sliderBar.width() !== o ? (this.sliderBar && this.sliderBar.destroy(), this.sliderBar = W(o), this.slider.add(this.sliderBar)) : this.sliderBar.setAttrs({
4436
4456
  fill: _,
@@ -4449,7 +4469,7 @@ class We {
4449
4469
  fill: r,
4450
4470
  cornerRadius: h
4451
4471
  }), this.renderProgress(o, e);
4452
- const _ = (m = this.context.getOptions().bar.move.single) == null ? void 0 : m.icon, D = (u = this.context.getOptions().bar.move.single) == null ? void 0 : u.backgroundColor, H = D ? B(D).alpha(((x = this.context.getOptions().bar.move.single) == null ? void 0 : x.opacity) ?? 1).toHex() : B(r).brighten(30 * (this.unpackFunc((w = this.context.getOptions().bar.progress) == null ? void 0 : w.show) ? -1 : 1)).alpha(((T = this.context.getOptions().bar.move.single) == null ? void 0 : T.opacity) ?? 1).toHex();
4472
+ const _ = (p = this.context.getOptions().bar.move.single) == null ? void 0 : p.icon, D = (u = this.context.getOptions().bar.move.single) == null ? void 0 : u.backgroundColor, I = D ? B(D).alpha(((y = this.context.getOptions().bar.move.single) == null ? void 0 : y.opacity) ?? 1).toHex() : B(r).brighten(30 * (this.unpackFunc((x = this.context.getOptions().bar.progress) == null ? void 0 : x.show) ? -1 : 1)).alpha(((T = this.context.getOptions().bar.move.single) == null ? void 0 : T.opacity) ?? 1).toHex();
4453
4473
  if (!!this.unpackFunc((b = this.context.getOptions().bar.move.single) == null ? void 0 : b.left)) {
4454
4474
  if (!this.leftHandleGroup) {
4455
4475
  this.leftHandleGroup = new S.Group({
@@ -4481,12 +4501,12 @@ class We {
4481
4501
  (q = this.leftHandleGroup) == null || q.add(z);
4482
4502
  });
4483
4503
  }
4484
- (y = this.leftHandleGroup.findOne("Rect")) == null || y.setAttrs({
4504
+ (w = this.leftHandleGroup.findOne("Rect")) == null || w.setAttrs({
4485
4505
  width: this.handlerWidth,
4486
4506
  height: e,
4487
- fill: H,
4507
+ fill: I,
4488
4508
  cornerRadius: [h[0], 0, 0, h[3]]
4489
- }), (k = this.leftHandleGroup.findOne("Image")) == null || k.setAttrs({
4509
+ }), (C = this.leftHandleGroup.findOne("Image")) == null || C.setAttrs({
4490
4510
  x: 0,
4491
4511
  y: (e - this.handlerWidth) / 2,
4492
4512
  width: this.handlerWidth,
@@ -4524,11 +4544,11 @@ class We {
4524
4544
  (q = this.rightHandleGroup) == null || q.add(z);
4525
4545
  });
4526
4546
  }
4527
- (C = this.rightHandleGroup.findOne("Rect")) == null || C.setAttrs({
4547
+ (k = this.rightHandleGroup.findOne("Rect")) == null || k.setAttrs({
4528
4548
  x: o - this.handlerWidth,
4529
4549
  width: this.handlerWidth,
4530
4550
  height: e,
4531
- fill: H,
4551
+ fill: I,
4532
4552
  cornerRadius: [0, h[1], h[2], 0]
4533
4553
  }), (v = this.rightHandleGroup.findOne("Image")) == null || v.setAttrs({
4534
4554
  x: o - this.handlerWidth,
@@ -4578,7 +4598,7 @@ class We {
4578
4598
  }
4579
4599
  }
4580
4600
  renderProgress(t, e) {
4581
- var i, s, n, o, r, h, c, g, d, l, p, m;
4601
+ var i, s, n, o, r, h, c, g, d, l, m, p;
4582
4602
  if (!this.unpackFunc((i = this.context.getOptions().bar.progress) == null ? void 0 : i.show)) {
4583
4603
  this.progressGroup && (this.progressGroup.destroy(), this.progressGroup = null);
4584
4604
  return;
@@ -4589,9 +4609,9 @@ class We {
4589
4609
  ((s = this.context.getOptions().bar.progress) == null ? void 0 : s.targetVal) ?? 100
4590
4610
  );
4591
4611
  if (u === 0) return;
4592
- const x = this.unpackFunc(
4612
+ const y = this.unpackFunc(
4593
4613
  this.context.getOptions().bar.backgroundColor
4594
- ) || this.context.getOptions().primaryColor, w = this.unpackFunc((n = this.context.getOptions().bar.progress) == null ? void 0 : n.backgroundColor) || B(x).brighten(((o = this.context.getOptions().bar.progress) == null ? void 0 : o.amount) || 30).toHex(), T = ot(
4614
+ ) || this.context.getOptions().primaryColor, x = this.unpackFunc((n = this.context.getOptions().bar.progress) == null ? void 0 : n.backgroundColor) || B(y).brighten(((o = this.context.getOptions().bar.progress) == null ? void 0 : o.amount) || 30).toHex(), T = ot(
4595
4615
  this.unpackFunc(this.context.getOptions().bar.radius)
4596
4616
  ), b = ot(
4597
4617
  this.unpackFunc((r = this.context.getOptions().bar.progress) == null ? void 0 : r.radius),
@@ -4599,41 +4619,41 @@ class We {
4599
4619
  // 默认 2
4600
4620
  );
4601
4621
  b[0] = T[0], b[3] = T[3], u === 1 && (b[1] = T[1], b[2] = T[2]);
4602
- const y = t * u;
4603
- this.progressGroup ? (this.progressGroup.width(y), this.progressGroup.destroyChildren()) : (this.progressGroup = new S.Group({
4622
+ const w = t * u;
4623
+ this.progressGroup ? (this.progressGroup.width(w), this.progressGroup.destroyChildren()) : (this.progressGroup = new S.Group({
4604
4624
  x: 0,
4605
4625
  y: 0,
4606
- width: y,
4626
+ width: w,
4607
4627
  height: e,
4608
4628
  listening: !1
4609
4629
  }), this.slider.add(this.progressGroup));
4610
- const k = new S.Rect({
4630
+ const C = new S.Rect({
4611
4631
  x: 0,
4612
4632
  y: 0,
4613
- width: y,
4633
+ width: w,
4614
4634
  height: e,
4615
- fill: w,
4635
+ fill: x,
4616
4636
  cornerRadius: b,
4617
4637
  opacity: this.unpackFunc((h = this.context.getOptions().bar.progress) == null ? void 0 : h.opacity)
4618
4638
  });
4619
- this.progressGroup.add(k);
4639
+ this.progressGroup.add(C);
4620
4640
  const E = `${gt(
4621
4641
  u * 100,
4622
4642
  (c = this.context.getOptions().bar.progress) == null ? void 0 : c.decimal
4623
- )}%`, C = new S.Text().measureSize(E).width, v = this.unpackFunc((g = this.context.getOptions().bar.progress) == null ? void 0 : g.textAlign), M = new S.Text({
4643
+ )}%`, k = new S.Text().measureSize(E).width, v = this.unpackFunc((g = this.context.getOptions().bar.progress) == null ? void 0 : g.textAlign), M = new S.Text({
4624
4644
  x: 0,
4625
4645
  y: v === "top" ? -e : 0,
4626
- width: v === "right" ? y + C : Math.max(y, C),
4646
+ width: v === "right" ? w + k : Math.max(w, k),
4627
4647
  height: e,
4628
- fill: this.unpackFunc((d = this.context.getOptions().bar.progress) == null ? void 0 : d.color) || B("#000000").mix(w, 50).alpha(0.7).toHex(),
4648
+ fill: this.unpackFunc((d = this.context.getOptions().bar.progress) == null ? void 0 : d.color) || B("#000000").mix(x, 50).alpha(0.7).toHex(),
4629
4649
  text: E,
4630
4650
  fontSize: this.unpackFunc((l = this.context.getOptions().bar.progress) == null ? void 0 : l.fontSize) || 10,
4631
- fontStyle: this.unpackFunc((p = this.context.getOptions().bar.progress) == null ? void 0 : p.fontStyle) || "italic",
4651
+ fontStyle: this.unpackFunc((m = this.context.getOptions().bar.progress) == null ? void 0 : m.fontStyle) || "italic",
4632
4652
  fontFamily: "Arial",
4633
4653
  verticalAlign: v === "top" ? "bottom" : "middle",
4634
4654
  align: "right"
4635
4655
  });
4636
- (m = this.progressGroup) == null || m.add(M);
4656
+ (p = this.progressGroup) == null || p.add(M);
4637
4657
  }
4638
4658
  }
4639
4659
  // 绑定事件,包括拖拽和边缘检测
@@ -4702,29 +4722,29 @@ class We {
4702
4722
  handleMove(t, e) {
4703
4723
  const i = e.width(), s = !!this.context.getOptions().bar.move.lock, n = !!this.context.getOptions().bar.move.byUnit, o = this.context.store.getTimeAxis().getCellWidth(), r = t.target.width(), h = t.target.x(), c = h + r, g = Math.max(0, -this.offsetX - h), d = Math.max(0, c - (-this.offsetX + i));
4704
4724
  this.autoMoveTimer = window.setInterval(() => {
4705
- const l = t.target.width(), p = t.target.x(), m = p + l, u = -this.offsetX, x = u + i, w = this.context.store.getTimeAxis().getTotalWidth(), T = p <= u + this.EDGE_THRESHOLD, b = m >= x - this.EDGE_THRESHOLD;
4725
+ const l = t.target.width(), m = t.target.x(), p = m + l, u = -this.offsetX, y = u + i, x = this.context.store.getTimeAxis().getTotalWidth(), T = m <= u + this.EDGE_THRESHOLD, b = p >= y - this.EDGE_THRESHOLD;
4706
4726
  if (T)
4707
4727
  if (u <= 0)
4708
4728
  this.draggingDirection === "left" && t.target.x(-g), this.stopAutoScroll(), s || (this.draggingDirection === "left" ? this.startAutoExpand("left", -g) : this.stopAutoExpand());
4709
4729
  else if (this.draggingDirection === "left") {
4710
- const y = n ? -o : -this.SCROLL_STEP;
4730
+ const w = n ? -o : -this.SCROLL_STEP;
4711
4731
  this.startAutoScroll(
4712
- y,
4732
+ w,
4713
4733
  n,
4714
4734
  () => {
4715
- t.target.x(t.target.x() + y);
4735
+ t.target.x(t.target.x() + w);
4716
4736
  },
4717
4737
  () => t.target.x(t.target.x() - g)
4718
4738
  );
4719
4739
  } else
4720
4740
  this.stopAutoScroll();
4721
4741
  else if (b)
4722
- if (x >= w)
4723
- this.draggingDirection === "right" && t.target.x(w - l + d), this.stopAutoScroll(), s || (this.draggingDirection === "right" ? this.startAutoExpand("right", 0, d) : this.stopAutoExpand());
4742
+ if (y >= x)
4743
+ this.draggingDirection === "right" && t.target.x(x - l + d), this.stopAutoScroll(), s || (this.draggingDirection === "right" ? this.startAutoExpand("right", 0, d) : this.stopAutoExpand());
4724
4744
  else if (this.draggingDirection === "right") {
4725
- const y = n ? o : this.SCROLL_STEP;
4726
- this.startAutoScroll(y, n, () => {
4727
- t.target.x(t.target.x() + y);
4745
+ const w = n ? o : this.SCROLL_STEP;
4746
+ this.startAutoScroll(w, n, () => {
4747
+ t.target.x(t.target.x() + w);
4728
4748
  });
4729
4749
  } else
4730
4750
  this.stopAutoScroll();
@@ -4735,18 +4755,18 @@ class We {
4735
4755
  }
4736
4756
  // 左右操作拖拽
4737
4757
  resizeMove(t, e) {
4738
- var x;
4758
+ var y;
4739
4759
  t.cancelBubble = !0;
4740
4760
  const i = t.target.getStage();
4741
4761
  if (!i) return;
4742
4762
  this.isDragging = !0, this.context.event.emit(L.SLIDER_MOVING, !0);
4743
- let s = ((x = i.getPointerPosition()) == null ? void 0 : x.x) || 0;
4763
+ let s = ((y = i.getPointerPosition()) == null ? void 0 : y.x) || 0;
4744
4764
  const n = !!this.context.getOptions().bar.move.byUnit, o = this.context.store.getTimeAxis().getCellWidth(), r = !!this.context.getOptions().bar.move.lock, h = i.width();
4745
4765
  let c = 0, g = 0;
4746
4766
  this.autoMoveTimer = window.setInterval(() => {
4747
- const w = this.slider.width(), T = this.slider.x(), b = T + w, y = -this.offsetX, k = y + h, E = T <= y + this.EDGE_THRESHOLD, C = b >= k - this.EDGE_THRESHOLD;
4767
+ const x = this.slider.width(), T = this.slider.x(), b = T + x, w = -this.offsetX, C = w + h, E = T <= w + this.EDGE_THRESHOLD, k = b >= C - this.EDGE_THRESHOLD;
4748
4768
  if (E && e === "left") {
4749
- if (y <= 0)
4769
+ if (w <= 0)
4750
4770
  this.slider.x(0), this.stopAutoScroll(), r || (this.draggingDirection === "left" ? this.startAutoExpand("left") : this.stopAutoExpand());
4751
4771
  else if (this.draggingDirection === "left") {
4752
4772
  const v = n ? -o : -this.SCROLL_STEP;
@@ -4756,8 +4776,8 @@ class We {
4756
4776
  } else
4757
4777
  this.stopAutoScroll();
4758
4778
  this.emitUpdate("left");
4759
- } else if (C && e === "right") {
4760
- if (k >= this.context.store.getTimeAxis().getTotalWidth())
4779
+ } else if (k && e === "right") {
4780
+ if (C >= this.context.store.getTimeAxis().getTotalWidth())
4761
4781
  this.slider.width(
4762
4782
  this.context.store.getTimeAxis().getTotalWidth() - this.slider.x()
4763
4783
  ), this.stopAutoScroll(), r || (this.draggingDirection === "right" ? this.startAutoExpand("right") : this.stopAutoExpand());
@@ -4769,12 +4789,12 @@ class We {
4769
4789
  } else
4770
4790
  this.stopAutoScroll();
4771
4791
  this.emitUpdate("right");
4772
- } else if (e === "right" && T <= y && b <= y + this.EDGE_THRESHOLD + o) {
4792
+ } else if (e === "right" && T <= w && b <= w + this.EDGE_THRESHOLD + o) {
4773
4793
  const v = n ? -o : -this.SCROLL_STEP;
4774
4794
  this.startAutoScroll(v, n, () => {
4775
4795
  g += v, this.slider.width(Math.max(this.slider.width(), o)), this.slider.width() > o && this.slider.x(this.slider.x() + v), this.emitUpdate("right");
4776
4796
  });
4777
- } else if (e === "left" && b >= k && T >= k - this.EDGE_THRESHOLD - o) {
4797
+ } else if (e === "left" && b >= C && T >= C - this.EDGE_THRESHOLD - o) {
4778
4798
  const v = n ? o : this.SCROLL_STEP;
4779
4799
  this.startAutoScroll(v, n, () => {
4780
4800
  c += v, this.slider.width(Math.max(this.slider.width(), o)), this.slider.width() > o && this.slider.x(this.slider.x() + v), this.emitUpdate("left");
@@ -4783,16 +4803,16 @@ class We {
4783
4803
  this.stopAutoExpand(), this.stopAutoScroll();
4784
4804
  }, this.MOVE_INTERVAL);
4785
4805
  let d;
4786
- const l = this.slider.x(), p = this.slider.width(), m = (w) => {
4787
- var y;
4788
- w.movementX > 0 ? this.draggingDirection = "right" : w.movementX < 0 && (this.draggingDirection = "left");
4789
- const T = Math.max(((y = i.getPointerPosition()) == null ? void 0 : y.x) || 0, 0);
4806
+ const l = this.slider.x(), m = this.slider.width(), p = (x) => {
4807
+ var w;
4808
+ x.movementX > 0 ? this.draggingDirection = "right" : x.movementX < 0 && (this.draggingDirection = "left");
4809
+ const T = Math.max(((w = i.getPointerPosition()) == null ? void 0 : w.x) || 0, 0);
4790
4810
  let b = T - s;
4791
- n && (b = ct(b, o)), (d === void 0 || d !== b) && (e === "left" ? p - b - c >= o && T < h - this.EDGE_THRESHOLD && (this.slider.width(p - b - c), this.slider.x(l + b + c), this.emitUpdate("left")) : p + b + g >= o && T > this.EDGE_THRESHOLD && (this.slider.width(p + b + g), this.emitUpdate("right")), d = b);
4811
+ n && (b = ct(b, o)), (d === void 0 || d !== b) && (e === "left" ? m - b - c >= o && T < h - this.EDGE_THRESHOLD && (this.slider.width(m - b - c), this.slider.x(l + b + c), this.emitUpdate("left")) : m + b + g >= o && T > this.EDGE_THRESHOLD && (this.slider.width(m + b + g), this.emitUpdate("right")), d = b);
4792
4812
  }, u = () => {
4793
- this.handleDragEnd(t), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", u);
4813
+ this.handleDragEnd(t), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", u);
4794
4814
  };
4795
- document.addEventListener("mousemove", m), document.addEventListener("mouseup", u);
4815
+ document.addEventListener("mousemove", p), document.addEventListener("mouseup", u);
4796
4816
  }
4797
4817
  // 开始自动扩展
4798
4818
  startAutoExpand(t, e = 0, i = 0) {
@@ -4856,18 +4876,18 @@ class We {
4856
4876
  }
4857
4877
  /** 闪烁 */
4858
4878
  handleBarBlink() {
4859
- if (!this.sliderBar) return;
4860
- const t = this.sliderBar.opacity(), e = 400, s = e * 2, n = new S.Animation((o) => {
4861
- if (!this.sliderBar || !o) return;
4879
+ if (!this.sliderGroup) return;
4880
+ const t = this.sliderGroup.opacity(), e = 500, s = e * 2, n = new S.Animation((o) => {
4881
+ if (!this.sliderGroup || !o) return;
4862
4882
  const r = o.time;
4863
4883
  if (r >= s) {
4864
- this.sliderBar.opacity(t), n.stop();
4884
+ this.sliderGroup.opacity(t), n.stop();
4865
4885
  return;
4866
4886
  }
4867
4887
  const h = r % e / e;
4868
4888
  let c;
4869
- h < 0.5 ? c = t * (1 - h * 2) : c = t * ((h - 0.5) * 2), this.sliderBar.opacity(Math.max(0, Math.min(t, c)));
4870
- }, this.sliderBar.getLayer());
4889
+ h < 0.5 ? c = t * (1 - h * 2) : c = t * ((h - 0.5) * 2), this.sliderGroup.opacity(Math.max(0, Math.min(t, c)));
4890
+ }, this.sliderGroup.getLayer());
4871
4891
  n.start();
4872
4892
  }
4873
4893
  }
@@ -5199,17 +5219,17 @@ class Bt {
5199
5219
  g.add(d);
5200
5220
  const l = new S.Group();
5201
5221
  if (o === 0 || o === 90) {
5202
- const m = new S.Line({
5222
+ const p = new S.Line({
5203
5223
  points: [0, 0, o === 0 ? h : 0, o === 0 ? 0 : c],
5204
5224
  stroke: e,
5205
5225
  strokeWidth: i,
5206
5226
  perfectDrawEnabled: !0
5207
5227
  });
5208
- l.add(m);
5228
+ l.add(p);
5209
5229
  } else
5210
- for (let m = -h; m < h * 2; m += h) {
5211
- const u = m + i / 2, x = 0, w = m + i / 2 + (Math.cos(r) < 0 ? -h : h), T = c, b = new S.Line({
5212
- points: [Math.ceil(u), Math.ceil(x), Math.ceil(w), Math.ceil(T)],
5230
+ for (let p = -h; p < h * 2; p += h) {
5231
+ const u = p + i / 2, y = 0, x = p + i / 2 + (Math.cos(r) < 0 ? -h : h), T = c, b = new S.Line({
5232
+ points: [Math.ceil(u), Math.ceil(y), Math.ceil(x), Math.ceil(T)],
5213
5233
  stroke: e,
5214
5234
  strokeWidth: i,
5215
5235
  perfectDrawEnabled: !0,
@@ -5219,8 +5239,8 @@ class Bt {
5219
5239
  l.add(b);
5220
5240
  }
5221
5241
  d.add(l), d.draw();
5222
- const p = new Image();
5223
- return p.src = g.toDataURL(), g.destroy(), p;
5242
+ const m = new Image();
5243
+ return m.src = g.toDataURL(), g.destroy(), m;
5224
5244
  }
5225
5245
  /**
5226
5246
  * 创建圆点图案
@@ -5250,13 +5270,13 @@ class Bt {
5250
5270
  y: o - s / 2 - i / 2
5251
5271
  }
5252
5272
  ].forEach((l) => {
5253
- const p = new S.Circle({
5273
+ const m = new S.Circle({
5254
5274
  x: l.x,
5255
5275
  y: l.y,
5256
5276
  radius: i / 2,
5257
5277
  fill: r.toString()
5258
5278
  });
5259
- c.add(p);
5279
+ c.add(m);
5260
5280
  }), c.draw();
5261
5281
  const d = new Image();
5262
5282
  return d.src = h.toDataURL(), h.destroy(), d;
@@ -5349,20 +5369,20 @@ class Be {
5349
5369
  for (let d = t; d <= e; ) {
5350
5370
  let l = s;
5351
5371
  if (l = s * 2 * (i === "day" ? 1 : 24), this.isWeekend(d)) {
5352
- const p = this.context.store.getTimeAxis().getTimeLeft(d), m = n, u = h;
5353
- if (p + l < c) {
5372
+ const m = this.context.store.getTimeAxis().getTimeLeft(d), p = n, u = h;
5373
+ if (m + l < c) {
5354
5374
  d = d.add(2, "day");
5355
5375
  continue;
5356
5376
  }
5357
- if (p > g)
5377
+ if (m > g)
5358
5378
  break;
5359
5379
  !this.patternImage && this.context.getOptions().weekend.pattern && (this.patternImage = await Bt.createPattern(
5360
5380
  this.context.getOptions().weekend
5361
5381
  ));
5362
- const w = new S.Rect({
5382
+ const x = new S.Rect({
5363
5383
  name: "weekend-rect",
5364
- x: p,
5365
- y: m,
5384
+ x: m,
5385
+ y: p,
5366
5386
  width: l,
5367
5387
  height: u,
5368
5388
  // 根据模式设置填充
@@ -5376,7 +5396,7 @@ class Be {
5376
5396
  },
5377
5397
  opacity: this.context.getOptions().weekend.opacity
5378
5398
  });
5379
- this.weekendGroup.add(w), d = d.add(2, "day");
5399
+ this.weekendGroup.add(x), d = d.add(2, "day");
5380
5400
  } else
5381
5401
  d = d.add(1, "day");
5382
5402
  }
@@ -5412,7 +5432,7 @@ class ze {
5412
5432
  * 渲染今日线
5413
5433
  */
5414
5434
  render() {
5415
- var d, l, p, m, u, x, w;
5435
+ var d, l, m, p, u, y, x;
5416
5436
  const t = Object.assign(
5417
5437
  {
5418
5438
  show: !0,
@@ -5424,7 +5444,7 @@ class ze {
5424
5444
  this.context.getOptions().today || {}
5425
5445
  );
5426
5446
  if (!t.show) return;
5427
- let e = I();
5447
+ let e = G();
5428
5448
  const i = this.context.store.getTimeAxis().getCellUnit();
5429
5449
  t.type === "block" && (e = e.startOf(i));
5430
5450
  const s = this.context.store.getTimeAxis().getTimeLeft(e), n = this.context.store.getTimeAxis().getCellWidth(), o = this.context.getOptions().header.height, r = B(t.backgroundColor).alpha(t.opacity).toHex(), h = (t.type === "block" ? s + n / 2 : s) + this.offsetX, c = [h, o, h, this.height], g = t.type === "line" ? t.width : n;
@@ -5433,24 +5453,24 @@ class ze {
5433
5453
  stroke: r,
5434
5454
  strokeWidth: g
5435
5455
  }), this.bgLayer.add(this.todayLine)), (d = this.context.getOptions().today.text) != null && d.show) {
5436
- const T = ((l = this.context.getOptions().today.text) == null ? void 0 : l.fontSize) || 10, b = ((p = this.context.getOptions().today.text) == null ? void 0 : p.fontFamily) || "Arial", y = ((m = this.context.getOptions().today.text) == null ? void 0 : m.content) || "今天", k = new S.Text({ fontSize: T, fontFamily: b }).measureSize(y), E = ((u = this.context.getOptions().today.text) == null ? void 0 : u.color) || "white", C = ((x = this.context.getOptions().today.text) == null ? void 0 : x.backgroundColor) || r;
5456
+ const T = ((l = this.context.getOptions().today.text) == null ? void 0 : l.fontSize) || 10, b = ((m = this.context.getOptions().today.text) == null ? void 0 : m.fontFamily) || "Arial", w = ((p = this.context.getOptions().today.text) == null ? void 0 : p.content) || "今天", C = new S.Text({ fontSize: T, fontFamily: b }).measureSize(w), E = ((u = this.context.getOptions().today.text) == null ? void 0 : u.color) || "white", k = ((y = this.context.getOptions().today.text) == null ? void 0 : y.backgroundColor) || r;
5437
5457
  if (!this.todayTextGroup)
5438
5458
  this.todayTextGroup = new S.Group({
5439
5459
  x: s + this.offsetX + g,
5440
5460
  y: o,
5441
- opacity: (w = this.context.getOptions().today.text) == null ? void 0 : w.opacity
5461
+ opacity: (x = this.context.getOptions().today.text) == null ? void 0 : x.opacity
5442
5462
  }), this.todayTextGroup.add(new S.Rect({
5443
5463
  x: 0,
5444
5464
  y: 0,
5445
- width: k.width + 12,
5446
- height: k.height + 8,
5447
- fill: C,
5465
+ width: C.width + 12,
5466
+ height: C.height + 8,
5467
+ fill: k,
5448
5468
  cornerRadius: 0,
5449
5469
  name: "today-text-bg"
5450
5470
  })), this.todayTextGroup.add(new S.Text({
5451
5471
  x: 0,
5452
5472
  y: 0,
5453
- text: y,
5473
+ text: w,
5454
5474
  fontSize: T,
5455
5475
  fontFamily: b,
5456
5476
  padding: 5,
@@ -5463,7 +5483,7 @@ class ze {
5463
5483
  this.todayTextGroup.x(s + this.offsetX + g);
5464
5484
  const v = this.todayTextGroup.findOne(".today-text");
5465
5485
  v == null || v.setAttrs({
5466
- text: y,
5486
+ text: w,
5467
5487
  fill: E,
5468
5488
  fontSize: T,
5469
5489
  fontFamily: b,
@@ -5471,9 +5491,9 @@ class ze {
5471
5491
  });
5472
5492
  const M = this.todayTextGroup.findOne(".today-text-bg");
5473
5493
  M == null || M.setAttrs({
5474
- width: k.width + 12,
5475
- height: k.height + 8,
5476
- fill: C
5494
+ width: C.width + 12,
5495
+ height: C.height + 8,
5496
+ fill: k
5477
5497
  });
5478
5498
  }
5479
5499
  } else this.todayTextGroup && (this.todayTextGroup.destroy(), this.todayTextGroup = void 0);
@@ -5486,9 +5506,9 @@ class ze {
5486
5506
  rotation: 180,
5487
5507
  name: "today-triangle"
5488
5508
  }), this.arrowAnimation = new S.Animation((T) => {
5489
- var y;
5509
+ var w;
5490
5510
  const b = Math.sin(T.time * 4 * Math.PI / 2e3) + o - 8;
5491
- (y = this.triangle) == null || y.y(b);
5511
+ (w = this.triangle) == null || w.y(b);
5492
5512
  }, this.headerLayer), this.headerLayer.add(this.triangle), this.triangle.moveToTop(), this.arrowAnimation.start())), this.bgLayer.batchDraw();
5493
5513
  }
5494
5514
  /**
@@ -5542,7 +5562,7 @@ class Ne {
5542
5562
  * 计算假期
5543
5563
  */
5544
5564
  async calculateHoliday() {
5545
- var d, l, p, m, u, x, w, T;
5565
+ var d, l, m, p, u, y, x, T;
5546
5566
  if (this.clearHoliday(), !this.context.getOptions().holiday.show) return;
5547
5567
  const t = this.context.getOptions().holiday.holidays;
5548
5568
  if (!t || t.length === 0) return;
@@ -5550,53 +5570,53 @@ class Ne {
5550
5570
  this.context.store.getTimeAxis().getCellUnit();
5551
5571
  const o = this.context.store.getTimeAxis().getCellWidth(), r = this.context.getOptions().header.height, h = this.context.getOptions().row.height, g = this.context.store.getDataManager().getVisibleSize() * h;
5552
5572
  for (let b = s; b <= n; b = b.add(1, "day")) {
5553
- const y = t.find((k) => {
5554
- if (X(k.date)) {
5555
- if (k.date.some((E) => I(E).isSame(b, "day")))
5556
- return k;
5557
- } else if (I(k.date).isSame(b, "day"))
5558
- return k;
5573
+ const w = t.find((C) => {
5574
+ if (X(C.date)) {
5575
+ if (C.date.some((E) => G(E).isSame(b, "day")))
5576
+ return C;
5577
+ } else if (G(C.date).isSame(b, "day"))
5578
+ return C;
5559
5579
  });
5560
- if (y) {
5561
- const k = this.context.store.getTimeAxis().getTimeLeft(b), E = r, C = g;
5562
- if (k + o < e)
5580
+ if (w) {
5581
+ const C = this.context.store.getTimeAxis().getTimeLeft(b), E = r, k = g;
5582
+ if (C + o < e)
5563
5583
  continue;
5564
- if (k > i)
5584
+ if (C > i)
5565
5585
  break;
5566
- !this.patternImage.has(y) && (y.pattern || this.context.getOptions().holiday.pattern) && this.patternImage.set(
5567
- y,
5586
+ !this.patternImage.has(w) && (w.pattern || this.context.getOptions().holiday.pattern) && this.patternImage.set(
5587
+ w,
5568
5588
  await Bt.createPattern({
5569
5589
  backgroundColor: this.context.getOptions().primaryColor,
5570
- ...y,
5590
+ ...w,
5571
5591
  ...this.context.getOptions().holiday
5572
5592
  })
5573
5593
  );
5574
5594
  const M = new S.Rect({
5575
5595
  name: "holiday-rect",
5576
- x: k,
5596
+ x: C,
5577
5597
  y: E,
5578
5598
  width: o,
5579
- height: C,
5599
+ height: k,
5580
5600
  // 根据模式设置填充
5581
- ...this.patternImage.get(y) ? {
5582
- fillPatternImage: this.patternImage.get(y) ?? void 0,
5601
+ ...this.patternImage.get(w) ? {
5602
+ fillPatternImage: this.patternImage.get(w) ?? void 0,
5583
5603
  fillPatternRepeat: "repeat",
5584
5604
  fillPatternOffset: { x: 0, y: 0 },
5585
5605
  fillPatternScale: { x: 1, y: 1 },
5586
- opacity: y.opacity || this.context.getOptions().holiday.opacity
5606
+ opacity: w.opacity || this.context.getOptions().holiday.opacity
5587
5607
  } : {
5588
- fill: y.backgroundColor || this.context.getOptions().holiday.backgroundColor || this.context.getOptions().primaryColor,
5589
- opacity: y.opacity || this.context.getOptions().holiday.opacity
5608
+ fill: w.backgroundColor || this.context.getOptions().holiday.backgroundColor || this.context.getOptions().primaryColor,
5609
+ opacity: w.opacity || this.context.getOptions().holiday.opacity
5590
5610
  }
5591
5611
  });
5592
- if (this.holidayGroup.add(M), (d = y.text) != null && d.show) {
5593
- if (X(y.date) && !I(y.date[0]).isSame(b, "day"))
5612
+ if (this.holidayGroup.add(M), (d = w.text) != null && d.show) {
5613
+ if (X(w.date) && !G(w.date[0]).isSame(b, "day"))
5594
5614
  continue;
5595
- const A = ((l = y.text) == null ? void 0 : l.fontSize) || 10, _ = ((p = y.text) == null ? void 0 : p.fontFamily) || "Arial", D = ((m = y.text) == null ? void 0 : m.content) || "", H = new S.Text({ fontSize: A, fontFamily: _ }).measureSize(D), W = ((u = y.text) == null ? void 0 : u.color) || "white", G = ((x = y.text) == null ? void 0 : x.backgroundColor) || y.backgroundColor || ((w = this.context.getOptions().holiday) == null ? void 0 : w.backgroundColor) || this.context.getOptions().primaryColor, R = new S.Group({
5615
+ const A = ((l = w.text) == null ? void 0 : l.fontSize) || 10, _ = ((m = w.text) == null ? void 0 : m.fontFamily) || "Arial", D = ((p = w.text) == null ? void 0 : p.content) || "", I = new S.Text({ fontSize: A, fontFamily: _ }).measureSize(D), W = ((u = w.text) == null ? void 0 : u.color) || "white", H = ((y = w.text) == null ? void 0 : y.backgroundColor) || w.backgroundColor || ((x = this.context.getOptions().holiday) == null ? void 0 : x.backgroundColor) || this.context.getOptions().primaryColor, R = new S.Group({
5596
5616
  name: "holiday-text-group",
5597
- x: k,
5617
+ x: C,
5598
5618
  y: E,
5599
- opacity: (T = y.text) == null ? void 0 : T.opacity
5619
+ opacity: (T = w.text) == null ? void 0 : T.opacity
5600
5620
  }), F = new S.Text({
5601
5621
  text: D,
5602
5622
  fill: W,
@@ -5606,9 +5626,9 @@ class Ne {
5606
5626
  }), z = new S.Rect({
5607
5627
  x: 0,
5608
5628
  y: 0,
5609
- width: H.width + 12,
5610
- height: H.height + 8,
5611
- fill: G
5629
+ width: I.width + 12,
5630
+ height: I.height + 8,
5631
+ fill: H
5612
5632
  });
5613
5633
  R.add(z), R.add(F), this.holidayGroup.add(R);
5614
5634
  }
@@ -5659,17 +5679,17 @@ class Pe {
5659
5679
  * 计算标志日期
5660
5680
  */
5661
5681
  async calculateFlag() {
5662
- var d, l, p, m, u, x, w;
5682
+ var d, l, m, p, u, y, x;
5663
5683
  if (this.clearFlag(), !((d = this.context.getOptions().flag) != null && d.show)) return;
5664
5684
  const t = (l = this.context.getOptions().flag) == null ? void 0 : l.data;
5665
5685
  if (!t || t.length === 0) return;
5666
- const e = ((p = this.context.getOptions().flag) == null ? void 0 : p.backgroundColor) || this.context.getOptions().primaryColor, i = ((m = this.context.getOptions().flag) == null ? void 0 : m.opacity) || 1, s = ((u = this.context.getOptions().flag) == null ? void 0 : u.color) || (B(e).isDark() ? "white" : "black"), n = ((x = this.context.getOptions().flag) == null ? void 0 : x.fontFamily) || "Arial", o = ((w = this.context.getOptions().flag) == null ? void 0 : w.fontSize) || 10, r = Math.max(0, -this.offsetX), h = r + this.width, c = this.context.store.getTimeAxis().getCellWidth(), g = this.context.getOptions().header.height;
5686
+ const e = ((m = this.context.getOptions().flag) == null ? void 0 : m.backgroundColor) || this.context.getOptions().primaryColor, i = ((p = this.context.getOptions().flag) == null ? void 0 : p.opacity) || 1, s = ((u = this.context.getOptions().flag) == null ? void 0 : u.color) || (B(e).isDark() ? "white" : "black"), n = ((y = this.context.getOptions().flag) == null ? void 0 : y.fontFamily) || "Arial", o = ((x = this.context.getOptions().flag) == null ? void 0 : x.fontSize) || 10, r = Math.max(0, -this.offsetX), h = r + this.width, c = this.context.store.getTimeAxis().getCellWidth(), g = this.context.getOptions().header.height;
5667
5687
  this.context.getOptions().row.height, this.context.store.getDataManager().getVisibleSize(), t.forEach((T) => {
5668
- const b = I(T.date), y = this.context.store.getTimeAxis().getTimeLeft(b), k = g;
5669
- if (y + c < r || y > h)
5688
+ const b = G(T.date), w = this.context.store.getTimeAxis().getTimeLeft(b), C = g;
5689
+ if (w + c < r || w > h)
5670
5690
  return;
5671
- const C = [y, g, y, this.height], v = new S.Line({
5672
- points: C,
5691
+ const k = [w, g, w, this.height], v = new S.Line({
5692
+ points: k,
5673
5693
  stroke: T.backgroundColor || e,
5674
5694
  opacity: T.opacity || i,
5675
5695
  strokeWidth: 1
@@ -5679,9 +5699,9 @@ class Pe {
5679
5699
  if (M) {
5680
5700
  const A = new S.Text({
5681
5701
  text: M,
5682
- x: y + 5,
5702
+ x: w + 5,
5683
5703
  // 添加一些内边距
5684
- y: k + 5,
5704
+ y: C + 5,
5685
5705
  // 添加一些内边距
5686
5706
  fontSize: o,
5687
5707
  fontFamily: n,
@@ -5689,8 +5709,8 @@ class Pe {
5689
5709
  verticalAlign: "middle",
5690
5710
  align: "left"
5691
5711
  }), _ = new S.Rect({
5692
- x: y,
5693
- y: k,
5712
+ x: w,
5713
+ y: C,
5694
5714
  width: A.measureSize(M).width + 12,
5695
5715
  height: A.measureSize(M).height + 8,
5696
5716
  fill: T.backgroundColor || e
@@ -5700,8 +5720,8 @@ class Pe {
5700
5720
  switch (T.flag) {
5701
5721
  case "banner":
5702
5722
  this.flagGroup.add(new S.Rect({
5703
- x: y,
5704
- y: k,
5723
+ x: w,
5724
+ y: C,
5705
5725
  width: 20,
5706
5726
  height: 10,
5707
5727
  fill: T.backgroundColor || e,
@@ -5710,7 +5730,7 @@ class Pe {
5710
5730
  break;
5711
5731
  case "pennant":
5712
5732
  this.flagGroup.add(new S.Line({
5713
- points: [y, k, y + 20, k + 5, y, k + 10],
5733
+ points: [w, C, w + 20, C + 5, w, C + 10],
5714
5734
  fill: T.backgroundColor || e,
5715
5735
  opacity: T.opacity || i,
5716
5736
  closed: !0
@@ -5718,7 +5738,7 @@ class Pe {
5718
5738
  break;
5719
5739
  case "tag":
5720
5740
  this.flagGroup.add(new S.Line({
5721
- points: [y, k, y + 20, k, y + 15, k + 5, y + 20, k + 10, y, k + 10],
5741
+ points: [w, C, w + 20, C, w + 15, C + 5, w + 20, C + 10, w, C + 10],
5722
5742
  fill: T.backgroundColor || e,
5723
5743
  opacity: T.opacity || i,
5724
5744
  closed: !0
@@ -5726,7 +5746,7 @@ class Pe {
5726
5746
  break;
5727
5747
  case "wedge":
5728
5748
  this.flagGroup.add(new S.Line({
5729
- points: [y, k, y + 20, k, y + 25, k + 5, y + 20, k + 10, y, k + 10],
5749
+ points: [w, C, w + 20, C, w + 25, C + 5, w + 20, C + 10, w, C + 10],
5730
5750
  fill: T.backgroundColor || e,
5731
5751
  opacity: T.opacity || i,
5732
5752
  closed: !0
@@ -5734,7 +5754,7 @@ class Pe {
5734
5754
  break;
5735
5755
  case "ribbon":
5736
5756
  this.flagGroup.add(new S.Line({
5737
- points: [y, k, y + 15, k + 2, y + 20, k, y + 20, k + 10, y + 15, k + 12, y, k + 10],
5757
+ points: [w, C, w + 15, C + 2, w + 20, C, w + 20, C + 10, w + 15, C + 12, w, C + 10],
5738
5758
  fill: T.backgroundColor || e,
5739
5759
  opacity: T.opacity || i,
5740
5760
  closed: !0,
@@ -5808,7 +5828,7 @@ class Ye {
5808
5828
  * 更新某一条数据
5809
5829
  */
5810
5830
  updateTask(t) {
5811
- this.calculateLinks(t), this.calculatePoints(t);
5831
+ this.calculateLinks([t]), this.calculatePoints(t);
5812
5832
  }
5813
5833
  /**
5814
5834
  * 渲染关联线
@@ -5835,44 +5855,44 @@ class Ye {
5835
5855
  const e = this.context.getOptions().header.height, i = this.context.getOptions().row.height, s = i / 2 + e, n = this.context.getOptions().links.create.radius, o = this.context.getOptions().links.create.mode === "always" ? 0.5 : 0, r = this.context.getOptions().links.create.color || this.context.getOptions().primaryColor, h = B(r).alpha(this.context.getOptions().links.create.opacity ?? 1).toHex(), c = this.context.getOptions().links.create.width;
5836
5856
  this.tasks.forEach((l) => {
5837
5857
  if (!(t && l.id !== t.id) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, l) && l.startTime && l.endTime) {
5838
- const p = this.context.store.getTimeAxis().getTimeLeft(l.startTime), m = this.context.store.getTimeAxis().getTimeLeft(l.endTime);
5858
+ const m = this.context.store.getTimeAxis().getTimeLeft(l.startTime), p = this.context.store.getTimeAxis().getTimeLeft(l.endTime);
5839
5859
  let u = this.context.getOptions().links.gap;
5840
5860
  l.isMilestone() && (u += i / 2);
5841
- const x = s + i * l.flatIndex;
5842
- let w = !0, T = !0, b = this.context.store.getOptionManager().unpackFunc(this.context.getOptions().links.create.from, l);
5843
- if (ht(b) ? w = T = b : V(b) && (w = b === "S", T = b === "F"), w) {
5844
- const y = new S.Circle({
5861
+ const y = s + i * l.flatIndex;
5862
+ let x = !0, T = !0, b = this.context.store.getOptionManager().unpackFunc(this.context.getOptions().links.create.from, l);
5863
+ if (ht(b) ? x = T = b : V(b) && (x = b === "S", T = b === "F"), x) {
5864
+ const w = new S.Circle({
5845
5865
  id: `point-${l.id}-left`,
5846
- x: p - u,
5847
- y: x,
5866
+ x: m - u,
5867
+ y,
5848
5868
  radius: n,
5849
5869
  opacity: o,
5850
5870
  stroke: h,
5851
5871
  strokeWidth: c
5852
5872
  });
5853
- this.pointGroup.add(y), y.on("mousedown", (k) => {
5854
- this.isDragging = !0, this.createLink(k, "S", r, [p - u, x], l.id);
5855
- }), y.on("mouseover", (k) => {
5873
+ this.pointGroup.add(w), w.on("mousedown", (C) => {
5874
+ this.isDragging = !0, this.createLink(C, "S", r, [m - u, y], l.id);
5875
+ }), w.on("mouseover", (C) => {
5856
5876
  this.isSliderMoving || (this.stage.container().style.cursor = "pointer");
5857
- }), y.on("mouseout", (k) => {
5877
+ }), w.on("mouseout", (C) => {
5858
5878
  this.isDragging || this.isSliderMoving || (this.stage.container().style.cursor = "default");
5859
5879
  });
5860
5880
  }
5861
5881
  if (T) {
5862
- const y = new S.Circle({
5882
+ const w = new S.Circle({
5863
5883
  id: `point-${l.id}-right`,
5864
- x: m + u,
5865
- y: x,
5884
+ x: p + u,
5885
+ y,
5866
5886
  radius: n,
5867
5887
  opacity: o,
5868
5888
  stroke: h,
5869
5889
  strokeWidth: c
5870
5890
  });
5871
- this.pointGroup.add(y), y.on("mousedown", (k) => {
5872
- this.isDragging = !0, this.createLink(k, "F", r, [m + u, x], l.id);
5873
- }), y.on("mouseover", (k) => {
5891
+ this.pointGroup.add(w), w.on("mousedown", (C) => {
5892
+ this.isDragging = !0, this.createLink(C, "F", r, [p + u, y], l.id);
5893
+ }), w.on("mouseover", (C) => {
5874
5894
  this.isSliderMoving || (this.stage.container().style.cursor = "pointer");
5875
- }), y.on("mouseout", (k) => {
5895
+ }), w.on("mouseout", (C) => {
5876
5896
  this.isDragging || this.isSliderMoving || (this.stage.container().style.cursor = "default");
5877
5897
  });
5878
5898
  }
@@ -5891,16 +5911,14 @@ class Ye {
5891
5911
  this.destroy();
5892
5912
  return;
5893
5913
  }
5894
- const e = t ? this.context.store.getLinkManager().getLinksByTaskId(t.id) : this.context.store.getLinkManager().getLinks();
5895
- t && e.forEach((s) => {
5896
- const n = this.createId(s);
5897
- this.linkCache.delete(n);
5898
- const o = this.linksGroup.findOne(`#${n}`);
5899
- o && o.destroy();
5914
+ const e = t != null && t.length ? t.reduce((s, n) => (s.push(...this.context.store.getLinkManager().getLinksByTaskId(n.id)), s), []) : this.context.store.getLinkManager().getLinks();
5915
+ t != null && t.length && e.forEach((s) => {
5916
+ const n = this.createId(s), o = this.linkCache.get(n);
5917
+ o == null || o.destroy(), this.linkCache.delete(n);
5900
5918
  });
5901
5919
  const i = Q();
5902
5920
  e.forEach((s) => {
5903
- var g, d, l, p, m, u, x, w;
5921
+ var g, d, l, m, p, u, y, x;
5904
5922
  const n = this.createId(s), o = this.context.store.getDataManager().getTaskById(s.from), r = this.context.store.getDataManager().getTaskById(s.to);
5905
5923
  if (!o) {
5906
5924
  O.warn(
@@ -5919,35 +5937,35 @@ class Ye {
5919
5937
  if (o.flatIndex < this.tasks[0].flatIndex && r.flatIndex < this.tasks[0].flatIndex || o.flatIndex > this.tasks[this.tasks.length - 1].flatIndex && r.flatIndex > this.tasks[this.tasks.length - 1].flatIndex)
5920
5938
  return;
5921
5939
  const h = Math.max(0, -this.offsetX), c = h + this.width;
5922
- if (!(this.context.store.getTimeAxis().getTimeLeft(((g = s.type) == null ? void 0 : g[0]) === "S" ? o.startTime : o.endTime) < h && this.context.store.getTimeAxis().getTimeLeft(((d = s.type) == null ? void 0 : d[1]) === "F" ? r.endTime : r.startTime) < h) && !(this.context.store.getTimeAxis().getTimeLeft(((l = s.type) == null ? void 0 : l[0]) === "S" ? o.startTime : o.endTime) > c && this.context.store.getTimeAxis().getTimeLeft(((p = s.type) == null ? void 0 : p[1]) === "F" ? r.endTime : r.startTime) > c) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, o) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, r)) {
5940
+ if (!(this.context.store.getTimeAxis().getTimeLeft(((g = s.type) == null ? void 0 : g[0]) === "S" ? o.startTime : o.endTime) < h && this.context.store.getTimeAxis().getTimeLeft(((d = s.type) == null ? void 0 : d[1]) === "F" ? r.endTime : r.startTime) < h) && !(this.context.store.getTimeAxis().getTimeLeft(((l = s.type) == null ? void 0 : l[0]) === "S" ? o.startTime : o.endTime) > c && this.context.store.getTimeAxis().getTimeLeft(((m = s.type) == null ? void 0 : m[1]) === "F" ? r.endTime : r.startTime) > c) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, o) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, r)) {
5923
5941
  const T = this.getPoints(o, r, s);
5924
5942
  if (T.length <= 2)
5925
5943
  O.warn("The link position has some error.", s);
5926
5944
  else {
5927
- const b = s.radius ?? this.context.getOptions().links.radius, y = ((m = s.arrow) == null ? void 0 : m.width) ?? this.context.getOptions().links.arrow.width, k = ((u = s.arrow) == null ? void 0 : u.height) ?? this.context.getOptions().links.arrow.height, E = s.width ?? this.context.getOptions().links.width;
5928
- let C = this.linkCache.get(n);
5929
- C === void 0 && (C = new S.Group({ id: n })), C._ = i;
5930
- const v = C.findOne("Circle");
5945
+ const b = s.radius ?? this.context.getOptions().links.radius, w = ((p = s.arrow) == null ? void 0 : p.width) ?? this.context.getOptions().links.arrow.width, C = ((u = s.arrow) == null ? void 0 : u.height) ?? this.context.getOptions().links.arrow.height, E = s.width ?? this.context.getOptions().links.width;
5946
+ let k = this.linkCache.get(n);
5947
+ k === void 0 && (k = new S.Group({ id: n })), t != null && t.length || (k._ = i);
5948
+ const v = k.findOne("Circle");
5931
5949
  if (v)
5932
5950
  v.radius(b), v.fill(
5933
5951
  s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
5934
5952
  ), v.x(T[0]), v.y(T[1]);
5935
5953
  else {
5936
- const G = new S.Circle({
5954
+ const H = new S.Circle({
5937
5955
  radius: b,
5938
5956
  fill: s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
5939
5957
  x: T[0],
5940
5958
  y: T[1]
5941
5959
  });
5942
- C.add(G);
5960
+ k.add(H);
5943
5961
  }
5944
- const M = Math.floor(T.length / 2), A = M % 2 === 0 ? M : M - 1, _ = T.slice(0, A + 2), D = T.slice(A), H = C.findOne("Line");
5945
- if (H)
5946
- H.points(_), H.stroke(
5962
+ const M = Math.floor(T.length / 2), A = M % 2 === 0 ? M : M - 1, _ = T.slice(0, A + 2), D = T.slice(A), I = k.findOne("Line");
5963
+ if (I)
5964
+ I.points(_), I.stroke(
5947
5965
  s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
5948
- ), H.strokeWidth(E), H.dash(s.dash || this.context.getOptions().links.dash);
5966
+ ), I.strokeWidth(E + (this.selectedMap.has(n) ? 2 : 0)), I.dash(s.dash || this.context.getOptions().links.dash);
5949
5967
  else {
5950
- const G = new S.Line({
5968
+ const H = new S.Line({
5951
5969
  points: _,
5952
5970
  stroke: s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
5953
5971
  strokeWidth: E,
@@ -5959,7 +5977,7 @@ class Ye {
5959
5977
  draggable: !0,
5960
5978
  dragBoundFunc: (R) => ({ x: 0, y: 0 })
5961
5979
  });
5962
- C.add(G), G.on("dragstart", (R) => {
5980
+ k.add(H), H.on("dragstart", (R) => {
5963
5981
  this.handleDrag(
5964
5982
  R,
5965
5983
  s,
@@ -5969,21 +5987,21 @@ class Ye {
5969
5987
  );
5970
5988
  });
5971
5989
  }
5972
- const W = C.findOne("Arrow");
5990
+ const W = k.findOne("Arrow");
5973
5991
  if (W)
5974
5992
  W.points(D), W.stroke(
5975
5993
  s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
5976
- ), W.strokeWidth(E), W.pointerLength(k), W.pointerWidth(y), W.fill(
5977
- ((x = s.arrow) == null ? void 0 : x.color) || this.context.getOptions().links.arrow.color || s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
5994
+ ), W.strokeWidth(E + (this.selectedMap.has(n) ? 2 : 0)), W.pointerLength(C), W.pointerWidth(w), W.fill(
5995
+ ((y = s.arrow) == null ? void 0 : y.color) || this.context.getOptions().links.arrow.color || s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
5978
5996
  ), W.lineJoin("round"), W.dash(s.dash || this.context.getOptions().links.dash);
5979
5997
  else {
5980
- const G = new S.Arrow({
5998
+ const H = new S.Arrow({
5981
5999
  points: D,
5982
6000
  stroke: s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
5983
6001
  strokeWidth: E,
5984
- pointerLength: k,
5985
- pointerWidth: y,
5986
- fill: ((w = s.arrow) == null ? void 0 : w.color) || this.context.getOptions().links.arrow.color || s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
6002
+ pointerLength: C,
6003
+ pointerWidth: w,
6004
+ fill: ((x = s.arrow) == null ? void 0 : x.color) || this.context.getOptions().links.arrow.color || s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
5987
6005
  // 箭头填充色
5988
6006
  lineJoin: "round",
5989
6007
  dash: s.dash || this.context.getOptions().links.dash,
@@ -5992,32 +6010,32 @@ class Ye {
5992
6010
  draggable: !0,
5993
6011
  dragBoundFunc: (R) => ({ x: 0, y: 0 })
5994
6012
  });
5995
- C.add(G), G.on("dragstart", (R) => {
6013
+ k.add(H), H.on("dragstart", (R) => {
5996
6014
  this.handleDrag(R, s, "F", [T[0], T[1]], n);
5997
6015
  });
5998
6016
  }
5999
- this.linkCache.has(n) || (this.linksGroup.add(C), C.on("mouseover", (G) => {
6000
- G.target.moveToTop(), this.context.getOptions().links.move.enabled === !0 && (this.stage.container().style.cursor = "pointer"), this.selectedMap.has(n) || this.handleHighlight(
6001
- C,
6002
- b,
6003
- y,
6017
+ this.linkCache.has(n) || (this.linksGroup.add(k), k.on("mouseover", (H) => {
6018
+ H.target.moveToTop(), this.context.getOptions().links.move.enabled === !0 && (this.stage.container().style.cursor = "pointer"), this.selectedMap.has(n) || this.handleHighlight(
6004
6019
  k,
6020
+ b,
6021
+ w,
6022
+ C,
6005
6023
  E,
6006
6024
  2
6007
6025
  );
6008
- }), C.on("mouseout", (G) => {
6026
+ }), k.on("mouseout", (H) => {
6009
6027
  this.selectedMap.has(n) || this.handleHighlight(
6010
- C,
6011
- b,
6012
- y,
6013
6028
  k,
6029
+ b,
6030
+ w,
6031
+ C,
6014
6032
  E,
6015
6033
  0
6016
6034
  ), !this.isDragging && (this.stage.container().style.cursor = "default");
6017
- }), C.on("mousedown", (G) => {
6035
+ }), k.on("mousedown", (H) => {
6018
6036
  this.isDragging = !0;
6019
- }), C.on("click", (G) => {
6020
- G.cancelBubble = !0, this.isDragging = !1, C.moveToTop(), G.evt.button === 0 ? this.selectedMap.has(n) ? (this.selectedMap.delete(n), this.context.event.emit(
6037
+ }), k.on("click", (H) => {
6038
+ H.cancelBubble = !0, this.isDragging = !1, k.moveToTop(), H.evt.button === 0 && (this.selectedMap.has(n) ? (this.selectedMap.delete(n), this.context.event.emit(
6021
6039
  L.SELECT_LINK,
6022
6040
  null,
6023
6041
  s,
@@ -6027,19 +6045,21 @@ class Ye {
6027
6045
  s,
6028
6046
  null,
6029
6047
  this.selectedMap.values().toArray()
6030
- )) : G.evt.button === 2 && this.context.event.emit(L.CONTEXT_LINK, G.evt, s);
6031
- }), this.linkCache.set(n, C)), this.selectedMap.has(n) && this.handleHighlight(
6032
- C,
6033
- b,
6034
- y,
6048
+ )));
6049
+ }), k.on("contextmenu", (H) => {
6050
+ H.evt.preventDefault(), H.cancelBubble = !0, this.context.event.emit(L.CONTEXT_LINK, H.evt, s);
6051
+ }), this.linkCache.set(n, k)), this.selectedMap.has(n) && this.handleHighlight(
6035
6052
  k,
6053
+ b,
6054
+ w,
6055
+ C,
6036
6056
  E,
6037
6057
  2,
6038
6058
  !0
6039
6059
  );
6040
6060
  }
6041
6061
  }
6042
- }), this.linkCache.forEach((s, n) => {
6062
+ }), t != null && t.length || this.linkCache.forEach((s, n) => {
6043
6063
  s._ !== i && (s.destroy(), this.linkCache.delete(n));
6044
6064
  }), this.layer.batchDraw();
6045
6065
  }
@@ -6075,17 +6095,17 @@ class Ye {
6075
6095
  0.05 + g + c * e.flatIndex
6076
6096
  ];
6077
6097
  {
6078
- const p = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6079
- if (isNaN(p))
6098
+ const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6099
+ if (isNaN(m))
6080
6100
  O.error("Link's distance must be a Numeric");
6081
6101
  else {
6082
- const m = n + d + p, u = o - d - p, x = [
6083
- Math.max(m, u),
6102
+ const p = n + d + m, u = o - d - m, y = [
6103
+ Math.max(p, u),
6084
6104
  g + c * e.flatIndex
6085
6105
  ];
6086
- l.push(...x);
6087
- const w = c * e.flatIndex + h + (e.flatIndex <= i.flatIndex ? c : 0);
6088
- l.push(x[0], w), l.push(u, w), l.push(u, g + c * i.flatIndex);
6106
+ l.push(...y);
6107
+ const x = c * e.flatIndex + h + (e.flatIndex <= i.flatIndex ? c : 0);
6108
+ l.push(y[0], x), l.push(u, x), l.push(u, g + c * i.flatIndex);
6089
6109
  }
6090
6110
  }
6091
6111
  return l.push(o - d, g + c * i.flatIndex), l;
@@ -6097,16 +6117,16 @@ class Ye {
6097
6117
  0.05 + g + c * e.flatIndex
6098
6118
  ];
6099
6119
  {
6100
- const p = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6101
- if (isNaN(p))
6120
+ const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6121
+ if (isNaN(m))
6102
6122
  O.error("Link's distance must be a Numeric");
6103
6123
  else {
6104
- const m = n + d + p, u = r + d + p, x = [
6105
- m <= u ? u : m,
6124
+ const p = n + d + m, u = r + d + m, y = [
6125
+ p <= u ? u : p,
6106
6126
  g + c * e.flatIndex
6107
6127
  ];
6108
- l.push(...x), l.push(
6109
- Math.max(u, m),
6128
+ l.push(...y), l.push(
6129
+ Math.max(u, p),
6110
6130
  g + c * i.flatIndex
6111
6131
  );
6112
6132
  }
@@ -6120,16 +6140,16 @@ class Ye {
6120
6140
  0.05 + g + c * e.flatIndex
6121
6141
  ];
6122
6142
  {
6123
- const p = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6124
- if (isNaN(p))
6143
+ const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6144
+ if (isNaN(m))
6125
6145
  O.error("Link's distance must be a Numeric");
6126
6146
  else {
6127
- const m = s - d - p, u = o - d - p;
6147
+ const p = s - d - m, u = o - d - m;
6128
6148
  l.push(
6129
- Math.min(u, m),
6149
+ Math.min(u, p),
6130
6150
  g + c * e.flatIndex
6131
6151
  ), l.push(
6132
- Math.min(u, m),
6152
+ Math.min(u, p),
6133
6153
  g + c * i.flatIndex
6134
6154
  );
6135
6155
  }
@@ -6143,17 +6163,17 @@ class Ye {
6143
6163
  0.05 + g + c * e.flatIndex
6144
6164
  ];
6145
6165
  {
6146
- const p = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6147
- if (isNaN(p))
6166
+ const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6167
+ if (isNaN(m))
6148
6168
  O.error("Link's distance must be a Numeric");
6149
6169
  else {
6150
- const m = s - d - p, u = r + d + p, x = [
6151
- Math.min(m, u),
6170
+ const p = s - d - m, u = r + d + m, y = [
6171
+ Math.min(p, u),
6152
6172
  g + c * e.flatIndex
6153
6173
  ];
6154
- l.push(...x);
6155
- const w = c * e.flatIndex + h + (e.flatIndex <= i.flatIndex ? c : 0);
6156
- l.push(x[0], w), l.push(u, w), l.push(u, g + c * i.flatIndex);
6174
+ l.push(...y);
6175
+ const x = c * e.flatIndex + h + (e.flatIndex <= i.flatIndex ? c : 0);
6176
+ l.push(y[0], x), l.push(u, x), l.push(u, g + c * i.flatIndex);
6157
6177
  }
6158
6178
  }
6159
6179
  return l.push(r + d, g + c * i.flatIndex), l;
@@ -6162,16 +6182,16 @@ class Ye {
6162
6182
  * 处理连线被点击后的移动
6163
6183
  */
6164
6184
  handleDrag(t, e, i, s, n) {
6165
- var x, w, T;
6185
+ var y, x, T;
6166
6186
  if (!this.isDragging || this.context.getOptions().links.move.enabled !== !0) return;
6167
6187
  this.stage.container().style.cursor = "pointer";
6168
6188
  const o = this.linksGroup.findOne(`#${n}`);
6169
6189
  this.templateArrow.setAttrs({
6170
6190
  stroke: e.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
6171
6191
  strokeWidth: e.width ?? this.context.getOptions().links.width,
6172
- pointerLength: ((x = e.arrow) == null ? void 0 : x.height) ?? this.context.getOptions().links.arrow.height,
6192
+ pointerLength: ((y = e.arrow) == null ? void 0 : y.height) ?? this.context.getOptions().links.arrow.height,
6173
6193
  // 箭头长度
6174
- pointerWidth: ((w = e.arrow) == null ? void 0 : w.width) ?? this.context.getOptions().links.arrow.width,
6194
+ pointerWidth: ((x = e.arrow) == null ? void 0 : x.width) ?? this.context.getOptions().links.arrow.width,
6175
6195
  // 箭头宽度
6176
6196
  fill: ((T = e.arrow) == null ? void 0 : T.color) || this.context.getOptions().links.arrow.color || e.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
6177
6197
  // 箭头填充色
@@ -6181,17 +6201,17 @@ class Ye {
6181
6201
  let r = null;
6182
6202
  const h = this.context.getOptions().header.height, c = this.context.getOptions().row.height, g = c / 2 + h, d = e.gap || this.context.getOptions().links.gap;
6183
6203
  let l = null;
6184
- const p = () => {
6204
+ const m = () => {
6185
6205
  const b = this.stage.getPointerPosition();
6186
6206
  if (b && (l = this.getTaskByPosition(b), !!l && (this.templateArrow.visible(!0), o == null || o.visible(!1), l != null && l.startTime && (l != null && l.endTime)))) {
6187
- const y = this.context.store.getTimeAxis().getTimeLeft(l.startTime), k = this.context.store.getTimeAxis().getTimeLeft(l.endTime), E = (k + y) / 2 + this.offsetX;
6188
- let C = y - d;
6189
- b.x <= E ? r = "S" : (r = "F", C = k + d);
6207
+ const w = this.context.store.getTimeAxis().getTimeLeft(l.startTime), C = this.context.store.getTimeAxis().getTimeLeft(l.endTime), E = (C + w) / 2 + this.offsetX;
6208
+ let k = w - d;
6209
+ b.x <= E ? r = "S" : (r = "F", k = C + d);
6190
6210
  let v;
6191
6211
  if (i === "S" ? v = `${r}${(e.type || "FS")[1]}` : v = `${(e.type || "FS")[0]}${r}`, i === "S") {
6192
6212
  const { allowLeft: M, allowRight: A } = this.isAllowStartDrop(l, e.to, v);
6193
6213
  this.templateArrow.points([
6194
- C,
6214
+ k,
6195
6215
  g + c * l.flatIndex,
6196
6216
  ...s
6197
6217
  ]), A ? this.stage.container().style.cursor = "pointer" : this.stage.container().style.cursor = "not-allowed";
@@ -6199,26 +6219,26 @@ class Ye {
6199
6219
  const { allowLeft: M, allowRight: A } = this.isAllowEndDrop(l, e.from, v);
6200
6220
  this.templateArrow.points([
6201
6221
  ...s,
6202
- C,
6222
+ k,
6203
6223
  g + c * l.flatIndex
6204
6224
  ]), M ? this.stage.container().style.cursor = "pointer" : this.stage.container().style.cursor = "not-allowed";
6205
6225
  }
6206
6226
  }
6207
- }, m = () => {
6208
- var k, E;
6227
+ }, p = () => {
6228
+ var C, E;
6209
6229
  let b;
6210
- const y = Z(e);
6211
- if (r && l && (i === "S" ? (b = `${r}${(e.type || "FS")[1]}`, y.from = l.id) : i === "F" && (b = `${(e.type || "FS")[0]}${r}`, y.to = l.id)), b && l) {
6212
- y.type = b;
6213
- let C = !1, v = !1;
6214
- i === "S" ? { allowLeft: C, allowRight: v } = this.isAllowStartDrop(l, y.to, y.type, !0) : i === "F" && ({ allowLeft: C, allowRight: v } = this.isAllowEndDrop(l, y.from, y.type, !0)), ((k = y.type) == null ? void 0 : k.slice(1)) === "S" && C || ((E = y.type) == null ? void 0 : E.slice(1)) === "F" && v ? (this.context.event.emit(L.UPDATE_LINK, y), this.context.store.getLinkManager().update()) : this.context.event.emit(L.ERROR, Y.LINK_NOT_ALLOWED);
6230
+ const w = Z(e);
6231
+ if (r && l && (i === "S" ? (b = `${r}${(e.type || "FS")[1]}`, w.from = l.id) : i === "F" && (b = `${(e.type || "FS")[0]}${r}`, w.to = l.id)), b && l) {
6232
+ w.type = b;
6233
+ let k = !1, v = !1, M;
6234
+ i === "S" ? { allowLeft: k, allowRight: v, reason: M } = this.isAllowStartDrop(l, w.to, w.type, !0) : i === "F" && ({ allowLeft: k, allowRight: v, reason: M } = this.isAllowEndDrop(l, w.from, w.type, !0)), ((C = w.type) == null ? void 0 : C.slice(1)) === "S" && k || ((E = w.type) == null ? void 0 : E.slice(1)) === "F" && v ? (this.context.event.emit(L.UPDATE_LINK, w), this.context.store.getLinkManager().update(), this.calculateLinks()) : this.context.event.emit(L.ERROR, M || Y.LINK_NOT_ALLOWED);
6215
6235
  } else
6216
6236
  this.context.event.emit(L.ERROR, Y.TASK_NOT_FOUND);
6217
- this.cleanupTempLink(), this.calculateLinks(l || void 0), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", m);
6237
+ this.cleanupTempLink(), this.calculateLinks([l, this.context.store.getDataManager().getTaskById(e.from), this.context.store.getDataManager().getTaskById(e.to)].filter((k) => !!k)), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p);
6218
6238
  }, u = (b) => {
6219
- b.key === "Escape" && (this.cleanupTempLink(), o == null || o.visible(!0), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", m), document.removeEventListener("keydown", u));
6239
+ b.key === "Escape" && (this.cleanupTempLink(), o == null || o.visible(!0), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p), document.removeEventListener("keydown", u));
6220
6240
  };
6221
- document.addEventListener("mousemove", p), document.addEventListener("mouseup", m), document.addEventListener("keydown", u);
6241
+ document.addEventListener("mousemove", m), document.addEventListener("mouseup", p), document.addEventListener("keydown", u);
6222
6242
  }
6223
6243
  /**
6224
6244
  * 处理连线被点击后的移动
@@ -6239,43 +6259,40 @@ class Ye {
6239
6259
  let r = null;
6240
6260
  const h = this.context.getOptions().header.height, c = this.context.getOptions().row.height, g = c / 2 + h, d = this.context.getOptions().links.gap;
6241
6261
  let l = null;
6242
- const p = () => {
6243
- const x = this.stage.getPointerPosition();
6244
- if (x && (l = this.getTaskByPosition(x), !!l && (this.templateArrow.visible(!0), l.startTime && l.endTime))) {
6245
- const w = this.context.store.getTimeAxis().getTimeLeft(l.startTime), T = this.context.store.getTimeAxis().getTimeLeft(l.endTime), b = (T + w) / 2 + this.offsetX;
6246
- let y = w - d;
6247
- x.x <= b ? r = "S" : (r = "F", y = T + d), this.templateArrow.points([
6262
+ const m = () => {
6263
+ const y = this.stage.getPointerPosition();
6264
+ if (y && (l = this.getTaskByPosition(y), !!l && (this.templateArrow.visible(!0), l.startTime && l.endTime))) {
6265
+ const x = this.context.store.getTimeAxis().getTimeLeft(l.startTime), T = this.context.store.getTimeAxis().getTimeLeft(l.endTime), b = (T + x) / 2 + this.offsetX;
6266
+ let w = x - d;
6267
+ y.x <= b ? r = "S" : (r = "F", w = T + d), this.templateArrow.points([
6248
6268
  ...s,
6249
- y,
6269
+ w,
6250
6270
  g + c * l.flatIndex
6251
6271
  ]);
6252
- const { allowLeft: k, allowRight: E } = this.isAllowEndDrop(l, n, o.convertPointsToLinkType(e, r));
6253
- r === "S" && !k ? this.stage.container().style.cursor = "not-allowed" : r === "F" && !E ? this.stage.container().style.cursor = "not-allowed" : this.stage.container().style.cursor = "pointer";
6272
+ const { allowLeft: C, allowRight: E } = this.isAllowEndDrop(l, n, o.convertPointsToLinkType(e, r));
6273
+ r === "S" && !C ? this.stage.container().style.cursor = "not-allowed" : r === "F" && !E ? this.stage.container().style.cursor = "not-allowed" : this.stage.container().style.cursor = "pointer";
6254
6274
  }
6255
- }, m = () => {
6256
- let x;
6257
- if (r && (x = o.convertPointsToLinkType(e, r)), x && l)
6258
- if (o.isLinkExist(n, l.id, x))
6275
+ }, p = () => {
6276
+ let y;
6277
+ if (r && (y = o.convertPointsToLinkType(e, r)), y && l)
6278
+ if (o.isLinkExist(n, l.id, y))
6259
6279
  this.context.event.emit(L.ERROR, Y.LINK_EXIST);
6260
6280
  else if (n === l.id && e === r)
6261
6281
  this.context.event.emit(L.ERROR, Y.LINK_SAME);
6262
6282
  else {
6263
- const { allowLeft: w, allowRight: T } = this.isAllowEndDrop(l, n, x, !0);
6264
- r === "S" && w || r === "F" && T ? (this.context.event.emit(L.CREATE_LINK, {
6283
+ const { allowLeft: x, allowRight: T, reason: b } = this.isAllowEndDrop(l, n, y, !0);
6284
+ r === "S" && x || r === "F" && T ? (this.context.event.emit(L.CREATE_LINK, {
6265
6285
  from: n,
6266
6286
  to: l.id,
6267
- type: x,
6287
+ type: y,
6268
6288
  color: i
6269
- }), this.context.store.getLinkManager().update()) : this.context.event.emit(
6270
- L.ERROR,
6271
- Y.LINK_NOT_ALLOWED
6272
- );
6289
+ }), this.context.store.getLinkManager().update()) : this.context.event.emit(L.ERROR, b || Y.LINK_NOT_ALLOWED);
6273
6290
  }
6274
- this.cleanupTempLink(), this.calculateLinks(l || void 0), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", m);
6275
- }, u = (x) => {
6276
- x.key === "Escape" && (this.cleanupTempLink(), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", m), document.removeEventListener("keydown", u));
6291
+ this.cleanupTempLink(), this.calculateLinks([l].filter((x) => !!x)), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p);
6292
+ }, u = (y) => {
6293
+ y.key === "Escape" && (this.cleanupTempLink(), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p), document.removeEventListener("keydown", u));
6277
6294
  };
6278
- document.addEventListener("mousemove", p), document.addEventListener("mouseup", m), document.addEventListener("keydown", u);
6295
+ document.addEventListener("mousemove", m), document.addEventListener("mouseup", p), document.addEventListener("keydown", u);
6279
6296
  }
6280
6297
  /**
6281
6298
  * 清理临时连线状态
@@ -6305,8 +6322,9 @@ class Ye {
6305
6322
  )), ht(r) ? n = o = r : V(r) && (n = r === "S", o = r === "F");
6306
6323
  const h = this.validateChain(t.id, e, i, s);
6307
6324
  return {
6308
- allowLeft: n && h,
6309
- allowRight: o && h
6325
+ allowLeft: n && h.ok,
6326
+ allowRight: o && h.ok,
6327
+ reason: h.reason
6310
6328
  };
6311
6329
  }
6312
6330
  /**
@@ -6320,16 +6338,17 @@ class Ye {
6320
6338
  )), ht(r) ? n = o = r : V(r) && (n = r === "S", o = r === "F");
6321
6339
  const h = this.validateChain(e, t.id, i, s);
6322
6340
  return {
6323
- allowLeft: n && h,
6324
- allowRight: o && h
6341
+ allowLeft: n && h.ok,
6342
+ allowRight: o && h.ok,
6343
+ reason: h.reason
6325
6344
  };
6326
6345
  }
6327
6346
  /**
6328
6347
  * 校验连线创建是否合法
6329
6348
  */
6330
6349
  validateChain(t, e, i, s = !1) {
6331
- const o = this.context.store.getLinkManager().validateLink({ from: t, to: e, type: i });
6332
- return o.ok ? !0 : (s && o.reason === Y.LINK_CYCLE && o.cycleInfo && this.highlightCycleNodes(o.cycleInfo.nodes), this.context.event.emit(L.ERROR, o.reason), !1);
6350
+ const o = this.context.store.getLinkManager().validateChain(t, e, i);
6351
+ return o.ok ? { ok: !0 } : (s && o.reason === Y.LINK_CYCLE && o.cycleInfo && this.highlightCycleNodes(o.cycleInfo.nodes), { ok: !1, reason: o.reason });
6333
6352
  }
6334
6353
  /**
6335
6354
  * 操作高亮关联线
@@ -6447,61 +6466,61 @@ class Ue {
6447
6466
  ), g = this.context.getOptions().baselines.offset ?? 0;
6448
6467
  h.forEach((d, l) => {
6449
6468
  if (!d.validate()) return;
6450
- const p = this.context.store.getTimeAxis().getTimeLeft(d.startTime), m = this.context.store.getTimeAxis().getTimeLeft(d.endTime), u = new S.Group({ id: `baseline-group-${d.id}` });
6451
- this.renderBaselineBar(u, r, d, p, m, i, e, c, t, o, n, s, g);
6452
- const x = this.context.getOptions().baselines.compare, w = d.getTimeDiff();
6453
- if (!x.enabled || !w) return;
6454
- const T = x.mode;
6455
- d.highlight && (T === "highlight" || T === "both") && this.renderCompareHighlight(u, r, d, w), l === 0 && (T === "indicator" || T === "both") && this.renderCompareIndicator(r, d, w), this.bindEvents(u, r, d), this.baselineGroup.add(u);
6469
+ const m = this.context.store.getTimeAxis().getTimeLeft(d.startTime), p = this.context.store.getTimeAxis().getTimeLeft(d.endTime), u = new S.Group({ id: `baseline-group-${d.id}` });
6470
+ this.renderBaselineBar(u, r, d, m, p, i, e, c, t, o, n, s, g), this.baselineGroup.add(u);
6471
+ const y = this.context.getOptions().baselines.compare, x = d.getTimeDiff();
6472
+ if (!y.enabled || !x) return;
6473
+ const T = y.mode;
6474
+ d.highlight && (T === "highlight" || T === "both") && this.renderCompareHighlight(u, r, d, x), l === 0 && (T === "indicator" || T === "both") && this.renderCompareIndicator(r, d, x), this.bindEvents(u, r, d);
6456
6475
  });
6457
6476
  }
6458
6477
  });
6459
6478
  }
6460
- renderBaselineBar(t, e, i, s, n, o, r, h, c, g, d, l, p) {
6479
+ renderBaselineBar(t, e, i, s, n, o, r, h, c, g, d, l, m) {
6461
6480
  if (this.context.getOptions().baselines.mode === "shadow") {
6462
- const m = o + r * e.flatIndex - h / 2 + p, u = new S.Rect({
6481
+ const p = o + r * e.flatIndex - h / 2 + m, u = new S.Rect({
6463
6482
  id: `baseline-item-${i.id}`,
6464
6483
  x: s,
6465
- y: m,
6484
+ y: p,
6466
6485
  width: n - s,
6467
6486
  height: h,
6468
6487
  cornerRadius: l,
6469
6488
  fill: g,
6470
6489
  opacity: d
6471
6490
  });
6472
- t.add(u), this.renderText(t, e, i, s, n, m, h);
6491
+ t.add(u), this.renderText(t, e, i, s, n, p, h);
6473
6492
  } else if (this.context.getOptions().baselines.mode === "line") {
6474
- const m = nt(this.context.getOptions().baselines.height ?? 5, r);
6475
- let u = c + r * e.flatIndex + p;
6476
- const x = this.context.getOptions().baselines.position;
6477
- let w = "";
6478
- x === "top" ? (u += +m / 2, w = "line_top") : x === "center" ? (u += r / 2, w = "line_center") : (u += r - m / 2, w = "line_bottom");
6493
+ const p = nt(this.context.getOptions().baselines.height ?? 5, r);
6494
+ let u = c + r * e.flatIndex + m;
6495
+ const y = this.context.getOptions().baselines.position;
6496
+ let x = "";
6497
+ y === "top" ? (u += +p / 2, x = "line_top") : y === "center" ? (u += r / 2, x = "line_center") : (u += r - p / 2, x = "line_bottom");
6479
6498
  const T = new S.Line({
6480
6499
  id: `baseline-item-${i.id}`,
6481
6500
  points: [s, u, n, u],
6482
6501
  stroke: g,
6483
6502
  opacity: d,
6484
- strokeWidth: m,
6503
+ strokeWidth: p,
6485
6504
  lineCap: "butt",
6486
6505
  lineJoin: "round"
6487
6506
  });
6488
- t.add(T), this.renderText(t, e, i, s, n, u, m, w);
6507
+ t.add(T), this.renderText(t, e, i, s, n, u, p, x);
6489
6508
  }
6490
6509
  }
6491
6510
  renderText(t, e, i, s, n, o, r, h) {
6492
6511
  const c = `chart-baseline-text-${i.id}`;
6493
6512
  if ((() => {
6494
- this.baselineGroup.find(`#${c}`) && this.baselineGroup.find(`#${c}`).forEach((w) => w.remove());
6513
+ this.baselineGroup.find(`#${c}`) && this.baselineGroup.find(`#${c}`).forEach((x) => x.remove());
6495
6514
  })(), !this.context.getOptions().baselines.label.show) return;
6496
6515
  const d = this.context.getOptions().baselines.label.field, l = d ? i.getField(d) : i.name;
6497
6516
  if (!l || l === "") return;
6498
- const p = n - s - 10, m = Math.max(this.context.getOptions().baselines.label.fontSize, r), u = new S.Text({
6517
+ const m = n - s - 10, p = Math.max(this.context.getOptions().baselines.label.fontSize, r), u = new S.Text({
6499
6518
  text: l,
6500
6519
  id: c,
6501
6520
  x: s + 5,
6502
6521
  y: o,
6503
- width: p,
6504
- height: m,
6522
+ width: m,
6523
+ height: p,
6505
6524
  fill: this.context.getOptions().baselines.label.color,
6506
6525
  fontSize: this.context.getOptions().baselines.label.fontSize,
6507
6526
  fontFamily: this.context.getOptions().baselines.label.fontFamily || "Arial",
@@ -6509,19 +6528,19 @@ class Ue {
6509
6528
  verticalAlign: "bottom"
6510
6529
  });
6511
6530
  h === "line_bottom" ? u.setAttrs({
6512
- y: o - m / 2,
6531
+ y: o - p / 2,
6513
6532
  verticalAlign: "top"
6514
6533
  }) : h === "line_center" ? u.setAttrs({
6515
- y: o - m / 2,
6534
+ y: o - p / 2,
6516
6535
  verticalAlign: "middle"
6517
6536
  }) : h === "line_top" && u.setAttrs({
6518
6537
  y: o - r / 2,
6519
6538
  verticalAlign: "bottom"
6520
- }), r >= m && u.setAttrs({
6539
+ }), r >= p && u.setAttrs({
6521
6540
  verticalAlign: "middle"
6522
6541
  });
6523
- const x = u.measureSize(l);
6524
- (this.context.getOptions().baselines.label.forceDisplay || p > x.width) && t.add(u);
6542
+ const y = u.measureSize(l);
6543
+ (this.context.getOptions().baselines.label.forceDisplay || m > y.width) && t.add(u);
6525
6544
  }
6526
6545
  renderCompareHighlight(t, e, i, s) {
6527
6546
  const n = s[`${this.context.getOptions().baselines.compare.target}Status`];
@@ -6548,44 +6567,44 @@ class Ue {
6548
6567
  const g = this.context.store.getTimeAxis().getTimeLeft(t.startTime), d = this.context.store.getTimeAxis().getTimeLeft(t.endTime);
6549
6568
  let l = (r - h) / 2 + r * t.flatIndex + o;
6550
6569
  if (n.position === "bottom" && (l += h), n.show === "start" || n.show === "both" || n.show === !0) {
6551
- const p = i.startStatus;
6552
- if (p && s.compare.indicator[p].show) {
6553
- c = B(s.compare.indicator[p].color).alpha(s.compare.indicator[p].opacity).toHex();
6554
- const m = new S.Circle({
6570
+ const m = i.startStatus;
6571
+ if (m && s.compare.indicator[m].show) {
6572
+ c = B(s.compare.indicator[m].color).alpha(s.compare.indicator[m].opacity).toHex();
6573
+ const p = new S.Circle({
6555
6574
  x: g - n.size,
6556
6575
  y: l,
6557
6576
  fill: c,
6558
6577
  radius: n.size / 2
6559
6578
  });
6560
- this.indicatorGroup.add(m);
6561
- let u = `${gt(i.startDiff)}${i.unit} ${p}`;
6562
- const x = s.compare.indicator[p].text;
6563
- j(x) ? u = x(i.startDiff, { ...t.getEmitData(), baseline: e }) : V(x) && (u = x);
6564
- const w = new S.Text({
6579
+ this.indicatorGroup.add(p);
6580
+ let u = `${gt(i.startDiff)}${i.unit} ${m}`;
6581
+ const y = s.compare.indicator[m].text;
6582
+ j(y) ? u = y(i.startDiff, { ...t.getEmitData(), baseline: e }) : V(y) && (u = y);
6583
+ const x = new S.Text({
6565
6584
  y: l - n.fontSize / 2,
6566
6585
  text: u,
6567
6586
  fill: c,
6568
6587
  fontSize: n.fontSize,
6569
6588
  fontFamily: n.fontFamily || "Arial"
6570
- }), T = w.measureSize(u);
6571
- w.x(g - n.size - T.width - 5), this.indicatorGroup.add(w);
6589
+ }), T = x.measureSize(u);
6590
+ x.x(g - n.size - T.width - 5), this.indicatorGroup.add(x);
6572
6591
  }
6573
6592
  }
6574
6593
  if (n.show === "end" || n.show === "both" || n.show === !0) {
6575
- const p = i.endStatus;
6576
- if (p && s.compare.indicator[p].show) {
6577
- c = B(s.compare.indicator[p].color).alpha(s.compare.indicator[p].opacity).toHex();
6578
- const m = new S.Circle({
6594
+ const m = i.endStatus;
6595
+ if (m && s.compare.indicator[m].show) {
6596
+ c = B(s.compare.indicator[m].color).alpha(s.compare.indicator[m].opacity).toHex();
6597
+ const p = new S.Circle({
6579
6598
  x: d + n.size,
6580
6599
  y: l,
6581
6600
  fill: c,
6582
6601
  radius: n.size / 2
6583
6602
  });
6584
- this.indicatorGroup.add(m);
6585
- let u = `${gt(i.endDiff)}${i.unit} ${p}`;
6586
- const x = s.compare.indicator[p].text;
6587
- j(x) ? u = x(i.endDiff, { ...t.getEmitData(), baseline: e }) : V(x) && (u = x);
6588
- const w = new S.Text({
6603
+ this.indicatorGroup.add(p);
6604
+ let u = `${gt(i.endDiff)}${i.unit} ${m}`;
6605
+ const y = s.compare.indicator[m].text;
6606
+ j(y) ? u = y(i.endDiff, { ...t.getEmitData(), baseline: e }) : V(y) && (u = y);
6607
+ const x = new S.Text({
6589
6608
  x: d + n.size + 5,
6590
6609
  y: l - n.fontSize / 2,
6591
6610
  text: u,
@@ -6593,7 +6612,7 @@ class Ue {
6593
6612
  fontSize: n.fontSize,
6594
6613
  fontFamily: n.fontFamily || "Arial"
6595
6614
  });
6596
- this.indicatorGroup.add(w);
6615
+ this.indicatorGroup.add(x);
6597
6616
  }
6598
6617
  }
6599
6618
  }
@@ -6685,18 +6704,18 @@ class Ke {
6685
6704
  this.initialWidth = i.getColumnWidth(c);
6686
6705
  const g = this.initialX;
6687
6706
  this.root.event.emit(L.SHOW_GUIDELINE, g);
6688
- const d = (p) => o(p), l = (p) => r(p, d, l);
6707
+ const d = (m) => o(m), l = (m) => r(m, d, l);
6689
6708
  document.addEventListener("mousemove", d), document.addEventListener("mouseup", l);
6690
6709
  }, o = (h) => {
6691
6710
  if (h.preventDefault(), !e) return;
6692
6711
  const c = h.clientX - t;
6693
6712
  s[s.length - 1].key;
6694
- const g = 50 - this.initialWidth, l = e.width - 20 - this.initialX, p = Math.max(g, Math.min(l, c)), m = this.initialX + p;
6695
- this.root.event.emit(L.MOVE_GUIDELINE, m);
6713
+ const g = 50 - this.initialWidth, l = e.width - 20 - this.initialX, m = Math.max(g, Math.min(l, c)), p = this.initialX + m;
6714
+ this.root.event.emit(L.MOVE_GUIDELINE, p);
6696
6715
  }, r = (h, c, g) => {
6697
6716
  document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", g), this.root.event.emit(L.HIDE_GUIDELINE);
6698
- const d = h.clientX - t, l = s[s.length - 1].key, p = Math.max(50, this.initialWidth + d);
6699
- i.setColumnWidth(l, p), this.root.event.emit(L.UPDATE_TABLE_HEADER);
6717
+ const d = h.clientX - t, l = s[s.length - 1].key, m = Math.max(50, this.initialWidth + d);
6718
+ i.setColumnWidth(l, m), this.root.event.emit(L.UPDATE_TABLE_HEADER);
6700
6719
  };
6701
6720
  this.line.addEventListener("mousedown", n);
6702
6721
  }
@@ -7115,7 +7134,7 @@ class Je {
7115
7134
  * @return {boolean} 是否成功跳转
7116
7135
  */
7117
7136
  jumpTo(t) {
7118
- const e = I(t);
7137
+ const e = G(t);
7119
7138
  if (!this.store.getTimeAxis().isInTimeAxis(e)) return !1;
7120
7139
  const i = this.store.getTimeAxis().getTimeLeft(e) - 100;
7121
7140
  return this.renderer.getScrollbar().scrollTo({ x: Math.max(i, 0) }), !0;