@orangelogic/design-system 2.69.0 → 2.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/library/chunks/AxisLabelRadial.BTpA5dYy.js +11 -0
  2. package/library/chunks/BaseColumnSeries.hIO71GLG.js +304 -0
  3. package/library/chunks/CandlestickSeries.w9C0GR9v.js +362 -0
  4. package/library/chunks/Circle.tOnnO-F-.js +17 -0
  5. package/library/chunks/ColumnSeries.Ckz75x1M.js +54 -0
  6. package/library/chunks/EditableAxisLabel.CCMTJT7K.js +445 -0
  7. package/library/chunks/EditableLabel.DPmicdjK.js +119 -0
  8. package/library/chunks/Gradient.BrDBLm8v.js +40 -0
  9. package/library/chunks/LinearGradient.CxfXxvMw.js +37 -0
  10. package/library/chunks/MonotoneXTension.CJMEHHj3.js +139 -0
  11. package/library/chunks/Picture.BNASYM-P.js +49 -0
  12. package/library/chunks/Polygon.Dr-GV2hn.js +70 -0
  13. package/library/chunks/ProgressPie.4mPA6xqm.js +234 -0
  14. package/library/chunks/RadialLabel.HfsGiN4x.js +88 -0
  15. package/library/chunks/Scrollbar.Bgg-RhjP.js +118 -0
  16. package/library/chunks/Slice.Dm56LTKj.js +120 -0
  17. package/library/chunks/Slider.FKJwoPq2.js +19 -0
  18. package/library/chunks/SpriteResizer.-qJDgug8.js +446 -0
  19. package/library/chunks/Triangle.BECgi7mc.js +21 -0
  20. package/library/chunks/ZoomTools.cgwuIB0e.js +199 -0
  21. package/library/chunks/___vite-browser-external_commonjs-proxy.C2tf3HsQ.js +8 -0
  22. package/library/chunks/{_baseUniq.Df-fLIBx.js → _baseUniq.BUihBa8c.js} +56 -53
  23. package/library/chunks/{_commonjsHelpers.ByX85dGu.js → _commonjsHelpers.DQNKXVTB.js} +2 -2
  24. package/library/chunks/accessors.BHk36ecy.js +11 -0
  25. package/library/chunks/am-chart.oZVBmpnn.js +18435 -0
  26. package/library/chunks/{animation.DfUHRQry.js → animation.DU8t6mrk.js} +1 -1
  27. package/library/chunks/{button.SoX-7UYy.js → button.CAAJPQFu.js} +3 -3
  28. package/library/chunks/{capitalize.WSkCXkNE.js → capitalize.CNStXZBq.js} +1 -1
  29. package/library/chunks/cardinal.BCA_LB0u.js +64 -0
  30. package/library/chunks/{color-swatch-group.Dx1fbSJx.js → color-swatch-group.CKHyWM8K.js} +6 -6
  31. package/library/chunks/{color-swatch.B7XXHxx1.js → color-swatch.BkpPCXd6.js} +2 -2
  32. package/library/chunks/colorPicker.C4w_vDjh.js +527 -0
  33. package/library/chunks/{confirm-popover.327ATuQH.js → confirm-popover.ZD74yDWw.js} +3 -3
  34. package/library/chunks/{content-builder.Bxi6k2LA.js → content-builder.B4Tqoc6M.js} +40 -34
  35. package/library/chunks/{cropper.BraEEykE.js → cropper.CQB3_qqG.js} +6937 -6935
  36. package/library/chunks/{dialog.eN3RUbwx.js → dialog.qSV5AjOE.js} +2 -2
  37. package/library/chunks/{dom.CZrJ64Dm.js → dom.BQVKDNd8.js} +1 -1
  38. package/library/chunks/{dot-pagination.Bek4w4zz.js → dot-pagination.BN_0ljfc.js} +2 -2
  39. package/library/chunks/exporting.BdjsEGF8.js +1407 -0
  40. package/library/chunks/{file-on-demand.BiC4cymk.js → file-on-demand.CXE4zf0J.js} +448 -386
  41. package/library/chunks/flow.D0FqdfOy.js +1594 -0
  42. package/library/chunks/{folder-select.DVEFgexx.js → folder-select.CPALQK22.js} +4 -4
  43. package/library/chunks/{form.CO12-VK0.js → form.DgwYWi0O.js} +1 -1
  44. package/library/chunks/gantt.DfUM7Gvb.js +2459 -0
  45. package/library/chunks/{header.Da5yvwdy.js → header.DXZ_5gLY.js} +2 -2
  46. package/library/chunks/hierarchy.5kfBCoGt.js +3561 -0
  47. package/library/chunks/{hub-connection.CfARlehM.js → hub-connection.Ot2odiCz.js} +1 -1
  48. package/library/chunks/{i18n.BMRLOAZR.js → i18n.C0iakJkV.js} +19 -11
  49. package/library/chunks/{iframe.BJizUE1A.js → iframe.BlzVfeBc.js} +2 -2
  50. package/library/chunks/{image.bndP5q2c.js → image.B3WjaCXP.js} +2 -2
  51. package/library/chunks/index.BkoLctE9.js +533 -0
  52. package/library/chunks/index.CZJTjkLp.js +142 -0
  53. package/library/chunks/{index.Bhnf0N8Q.js → index.CmVKj_wl.js} +7 -7
  54. package/library/chunks/index.DU0XUO4k.js +176 -0
  55. package/library/chunks/index.DcjJFMlq.js +1520 -0
  56. package/library/chunks/isObjectLike.z36Fu426.js +34 -0
  57. package/library/chunks/{isSymbol.huJ_Cvxt.js → isSymbol.L0C2ND_U.js} +1 -1
  58. package/library/chunks/json.BjaT7cyo.js +119 -0
  59. package/library/chunks/{list-editor.Du1h2Ms0.js → list-editor.CIAAFPco.js} +251 -222
  60. package/library/chunks/map.DbgNAGxD.js +3037 -0
  61. package/library/chunks/markerjs2.esm.B_9kjmye.js +1912 -0
  62. package/library/chunks/{option.Ce_wlnZj.js → option.ByVbmxUQ.js} +2 -2
  63. package/library/chunks/{pagination.DXu-mFAk.js → pagination.DPQn2fKX.js} +4 -4
  64. package/library/chunks/pdfmake.Bs7cMDH0.js +41224 -0
  65. package/library/chunks/percent.DO4FjAdu.js +902 -0
  66. package/library/chunks/{purify.es.BGaRrCfO.js → purify.es.BIuh5IAZ.js} +115 -115
  67. package/library/chunks/radar.Dd5fJVMg.js +789 -0
  68. package/library/chunks/{responsive.DgQTIrna.js → responsive.DL-wBD4P.js} +1 -1
  69. package/library/chunks/sliceGrouper.DA3aeuJ-.js +93 -0
  70. package/library/chunks/stock.BfI5MUyK.js +12684 -0
  71. package/library/chunks/{string.Cp_XNbnV.js → string.B_rEG27K.js} +1 -1
  72. package/library/chunks/{tab-group.B2pW__9H.js → tab-group.1h51o_Ly.js} +4 -4
  73. package/library/chunks/{table.5eWm9FfN.js → table.wVHv1Xze.js} +348 -327
  74. package/library/chunks/timeline.BxMLjB5J.js +837 -0
  75. package/library/chunks/timer.B39XOBYL.js +123 -0
  76. package/library/chunks/{toString.CRT5zqEU.js → toString.CL_lYXbK.js} +3 -3
  77. package/library/chunks/transform.BuqENXeT.js +50 -0
  78. package/library/chunks/{tree.Zls5YZ8z.js → tree.Bx0IGsWm.js} +2 -2
  79. package/library/chunks/venn.CxFupTb9.js +966 -0
  80. package/library/chunks/vfs_fonts.VJpdcrR6.js +9 -0
  81. package/library/chunks/watch.BCJD77bD.js +547 -0
  82. package/library/chunks/wc.ThQubbN2.js +255 -0
  83. package/library/chunks/xlsx.v-qkA-dg.js +25118 -0
  84. package/library/chunks/xy.q6e68du3.js +333 -0
  85. package/library/components/alert.js +2 -2
  86. package/library/components/am-chart.d.ts +3 -0
  87. package/library/components/am-chart.js +11 -0
  88. package/library/components/animated-image.js +1 -1
  89. package/library/components/animation.js +2 -2
  90. package/library/components/array-line-clamp.js +1 -1
  91. package/library/components/asset-link-format.js +7 -7
  92. package/library/components/atoms.js +166 -162
  93. package/library/components/avatar.js +1 -1
  94. package/library/components/border-input-group.js +1 -1
  95. package/library/components/breadcrumb-item.js +1 -1
  96. package/library/components/breadcrumb.js +1 -1
  97. package/library/components/button.js +4 -4
  98. package/library/components/checkbox.js +2 -2
  99. package/library/components/color-picker.js +4 -4
  100. package/library/components/color-swatch-group.js +7 -7
  101. package/library/components/color-swatch.js +3 -3
  102. package/library/components/confirm-popover.js +4 -4
  103. package/library/components/copy-button.js +2 -2
  104. package/library/components/corner-position-input-group.js +2 -2
  105. package/library/components/cropper.js +1 -1
  106. package/library/components/details.js +3 -2
  107. package/library/components/dialog.js +3 -3
  108. package/library/components/divider.js +1 -1
  109. package/library/components/dot-pagination.js +3 -3
  110. package/library/components/drawer.js +3 -3
  111. package/library/components/dropdown.js +2 -2
  112. package/library/components/dynamic-select.js +32 -30
  113. package/library/components/e-chart.d.ts +3 -0
  114. package/library/components/e-chart.js +47908 -0
  115. package/library/components/element-clamp.js +3 -3
  116. package/library/components/file-on-demand.js +10 -10
  117. package/library/components/folder-select.js +4 -4
  118. package/library/components/format-bytes.js +1 -1
  119. package/library/components/format-date.js +1 -1
  120. package/library/components/format-number.js +1 -1
  121. package/library/components/format-time.js +2 -2
  122. package/library/components/grid-item.js +1 -1
  123. package/library/components/header.js +3 -3
  124. package/library/components/hub-connection.js +2 -2
  125. package/library/components/icon-button.js +1 -1
  126. package/library/components/icon.js +1 -1
  127. package/library/components/iframe.js +3 -3
  128. package/library/components/image-comparer.js +2 -2
  129. package/library/components/image.js +3 -3
  130. package/library/components/include.js +1 -1
  131. package/library/components/input.js +3 -3
  132. package/library/components/line-clamp.js +1 -1
  133. package/library/components/list-editor.js +11 -8
  134. package/library/components/markdown.js +2 -2
  135. package/library/components/masonry.js +2 -2
  136. package/library/components/menu-item.js +2 -2
  137. package/library/components/menu.js +1 -1
  138. package/library/components/molecules.js +5 -5
  139. package/library/components/mutation-observer.js +1 -1
  140. package/library/components/option.js +3 -3
  141. package/library/components/organisms.js +2 -2
  142. package/library/components/pagination.js +5 -5
  143. package/library/components/popup.js +1 -1
  144. package/library/components/position-picker.js +1 -1
  145. package/library/components/progress-bar.js +1 -1
  146. package/library/components/progress-ring.js +1 -1
  147. package/library/components/qr-code.js +1 -1
  148. package/library/components/radio-button.js +1 -1
  149. package/library/components/radio-card.js +1 -1
  150. package/library/components/radio-group.js +2 -2
  151. package/library/components/radio.js +1 -1
  152. package/library/components/range.js +3 -3
  153. package/library/components/rating.js +2 -2
  154. package/library/components/relative-time.js +1 -1
  155. package/library/components/resize-observer.js +1 -1
  156. package/library/components/select.js +4 -4
  157. package/library/components/share-option-list.js +3 -3
  158. package/library/components/sidebar.js +1 -1
  159. package/library/components/size-input-group.js +2 -2
  160. package/library/components/spinner.js +1 -1
  161. package/library/components/split-panel.js +2 -2
  162. package/library/components/stepper.js +1 -1
  163. package/library/components/switch.js +2 -2
  164. package/library/components/tab-group.js +5 -5
  165. package/library/components/tab-panel.js +1 -1
  166. package/library/components/tab.js +2 -2
  167. package/library/components/table.js +5 -5
  168. package/library/components/tag.js +1 -1
  169. package/library/components/textarea.js +2 -2
  170. package/library/components/timecode.js +2 -2
  171. package/library/components/tooltip.js +2 -2
  172. package/library/components/tree-item.js +3 -3
  173. package/library/components/tree.js +3 -3
  174. package/library/components/typeface.js +2 -2
  175. package/library/components/types.js +27684 -27970
  176. package/library/components/video.js +1107 -1110
  177. package/library/package.json +1 -1
  178. package/library/packages/atoms/src/components/am-chart/am-chart.d.ts +45 -0
  179. package/library/packages/atoms/src/components/am-chart/am-chart.styles.d.ts +2 -0
  180. package/library/packages/atoms/src/components/am-chart/am-chart.utils.d.ts +23 -0
  181. package/library/packages/atoms/src/components/e-chart/e-chart-controller.d.ts +30 -0
  182. package/library/packages/atoms/src/components/e-chart/e-chart.d.ts +38 -0
  183. package/library/packages/atoms/src/components/e-chart/e-chart.styles.d.ts +2 -0
  184. package/library/packages/atoms/src/components/table/table.d.ts +21 -0
  185. package/library/packages/atoms/src/components/table/tabulator-tables/core/Tabulator.d.ts +1 -0
  186. package/library/packages/atoms/src/components/table/tabulator-tables/core/tools/DataLoader.d.ts +3 -1
  187. package/library/packages/atoms/src/index.d.ts +2 -0
  188. package/library/packages/events/src/cx-chart-plan-change.d.ts +10 -0
  189. package/library/packages/events/src/cx-dashboard-filter-change.d.ts +6 -0
  190. package/library/packages/events/src/cx-dashboard-table-load-more.d.ts +9 -0
  191. package/library/packages/events/src/cx-e-chart-drill-down.d.ts +16 -0
  192. package/library/packages/events/src/events.d.ts +4 -0
  193. package/library/packages/molecules/src/index.d.ts +1 -0
  194. package/library/packages/molecules/src/list-editor/list-editor.d.ts +7 -0
  195. package/library/packages/molecules/src/stat-card/stat-card.d.ts +81 -0
  196. package/library/packages/molecules/src/stat-card/stat-card.styles.d.ts +2 -0
  197. package/library/packages/molecules/src/storybook/storybook.d.ts +1 -0
  198. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +1 -1
  199. package/library/packages/organisms/src/content-builder/components/chart-plan-builder/chart-plan-builder.d.ts +88 -0
  200. package/library/packages/organisms/src/content-builder/components/chart-plan-builder/chart-plan-builder.styles.d.ts +2 -0
  201. package/library/packages/organisms/src/content-builder/components/chart-plan-builder/chart-plan-schema.d.ts +100 -0
  202. package/library/packages/organisms/src/content-builder/styleController.d.ts +2 -2
  203. package/library/packages/organisms/src/dashboard-filter/dashboard-filter.d.ts +83 -0
  204. package/library/packages/organisms/src/dashboard-filter/dashboard-filter.styles.d.ts +2 -0
  205. package/library/packages/organisms/src/dashboard-table/dashboard-table.d.ts +45 -0
  206. package/library/packages/organisms/src/dashboard-table/dashboard-table.styles.d.ts +2 -0
  207. package/library/packages/organisms/src/index.d.ts +3 -0
  208. package/library/packages/services/src/api/endpoints.d.ts +3 -0
  209. package/library/packages/types/src/am-chart.d.ts +22 -0
  210. package/library/packages/types/src/content-builder.d.ts +1 -0
  211. package/library/packages/types/src/stat-card.d.ts +19 -0
  212. package/library/packages/types/src/table.d.ts +4 -0
  213. package/library/packages/utils/src/custom-element/i18n.d.ts +8 -0
  214. package/library/react-web-component.d.ts +280 -4
  215. package/library/utils.js +8 -8
  216. package/package.json +1 -1
  217. package/library/chunks/_baseRest.ClTMQtN1.js +0 -67
  218. package/library/chunks/identity.ByMq8VxU.js +0 -6
  219. package/library/chunks/isObjectLike.D3cpZO39.js +0 -81
  220. package/library/chunks/watch.q1sEjPWL.js +0 -501
@@ -0,0 +1,2459 @@
1
+ import { Q as ft, D as wt, x as M, H as O, al as At, Z as rt, q as w, am as R, d as j, C as L, an as Ct, L as b, T, m as E, w as I, R as ct, $ as mt, t as q, e as y, P as ht, h as Q, a4 as G, aj as bt, ao as Tt, a as H, ap as tt, _ as et, z as ot, aq as Bt, B as S, G as V, ar as Pt, as as vt, at as xt, au as Rt, av as Xt, aw as Vt, ax as dt, r as Lt } from "./am-chart.oZVBmpnn.js";
2
+ import { L as J, a as Ot, P as St, N as Gt, C as zt } from "./ProgressPie.4mPA6xqm.js";
3
+ import { C as yt } from "./ColumnSeries.Ckz75x1M.js";
4
+ import { T as gt } from "./Triangle.BECgi7mc.js";
5
+ import { C as ut } from "./Circle.tOnnO-F-.js";
6
+ import { C as kt, E as Mt } from "./EditableAxisLabel.CCMTJT7K.js";
7
+ import { ColorPickerButton as Ht, ColorPicker as It } from "./colorPicker.C4w_vDjh.js";
8
+ import { S as pt } from "./Scrollbar.Bgg-RhjP.js";
9
+ class Z extends ft {
10
+ }
11
+ Z.className = "GanttDateAxis";
12
+ Z.classNames = ft.classNames.concat([Z.className]);
13
+ class Nt extends wt {
14
+ setupDefaultRules() {
15
+ super.setupDefaultRules();
16
+ const t = this._root.language, i = this._root.interfaceColors, e = this.rule.bind(this), s = t.translate("_date_day_full");
17
+ e("Gantt").setAll({
18
+ editable: !0,
19
+ layout: this._root.verticalLayout,
20
+ colors: At.new(this._root, {}),
21
+ snapThreshold: 0.5,
22
+ linkNewTasks: !0,
23
+ durationUnit: "day",
24
+ sidebarWidth: O(30),
25
+ weekends: [0, 6],
26
+ width: M,
27
+ height: M,
28
+ gridIntervals: {
29
+ year: [
30
+ { timeUnit: "week", count: 1 },
31
+ { timeUnit: "month", count: 1 },
32
+ { timeUnit: "month", count: 2 },
33
+ { timeUnit: "month", count: 6 }
34
+ ],
35
+ month: [
36
+ { timeUnit: "week", count: 1 },
37
+ { timeUnit: "week", count: 2 }
38
+ ],
39
+ week: [
40
+ { timeUnit: "day", count: 1 }
41
+ ],
42
+ day: [
43
+ { timeUnit: "hour", count: 1 },
44
+ { timeUnit: "hour", count: 3 },
45
+ { timeUnit: "hour", count: 6 },
46
+ { timeUnit: "hour", count: 12 }
47
+ ],
48
+ hour: [
49
+ { timeUnit: "minute", count: 1 },
50
+ { timeUnit: "minute", count: 5 },
51
+ { timeUnit: "minute", count: 15 },
52
+ { timeUnit: "minute", count: 30 }
53
+ ]
54
+ }
55
+ }), e("Container", ["zoomcontrols"]).setAll({
56
+ x: O(100),
57
+ centerX: O(100),
58
+ y: 10,
59
+ layout: this._root.verticalLayout
60
+ }), e("XYChart", ["gantt"]).setAll({
61
+ panX: !0,
62
+ panY: !0,
63
+ paddingRight: 0,
64
+ wheelY: "panY"
65
+ });
66
+ {
67
+ const n = e("Rectangle", ["axisresizer"]);
68
+ n.setAll({
69
+ width: 12,
70
+ height: M,
71
+ fillOpacity: 0.05,
72
+ fill: i.get("alternativeBackground"),
73
+ cursorOverStyle: "col-resize",
74
+ interactive: !0
75
+ }), n.states.create("hover", { fillOpacity: 0.1 });
76
+ }
77
+ e("EditableLabel", ["axis"]).setAll({
78
+ paddingBottom: 3,
79
+ paddingTop: 3,
80
+ paddingLeft: 5,
81
+ paddingRight: 5,
82
+ cursorOverStyle: "text"
83
+ }), e("GanttCategoryAxis").setAll({
84
+ maxDeviation: 0,
85
+ zoomOut: !1,
86
+ childShift: 25,
87
+ childCellSize: 0.8,
88
+ minCellHeight: 70
89
+ }), e("GanttCategoryAxisRenderer").setAll({
90
+ inversed: !0,
91
+ minGridDistance: 10
92
+ }), e("GanttDateAxis").setAll({
93
+ maxZoomFactor: 1e7,
94
+ extraMax: 0.03,
95
+ extraMin: 0.02,
96
+ autoZoom: !1,
97
+ //strictMinMaxSelection: false,
98
+ //strictMinMax: false,
99
+ markUnitChange: !1,
100
+ weekLabelLocation: 0.5,
101
+ cursorOverStyle: "pointer",
102
+ gridIntervals: [
103
+ { timeUnit: "hour", count: 1 },
104
+ { timeUnit: "day", count: 1 },
105
+ { timeUnit: "week", count: 1 },
106
+ { timeUnit: "month", count: 1 },
107
+ { timeUnit: "year", count: 1 },
108
+ { timeUnit: "year", count: 2 },
109
+ { timeUnit: "year", count: 5 },
110
+ { timeUnit: "year", count: 10 }
111
+ ],
112
+ dateFormats: {
113
+ hour: t.translate("_date_hour_full"),
114
+ day: t.translate("_date_day"),
115
+ week: s,
116
+ month: t.translate("_date_month_full"),
117
+ year: t.translate("_date_year")
118
+ }
119
+ }), e("GanttDateAxis", ["minor"]).setAll({
120
+ dateFormats: {
121
+ millisecond: "SSS",
122
+ second: "ss",
123
+ minute: "mm",
124
+ hour: t.translate("_date_hour_short"),
125
+ day: "EEEEE",
126
+ week: t.translate("_date_day"),
127
+ month: t.translate("_date_month"),
128
+ year: t.translate("_date_year")
129
+ },
130
+ fillRule: (n) => {
131
+ var o;
132
+ const r = n.get("axisFill");
133
+ if (r) {
134
+ const a = n.component, l = n.get("value", 0), c = n.get("endValue", 0), h = a.getPrivate("baseInterval"), g = a.getPrivate("gridInterval", h), u = (o = a.gantt) === null || o === void 0 ? void 0 : o.get("weekends", [0, 6]);
135
+ if (r.set("visible", !1), g.timeUnit == "day") {
136
+ let d = new Date(l).getDay();
137
+ const m = c - l, v = rt("day", 1);
138
+ u && u.indexOf(d) != -1 && m >= v * 0.9 && m <= v * 1.1 ? r.set("visible", !0) : r.set("visible", !1);
139
+ }
140
+ }
141
+ }
142
+ }), e("GanttDateAxisRenderer").setAll({
143
+ minGridDistance: 150,
144
+ opposite: !0
145
+ }), e("GanttDateAxisRenderer", ["minor"]).setAll({
146
+ minGridDistance: 50,
147
+ opposite: !0
148
+ }), e("Grid", ["cursor", "x"]).setAll({
149
+ forceHidden: !0
150
+ }), e("Grid", ["cursor", "y"]).setAll({
151
+ forceHidden: !0
152
+ }), e("Grid", ["range"]).setAll({
153
+ stroke: i.get("negative"),
154
+ strokeOpacity: 1,
155
+ strokeWidth: 2,
156
+ strokeDasharray: [4, 2]
157
+ }), e("AxisLabel", ["x"]).setAll({
158
+ paddingBottom: 15,
159
+ multiLocation: 0.5
160
+ }), e("EditableAxisLabel").setAll({
161
+ y: w,
162
+ populateText: !0,
163
+ text: "{name}",
164
+ centerY: w,
165
+ oversizedBehavior: "truncate",
166
+ marginRight: 10
167
+ }), e("AxisTick", ["gantt", "renderer", "x"]).setAll({
168
+ strokeOpacity: 0.1,
169
+ visible: !0,
170
+ location: 1,
171
+ length: 29
172
+ }), e("AxisTick", ["gantt", "axis", "y"]).states.create("hover", {
173
+ stroke: i.get("primaryButton"),
174
+ strokeOpacity: 1,
175
+ strokeWidth: 3
176
+ }), e("AxisTick", ["gantt", "renderer", "y"]).setAll({
177
+ strokeOpacity: 0.1,
178
+ visible: !0,
179
+ location: 1
180
+ }), e("Grid", ["gantt", "renderer", "x"]).setAll({
181
+ forceHidden: !0
182
+ });
183
+ {
184
+ const n = e("Grid", ["gantt", "renderer", "x", "minor"]);
185
+ n.setAll({
186
+ forceHidden: !1,
187
+ location: 1
188
+ }), n.states.create("hover", {
189
+ stroke: i.get("primaryButton"),
190
+ strokeOpacity: 1,
191
+ strokeWidth: 2
192
+ });
193
+ }
194
+ e("Grid", ["gantt", "renderer", "y"]).setAll({
195
+ location: 1
196
+ }), e("Container", ["axislabelcontainer"]).setAll({
197
+ minWidth: 150,
198
+ draggable: !0
199
+ }), e("Rectangle", ["axislabelcontainer", "background"]).setAll({
200
+ fill: i.get("alternativeBackground"),
201
+ fillOpacity: 0,
202
+ interactive: !0
203
+ }), e("Rectangle", ["axislabelcontainer", "background"]).states.create("hover", {
204
+ fillOpacity: 0.05
205
+ }), e("Rectangle", ["axislabelcontainer", "background"]).states.create("active", {
206
+ fillOpacity: 0.07
207
+ }), e("EditableLabel", ["categorylabel"]).setAll({
208
+ minWidth: 100,
209
+ multiLine: !1
210
+ }), e("Container", ["axislabelcontrols"]).setAll({
211
+ height: M,
212
+ layout: this._root.horizontalLayout
213
+ }), e("Rectangle", ["gantt", "grip", "axislabel"]).setAll({
214
+ width: 18,
215
+ height: 25,
216
+ cursorOverStyle: "ns-resize",
217
+ interactive: !0,
218
+ centerY: w,
219
+ y: w,
220
+ fillPattern: J.new(this._root, {
221
+ color: i.get("alternativeBackground"),
222
+ colorOpacity: 0.2,
223
+ rotation: 0,
224
+ gap: 3
225
+ })
226
+ }), e("ProgressPie").setAll({
227
+ y: w,
228
+ centerY: 0,
229
+ width: 32,
230
+ height: 32,
231
+ marginLeft: 15,
232
+ cursorOverStyle: "pointer"
233
+ }), e("NumericStepper").setAll({
234
+ y: w,
235
+ centerY: w
236
+ }), e("GanttSeries").setAll({
237
+ linkHorizontalOffset: 25,
238
+ snapCount: 1,
239
+ exactLocationX: !0
240
+ }), e("RoundedRectangle", ["series", "column", "gantt"]).setAll({
241
+ maxHeight: 60,
242
+ draggable: !0,
243
+ cornerRadiusBL: 5,
244
+ cornerRadiusTL: 5,
245
+ cornerRadiusBR: 5,
246
+ cornerRadiusTR: 5,
247
+ fillOpacity: 0.8,
248
+ strokeWidth: 2,
249
+ tooltipY: 0,
250
+ tooltipText: "{name}: {openValueX.formatDate('" + s + "')} - {valueX.formatDate('" + s + "')}"
251
+ }), e("RoundedRectangle", ["column", "series", "gantt"]).states.create("hover", {
252
+ strokeWidth: 3,
253
+ cornerRadiusBL: 0,
254
+ cornerRadiusTL: 0,
255
+ cornerRadiusBR: 0,
256
+ cornerRadiusTR: 0,
257
+ fillOpacity: 1
258
+ }), e("RoundedRectangle", ["column", "series", "gantt"]).states.create("disabled", {
259
+ opacity: 0.2,
260
+ forceInactive: !0
261
+ }), e("RoundedRectangle", ["series", "column", "gantt"]).states.create("hidden", {
262
+ opacity: 0,
263
+ visible: !1,
264
+ strokeOpacity: 0
265
+ }), e("Container", ["columncontainer"]).states.create("disabled", {
266
+ opacity: 0.2,
267
+ forceInactive: !0
268
+ }), e("Container", ["maskedcontainer"]).setAll({
269
+ position: "absolute"
270
+ }), e("RoundedRectangle", ["zerorectangle"]).setAll({
271
+ draggable: !0,
272
+ cornerRadiusBL: 2,
273
+ cornerRadiusTL: 2,
274
+ cornerRadiusBR: 2,
275
+ cornerRadiusTR: 2,
276
+ strokeWidth: 2,
277
+ rotation: 45,
278
+ fillOpacity: 0.8,
279
+ centerX: w,
280
+ centerY: w,
281
+ y: w,
282
+ tooltipText: "{name}: {openValueX.formatDate('" + s + "')}"
283
+ }), e("RoundedRectangle", ["zerorectangle"]).states.create("disabled", {
284
+ opacity: 0.5,
285
+ forceInactive: !0
286
+ }), e("Circle", ["connectorbullet", "start", "gantt"]).setAll({
287
+ strokeWidth: 2,
288
+ strokeOpacity: 1,
289
+ radius: 8,
290
+ y: w,
291
+ fill: i.get("background"),
292
+ stroke: i.get("alternativeBackground"),
293
+ fillOpacity: 1,
294
+ cursorOverStyle: "pointer",
295
+ role: "figure",
296
+ interactive: !0,
297
+ visible: !1
298
+ }), e("Circle", ["connectorbullet", "end", "gantt"]).setAll({
299
+ strokeWidth: 2,
300
+ strokeOpacity: 1,
301
+ radius: 8,
302
+ y: w,
303
+ fill: i.get("background"),
304
+ stroke: i.get("alternativeBackground"),
305
+ fillOpacity: 1,
306
+ cursorOverStyle: "pointer",
307
+ role: "figure",
308
+ interactive: !0
309
+ }), e("Circle", ["connectorbullet", "gantt", "end"]).states.create("hover", {
310
+ scale: 1.2
311
+ }), e("Circle", ["connectorbullet", "gantt", "end"]).states.create("activehover", {
312
+ scale: 1.2,
313
+ strokeWidth: 4
314
+ }), e("Rectangle", ["progressrectangle", "gantt"]).setAll({
315
+ forceInactive: !0,
316
+ width: 1,
317
+ fill: i.get("background"),
318
+ fillOpacity: 0.2,
319
+ strokeOpacity: 0,
320
+ fillPattern: J.new(this._root, {
321
+ width: 3e3,
322
+ height: 100,
323
+ angle: -45,
324
+ gap: 4,
325
+ color: i.get("background")
326
+ })
327
+ }), e("Triangle", ["progressgrip", "gantt"]).setAll({
328
+ draggable: !0,
329
+ cursorOverStyle: "ew-resize",
330
+ width: 22,
331
+ height: 11,
332
+ fill: i.get("background"),
333
+ stroke: i.get("background"),
334
+ strokeOpacity: 0,
335
+ fillOpacity: 1,
336
+ y: M,
337
+ centerY: M
338
+ }), e("Rectangle", ["resizegrip", "start", "gantt"]).setAll({
339
+ width: 9,
340
+ centerX: 19,
341
+ fill: i.get("background"),
342
+ stroke: i.get("alternativeBackground"),
343
+ fillPattern: J.new(this._root, {
344
+ color: i.get("alternativeBackground"),
345
+ colorOpacity: 0.2,
346
+ rotation: 90,
347
+ gap: 2
348
+ }),
349
+ draggable: !0,
350
+ fillOpacity: 0,
351
+ strokeOpacity: 0,
352
+ cursorOverStyle: "ew-resize"
353
+ }), e("Rectangle", ["resizegrip", "end", "gantt"]).setAll({
354
+ width: 9,
355
+ centerX: -10,
356
+ fill: i.get("background"),
357
+ stroke: i.get("alternativeBackground"),
358
+ fillPattern: J.new(this._root, {
359
+ color: i.get("alternativeBackground"),
360
+ colorOpacity: 0.2,
361
+ rotation: 90,
362
+ gap: 2
363
+ }),
364
+ draggable: !0,
365
+ fillOpacity: 0,
366
+ strokeOpacity: 0,
367
+ cursorOverStyle: "ew-resize"
368
+ }), e("Line", ["connectorline", "gantt"]).setAll({
369
+ strokeWidth: 1,
370
+ strokeDasharray: [2, 2],
371
+ strokeOpacity: 1,
372
+ stroke: i.get("alternativeBackground")
373
+ }), e("Triangle", ["connectorarrow", "gantt"]).setAll({
374
+ width: 10,
375
+ height: 10,
376
+ fill: i.get("alternativeBackground"),
377
+ stroke: i.get("alternativeBackground"),
378
+ rotation: 90,
379
+ centerX: w,
380
+ centerY: w,
381
+ fillOpacity: 1,
382
+ strokeOpacity: 1
383
+ }), e("Triangle", ["link", "start"]).setAll({
384
+ forceHidden: !0
385
+ }), e("Link", ["gantt"]).setAll({
386
+ toggleKey: "active",
387
+ cursorOverStyle: "pointer"
388
+ }), e("Link", ["gantt"]).states.create("active", {}), e("Button", ["secondary"]).setAll({
389
+ height: 35,
390
+ marginLeft: 6,
391
+ tooltipX: O(90)
392
+ }), e("Graphics", ["icon", "button", "fixedwidth"]).setAll({
393
+ x: w,
394
+ centerX: w
395
+ }), e("Button", ["fixedwidth"]).setAll({
396
+ width: 35
397
+ }), e("Button", ["zoombutton", "secondary"]).setAll({
398
+ height: 35,
399
+ width: 35,
400
+ y: void 0,
401
+ marginLeft: 0,
402
+ marginBottom: 6,
403
+ tooltipX: O(10)
404
+ });
405
+ {
406
+ const n = e("Graphics", ["icon", "button", "secondary"]);
407
+ n.setAll({
408
+ centerY: w,
409
+ y: w
410
+ }), R(n, "stroke", i, "secondaryButtonText");
411
+ }
412
+ {
413
+ const n = e("Graphics", ["icon", "button", "secondary"]);
414
+ n.states.create("hover", {
415
+ stroke: i.get("alternativeBackground")
416
+ }), n.states.create("active", {
417
+ stroke: i.get("alternativeBackground")
418
+ });
419
+ }
420
+ {
421
+ const n = e("RoundedRectangle", ["background", "secondary", "button"]);
422
+ R(n, "fill", i, "background"), R(n, "stroke", i, "secondaryButton");
423
+ }
424
+ e("RoundedRectangle", ["background", "secondary", "button"]).states.create("hover", {
425
+ strokeOpacity: 1,
426
+ fillOpacity: 0.2,
427
+ fill: i.get("secondaryButtonHover")
428
+ }), e("RoundedRectangle", ["background", "secondary", "button"]).states.create("active", {
429
+ strokeOpacity: 1,
430
+ fillOpacity: 0.2,
431
+ fill: i.get("secondaryButtonActive")
432
+ });
433
+ {
434
+ const n = e("RoundedRectangle", ["background", "secondary", "button"]).states.create("down", { stateAnimationDuration: 0 });
435
+ R(n, "fill", i, "secondaryButtonDown");
436
+ }
437
+ {
438
+ const n = e("Graphics", ["icon", "secondary", "button"]);
439
+ R(n, "stroke", i, "secondaryButton");
440
+ }
441
+ e("Button", ["taskbullet"]).setAll({
442
+ centerX: w,
443
+ centerY: w,
444
+ y: w,
445
+ width: 30,
446
+ height: 30,
447
+ cursorOverStyle: "pointer"
448
+ }), e("Graphics", ["taskbullet", "icon"]).states.create("default", {
449
+ stateAnimationDuration: 0
450
+ }), e("Graphics", ["taskbullet", "icon"]).states.create("hover", {
451
+ fill: i.get("secondaryButtonHover")
452
+ }), e("Graphics", ["taskbullet", "icon"]).states.create("active", {
453
+ fill: i.get("secondaryButton"),
454
+ stateAnimationDuration: 0,
455
+ rotation: 90
456
+ }), e("Graphics", ["taskbullet", "icon"]).states.create("disabled", {
457
+ // draw circle
458
+ marginLeft: 3,
459
+ stateAnimationDuration: 0,
460
+ fill: i.get("secondaryButton"),
461
+ draw: (n) => {
462
+ n.moveTo(0, 0), n.arc(0, 0, 4, 0, 360, !1);
463
+ }
464
+ }), e("RoundedRectangle", ["button", "taskbullet", "background"]).setAll({
465
+ opacity: 0
466
+ }), e("RoundedRectangle", ["button", "taskbullet", "background"]).states.create("default", {
467
+ opacity: 0
468
+ }), e("Button", ["taskbullet"]).states.create("disabled", {
469
+ stateAnimationDuration: 0
470
+ }), e("Graphics", ["taskbullet", "icon"]).setAll({
471
+ fill: i.get("secondaryButton"),
472
+ stateAnimationDuration: 0,
473
+ strokeOpacity: 0,
474
+ y: w,
475
+ // draw triangle that points left
476
+ draw: (n) => {
477
+ n.moveTo(-5, -8), n.lineTo(4, 0), n.lineTo(-5, 8), n.lineTo(-5, -8), n.closePath();
478
+ }
479
+ }), e("Button", ["add"]).setAll({
480
+ width: 35,
481
+ height: 35,
482
+ tooltipText: t.translateAny("Add task"),
483
+ tooltipX: O(90)
484
+ }), e("RoundedRectangle", ["button", "add", "background"]).setAll({
485
+ stroke: i.get("primaryButton"),
486
+ strokeWidth: 0
487
+ }), e("Button", ["edit"]).setAll({
488
+ visible: !1,
489
+ tooltipText: t.translateAny("Edit mode"),
490
+ toggleKey: "active"
491
+ });
492
+ {
493
+ const n = e("Graphics", ["icon", "edit", "button"]);
494
+ n.setAll({
495
+ svgPath: "M 11 -1 L 17 5 L 8 14 L 2 14 L 2 8 L 11 -1 M 7 11 L 15 3 M 5 9 L 13 1 M 2 8 L 5 9 L 5 11 L 7 11 L 8 14 M 2 12 L 4 14"
496
+ }), R(n, "stroke", i, "secondaryButton");
497
+ }
498
+ e("Button", ["expand"]).setAll({
499
+ tooltipText: t.translateAny("Expand all")
500
+ });
501
+ {
502
+ const n = e("Graphics", ["icon", "expand", "button"]);
503
+ n.setAll({
504
+ svgPath: "M -6 -4 L 0 2 L 6 -4 M -6 2 L 0 8 L 6 2"
505
+ }), R(n, "stroke", i, "secondaryButton");
506
+ }
507
+ e("Button", ["collapse"]).setAll({
508
+ tooltipText: t.translateAny("Collapse all")
509
+ });
510
+ {
511
+ const n = e("Graphics", ["icon", "collapse", "button"]);
512
+ n.setAll({
513
+ svgPath: "M -6 6 L 0 0 L 6 6 M -6 0 L 0 -6 L 6 0"
514
+ }), R(n, "stroke", i, "secondaryButton");
515
+ }
516
+ e("Button", ["link"]).setAll({
517
+ tooltipText: t.translateAny("Link new tasks"),
518
+ toggleKey: "active"
519
+ });
520
+ {
521
+ const n = e("Graphics", ["icon", "link", "button"]);
522
+ n.setAll({
523
+ dy: 1,
524
+ svgPath: "M 5 4 L 13 4 C 17 4 17 11 13 11 L 8 11 C 4 11 4 18 8 18 L 16 18 L 14 16 L 14 20 L 16 18"
525
+ }), R(n, "stroke", i, "secondaryButton");
526
+ }
527
+ e("Button", ["clear"]).setAll({
528
+ tooltipText: t.translateAny("Clear all")
529
+ });
530
+ {
531
+ const n = e("Graphics", ["icon", "clear", "button"]);
532
+ n.setAll({
533
+ marginLeft: 1,
534
+ marginRight: 1,
535
+ svgPath: "M 2.4 4 L 4.8 19.2 L 15.2 19.2 L 17.6 4 L 2.4 4 M 5.6 5.6 L 7.2 17.2 M 10 5.6 L 10 17.2 M 14.4 5.6 L 12.8 17.2 M 2.4 3.2 L 17.6 3.2 M 8.4 3.2 L 8.4 1.2 L 12 1.2 L 12 3.2"
536
+ }), R(n, "stroke", i, "secondaryButton");
537
+ }
538
+ e("Button", ["fit"]).setAll({
539
+ tooltipText: t.translateAny("Fit to view")
540
+ });
541
+ {
542
+ const n = e("Graphics", ["icon", "fit", "button"]);
543
+ n.setAll({
544
+ svgPath: "M 8 0 L 2 0 M 6 -4 L 2 0 L 6 4 M -2 0 L -8 0 M -6 -4 L -2 0 L -6 4"
545
+ }), R(n, "stroke", i, "secondaryButton");
546
+ }
547
+ e("Button", ["zoomout"]).setAll({
548
+ tooltipText: t.translateAny("Zoom out")
549
+ });
550
+ {
551
+ const n = e("Graphics", ["icon", "zoomout", "button"]);
552
+ n.setAll({
553
+ svgPath: "M 8 0 L 2 0 M 4 -4 L 8 0 L 4 4 M -2 0 L -8 0 M -4 -4 L -8 0 L -4 4"
554
+ }), R(n, "stroke", i, "secondaryButton");
555
+ }
556
+ e("Button", ["xbutton"]).setAll({
557
+ width: 35,
558
+ height: 35,
559
+ centerX: w,
560
+ centerY: w
561
+ }), e("RoundedRectangle", ["xbutton", "background"]).setAll({
562
+ fillOpacity: 0,
563
+ strokeOpacity: 0
564
+ }), e("Graphics", ["xbutton", "icon"]).setAll({
565
+ fill: i.get("negative"),
566
+ isMeasured: !1,
567
+ forceInactive: !0,
568
+ stroke: j(16777215),
569
+ strokeWidth: 2,
570
+ cursorOverStyle: "pointer",
571
+ centerX: w,
572
+ centerY: w,
573
+ x: w,
574
+ y: w,
575
+ draw: (n) => {
576
+ n.arc(0, 0, 16, 0, Math.PI * 2), n.moveTo(-6, -6), n.lineTo(6, 6), n.moveTo(6, -6), n.lineTo(-6, 6);
577
+ }
578
+ }), e("ColorPickerButton").setAll({
579
+ width: 35,
580
+ height: 35,
581
+ marginLeft: 6,
582
+ tooltipX: O(90),
583
+ tooltipText: t.translateAny("Set color")
584
+ });
585
+ }
586
+ }
587
+ class it extends yt {
588
+ constructor() {
589
+ super(...arguments), this._xPan = !1, this._yPan = !1, this.linksContainer = this.children.push(L.new(this._root, {})), this.connectorLine = this.children.push(Ct.new(this._root, {
590
+ themeTags: ["connectorline"],
591
+ visible: !1,
592
+ forceInactive: !0
593
+ })), this.connectorArrow = this.children.push(gt.new(this._root, {
594
+ themeTags: ["connectorarrow"],
595
+ visible: !1,
596
+ forceInactive: !0
597
+ })), this.links = this.addDisposer(new b(T.new({}), () => Ot._new(this._root, {
598
+ themeTags: E(this.containers.template.get("themeTags", []), ["link"])
599
+ }, [this.links.template]))), this.containers = this.addDisposer(new b(T.new({}), () => L._new(this._root, {
600
+ position: "absolute",
601
+ themeTagsSelf: ["columncontainer"]
602
+ }, [this.containers.template]))), this.maskedContainers = this.addDisposer(new b(T.new({}), () => L._new(this._root, {
603
+ position: "absolute",
604
+ themeTagsSelf: ["maskedcontainer"]
605
+ }, [this.maskedContainers.template]))), this.startBullets = this.addDisposer(new b(T.new({}), () => ut._new(this._root, {
606
+ x: -1e3,
607
+ themeTagsSelf: ["connectorbullet", "start"]
608
+ }, [this.startBullets.template]))), this.endBullets = this.addDisposer(new b(T.new({}), () => ut._new(this._root, {
609
+ x: -1e3,
610
+ themeTagsSelf: ["connectorbullet", "end"]
611
+ }, [this.endBullets.template]))), this.startGrips = this.addDisposer(new b(T.new({}), () => I._new(this._root, {
612
+ themeTagsSelf: ["resizegrip", "start"]
613
+ }, [this.startGrips.template]))), this.endGrips = this.addDisposer(new b(T.new({}), () => I._new(this._root, {
614
+ themeTagsSelf: ["resizegrip", "end"]
615
+ }, [this.endGrips.template]))), this.zeroRectangles = this.addDisposer(new b(T.new({}), () => ct._new(this._root, {
616
+ themeTagsSelf: ["zerorectangle"]
617
+ }, [this.zeroRectangles.template]))), this.progressRectangles = this.addDisposer(new b(T.new({}), () => I._new(this._root, {
618
+ themeTagsSelf: ["progressrectangle"]
619
+ }, [this.progressRectangles.template]))), this.progressGrips = this.addDisposer(new b(T.new({}), () => gt._new(this._root, {
620
+ themeTagsSelf: ["progressgrip"]
621
+ }, [this.progressGrips.template])));
622
+ }
623
+ _afterNew() {
624
+ this.fields.push("linkTo", "categoryId"), this.valueFields.push("progress", "duration"), this.set("exactLocationX", !0), super._afterNew(), this._disposers.push(this.events.on("globalpointermove", (t) => {
625
+ if (this.connectorLine.isVisible()) {
626
+ const i = this.toLocal(t.point);
627
+ this._updateConnector(i);
628
+ }
629
+ })), this.events.on("globalpointerup", (t) => {
630
+ this.connectorLine.isVisible() && this._endConnector();
631
+ }), this.columns.template.events.on("dragstart", (t) => {
632
+ this._columnDragStartX = t.target.x(), this._columnDragStartY = t.target.y();
633
+ }), this.columns.template.events.on("dragged", (t) => {
634
+ this._handleColumnDragged(t);
635
+ }), this.columns.template.events.on("dragstop", (t) => {
636
+ const i = this.get("xAxis"), e = t.target.dataItem, s = e.get("openValueX", 0);
637
+ let n = i.positionToValue(i.coordinateToPosition(t.target.x()));
638
+ const o = e.get("valueX", 0);
639
+ let r = n - s;
640
+ e.set("openValueX", n), e.set("valueX", o + r), e.set("openValueXWorking", n), e.set("valueXWorking", o + r), this._fixValues(e, "duration"), this._moveChildValues(e, r);
641
+ });
642
+ }
643
+ /**
644
+ * @ignore
645
+ */
646
+ roundValue(t, i) {
647
+ let e = this.gantt.get("snapThreshold", 0.8);
648
+ i && (e = 1 - e);
649
+ const s = this.get("snapCount", 1), o = this.get("xAxis").get("baseInterval");
650
+ return mt(t + this.getUnitDuration() * e, o.timeUnit, o.count * s, this._root);
651
+ }
652
+ /**
653
+ * @ignore
654
+ */
655
+ makeColumn(t, i) {
656
+ const e = super.makeColumn(t, i), s = this.get("yAxis");
657
+ e.events.on("click", () => {
658
+ s.selectDataItem(t.get("categoryAxisDataItem"));
659
+ });
660
+ const n = this.mainContainer.children.push(this.containers.make());
661
+ n._setDataItem(t), this.containers.push(n);
662
+ const o = this.zeroRectangles.make();
663
+ t.set("zeroRectangle", o), this.zeroRectangles.push(o), n.children.unshift(o), t.get("duration", 0) > 0 && o.hide(0);
664
+ let r = 0;
665
+ o.events.on("pointerdown", (p) => {
666
+ r = p.target.y(), e.dragStart(p);
667
+ }), o.events.on("dragstart", (p) => {
668
+ this._handleColumnDragged(p), p.target.setAll({
669
+ x: 0,
670
+ y: r
671
+ });
672
+ }), o.events.on("dragged", (p) => {
673
+ this._handleColumnDragged(p), p.target.setAll({
674
+ x: 0,
675
+ y: r
676
+ });
677
+ }), o.events.on("dragstop", (p) => {
678
+ e.dragStop(p);
679
+ }), o.events.on("pointerover", (p) => {
680
+ this._handleColumnHover(p);
681
+ }), o.adapters.add("fillPattern", (p, x) => x.dataItem.get("progress", 0) < 1 ? c.get("fillPattern") : p);
682
+ const a = n.children.push(this.maskedContainers.make());
683
+ t.setRaw("maskedContainer", a);
684
+ const l = n.children.push(ct.new(this._root, {
685
+ fill: j(16777215),
686
+ forceInactive: !0,
687
+ fillOpacity: 0
688
+ }));
689
+ t.setRaw("mask", l), a.set("mask", l);
690
+ const c = a.children.push(this.progressRectangles.make());
691
+ this.progressRectangles.push(c);
692
+ const h = this.progressGrips.make();
693
+ this.progressGrips.push(h), a.children.push(h), h.events.on("dragged", () => {
694
+ let p = h.x();
695
+ p = q(p, 0, e.getPrivate("width", 0)), h.setAll({ x: p, y: e.getPrivate("height", 0) }), t.set("progress", h.x() / e.getPrivate("width", 0));
696
+ });
697
+ const g = this.startGrips.make();
698
+ this.startGrips.push(g), n.children.push(g);
699
+ const u = this.endGrips.make();
700
+ this.endGrips.push(u), n.children.push(u), t.setRaw("startGrip", g), t.setRaw("endGrip", u);
701
+ const d = this.get("xAxis");
702
+ let m = 0;
703
+ g.events.on("dragstart", () => {
704
+ m = e.x(), e.show(), o.hide(), a.show();
705
+ }), g.events.on("pointerover", () => {
706
+ e.states.applyAnimate("hover");
707
+ }), g.events.on("pointerout", () => {
708
+ e.isVisible() && e.states.applyAnimate("default");
709
+ }), g.events.on("dragged", () => {
710
+ g.set("y", 0);
711
+ const p = g.x() + m;
712
+ let x = d.positionToValue(d.coordinateToPosition(p)), D = this._findMinStart(t);
713
+ x = Math.max(x, D), x = Math.min(x, t.get("valueX", x)), t.set("openValueX", x), g.set("x", 0);
714
+ }), g.events.on("dragstop", () => {
715
+ this._fixValues(t, "end"), this.markDirtyValues();
716
+ });
717
+ let v = 0;
718
+ u.events.on("dragstart", () => {
719
+ v = e.x(), e.show(), o.hide(), a.show();
720
+ }), u.events.on("pointerover", () => {
721
+ e.states.applyAnimate("hover");
722
+ }), u.events.on("pointerout", () => {
723
+ e.isVisible() && e.states.applyAnimate("default");
724
+ }), u.events.on("dragged", () => {
725
+ u.set("y", 0);
726
+ const p = u.x() + v;
727
+ let x = d.positionToValue(d.coordinateToPosition(p));
728
+ x = Math.max(x, t.get("openValueX", 0)), t.set("valueX", x), t.set("valueXWorking", x);
729
+ const D = t.get("graphics");
730
+ D && u.set("x", D.width());
731
+ }), u.events.on("dragstop", () => {
732
+ this._fixValues(t, "start"), this.markDirtyValues();
733
+ });
734
+ const f = this.startBullets.make();
735
+ f.events.on("pointerout", () => {
736
+ e.isVisible() && e.states.applyAnimate("default");
737
+ }), this.startBullets.push(f), n.children.push(f);
738
+ const _ = this.endBullets.make();
739
+ this.endBullets.push(_), n.children.push(_);
740
+ const C = (p) => {
741
+ this._startConnector(p);
742
+ };
743
+ f.events.on("pointerdown", () => C(f)), _.events.on("pointerdown", () => C(_)), e.events.on("pointerover", (p) => {
744
+ this._handleColumnHover(p);
745
+ }), e.events.on("pointerout", () => {
746
+ this._hoveredDataItem = void 0, this.connectorLine.isVisible() && f.hide();
747
+ }), t.setRaw("container", n), t.setRaw("startBullet", f), t.setRaw("endBullet", _), t.setRaw("progressRectangle", c), t.setRaw("progressGrip", h);
748
+ const k = (p, x) => {
749
+ e.on(p, (D) => {
750
+ x.set(p, D);
751
+ });
752
+ };
753
+ return k("x", n), k("y", n), k("dx", n), k("dy", n), k("cornerRadiusBL", l), k("cornerRadiusBR", l), k("cornerRadiusTL", l), k("cornerRadiusTR", l), this.isCollapsed(t) ? (t.hide(0), e.hide(0), a.hide(0)) : t.get("duration", 0) > 0 && (e.appear(), a.appear()), e;
754
+ }
755
+ _handleColumnDragged(t) {
756
+ const i = t.target, e = i.dataItem;
757
+ if (this._columnDragStartY !== void 0 && i.set("y", this._columnDragStartY), e && this._columnDragStartX !== void 0) {
758
+ const s = i.x() - this._columnDragStartX;
759
+ this._dragChildValues(e, s), this._updateLinks();
760
+ }
761
+ }
762
+ _handleColumnHover(t) {
763
+ var i;
764
+ if (!this.connectorLine.isVisible())
765
+ return;
766
+ const s = t.target.dataItem;
767
+ if (!s)
768
+ return;
769
+ const n = s.get("startBullet"), o = (i = this._startBullet) === null || i === void 0 ? void 0 : i.dataItem;
770
+ n && o && this.getDepth(o) === this.getDepth(s) && o !== s && (n.show(), this._hoveredDataItem = s);
771
+ }
772
+ /**
773
+ * Checks if the task is collapsed.
774
+ *
775
+ * @param dataItem Data item
776
+ * @return Collapsed?
777
+ */
778
+ isCollapsed(t) {
779
+ const i = t.get("categoryAxisDataItem");
780
+ if (i) {
781
+ const e = i.get("parent");
782
+ if (e)
783
+ return e.get("collapsed") ? !0 : this.isCollapsed(e);
784
+ }
785
+ return !1;
786
+ }
787
+ /**
788
+ * Updates the series, recalculating values and updating children.
789
+ *
790
+ * @ignore Exclude from docs
791
+ */
792
+ _updateChildren() {
793
+ if (this._valuesDirty) {
794
+ this.setPrivateRaw("minX", void 0), this.setPrivateRaw("maxX", void 0);
795
+ const t = this.get("yAxis"), i = t.get("renderer");
796
+ y(this.dataItems, (s) => {
797
+ const n = s.dataContext, o = s.get("categoryAxisDataItem");
798
+ if (o) {
799
+ const r = s.get("children");
800
+ r && r.length > 0 ? (s.set("openValueX", void 0), s.set("valueX", void 0), s.set("openValueXWorking", void 0), s.set("valueXWorking", void 0), delete n[this.get("openValueXField")], delete n[this.get("durationField")]) : (n[this.get("openValueXField")] = s.get("openValueX"), n[this.get("durationField")] = s.get("duration"), n[this.get("progressField")] = s.get("progress")), n[this.get("linkToField")] = s.get("linkTo");
801
+ const a = s.get("categoryY"), l = this.get("categoryYField", "category");
802
+ n[l] = a;
803
+ const c = o.dataContext, h = t.get("categoryField", "category"), g = o.get("parent");
804
+ c[h] = a, g && (c[t.get("parentIdField", "parentId")] = g.get("id"), c[t.get("collapsedField", "collapsed")] = o.get("collapsed", !1));
805
+ }
806
+ }), y(this.dataItems, (s) => {
807
+ this._adjustParentValues(s);
808
+ const n = s.get("children"), o = s.get("startGrip"), r = s.get("endGrip"), a = s.get("progressGrip");
809
+ let l = !0;
810
+ n && n.length > 0 && (l = !1), o && o.setPrivate("visible", l), r && r.set("visible", l), a && a.set("visible", l);
811
+ const c = s.get("categoryAxisDataItem");
812
+ let h = 0;
813
+ if (c) {
814
+ const f = c.get("durationStepper");
815
+ f && f.set("disabled", !l), h = c.get("index", 0);
816
+ }
817
+ const g = s.get("duration", 0);
818
+ let u = s.get("zeroRectangle");
819
+ const d = s.get("graphics"), m = s.get("maskedContainer"), v = c.get("customColor", c.get("color"));
820
+ if (u) {
821
+ let f = 20, _ = t.indexToPosition(h, 0), C = t.indexToPosition(h, 1);
822
+ _ = i.positionToCoordinate(_), C = i.positionToCoordinate(C);
823
+ const k = d.get("height", 0);
824
+ let p = 1;
825
+ k instanceof ht && (p *= k.value * Q(45)), f = (C - _) * p;
826
+ const x = d.get("maxHeight", 1 / 0) * Q(45), D = d.get("minHeight", 0) * Q(45);
827
+ f = q(f, D, x), u.setPrivate("height", f), u.setPrivate("width", f);
828
+ }
829
+ d && m && !this.isCollapsed(s) && (g === 0 && u ? !d.isHidden() && !d.isHiding() && (u.setAll({
830
+ fill: v,
831
+ stroke: v
832
+ }), !o?.isDragging() && !r?.isDragging() && (d.hide(), m.hide(), u.show())) : (u && u.hide(), d.show(), m.show()));
833
+ }), y(this.dataItems, (s) => {
834
+ this._adjustLinkValues(s);
835
+ }), y(this.dataItems, (s) => {
836
+ this._adjustParentValues(s);
837
+ const n = s.get("categoryAxisDataItem");
838
+ n && (n.set("duration", s.get("duration")), n.set("progress", s.get("progress")));
839
+ });
840
+ const e = "valueschanged";
841
+ this.events.isEnabled(e) && this.events.dispatch(e, {
842
+ type: e,
843
+ target: this
844
+ });
845
+ }
846
+ super._updateChildren(), this._columnsUpdated && this._updateLinks();
847
+ }
848
+ _getParentOpen(t) {
849
+ const i = t.get("parent");
850
+ return i ? this._getParentOpen(i) : t.get("openValueX", -1 / 0);
851
+ }
852
+ _adjustLinkValues(t) {
853
+ const i = t.get("linkTo");
854
+ if (i) {
855
+ const e = t.get("valueX", 0);
856
+ y(i, (s) => {
857
+ const n = this.getDataItemById(s);
858
+ if (n && n !== t) {
859
+ const o = n.get("openValueX", 0);
860
+ o !== void 0 && o < e && (n.set("openValueX", e), this._fixValues(n, "duration"), this._adjustChildValues(n));
861
+ }
862
+ });
863
+ }
864
+ }
865
+ _adjustChildValues(t) {
866
+ const i = t.get("children", []);
867
+ if (i && i.length > 0) {
868
+ let e = t.get("openValueX", 0);
869
+ y(i, (s) => {
870
+ const n = s.get("openValueX", 0);
871
+ (n === void 0 || n < e) && (s.set("openValueX", e), this._fixValues(s, "duration")), this._adjustChildValues(s);
872
+ });
873
+ }
874
+ }
875
+ _dragChildValues(t, i) {
876
+ const e = t.get("children");
877
+ e && e.length > 0 && y(e, (s) => {
878
+ const n = s.get("graphics");
879
+ n && n.set("dx", i), this._dragChildValues(s, i);
880
+ });
881
+ }
882
+ _moveChildValues(t, i) {
883
+ const e = t.get("children");
884
+ e && e.length > 0 && y(e, (s) => {
885
+ s.set("openValueX", s.get("openValueX", 0) + i), s.set("valueX", s.get("valueX", 0) + i), s.set("openValueXWorking", s.get("openValueX")), s.set("valueXWorking", s.get("openValueX"));
886
+ const n = s.get("graphics");
887
+ n && n.set("dx", 0), this._fixValues(s, "duration"), this._moveChildValues(s, i);
888
+ });
889
+ }
890
+ _findMinStart(t) {
891
+ let i = -1 / 0;
892
+ y(this.dataItems, (s) => {
893
+ const n = s.get("linkTo");
894
+ n && y(n, (o) => {
895
+ if (o === t.get("id")) {
896
+ const r = s.get("valueX", 0);
897
+ r > i && (i = r);
898
+ }
899
+ });
900
+ });
901
+ const e = t.get("parent");
902
+ return e && (i = Math.max(i, this._findMinStart(e))), i;
903
+ }
904
+ _adjustParentValues(t) {
905
+ const i = t.get("categoryAxisDataItem");
906
+ if (i) {
907
+ const e = t.get("graphics");
908
+ let s = i.get("customColor", i.get("color"));
909
+ e && e.setAll({
910
+ fill: s,
911
+ stroke: s
912
+ });
913
+ const n = t.get("zeroRectangle");
914
+ n && n.setAll({
915
+ fill: s,
916
+ stroke: s
917
+ });
918
+ const o = t.get("children");
919
+ if (o && o.length > 0) {
920
+ let r = 0;
921
+ y(o, (a) => {
922
+ const l = a.get("progress", 0);
923
+ l !== void 0 && (r += l);
924
+ }), r /= o.length, t.set("progress", r);
925
+ }
926
+ if (i) {
927
+ let r = t.get("valueX"), a = t.get("openValueX");
928
+ const l = t.get("duration", 0);
929
+ r === void 0 && a !== void 0 && (a = this.getOpenValue(a), r = this.getEndValue(a, l), t.setRaw("openValueX", a), t.setRaw("valueX", r));
930
+ let c = t.get("parent");
931
+ if (a !== void 0 && r !== void 0 && c) {
932
+ const h = c.get("openValueX"), g = c.get("valueX");
933
+ (h === void 0 || h > a) && c.set("openValueX", a), (g === void 0 || g < r) && (c.set("valueX", r), c.set("valueXWorking", r)), c.set("duration", this.getDataItemDuration(c)), this._adjustParentValues(c);
934
+ }
935
+ }
936
+ }
937
+ }
938
+ _startConnector(t) {
939
+ var i, e, s, n;
940
+ this._startBullet = t, this.connectorLine.show(), this.connectorArrow.show(), this._xPan = (i = this.chart) === null || i === void 0 ? void 0 : i.get("panX"), this._yPan = (e = this.chart) === null || e === void 0 ? void 0 : e.get("panY"), (s = this.chart) === null || s === void 0 || s.set("panX", !1), (n = this.chart) === null || n === void 0 || n.set("panY", !1);
941
+ const o = t.dataItem, r = this.getDepth(o), a = [];
942
+ y(this.dataItems, (g) => {
943
+ this.getDepth(g) != r && G(a, g);
944
+ const u = o.get("links");
945
+ u && u[g.get("id")] && G(a, g);
946
+ });
947
+ const l = o.get("parent");
948
+ l && y(this.dataItems, (g) => {
949
+ g.get("parent") !== l && G(a, g);
950
+ });
951
+ const c = o.get("id"), h = (g) => {
952
+ y(this.dataItems, (u) => {
953
+ const d = u.get("links");
954
+ d && d[g] && (a.push(u), h(u.get("id")));
955
+ });
956
+ };
957
+ h(c), y(a, (g) => {
958
+ const u = g.get("graphics");
959
+ u && u.states.applyAnimate("disabled");
960
+ const d = g.get("container");
961
+ d && d.states.applyAnimate("disabled");
962
+ const m = g.get("zeroRectangle");
963
+ m && m.states.applyAnimate("disabled");
964
+ });
965
+ }
966
+ _updateConnector(t) {
967
+ var i;
968
+ let e = (i = this._startBullet) === null || i === void 0 ? void 0 : i.toGlobal({ x: 0, y: 0 });
969
+ e && (e = this.toLocal(e), this.connectorLine.setAll({
970
+ segments: [[[{ x: e.x, y: e.y }, { x: t.x, y: t.y }]]]
971
+ }), this.connectorArrow.setAll({
972
+ x: t.x,
973
+ y: t.y,
974
+ rotation: bt(e, t) + 90
975
+ }));
976
+ }
977
+ _endConnector() {
978
+ var t, i, e, s, n;
979
+ let o = (t = this._startBullet) === null || t === void 0 ? void 0 : t.toGlobal({ x: 0, y: 0 });
980
+ if (o) {
981
+ o = this.toLocal(o), this.connectorLine.hide(), this.connectorArrow.hide(), y(this.dataItems, (a) => {
982
+ const l = a.get("graphics");
983
+ l && l.isVisible() && l.states.applyAnimate("default");
984
+ const c = a.get("container");
985
+ c && c.isVisible() && c.states.applyAnimate("default");
986
+ const h = a.get("zeroRectangle");
987
+ h && h.isVisible() && h.states.applyAnimate("default");
988
+ });
989
+ let r = this._hoveredDataItem;
990
+ if (r && r !== ((i = this._startBullet) === null || i === void 0 ? void 0 : i.dataItem)) {
991
+ const a = r.get("id");
992
+ if (a) {
993
+ const l = (e = this._startBullet) === null || e === void 0 ? void 0 : e.dataItem;
994
+ if (l) {
995
+ const c = l.get("linkTo", []);
996
+ Tt(c, a) === -1 && (c.push(a), l.set("linkTo", c), this.markDirtyValues());
997
+ }
998
+ }
999
+ }
1000
+ this._updateLinks();
1001
+ }
1002
+ this.endBullets.each((r) => {
1003
+ r.show();
1004
+ }), this.startBullets.each((r) => {
1005
+ r.hide();
1006
+ }), (s = this.chart) === null || s === void 0 || s.set("panX", this._xPan), (n = this.chart) === null || n === void 0 || n.set("panY", this._yPan);
1007
+ }
1008
+ /**
1009
+ * Fixes values of a data item, adjusting start, end, or duration as needed.
1010
+ */
1011
+ _fixValues(t, i) {
1012
+ let e = t.get("valueX"), s = t.get("openValueX"), n = t.get("duration", 0);
1013
+ if (H(e) && H(s)) {
1014
+ i === "start" ? (e = this.roundValue(e), n = this.getDataItemDuration(t), t.set("duration", n)) : i === "end" ? (s = this.roundValue(s, !0), n = this.getDataItemDuration(t), t.set("duration", n)) : i === "duration" && (s = this.roundValue(s, !0), e = s + n * this.getUnitDuration()), s = this.getOpenValue(s), e = this.getEndValue(s, n);
1015
+ const o = this.get("interpolationDuration", 0), r = this.get("interpolationEasing"), a = this.dataItems.indexOf(t);
1016
+ a >= this.startIndex() && a <= this.endIndex() ? (t.animate({ key: "openValueXWorking", to: s, duration: o, easing: r }), t.animate({ key: "valueXWorking", to: e, duration: o, easing: r }), t.animate({ key: "openValueX", to: s, duration: o, easing: r }), t.animate({ key: "valueX", to: e, duration: o, easing: r })) : (t.set("openValueXWorking", s), t.set("valueXWorking", e), t.set("openValueX", s), t.set("valueX", e));
1017
+ }
1018
+ }
1019
+ _toggleColumn(t, i) {
1020
+ super._toggleColumn(t, i);
1021
+ const e = t.get("container");
1022
+ e && e.setPrivate("visible", i);
1023
+ }
1024
+ _afterDataChange() {
1025
+ const t = this.get("yAxis");
1026
+ y(this.dataItems, (i) => {
1027
+ this._fixValues(i, "duration");
1028
+ const e = i.get("categoryY");
1029
+ if (e) {
1030
+ const s = t.dataItems.find((n) => n.get("category") === e);
1031
+ i.set("categoryAxisDataItem", s), s && s.on("duration", () => {
1032
+ const n = s.get("duration"), o = i.get("children");
1033
+ (!o || o.length === 0) && n !== void 0 && (i.set("duration", n), this._fixValues(i, "duration"));
1034
+ });
1035
+ }
1036
+ }), this.get("yAxis").markDirtyTree(), super._afterDataChange();
1037
+ }
1038
+ _updateLinks() {
1039
+ const t = this.get("xAxis"), i = this.get("yAxis"), e = i.get("renderer");
1040
+ let s = 0;
1041
+ const n = this.endBullets.getIndex(0);
1042
+ n && n.isVisible() && (s = n.get("radius", 0));
1043
+ let o = O(60), r = 0, a = 1 / 0, l = this.columns.getIndex(0), c = 1;
1044
+ if (l) {
1045
+ o = l.get("height", 0);
1046
+ const h = Q(45);
1047
+ o instanceof ht && (c = o.value * h * h), r = l.get("minHeight", 0) * h * h, a = l.get("maxHeight", 1 / 0) * h * h;
1048
+ }
1049
+ y(this.dataItems, (h) => {
1050
+ const g = h.get("linkTo"), u = h.get("categoryAxisDataItem");
1051
+ if (g) {
1052
+ let d = h.get("links");
1053
+ const m = this.get("linkHorizontalOffset", 25);
1054
+ y(g, (v) => {
1055
+ d || (d = h.set("links", {}));
1056
+ let f = d[v];
1057
+ f || (f = this.links.make(), d[v] = f, this.links.push(f), this.linksContainer.children.push(f), f.appear(), f.events.on("click", () => {
1058
+ if (f.get("active")) {
1059
+ this.links.removeValue(f);
1060
+ const A = h.get("links");
1061
+ A && delete A[v], tt(g, v), this.markDirtyValues(), f.dispose();
1062
+ }
1063
+ }), f.events.on("globalpointerup", () => {
1064
+ f.get("active") && !f.isHover() && f.set("active", !1);
1065
+ }));
1066
+ const _ = [], C = t.valueToPosition(h.get("valueX", 0)), k = i.categoryToPosition(h.get("categoryY")), p = this.getPoint(C, k);
1067
+ let x = { x: p.x + s, y: p.y };
1068
+ if (h.get("duration", 0) === 0) {
1069
+ let A = i.indexToPosition(u.get("index", 0), 0), B = i.indexToPosition(u.get("index", 0), 1);
1070
+ A = e.positionToCoordinate(A), B = e.positionToCoordinate(B);
1071
+ let P = (B - A) * c;
1072
+ P = q(P, r, a), x.x += P - s;
1073
+ }
1074
+ _.push(x), _.push({ x: x.x + m, y: x.y });
1075
+ const D = this.getDataItemById(v);
1076
+ if (D) {
1077
+ const A = t.valueToPosition(D.get("openValueX", 0)), B = i.categoryToPosition(D.get("categoryY")), P = this.getPoint(A, B);
1078
+ let U = P.x, $ = P.y, Y = { x: U, y: $ };
1079
+ if (D.get("duration", 0) === 0) {
1080
+ let z = D.get("categoryAxisDataItem");
1081
+ if (z) {
1082
+ let X = i.indexToPosition(z.get("index", 0), 0), W = i.indexToPosition(z.get("index", 0), 1);
1083
+ X = e.positionToCoordinate(X), W = e.positionToCoordinate(W);
1084
+ let F = (W - X) * c;
1085
+ F = q(F, r, a), Y.x -= F;
1086
+ }
1087
+ }
1088
+ if (Y.x - m < x.x + m) {
1089
+ const z = h.get("categoryY"), X = this.get("yAxis");
1090
+ if (z) {
1091
+ let W = X.categoryToIndex(z);
1092
+ const F = X.indexToPosition(W), _t = X.indexToPosition(W, 1);
1093
+ if (X && z) {
1094
+ let lt = -1;
1095
+ Y.y > x.y && (lt = 1);
1096
+ let Dt = X.get("renderer").positionToCoordinate(X.categoryToPosition(z) + (_t - F) * lt);
1097
+ _.push({ x: x.x + m, y: Dt });
1098
+ }
1099
+ }
1100
+ }
1101
+ _.push({ x: Y.x - m, y: Y.y }), _.push(Y);
1102
+ }
1103
+ f.set("points", _);
1104
+ });
1105
+ }
1106
+ });
1107
+ }
1108
+ /**
1109
+ * Updates series graphics.
1110
+ */
1111
+ _updateSeriesGraphics(t, i, e, s, n, o, r, a) {
1112
+ super._updateSeriesGraphics(t, i, e, s, n, o, !1, a);
1113
+ let l = t.get("left", 0), c = t.get("top", 0), h = t.get("right", 0) - l, g = t.get("bottom", 0) - c;
1114
+ const u = t.get("container"), d = t.get("mask"), m = t.get("categoryAxisDataItem"), v = m ? m.get("customColor", m.get("color")) : void 0;
1115
+ t.setRaw("name", m.dataContext.name);
1116
+ const f = t.get("startBullet");
1117
+ f?.setAll({
1118
+ x: 0,
1119
+ stroke: v
1120
+ });
1121
+ const _ = t.get("endBullet");
1122
+ _?.setAll({
1123
+ stroke: v,
1124
+ x: h
1125
+ }), u && u.setAll({
1126
+ x: l,
1127
+ y: c,
1128
+ width: h,
1129
+ height: g
1130
+ });
1131
+ const C = t.get("maskedContainer");
1132
+ C && C.setAll({
1133
+ x: 0,
1134
+ y: 0,
1135
+ width: h,
1136
+ height: g
1137
+ }), d && d.setAll({
1138
+ x: 0,
1139
+ y: 0,
1140
+ width: h,
1141
+ height: g
1142
+ });
1143
+ const k = t.get("startGrip");
1144
+ k && k.setAll({
1145
+ height: g
1146
+ });
1147
+ const p = t.get("endGrip");
1148
+ p && p.setAll({
1149
+ x: h,
1150
+ height: g
1151
+ });
1152
+ const x = t.get("progressRectangle");
1153
+ if (x) {
1154
+ const D = t.get("progress", 0), A = h - h * D;
1155
+ x.setAll({
1156
+ x: h - A,
1157
+ width: A,
1158
+ height: g
1159
+ });
1160
+ const B = t.get("progressGrip");
1161
+ B && B.setAll({
1162
+ x: h - A
1163
+ });
1164
+ const P = t.get("zeroRectangle");
1165
+ P && P.markDirtyKey("fillPattern");
1166
+ }
1167
+ }
1168
+ /**
1169
+ * Hides series's data item.
1170
+ *
1171
+ * @param dataItem Data item
1172
+ * @param duration Animation duration in milliseconds
1173
+ * @return Promise
1174
+ */
1175
+ hideDataItem(t, i) {
1176
+ const e = Object.create(null, {
1177
+ hideDataItem: { get: () => super.hideDataItem }
1178
+ });
1179
+ return et(this, void 0, void 0, function* () {
1180
+ const s = [e.hideDataItem.call(this, t, i)], n = t.get("container");
1181
+ n && s.push(n.hide(i));
1182
+ const o = t.get("links", {});
1183
+ o && ot(o, (a, l) => {
1184
+ l.hide(i);
1185
+ });
1186
+ const r = t.get("id");
1187
+ r && y(this.dataItems, (a) => {
1188
+ const l = a.get("linkTo");
1189
+ if (l && l.includes(r)) {
1190
+ const c = a.get("links");
1191
+ c && c[r] && c[r].hide(i);
1192
+ }
1193
+ }), yield Promise.all(s);
1194
+ });
1195
+ }
1196
+ /**
1197
+ * Shows series's data item.
1198
+ *
1199
+ * @param dataItem Data item
1200
+ * @param duration Animation duration in milliseconds
1201
+ * @return Promise
1202
+ */
1203
+ showDataItem(t, i) {
1204
+ const e = Object.create(null, {
1205
+ showDataItem: { get: () => super.showDataItem }
1206
+ });
1207
+ return et(this, void 0, void 0, function* () {
1208
+ const s = [e.showDataItem.call(this, t, i)], n = t.get("container");
1209
+ n && s.push(n.show(i));
1210
+ const o = t.get("links", {});
1211
+ o && ot(o, (a, l) => {
1212
+ l.show(i);
1213
+ });
1214
+ const r = t.get("id");
1215
+ r && y(this.dataItems, (a) => {
1216
+ const l = a.get("linkTo");
1217
+ if (l && l.includes(r)) {
1218
+ const c = a.get("links");
1219
+ c && c[r] && c[r].show(i);
1220
+ }
1221
+ }), yield Promise.all(s);
1222
+ });
1223
+ }
1224
+ /**
1225
+ * Disposes a data item and removes it from the series.
1226
+ *
1227
+ * @param dataItem Data item
1228
+ */
1229
+ disposeDataItem(t) {
1230
+ super.disposeDataItem(t);
1231
+ const i = t.get("container");
1232
+ i && (this.containers.removeValue(i), i.dispose());
1233
+ const e = t.get("startBullet");
1234
+ e && (this.startBullets.removeValue(e), e.dispose());
1235
+ const s = t.get("endBullet");
1236
+ s && (this.endBullets.removeValue(s), s.dispose());
1237
+ const n = t.get("startGrip");
1238
+ n && (this.startGrips.removeValue(n), n.dispose());
1239
+ const o = t.get("endGrip");
1240
+ o && (this.endGrips.removeValue(o), o.dispose());
1241
+ const r = t.get("progressRectangle");
1242
+ r && (this.progressRectangles.removeValue(r), r.dispose());
1243
+ const a = t.get("zeroRectangle");
1244
+ a && (this.zeroRectangles.removeValue(a), a.dispose());
1245
+ const l = t.get("progressGrip");
1246
+ l && (this.progressGrips.removeValue(l), l.dispose()), this.disposeLinks(t);
1247
+ }
1248
+ /**
1249
+ * Disposes all links of a data item and removes them from the series.
1250
+ *
1251
+ * @param dataItem Data item
1252
+ */
1253
+ disposeLinks(t) {
1254
+ const i = t.get("links", {});
1255
+ i && (ot(i, (s, n) => {
1256
+ n.dispose(), delete i[s];
1257
+ }), t.set("linkTo", []));
1258
+ const e = t.get("id", "");
1259
+ e && y(this.dataItems, (s) => {
1260
+ const n = s.get("linkTo");
1261
+ if (n && n.includes(e)) {
1262
+ tt(n, e);
1263
+ const o = s.get("links");
1264
+ if (o && o[e]) {
1265
+ const r = o[e];
1266
+ this.links.removeValue(r), delete o[e], r.dispose();
1267
+ }
1268
+ }
1269
+ });
1270
+ }
1271
+ /**
1272
+ * Returns the duration of a data item in units.
1273
+ *
1274
+ * @param dataItem Data item
1275
+ * @return Duration in units
1276
+ */
1277
+ getDataItemDuration(t) {
1278
+ const i = t.get("openValueX", 0);
1279
+ let e = t.get("valueX", 0);
1280
+ return Math.round((e - i) / this.getUnitDuration()) - this.getHolidayCount(i, e);
1281
+ }
1282
+ /**
1283
+ * Returns the depth of a data item in the hierarchy.
1284
+ *
1285
+ * @param dataItem Data item
1286
+ * @return Depth level
1287
+ */
1288
+ getDepth(t) {
1289
+ let i = 0, e = t.get("parent");
1290
+ for (; e; )
1291
+ i++, e = e.get("parent");
1292
+ return i;
1293
+ }
1294
+ /**
1295
+ * Returns the end value of a data item, adjusting for holidays and weekends.
1296
+ *
1297
+ * @param openValue Open value in milliseconds
1298
+ * @param duration Duration in units
1299
+ * @return Adjusted end value in milliseconds
1300
+ */
1301
+ getEndValue(t, i) {
1302
+ let e = i;
1303
+ const s = this.getUnitDuration();
1304
+ if (this.gantt.get("excludeWeekends", !0))
1305
+ for (let n = 0; n < e; n++)
1306
+ this.isHoliday(t + n * s) && e++;
1307
+ return t + e * s;
1308
+ }
1309
+ /**
1310
+ * Returns the open value of a data item, adjusting for holidays and weekends.
1311
+ *
1312
+ * @param openValue Open value in milliseconds
1313
+ * @return Adjusted open value
1314
+ */
1315
+ getOpenValue(t) {
1316
+ if (this.gantt.get("excludeWeekends", !0))
1317
+ for (; this.isHoliday(t); )
1318
+ t += this.getUnitDuration();
1319
+ return t;
1320
+ }
1321
+ /**
1322
+ * Returns the duration of a unit in milliseconds.
1323
+ *
1324
+ * @return Duration in milliseconds
1325
+ */
1326
+ getUnitDuration() {
1327
+ return rt(this.gantt.get("durationUnit", "day"));
1328
+ }
1329
+ /**
1330
+ * Returns the count of holidays between two dates.
1331
+ *
1332
+ * @param start Start date in milliseconds
1333
+ * @param end End date in milliseconds
1334
+ * @return Count of holidays
1335
+ */
1336
+ getHolidayCount(t, i) {
1337
+ let e = 0, s = !0;
1338
+ for (let n = i; n >= t; n -= this.getUnitDuration())
1339
+ this.isHoliday(n) ? !s && this.isHoliday(n) && e++ : s = !1;
1340
+ return e;
1341
+ }
1342
+ /**
1343
+ * Checks if a given date is a holiday or weekend.
1344
+ *
1345
+ * @param value Date value in milliseconds
1346
+ * @return `true` if the date is a holiday or weekend, otherwise `false`
1347
+ */
1348
+ isHoliday(t) {
1349
+ if (this.gantt.get("excludeWeekends", !0)) {
1350
+ const i = this.gantt.get("holidays", []), e = this.gantt.get("weekends", [0, 6]), s = new Date(t);
1351
+ if (e.includes(s.getDay()))
1352
+ return !0;
1353
+ if (i && i.length > 0) {
1354
+ let n = !1;
1355
+ return Bt(i, (o) => {
1356
+ if (o instanceof Date) {
1357
+ const r = o.getTime(), a = o.getTime() + rt("day");
1358
+ if (t >= r && t < a)
1359
+ return n = !0, !1;
1360
+ }
1361
+ return !0;
1362
+ }), n;
1363
+ }
1364
+ }
1365
+ return !1;
1366
+ }
1367
+ }
1368
+ it.className = "GanttSeries";
1369
+ it.classNames = yt.classNames.concat([it.className]);
1370
+ class st extends kt {
1371
+ constructor() {
1372
+ super(...arguments), this._treeDirty = !1, this.xButton = this.children.push(S.new(this._root, {
1373
+ themeTags: ["xbutton"],
1374
+ icon: V.new(this._root, {
1375
+ themeTags: ["icon"]
1376
+ })
1377
+ }));
1378
+ }
1379
+ _afterNew() {
1380
+ this.fields.push("parentId", "collapsed", "name"), super._afterNew(), this.events.on("wheel", (r) => {
1381
+ this.chart.handleWheel(r);
1382
+ }), this.xButton.hide(0);
1383
+ const t = this.get("renderer");
1384
+ this._firstDataItem = this.makeDataItem({ cellSize: 1e-4 }), t.makeTick(this._firstDataItem, []).set("dy", 0.5), t.makeGrid(this._firstDataItem, []).set("dy", 0.5), this.labelsContainer.setAll({
1385
+ maskContent: !0
1386
+ });
1387
+ const s = this.children.push(I.new(this._root, {
1388
+ themeTags: ["axisresizer"]
1389
+ }));
1390
+ this.axisResizer = s, s.events.on("pointerdown", (r) => {
1391
+ this._downX = this.toLocal(r.point).x, this._downW = this.width();
1392
+ }), s.events.on("globalpointermove", (r) => {
1393
+ if (this._downX !== void 0) {
1394
+ const l = this.toLocal(r.point).x - this._downX;
1395
+ if (this._downW !== void 0) {
1396
+ let c = this._downW + l;
1397
+ c = Math.max(c, this.get("minWidth", 100)), this.labelsContainer.set("width", c);
1398
+ }
1399
+ }
1400
+ }), s.events.on("globalpointerup", () => {
1401
+ this._downX = void 0;
1402
+ });
1403
+ const n = t.containers.template;
1404
+ n.events.on("dragged", (r) => {
1405
+ var a, l;
1406
+ this.xButton.hide(0);
1407
+ const c = r.target.dataItem, h = r.target;
1408
+ if (c) {
1409
+ const g = (r.target.y() - o) / this.chart.plotContainer.height() * (this.get("end", 1) - this.get("start", 0));
1410
+ c.set("deltaPosition", g);
1411
+ const u = (f, _) => {
1412
+ const C = f.get("children");
1413
+ C && y(C, (k) => {
1414
+ k.set("deltaPosition", _), u(k, _);
1415
+ });
1416
+ };
1417
+ u(c, g);
1418
+ const d = c.get("tick"), m = c.get("grid"), v = Math.ceil(o - h.y());
1419
+ if (d) {
1420
+ const f = c.get("children");
1421
+ (!f || f.length == 0) && (d.set("dy", v), m && m.set("dy", v));
1422
+ const _ = h.y(), C = t.containers;
1423
+ this._makeChildOf && ((l = (a = this._makeChildOf.get("container")) === null || a === void 0 ? void 0 : a.get("background")) === null || l === void 0 || l.unhover()), this._makeChildOf = void 0;
1424
+ for (let k = 0; k < C.length; k++) {
1425
+ const p = C.getIndex(k);
1426
+ if (p && p.isVisible() && p !== h) {
1427
+ const x = p.dataItem;
1428
+ if (x.get("cellSize", 0) > 0) {
1429
+ const D = x.get("children");
1430
+ if (D && D.indexOf(c) !== -1)
1431
+ continue;
1432
+ const A = p.get("background");
1433
+ if (A) {
1434
+ const B = p.y();
1435
+ Math.abs(_ + h.height() / 2 - (B + p.height() / 2)) < 5 && (A.hover(), this._makeChildOf = x);
1436
+ }
1437
+ }
1438
+ }
1439
+ }
1440
+ if (this._makeChildOf)
1441
+ this._previousTick && (this._previousTick.unhover(), this._previousTick = void 0);
1442
+ else {
1443
+ this._previousTick && (this._previousTick.states.applyAnimate("default"), this._previousTick = void 0);
1444
+ let k, p = 1 / 0;
1445
+ for (let x = t.ticks.length; x >= 0; x--) {
1446
+ const D = t.ticks.getIndex(x);
1447
+ if (D && d.isVisible()) {
1448
+ const A = D.dataItem;
1449
+ if (A) {
1450
+ const B = A.get("index", 0);
1451
+ if (B >= this.startIndex() && B <= this.endIndex()) {
1452
+ if (A.get("cellSize", 0) == 0)
1453
+ continue;
1454
+ let P = !1, U = A.get("parent");
1455
+ for (; U; ) {
1456
+ if (U === A) {
1457
+ P = !0;
1458
+ break;
1459
+ }
1460
+ U = U.get("parent");
1461
+ }
1462
+ if (P)
1463
+ continue;
1464
+ const $ = Math.abs(D.y() + D.get("dy", 0) - _ - h.height() / 2);
1465
+ $ < p && (p = $, k = D.dataItem);
1466
+ }
1467
+ }
1468
+ }
1469
+ }
1470
+ if (Math.abs(v) < 10 && (k = void 0, this._insertAfter = void 0), k && k !== c) {
1471
+ let x = !1, D = k.get("parent");
1472
+ for (; D; ) {
1473
+ if (D === c) {
1474
+ x = !0;
1475
+ break;
1476
+ }
1477
+ D = D.get("parent");
1478
+ }
1479
+ if (x)
1480
+ return;
1481
+ const A = k.get("tick");
1482
+ A && (A.hover(), this._previousTick = A), this._insertAfter = k;
1483
+ }
1484
+ }
1485
+ }
1486
+ }
1487
+ }), n.events.on("dragstop", (r) => {
1488
+ var a, l;
1489
+ this._draggedItem = r.target.dataItem, this._sortCategoryAxis(), this._makeChildOf && ((l = (a = this._makeChildOf.get("container")) === null || a === void 0 ? void 0 : a.get("background")) === null || l === void 0 || l.unhover(), this._makeChildOf.get("collapsed") && this.toggleCollapse(this._makeChildOf, !0), this._updateCellSizes()), this.get("renderer").containers.each((h) => {
1490
+ h.set("forceInactive", !1);
1491
+ });
1492
+ });
1493
+ let o = 0;
1494
+ n.events.on("dragstart", (r) => {
1495
+ this.get("renderer").containers.each((l) => {
1496
+ l.set("forceInactive", !0);
1497
+ }), o = r.target.y();
1498
+ });
1499
+ }
1500
+ _changed() {
1501
+ super._changed(), this.isDirty("selectedDataItem") && this.selectDataItem(this.get("selectedDataItem"));
1502
+ }
1503
+ _processBullet(t) {
1504
+ var i, e, s;
1505
+ super._processBullet(t);
1506
+ const n = t.get("parent");
1507
+ n && n.get("collapsed") && ((i = t.get("container")) === null || i === void 0 || i.hide(), (e = t.get("tick")) === null || e === void 0 || e.hide(), (s = t.get("grid")) === null || s === void 0 || s.hide(), t.set("finalCellSize", 0));
1508
+ }
1509
+ _updateChildren() {
1510
+ super._updateChildren(), this._dataChanged && (y(this.dataItems, (e) => {
1511
+ var s;
1512
+ if (!e.get("parentId")) {
1513
+ let o = e.get("customColor", e.get("color"));
1514
+ const r = e.dataContext;
1515
+ o === void 0 && r && r.color !== void 0 && (o = j(r.color)), o || (o = (s = this.gantt) === null || s === void 0 ? void 0 : s._nextColor()), e.setRaw("color", o);
1516
+ }
1517
+ }), y(this.dataItems, (e) => {
1518
+ const s = e.get("parentId");
1519
+ if (s) {
1520
+ const n = this.getDataItemById(s);
1521
+ if (n) {
1522
+ e.setRaw("parent", n), e.setRaw("cellSize", Math.pow(this.get("childCellSize", 1), this._getItemDepth(e))), e.setRaw("finalCellSize", e.get("cellSize"));
1523
+ let o = e.get("customColor", e.get("color"));
1524
+ const r = e.dataContext;
1525
+ o === void 0 && r && r.color !== void 0 && (o = j(r.color)), o == null ? e.setRaw("color", n.get("customColor", n.get("color"))) : e.setRaw("color", o);
1526
+ let a = n.get("children");
1527
+ a || (a = [], n.set("children", a)), G(a, e);
1528
+ }
1529
+ } else
1530
+ e.setRaw("cellSize", 1), e.setRaw("finalCellSize", 1);
1531
+ }), y(this.dataItems, (e) => {
1532
+ this.toggleCollapse(e, e.get("collapsed", !1), 0);
1533
+ })), this._treeDirty && this._updateTree();
1534
+ const t = this.get("renderer"), i = this._firstDataItem;
1535
+ i && (t.updateTick(i.get("tick"), 0), t.updateGrid(i.get("grid"), 0)), y(this.dataItems, (e) => {
1536
+ const s = e.get("progressPie");
1537
+ if (s) {
1538
+ const r = e.get("progress", 0);
1539
+ s.set("value", r);
1540
+ const a = e.get("customColor", e.get("color"));
1541
+ e.dataContext.color = a?.toString(), s.slice.set("fill", a), s.backgroundSlice.set("fill", a), s.label.set("fill", a);
1542
+ }
1543
+ const n = e.get("cellSize", 1), o = e.get("container");
1544
+ if (o) {
1545
+ n < 1e-4 ? o.setPrivate("visible", !1) : o.setPrivate("visible", !0);
1546
+ const r = e.get("index", 0), a = this.indexToPosition(r, 0), l = this.indexToPosition(r, 1), c = t.positionToCoordinate(a), h = t.positionToCoordinate(l);
1547
+ o.set("height", Math.abs(h - c));
1548
+ }
1549
+ });
1550
+ }
1551
+ _clearDirty() {
1552
+ super._clearDirty(), this._treeDirty = !1;
1553
+ }
1554
+ getSeriesDataItem(t) {
1555
+ if (t.get("seriesDataItem"))
1556
+ return t.get("seriesDataItem");
1557
+ const i = this.gantt;
1558
+ if (i) {
1559
+ const e = i.series.getDataItemById(t.get("id"));
1560
+ if (e)
1561
+ return t.set("seriesDataItem", e), e;
1562
+ }
1563
+ }
1564
+ /**
1565
+ * Zooms the axis to relative locations.
1566
+ *
1567
+ * Both `start` and `end` are relative: 0 means start of the axis, 1 - end.
1568
+ *
1569
+ * @param start Relative start
1570
+ * @param end Relative end
1571
+ * @param duration Duration of the zoom animation in milliseconds
1572
+ * @return Zoom animation
1573
+ */
1574
+ zoom(t, i, e) {
1575
+ if (this.get("zoomable", !0))
1576
+ if (this._updateFinals(t, i), this.get("start") !== t || this.get("end") != i) {
1577
+ let s = this._sAnimation, n = this._eAnimation;
1578
+ t > i && ([t, i] = [i, t]);
1579
+ let o = this.get("maxDeviation", 0.5) * Math.min(1, i - t);
1580
+ if (t < -o && (t = -o), i > 1 + o && (i = 1 + o), H(e) || (e = this.get("interpolationDuration", 0)), (s && s.playing && s.to == t || this.get("start") == t) && (n && n.playing && n.to == i || this.get("end") == i))
1581
+ return;
1582
+ if (e > 0) {
1583
+ let r = this.get("interpolationEasing"), a, l;
1584
+ if (this.get("start") != t && (a = this.animate({ key: "start", to: t, duration: e, easing: r })), this.get("end") != i && (l = this.animate({ key: "end", to: i, duration: e, easing: r })), this._sAnimation = a, this._eAnimation = l, a)
1585
+ return a;
1586
+ if (l)
1587
+ return l;
1588
+ } else
1589
+ this.set("start", t), this.set("end", i), this.root.events.once("frameended", () => {
1590
+ this.markDirtyKey("start");
1591
+ });
1592
+ } else
1593
+ this._sAnimation && this._sAnimation.stop(), this._eAnimation && this._eAnimation.stop();
1594
+ }
1595
+ _afterDataChange() {
1596
+ super._afterDataChange();
1597
+ const t = this.chart;
1598
+ if (t) {
1599
+ const i = t.plotContainer.height(), e = this.get("minCellHeight", 70), s = Math.floor(i / e);
1600
+ this.set("maxZoomCount", s), this.set("minZoomCount", s), this.get("start") == 0 && this.get("end") == 1 && (this.zoomToIndexes(0, s), this._dataChangeDp && this._dataChangeDp.dispose(), this._dataChangeDp = this.root.events.once("frameended", () => {
1601
+ this.adjustZoom();
1602
+ }));
1603
+ }
1604
+ }
1605
+ markDirtyTree() {
1606
+ this._treeDirty = !0, this.markDirty();
1607
+ }
1608
+ _sortCategoryAxis() {
1609
+ var t;
1610
+ let i = this._insertAfter;
1611
+ const e = this._draggedItem;
1612
+ if (this._previousTick && (this._previousTick.states.applyAnimate("default"), this._previousTick = void 0), !e)
1613
+ return;
1614
+ const s = e.get("parent"), n = this._getItemDepth(e);
1615
+ if (this._makeChildOf) {
1616
+ if (this._makeChildOf && e !== this._makeChildOf) {
1617
+ e.set("parent", this._makeChildOf);
1618
+ let a = this._makeChildOf.get("children");
1619
+ if (a || (a = this._makeChildOf.set("children", [])), a && !a.includes(e) && a.unshift(e), !e.get("customColor")) {
1620
+ const c = this._makeChildOf.get("customColor", this._makeChildOf.get("color"));
1621
+ e.setRaw("color", c);
1622
+ }
1623
+ const l = this.getSeriesDataItem(this._makeChildOf);
1624
+ l && l.setAll({
1625
+ openValueX: void 0,
1626
+ valueX: void 0,
1627
+ duration: e.get("duration", 0)
1628
+ });
1629
+ }
1630
+ i = this._makeChildOf;
1631
+ } else if (i && e !== i) {
1632
+ const a = i.get("children"), l = i.get("parent");
1633
+ if (a && a.length > 0 && !i.get("collapsed", !1))
1634
+ e.set("parent", i);
1635
+ else if (l) {
1636
+ const h = l.get("children");
1637
+ if (h) {
1638
+ const g = h[h.length - 1];
1639
+ if (i == g) {
1640
+ if (e.get("parent") !== l) {
1641
+ const u = l.get("parent");
1642
+ u ? u.get("children") && e.set("parent", u) : e.get("parent") !== void 0 && (e.set("parent", void 0), this._setNewColor(e));
1643
+ }
1644
+ } else
1645
+ a && !i.get("collapsed", !1) ? e.set("parent", i) : e.set("parent", l);
1646
+ }
1647
+ } else
1648
+ e.get("parent") !== void 0 && (e.set("parent", void 0), this._setNewColor(e));
1649
+ const c = e.get("parent");
1650
+ if (c) {
1651
+ if (!e.get("customColor")) {
1652
+ const g = c.get("customColor", c.get("color"));
1653
+ e.setRaw("color", g);
1654
+ }
1655
+ const h = c.get("children");
1656
+ h && (h.indexOf(i) !== -1 ? G(h, e, h.indexOf(i) + 1) : c == i ? h.unshift(e) : h.push(e));
1657
+ }
1658
+ }
1659
+ if (s && s != e.get("parent")) {
1660
+ const a = s.get("children");
1661
+ a && a.indexOf(e) !== -1 && tt(a, e);
1662
+ }
1663
+ if (i) {
1664
+ const a = this.dataItems.indexOf(i), l = this.dataItems.indexOf(e), c = (h, g) => {
1665
+ if (l >= a) {
1666
+ g++, G(this.dataItems, h, g);
1667
+ const u = h.get("children");
1668
+ u && Pt(u, (d) => {
1669
+ c(d, g);
1670
+ });
1671
+ } else {
1672
+ G(this.dataItems, h, g);
1673
+ const u = h.get("children");
1674
+ u && y(u, (d) => {
1675
+ c(d, g);
1676
+ });
1677
+ }
1678
+ };
1679
+ if (this._getItemDepth(e) != n) {
1680
+ const h = this.getSeriesDataItem(e);
1681
+ h && ((t = this.gantt) === null || t === void 0 || t.series.disposeLinks(h));
1682
+ }
1683
+ c(e, a);
1684
+ }
1685
+ this.markDirtyTree();
1686
+ const o = this.get("interpolationEasing"), r = this.get("interpolationDuration", 0);
1687
+ y(this.dataItems, (a, l) => {
1688
+ var c, h;
1689
+ const g = a.get("container");
1690
+ if (g) {
1691
+ let u = this.coordinateToPosition(g.y() + g.height() / 2), m = this.indexToPosition(l) - a.get("deltaPosition", 0) - u;
1692
+ a.set("deltaPosition", -m), a.animate({ key: "deltaPosition", to: 0, duration: r, easing: o }), (c = a.get("tick")) === null || c === void 0 || c.animate({ key: "dy", to: 0, duration: r, easing: o }), (h = a.get("grid")) === null || h === void 0 || h.animate({ key: "dy", to: 0, duration: r, easing: o });
1693
+ }
1694
+ });
1695
+ }
1696
+ _setNewColor(t, i) {
1697
+ var e;
1698
+ i || (i = (e = this.gantt) === null || e === void 0 ? void 0 : e._nextColor()), t.set("color", i);
1699
+ const s = t.get("children");
1700
+ s && s.length > 0 && y(s, (n) => {
1701
+ this._setNewColor(n, i);
1702
+ });
1703
+ }
1704
+ _updateTree() {
1705
+ const t = this.gantt;
1706
+ t && (y(t.series.dataItems, (i) => {
1707
+ i.set("children", []), i.set("parent", void 0);
1708
+ }), y(this.dataItems, (i) => {
1709
+ const e = i.get("parent");
1710
+ if (e) {
1711
+ const s = i.get("id"), n = e.get("id"), o = t.series.getDataItemById(s);
1712
+ i.set("parentId", n);
1713
+ const r = t.series.getDataItemById(n);
1714
+ if (o && r) {
1715
+ o.set("parent", r);
1716
+ let a = r.get("children", []);
1717
+ G(a, o);
1718
+ }
1719
+ }
1720
+ }), y(t.series.dataItems, (i) => {
1721
+ const e = i.get("children"), s = i.get("startGrip"), n = i.get("endGrip");
1722
+ s && n && (!e || e.length === 0 ? (s.set("forceHidden", !1), n.set("forceHidden", !1)) : (s.set("forceHidden", !0), n.set("forceHidden", !0)));
1723
+ }), this.data.values.length = 0, t.series.data.values.length = 0, y(this.dataItems, (i, e) => {
1724
+ i.setRaw("index", e), this.data.values.push(i.dataContext);
1725
+ const s = this.getSeriesDataItem(i);
1726
+ s && (t.series.data.values.push(s?.dataContext), G(t.series.dataItems, s));
1727
+ }), this._updateCellSizes(), y(this.dataItems, (i) => {
1728
+ this._updateBullet(i);
1729
+ }));
1730
+ }
1731
+ _updateCellSizes(t) {
1732
+ y(this.dataItems, (i) => {
1733
+ t === void 0 && (t = this.get("interpolationDuration", 0));
1734
+ const e = this._getItemDepth(i);
1735
+ let s = this.get("childCellSize", 1);
1736
+ const n = i.get("parent");
1737
+ n && n.get("collapsed", !1) && (s = 0), s = Math.pow(s, e), i.get("deleting") && (s = 0), i.get("cellSize", 1) != s && (i.set("finalCellSize", s), i.animate({ key: "cellSize", to: s, duration: t, easing: this.get("interpolationEasing") }));
1738
+ }), this._dataChangeDp && this._dataChangeDp.dispose(), this._dataChangeDp = this.root.events.once("frameended", () => {
1739
+ this.adjustZoom();
1740
+ });
1741
+ }
1742
+ _updateBullet(t) {
1743
+ const i = t.get("taskBullet");
1744
+ if (i) {
1745
+ const e = this._getItemDepth(t), s = t.get("children");
1746
+ i.setAll({
1747
+ marginLeft: this.get("childShift", 20) * e
1748
+ });
1749
+ const n = t.get("collapsed", !1), o = i.get("icon");
1750
+ let r = !1;
1751
+ s && s.length > 0 && (r = !0), o && (r ? (i.set("disabled", !1), this.root.events.once("frameended", () => {
1752
+ i.set("active", !n);
1753
+ })) : i.set("disabled", !0));
1754
+ }
1755
+ }
1756
+ /**
1757
+ * Toggles collapse state of a data item.
1758
+ * @param dataItem
1759
+ * @param collapse
1760
+ * @param duration
1761
+ */
1762
+ toggleCollapse(t, i, e) {
1763
+ if (t && t.get("collapsed", !1) !== i) {
1764
+ const s = t.get("children");
1765
+ t.set("collapsed", i), s && s.length > 0 && y(s, (n) => {
1766
+ const o = n.get("container"), r = n.get("grid"), a = n.get("tick");
1767
+ o && (i ? (o.hide(), r.hide(), a.hide()) : (o.show(), r.show(), a.show()));
1768
+ const l = this.gantt;
1769
+ if (l && l.series) {
1770
+ const h = l.series.dataItems.find((g) => g.get("categoryY") === n.get("category"));
1771
+ h && (i ? h.hide() : h.show());
1772
+ }
1773
+ this.toggleCollapse(n, i, e);
1774
+ }), this._updateBullet(t), this._updDP && this._updDP.dispose(), this._updDP = this.root.events.once("frameended", () => {
1775
+ this._updateCellSizes(e);
1776
+ });
1777
+ }
1778
+ }
1779
+ /**
1780
+ * Expands all categories in the axis.
1781
+ */
1782
+ expandAll() {
1783
+ y(this.dataItems, (t) => {
1784
+ t.get("collapsed", !1) && this.toggleCollapse(t, !1);
1785
+ });
1786
+ }
1787
+ /**
1788
+ * Collapses all categories in the axis.
1789
+ */
1790
+ collapseAll() {
1791
+ y(this.dataItems, (t) => {
1792
+ t.get("collapsed", !1) || this.toggleCollapse(t, !0);
1793
+ });
1794
+ }
1795
+ /**
1796
+ * Deletes all data items from the axis.
1797
+ */
1798
+ deleteAll() {
1799
+ var t;
1800
+ this.data.clear(), (t = this.gantt) === null || t === void 0 || t.series.data.clear(), this.selectDataItem(void 0);
1801
+ }
1802
+ /**
1803
+ * Deletes a data item from the axis.
1804
+ *
1805
+ * @param dataItem Data item to delete
1806
+ */
1807
+ deleteDataItem(t, i) {
1808
+ var e;
1809
+ const s = (e = this.gantt) === null || e === void 0 ? void 0 : e.series, n = t.get("children");
1810
+ if (n && n.length > 0)
1811
+ for (let a = n.length - 1; a >= 0; a--)
1812
+ this.deleteDataItem(n[a], !0);
1813
+ t.set("deleting", !0), i || this._updateCellSizes();
1814
+ const o = t.get("container");
1815
+ o && o.hide().then(() => {
1816
+ s && r && (s.setPrivate("minX", void 0), s.setPrivate("maxX", void 0), s.data.removeValue(r.dataContext)), this.data.removeValue(t.dataContext);
1817
+ });
1818
+ let r;
1819
+ s && (r = this.getSeriesDataItem(t), r && r.hide());
1820
+ }
1821
+ /**
1822
+ * Toggles progress pie for a data item. Toggling means that progress pie
1823
+ * will animate to 1 if it was less than 1, or animate to previous progress
1824
+ * value if it was 1.
1825
+ *
1826
+ * @param dataItem Data item to toggle progress pie for
1827
+ */
1828
+ toggleProgressPie(t, i) {
1829
+ if (t) {
1830
+ const e = t.get("children");
1831
+ if (e && e.length > 0) {
1832
+ const s = t.get("progress", 0);
1833
+ let n;
1834
+ s !== 1 && (n = 1), y(e, (o) => {
1835
+ this.toggleProgressPie(o, n);
1836
+ });
1837
+ } else {
1838
+ const s = this.getSeriesDataItem(t);
1839
+ if (s) {
1840
+ const n = s.get("progress", 0), o = s.get("prevProgress", 0);
1841
+ let r = 1;
1842
+ n == 1 && o != null && (r = o), i !== void 0 && (r = i), s.set("prevProgress", n), s.animate({
1843
+ key: "progress",
1844
+ to: r,
1845
+ duration: this.get("interpolationDuration", 0),
1846
+ easing: this.get("interpolationEasing")
1847
+ });
1848
+ }
1849
+ }
1850
+ }
1851
+ }
1852
+ /**
1853
+ * Sets a custom color for a data item.
1854
+ *
1855
+ * @param dataItem Data item to set color for
1856
+ * @param c Color to set
1857
+ */
1858
+ setDataItemColor(t, i) {
1859
+ var e;
1860
+ if (t) {
1861
+ const s = t.get("color");
1862
+ i && s && i.hex === s.hex && (i = void 0), t.set("customColor", i);
1863
+ const n = t.get("children");
1864
+ n && n.length > 0 && y(n, (o) => {
1865
+ this.setDataItemColor(o, i);
1866
+ }), (e = this.gantt) === null || e === void 0 || e.series.markDirtyValues();
1867
+ }
1868
+ }
1869
+ /**
1870
+ * Hides axis's data item.
1871
+ *
1872
+ * @param dataItem Data item
1873
+ * @param duration Animation duration in milliseconds
1874
+ * @return Promise
1875
+ */
1876
+ hideDataItem(t) {
1877
+ const i = Object.create(null, {
1878
+ hideDataItem: { get: () => super.hideDataItem }
1879
+ });
1880
+ return et(this, void 0, void 0, function* () {
1881
+ const e = i.hideDataItem.call(this, t), s = t.get("container");
1882
+ return s && s.hide(), e;
1883
+ });
1884
+ }
1885
+ /**
1886
+ * Shows axis's data item.
1887
+ *
1888
+ * @param dataItem Data item
1889
+ * @param duration Animation duration in milliseconds
1890
+ * @return Promise
1891
+ */
1892
+ showDataItem(t) {
1893
+ const i = Object.create(null, {
1894
+ showDataItem: { get: () => super.showDataItem }
1895
+ });
1896
+ return et(this, void 0, void 0, function* () {
1897
+ const e = i.showDataItem.call(this, t), s = t.get("container");
1898
+ return s && s.show(), e;
1899
+ });
1900
+ }
1901
+ _toggleFHDataItem(t, i) {
1902
+ const e = "forceHidden", s = t.get("container");
1903
+ s && s.set(e, i);
1904
+ }
1905
+ _toggleDataItem(t, i) {
1906
+ super._toggleDataItem(t, i);
1907
+ const e = t.get("container");
1908
+ e && e.set("visible", i);
1909
+ }
1910
+ /**
1911
+ * Disposes a data item.
1912
+ *
1913
+ * @param dataItem Data item to dispose
1914
+ */
1915
+ disposeDataItem(t) {
1916
+ super.disposeDataItem(t);
1917
+ const i = this.get("renderer"), e = t.get("container");
1918
+ e && (i.containers.removeValue(e), e.dispose());
1919
+ const s = t.get("progressPie");
1920
+ s && (i.progressPies.removeValue(s), s.dispose());
1921
+ const n = t.get("grip");
1922
+ n && (i.grips.removeValue(n), n.dispose());
1923
+ const o = t.get("durationStepper");
1924
+ o && (i.durationSteppers.removeValue(o), o.dispose());
1925
+ const r = t.get("taskBullet");
1926
+ r && (i.taskBullets.removeValue(r), r.dispose());
1927
+ const a = t.get("parent");
1928
+ if (a) {
1929
+ const l = a.get("children");
1930
+ l && tt(l, t), this._updateBullet(a);
1931
+ }
1932
+ this._updateCellSizes();
1933
+ }
1934
+ /**
1935
+ * Selects a data item and shows the delete button. If the data item is
1936
+ * already selected, it will unselect it.
1937
+ *
1938
+ * @param dataItem Data item to select
1939
+ */
1940
+ selectDataItem(t) {
1941
+ var i, e;
1942
+ if (!(!((i = this.gantt) === null || i === void 0) && i.get("editable", !0)))
1943
+ return;
1944
+ if (t === this.get("selectedDataItem")) {
1945
+ this.unselectDataItems();
1946
+ return;
1947
+ }
1948
+ if (this.unselectDataItems(), !t) {
1949
+ this.setRaw("selectedDataItem", void 0);
1950
+ return;
1951
+ }
1952
+ const s = t.get("container");
1953
+ if (s) {
1954
+ const n = s.get("background");
1955
+ n && n.set("active", !0);
1956
+ const o = t.get("progressPie");
1957
+ o?.children.push(this.xButton), this.setRaw("selectedDataItem", t), this._xHideDP && this._xHideDP.dispose(), (e = this.gantt) === null || e === void 0 || e.colorPickerButton.set("color", t.get("customColor", t.get("color"))), this.setTimeout(() => {
1958
+ this._xHideDP = this.events.once("globalpointerup", () => {
1959
+ this.unselectDataItems();
1960
+ });
1961
+ }, 200), this._delDp && this._delDp.dispose(), this._delDp = this.xButton.events.once("click", () => {
1962
+ const r = this.xButton.parent;
1963
+ r && r.children.removeValue(this.xButton), this.deleteDataItem(t), this.unselectDataItems();
1964
+ }), this.xButton.show();
1965
+ } else
1966
+ this.unselectDataItems();
1967
+ }
1968
+ /**
1969
+ * Unselects all data items.
1970
+ */
1971
+ unselectDataItems() {
1972
+ this.setRaw("selectedDataItem", void 0), this.xButton.hide(0), y(this.dataItems, (t) => {
1973
+ const i = t.get("container");
1974
+ if (i) {
1975
+ const e = i.get("background");
1976
+ e && e.set("active", !1);
1977
+ }
1978
+ });
1979
+ }
1980
+ /**
1981
+ * @ignore
1982
+ */
1983
+ _disposeXHideDP() {
1984
+ this._xHideDP && (this._xHideDP.dispose(), this._xHideDP = void 0);
1985
+ }
1986
+ /**
1987
+ * @ignore
1988
+ * @param dataItem
1989
+ * @returns depth of the data item in the hierarchy
1990
+ */
1991
+ _getItemDepth(t) {
1992
+ let i = 0, e = t.get("parent");
1993
+ for (; e; )
1994
+ i++, e = e.get("parent");
1995
+ return i;
1996
+ }
1997
+ /**
1998
+ * @ignore
1999
+ * Overrides original method so that a ghost label is not created.
2000
+ */
2001
+ _createGhostLabel() {
2002
+ }
2003
+ }
2004
+ st.className = "GanttCategoryAxis";
2005
+ st.classNames = kt.classNames.concat([st.className]);
2006
+ class nt extends vt {
2007
+ constructor() {
2008
+ super(...arguments), this.labels = this.addDisposer(new b(T.new({}), () => Mt._new(this._root, {
2009
+ themeTagsSelf: ["categorylabel"]
2010
+ }, [this.labels.template]))), this.containers = this.addDisposer(new b(T.new({}), () => L._new(this._root, {
2011
+ themeTagsSelf: ["axislabelcontainer"]
2012
+ }, [this.containers.template]))), this.controlsContainers = this.addDisposer(new b(T.new({}), () => L._new(this._root, {
2013
+ themeTagsSelf: ["axislabelcontrols"]
2014
+ }, [this.controlsContainers.template]))), this.grips = this.addDisposer(new b(T.new({}), () => I._new(this._root, {
2015
+ themeTags: E(this.grips.template.get("themeTags", ["grip", "axislabel"]), this.get("themeTags", []))
2016
+ }, [this.grips.template]))), this.progressPies = this.addDisposer(new b(T.new({}), () => St._new(this._root, {
2017
+ themeTags: E(this.progressPies.template.get("themeTags", ["progresspie"]), this.get("themeTags", []))
2018
+ }, [this.progressPies.template]))), this.taskBullets = this.addDisposer(new b(T.new({}), () => S._new(this._root, {
2019
+ toggleKey: "active",
2020
+ icon: V.new(this._root, {
2021
+ themeTags: ["icon"]
2022
+ }),
2023
+ themeTags: E(this.taskBullets.template.get("themeTags", ["taskbullet"]), this.get("themeTags", []))
2024
+ }, [this.taskBullets.template]))), this.durationSteppers = this.addDisposer(new b(T.new({}), () => Gt._new(this._root, {
2025
+ themeTags: E(this.durationSteppers.template.get("themeTags", ["durationstepper"]), this.get("themeTags", []))
2026
+ }, [this.durationSteppers.template])));
2027
+ }
2028
+ /**
2029
+ * @ignore
2030
+ */
2031
+ makeLabel(t, i) {
2032
+ const e = this.axis, s = this.containers.make(), n = t.dataContext;
2033
+ s.set("layout", this._root.horizontalLayout), s.set("width", M), s._setDataItem(t), this.containers.push(s), t.setRaw("container", s);
2034
+ const o = s.set("background", I.new(this._root, {
2035
+ themeTags: ["background", "axislabelcontainer"],
2036
+ interactive: !0
2037
+ }));
2038
+ o.events.on("click", (v) => {
2039
+ e.selectDataItem(v.target.dataItem);
2040
+ });
2041
+ const r = this.grips.make();
2042
+ s.children.push(r), this.grips.push(r), t.setRaw("grip", r);
2043
+ const a = this.taskBullets.make();
2044
+ s.children.push(a), this.taskBullets.push(a), t.setRaw("taskBullet", a), a.events.on("click", (v) => {
2045
+ const f = v.target.dataItem;
2046
+ f && e.toggleCollapse(f, !f.get("collapsed", !1));
2047
+ });
2048
+ const l = s.children.push(L.new(this._root, {
2049
+ width: M,
2050
+ centerY: w,
2051
+ y: w
2052
+ })), c = super.makeLabel(t, i);
2053
+ l.children.push(c), c.events.on("pointerover", () => {
2054
+ o.hover();
2055
+ }), c.events.on("pointerout", () => {
2056
+ o.unhover();
2057
+ }), c.events.on("click", () => {
2058
+ c.set("maxWidth", void 0);
2059
+ }), s.events.on("boundschanged", () => {
2060
+ c.set("maxWidth", l.width());
2061
+ });
2062
+ let h;
2063
+ c.on("active", (v) => {
2064
+ v && (h = c.get("text", ""), c.set("text", t.get("name")));
2065
+ }), c.on("text", (v) => {
2066
+ h != null && v != h && (t.set("name", v), n && (n[this.axis.get("nameField", "name")] = v));
2067
+ });
2068
+ const g = this.controlsContainers.make();
2069
+ this.controlsContainers.push(g), t.setRaw("controlsContainer", g), s.children.push(g);
2070
+ const u = this.durationSteppers.make();
2071
+ g.children.push(u), t.setRaw("durationStepper", u), this.durationSteppers.push(u), u.on("value", (v) => {
2072
+ const f = u.dataItem;
2073
+ f && H(v) && f.set("duration", v);
2074
+ });
2075
+ const d = t.get("duration");
2076
+ H(d) && u.set("value", d), t.on("duration", (v) => {
2077
+ u.set("value", v);
2078
+ });
2079
+ const m = this.progressPies.make();
2080
+ return g.children.push(m), t.setRaw("progressPie", m), m.events.on("click", (v) => {
2081
+ this.axis.toggleProgressPie(v.target.dataItem);
2082
+ }), this.progressPies.push(m), this.axis.labelsContainer.children.moveValue(s, 0), e._updateBullet(t), s.appear(), c;
2083
+ }
2084
+ /**
2085
+ * @ignore
2086
+ */
2087
+ updateLabel(t, i, e) {
2088
+ if (t) {
2089
+ const s = t.dataItem;
2090
+ if (s) {
2091
+ const n = s.get("container");
2092
+ n && (H(i) || (i = 0), H(e) && e != i && (i = i + (e - i) * 0), n.set("y", this.positionToCoordinate(i)), this.toggleVisibility(n, i, t.get("minPosition", 0), t.get("maxPosition", 1)));
2093
+ }
2094
+ }
2095
+ }
2096
+ /**
2097
+ * @ignore
2098
+ */
2099
+ updateTick(t, i, e, s) {
2100
+ super.updateTick(t, i, e, s), t && t.set("length", -this.axis.labelsContainer.width());
2101
+ }
2102
+ }
2103
+ nt.className = "GanttCategoryAxisRenderer";
2104
+ nt.classNames = vt.classNames.concat([nt.className]);
2105
+ class K extends xt {
2106
+ }
2107
+ K.className = "GanttDateAxisRenderer";
2108
+ K.classNames = xt.classNames.concat([K.className]);
2109
+ class at extends L {
2110
+ constructor() {
2111
+ super(...arguments), this.scrollbarX = pt.new(this._root, {
2112
+ orientation: "horizontal"
2113
+ }), this.scrollbarY = pt.new(this._root, {
2114
+ orientation: "vertical"
2115
+ }), this.controls = L.new(this._root, {
2116
+ themeTags: ["controls"],
2117
+ layout: this._root.horizontalLayout
2118
+ }), this.zoomControls = L.new(this._root, {
2119
+ themeTagsSelf: ["zoomcontrols"]
2120
+ }), this.addButton = this.controls.children.push(S.new(this._root, {
2121
+ themeTags: ["add", "plus"],
2122
+ tooltip: this.root.systemTooltip,
2123
+ icon: V.new(this._root, { themeTags: ["icon"] })
2124
+ })), this.colorPickerButton = this.controls.children.push(Ht.new(this._root, {
2125
+ disableOpacity: !0,
2126
+ tooltip: this.root.systemTooltip
2127
+ })), this.expandButton = this.controls.children.push(S.new(this._root, {
2128
+ themeTags: ["expand", "secondary", "fixedwidth"],
2129
+ icon: V.new(this._root, { themeTags: ["icon"] }),
2130
+ tooltip: this.root.systemTooltip
2131
+ })), this.collapseButton = this.controls.children.push(S.new(this._root, {
2132
+ themeTags: ["collapse", "secondary", "fixedwidth"],
2133
+ icon: V.new(this._root, { themeTags: ["icon"] }),
2134
+ tooltip: this.root.systemTooltip
2135
+ })), this.linkButton = this.controls.children.push(S.new(this._root, {
2136
+ themeTags: ["link", "secondary", "fixedwidth"],
2137
+ icon: V.new(this._root, { themeTags: ["icon"] }),
2138
+ tooltip: this.root.systemTooltip
2139
+ })), this.fitButton = this.zoomControls.children.push(S.new(this._root, {
2140
+ themeTags: ["fit", "secondary", "zoombutton"],
2141
+ icon: V.new(this._root, { themeTags: ["icon"] }),
2142
+ tooltip: this.root.systemTooltip
2143
+ })), this.zoomOutButton = this.zoomControls.children.push(S.new(this._root, {
2144
+ themeTags: ["zoomout", "secondary", "zoombutton"],
2145
+ icon: V.new(this._root, { themeTags: ["icon"] }),
2146
+ tooltip: this.root.systemTooltip
2147
+ })), this.editButton = this.controls.children.push(S.new(this._root, {
2148
+ themeTags: ["edit", "secondary", "fixedwidth"],
2149
+ icon: V.new(this._root, { themeTags: ["icon"] }),
2150
+ tooltip: this.root.systemTooltip
2151
+ })), this.clearButton = this.controls.children.push(zt.new(this._root, {
2152
+ themeTags: ["clear", "secondary", "confirm"],
2153
+ icon: V.new(this._root, { themeTags: ["icon"] }),
2154
+ tooltip: this.root.systemTooltip,
2155
+ active: !1
2156
+ })), this.colorPicker = this.children.push(It.new(this._root, { visible: !1 }));
2157
+ }
2158
+ _applyThemes(t = !1) {
2159
+ const i = this.get("colors");
2160
+ return i && i.reset(), super._applyThemes(t);
2161
+ }
2162
+ _afterNew() {
2163
+ this.addTag("gantt"), this._defaultThemes.push(Nt.new(this._root)), super._afterNew();
2164
+ const t = this._root;
2165
+ this.colorPickerButton.events.on("click", () => {
2166
+ this.yAxis.xButton.hide(0), this.colorPicker.setAll({
2167
+ colorButton: this.colorPickerButton
2168
+ }), this.children.moveValue(this.colorPicker, this.children.length - 1), this.yAxis._disposeXHideDP();
2169
+ }), this.colorPicker.events.on("colorchanged", () => {
2170
+ this._customColor = this.colorPicker.get("color"), this.yAxis.unselectDataItems();
2171
+ }), this.addButton.events.on("click", () => {
2172
+ this.addNewTask();
2173
+ });
2174
+ const i = this.children.push(Rt.new(t, {}));
2175
+ i.plotContainer.children.push(this.zoomControls), i.zoomOutButton.set("forceHidden", !0), i.children.push(this.controls), i.set("cursor", Xt.new(t, {
2176
+ xAxis: this.xAxis,
2177
+ yAxis: this.yAxis
2178
+ }));
2179
+ const e = nt.new(t, {});
2180
+ e.containers.template.adapters.add("x", () => 0);
2181
+ const s = i.yAxes.push(st.new(t, {
2182
+ categoryField: "id",
2183
+ cellSizeField: "cellSize",
2184
+ collapsedField: "collapsed",
2185
+ parentIdField: "parentId",
2186
+ colorField: "color",
2187
+ idField: "id",
2188
+ nameField: "name",
2189
+ renderer: e
2190
+ }));
2191
+ s.gantt = this, s.events.on("boundschanged", () => {
2192
+ this._updateScrollbar();
2193
+ }), i.plotContainer.events.on("boundschanged", () => {
2194
+ this._updateScrollbar();
2195
+ }), this.on("visible", () => {
2196
+ this.root.events.once("frameended", () => {
2197
+ this._updateScrollbar();
2198
+ });
2199
+ });
2200
+ const n = K.new(t, { themeTags: ["minor"] });
2201
+ n.grid.template.adapters.add("forceHidden", (d, m) => {
2202
+ const v = m.dataItem;
2203
+ return v && v.get("active") ? !0 : d;
2204
+ });
2205
+ const o = i.xAxes.push(Z.new(t, {
2206
+ themeTags: ["minor"],
2207
+ baseInterval: { timeUnit: "day", count: 1 },
2208
+ renderer: n,
2209
+ background: I.new(t, {
2210
+ fill: j(4095),
2211
+ fillOpacity: 0
2212
+ })
2213
+ }));
2214
+ o.gantt = this, o.events.on("pointerout", () => {
2215
+ n.grid.each((d) => {
2216
+ d.unhover();
2217
+ });
2218
+ }), o.events.on("click", () => {
2219
+ if (r) {
2220
+ const d = r.dataItem;
2221
+ if (d) {
2222
+ const m = d.get("endValue");
2223
+ if (m !== void 0) {
2224
+ let v = !1;
2225
+ o.axisRanges.each((f) => {
2226
+ f.get("value") === m && (this.unmarkDate(m), v = !0);
2227
+ }), v || (d.set("active", !0), this.markDate(m));
2228
+ }
2229
+ }
2230
+ }
2231
+ });
2232
+ let r;
2233
+ o.events.on("globalpointermove", (d) => {
2234
+ if (o.isHover()) {
2235
+ const m = o.toLocal({ x: d.point.x, y: d.point.y });
2236
+ let v = 1 / 0;
2237
+ n.grid.each((f) => {
2238
+ if (f.isVisible()) {
2239
+ const _ = f.dataItem;
2240
+ if (_ && !_.get("isRange")) {
2241
+ let C = Math.abs(f.x() - m.x);
2242
+ f.get("active") || f.unhover(), C < v && (v = C, r = f);
2243
+ }
2244
+ }
2245
+ }), r && r.hover();
2246
+ }
2247
+ });
2248
+ const a = K.new(t, {}), l = i.xAxes.push(Z.new(t, {
2249
+ baseInterval: { timeUnit: "day", count: 1 },
2250
+ renderer: a,
2251
+ tooltip: Vt.new(t, {})
2252
+ }));
2253
+ l.gantt = this, l.onPrivate("min", (d) => {
2254
+ o.setPrivate("min", d);
2255
+ }), l.onPrivate("max", (d) => {
2256
+ o.setPrivate("max", d);
2257
+ }), l.on("start", (d) => {
2258
+ o.set("start", d);
2259
+ }), l.on("end", (d) => {
2260
+ o.set("end", d);
2261
+ });
2262
+ const c = l.baseDuration();
2263
+ l.getPrivate("min") === void 0 && l.setPrivate("min", (/* @__PURE__ */ new Date()).getTime()), l.getPrivate("max") === void 0 && l.setPrivate("max", (/* @__PURE__ */ new Date()).getTime() + c * 3), l.onPrivate("gridInterval", (d) => {
2264
+ const m = this.get("gridIntervals");
2265
+ m && m[d.timeUnit] && o.set("gridIntervals", m[d.timeUnit]);
2266
+ });
2267
+ var h = i.series.push(it.new(t, {
2268
+ xAxis: l,
2269
+ yAxis: s,
2270
+ baseAxis: s,
2271
+ openValueXField: "start",
2272
+ valueXField: "end",
2273
+ progressField: "progress",
2274
+ durationField: "duration",
2275
+ linkToField: "linkTo",
2276
+ categoryYField: "id",
2277
+ idField: "id"
2278
+ }));
2279
+ h.gantt = this, this.scrollbarX = i.set("scrollbarX", this.scrollbarX), this.scrollbarY = i.set("scrollbarY", this.scrollbarY), this.scrollbarY.startGrip.set("forceHidden", !0), this.scrollbarY.endGrip.set("forceHidden", !0), this.children.push(this.scrollbarX), this.xyChart = i, this.series = h, this.xAxis = l, this.yAxis = s, this.xAxisMinor = o;
2280
+ const g = "valueschanged";
2281
+ this.series.events.on(g, () => {
2282
+ this.get("editable") && this.events.isEnabled(g) && this.events.dispatch(g, { type: g, target: this });
2283
+ }), this.expandButton.events.on("click", () => {
2284
+ this.yAxis.expandAll();
2285
+ }), this.collapseButton.events.on("click", () => {
2286
+ this.yAxis.collapseAll();
2287
+ }), this.clearButton.events.on("confirmed", () => {
2288
+ this.clearAll();
2289
+ }), this.linkButton.on("active", (d) => {
2290
+ this.set("linkNewTasks", d);
2291
+ }), this.colorPicker.on("color", (d) => {
2292
+ this.yAxis.setDataItemColor(this.yAxis.get("selectedDataItem"), d);
2293
+ }), this.editButton.on("active", (d) => {
2294
+ this.set("editable", d);
2295
+ }), this.fitButton.events.on("click", () => {
2296
+ let d = h.getPrivate("selectionMinX", 0), m = h.getPrivate("selectionMaxX", 0);
2297
+ const v = l.get("extraMin", 0.1), f = l.get("extraMax", 0.1);
2298
+ l.zoomToValues(d - (m - d) * v, m + (m - d) * f);
2299
+ }), this.zoomOutButton.events.on("click", () => {
2300
+ l.zoom(0, 1);
2301
+ });
2302
+ let u = !1;
2303
+ for (let d = 0; d < dt.licenses.length; d++)
2304
+ dt.licenses[d].match(/^AM5G.{5,}/i) && (u = !0);
2305
+ u ? this._root._licenseApplied() : this._root._showBranding();
2306
+ }
2307
+ // end _afterNew()
2308
+ _prepareChildren() {
2309
+ super._prepareChildren(), this.isDirty("editable") && this._toggleEditable(this.get("editable", !0));
2310
+ }
2311
+ clearAll() {
2312
+ var t;
2313
+ this.yAxis.deleteAll(), this._customColor = void 0, (t = this.get("colors")) === null || t === void 0 || t.reset(), this.colorPickerButton.set("color", void 0), this._nextColor();
2314
+ const i = /* @__PURE__ */ new Date();
2315
+ i.setHours(0, 0, 0, 0), this.xAxis.setPrivate("min", i.getTime()), this.xAxis.setPrivate("max", i.getTime() + this.xAxis.baseDuration() * 5);
2316
+ for (let e = this.xAxisMinor.axisRanges.length - 1; e >= 0; e--) {
2317
+ const s = this.xAxisMinor.axisRanges.getIndex(e);
2318
+ s && this.unmarkDate(s.get("value"));
2319
+ }
2320
+ }
2321
+ _updateChildren() {
2322
+ if (super._updateChildren(), this.isDirty("linkNewTasks") && this.linkButton.set("active", this.get("linkNewTasks", !1)), this.isDirty("editable") && this.editButton.set("active", this.get("editable", !0)), this._sizeDirty || this.isDirty("sidebarWidth")) {
2323
+ let t = Lt(this.get("sidebarWidth", O(20)), this.innerWidth());
2324
+ t = Math.max(t, this.yAxis.get("minWidth", 100)), this.yAxis.labelsContainer.set("width", t), this._updateScrollbar();
2325
+ }
2326
+ if (this.isDirty("durationUnit")) {
2327
+ const t = this.get("durationUnit");
2328
+ t && (this.xAxis.set("baseInterval", { timeUnit: t, count: 1 }), this.xAxisMinor.set("baseInterval", { timeUnit: t, count: 1 }));
2329
+ }
2330
+ this.colorPickerButton.getPrivate("color") === void 0 && this._nextColor();
2331
+ }
2332
+ _updateScrollbar() {
2333
+ const t = this.xyChart.plotContainer.toGlobal({ x: 0, y: 0 });
2334
+ this.scrollbarX.setAll({
2335
+ x: t.x,
2336
+ width: this.xyChart.plotContainer.width()
2337
+ });
2338
+ }
2339
+ /**
2340
+ * Adds a new task to the Gantt chart.
2341
+ *
2342
+ * @param category The category name for the task. If not provided, will be auto-generated.
2343
+ * @param start The start time of the task in milliseconds. If not provided, will be determined based on context.
2344
+ * @param duration The duration of the task. If not provided, defaults to 1.
2345
+ * @param parentId The parent category if this is a subtask.
2346
+ * @param progress The initial progress of the task (0-1). Defaults to 0.
2347
+ * @param linkToPrevious Should the task automatically link to the previous one?
2348
+ */
2349
+ addNewTask(t, i, e = 1, s, n = 0, o) {
2350
+ let r = this.series.dataItems.length, a = this.yAxis.dataItems.length;
2351
+ y(this.yAxis.dataItems, (p) => {
2352
+ p.get("id") == "gantt_" + a && a++;
2353
+ });
2354
+ const l = "gantt_" + a;
2355
+ t || (t = "New Task"), o === void 0 && (o = this.get("linkNewTasks", !1));
2356
+ let c;
2357
+ s != null ? c = this.yAxis.getDataItemById(s) : c = this.yAxis.get("selectedDataItem");
2358
+ let h = 0;
2359
+ if (c) {
2360
+ if (s = c.get("id"), s && i === void 0) {
2361
+ const x = this.series.getDataItemById(s);
2362
+ x && (i = x.get("valueX", (/* @__PURE__ */ new Date()).getTime()));
2363
+ }
2364
+ let p = c.get("children");
2365
+ p || (p = c.set("children", [])), h = p.length;
2366
+ }
2367
+ i === void 0 && (i = mt(this.xAxis.getPrivate("min", 0), this.get("durationUnit", "day"), 1, this.root), this.series.dataItems.length > 0 && (i = this.series.dataItems[r - 1].get("valueX", (/* @__PURE__ */ new Date()).getTime())));
2368
+ const g = {
2369
+ name: t,
2370
+ id: l
2371
+ };
2372
+ s && (g.parentId = s);
2373
+ let u = 0, d;
2374
+ if (c) {
2375
+ u = this.yAxis.dataItems.indexOf(c) + 1 + h;
2376
+ const p = c.get("children", []);
2377
+ let x = this.yAxis.dataItems.length;
2378
+ u >= x ? (p.length > 0 && (d = p[p.length - 1]), this.yAxis.data.push(g)) : (p.length > 0 && (d = this.yAxis.dataItems[u - 1]), this.yAxis.data.insertIndex(u, g)), u++;
2379
+ } else {
2380
+ for (let p = this.yAxis.dataItems.length - 1; p >= 0; p--) {
2381
+ const x = this.yAxis.dataItems[p];
2382
+ if (!x.get("parentId")) {
2383
+ d = x;
2384
+ break;
2385
+ }
2386
+ }
2387
+ this.yAxis.data.push(g), u = this.yAxis.dataItems.length;
2388
+ }
2389
+ const m = this.xAxis.baseDuration(), v = {
2390
+ start: i,
2391
+ end: i + 1,
2392
+ duration: e,
2393
+ progress: n,
2394
+ id: l,
2395
+ name: t
2396
+ };
2397
+ if (o && d) {
2398
+ const p = this.series.getDataItemById(d.get("id"));
2399
+ if (p) {
2400
+ const x = p.get("linkTo", []);
2401
+ x.includes(l) || (x.push(l), p.set("linkTo", x));
2402
+ }
2403
+ }
2404
+ this.series.data.moveValue(v, u - 1), this.series.dataItems[u - 1].animate({ key: "valueX", to: i + m * e, duration: this.series.get("interpolationDuration", 0), easing: this.series.get("interpolationEasing") }), this.yAxis._disposeXHideDP(), this.yAxis.xButton.hide(0);
2405
+ const _ = this.yAxis.get("maxZoomCount", 20);
2406
+ let C = Math.max(0, Math.round(u - _ / 2)), k = C + _;
2407
+ r = this.yAxis.dataItems.length, k > r && (k = r, C = Math.max(0, k - _)), this.yAxis.zoomToIndexes(C, k), this.yAxis.adjustZoom();
2408
+ }
2409
+ // Get next color from the color set
2410
+ _nextColor() {
2411
+ var t;
2412
+ if (this._customColor)
2413
+ return this._customColor;
2414
+ const i = (t = this.get("colors")) === null || t === void 0 ? void 0 : t.next();
2415
+ return this.colorPickerButton.setPrivate("color", i), i;
2416
+ }
2417
+ /**
2418
+ * Marks a date on the minor date axis.
2419
+ *
2420
+ * @param date Date to be marked
2421
+ */
2422
+ markDate(t) {
2423
+ const i = this.xAxisMinor, e = i.createAxisRange(i.makeDataItem({
2424
+ value: t
2425
+ })), s = "datemarked";
2426
+ this.events.isEnabled(s) && this.events.dispatch(s, { type: s, target: this, dataItem: e, date: t });
2427
+ }
2428
+ /**
2429
+ * Unmarks a date on the minor date axis.
2430
+ *
2431
+ * @param date Date to be unmarked
2432
+ */
2433
+ unmarkDate(t) {
2434
+ const i = this.xAxisMinor;
2435
+ let e;
2436
+ i.axisRanges.each((n) => {
2437
+ n && n.get("value") === t && (i.axisRanges.removeValue(n), e = n);
2438
+ });
2439
+ const s = "dateunmarked";
2440
+ this.events.isEnabled(s) && this.events.dispatch(s, { type: s, target: this, dataItem: e, date: t });
2441
+ }
2442
+ _toggleEditable(t) {
2443
+ const i = "forceHidden", e = "forceInactive", s = "draggable";
2444
+ this.series.markDirtyValues(), this.addButton.set(i, !t), this.colorPickerButton.set(i, !t), this.clearButton.set(i, !t), this.linkButton.set(i, !t);
2445
+ const n = this.yAxis.get("renderer");
2446
+ n.labels.template.set(e, !t), n.grips.template.set(i, !t), n.containers.template.set(s, t), n.controlsContainers.template.set(e, !t), this.series.columns.template.set(s, t), this.series.startGrips.template.set(i, !t), this.series.endGrips.template.set(i, !t), this.series.progressGrips.template.set(i, !t), this.series.startBullets.template.set(i, !t), this.series.endBullets.template.set(i, !t), this.series.links.template.set(e, !t), this.xAxisMinor.set(e, !t);
2447
+ }
2448
+ }
2449
+ at.className = "Gantt";
2450
+ at.classNames = L.classNames.concat([at.className]);
2451
+ export {
2452
+ Nt as DefaultTheme,
2453
+ at as Gantt,
2454
+ st as GanttCategoryAxis,
2455
+ nt as GanttCategoryAxisRenderer,
2456
+ Z as GanttDateAxis,
2457
+ K as GanttDateAxisRenderer,
2458
+ it as GanttSeries
2459
+ };