@toclocoinc/lattice-grid 1.86.4 → 1.86.5

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 (306) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -1
  3. package/angular/package.json +1 -1
  4. package/docs/API.html +4 -4
  5. package/docs/api/adapters.html +1 -1
  6. package/docs/api/ai.html +1 -1
  7. package/docs/api/alarms.html +1 -1
  8. package/docs/api/calendar.html +1 -1
  9. package/docs/api/charts.html +1 -1
  10. package/docs/api/dashboard.html +1 -1
  11. package/docs/api/data-router.html +1 -1
  12. package/docs/api/deckgl.html +1 -1
  13. package/docs/api/gantt.html +1 -1
  14. package/docs/api/geometry.html +1 -1
  15. package/docs/api/grid.html +2 -2
  16. package/docs/api/index.html +1 -1
  17. package/docs/api/kanban.html +1 -1
  18. package/docs/api/kpi.html +1 -1
  19. package/docs/api/layout.html +1 -1
  20. package/docs/api/leaflet.html +1 -1
  21. package/docs/api/list.html +1 -1
  22. package/docs/api/mapview.html +1 -1
  23. package/docs/api/mock-socket.html +1 -1
  24. package/docs/api/presets.html +1 -1
  25. package/docs/api/tabs.html +1 -1
  26. package/docs/api/types.html +1 -1
  27. package/docs/api-detail.html +4 -4
  28. package/docs/warnings.json +1 -1
  29. package/lattice-grid.d.ts +1 -1
  30. package/lattice-grid.esm.min.js +3 -3
  31. package/lattice-grid.min.cjs +3 -3
  32. package/lattice-grid.min.css +1 -1
  33. package/lattice-grid.min.js +3 -3
  34. package/modules/ai.d.ts +1 -1
  35. package/modules/ai.esm.min.js +2 -2
  36. package/modules/ai.min.cjs +2 -2
  37. package/modules/ai.min.js +2 -2
  38. package/modules/alarms.d.ts +1 -1
  39. package/modules/alarms.esm.min.js +2 -2
  40. package/modules/alarms.min.cjs +2 -2
  41. package/modules/alarms.min.js +2 -2
  42. package/modules/angular.d.ts +1 -1
  43. package/modules/angular.esm.min.js +2 -2
  44. package/modules/angular.min.cjs +2 -2
  45. package/modules/angular.min.js +2 -2
  46. package/modules/calendar.d.ts +1 -1
  47. package/modules/calendar.esm.min.js +2 -2
  48. package/modules/calendar.min.cjs +2 -2
  49. package/modules/calendar.min.js +2 -2
  50. package/modules/chart-alluvial.d.ts +1 -1
  51. package/modules/chart-alluvial.esm.min.js +1 -1
  52. package/modules/chart-alluvial.min.cjs +1 -1
  53. package/modules/chart-alluvial.min.js +1 -1
  54. package/modules/chart-arc.d.ts +1 -1
  55. package/modules/chart-arc.esm.min.js +1 -1
  56. package/modules/chart-arc.min.cjs +1 -1
  57. package/modules/chart-arc.min.js +1 -1
  58. package/modules/chart-barrace.d.ts +1 -1
  59. package/modules/chart-barrace.esm.min.js +1 -1
  60. package/modules/chart-barrace.min.cjs +1 -1
  61. package/modules/chart-barrace.min.js +1 -1
  62. package/modules/chart-bubblemap.d.ts +1 -1
  63. package/modules/chart-bubblemap.esm.min.js +1 -1
  64. package/modules/chart-bubblemap.min.cjs +1 -1
  65. package/modules/chart-bubblemap.min.js +1 -1
  66. package/modules/chart-bump.d.ts +1 -1
  67. package/modules/chart-bump.esm.min.js +1 -1
  68. package/modules/chart-bump.min.cjs +1 -1
  69. package/modules/chart-bump.min.js +1 -1
  70. package/modules/chart-calendar.d.ts +1 -1
  71. package/modules/chart-calendar.esm.min.js +1 -1
  72. package/modules/chart-calendar.min.cjs +1 -1
  73. package/modules/chart-calendar.min.js +1 -1
  74. package/modules/chart-choropleth.d.ts +1 -1
  75. package/modules/chart-choropleth.esm.min.js +1 -1
  76. package/modules/chart-choropleth.min.cjs +1 -1
  77. package/modules/chart-choropleth.min.js +1 -1
  78. package/modules/chart-decomposition.d.ts +1 -1
  79. package/modules/chart-decomposition.esm.min.js +1 -1
  80. package/modules/chart-decomposition.min.cjs +1 -1
  81. package/modules/chart-decomposition.min.js +1 -1
  82. package/modules/chart-diverging.d.ts +1 -1
  83. package/modules/chart-diverging.esm.min.js +1 -1
  84. package/modules/chart-diverging.min.cjs +1 -1
  85. package/modules/chart-diverging.min.js +1 -1
  86. package/modules/chart-dumbbell.d.ts +1 -1
  87. package/modules/chart-dumbbell.esm.min.js +1 -1
  88. package/modules/chart-dumbbell.min.cjs +1 -1
  89. package/modules/chart-dumbbell.min.js +1 -1
  90. package/modules/chart-fan.d.ts +1 -1
  91. package/modules/chart-fan.esm.min.js +1 -1
  92. package/modules/chart-fan.min.cjs +1 -1
  93. package/modules/chart-fan.min.js +1 -1
  94. package/modules/chart-forcetree.d.ts +1 -1
  95. package/modules/chart-forcetree.esm.min.js +2 -2
  96. package/modules/chart-forcetree.esm.min.js.map +2 -2
  97. package/modules/chart-forcetree.min.cjs +2 -2
  98. package/modules/chart-forcetree.min.js +2 -2
  99. package/modules/chart-forcetree.min.js.map +2 -2
  100. package/modules/chart-hexbin.d.ts +1 -1
  101. package/modules/chart-hexbin.esm.min.js +2 -2
  102. package/modules/chart-hexbin.esm.min.js.map +1 -1
  103. package/modules/chart-hexbin.min.cjs +2 -2
  104. package/modules/chart-hexbin.min.js +2 -2
  105. package/modules/chart-hexbin.min.js.map +1 -1
  106. package/modules/chart-hexmap.d.ts +1 -1
  107. package/modules/chart-hexmap.esm.min.js +1 -1
  108. package/modules/chart-hexmap.min.cjs +1 -1
  109. package/modules/chart-hexmap.min.js +1 -1
  110. package/modules/chart-icicle.d.ts +1 -1
  111. package/modules/chart-icicle.esm.min.js +1 -1
  112. package/modules/chart-icicle.min.cjs +1 -1
  113. package/modules/chart-icicle.min.js +1 -1
  114. package/modules/chart-markermap.d.ts +1 -1
  115. package/modules/chart-markermap.esm.min.js +1 -1
  116. package/modules/chart-markermap.min.cjs +1 -1
  117. package/modules/chart-markermap.min.js +1 -1
  118. package/modules/chart-motion.d.ts +1 -1
  119. package/modules/chart-motion.esm.min.js +1 -1
  120. package/modules/chart-motion.min.cjs +1 -1
  121. package/modules/chart-motion.min.js +1 -1
  122. package/modules/chart-pack.d.ts +1 -1
  123. package/modules/chart-pack.esm.min.js +1 -1
  124. package/modules/chart-pack.min.cjs +1 -1
  125. package/modules/chart-pack.min.js +1 -1
  126. package/modules/chart-parallel.d.ts +1 -1
  127. package/modules/chart-parallel.esm.min.js +1 -1
  128. package/modules/chart-parallel.min.cjs +1 -1
  129. package/modules/chart-parallel.min.js +1 -1
  130. package/modules/chart-pictorial.d.ts +1 -1
  131. package/modules/chart-pictorial.esm.min.js +1 -1
  132. package/modules/chart-pictorial.min.cjs +1 -1
  133. package/modules/chart-pictorial.min.js +1 -1
  134. package/modules/chart-polararea.d.ts +1 -1
  135. package/modules/chart-polararea.esm.min.js +1 -1
  136. package/modules/chart-polararea.min.cjs +1 -1
  137. package/modules/chart-polararea.min.js +1 -1
  138. package/modules/chart-polarscatter.d.ts +1 -1
  139. package/modules/chart-polarscatter.esm.min.js +1 -1
  140. package/modules/chart-polarscatter.min.cjs +1 -1
  141. package/modules/chart-polarscatter.min.js +1 -1
  142. package/modules/chart-pyramid.d.ts +1 -1
  143. package/modules/chart-pyramid.esm.min.js +1 -1
  144. package/modules/chart-pyramid.min.cjs +1 -1
  145. package/modules/chart-pyramid.min.js +1 -1
  146. package/modules/chart-radialbar.d.ts +1 -1
  147. package/modules/chart-radialbar.esm.min.js +1 -1
  148. package/modules/chart-radialbar.min.cjs +1 -1
  149. package/modules/chart-radialbar.min.js +1 -1
  150. package/modules/chart-ridgeline.d.ts +1 -1
  151. package/modules/chart-ridgeline.esm.min.js +1 -1
  152. package/modules/chart-ridgeline.min.cjs +1 -1
  153. package/modules/chart-ridgeline.min.js +1 -1
  154. package/modules/chart-roc.d.ts +1 -1
  155. package/modules/chart-roc.esm.min.js +1 -1
  156. package/modules/chart-roc.min.cjs +1 -1
  157. package/modules/chart-roc.min.js +1 -1
  158. package/modules/chart-serpentine.d.ts +1 -1
  159. package/modules/chart-serpentine.esm.min.js +1 -1
  160. package/modules/chart-serpentine.min.cjs +1 -1
  161. package/modules/chart-serpentine.min.js +1 -1
  162. package/modules/chart-slope.d.ts +1 -1
  163. package/modules/chart-slope.esm.min.js +1 -1
  164. package/modules/chart-slope.min.cjs +1 -1
  165. package/modules/chart-slope.min.js +1 -1
  166. package/modules/chart-spiral.d.ts +1 -1
  167. package/modules/chart-spiral.esm.min.js +1 -1
  168. package/modules/chart-spiral.min.cjs +1 -1
  169. package/modules/chart-spiral.min.js +1 -1
  170. package/modules/chart-splom.d.ts +1 -1
  171. package/modules/chart-splom.esm.min.js +1 -1
  172. package/modules/chart-splom.min.cjs +1 -1
  173. package/modules/chart-splom.min.js +1 -1
  174. package/modules/chart-tree.d.ts +1 -1
  175. package/modules/chart-tree.esm.min.js +2 -2
  176. package/modules/chart-tree.esm.min.js.map +2 -2
  177. package/modules/chart-tree.min.cjs +2 -2
  178. package/modules/chart-tree.min.js +2 -2
  179. package/modules/chart-tree.min.js.map +2 -2
  180. package/modules/chart-venn.d.ts +1 -1
  181. package/modules/chart-venn.esm.min.js +1 -1
  182. package/modules/chart-venn.min.cjs +1 -1
  183. package/modules/chart-venn.min.js +1 -1
  184. package/modules/chart-voronoi.d.ts +1 -1
  185. package/modules/chart-voronoi.esm.min.js +1 -1
  186. package/modules/chart-voronoi.min.cjs +1 -1
  187. package/modules/chart-voronoi.min.js +1 -1
  188. package/modules/chart-waffle.d.ts +1 -1
  189. package/modules/chart-waffle.esm.min.js +1 -1
  190. package/modules/chart-waffle.min.cjs +1 -1
  191. package/modules/chart-waffle.min.js +1 -1
  192. package/modules/chart-wordcloud.d.ts +1 -1
  193. package/modules/chart-wordcloud.esm.min.js +1 -1
  194. package/modules/chart-wordcloud.min.cjs +1 -1
  195. package/modules/chart-wordcloud.min.js +1 -1
  196. package/modules/charts.d.ts +1 -1
  197. package/modules/charts.esm.min.js +235 -235
  198. package/modules/charts.esm.min.js.map +2 -2
  199. package/modules/charts.min.cjs +235 -235
  200. package/modules/charts.min.js +235 -235
  201. package/modules/charts.min.js.map +2 -2
  202. package/modules/dashboard.d.ts +1 -1
  203. package/modules/dashboard.esm.min.js +2 -2
  204. package/modules/dashboard.min.cjs +2 -2
  205. package/modules/dashboard.min.js +2 -2
  206. package/modules/data-router.d.ts +1 -1
  207. package/modules/data-router.esm.min.js +2 -2
  208. package/modules/data-router.min.cjs +2 -2
  209. package/modules/data-router.min.js +2 -2
  210. package/modules/deckgl.d.ts +1 -1
  211. package/modules/deckgl.esm.min.js +2 -2
  212. package/modules/deckgl.min.cjs +2 -2
  213. package/modules/deckgl.min.js +2 -2
  214. package/modules/devtools.d.ts +1 -1
  215. package/modules/devtools.esm.min.js +1 -1
  216. package/modules/devtools.min.cjs +1 -1
  217. package/modules/devtools.min.js +1 -1
  218. package/modules/dhtmlx-compat.d.ts +1 -1
  219. package/modules/dhtmlx-compat.esm.min.js +2 -2
  220. package/modules/dhtmlx-compat.min.cjs +2 -2
  221. package/modules/dhtmlx-compat.min.js +2 -2
  222. package/modules/gantt.d.ts +1 -1
  223. package/modules/gantt.esm.min.js +2 -2
  224. package/modules/gantt.min.cjs +2 -2
  225. package/modules/gantt.min.js +2 -2
  226. package/modules/geo-europe-nuts.d.ts +1 -1
  227. package/modules/geo-europe-nuts.esm.min.js +1 -1
  228. package/modules/geo-europe-nuts.min.cjs +1 -1
  229. package/modules/geo-europe-nuts.min.js +1 -1
  230. package/modules/geo-uk.d.ts +1 -1
  231. package/modules/geo-uk.esm.min.js +1 -1
  232. package/modules/geo-uk.min.cjs +1 -1
  233. package/modules/geo-uk.min.js +1 -1
  234. package/modules/geo-us-states.d.ts +1 -1
  235. package/modules/geo-us-states.esm.min.js +1 -1
  236. package/modules/geo-us-states.min.cjs +1 -1
  237. package/modules/geo-us-states.min.js +1 -1
  238. package/modules/geo-world-110m.d.ts +1 -1
  239. package/modules/geo-world-110m.esm.min.js +1 -1
  240. package/modules/geo-world-110m.min.cjs +1 -1
  241. package/modules/geo-world-110m.min.js +1 -1
  242. package/modules/geo-world-50m.d.ts +1 -1
  243. package/modules/geo-world-50m.esm.min.js +1 -1
  244. package/modules/geo-world-50m.min.cjs +1 -1
  245. package/modules/geo-world-50m.min.js +1 -1
  246. package/modules/geometry.d.ts +1 -1
  247. package/modules/geometry.esm.min.js +2 -2
  248. package/modules/geometry.min.cjs +2 -2
  249. package/modules/geometry.min.js +2 -2
  250. package/modules/htmx.d.ts +1 -1
  251. package/modules/htmx.esm.min.js +3 -3
  252. package/modules/htmx.min.cjs +3 -3
  253. package/modules/htmx.min.js +3 -3
  254. package/modules/kanban.d.ts +1 -1
  255. package/modules/kanban.esm.min.js +2 -2
  256. package/modules/kanban.min.cjs +2 -2
  257. package/modules/kanban.min.js +2 -2
  258. package/modules/kpi.d.ts +1 -1
  259. package/modules/kpi.esm.min.js +2 -2
  260. package/modules/kpi.min.cjs +2 -2
  261. package/modules/kpi.min.js +2 -2
  262. package/modules/layout.d.ts +1 -1
  263. package/modules/layout.esm.min.js +2 -2
  264. package/modules/layout.min.cjs +2 -2
  265. package/modules/layout.min.js +2 -2
  266. package/modules/leaflet.d.ts +1 -1
  267. package/modules/leaflet.esm.min.js +2 -2
  268. package/modules/leaflet.min.cjs +2 -2
  269. package/modules/leaflet.min.js +2 -2
  270. package/modules/list.d.ts +1 -1
  271. package/modules/list.esm.min.js +2 -2
  272. package/modules/list.min.cjs +2 -2
  273. package/modules/list.min.js +2 -2
  274. package/modules/mapview.d.ts +1 -1
  275. package/modules/mapview.esm.min.js +2 -2
  276. package/modules/mapview.min.cjs +2 -2
  277. package/modules/mapview.min.js +2 -2
  278. package/modules/mock-socket.d.ts +1 -1
  279. package/modules/mock-socket.esm.min.js +1 -1
  280. package/modules/mock-socket.min.cjs +1 -1
  281. package/modules/mock-socket.min.js +1 -1
  282. package/modules/presets.d.ts +1 -1
  283. package/modules/presets.esm.min.js +2 -2
  284. package/modules/presets.min.cjs +2 -2
  285. package/modules/presets.min.js +2 -2
  286. package/modules/react.d.ts +1 -1
  287. package/modules/react.esm.min.js +2 -2
  288. package/modules/react.min.cjs +2 -2
  289. package/modules/react.min.js +2 -2
  290. package/modules/svelte.d.ts +1 -1
  291. package/modules/svelte.esm.min.js +2 -2
  292. package/modules/svelte.min.cjs +2 -2
  293. package/modules/svelte.min.js +2 -2
  294. package/modules/tabs.d.ts +1 -1
  295. package/modules/tabs.esm.min.js +2 -2
  296. package/modules/tabs.min.cjs +2 -2
  297. package/modules/tabs.min.js +2 -2
  298. package/modules/vue.d.ts +1 -1
  299. package/modules/vue.esm.min.js +2 -2
  300. package/modules/vue.min.cjs +2 -2
  301. package/modules/vue.min.js +2 -2
  302. package/modules/webcomponent.d.ts +1 -1
  303. package/modules/webcomponent.esm.min.js +3 -3
  304. package/modules/webcomponent.min.cjs +3 -3
  305. package/modules/webcomponent.min.js +3 -3
  306. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * Lattice Grid 1.86.4, gantt module
2
+ * Lattice Grid 1.86.5, gantt module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
6
- var qt=Object.create(null),Jt=Object.create(null);function Et(h,pt){qt[h]=pt}function Qt(h){var pt=Jt[h];if(pt)return pt;var xt=Object.create(null);Jt[h]=xt;var dt=qt[h];if(!dt)throw new Error("[lattice] missing module: "+h);return dt(xt,Qt),xt}Et("packages/core/src/internal/util.js",function(h,pt){"use strict";Object.defineProperty(h,"VERSION",{enumerable:!0,get:function(){return at}}),Object.defineProperty(h,"reportedWarnings",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"warnOnce",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(h,"infoOnce",{enumerable:!0,get:function(){return H}}),Object.defineProperty(h,"resetWarnings",{enumerable:!0,get:function(){return A}}),Object.defineProperty(h,"fail",{enumerable:!0,get:function(){return D}}),Object.defineProperty(h,"invariant",{enumerable:!0,get:function(){return B}}),Object.defineProperty(h,"DEV",{enumerable:!0,get:function(){return G}}),Object.defineProperty(h,"isObject",{enumerable:!0,get:function(){return R}}),Object.defineProperty(h,"isFunction",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"isNil",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(h,"isBlank",{enumerable:!0,get:function(){return V}}),Object.defineProperty(h,"isCtor",{enumerable:!0,get:function(){return it}}),Object.defineProperty(h,"pathGetter",{enumerable:!0,get:function(){return f}}),Object.defineProperty(h,"pathSetter",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(h,"getPath",{enumerable:!0,get:function(){return L}}),Object.defineProperty(h,"setPath",{enumerable:!0,get:function(){return st}}),Object.defineProperty(h,"humanise",{enumerable:!0,get:function(){return j}}),Object.defineProperty(h,"escapeHtml",{enumerable:!0,get:function(){return u}}),Object.defineProperty(h,"titleCase",{enumerable:!0,get:function(){return F}}),Object.defineProperty(h,"expand",{enumerable:!0,get:function(){return y}}),Object.defineProperty(h,"toArray",{enumerable:!0,get:function(){return z}}),Object.defineProperty(h,"merge",{enumerable:!0,get:function(){return U}}),Object.defineProperty(h,"mergeRow",{enumerable:!0,get:function(){return W}}),Object.defineProperty(h,"Lru",{enumerable:!0,get:function(){return X}}),Object.defineProperty(h,"collator",{enumerable:!0,get:function(){return S}}),Object.defineProperty(h,"defaultCompare",{enumerable:!0,get:function(){return p}}),Object.defineProperty(h,"now",{enumerable:!0,get:function(){return M}}),Object.defineProperty(h,"nextFrame",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(h,"cancelFrame",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(h,"frameBatched",{enumerable:!0,get:function(){return r}}),Object.defineProperty(h,"settleDebounce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(h,"whenIdle",{enumerable:!0,get:function(){return m}}),Object.defineProperty(h,"uid",{enumerable:!0,get:function(){return I}});const xt="1.86.4";async function dt(){return xt}const at="1.86.4",q=new Set,et=2e3;function x(s){if(q.add(s),q.size>et){const e=q.values().next().value;e!==void 0&&q.delete(e)}}const Q=[],l=500;function _(s,e,t){Q.push({key:s,level:e,message:t.map(n=>typeof n=="string"?n:g(n)).join(" "),at:Date.now()}),Q.length>l&&Q.shift()}function g(s){if(s instanceof Error)return s.message;try{return JSON.stringify(s)}catch{return String(s)}}function v(){return Q.map(s=>({...s}))}function J(s){if(s.length===0||typeof s[0]!="string")return s;const e=s[0].replace(/^\[lattice\]\s*/,"");return e===s[0]?s:[e,...s.slice(1)]}function nt(s,...e){if(q.has(s))return;x(s);const t=J(e);_(s,"warn",t),console.warn("[lattice]",...t)}function H(s,...e){if(q.has(s))return;x(s);const t=J(e);_(s,"info",t),console.info("[lattice]",...t)}function A(){q.clear(),Q.length=0}function D(s,e){const t=new Error(`[lattice] ${s}`);throw e!==void 0&&(t.cause=e),t}function B(s,e){s||D(e)}const G=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function R(s){return s!==null&&typeof s=="object"&&!Array.isArray(s)}function P(s){return typeof s=="function"}function tt(s){return s==null}function V(s){return s==null||s===""}function it(s){return typeof s!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(s))?!0:!!(s.prototype&&Object.getOwnPropertyNames(s.prototype).length>1)}const k=new Map;function f(s){let e=k.get(s);if(e)return e;if(!s.includes("."))e=t=>t?.[s];else{const t=s.split("."),n=t.length;e=i=>{let a=i;for(let b=0;b<n;b++){if(a==null)return;a=a[t[b]]}return a}}return k.set(s,e),e}const N=new Map;function Z(s){let e=N.get(s);if(e)return e;if(!s.includes("."))e=(t,n)=>{t!=null&&(t[s]=n)};else{const t=s.split("."),n=t.length-1;e=(i,a)=>{let b=i;for(let d=0;d<n;d++){if(b==null)return;const E=t[d];b[E]==null&&(b[E]={}),b=b[E]}b!=null&&(b[t[n]]=a)}}return N.set(s,e),e}function L(s,e){return f(e)(s)}function st(s,e,t){Z(e)(s,t)}function j(s){return s?(s.includes(".")?s.slice(s.lastIndexOf(".")+1):s).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,t=>t.toUpperCase()):""}const K={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function u(s){const e=s==null?"":String(s);return/[&<>"']/.test(e)?e.replace(/[&<>"']/g,t=>K[t]):e}function F(s){return String(s).replace(/\w\S*/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function y(s,e,t){if(s!==void 0)return s===!0?{enabled:!0,...t}:s===!1?{enabled:!1}:R(s)?s:{[e]:s,enabled:!0}}function z(s){return s==null?[]:Array.isArray(s)?s:[s]}const o=Object.freeze(new Set(["__proto__","constructor","prototype"]));function U(s,e){if(!R(s))return R(e)?{...e}:e;if(!R(e))return e===void 0?s:e;const t={...s};for(const n of Object.keys(e)){if(o.has(n))continue;const i=e[n];i!==void 0&&(t[n]=R(i)&&R(t[n])?U(t[n],i):i)}return t}function W(s,e){if(!R(s)||!R(e)||s===e)return e;const t=Object.create(Object.getPrototypeOf(s));return Object.assign(t,s,e),t}class X{#n;#r=new Map;#t;constructor(e=256,t=null){this.#n=e,this.#t=t}get size(){return this.#r.size}get max(){return this.#n}set max(e){this.#n=e,this.#e()}has(e){return this.#r.has(e)}get(e){const t=this.#r;if(!t.has(e))return;const n=t.get(e);return t.delete(e),t.set(e,n),n}peek(e){return this.#r.get(e)}set(e,t){const n=this.#r;return n.has(e)&&n.delete(e),n.set(e,t),this.#e(),t}delete(e){const t=this.#r.get(e);return this.#r.delete(e)&&this.#t&&this.#t(t,e),t}clear(){if(this.#t)for(const[e,t]of this.#r)this.#t(t,e);this.#r.clear()}keys(){return this.#r.keys()}values(){return this.#r.values()}#e(){const e=this.#r;for(;e.size>this.#n;){const t=e.keys().next().value,n=e.get(t);e.delete(t),this.#t&&this.#t(n,t)}}}const T=new Map;function S(s,e){const t=`${s||""}|${e?JSON.stringify(e):""}`;let n=T.get(t);return n||(n=new Intl.Collator(s||void 0,{numeric:!0,sensitivity:"variant",...e}),T.set(t,n)),n}function p(s,e){if(s===e)return 0;if(s==null)return 1;if(e==null)return-1;if(typeof s=="number"&&typeof e=="number")return Number.isNaN(s)?Number.isNaN(e)?0:1:Number.isNaN(e)||s<e?-1:s>e?1:0;const t=String(s),n=String(e);return t<n?-1:t>n?1:0}function M(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const lt=typeof requestAnimationFrame=="function";function wt(s){return lt?requestAnimationFrame(s):setTimeout(()=>s(M()),16)}function ot(s){s!=null&&(lt?cancelAnimationFrame(s):clearTimeout(s))}function r(s){let e=null,t=null;const n=()=>{e=null;const a=t;t=null,s(...a||[])},i=(...a)=>{t=a,e===null&&(e=wt(n))};return i.cancel=()=>{ot(e),e=null,t=null},i.flush=()=>{e!==null&&(ot(e),n())},i}function c(s,e){let t=null,n=null;const i=()=>{if(t=null,n===null)return;const d=n;n=null,s(...d),a()},a=()=>{t=setTimeout(i,e),typeof t?.unref=="function"&&t.unref()},b=(...d)=>{t===null?(s(...d),a()):(n=d,clearTimeout(t),a())};return b.flush=()=>{if(t!==null&&clearTimeout(t),t=null,n===null)return;const d=n;n=null,s(...d)},b.cancel=()=>{t!==null&&clearTimeout(t),t=null,n=null},b.pending=()=>t!==null||n!==null,b}function m(s,e=50){return typeof requestIdleCallback=="function"?requestIdleCallback(s,{timeout:e}):setTimeout(()=>s({timeRemaining:()=>0,didTimeout:!0}),1)}let w=0;function I(s="l"){return`${s}${(++w).toString(36)}`}}),Et("packages/modules/shared/emitter.js",function(h,pt){"use strict";Object.defineProperty(h,"WILDCARD",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"Emitter",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(h,"gate",{enumerable:!0,get:function(){return l}});const xt=pt("packages/core/src/internal/util.js"),dt=xt.isFunction,at=xt.warnOnce,q="*",et=new Set(["api","user","init","ai"]);function x(_,g){return _&&_.name?_.name:`#${g}`}class Q{#n=new Map;#r;constructor(g="module"){this.#r=String(g)}on(g,v){if(!dt(v))return()=>{};let J=this.#n.get(g);return J||(J=new Set,this.#n.set(g,J)),J.add(v),()=>this.off(g,v)}off(g,v){const J=this.#n.get(g);J&&J.delete(v)}count(g){const v=this.#n.get(g);return v?v.size:0}emit(g,v){const J=this.#n.get(g),nt=this.#n.get(q);if((!J||J.size===0)&&(!nt||nt.size===0))return;const H={...v||null,type:g};J&&J.size&&this.#t([...J],H,g),nt&&nt.size&&this.#t([...nt],H,q)}#t(g,v,J){for(let nt=0;nt<g.length;nt++)try{g[nt](v)}catch(H){at(`${this.#r}.emit.throw:${J}:${x(g[nt],nt)}`,`${this.#r}: a '${J}' handler threw; other handlers were unaffected.`,H)}}emitBefore(g,v,J){const nt=J??(v&&v.origin),H=et.has(nt)?nt:"user";let A=!1,D=null;const B=it=>{A=!0,it!=null&&D===null&&(D=String(it))},G={...v||null,type:g,origin:H,get defaultPrevented(){return A},get reason(){return D},preventDefault(it){B(it)}},R=this.#n.get(g);if(!R||R.size===0)return!0;const P=[...R],tt=()=>(A&&D===null&&(D="prevented"),A&&v&&typeof v=="object"&&(v.reason=D),!A),V=[];for(let it=0;it<P.length;it++){const k=P[it];try{const f=k(G);f&&dt(f.then)?V.push(f):f===!1&&B("prevented")}catch(f){B("error"),at(`${this.#r}.beforeThrow:${g}:${x(k,it)}`,`${this.#r}: a '${g}' before-handler threw; the action was cancelled.`,f)}}return V.length===0?tt():Promise.allSettled(V).then(it=>{for(const k of it)k.status==="rejected"?(B("error"),at(`${this.#r}.beforeReject:${g}`,`${this.#r}: a '${g}' before-handler rejected; the action was cancelled.`,k.reason)):k.value===!1&&B("prevented");return tt()})}clear(){this.#n.clear()}}function l(_,g,v,J,nt){const H=_.emitBefore(g,J,J.origin),A=()=>(_.emit(v,{...J,reason:J.reason||"prevented"}),!1);return H===!1?A():H&&dt(H.then)?H.then(D=>D?nt():A()):nt()}}),Et("packages/modules/gantt/time.js",function(h,pt){"use strict";Object.defineProperty(h,"toDayNumber",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"fromDayNumber",{enumerable:!0,get:function(){return et}}),Object.defineProperty(h,"toISODate",{enumerable:!0,get:function(){return x}}),Object.defineProperty(h,"resolveProjectEpoch",{enumerable:!0,get:function(){return Q}});const dt=pt("packages/core/src/internal/util.js").warnOnce,at=864e5;function q(l){if(l==null||l==="")return null;if(typeof l=="number")return Number.isFinite(l)?l:null;if(l instanceof Date)return Number.isFinite(l.getTime())?Math.floor(Date.UTC(l.getFullYear(),l.getMonth(),l.getDate())/at):null;const _=Date.parse(l);return Number.isFinite(_)?Math.floor(_/at):null}function et(l){return Number.isFinite(l)?new Date(Math.round(l)*at):null}function x(l){const _=et(l);return _?_.toISOString().slice(0,10):null}function Q(l){if(l==null||l==="")return 0;const _=q(l);return Number.isFinite(_)?_:(dt(`gantt.projectEpoch:${String(l)}`,`[lattice] gantt: projectEpoch ${JSON.stringify(l)} is not a date or a day number; the plan is rendered against the Unix epoch (day 0 = 1970-01-01).`),0)}}),Et("packages/modules/gantt/calendar.js",function(h,pt){"use strict";Object.defineProperty(h,"createCalendar",{enumerable:!0,get:function(){return et}});const xt=pt("packages/modules/gantt/time.js"),dt=xt.fromDayNumber,at=xt.toDayNumber,q=Object.freeze([1,2,3,4,5]);function et(x,Q=0){if(x==null)return null;let l,_;x==="weekends"?(l=q,_=new Set):(l=Array.isArray(x.workdays)&&x.workdays.length?x.workdays.map(Number).filter(R=>R>=0&&R<=6):q,_=new Set((Array.isArray(x.holidays)?x.holidays:[]).map(R=>at(R)).filter(R=>R!=null)));const g=new Set(l);if(g.size===7&&_.size===0||g.size===0)return null;const v=R=>{const P=dt(R);return P?g.has(P.getUTCDay())&&!_.has(R):!1},J=R=>{let P=R;for(;!v(P);)P+=1;return P},nt=R=>{let P=R;for(;!v(P);)P-=1;return P},H=J(Math.round(Number.isFinite(Q)?Q:0)),A=new Map([[0,H]]),D=new Map([[H,0]]);return{isWorking:v,nextWorking:J,dayOf:R=>{const P=Math.round(R);if(A.has(P))return A.get(P);if(P>0){let it=P-1;for(;!A.has(it);)it-=1;let k=A.get(it);for(let f=it+1;f<=P;f+=1)k=J(k+1),A.set(f,k),D.set(k,f);return A.get(P)}let tt=P+1;for(;!A.has(tt);)tt+=1;let V=A.get(tt);for(let it=tt-1;it>=P;it-=1)V=nt(V-1),A.set(it,V),D.set(V,it);return A.get(P)},indexOf:R=>{const P=J(Math.round(R));if(D.has(P))return D.get(P);if(P>H){let it=0,k=H;for(;D.has(J(k+1))&&k<P;)k=J(k+1),it=D.get(k);for(;k<P;)k=J(k+1),it+=1,A.set(it,k),D.set(k,it);return it}let tt=0,V=H;for(;V>P;)V=nt(V-1),tt-=1,A.set(tt,V),D.set(V,tt);return tt},anchor:H}}}),Et("packages/modules/gantt/schedule.js",function(h,pt){"use strict";Object.defineProperty(h,"LINK_TYPES",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(h,"CONSTRAINT_TYPES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(h,"EPS",{enumerable:!0,get:function(){return g}}),Object.defineProperty(h,"SCHEDULE_ERROR",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"TASK_FIELDS",{enumerable:!0,get:function(){return H}}),Object.defineProperty(h,"taskIdReader",{enumerable:!0,get:function(){return D}}),Object.defineProperty(h,"taskFieldWriters",{enumerable:!0,get:function(){return B}}),Object.defineProperty(h,"normalizeTasks",{enumerable:!0,get:function(){return R}}),Object.defineProperty(h,"buildTree",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"normalizeLinkSpec",{enumerable:!0,get:function(){return V}}),Object.defineProperty(h,"normalizeDependencies",{enumerable:!0,get:function(){return it}}),Object.defineProperty(h,"expandDependencies",{enumerable:!0,get:function(){return k}}),Object.defineProperty(h,"topoOrder",{enumerable:!0,get:function(){return f}}),Object.defineProperty(h,"computeSchedule",{enumerable:!0,get:function(){return st}}),Object.defineProperty(h,"findViolations",{enumerable:!0,get:function(){return F}});const dt=pt("packages/core/src/internal/util.js").warnOnce,q=pt("packages/modules/gantt/calendar.js").createCalendar,x=pt("packages/modules/gantt/time.js").toDayNumber,Q=["FS","SS","FF","SF"],l=["MSO","MFO","ALAP"],_=Object.freeze({mso:"MSO","must-start-on":"MSO",muststarton:"MSO","start-on":"MSO",mfo:"MFO","must-finish-on":"MFO",mustfinishon:"MFO","finish-on":"MFO",alap:"ALAP","as-late-as-possible":"ALAP",aslateaspossible:"ALAP",late:"ALAP"}),g=1e-9,v={CYCLE:"cycle",DUPLICATE_ID:"duplicate-id",UNKNOWN_TASK:"unknown-task",BAD_DURATION:"bad-duration",BAD_LINK_TYPE:"bad-link-type",SELF_DEPENDENCY:"self-dependency",UNKNOWN_PARENT:"unknown-parent",PARENT_CYCLE:"parent-cycle",DEP_ACROSS_HIERARCHY:"dep-across-hierarchy"};function J(y){if(y==null||y==="")return null;const z=typeof y=="number"?y:Number(y);return Number.isFinite(z)?z:null}function nt(y){return y==null||y===""?null:x(y)}const H=Object.freeze(["id","name","start","end","duration","milestone","percentComplete","parent","baselineStart","baselineEnd","constraint","constraintDate"]);function A(y){const z=y&&typeof y=="object"?y:{},o={};for(const U of H){const W=z[U];if(typeof W=="function")o[U]=W;else if(typeof W=="string"&&W!==""){const X=W;o[U]=T=>T[X]}else o[U]=X=>X[U]}return o}function D(y){return A(y).id}function B(y){const z=y&&typeof y=="object"?y:{},o={};for(const U of H){const W=z[U];typeof W=="string"&&W!==""?o[U]=W:typeof W=="function"?o[U]=null:o[U]=U}return o}function G(y,z){const o=z.constraint(y),U=o??(y&&y.constraintType);if(U==null||U==="")return null;const W=_[String(U).toLowerCase().replace(/\s+/g,"-")]??(l.includes(String(U).toUpperCase())?String(U).toUpperCase():null);if(!W)return null;const X=nt(z.constraintDate(y)??y.constraintAt??y.at);return{type:W,at:X}}function R(y,z){const o=new Map,U=[],W=A(z);if(!Array.isArray(y))return{ok:!1,error:{code:v.BAD_DURATION,message:"tasks must be an array"},order:U,byId:o};for(const X of y){const T=X?W.id(X):null,S=T!=null?String(T):null;if(S==null)return{ok:!1,error:{code:v.UNKNOWN_TASK,message:"every task needs an id"},order:U,byId:o};if(o.has(S))return{ok:!1,error:{code:v.DUPLICATE_ID,message:`duplicate task id "${S}"`,id:S},order:U,byId:o};const p=nt(W.start(X)),M=nt(W.end(X)),lt=W.milestone(X)===!0;let wt=lt?0:J(W.duration(X));if(wt==null&&p!=null&&M!=null&&(wt=M-p),wt!=null&&wt<0)return{ok:!1,error:{code:v.BAD_DURATION,message:`task "${S}" has negative duration ${wt}`,id:S},order:U,byId:o};const ot=W.name(X),r=W.parent(X);o.set(S,{id:S,name:ot!=null?String(ot):S,duration:wt,milestoneFlag:lt,earliestStart:p,placedStart:p,placedEnd:M,percentComplete:J(W.percentComplete(X)),parent:r!=null?String(r):null,constraint:G(X,W),baselineStart:nt(W.baselineStart(X)??(X.baseline&&X.baseline.start)),baselineEnd:nt(W.baselineEnd(X)??(X.baseline&&X.baseline.end))}),U.push(S)}return{ok:!0,order:U,byId:o}}function P(y,z){const o=new Map(y.map(S=>[S,[]]));for(const S of y){const p=z.get(S).parent;if(p!=null){if(!z.has(p))return{ok:!1,error:{code:v.UNKNOWN_PARENT,message:`task "${S}" names unknown parent "${p}"`,id:S}};o.get(p).push(S)}}for(const S of y){const p=new Set;let M=z.get(S).parent;for(;M!=null;){if(M===S||p.has(M))return{ok:!1,error:{code:v.PARENT_CYCLE,message:`parent cycle at "${S}"`,id:S}};p.add(M),M=z.get(M)?.parent??null}}const U=S=>o.get(S).length>0,W=new Map,X=S=>{if(W.has(S))return W.get(S);const p=o.get(S),M=p.length===0?[S]:p.flatMap(lt=>X(lt));return W.set(S,M),M};return{ok:!0,children:o,isSummary:U,descendantLeaves:X,ancestors:S=>{const p=new Set;let M=z.get(S).parent;for(;M!=null;)p.add(M),M=z.get(M).parent;return p}}}const tt=/^\s*(FS|SS|FF|SF)\s*(?:([+-])\s*(\d+(?:\.\d+)?))?\s*$/i;function V(y){const z={...y||null};if(typeof z.type!="string")return z;const o=tt.exec(z.type);if(!o||!o[2])return z;const U=(o[2]==="-"?-1:1)*Number(o[3]);z.type=o[1].toUpperCase();const W=J(y.lag);return W!=null&&W!==U?(dt(`gantt-link-shorthand-${String(y.type)}-${W}`,`[lattice] gantt: dependency type ${JSON.stringify(y.type)} carries a lag of ${U} but lag: ${W} was also given; the explicit lag wins. Give one or the other.`),z):(z.lag=U,z)}function it(y,z,o={}){const U=[];if(y==null)return{ok:!0,edges:U};if(!Array.isArray(y))return{ok:!1,error:{code:v.UNKNOWN_TASK,message:"dependencies must be an array"},edges:U};const W=typeof o.ancestors=="function"?o.ancestors:null;for(const X of y){const T=V(X),S=T&&T.from!=null?String(T.from):null,p=T&&T.to!=null?String(T.to):null,M=T&&T.type!=null?String(T.type).toUpperCase():"FS",lt=J(T.lag)??0;if(S==null||p==null)return{ok:!1,error:{code:v.UNKNOWN_TASK,message:"a dependency needs both `from` and `to`"},edges:U};if(!z.has(S))return{ok:!1,error:{code:v.UNKNOWN_TASK,message:`dependency references unknown task "${S}"`,id:S},edges:U};if(!z.has(p))return{ok:!1,error:{code:v.UNKNOWN_TASK,message:`dependency references unknown task "${p}"`,id:p},edges:U};if(S===p)return{ok:!1,error:{code:v.SELF_DEPENDENCY,message:`task "${S}" depends on itself`,id:S},edges:U};if(!Q.includes(M))return{ok:!1,error:{code:v.BAD_LINK_TYPE,message:`unknown link type "${M}" (expected one of ${Q.join("/")})`},edges:U};if(W&&(W(S).has(p)||W(p).has(S)))return{ok:!1,error:{code:v.DEP_ACROSS_HIERARCHY,message:`dependency between "${S}" and "${p}" crosses their own parent/child hierarchy`,from:S,to:p},edges:U};U.push({from:S,to:p,type:M,lag:lt})}return{ok:!0,edges:U}}function k(y,z){const o=new Set,U=[];for(const W of y){(z.isSummary(W.from)||z.isSummary(W.to))&&W.type!=="FS"&&dt(`gantt-summary-link-${W.type}-${W.from}-${W.to}`,`[lattice] gantt: ${W.type} link with a summary endpoint (${W.from} -> ${W.to}) is expanded to descendant leaves — a conservative v1 reading; only FS is exact for summary endpoints.`);for(const T of z.descendantLeaves(W.from))for(const S of z.descendantLeaves(W.to)){if(T===S)continue;const p=[T,S,W.type,W.lag].join("");o.has(p)||(o.add(p),U.push({from:T,to:S,type:W.type,lag:W.lag}))}}return U}function f(y,z){const o=new Map(y.map(T=>[T,0])),U=new Map(y.map(T=>[T,[]]));for(const T of z)N(o,T.to),U.get(T.from).push(T.to);const W=y.filter(T=>o.get(T)===0),X=[];for(;W.length;){const T=W.shift();X.push(T);for(const S of U.get(T)){const p=o.get(S)-1;o.set(S,p),p===0&&W.push(S)}}return X.length===y.length?{ok:!0,sorted:X}:{ok:!1,cycle:Z(y,U,new Set(X))}}function N(y,z){y.set(z,y.get(z)+1)}function Z(y,z,o){const U=y.find(S=>!o.has(S)),W=[],X=new Map;let T=U;for(;T!=null&&!X.has(T);)X.set(T,W.length),W.push(T),T=z.get(T).find(S=>!o.has(S));return T==null?W:W.slice(X.get(T)).concat(T)}function L(y,z,o,U,W,X=new Map){const T=f(y,o);if(!T.ok)return dt(`gantt-cycle-${T.cycle.join(">")}`,`[lattice] gantt: dependency cycle detected (${T.cycle.join(" -> ")}); schedule refused.`),{ok:!1,error:{code:v.CYCLE,message:`dependency cycle: ${T.cycle.join(" -> ")}`,cycle:T.cycle}};const S=T.sorted,p=new Map(y.map(w=>[w,[]])),M=new Map(y.map(w=>[w,[]]));for(const w of o)p.get(w.to).push(w),M.get(w.from).push(w);const lt=new Map;for(const w of y){const I=z.get(w);lt.set(w,{id:w,name:I.name,duration:I.duration,es:0,ef:0,ls:0,lf:0,totalFloat:0,critical:!1,percentComplete:I.percentComplete,parent:I.parent,isSummary:!1,isMilestone:I.duration===0,children:[]})}const wt=[];for(const w of S){const I=z.get(w),s=lt.get(w);let e=Math.max(U,I.earliestStart??U);for(const n of p.get(w)){const i=lt.get(n.from);let a;switch(n.type){case"FS":a=i.ef+n.lag;break;case"SS":a=i.es+n.lag;break;case"FF":a=i.ef+n.lag-s.duration;break;case"SF":a=i.es+n.lag-s.duration;break;default:a=-1/0}a>e&&(e=a)}const t=X.get(w);if(t&&t.type!=="ALAP"&&t.at!=null){const n=t.type==="MFO"?t.at-s.duration:t.at;n<e-g?wt.push({id:w,type:t.type,at:t.at,earliestFeasible:e}):e=n,s.pinned=!0}s.es=e,s.ef=e+s.duration}const ot=y.length?Math.max(...y.map(w=>lt.get(w).ef)):U,r=Number.isFinite(W)?W:ot;for(let w=S.length-1;w>=0;w-=1){const I=S[w],s=lt.get(I);let e=r;for(const t of M.get(I)){const n=lt.get(t.to);let i;switch(t.type){case"FS":i=n.ls-t.lag;break;case"SS":i=n.ls-t.lag+s.duration;break;case"FF":i=n.lf-t.lag;break;case"SF":i=n.lf-t.lag+s.duration;break;default:i=1/0}i<e&&(e=i)}s.pinned&&(e=s.ef),s.lf=e,s.ls=e-s.duration,s.totalFloat=s.ls-s.es,s.critical=s.totalFloat<=g}for(const w of y){const I=X.get(w);if(!I||I.type!=="ALAP")continue;const s=lt.get(w);s.es=s.ls,s.ef=s.lf,s.totalFloat=0,s.critical=!0}const c=y.filter(w=>lt.get(w).critical),m=u(y,o,lt);return{ok:!0,tasks:lt,critical:c,criticalPaths:m,projectFinish:ot,conflicts:wt}}function st(y,z=[],o={}){const U=nt(o.projectStart)??0,W=nt(o.deadline),X=q(o.calendar,U),T=a=>a==null?null:X?X.indexOf(a):a,S=a=>X?X.dayOf(a):a,p=R(y,o.fields);if(!p.ok)return{ok:!1,error:p.error};const{order:M,byId:lt}=p,wt=P(M,lt);if(!wt.ok)return{ok:!1,error:wt.error};const ot=it(z,lt,wt);if(!ot.ok)return{ok:!1,error:ot.error};for(const a of M)if(!wt.isSummary(a)&&lt.get(a).duration==null)return{ok:!1,error:{code:v.BAD_DURATION,message:`task "${a}" has no duration and no start+end to derive one`,id:a}};const r=M.filter(a=>!wt.isSummary(a)),c=new Map(r.map(a=>{const b=lt.get(a);return[a,{...b,earliestStart:T(b.earliestStart)}]})),m=new Map;for(const a of r){const b=lt.get(a).constraint;b&&m.set(a,{type:b.type,at:T(b.at)})}const w=X?X.indexOf(U):U,I=W==null?void 0:T(W),s=k(ot.edges,wt),e=L(r,c,s,w,I,m);if(!e.ok)return{ok:!1,error:e.error};const t=e.tasks;for(const a of r){const b=t.get(a);b.es=S(b.es),b.ef=S(b.ef),b.ls=S(b.ls),b.lf=S(b.lf),j(b,lt.get(a).baselineStart,lt.get(a).baselineEnd)}for(let a=M.length-1;a>=0;a-=1){const b=M[a];wt.isSummary(b)&&t.set(b,K(b,lt.get(b),wt,t))}for(const a of M)wt.isSummary(a)&&(t.get(a).children=wt.children.get(a).slice());const n=X?X.anchor:U,i=S(e.projectFinish);return{ok:!0,tasks:t,order:M,critical:e.critical,criticalPaths:e.criticalPaths,projectStart:n,projectFinish:i,projectDuration:i-n,conflicts:e.conflicts||[],calendar:!!X}}function j(y,z,o){z==null&&o==null||(y.baselineStart=z??null,y.baselineEnd=o??null,y.startVariance=z==null?null:y.es-z,y.finishVariance=o==null?null:y.ef-o,y.durationVariance=z==null||o==null?null:y.ef-y.es-(o-z))}function K(y,z,o,U){const W=o.children.get(y).map(m=>U.get(m)),X=Math.min(...W.map(m=>m.es)),T=Math.max(...W.map(m=>m.ef)),S=Math.min(...W.map(m=>m.ls)),p=Math.max(...W.map(m=>m.lf)),M=o.descendantLeaves(y).map(m=>U.get(m)),lt=M.reduce((m,w)=>m+w.duration,0),wt=lt>g?M.reduce((m,w)=>m+w.duration*(w.percentComplete??0),0)/lt:null,ot={id:y,name:z.name,duration:T-X,es:X,ef:T,ls:S,lf:p,totalFloat:S-X,critical:W.some(m=>m.critical),percentComplete:wt,parent:z.parent,isSummary:!0,isMilestone:!1,children:[]},r=M.map(m=>m.baselineStart).filter(m=>m!=null),c=M.map(m=>m.baselineEnd).filter(m=>m!=null);return(r.length||c.length)&&j(ot,r.length?Math.min(...r):null,c.length?Math.max(...c):null),ot}function u(y,z,o){const U=new Map(y.map(p=>[p,[]])),W=new Set;for(const p of z){const M=o.get(p.from),lt=o.get(p.to);if(!M.critical||!lt.critical)continue;let wt;switch(p.type){case"FS":wt=M.ef+p.lag;break;case"SS":wt=M.es+p.lag;break;case"FF":wt=M.ef+p.lag-lt.duration;break;case"SF":wt=M.es+p.lag-lt.duration;break;default:wt=-1/0}Math.abs(wt-lt.es)<=g&&(U.get(p.from).push(p.to),W.add(p.to))}const X=y.filter(p=>o.get(p).critical&&!W.has(p)),T=[],S=(p,M)=>{const lt=U.get(p);if(!lt.length){T.push(M);return}for(const wt of lt)S(wt,M.concat(wt))};for(const p of X)S(p,[p]);return T}function F(y,z,o){if(!z||!z.ok)return[];const U=[],W=A(o);for(const X of y){const T=X?W.id(X):null,S=T!=null?String(T):null;if(S==null||!z.tasks.has(S))continue;const p=z.tasks.get(S);if(p.isSummary)continue;const M=J(W.start(X));M!=null&&M<p.es-g&&U.push({id:S,placedStart:M,earliestStart:p.es,by:p.es-M})}return U}}),Et("packages/modules/gantt/resources.js",function(h,pt){"use strict";Object.defineProperty(h,"parseAssignments",{enumerable:!0,get:function(){return g}}),Object.defineProperty(h,"normalizeCapacities",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"sweepLoad",{enumerable:!0,get:function(){return J}}),Object.defineProperty(h,"computeResourceLoad",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(h,"levelResources",{enumerable:!0,get:function(){return D}});const dt=pt("packages/core/src/internal/util.js").warnOnce,at=pt("packages/modules/gantt/schedule.js"),q=at.computeSchedule,et=at.EPS,x=at.taskIdReader,l=pt("packages/modules/gantt/calendar.js").createCalendar;function _(G){if(G==null||G==="")return null;const R=typeof G=="number"?G:Number(G);return Number.isFinite(R)?R:null}function g(G){if(G&&Array.isArray(G.assignments))return G.assignments.map(tt=>{const V=tt&&(tt.resource??tt.name??tt.id);if(V==null||V==="")return null;const it=_(tt.units)??_(tt.allocation)??1;return{resource:String(V),units:it}}).filter(Boolean);const R=G?G.assignee??G.assignees??G.owner:null;return(Array.isArray(R)?R:R==null||R===""?[]:[R]).map(tt=>String(tt)).filter(tt=>tt!=="").map(tt=>({resource:tt,units:1}))}function v(G,R){const P=new Map;if(Array.isArray(G))for(const tt of G){const V=tt&&(tt.id??tt.name??tt.resource);if(V==null||V==="")continue;const it=_(tt.capacity??tt.maxUnits??tt.max??tt.units);P.set(String(V),it??R)}else if(G&&typeof G=="object")for(const[tt,V]of Object.entries(G)){const it=_(V);P.set(String(tt),it??R)}return P}function J(G){if(!G.length)return[];const R=new Set;for(const V of G)R.add(V.s),R.add(V.e);const P=[...R].sort((V,it)=>V-it),tt=[];for(let V=0;V<P.length-1;V+=1){const it=P[V],k=P[V+1];if(k<=it)continue;let f=0;const N=[];for(const Z of G)Z.s<=it&&Z.e>=k&&(f+=Z.units,N.push(Z.taskId));N.length&&tt.push({s:it,e:k,load:f,taskIds:N})}return tt}function nt(G,R,P={}){const tt={ok:!1,resources:[],overAllocations:[],byResource:new Map};if(!R||!R.ok)return tt;const V=_(P.defaultCapacity)??1,it=v(P.resources,V),k=P.calendar!=null?l(P.calendar,R.projectStart):null,f=F=>it.has(F)?it.get(F):V,N=F=>k?k.indexOf(F):F,Z=F=>k?k.dayOf(F):F,L=x(P.fields),st=new Map;for(const F of R.order){const y=R.tasks.get(F);if(!y||y.isSummary)continue;const z=G.find(X=>X&&L(X)!=null&&String(L(X))===F);if(!z)continue;const o=g(z);if(!o.length)continue;const U=N(y.es),W=N(y.ef);if(!(W<=U))for(const X of o)st.has(X.resource)||st.set(X.resource,[]),st.get(X.resource).push({s:U,e:W,units:X.units,taskId:F})}const j=new Map,K=[],u=[];for(const[F,y]of st){const z=f(F),o=J(y);let U=0;const W=o.map(T=>{T.load>U&&(U=T.load);const S={start:Z(T.s),end:Z(T.e),load:T.load,taskIds:T.taskIds};return T.load>z+et&&u.push({resource:F,capacity:z,start:S.start,end:S.end,load:T.load,taskIds:T.taskIds.slice()}),S}),X={resource:F,capacity:z,peak:U,segments:W};j.set(F,X),K.push(X)}return K.sort((F,y)=>F.resource<y.resource?-1:F.resource>y.resource?1:0),u.sort((F,y)=>F.start-y.start||(F.resource<y.resource?-1:1)),{ok:!0,resources:K,overAllocations:u,byResource:j}}function H(G){if(!G)return!1;const R=G.constraint??G.constraintType;if(R==null||R==="")return!1;const P=String(R).toLowerCase().replace(/\s+/g,"-");return P==="mso"||P==="must-start-on"||P==="muststarton"||P==="start-on"||P==="mfo"||P==="must-finish-on"||P==="mustfinishon"||P==="finish-on"}function A(G,R){return G?_(G[R])??0:0}function D(G,R,P={}){const tt={projectStart:P.projectStart,deadline:P.deadline,calendar:P.calendar,fields:P.fields},V=P.priorityField||"priority",it=P.maxIterations!=null?P.maxIterations:Math.max(100,G.length*G.length*2),k=x(P.fields),f=G.map(u=>({...u})),N=f.map(u=>String(k(u))),Z=u=>N.indexOf(u);let L=q(f,R,tt);if(!L.ok)return{ok:!1,error:L.error};const st=new Map;for(const u of L.order){const F=L.tasks.get(u);F&&!F.isSummary&&st.set(u,F.es)}let j=0;for(;j<it;j+=1){const u=nt(f,L,P);if(!u.overAllocations.length)return{ok:!0,resolved:!0,tasks:f,schedule:L,moves:B(st,L),iterations:j};const F=u.overAllocations.slice().sort((T,S)=>T.start-S.start||S.load-T.load)[0],y=new Map(f.map(T=>[String(k(T)),T])),z=F.taskIds.map(T=>L.tasks.get(T)).filter(Boolean),o=z.filter(T=>!H(y.get(T.id)));if(!o.length)return{ok:!0,resolved:!1,tasks:f,schedule:L,moves:B(st,L),remaining:u.overAllocations,iterations:j};o.sort((T,S)=>{if(S.totalFloat!==T.totalFloat)return S.totalFloat-T.totalFloat;const p=A(y.get(T.id),V),M=A(y.get(S.id),V);return p!==M?p-M:S.es!==T.es?S.es-T.es:Z(S.id)-Z(T.id)});const U=o[0],W=z.filter(T=>T.id!==U.id).map(T=>T.ef).filter(T=>T>U.es+et),X=W.length?Math.min(...W):U.es+1;if(y.get(U.id).start=X,L=q(f,R,tt),!L.ok)return{ok:!1,error:L.error}}const K=nt(f,L,P);return K.overAllocations.length&&dt("gantt-level-unresolved",`[lattice] gantt: resource leveling hit its ${it}-iteration cap with ${K.overAllocations.length} over-allocation(s) unresolved; returning the partial result.`),{ok:!0,resolved:K.overAllocations.length===0,tasks:f,schedule:L,moves:B(st,L),remaining:K.overAllocations,iterations:j}}function B(G,R){const P=[];for(const tt of R.order){const V=R.tasks.get(tt);if(!V||V.isSummary)continue;const it=G.get(tt);it!=null&&V.es>it+et&&P.push({id:tt,from:it,to:V.es,delay:V.es-it})}return P}}),Et("packages/modules/gantt/earned-value.js",function(h,pt){"use strict";Object.defineProperty(h,"computeEarnedValue",{enumerable:!0,get:function(){return l}});const dt=pt("packages/modules/gantt/time.js").toDayNumber,at=1e-9;function q(_){if(_==null||_==="")return null;const g=typeof _=="number"?_:Number(_);return Number.isFinite(g)?g:null}function et(_,g,v){return v-g<=at?_>=v?1:0:_<=g?0:_>=v?1:(_-g)/(v-g)}function x(_,g,v,J,nt){const H=g?q(g[J]):null,A=H??_.duration,D=g?q(g[nt]):null,B=_.percentComplete==null?0:Math.max(0,Math.min(100,_.percentComplete))/100,G=_.baselineStart!=null||_.baselineEnd!=null,R=_.baselineStart!=null?_.baselineStart:_.es,P=_.baselineEnd!=null?_.baselineEnd:_.ef,tt=A*et(v,R,P),V=A*B;return{bac:A,pv:tt,ev:V,ac:D,hasBaseline:G}}function Q(_){const g=_.ac;return{bac:_.bac,pv:_.pv,ev:_.ev,ac:g,sv:_.ev-_.pv,cv:g==null?null:_.ev-g,spi:Math.abs(_.pv)<at?null:_.ev/_.pv,cpi:g==null||Math.abs(g)<at?null:_.ev/g}}function l(_,g,v={}){if(!g||!g.ok||!g.tasks||!g.order)return{ok:!1,error:{code:"NO_SCHEDULE",message:"earned value needs a successful schedule"}};const J=v.costField||"cost",nt=v.actualCostField||"actualCost",H=v.statusDate==null?g.projectFinish:dt(v.statusDate)??g.projectFinish,A=new Map;for(const V of Array.isArray(_)?_:[])V&&V.id!=null&&A.set(String(V.id),V);const D=()=>({bac:0,pv:0,ev:0,ac:0,acAny:!1,hasBaseline:!1}),B=new Map;for(const V of g.order)B.set(V,D());const G=D();for(const V of g.order){const it=g.tasks.get(V);if(!it||it.isSummary)continue;const k=x(it,A.get(V),H,J,nt);let f=V;for(;f!=null&&B.has(f);){const N=B.get(f);N.bac+=k.bac,N.pv+=k.pv,N.ev+=k.ev,k.ac!=null&&(N.ac+=k.ac,N.acAny=!0),k.hasBaseline&&(N.hasBaseline=!0),f=g.tasks.get(f).parent}G.bac+=k.bac,G.pv+=k.pv,G.ev+=k.ev,k.ac!=null&&(G.ac+=k.ac,G.acAny=!0),k.hasBaseline&&(G.hasBaseline=!0)}const R=V=>Q({bac:V.bac,pv:V.pv,ev:V.ev,ac:V.acAny?V.ac:null}),P=new Map,tt=[];for(const V of g.order){const it=g.tasks.get(V),k=B.get(V),f={id:it.id,name:it.name,isSummary:!!it.isSummary,isMilestone:!!it.isMilestone,percentComplete:it.percentComplete??null,hasBaseline:k.hasBaseline,hasActualCost:k.acAny,...R(k)};P.set(V,f),tt.push(f)}return{ok:!0,statusDate:H,byTask:P,rows:tt,project:{hasActualCost:G.acAny,hasBaseline:G.hasBaseline,...R(G)}}}}),Et("packages/modules/gantt/mspdi.js",function(h,pt){"use strict";Object.defineProperty(h,"parseXml",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(h,"importMSPDI",{enumerable:!0,get:function(){return it}}),Object.defineProperty(h,"exportMSPDI",{enumerable:!0,get:function(){return f}});const dt=pt("packages/core/src/internal/util.js").warnOnce,at=pt("packages/modules/gantt/time.js"),q=at.toDayNumber,et=at.toISODate,x=Object.freeze({0:"FF",1:"FS",2:"SF",3:"SS"}),Q=Object.freeze({FF:0,FS:1,SF:2,SS:3}),l=Object.freeze({1:"as-late-as-possible",2:"must-start-on",3:"must-finish-on"}),_=Object.freeze({ALAP:1,MSO:2,MFO:3});function g(j){return String(j).replace(/&(#x?[0-9a-fA-F]+|lt|gt|amp|quot|apos);/g,(K,u)=>{if(u[0]==="#"){const F=u[1]==="x"||u[1]==="X"?parseInt(u.slice(2),16):parseInt(u.slice(1),10);return Number.isFinite(F)?String.fromCodePoint(F):K}return{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"}[u]??K})}function v(j){return String(j??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function J(j){const K=j.indexOf(":");return K<0?j:j.slice(K+1)}function nt(j){const K=String(j);let u=0;const F=[];let y=null;for(;u<K.length;){const z=K.indexOf("<",u);if(z<0)break;if(z>u&&F.length){const M=K.slice(u,z);M.trim()&&(F[F.length-1].text+=g(M))}if(K.startsWith("<?",z)){const M=K.indexOf("?>",z);u=M<0?K.length:M+2;continue}if(K.startsWith("<!--",z)){const M=K.indexOf("-->",z);u=M<0?K.length:M+3;continue}if(K.startsWith("<![CDATA[",z)){const M=K.indexOf("]]>",z);F.length&&(F[F.length-1].text+=K.slice(z+9,M<0?K.length:M)),u=M<0?K.length:M+3;continue}if(K.startsWith("<!",z)){const M=K.indexOf(">",z);u=M<0?K.length:M+1;continue}const o=K.indexOf(">",z);if(o<0)break;let U=K.slice(z+1,o).trim();if(U[0]==="/"){F.pop(),u=o+1;continue}const W=U.endsWith("/");W&&(U=U.slice(0,-1).trim());const X=U.search(/\s/),T=J(X<0?U:U.slice(0,X)),S={};if(X>=0)for(const M of U.slice(X).matchAll(/([\w:.-]+)\s*=\s*"([^"]*)"|([\w:.-]+)\s*=\s*'([^']*)'/g))S[J(M[1]??M[3])]=g(M[2]??M[4]??"");const p={name:T,attrs:S,children:[],text:""};F.length?F[F.length-1].children.push(p):y||(y=p),W||F.push(p),u=o+1}return y}function H(j,K){return j?j.children.find(u=>u.name===K):void 0}function A(j,K){return j?j.children.filter(u=>u.name===K):[]}function D(j,K){const u=H(j,K);return u?u.text.trim():void 0}function B(j){if(!j)return null;const K=String(j).match(/^\d{4}-\d{2}-\d{2}/);return q(K?K[0]:j)}function G(j,K){return`${et(j)}T${String(K).padStart(2,"0")}:00:00`}function R(j,K){if(!j)return null;const u=String(j).match(/PT?(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?/);return u?((Number(u[1])||0)+(Number(u[2])||0)/60+(Number(u[3])||0)/3600)/K:null}function P(j,K){return`PT${Math.round((j||0)*K*1e3)/1e3}H0M0S`}function tt(j,K){return(Number(j)||0)/(600*K)}function V(j,K){return Math.round((j||0)*10*60*K)}function it(j,K={}){const u=K.hoursPerDay??8,F=nt(j);if(!F||F.name!=="Project")return dt("gantt-mspdi-not-project","[lattice] gantt: importMSPDI input is not an MSPDI <Project> document."),{ok:!1,error:"not an MSPDI <Project> document",tasks:[],dependencies:[],resources:[]};const y=B(D(F,"StartDate")),z=H(F,"Resources"),o=new Map,U=[];for(const c of A(z,"Resource")){const m=D(c,"UID"),w=D(c,"Name");if(m==null||w==null||w==="")continue;o.set(m,w);const I=D(c,"MaxUnits");U.push({id:w,name:w,capacity:I==null?1:Number(I)})}const W=H(F,"Assignments"),X=new Map;for(const c of A(W,"Assignment")){const m=D(c,"TaskUID"),w=D(c,"ResourceUID"),I=o.get(w);if(m==null||I==null)continue;const s=D(c,"Units");X.has(m)||X.set(m,[]),X.get(m).push({resource:I,units:s==null?1:Number(s)})}const T=H(F,"Tasks"),S=[],p=[],M=new Map,lt=[],wt=[];for(const c of A(T,"Task")){if(D(c,"IsNull")==="1")continue;const m=D(c,"UID");if(m==null||m==="0")continue;const w=m;M.set(m,w);const I=Number(D(c,"OutlineLevel"))||1;for(;lt.length&&lt[lt.length-1].level>=I;)lt.pop();const s=lt.length?lt[lt.length-1].uid:null;lt.push({uid:m,level:I});const e=D(c,"Summary")==="1",t=D(c,"Milestone")==="1",n={id:w,name:D(c,"Name")??w};if(s&&(n.parent=s),t&&(n.milestone=!0),!e&&!t){const Y=R(D(c,"Duration"),u);Y!=null&&(n.duration=Y)}const i=B(D(c,"Start"));!e&&i!=null&&(n.start=i);const a=D(c,"PercentComplete");a!=null&&(n.percentComplete=Number(a));const b=l[Number(D(c,"ConstraintType"))];if(b){n.constraint=b;const Y=B(D(c,"ConstraintDate"));Y!=null&&(n.constraintDate=Y)}const d=H(c,"Baseline");if(d){const Y=B(D(d,"Start")),$=B(D(d,"Finish"));Y!=null&&(n.baselineStart=Y),$!=null&&(n.baselineEnd=$)}const E=X.get(m);E&&E.length&&(n.assignments=E),S.push(n);for(const Y of A(c,"PredecessorLink"))wt.push({raw:Y,uid:m})}for(const{raw:c,uid:m}of wt){const w=D(c,"PredecessorUID"),I=M.get(w),s=M.get(m);if(I==null||s==null)continue;const e=x[Number(D(c,"Type")??1)]??"FS",t=tt(D(c,"LinkLag"),u),n={from:I,to:s,type:e};t&&(n.lag=t),p.push(n)}const ot=k(F),r={ok:!0,tasks:S,dependencies:p,resources:U};return y!=null&&(r.projectStart=y),ot&&(r.calendar=ot),r}function k(j){const K=H(j,"Calendars"),u=A(K,"Calendar"),F=D(j,"CalendarUID"),y=u.find(T=>D(T,"UID")===F)??u[0];if(!y)return null;const z=H(y,"WeekDays"),o=[];let U=!1;for(const T of A(z,"WeekDay")){const S=Number(D(T,"DayType"));S>=1&&S<=7&&(U=!0,D(T,"DayWorking")==="1"&&o.push(S-1))}const W=[],X=H(y,"Exceptions");for(const T of A(X,"Exception")){if(D(T,"DayWorking")==="1")continue;const S=H(T,"TimePeriod"),p=B(D(S,"FromDate")),M=B(D(S,"ToDate"))??p;if(p!=null)for(let lt=p;lt<=M;lt+=1)W.push(lt)}return!U&&!W.length?null:{workdays:U?o:[1,2,3,4,5],holidays:W}}function f(j,K={}){const u=K.hoursPerDay??8,F=Array.isArray(j.tasks)?j.tasks:[],y=Array.isArray(j.dependencies)?j.dependencies:[],z=Array.isArray(j.resources)?j.resources:j.resources&&typeof j.resources=="object"?Object.entries(j.resources).map(([r,c])=>({id:r,name:r,capacity:c})):[],o=j.schedule&&j.schedule.ok?j.schedule:null,U=new Map;F.forEach((r,c)=>{const m=String(r.id);U.set(m,/^\d+$/.test(m)?m:String(c+1))});const W=new Map;for(const r of F){const c=r.parent!=null?String(r.parent):null;c&&(W.has(c)||W.set(c,[]),W.get(c).push(String(r.id)))}const X=r=>W.has(r),T=r=>{let c=1,m=F.find(w=>String(w.id)===r);for(;m&&m.parent!=null;)c+=1,m=F.find(w=>String(w.id)===String(m.parent));return c},S=new Map;for(const r of y){const c=String(r.to);S.has(c)||S.set(c,[]),S.get(c).push(r)}const p=[];p.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),p.push('<Project xmlns="http://schemas.microsoft.com/project">'),p.push(` <Name>${v(K.projectName||"Lattice Gantt export")}</Name>`);const M=j.projectStart!=null?q(j.projectStart):o?o.projectStart:null;M!=null&&p.push(` <StartDate>${G(M,8)}</StartDate>`);const lt=Z(j.calendar);if(lt&&p.push(" <CalendarUID>1</CalendarUID>"),lt){p.push(" <Calendars>"),p.push(" <Calendar>"),p.push(" <UID>1</UID>"),p.push(" <Name>Standard</Name>"),p.push(" <IsBaseCalendar>1</IsBaseCalendar>"),p.push(" <WeekDays>");for(let r=0;r<=6;r+=1){const c=lt.workdays.includes(r);p.push(" <WeekDay>"),p.push(` <DayType>${r+1}</DayType>`),p.push(` <DayWorking>${c?1:0}</DayWorking>`),p.push(" </WeekDay>")}if(p.push(" </WeekDays>"),lt.holidays.length){p.push(" <Exceptions>");for(const r of lt.holidays)p.push(" <Exception>"),p.push(" <DayWorking>0</DayWorking>"),p.push(` <TimePeriod><FromDate>${G(r,0)}</FromDate><ToDate>${G(r,23)}</ToDate></TimePeriod>`),p.push(" </Exception>");p.push(" </Exceptions>")}p.push(" </Calendar>"),p.push(" </Calendars>")}p.push(" <Tasks>");for(const r of F){const c=String(r.id),m=U.get(c),w=X(c),I=!!r.milestone||!w&&Number(r.duration)===0,s=o?o.tasks.get(c):null;p.push(" <Task>"),p.push(` <UID>${v(m)}</UID>`),p.push(` <ID>${v(m)}</ID>`),p.push(` <Name>${v(r.name!=null?r.name:c)}</Name>`),p.push(` <OutlineLevel>${T(c)}</OutlineLevel>`),p.push(` <Summary>${w?1:0}</Summary>`),p.push(` <Milestone>${I?1:0}</Milestone>`);const e=s?s.duration:r.duration!=null?Number(r.duration):null;e!=null&&p.push(` <Duration>${P(e,u)}</Duration>`),p.push(" <DurationFormat>7</DurationFormat>");const t=s?s.es:r.start!=null?q(r.start):null,n=s?s.ef:r.end!=null?q(r.end):t!=null&&e!=null?t+e:null;t!=null&&p.push(` <Start>${G(t,8)}</Start>`),n!=null&&p.push(` <Finish>${G(n,17)}</Finish>`);const i=s?s.percentComplete:r.percentComplete;i!=null&&p.push(` <PercentComplete>${Math.round(Number(i))}</PercentComplete>`);const a=L(r.constraint??r.constraintType);if(a!=null){p.push(` <ConstraintType>${a}</ConstraintType>`);const E=st(r.constraintDate??r.constraintAt??r.at);E!=null&&p.push(` <ConstraintDate>${G(E,8)}</ConstraintDate>`)}const b=st(r.baselineStart??(r.baseline&&r.baseline.start)),d=st(r.baselineEnd??(r.baseline&&r.baseline.end));(b!=null||d!=null)&&(p.push(" <Baseline>"),p.push(" <Number>0</Number>"),b!=null&&p.push(` <Start>${G(b,8)}</Start>`),d!=null&&p.push(` <Finish>${G(d,17)}</Finish>`),b!=null&&d!=null&&p.push(` <Duration>${P(d-b,u)}</Duration>`),p.push(" </Baseline>"));for(const E of S.get(c)||[]){const Y=U.get(String(E.from));Y!=null&&(p.push(" <PredecessorLink>"),p.push(` <PredecessorUID>${v(Y)}</PredecessorUID>`),p.push(` <Type>${Q[E.type?String(E.type).toUpperCase():"FS"]??1}</Type>`),E.lag&&(p.push(` <LinkLag>${V(Number(E.lag),u)}</LinkLag>`),p.push(" <LagFormat>7</LagFormat>")),p.push(" </PredecessorLink>"))}p.push(" </Task>")}p.push(" </Tasks>");const wt=new Map;z.forEach((r,c)=>{const m=String(r.name??r.id??`Resource ${c+1}`);wt.set(m,{uid:String(c+1),capacity:r.capacity??r.maxUnits??1})});const ot=[];for(const r of F)for(const c of N(r))wt.has(c.resource)||wt.set(c.resource,{uid:String(wt.size+1),capacity:1}),ot.push({taskUid:U.get(String(r.id)),resUid:wt.get(c.resource).uid,units:c.units});p.push(" <Resources>");for(const[r,c]of wt)p.push(" <Resource>"),p.push(` <UID>${v(c.uid)}</UID>`),p.push(` <ID>${v(c.uid)}</ID>`),p.push(` <Name>${v(r)}</Name>`),p.push(` <MaxUnits>${Number(c.capacity)}</MaxUnits>`),p.push(" </Resource>");return p.push(" </Resources>"),p.push(" <Assignments>"),ot.forEach((r,c)=>{p.push(" <Assignment>"),p.push(` <UID>${c+1}</UID>`),p.push(` <TaskUID>${v(r.taskUid)}</TaskUID>`),p.push(` <ResourceUID>${v(r.resUid)}</ResourceUID>`),p.push(` <Units>${Number(r.units)}</Units>`),p.push(" </Assignment>")}),p.push(" </Assignments>"),p.push("</Project>"),p.join(`
6
+ var qt=Object.create(null),Jt=Object.create(null);function Et(h,pt){qt[h]=pt}function Qt(h){var pt=Jt[h];if(pt)return pt;var xt=Object.create(null);Jt[h]=xt;var dt=qt[h];if(!dt)throw new Error("[lattice] missing module: "+h);return dt(xt,Qt),xt}Et("packages/core/src/internal/util.js",function(h,pt){"use strict";Object.defineProperty(h,"VERSION",{enumerable:!0,get:function(){return at}}),Object.defineProperty(h,"reportedWarnings",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"warnOnce",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(h,"infoOnce",{enumerable:!0,get:function(){return H}}),Object.defineProperty(h,"resetWarnings",{enumerable:!0,get:function(){return A}}),Object.defineProperty(h,"fail",{enumerable:!0,get:function(){return D}}),Object.defineProperty(h,"invariant",{enumerable:!0,get:function(){return B}}),Object.defineProperty(h,"DEV",{enumerable:!0,get:function(){return G}}),Object.defineProperty(h,"isObject",{enumerable:!0,get:function(){return R}}),Object.defineProperty(h,"isFunction",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"isNil",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(h,"isBlank",{enumerable:!0,get:function(){return V}}),Object.defineProperty(h,"isCtor",{enumerable:!0,get:function(){return it}}),Object.defineProperty(h,"pathGetter",{enumerable:!0,get:function(){return f}}),Object.defineProperty(h,"pathSetter",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(h,"getPath",{enumerable:!0,get:function(){return L}}),Object.defineProperty(h,"setPath",{enumerable:!0,get:function(){return st}}),Object.defineProperty(h,"humanise",{enumerable:!0,get:function(){return j}}),Object.defineProperty(h,"escapeHtml",{enumerable:!0,get:function(){return u}}),Object.defineProperty(h,"titleCase",{enumerable:!0,get:function(){return F}}),Object.defineProperty(h,"expand",{enumerable:!0,get:function(){return y}}),Object.defineProperty(h,"toArray",{enumerable:!0,get:function(){return z}}),Object.defineProperty(h,"merge",{enumerable:!0,get:function(){return U}}),Object.defineProperty(h,"mergeRow",{enumerable:!0,get:function(){return W}}),Object.defineProperty(h,"Lru",{enumerable:!0,get:function(){return X}}),Object.defineProperty(h,"collator",{enumerable:!0,get:function(){return S}}),Object.defineProperty(h,"defaultCompare",{enumerable:!0,get:function(){return p}}),Object.defineProperty(h,"now",{enumerable:!0,get:function(){return M}}),Object.defineProperty(h,"nextFrame",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(h,"cancelFrame",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(h,"frameBatched",{enumerable:!0,get:function(){return r}}),Object.defineProperty(h,"settleDebounce",{enumerable:!0,get:function(){return c}}),Object.defineProperty(h,"whenIdle",{enumerable:!0,get:function(){return m}}),Object.defineProperty(h,"uid",{enumerable:!0,get:function(){return I}});const xt="1.86.5";async function dt(){return xt}const at="1.86.5",q=new Set,et=2e3;function x(s){if(q.add(s),q.size>et){const e=q.values().next().value;e!==void 0&&q.delete(e)}}const Q=[],l=500;function _(s,e,t){Q.push({key:s,level:e,message:t.map(n=>typeof n=="string"?n:g(n)).join(" "),at:Date.now()}),Q.length>l&&Q.shift()}function g(s){if(s instanceof Error)return s.message;try{return JSON.stringify(s)}catch{return String(s)}}function v(){return Q.map(s=>({...s}))}function J(s){if(s.length===0||typeof s[0]!="string")return s;const e=s[0].replace(/^\[lattice\]\s*/,"");return e===s[0]?s:[e,...s.slice(1)]}function nt(s,...e){if(q.has(s))return;x(s);const t=J(e);_(s,"warn",t),console.warn("[lattice]",...t)}function H(s,...e){if(q.has(s))return;x(s);const t=J(e);_(s,"info",t),console.info("[lattice]",...t)}function A(){q.clear(),Q.length=0}function D(s,e){const t=new Error(`[lattice] ${s}`);throw e!==void 0&&(t.cause=e),t}function B(s,e){s||D(e)}const G=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function R(s){return s!==null&&typeof s=="object"&&!Array.isArray(s)}function P(s){return typeof s=="function"}function tt(s){return s==null}function V(s){return s==null||s===""}function it(s){return typeof s!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(s))?!0:!!(s.prototype&&Object.getOwnPropertyNames(s.prototype).length>1)}const k=new Map;function f(s){let e=k.get(s);if(e)return e;if(!s.includes("."))e=t=>t?.[s];else{const t=s.split("."),n=t.length;e=i=>{let a=i;for(let b=0;b<n;b++){if(a==null)return;a=a[t[b]]}return a}}return k.set(s,e),e}const N=new Map;function Z(s){let e=N.get(s);if(e)return e;if(!s.includes("."))e=(t,n)=>{t!=null&&(t[s]=n)};else{const t=s.split("."),n=t.length-1;e=(i,a)=>{let b=i;for(let d=0;d<n;d++){if(b==null)return;const E=t[d];b[E]==null&&(b[E]={}),b=b[E]}b!=null&&(b[t[n]]=a)}}return N.set(s,e),e}function L(s,e){return f(e)(s)}function st(s,e,t){Z(e)(s,t)}function j(s){return s?(s.includes(".")?s.slice(s.lastIndexOf(".")+1):s).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,t=>t.toUpperCase()):""}const K={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function u(s){const e=s==null?"":String(s);return/[&<>"']/.test(e)?e.replace(/[&<>"']/g,t=>K[t]):e}function F(s){return String(s).replace(/\w\S*/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function y(s,e,t){if(s!==void 0)return s===!0?{enabled:!0,...t}:s===!1?{enabled:!1}:R(s)?s:{[e]:s,enabled:!0}}function z(s){return s==null?[]:Array.isArray(s)?s:[s]}const o=Object.freeze(new Set(["__proto__","constructor","prototype"]));function U(s,e){if(!R(s))return R(e)?{...e}:e;if(!R(e))return e===void 0?s:e;const t={...s};for(const n of Object.keys(e)){if(o.has(n))continue;const i=e[n];i!==void 0&&(t[n]=R(i)&&R(t[n])?U(t[n],i):i)}return t}function W(s,e){if(!R(s)||!R(e)||s===e)return e;const t=Object.create(Object.getPrototypeOf(s));return Object.assign(t,s,e),t}class X{#n;#r=new Map;#t;constructor(e=256,t=null){this.#n=e,this.#t=t}get size(){return this.#r.size}get max(){return this.#n}set max(e){this.#n=e,this.#e()}has(e){return this.#r.has(e)}get(e){const t=this.#r;if(!t.has(e))return;const n=t.get(e);return t.delete(e),t.set(e,n),n}peek(e){return this.#r.get(e)}set(e,t){const n=this.#r;return n.has(e)&&n.delete(e),n.set(e,t),this.#e(),t}delete(e){const t=this.#r.get(e);return this.#r.delete(e)&&this.#t&&this.#t(t,e),t}clear(){if(this.#t)for(const[e,t]of this.#r)this.#t(t,e);this.#r.clear()}keys(){return this.#r.keys()}values(){return this.#r.values()}#e(){const e=this.#r;for(;e.size>this.#n;){const t=e.keys().next().value,n=e.get(t);e.delete(t),this.#t&&this.#t(n,t)}}}const T=new Map;function S(s,e){const t=`${s||""}|${e?JSON.stringify(e):""}`;let n=T.get(t);return n||(n=new Intl.Collator(s||void 0,{numeric:!0,sensitivity:"variant",...e}),T.set(t,n)),n}function p(s,e){if(s===e)return 0;if(s==null)return 1;if(e==null)return-1;if(typeof s=="number"&&typeof e=="number")return Number.isNaN(s)?Number.isNaN(e)?0:1:Number.isNaN(e)||s<e?-1:s>e?1:0;const t=String(s),n=String(e);return t<n?-1:t>n?1:0}function M(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const lt=typeof requestAnimationFrame=="function";function wt(s){return lt?requestAnimationFrame(s):setTimeout(()=>s(M()),16)}function ot(s){s!=null&&(lt?cancelAnimationFrame(s):clearTimeout(s))}function r(s){let e=null,t=null;const n=()=>{e=null;const a=t;t=null,s(...a||[])},i=(...a)=>{t=a,e===null&&(e=wt(n))};return i.cancel=()=>{ot(e),e=null,t=null},i.flush=()=>{e!==null&&(ot(e),n())},i}function c(s,e){let t=null,n=null;const i=()=>{if(t=null,n===null)return;const d=n;n=null,s(...d),a()},a=()=>{t=setTimeout(i,e),typeof t?.unref=="function"&&t.unref()},b=(...d)=>{t===null?(s(...d),a()):(n=d,clearTimeout(t),a())};return b.flush=()=>{if(t!==null&&clearTimeout(t),t=null,n===null)return;const d=n;n=null,s(...d)},b.cancel=()=>{t!==null&&clearTimeout(t),t=null,n=null},b.pending=()=>t!==null||n!==null,b}function m(s,e=50){return typeof requestIdleCallback=="function"?requestIdleCallback(s,{timeout:e}):setTimeout(()=>s({timeRemaining:()=>0,didTimeout:!0}),1)}let w=0;function I(s="l"){return`${s}${(++w).toString(36)}`}}),Et("packages/modules/shared/emitter.js",function(h,pt){"use strict";Object.defineProperty(h,"WILDCARD",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"Emitter",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(h,"gate",{enumerable:!0,get:function(){return l}});const xt=pt("packages/core/src/internal/util.js"),dt=xt.isFunction,at=xt.warnOnce,q="*",et=new Set(["api","user","init","ai"]);function x(_,g){return _&&_.name?_.name:`#${g}`}class Q{#n=new Map;#r;constructor(g="module"){this.#r=String(g)}on(g,v){if(!dt(v))return()=>{};let J=this.#n.get(g);return J||(J=new Set,this.#n.set(g,J)),J.add(v),()=>this.off(g,v)}off(g,v){const J=this.#n.get(g);J&&J.delete(v)}count(g){const v=this.#n.get(g);return v?v.size:0}emit(g,v){const J=this.#n.get(g),nt=this.#n.get(q);if((!J||J.size===0)&&(!nt||nt.size===0))return;const H={...v||null,type:g};J&&J.size&&this.#t([...J],H,g),nt&&nt.size&&this.#t([...nt],H,q)}#t(g,v,J){for(let nt=0;nt<g.length;nt++)try{g[nt](v)}catch(H){at(`${this.#r}.emit.throw:${J}:${x(g[nt],nt)}`,`${this.#r}: a '${J}' handler threw; other handlers were unaffected.`,H)}}emitBefore(g,v,J){const nt=J??(v&&v.origin),H=et.has(nt)?nt:"user";let A=!1,D=null;const B=it=>{A=!0,it!=null&&D===null&&(D=String(it))},G={...v||null,type:g,origin:H,get defaultPrevented(){return A},get reason(){return D},preventDefault(it){B(it)}},R=this.#n.get(g);if(!R||R.size===0)return!0;const P=[...R],tt=()=>(A&&D===null&&(D="prevented"),A&&v&&typeof v=="object"&&(v.reason=D),!A),V=[];for(let it=0;it<P.length;it++){const k=P[it];try{const f=k(G);f&&dt(f.then)?V.push(f):f===!1&&B("prevented")}catch(f){B("error"),at(`${this.#r}.beforeThrow:${g}:${x(k,it)}`,`${this.#r}: a '${g}' before-handler threw; the action was cancelled.`,f)}}return V.length===0?tt():Promise.allSettled(V).then(it=>{for(const k of it)k.status==="rejected"?(B("error"),at(`${this.#r}.beforeReject:${g}`,`${this.#r}: a '${g}' before-handler rejected; the action was cancelled.`,k.reason)):k.value===!1&&B("prevented");return tt()})}clear(){this.#n.clear()}}function l(_,g,v,J,nt){const H=_.emitBefore(g,J,J.origin),A=()=>(_.emit(v,{...J,reason:J.reason||"prevented"}),!1);return H===!1?A():H&&dt(H.then)?H.then(D=>D?nt():A()):nt()}}),Et("packages/modules/gantt/time.js",function(h,pt){"use strict";Object.defineProperty(h,"toDayNumber",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"fromDayNumber",{enumerable:!0,get:function(){return et}}),Object.defineProperty(h,"toISODate",{enumerable:!0,get:function(){return x}}),Object.defineProperty(h,"resolveProjectEpoch",{enumerable:!0,get:function(){return Q}});const dt=pt("packages/core/src/internal/util.js").warnOnce,at=864e5;function q(l){if(l==null||l==="")return null;if(typeof l=="number")return Number.isFinite(l)?l:null;if(l instanceof Date)return Number.isFinite(l.getTime())?Math.floor(Date.UTC(l.getFullYear(),l.getMonth(),l.getDate())/at):null;const _=Date.parse(l);return Number.isFinite(_)?Math.floor(_/at):null}function et(l){return Number.isFinite(l)?new Date(Math.round(l)*at):null}function x(l){const _=et(l);return _?_.toISOString().slice(0,10):null}function Q(l){if(l==null||l==="")return 0;const _=q(l);return Number.isFinite(_)?_:(dt(`gantt.projectEpoch:${String(l)}`,`[lattice] gantt: projectEpoch ${JSON.stringify(l)} is not a date or a day number; the plan is rendered against the Unix epoch (day 0 = 1970-01-01).`),0)}}),Et("packages/modules/gantt/calendar.js",function(h,pt){"use strict";Object.defineProperty(h,"createCalendar",{enumerable:!0,get:function(){return et}});const xt=pt("packages/modules/gantt/time.js"),dt=xt.fromDayNumber,at=xt.toDayNumber,q=Object.freeze([1,2,3,4,5]);function et(x,Q=0){if(x==null)return null;let l,_;x==="weekends"?(l=q,_=new Set):(l=Array.isArray(x.workdays)&&x.workdays.length?x.workdays.map(Number).filter(R=>R>=0&&R<=6):q,_=new Set((Array.isArray(x.holidays)?x.holidays:[]).map(R=>at(R)).filter(R=>R!=null)));const g=new Set(l);if(g.size===7&&_.size===0||g.size===0)return null;const v=R=>{const P=dt(R);return P?g.has(P.getUTCDay())&&!_.has(R):!1},J=R=>{let P=R;for(;!v(P);)P+=1;return P},nt=R=>{let P=R;for(;!v(P);)P-=1;return P},H=J(Math.round(Number.isFinite(Q)?Q:0)),A=new Map([[0,H]]),D=new Map([[H,0]]);return{isWorking:v,nextWorking:J,dayOf:R=>{const P=Math.round(R);if(A.has(P))return A.get(P);if(P>0){let it=P-1;for(;!A.has(it);)it-=1;let k=A.get(it);for(let f=it+1;f<=P;f+=1)k=J(k+1),A.set(f,k),D.set(k,f);return A.get(P)}let tt=P+1;for(;!A.has(tt);)tt+=1;let V=A.get(tt);for(let it=tt-1;it>=P;it-=1)V=nt(V-1),A.set(it,V),D.set(V,it);return A.get(P)},indexOf:R=>{const P=J(Math.round(R));if(D.has(P))return D.get(P);if(P>H){let it=0,k=H;for(;D.has(J(k+1))&&k<P;)k=J(k+1),it=D.get(k);for(;k<P;)k=J(k+1),it+=1,A.set(it,k),D.set(k,it);return it}let tt=0,V=H;for(;V>P;)V=nt(V-1),tt-=1,A.set(tt,V),D.set(V,tt);return tt},anchor:H}}}),Et("packages/modules/gantt/schedule.js",function(h,pt){"use strict";Object.defineProperty(h,"LINK_TYPES",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(h,"CONSTRAINT_TYPES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(h,"EPS",{enumerable:!0,get:function(){return g}}),Object.defineProperty(h,"SCHEDULE_ERROR",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"TASK_FIELDS",{enumerable:!0,get:function(){return H}}),Object.defineProperty(h,"taskIdReader",{enumerable:!0,get:function(){return D}}),Object.defineProperty(h,"taskFieldWriters",{enumerable:!0,get:function(){return B}}),Object.defineProperty(h,"normalizeTasks",{enumerable:!0,get:function(){return R}}),Object.defineProperty(h,"buildTree",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"normalizeLinkSpec",{enumerable:!0,get:function(){return V}}),Object.defineProperty(h,"normalizeDependencies",{enumerable:!0,get:function(){return it}}),Object.defineProperty(h,"expandDependencies",{enumerable:!0,get:function(){return k}}),Object.defineProperty(h,"topoOrder",{enumerable:!0,get:function(){return f}}),Object.defineProperty(h,"computeSchedule",{enumerable:!0,get:function(){return st}}),Object.defineProperty(h,"findViolations",{enumerable:!0,get:function(){return F}});const dt=pt("packages/core/src/internal/util.js").warnOnce,q=pt("packages/modules/gantt/calendar.js").createCalendar,x=pt("packages/modules/gantt/time.js").toDayNumber,Q=["FS","SS","FF","SF"],l=["MSO","MFO","ALAP"],_=Object.freeze({mso:"MSO","must-start-on":"MSO",muststarton:"MSO","start-on":"MSO",mfo:"MFO","must-finish-on":"MFO",mustfinishon:"MFO","finish-on":"MFO",alap:"ALAP","as-late-as-possible":"ALAP",aslateaspossible:"ALAP",late:"ALAP"}),g=1e-9,v={CYCLE:"cycle",DUPLICATE_ID:"duplicate-id",UNKNOWN_TASK:"unknown-task",BAD_DURATION:"bad-duration",BAD_LINK_TYPE:"bad-link-type",SELF_DEPENDENCY:"self-dependency",UNKNOWN_PARENT:"unknown-parent",PARENT_CYCLE:"parent-cycle",DEP_ACROSS_HIERARCHY:"dep-across-hierarchy"};function J(y){if(y==null||y==="")return null;const z=typeof y=="number"?y:Number(y);return Number.isFinite(z)?z:null}function nt(y){return y==null||y===""?null:x(y)}const H=Object.freeze(["id","name","start","end","duration","milestone","percentComplete","parent","baselineStart","baselineEnd","constraint","constraintDate"]);function A(y){const z=y&&typeof y=="object"?y:{},o={};for(const U of H){const W=z[U];if(typeof W=="function")o[U]=W;else if(typeof W=="string"&&W!==""){const X=W;o[U]=T=>T[X]}else o[U]=X=>X[U]}return o}function D(y){return A(y).id}function B(y){const z=y&&typeof y=="object"?y:{},o={};for(const U of H){const W=z[U];typeof W=="string"&&W!==""?o[U]=W:typeof W=="function"?o[U]=null:o[U]=U}return o}function G(y,z){const o=z.constraint(y),U=o??(y&&y.constraintType);if(U==null||U==="")return null;const W=_[String(U).toLowerCase().replace(/\s+/g,"-")]??(l.includes(String(U).toUpperCase())?String(U).toUpperCase():null);if(!W)return null;const X=nt(z.constraintDate(y)??y.constraintAt??y.at);return{type:W,at:X}}function R(y,z){const o=new Map,U=[],W=A(z);if(!Array.isArray(y))return{ok:!1,error:{code:v.BAD_DURATION,message:"tasks must be an array"},order:U,byId:o};for(const X of y){const T=X?W.id(X):null,S=T!=null?String(T):null;if(S==null)return{ok:!1,error:{code:v.UNKNOWN_TASK,message:"every task needs an id"},order:U,byId:o};if(o.has(S))return{ok:!1,error:{code:v.DUPLICATE_ID,message:`duplicate task id "${S}"`,id:S},order:U,byId:o};const p=nt(W.start(X)),M=nt(W.end(X)),lt=W.milestone(X)===!0;let wt=lt?0:J(W.duration(X));if(wt==null&&p!=null&&M!=null&&(wt=M-p),wt!=null&&wt<0)return{ok:!1,error:{code:v.BAD_DURATION,message:`task "${S}" has negative duration ${wt}`,id:S},order:U,byId:o};const ot=W.name(X),r=W.parent(X);o.set(S,{id:S,name:ot!=null?String(ot):S,duration:wt,milestoneFlag:lt,earliestStart:p,placedStart:p,placedEnd:M,percentComplete:J(W.percentComplete(X)),parent:r!=null?String(r):null,constraint:G(X,W),baselineStart:nt(W.baselineStart(X)??(X.baseline&&X.baseline.start)),baselineEnd:nt(W.baselineEnd(X)??(X.baseline&&X.baseline.end))}),U.push(S)}return{ok:!0,order:U,byId:o}}function P(y,z){const o=new Map(y.map(S=>[S,[]]));for(const S of y){const p=z.get(S).parent;if(p!=null){if(!z.has(p))return{ok:!1,error:{code:v.UNKNOWN_PARENT,message:`task "${S}" names unknown parent "${p}"`,id:S}};o.get(p).push(S)}}for(const S of y){const p=new Set;let M=z.get(S).parent;for(;M!=null;){if(M===S||p.has(M))return{ok:!1,error:{code:v.PARENT_CYCLE,message:`parent cycle at "${S}"`,id:S}};p.add(M),M=z.get(M)?.parent??null}}const U=S=>o.get(S).length>0,W=new Map,X=S=>{if(W.has(S))return W.get(S);const p=o.get(S),M=p.length===0?[S]:p.flatMap(lt=>X(lt));return W.set(S,M),M};return{ok:!0,children:o,isSummary:U,descendantLeaves:X,ancestors:S=>{const p=new Set;let M=z.get(S).parent;for(;M!=null;)p.add(M),M=z.get(M).parent;return p}}}const tt=/^\s*(FS|SS|FF|SF)\s*(?:([+-])\s*(\d+(?:\.\d+)?))?\s*$/i;function V(y){const z={...y||null};if(typeof z.type!="string")return z;const o=tt.exec(z.type);if(!o||!o[2])return z;const U=(o[2]==="-"?-1:1)*Number(o[3]);z.type=o[1].toUpperCase();const W=J(y.lag);return W!=null&&W!==U?(dt(`gantt-link-shorthand-${String(y.type)}-${W}`,`[lattice] gantt: dependency type ${JSON.stringify(y.type)} carries a lag of ${U} but lag: ${W} was also given; the explicit lag wins. Give one or the other.`),z):(z.lag=U,z)}function it(y,z,o={}){const U=[];if(y==null)return{ok:!0,edges:U};if(!Array.isArray(y))return{ok:!1,error:{code:v.UNKNOWN_TASK,message:"dependencies must be an array"},edges:U};const W=typeof o.ancestors=="function"?o.ancestors:null;for(const X of y){const T=V(X),S=T&&T.from!=null?String(T.from):null,p=T&&T.to!=null?String(T.to):null,M=T&&T.type!=null?String(T.type).toUpperCase():"FS",lt=J(T.lag)??0;if(S==null||p==null)return{ok:!1,error:{code:v.UNKNOWN_TASK,message:"a dependency needs both `from` and `to`"},edges:U};if(!z.has(S))return{ok:!1,error:{code:v.UNKNOWN_TASK,message:`dependency references unknown task "${S}"`,id:S},edges:U};if(!z.has(p))return{ok:!1,error:{code:v.UNKNOWN_TASK,message:`dependency references unknown task "${p}"`,id:p},edges:U};if(S===p)return{ok:!1,error:{code:v.SELF_DEPENDENCY,message:`task "${S}" depends on itself`,id:S},edges:U};if(!Q.includes(M))return{ok:!1,error:{code:v.BAD_LINK_TYPE,message:`unknown link type "${M}" (expected one of ${Q.join("/")})`},edges:U};if(W&&(W(S).has(p)||W(p).has(S)))return{ok:!1,error:{code:v.DEP_ACROSS_HIERARCHY,message:`dependency between "${S}" and "${p}" crosses their own parent/child hierarchy`,from:S,to:p},edges:U};U.push({from:S,to:p,type:M,lag:lt})}return{ok:!0,edges:U}}function k(y,z){const o=new Set,U=[];for(const W of y){(z.isSummary(W.from)||z.isSummary(W.to))&&W.type!=="FS"&&dt(`gantt-summary-link-${W.type}-${W.from}-${W.to}`,`[lattice] gantt: ${W.type} link with a summary endpoint (${W.from} -> ${W.to}) is expanded to descendant leaves — a conservative v1 reading; only FS is exact for summary endpoints.`);for(const T of z.descendantLeaves(W.from))for(const S of z.descendantLeaves(W.to)){if(T===S)continue;const p=[T,S,W.type,W.lag].join("");o.has(p)||(o.add(p),U.push({from:T,to:S,type:W.type,lag:W.lag}))}}return U}function f(y,z){const o=new Map(y.map(T=>[T,0])),U=new Map(y.map(T=>[T,[]]));for(const T of z)N(o,T.to),U.get(T.from).push(T.to);const W=y.filter(T=>o.get(T)===0),X=[];for(;W.length;){const T=W.shift();X.push(T);for(const S of U.get(T)){const p=o.get(S)-1;o.set(S,p),p===0&&W.push(S)}}return X.length===y.length?{ok:!0,sorted:X}:{ok:!1,cycle:Z(y,U,new Set(X))}}function N(y,z){y.set(z,y.get(z)+1)}function Z(y,z,o){const U=y.find(S=>!o.has(S)),W=[],X=new Map;let T=U;for(;T!=null&&!X.has(T);)X.set(T,W.length),W.push(T),T=z.get(T).find(S=>!o.has(S));return T==null?W:W.slice(X.get(T)).concat(T)}function L(y,z,o,U,W,X=new Map){const T=f(y,o);if(!T.ok)return dt(`gantt-cycle-${T.cycle.join(">")}`,`[lattice] gantt: dependency cycle detected (${T.cycle.join(" -> ")}); schedule refused.`),{ok:!1,error:{code:v.CYCLE,message:`dependency cycle: ${T.cycle.join(" -> ")}`,cycle:T.cycle}};const S=T.sorted,p=new Map(y.map(w=>[w,[]])),M=new Map(y.map(w=>[w,[]]));for(const w of o)p.get(w.to).push(w),M.get(w.from).push(w);const lt=new Map;for(const w of y){const I=z.get(w);lt.set(w,{id:w,name:I.name,duration:I.duration,es:0,ef:0,ls:0,lf:0,totalFloat:0,critical:!1,percentComplete:I.percentComplete,parent:I.parent,isSummary:!1,isMilestone:I.duration===0,children:[]})}const wt=[];for(const w of S){const I=z.get(w),s=lt.get(w);let e=Math.max(U,I.earliestStart??U);for(const n of p.get(w)){const i=lt.get(n.from);let a;switch(n.type){case"FS":a=i.ef+n.lag;break;case"SS":a=i.es+n.lag;break;case"FF":a=i.ef+n.lag-s.duration;break;case"SF":a=i.es+n.lag-s.duration;break;default:a=-1/0}a>e&&(e=a)}const t=X.get(w);if(t&&t.type!=="ALAP"&&t.at!=null){const n=t.type==="MFO"?t.at-s.duration:t.at;n<e-g?wt.push({id:w,type:t.type,at:t.at,earliestFeasible:e}):e=n,s.pinned=!0}s.es=e,s.ef=e+s.duration}const ot=y.length?Math.max(...y.map(w=>lt.get(w).ef)):U,r=Number.isFinite(W)?W:ot;for(let w=S.length-1;w>=0;w-=1){const I=S[w],s=lt.get(I);let e=r;for(const t of M.get(I)){const n=lt.get(t.to);let i;switch(t.type){case"FS":i=n.ls-t.lag;break;case"SS":i=n.ls-t.lag+s.duration;break;case"FF":i=n.lf-t.lag;break;case"SF":i=n.lf-t.lag+s.duration;break;default:i=1/0}i<e&&(e=i)}s.pinned&&(e=s.ef),s.lf=e,s.ls=e-s.duration,s.totalFloat=s.ls-s.es,s.critical=s.totalFloat<=g}for(const w of y){const I=X.get(w);if(!I||I.type!=="ALAP")continue;const s=lt.get(w);s.es=s.ls,s.ef=s.lf,s.totalFloat=0,s.critical=!0}const c=y.filter(w=>lt.get(w).critical),m=u(y,o,lt);return{ok:!0,tasks:lt,critical:c,criticalPaths:m,projectFinish:ot,conflicts:wt}}function st(y,z=[],o={}){const U=nt(o.projectStart)??0,W=nt(o.deadline),X=q(o.calendar,U),T=a=>a==null?null:X?X.indexOf(a):a,S=a=>X?X.dayOf(a):a,p=R(y,o.fields);if(!p.ok)return{ok:!1,error:p.error};const{order:M,byId:lt}=p,wt=P(M,lt);if(!wt.ok)return{ok:!1,error:wt.error};const ot=it(z,lt,wt);if(!ot.ok)return{ok:!1,error:ot.error};for(const a of M)if(!wt.isSummary(a)&&lt.get(a).duration==null)return{ok:!1,error:{code:v.BAD_DURATION,message:`task "${a}" has no duration and no start+end to derive one`,id:a}};const r=M.filter(a=>!wt.isSummary(a)),c=new Map(r.map(a=>{const b=lt.get(a);return[a,{...b,earliestStart:T(b.earliestStart)}]})),m=new Map;for(const a of r){const b=lt.get(a).constraint;b&&m.set(a,{type:b.type,at:T(b.at)})}const w=X?X.indexOf(U):U,I=W==null?void 0:T(W),s=k(ot.edges,wt),e=L(r,c,s,w,I,m);if(!e.ok)return{ok:!1,error:e.error};const t=e.tasks;for(const a of r){const b=t.get(a);b.es=S(b.es),b.ef=S(b.ef),b.ls=S(b.ls),b.lf=S(b.lf),j(b,lt.get(a).baselineStart,lt.get(a).baselineEnd)}for(let a=M.length-1;a>=0;a-=1){const b=M[a];wt.isSummary(b)&&t.set(b,K(b,lt.get(b),wt,t))}for(const a of M)wt.isSummary(a)&&(t.get(a).children=wt.children.get(a).slice());const n=X?X.anchor:U,i=S(e.projectFinish);return{ok:!0,tasks:t,order:M,critical:e.critical,criticalPaths:e.criticalPaths,projectStart:n,projectFinish:i,projectDuration:i-n,conflicts:e.conflicts||[],calendar:!!X}}function j(y,z,o){z==null&&o==null||(y.baselineStart=z??null,y.baselineEnd=o??null,y.startVariance=z==null?null:y.es-z,y.finishVariance=o==null?null:y.ef-o,y.durationVariance=z==null||o==null?null:y.ef-y.es-(o-z))}function K(y,z,o,U){const W=o.children.get(y).map(m=>U.get(m)),X=Math.min(...W.map(m=>m.es)),T=Math.max(...W.map(m=>m.ef)),S=Math.min(...W.map(m=>m.ls)),p=Math.max(...W.map(m=>m.lf)),M=o.descendantLeaves(y).map(m=>U.get(m)),lt=M.reduce((m,w)=>m+w.duration,0),wt=lt>g?M.reduce((m,w)=>m+w.duration*(w.percentComplete??0),0)/lt:null,ot={id:y,name:z.name,duration:T-X,es:X,ef:T,ls:S,lf:p,totalFloat:S-X,critical:W.some(m=>m.critical),percentComplete:wt,parent:z.parent,isSummary:!0,isMilestone:!1,children:[]},r=M.map(m=>m.baselineStart).filter(m=>m!=null),c=M.map(m=>m.baselineEnd).filter(m=>m!=null);return(r.length||c.length)&&j(ot,r.length?Math.min(...r):null,c.length?Math.max(...c):null),ot}function u(y,z,o){const U=new Map(y.map(p=>[p,[]])),W=new Set;for(const p of z){const M=o.get(p.from),lt=o.get(p.to);if(!M.critical||!lt.critical)continue;let wt;switch(p.type){case"FS":wt=M.ef+p.lag;break;case"SS":wt=M.es+p.lag;break;case"FF":wt=M.ef+p.lag-lt.duration;break;case"SF":wt=M.es+p.lag-lt.duration;break;default:wt=-1/0}Math.abs(wt-lt.es)<=g&&(U.get(p.from).push(p.to),W.add(p.to))}const X=y.filter(p=>o.get(p).critical&&!W.has(p)),T=[],S=(p,M)=>{const lt=U.get(p);if(!lt.length){T.push(M);return}for(const wt of lt)S(wt,M.concat(wt))};for(const p of X)S(p,[p]);return T}function F(y,z,o){if(!z||!z.ok)return[];const U=[],W=A(o);for(const X of y){const T=X?W.id(X):null,S=T!=null?String(T):null;if(S==null||!z.tasks.has(S))continue;const p=z.tasks.get(S);if(p.isSummary)continue;const M=J(W.start(X));M!=null&&M<p.es-g&&U.push({id:S,placedStart:M,earliestStart:p.es,by:p.es-M})}return U}}),Et("packages/modules/gantt/resources.js",function(h,pt){"use strict";Object.defineProperty(h,"parseAssignments",{enumerable:!0,get:function(){return g}}),Object.defineProperty(h,"normalizeCapacities",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"sweepLoad",{enumerable:!0,get:function(){return J}}),Object.defineProperty(h,"computeResourceLoad",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(h,"levelResources",{enumerable:!0,get:function(){return D}});const dt=pt("packages/core/src/internal/util.js").warnOnce,at=pt("packages/modules/gantt/schedule.js"),q=at.computeSchedule,et=at.EPS,x=at.taskIdReader,l=pt("packages/modules/gantt/calendar.js").createCalendar;function _(G){if(G==null||G==="")return null;const R=typeof G=="number"?G:Number(G);return Number.isFinite(R)?R:null}function g(G){if(G&&Array.isArray(G.assignments))return G.assignments.map(tt=>{const V=tt&&(tt.resource??tt.name??tt.id);if(V==null||V==="")return null;const it=_(tt.units)??_(tt.allocation)??1;return{resource:String(V),units:it}}).filter(Boolean);const R=G?G.assignee??G.assignees??G.owner:null;return(Array.isArray(R)?R:R==null||R===""?[]:[R]).map(tt=>String(tt)).filter(tt=>tt!=="").map(tt=>({resource:tt,units:1}))}function v(G,R){const P=new Map;if(Array.isArray(G))for(const tt of G){const V=tt&&(tt.id??tt.name??tt.resource);if(V==null||V==="")continue;const it=_(tt.capacity??tt.maxUnits??tt.max??tt.units);P.set(String(V),it??R)}else if(G&&typeof G=="object")for(const[tt,V]of Object.entries(G)){const it=_(V);P.set(String(tt),it??R)}return P}function J(G){if(!G.length)return[];const R=new Set;for(const V of G)R.add(V.s),R.add(V.e);const P=[...R].sort((V,it)=>V-it),tt=[];for(let V=0;V<P.length-1;V+=1){const it=P[V],k=P[V+1];if(k<=it)continue;let f=0;const N=[];for(const Z of G)Z.s<=it&&Z.e>=k&&(f+=Z.units,N.push(Z.taskId));N.length&&tt.push({s:it,e:k,load:f,taskIds:N})}return tt}function nt(G,R,P={}){const tt={ok:!1,resources:[],overAllocations:[],byResource:new Map};if(!R||!R.ok)return tt;const V=_(P.defaultCapacity)??1,it=v(P.resources,V),k=P.calendar!=null?l(P.calendar,R.projectStart):null,f=F=>it.has(F)?it.get(F):V,N=F=>k?k.indexOf(F):F,Z=F=>k?k.dayOf(F):F,L=x(P.fields),st=new Map;for(const F of R.order){const y=R.tasks.get(F);if(!y||y.isSummary)continue;const z=G.find(X=>X&&L(X)!=null&&String(L(X))===F);if(!z)continue;const o=g(z);if(!o.length)continue;const U=N(y.es),W=N(y.ef);if(!(W<=U))for(const X of o)st.has(X.resource)||st.set(X.resource,[]),st.get(X.resource).push({s:U,e:W,units:X.units,taskId:F})}const j=new Map,K=[],u=[];for(const[F,y]of st){const z=f(F),o=J(y);let U=0;const W=o.map(T=>{T.load>U&&(U=T.load);const S={start:Z(T.s),end:Z(T.e),load:T.load,taskIds:T.taskIds};return T.load>z+et&&u.push({resource:F,capacity:z,start:S.start,end:S.end,load:T.load,taskIds:T.taskIds.slice()}),S}),X={resource:F,capacity:z,peak:U,segments:W};j.set(F,X),K.push(X)}return K.sort((F,y)=>F.resource<y.resource?-1:F.resource>y.resource?1:0),u.sort((F,y)=>F.start-y.start||(F.resource<y.resource?-1:1)),{ok:!0,resources:K,overAllocations:u,byResource:j}}function H(G){if(!G)return!1;const R=G.constraint??G.constraintType;if(R==null||R==="")return!1;const P=String(R).toLowerCase().replace(/\s+/g,"-");return P==="mso"||P==="must-start-on"||P==="muststarton"||P==="start-on"||P==="mfo"||P==="must-finish-on"||P==="mustfinishon"||P==="finish-on"}function A(G,R){return G?_(G[R])??0:0}function D(G,R,P={}){const tt={projectStart:P.projectStart,deadline:P.deadline,calendar:P.calendar,fields:P.fields},V=P.priorityField||"priority",it=P.maxIterations!=null?P.maxIterations:Math.max(100,G.length*G.length*2),k=x(P.fields),f=G.map(u=>({...u})),N=f.map(u=>String(k(u))),Z=u=>N.indexOf(u);let L=q(f,R,tt);if(!L.ok)return{ok:!1,error:L.error};const st=new Map;for(const u of L.order){const F=L.tasks.get(u);F&&!F.isSummary&&st.set(u,F.es)}let j=0;for(;j<it;j+=1){const u=nt(f,L,P);if(!u.overAllocations.length)return{ok:!0,resolved:!0,tasks:f,schedule:L,moves:B(st,L),iterations:j};const F=u.overAllocations.slice().sort((T,S)=>T.start-S.start||S.load-T.load)[0],y=new Map(f.map(T=>[String(k(T)),T])),z=F.taskIds.map(T=>L.tasks.get(T)).filter(Boolean),o=z.filter(T=>!H(y.get(T.id)));if(!o.length)return{ok:!0,resolved:!1,tasks:f,schedule:L,moves:B(st,L),remaining:u.overAllocations,iterations:j};o.sort((T,S)=>{if(S.totalFloat!==T.totalFloat)return S.totalFloat-T.totalFloat;const p=A(y.get(T.id),V),M=A(y.get(S.id),V);return p!==M?p-M:S.es!==T.es?S.es-T.es:Z(S.id)-Z(T.id)});const U=o[0],W=z.filter(T=>T.id!==U.id).map(T=>T.ef).filter(T=>T>U.es+et),X=W.length?Math.min(...W):U.es+1;if(y.get(U.id).start=X,L=q(f,R,tt),!L.ok)return{ok:!1,error:L.error}}const K=nt(f,L,P);return K.overAllocations.length&&dt("gantt-level-unresolved",`[lattice] gantt: resource leveling hit its ${it}-iteration cap with ${K.overAllocations.length} over-allocation(s) unresolved; returning the partial result.`),{ok:!0,resolved:K.overAllocations.length===0,tasks:f,schedule:L,moves:B(st,L),remaining:K.overAllocations,iterations:j}}function B(G,R){const P=[];for(const tt of R.order){const V=R.tasks.get(tt);if(!V||V.isSummary)continue;const it=G.get(tt);it!=null&&V.es>it+et&&P.push({id:tt,from:it,to:V.es,delay:V.es-it})}return P}}),Et("packages/modules/gantt/earned-value.js",function(h,pt){"use strict";Object.defineProperty(h,"computeEarnedValue",{enumerable:!0,get:function(){return l}});const dt=pt("packages/modules/gantt/time.js").toDayNumber,at=1e-9;function q(_){if(_==null||_==="")return null;const g=typeof _=="number"?_:Number(_);return Number.isFinite(g)?g:null}function et(_,g,v){return v-g<=at?_>=v?1:0:_<=g?0:_>=v?1:(_-g)/(v-g)}function x(_,g,v,J,nt){const H=g?q(g[J]):null,A=H??_.duration,D=g?q(g[nt]):null,B=_.percentComplete==null?0:Math.max(0,Math.min(100,_.percentComplete))/100,G=_.baselineStart!=null||_.baselineEnd!=null,R=_.baselineStart!=null?_.baselineStart:_.es,P=_.baselineEnd!=null?_.baselineEnd:_.ef,tt=A*et(v,R,P),V=A*B;return{bac:A,pv:tt,ev:V,ac:D,hasBaseline:G}}function Q(_){const g=_.ac;return{bac:_.bac,pv:_.pv,ev:_.ev,ac:g,sv:_.ev-_.pv,cv:g==null?null:_.ev-g,spi:Math.abs(_.pv)<at?null:_.ev/_.pv,cpi:g==null||Math.abs(g)<at?null:_.ev/g}}function l(_,g,v={}){if(!g||!g.ok||!g.tasks||!g.order)return{ok:!1,error:{code:"NO_SCHEDULE",message:"earned value needs a successful schedule"}};const J=v.costField||"cost",nt=v.actualCostField||"actualCost",H=v.statusDate==null?g.projectFinish:dt(v.statusDate)??g.projectFinish,A=new Map;for(const V of Array.isArray(_)?_:[])V&&V.id!=null&&A.set(String(V.id),V);const D=()=>({bac:0,pv:0,ev:0,ac:0,acAny:!1,hasBaseline:!1}),B=new Map;for(const V of g.order)B.set(V,D());const G=D();for(const V of g.order){const it=g.tasks.get(V);if(!it||it.isSummary)continue;const k=x(it,A.get(V),H,J,nt);let f=V;for(;f!=null&&B.has(f);){const N=B.get(f);N.bac+=k.bac,N.pv+=k.pv,N.ev+=k.ev,k.ac!=null&&(N.ac+=k.ac,N.acAny=!0),k.hasBaseline&&(N.hasBaseline=!0),f=g.tasks.get(f).parent}G.bac+=k.bac,G.pv+=k.pv,G.ev+=k.ev,k.ac!=null&&(G.ac+=k.ac,G.acAny=!0),k.hasBaseline&&(G.hasBaseline=!0)}const R=V=>Q({bac:V.bac,pv:V.pv,ev:V.ev,ac:V.acAny?V.ac:null}),P=new Map,tt=[];for(const V of g.order){const it=g.tasks.get(V),k=B.get(V),f={id:it.id,name:it.name,isSummary:!!it.isSummary,isMilestone:!!it.isMilestone,percentComplete:it.percentComplete??null,hasBaseline:k.hasBaseline,hasActualCost:k.acAny,...R(k)};P.set(V,f),tt.push(f)}return{ok:!0,statusDate:H,byTask:P,rows:tt,project:{hasActualCost:G.acAny,hasBaseline:G.hasBaseline,...R(G)}}}}),Et("packages/modules/gantt/mspdi.js",function(h,pt){"use strict";Object.defineProperty(h,"parseXml",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(h,"importMSPDI",{enumerable:!0,get:function(){return it}}),Object.defineProperty(h,"exportMSPDI",{enumerable:!0,get:function(){return f}});const dt=pt("packages/core/src/internal/util.js").warnOnce,at=pt("packages/modules/gantt/time.js"),q=at.toDayNumber,et=at.toISODate,x=Object.freeze({0:"FF",1:"FS",2:"SF",3:"SS"}),Q=Object.freeze({FF:0,FS:1,SF:2,SS:3}),l=Object.freeze({1:"as-late-as-possible",2:"must-start-on",3:"must-finish-on"}),_=Object.freeze({ALAP:1,MSO:2,MFO:3});function g(j){return String(j).replace(/&(#x?[0-9a-fA-F]+|lt|gt|amp|quot|apos);/g,(K,u)=>{if(u[0]==="#"){const F=u[1]==="x"||u[1]==="X"?parseInt(u.slice(2),16):parseInt(u.slice(1),10);return Number.isFinite(F)?String.fromCodePoint(F):K}return{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"}[u]??K})}function v(j){return String(j??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function J(j){const K=j.indexOf(":");return K<0?j:j.slice(K+1)}function nt(j){const K=String(j);let u=0;const F=[];let y=null;for(;u<K.length;){const z=K.indexOf("<",u);if(z<0)break;if(z>u&&F.length){const M=K.slice(u,z);M.trim()&&(F[F.length-1].text+=g(M))}if(K.startsWith("<?",z)){const M=K.indexOf("?>",z);u=M<0?K.length:M+2;continue}if(K.startsWith("<!--",z)){const M=K.indexOf("-->",z);u=M<0?K.length:M+3;continue}if(K.startsWith("<![CDATA[",z)){const M=K.indexOf("]]>",z);F.length&&(F[F.length-1].text+=K.slice(z+9,M<0?K.length:M)),u=M<0?K.length:M+3;continue}if(K.startsWith("<!",z)){const M=K.indexOf(">",z);u=M<0?K.length:M+1;continue}const o=K.indexOf(">",z);if(o<0)break;let U=K.slice(z+1,o).trim();if(U[0]==="/"){F.pop(),u=o+1;continue}const W=U.endsWith("/");W&&(U=U.slice(0,-1).trim());const X=U.search(/\s/),T=J(X<0?U:U.slice(0,X)),S={};if(X>=0)for(const M of U.slice(X).matchAll(/([\w:.-]+)\s*=\s*"([^"]*)"|([\w:.-]+)\s*=\s*'([^']*)'/g))S[J(M[1]??M[3])]=g(M[2]??M[4]??"");const p={name:T,attrs:S,children:[],text:""};F.length?F[F.length-1].children.push(p):y||(y=p),W||F.push(p),u=o+1}return y}function H(j,K){return j?j.children.find(u=>u.name===K):void 0}function A(j,K){return j?j.children.filter(u=>u.name===K):[]}function D(j,K){const u=H(j,K);return u?u.text.trim():void 0}function B(j){if(!j)return null;const K=String(j).match(/^\d{4}-\d{2}-\d{2}/);return q(K?K[0]:j)}function G(j,K){return`${et(j)}T${String(K).padStart(2,"0")}:00:00`}function R(j,K){if(!j)return null;const u=String(j).match(/PT?(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?/);return u?((Number(u[1])||0)+(Number(u[2])||0)/60+(Number(u[3])||0)/3600)/K:null}function P(j,K){return`PT${Math.round((j||0)*K*1e3)/1e3}H0M0S`}function tt(j,K){return(Number(j)||0)/(600*K)}function V(j,K){return Math.round((j||0)*10*60*K)}function it(j,K={}){const u=K.hoursPerDay??8,F=nt(j);if(!F||F.name!=="Project")return dt("gantt-mspdi-not-project","[lattice] gantt: importMSPDI input is not an MSPDI <Project> document."),{ok:!1,error:"not an MSPDI <Project> document",tasks:[],dependencies:[],resources:[]};const y=B(D(F,"StartDate")),z=H(F,"Resources"),o=new Map,U=[];for(const c of A(z,"Resource")){const m=D(c,"UID"),w=D(c,"Name");if(m==null||w==null||w==="")continue;o.set(m,w);const I=D(c,"MaxUnits");U.push({id:w,name:w,capacity:I==null?1:Number(I)})}const W=H(F,"Assignments"),X=new Map;for(const c of A(W,"Assignment")){const m=D(c,"TaskUID"),w=D(c,"ResourceUID"),I=o.get(w);if(m==null||I==null)continue;const s=D(c,"Units");X.has(m)||X.set(m,[]),X.get(m).push({resource:I,units:s==null?1:Number(s)})}const T=H(F,"Tasks"),S=[],p=[],M=new Map,lt=[],wt=[];for(const c of A(T,"Task")){if(D(c,"IsNull")==="1")continue;const m=D(c,"UID");if(m==null||m==="0")continue;const w=m;M.set(m,w);const I=Number(D(c,"OutlineLevel"))||1;for(;lt.length&&lt[lt.length-1].level>=I;)lt.pop();const s=lt.length?lt[lt.length-1].uid:null;lt.push({uid:m,level:I});const e=D(c,"Summary")==="1",t=D(c,"Milestone")==="1",n={id:w,name:D(c,"Name")??w};if(s&&(n.parent=s),t&&(n.milestone=!0),!e&&!t){const Y=R(D(c,"Duration"),u);Y!=null&&(n.duration=Y)}const i=B(D(c,"Start"));!e&&i!=null&&(n.start=i);const a=D(c,"PercentComplete");a!=null&&(n.percentComplete=Number(a));const b=l[Number(D(c,"ConstraintType"))];if(b){n.constraint=b;const Y=B(D(c,"ConstraintDate"));Y!=null&&(n.constraintDate=Y)}const d=H(c,"Baseline");if(d){const Y=B(D(d,"Start")),$=B(D(d,"Finish"));Y!=null&&(n.baselineStart=Y),$!=null&&(n.baselineEnd=$)}const E=X.get(m);E&&E.length&&(n.assignments=E),S.push(n);for(const Y of A(c,"PredecessorLink"))wt.push({raw:Y,uid:m})}for(const{raw:c,uid:m}of wt){const w=D(c,"PredecessorUID"),I=M.get(w),s=M.get(m);if(I==null||s==null)continue;const e=x[Number(D(c,"Type")??1)]??"FS",t=tt(D(c,"LinkLag"),u),n={from:I,to:s,type:e};t&&(n.lag=t),p.push(n)}const ot=k(F),r={ok:!0,tasks:S,dependencies:p,resources:U};return y!=null&&(r.projectStart=y),ot&&(r.calendar=ot),r}function k(j){const K=H(j,"Calendars"),u=A(K,"Calendar"),F=D(j,"CalendarUID"),y=u.find(T=>D(T,"UID")===F)??u[0];if(!y)return null;const z=H(y,"WeekDays"),o=[];let U=!1;for(const T of A(z,"WeekDay")){const S=Number(D(T,"DayType"));S>=1&&S<=7&&(U=!0,D(T,"DayWorking")==="1"&&o.push(S-1))}const W=[],X=H(y,"Exceptions");for(const T of A(X,"Exception")){if(D(T,"DayWorking")==="1")continue;const S=H(T,"TimePeriod"),p=B(D(S,"FromDate")),M=B(D(S,"ToDate"))??p;if(p!=null)for(let lt=p;lt<=M;lt+=1)W.push(lt)}return!U&&!W.length?null:{workdays:U?o:[1,2,3,4,5],holidays:W}}function f(j,K={}){const u=K.hoursPerDay??8,F=Array.isArray(j.tasks)?j.tasks:[],y=Array.isArray(j.dependencies)?j.dependencies:[],z=Array.isArray(j.resources)?j.resources:j.resources&&typeof j.resources=="object"?Object.entries(j.resources).map(([r,c])=>({id:r,name:r,capacity:c})):[],o=j.schedule&&j.schedule.ok?j.schedule:null,U=new Map;F.forEach((r,c)=>{const m=String(r.id);U.set(m,/^\d+$/.test(m)?m:String(c+1))});const W=new Map;for(const r of F){const c=r.parent!=null?String(r.parent):null;c&&(W.has(c)||W.set(c,[]),W.get(c).push(String(r.id)))}const X=r=>W.has(r),T=r=>{let c=1,m=F.find(w=>String(w.id)===r);for(;m&&m.parent!=null;)c+=1,m=F.find(w=>String(w.id)===String(m.parent));return c},S=new Map;for(const r of y){const c=String(r.to);S.has(c)||S.set(c,[]),S.get(c).push(r)}const p=[];p.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),p.push('<Project xmlns="http://schemas.microsoft.com/project">'),p.push(` <Name>${v(K.projectName||"Lattice Gantt export")}</Name>`);const M=j.projectStart!=null?q(j.projectStart):o?o.projectStart:null;M!=null&&p.push(` <StartDate>${G(M,8)}</StartDate>`);const lt=Z(j.calendar);if(lt&&p.push(" <CalendarUID>1</CalendarUID>"),lt){p.push(" <Calendars>"),p.push(" <Calendar>"),p.push(" <UID>1</UID>"),p.push(" <Name>Standard</Name>"),p.push(" <IsBaseCalendar>1</IsBaseCalendar>"),p.push(" <WeekDays>");for(let r=0;r<=6;r+=1){const c=lt.workdays.includes(r);p.push(" <WeekDay>"),p.push(` <DayType>${r+1}</DayType>`),p.push(` <DayWorking>${c?1:0}</DayWorking>`),p.push(" </WeekDay>")}if(p.push(" </WeekDays>"),lt.holidays.length){p.push(" <Exceptions>");for(const r of lt.holidays)p.push(" <Exception>"),p.push(" <DayWorking>0</DayWorking>"),p.push(` <TimePeriod><FromDate>${G(r,0)}</FromDate><ToDate>${G(r,23)}</ToDate></TimePeriod>`),p.push(" </Exception>");p.push(" </Exceptions>")}p.push(" </Calendar>"),p.push(" </Calendars>")}p.push(" <Tasks>");for(const r of F){const c=String(r.id),m=U.get(c),w=X(c),I=!!r.milestone||!w&&Number(r.duration)===0,s=o?o.tasks.get(c):null;p.push(" <Task>"),p.push(` <UID>${v(m)}</UID>`),p.push(` <ID>${v(m)}</ID>`),p.push(` <Name>${v(r.name!=null?r.name:c)}</Name>`),p.push(` <OutlineLevel>${T(c)}</OutlineLevel>`),p.push(` <Summary>${w?1:0}</Summary>`),p.push(` <Milestone>${I?1:0}</Milestone>`);const e=s?s.duration:r.duration!=null?Number(r.duration):null;e!=null&&p.push(` <Duration>${P(e,u)}</Duration>`),p.push(" <DurationFormat>7</DurationFormat>");const t=s?s.es:r.start!=null?q(r.start):null,n=s?s.ef:r.end!=null?q(r.end):t!=null&&e!=null?t+e:null;t!=null&&p.push(` <Start>${G(t,8)}</Start>`),n!=null&&p.push(` <Finish>${G(n,17)}</Finish>`);const i=s?s.percentComplete:r.percentComplete;i!=null&&p.push(` <PercentComplete>${Math.round(Number(i))}</PercentComplete>`);const a=L(r.constraint??r.constraintType);if(a!=null){p.push(` <ConstraintType>${a}</ConstraintType>`);const E=st(r.constraintDate??r.constraintAt??r.at);E!=null&&p.push(` <ConstraintDate>${G(E,8)}</ConstraintDate>`)}const b=st(r.baselineStart??(r.baseline&&r.baseline.start)),d=st(r.baselineEnd??(r.baseline&&r.baseline.end));(b!=null||d!=null)&&(p.push(" <Baseline>"),p.push(" <Number>0</Number>"),b!=null&&p.push(` <Start>${G(b,8)}</Start>`),d!=null&&p.push(` <Finish>${G(d,17)}</Finish>`),b!=null&&d!=null&&p.push(` <Duration>${P(d-b,u)}</Duration>`),p.push(" </Baseline>"));for(const E of S.get(c)||[]){const Y=U.get(String(E.from));Y!=null&&(p.push(" <PredecessorLink>"),p.push(` <PredecessorUID>${v(Y)}</PredecessorUID>`),p.push(` <Type>${Q[E.type?String(E.type).toUpperCase():"FS"]??1}</Type>`),E.lag&&(p.push(` <LinkLag>${V(Number(E.lag),u)}</LinkLag>`),p.push(" <LagFormat>7</LagFormat>")),p.push(" </PredecessorLink>"))}p.push(" </Task>")}p.push(" </Tasks>");const wt=new Map;z.forEach((r,c)=>{const m=String(r.name??r.id??`Resource ${c+1}`);wt.set(m,{uid:String(c+1),capacity:r.capacity??r.maxUnits??1})});const ot=[];for(const r of F)for(const c of N(r))wt.has(c.resource)||wt.set(c.resource,{uid:String(wt.size+1),capacity:1}),ot.push({taskUid:U.get(String(r.id)),resUid:wt.get(c.resource).uid,units:c.units});p.push(" <Resources>");for(const[r,c]of wt)p.push(" <Resource>"),p.push(` <UID>${v(c.uid)}</UID>`),p.push(` <ID>${v(c.uid)}</ID>`),p.push(` <Name>${v(r)}</Name>`),p.push(` <MaxUnits>${Number(c.capacity)}</MaxUnits>`),p.push(" </Resource>");return p.push(" </Resources>"),p.push(" <Assignments>"),ot.forEach((r,c)=>{p.push(" <Assignment>"),p.push(` <UID>${c+1}</UID>`),p.push(` <TaskUID>${v(r.taskUid)}</TaskUID>`),p.push(` <ResourceUID>${v(r.resUid)}</ResourceUID>`),p.push(` <Units>${Number(r.units)}</Units>`),p.push(" </Assignment>")}),p.push(" </Assignments>"),p.push("</Project>"),p.join(`
7
7
  `)}function N(j){if(j&&Array.isArray(j.assignments))return j.assignments.map(F=>{const y=F&&(F.resource??F.name??F.id);if(y==null||y==="")return null;const z=Number(F.units??F.allocation??1);return{resource:String(y),units:Number.isFinite(z)?z:1}}).filter(Boolean);const K=j?j.assignee??j.assignees??j.owner:null;return(Array.isArray(K)?K:K==null||K===""?[]:[K]).map(F=>String(F)).filter(F=>F!=="").map(F=>({resource:F,units:1}))}function Z(j){if(j==null)return null;if(j==="weekends")return{workdays:[1,2,3,4,5],holidays:[]};const K=Array.isArray(j.workdays)&&j.workdays.length?j.workdays.map(Number).filter(F=>F>=0&&F<=6):[1,2,3,4,5],u=(Array.isArray(j.holidays)?j.holidays:[]).map(F=>q(F)).filter(F=>F!=null);return{workdays:K,holidays:u}}function L(j){if(j==null||j==="")return null;const K=String(j).toLowerCase().replace(/\s+/g,"-"),F={mso:"MSO","must-start-on":"MSO",muststarton:"MSO","start-on":"MSO",mfo:"MFO","must-finish-on":"MFO",mustfinishon:"MFO","finish-on":"MFO",alap:"ALAP","as-late-as-possible":"ALAP",aslateaspossible:"ALAP",late:"ALAP"}[K]??(["MSO","MFO","ALAP"].includes(String(j).toUpperCase())?String(j).toUpperCase():null);return F?_[F]:null}function st(j){return j==null||j===""?null:q(j)}}),Et("packages/modules/gantt/workload.js",function(h,pt){"use strict";Object.defineProperty(h,"WORKLOAD_DEFAULTS",{enumerable:!0,get:function(){return g}}),Object.defineProperty(h,"statedHours",{enumerable:!0,get:function(){return J}}),Object.defineProperty(h,"taskContour",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(h,"contourTotal",{enumerable:!0,get:function(){return H}}),Object.defineProperty(h,"serializeContour",{enumerable:!0,get:function(){return A}}),Object.defineProperty(h,"contourSpan",{enumerable:!0,get:function(){return D}}),Object.defineProperty(h,"spanDuration",{enumerable:!0,get:function(){return B}}),Object.defineProperty(h,"spreadHours",{enumerable:!0,get:function(){return G}}),Object.defineProperty(h,"setContourBucket",{enumerable:!0,get:function(){return R}}),Object.defineProperty(h,"retimeContour",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"recordWorkingDays",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(h,"workloadBuckets",{enumerable:!0,get:function(){return V}}),Object.defineProperty(h,"computeWorkload",{enumerable:!0,get:function(){return it}}),Object.defineProperty(h,"formatHours",{enumerable:!0,get:function(){return k}});const dt=pt("packages/modules/gantt/resources.js").parseAssignments,at=pt("packages/modules/gantt/schedule.js"),q=at.EPS,et=at.taskIdReader,x=pt("packages/modules/gantt/time.js"),Q=x.fromDayNumber,l=x.toDayNumber,_=x.toISODate,g=Object.freeze({hoursPerDay:8,height:160,rowHeight:28,decimals:1,totals:!0});function v(f){if(f==null||f===""||typeof f=="boolean")return null;const N=typeof f=="number"?f:Number(f);return Number.isFinite(N)?N:null}function J(f){if(!f||Array.isArray(f.work))return null;const N=v(f.work);return N??v(f.hours)}function nt(f){if(!f||!Array.isArray(f.work))return null;const N=[];for(const L of f.work){if(!L||typeof L!="object")continue;const st=l(L.date),j=v(L.hours);st==null||j==null||N.push({day:Math.round(st),hours:j})}N.sort((L,st)=>L.day-st.day);const Z=[];for(const L of N){const st=Z[Z.length-1];st&&st.day===L.day?st.hours+=L.hours:Z.push({day:L.day,hours:L.hours})}return Z}function H(f){return(Array.isArray(f)?f:[]).reduce((N,Z)=>N+(v(Z.hours)??0),0)}function A(f){const N=[];for(const Z of Array.isArray(f)?f:[]){const L=v(Z.hours);if(L==null||!(Math.abs(L)>q))continue;const st=_(Z.day);st!=null&&N.push({date:st,hours:Math.round(L*1e6)/1e6})}return N}function D(f){const N=(Array.isArray(f)?f:[]).filter(Z=>Math.abs(v(Z.hours)??0)>q);return N.length?{first:N[0].day,last:N[N.length-1].day}:null}function B(f,N,Z=null){if(!Number.isFinite(f)||!Number.isFinite(N)||N<f)return 0;if(typeof Z!="function")return Math.round(N-f)+1;let L=0;for(let st=Math.round(f);st<=Math.round(N);st+=1)Z(st)&&(L+=1);return L}function G(f,N){if(!Array.isArray(f)||!f.length)return[];const Z=N/f.length;return f.map(L=>({day:L,hours:Z}))}function R(f,N,Z,L){const st=(Array.isArray(f)?f:[]).filter(K=>!(K.day>=N.start&&K.day<N.end)),j=Math.abs(L)>q?G(Z,L):[];return[...st,...j].sort((K,u)=>K.day-u.day)}function P(f,N,Z){const L=Array.isArray(N)?N:[],st=Array.isArray(Z)?Z:[];if(!Array.isArray(f)||!L.length||!st.length)return Array.isArray(f)?f:[];const j=new Map(f.map(y=>[y.day,v(y.hours)??0])),K=L.map(y=>j.get(y)??0),u=K.length,F=[];for(let y=0;y<st.length;y+=1){const z=K[Math.min(u-1,Math.floor(y*u/st.length))];Math.abs(z)>q&&F.push({day:st[y],hours:z})}return F}function tt(f,N=null){const Z=[];if(!f||!Number.isFinite(f.es)||!Number.isFinite(f.ef))return Z;for(let L=Math.floor(f.es);L<Math.ceil(f.ef);L+=1)(typeof N!="function"||N(L))&&Z.push(L);return Z}function V(f,N,Z){const L=Math.floor(N),st=Math.ceil(Z),j=[];if(!(st>L))return j;if(f==="day"){for(let F=L;F<st;F+=1)j.push({start:F,end:F+1});return j}if(f==="month"||f==="quarter"){const F=Q(L);if(!F)return j;let y=Date.UTC(F.getUTCFullYear(),F.getUTCMonth(),1)/864e5;for(;y<st;){const z=Q(y),o=Date.UTC(z.getUTCFullYear(),z.getUTCMonth()+1,1)/864e5;j.push({start:y,end:o}),y=o}return j}const K=Q(L);let u=L-(K?K.getUTCDay():0);for(;u<st;u+=7)j.push({start:u,end:u+7});return j}function it(f,N,Z={}){const L=Array.isArray(Z.buckets)?Z.buckets:[],st={ok:!1,buckets:[],rows:[],totals:L.map(()=>null),grandTotal:0};if(!N||!N.ok)return st;const j=v(Z.hoursPerDay)??g.hoursPerDay,K=typeof Z.isWorking=="function"?Z.isWorking:null,u=Z.capacities instanceof Map?Z.capacities:null,F=et(Z.fields),y=new Map,z=(ot,r,c,m)=>{y.has(ot)||y.set(ot,{days:new Map,tasks:new Map});const w=y.get(ot);w.days.set(r,(w.days.get(r)||0)+c),w.tasks.has(m.id)||w.tasks.set(m.id,{...m,days:new Map});const I=w.tasks.get(m.id);I.days.set(r,(I.days.get(r)||0)+c)},o=new Map;for(const ot of Array.isArray(f)?f:[]){const r=ot?F(ot):null;r!=null&&o.set(String(r),ot)}const U=Array.isArray(f)&&N.order.length===f.length;for(let ot=0;ot<N.order.length;ot+=1){const r=N.order[ot],c=N.tasks.get(r);if(!c||c.isSummary)continue;const m=o.get(r)||(U?f[ot]:null);if(!m)continue;const w=tt(c,K),I=nt(m);if(!I&&!w.length)continue;const s=dt(m),e=s.length?s:[{resource:null,units:1}],t=e.reduce((i,a)=>i+(v(a.units)??0),0);if(!(t>0))continue;let n;if(I)n=I.filter(i=>Math.abs(i.hours)>q);else{const i=J(m),a=i??w.length*j*t;if(!(Math.abs(a)>q))continue;n=G(w,a)}if(n.length)for(const i of e){const a=v(i.units)??0,b=a/t;if(!(Math.abs(b)>0))continue;const d={id:r,name:c.name,units:a,unitsTotal:t,raw:m};for(const E of n)z(i.resource,E.day,E.hours*b,d)}}const W=ot=>{let r=0,c=L.length-1;for(;r<=c;){const m=r+c>>1;if(ot<L[m].start)c=m-1;else if(ot>=L[m].end)r=m+1;else return m}return-1},X=L.map(ot=>{let r=0;for(let c=Math.floor(ot.start);c<Math.ceil(ot.end);c+=1)(!K||K(c))&&(r+=1);return{start:ot.start,end:ot.end,workingDays:r}}),T=ot=>{const r=X.map(()=>0);for(const[c,m]of ot){const w=W(c);w>=0&&(r[w]+=m)}return r},S=[...y.keys()].filter(ot=>ot!=null).sort(),p=y.has(null)?[...S,null]:S,M=[],lt=X.map(()=>0);let wt=0;for(const ot of p){const r=y.get(ot),c=T(r.days),m=ot!=null&&u&&u.has(ot)?u.get(ot):null,w=c.map(t=>Math.abs(t)>q?t:null),I=c.map((t,n)=>{if(m==null)return!1;const i=m*j*X[n].workingDays;return t>i+q});let s=0;c.forEach((t,n)=>{s+=t,lt[n]+=t}),wt+=s;const e=[...r.tasks.values()].map(t=>{const n=T(t.days);return{id:t.id,name:t.name,units:t.units,unitsTotal:t.unitsTotal,raw:t.raw,cells:n.map(i=>Math.abs(i)>q?i:null),total:n.reduce((i,a)=>i+a,0)}});M.push({resource:ot,capacity:m,cells:w,over:I,total:s,tasks:e})}return{ok:!0,buckets:X,rows:M,totals:lt.map(ot=>Math.abs(ot)>q?ot:null),grandTotal:wt}}function k(f,N){if(f==null||!Number.isFinite(f))return"";const L=10**(Number.isFinite(N)?Math.max(0,Math.min(6,Math.round(N))):1),st=Math.round(f*L)/L;return Object.is(st,-0)||st===0?"0":String(st)}}),Et("packages/modules/shared/autosize.js",function(h,pt){"use strict";Object.defineProperty(h,"contentWidth",{enumerable:!0,get:function(){return at}}),Object.defineProperty(h,"contentHeight",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"firstMeasured",{enumerable:!0,get:function(){return et}}),Object.defineProperty(h,"watchSize",{enumerable:!0,get:function(){return x}}),Object.defineProperty(h,"watchBox",{enumerable:!0,get:function(){return Q}});const dt=pt("packages/core/src/internal/util.js").warnOnce;function at(l){if(!l||typeof l!="object")return null;const _=Number(l.clientWidth);if(Number.isFinite(_)&&_>0)return _;if(typeof l.getBoundingClientRect=="function"){const g=l.getBoundingClientRect(),v=g&&Number(g.width);if(Number.isFinite(v)&&v>0)return v}return null}function q(l){if(!l||typeof l!="object")return null;const _=Number(l.clientHeight);if(Number.isFinite(_)&&_>0)return _;if(typeof l.getBoundingClientRect=="function"){const g=l.getBoundingClientRect(),v=g&&Number(g.height);if(Number.isFinite(v)&&v>0)return v}return null}function et(l,_=at){for(const g of l||[]){const v=_(g);if(Number.isFinite(v)&&v>0)return v}return null}function x(l){const _=(l&&Array.isArray(l.targets)?l.targets:[]).filter(Boolean),g=l&&typeof l.read=="function"?l.read:()=>null,v=l&&typeof l.apply=="function"?l.apply:()=>{},J=Number.isFinite(l&&l.epsilon)?Number(l.epsilon):1;let nt=null,H=!1;const A=()=>{if(H)return!1;const P=g();if(!Number.isFinite(P)||P<=0||nt!=null&&Math.abs(P-nt)<J)return!1;nt=P,H=!0;try{v(P)}finally{H=!1}return!0};A();const D=_[0],B=l&&l.view||D&&D.ownerDocument&&D.ownerDocument.defaultView||globalThis,G=B&&B.ResizeObserver;let R=null;if(typeof G=="function"&&_.length){R=new G(()=>{A()});for(const P of _)P&&typeof R.observe=="function"&&R.observe(P)}else _.length&&dt("shared.autosize.no-resize-observer","ResizeObserver is unavailable; this view was sized once at mount and will not follow its container.");return{refresh:A,get applied(){return nt},release(){if(R&&typeof R.disconnect=="function")try{R.disconnect()}catch{}R=null}}}function Q(l){const _=(l&&Array.isArray(l.targets)?l.targets:[]).filter(Boolean),g=l&&typeof l.read=="function"?l.read:()=>({}),v=l&&typeof l.apply=="function"?l.apply:()=>{},J=Number.isFinite(l&&l.epsilon)?Number(l.epsilon):1;let nt=null,H=!1;const A=tt=>{if(nt==null)return!0;for(const[V,it]of Object.entries(tt)){if(!Number.isFinite(it)||it<=0)continue;const k=nt[V];if(!Number.isFinite(k)||Math.abs(it-k)>=J)return!0}return!1},D=()=>{if(H)return!1;const tt=g();if(!tt||typeof tt!="object"||!Object.values(tt).some(it=>Number.isFinite(it)&&it>0)||!A(tt))return!1;nt={...nt,...tt},H=!0;try{v(tt)}finally{H=!1}return!0};D();const B=_[0],G=l&&l.view||B&&B.ownerDocument&&B.ownerDocument.defaultView||globalThis,R=G&&G.ResizeObserver;let P=null;if(typeof R=="function"&&_.length){P=new R(()=>{D()});for(const tt of _)tt&&typeof P.observe=="function"&&P.observe(tt)}else _.length&&dt("shared.autosize.no-resize-observer","ResizeObserver is unavailable; this view was sized once at mount and will not follow its container.");return{refresh:D,get applied(){return nt},release(){if(P&&typeof P.disconnect=="function")try{P.disconnect()}catch{}P=null}}}}),Et("packages/modules/shared/axislabels.js",function(h,pt){"use strict";Object.defineProperty(h,"CHAR_RATIO",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(h,"BOLD_FACTOR",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(h,"MIN_GAP",{enumerable:!0,get:function(){return at}}),Object.defineProperty(h,"estimateLabelWidth",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"thinLabels",{enumerable:!0,get:function(){return et}});const xt=.62,dt=1.05,at=6;function q(x,Q,l=!1){return String(x??"").length*Q*xt*(l?dt:1)}function et(x,Q){const l=Number.isFinite(Q.gap)?Number(Q.gap):at,_=Number.isFinite(Q.fontSize)?Number(Q.fontSize):11,g=typeof Q.measure=="function"?Q.measure:A=>q(A,_,!!Q.bold),v=x.filter(A=>A&&Number.isFinite(A.at)).map(A=>({...A,width:g(String(A.text??""))})).sort((A,D)=>A.at-D.at);if(v.length<2)return{every:1,kept:v};const J=A=>{let D=null;for(let B=0;B<v.length;B+=A){const G=v[B];if(D&&G.at-D.at<D.width+l)return!1;D=G}return!0};let nt=1;for(;nt<v.length&&!J(nt);)nt++;const H=[];for(let A=0;A<v.length;A+=nt)H.push(v[A]);return{every:nt,kept:H}}}),Et("packages/modules/charts/svg.js",function(h,pt){"use strict";Object.defineProperty(h,"SVG_NS",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(h,"el",{enumerable:!0,get:function(){return at}}),Object.defineProperty(h,"svg",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"attr",{enumerable:!0,get:function(){return et}}),Object.defineProperty(h,"attrs",{enumerable:!0,get:function(){return x}}),Object.defineProperty(h,"setText",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(h,"clear",{enumerable:!0,get:function(){return l}}),Object.defineProperty(h,"append",{enumerable:!0,get:function(){return _}}),Object.defineProperty(h,"path",{enumerable:!0,get:function(){return g}}),Object.defineProperty(h,"ribbonPath",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"round",{enumerable:!0,get:function(){return J}}),Object.defineProperty(h,"pathRings",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(h,"insideRings",{enumerable:!0,get:function(){return H}});const xt="http://www.w3.org/2000/svg";function dt(A){const D=A.indexOf(")");return D<0?A:A.slice(D+1).trim()||"#0072b2"}function at(A,D,B){const G=A.createElement(D);return B&&G.setAttribute("class",B),G}function q(A,D,B){const G=A.createElementNS(xt,D);if(B)for(const R of Object.keys(B))G.setAttribute(R,String(B[R]));return G}function et(A,D,B){if(!A)return;if(B==null){A.removeAttribute(D);return}let G=String(B);G.startsWith("url(#")&&(D==="stroke"||D==="fill"&&A.localName==="text")&&(G=dt(G)),A.setAttribute(D,G)}function x(A,D){if(A)for(const B of Object.keys(D))et(A,B,D[B])}function Q(A,D){A&&(A.textContent=D==null?"":String(D))}function l(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}function _(A,D){for(const B of D)B&&A.appendChild(B);return A}function g(A){return A.join(" ")}function v(A){if(!A||A.length<2)return"";const D=["M",A[0].x,A[0].upper];for(let B=1;B<A.length;B++)D.push("L",A[B].x,A[B].upper);for(let B=A.length-1;B>=0;B--)D.push("L",A[B].x,A[B].lower);return D.push("Z"),g(D)}function J(A){return Math.round(A*100)/100}function nt(A){const D=[];let B=[];const G=String(A||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let R="",P=[];const tt=()=>{if(!R||!P.length){P=[];return}if(R==="M"||R==="L")for(let V=0;V+1<P.length;V+=2)B.push([P[V],P[V+1]]);else R!=="Z"&&P.length>=2&&B.push([P[P.length-2],P[P.length-1]]);P=[]};for(const V of G){if(/[A-Za-z]/.test(V)){if(tt(),V==="Z"||V==="z"){B.length>2&&D.push(B),B=[],R="";continue}V==="M"&&B.length>2&&(D.push(B),B=[]),R=V;continue}P.push(Number(V))}return tt(),B.length>2&&D.push(B),D}function H(A,D,B){let G=!1;for(const R of A)for(let P=0,tt=R.length-1;P<R.length;tt=P++){const[V,it]=R[P],[k,f]=R[tt];it>B!=f>B&&D<(k-V)*(B-it)/(f-it||1e-12)+V&&(G=!G)}return G}}),Et("packages/modules/charts/scale.js",function(h,pt){"use strict";Object.defineProperty(h,"isNumber",{enumerable:!0,get:function(){return l}}),Object.defineProperty(h,"toNumber",{enumerable:!0,get:function(){return _}}),Object.defineProperty(h,"toTime",{enumerable:!0,get:function(){return g}}),Object.defineProperty(h,"extent",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"niceStep",{enumerable:!0,get:function(){return J}}),Object.defineProperty(h,"niceDomain",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(h,"measureDomain",{enumerable:!0,get:function(){return H}}),Object.defineProperty(h,"linearTicks",{enumerable:!0,get:function(){return A}}),Object.defineProperty(h,"timeStepFor",{enumerable:!0,get:function(){return D}}),Object.defineProperty(h,"timeTicks",{enumerable:!0,get:function(){return G}}),Object.defineProperty(h,"linearScale",{enumerable:!0,get:function(){return R}}),Object.defineProperty(h,"timeScale",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"key",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(h,"bandScale",{enumerable:!0,get:function(){return V}}),Object.defineProperty(h,"sqrtScale",{enumerable:!0,get:function(){return it}});const xt=[1,2,2.5,5,10],dt=6e4,at=36e5,q=864e5,et=365.25*q,x=[1,2,5,10,20,25,50,100],Q=[1,5,10,25,50,100,250,500,1e3,5e3,15e3,3e4,dt,5*dt,15*dt,30*dt,at,3*at,6*at,12*at,q,2*q,7*q,14*q,30*q,90*q,180*q,...x.map(k=>k*et)];function l(k){return typeof k=="number"&&Number.isFinite(k)}function _(k){if(k==null||k==="")return null;if(k instanceof Date){const N=k.getTime();return Number.isFinite(N)?N:null}if(typeof k=="boolean")return k?1:0;const f=Number(k);return Number.isFinite(f)?f:null}function g(k){if(k==null||k==="")return null;if(k instanceof Date){const N=k.getTime();return Number.isFinite(N)?N:null}if(typeof k=="number")return Number.isFinite(k)?k:null;const f=Date.parse(String(k));return Number.isFinite(f)?f:null}function v(k){let f=1/0,N=-1/0;for(let Z=0;Z<k.length;Z++){const L=k[Z];l(L)&&(L<f&&(f=L),L>N&&(N=L))}return f===1/0?null:{min:f,max:N}}function J(k){if(!(k>0))return 1;const f=10**Math.floor(Math.log10(k));for(const N of xt)if(k<=N*f)return N*f;return 10*f}function nt(k,f=5){const N=J((k.max-k.min)/Math.max(1,f));return{min:Math.floor(k.min/N)*N,max:Math.ceil(k.max/N)*N,step:N}}function H(k,f={}){const N=v(k)||{min:0,max:1};let{min:Z,max:L}=N;if(f.zero&&(Z>0&&(Z=0),L<0&&(L=0)),Z===L){const st=Math.abs(Z)>0?Math.abs(Z)/10:1;Z-=st,L+=st}if(f.nice!==!1){const st=nt({min:Z,max:L},f.ticks||5);Z=st.min,L=st.max}return l(f.min)&&(Z=f.min),l(f.max)&&(L=f.max),Z===L&&(L=Z+1),{min:Z,max:L}}function A(k,f=5){const N=J((k.max-k.min)/Math.max(1,f)),Z=Math.ceil(k.min/N),L=Math.floor(k.max/N),st=[];for(let j=Z;j<=L;j++){const K=j*N;st.push(Math.abs(K)<N/1e6?0:Number(K.toPrecision(12)))}return st}function D(k,f=5){const N=Math.max(1,f),Z=k/N;let L=Q[Q.length-1];for(const K of Q)if(K>=Z){L=K;break}if(L<et)return L;let st=L,j=Math.abs(k/L-N);for(const K of Q){if(K<et)continue;const u=Math.abs(k/K-N);u<j&&(j=u,st=K)}return st}function B(k,f){const N=new Date(k.min).getUTCFullYear();let Z=Math.ceil(N/f)*f;Date.UTC(Z,0,1)<k.min&&(Z+=f);const L=[];for(;Date.UTC(Z,0,1)<=k.max;Z+=f)L.push(Date.UTC(Z,0,1));return L}function G(k,f=5){const N=D(k.max-k.min,f);if(N>=et)return B(k,Math.round(N/et));const Z=[],L=Math.ceil(k.min/N)*N;for(let st=L;st<=k.max;st+=N)Z.push(st);return Z}function R(k,f){const N=k.max-k.min||1,[Z,L]=f;return{kind:"linear",domain:k,range:f,of(st){return Z+(st-k.min)/N*(L-Z)},invert(st){return k.min+(st-Z)/(L-Z||1)*N},ticks(st=5){return A(k,st)}}}function P(k,f){return{...R(k,f),kind:"time",ticks(Z=5){return G(k,Z)}}}function tt(k){if(k==null)return" null";if(k instanceof Date)return` date:${k.getTime()}`;if(typeof k=="object"){const f=k,N=f.id??f.key??f.value;return N!==void 0&&typeof N!="object"?` obj:${String(N)}`:` obj:${String(k)}`}return String(k)}function V(k,f,N=.2){const Z=Math.min(.9,Math.max(0,N)),[L,st]=f,j=new Map;for(let F=0;F<k.length;F++){const y=tt(k[F]);j.has(y)||j.set(y,F)}const K=k.length?(st-L)/k.length:st-L,u=Math.max(0,K*(1-Z));return{kind:"band",domain:k,range:f,bandwidth:u,step:K,of(F){const y=j.get(tt(F));return y===void 0?NaN:L+y*K+(K-u)/2},centre(F){const y=this.of(F);return Number.isNaN(y)?NaN:y+u/2},ticks(){return k}}}function it(k,f){const[N,Z]=f,L=Math.max(Math.abs(k.max),Math.abs(k.min),0)||1;return{kind:"sqrt",domain:k,range:f,of(st){const j=Math.sqrt(Math.abs(st)/L);return N+j*(Z-N)}}}}),Et("packages/modules/gantt/links.js",function(h,pt){"use strict";Object.defineProperty(h,"LINK_SIDES",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"linkSides",{enumerable:!0,get:function(){return et}}),Object.defineProperty(h,"routeLink",{enumerable:!0,get:function(){return x}}),Object.defineProperty(h,"arrowheadPath",{enumerable:!0,get:function(){return Q}});const xt=pt("packages/modules/charts/svg.js"),dt=xt.path,at=xt.round,q=Object.freeze({FS:Object.freeze({depart:1,arrive:-1}),SS:Object.freeze({depart:-1,arrive:-1}),FF:Object.freeze({depart:1,arrive:1}),SF:Object.freeze({depart:-1,arrive:1})});function et(l){return q[String(l||"FS").toUpperCase()]||q.FS}function x(l){const _=Number(l.sx),g=Number(l.sy),v=Number(l.ex),J=Number(l.ey),nt=Number.isFinite(l.elbow)&&l.elbow>0?Number(l.elbow):8,H=Number.isFinite(l.rowGap)&&l.rowGap>0?Number(l.rowGap):nt,A=et(l.type),D=-A.arrive,B=Math.abs(J-g)<.5,G=(v-_)*D;if(B&&G>0)return{d:dt(["M",at(_),at(g),"H",at(v)]),arrowDir:D,route:"straight"};if(G>=0)return{d:dt(["M",at(_),at(g),"V",at(J),"H",at(v)]),arrowDir:D,route:"drop"};const R=B?g+H:(g+J)/2,P=_+A.depart*nt,tt=v+A.arrive*nt;return{d:dt(["M",at(_),at(g),"H",at(P),"V",at(R),"H",at(tt),"V",at(J),"H",at(v)]),arrowDir:D,route:"detour"}}function Q(l,_,g,v=4){return dt(["M",at(l),at(_),"L",at(l-g*v),at(_-v),"L",at(l-g*v),at(_+v),"Z"])}}),Et("packages/modules/gantt/messages.js",function(h,pt){"use strict";Object.defineProperty(h,"FALLBACK_EN",{enumerable:!0,get:function(){return at}}),Object.defineProperty(h,"createTranslator",{enumerable:!0,get:function(){return q}});const dt=pt("packages/core/src/internal/util.js").isFunction,at=Object.freeze({"gantt.lag":"+{days}d","gantt.lead":"{days}d","gantt.a11y.moved":"{name} moved to {date}","gantt.a11y.day":"day {day}","gantt.a11y.resized":"{name} resized to {days} days","gantt.a11y.linkFrom":"Linking from {name}. Focus the successor and press L.","gantt.a11y.linked":"Linked {from} to {to}, finish to start.","gantt.a11y.linkCancelled":"Link cancelled.","gantt.a11y.deleted":"{name} deleted.","gantt.workload.title":"Resource workload","gantt.workload.resource":"Resource","gantt.workload.total":"Total","gantt.workload.unassigned":"Unassigned","gantt.workload.cell":"{hours} h from {date}","gantt.workload.over":"{hours} h from {date}, over a capacity of {capacity} h","gantt.workload.expand":"Show {name}’s tasks","gantt.workload.collapse":"Hide {name}’s tasks","gantt.row.expand":"Expand {name}","gantt.row.collapse":"Collapse {name}","gantt.resource.over":"{name} — over-allocated","gantt.a11y.hoursSet":"{name}: {hours} h from {date}","gantt.a11y.hoursCleared":"{name}: no hours from {date}","gantt.a11y.hoursRefused":"{date} is not a working day; {name} was not changed.","gantt.tip.range":"{from} to {to}","gantt.tip.duration":"{days}d","gantt.tip.slack":"slack {days}d"});function q(et,x){return function(l,_){const g=dt(x)?x():null,v=et&&et.grid,J=g&&dt(g.t)&&g||v&&v.messages&&dt(v.messages.t)&&v.messages||null;if(J){let H;try{H=J.t(l,_)}catch{H=null}if(typeof H=="string"&&H&&H!==l)return H}const nt=at[l];return nt?nt.replace(/\{(\w+)\}/g,(H,A)=>_&&A in _?String(_[A]):H):l}}}),Et("packages/modules/gantt/gestures.js",function(h,pt){"use strict";Object.defineProperty(h,"describeTask",{enumerable:!0,get:function(){return at}}),Object.defineProperty(h,"GanttGestures",{enumerable:!0,get:function(){return q}});const dt=pt("packages/modules/charts/svg.js").round;function at(et,x){const Q=et.isSummary?"summary":et.isMilestone?"milestone":"task",l=x.dateAxis===!1?`day ${dt(et.es)} to ${dt(et.ef)}`:`${x.iso(et.es)} to ${x.iso(et.ef)}`,_=[`${et.name}, ${Q}`,l];return et.isMilestone||_.push(`${dt(et.duration)} days`),et.percentComplete!=null&&_.push(`${Math.round(et.percentComplete)}% complete`),_.push(`slack ${dt(et.totalFloat)} days`),et.critical&&_.push("on the critical path"),_.join(", ")}class q{#n;#r=null;#t=null;#e=null;constructor(x){this.#n=x}#o(){return this.#n.options()||{}}get dragging(){return this.#r!==null}#i(){const x=this.#n.plot();if(x&&typeof x.getScreenCTM=="function"){let l=null;try{l=x.getScreenCTM()}catch{l=null}if(l&&Number.isFinite(l.a)&&l.a>0)return{scale:l.a,origin:Number.isFinite(l.e)?l.e:0}}const Q=x&&x.getBoundingClientRect?x.getBoundingClientRect():null;return{scale:1,origin:Q&&Q.left||0}}#u(x){const{scale:Q,origin:l}=this.#i();return((x.clientX||0)-l)/Q}#a(x){const{scale:Q}=this.#i();return Math.round(x/Q/(this.#n.pxPerDay()||1))}onPointerDown(x){const Q=this.#n.controller.schedule;if(!Q||!Q.ok)return;const l=this.#n.rowOf(x.target);if(!l)return;const _=l.getAttribute("data-task"),g=Q.tasks.get(_);if(!g||g.isSummary)return;const v=this.#n.barOf(l);if(!v)return;const J=this.#u(x),nt=Number.isFinite(this.#o().resizeZone)?Number(this.#o().resizeZone):6,H=!g.isMilestone&&J>=this.#y(v)-nt?"resize":"move";this.#r={id:_,mode:H,startX:x.clientX||0,origStart:g.es,origDuration:g.duration,barEl:v},x.preventDefault&&x.preventDefault();const A=B=>this.#s(B),D=B=>this.#N(B);this.#t={move:A,up:D},this.#n.doc.addEventListener("pointermove",A),this.#n.doc.addEventListener("pointerup",D)}#y(x){const Q=parseFloat(x.getAttribute("x")),l=parseFloat(x.getAttribute("width"));return Number.isFinite(Q)&&Number.isFinite(l)?Q+l:Number.POSITIVE_INFINITY}#s(x){if(!this.#r)return;const Q=this.#n.pxPerDay()||1,l=this.#a((x.clientX||0)-this.#r.startX),_=this.#r.barEl;if(this.#r.mode==="move")_.getAttribute("d")?this.#x(_,l*Q):(_.setAttribute("x",dt(parseFloat(_.getAttribute("x"))+l*Q-this.#c(_))),this.#w(_,l*Q));else{const g=Math.max(1,parseFloat(_.getAttribute("width"))+(l*Q-this.#c(_)));_.setAttribute("width",dt(g)),this.#w(_,l*Q)}}#c(x){return parseFloat(x.getAttribute("data-preview")||"0")}#w(x,Q){x.setAttribute("data-preview",String(Q))}#x(x,Q){const l=this.#c(x),_=x.getAttribute("d").split(" ");for(let g=1;g<_.length;g+=1){const v=parseFloat(_[g]);!Number.isNaN(v)&&g%3===1&&(_[g]=String(dt(v+(Q-l))))}x.setAttribute("d",_.join(" ")),this.#w(x,Q)}#N(x){const Q=this.#r;if(this.#g(),this.#r=null,!Q)return;const l=this.#a((x.clientX||0)-Q.startX);if(l===0){this.#n.redraw();return}Q.mode==="move"?this.#n.controller.applyEdit({id:Q.id,start:Q.origStart+l},{writeBack:!0}):this.#n.controller.applyEdit({id:Q.id,duration:Math.max(0,Q.origDuration+l)},{writeBack:!0}),this.#n.redraw()}#g(){this.#t&&(this.#n.doc.removeEventListener("pointermove",this.#t.move),this.#n.doc.removeEventListener("pointerup",this.#t.up),this.#t=null)}onKey(x){const Q=this.#n.controller,l=Q.schedule;if(!l||!l.ok)return;const _=this.#n.rowOf(x.target),g=_?_.getAttribute("data-task"):null,v=g?l.tasks.get(g):null;if(!v)return;const J=this.#o(),nt=Number.isFinite(J.moveStep)?Number(J.moveStep):1,H=x.key,A=this.#n.t;if(H==="ArrowRight"||H==="ArrowLeft"){if(v.isSummary)return;const D=H==="ArrowRight"?1:-1;if(this.#n.focusTask(g),x.shiftKey){if(v.isMilestone)return;const B=Math.max(0,v.duration+D*nt);Q.applyEdit({id:g,duration:B},{writeBack:!0}),this.#n.announce(A("gantt.a11y.resized",{name:v.name,days:B}))}else{const B=v.es+D*nt,G=J.dateAxis===!1?A("gantt.a11y.day",{day:B}):this.#n.iso(B);Q.applyEdit({id:g,start:B},{writeBack:!0}),this.#n.announce(A("gantt.a11y.moved",{name:v.name,date:G}))}x.preventDefault&&x.preventDefault()}else if(H==="l"||H==="L"){if(v.isSummary)return;if(!this.#e)this.#e=g,this.#n.announce(A("gantt.a11y.linkFrom",{name:v.name}));else if(this.#e!==g){const D=this.#e;this.#e=null,this.#n.focusTask(g),Q.setDependencies([...Q.dependencies,{from:D,to:g,type:"FS"}]),this.#n.announce(A("gantt.a11y.linked",{from:D,to:v.name}))}x.preventDefault&&x.preventDefault()}else if(H==="Delete"||H==="Backspace"){if(v.isSummary)return;Q.deleteTask(g),this.#n.announce(A("gantt.a11y.deleted",{name:v.name})),x.preventDefault&&x.preventDefault()}else H==="Escape"&&this.#e&&(this.#e=null,this.#n.announce(A("gantt.a11y.linkCancelled")))}destroy(){this.#g(),this.#r=null,this.#e=null}}}),Et("packages/modules/gantt/render.js",function(h,pt){"use strict";Object.defineProperty(h,"NS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(h,"GanttView",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(h,"mountGantt",{enumerable:!0,get:function(){return wt}});const dt=pt("packages/core/src/internal/util.js").warnOnce,at=pt("packages/modules/shared/autosize.js"),q=at.contentWidth,et=at.firstMeasured,x=at.watchSize,l=pt("packages/modules/shared/axislabels.js").thinLabels,_=pt("packages/modules/charts/svg.js"),g=_.svg,v=_.el,J=_.setText,nt=_.path,H=_.round,D=pt("packages/modules/charts/scale.js").linearScale,B=pt("packages/modules/gantt/time.js"),G=B.toISODate,R=B.fromDayNumber,P=B.toDayNumber,tt=B.resolveProjectEpoch,V=pt("packages/modules/gantt/links.js"),it=V.routeLink,k=V.arrowheadPath,N=pt("packages/modules/gantt/schedule.js").EPS,Z=pt("packages/modules/gantt/messages.js"),L=Z.createTranslator,st=pt("packages/modules/gantt/gestures.js"),j=st.GanttGestures,K=st.describeTask;Object.defineProperty(h,"FALLBACK_EN",{enumerable:!0,get:function(){return Z.FALLBACK_EN}});const u="lat-gantt",F="data-lat-gantt-styles",y=720,z=Object.freeze({messages:null,width:"container",rowHeight:26,barPadding:4,labelWidth:160,axisHeight:22,rightPadding:16,rowLabels:!0,showArrows:!0,showCritical:!0,showProgress:!0,hoverChain:!0,dateAxis:!0,label:"name",today:null,nonWorking:null,editable:!0,resizeZone:6,zoom:null,projectEpoch:null,scrollToToday:!1,tooltip:!0,groupBy:null,keyboard:!0,moveStep:1}),o=11,U=Object.freeze({day:{px:28,step:1,level:"day"},week:{px:12,step:7,level:"week"},month:{px:4,step:30,level:"month"},quarter:{px:1.6,step:91,level:"quarter"}});function W(){return`
8
8
  .${u}{font:12px/1.4 system-ui,sans-serif;color:var(--lattice-foreground,#1f2933);overflow:auto}
9
9
  .${u}__plot{max-width:100%;height:auto;display:block}