zegantt 0.2.5 → 0.2.7

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/zegantt.css CHANGED
@@ -1 +1 @@
1
- @keyframes zg-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes zg-dash{to{stroke-dashoffset:-13}}.zg-no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.zg-no-scrollbar::-webkit-scrollbar{display:none}.zg-popup-btn{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;padding:8px 10px;border-radius:7px;border:none;background:transparent;cursor:pointer;font-size:13px;font-weight:500;color:#4f4f4f;text-align:left;transition:background .12s}.zg-popup-btn:hover{background:#f2f5f3}.zg-popup-btn-danger{color:#ef4444}.zg-popup-btn-danger:hover{background:#fef2f2}
1
+ @keyframes zg-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes zg-dash{to{stroke-dashoffset:-13}}.zg-no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.zg-no-scrollbar::-webkit-scrollbar{display:none}.zg-popup-btn{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;padding:8px 10px;border-radius:7px;border:none;background:transparent;cursor:pointer;font-size:13px;font-weight:500;color:#4f4f4f;text-align:left;transition:background .12s}.zg-popup-btn:hover{background:#f2f5f3}.zg-popup-btn span{flex:1;text-align:left}.zg-popup-btn-danger{color:#ef4444}.zg-popup-btn-danger:hover{background:#fef2f2}
package/dist/zegantt.js CHANGED
@@ -100,7 +100,7 @@ function xt() {
100
100
  newActionOpen: b,
101
101
  setNewActionOpen: M,
102
102
  newActionRef: I
103
- } = Te(), { projectName: y, onAddNewStage: D, onAddMilestone: m, onAddEvent: $, onAddNote: w } = n, z = (i) => {
103
+ } = Te(), { projectName: y, onAddNewStage: D, onAddMilestone: m, onAddEvent: $, onAddNote: w } = n, A = (i) => {
104
104
  v((a) => {
105
105
  const S = new Set(a);
106
106
  return S.has(i) ? S.delete(i) : S.add(i), S;
@@ -168,7 +168,7 @@ function xt() {
168
168
  return /* @__PURE__ */ r(
169
169
  "button",
170
170
  {
171
- onClick: () => z(i.type),
171
+ onClick: () => A(i.type),
172
172
  style: {
173
173
  display: "flex",
174
174
  alignItems: "center",
@@ -303,7 +303,7 @@ function xt() {
303
303
  }
304
304
  );
305
305
  }
306
- const Ve = 864e5, Z = (n, g) => new Date(n.getTime() + g * Ve), fe = (n, g) => Math.round((g.getTime() - n.getTime()) / Ve), Oe = (n) => new Date(n.getFullYear(), n.getMonth(), 1), Ae = (n) => new Date(n.getFullYear(), n.getMonth() + 1, 0), Q = (n) => `${String(n.getDate()).padStart(2, "0")}/${String(n.getMonth() + 1).padStart(2, "0")}/${n.getFullYear()}`, Xe = (n, g = "en") => new Intl.DateTimeFormat(g, { month: "long" }).format(n).toUpperCase();
306
+ const Ve = 864e5, Z = (n, g) => new Date(n.getTime() + g * Ve), fe = (n, g) => Math.round((g.getTime() - n.getTime()) / Ve), Oe = (n) => new Date(n.getFullYear(), n.getMonth(), 1), ze = (n) => new Date(n.getFullYear(), n.getMonth() + 1, 0), Q = (n) => `${String(n.getDate()).padStart(2, "0")}/${String(n.getMonth() + 1).padStart(2, "0")}/${n.getFullYear()}`, Xe = (n, g = "en") => new Intl.DateTimeFormat(g, { month: "long" }).format(n).toUpperCase();
307
307
  function bt() {
308
308
  const {
309
309
  props: n,
@@ -320,7 +320,7 @@ function bt() {
320
320
  delayedIds: m,
321
321
  criticalIds: $,
322
322
  relatedIds: w
323
- } = Te(), z = (i) => ({
323
+ } = Te(), A = (i) => ({
324
324
  id: i.id,
325
325
  name: i.name,
326
326
  start: i.start,
@@ -328,7 +328,7 @@ function bt() {
328
328
  type: i.originalType === "step" ? "task" : "milestone",
329
329
  progress: i.progress
330
330
  });
331
- return /* @__PURE__ */ r("div", { style: { width: ut, flexShrink: 0, borderRight: `1px solid ${e.border}` }, children: [
331
+ return /* @__PURE__ */ r("div", { style: { width: ut, flexShrink: 0, borderRight: `1px solid ${e.border}`, display: "flex", flexDirection: "column", height: "100%" }, children: [
332
332
  /* @__PURE__ */ r(
333
333
  "div",
334
334
  {
@@ -355,7 +355,7 @@ function bt() {
355
355
  onScroll: u,
356
356
  className: "zg-no-scrollbar",
357
357
  style: { overflowY: "auto", overflowX: "hidden", flex: 1 },
358
- children: h.map((i) => {
358
+ children: /* @__PURE__ */ t("div", { style: { height: Math.max(h.length * X, 400) + 80, position: "relative" }, children: h.map((i) => {
359
359
  if (i.kind === "projectHeader")
360
360
  return /* @__PURE__ */ t(
361
361
  "div",
@@ -432,7 +432,7 @@ function bt() {
432
432
  opacity: d ? 0.3 : 1
433
433
  },
434
434
  onClick: () => D((F) => F === a.id ? null : a.id),
435
- onDoubleClick: () => n.onTaskClick?.(z(a)),
435
+ onDoubleClick: () => n.onTaskClick?.(A(a)),
436
436
  onMouseEnter: () => I(a.id),
437
437
  onMouseLeave: () => I(null),
438
438
  children: [
@@ -489,7 +489,7 @@ function bt() {
489
489
  },
490
490
  a.id
491
491
  );
492
- })
492
+ }) })
493
493
  }
494
494
  )
495
495
  ] });
@@ -509,7 +509,7 @@ function mt(n, g, h = "en") {
509
509
  return { daysArr: S, todayIndex: R };
510
510
  };
511
511
  if (n.length === 0) {
512
- const i = /* @__PURE__ */ new Date(), a = Oe(i), S = Ae(i), p = fe(a, S) + 1, { daysArr: R, todayIndex: f } = u(a, p);
512
+ const i = /* @__PURE__ */ new Date(), a = Oe(i), S = ze(i), p = fe(a, S) + 1, { daysArr: R, todayIndex: f } = u(a, p);
513
513
  return {
514
514
  start: a,
515
515
  end: S,
@@ -526,10 +526,10 @@ function mt(n, g, h = "en") {
526
526
  n.forEach((i) => {
527
527
  i.start < v && (v = new Date(i.start)), i.end > b && (b = new Date(i.end));
528
528
  });
529
- const M = Oe(Z(v, -14)), I = Ae(Z(b, 14)), y = fe(M, I) + 1, D = [];
529
+ const M = Oe(Z(v, -14)), I = ze(Z(b, 14)), y = fe(M, I) + 1, D = [];
530
530
  let m = new Date(M);
531
531
  for (; m <= I; ) {
532
- const i = Ae(m), a = i > I ? I : i, S = fe(M, m), p = fe(m, a) + 1;
532
+ const i = ze(m), a = i > I ? I : i, S = fe(M, m), p = fe(m, a) + 1;
533
533
  D.push({
534
534
  date: new Date(m),
535
535
  label: `${Xe(m, h)} ${m.getFullYear()}`,
@@ -538,16 +538,16 @@ function mt(n, g, h = "en") {
538
538
  width: p * k
539
539
  }), m = new Date(m.getFullYear(), m.getMonth() + 1, 1);
540
540
  }
541
- const { daysArr: $, todayIndex: w } = u(M, y), z = [];
541
+ const { daysArr: $, todayIndex: w } = u(M, y), A = [];
542
542
  if (g === "month") {
543
543
  let i = "", a = 0;
544
544
  for (const S of D) {
545
545
  const p = S.date.getFullYear().toString();
546
- p !== i ? (i && z.push({ label: i, width: a * k }), i = p, a = S.days) : a += S.days;
546
+ p !== i ? (i && A.push({ label: i, width: a * k }), i = p, a = S.days) : a += S.days;
547
547
  }
548
- i && z.push({ label: i, width: a * k });
548
+ i && A.push({ label: i, width: a * k });
549
549
  }
550
- return { start: M, end: I, totalDays: y, dayWidth: k, totalWidth: y * k, months: D, years: z, days: $, todayIndex: w };
550
+ return { start: M, end: I, totalDays: y, dayWidth: k, totalWidth: y * k, months: D, years: A, days: $, todayIndex: w };
551
551
  }
552
552
  function ie(n, g) {
553
553
  return fe(g.start, n) * g.dayWidth;
@@ -567,7 +567,7 @@ function vt({
567
567
  showDots: m,
568
568
  isBarDimmed: $,
569
569
  isBarHighlighted: w,
570
- commonEvents: z,
570
+ commonEvents: A,
571
571
  handleResizeMouseDown: i,
572
572
  handleConnectDotMouseDown: a
573
573
  }) {
@@ -598,7 +598,7 @@ function vt({
598
598
  "div",
599
599
  {
600
600
  "data-task-id": n.id,
601
- ...z,
601
+ ...A,
602
602
  style: {
603
603
  position: "absolute",
604
604
  left: g,
@@ -662,7 +662,7 @@ function vt({
662
662
  "div",
663
663
  {
664
664
  "data-task-id": n.id,
665
- ...z,
665
+ ...A,
666
666
  style: {
667
667
  position: "absolute",
668
668
  left: g - 6,
@@ -704,7 +704,7 @@ function vt({
704
704
  "div",
705
705
  {
706
706
  "data-task-id": n.id,
707
- ...z,
707
+ ...A,
708
708
  style: {
709
709
  position: "absolute",
710
710
  left: g - 6,
@@ -746,7 +746,7 @@ function vt({
746
746
  "div",
747
747
  {
748
748
  "data-task-id": n.id,
749
- ...z,
749
+ ...A,
750
750
  style: {
751
751
  position: "absolute",
752
752
  left: g,
@@ -891,7 +891,7 @@ function St() {
891
891
  depModalLag: m,
892
892
  setDepModalLag: $,
893
893
  depCreating: w,
894
- deletingDepId: z,
894
+ deletingDepId: A,
895
895
  setDeletingDepId: i,
896
896
  chartMenu: a,
897
897
  setChartMenu: S,
@@ -997,10 +997,10 @@ function St() {
997
997
  /* @__PURE__ */ r("div", { style: { position: "absolute", inset: 0 }, children: [
998
998
  k.map((o, l) => {
999
999
  if (o.kind !== "task") return null;
1000
- const c = o.task, E = u?.task.id === c.id, W = v?.task.id === c.id, L = E || W && v.edge === "left" ? Z(c.start, E ? u.offsetDays : v.offsetDays) : c.start, A = E || W && v.edge === "right" ? Z(c.end, E ? u.offsetDays : v.offsetDays) : c.end, he = c.originalType !== "step";
1000
+ const c = o.task, E = u?.task.id === c.id, W = v?.task.id === c.id, L = E || W && v.edge === "left" ? Z(c.start, E ? u.offsetDays : v.offsetDays) : c.start, z = E || W && v.edge === "right" ? Z(c.end, E ? u.offsetDays : v.offsetDays) : c.end, he = c.originalType !== "step";
1001
1001
  let oe = ie(L, h), H = 0, je = 0;
1002
- he || (H = Math.max(ie(A, h) - oe, h.dayWidth), je = H * (c.progress / 100));
1003
- const Pe = P === c.id, ze = U === c.id, Ue = ae.has(c.id), qe = G.has(c.id), Ke = !!U && !ze && !ge.has(c.id), Je = ze || !!U && ge.has(c.id), Qe = b?.hoverTargetId === c.id, Ze = Pe || ze, et = l * X;
1002
+ he || (H = Math.max(ie(z, h) - oe, h.dayWidth), je = H * (c.progress / 100));
1003
+ const Pe = P === c.id, Ae = U === c.id, Ue = ae.has(c.id), qe = G.has(c.id), Ke = !!U && !Ae && !ge.has(c.id), Je = Ae || !!U && ge.has(c.id), Qe = b?.hoverTargetId === c.id, Ze = Pe || Ae, et = l * X;
1004
1004
  return /* @__PURE__ */ t(
1005
1005
  vt,
1006
1006
  {
@@ -1169,13 +1169,13 @@ function St() {
1169
1169
  }
1170
1170
  ),
1171
1171
  _.task && _.isOpen && (() => {
1172
- const o = _.task, l = (n.dependencies || []).filter((A) => A.predecessorId === o.id || A.successorId === o.id), c = { FS: C("gantt.depType.fs", "Finish to Start"), SS: C("gantt.depType.ss", "Start to Start"), FF: C("gantt.depType.ff", "Finish to Finish"), SF: C("gantt.depType.sf", "Start to Finish") }, E = l.length > 0 ? 300 : 220, W = Math.min(_.position.x, window.innerWidth - E - 16), L = _.position.y + 8;
1172
+ const o = _.task, l = (n.dependencies || []).filter((z) => z.predecessorId === o.id || z.successorId === o.id), c = { FS: C("gantt.depType.fs", "Finish to Start"), SS: C("gantt.depType.ss", "Start to Start"), FF: C("gantt.depType.ff", "Finish to Finish"), SF: C("gantt.depType.sf", "Start to Finish") }, E = l.length > 0 ? 300 : 220, W = Math.min(_.position.x, window.innerWidth - E - 16), L = _.position.y + 8;
1173
1173
  return /* @__PURE__ */ r(
1174
1174
  "div",
1175
1175
  {
1176
1176
  "data-popup": "gantt-action",
1177
1177
  style: { position: "fixed", left: W, top: L, zIndex: 9999, background: "#fff", borderRadius: 4, boxShadow: "0 12px 40px rgba(0,0,0,0.14), 0 3px 10px rgba(0,0,0,0.07)", border: `1.5px solid ${e.borderLight}`, width: E, overflow: "hidden" },
1178
- onMouseDown: (A) => A.stopPropagation(),
1178
+ onMouseDown: (z) => z.stopPropagation(),
1179
1179
  children: [
1180
1180
  /* @__PURE__ */ t("div", { style: { padding: "12px 14px 10px", borderBottom: `1px solid ${e.borderLight}` }, children: /* @__PURE__ */ t("p", { style: { fontSize: 13, fontWeight: 700, color: e.group, margin: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: o.name, children: o.name }) }),
1181
1181
  /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: 2, padding: "8px 6px" }, children: [
@@ -1184,21 +1184,21 @@ function St() {
1184
1184
  }, className: "zg-popup-btn", children: [
1185
1185
  /* @__PURE__ */ t(at, { size: 15 }),
1186
1186
  " ",
1187
- /* @__PURE__ */ t("span", { children: C("gantt.popup.viewDetails", "View details") })
1187
+ /* @__PURE__ */ t("span", { style: { flex: 1, textAlign: "left" }, children: C("gantt.popup.viewDetails", "View details") })
1188
1188
  ] }),
1189
1189
  /* @__PURE__ */ r("button", { onClick: () => {
1190
1190
  B?.(We(o)), ve();
1191
1191
  }, className: "zg-popup-btn", children: [
1192
1192
  /* @__PURE__ */ t(st, { size: 15 }),
1193
1193
  " ",
1194
- /* @__PURE__ */ t("span", { children: C("gantt.popup.edit", "Edit") })
1194
+ /* @__PURE__ */ t("span", { style: { flex: 1, textAlign: "left" }, children: C("gantt.popup.edit", "Edit") })
1195
1195
  ] }),
1196
1196
  /* @__PURE__ */ r("button", { onClick: () => {
1197
1197
  O?.(o.id), ve();
1198
1198
  }, className: "zg-popup-btn zg-popup-btn-danger", children: [
1199
1199
  /* @__PURE__ */ t(dt, { size: 15 }),
1200
1200
  " ",
1201
- /* @__PURE__ */ t("span", { children: C("gantt.popup.delete", "Delete") })
1201
+ /* @__PURE__ */ t("span", { style: { flex: 1, textAlign: "left" }, children: C("gantt.popup.delete", "Delete") })
1202
1202
  ] })
1203
1203
  ] }),
1204
1204
  l.length > 0 && /* @__PURE__ */ r("div", { style: { borderTop: `1px solid ${e.borderLight}`, padding: "10px 14px 12px" }, children: [
@@ -1208,15 +1208,15 @@ function St() {
1208
1208
  l.length,
1209
1209
  ")"
1210
1210
  ] }),
1211
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 5 }, children: l.map((A) => {
1212
- const he = A.predecessorId === o.id, oe = he ? A.successorName : A.predecessorName, H = z === A.id;
1211
+ /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 5 }, children: l.map((z) => {
1212
+ const he = z.predecessorId === o.id, oe = he ? z.successorName : z.predecessorName, H = A === z.id;
1213
1213
  return /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: 8, padding: "6px 8px", borderRadius: 8, background: "#f8fafb", border: `1px solid ${e.borderLight}` }, children: [
1214
1214
  /* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: [
1215
1215
  /* @__PURE__ */ r("div", { style: { fontSize: 10, fontWeight: 700, color: e.group, marginBottom: 2 }, children: [
1216
- /* @__PURE__ */ t("span", { style: { background: `${e.group}15`, borderRadius: 4, padding: "1px 5px" }, children: A.type }),
1216
+ /* @__PURE__ */ t("span", { style: { background: `${e.group}15`, borderRadius: 4, padding: "1px 5px" }, children: z.type }),
1217
1217
  " ",
1218
1218
  /* @__PURE__ */ t("span", { style: { color: e.textSecondary, fontWeight: 500 }, children: he ? "→ " : "← " }),
1219
- /* @__PURE__ */ t("span", { style: { color: e.textMuted, fontWeight: 400, fontSize: 9 }, children: c[A.type] ?? A.type })
1219
+ /* @__PURE__ */ t("span", { style: { color: e.textMuted, fontWeight: 400, fontSize: 9 }, children: c[z.type] ?? z.type })
1220
1220
  ] }),
1221
1221
  /* @__PURE__ */ t("div", { style: { fontSize: 11, color: e.textPrimary, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: oe, children: oe })
1222
1222
  ] }),
@@ -1225,9 +1225,9 @@ function St() {
1225
1225
  {
1226
1226
  disabled: !!H,
1227
1227
  onClick: async () => {
1228
- i(A.id);
1228
+ i(z.id);
1229
1229
  try {
1230
- await be(A.id);
1230
+ await be(z.id);
1231
1231
  } finally {
1232
1232
  i(null);
1233
1233
  }
@@ -1236,7 +1236,7 @@ function St() {
1236
1236
  children: H ? "⟳" : "🗑"
1237
1237
  }
1238
1238
  )
1239
- ] }, A.id);
1239
+ ] }, z.id);
1240
1240
  }) })
1241
1241
  ] })
1242
1242
  ]
@@ -1370,8 +1370,8 @@ function It(n, g, h, k) {
1370
1370
  if (!b || !M) return null;
1371
1371
  const I = k.get(b.id), y = k.get(M.id);
1372
1372
  if (I == null || y == null) return null;
1373
- const D = b.originalType !== "step", m = M.originalType !== "step", $ = D ? ie(b.start, h) + Le : ie(b.end, h), w = I * X + X / 2, z = m ? ie(M.start, h) - 10 : ie(M.start, h), i = y * X + X / 2, a = 14, S = Math.max($ + a, z - a), p = w === i ? `M${$},${w} L${z - 6},${i}` : `M${$},${w} L${S},${w} L${S},${i} L${z - 6},${i}`;
1374
- return { predId: b.id, succId: M.id, path: p, headX: z - 6, headY: i };
1373
+ const D = b.originalType !== "step", m = M.originalType !== "step", $ = D ? ie(b.start, h) + Le : ie(b.end, h), w = I * X + X / 2, A = m ? ie(M.start, h) - 10 : ie(M.start, h), i = y * X + X / 2, a = 14, S = Math.max($ + a, A - a), p = w === i ? `M${$},${w} L${A - 6},${i}` : `M${$},${w} L${S},${w} L${S},${i} L${A - 6},${i}`;
1374
+ return { predId: b.id, succId: M.id, path: p, headX: A - 6, headY: i };
1375
1375
  }).filter(Boolean);
1376
1376
  }
1377
1377
  function Tt(n, g) {
@@ -1401,12 +1401,12 @@ function Tt(n, g) {
1401
1401
  $.forEach((p) => {
1402
1402
  p > w && (w = p);
1403
1403
  });
1404
- const z = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
1404
+ const A = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
1405
1405
  for (let p = y.length - 1; p >= 0; p--) {
1406
1406
  const R = y[p], f = h.get(R), T = v.get(R) || [];
1407
1407
  let d = w;
1408
- for (const x of T) d = Math.min(d, z.get(x) ?? w);
1409
- i.set(R, T.length > 0 ? d : w), z.set(R, (i.get(R) || 0) - M(f));
1408
+ for (const x of T) d = Math.min(d, A.get(x) ?? w);
1409
+ i.set(R, T.length > 0 ? d : w), A.set(R, (i.get(R) || 0) - M(f));
1410
1410
  }
1411
1411
  const a = /* @__PURE__ */ new Set();
1412
1412
  u.forEach((p) => {
@@ -1415,7 +1415,7 @@ function Tt(n, g) {
1415
1415
  const S = /* @__PURE__ */ new Set();
1416
1416
  for (const p of y) {
1417
1417
  if (!a.has(p)) continue;
1418
- const R = (z.get(p) || 0) - (m.get(p) || 0);
1418
+ const R = (A.get(p) || 0) - (m.get(p) || 0);
1419
1419
  Math.abs(R) < 0.5 && S.add(p);
1420
1420
  }
1421
1421
  return S;
@@ -1515,7 +1515,7 @@ function Mt({
1515
1515
  projectTitle: d.projectTitle || void 0
1516
1516
  });
1517
1517
  }), f;
1518
- }, [n, g, h, k, u]), w = re(() => mt($, v, b), [$, v, b]), z = re(() => {
1518
+ }, [n, g, h, k, u]), w = re(() => mt($, v, b), [$, v, b]), A = re(() => {
1519
1519
  const f = [], T = ["step", "milestone", "event", "note"];
1520
1520
  if (M) {
1521
1521
  const d = /* @__PURE__ */ new Map();
@@ -1546,10 +1546,10 @@ function Mt({
1546
1546
  return f;
1547
1547
  }, [$, I, y, D, M]), i = re(() => {
1548
1548
  const f = /* @__PURE__ */ new Map();
1549
- return z.forEach((T, d) => {
1549
+ return A.forEach((T, d) => {
1550
1550
  T.kind === "task" && f.set(T.task.id, d);
1551
1551
  }), f;
1552
- }, [z]), a = re(
1552
+ }, [A]), a = re(
1553
1553
  () => It($, u || [], w, i),
1554
1554
  [$, u, w, i]
1555
1555
  ), S = re(() => Tt($, u || []), [$, u]), p = re(() => {
@@ -1570,7 +1570,7 @@ function Mt({
1570
1570
  return {
1571
1571
  tasks: $,
1572
1572
  timeline: w,
1573
- displayRows: z,
1573
+ displayRows: A,
1574
1574
  taskRowIndex: i,
1575
1575
  arrows: a,
1576
1576
  criticalIds: S,
@@ -1583,7 +1583,7 @@ function Ft(n) {
1583
1583
  isOpen: !1,
1584
1584
  position: { x: 0, y: 0 },
1585
1585
  task: null
1586
- }), [m, $] = j(null), [w, z] = j(null), [i, a] = j(null), [S, p] = j(null), [R, f] = j("FS"), [T, d] = j(0), [x, P] = j(!1), [F, U] = j(null), [N, s] = j(null), [Y, _] = j(!1), q = ce(null), [G, ae] = j(/* @__PURE__ */ new Set(["step", "milestone", "event", "note"])), [ge, Me] = j(/* @__PURE__ */ new Set()), [ye, De] = j(/* @__PURE__ */ new Set()), Re = J((o) => {
1586
+ }), [m, $] = j(null), [w, A] = j(null), [i, a] = j(null), [S, p] = j(null), [R, f] = j("FS"), [T, d] = j(0), [x, P] = j(!1), [F, U] = j(null), [N, s] = j(null), [Y, _] = j(!1), q = ce(null), [G, ae] = j(/* @__PURE__ */ new Set(["step", "milestone", "event", "note"])), [ge, Me] = j(/* @__PURE__ */ new Set()), [ye, De] = j(/* @__PURE__ */ new Set()), Re = J((o) => {
1587
1587
  ae((l) => {
1588
1588
  const c = new Set(l);
1589
1589
  return c.has(o) ? c.delete(o) : c.add(o), c;
@@ -1614,14 +1614,14 @@ function Ft(n) {
1614
1614
  }), O = kt(B.timeline), be = J((o, l) => {
1615
1615
  o.preventDefault(), o.stopPropagation(), $({ task: l, startMouseX: o.clientX, originalStart: new Date(l.start), originalEnd: new Date(l.end), offsetDays: 0 });
1616
1616
  }, []), Ce = J((o, l, c) => {
1617
- o.preventDefault(), o.stopPropagation(), z({ task: l, edge: c, startMouseX: o.clientX, originalStart: new Date(l.start), originalEnd: new Date(l.end), offsetDays: 0 });
1617
+ o.preventDefault(), o.stopPropagation(), A({ task: l, edge: c, startMouseX: o.clientX, originalStart: new Date(l.start), originalEnd: new Date(l.end), offsetDays: 0 });
1618
1618
  }, []), Ee = J((o, l, c) => {
1619
1619
  o.preventDefault(), o.stopPropagation(), a({ fromTaskId: l.id, fromEdge: c, fromScreenX: o.clientX, fromScreenY: o.clientY, currentScreenX: o.clientX, currentScreenY: o.clientY, hoverTargetId: null });
1620
1620
  }, []), $e = J(async () => {
1621
1621
  if (!S || !n.onCreateDependency) return;
1622
- const o = new Map(B.tasks.map((A) => [A.id, A])), l = o.get(S.fromTaskId), c = o.get(S.toTaskId);
1622
+ const o = new Map(B.tasks.map((z) => [z.id, z])), l = o.get(S.fromTaskId), c = o.get(S.toTaskId);
1623
1623
  if (!l || !c) return;
1624
- const E = (A) => A.originalType === "step" ? "STEP" : "MILESTONE", W = S.fromEdge === "right" ? l : c, L = S.fromEdge === "right" ? c : l;
1624
+ const E = (z) => z.originalType === "step" ? "STEP" : "MILESTONE", W = S.fromEdge === "right" ? l : c, L = S.fromEdge === "right" ? c : l;
1625
1625
  P(!0);
1626
1626
  try {
1627
1627
  await n.onCreateDependency({ predecessorId: W.id, predecessorType: E(W), successorId: L.id, successorType: E(L), type: R, lag: T }), p(null);
@@ -1651,13 +1651,13 @@ function Ft(n) {
1651
1651
  if (!w) return;
1652
1652
  const o = (c) => {
1653
1653
  const E = c.clientX - w.startMouseX, W = Math.round(E / B.timeline.dayWidth);
1654
- W !== w.offsetDays && z((L) => L ? { ...L, offsetDays: W } : null);
1654
+ W !== w.offsetDays && A((L) => L ? { ...L, offsetDays: W } : null);
1655
1655
  }, l = () => {
1656
1656
  if (w.offsetDays !== 0 && n.onTaskChange) {
1657
1657
  const c = w.edge === "left" ? Z(w.originalStart, w.offsetDays) : w.originalStart, E = w.edge === "right" ? Z(w.originalEnd, w.offsetDays) : w.originalEnd;
1658
1658
  E > c && n.onTaskChange({ id: w.task.id, name: w.task.name, start: c, end: E, type: "task", progress: w.task.progress });
1659
1659
  }
1660
- z(null);
1660
+ A(null);
1661
1661
  };
1662
1662
  return document.addEventListener("mousemove", o), document.addEventListener("mouseup", l), () => {
1663
1663
  document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", l);
@@ -1709,13 +1709,13 @@ function Ft(n) {
1709
1709
  const l = (E) => {
1710
1710
  const W = O.rightBodyRef.current;
1711
1711
  if (!W) return /* @__PURE__ */ new Date();
1712
- const L = W.getBoundingClientRect(), A = E - L.left + W.scrollLeft;
1713
- return Z(B.timeline.start, Math.max(0, Math.floor(A / B.timeline.dayWidth)));
1712
+ const L = W.getBoundingClientRect(), z = E - L.left + W.scrollLeft;
1713
+ return Z(B.timeline.start, Math.max(0, Math.floor(z / B.timeline.dayWidth)));
1714
1714
  }, c = (E) => {
1715
1715
  if (!n.groupByProject) return;
1716
1716
  const W = O.leftBodyRef.current;
1717
1717
  if (!W) return;
1718
- const L = W.getBoundingClientRect(), A = E - L.top + W.scrollTop, he = Math.max(0, Math.floor(A / 50));
1718
+ const L = W.getBoundingClientRect(), z = E - L.top + W.scrollTop, he = Math.max(0, Math.floor(z / 50));
1719
1719
  for (let oe = Math.min(he, B.displayRows.length - 1); oe >= 0; oe--) {
1720
1720
  const H = B.displayRows[oe];
1721
1721
  if (H.kind === "projectHeader") return H.projectId;
@@ -1752,7 +1752,7 @@ function Ft(n) {
1752
1752
  dragState: m,
1753
1753
  setDragState: $,
1754
1754
  resizeState: w,
1755
- setResizeState: z,
1755
+ setResizeState: A,
1756
1756
  connectState: i,
1757
1757
  setConnectState: a,
1758
1758
  visibleTypes: G,
@@ -1800,10 +1800,10 @@ function Ft(n) {
1800
1800
  if (!l) return;
1801
1801
  const c = l.getBoundingClientRect(), E = o - c.top + l.scrollTop, W = Math.max(0, Math.floor(E / 50));
1802
1802
  for (let L = Math.min(W, B.displayRows.length - 1); L >= 0; L--) {
1803
- const A = B.displayRows[L];
1804
- if (A.kind === "projectHeader") return A.projectId;
1805
- if (A.kind === "task" && A.task.projectId) return A.task.projectId;
1806
- if (A.kind === "group" && A.projectId) return A.projectId;
1803
+ const z = B.displayRows[L];
1804
+ if (z.kind === "projectHeader") return z.projectId;
1805
+ if (z.kind === "task" && z.task.projectId) return z.task.projectId;
1806
+ if (z.kind === "group" && z.projectId) return z.projectId;
1807
1807
  }
1808
1808
  },
1809
1809
  handleChartMouseDown: me,
@@ -1885,7 +1885,7 @@ const Dt = [
1885
1885
  FF: "Finish → Finish (FF)",
1886
1886
  SF: "Start → Finish (SF)"
1887
1887
  };
1888
- function zt({
1888
+ function At({
1889
1889
  isOpen: n,
1890
1890
  onClose: g,
1891
1891
  availableMilestones: h = [],
@@ -1893,9 +1893,9 @@ function zt({
1893
1893
  translations: u,
1894
1894
  onSaveNote: v
1895
1895
  }) {
1896
- const b = (s, Y) => u ? typeof u == "function" ? u(s, Y) : u[s] || Y : Y, [M, I] = j(""), [y, D] = j(""), [m, $] = j("#FEF08A"), [w, z] = j(""), [i, a] = j(""), [S, p] = j("FS"), [R, f] = j(!1), [T, d] = j([]), [x, P] = j(""), F = ce(null);
1896
+ const b = (s, Y) => u ? typeof u == "function" ? u(s, Y) : u[s] || Y : Y, [M, I] = j(""), [y, D] = j(""), [m, $] = j("#FEF08A"), [w, A] = j(""), [i, a] = j(""), [S, p] = j("FS"), [R, f] = j(!1), [T, d] = j([]), [x, P] = j(""), F = ce(null);
1897
1897
  pe(() => {
1898
- n && (I(""), D(""), $("#FEF08A"), z(k ?? (/* @__PURE__ */ new Date()).toISOString().split("T")[0]), a(""), p("FS"), d([]), P(""));
1898
+ n && (I(""), D(""), $("#FEF08A"), A(k ?? (/* @__PURE__ */ new Date()).toISOString().split("T")[0]), a(""), p("FS"), d([]), P(""));
1899
1899
  }, [n, k]);
1900
1900
  const U = [
1901
1901
  ...h.map((s) => ({ id: s.id, name: s.name, type: "MILESTONE" }))
@@ -2073,7 +2073,7 @@ function zt({
2073
2073
  {
2074
2074
  type: "date",
2075
2075
  value: w,
2076
- onChange: (s) => z(s.target.value),
2076
+ onChange: (s) => A(s.target.value),
2077
2077
  style: {
2078
2078
  background: "transparent",
2079
2079
  border: "none",
@@ -2185,7 +2185,7 @@ function zt({
2185
2185
  ] })
2186
2186
  ] }) }) : null;
2187
2187
  }
2188
- const At = {
2188
+ const zt = {
2189
2189
  // GanttHeader
2190
2190
  "planning.gantt": "PLANEJAMENTO DA OBRA",
2191
2191
  "charts.gantt.month": "Mês",
@@ -2259,7 +2259,7 @@ const At = {
2259
2259
  "noteModal.untitled": "Sem título"
2260
2260
  };
2261
2261
  export {
2262
- zt as NoteModal,
2262
+ At as NoteModal,
2263
2263
  Ft as ProjectGantt,
2264
- At as ptBR
2264
+ zt as ptBR
2265
2265
  };
@@ -1 +1 @@
1
- (function(R,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","lucide-react"],e):(R=typeof globalThis<"u"?globalThis:R||self,e(R.ZeGantt={},R.jsxRuntime,R.React,R.lucideReact))})(this,(function(R,e,h,L){"use strict";const Ee=h.createContext(void 0);function Pe({children:o,value:p}){return e.jsx(Ee.Provider,{value:p,children:o})}function ge(){const o=h.useContext(Ee);if(!o)throw new Error("useGanttContext must be used within a GanttProvider");return o}const U={white:"#FFFFFF",dark_gray:"#4F4F4F",gray:"#7B7B7B",light_gray:"#D9D9D9",dark_green:"#1A3C30",water_green:"#7ab7a3",light_green:"#A0D8A8",orange:"#CD6200",yellow:"#FFBB1C",red:"#FF0000"},t={pageBg:"#F8FAFB",surface:U.white,surfaceAlt:"#F7FAF8",headerBg:"#F2F5F3",textTitle:U.dark_green,textPrimary:U.dark_gray,textSecondary:U.gray,textMuted:U.light_gray,group:U.dark_green,groupLight:U.water_green,milestone:U.dark_green,milestoneRing:U.light_green,event:U.orange,note:U.yellow,border:U.light_gray,borderLight:"#ECECEC",weekendBg:"#F4F6F5",today:U.red,todayBg:"#FF000008",arrow:U.gray,arrowHover:U.dark_green},_=50,he=32,Ne=he*2,Ye=460,ee=26,de=28,Me=120,Oe=40,Xe=3.5,te=[{bar:"#D1D8A0",barBorder:"#A0D8A8",progress:"#1A3C30"},{bar:"#A0D8C8",barBorder:"#6BBFA8",progress:"#14534A"},{bar:"#B8C9E8",barBorder:"#8AAAD6",progress:"#2C4A70"},{bar:"#E8C9A0",barBorder:"#D6AA7A",progress:"#6B4510"},{bar:"#D8A0C8",barBorder:"#C47AAE",progress:"#6B2058"},{bar:"#A0C8D8",barBorder:"#74ACBF",progress:"#1A4F60"},{bar:"#C8D8A0",barBorder:"#A8BF74",progress:"#3F5014"},{bar:"#D8B0A0",barBorder:"#C4907A",progress:"#6B3020"},{bar:"#B0A0D8",barBorder:"#937ACE",progress:"#3A2070"},{bar:"#A0D8B0",barBorder:"#70C888",progress:"#1A5030"}],$e={step:"Steps",milestone:"Milestones",event:"Events",note:"Notes"};function _e(){const{props:o,t:p,viewMode:g,setViewMode:m,visibleTypes:f,setVisibleTypes:w,newActionOpen:b,setNewActionOpen:M,newActionRef:I}=ge(),{projectName:y,onAddNewStage:D,onAddMilestone:v,onAddEvent:$,onAddNote:S}=o,A=n=>{w(s=>{const k=new Set(s);return k.has(n)?k.delete(n):k.add(n),k})};return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"20px 24px",borderBottom:`1px solid ${t.border}`,background:`linear-gradient(180deg, ${t.headerBg} 0%, ${t.surface} 100%)`},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[e.jsxs("div",{children:[e.jsx("h3",{style:{margin:0,fontSize:14,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",color:t.textTitle},children:p("planning.gantt","Project Planning")}),e.jsx("div",{style:{height:2.5,width:64,marginTop:6,borderRadius:9999,background:`linear-gradient(90deg, ${t.group}, ${t.milestoneRing})`}})]}),y&&e.jsx("span",{style:{fontSize:12,fontWeight:500,padding:"4px 12px",borderRadius:9999,color:t.textSecondary,background:t.surface,border:`1px solid ${t.border}`},children:y})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("div",{style:{display:"flex",padding:4,borderRadius:8,background:"rgba(122,122,122,0.07)",border:`1px solid ${t.borderLight}`},children:["day","month"].map(n=>e.jsx("button",{onClick:()=>m(n),style:{padding:"6px 20px",fontSize:12,fontWeight:600,borderRadius:6,transition:"all 0.2s",border:"none",cursor:"pointer",...g===n?{background:t.surface,color:t.group,boxShadow:"0 1px 3px rgb(0 0 0 / 0.08)"}:{background:"transparent",color:t.textSecondary}},children:n==="day"?p("charts.gantt.month","Month"):p("charts.gantt.year","Year")},n))}),e.jsx("div",{style:{display:"flex",padding:4,borderRadius:8,gap:2,background:"rgba(122,122,122,0.07)",border:`1px solid ${t.borderLight}`},children:[{type:"step",label:p("gantt.filter.steps","Steps"),icon:e.jsx("div",{style:{width:10,height:10,borderRadius:2,background:te[0].bar,border:`1px solid ${te[0].barBorder}`}})},{type:"milestone",label:p("gantt.filter.milestones","Milestones"),icon:e.jsx(L.Flag,{size:11,style:{color:t.milestone}})},{type:"event",label:p("gantt.filter.events","Events"),icon:e.jsx(L.Clock,{size:11,style:{color:t.event}})},{type:"note",label:p("gantt.filter.notes","Notes"),icon:e.jsx(L.MessageCircle,{size:11,style:{color:t.note}})}].map(n=>{const s=f.has(n.type);return e.jsxs("button",{onClick:()=>A(n.type),style:{display:"flex",alignItems:"center",gap:6,padding:"6px 12px",fontSize:11,fontWeight:600,borderRadius:6,transition:"all 0.2s",border:"none",cursor:"pointer",...s?{background:t.surface,color:t.group,boxShadow:"0 1px 3px rgb(0 0 0 / 0.08)"}:{background:"transparent",color:t.textMuted,opacity:.5}},children:[n.icon,e.jsx("span",{children:n.label})]},n.type)})}),D&&e.jsxs("div",{ref:I,style:{position:"relative"},children:[e.jsxs("button",{onClick:()=>M(n=>!n),style:{display:"flex",alignItems:"center",gap:8,padding:"10px 20px",borderRadius:8,fontSize:14,fontWeight:600,color:"#fff",border:"none",cursor:"pointer",background:`linear-gradient(135deg, ${t.group}, ${t.group}dd)`,transition:"all 0.2s"},children:[e.jsx(L.Plus,{size:16}),e.jsx("span",{children:p("charts.gantt.newAction","New Action")}),e.jsx(L.ChevronDown,{size:14,style:{opacity:.7,transform:b?"rotate(180deg)":"none",transition:"transform 0.18s"}})]}),b&&e.jsx("div",{style:{position:"absolute",top:"calc(100% + 6px)",right:0,zIndex:99999,background:"#fff",borderRadius:10,boxShadow:"0 12px 40px rgba(0,0,0,0.15), 0 3px 10px rgba(0,0,0,0.08)",border:`1.5px solid ${t.borderLight}`,width:200,overflow:"hidden",padding:"5px 5px"},onClick:n=>n.stopPropagation(),children:[{label:p("gantt.newAction.step","Step"),icon:e.jsx("div",{style:{width:14,height:14,borderRadius:3,background:te[0].bar,border:`1.5px solid ${te[0].barBorder}`,flexShrink:0}}),action:()=>{D(),M(!1)}},{label:p("gantt.newAction.milestone","Milestone"),icon:e.jsx("div",{style:{width:22,height:22,borderRadius:"50%",background:`${t.milestoneRing}30`,border:`1.5px solid ${t.milestoneRing}`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Flag,{size:11,style:{color:t.milestone}})}),action:()=>{v?.(),M(!1)}},{label:p("gantt.newAction.event","Event"),icon:e.jsx("div",{style:{width:22,height:22,borderRadius:"50%",background:`${t.event}18`,border:`1.5px solid ${t.event}55`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Clock,{size:11,style:{color:t.event}})}),action:()=>{$?.(),M(!1)}},{label:p("gantt.newAction.note","Note"),icon:e.jsx("div",{style:{width:16,height:20,background:t.note,borderRadius:2,boxShadow:"1px 1px 3px rgba(0,0,0,0.14)",position:"relative",overflow:"visible",flexShrink:0},children:e.jsx("div",{style:{position:"absolute",top:-2,left:"50%",transform:"translateX(-50%)",width:10,height:4,background:"rgba(255,255,255,0.55)",borderRadius:1}})}),action:()=>{S?.(),M(!1)}}].map(n=>e.jsxs("button",{onClick:n.action,style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"8px 10px",borderRadius:7,border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:500,color:t.textPrimary,textAlign:"left",transition:"background 0.12s"},onMouseEnter:s=>{s.currentTarget.style.background=t.headerBg},onMouseLeave:s=>{s.currentTarget.style.background="transparent"},children:[n.icon,n.label]},n.label))})]})]})]})}const ze=864e5,J=(o,p)=>new Date(o.getTime()+p*ze),le=(o,p)=>Math.round((p.getTime()-o.getTime())/ze),Ae=o=>new Date(o.getFullYear(),o.getMonth(),1),De=o=>new Date(o.getFullYear(),o.getMonth()+1,0),Z=o=>`${String(o.getDate()).padStart(2,"0")}/${String(o.getMonth()+1).padStart(2,"0")}/${o.getFullYear()}`,We=(o,p="en")=>new Intl.DateTimeFormat(p,{month:"long"}).format(o).toUpperCase();function Ge(){const{props:o,t:p,displayRows:g,leftBodyRef:m,handleLeftScroll:f,toggleProject:w,toggleGroup:b,hoveredTaskId:M,setHoveredTaskId:I,selectedTaskId:y,setSelectedTaskId:D,delayedIds:v,criticalIds:$,relatedIds:S}=ge(),A=n=>({id:n.id,name:n.name,start:n.start,end:n.end,type:n.originalType==="step"?"task":"milestone",progress:n.progress});return e.jsxs("div",{style:{width:Ye,flexShrink:0,borderRight:`1px solid ${t.border}`},children:[e.jsxs("div",{style:{boxSizing:"border-box",display:"flex",alignItems:"center",padding:"0 16px",height:Ne,background:t.headerBg,borderBottom:`1px solid ${t.border}`},children:[e.jsx("div",{style:{flex:1,fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",color:t.textSecondary},children:p("charts.gantt.stepName","STEP NAME")}),e.jsx("div",{style:{width:80,fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",textAlign:"center",color:t.textSecondary},children:p("charts.gantt.start","START")}),e.jsx("div",{style:{width:80,fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",textAlign:"center",color:t.textSecondary},children:p("charts.gantt.end","END")})]}),e.jsx("div",{ref:m,onScroll:f,className:"zg-no-scrollbar",style:{overflowY:"auto",overflowX:"hidden",flex:1},children:g.map(n=>{if(n.kind==="projectHeader")return e.jsx("div",{style:{boxSizing:"border-box",display:"flex",alignItems:"center",padding:"0 16px",cursor:"pointer",userSelect:"none",height:_,borderBottom:`1.5px solid ${t.group}44`,background:`${t.group}0E`},onClick:()=>w(n.projectId),children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:[n.collapsed?e.jsx(L.ChevronRight,{size:15,style:{color:t.group,flexShrink:0}}):e.jsx(L.ChevronDown,{size:15,style:{color:t.group,flexShrink:0}}),e.jsx("span",{style:{fontSize:12,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",color:t.group,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.projectTitle})]})},`ph-${n.projectId}`);if(n.kind==="group"){const z=n.projectId?`${n.projectId}-${n.groupType}`:n.groupType;return e.jsx("div",{style:{boxSizing:"border-box",display:"flex",alignItems:"center",padding:"0 16px",cursor:"pointer",userSelect:"none",height:_,borderBottom:`1px solid ${t.border}`,background:t.headerBg},onClick:()=>b(z),children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:[n.collapsed?e.jsx(L.ChevronRight,{size:14,style:{color:t.textSecondary,flexShrink:0}}):e.jsx(L.ChevronDown,{size:14,style:{color:t.textSecondary,flexShrink:0}}),e.jsx("span",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",color:t.textTitle},children:p(`gantt.group.${n.groupType}`,n.label)}),e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 6px",borderRadius:9999,background:"rgba(0,0,0,0.06)",color:t.textSecondary},children:n.count})]})},`g-${z}`)}const s=n.task,k=y===s.id,c=M===s.id,C=s.originalType!=="step",u=v.has(s.id),T=$.has(s.id),i=y!==null&&s.id!==y&&!S.has(s.id),x=y!==null&&S.has(s.id),N=u?"#FFF5F5":k?t.groupLight:x?`${t.groupLight}99`:c?t.pageBg:t.surface;return e.jsxs("div",{style:{boxSizing:"border-box",display:"flex",alignItems:"center",padding:"0 16px",cursor:"pointer",transition:"opacity 0.18s, background 0.15s",height:_,borderBottom:`1px solid ${t.borderLight}`,background:N,borderLeft:k?`3px solid ${t.group}`:x?`3px solid ${t.group}66`:T?`3px solid ${t.today}`:void 0,opacity:i?.3:1},onClick:()=>D(z=>z===s.id?null:s.id),onDoubleClick:()=>o.onTaskClick?.(A(s)),onMouseEnter:()=>I(s.id),onMouseLeave:()=>I(null),children:[e.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:8,minWidth:0,paddingRight:8},children:[s.originalType==="step"&&e.jsx("div",{style:{flexShrink:0,borderRadius:4,width:14,height:14,background:te[s.colorIdx??0].bar,border:`1.5px solid ${te[s.colorIdx??0].barBorder}`}}),s.originalType==="milestone"&&e.jsx("div",{style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",width:22,height:22,background:`${t.milestoneRing}30`,border:`1.5px solid ${t.milestoneRing}`},children:e.jsx(L.Flag,{size:11,style:{color:t.milestone}})}),s.originalType==="event"&&e.jsx("div",{style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",width:22,height:22,background:`${t.event}18`,border:`1.5px solid ${t.event}55`},children:e.jsx(L.Clock,{size:11,style:{color:t.event}})}),s.originalType==="note"&&e.jsx("div",{style:{flexShrink:0,width:16,height:20,background:s.noteColor||t.note,borderRadius:2,boxShadow:"1px 1px 3px rgba(0,0,0,0.14)",position:"relative",overflow:"visible"},children:e.jsx("div",{style:{position:"absolute",top:-2,left:"50%",transform:"translateX(-50%)",width:10,height:4,background:"rgba(255,255,255,0.55)",borderRadius:1}})}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[e.jsx("span",{style:{fontSize:13,fontWeight:500,lineHeight:1.25,color:k?t.group:u?t.today:t.textPrimary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.name}),s.originalType==="note"&&s.noteProjectTitle&&e.jsx("span",{style:{fontSize:10,color:t.textSecondary,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.noteProjectTitle})]}),s.originalType==="note"&&(s.filesCount||0)>0&&e.jsxs("span",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:2,fontSize:10,padding:"2px 6px",borderRadius:9999,color:t.textSecondary,background:t.headerBg,border:`1px solid ${t.borderLight}`},children:[e.jsx(L.Paperclip,{size:9}),s.filesCount]}),u&&e.jsx(L.AlertTriangle,{size:12,style:{flexShrink:0,color:t.today}})]}),e.jsx("div",{style:{width:80,fontSize:11,fontWeight:500,textAlign:"center",fontVariantNumeric:"tabular-nums",color:u?t.today:t.textMuted},children:Z(s.start)}),e.jsx("div",{style:{width:80,fontSize:11,fontWeight:500,textAlign:"center",fontVariantNumeric:"tabular-nums",color:u?t.today:t.textMuted},children:C?"—":Z(s.end)})]},s.id)})})]})}function He(o,p,g="en"){const m=p==="day"?Oe:Xe,f=(n,s)=>{const k=[],c=new Date().toDateString();let C=-1;for(let u=0;u<s;u++){const T=J(n,u),i=T.toDateString()===c;i&&(C=u),k.push({date:T,isToday:i,isWeekend:T.getDay()===0||T.getDay()===6})}return{daysArr:k,todayIndex:C}};if(o.length===0){const n=new Date,s=Ae(n),k=De(n),c=le(s,k)+1,{daysArr:C,todayIndex:u}=f(s,c);return{start:s,end:k,totalDays:c,dayWidth:m,totalWidth:c*m,months:[{date:s,label:`${We(s,g)} ${s.getFullYear()}`,startDay:0,days:c,width:c*m}],years:[{label:s.getFullYear().toString(),width:c*m}],days:C,todayIndex:u}}let w=new Date(o[0].start),b=new Date(o[0].end);o.forEach(n=>{n.start<w&&(w=new Date(n.start)),n.end>b&&(b=new Date(n.end))});const M=Ae(J(w,-14)),I=De(J(b,14)),y=le(M,I)+1,D=[];let v=new Date(M);for(;v<=I;){const n=De(v),s=n>I?I:n,k=le(M,v),c=le(v,s)+1;D.push({date:new Date(v),label:`${We(v,g)} ${v.getFullYear()}`,startDay:k,days:c,width:c*m}),v=new Date(v.getFullYear(),v.getMonth()+1,1)}const{daysArr:$,todayIndex:S}=f(M,y),A=[];if(p==="month"){let n="",s=0;for(const k of D){const c=k.date.getFullYear().toString();c!==n?(n&&A.push({label:n,width:s*m}),n=c,s=k.days):s+=k.days}n&&A.push({label:n,width:s*m})}return{start:M,end:I,totalDays:y,dayWidth:m,totalWidth:y*m,months:D,years:A,days:$,todayIndex:S}}function re(o,p){return le(p.start,o)*p.dayWidth}function Ve({task:o,x:p,y:g,w:m,progW:f,isHov:w,isDrag:b,isResize:M,isCritical:I,isDelayed:y,isConnectTarget:D,showDots:v,isBarDimmed:$,isBarHighlighted:S,commonEvents:A,handleResizeMouseDown:n,handleConnectDotMouseDown:s}){const{timeline:k,viewMode:c}=ge();if(o.originalType==="step"){const C=te[o.colorIdx??0],u=g+(_-ee)/2,T=!!(o.previsionStart&&o.previsionEnd),i=T?re(o.previsionStart,k):0,x=T?Math.max(re(o.previsionEnd,k)-i,c==="month"?k.dayWidth:6):0,N=u+ee+3;return e.jsxs(e.Fragment,{children:[T&&e.jsx("div",{title:`Previsto: ${Z(o.previsionStart)} → ${Z(o.previsionEnd)}`,style:{position:"absolute",left:i,top:N,width:x,height:5,borderRadius:3,background:`${C.progress}33`,border:`1.5px solid ${C.progress}66`,boxShadow:`inset 0 0 0 1px ${C.progress}22`,pointerEvents:"none",zIndex:5}}),e.jsxs("div",{"data-task-id":o.id,...A,style:{position:"absolute",left:p,top:u,width:m,height:ee,borderRadius:ee/2,background:y?"linear-gradient(135deg, #fdd, #fee)":C.bar,border:I?`2px solid ${t.today}`:y?`1.5px solid ${t.today}88`:`1.5px solid ${C.barBorder}`,cursor:b||M?"grabbing":"grab",zIndex:w||D?20:10,boxShadow:D?`0 0 0 2px ${t.group}, 0 4px 16px ${t.group}33`:I?`0 0 0 1px ${t.today}44, 0 3px 12px ${t.today}22`:S&&!w?`0 0 0 2px ${t.group}99, 0 3px 14px ${t.group}33`:w?`0 3px 12px ${C.progress}22`:"none",transform:w?"scaleY(1.06)":"scaleY(1)",opacity:$?.15:1,transition:b||M?"none":"box-shadow 0.2s, transform 0.15s, opacity 0.18s",overflow:"visible"},children:[e.jsxs("div",{style:{position:"absolute",left:0,top:0,width:m,height:"100%",borderRadius:ee/2,overflow:"hidden",pointerEvents:"none"},children:[e.jsx("div",{style:{position:"absolute",left:0,top:0,width:f,height:"100%",background:y?`linear-gradient(90deg, ${t.today}cc, ${t.today}88)`:`linear-gradient(90deg, ${C.progress}, ${C.progress}cc)`,borderRadius:`${ee/2}px 0 0 ${ee/2}px`,transition:b||M?"none":"width 0.3s"}}),m>50&&e.jsxs("span",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:700,letterSpacing:"0.05em",color:o.progress>50?"#fff":y?t.today:C.progress,zIndex:1,pointerEvents:"none"},children:[Math.round(o.progress),"%"]})]}),e.jsx("div",{onMouseDown:z=>n(z,o,"left"),style:{position:"absolute",left:0,top:0,width:8,height:"100%",cursor:"col-resize",zIndex:2,borderRadius:`${ee/2}px 0 0 ${ee/2}px`}}),e.jsx("div",{onMouseDown:z=>n(z,o,"right"),style:{position:"absolute",right:0,top:0,width:8,height:"100%",cursor:"col-resize",zIndex:2,borderRadius:`0 ${ee/2}px ${ee/2}px 0`}}),v&&e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-task-id":o.id,onMouseDown:z=>s(z,o,"left"),style:{position:"absolute",left:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}}),e.jsx("div",{"data-task-id":o.id,onMouseDown:z=>s(z,o,"right"),style:{position:"absolute",right:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}})]})]})]})}if(o.originalType==="milestone"){const C=g+(_-de)/2;return e.jsxs("div",{"data-task-id":o.id,...A,style:{position:"absolute",left:p-6,top:C,height:de,minWidth:Me,borderRadius:de/2,background:I?"linear-gradient(135deg, #fee, #fff5f5)":"linear-gradient(135deg, #e8f5ee, #f0f8f4)",border:D?`2px solid ${t.group}`:I?`2px solid ${t.today}`:`1.5px solid ${t.milestoneRing}`,display:"flex",alignItems:"center",gap:6,paddingLeft:4,paddingRight:12,cursor:b?"grabbing":"grab",zIndex:w||D?20:10,boxShadow:D?`0 0 0 2px ${t.group}, 0 4px 16px ${t.group}33`:I?`0 0 0 1px ${t.today}44, 0 3px 12px ${t.today}22`:S&&!w?`0 0 0 2px ${t.group}99, 0 3px 14px ${t.group}33`:w?`0 3px 12px ${t.milestone}22`:"0 1px 3px rgba(0,0,0,0.06)",opacity:$?.15:1,transition:"box-shadow 0.2s, transform 0.15s, opacity 0.18s",transform:w?"translateY(-1px)":"none",whiteSpace:"nowrap",overflow:"visible"},children:[e.jsx("div",{style:{width:20,height:20,borderRadius:"50%",background:I?t.today:t.milestone,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Flag,{size:11,color:"#fff",strokeWidth:2.5})}),e.jsx("span",{style:{fontSize:11,fontWeight:600,color:I?t.today:t.milestone,overflow:"hidden",textOverflow:"ellipsis",maxWidth:130},children:o.name}),o.progress>=100&&e.jsx("span",{style:{fontSize:9,fontWeight:700,color:"#fff",background:t.milestoneRing,borderRadius:6,padding:"1px 5px"},children:"✓"}),v&&e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-task-id":o.id,onMouseDown:u=>s(u,o,"left"),style:{position:"absolute",left:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}}),e.jsx("div",{"data-task-id":o.id,onMouseDown:u=>s(u,o,"right"),style:{position:"absolute",right:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}})]})]})}if(o.originalType==="event"){const C=g+(_-de)/2;return e.jsxs("div",{"data-task-id":o.id,...A,style:{position:"absolute",left:p-6,top:C,height:de,minWidth:Me,borderRadius:de/2,background:I?"linear-gradient(135deg, #fee, #fff5f5)":"linear-gradient(135deg, #fff7ed, #ffedd5)",border:D?`2px solid ${t.group}`:I?`2px solid ${t.today}`:`1.5px solid ${t.event}`,display:"flex",alignItems:"center",gap:6,paddingLeft:4,paddingRight:12,cursor:b?"grabbing":"grab",zIndex:w||D?20:10,boxShadow:D?`0 0 0 2px ${t.group}, 0 4px 16px ${t.group}33`:I?`0 0 0 1px ${t.today}44, 0 3px 12px ${t.today}22`:S&&!w?`0 0 0 2px ${t.group}99, 0 3px 14px ${t.group}33`:w?`0 3px 12px ${t.event}33`:"0 1px 3px rgba(0,0,0,0.06)",opacity:$?.15:1,transition:"box-shadow 0.2s, transform 0.15s, opacity 0.18s",transform:w?"translateY(-1px)":"none",whiteSpace:"nowrap",overflow:"visible"},children:[e.jsx("div",{style:{width:20,height:20,borderRadius:"50%",background:I?t.today:t.event,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Clock,{size:11,color:"#fff",strokeWidth:2.5})}),e.jsx("span",{style:{fontSize:11,fontWeight:600,color:I?t.today:t.event,overflow:"hidden",textOverflow:"ellipsis",maxWidth:130},children:o.name}),o.progress>=100&&e.jsx("span",{style:{fontSize:9,fontWeight:700,color:"#fff",background:t.event,borderRadius:6,padding:"1px 5px"},children:"✓"}),v&&e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-task-id":o.id,onMouseDown:u=>s(u,o,"left"),style:{position:"absolute",left:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}}),e.jsx("div",{"data-task-id":o.id,onMouseDown:u=>s(u,o,"right"),style:{position:"absolute",right:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}})]})]})}if(o.originalType==="note"){const u=g+4,T=o.noteColor||"#FEF08A",i=o.filesCount||0;return e.jsxs("div",{"data-task-id":o.id,...A,style:{position:"absolute",left:p,top:u,width:148,minHeight:72,background:T,borderRadius:3,cursor:b?"grabbing":"grab",zIndex:w||D?20:10,boxShadow:D?`0 0 0 2px ${t.group}, 4px 6px 16px rgba(0,0,0,0.22)`:S&&!w?`0 0 0 2px ${t.group}99, 3px 4px 14px rgba(0,0,0,0.18)`:w?"4px 6px 18px rgba(0,0,0,0.22)":"2px 3px 8px rgba(0,0,0,0.13)",opacity:$?.2:1,transition:b?"none":"box-shadow 0.2s, transform 0.15s, opacity 0.18s",transform:w?"rotate(-1.5deg) scale(1.03) translateY(-2px)":"rotate(0deg)",border:"1px solid rgba(0,0,0,0.06)",padding:"12px 10px 10px",display:"flex",flexDirection:"column",gap:2,userSelect:"none"},children:[e.jsx("div",{style:{position:"absolute",top:-6,left:"50%",transform:"translateX(-50%)",width:40,height:11,background:"rgba(255,255,255,0.55)",borderRadius:2,boxShadow:"0 1px 3px rgba(0,0,0,0.08)"}}),e.jsx("span",{style:{fontSize:13,fontWeight:700,color:"#1a1a1a",lineHeight:"1.3",wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:o.name}),o.projectTitle&&e.jsx("span",{style:{fontSize:10,fontWeight:400,color:"rgba(0,0,0,0.55)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.projectTitle}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:2},children:[e.jsx("span",{style:{fontSize:9,fontWeight:500,color:"rgba(0,0,0,0.45)"},children:Z(o.start)}),i>0&&e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:2,fontSize:9,color:"rgba(0,0,0,0.45)"},children:[e.jsx(L.Paperclip,{size:8})," ",i]})]}),v&&e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-task-id":o.id,onMouseDown:x=>s(x,o,"left"),style:{position:"absolute",left:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}}),e.jsx("div",{"data-task-id":o.id,onMouseDown:x=>s(x,o,"right"),style:{position:"absolute",right:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}})]})]})}return null}function Ue(){const{arrows:o,hoveredTaskId:p,selectedTaskId:g,relatedIds:m}=ge();return e.jsx(e.Fragment,{children:o.map((f,w)=>{const b=p===f.predId||p===f.succId,M=!g||f.predId===g||f.succId===g||m.has(f.predId)||m.has(f.succId),I=g!==null&&M,y=b?t.arrowHover:I?t.group:t.arrow;return e.jsxs("g",{style:{opacity:M?I?1:void 0:.08,transition:"opacity 0.18s"},children:[e.jsx("path",{d:f.path,fill:"none",stroke:y,strokeWidth:I?2.5:b?2:1.5,style:{transition:"stroke 0.2s, stroke-width 0.2s"}}),e.jsx("polygon",{points:`${f.headX},${f.headY} ${f.headX-6},${f.headY-4} ${f.headX-6},${f.headY+4}`,fill:y,style:{transition:"fill 0.2s"}})]},w)})})}const Ce=o=>({id:o.id,name:o.name,start:o.start,end:o.end,type:o.originalType==="step"?"task":o.originalType,progress:o.progress}),fe=(o,p)=>{switch(o){case"step":return e.jsx("div",{style:{width:12,height:12,borderRadius:2,background:te[p??0].bar,border:`1.5px solid ${te[p??0].barBorder}`,flexShrink:0}});case"milestone":return e.jsx("div",{style:{width:16,height:16,borderRadius:"50%",background:t.milestone,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Flag,{size:8,color:"#fff"})});case"event":return e.jsx("div",{style:{width:16,height:16,borderRadius:"50%",background:t.event,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Clock,{size:8,color:"#fff"})});case"note":return e.jsx("div",{style:{width:12,height:14,background:t.note,borderRadius:2,boxShadow:"1px 1px 2px rgba(0,0,0,0.1)",flexShrink:0}});default:return null}};function qe(){const{props:o,viewMode:p,timeline:g,displayRows:m,dragState:f,resizeState:w,connectState:b,pendingConnection:M,setPendingConnection:I,depModalType:y,setDepModalType:D,depModalLag:v,setDepModalLag:$,depCreating:S,deletingDepId:A,setDeletingDepId:n,chartMenu:s,setChartMenu:k,rightBodyRef:c,timeHeaderRef:C,handleChartMouseDown:u,handleChartWheel:T,openChartMenu:i,handleRightScroll:x,hoveredTaskId:N,setHoveredTaskId:z,selectedTaskId:q,setSelectedTaskId:Y,tooltip:a,setTooltip:O,popupState:G,setPopupState:K,criticalIds:V,delayedIds:se,relatedIds:ce,handleBarMouseDown:we,handleResizeMouseDown:ue,handleConnectDotMouseDown:Se,handleCreateDependency:ke}=ge(),{translations:ie,onViewStage:ye,onEditStage:j,onDeleteStage:X,onDeleteDependency:xe,onAddNewStage:me,onAddMilestone:Ie,onAddEvent:Te,onAddNote:ae}=o,F=(r,d)=>ie?typeof ie=="function"?ie(r,d):ie[r]||d:d,be=(r,d)=>Math.round((d.getTime()-r.getTime())/864e5)+1,oe=Math.max(m.length*_,400)+80,ve=()=>K({isOpen:!1,position:{x:0,y:0},task:null});return e.jsxs("div",{style:{flex:1,width:"100%",background:"#FAFAFA",display:"flex",flexDirection:"column",position:"relative",overflow:"hidden",borderLeft:`1px solid ${t.borderLight}`},children:[e.jsx("div",{ref:C,style:{boxSizing:"border-box",height:he*2,background:t.headerBg,borderBottom:`1px solid ${t.borderLight}`,overflow:"hidden",position:"relative",flexShrink:0,boxShadow:"0 1px 3px rgba(0,0,0,0.02)"},onWheel:T,children:e.jsxs("div",{style:{width:g.totalWidth,height:"100%",position:"relative"},children:[e.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,height:he,display:"flex"},children:[p==="day"&&g.months.map((r,d)=>e.jsx("div",{style:{width:r.width,position:"relative",height:"100%",borderRight:`1px solid ${t.borderLight}`,paddingLeft:12,display:"flex",alignItems:"flex-end",paddingBottom:6},children:e.jsx("span",{style:{fontSize:13,fontWeight:700,color:t.textTitle,letterSpacing:"0.02em"},children:r.label})},d)),p==="month"&&g.years?.map((r,d)=>e.jsx("div",{style:{width:r.width,position:"relative",height:"100%",borderRight:`1px solid ${t.borderLight}`,paddingLeft:12,display:"flex",alignItems:"flex-end",paddingBottom:6},children:e.jsx("span",{style:{fontSize:13,fontWeight:700,color:t.textTitle,letterSpacing:"0.02em"},children:r.label})},d))]}),e.jsxs("div",{style:{position:"absolute",top:he,left:0,right:0,height:he,display:"flex"},children:[p==="day"&&g.days.map((r,d)=>{const l=r.isToday;return e.jsx("div",{style:{width:g.dayWidth,position:"relative",height:"100%",borderRight:`1px solid ${t.borderLight}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{fontSize:11,fontWeight:l?800:500,color:l?t.today:t.textSecondary,letterSpacing:"-0.03em"},children:r.date.getDate().toString().padStart(2,"0")})},d)}),p==="month"&&g.months.map((r,d)=>e.jsx("div",{style:{width:r.width,position:"relative",height:"100%",borderRight:`1px solid ${t.borderLight}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{fontSize:11,fontWeight:600,color:t.textPrimary,textTransform:"uppercase",letterSpacing:"0.05em"},children:r.label.substring(0,3)})},d))]})]})}),e.jsx("div",{ref:c,className:"zg-no-scrollbar",style:{flex:1,overflow:"auto",background:"#fff",position:"relative"},onScroll:x,onMouseDown:u,onWheel:T,onContextMenu:i,children:e.jsxs("div",{style:{width:g.totalWidth,height:oe,position:"relative"},children:[e.jsxs("svg",{width:g.totalWidth,height:oe,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[e.jsxs("defs",{children:[e.jsx("pattern",{id:"gantt-y-lines",x:"0",y:"0",width:g.dayWidth,height:_,patternUnits:"userSpaceOnUse",children:e.jsx("line",{x1:g.dayWidth,y1:"0",x2:g.dayWidth,y2:_,stroke:t.border,strokeWidth:"1",strokeDasharray:"4 4",opacity:"0.4"})}),e.jsx("pattern",{id:"gantt-x-lines",x:"0",y:"0",width:g.dayWidth,height:_,patternUnits:"userSpaceOnUse",children:e.jsx("line",{x1:"0",y1:_,x2:g.dayWidth,y2:_,stroke:t.borderLight,strokeWidth:"1"})})]}),e.jsx("rect",{width:"100%",height:"100%",fill:"url(#gantt-x-lines)"}),e.jsx("rect",{width:"100%",height:"100%",fill:"url(#gantt-y-lines)"}),p==="day"&&g.days.map((r,d)=>r.isWeekend?e.jsx("rect",{x:d*g.dayWidth,y:0,width:g.dayWidth,height:oe,fill:t.weekendBg,opacity:.6},`we-${d}`):null),p==="month"&&g.days.map((r,d)=>r.isWeekend?e.jsx("rect",{x:d*g.dayWidth,y:0,width:g.dayWidth,height:oe,fill:t.weekendBg,opacity:.3},`wem-${d}`):null),g.todayIndex>=0&&e.jsxs("g",{children:[e.jsx("rect",{x:g.todayIndex*g.dayWidth,y:0,width:g.dayWidth,height:oe,fill:t.todayBg}),e.jsx("line",{x1:(g.todayIndex+.5)*g.dayWidth,y1:0,x2:(g.todayIndex+.5)*g.dayWidth,y2:oe,stroke:t.today,strokeWidth:2,strokeDasharray:"4 4",opacity:.3})]})]}),m.map((r,d)=>r.kind==="group"||r.kind==="projectHeader"?e.jsx("div",{style:{boxSizing:"border-box",position:"absolute",left:0,top:d*_,width:"100%",height:_,background:r.kind==="projectHeader"?t.headerBg:`${t.groupLight}15`,borderBottom:`1px solid ${t.borderLight}`,pointerEvents:"none"}},`bg-${d}`):null),e.jsxs("div",{style:{position:"absolute",inset:0},children:[m.map((r,d)=>{if(r.kind!=="task")return null;const l=r.task,E=f?.task.id===l.id,B=w?.task.id===l.id,P=E||B&&w.edge==="left"?J(l.start,E?f.offsetDays:w.offsetDays):l.start,W=E||B&&w.edge==="right"?J(l.end,E?f.offsetDays:w.offsetDays):l.end,pe=l.originalType!=="step";let ne=re(P,g),H=0,Le=0;pe||(H=Math.max(re(W,g)-ne,g.dayWidth),Le=H*(l.progress/100));const je=N===l.id,Fe=q===l.id,rt=se.has(l.id),nt=V.has(l.id),st=!!q&&!Fe&&!ce.has(l.id),at=Fe||!!q&&ce.has(l.id),it=b?.hoverTargetId===l.id,dt=je||Fe,lt=d*_,ct={onMouseEnter:Q=>{z(l.id),!f&&!w&&O({task:l,x:Q.clientX,y:Q.clientY})},onMouseMove:Q=>{N===l.id&&!f&&!w&&O({task:l,x:Q.clientX,y:Q.clientY})},onMouseLeave:()=>{z(null),O(null)},onClick:Q=>{Q.stopPropagation(),Y(l.id),Q.detail===2&&ye?.(Ce(l)),K(!G.isOpen||G.task?.id!==l.id?{isOpen:!0,position:{x:Q.clientX,y:Q.clientY},task:l}:{isOpen:!1,position:{x:0,y:0},task:null})},onMouseDown:Q=>we(Q,l)};return e.jsx(Ve,{task:l,x:ne,y:lt,w:H,progW:Le,isHov:je,isDrag:E,isResize:B,isCritical:nt,isDelayed:rt,isConnectTarget:it,showDots:dt,isBarDimmed:st,isBarHighlighted:at,commonEvents:ct,handleResizeMouseDown:ue,handleConnectDotMouseDown:Se},l.id)}),e.jsx("svg",{width:g.totalWidth,height:oe,style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx(Ue,{})}),a&&!f&&e.jsx("div",{style:{position:"fixed",left:a.x+16,top:a.y-10,zIndex:9999,pointerEvents:"none"},children:e.jsxs("div",{style:{borderRadius:12,padding:"12px 16px",minWidth:220,maxWidth:340,background:`${t.surface}f5`,border:`1px solid ${t.borderLight}`,boxShadow:"0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[fe(a.task.originalType,a.task.colorIdx),e.jsx("span",{style:{fontSize:12,fontWeight:700,color:t.textTitle,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.task.name})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:11,color:t.textSecondary},children:a.task.originalType==="step"?e.jsxs(e.Fragment,{children:[a.task.previsionStart&&a.task.previsionEnd&&e.jsxs("div",{style:{background:`${t.headerBg}`,borderRadius:6,padding:"4px 6px",marginBottom:2},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginBottom:4},children:[e.jsx("div",{style:{width:20,height:4,borderRadius:2,background:`${t.textSecondary}44`,border:`1.5px solid ${t.textSecondary}66`}}),e.jsx("span",{style:{fontSize:9,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:t.textSecondary},children:F("gantt.tooltip.planned","Planned")})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.start","Start"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.previsionStart)})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.end","End"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.previsionEnd)})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.duration","Duration"),":"]}),e.jsxs("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:[be(a.task.previsionStart,a.task.previsionEnd),"d"]})]})]}),e.jsxs("div",{style:{background:a.task.hasActualDates?`${t.groupLight}22`:"transparent",borderRadius:6,padding:"4px 6px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginBottom:4},children:[e.jsx("div",{style:{width:20,height:4,borderRadius:2,background:te[a.task.colorIdx??0].progress}}),e.jsx("span",{style:{fontSize:9,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:a.task.hasActualDates?t.group:t.textSecondary},children:a.task.hasActualDates?F("gantt.tooltip.actual","Actual"):F("gantt.tooltip.plannedInUse","Planned (in use)")})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.start","Start"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.start)})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.end","End"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.end)})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.duration","Duration"),":"]}),e.jsxs("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:[be(a.task.start,a.task.end),"d"]})]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16,paddingTop:4,marginTop:4,borderTop:`1px solid ${t.borderLight}`},children:[e.jsxs("span",{children:[F("charts.gantt.progress","Progress"),":"]}),e.jsxs("span",{style:{fontWeight:700,color:t.group},children:[Math.round(a.task.progress),"%"]})]})]}):a.task.originalType==="note"?e.jsxs(e.Fragment,{children:[a.task.noteProjectTitle&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[e.jsx("div",{style:{width:8,height:8,borderRadius:2,background:a.task.noteColor||t.note,flexShrink:0}}),e.jsx("span",{style:{fontSize:11,fontWeight:600,color:t.textPrimary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.task.noteProjectTitle})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.date","Date"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.start)})]}),(a.task.filesCount||0)>0&&e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.attachments","Attachments"),":"]}),e.jsxs("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:4,color:t.textPrimary},children:[e.jsx(L.Paperclip,{size:10}),a.task.filesCount]})]})]}):e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("charts.gantt.start","Start"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.start)})]})})]})})]})]})}),G.task&&G.isOpen&&(()=>{const r=G.task,d=(o.dependencies||[]).filter(W=>W.predecessorId===r.id||W.successorId===r.id),l={FS:F("gantt.depType.fs","Finish to Start"),SS:F("gantt.depType.ss","Start to Start"),FF:F("gantt.depType.ff","Finish to Finish"),SF:F("gantt.depType.sf","Start to Finish")},E=d.length>0?300:220,B=Math.min(G.position.x,window.innerWidth-E-16),P=G.position.y+8;return e.jsxs("div",{"data-popup":"gantt-action",style:{position:"fixed",left:B,top:P,zIndex:9999,background:"#fff",borderRadius:4,boxShadow:"0 12px 40px rgba(0,0,0,0.14), 0 3px 10px rgba(0,0,0,0.07)",border:`1.5px solid ${t.borderLight}`,width:E,overflow:"hidden"},onMouseDown:W=>W.stopPropagation(),children:[e.jsx("div",{style:{padding:"12px 14px 10px",borderBottom:`1px solid ${t.borderLight}`},children:e.jsx("p",{style:{fontSize:13,fontWeight:700,color:t.group,margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r.name,children:r.name})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2,padding:"8px 6px"},children:[e.jsxs("button",{onClick:()=>{ye?.(Ce(r)),ve()},className:"zg-popup-btn",children:[e.jsx(L.Eye,{size:15})," ",e.jsx("span",{children:F("gantt.popup.viewDetails","View details")})]}),e.jsxs("button",{onClick:()=>{j?.(Ce(r)),ve()},className:"zg-popup-btn",children:[e.jsx(L.Edit2,{size:15})," ",e.jsx("span",{children:F("gantt.popup.edit","Edit")})]}),e.jsxs("button",{onClick:()=>{X?.(r.id),ve()},className:"zg-popup-btn zg-popup-btn-danger",children:[e.jsx(L.Trash2,{size:15})," ",e.jsx("span",{children:F("gantt.popup.delete","Delete")})]})]}),d.length>0&&e.jsxs("div",{style:{borderTop:`1px solid ${t.borderLight}`,padding:"10px 14px 12px"},children:[e.jsxs("div",{style:{fontSize:10,fontWeight:700,color:t.textSecondary,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:8},children:[F("gantt.popup.relations","Relations")," (",d.length,")"]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:d.map(W=>{const pe=W.predecessorId===r.id,ne=pe?W.successorName:W.predecessorName,H=A===W.id;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:8,background:"#f8fafb",border:`1px solid ${t.borderLight}`},children:[e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{fontSize:10,fontWeight:700,color:t.group,marginBottom:2},children:[e.jsx("span",{style:{background:`${t.group}15`,borderRadius:4,padding:"1px 5px"},children:W.type})," ",e.jsx("span",{style:{color:t.textSecondary,fontWeight:500},children:pe?"→ ":"← "}),e.jsx("span",{style:{color:t.textMuted,fontWeight:400,fontSize:9},children:l[W.type]??W.type})]}),e.jsx("div",{style:{fontSize:11,color:t.textPrimary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:ne,children:ne})]}),xe&&e.jsx("button",{disabled:!!H,onClick:async()=>{n(W.id);try{await xe(W.id)}finally{n(null)}},style:{flexShrink:0,padding:"4px 6px",borderRadius:6,border:"none",background:H?"#fee2e2":"transparent",cursor:H?"wait":"pointer",color:"#ef4444",fontSize:14,opacity:H?.5:1,transition:"background 0.12s"},children:H?"⟳":"🗑"})]},W.id)})})]})]})})(),s&&e.jsxs("div",{"data-menu":"chart-create",style:{position:"fixed",left:Math.min(s.x,window.innerWidth-220),top:Math.min(s.y,window.innerHeight-220),zIndex:99999,background:"#fff",borderRadius:10,boxShadow:"0 12px 40px rgba(0,0,0,0.15), 0 3px 10px rgba(0,0,0,0.08)",border:`1.5px solid ${t.borderLight}`,width:200,overflow:"hidden"},onClick:r=>r.stopPropagation(),children:[e.jsx("div",{style:{padding:"9px 13px 8px",borderBottom:`1px solid ${t.borderLight}`,background:t.headerBg},children:e.jsxs("p",{style:{margin:0,fontSize:10,fontWeight:700,color:t.textSecondary,textTransform:"uppercase",letterSpacing:"0.08em"},children:[F("gantt.chart.addOn","Add on")," ",Z(s.date)]})}),e.jsx("div",{style:{padding:"5px 5px"},children:[{label:F("gantt.newAction.step","Step"),icon:fe("step",0),action:()=>{me?.(s.date,s.projectId),k(null)}},{label:F("gantt.newAction.milestone","Milestone"),icon:fe("milestone"),action:()=>{Ie?.(s.date,s.projectId),k(null)}},{label:F("gantt.newAction.event","Event"),icon:fe("event"),action:()=>{Te?.(s.date,s.projectId),k(null)}},{label:F("gantt.newAction.note","Note"),icon:fe("note"),action:()=>{ae?.(s.date,s.projectId),k(null)}}].map(r=>e.jsxs("button",{onClick:r.action,className:"zg-popup-btn",style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"8px 10px",borderRadius:7,border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:500,color:t.textPrimary,textAlign:"left",transition:"background 0.12s"},children:[r.icon," ",r.label]},r.label))})]}),b&&e.jsxs("svg",{style:{position:"fixed",inset:0,width:"100vw",height:"100vh",pointerEvents:"none",zIndex:99999},children:[e.jsx("defs",{children:e.jsx("marker",{id:"connect-arrow",markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:e.jsx("path",{d:"M0,0 L0,6 L6,3 z",fill:t.group})})}),e.jsx("line",{x1:b.fromScreenX,y1:b.fromScreenY,x2:b.currentScreenX,y2:b.currentScreenY,stroke:t.group,strokeWidth:2.5,strokeDasharray:"8 5",markerEnd:"url(#connect-arrow)",opacity:.85,style:{animation:"zg-dash 0.5s linear infinite"}})]}),M&&e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99998},onClick:()=>I(null),children:e.jsxs("div",{style:{background:"#fff",borderRadius:20,padding:"32px 36px",width:420,boxShadow:"0 24px 80px rgba(0,0,0,0.18), 0 6px 24px rgba(0,0,0,0.08)"},onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("h3",{style:{fontSize:18,fontWeight:700,color:t.textTitle,marginBottom:4},children:F("gantt.depModal.title","Relation Type")}),e.jsx("p",{style:{fontSize:13,color:t.textSecondary},children:F("gantt.depModal.subtitle","Choose how the two tasks relate")})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,marginBottom:20},children:[{type:"FS",label:F("gantt.depModal.fs","Finish to Start"),desc:F("gantt.depModal.fsDesc","B starts when A finishes")},{type:"SS",label:F("gantt.depModal.ss","Start to Start"),desc:F("gantt.depModal.ssDesc","A and B start together")},{type:"FF",label:F("gantt.depModal.ff","Finish to Finish"),desc:F("gantt.depModal.ffDesc","A and B finish together")},{type:"SF",label:F("gantt.depModal.sf","Start to Finish"),desc:F("gantt.depModal.sfDesc","B finishes when A starts")}].map(r=>e.jsxs("button",{onClick:()=>D(r.type),style:{border:y===r.type?`2px solid ${t.group}`:`1.5px solid ${t.borderLight}`,borderRadius:12,padding:"12px 14px",textAlign:"left",cursor:"pointer",background:y===r.type?`${t.group}0d`:"#fafafa"},children:[e.jsx("div",{style:{fontSize:11,fontFamily:"monospace",fontWeight:700,color:t.group,marginBottom:4,background:y===r.type?`${t.group}20`:`${t.group}0d`,borderRadius:6,padding:"2px 6px",display:"inline-block"},children:r.type}),e.jsx("div",{style:{fontSize:13,fontWeight:600,color:t.textTitle,marginBottom:2},children:r.label}),e.jsx("div",{style:{fontSize:11,color:t.textSecondary},children:r.desc})]},r.type))}),e.jsxs("div",{style:{marginBottom:24},children:[e.jsx("label",{style:{display:"block",fontSize:13,fontWeight:600,color:t.textTitle,marginBottom:6},children:F("gantt.depModal.lagLabel","Lag (days)")}),e.jsx("input",{type:"number",value:v,onChange:r=>$(parseInt(r.target.value)||0),style:{width:"100%",padding:"10px 12px",border:`1.5px solid ${t.borderLight}`,borderRadius:8,fontSize:14}})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[e.jsx("button",{onClick:()=>I(null),style:{padding:"10px 16px",borderRadius:8,border:`1px solid ${t.borderLight}`,background:"#fff",cursor:"pointer",fontWeight:600},children:F("gantt.depModal.cancel","Cancel")}),e.jsx("button",{onClick:ke,disabled:S,style:{padding:"10px 16px",borderRadius:8,border:"none",background:t.group,color:"#fff",cursor:S?"wait":"pointer",fontWeight:600},children:S?F("gantt.depModal.saving","Saving..."):F("gantt.depModal.create","Create Dependency")})]})]})})]})}function Ke(o){const p=h.useRef(null),g=h.useRef(null),m=h.useRef(null),f=h.useRef(!1),w=h.useCallback(()=>{if(f.current)return;f.current=!0;const y=g.current;y&&p.current&&(p.current.scrollTop=y.scrollTop),y&&m.current&&(m.current.scrollLeft=y.scrollLeft),f.current=!1},[]),b=h.useCallback(()=>{f.current||(f.current=!0,p.current&&g.current&&(g.current.scrollTop=p.current.scrollTop),f.current=!1)},[]),M=h.useRef(!1);h.useEffect(()=>{if(M.current||!o.totalWidth)return;const y=g.current;if(!y)return;const D=re(new Date,o);if(D>=0&&D<=o.totalWidth){const v=D-y.clientWidth/2;y.scrollLeft=Math.max(0,v),m.current&&(m.current.scrollLeft=y.scrollLeft),M.current=!0}},[o]);const I=h.useCallback(y=>{const D=g.current;if(D)if(y.preventDefault(),y.shiftKey||Math.abs(y.deltaX)>Math.abs(y.deltaY)){const v=y.shiftKey?y.deltaY:y.deltaX;D.scrollLeft+=v,m.current&&(m.current.scrollLeft=D.scrollLeft)}else D.scrollTop+=y.deltaY,p.current&&(p.current.scrollTop=D.scrollTop)},[]);return{leftBodyRef:p,rightBodyRef:g,timeHeaderRef:m,handleRightScroll:w,handleLeftScroll:b,handleChartWheel:I}}function Je(o,p,g,m){const f=new Map;return o.forEach(w=>f.set(w.id,w)),p.map(w=>{const b=f.get(w.predecessorId),M=f.get(w.successorId);if(!b||!M)return null;const I=m.get(b.id),y=m.get(M.id);if(I==null||y==null)return null;const D=b.originalType!=="step",v=M.originalType!=="step",$=D?re(b.start,g)+Me:re(b.end,g),S=I*_+_/2,A=v?re(M.start,g)-10:re(M.start,g),n=y*_+_/2,s=14,k=Math.max($+s,A-s),c=S===n?`M${$},${S} L${A-6},${n}`:`M${$},${S} L${k},${S} L${k},${n} L${A-6},${n}`;return{predId:b.id,succId:M.id,path:c,headX:A-6,headY:n}}).filter(Boolean)}function Ze(o,p){if(o.length===0||p.length===0)return new Set;const g=new Map;o.forEach(c=>g.set(c.id,c));const m=new Set(o.map(c=>c.id)),f=p.filter(c=>m.has(c.predecessorId)&&m.has(c.successorId));if(f.length===0)return new Set;const w=new Map,b=new Map;f.forEach(c=>{w.has(c.predecessorId)||w.set(c.predecessorId,[]),w.get(c.predecessorId).push(c.successorId),b.has(c.successorId)||b.set(c.successorId,[]),b.get(c.successorId).push(c.predecessorId)});const M=c=>Math.max(1,le(c.start,c.end)),I=new Set,y=[];function D(c){I.has(c)||(I.add(c),(w.get(c)||[]).forEach(D),y.unshift(c))}o.forEach(c=>D(c.id));const v=new Map,$=new Map;for(const c of y){const C=g.get(c),u=b.get(c)||[];let T=0;for(const x of u)T=Math.max(T,$.get(x)||0);const i=u.length>0?T:0;v.set(c,i),$.set(c,i+M(C))}let S=0;$.forEach(c=>{c>S&&(S=c)});const A=new Map,n=new Map;for(let c=y.length-1;c>=0;c--){const C=y[c],u=g.get(C),T=w.get(C)||[];let i=S;for(const x of T)i=Math.min(i,A.get(x)??S);n.set(C,T.length>0?i:S),A.set(C,(n.get(C)||0)-M(u))}const s=new Set;f.forEach(c=>{s.add(c.predecessorId),s.add(c.successorId)});const k=new Set;for(const c of y){if(!s.has(c))continue;const C=(A.get(c)||0)-(v.get(c)||0);Math.abs(C)<.5&&k.add(c)}return k}function Qe({steps:o,milestones:p,events:g,notes:m,dependencies:f,viewMode:w,locale:b,groupByProject:M,visibleTypes:I,collapsedGroups:y,collapsedProjects:D,selectedTaskId:v}){const $=h.useMemo(()=>{const u=[];let T=0;return o.forEach(i=>{const x=!!(i.startDate&&i.finishDate),N=i.startDate||i.previsionStartDate,z=i.finishDate||i.previsionFinishDate;if(!N||!z)return;const q=new Date(N),Y=new Date(z);if(isNaN(q.getTime())||isNaN(Y.getTime()))return;Y<=q&&Y.setDate(Y.getDate()+1);let a,O;if(i.previsionStartDate&&i.previsionFinishDate){const V=new Date(i.previsionStartDate),se=new Date(i.previsionFinishDate);!isNaN(V.getTime())&&!isNaN(se.getTime())&&(a=V,O=se<=V?J(V,1):se)}const G=f?.filter(V=>V.successorId===i.id).map(V=>V.predecessorId)||[],K=i.conclusionPercent!=null?Number(i.conclusionPercent):0;u.push({id:i.id,name:i.name,start:q,end:Y,progress:K>1?Math.min(K,100):K*100,originalType:"step",deps:G,colorIdx:T%te.length,previsionStart:a,previsionEnd:O,hasActualDates:x,projectId:i.projectId||void 0,projectTitle:i.projectTitle||void 0}),T++}),p?.forEach(i=>{if(!i.date)return;const x=new Date(i.date);if(isNaN(x.getTime()))return;const N=f?.filter(z=>z.successorId===i.id).map(z=>z.predecessorId)||[];u.push({id:i.id,name:i.name,start:x,end:x,progress:i.finished?100:0,originalType:"milestone",deps:N,projectId:i.projectId||void 0,projectTitle:i.projectTitle||void 0})}),g?.forEach(i=>{if(!i.date)return;const x=new Date(i.date);if(isNaN(x.getTime()))return;const N=f?.filter(z=>z.successorId===i.id).map(z=>z.predecessorId)||[];u.push({id:i.id,name:i.title,start:x,end:x,progress:i.finished?100:0,originalType:"event",deps:N,projectId:i.projectId||void 0,projectTitle:i.projectTitle||void 0})}),m?.forEach(i=>{if(!i.date)return;const x=new Date(i.date);isNaN(x.getTime())||u.push({id:i.id,name:i.title||"Note",start:x,end:x,progress:0,originalType:"note",deps:[],noteCount:1,noteColor:i.color||t.note,filesCount:i.filesCount||0,noteProjectTitle:i.projectTitle||void 0,projectId:i.projectId||void 0,projectTitle:i.projectTitle||void 0})}),u},[o,p,g,m,f]),S=h.useMemo(()=>He($,w,b),[$,w,b]),A=h.useMemo(()=>{const u=[],T=["step","milestone","event","note"];if(M){const i=new Map;$.forEach(x=>{x.projectId&&!i.has(x.projectId)&&i.set(x.projectId,x.projectTitle||x.projectId)});for(const[x,N]of Array.from(i.entries())){const z=D.has(x);if(u.push({kind:"projectHeader",projectId:x,projectTitle:N,collapsed:z}),!z){const q=$.filter(Y=>Y.projectId===x);for(const Y of T){if(!I.has(Y))continue;const a=q.filter(K=>K.originalType===Y);if(a.length===0)continue;const O=`${x}-${Y}`,G=y.has(O);u.push({kind:"group",groupType:Y,label:$e[Y],count:a.length,collapsed:G,projectId:x}),G||a.forEach(K=>u.push({kind:"task",task:K}))}}}}else for(const i of T){if(!I.has(i))continue;const x=$.filter(z=>z.originalType===i);if(x.length===0)continue;const N=y.has(i);u.push({kind:"group",groupType:i,label:$e[i],count:x.length,collapsed:N}),N||x.forEach(z=>u.push({kind:"task",task:z}))}return u},[$,I,y,D,M]),n=h.useMemo(()=>{const u=new Map;return A.forEach((T,i)=>{T.kind==="task"&&u.set(T.task.id,i)}),u},[A]),s=h.useMemo(()=>Je($,f||[],S,n),[$,f,S,n]),k=h.useMemo(()=>Ze($,f||[]),[$,f]),c=h.useMemo(()=>{const u=new Set,T=new Date;return $.forEach(i=>{i.originalType==="step"&&i.end<T&&i.progress<100&&u.add(i.id)}),u},[$]),C=h.useMemo(()=>{if(!v||!f?.length)return new Set;const u=new Set,T=[v];for(;T.length;){const i=T.shift();for(const x of f)x.predecessorId===i&&!u.has(x.successorId)&&(u.add(x.successorId),T.push(x.successorId)),x.successorId===i&&!u.has(x.predecessorId)&&(u.add(x.predecessorId),T.push(x.predecessorId))}return u},[v,f]);return{tasks:$,timeline:S,displayRows:A,taskRowIndex:n,arrows:s,criticalIds:k,delayedIds:c,relatedIds:C}}function Re(o){const[p,g]=h.useState("day"),[m,f]=h.useState(null),[w,b]=h.useState(null),[M,I]=h.useState(null),[y,D]=h.useState({isOpen:!1,position:{x:0,y:0},task:null}),[v,$]=h.useState(null),[S,A]=h.useState(null),[n,s]=h.useState(null),[k,c]=h.useState(null),[C,u]=h.useState("FS"),[T,i]=h.useState(0),[x,N]=h.useState(!1),[z,q]=h.useState(null),[Y,a]=h.useState(null),[O,G]=h.useState(!1),K=h.useRef(null),[V,se]=h.useState(new Set(["step","milestone","event","note"])),[ce,we]=h.useState(new Set),[ue,Se]=h.useState(new Set),ke=h.useCallback(r=>{se(d=>{const l=new Set(d);return l.has(r)?l.delete(r):l.add(r),l})},[]),ie=h.useCallback(r=>{we(d=>{const l=new Set(d);return l.has(r)?l.delete(r):l.add(r),l})},[]),ye=h.useCallback(r=>{Se(d=>{const l=new Set(d);return l.has(r)?l.delete(r):l.add(r),l})},[]),j=Qe({steps:o.steps,milestones:o.milestones,events:o.events,notes:o.notes,dependencies:o.dependencies,viewMode:p,locale:o.locale,visibleTypes:V,collapsedGroups:ce,collapsedProjects:ue,groupByProject:o.groupByProject,selectedTaskId:w||null}),X=Ke(j.timeline),xe=h.useCallback((r,d)=>{r.preventDefault(),r.stopPropagation(),$({task:d,startMouseX:r.clientX,originalStart:new Date(d.start),originalEnd:new Date(d.end),offsetDays:0})},[]),me=h.useCallback((r,d,l)=>{r.preventDefault(),r.stopPropagation(),A({task:d,edge:l,startMouseX:r.clientX,originalStart:new Date(d.start),originalEnd:new Date(d.end),offsetDays:0})},[]),Ie=h.useCallback((r,d,l)=>{r.preventDefault(),r.stopPropagation(),s({fromTaskId:d.id,fromEdge:l,fromScreenX:r.clientX,fromScreenY:r.clientY,currentScreenX:r.clientX,currentScreenY:r.clientY,hoverTargetId:null})},[]),Te=h.useCallback(async()=>{if(!k||!o.onCreateDependency)return;const r=new Map(j.tasks.map(W=>[W.id,W])),d=r.get(k.fromTaskId),l=r.get(k.toTaskId);if(!d||!l)return;const E=W=>W.originalType==="step"?"STEP":"MILESTONE",B=k.fromEdge==="right"?d:l,P=k.fromEdge==="right"?l:d;N(!0);try{await o.onCreateDependency({predecessorId:B.id,predecessorType:E(B),successorId:P.id,successorType:E(P),type:C,lag:T}),c(null)}finally{N(!1)}},[k,j.tasks,o.onCreateDependency,C,T]);h.useEffect(()=>{if(!v)return;const r=l=>{const E=l.clientX-v.startMouseX,B=Math.round(E/j.timeline.dayWidth);B!==v.offsetDays&&$(P=>P?{...P,offsetDays:B}:null)},d=()=>{v.offsetDays!==0&&o.onTaskChange&&o.onTaskChange({id:v.task.id,name:v.task.name,start:J(v.originalStart,v.offsetDays),end:J(v.originalEnd,v.offsetDays),type:v.task.originalType==="step"?"task":"milestone",progress:v.task.progress}),$(null)};return document.addEventListener("mousemove",r),document.addEventListener("mouseup",d),()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",d)}},[v,j.timeline.dayWidth,o.onTaskChange]),h.useEffect(()=>{if(!S)return;const r=l=>{const E=l.clientX-S.startMouseX,B=Math.round(E/j.timeline.dayWidth);B!==S.offsetDays&&A(P=>P?{...P,offsetDays:B}:null)},d=()=>{if(S.offsetDays!==0&&o.onTaskChange){const l=S.edge==="left"?J(S.originalStart,S.offsetDays):S.originalStart,E=S.edge==="right"?J(S.originalEnd,S.offsetDays):S.originalEnd;E>l&&o.onTaskChange({id:S.task.id,name:S.task.name,start:l,end:E,type:"task",progress:S.task.progress})}A(null)};return document.addEventListener("mousemove",r),document.addEventListener("mouseup",d),()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",d)}},[S,j.timeline.dayWidth,o.onTaskChange]),h.useEffect(()=>{if(!n)return;const r=l=>{let E=null;for(const B of document.elementsFromPoint(l.clientX,l.clientY)){const P=B.dataset?.taskId;if(P&&P!==n.fromTaskId){E=P;break}}s(B=>B?{...B,currentScreenX:l.clientX,currentScreenY:l.clientY,hoverTargetId:E}:null)},d=l=>{let E=null;for(const B of document.elementsFromPoint(l.clientX,l.clientY)){const P=B.dataset?.taskId;if(P&&P!==n.fromTaskId){E=P;break}}E&&o.onCreateDependency&&(c({fromTaskId:n.fromTaskId,fromEdge:n.fromEdge,toTaskId:E}),u("FS"),i(0)),s(null)};return document.addEventListener("mousemove",r),document.addEventListener("mouseup",d),()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",d)}},[n?.fromTaskId,n?.fromEdge,o.onCreateDependency]);const[ae,F]=h.useState(null),be=h.useCallback(r=>{if(S||v||r.button===2)return;const d=X.rightBodyRef.current;d&&(r.preventDefault(),F({startX:r.clientX,startY:r.clientY,scrollLeft:d.scrollLeft,scrollTop:d.scrollTop}))},[S,v,X.rightBodyRef]);h.useEffect(()=>{if(!ae)return;const r=l=>{const E=X.rightBodyRef.current;E&&(E.scrollLeft=ae.scrollLeft-(l.clientX-ae.startX),E.scrollTop=ae.scrollTop-(l.clientY-ae.startY),X.leftBodyRef.current&&(X.leftBodyRef.current.scrollTop=E.scrollTop),X.timeHeaderRef.current&&(X.timeHeaderRef.current.scrollLeft=E.scrollLeft))},d=()=>F(null);return document.addEventListener("mousemove",r),document.addEventListener("mouseup",d),()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",d)}},[ae,X.rightBodyRef,X.leftBodyRef,X.timeHeaderRef]);const oe=h.useCallback(r=>{r.preventDefault(),r.stopPropagation();const d=E=>{const B=X.rightBodyRef.current;if(!B)return new Date;const P=B.getBoundingClientRect(),W=E-P.left+B.scrollLeft;return J(j.timeline.start,Math.max(0,Math.floor(W/j.timeline.dayWidth)))},l=E=>{if(!o.groupByProject)return;const B=X.leftBodyRef.current;if(!B)return;const P=B.getBoundingClientRect(),W=E-P.top+B.scrollTop,pe=Math.max(0,Math.floor(W/50));for(let ne=Math.min(pe,j.displayRows.length-1);ne>=0;ne--){const H=j.displayRows[ne];if(H.kind==="projectHeader")return H.projectId;if(H.kind==="task"&&H.task.projectId)return H.task.projectId;if(H.kind==="group"&&H.projectId)return H.projectId}};a({x:r.clientX,y:r.clientY,date:d(r.clientX),projectId:l(r.clientY)}),F(null)},[j.timeline,j.displayRows,o.groupByProject,X.rightBodyRef,X.leftBodyRef]);h.useEffect(()=>{if(!Y)return;const r=E=>{E.key==="Escape"&&a(null)},d=E=>{E.target.closest('[data-menu="chart-create"]')||a(null)},l=()=>a(null);return document.addEventListener("keydown",r),document.addEventListener("click",d),window.addEventListener("scroll",l,!0),()=>{document.removeEventListener("keydown",r),document.removeEventListener("click",d),window.removeEventListener("scroll",l,!0)}},[Y]);const ve=h.useMemo(()=>({props:o,t:(r,d)=>o.translations?typeof o.translations=="function"?o.translations(r,d):o.translations[r]||d||"":d||"",viewMode:p,setViewMode:g,hoveredTaskId:m,setHoveredTaskId:f,selectedTaskId:w,setSelectedTaskId:b,tooltip:M,setTooltip:I,popupState:y,setPopupState:D,dragState:v,setDragState:$,resizeState:S,setResizeState:A,connectState:n,setConnectState:s,visibleTypes:V,setVisibleTypes:se,toggleVisibility:ke,collapsedGroups:ce,setCollapsedGroups:we,toggleGroup:ie,collapsedProjects:ue,setCollapsedProjects:Se,toggleProject:ye,pendingConnection:k,setPendingConnection:c,depModalType:C,setDepModalType:u,depModalLag:T,setDepModalLag:i,depCreating:x,setDepCreating:N,deletingDepId:z,setDeletingDepId:q,chartMenu:Y,setChartMenu:a,newActionOpen:O,setNewActionOpen:G,tasks:j.tasks,timeline:j.timeline,displayRows:j.displayRows,taskRowIndex:j.taskRowIndex||new Map,arrows:j.arrows,criticalIds:j.criticalIds,delayedIds:j.delayedIds,relatedIds:j.relatedIds,...X,newActionRef:K,screenXToDate:r=>{const d=X.rightBodyRef.current;if(!d)return new Date;const l=d.getBoundingClientRect(),E=r-l.left+d.scrollLeft;return J(j.timeline.start,Math.max(0,Math.floor(E/j.timeline.dayWidth)))},screenYToProjectId:r=>{if(!o.groupByProject)return;const d=X.leftBodyRef.current;if(!d)return;const l=d.getBoundingClientRect(),E=r-l.top+d.scrollTop,B=Math.max(0,Math.floor(E/50));for(let P=Math.min(B,j.displayRows.length-1);P>=0;P--){const W=j.displayRows[P];if(W.kind==="projectHeader")return W.projectId;if(W.kind==="task"&&W.task.projectId)return W.task.projectId;if(W.kind==="group"&&W.projectId)return W.projectId}},handleChartMouseDown:be,openChartMenu:oe,handleBarMouseDown:xe,handleResizeMouseDown:me,handleConnectDotMouseDown:Ie,handleCreateDependency:Te}),[o,p,m,w,M,y,v,S,n,V,ce,ue,k,C,T,x,z,Y,O,j,X,ke,ie,ye,be,oe,xe,me,Ie,Te]);return o.loading?e.jsx("div",{style:{padding:48,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:t.textSecondary},children:e.jsx(L.Loader2,{size:32,style:{animation:"zg-spin 1.5s linear infinite",color:t.group}})}):e.jsx(Pe,{value:ve,children:e.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",marginLeft:"auto",marginRight:"auto",background:"#fff",borderRadius:12,boxShadow:"0 8px 30px rgb(0,0,0,0.06)",overflow:"hidden",height:"calc(100vh - 48px)",minHeight:600,border:`1px solid ${t.borderLight}`},children:[e.jsx(_e,{}),e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden",position:"relative",background:t.surfaceAlt},children:[e.jsx(Ge,{}),e.jsx(qe,{})]})]})})}const et=[{label:"Yellow",value:"#FEF08A"},{label:"Green",value:"#BBF7D0"},{label:"Blue",value:"#BFDBFE"},{label:"Pink",value:"#FBCFE8"},{label:"Purple",value:"#E9D5FF"},{label:"Orange",value:"#FED7AA"},{label:"White",value:"#FFFFFF"}],Be={FS:"Finish → Start (FS)",SS:"Start → Start (SS)",FF:"Finish → Finish (FF)",SF:"Start → Finish (SF)"};function tt({isOpen:o,onClose:p,availableMilestones:g=[],initialDate:m,translations:f,onSaveNote:w}){const b=(a,O)=>f?typeof f=="function"?f(a,O):f[a]||O:O,[M,I]=h.useState(""),[y,D]=h.useState(""),[v,$]=h.useState("#FEF08A"),[S,A]=h.useState(""),[n,s]=h.useState(""),[k,c]=h.useState("FS"),[C,u]=h.useState(!1),[T,i]=h.useState([]),[x,N]=h.useState(""),z=h.useRef(null);h.useEffect(()=>{o&&(I(""),D(""),$("#FEF08A"),A(m??new Date().toISOString().split("T")[0]),s(""),c("FS"),i([]),N(""))},[o,m]);const q=[...g.map(a=>({id:a.id,name:a.name,type:"MILESTONE"}))],Y=async()=>{if(!M.trim()&&!y.trim()){N(b("noteModal.errorEmpty","Please provide a title or content for the note."));return}N("");try{u(!0),await w({title:M||b("noteModal.untitled","Untitled"),description:y,color:v,date:S?`${S}T00:00:00`:new Date().toISOString(),predecessorId:n,dependencyType:k,files:T}),p()}catch(a){console.error(a),N(b("noteModal.errorSave","Error creating note."))}finally{u(!1)}};return o?e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.2)",backdropFilter:"blur(2px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:16},onClick:p,children:e.jsxs("div",{onClick:a=>a.stopPropagation(),style:{width:400,maxHeight:"90vh",background:v||"#FFFACD",borderRadius:4,boxShadow:"4px 6px 20px rgba(0,0,0,0.18), 1px 1px 4px rgba(0,0,0,0.08)",transform:"rotate(-1deg)",position:"relative",display:"flex",flexDirection:"column",fontFamily:"'Inter', sans-serif",overflow:"hidden",transition:"background 0.3s"},children:[e.jsx("div",{style:{position:"absolute",top:-6,left:"50%",transform:"translateX(-50%)",width:64,height:16,background:"rgba(255,255,255,0.55)",borderRadius:2,boxShadow:"0 1px 3px rgba(0,0,0,0.08)"}}),e.jsx("button",{onClick:p,style:{position:"absolute",top:10,right:10,width:24,height:24,borderRadius:"50%",background:"rgba(0,0,0,0.08)",border:"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:14,color:"#3a3a3a"},onMouseEnter:a=>a.currentTarget.style.background="rgba(0,0,0,0.15)",onMouseLeave:a=>a.currentTarget.style.background="rgba(0,0,0,0.08)",children:"✕"}),e.jsxs("div",{style:{padding:"28px 24px 20px",flex:1,overflowY:"auto",display:"flex",flexDirection:"column"},children:[x&&e.jsx("div",{style:{background:"rgba(255,0,0,0.1)",color:"#d32f2f",padding:"8px 12px",borderRadius:6,fontSize:12,marginBottom:12,border:"1px solid rgba(255,0,0,0.2)"},children:x}),e.jsx("input",{type:"text",value:M,onChange:a=>I(a.target.value),placeholder:b("noteModal.titlePlaceholder","Note title..."),style:{width:"100%",background:"transparent",border:"none",outline:"none",fontSize:20,fontWeight:800,color:"#2a2a2a",lineHeight:"1.3",padding:0,margin:0,marginBottom:14,fontFamily:"inherit"}}),e.jsx("div",{style:{width:"100%",height:1,background:"rgba(0,0,0,0.08)",marginBottom:14}}),e.jsx("textarea",{value:y,onChange:a=>D(a.target.value),rows:6,placeholder:b("noteModal.contentPlaceholder","Write your note here..."),style:{width:"100%",background:"transparent",border:"none",outline:"none",fontSize:14,color:"#3a3a3a",lineHeight:"1.6",resize:"vertical",padding:0,margin:0,fontFamily:"inherit",flex:1,minHeight:100}}),e.jsxs("div",{style:{marginTop:14,paddingTop:10,borderTop:"1px solid rgba(0,0,0,0.08)"},children:[e.jsx("input",{ref:z,type:"file",multiple:!0,onChange:a=>{const O=a.target.files?Array.from(a.target.files):[];O.length>0&&i(G=>[...G,...O]),z.current&&(z.current.value="")},style:{display:"none"}}),e.jsxs("button",{type:"button",onClick:()=>z.current?.click(),style:{display:"flex",alignItems:"center",gap:6,padding:"6px 12px",borderRadius:6,background:"rgba(0,0,0,0.05)",border:"1px dashed rgba(0,0,0,0.15)",cursor:"pointer",fontSize:12,color:"#3a3a3a",fontWeight:500,transition:"background 0.15s",width:"100%",justifyContent:"center"},onMouseEnter:a=>a.currentTarget.style.background="rgba(0,0,0,0.08)",onMouseLeave:a=>a.currentTarget.style.background="rgba(0,0,0,0.05)",children:[e.jsx(L.Upload,{size:13}),b("noteModal.attachFiles","Attach files")]}),T.length>0&&e.jsx("div",{style:{marginTop:8,display:"flex",flexDirection:"column",gap:4},children:T.map((a,O)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 8px",borderRadius:4,background:"rgba(255,255,255,0.5)",fontSize:11,color:"#3a3a3a"},children:[e.jsx(L.Paperclip,{size:10,style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),e.jsxs("span",{style:{fontSize:9,color:"rgba(58,58,58,0.4)",flexShrink:0},children:[(a.size/1024).toFixed(0),"KB"]}),e.jsx("button",{type:"button",onClick:()=>i(G=>G.filter((K,V)=>V!==O)),style:{background:"none",border:"none",cursor:"pointer",padding:2,display:"flex",color:"#ef4444"},title:b("noteModal.removeFile","Remove"),children:e.jsx(L.X,{size:12})})]},`file-${O}`))})]}),e.jsxs("div",{style:{marginTop:16,paddingTop:12,borderTop:"1px solid rgba(0,0,0,0.08)",display:"flex",alignItems:"center",justifyItems:"flex-start",justifyContent:"space-between",gap:12},children:[e.jsx("input",{type:"date",value:S,onChange:a=>A(a.target.value),style:{background:"transparent",border:"none",outline:"none",fontSize:12,color:"rgba(58,58,58,0.5)",fontWeight:500,fontFamily:"inherit",padding:0,cursor:"pointer",width:"auto"}}),e.jsx("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end"},children:et.map(a=>e.jsx("button",{type:"button",onClick:()=>$(a.value),style:{width:22,height:22,borderRadius:"50%",border:v===a.value?"2px solid #1A3C30":"1.5px solid rgba(0,0,0,0.12)",backgroundColor:a.value,cursor:"pointer",padding:0,transform:v===a.value?"scale(1.15)":"scale(1)",transition:"all 0.15s",boxShadow:v===a.value?"0 1px 4px rgba(0,0,0,0.15)":"none"},title:a.label},a.value))})]}),q.length>0&&e.jsxs("div",{style:{marginTop:12,paddingTop:12,borderTop:"1px solid rgba(0,0,0,0.08)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:8},children:[e.jsx(L.Link2,{size:14,style:{color:"rgba(58,58,58,0.5)"}}),e.jsx("span",{style:{fontSize:11,color:"rgba(58,58,58,0.5)",fontWeight:600},children:b("noteModal.dependency","Dependency")})]}),e.jsxs("select",{value:n,onChange:a=>s(a.target.value),style:{width:"100%",background:"rgba(255,255,255,0.3)",border:"1px solid rgba(0,0,0,0.08)",borderRadius:6,fontSize:12,color:"#3a3a3a",padding:"6px 8px",outline:"none",fontFamily:"inherit",cursor:"pointer"},children:[e.jsx("option",{value:"",children:b("noteModal.none","None")}),g.length>0&&e.jsx("optgroup",{label:b("noteModal.milestones","Milestones"),children:g.map(a=>e.jsx("option",{value:a.id,children:a.name},a.id))})]}),n&&e.jsx("select",{value:k,onChange:a=>c(a.target.value),style:{width:"100%",background:"rgba(255,255,255,0.3)",border:"1px solid rgba(0,0,0,0.08)",borderRadius:6,fontSize:12,color:"#3a3a3a",padding:"6px 8px",outline:"none",fontFamily:"inherit",cursor:"pointer",marginTop:6},children:Object.keys(Be).map(a=>e.jsx("option",{value:a,children:Be[a]},a))})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,paddingTop:16,marginTop:12,borderTop:"1px solid rgba(0,0,0,0.08)"},children:[e.jsx("button",{onClick:p,style:{padding:"8px 16px",fontSize:13,color:"#3a3a3a",background:"rgba(255,255,255,0.5)",border:"1px solid rgba(0,0,0,0.1)",borderRadius:8,cursor:"pointer"},children:b("noteModal.cancel","Cancel")}),e.jsxs("button",{onClick:Y,disabled:C,style:{padding:"8px 20px",fontSize:13,color:"#fff",background:"#1A3C30",border:"none",borderRadius:8,cursor:"pointer",display:"flex",alignItems:"center",gap:6,opacity:C?.5:1},children:[C&&e.jsx(L.Loader2,{size:16,style:{animation:"zg-spin 1s linear infinite"}}),b("noteModal.create","Create Note")]})]})]})]})}):null}const ot={"planning.gantt":"PLANEJAMENTO DA OBRA","charts.gantt.month":"Mês","charts.gantt.year":"Ano","charts.gantt.stepName":"NOME DA ETAPA","charts.gantt.start":"INÍCIO","charts.gantt.end":"FIM","charts.gantt.newAction":"Nova Ação","charts.gantt.progress":"Progresso","gantt.filter.steps":"Etapas","gantt.filter.milestones":"Marcos","gantt.filter.events":"Eventos","gantt.filter.notes":"Notas","gantt.newAction.step":"Etapa","gantt.newAction.milestone":"Marco","gantt.newAction.event":"Evento","gantt.newAction.note":"Nota","gantt.group.step":"Etapas","gantt.group.milestone":"Marcos","gantt.group.event":"Eventos","gantt.group.note":"Notas","gantt.tooltip.planned":"Previsto","gantt.tooltip.actual":"Real","gantt.tooltip.plannedInUse":"Previsto (em uso)","gantt.tooltip.start":"Início","gantt.tooltip.end":"Fim","gantt.tooltip.duration":"Duração","gantt.tooltip.progress":"Progresso","gantt.tooltip.date":"Data","gantt.tooltip.attachments":"Anexos","gantt.popup.viewDetails":"Ver detalhes","gantt.popup.edit":"Editar","gantt.popup.delete":"Excluir","gantt.popup.relations":"Relações","gantt.chart.addOn":"Adicionar em","gantt.depType.fs":"Início após Fim","gantt.depType.ss":"Inícios simultâneos","gantt.depType.ff":"Fins simultâneos","gantt.depType.sf":"Fim após Início","gantt.depModal.title":"Tipo de Relação","gantt.depModal.subtitle":"Escolha como as duas tarefas se relacionam","gantt.depModal.fs":"Início após Fim","gantt.depModal.fsDesc":"B começa quando A termina","gantt.depModal.ss":"Inícios simultâneos","gantt.depModal.ssDesc":"A e B começam juntos","gantt.depModal.ff":"Fins simultâneos","gantt.depModal.ffDesc":"A e B terminam juntos","gantt.depModal.sf":"Fim após Início","gantt.depModal.sfDesc":"B termina quando A começa","gantt.depModal.lagLabel":"Atraso (Lag) em dias","gantt.depModal.cancel":"Cancelar","gantt.depModal.create":"Criar Dependência","gantt.depModal.saving":"Salvando...","noteModal.titlePlaceholder":"Título da nota...","noteModal.contentPlaceholder":"Escreva sua nota aqui...","noteModal.attachFiles":"Anexar arquivos","noteModal.removeFile":"Remover","noteModal.dependency":"Dependência","noteModal.none":"Nenhuma","noteModal.milestones":"Marcos","noteModal.cancel":"Cancelar","noteModal.create":"Criar Nota","noteModal.errorEmpty":"Informe o título ou conteúdo da nota.","noteModal.errorSave":"Erro ao criar nota.","noteModal.untitled":"Sem título"};R.NoteModal=tt,R.ProjectGantt=Re,R.ptBR=ot,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(R,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","lucide-react"],e):(R=typeof globalThis<"u"?globalThis:R||self,e(R.ZeGantt={},R.jsxRuntime,R.React,R.lucideReact))})(this,(function(R,e,h,L){"use strict";const Ee=h.createContext(void 0);function Pe({children:o,value:p}){return e.jsx(Ee.Provider,{value:p,children:o})}function ge(){const o=h.useContext(Ee);if(!o)throw new Error("useGanttContext must be used within a GanttProvider");return o}const U={white:"#FFFFFF",dark_gray:"#4F4F4F",gray:"#7B7B7B",light_gray:"#D9D9D9",dark_green:"#1A3C30",water_green:"#7ab7a3",light_green:"#A0D8A8",orange:"#CD6200",yellow:"#FFBB1C",red:"#FF0000"},t={pageBg:"#F8FAFB",surface:U.white,surfaceAlt:"#F7FAF8",headerBg:"#F2F5F3",textTitle:U.dark_green,textPrimary:U.dark_gray,textSecondary:U.gray,textMuted:U.light_gray,group:U.dark_green,groupLight:U.water_green,milestone:U.dark_green,milestoneRing:U.light_green,event:U.orange,note:U.yellow,border:U.light_gray,borderLight:"#ECECEC",weekendBg:"#F4F6F5",today:U.red,todayBg:"#FF000008",arrow:U.gray,arrowHover:U.dark_green},X=50,he=32,Ne=he*2,Ye=460,ee=26,de=28,Me=120,Oe=40,Xe=3.5,te=[{bar:"#D1D8A0",barBorder:"#A0D8A8",progress:"#1A3C30"},{bar:"#A0D8C8",barBorder:"#6BBFA8",progress:"#14534A"},{bar:"#B8C9E8",barBorder:"#8AAAD6",progress:"#2C4A70"},{bar:"#E8C9A0",barBorder:"#D6AA7A",progress:"#6B4510"},{bar:"#D8A0C8",barBorder:"#C47AAE",progress:"#6B2058"},{bar:"#A0C8D8",barBorder:"#74ACBF",progress:"#1A4F60"},{bar:"#C8D8A0",barBorder:"#A8BF74",progress:"#3F5014"},{bar:"#D8B0A0",barBorder:"#C4907A",progress:"#6B3020"},{bar:"#B0A0D8",barBorder:"#937ACE",progress:"#3A2070"},{bar:"#A0D8B0",barBorder:"#70C888",progress:"#1A5030"}],$e={step:"Steps",milestone:"Milestones",event:"Events",note:"Notes"};function _e(){const{props:o,t:p,viewMode:g,setViewMode:m,visibleTypes:f,setVisibleTypes:w,newActionOpen:b,setNewActionOpen:M,newActionRef:I}=ge(),{projectName:y,onAddNewStage:D,onAddMilestone:v,onAddEvent:$,onAddNote:S}=o,z=n=>{w(s=>{const k=new Set(s);return k.has(n)?k.delete(n):k.add(n),k})};return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"20px 24px",borderBottom:`1px solid ${t.border}`,background:`linear-gradient(180deg, ${t.headerBg} 0%, ${t.surface} 100%)`},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[e.jsxs("div",{children:[e.jsx("h3",{style:{margin:0,fontSize:14,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",color:t.textTitle},children:p("planning.gantt","Project Planning")}),e.jsx("div",{style:{height:2.5,width:64,marginTop:6,borderRadius:9999,background:`linear-gradient(90deg, ${t.group}, ${t.milestoneRing})`}})]}),y&&e.jsx("span",{style:{fontSize:12,fontWeight:500,padding:"4px 12px",borderRadius:9999,color:t.textSecondary,background:t.surface,border:`1px solid ${t.border}`},children:y})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("div",{style:{display:"flex",padding:4,borderRadius:8,background:"rgba(122,122,122,0.07)",border:`1px solid ${t.borderLight}`},children:["day","month"].map(n=>e.jsx("button",{onClick:()=>m(n),style:{padding:"6px 20px",fontSize:12,fontWeight:600,borderRadius:6,transition:"all 0.2s",border:"none",cursor:"pointer",...g===n?{background:t.surface,color:t.group,boxShadow:"0 1px 3px rgb(0 0 0 / 0.08)"}:{background:"transparent",color:t.textSecondary}},children:n==="day"?p("charts.gantt.month","Month"):p("charts.gantt.year","Year")},n))}),e.jsx("div",{style:{display:"flex",padding:4,borderRadius:8,gap:2,background:"rgba(122,122,122,0.07)",border:`1px solid ${t.borderLight}`},children:[{type:"step",label:p("gantt.filter.steps","Steps"),icon:e.jsx("div",{style:{width:10,height:10,borderRadius:2,background:te[0].bar,border:`1px solid ${te[0].barBorder}`}})},{type:"milestone",label:p("gantt.filter.milestones","Milestones"),icon:e.jsx(L.Flag,{size:11,style:{color:t.milestone}})},{type:"event",label:p("gantt.filter.events","Events"),icon:e.jsx(L.Clock,{size:11,style:{color:t.event}})},{type:"note",label:p("gantt.filter.notes","Notes"),icon:e.jsx(L.MessageCircle,{size:11,style:{color:t.note}})}].map(n=>{const s=f.has(n.type);return e.jsxs("button",{onClick:()=>z(n.type),style:{display:"flex",alignItems:"center",gap:6,padding:"6px 12px",fontSize:11,fontWeight:600,borderRadius:6,transition:"all 0.2s",border:"none",cursor:"pointer",...s?{background:t.surface,color:t.group,boxShadow:"0 1px 3px rgb(0 0 0 / 0.08)"}:{background:"transparent",color:t.textMuted,opacity:.5}},children:[n.icon,e.jsx("span",{children:n.label})]},n.type)})}),D&&e.jsxs("div",{ref:I,style:{position:"relative"},children:[e.jsxs("button",{onClick:()=>M(n=>!n),style:{display:"flex",alignItems:"center",gap:8,padding:"10px 20px",borderRadius:8,fontSize:14,fontWeight:600,color:"#fff",border:"none",cursor:"pointer",background:`linear-gradient(135deg, ${t.group}, ${t.group}dd)`,transition:"all 0.2s"},children:[e.jsx(L.Plus,{size:16}),e.jsx("span",{children:p("charts.gantt.newAction","New Action")}),e.jsx(L.ChevronDown,{size:14,style:{opacity:.7,transform:b?"rotate(180deg)":"none",transition:"transform 0.18s"}})]}),b&&e.jsx("div",{style:{position:"absolute",top:"calc(100% + 6px)",right:0,zIndex:99999,background:"#fff",borderRadius:10,boxShadow:"0 12px 40px rgba(0,0,0,0.15), 0 3px 10px rgba(0,0,0,0.08)",border:`1.5px solid ${t.borderLight}`,width:200,overflow:"hidden",padding:"5px 5px"},onClick:n=>n.stopPropagation(),children:[{label:p("gantt.newAction.step","Step"),icon:e.jsx("div",{style:{width:14,height:14,borderRadius:3,background:te[0].bar,border:`1.5px solid ${te[0].barBorder}`,flexShrink:0}}),action:()=>{D(),M(!1)}},{label:p("gantt.newAction.milestone","Milestone"),icon:e.jsx("div",{style:{width:22,height:22,borderRadius:"50%",background:`${t.milestoneRing}30`,border:`1.5px solid ${t.milestoneRing}`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Flag,{size:11,style:{color:t.milestone}})}),action:()=>{v?.(),M(!1)}},{label:p("gantt.newAction.event","Event"),icon:e.jsx("div",{style:{width:22,height:22,borderRadius:"50%",background:`${t.event}18`,border:`1.5px solid ${t.event}55`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Clock,{size:11,style:{color:t.event}})}),action:()=>{$?.(),M(!1)}},{label:p("gantt.newAction.note","Note"),icon:e.jsx("div",{style:{width:16,height:20,background:t.note,borderRadius:2,boxShadow:"1px 1px 3px rgba(0,0,0,0.14)",position:"relative",overflow:"visible",flexShrink:0},children:e.jsx("div",{style:{position:"absolute",top:-2,left:"50%",transform:"translateX(-50%)",width:10,height:4,background:"rgba(255,255,255,0.55)",borderRadius:1}})}),action:()=>{S?.(),M(!1)}}].map(n=>e.jsxs("button",{onClick:n.action,style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"8px 10px",borderRadius:7,border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:500,color:t.textPrimary,textAlign:"left",transition:"background 0.12s"},onMouseEnter:s=>{s.currentTarget.style.background=t.headerBg},onMouseLeave:s=>{s.currentTarget.style.background="transparent"},children:[n.icon,n.label]},n.label))})]})]})]})}const Ae=864e5,J=(o,p)=>new Date(o.getTime()+p*Ae),le=(o,p)=>Math.round((p.getTime()-o.getTime())/Ae),ze=o=>new Date(o.getFullYear(),o.getMonth(),1),De=o=>new Date(o.getFullYear(),o.getMonth()+1,0),Z=o=>`${String(o.getDate()).padStart(2,"0")}/${String(o.getMonth()+1).padStart(2,"0")}/${o.getFullYear()}`,We=(o,p="en")=>new Intl.DateTimeFormat(p,{month:"long"}).format(o).toUpperCase();function Ge(){const{props:o,t:p,displayRows:g,leftBodyRef:m,handleLeftScroll:f,toggleProject:w,toggleGroup:b,hoveredTaskId:M,setHoveredTaskId:I,selectedTaskId:y,setSelectedTaskId:D,delayedIds:v,criticalIds:$,relatedIds:S}=ge(),z=n=>({id:n.id,name:n.name,start:n.start,end:n.end,type:n.originalType==="step"?"task":"milestone",progress:n.progress});return e.jsxs("div",{style:{width:Ye,flexShrink:0,borderRight:`1px solid ${t.border}`,display:"flex",flexDirection:"column",height:"100%"},children:[e.jsxs("div",{style:{boxSizing:"border-box",display:"flex",alignItems:"center",padding:"0 16px",height:Ne,background:t.headerBg,borderBottom:`1px solid ${t.border}`},children:[e.jsx("div",{style:{flex:1,fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",color:t.textSecondary},children:p("charts.gantt.stepName","STEP NAME")}),e.jsx("div",{style:{width:80,fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",textAlign:"center",color:t.textSecondary},children:p("charts.gantt.start","START")}),e.jsx("div",{style:{width:80,fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",textAlign:"center",color:t.textSecondary},children:p("charts.gantt.end","END")})]}),e.jsx("div",{ref:m,onScroll:f,className:"zg-no-scrollbar",style:{overflowY:"auto",overflowX:"hidden",flex:1},children:e.jsx("div",{style:{height:Math.max(g.length*X,400)+80,position:"relative"},children:g.map(n=>{if(n.kind==="projectHeader")return e.jsx("div",{style:{boxSizing:"border-box",display:"flex",alignItems:"center",padding:"0 16px",cursor:"pointer",userSelect:"none",height:X,borderBottom:`1.5px solid ${t.group}44`,background:`${t.group}0E`},onClick:()=>w(n.projectId),children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:[n.collapsed?e.jsx(L.ChevronRight,{size:15,style:{color:t.group,flexShrink:0}}):e.jsx(L.ChevronDown,{size:15,style:{color:t.group,flexShrink:0}}),e.jsx("span",{style:{fontSize:12,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",color:t.group,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.projectTitle})]})},`ph-${n.projectId}`);if(n.kind==="group"){const A=n.projectId?`${n.projectId}-${n.groupType}`:n.groupType;return e.jsx("div",{style:{boxSizing:"border-box",display:"flex",alignItems:"center",padding:"0 16px",cursor:"pointer",userSelect:"none",height:X,borderBottom:`1px solid ${t.border}`,background:t.headerBg},onClick:()=>b(A),children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:[n.collapsed?e.jsx(L.ChevronRight,{size:14,style:{color:t.textSecondary,flexShrink:0}}):e.jsx(L.ChevronDown,{size:14,style:{color:t.textSecondary,flexShrink:0}}),e.jsx("span",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",color:t.textTitle},children:p(`gantt.group.${n.groupType}`,n.label)}),e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 6px",borderRadius:9999,background:"rgba(0,0,0,0.06)",color:t.textSecondary},children:n.count})]})},`g-${A}`)}const s=n.task,k=y===s.id,c=M===s.id,C=s.originalType!=="step",u=v.has(s.id),T=$.has(s.id),i=y!==null&&s.id!==y&&!S.has(s.id),x=y!==null&&S.has(s.id),N=u?"#FFF5F5":k?t.groupLight:x?`${t.groupLight}99`:c?t.pageBg:t.surface;return e.jsxs("div",{style:{boxSizing:"border-box",display:"flex",alignItems:"center",padding:"0 16px",cursor:"pointer",transition:"opacity 0.18s, background 0.15s",height:X,borderBottom:`1px solid ${t.borderLight}`,background:N,borderLeft:k?`3px solid ${t.group}`:x?`3px solid ${t.group}66`:T?`3px solid ${t.today}`:void 0,opacity:i?.3:1},onClick:()=>D(A=>A===s.id?null:s.id),onDoubleClick:()=>o.onTaskClick?.(z(s)),onMouseEnter:()=>I(s.id),onMouseLeave:()=>I(null),children:[e.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:8,minWidth:0,paddingRight:8},children:[s.originalType==="step"&&e.jsx("div",{style:{flexShrink:0,borderRadius:4,width:14,height:14,background:te[s.colorIdx??0].bar,border:`1.5px solid ${te[s.colorIdx??0].barBorder}`}}),s.originalType==="milestone"&&e.jsx("div",{style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",width:22,height:22,background:`${t.milestoneRing}30`,border:`1.5px solid ${t.milestoneRing}`},children:e.jsx(L.Flag,{size:11,style:{color:t.milestone}})}),s.originalType==="event"&&e.jsx("div",{style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",width:22,height:22,background:`${t.event}18`,border:`1.5px solid ${t.event}55`},children:e.jsx(L.Clock,{size:11,style:{color:t.event}})}),s.originalType==="note"&&e.jsx("div",{style:{flexShrink:0,width:16,height:20,background:s.noteColor||t.note,borderRadius:2,boxShadow:"1px 1px 3px rgba(0,0,0,0.14)",position:"relative",overflow:"visible"},children:e.jsx("div",{style:{position:"absolute",top:-2,left:"50%",transform:"translateX(-50%)",width:10,height:4,background:"rgba(255,255,255,0.55)",borderRadius:1}})}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[e.jsx("span",{style:{fontSize:13,fontWeight:500,lineHeight:1.25,color:k?t.group:u?t.today:t.textPrimary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.name}),s.originalType==="note"&&s.noteProjectTitle&&e.jsx("span",{style:{fontSize:10,color:t.textSecondary,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.noteProjectTitle})]}),s.originalType==="note"&&(s.filesCount||0)>0&&e.jsxs("span",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:2,fontSize:10,padding:"2px 6px",borderRadius:9999,color:t.textSecondary,background:t.headerBg,border:`1px solid ${t.borderLight}`},children:[e.jsx(L.Paperclip,{size:9}),s.filesCount]}),u&&e.jsx(L.AlertTriangle,{size:12,style:{flexShrink:0,color:t.today}})]}),e.jsx("div",{style:{width:80,fontSize:11,fontWeight:500,textAlign:"center",fontVariantNumeric:"tabular-nums",color:u?t.today:t.textMuted},children:Z(s.start)}),e.jsx("div",{style:{width:80,fontSize:11,fontWeight:500,textAlign:"center",fontVariantNumeric:"tabular-nums",color:u?t.today:t.textMuted},children:C?"—":Z(s.end)})]},s.id)})})})]})}function He(o,p,g="en"){const m=p==="day"?Oe:Xe,f=(n,s)=>{const k=[],c=new Date().toDateString();let C=-1;for(let u=0;u<s;u++){const T=J(n,u),i=T.toDateString()===c;i&&(C=u),k.push({date:T,isToday:i,isWeekend:T.getDay()===0||T.getDay()===6})}return{daysArr:k,todayIndex:C}};if(o.length===0){const n=new Date,s=ze(n),k=De(n),c=le(s,k)+1,{daysArr:C,todayIndex:u}=f(s,c);return{start:s,end:k,totalDays:c,dayWidth:m,totalWidth:c*m,months:[{date:s,label:`${We(s,g)} ${s.getFullYear()}`,startDay:0,days:c,width:c*m}],years:[{label:s.getFullYear().toString(),width:c*m}],days:C,todayIndex:u}}let w=new Date(o[0].start),b=new Date(o[0].end);o.forEach(n=>{n.start<w&&(w=new Date(n.start)),n.end>b&&(b=new Date(n.end))});const M=ze(J(w,-14)),I=De(J(b,14)),y=le(M,I)+1,D=[];let v=new Date(M);for(;v<=I;){const n=De(v),s=n>I?I:n,k=le(M,v),c=le(v,s)+1;D.push({date:new Date(v),label:`${We(v,g)} ${v.getFullYear()}`,startDay:k,days:c,width:c*m}),v=new Date(v.getFullYear(),v.getMonth()+1,1)}const{daysArr:$,todayIndex:S}=f(M,y),z=[];if(p==="month"){let n="",s=0;for(const k of D){const c=k.date.getFullYear().toString();c!==n?(n&&z.push({label:n,width:s*m}),n=c,s=k.days):s+=k.days}n&&z.push({label:n,width:s*m})}return{start:M,end:I,totalDays:y,dayWidth:m,totalWidth:y*m,months:D,years:z,days:$,todayIndex:S}}function re(o,p){return le(p.start,o)*p.dayWidth}function Ve({task:o,x:p,y:g,w:m,progW:f,isHov:w,isDrag:b,isResize:M,isCritical:I,isDelayed:y,isConnectTarget:D,showDots:v,isBarDimmed:$,isBarHighlighted:S,commonEvents:z,handleResizeMouseDown:n,handleConnectDotMouseDown:s}){const{timeline:k,viewMode:c}=ge();if(o.originalType==="step"){const C=te[o.colorIdx??0],u=g+(X-ee)/2,T=!!(o.previsionStart&&o.previsionEnd),i=T?re(o.previsionStart,k):0,x=T?Math.max(re(o.previsionEnd,k)-i,c==="month"?k.dayWidth:6):0,N=u+ee+3;return e.jsxs(e.Fragment,{children:[T&&e.jsx("div",{title:`Previsto: ${Z(o.previsionStart)} → ${Z(o.previsionEnd)}`,style:{position:"absolute",left:i,top:N,width:x,height:5,borderRadius:3,background:`${C.progress}33`,border:`1.5px solid ${C.progress}66`,boxShadow:`inset 0 0 0 1px ${C.progress}22`,pointerEvents:"none",zIndex:5}}),e.jsxs("div",{"data-task-id":o.id,...z,style:{position:"absolute",left:p,top:u,width:m,height:ee,borderRadius:ee/2,background:y?"linear-gradient(135deg, #fdd, #fee)":C.bar,border:I?`2px solid ${t.today}`:y?`1.5px solid ${t.today}88`:`1.5px solid ${C.barBorder}`,cursor:b||M?"grabbing":"grab",zIndex:w||D?20:10,boxShadow:D?`0 0 0 2px ${t.group}, 0 4px 16px ${t.group}33`:I?`0 0 0 1px ${t.today}44, 0 3px 12px ${t.today}22`:S&&!w?`0 0 0 2px ${t.group}99, 0 3px 14px ${t.group}33`:w?`0 3px 12px ${C.progress}22`:"none",transform:w?"scaleY(1.06)":"scaleY(1)",opacity:$?.15:1,transition:b||M?"none":"box-shadow 0.2s, transform 0.15s, opacity 0.18s",overflow:"visible"},children:[e.jsxs("div",{style:{position:"absolute",left:0,top:0,width:m,height:"100%",borderRadius:ee/2,overflow:"hidden",pointerEvents:"none"},children:[e.jsx("div",{style:{position:"absolute",left:0,top:0,width:f,height:"100%",background:y?`linear-gradient(90deg, ${t.today}cc, ${t.today}88)`:`linear-gradient(90deg, ${C.progress}, ${C.progress}cc)`,borderRadius:`${ee/2}px 0 0 ${ee/2}px`,transition:b||M?"none":"width 0.3s"}}),m>50&&e.jsxs("span",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:700,letterSpacing:"0.05em",color:o.progress>50?"#fff":y?t.today:C.progress,zIndex:1,pointerEvents:"none"},children:[Math.round(o.progress),"%"]})]}),e.jsx("div",{onMouseDown:A=>n(A,o,"left"),style:{position:"absolute",left:0,top:0,width:8,height:"100%",cursor:"col-resize",zIndex:2,borderRadius:`${ee/2}px 0 0 ${ee/2}px`}}),e.jsx("div",{onMouseDown:A=>n(A,o,"right"),style:{position:"absolute",right:0,top:0,width:8,height:"100%",cursor:"col-resize",zIndex:2,borderRadius:`0 ${ee/2}px ${ee/2}px 0`}}),v&&e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-task-id":o.id,onMouseDown:A=>s(A,o,"left"),style:{position:"absolute",left:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}}),e.jsx("div",{"data-task-id":o.id,onMouseDown:A=>s(A,o,"right"),style:{position:"absolute",right:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}})]})]})]})}if(o.originalType==="milestone"){const C=g+(X-de)/2;return e.jsxs("div",{"data-task-id":o.id,...z,style:{position:"absolute",left:p-6,top:C,height:de,minWidth:Me,borderRadius:de/2,background:I?"linear-gradient(135deg, #fee, #fff5f5)":"linear-gradient(135deg, #e8f5ee, #f0f8f4)",border:D?`2px solid ${t.group}`:I?`2px solid ${t.today}`:`1.5px solid ${t.milestoneRing}`,display:"flex",alignItems:"center",gap:6,paddingLeft:4,paddingRight:12,cursor:b?"grabbing":"grab",zIndex:w||D?20:10,boxShadow:D?`0 0 0 2px ${t.group}, 0 4px 16px ${t.group}33`:I?`0 0 0 1px ${t.today}44, 0 3px 12px ${t.today}22`:S&&!w?`0 0 0 2px ${t.group}99, 0 3px 14px ${t.group}33`:w?`0 3px 12px ${t.milestone}22`:"0 1px 3px rgba(0,0,0,0.06)",opacity:$?.15:1,transition:"box-shadow 0.2s, transform 0.15s, opacity 0.18s",transform:w?"translateY(-1px)":"none",whiteSpace:"nowrap",overflow:"visible"},children:[e.jsx("div",{style:{width:20,height:20,borderRadius:"50%",background:I?t.today:t.milestone,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Flag,{size:11,color:"#fff",strokeWidth:2.5})}),e.jsx("span",{style:{fontSize:11,fontWeight:600,color:I?t.today:t.milestone,overflow:"hidden",textOverflow:"ellipsis",maxWidth:130},children:o.name}),o.progress>=100&&e.jsx("span",{style:{fontSize:9,fontWeight:700,color:"#fff",background:t.milestoneRing,borderRadius:6,padding:"1px 5px"},children:"✓"}),v&&e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-task-id":o.id,onMouseDown:u=>s(u,o,"left"),style:{position:"absolute",left:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}}),e.jsx("div",{"data-task-id":o.id,onMouseDown:u=>s(u,o,"right"),style:{position:"absolute",right:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}})]})]})}if(o.originalType==="event"){const C=g+(X-de)/2;return e.jsxs("div",{"data-task-id":o.id,...z,style:{position:"absolute",left:p-6,top:C,height:de,minWidth:Me,borderRadius:de/2,background:I?"linear-gradient(135deg, #fee, #fff5f5)":"linear-gradient(135deg, #fff7ed, #ffedd5)",border:D?`2px solid ${t.group}`:I?`2px solid ${t.today}`:`1.5px solid ${t.event}`,display:"flex",alignItems:"center",gap:6,paddingLeft:4,paddingRight:12,cursor:b?"grabbing":"grab",zIndex:w||D?20:10,boxShadow:D?`0 0 0 2px ${t.group}, 0 4px 16px ${t.group}33`:I?`0 0 0 1px ${t.today}44, 0 3px 12px ${t.today}22`:S&&!w?`0 0 0 2px ${t.group}99, 0 3px 14px ${t.group}33`:w?`0 3px 12px ${t.event}33`:"0 1px 3px rgba(0,0,0,0.06)",opacity:$?.15:1,transition:"box-shadow 0.2s, transform 0.15s, opacity 0.18s",transform:w?"translateY(-1px)":"none",whiteSpace:"nowrap",overflow:"visible"},children:[e.jsx("div",{style:{width:20,height:20,borderRadius:"50%",background:I?t.today:t.event,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Clock,{size:11,color:"#fff",strokeWidth:2.5})}),e.jsx("span",{style:{fontSize:11,fontWeight:600,color:I?t.today:t.event,overflow:"hidden",textOverflow:"ellipsis",maxWidth:130},children:o.name}),o.progress>=100&&e.jsx("span",{style:{fontSize:9,fontWeight:700,color:"#fff",background:t.event,borderRadius:6,padding:"1px 5px"},children:"✓"}),v&&e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-task-id":o.id,onMouseDown:u=>s(u,o,"left"),style:{position:"absolute",left:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}}),e.jsx("div",{"data-task-id":o.id,onMouseDown:u=>s(u,o,"right"),style:{position:"absolute",right:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}})]})]})}if(o.originalType==="note"){const u=g+4,T=o.noteColor||"#FEF08A",i=o.filesCount||0;return e.jsxs("div",{"data-task-id":o.id,...z,style:{position:"absolute",left:p,top:u,width:148,minHeight:72,background:T,borderRadius:3,cursor:b?"grabbing":"grab",zIndex:w||D?20:10,boxShadow:D?`0 0 0 2px ${t.group}, 4px 6px 16px rgba(0,0,0,0.22)`:S&&!w?`0 0 0 2px ${t.group}99, 3px 4px 14px rgba(0,0,0,0.18)`:w?"4px 6px 18px rgba(0,0,0,0.22)":"2px 3px 8px rgba(0,0,0,0.13)",opacity:$?.2:1,transition:b?"none":"box-shadow 0.2s, transform 0.15s, opacity 0.18s",transform:w?"rotate(-1.5deg) scale(1.03) translateY(-2px)":"rotate(0deg)",border:"1px solid rgba(0,0,0,0.06)",padding:"12px 10px 10px",display:"flex",flexDirection:"column",gap:2,userSelect:"none"},children:[e.jsx("div",{style:{position:"absolute",top:-6,left:"50%",transform:"translateX(-50%)",width:40,height:11,background:"rgba(255,255,255,0.55)",borderRadius:2,boxShadow:"0 1px 3px rgba(0,0,0,0.08)"}}),e.jsx("span",{style:{fontSize:13,fontWeight:700,color:"#1a1a1a",lineHeight:"1.3",wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:o.name}),o.projectTitle&&e.jsx("span",{style:{fontSize:10,fontWeight:400,color:"rgba(0,0,0,0.55)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.projectTitle}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:2},children:[e.jsx("span",{style:{fontSize:9,fontWeight:500,color:"rgba(0,0,0,0.45)"},children:Z(o.start)}),i>0&&e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:2,fontSize:9,color:"rgba(0,0,0,0.45)"},children:[e.jsx(L.Paperclip,{size:8})," ",i]})]}),v&&e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-task-id":o.id,onMouseDown:x=>s(x,o,"left"),style:{position:"absolute",left:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}}),e.jsx("div",{"data-task-id":o.id,onMouseDown:x=>s(x,o,"right"),style:{position:"absolute",right:-7,top:"50%",transform:"translateY(-50%)",width:14,height:14,borderRadius:"50%",background:t.group,border:"2.5px solid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",cursor:"crosshair",zIndex:30}})]})]})}return null}function Ue(){const{arrows:o,hoveredTaskId:p,selectedTaskId:g,relatedIds:m}=ge();return e.jsx(e.Fragment,{children:o.map((f,w)=>{const b=p===f.predId||p===f.succId,M=!g||f.predId===g||f.succId===g||m.has(f.predId)||m.has(f.succId),I=g!==null&&M,y=b?t.arrowHover:I?t.group:t.arrow;return e.jsxs("g",{style:{opacity:M?I?1:void 0:.08,transition:"opacity 0.18s"},children:[e.jsx("path",{d:f.path,fill:"none",stroke:y,strokeWidth:I?2.5:b?2:1.5,style:{transition:"stroke 0.2s, stroke-width 0.2s"}}),e.jsx("polygon",{points:`${f.headX},${f.headY} ${f.headX-6},${f.headY-4} ${f.headX-6},${f.headY+4}`,fill:y,style:{transition:"fill 0.2s"}})]},w)})})}const Ce=o=>({id:o.id,name:o.name,start:o.start,end:o.end,type:o.originalType==="step"?"task":o.originalType,progress:o.progress}),fe=(o,p)=>{switch(o){case"step":return e.jsx("div",{style:{width:12,height:12,borderRadius:2,background:te[p??0].bar,border:`1.5px solid ${te[p??0].barBorder}`,flexShrink:0}});case"milestone":return e.jsx("div",{style:{width:16,height:16,borderRadius:"50%",background:t.milestone,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Flag,{size:8,color:"#fff"})});case"event":return e.jsx("div",{style:{width:16,height:16,borderRadius:"50%",background:t.event,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(L.Clock,{size:8,color:"#fff"})});case"note":return e.jsx("div",{style:{width:12,height:14,background:t.note,borderRadius:2,boxShadow:"1px 1px 2px rgba(0,0,0,0.1)",flexShrink:0}});default:return null}};function qe(){const{props:o,viewMode:p,timeline:g,displayRows:m,dragState:f,resizeState:w,connectState:b,pendingConnection:M,setPendingConnection:I,depModalType:y,setDepModalType:D,depModalLag:v,setDepModalLag:$,depCreating:S,deletingDepId:z,setDeletingDepId:n,chartMenu:s,setChartMenu:k,rightBodyRef:c,timeHeaderRef:C,handleChartMouseDown:u,handleChartWheel:T,openChartMenu:i,handleRightScroll:x,hoveredTaskId:N,setHoveredTaskId:A,selectedTaskId:q,setSelectedTaskId:Y,tooltip:a,setTooltip:O,popupState:G,setPopupState:K,criticalIds:V,delayedIds:se,relatedIds:ce,handleBarMouseDown:we,handleResizeMouseDown:ue,handleConnectDotMouseDown:Se,handleCreateDependency:ke}=ge(),{translations:ie,onViewStage:ye,onEditStage:j,onDeleteStage:_,onDeleteDependency:xe,onAddNewStage:me,onAddMilestone:Ie,onAddEvent:Te,onAddNote:ae}=o,F=(r,d)=>ie?typeof ie=="function"?ie(r,d):ie[r]||d:d,be=(r,d)=>Math.round((d.getTime()-r.getTime())/864e5)+1,oe=Math.max(m.length*X,400)+80,ve=()=>K({isOpen:!1,position:{x:0,y:0},task:null});return e.jsxs("div",{style:{flex:1,width:"100%",background:"#FAFAFA",display:"flex",flexDirection:"column",position:"relative",overflow:"hidden",borderLeft:`1px solid ${t.borderLight}`},children:[e.jsx("div",{ref:C,style:{boxSizing:"border-box",height:he*2,background:t.headerBg,borderBottom:`1px solid ${t.borderLight}`,overflow:"hidden",position:"relative",flexShrink:0,boxShadow:"0 1px 3px rgba(0,0,0,0.02)"},onWheel:T,children:e.jsxs("div",{style:{width:g.totalWidth,height:"100%",position:"relative"},children:[e.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,height:he,display:"flex"},children:[p==="day"&&g.months.map((r,d)=>e.jsx("div",{style:{width:r.width,position:"relative",height:"100%",borderRight:`1px solid ${t.borderLight}`,paddingLeft:12,display:"flex",alignItems:"flex-end",paddingBottom:6},children:e.jsx("span",{style:{fontSize:13,fontWeight:700,color:t.textTitle,letterSpacing:"0.02em"},children:r.label})},d)),p==="month"&&g.years?.map((r,d)=>e.jsx("div",{style:{width:r.width,position:"relative",height:"100%",borderRight:`1px solid ${t.borderLight}`,paddingLeft:12,display:"flex",alignItems:"flex-end",paddingBottom:6},children:e.jsx("span",{style:{fontSize:13,fontWeight:700,color:t.textTitle,letterSpacing:"0.02em"},children:r.label})},d))]}),e.jsxs("div",{style:{position:"absolute",top:he,left:0,right:0,height:he,display:"flex"},children:[p==="day"&&g.days.map((r,d)=>{const l=r.isToday;return e.jsx("div",{style:{width:g.dayWidth,position:"relative",height:"100%",borderRight:`1px solid ${t.borderLight}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{fontSize:11,fontWeight:l?800:500,color:l?t.today:t.textSecondary,letterSpacing:"-0.03em"},children:r.date.getDate().toString().padStart(2,"0")})},d)}),p==="month"&&g.months.map((r,d)=>e.jsx("div",{style:{width:r.width,position:"relative",height:"100%",borderRight:`1px solid ${t.borderLight}`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{fontSize:11,fontWeight:600,color:t.textPrimary,textTransform:"uppercase",letterSpacing:"0.05em"},children:r.label.substring(0,3)})},d))]})]})}),e.jsx("div",{ref:c,className:"zg-no-scrollbar",style:{flex:1,overflow:"auto",background:"#fff",position:"relative"},onScroll:x,onMouseDown:u,onWheel:T,onContextMenu:i,children:e.jsxs("div",{style:{width:g.totalWidth,height:oe,position:"relative"},children:[e.jsxs("svg",{width:g.totalWidth,height:oe,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[e.jsxs("defs",{children:[e.jsx("pattern",{id:"gantt-y-lines",x:"0",y:"0",width:g.dayWidth,height:X,patternUnits:"userSpaceOnUse",children:e.jsx("line",{x1:g.dayWidth,y1:"0",x2:g.dayWidth,y2:X,stroke:t.border,strokeWidth:"1",strokeDasharray:"4 4",opacity:"0.4"})}),e.jsx("pattern",{id:"gantt-x-lines",x:"0",y:"0",width:g.dayWidth,height:X,patternUnits:"userSpaceOnUse",children:e.jsx("line",{x1:"0",y1:X,x2:g.dayWidth,y2:X,stroke:t.borderLight,strokeWidth:"1"})})]}),e.jsx("rect",{width:"100%",height:"100%",fill:"url(#gantt-x-lines)"}),e.jsx("rect",{width:"100%",height:"100%",fill:"url(#gantt-y-lines)"}),p==="day"&&g.days.map((r,d)=>r.isWeekend?e.jsx("rect",{x:d*g.dayWidth,y:0,width:g.dayWidth,height:oe,fill:t.weekendBg,opacity:.6},`we-${d}`):null),p==="month"&&g.days.map((r,d)=>r.isWeekend?e.jsx("rect",{x:d*g.dayWidth,y:0,width:g.dayWidth,height:oe,fill:t.weekendBg,opacity:.3},`wem-${d}`):null),g.todayIndex>=0&&e.jsxs("g",{children:[e.jsx("rect",{x:g.todayIndex*g.dayWidth,y:0,width:g.dayWidth,height:oe,fill:t.todayBg}),e.jsx("line",{x1:(g.todayIndex+.5)*g.dayWidth,y1:0,x2:(g.todayIndex+.5)*g.dayWidth,y2:oe,stroke:t.today,strokeWidth:2,strokeDasharray:"4 4",opacity:.3})]})]}),m.map((r,d)=>r.kind==="group"||r.kind==="projectHeader"?e.jsx("div",{style:{boxSizing:"border-box",position:"absolute",left:0,top:d*X,width:"100%",height:X,background:r.kind==="projectHeader"?t.headerBg:`${t.groupLight}15`,borderBottom:`1px solid ${t.borderLight}`,pointerEvents:"none"}},`bg-${d}`):null),e.jsxs("div",{style:{position:"absolute",inset:0},children:[m.map((r,d)=>{if(r.kind!=="task")return null;const l=r.task,E=f?.task.id===l.id,B=w?.task.id===l.id,P=E||B&&w.edge==="left"?J(l.start,E?f.offsetDays:w.offsetDays):l.start,W=E||B&&w.edge==="right"?J(l.end,E?f.offsetDays:w.offsetDays):l.end,pe=l.originalType!=="step";let ne=re(P,g),H=0,Le=0;pe||(H=Math.max(re(W,g)-ne,g.dayWidth),Le=H*(l.progress/100));const je=N===l.id,Fe=q===l.id,rt=se.has(l.id),nt=V.has(l.id),st=!!q&&!Fe&&!ce.has(l.id),at=Fe||!!q&&ce.has(l.id),it=b?.hoverTargetId===l.id,dt=je||Fe,lt=d*X,ct={onMouseEnter:Q=>{A(l.id),!f&&!w&&O({task:l,x:Q.clientX,y:Q.clientY})},onMouseMove:Q=>{N===l.id&&!f&&!w&&O({task:l,x:Q.clientX,y:Q.clientY})},onMouseLeave:()=>{A(null),O(null)},onClick:Q=>{Q.stopPropagation(),Y(l.id),Q.detail===2&&ye?.(Ce(l)),K(!G.isOpen||G.task?.id!==l.id?{isOpen:!0,position:{x:Q.clientX,y:Q.clientY},task:l}:{isOpen:!1,position:{x:0,y:0},task:null})},onMouseDown:Q=>we(Q,l)};return e.jsx(Ve,{task:l,x:ne,y:lt,w:H,progW:Le,isHov:je,isDrag:E,isResize:B,isCritical:nt,isDelayed:rt,isConnectTarget:it,showDots:dt,isBarDimmed:st,isBarHighlighted:at,commonEvents:ct,handleResizeMouseDown:ue,handleConnectDotMouseDown:Se},l.id)}),e.jsx("svg",{width:g.totalWidth,height:oe,style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx(Ue,{})}),a&&!f&&e.jsx("div",{style:{position:"fixed",left:a.x+16,top:a.y-10,zIndex:9999,pointerEvents:"none"},children:e.jsxs("div",{style:{borderRadius:12,padding:"12px 16px",minWidth:220,maxWidth:340,background:`${t.surface}f5`,border:`1px solid ${t.borderLight}`,boxShadow:"0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[fe(a.task.originalType,a.task.colorIdx),e.jsx("span",{style:{fontSize:12,fontWeight:700,color:t.textTitle,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.task.name})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:11,color:t.textSecondary},children:a.task.originalType==="step"?e.jsxs(e.Fragment,{children:[a.task.previsionStart&&a.task.previsionEnd&&e.jsxs("div",{style:{background:`${t.headerBg}`,borderRadius:6,padding:"4px 6px",marginBottom:2},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginBottom:4},children:[e.jsx("div",{style:{width:20,height:4,borderRadius:2,background:`${t.textSecondary}44`,border:`1.5px solid ${t.textSecondary}66`}}),e.jsx("span",{style:{fontSize:9,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:t.textSecondary},children:F("gantt.tooltip.planned","Planned")})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.start","Start"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.previsionStart)})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.end","End"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.previsionEnd)})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.duration","Duration"),":"]}),e.jsxs("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:[be(a.task.previsionStart,a.task.previsionEnd),"d"]})]})]}),e.jsxs("div",{style:{background:a.task.hasActualDates?`${t.groupLight}22`:"transparent",borderRadius:6,padding:"4px 6px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginBottom:4},children:[e.jsx("div",{style:{width:20,height:4,borderRadius:2,background:te[a.task.colorIdx??0].progress}}),e.jsx("span",{style:{fontSize:9,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:a.task.hasActualDates?t.group:t.textSecondary},children:a.task.hasActualDates?F("gantt.tooltip.actual","Actual"):F("gantt.tooltip.plannedInUse","Planned (in use)")})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.start","Start"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.start)})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.end","End"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.end)})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.duration","Duration"),":"]}),e.jsxs("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:[be(a.task.start,a.task.end),"d"]})]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16,paddingTop:4,marginTop:4,borderTop:`1px solid ${t.borderLight}`},children:[e.jsxs("span",{children:[F("charts.gantt.progress","Progress"),":"]}),e.jsxs("span",{style:{fontWeight:700,color:t.group},children:[Math.round(a.task.progress),"%"]})]})]}):a.task.originalType==="note"?e.jsxs(e.Fragment,{children:[a.task.noteProjectTitle&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[e.jsx("div",{style:{width:8,height:8,borderRadius:2,background:a.task.noteColor||t.note,flexShrink:0}}),e.jsx("span",{style:{fontSize:11,fontWeight:600,color:t.textPrimary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.task.noteProjectTitle})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.date","Date"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.start)})]}),(a.task.filesCount||0)>0&&e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("gantt.tooltip.attachments","Attachments"),":"]}),e.jsxs("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:4,color:t.textPrimary},children:[e.jsx(L.Paperclip,{size:10}),a.task.filesCount]})]})]}):e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[e.jsxs("span",{children:[F("charts.gantt.start","Start"),":"]}),e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:t.textPrimary},children:Z(a.task.start)})]})})]})})]})]})}),G.task&&G.isOpen&&(()=>{const r=G.task,d=(o.dependencies||[]).filter(W=>W.predecessorId===r.id||W.successorId===r.id),l={FS:F("gantt.depType.fs","Finish to Start"),SS:F("gantt.depType.ss","Start to Start"),FF:F("gantt.depType.ff","Finish to Finish"),SF:F("gantt.depType.sf","Start to Finish")},E=d.length>0?300:220,B=Math.min(G.position.x,window.innerWidth-E-16),P=G.position.y+8;return e.jsxs("div",{"data-popup":"gantt-action",style:{position:"fixed",left:B,top:P,zIndex:9999,background:"#fff",borderRadius:4,boxShadow:"0 12px 40px rgba(0,0,0,0.14), 0 3px 10px rgba(0,0,0,0.07)",border:`1.5px solid ${t.borderLight}`,width:E,overflow:"hidden"},onMouseDown:W=>W.stopPropagation(),children:[e.jsx("div",{style:{padding:"12px 14px 10px",borderBottom:`1px solid ${t.borderLight}`},children:e.jsx("p",{style:{fontSize:13,fontWeight:700,color:t.group,margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r.name,children:r.name})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2,padding:"8px 6px"},children:[e.jsxs("button",{onClick:()=>{ye?.(Ce(r)),ve()},className:"zg-popup-btn",children:[e.jsx(L.Eye,{size:15})," ",e.jsx("span",{style:{flex:1,textAlign:"left"},children:F("gantt.popup.viewDetails","View details")})]}),e.jsxs("button",{onClick:()=>{j?.(Ce(r)),ve()},className:"zg-popup-btn",children:[e.jsx(L.Edit2,{size:15})," ",e.jsx("span",{style:{flex:1,textAlign:"left"},children:F("gantt.popup.edit","Edit")})]}),e.jsxs("button",{onClick:()=>{_?.(r.id),ve()},className:"zg-popup-btn zg-popup-btn-danger",children:[e.jsx(L.Trash2,{size:15})," ",e.jsx("span",{style:{flex:1,textAlign:"left"},children:F("gantt.popup.delete","Delete")})]})]}),d.length>0&&e.jsxs("div",{style:{borderTop:`1px solid ${t.borderLight}`,padding:"10px 14px 12px"},children:[e.jsxs("div",{style:{fontSize:10,fontWeight:700,color:t.textSecondary,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:8},children:[F("gantt.popup.relations","Relations")," (",d.length,")"]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:d.map(W=>{const pe=W.predecessorId===r.id,ne=pe?W.successorName:W.predecessorName,H=z===W.id;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:8,background:"#f8fafb",border:`1px solid ${t.borderLight}`},children:[e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{fontSize:10,fontWeight:700,color:t.group,marginBottom:2},children:[e.jsx("span",{style:{background:`${t.group}15`,borderRadius:4,padding:"1px 5px"},children:W.type})," ",e.jsx("span",{style:{color:t.textSecondary,fontWeight:500},children:pe?"→ ":"← "}),e.jsx("span",{style:{color:t.textMuted,fontWeight:400,fontSize:9},children:l[W.type]??W.type})]}),e.jsx("div",{style:{fontSize:11,color:t.textPrimary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:ne,children:ne})]}),xe&&e.jsx("button",{disabled:!!H,onClick:async()=>{n(W.id);try{await xe(W.id)}finally{n(null)}},style:{flexShrink:0,padding:"4px 6px",borderRadius:6,border:"none",background:H?"#fee2e2":"transparent",cursor:H?"wait":"pointer",color:"#ef4444",fontSize:14,opacity:H?.5:1,transition:"background 0.12s"},children:H?"⟳":"🗑"})]},W.id)})})]})]})})(),s&&e.jsxs("div",{"data-menu":"chart-create",style:{position:"fixed",left:Math.min(s.x,window.innerWidth-220),top:Math.min(s.y,window.innerHeight-220),zIndex:99999,background:"#fff",borderRadius:10,boxShadow:"0 12px 40px rgba(0,0,0,0.15), 0 3px 10px rgba(0,0,0,0.08)",border:`1.5px solid ${t.borderLight}`,width:200,overflow:"hidden"},onClick:r=>r.stopPropagation(),children:[e.jsx("div",{style:{padding:"9px 13px 8px",borderBottom:`1px solid ${t.borderLight}`,background:t.headerBg},children:e.jsxs("p",{style:{margin:0,fontSize:10,fontWeight:700,color:t.textSecondary,textTransform:"uppercase",letterSpacing:"0.08em"},children:[F("gantt.chart.addOn","Add on")," ",Z(s.date)]})}),e.jsx("div",{style:{padding:"5px 5px"},children:[{label:F("gantt.newAction.step","Step"),icon:fe("step",0),action:()=>{me?.(s.date,s.projectId),k(null)}},{label:F("gantt.newAction.milestone","Milestone"),icon:fe("milestone"),action:()=>{Ie?.(s.date,s.projectId),k(null)}},{label:F("gantt.newAction.event","Event"),icon:fe("event"),action:()=>{Te?.(s.date,s.projectId),k(null)}},{label:F("gantt.newAction.note","Note"),icon:fe("note"),action:()=>{ae?.(s.date,s.projectId),k(null)}}].map(r=>e.jsxs("button",{onClick:r.action,className:"zg-popup-btn",style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"8px 10px",borderRadius:7,border:"none",background:"transparent",cursor:"pointer",fontSize:13,fontWeight:500,color:t.textPrimary,textAlign:"left",transition:"background 0.12s"},children:[r.icon," ",r.label]},r.label))})]}),b&&e.jsxs("svg",{style:{position:"fixed",inset:0,width:"100vw",height:"100vh",pointerEvents:"none",zIndex:99999},children:[e.jsx("defs",{children:e.jsx("marker",{id:"connect-arrow",markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:e.jsx("path",{d:"M0,0 L0,6 L6,3 z",fill:t.group})})}),e.jsx("line",{x1:b.fromScreenX,y1:b.fromScreenY,x2:b.currentScreenX,y2:b.currentScreenY,stroke:t.group,strokeWidth:2.5,strokeDasharray:"8 5",markerEnd:"url(#connect-arrow)",opacity:.85,style:{animation:"zg-dash 0.5s linear infinite"}})]}),M&&e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99998},onClick:()=>I(null),children:e.jsxs("div",{style:{background:"#fff",borderRadius:20,padding:"32px 36px",width:420,boxShadow:"0 24px 80px rgba(0,0,0,0.18), 0 6px 24px rgba(0,0,0,0.08)"},onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("h3",{style:{fontSize:18,fontWeight:700,color:t.textTitle,marginBottom:4},children:F("gantt.depModal.title","Relation Type")}),e.jsx("p",{style:{fontSize:13,color:t.textSecondary},children:F("gantt.depModal.subtitle","Choose how the two tasks relate")})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,marginBottom:20},children:[{type:"FS",label:F("gantt.depModal.fs","Finish to Start"),desc:F("gantt.depModal.fsDesc","B starts when A finishes")},{type:"SS",label:F("gantt.depModal.ss","Start to Start"),desc:F("gantt.depModal.ssDesc","A and B start together")},{type:"FF",label:F("gantt.depModal.ff","Finish to Finish"),desc:F("gantt.depModal.ffDesc","A and B finish together")},{type:"SF",label:F("gantt.depModal.sf","Start to Finish"),desc:F("gantt.depModal.sfDesc","B finishes when A starts")}].map(r=>e.jsxs("button",{onClick:()=>D(r.type),style:{border:y===r.type?`2px solid ${t.group}`:`1.5px solid ${t.borderLight}`,borderRadius:12,padding:"12px 14px",textAlign:"left",cursor:"pointer",background:y===r.type?`${t.group}0d`:"#fafafa"},children:[e.jsx("div",{style:{fontSize:11,fontFamily:"monospace",fontWeight:700,color:t.group,marginBottom:4,background:y===r.type?`${t.group}20`:`${t.group}0d`,borderRadius:6,padding:"2px 6px",display:"inline-block"},children:r.type}),e.jsx("div",{style:{fontSize:13,fontWeight:600,color:t.textTitle,marginBottom:2},children:r.label}),e.jsx("div",{style:{fontSize:11,color:t.textSecondary},children:r.desc})]},r.type))}),e.jsxs("div",{style:{marginBottom:24},children:[e.jsx("label",{style:{display:"block",fontSize:13,fontWeight:600,color:t.textTitle,marginBottom:6},children:F("gantt.depModal.lagLabel","Lag (days)")}),e.jsx("input",{type:"number",value:v,onChange:r=>$(parseInt(r.target.value)||0),style:{width:"100%",padding:"10px 12px",border:`1.5px solid ${t.borderLight}`,borderRadius:8,fontSize:14}})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[e.jsx("button",{onClick:()=>I(null),style:{padding:"10px 16px",borderRadius:8,border:`1px solid ${t.borderLight}`,background:"#fff",cursor:"pointer",fontWeight:600},children:F("gantt.depModal.cancel","Cancel")}),e.jsx("button",{onClick:ke,disabled:S,style:{padding:"10px 16px",borderRadius:8,border:"none",background:t.group,color:"#fff",cursor:S?"wait":"pointer",fontWeight:600},children:S?F("gantt.depModal.saving","Saving..."):F("gantt.depModal.create","Create Dependency")})]})]})})]})}function Ke(o){const p=h.useRef(null),g=h.useRef(null),m=h.useRef(null),f=h.useRef(!1),w=h.useCallback(()=>{if(f.current)return;f.current=!0;const y=g.current;y&&p.current&&(p.current.scrollTop=y.scrollTop),y&&m.current&&(m.current.scrollLeft=y.scrollLeft),f.current=!1},[]),b=h.useCallback(()=>{f.current||(f.current=!0,p.current&&g.current&&(g.current.scrollTop=p.current.scrollTop),f.current=!1)},[]),M=h.useRef(!1);h.useEffect(()=>{if(M.current||!o.totalWidth)return;const y=g.current;if(!y)return;const D=re(new Date,o);if(D>=0&&D<=o.totalWidth){const v=D-y.clientWidth/2;y.scrollLeft=Math.max(0,v),m.current&&(m.current.scrollLeft=y.scrollLeft),M.current=!0}},[o]);const I=h.useCallback(y=>{const D=g.current;if(D)if(y.preventDefault(),y.shiftKey||Math.abs(y.deltaX)>Math.abs(y.deltaY)){const v=y.shiftKey?y.deltaY:y.deltaX;D.scrollLeft+=v,m.current&&(m.current.scrollLeft=D.scrollLeft)}else D.scrollTop+=y.deltaY,p.current&&(p.current.scrollTop=D.scrollTop)},[]);return{leftBodyRef:p,rightBodyRef:g,timeHeaderRef:m,handleRightScroll:w,handleLeftScroll:b,handleChartWheel:I}}function Je(o,p,g,m){const f=new Map;return o.forEach(w=>f.set(w.id,w)),p.map(w=>{const b=f.get(w.predecessorId),M=f.get(w.successorId);if(!b||!M)return null;const I=m.get(b.id),y=m.get(M.id);if(I==null||y==null)return null;const D=b.originalType!=="step",v=M.originalType!=="step",$=D?re(b.start,g)+Me:re(b.end,g),S=I*X+X/2,z=v?re(M.start,g)-10:re(M.start,g),n=y*X+X/2,s=14,k=Math.max($+s,z-s),c=S===n?`M${$},${S} L${z-6},${n}`:`M${$},${S} L${k},${S} L${k},${n} L${z-6},${n}`;return{predId:b.id,succId:M.id,path:c,headX:z-6,headY:n}}).filter(Boolean)}function Ze(o,p){if(o.length===0||p.length===0)return new Set;const g=new Map;o.forEach(c=>g.set(c.id,c));const m=new Set(o.map(c=>c.id)),f=p.filter(c=>m.has(c.predecessorId)&&m.has(c.successorId));if(f.length===0)return new Set;const w=new Map,b=new Map;f.forEach(c=>{w.has(c.predecessorId)||w.set(c.predecessorId,[]),w.get(c.predecessorId).push(c.successorId),b.has(c.successorId)||b.set(c.successorId,[]),b.get(c.successorId).push(c.predecessorId)});const M=c=>Math.max(1,le(c.start,c.end)),I=new Set,y=[];function D(c){I.has(c)||(I.add(c),(w.get(c)||[]).forEach(D),y.unshift(c))}o.forEach(c=>D(c.id));const v=new Map,$=new Map;for(const c of y){const C=g.get(c),u=b.get(c)||[];let T=0;for(const x of u)T=Math.max(T,$.get(x)||0);const i=u.length>0?T:0;v.set(c,i),$.set(c,i+M(C))}let S=0;$.forEach(c=>{c>S&&(S=c)});const z=new Map,n=new Map;for(let c=y.length-1;c>=0;c--){const C=y[c],u=g.get(C),T=w.get(C)||[];let i=S;for(const x of T)i=Math.min(i,z.get(x)??S);n.set(C,T.length>0?i:S),z.set(C,(n.get(C)||0)-M(u))}const s=new Set;f.forEach(c=>{s.add(c.predecessorId),s.add(c.successorId)});const k=new Set;for(const c of y){if(!s.has(c))continue;const C=(z.get(c)||0)-(v.get(c)||0);Math.abs(C)<.5&&k.add(c)}return k}function Qe({steps:o,milestones:p,events:g,notes:m,dependencies:f,viewMode:w,locale:b,groupByProject:M,visibleTypes:I,collapsedGroups:y,collapsedProjects:D,selectedTaskId:v}){const $=h.useMemo(()=>{const u=[];let T=0;return o.forEach(i=>{const x=!!(i.startDate&&i.finishDate),N=i.startDate||i.previsionStartDate,A=i.finishDate||i.previsionFinishDate;if(!N||!A)return;const q=new Date(N),Y=new Date(A);if(isNaN(q.getTime())||isNaN(Y.getTime()))return;Y<=q&&Y.setDate(Y.getDate()+1);let a,O;if(i.previsionStartDate&&i.previsionFinishDate){const V=new Date(i.previsionStartDate),se=new Date(i.previsionFinishDate);!isNaN(V.getTime())&&!isNaN(se.getTime())&&(a=V,O=se<=V?J(V,1):se)}const G=f?.filter(V=>V.successorId===i.id).map(V=>V.predecessorId)||[],K=i.conclusionPercent!=null?Number(i.conclusionPercent):0;u.push({id:i.id,name:i.name,start:q,end:Y,progress:K>1?Math.min(K,100):K*100,originalType:"step",deps:G,colorIdx:T%te.length,previsionStart:a,previsionEnd:O,hasActualDates:x,projectId:i.projectId||void 0,projectTitle:i.projectTitle||void 0}),T++}),p?.forEach(i=>{if(!i.date)return;const x=new Date(i.date);if(isNaN(x.getTime()))return;const N=f?.filter(A=>A.successorId===i.id).map(A=>A.predecessorId)||[];u.push({id:i.id,name:i.name,start:x,end:x,progress:i.finished?100:0,originalType:"milestone",deps:N,projectId:i.projectId||void 0,projectTitle:i.projectTitle||void 0})}),g?.forEach(i=>{if(!i.date)return;const x=new Date(i.date);if(isNaN(x.getTime()))return;const N=f?.filter(A=>A.successorId===i.id).map(A=>A.predecessorId)||[];u.push({id:i.id,name:i.title,start:x,end:x,progress:i.finished?100:0,originalType:"event",deps:N,projectId:i.projectId||void 0,projectTitle:i.projectTitle||void 0})}),m?.forEach(i=>{if(!i.date)return;const x=new Date(i.date);isNaN(x.getTime())||u.push({id:i.id,name:i.title||"Note",start:x,end:x,progress:0,originalType:"note",deps:[],noteCount:1,noteColor:i.color||t.note,filesCount:i.filesCount||0,noteProjectTitle:i.projectTitle||void 0,projectId:i.projectId||void 0,projectTitle:i.projectTitle||void 0})}),u},[o,p,g,m,f]),S=h.useMemo(()=>He($,w,b),[$,w,b]),z=h.useMemo(()=>{const u=[],T=["step","milestone","event","note"];if(M){const i=new Map;$.forEach(x=>{x.projectId&&!i.has(x.projectId)&&i.set(x.projectId,x.projectTitle||x.projectId)});for(const[x,N]of Array.from(i.entries())){const A=D.has(x);if(u.push({kind:"projectHeader",projectId:x,projectTitle:N,collapsed:A}),!A){const q=$.filter(Y=>Y.projectId===x);for(const Y of T){if(!I.has(Y))continue;const a=q.filter(K=>K.originalType===Y);if(a.length===0)continue;const O=`${x}-${Y}`,G=y.has(O);u.push({kind:"group",groupType:Y,label:$e[Y],count:a.length,collapsed:G,projectId:x}),G||a.forEach(K=>u.push({kind:"task",task:K}))}}}}else for(const i of T){if(!I.has(i))continue;const x=$.filter(A=>A.originalType===i);if(x.length===0)continue;const N=y.has(i);u.push({kind:"group",groupType:i,label:$e[i],count:x.length,collapsed:N}),N||x.forEach(A=>u.push({kind:"task",task:A}))}return u},[$,I,y,D,M]),n=h.useMemo(()=>{const u=new Map;return z.forEach((T,i)=>{T.kind==="task"&&u.set(T.task.id,i)}),u},[z]),s=h.useMemo(()=>Je($,f||[],S,n),[$,f,S,n]),k=h.useMemo(()=>Ze($,f||[]),[$,f]),c=h.useMemo(()=>{const u=new Set,T=new Date;return $.forEach(i=>{i.originalType==="step"&&i.end<T&&i.progress<100&&u.add(i.id)}),u},[$]),C=h.useMemo(()=>{if(!v||!f?.length)return new Set;const u=new Set,T=[v];for(;T.length;){const i=T.shift();for(const x of f)x.predecessorId===i&&!u.has(x.successorId)&&(u.add(x.successorId),T.push(x.successorId)),x.successorId===i&&!u.has(x.predecessorId)&&(u.add(x.predecessorId),T.push(x.predecessorId))}return u},[v,f]);return{tasks:$,timeline:S,displayRows:z,taskRowIndex:n,arrows:s,criticalIds:k,delayedIds:c,relatedIds:C}}function Re(o){const[p,g]=h.useState("day"),[m,f]=h.useState(null),[w,b]=h.useState(null),[M,I]=h.useState(null),[y,D]=h.useState({isOpen:!1,position:{x:0,y:0},task:null}),[v,$]=h.useState(null),[S,z]=h.useState(null),[n,s]=h.useState(null),[k,c]=h.useState(null),[C,u]=h.useState("FS"),[T,i]=h.useState(0),[x,N]=h.useState(!1),[A,q]=h.useState(null),[Y,a]=h.useState(null),[O,G]=h.useState(!1),K=h.useRef(null),[V,se]=h.useState(new Set(["step","milestone","event","note"])),[ce,we]=h.useState(new Set),[ue,Se]=h.useState(new Set),ke=h.useCallback(r=>{se(d=>{const l=new Set(d);return l.has(r)?l.delete(r):l.add(r),l})},[]),ie=h.useCallback(r=>{we(d=>{const l=new Set(d);return l.has(r)?l.delete(r):l.add(r),l})},[]),ye=h.useCallback(r=>{Se(d=>{const l=new Set(d);return l.has(r)?l.delete(r):l.add(r),l})},[]),j=Qe({steps:o.steps,milestones:o.milestones,events:o.events,notes:o.notes,dependencies:o.dependencies,viewMode:p,locale:o.locale,visibleTypes:V,collapsedGroups:ce,collapsedProjects:ue,groupByProject:o.groupByProject,selectedTaskId:w||null}),_=Ke(j.timeline),xe=h.useCallback((r,d)=>{r.preventDefault(),r.stopPropagation(),$({task:d,startMouseX:r.clientX,originalStart:new Date(d.start),originalEnd:new Date(d.end),offsetDays:0})},[]),me=h.useCallback((r,d,l)=>{r.preventDefault(),r.stopPropagation(),z({task:d,edge:l,startMouseX:r.clientX,originalStart:new Date(d.start),originalEnd:new Date(d.end),offsetDays:0})},[]),Ie=h.useCallback((r,d,l)=>{r.preventDefault(),r.stopPropagation(),s({fromTaskId:d.id,fromEdge:l,fromScreenX:r.clientX,fromScreenY:r.clientY,currentScreenX:r.clientX,currentScreenY:r.clientY,hoverTargetId:null})},[]),Te=h.useCallback(async()=>{if(!k||!o.onCreateDependency)return;const r=new Map(j.tasks.map(W=>[W.id,W])),d=r.get(k.fromTaskId),l=r.get(k.toTaskId);if(!d||!l)return;const E=W=>W.originalType==="step"?"STEP":"MILESTONE",B=k.fromEdge==="right"?d:l,P=k.fromEdge==="right"?l:d;N(!0);try{await o.onCreateDependency({predecessorId:B.id,predecessorType:E(B),successorId:P.id,successorType:E(P),type:C,lag:T}),c(null)}finally{N(!1)}},[k,j.tasks,o.onCreateDependency,C,T]);h.useEffect(()=>{if(!v)return;const r=l=>{const E=l.clientX-v.startMouseX,B=Math.round(E/j.timeline.dayWidth);B!==v.offsetDays&&$(P=>P?{...P,offsetDays:B}:null)},d=()=>{v.offsetDays!==0&&o.onTaskChange&&o.onTaskChange({id:v.task.id,name:v.task.name,start:J(v.originalStart,v.offsetDays),end:J(v.originalEnd,v.offsetDays),type:v.task.originalType==="step"?"task":"milestone",progress:v.task.progress}),$(null)};return document.addEventListener("mousemove",r),document.addEventListener("mouseup",d),()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",d)}},[v,j.timeline.dayWidth,o.onTaskChange]),h.useEffect(()=>{if(!S)return;const r=l=>{const E=l.clientX-S.startMouseX,B=Math.round(E/j.timeline.dayWidth);B!==S.offsetDays&&z(P=>P?{...P,offsetDays:B}:null)},d=()=>{if(S.offsetDays!==0&&o.onTaskChange){const l=S.edge==="left"?J(S.originalStart,S.offsetDays):S.originalStart,E=S.edge==="right"?J(S.originalEnd,S.offsetDays):S.originalEnd;E>l&&o.onTaskChange({id:S.task.id,name:S.task.name,start:l,end:E,type:"task",progress:S.task.progress})}z(null)};return document.addEventListener("mousemove",r),document.addEventListener("mouseup",d),()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",d)}},[S,j.timeline.dayWidth,o.onTaskChange]),h.useEffect(()=>{if(!n)return;const r=l=>{let E=null;for(const B of document.elementsFromPoint(l.clientX,l.clientY)){const P=B.dataset?.taskId;if(P&&P!==n.fromTaskId){E=P;break}}s(B=>B?{...B,currentScreenX:l.clientX,currentScreenY:l.clientY,hoverTargetId:E}:null)},d=l=>{let E=null;for(const B of document.elementsFromPoint(l.clientX,l.clientY)){const P=B.dataset?.taskId;if(P&&P!==n.fromTaskId){E=P;break}}E&&o.onCreateDependency&&(c({fromTaskId:n.fromTaskId,fromEdge:n.fromEdge,toTaskId:E}),u("FS"),i(0)),s(null)};return document.addEventListener("mousemove",r),document.addEventListener("mouseup",d),()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",d)}},[n?.fromTaskId,n?.fromEdge,o.onCreateDependency]);const[ae,F]=h.useState(null),be=h.useCallback(r=>{if(S||v||r.button===2)return;const d=_.rightBodyRef.current;d&&(r.preventDefault(),F({startX:r.clientX,startY:r.clientY,scrollLeft:d.scrollLeft,scrollTop:d.scrollTop}))},[S,v,_.rightBodyRef]);h.useEffect(()=>{if(!ae)return;const r=l=>{const E=_.rightBodyRef.current;E&&(E.scrollLeft=ae.scrollLeft-(l.clientX-ae.startX),E.scrollTop=ae.scrollTop-(l.clientY-ae.startY),_.leftBodyRef.current&&(_.leftBodyRef.current.scrollTop=E.scrollTop),_.timeHeaderRef.current&&(_.timeHeaderRef.current.scrollLeft=E.scrollLeft))},d=()=>F(null);return document.addEventListener("mousemove",r),document.addEventListener("mouseup",d),()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",d)}},[ae,_.rightBodyRef,_.leftBodyRef,_.timeHeaderRef]);const oe=h.useCallback(r=>{r.preventDefault(),r.stopPropagation();const d=E=>{const B=_.rightBodyRef.current;if(!B)return new Date;const P=B.getBoundingClientRect(),W=E-P.left+B.scrollLeft;return J(j.timeline.start,Math.max(0,Math.floor(W/j.timeline.dayWidth)))},l=E=>{if(!o.groupByProject)return;const B=_.leftBodyRef.current;if(!B)return;const P=B.getBoundingClientRect(),W=E-P.top+B.scrollTop,pe=Math.max(0,Math.floor(W/50));for(let ne=Math.min(pe,j.displayRows.length-1);ne>=0;ne--){const H=j.displayRows[ne];if(H.kind==="projectHeader")return H.projectId;if(H.kind==="task"&&H.task.projectId)return H.task.projectId;if(H.kind==="group"&&H.projectId)return H.projectId}};a({x:r.clientX,y:r.clientY,date:d(r.clientX),projectId:l(r.clientY)}),F(null)},[j.timeline,j.displayRows,o.groupByProject,_.rightBodyRef,_.leftBodyRef]);h.useEffect(()=>{if(!Y)return;const r=E=>{E.key==="Escape"&&a(null)},d=E=>{E.target.closest('[data-menu="chart-create"]')||a(null)},l=()=>a(null);return document.addEventListener("keydown",r),document.addEventListener("click",d),window.addEventListener("scroll",l,!0),()=>{document.removeEventListener("keydown",r),document.removeEventListener("click",d),window.removeEventListener("scroll",l,!0)}},[Y]);const ve=h.useMemo(()=>({props:o,t:(r,d)=>o.translations?typeof o.translations=="function"?o.translations(r,d):o.translations[r]||d||"":d||"",viewMode:p,setViewMode:g,hoveredTaskId:m,setHoveredTaskId:f,selectedTaskId:w,setSelectedTaskId:b,tooltip:M,setTooltip:I,popupState:y,setPopupState:D,dragState:v,setDragState:$,resizeState:S,setResizeState:z,connectState:n,setConnectState:s,visibleTypes:V,setVisibleTypes:se,toggleVisibility:ke,collapsedGroups:ce,setCollapsedGroups:we,toggleGroup:ie,collapsedProjects:ue,setCollapsedProjects:Se,toggleProject:ye,pendingConnection:k,setPendingConnection:c,depModalType:C,setDepModalType:u,depModalLag:T,setDepModalLag:i,depCreating:x,setDepCreating:N,deletingDepId:A,setDeletingDepId:q,chartMenu:Y,setChartMenu:a,newActionOpen:O,setNewActionOpen:G,tasks:j.tasks,timeline:j.timeline,displayRows:j.displayRows,taskRowIndex:j.taskRowIndex||new Map,arrows:j.arrows,criticalIds:j.criticalIds,delayedIds:j.delayedIds,relatedIds:j.relatedIds,..._,newActionRef:K,screenXToDate:r=>{const d=_.rightBodyRef.current;if(!d)return new Date;const l=d.getBoundingClientRect(),E=r-l.left+d.scrollLeft;return J(j.timeline.start,Math.max(0,Math.floor(E/j.timeline.dayWidth)))},screenYToProjectId:r=>{if(!o.groupByProject)return;const d=_.leftBodyRef.current;if(!d)return;const l=d.getBoundingClientRect(),E=r-l.top+d.scrollTop,B=Math.max(0,Math.floor(E/50));for(let P=Math.min(B,j.displayRows.length-1);P>=0;P--){const W=j.displayRows[P];if(W.kind==="projectHeader")return W.projectId;if(W.kind==="task"&&W.task.projectId)return W.task.projectId;if(W.kind==="group"&&W.projectId)return W.projectId}},handleChartMouseDown:be,openChartMenu:oe,handleBarMouseDown:xe,handleResizeMouseDown:me,handleConnectDotMouseDown:Ie,handleCreateDependency:Te}),[o,p,m,w,M,y,v,S,n,V,ce,ue,k,C,T,x,A,Y,O,j,_,ke,ie,ye,be,oe,xe,me,Ie,Te]);return o.loading?e.jsx("div",{style:{padding:48,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:t.textSecondary},children:e.jsx(L.Loader2,{size:32,style:{animation:"zg-spin 1.5s linear infinite",color:t.group}})}):e.jsx(Pe,{value:ve,children:e.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",marginLeft:"auto",marginRight:"auto",background:"#fff",borderRadius:12,boxShadow:"0 8px 30px rgb(0,0,0,0.06)",overflow:"hidden",height:"calc(100vh - 48px)",minHeight:600,border:`1px solid ${t.borderLight}`},children:[e.jsx(_e,{}),e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden",position:"relative",background:t.surfaceAlt},children:[e.jsx(Ge,{}),e.jsx(qe,{})]})]})})}const et=[{label:"Yellow",value:"#FEF08A"},{label:"Green",value:"#BBF7D0"},{label:"Blue",value:"#BFDBFE"},{label:"Pink",value:"#FBCFE8"},{label:"Purple",value:"#E9D5FF"},{label:"Orange",value:"#FED7AA"},{label:"White",value:"#FFFFFF"}],Be={FS:"Finish → Start (FS)",SS:"Start → Start (SS)",FF:"Finish → Finish (FF)",SF:"Start → Finish (SF)"};function tt({isOpen:o,onClose:p,availableMilestones:g=[],initialDate:m,translations:f,onSaveNote:w}){const b=(a,O)=>f?typeof f=="function"?f(a,O):f[a]||O:O,[M,I]=h.useState(""),[y,D]=h.useState(""),[v,$]=h.useState("#FEF08A"),[S,z]=h.useState(""),[n,s]=h.useState(""),[k,c]=h.useState("FS"),[C,u]=h.useState(!1),[T,i]=h.useState([]),[x,N]=h.useState(""),A=h.useRef(null);h.useEffect(()=>{o&&(I(""),D(""),$("#FEF08A"),z(m??new Date().toISOString().split("T")[0]),s(""),c("FS"),i([]),N(""))},[o,m]);const q=[...g.map(a=>({id:a.id,name:a.name,type:"MILESTONE"}))],Y=async()=>{if(!M.trim()&&!y.trim()){N(b("noteModal.errorEmpty","Please provide a title or content for the note."));return}N("");try{u(!0),await w({title:M||b("noteModal.untitled","Untitled"),description:y,color:v,date:S?`${S}T00:00:00`:new Date().toISOString(),predecessorId:n,dependencyType:k,files:T}),p()}catch(a){console.error(a),N(b("noteModal.errorSave","Error creating note."))}finally{u(!1)}};return o?e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.2)",backdropFilter:"blur(2px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:16},onClick:p,children:e.jsxs("div",{onClick:a=>a.stopPropagation(),style:{width:400,maxHeight:"90vh",background:v||"#FFFACD",borderRadius:4,boxShadow:"4px 6px 20px rgba(0,0,0,0.18), 1px 1px 4px rgba(0,0,0,0.08)",transform:"rotate(-1deg)",position:"relative",display:"flex",flexDirection:"column",fontFamily:"'Inter', sans-serif",overflow:"hidden",transition:"background 0.3s"},children:[e.jsx("div",{style:{position:"absolute",top:-6,left:"50%",transform:"translateX(-50%)",width:64,height:16,background:"rgba(255,255,255,0.55)",borderRadius:2,boxShadow:"0 1px 3px rgba(0,0,0,0.08)"}}),e.jsx("button",{onClick:p,style:{position:"absolute",top:10,right:10,width:24,height:24,borderRadius:"50%",background:"rgba(0,0,0,0.08)",border:"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontSize:14,color:"#3a3a3a"},onMouseEnter:a=>a.currentTarget.style.background="rgba(0,0,0,0.15)",onMouseLeave:a=>a.currentTarget.style.background="rgba(0,0,0,0.08)",children:"✕"}),e.jsxs("div",{style:{padding:"28px 24px 20px",flex:1,overflowY:"auto",display:"flex",flexDirection:"column"},children:[x&&e.jsx("div",{style:{background:"rgba(255,0,0,0.1)",color:"#d32f2f",padding:"8px 12px",borderRadius:6,fontSize:12,marginBottom:12,border:"1px solid rgba(255,0,0,0.2)"},children:x}),e.jsx("input",{type:"text",value:M,onChange:a=>I(a.target.value),placeholder:b("noteModal.titlePlaceholder","Note title..."),style:{width:"100%",background:"transparent",border:"none",outline:"none",fontSize:20,fontWeight:800,color:"#2a2a2a",lineHeight:"1.3",padding:0,margin:0,marginBottom:14,fontFamily:"inherit"}}),e.jsx("div",{style:{width:"100%",height:1,background:"rgba(0,0,0,0.08)",marginBottom:14}}),e.jsx("textarea",{value:y,onChange:a=>D(a.target.value),rows:6,placeholder:b("noteModal.contentPlaceholder","Write your note here..."),style:{width:"100%",background:"transparent",border:"none",outline:"none",fontSize:14,color:"#3a3a3a",lineHeight:"1.6",resize:"vertical",padding:0,margin:0,fontFamily:"inherit",flex:1,minHeight:100}}),e.jsxs("div",{style:{marginTop:14,paddingTop:10,borderTop:"1px solid rgba(0,0,0,0.08)"},children:[e.jsx("input",{ref:A,type:"file",multiple:!0,onChange:a=>{const O=a.target.files?Array.from(a.target.files):[];O.length>0&&i(G=>[...G,...O]),A.current&&(A.current.value="")},style:{display:"none"}}),e.jsxs("button",{type:"button",onClick:()=>A.current?.click(),style:{display:"flex",alignItems:"center",gap:6,padding:"6px 12px",borderRadius:6,background:"rgba(0,0,0,0.05)",border:"1px dashed rgba(0,0,0,0.15)",cursor:"pointer",fontSize:12,color:"#3a3a3a",fontWeight:500,transition:"background 0.15s",width:"100%",justifyContent:"center"},onMouseEnter:a=>a.currentTarget.style.background="rgba(0,0,0,0.08)",onMouseLeave:a=>a.currentTarget.style.background="rgba(0,0,0,0.05)",children:[e.jsx(L.Upload,{size:13}),b("noteModal.attachFiles","Attach files")]}),T.length>0&&e.jsx("div",{style:{marginTop:8,display:"flex",flexDirection:"column",gap:4},children:T.map((a,O)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 8px",borderRadius:4,background:"rgba(255,255,255,0.5)",fontSize:11,color:"#3a3a3a"},children:[e.jsx(L.Paperclip,{size:10,style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),e.jsxs("span",{style:{fontSize:9,color:"rgba(58,58,58,0.4)",flexShrink:0},children:[(a.size/1024).toFixed(0),"KB"]}),e.jsx("button",{type:"button",onClick:()=>i(G=>G.filter((K,V)=>V!==O)),style:{background:"none",border:"none",cursor:"pointer",padding:2,display:"flex",color:"#ef4444"},title:b("noteModal.removeFile","Remove"),children:e.jsx(L.X,{size:12})})]},`file-${O}`))})]}),e.jsxs("div",{style:{marginTop:16,paddingTop:12,borderTop:"1px solid rgba(0,0,0,0.08)",display:"flex",alignItems:"center",justifyItems:"flex-start",justifyContent:"space-between",gap:12},children:[e.jsx("input",{type:"date",value:S,onChange:a=>z(a.target.value),style:{background:"transparent",border:"none",outline:"none",fontSize:12,color:"rgba(58,58,58,0.5)",fontWeight:500,fontFamily:"inherit",padding:0,cursor:"pointer",width:"auto"}}),e.jsx("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end"},children:et.map(a=>e.jsx("button",{type:"button",onClick:()=>$(a.value),style:{width:22,height:22,borderRadius:"50%",border:v===a.value?"2px solid #1A3C30":"1.5px solid rgba(0,0,0,0.12)",backgroundColor:a.value,cursor:"pointer",padding:0,transform:v===a.value?"scale(1.15)":"scale(1)",transition:"all 0.15s",boxShadow:v===a.value?"0 1px 4px rgba(0,0,0,0.15)":"none"},title:a.label},a.value))})]}),q.length>0&&e.jsxs("div",{style:{marginTop:12,paddingTop:12,borderTop:"1px solid rgba(0,0,0,0.08)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:8},children:[e.jsx(L.Link2,{size:14,style:{color:"rgba(58,58,58,0.5)"}}),e.jsx("span",{style:{fontSize:11,color:"rgba(58,58,58,0.5)",fontWeight:600},children:b("noteModal.dependency","Dependency")})]}),e.jsxs("select",{value:n,onChange:a=>s(a.target.value),style:{width:"100%",background:"rgba(255,255,255,0.3)",border:"1px solid rgba(0,0,0,0.08)",borderRadius:6,fontSize:12,color:"#3a3a3a",padding:"6px 8px",outline:"none",fontFamily:"inherit",cursor:"pointer"},children:[e.jsx("option",{value:"",children:b("noteModal.none","None")}),g.length>0&&e.jsx("optgroup",{label:b("noteModal.milestones","Milestones"),children:g.map(a=>e.jsx("option",{value:a.id,children:a.name},a.id))})]}),n&&e.jsx("select",{value:k,onChange:a=>c(a.target.value),style:{width:"100%",background:"rgba(255,255,255,0.3)",border:"1px solid rgba(0,0,0,0.08)",borderRadius:6,fontSize:12,color:"#3a3a3a",padding:"6px 8px",outline:"none",fontFamily:"inherit",cursor:"pointer",marginTop:6},children:Object.keys(Be).map(a=>e.jsx("option",{value:a,children:Be[a]},a))})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,paddingTop:16,marginTop:12,borderTop:"1px solid rgba(0,0,0,0.08)"},children:[e.jsx("button",{onClick:p,style:{padding:"8px 16px",fontSize:13,color:"#3a3a3a",background:"rgba(255,255,255,0.5)",border:"1px solid rgba(0,0,0,0.1)",borderRadius:8,cursor:"pointer"},children:b("noteModal.cancel","Cancel")}),e.jsxs("button",{onClick:Y,disabled:C,style:{padding:"8px 20px",fontSize:13,color:"#fff",background:"#1A3C30",border:"none",borderRadius:8,cursor:"pointer",display:"flex",alignItems:"center",gap:6,opacity:C?.5:1},children:[C&&e.jsx(L.Loader2,{size:16,style:{animation:"zg-spin 1s linear infinite"}}),b("noteModal.create","Create Note")]})]})]})]})}):null}const ot={"planning.gantt":"PLANEJAMENTO DA OBRA","charts.gantt.month":"Mês","charts.gantt.year":"Ano","charts.gantt.stepName":"NOME DA ETAPA","charts.gantt.start":"INÍCIO","charts.gantt.end":"FIM","charts.gantt.newAction":"Nova Ação","charts.gantt.progress":"Progresso","gantt.filter.steps":"Etapas","gantt.filter.milestones":"Marcos","gantt.filter.events":"Eventos","gantt.filter.notes":"Notas","gantt.newAction.step":"Etapa","gantt.newAction.milestone":"Marco","gantt.newAction.event":"Evento","gantt.newAction.note":"Nota","gantt.group.step":"Etapas","gantt.group.milestone":"Marcos","gantt.group.event":"Eventos","gantt.group.note":"Notas","gantt.tooltip.planned":"Previsto","gantt.tooltip.actual":"Real","gantt.tooltip.plannedInUse":"Previsto (em uso)","gantt.tooltip.start":"Início","gantt.tooltip.end":"Fim","gantt.tooltip.duration":"Duração","gantt.tooltip.progress":"Progresso","gantt.tooltip.date":"Data","gantt.tooltip.attachments":"Anexos","gantt.popup.viewDetails":"Ver detalhes","gantt.popup.edit":"Editar","gantt.popup.delete":"Excluir","gantt.popup.relations":"Relações","gantt.chart.addOn":"Adicionar em","gantt.depType.fs":"Início após Fim","gantt.depType.ss":"Inícios simultâneos","gantt.depType.ff":"Fins simultâneos","gantt.depType.sf":"Fim após Início","gantt.depModal.title":"Tipo de Relação","gantt.depModal.subtitle":"Escolha como as duas tarefas se relacionam","gantt.depModal.fs":"Início após Fim","gantt.depModal.fsDesc":"B começa quando A termina","gantt.depModal.ss":"Inícios simultâneos","gantt.depModal.ssDesc":"A e B começam juntos","gantt.depModal.ff":"Fins simultâneos","gantt.depModal.ffDesc":"A e B terminam juntos","gantt.depModal.sf":"Fim após Início","gantt.depModal.sfDesc":"B termina quando A começa","gantt.depModal.lagLabel":"Atraso (Lag) em dias","gantt.depModal.cancel":"Cancelar","gantt.depModal.create":"Criar Dependência","gantt.depModal.saving":"Salvando...","noteModal.titlePlaceholder":"Título da nota...","noteModal.contentPlaceholder":"Escreva sua nota aqui...","noteModal.attachFiles":"Anexar arquivos","noteModal.removeFile":"Remover","noteModal.dependency":"Dependência","noteModal.none":"Nenhuma","noteModal.milestones":"Marcos","noteModal.cancel":"Cancelar","noteModal.create":"Criar Nota","noteModal.errorEmpty":"Informe o título ou conteúdo da nota.","noteModal.errorSave":"Erro ao criar nota.","noteModal.untitled":"Sem título"};R.NoteModal=tt,R.ProjectGantt=Re,R.ptBR=ot,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zegantt",
3
3
  "private": false,
4
- "version": "0.2.5",
4
+ "version": "0.2.7",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",